diff --git a/.claude/commands/code-review.md b/.claude/commands/code-review.md new file mode 100644 index 00000000..6f4aedac --- /dev/null +++ b/.claude/commands/code-review.md @@ -0,0 +1,259 @@ +--- +allowed-tools: Bash, Read, Grep, Glob +description: Review uncommitted changes following WordPress PHP, React, and CSS best practices +argument-hint: "[--staged]" +author: Daniel Mejta +--- + +# Code Review Command + +Performs comprehensive code review of uncommitted changes following best practices for WordPress PHP development, React components, and CSS styles. Outputs actionable recommendations with severity ratings and an overall quality score. + +## Usage + +Review all uncommitted changes: +``` +/code-review +``` + +Review only staged changes: +``` +/code-review --staged +``` + +## Review Criteria + +### WordPress PHP Best Practices +- **WordPress Coding Standards (WPCS)**: Spacing, indentation, naming conventions +- **Security**: Proper data escaping (esc_html, esc_attr, esc_url, wp_kses), nonce verification, capability checks +- **Performance**: Efficient database queries, proper caching, avoiding n+1 queries +- **Hooks**: Proper use of actions and filters, appropriate priorities +- **Internationalization**: Proper use of translation functions with correct text domain +- **Error Handling**: Proper exception handling, WP_Error usage +- **Documentation**: PHPDoc blocks for classes, methods, and complex functions +- **Namespace**: Proper PSR-4 autoloading and namespace usage +- **Sanitization**: Proper input sanitization and validation + +### React Best Practices +- **Component Structure**: Proper component composition, single responsibility +- **Hooks**: Correct use of useState, useEffect, useCallback, useMemo +- **Props**: Clear prop types, proper destructuring, avoiding prop drilling +- **Performance**: Unnecessary re-renders, missing dependency arrays, key props +- **Accessibility**: ARIA attributes, semantic HTML, keyboard navigation +- **State Management**: Appropriate state location, avoiding derived state +- **Error Boundaries**: Proper error handling in components +- **Code Organization**: Clear naming, consistent patterns, DRY principles + +### CSS Best Practices +- **Naming**: BEM methodology or consistent naming convention +- **Specificity**: Avoiding overly specific selectors, !important usage +- **Organization**: Logical grouping, consistent ordering of properties +- **Responsiveness**: Mobile-first approach, appropriate breakpoints +- **Accessibility**: Focus states, color contrast, screen reader compatibility +- **Performance**: Efficient selectors, avoiding layout thrashing +- **Modern CSS**: Using CSS custom properties, grid, flexbox appropriately +- **Browser Compatibility**: Considering vendor prefixes and fallbacks + +## Instructions + +Follow these steps to perform the code review: + +### 1. Identify Changed Files + +Use Bash to get the list of uncommitted changes: +```bash +# For all changes (default) +git status --short + +# For staged changes only +git diff --cached --name-only +``` + +If no changes are found, inform the user and exit. + +### 2. Get File Contents and Changes + +For each changed file: +- Use `git diff` (or `git diff --cached` for staged) to see the actual changes +- Use Read tool to get full file context if needed +- Focus review on the changed lines and their surrounding context + +### 3. Analyze by File Type + +**For PHP files** (*.php): +- Check WordPress Coding Standards compliance +- Look for security vulnerabilities (unescaped output, SQL injection, XSS) +- Verify proper sanitization and validation +- Check for proper internationalization +- Review hook usage and priorities +- Verify PHPDoc documentation +- Check namespace and class structure + +**For JavaScript/JSX files** (*.js, *.jsx): +- Review React component structure and patterns +- Check hooks usage and dependencies +- Look for performance issues +- Verify accessibility attributes +- Check for proper error handling +- Review state management patterns +- Verify consistent code style + +**For CSS/SCSS files** (*.css, *.scss): +- Review naming conventions +- Check selector specificity +- Verify responsive design approach +- Check accessibility (focus states, contrast) +- Review property organization +- Look for performance anti-patterns +- Check for modern CSS usage + +### 4. Categorize Issues by Severity + +**CRITICAL** (Score impact: -3 points each) +- Security vulnerabilities (XSS, SQL injection, CSRF) +- Data loss potential +- Breaking changes without fallbacks +- Accessibility violations preventing usage + +**HIGH** (Score impact: -2 points each) +- Performance issues causing significant slowdowns +- Missing error handling in critical paths +- WordPress Coding Standards violations affecting functionality +- Improper hook priorities causing conflicts +- Missing or incorrect internationalization + +**MEDIUM** (Score impact: -1 point each) +- Code style inconsistencies +- Missing documentation +- Non-optimal performance patterns +- Minor accessibility improvements +- Code organization issues + +**LOW** (Score impact: -0.5 points each) +- Minor style suggestions +- Code readability improvements +- Non-critical refactoring opportunities +- Documentation enhancements + +### 5. Calculate Overall Score + +Start with a base score of 10: +- Subtract points based on severity (see above) +- Minimum score is 1 +- Round to nearest 0.5 + +**Score Interpretation**: +- 9.0-10.0: Excellent - Production ready +- 7.0-8.5: Good - Minor improvements recommended +- 5.0-6.5: Fair - Several issues to address +- 3.0-4.5: Needs Work - Significant issues present +- 1.0-2.5: Critical - Major issues must be fixed + +### 6. Format Output + +Present the review in this structure: + +``` +# Code Review Results + +## Overview +- Files reviewed: [count] +- Total issues: [count] +- Overall score: [X.X/10] - [interpretation] + +## Issues by Severity + +### CRITICAL (count) +1. [File:Line] - [Issue description] + Recommendation: [Specific fix] + +### HIGH (count) +... + +### MEDIUM (count) +... + +### LOW (count) +... + +## Summary +[Brief summary of main concerns and positive aspects] + +## Next Steps +[Prioritized action items] +``` + +## Error Handling + +- If git is not available, inform the user +- If no changes detected, confirm with user that working tree is clean +- If a file cannot be read, note it and continue with other files +- If diff is too large, focus on changed sections rather than full file analysis +- If encountering binary files, skip with a note + +## Performance Considerations + +- For large diffs (>1000 lines), provide a warning and option to continue +- Focus on changed lines and immediate context (±5 lines) +- Use Grep for pattern matching rather than reading entire large files +- Process files in parallel when checking for common patterns + +## Examples + +### Example Output + +``` +# Code Review Results + +## Overview +- Files reviewed: 5 +- Total issues: 8 +- Overall score: 7.5/10 - Good + +## Issues by Severity + +### CRITICAL (1) +1. src/Admin.php:45 - Unescaped output in admin interface + Recommendation: Use esc_html() when outputting $user_name to prevent XSS + +### HIGH (2) +1. assets/components/Field.js:23 - Missing dependency in useEffect + Recommendation: Add 'value' to dependency array to prevent stale closures + +2. src/Integration.php:78 - Direct database query without prepare() + Recommendation: Use $wpdb->prepare() to prevent SQL injection + +### MEDIUM (3) +1. assets/styles/field.scss:15 - Using px instead of rem for font-size + Recommendation: Use rem units for better accessibility + +2. src/Helper.php:102 - Missing PHPDoc block + Recommendation: Add @param and @return documentation + +3. assets/components/Label.js:10 - Prop types not defined + Recommendation: Add PropTypes or use TypeScript + +### LOW (2) +1. assets/styles/layout.scss:45 - Consider using CSS custom properties + Recommendation: Replace hardcoded colors with CSS variables + +2. src/Options.php:200 - Consider extracting method for better readability + Recommendation: Extract validation logic into separate method + +## Summary +The code is generally well-structured and follows most best practices. The critical XSS vulnerability should be addressed immediately. React hooks usage needs attention to prevent subtle bugs. CSS could benefit from more modern patterns. + +## Next Steps +1. Fix XSS vulnerability in Admin.php (CRITICAL) +2. Add missing useEffect dependency (HIGH) +3. Refactor database query to use prepare() (HIGH) +4. Address remaining medium and low priority items in subsequent iterations +``` + +## Notes + +- This command analyzes code quality but does not make changes +- For automatic fixes, consider using separate commands like /phpcbf for PHP +- Review is opinionated based on WordPress and React best practices +- Scores are relative to the codebase being reviewed, not absolute measures +- Consider running phpcs and npm lint commands for automated checks first diff --git a/CHANGELOG.md b/CHANGELOG.md index a71e728c..a042b71d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [4.5.0] - 2026-02-17 + +### Added +- `collapse` prop for MultiGroup field to control item collapsibility +- `wrapper` field type for visual grouping of fields without value nesting +- `columns` field type for multi-column grid layout +- `FieldFactory` class for programmatic field creation +- `setTitle` support for all field components + +### Changed +- Removed React portals and render fields inside a single app container +- Switched field layout to CSS grid +- Cleaned up CSS/SCSS styles and React classnames +- Wrapped root fields in container div for layout targeting +- Applied flex layout to app instance fields wrapper +- Rewrote README with comprehensive field types, examples, and integration reference +- Standardized all 57 field type docs with consistent template + +### Fixed +- Active tab now preserved after saving options page +- Grid layout for fields without label text +- Explicit props now properly override spread props in Label and FieldComponent + ## [4.4.2] - 2026-02-05 ### Fixed diff --git a/CLAUDE.md b/CLAUDE.md index 46992395..268dc1fd 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,152 +1,151 @@ # CLAUDE.md -This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. - -## Build/Test Commands -- Start dev server: `npm run start` -- Build for production: `npm run build` -- Analyze bundle: `npm run build:analyze` -- PHP code standards check: `composer run phpcs` -- PHP code beautifier: `composer run phpcbf` - -## Code Style Guidelines -- PHP: WordPress Coding Standards (WPCS) with customizations in phpcs.xml -- PHP version: 8.1+ -- WordPress version: 6.2+ -- JS: Use WordPress scripts standards -- Prefix PHP globals with `wpifycf` -- Translation text domain: `wpify-custom-fields` -- React components use PascalCase -- JS helpers use camelCase -- Namespace: `Wpify\CustomFields` -- PHP class files match class name (PSR-4) -- Import paths: Use `@` alias for assets directory in JS -- Error handling: Use custom exceptions in `Exceptions` directory -- Documentation is in PHPDoc format and in docs folder in md format -- When generating PHP code, always use WordPress Coding Standards - -## Extending Field Types -To create a custom field type, the following components are required: - -1. **PHP Filters**: - - `wpifycf_sanitize_{type}` - For sanitizing field values - - `wpifycf_wp_type_{type}` - To specify WordPress data type (integer, number, boolean, object, array, string) - - `wpifycf_default_value_{type}` - To define default values - -2. **JavaScript Components**: - - Create a React component for the field - - Add validation method to the component (`YourComponent.checkValidity`) - - Register the field via `addFilter('wpifycf_field_{type}', 'wpify_custom_fields', () => YourComponent)` - -3. **Multi-field Types**: - - Custom field types can have multi-versions by prefixing with `multi_` - - Leverage the existing `MultiField` component for implementation - - Use `checkValidityMultiFieldType` helper for validation - -4. **Field Component Structure**: - - Field components receive props like `id`, `htmlId`, `onChange`, `value`, etc. - - CSS classes should follow pattern: `wpifycf-field-{type}` - - Return JSX with appropriate HTML elements - -## Documentation Standards -When writing or updating documentation: - -### PHP Code Examples -- Use tabs for indentation, not spaces -- Follow WordPress Coding Standards for all PHP examples: - - Add spaces inside parentheses for conditions: `if ( ! empty( $var ) )` - - Add spaces after control structure keywords: `if (...) {` - - Add spaces around logical operators: `$a && $b`, `! $condition` - - Add spaces around string concatenation: `$a . ' ' . $b` - - Add spaces for function parameters: `function_name( $param1, $param2 )` - - Use proper array formatting with tabs for indentation: - ```php - array( - 'key1' => 'value1', - 'key2' => 'value2', - ) - ``` - - Maintain consistent spacing around array arrow operators: `'key' => 'value'` - - Use spaces in associative array access: `$array[ 'key' ]` - -### Documentation Structure for Field Types -Field type documentation should follow this consistent structure: -1. **Title and Description** - Clear explanation of the field's purpose -2. **Field Type Definition** - Example code following WordPress coding standards -3. **Properties Section**: - - Default field properties - - Specific properties unique to the field type -4. **Stored Value** - Explanation of how data is stored in the database -5. **Example Usage** - Real-world examples with WordPress coding standards -6. **Notes** - Important details about the field's behavior and uses - -### Documentation Structure for Integrations -Integration documentation should follow this consistent structure: -1. **Title and Overview** - Clear explanation of the integration's purpose -2. **Requirements** - Any specific plugins or dependencies required (if applicable) -3. **Usage Example** - PHP code example following WordPress coding standards -4. **Parameters Section**: - - Required parameters with descriptions - - Optional parameters with descriptions and default values -5. **Data Storage** - How and where the integration stores its data -6. **Retrieving Data** - How to access stored data programmatically -7. **Advanced Usage** - Examples of tabs, conditional display, etc. (as applicable) - -### Security in Examples -- Always include proper data escaping in examples: - - `esc_html()` for plain text output - - `esc_attr()` for HTML attributes - - `esc_url()` for URLs - - `wp_kses()` for allowing specific HTML - -### Consistency -- Maintain consistent terminology across all documentation files -- Use consistent formatting for property descriptions -- Keep parameter documentation format consistent: `name` _(type)_ - description -- When documenting integrations, use consistent parameter naming and structure - -### Integration-Specific Notes -- For WooCommerce integrations, always mention compatibility with HPOS when applicable -- Product Options integrations should list common tab IDs from WooCommerce -- Order and Subscription integrations should include examples of retrieving meta -- All integration documentation should include examples of tabs and conditional display -- When documenting options pages, always include proper menu/page configuration - -### File Organization -- Field type documentation goes in `docs/field-types/` -- Integration documentation goes in `docs/integrations/` -- Feature documentation goes in `docs/features/` -- All documentation files should use `.md` extension -- Main index files (integrations.md, field-types.md) should link to all related docs - -## Conditional Fields -The plugin provides a robust conditional logic system for dynamically showing/hiding fields: - -### Condition Structure -Each condition requires: -- `field`: The ID of the field to check (can use path references) -- `condition`: The comparison operator -- `value`: The value to compare against - -### Available Operators -- `==`: Equal (default) -- `!=`: Not equal -- `>`, `>=`, `<`, `<=`: Comparison operators -- `between`: Value is between two numbers, inclusive -- `contains`, `not_contains`: String contains/doesn't contain value -- `in`, `not_in`: Value is/isn't in an array -- `empty`, `not_empty`: Value is/isn't empty - -### Multiple Conditions -- Combine with `'and'` (default) or `'or'` between conditions -- Create nested condition groups with sub-arrays for complex logic - -### Path References -- Dot notation for nested fields: `parent.child` -- Hash symbols for relative paths: `#` (parent), `##` (grandparent) -- Array access: `multi_field[0]` for specific items - -### Technical Implementation -- Conditional logic lives in `Field.js`, `hooks.js` (useConditions), and `functions.js` -- Hidden fields are still submitted but have `data-hide-field="true"` attribute -- Conditions are evaluated in real-time as users interact with the form +## Project Overview + +WPify Custom Fields — WordPress plugin providing 58 field types across 15 integration points (metaboxes, options pages, taxonomy terms, users, WooCommerce products/orders/coupons, Gutenberg blocks, etc.). PHP 8.1+ / WordPress 6.2+ / React 18. + +Entry point: `custom-fields.php` → singleton `wpify_custom_fields()` returns `CustomFields` instance. + +## Directory Structure + +``` +src/ # PHP source (PSR-4: Wpify\CustomFields) + CustomFields.php # Main class — factory methods, sanitization, type mapping + Api.php # REST API endpoints (/wpifycf/v1/) + FieldFactory.php # Fluent PHP API for building field definitions + Helpers.php # URL fetching, post/term queries, file operations + Fields/ # PHP field type handlers (DirectFileField) + Integrations/ # All 15 integration classes + Exceptions/ # MissingArgumentException, CustomFieldsException +assets/ # JS/React source (@ alias in imports) + custom-fields.js # Entry point — bootstraps React apps from DOM containers + components/ # Shared: App, Field, AppContext, MultiField, GutenbergBlock, Tabs, Label, etc. + fields/ # 59 field type React components + helpers/ # hooks.js, functions.js, validators.js, field-types.js, generators.js + styles/ # SCSS with CSS custom properties and container queries +docs/ # Markdown documentation (field-types/, integrations/, features/) +build/ # Webpack output (generated) +``` + +## Build Commands + +- Dev server: `npm run start` +- Production build: `npm run build` +- Bundle analysis: `npm run build:analyze` +- PHP code standards: `composer run phpcs` +- PHP auto-fix: `composer run phpcbf` + +## Architecture + +### PHP Integration Class Hierarchy + +``` +BaseIntegration (abstract) +│ normalize_items(), enqueue(), register_rest_options() +│ +├── OptionsIntegration (abstract) +│ │ print_app(), prepare_items_for_js(), get/set_field(), set_fields_from_post_request() +│ │ +│ ├── Options — Admin menu pages (get_option / update_option) +│ ├── SiteOptions — Multisite network options +│ ├── WooCommerceSettings — WC settings tabs +│ │ +│ └── ItemsIntegration (abstract) +│ │ Adds get_item_id() for item-bound storage +│ │ +│ ├── Metabox — Post meta boxes +│ ├── Taxonomy — Term meta fields +│ ├── User — User profile fields +│ ├── Comment — Comment meta +│ ├── MenuItem — Nav menu item meta +│ ├── ProductOptions — WC product data tabs +│ ├── ProductVariationOptions — WC product variations +│ ├── CouponOptions — WC coupon fields +│ ├── OrderMetabox — WC orders (HPOS compatible) +│ ├── SubscriptionMetabox — WC Subscriptions +│ └── WcMembershipPlanOptions — WC Memberships +│ +└── GutenbergBlock — Block attributes, server-side rendering, InnerBlocks +``` + +### Data Flow: PHP → JavaScript + +1. **Normalize** — `normalize_items()` adds IDs, global_ids, resolves type aliases, registers async option endpoints +2. **Prepare** — `prepare_items_for_js()` builds input names, fetches current values from DB +3. **Render** — `print_app()` outputs a `.wpifycf-app-instance` container with all field data in `data-fields` JSON attribute +4. **Bootstrap** — JS entry reads `data-fields`, creates React root with `AppContextProvider` +5. **Render tree** — `App` → `RootFields` → `Field` (dispatcher) → specific field component +6. **Submit** — Hidden `` elements carry values; PHP `set_fields_from_post_request()` sanitizes and saves +7. **Gutenberg** — Uses controlled state (`attributes` / `setAttributes`) instead of form submission + +### Key JS Components + +- **`Field.js`** — Central dispatcher: resolves type to component via `getFieldComponentByType()`, evaluates conditions (`useConditions`), runs validation (`checkValidity`), handles generators +- **`AppContext.js`** — Global state provider: values, fields, tabs, config. Supports both controlled (Gutenberg) and uncontrolled (form) modes +- **`MultiField.js`** — Generic repeater: add/remove/reorder (Sortable.js), min/max constraints. All `multi_*` types are thin wrappers around this +- **`GutenbergBlock.js`** — View/Edit mode toggle, server-side block rendering, InnerBlocks via HTML comment replacement +- **`functions.js`** — `evaluateConditions()`, `getValueByPath()` (dot notation + relative `#`/`##` paths), `interpolateFieldValues()` +- **`validators.js`** — `checkValidityStringType`, `checkValidityNumberType`, `checkValidityGroupType`, `checkValidityMultiFieldType()` factory +- **`hooks.js`** — `useConditions`, `useMulti`, `usePosts`, `useTerms`, `useOptions`, `useMediaLibrary`, `useValidity`, `useSortableList` + +## Code Style + +- **PHP**: WordPress Coding Standards (WPCS) — see `phpcs.xml` for project customizations +- **JS**: WordPress scripts standards via `@wordpress/scripts` +- **CSS**: SCSS, BEM-style with `wpifycf-` prefix, CSS custom properties (`--wpifycf-*`), container queries on `.wpifycf-app-instance` and `.wpifycf-field__control` +- **Naming**: PHP namespace `Wpify\CustomFields` (PSR-4), React components PascalCase, JS helpers camelCase +- **Prefix**: PHP globals `wpifycf`, text domain `wpify-custom-fields` +- **JS imports**: `@` alias = `assets/` directory +- **Docs**: PHPDoc in code, markdown in `docs/`. Follow WordPress Coding Standards in PHP examples (tabs, spaces in parentheses/functions). Always escape output: `esc_html()`, `esc_attr()`, `esc_url()`, `wp_kses()` + +## Key Patterns + +### Integration Lifecycle +- **Render**: `normalize_items()` → `prepare_items_for_js()` → `print_app(context, tabs, attrs, items)` +- **Save**: `normalize_items()` → `set_fields_from_post_request(items)` +- **Register meta**: `normalize_items()` → `flatten_items()` → `register_{type}_meta()` per field + +### Field Type Aliases (backward compatibility) +`switch` → `toggle`, `multiswitch` → `multi_toggle`, `multiselect` → `multi_select`, `colorpicker` → `color`, `gallery` → `multi_attachment`, `repeater` → `multi_group` + +### PHP Extensibility Filters +- `wpifycf_sanitize_{type}` — custom sanitization +- `wpifycf_wp_type_{type}` — WordPress data type mapping (integer, number, boolean, object, array, string) +- `wpifycf_default_value_{type}` — default values +- `wpifycf_items` — filter normalized items + +### JS Extensibility Filters (@wordpress/hooks) +- `wpifycf_field_{type}` — register custom field component +- `wpifycf_definition` — filter field definitions before render +- `wpifycf_generator_{name}` — auto-generate field values (e.g., UUID) + +### Extending Field Types +- **PHP**: Register `wpifycf_sanitize_{type}`, `wpifycf_wp_type_{type}`, `wpifycf_default_value_{type}` filters +- **JS**: Create component in `assets/fields/`, add static `checkValidity(value, field)` method, register with `addFilter('wpifycf_field_{type}', ...)` +- **Multi-version**: Wrap with `MultiField`, use `checkValidityMultiFieldType(type)` helper +- Full guide: `docs/features/extending.md` + +### Conditional Logic +Conditions array with operators (`==`, `!=`, `>`, `>=`, `<`, `<=`, `between`, `contains`, `not_contains`, `in`, `not_in`, `empty`, `not_empty`), `and`/`or` combinators, nested groups, relative path refs (`#` parent, `##` grandparent). Hidden fields still submit values with `data-hide-field="true"`. Full docs: `docs/features/conditions.md` + +### Validation +Field components export static `checkValidity(value, field)` → array of error strings. Form submission blocked if errors. Validators in `assets/helpers/validators.js`. Full docs: `docs/features/validation.md` + +## Documentation + +When writing or updating docs in `docs/`: +- Follow existing templates — consistent structure for field types, integrations, and features (see any existing file as reference) +- PHP examples: WordPress Coding Standards with tabs, spaces in parentheses/functions +- Always escape output in examples (`esc_html()`, `esc_attr()`, `esc_url()`, `wp_kses()`) +- Parameter format: `name` _(type)_ — description +- File organization: `docs/field-types/`, `docs/integrations/`, `docs/features/` + +## Self-Maintenance + +When your changes invalidate or create gaps in this file, update it as part of the same task. Typical triggers: +- Build commands or scripts change +- New integrations, field types, or major features are added +- Class hierarchy or data flow changes +- File/directory structure changes + +Keep updates minimal, match existing style, do not add session-specific or speculative content. diff --git a/assets/components/App.js b/assets/components/App.js index c9b71504..6ac8981a 100644 --- a/assets/components/App.js +++ b/assets/components/App.js @@ -10,10 +10,8 @@ export function App ({ form }) { const { validity, validate, handleValidityChange } = useValidity({ form }); const renderOptions = useMemo(() => ({ - noFieldWrapper: ['options', 'edit_term', 'add_term'].includes(context), - noControlWrapper: false, isRoot: true, - }), [context]); + }), []); const filteredFields = applyFilters('wpifycf_definition', fields, values, { context }); diff --git a/assets/components/ControlWrapper.js b/assets/components/ControlWrapper.js index dc0006bd..6db09066 100644 --- a/assets/components/ControlWrapper.js +++ b/assets/components/ControlWrapper.js @@ -1,21 +1,8 @@ -import { useContext } from 'react'; -import { AppContext } from '@/components/AppContext';; - export function ControlWrapper ({ renderOptions = {}, children }) { - const { context } = useContext(AppContext); - if (renderOptions.noControlWrapper) { return children; } - if (context === 'edit_term' && renderOptions.isRoot) { - return ( - - {children} - - ); - } - return (
{children} diff --git a/assets/components/Field.js b/assets/components/Field.js index b1b5d8e9..c7f3b7ab 100644 --- a/assets/components/Field.js +++ b/assets/components/Field.js @@ -8,13 +8,12 @@ import { useContext, useEffect, useMemo } from 'react'; import { FieldWrapper } from '@/components/FieldWrapper'; import { ControlWrapper } from '@/components/ControlWrapper'; import { FieldDescription } from '@/components/FieldDescription'; -import { getFieldComponentByType, maybePortal } from '@/helpers/functions'; +import { getFieldComponentByType } from '@/helpers/functions'; import { AppContext } from '@/components/AppContext'; export function Field ({ type, name, - node, renderOptions, description, value, @@ -75,37 +74,21 @@ export function Field ({ ...(props.render_options || {}), }; - if (combinedRenderOptions.noLabel && combinedRenderOptions.isRoot) { - const closestTd = node?.closest('td'); - const closestTr = closestTd?.closest('tr'); - const closestTh = closestTr?.querySelector(':scope > th'); - - if (closestTd) { - closestTd.setAttribute('colspan', 2); - } - - if (closestTh) { - closestTh.remove(); - } - } - - return maybePortal(isHidden + return isHidden ? hiddenField : ( - ), node); + ); } diff --git a/assets/components/FieldDescription.js b/assets/components/FieldDescription.js index ed99481e..ca2d48a1 100644 --- a/assets/components/FieldDescription.js +++ b/assets/components/FieldDescription.js @@ -1,31 +1,13 @@ import clsx from 'clsx'; -import { useContext } from 'react'; -import { AppContext } from '@/components/AppContext';; export function FieldDescription({ - renderOptions = {}, description, descriptionPosition }) { - const { context } = useContext(AppContext); - if (! description) { return null; } - if (['edit_term', 'user', 'add_term'].includes(context) && renderOptions.isRoot) { - return ( -

- ); - } - return (

; + } - const markup = ( + return ( ); - - if (['options', 'site-options', 'user'].includes(context) && node) { - return maybePortal(markup, node.closest('tr')?.querySelector('th')); - } - - if (context === 'edit_term' && renderOptions.isRoot) { - return ( - - {markup} - - ); - } - - return markup; } diff --git a/assets/components/MultiField.js b/assets/components/MultiField.js index eed20d63..cb4e28c2 100644 --- a/assets/components/MultiField.js +++ b/assets/components/MultiField.js @@ -57,7 +57,7 @@ export function MultiField ({
)} -
+
( - null} - /> - )); + return ( +
+ {fields.map(field => ( + null} + /> + ))} +
+ ); } diff --git a/assets/custom-fields.js b/assets/custom-fields.js index 8622dffb..375e9add 100644 --- a/assets/custom-fields.js +++ b/assets/custom-fields.js @@ -17,10 +17,7 @@ import { AppContextProvider } from '@/components/AppContext'; function loadCustomFields (config) { addStyleSheet(config.stylesheet); document.querySelectorAll('.wpifycf-app-instance[data-loaded=false][data-instance="' + config.instance + '"]').forEach(container => { - const nodes = Array.from(document.querySelectorAll('.wpifycf-field-instance[data-instance="' + config.instance + '"][data-integration-id="' + container.dataset.integrationId + '"]')); - const defs = nodes.map(node => { - return { ...JSON.parse(node.dataset.item), node }; - }); + const defs = JSON.parse(container.dataset.fields || '[]'); const fields = defs.map(({ value, ...props }) => props); const initialValues = defs.reduce((acc, { id, value }) => ({ ...acc, [id]: value }), {}); diff --git a/assets/fields/Checkbox.js b/assets/fields/Checkbox.js index d6d6fd37..f23ae545 100644 --- a/assets/fields/Checkbox.js +++ b/assets/fields/Checkbox.js @@ -1,4 +1,4 @@ -import { useCallback } from 'react'; +import { useCallback, useEffect } from 'react'; import clsx from 'clsx'; import { addFilter } from '@wordpress/hooks'; import { checkValidityBooleanType } from '@/helpers/validators'; @@ -15,13 +15,14 @@ function Checkbox ({ disabled = false, setTitle, }) { + useEffect(() => { + if (typeof setTitle === 'function') { + setTitle(value ? stripHtml(title) : ''); + } + }, [setTitle, value, title]); + const handleChange = useCallback(event => { onChange(event.target.checked); - if (event.target.checked) { - setTitle(stripHtml(title)); - } else { - setTitle(''); - } }, [onChange]); return ( diff --git a/assets/fields/Code.js b/assets/fields/Code.js index d58b3f4c..d319930d 100644 --- a/assets/fields/Code.js +++ b/assets/fields/Code.js @@ -13,6 +13,7 @@ import { xml } from '@codemirror/lang-xml'; import { json } from '@codemirror/lang-json'; import { EditorView } from '@codemirror/view' import { checkValidityStringType } from '@/helpers/validators'; +import { useFieldTitle } from '@/helpers/hooks'; export function Code ({ id, @@ -24,7 +25,9 @@ export function Code ({ attributes = {}, className, disabled = false, + setTitle, }) { + useFieldTitle(setTitle, value ? String(value).substring(0, 50) : ''); const extensions = [EditorView.lineWrapping]; const languageExtension = getLanguageExtension(language); diff --git a/assets/fields/Color.js b/assets/fields/Color.js index ba55d88e..0cb3cc38 100644 --- a/assets/fields/Color.js +++ b/assets/fields/Color.js @@ -2,6 +2,7 @@ import { useCallback } from 'react'; import clsx from 'clsx'; import { addFilter } from '@wordpress/hooks'; import { checkValidityStringType } from '@/helpers/validators'; +import { useFieldTitle } from '@/helpers/hooks'; function Color ({ id, @@ -11,7 +12,9 @@ function Color ({ attributes = {}, disabled = false, className, + setTitle, }) { + useFieldTitle(setTitle, value); const handleChange = useCallback(event => onChange(event.target.value), [onChange]); return ( diff --git a/assets/fields/Columns.js b/assets/fields/Columns.js new file mode 100644 index 00000000..8ec21f6a --- /dev/null +++ b/assets/fields/Columns.js @@ -0,0 +1,141 @@ +import { useCallback, useContext, useEffect, useRef, useState } from 'react'; +import clsx from 'clsx'; +import { Field } from '@/components/Field'; +import { AppContext } from '@/components/AppContext'; + +const noop = () => null; + +function useContainerWidth (ref) { + const [width, setWidth] = useState(0); + + useEffect(() => { + if (!ref.current) return; + + const observer = new ResizeObserver(entries => { + for (const entry of entries) { + setWidth(entry.contentBoxSize?.[0]?.inlineSize ?? entry.contentRect.width); + } + }); + + observer.observe(ref.current); + + return () => observer.disconnect(); + }, [ref]); + + return width; +} + +function Columns ({ + id, + htmlId, + items = [], + columns = 2, + gap, + classname, + attributes = {}, + disabled = false, + fieldPath, + parentValue, + parentOnChange, + setTitleFactory, + validity = [], +}) { + const containerRef = useRef(null); + const containerWidth = useContainerWidth(containerRef); + const { values, updateValue } = useContext(AppContext); + const isInsideGroup = typeof parentOnChange === 'function'; + + // Strip columns' own segment from fieldPath so children get paths relative to the parent. + const parentFieldPath = fieldPath ? fieldPath.split('.').slice(0, -1).join('.') : ''; + + const fieldValidity = validity?.reduce((acc, item) => typeof item === 'object' ? { ...acc, ...item } : acc, {}); + + const handleChange = useCallback( + id => fieldValue => parentOnChange && parentOnChange({ ...parentValue, [id]: fieldValue }), + [parentValue, parentOnChange] + ); + + const effectiveColumns = containerWidth > 0 + ? Math.max(1, Math.min(columns, Math.floor(containerWidth / 300))) + : columns; + + const isCollapsed = effectiveColumns < columns; + + const style = { + '--wpifycf-columns': effectiveColumns, + ...(gap ? { '--wpifycf-columns-gap': gap } : {}), + }; + + return ( +
+ {items.map(field => { + const childFieldPath = parentFieldPath + ? `${parentFieldPath}.${field.id}` + : field.id; + + const itemStyle = {}; + + if (!isCollapsed) { + const col = field.column ? Math.min(field.column, effectiveColumns) : null; + const span = field.column_span ? Math.min(field.column_span, col ? effectiveColumns - col + 1 : effectiveColumns) : null; + + if (col && span) { + itemStyle.gridColumn = `${col} / span ${span}`; + } else if (col) { + itemStyle.gridColumn = col; + } else if (span) { + itemStyle.gridColumn = `span ${span}`; + } + } + + if (isInsideGroup) { + return ( +
+ +
+ ); + } + + return ( +
+ +
+ ); + })} +
+ ); +} + +Columns.renderOptions = { + noLabel: true, + noFieldWrapper: true, + noControlWrapper: true, +}; + +export default Columns; diff --git a/assets/fields/Date.js b/assets/fields/Date.js index 5f0272ec..61ea71c5 100644 --- a/assets/fields/Date.js +++ b/assets/fields/Date.js @@ -2,6 +2,7 @@ import { useCallback } from 'react'; import clsx from 'clsx'; import { addFilter } from '@wordpress/hooks'; import { checkValidityDateTimeType } from '@/helpers/validators'; +import { useFieldTitle } from '@/helpers/hooks'; export function Date ({ id, @@ -13,7 +14,9 @@ export function Date ({ max, disabled = false, className, + setTitle, }) { + useFieldTitle(setTitle, value); const handleChange = useCallback(event => onChange(event.target.value), [onChange]); return ( diff --git a/assets/fields/DateRange.js b/assets/fields/DateRange.js index 5a2faa3c..8268963e 100644 --- a/assets/fields/DateRange.js +++ b/assets/fields/DateRange.js @@ -1,6 +1,7 @@ import { useCallback } from 'react'; import clsx from 'clsx'; import { checkValidityDateRangeType } from '@/helpers/validators'; +import { useFieldTitle } from '@/helpers/hooks'; export function DateRange ({ id, @@ -12,12 +13,15 @@ export function DateRange ({ max, disabled = false, className, + setTitle, }) { // Normalize value to array format internally const normalizedValue = Array.isArray(value) ? value : [null, null]; const startDate = normalizedValue[0] || ''; const endDate = normalizedValue[1] || ''; + useFieldTitle(setTitle, [startDate, endDate].filter(Boolean).join(' — ')); + // Calculate dynamic min/max constraints // Start date max: the lesser of endDate and max const startMax = endDate && max ? (endDate < max ? endDate : max) : (endDate || max); diff --git a/assets/fields/Datetime.js b/assets/fields/Datetime.js index e6c536d2..e8d8a63f 100644 --- a/assets/fields/Datetime.js +++ b/assets/fields/Datetime.js @@ -2,6 +2,7 @@ import { useCallback } from 'react'; import clsx from 'clsx'; import { addFilter } from '@wordpress/hooks'; import { checkValidityDateTimeType } from '@/helpers/validators'; +import { useFieldTitle } from '@/helpers/hooks'; export function Datetime ({ id, @@ -13,7 +14,9 @@ export function Datetime ({ attributes = {}, disabled = false, className, + setTitle, }) { + useFieldTitle(setTitle, value); const handleChange = useCallback(event => onChange(event.target.value), [onChange]); return ( diff --git a/assets/fields/DirectFile.js b/assets/fields/DirectFile.js index 2416bf37..fcf8352d 100644 --- a/assets/fields/DirectFile.js +++ b/assets/fields/DirectFile.js @@ -3,9 +3,9 @@ import { useState, useRef } from '@wordpress/element'; import { Button, Icon, Spinner } from '@wordpress/components'; import { upload as uploadIcon, trash as trashIcon, page as pageIcon } from '@wordpress/icons'; import { checkValidityStringType } from '../helpers/validators'; -import { useDirectFileUpload, useDirectFileInfo } from '../helpers/hooks'; +import { useDirectFileUpload, useDirectFileInfo, useFieldTitle } from '../helpers/hooks'; -function DirectFile({ id, htmlId, value, onChange, required, allowed_types, max_size, ...props }) { +function DirectFile({ id, htmlId, value, onChange, required, allowed_types, max_size, setTitle, ...props }) { const [uploading, setUploading] = useState(false); const [progress, setProgress] = useState(0); const [error, setError] = useState(null); @@ -14,6 +14,9 @@ function DirectFile({ id, htmlId, value, onChange, required, allowed_types, max_ const uploadMutation = useDirectFileUpload(); const fileInfo = useDirectFileInfo(value); + const fileName = value && typeof value === 'string' ? value.split('/').pop() : ''; + useFieldTitle(setTitle, fileName); + const formatFileSize = (bytes) => { if (!bytes) return ''; const sizes = ['B', 'KB', 'MB', 'GB']; @@ -123,7 +126,7 @@ function DirectFile({ id, htmlId, value, onChange, required, allowed_types, max_ /> {!hasFile && !uploading && ( -
+
diff --git a/assets/fields/Html.js b/assets/fields/Html.js index fd0ce1ce..498da863 100644 --- a/assets/fields/Html.js +++ b/assets/fields/Html.js @@ -12,7 +12,7 @@ function Html ({ return ( Failed to render HTML field
}>
diff --git a/assets/fields/InnerBlocks.js b/assets/fields/InnerBlocks.js index 8254d103..d7233a09 100644 --- a/assets/fields/InnerBlocks.js +++ b/assets/fields/InnerBlocks.js @@ -10,7 +10,7 @@ export function InnerBlocks({ orientation, }) { return ( -
+
{ - if (value.longitude && value.latitude) { - setTitle(`${value.longitude}:${value.latitude}`); - } else { - setTitle(''); + if (typeof setTitle === 'function') { + setTitle(value.longitude && value.latitude ? `${value.longitude}:${value.latitude}` : ''); } - }, [value]); + }, [value, setTitle]); return (
@@ -336,7 +334,7 @@ function AutoComplete ({ value, onChange, apiKey, lang, setCenter }) { onClick={() => handleSelect(index)} onMouseOver={() => handleMouseOver(index)} onMouseOut={() => setActive(null)} - className={index === active ? 'active' : ''} + className={index === active ? 'wpifycf-field-mapycz__suggestion--active' : ''} > {suggestion.name} diff --git a/assets/fields/Month.js b/assets/fields/Month.js index ef3f5869..a505a261 100644 --- a/assets/fields/Month.js +++ b/assets/fields/Month.js @@ -2,6 +2,7 @@ import { useCallback } from 'react'; import clsx from 'clsx'; import { addFilter } from '@wordpress/hooks'; import { checkValidityStringType } from '@/helpers/validators'; +import { useFieldTitle } from '@/helpers/hooks'; export function Month ({ id, @@ -13,7 +14,9 @@ export function Month ({ max, disabled = false, className, + setTitle, }) { + useFieldTitle(setTitle, value); const handleChange = useCallback(event => onChange(event.target.value), [onChange]); return ( diff --git a/assets/fields/MultiAttachment.js b/assets/fields/MultiAttachment.js index 4bdfca08..1d800a9d 100644 --- a/assets/fields/MultiAttachment.js +++ b/assets/fields/MultiAttachment.js @@ -1,7 +1,7 @@ import { useCallback, useEffect, useState, useRef } from 'react'; -import { __ } from '@wordpress/i18n'; +import { __, _n, sprintf } from '@wordpress/i18n'; import { AttachmentItem } from '@/fields/Attachment'; -import { useSortableList, useMediaLibrary } from '@/helpers/hooks'; +import { useSortableList, useMediaLibrary, useFieldTitle } from '@/helpers/hooks'; import { Button } from '@/components/Button'; import clsx from 'clsx'; import { addFilter } from '@wordpress/hooks'; @@ -14,7 +14,9 @@ function MultiAttachment ({ onChange, className, disabled = false, + setTitle, }) { + useFieldTitle(setTitle, Array.isArray(value) && value.length > 0 ? sprintf(_n('%d attachment', '%d attachments', value.length, 'wpify-custom-fields'), value.length) : ''); useEffect(() => { if (!Array.isArray(value)) { onChange([]); diff --git a/assets/fields/MultiCheckbox.js b/assets/fields/MultiCheckbox.js index d0f5f14d..2515c09b 100644 --- a/assets/fields/MultiCheckbox.js +++ b/assets/fields/MultiCheckbox.js @@ -1,6 +1,8 @@ -import { useCallback } from 'react' +import { useCallback, useMemo } from 'react' import { addFilter } from '@wordpress/hooks' import { checkValidityMultiBooleanType } from '@/helpers/validators' +import { useFieldTitle } from '@/helpers/hooks' +import { stripHtml } from '@/helpers/functions' import clsx from 'clsx' function MultiCheckbox ({ @@ -12,7 +14,18 @@ function MultiCheckbox ({ attributes = {}, disabled = false, className, + setTitle, }) { + const titleValue = useMemo(() => { + if (!Array.isArray(value) || value.length === 0 || !options) return ''; + const labels = value.slice(0, 3).map(v => { + const opt = options.find(o => o.value === v); + return opt ? stripHtml(opt.label) : v; + }).filter(Boolean); + if (value.length > 3) return labels.join(', ') + ` (+${value.length - 3})`; + return labels.join(', '); + }, [value, options]); + useFieldTitle(setTitle, titleValue); const handleChange = useCallback(optionValue => event => { const nextValue = Array.isArray(value) ? [...value] : [] diff --git a/assets/fields/MultiDirectFile.js b/assets/fields/MultiDirectFile.js index 16d796e9..1cd049c9 100644 --- a/assets/fields/MultiDirectFile.js +++ b/assets/fields/MultiDirectFile.js @@ -1,8 +1,8 @@ import { useCallback, useEffect, useState, useRef } from 'react'; -import { __, sprintf } from '@wordpress/i18n'; +import { __, _n, sprintf } from '@wordpress/i18n'; import { Button, Icon, Spinner } from '@wordpress/components'; import { upload as uploadIcon, trash as trashIcon, page as pageIcon } from '@wordpress/icons'; -import { useSortableList, useDirectFileUpload, useDirectFileInfo } from '@/helpers/hooks'; +import { useSortableList, useDirectFileUpload, useDirectFileInfo, useFieldTitle } from '@/helpers/hooks'; import { IconButton } from '@/components/IconButton'; import clsx from 'clsx'; import { checkValidityMultiNonZeroType } from '@/helpers/validators'; @@ -44,56 +44,56 @@ function DirectFileItem({ file, onRemove, disabled }) { const isDownloadable = getFileUrl() !== null; return ( -
{!disabled && ( -
+
)} -
+
{file.uploading ? ( -
+
-
+
- + {__('Uploading...', 'wpify-custom-fields')} {Math.round(file.progress || 0)}%
) : ( -
+
-
-
+
+
{isDownloadable ? ( {getFileName()} ) : ( - + {getFileName()} )} {!disabled && ( -
+
)}
- {file.path} + {file.path} {(file.size || fileInfo?.data?.size) && ( - + {formatFileSize(file.size || fileInfo?.data?.size)} )} @@ -101,7 +101,7 @@ function DirectFileItem({ file, onRemove, disabled }) {
)} {file.error && ( -
+
{file.error}
)} @@ -118,7 +118,10 @@ function MultiDirectFile({ disabled = false, allowed_types, max_size, + setTitle, }) { + useFieldTitle(setTitle, Array.isArray(value) && value.length > 0 ? sprintf(_n('%d file', '%d files', value.length, 'wpify-custom-fields'), value.length) : ''); + useEffect(() => { if (!Array.isArray(value)) { onChange([]); @@ -204,7 +207,7 @@ function MultiDirectFile({ items: files, setItems: onSortEnd, disabled, - dragHandle: '.wpifycf-multi-direct-file-item__sort', + dragHandle: '.wpifycf-field-multi-direct-file__item__sort', }); const formatFileSize = (bytes) => { @@ -366,7 +369,7 @@ function MultiDirectFile({ )} {files.length > 0 && ( -
+
{files.map((file) => ( { - return props.items.reduce((acc, item) => { + return flattenWrapperItems(props.items).reduce((acc, item) => { acc[item.id] = item.default; return acc; }, {}); }, [props.items]); + const [titles, setTitles] = useState(() => { + if (!Array.isArray(value)) { + return []; + } + return value.map(() => ''); + }); + + const handleSetTitle = useCallback(index => title => { + setTitles(prev => { + if (prev[index] === title) return prev; + const next = [...prev]; + next[index] = title; + return next; + }); + }, []); + + const handleMutate = useCallback(({ type, ...args }) => { + setTitles(prev => { + switch (type) { + case 'sort': + return args.indexMap.map(oldIdx => prev[oldIdx] || ''); + case 'remove': { + const next = [...prev]; + next.splice(args.index, 1); + return next; + } + case 'duplicate': { + const next = [...prev]; + next.splice(args.index, 0, prev[args.index]); + return next; + } + case 'add': + return [...prev, '']; + default: + return prev; + } + }); + }, []); + const { add, remove, @@ -57,26 +97,12 @@ function MultiGroup ({ defaultValue, disabled_buttons, disabled, + collapse, dragHandle: '.wpifycf__move-handle', + onMutate: handleMutate, }); const fieldsValidity = validity?.reduce((acc, item) => typeof item === 'object' ? { ...acc, ...item } : acc, {}); - const [titles, setTitles] = useState(() => { - if (!Array.isArray(value)) { - return []; - } - return value.map((val, index) => '#' + (index + 1)); - }); - - const handleSetTitle = useCallback(index => title => { - if (titles[index] !== title) { - setTitles(titles => { - const nextTitles = [...titles]; - nextTitles[index] = title; - return nextTitles; - }); - } - }, [titles, setTitles]); return (
@@ -86,17 +112,18 @@ function MultiGroup ({ className={clsx( 'wpifycf-field-multi-group__item', collapsed[index] && 'wpifycf-field-multi-group__item--collapsed', + !collapse && 'wpifycf-field-multi-group__item--not-collapsible', fieldsValidity[index] && 'wpifycf-field-multi-group__item--invalid', )} key={keyPrefix + '.' + index} >
{canMove && ( -
+
)} -
+
{titles[index] || `#${index + 1}`}
diff --git a/assets/fields/MultiPost.js b/assets/fields/MultiPost.js index 906c3818..611315e3 100644 --- a/assets/fields/MultiPost.js +++ b/assets/fields/MultiPost.js @@ -1,8 +1,9 @@ import { addFilter } from '@wordpress/hooks'; import { useCallback, useEffect } from 'react'; +import { __, _n, sprintf } from '@wordpress/i18n'; import { PostSelect } from '@/components/PostSelect'; import { PostPreview } from '@/fields/Post'; -import { useMulti, usePosts } from '@/helpers/hooks'; +import { useMulti, usePosts, useFieldTitle } from '@/helpers/hooks'; import { checkValidityMultiNonZeroType } from '@/helpers/validators'; import clsx from 'clsx'; @@ -13,7 +14,10 @@ export function MultiPost ({ post_type: postType, className, disabled = false, + setTitle, }) { + useFieldTitle(setTitle, Array.isArray(value) && value.length > 0 ? sprintf(_n('%d post', '%d posts', value.length, 'wpify-custom-fields'), value.length) : ''); + useEffect(() => { if (!Array.isArray(value)) { onChange([]); diff --git a/assets/fields/MultiSelect.js b/assets/fields/MultiSelect.js index 30b55c38..d5ddb6c6 100644 --- a/assets/fields/MultiSelect.js +++ b/assets/fields/MultiSelect.js @@ -1,6 +1,6 @@ import { addFilter } from '@wordpress/hooks'; import { Select as SelectControl } from '@/components/Select.js'; -import { useMulti, useOptions, useOtherFieldValues } from '@/helpers/hooks'; +import { useMulti, useOptions, useOtherFieldValues, useFieldTitle } from '@/helpers/hooks'; import { useCallback, useEffect, useMemo, useState } from 'react'; import { IconButton } from '@/components/IconButton'; import { checkValidityMultiStringType } from '@/helpers/validators'; @@ -18,6 +18,7 @@ export function MultiSelect ({ disabled, async_params: asyncParams = {}, fieldPath, + setTitle, }) { useEffect(() => { if (!Array.isArray(value)) { @@ -85,6 +86,14 @@ export function MultiSelect ({ [realOptions, value], ); + const titleValue = useMemo(() => { + if (!Array.isArray(value) || value.length === 0) return ''; + const labels = value.slice(0, 3).map(v => allOptions[v] || v).filter(Boolean); + if (value.length > 3) return labels.join(', ') + ` (+${value.length - 3})`; + return labels.join(', '); + }, [value, allOptions]); + useFieldTitle(setTitle, titleValue); + const { containerRef, remove diff --git a/assets/fields/MultiTerm.js b/assets/fields/MultiTerm.js index 501554bb..b1e4b2b1 100644 --- a/assets/fields/MultiTerm.js +++ b/assets/fields/MultiTerm.js @@ -1,5 +1,5 @@ -import { useTerms } from '@/helpers/hooks'; -import { __ } from '@wordpress/i18n'; +import { useTerms, useFieldTitle } from '@/helpers/hooks'; +import { __, _n, sprintf } from '@wordpress/i18n'; import { MultiSelect } from '@/fields/MultiSelect'; import { CategoryTree } from '@/fields/Term'; import { useMemo } from 'react'; @@ -15,7 +15,10 @@ export function MultiTerm ({ onChange, className, disabled = false, + setTitle, }) { + useFieldTitle(setTitle, Array.isArray(value) && value.length > 0 ? sprintf(_n('%d term', '%d terms', value.length, 'wpify-custom-fields'), value.length) : ''); + const { data: terms, isError, isFetching } = useTerms({ taxonomy }); const termOptions = useMemo( diff --git a/assets/fields/MultiToggle.js b/assets/fields/MultiToggle.js index ea1e531c..31ec61bf 100644 --- a/assets/fields/MultiToggle.js +++ b/assets/fields/MultiToggle.js @@ -1,7 +1,9 @@ -import { useCallback } from 'react' +import { useCallback, useMemo } from 'react' import { addFilter } from '@wordpress/hooks' import { ToggleControl } from '@wordpress/components' import { checkValidityMultiBooleanType } from '@/helpers/validators' +import { useFieldTitle } from '@/helpers/hooks' +import { stripHtml } from '@/helpers/functions' import clsx from 'clsx' function MultiToggle ({ @@ -12,7 +14,17 @@ function MultiToggle ({ options, className, disabled = false, + setTitle, }) { + const titleValue = useMemo(() => { + if (!Array.isArray(value) || value.length === 0 || !options) return ''; + return value + .map(v => options.find(o => o.value === v)) + .filter(Boolean) + .map(o => stripHtml(o.label)) + .join(', '); + }, [value, options]); + useFieldTitle(setTitle, titleValue); const handleChange = useCallback(optionValue => checked => { const nextValue = Array.isArray(value) ? [...value] : [] diff --git a/assets/fields/Number.js b/assets/fields/Number.js index 90ceea90..da5374a2 100644 --- a/assets/fields/Number.js +++ b/assets/fields/Number.js @@ -2,6 +2,7 @@ import { useCallback } from 'react'; import clsx from 'clsx'; import { addFilter } from '@wordpress/hooks'; import { checkValidityNumberType } from '@/helpers/validators'; +import { useFieldTitle } from '@/helpers/hooks'; export function NumberInput ({ id, @@ -14,7 +15,9 @@ export function NumberInput ({ attributes = {}, className, disabled = false, + setTitle, }) { + useFieldTitle(setTitle, value); const handleChange = useCallback(event => onChange(Number(event.target.value)), [onChange]); return ( diff --git a/assets/fields/Password.js b/assets/fields/Password.js index cc84c9df..edbbf6bc 100644 --- a/assets/fields/Password.js +++ b/assets/fields/Password.js @@ -2,6 +2,7 @@ import { useCallback } from 'react'; import clsx from 'clsx'; import { addFilter } from '@wordpress/hooks'; import { checkValidityStringType } from '@/helpers/validators'; +import { useFieldTitle } from '@/helpers/hooks'; function Password ({ id, @@ -11,7 +12,9 @@ function Password ({ attributes = {}, className, disabled = false, + setTitle, }) { + useFieldTitle(setTitle, value ? '••••••' : ''); const handleChange = useCallback(event => onChange(String(event.target.value)), [onChange]); return ( diff --git a/assets/fields/Post.js b/assets/fields/Post.js index d623484a..ab32c238 100644 --- a/assets/fields/Post.js +++ b/assets/fields/Post.js @@ -3,6 +3,7 @@ import { addFilter } from '@wordpress/hooks'; import { PostSelect } from '@/components/PostSelect'; import { IconButton } from '@/components/IconButton'; import { checkValidityNumberType } from '@/helpers/validators'; +import { useFieldTitle } from '@/helpers/hooks'; import clsx from 'clsx'; import defaultThumbnail from '@/images/placeholder-image.svg'; import { stripHtml } from '@/helpers/functions'; @@ -14,8 +15,10 @@ export function Post ({ post_type: postType, className, disabled = false, + setTitle, }) { const [selected, setSelected] = useState(null); + useFieldTitle(setTitle, selected ? stripHtml(selected.title) : ''); const handleDelete = useCallback(() => onChange(null), [onChange]); return ( diff --git a/assets/fields/Radio.js b/assets/fields/Radio.js index 888e8863..c3f4103c 100644 --- a/assets/fields/Radio.js +++ b/assets/fields/Radio.js @@ -1,6 +1,8 @@ -import { useCallback } from 'react'; +import { useCallback, useMemo } from 'react'; import clsx from 'clsx'; import { checkValidityStringType } from '@/helpers/validators'; +import { useFieldTitle } from '@/helpers/hooks'; +import { stripHtml } from '@/helpers/functions'; export function Radio ({ id, @@ -11,7 +13,13 @@ export function Radio ({ attributes = {}, className, disabled = false, + setTitle, }) { + const selectedLabel = useMemo(() => { + const option = options.find(o => (o.value || o) === value); + return option ? stripHtml(option.label || option) : ''; + }, [options, value]); + useFieldTitle(setTitle, selectedLabel); const handleChange = useCallback(event => onChange(event.target.value), [onChange]); return ( diff --git a/assets/fields/Range.js b/assets/fields/Range.js index 75680252..bce08c06 100644 --- a/assets/fields/Range.js +++ b/assets/fields/Range.js @@ -2,6 +2,7 @@ import { useCallback } from 'react'; import clsx from 'clsx'; import { addFilter } from '@wordpress/hooks'; import { checkValidityNumberType } from '@/helpers/validators'; +import { useFieldTitle } from '@/helpers/hooks'; export function Range ({ id, @@ -14,7 +15,9 @@ export function Range ({ attributes = {}, className, disabled = false, + setTitle, }) { + useFieldTitle(setTitle, value); const handleChange = useCallback(event => onChange(Number(event.target.value)), [onChange]); const isValid = !isNaN(parseFloat(value)); diff --git a/assets/fields/Tel.js b/assets/fields/Tel.js index 39f91b33..c177c392 100644 --- a/assets/fields/Tel.js +++ b/assets/fields/Tel.js @@ -4,6 +4,7 @@ import { addFilter } from '@wordpress/hooks'; import PhoneInput from 'react-phone-number-input'; import 'react-phone-number-input/style.css'; import { checkValidityStringType } from '@/helpers/validators'; +import { useFieldTitle } from '@/helpers/hooks'; export function Tel ({ id, @@ -15,7 +16,9 @@ export function Tel ({ default_country: defaultCountry = 'US', className, disabled = false, + setTitle, }) { + useFieldTitle(setTitle, value); useEffect(() => { if (typeof value !== 'string') { onChange(''); diff --git a/assets/fields/Term.js b/assets/fields/Term.js index 30445b24..75447b12 100644 --- a/assets/fields/Term.js +++ b/assets/fields/Term.js @@ -1,10 +1,11 @@ import { addFilter } from '@wordpress/hooks'; -import { useTerms } from '@/helpers/hooks'; -import React, { useState, useEffect, useCallback } from 'react'; +import { useTerms, useFieldTitle } from '@/helpers/hooks'; +import React, { useState, useEffect, useCallback, useMemo } from 'react'; import { IconButton } from '@/components/IconButton'; import { Select } from '@/fields/Select'; import { __ } from '@wordpress/i18n'; import { checkValidityNonZeroIntegerType } from '@/helpers/validators'; +import { stripHtml } from '@/helpers/functions'; import clsx from 'clsx'; function isTermExpanded (category, value) { @@ -21,9 +22,29 @@ export function Term ({ onChange, className, disabled = false, + setTitle, }) { const { data: terms, isError, isFetching } = useTerms({ taxonomy }); + // For CategoryTree path, find the selected term name for setTitle + const hasTree = !isFetching && !isError && terms.length > 0 && terms.some(term => term.children); + const selectedTermName = useMemo(() => { + if (!hasTree || !terms || !value) return null; + const findTerm = (items, id) => { + for (const item of items) { + if (item.id === parseInt(id)) return stripHtml(item.name); + if (item.children) { + const found = findTerm(item.children, id); + if (found) return found; + } + } + return ''; + }; + return findTerm(terms, value); + }, [hasTree, terms, value]); + // When terms form a tree, we handle the title here; otherwise the ",i=document.createElement("div");return i.innerHTML=n,i.firstChild},_addItem:function(t){var e,n=document.createElement("label"),i=this._map.hasLayer(t.layer);t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=i):e=this._createRadioElement("leaflet-base-layers_"+o(this),i),this._layerControlInputs.push(e),e.layerId=o(t.layer),_e(e,"click",this._onInputClick,this);var r=document.createElement("span");r.innerHTML=" "+t.name;var s=document.createElement("span");return n.appendChild(s),s.appendChild(e),s.appendChild(r),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(n),this._checkDisabledLayers(),n},_onInputClick:function(){if(!this._preventClick){var t,e,n=this._layerControlInputs,i=[],r=[];this._handlingClick=!0;for(var o=n.length-1;o>=0;o--)t=n[o],e=this._getLayer(t.layerId).layer,t.checked?i.push(e):t.checked||r.push(e);for(o=0;o=0;r--)t=n[r],e=this._getLayer(t.layerId).layer,t.disabled=void 0!==e.options.minZoom&&ie.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var t=this._section;this._preventClick=!0,_e(t,"click",Ve),this.expand();var e=this;setTimeout((function(){Te(t,"click",Ve),e._preventClick=!1}))}}),Fe=Ye.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",n=re("div",e+" leaflet-bar"),i=this.options;return this._zoomInButton=this._createButton(i.zoomInText,i.zoomInTitle,e+"-in",n,this._zoomIn),this._zoomOutButton=this._createButton(i.zoomOutText,i.zoomOutTitle,e+"-out",n,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),n},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,n,i,r){var o=re("a",n,i);return o.innerHTML=t,o.href="#",o.title=e,o.setAttribute("role","button"),o.setAttribute("aria-label",e),Me(o),_e(o,"click",Xe),_e(o,"click",r,this),_e(o,"click",this._refocusOnMap,this),o},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";he(this._zoomInButton,e),he(this._zoomOutButton,e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||t._zoom===t.getMinZoom())&&(ue(this._zoomOutButton,e),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||t._zoom===t.getMaxZoom())&&(ue(this._zoomInButton,e),this._zoomInButton.setAttribute("aria-disabled","true"))}});De.mergeOptions({zoomControl:!0}),De.addInitHook((function(){this.options.zoomControl&&(this.zoomControl=new Fe,this.addControl(this.zoomControl))}));var He=Ye.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",n=re("div",e),i=this.options;return this._addScales(i,e+"-line",n),t.on(i.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),n},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,n){t.metric&&(this._mScale=re("div",e,n)),t.imperial&&(this._iScale=re("div",e,n))},_update:function(){var t=this._map,e=t.getSize().y/2,n=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(n)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t),n=e<1e3?e+" m":e/1e3+" km";this._updateScale(this._mScale,n,e/t)},_updateImperial:function(t){var e,n,i,r=3.2808399*t;r>5280?(e=r/5280,n=this._getRoundNum(e),this._updateScale(this._iScale,n+" mi",n/e)):(i=this._getRoundNum(r),this._updateScale(this._iScale,i+" ft",i/r))},_updateScale:function(t,e,n){t.style.width=Math.round(this.options.maxWidth*n)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),n=t/e;return e*(n>=10?10:n>=5?5:n>=3?3:n>=2?2:1)}}),Ke=Ye.extend({options:{position:"bottomright",prefix:''+(At.inlineSvg?' ':"")+"Leaflet"},initialize:function(t){d(this,t),this._attributions={}},onAdd:function(t){for(var e in t.attributionControl=this,this._container=re("div","leaflet-control-attribution"),Me(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",(function(){this.removeAttribution(t.layer.getAttribution())}),this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var n=[];this.options.prefix&&n.push(this.options.prefix),t.length&&n.push(t.join(", ")),this._container.innerHTML=n.join(' ')}}});De.mergeOptions({attributionControl:!0}),De.addInitHook((function(){this.options.attributionControl&&(new Ke).addTo(this)}));Ye.Layers=Ge,Ye.Zoom=Fe,Ye.Scale=He,Ye.Attribution=Ke,Be.layers=function(t,e,n){return new Ge(t,e,n)},Be.zoom=function(t){return new Fe(t)},Be.scale=function(t){return new He(t)},Be.attribution=function(t){return new Ke(t)};var Je=_.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Je.addTo=function(t,e){return t.addHandler(e,this),this};var tn={Events:k},en=At.touch?"touchstart mousedown":"mousedown",nn=T.extend({options:{clickTolerance:3},initialize:function(t,e,n,i){d(this,i),this._element=t,this._dragStartTarget=e||t,this._preventOutline=n},enable:function(){this._enabled||(_e(this._dragStartTarget,en,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(nn._dragging===this&&this.finishDrag(!0),Te(this._dragStartTarget,en,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(this._enabled&&(this._moved=!1,!ce(this._element,"leaflet-zoom-anim")))if(t.touches&&1!==t.touches.length)nn._dragging===this&&this.finishDrag();else if(!(nn._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(nn._dragging=this,this._preventOutline&&Se(this._element),ve(),Bt(),this._moving))){this.fire("down");var e=t.touches?t.touches[0]:t,n=xe(this._element);this._startPoint=new C(e.clientX,e.clientY),this._startPos=ye(this._element),this._parentScale=Qe(n);var i="mousedown"===t.type;_e(document,i?"mousemove":"touchmove",this._onMove,this),_e(document,i?"mouseup":"touchend touchcancel",this._onUp,this)}},_onMove:function(t){if(this._enabled)if(t.touches&&t.touches.length>1)this._moved=!0;else{var e=t.touches&&1===t.touches.length?t.touches[0]:t,n=new C(e.clientX,e.clientY)._subtract(this._startPoint);(n.x||n.y)&&(Math.abs(n.x)+Math.abs(n.y)e&&(n.push(t[i]),r=i);return rl&&(o=s,l=a);l>n&&(e[o]=1,hn(t,e,n,i,o),hn(t,e,n,o,r))}function dn(t,e,n,i,r){var o,s,a,l=i?an:fn(t,n),c=fn(e,n);for(an=c;;){if(!(l|c))return[t,e];if(l&c)return!1;a=fn(s=On(t,e,o=l||c,n,r),n),o===l?(t=s,l=a):(e=s,c=a)}}function On(t,e,n,i,r){var o,s,a=e.x-t.x,l=e.y-t.y,c=i.min,u=i.max;return 8&n?(o=t.x+a*(u.y-t.y)/l,s=u.y):4&n?(o=t.x+a*(c.y-t.y)/l,s=c.y):2&n?(o=u.x,s=t.y+l*(u.x-t.x)/a):1&n&&(o=c.x,s=t.y+l*(c.x-t.x)/a),new C(o,s,r)}function fn(t,e){var n=0;return t.xe.max.x&&(n|=2),t.ye.max.y&&(n|=8),n}function pn(t,e){var n=e.x-t.x,i=e.y-t.y;return n*n+i*i}function mn(t,e,n,i){var r,o=e.x,s=e.y,a=n.x-o,l=n.y-s,c=a*a+l*l;return c>0&&((r=((t.x-o)*a+(t.y-s)*l)/c)>1?(o=n.x,s=n.y):r>0&&(o+=a*r,s+=l*r)),a=t.x-o,l=t.y-s,i?a*a+l*l:new C(o,s)}function gn(t){return!m(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function yn(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),gn(t)}function $n(t,e){var n,i,r,o,s,a,l,c;if(!t||0===t.length)throw new Error("latlngs not passed");gn(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var u=X([0,0]),h=M(t);h.getNorthWest().distanceTo(h.getSouthWest())*h.getNorthEast().distanceTo(h.getNorthWest())<1700&&(u=sn(t));var d=t.length,O=[];for(n=0;ni){l=(o-i)/r,c=[a.x-l*(a.x-s.x),a.y-l*(a.y-s.y)];break}var p=e.unproject(R(c));return X([p.lat+u.lat,p.lng+u.lng])}var vn={__proto__:null,simplify:cn,pointToSegmentDistance:un,closestPointOnSegment:function(t,e,n){return mn(t,e,n)},clipSegment:dn,_getEdgeIntersection:On,_getBitCode:fn,_sqClosestPointOnSegment:mn,isFlat:gn,_flat:yn,polylineCenter:$n},bn={project:function(t){return new C(t.lng,t.lat)},unproject:function(t){return new V(t.y,t.x)},bounds:new E([-180,-90],[180,90])},Sn={R:6378137,R_MINOR:6356752.314245179,bounds:new E([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var e=Math.PI/180,n=this.R,i=t.lat*e,r=this.R_MINOR/n,o=Math.sqrt(1-r*r),s=o*Math.sin(i),a=Math.tan(Math.PI/4-i/2)/Math.pow((1-s)/(1+s),o/2);return i=-n*Math.log(Math.max(a,1e-10)),new C(t.lng*e*n,i)},unproject:function(t){for(var e,n=180/Math.PI,i=this.R,r=this.R_MINOR/i,o=Math.sqrt(1-r*r),s=Math.exp(-t.y/i),a=Math.PI/2-2*Math.atan(s),l=0,c=.1;l<15&&Math.abs(c)>1e-7;l++)e=o*Math.sin(a),e=Math.pow((1-e)/(1+e),o/2),a+=c=Math.PI/2-2*Math.atan(s*e)-a;return new V(a*n,t.x*n/i)}},wn={__proto__:null,LonLat:bn,Mercator:Sn,SphericalMercator:N},xn=e({},j,{code:"EPSG:3395",projection:Sn,transformation:function(){var t=.5/(Math.PI*Sn.R);return D(t,.5,-t,.5)}()}),Qn=e({},j,{code:"EPSG:4326",projection:bn,transformation:D(1/180,1,-1/180,.5)}),Pn=e({},W,{projection:bn,transformation:D(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var n=e.lng-t.lng,i=e.lat-t.lat;return Math.sqrt(n*n+i*i)},infinite:!0});W.Earth=j,W.EPSG3395=xn,W.EPSG3857=Y,W.EPSG900913=B,W.EPSG4326=Qn,W.Simple=Pn;var kn=T.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[o(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[o(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var n=this.getEvents();e.on(n,this),this.once("remove",(function(){e.off(n,this)}),this)}this.onAdd(e),this.fire("add"),e.fire("layeradd",{layer:this})}}});De.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=o(t);return this._layers[e]||(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this},removeLayer:function(t){var e=o(t);return this._layers[e]?(this._loaded&&t.onRemove(this),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return o(t)in this._layers},eachLayer:function(t,e){for(var n in this._layers)t.call(e,this._layers[n]);return this},_addLayers:function(t){for(var e=0,n=(t=t?m(t)?t:[t]:[]).length;ethis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()=2&&e[0]instanceof V&&e[0].equals(e[n-1])&&e.pop(),e},_setLatLngs:function(t){Xn.prototype._setLatLngs.call(this,t),gn(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return gn(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,n=new C(e,e);if(t=new E(t.min.subtract(n),t.max.add(n)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var i,r=0,o=this._rings.length;rt.y!=i.y>t.y&&t.x<(i.x-n.x)*(t.y-n.y)/(i.y-n.y)+n.x&&(c=!c);return c||Xn.prototype._containsPoint.call(this,t,!0)}});var Wn=Cn.extend({initialize:function(t,e){d(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,n,i,r=m(t)?t:t.features;if(r){for(e=0,n=r.length;e0&&r.push(r[0].slice()),r}function Yn(t,n){return t.feature?e({},t.feature,{geometry:n}):Bn(n)}function Bn(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}var Gn={toGeoJSON:function(t){return Yn(this,{type:"Point",coordinates:Un(this.getLatLng(),t)})}};function Fn(t,e){return new Wn(t,e)}An.include(Gn),Vn.include(Gn),Mn.include(Gn),Xn.include({toGeoJSON:function(t){var e=!gn(this._latlngs);return Yn(this,{type:(e?"Multi":"")+"LineString",coordinates:Dn(this._latlngs,e?1:0,!1,t)})}}),qn.include({toGeoJSON:function(t){var e=!gn(this._latlngs),n=e&&!gn(this._latlngs[0]),i=Dn(this._latlngs,n?2:e?1:0,!0,t);return e||(i=[i]),Yn(this,{type:(n?"Multi":"")+"Polygon",coordinates:i})}}),Tn.include({toMultiPoint:function(t){var e=[];return this.eachLayer((function(n){e.push(n.toGeoJSON(t).geometry.coordinates)})),Yn(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(t){var e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===e)return this.toMultiPoint(t);var n="GeometryCollection"===e,i=[];return this.eachLayer((function(e){if(e.toGeoJSON){var r=e.toGeoJSON(t);if(n)i.push(r.geometry);else{var o=Bn(r);"FeatureCollection"===o.type?i.push.apply(i,o.features):i.push(o)}}})),n?Yn(this,{geometries:i,type:"GeometryCollection"}):{type:"FeatureCollection",features:i}}});var Hn=Fn,Kn=kn.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,n){this._url=t,this._bounds=M(e),d(this,n)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(ue(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){oe(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&ae(this._image),this},bringToBack:function(){return this._map&&le(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=M(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t="IMG"===this._url.tagName,e=this._image=t?this._url:re("img");ue(e,"leaflet-image-layer"),this._zoomAnimated&&ue(e,"leaflet-zoom-animated"),this.options.className&&ue(e,this.options.className),e.onselectstart=l,e.onmousemove=l,e.onload=i(this.fire,this,"load"),e.onerror=i(this._overlayOnError,this,"error"),(this.options.crossOrigin||""===this.options.crossOrigin)&&(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=e.src:(e.src=this._url,e.alt=this.options.alt)},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),n=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;me(this._image,n,e)},_reset:function(){var t=this._image,e=new E(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),n=e.getSize();ge(t,e.min),t.style.width=n.x+"px",t.style.height=n.y+"px"},_updateOpacity:function(){fe(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)},getCenter:function(){return this._bounds.getCenter()}}),Jn=Kn.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var t="VIDEO"===this._url.tagName,e=this._image=t?this._url:re("video");if(ue(e,"leaflet-image-layer"),this._zoomAnimated&&ue(e,"leaflet-zoom-animated"),this.options.className&&ue(e,this.options.className),e.onselectstart=l,e.onmousemove=l,e.onloadeddata=i(this.fire,this,"load"),t){for(var n=e.getElementsByTagName("source"),r=[],o=0;o0?r:[e.src]}else{m(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted,e.playsInline=!!this.options.playsInline;for(var s=0;sr?(e.height=r+"px",ue(t,o)):he(t,o),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),n=this._getAnchor();ge(this._container,e.add(n))},_adjustPan:function(){if(this.options.autoPan)if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning)this._autopanning=!1;else{var t=this._map,e=parseInt(ie(this._container,"marginBottom"),10)||0,n=this._container.offsetHeight+e,i=this._containerWidth,r=new C(this._containerLeft,-n-this._containerBottom);r._add(ye(this._container));var o=t.layerPointToContainerPoint(r),s=R(this.options.autoPanPadding),a=R(this.options.autoPanPaddingTopLeft||s),l=R(this.options.autoPanPaddingBottomRight||s),c=t.getSize(),u=0,h=0;o.x+i+l.x>c.x&&(u=o.x+i-c.x+l.x),o.x-u-a.x<0&&(u=o.x-a.x),o.y+n+l.y>c.y&&(h=o.y+n-c.y+l.y),o.y-h-a.y<0&&(h=o.y-a.y),(u||h)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([u,h]))}},_getAnchor:function(){return R(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}});De.mergeOptions({closePopupOnClick:!0}),De.include({openPopup:function(t,e,n){return this._initOverlay(ni,t,e,n).openOn(this),this},closePopup:function(t){return(t=arguments.length?t:this._popup)&&t.close(),this}}),kn.include({bindPopup:function(t,e){return this._popup=this._initOverlay(ni,this._popup,t,e),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t){return this._popup&&(this instanceof Cn||(this._popup._source=this),this._popup._prepareOpen(t||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){if(this._popup&&this._map){Xe(t);var e=t.layer||t.target;this._popup._source!==e||e instanceof Zn?(this._popup._source=e,this.openPopup(t.latlng)):this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng)}},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var ii=ei.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){ei.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){ei.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=ei.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=re("div",t),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+o(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,n,i=this._map,r=this._container,o=i.latLngToContainerPoint(i.getCenter()),s=i.layerPointToContainerPoint(t),a=this.options.direction,l=r.offsetWidth,c=r.offsetHeight,u=R(this.options.offset),h=this._getAnchor();"top"===a?(e=l/2,n=c):"bottom"===a?(e=l/2,n=0):"center"===a?(e=l/2,n=c/2):"right"===a?(e=0,n=c/2):"left"===a?(e=l,n=c/2):s.xthis.options.maxZoom||ni&&this._retainParent(r,o,s,i))},_retainChildren:function(t,e,n,i){for(var r=2*t;r<2*t+2;r++)for(var o=2*e;o<2*e+2;o++){var s=new C(r,o);s.z=n+1;var a=this._tileCoordsToKey(s),l=this._tiles[a];l&&l.active?l.retain=!0:(l&&l.loaded&&(l.retain=!0),n+1this.options.maxZoom||void 0!==this.options.minZoom&&r1)this._setView(t,n);else{for(var h=r.min.y;h<=r.max.y;h++)for(var d=r.min.x;d<=r.max.x;d++){var O=new C(d,h);if(O.z=this._tileZoom,this._isValidTile(O)){var f=this._tiles[this._tileCoordsToKey(O)];f?f.current=!0:s.push(O)}}if(s.sort((function(t,e){return t.distanceTo(o)-e.distanceTo(o)})),0!==s.length){this._loading||(this._loading=!0,this.fire("loading"));var p=document.createDocumentFragment();for(d=0;dn.max.x)||!e.wrapLat&&(t.yn.max.y))return!1}if(!this.options.bounds)return!0;var i=this._tileCoordsToBounds(t);return M(this.options.bounds).overlaps(i)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,n=this.getTileSize(),i=t.scaleBy(n),r=i.add(n);return[e.unproject(i,t.z),e.unproject(r,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),n=new Z(e[0],e[1]);return this.options.noWrap||(n=this._map.wrapLatLngBounds(n)),n},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),n=new C(+e[0],+e[1]);return n.z=+e[2],n},_removeTile:function(t){var e=this._tiles[t];e&&(oe(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){ue(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=l,t.onmousemove=l,At.ielt9&&this.options.opacity<1&&fe(t,this.options.opacity)},_addTile:function(t,e){var n=this._getTilePos(t),r=this._tileCoordsToKey(t),o=this.createTile(this._wrapCoords(t),i(this._tileReady,this,t));this._initTile(o),this.createTile.length<2&&x(i(this._tileReady,this,t,null,o)),ge(o,n),this._tiles[r]={el:o,coords:t,current:!0},e.appendChild(o),this.fire("tileloadstart",{tile:o,coords:t})},_tileReady:function(t,e,n){e&&this.fire("tileerror",{error:e,tile:n,coords:t});var r=this._tileCoordsToKey(t);(n=this._tiles[r])&&(n.loaded=+new Date,this._map._fadeAnimated?(fe(n.el,0),Q(this._fadeFrame),this._fadeFrame=x(this._updateOpacity,this)):(n.active=!0,this._pruneTiles()),e||(ue(n.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:n.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),At.ielt9||!this._map._fadeAnimated?x(this._pruneTiles,this):setTimeout(i(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new C(this._wrapX?a(t.x,this._wrapX):t.x,this._wrapY?a(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new E(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});var si=oi.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,e){this._url=t,(e=d(this,e)).detectRetina&&At.retina&&e.maxZoom>0?(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom=Math.min(e.maxZoom,e.minZoom+1)):(e.zoomOffset++,e.maxZoom=Math.max(e.minZoom,e.maxZoom-1)),e.minZoom=Math.max(0,e.minZoom)):e.zoomReverse?e.minZoom=Math.min(e.maxZoom,e.minZoom):e.maxZoom=Math.max(e.minZoom,e.maxZoom),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var n=document.createElement("img");return _e(n,"load",i(this._tileOnLoad,this,e,n)),_e(n,"error",i(this._tileOnError,this,e,n)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(n.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),"string"==typeof this.options.referrerPolicy&&(n.referrerPolicy=this.options.referrerPolicy),n.alt="",n.src=this.getTileUrl(t),n},getTileUrl:function(t){var n={r:At.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var i=this._globalTileRange.max.y-t.y;this.options.tms&&(n.y=i),n["-y"]=i}return p(this._url,e(n,this.options))},_tileOnLoad:function(t,e){At.ielt9?setTimeout(i(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,n){var i=this.options.errorTileUrl;i&&e.getAttribute("src")!==i&&(e.src=i),t(n,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,e=this.options.maxZoom;return this.options.zoomReverse&&(t=e-t),t+this.options.zoomOffset},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)if(this._tiles[t].coords.z!==this._tileZoom&&((e=this._tiles[t].el).onload=l,e.onerror=l,!e.complete)){e.src=y;var n=this._tiles[t].coords;oe(e),delete this._tiles[t],this.fire("tileabort",{tile:e,coords:n})}},_removeTile:function(t){var e=this._tiles[t];if(e)return e.el.setAttribute("src",y),oi.prototype._removeTile.call(this,t)},_tileReady:function(t,e,n){if(this._map&&(!n||n.getAttribute("src")!==y))return oi.prototype._tileReady.call(this,t,e,n)}});function ai(t,e){return new si(t,e)}var li=si.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,n){this._url=t;var i=e({},this.defaultWmsParams);for(var r in n)r in this.options||(i[r]=n[r]);var o=(n=d(this,n)).detectRetina&&At.retina?2:1,s=this.getTileSize();i.width=s.x*o,i.height=s.y*o,this.wmsParams=i},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,si.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),n=this._crs,i=A(n.project(e[0]),n.project(e[1])),r=i.min,o=i.max,s=(this._wmsVersion>=1.3&&this._crs===Qn?[r.y,r.x,o.y,o.x]:[r.x,r.y,o.x,o.y]).join(","),a=si.prototype.getTileUrl.call(this,t);return a+O(this.wmsParams,a,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+s},setParams:function(t,n){return e(this.wmsParams,t),n||this.redraw(),this}});si.WMS=li,ai.wms=function(t,e){return new li(t,e)};var ci=kn.extend({options:{padding:.1},initialize:function(t){d(this,t),o(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),ue(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var n=this._map.getZoomScale(e,this._zoom),i=this._map.getSize().multiplyBy(.5+this.options.padding),r=this._map.project(this._center,e),o=i.multiplyBy(-n).add(r).subtract(this._map._getNewPixelOrigin(t,e));At.any3d?me(this._container,o,n):ge(this._container,o)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),n=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new E(n,n.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),ui=ci.extend({options:{tolerance:0},getEvents:function(){var t=ci.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){ci.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");_e(t,"mousemove",this._onMouseMove,this),_e(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),_e(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){Q(this._redrawRequest),delete this._ctx,oe(this._container),Te(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){ci.prototype._update.call(this);var t=this._bounds,e=this._container,n=t.getSize(),i=At.retina?2:1;ge(e,t.min),e.width=i*n.x,e.height=i*n.y,e.style.width=n.x+"px",e.style.height=n.y+"px",At.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){ci.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[o(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,n=e.next,i=e.prev;n?n.prev=i:this._drawLast=i,i?i.next=n:this._drawFirst=n,delete t._order,delete this._layers[o(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){var e,n,i=t.options.dashArray.split(/[, ]+/),r=[];for(n=0;n')}}catch(t){}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),Oi={_initContainer:function(){this._container=re("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(ci.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=di("shape");ue(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=di("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[o(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;oe(e),t.removeInteractiveTarget(e),delete this._layers[o(t)]},_updateStyle:function(t){var e=t._stroke,n=t._fill,i=t.options,r=t._container;r.stroked=!!i.stroke,r.filled=!!i.fill,i.stroke?(e||(e=t._stroke=di("stroke")),r.appendChild(e),e.weight=i.weight+"px",e.color=i.color,e.opacity=i.opacity,i.dashArray?e.dashStyle=m(i.dashArray)?i.dashArray.join(" "):i.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=i.lineCap.replace("butt","flat"),e.joinstyle=i.lineJoin):e&&(r.removeChild(e),t._stroke=null),i.fill?(n||(n=t._fill=di("fill")),r.appendChild(n),n.color=i.fillColor||i.color,n.opacity=i.fillOpacity):n&&(r.removeChild(n),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),n=Math.round(t._radius),i=Math.round(t._radiusY||n);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+n+","+i+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){ae(t._container)},_bringToBack:function(t){le(t._container)}},fi=At.vml?di:G,pi=ci.extend({_initContainer:function(){this._container=fi("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=fi("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){oe(this._container),Te(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!this._map._animatingZoom||!this._bounds){ci.prototype._update.call(this);var t=this._bounds,e=t.getSize(),n=this._container;this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,n.setAttribute("width",e.x),n.setAttribute("height",e.y)),ge(n,t.min),n.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=fi("path");t.options.className&&ue(e,t.options.className),t.options.interactive&&ue(e,"leaflet-interactive"),this._updateStyle(t),this._layers[o(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){oe(t._path),t.removeInteractiveTarget(t._path),delete this._layers[o(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,n=t.options;e&&(n.stroke?(e.setAttribute("stroke",n.color),e.setAttribute("stroke-opacity",n.opacity),e.setAttribute("stroke-width",n.weight),e.setAttribute("stroke-linecap",n.lineCap),e.setAttribute("stroke-linejoin",n.lineJoin),n.dashArray?e.setAttribute("stroke-dasharray",n.dashArray):e.removeAttribute("stroke-dasharray"),n.dashOffset?e.setAttribute("stroke-dashoffset",n.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),n.fill?(e.setAttribute("fill",n.fillColor||n.color),e.setAttribute("fill-opacity",n.fillOpacity),e.setAttribute("fill-rule",n.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,F(t._parts,e))},_updateCircle:function(t){var e=t._point,n=Math.max(Math.round(t._radius),1),i="a"+n+","+(Math.max(Math.round(t._radiusY),1)||n)+" 0 1,0 ",r=t._empty()?"M0 0":"M"+(e.x-n)+","+e.y+i+2*n+",0 "+i+2*-n+",0 ";this._setPath(t,r)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){ae(t._path)},_bringToBack:function(t){le(t._path)}});function mi(t){return At.svg||At.vml?new pi(t):null}At.vml&&pi.include(Oi),De.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&hi(t)||mi(t)}});var gi=qn.extend({initialize:function(t,e){qn.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=M(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});pi.create=fi,pi.pointsToPath=F,Wn.geometryToLayer=jn,Wn.coordsToLatLng=Ln,Wn.coordsToLatLngs=Nn,Wn.latLngToCoords=Un,Wn.latLngsToCoords=Dn,Wn.getFeature=Yn,Wn.asFeature=Bn,De.mergeOptions({boxZoom:!0});var yi=Je.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){_e(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Te(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){oe(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),Bt(),ve(),this._startPoint=this._map.mouseEventToContainerPoint(t),_e(document,{contextmenu:Xe,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=re("div","leaflet-zoom-box",this._container),ue(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new E(this._point,this._startPoint),n=e.getSize();ge(this._box,e.min),this._box.style.width=n.x+"px",this._box.style.height=n.y+"px"},_finish:function(){this._moved&&(oe(this._box),he(this._container,"leaflet-crosshair")),Gt(),be(),Te(document,{contextmenu:Xe,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(i(this._resetState,this),0);var e=new Z(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});De.addInitHook("addHandler","boxZoom",yi),De.mergeOptions({doubleClickZoom:!0});var $i=Je.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,n=e.getZoom(),i=e.options.zoomDelta,r=t.originalEvent.shiftKey?n-i:n+i;"center"===e.options.doubleClickZoom?e.setZoom(r):e.setZoomAround(t.containerPoint,r)}});De.addInitHook("addHandler","doubleClickZoom",$i),De.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var vi=Je.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new nn(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}ue(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){he(this._map._container,"leaflet-grab"),he(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=M(this._map.options.maxBounds);this._offsetLimit=A(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,n=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(n),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.xe.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),n=this._initialWorldOffset,i=this._draggable._newPos.x,r=(i-e+n)%t+e-n,o=(i+e+n)%t-e-n,s=Math.abs(r+n)0?o:-o))-e;this._delta=0,this._startTime=null,s&&("center"===t.options.scrollWheelZoom?t.setZoom(e+s):t.setZoomAround(this._lastMousePos,e+s))}});De.addInitHook("addHandler","scrollWheelZoom",Si);De.mergeOptions({tapHold:At.touchNative&&At.safari&&At.mobile,tapTolerance:15});var wi=Je.extend({addHooks:function(){_e(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Te(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(clearTimeout(this._holdTimeout),1===t.touches.length){var e=t.touches[0];this._startPos=this._newPos=new C(e.clientX,e.clientY),this._holdTimeout=setTimeout(i((function(){this._cancel(),this._isTapValid()&&(_e(document,"touchend",Ve),_e(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",e))}),this),600),_e(document,"touchend touchcancel contextmenu",this._cancel,this),_e(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function t(){Te(document,"touchend",Ve),Te(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),Te(document,"touchend touchcancel contextmenu",this._cancel,this),Te(document,"touchmove",this._onMove,this)},_onMove:function(t){var e=t.touches[0];this._newPos=new C(e.clientX,e.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,e){var n=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY});n._simulated=!0,e.target.dispatchEvent(n)}});De.addInitHook("addHandler","tapHold",wi),De.mergeOptions({touchZoom:At.touch,bounceAtZoomLimits:!0});var xi=Je.extend({addHooks:function(){ue(this._map._container,"leaflet-touch-zoom"),_e(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){he(this._map._container,"leaflet-touch-zoom"),Te(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(t.touches&&2===t.touches.length&&!e._animatingZoom&&!this._zooming){var n=e.mouseEventToContainerPoint(t.touches[0]),i=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),"center"!==e.options.touchZoom&&(this._pinchStartLatLng=e.containerPointToLatLng(n.add(i)._divideBy(2))),this._startDist=n.distanceTo(i),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),_e(document,"touchmove",this._onTouchMove,this),_e(document,"touchend touchcancel",this._onTouchEnd,this),Ve(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,n=e.mouseEventToContainerPoint(t.touches[0]),r=e.mouseEventToContainerPoint(t.touches[1]),o=n.distanceTo(r)/this._startDist;if(this._zoom=e.getScaleZoom(o,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoome.getMaxZoom()&&o>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===o)return}else{var s=n._add(r)._divideBy(2)._subtract(this._centerPoint);if(1===o&&0===s.x&&0===s.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(s),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),Q(this._animRequest);var a=i(e._move,e,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=x(a,this,!0),Ve(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,Q(this._animRequest),Te(document,"touchmove",this._onTouchMove,this),Te(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});De.addInitHook("addHandler","touchZoom",xi),De.BoxZoom=yi,De.DoubleClickZoom=$i,De.Drag=vi,De.Keyboard=bi,De.ScrollWheelZoom=Si,De.TapHold=wi,De.TouchZoom=xi,t.Bounds=E,t.Browser=At,t.CRS=W,t.Canvas=ui,t.Circle=Vn,t.CircleMarker=Mn,t.Class=_,t.Control=Ye,t.DivIcon=ri,t.DivOverlay=ei,t.DomEvent=Ne,t.DomUtil=Pe,t.Draggable=nn,t.Evented=T,t.FeatureGroup=Cn,t.GeoJSON=Wn,t.GridLayer=oi,t.Handler=Je,t.Icon=zn,t.ImageOverlay=Kn,t.LatLng=V,t.LatLngBounds=Z,t.Layer=kn,t.LayerGroup=Tn,t.LineUtil=vn,t.Map=De,t.Marker=An,t.Mixin=tn,t.Path=Zn,t.Point=C,t.PolyUtil=ln,t.Polygon=qn,t.Polyline=Xn,t.Popup=ni,t.PosAnimation=Ue,t.Projection=wn,t.Rectangle=gi,t.Renderer=ci,t.SVG=pi,t.SVGOverlay=ti,t.TileLayer=si,t.Tooltip=ii,t.Transformation=U,t.Util=P,t.VideoOverlay=Jn,t.bind=i,t.bounds=A,t.canvas=hi,t.circle=function(t,e,n){return new Vn(t,e,n)},t.circleMarker=function(t,e){return new Mn(t,e)},t.control=Be,t.divIcon=function(t){return new ri(t)},t.extend=e,t.featureGroup=function(t,e){return new Cn(t,e)},t.geoJSON=Fn,t.geoJson=Hn,t.gridLayer=function(t){return new oi(t)},t.icon=function(t){return new zn(t)},t.imageOverlay=function(t,e,n){return new Kn(t,e,n)},t.latLng=X,t.latLngBounds=M,t.layerGroup=function(t,e){return new Tn(t,e)},t.map=function(t,e){return new De(t,e)},t.marker=function(t,e){return new An(t,e)},t.point=R,t.polygon=function(t,e){return new qn(t,e)},t.polyline=function(t,e){return new Xn(t,e)},t.popup=function(t,e){return new ni(t,e)},t.rectangle=function(t,e){return new gi(t,e)},t.setOptions=d,t.stamp=o,t.svg=mi,t.svgOverlay=function(t,e,n){return new ti(t,e,n)},t.tileLayer=ai,t.tooltip=function(t,e){return new ii(t,e)},t.transformation=D,t.version="1.9.4",t.videoOverlay=function(t,e,n){return new Jn(t,e,n)};var Qi=window.L;t.noConflict=function(){return window.L=Qi,this},window.L=t}(e)},2694:(t,e,n)=>{"use strict";var i=n(6925);function r(){}function o(){}o.resetWarningCache=r,t.exports=function(){function t(t,e,n,r,o,s){if(s!==i){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function e(){return t}t.isRequired=t;var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:o,resetWarningCache:r};return n.PropTypes=n,n}},5556:(t,e,n)=>{t.exports=n(2694)()},6925:t=>{"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},5338:(t,e,n)=>{"use strict";var i=n(5795);e.H=i.createRoot,i.hydrateRoot},7665:(t,e,n)=>{"use strict";n.d(e,{tH:()=>s});var i=n(1609);const r=(0,i.createContext)(null),o={didCatch:!1,error:null};class s extends i.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=o}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(null!==t){for(var e,n,i=arguments.length,r=new Array(i),s=0;s0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.length!==e.length||t.some(((t,n)=>!Object.is(t,e[n])))}(t.resetKeys,i)&&(null===(r=(s=this.props).onReset)||void 0===r||r.call(s,{next:i,prev:t.resetKeys,reason:"keys"}),this.setState(o))}render(){const{children:t,fallbackRender:e,FallbackComponent:n,fallback:o}=this.props,{didCatch:s,error:a}=this.state;let l=t;if(s){const t={error:a,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof e)l=e(t);else if(n)l=(0,i.createElement)(n,t);else{if(void 0===o)throw a;l=o}}return(0,i.createElement)(r.Provider,{value:{didCatch:s,error:a,resetErrorBoundary:this.resetErrorBoundary}},l)}}},2799:(t,e)=>{"use strict";var n="function"==typeof Symbol&&Symbol.for,i=n?Symbol.for("react.element"):60103,r=n?Symbol.for("react.portal"):60106,o=n?Symbol.for("react.fragment"):60107,s=n?Symbol.for("react.strict_mode"):60108,a=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,h=n?Symbol.for("react.concurrent_mode"):60111,d=n?Symbol.for("react.forward_ref"):60112,O=n?Symbol.for("react.suspense"):60113,f=n?Symbol.for("react.suspense_list"):60120,p=n?Symbol.for("react.memo"):60115,m=n?Symbol.for("react.lazy"):60116,g=n?Symbol.for("react.block"):60121,y=n?Symbol.for("react.fundamental"):60117,$=n?Symbol.for("react.responder"):60118,v=n?Symbol.for("react.scope"):60119;function b(t){if("object"==typeof t&&null!==t){var e=t.$$typeof;switch(e){case i:switch(t=t.type){case u:case h:case o:case a:case s:case O:return t;default:switch(t=t&&t.$$typeof){case c:case d:case m:case p:case l:return t;default:return e}}case r:return e}}}function S(t){return b(t)===h}e.AsyncMode=u,e.ConcurrentMode=h,e.ContextConsumer=c,e.ContextProvider=l,e.Element=i,e.ForwardRef=d,e.Fragment=o,e.Lazy=m,e.Memo=p,e.Portal=r,e.Profiler=a,e.StrictMode=s,e.Suspense=O,e.isAsyncMode=function(t){return S(t)||b(t)===u},e.isConcurrentMode=S,e.isContextConsumer=function(t){return b(t)===c},e.isContextProvider=function(t){return b(t)===l},e.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===i},e.isForwardRef=function(t){return b(t)===d},e.isFragment=function(t){return b(t)===o},e.isLazy=function(t){return b(t)===m},e.isMemo=function(t){return b(t)===p},e.isPortal=function(t){return b(t)===r},e.isProfiler=function(t){return b(t)===a},e.isStrictMode=function(t){return b(t)===s},e.isSuspense=function(t){return b(t)===O},e.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===o||t===h||t===a||t===s||t===O||t===f||"object"==typeof t&&null!==t&&(t.$$typeof===m||t.$$typeof===p||t.$$typeof===l||t.$$typeof===c||t.$$typeof===d||t.$$typeof===y||t.$$typeof===$||t.$$typeof===v||t.$$typeof===g)},e.typeOf=b},4363:(t,e,n)=>{"use strict";t.exports=n(2799)},4210:(t,e,n)=>{"use strict";function i(t,e,n,i,r,o,s){this.acceptsBooleans=2===e||3===e||4===e,this.attributeName=i,this.attributeNamespace=r,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=o,this.removeEmptyString=s}const r={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach((t=>{r[t]=new i(t,0,!1,t,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((([t,e])=>{r[t]=new i(t,1,!1,e,null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((t=>{r[t]=new i(t,2,!1,t.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((t=>{r[t]=new i(t,2,!1,t,null,!1,!1)})),["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach((t=>{r[t]=new i(t,3,!1,t.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((t=>{r[t]=new i(t,3,!0,t,null,!1,!1)})),["capture","download"].forEach((t=>{r[t]=new i(t,4,!1,t,null,!1,!1)})),["cols","rows","size","span"].forEach((t=>{r[t]=new i(t,6,!1,t,null,!1,!1)})),["rowSpan","start"].forEach((t=>{r[t]=new i(t,5,!1,t.toLowerCase(),null,!1,!1)}));const o=/[\-\:]([a-z])/g,s=t=>t[1].toUpperCase();["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach((t=>{const e=t.replace(o,s);r[e]=new i(e,1,!1,t,null,!1,!1)})),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach((t=>{const e=t.replace(o,s);r[e]=new i(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((t=>{const e=t.replace(o,s);r[e]=new i(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((t=>{r[t]=new i(t,1,!1,t.toLowerCase(),null,!1,!1)})),r.xlinkHref=new i("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((t=>{r[t]=new i(t,1,!1,t.toLowerCase(),null,!0,!0)}));const{CAMELCASE:a,SAME:l,possibleStandardNames:c}=n(6811),u=RegExp.prototype.test.bind(new RegExp("^(data|aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$")),h=Object.keys(c).reduce(((t,e)=>{const n=c[e];return n===l?t[e]=e:n===a?t[e.toLowerCase()]=e:t[e]=n,t}),{});e.BOOLEAN=3,e.BOOLEANISH_STRING=2,e.NUMERIC=5,e.OVERLOADED_BOOLEAN=4,e.POSITIVE_NUMERIC=6,e.RESERVED=0,e.STRING=1,e.getPropertyInfo=function(t){return r.hasOwnProperty(t)?r[t]:null},e.isCustomAttribute=u,e.possibleStandardNames=h},6811:(t,e)=>{e.SAME=0,e.CAMELCASE=1,e.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1}},3762:(t,e,n)=>{"use strict";function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function r(t){var e=function(t){if("object"!=i(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==i(e)?e:e+""}function o(t,e,n){return(e=r(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function a(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,i=Array(e);ndi});var h=n(8587);function d(t,e){if(null==t)return{};var n,i,r=(0,h.A)(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i0?k(X,--M):0,A--,10===V&&(A=1,E--),V}function I(){return V=M2||D(V)>3?"":" "}function H(t,e){for(;--e&&I()&&!(V<48||V>102||V>57&&V<65||V>70&&V<97););return U(t,N()+(e<6&&32==L()&&32==I()))}function K(t){for(;I();)switch(V){case t:return M;case 34:case 39:34!==t&&39!==t&&K(V);break;case 40:41===t&&K(t);break;case 92:I()}return M}function J(t,e){for(;I()&&t+V!==57&&(t+V!==84||47!==L()););return"/*"+U(e,M-1)+"*"+w(47===t?t:I())}function tt(t){for(;!D(L());)I();return U(t,M)}var et="-ms-",nt="-moz-",it="-webkit-",rt="comm",ot="rule",st="decl",at="@keyframes";function lt(t,e){for(var n="",i=z(t),r=0;r0&&C(x)-h&&R(O>32?ft(x+";",i,n,h-1):ft(P(x," ","")+";",i,n,h-2),l);break;case 59:x+=";";default:if(R(S=dt(x,e,n,c,u,r,a,$,v=[],b=[],h),o),123===y)if(0===u)ht(x,e,S,S,v,o,h,a,b);else switch(99===d&&110===k(x,3)?100:d){case 100:case 108:case 109:case 115:ht(t,S,S,i&&R(dt(t,S,S,0,0,r,a,$,r,v=[],h),b),r,b,h,a,i?v:b);break;default:ht(x,S,S,S,[""],b,0,a,b)}}c=u=O=0,p=g=1,$=x="",h=s;break;case 58:h=1+C(x),O=f;default:if(p<1)if(123==y)--p;else if(125==y&&0==p++&&125==j())continue;switch(x+=w(y),y*p){case 38:g=u>0?1:(x+="\f",-1);break;case 44:a[c++]=(C(x)-1)*g,g=1;break;case 64:45===L()&&(x+=G(I())),d=L(),u=h=C($=x+=tt(N())),y++;break;case 45:45===f&&2==C(x)&&(p=0)}}return o}function dt(t,e,n,i,r,o,s,a,l,c,u){for(var h=r-1,d=0===r?o:[""],O=z(d),f=0,p=0,m=0;f0?d[g]+" "+y:P(y,/&\f/g,d[g])))&&(l[m++]=$);return q(t,e,n,0===r?ot:a,l,c,u)}function Ot(t,e,n){return q(t,e,n,rt,w(V),T(t,2,-2),0)}function ft(t,e,n,i){return q(t,e,n,st,T(t,0,i),T(t,i+1,-1),i)}var pt=function(t,e,n){for(var i=0,r=0;i=r,r=L(),38===i&&12===r&&(e[n]=1),!D(r);)I();return U(t,M)},mt=new WeakMap,gt=function(t){if("rule"===t.type&&t.parent&&!(t.length<1)){for(var e=t.value,n=t.parent,i=t.column===n.column&&t.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==t.props.length||58===e.charCodeAt(0)||mt.get(n))&&!i){mt.set(t,!0);for(var r=[],o=function(t,e){return B(function(t,e){var n=-1,i=44;do{switch(D(i)){case 0:38===i&&12===L()&&(e[n]=1),t[n]+=pt(M-1,e,n);break;case 2:t[n]+=G(i);break;case 4:if(44===i){t[++n]=58===L()?"&\f":"",e[n]=t[n].length;break}default:t[n]+=w(i)}}while(i=I());return t}(Y(t),e))}(e,r),s=n.props,a=0,l=0;a6)switch(k(t,e+1)){case 109:if(45!==k(t,e+4))break;case 102:return P(t,/(.+:)(.+)-([^]+)/,"$1"+it+"$2-$3$1"+nt+(108==k(t,e+3)?"$3":"$2-$3"))+t;case 115:return~_(t,"stretch")?$t(P(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(115!==k(t,e+1))break;case 6444:switch(k(t,C(t)-3-(~_(t,"!important")&&10))){case 107:return P(t,":",":"+it)+t;case 101:return P(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+it+(45===k(t,14)?"inline-":"")+"box$3$1"+it+"$2$3$1"+et+"$2box$3")+t}break;case 5936:switch(k(t,e+11)){case 114:return it+t+et+P(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return it+t+et+P(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return it+t+et+P(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return it+t+et+t+t}return t}var vt=[function(t,e,n,i){if(t.length>-1&&!t.return)switch(t.type){case st:t.return=$t(t.value,t.length);break;case at:return lt([W(t,{value:P(t.value,"@","@"+it)})],i);case ot:if(t.length)return function(t,e){return t.map(e).join("")}(t.props,(function(e){switch(function(t){return(t=/(::plac\w+|:read-\w+)/.exec(t))?t[0]:t}(e)){case":read-only":case":read-write":return lt([W(t,{props:[P(e,/:(read-\w+)/,":-moz-$1")]})],i);case"::placeholder":return lt([W(t,{props:[P(e,/:(plac\w+)/,":"+it+"input-$1")]}),W(t,{props:[P(e,/:(plac\w+)/,":-moz-$1")]}),W(t,{props:[P(e,/:(plac\w+)/,et+"input-$1")]})],i)}return""}))}}],bt=function(t){var e=t.key;if("css"===e){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(t){-1!==t.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(t),t.setAttribute("data-s",""))}))}var i,r,o=t.stylisPlugins||vt,s={},a=[];i=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+e+' "]'),(function(t){for(var e=t.getAttribute("data-emotion").split(" "),n=1;n=4;++i,r-=4)e=1540483477*(65535&(e=255&t.charCodeAt(i)|(255&t.charCodeAt(++i))<<8|(255&t.charCodeAt(++i))<<16|(255&t.charCodeAt(++i))<<24))+(59797*(e>>>16)<<16),n=1540483477*(65535&(e^=e>>>24))+(59797*(e>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(r){case 3:n^=(255&t.charCodeAt(i+2))<<16;case 2:n^=(255&t.charCodeAt(i+1))<<8;case 1:n=1540483477*(65535&(n^=255&t.charCodeAt(i)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(r)+l;return{name:c,styles:r,next:Rt}}var Zt=!!O.useInsertionEffect&&O.useInsertionEffect,Mt=Zt||function(t){return t()},Vt=(Zt||O.useLayoutEffect,O.createContext("undefined"!=typeof HTMLElement?bt({key:"css"}):null)),Xt=(Vt.Provider,function(t){return(0,O.forwardRef)((function(e,n){var i=(0,O.useContext)(Vt);return t(e,i,n)}))}),qt=O.createContext({}),Wt={}.hasOwnProperty,jt="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",It=function(t){var e=t.cache,n=t.serialized,i=t.isStringTag;return St(e,n,i),Mt((function(){return function(t,e,n){St(t,e,n);var i=t.key+"-"+e.name;if(void 0===t.inserted[e.name]){var r=e;do{t.insert(e===r?"."+i:"",r,t.sheet,!0),r=r.next}while(void 0!==r)}}(e,n,i)})),null},Lt=Xt((function(t,e,n){var i=t.css;"string"==typeof i&&void 0!==e.registered[i]&&(i=e.registered[i]);var r=t[jt],o=[i],s="";"string"==typeof t.className?s=function(t,e,n){var i="";return n.split(" ").forEach((function(n){void 0!==t[n]?e.push(t[n]+";"):n&&(i+=n+" ")})),i}(e.registered,o,t.className):null!=t.className&&(s=t.className+" ");var a=At(o,void 0,O.useContext(qt));s+=e.key+"-"+a.name;var l={};for(var c in t)Wt.call(t,c)&&"css"!==c&&c!==jt&&(l[c]=t[c]);return l.className=s,n&&(l.ref=n),O.createElement(O.Fragment,null,O.createElement(It,{cache:e,serialized:a,isStringTag:"string"==typeof r}),O.createElement(r,l))})),Nt=Lt,Ut=(n(4146),function(t,e){var n=arguments;if(null==e||!Wt.call(e,"css"))return O.createElement.apply(void 0,n);var i=n.length,r=new Array(i);r[0]=Nt,r[1]=function(t,e){var n={};for(var i in e)Wt.call(e,i)&&(n[i]=e[i]);return n[jt]=t,n}(t,e);for(var o=2;o({x:t,y:t});function Jt(){return"undefined"!=typeof window}function te(t){return ie(t)?(t.nodeName||"").toLowerCase():"#document"}function ee(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function ne(t){var e;return null==(e=(ie(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function ie(t){return!!Jt()&&(t instanceof Node||t instanceof ee(t).Node)}function re(t){return!!Jt()&&(t instanceof Element||t instanceof ee(t).Element)}function oe(t){return!!Jt()&&(t instanceof HTMLElement||t instanceof ee(t).HTMLElement)}function se(t){return!(!Jt()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof ee(t).ShadowRoot)}function ae(t){const{overflow:e,overflowX:n,overflowY:i,display:r}=le(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!["inline","contents"].includes(r)}function le(t){return ee(t).getComputedStyle(t)}function ce(t){const e=function(t){if("html"===te(t))return t;const e=t.assignedSlot||t.parentNode||se(t)&&t.host||ne(t);return se(e)?e.host:e}(t);return function(t){return["html","body","#document"].includes(te(t))}(e)?t.ownerDocument?t.ownerDocument.body:t.body:oe(e)&&ae(e)?e:ce(e)}function ue(t,e,n){var i;void 0===e&&(e=[]),void 0===n&&(n=!0);const r=ce(t),o=r===(null==(i=t.ownerDocument)?void 0:i.body),s=ee(r);if(o){const t=he(s);return e.concat(s,s.visualViewport||[],ae(r)?r:[],t&&n?ue(t):[])}return e.concat(r,ue(r,[],n))}function he(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function de(t){return re(t)?t:t.contextElement}function Oe(t){const e=de(t);if(!oe(e))return Kt(1);const n=e.getBoundingClientRect(),{width:i,height:r,$:o}=function(t){const e=le(t);let n=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=oe(t),o=r?t.offsetWidth:n,s=r?t.offsetHeight:i,a=Ft(n)!==o||Ft(i)!==s;return a&&(n=o,i=s),{width:n,height:i,$:a}}(e);let s=(o?Ft(n.width):n.width)/i,a=(o?Ft(n.height):n.height)/r;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const fe=Kt(0);function pe(t){const e=ee(t);return"undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:fe}function me(t,e,n,i){void 0===e&&(e=!1),void 0===n&&(n=!1);const r=t.getBoundingClientRect(),o=de(t);let s=Kt(1);e&&(i?re(i)&&(s=Oe(i)):s=Oe(t));const a=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==ee(t))&&e}(o,n,i)?pe(o):Kt(0);let l=(r.left+a.x)/s.x,c=(r.top+a.y)/s.y,u=r.width/s.x,h=r.height/s.y;if(o){const t=ee(o),e=i&&re(i)?ee(i):i;let n=t,r=he(n);for(;r&&i&&e!==n;){const t=Oe(r),e=r.getBoundingClientRect(),i=le(r),o=e.left+(r.clientLeft+parseFloat(i.paddingLeft))*t.x,s=e.top+(r.clientTop+parseFloat(i.paddingTop))*t.y;l*=t.x,c*=t.y,u*=t.x,h*=t.y,l+=o,c+=s,n=ee(r),r=he(n)}}return function(t){const{x:e,y:n,width:i,height:r}=t;return{width:i,height:r,top:n,left:e,right:e+i,bottom:n+r,x:e,y:n}}({width:u,height:h,x:l,y:c})}const ge=O.useLayoutEffect;var ye=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],$e=function(){};function ve(t,e){return e?"-"===e[0]?t+e:t+"__"+e:t}function be(t,e){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r-1}function Pe(t){return Qe(t)?window.pageYOffset:t.scrollTop}function _e(t,e){Qe(t)?window.scrollTo(0,e):t.scrollTop=e}function ke(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:$e,r=Pe(t),o=e-r,s=0;!function e(){var a,l=o*((a=(a=s+=10)/n-1)*a*a+1)+r;_e(t,l),sn.bottom?_e(t,Math.min(e.offsetTop+e.clientHeight-t.offsetHeight+r,t.scrollHeight)):i.top-r=f)return{placement:"bottom",maxHeight:e};if(x>=f&&!s)return o&&ke(l,Q,_),{placement:"bottom",maxHeight:e};if(!s&&x>=i||s&&S>=i)return o&&ke(l,Q,_),{placement:"bottom",maxHeight:s?S-$:x-$};if("auto"===r||s){var k=e,T=s?b:w;return T>=i&&(k=Math.min(T-$-a,e)),{placement:"top",maxHeight:k}}if("bottom"===r)return o&&_e(l,Q),{placement:"bottom",maxHeight:e};break;case"top":if(b>=f)return{placement:"top",maxHeight:e};if(w>=f&&!s)return o&&ke(l,P,_),{placement:"top",maxHeight:e};if(!s&&w>=i||s&&b>=i){var C=e;return(!s&&w>=i||s&&b>=i)&&(C=s?b-v:w-v),o&&ke(l,P,_),{placement:"top",maxHeight:C}}return{placement:"bottom",maxHeight:e};default:throw new Error('Invalid placement provided "'.concat(r,'".'))}return c}({maxHeight:i,menuEl:t,minHeight:n,placement:r,shouldScroll:s&&!e,isFixedPosition:e,controlHeight:$});p(a.maxHeight),y(a.placement),null==c||c(a.placement)}}),[i,r,o,s,n,c,$]),e({ref:h,placerProps:a(a({},t),{},{placement:g||Ie(r),maxHeight:f})})},Ue=function(t,e){var n=t.theme,i=n.spacing.baseUnit,r=n.colors;return a({textAlign:"center"},e?{}:{color:r.neutral40,padding:"".concat(2*i,"px ").concat(3*i,"px")})},De=Ue,Ye=Ue,Be=["size"],Ge=["innerProps","isRtl","size"],Fe={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},He=function(t){var e=t.size,n=d(t,Be);return Ut("svg",(0,p.A)({height:e,width:e,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:Fe},n))},Ke=function(t){return Ut(He,(0,p.A)({size:20},t),Ut("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},Je=function(t){return Ut(He,(0,p.A)({size:20},t),Ut("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},tn=function(t,e){var n=t.isFocused,i=t.theme,r=i.spacing.baseUnit,o=i.colors;return a({label:"indicatorContainer",display:"flex",transition:"color 150ms"},e?{}:{color:n?o.neutral60:o.neutral20,padding:2*r,":hover":{color:n?o.neutral80:o.neutral40}})},en=tn,nn=tn,rn=function(){var t=Dt.apply(void 0,arguments),e="animation-"+t.name;return{name:e,styles:"@keyframes "+e+"{"+t.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}(qe||(We=["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"],je||(je=We.slice(0)),qe=Object.freeze(Object.defineProperties(We,{raw:{value:Object.freeze(je)}})))),on=function(t){var e=t.delay,n=t.offset;return Ut("span",{css:Dt({animation:"".concat(rn," 1s ease-in-out ").concat(e,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},sn=["data"],an=["innerRef","isDisabled","isHidden","inputClassName"],ln={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},cn={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":a({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},ln)},un=function(t){return a({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},ln)},hn=function(t){var e=t.children,n=t.innerProps;return Ut("div",n,e)},dn={ClearIndicator:function(t){var e=t.children,n=t.innerProps;return Ut("div",(0,p.A)({},xe(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),n),e||Ut(Ke,null))},Control:function(t){var e=t.children,n=t.isDisabled,i=t.isFocused,r=t.innerRef,o=t.innerProps,s=t.menuIsOpen;return Ut("div",(0,p.A)({ref:r},xe(t,"control",{control:!0,"control--is-disabled":n,"control--is-focused":i,"control--menu-is-open":s}),o,{"aria-disabled":n||void 0}),e)},DropdownIndicator:function(t){var e=t.children,n=t.innerProps;return Ut("div",(0,p.A)({},xe(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),n),e||Ut(Je,null))},DownChevron:Je,CrossIcon:Ke,Group:function(t){var e=t.children,n=t.cx,i=t.getStyles,r=t.getClassNames,o=t.Heading,s=t.headingProps,a=t.innerProps,l=t.label,c=t.theme,u=t.selectProps;return Ut("div",(0,p.A)({},xe(t,"group",{group:!0}),a),Ut(o,(0,p.A)({},s,{selectProps:u,theme:c,getStyles:i,getClassNames:r,cx:n}),l),Ut("div",null,e))},GroupHeading:function(t){var e=we(t);e.data;var n=d(e,sn);return Ut("div",(0,p.A)({},xe(t,"groupHeading",{"group-heading":!0}),n))},IndicatorsContainer:function(t){var e=t.children,n=t.innerProps;return Ut("div",(0,p.A)({},xe(t,"indicatorsContainer",{indicators:!0}),n),e)},IndicatorSeparator:function(t){var e=t.innerProps;return Ut("span",(0,p.A)({},e,xe(t,"indicatorSeparator",{"indicator-separator":!0})))},Input:function(t){var e=t.cx,n=t.value,i=we(t),r=i.innerRef,o=i.isDisabled,s=i.isHidden,a=i.inputClassName,l=d(i,an);return Ut("div",(0,p.A)({},xe(t,"input",{"input-container":!0}),{"data-value":n||""}),Ut("input",(0,p.A)({className:e({input:!0},a),ref:r,style:un(s),disabled:o},l)))},LoadingIndicator:function(t){var e=t.innerProps,n=t.isRtl,i=t.size,r=void 0===i?4:i,o=d(t,Ge);return Ut("div",(0,p.A)({},xe(a(a({},o),{},{innerProps:e,isRtl:n,size:r}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),e),Ut(on,{delay:0,offset:n}),Ut(on,{delay:160,offset:!0}),Ut(on,{delay:320,offset:!n}))},Menu:function(t){var e=t.children,n=t.innerRef,i=t.innerProps;return Ut("div",(0,p.A)({},xe(t,"menu",{menu:!0}),{ref:n},i),e)},MenuList:function(t){var e=t.children,n=t.innerProps,i=t.innerRef,r=t.isMulti;return Ut("div",(0,p.A)({},xe(t,"menuList",{"menu-list":!0,"menu-list--is-multi":r}),{ref:i},n),e)},MenuPortal:function(t){var e=t.appendTo,n=t.children,i=t.controlElement,r=t.innerProps,o=t.menuPlacement,s=t.menuPosition,l=(0,O.useRef)(null),c=(0,O.useRef)(null),h=u((0,O.useState)(Ie(o)),2),d=h[0],f=h[1],m=(0,O.useMemo)((function(){return{setPortalPlacement:f}}),[]),g=u((0,O.useState)(null),2),y=g[0],$=g[1],v=(0,O.useCallback)((function(){if(i){var t=function(t){var e=t.getBoundingClientRect();return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width}}(i),e="fixed"===s?0:window.pageYOffset,n=t[d]+e;n===(null==y?void 0:y.offset)&&t.left===(null==y?void 0:y.rect.left)&&t.width===(null==y?void 0:y.rect.width)||$({offset:n,rect:t})}}),[i,s,d,null==y?void 0:y.offset,null==y?void 0:y.rect.left,null==y?void 0:y.rect.width]);ge((function(){v()}),[v]);var b=(0,O.useCallback)((function(){"function"==typeof c.current&&(c.current(),c.current=null),i&&l.current&&(c.current=function(t,e,n,i){void 0===i&&(i={});const{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=i,c=de(t),u=r||o?[...c?ue(c):[],...ue(e)]:[];u.forEach((t=>{r&&t.addEventListener("scroll",n,{passive:!0}),o&&t.addEventListener("resize",n)}));const h=c&&a?function(t,e){let n,i=null;const r=ne(t);function o(){var t;clearTimeout(n),null==(t=i)||t.disconnect(),i=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),o();const{left:c,top:u,width:h,height:d}=t.getBoundingClientRect();if(a||e(),!h||!d)return;const O={rootMargin:-Ht(u)+"px "+-Ht(r.clientWidth-(c+h))+"px "+-Ht(r.clientHeight-(u+d))+"px "+-Ht(c)+"px",threshold:Gt(0,Bt(1,l))||1};let f=!0;function p(t){const e=t[0].intersectionRatio;if(e!==l){if(!f)return s();e?s(!1,e):n=setTimeout((()=>{s(!1,1e-7)}),1e3)}f=!1}try{i=new IntersectionObserver(p,{...O,root:r.ownerDocument})}catch(t){i=new IntersectionObserver(p,O)}i.observe(t)}(!0),o}(c,n):null;let d,O=-1,f=null;s&&(f=new ResizeObserver((t=>{let[i]=t;i&&i.target===c&&f&&(f.unobserve(e),cancelAnimationFrame(O),O=requestAnimationFrame((()=>{var t;null==(t=f)||t.observe(e)}))),n()})),c&&!l&&f.observe(c),f.observe(e));let p=l?me(t):null;return l&&function e(){const i=me(t);!p||i.x===p.x&&i.y===p.y&&i.width===p.width&&i.height===p.height||n(),p=i,d=requestAnimationFrame(e)}(),n(),()=>{var t;u.forEach((t=>{r&&t.removeEventListener("scroll",n),o&&t.removeEventListener("resize",n)})),null==h||h(),null==(t=f)||t.disconnect(),f=null,l&&cancelAnimationFrame(d)}}(i,l.current,v,{elementResize:"ResizeObserver"in window}))}),[i,v]);ge((function(){b()}),[b]);var S=(0,O.useCallback)((function(t){l.current=t,b()}),[b]);if(!e&&"fixed"!==s||!y)return null;var w=Ut("div",(0,p.A)({ref:S},xe(a(a({},t),{},{offset:y.offset,position:s,rect:y.rect}),"menuPortal",{"menu-portal":!0}),r),n);return Ut(Le.Provider,{value:m},e?(0,Yt.createPortal)(w,e):w)},LoadingMessage:function(t){var e=t.children,n=void 0===e?"Loading...":e,i=t.innerProps,r=d(t,Xe);return Ut("div",(0,p.A)({},xe(a(a({},r),{},{children:n,innerProps:i}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),i),n)},NoOptionsMessage:function(t){var e=t.children,n=void 0===e?"No options":e,i=t.innerProps,r=d(t,Ve);return Ut("div",(0,p.A)({},xe(a(a({},r),{},{children:n,innerProps:i}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),i),n)},MultiValue:function(t){var e=t.children,n=t.components,i=t.data,r=t.innerProps,o=t.isDisabled,s=t.removeProps,l=t.selectProps,c=n.Container,u=n.Label,h=n.Remove;return Ut(c,{data:i,innerProps:a(a({},xe(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":o})),r),selectProps:l},Ut(u,{data:i,innerProps:a({},xe(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},e),Ut(h,{data:i,innerProps:a(a({},xe(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(e||"option")},s),selectProps:l}))},MultiValueContainer:hn,MultiValueLabel:hn,MultiValueRemove:function(t){var e=t.children,n=t.innerProps;return Ut("div",(0,p.A)({role:"button"},n),e||Ut(Ke,{size:14}))},Option:function(t){var e=t.children,n=t.isDisabled,i=t.isFocused,r=t.isSelected,o=t.innerRef,s=t.innerProps;return Ut("div",(0,p.A)({},xe(t,"option",{option:!0,"option--is-disabled":n,"option--is-focused":i,"option--is-selected":r}),{ref:o,"aria-disabled":n},s),e)},Placeholder:function(t){var e=t.children,n=t.innerProps;return Ut("div",(0,p.A)({},xe(t,"placeholder",{placeholder:!0}),n),e)},SelectContainer:function(t){var e=t.children,n=t.innerProps,i=t.isDisabled,r=t.isRtl;return Ut("div",(0,p.A)({},xe(t,"container",{"--is-disabled":i,"--is-rtl":r}),n),e)},SingleValue:function(t){var e=t.children,n=t.isDisabled,i=t.innerProps;return Ut("div",(0,p.A)({},xe(t,"singleValue",{"single-value":!0,"single-value--is-disabled":n}),i),e)},ValueContainer:function(t){var e=t.children,n=t.innerProps,i=t.isMulti,r=t.hasValue;return Ut("div",(0,p.A)({},xe(t,"valueContainer",{"value-container":!0,"value-container--is-multi":i,"value-container--has-value":r}),n),e)}},On=Number.isNaN||function(t){return"number"==typeof t&&t!=t};function fn(t,e){if(t.length!==e.length)return!1;for(var n=0;n1?"s":""," ").concat(r.join(","),", selected.");case"select-option":return"option ".concat(i,o?" is disabled. Select another option.":", selected.");default:return""}},onFocus:function(t){var e=t.context,n=t.focused,i=t.options,r=t.label,o=void 0===r?"":r,s=t.selectValue,a=t.isDisabled,l=t.isSelected,c=t.isAppleDevice,u=function(t,e){return t&&t.length?"".concat(t.indexOf(e)+1," of ").concat(t.length):""};if("value"===e&&s)return"value ".concat(o," focused, ").concat(u(s,n),".");if("menu"===e&&c){var h=a?" disabled":"",d="".concat(l?" selected":"").concat(h);return"".concat(o).concat(d,", ").concat(u(i,n),".")}return""},onFilter:function(t){var e=t.inputValue,n=t.resultsMessage;return"".concat(n).concat(e?" for search term "+e:"",".")}},yn=function(t){var e=t.ariaSelection,n=t.focusedOption,i=t.focusedValue,r=t.focusableOptions,o=t.isFocused,s=t.selectValue,l=t.selectProps,c=t.id,u=t.isAppleDevice,h=l.ariaLiveMessages,d=l.getOptionLabel,f=l.inputValue,p=l.isMulti,m=l.isOptionDisabled,g=l.isSearchable,y=l.menuIsOpen,$=l.options,v=l.screenReaderStatus,b=l.tabSelectsValue,S=l.isLoading,w=l["aria-label"],x=l["aria-live"],Q=(0,O.useMemo)((function(){return a(a({},gn),h||{})}),[h]),P=(0,O.useMemo)((function(){var t,n="";if(e&&Q.onChange){var i=e.option,r=e.options,o=e.removedValue,l=e.removedValues,c=e.value,u=o||i||(t=c,Array.isArray(t)?null:t),h=u?d(u):"",O=r||l||void 0,f=O?O.map(d):[],p=a({isDisabled:u&&m(u,s),label:h,labels:f},e);n=Q.onChange(p)}return n}),[e,Q,m,s,d]),_=(0,O.useMemo)((function(){var t="",e=n||i,o=!!(n&&s&&s.includes(n));if(e&&Q.onFocus){var a={focused:e,label:d(e),isDisabled:m(e,s),isSelected:o,options:r,context:e===n?"menu":"value",selectValue:s,isAppleDevice:u};t=Q.onFocus(a)}return t}),[n,i,d,m,Q,r,s,u]),k=(0,O.useMemo)((function(){var t="";if(y&&$.length&&!S&&Q.onFilter){var e=v({count:r.length});t=Q.onFilter({inputValue:f,resultsMessage:e})}return t}),[r,f,y,Q,$,v,S]),T="initial-input-focus"===(null==e?void 0:e.action),C=(0,O.useMemo)((function(){var t="";if(Q.guidance){var e=i?"value":y?"menu":"input";t=Q.guidance({"aria-label":w,context:e,isDisabled:n&&m(n,s),isMulti:p,isSearchable:g,tabSelectsValue:b,isInitialFocus:T})}return t}),[w,n,i,p,m,g,y,Q,s,b,T]),z=Ut(O.Fragment,null,Ut("span",{id:"aria-selection"},P),Ut("span",{id:"aria-focused"},_),Ut("span",{id:"aria-results"},k),Ut("span",{id:"aria-guidance"},C));return Ut(O.Fragment,null,Ut(mn,{id:c},T&&z),Ut(mn,{"aria-live":x,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},o&&!T&&z))},$n=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],vn=new RegExp("["+$n.map((function(t){return t.letters})).join("")+"]","g"),bn={},Sn=0;Sn<$n.length;Sn++)for(var wn=$n[Sn],xn=0;xn1?e-1:0),i=1;i0,p=h-d-u,m=!1;p>e&&s.current&&(i&&i(t),s.current=!1),f&&a.current&&(o&&o(t),a.current=!1),f&&e>p?(n&&!s.current&&n(t),O.scrollTop=h,m=!0,s.current=!0):!f&&-e>u&&(r&&!a.current&&r(t),O.scrollTop=0,m=!0,a.current=!0),m&&function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()}(t)}}),[n,i,r,o]),h=(0,O.useCallback)((function(t){u(t,t.deltaY)}),[u]),d=(0,O.useCallback)((function(t){l.current=t.changedTouches[0].clientY}),[]),f=(0,O.useCallback)((function(t){var e=l.current-t.changedTouches[0].clientY;u(t,e)}),[u]),p=(0,O.useCallback)((function(t){if(t){var e=!!Ae&&{passive:!1};t.addEventListener("wheel",h,e),t.addEventListener("touchstart",d,e),t.addEventListener("touchmove",f,e)}}),[f,d,h]),m=(0,O.useCallback)((function(t){t&&(t.removeEventListener("wheel",h,!1),t.removeEventListener("touchstart",d,!1),t.removeEventListener("touchmove",f,!1))}),[f,d,h]);return(0,O.useEffect)((function(){if(e){var t=c.current;return p(t),function(){m(t)}}}),[e,p,m]),function(t){c.current=t}}({isEnabled:void 0===i||i,onBottomArrive:t.onBottomArrive,onBottomLeave:t.onBottomLeave,onTopArrive:t.onTopArrive,onTopLeave:t.onTopLeave}),o=function(t){var e=t.isEnabled,n=t.accountForScrollbars,i=void 0===n||n,r=(0,O.useRef)({}),o=(0,O.useRef)(null),s=(0,O.useCallback)((function(t){if(Xn){var e=document.body,n=e&&e.style;if(i&&Rn.forEach((function(t){var e=n&&n[t];r.current[t]=e})),i&&qn<1){var o=parseInt(r.current.paddingRight,10)||0,s=document.body?document.body.clientWidth:0,a=window.innerWidth-s+o||0;Object.keys(En).forEach((function(t){var e=En[t];n&&(n[t]=e)})),n&&(n.paddingRight="".concat(a,"px"))}e&&Vn()&&(e.addEventListener("touchmove",An,Wn),t&&(t.addEventListener("touchstart",Mn,Wn),t.addEventListener("touchmove",Zn,Wn))),qn+=1}}),[i]),a=(0,O.useCallback)((function(t){if(Xn){var e=document.body,n=e&&e.style;qn=Math.max(qn-1,0),i&&qn<1&&Rn.forEach((function(t){var e=r.current[t];n&&(n[t]=e)})),e&&Vn()&&(e.removeEventListener("touchmove",An,Wn),t&&(t.removeEventListener("touchstart",Mn,Wn),t.removeEventListener("touchmove",Zn,Wn)))}}),[i]);return(0,O.useEffect)((function(){if(e){var t=o.current;return s(t),function(){a(t)}}}),[e,s,a]),function(t){o.current=t}}({isEnabled:n});return Ut(O.Fragment,null,n&&Ut("div",{onClick:jn,css:In}),e((function(t){r(t),o(t)})))}var Nn={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},Un=function(t){var e=t.name,n=t.onFocus;return Ut("input",{required:!0,name:e,tabIndex:-1,"aria-hidden":"true",onFocus:n,css:Nn,value:"",onChange:function(){}})};function Dn(t){var e;return"undefined"!=typeof window&&null!=window.navigator&&t.test((null===(e=window.navigator.userAgentData)||void 0===e?void 0:e.platform)||window.navigator.platform)}function Yn(){return Dn(/^Mac/i)}var Bn={clearIndicator:nn,container:function(t){var e=t.isDisabled;return{label:"container",direction:t.isRtl?"rtl":void 0,pointerEvents:e?"none":void 0,position:"relative"}},control:function(t,e){var n=t.isDisabled,i=t.isFocused,r=t.theme,o=r.colors,s=r.borderRadius;return a({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:r.spacing.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},e?{}:{backgroundColor:n?o.neutral5:o.neutral0,borderColor:n?o.neutral10:i?o.primary:o.neutral20,borderRadius:s,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(o.primary):void 0,"&:hover":{borderColor:i?o.primary:o.neutral30}})},dropdownIndicator:en,group:function(t,e){var n=t.theme.spacing;return e?{}:{paddingBottom:2*n.baseUnit,paddingTop:2*n.baseUnit}},groupHeading:function(t,e){var n=t.theme,i=n.colors,r=n.spacing;return a({label:"group",cursor:"default",display:"block"},e?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:3*r.baseUnit,paddingRight:3*r.baseUnit,textTransform:"uppercase"})},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(t,e){var n=t.isDisabled,i=t.theme,r=i.spacing.baseUnit,o=i.colors;return a({label:"indicatorSeparator",alignSelf:"stretch",width:1},e?{}:{backgroundColor:n?o.neutral10:o.neutral20,marginBottom:2*r,marginTop:2*r})},input:function(t,e){var n=t.isDisabled,i=t.value,r=t.theme,o=r.spacing,s=r.colors;return a(a({visibility:n?"hidden":"visible",transform:i?"translateZ(0)":""},cn),e?{}:{margin:o.baseUnit/2,paddingBottom:o.baseUnit/2,paddingTop:o.baseUnit/2,color:s.neutral80})},loadingIndicator:function(t,e){var n=t.isFocused,i=t.size,r=t.theme,o=r.colors,s=r.spacing.baseUnit;return a({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},e?{}:{color:n?o.neutral60:o.neutral20,padding:2*s})},loadingMessage:Ye,menu:function(t,e){var n,i=t.placement,r=t.theme,s=r.borderRadius,l=r.spacing,c=r.colors;return a((o(n={label:"menu"},function(t){return t?{bottom:"top",top:"bottom"}[t]:"bottom"}(i),"100%"),o(n,"position","absolute"),o(n,"width","100%"),o(n,"zIndex",1),n),e?{}:{backgroundColor:c.neutral0,borderRadius:s,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:l.menuGutter,marginTop:l.menuGutter})},menuList:function(t,e){var n=t.maxHeight,i=t.theme.spacing.baseUnit;return a({maxHeight:n,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},e?{}:{paddingBottom:i,paddingTop:i})},menuPortal:function(t){var e=t.rect,n=t.offset,i=t.position;return{left:e.left,position:i,top:n,width:e.width,zIndex:1}},multiValue:function(t,e){var n=t.theme,i=n.spacing,r=n.borderRadius,o=n.colors;return a({label:"multiValue",display:"flex",minWidth:0},e?{}:{backgroundColor:o.neutral10,borderRadius:r/2,margin:i.baseUnit/2})},multiValueLabel:function(t,e){var n=t.theme,i=n.borderRadius,r=n.colors,o=t.cropWithEllipsis;return a({overflow:"hidden",textOverflow:o||void 0===o?"ellipsis":void 0,whiteSpace:"nowrap"},e?{}:{borderRadius:i/2,color:r.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},multiValueRemove:function(t,e){var n=t.theme,i=n.spacing,r=n.borderRadius,o=n.colors,s=t.isFocused;return a({alignItems:"center",display:"flex"},e?{}:{borderRadius:r/2,backgroundColor:s?o.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}})},noOptionsMessage:De,option:function(t,e){var n=t.isDisabled,i=t.isFocused,r=t.isSelected,o=t.theme,s=o.spacing,l=o.colors;return a({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},e?{}:{backgroundColor:r?l.primary:i?l.primary25:"transparent",color:n?l.neutral20:r?l.neutral0:"inherit",padding:"".concat(2*s.baseUnit,"px ").concat(3*s.baseUnit,"px"),":active":{backgroundColor:n?void 0:r?l.primary:l.primary50}})},placeholder:function(t,e){var n=t.theme,i=n.spacing,r=n.colors;return a({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},e?{}:{color:r.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},singleValue:function(t,e){var n=t.isDisabled,i=t.theme,r=i.spacing,o=i.colors;return a({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},e?{}:{color:n?o.neutral40:o.neutral80,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},valueContainer:function(t,e){var n=t.theme.spacing,i=t.isMulti,r=t.hasValue,o=t.selectProps.controlShouldRenderValue;return a({alignItems:"center",display:i&&r&&o?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},e?{}:{padding:"".concat(n.baseUnit/2,"px ").concat(2*n.baseUnit,"px")})}},Gn={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},Fn={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Ce(),captureMenuScroll:!Ce(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(t,e){if(t.data.__isNew__)return!0;var n=a({ignoreCase:!0,ignoreAccents:!0,stringify:Tn,trim:!0,matchFrom:"any"},undefined),i=n.ignoreCase,r=n.ignoreAccents,o=n.stringify,s=n.trim,l=n.matchFrom,c=s?kn(e):e,u=s?kn(o(t)):o(t);return i&&(c=c.toLowerCase(),u=u.toLowerCase()),r&&(c=Pn(c),u=Qn(u)),"start"===l?u.substr(0,c.length)===c:u.indexOf(c)>-1},formatGroupLabel:function(t){return t.label},getOptionLabel:function(t){return t.label},getOptionValue:function(t){return t.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:function(t){return!!t.isDisabled},loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(t){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(t){var e=t.count;return"".concat(e," result").concat(1!==e?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function Hn(t,e,n,i){return{type:"option",data:e,isDisabled:oi(t,e,n),isSelected:si(t,e,n),label:ii(t,e),value:ri(t,e),index:i}}function Kn(t,e){return t.options.map((function(n,i){if("options"in n){var r=n.options.map((function(n,i){return Hn(t,n,e,i)})).filter((function(e){return ei(t,e)}));return r.length>0?{type:"group",data:n,options:r,index:i}:void 0}var o=Hn(t,n,e,i);return ei(t,o)?o:void 0})).filter(Ze)}function Jn(t){return t.reduce((function(t,e){return"group"===e.type?t.push.apply(t,v(e.options.map((function(t){return t.data})))):t.push(e.data),t}),[])}function ti(t,e){return t.reduce((function(t,n){return"group"===n.type?t.push.apply(t,v(n.options.map((function(t){return{data:t.data,id:"".concat(e,"-").concat(n.index,"-").concat(t.index)}})))):t.push({data:n.data,id:"".concat(e,"-").concat(n.index)}),t}),[])}function ei(t,e){var n=t.inputValue,i=void 0===n?"":n,r=e.data,o=e.isSelected,s=e.label,a=e.value;return(!li(t)||!o)&&ai(t,{label:s,value:a,data:r},i)}var ni=function(t,e){var n;return(null===(n=t.find((function(t){return t.data===e})))||void 0===n?void 0:n.id)||null},ii=function(t,e){return t.getOptionLabel(e)},ri=function(t,e){return t.getOptionValue(e)};function oi(t,e,n){return"function"==typeof t.isOptionDisabled&&t.isOptionDisabled(e,n)}function si(t,e,n){if(n.indexOf(e)>-1)return!0;if("function"==typeof t.isOptionSelected)return t.isOptionSelected(e,n);var i=ri(t,e);return n.some((function(e){return ri(t,e)===i}))}function ai(t,e,n){return!t.filterOption||t.filterOption(e,n)}var li=function(t){var e=t.hideSelectedOptions,n=t.isMulti;return void 0===e?n:e},ci=1,ui=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&g(t,e)}(n,t);var e=function(t){var e=$();return function(){var n,r=y(t);if(e){var o=y(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(t,e){if(e&&("object"==i(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}(n);function n(t){var i;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),(i=e.call(this,t)).state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},i.blockOptionHover=!1,i.isComposing=!1,i.commonProps=void 0,i.initialTouchX=0,i.initialTouchY=0,i.openAfterFocus=!1,i.scrollToFocusedOptionOnUpdate=!1,i.userIsDragging=void 0,i.isAppleDevice=Yn()||Dn(/^iPhone/i)||Dn(/^iPad/i)||Yn()&&navigator.maxTouchPoints>1,i.controlRef=null,i.getControlRef=function(t){i.controlRef=t},i.focusedOptionRef=null,i.getFocusedOptionRef=function(t){i.focusedOptionRef=t},i.menuListRef=null,i.getMenuListRef=function(t){i.menuListRef=t},i.inputRef=null,i.getInputRef=function(t){i.inputRef=t},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(t,e){var n=i.props,r=n.onChange,o=n.name;e.name=o,i.ariaOnChange(t,e),r(t,e)},i.setValue=function(t,e,n){var r=i.props,o=r.closeMenuOnSelect,s=r.isMulti,a=r.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:a}),o&&(i.setState({inputIsHiddenAfterUpdate:!s}),i.onMenuClose()),i.setState({clearFocusValueOnUpdate:!0}),i.onChange(t,{action:e,option:n})},i.selectOption=function(t){var e=i.props,n=e.blurInputOnSelect,r=e.isMulti,o=e.name,s=i.state.selectValue,a=r&&i.isOptionSelected(t,s),l=i.isOptionDisabled(t,s);if(a){var c=i.getOptionValue(t);i.setValue(s.filter((function(t){return i.getOptionValue(t)!==c})),"deselect-option",t)}else{if(l)return void i.ariaOnChange(t,{action:"select-option",option:t,name:o});r?i.setValue([].concat(v(s),[t]),"select-option",t):i.setValue(t,"select-option")}n&&i.blurInput()},i.removeValue=function(t){var e=i.props.isMulti,n=i.state.selectValue,r=i.getOptionValue(t),o=n.filter((function(t){return i.getOptionValue(t)!==r})),s=Me(e,o,o[0]||null);i.onChange(s,{action:"remove-value",removedValue:t}),i.focusInput()},i.clearValue=function(){var t=i.state.selectValue;i.onChange(Me(i.props.isMulti,[],null),{action:"clear",removedValues:t})},i.popValue=function(){var t=i.props.isMulti,e=i.state.selectValue,n=e[e.length-1],r=e.slice(0,e.length-1),o=Me(t,r,r[0]||null);n&&i.onChange(o,{action:"pop-value",removedValue:n})},i.getFocusedOptionId=function(t){return ni(i.state.focusableOptionsWithIds,t)},i.getFocusableOptionsWithIds=function(){return ti(Kn(i.props,i.state.selectValue),i.getElementId("option"))},i.getValue=function(){return i.state.selectValue},i.cx=function(){for(var t=arguments.length,e=new Array(t),n=0;n5||o>5}},i.onTouchEnd=function(t){i.userIsDragging||(i.controlRef&&!i.controlRef.contains(t.target)&&i.menuListRef&&!i.menuListRef.contains(t.target)&&i.blurInput(),i.initialTouchX=0,i.initialTouchY=0)},i.onControlTouchEnd=function(t){i.userIsDragging||i.onControlMouseDown(t)},i.onClearIndicatorTouchEnd=function(t){i.userIsDragging||i.onClearIndicatorMouseDown(t)},i.onDropdownIndicatorTouchEnd=function(t){i.userIsDragging||i.onDropdownIndicatorMouseDown(t)},i.handleInputChange=function(t){var e=i.props.inputValue,n=t.currentTarget.value;i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange(n,{action:"input-change",prevInputValue:e}),i.props.menuIsOpen||i.onMenuOpen()},i.onInputFocus=function(t){i.props.onFocus&&i.props.onFocus(t),i.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(i.openAfterFocus||i.props.openMenuOnFocus)&&i.openMenu("first"),i.openAfterFocus=!1},i.onInputBlur=function(t){var e=i.props.inputValue;i.menuListRef&&i.menuListRef.contains(document.activeElement)?i.inputRef.focus():(i.props.onBlur&&i.props.onBlur(t),i.onInputChange("",{action:"input-blur",prevInputValue:e}),i.onMenuClose(),i.setState({focusedValue:null,isFocused:!1}))},i.onOptionHover=function(t){if(!i.blockOptionHover&&i.state.focusedOption!==t){var e=i.getFocusableOptions().indexOf(t);i.setState({focusedOption:t,focusedOptionId:e>-1?i.getFocusedOptionId(t):null})}},i.shouldHideSelectedOptions=function(){return li(i.props)},i.onValueInputFocus=function(t){t.preventDefault(),t.stopPropagation(),i.focus()},i.onKeyDown=function(t){var e=i.props,n=e.isMulti,r=e.backspaceRemovesValue,o=e.escapeClearsValue,s=e.inputValue,a=e.isClearable,l=e.isDisabled,c=e.menuIsOpen,u=e.onKeyDown,h=e.tabSelectsValue,d=e.openMenuOnFocus,O=i.state,f=O.focusedOption,p=O.focusedValue,m=O.selectValue;if(!(l||"function"==typeof u&&(u(t),t.defaultPrevented))){switch(i.blockOptionHover=!0,t.key){case"ArrowLeft":if(!n||s)return;i.focusValue("previous");break;case"ArrowRight":if(!n||s)return;i.focusValue("next");break;case"Delete":case"Backspace":if(s)return;if(p)i.removeValue(p);else{if(!r)return;n?i.popValue():a&&i.clearValue()}break;case"Tab":if(i.isComposing)return;if(t.shiftKey||!c||!h||!f||d&&i.isOptionSelected(f,m))return;i.selectOption(f);break;case"Enter":if(229===t.keyCode)break;if(c){if(!f)return;if(i.isComposing)return;i.selectOption(f);break}return;case"Escape":c?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:s}),i.onMenuClose()):a&&o&&i.clearValue();break;case" ":if(s)return;if(!c){i.openMenu("first");break}if(!f)return;i.selectOption(f);break;case"ArrowUp":c?i.focusOption("up"):i.openMenu("last");break;case"ArrowDown":c?i.focusOption("down"):i.openMenu("first");break;case"PageUp":if(!c)return;i.focusOption("pageup");break;case"PageDown":if(!c)return;i.focusOption("pagedown");break;case"Home":if(!c)return;i.focusOption("first");break;case"End":if(!c)return;i.focusOption("last");break;default:return}t.preventDefault()}},i.state.instancePrefix="react-select-"+(i.props.instanceId||++ci),i.state.selectValue=Se(t.value),t.menuIsOpen&&i.state.selectValue.length){var r=i.getFocusableOptionsWithIds(),o=i.buildFocusableOptions(),s=o.indexOf(i.state.selectValue[0]);i.state.focusableOptionsWithIds=r,i.state.focusedOption=o[s],i.state.focusedOptionId=ni(r,o[s])}return i}return function(t,e,n){e&&m(t.prototype,e),n&&m(t,n),Object.defineProperty(t,"prototype",{writable:!1})}(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&Te(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(t){var e=this.props,n=e.isDisabled,i=e.menuIsOpen,r=this.state.isFocused;(r&&!n&&t.isDisabled||r&&i&&!t.menuIsOpen)&&this.focusInput(),r&&n&&!t.isDisabled?this.setState({isFocused:!1},this.onMenuClose):r||n||!t.isDisabled||this.inputRef!==document.activeElement||this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Te(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(t,e){this.props.onInputChange(t,e)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(t){var e=this,n=this.state,i=n.selectValue,r=n.isFocused,o=this.buildFocusableOptions(),s="first"===t?0:o.length-1;if(!this.props.isMulti){var a=o.indexOf(i[0]);a>-1&&(s=a)}this.scrollToFocusedOptionOnUpdate=!(r&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:o[s],focusedOptionId:this.getFocusedOptionId(o[s])},(function(){return e.onMenuOpen()}))}},{key:"focusValue",value:function(t){var e=this.state,n=e.selectValue,i=e.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var r=n.indexOf(i);i||(r=-1);var o=n.length-1,s=-1;if(n.length){switch(t){case"previous":s=0===r?0:-1===r?o:r-1;break;case"next":r>-1&&r0&&void 0!==arguments[0]?arguments[0]:"first",e=this.props.pageSize,n=this.state.focusedOption,i=this.getFocusableOptions();if(i.length){var r=0,o=i.indexOf(n);n||(o=-1),"up"===t?r=o>0?o-1:i.length-1:"down"===t?r=(o+1)%i.length:"pageup"===t?(r=o-e)<0&&(r=0):"pagedown"===t?(r=o+e)>i.length-1&&(r=i.length-1):"last"===t&&(r=i.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:i[r],focusedValue:null,focusedOptionId:this.getFocusedOptionId(i[r])})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(Gn):a(a({},Gn),this.props.theme):Gn}},{key:"getCommonProps",value:function(){var t=this.clearValue,e=this.cx,n=this.getStyles,i=this.getClassNames,r=this.getValue,o=this.selectOption,s=this.setValue,a=this.props,l=a.isMulti,c=a.isRtl,u=a.options;return{clearValue:t,cx:e,getStyles:n,getClassNames:i,getValue:r,hasValue:this.hasValue(),isMulti:l,isRtl:c,options:u,selectOption:o,selectProps:a,setValue:s,theme:this.getTheme()}}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var t=this.props,e=t.isClearable,n=t.isMulti;return void 0===e?n:e}},{key:"isOptionDisabled",value:function(t,e){return oi(this.props,t,e)}},{key:"isOptionSelected",value:function(t,e){return si(this.props,t,e)}},{key:"filterOption",value:function(t,e){return ai(this.props,t,e)}},{key:"formatOptionLabel",value:function(t,e){if("function"==typeof this.props.formatOptionLabel){var n=this.props.inputValue,i=this.state.selectValue;return this.props.formatOptionLabel(t,{context:e,inputValue:n,selectValue:i})}return this.getOptionLabel(t)}},{key:"formatGroupLabel",value:function(t){return this.props.formatGroupLabel(t)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var t=this.props,e=t.isDisabled,n=t.isSearchable,i=t.inputId,r=t.inputValue,o=t.tabIndex,s=t.form,l=t.menuIsOpen,c=t.required,u=this.getComponents().Input,h=this.state,d=h.inputIsHidden,f=h.ariaSelection,m=this.commonProps,g=i||this.getElementId("input"),y=a(a(a({"aria-autocomplete":"list","aria-expanded":l,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":c,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},l&&{"aria-controls":this.getElementId("listbox")}),!n&&{"aria-readonly":!0}),this.hasValue()?"initial-input-focus"===(null==f?void 0:f.action)&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return n?O.createElement(u,(0,p.A)({},m,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:g,innerRef:this.getInputRef,isDisabled:e,isHidden:d,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:o,form:s,type:"text",value:r},y)):O.createElement(zn,(0,p.A)({id:g,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:$e,onFocus:this.onInputFocus,disabled:e,tabIndex:o,inputMode:"none",form:s,value:""},y))}},{key:"renderPlaceholderOrValue",value:function(){var t=this,e=this.getComponents(),n=e.MultiValue,i=e.MultiValueContainer,r=e.MultiValueLabel,o=e.MultiValueRemove,s=e.SingleValue,a=e.Placeholder,l=this.commonProps,c=this.props,u=c.controlShouldRenderValue,h=c.isDisabled,d=c.isMulti,f=c.inputValue,m=c.placeholder,g=this.state,y=g.selectValue,$=g.focusedValue,v=g.isFocused;if(!this.hasValue()||!u)return f?null:O.createElement(a,(0,p.A)({},l,{key:"placeholder",isDisabled:h,isFocused:v,innerProps:{id:this.getElementId("placeholder")}}),m);if(d)return y.map((function(e,s){var a=e===$,c="".concat(t.getOptionLabel(e),"-").concat(t.getOptionValue(e));return O.createElement(n,(0,p.A)({},l,{components:{Container:i,Label:r,Remove:o},isFocused:a,isDisabled:h,key:c,index:s,removeProps:{onClick:function(){return t.removeValue(e)},onTouchEnd:function(){return t.removeValue(e)},onMouseDown:function(t){t.preventDefault()}},data:e}),t.formatOptionLabel(e,"value"))}));if(f)return null;var b=y[0];return O.createElement(s,(0,p.A)({},l,{data:b,isDisabled:h}),this.formatOptionLabel(b,"value"))}},{key:"renderClearIndicator",value:function(){var t=this.getComponents().ClearIndicator,e=this.commonProps,n=this.props,i=n.isDisabled,r=n.isLoading,o=this.state.isFocused;if(!this.isClearable()||!t||i||!this.hasValue()||r)return null;var s={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return O.createElement(t,(0,p.A)({},e,{innerProps:s,isFocused:o}))}},{key:"renderLoadingIndicator",value:function(){var t=this.getComponents().LoadingIndicator,e=this.commonProps,n=this.props,i=n.isDisabled,r=n.isLoading,o=this.state.isFocused;return t&&r?O.createElement(t,(0,p.A)({},e,{innerProps:{"aria-hidden":"true"},isDisabled:i,isFocused:o})):null}},{key:"renderIndicatorSeparator",value:function(){var t=this.getComponents(),e=t.DropdownIndicator,n=t.IndicatorSeparator;if(!e||!n)return null;var i=this.commonProps,r=this.props.isDisabled,o=this.state.isFocused;return O.createElement(n,(0,p.A)({},i,{isDisabled:r,isFocused:o}))}},{key:"renderDropdownIndicator",value:function(){var t=this.getComponents().DropdownIndicator;if(!t)return null;var e=this.commonProps,n=this.props.isDisabled,i=this.state.isFocused,r={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return O.createElement(t,(0,p.A)({},e,{innerProps:r,isDisabled:n,isFocused:i}))}},{key:"renderMenu",value:function(){var t=this,e=this.getComponents(),n=e.Group,i=e.GroupHeading,r=e.Menu,o=e.MenuList,s=e.MenuPortal,a=e.LoadingMessage,l=e.NoOptionsMessage,c=e.Option,u=this.commonProps,h=this.state.focusedOption,d=this.props,f=d.captureMenuScroll,m=d.inputValue,g=d.isLoading,y=d.loadingMessage,$=d.minMenuHeight,v=d.maxMenuHeight,b=d.menuIsOpen,S=d.menuPlacement,w=d.menuPosition,x=d.menuPortalTarget,Q=d.menuShouldBlockScroll,P=d.menuShouldScrollIntoView,_=d.noOptionsMessage,k=d.onMenuScrollToTop,T=d.onMenuScrollToBottom;if(!b)return null;var C,z=function(e,n){var i=e.type,r=e.data,o=e.isDisabled,s=e.isSelected,a=e.label,l=e.value,d=h===r,f=o?void 0:function(){return t.onOptionHover(r)},m=o?void 0:function(){return t.selectOption(r)},g="".concat(t.getElementId("option"),"-").concat(n),y={id:g,onClick:m,onMouseMove:f,onMouseOver:f,tabIndex:-1,role:"option","aria-selected":t.isAppleDevice?void 0:s};return O.createElement(c,(0,p.A)({},u,{innerProps:y,data:r,isDisabled:o,isSelected:s,key:g,label:a,type:i,value:l,isFocused:d,innerRef:d?t.getFocusedOptionRef:void 0}),t.formatOptionLabel(e.data,"menu"))};if(this.hasOptions())C=this.getCategorizedOptions().map((function(e){if("group"===e.type){var r=e.data,o=e.options,s=e.index,a="".concat(t.getElementId("group"),"-").concat(s),l="".concat(a,"-heading");return O.createElement(n,(0,p.A)({},u,{key:a,data:r,options:o,Heading:i,headingProps:{id:l,data:e.data},label:t.formatGroupLabel(e.data)}),e.options.map((function(t){return z(t,"".concat(s,"-").concat(t.index))})))}if("option"===e.type)return z(e,"".concat(e.index))}));else if(g){var R=y({inputValue:m});if(null===R)return null;C=O.createElement(a,u,R)}else{var E=_({inputValue:m});if(null===E)return null;C=O.createElement(l,u,E)}var A={minMenuHeight:$,maxMenuHeight:v,menuPlacement:S,menuPosition:w,menuShouldScrollIntoView:P},Z=O.createElement(Ne,(0,p.A)({},u,A),(function(e){var n=e.ref,i=e.placerProps,s=i.placement,a=i.maxHeight;return O.createElement(r,(0,p.A)({},u,A,{innerRef:n,innerProps:{onMouseDown:t.onMenuMouseDown,onMouseMove:t.onMenuMouseMove},isLoading:g,placement:s}),O.createElement(Ln,{captureEnabled:f,onTopArrive:k,onBottomArrive:T,lockEnabled:Q},(function(e){return O.createElement(o,(0,p.A)({},u,{innerRef:function(n){t.getMenuListRef(n),e(n)},innerProps:{role:"listbox","aria-multiselectable":u.isMulti,id:t.getElementId("listbox")},isLoading:g,maxHeight:a,focusedOption:h}),C)})))}));return x||"fixed"===w?O.createElement(s,(0,p.A)({},u,{appendTo:x,controlElement:this.controlRef,menuPlacement:S,menuPosition:w}),Z):Z}},{key:"renderFormField",value:function(){var t=this,e=this.props,n=e.delimiter,i=e.isDisabled,r=e.isMulti,o=e.name,s=e.required,a=this.state.selectValue;if(s&&!this.hasValue()&&!i)return O.createElement(Un,{name:o,onFocus:this.onValueInputFocus});if(o&&!i){if(r){if(n){var l=a.map((function(e){return t.getOptionValue(e)})).join(n);return O.createElement("input",{name:o,type:"hidden",value:l})}var c=a.length>0?a.map((function(e,n){return O.createElement("input",{key:"i-".concat(n),name:o,type:"hidden",value:t.getOptionValue(e)})})):O.createElement("input",{name:o,type:"hidden",value:""});return O.createElement("div",null,c)}var u=a[0]?this.getOptionValue(a[0]):"";return O.createElement("input",{name:o,type:"hidden",value:u})}}},{key:"renderLiveRegion",value:function(){var t=this.commonProps,e=this.state,n=e.ariaSelection,i=e.focusedOption,r=e.focusedValue,o=e.isFocused,s=e.selectValue,a=this.getFocusableOptions();return O.createElement(yn,(0,p.A)({},t,{id:this.getElementId("live-region"),ariaSelection:n,focusedOption:i,focusedValue:r,isFocused:o,selectValue:s,focusableOptions:a,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var t=this.getComponents(),e=t.Control,n=t.IndicatorsContainer,i=t.SelectContainer,r=t.ValueContainer,o=this.props,s=o.className,a=o.id,l=o.isDisabled,c=o.menuIsOpen,u=this.state.isFocused,h=this.commonProps=this.getCommonProps();return O.createElement(i,(0,p.A)({},h,{className:s,innerProps:{id:a,onKeyDown:this.onKeyDown},isDisabled:l,isFocused:u}),this.renderLiveRegion(),O.createElement(e,(0,p.A)({},h,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:l,isFocused:u,menuIsOpen:c}),O.createElement(r,(0,p.A)({},h,{isDisabled:l}),this.renderPlaceholderOrValue(),this.renderInput()),O.createElement(n,(0,p.A)({},h,{isDisabled:l}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(t,e){var n=e.prevProps,i=e.clearFocusValueOnUpdate,r=e.inputIsHiddenAfterUpdate,o=e.ariaSelection,s=e.isFocused,l=e.prevWasFocused,c=e.instancePrefix,u=t.options,h=t.value,d=t.menuIsOpen,O=t.inputValue,f=t.isMulti,p=Se(h),m={};if(n&&(h!==n.value||u!==n.options||d!==n.menuIsOpen||O!==n.inputValue)){var g=d?function(t,e){return Jn(Kn(t,e))}(t,p):[],y=d?ti(Kn(t,p),"".concat(c,"-option")):[],$=i?function(t,e){var n=t.focusedValue,i=t.selectValue.indexOf(n);if(i>-1){if(e.indexOf(n)>-1)return n;if(i-1?n:e[0]}(e,g);m={selectValue:p,focusedOption:v,focusedOptionId:ni(y,v),focusableOptionsWithIds:y,focusedValue:$,clearFocusValueOnUpdate:!1}}var b=null!=r&&t!==n?{inputIsHidden:r,inputIsHiddenAfterUpdate:void 0}:{},S=o,w=s&&l;return s&&!w&&(S={value:Me(f,p,p[0]||null),options:p,action:"initial-input-focus"},w=!l),"initial-input-focus"===(null==o?void 0:o.action)&&(S=null),a(a(a({},m),b),{},{prevProps:t,ariaSelection:S,prevWasFocused:w})}}]),n}(O.Component);ui.defaultProps=Fn;var hi=(0,O.forwardRef)((function(t,e){var n=function(t){var e=t.defaultInputValue,n=void 0===e?"":e,i=t.defaultMenuIsOpen,r=void 0!==i&&i,o=t.defaultValue,s=void 0===o?null:o,l=t.inputValue,c=t.menuIsOpen,h=t.onChange,p=t.onInputChange,m=t.onMenuClose,g=t.onMenuOpen,y=t.value,$=d(t,f),v=u((0,O.useState)(void 0!==l?l:n),2),b=v[0],S=v[1],w=u((0,O.useState)(void 0!==c?c:r),2),x=w[0],Q=w[1],P=u((0,O.useState)(void 0!==y?y:s),2),_=P[0],k=P[1],T=(0,O.useCallback)((function(t,e){"function"==typeof h&&h(t,e),k(t)}),[h]),C=(0,O.useCallback)((function(t,e){var n;"function"==typeof p&&(n=p(t,e)),S(void 0!==n?n:t)}),[p]),z=(0,O.useCallback)((function(){"function"==typeof g&&g(),Q(!0)}),[g]),R=(0,O.useCallback)((function(){"function"==typeof m&&m(),Q(!1)}),[m]),E=void 0!==l?l:b,A=void 0!==c?c:x,Z=void 0!==y?y:_;return a(a({},$),{},{inputValue:E,menuIsOpen:A,onChange:T,onInputChange:C,onMenuClose:R,onMenuOpen:z,value:Z})}(t);return O.createElement(ui,(0,p.A)({ref:e},n))})),di=hi},1020:(t,e,n)=>{"use strict";var i=n(1609),r=Symbol.for("react.element"),o=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),s=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function l(t,e,n){var i,l={},c=null,u=null;for(i in void 0!==n&&(c=""+n),void 0!==e.key&&(c=""+e.key),void 0!==e.ref&&(u=e.ref),e)o.call(e,i)&&!a.hasOwnProperty(i)&&(l[i]=e[i]);if(t&&t.defaultProps)for(i in e=t.defaultProps)void 0===l[i]&&(l[i]=e[i]);return{$$typeof:r,type:t,key:c,ref:u,props:l,_owner:s.current}}e.jsx=l,e.jsxs=l},4848:(t,e,n)=>{"use strict";t.exports=n(1020)},5229:function(t,e,n){"use strict";var i=(this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}})(n(1133)),r=n(8917);function o(t,e){var n={};return t&&"string"==typeof t?((0,i.default)(t,(function(t,i){t&&i&&(n[(0,r.camelCase)(t,e)]=i)})),n):n}o.default=o,t.exports=o},8917:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,i=/-([a-z])/g,r=/^[^-]+$/,o=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,a=function(t,e){return e.toUpperCase()},l=function(t,e){return"".concat(e,"-")};e.camelCase=function(t,e){return void 0===e&&(e={}),function(t){return!t||r.test(t)||n.test(t)}(t)?t:(t=t.toLowerCase(),(t=e.reactCompat?t.replace(s,l):t.replace(o,l)).replace(i,a))}},1133:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){let n=null;if(!t||"string"!=typeof t)return n;const i=(0,r.default)(t),o="function"==typeof e;return i.forEach((t=>{if("declaration"!==t.type)return;const{property:i,value:r}=t;o?e(i,r,t):r&&(n=n||{},n[i]=r)})),n};const r=i(n(5077))},3829:(t,e,n)=>{"use strict";n.d(e,{A:()=>c});const i={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};var r,o=new Uint8Array(16);function s(){if(!r&&!(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(o)}for(var a=[],l=0;l<256;++l)a.push((l+256).toString(16).slice(1));const c=function(t,e,n){if(i.randomUUID&&!e&&!t)return i.randomUUID();var r=(t=t||{}).random||(t.rng||s)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){n=n||0;for(var o=0;o<16;++o)e[n+o]=r[o];return e}return function(t,e=0){return(a[t[e+0]]+a[t[e+1]]+a[t[e+2]]+a[t[e+3]]+"-"+a[t[e+4]]+a[t[e+5]]+"-"+a[t[e+6]]+a[t[e+7]]+"-"+a[t[e+8]]+a[t[e+9]]+"-"+a[t[e+10]]+a[t[e+11]]+a[t[e+12]]+a[t[e+13]]+a[t[e+14]]+a[t[e+15]]).toLowerCase()}(r)}},1609:t=>{"use strict";t.exports=window.React},5795:t=>{"use strict";t.exports=window.ReactDOM},4715:t=>{"use strict";t.exports=window.wp.blockEditor},6427:t=>{"use strict";t.exports=window.wp.components},7143:t=>{"use strict";t.exports=window.wp.data},6087:t=>{"use strict";t.exports=window.wp.element},2619:t=>{"use strict";t.exports=window.wp.hooks},7723:t=>{"use strict";t.exports=window.wp.i18n},5573:t=>{"use strict";t.exports=window.wp.primitives},6942:(t,e)=>{var n;!function(){"use strict";var i={}.hasOwnProperty;function r(){for(var t="",e=0;e{"use strict";function i(){return i=Object.assign?Object.assign.bind():function(t){for(var e=1;ei})},8587:(t,e,n)=>{"use strict";function i(t,e){if(null==t)return{};var n={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(e.includes(i))continue;n[i]=t[i]}return n}n.d(e,{A:()=>i})},9658:(t,e,n)=>{"use strict";n.d(e,{m:()=>o});var i=n(6500),r=n(4880),o=new class extends i.Q{#X;#q;#W;constructor(){super(),this.#W=t=>{if(!r.S$&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#q||this.setEventListener(this.#W)}onUnsubscribe(){this.hasListeners()||(this.#q?.(),this.#q=void 0)}setEventListener(t){this.#W=t,this.#q?.(),this.#q=t((t=>{"boolean"==typeof t?this.setFocused(t):this.onFocus()}))}setFocused(t){this.#X!==t&&(this.#X=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach((e=>{e(t)}))}isFocused(){return"boolean"==typeof this.#X?this.#X:"hidden"!==globalThis.document?.visibilityState}}},6158:(t,e,n)=>{"use strict";n.d(e,{$:()=>a,s:()=>s});var i=n(6261),r=n(1692),o=n(8904),s=class extends r.k{#j;#r;#I;constructor(t){super(),this.mutationId=t.mutationId,this.#r=t.mutationCache,this.#j=[],this.state=t.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#j.includes(t)||(this.#j.push(t),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#j=this.#j.filter((e=>e!==t)),this.scheduleGc(),this.#r.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#j.length||("pending"===this.state.status?this.scheduleGc():this.#r.remove(this))}continue(){return this.#I?.continue()??this.execute(this.state.variables)}async execute(t){this.#I=(0,o.II)({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(t,e)=>{this.#L({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#L({type:"pause"})},onContinue:()=>{this.#L({type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#r.canRun(this)});const e="pending"===this.state.status,n=!this.#I.canStart();try{if(!e){this.#L({type:"pending",variables:t,isPaused:n}),await(this.#r.config.onMutate?.(t,this));const e=await(this.options.onMutate?.(t));e!==this.state.context&&this.#L({type:"pending",context:e,variables:t,isPaused:n})}const i=await this.#I.start();return await(this.#r.config.onSuccess?.(i,t,this.state.context,this)),await(this.options.onSuccess?.(i,t,this.state.context)),await(this.#r.config.onSettled?.(i,null,this.state.variables,this.state.context,this)),await(this.options.onSettled?.(i,null,t,this.state.context)),this.#L({type:"success",data:i}),i}catch(e){try{throw await(this.#r.config.onError?.(e,t,this.state.context,this)),await(this.options.onError?.(e,t,this.state.context)),await(this.#r.config.onSettled?.(void 0,e,this.state.variables,this.state.context,this)),await(this.options.onSettled?.(void 0,e,t,this.state.context)),e}finally{this.#L({type:"error",error:e})}}finally{this.#r.runNext(this)}}#L(t){this.state=(e=>{switch(t.type){case"failed":return{...e,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...e,isPaused:!0};case"continue":return{...e,isPaused:!1};case"pending":return{...e,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...e,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...e,data:void 0,error:t.error,failureCount:e.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}})(this.state),i.j.batch((()=>{this.#j.forEach((e=>{e.onMutationUpdate(t)})),this.#r.notify({mutation:this,type:"updated",action:t})}))}};function a(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},6261:(t,e,n)=>{"use strict";n.d(e,{j:()=>i});var i=function(){let t=[],e=0,n=t=>{t()},i=t=>{t()},r=t=>setTimeout(t,0);const o=i=>{e?t.push(i):r((()=>{n(i)}))};return{batch:o=>{let s;e++;try{s=o()}finally{e--,e||(()=>{const e=t;t=[],e.length&&r((()=>{i((()=>{e.forEach((t=>{n(t)}))}))}))})()}return s},batchCalls:t=>(...e)=>{o((()=>{t(...e)}))},schedule:o,setNotifyFunction:t=>{n=t},setBatchNotifyFunction:t=>{i=t},setScheduler:t=>{r=t}}}()},6035:(t,e,n)=>{"use strict";n.d(e,{t:()=>o});var i=n(6500),r=n(4880),o=new class extends i.Q{#N=!0;#q;#W;constructor(){super(),this.#W=t=>{if(!r.S$&&window.addEventListener){const e=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#q||this.setEventListener(this.#W)}onUnsubscribe(){this.hasListeners()||(this.#q?.(),this.#q=void 0)}setEventListener(t){this.#W=t,this.#q?.(),this.#q=t(this.setOnline.bind(this))}setOnline(t){this.#N!==t&&(this.#N=t,this.listeners.forEach((e=>{e(t)})))}isOnline(){return this.#N}}},9757:(t,e,n)=>{"use strict";n.d(e,{X:()=>a,k:()=>l});var i=n(4880),r=n(6261),o=n(8904),s=n(1692),a=class extends s.k{#U;#D;#Y;#I;#o;#B;constructor(t){super(),this.#B=!1,this.#o=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#Y=t.cache,this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#U=function(t){const e="function"==typeof t.initialData?t.initialData():t.initialData,n=void 0!==e,i=n?"function"==typeof t.initialDataUpdatedAt?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}(this.options),this.state=t.state??this.#U,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#I?.promise}setOptions(t){this.options={...this.#o,...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#Y.remove(this)}setData(t,e){const n=(0,i.pl)(this.state.data,t,this.options);return this.#L({data:n,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),n}setState(t,e){this.#L({type:"setState",state:t,setStateOptions:e})}cancel(t){const e=this.#I?.promise;return this.#I?.cancel(t),e?e.then(i.lQ).catch(i.lQ):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#U)}isActive(){return this.observers.some((t=>!1!==(0,i.Eh)(t.options.enabled,this)))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===i.hT||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return!!this.state.isInvalidated||(this.getObserversCount()>0?this.observers.some((t=>t.getCurrentResult().isStale)):void 0===this.state.data)}isStaleByTime(t=0){return this.state.isInvalidated||void 0===this.state.data||!(0,i.j3)(this.state.dataUpdatedAt,t)}onFocus(){const t=this.observers.find((t=>t.shouldFetchOnWindowFocus()));t?.refetch({cancelRefetch:!1}),this.#I?.continue()}onOnline(){const t=this.observers.find((t=>t.shouldFetchOnReconnect()));t?.refetch({cancelRefetch:!1}),this.#I?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#Y.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter((e=>e!==t)),this.observers.length||(this.#I&&(this.#B?this.#I.cancel({revert:!0}):this.#I.cancelRetry()),this.scheduleGc()),this.#Y.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#L({type:"invalidate"})}fetch(t,e){if("idle"!==this.state.fetchStatus)if(void 0!==this.state.data&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#I)return this.#I.continueRetry(),this.#I.promise;if(t&&this.setOptions(t),!this.options.queryFn){const t=this.observers.find((t=>t.options.queryFn));t&&this.setOptions(t.options)}const n=new AbortController,r=t=>{Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(this.#B=!0,n.signal)})},s={fetchOptions:e,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:()=>{const t=(0,i.ZM)(this.options,e),n={queryKey:this.queryKey,meta:this.meta};return r(n),this.#B=!1,this.options.persister?this.options.persister(t,n,this):t(n)}};r(s),this.options.behavior?.onFetch(s,this),this.#D=this.state,"idle"!==this.state.fetchStatus&&this.state.fetchMeta===s.fetchOptions?.meta||this.#L({type:"fetch",meta:s.fetchOptions?.meta});const a=t=>{(0,o.wm)(t)&&t.silent||this.#L({type:"error",error:t}),(0,o.wm)(t)||(this.#Y.config.onError?.(t,this),this.#Y.config.onSettled?.(this.state.data,t,this)),this.scheduleGc()};return this.#I=(0,o.II)({initialPromise:e?.initialPromise,fn:s.fetchFn,abort:n.abort.bind(n),onSuccess:t=>{if(void 0!==t){try{this.setData(t)}catch(t){return void a(t)}this.#Y.config.onSuccess?.(t,this),this.#Y.config.onSettled?.(t,this.state.error,this),this.scheduleGc()}else a(new Error(`${this.queryHash} data is undefined`))},onError:a,onFail:(t,e)=>{this.#L({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#L({type:"pause"})},onContinue:()=>{this.#L({type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0}),this.#I.start()}#L(t){this.state=(e=>{switch(t.type){case"failed":return{...e,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...e,fetchStatus:"paused"};case"continue":return{...e,fetchStatus:"fetching"};case"fetch":return{...e,...l(e.data,this.options),fetchMeta:t.meta??null};case"success":return{...e,data:t.data,dataUpdateCount:e.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const n=t.error;return(0,o.wm)(n)&&n.revert&&this.#D?{...this.#D,fetchStatus:"idle"}:{...e,error:n,errorUpdateCount:e.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:e.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error"};case"invalidate":return{...e,isInvalidated:!0};case"setState":return{...e,...t.state}}})(this.state),r.j.batch((()=>{this.observers.forEach((t=>{t.onQueryUpdate()})),this.#Y.notify({query:this,type:"updated",action:t})}))}};function l(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:(0,o.v_)(e.networkMode)?"fetching":"paused",...void 0===t&&{error:null,status:"pending"}}}},1692:(t,e,n)=>{"use strict";n.d(e,{k:()=>r});var i=n(4880),r=class{#G;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,i.gn)(this.gcTime)&&(this.#G=setTimeout((()=>{this.optionalRemove()}),this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(i.S$?1/0:3e5))}clearGcTimeout(){this.#G&&(clearTimeout(this.#G),this.#G=void 0)}}},8904:(t,e,n)=>{"use strict";n.d(e,{II:()=>h,v_:()=>l,wm:()=>u});var i=n(9658),r=n(6035),o=n(4658),s=n(4880);function a(t){return Math.min(1e3*2**t,3e4)}function l(t){return"online"!==(t??"online")||r.t.isOnline()}var c=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function u(t){return t instanceof c}function h(t){let e,n=!1,u=0,h=!1;const d=(0,o.T)(),O=()=>i.m.isFocused()&&("always"===t.networkMode||r.t.isOnline())&&t.canRun(),f=()=>l(t.networkMode)&&t.canRun(),p=n=>{h||(h=!0,t.onSuccess?.(n),e?.(),d.resolve(n))},m=n=>{h||(h=!0,t.onError?.(n),e?.(),d.reject(n))},g=()=>new Promise((n=>{e=t=>{(h||O())&&n(t)},t.onPause?.()})).then((()=>{e=void 0,h||t.onContinue?.()})),y=()=>{if(h)return;let e;const i=0===u?t.initialPromise:void 0;try{e=i??t.fn()}catch(t){e=Promise.reject(t)}Promise.resolve(e).then(p).catch((e=>{if(h)return;const i=t.retry??(s.S$?0:3),r=t.retryDelay??a,o="function"==typeof r?r(u,e):r,l=!0===i||"number"==typeof i&&uO()?void 0:g())).then((()=>{n?m(e):y()}))):m(e)}))};return{promise:d,cancel:e=>{h||(m(new c(e)),t.abort?.())},continue:()=>(e?.(),d),cancelRetry:()=>{n=!0},continueRetry:()=>{n=!1},canStart:f,start:()=>(f()?y():g().then(y),d)}}},6500:(t,e,n)=>{"use strict";n.d(e,{Q:()=>i});var i=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}},4658:(t,e,n)=>{"use strict";function i(){let t,e;const n=new Promise(((n,i)=>{t=n,e=i}));function i(t){Object.assign(n,t),delete n.resolve,delete n.reject}return n.status="pending",n.catch((()=>{})),n.resolve=e=>{i({status:"fulfilled",value:e}),t(e)},n.reject=t=>{i({status:"rejected",reason:t}),e(t)},n}n.d(e,{T:()=>i})},4880:(t,e,n)=>{"use strict";n.d(e,{Cp:()=>f,EN:()=>O,Eh:()=>c,F$:()=>d,MK:()=>u,S$:()=>i,ZM:()=>Q,ZZ:()=>w,Zw:()=>o,d2:()=>l,f8:()=>m,gn:()=>s,hT:()=>x,j3:()=>a,lQ:()=>r,nJ:()=>h,pl:()=>b,y9:()=>S,yy:()=>v});var i="undefined"==typeof window||"Deno"in globalThis;function r(){}function o(t,e){return"function"==typeof t?t(e):t}function s(t){return"number"==typeof t&&t>=0&&t!==1/0}function a(t,e){return Math.max(t+(e||0)-Date.now(),0)}function l(t,e){return"function"==typeof t?t(e):t}function c(t,e){return"function"==typeof t?t(e):t}function u(t,e){const{type:n="all",exact:i,fetchStatus:r,predicate:o,queryKey:s,stale:a}=t;if(s)if(i){if(e.queryHash!==d(s,e.options))return!1}else if(!f(e.queryKey,s))return!1;if("all"!==n){const t=e.isActive();if("active"===n&&!t)return!1;if("inactive"===n&&t)return!1}return!("boolean"==typeof a&&e.isStale()!==a||r&&r!==e.state.fetchStatus||o&&!o(e))}function h(t,e){const{exact:n,status:i,predicate:r,mutationKey:o}=t;if(o){if(!e.options.mutationKey)return!1;if(n){if(O(e.options.mutationKey)!==O(o))return!1}else if(!f(e.options.mutationKey,o))return!1}return!(i&&e.state.status!==i||r&&!r(e))}function d(t,e){return(e?.queryKeyHashFn||O)(t)}function O(t){return JSON.stringify(t,((t,e)=>y(e)?Object.keys(e).sort().reduce(((t,n)=>(t[n]=e[n],t)),{}):e))}function f(t,e){return t===e||typeof t==typeof e&&!(!t||!e||"object"!=typeof t||"object"!=typeof e)&&!Object.keys(e).some((n=>!f(t[n],e[n])))}function p(t,e){if(t===e)return t;const n=g(t)&&g(e);if(n||y(t)&&y(e)){const i=n?t:Object.keys(t),r=i.length,o=n?e:Object.keys(e),s=o.length,a=n?[]:{};let l=0;for(let r=0;r{setTimeout(e,t)}))}function b(t,e,n){return"function"==typeof n.structuralSharing?n.structuralSharing(t,e):!1!==n.structuralSharing?p(t,e):e}function S(t,e,n=0){const i=[...t,e];return n&&i.length>n?i.slice(1):i}function w(t,e,n=0){const i=[e,...t];return n&&i.length>n?i.slice(0,-1):i}var x=Symbol();function Q(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:t.queryFn&&t.queryFn!==x?t.queryFn:()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`))}},46:(t,e,n)=>{"use strict";n.d(e,{Ht:()=>a,jE:()=>s});var i=n(1609),r=n(4848),o=i.createContext(void 0),s=t=>{const e=i.useContext(o);if(t)return t;if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},a=({client:t,children:e})=>(i.useEffect((()=>(t.mount(),()=>{t.unmount()})),[t]),(0,r.jsx)(o.Provider,{value:t,children:e}))},5480:(t,e,n)=>{"use strict";n.d(e,{d7:()=>r});var i=n(1609);function r(t,e){const[n,r]=i.useState(t);return i.useEffect((()=>{const n=setTimeout((()=>{r(t)}),e);return()=>{clearTimeout(n)}}),[t,e]),n}},4164:(t,e,n)=>{"use strict";function i(t){var e,n,r="";if("string"==typeof t||"number"==typeof t)r+=t;else if("object"==typeof t)if(Array.isArray(t)){var o=t.length;for(e=0;er});const r=function(){for(var t,e,n=0,r="",o=arguments.length;n{if(!n){var s=1/0;for(u=0;u=o)&&Object.keys(i.O).every((t=>i.O[t](n[l])))?n.splice(l--,1):(a=!1,o0&&t[u-1][2]>o;u--)t[u]=t[u-1];t[u]=[n,r,o]},i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t={546:0,409:0};i.O.j=e=>0===t[e];var e=(e,n)=>{var r,o,[s,a,l]=n,c=0;if(s.some((e=>0!==t[e]))){for(r in a)i.o(a,r)&&(i.m[r]=a[r]);if(l)var u=l(i)}for(e&&e(n);ci(4006)));r=i.O(r)})(); \ No newline at end of file +(()=>{var t,e={7677:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});var i=n(6087);const r=(0,i.forwardRef)((function({icon:t,size:e=24,...n},r){return(0,i.cloneElement)(t,{width:e,height:e,...n,ref:r})}))},2391:(t,e,n)=>{"use strict";n.d(e,{A:()=>o});var i=n(5573),r=n(4848);const o=(0,r.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(i.Path,{d:"m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z"})})},3349:(t,e,n)=>{"use strict";n.d(e,{A:()=>o});var i=n(5573),r=n(4848);const o=(0,r.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(i.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z"})})},7316:(t,e,n)=>{"use strict";n.d(e,{B:()=>r,Q:()=>o});var i=n(1609);const r=(0,i.createContext)({});function o({context:t,config:e,tabs:n,fields:o,values:s,updateValue:a,initialValues:l={},children:c}){const[u,h]=(0,i.useState)(l),d=(0,i.useCallback)((t=>e=>h((n=>({...n,[t]:e})))),[]),[O,f]=(0,i.useState)((()=>{let e="";return"gutenberg"!==t&&(e=new URLSearchParams(window.location.hash.slice(1)).get("tab")),(!e&&Object.keys(n).length>0||e&&!n[e])&&(e=Object.keys(n)[0]),e})),p=(0,i.useCallback)((e=>{if(f(e),"gutenberg"!==t){const t=new URLSearchParams(window.location.hash.slice(1));t.set("tab",e),window.location.hash=t.toString()}}),[f]),m=(0,i.useCallback)((()=>{const t=new URLSearchParams(window.location.hash.slice(1)).get("tab");t&&t!==O&&f(t)}),[O]);(0,i.useEffect)((()=>("gutenberg"!==t&&(window.addEventListener("hashchange",m),m()),()=>{"gutenberg"!==t&&window.removeEventListener("hashchange",m)})),[t,m]);const g=s||u,y=a||d;return(0,i.createElement)(r.Provider,{value:{context:t,config:e,tabs:n,fields:o,values:g,updateValue:y,currentTab:O,setTab:p}},c)}},3250:(t,e,n)=>{"use strict";n.d(e,{$:()=>o});var i=n(1609),r=n(4164);function o({onClick:t,href:e,className:n,children:o,target:s,primary:a=!1,disabled:l=!1,...c}){const u=e?"a":"button",h={};e?(h.href=e,h.target=s||"_blank"):h.type="button";const d=(0,i.useCallback)((e=>{l?e.preventDefault():t(e)}),[t,l]);return(0,i.createElement)(u,{...h,...c,onClick:d,disabled:l,className:(0,r.A)("wpifycf-button",n,a&&"wpifycf-button--primary")},o)}},5587:(t,e,n)=>{"use strict";n.d(e,{D:()=>m});var i=n(1609),r=n(2619),o=n(7665),s=n(7723),a=n(4164);function l({html:t}){return(0,i.createElement)(o.tH,{fallback:t},(0,i.createElement)("span",{dangerouslySetInnerHTML:{__html:t}}))}function c({label:t,type:e,htmlId:n,renderOptions:r={},className:o,required:s,validity:c=[]}){return!0===r.noLabel?null:t?(0,i.createElement)("label",{htmlFor:n,className:(0,a.A)(`wpifycf-field__label wpifycf-field__label--${e}`,o,c.length&&"wpifycf-field__label--invalid")},(0,i.createElement)(l,{html:t}),s&&(0,i.createElement)("span",{className:"wpifycf-field__required"},"*")):(0,i.createElement)("span",{className:`wpifycf-field__label wpifycf-field__label--${e}`})}var u=n(386);function h({renderOptions:t={},children:e}){return t.noFieldWrapper?e:(0,i.createElement)("div",{className:"wpifycf-field__wrapper"},e)}function d({renderOptions:t={},children:e}){return t.noControlWrapper?e:(0,i.createElement)("div",{className:"wpifycf-field__control"},e)}function O({description:t,descriptionPosition:e}){return t?(0,i.createElement)("div",{className:(0,a.A)("wpifycf-field__description",`wpifycf-field__description--${e}`),dangerouslySetInnerHTML:{__html:t}}):null}var f=n(5103),p=n(7316);function m({type:t,name:e,renderOptions:n,description:l,value:m,tab:g,setValidity:y,conditions:$,fieldPath:v,isRoot:b=!1,generator:S,...w}){const x=(0,i.useMemo)((()=>(0,f.JC)(t,w)),[t,w]),{currentTab:Q,values:P}=(0,i.useContext)(p.B),{getValue:_}=(0,u.oV)(v),k=!(0,u.AS)({conditions:$,fieldPath:v})||!(!g||!Q||Q===g)||"hidden"===t,T=(0,i.useMemo)((()=>k||"function"!=typeof x.checkValidity?[]:x.checkValidity(m,{...w,type:t})),[x,m,w,t,k]);(0,i.useEffect)((()=>{"function"==typeof y&&y(T)}),[y,T]),(0,i.useEffect)((()=>{if(m||"string"!=typeof S)null==m&&w.default&&w.onChange(w.default);else{const t=(0,r.applyFilters)("wpifycf_generator_"+S,m,w);t&&t!==m&&w.onChange(t)}}),[m,S,w.onChange,w.default]);const C=e&&(0,i.createElement)("input",{type:"hidden",name:e,"data-hide-field":k?"true":"false",value:void 0===m?"":"string"!=typeof m?JSON.stringify(m):m}),z=w.validity?.filter((t=>"string"==typeof t))||[],R={...x.renderOptions||{},...n,...w.render_options||{}};return k?C:(0,i.createElement)(h,{renderOptions:R},(0,i.createElement)(c,{...w,renderOptions:R,type:t,className:"wpifycf-field__label",isRoot:b}),(0,i.createElement)(d,{renderOptions:R},C,"before"===x.descriptionPosition&&(0,i.createElement)(O,{description:l,descriptionPosition:"before"}),(0,i.createElement)(o.tH,{fallback:(0,i.createElement)("div",{className:"wpifycf-error-boundary"},(0,s.sprintf)((0,s.__)("An error occurred while rendering the field of type %s.","wpify-custom-fields"),t))},(0,i.createElement)(x,{...w,type:t,value:m,className:(0,a.A)("wpifycf-field",`wpifycf-field--${t}`,w.className,z.length>0&&"wpifycf-field--invalid",R.noLabel&&"wpifycf-field--no-label",R.isRoot&&"wpifycf-field--is-root"),fieldPath:v,allValues:P,getValue:_})),z.map(((t,e)=>(0,i.createElement)("label",{htmlFor:w.htmlId,key:e,className:"wpifycf-field__error"},t))),"before"!==x.descriptionPosition&&(0,i.createElement)(O,{description:l,descriptionPosition:"after"})))}},9388:(t,e,n)=>{"use strict";n.d(e,{K:()=>V});var i=n(1609),r=n(4164),o=n(3349),s=n(5573),a=n(4848);const l=(0,a.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.jsx)(s.Path,{d:"m12 20-4.5-3.6-.9 1.2L12 22l5.5-4.4-.9-1.2L12 20zm0-16 4.5 3.6.9-1.2L12 2 6.5 6.4l.9 1.2L12 4z"})}),c=(0,a.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.jsx)(s.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5 4.5h11a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V5a.5.5 0 0 1 .5-.5ZM3 5a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5Zm17 3v10.75c0 .69-.56 1.25-1.25 1.25H6v1.5h12.75a2.75 2.75 0 0 0 2.75-2.75V8H20Z"})});var u=n(2391);const h=(0,a.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.jsx)(s.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})}),d=(0,a.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.jsx)(s.Path,{d:"M7 11.5h10V13H7z"})}),O=(0,a.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.jsx)(s.Path,{d:"M14.7 11.3c1-.6 1.5-1.6 1.5-3 0-2.3-1.3-3.4-4-3.4H7v14h5.8c1.4 0 2.5-.3 3.3-1 .8-.7 1.2-1.7 1.2-2.9.1-1.9-.8-3.1-2.6-3.7zm-5.1-4h2.3c.6 0 1.1.1 1.4.4.3.3.5.7.5 1.2s-.2 1-.5 1.2c-.3.3-.8.4-1.4.4H9.6V7.3zm4.6 9c-.4.3-1 .4-1.7.4H9.6v-3.9h2.9c.7 0 1.3.2 1.7.5.4.3.6.8.6 1.5s-.2 1.2-.6 1.5z"})}),f=(0,a.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.jsx)(s.Path,{d:"M12.5 5L10 19h1.9l2.5-14z"})}),p=(0,a.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.jsx)(s.Path,{d:"M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z"})}),m=(0,a.jsx)(s.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,a.jsx)(s.Path,{d:"M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z"})}),g=(0,a.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.jsx)(s.Path,{d:"M17.6 7c-.6.9-1.5 1.7-2.6 2v1h2v7h2V7h-1.4zM11 11H7V7H5v10h2v-4h4v4h2V7h-2v4z"})}),y=(0,a.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.jsx)(s.Path,{d:"M9 11.1H5v-4H3v10h2v-4h4v4h2v-10H9v4zm8 4c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6v1.5h8v-2H17z"})}),$=(0,a.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.jsx)(s.Path,{d:"M9 11H5V7H3v10h2v-4h4v4h2V7H9v4zm11.3 1.7c-.4-.4-1-.7-1.6-.8v-.1c.6-.2 1.1-.5 1.5-.9.3-.4.5-.8.5-1.3 0-.4-.1-.8-.3-1.1-.2-.3-.5-.6-.8-.8-.4-.2-.8-.4-1.2-.5-.6-.1-1.1-.2-1.6-.2-.6 0-1.3.1-1.8.3s-1.1.5-1.6.9l1.2 1.4c.4-.2.7-.4 1.1-.6.3-.2.7-.3 1.1-.3.4 0 .8.1 1.1.3.3.2.4.5.4.8 0 .4-.2.7-.6.9-.7.3-1.5.5-2.2.4v1.6c.5 0 1 0 1.5.1.3.1.7.2 1 .3.2.1.4.2.5.4s.1.4.1.6c0 .3-.2.7-.5.8-.4.2-.9.3-1.4.3s-1-.1-1.4-.3c-.4-.2-.8-.4-1.2-.7L13 15.6c.5.4 1 .8 1.6 1 .7.3 1.5.4 2.3.4.6 0 1.1-.1 1.6-.2.4-.1.9-.2 1.3-.5.4-.2.7-.5.9-.9.2-.4.3-.8.3-1.2 0-.6-.3-1.1-.7-1.5z"})}),v=(0,a.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.jsx)(s.Path,{d:"M20 13V7h-3l-4 6v2h5v2h2v-2h1v-2h-1zm-2 0h-2.8L18 9v4zm-9-2H5V7H3v10h2v-4h4v4h2V7H9v4z"})}),b=(0,a.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.jsx)(s.Path,{d:"M9 11H5V7H3v10h2v-4h4v4h2V7H9v4zm11.7 1.2c-.2-.3-.5-.7-.8-.9-.3-.3-.7-.5-1.1-.6-.5-.1-.9-.2-1.4-.2-.2 0-.5.1-.7.1-.2.1-.5.1-.7.2l.1-1.9h4.3V7H14l-.3 5 1 .6.5-.2.4-.1c.1-.1.3-.1.4-.1h.5c.5 0 1 .1 1.4.4.4.2.6.7.6 1.1 0 .4-.2.8-.6 1.1-.4.3-.9.4-1.4.4-.4 0-.9-.1-1.3-.3-.4-.2-.7-.4-1.1-.7 0 0-1.1 1.4-1 1.5.5.4 1 .8 1.6 1 .7.3 1.5.4 2.3.4.5 0 1-.1 1.5-.3s.9-.4 1.3-.7c.4-.3.7-.7.9-1.1s.3-.9.3-1.4-.1-1-.3-1.4z"})}),S=(0,a.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.jsx)(s.Path,{d:"M20.7 12.4c-.2-.3-.4-.6-.7-.9s-.6-.5-1-.6c-.4-.2-.8-.2-1.2-.2-.5 0-.9.1-1.3.3s-.8.5-1.2.8c0-.5 0-.9.2-1.4l.6-.9c.2-.2.5-.4.8-.5.6-.2 1.3-.2 1.9 0 .3.1.6.3.8.5 0 0 1.3-1.3 1.3-1.4-.4-.3-.9-.6-1.4-.8-.6-.2-1.3-.3-2-.3-.6 0-1.1.1-1.7.4-.5.2-1 .5-1.4.9-.4.4-.8 1-1 1.6-.3.7-.4 1.5-.4 2.3s.1 1.5.3 2.1c.2.6.6 1.1 1 1.5.4.4.9.7 1.4.9 1 .3 2 .3 3 0 .4-.1.8-.3 1.2-.6.3-.3.6-.6.8-1 .2-.5.3-.9.3-1.4s-.1-.9-.3-1.3zm-2 2.1c-.1.2-.3.4-.4.5-.1.1-.3.2-.5.2-.2.1-.4.1-.6.1-.2.1-.5 0-.7-.1-.2 0-.3-.2-.5-.3-.1-.2-.3-.4-.4-.6-.2-.3-.3-.7-.3-1 .3-.3.6-.5 1-.7.3-.1.7-.2 1-.2.4 0 .8.1 1.1.3.3.3.4.7.4 1.1 0 .2 0 .5-.1.7zM9 11H5V7H3v10h2v-4h4v4h2V7H9v4z"})}),w=(0,a.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.jsx)(s.Path,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})}),x=(0,a.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.jsx)(s.Path,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM5 6.7V10h1V5.3L3.8 6l.4 1 .8-.3zm-.4 5.7c-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5h2.7v-1h-1c.3-.6.8-1.4.9-2.1.1-.3 0-.8-.2-1.1-.5-.6-1.3-.5-1.7-.4z"})}),Q=(0,a.jsx)(s.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,a.jsx)(s.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12zM7 16.5h6V15H7v1.5zm4-4h6V11h-6v1.5zM9 11H7v1.5h2V11zm6 5.5h2V15h-2v1.5z"})}),P=(0,a.jsx)(s.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,a.jsx)(s.Path,{d:"M13 6v6h5.2v4c0 .8-.2 1.4-.5 1.7-.6.6-1.6.6-2.5.5h-.3v1.5h.5c1 0 2.3-.1 3.3-1 .6-.6 1-1.6 1-2.8V6H13zm-9 6h5.2v4c0 .8-.2 1.4-.5 1.7-.6.6-1.6.6-2.5.5h-.3v1.5h.5c1 0 2.3-.1 3.3-1 .6-.6 1-1.6 1-2.8V6H4v6z"})}),_=(0,a.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.jsx)(s.Path,{d:"M5 11.25h14v1.5H5z"})}),k=(0,a.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.jsx)(s.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"})}),T=(0,a.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.jsx)(s.Path,{d:"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z"})}),C=(0,a.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.jsx)(s.Path,{d:"m9.99609 14v-.2251l.00391.0001v6.225h1.5v-14.5h2.5v14.5h1.5v-14.5h3v-1.5h-8.50391c-2.76142 0-5 2.23858-5 5 0 2.7614 2.23858 5 5 5z"})}),z=(0,a.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.jsx)(s.Path,{d:"M7 18v1h10v-1H7zm5-2c1.5 0 2.6-.4 3.4-1.2.8-.8 1.1-2 1.1-3.5V5H15v5.8c0 1.2-.2 2.1-.6 2.8-.4.7-1.2 1-2.4 1s-2-.3-2.4-1c-.4-.7-.6-1.6-.6-2.8V5H7.5v6.2c0 1.5.4 2.7 1.1 3.5.8.9 1.9 1.3 3.4 1.3z"})}),R=(0,a.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.jsx)(s.Path,{d:"M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z"})}),E=(0,a.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.jsx)(s.Path,{d:"M17.031 4.703 15.576 4l-1.56 3H14v.03l-2.324 4.47H9.5V13h1.396l-1.502 2.889h-.95a3.694 3.694 0 0 1 0-7.389H10V7H8.444a5.194 5.194 0 1 0 0 10.389h.17L7.5 19.53l1.416.719L15.049 8.5h.507a3.694 3.694 0 0 1 0 7.39H14v1.5h1.556a5.194 5.194 0 0 0 .273-10.383l1.202-2.304Z"})}),A=(0,a.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.jsx)(s.Path,{d:"M6.13 5.5l1.926 1.927A4.975 4.975 0 007.025 10H5v1.5h2V13H5v1.5h2.1a5.002 5.002 0 009.8 0H19V13h-2v-1.5h2V10h-2.025a4.979 4.979 0 00-1.167-2.74l1.76-1.76-1.061-1.06-1.834 1.834A4.977 4.977 0 0012 5.5c-1.062 0-2.046.33-2.855.895L7.19 4.44 6.13 5.5zm2.37 5v3a3.5 3.5 0 107 0v-3a3.5 3.5 0 10-7 0z",fillRule:"evenodd",clipRule:"evenodd"})});var Z=n(7677);const M={trash:o.A,move:l,duplicate:c,edit:u.A,plus:h,minus:d,bold:O,italic:f,strike:p,code:m,h1:g,h2:y,h3:$,h4:v,h5:b,h6:S,bulletList:w,numberList:x,preformatted:Q,quote:P,line:_,arrowLeft:k,arrowRight:T,paragraph:C,underline:z,link:R,linkOff:E};function V({onClick:t,href:e,className:n,icon:o,style:s="light",size:a=20}){const l=e?"a":"button",c={};e?(c.href=e,c.target="_blank"):c.type="button";const u=M[o]||A;return(0,i.createElement)(l,{...c,onClick:t,className:(0,r.A)("wpifycf-icon-button",`wpifycf-icon-button--${s}`,`wpifycf-icon-button--${o}`,n)},(0,i.createElement)(Z.A,{icon:u,size:a}))}},6353:(t,e,n)=>{"use strict";n.d(e,{q:()=>c});var i=n(1609),r=n(9388),o=n(386),s=n(3250),a=n(4164),l=n(5587);function c({type:t,name:e,value:n=[],onChange:c,default:u,buttons:h={},disabled_buttons:d=[],min:O,max:f,htmlId:p,className:m,validity:g=[],fieldPath:y,disabled:$=!1,...v}){const{add:b,remove:S,handleChange:w,canAdd:x,canRemove:Q,canMove:P,containerRef:_,keyPrefix:k}=(0,o.NQ)({value:n,onChange:c,min:O,max:f,defaultValue:u,disabled_buttons:d,disabled:$,dragHandle:".wpifycf-multi-field-item__sort"}),T=g?.reduce(((t,e)=>"object"==typeof e?{...t,...e}:t),{});return(0,i.createElement)("div",{className:(0,a.A)("wpifycf-multi-field",`wpifycf-multi-field--${t}`,m)},e&&(0,i.createElement)("input",{type:"hidden",name:e,value:JSON.stringify(n)}),(0,i.createElement)("div",{className:"wpifycf-multi-field-items",ref:_},Array.isArray(n)&&n.map(((e,n)=>(0,i.createElement)("div",{className:(0,a.A)("wpifycf-multi-field-item"),key:k+"."+n},P&&(0,i.createElement)("div",{className:"wpifycf-multi-field-item__sort"},(0,i.createElement)(r.K,{icon:"move",className:"wpifycf-sort"})),(0,i.createElement)("div",{className:`wpifycf-multi-field-item-field wpifycf-multi-field-item-field--${t}`},(0,i.createElement)(l.D,{...v,type:t,value:e,default:u,onChange:w(n),htmlId:p+"."+n,validity:T[n],renderOptions:{noLabel:!0,noWrapper:!0},fieldPath:`${y}[${n}]`,disabled:$})),Q&&(0,i.createElement)("div",{className:"wpifycf-multi-field-item-actions"},h.remove?(0,i.createElement)(s.$,{onClick:S(n)},h.remove):(0,i.createElement)(r.K,{icon:"trash",onClick:S(n)})))))),x&&(0,i.createElement)("div",{className:"wpifycf-multi-field-item-buttons-after"},h.add?(0,i.createElement)(s.$,{onClick:b},h.add):(0,i.createElement)(r.K,{icon:"plus",onClick:b,size:24})))}},5028:(t,e,n)=>{"use strict";n.d(e,{l:()=>l});var i=n(1609),r=n(5480),o=n(386),s=n(3762),a=n(5103);function l({postType:t,onChange:e,onSelect:n,value:l,exclude:c,include:u,disabled:h}){const[d,O]=(0,i.useState)(""),[f,p]=(0,i.useState)(void 0),m=(0,r.d7)(d,300),{data:g=[],isLoading:y}=(0,o.j6)({postType:t,s:m,ensure:[l],select:t=>t.map((t=>({...t,label:(0,a.QZ)(t.title),value:t.id}))),exclude:c,include:u}),$=(0,i.useMemo)((()=>l&&g.find((t=>String(t.value)===String(l)))),[g,l]);(0,i.useEffect)((()=>{f!==$&&(p($),"function"==typeof n&&n($))}),[f,$,n]);const v=(0,i.useCallback)((t=>{void 0!==t&&("function"==typeof e&&e(t?.value),"function"==typeof n&&n(t),p(t))}),[e,n]);return(0,i.createElement)(s.Ay,{unstyled:!0,isLoading:y,isClearable:!0,options:g,value:$,onInputChange:O,filterOption:Boolean,className:"wpifycf-select",classNamePrefix:"wpifycf-select",onChange:v,menuPortalTarget:document.body,isDisabled:h})}},9550:(t,e,n)=>{"use strict";n.d(e,{l:()=>a});var i=n(1609),r=n(3762),o=n(4164),s=n(7723);function a({value:t,onChange:e,options:n,filterOption:a,onInputChange:l,className:c,disabled:u,isFetching:h,...d}){const O=(0,i.useCallback)((t=>e(t?.value)),[e]),f=h?(0,s.__)("Loading options...","wpify-custom-fields"):(0,s.__)("Select an option","wpify-custom-fields");return(0,i.createElement)(r.Ay,{unstyled:!0,value:t,onChange:O,options:n,isClearable:!0,className:(0,o.A)("wpifycf-select",c),classNamePrefix:"wpifycf-select",filterOption:a,onInputChange:l,menuPortalTarget:document.body,isDisabled:u,placeholder:f,...d})}},4006:(t,e,n)=>{"use strict";var i=n(1609),r=n(5338),o=n(386),s=n(7316),a=n(5587);function l({fields:t,values:e,updateValue:n,renderOptions:r,handleValidityChange:o,validate:s,validity:l}){return(0,i.createElement)("div",{className:"wpifycf-app-instance__fields"},t.map((t=>(0,i.createElement)(a.D,{key:t.id,...t,name:t.name||t.id,value:e[t.id],htmlId:t.id.replace(/[\[\]]+/g,"_"),onChange:n(t.id),renderOptions:r,setValidity:o(t.id),validity:s?l[t.id]:[],fieldPath:t.id,setTitle:()=>null}))))}var c=n(4164);function u(){const{currentTab:t,setTab:e,tabs:n}=(0,i.useContext)(s.B),r=(0,i.useCallback)((t=>()=>e(t)),[e]);return Object.keys(n).length>1?(0,i.createElement)("nav",{className:"nav-tab-wrapper"},Object.keys(n).map((e=>(0,i.createElement)("button",{key:e,className:(0,c.A)("nav-tab",{"nav-tab-active":e===t}),onClick:r(e),type:"button"},n[e])))):null}var h=n(2619);function d({form:t}){const{fields:e,values:n,updateValue:r,context:a}=(0,i.useContext)(s.B),{validity:c,validate:d,handleValidityChange:O}=(0,o.KL)({form:t}),f=(0,i.useMemo)((()=>({isRoot:!0})),[]),p=(0,h.applyFilters)("wpifycf_definition",e,n,{context:a});return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(u,null),(0,i.createElement)(l,{fields:p,values:n,updateValue:r,renderOptions:f,handleValidityChange:O,validate:d,validity:c}))}var O=n(5103),f=n(4880),p=n(9757),m=n(6261),g=n(6500),y=class extends g.Q{constructor(t={}){super(),this.config=t,this.#t=new Map}#t;build(t,e,n){const i=e.queryKey,r=e.queryHash??(0,f.F$)(i,e);let o=this.get(r);return o||(o=new p.X({cache:this,queryKey:i,queryHash:r,options:t.defaultQueryOptions(e),state:n,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){this.#t.has(t.queryHash)||(this.#t.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#t.get(t.queryHash);e&&(t.destroy(),e===t&&this.#t.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){m.j.batch((()=>{this.getAll().forEach((t=>{this.remove(t)}))}))}get(t){return this.#t.get(t)}getAll(){return[...this.#t.values()]}find(t){const e={exact:!0,...t};return this.getAll().find((t=>(0,f.MK)(e,t)))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter((e=>(0,f.MK)(t,e))):e}notify(t){m.j.batch((()=>{this.listeners.forEach((e=>{e(t)}))}))}onFocus(){m.j.batch((()=>{this.getAll().forEach((t=>{t.onFocus()}))}))}onOnline(){m.j.batch((()=>{this.getAll().forEach((t=>{t.onOnline()}))}))}},$=n(6158),v=class extends g.Q{constructor(t={}){super(),this.config=t,this.#e=new Map,this.#n=Date.now()}#e;#n;build(t,e,n){const i=new $.s({mutationCache:this,mutationId:++this.#n,options:t.defaultMutationOptions(e),state:n});return this.add(i),i}add(t){const e=b(t),n=this.#e.get(e)??[];n.push(t),this.#e.set(e,n),this.notify({type:"added",mutation:t})}remove(t){const e=b(t);if(this.#e.has(e)){const n=this.#e.get(e)?.filter((e=>e!==t));n&&(0===n.length?this.#e.delete(e):this.#e.set(e,n))}this.notify({type:"removed",mutation:t})}canRun(t){const e=this.#e.get(b(t))?.find((t=>"pending"===t.state.status));return!e||e===t}runNext(t){const e=this.#e.get(b(t))?.find((e=>e!==t&&e.state.isPaused));return e?.continue()??Promise.resolve()}clear(){m.j.batch((()=>{this.getAll().forEach((t=>{this.remove(t)}))}))}getAll(){return[...this.#e.values()].flat()}find(t){const e={exact:!0,...t};return this.getAll().find((t=>(0,f.nJ)(e,t)))}findAll(t={}){return this.getAll().filter((e=>(0,f.nJ)(t,e)))}notify(t){m.j.batch((()=>{this.listeners.forEach((e=>{e(t)}))}))}resumePausedMutations(){const t=this.getAll().filter((t=>t.state.isPaused));return m.j.batch((()=>Promise.all(t.map((t=>t.continue().catch(f.lQ))))))}};function b(t){return t.options.scope?.id??String(t.mutationId)}var S=n(9658),w=n(6035);function x(t){return{onFetch:(e,n)=>{const i=e.options,r=e.fetchOptions?.meta?.fetchMore?.direction,o=e.state.data?.pages||[],s=e.state.data?.pageParams||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let n=!1;const c=(0,f.ZM)(e.options,e.fetchOptions),u=async(t,i,r)=>{if(n)return Promise.reject();if(null==i&&t.pages.length)return Promise.resolve(t);const o={queryKey:e.queryKey,pageParam:i,direction:r?"backward":"forward",meta:e.options.meta};var s;s=o,Object.defineProperty(s,"signal",{enumerable:!0,get:()=>(e.signal.aborted?n=!0:e.signal.addEventListener("abort",(()=>{n=!0})),e.signal)});const a=await c(o),{maxPages:l}=e.options,u=r?f.ZZ:f.y9;return{pages:u(t.pages,a,l),pageParams:u(t.pageParams,i,l)}};if(r&&o.length){const t="backward"===r,e={pages:o,pageParams:s},n=(t?P:Q)(i,e);a=await u(e,n,t)}else{const e=t??o.length;do{const t=0===l?s[0]??i.initialPageParam:Q(i,a);if(l>0&&null==t)break;a=await u(a,t),l++}while(le.options.persister?.(c,{queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n):e.fetchFn=c}}}function Q(t,{pages:e,pageParams:n}){const i=e.length-1;return e.length>0?t.getNextPageParam(e[i],e,n[i],n):void 0}function P(t,{pages:e,pageParams:n}){return e.length>0?t.getPreviousPageParam?.(e[0],e,n[0],n):void 0}var _=class{#i;#r;#o;#s;#a;#l;#c;#u;constructor(t={}){this.#i=t.queryCache||new y,this.#r=t.mutationCache||new v,this.#o=t.defaultOptions||{},this.#s=new Map,this.#a=new Map,this.#l=0}mount(){this.#l++,1===this.#l&&(this.#c=S.m.subscribe((async t=>{t&&(await this.resumePausedMutations(),this.#i.onFocus())})),this.#u=w.t.subscribe((async t=>{t&&(await this.resumePausedMutations(),this.#i.onOnline())})))}unmount(){this.#l--,0===this.#l&&(this.#c?.(),this.#c=void 0,this.#u?.(),this.#u=void 0)}isFetching(t){return this.#i.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#r.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#i.get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.getQueryData(t.queryKey);if(void 0===e)return this.fetchQuery(t);{const n=this.defaultQueryOptions(t),i=this.#i.build(this,n);return t.revalidateIfStale&&i.isStaleByTime((0,f.d2)(n.staleTime,i))&&this.prefetchQuery(n),Promise.resolve(e)}}getQueriesData(t){return this.#i.findAll(t).map((({queryKey:t,state:e})=>[t,e.data]))}setQueryData(t,e,n){const i=this.defaultQueryOptions({queryKey:t}),r=this.#i.get(i.queryHash),o=r?.state.data,s=(0,f.Zw)(e,o);if(void 0!==s)return this.#i.build(this,i).setData(s,{...n,manual:!0})}setQueriesData(t,e,n){return m.j.batch((()=>this.#i.findAll(t).map((({queryKey:t})=>[t,this.setQueryData(t,e,n)]))))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#i.get(e.queryHash)?.state}removeQueries(t){const e=this.#i;m.j.batch((()=>{e.findAll(t).forEach((t=>{e.remove(t)}))}))}resetQueries(t,e){const n=this.#i,i={type:"active",...t};return m.j.batch((()=>(n.findAll(t).forEach((t=>{t.reset()})),this.refetchQueries(i,e))))}cancelQueries(t={},e={}){const n={revert:!0,...e},i=m.j.batch((()=>this.#i.findAll(t).map((t=>t.cancel(n)))));return Promise.all(i).then(f.lQ).catch(f.lQ)}invalidateQueries(t={},e={}){return m.j.batch((()=>{if(this.#i.findAll(t).forEach((t=>{t.invalidate()})),"none"===t.refetchType)return Promise.resolve();const n={...t,type:t.refetchType??t.type??"active"};return this.refetchQueries(n,e)}))}refetchQueries(t={},e){const n={...e,cancelRefetch:e?.cancelRefetch??!0},i=m.j.batch((()=>this.#i.findAll(t).filter((t=>!t.isDisabled())).map((t=>{let e=t.fetch(void 0,n);return n.throwOnError||(e=e.catch(f.lQ)),"paused"===t.state.fetchStatus?Promise.resolve():e}))));return Promise.all(i).then(f.lQ)}fetchQuery(t){const e=this.defaultQueryOptions(t);void 0===e.retry&&(e.retry=!1);const n=this.#i.build(this,e);return n.isStaleByTime((0,f.d2)(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(f.lQ).catch(f.lQ)}fetchInfiniteQuery(t){return t.behavior=x(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(f.lQ).catch(f.lQ)}ensureInfiniteQueryData(t){return t.behavior=x(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return w.t.isOnline()?this.#r.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#i}getMutationCache(){return this.#r}getDefaultOptions(){return this.#o}setDefaultOptions(t){this.#o=t}setQueryDefaults(t,e){this.#s.set((0,f.EN)(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...this.#s.values()];let n={};return e.forEach((e=>{(0,f.Cp)(t,e.queryKey)&&(n={...n,...e.defaultOptions})})),n}setMutationDefaults(t,e){this.#a.set((0,f.EN)(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...this.#a.values()];let n={};return e.forEach((e=>{(0,f.Cp)(t,e.mutationKey)&&(n={...n,...e.defaultOptions})})),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...this.#o.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=(0,f.F$)(e.queryKey,e)),void 0===e.refetchOnReconnect&&(e.refetchOnReconnect="always"!==e.networkMode),void 0===e.throwOnError&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),!0!==e.enabled&&e.queryFn===f.hT&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#o.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#i.clear(),this.#r.clear()}},k=n(46);const T=window.wp.blocks;var C=n(4715),z=n(6427),R=n(7723),E=n(7677),A=n(5573),Z=n(4848);const M=(0,Z.jsx)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Z.jsx)(A.Path,{d:"M20.5 16h-.7V8c0-1.1-.9-2-2-2H6.2c-1.1 0-2 .9-2 2v8h-.7c-.8 0-1.5.7-1.5 1.5h20c0-.8-.7-1.5-1.5-1.5zM5.7 8c0-.3.2-.5.5-.5h11.6c.3 0 .5.2.5.5v7.6H5.7V8z"})});var V=n(2391),X=n(5480),q=n(7143),W=n(7665),j=n(442);const I=j.default||j,L="view",N="edit";function U({name:t,args:e}){const n=(0,C.useBlockProps)(),[r,l]=(0,i.useState)(L),c=(0,i.useCallback)((()=>l(L)),[]),u=(0,i.useCallback)((()=>l(N)),[]),{fields:d,values:O,updateValue:f}=(0,i.useContext)(s.B),p=d.filter((t=>"inspector"!==t.position)),m=d.filter((t=>"inspector"===t.position)),{validity:g,validate:y,handleValidityChange:$}=(0,o.KL)(),v=(0,h.applyFilters)("wpifycf_definition",d,O,{context:"gutenberg",name:t,args:e});return(0,i.createElement)("div",{...n},p.length>0&&(0,i.createElement)(C.BlockControls,null,(0,i.createElement)(z.ToolbarGroup,null,(0,i.createElement)(z.ToolbarButton,{isActive:r===L,onClick:c},(0,i.createElement)(E.A,{icon:M}),(0,R.__)("View","wpify-custom-fields")),(0,i.createElement)(z.ToolbarButton,{isActive:r===N,onClick:u},(0,i.createElement)(E.A,{icon:V.A}),(0,R.__)("Edit","wpify-custom-fields")))),(0,i.createElement)("div",{className:"wpifycf-gutenberg-block"},r===L&&(0,i.createElement)(D,{title:e.title,name:t,attributes:O,fields:d}),r===N&&(0,i.createElement)(Y,{fields:v,values:O,updateValue:f})),m.length>0&&(0,i.createElement)(C.InspectorControls,null,(0,i.createElement)(z.Panel,null,(0,i.createElement)(z.PanelBody,{title:(0,R.__)("Settings","wpify-custom-fields")},m.map((t=>(0,i.createElement)(z.PanelRow,{key:t.id},(0,i.createElement)(a.D,{key:t.id,...t,name:t.name||t.id,value:O[t.id],htmlId:t.id.replace(/[\[\]]+/g,"_"),onChange:f(t.id),renderOptions:{noFieldWrapper:!1,noControlWrapper:!1,isRoot:!0},setValidity:$(t.id),validity:y?g[t.id]:[],fieldPath:t.id,setTitle:()=>null}))))))))}function D({name:t,attributes:e,title:n,fields:r}){const s=(0,q.useSelect)((t=>t("core/editor")?.getCurrentPostId())),a=(0,X.d7)(e,500),l=(0,o.NW)({blockName:t,attributes:a,postId:s}),c=r.find((t=>"inner_blocks"===t.type)),u={replace:t=>{if("comment"===t.type&&c){const e=t.data.trim();if(/^inner_blocks[\s/]*$/.test(e))return(0,i.createElement)(C.InnerBlocks,{allowedBlocks:c.allowed_blocks,template:c.template,orientation:c.orientation,templateLock:c.template_lock})}}};return l.isFetching?(0,i.createElement)(F,{title:n,name:t}):l.isError?(0,i.createElement)(G,{title:n,name:t}):l.data?(0,i.createElement)(W.tH,{fallback:(0,i.createElement)(G,{title:n,name:t})},(0,i.createElement)("div",{className:"wpifycf-gutenberg-block__ssr"},I(l.data,u))):(0,i.createElement)(B,{title:n,name:t})}function Y({fields:t,values:e,updateValue:n}){const{validity:r,validate:s,handleValidityChange:a}=(0,o.KL)(),c=t.filter((t=>"inspector"!==t.position));return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(u,null),(0,i.createElement)("div",{className:"wpifycf-gutenberg-block__fields"},(0,i.createElement)(l,{fields:c,values:e,updateValue:n,renderOptions:{noFieldWrapper:!1,noControlWrapper:!1,isRoot:!0},handleValidityChange:a,validate:s,validity:r})))}function B({title:t,name:e}){return(0,i.createElement)("div",{className:"wpifycf-gutenberg-block__placeholder wpifycf-gutenberg-block__placeholder--empty",dangerouslySetInnerHTML:{__html:(0,R.sprintf)((0,R.__)("The block %1$s (%2$s) has no content to display."),t,e)}})}function G({title:t,name:e}){return(0,i.createElement)("div",{className:"wpifycf-gutenberg-block__placeholder wpifycf-gutenberg-block__placeholder--error",dangerouslySetInnerHTML:{__html:(0,R.sprintf)((0,R.__)("The block %1$s (%2$s) cannot been rendered."),t,e)}})}function F({title:t,name:e}){return(0,i.createElement)("div",{className:"wpifycf-gutenberg-block__placeholder wpifycf-gutenberg-block__placeholder--loading",dangerouslySetInnerHTML:{__html:(0,R.sprintf)((0,R.__)("Loading block %1$s (%2$s)..."),t,e)}})}function H(){return(0,i.createElement)(C.InnerBlocks.Content,null)}!function(t){n(6693),n(8759);const e=new _;function o(t){(0,O.CS)(t.stylesheet),document.querySelectorAll('.wpifycf-app-instance[data-loaded=false][data-instance="'+t.instance+'"]').forEach((n=>{const o=JSON.parse(n.dataset.fields||"[]"),a=o.map((({value:t,...e})=>e)),l=o.reduce(((t,{id:e,value:n})=>({...t,[e]:n})),{});(0,r.H)(n).render((0,i.createElement)(s.Q,{context:n.dataset.context,config:t,tabs:JSON.parse(n.dataset.tabs),fields:a,initialValues:l},(0,i.createElement)(k.Ht,{client:e},(0,i.createElement)(i.StrictMode,null,(0,i.createElement)(d,{form:n.closest("form")}))))),n.setAttribute("data-loaded","true")}))}document.addEventListener("DOMContentLoaded",(()=>o(t))),document.addEventListener("wpifycf_register_block_"+t.instance,(n=>function(t,n){if(t.detail.instance!==n.instance)return;(0,O.CS)(n.stylesheet);let{icon:r}=t.detail.args;r&&/]*>/gm.test(r)?r=(0,i.createElement)("span",{dangerouslySetInnerHTML:{__html:r}}):r||(r=(0,i.createElement)("svg",{viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg"},(0,i.createElement)("path",{opacity:"0.3",d:"M 345.265 37.602 L 345.265 474.4 C 345.265 495.122 362.065 511.922 382.787 511.922 C 403.51 511.922 420.31 495.122 420.31 474.4 L 420.31 37.602 C 420.31 16.879 403.51 0.08 382.787 0.08 C 362.065 0.08 345.265 16.879 345.265 37.602 Z"}),(0,i.createElement)("path",{opacity:"0.3",d:"M 188.442 37.602 L 188.442 472.475 C 188.442 493.198 205.241 509.998 225.964 509.998 C 246.687 509.998 263.486 493.198 263.486 472.475 L 263.486 37.602 C 263.486 16.879 246.687 0.08 225.964 0.08 C 205.241 0.08 188.442 16.879 188.442 37.602 Z"}),(0,i.createElement)("path",{opacity:"0.8",d:"M 34.734 50.347 L 191.098 484.6 C 198.132 504.137 219.673 514.272 239.21 507.237 C 258.747 500.202 268.882 478.662 261.848 459.125 L 105.484 24.871 C 98.45 5.335 76.909 -4.801 57.371 2.234 C 37.835 9.269 27.699 30.81 34.734 50.347 Z"}),(0,i.createElement)("path",{opacity:"0.8",d:"M 190.114 50.347 L 347.388 487.129 C 354.423 506.666 375.963 516.802 395.5 509.767 C 415.037 502.732 425.173 481.191 418.138 461.654 L 260.864 24.871 C 253.829 5.334 232.289 -4.801 212.751 2.234 C 193.215 9.269 183.079 30.81 190.114 50.347 Z"}),(0,i.createElement)("path",{opacity:"0.8",d:"M 347.419 50.347 L 406.575 214.632 C 413.61 234.17 435.15 244.304 454.687 237.27 C 474.224 230.236 484.36 208.694 477.325 189.157 L 418.17 24.871 C 411.135 5.334 389.594 -4.801 370.057 2.234 C 350.52 9.269 340.384 30.81 347.419 50.347 Z"}))),(0,T.registerBlockType)(t.detail,{...t.detail.args,icon:r,edit:({attributes:r,setAttributes:o,...a})=>{const l=(0,i.useCallback)((t=>e=>o({[t]:e})),[o]);return(0,i.createElement)(s.Q,{context:"gutenberg",config:n,tabs:t.detail.tabs,fields:t.detail.items,values:r,updateValue:l},(0,i.createElement)(k.Ht,{client:e},(0,i.createElement)(i.StrictMode,null,(0,i.createElement)(U,{...a,name:t.detail.name,args:t.detail.args}))))},save:H})}(n,t))),"undefined"!=typeof jQuery&&(jQuery(document).on("woocommerce_variations_loaded",(()=>o(t))),jQuery(document).on("menu-item-added",(()=>o(t))))}(JSON.parse(JSON.stringify(window.wpifycf)))},2452:(t,e,n)=>{"use strict";n.r(e),n.d(e,{AttachmentItem:()=>h,default:()=>d});var i=n(1609),r=n(4164),o=n(9388),s=n(3250),a=n(7723),l=n(386),c=n(1014);function u({value:t=0,id:e,onChange:n,attachment_type:o,attributes:c={},className:u,disabled:d=!1,setTitle:O}){const{attachment:f,setAttachment:p}=(0,l.po)(t);(0,i.useEffect)((()=>{O(f?f.filename:"")}),[f,O]);const m=(0,l.tj)({value:t,onChange:n,multiple:!1,title:(0,a.__)("Select attachment","wpify-custom-fields"),button:(0,a.__)("Select attachment","wpify-custom-fields"),type:o}),g=(0,i.useCallback)((()=>{p(null),n(0)}),[p,n]);return(0,i.createElement)("div",{className:(0,r.A)("wpifycf-field-attachment",`wpifycf-field-attachment--${e}`,c.class,u)},f&&(0,i.createElement)(h,{attachment:f,remove:g,disabled:d}),!f&&!d&&(0,i.createElement)(s.$,{onClick:m,className:"wpifycf-button__add"},(0,a.__)("Add attachment","wpify-custom-fields")))}function h({attachment:t,remove:e,disabled:n}){const s=t?.sizes?.medium?.url,a=t?.icon;return(0,i.createElement)("div",{className:(0,r.A)("wpifycf-attachment-item",{"wpifycf-attachment-item--has-thumbnail":!!s,"wpifycf-attachment-item--has-icon":!s})},s?(0,i.createElement)("div",{className:"wpifycf-attachment-item__thumbnail"},(0,i.createElement)("img",{src:s,alt:t.filename,width:150,height:150})):(0,i.createElement)("div",{className:"wpifycf-attachment-item__icon"},(0,i.createElement)("img",{src:a,alt:t.filename,width:50})),!s&&(0,i.createElement)("div",{className:"wpifycf-attachment-item__info"},t.filename),!n&&(0,i.createElement)("div",{className:"wpifycf-attachment-item__actions"},(0,i.createElement)(o.K,{href:t.editLink,icon:"edit",style:"dark"}),(0,i.createElement)(o.K,{onClick:e,icon:"trash",style:"dark"})))}u.checkValidity=c.QH;const d=u},9853:(t,e,n)=>{"use strict";n.r(e),n.d(e,{Button:()=>a,default:()=>l});var i=n(1609),r=n(3250),o=n(2619),s=n(4164);function a(t){const{title:e,id:n,url:a,href:l=a,action:c,primary:u=!1,disabled:h=!1,attributes:d={},className:O,target:f}=t,p=(0,i.useCallback)((e=>{c&&(e.preventDefault(),(0,o.doAction)(c,t))}),[c,t]);return(0,i.createElement)(r.$,{primary:u,href:l,onClick:p,className:(0,s.A)("wpifycf-field-button",`wpifycf-field-${n}`,d.class,O),disabled:h,target:f,...d},e)}const l=a},9572:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>l});var i=n(1609),r=n(4164),o=(n(2619),n(1014)),s=n(5103);function a({id:t,htmlId:e,onChange:n,value:o=!1,attributes:a={},className:l,title:c,disabled:u=!1,setTitle:h}){(0,i.useEffect)((()=>{"function"==typeof h&&h(o?(0,s.QZ)(c):"")}),[h,o,c]);const d=(0,i.useCallback)((t=>{n(t.target.checked)}),[n]);return(0,i.createElement)("label",null,(0,i.createElement)("input",{type:"checkbox",id:e,onChange:d,className:(0,r.A)("wpifycf-field-checkbox",`wpifycf-field-checkbox--${t}`,a.class,l),checked:o,disabled:u,...a}),(0,i.createElement)("span",{dangerouslySetInnerHTML:{__html:c}}))}a.checkValidity=o.Vj;const l=a},4582:(t,e,n)=>{"use strict";n.r(e),n.d(e,{Code:()=>Yv,default:()=>Bv});var i=n(1609),r=n(4164),o=(n(2619),n(7665)),s=n(8168),a=n(8587);class l{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,e,n){[t,e]=g(this,t,e);let i=[];return this.decompose(0,t,i,2),n.length&&n.decompose(0,n.length,i,3),this.decompose(e,this.length,i,1),u.from(i,this.length-(e-t)+n.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,e=this.length){[t,e]=g(this,t,e);let n=[];return this.decompose(t,e,n,0),u.from(n,e-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let e=this.scanIdentical(t,1),n=this.length-this.scanIdentical(t,-1),i=new O(this),r=new O(t);for(let t=e,o=e;;){if(i.next(t),r.next(t),t=0,i.lineBreak!=r.lineBreak||i.done!=r.done||i.value!=r.value)return!1;if(o+=i.value.length,i.done||o>=n)return!0}}iter(t=1){return new O(this,t)}iterRange(t,e=this.length){return new f(this,t,e)}iterLines(t,e){let n;if(null==t)n=this.iter();else{null==e&&(e=this.lines+1);let i=this.line(t).from;n=this.iterRange(i,Math.max(i,e==this.lines+1?this.length:e<=1?0:this.line(e-1).to))}return new p(n)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(0==t.length)throw new RangeError("A document must have at least one line");return 1!=t.length||t[0]?t.length<=32?new c(t):u.from(c.split(t,[])):l.empty}}class c extends l{constructor(t,e=function(t){let e=-1;for(let n of t)e+=n.length+1;return e}(t)){super(),this.text=t,this.length=e}get lines(){return this.text.length}get children(){return null}lineInner(t,e,n,i){for(let r=0;;r++){let o=this.text[r],s=i+o.length;if((e?n:s)>=t)return new m(i,s,n,o);i=s+1,n++}}decompose(t,e,n,i){let r=t<=0&&e>=this.length?this:new c(d(this.text,t,e),Math.min(e,this.length)-Math.max(0,t));if(1&i){let t=n.pop(),e=h(r.text,t.text.slice(),0,r.length);if(e.length<=32)n.push(new c(e,t.length+r.length));else{let t=e.length>>1;n.push(new c(e.slice(0,t)),new c(e.slice(t)))}}else n.push(r)}replace(t,e,n){if(!(n instanceof c))return super.replace(t,e,n);[t,e]=g(this,t,e);let i=h(this.text,h(n.text,d(this.text,0,t)),e),r=this.length+n.length-(e-t);return i.length<=32?new c(i,r):u.from(c.split(i,[]),r)}sliceString(t,e=this.length,n="\n"){[t,e]=g(this,t,e);let i="";for(let r=0,o=0;r<=e&&ot&&o&&(i+=n),tr&&(i+=s.slice(Math.max(0,t-r),e-r)),r=a+1}return i}flatten(t){for(let e of this.text)t.push(e)}scanIdentical(){return 0}static split(t,e){let n=[],i=-1;for(let r of t)n.push(r),i+=r.length+1,32==n.length&&(e.push(new c(n,i)),n=[],i=-1);return i>-1&&e.push(new c(n,i)),e}}class u extends l{constructor(t,e){super(),this.children=t,this.length=e,this.lines=0;for(let e of t)this.lines+=e.lines}lineInner(t,e,n,i){for(let r=0;;r++){let o=this.children[r],s=i+o.length,a=n+o.lines-1;if((e?a:s)>=t)return o.lineInner(t,e,n,i);i=s+1,n=a+1}}decompose(t,e,n,i){for(let r=0,o=0;o<=e&&r=o){let r=i&((o<=t?1:0)|(a>=e?2:0));o>=t&&a<=e&&!r?n.push(s):s.decompose(t-o,e-o,n,r)}o=a+1}}replace(t,e,n){if([t,e]=g(this,t,e),n.lines=r&&e<=s){let a=o.replace(t-r,e-r,n),l=this.lines-o.lines+a.lines;if(a.lines>4&&a.lines>l>>6){let r=this.children.slice();return r[i]=a,new u(r,this.length-(e-t)+n.length)}return super.replace(r,s,a)}r=s+1}return super.replace(t,e,n)}sliceString(t,e=this.length,n="\n"){[t,e]=g(this,t,e);let i="";for(let r=0,o=0;rt&&r&&(i+=n),to&&(i+=s.sliceString(t-o,e-o,n)),o=a+1}return i}flatten(t){for(let e of this.children)e.flatten(t)}scanIdentical(t,e){if(!(t instanceof u))return 0;let n=0,[i,r,o,s]=e>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=e,r+=e){if(i==o||r==s)return n;let a=this.children[i],l=t.children[r];if(a!=l)return n+a.scanIdentical(l,e);n+=a.length+1}}static from(t,e=t.reduce(((t,e)=>t+e.length+1),-1)){let n=0;for(let e of t)n+=e.lines;if(n<32){let n=[];for(let e of t)e.flatten(n);return new c(n,e)}let i=Math.max(32,n>>5),r=i<<1,o=i>>1,s=[],a=0,l=-1,h=[];function d(t){let e;if(t.lines>r&&t instanceof u)for(let e of t.children)d(e);else t.lines>o&&(a>o||!a)?(O(),s.push(t)):t instanceof c&&a&&(e=h[h.length-1])instanceof c&&t.lines+e.lines<=32?(a+=t.lines,l+=t.length+1,h[h.length-1]=new c(e.text.concat(t.text),e.length+1+t.length)):(a+t.lines>i&&O(),a+=t.lines,l+=t.length+1,h.push(t))}function O(){0!=a&&(s.push(1==h.length?h[0]:u.from(h,l)),l=-1,a=h.length=0)}for(let e of t)d(e);return O(),1==s.length?s[0]:new u(s,e)}}function h(t,e,n=0,i=1e9){for(let r=0,o=0,s=!0;o=n&&(l>i&&(a=a.slice(0,i-r)),r0?1:(t instanceof c?t.text.length:t.children.length)<<1]}nextInner(t,e){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,i=this.nodes[n],r=this.offsets[n],o=r>>1,s=i instanceof c?i.text.length:i.children.length;if(o==(e>0?s:0)){if(0==n)return this.done=!0,this.value="",this;e>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&r)==(e>0?0:1)){if(this.offsets[n]+=e,0==t)return this.lineBreak=!0,this.value="\n",this;t--}else if(i instanceof c){let r=i.text[o+(e<0?-1:0)];if(this.offsets[n]+=e,r.length>Math.max(0,t))return this.value=0==t?r:e>0?r.slice(t):r.slice(0,r.length-t),this;t-=r.length}else{let r=i.children[o+(e<0?-1:0)];t>r.length?(t-=r.length,this.offsets[n]+=e):(e<0&&this.offsets[n]--,this.nodes.push(r),this.offsets.push(e>0?1:(r instanceof c?r.text.length:r.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class f{constructor(t,e,n){this.value="",this.done=!1,this.cursor=new O(t,e>n?-1:1),this.pos=e>n?t.length:0,this.from=Math.min(e,n),this.to=Math.max(e,n)}nextInner(t,e){if(e<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,e<0?this.pos-this.to:this.from-this.pos);let n=e<0?this.pos-this.from:this.to-this.pos;t>n&&(t=n),n-=t;let{value:i}=this.cursor.next(t);return this.pos+=(i.length+t)*e,this.value=i.length<=n?i:e<0?i.slice(i.length-n):i.slice(0,n),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class p{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:e,lineBreak:n,value:i}=this.inner.next(t);return e&&this.afterBreak?(this.value="",this.afterBreak=!1):e?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(l.prototype[Symbol.iterator]=function(){return this.iter()},O.prototype[Symbol.iterator]=f.prototype[Symbol.iterator]=p.prototype[Symbol.iterator]=function(){return this});class m{constructor(t,e,n,i){this.from=t,this.to=e,this.number=n,this.text=i}get length(){return this.to-this.from}}function g(t,e,n){return[e=Math.max(0,Math.min(t.length,e)),Math.max(e,Math.min(t.length,n))]}let y="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map((t=>t?parseInt(t,36):1));for(let t=1;tt)return y[e-1]<=t;return!1}function v(t){return t>=127462&&t<=127487}function b(t,e,n=!0,i=!0){return(n?S:w)(t,e,i)}function S(t,e,n){if(e==t.length)return e;e&&x(t.charCodeAt(e))&&Q(t.charCodeAt(e-1))&&e--;let i=P(t,e);for(e+=k(i);e=0&&v(P(t,i));)n++,i-=2;if(n%2==0)break;e+=2}}}return e}function w(t,e,n){for(;e>0;){let i=S(t,e-2,n);if(i=56320&&t<57344}function Q(t){return t>=55296&&t<56320}function P(t,e){let n=t.charCodeAt(e);if(!Q(n)||e+1==t.length)return n;let i=t.charCodeAt(e+1);return x(i)?i-56320+(n-55296<<10)+65536:n}function _(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t)))}function k(t){return t<65536?1:2}const T=/\r\n?|\n/;var C=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(C||(C={}));class z{constructor(t){this.sections=t}get length(){let t=0;for(let e=0;et)return r+(t-i);r+=s}else{if(n!=C.Simple&&l>=t&&(n==C.TrackDel&&it||n==C.TrackBefore&&it))return null;if(l>t||l==t&&e<0&&!s)return t==i||e<0?r:r+a;r+=a}i=l}if(t>i)throw new RangeError(`Position ${t} is out of range for changeset of length ${i}`);return r}touchesRange(t,e=t){for(let n=0,i=0;n=0&&i<=e&&r>=t)return!(ie)||"cover";i=r}return!1}toString(){let t="";for(let e=0;e=0?":"+i:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some((t=>"number"!=typeof t)))throw new RangeError("Invalid JSON representation of ChangeDesc");return new z(t)}static create(t){return new z(t)}}class R extends z{constructor(t,e){super(t),this.inserted=e}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return Z(this,((e,n,i,r,o)=>t=t.replace(i,i+(n-e),o)),!1),t}mapDesc(t,e=!1){return M(this,t,e,!0)}invert(t){let e=this.sections.slice(),n=[];for(let i=0,r=0;i=0){e[i]=s,e[i+1]=o;let a=i>>1;for(;n.length0&&A(n,e,r.text),r.forward(t),s+=t}let l=t[o++];for(;s>1].toJSON()))}return t}static of(t,e,n){let i=[],r=[],o=0,s=null;function a(t=!1){if(!t&&!i.length)return;os||t<0||s>e)throw new RangeError(`Invalid change range ${t} to ${s} (in doc of length ${e})`);let h=u?"string"==typeof u?l.of(u.split(n||T)):u:l.empty,d=h.length;if(t==s&&0==d)return;to&&E(i,t-o,-1),E(i,s-t,d),A(r,i,h),o=s}}(t),a(!s),s}static empty(t){return new R(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let e=[],n=[];for(let i=0;ie&&"string"!=typeof t)))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==r.length)e.push(r[0],0);else{for(;n.length=0&&n<=0&&n==t[r+1]?t[r]+=e:0==e&&0==t[r]?t[r+1]+=n:i?(t[r]+=e,t[r+1]+=n):t.push(e,n)}function A(t,e,n){if(0==n.length)return;let i=e.length-2>>1;if(i>1])),!(n||s==t.sections.length||t.sections[s+1]<0);)a=t.sections[s++],c=t.sections[s++];e(r,u,o,h,d),r=u,o=h}}}function M(t,e,n,i=!1){let r=[],o=i?[]:null,s=new X(t),a=new X(e);for(let t=-1;;)if(-1==s.ins&&-1==a.ins){let t=Math.min(s.len,a.len);E(r,t,-1),s.forward(t),a.forward(t)}else if(a.ins>=0&&(s.ins<0||t==s.i||0==s.off&&(a.len=0&&t=0)){if(s.done&&a.done)return o?R.createSet(r,o):z.create(r);throw new Error("Mismatched change set lengths")}{let e=0,n=s.len;for(;n;)if(-1==a.ins){let t=Math.min(n,a.len);e+=t,n-=t,a.forward(t)}else{if(!(0==a.ins&&a.lene||s.ins>=0&&s.len>e)&&(t||i.length>n),o.forward2(e),s.forward(e)}}else E(i,0,s.ins,t),r&&A(r,i,s.text),s.next()}}class X{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i>1;return e>=t.length?l.empty:t[e]}textBit(t){let{inserted:e}=this.set,n=this.i-2>>1;return n>=e.length&&!t?l.empty:e[n].slice(this.off,null==t?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){-1==this.ins?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class q{constructor(t,e,n){this.from=t,this.to=e,this.flags=n}get anchor(){return 32&this.flags?this.to:this.from}get head(){return 32&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 8&this.flags?-1:16&this.flags?1:0}get bidiLevel(){let t=7&this.flags;return 7==t?null:t}get goalColumn(){let t=this.flags>>6;return 16777215==t?void 0:t}map(t,e=-1){let n,i;return this.empty?n=i=t.mapPos(this.from,e):(n=t.mapPos(this.from,1),i=t.mapPos(this.to,-1)),n==this.from&&i==this.to?this:new q(n,i,this.flags)}extend(t,e=t){if(t<=this.anchor&&e>=this.anchor)return W.range(t,e);let n=Math.abs(t-this.anchor)>Math.abs(e-this.anchor)?t:e;return W.range(this.anchor,n)}eq(t,e=!1){return!(this.anchor!=t.anchor||this.head!=t.head||e&&this.empty&&this.assoc!=t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||"number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid JSON representation for SelectionRange");return W.range(t.anchor,t.head)}static create(t,e,n){return new q(t,e,n)}}class W{constructor(t,e){this.ranges=t,this.mainIndex=e}map(t,e=-1){return t.empty?this:W.create(this.ranges.map((n=>n.map(t,e))),this.mainIndex)}eq(t,e=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let n=0;nt.toJSON())),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||"number"!=typeof t.main||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new W(t.ranges.map((t=>q.fromJSON(t))),t.main)}static single(t,e=t){return new W([W.range(t,e)],0)}static create(t,e=0){if(0==t.length)throw new RangeError("A selection needs at least one range");for(let n=0,i=0;it?8:0)|r)}static normalized(t,e=0){let n=t[e];t.sort(((t,e)=>t.from-e.from)),e=t.indexOf(n);for(let n=1;ni.head?W.range(s,o):W.range(o,s))}}return new W(t,e)}}function j(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let I=0;class L{constructor(t,e,n,i,r){this.combine=t,this.compareInput=e,this.compare=n,this.isStatic=i,this.id=I++,this.default=t([]),this.extensions="function"==typeof r?r(this):r}get reader(){return this}static define(t={}){return new L(t.combine||(t=>t),t.compareInput||((t,e)=>t===e),t.compare||(t.combine?(t,e)=>t===e:N),!!t.static,t.enables)}of(t){return new U([],this,0,t)}compute(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new U(t,this,1,e)}computeN(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new U(t,this,2,e)}from(t,e){return e||(e=t=>t),this.compute([t],(n=>e(n.field(t))))}}function N(t,e){return t==e||t.length==e.length&&t.every(((t,n)=>t===e[n]))}class U{constructor(t,e,n,i){this.dependencies=t,this.facet=e,this.type=n,this.value=i,this.id=I++}dynamicSlot(t){var e;let n=this.value,i=this.facet.compareInput,r=this.id,o=t[r]>>1,s=2==this.type,a=!1,l=!1,c=[];for(let n of this.dependencies)"doc"==n?a=!0:"selection"==n?l=!0:1&(null!==(e=t[n.id])&&void 0!==e?e:1)||c.push(t[n.id]);return{create:t=>(t.values[o]=n(t),1),update(t,e){if(a&&e.docChanged||l&&(e.docChanged||e.selection)||Y(t,c)){let e=n(t);if(s?!D(e,t.values[o],i):!i(e,t.values[o]))return t.values[o]=e,1}return 0},reconfigure:(t,e)=>{let a,l=e.config.address[r];if(null!=l){let r=rt(e,l);if(this.dependencies.every((n=>n instanceof L?e.facet(n)===t.facet(n):!(n instanceof F)||e.field(n,!1)==t.field(n,!1)))||(s?D(a=n(t),r,i):i(a=n(t),r)))return t.values[o]=r,0}else a=n(t);return t.values[o]=a,1}}}}function D(t,e,n){if(t.length!=e.length)return!1;for(let i=0;it[e.id])),r=n.map((t=>t.type)),o=i.filter((t=>!(1&t))),s=t[e.id]>>1;function a(t){let n=[];for(let e=0;et===e),t);return t.provide&&(e.provides=t.provide(e)),e}create(t){let e=t.facet(G).find((t=>t.field==this));return((null==e?void 0:e.create)||this.createF)(t)}slot(t){let e=t[this.id]>>1;return{create:t=>(t.values[e]=this.create(t),1),update:(t,n)=>{let i=t.values[e],r=this.updateF(i,n);return this.compareF(i,r)?0:(t.values[e]=r,1)},reconfigure:(t,n)=>null!=n.config.address[this.id]?(t.values[e]=n.field(this),0):(t.values[e]=this.create(t),1)}}init(t){return[this,G.of({field:this,create:t})]}get extension(){return this}}function H(t){return e=>new J(e,t)}const K={highest:H(0),high:H(1),default:H(2),low:H(3),lowest:H(4)};class J{constructor(t,e){this.inner=t,this.prec=e}}class tt{of(t){return new et(this,t)}reconfigure(t){return tt.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class et{constructor(t,e){this.compartment=t,this.inner=e}}class nt{constructor(t,e,n,i,r,o){for(this.base=t,this.compartments=e,this.dynamicSlots=n,this.address=i,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(t,e,n){let i=[],r=Object.create(null),o=new Map;for(let n of function(t,e,n){let i=[[],[],[],[],[]],r=new Map;return function t(o,s){let a=r.get(o);if(null!=a){if(a<=s)return;let t=i[a].indexOf(o);t>-1&&i[a].splice(t,1),o instanceof et&&n.delete(o.compartment)}if(r.set(o,s),Array.isArray(o))for(let e of o)t(e,s);else if(o instanceof et){if(n.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let i=e.get(o.compartment)||o.inner;n.set(o.compartment,i),t(i,s)}else if(o instanceof J)t(o.inner,o.prec);else if(o instanceof F)i[s].push(o),o.provides&&t(o.provides,s);else if(o instanceof U)i[s].push(o),o.facet.extensions&&t(o.facet.extensions,2);else{let e=o.extension;if(!e)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);t(e,s)}}(t,2),i.reduce(((t,e)=>t.concat(e)))}(t,e,o))n instanceof F?i.push(n):(r[n.facet.id]||(r[n.facet.id]=[])).push(n);let s=Object.create(null),a=[],l=[];for(let t of i)s[t.id]=l.length<<1,l.push((e=>t.slot(e)));let c=null==n?void 0:n.config.facets;for(let t in r){let e=r[t],i=e[0].facet,o=c&&c[t]||[];if(e.every((t=>0==t.type)))if(s[i.id]=a.length<<1|1,N(o,e))a.push(n.facet(i));else{let t=i.combine(e.map((t=>t.value)));a.push(n&&i.compare(t,n.facet(i))?n.facet(i):t)}else{for(let t of e)0==t.type?(s[t.id]=a.length<<1|1,a.push(t.value)):(s[t.id]=l.length<<1,l.push((e=>t.dynamicSlot(e))));s[i.id]=l.length<<1,l.push((t=>B(t,i,e)))}}let u=l.map((t=>t(s)));return new nt(t,o,u,s,a,r)}}function it(t,e){if(1&e)return 2;let n=e>>1,i=t.status[n];if(4==i)throw new Error("Cyclic dependency between fields and/or facets");if(2&i)return i;t.status[n]=4;let r=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|r}function rt(t,e){return 1&e?t.config.staticValues[e>>1]:t.values[e>>1]}const ot=L.define(),st=L.define({combine:t=>t.some((t=>t)),static:!0}),at=L.define({combine:t=>t.length?t[0]:void 0,static:!0}),lt=L.define(),ct=L.define(),ut=L.define(),ht=L.define({combine:t=>!!t.length&&t[0]});class dt{constructor(t,e){this.type=t,this.value=e}static define(){return new Ot}}class Ot{of(t){return new dt(this,t)}}class ft{constructor(t){this.map=t}of(t){return new pt(this,t)}}class pt{constructor(t,e){this.type=t,this.value=e}map(t){let e=this.type.map(this.value,t);return void 0===e?void 0:e==this.value?this:new pt(this.type,e)}is(t){return this.type==t}static define(t={}){return new ft(t.map||(t=>t))}static mapEffects(t,e){if(!t.length)return t;let n=[];for(let i of t){let t=i.map(e);t&&n.push(t)}return n}}pt.reconfigure=pt.define(),pt.appendConfig=pt.define();class mt{constructor(t,e,n,i,r,o){this.startState=t,this.changes=e,this.selection=n,this.effects=i,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,n&&j(n,e.newLength),r.some((t=>t.type==mt.time))||(this.annotations=r.concat(mt.time.of(Date.now())))}static create(t,e,n,i,r,o){return new mt(t,e,n,i,r,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(let e of this.annotations)if(e.type==t)return e.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let e=this.annotation(mt.userEvent);return!(!e||!(e==t||e.length>t.length&&e.slice(0,t.length)==t&&"."==e[t.length]))}}function gt(t,e){let n=[];for(let i=0,r=0;;){let o,s;if(i=t[i]))o=t[i++],s=t[i++];else{if(!(r=0;r--){let o=n[r](t);o&&Object.keys(o).length&&(i=yt(i,$t(e,o,t.changes.newLength),!0))}return i==t?t:mt.create(e,t.changes,t.selection,i.effects,i.annotations,i.scrollIntoView)}(n?function(t){let e=t.startState,n=!0;for(let i of e.facet(lt)){let e=i(t);if(!1===e){n=!1;break}Array.isArray(e)&&(n=!0===n?e:gt(n,e))}if(!0!==n){let i,r;if(!1===n)r=t.changes.invertedDesc,i=R.empty(e.doc.length);else{let e=t.changes.filter(n);i=e.changes,r=e.filtered.mapDesc(e.changes).invertedDesc}t=mt.create(e,i,t.selection&&t.selection.map(r),pt.mapEffects(t.effects,r),t.annotations,t.scrollIntoView)}let i=e.facet(ct);for(let n=i.length-1;n>=0;n--){let r=i[n](t);t=r instanceof mt?r:Array.isArray(r)&&1==r.length&&r[0]instanceof mt?r[0]:vt(e,St(r),!1)}return t}(r):r)}mt.time=dt.define(),mt.userEvent=dt.define(),mt.addToHistory=dt.define(),mt.remote=dt.define();const bt=[];function St(t){return null==t?bt:Array.isArray(t)?t:[t]}var wt=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(wt||(wt={}));const xt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Qt;try{Qt=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(t){}class Pt{constructor(t,e,n,i,r,o){this.config=t,this.doc=e,this.selection=n,this.values=i,this.status=t.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let t=0;tr.set(e,t))),n=null),r.set(e.value.compartment,e.value.extension)):e.is(pt.reconfigure)?(n=null,i=e.value):e.is(pt.appendConfig)&&(n=null,i=St(i).concat(e.value));n?e=t.startState.values.slice():(n=nt.resolve(i,r,this),e=new Pt(n,this.doc,this.selection,n.dynamicSlots.map((()=>null)),((t,e)=>e.reconfigure(t,this)),null).values);let o=t.startState.facet(st)?t.newSelection:t.newSelection.asSingle();new Pt(n,t.newDoc,o,e,((e,n)=>n.update(e,t)),t)}replaceSelection(t){return"string"==typeof t&&(t=this.toText(t)),this.changeByRange((e=>({changes:{from:e.from,to:e.to,insert:t},range:W.cursor(e.from+t.length)})))}changeByRange(t){let e=this.selection,n=t(e.ranges[0]),i=this.changes(n.changes),r=[n.range],o=St(n.effects);for(let n=1;nr.spec.fromJSON(o,t))))}return Pt.create({doc:t.doc,selection:W.fromJSON(t.selection),extensions:e.extensions?i.concat([e.extensions]):i})}static create(t={}){let e=nt.resolve(t.extensions||[],new Map),n=t.doc instanceof l?t.doc:l.of((t.doc||"").split(e.staticFacet(Pt.lineSeparator)||T)),i=t.selection?t.selection instanceof W?t.selection:W.single(t.selection.anchor,t.selection.head):W.single(0);return j(i,n.length),e.staticFacet(st)||(i=i.asSingle()),new Pt(e,n,i,e.dynamicSlots.map((()=>null)),((t,e)=>e.create(t)),null)}get tabSize(){return this.facet(Pt.tabSize)}get lineBreak(){return this.facet(Pt.lineSeparator)||"\n"}get readOnly(){return this.facet(ht)}phrase(t,...e){for(let e of this.facet(Pt.phrases))if(Object.prototype.hasOwnProperty.call(e,t)){t=e[t];break}return e.length&&(t=t.replace(/\$(\$|\d*)/g,((t,n)=>{if("$"==n)return"$";let i=+(n||1);return!i||i>e.length?t:e[i-1]}))),t}languageDataAt(t,e,n=-1){let i=[];for(let r of this.facet(ot))for(let o of r(this,e,n))Object.prototype.hasOwnProperty.call(o,t)&&i.push(o[t]);return i}charCategorizer(t){return e=this.languageDataAt("wordChars",t).join(""),t=>{if(!/\S/.test(t))return wt.Space;if(function(t){if(Qt)return Qt.test(t);for(let e=0;e"€"&&(n.toUpperCase()!=n.toLowerCase()||xt.test(n)))return!0}return!1}(t))return wt.Word;for(let n=0;n-1)return wt.Word;return wt.Other};var e}wordAt(t){let{text:e,from:n,length:i}=this.doc.lineAt(t),r=this.charCategorizer(t),o=t-n,s=t-n;for(;o>0;){let t=b(e,o,!1);if(r(e.slice(t,o))!=wt.Word)break;o=t}for(;st.length?t[0]:4}),Pt.lineSeparator=at,Pt.readOnly=ht,Pt.phrases=L.define({compare(t,e){let n=Object.keys(t),i=Object.keys(e);return n.length==i.length&&n.every((n=>t[n]==e[n]))}}),Pt.languageData=ot,Pt.changeFilter=lt,Pt.transactionFilter=ct,Pt.transactionExtender=ut,tt.reconfigure=pt.define();class kt{eq(t){return this==t}range(t,e=t){return Tt.create(t,e,this)}}kt.prototype.startSide=kt.prototype.endSide=0,kt.prototype.point=!1,kt.prototype.mapMode=C.TrackDel;class Tt{constructor(t,e,n){this.from=t,this.to=e,this.value=n}static create(t,e,n){return new Tt(t,e,n)}}function Ct(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class zt{constructor(t,e,n,i){this.from=t,this.to=e,this.value=n,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(t,e,n,i=0){let r=n?this.to:this.from;for(let o=i,s=r.length;;){if(o==s)return o;let i=o+s>>1,a=r[i]-t||(n?this.value[i].endSide:this.value[i].startSide)-e;if(i==o)return a>=0?o:s;a>=0?s=i:o=i+1}}between(t,e,n,i){for(let r=this.findIndex(e,-1e9,!0),o=this.findIndex(n,1e9,!1,r);rc||l==c&&u.startSide>0&&u.endSide<=0)continue;(c-l||u.endSide-u.startSide)<0||(o<0&&(o=l),u.point&&(s=Math.max(s,c-l)),n.push(u),i.push(l-o),r.push(c-o))}return{mapped:n.length?new zt(i,r,n,s):null,pos:o}}}class Rt{constructor(t,e,n,i){this.chunkPos=t,this.chunk=e,this.nextLayer=n,this.maxPoint=i}static create(t,e,n,i){return new Rt(t,e,n,i)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let e of this.chunk)t+=e.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:e=[],sort:n=!1,filterFrom:i=0,filterTo:r=this.length}=t,o=t.filter;if(0==e.length&&!o)return this;if(n&&(e=e.slice().sort(Ct)),this.isEmpty)return e.length?Rt.of(e):this;let s=new Zt(this,null,-1).goto(0),a=0,l=[],c=new Et;for(;s.value||a=0){let t=e[a++];c.addInner(t.from,t.to,t.value)||l.push(t)}else 1==s.rangeIndex&&s.chunkIndexthis.chunkEnd(s.chunkIndex)||rs.to||r=r&&t<=r+o.length&&!1===o.between(r,t-r,e-r,n))return}this.nextLayer.between(t,e,n)}}iter(t=0){return Mt.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,e=0){return Mt.from(t).goto(e)}static compare(t,e,n,i,r=-1){let o=t.filter((t=>t.maxPoint>0||!t.isEmpty&&t.maxPoint>=r)),s=e.filter((t=>t.maxPoint>0||!t.isEmpty&&t.maxPoint>=r)),a=At(o,s,n),l=new Xt(o,a,r),c=new Xt(s,a,r);n.iterGaps(((t,e,n)=>qt(l,t,c,e,n,i))),n.empty&&0==n.length&&qt(l,0,c,0,0,i)}static eq(t,e,n=0,i){null==i&&(i=999999999);let r=t.filter((t=>!t.isEmpty&&e.indexOf(t)<0)),o=e.filter((e=>!e.isEmpty&&t.indexOf(e)<0));if(r.length!=o.length)return!1;if(!r.length)return!0;let s=At(r,o),a=new Xt(r,s,0).goto(n),l=new Xt(o,s,0).goto(n);for(;;){if(a.to!=l.to||!Wt(a.active,l.active)||a.point&&(!l.point||!a.point.eq(l.point)))return!1;if(a.to>i)return!0;a.next(),l.next()}}static spans(t,e,n,i,r=-1){let o=new Xt(t,null,r).goto(e),s=e,a=o.openStart;for(;;){let t=Math.min(o.to,n);if(o.point){let n=o.activeForPoint(o.to),r=o.pointFroms&&(i.span(s,t,o.active,a),a=o.openEnd(t));if(o.to>n)return a+(o.point&&o.to>n?1:0);s=o.to,o.next()}}static of(t,e=!1){let n=new Et;for(let i of t instanceof Tt?[t]:e?function(t){if(t.length>1)for(let e=t[0],n=1;n0)return t.slice().sort(Ct);e=i}return t}(t):t)n.add(i.from,i.to,i.value);return n.finish()}static join(t){if(!t.length)return Rt.empty;let e=t[t.length-1];for(let n=t.length-2;n>=0;n--)for(let i=t[n];i!=Rt.empty;i=i.nextLayer)e=new Rt(i.chunkPos,i.chunk,e,Math.max(i.maxPoint,e.maxPoint));return e}}Rt.empty=new Rt([],[],null,-1),Rt.empty.nextLayer=Rt.empty;class Et{finishChunk(t){this.chunks.push(new zt(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,e,n){this.addInner(t,e,n)||(this.nextLayer||(this.nextLayer=new Et)).add(t,e,n)}addInner(t,e,n){let i=t-this.lastTo||n.startSide-this.last.endSide;if(i<=0&&(t-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(i<0||(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(e-this.chunkStart),this.last=n,this.lastFrom=t,this.lastTo=e,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,e-t)),0))}addChunk(t,e){if((t-this.lastTo||e.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,e.maxPoint),this.chunks.push(e),this.chunkPos.push(t);let n=e.value.length-1;return this.last=e.value[n],this.lastFrom=e.from[n]+t,this.lastTo=e.to[n]+t,!0}finish(){return this.finishInner(Rt.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return t;let e=Rt.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,e}}function At(t,e,n){let i=new Map;for(let e of t)for(let t=0;t=this.minPoint)break}}}setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=n&&i.push(new Zt(o,e,n,r));return 1==i.length?i[0]:new Mt(i)}get startSide(){return this.value?this.value.startSide:0}goto(t,e=-1e9){for(let n of this.heap)n.goto(t,e);for(let t=this.heap.length>>1;t>=0;t--)Vt(this.heap,t);return this.next(),this}forward(t,e){for(let n of this.heap)n.forward(t,e);for(let t=this.heap.length>>1;t>=0;t--)Vt(this.heap,t);(this.to-t||this.value.endSide-e)<0&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),Vt(this.heap,0)}}}function Vt(t,e){for(let n=t[e];;){let i=1+(e<<1);if(i>=t.length)break;let r=t[i];if(i+1=0&&(r=t[i+1],i++),n.compare(r)<0)break;t[i]=n,t[e]=r,e=i}}class Xt{constructor(t,e,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Mt.from(t,e,n)}goto(t,e=-1e9){return this.cursor.goto(t,e),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=e,this.openStart=-1,this.next(),this}forward(t,e){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-e)<0;)this.removeActive(this.minActive);this.cursor.forward(t,e)}removeActive(t){jt(this.active,t),jt(this.activeTo,t),jt(this.activeRank,t),this.minActive=Lt(this.active,this.activeTo)}addActive(t){let e=0,{value:n,to:i,rank:r}=this.cursor;for(;e0;)e++;It(this.active,e,n),It(this.activeTo,e,i),It(this.activeRank,e,r),t&&It(t,e,this.cursor.from),this.minActive=Lt(this.active,this.activeTo)}next(){let t=this.to,e=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>t){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),n&&jt(n,i)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}{let t=this.cursor.value;if(t.point){if(!(e&&this.cursor.to==this.to&&this.cursor.from=0&&n[e]=0&&!(this.activeRank[n]t||this.activeTo[n]==t&&this.active[n].endSide>=this.point.endSide)&&e.push(this.active[n]);return e.reverse()}openEnd(t){let e=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>t;n--)e++;return e}}function qt(t,e,n,i,r,o){t.goto(e),n.goto(i);let s=i+r,a=i,l=i-e;for(;;){let e=t.to+l-n.to||t.endSide-n.endSide,i=e<0?t.to+l:n.to,r=Math.min(i,s);if(t.point||n.point?t.point&&n.point&&(t.point==n.point||t.point.eq(n.point))&&Wt(t.activeForPoint(t.to),n.activeForPoint(n.to))||o.comparePoint(a,r,t.point,n.point):r>a&&!Wt(t.active,n.active)&&o.compareRange(a,r,t.active,n.active),i>s)break;a=i,e<=0&&t.next(),e>=0&&n.next()}}function Wt(t,e){if(t.length!=e.length)return!1;for(let n=0;n=e;n--)t[n+1]=t[n];t[e]=n}function Lt(t,e){let n=-1,i=1e9;for(let r=0;r=e)return i;if(i==t.length)break;r+=9==t.charCodeAt(i)?n-r%n:1,i=b(t,i)}return!0===i?-1:t.length}const Dt="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),Yt="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),Bt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};class Gt{constructor(t,e){this.rules=[];let{finish:n}=e||{};function i(t){return/^@/.test(t)?[t]:t.split(/,\s*/)}function r(t,e,o,s){let a=[],l=/^@(\w+)\b/.exec(t[0]),c=l&&"keyframes"==l[1];if(l&&null==e)return o.push(t[0]+";");for(let n in e){let s=e[n];if(/&/.test(n))r(n.split(/,\s*/).map((e=>t.map((t=>e.replace(/&/,t))))).reduce(((t,e)=>t.concat(e))),s,o);else if(s&&"object"==typeof s){if(!l)throw new RangeError("The value of a property ("+n+") should be a primitive value.");r(i(n),s,a,c)}else null!=s&&a.push(n.replace(/_.*/,"").replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))+": "+s+";")}(a.length||c)&&o.push((!n||l||s?t:t.map(n)).join(", ")+" {"+a.join(" ")+"}")}for(let e in t)r(i(e),t[e],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let t=Bt[Dt]||1;return Bt[Dt]=t+1,"ͼ"+t.toString(36)}static mount(t,e,n){let i=t[Yt],r=n&&n.nonce;i?r&&i.setNonce(r):i=new Ht(t,r),i.mount(Array.isArray(e)?e:[e],t)}}let Ft=new Map;class Ht{constructor(t,e){let n=t.ownerDocument||t,i=n.defaultView;if(!t.head&&t.adoptedStyleSheets&&i.CSSStyleSheet){let e=Ft.get(n);if(e)return t[Yt]=e;this.sheet=new i.CSSStyleSheet,Ft.set(n,this)}else this.styleTag=n.createElement("style"),e&&this.styleTag.setAttribute("nonce",e);this.modules=[],t[Yt]=this}mount(t,e){let n=this.sheet,i=0,r=0;for(let e=0;e-1&&(this.modules.splice(s,1),r--,s=-1),-1==s){if(this.modules.splice(r++,0,o),n)for(let t=0;t",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},te="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),ee="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),ne=0;ne<10;ne++)Kt[48+ne]=Kt[96+ne]=String(ne);for(ne=1;ne<=24;ne++)Kt[ne+111]="F"+ne;for(ne=65;ne<=90;ne++)Kt[ne]=String.fromCharCode(ne+32),Jt[ne]=String.fromCharCode(ne);for(var ie in Kt)Jt.hasOwnProperty(ie)||(Jt[ie]=Kt[ie]);function re(t){let e;return e=11==t.nodeType?t.getSelection?t:t.ownerDocument:t,e.getSelection()}function oe(t,e){return!!e&&(t==e||t.contains(1!=e.nodeType?e.parentNode:e))}function se(t,e){if(!e.anchorNode)return!1;try{return oe(t,e.anchorNode)}catch(t){return!1}}function ae(t){return 3==t.nodeType?ve(t,0,t.nodeValue.length).getClientRects():1==t.nodeType?t.getClientRects():[]}function le(t,e,n,i){return!!n&&(he(t,e,n,i,-1)||he(t,e,n,i,1))}function ce(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e}function ue(t){return 1==t.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function he(t,e,n,i,r){for(;;){if(t==n&&e==i)return!0;if(e==(r<0?0:de(t))){if("DIV"==t.nodeName)return!1;let n=t.parentNode;if(!n||1!=n.nodeType)return!1;e=ce(t)+(r<0?0:1),t=n}else{if(1!=t.nodeType)return!1;if(1==(t=t.childNodes[e+(r<0?-1:0)]).nodeType&&"false"==t.contentEditable)return!1;e=r<0?de(t):0}}}function de(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Oe(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function fe(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function pe(t,e){let n=e.width/t.offsetWidth,i=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.height-t.offsetHeight)<1)&&(i=1),{scaleX:n,scaleY:i}}class me{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){let{anchorNode:e,focusNode:n}=t;this.set(e,Math.min(t.anchorOffset,e?de(e):0),n,Math.min(t.focusOffset,n?de(n):0))}set(t,e,n,i){this.anchorNode=t,this.anchorOffset=e,this.focusNode=n,this.focusOffset=i}}let ge,ye=null;function $e(t){if(t.setActive)return t.setActive();if(ye)return t.focus(ye);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(null==ye?{get preventScroll(){return ye={preventScroll:!0},!0}}:void 0),!ye){ye=!1;for(let t=0;tMath.max(1,t.scrollHeight-t.clientHeight-4)}function xe(t,e){for(let n=t,i=e;;){if(3==n.nodeType&&i>0)return{node:n,offset:i};if(1==n.nodeType&&i>0){if("false"==n.contentEditable)return null;n=n.childNodes[i-1],i=de(n)}else{if(!n.parentNode||ue(n))return null;i=ce(n),n=n.parentNode}}}function Qe(t,e){for(let n=t,i=e;;){if(3==n.nodeType&&ie)return n.domBoundsAround(t,e,l);if(u>=t&&-1==i&&(i=a,r=l),l>e&&n.dom.parentNode==this.dom){o=a,s=c;break}c=u,l=u+n.breakAfter}return{from:r,to:s<0?n+this.length:s,startDOM:(i?this.children[i-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o=0?this.children[o].dom:null}}markDirty(t=!1){this.flags|=2,this.markParentsDirty(t)}markParentsDirty(t){for(let e=this.parent;e;e=e.parent){if(t&&(e.flags|=2),1&e.flags)return;e.flags|=1,t=!1}}setParent(t){this.parent!=t&&(this.parent=t,7&this.flags&&this.markParentsDirty(!0))}setDOM(t){this.dom!=t&&(this.dom&&(this.dom.cmView=null),this.dom=t,t.cmView=this)}get rootView(){for(let t=this;;){let e=t.parent;if(!e)return t;t=e}}replaceChildren(t,e,n=_e){this.markDirty();for(let i=t;ithis.pos||t==this.pos&&(e>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=t-this.pos,this;let n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}}function ze(t,e,n,i,r,o,s,a,l){let{children:c}=t,u=c.length?c[e]:null,h=o.length?o[o.length-1]:null,d=h?h.breakAfter:s;if(!(e==i&&u&&!s&&!d&&o.length<2&&u.merge(n,r,o.length?h:null,0==n,a,l))){if(i0&&(!s&&o.length&&u.merge(n,u.length,o[0],!1,a,0)?u.breakAfter=o.shift().breakAfter:(n2);var Ne={mac:Le||/Mac/.test(Ee.platform),windows:/Win/.test(Ee.platform),linux:/Linux|X11/.test(Ee.platform),ie:Xe,ie_version:Me?Ae.documentMode||6:Ve?+Ve[1]:Ze?+Ze[1]:0,gecko:qe,gecko_version:qe?+(/Firefox\/(\d+)/.exec(Ee.userAgent)||[0,0])[1]:0,chrome:!!We,chrome_version:We?+We[1]:0,ios:Le,android:/Android\b/.test(Ee.userAgent),webkit:je,safari:Ie,webkit_version:je?+(/\bAppleWebKit\/(\d+)/.exec(Ee.userAgent)||[0,0])[1]:0,tabSize:null!=Ae.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};class Ue extends ke{constructor(t){super(),this.text=t}get length(){return this.text.length}createDOM(t){this.setDOM(t||document.createTextNode(this.text))}sync(t,e){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text)}reuseDOM(t){3==t.nodeType&&this.createDOM(t)}merge(t,e,n){return!(8&this.flags||n&&(!(n instanceof Ue)||this.length-(e-t)+n.length>256||8&n.flags)||(this.text=this.text.slice(0,t)+(n?n.text:"")+this.text.slice(e),this.markDirty(),0))}split(t){let e=new Ue(this.text.slice(t));return this.text=this.text.slice(0,t),this.markDirty(),e.flags|=8&this.flags,e}localPosFromDOM(t,e){return t==this.dom?e:e?this.text.length:0}domAtPos(t){return new Pe(this.dom,t)}domBoundsAround(t,e,n){return{from:n,to:n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(t,e){return function(t,e,n){let i=t.nodeValue.length;e>i&&(e=i);let r=e,o=e,s=0;0==e&&n<0||e==i&&n>=0?Ne.chrome||Ne.gecko||(e?(r--,s=1):o=0)?0:a.length-1];return Ne.safari&&!s&&0==l.width&&(l=Array.prototype.find.call(a,(t=>t.width))||l),s?Oe(l,s<0):l||null}(this.dom,t,e)}}class De extends ke{constructor(t,e=[],n=0){super(),this.mark=t,this.children=e,this.length=n;for(let t of e)t.setParent(this)}setAttrs(t){if(Se(t),this.mark.class&&(t.className=this.mark.class),this.mark.attrs)for(let e in this.mark.attrs)t.setAttribute(e,this.mark.attrs[e]);return t}canReuseDOM(t){return super.canReuseDOM(t)&&!(8&(this.flags|t.flags))}reuseDOM(t){t.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(t),this.flags|=6)}sync(t,e){this.dom?4&this.flags&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(t,e)}merge(t,e,n,i,r,o){return!(n&&(!(n instanceof De&&n.mark.eq(this.mark))||t&&r<=0||et&&e.push(n=t&&(i=r),n=s,r++}let o=this.length-t;return this.length=t,i>-1&&(this.children.length=i,this.markDirty()),new De(this.mark,e,o)}domAtPos(t){return Ge(this,t)}coordsAt(t,e){return He(this,t,e)}}class Ye extends ke{static create(t,e,n){return new Ye(t,e,n)}constructor(t,e,n){super(),this.widget=t,this.length=e,this.side=n,this.prevWidget=null}split(t){let e=Ye.create(this.widget,this.length-t,this.side);return this.length-=t,e}sync(t){this.dom&&this.widget.updateDOM(this.dom,t)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(t)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(t,e,n,i,r,o){return!(n&&(!(n instanceof Ye&&this.widget.compare(n.widget))||t>0&&r<=0||e0)?Pe.before(this.dom):Pe.after(this.dom,t==this.length)}domBoundsAround(){return null}coordsAt(t,e){let n=this.widget.coordsAt(this.dom,t,e);if(n)return n;let i=this.dom.getClientRects(),r=null;if(!i.length)return null;let o=this.side?this.side<0:t>0;for(let e=o?i.length-1:0;r=i[e],!(t>0?0==e:e==i.length-1||r.top0?Pe.before(this.dom):Pe.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(t){return this.dom.getBoundingClientRect()}get overrideDOMText(){return l.empty}get isHidden(){return!0}}function Ge(t,e){let n=t.dom,{children:i}=t,r=0;for(let t=0;rt&&e0;t--){let e=i[t-1];if(e.dom.parentNode==n)return e.domAtPos(e.length)}for(let t=r;t0&&e instanceof De&&r.length&&(i=r[r.length-1])instanceof De&&i.mark.eq(e.mark)?Fe(i,e.children[0],n-1):(r.push(e),e.setParent(t)),t.length+=e.length}function He(t,e,n){let i=null,r=-1,o=null,s=-1;!function t(e,a){for(let l=0,c=0;l=a&&(u.children.length?t(u,a-c):(!o||o.isHidden&&n>0)&&(h>a||c==h&&u.getSide()>0)?(o=u,s=a-c):(c-1?1:0)!=r.length-(n&&r.indexOf(n)>-1?1:0))return!1;for(let o of i)if(o!=n&&(-1==r.indexOf(o)||t[o]!==e[o]))return!1;return!0}function en(t,e,n){let i=!1;if(e)for(let r in e)n&&r in n||(i=!0,"style"==r?t.style.cssText="":t.removeAttribute(r));if(n)for(let r in n)e&&e[r]==n[r]||(i=!0,"style"==r?t.style.cssText=n[r]:t.setAttribute(r,n[r]));return i}function nn(t){let e=Object.create(null);for(let n=0;n0?3e8:-4e8:e>0?1e8:-1e8,new cn(t,e,e,n,t.widget||null,!1)}static replace(t){let e,n,i=!!t.block;if(t.isBlockGap)e=-5e8,n=4e8;else{let{start:r,end:o}=un(t,i);e=(r?i?-3e8:-1:5e8)-1,n=1+(o?i?2e8:1:-6e8)}return new cn(t,e,n,i,t.widget||null,!0)}static line(t){return new ln(t)}static set(t,e=!1){return Rt.of(t,e)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}sn.none=Rt.empty;class an extends sn{constructor(t){let{start:e,end:n}=un(t);super(e?-1:5e8,n?1:-6e8,null,t),this.tagName=t.tagName||"span",this.class=t.class||"",this.attrs=t.attributes||null}eq(t){var e,n;return this==t||t instanceof an&&this.tagName==t.tagName&&(this.class||(null===(e=this.attrs)||void 0===e?void 0:e.class))==(t.class||(null===(n=t.attrs)||void 0===n?void 0:n.class))&&tn(this.attrs,t.attrs,"class")}range(t,e=t){if(t>=e)throw new RangeError("Mark decorations may not be empty");return super.range(t,e)}}an.prototype.point=!1;class ln extends sn{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof ln&&this.spec.class==t.spec.class&&tn(this.spec.attributes,t.spec.attributes)}range(t,e=t){if(e!=t)throw new RangeError("Line decoration ranges must be zero-length");return super.range(t,e)}}ln.prototype.mapMode=C.TrackBefore,ln.prototype.point=!0;class cn extends sn{constructor(t,e,n,i,r,o){super(e,n,r,t),this.block=i,this.isReplace=o,this.mapMode=i?e<=0?C.TrackBefore:C.TrackAfter:C.TrackDel}get type(){return this.startSide!=this.endSide?on.WidgetRange:this.startSide<=0?on.WidgetBefore:on.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof cn&&((e=this.widget)==(n=t.widget)||!!(e&&n&&e.compare(n)))&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide;var e,n}range(t,e=t){if(this.isReplace&&(t>e||t==e&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&e!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(t,e)}}function un(t,e=!1){let{inclusiveStart:n,inclusiveEnd:i}=t;return null==n&&(n=t.inclusive),null==i&&(i=t.inclusive),{start:null!=n?n:e,end:null!=i?i:e}}function hn(t,e,n,i=0){let r=n.length-1;r>=0&&n[r]+i>=t?n[r]=Math.max(n[r],e):n.push(t,e)}cn.prototype.point=!0;class dn extends ke{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(t,e,n,i,r,o){if(n){if(!(n instanceof dn))return!1;this.dom||n.transferDOM(this)}return i&&this.setDeco(n?n.attrs:null),Re(this,t,e,n?n.children.slice():[],r,o),!0}split(t){let e=new dn;if(e.breakAfter=this.breakAfter,0==this.length)return e;let{i:n,off:i}=this.childPos(t);i&&(e.append(this.children[n].split(i),0),this.children[n].merge(i,this.children[n].length,null,!1,0,0),n++);for(let t=n;t0&&0==this.children[n-1].length;)this.children[--n].destroy();return this.children.length=n,this.markDirty(),this.length=t,e}transferDOM(t){this.dom&&(this.markDirty(),t.setDOM(this.dom),t.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(t){tn(this.attrs,t)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=t)}append(t,e){Fe(this,t,e)}addLineDeco(t){let e=t.spec.attributes,n=t.spec.class;e&&(this.attrs=Ke(e,this.attrs||{})),n&&(this.attrs=Ke({class:n},this.attrs||{}))}domAtPos(t){return Ge(this,t)}reuseDOM(t){"DIV"==t.nodeName&&(this.setDOM(t),this.flags|=6)}sync(t,e){var n;this.dom?4&this.flags&&(Se(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),void 0!==this.prevAttrs&&(en(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(t,e);let i=this.dom.lastChild;for(;i&&ke.get(i)instanceof De;)i=i.lastChild;if(!(i&&this.length&&("BR"==i.nodeName||0!=(null===(n=ke.get(i))||void 0===n?void 0:n.isEditable)||Ne.ios&&this.children.some((t=>t instanceof Ue))))){let t=document.createElement("BR");t.cmIgnore=!0,this.dom.appendChild(t)}}measureTextSize(){if(0==this.children.length||this.length>20)return null;let t,e=0;for(let n of this.children){if(!(n instanceof Ue)||/[^ -~]/.test(n.text))return null;let i=ae(n.dom);if(1!=i.length)return null;e+=i[0].width,t=i[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(t,e){let n=He(this,t,e);if(!this.children.length&&n&&this.parent){let{heightOracle:t}=this.parent.view.viewState,e=n.bottom-n.top;if(Math.abs(e-t.lineHeight)<2&&t.textHeight=e){if(r instanceof dn)return r;if(o>e)break}i=o+r.breakAfter}return null}}class On extends ke{constructor(t,e,n){super(),this.widget=t,this.length=e,this.deco=n,this.breakAfter=0,this.prevWidget=null}merge(t,e,n,i,r,o){return!(n&&(!(n instanceof On&&this.widget.compare(n.widget))||t>0&&r<=0||e0)}}class fn extends rn{constructor(t){super(),this.height=t}toDOM(){let t=document.createElement("div");return t.className="cm-gap",this.updateDOM(t),t}eq(t){return t.height==this.height}updateDOM(t){return t.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class pn{constructor(t,e,n,i){this.doc=t,this.pos=e,this.end=n,this.disallowBlockEffectsFor=i,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=t.iter(),this.skip=e}posCovered(){if(0==this.content.length)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let t=this.content[this.content.length-1];return!(t.breakAfter||t instanceof On&&t.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new dn),this.atCursorPos=!0),this.curLine}flushBuffer(t=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(mn(new Be(-1),t),t.length),this.pendingBuffer=0)}addBlockWidget(t){this.flushBuffer(),this.curLine=null,this.content.push(t)}finish(t){this.pendingBuffer&&t<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,this.posCovered()||t&&this.content.length&&this.content[this.content.length-1]instanceof On||this.getLine()}buildText(t,e,n){for(;t>0;){if(this.textOff==this.text.length){let{value:e,lineBreak:n,done:i}=this.cursor.next(this.skip);if(this.skip=0,i)throw new Error("Ran out of text content when drawing inline views");if(n){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,t--;continue}this.text=e,this.textOff=0}let i=Math.min(this.text.length-this.textOff,t,512);this.flushBuffer(e.slice(e.length-n)),this.getLine().append(mn(new Ue(this.text.slice(this.textOff,this.textOff+i)),e),n),this.atCursorPos=!0,this.textOff+=i,t-=i,n=0}}span(t,e,n,i){this.buildText(e-t,n,i),this.pos=e,this.openStart<0&&(this.openStart=i)}point(t,e,n,i,r,o){if(this.disallowBlockEffectsFor[o]&&n instanceof cn){if(n.block)throw new RangeError("Block decorations may not be specified via plugins");if(e>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let s=e-t;if(n instanceof cn)if(n.block)n.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new On(n.widget||gn.block,s,n));else{let o=Ye.create(n.widget||gn.inline,s,s?0:n.startSide),a=this.atCursorPos&&!o.isEditable&&r<=i.length&&(t0),l=!o.isEditable&&(ti.length||n.startSide<=0),c=this.getLine();2!=this.pendingBuffer||a||o.isEditable||(this.pendingBuffer=0),this.flushBuffer(i),a&&(c.append(mn(new Be(1),i),r),r=i.length+Math.max(0,r-i.length)),c.append(mn(o,i),r),this.atCursorPos=l,this.pendingBuffer=l?ti.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=i.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(n);s&&(this.textOff+s<=this.text.length?this.textOff+=s:(this.skip+=s-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=e),this.openStart<0&&(this.openStart=r)}static build(t,e,n,i,r){let o=new pn(t,e,n,r);return o.openEnd=Rt.spans(i,e,n,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function mn(t,e){for(let n of e)t=new De(n,[t],t.length);return t}class gn extends rn{constructor(t){super(),this.tag=t}eq(t){return t.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(t){return t.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}gn.inline=new gn("span"),gn.block=new gn("div");var yn=function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t}(yn||(yn={}));const $n=yn.LTR,vn=yn.RTL;function bn(t){let e=[];for(let n=0;n=e){if(s.level==n)return o;(r<0||(0!=i?i<0?s.frome:t[r].level>s.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}}function Cn(t,e){if(t.length!=e.length)return!1;for(let n=0;nl&&s.push(new Tn(l,f.from,d)),En(t,f.direction==$n!=!(d%2)?i+1:i,r,f.inner,f.from,f.to,s),l=f.to),O=f.to}else{if(O==n||(e?zn[O]!=a:zn[O]==a))break;O++}h?Rn(t,l,O,i+1,r,h,s):le;){let n=!0,u=!1;if(!c||l>o[c-1].to){let t=zn[l-1];t!=a&&(n=!1,u=16==t)}let h=n||1!=a?null:[],d=n?i:i+1,O=l;t:for(;;)if(c&&O==o[c-1].to){if(u)break t;let f=o[--c];if(!n)for(let t=f.from,n=c;;){if(t==e)break t;if(!n||o[n-1].to!=t){if(zn[t-1]==a)break t;break}t=o[--n].from}h?h.push(f):(f.to=0;t-=3)if(Qn[t+1]==-n){let e=Qn[t+2],n=2&e?r:4&e?1&e?o:r:0;n&&(zn[s]=zn[Qn[t]]=n),a=t;break}}else{if(189==Qn.length)break;Qn[a++]=s,Qn[a++]=e,Qn[a++]=l}else if(2==(i=zn[s])||1==i){let t=i==r;l=t?0:1;for(let e=a-3;e>=0;e-=3){let n=Qn[e+2];if(2&n)break;if(t)Qn[e+2]|=2;else{if(4&n)break;Qn[e+2]|=4}}}}}(t,r,o,i,a),function(t,e,n,i){for(let r=0,o=i;r<=n.length;r++){let s=r?n[r-1].to:t,a=rl;)e==o&&(e=n[--i].from,o=i?n[i-1].to:t),zn[--e]=u;l=s}else o=s,l++}}}(r,o,i,a),Rn(t,r,o,e,n,i,s)}function An(t){return[new Tn(0,t,0)]}let Zn="";function Mn(t,e,n,i,r){var o;let s=i.head-t.from,a=Tn.find(e,s,null!==(o=i.bidiLevel)&&void 0!==o?o:-1,i.assoc),l=e[a],c=l.side(r,n);if(s==c){let t=a+=r?1:-1;if(t<0||t>=e.length)return null;l=e[a=t],s=l.side(!r,n),c=l.side(r,n)}let u=b(t.text,s,l.forward(r,n));(ul.to)&&(u=c),Zn=t.text.slice(Math.min(s,u),Math.max(s,u));let h=a==(r?e.length-1:0)?null:e[a+(r?1:-1)];return h&&u==c&&h.level+(r?0:1)t.some((t=>t))}),Bn=L.define({combine:t=>t.some((t=>t))}),Gn=L.define();class Fn{constructor(t,e="nearest",n="nearest",i=5,r=5,o=!1){this.range=t,this.y=e,this.x=n,this.yMargin=i,this.xMargin=r,this.isSnapshot=o}map(t){return t.empty?this:new Fn(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new Fn(W.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Hn=pt.define({map:(t,e)=>t.map(e)}),Kn=pt.define();function Jn(t,e,n){let i=t.facet(jn);i.length?i[0](e):window.onerror?window.onerror(String(e),n,void 0,void 0,e):n?console.error(n+":",e):console.error(e)}const ti=L.define({combine:t=>!t.length||t[0]});let ei=0;const ni=L.define();class ii{constructor(t,e,n,i,r){this.id=t,this.create=e,this.domEventHandlers=n,this.domEventObservers=i,this.extension=r(this)}static define(t,e){const{eventHandlers:n,eventObservers:i,provide:r,decorations:o}=e||{};return new ii(ei++,t,n,i,(t=>{let e=[ni.of(t)];return o&&e.push(ai.of((e=>{let n=e.plugin(t);return n?o(n):sn.none}))),r&&e.push(r(t)),e}))}static fromClass(t,e){return ii.define((e=>new t(e)),e)}}class ri{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}update(t){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(e){if(Jn(t.state,e,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(t){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(t)}catch(e){Jn(t.state,e,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(t){var e;if(null===(e=this.value)||void 0===e?void 0:e.destroy)try{this.value.destroy()}catch(e){Jn(t.state,e,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const oi=L.define(),si=L.define(),ai=L.define(),li=L.define(),ci=L.define(),ui=L.define();function hi(t,e){let n=t.state.facet(ui);if(!n.length)return n;let i=n.map((e=>e instanceof Function?e(t):e)),r=[];return Rt.spans(i,e.from,e.to,{point(){},span(t,n,i,o){let s=t-e.from,a=n-e.from,l=r;for(let t=i.length-1;t>=0;t--,o--){let n,r=i[t].spec.bidiIsolate;if(null==r&&(r=Vn(e.text,s,a)),o>0&&l.length&&(n=l[l.length-1]).to==s&&n.direction==r)n.to=a,l=n.inner;else{let t={from:s,to:a,direction:r,inner:[]};l.push(t),l=t.inner}}}}),r}const di=L.define();function Oi(t){let e=0,n=0,i=0,r=0;for(let o of t.state.facet(di)){let s=o(t);s&&(null!=s.left&&(e=Math.max(e,s.left)),null!=s.right&&(n=Math.max(n,s.right)),null!=s.top&&(i=Math.max(i,s.top)),null!=s.bottom&&(r=Math.max(r,s.bottom)))}return{left:e,right:n,top:i,bottom:r}}const fi=L.define();class pi{constructor(t,e,n,i){this.fromA=t,this.toA=e,this.fromB=n,this.toB=i}join(t){return new pi(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let e=t.length,n=this;for(;e>0;e--){let i=t[e-1];if(!(i.fromA>n.toA)){if(i.toAc)break;r+=2}if(!a)return n;new pi(a.fromA,a.toA,a.fromB,a.toB).addToSet(n),o=a.toA,s=a.toB}}}class mi{constructor(t,e,n){this.view=t,this.state=e,this.transactions=n,this.flags=0,this.startState=t.state,this.changes=R.empty(this.startState.doc.length);for(let t of n)this.changes=this.changes.compose(t.changes);let i=[];this.changes.iterChangedRanges(((t,e,n,r)=>i.push(new pi(t,e,n,r)))),this.changedRanges=i}static create(t,e,n){return new mi(t,e,n)}get viewportChanged(){return(4&this.flags)>0}get heightChanged(){return(2&this.flags)>0}get geometryChanged(){return this.docChanged||(10&this.flags)>0}get focusChanged(){return(1&this.flags)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some((t=>t.selection))}get empty(){return 0==this.flags&&0==this.transactions.length}}class gi extends ke{get length(){return this.view.state.doc.length}constructor(t){super(),this.view=t,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=sn.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(t.contentDOM),this.children=[new dn],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new pi(0,0,0,t.state.doc.length)],0,null)}update(t){var e;let n=t.changedRanges;this.minWidth>0&&n.length&&(n.every((({fromA:t,toA:e})=>ethis.minWidthTo))?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(t);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&((null===(e=this.domChanged)||void 0===e?void 0:e.newSel)?i=this.domChanged.newSel.head:function(t,e){let n=!1;return e&&t.iterChangedRanges(((t,i)=>{te.from&&(n=!0)})),n}(t.changes,this.hasComposition)||t.selectionSet||(i=t.state.selection.main.head));let r=i>-1?function(t,e,n){let i=yi(t,n);if(!i)return null;let{node:r,from:o,to:s}=i,a=r.nodeValue;if(/[\n\r]/.test(a))return null;if(t.state.doc.sliceString(i.from,i.to)!=a)return null;let l=e.invertedDesc,c=new pi(l.mapPos(o),l.mapPos(s),o,s),u=[];for(let e=r.parentNode;;e=e.parentNode){let n=ke.get(e);if(n instanceof De)u.push({node:e,deco:n.mark});else{if(n instanceof dn||"DIV"==e.nodeName&&e.parentNode==t.contentDOM)return{range:c,text:r,marks:u,line:e};if(e==t.contentDOM)return null;u.push({node:e,deco:new an({inclusive:!0,attributes:nn(e),tagName:e.tagName.toLowerCase()})})}}}(this.view,t.changes,i):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:e,to:i}=this.hasComposition;n=new pi(e,i,t.changes.mapPos(e,-1),t.changes.mapPos(i,1)).addToSet(n.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(Ne.ie||Ne.chrome)&&!r&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);let o=function(t,e,n){let i=new $i;return Rt.compare(t,e,n,i),i.changes}(this.decorations,this.updateDeco(),t.changes);return n=pi.extendWithRanges(n,o),!!(7&this.flags||0!=n.length)&&(this.updateInner(n,t.startState.doc.length,r),t.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(t,e,n){this.view.viewState.mustMeasureContent=!0,this.updateChildren(t,e,n);let{observer:i}=this.view;i.ignore((()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let t=Ne.chrome||Ne.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,t),this.flags&=-8,t&&(t.written||i.selectionRange.focusNode!=t.node)&&(this.forceSelection=!0),this.dom.style.height=""})),this.markedForComposition.forEach((t=>t.flags&=-9));let r=[];if(this.view.viewport.from||this.view.viewport.to=0?i[t]:null;if(!e)break;let o,s,a,l,{fromA:c,toA:u,fromB:h,toB:d}=e;if(n&&n.range.fromBh){let t=pn.build(this.view.state.doc,h,n.range.fromB,this.decorations,this.dynamicDecorationMap),e=pn.build(this.view.state.doc,n.range.toB,d,this.decorations,this.dynamicDecorationMap);s=t.breakAtStart,a=t.openStart,l=e.openEnd;let i=this.compositionView(n);e.breakAtStart?i.breakAfter=1:e.content.length&&i.merge(i.length,i.length,e.content[0],!1,e.openStart,0)&&(i.breakAfter=e.content[0].breakAfter,e.content.shift()),t.content.length&&i.merge(0,0,t.content[t.content.length-1],!0,0,t.openEnd)&&t.content.pop(),o=t.content.concat(i).concat(e.content)}else({content:o,breakAtStart:s,openStart:a,openEnd:l}=pn.build(this.view.state.doc,h,d,this.decorations,this.dynamicDecorationMap));let{i:O,off:f}=r.findPos(u,1),{i:p,off:m}=r.findPos(c,-1);ze(this,p,m,O,f,o,s,a,l)}n&&this.fixCompositionDOM(n)}updateEditContextFormatting(t){this.editContextFormatting=this.editContextFormatting.map(t.changes);for(let e of t.transactions)for(let t of e.effects)t.is(Kn)&&(this.editContextFormatting=t.value)}compositionView(t){let e=new Ue(t.text.nodeValue);e.flags|=8;for(let{deco:n}of t.marks)e=new De(n,[e],e.length);let n=new dn;return n.append(e,0),n}fixCompositionDOM(t){let e=(t,e)=>{e.flags|=8|(e.children.some((t=>7&t.flags))?1:0),this.markedForComposition.add(e);let n=ke.get(t);n&&n!=e&&(n.dom=null),e.setDOM(t)},n=this.childPos(t.range.fromB,1),i=this.children[n.i];e(t.line,i);for(let r=t.marks.length-1;r>=-1;r--)n=i.childPos(n.off,1),i=i.children[n.i],e(r>=0?t.marks[r].node:t.text,i)}updateSelection(t=!1,e=!1){!t&&this.view.observer.selectionRange.focusNode||this.view.observer.readSelectionRange();let n=this.view.root.activeElement,i=n==this.dom,r=!i&&se(this.dom,this.view.observer.selectionRange)&&!(n&&this.dom.contains(n));if(!(i||e||r))return;let o=this.forceSelection;this.forceSelection=!1;let s=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(s.anchor)),l=s.empty?a:this.moveToLine(this.domAtPos(s.head));if(Ne.gecko&&s.empty&&!this.hasComposition&&1==(c=a).node.nodeType&&c.node.firstChild&&(0==c.offset||"false"==c.node.childNodes[c.offset-1].contentEditable)&&(c.offset==c.node.childNodes.length||"false"==c.node.childNodes[c.offset].contentEditable)){let t=document.createTextNode("");this.view.observer.ignore((()=>a.node.insertBefore(t,a.node.childNodes[a.offset]||null))),a=l=new Pe(t,0),o=!0}var c;let u=this.view.observer.selectionRange;!o&&u.focusNode&&(le(a.node,a.offset,u.anchorNode,u.anchorOffset)&&le(l.node,l.offset,u.focusNode,u.focusOffset)||this.suppressWidgetCursorChange(u,s))||(this.view.observer.ignore((()=>{Ne.android&&Ne.chrome&&this.dom.contains(u.focusNode)&&function(t,e){for(let n=t;n&&n!=e;n=n.assignedSlot||n.parentNode)if(1==n.nodeType&&"false"==n.contentEditable)return!0;return!1}(u.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let t=re(this.view.root);if(t)if(s.empty){if(Ne.gecko){let t=(e=a.node,i=a.offset,1!=e.nodeType?0:(i&&"false"==e.childNodes[i-1].contentEditable?1:0)|(is.head&&([a,l]=[l,a]),e.setEnd(l.node,l.offset),e.setStart(a.node,a.offset),t.removeAllRanges(),t.addRange(e)}var e,i;r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),n&&n.focus())})),this.view.observer.setSelectionRange(a,l)),this.impreciseAnchor=a.precise?null:new Pe(u.anchorNode,u.anchorOffset),this.impreciseHead=l.precise?null:new Pe(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(t,e){return this.hasComposition&&e.empty&&le(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==e.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:t}=this,e=t.state.selection.main,n=re(t.root),{anchorNode:i,anchorOffset:r}=t.observer.selectionRange;if(!(n&&e.empty&&e.assoc&&n.modify))return;let o=dn.find(this,e.head);if(!o)return;let s=o.posAtStart;if(e.head==s||e.head==s+o.length)return;let a=this.coordsAt(e.head,-1),l=this.coordsAt(e.head,1);if(!a||!l||a.bottom>l.top)return;let c=this.domAtPos(e.head+e.assoc);n.collapse(c.node,c.offset),n.modify("move",e.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();let u=t.observer.selectionRange;t.docView.posFromDOM(u.anchorNode,u.anchorOffset)!=e.from&&n.collapse(i,r)}moveToLine(t){let e,n=this.dom;if(t.node!=n)return t;for(let i=t.offset;!e&&i=0;i--){let t=ke.get(n.childNodes[i]);t instanceof dn&&(e=t.domAtPos(t.length))}return e?new Pe(e.node,e.offset,!0):t}nearest(t){for(let e=t;e;){let t=ke.get(e);if(t&&t.rootView==this)return t;e=e.parentNode}return null}posFromDOM(t,e){let n=this.nearest(t);if(!n)throw new RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(t,e)+n.posAtStart}domAtPos(t){let{i:e,off:n}=this.childCursor().findPos(t,-1);for(;e=0;o--){let s=this.children[o],a=r-s.breakAfter,l=a-s.length;if(at||s.covers(1))&&(!n||s instanceof dn&&!(n instanceof dn&&e>=0)))n=s,i=l;else if(n&&l==t&&a==t&&s instanceof On&&Math.abs(e)<2){if(s.deco.startSide<0)break;o&&(n=null)}r=l}return n?n.coordsAt(t-i,e):null}coordsForChar(t){let{i:e,off:n}=this.childPos(t,1),i=this.children[e];if(!(i instanceof dn))return null;for(;i.children.length;){let{i:t,off:e}=i.childPos(n,1);for(;;t++){if(t==i.children.length)return null;if((i=i.children[t]).length)break}n=e}if(!(i instanceof Ue))return null;let r=b(i.text,n);if(r==n)return null;let o=ve(i.dom,n,r).getClientRects();for(let t=0;tMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,s=-1,a=this.view.textDirection==yn.LTR;for(let t=0,l=0;li)break;if(t>=n){let n=c.dom.getBoundingClientRect();if(e.push(n.height),o){let e=c.dom.lastChild,i=e?ae(e):[];if(i.length){let e=i[i.length-1],o=a?e.right-n.left:n.right-e.left;o>s&&(s=o,this.minWidth=r,this.minWidthFrom=t,this.minWidthTo=u)}}}t=u+c.breakAfter}return e}textDirectionAt(t){let{i:e}=this.childPos(t,1);return"rtl"==getComputedStyle(this.children[e].dom).direction?yn.RTL:yn.LTR}measureTextSize(){for(let t of this.children)if(t instanceof dn){let e=t.measureTextSize();if(e)return e}let t,e,n,i=document.createElement("div");return i.className="cm-line",i.style.width="99999px",i.style.position="absolute",i.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore((()=>{this.dom.appendChild(i);let r=ae(i.firstChild)[0];t=i.getBoundingClientRect().height,e=r?r.width/27:7,n=r?r.height:t,i.remove()})),{lineHeight:t,charWidth:e,textHeight:n}}childCursor(t=this.length){let e=this.children.length;return e&&(t-=this.children[--e].length),new Ce(this.children,t,e)}computeBlockGapDeco(){let t=[],e=this.view.viewState;for(let n=0,i=0;;i++){let r=i==e.viewports.length?null:e.viewports[i],o=r?r.from-1:this.length;if(o>n){let i=(e.lineBlockAt(o).bottom-e.lineBlockAt(n).top)/this.view.scaleY;t.push(sn.replace({widget:new fn(i),block:!0,inclusive:!0,isBlockGap:!0}).range(n,o))}if(!r)break;n=r.to+1}return sn.set(t)}updateDeco(){let t=1,e=this.view.state.facet(ai).map((e=>(this.dynamicDecorationMap[t++]="function"==typeof e)?e(this.view):e)),n=!1,i=this.view.state.facet(li).map(((t,e)=>{let i="function"==typeof t;return i&&(n=!0),i?t(this.view):t}));for(i.length&&(this.dynamicDecorationMap[t++]=n,e.push(Rt.join(i))),this.decorations=[this.editContextFormatting,...e,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];tn.anchor?-1:1);if(!i)return;!n.empty&&(e=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(i={left:Math.min(i.left,e.left),top:Math.min(i.top,e.top),right:Math.max(i.right,e.right),bottom:Math.max(i.bottom,e.bottom)});let r=Oi(this.view),o={left:i.left-r.left,top:i.top-r.top,right:i.right+r.right,bottom:i.bottom+r.bottom},{offsetWidth:s,offsetHeight:a}=this.view.scrollDOM;!function(t,e,n,i,r,o,s,a){let l=t.ownerDocument,c=l.defaultView||window;for(let u=t,h=!1;u&&!h;)if(1==u.nodeType){let t,d=u==l.body,O=1,f=1;if(d)t=fe(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(h=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let e=u.getBoundingClientRect();({scaleX:O,scaleY:f}=pe(u,e)),t={left:e.left,right:e.left+u.clientWidth*O,top:e.top,bottom:e.top+u.clientHeight*f}}let p=0,m=0;if("nearest"==r)e.top0&&e.bottom>t.bottom+m&&(m=e.bottom-t.bottom+m+s)):e.bottom>t.bottom&&(m=e.bottom-t.bottom+s,n<0&&e.top-m0&&e.right>t.right+p&&(p=e.right-t.right+p+o)):e.right>t.right&&(p=e.right-t.right+o,n<0&&e.leftt?e.left-t:Math.max(0,t-e.right)}function bi(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom)}function Si(t,e){return t.tope.top+1}function wi(t,e){return et.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function Qi(t,e,n){let i,r,o,s,a,l,c,u,h=!1;for(let d=t.firstChild;d;d=d.nextSibling){let t=ae(d);for(let O=0;Om||s==m&&o>p){i=d,r=f,o=p,s=m;let a=m?n0?O0)}0==p?n>f.bottom&&(!c||c.bottomf.top)&&(l=d,u=f):c&&Si(c,f)?c=xi(c,f.bottom):u&&Si(u,f)&&(u=wi(u,f.top))}}if(c&&c.bottom>=n?(i=a,r=c):u&&u.top<=n&&(i=l,r=u),!i)return{node:t,offset:0};let d=Math.max(r.left,Math.min(r.right,e));return 3==i.nodeType?Pi(i,d,n):h&&"false"!=i.contentEditable?Qi(i,d,n):{node:t,offset:Array.prototype.indexOf.call(t.childNodes,i)+(e>=(r.left+r.right)/2?1:0)}}function Pi(t,e,n){let i=t.nodeValue.length,r=-1,o=1e9,s=0;for(let a=0;an?c.top-n:n-c.bottom)-1;if(c.left-1<=e&&c.right+1>=e&&u=(c.left+c.right)/2,i=n;if((Ne.chrome||Ne.gecko)&&ve(t,a).getBoundingClientRect().left==c.right&&(i=!n),u<=0)return{node:t,offset:a+(i?1:0)};r=a+(i?1:0),o=u}}}return{node:t,offset:r>-1?r:s>0?t.nodeValue.length:0}}function _i(t,e,n,i=-1){var r,o;let s,a=t.contentDOM.getBoundingClientRect(),l=a.top+t.viewState.paddingTop,{docHeight:c}=t.viewState,{x:u,y:h}=e,d=h-l;if(d<0)return 0;if(d>c)return t.state.doc.length;for(let e=t.viewState.heightOracle.textHeight/2,r=!1;s=t.elementAtHeight(d),s.type!=on.Text;)for(;d=i>0?s.bottom+e:s.top-e,!(d>=0&&d<=c);){if(r)return n?null:0;r=!0,i=-i}h=l+d;let O=s.from;if(Ot.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:n?null:ki(t,a,s,u,h);let f=t.dom.ownerDocument,p=t.root.elementFromPoint?t.root:f,m=p.elementFromPoint(u,h);m&&!t.contentDOM.contains(m)&&(m=null),m||(u=Math.max(a.left+1,Math.min(a.right-1,u)),m=p.elementFromPoint(u,h),m&&!t.contentDOM.contains(m)&&(m=null));let g,y=-1;if(m&&0!=(null===(r=t.docView.nearest(m))||void 0===r?void 0:r.isEditable)){if(f.caretPositionFromPoint){let t=f.caretPositionFromPoint(u,h);t&&({offsetNode:g,offset:y}=t)}else if(f.caretRangeFromPoint){let e=f.caretRangeFromPoint(u,h);e&&(({startContainer:g,startOffset:y}=e),(!t.contentDOM.contains(g)||Ne.safari&&function(t,e,n){let i;if(3!=t.nodeType||e!=(i=t.nodeValue.length))return!1;for(let e=t.nextSibling;e;e=e.nextSibling)if(1!=e.nodeType||"BR"!=e.nodeName)return!1;return ve(t,i-1,i).getBoundingClientRect().left>n}(g,y,u)||Ne.chrome&&function(t,e,n){if(0!=e)return!1;for(let e=t;;){let t=e.parentNode;if(!t||1!=t.nodeType||t.firstChild!=e)return!1;if(t.classList.contains("cm-line"))break;e=t}return n-(1==t.nodeType?t.getBoundingClientRect():ve(t,0,Math.max(t.nodeValue.length,1)).getBoundingClientRect()).left>5}(g,y,u))&&(g=void 0))}g&&(y=Math.min(de(g),y))}if(!g||!t.docView.dom.contains(g)){let e=dn.find(t.docView,O);if(!e)return d>s.top+s.height/2?s.to:s.from;({node:g,offset:y}=Qi(e.dom,u,h))}let $=t.docView.nearest(g);if(!$)return null;if($.isWidget&&1==(null===(o=$.dom)||void 0===o?void 0:o.nodeType)){let t=$.dom.getBoundingClientRect();return e.y1.5*t.defaultLineHeight){let e=t.viewState.heightOracle.textHeight;o+=Math.floor((r-n.top-.5*(t.defaultLineHeight-e))/e)*t.viewState.heightOracle.lineLength}let s=t.state.sliceDoc(n.from,n.to);return n.from+Ut(s,o,t.state.tabSize)}function Ti(t,e){let n=t.lineBlockAt(e);if(Array.isArray(n.type))for(let t of n.type)if(t.to>e||t.to==e&&(t.to==n.to||t.type==on.Text))return t;return n}function Ci(t,e,n,i){let r=t.state.doc.lineAt(e.head),o=t.bidiSpans(r),s=t.textDirectionAt(r.from);for(let a=e,l=null;;){let e=Mn(r,o,s,a,n),c=Zn;if(!e){if(r.number==(n?t.state.doc.lines:1))return a;c="\n",r=t.state.doc.line(r.number+(n?1:-1)),o=t.bidiSpans(r),e=t.visualLineSide(r,!n)}if(l){if(!l(c))return a}else{if(!i)return e;l=i(c)}a=e}}function zi(t,e,n){for(;;){let i=0;for(let r of t)r.between(e-1,e+1,((t,r,o)=>{if(e>t&&ee(t))),n.from,e.head>n.from?-1:1);return i==n.from?n:W.cursor(i,it)&&this.lineBreak(),i=r}return this.findPointBefore(n,e),this}readTextNode(t){let e=t.nodeValue;for(let n of this.points)n.node==t&&(n.pos=this.text.length+Math.min(n.offset,e.length));for(let n=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let r,o=-1,s=1;if(this.lineSeparator?(o=e.indexOf(this.lineSeparator,n),s=this.lineSeparator.length):(r=i.exec(e))&&(o=r.index,s=r[0].length),this.append(e.slice(n,o<0?e.length:o)),o<0)break;if(this.lineBreak(),s>1)for(let e of this.points)e.node==t&&e.pos>this.text.length&&(e.pos-=s-1);n=o+s}}readNode(t){if(t.cmIgnore)return;let e=ke.get(t),n=e&&e.overrideDOMText;if(null!=n){this.findPointInside(t,n.length);for(let t=n.iter();!t.next().done;)t.lineBreak?this.lineBreak():this.append(t.value)}else 3==t.nodeType?this.readTextNode(t):"BR"==t.nodeName?t.nextSibling&&this.lineBreak():1==t.nodeType&&this.readRange(t.firstChild,null)}findPointBefore(t,e){for(let n of this.points)n.node==t&&t.childNodes[n.offset]==e&&(n.pos=this.text.length)}findPointInside(t,e){for(let n of this.points)(3==t.nodeType?n.node==t:t.contains(n.node))&&(n.pos=this.text.length+(Zi(t,n.node,n.offset)?e:0))}}function Zi(t,e,n){for(;;){if(!e||n-1;let{impreciseHead:r,impreciseAnchor:o}=t.docView;if(t.state.readOnly&&e>-1)this.newSel=null;else if(e>-1&&(this.bounds=t.docView.domBoundsAround(e,n,0))){let e=r||o?[]:function(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:o}=t.observer.selectionRange;return n&&(e.push(new Mi(n,i)),r==n&&o==i||e.push(new Mi(r,o))),e}(t),n=new Ai(e,t.state);n.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=n.text,this.newSel=function(t,e){if(0==t.length)return null;let n=t[0].pos,i=2==t.length?t[1].pos:n;return n>-1&&i>-1?W.single(n+e,i+e):null}(e,this.bounds.from)}else{let e=t.observer.selectionRange,n=r&&r.node==e.focusNode&&r.offset==e.focusOffset||!oe(t.contentDOM,e.focusNode)?t.state.selection.main.head:t.docView.posFromDOM(e.focusNode,e.focusOffset),i=o&&o.node==e.anchorNode&&o.offset==e.anchorOffset||!oe(t.contentDOM,e.anchorNode)?t.state.selection.main.anchor:t.docView.posFromDOM(e.anchorNode,e.anchorOffset),s=t.viewport;if((Ne.ios||Ne.chrome)&&t.state.selection.main.empty&&n!=i&&(s.from>0||s.toDate.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:i,to:s}=e.bounds,a=r.from,c=null;(8===o||Ne.android&&e.text.length0&&a>0&&t.charCodeAt(s-1)==e.charCodeAt(a-1);)s--,a--;return"end"==i&&(n-=s+Math.max(0,o-Math.min(s,a))-o),s=s?o-n:0,a=o+(a-s),s=o):a=a?o-n:0,s=o+(s-a),a=o),{from:o,toA:s,toB:a}}(t.state.doc.sliceString(i,s,Ei),e.text,a-i,c);u&&(Ne.chrome&&13==o&&u.toB==u.from+2&&e.text.slice(u.from,u.toB)==Ei+Ei&&u.toB--,n={from:i+u.from,to:i+u.toA,insert:l.of(e.text.slice(u.from,u.toB).split(Ei))})}else i&&(!t.hasFocus&&t.state.facet(ti)||i.main.eq(r))&&(i=null);if(!n&&!i)return!1;if(!n&&e.typeOver&&!r.empty&&i&&i.main.empty?n={from:r.from,to:r.to,insert:t.state.doc.slice(r.from,r.to)}:n&&n.from>=r.from&&n.to<=r.to&&(n.from!=r.from||n.to!=r.to)&&r.to-r.from-(n.to-n.from)<=4?n={from:r.from,to:r.to,insert:t.state.doc.slice(r.from,n.from).append(n.insert).append(t.state.doc.slice(n.to,r.to))}:(Ne.mac||Ne.android)&&n&&n.from==n.to&&n.from==r.head-1&&/^\. ?$/.test(n.insert.toString())&&"off"==t.contentDOM.getAttribute("autocorrect")?(i&&2==n.insert.length&&(i=W.single(i.main.anchor-1,i.main.head-1)),n={from:r.from,to:r.to,insert:l.of([" "])}):Ne.chrome&&n&&n.from==n.to&&n.from==r.head&&"\n "==n.insert.toString()&&t.lineWrapping&&(i&&(i=W.single(i.main.anchor-1,i.main.head-1)),n={from:r.from,to:r.to,insert:l.of([" "])}),n)return qi(t,n,i,o);if(i&&!i.main.eq(r)){let e=!1,n="select";return t.inputState.lastSelectionTime>Date.now()-50&&("select"==t.inputState.lastSelectionOrigin&&(e=!0),n=t.inputState.lastSelectionOrigin),t.dispatch({selection:i,scrollIntoView:e,userEvent:n}),!0}return!1}function qi(t,e,n,i=-1){if(Ne.ios&&t.inputState.flushIOSKey(e))return!0;let r=t.state.selection.main;if(Ne.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&" "==t.state.sliceDoc(e.from,r.from))&&1==e.insert.length&&2==e.insert.lines&&be(t.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&0==e.insert.length||8==i&&e.insert.lengthr.head)&&be(t.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&0==e.insert.length&&be(t.contentDOM,"Delete",46)))return!0;let o,s=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let a=()=>o||(o=function(t,e,n){let i,r=t.state,o=r.selection.main;if(e.from>=o.from&&e.to<=o.to&&e.to-e.from>=(o.to-o.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let n=o.frome.to?r.sliceDoc(e.to,o.to):"";i=r.replaceSelection(t.state.toText(n+e.insert.sliceString(0,void 0,t.state.lineBreak)+s))}else{let s=r.changes(e),a=n&&n.main.to<=s.newLength?n.main:void 0;if(r.selection.ranges.length>1&&t.inputState.composing>=0&&e.to<=o.to&&e.to>=o.to-10){let l,c=t.state.sliceDoc(e.from,e.to),u=n&&yi(t,n.main.head);if(u){let t=e.insert.length-(e.to-e.from);l={from:u.from,to:u.to-t}}else l=t.state.doc.lineAt(o.head);let h=o.to-e.to,d=o.to-o.from;i=r.changeByRange((n=>{if(n.from==o.from&&n.to==o.to)return{changes:s,range:a||n.map(s)};let i=n.to-h,u=i-c.length;if(n.to-n.from!=d||t.state.sliceDoc(u,i)!=c||n.to>=l.from&&n.from<=l.to)return{range:n};let O=r.changes({from:u,to:i,insert:e.insert}),f=n.to-o.to;return{changes:O,range:a?W.range(Math.max(0,a.anchor+f),Math.max(0,a.head+f)):n.map(O)}}))}else i={changes:s,selection:a&&r.selection.replaceRange(a)}}let s="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,s+=".compose",t.inputState.compositionFirstChange&&(s+=".start",t.inputState.compositionFirstChange=!1)),r.update(i,{userEvent:s,scrollIntoView:!0})}(t,e,n));return t.state.facet(Ln).some((n=>n(t,e.from,e.to,s,a)))||t.dispatch(a()),!0}class Wi{setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}constructor(t){this.view=t,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=t.hasFocus,Ne.safari&&t.contentDOM.addEventListener("input",(()=>null)),Ne.gecko&&function(t){Or.has(t)||(Or.add(t),t.addEventListener("copy",(()=>{})),t.addEventListener("cut",(()=>{})))}(t.contentDOM.ownerDocument)}handleEvent(t){(function(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n,i=e.target;i!=t.contentDOM;i=i.parentNode)if(!i||11==i.nodeType||(n=ke.get(i))&&n.ignoreEvent(e))return!1;return!0})(this.view,t)&&!this.ignoreDuringComposition(t)&&("keydown"==t.type&&this.keydown(t)||this.runHandlers(t.type,t))}runHandlers(t,e){let n=this.handlers[t];if(n){for(let t of n.observers)t(this.view,e);for(let t of n.handlers){if(e.defaultPrevented)break;if(t(this.view,e)){e.preventDefault();break}}}}ensureHandlers(t){let e=Ii(t),n=this.handlers,i=this.view.contentDOM;for(let t in e)if("scroll"!=t){let r=!e[t].handlers.length,o=n[t];o&&r!=!o.handlers.length&&(i.removeEventListener(t,this.handleEvent),o=null),o||i.addEventListener(t,this.handleEvent,{passive:r})}for(let t in n)"scroll"==t||e[t]||i.removeEventListener(t,this.handleEvent);this.handlers=e}keydown(t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),9==t.keyCode&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&27!=t.keyCode&&Ui.indexOf(t.keyCode)<0&&(this.tabFocusMode=-1),Ne.android&&Ne.chrome&&!t.synthetic&&(13==t.keyCode||8==t.keyCode))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;let e;return!Ne.ios||t.synthetic||t.altKey||t.metaKey||!((e=Li.find((e=>e.keyCode==t.keyCode)))&&!t.ctrlKey||Ni.indexOf(t.key)>-1&&t.ctrlKey&&!t.shiftKey)?(229!=t.keyCode&&this.view.observer.forceFlush(),!1):(this.pendingIOSKey=e||t,setTimeout((()=>this.flushIOSKey()),250),!0)}flushIOSKey(t){let e=this.pendingIOSKey;return!!e&&!("Enter"==e.key&&t&&t.from0||!!(Ne.safari&&!Ne.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100)&&(this.compositionPendingKey=!1,!0))}startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t}update(t){this.view.observer.update(t),this.mouseSelection&&this.mouseSelection.update(t),this.draggedContent&&t.docChanged&&(this.draggedContent=this.draggedContent.map(t.changes)),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function ji(t,e){return(n,i)=>{try{return e.call(t,i,n)}catch(t){Jn(n.state,t)}}}function Ii(t){let e=Object.create(null);function n(t){return e[t]||(e[t]={observers:[],handlers:[]})}for(let e of t){let t=e.spec;if(t&&t.domEventHandlers)for(let i in t.domEventHandlers){let r=t.domEventHandlers[i];r&&n(i).handlers.push(ji(e.value,r))}if(t&&t.domEventObservers)for(let i in t.domEventObservers){let r=t.domEventObservers[i];r&&n(i).observers.push(ji(e.value,r))}}for(let t in Bi)n(t).handlers.push(Bi[t]);for(let t in Gi)n(t).observers.push(Gi[t]);return e}const Li=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Ni="dthko",Ui=[16,17,18,20,91,92,224,225];function Di(t){return.7*Math.max(0,t)+8}class Yi{constructor(t,e,n,i){this.view=t,this.startEvent=e,this.style=n,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=e,this.scrollParents=function(t){let e,n,i=t.ownerDocument;for(let r=t.parentNode;r&&!(r==i.body||e&&n);)if(1==r.nodeType)!n&&r.scrollHeight>r.clientHeight&&(n=r),!e&&r.scrollWidth>r.clientWidth&&(e=r),r=r.assignedSlot||r.parentNode;else{if(11!=r.nodeType)break;r=r.host}return{x:e,y:n}}(t.contentDOM),this.atoms=t.state.facet(ci).map((e=>e(t)));let r=t.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=e.shiftKey,this.multiple=t.state.facet(Pt.allowMultipleSelections)&&function(t,e){let n=t.state.facet(Xn);return n.length?n[0](e):Ne.mac?e.metaKey:e.ctrlKey}(t,e),this.dragging=!(!function(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let i=re(t.root);if(!i||0==i.rangeCount)return!0;let r=i.getRangeAt(0).getClientRects();for(let t=0;t=e.clientX&&n.top<=e.clientY&&n.bottom>=e.clientY)return!0}return!1}(t,e)||1!=ar(e))&&null}start(t){!1===this.dragging&&this.select(t)}move(t){if(0==t.buttons)return this.destroy();if(this.dragging||null==this.dragging&&(e=this.startEvent,n=t,Math.max(Math.abs(e.clientX-n.clientX),Math.abs(e.clientY-n.clientY))<10))return;var e,n;this.select(this.lastEvent=t);let i=0,r=0,o=0,s=0,a=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:o,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:l}=this.scrollParents.y.getBoundingClientRect());let c=Oi(this.view);t.clientX-c.left<=o+6?i=-Di(o-t.clientX):t.clientX+c.right>=a-6&&(i=Di(t.clientX-a)),t.clientY-c.top<=s+6?r=-Di(s-t.clientY):t.clientY+c.bottom>=l-6&&(r=Di(t.clientY-l)),this.setScrollSpeed(i,r)}up(t){null==this.dragging&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(t,e){this.scrollSpeed={x:t,y:e},t||e?this.scrolling<0&&(this.scrolling=setInterval((()=>this.scroll()),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:t,y:e}=this.scrollSpeed;t&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=t,t=0),e&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=e,e=0),(t||e)&&this.view.win.scrollBy(t,e),!1===this.dragging&&this.select(this.lastEvent)}skipAtoms(t){let e=null;for(let n=0;nt.isUserEvent("input.type")))?this.destroy():this.style.update(t)&&setTimeout((()=>this.select(this.lastEvent)),20)}}const Bi=Object.create(null),Gi=Object.create(null),Fi=Ne.ie&&Ne.ie_version<15||Ne.ios&&Ne.webkit_version<604;function Hi(t,e,n){for(let i of t.facet(e))n=i(n,t);return n}function Ki(t,e){e=Hi(t.state,Un,e);let n,{state:i}=t,r=1,o=i.toText(e),s=o.lines==i.selection.ranges.length;if(null!=cr&&i.selection.ranges.every((t=>t.empty))&&cr==o.toString()){let t=-1;n=i.changeByRange((n=>{let a=i.doc.lineAt(n.from);if(a.from==t)return{range:n};t=a.from;let l=i.toText((s?o.line(r++).text:e)+i.lineBreak);return{changes:{from:a.from,insert:l},range:W.cursor(n.from+l.length)}}))}else n=s?i.changeByRange((t=>{let e=o.line(r++);return{changes:{from:t.from,to:t.to,insert:e.text},range:W.cursor(t.from+e.length)}})):i.replaceSelection(o);t.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}function Ji(t,e,n,i){if(1==i)return W.cursor(e,n);if(2==i)return function(t,e,n=1){let i=t.charCategorizer(e),r=t.doc.lineAt(e),o=e-r.from;if(0==r.length)return W.cursor(e);0==o?n=1:o==r.length&&(n=-1);let s=o,a=o;n<0?s=b(r.text,o,!1):a=b(r.text,o);let l=i(r.text.slice(s,a));for(;s>0;){let t=b(r.text,s,!1);if(i(r.text.slice(t,s))!=l)break;s=t}for(;a{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft},Bi.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),27==e.keyCode&&0!=t.inputState.tabFocusMode&&(t.inputState.tabFocusMode=Date.now()+2e3),!1),Gi.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")},Gi.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")},Bi.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let i of t.state.facet(Wn))if(n=i(t,e),n)break;if(n||0!=e.button||(n=function(t,e){let n=nr(t,e),i=ar(e),r=t.state.selection;return{update(t){t.docChanged&&(n.pos=t.changes.mapPos(n.pos),r=r.map(t.changes))},get(e,o,s){let a,l=nr(t,e),c=Ji(t,l.pos,l.bias,i);if(n.pos!=l.pos&&!o){let e=Ji(t,n.pos,n.bias,i),r=Math.min(e.from,c.from),o=Math.max(e.to,c.to);c=r1&&(a=function(t,e){for(let n=0;n=e)return W.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}(r,l.pos))?a:s?r.addRange(c):W.create([c])}}}(t,e)),n){let i=!t.hasFocus;t.inputState.startMouseSelection(new Yi(t,e,n,i)),i&&t.observer.ignore((()=>{$e(t.contentDOM);let e=t.root.activeElement;e&&!e.contains(t.contentDOM)&&e.blur()}));let r=t.inputState.mouseSelection;if(r)return r.start(e),!1===r.dragging}return!1};let tr=(t,e,n)=>e>=n.top&&e<=n.bottom&&t>=n.left&&t<=n.right;function er(t,e,n,i){let r=dn.find(t.docView,e);if(!r)return 1;let o=e-r.posAtStart;if(0==o)return 1;if(o==r.length)return-1;let s=r.coordsAt(o,-1);if(s&&tr(n,i,s))return-1;let a=r.coordsAt(o,1);return a&&tr(n,i,a)?1:s&&s.bottom>=i?-1:1}function nr(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:n,bias:er(t,n,e.clientX,e.clientY)}}const ir=Ne.ie&&Ne.ie_version<=11;let rr=null,or=0,sr=0;function ar(t){if(!ir)return t.detail;let e=rr,n=sr;return rr=t,sr=Date.now(),or=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(or+1)%3:1}function lr(t,e,n,i){if(!(n=Hi(t.state,Un,n)))return;let r=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:o}=t.inputState,s=i&&o&&function(t,e){let n=t.state.facet(qn);return n.length?n[0](e):Ne.mac?!e.altKey:!e.ctrlKey}(t,e)?{from:o.from,to:o.to}:null,a={from:r,insert:n},l=t.state.changes(s?[s,a]:a);t.focus(),t.dispatch({changes:l,selection:{anchor:l.mapPos(r,-1),head:l.mapPos(r,1)},userEvent:s?"move.drop":"input.drop"}),t.inputState.draggedContent=null}Bi.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let i=t.docView.nearest(e.target);if(i&&i.isWidget){let t=i.posAtStart,e=t+i.length;(t>=n.to||e<=n.from)&&(n=W.range(t,e))}}let{inputState:i}=t;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",Hi(t.state,Dn,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1},Bi.dragend=t=>(t.inputState.draggedContent=null,!1),Bi.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let i=Array(n.length),r=0,o=()=>{++r==n.length&&lr(t,e,i.filter((t=>null!=t)).join(t.state.lineBreak),!1)};for(let t=0;t{/[\x00-\x08\x0e-\x1f]{2}/.test(e.result)||(i[t]=e.result),o()},e.readAsText(n[t])}return!0}{let n=e.dataTransfer.getData("Text");if(n)return lr(t,e,n,!0),!0}return!1},Bi.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=Fi?null:e.clipboardData;return n?(Ki(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(function(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout((()=>{t.focus(),n.remove(),Ki(t,n.value)}),50)}(t),!1)};let cr=null;Bi.copy=Bi.cut=(t,e)=>{let{text:n,ranges:i,linewise:r}=function(t){let e=[],n=[],i=!1;for(let i of t.selection.ranges)i.empty||(e.push(t.sliceDoc(i.from,i.to)),n.push(i));if(!e.length){let r=-1;for(let{from:i}of t.selection.ranges){let o=t.doc.lineAt(i);o.number>r&&(e.push(o.text),n.push({from:o.from,to:Math.min(t.doc.length,o.to+1)})),r=o.number}i=!0}return{text:Hi(t,Dn,e.join(t.lineBreak)),ranges:n,linewise:i}}(t.state);if(!n&&!r)return!1;cr=r?n:null,"cut"!=e.type||t.state.readOnly||t.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let o=Fi?null:e.clipboardData;return o?(o.clearData(),o.setData("text/plain",n),!0):(function(t,e){let n=t.dom.parentNode;if(!n)return;let i=n.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout((()=>{i.remove(),t.focus()}),50)}(t,n),!1)};const ur=dt.define();function hr(t,e){let n=[];for(let i of t.facet(Nn)){let r=i(t,e);r&&n.push(r)}return n?t.update({effects:n,annotations:ur.of(!0)}):null}function dr(t){setTimeout((()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=hr(t.state,e);n?t.dispatch(n):t.update([])}}),10)}Gi.focus=t=>{t.inputState.lastFocusTime=Date.now(),t.scrollDOM.scrollTop||!t.inputState.lastScrollTop&&!t.inputState.lastScrollLeft||(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),dr(t)},Gi.blur=t=>{t.observer.clearSelectionRange(),dr(t)},Gi.compositionstart=Gi.compositionupdate=t=>{t.observer.editContext||(null==t.inputState.compositionFirstChange&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))},Gi.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,Ne.chrome&&Ne.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then((()=>t.observer.flush())):setTimeout((()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])}),50))},Gi.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()},Bi.beforeinput=(t,e)=>{var n,i;if("insertReplacementText"==e.inputType&&t.observer.editContext){let i=null===(n=e.dataTransfer)||void 0===n?void 0:n.getData("text/plain"),r=e.getTargetRanges();if(i&&r.length){let e=r[0],n=t.posAtDOM(e.startContainer,e.startOffset),o=t.posAtDOM(e.endContainer,e.endOffset);return qi(t,{from:n,to:o,insert:t.state.toText(i)},null),!0}}let r;if(Ne.chrome&&Ne.android&&(r=Li.find((t=>t.inputType==e.inputType)))&&(t.observer.delayAndroidKey(r.key,r.keyCode),"Backspace"==r.key||"Delete"==r.key)){let e=(null===(i=window.visualViewport)||void 0===i?void 0:i.height)||0;setTimeout((()=>{var n;((null===(n=window.visualViewport)||void 0===n?void 0:n.height)||0)>e+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())}),100)}return Ne.ios&&"deleteContentForward"==e.inputType&&t.observer.flushSoon(),Ne.safari&&"insertText"==e.inputType&&t.inputState.composing>=0&&setTimeout((()=>Gi.compositionend(t,e)),20),!1};const Or=new Set,fr=["pre-wrap","normal","pre-line","break-spaces"];let pr=!1;function mr(){pr=!1}class gr{constructor(t){this.lineWrapping=t,this.doc=l.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(t,e){let n=this.doc.lineAt(e).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((e-t-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(t){return this.lineWrapping?(1+Math.max(0,Math.ceil((t-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(t){return this.doc=t,this}mustRefreshForWrapping(t){return fr.indexOf(t)>-1!=this.lineWrapping}mustRefreshForHeights(t){let e=!1;for(let n=0;n-1,a=Math.round(e)!=Math.round(this.lineHeight)||this.lineWrapping!=s;if(this.lineWrapping=s,this.lineHeight=e,this.charWidth=n,this.textHeight=i,this.lineLength=r,a){this.heightSamples={};for(let t=0;t0}set outdated(t){this.flags=(t?2:0)|-3&this.flags}setHeight(t){this.height!=t&&(Math.abs(this.height-t)>br&&(pr=!0),this.height=t)}replace(t,e,n){return Sr.of(n)}decomposeLeft(t,e){e.push(this)}decomposeRight(t,e){e.push(this)}applyChanges(t,e,n,i){let r=this,o=n.doc;for(let s=i.length-1;s>=0;s--){let{fromA:a,toA:l,fromB:c,toB:u}=i[s],h=r.lineAt(a,vr.ByPosNoHeight,n.setDoc(e),0,0),d=h.to>=l?h:r.lineAt(l,vr.ByPosNoHeight,n,0,0);for(u+=d.to-l,l=d.to;s>0&&h.from<=i[s-1].toA;)a=i[s-1].fromA,c=i[s-1].fromB,s--,a2*r){let r=t[e-1];r.break?t.splice(--e,1,r.left,null,r.right):t.splice(--e,1,r.left,r.right),n+=1+r.break,i-=r.size}else{if(!(r>2*i))break;{let e=t[n];e.break?t.splice(n,1,e.left,null,e.right):t.splice(n,1,e.left,e.right),n+=2+e.break,r-=e.size}}else if(i=r&&o(this.blockAt(0,n,i,r))}updateHeight(t,e=0,n=!1,i){return i&&i.from<=e&&i.more&&this.setHeight(i.heights[i.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Qr extends xr{constructor(t,e){super(t,e,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(t,e,n,i){return new $r(i,this.length,n,this.height,this.breaks)}replace(t,e,n){let i=n[0];return 1==n.length&&(i instanceof Qr||i instanceof Pr&&4&i.flags)&&Math.abs(this.length-i.length)<10?(i instanceof Pr?i=new Qr(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):Sr.of(n)}updateHeight(t,e=0,n=!1,i){return i&&i.from<=e&&i.more?this.setHeight(i.heights[i.index++]):(n||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Pr extends Sr{constructor(t){super(t,0)}heightMetrics(t,e){let n,i=t.doc.lineAt(e).number,r=t.doc.lineAt(e+this.length).number,o=r-i+1,s=0;if(t.lineWrapping){let e=Math.min(this.height,t.lineHeight*o);n=e/o,this.length>o+1&&(s=(this.height-e)/(this.length-o-1))}else n=this.height/o;return{firstLine:i,lastLine:r,perLine:n,perChar:s}}blockAt(t,e,n,i){let{firstLine:r,lastLine:o,perLine:s,perChar:a}=this.heightMetrics(e,i);if(e.lineWrapping){let r=i+(t0){let t=n[n.length-1];t instanceof Pr?n[n.length-1]=new Pr(t.length+i):n.push(null,new Pr(i-1))}if(t>0){let e=n[0];e instanceof Pr?n[0]=new Pr(t+e.length):n.unshift(new Pr(t-1),null)}return Sr.of(n)}decomposeLeft(t,e){e.push(new Pr(t-1),null)}decomposeRight(t,e){e.push(null,new Pr(this.length-t-1))}updateHeight(t,e=0,n=!1,i){let r=e+this.length;if(i&&i.from<=e+this.length&&i.more){let n=[],o=Math.max(e,i.from),s=-1;for(i.from>e&&n.push(new Pr(i.from-e-1).updateHeight(t,e));o<=r&&i.more;){let e=t.doc.lineAt(o).length;n.length&&n.push(null);let r=i.heights[i.index++];-1==s?s=r:Math.abs(r-s)>=br&&(s=-2);let a=new Qr(e,r);a.outdated=!1,n.push(a),o+=e+1}o<=r&&n.push(null,new Pr(r-o).updateHeight(t,o));let a=Sr.of(n);return(s<0||Math.abs(a.height-this.height)>=br||Math.abs(s-this.heightMetrics(t,e).perLine)>=br)&&(pr=!0),wr(this,a)}return(n||this.outdated)&&(this.setHeight(t.heightForGap(e,e+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class _r extends Sr{constructor(t,e,n){super(t.length+e+n.length,t.height+n.height,e|(t.outdated||n.outdated?2:0)),this.left=t,this.right=n,this.size=t.size+n.size}get break(){return 1&this.flags}blockAt(t,e,n,i){let r=n+this.left.height;return ts))return l;let c=e==vr.ByPosNoHeight?vr.ByPosNoHeight:vr.ByPos;return a?l.join(this.right.lineAt(s,c,n,o,s)):this.left.lineAt(s,c,n,i,r).join(l)}forEachLine(t,e,n,i,r,o){let s=i+this.left.height,a=r+this.left.length+this.break;if(this.break)t=a&&this.right.forEachLine(t,e,n,s,a,o);else{let l=this.lineAt(a,vr.ByPos,n,i,r);t=t&&l.from<=e&&o(l),e>l.to&&this.right.forEachLine(l.to+1,e,n,s,a,o)}}replace(t,e,n){let i=this.left.length+this.break;if(ethis.left.length)return this.balanced(this.left,this.right.replace(t-i,e-i,n));let r=[];t>0&&this.decomposeLeft(t,r);let o=r.length;for(let t of n)r.push(t);if(t>0&&kr(r,o-1),e=n&&e.push(null)),t>n&&this.right.decomposeLeft(t-n,e)}decomposeRight(t,e){let n=this.left.length,i=n+this.break;if(t>=i)return this.right.decomposeRight(t-i,e);t2*e.size||e.size>2*t.size?Sr.of(this.break?[t,null,e]:[t,e]):(this.left=wr(this.left,t),this.right=wr(this.right,e),this.setHeight(t.height+e.height),this.outdated=t.outdated||e.outdated,this.size=t.size+e.size,this.length=t.length+this.break+e.length,this)}updateHeight(t,e=0,n=!1,i){let{left:r,right:o}=this,s=e+r.length+this.break,a=null;return i&&i.from<=e+r.length&&i.more?a=r=r.updateHeight(t,e,n,i):r.updateHeight(t,e,n),i&&i.from<=s+o.length&&i.more?a=o=o.updateHeight(t,s,n,i):o.updateHeight(t,s,n),a?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function kr(t,e){let n,i;null==t[e]&&(n=t[e-1])instanceof Pr&&(i=t[e+1])instanceof Pr&&t.splice(e-1,3,new Pr(n.length+1+i.length))}class Tr{constructor(t,e){this.pos=t,this.oracle=e,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,e){if(this.lineStart>-1){let t=Math.min(e,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof Qr?n.length+=t-this.pos:(t>this.pos||!this.isCovered)&&this.nodes.push(new Qr(t-this.pos,-1)),this.writtenTo=t,e>t&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=e}point(t,e,n){if(t=5)&&this.addLineDeco(i,r,o)}else e>t&&this.span(t,e);this.lineEnd>-1&&this.lineEnd-1)return;let{from:t,to:e}=this.oracle.doc.lineAt(this.pos);this.lineStart=t,this.lineEnd=e,this.writtenTot&&this.nodes.push(new Qr(this.pos-t,-1)),this.writtenTo=this.pos}blankContent(t,e){let n=new Pr(e-t);return this.oracle.doc.lineAt(t).to==e&&(n.flags|=4),n}ensureLine(){this.enterLine();let t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof Qr)return t;let e=new Qr(0,-1);return this.nodes.push(e),e}addBlock(t){this.enterLine();let e=t.deco;e&&e.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,e&&e.endSide>0&&(this.covering=t)}addLineDeco(t,e,n){let i=this.ensureLine();i.length+=n,i.collapsed+=n,i.widgetHeight=Math.max(i.widgetHeight,t),i.breaks+=e,this.writtenTo=this.pos=this.pos+n}finish(t){let e=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||e instanceof Qr||this.isCovered?(this.writtenTon.clientHeight||n.scrollWidth>n.clientWidth)&&"visible"!=i.overflow){let i=n.getBoundingClientRect();o=Math.max(o,i.left),s=Math.min(s,i.right),a=Math.max(a,i.top),l=Math.min(e==t.parentNode?r.innerHeight:l,i.bottom)}e="absolute"==i.position||"fixed"==i.position?n.offsetParent:n.parentNode}else{if(11!=e.nodeType)break;e=e.host}return{left:o-n.left,right:Math.max(o,s)-n.left,top:a-(n.top+e),bottom:Math.max(a,l)-(n.top+e)}}function Rr(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class Er{constructor(t,e,n,i){this.from=t,this.to=e,this.size=n,this.displaySize=i}static same(t,e){if(t.length!=e.length)return!1;for(let n=0;n"function"!=typeof t&&"cm-lineWrapping"==t.class));this.heightOracle=new gr(e),this.stateDeco=t.facet(ai).filter((t=>"function"!=typeof t)),this.heightMap=Sr.empty().applyChanges(this.stateDeco,l.empty,this.heightOracle.setDoc(t.doc),[new pi(0,0,0,t.doc.length)]);for(let t=0;t<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());t++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=sn.set(this.lineGaps.map((t=>t.draw(this,!1)))),this.computeVisibleRanges()}updateForViewport(){let t=[this.viewport],{main:e}=this.state.selection;for(let n=0;n<=1;n++){let i=n?e.head:e.anchor;if(!t.some((({from:t,to:e})=>i>=t&&i<=e))){let{from:e,to:n}=this.lineBlockAt(i);t.push(new Mr(e,n))}}return this.viewports=t.sort(((t,e)=>t.from-e.from)),this.updateScaler()}updateScaler(){let t=this.scaler;return this.scaler=this.heightMap.height<=7e6?qr:new Wr(this.heightOracle,this.heightMap,this.viewports),t.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,(t=>{this.viewportLines.push(jr(t,this.scaler))}))}update(t,e=null){this.state=t.state;let n=this.stateDeco;this.stateDeco=this.state.facet(ai).filter((t=>"function"!=typeof t));let i=t.changedRanges,r=pi.extendWithRanges(i,function(t,e,n){let i=new Cr;return Rt.compare(t,e,n,i,0),i.changes}(n,this.stateDeco,t?t.changes:R.empty(this.state.doc.length))),o=this.heightMap.height,s=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);mr(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),r),(this.heightMap.height!=o||pr)&&(t.flags|=2),s?(this.scrollAnchorPos=t.changes.mapPos(s.from,-1),this.scrollAnchorHeight=s.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=r.length?this.mapViewport(this.viewport,t.changes):this.viewport;(e&&(e.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,e));let l=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,t.flags|=this.updateForViewport(),(l||!t.changes.empty||2&t.flags)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(),e&&(this.scrollTarget=e),!this.mustEnforceCursorAssoc&&t.selectionSet&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(Bn)&&(this.mustEnforceCursorAssoc=!0)}measure(t){let e=t.contentDOM,n=window.getComputedStyle(e),i=this.heightOracle,r=n.whiteSpace;this.defaultTextDirection="rtl"==n.direction?yn.RTL:yn.LTR;let o=this.heightOracle.mustRefreshForWrapping(r),s=e.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=s.height;this.contentDOMHeight=s.height,this.mustMeasureContent=!1;let c=0,u=0;if(s.width&&s.height){let{scaleX:t,scaleY:n}=pe(e,s);(t>.005&&Math.abs(this.scaleX-t)>.005||n>.005&&Math.abs(this.scaleY-n)>.005)&&(this.scaleX=t,this.scaleY=n,c|=8,o=a=!0)}let h=(parseInt(n.paddingTop)||0)*this.scaleY,d=(parseInt(n.paddingBottom)||0)*this.scaleY;this.paddingTop==h&&this.paddingBottom==d||(this.paddingTop=h,this.paddingBottom=d,c|=10),this.editorWidth!=t.scrollDOM.clientWidth&&(i.lineWrapping&&(a=!0),this.editorWidth=t.scrollDOM.clientWidth,c|=8);let O=t.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=O&&(this.scrollAnchorHeight=-1,this.scrollTop=O),this.scrolledToBottom=we(t.scrollDOM);let f=(this.printing?Rr:zr)(e,this.paddingTop),p=f.top-this.pixelViewport.top,m=f.bottom-this.pixelViewport.bottom;this.pixelViewport=f;let g=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(g!=this.inView&&(this.inView=g,g&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let y=s.width;if(this.contentDOMWidth==y&&this.editorHeight==t.scrollDOM.clientHeight||(this.contentDOMWidth=s.width,this.editorHeight=t.scrollDOM.clientHeight,c|=8),a){let e=t.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(e)&&(o=!0),o||i.lineWrapping&&Math.abs(y-this.contentDOMWidth)>i.charWidth){let{lineHeight:n,charWidth:s,textHeight:a}=t.docView.measureTextSize();o=n>0&&i.refresh(r,n,s,a,y/s,e),o&&(t.docView.minWidth=0,c|=8)}p>0&&m>0?u=Math.max(p,m):p<0&&m<0&&(u=Math.min(p,m)),mr();for(let n of this.viewports){let r=n.from==this.viewport.from?e:t.docView.measureVisibleLineHeights(n);this.heightMap=(o?Sr.empty().applyChanges(this.stateDeco,l.empty,this.heightOracle,[new pi(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(i,0,o,new yr(n.from,r))}pr&&(c|=2)}let $=!this.viewportIsAppropriate(this.viewport,u)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return $&&(2&c&&(c|=this.updateScaler()),this.viewport=this.getViewport(u,this.scrollTarget),c|=this.updateForViewport()),(2&c||$)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,t)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(t,e){let n=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),i=this.heightMap,r=this.heightOracle,{visibleTop:o,visibleBottom:s}=this,a=new Mr(i.lineAt(o-1e3*n,vr.ByHeight,r,0,0).from,i.lineAt(s+1e3*(1-n),vr.ByHeight,r,0,0).to);if(e){let{head:t}=e.range;if(ta.to){let n,o=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),s=i.lineAt(t,vr.ByPos,r,0,0);n="center"==e.y?(s.top+s.bottom)/2-o/2:"start"==e.y||"nearest"==e.y&&t=s+Math.max(10,Math.min(n,250)))&&i>o-2e3&&r>1,o=i<<1;if(this.defaultTextDirection!=yn.LTR&&!n)return[];let s=[],a=(i,o,l,c)=>{if(o-ii&&tt.from>=l.from&&t.to<=l.to&&Math.abs(t.from-i)t.frome))));if(!d){if(ot.from<=o&&t.to>=o))){let t=e.moveToLineBoundary(W.cursor(o),!1,!0).head;t>i&&(o=t)}let t=this.gapSize(l,i,o,c);d=new Er(i,o,t,n||t<2e6?t:2e6)}s.push(d)},l=e=>{if(e.lengthr&&(i.push({from:r,to:t}),o+=t-r),r=e}},20),r2e6)for(let n of t)n.from>=e.from&&n.frome.from&&a(e.from,s,e,r),lt.draw(this,this.heightOracle.lineWrapping)))))}computeVisibleRanges(){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let e=[];Rt.spans(t,this.viewport.from,this.viewport.to,{span(t,n){e.push({from:t,to:n})},point(){}},20);let n=e.length!=this.visibleRanges.length||this.visibleRanges.some(((t,n)=>t.from!=e[n].from||t.to!=e[n].to));return this.visibleRanges=e,n?4:0}lineBlockAt(t){return t>=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find((e=>e.from<=t&&e.to>=t))||jr(this.heightMap.lineAt(t,vr.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(t){return t>=this.viewportLines[0].top&&t<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find((e=>e.top<=t&&e.bottom>=t))||jr(this.heightMap.lineAt(this.scaler.fromDOM(t),vr.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(t){let e=this.lineBlockAtHeight(t+8);return e.from>=this.viewport.from||this.viewportLines[0].top-t>200?e:this.viewportLines[0]}elementAtHeight(t){return jr(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Mr{constructor(t,e){this.from=t,this.to=e}}function Vr({total:t,ranges:e},n){if(n<=0)return e[0].from;if(n>=1)return e[e.length-1].to;let i=Math.floor(t*n);for(let t=0;;t++){let{from:n,to:r}=e[t],o=r-n;if(i<=o)return n+i;i-=o}}function Xr(t,e){let n=0;for(let{from:i,to:r}of t.ranges){if(e<=r){n+=e-i;break}n+=r-i}return n/t.total}const qr={toDOM:t=>t,fromDOM:t=>t,scale:1,eq(t){return t==this}};class Wr{constructor(t,e,n){let i=0,r=0,o=0;this.viewports=n.map((({from:n,to:r})=>{let o=e.lineAt(n,vr.ByPos,t,0,0).top,s=e.lineAt(r,vr.ByPos,t,0,0).bottom;return i+=s-o,{from:n,to:r,top:o,bottom:s,domTop:0,domBottom:0}})),this.scale=(7e6-i)/(e.height-i);for(let t of this.viewports)t.domTop=o+(t.top-r)*this.scale,o=t.domBottom=t.domTop+(t.bottom-t.top),r=t.bottom}toDOM(t){for(let e=0,n=0,i=0;;e++){let r=ee.from==t.viewports[n].from&&e.to==t.viewports[n].to))}}function jr(t,e){if(1==e.scale)return t;let n=e.toDOM(t.top),i=e.toDOM(t.bottom);return new $r(t.from,t.length,n,i-n,Array.isArray(t._content)?t._content.map((t=>jr(t,e))):t._content)}const Ir=L.define({combine:t=>t.join(" ")}),Lr=L.define({combine:t=>t.indexOf(!0)>-1}),Nr=Gt.newName(),Ur=Gt.newName(),Dr=Gt.newName(),Yr={"&light":"."+Ur,"&dark":"."+Dr};function Br(t,e,n){return new Gt(e,{finish:e=>/&/.test(e)?e.replace(/&\w*/,(e=>{if("&"==e)return t;if(!n||!n[e])throw new RangeError(`Unsupported selector: ${e}`);return n[e]})):t+" "+e})}const Gr=Br("."+Nr,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:'url(\'data:image/svg+xml,\')',backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Yr),Fr={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Hr=Ne.ie&&Ne.ie_version<=11;class Kr{constructor(t){this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new me,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver((e=>{for(let t of e)this.queue.push(t);(Ne.ie&&Ne.ie_version<=11||Ne.ios&&t.composing)&&e.some((t=>"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length))?this.flushSoon():this.flush()})),!window.EditContext||!1===t.constructor.EDIT_CONTEXT||Ne.chrome&&Ne.chrome_version<126||(this.editContext=new eo(t),t.state.facet(ti)&&(t.contentDOM.editContext=this.editContext.editContext)),Hr&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),"function"==typeof ResizeObserver&&(this.resizeScroll=new ResizeObserver((()=>{var t;(null===(t=this.view.docView)||void 0===t?void 0:t.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))}),{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver((t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))}),{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(t){this.view.inputState.runHandlers("scroll",t),this.intersecting&&this.view.measure()}onScroll(t){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(t)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout((()=>{this.resizeTimeout=-1,this.view.requestMeasure()}),50))}onPrint(t){("change"!=t.type&&t.type||t.matches)&&(this.view.viewState.printing=!0,this.view.measure(),setTimeout((()=>{this.view.viewState.printing=!1,this.view.requestMeasure()}),500))}updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some(((e,n)=>e!=t[n])))){this.gapIntersection.disconnect();for(let e of t)this.gapIntersection.observe(e);this.gaps=t}}onSelectionChange(t){let e=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,i=this.selectionRange;if(n.state.facet(ti)?n.root.activeElement!=this.dom:!se(this.dom,i))return;let r=i.anchorNode&&n.docView.nearest(i.anchorNode);r&&r.ignoreEvent(t)?e||(this.selectionChanged=!1):(Ne.ie&&Ne.ie_version<=11||Ne.android&&Ne.chrome)&&!n.state.selection.main.empty&&i.focusNode&&le(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,e=re(t.root);if(!e)return!1;let n=Ne.safari&&11==t.root.nodeType&&t.root.activeElement==this.dom&&function(t,e){if(e.getComposedRanges){let n=e.getComposedRanges(t.root)[0];if(n)return to(t,n)}let n=null;function i(t){t.preventDefault(),t.stopImmediatePropagation(),n=t.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",i,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",i,!0),n?to(t,n):null}(this.view,e)||e;if(!n||this.selectionRange.eq(n))return!1;let i=se(this.dom,n);return i&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime{let t=this.delayedAndroidKey;t&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=t.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&t.force&&be(this.dom,t.key,t.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(t)}this.delayedAndroidKey&&"Enter"!=t||(this.delayedAndroidKey={key:t,keyCode:e,force:this.lastChange{this.delayedFlush=-1,this.flush()})))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}processRecords(){let t=this.pendingRecords();t.length&&(this.queue=[]);let e=-1,n=-1,i=!1;for(let r of t){let t=this.readMutation(r);t&&(t.typeOver&&(i=!0),-1==e?({from:e,to:n}=t):(e=Math.min(t.from,e),n=Math.max(t.to,n)))}return{from:e,to:n,typeOver:i}}readChange(){let{from:t,to:e,typeOver:n}=this.processRecords(),i=this.selectionChanged&&se(this.dom,this.selectionRange);if(t<0&&!i)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new Vi(this.view,t,e,n);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}flush(t=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();let e=this.readChange();if(!e)return this.view.requestMeasure(),!1;let n=this.view.state,i=Xi(this.view,e);return this.view.state==n&&(e.domChanged||e.newSel&&!e.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),i}readMutation(t){let e=this.view.docView.nearest(t.target);if(!e||e.ignoreMutation(t))return null;if(e.markDirty("attributes"==t.type),"attributes"==t.type&&(e.flags|=4),"childList"==t.type){let n=Jr(e,t.previousSibling||t.target.previousSibling,-1),i=Jr(e,t.nextSibling||t.target.nextSibling,1);return{from:n?e.posAfter(n):e.posAtStart,to:i?e.posBefore(i):e.posAtEnd,typeOver:!1}}return"characterData"==t.type?{from:e.posAtStart,to:e.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win))}addWindowListeners(t){t.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange)}update(t){this.editContext&&(this.editContext.update(t),t.startState.facet(ti)!=t.state.facet(ti)&&(t.view.contentDOM.editContext=t.state.facet(ti)?this.editContext.editContext:null))}destroy(){var t,e,n;this.stop(),null===(t=this.intersection)||void 0===t||t.disconnect(),null===(e=this.gapIntersection)||void 0===e||e.disconnect(),null===(n=this.resizeScroll)||void 0===n||n.disconnect();for(let t of this.scrollTargets)t.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function Jr(t,e,n){for(;e;){let i=ke.get(e);if(i&&i.parent==t)return i;let r=e.parentNode;e=r!=t.dom?r:n>0?e.nextSibling:e.previousSibling}return null}function to(t,e){let n=e.startContainer,i=e.startOffset,r=e.endContainer,o=e.endOffset,s=t.docView.domAtPos(t.state.selection.main.anchor);return le(s.node,s.offset,r,o)&&([n,i,r,o]=[r,o,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:o}}class eo{constructor(t){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.resetRange(t.state);let e=this.editContext=new window.EditContext({text:t.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,t.state.selection.main.anchor))),selectionEnd:this.toContextPos(t.state.selection.main.head)});this.handlers.textupdate=e=>{let{anchor:n}=t.state.selection.main,i={from:this.toEditorPos(e.updateRangeStart),to:this.toEditorPos(e.updateRangeEnd),insert:l.of(e.text.split("\n"))};i.from==this.from&&nthis.to&&(i.to=n),(i.from!=i.to||i.insert.length)&&(this.pendingContextChange=i,t.state.readOnly||qi(t,i,W.single(this.toEditorPos(e.selectionStart),this.toEditorPos(e.selectionEnd))),this.pendingContextChange&&(this.revertPending(t.state),this.setSelection(t.state)))},this.handlers.characterboundsupdate=n=>{let i=[],r=null;for(let e=this.toEditorPos(n.rangeStart),o=this.toEditorPos(n.rangeEnd);e{let n=[];for(let t of e.getTextFormats()){let e=t.underlineStyle,i=t.underlineThickness;if("None"!=e&&"None"!=i){let r=`text-decoration: underline ${"Dashed"==e?"dashed ":"Squiggle"==e?"wavy ":""}${"Thin"==i?1:2}px`;n.push(sn.mark({attributes:{style:r}}).range(this.toEditorPos(t.rangeStart),this.toEditorPos(t.rangeEnd)))}}t.dispatch({effects:Kn.of(sn.set(n))})},this.handlers.compositionstart=()=>{t.inputState.composing<0&&(t.inputState.composing=0,t.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{t.inputState.composing=-1,t.inputState.compositionFirstChange=null};for(let t in this.handlers)e.addEventListener(t,this.handlers[t]);this.measureReq={read:t=>{this.editContext.updateControlBounds(t.contentDOM.getBoundingClientRect());let e=re(t.root);e&&e.rangeCount&&this.editContext.updateSelectionBounds(e.getRangeAt(0).getBoundingClientRect())}}}applyEdits(t){let e=0,n=!1,i=this.pendingContextChange;return t.changes.iterChanges(((r,o,s,a,l)=>{if(n)return;let c=l.length-(o-r);if(i&&o>=i.to){if(i.from==r&&i.to==o&&i.insert.eq(l))return i=this.pendingContextChange=null,e+=c,void(this.to+=c);i=null,this.revertPending(t.state)}if(r+=e,(o+=e)<=this.from)this.from+=c,this.to+=c;else if(rthis.to||this.to-this.from+l.length>3e4)return void(n=!0);this.editContext.updateText(this.toContextPos(r),this.toContextPos(o),l.toString()),this.to+=c}e+=c})),i&&!n&&this.revertPending(t.state),!n}update(t){let e=this.pendingContextChange;this.applyEdits(t)&&this.rangeIsValid(t.state)?(t.docChanged||t.selectionSet||e)&&this.setSelection(t.state):(this.pendingContextChange=null,this.resetRange(t.state),this.editContext.updateText(0,this.editContext.text.length,t.state.doc.sliceString(this.from,this.to)),this.setSelection(t.state)),(t.geometryChanged||t.docChanged||t.selectionSet)&&t.view.requestMeasure(this.measureReq)}resetRange(t){let{head:e}=t.selection.main;this.from=Math.max(0,e-1e4),this.to=Math.min(t.doc.length,e+1e4)}revertPending(t){let e=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(e.from),this.toContextPos(e.from+e.insert.length),t.doc.sliceString(e.from,e.to))}setSelection(t){let{main:e}=t.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,e.anchor))),i=this.toContextPos(e.head);this.editContext.selectionStart==n&&this.editContext.selectionEnd==i||this.editContext.updateSelection(n,i)}rangeIsValid(t){let{head:e}=t.selection.main;return!(this.from>0&&e-this.from<500||this.to3e4)}toEditorPos(t){return t+this.from}toContextPos(t){return t-this.from}destroy(){for(let t in this.handlers)this.editContext.removeEventListener(t,this.handlers[t])}}class no{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(t={}){var e;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),t.parent&&t.parent.appendChild(this.dom);let{dispatch:n}=t;this.dispatchTransactions=t.dispatchTransactions||n&&(t=>t.forEach((t=>n(t,this))))||(t=>this.update(t)),this.dispatch=this.dispatch.bind(this),this._root=t.root||function(t){for(;t;){if(t&&(9==t.nodeType||11==t.nodeType&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}(t.parent)||document,this.viewState=new Zr(t.state||Pt.create(t)),t.scrollTo&&t.scrollTo.is(Hn)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(ni).map((t=>new ri(t)));for(let t of this.plugins)t.update(this);this.observer=new Kr(this),this.inputState=new Wi(this),this.inputState.ensureHandlers(this.plugins),this.docView=new gi(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),(null===(e=document.fonts)||void 0===e?void 0:e.ready)&&document.fonts.ready.then((()=>this.requestMeasure()))}dispatch(...t){let e=1==t.length&&t[0]instanceof mt?t:1==t.length&&Array.isArray(t[0])?t[0]:[this.state.update(...t)];this.dispatchTransactions(e,this)}update(t){if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let e,n=!1,i=!1,r=this.state;for(let e of t){if(e.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=e.state}if(this.destroyed)return void(this.viewState.state=r);let o=this.hasFocus,s=0,a=null;t.some((t=>t.annotation(ur)))?(this.inputState.notifiedFocused=o,s=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=hr(r,o),a||(s=1));let l=this.observer.delayedAndroidKey,c=null;if(l?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(c=null)):this.observer.clear(),r.facet(Pt.phrases)!=this.state.facet(Pt.phrases))return this.setState(r);e=mi.create(this,r,t),e.flags|=s;let u=this.viewState.scrollTarget;try{this.updateState=2;for(let e of t){if(u&&(u=u.map(e.changes)),e.scrollIntoView){let{main:t}=e.state.selection;u=new Fn(t.empty?t:W.cursor(t.head,t.head>t.anchor?-1:1))}for(let t of e.effects)t.is(Hn)&&(u=t.value.clip(this.state))}this.viewState.update(e,u),this.bidiCache=oo.update(this.bidiCache,e.changes),e.empty||(this.updatePlugins(e),this.inputState.update(e)),n=this.docView.update(e),this.state.facet(fi)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(n,t.some((t=>t.isUserEvent("select.pointer"))))}finally{this.updateState=0}if(e.startState.facet(Ir)!=e.state.facet(Ir)&&(this.viewState.mustMeasureContent=!0),(n||i||u||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!e.empty)for(let t of this.state.facet(In))try{t(e)}catch(t){Jn(this.state,t,"update listener")}(a||c)&&Promise.resolve().then((()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!Xi(this,c)&&l.force&&be(this.contentDOM,l.key,l.keyCode)}))}setState(t){if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed)return void(this.viewState.state=t);this.updateState=2;let e=this.hasFocus;try{for(let t of this.plugins)t.destroy(this);this.viewState=new Zr(t),this.plugins=t.facet(ni).map((t=>new ri(t))),this.pluginMap.clear();for(let t of this.plugins)t.update(this);this.docView.destroy(),this.docView=new gi(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}e&&this.focus(),this.requestMeasure()}updatePlugins(t){let e=t.startState.facet(ni),n=t.state.facet(ni);if(e!=n){let i=[];for(let r of n){let n=e.indexOf(r);if(n<0)i.push(new ri(r));else{let e=this.plugins[n];e.mustUpdate=t,i.push(e)}}for(let e of this.plugins)e.mustUpdate!=t&&e.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let e of this.plugins)e.mustUpdate=t;for(let t=0;t-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey)return this.measureScheduled=-1,void this.requestMeasure();this.measureScheduled=0,t&&this.observer.forceFlush();let e=null,n=this.scrollDOM,i=n.scrollTop*this.scaleY,{scrollAnchorPos:r,scrollAnchorHeight:o}=this.viewState;Math.abs(i-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let t=0;;t++){if(o<0)if(we(n))r=-1,o=this.viewState.heightMap.height;else{let t=this.viewState.scrollAnchorAt(i);r=t.from,o=t.top}this.updateState=1;let s=this.viewState.measure(this);if(!s&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(t>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let a=[];4&s||([this.measureRequests,a]=[a,this.measureRequests]);let l=a.map((t=>{try{return t.read(this)}catch(t){return Jn(this.state,t),ro}})),c=mi.create(this,this.state,[]),u=!1;c.flags|=s,e?e.flags|=s:e=c,this.updateState=2,c.empty||(this.updatePlugins(c),this.inputState.update(c),this.updateAttrs(),u=this.docView.update(c),u&&this.docViewUpdate());for(let t=0;t1||t<-1){i+=t,n.scrollTop=i/this.scaleY,o=-1;continue}}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(e&&!e.empty)for(let t of this.state.facet(In))t(e)}get themeClasses(){return Nr+" "+(this.state.facet(Lr)?Dr:Ur)+" "+this.state.facet(Ir)}updateAttrs(){let t=so(this,oi,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),e={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(ti)?"true":"false",class:"cm-content",style:`${Ne.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(e["aria-readonly"]="true"),so(this,si,e);let n=this.observer.ignore((()=>{let n=en(this.contentDOM,this.contentAttrs,e),i=en(this.dom,this.editorAttrs,t);return n||i}));return this.editorAttrs=t,this.contentAttrs=e,n}showAnnouncements(t){let e=!0;for(let n of t)for(let t of n.effects)t.is(no.announce)&&(e&&(this.announceDOM.textContent=""),e=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=t.value)}mountStyles(){this.styleModules=this.state.facet(fi);let t=this.state.facet(no.cspNonce);Gt.mount(this.root,this.styleModules.concat(Gr).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(2==this.updateState)throw new Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(t){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame((()=>this.measure()))),t){if(this.measureRequests.indexOf(t)>-1)return;if(null!=t.key)for(let e=0;ee.spec==t))||null),e&&e.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(t){return this.readMeasured(),this.viewState.elementAtHeight(t)}lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(t){return this.viewState.lineBlockAt(t)}get contentHeight(){return this.viewState.contentHeight}moveByChar(t,e,n){return Ri(this,t,Ci(this,t,e,n))}moveByGroup(t,e){return Ri(this,t,Ci(this,t,e,(e=>function(t,e,n){let i=t.state.charCategorizer(e),r=i(n);return t=>{let e=i(t);return r==wt.Space&&(r=e),r==e}}(this,t.head,e))))}visualLineSide(t,e){let n=this.bidiSpans(t),i=this.textDirectionAt(t.from),r=n[e?n.length-1:0];return W.cursor(r.side(e,i)+t.from,r.forward(!e,i)?1:-1)}moveToLineBoundary(t,e,n=!0){return function(t,e,n,i){let r=Ti(t,e.head),o=i&&r.type==on.Text&&(t.lineWrapping||r.widgetLineBreaks)?t.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head):null;if(o){let e=t.dom.getBoundingClientRect(),i=t.textDirectionAt(r.from),s=t.posAtCoords({x:n==(i==yn.LTR)?e.right-1:e.left+1,y:(o.top+o.bottom)/2});if(null!=s)return W.cursor(s,n?-1:1)}return W.cursor(n?r.to:r.from,n?-1:1)}(this,t,e,n)}moveVertically(t,e,n){return Ri(this,t,function(t,e,n,i){let r=e.head,o=n?1:-1;if(r==(n?t.state.doc.length:0))return W.cursor(r,e.assoc);let s,a=e.goalColumn,l=t.contentDOM.getBoundingClientRect(),c=t.coordsAtPos(r,e.assoc||-1),u=t.documentTop;if(c)null==a&&(a=c.left-l.left),s=o<0?c.top:c.bottom;else{let e=t.viewState.lineBlockAt(r);null==a&&(a=Math.min(l.right-l.left,t.defaultCharacterWidth*(r-e.from))),s=(o<0?e.top:e.bottom)+u}let h=l.left+a,d=null!=i?i:t.viewState.heightOracle.textHeight>>1;for(let e=0;;e+=10){let n=s+(d+e)*o,i=_i(t,{x:h,y:n},!1,o);if(nl.bottom||(o<0?ir)){let e=t.docView.coordsForChar(i),r=!e||n0)}coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet(Yn)||tthis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>io)return An(t.length);let e,n=this.textDirectionAt(t.from);for(let i of this.bidiCache)if(i.from==t.from&&i.dir==n&&(i.fresh||Cn(i.isolates,e=hi(this,t))))return i.order;e||(e=hi(this,t));let i=function(t,e,n){if(!t)return[new Tn(0,0,e==vn?1:0)];if(e==$n&&!n.length&&!kn.test(t))return An(t.length);if(n.length)for(;t.length>zn.length;)zn[zn.length]=256;let i=[],r=e==$n?0:1;return En(t,r,r,n,0,t.length,i),i}(t.text,n,e);return this.bidiCache.push(new oo(t.from,t.to,n,e,!0,i)),i}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||Ne.safari&&(null===(t=this.inputState)||void 0===t?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore((()=>{$e(this.contentDOM),this.docView.updateSelection()}))}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((9==t.nodeType?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let t of this.plugins)t.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(t,e={}){return Hn.of(new Fn("number"==typeof t?W.cursor(t):t,e.y,e.x,e.yMargin,e.xMargin))}scrollSnapshot(){let{scrollTop:t,scrollLeft:e}=this.scrollDOM,n=this.viewState.scrollAnchorAt(t);return Hn.of(new Fn(W.cursor(n.from),"start","start",n.top-t,e,!0))}setTabFocusMode(t){null==t?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:"boolean"==typeof t?this.inputState.tabFocusMode=t?0:-1:0!=this.inputState.tabFocusMode&&(this.inputState.tabFocusMode=Date.now()+t)}static domEventHandlers(t){return ii.define((()=>({})),{eventHandlers:t})}static domEventObservers(t){return ii.define((()=>({})),{eventObservers:t})}static theme(t,e){let n=Gt.newName(),i=[Ir.of(n),fi.of(Br(`.${n}`,t))];return e&&e.dark&&i.push(Lr.of(!0)),i}static baseTheme(t){return K.lowest(fi.of(Br("."+Nr,t,Yr)))}static findFromDOM(t){var e;let n=t.querySelector(".cm-content"),i=n&&ke.get(n)||ke.get(t);return(null===(e=null==i?void 0:i.rootView)||void 0===e?void 0:e.view)||null}}no.styleModule=fi,no.inputHandler=Ln,no.clipboardInputFilter=Un,no.clipboardOutputFilter=Dn,no.scrollHandler=Gn,no.focusChangeEffect=Nn,no.perLineTextDirection=Yn,no.exceptionSink=jn,no.updateListener=In,no.editable=ti,no.mouseSelectionStyle=Wn,no.dragMovesSelection=qn,no.clickAddsSelectionRange=Xn,no.decorations=ai,no.outerDecorations=li,no.atomicRanges=ci,no.bidiIsolatedRanges=ui,no.scrollMargins=di,no.darkTheme=Lr,no.cspNonce=L.define({combine:t=>t.length?t[0]:""}),no.contentAttributes=si,no.editorAttributes=oi,no.lineWrapping=no.contentAttributes.of({class:"cm-lineWrapping"}),no.announce=pt.define();const io=4096,ro={};class oo{constructor(t,e,n,i,r,o){this.from=t,this.to=e,this.dir=n,this.isolates=i,this.fresh=r,this.order=o}static update(t,e){if(e.empty&&!t.some((t=>t.fresh)))return t;let n=[],i=t.length?t[t.length-1].dir:yn.LTR;for(let r=Math.max(0,t.length-10);r=0;r--){let e=i[r],o="function"==typeof e?e(t):e;o&&Ke(o,n)}return n}const ao=Ne.mac?"mac":Ne.windows?"win":Ne.linux?"linux":"key";function lo(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),!1!==n&&e.shiftKey&&(t="Shift-"+t),t}const co=K.default(no.domEventHandlers({keydown:(t,e)=>go(Oo(e.state),t,e,"editor")})),uo=L.define({enables:co}),ho=new WeakMap;function Oo(t){let e=t.facet(uo),n=ho.get(e);return n||ho.set(e,n=function(t,e=ao){let n=Object.create(null),i=Object.create(null),r=(t,e)=>{let n=i[t];if(null==n)i[t]=e;else if(n!=e)throw new Error("Key binding "+t+" is used both as a regular binding and as a multi-stroke prefix")},o=(t,i,o,s,a)=>{var l,c;let u=n[t]||(n[t]=Object.create(null)),h=i.split(/ (?!$)/).map((t=>function(t,e){const n=t.split(/-(?!$)/);let i,r,o,s,a=n[n.length-1];"Space"==a&&(a=" ");for(let t=0;t{let i=fo={view:e,prefix:n,scope:t};return setTimeout((()=>{fo==i&&(fo=null)}),po),!0}]})}let d=h.join(" ");r(d,!1);let O=u[d]||(u[d]={preventDefault:!1,stopPropagation:!1,run:(null===(c=null===(l=u._any)||void 0===l?void 0:l.run)||void 0===c?void 0:c.slice())||[]});o&&O.run.push(o),s&&(O.preventDefault=!0),a&&(O.stopPropagation=!0)};for(let i of t){let t=i.scope?i.scope.split(" "):["editor"];if(i.any)for(let e of t){let t=n[e]||(n[e]=Object.create(null));t._any||(t._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:r}=i;for(let e in t)t[e].run.push((t=>r(t,mo)))}let r=i[e]||i.key;if(r)for(let e of t)o(e,r,i.run,i.preventDefault,i.stopPropagation),i.shift&&o(e,"Shift-"+r,i.shift,i.preventDefault,i.stopPropagation)}return n}(e.reduce(((t,e)=>t.concat(e)),[]))),n}let fo=null;const po=4e3;let mo=null;function go(t,e,n,i){mo=e;let r=function(t){var e=!(te&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||ee&&t.shiftKey&&t.key&&1==t.key.length||"Unidentified"==t.key)&&t.key||(t.shiftKey?Jt:Kt)[t.keyCode]||t.key||"Unidentified";return"Esc"==e&&(e="Escape"),"Del"==e&&(e="Delete"),"Left"==e&&(e="ArrowLeft"),"Up"==e&&(e="ArrowUp"),"Right"==e&&(e="ArrowRight"),"Down"==e&&(e="ArrowDown"),e}(e),o=k(P(r,0))==r.length&&" "!=r,s="",a=!1,l=!1,c=!1;fo&&fo.view==n&&fo.scope==i&&(s=fo.prefix+" ",Ui.indexOf(e.keyCode)<0&&(l=!0,fo=null));let u,h,d=new Set,O=t=>{if(t){for(let e of t.run)if(!d.has(e)&&(d.add(e),e(n)))return t.stopPropagation&&(c=!0),!0;t.preventDefault&&(t.stopPropagation&&(c=!0),l=!0)}return!1},f=t[i];return f&&(O(f[s+lo(r,e,!o)])?a=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Ne.windows&&e.ctrlKey&&e.altKey)&&(u=Kt[e.keyCode])&&u!=r?(O(f[s+lo(u,e,!0)])||e.shiftKey&&(h=Jt[e.keyCode])!=r&&h!=u&&O(f[s+lo(h,e,!1)]))&&(a=!0):o&&e.shiftKey&&O(f[s+lo(r,e,!0)])&&(a=!0),!a&&O(f._any)&&(a=!0)),l&&(a=!0),a&&c&&e.stopPropagation(),mo=null,a}class yo{constructor(t,e,n,i,r){this.className=t,this.left=e,this.top=n,this.width=i,this.height=r}draw(){let t=document.createElement("div");return t.className=this.className,this.adjust(t),t}update(t,e){return e.className==this.className&&(this.adjust(t),!0)}adjust(t){t.style.left=this.left+"px",t.style.top=this.top+"px",null!=this.width&&(t.style.width=this.width+"px"),t.style.height=this.height+"px"}eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}static forRange(t,e,n){if(n.empty){let i=t.coordsAtPos(n.head,n.assoc||1);if(!i)return[];let r=$o(t);return[new yo(e,i.left-r.left,i.top-r.top,null,i.bottom-i.top)]}return function(t,e,n){if(n.to<=t.viewport.from||n.from>=t.viewport.to)return[];let i=Math.max(n.from,t.viewport.from),r=Math.min(n.to,t.viewport.to),o=t.textDirection==yn.LTR,s=t.contentDOM,a=s.getBoundingClientRect(),l=$o(t),c=s.querySelector(".cm-line"),u=c&&window.getComputedStyle(c),h=a.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),d=a.right-(u?parseInt(u.paddingRight):0),O=Ti(t,i),f=Ti(t,r),p=O.type==on.Text?O:null,m=f.type==on.Text?f:null;if(p&&(t.lineWrapping||O.widgetLineBreaks)&&(p=vo(t,i,1,p)),m&&(t.lineWrapping||f.widgetLineBreaks)&&(m=vo(t,r,-1,m)),p&&m&&p.from==m.from&&p.to==m.to)return y($(n.from,n.to,p));{let e=p?$(n.from,null,p):v(O,!1),i=m?$(null,n.to,m):v(f,!0),r=[];return(p||O).to<(m||f).from-(p&&m?1:0)||O.widgetLineBreaks>1&&e.bottom+t.defaultLineHeight/2c&&i.from=o)break;a>r&&l(Math.max(t,r),null==e&&t<=c,Math.min(a,o),null==n&&a>=u,s.dir)}if(r=i.to+1,r>=o)break}return 0==a.length&&l(c,null==e,u,null==n,t.textDirection),{top:r,bottom:s,horizontal:a}}function v(t,e){let n=a.top+(e?t.top:t.bottom);return{top:n,bottom:n,horizontal:[]}}}(t,e,n)}}function $o(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==yn.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function vo(t,e,n,i){let r=t.coordsAtPos(e,2*n);if(!r)return i;let o=t.dom.getBoundingClientRect(),s=(r.top+r.bottom)/2,a=t.posAtCoords({x:o.left+1,y:s}),l=t.posAtCoords({x:o.right-1,y:s});return null==a||null==l?i:{from:Math.max(i.from,Math.min(a,l)),to:Math.min(i.to,Math.max(a,l))}}class bo{constructor(t,e){this.view=t,this.layer=e,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=t.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),e.above&&this.dom.classList.add("cm-layer-above"),e.class&&this.dom.classList.add(e.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(t.state),t.requestMeasure(this.measureReq),e.mount&&e.mount(this.dom,t)}update(t){t.startState.facet(So)!=t.state.facet(So)&&this.setOrder(t.state),(this.layer.update(t,this.dom)||t.geometryChanged)&&(this.scale(),t.view.requestMeasure(this.measureReq))}docViewUpdate(t){!1!==this.layer.updateOnDocViewUpdate&&t.requestMeasure(this.measureReq)}setOrder(t){let e=0,n=t.facet(So);for(;e{return n=t,i=this.drawn[e],!(n.constructor==i.constructor&&n.eq(i));var n,i}))){let e=this.dom.firstChild,n=0;for(let i of t)i.update&&e&&i.constructor&&this.drawn[n].constructor&&i.update(e,this.drawn[n])?(e=e.nextSibling,n++):this.dom.insertBefore(i.draw(),e);for(;e;){let t=e.nextSibling;e.remove(),e=t}this.drawn=t}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const So=L.define();function wo(t){return[ii.define((e=>new bo(e,t))),So.of(t)]}const xo=!Ne.ios,Qo=L.define({combine:t=>_t(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(t,e)=>Math.min(t,e),drawRangeCursor:(t,e)=>t||e})});function Po(t){return t.startState.facet(Qo)!=t.state.facet(Qo)}const _o=wo({above:!0,markers(t){let{state:e}=t,n=e.facet(Qo),i=[];for(let r of e.selection.ranges){let o=r==e.selection.main;if(r.empty?!o||xo:n.drawRangeCursor){let e=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",n=r.empty?r:W.cursor(r.head,r.head>r.anchor?-1:1);for(let r of yo.forRange(t,e,n))i.push(r)}}return i},update(t,e){t.transactions.some((t=>t.selection))&&(e.style.animationName="cm-blink"==e.style.animationName?"cm-blink2":"cm-blink");let n=Po(t);return n&&ko(t.state,e),t.docChanged||t.selectionSet||n},mount(t,e){ko(e.state,t)},class:"cm-cursorLayer"});function ko(t,e){e.style.animationDuration=t.facet(Qo).cursorBlinkRate+"ms"}const To=wo({above:!1,markers:t=>t.state.selection.ranges.map((e=>e.empty?[]:yo.forRange(t,"cm-selectionBackground",e))).reduce(((t,e)=>t.concat(e))),update:(t,e)=>t.docChanged||t.selectionSet||t.viewportChanged||Po(t),class:"cm-selectionLayer"}),Co={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};xo&&(Co[".cm-line"].caretColor=Co[".cm-content"].caretColor="transparent !important");const zo=K.highest(no.theme(Co)),Ro=pt.define({map:(t,e)=>null==t?null:e.mapPos(t)}),Eo=F.define({create:()=>null,update:(t,e)=>(null!=t&&(t=e.changes.mapPos(t)),e.effects.reduce(((t,e)=>e.is(Ro)?e.value:t),t))}),Ao=ii.fromClass(class{constructor(t){this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(t){var e;let n=t.state.field(Eo);null==n?null!=this.cursor&&(null===(e=this.cursor)||void 0===e||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(t.startState.field(Eo)!=n||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(Eo),n=null!=e&&t.coordsAtPos(e);if(!n)return null;let i=t.scrollDOM.getBoundingClientRect();return{left:n.left-i.left+t.scrollDOM.scrollLeft*t.scaleX,top:n.top-i.top+t.scrollDOM.scrollTop*t.scaleY,height:n.bottom-n.top}}drawCursor(t){if(this.cursor){let{scaleX:e,scaleY:n}=this.view;t?(this.cursor.style.left=t.left/e+"px",this.cursor.style.top=t.top/n+"px",this.cursor.style.height=t.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(t){this.view.state.field(Eo)!=t&&this.view.dispatch({effects:Ro.of(t)})}},{eventObservers:{dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}))},dragleave(t){t.target!=this.view.contentDOM&&this.view.contentDOM.contains(t.relatedTarget)||this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function Zo(t,e,n,i,r){e.lastIndex=0;for(let o,s=t.iterRange(n,i),a=n;!s.next().done;a+=s.value.length)if(!s.lineBreak)for(;o=e.exec(s.value);)r(a+o.index,o)}class Mo{constructor(t){const{regexp:e,decoration:n,decorate:i,boundary:r,maxLength:o=1e3}=t;if(!e.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=e,i)this.addMatch=(t,e,n,r)=>i(r,n,n+t[0].length,t,e);else if("function"==typeof n)this.addMatch=(t,e,i,r)=>{let o=n(t,e,i);o&&r(i,i+t[0].length,o)};else{if(!n)throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.addMatch=(t,e,i,r)=>r(i,i+t[0].length,n)}this.boundary=r,this.maxLength=o}createDeco(t){let e=new Et,n=e.add.bind(e);for(let{from:e,to:i}of function(t,e){let n=t.visibleRanges;if(1==n.length&&n[0].from==t.viewport.from&&n[0].to==t.viewport.to)return n;let i=[];for(let{from:r,to:o}of n)r=Math.max(t.state.doc.lineAt(r).from,r-e),o=Math.min(t.state.doc.lineAt(o).to,o+e),i.length&&i[i.length-1].to>=r?i[i.length-1].to=o:i.push({from:r,to:o});return i}(t,this.maxLength))Zo(t.state.doc,this.regexp,e,i,((e,i)=>this.addMatch(i,t,e,n)));return e.finish()}updateDeco(t,e){let n=1e9,i=-1;return t.docChanged&&t.changes.iterChanges(((e,r,o,s)=>{s>t.view.viewport.from&&o1e3?this.createDeco(t.view):i>-1?this.updateRange(t.view,e.map(t.changes),n,i):e}updateRange(t,e,n,i){for(let r of t.visibleRanges){let o=Math.max(r.from,n),s=Math.min(r.to,i);if(s>o){let n=t.state.doc.lineAt(o),i=n.ton.from;o--)if(this.boundary.test(n.text[o-1-n.from])){a=o;break}for(;su.push(n.range(t,e));if(n==i)for(this.regexp.lastIndex=a-n.from;(c=this.regexp.exec(n.text))&&c.indexthis.addMatch(n,t,e,h)));e=e.update({filterFrom:a,filterTo:l,filter:(t,e)=>tl,add:u})}}return e}}const Vo=null!=/x/.unicode?"gu":"g",Xo=new RegExp("[\0-\b\n--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\ufeff-]",Vo),qo={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Wo=null;const jo=L.define({combine(t){let e=_t(t,{render:null,specialChars:Xo,addSpecialChars:null});return(e.replaceTabs=!function(){var t;if(null==Wo&&"undefined"!=typeof document&&document.body){let e=document.body.style;Wo=null!=(null!==(t=e.tabSize)&&void 0!==t?t:e.MozTabSize)}return Wo||!1}())&&(e.specialChars=new RegExp("\t|"+e.specialChars.source,Vo)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Vo)),e}});let Io=null;class Lo extends rn{constructor(t,e){super(),this.options=t,this.code=e}eq(t){return t.code==this.code}toDOM(t){let e=function(t){return t>=32?"•":10==t?"␤":String.fromCharCode(9216+t)}(this.code),n=t.state.phrase("Control character")+" "+(qo[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,n,e);if(i)return i;let r=document.createElement("span");return r.textContent=e,r.title=n,r.setAttribute("aria-label",n),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class No extends rn{constructor(t){super(),this.width=t}eq(t){return t.width==this.width}toDOM(){let t=document.createElement("span");return t.textContent="\t",t.className="cm-tab",t.style.width=this.width+"px",t}ignoreEvent(){return!1}}const Uo=sn.line({class:"cm-activeLine"}),Do=ii.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,n=[];for(let i of t.state.selection.ranges){let r=t.lineBlockAt(i.head);r.from>e&&(n.push(Uo.range(r.from)),e=r.from)}return sn.set(n)}},{decorations:t=>t.decorations});class Yo extends rn{constructor(t){super(),this.content=t}toDOM(t){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild("string"==typeof this.content?document.createTextNode(this.content):"function"==typeof this.content?this.content(t):this.content.cloneNode(!0)),"string"==typeof this.content?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}coordsAt(t){let e=t.firstChild?ae(t.firstChild):[];if(!e.length)return null;let n=window.getComputedStyle(t.parentNode),i=Oe(e[0],"rtl"!=n.direction),r=parseInt(n.lineHeight);return i.bottom-i.top>1.5*r?{left:i.left,right:i.right,top:i.top,bottom:i.top+r}:i}ignoreEvent(){return!1}}const Bo=2e3;function Go(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1),i=t.state.doc.lineAt(n),r=n-i.from,o=r>Bo?-1:r==i.length?function(t,e){let n=t.coordsAtPos(t.viewport.from);return n?Math.round(Math.abs((n.left-e)/t.defaultCharacterWidth)):-1}(t,e.clientX):Nt(i.text,t.state.tabSize,n-i.from);return{line:i.number,col:o,off:r}}const Fo={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},Ho={style:"cursor: crosshair"},Ko="-10000px";class Jo{constructor(t,e,n,i){this.facet=e,this.createTooltipView=n,this.removeTooltipView=i,this.input=t.state.facet(e),this.tooltips=this.input.filter((t=>t));let r=null;this.tooltipViews=this.tooltips.map((t=>r=n(t,r)))}update(t,e){var n;let i=t.state.facet(this.facet),r=i.filter((t=>t));if(i===this.input){for(let e of this.tooltipViews)e.update&&e.update(t);return!1}let o=[],s=e?[]:null;for(let n=0;ne[n]=t)),e.length=s.length),this.input=i,this.tooltips=r,this.tooltipViews=o,!0}}function ts(t){let{win:e}=t;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const es=L.define({combine:t=>{var e,n,i;return{position:Ne.ios?"absolute":(null===(e=t.find((t=>t.position)))||void 0===e?void 0:e.position)||"fixed",parent:(null===(n=t.find((t=>t.parent)))||void 0===n?void 0:n.parent)||null,tooltipSpace:(null===(i=t.find((t=>t.tooltipSpace)))||void 0===i?void 0:i.tooltipSpace)||ts}}}),ns=new WeakMap,is=ii.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(es);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver="function"==typeof ResizeObserver?new ResizeObserver((()=>this.measureSoon())):null,this.manager=new Jo(t,ss,((t,e)=>this.createTooltip(t,e)),(t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()})),this.above=this.manager.tooltips.map((t=>!!t.above)),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver((t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()}),{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout((()=>{this.measureTimeout=-1,this.maybeMeasure()}),50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let n=e||t.geometryChanged,i=t.state.facet(es);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let t of this.manager.tooltipViews)t.dom.style.position=this.position;n=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let t of this.manager.tooltipViews)this.container.appendChild(t.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(t,e){let n=t.create(this.view),i=e?e.dom:null;if(n.dom.classList.add("cm-tooltip"),t.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let t=document.createElement("div");t.className="cm-tooltip-arrow",n.dom.appendChild(t)}return n.dom.style.position=this.position,n.dom.style.top=Ko,n.dom.style.left="0px",this.container.insertBefore(n.dom,i),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var t,e,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let e of this.manager.tooltipViews)e.dom.remove(),null===(t=e.destroy)||void 0===t||t.call(e);this.parent&&this.container.remove(),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),null===(n=this.intersectionObserver)||void 0===n||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=this.view.dom.getBoundingClientRect(),e=1,n=1,i=!1;if("fixed"==this.position&&this.manager.tooltipViews.length){let{dom:t}=this.manager.tooltipViews[0];if(Ne.gecko)i=t.offsetParent!=this.container.ownerDocument.body;else if(t.style.top==Ko&&"0px"==t.style.left){let e=t.getBoundingClientRect();i=Math.abs(e.top+1e4)>1||Math.abs(e.left)>1}}if(i||"absolute"==this.position)if(this.parent){let t=this.parent.getBoundingClientRect();t.width&&t.height&&(e=t.width/this.parent.offsetWidth,n=t.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:n}=this.view.viewState);return{editor:t,parent:this.parent?this.container.getBoundingClientRect():t,pos:this.manager.tooltips.map(((t,e)=>{let n=this.manager.tooltipViews[e];return n.getCoords?n.getCoords(t.pos):this.view.coordsAtPos(t.pos)})),size:this.manager.tooltipViews.map((({dom:t})=>t.getBoundingClientRect())),space:this.view.state.facet(es).tooltipSpace(this.view),scaleX:e,scaleY:n,makeAbsolute:i}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let t of this.manager.tooltipViews)t.dom.style.position="absolute"}let{editor:n,space:i,scaleX:r,scaleY:o}=t,s=[];for(let a=0;a=Math.min(n.bottom,i.bottom)||h.rightMath.min(n.right,i.right)+.1){u.style.top=Ko;continue}let O=l.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,f=O?7:0,p=d.right-d.left,m=null!==(e=ns.get(c))&&void 0!==e?e:d.bottom-d.top,g=c.offset||os,y=this.view.textDirection==yn.LTR,$=d.width>i.right-i.left?y?i.left:i.right-d.width:y?Math.max(i.left,Math.min(h.left-(O?14:0)+g.x,i.right-p)):Math.min(Math.max(i.left,h.left-p+(O?14:0)-g.x),i.right-p),v=this.above[a];!l.strictSide&&(v?h.top-(d.bottom-d.top)-g.yi.bottom)&&v==i.bottom-h.bottom>h.top-i.top&&(v=this.above[a]=!v);let b=(v?h.top-i.top:i.bottom-h.bottom)-f;if(b$&&t.topS&&(S=v?t.top-m-2-f:t.bottom+f+2);if("absolute"==this.position?(u.style.top=(S-t.parent.top)/o+"px",u.style.left=($-t.parent.left)/r+"px"):(u.style.top=S/o+"px",u.style.left=$/r+"px"),O){let t=h.left+(y?g.x:-g.x)-($+14-7);O.style.left=t/r+"px"}!0!==c.overlap&&s.push({left:$,top:S,right:w,bottom:S+m}),u.classList.toggle("cm-tooltip-above",v),u.classList.toggle("cm-tooltip-below",!v),c.positioned&&c.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=Ko}},{eventObservers:{scroll(){this.maybeMeasure()}}}),rs=no.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),os={x:0,y:0},ss=L.define({enables:[is,rs]}),as=L.define({combine:t=>t.reduce(((t,e)=>t.concat(e)),[])});class ls{static create(t){return new ls(t)}constructor(t){this.view=t,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new Jo(t,as,((t,e)=>this.createHostedView(t,e)),(t=>t.dom.remove()))}createHostedView(t,e){let n=t.create(this.view);return n.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(n.dom,e?e.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(t){for(let e of this.manager.tooltipViews)e.mount&&e.mount(t);this.mounted=!0}positioned(t){for(let e of this.manager.tooltipViews)e.positioned&&e.positioned(t)}update(t){this.manager.update(t)}destroy(){var t;for(let e of this.manager.tooltipViews)null===(t=e.destroy)||void 0===t||t.call(e)}passProp(t){let e;for(let n of this.manager.tooltipViews){let i=n[t];if(void 0!==i)if(void 0===e)e=i;else if(e!==i)return}return e}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const cs=ss.compute([as],(t=>{let e=t.facet(as);return 0===e.length?null:{pos:Math.min(...e.map((t=>t.pos))),end:Math.max(...e.map((t=>{var e;return null!==(e=t.end)&&void 0!==e?e:t.pos}))),create:ls.create,above:e[0].above,arrow:e.some((t=>t.arrow))}}));class us{constructor(t,e,n,i,r){this.view=t,this.source=e,this.field=n,this.setHover=i,this.hoverTime=r,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:t.dom,time:0},this.checkHover=this.checkHover.bind(this),t.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),t.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout((()=>this.startHover()),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let t=Date.now()-this.lastMove.time;tn.bottom||e.xn.right+t.defaultCharacterWidth)return;let o=t.bidiSpans(t.state.doc.lineAt(i)).find((t=>t.from<=i&&t.to>=i)),s=o&&o.dir==yn.RTL?-1:1;r=e.x{this.pending==e&&(this.pending=null,!n||Array.isArray(n)&&!n.length||t.dispatch({effects:this.setHover.of(Array.isArray(n)?n:[n])}))}),(e=>Jn(t.state,e,"hover tooltip")))}else!o||Array.isArray(o)&&!o.length||t.dispatch({effects:this.setHover.of(Array.isArray(o)?o:[o])})}get tooltip(){let t=this.view.plugin(is),e=t?t.manager.tooltips.findIndex((t=>t.create==ls.create)):-1;return e>-1?t.manager.tooltipViews[e]:null}mousemove(t){var e,n;this.lastMove={x:t.clientX,y:t.clientY,target:t.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:i,tooltip:r}=this;if(i.length&&r&&!function(t,e){let n,{left:i,right:r,top:o,bottom:s}=t.getBoundingClientRect();if(n=t.querySelector(".cm-tooltip-arrow")){let t=n.getBoundingClientRect();o=Math.min(t.top,o),s=Math.max(t.bottom,s)}return e.clientX>=i-hs&&e.clientX<=r+hs&&e.clientY>=o-hs&&e.clientY<=s+hs}(r.dom,t)||this.pending){let{pos:r}=i[0]||this.pending,o=null!==(n=null===(e=i[0])||void 0===e?void 0:e.end)&&void 0!==n?n:r;(r==o?this.view.posAtCoords(this.lastMove)==r:function(t,e,n,i,r){let o=t.scrollDOM.getBoundingClientRect(),s=t.documentTop+t.documentPadding.top+t.contentHeight;if(o.left>i||o.rightr||Math.min(o.bottom,s)=e&&a<=n}(this.view,r,o,t.clientX,t.clientY))||(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(t){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:e}=this;if(e.length){let{tooltip:e}=this;e&&e.dom.contains(t.relatedTarget)?this.watchTooltipLeave(e.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(t){let e=n=>{t.removeEventListener("mouseleave",e),this.active.length&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};t.addEventListener("mouseleave",e)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const hs=4;function ds(t,e={}){let n=pt.define(),i=F.define({create:()=>[],update(t,i){if(t.length&&(e.hideOnChange&&(i.docChanged||i.selection)?t=[]:e.hideOn&&(t=t.filter((t=>!e.hideOn(i,t)))),i.docChanged)){let e=[];for(let n of t){let t=i.changes.mapPos(n.pos,-1,C.TrackDel);if(null!=t){let r=Object.assign(Object.create(null),n);r.pos=t,null!=r.end&&(r.end=i.changes.mapPos(r.end)),e.push(r)}}t=e}for(let e of i.effects)e.is(n)&&(t=e.value),e.is(fs)&&(t=[]);return t},provide:t=>as.from(t)});return{active:i,extension:[i,ii.define((r=>new us(r,t,i,n,e.hoverTime||300))),cs]}}function Os(t,e){let n=t.plugin(is);if(!n)return null;let i=n.manager.tooltips.indexOf(e);return i<0?null:n.manager.tooltipViews[i]}const fs=pt.define(),ps=L.define({combine(t){let e,n;for(let i of t)e=e||i.topContainer,n=n||i.bottomContainer;return{topContainer:e,bottomContainer:n}}});function ms(t,e){let n=t.plugin(gs),i=n?n.specs.indexOf(e):-1;return i>-1?n.panels[i]:null}const gs=ii.fromClass(class{constructor(t){this.input=t.state.facet(vs),this.specs=this.input.filter((t=>t)),this.panels=this.specs.map((e=>e(t)));let e=t.state.facet(ps);this.top=new ys(t,!0,e.topContainer),this.bottom=new ys(t,!1,e.bottomContainer),this.top.sync(this.panels.filter((t=>t.top))),this.bottom.sync(this.panels.filter((t=>!t.top)));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(t){let e=t.state.facet(ps);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new ys(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new ys(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(vs);if(n!=this.input){let e=n.filter((t=>t)),i=[],r=[],o=[],s=[];for(let n of e){let e,a=this.specs.indexOf(n);a<0?(e=n(t.view),s.push(e)):(e=this.panels[a],e.update&&e.update(t)),i.push(e),(e.top?r:o).push(e)}this.specs=e,this.panels=i,this.top.sync(r),this.bottom.sync(o);for(let t of s)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}else for(let e of this.panels)e.update&&e.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>no.scrollMargins.of((e=>{let n=e.plugin(t);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}}))});class ys{constructor(t,e,n){this.view=t,this.top=e,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(t){for(let e of this.panels)e.destroy&&t.indexOf(e)<0&&e.destroy();this.panels=t,this.syncDOM()}syncDOM(){if(0==this.panels.length)return void(this.dom&&(this.dom.remove(),this.dom=void 0));if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let t=this.dom.firstChild;for(let e of this.panels)if(e.dom.parentNode==this.dom){for(;t!=e.dom;)t=$s(t);t=t.nextSibling}else this.dom.insertBefore(e.dom,t);for(;t;)t=$s(t)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(this.container&&this.classes!=this.view.themeClasses){for(let t of this.classes.split(" "))t&&this.container.classList.remove(t);for(let t of(this.classes=this.view.themeClasses).split(" "))t&&this.container.classList.add(t)}}}function $s(t){let e=t.nextSibling;return t.remove(),e}const vs=L.define({enables:gs});class bs extends kt{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}bs.prototype.elementClass="",bs.prototype.toDOM=void 0,bs.prototype.mapMode=C.TrackBefore,bs.prototype.startSide=bs.prototype.endSide=-1,bs.prototype.point=!0;const Ss=L.define(),ws=L.define(),xs={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Rt.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},Qs=L.define();function Ps(t){return[ks(),Qs.of(Object.assign(Object.assign({},xs),t))]}const _s=L.define({combine:t=>t.some((t=>t))});function ks(t){let e=[Ts];return t&&!1===t.fixed&&e.push(_s.of(!0)),e}const Ts=ii.fromClass(class{constructor(t){this.view=t,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(Qs).map((e=>new Es(t,e)));for(let t of this.gutters)this.dom.appendChild(t.dom);this.fixed=!t.state.facet(_s),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}update(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,i=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(i<.8*(n.to-n.from))}t.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(_s)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&this.dom.remove();let n=Rt.iter(this.view.state.facet(Ss),this.view.viewport.from),i=[],r=this.gutters.map((t=>new Rs(t,this.view.viewport,-this.view.documentPadding.top)));for(let t of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(t.type)){let e=!0;for(let o of t.type)if(o.type==on.Text&&e){zs(n,i,o.from);for(let t of r)t.line(this.view,o,i);e=!1}else if(o.widget)for(let t of r)t.widget(this.view,o)}else if(t.type==on.Text){zs(n,i,t.from);for(let e of r)e.line(this.view,t,i)}else if(t.widget)for(let e of r)e.widget(this.view,t);for(let t of r)t.finish();t&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(t){let e=t.startState.facet(Qs),n=t.state.facet(Qs),i=t.docChanged||t.heightChanged||t.viewportChanged||!Rt.eq(t.startState.facet(Ss),t.state.facet(Ss),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let e of this.gutters)e.update(t)&&(i=!0);else{i=!0;let r=[];for(let i of n){let n=e.indexOf(i);n<0?r.push(new Es(this.view,i)):(this.gutters[n].update(t),r.push(this.gutters[n]))}for(let t of this.gutters)t.dom.remove(),r.indexOf(t)<0&&t.destroy();for(let t of r)this.dom.appendChild(t.dom);this.gutters=r}return i}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove()}},{provide:t=>no.scrollMargins.of((e=>{let n=e.plugin(t);return n&&0!=n.gutters.length&&n.fixed?e.textDirection==yn.LTR?{left:n.dom.offsetWidth*e.scaleX}:{right:n.dom.offsetWidth*e.scaleX}:null}))});function Cs(t){return Array.isArray(t)?t:[t]}function zs(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class Rs{constructor(t,e,n){this.gutter=t,this.height=n,this.i=0,this.cursor=Rt.iter(t.markers,e.from)}addElement(t,e,n){let{gutter:i}=this,r=(e.top-this.height)/t.scaleY,o=e.height/t.scaleY;if(this.i==i.elements.length){let e=new As(t,o,r,n);i.elements.push(e),i.dom.appendChild(e.dom)}else i.elements[this.i].update(t,o,r,n);this.height=e.bottom,this.i++}line(t,e,n){let i=[];zs(this.cursor,i,e.from),n.length&&(i=i.concat(n));let r=this.gutter.config.lineMarker(t,e,i);r&&i.unshift(r);let o=this.gutter;(0!=i.length||o.config.renderEmptyElements)&&this.addElement(t,e,i)}widget(t,e){let n=this.gutter.config.widgetMarker(t,e.widget,e),i=n?[n]:null;for(let n of t.state.facet(ws)){let r=n(t,e.widget,e);r&&(i||(i=[])).push(r)}i&&this.addElement(t,e,i)}finish(){let t=this.gutter;for(;t.elements.length>this.i;){let e=t.elements.pop();t.dom.removeChild(e.dom),e.destroy()}}}class Es{constructor(t,e){this.view=t,this.config=e,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let n in e.domEventHandlers)this.dom.addEventListener(n,(i=>{let r,o=i.target;if(o!=this.dom&&this.dom.contains(o)){for(;o.parentNode!=this.dom;)o=o.parentNode;let t=o.getBoundingClientRect();r=(t.top+t.bottom)/2}else r=i.clientY;let s=t.lineBlockAtHeight(r-t.documentTop);e.domEventHandlers[n](t,s,i)&&i.preventDefault()}));this.markers=Cs(e.markers(t)),e.initialSpacer&&(this.spacer=new As(t,0,0,[e.initialSpacer(t)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(t){let e=this.markers;if(this.markers=Cs(this.config.markers(t.view)),this.spacer&&this.config.updateSpacer){let e=this.config.updateSpacer(this.spacer.markers[0],t);e!=this.spacer.markers[0]&&this.spacer.update(t.view,0,0,[e])}let n=t.view.viewport;return!Rt.eq(this.markers,e,n.from,n.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(t)}destroy(){for(let t of this.elements)t.destroy()}}class As{constructor(t,e,n,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(t,e,n,i)}update(t,e,n,i){this.height!=e&&(this.height=e,this.dom.style.height=e+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),function(t,e){if(t.length!=e.length)return!1;for(let n=0;n_t(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(t,e){let n=Object.assign({},t);for(let t in e){let i=n[t],r=e[t];n[t]=i?(t,e,n)=>i(t,e,n)||r(t,e,n):r}return n}})});class Xs extends bs{constructor(t){super(),this.number=t}eq(t){return this.number==t.number}toDOM(){return document.createTextNode(this.number)}}function qs(t,e){return t.state.facet(Vs).formatNumber(e,t.state)}const Ws=Qs.compute([Vs],(t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers:t=>t.state.facet(Zs),lineMarker:(t,e,n)=>n.some((t=>t.toDOM))?null:new Xs(qs(t,t.state.doc.lineAt(e.from).number)),widgetMarker:(t,e,n)=>{for(let i of t.state.facet(Ms)){let r=i(t,e,n);if(r)return r}return null},lineMarkerChange:t=>t.startState.facet(Vs)!=t.state.facet(Vs),initialSpacer:t=>new Xs(qs(t,js(t.state.doc.lines))),updateSpacer(t,e){let n=qs(e.view,js(e.view.state.doc.lines));return n==t.number?t:new Xs(n)},domEventHandlers:t.facet(Vs).domEventHandlers})));function js(t){let e=9;for(;e{let e=[],n=-1;for(let i of t.selection.ranges){let r=t.doc.lineAt(i.head).from;r>n&&(n=r,e.push(Is.range(r)))}return Rt.of(e)})),Ns=1024;let Us=0;class Ds{constructor(t,e){this.from=t,this.to=e}}class Ys{constructor(t={}){this.id=Us++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return"function"!=typeof t&&(t=Fs.match(t)),e=>{let n=t(e);return void 0===n?null:[this,n]}}}Ys.closedBy=new Ys({deserialize:t=>t.split(" ")}),Ys.openedBy=new Ys({deserialize:t=>t.split(" ")}),Ys.group=new Ys({deserialize:t=>t.split(" ")}),Ys.isolate=new Ys({deserialize:t=>{if(t&&"rtl"!=t&&"ltr"!=t&&"auto"!=t)throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}}),Ys.contextHash=new Ys({perNode:!0}),Ys.lookAhead=new Ys({perNode:!0}),Ys.mounted=new Ys({perNode:!0});class Bs{constructor(t,e,n){this.tree=t,this.overlay=e,this.parser=n}static get(t){return t&&t.props&&t.props[Ys.mounted.id]}}const Gs=Object.create(null);class Fs{constructor(t,e,n,i=0){this.name=t,this.props=e,this.id=n,this.flags=i}static define(t){let e=t.props&&t.props.length?Object.create(null):Gs,n=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(null==t.name?8:0),i=new Fs(t.name||"",e,t.id,n);if(t.props)for(let n of t.props)if(Array.isArray(n)||(n=n(i)),n){if(n[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");e[n[0].id]=n[1]}return i}prop(t){return this.props[t.id]}get isTop(){return(1&this.flags)>0}get isSkipped(){return(2&this.flags)>0}get isError(){return(4&this.flags)>0}get isAnonymous(){return(8&this.flags)>0}is(t){if("string"==typeof t){if(this.name==t)return!0;let e=this.prop(Ys.group);return!!e&&e.indexOf(t)>-1}return this.id==t}static match(t){let e=Object.create(null);for(let n in t)for(let i of n.split(" "))e[i]=t[n];return t=>{for(let n=t.prop(Ys.group),i=-1;i<(n?n.length:0);i++){let r=e[i<0?t.name:n[i]];if(r)return r}}}}Fs.none=new Fs("",Object.create(null),0,8);class Hs{constructor(t){this.types=t;for(let e=0;e=e){let s=new aa(o.tree,o.overlay[0].from+t.from,-1,t);(r||(r=[i])).push(oa(s,e,n,!1))}}return r?da(r):i}(this,t,e)}iterate(t){let{enter:e,leave:n,from:i=0,to:r=this.length}=t,o=t.mode||0,s=(o&ta.IncludeAnonymous)>0;for(let t=this.cursor(o|ta.IncludeAnonymous);;){let o=!1;if(t.from<=r&&t.to>=i&&(!s&&t.type.isAnonymous||!1!==e(t))){if(t.firstChild())continue;o=!0}for(;o&&n&&(s||!t.type.isAnonymous)&&n(t),!t.nextSibling();){if(!t.parent())return;o=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let e in this.props)t.push([+e,this.props[e]]);return t}balance(t={}){return this.children.length<=8?this:ya(Fs.none,this.children,this.positions,0,this.children.length,0,this.length,((t,e,n)=>new ea(this.type,t,e,n,this.propValues)),t.makeTree||((t,e,n)=>new ea(Fs.none,t,e,n)))}static build(t){return function(t){var e;let{buffer:n,nodeSet:i,maxBufferLength:r=Ns,reused:o=[],minRepeatType:s=i.types.length}=t,a=Array.isArray(n)?new na(n,n.length):n,l=i.types,c=0,u=0;function h(t,e,n,m,g,y){let{id:$,start:v,end:b,size:S}=a,w=u,x=c;for(;S<0;){if(a.next(),-1==S){let e=o[$];return n.push(e),void m.push(v-t)}if(-3==S)return void(c=$);if(-4==S)return void(u=$);throw new RangeError(`Unrecognized record size: ${S}`)}let Q,P,_=l[$],k=v-t;if(b-v<=r&&(P=function(t,e){let n=a.fork(),i=0,o=0,l=0,c=n.end-r,u={size:0,start:0,skip:0};t:for(let r=n.pos-t;n.pos>r;){let t=n.size;if(n.id==e&&t>=0){u.size=i,u.start=o,u.skip=l,l+=4,i+=4,n.next();continue}let a=n.pos-t;if(t<0||a=s?4:0,d=n.start;for(n.next();n.pos>a;){if(n.size<0){if(-3!=n.size)break t;h+=4}else n.id>=s&&(h+=4);n.next()}o=d,i+=t,l+=h}return(e<0||i==t)&&(u.size=i,u.start=o,u.skip=l),u.size>4?u:void 0}(a.pos-e,g))){let e=new Uint16Array(P.size-P.skip),n=a.pos-P.size,r=e.length;for(;a.pos>n;)r=p(P.start,e,r);Q=new ia(e,b-P.start,i),k=P.start-t}else{let t=a.pos-S;a.next();let e=[],n=[],i=$>=s?$:-1,o=0,l=b;for(;a.pos>t;)i>=0&&a.id==i&&a.size>=0?(a.end<=l-r&&(O(e,n,v,o,a.end,l,i,w,x),o=e.length,l=a.end),a.next()):y>2500?d(v,t,e,n):h(v,t,e,n,i,y+1);if(i>=0&&o>0&&o-1&&o>0){let t=function(t,e){return(n,i,r)=>{let o,s,a=0,l=n.length-1;if(l>=0&&(o=n[l])instanceof ea){if(!l&&o.type==t&&o.length==r)return o;(s=o.prop(Ys.lookAhead))&&(a=i[l]+o.length+s)}return f(t,n,i,r,a,e)}}(_,x);Q=ya(_,e,n,0,e.length,0,b-v,t,t)}else Q=f(_,e,n,b-v,w-b,x)}n.push(Q),m.push(k)}function d(t,e,n,o){let s=[],l=0,c=-1;for(;a.pos>e;){let{id:t,start:e,end:n,size:i}=a;if(i>4)a.next();else{if(c>-1&&e=0;t-=3)e[n++]=s[t],e[n++]=s[t+1]-r,e[n++]=s[t+2]-r,e[n++]=n;n.push(new ia(e,s[2]-r,i)),o.push(r-t)}}function O(t,e,n,r,o,s,a,l,c){let u=[],h=[];for(;t.length>r;)u.push(t.pop()),h.push(e.pop()+n-o);t.push(f(i.types[a],u,h,s-o,l-s,c)),e.push(o-n)}function f(t,e,n,i,r,o,s){if(o){let t=[Ys.contextHash,o];s=s?[t].concat(s):[t]}if(r>25){let t=[Ys.lookAhead,r];s=s?[t].concat(s):[t]}return new ea(t,e,n,i,s)}function p(t,e,n){let{id:i,start:r,end:o,size:l}=a;if(a.next(),l>=0&&i4){let i=a.pos-(l-4);for(;a.pos>i;)n=p(t,e,n)}e[--n]=s,e[--n]=o-t,e[--n]=r-t,e[--n]=i}else-3==l?c=i:-4==l&&(u=i);return n}let m=[],g=[];for(;a.pos>0;)h(t.start||0,t.bufferStart||0,m,g,-1,0);let y=null!==(e=t.length)&&void 0!==e?e:m.length?g[0]+m[0].length:0;return new ea(l[t.topID],m.reverse(),g.reverse(),y)}(t)}}ea.empty=new ea(Fs.none,[],[],0);class na{constructor(t,e){this.buffer=t,this.index=e}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new na(this.buffer,this.index)}}class ia{constructor(t,e,n){this.buffer=t,this.length=e,this.set=n}get type(){return Fs.none}toString(){let t=[];for(let e=0;e0));a=o[a+3]);return s}slice(t,e,n){let i=this.buffer,r=new Uint16Array(e-t),o=0;for(let s=t,a=0;s=e&&ne;case 1:return n<=e&&i>e;case 2:return i>e;case 4:return!0}}function oa(t,e,n,i){for(var r;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to0?s.length:-1;t!=l;t+=e){let l=s[t],c=a[t]+o.from;if(ra(i,n,c,c+l.length))if(l instanceof ia){if(r&ta.ExcludeBuffers)continue;let s=l.findChild(0,l.buffer.length,e,n-c,i);if(s>-1)return new ha(new ua(o,l,t,c),null,s)}else if(r&ta.IncludeAnonymous||!l.type.isAnonymous||pa(l)){let s;if(!(r&ta.IgnoreMounts)&&(s=Bs.get(l))&&!s.overlay)return new aa(s.tree,c,t,o);let a=new aa(l,c,t,o);return r&ta.IncludeAnonymous||!a.type.isAnonymous?a:a.nextChild(e<0?l.children.length-1:0,e,n,i)}}if(r&ta.IncludeAnonymous||!o.type.isAnonymous)return null;if(t=o.index>=0?o.index+e:e<0?-1:o._parent._tree.children.length,o=o._parent,!o)return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}enter(t,e,n=0){let i;if(!(n&ta.IgnoreOverlays)&&(i=Bs.get(this._tree))&&i.overlay){let n=t-this.from;for(let{from:t,to:r}of i.overlay)if((e>0?t<=n:t=n:r>n))return new aa(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,e,n)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function la(t,e,n,i){let r=t.cursor(),o=[];if(!r.firstChild())return o;if(null!=n)for(let t=!1;!t;)if(t=r.type.is(n),!r.nextSibling())return o;for(;;){if(null!=i&&r.type.is(i))return o;if(r.type.is(e)&&o.push(r.node),!r.nextSibling())return null==i?o:[]}}function ca(t,e,n=e.length-1){for(let i=t;n>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[n]&&e[n]!=i.name)return!1;n--}}return!0}class ua{constructor(t,e,n,i){this.parent=t,this.buffer=e,this.index=n,this.start=i}}class ha extends sa{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(t,e,n){super(),this.context=t,this._parent=e,this.index=n,this.type=t.buffer.set.types[t.buffer.buffer[n]]}child(t,e,n){let{buffer:i}=this.context,r=i.findChild(this.index+4,i.buffer[this.index+3],t,e-this.context.start,n);return r<0?null:new ha(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}enter(t,e,n=0){if(n&ta.ExcludeBuffers)return null;let{buffer:i}=this.context,r=i.findChild(this.index+4,i.buffer[this.index+3],e>0?1:-1,t-this.context.start,e);return r<0?null:new ha(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,e=t.buffer[this.index+3];return e<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new ha(this.context,this._parent,e):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,e=this._parent?this._parent.index+4:0;return this.index==e?this.externalSibling(-1):new ha(this.context,this._parent,t.findChild(e,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],e=[],{buffer:n}=this.context,i=this.index+4,r=n.buffer[this.index+3];if(r>i){let o=n.buffer[this.index+1];t.push(n.slice(i,r,o)),e.push(0)}return new ea(this.type,t,e,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function da(t){if(!t.length)return null;let e=0,n=t[0];for(let i=1;in.from||r.to0){if(this.index-1)for(let i=e+t,r=t<0?-1:n._tree.children.length;i!=r;i+=t){let t=n._tree.children[i];if(this.mode&ta.IncludeAnonymous||t instanceof ia||!t.type.isAnonymous||pa(t))return!1}return!0}move(t,e){if(e&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,e=0){for(;(this.from==this.to||(e<1?this.from>=t:this.from>t)||(e>-1?this.to<=t:this.to=0;){for(let o=t;o;o=o._parent)if(o.index==i){if(i==this.index)return o;e=o,n=r+1;break t}i=this.stack[--r]}for(let t=n;t=0;r--){if(r<0)return ca(this._tree,t,i);let o=n[e.buffer[this.stack[r]]];if(!o.isAnonymous){if(t[i]&&t[i]!=o.name)return!1;i--}}return!0}}function pa(t){return t.children.some((t=>t instanceof ia||!t.type.isAnonymous||pa(t)))}const ma=new WeakMap;function ga(t,e){if(!t.isAnonymous||e instanceof ia||e.type!=t)return 1;let n=ma.get(e);if(null==n){n=1;for(let i of e.children){if(i.type!=t||!(i instanceof ea)){n=1;break}n+=ga(t,i)}ma.set(e,n)}return n}function ya(t,e,n,i,r,o,s,a,l){let c=0;for(let n=i;n=u)break;f+=e}if(c==r+1){if(f>u){let t=n[r];e(t.children,t.positions,0,t.children.length,i[r]+a);continue}h.push(n[r])}else{let e=i[c-1]+n[c-1].length-O;h.push(ya(t,n,i,r,c,O,e,null,l))}d.push(O+a-o)}}(e,n,i,r,0),(a||l)(h,d,s)}class $a{constructor(){this.map=new WeakMap}setBuffer(t,e,n){let i=this.map.get(t);i||this.map.set(t,i=new Map),i.set(e,n)}getBuffer(t,e){let n=this.map.get(t);return n&&n.get(e)}set(t,e){t instanceof ha?this.setBuffer(t.context.buffer,t.index,e):t instanceof aa&&this.map.set(t.tree,e)}get(t){return t instanceof ha?this.getBuffer(t.context.buffer,t.index):t instanceof aa?this.map.get(t.tree):void 0}cursorSet(t,e){t.buffer?this.setBuffer(t.buffer.buffer,t.index,e):this.map.set(t.tree,e)}cursorGet(t){return t.buffer?this.getBuffer(t.buffer.buffer,t.index):this.map.get(t.tree)}}class va{constructor(t,e,n,i,r=!1,o=!1){this.from=t,this.to=e,this.tree=n,this.offset=i,this.open=(r?1:0)|(o?2:0)}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(t,e=[],n=!1){let i=[new va(0,t.length,t,0,!1,n)];for(let n of e)n.to>t.length&&i.push(n);return i}static applyChanges(t,e,n=128){if(!e.length)return t;let i=[],r=1,o=t.length?t[0]:null;for(let s=0,a=0,l=0;;s++){let c=s=n)for(;o&&o.from=e.from||u<=e.to||l){let t=Math.max(e.from,a)-l,n=Math.min(e.to,u)-l;e=t>=n?null:new va(t,n,e.tree,e.offset+l,s>0,!!c)}if(e&&i.push(e),o.to>u)break;o=rnew Ds(t.from,t.to))):[new Ds(0,0)]:[new Ds(0,t.length)],this.createParse(t,e||[],n)}parse(t,e,n){let i=this.startParse(t,e,n);for(;;){let t=i.advance();if(t)return t}}}class Sa{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,e){return this.string.slice(t,e)}}function wa(t){return(e,n,i,r)=>new ka(e,t,n,i,r)}class xa{constructor(t,e,n,i,r){this.parser=t,this.parse=e,this.overlay=n,this.target=i,this.from=r}}function Qa(t){if(!t.length||t.some((t=>t.from>=t.to)))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}class Pa{constructor(t,e,n,i,r,o,s){this.parser=t,this.predicate=e,this.mounts=n,this.index=i,this.start=r,this.target=o,this.prev=s,this.depth=0,this.ranges=[]}}const _a=new Ys({perNode:!0});class ka{constructor(t,e,n,i,r){this.nest=e,this.input=n,this.fragments=i,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=t}advance(){if(this.baseParse){let t=this.baseParse.advance();if(!t)return null;if(this.baseParse=null,this.baseTree=t,this.startInner(),null!=this.stoppedAt)for(let t of this.inner)t.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let t=this.baseTree;return null!=this.stoppedAt&&(t=new ea(t.type,t.children,t.positions,t.length,t.propValues.concat([[_a,this.stoppedAt]]))),t}let t=this.inner[this.innerDone],e=t.parse.advance();if(e){this.innerDone++;let n=Object.assign(Object.create(null),t.target.props);n[Ys.mounted.id]=new Bs(e,t.overlay,t.parser),t.target.props=n}return null}get parsedPos(){if(this.baseParse)return 0;let t=this.input.length;for(let e=this.innerDone;e=this.stoppedAt)a=!1;else if(t.hasNode(i)){if(e){let t=e.mounts.find((t=>t.frag.from<=i.from&&t.frag.to>=i.to&&t.mount.overlay));if(t)for(let n of t.mount.overlay){let r=n.from+t.pos,o=n.to+t.pos;r>=i.from&&o<=i.to&&!e.ranges.some((t=>t.fromr))&&e.ranges.push({from:r,to:o})}}a=!1}else if(n&&(o=Ta(n.ranges,i.from,i.to)))a=2!=o;else if(!i.type.isAnonymous&&(r=this.nest(i,this.input))&&(i.fromnew Ds(t.from-i.from,t.to-i.from))):null,i.tree,t.length?t[0].from:i.from)),r.overlay?t.length&&(n={ranges:t,depth:0,prev:n}):a=!1}}else if(e&&(s=e.predicate(i))&&(!0===s&&(s=new Ds(i.from,i.to)),s.from=0&&e.ranges[t].to==s.from?e.ranges[t]={from:e.ranges[t].from,to:s.to}:e.ranges.push(s)}if(a&&i.firstChild())e&&e.depth++,n&&n.depth++;else for(;!i.nextSibling();){if(!i.parent())break t;if(e&&! --e.depth){let t=Aa(this.ranges,e.ranges);t.length&&(Qa(t),this.inner.splice(e.index,0,new xa(e.parser,e.parser.startParse(this.input,Ma(e.mounts,t),t),e.ranges.map((t=>new Ds(t.from-e.start,t.to-e.start))),e.target,t[0].from))),e=e.prev}n&&! --n.depth&&(n=n.prev)}}}}function Ta(t,e,n){for(let i of t){if(i.from>=n)break;if(i.to>e)return i.from<=e&&i.to>=n?2:1}return 0}function Ca(t,e,n,i,r,o){if(e=t&&e.enter(n,1,ta.IgnoreOverlays|ta.ExcludeBuffers)||e.next(!1)||(this.done=!0)}hasNode(t){if(this.moveTo(t.from),!this.done&&this.cursor.from+this.offset==t.from&&this.cursor.tree)for(let e=this.cursor.tree;;){if(e==t.tree)return!0;if(!(e.children.length&&0==e.positions[0]&&e.children[0]instanceof ea))break;e=e.children[0]}return!1}}class Ea{constructor(t){var e;if(this.fragments=t,this.curTo=0,this.fragI=0,t.length){let n=this.curFrag=t[0];this.curTo=null!==(e=n.tree.prop(_a))&&void 0!==e?e:n.to,this.inner=new Ra(n.tree,-n.offset)}else this.curFrag=this.inner=null}hasNode(t){for(;this.curFrag&&t.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=t.from&&this.curTo>=t.to&&this.inner.hasNode(t)}nextFrag(){var t;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let e=this.curFrag=this.fragments[this.fragI];this.curTo=null!==(t=e.tree.prop(_a))&&void 0!==t?t:e.to,this.inner=new Ra(e.tree,-e.offset)}}findMounts(t,e){var n;let i=[];if(this.inner){this.inner.cursor.moveTo(t,1);for(let t=this.inner.cursor.node;t;t=t.parent){let r=null===(n=t.tree)||void 0===n?void 0:n.prop(Ys.mounted);if(r&&r.parser==e)for(let e=this.fragI;e=t.to)break;n.tree==this.curFrag.tree&&i.push({frag:n,pos:t.from-n.offset,mount:r})}}}return i}}function Aa(t,e){let n=null,i=e;for(let r=1,o=0;r=a)break;t.to<=s||(n||(i=n=e.slice()),t.froma&&n.splice(o+1,0,new Ds(a,t.to))):t.to>a?n[o--]=new Ds(a,t.to):n.splice(o--,1))}}return i}function Za(t,e,n,i){let r=0,o=0,s=!1,a=!1,l=-1e9,c=[];for(;;){let u=r==t.length?1e9:s?t[r].to:t[r].from,h=o==e.length?1e9:a?e[o].to:e[o].from;if(s!=a){let t=Math.max(l,n),e=Math.min(u,h,i);tnew Ds(t.from+i,t.to+i))),a,l);for(let e=0,i=a;;e++){let a=e==s.length,c=a?l:s[e].from;if(c>i&&n.push(new va(i,c,r.tree,-t,o.from>=i||o.openStart,o.to<=c||o.openEnd)),a)break;i=s[e].to}}else n.push(new va(a,l,r.tree,-t,o.from>=t||o.openStart,o.to<=s||o.openEnd))}return n}let Va=0;class Xa{constructor(t,e,n,i){this.name=t,this.set=e,this.base=n,this.modified=i,this.id=Va++}toString(){let{name:t}=this;for(let e of this.modified)e.name&&(t=`${e.name}(${t})`);return t}static define(t,e){let n="string"==typeof t?t:"?";if(t instanceof Xa&&(e=t),null==e?void 0:e.base)throw new Error("Can not derive from a modified tag");let i=new Xa(n,[],null,[]);if(i.set.push(i),e)for(let t of e.set)i.set.push(t);return i}static defineModifier(t){let e=new Wa(t);return t=>t.modified.indexOf(e)>-1?t:Wa.get(t.base||t,t.modified.concat(e).sort(((t,e)=>t.id-e.id)))}}let qa=0;class Wa{constructor(t){this.name=t,this.instances=[],this.id=qa++}static get(t,e){if(!e.length)return t;let n=e[0].instances.find((n=>{return n.base==t&&(i=e,r=n.modified,i.length==r.length&&i.every(((t,e)=>t==r[e])));var i,r}));if(n)return n;let i=[],r=new Xa(t.name,i,t,e);for(let t of e)t.instances.push(r);let o=function(t){let e=[[]];for(let n=0;ne.length-t.length))}(e);for(let e of t.set)if(!e.modified.length)for(let t of o)i.push(Wa.get(e,t));return r}}function ja(t){let e=Object.create(null);for(let n in t){let i=t[n];Array.isArray(i)||(i=[i]);for(let t of n.split(" "))if(t){let n=[],r=2,o=t;for(let e=0;;){if("..."==o&&e>0&&e+3==t.length){r=1;break}let i=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!i)throw new RangeError("Invalid path: "+t);if(n.push("*"==i[0]?"":'"'==i[0][0]?JSON.parse(i[0]):i[0]),e+=i[0].length,e==t.length)break;let s=t[e++];if(e==t.length&&"!"==s){r=0;break}if("/"!=s)throw new RangeError("Invalid path: "+t);o=t.slice(e)}let s=n.length-1,a=n[s];if(!a)throw new RangeError("Invalid path: "+t);let l=new La(i,r,s>0?n.slice(0,s):null);e[a]=l.sort(e[a])}}return Ia.add(e)}const Ia=new Ys;class La{constructor(t,e,n,i){this.tags=t,this.mode=e,this.context=n,this.next=i}get opaque(){return 0==this.mode}get inherit(){return 1==this.mode}sort(t){return!t||t.depth{let e=r;for(let i of t)for(let t of i.set){let i=n[t.id];if(i){e=e?e+" "+i:i;break}}return e},scope:i}}function Ua(t,e,n,i=0,r=t.length){let o=new Da(i,Array.isArray(e)?e:[e],n);o.highlightRange(t.cursor(),i,r,"",o.highlighters),o.flush(r)}La.empty=new La([],2,null);class Da{constructor(t,e,n){this.at=t,this.highlighters=e,this.span=n,this.class=""}startSpan(t,e){e!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=e)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,e,n,i,r){let{type:o,from:s,to:a}=t;if(s>=n||a<=e)return;o.isTop&&(r=this.highlighters.filter((t=>!t.scope||t.scope(o))));let l=i,c=function(t){let e=t.type.prop(Ia);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}(t)||La.empty,u=function(t,e){let n=null;for(let i of t){let t=i.style(e);t&&(n=n?n+" "+t:t)}return n}(r,c.tags);if(u&&(l&&(l+=" "),l+=u,1==c.mode&&(i+=(i?" ":"")+u)),this.startSpan(Math.max(e,s),l),c.opaque)return;let h=t.tree&&t.tree.prop(Ys.mounted);if(h&&h.overlay){let o=t.node.enter(h.overlay[0].from+s,1),c=this.highlighters.filter((t=>!t.scope||t.scope(h.tree.type))),u=t.firstChild();for(let d=0,O=s;;d++){let f=d=p)&&t.nextSibling()););if(!f||p>n)break;O=f.to+s,O>e&&(this.highlightRange(o.cursor(),Math.max(e,f.from+s),Math.min(n,O),"",c),this.startSpan(Math.min(n,O),l))}u&&t.parent()}else if(t.firstChild()){h&&(i="");do{if(!(t.to<=e)){if(t.from>=n)break;this.highlightRange(t,e,n,i,r),this.startSpan(Math.min(n,t.to),l)}}while(t.nextSibling());t.parent()}}}const Ya=Xa.define,Ba=Ya(),Ga=Ya(),Fa=Ya(Ga),Ha=Ya(Ga),Ka=Ya(),Ja=Ya(Ka),tl=Ya(Ka),el=Ya(),nl=Ya(el),il=Ya(),rl=Ya(),ol=Ya(),sl=Ya(ol),al=Ya(),ll={comment:Ba,lineComment:Ya(Ba),blockComment:Ya(Ba),docComment:Ya(Ba),name:Ga,variableName:Ya(Ga),typeName:Fa,tagName:Ya(Fa),propertyName:Ha,attributeName:Ya(Ha),className:Ya(Ga),labelName:Ya(Ga),namespace:Ya(Ga),macroName:Ya(Ga),literal:Ka,string:Ja,docString:Ya(Ja),character:Ya(Ja),attributeValue:Ya(Ja),number:tl,integer:Ya(tl),float:Ya(tl),bool:Ya(Ka),regexp:Ya(Ka),escape:Ya(Ka),color:Ya(Ka),url:Ya(Ka),keyword:il,self:Ya(il),null:Ya(il),atom:Ya(il),unit:Ya(il),modifier:Ya(il),operatorKeyword:Ya(il),controlKeyword:Ya(il),definitionKeyword:Ya(il),moduleKeyword:Ya(il),operator:rl,derefOperator:Ya(rl),arithmeticOperator:Ya(rl),logicOperator:Ya(rl),bitwiseOperator:Ya(rl),compareOperator:Ya(rl),updateOperator:Ya(rl),definitionOperator:Ya(rl),typeOperator:Ya(rl),controlOperator:Ya(rl),punctuation:ol,separator:Ya(ol),bracket:sl,angleBracket:Ya(sl),squareBracket:Ya(sl),paren:Ya(sl),brace:Ya(sl),content:el,heading:nl,heading1:Ya(nl),heading2:Ya(nl),heading3:Ya(nl),heading4:Ya(nl),heading5:Ya(nl),heading6:Ya(nl),contentSeparator:Ya(el),list:Ya(el),quote:Ya(el),emphasis:Ya(el),strong:Ya(el),link:Ya(el),monospace:Ya(el),strikethrough:Ya(el),inserted:Ya(),deleted:Ya(),changed:Ya(),invalid:Ya(),meta:al,documentMeta:Ya(al),annotation:Ya(al),processingInstruction:Ya(al),definition:Xa.defineModifier("definition"),constant:Xa.defineModifier("constant"),function:Xa.defineModifier("function"),standard:Xa.defineModifier("standard"),local:Xa.defineModifier("local"),special:Xa.defineModifier("special")};for(let t in ll){let e=ll[t];e instanceof Xa&&(e.name=t)}var cl;Na([{tag:ll.link,class:"tok-link"},{tag:ll.heading,class:"tok-heading"},{tag:ll.emphasis,class:"tok-emphasis"},{tag:ll.strong,class:"tok-strong"},{tag:ll.keyword,class:"tok-keyword"},{tag:ll.atom,class:"tok-atom"},{tag:ll.bool,class:"tok-bool"},{tag:ll.url,class:"tok-url"},{tag:ll.labelName,class:"tok-labelName"},{tag:ll.inserted,class:"tok-inserted"},{tag:ll.deleted,class:"tok-deleted"},{tag:ll.literal,class:"tok-literal"},{tag:ll.string,class:"tok-string"},{tag:ll.number,class:"tok-number"},{tag:[ll.regexp,ll.escape,ll.special(ll.string)],class:"tok-string2"},{tag:ll.variableName,class:"tok-variableName"},{tag:ll.local(ll.variableName),class:"tok-variableName tok-local"},{tag:ll.definition(ll.variableName),class:"tok-variableName tok-definition"},{tag:ll.special(ll.variableName),class:"tok-variableName2"},{tag:ll.definition(ll.propertyName),class:"tok-propertyName tok-definition"},{tag:ll.typeName,class:"tok-typeName"},{tag:ll.namespace,class:"tok-namespace"},{tag:ll.className,class:"tok-className"},{tag:ll.macroName,class:"tok-macroName"},{tag:ll.propertyName,class:"tok-propertyName"},{tag:ll.operator,class:"tok-operator"},{tag:ll.comment,class:"tok-comment"},{tag:ll.meta,class:"tok-meta"},{tag:ll.invalid,class:"tok-invalid"},{tag:ll.punctuation,class:"tok-punctuation"}]);const ul=new Ys;function hl(t){return L.define({combine:t?e=>e.concat(t):void 0})}const dl=new Ys;class Ol{constructor(t,e,n=[],i=""){this.data=t,this.name=i,Pt.prototype.hasOwnProperty("tree")||Object.defineProperty(Pt.prototype,"tree",{get(){return ml(this)}}),this.parser=e,this.extension=[Ql.of(this),Pt.languageData.of(((t,e,n)=>{let i=fl(t,e,n),r=i.type.prop(ul);if(!r)return[];let o=t.facet(r),s=i.type.prop(dl);if(s){let r=i.resolve(e-i.from,n);for(let e of s)if(e.test(r,t)){let n=t.facet(e.facet);return"replace"==e.type?n:n.concat(o)}}return o}))].concat(n)}isActiveAt(t,e,n=-1){return fl(t,e,n).type.prop(ul)==this.data}findRegions(t){let e=t.facet(Ql);if((null==e?void 0:e.data)==this.data)return[{from:0,to:t.doc.length}];if(!e||!e.allowsNesting)return[];let n=[],i=(t,e)=>{if(t.prop(ul)==this.data)return void n.push({from:e,to:e+t.length});let r=t.prop(Ys.mounted);if(r){if(r.tree.prop(ul)==this.data){if(r.overlay)for(let t of r.overlay)n.push({from:t.from+e,to:t.to+e});else n.push({from:e,to:e+t.length});return}if(r.overlay){let t=n.length;if(i(r.tree,r.overlay[0].from+e),n.length>t)return}}for(let n=0;nt.isTop?e:void 0))]}),t.name)}configure(t,e){return new pl(this.data,this.parser.configure(t),e||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function ml(t){let e=t.field(Ol.state,!1);return e?e.tree:ea.empty}class gl{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,e){let n=this.cursorPos-this.string.length;return t=this.cursorPos?this.doc.sliceString(t,e):this.string.slice(t-n,e-n)}}let yl=null;class $l{constructor(t,e,n=[],i,r,o,s,a){this.parser=t,this.state=e,this.fragments=n,this.tree=i,this.treeLen=r,this.viewport=o,this.skipped=s,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(t,e,n){return new $l(t,e,[],ea.empty,0,n,[],null)}startParse(){return this.parser.startParse(new gl(this.state.doc),this.fragments)}work(t,e){return null!=e&&e>=this.state.doc.length&&(e=void 0),this.tree!=ea.empty&&this.isDone(null!=e?e:this.state.doc.length)?(this.takeTree(),!0):this.withContext((()=>{var n;if("number"==typeof t){let e=Date.now()+t;t=()=>Date.now()>e}for(this.parse||(this.parse=this.startParse()),null!=e&&(null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&e=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext((()=>{for(;!(e=this.parse.advance()););})),this.treeLen=t,this.tree=e,this.fragments=this.withoutTempSkipped(va.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let e=yl;yl=this;try{return t()}finally{yl=e}}withoutTempSkipped(t){for(let e;e=this.tempSkipped.pop();)t=vl(t,e.from,e.to);return t}changes(t,e){let{fragments:n,tree:i,treeLen:r,viewport:o,skipped:s}=this;if(this.takeTree(),!t.empty){let e=[];if(t.iterChangedRanges(((t,n,i,r)=>e.push({fromA:t,toA:n,fromB:i,toB:r}))),n=va.applyChanges(n,e),i=ea.empty,r=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){s=[];for(let e of this.skipped){let n=t.mapPos(e.from,1),i=t.mapPos(e.to,-1);nt.from&&(this.fragments=vl(this.fragments,n,i),this.skipped.splice(e--,1))}return!(this.skipped.length>=e||(this.reset(),0))}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,e){this.skipped.push({from:t,to:e})}static getSkippingParser(t){return new class extends ba{createParse(e,n,i){let r=i[0].from,o=i[i.length-1].to;return{parsedPos:r,advance(){let e=yl;if(e){for(let t of i)e.tempSkipped.push(t);t&&(e.scheduleOn=e.scheduleOn?Promise.all([e.scheduleOn,t]):t)}return this.parsedPos=o,new ea(Fs.none,[],[],o-r)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let e=this.fragments;return this.treeLen>=t&&e.length&&0==e[0].from&&e[0].to>=t}static get(){return yl}}function vl(t,e,n){return va.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class bl{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let e=this.context.changes(t.changes,t.state),n=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),e.viewport.to);return e.work(20,n)||e.takeTree(),new bl(e)}static init(t){let e=Math.min(3e3,t.doc.length),n=$l.create(t.facet(Ql).parser,t,{from:0,to:e});return n.work(20,e)||n.takeTree(),new bl(n)}}Ol.state=F.define({create:bl.init,update(t,e){for(let t of e.effects)if(t.is(Ol.setState))return t.value;return e.startState.facet(Ql)!=e.state.facet(Ql)?bl.init(e.state):t.apply(e)}});let Sl=t=>{let e=setTimeout((()=>t()),500);return()=>clearTimeout(e)};"undefined"!=typeof requestIdleCallback&&(Sl=t=>{let e=-1,n=setTimeout((()=>{e=requestIdleCallback(t,{timeout:400})}),100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const wl="undefined"!=typeof navigator&&(null===(cl=navigator.scheduling)||void 0===cl?void 0:cl.isInputPending)?()=>navigator.scheduling.isInputPending():null,xl=ii.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let e=this.view.state.field(Ol.state).context;(e.updateViewport(t.view.viewport)||this.view.viewport.to>e.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(e)}scheduleWork(){if(this.working)return;let{state:t}=this.view,e=t.field(Ol.state);e.tree==e.context.tree&&e.context.isDone(t.doc.length)||(this.working=Sl(this.work))}work(t){this.working=null;let e=Date.now();if(this.chunkEndi+1e3,a=r.context.work((()=>wl&&wl()||Date.now()>o),i+(s?0:1e5));this.chunkBudget-=Date.now()-e,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:Ol.setState.of(new bl(r.context))})),this.chunkBudget>0&&(!a||s)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then((()=>this.scheduleWork())).catch((t=>Jn(this.view.state,t))).then((()=>this.workScheduled--)),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Ql=L.define({combine:t=>t.length?t[0]:null,enables:t=>[Ol.state,xl,no.contentAttributes.compute([t],(e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}}))]});class Pl{constructor(t,e=[]){this.language=t,this.support=e,this.extension=[t,e]}}class _l{constructor(t,e,n,i,r,o=void 0){this.name=t,this.alias=e,this.extensions=n,this.filename=i,this.loadFunc=r,this.support=o,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then((t=>this.support=t),(t=>{throw this.loading=null,t})))}static of(t){let{load:e,support:n}=t;if(!e){if(!n)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");e=()=>Promise.resolve(n)}return new _l(t.name,(t.alias||[]).concat(t.name).map((t=>t.toLowerCase())),t.extensions||[],t.filename,e,n)}static matchFilename(t,e){for(let n of t)if(n.filename&&n.filename.test(e))return n;let n=/\.([^.]+)$/.exec(e);if(n)for(let e of t)if(e.extensions.indexOf(n[1])>-1)return e;return null}static matchLanguageName(t,e,n=!0){e=e.toLowerCase();for(let n of t)if(n.alias.some((t=>t==e)))return n;if(n)for(let n of t)for(let t of n.alias){let i=e.indexOf(t);if(i>-1&&(t.length>2||!/\w/.test(e[i-1])&&!/\w/.test(e[i+t.length])))return n}return null}}const kl=L.define(),Tl=L.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some((t=>t!=e[0])))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function Cl(t){let e=t.facet(Tl);return 9==e.charCodeAt(0)?t.tabSize*e.length:e.length}function zl(t,e){let n="",i=t.tabSize,r=t.facet(Tl)[0];if("\t"==r){for(;e>=i;)n+="\t",e-=i;r=" "}for(let t=0;t=e?function(t,e,n){let i=e.resolveStack(n),r=i.node.enterUnfinishedNodesBefore(n);if(r!=i.node){let t=[];for(let e=r;e!=i.node;e=e.parent)t.push(e);for(let e=t.length-1;e>=0;e--)i={node:t[e],next:i}}return Zl(i,t,n)}(t,n,e):null}class El{constructor(t,e={}){this.state=t,this.options=e,this.unit=Cl(t)}lineAt(t,e=1){let n=this.state.doc.lineAt(t),{simulateBreak:i,simulateDoubleBreak:r}=this.options;return null!=i&&i>=n.from&&i<=n.to?r&&i==t?{text:"",from:t}:(e<0?i-1&&(r+=o-this.countColumn(n,n.search(/\S|$/))),r}countColumn(t,e=t.length){return Nt(t,this.state.tabSize,e)}lineIndent(t,e=1){let{text:n,from:i}=this.lineAt(t,e),r=this.options.overrideIndentation;if(r){let t=r(i);if(t>-1)return t}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Al=new Ys;function Zl(t,e,n){for(let i=t;i;i=i.next){let t=Ml(i.node);if(t)return t(Xl.create(e,n,i))}return 0}function Ml(t){let e=t.type.prop(Al);if(e)return e;let n,i=t.firstChild;if(i&&(n=i.type.prop(Ys.closedBy))){let e=t.lastChild,i=e&&n.indexOf(e.name)>-1;return t=>jl(t,!0,1,void 0,i&&!function(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}(t)?e.from:void 0)}return null==t.parent?Vl:null}function Vl(){return 0}class Xl extends El{constructor(t,e,n){super(t.state,t.options),this.base=t,this.pos=e,this.context=n}get node(){return this.context.node}static create(t,e,n){return new Xl(t,e,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let e=this.state.doc.lineAt(t.from);for(;;){let n=t.resolve(e.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(ql(n,t))break;e=this.state.doc.lineAt(n.from)}return this.lineIndent(e.from)}continue(){return Zl(this.context.next,this.base,this.pos)}}function ql(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function Wl({closing:t,align:e=!0,units:n=1}){return i=>jl(i,e,n,t)}function jl(t,e,n,i,r){let o=t.textAfter,s=o.match(/^\s*/)[0].length,a=i&&o.slice(s,s+i.length)==i||r==t.pos+s,l=e?function(t){let e=t.node,n=e.childAfter(e.from),i=e.lastChild;if(!n)return null;let r=t.options.simulateBreak,o=t.state.doc.lineAt(n.from),s=null==r||r<=o.from?o.to:Math.min(o.to,r);for(let t=n.to;;){let r=e.childAfter(t);if(!r||r==i)return null;if(!r.type.isSkipped){if(r.from>=s)return null;let t=/^ */.exec(o.text.slice(n.to-o.from))[0].length;return{from:n.from,to:n.to+t}}t=r.to}}(t):null;return l?a?t.column(l.from):t.column(l.to):t.baseIndent+(a?0:t.unit*n)}function Il({except:t,units:e=1}={}){return n=>{let i=t&&t.test(n.textAfter);return n.baseIndent+(i?0:e*n.unit)}}const Ll=L.define(),Nl=new Ys;function Ul(t){let e=t.firstChild,n=t.lastChild;return e&&e.ton)continue;if(r&&s.from=e&&i.to>n&&(r=i)}}return r}(t,e,n)}function Bl(t,e){let n=e.mapPos(t.from,1),i=e.mapPos(t.to,-1);return n>=i?void 0:{from:n,to:i}}const Gl=pt.define({map:Bl}),Fl=pt.define({map:Bl});function Hl(t){let e=[];for(let{head:n}of t.state.selection.ranges)e.some((t=>t.from<=n&&t.to>=n))||e.push(t.lineBlockAt(n));return e}const Kl=F.define({create:()=>sn.none,update(t,e){t=t.map(e.changes);for(let n of e.effects)if(n.is(Gl)&&!tc(t,n.value.from,n.value.to)){let{preparePlaceholder:i}=e.state.facet(oc),r=i?sn.replace({widget:new cc(i(e.state,n.value))}):lc;t=t.update({add:[r.range(n.value.from,n.value.to)]})}else n.is(Fl)&&(t=t.update({filter:(t,e)=>n.value.from!=t||n.value.to!=e,filterFrom:n.value.from,filterTo:n.value.to}));if(e.selection){let n=!1,{head:i}=e.selection.main;t.between(i,i,((t,e)=>{ti&&(n=!0)})),n&&(t=t.update({filterFrom:i,filterTo:i,filter:(t,e)=>e<=i||t>=i}))}return t},provide:t=>no.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,((t,e)=>{n.push(t,e)})),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n{(!r||r.from>t)&&(r={from:t,to:e})})),r}function tc(t,e,n){let i=!1;return t.between(e,e,((t,r)=>{t==e&&r==n&&(i=!0)})),i}function ec(t,e){return t.field(Kl,!1)?e:e.concat(pt.appendConfig.of(sc()))}function nc(t,e,n=!0){let i=t.state.doc.lineAt(e.from).number,r=t.state.doc.lineAt(e.to).number;return no.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${i} ${t.state.phrase("to")} ${r}.`)}const ic=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:t=>{for(let e of Hl(t)){let n=Yl(t.state,e.from,e.to);if(n)return t.dispatch({effects:ec(t.state,[Gl.of(n),nc(t,n)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:t=>{if(!t.state.field(Kl,!1))return!1;let e=[];for(let n of Hl(t)){let i=Jl(t.state,n.from,n.to);i&&e.push(Fl.of(i),nc(t,i,!1))}return e.length&&t.dispatch({effects:e}),e.length>0}},{key:"Ctrl-Alt-[",run:t=>{let{state:e}=t,n=[];for(let i=0;i{let e=t.state.field(Kl,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,((t,e)=>{n.push(Fl.of({from:t,to:e}))})),t.dispatch({effects:n}),!0}}],rc={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},oc=L.define({combine:t=>_t(t,rc)});function sc(t){let e=[Kl,dc];return t&&e.push(oc.of(t)),e}function ac(t,e){let{state:n}=t,i=n.facet(oc),r=e=>{let n=t.lineBlockAt(t.posAtDOM(e.target)),i=Jl(t.state,n.from,n.to);i&&t.dispatch({effects:Fl.of(i)}),e.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(t,r,e);let o=document.createElement("span");return o.textContent=i.placeholderText,o.setAttribute("aria-label",n.phrase("folded code")),o.title=n.phrase("unfold"),o.className="cm-foldPlaceholder",o.onclick=r,o}const lc=sn.replace({widget:new class extends rn{toDOM(t){return ac(t,null)}}});class cc extends rn{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return ac(t,this.value)}}const uc={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class hc extends bs{constructor(t,e){super(),this.config=t,this.open=e}eq(t){return this.config==t.config&&this.open==t.open}toDOM(t){if(this.config.markerDOM)return this.config.markerDOM(this.open);let e=document.createElement("span");return e.textContent=this.open?this.config.openText:this.config.closedText,e.title=t.state.phrase(this.open?"Fold line":"Unfold line"),e}}const dc=no.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Oc{constructor(t,e){let n;function i(t){let e=Gt.newName();return(n||(n=Object.create(null)))["."+e]=t,e}this.specs=t;const r="string"==typeof e.all?e.all:e.all?i(e.all):void 0,o=e.scope;this.scope=o instanceof Ol?t=>t.prop(ul)==o.data:o?t=>t==o:void 0,this.style=Na(t.map((t=>({tag:t.tag,class:t.class||i(Object.assign({},t,{tag:null}))}))),{all:r}).style,this.module=n?new Gt(n):null,this.themeType=e.themeType}static define(t,e){return new Oc(t,e||{})}}const fc=L.define(),pc=L.define({combine:t=>t.length?[t[0]]:null});function mc(t){let e=t.facet(fc);return e.length?e:t.facet(pc)}function gc(t,e){let n,i=[$c];return t instanceof Oc&&(t.module&&i.push(no.styleModule.of(t.module)),n=t.themeType),(null==e?void 0:e.fallback)?i.push(pc.of(t)):n?i.push(fc.computeN([no.darkTheme],(e=>e.facet(no.darkTheme)==("dark"==n)?[t]:[]))):i.push(fc.of(t)),i}class yc{constructor(t){this.markCache=Object.create(null),this.tree=ml(t.state),this.decorations=this.buildDeco(t,mc(t.state)),this.decoratedTo=t.viewport.to}update(t){let e=ml(t.state),n=mc(t.state),i=n!=mc(t.startState),{viewport:r}=t.view,o=t.changes.mapPos(this.decoratedTo,1);e.length=r.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=o):(e!=this.tree||t.viewportChanged||i)&&(this.tree=e,this.decorations=this.buildDeco(t.view,n),this.decoratedTo=r.to)}buildDeco(t,e){if(!e||!this.tree.length)return sn.none;let n=new Et;for(let{from:i,to:r}of t.visibleRanges)Ua(this.tree,e,((t,e,i)=>{n.add(t,e,this.markCache[i]||(this.markCache[i]=sn.mark({class:i})))}),i,r);return n.finish()}}const $c=K.high(ii.fromClass(yc,{decorations:t=>t.decorations})),vc=Oc.define([{tag:ll.meta,color:"#404740"},{tag:ll.link,textDecoration:"underline"},{tag:ll.heading,textDecoration:"underline",fontWeight:"bold"},{tag:ll.emphasis,fontStyle:"italic"},{tag:ll.strong,fontWeight:"bold"},{tag:ll.strikethrough,textDecoration:"line-through"},{tag:ll.keyword,color:"#708"},{tag:[ll.atom,ll.bool,ll.url,ll.contentSeparator,ll.labelName],color:"#219"},{tag:[ll.literal,ll.inserted],color:"#164"},{tag:[ll.string,ll.deleted],color:"#a11"},{tag:[ll.regexp,ll.escape,ll.special(ll.string)],color:"#e40"},{tag:ll.definition(ll.variableName),color:"#00f"},{tag:ll.local(ll.variableName),color:"#30a"},{tag:[ll.typeName,ll.namespace],color:"#085"},{tag:ll.className,color:"#167"},{tag:[ll.special(ll.variableName),ll.macroName],color:"#256"},{tag:ll.definition(ll.propertyName),color:"#00c"},{tag:ll.comment,color:"#940"},{tag:ll.invalid,color:"#f00"}]),bc=no.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Sc="()[]{}",wc=L.define({combine:t=>_t(t,{afterCursor:!0,brackets:Sc,maxScanDistance:1e4,renderMatch:Pc})}),xc=sn.mark({class:"cm-matchingBracket"}),Qc=sn.mark({class:"cm-nonmatchingBracket"});function Pc(t){let e=[],n=t.matched?xc:Qc;return e.push(n.range(t.start.from,t.start.to)),t.end&&e.push(n.range(t.end.from,t.end.to)),e}const _c=F.define({create:()=>sn.none,update(t,e){if(!e.docChanged&&!e.selection)return t;let n=[],i=e.state.facet(wc);for(let t of e.state.selection.ranges){if(!t.empty)continue;let r=Rc(e.state,t.head,-1,i)||t.head>0&&Rc(e.state,t.head-1,1,i)||i.afterCursor&&(Rc(e.state,t.head,1,i)||t.headno.decorations.from(t)}),kc=[_c,bc],Tc=new Ys;function Cc(t,e,n){let i=t.prop(e<0?Ys.openedBy:Ys.closedBy);if(i)return i;if(1==t.name.length){let i=n.indexOf(t.name);if(i>-1&&i%2==(e<0?1:0))return[n[i+e]]}return null}function zc(t){let e=t.type.prop(Tc);return e?e(t.node):t}function Rc(t,e,n,i={}){let r=i.maxScanDistance||1e4,o=i.brackets||Sc,s=ml(t),a=s.resolveInner(e,n);for(let t=a;t;t=t.parent){let i=Cc(t.type,n,o);if(i&&t.from0?e>=r.from&&er.from&&e<=r.to))return Ec(0,0,n,t,r,i,o)}}return function(t,e,n,i,r,o,s){let a=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),l=s.indexOf(a);if(l<0||l%2==0!=n>0)return null;let c={from:n<0?e-1:e,to:n>0?e+1:e},u=t.doc.iterRange(e,n>0?t.doc.length:0),h=0;for(let t=0;!u.next().done&&t<=o;){let o=u.value;n<0&&(t+=o.length);let a=e+t*n;for(let t=n>0?0:o.length-1,e=n>0?o.length:-1;t!=e;t+=n){let e=s.indexOf(o[t]);if(!(e<0||i.resolveInner(a+t,1).type!=r))if(e%2==0==n>0)h++;else{if(1==h)return{start:c,end:{from:a+t,to:a+t+1},matched:e>>1==l>>1};h--}}n>0&&(t+=o.length)}return u.done?{start:c,matched:!1}:null}(t,e,n,s,a.type,r,o)}function Ec(t,e,n,i,r,o,s){let a=i.parent,l={from:r.from,to:r.to},c=0,u=null==a?void 0:a.cursor();if(u&&(n<0?u.childBefore(i.from):u.childAfter(i.to)))do{if(n<0?u.to<=i.from:u.from>=i.to){if(0==c&&o.indexOf(u.type.name)>-1&&u.from-1||(Mc.push(t),console.warn(e))}function Wc(t,e){let n=[];for(let i of e.split(" ")){let e=[];for(let n of i.split(".")){let i=t[n]||ll[n];i?"function"==typeof i?e.length?e=e.map(i):qc(n,`Modifier ${n} used at start of tag`):e.length?qc(n,`Tag ${n} used as modifier`):e=Array.isArray(i)?i:[i]:qc(n,`Unknown highlighting tag ${n}`)}for(let t of e)n.push(t)}if(!n.length)return 0;let i=e.replace(/ /g,"_"),r=i+" "+n.map((t=>t.id)),o=Vc[r];if(o)return o.id;let s=Vc[r]=Fs.define({id:Zc.length,name:i,props:[ja({[i]:n})]});return Zc.push(s),s.id}function jc(t,e){return({state:n,dispatch:i})=>{if(n.readOnly)return!1;let r=t(e,n);return!!r&&(i(n.update(r)),!0)}}yn.RTL,yn.LTR;const Ic=jc(Bc,0),Lc=jc(Yc,0),Nc=jc(((t,e)=>Yc(t,e,function(t){let e=[];for(let n of t.selection.ranges){let i=t.doc.lineAt(n.from),r=n.to<=i.to?i:t.doc.lineAt(n.to);r.from>i.from&&r.from==n.to&&(r=n.to==i.to+1?i:t.doc.lineAt(n.to-1));let o=e.length-1;o>=0&&e[o].to>i.from?e[o].to=r.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:r.to})}return e}(e))),0);function Uc(t,e){let n=t.languageDataAt("commentTokens",e);return n.length?n[0]:{}}const Dc=50;function Yc(t,e,n=e.selection.ranges){let i=n.map((t=>Uc(e,t.from).block));if(!i.every((t=>t)))return null;let r=n.map(((t,n)=>function(t,{open:e,close:n},i,r){let o,s,a=t.sliceDoc(i-Dc,i),l=t.sliceDoc(r,r+Dc),c=/\s*$/.exec(a)[0].length,u=/^\s*/.exec(l)[0].length,h=a.length-c;if(a.slice(h-e.length,h)==e&&l.slice(u,u+n.length)==n)return{open:{pos:i-c,margin:c&&1},close:{pos:r+u,margin:u&&1}};r-i<=2*Dc?o=s=t.sliceDoc(i,r):(o=t.sliceDoc(i,i+Dc),s=t.sliceDoc(r-Dc,r));let d=/^\s*/.exec(o)[0].length,O=/\s*$/.exec(s)[0].length,f=s.length-O-n.length;return o.slice(d,d+e.length)==e&&s.slice(f,f+n.length)==n?{open:{pos:i+d+e.length,margin:/\s/.test(o.charAt(d+e.length))?1:0},close:{pos:r-O-n.length,margin:/\s/.test(s.charAt(f-1))?1:0}}:null}(e,i[n],t.from,t.to)));if(2!=t&&!r.every((t=>t)))return{changes:e.changes(n.map(((t,e)=>r[e]?[]:[{from:t.from,insert:i[e].open+" "},{from:t.to,insert:" "+i[e].close}])))};if(1!=t&&r.some((t=>t))){let t=[];for(let e,n=0;nr&&(t==o||o>l.from)){r=l.from;let t=/^\s*/.exec(l.text)[0].length,e=t==l.length,n=l.text.slice(t,t+a.length)==a?t:-1;tt.comment<0&&(!t.empty||t.single)))){let t=[];for(let{line:e,token:n,indent:r,empty:o,single:s}of i)!s&&o||t.push({from:e.from+r,insert:n+" "});let n=e.changes(t);return{changes:n,selection:e.selection.map(n,1)}}if(1!=t&&i.some((t=>t.comment>=0))){let t=[];for(let{line:e,comment:n,token:r}of i)if(n>=0){let i=e.from+n,o=i+r.length;" "==e.text[o-e.from]&&o++,t.push({from:i,to:o})}return{changes:t}}return null}const Gc=dt.define(),Fc=dt.define(),Hc=L.define(),Kc=L.define({combine:t=>_t(t,{minDepth:100,newGroupDelay:500,joinToEvent:(t,e)=>e},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,e)=>(n,i)=>t(n,i)||e(n,i)})}),Jc=F.define({create:()=>pu.empty,update(t,e){let n=e.state.facet(Kc),i=e.annotation(Gc);if(i){let r=ou.fromTransaction(e,i.selection),o=i.side,s=0==o?t.undone:t.done;return s=r?su(s,s.length,n.minDepth,r):uu(s,e.startState.selection),new pu(0==o?i.rest:s,0==o?s:i.rest)}let r=e.annotation(Fc);if("full"!=r&&"before"!=r||(t=t.isolate()),!1===e.annotation(mt.addToHistory))return e.changes.empty?t:t.addMapping(e.changes.desc);let o=ou.fromTransaction(e),s=e.annotation(mt.time),a=e.annotation(mt.userEvent);return o?t=t.addChanges(o,s,a,n,e):e.selection&&(t=t.addSelection(e.startState.selection,s,a,n.newGroupDelay)),"full"!=r&&"after"!=r||(t=t.isolate()),t},toJSON:t=>({done:t.done.map((t=>t.toJSON())),undone:t.undone.map((t=>t.toJSON()))}),fromJSON:t=>new pu(t.done.map(ou.fromJSON),t.undone.map(ou.fromJSON))});function tu(t,e){return function({state:n,dispatch:i}){if(!e&&n.readOnly)return!1;let r=n.field(Jc,!1);if(!r)return!1;let o=r.pop(t,n,e);return!!o&&(i(o),!0)}}const eu=tu(0,!1),nu=tu(1,!1),iu=tu(0,!0),ru=tu(1,!0);class ou{constructor(t,e,n,i,r){this.changes=t,this.effects=e,this.mapped=n,this.startSelection=i,this.selectionsAfter=r}setSelAfter(t){return new ou(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,e,n;return{changes:null===(t=this.changes)||void 0===t?void 0:t.toJSON(),mapped:null===(e=this.mapped)||void 0===e?void 0:e.toJSON(),startSelection:null===(n=this.startSelection)||void 0===n?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map((t=>t.toJSON()))}}static fromJSON(t){return new ou(t.changes&&R.fromJSON(t.changes),[],t.mapped&&z.fromJSON(t.mapped),t.startSelection&&W.fromJSON(t.startSelection),t.selectionsAfter.map(W.fromJSON))}static fromTransaction(t,e){let n=lu;for(let e of t.startState.facet(Hc)){let i=e(t);i.length&&(n=n.concat(i))}return!n.length&&t.changes.empty?null:new ou(t.changes.invert(t.startState.doc),n,void 0,e||t.startState.selection,lu)}static selection(t){return new ou(void 0,lu,void 0,void 0,t)}}function su(t,e,n,i){let r=e+1>n+20?e-n-1:0,o=t.slice(r,e);return o.push(i),o}function au(t,e){return t.length?e.length?t.concat(e):t:e}const lu=[],cu=200;function uu(t,e){if(t.length){let n=t[t.length-1],i=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-cu));return i.length&&i[i.length-1].eq(e)?t:(i.push(e),su(t,t.length-1,1e9,n.setSelAfter(i)))}return[ou.selection([e])]}function hu(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function du(t,e){if(!t.length)return t;let n=t.length,i=lu;for(;n;){let r=Ou(t[n-1],e,i);if(r.changes&&!r.changes.empty||r.effects.length){let e=t.slice(0,n);return e[n-1]=r,e}e=r.mapped,n--,i=r.selectionsAfter}return i.length?[ou.selection(i)]:lu}function Ou(t,e,n){let i=au(t.selectionsAfter.length?t.selectionsAfter.map((t=>t.map(e))):lu,n);if(!t.changes)return ou.selection(i);let r=t.changes.map(e),o=e.mapDesc(t.changes,!0),s=t.mapped?t.mapped.composeDesc(o):o;return new ou(r,pt.mapEffects(t.effects,e),s,t.startSelection.map(o),i)}const fu=/^(input\.type|delete)($|\.)/;class pu{constructor(t,e,n=0,i=void 0){this.done=t,this.undone=e,this.prevTime=n,this.prevUserEvent=i}isolate(){return this.prevTime?new pu(this.done,this.undone):this}addChanges(t,e,n,i,r){let o=this.done,s=o[o.length-1];return o=s&&s.changes&&!s.changes.empty&&t.changes&&(!n||fu.test(n))&&(!s.selectionsAfter.length&&e-this.prevTimen.push(t,e))),e.iterChangedRanges(((t,e,r,o)=>{for(let t=0;t=e&&r<=s&&(i=!0)}})),i}(s.changes,t.changes))||"input.type.compose"==n)?su(o,o.length-1,i.minDepth,new ou(t.changes.compose(s.changes),au(pt.mapEffects(t.effects,s.changes),s.effects),s.mapped,s.startSelection,lu)):su(o,o.length,i.minDepth,t),new pu(o,lu,e,n)}addSelection(t,e,n,i){let r=this.done.length?this.done[this.done.length-1].selectionsAfter:lu;return r.length>0&&e-this.prevTimet.empty!=s.ranges[e].empty)).length)?this:new pu(uu(this.done,t),this.undone,e,n);var o,s}addMapping(t){return new pu(du(this.done,t),du(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,e,n){let i=0==t?this.done:this.undone;if(0==i.length)return null;let r=i[i.length-1],o=r.selectionsAfter[0]||e.selection;if(n&&r.selectionsAfter.length)return e.update({selection:r.selectionsAfter[r.selectionsAfter.length-1],annotations:Gc.of({side:t,rest:hu(i),selection:o}),userEvent:0==t?"select.undo":"select.redo",scrollIntoView:!0});if(r.changes){let n=1==i.length?lu:i.slice(0,i.length-1);return r.mapped&&(n=du(n,r.mapped)),e.update({changes:r.changes,selection:r.startSelection,effects:r.effects,annotations:Gc.of({side:t,rest:n,selection:o}),filter:!1,userEvent:0==t?"undo":"redo",scrollIntoView:!0})}return null}}pu.empty=new pu(lu,lu);const mu=[{key:"Mod-z",run:eu,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:nu,preventDefault:!0},{linux:"Ctrl-Shift-z",run:nu,preventDefault:!0},{key:"Mod-u",run:iu,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:ru,preventDefault:!0}];function gu(t,e){return W.create(t.ranges.map(e),t.mainIndex)}function yu(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function $u({state:t,dispatch:e},n){let i=gu(t.selection,n);return!i.eq(t.selection,!0)&&(e(yu(t,i)),!0)}function vu(t,e){return W.cursor(e?t.to:t.from)}function bu(t,e){return $u(t,(n=>n.empty?t.moveByChar(n,e):vu(n,e)))}function Su(t){return t.textDirectionAt(t.state.selection.main.head)==yn.LTR}const wu=t=>bu(t,!Su(t)),xu=t=>bu(t,Su(t));function Qu(t,e){return $u(t,(n=>n.empty?t.moveByGroup(n,e):vu(n,e)))}function Pu(t,e,n){if(e.type.prop(n))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function _u(t,e,n){let i,r,o=ml(t).resolveInner(e.head),s=n?Ys.closedBy:Ys.openedBy;for(let i=e.head;;){let e=n?o.childAfter(i):o.childBefore(i);if(!e)break;Pu(t,e,s)?o=e:i=n?e.to:e.from}return r=o.type.prop(s)&&(i=n?Rc(t,o.from,1):Rc(t,o.to,-1))&&i.matched?n?i.end.to:i.end.from:n?o.to:o.from,W.cursor(r,n?-1:1)}function ku(t,e){return $u(t,(n=>{if(!n.empty)return vu(n,e);let i=t.moveVertically(n,e);return i.head!=n.head?i:t.moveToLineBoundary(n,e)}))}"undefined"!=typeof Intl&&Intl.Segmenter;const Tu=t=>ku(t,!1),Cu=t=>ku(t,!0);function zu(t){let e,n=t.scrollDOM.clientHeightn.empty?t.moveVertically(n,e,i.height):vu(n,e)));if(o.eq(r.selection))return!1;if(i.selfScroll){let e=t.coordsAtPos(r.selection.main.head),s=t.scrollDOM.getBoundingClientRect(),a=s.top+i.marginTop,l=s.bottom-i.marginBottom;e&&e.top>a&&e.bottomRu(t,!1),Au=t=>Ru(t,!0);function Zu(t,e,n){let i=t.lineBlockAt(e.head),r=t.moveToLineBoundary(e,n);if(r.head==e.head&&r.head!=(n?i.to:i.from)&&(r=t.moveToLineBoundary(e,n,!1)),!n&&r.head==i.from&&i.length){let n=/^\s*/.exec(t.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;n&&e.head!=i.from+n&&(r=W.cursor(i.from+n))}return r}function Mu(t,e){let n=gu(t.state.selection,(t=>{let n=e(t);return W.range(t.anchor,n.head,n.goalColumn,n.bidiLevel||void 0)}));return!n.eq(t.state.selection)&&(t.dispatch(yu(t.state,n)),!0)}function Vu(t,e){return Mu(t,(n=>t.moveByChar(n,e)))}const Xu=t=>Vu(t,!Su(t)),qu=t=>Vu(t,Su(t));function Wu(t,e){return Mu(t,(n=>t.moveByGroup(n,e)))}function ju(t,e){return Mu(t,(n=>t.moveVertically(n,e)))}const Iu=t=>ju(t,!1),Lu=t=>ju(t,!0);function Nu(t,e){return Mu(t,(n=>t.moveVertically(n,e,zu(t).height)))}const Uu=t=>Nu(t,!1),Du=t=>Nu(t,!0),Yu=({state:t,dispatch:e})=>(e(yu(t,{anchor:0})),!0),Bu=({state:t,dispatch:e})=>(e(yu(t,{anchor:t.doc.length})),!0),Gu=({state:t,dispatch:e})=>(e(yu(t,{anchor:t.selection.main.anchor,head:0})),!0),Fu=({state:t,dispatch:e})=>(e(yu(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0);function Hu(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:i}=t,r=i.changeByRange((i=>{let{from:r,to:o}=i;if(r==o){let s=e(i);sr&&(n="delete.forward",s=Ku(t,s,!0)),r=Math.min(r,s),o=Math.max(o,s)}else r=Ku(t,r,!1),o=Ku(t,o,!0);return r==o?{range:i}:{changes:{from:r,to:o},range:W.cursor(r,re(t))))i.between(e,e,((t,i)=>{te&&(e=n?i:t)}));return e}const Ju=(t,e,n)=>Hu(t,(i=>{let r,o,s=i.from,{state:a}=t,l=a.doc.lineAt(s);if(n&&!e&&s>l.from&&sJu(t,!1,!0),eh=t=>Ju(t,!0,!1),nh=(t,e)=>Hu(t,(n=>{let i=n.head,{state:r}=t,o=r.doc.lineAt(i),s=r.charCategorizer(i);for(let t=null;;){if(i==(e?o.to:o.from)){i==n.head&&o.number!=(e?r.doc.lines:1)&&(i+=e?1:-1);break}let a=b(o.text,i-o.from,e)+o.from,l=o.text.slice(Math.min(i,a)-o.from,Math.max(i,a)-o.from),c=s(l);if(null!=t&&c!=t)break;" "==l&&i==n.head||(t=c),i=a}return i})),ih=t=>nh(t,!1);function rh(t){let e=[],n=-1;for(let i of t.selection.ranges){let r=t.doc.lineAt(i.from),o=t.doc.lineAt(i.to);if(i.empty||i.to!=o.from||(o=t.doc.lineAt(i.to-1)),n>=r.number){let t=e[e.length-1];t.to=o.to,t.ranges.push(i)}else e.push({from:r.from,to:o.to,ranges:[i]});n=o.number+1}return e}function oh(t,e,n){if(t.readOnly)return!1;let i=[],r=[];for(let e of rh(t)){if(n?e.to==t.doc.length:0==e.from)continue;let o=t.doc.lineAt(n?e.to+1:e.from-1),s=o.length+1;if(n){i.push({from:e.to,to:o.to},{from:e.from,insert:o.text+t.lineBreak});for(let n of e.ranges)r.push(W.range(Math.min(t.doc.length,n.anchor+s),Math.min(t.doc.length,n.head+s)))}else{i.push({from:o.from,to:e.from},{from:e.to,insert:t.lineBreak+o.text});for(let t of e.ranges)r.push(W.range(t.anchor-s,t.head-s))}}return!!i.length&&(e(t.update({changes:i,scrollIntoView:!0,selection:W.create(r,t.selection.mainIndex),userEvent:"move.line"})),!0)}function sh(t,e,n){if(t.readOnly)return!1;let i=[];for(let e of rh(t))n?i.push({from:e.from,insert:t.doc.slice(e.from,e.to)+t.lineBreak}):i.push({from:e.to,insert:t.lineBreak+t.doc.slice(e.from,e.to)});return e(t.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const ah=lh(!1);function lh(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let i=e.changeByRange((n=>{let{from:i,to:r}=n,o=e.doc.lineAt(i),s=!t&&i==r&&function(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n,i=ml(t).resolveInner(e),r=i.childBefore(e),o=i.childAfter(e);return r&&o&&r.to<=e&&o.from>=e&&(n=r.type.prop(Ys.closedBy))&&n.indexOf(o.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(o.from).from&&!/\S/.test(t.sliceDoc(r.to,o.from))?{from:r.to,to:o.from}:null}(e,i);t&&(i=r=(r<=o.to?o:e.doc.lineAt(r)).to);let a=new El(e,{simulateBreak:i,simulateDoubleBreak:!!s}),c=Rl(a,i);for(null==c&&(c=Nt(/^\s*/.exec(e.doc.lineAt(i).text)[0],e.tabSize));ro.from&&i{let r=[];for(let o=i.from;o<=i.to;){let s=t.doc.lineAt(o);s.number>n&&(i.empty||i.to>s.from)&&(e(s,r,i),n=s.number),o=s.to+1}let o=t.changes(r);return{changes:r,range:W.range(o.mapPos(i.anchor,1),o.mapPos(i.head,1))}}))}const uh=({state:t,dispatch:e})=>!t.readOnly&&(e(t.update(ch(t,((e,n)=>{n.push({from:e.from,insert:t.facet(Tl)})})),{userEvent:"input.indent"})),!0),hh=({state:t,dispatch:e})=>!t.readOnly&&(e(t.update(ch(t,((e,n)=>{let i=/^\s*/.exec(e.text)[0];if(!i)return;let r=Nt(i,t.tabSize),o=0,s=zl(t,Math.max(0,r-Cl(t)));for(;o$u(t,(e=>W.cursor(t.lineBlockAt(e.head).from,1))),shift:t=>Mu(t,(e=>W.cursor(t.lineBlockAt(e.head).from)))},{key:"Ctrl-e",run:t=>$u(t,(e=>W.cursor(t.lineBlockAt(e.head).to,-1))),shift:t=>Mu(t,(e=>W.cursor(t.lineBlockAt(e.head).to)))},{key:"Ctrl-d",run:eh},{key:"Ctrl-h",run:th},{key:"Ctrl-k",run:t=>Hu(t,(e=>{let n=t.lineBlockAt(e.head).to;return e.head{if(t.readOnly)return!1;let n=t.changeByRange((t=>({changes:{from:t.from,to:t.to,insert:l.of(["",""])},range:W.cursor(t.from)})));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange((e=>{if(!e.empty||0==e.from||e.from==t.doc.length)return{range:e};let n=e.from,i=t.doc.lineAt(n),r=n==i.from?n-1:b(i.text,n-i.from,!1)+i.from,o=n==i.to?n+1:b(i.text,n-i.from,!0)+i.from;return{changes:{from:r,to:o,insert:t.doc.slice(n,o).append(t.doc.slice(r,n))},range:W.cursor(o)}}));return!n.changes.empty&&(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:Au}],Oh=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:t=>$u(t,(e=>_u(t.state,e,!Su(t)))),shift:t=>Mu(t,(e=>_u(t.state,e,!Su(t))))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:t=>$u(t,(e=>_u(t.state,e,Su(t)))),shift:t=>Mu(t,(e=>_u(t.state,e,Su(t))))},{key:"Alt-ArrowUp",run:({state:t,dispatch:e})=>oh(t,e,!1)},{key:"Shift-Alt-ArrowUp",run:({state:t,dispatch:e})=>sh(t,e,!1)},{key:"Alt-ArrowDown",run:({state:t,dispatch:e})=>oh(t,e,!0)},{key:"Shift-Alt-ArrowDown",run:({state:t,dispatch:e})=>sh(t,e,!0)},{key:"Escape",run:({state:t,dispatch:e})=>{let n=t.selection,i=null;return n.ranges.length>1?i=W.create([n.main]):n.main.empty||(i=W.create([W.cursor(n.main.head)])),!!i&&(e(yu(t,i)),!0)}},{key:"Mod-Enter",run:lh(!0)},{key:"Alt-l",mac:"Ctrl-l",run:({state:t,dispatch:e})=>{let n=rh(t).map((({from:e,to:n})=>W.range(e,Math.min(n+1,t.doc.length))));return e(t.update({selection:W.create(n),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:t,dispatch:e})=>{let n=gu(t.selection,(e=>{let n=ml(t),i=n.resolveStack(e.from,1);if(e.empty){let t=n.resolveStack(e.from,-1);t.node.from>=i.node.from&&t.node.to<=i.node.to&&(i=t)}for(let t=i;t;t=t.next){let{node:n}=t;if((n.from=e.to||n.to>e.to&&n.from<=e.from)&&t.next)return W.range(n.to,n.from)}return e}));return!n.eq(t.selection)&&(e(yu(t,n)),!0)},preventDefault:!0},{key:"Mod-[",run:hh},{key:"Mod-]",run:uh},{key:"Mod-Alt-\\",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),i=new El(t,{overrideIndentation:t=>{let e=n[t];return null==e?-1:e}}),r=ch(t,((e,r,o)=>{let s=Rl(i,e.from);if(null==s)return;/\S/.test(e.text)||(s=0);let a=/^\s*/.exec(e.text)[0],l=zl(t,s);(a!=l||o.from{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(rh(e).map((({from:t,to:n})=>(t>0?t--:n{let n;if(t.lineWrapping){let i=t.lineBlockAt(e.head),r=t.coordsAtPos(e.head,e.assoc||1);r&&(n=i.bottom+t.documentTop-r.bottom+t.defaultLineHeight/2)}return t.moveVertically(e,!0,n)})).map(n);return t.dispatch({changes:n,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:t,dispatch:e})=>function(t,e,n){let i=!1,r=gu(t.selection,(e=>{let r=Rc(t,e.head,-1)||Rc(t,e.head,1)||e.head>0&&Rc(t,e.head-1,1)||e.head{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),i=Uc(t.state,n.from);return i.line?Ic(t):!!i.block&&Nc(t)}},{key:"Alt-A",run:Lc},{key:"Ctrl-m",mac:"Shift-Alt-m",run:t=>(t.setTabFocusMode(),!0)}].concat([{key:"ArrowLeft",run:wu,shift:Xu,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:t=>Qu(t,!Su(t)),shift:t=>Wu(t,!Su(t)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:t=>$u(t,(e=>Zu(t,e,!Su(t)))),shift:t=>Mu(t,(e=>Zu(t,e,!Su(t)))),preventDefault:!0},{key:"ArrowRight",run:xu,shift:qu,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:t=>Qu(t,Su(t)),shift:t=>Wu(t,Su(t)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:t=>$u(t,(e=>Zu(t,e,Su(t)))),shift:t=>Mu(t,(e=>Zu(t,e,Su(t)))),preventDefault:!0},{key:"ArrowUp",run:Tu,shift:Iu,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Yu,shift:Gu},{mac:"Ctrl-ArrowUp",run:Eu,shift:Uu},{key:"ArrowDown",run:Cu,shift:Lu,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Bu,shift:Fu},{mac:"Ctrl-ArrowDown",run:Au,shift:Du},{key:"PageUp",run:Eu,shift:Uu},{key:"PageDown",run:Au,shift:Du},{key:"Home",run:t=>$u(t,(e=>Zu(t,e,!1))),shift:t=>Mu(t,(e=>Zu(t,e,!1))),preventDefault:!0},{key:"Mod-Home",run:Yu,shift:Gu},{key:"End",run:t=>$u(t,(e=>Zu(t,e,!0))),shift:t=>Mu(t,(e=>Zu(t,e,!0))),preventDefault:!0},{key:"Mod-End",run:Bu,shift:Fu},{key:"Enter",run:ah,shift:ah},{key:"Mod-a",run:({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:th,shift:th},{key:"Delete",run:eh},{key:"Mod-Backspace",mac:"Alt-Backspace",run:ih},{key:"Mod-Delete",mac:"Alt-Delete",run:t=>nh(t,!0)},{mac:"Mod-Backspace",run:t=>Hu(t,(e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}))},{mac:"Mod-Delete",run:t=>Hu(t,(e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head({mac:t.key,run:t.run,shift:t.shift}))))),fh={key:"Tab",run:uh,shift:hh};function ph(){var t=arguments[0];"string"==typeof t&&(t=document.createElement(t));var e=1,n=arguments[1];if(n&&"object"==typeof n&&null==n.nodeType&&!Array.isArray(n)){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var r=n[i];"string"==typeof r?t.setAttribute(i,r):null!=r&&(t[i]=r)}e++}for(;et.normalize("NFKD"):t=>t;class yh{constructor(t,e,n=0,i=t.length,r,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(n,i),this.bufferStart=n,this.normalize=r?t=>r(gh(t)):gh,this.query=this.normalize(e)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return P(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let e=_(t),n=this.bufferStart+this.bufferPos;this.bufferPos+=k(t);let i=this.normalize(e);for(let t=0,r=n;;t++){let o=i.charCodeAt(t),s=this.match(o,r,this.bufferPos+this.bufferStart);if(t==i.length-1){if(s)return this.value=s,this;break}r==n&&tthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let e=this.matchPos<=this.to&&this.re.exec(this.curLine);if(e){let n=this.curLineStart+e.index,i=n+e[0].length;if(this.matchPos=Qh(this.text,i+(n==i?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(nthis.value.to)&&(!this.test||this.test(n,i,e)))return this.value={from:n,to:i,match:e},this;t=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length=n||i.to<=e){let i=new wh(e,t.sliceString(e,n));return Sh.set(t,i),i}if(i.from==e&&i.to==n)return i;let{text:r,from:o}=i;return o>e&&(r=t.sliceString(e,o)+r,o=e),i.to=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,e=this.re.exec(this.flat.text);if(e&&!e[0]&&e.index==t&&(this.re.lastIndex=t+1,e=this.re.exec(this.flat.text)),e){let t=this.flat.from+e.index,n=t+e[0].length;if((this.flat.to>=this.to||e.index+e[0].length<=this.flat.text.length-10)&&(!this.test||this.test(t,n,e)))return this.value={from:t,to:n,match:e},this.matchPos=Qh(this.text,n+(t==n?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=wh.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function Qh(t,e){if(e>=t.length)return e;let n,i=t.lineAt(e);for(;e=56320&&n<57344;)e++;return e}function Ph(t){let e=ph("input",{class:"cm-textfield",name:"line",value:String(t.state.doc.lineAt(t.state.selection.main.head).number)});function n(){let n=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(e.value);if(!n)return;let{state:i}=t,r=i.doc.lineAt(i.selection.main.head),[,o,s,a,l]=n,c=a?+a.slice(1):0,u=s?+s:r.number;if(s&&l){let t=u/100;o&&(t=t*("-"==o?-1:1)+r.number/i.doc.lines),u=Math.round(i.doc.lines*t)}else s&&o&&(u=u*("-"==o?-1:1)+r.number);let h=i.doc.line(Math.max(1,Math.min(i.doc.lines,u))),d=W.cursor(h.from+Math.max(0,Math.min(c,h.length)));t.dispatch({effects:[_h.of(!1),no.scrollIntoView(d.from,{y:"center"})],selection:d}),t.focus()}return{dom:ph("form",{class:"cm-gotoLine",onkeydown:e=>{27==e.keyCode?(e.preventDefault(),t.dispatch({effects:_h.of(!1)}),t.focus()):13==e.keyCode&&(e.preventDefault(),n())},onsubmit:t=>{t.preventDefault(),n()}},ph("label",t.state.phrase("Go to line"),": ",e)," ",ph("button",{class:"cm-button",type:"submit"},t.state.phrase("go")))}}"undefined"!=typeof Symbol&&(bh.prototype[Symbol.iterator]=xh.prototype[Symbol.iterator]=function(){return this});const _h=pt.define(),kh=F.define({create:()=>!0,update(t,e){for(let n of e.effects)n.is(_h)&&(t=n.value);return t},provide:t=>vs.from(t,(t=>t?Ph:null))}),Th=no.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),Ch={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},zh=L.define({combine:t=>_t(t,Ch,{highlightWordAroundCursor:(t,e)=>t||e,minSelectionLength:Math.min,maxMatches:Math.min})}),Rh=sn.mark({class:"cm-selectionMatch"}),Eh=sn.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Ah(t,e,n,i){return!(0!=n&&t(e.sliceDoc(n-1,n))==wt.Word||i!=e.doc.length&&t(e.sliceDoc(i,i+1))==wt.Word)}const Zh=ii.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(zh),{state:n}=t,i=n.selection;if(i.ranges.length>1)return sn.none;let r,o=i.main,s=null;if(o.empty){if(!e.highlightWordAroundCursor)return sn.none;let t=n.wordAt(o.head);if(!t)return sn.none;s=n.charCategorizer(o.head),r=n.sliceDoc(t.from,t.to)}else{let t=o.to-o.from;if(t200)return sn.none;if(e.wholeWords){if(r=n.sliceDoc(o.from,o.to),s=n.charCategorizer(o.head),!Ah(s,n,o.from,o.to)||!function(t,e,n,i){return t(e.sliceDoc(n,n+1))==wt.Word&&t(e.sliceDoc(i-1,i))==wt.Word}(s,n,o.from,o.to))return sn.none}else if(r=n.sliceDoc(o.from,o.to),!r)return sn.none}let a=[];for(let i of t.visibleRanges){let t=new yh(n.doc,r,i.from,i.to);for(;!t.next().done;){let{from:i,to:r}=t.value;if((!s||Ah(s,n,i,r))&&(o.empty&&i<=o.from&&r>=o.to?a.push(Eh.range(i,r)):(i>=o.to||r<=o.from)&&a.push(Rh.range(i,r)),a.length>e.maxMatches))return sn.none}}return sn.set(a)}},{decorations:t=>t.decorations}),Mh=no.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Vh=L.define({combine:t=>_t(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new dd(t),scrollToMatch:t=>no.scrollIntoView(t)})});class Xh{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||function(t){try{return new RegExp(t,vh),!0}catch(t){return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,((t,e)=>"n"==e?"\n":"r"==e?"\r":"t"==e?"\t":"\\"))}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord}create(){return this.regexp?new Uh(this):new jh(this)}getCursor(t,e=0,n){let i=t.doc?t:Pt.create({doc:t});return null==n&&(n=i.doc.length),this.regexp?Ih(this,i,e,n):Wh(this,i,e,n)}}class qh{constructor(t){this.spec=t}}function Wh(t,e,n,i){return new yh(e.doc,t.unquoted,n,i,t.caseSensitive?void 0:t=>t.toLowerCase(),t.wholeWord?function(t,e){return(n,i,r,o)=>((o>n||o+r.length=e)return null;i.push(n.value)}return i}highlight(t,e,n,i){let r=Wh(this.spec,t,Math.max(0,e-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,t.doc.length));for(;!r.next().done;)i(r.value.from,r.value.to)}}function Ih(t,e,n,i){return new bh(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:t.wholeWord?(r=e.charCategorizer(e.selection.main.head),(t,e,n)=>!n[0].length||(r(Lh(n.input,n.index))!=wt.Word||r(Nh(n.input,n.index))!=wt.Word)&&(r(Nh(n.input,n.index+n[0].length))!=wt.Word||r(Lh(n.input,n.index+n[0].length))!=wt.Word)):void 0},n,i);var r}function Lh(t,e){return t.slice(b(t,e,!1),e)}function Nh(t,e){return t.slice(e,b(t,e))}class Uh extends qh{nextMatch(t,e,n){let i=Ih(this.spec,t,n,t.doc.length).next();return i.done&&(i=Ih(this.spec,t,0,e).next()),i.done?null:i.value}prevMatchInRange(t,e,n){for(let i=1;;i++){let r=Math.max(e,n-1e4*i),o=Ih(this.spec,t,r,n),s=null;for(;!o.next().done;)s=o.value;if(s&&(r==e||s.from>r+10))return s;if(r==e)return null}}prevMatch(t,e,n){return this.prevMatchInRange(t,0,e)||this.prevMatchInRange(t,n,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,((e,n)=>"$"==n?"$":"&"==n?t.match[0]:"0"!=n&&+n=e)return null;i.push(n.value)}return i}highlight(t,e,n,i){let r=Ih(this.spec,t,Math.max(0,e-250),Math.min(n+250,t.doc.length));for(;!r.next().done;)i(r.value.from,r.value.to)}}const Dh=pt.define(),Yh=pt.define(),Bh=F.define({create:t=>new Gh(sd(t).create(),null),update(t,e){for(let n of e.effects)n.is(Dh)?t=new Gh(n.value.create(),t.panel):n.is(Yh)&&(t=new Gh(t.query,n.value?od:null));return t},provide:t=>vs.from(t,(t=>t.panel))});class Gh{constructor(t,e){this.query=t,this.panel=e}}const Fh=sn.mark({class:"cm-searchMatch"}),Hh=sn.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Kh=ii.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(Bh))}update(t){let e=t.state.field(Bh);(e!=t.startState.field(Bh)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return sn.none;let{view:n}=this,i=new Et;for(let e=0,r=n.visibleRanges,o=r.length;er[e+1].from-500;)a=r[++e].to;t.highlight(n.state,s,a,((t,e)=>{let r=n.state.selection.ranges.some((n=>n.from==t&&n.to==e));i.add(t,e,r?Hh:Fh)}))}return i.finish()}},{decorations:t=>t.decorations});function Jh(t){return e=>{let n=e.state.field(Bh,!1);return n&&n.query.spec.valid?t(e,n):cd(e)}}const td=Jh(((t,{query:e})=>{let{to:n}=t.state.selection.main,i=e.nextMatch(t.state,n,n);if(!i)return!1;let r=W.single(i.from,i.to),o=t.state.facet(Vh);return t.dispatch({selection:r,effects:[md(t,i),o.scrollToMatch(r.main,t)],userEvent:"select.search"}),ld(t),!0})),ed=Jh(((t,{query:e})=>{let{state:n}=t,{from:i}=n.selection.main,r=e.prevMatch(n,i,i);if(!r)return!1;let o=W.single(r.from,r.to),s=t.state.facet(Vh);return t.dispatch({selection:o,effects:[md(t,r),s.scrollToMatch(o.main,t)],userEvent:"select.search"}),ld(t),!0})),nd=Jh(((t,{query:e})=>{let n=e.matchAll(t.state,1e3);return!(!n||!n.length||(t.dispatch({selection:W.create(n.map((t=>W.range(t.from,t.to)))),userEvent:"select.search.matches"}),0))})),id=Jh(((t,{query:e})=>{let{state:n}=t,{from:i,to:r}=n.selection.main;if(n.readOnly)return!1;let o=e.nextMatch(n,i,i);if(!o)return!1;let s,a,l=[],c=[];if(o.from==i&&o.to==r&&(a=n.toText(e.getReplacement(o)),l.push({from:o.from,to:o.to,insert:a}),o=e.nextMatch(n,o.from,o.to),c.push(no.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(i).number)+"."))),o){let e=0==l.length||l[0].from>=o.to?0:o.to-o.from-a.length;s=W.single(o.from-e,o.to-e),c.push(md(t,o)),c.push(n.facet(Vh).scrollToMatch(s.main,t))}return t.dispatch({changes:l,selection:s,effects:c,userEvent:"input.replace"}),!0})),rd=Jh(((t,{query:e})=>{if(t.state.readOnly)return!1;let n=e.matchAll(t.state,1e9).map((t=>{let{from:n,to:i}=t;return{from:n,to:i,insert:e.getReplacement(t)}}));if(!n.length)return!1;let i=t.state.phrase("replaced $ matches",n.length)+".";return t.dispatch({changes:n,effects:no.announce.of(i),userEvent:"input.replace.all"}),!0}));function od(t){return t.state.facet(Vh).createPanel(t)}function sd(t,e){var n,i,r,o,s;let a=t.selection.main,l=a.empty||a.to>a.from+100?"":t.sliceDoc(a.from,a.to);if(e&&!l)return e;let c=t.facet(Vh);return new Xh({search:(null!==(n=null==e?void 0:e.literal)&&void 0!==n?n:c.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:null!==(i=null==e?void 0:e.caseSensitive)&&void 0!==i?i:c.caseSensitive,literal:null!==(r=null==e?void 0:e.literal)&&void 0!==r?r:c.literal,regexp:null!==(o=null==e?void 0:e.regexp)&&void 0!==o?o:c.regexp,wholeWord:null!==(s=null==e?void 0:e.wholeWord)&&void 0!==s?s:c.wholeWord})}function ad(t){let e=ms(t,od);return e&&e.dom.querySelector("[main-field]")}function ld(t){let e=ad(t);e&&e==t.root.activeElement&&e.select()}const cd=t=>{let e=t.state.field(Bh,!1);if(e&&e.panel){let n=ad(t);if(n&&n!=t.root.activeElement){let i=sd(t.state,e.query.spec);i.valid&&t.dispatch({effects:Dh.of(i)}),n.focus(),n.select()}}else t.dispatch({effects:[Yh.of(!0),e?Dh.of(sd(t.state,e.query.spec)):pt.appendConfig.of(yd)]});return!0},ud=t=>{let e=t.state.field(Bh,!1);if(!e||!e.panel)return!1;let n=ms(t,od);return n&&n.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:Yh.of(!1)}),!0},hd=[{key:"Mod-f",run:cd,scope:"editor search-panel"},{key:"F3",run:td,shift:ed,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:td,shift:ed,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:ud,scope:"editor search-panel"},{key:"Mod-Shift-l",run:({state:t,dispatch:e})=>{let n=t.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:i,to:r}=n.main,o=[],s=0;for(let e=new yh(t.doc,t.sliceDoc(i,r));!e.next().done;){if(o.length>1e3)return!1;e.value.from==i&&(s=o.length),o.push(W.range(e.value.from,e.value.to))}return e(t.update({selection:W.create(o,s),userEvent:"select.search.matches"})),!0}},{key:"Mod-Alt-g",run:t=>{let e=ms(t,Ph);if(!e){let n=[_h.of(!0)];null==t.state.field(kh,!1)&&n.push(pt.appendConfig.of([kh,Th])),t.dispatch({effects:n}),e=ms(t,Ph)}return e&&e.dom.querySelector("input").select(),!0}},{key:"Mod-d",run:({state:t,dispatch:e})=>{let{ranges:n}=t.selection;if(n.some((t=>t.from===t.to)))return(({state:t,dispatch:e})=>{let{selection:n}=t,i=W.create(n.ranges.map((e=>t.wordAt(e.head)||W.cursor(e.head))),n.mainIndex);return!i.eq(n)&&(e(t.update({selection:i})),!0)})({state:t,dispatch:e});let i=t.sliceDoc(n[0].from,n[0].to);if(t.selection.ranges.some((e=>t.sliceDoc(e.from,e.to)!=i)))return!1;let r=function(t,e){let{main:n,ranges:i}=t.selection,r=t.wordAt(n.head),o=r&&r.from==n.from&&r.to==n.to;for(let n=!1,r=new yh(t.doc,e,i[i.length-1].to);;){if(r.next(),!r.done){if(n&&i.some((t=>t.from==r.value.from)))continue;if(o){let e=t.wordAt(r.value.from);if(!e||e.from!=r.value.from||e.to!=r.value.to)continue}return r.value}if(n)return null;r=new yh(t.doc,e,0,Math.max(0,i[i.length-1].from-1)),n=!0}}(t,i);return!!r&&(e(t.update({selection:t.selection.addRange(W.range(r.from,r.to),!1),effects:no.scrollIntoView(r.to)})),!0)},preventDefault:!0}];class dd{constructor(t){this.view=t;let e=this.query=t.state.field(Bh).query.spec;function n(t,e,n){return ph("button",{class:"cm-button",name:t,onclick:e,type:"button"},n)}this.commit=this.commit.bind(this),this.searchField=ph("input",{value:e.search,placeholder:Od(t,"Find"),"aria-label":Od(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=ph("input",{value:e.replace,placeholder:Od(t,"Replace"),"aria-label":Od(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=ph("input",{type:"checkbox",name:"case",form:"",checked:e.caseSensitive,onchange:this.commit}),this.reField=ph("input",{type:"checkbox",name:"re",form:"",checked:e.regexp,onchange:this.commit}),this.wordField=ph("input",{type:"checkbox",name:"word",form:"",checked:e.wholeWord,onchange:this.commit}),this.dom=ph("div",{onkeydown:t=>this.keydown(t),class:"cm-search"},[this.searchField,n("next",(()=>td(t)),[Od(t,"next")]),n("prev",(()=>ed(t)),[Od(t,"previous")]),n("select",(()=>nd(t)),[Od(t,"all")]),ph("label",null,[this.caseField,Od(t,"match case")]),ph("label",null,[this.reField,Od(t,"regexp")]),ph("label",null,[this.wordField,Od(t,"by word")]),...t.state.readOnly?[]:[ph("br"),this.replaceField,n("replace",(()=>id(t)),[Od(t,"replace")]),n("replaceAll",(()=>rd(t)),[Od(t,"replace all")])],ph("button",{name:"close",onclick:()=>ud(t),"aria-label":Od(t,"close"),type:"button"},["×"])])}commit(){let t=new Xh({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:Dh.of(t)}))}keydown(t){var e,n;n=t,go(Oo((e=this.view).state),n,e,"search-panel")?t.preventDefault():13==t.keyCode&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?ed:td)(this.view)):13==t.keyCode&&t.target==this.replaceField&&(t.preventDefault(),id(this.view))}update(t){for(let e of t.transactions)for(let t of e.effects)t.is(Dh)&&!t.value.eq(this.query)&&this.setQuery(t.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Vh).top}}function Od(t,e){return t.state.phrase(e)}const fd=30,pd=/[\s\.,:;?!]/;function md(t,{from:e,to:n}){let i=t.state.doc.lineAt(e),r=t.state.doc.lineAt(n).to,o=Math.max(i.from,e-fd),s=Math.min(r,n+fd),a=t.state.sliceDoc(o,s);if(o!=i.from)for(let t=0;ta.length-fd;t--)if(!pd.test(a[t-1])&&pd.test(a[t])){a=a.slice(0,t);break}return no.announce.of(`${t.state.phrase("current match")}. ${a} ${t.state.phrase("on line")} ${i.number}.`)}const gd=no.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),yd=[Bh,K.low(Kh),gd];class $d{constructor(t,e,n,i){this.state=t,this.pos=e,this.explicit=n,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let e=ml(this.state).resolveInner(this.pos,-1);for(;e&&t.indexOf(e.name)<0;)e=e.parent;return e?{from:e.from,to:this.pos,text:this.state.sliceDoc(e.from,this.pos),type:e.type}:null}matchBefore(t){let e=this.state.doc.lineAt(this.pos),n=Math.max(e.from,this.pos-250),i=e.text.slice(n-e.from,this.pos-e.from),r=i.search(Qd(t,!1));return r<0?null:{from:n+r,to:this.pos,text:i.slice(r)}}get aborted(){return null==this.abortListeners}addEventListener(t,e,n){"abort"==t&&this.abortListeners&&(this.abortListeners.push(e),n&&n.onDocChange&&(this.abortOnDocChange=!0))}}function vd(t){let e=Object.keys(t).join(""),n=/\w/.test(e);return n&&(e=e.replace(/\w/g,"")),`[${n?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function bd(t){let e=t.map((t=>"string"==typeof t?{label:t}:t)),[n,i]=e.every((t=>/^\w+$/.test(t.label)))?[/\w*$/,/\w+$/]:function(t){let e=Object.create(null),n=Object.create(null);for(let{label:i}of t){e[i[0]]=!0;for(let t=1;t{let r=t.matchBefore(i);return r||t.explicit?{from:r?r.from:t.pos,options:e,validFor:n}:null}}function Sd(t,e){return n=>{for(let e=ml(n.state).resolveInner(n.pos,-1);e;e=e.parent){if(t.indexOf(e.name)>-1)return null;if(e.type.isTop)break}return e(n)}}class wd{constructor(t,e,n,i){this.completion=t,this.source=e,this.match=n,this.score=i}}function xd(t){return t.selection.main.from}function Qd(t,e){var n;let{source:i}=t,r=e&&"^"!=i[0],o="$"!=i[i.length-1];return r||o?new RegExp(`${r?"^":""}(?:${i})${o?"$":""}`,null!==(n=t.flags)&&void 0!==n?n:t.ignoreCase?"i":""):t}const Pd=dt.define(),_d=new WeakMap;function kd(t){if(!Array.isArray(t))return t;let e=_d.get(t);return e||_d.set(t,e=bd(t)),e}const Td=pt.define(),Cd=pt.define();class zd{constructor(t){this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let e=0;e=48&&l<=57||l>=97&&l<=122?2:l>=65&&l<=90?1:0:(y=_(l))!=y.toLowerCase()?1:y!=y.toUpperCase()?2:0;(!i||1==$&&p||0==g&&0!=$)&&(e[u]==l||n[u]==l&&(h=!0)?o[u++]=i:o.length&&(m=!1)),g=$,i+=k(l)}return u==a&&0==o[0]&&m?this.result((h?-200:0)-100,o,t):d==a&&0==O?this.ret(-200-t.length+(f==t.length?0:-100),[0,f]):s>-1?this.ret(-700-t.length,[s,s+this.pattern.length]):d==a?this.ret(-900-t.length,[O,f]):u==a?this.result((h?-200:0)-100-700+(m?0:-1100),o,t):2==e.length?null:this.result((i[0]?-700:0)-200-1100,i,t)}result(t,e,n){let i=[],r=0;for(let t of e){let e=t+(this.astral?k(P(n,t)):1);r&&i[r-1]==t?i[r-1]=e:(i[r++]=t,i[r++]=e)}return this.ret(t-n.length,i)}}class Rd{constructor(t){this.pattern=t,this.matched=[],this.score=0,this.folded=t.toLowerCase()}match(t){if(t.length_t(t,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Zd,filterStrict:!1,compareCompletions:(t,e)=>t.label.localeCompare(e.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(t,e)=>t&&e,closeOnBlur:(t,e)=>t&&e,icons:(t,e)=>t&&e,tooltipClass:(t,e)=>n=>Ad(t(n),e(n)),optionClass:(t,e)=>n=>Ad(t(n),e(n)),addToOptions:(t,e)=>t.concat(e),filterStrict:(t,e)=>t||e})});function Ad(t,e){return t?e?t+" "+e:t:e}function Zd(t,e,n,i,r,o){let s,a,l=t.textDirection==yn.RTL,c=l,u=!1,h="top",d=e.left-r.left,O=r.right-e.right,f=i.right-i.left,p=i.bottom-i.top;if(c&&d=p||t>e.top?s=n.bottom-e.top:(h="bottom",s=e.bottom-n.top)}return{style:`${h}: ${s/((e.bottom-e.top)/o.offsetHeight)}px; max-width: ${a/((e.right-e.left)/o.offsetWidth)}px`,class:"cm-completionInfo-"+(u?l?"left-narrow":"right-narrow":c?"left":"right")}}function Md(t,e,n){if(t<=n)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let t=Math.floor(e/n);return{from:t*n,to:(t+1)*n}}let i=Math.floor((t-e)/n);return{from:t-(i+1)*n,to:t-i*n}}class Vd{constructor(t,e,n){this.view=t,this.stateField=e,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:t=>this.placeInfo(t),key:this},this.space=null,this.currentClass="";let i=t.state.field(e),{options:r,selected:o}=i.open,s=t.state.facet(Ed);this.optionContent=function(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(t){let e=document.createElement("div");return e.classList.add("cm-completionIcon"),t.type&&e.classList.add(...t.type.split(/\s+/g).map((t=>"cm-completionIcon-"+t))),e.setAttribute("aria-hidden","true"),e},position:20}),e.push({render(t,e,n,i){let r=document.createElement("span");r.className="cm-completionLabel";let o=t.displayLabel||t.label,s=0;for(let t=0;ts&&r.appendChild(document.createTextNode(o.slice(s,e)));let a=r.appendChild(document.createElement("span"));a.appendChild(document.createTextNode(o.slice(e,n))),a.className="cm-completionMatchedText",s=n}return st.position-e.position)).map((t=>t.render))}(s),this.optionClass=s.optionClass,this.tooltipClass=s.tooltipClass,this.range=Md(r.length,o,s.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(t.state),this.dom.addEventListener("mousedown",(n=>{let{options:i}=t.state.field(e).open;for(let e,r=n.target;r&&r!=this.dom;r=r.parentNode)if("LI"==r.nodeName&&(e=/-(\d+)$/.exec(r.id))&&+e[1]{let n=t.state.field(this.stateField,!1);n&&n.tooltip&&t.state.facet(Ed).closeOnBlur&&e.relatedTarget!=t.contentDOM&&t.dispatch({effects:Cd.of(null)})})),this.showOptions(r,i.id)}mount(){this.updateSel()}showOptions(t,e){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t,e,this.range)),this.list.addEventListener("scroll",(()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)}))}update(t){var e;let n=t.state.field(this.stateField),i=t.startState.field(this.stateField);if(this.updateTooltipClass(t.state),n!=i){let{options:r,selected:o,disabled:s}=n.open;i.open&&i.open.options==r||(this.range=Md(r.length,o,t.state.facet(Ed).maxRenderedOptions),this.showOptions(r,n.id)),this.updateSel(),s!=(null===(e=i.open)||void 0===e?void 0:e.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!s)}}updateTooltipClass(t){let e=this.tooltipClass(t);if(e!=this.currentClass){for(let t of this.currentClass.split(" "))t&&this.dom.classList.remove(t);for(let t of e.split(" "))t&&this.dom.classList.add(t);this.currentClass=e}}positioned(t){this.space=t,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let t=this.view.state.field(this.stateField),e=t.open;if((e.selected>-1&&e.selected=this.range.to)&&(this.range=Md(e.options.length,e.selected,this.view.state.facet(Ed).maxRenderedOptions),this.showOptions(e.options,t.id)),this.updateSelectedOption(e.selected)){this.destroyInfo();let{completion:n}=e.options[e.selected],{info:i}=n;if(!i)return;let r="string"==typeof i?document.createTextNode(i):i(n);if(!r)return;"then"in r?r.then((e=>{e&&this.view.state.field(this.stateField,!1)==t&&this.addInfoPane(e,n)})).catch((t=>Jn(this.view.state,t,"completion info"))):this.addInfoPane(r,n)}}addInfoPane(t,e){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",null!=t.nodeType)n.appendChild(t),this.infoDestroy=null;else{let{dom:e,destroy:i}=t;n.appendChild(e),this.infoDestroy=i||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(t){let e=null;for(let n=this.list.firstChild,i=this.range.from;n;n=n.nextSibling,i++)"LI"==n.nodeName&&n.id?i==t?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),e=n):n.hasAttribute("aria-selected")&&n.removeAttribute("aria-selected"):i--;return e&&function(t,e){let n=t.getBoundingClientRect(),i=e.getBoundingClientRect(),r=n.height/t.offsetHeight;i.topn.bottom&&(t.scrollTop+=(i.bottom-n.bottom)/r)}(this.list,e),e}measureInfo(){let t=this.dom.querySelector("[aria-selected]");if(!t||!this.info)return null;let e=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),i=t.getBoundingClientRect(),r=this.space;if(!r){let t=this.dom.ownerDocument.defaultView||window;r={left:0,top:0,right:t.innerWidth,bottom:t.innerHeight}}return i.top>Math.min(r.bottom,e.bottom)-10||i.bottomn.from||0==n.from)&&(r=t,"string"!=typeof l&&l.header?i.appendChild(l.header(l)):i.appendChild(document.createElement("completion-section")).textContent=t)}const c=i.appendChild(document.createElement("li"));c.id=e+"-"+o,c.setAttribute("role","option");let u=this.optionClass(s);u&&(c.className=u);for(let t of this.optionContent){let e=t(s,this.view.state,this.view,a);e&&c.appendChild(e)}}return n.from&&i.classList.add("cm-completionListIncompleteTop"),n.tonew Vd(n,t,e)}function qd(t){return 100*(t.boost||0)+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}class Wd{constructor(t,e,n,i,r,o){this.options=t,this.attrs=e,this.tooltip=n,this.timestamp=i,this.selected=r,this.disabled=o}setSelected(t,e){return t==this.selected||t>=this.options.length?this:new Wd(this.options,Nd(e,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,e,n,i,r){let o=function(t,e){let n=[],i=null,r=t=>{n.push(t);let{section:e}=t.completion;if(e){i||(i=[]);let t="string"==typeof e?e:e.name;i.some((e=>e.name==t))||i.push("string"==typeof e?{name:t}:e)}},o=e.facet(Ed);for(let i of t)if(i.hasResult()){let t=i.result.getMatch;if(!1===i.result.filter)for(let e of i.result.options)r(new wd(e,i.source,t?t(e):[],1e9-n.length));else{let n,s=e.sliceDoc(i.from,i.to),a=o.filterStrict?new Rd(s):new zd(s);for(let e of i.result.options)if(n=a.match(e.label)){let o=e.displayLabel?t?t(e,n.matched):[]:n.matched;r(new wd(e,i.source,o,n.score+(e.boost||0)))}}}if(i){let t=Object.create(null),e=0,r=(t,e)=>{var n,i;return(null!==(n=t.rank)&&void 0!==n?n:1e9)-(null!==(i=e.rank)&&void 0!==i?i:1e9)||(t.namee.score-t.score||l(t.completion,e.completion)))){let e=t.completion;!a||a.label!=e.label||a.detail!=e.detail||null!=a.type&&null!=e.type&&a.type!=e.type||a.apply!=e.apply||a.boost!=e.boost?s.push(t):qd(t.completion)>qd(a)&&(s[s.length-1]=t),a=t.completion}return s}(t,e);if(!o.length)return i&&t.some((t=>1==t.state))?new Wd(i.options,i.attrs,i.tooltip,i.timestamp,i.selected,!0):null;let s=e.facet(Ed).selectOnOpen?0:-1;if(i&&i.selected!=s&&-1!=i.selected){let t=i.options[i.selected].completion;for(let e=0;ee.hasResult()?Math.min(t,e.from):t),1e8),create:Jd,above:r.aboveCursor},i?i.timestamp:Date.now(),s,!1)}map(t){return new Wd(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:t.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class jd{constructor(t,e,n){this.active=t,this.id=e,this.open=n}static start(){return new jd(Ud,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(t){let{state:e}=t,n=e.facet(Ed),i=(n.override||e.languageDataAt("autocomplete",xd(e)).map(kd)).map((e=>(this.active.find((t=>t.source==e))||new Yd(e,this.active.some((t=>0!=t.state))?1:0)).update(t,n)));i.length==this.active.length&&i.every(((t,e)=>t==this.active[e]))&&(i=this.active);let r=this.open;r&&t.docChanged&&(r=r.map(t.changes)),t.selection||i.some((e=>e.hasResult()&&t.changes.touchesRange(e.from,e.to)))||!function(t,e){if(t==e)return!0;for(let n=0,i=0;;){for(;n1==t.state))&&(r=null),!r&&i.every((t=>1!=t.state))&&i.some((t=>t.hasResult()))&&(i=i.map((t=>t.hasResult()?new Yd(t.source,0):t)));for(let e of t.effects)e.is(Fd)&&(r=r&&r.setSelected(e.value,this.id));return i==this.active&&r==this.open?this:new jd(i,this.id,r)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?Id:Ld}}const Id={"aria-autocomplete":"list"},Ld={};function Nd(t,e){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":t};return e>-1&&(n["aria-activedescendant"]=t+"-"+e),n}const Ud=[];function Dd(t,e){if(t.isUserEvent("input.complete")){let n=t.annotation(Pd);if(n&&e.activateOnCompletion(n))return 12}let n=t.isUserEvent("input.type");return n&&e.activateOnTyping?5:n?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}class Yd{constructor(t,e,n=-1){this.source=t,this.state=e,this.explicitPos=n}hasResult(){return!1}update(t,e){let n=Dd(t,e),i=this;(8&n||16&n&&this.touches(t))&&(i=new Yd(i.source,0)),4&n&&0==i.state&&(i=new Yd(this.source,1)),i=i.updateFor(t,n);for(let e of t.effects)if(e.is(Td))i=new Yd(i.source,1,e.value?xd(t.state):-1);else if(e.is(Cd))i=new Yd(i.source,0);else if(e.is(Gd))for(let t of e.value)t.source==i.source&&(i=t);return i}updateFor(t,e){return this.map(t.changes)}map(t){return t.empty||this.explicitPos<0?this:new Yd(this.source,this.state,t.mapPos(this.explicitPos))}touches(t){return t.changes.touchesRange(xd(t.state))}}class Bd extends Yd{constructor(t,e,n,i,r){super(t,2,e),this.result=n,this.from=i,this.to=r}hasResult(){return!0}updateFor(t,e){var n;if(!(3&e))return this.map(t.changes);let i=this.result;i.map&&!t.changes.empty&&(i=i.map(i,t.changes));let r=t.changes.mapPos(this.from),o=t.changes.mapPos(this.to,1),s=xd(t.state);if((this.explicitPos<0?s<=r:so||!i||2&e&&xd(t.startState)==this.from)return new Yd(this.source,4&e?1:0);let a=this.explicitPos<0?-1:t.changes.mapPos(this.explicitPos);return function(t,e,n,i){if(!t)return!1;let r=e.sliceDoc(n,i);return"function"==typeof t?t(r,n,i,e):Qd(t,!0).test(r)}(i.validFor,t.state,r,o)?new Bd(this.source,a,i,r,o):i.update&&(i=i.update(i,r,o,new $d(t.state,s,a>=0)))?new Bd(this.source,a,i,i.from,null!==(n=i.to)&&void 0!==n?n:xd(t.state)):new Yd(this.source,1,a)}map(t){return t.empty?this:(this.result.map?this.result.map(this.result,t):this.result)?new Bd(this.source,this.explicitPos<0?-1:t.mapPos(this.explicitPos),this.result,t.mapPos(this.from),t.mapPos(this.to,1)):new Yd(this.source,0)}touches(t){return t.changes.touchesRange(this.from,this.to)}}const Gd=pt.define({map:(t,e)=>t.map((t=>t.map(e)))}),Fd=pt.define(),Hd=F.define({create:()=>jd.start(),update:(t,e)=>t.update(e),provide:t=>[ss.from(t,(t=>t.tooltip)),no.contentAttributes.from(t,(t=>t.attrs))]});function Kd(t,e){const n=e.completion.apply||e.completion.label;let i=t.state.field(Hd).active.find((t=>t.source==e.source));return i instanceof Bd&&("string"==typeof n?t.dispatch(Object.assign(Object.assign({},function(t,e,n,i){let{main:r}=t.selection,o=n-r.from,s=i-r.from;return Object.assign(Object.assign({},t.changeByRange((a=>{if(a!=r&&n!=i&&t.sliceDoc(a.from+o,a.from+s)!=t.sliceDoc(n,i))return{range:a};let l=t.toText(e);return{changes:{from:a.from+o,to:i==r.from?a.to:a.from+s,insert:l},range:W.cursor(a.from+o+l.length)}}))),{scrollIntoView:!0,userEvent:"input.complete"})}(t.state,n,i.from,i.to)),{annotations:Pd.of(e.completion)})):n(t,e.completion,i.from,i.to),!0)}const Jd=Xd(Hd,Kd);function tO(t,e="option"){return n=>{let i=n.state.field(Hd,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp-1?i.open.selected+o*(t?1:-1):t?0:s-1;return a<0?a="page"==e?0:s-1:a>=s&&(a="page"==e?s-1:0),n.dispatch({effects:Fd.of(a)}),!0}}const eO=t=>!!t.state.field(Hd,!1)&&(t.dispatch({effects:Td.of(!0)}),!0);class nO{constructor(t,e){this.active=t,this.context=e,this.time=Date.now(),this.updates=[],this.done=void 0}}const iO=ii.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field(Hd).active)1==e.state&&this.startQuery(e)}update(t){let e=t.state.field(Hd),n=t.state.facet(Ed);if(!t.selectionSet&&!t.docChanged&&t.startState.field(Hd)==e)return;let i=t.transactions.some((t=>{let e=Dd(t,n);return 8&e||(t.selection||t.docChanged)&&!(3&e)}));for(let e=0;e50&&Date.now()-n.time>1e3){for(let t of n.context.abortListeners)try{t()}catch(t){Jn(this.view.state,t)}n.context.abortListeners=null,this.running.splice(e--,1)}else n.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some((t=>t.effects.some((t=>t.is(Td)))))&&(this.pendingStart=!0);let r=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=e.active.some((t=>1==t.state&&!this.running.some((e=>e.active.source==t.source))))?setTimeout((()=>this.startUpdate()),r):-1,0!=this.composing)for(let e of t.transactions)e.isUserEvent("input.type")?this.composing=2:2==this.composing&&e.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field(Hd);for(let t of e.active)1!=t.state||this.running.some((e=>e.active.source==t.source))||this.startQuery(t)}startQuery(t){let{state:e}=this.view,n=xd(e),i=new $d(e,n,t.explicitPos==n,this.view),r=new nO(t,i);this.running.push(r),Promise.resolve(t.source(i)).then((t=>{r.context.aborted||(r.done=t||null,this.scheduleAccept())}),(t=>{this.view.dispatch({effects:Cd.of(null)}),Jn(this.view.state,t)}))}scheduleAccept(){this.running.every((t=>void 0!==t.done))?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout((()=>this.accept()),this.view.state.facet(Ed).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],n=this.view.state.facet(Ed);for(let i=0;it.source==r.active.source));if(o&&1==o.state)if(null==r.done){let t=new Yd(r.active.source,0);for(let e of r.updates)t=t.update(e,n);1!=t.state&&e.push(t)}else this.startQuery(o)}e.length&&this.view.dispatch({effects:Gd.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(Hd,!1);if(e&&e.tooltip&&this.view.state.facet(Ed).closeOnBlur){let n=e.open&&Os(this.view,e.open.tooltip);n&&n.dom.contains(t.relatedTarget)||setTimeout((()=>this.view.dispatch({effects:Cd.of(null)})),10)}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout((()=>this.view.dispatch({effects:Td.of(!1)})),20),this.composing=0}}}),rO="object"==typeof navigator&&/Win/.test(navigator.platform),oO=K.highest(no.domEventHandlers({keydown(t,e){let n=e.state.field(Hd,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||t.key.length>1||t.ctrlKey&&(!rO||!t.altKey)||t.metaKey)return!1;let i=n.open.options[n.open.selected],r=n.active.find((t=>t.source==i.source)),o=i.completion.commitCharacters||r.result.commitCharacters;return o&&o.indexOf(t.key)>-1&&Kd(e,i),!1}})),sO=no.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class aO{constructor(t,e,n,i){this.field=t,this.line=e,this.from=n,this.to=i}}class lO{constructor(t,e,n){this.field=t,this.from=e,this.to=n}map(t){let e=t.mapPos(this.from,-1,C.TrackDel),n=t.mapPos(this.to,1,C.TrackDel);return null==e||null==n?null:new lO(this.field,e,n)}}class cO{constructor(t,e){this.lines=t,this.fieldPositions=e}instantiate(t,e){let n=[],i=[e],r=t.doc.lineAt(e),o=/^\s*/.exec(r.text)[0];for(let r of this.lines){if(n.length){let n=o,s=/^\t*/.exec(r)[0].length;for(let e=0;enew lO(t.field,i[t.line]+t.from,i[t.line]+t.to)));return{text:n,ranges:s}}static parse(t){let e,n=[],i=[],r=[];for(let o of t.split(/\r\n?|\n/)){for(;e=/[#$]\{(?:(\d+)(?::([^}]*))?|((?:\\[{}]|[^}])*))\}/.exec(o);){let t=e[1]?+e[1]:null,s=e[2]||e[3]||"",a=-1,l=s.replace(/\\[{}]/g,(t=>t[1]));for(let e=0;e=a&&t.field++}r.push(new aO(a,i.length,e.index,e.index+l.length)),o=o.slice(0,e.index)+s+o.slice(e.index+e[0].length)}o=o.replace(/\\([{}])/g,((t,e,n)=>{for(let t of r)t.line==i.length&&t.from>n&&(t.from--,t.to--);return e})),i.push(o)}return new cO(i,r)}}let uO=sn.widget({widget:new class extends rn{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),hO=sn.mark({class:"cm-snippetField"});class dO{constructor(t,e){this.ranges=t,this.active=e,this.deco=sn.set(t.map((t=>(t.from==t.to?uO:hO).range(t.from,t.to))))}map(t){let e=[];for(let n of this.ranges){let i=n.map(t);if(!i)return null;e.push(i)}return new dO(e,this.active)}selectionInsideField(t){return t.ranges.every((t=>this.ranges.some((e=>e.field==this.active&&e.from<=t.from&&e.to>=t.to))))}}const OO=pt.define({map:(t,e)=>t&&t.map(e)}),fO=pt.define(),pO=F.define({create:()=>null,update(t,e){for(let n of e.effects){if(n.is(OO))return n.value;if(n.is(fO)&&t)return new dO(t.ranges,n.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>no.decorations.from(t,(t=>t?t.deco:sn.none))});function mO(t,e){return W.create(t.filter((t=>t.field==e)).map((t=>W.range(t.from,t.to))))}function gO(t){let e=cO.parse(t);return(t,n,i,r)=>{let{text:o,ranges:s}=e.instantiate(t.state,i),a={changes:{from:i,to:r,insert:l.of(o)},scrollIntoView:!0,annotations:n?[Pd.of(n),mt.userEvent.of("input.complete")]:void 0};if(s.length&&(a.selection=mO(s,0)),s.some((t=>t.field>0))){let e=new dO(s,0),n=a.effects=[OO.of(e)];void 0===t.state.field(pO,!1)&&n.push(pt.appendConfig.of([pO,bO,wO,sO]))}t.dispatch(t.state.update(a))}}function yO(t){return({state:e,dispatch:n})=>{let i=e.field(pO,!1);if(!i||t<0&&0==i.active)return!1;let r=i.active+t,o=t>0&&!i.ranges.some((e=>e.field==r+t));return n(e.update({selection:mO(i.ranges,r),effects:OO.of(o?null:new dO(i.ranges,r)),scrollIntoView:!0})),!0}}const $O=[{key:"Tab",run:yO(1),shift:yO(-1)},{key:"Escape",run:({state:t,dispatch:e})=>!!t.field(pO,!1)&&(e(t.update({effects:OO.of(null)})),!0)}],vO=L.define({combine:t=>t.length?t[0]:$O}),bO=K.highest(uo.compute([vO],(t=>t.facet(vO))));function SO(t,e){return Object.assign(Object.assign({},e),{apply:gO(t)})}const wO=no.domEventHandlers({mousedown(t,e){let n,i=e.state.field(pO,!1);if(!i||null==(n=e.posAtCoords({x:t.clientX,y:t.clientY})))return!1;let r=i.ranges.find((t=>t.from<=n&&t.to>=n));return!(!r||r.field==i.active||(e.dispatch({selection:mO(i.ranges,r.field),effects:OO.of(i.ranges.some((t=>t.field>r.field))?new dO(i.ranges,r.field):null),scrollIntoView:!0}),0))}}),xO={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},QO=pt.define({map(t,e){let n=e.mapPos(t,-1,C.TrackAfter);return null==n?void 0:n}}),PO=new class extends kt{};PO.startSide=1,PO.endSide=-1;const _O=F.define({create:()=>Rt.empty,update(t,e){if(t=t.map(e.changes),e.selection){let n=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:t=>t>=n.from&&t<=n.to})}for(let n of e.effects)n.is(QO)&&(t=t.update({add:[PO.range(n.value,n.value+1)]}));return t}}),kO="()[]{}<>";function TO(t){for(let e=0;e<8;e+=2)if(kO.charCodeAt(e)==t)return kO.charAt(e+1);return _(t<128?t:t+1)}function CO(t,e){return t.languageDataAt("closeBrackets",e)[0]||xO}const zO="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),RO=no.inputHandler.of(((t,e,n,i)=>{if((zO?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let r=t.state.selection.main;if(i.length>2||2==i.length&&1==k(P(i,0))||e!=r.from||n!=r.to)return!1;let o=function(t,e){let n=CO(t,t.selection.main.head),i=n.brackets||xO.brackets;for(let r of i){let o=TO(P(r,0));if(e==r)return o==r?XO(t,r,i.indexOf(r+r+r)>-1,n):MO(t,r,o,n.before||xO.before);if(e==o&&AO(t,t.selection.main.from))return VO(t,0,o)}return null}(t.state,i);return!!o&&(t.dispatch(o),!0)})),EO=[{key:"Backspace",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=CO(t,t.selection.main.head).brackets||xO.brackets,i=null,r=t.changeByRange((e=>{if(e.empty){let i=function(t,e){let n=t.sliceString(e-2,e);return k(P(n,0))==n.length?n:n.slice(1)}(t.doc,e.head);for(let r of n)if(r==i&&ZO(t.doc,e.head)==TO(P(r,0)))return{changes:{from:e.head-r.length,to:e.head+r.length},range:W.cursor(e.head-r.length)}}return{range:i=e}}));return i||e(t.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!i}}];function AO(t,e){let n=!1;return t.field(_O).between(0,t.doc.length,(t=>{t==e&&(n=!0)})),n}function ZO(t,e){let n=t.sliceString(e,e+2);return n.slice(0,k(P(n,0)))}function MO(t,e,n,i){let r=null,o=t.changeByRange((o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:n,from:o.to}],effects:QO.of(o.to+e.length),range:W.range(o.anchor+e.length,o.head+e.length)};let s=ZO(t.doc,o.head);return!s||/\s/.test(s)||i.indexOf(s)>-1?{changes:{insert:e+n,from:o.head},effects:QO.of(o.head+e.length),range:W.cursor(o.head+e.length)}:{range:r=o}}));return r?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function VO(t,e,n){let i=null,r=t.changeByRange((e=>e.empty&&ZO(t.doc,e.head)==n?{changes:{from:e.head,to:e.head+n.length,insert:n},range:W.cursor(e.head+n.length)}:i={range:e}));return i?null:t.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function XO(t,e,n,i){let r=i.stringPrefixes||xO.stringPrefixes,o=null,s=t.changeByRange((i=>{if(!i.empty)return{changes:[{insert:e,from:i.from},{insert:e,from:i.to}],effects:QO.of(i.to+e.length),range:W.range(i.anchor+e.length,i.head+e.length)};let s,a=i.head,l=ZO(t.doc,a);if(l==e){if(qO(t,a))return{changes:{insert:e+e,from:a},effects:QO.of(a+e.length),range:W.cursor(a+e.length)};if(AO(t,a)){let i=n&&t.sliceDoc(a,a+3*e.length)==e+e+e?e+e+e:e;return{changes:{from:a,to:a+i.length,insert:i},range:W.cursor(a+i.length)}}}else{if(n&&t.sliceDoc(a-2*e.length,a)==e+e&&(s=WO(t,a-2*e.length,r))>-1&&qO(t,s))return{changes:{insert:e+e+e+e,from:a},effects:QO.of(a+e.length),range:W.cursor(a+e.length)};if(t.charCategorizer(a)(l)!=wt.Word&&WO(t,a,r)>-1&&!function(t,e,n,i){let r=ml(t).resolveInner(e,-1),o=i.reduce(((t,e)=>Math.max(t,e.length)),0);for(let s=0;s<5;s++){let s=t.sliceDoc(r.from,Math.min(r.to,r.from+n.length+o)),a=s.indexOf(n);if(!a||a>-1&&i.indexOf(s.slice(0,a))>-1){let e=r.firstChild;for(;e&&e.from==r.from&&e.to-e.from>n.length+a;){if(t.sliceDoc(e.to-n.length,e.to)==n)return!1;e=e.firstChild}return!0}let l=r.to==e&&r.parent;if(!l)break;r=l}return!1}(t,a,e,r))return{changes:{insert:e+e,from:a},effects:QO.of(a+e.length),range:W.cursor(a+e.length)}}return{range:o=i}}));return o?null:t.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function qO(t,e){let n=ml(t).resolveInner(e+1);return n.parent&&n.from==e}function WO(t,e,n){let i=t.charCategorizer(e);if(i(t.sliceDoc(e-1,e))!=wt.Word)return e;for(let r of n){let n=e-r.length;if(t.sliceDoc(n,e)==r&&i(t.sliceDoc(n-1,n))!=wt.Word)return n}return-1}const jO=[{key:"Ctrl-Space",run:eO},{mac:"Alt-`",run:eO},{key:"Escape",run:t=>{let e=t.state.field(Hd,!1);return!(!e||!e.active.some((t=>0!=t.state))||(t.dispatch({effects:Cd.of(null)}),0))}},{key:"ArrowDown",run:tO(!0)},{key:"ArrowUp",run:tO(!1)},{key:"PageDown",run:tO(!0,"page")},{key:"PageUp",run:tO(!1,"page")},{key:"Enter",run:t=>{let e=t.state.field(Hd,!1);return!(t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampt.facet(Ed).defaultKeymap?[jO]:[])));class LO{constructor(t,e,n){this.from=t,this.to=e,this.diagnostic=n}}class NO{constructor(t,e,n){this.diagnostics=t,this.panel=e,this.selected=n}static init(t,e,n){let i=t,r=n.facet(ef).markerFilter;r&&(i=r(i,n));let o=sn.set(i.map((t=>t.from==t.to||t.from==t.to-1&&n.doc.lineAt(t.from).to==t.from?sn.widget({widget:new of(t),diagnostic:t}).range(t.from):sn.mark({attributes:{class:"cm-lintRange cm-lintRange-"+t.severity+(t.markClass?" "+t.markClass:"")},diagnostic:t}).range(t.from,t.to))),!0);return new NO(o,e,UO(o))}}function UO(t,e=null,n=0){let i=null;return t.between(n,1e9,((t,n,{spec:r})=>{if(!e||r.diagnostic==e)return i=new LO(t,n,r.diagnostic),!1})),i}const DO=pt.define(),YO=pt.define(),BO=pt.define(),GO=F.define({create:()=>new NO(sn.none,null,null),update(t,e){if(e.docChanged&&t.diagnostics.size){let n=t.diagnostics.map(e.changes),i=null,r=t.panel;if(t.selected){let r=e.changes.mapPos(t.selected.from,1);i=UO(n,t.selected.diagnostic,r)||UO(n,null,r)}!n.size&&r&&e.state.facet(ef).autoPanel&&(r=null),t=new NO(n,r,i)}for(let n of e.effects)if(n.is(DO)){let i=e.state.facet(ef).autoPanel?n.value.length?af.open:null:t.panel;t=NO.init(n.value,i,e.state)}else n.is(YO)?t=new NO(t.diagnostics,n.value?af.open:null,t.selected):n.is(BO)&&(t=new NO(t.diagnostics,t.panel,n.value));return t},provide:t=>[vs.from(t,(t=>t.panel)),no.decorations.from(t,(t=>t.diagnostics))]}),FO=sn.mark({class:"cm-lintRange cm-lintRange-active"});function HO(t,e,n){let{diagnostics:i}=t.state.field(GO),r=[],o=2e8,s=0;i.between(e-(n<0?1:0),e+(n>0?1:0),((t,i,{spec:a})=>{e>=t&&e<=i&&(t==i||(e>t||n>0)&&(e({dom:KO(t,r)})}:null}function KO(t,e){return ph("ul",{class:"cm-tooltip-lint"},e.map((e=>rf(t,e,!1))))}const JO=t=>{let e=t.state.field(GO,!1);return!(!e||!e.panel||(t.dispatch({effects:YO.of(!1)}),0))},tf=[{key:"Mod-Shift-m",run:t=>{let e=t.state.field(GO,!1);var n,i;e&&e.panel||t.dispatch({effects:(n=t.state,i=[YO.of(!0)],n.field(GO,!1)?i:i.concat(pt.appendConfig.of(uf)))});let r=ms(t,af.open);return r&&r.dom.querySelector(".cm-panel-lint ul").focus(),!0},preventDefault:!0},{key:"F8",run:t=>{let e=t.state.field(GO,!1);if(!e)return!1;let n=t.state.selection.main,i=e.diagnostics.iter(n.to+1);return!(!i.value&&(i=e.diagnostics.iter(0),!i.value||i.from==n.from&&i.to==n.to)||(t.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),0))}}],ef=L.define({combine:t=>Object.assign({sources:t.map((t=>t.source)).filter((t=>null!=t))},_t(t.map((t=>t.config)),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(t,e)=>t?e?n=>t(n)||e(n):t:e}))});function nf(t){let e=[];if(t)t:for(let{name:n}of t){for(let t=0;tt.toLowerCase()==i.toLowerCase()))){e.push(i);continue t}}e.push("")}return e}function rf(t,e,n){var i;let r=n?nf(e.actions):[];return ph("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},ph("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),null===(i=e.actions)||void 0===i?void 0:i.map(((n,i)=>{let o=!1,s=i=>{if(i.preventDefault(),o)return;o=!0;let r=UO(t.state.field(GO).diagnostics,e);r&&n.apply(t,r.from,r.to)},{name:a}=n,l=r[i]?a.indexOf(r[i]):-1,c=l<0?a:[a.slice(0,l),ph("u",a.slice(l,l+1)),a.slice(l+1)];return ph("button",{type:"button",class:"cm-diagnosticAction",onclick:s,onmousedown:s,"aria-label":` Action: ${a}${l<0?"":` (access key "${r[i]})"`}.`},c)})),e.source&&ph("div",{class:"cm-diagnosticSource"},e.source))}class of extends rn{constructor(t){super(),this.diagnostic=t}eq(t){return t.diagnostic==this.diagnostic}toDOM(){return ph("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class sf{constructor(t,e){this.diagnostic=e,this.id="item_"+Math.floor(4294967295*Math.random()).toString(16),this.dom=rf(t,e,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class af{constructor(t){this.view=t,this.items=[],this.list=ph("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:e=>{if(27==e.keyCode)JO(this.view),this.view.focus();else if(38==e.keyCode||33==e.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==e.keyCode||34==e.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==e.keyCode)this.moveSelection(0);else if(35==e.keyCode)this.moveSelection(this.items.length-1);else if(13==e.keyCode)this.view.focus();else{if(!(e.keyCode>=65&&e.keyCode<=90&&this.selectedIndex>=0))return;{let{diagnostic:n}=this.items[this.selectedIndex],i=nf(n.actions);for(let r=0;r{for(let e=0;eJO(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(GO).selected;if(!t)return-1;for(let e=0;e{let a,l=-1;for(let t=n;tn&&(this.items.splice(n,l-n),i=!0)),e&&a.diagnostic==e.diagnostic?a.dom.hasAttribute("aria-selected")||(a.dom.setAttribute("aria-selected","true"),r=a):a.dom.hasAttribute("aria-selected")&&a.dom.removeAttribute("aria-selected"),n++}));n({sel:r.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:t,panel:e})=>{let n=e.height/this.list.offsetHeight;t.tope.bottom&&(this.list.scrollTop+=(t.bottom-e.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let t=this.list.firstChild;function e(){let e=t;t=e.nextSibling,e.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;t!=n.dom;)e();t=n.dom.nextSibling}else this.list.insertBefore(n.dom,t);for(;t;)e()}moveSelection(t){if(this.selectedIndex<0)return;let e=UO(this.view.state.field(GO).diagnostics,this.items[t].diagnostic);e&&this.view.dispatch({selection:{anchor:e.from,head:e.to},scrollIntoView:!0,effects:BO.of(e)})}static open(t){return new af(t)}}function lf(t){return function(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(t)}')`}(``,'width="6" height="3"')}const cf=no.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:lf("#d11")},".cm-lintRange-warning":{backgroundImage:lf("orange")},".cm-lintRange-info":{backgroundImage:lf("#999")},".cm-lintRange-hint":{backgroundImage:lf("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}}),uf=[GO,no.decorations.compute([GO],(t=>{let{selected:e,panel:n}=t.field(GO);return e&&n&&e.from!=e.to?sn.set([FO.range(e.from,e.to)]):sn.none})),ds(HO,{hideOn:function(t,e){let n=e.pos,i=e.end||n,r=t.state.facet(ef).hideOn(t,n,i);if(null!=r)return r;let o=t.startState.doc.lineAt(e.pos);return!(!t.effects.some((t=>t.is(DO)))&&!t.changes.touchesRange(o.from,Math.max(o.to,i)))}}),cf];var hf=function(t){void 0===t&&(t={});var{crosshairCursor:e=!1}=t,n=[];!1!==t.closeBracketsKeymap&&(n=n.concat(EO)),!1!==t.defaultKeymap&&(n=n.concat(Oh)),!1!==t.searchKeymap&&(n=n.concat(hd)),!1!==t.historyKeymap&&(n=n.concat(mu)),!1!==t.foldKeymap&&(n=n.concat(ic)),!1!==t.completionKeymap&&(n=n.concat(jO)),!1!==t.lintKeymap&&(n=n.concat(tf));var i=[];return!1!==t.lineNumbers&&i.push(function(t={}){return[Vs.of(t),ks(),Ws]}()),!1!==t.highlightActiveLineGutter&&i.push(Ls),!1!==t.highlightSpecialChars&&i.push(function(t={}){return[jo.of(t),Io||(Io=ii.fromClass(class{constructor(t){this.view=t,this.decorations=sn.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(jo)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new Mo({regexp:t.specialChars,decoration:(e,n,i)=>{let{doc:r}=n.state,o=P(e[0],0);if(9==o){let t=r.lineAt(i),e=n.state.tabSize,o=Nt(t.text,e,i-t.from);return sn.replace({widget:new No((e-o%e)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=sn.replace({widget:new Lo(t,o)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(jo);t.startState.facet(jo)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))]}()),!1!==t.history&&i.push(function(t={}){return[Jc,Kc.of(t),no.domEventHandlers({beforeinput(t,e){let n="historyUndo"==t.inputType?eu:"historyRedo"==t.inputType?nu:null;return!!n&&(t.preventDefault(),n(e))}})]}()),!1!==t.foldGutter&&i.push(function(t={}){let e=Object.assign(Object.assign({},uc),t),n=new hc(e,!0),i=new hc(e,!1),r=ii.fromClass(class{constructor(t){this.from=t.viewport.from,this.markers=this.buildMarkers(t)}update(t){(t.docChanged||t.viewportChanged||t.startState.facet(Ql)!=t.state.facet(Ql)||t.startState.field(Kl,!1)!=t.state.field(Kl,!1)||ml(t.startState)!=ml(t.state)||e.foldingChanged(t))&&(this.markers=this.buildMarkers(t.view))}buildMarkers(t){let e=new Et;for(let r of t.viewportLineBlocks){let o=Jl(t.state,r.from,r.to)?i:Yl(t.state,r.from,r.to)?n:null;o&&e.add(r.from,r.from,o)}return e.finish()}}),{domEventHandlers:o}=e;return[r,Ps({class:"cm-foldGutter",markers(t){var e;return(null===(e=t.plugin(r))||void 0===e?void 0:e.markers)||Rt.empty},initialSpacer:()=>new hc(e,!1),domEventHandlers:Object.assign(Object.assign({},o),{click:(t,e,n)=>{if(o.click&&o.click(t,e,n))return!0;let i=Jl(t.state,e.from,e.to);if(i)return t.dispatch({effects:Fl.of(i)}),!0;let r=Yl(t.state,e.from,e.to);return!!r&&(t.dispatch({effects:Gl.of(r)}),!0)}})}),sc()]}()),!1!==t.drawSelection&&i.push(function(t={}){return[Qo.of(t),_o,To,zo,Bn.of(!0)]}()),!1!==t.dropCursor&&i.push([Eo,Ao]),!1!==t.allowMultipleSelections&&i.push(Pt.allowMultipleSelections.of(!0)),!1!==t.indentOnInput&&i.push(Pt.transactionFilter.of((t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let n=t.newDoc,{head:i}=t.newSelection.main,r=n.lineAt(i);if(i>r.from+200)return t;let o=n.sliceString(r.from,i);if(!e.some((t=>t.test(o))))return t;let{state:s}=t,a=-1,l=[];for(let{head:t}of s.selection.ranges){let e=s.doc.lineAt(t);if(e.from==a)continue;a=e.from;let n=Rl(s,e.from);if(null==n)continue;let i=/^\s*/.exec(e.text)[0],r=zl(s,n);i!=r&&l.push({from:e.from,to:e.from+i.length,insert:r})}return l.length?[t,{changes:l,sequential:!0}]:t}))),!1!==t.syntaxHighlighting&&i.push(gc(vc,{fallback:!0})),!1!==t.bracketMatching&&i.push(function(t={}){return[wc.of(t),kc]}()),!1!==t.closeBrackets&&i.push([RO,_O]),!1!==t.autocompletion&&i.push(function(t={}){return[oO,Hd,Ed.of(t),iO,IO,sO]}()),!1!==t.rectangularSelection&&i.push(function(){let t=t=>t.altKey&&0==t.button;return no.mouseSelectionStyle.of(((e,n)=>t(n)?function(t,e){let n=Go(t,e),i=t.state.selection;return n?{update(t){if(t.docChanged){let e=t.changes.mapPos(t.startState.doc.line(n.line).from),r=t.state.doc.lineAt(e);n={line:r.number,col:n.col,off:Math.min(n.off,r.length)},i=i.map(t.changes)}},get(e,r,o){let s=Go(t,e);if(!s)return i;let a=function(t,e,n){let i=Math.min(e.line,n.line),r=Math.max(e.line,n.line),o=[];if(e.off>Bo||n.off>Bo||e.col<0||n.col<0){let s=Math.min(e.off,n.off),a=Math.max(e.off,n.off);for(let e=i;e<=r;e++){let n=t.doc.line(e);n.length<=a&&o.push(W.range(n.from+s,n.to+a))}}else{let s=Math.min(e.col,n.col),a=Math.max(e.col,n.col);for(let e=i;e<=r;e++){let n=t.doc.line(e),i=Ut(n.text,s,t.tabSize,!0);if(i<0)o.push(W.cursor(n.to));else{let e=Ut(n.text,a,t.tabSize);o.push(W.range(n.from+i,n.from+e))}}}return o}(t.state,n,s);return a.length?o?W.create(a.concat(i.ranges)):W.create(a):i}}:null}(e,n):null))}()),!1!==e&&i.push(function(t={}){let[e,n]=Fo[t.key||"Alt"],i=ii.fromClass(class{constructor(t){this.view=t,this.isDown=!1}set(t){this.isDown!=t&&(this.isDown=t,this.view.update([]))}},{eventObservers:{keydown(t){this.set(t.keyCode==e||n(t))},keyup(t){t.keyCode!=e&&n(t)||this.set(!1)},mousemove(t){this.set(n(t))}}});return[i,no.contentAttributes.of((t=>{var e;return(null===(e=t.plugin(i))||void 0===e?void 0:e.isDown)?Ho:null}))]}()),!1!==t.highlightActiveLine&&i.push(Do),!1!==t.highlightSelectionMatches&&i.push(function(){let t=[Mh,Zh];return t}()),t.tabSize&&"number"==typeof t.tabSize&&i.push(Tl.of(" ".repeat(t.tabSize))),i.concat([uo.of(n.flat())]).filter(Boolean)};const df="#e06c75",Of="#abb2bf",ff="#7d8799",pf="#d19a66",mf="#2c313a",gf="#282c34",yf="#353a42",$f="#528bff",vf=[no.theme({"&":{color:Of,backgroundColor:gf},".cm-content":{caretColor:$f},".cm-cursor, .cm-dropCursor":{borderLeftColor:$f},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#3E4451"},".cm-panels":{backgroundColor:"#21252b",color:Of},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:gf,color:ff,border:"none"},".cm-activeLineGutter":{backgroundColor:mf},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:yf},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:yf,borderBottomColor:yf},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:mf,color:Of}}},{dark:!0}),gc(Oc.define([{tag:ll.keyword,color:"#c678dd"},{tag:[ll.name,ll.deleted,ll.character,ll.propertyName,ll.macroName],color:df},{tag:[ll.function(ll.variableName),ll.labelName],color:"#61afef"},{tag:[ll.color,ll.constant(ll.name),ll.standard(ll.name)],color:pf},{tag:[ll.definition(ll.name),ll.separator],color:Of},{tag:[ll.typeName,ll.className,ll.number,ll.changed,ll.annotation,ll.modifier,ll.self,ll.namespace],color:"#e5c07b"},{tag:[ll.operator,ll.operatorKeyword,ll.url,ll.escape,ll.regexp,ll.link,ll.special(ll.string)],color:"#56b6c2"},{tag:[ll.meta,ll.comment],color:ff},{tag:ll.strong,fontWeight:"bold"},{tag:ll.emphasis,fontStyle:"italic"},{tag:ll.strikethrough,textDecoration:"line-through"},{tag:ll.link,color:ff,textDecoration:"underline"},{tag:ll.heading,fontWeight:"bold",color:df},{tag:[ll.atom,ll.bool,ll.special(ll.variableName)],color:pf},{tag:[ll.processingInstruction,ll.string,ll.inserted],color:"#98c379"},{tag:ll.invalid,color:"#ffffff"}]))];var bf=no.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),Sf=function(t){void 0===t&&(t={});var{indentWithTab:e=!0,editable:n=!0,readOnly:i=!1,theme:r="light",placeholder:o="",basicSetup:s=!0}=t,a=[];switch(e&&a.unshift(uo.of([fh])),s&&("boolean"==typeof s?a.unshift(hf()):a.unshift(hf(s))),o&&a.unshift(function(t){return ii.fromClass(class{constructor(e){this.view=e,this.placeholder=t?sn.set([sn.widget({widget:new Yo(t),side:1}).range(0)]):sn.none}get decorations(){return this.view.state.doc.length?sn.none:this.placeholder}},{decorations:t=>t.decorations})}(o)),r){case"light":a.push(bf);break;case"dark":a.push(vf);break;case"none":break;default:a.push(r)}return!1===n&&a.push(no.editable.of(!1)),i&&a.push(Pt.readOnly.of(!0)),[...a]},wf=dt.define(),xf=[],Qf=n(4848),Pf=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],_f=(0,i.forwardRef)(((t,e)=>{var{className:n,value:r="",selection:o,extensions:l=[],onChange:c,onStatistics:u,onCreateEditor:h,onUpdate:d,autoFocus:O,theme:f="light",height:p,minHeight:m,maxHeight:g,width:y,minWidth:$,maxWidth:v,basicSetup:b,placeholder:S,indentWithTab:w,editable:x,readOnly:Q,root:P,initialState:_}=t,k=(0,a.A)(t,Pf),T=(0,i.useRef)(null),{state:C,view:z,container:R}=function(t){var{value:e,selection:n,onChange:r,onStatistics:o,onCreateEditor:s,onUpdate:a,extensions:l=xf,autoFocus:c,theme:u="light",height:h=null,minHeight:d=null,maxHeight:O=null,width:f=null,minWidth:p=null,maxWidth:m=null,placeholder:g="",editable:y=!0,readOnly:$=!1,indentWithTab:v=!0,basicSetup:b=!0,root:S,initialState:w}=t,[x,Q]=(0,i.useState)(),[P,_]=(0,i.useState)(),[k,T]=(0,i.useState)(),C=no.theme({"&":{height:h,minHeight:d,maxHeight:O,width:f,minWidth:p,maxWidth:m},"& .cm-scroller":{height:"100% !important"}}),z=no.updateListener.of((t=>{if(t.docChanged&&"function"==typeof r&&!t.transactions.some((t=>t.annotation(wf)))){var e=t.state.doc.toString();r(e,t)}o&&o((t=>({line:t.state.doc.lineAt(t.state.selection.main.from),lineCount:t.state.doc.lines,lineBreak:t.state.lineBreak,length:t.state.doc.length,readOnly:t.state.readOnly,tabSize:t.state.tabSize,selection:t.state.selection,selectionAsSingle:t.state.selection.asSingle().main,ranges:t.state.selection.ranges,selectionCode:t.state.sliceDoc(t.state.selection.main.from,t.state.selection.main.to),selections:t.state.selection.ranges.map((e=>t.state.sliceDoc(e.from,e.to))),selectedText:t.state.selection.ranges.some((t=>!t.empty))}))(t))})),R=[z,C,...Sf({theme:u,editable:y,readOnly:$,placeholder:g,indentWithTab:v,basicSetup:b})];return a&&"function"==typeof a&&R.push(no.updateListener.of(a)),R=R.concat(l),(0,i.useEffect)((()=>{if(x&&!k){var t={doc:e,selection:n,extensions:R},i=w?Pt.fromJSON(w.json,t,w.fields):Pt.create(t);if(T(i),!P){var r=new no({state:i,parent:x,root:S});_(r),s&&s(r,i)}}return()=>{P&&(T(void 0),_(void 0))}}),[x,k]),(0,i.useEffect)((()=>Q(t.container)),[t.container]),(0,i.useEffect)((()=>()=>{P&&(P.destroy(),_(void 0))}),[P]),(0,i.useEffect)((()=>{c&&P&&P.focus()}),[c,P]),(0,i.useEffect)((()=>{P&&P.dispatch({effects:pt.reconfigure.of(R)})}),[u,l,h,d,O,f,p,m,g,y,$,v,b,r,a]),(0,i.useEffect)((()=>{if(void 0!==e){var t=P?P.state.doc.toString():"";P&&e!==t&&P.dispatch({changes:{from:0,to:t.length,insert:e||""},annotations:[wf.of(!0)]})}}),[e,P]),{state:k,setState:T,view:P,setView:_,container:x,setContainer:Q}}({container:T.current,root:P,value:r,autoFocus:O,theme:f,height:p,minHeight:m,maxHeight:g,width:y,minWidth:$,maxWidth:v,basicSetup:b,placeholder:S,indentWithTab:w,editable:x,readOnly:Q,selection:o,onChange:c,onStatistics:u,onCreateEditor:h,onUpdate:d,extensions:l,initialState:_});if((0,i.useImperativeHandle)(e,(()=>({editor:T.current,state:C,view:z})),[T,R,C,z]),"string"!=typeof r)throw new Error("value must be typeof string but got "+typeof r);var E="string"==typeof f?"cm-theme-"+f:"cm-theme";return(0,Qf.jsx)("div",(0,s.A)({ref:T,className:E+(n?" "+n:"")},k))}));_f.displayName="CodeMirror";const kf=_f;var Tf=t=>{var{theme:e,settings:n={},styles:i=[]}=t,r={".cm-gutters":{}},o={};n.background&&(o.backgroundColor=n.background),n.backgroundImage&&(o.backgroundImage=n.backgroundImage),n.foreground&&(o.color=n.foreground),n.fontSize&&(o.fontSize=n.fontSize),(n.background||n.foreground)&&(r["&"]=o),n.fontFamily&&(r["&.cm-editor .cm-scroller"]={fontFamily:n.fontFamily}),n.gutterBackground&&(r[".cm-gutters"].backgroundColor=n.gutterBackground),n.gutterForeground&&(r[".cm-gutters"].color=n.gutterForeground),n.gutterBorder&&(r[".cm-gutters"].borderRightColor=n.gutterBorder),n.caret&&(r[".cm-content"]={caretColor:n.caret},r[".cm-cursor, .cm-dropCursor"]={borderLeftColor:n.caret});var s={};return n.gutterActiveForeground&&(s.color=n.gutterActiveForeground),n.lineHighlight&&(r[".cm-activeLine"]={backgroundColor:n.lineHighlight},s.backgroundColor=n.lineHighlight),r[".cm-activeLineGutter"]=s,n.selection&&(r["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:n.selection+" !important"}),n.selectionMatch&&(r["& .cm-selectionMatch"]={backgroundColor:n.selectionMatch}),[no.theme(r,{dark:"dark"===e}),gc(Oc.define(i))]},Cf={background:"#ffffff",foreground:"#383a42",caret:"#000",selection:"#add6ff",selectionMatch:"#a8ac94",lineHighlight:"#99999926",gutterBackground:"#fff",gutterForeground:"#237893",gutterActiveForeground:"#0b216f",fontFamily:'Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace'},zf=[{tag:[ll.keyword,ll.operatorKeyword,ll.modifier,ll.color,ll.constant(ll.name),ll.standard(ll.name),ll.standard(ll.tagName),ll.special(ll.brace),ll.atom,ll.bool,ll.special(ll.variableName)],color:"#0000ff"},{tag:[ll.moduleKeyword,ll.controlKeyword],color:"#af00db"},{tag:[ll.name,ll.deleted,ll.character,ll.macroName,ll.propertyName,ll.variableName,ll.labelName,ll.definition(ll.name)],color:"#0070c1"},{tag:ll.heading,fontWeight:"bold",color:"#0070c1"},{tag:[ll.typeName,ll.className,ll.tagName,ll.number,ll.changed,ll.annotation,ll.self,ll.namespace],color:"#267f99"},{tag:[ll.function(ll.variableName),ll.function(ll.propertyName)],color:"#795e26"},{tag:[ll.number],color:"#098658"},{tag:[ll.operator,ll.punctuation,ll.separator,ll.url,ll.escape,ll.regexp],color:"#383a42"},{tag:[ll.regexp],color:"#af00db"},{tag:[ll.special(ll.string),ll.processingInstruction,ll.string,ll.inserted],color:"#a31515"},{tag:[ll.angleBracket],color:"#383a42"},{tag:ll.strong,fontWeight:"bold"},{tag:ll.emphasis,fontStyle:"italic"},{tag:ll.strikethrough,textDecoration:"line-through"},{tag:[ll.meta,ll.comment],color:"#008000"},{tag:ll.link,color:"#4078f2",textDecoration:"underline"},{tag:ll.invalid,color:"#e45649"}];!function(){var{theme:t="light",settings:e={},styles:n=[]}={};Tf({theme:t,settings:(0,s.A)({},Cf,e),styles:[...zf,...n]})}();var Rf={background:"#1e1e1e",foreground:"#9cdcfe",caret:"#c6c6c6",selection:"#6199ff2f",selectionMatch:"#72a1ff59",lineHighlight:"#ffffff0f",gutterBackground:"#1e1e1e",gutterForeground:"#838383",gutterActiveForeground:"#fff",fontFamily:'Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace'},Ef=[{tag:[ll.keyword,ll.operatorKeyword,ll.modifier,ll.color,ll.constant(ll.name),ll.standard(ll.name),ll.standard(ll.tagName),ll.special(ll.brace),ll.atom,ll.bool,ll.special(ll.variableName)],color:"#569cd6"},{tag:[ll.controlKeyword,ll.moduleKeyword],color:"#c586c0"},{tag:[ll.name,ll.deleted,ll.character,ll.macroName,ll.propertyName,ll.variableName,ll.labelName,ll.definition(ll.name)],color:"#9cdcfe"},{tag:ll.heading,fontWeight:"bold",color:"#9cdcfe"},{tag:[ll.typeName,ll.className,ll.tagName,ll.number,ll.changed,ll.annotation,ll.self,ll.namespace],color:"#4ec9b0"},{tag:[ll.function(ll.variableName),ll.function(ll.propertyName)],color:"#dcdcaa"},{tag:[ll.number],color:"#b5cea8"},{tag:[ll.operator,ll.punctuation,ll.separator,ll.url,ll.escape,ll.regexp],color:"#d4d4d4"},{tag:[ll.regexp],color:"#d16969"},{tag:[ll.special(ll.string),ll.processingInstruction,ll.string,ll.inserted],color:"#ce9178"},{tag:[ll.angleBracket],color:"#808080"},{tag:ll.strong,fontWeight:"bold"},{tag:ll.emphasis,fontStyle:"italic"},{tag:ll.strikethrough,textDecoration:"line-through"},{tag:[ll.meta,ll.comment],color:"#6a9955"},{tag:ll.link,color:"#6a9955",textDecoration:"underline"},{tag:ll.invalid,color:"#ff0000"}],Af=function(){var{theme:t="dark",settings:e={},styles:n=[]}={};return Tf({theme:t,settings:(0,s.A)({},Rf,e),styles:[...Ef,...n]})}();class Zf{constructor(t,e,n,i,r,o,s,a,l,c=0,u){this.p=t,this.stack=e,this.state=n,this.reducePos=i,this.pos=r,this.score=o,this.buffer=s,this.bufferBase=a,this.curContext=l,this.lookAhead=c,this.parent=u}toString(){return`[${this.stack.filter(((t,e)=>e%3==0)).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(t,e,n=0){let i=t.parser.context;return new Zf(t,[],e,n,n,0,[],0,i?new Mf(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(t,e){this.stack.push(this.state,e,this.bufferBase+this.buffer.length),this.state=t}reduce(t){var e;let n=t>>19,i=65535&t,{parser:r}=this.p,o=this.reducePos=2e3&&!(null===(e=this.p.parser.nodeSet.types[i])||void 0===e?void 0:e.isAnonymous)&&(l==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSizea;)this.stack.pop();this.reduceContext(i,l)}storeNode(t,e,n,i=4,r=!1){if(0==t&&(!this.stack.length||this.stack[this.stack.length-1]0&&0==t.buffer[i-4]&&t.buffer[i-1]>-1){if(e==n)return;if(t.buffer[i-2]>=e)return void(t.buffer[i-2]=n)}}if(r&&this.pos!=n){let r=this.buffer.length;if(r>0&&0!=this.buffer[r-4]){let t=!1;for(let e=r;e>0&&this.buffer[e-2]>n;e-=4)if(this.buffer[e-1]>=0){t=!0;break}if(t)for(;r>0&&this.buffer[r-2]>n;)this.buffer[r]=this.buffer[r-4],this.buffer[r+1]=this.buffer[r-3],this.buffer[r+2]=this.buffer[r-2],this.buffer[r+3]=this.buffer[r-1],r-=4,i>4&&(i-=4)}this.buffer[r]=t,this.buffer[r+1]=e,this.buffer[r+2]=n,this.buffer[r+3]=i}else this.buffer.push(t,e,n,i)}shift(t,e,n,i){if(131072&t)this.pushState(65535&t,this.pos);else if(262144&t)this.pos=i,this.shiftContext(e,n),e<=this.p.parser.maxNode&&this.buffer.push(e,n,i,4);else{let r=t,{parser:o}=this.p;(i>this.pos||e<=o.maxNode)&&(this.pos=i,o.stateFlag(r,1)||(this.reducePos=i)),this.pushState(r,n),this.shiftContext(e,n),e<=o.maxNode&&this.buffer.push(e,n,i,4)}}apply(t,e,n,i){65536&t?this.reduce(t):this.shift(t,e,n,i)}useNode(t,e){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=t)&&(this.p.reused.push(t),n++);let i=this.pos;this.reducePos=this.pos=i+t.length,this.pushState(e,i),this.buffer.push(n,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,t,this,this.p.stream.reset(this.pos-t.length)))}split(){let t=this,e=t.buffer.length;for(;e>0&&t.buffer[e-2]>t.reducePos;)e-=4;let n=t.buffer.slice(e),i=t.bufferBase+e;for(;t&&i==t.bufferBase;)t=t.parent;return new Zf(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,i,this.curContext,this.lookAhead,t)}recoverByDelete(t,e){let n=t<=this.p.parser.maxNode;n&&this.storeNode(t,this.pos,e,4),this.storeNode(0,this.pos,e,n?8:4),this.pos=this.reducePos=e,this.score-=190}canShift(t){for(let e=new Vf(this);;){let n=this.p.parser.stateSlot(e.state,4)||this.p.parser.hasAction(e.state,t);if(0==n)return!1;if(!(65536&n))return!0;e.reduce(n)}}recoverByInsert(t){if(this.stack.length>=300)return[];let e=this.p.parser.nextStates(this.state);if(e.length>8||this.stack.length>=120){let n=[];for(let i,r=0;r1&e&&t==i))||n.push(e[t],i)}e=n}let n=[];for(let t=0;t>19,i=65535&e,r=this.stack.length-3*n;if(r<0||t.getGoto(this.stack[r],i,!1)<0){let t=this.findForcedReduction();if(null==t)return!1;e=t}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(e),!0}findForcedReduction(){let{parser:t}=this.p,e=[],n=(i,r)=>{if(!e.includes(i))return e.push(i),t.allActions(i,(e=>{if(393216&e);else if(65536&e){let n=(e>>19)-r;if(n>1){let i=65535&e,r=this.stack.length-3*n;if(r>=0&&t.getGoto(this.stack[r],i,!1)>=0)return n<<19|65536|i}}else{let t=n(e,r+1);if(null!=t)return t}}))};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(3!=this.stack.length)return!1;let{parser:t}=this.p;return 65535==t.data[t.stateSlot(this.state,1)]&&!t.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(t){if(this.state!=t.state||this.stack.length!=t.stack.length)return!1;for(let e=0;ethis.lookAhead&&(this.emitLookAhead(),this.lookAhead=t)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class Mf{constructor(t,e){this.tracker=t,this.context=e,this.hash=t.strict?t.hash(e):0}}class Vf{constructor(t){this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}reduce(t){let e=65535&t,n=t>>19;0==n?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=3*(n-1);let i=this.start.p.parser.getGoto(this.stack[this.base-3],e,!0);this.state=i}}class Xf{constructor(t,e,n){this.stack=t,this.pos=e,this.index=n,this.buffer=t.buffer,0==this.index&&this.maybeNext()}static create(t,e=t.bufferBase+t.buffer.length){return new Xf(t,e,e-t.bufferBase)}maybeNext(){let t=this.stack.parent;null!=t&&(this.index=this.stack.bufferBase-t.bufferBase,this.stack=t,this.buffer=t.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new Xf(this.stack,this.pos,this.index)}}function qf(t,e=Uint16Array){if("string"!=typeof t)return t;let n=null;for(let i=0,r=0;i=92&&e--,e>=34&&e--;let r=e-32;if(r>=46&&(r-=46,n=!0),o+=r,n)break;o*=46}n?n[r++]=o:n=new e(o)}return n}class Wf{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const jf=new Wf;class If{constructor(t,e){this.input=t,this.ranges=e,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=jf,this.rangeIndex=0,this.pos=this.chunkPos=e[0].from,this.range=e[0],this.end=e[e.length-1].to,this.readNext()}resolveOffset(t,e){let n=this.range,i=this.rangeIndex,r=this.pos+t;for(;rn.to:r>=n.to;){if(i==this.ranges.length-1)return null;let t=this.ranges[++i];r+=t.from-n.to,n=t}return r}clipPos(t){if(t>=this.range.from&&tt)return Math.max(t,e.from);return this.end}peek(t){let e,n,i=this.chunkOff+t;if(i>=0&&i=this.chunk2Pos&&ei.to&&(this.chunk2=this.chunk2.slice(0,i.to-e)),n=this.chunk2.charCodeAt(0)}}return e>=this.token.lookAhead&&(this.token.lookAhead=e+1),n}acceptToken(t,e=0){let n=e?this.resolveOffset(e,-1):this.pos;if(null==n||n=this.chunk2Pos&&this.posthis.range.to?t.slice(0,this.range.to-this.pos):t,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(t=1){for(this.chunkOff+=t;this.pos+t>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();t-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=t,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(t,e){if(e?(this.token=e,e.start=t,e.lookAhead=t+1,e.value=e.extended=-1):this.token=jf,this.pos!=t){if(this.pos=t,t==this.end)return this.setDone(),this;for(;t=this.range.to;)this.range=this.ranges[++this.rangeIndex];t>=this.chunkPos&&t=this.chunkPos&&e<=this.chunkPos+this.chunk.length)return this.chunk.slice(t-this.chunkPos,e-this.chunkPos);if(t>=this.chunk2Pos&&e<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(t-this.chunk2Pos,e-this.chunk2Pos);if(t>=this.range.from&&e<=this.range.to)return this.input.read(t,e);let n="";for(let i of this.ranges){if(i.from>=e)break;i.to>t&&(n+=this.input.read(Math.max(i.from,t),Math.min(i.to,e)))}return n}}class Lf{constructor(t,e){this.data=t,this.id=e}token(t,e){let{parser:n}=e.p;Df(this.data,t,e,this.id,n.data,n.tokenPrecTable)}}Lf.prototype.contextual=Lf.prototype.fallback=Lf.prototype.extend=!1;class Nf{constructor(t,e,n){this.precTable=e,this.elseToken=n,this.data="string"==typeof t?qf(t):t}token(t,e){let n=t.pos,i=0;for(;;){let n=t.next<0,r=t.resolveOffset(1,1);if(Df(this.data,t,e,0,this.data,this.precTable),t.token.value>-1)break;if(null==this.elseToken)return;if(n||i++,null==r)break;t.reset(r,t.token)}i&&(t.reset(n,t.token),t.acceptToken(this.elseToken,i))}}Nf.prototype.contextual=Lf.prototype.fallback=Lf.prototype.extend=!1;class Uf{constructor(t,e={}){this.token=t,this.contextual=!!e.contextual,this.fallback=!!e.fallback,this.extend=!!e.extend}}function Df(t,e,n,i,r,o){let s=0,a=1<0){let n=t[i];if(l.allows(n)&&(-1==e.token.value||e.token.value==n||Bf(n,e.token.value,r,o))){e.acceptToken(n);break}}let i=e.next,c=0,u=t[s+2];if(!(e.next<0&&u>c&&65535==t[n+3*u-3])){for(;c>1,o=n+r+(r<<1),a=t[o],l=t[o+1]||65536;if(i=l)){s=t[o+2],e.advance();continue t}c=r+1}}break}s=t[n+3*u-1]}}function Yf(t,e,n){for(let i,r=e;65535!=(i=t[r]);r++)if(i==n)return r-e;return-1}function Bf(t,e,n,i){let r=Yf(n,i,e);return r<0||Yf(n,i,t)e)&&!i.type.isError)return n<0?Math.max(0,Math.min(i.to-1,e-25)):Math.min(t.length,Math.max(i.from+1,e+25));if(n<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return n<0?0:t.length}}class Kf{constructor(t,e){this.fragments=t,this.nodeSet=e,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let t=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(t){for(this.safeFrom=t.openStart?Hf(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?Hf(t.tree,t.to+t.offset,-1)-t.offset:t.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(t.tree),this.start.push(-t.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(tt)return this.nextStart=o,null;if(r instanceof ea){if(o==t){if(o=Math.max(this.safeFrom,t)&&(this.trees.push(r),this.start.push(o),this.index.push(0))}else this.index[e]++,this.nextStart=o+r.length}}}class Jf{constructor(t,e){this.stream=e,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map((t=>new Wf))}getActions(t){let e=0,n=null,{parser:i}=t.p,{tokenizers:r}=i,o=i.stateSlot(t.state,3),s=t.curContext?t.curContext.hash:0,a=0;for(let i=0;ic.end+25&&(a=Math.max(c.lookAhead,a)),0!=c.value)){let i=e;if(c.extended>-1&&(e=this.addActions(t,c.extended,c.end,e)),e=this.addActions(t,c.value,c.end,e),!l.extend&&(n=c,e>i))break}}for(;this.actions.length>e;)this.actions.pop();return a&&t.setLookAhead(a),n||t.pos!=this.stream.end||(n=new Wf,n.value=t.p.parser.eofTerm,n.start=n.end=t.pos,e=this.addActions(t,n.value,n.end,e)),this.mainToken=n,this.actions}getMainToken(t){if(this.mainToken)return this.mainToken;let e=new Wf,{pos:n,p:i}=t;return e.start=n,e.end=Math.min(n+1,i.stream.end),e.value=n==i.stream.end?i.parser.eofTerm:0,e}updateCachedToken(t,e,n){let i=this.stream.clipPos(n.pos);if(e.token(this.stream.reset(i,t),n),t.value>-1){let{parser:e}=n.p;for(let i=0;i=0&&n.p.parser.dialect.allows(r>>1)){1&r?t.extended=r>>1:t.value=r>>1;break}}}else t.value=0,t.end=this.stream.clipPos(i+1)}putAction(t,e,n,i){for(let e=0;e4*t.bufferLength?new Kf(n,t.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let t,e,n=this.stacks,i=this.minStackPos,r=this.stacks=[];if(this.bigReductionCount>300&&1==n.length){let[t]=n;for(;t.forceReduce()&&t.stack.length&&t.stack[t.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;oi)r.push(s);else{if(this.advanceStack(s,r,n))continue;{t||(t=[],e=[]),t.push(s);let n=this.tokens.getMainToken(s);e.push(n.value,n.end)}}break}}if(!r.length){let e=t&&function(t){let e=null;for(let n of t){let t=n.p.stoppedAt;(n.pos==n.p.stream.end||null!=t&&n.pos>t)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.scorethis.stoppedAt?t[0]:this.runRecovery(t,e,r);if(n)return Gf&&console.log("Force-finish "+this.stackID(n)),this.stackToTree(n.forceAll())}if(this.recovering){let t=1==this.recovering?1:3*this.recovering;if(r.length>t)for(r.sort(((t,e)=>e.score-t.score));r.length>t;)r.pop();r.some((t=>t.reducePos>i))&&this.recovering--}else if(r.length>1){t:for(let t=0;t500&&i.buffer.length>500){if(!((e.score-i.score||e.buffer.length-i.buffer.length)>0)){r.splice(t--,1);continue t}r.splice(n--,1)}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let t=1;t ":"";if(null!=this.stoppedAt&&i>this.stoppedAt)return t.forceReduce()?t:null;if(this.fragments){let e=t.curContext&&t.curContext.tracker.strict,n=e?t.curContext.hash:0;for(let s=this.fragments.nodeAt(i);s;){let i=this.parser.nodeSet.types[s.type.id]==s.type?r.getGoto(t.state,s.type.id):-1;if(i>-1&&s.length&&(!e||(s.prop(Ys.contextHash)||0)==n))return t.useNode(s,i),Gf&&console.log(o+this.stackID(t)+` (via reuse of ${r.getName(s.type.id)})`),!0;if(!(s instanceof ea)||0==s.children.length||s.positions[0]>0)break;let a=s.children[0];if(!(a instanceof ea&&0==s.positions[0]))break;s=a}}let s=r.stateSlot(t.state,4);if(s>0)return t.reduce(s),Gf&&console.log(o+this.stackID(t)+` (via always-reduce ${r.getName(65535&s)})`),!0;if(t.stack.length>=8400)for(;t.stack.length>6e3&&t.forceReduce(););let a=this.tokens.getActions(t);for(let s=0;si?e.push(d):n.push(d)}return!1}advanceFully(t,e){let n=t.pos;for(;;){if(!this.advanceStack(t,null,null))return!1;if(t.pos>n)return ep(t,e),!0}}runRecovery(t,e,n){let i=null,r=!1;for(let o=0;o ":"";if(s.deadEnd){if(r)continue;if(r=!0,s.restart(),Gf&&console.log(c+this.stackID(s)+" (restarted)"),this.advanceFully(s,n))continue}let u=s.split(),h=c;for(let t=0;u.forceReduce()&&t<10&&(Gf&&console.log(h+this.stackID(u)+" (via force-reduce)"),!this.advanceFully(u,n));t++)Gf&&(h=this.stackID(u)+" -> ");for(let t of s.recoverByInsert(a))Gf&&console.log(c+this.stackID(t)+" (via recover-insert)"),this.advanceFully(t,n);this.stream.end>s.pos?(l==s.pos&&(l++,a=0),s.recoverByDelete(a,l),Gf&&console.log(c+this.stackID(s)+` (via recover-delete ${this.parser.getName(a)})`),ep(s,n)):(!i||i.scoret;class rp{constructor(t){this.start=t.start,this.shift=t.shift||ip,this.reduce=t.reduce||ip,this.reuse=t.reuse||ip,this.hash=t.hash||(()=>0),this.strict=!1!==t.strict}}class op extends ba{constructor(t){if(super(),this.wrappers=[],14!=t.version)throw new RangeError(`Parser version (${t.version}) doesn't match runtime version (14)`);let e=t.nodeNames.split(" ");this.minRepeatTerm=e.length;for(let n=0;nt.topRules[e][1])),i=[];for(let t=0;t=0)r(i,t,e[n++]);else{let o=e[n+-i];for(let s=-i;s>0;s--)r(e[n++],t,o);n++}}}this.nodeSet=new Hs(e.map(((e,r)=>Fs.define({name:r>=this.minRepeatTerm?void 0:e,id:r,props:i[r],top:n.indexOf(r)>-1,error:0==r,skipped:t.skippedNodes&&t.skippedNodes.indexOf(r)>-1})))),t.propSources&&(this.nodeSet=this.nodeSet.extend(...t.propSources)),this.strict=!1,this.bufferLength=Ns;let o=qf(t.tokenData);this.context=t.context,this.specializerSpecs=t.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let t=0;t"number"==typeof t?new Lf(o,t):t)),this.topRules=t.topRules,this.dialects=t.dialects||{},this.dynamicPrecedences=t.dynamicPrecedences||null,this.tokenPrecTable=t.tokenPrec,this.termNames=t.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(t,e,n){let i=new tp(this,t,e,n);for(let r of this.wrappers)i=r(i,t,e,n);return i}getGoto(t,e,n=!1){let i=this.goto;if(e>=i[0])return-1;for(let r=i[e+1];;){let e=i[r++],o=1&e,s=i[r++];if(o&&n)return s;for(let n=r+(e>>1);r0}validAction(t,e){return!!this.allActions(t,(t=>t==e||null))}allActions(t,e){let n=this.stateSlot(t,4),i=n?e(n):void 0;for(let n=this.stateSlot(t,1);null==i;n+=3){if(65535==this.data[n]){if(1!=this.data[n+1])break;n=sp(this.data,n+2)}i=e(sp(this.data,n+1))}return i}nextStates(t){let e=[];for(let n=this.stateSlot(t,1);;n+=3){if(65535==this.data[n]){if(1!=this.data[n+1])break;n=sp(this.data,n+2)}if(!(1&this.data[n+2])){let t=this.data[n+1];e.some(((e,n)=>1&n&&e==t))||e.push(this.data[n],t)}}return e}configure(t){let e=Object.assign(Object.create(op.prototype),this);if(t.props&&(e.nodeSet=this.nodeSet.extend(...t.props)),t.top){let n=this.topRules[t.top];if(!n)throw new RangeError(`Invalid top rule name ${t.top}`);e.top=n}return t.tokenizers&&(e.tokenizers=this.tokenizers.map((e=>{let n=t.tokenizers.find((t=>t.from==e));return n?n.to:e}))),t.specializers&&(e.specializers=this.specializers.slice(),e.specializerSpecs=this.specializerSpecs.map(((n,i)=>{let r=t.specializers.find((t=>t.from==n.external));if(!r)return n;let o=Object.assign(Object.assign({},n),{external:r.to});return e.specializers[i]=ap(o),o}))),t.contextTracker&&(e.context=t.contextTracker),t.dialect&&(e.dialect=this.parseDialect(t.dialect)),null!=t.strict&&(e.strict=t.strict),t.wrap&&(e.wrappers=e.wrappers.concat(t.wrap)),null!=t.bufferLength&&(e.bufferLength=t.bufferLength),e}hasWrappers(){return this.wrappers.length>0}getName(t){return this.termNames?this.termNames[t]:String(t<=this.maxNode&&this.nodeSet.types[t].name||t)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(t){let e=this.dynamicPrecedences;return null==e?0:e[t]||0}parseDialect(t){let e=Object.keys(this.dialects),n=e.map((()=>!1));if(t)for(let i of t.split(" ")){let t=e.indexOf(i);t>=0&&(n[t]=!0)}let i=null;for(let t=0;tt.external(n,i)<<1|e}return t.get}const lp=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],cp=new rp({start:!1,shift:(t,e)=>5==e||6==e||316==e?t:317==e,strict:!1}),up=new Uf(((t,e)=>{let{next:n}=t;(125==n||-1==n||e.context)&&t.acceptToken(314)}),{contextual:!0,fallback:!0}),hp=new Uf(((t,e)=>{let n,{next:i}=t;lp.indexOf(i)>-1||(47!=i||47!=(n=t.peek(1))&&42!=n)&&(125==i||59==i||-1==i||e.context||t.acceptToken(312))}),{contextual:!0}),dp=new Uf(((t,e)=>{91!=t.next||e.context||t.acceptToken(313)}),{contextual:!0}),Op=new Uf(((t,e)=>{let{next:n}=t;if(43==n||45==n){if(t.advance(),n==t.next){t.advance();let n=!e.context&&e.canShift(1);t.acceptToken(n?1:2)}}else 63==n&&46==t.peek(1)&&(t.advance(),t.advance(),(t.next<48||t.next>57)&&t.acceptToken(3))}),{contextual:!0});function fp(t,e){return t>=65&&t<=90||t>=97&&t<=122||95==t||t>=192||!e&&t>=48&&t<=57}const pp=new Uf(((t,e)=>{if(60!=t.next||!e.dialectEnabled(0))return;if(t.advance(),47==t.next)return;let n=0;for(;lp.indexOf(t.next)>-1;)t.advance(),n++;if(fp(t.next,!0)){for(t.advance(),n++;fp(t.next,!1);)t.advance(),n++;for(;lp.indexOf(t.next)>-1;)t.advance(),n++;if(44==t.next)return;for(let e=0;;e++){if(7==e){if(!fp(t.next,!0))return;break}if(t.next!="extends".charCodeAt(e))break;t.advance(),n++}}t.acceptToken(4,-n)})),mp=ja({"get set async static":ll.modifier,"for while do if else switch try catch finally return throw break continue default case":ll.controlKeyword,"in of await yield void typeof delete instanceof":ll.operatorKeyword,"let var const using function class extends":ll.definitionKeyword,"import export from":ll.moduleKeyword,"with debugger as new":ll.keyword,TemplateString:ll.special(ll.string),super:ll.atom,BooleanLiteral:ll.bool,this:ll.self,null:ll.null,Star:ll.modifier,VariableName:ll.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":ll.function(ll.variableName),VariableDefinition:ll.definition(ll.variableName),Label:ll.labelName,PropertyName:ll.propertyName,PrivatePropertyName:ll.special(ll.propertyName),"CallExpression/MemberExpression/PropertyName":ll.function(ll.propertyName),"FunctionDeclaration/VariableDefinition":ll.function(ll.definition(ll.variableName)),"ClassDeclaration/VariableDefinition":ll.definition(ll.className),PropertyDefinition:ll.definition(ll.propertyName),PrivatePropertyDefinition:ll.definition(ll.special(ll.propertyName)),UpdateOp:ll.updateOperator,"LineComment Hashbang":ll.lineComment,BlockComment:ll.blockComment,Number:ll.number,String:ll.string,Escape:ll.escape,ArithOp:ll.arithmeticOperator,LogicOp:ll.logicOperator,BitOp:ll.bitwiseOperator,CompareOp:ll.compareOperator,RegExp:ll.regexp,Equals:ll.definitionOperator,Arrow:ll.function(ll.punctuation),": Spread":ll.punctuation,"( )":ll.paren,"[ ]":ll.squareBracket,"{ }":ll.brace,"InterpolationStart InterpolationEnd":ll.special(ll.brace),".":ll.derefOperator,", ;":ll.separator,"@":ll.meta,TypeName:ll.typeName,TypeDefinition:ll.definition(ll.typeName),"type enum interface implements namespace module declare":ll.definitionKeyword,"abstract global Privacy readonly override":ll.modifier,"is keyof unique infer":ll.operatorKeyword,JSXAttributeValue:ll.attributeValue,JSXText:ll.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":ll.angleBracket,"JSXIdentifier JSXNameSpacedName":ll.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":ll.attributeName,"JSXBuiltin/JSXIdentifier":ll.standard(ll.tagName)}),gp={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,extends:54,this:58,true:66,false:66,null:78,void:82,typeof:86,super:102,new:136,delete:148,yield:157,await:161,class:166,public:229,private:229,protected:229,readonly:231,instanceof:250,satisfies:253,in:254,const:256,import:290,keyof:345,unique:349,infer:355,is:391,abstract:411,implements:413,type:415,let:418,var:420,using:423,interface:429,enum:433,namespace:439,module:441,declare:445,global:449,for:468,of:477,while:480,with:484,do:488,if:492,else:494,switch:498,case:504,try:510,catch:514,finally:518,return:522,throw:526,break:530,continue:534,debugger:538},yp={__proto__:null,async:123,get:125,set:127,declare:189,public:191,private:191,protected:191,static:193,abstract:195,override:197,readonly:203,accessor:205,new:395},$p={__proto__:null,"<":187},vp=op.deserialize({version:14,states:"$CdQ%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#D^O.QQlO'#DdO.bQlO'#DoO%[QlO'#DwO0fQlO'#EPOOQ!0Lf'#EX'#EXO1PQ`O'#EUOOQO'#Em'#EmOOQO'#Ih'#IhO1XQ`O'#GpO1dQ`O'#ElO1iQ`O'#ElO3hQ!0MxO'#JnO6[Q!0MxO'#JoO6uQ`O'#F[O6zQ,UO'#FsOOQ!0Lf'#Fe'#FeO7VO7dO'#FeO7eQMhO'#FzO9RQ`O'#FyOOQ!0Lf'#Jo'#JoOOQ!0Lb'#Jn'#JnO9WQ`O'#GtOOQ['#K['#K[O9cQ`O'#IUO9hQ!0LrO'#IVOOQ['#J['#J[OOQ['#IZ'#IZQ`QlOOQ`QlOOO9pQ!L^O'#DsO9wQlO'#D{O:OQlO'#D}O9^Q`O'#GpO:VQMhO'#CoO:eQ`O'#EkO:pQ`O'#EvO:uQMhO'#FdO;dQ`O'#GpOOQO'#K]'#K]O;iQ`O'#K]O;wQ`O'#GxO;wQ`O'#GyO;wQ`O'#G{O9^Q`O'#HOOVQ`O'#CeO>gQ`O'#H_O>oQ`O'#HeO>oQ`O'#HgO`QlO'#HiO>oQ`O'#HkO>oQ`O'#HnO>tQ`O'#HtO>yQ!0LsO'#HzO%[QlO'#H|O?UQ!0LsO'#IOO?aQ!0LsO'#IQO9hQ!0LrO'#ISO?lQ!0MxO'#CiO@nQpO'#DiQOQ`OOO%[QlO'#D}OAUQ`O'#EQO:VQMhO'#EkOAaQ`O'#EkOAlQ!bO'#FdOOQ['#Cg'#CgOOQ!0Lb'#Dn'#DnOOQ!0Lb'#Jr'#JrO%[QlO'#JrOOQO'#Ju'#JuOOQO'#Id'#IdOBlQpO'#EdOOQ!0Lb'#Ec'#EcOOQ!0Lb'#Jy'#JyOChQ!0MSO'#EdOCrQpO'#ETOOQO'#Jt'#JtODWQpO'#JuOEeQpO'#ETOCrQpO'#EdPErO&2DjO'#CbPOOO)CDy)CDyOOOO'#I['#I[OE}O#tO,59UOOQ!0Lh,59U,59UOOOO'#I]'#I]OF]O&jO,59UOFkQ!L^O'#D`OOOO'#I_'#I_OFrO#@ItO,59xOOQ!0Lf,59x,59xOGQQlO'#I`OGeQ`O'#JpOIdQ!fO'#JpO+}QlO'#JpOIkQ`O,5:OOJRQ`O'#EmOJ`Q`O'#KPOJkQ`O'#KOOJkQ`O'#KOOJsQ`O,5;ZOJxQ`O'#J}OOQ!0Ln,5:Z,5:ZOKPQlO,5:ZOL}Q!0MxO,5:cOMnQ`O,5:kONXQ!0LrO'#J|ON`Q`O'#J{O9WQ`O'#J{ONtQ`O'#J{ON|Q`O,5;YO! RQ`O'#J{O!#WQ!fO'#JoOOQ!0Lh'#Ci'#CiO%[QlO'#EPO!#vQ!fO,5:pOOQS'#Jv'#JvOOQO-EpOOQ['#Jd'#JdOOQ[,5>q,5>qOOQ[-E[Q!0MxO,5:gO%[QlO,5:gO!@rQ!0MxO,5:iOOQO,5@w,5@wO!AcQMhO,5=[O!AqQ!0LrO'#JeO9RQ`O'#JeO!BSQ!0LrO,59ZO!B_QpO,59ZO!BgQMhO,59ZO:VQMhO,59ZO!BrQ`O,5;WO!BzQ`O'#H^O!C`Q`O'#KaO%[QlO,5;|O!9fQpO,5tQ`O'#HTO9^Q`O'#HVO!DwQ`O'#HVO:VQMhO'#HXO!D|Q`O'#HXOOQ[,5=m,5=mO!ERQ`O'#HYO!EdQ`O'#CoO!EiQ`O,59PO!EsQ`O,59PO!GxQlO,59POOQ[,59P,59PO!HYQ!0LrO,59PO%[QlO,59PO!JeQlO'#HaOOQ['#Hb'#HbOOQ['#Hc'#HcO`QlO,5=yO!J{Q`O,5=yO`QlO,5>PO`QlO,5>RO!KQQ`O,5>TO`QlO,5>VO!KVQ`O,5>YO!K[QlO,5>`OOQ[,5>f,5>fO%[QlO,5>fO9hQ!0LrO,5>hOOQ[,5>j,5>jO# fQ`O,5>jOOQ[,5>l,5>lO# fQ`O,5>lOOQ[,5>n,5>nO#!SQpO'#D[O%[QlO'#JrO#!uQpO'#JrO##PQpO'#DjO##bQpO'#DjO#%sQlO'#DjO#%zQ`O'#JqO#&SQ`O,5:TO#&XQ`O'#EqO#&gQ`O'#KQO#&oQ`O,5;[O#&tQpO'#DjO#'RQpO'#ESOOQ!0Lf,5:l,5:lO%[QlO,5:lO#'YQ`O,5:lO>tQ`O,5;VO!B_QpO,5;VO!BgQMhO,5;VO:VQMhO,5;VO#'bQ`O,5@^O#'gQ07dO,5:pOOQO-EzO+}QlO,5>zOOQO,5?Q,5?QO#*oQlO'#I`OOQO-E<^-E<^O#*|Q`O,5@[O#+UQ!fO,5@[O#+]Q`O,5@jOOQ!0Lf1G/j1G/jO%[QlO,5@kO#+eQ`O'#IfOOQO-EoQ`O1G3oO$4WQlO1G3qO$8[QlO'#HpOOQ[1G3t1G3tO$8iQ`O'#HvO>tQ`O'#HxOOQ[1G3z1G3zO$8qQlO1G3zO9hQ!0LrO1G4QOOQ[1G4S1G4SOOQ!0Lb'#G]'#G]O9hQ!0LrO1G4UO9hQ!0LrO1G4WO$tQ`O,5:UO!(vQlO,5:UO!B_QpO,5:UO$<}Q?MtO,5:UOOQO,5;],5;]O$=XQpO'#IaO$=oQ`O,5@]OOQ!0Lf1G/o1G/oO$=wQpO'#IgO$>RQ`O,5@lOOQ!0Lb1G0v1G0vO##bQpO,5:UOOQO'#Ic'#IcO$>ZQpO,5:nOOQ!0Ln,5:n,5:nO#']Q`O1G0WOOQ!0Lf1G0W1G0WO%[QlO1G0WOOQ!0Lf1G0q1G0qO>tQ`O1G0qO!B_QpO1G0qO!BgQMhO1G0qOOQ!0Lb1G5x1G5xO!BSQ!0LrO1G0ZOOQO1G0j1G0jO%[QlO1G0jO$>bQ!0LrO1G0jO$>mQ!0LrO1G0jO!B_QpO1G0ZOCrQpO1G0ZO$>{Q!0LrO1G0jOOQO1G0Z1G0ZO$?aQ!0MxO1G0jPOOO-EzO$?}Q`O1G5vO$@VQ`O1G6UO$@_Q!fO1G6VO9WQ`O,5?QO$@iQ!0MxO1G6SO%[QlO1G6SO$@yQ!0LrO1G6SO$A[Q`O1G6RO$A[Q`O1G6RO9WQ`O1G6RO$AdQ`O,5?TO9WQ`O,5?TOOQO,5?T,5?TO$AxQ`O,5?TO$)QQ`O,5?TOOQO-E[OOQ[,5>[,5>[O%[QlO'#HqO%<{Q`O'#HsOOQ[,5>b,5>bO9WQ`O,5>bOOQ[,5>d,5>dOOQ[7+)f7+)fOOQ[7+)l7+)lOOQ[7+)p7+)pOOQ[7+)r7+)rO%=QQpO1G5xO%=lQ?MtO1G0wO%=vQ`O1G0wOOQO1G/p1G/pO%>RQ?MtO1G/pO>tQ`O1G/pO!(vQlO'#DjOOQO,5>{,5>{OOQO-E<_-E<_OOQO,5?R,5?ROOQO-EtQ`O7+&]O!B_QpO7+&]OOQO7+%u7+%uO$?aQ!0MxO7+&UOOQO7+&U7+&UO%[QlO7+&UO%>]Q!0LrO7+&UO!BSQ!0LrO7+%uO!B_QpO7+%uO%>hQ!0LrO7+&UO%>vQ!0MxO7++nO%[QlO7++nO%?WQ`O7++mO%?WQ`O7++mOOQO1G4o1G4oO9WQ`O1G4oO%?`Q`O1G4oOOQS7+%z7+%zO#']Q`O<|O%[QlO,5>|OOQO-E<`-E<`O%KlQ`O1G5yOOQ!0Lf<]OOQ[,5>_,5>_O&;hQ`O1G3|O9WQ`O7+&cO!(vQlO7+&cOOQO7+%[7+%[O&;mQ?MtO1G6VO>tQ`O7+%[OOQ!0Lf<tQ`O<tQ`O7+)hO'+dQ`O<{AN>{O%[QlOAN?[OOQO<{Oh%VOk+bO![']O%f+aO~O!d+dOa(XX![(XX'v(XX!Y(XX~Oa%lO![XO'v%lO~Oh%VO!i%cO~Oh%VO!i%cO(P%eO~O!d#vO#h(uO~Ob+oO%g+pO(P+lO(RTO(UUO!Z)UP~O!Y+qO`)TX~O[+uO~O`+vO~O![%}O(P%eO(Q!lO`)TP~Oh%VO#]+{O~Oh%VOk,OO![$|O~O![,QO~O},SO![XO~O%k%tO~O!u,XO~Oe,^O~Ob,_O(P#nO(RTO(UUO!Z)SP~Oe%{O~O%g!QO(P&WO~P=RO[,dO`,cO~OPYOQYOSfOdzOeyOmkOoYOpkOqkOwkOyYO{YO!PWO!TkO!UkO!fuO!iZO!lYO!mYO!nYO!pvO!uxO!y]O%e}O(RTO(UUO(]VO(k[O(ziO~O![!eO!r!gO$V!kO(P!dO~P!E{O`,cOa%lO'v%lO~OPYOQYOSfOd!jOe!iOmkOoYOpkOqkOwkOyYO{YO!PWO!TkO!UkO![!eO!fuO!iZO!lYO!mYO!nYO!pvO!u!hO$V!kO(P!dO(RTO(UUO(]VO(k[O(ziO~Oa,iO!rwO#t!OO%i!OO%j!OO%k!OO~P!HeO!i&lO~O&Y,oO~O![,qO~O&k,sO&m,tOP&haQ&haS&haY&haa&had&hae&ham&hao&hap&haq&haw&hay&ha{&ha!P&ha!T&ha!U&ha![&ha!f&ha!i&ha!l&ha!m&ha!n&ha!p&ha!r&ha!u&ha!y&ha#t&ha$V&ha%e&ha%g&ha%i&ha%j&ha%k&ha%n&ha%p&ha%s&ha%t&ha%v&ha&S&ha&Y&ha&[&ha&^&ha&`&ha&c&ha&i&ha&o&ha&q&ha&s&ha&u&ha&w&ha's&ha(P&ha(R&ha(U&ha(]&ha(k&ha(z&ha!Z&ha&a&hab&ha&f&ha~O(P,yO~Oh!bX!Y!OX!Z!OX!d!OX!d!bX!i!bX#]!OX~O!Y!bX!Z!bX~P# kO!d-OO#],}Oh(fX!Y#eX!Z#eX!d(fX!i(fX~O!Y(fX!Z(fX~P#!^Oh%VO!d-QO!i%cO!Y!^X!Z!^X~Op!nO!P!oO(RTO(UUO(a!mO~OP;jOQ;jOSfOd=fOe!iOmkOo;jOpkOqkOwkOy;jO{;jO!PWO!TkO!UkO![!eO!f;mO!iZO!l;jO!m;jO!n;jO!p;nO!r;qO!u!hO$V!kO(RTO(UUO(]VO(k[O(z=dO~O(P{Og'XX!Y'XX~P!+oO!Y.xOg(la~OSfO![3vO$c3wO~O!Z3{O~Os3|O~P#.uOa$lq!Y$lq'v$lq's$lq!V$lq!h$lqs$lq![$lq%f$lq!d$lq~P!9}O!V4OO~P!&fO!P4PO~O}){O'u)|O(v%POk'ea(u'ea!Y'ea#]'ea~Og'ea#}'ea~P%+ZO}){O'u)|Ok'ga(u'ga(v'ga!Y'ga#]'ga~Og'ga#}'ga~P%+|O(n$YO~P#.uO!VfX!V$xX!YfX!Y$xX!d%PX#]fX~P!/nO(PU#>[#>|#?`#?f#?l#?z#@a#BQ#B`#Bg#C}#D]#Ey#FX#F_#Fe#Fk#Fu#F{#GR#G]#Go#GuPPPPPPPPPPP#G{PPPPPPP#Hp#Kw#Ma#Mh#MpPPP$%OP$%X$(Q$.k$.n$.q$/p$/s$/z$0SP$0Y$0]P$0y$0}$1u$3T$3Y$3pPP$3u$3{$4PP$4S$4W$4[$5W$5o$6W$6[$6_$6b$6h$6k$6o$6sR!|RoqOXst!Z#d%k&o&q&r&t,l,q1}2QY!vQ']-^1b5iQ%rvQ%zyQ&R|Q&g!VS'T!e-UQ'c!iS'i!r!yU*g$|*W*kQ+j%{Q+w&TQ,]&aQ-['[Q-f'dQ-n'jQ0S*mQ1l,^R < TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:377,context:cp,nodeProps:[["isolate",-8,5,6,14,34,36,48,50,52,""],["group",-26,9,17,19,65,204,208,212,213,215,218,221,231,233,239,241,243,245,248,254,260,262,264,266,268,270,271,"Statement",-34,13,14,29,32,33,39,48,51,52,54,59,67,69,73,77,79,81,82,107,108,117,118,135,138,140,141,142,143,144,146,147,166,167,169,"Expression",-23,28,30,34,38,40,42,171,173,175,176,178,179,180,182,183,184,186,187,188,198,200,202,203,"Type",-3,85,100,106,"ClassItem"],["openedBy",23,"<",35,"InterpolationStart",53,"[",57,"{",70,"(",159,"JSXStartCloseTag"],["closedBy",24,">",37,"InterpolationEnd",47,"]",58,"}",71,")",164,"JSXEndTag"]],propSources:[mp],skippedNodes:[0,5,6,274],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$h&j(V!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(V!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$h&j(SpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(SpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Sp(V!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$h&j(Sp(V!b'x0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(T#S$h&j'y0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$h&j(Sp(V!b'y0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$h&j!m),Q(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#u(Ch$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#u(Ch$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(R':f$h&j(V!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$h&j(V!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$h&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$c`$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$c``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$c`$h&j(V!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(V!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$c`(V!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$h&j(Sp(V!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$h&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(V!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$h&j(SpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(SpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Sp(V!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$h&j!U7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!U7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!U7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$h&j(V!b!U7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(V!b!U7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(V!b!U7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(V!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$h&j(V!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$h&j(Sp(V!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$h&j(Sp(V!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$h&j(Sp(V!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$h&j(Sp(V!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!d$b$h&j#})Lv(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#O-v$?V_!Z(CdsBr$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!n7`$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$h&j(Sp(V!b'x0/l$[#t(P,2j(a$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$h&j(Sp(V!b'y0/l$[#t(P,2j(a$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[hp,dp,Op,pp,2,3,4,5,6,7,8,9,10,11,12,13,14,up,new Nf("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOu~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!R~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(_~~",141,336),new Nf("j~RQYZXz{^~^O'|~~aP!P!Qd~iO'}~~",25,319)],topRules:{Script:[0,7],SingleExpression:[1,272],SingleClassItem:[2,273]},dialects:{jsx:0,ts:14980},dynamicPrecedences:{77:1,79:1,91:1,167:1,196:1},specialized:[{term:323,get:t=>gp[t]||-1},{term:339,get:t=>yp[t]||-1},{term:92,get:t=>$p[t]||-1}],tokenPrec:15004}),bp=[SO("function ${name}(${params}) {\n\t${}\n}",{label:"function",detail:"definition",type:"keyword"}),SO("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n\t${}\n}",{label:"for",detail:"loop",type:"keyword"}),SO("for (let ${name} of ${collection}) {\n\t${}\n}",{label:"for",detail:"of loop",type:"keyword"}),SO("do {\n\t${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),SO("while (${}) {\n\t${}\n}",{label:"while",detail:"loop",type:"keyword"}),SO("try {\n\t${}\n} catch (${error}) {\n\t${}\n}",{label:"try",detail:"/ catch block",type:"keyword"}),SO("if (${}) {\n\t${}\n}",{label:"if",detail:"block",type:"keyword"}),SO("if (${}) {\n\t${}\n} else {\n\t${}\n}",{label:"if",detail:"/ else block",type:"keyword"}),SO("class ${name} {\n\tconstructor(${params}) {\n\t\t${}\n\t}\n}",{label:"class",detail:"definition",type:"keyword"}),SO('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),SO('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],Sp=bp.concat([SO("interface ${name} {\n\t${}\n}",{label:"interface",detail:"definition",type:"keyword"}),SO("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),SO("enum ${name} {\n\t${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),wp=new $a,xp=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Qp(t){return(e,n)=>{let i=e.node.getChild("VariableDefinition");return i&&n(i,t),!0}}const Pp=["FunctionDeclaration"],_p={FunctionDeclaration:Qp("function"),ClassDeclaration:Qp("class"),ClassExpression:()=>!0,EnumDeclaration:Qp("constant"),TypeAliasDeclaration:Qp("type"),NamespaceDeclaration:Qp("namespace"),VariableDefinition(t,e){t.matchContext(Pp)||e(t,"variable")},TypeDefinition(t,e){e(t,"type")},__proto__:null};function kp(t,e){let n=wp.get(e);if(n)return n;let i=[],r=!0;function o(e,n){let r=t.sliceString(e.from,e.to);i.push({label:r,type:n})}return e.cursor(ta.IncludeAnonymous).iterate((e=>{if(r)r=!1;else if(e.name){let t=_p[e.name];if(t&&t(e,o)||xp.has(e.name))return!1}else if(e.to-e.from>8192){for(let n of kp(t,e.node))i.push(n);return!1}})),wp.set(e,i),i}const Tp=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,Cp=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function zp(t){let e=ml(t.state).resolveInner(t.pos,-1);if(Cp.indexOf(e.name)>-1)return null;let n="VariableName"==e.name||e.to-e.from<20&&Tp.test(t.state.sliceDoc(e.from,e.to));if(!n&&!t.explicit)return null;let i=[];for(let n=e;n;n=n.parent)xp.has(n.name)&&(i=i.concat(kp(t.state.doc,n)));return{options:i,from:n?e.from:t.pos,validFor:Tp}}const Rp=pl.define({name:"javascript",parser:vp.configure({props:[Al.add({IfStatement:Il({except:/^\s*({|else\b)/}),TryStatement:Il({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:t=>t.baseIndent,SwitchBody:t=>{let e=t.textAfter,n=/^\s*\}/.test(e),i=/^\s*(case|default)\b/.test(e);return t.baseIndent+(n?0:i?1:2)*t.unit},Block:Wl({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":Il({except:/^{/}),JSXElement(t){let e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},JSXEscape(t){let e=/\s*\}/.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},"JSXOpenTag JSXSelfClosingTag":t=>t.column(t.node.from)+t.unit}),Nl.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Ul,BlockComment:t=>({from:t.from+2,to:t.to-2})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),Ep={test:t=>/^JSX/.test(t.name),facet:hl({commentTokens:{block:{open:"{/*",close:"*/}"}}})},Ap=Rp.configure({dialect:"ts"},"typescript"),Zp=Rp.configure({dialect:"jsx",props:[dl.add((t=>t.isTop?[Ep]:void 0))]}),Mp=Rp.configure({dialect:"jsx ts",props:[dl.add((t=>t.isTop?[Ep]:void 0))]},"typescript");let Vp=t=>({label:t,type:"keyword"});const Xp="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(Vp),qp=Xp.concat(["declare","implements","private","protected","public"].map(Vp));function Wp(t={}){let e=t.jsx?t.typescript?Mp:Zp:t.typescript?Ap:Rp,n=t.typescript?Sp.concat(qp):bp.concat(Xp);return new Pl(e,[Rp.data.of({autocomplete:Sd(Cp,bd(n))}),Rp.data.of({autocomplete:zp}),t.jsx?Lp:[]])}function jp(t,e,n=t.length){for(let i=null==e?void 0:e.firstChild;i;i=i.nextSibling)if("JSXIdentifier"==i.name||"JSXBuiltin"==i.name||"JSXNamespacedName"==i.name||"JSXMemberExpression"==i.name)return t.sliceString(i.from,Math.min(i.to,n));return""}const Ip="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),Lp=no.inputHandler.of(((t,e,n,i,r)=>{if((Ip?t.composing:t.compositionStarted)||t.state.readOnly||e!=n||">"!=i&&"/"!=i||!Rp.isActiveAt(t.state,e,-1))return!1;let o=r(),{state:s}=o,a=s.changeByRange((t=>{var e;let n,{head:r}=t,o=ml(s).resolveInner(r-1,-1);if("JSXStartTag"==o.name&&(o=o.parent),s.doc.sliceString(r-1,r)!=i||"JSXAttributeValue"==o.name&&o.to>r);else{if(">"==i&&"JSXFragmentTag"==o.name)return{range:t,changes:{from:r,insert:""}};if("/"==i&&"JSXStartCloseTag"==o.name){let t=o.parent,i=t.parent;if(i&&t.from==r-2&&((n=jp(s.doc,i.firstChild,r))||"JSXFragmentTag"==(null===(e=i.firstChild)||void 0===e?void 0:e.name))){let t=`${n}>`;return{range:W.cursor(r+t.length,-1),changes:{from:r,insert:t}}}}else if(">"==i){let e=function(t){for(;;){if("JSXOpenTag"==t.name||"JSXSelfClosingTag"==t.name||"JSXFragmentTag"==t.name)return t;if("JSXEscape"==t.name||!t.parent)return null;t=t.parent}}(o);if(e&&"JSXOpenTag"==e.name&&!/^\/?>|^<\//.test(s.doc.sliceString(r,r+2))&&(n=jp(s.doc,e,r)))return{range:t,changes:{from:r,insert:``}}}}return{range:t}}));return!a.changes.empty&&(t.dispatch([o,s.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)})),Np=20,Up=22,Dp=23,Yp=24,Bp=26,Gp=27,Fp=28,Hp=31,Kp=34,Jp=37,tm={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},em={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},nm={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function im(t){return 9==t||10==t||13==t||32==t}let rm=null,om=null,sm=0;function am(t,e){let n=t.pos+e;if(sm==n&&om==t)return rm;let i=t.peek(e);for(;im(i);)i=t.peek(++e);let r="";for(;45==(o=i)||46==o||58==o||o>=65&&o<=90||95==o||o>=97&&o<=122||o>=161;)r+=String.fromCharCode(i),i=t.peek(++e);var o;return om=t,sm=n,rm=r?r.toLowerCase():i==lm||i==cm?void 0:null}const lm=63,cm=33;function um(t,e){this.name=t,this.parent=e}const hm=[6,10,7,8,9],dm=new rp({start:null,shift:(t,e,n,i)=>hm.indexOf(e)>-1?new um(am(i,1)||"",t):t,reduce:(t,e)=>e==Np&&t?t.parent:t,reuse(t,e,n,i){let r=e.type.id;return 6==r||36==r?new um(am(i,1)||"",t):t},strict:!1}),Om=new Uf(((t,e)=>{if(60!=t.next)return void(t.next<0&&e.context&&t.acceptToken(57));t.advance();let n=47==t.next;n&&t.advance();let i=am(t,0);if(void 0===i)return;if(!i)return t.acceptToken(n?14:6);let r=e.context?e.context.name:null;if(n){if(i==r)return t.acceptToken(11);if(r&&em[r])return t.acceptToken(57,-2);if(e.dialectEnabled(0))return t.acceptToken(12);for(let t=e.context;t;t=t.parent)if(t.name==i)return;t.acceptToken(13)}else{if("script"==i)return t.acceptToken(7);if("style"==i)return t.acceptToken(8);if("textarea"==i)return t.acceptToken(9);if(tm.hasOwnProperty(i))return t.acceptToken(10);r&&nm[r]&&nm[r][i]?t.acceptToken(57,-1):t.acceptToken(6)}}),{contextual:!0}),fm=new Uf((t=>{for(let e=0,n=0;;n++){if(t.next<0){n&&t.acceptToken(58);break}if(45==t.next)e++;else{if(62==t.next&&e>=2){n>=3&&t.acceptToken(58,-2);break}e=0}t.advance()}})),pm=new Uf(((t,e)=>{if(47==t.next&&62==t.peek(1)){let n=e.dialectEnabled(1)||function(t){for(;t;t=t.parent)if("svg"==t.name||"math"==t.name)return!0;return!1}(e.context);t.acceptToken(n?5:4,2)}else 62==t.next&&t.acceptToken(4,1)}));function mm(t,e,n){let i=2+t.length;return new Uf((r=>{for(let o=0,s=0,a=0;;a++){if(r.next<0){a&&r.acceptToken(e);break}if(0==o&&60==r.next||1==o&&47==r.next||o>=2&&os?r.acceptToken(e,-s):r.acceptToken(n,-(s-2));break}if((10==r.next||13==r.next)&&a){r.acceptToken(e,1);break}o=s=0}else s++;r.advance()}}))}const gm=mm("script",54,1),ym=mm("style",55,2),$m=mm("textarea",56,3),vm=ja({"Text RawText":ll.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":ll.angleBracket,TagName:ll.tagName,"MismatchedCloseTag/TagName":[ll.tagName,ll.invalid],AttributeName:ll.attributeName,"AttributeValue UnquotedAttributeValue":ll.attributeValue,Is:ll.definitionOperator,"EntityReference CharacterReference":ll.character,Comment:ll.blockComment,ProcessingInst:ll.processingInstruction,DoctypeDecl:ll.documentMeta}),bm=op.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%ZQ&rO,59fO%fQ&rO,59iO%qQ&rO,59lO%|Q&rO,59nOOOa'#D^'#D^O&XOaO'#CxO&dOaO,59[OOOb'#D_'#D_O&lObO'#C{O&wObO,59[OOOd'#D`'#D`O'POdO'#DOO'[OdO,59[OOO`'#Da'#DaO'dO!rO,59[O'kQ#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'pO$fO,59oOOO`,59o,59oO'xQ#|O,59qO'}Q#|O,59rOOO`-E7W-E7WO(SQ&rO'#CsOOQW'#DZ'#DZO(bQ&rO1G.wOOOa1G.w1G.wOOO`1G/Y1G/YO(mQ&rO1G/QOOOb1G/Q1G/QO(xQ&rO1G/TOOOd1G/T1G/TO)TQ&rO1G/WOOO`1G/W1G/WO)`Q&rO1G/YOOOa-E7[-E7[O)kQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)pQ#tO'#C|OOOd-E7^-E7^O)uQ#tO'#DPOOO`-E7_-E7_O)zQ#|O,59mOOOp-E7`-E7`OOO`1G/Z1G/ZOOO`1G/]1G/]OOO`1G/^1G/^O*PQ,UO,59_OOQW-E7X-E7XOOOa7+$c7+$cOOO`7+$t7+$tOOOb7+$l7+$lOOOd7+$o7+$oOOO`7+$r7+$rO*[Q#|O,59eO*aQ#|O,59hO*fQ#|O,59kOOO`1G/X1G/XO*kO7[O'#CvO*|OMhO'#CvOOQW1G.y1G.yOOO`1G/P1G/POOO`1G/S1G/SOOO`1G/V1G/VOOOO'#D['#D[O+_O7[O,59bOOQW,59b,59bOOOO'#D]'#D]O+pOMhO,59bOOOO-E7Y-E7YOOQW1G.|1G.|OOOO-E7Z-E7Z",stateData:",]~O!^OS~OUSOVPOWQOXROYTO[]O][O^^O`^Oa^Ob^Oc^Ox^O{_O!dZO~OfaO~OfbO~OfcO~OfdO~OfeO~O!WfOPlP!ZlP~O!XiOQoP!ZoP~O!YlORrP!ZrP~OUSOVPOWQOXROYTOZqO[]O][O^^O`^Oa^Ob^Oc^Ox^O!dZO~O!ZrO~P#dO![sO!euO~OfvO~OfwO~OS|OT}OhyO~OS!POT}OhyO~OS!ROT}OhyO~OS!TOT}OhyO~OS}OT}OhyO~O!WfOPlX!ZlX~OP!WO!Z!XO~O!XiOQoX!ZoX~OQ!ZO!Z!XO~O!YlORrX!ZrX~OR!]O!Z!XO~O!Z!XO~P#dOf!_O~O![sO!e!aO~OS!bO~OS!cO~Oi!dOSgXTgXhgX~OS!fOT!gOhyO~OS!hOT!gOhyO~OS!iOT!gOhyO~OS!jOT!gOhyO~OS!gOT!gOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:dm,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"],["isolate",-11,21,29,30,32,33,35,36,37,38,41,42,"ltr",-3,26,27,39,""]],propSources:[vm],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zbkWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOa!R!R7tP;=`<%l7S!Z8OYkWa!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{ihSkWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbhSkWa!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXhSa!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TakWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOb!R!RAwP;=`<%lAY!ZBRYkWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbhSkWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbhSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXhSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!bx`P!a`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYlhS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_khS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_X`P!a`!cp!eQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZhSfQ`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!a`!cpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!a`!cp!dPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!a`!cpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!a`!cpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!a`!cpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!a`!cpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!a`!cpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!a`!cpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!a`!cpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!cpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO{PP!-nP;=`<%l!-Sq!-xS!cp{POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!a`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!a`{POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!a`!cp{POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!a`!cpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!a`!cpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!a`!cpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!a`!cpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!a`!cpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!a`!cpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!cpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOxPP!7TP;=`<%l!6Vq!7]V!cpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!a`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let a=t.type.id;if(a==Fp)return xm(t,e,n);if(a==Hp)return xm(t,e,i);if(a==Kp)return xm(t,e,r);if(a==Np&&o.length){let n,i=t.node,r=i.firstChild,s=r&&wm(r,e);if(s)for(let t of o)if(t.tag==s&&(!t.attrs||t.attrs(n||(n=Sm(r,e))))){let e=i.lastChild,n=e.type.id==Jp?e.from:i.to;if(n>r.to)return{parser:t.parser,overlay:[{from:r.to,to:n}]}}}if(s&&a==Dp){let n,i=t.node;if(n=i.firstChild){let t=s[e.read(n.from,n.to)];if(t)for(let n of t){if(n.tagName&&n.tagName!=wm(i.parent,e))continue;let t=i.lastChild;if(t.type.id==Bp){let e=t.from+1,i=t.lastChild,r=t.to-(i&&i.isError?0:1);if(r>e)return{parser:n.parser,overlay:[{from:e,to:r}]}}else if(t.type.id==Gp)return{parser:n.parser,overlay:[{from:t.from,to:t.to}]}}}}return null}))}const Pm=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288];function _m(t){return t>=65&&t<=90||t>=97&&t<=122||t>=161}function km(t){return t>=48&&t<=57}const Tm=new Uf(((t,e)=>{for(let n=!1,i=0,r=0;;r++){let{next:o}=t;if(_m(o)||45==o||95==o||n&&km(o))!n&&(45!=o||r>0)&&(n=!0),i===r&&45==o&&i++,t.advance();else{if(92!=o||10==t.peek(1)){n&&t.acceptToken(40==o?100:2==i&&e.canShift(2)?2:101);break}t.advance(),t.next>-1&&t.advance(),n=!0}}})),Cm=new Uf((t=>{if(Pm.includes(t.peek(-1))){let{next:e}=t;(_m(e)||95==e||35==e||46==e||91==e||58==e&&_m(t.peek(1))||45==e||38==e)&&t.acceptToken(99)}})),zm=new Uf((t=>{if(!Pm.includes(t.peek(-1))){let{next:e}=t;if(37==e&&(t.advance(),t.acceptToken(1)),_m(e)){do{t.advance()}while(_m(t.next)||km(t.next));t.acceptToken(1)}}})),Rm=ja({"AtKeyword import charset namespace keyframes media supports":ll.definitionKeyword,"from to selector":ll.keyword,NamespaceName:ll.namespace,KeyframeName:ll.labelName,KeyframeRangeName:ll.operatorKeyword,TagName:ll.tagName,ClassName:ll.className,PseudoClassName:ll.constant(ll.className),IdName:ll.labelName,"FeatureName PropertyName":ll.propertyName,AttributeName:ll.attributeName,NumberLiteral:ll.number,KeywordQuery:ll.keyword,UnaryQueryOp:ll.operatorKeyword,"CallTag ValueName":ll.atom,VariableName:ll.variableName,Callee:ll.operatorKeyword,Unit:ll.unit,"UniversalSelector NestingSelector":ll.definitionOperator,MatchOp:ll.compareOperator,"ChildOp SiblingOp, LogicOp":ll.logicOperator,BinOp:ll.arithmeticOperator,Important:ll.modifier,Comment:ll.blockComment,ColorLiteral:ll.color,"ParenthesizedContent StringLiteral":ll.string,":":ll.punctuation,"PseudoOp #":ll.derefOperator,"; ,":ll.separator,"( )":ll.paren,"[ ]":ll.squareBracket,"{ }":ll.brace}),Em={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:138},Am={__proto__:null,"@import":118,"@media":142,"@charset":146,"@namespace":150,"@keyframes":156,"@supports":168},Zm={__proto__:null,not:132,only:132},Mm=op.deserialize({version:14,states:":jQYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DTO$vQ[O'#DWOOQP'#Em'#EmO${QdO'#DgO%jQ[O'#DtO${QdO'#DvO%{Q[O'#DxO&WQ[O'#D{O&`Q[O'#ERO&nQ[O'#ETOOQS'#El'#ElOOQS'#EW'#EWQYQ[OOO&uQXO'#CdO'jQWO'#DcO'oQWO'#EsO'zQ[O'#EsQOQWOOP(UO#tO'#C_POOO)C@[)C@[OOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(aQ[O'#E[O({QWO,58{O)TQ[O,59SO$qQ[O,59oO$vQ[O,59rO(aQ[O,59uO(aQ[O,59wO(aQ[O,59xO)`Q[O'#DbOOQS,58{,58{OOQP'#Ck'#CkOOQO'#DR'#DROOQP,59S,59SO)gQWO,59SO)lQWO,59SOOQP'#DV'#DVOOQP,59o,59oOOQO'#DX'#DXO)qQ`O,59rOOQS'#Cp'#CpO${QdO'#CqO)yQvO'#CsO+ZQtO,5:ROOQO'#Cx'#CxO)lQWO'#CwO+oQWO'#CyO+tQ[O'#DOOOQS'#Ep'#EpOOQO'#Dj'#DjO+|Q[O'#DqO,[QWO'#EtO&`Q[O'#DoO,jQWO'#DrOOQO'#Eu'#EuO)OQWO,5:`O,oQpO,5:bOOQS'#Dz'#DzO,wQWO,5:dO,|Q[O,5:dOOQO'#D}'#D}O-UQWO,5:gO-ZQWO,5:mO-cQWO,5:oOOQS-E8U-E8UO-kQdO,59}O-{Q[O'#E^O.YQWO,5;_O.YQWO,5;_POOO'#EV'#EVP.eO#tO,58yPOOO,58y,58yOOQP1G.l1G.lO/[QXO,5:vOOQO-E8Y-E8YOOQS1G.g1G.gOOQP1G.n1G.nO)gQWO1G.nO)lQWO1G.nOOQP1G/Z1G/ZO/iQ`O1G/^O0SQXO1G/aO0jQXO1G/cO1QQXO1G/dO1hQWO,59|O1mQ[O'#DSO1tQdO'#CoOOQP1G/^1G/^O${QdO1G/^O1{QpO,59]OOQS,59_,59_O${QdO,59aO2TQWO1G/mOOQS,59c,59cO2YQ!bO,59eOOQS'#DP'#DPOOQS'#EY'#EYO2eQ[O,59jOOQS,59j,59jO2mQWO'#DjO2xQWO,5:VO2}QWO,5:]O&`Q[O,5:XO&`Q[O'#E_O3VQWO,5;`O3bQWO,5:ZO(aQ[O,5:^OOQS1G/z1G/zOOQS1G/|1G/|OOQS1G0O1G0OO3sQWO1G0OO3xQdO'#EOOOQS1G0R1G0ROOQS1G0X1G0XOOQS1G0Z1G0ZO4TQtO1G/iOOQO1G/i1G/iOOQO,5:x,5:xO4kQ[O,5:xOOQO-E8[-E8[O4xQWO1G0yPOOO-E8T-E8TPOOO1G.e1G.eOOQP7+$Y7+$YOOQP7+$x7+$xO${QdO7+$xOOQS1G/h1G/hO5TQXO'#ErO5[QWO,59nO5aQtO'#EXO6XQdO'#EoO6cQWO,59ZO6hQpO7+$xOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%X7+%XOOQS1G/P1G/PO6pQWO1G/POOQS-E8W-E8WOOQS1G/U1G/UO${QdO1G/qOOQO1G/w1G/wOOQO1G/s1G/sO6uQWO,5:yOOQO-E8]-E8]O7TQXO1G/xOOQS7+%j7+%jO7[QYO'#CsOOQO'#EQ'#EQO7gQ`O'#EPOOQO'#EP'#EPO7rQWO'#E`O7zQdO,5:jOOQS,5:j,5:jO8VQtO'#E]O${QdO'#E]O9WQdO7+%TOOQO7+%T7+%TOOQO1G0d1G0dO9kQpO<OAN>OO;]QdO,5:uOOQO-E8X-E8XOOQO<T![;'S%^;'S;=`%o<%lO%^l;TUo`Oy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^l;nYo`#e[Oy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^l[[o`#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^n?VSt^Oy%^z;'S%^;'S;=`%o<%lO%^l?hWjWOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^n@VU#bQOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjWOy%^z{@}{;'S%^;'S;=`%o<%lO%^~AUSo`#[~Oy%^z;'S%^;'S;=`%o<%lO%^lAg[#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU]QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S^Qo`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!Y^Oy%^z;'S%^;'S;=`%o<%lO%^dCoS|SOy%^z;'S%^;'S;=`%o<%lO%^bDQU!OQOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS!OQo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[![Qo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^nFfSq^Oy%^z;'S%^;'S;=`%o<%lO%^nFwSp^Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!bQo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!TUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!S^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!RQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[Cm,zm,Tm,1,2,3,4,new Nf("m~RRYZ[z{a~~g~aO#^~~dP!P!Qg~lO#_~~",28,105)],topRules:{StyleSheet:[0,4],Styles:[1,86]},specialized:[{term:100,get:t=>Em[t]||-1},{term:58,get:t=>Am[t]||-1},{term:101,get:t=>Zm[t]||-1}],tokenPrec:1219});let Vm=null;function Xm(){if(!Vm&&"object"==typeof document&&document.body){let{style:t}=document.body,e=[],n=new Set;for(let i in t)"cssText"!=i&&"cssFloat"!=i&&"string"==typeof t[i]&&(/[A-Z]/.test(i)&&(i=i.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))),n.has(i)||(e.push(i),n.add(i)));Vm=e.sort().map((t=>({type:"property",label:t})))}return Vm||[]}const qm=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map((t=>({type:"class",label:t}))),Wm=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map((t=>({type:"keyword",label:t}))).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map((t=>({type:"constant",label:t})))),jm=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map((t=>({type:"type",label:t}))),Im=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map((t=>({type:"keyword",label:t}))),Lm=/^(\w[\w-]*|-\w[\w-]*|)$/,Nm=/^-(-[\w-]*)?$/,Um=new $a,Dm=["Declaration"];function Ym(t){for(let e=t;;){if(e.type.isTop)return e;if(!(e=e.parent))return t}}function Bm(t,e,n){if(e.to-e.from>4096){let i=Um.get(e);if(i)return i;let r=[],o=new Set,s=e.cursor(ta.IncludeAnonymous);if(s.firstChild())do{for(let e of Bm(t,s.node,n))o.has(e.label)||(o.add(e.label),r.push(e))}while(s.nextSibling());return Um.set(e,r),r}{let i=[],r=new Set;return e.cursor().iterate((e=>{var o;if(n(e)&&e.matchContext(Dm)&&":"==(null===(o=e.node.nextSibling)||void 0===o?void 0:o.name)){let n=t.sliceString(e.from,e.to);r.has(n)||(r.add(n),i.push({label:n,type:"variable"}))}})),i}}const Gm=t=>e=>{let{state:n,pos:i}=e,r=ml(n).resolveInner(i,-1),o=r.type.isError&&r.from==r.to-1&&"-"==n.doc.sliceString(r.from,r.to);if("PropertyName"==r.name||(o||"TagName"==r.name)&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:Xm(),validFor:Lm};if("ValueName"==r.name)return{from:r.from,options:Wm,validFor:Lm};if("PseudoClassName"==r.name)return{from:r.from,options:qm,validFor:Lm};if(t(r)||(e.explicit||o)&&function(t,e){var n;if(("("==t.name||t.type.isError)&&(t=t.parent||t),"ArgList"!=t.name)return!1;let i=null===(n=t.parent)||void 0===n?void 0:n.firstChild;return"Callee"==(null==i?void 0:i.name)&&"var"==e.sliceString(i.from,i.to)}(r,n.doc))return{from:t(r)||o?r.from:i,options:Bm(n.doc,Ym(r),t),validFor:Nm};if("TagName"==r.name){for(let{parent:t}=r;t;t=t.parent)if("Block"==t.name)return{from:r.from,options:Xm(),validFor:Lm};return{from:r.from,options:jm,validFor:Lm}}if("AtKeyword"==r.name)return{from:r.from,options:Im,validFor:Lm};if(!e.explicit)return null;let s=r.resolve(i),a=s.childBefore(i);return a&&":"==a.name&&"PseudoClassSelector"==s.name?{from:i,options:qm,validFor:Lm}:a&&":"==a.name&&"Declaration"==s.name||"ArgList"==s.name?{from:i,options:Wm,validFor:Lm}:"Block"==s.name||"Styles"==s.name?{from:i,options:Xm(),validFor:Lm}:null},Fm=Gm((t=>"VariableName"==t.name)),Hm=pl.define({name:"css",parser:Mm.configure({props:[Al.add({Declaration:Il()}),Nl.add({"Block KeyframeList":Ul})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Km(){return new Pl(Hm,Hm.data.of({autocomplete:Fm}))}const Jm=["_blank","_self","_top","_parent"],tg=["ascii","utf-8","utf-16","latin1","latin1"],eg=["get","post","put","delete"],ng=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],ig=["true","false"],rg={},og={a:{attrs:{href:null,ping:null,type:null,media:null,target:Jm,hreflang:null}},abbr:rg,address:rg,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:rg,aside:rg,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:rg,base:{attrs:{href:null,target:Jm}},bdi:rg,bdo:rg,blockquote:{attrs:{cite:null}},body:rg,br:rg,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:ng,formmethod:eg,formnovalidate:["novalidate"],formtarget:Jm,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:rg,center:rg,cite:rg,code:rg,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:rg,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:rg,div:rg,dl:rg,dt:rg,em:rg,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:rg,figure:rg,footer:rg,form:{attrs:{action:null,name:null,"accept-charset":tg,autocomplete:["on","off"],enctype:ng,method:eg,novalidate:["novalidate"],target:Jm}},h1:rg,h2:rg,h3:rg,h4:rg,h5:rg,h6:rg,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:rg,hgroup:rg,hr:rg,html:{attrs:{manifest:null}},i:rg,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:ng,formmethod:eg,formnovalidate:["novalidate"],formtarget:Jm,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:rg,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:rg,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:rg,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:tg,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:rg,noscript:rg,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:rg,param:{attrs:{name:null,value:null}},pre:rg,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:rg,rt:rg,ruby:rg,samp:rg,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:tg}},section:rg,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:rg,source:{attrs:{src:null,type:null,media:null}},span:rg,strong:rg,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:rg,summary:rg,sup:rg,table:rg,tbody:rg,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:rg,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:rg,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:rg,time:{attrs:{datetime:null}},title:rg,tr:rg,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:rg,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:rg},sg={accesskey:null,class:null,contenteditable:ig,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:ig,autocorrect:ig,autocapitalize:ig,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":ig,"aria-autocomplete":["inline","list","both","none"],"aria-busy":ig,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":ig,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":ig,"aria-hidden":ig,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":ig,"aria-multiselectable":ig,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":ig,"aria-relevant":null,"aria-required":ig,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},ag="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map((t=>"on"+t));for(let t of ag)sg[t]=null;class lg{constructor(t,e){this.tags=Object.assign(Object.assign({},og),t),this.globalAttrs=Object.assign(Object.assign({},sg),e),this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}function cg(t,e,n=t.length){if(!e)return"";let i=e.firstChild,r=i&&i.getChild("TagName");return r?t.sliceString(r.from,Math.min(r.to,n)):""}function ug(t,e=!1){for(;t;t=t.parent)if("Element"==t.name){if(!e)return t;e=!1}return null}function hg(t,e,n){let i=n.tags[cg(t,ug(e))];return(null==i?void 0:i.children)||n.allTags}function dg(t,e){let n=[];for(let i=ug(e);i&&!i.type.isTop;i=ug(i.parent)){let r=cg(t,i);if(r&&"CloseTag"==i.lastChild.name)break;r&&n.indexOf(r)<0&&("EndTag"==e.name||e.from>=i.firstChild.to)&&n.push(r)}return n}lg.default=new lg;const Og=/^[:\-\.\w\u00b7-\uffff]*$/;function fg(t,e,n,i,r){let o=/\s*>/.test(t.sliceDoc(r,r+5))?"":">",s=ug(n,!0);return{from:i,to:r,options:hg(t.doc,s,e).map((t=>({label:t,type:"type"}))).concat(dg(t.doc,n).map(((t,e)=>({label:"/"+t,apply:"/"+t+o,type:"type",boost:99-e})))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function pg(t,e,n,i){let r=/\s*>/.test(t.sliceDoc(i,i+5))?"":">";return{from:n,to:i,options:dg(t.doc,e).map(((t,e)=>({label:t,apply:t+r,type:"type",boost:99-e}))),validFor:Og}}function mg(t,e){let{state:n,pos:i}=e,r=ml(n).resolveInner(i,-1),o=r.resolve(i);for(let t,e=i;o==r&&(t=r.childBefore(e));){let n=t.lastChild;if(!n||!n.type.isError||n.from({label:t,type:"property"}))),validFor:Og}}(n,t,r,"AttributeName"==r.name?r.from:i,i):"Is"==r.name||"AttributeValue"==r.name||"UnquotedAttributeValue"==r.name?function(t,e,n,i,r){var o;let s,a=null===(o=n.parent)||void 0===o?void 0:o.getChild("AttributeName"),l=[];if(a){let o=t.sliceDoc(a.from,a.to),c=e.globalAttrs[o];if(!c){let i=ug(n),r=i?e.tags[cg(t.doc,i)]:null;c=(null==r?void 0:r.attrs)&&r.attrs[o]}if(c){let e=t.sliceDoc(i,r).toLowerCase(),n='"',o='"';/^['"]/.test(e)?(s='"'==e[0]?/^[^"]*$/:/^[^']*$/,n="",o=t.sliceDoc(r,r+1)==e[0]?"":e[0],e=e.slice(1),i++):s=/^[^\s<>='"]*$/;for(let t of c)l.push({label:t,apply:n+t+o,type:"constant"})}}return{from:i,to:r,options:l,validFor:s}}(n,t,r,"Is"==r.name?i:r.from,i):!e.explicit||"Element"!=o.name&&"Text"!=o.name&&"Document"!=o.name?null:function(t,e,n,i){let r=[],o=0;for(let i of hg(t.doc,n,e))r.push({label:"<"+i,type:"type"});for(let e of dg(t.doc,n))r.push({label:"",type:"type",boost:99-o++});return{from:i,to:i,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}(n,t,r,i)}function gg(t){let{extraTags:e,extraGlobalAttributes:n}=t,i=n||e?new lg(e,n):lg.default;return t=>mg(i,t)}const yg=Rp.parser.configure({top:"SingleExpression"}),$g=[{tag:"script",attrs:t=>"text/typescript"==t.type||"ts"==t.lang,parser:Ap.parser},{tag:"script",attrs:t=>"text/babel"==t.type||"text/jsx"==t.type,parser:Zp.parser},{tag:"script",attrs:t=>"text/typescript-jsx"==t.type,parser:Mp.parser},{tag:"script",attrs:t=>/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(t.type),parser:yg},{tag:"script",attrs:t=>!t.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(t.type),parser:Rp.parser},{tag:"style",attrs:t=>(!t.lang||"css"==t.lang)&&(!t.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(t.type)),parser:Hm.parser}],vg=[{name:"style",parser:Hm.parser.configure({top:"Styles"})}].concat(ag.map((t=>({name:t,parser:Rp.parser})))),bg=pl.define({name:"html",parser:bm.configure({props:[Al.add({Element(t){let e=/^(\s*)(<\/)?/.exec(t.textAfter);return t.node.to<=t.pos+e[0].length?t.continue():t.lineIndent(t.node.from)+(e[2]?0:t.unit)},"OpenTag CloseTag SelfClosingTag":t=>t.column(t.node.from)+t.unit,Document(t){if(t.pos+/\s*/.exec(t.textAfter)[0].lengtht.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"\x3c!--",close:"--\x3e"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-._"}}),Sg=bg.configure({wrap:Qm($g,vg)});function wg(t={}){let e,n="";!1===t.matchClosingTags&&(n="noMatch"),!0===t.selfClosingTags&&(n=(n?n+" ":"")+"selfClosing"),(t.nestedLanguages&&t.nestedLanguages.length||t.nestedAttributes&&t.nestedAttributes.length)&&(e=Qm((t.nestedLanguages||[]).concat($g),(t.nestedAttributes||[]).concat(vg)));let i=e?bg.configure({wrap:e,dialect:n}):n?Sg.configure({dialect:n}):Sg;return new Pl(i,[Sg.data.of({autocomplete:gg(t)}),!1!==t.autoCloseTags?Qg:[],Wp().support,Km().support])}const xg=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),Qg=no.inputHandler.of(((t,e,n,i,r)=>{if(t.composing||t.state.readOnly||e!=n||">"!=i&&"/"!=i||!Sg.isActiveAt(t.state,e,-1))return!1;let o=r(),{state:s}=o,a=s.changeByRange((t=>{var e,n,r;let o,a=s.doc.sliceString(t.from-1,t.to)==i,{head:l}=t,c=ml(s).resolveInner(l,-1);if(a&&">"==i&&"EndTag"==c.name){let i=c.parent;if("CloseTag"!=(null===(n=null===(e=i.parent)||void 0===e?void 0:e.lastChild)||void 0===n?void 0:n.name)&&(o=cg(s.doc,i.parent,l))&&!xg.has(o))return{range:t,changes:{from:l,to:l+(">"===s.doc.sliceString(l,l+1)?1:0),insert:``}}}else if(a&&"/"==i&&"IncompleteCloseTag"==c.name){let t=c.parent;if(c.from==l-2&&"CloseTag"!=(null===(r=t.lastChild)||void 0===r?void 0:r.name)&&(o=cg(s.doc,t,l))&&!xg.has(o)){let t=l+(">"===s.doc.sliceString(l,l+1)?1:0),e=`${o}>`;return{range:W.cursor(l+e.length,-1),changes:{from:l,to:t,insert:e}}}}return{range:t}}));return!a.changes.empty&&(t.dispatch([o,s.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)})),Pg=20,_g=21;function kg(t){return t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57}function Tg(t,e,n){for(let i=!1;;){if(t.next<0)return;if(t.next==e&&!i)return void t.advance();i=n&&!i&&92==t.next,t.advance()}}function Cg(t,e){for(;95==t.next||kg(t.next);)null!=e&&(e+=String.fromCharCode(t.next)),t.advance();return e}function zg(t,e){for(;48==t.next||49==t.next;)t.advance();e&&t.next==e&&t.advance()}function Rg(t,e){for(;;){if(46==t.next){if(e)break;e=!0}else if(t.next<48||t.next>57)break;t.advance()}if(69==t.next||101==t.next)for(t.advance(),43!=t.next&&45!=t.next||t.advance();t.next>=48&&t.next<=57;)t.advance()}function Eg(t){for(;!(t.next<0||10==t.next);)t.advance()}function Ag(t,e){for(let n=0;n!=&|~^/",specialVar:"?",identifierQuotes:'"',caseInsensitiveIdentifiers:!1,words:Mg("absolute action add after all allocate alter and any are as asc assertion at authorization before begin between both breadth by call cascade cascaded case cast catalog check close collate collation column commit condition connect connection constraint constraints constructor continue corresponding count create cross cube current current_date current_default_transform_group current_transform_group_for_type current_path current_role current_time current_timestamp current_user cursor cycle data day deallocate declare default deferrable deferred delete depth deref desc describe descriptor deterministic diagnostics disconnect distinct do domain drop dynamic each else elseif end end-exec equals escape except exception exec execute exists exit external fetch first for foreign found from free full function general get global go goto grant group grouping handle having hold hour identity if immediate in indicator initially inner inout input insert intersect into is isolation join key language last lateral leading leave left level like limit local localtime localtimestamp locator loop map match method minute modifies module month names natural nesting new next no none not of old on only open option or order ordinality out outer output overlaps pad parameter partial path prepare preserve primary prior privileges procedure public read reads recursive redo ref references referencing relative release repeat resignal restrict result return returns revoke right role rollback rollup routine row rows savepoint schema scroll search second section select session session_user set sets signal similar size some space specific specifictype sql sqlexception sqlstate sqlwarning start state static system_user table temporary then timezone_hour timezone_minute to trailing transaction translation treat trigger under undo union unique unnest until update usage user using value values view when whenever where while with without work write year zone ","array binary bit boolean char character clob date decimal double float int integer interval large national nchar nclob numeric object precision real smallint time timestamp varchar varying ")};function Xg(t){return new Uf((e=>{var n;let{next:i}=e;if(e.advance(),Ag(i,Zg)){for(;Ag(e.next,Zg);)e.advance();e.acceptToken(36)}else if(36==i&&t.doubleDollarQuotedStrings){let t=Cg(e,"");36==e.next&&(e.advance(),function(t,e){t:for(;;){if(t.next<0)return;if(36==t.next){t.advance();for(let n=0;n1){e.advance(),Tg(e,39,t.backslashEscapes),e.acceptToken(3);break}if(!kg(e.next))break;e.advance()}else if(t.plsqlQuotingMechanism&&(113==i||81==i)&&39==e.next&&e.peek(1)>0&&!Ag(e.peek(1),Zg)){let t=e.peek(1);e.advance(2),function(t,e){let n="[{<(".indexOf(String.fromCharCode(e)),i=n<0?e:"]}>)".charCodeAt(n);for(;;){if(t.next<0)return;if(t.next==i&&39==t.peek(1))return void t.advance(2);t.advance()}}(e,t),e.acceptToken(3)}else if(40==i)e.acceptToken(7);else if(41==i)e.acceptToken(8);else if(123==i)e.acceptToken(9);else if(125==i)e.acceptToken(10);else if(91==i)e.acceptToken(11);else if(93==i)e.acceptToken(12);else if(59==i)e.acceptToken(13);else if(t.unquotedBitLiterals&&48==i&&98==e.next)e.advance(),zg(e),e.acceptToken(22);else if(98!=i&&66!=i||39!=e.next&&34!=e.next){if(48==i&&(120==e.next||88==e.next)||(120==i||88==i)&&39==e.next){let t=39==e.next;for(e.advance();(r=e.next)>=48&&r<=57||r>=97&&r<=102||r>=65&&r<=70;)e.advance();t&&39==e.next&&e.advance(),e.acceptToken(4)}else if(46==i&&e.next>=48&&e.next<=57)Rg(e,!0),e.acceptToken(4);else if(46==i)e.acceptToken(14);else if(i>=48&&i<=57)Rg(e,!1),e.acceptToken(4);else if(Ag(i,t.operatorChars)){for(;Ag(e.next,t.operatorChars);)e.advance();e.acceptToken(15)}else if(Ag(i,t.specialVar))e.next==i&&e.advance(),function(t){if(39==t.next||34==t.next||96==t.next){let e=t.next;t.advance(),Tg(t,e,!1)}else Cg(t)}(e),e.acceptToken(17);else if(Ag(i,t.identifierQuotes))Tg(e,i,!1),e.acceptToken(19);else if(58==i||44==i)e.acceptToken(16);else if(kg(i)){let r=Cg(e,String.fromCharCode(i));e.acceptToken(46==e.next||46==e.peek(-r.length-1)?18:null!==(n=t.words[r.toLowerCase()])&&void 0!==n?n:18)}}else{const n=e.next;e.advance(),t.treatBitsAsBytes?(Tg(e,n,t.backslashEscapes),e.acceptToken(23)):(zg(e,n),e.acceptToken(22))}else e.advance(),Tg(e,39,t.backslashEscapes),e.acceptToken(3);else e.advance(),Tg(e,39,!0),e.acceptToken(3);else Eg(e),e.acceptToken(1);var r}))}const qg=Xg(Vg),Wg=op.deserialize({version:14,states:"%vQ]QQOOO#wQRO'#DSO$OQQO'#CwO%eQQO'#CxO%lQQO'#CyO%sQQO'#CzOOQQ'#DS'#DSOOQQ'#C}'#C}O'UQRO'#C{OOQQ'#Cv'#CvOOQQ'#C|'#C|Q]QQOOQOQQOOO'`QQO'#DOO(xQRO,59cO)PQQO,59cO)UQQO'#DSOOQQ,59d,59dO)cQQO,59dOOQQ,59e,59eO)jQQO,59eOOQQ,59f,59fO)qQQO,59fOOQQ-E6{-E6{OOQQ,59b,59bOOQQ-E6z-E6zOOQQ,59j,59jOOQQ-E6|-E6|O+VQRO1G.}O+^QQO,59cOOQQ1G/O1G/OOOQQ1G/P1G/POOQQ1G/Q1G/QP+kQQO'#C}O+rQQO1G.}O)PQQO,59cO,PQQO'#Cw",stateData:",[~OtOSPOSQOS~ORUOSUOTUOUUOVROXSOZTO]XO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O^]ORvXSvXTvXUvXVvXXvXZvX]vX_vX`vXavXbvXcvXdvXevXfvXgvXhvX~OsvX~P!jOa_Ob_Oc_O~ORUOSUOTUOUUOVROXSOZTO^tO_UO`UOa`Ob`Oc`OdUOeUOfUOgUOhUO~OWaO~P$ZOYcO~P$ZO[eO~P$ZORUOSUOTUOUUOVROXSOZTO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O]hOsoX~P%zOajObjOcjO~O^]ORkaSkaTkaUkaVkaXkaZka]ka_ka`kaakabkackadkaekafkagkahka~Oska~P'kO^]O~OWvXYvX[vX~P!jOWnO~P$ZOYoO~P$ZO[pO~P$ZO^]ORkiSkiTkiUkiVkiXkiZki]ki_ki`kiakibkickidkiekifkigkihki~Oski~P)xOWkaYka[ka~P'kO]hO~P$ZOWkiYki[ki~P)xOasObsOcsO~O",goto:"#hwPPPPPPPPPPPPPPPPPPPPPPPPPPx||||!Y!^!d!xPPP#[TYOZeUORSTWZbdfqT[OZQZORiZSWOZQbRQdSQfTZgWbdfqQ^PWk^lmrQl_Qm`RrseVORSTWZbdfq",nodeNames:"⚠ LineComment BlockComment String Number Bool Null ( ) { } [ ] ; . Operator Punctuation SpecialVar Identifier QuotedIdentifier Keyword Type Bits Bytes Builtin Script Statement CompositeIdentifier Parens Braces Brackets Statement",maxTerm:38,nodeProps:[["isolate",-4,1,2,3,19,""]],skippedNodes:[0,1,2],repeatNodeCount:3,tokenData:"RORO",tokenizers:[0,qg],topRules:{Script:[0,25]},tokenPrec:0});function jg(t){let e=t.cursor().moveTo(t.from,-1);for(;/Comment/.test(e.name);)e.moveTo(e.from,-1);return e.node}function Ig(t,e){let n=t.sliceString(e.from,e.to),i=/^([`'"])(.*)\1$/.exec(n);return i?i[2]:n}function Lg(t){return t&&("Identifier"==t.name||"QuotedIdentifier"==t.name)}function Ng(t,e){if("CompositeIdentifier"==e.name){let n=[];for(let i=e.firstChild;i;i=i.nextSibling)Lg(i)&&n.push(Ig(t,i));return n}return[Ig(t,e)]}function Ug(t,e){for(let n=[];;){if(!e||"."!=e.name)return n;let i=jg(e);if(!Lg(i))return n;n.unshift(Ig(t,i)),e=jg(i)}}const Dg=new Set("where group having order union intersect except all distinct limit offset fetch for".split(" ")),Yg=/^\w*$/,Bg=/^[`'"]?\w*[`'"]?$/;function Gg(t){return t.self&&"string"==typeof t.self.label}class Fg{constructor(t,e){this.idQuote=t,this.idCaseInsensitive=e,this.list=[],this.children=void 0}child(t){let e=this.children||(this.children=Object.create(null));return e[t]||(t&&!this.list.some((e=>e.label==t))&&this.list.push(Hg(t,"type",this.idQuote,this.idCaseInsensitive)),e[t]=new Fg(this.idQuote,this.idCaseInsensitive))}maybeChild(t){return this.children?this.children[t]:null}addCompletion(t){let e=this.list.findIndex((e=>e.label==t.label));e>-1?this.list[e]=t:this.list.push(t)}addCompletions(t){for(let e of t)this.addCompletion("string"==typeof e?Hg(e,"property",this.idQuote,this.idCaseInsensitive):e)}addNamespace(t){Array.isArray(t)?this.addCompletions(t):Gg(t)?this.addNamespace(t.children):this.addNamespaceObject(t)}addNamespaceObject(t){for(let e of Object.keys(t)){let n=t[e],i=null,r=e.replace(/\\?\./g,(t=>"."==t?"\0":t)).split("\0"),o=this;Gg(n)&&(i=n.self,n=n.children);for(let t=0;t({from:Math.min(t.from+100,e.doc.lineAt(t.from).to),to:t.to}),BlockComment:t=>({from:t.from+2,to:t.to-2})}),ja({Keyword:ll.keyword,Type:ll.typeName,Builtin:ll.standard(ll.name),Bits:ll.number,Bytes:ll.string,Bool:ll.bool,Null:ll.null,Number:ll.number,String:ll.string,Identifier:ll.name,QuotedIdentifier:ll.special(ll.string),SpecialVar:ll.special(ll.name),LineComment:ll.lineComment,BlockComment:ll.blockComment,Operator:ll.operator,"Semi Punctuation":ll.punctuation,"( )":ll.paren,"{ }":ll.brace,"[ ]":ll.squareBracket})]});class Jg{constructor(t,e,n){this.dialect=t,this.language=e,this.spec=n}get extension(){return this.language.extension}static define(t){let e=function(t,e,n,i){let r={};for(let e in Vg)r[e]=(t.hasOwnProperty(e)?t:Vg)[e];return e&&(r.words=Mg(e,n||"",i)),r}(t,t.keywords,t.types,t.builtin),n=pl.define({name:"sql",parser:Kg.configure({tokenizers:[{from:qg,to:Xg(e)}]}),languageData:{commentTokens:{line:"--",block:{open:"/*",close:"*/"}},closeBrackets:{brackets:["(","[","{","'",'"',"`"]}}});return new Jg(e,n,t)}}function ty(t,e){return{label:t,type:e,boost:-1}}function ey(t,e=!1,n){return function(t,e,n){let i=Object.keys(t).map((i=>{return n(e?i.toUpperCase():i,(r=t[i])==_g?"type":r==Pg?"keyword":"variable");var r}));return Sd(["QuotedIdentifier","SpecialVar","String","LineComment","BlockComment","."],bd(i))}(t.dialect.words,e,n||ty)}function ny(t){return t.schema?function(t,e,n,i,r,o){var s;let a=(null===(s=null==o?void 0:o.spec.identifierQuotes)||void 0===s?void 0:s[0])||'"',l=new Fg(a,!!(null==o?void 0:o.spec.caseInsensitiveIdentifiers)),c=r?l.child(r):null;return l.addNamespace(t),e&&(c||l).addCompletions(e),n&&l.addCompletions(n),c&&l.addCompletions(c.list),i&&l.addCompletions((c||l).child(i).list),t=>{let{parents:e,from:n,quoted:r,empty:o,aliases:s}=function(t,e){let n=ml(t).resolveInner(e,-1),i=function(t,e){let n;for(let t=e;!n;t=t.parent){if(!t)return null;"Statement"==t.name&&(n=t)}let i=null;for(let e=n.firstChild,r=!1,o=null;e;e=e.nextSibling){let n="Keyword"==e.name?t.sliceString(e.from,e.to).toLowerCase():null,s=null;if(r)if("as"==n&&o&&Lg(e.nextSibling))s=Ig(t,e.nextSibling);else{if(n&&Dg.has(n))break;o&&Lg(e)&&(s=Ig(t,e))}else r="from"==n;s&&(i||(i=Object.create(null)),i[s]=Ng(t,o)),o=/Identifier$/.test(e.name)?e:null}return i}(t.doc,n);return"Identifier"==n.name||"QuotedIdentifier"==n.name||"Keyword"==n.name?{from:n.from,quoted:"QuotedIdentifier"==n.name?t.doc.sliceString(n.from,n.from+1):null,parents:Ug(t.doc,jg(n)),aliases:i}:"."==n.name?{from:e,quoted:null,parents:Ug(t.doc,n),aliases:i}:{from:e,quoted:null,parents:[],empty:!0,aliases:i}}(t.state,t.pos);if(o&&!t.explicit)return null;s&&1==e.length&&(e=s[e[0]]||e);let a=l;for(let t of e){for(;!a.children||!a.children[t];)if(a==l&&c)a=c;else{if(a!=c||!i)return null;a=a.child(i)}let e=a.maybeChild(t);if(!e)return null;a=e}let u=r&&t.state.sliceDoc(t.pos,t.pos+1)==r,h=a.list;return a==l&&s&&(h=h.concat(Object.keys(s).map((t=>({label:t,type:"constant"}))))),{from:n,to:u?t.pos+1:void 0,options:(d=r,O=h,d?O.map((t=>Object.assign(Object.assign({},t),{label:t.label[0]==d?t.label:d+t.label+d,apply:void 0}))):O),validFor:r?Bg:Yg};var d,O}}(t.schema,t.tables,t.schemas,t.defaultTable,t.defaultSchema,t.dialect||ry):()=>null}function iy(t){return t.schema?(t.dialect||ry).language.data.of({autocomplete:ny(t)}):[]}const ry=Jg.define({}),oy={abstract:4,and:5,array:6,as:7,true:8,false:8,break:9,case:10,catch:11,clone:12,const:13,continue:14,declare:16,default:15,do:17,echo:18,else:19,elseif:20,enddeclare:21,endfor:22,endforeach:23,endif:24,endswitch:25,endwhile:26,enum:27,extends:28,final:29,finally:30,fn:31,for:32,foreach:33,from:34,function:35,global:36,goto:37,if:38,implements:39,include:40,include_once:41,instanceof:42,insteadof:43,interface:44,list:45,match:46,namespace:47,new:48,null:49,or:50,print:51,require:52,require_once:53,return:54,switch:55,throw:56,trait:57,try:58,unset:59,use:60,var:61,public:62,private:62,protected:62,while:63,xor:64,yield:65,__proto__:null};function sy(t){let e=oy[t.toLowerCase()];return null==e?-1:e}function ay(t){return 9==t||10==t||13==t||32==t}function ly(t){return t>=97&&t<=122||t>=65&&t<=90}function cy(t){return 95==t||t>=128||ly(t)}function uy(t){return t>=48&&t<=55||t>=97&&t<=102||t>=65&&t<=70}const hy={int:!0,integer:!0,bool:!0,boolean:!0,float:!0,double:!0,real:!0,string:!0,array:!0,object:!0,unset:!0,__proto__:null},dy=new Uf((t=>{if(40==t.next){t.advance();let e=0;for(;ay(t.peek(e));)e++;let n,i="";for(;ly(n=t.peek(e));)i+=String.fromCharCode(n),e++;for(;ay(t.peek(e));)e++;41==t.peek(e)&&hy[i.toLowerCase()]&&t.acceptToken(1)}else if(60==t.next&&60==t.peek(1)&&60==t.peek(2)){for(let e=0;e<3;e++)t.advance();for(;32==t.next||9==t.next;)t.advance();let e=39==t.next;if(e&&t.advance(),!cy(t.next))return;let n=String.fromCharCode(t.next);for(;t.advance(),cy(t.next)||t.next>=48&&t.next<=55;)n+=String.fromCharCode(t.next);if(e){if(39!=t.next)return;t.advance()}if(10!=t.next&&13!=t.next)return;for(;;){let e=10==t.next||13==t.next;if(t.advance(),t.next<0)return;if(e){for(;32==t.next||9==t.next;)t.advance();let e=!0;for(let i=0;i{t.next<0&&t.acceptToken(266)})),fy=new Uf(((t,e)=>{63==t.next&&e.canShift(265)&&62==t.peek(1)&&t.acceptToken(265)}));function py(t){let e=t.peek(1);if(110==e||114==e||116==e||118==e||101==e||102==e||92==e||36==e||34==e||123==e)return 2;if(e>=48&&e<=55){let e,n=2;for(;n<5&&(e=t.peek(n))>=48&&e<=55;)n++;return n}if(120==e&&uy(t.peek(2)))return uy(t.peek(3))?4:3;if(117==e&&123==t.peek(2))for(let e=3;;e++){let n=t.peek(e);if(125==n)return 2==e?0:e+1;if(!uy(n))break}return 0}const my=new Uf(((t,e)=>{let n=!1;for(;!(34==t.next||t.next<0||36==t.next&&(cy(t.peek(1))||123==t.peek(1))||123==t.next&&36==t.peek(1));n=!0){if(92==t.next){let e=py(t);if(e){if(n)break;return t.acceptToken(3,e)}}else if(!n&&(91==t.next||45==t.next&&62==t.peek(1)&&cy(t.peek(2))||63==t.next&&45==t.peek(1)&&62==t.peek(2)&&cy(t.peek(3)))&&e.canShift(264))break;t.advance()}n&&t.acceptToken(263)})),gy=ja({"Visibility abstract final static":ll.modifier,"for foreach while do if else elseif switch try catch finally return throw break continue default case":ll.controlKeyword,"endif endfor endforeach endswitch endwhile declare enddeclare goto match":ll.controlKeyword,"and or xor yield unset clone instanceof insteadof":ll.operatorKeyword,"function fn class trait implements extends const enum global interface use var":ll.definitionKeyword,"include include_once require require_once namespace":ll.moduleKeyword,"new from echo print array list as":ll.keyword,null:ll.null,Boolean:ll.bool,VariableName:ll.variableName,"NamespaceName/...":ll.namespace,"NamedType/...":ll.typeName,Name:ll.name,"CallExpression/Name":ll.function(ll.variableName),"LabelStatement/Name":ll.labelName,"MemberExpression/Name":ll.propertyName,"MemberExpression/VariableName":ll.special(ll.propertyName),"ScopedExpression/ClassMemberName/Name":ll.propertyName,"ScopedExpression/ClassMemberName/VariableName":ll.special(ll.propertyName),"CallExpression/MemberExpression/Name":ll.function(ll.propertyName),"CallExpression/ScopedExpression/ClassMemberName/Name":ll.function(ll.propertyName),"MethodDeclaration/Name":ll.function(ll.definition(ll.variableName)),"FunctionDefinition/Name":ll.function(ll.definition(ll.variableName)),"ClassDeclaration/Name":ll.definition(ll.className),UpdateOp:ll.updateOperator,ArithOp:ll.arithmeticOperator,LogicOp:ll.logicOperator,BitOp:ll.bitwiseOperator,CompareOp:ll.compareOperator,ControlOp:ll.controlOperator,AssignOp:ll.definitionOperator,"$ ConcatOp":ll.operator,LineComment:ll.lineComment,BlockComment:ll.blockComment,Integer:ll.integer,Float:ll.float,String:ll.string,ShellExpression:ll.special(ll.string),"=> ->":ll.punctuation,"( )":ll.paren,"#[ [ ]":ll.squareBracket,"${ { }":ll.brace,"-> ?->":ll.derefOperator,", ; :: : \\":ll.separator,"PhpOpen PhpClose":ll.processingInstruction}),yy={__proto__:null,static:311,STATIC:311,class:333,CLASS:333},$y=op.deserialize({version:14,states:"$GSQ`OWOOQhQaOOP%oO`OOOOO#t'#H_'#H_O%tO#|O'#DtOOO#u'#Dw'#DwQ&SOWO'#DwO&XO$VOOOOQ#u'#Dx'#DxO&lQaO'#D|O(mQdO'#E}O(tQdO'#EQO*kQaO'#EWO,zQ`O'#ETO-PQ`O'#E^O/nQaO'#E^O/uQ`O'#EfO/zQ`O'#EoO*kQaO'#EoO0VQ`O'#HhO0[Q`O'#E{O0[Q`O'#E{OOQS'#Ic'#IcO0aQ`O'#EvOOQS'#IZ'#IZO2oQdO'#IWO6tQeO'#FUO*kQaO'#FeO*kQaO'#FfO*kQaO'#FgO*kQaO'#FhO*kQaO'#FhO*kQaO'#FkOOQO'#Id'#IdO7RQ`O'#FqOOQO'#Hi'#HiO7ZQ`O'#HOO7uQ`O'#FlO8QQ`O'#H]O8]Q`O'#FvO8eQaO'#FwO*kQaO'#GVO*kQaO'#GYO8}OrO'#G]OOQS'#Iq'#IqOOQS'#Ip'#IpOOQS'#IW'#IWO,zQ`O'#GdO,zQ`O'#GfO,zQ`O'#GkOhQaO'#GmO9UQ`O'#GnO9ZQ`O'#GqO9`Q`O'#GtO9eQeO'#GuO9eQeO'#GvO9eQeO'#GwO9oQ`O'#GxO9tQ`O'#GzO9yQaO'#G{OS,5>SOJ[QdO,5;gOOQO-E;f-E;fOL^Q`O,5;gOLcQpO,5;bO0aQ`O'#EyOLkQtO'#E}OOQS'#Ez'#EzOOQS'#Ib'#IbOM`QaO,5:wO*kQaO,5;nOOQS,5;p,5;pO*kQaO,5;pOMgQdO,5UQaO,5=hO!-eQ`O'#F}O!-jQdO'#IlO!&WQdO,5=iOOQ#u,5=j,5=jO!-uQ`O,5=lO!-xQ`O,5=mO!-}Q`O,5=nO!.YQdO,5=qOOQ#u,5=q,5=qO!.eQ`O,5=rO!.eQ`O,5=rO!.mQdO'#IwO!.{Q`O'#HXO!&WQdO,5=rO!/ZQ`O,5=rO!/fQdO'#IYO!&WQdO,5=vOOQ#u-E;_-E;_O!1RQ`O,5=kOOO#u,5:^,5:^O!1^O#|O,5:^OOO#u-E;^-E;^OOOO,5>p,5>pOOQ#y1G0S1G0SO!1fQ`O1G0XO*kQaO1G0XO!2xQ`O1G0pOOQS1G0p1G0pO!4[Q`O1G0pOOQS'#I_'#I_O*kQaO'#I_OOQS1G0q1G0qO!4cQ`O'#IaO!7lQ`O'#E}O!7yQaO'#EuOOQO'#Ia'#IaO!8TQ`O'#I`O!8]Q`O,5;_OOQS'#FQ'#FQOOQS1G1U1G1UO!8bQdO1G1]O!:dQdO1G1]O!wO#(fQaO'#HdO#(vQ`O,5>vOOQS1G0d1G0dO#)OQ`O1G0dO#)TQ`O'#I^O#*mQ`O'#I^O#*uQ`O,5;ROIbQaO,5;ROOQS1G0u1G0uPOQO'#E}'#E}O#+fQdO1G1RO0aQ`O'#HgO#-hQtO,5;cO#.YQaO1G0|OOQS,5;e,5;eO#0iQtO,5;gO#0vQdO1G0cO*kQaO1G0cO#2cQdO1G1YO#4OQdO1G1[OOQO,5<^,5<^O#4`Q`O'#HjO#4nQ`O,5?ROOQO1G1w1G1wO#4vQ`O,5?ZO!&WQdO1G3TO<_Q`O1G3TOOQ#u1G3U1G3UO#4{Q`O1G3YO!1RQ`O1G3VO#5WQ`O1G3VO#5]QpO'#FoO#5kQ`O'#FoO#5{Q`O'#FoO#6WQ`O'#FoO#6`Q`O'#FsO#6eQ`O'#FtOOQO'#If'#IfO#6lQ`O'#IeO#6tQ`O,5tOOQ#u1G3b1G3bOOQ#u1G3V1G3VO!-xQ`O1G3VO!1UQ`O1G3VOOO#u1G/x1G/xO*kQaO7+%sO#MuQdO7+%sOOQS7+&[7+&[O$ bQ`O,5>yO>UQaO,5;`O$ iQ`O,5;aO$#OQaO'#HfO$#YQ`O,5>zOOQS1G0y1G0yO$#bQ`O'#EYO$#gQ`O'#IXO$#oQ`O,5:sOOQS1G0e1G0eO$#tQ`O1G0eO$#yQ`O1G0iO9yQaO1G0iOOQO,5>O,5>OOOQO-E;b-E;bOOQS7+&O7+&OO>UQaO,5;SO$%`QaO'#HeO$%jQ`O,5>xOOQS1G0m1G0mO$%rQ`O1G0mOOQS,5>R,5>ROOQS-E;e-E;eO$%wQdO7+&hO$'yQtO1G1RO$(WQdO7+%}OOQS1G0i1G0iOOQO,5>U,5>UOOQO-E;h-E;hOOQ#u7+(o7+(oO!&WQdO7+(oOOQ#u7+(t7+(tO#KmQ`O7+(tO0aQ`O7+(tOOQ#u7+(q7+(qO!-xQ`O7+(qO!1UQ`O7+(qO!1RQ`O7+(qO$)sQ`O,5UQaO,5],5>]OOQS-E;o-E;oO$.iQdO7+'hO$.yQpO7+'hO$/RQdO'#IiOOQO,5dOOQ#u,5>d,5>dOOQ#u-E;v-E;vO$;lQaO7+(lO$cOOQS-E;u-E;uO!&WQdO7+(nO$=mQdO1G2TOOQS,5>[,5>[OOQS-E;n-E;nOOQ#u7+(r7+(rO$?nQ`O'#GQO$?uQ`O'#GQO$@ZQ`O'#HUOOQO'#Hy'#HyO$@`Q`O,5=oOOQ#u,5=o,5=oO$@gQpO7+(tOOQ#u7+(x7+(xO!&WQdO7+(xO$@rQdO,5>fOOQS-E;x-E;xO$AQQdO1G4}O$A]Q`O,5=tO$AbQ`O,5=tO$AmQ`O'#H{O$BRQ`O,5?dOOQS1G3_1G3_O#KrQ`O7+(xO$BZQdO,5=|OOQS-E;`-E;`O$CvQdO<Q,5>QOOQO-E;d-E;dO$8YQaO,5:tO$FxQaO'#HcO$GVQ`O,5>sOOQS1G0_1G0_OOQS7+&P7+&PO$G_Q`O7+&TO$HtQ`O1G0nO$JZQ`O,5>POOQO,5>P,5>POOQO-E;c-E;cOOQS7+&X7+&XOOQS7+&T7+&TOOQ#u<UQaO1G1uO$KsQ`O1G1uO$LOQ`O1G1yOOQO1G1y1G1yO$LTQ`O1G1uO$L]Q`O1G1uO$MrQ`O1G1zO>UQaO1G1zOOQO,5>V,5>VOOQO-E;i-E;iOOQS<`OOQ#u-E;r-E;rOhQaO<aOOQO-E;s-E;sO!&WQdO<g,5>gOOQO-E;y-E;yO!&WQdO<UQaO,5;TOOQ#uANAzANAzO#KmQ`OANAzOOQ#uANAwANAwO!-xQ`OANAwO%)vQ`O7+'aO>UQaO7+'aOOQO7+'e7+'eO%+]Q`O7+'aO%+hQ`O7+'eO>UQaO7+'fO%+mQ`O7+'fO%-SQ`O'#HlO%-bQ`O,5?SO%-bQ`O,5?SOOQO1G1{1G1{O$+qQpOAN@dOOQSAN@dAN@dO0aQ`OAN@dO%-jQtOANCgO%-xQ`OAN@dO*kQaOAN@nO%.QQdOAN@nO%.bQpOAN@nOOQS,5>X,5>XOOQS-E;k-E;kOOQO1G2U1G2UO!&WQdO1G2UO$/dQpO1G2UO<_Q`O1G2SO!.YQdO1G2WO!&WQdO1G2SOOQO1G2W1G2WOOQO1G2S1G2SO%.jQaO'#GSOOQO1G2X1G2XOOQSAN@oAN@oOOOQ<UQaO<W,5>WO%6wQ`O,5>WOOQO-E;j-E;jO%6|Q`O1G4nOOQSG26OG26OO$+qQpOG26OO0aQ`OG26OO%7UQdOG26YO*kQaOG26YOOQO7+'p7+'pO!&WQdO7+'pO!&WQdO7+'nOOQO7+'r7+'rOOQO7+'n7+'nO%7fQ`OLD+tO%8uQ`O'#E}O%9PQ`O'#IZO!&WQdO'#HrO%:|QaO,5^,5>^OOQP-E;p-E;pOOQO1G2Y1G2YOOQ#uLD,bLD,bOOQTG27RG27RO!&WQdOLD,xO!&WQdO<wO&EPQdO1G0cO#.YQaO1G0cO&F{QdO1G1YO&HwQdO1G1[O#.YQaO1G1|O#.YQaO7+%sO&JsQdO7+%sO&LoQdO7+%}O#.YQaO7+'hO&NkQdO7+'hO'!gQdO<lQdO,5>wO(@nQdO1G0cO'.QQaO1G0cO(BpQdO1G1YO(DrQdO1G1[O'.QQaO1G1|O'.QQaO7+%sO(FtQdO7+%sO(HvQdO7+%}O'.QQaO7+'hO(JxQdO7+'hO(LzQdO<wO*1sQaO'#HdO*2TQ`O,5>vO*2]QdO1G0cO9yQaO1G0cO*4XQdO1G1YO*6TQdO1G1[O9yQaO1G1|O>UQaO'#HwO*8PQ`O,5=[O*8XQaO'#HbO*8cQ`O,5>tO9yQaO7+%sO*8kQdO7+%sO*:gQ`O1G0iO>UQaO1G0iO*;|QdO7+%}O9yQaO7+'hO*=xQdO7+'hO*?tQ`O,5>cO*AZQ`O,5=|O*BpQdO<UQaO'#FeO>UQaO'#FfO>UQaO'#FgO>UQaO'#FhO>UQaO'#FhO>UQaO'#FkO+'XQaO'#FwO>UQaO'#GVO>UQaO'#GYO+'`QaO,5:mO>UQaO,5;qO>UQaO,5;qO>UQaO,5;qO>UQaO,5;qO>UQaO,5;qO>UQaO,5;qO>UQaO,5;qO>UQaO,5;qO>UQaO,5;qO>UQaO,5;qO>UQaO,5;qO>UQaO,5;qO>UQaO,5;qO>UQaO,5;qO>UQaO,5;qO>UQaO,5;qO+'gQ`O'#I]O$8YQaO'#EaO+)PQaOG26YO$8YQaO'#I]O+*{Q`O'#I[O++TQaO,5:wO>UQaO,5;nO>UQaO,5;pO++[Q`O,5UQaO1G0XO+9hQ`O1G1]O+;TQ`O1G1]O+]Q`O1G1]O+?xQ`O1G1]O+AeQ`O1G1]O+CQQ`O1G1]O+DmQ`O1G1]O+FYQ`O1G1]O+GuQ`O1G1]O+IbQ`O1G1]O+J}Q`O1G1]O+LjQ`O1G1]O+NVQ`O1G1]O, rQ`O1G1]O,#_Q`O1G0cO>UQaO1G0cO,$zQ`O1G1YO,&gQ`O1G1[O,(SQ`O1G1|O>UQaO1G1|O>UQaO7+%sO,([Q`O7+%sO,)wQ`O7+%}O>UQaO7+'hO,+dQ`O7+'hO,+lQ`O7+'hO,-XQpO7+'hO,-aQ`O<UQaO<UQaOAN@nO,0qQ`OAN@nO,2^QpOAN@nO,2fQ`OG26YO>UQaOG26YO,4RQ`OLD+tO,5nQaO,5:}O>UQaO1G0iO,5uQ`O'#I]O$8YQaO'#FeO$8YQaO'#FfO$8YQaO'#FgO$8YQaO'#FhO$8YQaO'#FhO+)PQaO'#FhO$8YQaO'#FkO,6SQaO'#FwO,6ZQaO'#FwO$8YQaO'#GVO+)PQaO'#GVO$8YQaO'#GYO$8YQaO,5;qO+)PQaO,5;qO$8YQaO,5;qO+)PQaO,5;qO$8YQaO,5;qO+)PQaO,5;qO$8YQaO,5;qO+)PQaO,5;qO$8YQaO,5;qO+)PQaO,5;qO$8YQaO,5;qO+)PQaO,5;qO$8YQaO,5;qO+)PQaO,5;qO$8YQaO,5;qO+)PQaO,5;qO$8YQaO,5;qO+)PQaO,5;qO$8YQaO,5;qO+)PQaO,5;qO$8YQaO,5;qO+)PQaO,5;qO$8YQaO,5;qO+)PQaO,5;qO$8YQaO,5;qO+)PQaO,5;qO$8YQaO,5;qO+)PQaO,5;qO$8YQaO,5;qO+)PQaO,5;qO$8YQaO,5;qO+)PQaO,5;qO,8YQ`O'#FlO>UQaO'#EaO>UQaO'#I]O,8bQaO,5:wO,8iQaO,5:wO$8YQaO,5;nO+)PQaO,5;nO$8YQaO,5;pO,:hQ`O,5wO-IcQ`O1G0cO-KOQ`O1G0cO$8YQaO1G0cO+)PQaO1G0cO-L_Q`O1G1YO-MzQ`O1G1YO. ZQ`O1G1[O$8YQaO1G1|O$8YQaO7+%sO+)PQaO7+%sO.!vQ`O7+%sO.$cQ`O7+%sO.%rQ`O7+%}O.'_Q`O7+%}O$8YQaO7+'hO.(nQ`O7+'hO.*ZQ`O<fQ`O,5>wO.@RQ`O1G1|O!%WQ`O1G1|O0aQ`O1G1|O0aQ`O7+'hO.@ZQ`O7+'hO.@cQpO7+'hO.@kQpO<UO#X&PO~P>UO!o&SO!s&RO#b&RO~OPgOQ|OU^OW}O[8lOo=yOs#hOx8jOy8jO}`O!O]O!Q8pO!R}O!T8oO!U8kO!V8kO!Y8rO!c8iO!s&VO!y[O#U&WO#W_O#bhO#daO#ebO#peO$T8nO$]8mO$^8nO$aqO$z8qO${!OO$}}O%O}O%V|O'g{O~O!x'SP~PAOO!s&[O#b&[O~OT#TOz#RO!S#UO!b#VO!o!{O!v!yO!y!}O#S#QO#W!zO#`!|O#a!|O#s#PO#z#SO#{#WO#|#XO#}#YO$O#ZO$Q#]O$R#^O$S#_O$T#`O$U#aO$V#bO$W#bO$z#dO~O!x&nO~PCqO!x'VX!}'VX#O'VX#X'VX!n'VXV'VX!q'VX#u'VX#w'VXw'VX~P&sO!y$hO#S&oO~Oo$mOs$lO~O!o&pO~O!}&sO#S;dO#U;cO!x'OP~P9yOT6iOz6gO!S6jO!b6kO!o!{O!v8sO!y!}O#S#QO#W!zO#`!|O#a!|O#s#PO#z6hO#{6lO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dO!}'PX#X'PX~O#O&tO~PGSO!}&wO#X'OX~O#X&yO~O!}'OO!x'QP~P9yO!n'PO~PCqO!m#oa!o#oa#S#oa#p#qX&s#oa!x#oa#O#oaw#oa~OT#oaz#oa!S#oa!b#oa!v#oa!y#oa#W#oa#`#oa#a#oa#s#oa#z#oa#{#oa#|#oa#}#oa$O#oa$Q#oa$R#oa$S#oa$T#oa$U#oa$V#oa$W#oa$z#oa!}#oa#X#oa!n#oaV#oa!q#oa#u#oa#w#oa~PIpO!s'RO~O!x'UO#l'SO~O!x'VX#l'VX#p#qX#S'VX#U'VX#b'VX!o'VX#O'VXw'VX!m'VX&s'VX~O#S'YO~P*kO!m$Xa&s$Xa!x$Xa!n$Xa~PCqO!m$Ya&s$Ya!x$Ya!n$Ya~PCqO!m$Za&s$Za!x$Za!n$Za~PCqO!m$[a&s$[a!x$[a!n$[a~PCqO!o!{O!y!}O#W!zO#`!|O#a!|O#s#PO$z#dOT$[a!S$[a!b$[a!m$[a!v$[a#S$[a#z$[a#{$[a#|$[a#}$[a$O$[a$Q$[a$R$[a$S$[a$T$[a$U$[a$V$[a$W$[a&s$[a!x$[a!n$[a~Oz#RO~PNyO!m$_a&s$_a!x$_a!n$_a~PCqO!y!}O!}$fX#X$fX~O!}'^O#X'ZX~O#X'`O~O!s$kO#S'aO~O]'cO~O!s'eO~O!s'fO~O$l'gO~O!`'mO#S'kO#U'lO#b'jO$drO!x'XP~P0aO!^'sO!oXO!q'rO~O!s'uO!y$hO~O!y$hO#S'wO~O!y$hO#S'yO~O#u'zO!m$sX!}$sX&s$sX~O!}'{O!m'bX&s'bX~O!m#cO&s#cO~O!q(PO#O(OO~O!m$ka&s$ka!x$ka!n$ka~PCqOl(ROw(SO!o(TO!y!}O~O!o!{O!y!}O#W!zO#`!|O#a!|O#s#PO~OT$yaz$ya!S$ya!b$ya!m$ya!v$ya#S$ya#z$ya#{$ya#|$ya#}$ya$O$ya$Q$ya$R$ya$S$ya$T$ya$U$ya$V$ya$W$ya$z$ya&s$ya!x$ya!}$ya#O$ya#X$ya!n$ya!q$yaV$ya#u$ya#w$ya~P!'WO!m$|a&s$|a!x$|a!n$|a~PCqO#W([O#`(YO#a(YO&r(ZOR&gX!o&gX#b&gX#e&gX&q&gX'f&gX~O'f(_O~P8lO!q(`O~PhO!o(cO!q(dO~O!q(`O&s(gO~PhO!a(kO~O!m(lO~P9yOZ(wOn(xO~O!s(zO~OT6iOz6gO!S6jO!b6kO!v8sO!}({O#S#QO#z6hO#{6lO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dO!m'jX&s'jX~P!'WO#u)PO~O!})QO!m'`X&s'`X~Ol(RO!o(TO~Ow(SO!o)WO!q)ZO~O!m#cO!oXO&s#cO~O!o%pO!s#yO~OV)aO!})_O!m'kX&s'kX~O])cOs)cO!s#gO#peO~O!o%pO!s#gO#p)hO~OT6iOz6gO!S6jO!b6kO!v8sO!})iO#S#QO#z6hO#{6lO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dO!m&|X&s&|X#O&|X~P!'WOl(ROw(SO!o(TO~O!i)oO&t)oO~OT8vOz8tO!S8wO!b8xO!q)pO!v=ZO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dO~P!'WOT8vOz8tO!S8wO!b8xO!v=ZO#S#QO#X)rO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dO~P!'WO!n)rO~PCqOT8vOz8tO!S8wO!b8xO!v=ZO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dO!x'TX!}'TX~P!'WOT'VXz'VX!S'VX!b'VX!o'VX!v'VX!y'VX#S'VX#W'VX#`'VX#a'VX#p#qX#s'VX#z'VX#{'VX#|'VX#}'VX$O'VX$Q'VX$R'VX$S'VX$T'VX$U'VX$V'VX$W'VX$z'VX~O!q)tO!x'VX!}'VX~P!5xO!x#iX!}#iX~P>UO!})vO!x'SX~O!x)xO~O$z#dOT#yiz#yi!S#yi!b#yi!m#yi!v#yi#S#yi#z#yi#{#yi#|#yi#}#yi$O#yi$Q#yi$R#yi$S#yi$T#yi$U#yi$V#yi$W#yi&s#yi!x#yi!}#yi#O#yi#X#yi!n#yi!q#yiV#yi#u#yi#w#yi~P!'WOz#RO#S#QO#z#SO#{#WO#|#XO#}#YO$O#ZO$Q#]O$R#^O$S#_O$T#`O$U#aO$V#bO$W#bO$z#dOT#yi!S#yi!b#yi!m#yi!v#yi&s#yi!x#yi!n#yi~P!'WOz#RO!v!yO#S#QO#z#SO#{#WO#|#XO#}#YO$O#ZO$Q#]O$R#^O$S#_O$T#`O$U#aO$V#bO$W#bO$z#dOT#yi!S#yi!b#yi!m#yi&s#yi!x#yi!n#yi~P!'WOT#TOz#RO!b#VO!v!yO#S#QO#z#SO#{#WO#|#XO#}#YO$O#ZO$Q#]O$R#^O$S#_O$T#`O$U#aO$V#bO$W#bO$z#dO!S#yi!m#yi&s#yi!x#yi!n#yi~P!'WOT#TOz#RO!v!yO#S#QO#z#SO#{#WO#|#XO#}#YO$O#ZO$Q#]O$R#^O$S#_O$T#`O$U#aO$V#bO$W#bO$z#dO!S#yi!b#yi!m#yi&s#yi!x#yi!n#yi~P!'WOz#RO#S#QO#|#XO#}#YO$O#ZO$Q#]O$R#^O$S#_O$T#`O$U#aO$V#bO$W#bO$z#dOT#yi!S#yi!b#yi!m#yi!v#yi#z#yi#{#yi&s#yi!x#yi!n#yi~P!'WOz#RO#S#QO#}#YO$O#ZO$Q#]O$R#^O$S#_O$T#`O$U#aO$V#bO$W#bO$z#dOT#yi!S#yi!b#yi!m#yi!v#yi#z#yi#{#yi#|#yi&s#yi!x#yi!n#yi~P!'WOz#RO#S#QO$O#ZO$Q#]O$R#^O$S#_O$T#`O$U#aO$V#bO$W#bO$z#dOT#yi!S#yi!b#yi!m#yi!v#yi#z#yi#{#yi#|#yi#}#yi&s#yi!x#yi!n#yi~P!'WOz#RO#S#QO$Q#]O$R#^O$S#_O$T#`O$U#aO$V#bO$W#bO$z#dOT#yi!S#yi!b#yi!m#yi!v#yi#z#yi#{#yi#|#yi#}#yi$O#yi&s#yi!x#yi!n#yi~P!'WOz#RO$Q#]O$R#^O$S#_O$T#`O$U#aO$V#bO$W#bO$z#dOT#yi!S#yi!b#yi!m#yi!v#yi#S#yi#z#yi#{#yi#|#yi#}#yi$O#yi&s#yi!x#yi!n#yi~P!'WOz#RO$R#^O$S#_O$T#`O$U#aO$V#bO$W#bO$z#dOT#yi!S#yi!b#yi!m#yi!v#yi#S#yi#z#yi#{#yi#|#yi#}#yi$O#yi$Q#yi&s#yi!x#yi!n#yi~P!'WOz#RO$S#_O$T#`O$U#aO$V#bO$W#bO$z#dOT#yi!S#yi!b#yi!m#yi!v#yi#S#yi#z#yi#{#yi#|#yi#}#yi$O#yi$Q#yi$R#yi&s#yi!x#yi!n#yi~P!'WOz#RO$T#`O$V#bO$W#bO$z#dOT#yi!S#yi!b#yi!m#yi!v#yi#S#yi#z#yi#{#yi#|#yi#}#yi$O#yi$Q#yi$R#yi$S#yi$U#yi&s#yi!x#yi!n#yi~P!'WOz#RO$V#bO$W#bO$z#dOT#yi!S#yi!b#yi!m#yi!v#yi#S#yi#z#yi#{#yi#|#yi#}#yi$O#yi$Q#yi$R#yi$S#yi$T#yi$U#yi&s#yi!x#yi!n#yi~P!'WOz#RO$S#_O$T#`O$V#bO$W#bO$z#dOT#yi!S#yi!b#yi!m#yi!v#yi#S#yi#z#yi#{#yi#|#yi#}#yi$O#yi$Q#yi$R#yi$U#yi&s#yi!x#yi!n#yi~P!'WOz#RO$W#bO$z#dOT#yi!S#yi!b#yi!m#yi!v#yi#S#yi#z#yi#{#yi#|#yi#}#yi$O#yi$Q#yi$R#yi$S#yi$T#yi$U#yi$V#yi&s#yi!x#yi!n#yi~P!'WO_)yO~P9yO!x)|O~O#S*PO~P9yOT6iOz6gO!S6jO!b6kO!v8sO#S#QO#z6hO#{6lO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dO!}#Ta#X#Ta#O#Ta!m#Ta&s#Ta!x#Ta!n#TaV#Ta!q#Ta~P!'WOT6iOz6gO!S6jO!b6kO!v8sO#S#QO#z6hO#{6lO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dO!}'Pa#X'Pa#O'Pa!m'Pa&s'Pa!x'Pa!n'PaV'Pa!q'Pa~P!'WO#S#oO#U#nO!}&WX#X&WX~P9yO!}&wO#X'Oa~O#X*SO~OT6iOz6gO!S6jO!b6kO!v8sO!}*UO#O*TO#S#QO#z6hO#{6lO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dO!x'QX~P!'WO!}*UO!x'QX~O!x*WO~O!m#oi!o#oi#S#oi#p#qX&s#oi!x#oi#O#oiw#oi~OT#oiz#oi!S#oi!b#oi!v#oi!y#oi#W#oi#`#oi#a#oi#s#oi#z#oi#{#oi#|#oi#}#oi$O#oi$Q#oi$R#oi$S#oi$T#oi$U#oi$V#oi$W#oi$z#oi!}#oi#X#oi!n#oiV#oi!q#oi#u#oi#w#oi~P#*zO#l'SO!x#ka#S#ka#U#ka#b#ka!o#ka#O#kaw#ka!m#ka&s#ka~OPgOQ|OU^OW}O[4OOo5xOs#hOx3zOy3zO}`O!O]O!Q2^O!R}O!T4UO!U3|O!V3|O!Y2`O!c3xO!s#gO!y[O#W_O#bhO#daO#ebO#peO$T4SO$]4QO$^4SO$aqO$z2_O${!OO$}}O%O}O%V|O'g{O~O#l#oa#U#oa#b#oa~PIpOz#RO!v!yO#S#QO#z#SO#{#WO#|#XO#}#YO$O#ZO$Q#]O$R#^O$S#_O$T#`O$U#aO$V#bO$W#bO$z#dOT#Pi!S#Pi!b#Pi!m#Pi&s#Pi!x#Pi!n#Pi~P!'WOz#RO!v!yO#S#QO#z#SO#{#WO#|#XO#}#YO$O#ZO$Q#]O$R#^O$S#_O$T#`O$U#aO$V#bO$W#bO$z#dOT#vi!S#vi!b#vi!m#vi&s#vi!x#vi!n#vi~P!'WO!m#xi&s#xi!x#xi!n#xi~PCqO!s#gO#peO!}&^X#X&^X~O!}'^O#X'Za~O!s'uO~Ow(SO!o)WO!q*fO~O!s*jO~O#S*lO#U*mO#b*kO#l'SO~O#S*lO#U*mO#b*kO$drO~P0aO#u*oO!x$cX!}$cX~O#U*mO#b*kO~O#b*pO~O#b*rO~P0aO!}*sO!x'XX~O!x*uO~O!y*wO~O!^*{O!oXO!q*zO~O!q*}O!o'ci!m'ci&s'ci~O!q+QO#O+PO~O#b$nO!m&eX!}&eX&s&eX~O!}'{O!m'ba&s'ba~OT$kiz$ki!S$ki!b$ki!m$ki!o$ki!v$ki!y$ki#S$ki#W$ki#`$ki#a$ki#s$ki#u#fa#w#fa#z$ki#{$ki#|$ki#}$ki$O$ki$Q$ki$R$ki$S$ki$T$ki$U$ki$V$ki$W$ki$z$ki&s$ki!x$ki!}$ki#O$ki#X$ki!n$ki!q$kiV$ki~OS+^O]+aOm+^Os$aO!^+dO!_+^O!`+^O!n+hO#b$nO$aqO$drO~P0aO!s+lO~O#W+nO#`+mO#a+mO~O!s+pO#b+pO$}+pO%T+oO~O!n+qO~PCqOc%XXd%XXh%XXj%XXf%XXg%XXe%XX~PhOc+uOd+sOP%WiQ%WiS%WiU%WiW%WiX%Wi[%Wi]%Wi^%Wi`%Wia%Wib%Wik%Wim%Wio%Wip%Wiq%Wis%Wit%Wiu%Wiv%Wix%Wiy%Wi|%Wi}%Wi!O%Wi!P%Wi!Q%Wi!R%Wi!T%Wi!U%Wi!V%Wi!W%Wi!X%Wi!Y%Wi!Z%Wi![%Wi!]%Wi!^%Wi!`%Wi!a%Wi!c%Wi!m%Wi!o%Wi!s%Wi!y%Wi#W%Wi#b%Wi#d%Wi#e%Wi#p%Wi$T%Wi$]%Wi$^%Wi$a%Wi$d%Wi$l%Wi$z%Wi${%Wi$}%Wi%O%Wi%V%Wi&p%Wi'g%Wi&t%Wi!n%Wih%Wij%Wif%Wig%WiY%Wi_%Wii%Wie%Wi~Oc+yOd+vOh+xO~OY+zO_+{O!n,OO~OY+zO_+{Oi%^X~Oi,QO~Oj,RO~O!m,TO~P9yO!m,VO~Of,WO~OT6iOV,XOz6gO!S6jO!b6kO!v8sO#S#QO#z6hO#{6lO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dO~P!'WOg,YO~O!y,ZO~OZ(wOn(xOP%liQ%liS%liU%liW%liX%li[%li]%li^%li`%lia%lib%lik%lim%lio%lip%liq%lis%lit%liu%liv%lix%liy%li|%li}%li!O%li!P%li!Q%li!R%li!T%li!U%li!V%li!W%li!X%li!Y%li!Z%li![%li!]%li!^%li!`%li!a%li!c%li!m%li!o%li!s%li!y%li#W%li#b%li#d%li#e%li#p%li$T%li$]%li$^%li$a%li$d%li$l%li$z%li${%li$}%li%O%li%V%li&p%li'g%li&t%li!n%lic%lid%lih%lij%lif%lig%liY%li_%lii%lie%li~O#u,_O~O!}({O!m%da&s%da~O!x,bO~O!s%dO!m&dX!}&dX&s&dX~O!})QO!m'`a&s'`a~OS+^OY,iOm+^Os$aO!^+dO!_+^O!`+^O$aqO$drO~O!n,lO~P#JwO!o)WO~O!o%pO!s'RO~O!s#gO#peO!m&nX!}&nX&s&nX~O!})_O!m'ka&s'ka~O!s,rO~OV,sO!n%|X!}%|X~O!},uO!n'lX~O!n,wO~O!m&UX!}&UX&s&UX#O&UX~P9yO!})iO!m&|a&s&|a#O&|a~Oz#RO#S#QO#z#SO#{#WO#|#XO#}#YO$O#ZO$Q#]O$R#^O$S#_O$T#`O$U#aO$V#bO$W#bO$z#dOT!uq!S!uq!b!uq!m!uq!v!uq&s!uq!x!uq!n!uq~P!'WO!n,|O~PCqOT8vOz8tO!S8wO!b8xO!v=ZO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dO!x#ia!}#ia~P!'WO!x&YX!}&YX~PAOO!})vO!x'Sa~O#O-QO~O!}-RO!n&{X~O!n-TO~O!x-UO~OT6iOz6gO!S6jO!b6kO!v8sO#S#QO#z6hO#{6lO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dO!}#Vi#X#Vi~P!'WO!x&XX!}&XX~P9yO!}*UO!x'Qa~O!x-[O~OT#jqz#jq!S#jq!b#jq!m#jq!v#jq#S#jq#u#jq#w#jq#z#jq#{#jq#|#jq#}#jq$O#jq$Q#jq$R#jq$S#jq$T#jq$U#jq$V#jq$W#jq$z#jq&s#jq!x#jq!}#jq#O#jq#X#jq!n#jq!q#jqV#jq~P!'WO#l#oi#U#oi#b#oi~P#*zOz#RO!v!yO#S#QO#z#SO#{#WO#|#XO#}#YO$O#ZO$Q#]O$R#^O$S#_O$T#`O$U#aO$V#bO$W#bO$z#dOT#Pq!S#Pq!b#Pq!m#Pq&s#Pq!x#Pq!n#Pq~P!'WO#u-dO!x$ca!}$ca~O#U-fO#b-eO~O#b-gO~O#S-hO#U-fO#b-eO#l'SO~O#b-jO#l'SO~O#u-kO!x$ha!}$ha~O!`'mO#S'kO#U'lO#b'jO$drO!x&_X!}&_X~P0aO!}*sO!x'Xa~O!oXO#l'SO~O#S-pO#b-oO!x'[P~O!oXO!q-rO~O!q-uO!o'cq!m'cq&s'cq~O!^-wO!oXO!q-rO~O!q-{O#O-zO~OT6iOz6gO!S6jO!b6kO!v8sO#S#QO#z6hO#{6lO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dO!m$si!}$si&s$si~P!'WO!m$jq&s$jq!x$jq!n$jq~PCqO#O-zO#l'SO~O!}-|Ow']X!o']X!m']X&s']X~O#b$nO#l'SO~OS+^O].ROm+^Os$aO!_+^O!`+^O#b$nO$aqO$drO~P0aOS+^O].ROm+^Os$aO!_+^O!`+^O#b$nO$aqO~P0aOS+^O]+aOm+^Os$aO!^+dO!_+^O!`+^O!n.ZO#b$nO$aqO$drO~P0aO!s.^O~O!s._O#b._O$}._O%T+oO~O$}.`O~O#X.aO~Oc%Xad%Xah%Xaj%Xaf%Xag%Xae%Xa~PhOc.dOd+sOP%WqQ%WqS%WqU%WqW%WqX%Wq[%Wq]%Wq^%Wq`%Wqa%Wqb%Wqk%Wqm%Wqo%Wqp%Wqq%Wqs%Wqt%Wqu%Wqv%Wqx%Wqy%Wq|%Wq}%Wq!O%Wq!P%Wq!Q%Wq!R%Wq!T%Wq!U%Wq!V%Wq!W%Wq!X%Wq!Y%Wq!Z%Wq![%Wq!]%Wq!^%Wq!`%Wq!a%Wq!c%Wq!m%Wq!o%Wq!s%Wq!y%Wq#W%Wq#b%Wq#d%Wq#e%Wq#p%Wq$T%Wq$]%Wq$^%Wq$a%Wq$d%Wq$l%Wq$z%Wq${%Wq$}%Wq%O%Wq%V%Wq&p%Wq'g%Wq&t%Wq!n%Wqh%Wqj%Wqf%Wqg%WqY%Wq_%Wqi%Wqe%Wq~Oc.iOd+vOh.hO~O!q(`O~OP6]OQ|OU^OW}O[:fOo>ROs#hOx:dOy:dO}`O!O]O!Q:kO!R}O!T:jO!U:eO!V:eO!Y:oO!c8gO!s#gO!y[O#W_O#bhO#daO#ebO#peO$T:hO$]:gO$^:hO$aqO$z:mO${!OO$}}O%O}O%V|O'g{O~O!m.lO!q.lO~OY+zO_+{O!n.nO~OY+zO_+{Oi%^a~O!x.rO~P>UO!m.tO~O!m.tO~P9yOQ|OW}O!R}O$}}O%O}O%V|O'g{O~OT6iOz6gO!S6jO!b6kO!v8sO#S#QO#z6hO#{6lO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dO!m&ka!}&ka&s&ka~P!'WOT6iOz6gO!S6jO!b6kO!v8sO#S#QO#z6hO#{6lO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dO!m$qi!}$qi&s$qi~P!'WOS+^Om+^Os$aO!_+^O!`+^O$aqO$drO~OY/PO~P$?VOS+^Om+^Os$aO!_+^O!`+^O$aqO~O!s/QO~O!n/SO~P#JwOw(SO!o)WO#l'SO~OV/VO!m&na!}&na&s&na~O!})_O!m'ki&s'ki~O!s/XO~OV/YO!n%|a!}%|a~O]/[Os/[O!s#gO#peO!n&oX!}&oX~O!},uO!n'la~OT6iOz6gO!S6jO!b6kO!v8sO#S#QO#z6hO#{6lO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dO!m&Ua!}&Ua&s&Ua#O&Ua~P!'WOz#RO#S#QO#z#SO#{#WO#|#XO#}#YO$O#ZO$Q#]O$R#^O$S#_O$T#`O$U#aO$V#bO$W#bO$z#dOT!uy!S!uy!b!uy!m!uy!v!uy&s!uy!x!uy!n!uy~P!'WOT8vOz8tO!S8wO!b8xO!v=ZO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dO!x#hi!}#hi~P!'WO_)yO!n&VX!}&VX~P9yO!}-RO!n&{a~OT6iOz6gO!S6jO!b6kO!v8sO#S#QO#z6hO#{6lO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dO!}#Vq#X#Vq~P!'WOT8vOz8tO!S8wO!b8xO!v=ZO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dO!x#[i!}#[i~P!'WOT6iOz6gO!S6jO!b6kO!v8sO#O/cO#S#QO#z6hO#{6lO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dO!x&Xa!}&Xa~P!'WO#u/iO!x$ci!}$ci~O#b/jO~O#U/lO#b/kO~OT8vOz8tO!S8wO!b8xO!v=ZO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dO!x$ci!}$ci~P!'WO#u/mO!x$hi!}$hi~O!}/oO!x'[X~O#b/qO~O!x/rO~O!oXO!q/uO~O#l'SO!o'cy!m'cy&s'cy~O!m$jy&s$jy!x$jy!n$jy~PCqO#O/xO#l'SO~O!s#gO#peOw&aX!o&aX!}&aX!m&aX&s&aX~O!}-|Ow']a!o']a!m']a&s']a~OU$PO]0QO!R$PO!s$OO!v#}O#b$nO#p2XO~P$?uO!m#cO!o0VO&s#cO~O#X0YO~Oh0_O~OT:tOz:pO!S:vO!b:xO!m0`O!q0`O!v=mO#S#QO#z:rO#{:zO#|:|O#};OO$O;QO$Q;UO$R;WO$S;YO$T;[O$U;^O$V;`O$W;`O$z#dO~P!'WOY%]a_%]a!n%]ai%]a~PhO!x0bO~O!x0bO~P>UO!m0dO~OT6iOz6gO!S6jO!b6kO!v8sO!x0fO#O0eO#S#QO#z6hO#{6lO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dO~P!'WO!x0fO~O!x0gO#b0hO#l'SO~O!x0iO~O!s0jO~O!m#cO#u0lO&s#cO~O!s0mO~O!})_O!m'kq&s'kq~O!s0nO~OV0oO!n%}X!}%}X~OT:tOz:pO!S:vO!b:xO!v=mO#S#QO#z:rO#{:zO#|:|O#};OO$O;QO$Q;UO$R;WO$S;YO$T;[O$U;^O$V;`O$W;`O$z#dO!n!|i!}!|i~P!'WOT8vOz8tO!S8wO!b8xO!v=ZO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dO!x$cq!}$cq~P!'WO#u0vO!x$cq!}$cq~O#b0wO~OT8vOz8tO!S8wO!b8xO!v=ZO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dO!x$hq!}$hq~P!'WO#S0zO#b0yO!x&`X!}&`X~O!}/oO!x'[a~O#l'SO!o'c!R!m'c!R&s'c!R~O!oXO!q1PO~O!m$j!R&s$j!R!x$j!R!n$j!R~PCqO#O1RO#l'SO~OP6]OU^O[9WOo>SOs#hOx9WOy9WO}`O!O]O!Q:lO!T9WO!U9WO!V9WO!Y9WO!c8hO!n1^O!s1YO!y[O#W_O#bhO#daO#ebO#peO$T:iO$]9WO$^:iO$aqO$z:nO${!OO~P$;lOh1_O~OY%[i_%[i!n%[ii%[i~PhOY%]i_%]i!n%]ii%]i~PhO!x1bO~O!x1bO~P>UO!x1eO~O!m#cO#u1iO&s#cO~O$}1jO%V1jO~O!s1kO~OV1lO!n%}a!}%}a~OT8vOz8tO!S8wO!b8xO!v=ZO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dO!x#]i!}#]i~P!'WOT8vOz8tO!S8wO!b8xO!v=ZO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dO!x$cy!}$cy~P!'WOT8vOz8tO!S8wO!b8xO!v=ZO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dO!x$hy!}$hy~P!'WO#b1nO~O!}/oO!x'[i~O!m$j!Z&s$j!Z!x$j!Z!n$j!Z~PCqOT:uOz:qO!S:wO!b:yO!v=nO#S#QO#z:sO#{:{O#|:}O#};PO$O;RO$Q;VO$R;XO$S;ZO$T;]O$U;_O$V;aO$W;aO$z#dO~P!'WOV1uO{1tO~P!5xOV1uO{1tOT&}Xz&}X!S&}X!b&}X!o&}X!v&}X!y&}X#S&}X#W&}X#`&}X#a&}X#s&}X#u&}X#w&}X#z&}X#{&}X#|&}X#}&}X$O&}X$Q&}X$R&}X$S&}X$T&}X$U&}X$V&}X$W&}X$z&}X~OP6]OU^O[9WOo>SOs#hOx9WOy9WO}`O!O]O!Q:lO!T9WO!U9WO!V9WO!Y9WO!c8hO!n1xO!s1YO!y[O#W_O#bhO#daO#ebO#peO$T:iO$]9WO$^:iO$aqO$z:nO${!OO~P$;lOY%[q_%[q!n%[qi%[q~PhO!x1zO~O!x%gi~PCqOe1{O~O$}1|O%V1|O~O!s2OO~OT8vOz8tO!S8wO!b8xO!v=ZO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dO!x$c!R!}$c!R~P!'WO!m$j!c&s$j!c!x$j!c!n$j!c~PCqO!s2QO~O!`2SO!s2RO~O!s2VO!m$xi&s$xi~O!s'WO~O!s*]O~OT2cOz2aO!S2dO!b2eO!v4WO#S#QO#z2bO#{2fO#|2gO#}2hO$O2iO$Q2kO$R2lO$S2mO$T2nO$U2oO$V2pO$W2pO$z#dO!m$ka#u$ka#w$ka&s$ka!x$ka!n$ka!q$ka#X$ka!}$ka~P!'WO#S2]O~P*kO$l$tO~P#.YOT6iOz6gO!S6jO!b6kO!v8sO#O2[O#S#QO#z6hO#{6lO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dO!m'PX&s'PX!x'PX!n'PX~P!'WOT4fOz4dO!S4gO!b4hO!v6TO#O3uO#S#QO#z4eO#{4iO#|4jO#}4kO$O4lO$Q4nO$R4oO$S4pO$T4qO$U4rO$V4sO$W4sO$z#dO!}'PX#X'PX#u'PX#w'PX!m'PX&s'PX!x'PX!n'PXV'PX!q'PX~P!'WO#S3dO~P#.YOT2cOz2aO!S2dO!b2eO!v4WO#S#QO#z2bO#{2fO#|2gO#}2hO$O2iO$Q2kO$R2lO$S2mO$T2nO$U2oO$V2pO$W2pO$z#dO!m$Xa#u$Xa#w$Xa&s$Xa!x$Xa!n$Xa!q$Xa#X$Xa!}$Xa~P!'WOT2cOz2aO!S2dO!b2eO!v4WO#S#QO#z2bO#{2fO#|2gO#}2hO$O2iO$Q2kO$R2lO$S2mO$T2nO$U2oO$V2pO$W2pO$z#dO!m$Ya#u$Ya#w$Ya&s$Ya!x$Ya!n$Ya!q$Ya#X$Ya!}$Ya~P!'WOT2cOz2aO!S2dO!b2eO!v4WO#S#QO#z2bO#{2fO#|2gO#}2hO$O2iO$Q2kO$R2lO$S2mO$T2nO$U2oO$V2pO$W2pO$z#dO!m$Za#u$Za#w$Za&s$Za!x$Za!n$Za!q$Za#X$Za!}$Za~P!'WOT2cOz2aO!S2dO!b2eO!v4WO#S#QO#z2bO#{2fO#|2gO#}2hO$O2iO$Q2kO$R2lO$S2mO$T2nO$U2oO$V2pO$W2pO$z#dO!m$[a#u$[a#w$[a&s$[a!x$[a!n$[a!q$[a#X$[a!}$[a~P!'WOz2aO#u$[a#w$[a!q$[a#X$[a!}$[a~PNyOT2cOz2aO!S2dO!b2eO!v4WO#S#QO#z2bO#{2fO#|2gO#}2hO$O2iO$Q2kO$R2lO$S2mO$T2nO$U2oO$V2pO$W2pO$z#dO!m$_a#u$_a#w$_a&s$_a!x$_a!n$_a!q$_a#X$_a!}$_a~P!'WOT2cOz2aO!S2dO!b2eO!v4WO#S#QO#z2bO#{2fO#|2gO#}2hO$O2iO$Q2kO$R2lO$S2mO$T2nO$U2oO$V2pO$W2pO$z#dO!m$|a#u$|a#w$|a&s$|a!x$|a!n$|a!q$|a#X$|a!}$|a~P!'WOz2aO#S#QO#z2bO#{2fO#|2gO#}2hO$O2iO$Q2kO$R2lO$S2mO$T2nO$U2oO$V2pO$W2pO$z#dOT#yi!S#yi!b#yi!m#yi!v#yi#u#yi#w#yi&s#yi!x#yi!n#yi!q#yi#X#yi!}#yi~P!'WOz2aO!v4WO#S#QO#z2bO#{2fO#|2gO#}2hO$O2iO$Q2kO$R2lO$S2mO$T2nO$U2oO$V2pO$W2pO$z#dOT#yi!S#yi!b#yi!m#yi#u#yi#w#yi&s#yi!x#yi!n#yi!q#yi#X#yi!}#yi~P!'WOT2cOz2aO!b2eO!v4WO#S#QO#z2bO#{2fO#|2gO#}2hO$O2iO$Q2kO$R2lO$S2mO$T2nO$U2oO$V2pO$W2pO$z#dO!S#yi!m#yi#u#yi#w#yi&s#yi!x#yi!n#yi!q#yi#X#yi!}#yi~P!'WOT2cOz2aO!v4WO#S#QO#z2bO#{2fO#|2gO#}2hO$O2iO$Q2kO$R2lO$S2mO$T2nO$U2oO$V2pO$W2pO$z#dO!S#yi!b#yi!m#yi#u#yi#w#yi&s#yi!x#yi!n#yi!q#yi#X#yi!}#yi~P!'WOz2aO#S#QO#|2gO#}2hO$O2iO$Q2kO$R2lO$S2mO$T2nO$U2oO$V2pO$W2pO$z#dOT#yi!S#yi!b#yi!m#yi!v#yi#u#yi#w#yi#z#yi#{#yi&s#yi!x#yi!n#yi!q#yi#X#yi!}#yi~P!'WOz2aO#S#QO#}2hO$O2iO$Q2kO$R2lO$S2mO$T2nO$U2oO$V2pO$W2pO$z#dOT#yi!S#yi!b#yi!m#yi!v#yi#u#yi#w#yi#z#yi#{#yi#|#yi&s#yi!x#yi!n#yi!q#yi#X#yi!}#yi~P!'WOz2aO#S#QO$O2iO$Q2kO$R2lO$S2mO$T2nO$U2oO$V2pO$W2pO$z#dOT#yi!S#yi!b#yi!m#yi!v#yi#u#yi#w#yi#z#yi#{#yi#|#yi#}#yi&s#yi!x#yi!n#yi!q#yi#X#yi!}#yi~P!'WOz2aO#S#QO$Q2kO$R2lO$S2mO$T2nO$U2oO$V2pO$W2pO$z#dOT#yi!S#yi!b#yi!m#yi!v#yi#u#yi#w#yi#z#yi#{#yi#|#yi#}#yi$O#yi&s#yi!x#yi!n#yi!q#yi#X#yi!}#yi~P!'WOz2aO$Q2kO$R2lO$S2mO$T2nO$U2oO$V2pO$W2pO$z#dOT#yi!S#yi!b#yi!m#yi!v#yi#S#yi#u#yi#w#yi#z#yi#{#yi#|#yi#}#yi$O#yi&s#yi!x#yi!n#yi!q#yi#X#yi!}#yi~P!'WOz2aO$R2lO$S2mO$T2nO$U2oO$V2pO$W2pO$z#dOT#yi!S#yi!b#yi!m#yi!v#yi#S#yi#u#yi#w#yi#z#yi#{#yi#|#yi#}#yi$O#yi$Q#yi&s#yi!x#yi!n#yi!q#yi#X#yi!}#yi~P!'WOz2aO$S2mO$T2nO$U2oO$V2pO$W2pO$z#dOT#yi!S#yi!b#yi!m#yi!v#yi#S#yi#u#yi#w#yi#z#yi#{#yi#|#yi#}#yi$O#yi$Q#yi$R#yi&s#yi!x#yi!n#yi!q#yi#X#yi!}#yi~P!'WOz2aO$T2nO$V2pO$W2pO$z#dOT#yi!S#yi!b#yi!m#yi!v#yi#S#yi#u#yi#w#yi#z#yi#{#yi#|#yi#}#yi$O#yi$Q#yi$R#yi$S#yi$U#yi&s#yi!x#yi!n#yi!q#yi#X#yi!}#yi~P!'WOz2aO$V2pO$W2pO$z#dOT#yi!S#yi!b#yi!m#yi!v#yi#S#yi#u#yi#w#yi#z#yi#{#yi#|#yi#}#yi$O#yi$Q#yi$R#yi$S#yi$T#yi$U#yi&s#yi!x#yi!n#yi!q#yi#X#yi!}#yi~P!'WOz2aO$S2mO$T2nO$V2pO$W2pO$z#dOT#yi!S#yi!b#yi!m#yi!v#yi#S#yi#u#yi#w#yi#z#yi#{#yi#|#yi#}#yi$O#yi$Q#yi$R#yi$U#yi&s#yi!x#yi!n#yi!q#yi#X#yi!}#yi~P!'WOz2aO$W2pO$z#dOT#yi!S#yi!b#yi!m#yi!v#yi#S#yi#u#yi#w#yi#z#yi#{#yi#|#yi#}#yi$O#yi$Q#yi$R#yi$S#yi$T#yi$U#yi$V#yi&s#yi!x#yi!n#yi!q#yi#X#yi!}#yi~P!'WOT2cOz2aO!S2dO!b2eO!v4WO#S#QO#z2bO#{2fO#|2gO#}2hO$O2iO$Q2kO$R2lO$S2mO$T2nO$U2oO$V2pO$W2pO$z#dO!m#Ta#u#Ta#w#Ta&s#Ta!x#Ta!n#Ta!q#Ta#X#Ta!}#Ta~P!'WOT2cOz2aO!S2dO!b2eO!v4WO#S#QO#z2bO#{2fO#|2gO#}2hO$O2iO$Q2kO$R2lO$S2mO$T2nO$U2oO$V2pO$W2pO$z#dO!m'Pa#u'Pa#w'Pa&s'Pa!x'Pa!n'Pa!q'Pa#X'Pa!}'Pa~P!'WOz2aO!v4WO#S#QO#z2bO#{2fO#|2gO#}2hO$O2iO$Q2kO$R2lO$S2mO$T2nO$U2oO$V2pO$W2pO$z#dOT#Pi!S#Pi!b#Pi!m#Pi#u#Pi#w#Pi&s#Pi!x#Pi!n#Pi!q#Pi#X#Pi!}#Pi~P!'WOz2aO!v4WO#S#QO#z2bO#{2fO#|2gO#}2hO$O2iO$Q2kO$R2lO$S2mO$T2nO$U2oO$V2pO$W2pO$z#dOT#vi!S#vi!b#vi!m#vi#u#vi#w#vi&s#vi!x#vi!n#vi!q#vi#X#vi!}#vi~P!'WOT2cOz2aO!S2dO!b2eO!v4WO#S#QO#z2bO#{2fO#|2gO#}2hO$O2iO$Q2kO$R2lO$S2mO$T2nO$U2oO$V2pO$W2pO$z#dO!m#xi#u#xi#w#xi&s#xi!x#xi!n#xi!q#xi#X#xi!}#xi~P!'WOz2aO#S#QO#z2bO#{2fO#|2gO#}2hO$O2iO$Q2kO$R2lO$S2mO$T2nO$U2oO$V2pO$W2pO$z#dOT!uq!S!uq!b!uq!m!uq!v!uq#u!uq#w!uq&s!uq!x!uq!n!uq!q!uq#X!uq!}!uq~P!'WOz2aO!v4WO#S#QO#z2bO#{2fO#|2gO#}2hO$O2iO$Q2kO$R2lO$S2mO$T2nO$U2oO$V2pO$W2pO$z#dOT#Pq!S#Pq!b#Pq!m#Pq#u#Pq#w#Pq&s#Pq!x#Pq!n#Pq!q#Pq#X#Pq!}#Pq~P!'WOT2cOz2aO!S2dO!b2eO!v4WO#S#QO#z2bO#{2fO#|2gO#}2hO$O2iO$Q2kO$R2lO$S2mO$T2nO$U2oO$V2pO$W2pO$z#dO!m$jq#u$jq#w$jq&s$jq!x$jq!n$jq!q$jq#X$jq!}$jq~P!'WOz2aO#S#QO#z2bO#{2fO#|2gO#}2hO$O2iO$Q2kO$R2lO$S2mO$T2nO$U2oO$V2pO$W2pO$z#dOT!uy!S!uy!b!uy!m!uy!v!uy#u!uy#w!uy&s!uy!x!uy!n!uy!q!uy#X!uy!}!uy~P!'WOT2cOz2aO!S2dO!b2eO!v4WO#S#QO#z2bO#{2fO#|2gO#}2hO$O2iO$Q2kO$R2lO$S2mO$T2nO$U2oO$V2pO$W2pO$z#dO!m$jy#u$jy#w$jy&s$jy!x$jy!n$jy!q$jy#X$jy!}$jy~P!'WOT2cOz2aO!S2dO!b2eO!v4WO#S#QO#z2bO#{2fO#|2gO#}2hO$O2iO$Q2kO$R2lO$S2mO$T2nO$U2oO$V2pO$W2pO$z#dO!m$j!R#u$j!R#w$j!R&s$j!R!x$j!R!n$j!R!q$j!R#X$j!R!}$j!R~P!'WOT2cOz2aO!S2dO!b2eO!v4WO#S#QO#z2bO#{2fO#|2gO#}2hO$O2iO$Q2kO$R2lO$S2mO$T2nO$U2oO$V2pO$W2pO$z#dO!m$j!Z#u$j!Z#w$j!Z&s$j!Z!x$j!Z!n$j!Z!q$j!Z#X$j!Z!}$j!Z~P!'WOT2cOz2aO!S2dO!b2eO!v4WO#S#QO#z2bO#{2fO#|2gO#}2hO$O2iO$Q2kO$R2lO$S2mO$T2nO$U2oO$V2pO$W2pO$z#dO!m$j!c#u$j!c#w$j!c&s$j!c!x$j!c!n$j!c!q$j!c#X$j!c!}$j!c~P!'WOP6]OU^O[4POo8^Os#hOx3{Oy3{O}`O!O]O!Q4aO!T4VO!U3}O!V3}O!Y4cO!c3yO!s#gO!y[O#S3vO#W_O#bhO#daO#ebO#peO$T4TO$]4RO$^4TO$aqO$z4bO${!OO~P$;lOP6]OU^O[4POo8^Os#hOx3{Oy3{O}`O!O]O!Q4aO!T4VO!U3}O!V3}O!Y4cO!c3yO!s#gO!y[O#W_O#bhO#daO#ebO#peO$T4TO$]4RO$^4TO$aqO$z4bO${!OO~P$;lO#u2uO#w2vO!q&zX#X&zX!}&zX~P0rOP6]OU^O[4POo8^Or2wOs#hOx3{Oy3{O}`O!O]O!Q4aO!T4VO!U3}O!V3}O!Y4cO!c3yO!s#gO!y[O#S2tO#U2sO#W_O#bhO#daO#ebO#peO$T4TO$]4RO$^4TO$aqO$z4bO${!OOT#xXz#xX!S#xX!b#xX!m#xX!o#xX!v#xX#`#xX#a#xX#s#xX#u#xX#w#xX#z#xX#{#xX#|#xX#}#xX$O#xX$Q#xX$R#xX$S#xX$U#xX$V#xX$W#xX&s#xX!x#xX!n#xX!q#xX#X#xX!}#xX~P$;lOP6]OU^O[4POo8^Or4xOs#hOx3{Oy3{O}`O!O]O!Q4aO!T4VO!U3}O!V3}O!Y4cO!c3yO!s#gO!y[O#S4uO#U4tO#W_O#bhO#daO#ebO#peO$T4TO$]4RO$^4TO$aqO$z4bO${!OOT#xXz#xX!S#xX!b#xX!o#xX!v#xX!}#xX#O#xX#X#xX#`#xX#a#xX#s#xX#u#xX#w#xX#z#xX#{#xX#|#xX#}#xX$O#xX$Q#xX$R#xX$S#xX$U#xX$V#xX$W#xX!m#xX&s#xX!x#xX!n#xXV#xX!q#xX~P$;lO!q3PO~P>UO!q5}O#O3gO~OT8vOz8tO!S8wO!b8xO!q3hO!v=ZO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dO~P!'WO!q6OO#O3kO~O!q6PO#O3oO~O#O3oO#l'SO~O#O3pO#l'SO~O#O3sO#l'SO~OP6]OU^O[4POo8^Os#hOx3{Oy3{O}`O!O]O!Q4aO!T4VO!U3}O!V3}O!Y4cO!c3yO!s#gO!y[O#W_O#bhO#daO#ebO#peO$T4TO$]4RO$^4TO$aqO$l$tO$z4bO${!OO~P$;lOP6]OU^O[4POo8^Os#hOx3{Oy3{O}`O!O]O!Q4aO!T4VO!U3}O!V3}O!Y4cO!c3yO!s#gO!y[O#S5eO#W_O#bhO#daO#ebO#peO$T4TO$]4RO$^4TO$aqO$z4bO${!OO~P$;lOT4fOz4dO!S4gO!b4hO!v6TO#S#QO#z4eO#{4iO#|4jO#}4kO$O4lO$Q4nO$R4oO$S4pO$T4qO$U4rO$V4sO$W4sO$z#dO!}$Xa#O$Xa#X$Xa#u$Xa#w$Xa!m$Xa&s$Xa!x$Xa!n$XaV$Xa!q$Xa~P!'WOT4fOz4dO!S4gO!b4hO!v6TO#S#QO#z4eO#{4iO#|4jO#}4kO$O4lO$Q4nO$R4oO$S4pO$T4qO$U4rO$V4sO$W4sO$z#dO!}$Ya#O$Ya#X$Ya#u$Ya#w$Ya!m$Ya&s$Ya!x$Ya!n$YaV$Ya!q$Ya~P!'WOT4fOz4dO!S4gO!b4hO!v6TO#S#QO#z4eO#{4iO#|4jO#}4kO$O4lO$Q4nO$R4oO$S4pO$T4qO$U4rO$V4sO$W4sO$z#dO!}$Za#O$Za#X$Za#u$Za#w$Za!m$Za&s$Za!x$Za!n$ZaV$Za!q$Za~P!'WOT4fOz4dO!S4gO!b4hO!v6TO#S#QO#z4eO#{4iO#|4jO#}4kO$O4lO$Q4nO$R4oO$S4pO$T4qO$U4rO$V4sO$W4sO$z#dO!}$[a#O$[a#X$[a#u$[a#w$[a!m$[a&s$[a!x$[a!n$[aV$[a!q$[a~P!'WOz4dO!}$[a#O$[a#X$[a#u$[a#w$[aV$[a!q$[a~PNyOT4fOz4dO!S4gO!b4hO!v6TO#S#QO#z4eO#{4iO#|4jO#}4kO$O4lO$Q4nO$R4oO$S4pO$T4qO$U4rO$V4sO$W4sO$z#dO!}$_a#O$_a#X$_a#u$_a#w$_a!m$_a&s$_a!x$_a!n$_aV$_a!q$_a~P!'WOT4fOz4dO!S4gO!b4hO!v6TO#S#QO#z4eO#{4iO#|4jO#}4kO$O4lO$Q4nO$R4oO$S4pO$T4qO$U4rO$V4sO$W4sO$z#dO!}$|a#O$|a#X$|a#u$|a#w$|a!m$|a&s$|a!x$|a!n$|aV$|a!q$|a~P!'WOz4dO#S#QO#z4eO#{4iO#|4jO#}4kO$O4lO$Q4nO$R4oO$S4pO$T4qO$U4rO$V4sO$W4sO$z#dOT#yi!S#yi!b#yi!v#yi!}#yi#O#yi#X#yi#u#yi#w#yi!m#yi&s#yi!x#yi!n#yiV#yi!q#yi~P!'WOz4dO!v6TO#S#QO#z4eO#{4iO#|4jO#}4kO$O4lO$Q4nO$R4oO$S4pO$T4qO$U4rO$V4sO$W4sO$z#dOT#yi!S#yi!b#yi!}#yi#O#yi#X#yi#u#yi#w#yi!m#yi&s#yi!x#yi!n#yiV#yi!q#yi~P!'WOT4fOz4dO!b4hO!v6TO#S#QO#z4eO#{4iO#|4jO#}4kO$O4lO$Q4nO$R4oO$S4pO$T4qO$U4rO$V4sO$W4sO$z#dO!S#yi!}#yi#O#yi#X#yi#u#yi#w#yi!m#yi&s#yi!x#yi!n#yiV#yi!q#yi~P!'WOT4fOz4dO!v6TO#S#QO#z4eO#{4iO#|4jO#}4kO$O4lO$Q4nO$R4oO$S4pO$T4qO$U4rO$V4sO$W4sO$z#dO!S#yi!b#yi!}#yi#O#yi#X#yi#u#yi#w#yi!m#yi&s#yi!x#yi!n#yiV#yi!q#yi~P!'WOz4dO#S#QO#|4jO#}4kO$O4lO$Q4nO$R4oO$S4pO$T4qO$U4rO$V4sO$W4sO$z#dOT#yi!S#yi!b#yi!v#yi!}#yi#O#yi#X#yi#u#yi#w#yi#z#yi#{#yi!m#yi&s#yi!x#yi!n#yiV#yi!q#yi~P!'WOz4dO#S#QO#}4kO$O4lO$Q4nO$R4oO$S4pO$T4qO$U4rO$V4sO$W4sO$z#dOT#yi!S#yi!b#yi!v#yi!}#yi#O#yi#X#yi#u#yi#w#yi#z#yi#{#yi#|#yi!m#yi&s#yi!x#yi!n#yiV#yi!q#yi~P!'WOz4dO#S#QO$O4lO$Q4nO$R4oO$S4pO$T4qO$U4rO$V4sO$W4sO$z#dOT#yi!S#yi!b#yi!v#yi!}#yi#O#yi#X#yi#u#yi#w#yi#z#yi#{#yi#|#yi#}#yi!m#yi&s#yi!x#yi!n#yiV#yi!q#yi~P!'WOz4dO#S#QO$Q4nO$R4oO$S4pO$T4qO$U4rO$V4sO$W4sO$z#dOT#yi!S#yi!b#yi!v#yi!}#yi#O#yi#X#yi#u#yi#w#yi#z#yi#{#yi#|#yi#}#yi$O#yi!m#yi&s#yi!x#yi!n#yiV#yi!q#yi~P!'WOz4dO$Q4nO$R4oO$S4pO$T4qO$U4rO$V4sO$W4sO$z#dOT#yi!S#yi!b#yi!v#yi!}#yi#O#yi#S#yi#X#yi#u#yi#w#yi#z#yi#{#yi#|#yi#}#yi$O#yi!m#yi&s#yi!x#yi!n#yiV#yi!q#yi~P!'WOz4dO$R4oO$S4pO$T4qO$U4rO$V4sO$W4sO$z#dOT#yi!S#yi!b#yi!v#yi!}#yi#O#yi#S#yi#X#yi#u#yi#w#yi#z#yi#{#yi#|#yi#}#yi$O#yi$Q#yi!m#yi&s#yi!x#yi!n#yiV#yi!q#yi~P!'WOz4dO$S4pO$T4qO$U4rO$V4sO$W4sO$z#dOT#yi!S#yi!b#yi!v#yi!}#yi#O#yi#S#yi#X#yi#u#yi#w#yi#z#yi#{#yi#|#yi#}#yi$O#yi$Q#yi$R#yi!m#yi&s#yi!x#yi!n#yiV#yi!q#yi~P!'WOz4dO$T4qO$V4sO$W4sO$z#dOT#yi!S#yi!b#yi!v#yi!}#yi#O#yi#S#yi#X#yi#u#yi#w#yi#z#yi#{#yi#|#yi#}#yi$O#yi$Q#yi$R#yi$S#yi$U#yi!m#yi&s#yi!x#yi!n#yiV#yi!q#yi~P!'WOz4dO$V4sO$W4sO$z#dOT#yi!S#yi!b#yi!v#yi!}#yi#O#yi#S#yi#X#yi#u#yi#w#yi#z#yi#{#yi#|#yi#}#yi$O#yi$Q#yi$R#yi$S#yi$T#yi$U#yi!m#yi&s#yi!x#yi!n#yiV#yi!q#yi~P!'WOz4dO$S4pO$T4qO$V4sO$W4sO$z#dOT#yi!S#yi!b#yi!v#yi!}#yi#O#yi#S#yi#X#yi#u#yi#w#yi#z#yi#{#yi#|#yi#}#yi$O#yi$Q#yi$R#yi$U#yi!m#yi&s#yi!x#yi!n#yiV#yi!q#yi~P!'WOz4dO$W4sO$z#dOT#yi!S#yi!b#yi!v#yi!}#yi#O#yi#S#yi#X#yi#u#yi#w#yi#z#yi#{#yi#|#yi#}#yi$O#yi$Q#yi$R#yi$S#yi$T#yi$U#yi$V#yi!m#yi&s#yi!x#yi!n#yiV#yi!q#yi~P!'WOT4fOz4dO!S4gO!b4hO!v6TO#S#QO#z4eO#{4iO#|4jO#}4kO$O4lO$Q4nO$R4oO$S4pO$T4qO$U4rO$V4sO$W4sO$z#dO!}#Ta#O#Ta#X#Ta#u#Ta#w#Ta!m#Ta&s#Ta!x#Ta!n#TaV#Ta!q#Ta~P!'WOT4fOz4dO!S4gO!b4hO!v6TO#S#QO#z4eO#{4iO#|4jO#}4kO$O4lO$Q4nO$R4oO$S4pO$T4qO$U4rO$V4sO$W4sO$z#dO!}'Pa#O'Pa#X'Pa#u'Pa#w'Pa!m'Pa&s'Pa!x'Pa!n'PaV'Pa!q'Pa~P!'WOz4dO!v6TO#S#QO#z4eO#{4iO#|4jO#}4kO$O4lO$Q4nO$R4oO$S4pO$T4qO$U4rO$V4sO$W4sO$z#dOT#Pi!S#Pi!b#Pi!}#Pi#O#Pi#X#Pi#u#Pi#w#Pi!m#Pi&s#Pi!x#Pi!n#PiV#Pi!q#Pi~P!'WOz4dO!v6TO#S#QO#z4eO#{4iO#|4jO#}4kO$O4lO$Q4nO$R4oO$S4pO$T4qO$U4rO$V4sO$W4sO$z#dOT#vi!S#vi!b#vi!}#vi#O#vi#X#vi#u#vi#w#vi!m#vi&s#vi!x#vi!n#viV#vi!q#vi~P!'WOT4fOz4dO!S4gO!b4hO!v6TO#S#QO#z4eO#{4iO#|4jO#}4kO$O4lO$Q4nO$R4oO$S4pO$T4qO$U4rO$V4sO$W4sO$z#dO!}#xi#O#xi#X#xi#u#xi#w#xi!m#xi&s#xi!x#xi!n#xiV#xi!q#xi~P!'WOz4dO#S#QO#z4eO#{4iO#|4jO#}4kO$O4lO$Q4nO$R4oO$S4pO$T4qO$U4rO$V4sO$W4sO$z#dOT!uq!S!uq!b!uq!v!uq!}!uq#O!uq#X!uq#u!uq#w!uq!m!uq&s!uq!x!uq!n!uqV!uq!q!uq~P!'WOz4dO!v6TO#S#QO#z4eO#{4iO#|4jO#}4kO$O4lO$Q4nO$R4oO$S4pO$T4qO$U4rO$V4sO$W4sO$z#dOT#Pq!S#Pq!b#Pq!}#Pq#O#Pq#X#Pq#u#Pq#w#Pq!m#Pq&s#Pq!x#Pq!n#PqV#Pq!q#Pq~P!'WOT4fOz4dO!S4gO!b4hO!v6TO#S#QO#z4eO#{4iO#|4jO#}4kO$O4lO$Q4nO$R4oO$S4pO$T4qO$U4rO$V4sO$W4sO$z#dO!}$jq#O$jq#X$jq#u$jq#w$jq!m$jq&s$jq!x$jq!n$jqV$jq!q$jq~P!'WOz4dO#S#QO#z4eO#{4iO#|4jO#}4kO$O4lO$Q4nO$R4oO$S4pO$T4qO$U4rO$V4sO$W4sO$z#dOT!uy!S!uy!b!uy!v!uy!}!uy#O!uy#X!uy#u!uy#w!uy!m!uy&s!uy!x!uy!n!uyV!uy!q!uy~P!'WOT4fOz4dO!S4gO!b4hO!v6TO#S#QO#z4eO#{4iO#|4jO#}4kO$O4lO$Q4nO$R4oO$S4pO$T4qO$U4rO$V4sO$W4sO$z#dO!}$jy#O$jy#X$jy#u$jy#w$jy!m$jy&s$jy!x$jy!n$jyV$jy!q$jy~P!'WOT4fOz4dO!S4gO!b4hO!v6TO#S#QO#z4eO#{4iO#|4jO#}4kO$O4lO$Q4nO$R4oO$S4pO$T4qO$U4rO$V4sO$W4sO$z#dO!}$j!R#O$j!R#X$j!R#u$j!R#w$j!R!m$j!R&s$j!R!x$j!R!n$j!RV$j!R!q$j!R~P!'WOT4fOz4dO!S4gO!b4hO!v6TO#S#QO#z4eO#{4iO#|4jO#}4kO$O4lO$Q4nO$R4oO$S4pO$T4qO$U4rO$V4sO$W4sO$z#dO!}$j!Z#O$j!Z#X$j!Z#u$j!Z#w$j!Z!m$j!Z&s$j!Z!x$j!Z!n$j!ZV$j!Z!q$j!Z~P!'WOT4fOz4dO!S4gO!b4hO!v6TO#S#QO#z4eO#{4iO#|4jO#}4kO$O4lO$Q4nO$R4oO$S4pO$T4qO$U4rO$V4sO$W4sO$z#dO!}$j!c#O$j!c#X$j!c#u$j!c#w$j!c!m$j!c&s$j!c!x$j!c!n$j!cV$j!c!q$j!c~P!'WO#S5wO~P#.YO!y$hO#S5{O~O!x4ZO#l'SO~O!y$hO#S5|O~OT4fOz4dO!S4gO!b4hO!v6TO#S#QO#z4eO#{4iO#|4jO#}4kO$O4lO$Q4nO$R4oO$S4pO$T4qO$U4rO$V4sO$W4sO$z#dO!}$ka#O$ka#X$ka#u$ka#w$ka!m$ka&s$ka!x$ka!n$kaV$ka!q$ka~P!'WOT4fOz4dO!S4gO!b4hO!v6TO#O5vO#S#QO#z4eO#{4iO#|4jO#}4kO$O4lO$Q4nO$R4oO$S4pO$T4qO$U4rO$V4sO$W4sO$z#dO!m'PX#u'PX#w'PX&s'PX!x'PX!n'PX!q'PX#X'PX!}'PX~P!'WO#u4vO#w4wO!}&zX#O&zX#X&zXV&zX!q&zX~P0rO!q5QO~P>UO!q8bO#O5hO~OT8vOz8tO!S8wO!b8xO!q5iO!v=ZO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dO~P!'WO!q8cO#O5lO~O!q8dO#O5pO~O#O5pO#l'SO~O#O5qO#l'SO~O#O5tO#l'SO~O$l$tO~P9yOo5zOs$lO~O#S7oO~P9yOT6iOz6gO!S6jO!b6kO!v8sO#S#QO#z6hO#{6lO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dO!}$Xa#O$Xa#X$Xa!m$Xa&s$Xa!x$Xa!n$XaV$Xa!q$Xa~P!'WOT6iOz6gO!S6jO!b6kO!v8sO#S#QO#z6hO#{6lO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dO!}$Ya#O$Ya#X$Ya!m$Ya&s$Ya!x$Ya!n$YaV$Ya!q$Ya~P!'WOT6iOz6gO!S6jO!b6kO!v8sO#S#QO#z6hO#{6lO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dO!}$Za#O$Za#X$Za!m$Za&s$Za!x$Za!n$ZaV$Za!q$Za~P!'WOT6iOz6gO!S6jO!b6kO!v8sO#S#QO#z6hO#{6lO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dO!}$[a#O$[a#X$[a!m$[a&s$[a!x$[a!n$[aV$[a!q$[a~P!'WOz6gO!}$[a#O$[a#X$[aV$[a!q$[a~PNyOT6iOz6gO!S6jO!b6kO!v8sO#S#QO#z6hO#{6lO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dO!}$_a#O$_a#X$_a!m$_a&s$_a!x$_a!n$_aV$_a!q$_a~P!'WOT6iOz6gO!S6jO!b6kO!v8sO#S#QO#z6hO#{6lO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dO!}$ka#O$ka#X$ka!m$ka&s$ka!x$ka!n$kaV$ka!q$ka~P!'WOT6iOz6gO!S6jO!b6kO!v8sO#S#QO#z6hO#{6lO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dO!}$|a#O$|a#X$|a!m$|a&s$|a!x$|a!n$|aV$|a!q$|a~P!'WOT8vOz8tO!S8wO!b8xO!v=ZO!}7sO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dO!x'jX~P!'WOT8vOz8tO!S8wO!b8xO!v=ZO!}7uO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dO!x&|X~P!'WOz6gO#S#QO#z6hO#{6lO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dOT#yi!S#yi!b#yi!v#yi!}#yi#O#yi#X#yi!m#yi&s#yi!x#yi!n#yiV#yi!q#yi~P!'WOz6gO!v8sO#S#QO#z6hO#{6lO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dOT#yi!S#yi!b#yi!}#yi#O#yi#X#yi!m#yi&s#yi!x#yi!n#yiV#yi!q#yi~P!'WOT6iOz6gO!b6kO!v8sO#S#QO#z6hO#{6lO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dO!S#yi!}#yi#O#yi#X#yi!m#yi&s#yi!x#yi!n#yiV#yi!q#yi~P!'WOT6iOz6gO!v8sO#S#QO#z6hO#{6lO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dO!S#yi!b#yi!}#yi#O#yi#X#yi!m#yi&s#yi!x#yi!n#yiV#yi!q#yi~P!'WOz6gO#S#QO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dOT#yi!S#yi!b#yi!v#yi!}#yi#O#yi#X#yi#z#yi#{#yi!m#yi&s#yi!x#yi!n#yiV#yi!q#yi~P!'WOz6gO#S#QO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dOT#yi!S#yi!b#yi!v#yi!}#yi#O#yi#X#yi#z#yi#{#yi#|#yi!m#yi&s#yi!x#yi!n#yiV#yi!q#yi~P!'WOz6gO#S#QO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dOT#yi!S#yi!b#yi!v#yi!}#yi#O#yi#X#yi#z#yi#{#yi#|#yi#}#yi!m#yi&s#yi!x#yi!n#yiV#yi!q#yi~P!'WOz6gO#S#QO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dOT#yi!S#yi!b#yi!v#yi!}#yi#O#yi#X#yi#z#yi#{#yi#|#yi#}#yi$O#yi!m#yi&s#yi!x#yi!n#yiV#yi!q#yi~P!'WOz6gO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dOT#yi!S#yi!b#yi!v#yi!}#yi#O#yi#S#yi#X#yi#z#yi#{#yi#|#yi#}#yi$O#yi!m#yi&s#yi!x#yi!n#yiV#yi!q#yi~P!'WOz6gO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dOT#yi!S#yi!b#yi!v#yi!}#yi#O#yi#S#yi#X#yi#z#yi#{#yi#|#yi#}#yi$O#yi$Q#yi!m#yi&s#yi!x#yi!n#yiV#yi!q#yi~P!'WOz6gO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dOT#yi!S#yi!b#yi!v#yi!}#yi#O#yi#S#yi#X#yi#z#yi#{#yi#|#yi#}#yi$O#yi$Q#yi$R#yi!m#yi&s#yi!x#yi!n#yiV#yi!q#yi~P!'WOz6gO$T6tO$V6vO$W6vO$z#dOT#yi!S#yi!b#yi!v#yi!}#yi#O#yi#S#yi#X#yi#z#yi#{#yi#|#yi#}#yi$O#yi$Q#yi$R#yi$S#yi$U#yi!m#yi&s#yi!x#yi!n#yiV#yi!q#yi~P!'WOz6gO$V6vO$W6vO$z#dOT#yi!S#yi!b#yi!v#yi!}#yi#O#yi#S#yi#X#yi#z#yi#{#yi#|#yi#}#yi$O#yi$Q#yi$R#yi$S#yi$T#yi$U#yi!m#yi&s#yi!x#yi!n#yiV#yi!q#yi~P!'WOz6gO$S6sO$T6tO$V6vO$W6vO$z#dOT#yi!S#yi!b#yi!v#yi!}#yi#O#yi#S#yi#X#yi#z#yi#{#yi#|#yi#}#yi$O#yi$Q#yi$R#yi$U#yi!m#yi&s#yi!x#yi!n#yiV#yi!q#yi~P!'WOz6gO$W6vO$z#dOT#yi!S#yi!b#yi!v#yi!}#yi#O#yi#S#yi#X#yi#z#yi#{#yi#|#yi#}#yi$O#yi$Q#yi$R#yi$S#yi$T#yi$U#yi$V#yi!m#yi&s#yi!x#yi!n#yiV#yi!q#yi~P!'WO#S7zO~P>UO!m#Ta&s#Ta!x#Ta!n#Ta~PCqO!m'Pa&s'Pa!x'Pa!n'Pa~PCqO#S;dO#U;cO!x&WX!}&WX~P9yO!}7lO!x'Oa~Oz6gO!v8sO#S#QO#z6hO#{6lO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dOT#Pi!S#Pi!b#Pi!}#Pi#O#Pi#X#Pi!m#Pi&s#Pi!x#Pi!n#PiV#Pi!q#Pi~P!'WOz6gO!v8sO#S#QO#z6hO#{6lO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dOT#vi!S#vi!b#vi!}#vi#O#vi#X#vi!m#vi&s#vi!x#vi!n#viV#vi!q#vi~P!'WOT6iOz6gO!S6jO!b6kO!v8sO#S#QO#z6hO#{6lO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dO!}#xi#O#xi#X#xi!m#xi&s#xi!x#xi!n#xiV#xi!q#xi~P!'WO!}7sO!x%da~O!x&UX!}&UX~P>UO!}7uO!x&|a~Oz6gO#S#QO#z6hO#{6lO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dOT!uq!S!uq!b!uq!v!uq!}!uq#O!uq#X!uq!m!uq&s!uq!x!uq!n!uqV!uq!q!uq~P!'WOT8vOz8tO!S8wO!b8xO!v=ZO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dO!x#Vi!}#Vi~P!'WOz6gO!v8sO#S#QO#z6hO#{6lO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dOT#Pq!S#Pq!b#Pq!}#Pq#O#Pq#X#Pq!m#Pq&s#Pq!x#Pq!n#PqV#Pq!q#Pq~P!'WOT6iOz6gO!S6jO!b6kO!v8sO#S#QO#z6hO#{6lO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dO!}$jq#O$jq#X$jq!m$jq&s$jq!x$jq!n$jqV$jq!q$jq~P!'WOT8vOz8tO!S8wO!b8xO!v=ZO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dO!x&ka!}&ka~P!'WOT8vOz8tO!S8wO!b8xO!v=ZO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dO!x&Ua!}&Ua~P!'WOz6gO#S#QO#z6hO#{6lO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dOT!uy!S!uy!b!uy!v!uy!}!uy#O!uy#X!uy!m!uy&s!uy!x!uy!n!uyV!uy!q!uy~P!'WOT8vOz8tO!S8wO!b8xO!v=ZO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dO!x#Vq!}#Vq~P!'WOT6iOz6gO!S6jO!b6kO!v8sO#S#QO#z6hO#{6lO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dO!}$jy#O$jy#X$jy!m$jy&s$jy!x$jy!n$jyV$jy!q$jy~P!'WOT6iOz6gO!S6jO!b6kO!v8sO#S#QO#z6hO#{6lO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dO!}$j!R#O$j!R#X$j!R!m$j!R&s$j!R!x$j!R!n$j!RV$j!R!q$j!R~P!'WOT6iOz6gO!S6jO!b6kO!v8sO#S#QO#z6hO#{6lO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dO!}$j!Z#O$j!Z#X$j!Z!m$j!Z&s$j!Z!x$j!Z!n$j!ZV$j!Z!q$j!Z~P!'WOT6iOz6gO!S6jO!b6kO!v8sO#S#QO#z6hO#{6lO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dO!}$j!c#O$j!c#X$j!c!m$j!c&s$j!c!x$j!c!n$j!cV$j!c!q$j!c~P!'WO#S8[O~P9yO#O8ZO!m'PX&s'PX!x'PX!n'PXV'PX!q'PX~PGSO!y$hO#S8`O~O!y$hO#S8aO~O#u6zO#w6{O!}&zX#O&zX#X&zXV&zX!q&zX~P0rOr6|O#S#oO#U#nO!}#xX#O#xX#X#xXV#xX!q#xX~P2yOr;iO#S9XO#U9VOT#xXz#xX!S#xX!b#xX!m#xX!o#xX!q#xX!v#xX#`#xX#a#xX#s#xX#z#xX#{#xX#|#xX#}#xX$O#xX$Q#xX$R#xX$S#xX$U#xX$V#xX$W#xX!n#xX!}#xX~P9yOr9WO#S9WO#U9WOT#xXz#xX!S#xX!b#xX!o#xX!v#xX#`#xX#a#xX#s#xX#z#xX#{#xX#|#xX#}#xX$O#xX$Q#xX$R#xX$S#xX$U#xX$V#xX$W#xX~P9yOr9]O#S;dO#U;cOT#xXz#xX!S#xX!b#xX!o#xX!q#xX!v#xX#`#xX#a#xX#s#xX#z#xX#{#xX#|#xX#}#xX$O#xX$Q#xX$R#xX$S#xX$U#xX$V#xX$W#xX#X#xX!x#xX!}#xX~P9yO$l$tO~P>UO!q7XO~P>UOT6iOz6gO!S6jO!b6kO!v8sO#O7iO#S#QO#z6hO#{6lO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dO!x'PX!}'PX~P!'WOP6]OU^O[9WOo>SOs#hOx9WOy9WO}`O!O]O!Q:lO!T9WO!U9WO!V9WO!Y9WO!c8hO!s#gO!y[O#W_O#bhO#daO#ebO#peO$T:iO$]9WO$^:iO$aqO$z:nO${!OO~P$;lO!}7lO!x'OX~O#S9yO~P>UOT8vOz8tO!S8wO!b8xO!v=ZO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dO!q$Xa#X$Xa!x$Xa!}$Xa~P!'WOT8vOz8tO!S8wO!b8xO!v=ZO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dO!q$Ya#X$Ya!x$Ya!}$Ya~P!'WOT8vOz8tO!S8wO!b8xO!v=ZO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dO!q$Za#X$Za!x$Za!}$Za~P!'WOT8vOz8tO!S8wO!b8xO!v=ZO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dO!q$[a#X$[a!x$[a!}$[a~P!'WOz8tO$z#dOT$[a!S$[a!b$[a!q$[a!v$[a#S$[a#z$[a#{$[a#|$[a#}$[a$O$[a$Q$[a$R$[a$S$[a$T$[a$U$[a$V$[a$W$[a#X$[a!x$[a!}$[a~P!'WOT8vOz8tO!S8wO!b8xO!v=ZO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dO!q$_a#X$_a!x$_a!}$_a~P!'WO!q=dO#O7rO~OT8vOz8tO!S8wO!b8xO!v=ZO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dO!q$ka#X$ka!x$ka!}$ka~P!'WOT8vOz8tO!S8wO!b8xO!v=ZO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dO!q$|a#X$|a!x$|a!}$|a~P!'WOT8vOz8tO!S8wO!b8xO!q7wO!v=ZO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dO~P!'WOz8tO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dOT#yi!S#yi!b#yi!q#yi!v#yi#X#yi!x#yi!}#yi~P!'WOz8tO!v=ZO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dOT#yi!S#yi!b#yi!q#yi#X#yi!x#yi!}#yi~P!'WOT8vOz8tO!b8xO!v=ZO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dO!S#yi!q#yi#X#yi!x#yi!}#yi~P!'WOT8vOz8tO!v=ZO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dO!S#yi!b#yi!q#yi#X#yi!x#yi!}#yi~P!'WOz8tO#S#QO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dOT#yi!S#yi!b#yi!q#yi!v#yi#z#yi#{#yi#X#yi!x#yi!}#yi~P!'WOz8tO#S#QO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dOT#yi!S#yi!b#yi!q#yi!v#yi#z#yi#{#yi#|#yi#X#yi!x#yi!}#yi~P!'WOz8tO#S#QO$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dOT#yi!S#yi!b#yi!q#yi!v#yi#z#yi#{#yi#|#yi#}#yi#X#yi!x#yi!}#yi~P!'WOz8tO#S#QO$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dOT#yi!S#yi!b#yi!q#yi!v#yi#z#yi#{#yi#|#yi#}#yi$O#yi#X#yi!x#yi!}#yi~P!'WOz8tO$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dOT#yi!S#yi!b#yi!q#yi!v#yi#S#yi#z#yi#{#yi#|#yi#}#yi$O#yi#X#yi!x#yi!}#yi~P!'WOz8tO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dOT#yi!S#yi!b#yi!q#yi!v#yi#S#yi#z#yi#{#yi#|#yi#}#yi$O#yi$Q#yi#X#yi!x#yi!}#yi~P!'WOz8tO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dOT#yi!S#yi!b#yi!q#yi!v#yi#S#yi#z#yi#{#yi#|#yi#}#yi$O#yi$Q#yi$R#yi#X#yi!x#yi!}#yi~P!'WOz8tO$T9RO$V9TO$W9TO$z#dOT#yi!S#yi!b#yi!q#yi!v#yi#S#yi#z#yi#{#yi#|#yi#}#yi$O#yi$Q#yi$R#yi$S#yi$U#yi#X#yi!x#yi!}#yi~P!'WOz8tO$V9TO$W9TO$z#dOT#yi!S#yi!b#yi!q#yi!v#yi#S#yi#z#yi#{#yi#|#yi#}#yi$O#yi$Q#yi$R#yi$S#yi$T#yi$U#yi#X#yi!x#yi!}#yi~P!'WOz8tO$S9QO$T9RO$V9TO$W9TO$z#dOT#yi!S#yi!b#yi!q#yi!v#yi#S#yi#z#yi#{#yi#|#yi#}#yi$O#yi$Q#yi$R#yi$U#yi#X#yi!x#yi!}#yi~P!'WOz8tO$W9TO$z#dOT#yi!S#yi!b#yi!q#yi!v#yi#S#yi#z#yi#{#yi#|#yi#}#yi$O#yi$Q#yi$R#yi$S#yi$T#yi$U#yi$V#yi#X#yi!x#yi!}#yi~P!'WOz8tO!v=ZO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dOT#Pi!S#Pi!b#Pi!q#Pi#X#Pi!x#Pi!}#Pi~P!'WOz8tO!v=ZO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dOT#vi!S#vi!b#vi!q#vi#X#vi!x#vi!}#vi~P!'WOT8vOz8tO!S8wO!b8xO!v=ZO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dO!q#xi#X#xi!x#xi!}#xi~P!'WO!q=eO#O7|O~Oz8tO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dOT!uq!S!uq!b!uq!q!uq!v!uq#X!uq!x!uq!}!uq~P!'WOz8tO!v=ZO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dOT#Pq!S#Pq!b#Pq!q#Pq#X#Pq!x#Pq!}#Pq~P!'WO!q=iO#O8TO~OT8vOz8tO!S8wO!b8xO!v=ZO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dO!q$jq#X$jq!x$jq!}$jq~P!'WO#O8TO#l'SO~Oz8tO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dOT!uy!S!uy!b!uy!q!uy!v!uy#X!uy!x!uy!}!uy~P!'WOT8vOz8tO!S8wO!b8xO!v=ZO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dO!q$jy#X$jy!x$jy!}$jy~P!'WO#O8UO#l'SO~OT8vOz8tO!S8wO!b8xO!v=ZO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dO!q$j!R#X$j!R!x$j!R!}$j!R~P!'WO#O8XO#l'SO~OT8vOz8tO!S8wO!b8xO!v=ZO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dO!q$j!Z#X$j!Z!x$j!Z!}$j!Z~P!'WOT8vOz8tO!S8wO!b8xO!v=ZO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dO!q$j!c#X$j!c!x$j!c!}$j!c~P!'WO#S:bO~P>UO#O:aO!q'PX!x'PX~PGSO$l$tO~P$8YOP6]OU^O[9WOo>SOs#hOx9WOy9WO}`O!O]O!Q:lO!T9WO!U9WO!V9WO!Y9WO!c8hO!s#gO!y[O#W_O#bhO#daO#ebO#peO$T:iO$]9WO$^:iO$aqO$l$tO$z:nO${!OO~P$;lOo8_Os$lO~O#SSOs#hOx9WOy9WO}`O!O]O!Q:lO!T9WO!U9WO!V9WO!Y9WO!c8hO!s#gO!y[O#SSOs#hOx9WOy9WO}`O!O]O!Q:lO!T9WO!U9WO!V9WO!Y9WO!c8hO!s#gO!y[O#S=UO#W_O#bhO#daO#ebO#peO$T:iO$]9WO$^:iO$aqO$z:nO${!OO~P$;lOT6iOz6gO!S6jO!b6kO!v8sO#O=SO#S#QO#z6hO#{6lO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dO~P!'WOT6iOz6gO!S6jO!b6kO!v8sO#O=RO#S#QO#z6hO#{6lO#|6mO#}6nO$O6oO$Q6qO$R6rO$S6sO$T6tO$U6uO$V6vO$W6vO$z#dO!m'PX!q'PX!n'PX!}'PX~P!'WOT&zXz&zX!S&zX!b&zX!o&zX!q&zX!v&zX!y&zX#S&zX#W&zX#`&zX#a&zX#s&zX#z&zX#{&zX#|&zX#}&zX$O&zX$Q&zX$R&zX$S&zX$T&zX$U&zX$V&zX$W&zX$z&zX!}&zX~O#u9ZO#w9[O#X&zX!x&zX~P.8oO!y$hO#S=^O~O!q9hO~P>UO!y$hO#S=cO~O!q>OO#O9}O~OT8vOz8tO!S8wO!b8xO!q:OO!v=ZO#S#QO#z8uO#{8yO#|8zO#}8{O$O8|O$Q9OO$R9PO$S9QO$T9RO$U9SO$V9TO$W9TO$z#dO~P!'WOT:tOz:pO!S:vO!b:xO!v=mO#S#QO#z:rO#{:zO#|:|O#};OO$O;QO$Q;UO$R;WO$S;YO$T;[O$U;^O$V;`O$W;`O$z#dO!m#Ta!q#Ta!n#Ta!}#Ta~P!'WOT:tOz:pO!S:vO!b:xO!v=mO#S#QO#z:rO#{:zO#|:|O#};OO$O;QO$Q;UO$R;WO$S;YO$T;[O$U;^O$V;`O$W;`O$z#dO!m'Pa!q'Pa!n'Pa!}'Pa~P!'WO!q>PO#O:RO~O!q>QO#O:YO~O#O:YO#l'SO~O#O:ZO#l'SO~O#O:_O#l'SO~O#u;eO#w;gO!m&zX!n&zX~P.8oO#u;fO#w;hOT&zXz&zX!S&zX!b&zX!o&zX!v&zX!y&zX#S&zX#W&zX#`&zX#a&zX#s&zX#z&zX#{&zX#|&zX#}&zX$O&zX$Q&zX$R&zX$S&zX$T&zX$U&zX$V&zX$W&zX$z&zX~O!q;tO~P>UO!q;uO~P>UO!q>XO#OYO#O9WO~OT8vOz8tO!S8wO!b8xO!qZO#O[O#O<{O~O#O<{O#l'SO~O#O9WO#l'SO~O#O<|O#l'SO~O#O=PO#l'SO~O!y$hO#S=|O~Oo=[Os$lO~O!y$hO#S=}O~O!y$hO#S>UO~O!y$hO#S>VO~O!y$hO#S>WO~Oo={Os$lO~Oo>TOs$lO~Oo>SOs$lO~O%O$U$}$d!d$V#b%V#e'g!s#d~",goto:"%&y'mPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP'nP'uPP'{(OPPP(hP(OP(O*ZP*ZPP2W:j:mPP*Z:sBpPBsPBsPP:sCSCVCZ:s:sPPPC^PP:sK^!$S!$S:s!$WP!$W!$W!%UP!.]!7pP!?oP*ZP*Z*ZPPPPP!?rPPPPPPP*Z*Z*Z*ZPP*Z*ZP!E]!GRP!GV!Gy!GR!GR!HP*Z*ZP!HY!Hl!Ib!J`!Jd!J`!Jo!J}!J}!KV!KY!KY*ZPP*ZPP!K^#%[#%[#%`P#%fP(O#%j(O#&S#&V#&V#&](O#&`(O(O#&f#&i(O#&r#&u(O(O(O(O(O#&x(O(O(O(O(O(O(O(O(O#&{!KR(O(O#'_#'o#'r(O(OP#'u#'|#(S#(o#(y#)P#)Z#)b#)h#*d#4X#5T#5Z#5a#5k#5q#5w#6]#6c#6i#6o#6u#6{#7R#7]#7g#7m#7s#7}PPPPPPPP#8T#8X#8}#NO#NR#N]$(f$(r$)X$)_$)b$)e$)k$,X$5v$>_$>b$>h$>k$>n$>w$>{$?X$?k$Bk$CO$C{$K{PP%%y%%}%&Z%&p%&vQ!nQT!qV!rQUOR%x!mRVO}!hPVX!S!j!r!s!w$}%P%S%U(`+r+u.b.d.l0`0a0i1a|!hPVX!S!j!r!s!w$}%P%S%U(`+r+u.b.d.l0`0a0i1aQ%^!ZQ%g!aQ%l!eQ'd$dQ'q$iQ)[%kQ*y'tQ,](xU-n*v*x+OQ.W+cQ.{,[S/t-s-tQ0T.SS0}/s/wQ1V0RQ1o1OR2P1p0u!OPVX[_bjklmnopxyz!S!W!X!Y!]!g!j!r!s!w!y!z!{!}#R#S#T#U#V#W#X#Y#Z#[#]#^#_#`#a#b#k#n#o#s#t$R$S$U$y$}%P%R%S%T%U%c%}&S&W&p&s&t&w'O'U'Y'z(O(`(l({)P)i)p)t)v*P*T*U*o+P+r+u+z,T,V,X-Q-R-d-k-z.b.d.l.t/c/i/m/x0V0`0a0d0e0i0v1R1]1a2[2]2^2_2`2a2b2c2d2e2f2g2h2i2j2k2l2m2n2o2p2s2t2u2v2w3P3d3g3h3k3o3p3s3u3v3x3y3z3{3|3}4O4P4Q4R4S4T4U4V4W4Z4a4b4c4d4e4f4g4h4i4j4k4l4m4n4o4p4q4r4s4t4u4v4w4x5Q5e5h5i5l5p5q5t5v5w6T6^6_6`6a6b6c6d6e6f6g6h6i6j6k6l6m6n6o6p6q6r6s6t6u6v6x6y6z6{6|7X7i7l7o7r7s7u7w7z7|8T8U8X8Z8[8f8g8h8i8j8k8l8m8n8o8p8q8r8s8t8u8v8w8x8y8z8{8|8}9O9P9Q9R9S9T9V9W9X9Z9[9]9h9y9}:O:R:Y:Z:_:a:b:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:u:v:w:x:y:z:{:|:};O;P;Q;R;S;T;U;V;W;X;Y;Z;[;];^;_;`;a;c;d;e;f;g;h;i;t;uO>P>Q>X>Y>Z>[3ZfPVX[_bgjklmnoprxyz!S!W!X!Y!]!e!f!g!j!r!s!w!y!z!{!}#R#S#T#U#V#W#X#Y#Z#[#]#^#_#`#a#b#k#n#o#s#t#}$R$S$U$h$y$}%P%R%S%T%U%c%p%r%}&S&W&p&s&t&w'O'S'U'Y'^'i'm'r'z(O(P(R(S(T(`(l({)P)Z)_)c)i)p)t)v*P*T*U*f*o*s*z*}+P+Q+]+`+d+g+r+u+z,T,V,X,Z,u-Q-R-d-k-r-u-z-{-|.Q.b.d.l.t/[/c/i/m/u/x0V0`0a0d0e0i0v1P1R1]1a2[2]2^2_2`2a2b2c2d2e2f2g2h2i2j2k2l2m2n2o2p2s2t2u2v2w3P3d3g3h3k3o3p3s3u3v3x3y3z3{3|3}4O4P4Q4R4S4T4U4V4W4Z4a4b4c4d4e4f4g4h4i4j4k4l4m4n4o4p4q4r4s4t4u4v4w4x5Q5e5h5i5l5p5q5t5v5w5}6O6P6T6]6^6_6`6a6b6c6d6e6f6g6h6i6j6k6l6m6n6o6p6q6r6s6t6u6v6x6y6z6{6|7X7i7l7o7r7s7u7w7z7|8T8U8X8Z8[8b8c8d8f8g8h8i8j8k8l8m8n8o8p8q8r8s8t8u8v8w8x8y8z8{8|8}9O9P9Q9R9S9T9V9W9X9Z9[9]9h9y9}:O:R:Y:Z:_:a:b:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:u:v:w:x:y:z:{:|:};O;P;Q;R;S;T;U;V;W;X;Y;Z;[;];^;_;`;a;c;d;e;f;g;h;i;t;uO>P>Q>X>Y>Z>[3scPVX[_bdegjklmnoprxyz!S!W!X!Y!]!e!f!g!j!r!s!w!y!z!{!}#R#S#T#U#V#W#X#Y#Z#[#]#^#_#`#a#b#k#n#o#s#t#{#}$R$S$U$h$y$}%P%R%S%T%U%c%m%n%p%r%}&S&W&p&s&t&w'O'S'U'Y'^'i'm'r'z(O(P(R(S(T(`(l({)P)Z)^)_)c)g)h)i)p)t)v*P*T*U*f*o*s*z*}+P+Q+]+`+d+g+r+u+z,T,V,X,Z,u,x-Q-R-d-k-r-u-z-{-|.Q.b.d.l.t/[/c/i/m/u/x0V0`0a0d0e0i0v1P1R1]1a2W2X2Y2[2]2^2_2`2a2b2c2d2e2f2g2h2i2j2k2l2m2n2o2p2s2t2u2v2w3P3d3g3h3k3o3p3s3u3v3x3y3z3{3|3}4O4P4Q4R4S4T4U4V4W4Z4a4b4c4d4e4f4g4h4i4j4k4l4m4n4o4p4q4r4s4t4u4v4w4x5Q5e5h5i5l5p5q5t5v5w5}6O6P6T6]6^6_6`6a6b6c6d6e6f6g6h6i6j6k6l6m6n6o6p6q6r6s6t6u6v6x6y6z6{6|7X7i7l7o7r7s7u7w7z7|8T8U8X8Z8[8b8c8d8f8g8h8i8j8k8l8m8n8o8p8q8r8s8t8u8v8w8x8y8z8{8|8}9O9P9Q9R9S9T9V9W9X9Z9[9]9h9y9}:O:R:Y:Z:_:a:b:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:u:v:w:x:y:z:{:|:};O;P;Q;R;S;T;U;V;W;X;Y;Z;[;];^;_;`;a;c;d;e;f;g;h;i;t;uO>P>Q>X>Y>Z>[0phPVX[_bjklmnopxyz!S!W!X!Y!]!g!j!r!s!w!y!z!{!}#R#S#T#U#V#W#X#Y#Z#[#]#^#_#`#a#b#k#n#o#s#t$R$S$U$y$}%P%R%S%T%U%c%}&S&W&p&s&t&w'O'U'Y'z(O(`(l({)P)i)p)t)v*P*T*U*o+P+r+u+z,T,V,X-Q-R-d-k-z.b.d.l.t/c/i/m/x0`0a0d0e0i0v1R1a2[2]2^2_2`2a2b2c2d2e2f2g2h2i2j2k2l2m2n2o2p2s2t2u2v2w3P3d3g3h3k3o3p3s3u3v3x3y3z3{3|3}4O4P4Q4R4S4T4U4V4W4Z4a4b4c4d4e4f4g4h4i4j4k4l4m4n4o4p4q4r4s4t4u4v4w4x5Q5e5h5i5l5p5q5t5v5w6T6^6_6`6a6b6c6d6e6f6g6h6i6j6k6l6m6n6o6p6q6r6s6t6u6v6x6y6z6{6|7X7i7l7o7r7s7u7w7z7|8T8U8X8Z8[8f8g8h8i8j8k8l8m8n8o8p8q8r8s8t8u8v8w8x8y8z8{8|8}9O9P9Q9R9S9T9V9W9X9Z9[9]9h9y9}:O:R:Y:Z:_:a:b:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:u:v:w:x:y:z:{:|:};O;P;Q;R;S;T;U;V;W;X;Y;Z;[;];^;_;`;a;c;d;e;f;g;h;i;t;uRS=p>S>VS=s>T>UR=t>WT'n$h*s!csPVXt!S!j!r!s!w$h$}%P%S%U'i(T(`)W*s+]+g+r+u,g,k.b.d.l0`0a0i1aQ$^rR*`'^Q*x'sQ-t*{R/w-wQ(W$tQ)U%hQ)n%vQ*i'fQ+k(XR-c*jQ(V$tQ)Y%jQ)m%vQ*e'eS*h'f)nS+j(W(XS-b*i*jQ.]+kQ/T,mQ/e-`R/g-cQ(U$tQ)T%hQ)V%iQ)l%vU*g'f)m)nU+i(V(W(XQ,f)UU-a*h*i*jS.[+j+kS/f-b-cQ0X.]R0t/gT+e(T+g[%e!_$b'c+a.R0QR,d)Qb$ov(T+[+]+`+g.P.Q0PR+T'{S+e(T+gT,j)W,kR0W.XT1[0V1]0w|PVX[_bjklmnopxyz!S!W!X!Y!]!g!j!r!s!w!y!z!{!}#R#S#T#U#V#W#X#Y#Z#[#]#^#_#`#a#b#k#n#o#s#t$R$S$U$y$}%P%R%S%T%U%c%}&S&W&p&s&t&w'O'U'Y'z(O(`(l({)P)i)p)t)v*P*T*U*o+P+r+u+z,T,V,X,_-Q-R-d-k-z.b.d.l.t/c/i/m/x0V0`0a0d0e0i0v1R1]1a2[2]2^2_2`2a2b2c2d2e2f2g2h2i2j2k2l2m2n2o2p2s2t2u2v2w3P3d3g3h3k3o3p3s3u3v3x3y3z3{3|3}4O4P4Q4R4S4T4U4V4W4Z4a4b4c4d4e4f4g4h4i4j4k4l4m4n4o4p4q4r4s4t4u4v4w4x5Q5e5h5i5l5p5q5t5v5w6T6^6_6`6a6b6c6d6e6f6g6h6i6j6k6l6m6n6o6p6q6r6s6t6u6v6x6y6z6{6|7X7i7l7o7r7s7u7w7z7|8T8U8X8Z8[8f8g8h8i8j8k8l8m8n8o8p8q8r8s8t8u8v8w8x8y8z8{8|8}9O9P9Q9R9S9T9V9W9X9Z9[9]9h9y9}:O:R:Y:Z:_:a:b:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:u:v:w:x:y:z:{:|:};O;P;Q;R;S;T;U;V;W;X;Y;Z;[;];^;_;`;a;c;d;e;f;g;h;i;t;uO>P>Q>X>Y>Z>[R2Y2X|tPVX!S!j!r!s!w$}%P%S%U(`+r+u.b.d.l0`0a0i1aW$`t'i+],gS'i$h*sS+](T+gT,g)W,kQ'_$^R*a'_Q*t'oR-m*tQ/p-oS0{/p0|R0|/qQ-}+XR/|-}Q+g(TR.Y+gS+`(T+gS,h)W,kQ.Q+]W.T+`,h.Q/OR/O,gQ)R%eR,e)RQ'|$oR+U'|Q1]0VR1w1]Q${{R(^${Q+t(aR.c+tQ+w(bR.g+wQ+}(cQ,P(dT.m+},PQ(|%`S,a(|7tR7t7VQ(y%^R,^(yQ,k)WR/R,kQ)`%oS,q)`/WR/W,rQ,v)dR/^,vT!uV!rj!iPVX!j!r!s!w(`+r.l0`0a1aQ%Q!SQ(a$}W(h%P%S%U0iQ.e+uQ0Z.bR0[.d|ZPVX!S!j!r!s!w$}%P%S%U(`+r+u.b.d.l0`0a0i1aQ#f[U#m_#s&wQ#wbQ$VkQ$WlQ$XmQ$YnQ$ZoQ$[pQ$sx^$uy2_4b6e8q:m:nQ$vzQ%W!WQ%Y!XQ%[!YW%`!]%R(l,VU%s!g&p-RQ%|!yQ&O!zQ&Q!{S&U!})v^&^#R2a4d6g8t:p:qQ&_#SQ&`#TQ&a#UQ&b#VQ&c#WQ&d#XQ&e#YQ&f#ZQ&g#[Q&h#]Q&i#^Q&j#_Q&k#`Q&l#aQ&m#bQ&u#nQ&v#oS&{#t'OQ'X$RQ'Z$SQ'[$UQ(]$yQ(p%TQ)q%}Q)s&SQ)u&WQ*O&tS*['U4ZQ*^'Y^*_2[3u5v8Z:a=R=SQ+S'zQ+V(OQ,`({Q,c)PQ,y)iQ,{)pQ,})tQ-V*PQ-W*TQ-X*U^-]2]3v5w8[:b=T=UQ-i*oQ-x+PQ.k+zQ.w,XQ/`-QQ/h-dQ/n-kQ/y-zQ0r/cQ0u/iQ0x/mQ1Q/xU1X0V1]9WQ1d0eQ1m0vQ1q1RQ2Z2^Q2qjQ2r3yQ2x3zQ2y3|Q2z4OQ2{4QQ2|4SQ2}4UQ3O2`Q3Q2bQ3R2cQ3S2dQ3T2eQ3U2fQ3V2gQ3W2hQ3X2iQ3Y2jQ3Z2kQ3[2lQ3]2mQ3^2nQ3_2oQ3`2pQ3a2sQ3b2tQ3c2uQ3e2vQ3f2wQ3i3PQ3j3dQ3l3gQ3m3hQ3n3kQ3q3oQ3r3pQ3t3sQ4Y4WQ4y3{Q4z3}Q4{4PQ4|4RQ4}4TQ5O4VQ5P4cQ5R4eQ5S4fQ5T4gQ5U4hQ5V4iQ5W4jQ5X4kQ5Y4lQ5Z4mQ5[4nQ5]4oQ5^4pQ5_4qQ5`4rQ5a4sQ5b4tQ5c4uQ5d4vQ5f4wQ5g4xQ5j5QQ5k5eQ5m5hQ5n5iQ5o5lQ5r5pQ5s5qQ5u5tQ6Q4aQ6R3xQ6V6TQ6}6^Q7O6_Q7P6`Q7Q6aQ7R6bQ7S6cQ7T6dQ7U6fU7V,T.t0dQ7W%cQ7Y6hQ7Z6iQ7[6jQ7]6kQ7^6lQ7_6mQ7`6nQ7a6oQ7b6pQ7c6qQ7d6rQ7e6sQ7f6tQ7g6uQ7h6vQ7j6xQ7k6yQ7n6zQ7p6{Q7q6|Q7x7XQ7y7iQ7{7oQ7}7rQ8O7sQ8P7uQ8Q7wQ8R7zQ8S7|Q8V8TQ8W8UQ8Y8XQ8]8fU9U#k&s7lQ9^8jQ9_8kQ9`8lQ9a8mQ9b8nQ9c8oQ9e8pQ9f8rQ9g8sQ9i8uQ9j8vQ9k8wQ9l8xQ9m8yQ9n8zQ9o8{Q9p8|Q9q8}Q9r9OQ9s9PQ9t9QQ9u9RQ9v9SQ9w9TQ9x9ZQ9z9[Q9{9]Q:P9hQ:Q9yQ:T9}Q:V:OQ:W:RQ:[:YQ:^:ZQ:`:_Q:c8iQ;j:dQ;k:eQ;l:fQ;m:gQ;n:hQ;o:iQ;p:jQ;q:kQ;r:lQ;s:oQ;v:rQ;w:sQ;x:tQ;y:uQ;z:vQ;{:wQ;|:xQ;}:yQOQ=h>PQ=j>QQ=u>XQ=v>YQ=w>ZR=x>[0t!OPVX[_bjklmnopxyz!S!W!X!Y!]!g!j!r!s!w!y!z!{!}#R#S#T#U#V#W#X#Y#Z#[#]#^#_#`#a#b#k#n#o#s#t$R$S$U$y$}%P%R%S%T%U%c%}&S&W&p&s&t&w'O'U'Y'z(O(`(l({)P)i)p)t)v*P*T*U*o+P+r+u+z,T,V,X-Q-R-d-k-z.b.d.l.t/c/i/m/x0V0`0a0d0e0i0v1R1]1a2[2]2^2_2`2a2b2c2d2e2f2g2h2i2j2k2l2m2n2o2p2s2t2u2v2w3P3d3g3h3k3o3p3s3u3v3x3y3z3{3|3}4O4P4Q4R4S4T4U4V4W4Z4a4b4c4d4e4f4g4h4i4j4k4l4m4n4o4p4q4r4s4t4u4v4w4x5Q5e5h5i5l5p5q5t5v5w6T6^6_6`6a6b6c6d6e6f6g6h6i6j6k6l6m6n6o6p6q6r6s6t6u6v6x6y6z6{6|7X7i7l7o7r7s7u7w7z7|8T8U8X8Z8[8f8g8h8i8j8k8l8m8n8o8p8q8r8s8t8u8v8w8x8y8z8{8|8}9O9P9Q9R9S9T9V9W9X9Z9[9]9h9y9}:O:R:Y:Z:_:a:b:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:u:v:w:x:y:z:{:|:};O;P;Q;R;S;T;U;V;W;X;Y;Z;[;];^;_;`;a;c;d;e;f;g;h;i;t;uO>P>Q>X>Y>Z>[S$]r'^Q%k!eS%o!f%rQ)b%pU+X(R(S+dQ,p)_Q,t)cQ/Z,uQ/{-|R0p/[|vPVX!S!j!r!s!w$}%P%S%U(`+r+u.b.d.l0`0a0i1a#U#i[bklmnopxyz!W!X!Y!{#R#S#T#U#V#W#X#Y#Z#[#]#^#_#`#a#b$R$S$U$y%}&S'Y(O)p+P-z/x0e1R2[2]6x6yd+^(T)W+]+`+g,g,h,k.Q/O!t6w'U2^2_2`2a2b2c2d2e2f2g2h2i2j2k2l2m2n2o2p2s2t2u2v2w3P3d3g3h3k3o3p3s3z3|4O4Q4S4U5v5w!x;b3u3v3x3y3{3}4P4R4T4V4Z4a4b4c4d4e4f4g4h4i4j4k4l4m4n4o4p4q4r4s4t4u4v4w4x5Q5e5h5i5l5p5q5t$O=z_j!]!g#k#n#o#s#t%R%T&p&s&t&w'O'z(l({)P)i*P*U,V,X-R6^6_6`6a6b6c6d6e6f6g6h6i6j6k6l6m6n6o6p6q6r6s6t6u6v6z6{6|7X7l7o7r7w7|8T8U8X8Z8[8f8g8h8i#|>]!y!z!}%c&W)t)v*T*o,T-d-k.t/c/i/m0d0v4W6T7i7s7u7z8j8k8l8m8n8o8p8q8r8s8t8u8v8w8x8y8z8{8|8}9O9P9Q9R9S9T9Z9[9]9h9y9}:O:R:Y:Z:_:a:b;c;d=Z=m=n!v>^+z-Q9V9X:d:e:f:g:h:j:k:m:o:p:r:t:v:x:z:|;O;Q;S;U;W;Y;[;^;`;e;g;i;t_0V1]9W:i:l:n:q:s:u:w:y:{:};P;R;T;V;X;Z;];_;a;f;h;u AssignmentExpression ArrayExpression ValueList & VariadicUnpacking ... Pair [ ] ListExpression ValueList Pair Pair SubscriptExpression MemberExpression -> ?-> VariableName DynamicVariable $ ${ CallExpression ArgList NamedArgument SpreadArgument CastExpression UnionType LogicOp OptionalType NamedType QualifiedName \\ NamespaceName ScopedExpression :: ClassMemberName AssignOp UpdateExpression UpdateOp YieldExpression BinaryExpression LogicOp LogicOp LogicOp BitOp BitOp BitOp CompareOp CompareOp BitOp ArithOp ConcatOp ArithOp ArithOp IncludeExpression RequireExpression CloneExpression UnaryExpression ControlOp LogicOp PrintIntrinsic FunctionExpression static ParamList Parameter #[ Attributes Attribute VariadicParameter PropertyParameter UseList ArrowFunction NewExpression class BaseClause ClassInterfaceClause DeclarationList ConstDeclaration VariableDeclarator PropertyDeclaration VariableDeclarator MethodDeclaration UseDeclaration UseList UseInsteadOfClause UseAsClause UpdateExpression ArithOp ShellExpression ThrowExpression Integer Float String MemberExpression SubscriptExpression UnaryExpression ArithOp Interpolation String IfStatement ColonBlock SwitchStatement Block CaseStatement DefaultStatement ColonBlock WhileStatement EmptyStatement DoStatement ForStatement ForSpec SequenceExpression ForeachStatement ForSpec Pair GotoStatement ContinueStatement BreakStatement ReturnStatement TryStatement CatchDeclarator DeclareStatement EchoStatement UnsetStatement ConstDeclaration FunctionDefinition ClassDeclaration InterfaceDeclaration TraitDeclaration EnumDeclaration EnumBody EnumCase NamespaceDefinition NamespaceUseDeclaration UseGroup UseClause UseClause GlobalDeclaration FunctionStaticDeclaration Program",maxTerm:304,nodeProps:[["group",-36,2,8,49,81,83,85,88,93,94,102,106,107,110,111,114,118,123,126,130,132,133,147,148,149,150,153,154,164,165,179,181,182,183,184,185,191,"Expression",-28,74,78,80,82,192,194,199,201,202,205,208,209,210,211,212,214,215,216,217,218,219,220,221,222,225,226,230,231,"Statement",-3,119,121,122,"Type"],["isolate",-4,66,67,70,191,""],["openedBy",69,"phpOpen",76,"{",86,"(",101,"#["],["closedBy",71,"phpClose",77,"}",87,")",158,"]"]],propSources:[gy],skippedNodes:[0],repeatNodeCount:29,tokenData:"!F|_R!]OX$zXY&^YZ'sZ]$z]^&^^p$zpq&^qr)Rrs+Pst+otu2buv5evw6rwx8Vxy>]yz>yz{?g{|@}|}Bb}!OCO!O!PDh!P!QKT!Q!R!!o!R![!$q![!]!,P!]!^!-a!^!_!-}!_!`!1S!`!a!2d!a!b!3t!b!c!7^!c!d!7z!d!e!9W!e!}!7z!}#O!;^#O#P!;z#P#Q!V<%lO8VR9WV&wP%VQOw9mwx:Xx#O9m#O#P:^#P;'S9m;'S;=`;X<%lO9mQ9rV%VQOw9mwx:Xx#O9m#O#P:^#P;'S9m;'S;=`;X<%lO9mQ:^O%VQQ:aRO;'S9m;'S;=`:j;=`O9mQ:oW%VQOw9mwx:Xx#O9m#O#P:^#P;'S9m;'S;=`;X;=`<%l9m<%lO9mQ;[P;=`<%l9mR;fV&wP%VQOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zRV<%l~8V~O8V~~%fR=OW&wPOY8VYZ9PZ!^8V!^!_;{!_;'S8V;'S;=`=h;=`<%l9m<%lO8VR=mW%VQOw9mwx:Xx#O9m#O#P:^#P;'S9m;'S;=`;X;=`<%l8V<%lO9mR>YP;=`<%l8VR>dV!yQ&wPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zV?QV!xU&wPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR?nY&wP$VQOY$zYZ%fZz$zz{@^{!^$z!^!_%k!_!`6U!`;'S$z;'S;=`&W<%lO$zR@eW$WQ&wPOY$zYZ%fZ!^$z!^!_%k!_!`6U!`;'S$z;'S;=`&W<%lO$zRAUY$TQ&wPOY$zYZ%fZ{$z{|At|!^$z!^!_%k!_!`6U!`;'S$z;'S;=`&W<%lO$zRA{V$zQ&wPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zRBiV!}Q&wPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$z_CXZ$TQ%TW&wPOY$zYZ%fZ}$z}!OAt!O!^$z!^!_%k!_!`6U!`!aCz!a;'S$z;'S;=`&W<%lO$zVDRV#`U&wPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zVDo[&wP$UQOY$zYZ%fZ!O$z!O!PEe!P!Q$z!Q![Fs![!^$z!^!_%k!_!`6U!`;'S$z;'S;=`&W<%lO$zVEjX&wPOY$zYZ%fZ!O$z!O!PFV!P!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zVF^V#UU&wPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zRFz_&wP%OQOY$zYZ%fZ!Q$z!Q![Fs![!^$z!^!_%k!_!g$z!g!hGy!h#R$z#R#SJc#S#X$z#X#YGy#Y;'S$z;'S;=`&W<%lO$zRHO]&wPOY$zYZ%fZ{$z{|Hw|}$z}!OHw!O!Q$z!Q![Ii![!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zRH|X&wPOY$zYZ%fZ!Q$z!Q![Ii![!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zRIpZ&wP%OQOY$zYZ%fZ!Q$z!Q![Ii![!^$z!^!_%k!_#R$z#R#SHw#S;'S$z;'S;=`&W<%lO$zRJhX&wPOY$zYZ%fZ!Q$z!Q![Fs![!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zVK[[&wP$VQOY$zYZ%fZz$zz{LQ{!P$z!P!Q,o!Q!^$z!^!_%k!_!`6U!`;'S$z;'S;=`&W<%lO$zVLVX&wPOYLQYZLrZzLQz{N_{!^LQ!^!_! s!_;'SLQ;'S;=`!!i<%lOLQVLwT&wPOzMWz{Mj{;'SMW;'S;=`NX<%lOMWUMZTOzMWz{Mj{;'SMW;'S;=`NX<%lOMWUMmVOzMWz{Mj{!PMW!P!QNS!Q;'SMW;'S;=`NX<%lOMWUNXO!eUUN[P;=`<%lMWVNdZ&wPOYLQYZLrZzLQz{N_{!PLQ!P!Q! V!Q!^LQ!^!_! s!_;'SLQ;'S;=`!!i<%lOLQV! ^V!eU&wPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zV! vZOYLQYZLrZzLQz{N_{!aLQ!a!bMW!b;'SLQ;'S;=`!!i<%l~LQ~OLQ~~%fV!!lP;=`<%lLQZ!!vm&wP$}YOY$zYZ%fZ!O$z!O!PFs!P!Q$z!Q![!$q![!^$z!^!_%k!_!d$z!d!e!&o!e!g$z!g!hGy!h!q$z!q!r!(a!r!z$z!z!{!){!{#R$z#R#S!%}#S#U$z#U#V!&o#V#X$z#X#YGy#Y#c$z#c#d!(a#d#l$z#l#m!){#m;'S$z;'S;=`&W<%lO$zZ!$xa&wP$}YOY$zYZ%fZ!O$z!O!PFs!P!Q$z!Q![!$q![!^$z!^!_%k!_!g$z!g!hGy!h#R$z#R#S!%}#S#X$z#X#YGy#Y;'S$z;'S;=`&W<%lO$zZ!&SX&wPOY$zYZ%fZ!Q$z!Q![!$q![!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zZ!&tY&wPOY$zYZ%fZ!Q$z!Q!R!'d!R!S!'d!S!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zZ!'k[&wP$}YOY$zYZ%fZ!Q$z!Q!R!'d!R!S!'d!S!^$z!^!_%k!_#R$z#R#S!&o#S;'S$z;'S;=`&W<%lO$zZ!(fX&wPOY$zYZ%fZ!Q$z!Q!Y!)R!Y!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zZ!)YZ&wP$}YOY$zYZ%fZ!Q$z!Q!Y!)R!Y!^$z!^!_%k!_#R$z#R#S!(a#S;'S$z;'S;=`&W<%lO$zZ!*Q]&wPOY$zYZ%fZ!Q$z!Q![!*y![!^$z!^!_%k!_!c$z!c!i!*y!i#T$z#T#Z!*y#Z;'S$z;'S;=`&W<%lO$zZ!+Q_&wP$}YOY$zYZ%fZ!Q$z!Q![!*y![!^$z!^!_%k!_!c$z!c!i!*y!i#R$z#R#S!){#S#T$z#T#Z!*y#Z;'S$z;'S;=`&W<%lO$zR!,WX!qQ&wPOY$zYZ%fZ![$z![!]!,s!]!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR!,zV#sQ&wPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zV!-hV!mU&wPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR!.S[$RQOY$zYZ%fZ!^$z!^!_!.x!_!`!/i!`!a*c!a!b!0]!b;'S$z;'S;=`&W<%l~$z~O$z~~%fR!/PW$SQ&wPOY$zYZ%fZ!^$z!^!_%k!_!`6U!`;'S$z;'S;=`&W<%lO$zR!/pX$RQ&wPOY$zYZ%fZ!^$z!^!_%k!_!`$z!`!a*c!a;'S$z;'S;=`&W<%lO$zP!0bR!iP!_!`!0k!r!s!0p#d#e!0pP!0pO!iPP!0sQ!j!k!0y#[#]!0yP!0|Q!r!s!0k#d#e!0kV!1ZX#uQ&wPOY$zYZ%fZ!^$z!^!_%k!_!`)r!`!a!1v!a;'S$z;'S;=`&W<%lO$zV!1}V#OU&wPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR!2kX$RQ&wPOY$zYZ%fZ!^$z!^!_%k!_!`!3W!`!a!.x!a;'S$z;'S;=`&W<%lO$zR!3_V$RQ&wPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zV!3{[!vQ&wPOY$zYZ%fZ}$z}!O!4q!O!^$z!^!_%k!_!`$z!`!a!6P!a!b!6m!b;'S$z;'S;=`&W<%lO$zV!4vX&wPOY$zYZ%fZ!^$z!^!_%k!_!`$z!`!a!5c!a;'S$z;'S;=`&W<%lO$zV!5jV#aU&wPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zV!6WV!gU&wPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR!6tW#zQ&wPOY$zYZ%fZ!^$z!^!_%k!_!`6U!`;'S$z;'S;=`&W<%lO$zR!7eV$]Q&wPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$z_!8Ra&wP!s^OY$zYZ%fZ!Q$z!Q![!7z![!^$z!^!_%k!_!c$z!c!}!7z!}#R$z#R#S!7z#S#T$z#T#o!7z#o$g$z$g&j!7z&j;'S$z;'S;=`&W<%lO$z_!9_e&wP!s^OY$zYZ%fZr$zrs!:psw$zwx8Vx!Q$z!Q![!7z![!^$z!^!_%k!_!c$z!c!}!7z!}#R$z#R#S!7z#S#T$z#T#o!7z#o$g$z$g&j!7z&j;'S$z;'S;=`&W<%lO$zR!:wV&wP'gQOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zV!;eV#WU&wPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zV!mZ!^!=u!^!_!@u!_#O!=u#O#P!Aq#P#S!=u#S#T!B{#T;'S!=u;'S;=`!Ci<%lO!=uR!>rV&wPO#O!?X#O#P!?q#P#S!?X#S#T!@j#T;'S!?X;'S;=`!@o<%lO!?XQ!?[VO#O!?X#O#P!?q#P#S!?X#S#T!@j#T;'S!?X;'S;=`!@o<%lO!?XQ!?tRO;'S!?X;'S;=`!?};=`O!?XQ!@QWO#O!?X#O#P!?q#P#S!?X#S#T!@j#T;'S!?X;'S;=`!@o;=`<%l!?X<%lO!?XQ!@oO${QQ!@rP;=`<%l!?XR!@x]OY!=uYZ!>mZ!a!=u!a!b!?X!b#O!=u#O#P!Aq#P#S!=u#S#T!B{#T;'S!=u;'S;=`!Ci<%l~!=u~O!=u~~%fR!AvW&wPOY!=uYZ!>mZ!^!=u!^!_!@u!_;'S!=u;'S;=`!B`;=`<%l!?X<%lO!=uR!BcWO#O!?X#O#P!?q#P#S!?X#S#T!@j#T;'S!?X;'S;=`!@o;=`<%l!=u<%lO!?XR!CSV${Q&wPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR!ClP;=`<%l!=uV!CvV!oU&wPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zV!DfY#}Q#lS&wPOY$zYZ%fZ!^$z!^!_%k!_!`6U!`#p$z#p#q!EU#q;'S$z;'S;=`&W<%lO$zR!E]V#{Q&wPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR!EyV!nQ&wPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR!FgV$^Q&wPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$z",tokenizers:[dy,my,fy,0,1,2,3,Oy],topRules:{Template:[0,72],Program:[1,232]},dynamicPrecedences:{284:1},specialized:[{term:81,get:(t,e)=>sy(t)<<1,external:sy},{term:81,get:t=>yy[t]||-1}],tokenPrec:29354}),vy=pl.define({name:"php",parser:$y.configure({props:[Al.add({IfStatement:Il({except:/^\s*({|else\b|elseif\b|endif\b)/}),TryStatement:Il({except:/^\s*({|catch\b|finally\b)/}),SwitchBody:t=>{let e=t.textAfter,n=/^\s*\}/.test(e),i=/^\s*(case|default)\b/.test(e);return t.baseIndent+(n?0:i?1:2)*t.unit},ColonBlock:t=>t.baseIndent+t.unit,"Block EnumBody DeclarationList":Wl({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"String BlockComment":()=>null,Statement:Il({except:/^({|end(for|foreach|switch|while)\b)/})}),Nl.add({"Block EnumBody DeclarationList SwitchBody ArrayExpression ValueList":Ul,ColonBlock:t=>({from:t.from+1,to:t.to}),BlockComment:t=>({from:t.from+2,to:t.to-2})})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"},line:"//"},indentOnInput:/^\s*(?:case |default:|end(?:if|for(?:each)?|switch|while)|else(?:if)?|\{|\})$/,wordChars:"$",closeBrackets:{stringPrefixes:["b","B"]}}});class by{static create(t,e,n,i,r){return new by(t,e,n,i+(i<<8)+t+(e<<4)|0,r,[],[])}constructor(t,e,n,i,r,o,s){this.type=t,this.value=e,this.from=n,this.hash=i,this.end=r,this.children=o,this.positions=s,this.hashProp=[[Ys.contextHash,i]]}addChild(t,e){t.prop(Ys.contextHash)!=this.hash&&(t=new ea(t.type,t.children,t.positions,t.length,this.hashProp)),this.children.push(t),this.positions.push(e)}toTree(t,e=this.end){let n=this.children.length-1;return n>=0&&(e=Math.max(e,this.positions[n]+this.children[n].length+this.from)),new ea(t.types[this.type],this.children,this.positions,e-this.from).balance({makeTree:(t,e,n)=>new ea(Fs.none,t,e,n,this.hashProp)})}}var Sy;!function(t){t[t.Document=1]="Document",t[t.CodeBlock=2]="CodeBlock",t[t.FencedCode=3]="FencedCode",t[t.Blockquote=4]="Blockquote",t[t.HorizontalRule=5]="HorizontalRule",t[t.BulletList=6]="BulletList",t[t.OrderedList=7]="OrderedList",t[t.ListItem=8]="ListItem",t[t.ATXHeading1=9]="ATXHeading1",t[t.ATXHeading2=10]="ATXHeading2",t[t.ATXHeading3=11]="ATXHeading3",t[t.ATXHeading4=12]="ATXHeading4",t[t.ATXHeading5=13]="ATXHeading5",t[t.ATXHeading6=14]="ATXHeading6",t[t.SetextHeading1=15]="SetextHeading1",t[t.SetextHeading2=16]="SetextHeading2",t[t.HTMLBlock=17]="HTMLBlock",t[t.LinkReference=18]="LinkReference",t[t.Paragraph=19]="Paragraph",t[t.CommentBlock=20]="CommentBlock",t[t.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",t[t.Escape=22]="Escape",t[t.Entity=23]="Entity",t[t.HardBreak=24]="HardBreak",t[t.Emphasis=25]="Emphasis",t[t.StrongEmphasis=26]="StrongEmphasis",t[t.Link=27]="Link",t[t.Image=28]="Image",t[t.InlineCode=29]="InlineCode",t[t.HTMLTag=30]="HTMLTag",t[t.Comment=31]="Comment",t[t.ProcessingInstruction=32]="ProcessingInstruction",t[t.Autolink=33]="Autolink",t[t.HeaderMark=34]="HeaderMark",t[t.QuoteMark=35]="QuoteMark",t[t.ListMark=36]="ListMark",t[t.LinkMark=37]="LinkMark",t[t.EmphasisMark=38]="EmphasisMark",t[t.CodeMark=39]="CodeMark",t[t.CodeText=40]="CodeText",t[t.CodeInfo=41]="CodeInfo",t[t.LinkTitle=42]="LinkTitle",t[t.LinkLabel=43]="LinkLabel",t[t.URL=44]="URL"}(Sy||(Sy={}));class wy{constructor(t,e){this.start=t,this.content=e,this.marks=[],this.parsers=[]}}class xy{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let t=this.skipSpace(this.basePos);this.indent=this.countIndent(t,this.pos,this.indent),this.pos=t,this.next=t==this.text.length?-1:this.text.charCodeAt(t)}skipSpace(t){return ky(this.text,t)}reset(t){for(this.text=t,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(t){this.basePos=t,this.baseIndent=this.countIndent(t,this.pos,this.indent)}moveBaseColumn(t){this.baseIndent=t,this.basePos=this.findColumn(t)}addMarker(t){this.markers.push(t)}countIndent(t,e=0,n=0){for(let i=e;i=e.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let i=(t.type==Sy.OrderedList?Zy:Ay)(n,e,!1);return i>0&&(t.type!=Sy.BulletList||Ry(n,e,!1)<0)&&n.text.charCodeAt(n.pos+i-1)==t.value}const Py={[Sy.Blockquote]:(t,e,n)=>62==n.next&&(n.markers.push(c$(Sy.QuoteMark,e.lineStart+n.pos,e.lineStart+n.pos+1)),n.moveBase(n.pos+(_y(n.text.charCodeAt(n.pos+1))?2:1)),t.end=e.lineStart+n.text.length,!0),[Sy.ListItem]:(t,e,n)=>!(n.indent-1||(n.moveBaseColumn(n.baseIndent+t.value),0)),[Sy.OrderedList]:Qy,[Sy.BulletList]:Qy,[Sy.Document]:()=>!0};function _y(t){return 32==t||9==t||10==t||13==t}function ky(t,e=0){for(;en&&_y(t.charCodeAt(e-1));)e--;return e}function Cy(t){if(96!=t.next&&126!=t.next)return-1;let e=t.pos+1;for(;e-1&&t.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf(Gy.SetextHeading)>-1||i<3?-1:1}function Ey(t,e){for(let n=t.stack.length-1;n>=0;n--)if(t.stack[n].type==e)return!0;return!1}function Ay(t,e,n){return 45!=t.next&&43!=t.next&&42!=t.next||t.pos!=t.text.length-1&&!_y(t.text.charCodeAt(t.pos+1))||!(!n||Ey(e,Sy.BulletList)||t.skipSpace(t.pos+2)=48&&r<=57;){if(i++,i==t.text.length)return-1;r=t.text.charCodeAt(i)}return i==t.pos||i>t.pos+9||46!=r&&41!=r||it.pos+1||49!=t.next)?-1:i+1-t.pos}function My(t){if(35!=t.next)return-1;let e=t.pos+1;for(;e6?-1:n}function Vy(t){if(45!=t.next&&61!=t.next||t.indent>=t.baseIndent+4)return-1;let e=t.pos+1;for(;e/,Wy=/\?>/,jy=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*/i.exec(i);if(o)return t.append(c$(Sy.Comment,n,n+1+o[0].length));let s=/^\?[^]*?\?>/.exec(i);if(s)return t.append(c$(Sy.ProcessingInstruction,n,n+1+s[0].length));let a=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(i);return a?t.append(c$(Sy.HTMLTag,n,n+1+a[0].length)):-1},Emphasis(t,e,n){if(95!=e&&42!=e)return-1;let i=n+1;for(;t.char(i)==e;)i++;let r=t.slice(n-1,n),o=t.slice(i,i+1),s=p$.test(r),a=p$.test(o),l=/\s|^$/.test(r),c=/\s|^$/.test(o),u=!c&&(!a||l||s),h=!l&&(!s||c||a),d=u&&(42==e||!h||s),O=h&&(42==e||!u||a);return t.append(new f$(95==e?u$:h$,n,i,(d?1:0)|(O?2:0)))},HardBreak(t,e,n){if(92==e&&10==t.char(n+1))return t.append(c$(Sy.HardBreak,n,n+2));if(32==e){let e=n+1;for(;32==t.char(e);)e++;if(10==t.char(e)&&e>=n+2)return t.append(c$(Sy.HardBreak,n,e+1))}return-1},Link:(t,e,n)=>91==e?t.append(new f$(d$,n,n+1,1)):-1,Image:(t,e,n)=>33==e&&91==t.char(n+1)?t.append(new f$(O$,n,n+2,1)):-1,LinkEnd(t,e,n){if(93!=e)return-1;for(let e=t.parts.length-1;e>=0;e--){let i=t.parts[e];if(i instanceof f$&&(i.type==d$||i.type==O$)){if(!i.side||t.skipSpace(i.to)==n&&!/[(\[]/.test(t.slice(n+1,n+2)))return t.parts[e]=null,-1;let r=t.takeContent(e),o=t.parts[e]=g$(t,r,i.type==d$?Sy.Link:Sy.Image,i.from,n+1);if(i.type==d$)for(let n=0;ne?c$(Sy.URL,e+n,r+n):r==t.length&&null}}function $$(t,e,n){let i=t.charCodeAt(e);if(39!=i&&34!=i&&40!=i)return!1;let r=40==i?41:i;for(let i=e+1,o=!1;i=this.end?-1:this.text.charCodeAt(t-this.offset)}get end(){return this.offset+this.text.length}slice(t,e){return this.text.slice(t-this.offset,e-this.offset)}append(t){return this.parts.push(t),t.to}addDelimiter(t,e,n,i,r){return this.append(new f$(t,e,n,(i?1:0)|(r?2:0)))}get hasOpenLink(){for(let t=this.parts.length-1;t>=0;t--){let e=this.parts[t];if(e instanceof f$&&(e.type==d$||e.type==O$))return!0}return!1}addElement(t){return this.append(t)}resolveMarkers(t){for(let e=t;e=t;s--){let t=this.parts[s];if(t instanceof f$&&1&t.side&&t.type==n.type&&!(r&&(1&n.side||2&t.side)&&(t.to-t.from+o)%3==0&&((t.to-t.from)%3||o%3))){i=t;break}}if(!i)continue;let a=n.type.resolve,l=[],c=i.from,u=n.to;if(r){let t=Math.min(2,i.to-i.from,o);c=i.to-t,u=n.from+t,a=1==t?"Emphasis":"StrongEmphasis"}i.type.mark&&l.push(this.elt(i.type.mark,c,i.to));for(let t=s+1;t=0;e--){let n=this.parts[e];if(n instanceof f$&&n.type==t)return e}return null}takeContent(t){let e=this.resolveMarkers(t);return this.parts.length=t,e}skipSpace(t){return ky(this.text,t-this.offset)+this.offset}elt(t,e,n,i){return"string"==typeof t?c$(this.parser.getNodeType(t),e,n,i):new l$(t,e)}}function S$(t,e){if(!e.length)return t;if(!t.length)return e;let n=t.slice(),i=0;for(let t of e){for(;i(t?t-1:0))return!1;if(this.fragmentEnd<0){let t=this.fragment.to;for(;t>0&&"\n"!=this.input.read(t-1,t);)t--;this.fragmentEnd=t?t-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let i=t+this.fragment.offset;for(;n.to<=i;)if(!n.parent())return!1;for(;;){if(n.from>=i)return this.fragment.from<=e;if(!n.childAfter(i))return!1}}matches(t){let e=this.cursor.tree;return e&&e.prop(Ys.contextHash)==t}takeNodes(t){let e=this.cursor,n=this.fragment.offset,i=this.fragmentEnd-(this.fragment.openEnd?1:0),r=t.absoluteLineStart,o=r,s=t.block.children.length,a=o,l=s;for(;;){if(e.to-n>i){if(e.type.isAnonymous&&e.firstChild())continue;break}let r=Q$(e.from-n,t.ranges);if(e.to-n<=t.ranges[t.rangeI].to)t.addNode(e.tree,r);else{let n=new ea(t.parser.nodeSet.types[Sy.Paragraph],[],[],0,t.block.hashProp);t.reusePlaceholders.set(n,e.tree),t.addNode(n,r)}if(e.type.is("Block")&&(w$.indexOf(e.type.id)<0?(o=e.to-n,s=t.block.children.length):(o=a,s=l,a=e.to-n,l=t.block.children.length)),!e.nextSibling())break}for(;t.block.children.length>s;)t.block.children.pop(),t.block.positions.pop();return o-r}}function Q$(t,e){let n=t;for(let i=1;iUy[t])),Object.keys(Uy).map((t=>Gy[t])),Object.keys(Uy),Fy,Py,Object.keys(m$).map((t=>m$[t])),Object.keys(m$),[]);function k$(t,e,n){let i=[];for(let r=t.firstChild,o=e;;r=r.nextSibling){let t=r?r.from:n;if(t>o&&i.push({from:o,to:t}),!r)break;o=r.to}return i}const T$={resolve:"Strikethrough",mark:"StrikethroughMark"},C$={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":ll.strikethrough}},{name:"StrikethroughMark",style:ll.processingInstruction}],parseInline:[{name:"Strikethrough",parse(t,e,n){if(126!=e||126!=t.char(n+1)||126==t.char(n+2))return-1;let i=t.slice(n-1,n),r=t.slice(n+2,n+3),o=/\s|^$/.test(i),s=/\s|^$/.test(r),a=p$.test(i),l=p$.test(r);return t.addDelimiter(T$,n,n+2,!s&&(!l||o||a),!o&&(!a||s||l))},after:"Emphasis"}]};function z$(t,e,n=0,i,r=0){let o=0,s=!0,a=-1,l=-1,c=!1,u=()=>{i.push(t.elt("TableCell",r+a,r+l,t.parser.parseInline(e.slice(a,l),r+a)))};for(let h=n;h-1)&&o++,s=!1,i&&(a>-1&&u(),i.push(t.elt("TableDelimiter",h+r,h+r+1))),a=l=-1),c=!c&&92==n}return a>-1&&(o++,i&&u()),o}function R$(t,e){for(let n=e;nR$(e.content,0)?new A$:null,endLeaf(t,e,n){if(n.parsers.some((t=>t instanceof A$))||!R$(e.text,e.basePos))return!1;let i=t.scanLine(t.absoluteLineEnd+1).text;return E$.test(i)&&z$(t,e.text,e.basePos)==z$(t,i,e.basePos)},before:"SetextHeading"}]};class M${nextLine(){return!1}finish(t,e){return t.addLeafElement(e,t.elt("Task",e.start,e.start+e.content.length,[t.elt("TaskMarker",e.start,e.start+3),...t.parser.parseInline(e.content.slice(3),e.start+3)])),!0}}const V$={defineNodes:[{name:"Task",block:!0,style:ll.list},{name:"TaskMarker",style:ll.atom}],parseBlock:[{name:"TaskList",leaf:(t,e)=>/^\[[ xX]\][ \t]/.test(e.content)&&"ListItem"==t.parentType().name?new M$:null,after:"SetextHeading"}]},X$=/(www\.)|(https?:\/\/)|([\w.+-]+@)|(mailto:|xmpp:)/gy,q$=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,W$=/[\w-]+\.[\w-]+($|\/)/,j$=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,I$=/\/[a-zA-Z\d@.]+/gy;function L$(t,e,n,i){let r=0;for(let o=e;o-1)return-1;let i=e+n[0].length;for(;;){let n,r=t[i-1];if(/[?!.,:*_~]/.test(r)||")"==r&&L$(t,e,i,")")>L$(t,e,i,"("))i--;else{if(";"!=r||!(n=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(t.slice(e,i))))break;i=e+n.index}}return i}(t.text,i+r[0].length),o>-1&&t.hasOpenLink&&(o=i+/([^\[\]]|\[[^\]]*\])*/.exec(t.text.slice(i,o))[0].length)):r[3]?o=N$(t.text,i):(o=N$(t.text,i+r[0].length),o>-1&&"xmpp:"==r[0]&&(I$.lastIndex=o,r=I$.exec(t.text),r&&(o=r.index+r[0].length))),o<0?-1:(t.addElement(t.elt("URL",n,o+t.offset)),o+t.offset)):-1}}]}];function D$(t,e,n){return(i,r,o)=>{if(r!=t||i.char(o+1)==t)return-1;let s=[i.elt(n,o,o+1)];for(let r=o+1;r!t.is("Block")||t.is("Document")||null!=J$(t)||function(t){return"OrderedList"==t.name||"BulletList"==t.name}(t)?void 0:(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to}))),H$.add(J$),Al.add({Document:()=>null}),ul.add({Document:F$})]});function J$(t){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(t.name);return e?+e[1]:void 0}function tv(t,e){let n=t;for(;;){let t,i=n.nextSibling;if(!i||null!=(t=J$(i.type))&&t<=e)break;n=i}return n.to}const ev=Ll.of(((t,e,n)=>{for(let i=ml(t).resolveInner(n,-1);i&&!(i.fromn)return{from:n,to:e}}return null}));function nv(t){return new Ol(F$,t,[ev],"markdown")}const iv=nv(K$),rv=nv(K$.configure([U$,B$,Y$,G$,{props:[Nl.add({Table:(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}]));class ov{constructor(t,e,n,i,r,o,s){this.node=t,this.from=e,this.to=n,this.spaceBefore=i,this.spaceAfter=r,this.type=o,this.item=s}blank(t,e=!0){let n=this.spaceBefore+("Blockquote"==this.node.name?">":"");if(null!=t){for(;n.length0;t--)n+=" ";return n+(e?this.spaceAfter:"")}marker(t,e){let n="OrderedList"==this.node.name?String(+av(this.item,t)[2]+e):"";return this.spaceBefore+n+this.type+this.spaceAfter}}function sv(t,e){let n=[];for(let e=t;e&&"Document"!=e.name;e=e.parent)"ListItem"!=e.name&&"Blockquote"!=e.name&&"FencedCode"!=e.name||n.push(e);let i=[];for(let t=n.length-1;t>=0;t--){let r,o=n[t],s=e.lineAt(o.from),a=o.from-s.from;if("FencedCode"==o.name)i.push(new ov(o,a,a,"","","",null));else if("Blockquote"==o.name&&(r=/^ *>( ?)/.exec(s.text.slice(a))))i.push(new ov(o,a,a+r[0].length,"",r[1],">",null));else if("ListItem"==o.name&&"OrderedList"==o.parent.name&&(r=/^( *)\d+([.)])( *)/.exec(s.text.slice(a)))){let t=r[3],e=r[0].length;t.length>=4&&(t=t.slice(0,t.length-4),e-=4),i.push(new ov(o.parent,a,a+e,r[1],t,r[2],o))}else if("ListItem"==o.name&&"BulletList"==o.parent.name&&(r=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(s.text.slice(a)))){let t=r[4],e=r[0].length;t.length>4&&(t=t.slice(0,t.length-4),e-=4);let n=r[2];r[3]&&(n+=r[3].replace(/[xX]/," ")),i.push(new ov(o.parent,a,a+e,r[1],t,n,o))}}return i}function av(t,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(t.from,t.from+10))}function lv(t,e,n,i=0){for(let r=-1,o=t;;){if("ListItem"==o.name){let t=av(o,e),s=+t[2];if(r>=0){if(s!=r+1)return;n.push({from:o.from+t[1].length,to:o.from+t[0].length,insert:String(r+2+i)})}r=s}let t=o.nextSibling;if(!t)break;o=t}}function cv(t,e){let n=/^[ \t]*/.exec(t)[0].length;if(!n||"\t"!=e.facet(Tl))return t;let i="";for(let e=Nt(t,4,n);e>0;)e>=4?(i+="\t",e-=4):(i+=" ",e--);return i+t.slice(n)}function uv(t){return"QuoteMark"==t.name||"ListMark"==t.name}function hv(t,e,n){let i="";for(let e=0,r=t.length-2;e<=r;e++)i+=t[e].blank(e{let n=ml(t),{doc:i}=t,r=null,o=t.changeByRange((e=>{if(!e.empty||!rv.isActiveAt(t,e.from))return r={range:e};let o=e.from,s=i.lineAt(o),a=sv(n.resolveInner(o,-1),i);for(;a.length&&a[a.length-1].from>o-s.from;)a.pop();if(!a.length)return r={range:e};let l=a[a.length-1];if(l.to-l.spaceAfter.length>o-s.from)return r={range:e};let c=o>=l.to-l.spaceAfter.length&&!/\S/.test(s.text.slice(l.to));if(l.item&&c){let e=l.node.firstChild,n=l.node.getChild("ListItem","ListItem");if(e.to>=o||n&&n.to0&&!/[^\s>]/.test(i.lineAt(s.from-1).text)){let t,e=a.length>1?a[a.length-2]:null,n="";e&&e.item?(t=s.from+e.from,n=e.marker(i,1)):t=s.from+(e?e.to:0);let r=[{from:t,to:o,insert:n}];return"OrderedList"==l.node.name&&lv(l.item,i,r,-2),e&&"OrderedList"==e.node.name&&lv(e.item,i,r),{range:W.cursor(t+n.length),changes:r}}{let e=hv(a,t,s);return{range:W.cursor(o+e.length+1),changes:{from:s.from,insert:e+t.lineBreak}}}}if("Blockquote"==l.node.name&&c&&s.from){let n=i.lineAt(s.from-1),r=/>\s*$/.exec(n.text);if(r&&r.index==l.from){let i=t.changes([{from:n.from+r.index,to:n.to},{from:s.from+l.from,to:s.to}]);return{range:e.map(i),changes:i}}}let u=[];"OrderedList"==l.node.name&&lv(l.item,i,u);let h=l.item&&l.item.from]*/.exec(s.text)[0].length>=l.to)for(let t=0,e=a.length-1;t<=e;t++)d+=t!=e||h?a[t].blank(ts.from&&/\s/.test(s.text.charAt(O-s.from-1));)O--;return d=cv(d,t),function(t,e){if("OrderedList"!=t.name&&"BulletList"!=t.name)return!1;let n=t.firstChild,i=t.getChild("ListItem","ListItem");if(!i)return!1;let r=e.lineAt(n.to),o=e.lineAt(i.from),s=/^[\s>]*$/.test(r.text);return r.number+(s?0:1){let n=ml(t),i=null,r=t.changeByRange((e=>{let r=e.from,{doc:o}=t;if(e.empty&&rv.isActiveAt(t,e.from)){let e=o.lineAt(r),i=sv(function(t,e){let n=t.resolveInner(e,-1),i=e;uv(n)&&(i=n.from,n=n.parent);for(let t;t=n.childBefore(i);)if(uv(t))i=t.from;else{if("OrderedList"!=t.name&&"BulletList"!=t.name)break;n=t.lastChild,i=n.to}return n}(n,r),o);if(i.length){let n=i[i.length-1],o=n.to-n.spaceAfter.length+(n.spaceAfter?1:0);if(r-e.from>o&&!/\S/.test(e.text.slice(o,r-e.from)))return{range:W.cursor(e.from+o),changes:{from:e.from+o,to:r}};if(r-e.from==o&&(!n.item||e.from<=n.item.from||!/\S/.test(e.text.slice(0,n.to)))){let i=e.from+n.from;if(n.item&&n.node.from=65&&t<=90||95==t||t>=97&&t<=122||t>=161}let yv=null,$v=null,vv=0;function bv(t,e){let n=t.pos+e;if($v==t&&vv==n)return yv;for(;9==(i=t.peek(e))||10==i||13==i||32==i;)e++;var i;let r="";for(;;){let n=t.peek(e);if(!gv(n))break;r+=String.fromCharCode(n),e++}return $v=t,vv=n,yv=r||null}function Sv(t,e){this.name=t,this.parent=e,this.hash=e?e.hash:0;for(let e=0;e1==e?new Sv(bv(i,1)||"",t):t,reduce:(t,e)=>11==e&&t?t.parent:t,reuse(t,e,n,i){let r=e.type.id;return 1==r||13==r?new Sv(bv(i,1)||"",t):t},hash:t=>t?t.hash:0,strict:!1}),xv=new Uf(((t,e)=>{if(60==t.next)if(t.advance(),47==t.next){t.advance();let n=bv(t,0);if(!n)return t.acceptToken(5);if(e.context&&n==e.context.name)return t.acceptToken(2);for(let i=e.context;i;i=i.parent)if(i.name==n)return t.acceptToken(3,-2);t.acceptToken(4)}else if(33!=t.next&&63!=t.next)return t.acceptToken(1)}),{contextual:!0});function Qv(t,e){return new Uf((n=>{let i=0,r=e.charCodeAt(0);t:for(;!(n.next<0);n.advance(),i++)if(n.next==r){for(let t=1;t"),kv=Qv(37,"]]>"),Tv=ja({Text:ll.content,"StartTag StartCloseTag EndTag SelfCloseEndTag":ll.angleBracket,TagName:ll.tagName,"MismatchedCloseTag/TagName":[ll.tagName,ll.invalid],AttributeName:ll.attributeName,AttributeValue:ll.attributeValue,Is:ll.definitionOperator,"EntityReference CharacterReference":ll.character,Comment:ll.blockComment,ProcessingInst:ll.processingInstruction,DoctypeDecl:ll.documentMeta,Cdata:ll.special(ll.string)}),Cv=op.deserialize({version:14,states:",SOQOaOOOrOxO'#CfOzOpO'#CiO!tOaO'#CgOOOP'#Cg'#CgO!{OrO'#CrO#TOtO'#CsO#]OpO'#CtOOOP'#DS'#DSOOOP'#Cv'#CvQQOaOOOOOW'#Cw'#CwO#eOxO,59QOOOP,59Q,59QOOOO'#Cx'#CxO#mOpO,59TO#uO!bO,59TOOOP'#C{'#C{O$TOaO,59RO$[OpO'#CoOOOP,59R,59ROOOQ'#C|'#C|O$dOrO,59^OOOP,59^,59^OOOS'#C}'#C}O$lOtO,59_OOOP,59_,59_O$tOpO,59`O$|OpO,59`OOOP-E6t-E6tOOOW-E6u-E6uOOOP1G.l1G.lOOOO-E6v-E6vO%UO!bO1G.oO%UO!bO1G.oO%dOpO'#CkO%lO!bO'#CyO%zO!bO1G.oOOOP1G.o1G.oOOOP1G.w1G.wOOOP-E6y-E6yOOOP1G.m1G.mO&VOpO,59ZO&_OpO,59ZOOOQ-E6z-E6zOOOP1G.x1G.xOOOS-E6{-E6{OOOP1G.y1G.yO&gOpO1G.zO&gOpO1G.zOOOP1G.z1G.zO&oO!bO7+$ZO&}O!bO7+$ZOOOP7+$Z7+$ZOOOP7+$c7+$cO'YOpO,59VO'bOpO,59VO'jO!bO,59eOOOO-E6w-E6wO'xOpO1G.uO'xOpO1G.uOOOP1G.u1G.uO(QOpO7+$fOOOP7+$f7+$fO(YO!bO<d!d;'S%y;'S;=`&_<%lO%yX>iV{WOr%ysv%yw!}%y!}#O?O#O;'S%y;'S;=`&_<%lO%yX?VT{WxPOr%ysv%yw;'S%y;'S;=`&_<%lO%yX?kV{WOr%ysv%yw#W%y#W#X@Q#X;'S%y;'S;=`&_<%lO%yX@VV{WOr%ysv%yw#T%y#T#U@l#U;'S%y;'S;=`&_<%lO%yX@qV{WOr%ysv%yw#h%y#h#iAW#i;'S%y;'S;=`&_<%lO%yXA]V{WOr%ysv%yw#T%y#T#U>d#U;'S%y;'S;=`&_<%lO%yXAwV{WOr%ysv%yw#c%y#c#dB^#d;'S%y;'S;=`&_<%lO%yXBcV{WOr%ysv%yw#V%y#V#WBx#W;'S%y;'S;=`&_<%lO%yXB}V{WOr%ysv%yw#h%y#h#iCd#i;'S%y;'S;=`&_<%lO%yXCiV{WOr%ysv%yw#m%y#m#nDO#n;'S%y;'S;=`&_<%lO%yXDTV{WOr%ysv%yw#d%y#d#eDj#e;'S%y;'S;=`&_<%lO%yXDoV{WOr%ysv%yw#X%y#X#Y9i#Y;'S%y;'S;=`&_<%lO%yXE]T!PP{WOr%ysv%yw;'S%y;'S;=`&_<%lO%yZEuWaQVP{WOr$nrs%_sv$nw!^$n!^!_%y!_;'S$n;'S;=`&e<%lO$n_FhW[UVP{WOr$nrs%_sv$nw!^$n!^!_%y!_;'S$n;'S;=`&e<%lO$nZGXYVP{WOr$nrs%_sv$nw!^$n!^!_%y!_!`$n!`!aGw!a;'S$n;'S;=`&e<%lO$nZHQW!OQVP{WOr$nrs%_sv$nw!^$n!^!_%y!_;'S$n;'S;=`&e<%lO$nZHqYVP{WOr$nrs%_sv$nw!^$n!^!_%y!_#P$n#P#QIa#Q;'S$n;'S;=`&e<%lO$nZIhYVP{WOr$nrs%_sv$nw!^$n!^!_%y!_!`$n!`!aJW!a;'S$n;'S;=`&e<%lO$nZJaWwQVP{WOr$nrs%_sv$nw!^$n!^!_%y!_;'S$n;'S;=`&e<%lO$n",tokenizers:[xv,Pv,_v,kv,0,1,2,3],topRules:{Document:[0,6]},tokenPrec:0});function zv(t,e){let n=e&&e.getChild("TagName");return n?t.sliceString(n.from,n.to):""}function Rv(t,e){let n=e&&e.firstChild;return n&&"OpenTag"==n.name?zv(t,n):""}function Ev(t){for(let e=t&&t.parent;e;e=e.parent)if("Element"==e.name)return e;return null}class Av{constructor(t,e,n){this.attrs=e,this.attrValues=n,this.children=[],this.name=t.name,this.completion=Object.assign(Object.assign({type:"type"},t.completion||{}),{label:this.name}),this.openCompletion=Object.assign(Object.assign({},this.completion),{label:"<"+this.name}),this.closeCompletion=Object.assign(Object.assign({},this.completion),{label:"",boost:2}),this.closeNameCompletion=Object.assign(Object.assign({},this.completion),{label:this.name+">"}),this.text=t.textContent?t.textContent.map((t=>({label:t,type:"text"}))):[]}}const Zv=/^[:\-\.\w\u00b7-\uffff]*$/;function Mv(t){return Object.assign(Object.assign({type:"property"},t.completion||{}),{label:t.name})}function Vv(t){return"string"==typeof t?{label:`"${t}"`,type:"constant"}:/^"/.test(t.label)?t:Object.assign(Object.assign({},t),{label:`"${t.label}"`})}function Xv(t,e){let n=[],i=[],r=Object.create(null);for(let t of e){let e=Mv(t);n.push(e),t.global&&i.push(e),t.values&&(r[t.name]=t.values.map(Vv))}let o=[],s=[],a=Object.create(null);for(let e of t){let t=i,l=r;e.attributes&&(t=t.concat(e.attributes.map((t=>"string"==typeof t?n.find((e=>e.label==t))||{label:t,type:"property"}:(t.values&&(l==r&&(l=Object.create(l)),l[t.name]=t.values.map(Vv)),Mv(t))))));let c=new Av(e,t,l);a[c.name]=c,o.push(c),e.top&&s.push(c)}s.length||(s=o);for(let e=0;e{var e;let{doc:n}=t.state,l=function(t,e){var n;let i=ml(t).resolveInner(e,-1),r=null;for(let t=i;!r&&t.parent;t=t.parent)"OpenTag"!=t.name&&"CloseTag"!=t.name&&"SelfClosingTag"!=t.name&&"MismatchedCloseTag"!=t.name||(r=t);if(r&&(r.to>e||r.lastChild.type.isError)){let t=r.parent;if("TagName"==i.name)return"CloseTag"==r.name||"MismatchedCloseTag"==r.name?{type:"closeTag",from:i.from,context:t}:{type:"openTag",from:i.from,context:Ev(t)};if("AttributeName"==i.name)return{type:"attrName",from:i.from,context:r};if("AttributeValue"==i.name)return{type:"attrValue",from:i.from,context:r};let n=i==r||"Attribute"==i.name?i.childBefore(e):i;return"StartTag"==(null==n?void 0:n.name)?{type:"openTag",from:e,context:Ev(t)}:"StartCloseTag"==(null==n?void 0:n.name)&&n.to<=e?{type:"closeTag",from:e,context:t}:"Is"==(null==n?void 0:n.name)?{type:"attrValue",from:e,context:r}:n?{type:"attrName",from:e,context:r}:null}if("StartCloseTag"==i.name)return{type:"closeTag",from:e,context:i.parent};for(;i.parent&&i.to==e&&!(null===(n=i.lastChild)||void 0===n?void 0:n.type.isError);)i=i.parent;return"Element"==i.name||"Text"==i.name||"Document"==i.name?{type:"tag",from:e,context:"Element"==i.name?i:Ev(i)}:null}(t.state,t.pos);if(!l||"tag"==l.type&&!t.explicit)return null;let{type:c,from:u,context:h}=l;if("openTag"==c){let t=s,e=Rv(n,h);if(e){let n=a[e];t=(null==n?void 0:n.children)||o}return{from:u,options:t.map((t=>t.completion)),validFor:Zv}}if("closeTag"==c){let i=Rv(n,h);return i?{from:u,to:t.pos+(">"==n.sliceString(t.pos,t.pos+1)?1:0),options:[(null===(e=a[i])||void 0===e?void 0:e.closeNameCompletion)||{label:i+">",type:"type"}],validFor:Zv}:null}if("attrName"==c){let t=a[zv(n,h)];return{from:u,options:(null==t?void 0:t.attrs)||i,validFor:Zv}}if("attrValue"==c){let e=function(t,e,n){let i=e&&e.getChildren("Attribute").find((t=>t.from<=n&&t.to>=n)),r=i&&i.getChild("AttributeName");return r?t.sliceString(r.from,r.to):""}(n,h,u);if(!e)return null;let i=a[zv(n,h)],o=((null==i?void 0:i.attrValues)||r)[e];return o&&o.length?{from:u,to:t.pos+('"'==n.sliceString(t.pos,t.pos+1)?1:0),options:o,validFor:/^"[^"]*"?$/}:null}if("tag"==c){let e=Rv(n,h),i=a[e],r=[],l=h&&h.lastChild;!e||l&&"CloseTag"==l.name&&zv(n,l)==e||r.push(i?i.closeCompletion:{label:"",type:"type",boost:2});let c=r.concat(((null==i?void 0:i.children)||(h?o:s)).map((t=>t.openCompletion)));if(h&&(null==i?void 0:i.text.length)){let e=h.firstChild;e.to>t.pos-20&&!/\S/.test(t.state.sliceDoc(e.to,t.pos))&&(c=c.concat(i.text))}return{from:u,options:c,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}return null}}const qv=pl.define({name:"xml",parser:Cv.configure({props:[Al.add({Element(t){let e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},"OpenTag CloseTag SelfClosingTag":t=>t.column(t.node.from)+t.unit}),Nl.add({Element(t){let e=t.firstChild,n=t.lastChild;return e&&"OpenTag"==e.name?{from:e.to,to:"CloseTag"==n.name?n.from:t.to}:null}}),Tc.add({"OpenTag CloseTag":t=>t.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"\x3c!--",close:"--\x3e"}},indentOnInput:/^\s*<\/$/}});function Wv(t,e,n=t.length){if(!e)return"";let i=e.firstChild,r=i&&i.getChild("TagName");return r?t.sliceString(r.from,Math.min(r.to,n)):""}const jv=no.inputHandler.of(((t,e,n,i,r)=>{if(t.composing||t.state.readOnly||e!=n||">"!=i&&"/"!=i||!qv.isActiveAt(t.state,e,-1))return!1;let o=r(),{state:s}=o,a=s.changeByRange((t=>{var e,n,r;let o,{head:a}=t,l=s.doc.sliceString(a-1,a)==i,c=ml(s).resolveInner(a,-1);if(l&&">"==i&&"EndTag"==c.name){let i=c.parent;if("CloseTag"!=(null===(n=null===(e=i.parent)||void 0===e?void 0:e.lastChild)||void 0===n?void 0:n.name)&&(o=Wv(s.doc,i.parent,a)))return{range:t,changes:{from:a,to:a+(">"===s.doc.sliceString(a,a+1)?1:0),insert:``}}}else if(l&&"/"==i&&"StartCloseTag"==c.name){let t=c.parent;if(c.from==a-2&&"CloseTag"!=(null===(r=t.lastChild)||void 0===r?void 0:r.name)&&(o=Wv(s.doc,t,a))){let t=a+(">"===s.doc.sliceString(a,a+1)?1:0),e=`${o}>`;return{range:W.cursor(a+e.length,-1),changes:{from:a,to:t,insert:e}}}}return{range:t}}));return!a.changes.empty&&(t.dispatch([o,s.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)})),Iv=ja({String:ll.string,Number:ll.number,"True False":ll.bool,PropertyName:ll.propertyName,Null:ll.null,",":ll.separator,"[ ]":ll.squareBracket,"{ }":ll.brace}),Lv=op.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[Iv],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zOh~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yOg~~'OO]~~'TO[~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),Nv=pl.define({name:"json",parser:Lv.configure({props:[Al.add({Object:Il({except:/^\s*\}/}),Array:Il({except:/^\s*\]/})}),Nl.add({"Object Array":Ul})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});var Uv=n(1014),Dv=n(386);function Yv({id:t,value:e="",onChange:n,language:s="html",height:a=200,theme:l="dark",attributes:c={},className:u,disabled:h=!1,setTitle:d}){(0,Dv.Us)(d,e?String(e).substring(0,50):"");const O=[no.lineWrapping],f=function(t){switch(t){case"javascript":case"js":return Wp();case"html":return wg();case"css":return Km();case"sql":return function(t={}){let e=t.dialect||ry;return new Pl(e.language,[iy(t),e.language.data.of({autocomplete:ey(e,t.upperCaseKeywords,t.keywordCompletion)})])}();case"php":return function(t={}){let e,n=[];if(null===t.baseLanguage);else if(t.baseLanguage)e=t.baseLanguage;else{let t=wg({matchClosingTags:!1});n.push(t.support),e=t.language}return new Pl(vy.configure({wrap:e&&wa((t=>t.type.isTop?{parser:e.parser,overlay:t=>"Text"==t.name}:null)),top:t.plain?"Program":"Template"}),n)}();case"markdown":case"md":return function(t={}){let{codeLanguages:e,defaultCodeLanguage:n,addKeymap:i=!0,base:{parser:r}=iv,completeHTMLTags:o=!0,htmlTagLanguage:s=Ov}=t;if(!(r instanceof t$))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let a,l=t.extensions?[t.extensions]:[],c=[s.support];n instanceof Pl?(c.push(n.support),a=n.language):n&&(a=n);let u=e||a?(h=e,d=a,t=>{if(t&&h){let e=null;if(t=/\S*/.exec(t)[0],e="function"==typeof h?h(t):_l.matchLanguageName(h,t,!0),e instanceof _l)return e.support?e.support.language.parser:$l.getSkippingParser(e.load());if(e)return e.parser}return d?d.parser:null}):void 0;var h,d;l.push(function(t){let{codeParser:e,htmlParser:n}=t,i=wa(((t,i)=>{let r=t.type.id;if(!e||r!=Sy.CodeBlock&&r!=Sy.FencedCode){if(n&&(r==Sy.HTMLBlock||r==Sy.HTMLTag))return{parser:n,overlay:k$(t.node,t.from,t.to)}}else{let n="";if(r==Sy.FencedCode){let e=t.node.getChild(Sy.CodeInfo);e&&(n=i.read(e.from,e.to))}let o=e(n);if(o)return{parser:o,overlay:t=>t.type.id==Sy.CodeText}}return null}));return{wrap:i}}({codeParser:u,htmlParser:s.language.parser})),i&&c.push(K.high(uo.of(dv)));let O=nv(r.configure(l));return o&&c.push(O.data.of({autocomplete:fv})),new Pl(O,c)}();case"xml":return function(t={}){let e=[qv.data.of({autocomplete:Xv(t.elements||[],t.attributes||[])})];return!1!==t.autoCloseTags&&e.push(jv),new Pl(qv,e)}();case"json":return new Pl(Nv);default:return null}}(s);return f&&O.push(f),(0,i.createElement)(o.tH,{fallback:(0,i.createElement)("textarea",{className:(0,r.A)("wpifycf-field-code","wpifycf-field-code--fallback",`wpifycf-field-code--${t}`,c.class,u),value:e,onChange:t=>n(t.target.value),style:{width:"100%",height:a+"px"},disabled:h})},(0,i.createElement)(kf,{className:(0,r.A)("wpifycf-field-code",`wpifycf-field-code--${t}`,c.class),value:e,onChange:n,height:a+"px",theme:"dark"===l?Af:void 0,extensions:O,editable:!h}))}Yv.checkValidity=Uv.e6;const Bv=Yv},8542:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>l});var i=n(1609),r=n(4164),o=(n(2619),n(1014)),s=n(386);function a({id:t,htmlId:e,onChange:n,value:o="",attributes:a={},disabled:l=!1,className:c,setTitle:u}){(0,s.Us)(u,o);const h=(0,i.useCallback)((t=>n(t.target.value)),[n]);return(0,i.createElement)("input",{type:"color",id:e,onChange:h,value:o,className:(0,r.A)("wpifycf-field-color",`wpifycf-field-color--${t}`,a.class,c),disabled:l,...a})}a.checkValidity=o.e6;const l=a},3537:(t,e,n)=>{"use strict";n.r(e),n.d(e,{Date:()=>a,default:()=>l});var i=n(1609),r=n(4164),o=(n(2619),n(1014)),s=n(386);function a({id:t,htmlId:e,onChange:n,value:o,attributes:a={},min:l,max:c,disabled:u=!1,className:h,setTitle:d}){(0,s.Us)(d,o);const O=(0,i.useCallback)((t=>n(t.target.value)),[n]);return(0,i.createElement)("input",{type:"date",id:e,onChange:O,value:o,className:(0,r.A)("wpifycf-field-date",`wpifycf-field-date--${t}`,a.class,h),min:l,max:c,disabled:u,...a})}a.checkValidity=o.wZ;const l=a},6328:(t,e,n)=>{"use strict";n.r(e),n.d(e,{DateRange:()=>a,default:()=>l});var i=n(1609),r=n(4164),o=n(1014),s=n(386);function a({id:t,htmlId:e,onChange:n,value:o,attributes:a={},min:l,max:c,disabled:u=!1,className:h,setTitle:d}){const O=Array.isArray(o)?o:[null,null],f=O[0]||"",p=O[1]||"";(0,s.Us)(d,[f,p].filter(Boolean).join(" — "));const m=p&&c?pl?f:l:f||l,y=(0,i.useCallback)((t=>{const e=t.target.value||null,i=O[1]||null;n(e||i?[e,i]:null)}),[n,O]),$=(0,i.useCallback)((t=>{const e=O[0]||null,i=t.target.value||null;n(e||i?[e,i]:null)}),[n,O]);return(0,i.createElement)("div",{className:(0,r.A)("wpifycf-field-date-range",`wpifycf-field-date-range--${t}`,a.class,h)},(0,i.createElement)("input",{type:"date",id:`${e}-start`,onChange:y,value:f,className:"wpifycf-field-date-range__start",min:l,max:m,disabled:u,...a}),(0,i.createElement)("span",null,"—"),(0,i.createElement)("input",{type:"date",id:`${e}-end`,onChange:$,value:p,className:"wpifycf-field-date-range__end",min:g,max:c,disabled:u,...a}))}a.checkValidity=o.u9;const l=a},8068:(t,e,n)=>{"use strict";n.r(e),n.d(e,{Datetime:()=>a,default:()=>l});var i=n(1609),r=n(4164),o=(n(2619),n(1014)),s=n(386);function a({id:t,htmlId:e,onChange:n,value:o="",min:a,max:l,attributes:c={},disabled:u=!1,className:h,setTitle:d}){(0,s.Us)(d,o);const O=(0,i.useCallback)((t=>n(t.target.value)),[n]);return(0,i.createElement)("input",{type:"datetime-local",id:e,onChange:O,value:o,min:a,max:l,className:(0,r.A)("wpifycf-field-datetime",`wpifycf-field-datetime--${t}`,c.class,h),disabled:u,...c})}a.checkValidity=o.wZ;const l=a},4977:(t,e,n)=>{"use strict";n.r(e),n.d(e,{Email:()=>a,default:()=>l});var i=n(1609),r=n(4164),o=(n(2619),n(1014)),s=n(386);function a({id:t,htmlId:e,onChange:n,value:o="",attributes:a={},disabled:l=!1,className:c,setTitle:u}){(0,s.Us)(u,o);const h=(0,i.useCallback)((function(t){"function"==typeof n&&n(t.target.value)}),[n]);return(0,i.createElement)("input",{type:"email",id:e,onChange:h,value:o,className:(0,r.A)("wpifycf-field-email",`wpifycf-field-email--${t}`,a.class,c),disabled:l,...a})}a.checkValidity=o.Bd;const l=a},4958:(t,e,n)=>{"use strict";n.r(e),n.d(e,{Group:()=>l,default:()=>c});var i=n(1609),r=n(4164),o=n(5587),s=n(1014),a=n(5103);function l({id:t,htmlId:e,value:n={},onChange:s,items:l,attributes:c={},validity:u=[],className:h,fieldPath:d,disabled:O=!1,setTitle:f}){const p=u?.reduce(((t,e)=>"object"==typeof e?{...t,...e}:t),{}),m=(0,i.useMemo)((()=>(0,a.of)(l)),[l]),[g,y]=(0,i.useState)({}),$=(0,i.useCallback)((t=>e=>{const n=(0,a.QZ)(e);y((e=>e[t]===n?e:{...e,[t]:n}))}),[]),v=(0,i.useMemo)((()=>{for(const t of m){const e=g[t.id];if(e)return String(e);const i=n?.[t.id];if(null!=i&&""!==i&&("string"==typeof i||"number"==typeof i))return String(i)}return""}),[g,m,n]);(0,i.useEffect)((()=>{"function"==typeof f&&f(v)}),[v,f]);const b=(0,i.useCallback)((t=>e=>s({...n,[t]:e})),[n,s]);return(0,i.createElement)("div",{className:(0,r.A)("wpifycf-field-group",`wpifycf-field-group--${t}`,c.class,h)},l.map((t=>(0,i.createElement)(o.D,{key:t.id,disabled:O,...t,value:n[t.id]||"",onChange:b(t.id),parentValue:n,parentOnChange:s,htmlId:`${e}.${t.id}`,validity:p[t.id],fieldPath:`${d}.${t.id}`,setTitle:$(t.id),setTitleFactory:$}))))}l.descriptionPosition="before",l.checkValidity=s.gX;const c=l},3125:(t,e,n)=>{"use strict";n.r(e),n.d(e,{Hidden:()=>o,default:()=>s});var i=n(1609),r=n(4164);function o({id:t,htmlId:e,onChange:n,value:o="",attributes:s={},className:a}){const l=(0,i.useCallback)((t=>n(t.target.value)),[n]);return(0,i.createElement)("input",{type:"hidden",id:e,onChange:l,value:o,className:(0,r.A)("wpifycf-field-hidden",`wpifycf-field-hidden--${t}`,s.class,a),...s})}n(2619);const s=o},7692:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>a});var i=n(1609),r=n(7665),o=n(4164);function s({attributes:t={},id:e,className:n,content:s}){return(0,i.createElement)(r.tH,{fallback:(0,i.createElement)("div",null,"Failed to render HTML field")},(0,i.createElement)("div",{className:(0,o.A)("wpifycf-field-html",`wpifycf-field-html--${e}`,t.class,n),...t,dangerouslySetInnerHTML:{__html:s}}))}n(2619),s.renderOptions={noLabel:!0};const a=s},75:(t,e,n)=>{"use strict";n.r(e),n.d(e,{InnerBlocks:()=>s,default:()=>a});var i=n(1609),r=n(4715),o=n(4164);function s({id:t,className:e,allowed_blocks:n,template:s,template_lock:a,orientation:l}){return(0,i.createElement)("div",{className:(0,o.A)("wpifycf-field-inner-blocks",`wpifycf-field-inner-blocks--${t}`,e)},(0,i.createElement)(r.InnerBlocks,{allowedBlocks:n,template:s,orientation:l,templateLock:a}))}const a=s},8213:(t,e,n)=>{"use strict";n.r(e),n.d(e,{Link:()=>u,default:()=>O});var i=n(1609),r=(n(2619),n(7723)),o=n(5103),s=n(386),a=n(5028),l=n(4164),c=n(1014);function u({id:t,htmlId:e,value:n={},onChange:c,post_type:u,className:O,disabled:f=!1,setTitle:p}){const[m,g]=(0,i.useState)(null),y=(0,s.P6)(u),$={target:null,post:null,post_type:null,label:null,url:null},v=(0,i.useCallback)((t=>{const e=[];return t.label&&e.push((0,o.QZ)(t.label)),t.url&&e.push(`(${t.url})`),e.join(" ")}),[]),b=(0,i.useCallback)((t=>{if(void 0!==t&&t?.id!==n.post){const e={...$,...n,post:t?.id,label:t?.title,url:t?.permalink};c(e),p(v(e))}}),[c,p,n]),S=(0,i.useCallback)((t=>{const e={...$,...n,url:t.target.value};c(e),p(v(e))}),[c,p,n]),w=(0,i.useCallback)((t=>{c({...$,...n,target:t.target.checked?"_blank":null})}),[c,n]),x=(0,i.useCallback)((t=>{const e={...$,...n,label:t.target.value};c(e),p(v(e))}),[c,n]),Q=(0,i.useCallback)((t=>{const e={...$,...n,post_type:t.target.value,post:null,url:null,label:null};c(e),p(v(e))}),[c,n]),P=(0,i.useCallback)((t=>{const e=(0,o.l2)(t.target.value);if(g(e),n?.url!==e){const t={...$,...n,url:e};c(t),p(v(t))}}),[c,n]),_=(0,s.LD)(m);return(0,i.useEffect)((()=>{if(m&&_.data&&!n.label){const t={...$,...n,label:_.data};c(t),g(null),p(v(t))}}),[_,c,n.label,m]),(0,i.useEffect)((()=>{p(n?.label)}),[p,n?.label]),(0,i.createElement)("div",{className:(0,l.A)("wpifycf-field-link",`wpifycf-field-link--${t}`,O)},(0,i.createElement)("div",{className:"wpifycf-field-link__fields"},(0,i.createElement)("div",{className:"wpifycf-field-link__field-label"},y.length>0?(0,i.createElement)(h,{value:n,postTypes:y,onChange:Q,disabled:f}):(0,i.createElement)("label",{htmlFor:e+".url"},(0,r.__)("URL","wpify-custom-fields"))),(0,i.createElement)("div",{className:"wpifycf-field-link__field-input"},n.post_type&&(0,i.createElement)(a.l,{postType:n.post_type,value:n.post,onSelect:b,disabled:f}),(0,i.createElement)(d,{value:n,htmlId:e,onUrlChange:S,onBlur:P,onTargetChange:w,disabled:f})),(0,i.createElement)("div",{className:"wpifycf-field-link__field-label"},(0,i.createElement)("label",{htmlFor:e+".label"},(0,r.__)("Label","wpify-custom-fields"))),(0,i.createElement)("div",{className:"wpifycf-field-link__field-input"},(0,i.createElement)("input",{type:"text",value:n?.label||"",id:e+".label",onChange:x,disabled:f}))))}function h({onChange:t,postTypes:e,value:n,disabled:o}){return(0,i.createElement)("select",{value:n.post_type||"",onChange:t,disabled:o},(0,i.createElement)("option",{value:""},(0,r.__)("URL","wpify-custom-fields")),e.map((t=>(0,i.createElement)("option",{value:t.slug,key:t.slug},t.labels.singular_name))))}function d({value:t={},htmlId:e,onUrlChange:n,onTargetChange:o,onBlur:s,disabled:a}){return(0,i.createElement)("div",{className:"wpifycf-field-link__url-input"},(0,i.createElement)("input",{type:"url",disabled:a,value:t.url||"",id:e+".url",onChange:n,onBlur:s}),(0,i.createElement)("label",{className:"wpifycf-field-link__field-option"},(0,i.createElement)("input",{type:"checkbox",disabled:a,checked:"_blank"===t.target,onChange:o}),(0,r.__)("Open in a new tab","wpify-custom-fields")))}u.checkValidity=c.jx;const O=u},8417:(t,e,n)=>{"use strict";n.r(e),n.d(e,{Mapycz:()=>x,default:()=>C});var i=n(1609),r=(n(2619),n(7723)),o=n(386),s=n(3250);const a=(0,i.createContext)(null),l=a.Provider;var c=n(3481),u=n.n(c);function h(){return h=Object.assign||function(t){for(var e=1;eg?.map??null),[g]);const $=(0,i.useCallback)((i=>{if(null!==i&&null===g){const r=new c.Map(i,f);null!=n&&null!=O?r.setView(n,O):null!=t&&r.fitBounds(t,e),null!=d&&r.whenReady(d),y(function(t){return Object.freeze({__version:1,map:t})}(r))}}),[]);(0,i.useEffect)((()=>()=>{g?.map.remove()}),[g]);const v=g?i.createElement(l,{value:g},r):a??null;return i.createElement("div",h({},m,{ref:$}),v)}const O=(0,i.forwardRef)(d);function f(t,e,n){return Object.freeze({instance:t,context:e,container:n})}function p(t,e){return null==e?function(e,n){const r=(0,i.useRef)();return r.current||(r.current=t(e,n)),r}:function(n,r){const o=(0,i.useRef)();o.current||(o.current=t(n,r));const s=(0,i.useRef)(n),{instance:a}=o.current;return(0,i.useEffect)((function(){s.current!==n&&(e(a,n,s.current),s.current=n)}),[a,n,r]),o}}function m(t,e){const n=t.pane??e.pane;return n?{...t,pane:n}:t}function g(t){return function(e){const n=function(){const t=(0,i.useContext)(a);if(null==t)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of ");return t}(),r=t(m(e,n),n);return function(t,e){const n=(0,i.useRef)(e);(0,i.useEffect)((function(){e!==n.current&&null!=t.attributionControl&&(null!=n.current&&t.attributionControl.removeAttribution(n.current),null!=e&&t.attributionControl.addAttribution(e)),n.current=e}),[t,e])}(n.map,e.attribution),function(t,e){const n=(0,i.useRef)();(0,i.useEffect)((function(){return null!=e&&t.instance.on(e),n.current=e,function(){null!=n.current&&t.instance.off(n.current),n.current=null}}),[t,e])}(r.current,e.eventHandlers),function(t,e){(0,i.useEffect)((function(){return(e.layerContainer??e.map).addLayer(t.instance),function(){e.layerContainer?.removeLayer(t.instance),e.map.removeLayer(t.instance)}}),[e,t])}(r.current,n),r}}n(5795);const y=function(t){function e(e,n){const{instance:r,context:o}=t(e).current;return(0,i.useImperativeHandle)(n,(()=>r)),null==e.children?null:i.createElement(l,{value:o},e.children)}return(0,i.forwardRef)(e)}(g(p((function({position:t,...e},n){const i=new c.Marker(t,e);return f(i,(r=n,o={overlayContainer:i},Object.freeze({...r,...o})));var r,o}),(function(t,e,n){e.position!==n.position&&t.setLatLng(e.position),null!=e.icon&&e.icon!==n.icon&&t.setIcon(e.icon),null!=e.zIndexOffset&&e.zIndexOffset!==n.zIndexOffset&&t.setZIndexOffset(e.zIndexOffset),null!=e.opacity&&e.opacity!==n.opacity&&t.setOpacity(e.opacity),null!=t.dragging&&e.draggable!==n.draggable&&(!0===e.draggable?t.dragging.enable():t.dragging.disable())})))),$=function(t){function e(e,n){const{instance:r}=t(e).current;return(0,i.useImperativeHandle)(n,(()=>r)),null}return(0,i.forwardRef)(e)}(g(p((function({url:t,...e},n){return f(new c.TileLayer(t,m(e,n)),n)}),(function(t,e,n){!function(t,e,n){const{opacity:i,zIndex:r}=e;null!=i&&i!==n.opacity&&t.setOpacity(i),null!=r&&r!==n.zIndex&&t.setZIndex(r)}(t,e,n);const{url:i}=e;null!=i&&i!==n.url&&t.setUrl(i)}))));var v=n(4164),b=n(7316);const S=u().icon({iconUrl:"https://api.mapy.cz/img/api/marker/drop-red.png",iconSize:[22,31],iconAnchor:[11,31]}),w={latitude:50.078625,longitude:14.460411,zoom:13};function x({id:t,htmlId:e,value:n={},onChange:s,lang:a="en",className:l,disabled:c=!1,setTitle:u}){const h=(0,o.VV)();return(0,i.useEffect)((()=>{"function"==typeof u&&u(n.longitude&&n.latitude?`${n.longitude}:${n.latitude}`:"")}),[n,u]),(0,i.createElement)("div",{className:(0,v.A)("wpifycf-field-mapycz",`wpifycf-field-mapycz--${t}`,l)},h.isFetching?(0,i.createElement)("div",null,(0,r.__)("Loading MapyCZ field...","wpify-custom-field")):h.isError?(0,i.createElement)("div",null,(0,r.__)("Error in loading MapyCZ field...","wpify-custom-field")):h.apiKey?(0,i.createElement)(Q,{apiKey:h.apiKey,value:n,onChange:s,lang:a,disabled:c}):(0,i.createElement)(T,{mapycz:h,htmlId:e}))}function Q({apiKey:t,value:e={},onChange:n,lang:r,disabled:s=!1}){const[a,l]=(0,i.useState)(null),c=e.latitude||w.latitude,h=e.longitude||w.longitude,d=e.zoom||w.zoom,f=[c,h],p=(0,i.useRef)(),{context:m}=(0,i.useContext)(b.B),{data:g}=(0,o.qr)({latitude:c,longitude:h,apiKey:t,lang:r});(0,i.useEffect)((()=>{if(Array.isArray(g?.items)){const t=g.items[0];let i="",r="",o="",s="",a="",l="";t.regionalStructure?.forEach((t=>{"regional.address"===t.type?r=t.name:"regional.street"===t.type?i=t.name:"regional.municipality_part"===t.type?a=t.name:"regional.municipality"===t.type?s=t.name:"regional.country"===t.type&&(l=t.name)})),t.zip&&(o=t.zip),e.street===i&&e.number===r&&e.zip===o&&e.city===s&&e.cityPart===a&&e.country===l||n({...e,street:i,number:r,zip:o,city:s,cityPart:a,country:l})}}),[n,e,g]);const $=(0,i.useCallback)((t=>{a&&a.setView(t)}),[a]),v=(0,i.useCallback)((t=>{if(!s){const i=t.target.getLatLng();n({...e,latitude:i.lat.toFixed(6),longitude:i.lng.toFixed(6)}),$(i)}}),[n,e,$,s]),x=(0,i.useCallback)((t=>{s||n({...e,zoom:t.target.getZoom()})}),[n,e,s]),Q=(0,i.useCallback)((t=>{if(!s){const i=t.target.getCenter();n({...e,latitude:i.lat.toFixed(6),longitude:i.lng.toFixed(6)})}}),[n,e,s]);(0,i.useEffect)((()=>(a&&(a.on("zoomend",x),a.on("moveend",Q)),()=>{a&&(a.off("zoomend",x),a.off("moveend",Q))})),[a,x,Q,m]);const T=(0,i.useMemo)((()=>(0,i.createElement)(O,{center:f,zoom:d,style:{height:"300px",width:"100%"},scrollWheelZoom:!1,ref:l},(0,i.createElement)(k,{apiKey:t}),(0,i.createElement)(y,{position:f,icon:S,draggable:!s,eventHandlers:{dragend:v}}))),[t,a,v]);return(0,i.useEffect)((()=>{a&&(new(u().Control.extend({options:{position:"bottomleft"},onAdd:()=>{const t=u().DomUtil.create("div"),e=u().DomUtil.create("a","",t);return e.setAttribute("href","http://mapy.cz/"),e.setAttribute("target","_blank"),e.setAttribute("rel","noreferrer noopenner"),e.innerHTML='Seznam.cz a.s.',u().DomEvent.disableClickPropagation(e),t}}))).addTo(a)}),[a]),(0,i.createElement)("div",{className:"wpifycf-field-mapycz__map",ref:p},!s&&(0,i.createElement)(_,{value:e,onChange:n,apiKey:t,lang:r,setCenter:$}),T,(0,i.createElement)(P,{value:e,className:"wpifycf-field-mapycz__address"}))}function P({value:t,className:e}){return t?.latitude&&t?.longitude?(0,i.createElement)("div",{className:e},t.country&&(0,i.createElement)(i.Fragment,null,t.street," ",t.number,(t.street||t.number)&&", ",t.zip," ",t.city," ",t.cityPart&&` - ${t.cityPart}`,", ",t.country),(0,i.createElement)("br",null),parseFloat(t.latitude).toFixed(6),", ",parseFloat(t.longitude).toFixed(6)):null}function _({value:t,onChange:e,apiKey:n,lang:s,setCenter:a}){const l=(0,i.useRef)(),[c,u]=(0,i.useState)(""),[h,d]=(0,i.useState)(null),{data:O}=(0,o.BS)({query:c,apiKey:n,lang:s}),f=(0,i.useCallback)((t=>{u(t.target.value)}),[]),p=(0,i.useCallback)((t=>{d(t)}),[]),m=(0,i.useCallback)((n=>{O.items[n]&&(e({...t,latitude:O.items[n].position.lat.toFixed(6),longitude:O.items[n].position.lon.toFixed(6)}),d(null),a([O.items[n].position.lat.toFixed(6),O.items[n].position.lon.toFixed(6)]),u(O.items[n].name))}),[e,O.items,a,t]),g=O.items.length,y=(0,i.useCallback)((n=>{if("ArrowUp"===n.key&&h>0)d((h+g-1)%g);else if("ArrowDown"===n.key&&h-?\d+(\.\d+)?)\s*[,;]\s*(?-?\d+(\.\d+)?)/,/(?-?\d+(,\d+)?)\s*;\s*(?-?\d+(,\d+)?)/];for(let r=0;r{d(0)}),[]);return(0,i.createElement)("div",{className:"wpifycf-field-mapycz__autocomplete",ref:l},(0,i.createElement)("input",{value:c,onChange:f,className:"wpifycf-field-mapycz__autocomplete-input",onKeyDown:y,onFocus:$,onMouseOver:()=>d(0)}),null!==h&&O.items.length>0&&(0,i.createElement)("div",{className:"wpifycf-field-mapycz__suggestions"},O.items.map(((t,e)=>(0,i.createElement)("button",{type:"button",key:e,onClick:()=>m(e),onMouseOver:()=>p(e),onMouseOut:()=>d(null),className:e===h?"wpifycf-field-mapycz__suggestion--active":""},(0,i.createElement)("strong",null,t.name),(0,i.createElement)("br",null),(0,i.createElement)("small",null,t.location)))),(0,i.createElement)("div",{className:"wpifycf-field-mapycz__suggestions-attribution"},(0,r.__)("Powered by","wpify-custom-fields"),(0,i.createElement)("a",{href:"https://api.mapy.cz/",target:"_blank",rel:"noreferrer noopenner"},(0,i.createElement)("img",{src:"https://api.mapy.cz/img/api/logo-small.svg",width:50,alt:"Mapy.cz"})))))}function k({apiKey:t}){return(0,i.createElement)($,{url:`https://api.mapy.cz/v1/maptiles/basic/256/{z}/{x}/{y}?apikey=${t}`,attribution:'© Seznam.cz a.s. a další'})}function T({mapycz:t,htmlId:e}){const[n,o]=(0,i.useState)(t.apiKey||""),a=(0,i.useCallback)((t=>{o(t.target.value)}),[o]),l=(0,i.useCallback)((()=>{t.handleUpdate(n)}),[t,n]);return(0,i.createElement)("div",{className:"wpifycf-field-mapycz__set-key"},(0,i.createElement)("label",{htmlFor:e,dangerouslySetInnerHTML:{__html:(0,r.__)('To use Mapy.cz field type, please register your project in Mapy.cz portal
and get the API key, it\'s free. Enter the key bellow:',"wpify-custom-fields")}}),(0,i.createElement)("input",{id:e,type:"text",size:46,value:n,onChange:a}),(0,i.createElement)(s.$,{onClick:l},(0,r.__)("Set API key","wpify-custom-fields")))}x.checkValidity=function(t,e){const n=[];return!e.required||("object"!=typeof t||t.latitude&&t.longitude)&&"object"==typeof t||n.push((0,r.__)("This field is required.","wpify-custom-fields")),n};const C=x},1419:(t,e,n)=>{"use strict";n.r(e),n.d(e,{Month:()=>a,default:()=>l});var i=n(1609),r=n(4164),o=(n(2619),n(1014)),s=n(386);function a({id:t,htmlId:e,onChange:n,value:o="",attributes:a={},min:l,max:c,disabled:u=!1,className:h,setTitle:d}){(0,s.Us)(d,o);const O=(0,i.useCallback)((t=>n(t.target.value)),[n]);return(0,i.createElement)("input",{type:"month",id:e,onChange:O,value:o,className:(0,r.A)("wpifycf-field-month",`wpifycf-field-month--${t}`,a.class,h),min:l,max:c,disabled:u,...a})}a.checkValidity=o.e6;const l=a},6985:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>h});var i=n(1609),r=n(7723),o=n(2452),s=n(386),a=n(3250),l=n(4164),c=(n(2619),n(1014));function u({id:t,value:e=[],attachment_type:n,onChange:c,className:u,disabled:h=!1,setTitle:d}){(0,s.Us)(d,Array.isArray(e)&&e.length>0?(0,r.sprintf)((0,r._n)("%d attachment","%d attachments",e.length,"wpify-custom-fields"),e.length):""),(0,i.useEffect)((()=>{Array.isArray(e)||c([])}),[e,c]);const[O,f]=(0,i.useState)([]),p=(0,i.useRef)(null),m=(0,i.useCallback)((t=>{f(t),c(t.map((t=>t.id)))}),[c]);(0,s.C_)({containerRef:p,items:O,setItems:m,disabled:h}),(0,i.useEffect)((()=>{e.length>0&&Promise.allSettled(e.map((t=>wp.media.attachment(String(t)).fetch()))).then((t=>f(t.filter((t=>"fulfilled"===t.status)).map((t=>t.value)))))}),[e]);const g=(0,s.tj)({value:e,onChange:c,multiple:!0,title:(0,r.__)("Add attachments","wpify-custom-fields"),button:(0,r.__)("Add selected","wpify-custom-fields"),type:n}),y=(0,i.useCallback)((t=>()=>{const n=e.filter((e=>e!==t));c(n),f((e=>e.filter((e=>e.id!==t))))}),[c,e]);return(0,i.createElement)("div",{className:(0,l.A)("wpifycf-field-multi-attachment",`wpifycf-field-multi-attachment--${t}`,u)},!h&&(0,i.createElement)(a.$,{className:"wpifycf-button__add",onClick:g},(0,r.__)("Add attachments","wpify-custom-fields")),O.length>0&&(0,i.createElement)("div",{className:"wpifycf-field-multi-attachment__items",ref:p},O.map((t=>(0,i.createElement)(o.AttachmentItem,{key:t.id,attachment:t,remove:y(t.id),disabled:h})))))}u.checkValidity=c.XK;const h=u},9592:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>s});var i=n(1609),r=n(4164),o=n(9853);const s=function({className:t,buttons:e=[],disabled:n=!1}){return(0,i.createElement)("div",{className:(0,r.A)("wpifycf-field-multi-button",t)},e.map(((t,e)=>(0,i.createElement)(o.Button,{key:e,disabled:n,...t}))))}},1237:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>c});var i=n(1609),r=(n(2619),n(1014)),o=n(386),s=n(5103),a=n(4164);function l({id:t,htmlId:e,onChange:n,value:r=[],options:l,attributes:c={},disabled:u=!1,className:h,setTitle:d}){const O=(0,i.useMemo)((()=>{if(!Array.isArray(r)||0===r.length||!l)return"";const t=r.slice(0,3).map((t=>{const e=l.find((e=>e.value===t));return e?(0,s.QZ)(e.label):t})).filter(Boolean);return r.length>3?t.join(", ")+` (+${r.length-3})`:t.join(", ")}),[r,l]);(0,o.Us)(d,O);const f=(0,i.useCallback)((t=>e=>{const i=Array.isArray(r)?[...r]:[];e.target.checked?i.push(t):i.splice(i.indexOf(t),1),n(i.filter(((t,e,n)=>n.indexOf(t)===e)))}),[n,r]);return(0,i.createElement)("div",{className:(0,a.A)("wpifycf-field-multi-checkbox",`wpifycf-field-multi-checkbox--${t}`,h)},l.map((t=>(0,i.createElement)("div",{className:`wpifycf-field-multi-checkbox__item wpifycf-field-multi-checkbox__item--${t.value}`,key:t.value},(0,i.createElement)("input",{type:"checkbox",id:`${e}-${t.value}`,onChange:f(t.value),checked:!!Array.isArray(r)&&r.includes(t.value),disabled:u||t.disabled,...c}),(0,i.createElement)("label",{className:"wpifycf-field-multi-checkbox__label",htmlFor:`${e}-${t.value}`,dangerouslySetInnerHTML:{__html:t.label}})))))}l.checkValidity=r.QM;const c=l},8236:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>a});var i=n(1609),r=n(6353),o=(n(2619),n(1014));const s=t=>(0,i.createElement)(r.q,{...t,type:"date"});s.checkValidity=(0,o.E2)("date");const a=s},9403:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>a});var i=n(1609),r=n(6353),o=n(1014);const s=t=>(0,i.createElement)(r.q,{...t,type:"date_range"});s.checkValidity=(0,o.E2)("date_range");const a=s},7569:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>a});var i=n(1609),r=n(6353),o=(n(2619),n(1014));const s=t=>(0,i.createElement)(r.q,{...t,type:"datetime"});s.checkValidity=(0,o.E2)("datetime");const a=s},7242:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>a});var i=n(1609),r=n(6353),o=(n(2619),n(1014));const s=t=>(0,i.createElement)(r.q,{...t,type:"email"});s.checkValidity=(0,o.E2)("email");const a=s},6733:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>O});var i=n(1609),r=n(386),o=n(4164),s=n(3250),a=n(7723),l=n(9388),c=n(1014),u=n(5587),h=n(5103);function d({value:t=[],onChange:e,buttons:n={},disabled_buttons:c=[],min:d,max:O,htmlId:f,className:p,validity:m=[],fieldPath:g,disabled:y=!1,collapse:$=!0,setTitle:v,...b}){(0,i.useEffect)((()=>{Array.isArray(t)||e([])}),[t,e]);const S=(0,i.useMemo)((()=>(0,h.of)(b.items).reduce(((t,e)=>(t[e.id]=e.default,t)),{})),[b.items]),[w,x]=(0,i.useState)((()=>Array.isArray(t)?t.map((()=>"")):[])),Q=(0,i.useCallback)((t=>e=>{x((n=>{if(n[t]===e)return n;const i=[...n];return i[t]=e,i}))}),[]),P=(0,i.useCallback)((({type:t,...e})=>{x((n=>{switch(t){case"sort":return e.indexMap.map((t=>n[t]||""));case"remove":{const t=[...n];return t.splice(e.index,1),t}case"duplicate":{const t=[...n];return t.splice(e.index,0,n[e.index]),t}case"add":return[...n,""];default:return n}}))}),[]),{add:_,remove:k,duplicate:T,handleChange:C,canAdd:z,canRemove:R,canMove:E,canDuplicate:A,containerRef:Z,keyPrefix:M,collapsed:V,toggleCollapsed:X}=(0,r.NQ)({value:t,onChange:e,min:d,max:O,defaultValue:S,disabled_buttons:c,disabled:y,collapse:$,dragHandle:".wpifycf__move-handle",onMutate:P}),q=m?.reduce(((t,e)=>"object"==typeof e?{...t,...e}:t),{});return(0,i.createElement)("div",{className:(0,o.A)("wpifycf-field-multi-group",`wpifycf-field-multi-group--${b.id}`,b.attributes?.class,p)},(0,i.createElement)("div",{className:"wpifycf-field-multi-group__items",ref:Z},Array.isArray(t)&&t.map(((t,e)=>(0,i.createElement)("div",{className:(0,o.A)("wpifycf-field-multi-group__item",V[e]&&"wpifycf-field-multi-group__item--collapsed",!$&&"wpifycf-field-multi-group__item--not-collapsible",q[e]&&"wpifycf-field-multi-group__item--invalid"),key:M+"."+e},(0,i.createElement)("div",{className:"wpifycf-field-multi-group__item-header wpifycf__move-handle"},E&&(0,i.createElement)("div",{className:"wpifycf-field-multi-group__sort",onClick:$?X(e):void 0},(0,i.createElement)(l.K,{icon:"move",className:"wpifycf-sort"})),(0,i.createElement)("div",{className:"wpifycf-field-multi-group__title",onClick:$?X(e):void 0},w[e]||`#${e+1}`),(0,i.createElement)("div",{className:(0,o.A)("wpifycf-field-multi-group__header-actions")},A&&(0,i.createElement)("div",{className:"wpifycf-field-multi-group__duplicate"},n.duplicate?(0,i.createElement)(s.$,{onClick:T(e)},n.duplicate):(0,i.createElement)(l.K,{icon:"duplicate",onClick:T(e)})),R&&(0,i.createElement)("div",{className:"wpifycf-field-multi-group__remove"},n.remove?(0,i.createElement)(s.$,{onClick:k(e)},n.remove):(0,i.createElement)(l.K,{icon:"trash",onClick:k(e)})))),(0,i.createElement)("div",{className:"wpifycf-field-multi-group__content"},(0,i.createElement)(u.D,{...b,disabled:y,value:t,default:S,onChange:C(e),type:"group",htmlId:f+"."+e,validity:q[e],fieldPath:`${g}[${e}]`,renderOptions:{noLabel:!0,noFieldWrapper:!0,noControlWrapper:!0},setTitle:Q(e)})))))),z&&(0,i.createElement)("div",{className:"wpifycf-field-multi-group__actions"},(0,i.createElement)(s.$,{onClick:_},n.add||(0,a.__)("Add item","wpify-custom-fields"))))}d.checkValidity=c.x4;const O=d},5076:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>a});var i=n(1609),r=n(6353),o=(n(2619),n(1014));const s=t=>(0,i.createElement)(r.q,{...t,type:"link"});s.checkValidity=(0,o.E2)("link");const a=s},5708:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>a});var i=n(1609),r=n(6353),o=(n(2619),n(1014));const s=t=>(0,i.createElement)(r.q,{...t,type:"mapycz"});s.checkValidity=(0,o.E2)("mapycz");const a=s},2220:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>a});var i=n(1609),r=n(6353),o=(n(2619),n(1014));const s=t=>(0,i.createElement)(r.q,{...t,type:"month"});s.checkValidity=(0,o.E2)("month");const a=s},3909:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>a});var i=n(1609),r=n(6353),o=(n(2619),n(1014));const s=t=>(0,i.createElement)(r.q,{...t,type:"number"});s.checkValidity=(0,o.E2)("number");const a=s},8742:(t,e,n)=>{"use strict";n.r(e),n.d(e,{MultiPost:()=>u,default:()=>h});var i=n(1609),r=(n(2619),n(7723)),o=n(5028),s=n(251),a=n(386),l=n(1014),c=n(4164);function u({id:t,value:e=[],onChange:n,post_type:l,className:u,disabled:h=!1,setTitle:d}){(0,a.Us)(d,Array.isArray(e)&&e.length>0?(0,r.sprintf)((0,r._n)("%d post","%d posts",e.length,"wpify-custom-fields"),e.length):""),(0,i.useEffect)((()=>{Array.isArray(e)||n([])}),[e,n]);const O=(0,i.useCallback)((t=>n([t,...e])),[n,e]),{data:f}=(0,a.j6)({postType:l,enabled:Array.isArray(e)&&e.length>0,include:Array.isArray(e)?[...e].sort():[]}),{containerRef:p,remove:m}=(0,a.NQ)({value:e,onChange:n,disabled:h});return(0,i.createElement)("div",{className:(0,c.A)("wpifycf-field-multi-post",`wpifycf-field-multi-post--${t}`,u)},!h&&(0,i.createElement)(o.l,{value:null,exclude:e,onChange:O,postType:l}),(0,i.createElement)("div",{className:"wpifycf-field-multi-post__items",ref:p},Array.isArray(e)&&e.map(((t,e)=>(0,i.createElement)(s.PostPreview,{key:e+"-"+t,post:f.find((e=>e.id===t)),onDelete:m(e),disabled:h})))))}u.checkValidity=l.XK;const h=u},6440:(t,e,n)=>{"use strict";n.r(e),n.d(e,{MultiSelect:()=>h,default:()=>d});var i=n(1609),r=(n(2619),n(9550)),o=n(386),s=n(9388),a=n(1014),l=n(4164),c=n(5480),u=n(5103);function h({id:t,value:e=[],onChange:n,options:a=[],options_key:h,className:d,disabled:O,async_params:f={},fieldPath:p,setTitle:m}){(0,i.useEffect)((()=>{Array.isArray(e)||n([])}),[e,n]);const[g,y]=(0,i.useState)(""),$=(0,c.d7)(g,300),[v,b]=(0,i.useState)({}),{getValue:S}=(0,o.oV)(p),w=(0,i.useMemo)((()=>(0,u.o0)(f,S)),[f,S]),{data:x,isSuccess:Q,isFetching:P}=(0,o.II)({optionsKey:h,enabled:!!h,initialData:a,search:$,value:e,...w});(0,i.useEffect)((()=>{Q&&b((t=>({...t,...x.reduce(((t,e)=>(t[e.value]=(0,u.QZ)(e.label),t)),{})})))}),[x,Q]);const _=(0,i.useMemo)((()=>(h?x.length>0?x:[{value:"",label:"No options found"}]:a).map((t=>({...t,label:(0,u.QZ)(t.label)})))),[x,a]),k=(0,i.useMemo)((()=>_.filter((t=>!e?.includes(t.value)))),[_,e]),T=(0,i.useMemo)((()=>(Array.isArray(e)?e.filter(Boolean).map((t=>_.find((e=>String(e.value)===String(t)))||{value:t,label:(0,u.QZ)(t)})):[]).map((t=>({...t,label:(0,u.QZ)(t.label)})))),[_,e]),C=(0,i.useMemo)((()=>{if(!Array.isArray(e)||0===e.length)return"";const t=e.slice(0,3).map((t=>v[t]||t)).filter(Boolean);return e.length>3?t.join(", ")+` (+${e.length-3})`:t.join(", ")}),[e,v]);(0,o.Us)(m,C);const{containerRef:z,remove:R}=(0,o.NQ)({value:e,onChange:n,disabled:O}),E=(0,i.useCallback)((t=>n([t,...e])),[n,e]);return(0,i.createElement)("div",{className:(0,l.A)("wpifycf-field-multi-select",`wpifycf-field-multi-select--${t}`,d)},T.length>0&&(0,i.createElement)("div",{className:"wpifycf-field-multi-select__options",ref:z},T.map(((t,e)=>(0,i.createElement)("div",{className:"wpifycf-field-multi-select__option",key:t.value},(0,i.createElement)("span",null,v[t.value]||t.value),!O&&(0,i.createElement)(s.K,{icon:"trash",onClick:R(e)}))))),(0,i.createElement)(r.l,{id:t,value:null,onChange:E,options:k,filterOption:h?Boolean:void 0,onInputChange:y,disabled:O,isFetching:P}))}h.checkValidity=a.l1;const d=h},4379:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>a});var i=n(1609),r=n(6353),o=(n(2619),n(1014));const s=t=>(0,i.createElement)(r.q,{...t,type:"tel"});s.checkValidity=(0,o.E2)("tel");const a=s},6930:(t,e,n)=>{"use strict";n.r(e),n.d(e,{MultiTerm:()=>h,default:()=>d});var i=n(1609),r=n(386),o=n(7723),s=n(6440),a=n(6791),l=n(1014),c=n(4164),u=n(5103);function h({taxonomy:t,id:e,htmlId:n,value:l=[],onChange:h,className:d,disabled:O=!1,setTitle:f}){(0,r.Us)(f,Array.isArray(l)&&l.length>0?(0,o.sprintf)((0,o._n)("%d term","%d terms",l.length,"wpify-custom-fields"),l.length):"");const{data:p,isError:m,isFetching:g}=(0,r.hf)({taxonomy:t}),y=(0,i.useMemo)((()=>p.map((t=>({value:t.id,label:(0,u.QZ)(t.name)})))),[p]);let $;return $=g?(0,o.__)("Loading terms...","wpify-custom-fields"):m?(0,o.__)("Error in loading terms...","wpify-custom-fields"):0===p.length?(0,o.__)("No terms found...","wpify-custom-fields"):p.some((t=>t.children))?(0,i.createElement)(a.CategoryTree,{categories:p,value:l,onChange:h,type:"checkbox",htmlId:n,disabled:O}):(0,i.createElement)(s.MultiSelect,{id:e,htmlId:n,value:l,onChange:h,options:y,disabled:O}),(0,i.createElement)("div",{className:(0,c.A)("wpifycf-field-term",`wpifycf-field-term--${e}`,d)},$)}h.checkValidity=l.XK;const d=h},6323:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>a});var i=n(1609),r=n(6353),o=(n(2619),n(1014));const s=t=>(0,i.createElement)(r.q,{...t,type:"text"});s.checkValidity=(0,o.E2)("text");const a=s},4726:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>a});var i=n(1609),r=n(6353),o=(n(2619),n(1014));const s=t=>(0,i.createElement)(r.q,{...t,type:"textarea"});s.checkValidity=(0,o.E2)("textarea");const a=s},4549:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>a});var i=n(1609),r=n(6353),o=(n(2619),n(1014));const s=t=>(0,i.createElement)(r.q,{...t,type:"time"});s.checkValidity=(0,o.E2)("time");const a=s},5972:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>u});var i=n(1609),r=(n(2619),n(6427)),o=n(1014),s=n(386),a=n(5103),l=n(4164);function c({id:t,htmlId:e,onChange:n,value:o=[],options:c,className:u,disabled:h=!1,setTitle:d}){const O=(0,i.useMemo)((()=>Array.isArray(o)&&0!==o.length&&c?o.map((t=>c.find((e=>e.value===t)))).filter(Boolean).map((t=>(0,a.QZ)(t.label))).join(", "):""),[o,c]);(0,s.Us)(d,O);const f=(0,i.useCallback)((t=>e=>{const i=Array.isArray(o)?[...o]:[];e?i.push(t):i.splice(i.indexOf(t),1),n(i.filter(((t,e,n)=>n.indexOf(t)===e)))}),[n,o]);return(0,i.createElement)("div",{className:(0,l.A)("wpifycf-field-multi-toggle",`wpifycf-field-multi-toggle--${t}`,u)},c.map((t=>(0,i.createElement)("div",{className:`wpifycf-field-multi-toggle__item wpifycf-field-multi-checkbox__item--${t.value}`,key:t.value},(0,i.createElement)(r.ToggleControl,{id:`${e}-${t.value}`,onChange:f(t.value),checked:!!Array.isArray(o)&&o.includes(t.value),disabled:h||t.disabled,label:(0,i.createElement)("span",{dangerouslySetInnerHTML:{__html:t.label}})})))))}c.checkValidity=o.QM;const u=c},5971:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>a});var i=n(1609),r=n(6353),o=(n(2619),n(1014));const s=t=>(0,i.createElement)(r.q,{...t,type:"url"});s.checkValidity=(0,o.E2)("url");const a=s},688:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>a});var i=n(1609),r=n(6353),o=(n(2619),n(1014));const s=t=>(0,i.createElement)(r.q,{...t,type:"week"});s.checkValidity=(0,o.E2)("week");const a=s},9188:(t,e,n)=>{"use strict";n.r(e),n.d(e,{NumberInput:()=>a,default:()=>l});var i=n(1609),r=n(4164),o=(n(2619),n(1014)),s=n(386);function a({id:t,htmlId:e,onChange:n,value:o="",min:a,max:l,step:c,attributes:u={},className:h,disabled:d=!1,setTitle:O}){(0,s.Us)(O,o);const f=(0,i.useCallback)((t=>n(Number(t.target.value))),[n]);return(0,i.createElement)("input",{type:"number",id:e,onChange:f,value:o,min:a,max:l,step:c,className:(0,r.A)("wpifycf-field-number",`wpifycf-field-number--${t}`,u.class,h),disabled:d,...u})}a.checkValidity=o.qK;const l=a},5484:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>l});var i=n(1609),r=n(4164),o=(n(2619),n(1014)),s=n(386);function a({id:t,htmlId:e,onChange:n,value:o="",attributes:a={},className:l,disabled:c=!1,setTitle:u}){(0,s.Us)(u,o?"••••••":"");const h=(0,i.useCallback)((t=>n(String(t.target.value))),[n]);return(0,i.createElement)("input",{type:"password",id:e,onChange:h,value:o,className:(0,r.A)("wpifycf-field-password",`wpifycf-field-password--${t}`,a.class,l),disabled:c,...a})}a.checkValidity=o.e6;const l=a},251:(t,e,n)=>{"use strict";n.r(e),n.d(e,{Post:()=>h,PostPreview:()=>d,default:()=>O});var i=n(1609),r=(n(2619),n(5028)),o=n(9388),s=n(1014),a=n(386),l=n(4164);const c="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMTAwcHgiIGhlaWdodD0iMTAwcHgiIHZpZXdCb3g9IjAgMCAxMDAgMTAwIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPHBhdGggZmlsbD0iI2QwZDBkMCIgZD0iTSAwLjAwMSAwIEwgMTAwLjAwMSAwIEwgMTAwLjAwMSAxMDAgTCAwLjAwMSAxMDAgTCAwLjAwMSAwIFoiLz4KICAgIDxwYXRoIGQ9Ik0gNTguMjQ5IDQ2LjU4OSBMIDM5LjIzNCA3MS43OTkgTCAzMC4zNjkgNjAuMDQ1IEwgNy4wODYgOTAuOTE0IEwgOTEuNjgyIDkwLjkxNCBMIDU4LjI0OSA0Ni41ODkgWiIgb3BhY2l0eT0iLjY3NSIgZmlsbD0iI2ZmZiIvPgogICAgPGNpcmNsZSBjeD0iMjUiIGN5PSIyNSIgcj0iOCIgb3BhY2l0eT0iLjY3NSIgZmlsbD0iI2ZmZiIvPgo8L3N2Zz4K";var u=n(5103);function h({id:t,value:e=null,onChange:n,post_type:o,className:s,disabled:c=!1,setTitle:h}){const[O,f]=(0,i.useState)(null);(0,a.Us)(h,O?(0,u.QZ)(O.title):"");const p=(0,i.useCallback)((()=>n(null)),[n]);return(0,i.createElement)("div",{className:(0,l.A)("wpifycf-field-post",`wpifycf-field-post--${t}`,s)},(0,i.createElement)(r.l,{value:e,onChange:n,onSelect:f,postType:o,disabled:c}),e>0&&(0,i.createElement)(d,{post:O,onDelete:p,disabled:c}))}function d({post:t,onDelete:e,disabled:n}){return(0,i.createElement)("div",{className:"wpifycf-post-preview"},t&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("img",{src:t.thumbnail||c,alt:t.title,className:"wpifycf-post-preview__thumbnail",loading:"lazy",width:"100",height:"100"}),(0,i.createElement)("div",{className:"wpifycf-post-preview__title"},(0,i.createElement)("a",{href:t.permalink,target:"_blank"},t.id,": ",(0,u.QZ)(t.title))),(0,i.createElement)("div",{className:"wpifycf-post-preview__excerpt"},t.excerpt.length>125?t.excerpt.substring(0,125)+"...":t.excerpt)),!n&&(0,i.createElement)(o.K,{icon:"trash",className:"wpifycf-post-preview__delete",onClick:e}))}h.checkValidity=s.qK;const O=h},9242:(t,e,n)=>{"use strict";n.r(e),n.d(e,{Radio:()=>l,default:()=>c});var i=n(1609),r=n(4164),o=n(1014),s=n(386),a=n(5103);function l({id:t,htmlId:e,onChange:n,value:o="",options:l=[],attributes:c={},className:u,disabled:h=!1,setTitle:d}){const O=(0,i.useMemo)((()=>{const t=l.find((t=>(t.value||t)===o));return t?(0,a.QZ)(t.label||t):""}),[l,o]);(0,s.Us)(d,O);const f=(0,i.useCallback)((t=>n(t.target.value)),[n]);return(0,i.createElement)("div",{className:(0,r.A)("wpifycf-field-radio",`wpifycf-field-radio--${t}`,c.class,u)},l.map(((t,n)=>{const r=t.value||t,s=t.label||t,a=o===r,l=`${e}-${n}`;return(0,i.createElement)("label",{key:l,htmlFor:l,className:"wpifycf-field-radio__label"},(0,i.createElement)("input",{type:"radio",id:l,onChange:f,value:r,checked:a,disabled:h,...c}),s)})))}l.checkValidity=o.e6;const c=l},9428:(t,e,n)=>{"use strict";n.r(e),n.d(e,{Range:()=>a,default:()=>l});var i=n(1609),r=n(4164),o=(n(2619),n(1014)),s=n(386);function a({id:t,htmlId:e,onChange:n,value:o="",min:a,max:l,step:c,attributes:u={},className:h,disabled:d=!1,setTitle:O}){(0,s.Us)(O,o);const f=(0,i.useCallback)((t=>n(Number(t.target.value))),[n]),p=!isNaN(parseFloat(o));return(0,i.createElement)("div",{className:(0,r.A)("wpifycf-field-range",`wpifycf-field-range--${t}`,u.class,h)},a&&(0,i.createElement)("div",{className:"wpifycf-field-range__minmax"},a),(0,i.createElement)("input",{type:"range",id:e,onChange:f,value:o,min:a,max:l,step:c,disabled:d,...u}),l&&(0,i.createElement)("div",{className:"wpifycf-field-range__minmax"},l),p&&(0,i.createElement)("div",{className:"wpifycf-field-range__value"},o))}a.checkValidity=o.qK;const l=a},2117:(t,e,n)=>{"use strict";n.r(e),n.d(e,{Select:()=>c,default:()=>u});var i=n(1609),r=n(9550),o=n(386),s=n(1014),a=n(4164),l=n(5103);function c({id:t,value:e="",onChange:n,options:s=[],options_key:c,className:u,disabled:h=!1,setTitle:d,async_params:O={},fieldPath:f}){const[p,m]=(0,i.useState)(""),{getValue:g}=(0,o.oV)(f),y=(0,i.useMemo)((()=>(0,l.o0)(O,g)),[O,g]),{data:$,isFetching:v}=(0,o.II)({optionsKey:c,enabled:!!c,initialData:s,search:p,value:e,...y}),b=(0,i.useMemo)((()=>(c?$:s).map((t=>({...t,label:(0,l.QZ)(t.label)})))),[$,s]),S=(0,i.useMemo)((()=>Array.isArray(b)?b.find((t=>String(t.value)===String(e))):null),[b,e]);return(0,i.useEffect)((()=>{d&&d((0,l.QZ)(S?.label||""))}),[S,d]),(0,i.createElement)(r.l,{id:t,value:S,onChange:n,options:b,filterOption:c?Boolean:void 0,onInputChange:m,className:(0,a.A)("wpifycf-field-select",`wpifycf-field-select--${t}`,u),disabled:h,isFetching:v})}c.checkValidity=s.e6;const u=c},3585:(t,e,n)=>{"use strict";n.r(e),n.d(e,{Tel:()=>wi,default:()=>xi});var i=n(1609),r=n(4164);n(2619);const o={ext:"ext.",country:"Phone number country",phone:"Phone",AB:"Abkhazia",AC:"Ascension Island",AD:"Andorra",AE:"United Arab Emirates",AF:"Afghanistan",AG:"Antigua and Barbuda",AI:"Anguilla",AL:"Albania",AM:"Armenia",AO:"Angola",AQ:"Antarctica",AR:"Argentina",AS:"American Samoa",AT:"Austria",AU:"Australia",AW:"Aruba",AX:"Åland Islands",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BB:"Barbados",BD:"Bangladesh",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BL:"Saint Barthélemy",BM:"Bermuda",BN:"Brunei Darussalam",BO:"Bolivia",BQ:"Bonaire, Sint Eustatius and Saba",BR:"Brazil",BS:"Bahamas",BT:"Bhutan",BV:"Bouvet Island",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CC:"Cocos (Keeling) Islands",CD:"Congo, Democratic Republic of the",CF:"Central African Republic",CG:"Congo",CH:"Switzerland",CI:"Cote d'Ivoire",CK:"Cook Islands",CL:"Chile",CM:"Cameroon",CN:"China",CO:"Colombia",CR:"Costa Rica",CU:"Cuba",CV:"Cape Verde",CW:"Curaçao",CX:"Christmas Island",CY:"Cyprus",CZ:"Czech Republic",DE:"Germany",DJ:"Djibouti",DK:"Denmark",DM:"Dominica",DO:"Dominican Republic",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",EH:"Western Sahara",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",FI:"Finland",FJ:"Fiji",FK:"Falkland Islands",FM:"Federated States of Micronesia",FO:"Faroe Islands",FR:"France",GA:"Gabon",GB:"United Kingdom",GD:"Grenada",GE:"Georgia",GF:"French Guiana",GG:"Guernsey",GH:"Ghana",GI:"Gibraltar",GL:"Greenland",GM:"Gambia",GN:"Guinea",GP:"Guadeloupe",GQ:"Equatorial Guinea",GR:"Greece",GS:"South Georgia and the South Sandwich Islands",GT:"Guatemala",GU:"Guam",GW:"Guinea-Bissau",GY:"Guyana",HK:"Hong Kong",HM:"Heard Island and McDonald Islands",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IL:"Israel",IM:"Isle of Man",IN:"India",IO:"British Indian Ocean Territory",IQ:"Iraq",IR:"Iran",IS:"Iceland",IT:"Italy",JE:"Jersey",JM:"Jamaica",JO:"Jordan",JP:"Japan",KE:"Kenya",KG:"Kyrgyzstan",KH:"Cambodia",KI:"Kiribati",KM:"Comoros",KN:"Saint Kitts and Nevis",KP:"North Korea",KR:"South Korea",KW:"Kuwait",KY:"Cayman Islands",KZ:"Kazakhstan",LA:"Laos",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LK:"Sri Lanka",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libya",MA:"Morocco",MC:"Monaco",MD:"Moldova",ME:"Montenegro",MF:"Saint Martin (French Part)",MG:"Madagascar",MH:"Marshall Islands",MK:"North Macedonia",ML:"Mali",MM:"Myanmar",MN:"Mongolia",MO:"Macao",MP:"Northern Mariana Islands",MQ:"Martinique",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MV:"Maldives",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"Netherlands",NO:"Norway",NP:"Nepal",NR:"Nauru",NU:"Niue",NZ:"New Zealand",OM:"Oman",OS:"South Ossetia",PA:"Panama",PE:"Peru",PF:"French Polynesia",PG:"Papua New Guinea",PH:"Philippines",PK:"Pakistan",PL:"Poland",PM:"Saint Pierre and Miquelon",PN:"Pitcairn",PR:"Puerto Rico",PS:"Palestine",PT:"Portugal",PW:"Palau",PY:"Paraguay",QA:"Qatar",RE:"Reunion",RO:"Romania",RS:"Serbia",RU:"Russia",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands",SC:"Seychelles",SD:"Sudan",SE:"Sweden",SG:"Singapore",SH:"Saint Helena",SI:"Slovenia",SJ:"Svalbard and Jan Mayen",SK:"Slovakia",SL:"Sierra Leone",SM:"San Marino",SN:"Senegal",SO:"Somalia",SR:"Suriname",SS:"South Sudan",ST:"Sao Tome and Principe",SV:"El Salvador",SX:"Sint Maarten",SY:"Syria",SZ:"Swaziland",TA:"Tristan da Cunha",TC:"Turks and Caicos Islands",TD:"Chad",TF:"French Southern Territories",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TK:"Tokelau",TL:"Timor-Leste",TM:"Turkmenistan",TN:"Tunisia",TO:"Tonga",TR:"Turkey",TT:"Trinidad and Tobago",TV:"Tuvalu",TW:"Taiwan",TZ:"Tanzania",UA:"Ukraine",UG:"Uganda",UM:"United States Minor Outlying Islands",US:"United States",UY:"Uruguay",UZ:"Uzbekistan",VA:"Holy See (Vatican City State)",VC:"Saint Vincent and the Grenadines",VE:"Venezuela",VG:"Virgin Islands, British",VI:"Virgin Islands, U.S.",VN:"Vietnam",VU:"Vanuatu",WF:"Wallis and Futuna",WS:"Samoa",XK:"Kosovo",YE:"Yemen",YT:"Mayotte",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe",ZZ:"International"};var s=n(5556),a=s.shape({country_calling_codes:s.object.isRequired,countries:s.object.isRequired}),l=s.objectOf(s.string),c=n(6942);function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e.split(""));!(n=r()).done;)n.value===t&&i++;return i}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:"x",n=arguments.length>2?arguments[2]:void 0;if(!t)return function(t){return{text:t}};var i=h(e,t);return function(r){if(!r)return{text:"",template:t};for(var o,s=0,a="",l=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return d(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(t.split(""));!(o=l()).done;){var c=o.value;if(c===e){if(a+=r[s],++s===r.length&&r.length2&&void 0!==arguments[2]?arguments[2]:"x",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:" ",r=t.length,o=h("(",t)-h(")",t);o>0&&rs&&(o=r.length))),s++}return void 0===e&&(o=r.length),{value:r,caret:o}}(t.value,t.selectionStart,e),s=o.value,a=o.caret;if(i){var l=function(t,e,n){switch(n){case"Backspace":e>0&&(t=t.slice(0,e-1)+t.slice(e),e--);break;case"Delete":t=t.slice(0,e)+t.slice(e+1)}return{value:t,caret:e}}(s,a,i);s=l.value,a=l.caret}var c=function(t,e,n){"string"==typeof n&&(n=O(n));var i=n(t)||{},r=i.text,o=i.template;if(void 0===r&&(r=t),o)if(void 0===e)e=r.length;else{for(var s=0,a=!1,l=-1;s=0||(r[n]=t[n]);return r}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}(t,y),u=(0,i.useRef)(),h=(0,i.useCallback)((function(t){u.current=t,e&&("function"==typeof e?e(t):e.current=t)}),[e]),d=(0,i.useCallback)((function(t){g(u.current,r,o,void 0,a)}),[u,r,o,a]),O=(0,i.useCallback)((function(t){if(l&&l(t),!t.defaultPrevented)return m(t,u.current,r,o,a)}),[u,r,o,a,l]);return i.createElement(s,$({},c,{ref:h,value:o(S(n)?"":n).text,onKeyDown:O,onChange:d}))}(v=i.forwardRef(v)).propTypes={parse:s.func.isRequired,format:s.func.isRequired,inputComponent:s.elementType.isRequired,type:s.string.isRequired,value:s.string,onChange:s.func.isRequired,onKeyDown:s.func,onCut:s.func,onPaste:s.func},v.defaultProps={inputComponent:"input",type:"text"};const b=v;function S(t){return null==t}function w(t,e){t=t.split("-"),e=e.split("-");for(var n=t[0].split("."),i=e[0].split("."),r=0;r<3;r++){var o=Number(n[r]),s=Number(i[r]);if(o>s)return 1;if(s>o)return-1;if(!isNaN(o)&&isNaN(s))return 1;if(isNaN(o)&&!isNaN(s))return-1}return t[1]&&e[1]?t[1]>e[1]?1:t[1]t.length)&&(e=t.length);for(var n=0,i=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e);!(n=r()).done;){var o=n.value;t.indexOf(o)<0&&i.push(o)}return i.sort((function(t,e){return t-e}))}(r,o.possibleLengths()))}else if(e&&!i)return"INVALID_LENGTH";var s=t.length,a=r[0];return a===s?"IS_POSSIBLE":a>s?"TOO_SHORT":r[r.length-1]=0?"IS_POSSIBLE":"INVALID_LENGTH"}function U(t,e){return"IS_POSSIBLE"===L(t,e)}function D(t,e){return t=t||"",new RegExp("^(?:"+e+")$").test(t)}function Y(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(B);!(r=o()).done;){var s=r.value;if(F(i,s,n))return s}}}}function F(t,e,n){return!(!(e=n.type(e))||!e.pattern())&&!(e.possibleLengths()&&e.possibleLengths().indexOf(t.length)<0)&&D(t,e.pattern())}var H="0-90-9٠-٩۰-۹",K="".concat("-‐-―−ー-").concat("//").concat("..").concat("  ­​⁠ ").concat("()()[]\\[\\]").concat("~⁓∼~");function J(t){return t.replace(new RegExp("[".concat(K,"]+"),"g")," ").trim()}var tt=/(\$\d)/;function et(t,e,n){var i=n.useInternationalFormat,r=n.withNationalPrefix,o=(n.carrierCode,n.metadata,t.replace(new RegExp(e.pattern()),i?e.internationalFormat():r&&e.nationalPrefixFormattingRule()?e.format().replace(tt,e.nationalPrefixFormattingRule()):e.format()));return i?J(o):o}var nt=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;function it(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(t);!(n=i()).done;){var r=n.value;if(r.leadingDigitsPatterns().length>0){var o=r.leadingDigitsPatterns()[r.leadingDigitsPatterns().length-1];if(0!==e.search(o))continue}if(D(e,r.pattern()))return r}}(i.formats(),t);return o?et(t,o,{useInternationalFormat:"INTERNATIONAL"===n,withNationalPrefix:!o.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!r||!1!==r.nationalPrefix,carrierCode:e,metadata:i}):t}function ct(t,e,n,i){return e?i(t,e,n):t}function ut(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function ht(t){for(var e=1;e=0}(e,t,n)})):[]);var t,e,n,i}},{key:"isPossible",value:function(){return function(t,e,n){if(void 0===e&&(e={}),n=new R(n),e.v2){if(!t.countryCallingCode)throw new Error("Invalid phone number object passed");n.selectNumberingPlan(t.countryCallingCode)}else{if(!t.phone)return!1;if(t.country){if(!n.hasCountry(t.country))throw new Error("Unknown country: ".concat(t.country));n.country(t.country)}else{if(!t.countryCallingCode)throw new Error("Invalid phone number object passed");n.selectNumberingPlan(t.countryCallingCode)}}if(n.possibleLengths())return U(t.phone||t.nationalNumber,n);if(t.countryCallingCode&&n.isNonGeographicCallingCode(t.countryCallingCode))return!0;throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}(this,{v2:!0},this.getMetadata())}},{key:"isValid",value:function(){return t=this,e={v2:!0},n=this.getMetadata(),e=e||{},(n=new R(n)).selectNumberingPlan(t.country,t.countryCallingCode),n.hasTypes()?void 0!==G(t,e,n.metadata):D(e.v2?t.nationalNumber:t.phone,n.nationalNumberPattern());var t,e,n}},{key:"isNonGeographic",value:function(){return new R(this.getMetadata()).isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(t){return this.number===t.number&&this.ext===t.ext}},{key:"getType",value:function(){return G(this,{v2:!0},this.getMetadata())}},{key:"format",value:function(t,e){return function(t,e,n,i){if(n=n?ot(ot({},at),n):at,i=new R(i),t.country&&"001"!==t.country){if(!i.hasCountry(t.country))throw new Error("Unknown country: ".concat(t.country));i.country(t.country)}else{if(!t.countryCallingCode)return t.phone||"";i.selectNumberingPlan(t.countryCallingCode)}var r,o=i.countryCallingCode(),s=n.v2?t.nationalNumber:t.phone;switch(e){case"NATIONAL":return s?ct(r=lt(s,t.carrierCode,"NATIONAL",i,n),t.ext,i,n.formatExtension):"";case"INTERNATIONAL":return s?(r=lt(s,null,"INTERNATIONAL",i,n),ct(r="+".concat(o," ").concat(r),t.ext,i,n.formatExtension)):"+".concat(o);case"E.164":return"+".concat(o).concat(s);case"RFC3966":return function(t){var e=t.number,n=t.ext;if(!e)return"";if("+"!==e[0])throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(e).concat(n?";ext="+n:"")}({number:"+".concat(o).concat(s),ext:t.ext});case"IDD":if(!n.fromCountry)return;var a=function(t,e,n,i,r){if(q(i,r.metadata)===n){var o=lt(t,e,"NATIONAL",r);return"1"===n?n+" "+o:o}var s=function(t,e,n){var i=new R(n);return i.selectNumberingPlan(t,void 0),i.defaultIDDPrefix()?i.defaultIDDPrefix():nt.test(i.IDDPrefix())?i.IDDPrefix():void 0}(i,0,r.metadata);if(s)return"".concat(s," ").concat(n," ").concat(lt(t,null,"INTERNATIONAL",r))}(s,t.carrierCode,o,n.fromCountry,i);return ct(a,t.ext,i,n.formatExtension);default:throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(e,'"'))}}(this,t,e?ht(ht({},e),{},{v2:!0}):{v2:!0},this.getMetadata())}},{key:"formatNational",value:function(t){return this.format("NATIONAL",t)}},{key:"formatInternational",value:function(t){return this.format("INTERNATIONAL",t)}},{key:"getURI",value:function(t){return this.format("RFC3966",t)}}])&&Ot(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),pt=function(t){return/^[A-Z]{2}$/.test(t)};function mt(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,i=new Array(e);n1;)1&e&&(n+=t),e>>=1,t+=t;return n+t}function St(t,e){return")"===t[e]&&e++,function(t){for(var e=[],n=0;nt.length)&&(e=t.length);for(var n=0,i=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(t.split(""));!(e=i()).done;){var r=Qt(e.value);r&&(n+=r)}return n}function _t(t,e,n){var i=n.metadata,r=n.shouldTryNationalPrefixFormattingRule,o=n.getSeparatorAfterNationalPrefix;if(new RegExp("^(?:".concat(e.pattern(),")$")).test(t.nationalSignificantNumber))return function(t,e,n){var i=n.metadata,r=n.shouldTryNationalPrefixFormattingRule,o=n.getSeparatorAfterNationalPrefix;if(t.nationalSignificantNumber,t.international,t.nationalPrefix,t.carrierCode,r(e)){var s=kt(t,e,{useNationalPrefixFormattingRule:!0,getSeparatorAfterNationalPrefix:o,metadata:i});if(s)return s}return kt(t,e,{useNationalPrefixFormattingRule:!1,getSeparatorAfterNationalPrefix:o,metadata:i})}(t,e,{metadata:i,shouldTryNationalPrefixFormattingRule:r,getSeparatorAfterNationalPrefix:o})}function kt(t,e,n){var i=n.metadata,r=n.useNationalPrefixFormattingRule,o=n.getSeparatorAfterNationalPrefix,s=et(t.nationalSignificantNumber,e,{carrierCode:t.carrierCode,useInternationalFormat:t.international,withNationalPrefix:r,metadata:i});if(r||(t.nationalPrefix?s=t.nationalPrefix+o(e)+s:t.complexPrefixBeforeNationalSignificantNumber&&(s=t.complexPrefixBeforeNationalSignificantNumber+" "+s)),function(t,e){return Pt(t)===e.getNationalDigits()}(s,t))return s}function Tt(t,e){for(var n=0;n=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Mt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:{}).allowOverflow;if(!t)throw new Error("String is required");var n=qt(t.split(""),this.matchTree,!0);if(n&&n.match&&delete n.matchedChars,!n||!n.overflow||e)return n}}],n&&Vt(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function qt(t,e,n){if("string"==typeof e){var i=t.join("");return 0===e.indexOf(i)?t.length===e.length?{match:!0,matchedChars:t}:{partialMatch:!0}:0===i.indexOf(e)?n&&t.length>e.length?{overflow:!0}:{match:!0,matchedChars:t.slice(0,e.length)}:void 0}if(Array.isArray(e)){for(var r=t.slice(),o=0;o=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function jt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n=0)){var n=this.getTemplateForFormat(t,e);return n?(this.setNationalNumberTemplate(n,e),!0):void 0}}},{key:"getSeparatorAfterNationalPrefix",value:function(t){return this.isNANP||t&&t.nationalPrefixFormattingRule()&&Nt.test(t.nationalPrefixFormattingRule())?" ":""}},{key:"getInternationalPrefixBeforeCountryCallingCode",value:function(t,e){var n=t.IDDPrefix,i=t.missingPlus;return n?e&&!1===e.spacing?n:n+" ":i?"":"+"}},{key:"getTemplate",value:function(t){if(this.template){for(var e=-1,n=0,i=t.international?this.getInternationalPrefixBeforeCountryCallingCode(t,{spacing:!1}):"";na.length)){var l=new RegExp("^"+s+"$"),c=n.replace(/\d/g,"9");l.test(c)&&(a=c);var u,h=this.getFormatFormat(t,i);if(this.shouldTryNationalPrefixFormattingRule(t,{international:i,nationalPrefix:r})){var d=h.replace(tt,t.nationalPrefixFormattingRule());if(Pt(t.nationalPrefixFormattingRule())===(r||"")+Pt("$1")&&(h=d,u=!0,r))for(var O=r.length;O>0;)h=h.replace(/\d/,$t),O--}var f=a.replace(new RegExp(s),h).replace(new RegExp("9","g"),$t);return u||(o?f=bt($t,o.length)+" "+f:r&&(f=bt($t,r.length)+this.getSeparatorAfterNationalPrefix(t)+f)),i&&(f=J(f)),f}}},{key:"formatNextNationalNumberDigits",value:function(t){var e=function(t,e,n){for(var i,r=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return yt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?yt(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(n.split(""));!(i=r()).done;){var o=i.value;if(t.slice(e+1).search(vt)<0)return;e=t.search(vt),t=t.replace(vt,o)}return[t,e]}(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition,t);if(e)return this.populatedNationalNumberTemplate=e[0],this.populatedNationalNumberTemplatePosition=e[1],St(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition+1);this.resetFormat()}},{key:"shouldTryNationalPrefixFormattingRule",value:function(t,e){var n=e.international,i=e.nationalPrefix;if(t.nationalPrefixFormattingRule()){var r=t.usesNationalPrefix();if(r&&i||!r&&!n)return!0}}}])&&It(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Yt=new RegExp("(["+H+"])");function Bt(t,e,n,i){if(e){var r=new R(i);r.selectNumberingPlan(e,n);var o=new RegExp(r.IDDPrefix());if(0===t.search(o)){var s=(t=t.slice(t.match(o)[0].length)).match(Yt);if(!(s&&null!=s[1]&&s[1].length>0&&"0"===s[1]))return t}}}function Gt(t,e){if(t&&e.numberingPlan.nationalPrefixForParsing()){var n=new RegExp("^(?:"+e.numberingPlan.nationalPrefixForParsing()+")"),i=n.exec(t);if(i){var r,o,s,a=i.length-1,l=a>0&&i[a];if(e.nationalPrefixTransformRule()&&l)r=t.replace(n,e.nationalPrefixTransformRule()),a>1&&(o=i[1]);else{var c=i[0];r=t.slice(c.length),l&&(o=i[1])}if(l){var u=t.indexOf(i[1]);t.slice(0,u)===e.numberingPlan.nationalPrefix()&&(s=e.numberingPlan.nationalPrefix())}else s=i[0];return{nationalNumber:r,nationalPrefix:s,carrierCode:o}}}return{nationalNumber:t}}function Ft(t,e){var n=Gt(t,e),i=n.carrierCode,r=n.nationalNumber;if(r!==t){if(!function(t,e,n){return!(D(t,n.nationalNumberPattern())&&!D(e,n.nationalNumberPattern()))}(t,r,e))return{nationalNumber:t};if(e.possibleLengths()&&!function(t,e){switch(L(t,e)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}(r,e))return{nationalNumber:t}}return{nationalNumber:r,carrierCode:i}}function Ht(t,e,n,i){var r=e?q(e,i):n;if(0===t.indexOf(r)){(i=new R(i)).selectNumberingPlan(e,n);var o=t.slice(r.length),s=Ft(o,i).nationalNumber,a=Ft(t,i).nationalNumber;if(!D(a,i.nationalNumberPattern())&&D(s,i.nationalNumberPattern())||"TOO_LONG"===L(a,i))return{countryCallingCode:r,number:o}}return{number:t}}function Kt(t,e,n,i){if(!t)return{};var r;if("+"!==t[0]){var o=Bt(t,e,n,i);if(!o||o===t){if(e||n){var s=Ht(t,e,n,i),a=s.countryCallingCode,l=s.number;if(a)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:a,number:l}}return{number:t}}r=!0,t="+"+o}if("0"===t[1])return{};i=new R(i);for(var c=2;c-1<=3&&c<=t.length;){var u=t.slice(1,c);if(i.hasCallingCode(u))return i.selectNumberingPlan(u),{countryCallingCodeSource:r?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:u,number:t.slice(c)};c++}return{}}function Jt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,o=[],_n=!0,s=!1;try{for(n=n.call(t);!(_n=(i=n.next()).done)&&(o.push(i.value),!e||o.length!==e);_n=!0);}catch(t){s=!0,r=t}finally{try{_n||null==n.return||n.return()}finally{if(s)throw r}}return o}}(t,e)||function(t,e){if(t){if("string"==typeof t)return te(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?te(t,e):void 0}}(t,e)||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 te(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n=3;if(e.appendDigits(t),i&&this.extractIddPrefix(e),this.isWaitingForCountryCallingCode(e)){if(!this.extractCountryCallingCode(e))return}else e.appendNationalSignificantNumberDigits(t);e.international||this.hasExtractedNationalSignificantNumber||this.extractNationalSignificantNumber(e.getNationalDigits(),(function(t){return e.update(t)}))}},{key:"isWaitingForCountryCallingCode",value:function(t){var e=t.international,n=t.callingCode;return e&&!n}},{key:"extractCountryCallingCode",value:function(t){var e=Kt("+"+t.getDigitsWithoutInternationalPrefix(),this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),n=e.countryCallingCode,i=e.number;if(n)return t.setCallingCode(n),t.update({nationalSignificantNumber:i}),!0}},{key:"reset",value:function(t){if(t){this.hasSelectedNumberingPlan=!0;var e=t._nationalPrefixForParsing();this.couldPossiblyExtractAnotherNationalSignificantNumber=e&&oe.test(e)}else this.hasSelectedNumberingPlan=void 0,this.couldPossiblyExtractAnotherNationalSignificantNumber=void 0}},{key:"extractNationalSignificantNumber",value:function(t,e){if(this.hasSelectedNumberingPlan){var n=Gt(t,this.metadata),i=n.nationalPrefix,r=n.nationalNumber,o=n.carrierCode;if(r!==t)return this.onExtractedNationalNumber(i,o,r,t,e),!0}}},{key:"extractAnotherNationalSignificantNumber",value:function(t,e,n){if(!this.hasExtractedNationalSignificantNumber)return this.extractNationalSignificantNumber(t,n);if(this.couldPossiblyExtractAnotherNationalSignificantNumber){var i=Gt(t,this.metadata),r=i.nationalPrefix,o=i.nationalNumber,s=i.carrierCode;if(o!==e)return this.onExtractedNationalNumber(r,s,o,t,n),!0}}},{key:"onExtractedNationalNumber",value:function(t,e,n,i,r){var o,s,a=i.lastIndexOf(n);if(a>=0&&a===i.length-n.length){s=!0;var l=i.slice(0,a);l!==t&&(o=l)}r({nationalPrefix:t,carrierCode:e,nationalSignificantNumber:n,nationalSignificantNumberMatchesInput:s,complexPrefixBeforeNationalSignificantNumber:o}),this.hasExtractedNationalSignificantNumber=!0,this.onNationalSignificantNumberChange()}},{key:"reExtractNationalSignificantNumber",value:function(t){return!!this.extractAnotherNationalSignificantNumber(t.getNationalDigits(),t.nationalSignificantNumber,(function(e){return t.update(e)}))||(this.extractIddPrefix(t)||this.fixMissingPlus(t)?(this.extractCallingCodeAndNationalSignificantNumber(t),!0):void 0)}},{key:"extractIddPrefix",value:function(t){var e=t.international,n=t.IDDPrefix,i=t.digits;if(t.nationalSignificantNumber,!e&&!n){var r=Bt(i,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata);return void 0!==r&&r!==i?(t.update({IDDPrefix:i.slice(0,i.length-r.length)}),this.startInternationalNumber(t,{country:void 0,callingCode:void 0}),!0):void 0}}},{key:"fixMissingPlus",value:function(t){if(!t.international){var e=Ht(t.digits,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),n=e.countryCallingCode;if(e.number,n)return t.update({missingPlus:!0}),this.startInternationalNumber(t,{country:t.country,callingCode:n}),!0}}},{key:"startInternationalNumber",value:function(t,e){var n=e.country,i=e.callingCode;t.startInternationalNumber(n,i),t.nationalSignificantNumber&&(t.resetNationalSignificantNumber(),this.onNationalSignificantNumberChange(),this.hasExtractedNationalSignificantNumber=void 0)}},{key:"extractCallingCodeAndNationalSignificantNumber",value:function(t){this.extractCountryCallingCode(t)&&this.extractNationalSignificantNumber(t.getNationalDigits(),(function(e){return t.update(e)}))}}])&&ee(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ae(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(n);!(r=o()).done;){var s=r.value;if(i.country(s),i.leadingDigits()){if(t&&0===t.search(i.leadingDigits()))return s}else if(G({phone:t,country:s},void 0,i.metadata))return s}}function ce(t,e){var n=e.nationalNumber,i=e.defaultCountry,r=e.metadata,o=r.getCountryCodesForCallingCode(t);if(o)return 1===o.length?o[0]:le(n,{countries:o,defaultCountry:i,metadata:r.metadata})}function ue(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n1}},{key:"determineTheCountry",value:function(){this.state.setCountry(ce(this.isInternational()?this.state.callingCode:this.defaultCallingCode,{nationalNumber:this.state.nationalSignificantNumber,defaultCountry:this.defaultCountry,metadata:this.metadata}))}},{key:"getNumberValue",value:function(){var t=this.state,e=t.digits,n=t.callingCode,i=t.country,r=t.nationalSignificantNumber;if(e)return this.isInternational()?n?"+"+n+r:"+"+e:i||n?"+"+(i?this.metadata.countryCallingCode():n)+r:void 0}},{key:"getNumber",value:function(){var t=this.state,e=t.nationalSignificantNumber,n=t.carrierCode,i=t.callingCode,r=this._getCountry();if(e&&(r||i)){if(r&&r===this.defaultCountry){var o=new R(this.metadata.metadata);o.selectNumberingPlan(r);var s=o.numberingPlan.callingCode(),a=this.metadata.getCountryCodesForCallingCode(s);if(a.length>1){var l=le(e,{countries:a,defaultCountry:this.defaultCountry,metadata:this.metadata.metadata});l&&(r=l)}}var c=new ft(r||i,e,this.metadata.metadata);return n&&(c.carrierCode=n),c}}},{key:"isPossible",value:function(){var t=this.getNumber();return!!t&&t.isPossible()}},{key:"isValid",value:function(){var t=this.getNumber();return!!t&&t.isValid()}},{key:"getNationalNumber",value:function(){return this.state.nationalSignificantNumber}},{key:"getChars",value:function(){return(this.state.international?"+":"")+this.state.digits}},{key:"getTemplate",value:function(){return this.formatter.getTemplate(this.state)||this.getNonFormattedTemplate()||""}}])&&he(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Oe(t){var e=t.inputFormat,n=t.country,i=t.metadata;return"NATIONAL_PART_OF_INTERNATIONAL"===e?"+".concat(q(n,i)):""}function fe(t,e){return e&&" "===(t=t.slice(e.length))[0]&&(t=t.slice(1)),t}function pe(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(t.split(""));!(e=i()).done;)n+=ge(e.value,n)||"";return n}function ge(t,e,n){return"+"===t?e?void("function"==typeof n&&n("end")):"+":Qt(t)}function ye(t,e,n){if(!n||!n.ignoreRest)return ge(t,e,(function(t){n&&"end"===t&&(n.ignoreRest=!0)}))}function $e(t){var e=t.onKeyDown,n=t.inputFormat;return(0,i.useCallback)((function(t){t.keyCode===ve&&"INTERNATIONAL"===n&&t.target instanceof HTMLInputElement&&t.target.selectionStart===be.length?t.preventDefault():e&&e(t)}),[e,n])}var ve=8,be="+",Se=["onKeyDown","country","inputFormat","metadata","international","withCountryCallingCode"];function we(){return we=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0||(r[n]=t[n]);return r}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}(t,Se)),c=(0,i.useCallback)((function(t){var e=new de(r,a),n=Oe({inputFormat:o,country:r,metadata:a}),i=e.input(n+t),s=e.getTemplate();return n&&(i=fe(i,n),s&&(s=fe(s,n))),{text:i,template:s}}),[r,a]),u=$e({onKeyDown:n,inputFormat:o});return i.createElement(b,we({},l,{ref:e,parse:ye,format:c,onKeyDown:u}))}return(t=i.forwardRef(t)).propTypes={value:s.string.isRequired,onChange:s.func.isRequired,onKeyDown:s.func,country:s.string,inputFormat:s.oneOf(["INTERNATIONAL","NATIONAL_PART_OF_INTERNATIONAL","NATIONAL","INTERNATIONAL_OR_NATIONAL"]).isRequired,metadata:s.object},t}();var Qe=["value","onChange","onKeyDown","country","inputFormat","metadata","inputComponent","international","withCountryCallingCode"];function Pe(){return Pe=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0||(r[n]=t[n]);return r}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}(t,Qe)),O=Oe({inputFormat:a,country:s,metadata:c}),f=(0,i.useCallback)((function(t){var e=me(t.target.value);e===n&&0===ke(O,e,s,c).indexOf(t.target.value)&&(e=e.slice(0,-1)),r(e)}),[O,n,r,s,c]),p=$e({onKeyDown:o,inputFormat:a});return i.createElement(h,Pe({},d,{ref:e,value:ke(O,n,s,c),onChange:f,onKeyDown:p}))}return(t=i.forwardRef(t)).propTypes={value:s.string.isRequired,onChange:s.func.isRequired,onKeyDown:s.func,country:s.string,inputFormat:s.oneOf(["INTERNATIONAL","NATIONAL_PART_OF_INTERNATIONAL","NATIONAL","INTERNATIONAL_OR_NATIONAL"]).isRequired,metadata:s.object,inputComponent:s.elementType},t}();function ke(t,e,n,i){return fe(function(t,e,n){return n||(n=e,e=void 0),new de(e,n).input(t)}(t+e,n,i),t)}function Te(t){return String.fromCodePoint(127397+t.toUpperCase().charCodeAt(0))}var Ce=["value","onChange","options","disabled","readOnly"],ze=["value","options","className","iconComponent","getIconAspectRatio","arrowComponent","unicodeFlags"];function Re(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n=0||(r[n]=t[n]);return r}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Ze(t){var e=t.value,n=t.onChange,r=t.options,o=t.disabled,s=t.readOnly,a=Ae(t,Ce),l=(0,i.useCallback)((function(t){var e=t.target.value;n("ZZ"===e?void 0:e)}),[n]);return(0,i.useMemo)((function(){return qe(r,e)}),[r,e]),i.createElement("select",Ee({},a,{disabled:o||s,readOnly:s,value:e||"ZZ",onChange:l}),r.map((function(t){var e=t.value,n=t.label,r=t.divider;return i.createElement("option",{key:r?"|":e||"ZZ",value:r?"|":e||"ZZ",disabled:!!r,style:r?Me:void 0},n)})))}Ze.propTypes={value:s.string,onChange:s.func.isRequired,options:s.arrayOf(s.shape({value:s.string,label:s.string,divider:s.bool})).isRequired,disabled:s.bool,readOnly:s.bool};var Me={fontSize:"1px",backgroundColor:"currentColor",color:"inherit"};function Ve(t){var e,n=t.value,r=t.options,o=t.className,s=t.iconComponent,a=(t.getIconAspectRatio,t.arrowComponent),l=void 0===a?Xe:a,u=t.unicodeFlags,h=Ae(t,ze),d=(0,i.useMemo)((function(){return qe(r,n)}),[r,n]);return i.createElement("div",{className:"PhoneInputCountry"},i.createElement(Ze,Ee({},h,{value:n,options:r,className:c("PhoneInputCountrySelect",o)})),d&&(u&&n?i.createElement("div",{className:"PhoneInputCountryIconUnicode"},Te((e=n)[0])+Te(e[1])):i.createElement(s,{"aria-hidden":!0,country:n,label:d.label,aspectRatio:u?1:void 0})),i.createElement(l,null))}function Xe(){return i.createElement("div",{className:"PhoneInputCountrySelectArrow"})}function qe(t,e){for(var n,i=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Re(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Re(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(t);!(n=i()).done;){var r=n.value;if(!r.divider&&(o=r.value,s=e,null==o?null==s:o===s))return r}var o,s}Ve.propTypes={iconComponent:s.elementType,arrowComponent:s.elementType,unicodeFlags:s.bool};var We=["country","countryName","flags","flagUrl"];function je(){return je=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0||(r[n]=t[n]);return r}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}(t,We);return r&&r[e]?r[e]({title:n}):i.createElement("img",je({},s,{alt:n,role:n?void 0:"presentation",src:o.replace("{XX}",e).replace("{xx}",e.toLowerCase())}))}Ie.propTypes={country:s.string.isRequired,countryName:s.string.isRequired,flags:s.objectOf(s.elementType),flagUrl:s.string.isRequired};var Le=["aspectRatio"],Ne=["title"],Ue=["title"];function De(){return De=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0||(r[n]=t[n]);return r}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Be(t){var e=t.aspectRatio,n=Ye(t,Le);return 1===e?i.createElement(Fe,n):i.createElement(Ge,n)}function Ge(t){var e=t.title,n=Ye(t,Ne);return i.createElement("svg",De({},n,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 75 50"}),i.createElement("title",null,e),i.createElement("g",{className:"PhoneInputInternationalIconGlobe",stroke:"currentColor",fill:"none",strokeWidth:"2",strokeMiterlimit:"10"},i.createElement("path",{strokeLinecap:"round",d:"M47.2,36.1C48.1,36,49,36,50,36c7.4,0,14,1.7,18.5,4.3"}),i.createElement("path",{d:"M68.6,9.6C64.2,12.3,57.5,14,50,14c-7.4,0-14-1.7-18.5-4.3"}),i.createElement("line",{x1:"26",y1:"25",x2:"74",y2:"25"}),i.createElement("line",{x1:"50",y1:"1",x2:"50",y2:"49"}),i.createElement("path",{strokeLinecap:"round",d:"M46.3,48.7c1.2,0.2,2.5,0.3,3.7,0.3c13.3,0,24-10.7,24-24S63.3,1,50,1S26,11.7,26,25c0,2,0.3,3.9,0.7,5.8"}),i.createElement("path",{strokeLinecap:"round",d:"M46.8,48.2c1,0.6,2.1,0.8,3.2,0.8c6.6,0,12-10.7,12-24S56.6,1,50,1S38,11.7,38,25c0,1.4,0.1,2.7,0.2,4c0,0.1,0,0.2,0,0.2"})),i.createElement("path",{className:"PhoneInputInternationalIconPhone",stroke:"none",fill:"currentColor",d:"M12.4,17.9c2.9-2.9,5.4-4.8,0.3-11.2S4.1,5.2,1.3,8.1C-2,11.4,1.1,23.5,13.1,35.6s24.3,15.2,27.5,11.9c2.8-2.8,7.8-6.3,1.4-11.5s-8.3-2.6-11.2,0.3c-2,2-7.2-2.2-11.7-6.7S10.4,19.9,12.4,17.9z"}))}function Fe(t){var e=t.title,n=Ye(t,Ue);return i.createElement("svg",De({},n,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 50 50"}),i.createElement("title",null,e),i.createElement("g",{className:"PhoneInputInternationalIconGlobe",stroke:"currentColor",fill:"none",strokeWidth:"2",strokeLinecap:"round"},i.createElement("path",{d:"M8.45,13A21.44,21.44,0,1,1,37.08,41.56"}),i.createElement("path",{d:"M19.36,35.47a36.9,36.9,0,0,1-2.28-13.24C17.08,10.39,21.88.85,27.8.85s10.72,9.54,10.72,21.38c0,6.48-1.44,12.28-3.71,16.21"}),i.createElement("path",{d:"M17.41,33.4A39,39,0,0,1,27.8,32.06c6.62,0,12.55,1.5,16.48,3.86"}),i.createElement("path",{d:"M44.29,8.53c-3.93,2.37-9.86,3.88-16.49,3.88S15.25,10.9,11.31,8.54"}),i.createElement("line",{x1:"27.8",y1:"0.85",x2:"27.8",y2:"34.61"}),i.createElement("line",{x1:"15.2",y1:"22.23",x2:"49.15",y2:"22.23"})),i.createElement("path",{className:"PhoneInputInternationalIconPhone",stroke:"transparent",fill:"currentColor",d:"M9.42,26.64c2.22-2.22,4.15-3.59.22-8.49S3.08,17,.93,19.17c-2.49,2.48-.13,11.74,9,20.89s18.41,11.5,20.89,9c2.15-2.15,5.91-4.77,1-8.71s-6.27-2-8.49.22c-1.55,1.55-5.48-1.69-8.86-5.08S7.87,28.19,9.42,26.64Z"}))}function He(t){(function(t){if(t.length<2)return!1;if("+"!==t[0])return!1;for(var e=1;e=48&&n<=57))return!1;e++}return!0})(t)||console.error("[react-phone-number-input] Expected the initial `value` to be a E.164 phone number. Got",t)}function Ke(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n=0||(r[n]=t[n]);return r}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}(t,nn),h=o===Be?l:void 0;return i.createElement("div",rn({},u,{className:c("PhoneInputCountryIcon",{"PhoneInputCountryIcon--square":1===h,"PhoneInputCountryIcon--border":s})}),s?i.createElement(r,{country:s,countryName:a,flags:e,flagUrl:n,className:"PhoneInputCountryIconImg"}):i.createElement(o,{title:a,aspectRatio:h,className:"PhoneInputCountryIconImg"}))}return a.propTypes={country:s.string,label:s.string.isRequired,aspectRatio:s.number},a}function sn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(t);!(n=i()).done;){var r=n.value;r&&ln(r,e)}}function ln(t,e){"function"==typeof t?t(e):t.current=e}function cn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function un(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function hn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n=t.length)return"";var i=t.indexOf(";",n);return i>=0?t.substring(n,i):t.substring(n)}(t);if(!function(t){return null===t||0!==t.length&&(zn.test(t)||Rn.test(t))}(r))throw new vn("NOT_A_NUMBER");if(null===r)n=i(t)||"";else{n="","+"===r.charAt(0)&&(n+=r);var o,s=t.indexOf("tel:");o=s>=0?s+4:0;var a=t.indexOf(En);n+=t.substring(o,a)}var l=n.indexOf(";isub=");if(l>0&&(n=n.substring(0,l)),""!==n)return n}(t,{extractFormattedPhoneNumber:function(t){return function(t,e,n){if(t)if(t.length>250){if(n)throw new vn("TOO_LONG")}else{if(!1===e)return t;var i=t.search(An);if(!(i<0))return t.slice(i).replace(Zn,"")}}(t,n,e)}});if(!i)return{};if(!function(t){return t.length>=2&&kn.test(t)}(i))return function(t){return Qn.test(t)}(i)?{error:"TOO_SHORT"}:{};var r=function(t){var e=t.search(Tn);if(e<0)return{};for(var n=t.slice(0,e),i=t.match(Tn),r=1;r17){if(e.v2)throw new vn("TOO_LONG");return{}}if(e.v2){var O=new ft(u,c,n.metadata);return l&&(O.country=l),d&&(O.carrierCode=d),o&&(O.ext=o),O.__countryCallingCodeSource=h,O}var f=!!(e.extended?n.hasSelectedNumberingPlan():l)&&D(c,n.nationalNumberPattern());return e.extended?{country:l,countryCallingCode:u,carrierCode:d,valid:f,possible:!!f||!(!0!==e.extended||!n.possibleLengths()||!U(c,n)),phone:c,ext:o}:f?function(t,e,n){var i={country:t,phone:e};return n&&(i.ext=n),i}(l,c,o):{}}function Vn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function Xn(t){for(var e=1;e=0?l:void 0;if(n)if(Fn(t,n,a)){if(o&&Fn(t,o,a))return o;if(r&&Fn(t,r,a))return r;if(!s)return}else if(!s)return;return n}function Yn(t,e,n){if(0===t.indexOf(Ln(e,n))){var i=new de(e,n);i.input(t);var r=i.getNumber();return r?r.formatNational().replace(/\D/g,""):""}return t.replace(/\D/g,"")}function Bn(t,e,n){return String.prototype.localeCompare?t.localeCompare(e,n):te?1:0}function Gn(t,e,n){var i=new de(e,n);i.input(t);var r=i.getNumber();return r&&r.nationalNumber}function Fn(t,e,n){for(var i=Ln(e,n),r=0;r0)return t.slice(0,t.length-r)}return t}(t,r,d)),!t||"+"===t[0]||r&&!u||(t="+"+t),!t&&i&&"+"===i[0]&&(r=u?void 0:o),"+"===t&&i&&"+"===i[0]&&i.length>1&&(r=void 0),t&&(n="+"===t[0]&&("+"===t||r&&0===Ln(r,d).indexOf(t))?void 0:Un(t,r,d)),n&&(r=Dn(n,{country:r,countries:c,defaultCountry:o,latestCountrySelectedByUser:s,required:!1,metadata:d}),!1===u&&r&&t&&"+"===t[0]&&(n=Un(t=Yn(t,r,d),r,d))),!r&&a&&(r=o||l()),{phoneDigits:t,country:r,value:n}}(t,{prevPhoneDigits:d,country:O,countryRequired:!o,defaultCountry:i,latestCountrySelectedByUser:f,getAnyCountry:function(){return n.getFirstSupportedCountry({countries:h})},countries:h,international:s,limitMaxLength:a,countryCallingCodeEditable:l,metadata:c}),m=p.phoneDigits,g=p.country,y=p.value,$={phoneDigits:m,value:y,country:g};f&&y&&!Fn(y,f,c)&&($.latestCountrySelectedByUser=void 0),!1===l&&(y||m!==n.state.phoneDigits||($.forceRerender={})),n.setState($,(function(){return r(y)}))})),hi(n,"_onFocus",(function(){return n.setState({isFocused:!0})})),hi(n,"_onBlur",(function(){return n.setState({isFocused:!1})})),hi(n,"onFocus",(function(t){n._onFocus();var e=n.props.onFocus;e&&e(t)})),hi(n,"onBlur",(function(t){var e=n.props.onBlur;n._onBlur(),e&&e(t)})),hi(n,"onCountryFocus",(function(t){n._onFocus();var e=n.props.countrySelectProps;if(e){var i=e.onFocus;i&&i(t)}})),hi(n,"onCountryBlur",(function(t){n._onBlur();var e=n.props.countrySelectProps;if(e){var i=e.onBlur;i&&i(t)}})),n.inputRef=i.createRef();var a=n.props,l=a.value,c=(a.labels,a.international),u=a.addInternationalOption,h=a.displayInitialValueAsLocalNumber,d=a.initialValueFormat,O=a.metadata,f=n.props,p=f.defaultCountry,m=f.countries;p&&(n.isCountrySupportedWithError(p)||(p=void 0)),l&&He(l),m=tn(m,O);var g=Nn(l,O);n.CountryIcon=on(n.props);var y=function(t){var e,n=t.value,i=t.phoneNumber,r=t.defaultCountry,o=t.getAnyCountry,s=t.countries,a=t.required,l=t.metadata;return i&&i.country?e=i.country:r&&(n&&!Fn(n,r,l)||(e=r)),s&&s.indexOf(e)<0&&(e=void 0),!e&&a&&s&&s.length>0&&(e=o()),e}({value:l,phoneNumber:g,defaultCountry:p,required:!u,countries:m||en(O),getAnyCountry:function(){return n.getFirstSupportedCountry({countries:m})},metadata:O});return n.state={props:n.props,country:y,countries:m,phoneDigits:Hn({value:l,phoneNumber:g,defaultCountry:p,international:c,useNationalFormat:h||"national"===d,metadata:O}),value:l},n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ui(t,e)}(e,t),n=e,r=[{key:"componentDidMount",value:function(){var t=this.props.onCountryChange,e=this.props.defaultCountry,n=this.state.country;t&&(e&&(this.isCountrySupportedWithError(e)||(e=void 0)),n!==e&&t(n))}},{key:"componentDidUpdate",value:function(t,e){var n=this.props.onCountryChange,i=this.state.country;n&&i!==e.country&&n(i)}},{key:"getCountrySelectOptions",value:function(t){var e=t.countries,n=this.props,i=n.international,r=n.countryCallingCodeEditable,o=n.countryOptionsOrder,s=n.addInternationalOption,a=n.labels,l=n.locales,c=n.metadata;return this.useMemoCountrySelectOptions((function(){return function(t,e){if(!e)return t;for(var n,i=[],r=[],o=i,s=function(){var e=n.value;if("|"===e)o.push({divider:!0});else if("..."===e||"…"===e)o=r;else{var i;i="🌐"===e?void 0:e;var s=t.indexOf(t.filter((function(t){return t.value===i}))[0]),a=t[s];t.splice(s,1),o.push(a)}},a=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Ke(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ke(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e);!(n=a()).done;)s();return i.concat(t).concat(r)}(function(t){var e=t.countryNames,n=t.addInternationalOption,i=t.compareStringsLocales,r=t.compareStrings;r||(r=Bn);var o=t.countries.map((function(t){return{value:t,label:e[t]||t}}));return o.sort((function(t,e){return r(t.label,e.label,i)})),n&&o.unshift({label:e.ZZ}),o}({countries:e||en(c),countryNames:a,addInternationalOption:(!i||!1!==r)&&s,compareStringsLocales:l}),function(t,e){if(t&&(t=t.filter((function(t){switch(t){case"🌐":case"|":case"...":case"…":return!0;default:return Je(t,e)}}))).length>0)return t}(o,c))}),[e,o,s,a,c])}},{key:"useMemoCountrySelectOptions",value:function(t,e){return this.countrySelectOptionsMemoDependencies&&function(t,e){if(t.length!==e.length)return!1;for(var n=0;n=0||(r[n]=t[n]);return r}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}(t,ni)),v=this.state,b=v.country,S=v.countries,w=v.phoneDigits,x=v.isFocused,Q=h?xe:_e,P=this.getCountrySelectOptions({countries:S});return i.createElement(f,si({style:s,className:c(a,"PhoneInput",{"PhoneInput--focus":x,"PhoneInput--disabled":n,"PhoneInput--readOnly":r})},p),i.createElement(d,si({name:e?"".concat(e,"Country"):void 0,"aria-label":m.country},O,{value:b,options:P,onChange:this.onCountryChange,onFocus:this.onCountryFocus,onBlur:this.onCountryBlur,disabled:n||O&&O.disabled,readOnly:r||O&&O.readOnly,iconComponent:this.CountryIcon})),i.createElement(Q,si({ref:this.setInputRef,type:"tel",autoComplete:o},u,$,{inputFormat:!0===y?"INTERNATIONAL":!1===y?"NATIONAL":"INTERNATIONAL_OR_NATIONAL",international:!!y||void 0,withCountryCallingCode:!!y||void 0,name:e,metadata:g,country:b,value:w||"",onChange:this.onChange,onFocus:this.onFocus,onBlur:this.onBlur,disabled:n,readOnly:r,inputComponent:l,className:c("PhoneInputInput",u&&u.className,$.className)})))}}],o=[{key:"getDerivedStateFromProps",value:function(t,e){return oi({props:t},function(t,e,n){var i=t.metadata,r=t.countries,o=t.defaultCountry,s=t.value,a=t.reset,l=t.international,c=t.displayInitialValueAsLocalNumber,u=t.initialValueFormat,h=e.defaultCountry,d=e.value,O=e.reset,f=(n.country,n.value),p=n.hasUserSelectedACountry,m=n.latestCountrySelectedByUser,g=function(t){return Hn(ti(ti({},t),{},{international:l,useNationalFormat:c||"national"===u,metadata:i}))};if(a!==O)return{phoneDigits:g({value:void 0,defaultCountry:o}),value:void 0,country:o,latestCountrySelectedByUser:void 0,hasUserSelectedACountry:void 0};if(o!==h){var y=!o||Je(o,i),$=!f||l&&f===g({value:void 0,defaultCountry:h});if(!p&&y&&!s&&$)return{country:o,phoneDigits:g({value:void 0,defaultCountry:o}),value:void 0}}if(!ei(s,d)&&!ei(s,f)){var v,b,S;if(s){s&&He(s),v=Nn(s,i);var w=tn(r,i);v&&v.country?(!w||w.indexOf(v.country)>=0)&&(b=v.country):(b=Dn(s,{country:void 0,countries:w,metadata:i}))||o&&0===s.indexOf(Ln(o,i))&&(b=o)}return s?m&&((b?m===b:Fn(s,m,i))?b||(b=m):S={latestCountrySelectedByUser:void 0}):S={latestCountrySelectedByUser:void 0,hasUserSelectedACountry:void 0},ti(ti({},S),{},{phoneDigits:g({phoneNumber:v,value:s,defaultCountry:o}),value:s,country:s?b:o})}}(t,e.props,e))}}],r&&ai(n.prototype,r),o&&ai(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(i.PureComponent),fi=i.forwardRef((function(t,e){return i.createElement(Oi,si({},function(t){for(var e in t=oi({},t),pi)void 0===t[e]&&(t[e]=pi[e]);return t}(t),{inputRef:e}))}));fi.propTypes={value:s.string,onChange:s.func.isRequired,onFocus:s.func,onBlur:s.func,disabled:s.bool,readOnly:s.bool,autoComplete:s.string,initialValueFormat:s.oneOf(["national"]),displayInitialValueAsLocalNumber:s.bool,defaultCountry:s.string,countries:s.arrayOf(s.string),labels:l,locales:s.oneOfType([s.string,s.arrayOf(s.string)]),flagUrl:s.string,flags:s.objectOf(s.elementType),flagComponent:s.elementType,addInternationalOption:s.bool,internationalIcon:s.elementType,countryOptionsOrder:s.arrayOf(s.string),style:s.object,className:s.string,countrySelectComponent:s.elementType,countrySelectProps:s.object,inputComponent:s.elementType,numberInputProps:s.object,containerComponent:s.elementType,containerComponentProps:s.object,smartCaret:s.bool,international:s.bool,limitMaxLength:s.bool,countryCallingCodeEditable:s.bool,metadata:a,onCountryChange:s.func,focusInputOnCountrySelection:s.bool};var pi={autoComplete:"tel",countrySelectComponent:Ve,flagComponent:Ie,flagUrl:"https://purecatamphetamine.github.io/country-flag-icons/3x2/{XX}.svg",internationalIcon:Be,inputComponent:"input",containerComponent:"div",reset:s.any,smartCaret:!0,addInternationalOption:!0,countryCallingCodeEditable:!0,focusInputOnCountrySelection:!0};const mi=fi;var gi=["metadata","labels"];function yi(){return yi=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0||(r[n]=t[n]);return r}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}(e,gi);return i.createElement(mi,yi({},c,{ref:n,metadata:s,labels:l}))}));return e.propTypes={metadata:a,labels:l},e}$i();const vi=$i({version:4,country_calling_codes:{1:["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],249:["SD"],250:["RW"],251:["ET"],252:["SO"],253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],381:["RS"],382:["ME"],383:["XK"],385:["HR"],386:["SI"],387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],688:["TV"],689:["PF"],690:["TK"],691:["FM"],692:["MH"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],880:["BD"],886:["TW"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]},countries:{AC:["247","00","(?:[01589]\\d|[46])\\d{4}",[5,6]],AD:["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]]],AE:["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],"0"],AF:["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0"],AG:["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([457]\\d{6})$|1","268$1",0,"268"],AI:["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2457]\\d{6})$|1","264$1",0,"264"],AL:["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0"],AM:["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0"],AO:["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]]],AR:["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",0,"$1 $2 $3-$4"],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 15-$3-$4",["91"],"0$1",0,"$1 $2 $3-$4"],["(\\d{3})(\\d{3})(\\d{5})","$1-$2-$3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9"],"0$1",0,"$1 $2 $3-$4"]],"0",0,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1"],AS:["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"([267]\\d{6})$|1","684$1",0,"684"],AT:["43","00","1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",[4,5,6,7,8,9,10,11,12,13],[["(\\d)(\\d{3,12})","$1 $2",["1(?:11|[2-9])"],"0$1"],["(\\d{3})(\\d{2})","$1 $2",["517"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["5[079]"],"0$1"],["(\\d{3})(\\d{3,10})","$1 $2",["(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]"],"0$1"],["(\\d{4})(\\d{3,9})","$1 $2",["[2-467]|5[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["5"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,7})","$1 $2 $3",["5"],"0$1"]],"0"],AU:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}",[5,6,7,8,9,10,12],[["(\\d{2})(\\d{3,4})","$1 $2",["16"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["14|4"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:30|[89])"]]],"0",0,"(183[12])|0",0,0,0,[["(?:(?:(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|7(?:[013-57-9]\\d|2[0-8]))\\d|3(?:(?:[0-3589]\\d|6[1-9]|7[0-35-9])\\d|4(?:[0-578]\\d|90)))\\d\\d|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4])|3\\d\\d)|(?:6[0-8]|[78]\\d)\\d{3}|9(?:[02-9]\\d{3}|1(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79])))))\\d{3}",[9]],["4(?:79[01]|83[0-389]|94[0-4])\\d{5}|4(?:[0-36]\\d|4[047-9]|5[0-25-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,["163\\d{2,6}",[5,6,7,8,9]],["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],AW:["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]]],AX:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}",[5,6,7,8,9,10,11,12],0,"0",0,0,0,0,"18",0,"00"],AZ:["994","00","365\\d{6}|(?:[124579]\\d|60|88)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[28]|2|365|46","1[28]|2|365[45]|46","1[28]|2|365(?:4|5[02])|46"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[13-9]"],"0$1"]],"0"],BA:["387","00","6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-3]|[7-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]|6[56]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6"],"0$1"]],"0"],BB:["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","246$1",0,"246"],BD:["880","00","[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{4,6})","$1-$2",["31[5-8]|[459]1"],"0$1"],["(\\d{3})(\\d{3,7})","$1-$2",["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"],"0$1"],["(\\d{4})(\\d{3,6})","$1-$2",["[13-9]|2[23]"],"0$1"],["(\\d)(\\d{7,8})","$1-$2",["2"],"0$1"]],"0"],BE:["32","00","4\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[239]|4[23]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[15-8]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4"],"0$1"]],"0"],BF:["226","00","[025-7]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[025-7]"]]]],BG:["359","00","00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",[6,7,8,9,12],[["(\\d)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["43[1-6]|70[1-9]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:70|8)0"],"0$1"],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[1-7]|7"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[48]|9[08]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"]],"0"],BH:["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[02-4679]"]]]],BI:["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]]],BJ:["229","00","[24-689]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-689]"]]]],BL:["590","00","590\\d{6}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:2[7-9]|3[3-7]|5[12]|87)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-5])\\d{4}"]]],BM:["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","441$1",0,"441"],BN:["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]]],BO:["591","00(?:1\\d)?","8001\\d{5}|(?:[2-467]\\d|50)\\d{6}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[235]|4[46]"]],["(\\d{8})","$1",["[67]"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["8"]]],"0",0,"0(1\\d)?"],BQ:["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]"],BR:["55","00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","(?:[1-46-9]\\d\\d|5(?:[0-46-9]\\d|5[0-46-9]))\\d{8}|[1-9]\\d{9}|[3589]\\d{8}|[34]\\d{7}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37)","4(?:02|37)0|[34]00"]],["(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["(?:[358]|90)0"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"],"($1)"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[16][1-9]|[2-57-9]"],"($1)"]],"0",0,"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2"],BS:["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([3-8]\\d{6})$|1","242$1",0,"242"],BT:["975","00","[17]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-68]|7[246]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|7"]]]],BW:["267","00","(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}",[7,8,10],[["(\\d{2})(\\d{5})","$1 $2",["90"]],["(\\d{3})(\\d{4})","$1 $2",["[24-6]|3[15-9]"]],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37]"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["8"]]]],BY:["375","810","(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3})","$1 $2",["800"],"8 $1"],["(\\d{3})(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"],["(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:[56]|7[467])|2[1-3]"],"8 0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-4]"],"8 0$1"],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["[89]"],"8 $1"]],"8",0,"0|80?",0,0,0,0,"8~10"],BZ:["501","00","(?:0800\\d|[2-8])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],["(\\d)(\\d{3})(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]]],CA:["1","011","(?:[2-8]\\d|90)\\d{8}|3\\d{6}",[7,10],0,"1",0,0,0,0,0,[["(?:2(?:04|[23]6|[48]9|50|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|7[39])|90[25])[2-9]\\d{6}",[10]],["",[10]],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",[10]],["900[2-9]\\d{6}",[10]],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:00|2[125-9]|33|44|66|77|88)|622)[2-9]\\d{6}",[10]],0,["310\\d{4}",[7]],0,["600[2-9]\\d{6}",[10]]]],CC:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}",[9]],["4(?:79[01]|83[0-389]|94[0-4])\\d{5}|4(?:[0-36]\\d|4[047-9]|5[0-25-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CD:["243","00","(?:(?:[189]|5\\d)\\d|2)\\d{7}|[1-68]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["5"],"0$1"]],"0"],CF:["236","00","(?:[27]\\d{3}|8776)\\d{4}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[278]"]]]],CG:["242","00","222\\d{6}|(?:0\\d|80)\\d{7}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]]]],CH:["41","00","8\\d{11}|[2-9]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]|81"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["8"],"0$1"]],"0"],CI:["225","00","[02]\\d{9}",[10],[["(\\d{2})(\\d{2})(\\d)(\\d{5})","$1 $2 $3 $4",["2"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3 $4",["0"]]]],CK:["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]]],CL:["56","(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0","12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}",[9,10,11],[["(\\d{5})(\\d{4})","$1 $2",["219","2196"],"($1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["44"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[1-36]"],"($1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9[2-9]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-9]|[1-9])"],"($1)"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{3})(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"]]]],CM:["237","00","[26]\\d{8}|88\\d{6,7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["88"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]|88"]]]],CN:["86","00|1(?:[12]\\d|79)\\d\\d00","(?:(?:1[03-689]|2\\d)\\d\\d|6)\\d{8}|1\\d{10}|[126]\\d{6}(?:\\d(?:\\d{2})?)?|86\\d{5,6}|(?:[3-579]\\d|8[0-57-9])\\d{5,9}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2[0-57-9])[19]|3(?:[157]|35|49|9[1-68])|4(?:1[124-9]|2[179]|6[47-9]|7|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:07|1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3|4[13]|5[1-5]|7[0-79]|9[0-35-9])|(?:4[35]|59|85)[1-9]","(?:10|2[0-57-9])(?:1[02]|9[56])|8078|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))1","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|80781|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))12","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|807812|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:078|1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123"],"0$1"],["(\\d{3})(\\d{5,6})","$1 $2",["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]","(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]","85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])","85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["(?:4|80)0"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|2(?:[02-57-9]|1[1-9])","10|2(?:[02-57-9]|1[1-9])","10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"],"0$1",1],["(\\d{3})(\\d{7,8})","$1 $2",["9"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[3-578]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-9]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["[12]"],"0$1",1]],"0",0,"(1(?:[12]\\d|79)\\d\\d)|0",0,0,0,0,"00"],CO:["57","00(?:4(?:[14]4|56)|[579])","60\\d{8}|(?:1\\d|[39])\\d{9}",[10,11],[["(\\d{3})(\\d{7})","$1 $2",["6|90"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["3[0-357]|91"]],["(\\d)(\\d{3})(\\d{7})","$1-$2-$3",["1"],"0$1",0,"$1 $2 $3"]],"0",0,"0([3579]|4(?:[14]4|56))?"],CR:["506","00","(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}",[8,10],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[3-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]"]]],0,0,"(19(?:0[0-2468]|1[09]|20|66|77|99))"],CU:["53","119","(?:[2-7]|8\\d\\d)\\d{7}|[2-47]\\d{6}|[34]\\d{5}",[6,7,8,10],[["(\\d{2})(\\d{4,6})","$1 $2",["2[1-4]|[34]"],"(0$1)"],["(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["[56]"],"0$1"],["(\\d{3})(\\d{7})","$1 $2",["8"],"0$1"]],"0"],CV:["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]]],CW:["599","00","(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[3467]"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["9[4-8]"]]],0,0,0,0,0,"[69]"],CX:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}",[9]],["4(?:79[01]|83[0-389]|94[0-4])\\d{5}|4(?:[0-36]\\d|4[047-9]|5[0-25-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CY:["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]]],CZ:["420","00","(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",[9,10,11,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["96"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]]],DE:["49","00","[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}",[4,5,6,7,8,9,10,11,12,13,14,15],[["(\\d{2})(\\d{3,13})","$1 $2",["3[02]|40|[68]9"],"0$1"],["(\\d{3})(\\d{3,12})","$1 $2",["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],"0$1"],["(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["138"],"0$1"],["(\\d{5})(\\d{2,10})","$1 $2",["3"],"0$1"],["(\\d{3})(\\d{5,11})","$1 $2",["181"],"0$1"],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["1(?:3|80)|9"],"0$1"],["(\\d{3})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],["(\\d{3})(\\d{7,12})","$1 $2",["8"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["18[68]"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["15[1279]"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["15[03568]","15(?:[0568]|31)"],"0$1"],["(\\d{3})(\\d{8})","$1 $2",["18"],"0$1"],["(\\d{3})(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"],["(\\d{4})(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],["(\\d{3})(\\d{2})(\\d{8})","$1 $2 $3",["15"],"0$1"]],"0"],DJ:["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]]],DK:["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]]],DM:["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","767$1",0,"767"],DO:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9"],DZ:["213","00","(?:[1-4]|[5-79]\\d|80)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1"]],"0"],EC:["593","00","1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",[8,9,10,11],[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[2-7]"],"(0$1)",0,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{3})(\\d{3,4})","$1 $2 $3",["1"]]],"0"],EE:["372","00","8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]],["(\\d{4})(\\d{3,4})","$1 $2",["[45]|8(?:00|[1-49])","[45]|8(?:00[1-9]|[1-49])"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],EG:["20","00","[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",[8,9,10],[["(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],["(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|8[2468]|9[235-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{8})","$1 $2",["1"],"0$1"]],"0"],EH:["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,"528[89]"],ER:["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0"],ES:["34","00","[5-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-9]"]]]],ET:["251","00","(?:11|[2-579]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-579]"],"0$1"]],"0"],FI:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",[5,6,7,8,9,10,11,12],[["(\\d{5})","$1",["20[2-59]"],"0$1"],["(\\d{3})(\\d{3,7})","$1 $2",["(?:[1-3]0|[68])0|70[07-9]"],"0$1"],["(\\d{2})(\\d{4,8})","$1 $2",["[14]|2[09]|50|7[135]"],"0$1"],["(\\d{2})(\\d{6,10})","$1 $2",["7"],"0$1"],["(\\d)(\\d{4,9})","$1 $2",["(?:1[49]|[2568])[1-8]|3(?:0[1-9]|[1-9])|9"],"0$1"]],"0",0,0,0,0,"1[03-79]|[2-9]",0,"00"],FJ:["679","0(?:0|52)","45\\d{5}|(?:0800\\d|[235-9])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|45"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],0,0,0,0,0,0,0,"00"],FK:["500","00","[2-7]\\d{4}",[5]],FM:["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]]],FO:["298","00","[2-9]\\d{5}",[6],[["(\\d{6})","$1",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))"],FR:["33","00","[1-9]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"]],"0"],GA:["241","00","(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}",[7,8],[["(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["11|[67]"],"0$1"]],0,0,"0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})","$1"],GB:["44","00","[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",[7,9,10],[["(\\d{3})(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["845","8454","84546","845464"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["800"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:(?:38|69)7|5(?:24|39)|768|946)","1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["1(?:[2-69][02-9]|[78])"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[25]|7(?:0|6[02-9])","[25]|7(?:0|6(?:[03-9]|2[356]))"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[1389]"],"0$1"]],"0",0,0,0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0-35])|4(?:(?:[0-5]\\d|70)\\d|69[7-9])|(?:(?:5[0-26-9]|[78][0-49])\\d|6(?:[0-4]\\d|50))\\d)|(?:2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d|1(?:[0-7]\\d|8[0-3]))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d)\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}",[9,10]],["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]],0," x"],GD:["1","011","(?:473|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","473$1",0,"473"],GE:["995","00","(?:[3-57]\\d\\d|800)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["32"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[57]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"]],"0"],GF:["594","00","[56]94\\d{6}|(?:80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[56]|9[47]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[89]"],"0$1"]],"0"],GG:["44","00","(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?",[7,9,10],0,"0",0,"([25-9]\\d{5})$|0","1481$1",0,0,[["1481[25-9]\\d{5}",[10]],["7(?:(?:781|839)\\d|911[17])\\d{5}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]]],GH:["233","00","(?:[235]\\d{3}|800)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[235]"],"0$1"]],"0"],GI:["350","00","(?:[25]\\d|60)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]]],GL:["299","00","(?:19|[2-689]\\d|70)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-9]"]]]],GM:["220","00","[2-9]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],GN:["224","00","722\\d{6}|(?:3|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]]],GP:["590","00","590\\d{6}|(?:69|80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["590(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1-9]|5[3-579]|[68][0-689]|7[08]|9\\d)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-5])\\d{4}"]]],GQ:["240","00","222\\d{6}|(?:3\\d|55|[89]0)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],["(\\d{3})(\\d{6})","$1 $2",["[89]"]]]],GR:["30","00","5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}",[10,11,12],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],["(\\d{4})(\\d{6})","$1 $2",["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2689]"]],["(\\d{3})(\\d{3,4})(\\d{5})","$1 $2 $3",["8"]]]],GT:["502","00","80\\d{6}|(?:1\\d{3}|[2-7])\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1 $2",["[2-8]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],GU:["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","671$1",0,"671"],GW:["245","00","[49]\\d{8}|4\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["40"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"]]]],GY:["592","001","(?:[2-8]\\d{3}|9008)\\d{3}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],HK:["852","00(?:30|5[09]|[126-9]?)","8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}",[5,6,7,8,9,11],[["(\\d{3})(\\d{2,5})","$1 $2",["900","9003"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{3})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,0,"00"],HN:["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]]],HR:["385","00","(?:[24-69]\\d|3[0-79])\\d{7}|80\\d{5,7}|[1-79]\\d{7}|6\\d{5,6}",[6,7,8,9],[["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["6[01]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6|7[245]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-57]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],"0"],HT:["509","00","(?:[2-489]\\d|55)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-589]"]]]],HU:["36","00","[235-7]\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"06 $1"]],"06"],ID:["62","00[89]","00[1-9]\\d{9,14}|(?:[1-36]|8\\d{5})\\d{6}|00\\d{9}|[1-9]\\d{8,10}|[2-9]\\d{7}",[7,8,9,10,11,12,13,14,15,16,17],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["15"]],["(\\d{2})(\\d{5,9})","$1 $2",["2[124]|[36]1"],"(0$1)"],["(\\d{3})(\\d{5,7})","$1 $2",["800"],"0$1"],["(\\d{3})(\\d{5,8})","$1 $2",["[2-79]"],"(0$1)"],["(\\d{3})(\\d{3,4})(\\d{3})","$1-$2-$3",["8[1-35-9]"],"0$1"],["(\\d{3})(\\d{6,8})","$1 $2",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],["(\\d{3})(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3",["8"],"0$1"]],"0"],IE:["353","00","(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],["(\\d{3})(\\d{5})","$1 $2",["[45]0"],"(0$1)"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2569]|4[1-69]|7[14]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[78]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["4"],"(0$1)"],["(\\d{2})(\\d)(\\d{3})(\\d{4})","$1 $2 $3 $4",["8"],"0$1"]],"0"],IL:["972","0(?:0|1[2-9])","1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}",[7,8,9,10,11,12],[["(\\d{4})(\\d{3})","$1-$2",["125"]],["(\\d{4})(\\d{2})(\\d{2})","$1-$2-$3",["121"]],["(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1-$2-$3",["12"]],["(\\d{4})(\\d{6})","$1-$2",["159"]],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"]],["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})","$1-$2 $3-$4",["15"]]],"0"],IM:["44","00","1624\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([25-8]\\d{5})$|0","1624$1",0,"74576|(?:16|7[56])24"],IN:["91","00","(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}",[8,9,10,11,12,13],[["(\\d{8})","$1",["5(?:0|2[23]|3[03]|[67]1|88)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"],0,1],["(\\d{4})(\\d{4,5})","$1 $2",["180","1800"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["140"],0,1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79[1-7]|80[2-46]","11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])","11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"],"0$1",1],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807","1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]","1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|83)|73179|807(?:1|9[1-3])|(?:1552|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[124-6])\\d|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"],"0$1",1],["(\\d{5})(\\d{5})","$1 $2",["[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["1(?:6|8[06])","1(?:6|8[06]0)"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0"],IO:["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]]],IQ:["964","00","(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],IR:["98","00","[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}",[4,5,6,7,10],[["(\\d{4,5})","$1",["96"],"0$1"],["(\\d{2})(\\d{4,5})","$1 $2",["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"]],"0"],IS:["354","00|1(?:0(?:01|[12]0)|100)","(?:38\\d|[4-9])\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],0,0,0,0,0,0,0,"00"],IT:["39","00","0\\d{5,10}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:43|55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?",[6,7,8,9,10,11,12],[["(\\d{2})(\\d{4,6})","$1 $2",["0[26]"]],["(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]],["(\\d{4})(\\d{2,6})","$1 $2",["0(?:[13-579][2-46-8]|8[236-8])"]],["(\\d{4})(\\d{4})","$1 $2",["894"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|5"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["1(?:44|[679])|[378]|43"]],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]|14"]],["(\\d{2})(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["3"]]],0,0,0,0,0,0,[["0669[0-79]\\d{1,6}|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[1-356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}",[6,7,8,9,10,11]],["3[2-9]\\d{7,8}|(?:31|43)\\d{8}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],["3[2-8]\\d{9,10}",[11,12]],0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],JE:["44","00","1534\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([0-24-8]\\d{5})$|0","1534$1",0,0,[["1534[0-24-8]\\d{5}"],["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97\\d))\\d{5}"],["80(?:07(?:35|81)|8901)\\d{4}"],["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"],["701511\\d{4}"],0,["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"],["56\\d{8}"]]],JM:["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876"],JO:["962","00","(?:(?:[2689]|7\\d)\\d|32|53)\\d{6}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],["(\\d{3})(\\d{5,6})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["70"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],JP:["81","010","00[1-9]\\d{6,14}|[257-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}",[8,9,10,11,12,13,14,15,16,17],[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51)|9(?:80|9[16])","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["[36]|4(?:2[09]|7[01])","[36]|4(?:2(?:0|9[02-69])|7(?:0[019]|1))"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[0459]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[26-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9]|9[29])|5(?:2|3(?:[045]|9[0-8])|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|3(?:[29]|60)|49|51|6(?:[0-24]|36|5[0-3589]|7[23]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3(?:[045]|9(?:[0-58]|6[4-9]|7[0-35689]))|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|60|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[2-57-9]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|7(?:2[2-468]|3[78])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"],"0$1"],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["[14]|[289][2-9]|5[3-9]|7[2-4679]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[257-9]"],"0$1"]],"0",0,"(000[259]\\d{6})$|(?:(?:003768)0?)|0","$1"],KE:["254","000","(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}",[7,8,9,10],[["(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[17]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0"],KG:["996","00","8\\d{9}|[235-9]\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["3(?:1[346]|[24-79])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-79]|88"],"0$1"],["(\\d{3})(\\d{3})(\\d)(\\d{2,3})","$1 $2 $3 $4",["8"],"0$1"]],"0"],KH:["855","00[14-9]","1\\d{9}|[1-9]\\d{7,8}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],KI:["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0"],KM:["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]]],KN:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","869$1",0,"869"],KP:["850","00|99","85\\d{6}|(?:19\\d|[2-7])\\d{7}",[8,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"]],"0"],KR:["82","00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))","00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}",[5,6,8,9,10,11,12,13,14],[["(\\d{2})(\\d{3,4})","$1-$2",["(?:3[1-3]|[46][1-4]|5[1-5])1"],"0$1"],["(\\d{4})(\\d{4})","$1-$2",["1"]],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[36]0|8"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["[1346]|5[1-5]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{2})(\\d{5})(\\d{4})","$1-$2-$3",["5"],"0$1"]],"0",0,"0(8(?:[1-46-8]|5\\d\\d))?"],KW:["965","00","18\\d{5}|(?:[2569]\\d|41)\\d{6}",[7,8],[["(\\d{4})(\\d{3,4})","$1 $2",["[169]|2(?:[235]|4[1-35-9])|52"]],["(\\d{3})(\\d{5})","$1 $2",["[245]"]]]],KY:["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","345$1",0,"345"],KZ:["7","810","(?:33622|8\\d{8})\\d{5}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"33|7",0,"8~10"],LA:["856","00","[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["30[0135-9]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[23]"],"0$1"]],"0"],LB:["961","00","[27-9]\\d{7}|[13-9]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-69]|7(?:[2-57]|62|8[0-7]|9[04-9])|8[02-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27-9]"]]],"0"],LC:["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"([2-8]\\d{6})$|1","758$1",0,"758"],LI:["423","00","[68]\\d{8}|(?:[2378]\\d|90)\\d{5}",[7,9],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2379]|8(?:0[09]|7)","[2379]|8(?:0(?:02|9)|7)"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["69"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],"0",0,"(1001)|0"],LK:["94","00","[1-9]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[1-689]"],"0$1"]],"0"],LR:["231","00","(?:[245]\\d|33|77|88)\\d{7}|(?:2\\d|[4-6])\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["4[67]|[56]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-578]"],"0$1"]],"0"],LS:["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]]],LT:["370","00","(?:[3469]\\d|52|[78]0)\\d{6}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["52[0-7]"],"(0-$1)",1],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"0 $1",1],["(\\d{2})(\\d{6})","$1 $2",["37|4(?:[15]|6[1-8])"],"(0-$1)",1],["(\\d{3})(\\d{5})","$1 $2",["[3-6]"],"(0-$1)",1]],"0",0,"[08]"],LU:["352","00","35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",[4,5,6,7,8,9,10,11],[["(\\d{2})(\\d{3})","$1 $2",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20[2-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["2(?:[0367]|4[3-8])"]],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["80[01]|90[015]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["2(?:[0367]|4[3-8])"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})","$1 $2 $3 $4",["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"],LV:["371","00","(?:[268]\\d|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[269]|8[01]"]]]],LY:["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0"],MA:["212","00","[5-8]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5[45]"],"0$1"],["(\\d{4})(\\d{5})","$1-$2",["5(?:2[2-46-9]|3[3-9]|9)|8(?:0[89]|92)"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8"],"0$1"],["(\\d{3})(\\d{6})","$1-$2",["[5-7]"],"0$1"]],"0",0,0,0,0,0,[["5(?:2(?:[0-25-79]\\d|3[1-578]|4[02-46-8]|8[0235-7])|3(?:[0-47]\\d|5[02-9]|6[02-8]|8[014-9]|9[3-9])|(?:4[067]|5[03])\\d)\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[0167]\\d|2[0-4]|5[01]|8[0-3]))\\d{6}"],["80[0-7]\\d{6}"],["89\\d{7}"],0,0,0,0,["(?:592(?:4[0-2]|93)|80[89]\\d\\d)\\d{4}"]]],MC:["377","00","(?:[3489]|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[389]"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["6"],"0$1"]],"0"],MD:["373","00","(?:[235-7]\\d|[89]0)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[25-7]"],"0$1"]],"0"],ME:["382","00","(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"0$1"]],"0"],MF:["590","00","590\\d{6}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-5])\\d{4}"]]],MG:["261","00","[23]\\d{8}",[9],[["(\\d{2})(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,"([24-9]\\d{6})$|0","20$1"],MH:["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1"],MK:["389","00","[2-578]\\d{7}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2|34[47]|4(?:[37]7|5[47]|64)"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],"0"],ML:["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]]],MM:["95","00","1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}",[6,7,8,9,10],[["(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["4(?:[2-46]|5[3-5])|5|6(?:[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-5]|(?:60|86)[23]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|452|678|86","[12]|452|6788|86"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[4-7]|8[1-35]"],"0$1"],["(\\d)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92"],"0$1"],["(\\d)(\\d{5})(\\d{4})","$1 $2 $3",["9"],"0$1"]],"0"],MN:["976","001","[12]\\d{7,9}|[5-9]\\d{7}",[8,9,10],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[12]1"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[5-9]"]],["(\\d{3})(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["[12](?:27|3[2-8]|4[2-68]|5[1-4689])","[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["[12]"],"0$1"]],"0"],MO:["853","00","0800\\d{3}|(?:28|[68]\\d)\\d{6}",[7,8],[["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{4})(\\d{4})","$1 $2",["[268]"]]]],MP:["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","670$1",0,"670"],MQ:["596","00","596\\d{6}|(?:69|80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],MR:["222","00","(?:[2-4]\\d\\d|800)\\d{5}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-48]"]]]],MS:["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"([34]\\d{6})$|1","664$1",0,"664"],MT:["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]]],MU:["230","0(?:0|[24-7]0|3[03])","(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[2-46]|8[013]"]],["(\\d{4})(\\d{4})","$1 $2",["[57]"]],["(\\d{5})(\\d{5})","$1 $2",["8"]]],0,0,0,0,0,0,0,"020"],MV:["960","0(?:0|19)","(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}",[7,10],[["(\\d{3})(\\d{4})","$1-$2",["[34679]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,0,"00"],MW:["265","00","(?:[1289]\\d|31|77)\\d{7}|1\\d{6}",[7,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[137-9]"],"0$1"]],"0"],MX:["52","0[09]","[2-9]\\d{9}",[10],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["33|5[56]|81"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2-9]"]]],0,0,0,0,0,0,0,"00"],MY:["60","00","1\\d{8,9}|(?:3\\d|[4-9])\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1-$2 $3",["1(?:[02469]|[378][1-9]|53)|8","1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3-$4",["1(?:[367]|80)"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2 $3",["1"],"0$1"]],"0"],MZ:["258","00","(?:2|8\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-79]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],NA:["264","00","[68]\\d{7,8}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["87"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],NC:["687","00","(?:050|[2-57-9]\\d\\d)\\d{3}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[02-57-9]"]]]],NE:["227","00","[027-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["08"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[089]|2[013]|7[0467]"]]]],NF:["672","00","[13]\\d{5}",[6],[["(\\d{2})(\\d{4})","$1 $2",["1[0-3]"]],["(\\d)(\\d{5})","$1 $2",["[13]"]]],0,0,"([0-258]\\d{4})$","3$1"],NG:["234","009","38\\d{6}|[78]\\d{9,13}|(?:20|9\\d)\\d{8}",[8,10,11,12,13,14],[["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["3"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["20[129]"],"0$1"],["(\\d{4})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]"],"0$1"],["(\\d{3})(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]"],"0$1"]],"0"],NI:["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]]],NL:["31","00","(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}",[5,6,7,8,9,10,11],[["(\\d{3})(\\d{4,7})","$1 $2",["[89]0"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["66"],"0$1"],["(\\d)(\\d{8})","$1 $2",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-578]|91"],"0$1"],["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3",["9"],"0$1"]],"0"],NO:["47","00","(?:0|[2-9]\\d{3})\\d{4}",[5,8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]"]]],0,0,0,0,0,"[02-689]|7[0-8]"],NP:["977","00","(?:1\\d|9)\\d{9}|[1-9]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],["(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"],"0$1"],["(\\d{3})(\\d{7})","$1-$2",["9"]]],"0"],NR:["674","00","(?:444|(?:55|8\\d)\\d|666)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[4-68]"]]]],NU:["683","00","(?:[4-7]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]]],NZ:["64","0(?:0|161)","[1289]\\d{9}|50\\d{5}(?:\\d{2,3})?|[27-9]\\d{7,8}|(?:[34]\\d|6[0-35-9])\\d{6}|8\\d{4,6}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,8})","$1 $2",["8[1-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["50[036-8]|8|90","50(?:[0367]|88)|8|90"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["24|[346]|7[2-57-9]|9[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|[589]"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1|2[028]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:[169]|7[0-35-9])|7"],"0$1"]],"0",0,0,0,0,0,0,"00"],OM:["968","00","(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}",[7,8,9],[["(\\d{3})(\\d{4,6})","$1 $2",["[58]"]],["(\\d{2})(\\d{6})","$1 $2",["2"]],["(\\d{4})(\\d{4})","$1 $2",["[179]"]]]],PA:["507","00","(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}",[7,8,10,11],[["(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],["(\\d{4})(\\d{4})","$1-$2",["[68]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]]],PE:["51","00|19(?:1[124]|77|90)00","(?:[14-8]|9\\d)\\d{7}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["1"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[4-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,0,"00"," Anexo "],PF:["689","00","4\\d{5}(?:\\d{2})?|8\\d{7,8}",[6,8,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4|8[7-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],PG:["675","00|140[1-3]","(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["18|[2-69]|85"]],["(\\d{4})(\\d{4})","$1 $2",["[78]"]]],0,0,0,0,0,0,0,"00"],PH:["63","00","(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}",[6,8,9,10,11,12,13],[["(\\d)(\\d{5})","$1 $2",["2"],"(0$1)"],["(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2","3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],["(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|8[2-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],"0"],PK:["92","00","122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,7})","$1 $2 $3",["[89]0"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["1"]],["(\\d{3})(\\d{6,7})","$1 $2",["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"],"(0$1)"],["(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],["(\\d{5})(\\d{5})","$1 $2",["58"],"(0$1)"],["(\\d{3})(\\d{7})","$1 $2",["3"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[24-9]"],"(0$1)"]],"0"],PL:["48","00","(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}",[6,7,8,9,10],[["(\\d{5})","$1",["19"]],["(\\d{3})(\\d{3})","$1 $2",["11|20|64"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1","(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2-8]|[2-7]|8[1-79]|9[145]"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["8"]]]],PM:["508","00","[45]\\d{5}|(?:708|80\\d)\\d{6}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[45]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],PR:["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939"],PS:["970","00","[2489]2\\d{6}|(?:1\\d|5)\\d{8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],PT:["351","00","1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["16|[236-9]"]]]],PW:["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],PY:["595","00","59\\d{4,6}|9\\d{5,10}|(?:[2-46-8]\\d|5[0-8])\\d{4,7}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]"],"(0$1)"],["(\\d{3})(\\d{4,5})","$1 $2",["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["87"]],["(\\d{3})(\\d{6})","$1 $2",["9(?:[5-79]|8[1-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],"0"],QA:["974","00","800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}",[7,8,9,11],[["(\\d{3})(\\d{4})","$1 $2",["2[16]|8"]],["(\\d{4})(\\d{4})","$1 $2",["[3-7]"]]]],RE:["262","00","(?:26|[689]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2689]"],"0$1"]],"0",0,0,0,0,0,[["26(?:2\\d\\d|3(?:0\\d|1[0-6]))\\d{4}"],["69(?:2\\d\\d|3(?:[06][0-6]|1[013]|2[0-2]|3[0-39]|4\\d|5[0-5]|7[0-37]|8[0-8]|9[0-479]))\\d{4}"],["80\\d{7}"],["89[1-37-9]\\d{6}"],0,0,0,0,["9(?:399[0-3]|479[0-5]|76(?:2[278]|3[0-37]))\\d{4}"],["8(?:1[019]|2[0156]|84|90)\\d{6}"]]],RO:["40","00","(?:[236-8]\\d|90)\\d{7}|[23]\\d{5}",[6,9],[["(\\d{3})(\\d{3})","$1 $2",["2[3-6]","2[3-6]\\d9"],"0$1"],["(\\d{2})(\\d{4})","$1 $2",["219|31"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[236-9]"],"0$1"]],"0",0,0,0,0,0,0,0," int "],RS:["381","00","38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",[6,7,8,9,10,11,12],[["(\\d{3})(\\d{3,9})","$1 $2",["(?:2[389]|39)0|[7-9]"],"0$1"],["(\\d{2})(\\d{5,10})","$1 $2",["[1-36]"],"0$1"]],"0"],RU:["7","810","8\\d{13}|[347-9]\\d{9}",[10,14],[["(\\d{4})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-8]|2[1-9])","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"],"8 ($1)",1],["(\\d{5})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-68]|2[1-9])","7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))","7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[349]|8(?:[02-7]|1[1-8])"],"8 ($1)",1],["(\\d{4})(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["8"],"8 ($1)"]],"8",0,0,0,0,"3[04-689]|[489]",0,"8~10"],RW:["250","00","(?:06|[27]\\d\\d|[89]00)\\d{6}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1"]],"0"],SA:["966","00","92\\d{7}|(?:[15]|8\\d)\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["9"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["81"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],"0"],SB:["677","0[01]","[6-9]\\d{6}|[1-6]\\d{4}",[5,7],[["(\\d{2})(\\d{5})","$1 $2",["6[89]|7|8[4-9]|9(?:[1-8]|9[0-8])"]]]],SC:["248","010|0[0-2]","(?:[2489]\\d|64)\\d{5}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]|9[57]"]]],0,0,0,0,0,0,0,"00"],SD:["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0"],SE:["46","00","(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",[6,7,8,9,10,12],[["(\\d{2})(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{4})","$1-$2",["9(?:00|39|44|9)"],"0$1",0,"$1 $2"],["(\\d{2})(\\d{3})(\\d{2})","$1-$2 $3",["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3"],["(\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{2,3})(\\d{3})","$1-$2 $3",["9(?:00|39|44)"],"0$1",0,"$1 $2 $3"],["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3 $4"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["10|7"],"0$1",0,"$1 $2 $3 $4"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["[26]"],"0$1",0,"$1 $2 $3 $4 $5"]],"0"],SG:["65","0[0-3]\\d","(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["[369]|8(?:0[1-9]|[1-9])"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]],["(\\d{4})(\\d{4})(\\d{3})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],SH:["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]"],SI:["386","00|10(?:22|66|88|99)","[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",[5,6,7,8],[["(\\d{2})(\\d{3,6})","$1 $2",["8[09]|9"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["59|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[0139]|51|6"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-57]"],"(0$1)"]],"0",0,0,0,0,0,0,"00"],SJ:["47","00","0\\d{4}|(?:[489]\\d|79)\\d{6}",[5,8],0,0,0,0,0,0,"79"],SK:["421","00","[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",[6,7,9],[["(\\d)(\\d{2})(\\d{3,4})","$1 $2 $3",["21"],"0$1"],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["[3-5][1-8]1","[3-5][1-8]1[67]"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1/$2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1/$2 $3 $4",["[3-5]"],"0$1"]],"0"],SL:["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0"],SM:["378","00","(?:0549|[5-7]\\d)\\d{6}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],["(\\d{4})(\\d{6})","$1 $2",["0"]]],0,0,"([89]\\d{5})$","0549$1"],SN:["221","00","(?:[378]\\d|93)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]]]],SO:["252","00","[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}",[6,7,8,9],[["(\\d{2})(\\d{4})","$1 $2",["8[125]"]],["(\\d{6})","$1",["[134]"]],["(\\d)(\\d{6})","$1 $2",["[15]|2[0-79]|3[0-46-8]|4[0-7]"]],["(\\d)(\\d{7})","$1 $2",["(?:2|90)4|[67]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[348]|64|79|90"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|6[0-35-9]|77|9[2-9]"]]],"0"],SR:["597","00","(?:[2-5]|68|[78]\\d)\\d{5}",[6,7],[["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],["(\\d{3})(\\d{3})","$1-$2",["[2-5]"]],["(\\d{3})(\\d{4})","$1-$2",["[6-8]"]]]],SS:["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0"],ST:["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]]],SV:["503","00","[267]\\d{7}|(?:80\\d|900)\\d{4}(?:\\d{4})?",[7,8,11],[["(\\d{3})(\\d{4})","$1 $2",["[89]"]],["(\\d{4})(\\d{4})","$1 $2",["[267]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]]],SX:["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"(5\\d{6})$|1","721$1",0,"721"],SY:["963","00","[1-39]\\d{8}|[1-5]\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-5]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1",1]],"0"],SZ:["268","00","0800\\d{4}|(?:[237]\\d|900)\\d{6}",[8,9],[["(\\d{4})(\\d{4})","$1 $2",["[0237]"]],["(\\d{5})(\\d{4})","$1 $2",["9"]]]],TA:["290","00","8\\d{3}",[4],0,0,0,0,0,0,"8"],TC:["1","011","(?:[58]\\d\\d|649|900)\\d{7}",[10],0,"1",0,"([2-479]\\d{6})$|1","649$1",0,"649"],TD:["235","00|16","(?:22|[689]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-9]"]]],0,0,0,0,0,0,0,"00"],TG:["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]]],TH:["66","00[1-9]","(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}",[8,9,10,13],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],TJ:["992","810","[0-57-9]\\d{8}",[9],[["(\\d{6})(\\d)(\\d{2})","$1 $2 $3",["331","3317"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["44[02-479]|[34]7"]],["(\\d{4})(\\d)(\\d{4})","$1 $2 $3",["3(?:[1245]|3[12])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[0-57-9]"]]],0,0,0,0,0,0,0,"8~10"],TK:["690","00","[2-47]\\d{3,6}",[4,5,6,7]],TL:["670","00","7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[2-489]|70"]],["(\\d{4})(\\d{4})","$1 $2",["7"]]]],TM:["993","810","(?:[1-6]\\d|71)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-5]"],"(8 $1)"],["(\\d{2})(\\d{6})","$1 $2",["[67]"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],TN:["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]]],TO:["676","00","(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}",[5,7],[["(\\d{2})(\\d{3})","$1-$2",["[2-4]|50|6[09]|7[0-24-69]|8[05]"]],["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[5-9]"]]]],TR:["90","00","4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",[7,10,12,13],[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["512|8[01589]|90"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5(?:[0-59]|61)","5(?:[0-59]|61[06])","5(?:[0-59]|61[06]1)"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24][1-8]|3[1-9]"],"(0$1)",1],["(\\d{3})(\\d{3})(\\d{6,7})","$1 $2 $3",["80"],"0$1",1]],"0"],TT:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-46-8]\\d{6})$|1","868$1",0,"868"],TV:["688","00","(?:2|7\\d\\d|90)\\d{4}",[5,6,7],[["(\\d{2})(\\d{3})","$1 $2",["2"]],["(\\d{2})(\\d{4})","$1 $2",["90"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],TW:["886","0(?:0[25-79]|19)","[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}",[7,8,9,10,11],[["(\\d{2})(\\d)(\\d{4})","$1 $2 $3",["202"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[258]0"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]","[23568]|4(?:0[2-48]|[1-47-9])|(?:400|7)[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,5})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,0,0,"#"],TZ:["255","00[056]","(?:[25-8]\\d|41|90)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["5"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"]],"0"],UA:["380","00","[89]\\d{9}|[3-9]\\d{8}",[9,10],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]","6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])","3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|89|9[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,0,"0~0"],UG:["256","00[057]","800\\d{6}|(?:[29]0|[347]\\d)\\d{7}",[9],[["(\\d{4})(\\d{5})","$1 $2",["202","2024"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[27-9]|4(?:6[45]|[7-9])"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[34]"],"0$1"]],"0"],US:["1","011","[2-9]\\d{9}|3\\d{6}",[10],[["(\\d{3})(\\d{4})","$1-$2",["310"],0,1],["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],0,1,"$1-$2-$3"]],"1",0,0,0,0,0,[["(?:3052(?:0[0-8]|[1-9]\\d)|5056(?:[0-35-9]\\d|4[468])|7302[0-4]\\d)\\d{4}|(?:305[3-9]|472[24]|505[2-57-9]|7306|983[2-47-9])\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-47-9]|1[02-9]|2[013569]|3[0-24679]|4[167]|5[0-2]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-47-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-29])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[1247]|4[037]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[068]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"],0,0,0,["305209\\d{4}"]]],UY:["598","0(?:0|1[3-9]\\d)","0004\\d{2,9}|[1249]\\d{7}|(?:[49]\\d|80)\\d{5}",[6,7,8,9,10,11,12,13],[["(\\d{3})(\\d{3,4})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[49]0|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[124]"]],["(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3 $4",["0"]]],"0",0,0,0,0,0,0,"00"," int. "],UZ:["998","00","(?:20|33|[5-79]\\d|88)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-9]"]]]],VA:["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11,12],0,0,0,0,0,0,"06698"],VC:["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","784$1",0,"784"],VE:["58","00","[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}",[10],[["(\\d{3})(\\d{7})","$1-$2",["[24-689]"],"0$1"]],"0"],VG:["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-578]\\d{6})$|1","284$1",0,"284"],VI:["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","340$1",0,"340"],VN:["84","00","[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|[16-8]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["80"],"0$1",1],["(\\d{4})(\\d{4,6})","$1 $2",["1"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["6"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[357-9]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2[48]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["2"],"0$1",1]],"0"],VU:["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]]],WF:["681","00","(?:40|72|8\\d{4})\\d{4}|[89]\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[47-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],WS:["685","0","(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}",[5,6,7,10],[["(\\d{5})","$1",["[2-5]|6[1-9]"]],["(\\d{3})(\\d{3,7})","$1 $2",["[68]"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],XK:["383","00","2\\d{7,8}|3\\d{7,11}|(?:4\\d\\d|[89]00)\\d{5}",[8,9,10,11,12],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2|39"],"0$1"],["(\\d{2})(\\d{7,10})","$1 $2",["3"],"0$1"]],"0"],YE:["967","00","(?:1|7\\d)\\d{7}|[1-7]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7(?:[24-6]|8[0-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"]],"0"],YT:["262","00","(?:80|9\\d)\\d{7}|(?:26|63)9\\d{6}",[9],0,"0",0,0,0,0,0,[["269(?:0[0-467]|15|5[0-4]|6\\d|[78]0)\\d{4}"],["639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])\\d{4}"],["80\\d{7}"],0,0,0,0,0,["9(?:(?:39|47)8[01]|769\\d)\\d{4}"]]],ZA:["27","00","[1-79]\\d{8}|8\\d{4,9}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],ZM:["260","00","800\\d{6}|(?:21|63|[79]\\d)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[28]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[79]"],"0$1"]],"0"],ZW:["263","00","2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}",[5,6,7,8,9,10],[["(\\d{3})(\\d{3,5})","$1 $2",["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"],"0$1"],["(\\d)(\\d{3})(\\d{2,4})","$1 $2 $3",["[49]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["80"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2","2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)","2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["29[013-9]|39|54"],"0$1"],["(\\d{4})(\\d{3,5})","$1 $2",["(?:25|54)8","258|5483"],"0$1"]],"0"]},nonGeographic:{800:["800",0,"(?:00|[1-9]\\d)\\d{6}",[8],[["(\\d{4})(\\d{4})","$1 $2",["\\d"]]],0,0,0,0,0,0,[0,0,["(?:00|[1-9]\\d)\\d{6}"]]],808:["808",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,["[1-9]\\d{7}"]]],870:["870",0,"7\\d{11}|[35-7]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[35-7]"]]],0,0,0,0,0,0,[0,["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"]]],878:["878",0,"10\\d{10}",[12],[["(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["10\\d{10}"]]],881:["881",0,"6\\d{9}|[0-36-9]\\d{8}",[9,10],[["(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[0-37-9]"]],["(\\d)(\\d{3})(\\d{5,6})","$1 $2 $3",["6"]]],0,0,0,0,0,0,[0,["6\\d{9}|[0-36-9]\\d{8}"]]],882:["882",0,"[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?",[7,8,9,10,11,12],[["(\\d{2})(\\d{5})","$1 $2",["16|342"]],["(\\d{2})(\\d{6})","$1 $2",["49"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["1[36]|9"]],["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["16"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|23|3(?:[15]|4[57])|4|51"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["34"]],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["[1-35]"]]],0,0,0,0,0,0,[0,["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|50\\d{3})\\d{7}",[7,8,9,10,12]],0,0,0,["348[57]\\d{7}",[11]],0,0,["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]],883:["883",0,"(?:[1-4]\\d|51)\\d{6,10}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,8})","$1 $2 $3",["[14]|2[24-689]|3[02-689]|51[24-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["21"]],["(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["51[13]"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[235]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[0-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]],888:["888",0,"\\d{11}",[11],[["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],0,0,0,0,0,0,[0,0,0,0,0,0,["\\d{11}"]]],979:["979",0,"[1359]\\d{8}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[1359]"]]],0,0,0,0,0,0,[0,0,0,["[1359]\\d{8}"]]]}});var bi=n(1014),Si=n(386);function wi({id:t,htmlId:e,onChange:n,value:o="",defaultValue:s="",attributes:a={},default_country:l="US",className:c,disabled:u=!1,setTitle:h}){return(0,Si.Us)(h,o),(0,i.useEffect)((()=>{"string"!=typeof o&&n("")}),[o,n]),(0,i.createElement)(vi,{international:!0,defaultCountry:l,value:o,id:e,onChange:n,disabled:u,className:(0,r.A)("wpifycf-field-tel",`wpifycf-field-tel--${t}`,a.class,c),...a})}wi.checkValidity=bi.e6;const xi=wi},6791:(t,e,n)=>{"use strict";n.r(e),n.d(e,{CategoryTree:()=>O,Term:()=>d,default:()=>p});var i=n(1609),r=(n(2619),n(386)),o=n(9388),s=n(2117),a=n(7723),l=n(1014),c=n(5103),u=n(4164);function h(t,e){return!!t.children&&t.children.some((t=>e.includes(t.id)||h(t,e)))}function d({taxonomy:t,id:e,htmlId:n,value:o=0,onChange:l,className:h,disabled:d=!1,setTitle:f}){const{data:p,isError:m,isFetching:g}=(0,r.hf)({taxonomy:t}),y=!g&&!m&&p.length>0&&p.some((t=>t.children)),$=(0,i.useMemo)((()=>{if(!y||!p||!o)return null;const t=(e,n)=>{for(const i of e){if(i.id===parseInt(n))return(0,c.QZ)(i.name);if(i.children){const e=t(i.children,n);if(e)return e}}return""};return t(p,o)}),[y,p,o]);let v;return(0,r.Us)(y?f:void 0,$||""),v=g?(0,a.__)("Loading terms...","wpify-custom-fields"):m?(0,a.__)("Error in loading terms...","wpify-custom-fields"):0===p.length?(0,a.__)("No terms found...","wpify-custom-fields"):p.some((t=>t.children))?(0,i.createElement)(O,{categories:p,value:[parseInt(o)],onChange:l,type:"radio",htmlId:n,disabled:d}):(0,i.createElement)(s.Select,{id:e,htmlId:n,value:o,onChange:l,options:p.map((t=>({value:t.id,label:t.name}))),disabled:d,setTitle:f}),(0,i.createElement)("div",{className:(0,u.A)("wpifycf-field-term",`wpifycf-field-term--${e}`,h)},v)}function O({categories:t=[],value:e=[],onChange:n,htmlId:r,type:o,disabled:s=!1}){return(0,i.createElement)("div",{className:"wpifycf-term-items"},t.map((t=>(0,i.createElement)(f,{key:t.id,category:t,value:e,onChange:n,htmlId:r+"__select",type:o,disabled:s}))))}function f({htmlId:t,category:e,value:n=[],onChange:r,type:s,disabled:a=!1}){const[l,c]=(0,i.useState)((()=>h(e,n)));(0,i.useEffect)((()=>{c((t=>t||h(e,n)))}),[e,n]);const u=(0,i.useCallback)((()=>{c((t=>!t))}),[]),d=(0,i.useCallback)((t=>()=>{if(a)return null;"radio"===s?r(t):"checkbox"===s&&(n.includes(t)?r(n.filter((e=>t!==e))):r([...n,t]))}),[s,r,n]);return(0,i.createElement)("div",{className:"wpifycf-term-item"},(0,i.createElement)("div",{className:"wpifycf-term-item__name"},(0,i.createElement)("input",{type:s,name:t,onChange:d(e.id),checked:n.includes(e.id),disabled:a}),(0,i.createElement)("div",{onClick:e.children?u:d(e.id),dangerouslySetInnerHTML:{__html:e.name}}),e.children&&(0,i.createElement)(o.K,{icon:l?"minus":"plus",onClick:u})),l&&e.children&&(0,i.createElement)("div",{className:"wpifycf-term-item__children"},e.children.map((e=>(0,i.createElement)(f,{key:e.id,category:e,value:n,onChange:r,type:s,htmlId:t,disabled:a})))))}d.checkValidity=l.QH;const p=d},4402:(t,e,n)=>{"use strict";n.r(e),n.d(e,{Text:()=>a,default:()=>l});var i=n(1609),r=n(4164),o=n(1014),s=n(386);function a({id:t,htmlId:e,onChange:n,value:o="",attributes:a={},className:l,disabled:c=!1,counter:u=!1,setTitle:h}){(0,s.Us)(h,o);const d=(0,i.useCallback)((t=>n(t.target.value)),[n]);return(0,i.createElement)(i.Fragment,null,(0,i.createElement)("input",{type:"text",id:e,onChange:d,value:o,className:(0,r.A)("wpifycf-field-text",`wpifycf-field-text--${t}`,a.class,l),disabled:c,...a}),u&&(0,i.createElement)("span",{className:"wpifycf-field-text__counter"},String(o).length))}a.checkValidity=o.e6;const l=a},4759:(t,e,n)=>{"use strict";n.r(e),n.d(e,{Textarea:()=>a,default:()=>l});var i=n(1609),r=n(4164),o=(n(2619),n(1014)),s=n(386);function a({id:t,htmlId:e,onChange:n,value:o="",attributes:a={},className:l,disabled:c=!1,counter:u=!1,setTitle:h}){(0,s.Us)(h,o?String(o).substring(0,50):"");const d=(0,i.useCallback)((t=>n(t.target.value)),[n]);return(0,i.createElement)(i.Fragment,null,(0,i.createElement)("textarea",{id:e,onChange:d,value:o,className:(0,r.A)("wpifycf-field-textarea",`wpifycf-field-textarea--${t}`,a.class,l),disabled:c,...a}),u&&(0,i.createElement)("span",{className:"wpifycf-field-textarea__counter"},String(o).length))}a.checkValidity=o.e6;const l=a},7032:(t,e,n)=>{"use strict";n.r(e),n.d(e,{Time:()=>a,default:()=>l});var i=n(1609),r=n(4164),o=(n(2619),n(1014)),s=n(386);function a({id:t,htmlId:e,onChange:n,value:o="",min:a,max:l,attributes:c={},className:u,disabled:h=!1,setTitle:d}){(0,s.Us)(d,o);const O=(0,i.useCallback)((t=>n(t.target.value)),[n]);return(0,i.createElement)("input",{type:"time",id:e,onChange:O,value:o,min:a,max:l,className:(0,r.A)("wpifycf-field-time",`wpifycf-field-time--${t}`,c.class,u),disabled:h,...c})}a.checkValidity=o.e6;const l=a},955:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>s});var i=n(1609),r=(n(2619),n(4164));function o({title:t,className:e}){return(0,i.createElement)("div",{className:(0,r.A)("wpify-field-title",e)},t&&(0,i.createElement)("h2",{dangerouslySetInnerHTML:{__html:t}}))}o.renderOptions={noWrapper:!0,noLabel:!0};const s=o},1189:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>c});var i=n(1609),r=(n(2619),n(6427)),o=n(1014),s=n(4164),a=n(5103);function l({id:t,htmlId:e,value:n=null,title:o,disabled:l=!1,onChange:c,className:u,setTitle:h}){return(0,i.useEffect)((()=>{h(n?(0,a.QZ)(o):"")}),[h,n]),(0,i.createElement)(r.ToggleControl,{id:e,label:(0,i.createElement)("span",{dangerouslySetInnerHTML:{__html:o}}),checked:n,onChange:c,disabled:l,className:(0,s.A)("wpifycf-field-toggle",`wpifycf-field-toggle--${t}`,u),__nextHasNoMarginBottom:!0})}l.checkValidity=o.Vj;const c=l},2144:(t,e,n)=>{"use strict";n.r(e),n.d(e,{Url:()=>l,default:()=>c});var i=n(1609),r=n(4164),o=(n(2619),n(5103)),s=n(1014),a=n(386);function l({id:t,htmlId:e,onChange:n,value:s="",attributes:l={},className:c,disabled:u=!1,setTitle:h}){(0,a.Us)(h,s);const d=(0,i.useCallback)((t=>n(t.target.value)),[n]),O=(0,i.useCallback)((t=>{const e=(0,o.l2)(t.target.value);s!==e&&n(e)}),[n,s]);return(0,i.createElement)("input",{type:"url",id:e,onChange:d,onBlur:O,value:s,className:(0,r.A)("wpifycf-field-url",`wpifycf-field-url--${t}`,l.class,c),disabled:u,...l})}l.checkValidity=s.e6;const c=l},5257:(t,e,n)=>{"use strict";n.r(e),n.d(e,{Week:()=>a,default:()=>l});var i=n(1609),r=n(4164),o=(n(2619),n(1014)),s=n(386);function a({id:t,htmlId:e,onChange:n,value:o="",min:a,max:l,attributes:c={},className:u,disabled:h=!1,setTitle:d}){(0,s.Us)(d,o);const O=(0,i.useCallback)((t=>n(t.target.value)),[n]);return(0,i.createElement)("input",{type:"week",id:e,onChange:O,value:o,min:a,max:l,className:(0,r.A)("wpifycf-field-week",`wpifycf-field-week--${t}`,c.class,u),disabled:h,...c})}a.checkValidity=o.e6;const l=a},1816:(t,e,n)=>{"use strict";n.r(e),n.d(e,{Wysiwyg:()=>w,default:()=>x});var i=n(1609),r=n(6087),o=n(4164),s=n(7723),a=n(4582),l=n(1014),c=n(7316),u=n(5103),h=n(6427),d=n(5573),O=n(4848);const f=(0,O.jsx)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,O.jsx)(d.Path,{d:"M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z"})}),p="visual",m="html";function g(){return document.querySelector('iframe[name="editor-canvas"]')}function y(){return!!g()}const $={getWindow:()=>window,isIframeMode:()=>y(),getTargetDocument:(t=!1)=>t?document:function(){const t=g();return t?.contentDocument?t.contentDocument:document}(),getTinyMCE(){return this.getWindow().tinymce},getEditorL10n(){return this.getWindow().wpEditorL10n},getOldEditor(){const t=this.getWindow();return t.wp?.oldEditor},isAvailable(){const t=this.getTinyMCE(),e=this.getEditorL10n();return void 0!==t&&void 0!==e?.tinymce},initialize(t,e={}){const n=this.getTinyMCE(),i=this.getEditorL10n(),r=this.getOldEditor(),o=this.getWindow(),s=this.isIframeMode();if(!n||!i?.tinymce)return null;const a=n.get(t);if(a)return a;const{baseURL:l,suffix:c,settings:u}=i.tinymce;n.EditorManager.overrideDefaults({base_url:l,suffix:c});const h=o.wpifycf_wysiwyg_toolbars||window.wpifycf_wysiwyg_toolbars||{},d=e.toolbar||"full",O={};h[d]&&Object.keys(h[d]).forEach((t=>{O["toolbar"+t]=h[d][t]}));const f={...u,...O,height:e.height||300,wp_autoresize_on:!1,setup:e.setup},p=e.forceMainDocument||!1,m=this.getTargetDocument(p).getElementById(t);if(s&&!p){if(!m)return null;n.init({...f,target:m})}else r?r.initialize(t,{tinymce:f}):n.init({...f,selector:"#"+t});return n.get(t)},destroy(t){const e=this.getTinyMCE(),n=this.getOldEditor(),i=this.isIframeMode();if(!e)return!1;const r=e.get(t);return!!r&&(r.save(),r.off(),n&&!i?n.remove(t):r.destroy(),!0)},get(t){const e=this.getTinyMCE();return e?e.get(t):null}};function v({children:t,className:e}){const n=(0,i.useCallback)((t=>{t.stopPropagation(),window.dispatchEvent(new MouseEvent("mouseup"))}),[]),r=(0,i.useCallback)((t=>{t.stopPropagation()}),[]),s=(0,i.useCallback)((t=>{t.stopPropagation()}),[]),a=(0,i.useCallback)((t=>{"Tab"!==t.key&&"Escape"!==t.key&&t.stopPropagation()}),[]),l=(0,i.useCallback)((t=>{t.stopPropagation()}),[]);return(0,i.createElement)("div",{className:(0,o.A)("wpifycf-event-isolation-wrapper",e),onMouseDown:r,onMouseUp:n,onClick:s,onKeyDown:a,onFocus:l},t)}function b({htmlId:t,value:e,onChange:n,height:o=300,disabled:a=!1,toolbar:l="full",delay:c=!1}){const u=(0,i.useRef)(null),h=(0,i.useRef)(null),[d,O]=(0,i.useState)(!1),[f,p]=(0,i.useState)(c),m=(0,i.useRef)(null),g=(0,i.useMemo)((()=>t.replace(/\./g,"__").replace(/\[/g,"_").replace(/\]/g,"_").replace(/[^a-zA-Z0-9_-]/g,"_")),[t]),y=(0,i.useCallback)((()=>{if(u.current||a)return;if(!$.isAvailable())return void(m.current=setTimeout(y,100));const t={height:Math.max(o,300),toolbar:l,setup(t){u.current=t,t.on("init",(()=>{e&&t.setContent(e),O(!0)})),t.on("change keyup",(()=>{t.save();const e=t.getContent();n?.(e)})),t.on("mouseup",(()=>{window.dispatchEvent(new MouseEvent("mouseup"))})),t.on("mousedown",(t=>{t.stopPropagation()}))}};$.initialize(g,t)}),[g,o,l,n,e,a]),v=(0,i.useCallback)((()=>{p(!1)}),[]);return(0,i.useEffect)((()=>(f||a||(m.current=setTimeout(y,50)),()=>{m.current&&clearTimeout(m.current)})),[f,a,y]),(0,i.useEffect)((()=>()=>{u.current&&($.destroy(g),u.current=null)}),[g]),(0,i.useEffect)((()=>{const t=u.current;if(t&&d){const n=t.getContent();if(e!==n&&void 0!==e){const n=t.selection.getBookmark(2,!0);t.setContent(e||"");try{t.selection.moveToBookmark(n)}catch(t){}}}}),[e,d]),f?(0,i.createElement)("div",{className:"wpifycf-field-wysiwyg__delay-wrapper",style:{minHeight:o+94},onClick:v,role:"button",tabIndex:0,onKeyDown:t=>"Enter"===t.key&&v()},(0,i.createElement)("div",{className:"wpifycf-field-wysiwyg__delay-message"},(0,s.__)("Click to initialize editor","wpify-custom-fields")),e&&(0,i.createElement)(r.RawHTML,{className:"wpifycf-field-wysiwyg__delay-preview"},e)):(0,i.createElement)("div",{className:"wpifycf-field-wysiwyg__editor-container"},(0,i.createElement)("textarea",{ref:h,id:g,defaultValue:e||"",style:{height:o},disabled:a}))}function S({htmlId:t,value:e,onChange:n,height:a=300,disabled:l=!1,toolbar:c="full"}){const[u,d]=(0,i.useState)(!1),[O,p]=(0,i.useState)(!1),[m,g]=(0,i.useState)(e),y=(0,i.useRef)(null),[v,b]=(0,i.useState)(!1),S=(0,i.useMemo)((()=>`wpifycf_modal_${t}`.replace(/\./g,"__").replace(/\[/g,"_").replace(/\]/g,"_").replace(/[^a-zA-Z0-9_-]/g,"_")),[t]);(0,i.useEffect)((()=>{g(e)}),[e]);const w=(0,i.useCallback)((()=>{g(e),d(!0)}),[e]),x=(0,i.useCallback)((()=>{const t=y.current;if(t){const e=t.getContent();n?.(e)}d(!1),b(!1)}),[n]),Q=(0,i.useCallback)((()=>{g(e),d(!1),b(!1)}),[e]),P=(0,i.useCallback)((()=>{p((t=>!t))}),[]),_=(0,i.useRef)("");return(0,i.useEffect)((()=>{if(!u)return;_.current=m||"";const t=()=>{if(!$.isAvailable())return void setTimeout(t,100);if(y.current)return;const e={height:Math.max(a,300),toolbar:c,forceMainDocument:!0,setup(t){y.current=t,t.on("init",(()=>{t.setContent(_.current),b(!0),t.focus()})),t.on("change keyup",(()=>{t.save(),g(t.getContent())}))}};$.initialize(S,e)},e=setTimeout(t,100);return()=>{clearTimeout(e),y.current&&($.destroy(S),y.current=null)}}),[u,S,a,c]),(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:(0,o.A)("wpifycf-field-wysiwyg__preview-wrapper",l&&"wpifycf-field-wysiwyg__preview-wrapper--disabled")},(0,i.createElement)("div",{className:"wpifycf-field-wysiwyg__preview",onClick:l?void 0:w,role:l?void 0:"button",tabIndex:l?void 0:0,onKeyDown:t=>!l&&"Enter"===t.key&&w()},e?(0,i.createElement)(r.RawHTML,null,e):(0,i.createElement)("span",{className:"wpifycf-field-wysiwyg__placeholder"},(0,s.__)("Click to add content...","wpify-custom-fields"))),!l&&(0,i.createElement)(h.Button,{onClick:w,variant:"primary",className:"wpifycf-field-wysiwyg__edit-button"},(0,s.__)("Edit","wpify-custom-fields"))),u&&(0,i.createElement)(h.Modal,{title:(0,s.__)("Edit Content","wpify-custom-fields"),onRequestClose:x,shouldCloseOnClickOutside:!1,overlayClassName:"wpifycf-wysiwyg-modal-overlay",isFullScreen:O,className:(0,o.A)("wpifycf-wysiwyg-modal",O&&"wpifycf-wysiwyg-modal--fullscreen"),headerActions:(0,i.createElement)(h.Button,{size:"small",onClick:P,icon:f,isPressed:O,label:O?(0,s.__)("Exit fullscreen","wpify-custom-fields"):(0,s.__)("Enter fullscreen","wpify-custom-fields")})},(0,i.createElement)("div",{className:"wpifycf-wysiwyg-modal__editor"},(0,i.createElement)("textarea",{id:S,defaultValue:m||"",style:{height:O?"calc(100vh - 200px)":a}})),(0,i.createElement)(h.Flex,{className:"wpifycf-wysiwyg-modal__actions",justify:"flex-end",expanded:!1},(0,i.createElement)(h.FlexItem,null,(0,i.createElement)(h.Button,{variant:"tertiary",onClick:Q},(0,s.__)("Cancel","wpify-custom-fields"))),(0,i.createElement)(h.FlexItem,null,(0,i.createElement)(h.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:x},(0,s.__)("Done","wpify-custom-fields"))))))}function w({id:t,htmlId:e,value:n,onChange:l,height:h=300,className:d,disabled:O=!1,setTitle:f,toolbar:g="full",delay:$=!1,tabs:w="all",forceModal:x=!1}){const[Q,P]=(0,i.useState)(p),{context:_}=(0,i.useContext)(c.B);(0,i.useEffect)((()=>{f?.((0,u.QZ)(n||"").replace(/\n/g," ").substring(0,50))}),[f,n]);const k="all"===w||"visual"===w,T="all"===w||"text"===w,C="all"===w;(0,i.useEffect)((()=>{"visual"===w&&Q===m?P(p):"text"===w&&Q===p&&P(m)}),[w,Q]);const z="gutenberg"===_,R="gutenberg"===_&&y(),E="gutenberg"===_&&(x||R),A=(0,i.createElement)(b,{htmlId:e,value:n,onChange:l,height:h,disabled:O,toolbar:g,delay:$});return(0,i.createElement)("div",{className:(0,o.A)("wpifycf-field-wysiwyg",`wpifycf-field-wysiwyg--${t}`,d)},C&&(0,i.createElement)("div",{className:"wpifycf-field-wysiwyg__tabs"},k&&(0,i.createElement)("button",{type:"button",className:(0,o.A)("wpifycf-field-wysiwyg__tab",Q===p&&"wpifycf-field-wysiwyg__tab--active"),onClick:()=>P(p)},(0,s.__)("Visual","wpify-custom-fields")),T&&(0,i.createElement)("button",{type:"button",className:(0,o.A)("wpifycf-field-wysiwyg__tab",Q===m&&"wpifycf-field-wysiwyg__tab--active"),onClick:()=>P(m)},(0,s.__)("HTML","wpify-custom-fields"))),Q===p&&(O?(0,i.createElement)(r.RawHTML,{className:"wpifycf-field-wysiwyg__raw"},n):E?(0,i.createElement)(S,{htmlId:e,value:n,onChange:l,height:h,disabled:O,toolbar:g}):z?(0,i.createElement)(v,null,A):A),Q===m&&(0,i.createElement)(a.Code,{value:n,onChange:l,height:h+94,id:t,htmlId:e,language:"html",theme:"light",disabled:O}))}w.checkValidity=l.e6,w.VIEW_VISUAL=p,w.VIEW_HTML=m;const x=w},6693:(t,e,n)=>{n(2452),n(9853),n(9572),n(4582),n(8542),n(3537),n(6328),n(8068),n(4977),n(4958),n(3125),n(7692),n(75),n(8213),n(8417),n(1419),n(6985),n(9592),n(1237),n(8236),n(9403),n(7569),n(7242),n(6733),n(5076),n(5708),n(2220),n(3909),n(8742),n(6440),n(4379),n(6930),n(6323),n(4726),n(4549),n(5972),n(5971),n(688),n(9188),n(5484),n(251),n(9242),n(9428),n(2117),n(3585),n(6791),n(4402),n(4759),n(7032),n(955),n(1189),n(2144),n(5257),n(1816)},5103:(t,e,n)=>{"use strict";n.d(e,{CS:()=>zt,wz:()=>Xt,of:()=>qt,JC:()=>Zt,Em:()=>Mt,o0:()=>jt,l2:()=>Et,QZ:()=>Wt});var i=n(2619),r=n(2452),o=n(9853),s=n(9572),a=n(1609),l=n(4164),c=n(5587),u=n(7316);const h=()=>null;function d({id:t,htmlId:e,items:n=[],columns:i=2,gap:r,classname:o,attributes:s={},disabled:d=!1,fieldPath:O,parentValue:f,parentOnChange:p,setTitleFactory:m,validity:g=[]}){const y=(0,a.useRef)(null),$=function(t){const[e,n]=(0,a.useState)(0);return(0,a.useEffect)((()=>{if(!t.current)return;const e=new ResizeObserver((t=>{for(const i of t){var e;n(null!==(e=i.contentBoxSize?.[0]?.inlineSize)&&void 0!==e?e:i.contentRect.width)}}));return e.observe(t.current),()=>e.disconnect()}),[t]),e}(y),{values:v,updateValue:b}=(0,a.useContext)(u.B),S="function"==typeof p,w=O?O.split(".").slice(0,-1).join("."):"",x=g?.reduce(((t,e)=>"object"==typeof e?{...t,...e}:t),{}),Q=(0,a.useCallback)((t=>e=>p&&p({...f,[t]:e})),[f,p]),P=$>0?Math.max(1,Math.min(i,Math.floor($/300))):i,_=P{const n=w?`${w}.${t.id}`:t.id,i={};if(!_){const e=t.column?Math.min(t.column,P):null,n=t.column_span?Math.min(t.column_span,e?P-e+1:P):null;e&&n?i.gridColumn=`${e} / span ${n}`:e?i.gridColumn=e:n&&(i.gridColumn=`span ${n}`)}return S?(0,a.createElement)("div",{key:t.id,className:"wpifycf-field-columns__item",style:i},(0,a.createElement)(c.D,{disabled:d,...t,value:f[t.id]||"",onChange:Q(t.id),parentValue:f,parentOnChange:p,setTitle:m?m(t.id):h,setTitleFactory:m,htmlId:`${e}.${t.id}`,validity:x[t.id],fieldPath:n})):(0,a.createElement)("div",{key:t.id,className:"wpifycf-field-columns__item",style:i},(0,a.createElement)(c.D,{disabled:d,...t,name:t.name||t.id,value:v[t.id],onChange:b(t.id),htmlId:t.id.replace(/[\[\]]+/g,"_"),fieldPath:t.id,setTitle:h}))})))}d.renderOptions={noLabel:!0,noFieldWrapper:!0,noControlWrapper:!0};const O=d;var f=n(4582),p=n(8542),m=n(3537),g=n(6328),y=n(8068),$=n(7723),v=n(6087),b=n(6427),S=n(5573),w=n(4848);const x=(0,w.jsx)(S.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,w.jsx)(S.Path,{d:"M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"})}),Q=(0,w.jsxs)(S.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,w.jsx)(S.Path,{d:"M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z"}),(0,w.jsx)(S.Path,{d:"M17 4H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM7 5.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5Z"})]});var P=n(3349),_=n(1014),k=n(386);function T({id:t,htmlId:e,value:n,onChange:i,required:r,allowed_types:o,max_size:s,setTitle:l,...c}){const[u,h]=(0,v.useState)(!1),[d,O]=(0,v.useState)(0),[f,p]=(0,v.useState)(null),[m,g]=(0,v.useState)(null),y=(0,v.useRef)(null),S=(0,k.OZ)(),w=(0,k.RZ)(n),_=n&&"string"==typeof n?n.split("/").pop():"";(0,k.Us)(l,_);const T=()=>{y.current&&y.current.click()},C=()=>{if(!n||"string"!=typeof n)return"";const t=n.split("/");return t[t.length-1]},z=()=>{if(!n||"string"!=typeof n)return null;const t=window.wpifycf?.abspath||"",e=window.wpifycf?.site_url||"";return t&&e&&n.startsWith(t)?n.replace(t,e+"/"):null},R=null!==z(),E="string"==typeof n&&n.length>0;return(0,a.createElement)("div",{className:"wpifycf-field-direct-file"},(0,a.createElement)("input",{type:"file",ref:y,onChange:e=>{const n=e.target.files[0];if(n)if(p(null),s&&n.size>s){const t=(s/1024/1024).toFixed(2);p((0,$.sprintf)((0,$.__)("File size exceeds maximum allowed size of %sMB","wpify-custom-fields"),t))}else o&&o.length>0&&!o.includes(n.type)?p((0,$.sprintf)((0,$.__)('File type "%s" is not allowed',"wpify-custom-fields"),n.type)):(h(!0),O(0),S.mutate({file:n,fieldId:t,onProgress:O},{onSuccess:t=>{i(t.temp_path),g(t.size),h(!1),O(0)},onError:t=>{p(t.message||(0,$.__)("Upload failed","wpify-custom-fields")),h(!1),O(0)}}))},style:{display:"none"},accept:o&&o.length>0?o.join(","):void 0}),!E&&!u&&(0,a.createElement)("div",{className:"wpifycf-direct-file__empty"},(0,a.createElement)(b.Button,{variant:"secondary",onClick:T,icon:x},(0,$.__)("Choose File","wpify-custom-fields"))),u&&(0,a.createElement)("div",{className:"wpifycf-direct-file__uploading"},(0,a.createElement)(b.Spinner,null),(0,a.createElement)("div",{className:"wpifycf-direct-file__progress"},(0,a.createElement)("div",{className:"wpifycf-direct-file__progress-bar",style:{width:`${d}%`}})),(0,a.createElement)("span",{className:"wpifycf-direct-file__progress-text"},(0,$.__)("Uploading...","wpify-custom-fields")," ",Math.round(d),"%")),E&&!u&&(0,a.createElement)("div",{className:"wpifycf-direct-file__preview"},(0,a.createElement)("div",{className:"wpifycf-direct-file__info"},(0,a.createElement)(b.Icon,{icon:Q}),(0,a.createElement)("div",{className:"wpifycf-direct-file__details"},R?(0,a.createElement)("a",{href:z(),target:"_blank",rel:"noopener noreferrer",className:"wpifycf-direct-file__name wpifycf-direct-file__name--link"},C()):(0,a.createElement)("span",{className:"wpifycf-direct-file__name"},C()),(0,a.createElement)("span",{className:"wpifycf-direct-file__meta"},(0,a.createElement)("span",{className:"wpifycf-direct-file__path"},n),(m||w?.data?.size)&&(0,a.createElement)("span",{className:"wpifycf-direct-file__size"},(t=>{if(!t)return"";if(0===t)return"0 B";const e=Math.floor(Math.log(t)/Math.log(1024));return Math.round(t/Math.pow(1024,e)*100)/100+" "+["B","KB","MB","GB"][e]})(m||w?.data?.size))))),(0,a.createElement)("div",{className:"wpifycf-direct-file__actions"},(0,a.createElement)(b.Button,{variant:"secondary",onClick:T,icon:x,isSmall:!0},(0,$.__)("Replace","wpify-custom-fields")),(0,a.createElement)(b.Button,{variant:"secondary",onClick:()=>{i(""),g(null),p(null),y.current&&(y.current.value="")},icon:P.A,isDestructive:!0,isSmall:!0},(0,$.__)("Remove","wpify-custom-fields")))),f&&(0,a.createElement)("div",{className:"wpifycf-direct-file__error"},f))}T.checkValidity=_.e6;const C=T;var z=n(4977),R=n(4958),E=n(3125),A=n(7692),Z=n(75),M=n(8213),V=n(8417),X=n(1419),q=n(6985),W=n(9592),j=n(1237),I=n(8236),L=n(9403),N=n(7569),U=n(9388);function D({file:t,onRemove:e,disabled:n}){const i=(0,k.RZ)(t.path),r=()=>{if(!t.path||"string"!=typeof t.path)return t.name||"";const e=t.path.split("/");return e[e.length-1]},o=()=>{if(!t.path||"string"!=typeof t.path)return null;const e=window.wpifycf?.abspath||"",n=window.wpifycf?.site_url||"";return e&&n&&t.path.startsWith(e)?t.path.replace(e,n+"/"):null},s=null!==o();return(0,a.createElement)("div",{className:(0,l.A)("wpifycf-field-multi-direct-file__item",{"wpifycf-field-multi-direct-file__item--uploading":t.uploading})},!n&&(0,a.createElement)("div",{className:"wpifycf-field-multi-direct-file__item__sort"},(0,a.createElement)(U.K,{icon:"move",className:"wpifycf-sort"})),(0,a.createElement)("div",{className:"wpifycf-field-multi-direct-file__item__content"},t.uploading?(0,a.createElement)("div",{className:"wpifycf-direct-file__uploading"},(0,a.createElement)(b.Spinner,null),(0,a.createElement)("div",{className:"wpifycf-direct-file__progress"},(0,a.createElement)("div",{className:"wpifycf-direct-file__progress-bar",style:{width:`${t.progress||0}%`}})),(0,a.createElement)("span",{className:"wpifycf-direct-file__progress-text"},(0,$.__)("Uploading...","wpify-custom-fields")," ",Math.round(t.progress||0),"%")):(0,a.createElement)("div",{className:"wpifycf-direct-file__info"},(0,a.createElement)(b.Icon,{icon:Q}),(0,a.createElement)("div",{className:"wpifycf-direct-file__details"},(0,a.createElement)("div",{className:"wpifycf-direct-file__header"},s?(0,a.createElement)("a",{href:o(),target:"_blank",rel:"noopener noreferrer",className:"wpifycf-direct-file__name wpifycf-direct-file__name--link"},r()):(0,a.createElement)("span",{className:"wpifycf-direct-file__name"},r()),!n&&(0,a.createElement)("div",{className:"wpifycf-field-multi-direct-file__item__actions"},(0,a.createElement)(U.K,{icon:"trash",onClick:e}))),(0,a.createElement)("span",{className:"wpifycf-direct-file__path"},t.path),(t.size||i?.data?.size)&&(0,a.createElement)("span",{className:"wpifycf-direct-file__size"},(t=>{if(!t)return"";if(0===t)return"0 B";const e=Math.floor(Math.log(t)/Math.log(1024));return Math.round(t/Math.pow(1024,e)*100)/100+" "+["B","KB","MB","GB"][e]})(t.size||i?.data?.size)))),t.error&&(0,a.createElement)("div",{className:"wpifycf-direct-file__error"},t.error)))}function Y({id:t,value:e=[],onChange:n,className:i,disabled:r=!1,allowed_types:o,max_size:s,setTitle:c}){(0,k.Us)(c,Array.isArray(e)&&e.length>0?(0,$.sprintf)((0,$._n)("%d file","%d files",e.length,"wpify-custom-fields"),e.length):""),(0,a.useEffect)((()=>{Array.isArray(e)||n([])}),[e,n]);const[u,h]=(0,a.useState)([]),d=(0,a.useRef)(null),O=(0,a.useRef)(null),f=(0,k.OZ)(),p=(0,a.useRef)([]);(0,a.useEffect)((()=>{JSON.stringify([...e].sort())!==JSON.stringify([...p.current].sort())&&h((t=>t.some((t=>t.uploading))?t:Array.isArray(e)&&e.length>0?e.map(((e,n)=>t.find((t=>t.path===e))||{id:`file-${n}-${e}`,path:e,name:e.split("/").pop(),uploading:!1,progress:0,error:null})):0===e.length?[]:t))}),[e]),(0,a.useEffect)((()=>{const t=u.filter((t=>!t.uploading&&t.path&&!t.error)).map((t=>t.path));JSON.stringify(t.sort())!==JSON.stringify([...e].sort())&&(p.current=t,n(t))}),[u,e,n]);const m=(0,a.useCallback)((t=>{h(t);const e=t.filter((t=>!t.uploading&&t.path)).map((t=>t.path));p.current=e,n(e)}),[n]);(0,k.C_)({containerRef:d,items:u,setItems:m,disabled:r,dragHandle:".wpifycf-field-multi-direct-file__item__sort"});const g=(0,a.useCallback)((async e=>{const n=Array.from(e.target.files);if(0===n.length)return;const i=n.map(((t,e)=>({id:`uploading-${Date.now()}-${e}`,name:t.name,size:t.size,uploading:!0,progress:0,error:null,file:t})));h((t=>[...t,...i]));const r=i.map((async e=>{const n=e.file;if(s&&n.size>s){const t=(s/1024/1024).toFixed(2);return{id:e.id,success:!1,error:(0,$.sprintf)((0,$.__)("File size exceeds maximum allowed size of %sMB","wpify-custom-fields"),t)}}if(o&&o.length>0&&!o.includes(n.type))return{id:e.id,success:!1,error:(0,$.sprintf)((0,$.__)('File type "%s" is not allowed',"wpify-custom-fields"),n.type)};try{const i=await f.mutateAsync({file:n,fieldId:t,onProgress:t=>{h((n=>n.map((n=>n.id===e.id?{...n,progress:t}:n))))}});return{id:e.id,success:!0,response:i}}catch(t){return{id:e.id,success:!1,error:t.message||(0,$.__)("Upload failed","wpify-custom-fields")}}})),a=await Promise.allSettled(r);h((t=>t.map((t=>{const e=a.find((e=>"fulfilled"===e.status&&e.value.id===t.id));if(!e||"rejected"===e.status)return t;const n=e.value;return n.success?{...t,path:n.response.temp_path,size:n.response.size,uploading:!1,progress:0,error:null,file:void 0}:{...t,uploading:!1,progress:0,error:n.error}})))),O.current&&(O.current.value="")}),[t,s,o,f]),y=(0,a.useCallback)((t=>()=>{h((e=>e.filter((e=>e.id!==t))))}),[]);return(0,a.createElement)("div",{className:(0,l.A)("wpifycf-field-multi-direct-file",`wpifycf-field-multi-direct-file--${t}`,i)},(0,a.createElement)("input",{type:"file",ref:O,onChange:g,style:{display:"none"},accept:o&&o.length>0?o.join(","):void 0,multiple:!0}),!r&&(0,a.createElement)(b.Button,{className:"wpifycf-button__add",onClick:()=>{O.current&&O.current.click()},icon:x,variant:"secondary",isSmall:!0},(0,$.__)("Add files","wpify-custom-fields")),u.length>0&&(0,a.createElement)("div",{className:"wpifycf-field-multi-direct-file__items",ref:d},u.map((t=>(0,a.createElement)(D,{key:t.id,file:t,remove:y(t.id),onRemove:y(t.id),disabled:r})))))}Y.checkValidity=_.XK;const B=Y;var G=n(7242),F=n(6733),H=n(5076),K=n(5708),J=n(2220),tt=n(3909),et=n(8742),nt=n(6440),it=n(4379),rt=n(6930),ot=n(6323),st=n(4726),at=n(4549),lt=n(5972),ct=n(5971),ut=n(688),ht=n(9188),dt=n(5484),Ot=n(251),ft=n(9242),pt=n(9428),mt=n(2117),gt=n(3585),yt=n(6791),$t=n(4402),vt=n(4759),bt=n(7032),St=n(955),wt=n(1189),xt=n(2144),Qt=n(5257);const Pt=()=>null;function _t({id:t,htmlId:e,items:n=[],tag:i="div",classname:r,attributes:o={},disabled:s=!1,fieldPath:h,parentValue:d,parentOnChange:O,setTitleFactory:f,validity:p=[]}){const{values:m,updateValue:g}=(0,a.useContext)(u.B),y="function"==typeof O,$=h?h.split(".").slice(0,-1).join("."):"",v=p?.reduce(((t,e)=>"object"==typeof e?{...t,...e}:t),{}),b=(0,a.useCallback)((t=>e=>O&&O({...d,[t]:e})),[d,O]);return(0,a.createElement)(i,{className:(0,l.A)("wpifycf-field-wrapper",r),...o},n.map((t=>{const n=$?`${$}.${t.id}`:t.id;return y?(0,a.createElement)(c.D,{key:t.id,disabled:s,...t,value:d[t.id]||"",onChange:b(t.id),parentValue:d,parentOnChange:O,setTitle:f?f(t.id):Pt,setTitleFactory:f,htmlId:`${e}.${t.id}`,validity:v[t.id],fieldPath:n}):(0,a.createElement)(c.D,{key:t.id,disabled:s,...t,name:t.name||t.id,value:m[t.id],onChange:g(t.id),htmlId:t.id.replace(/[\[\]]+/g,"_"),fieldPath:t.id,setTitle:Pt})})))}_t.renderOptions={noLabel:!0,noFieldWrapper:!0,noControlWrapper:!0};const kt=_t;var Tt=n(1816);const Ct={attachment:r.default,button:o.default,checkbox:s.default,code:f.default,columns:O,color:p.default,date:m.default,date_range:g.default,datetime:y.default,direct_file:C,email:z.default,group:R.default,hidden:E.default,html:A.default,inner_blocks:Z.default,link:M.default,mapycz:V.default,month:X.default,multi_attachment:q.default,multi_button:W.default,multi_checkbox:j.default,multi_date:I.default,multi_date_range:L.default,multi_datetime:N.default,multi_direct_file:B,multi_email:G.default,multi_group:F.default,multi_link:H.default,multi_mapycz:K.default,multi_month:J.default,multi_number:tt.default,multi_post:et.default,multi_select:nt.default,multi_tel:it.default,multi_term:rt.default,multi_text:ot.default,multi_textarea:st.default,multi_time:at.default,multi_toggle:lt.default,multi_url:ct.default,multi_week:ut.default,number:ht.default,password:dt.default,post:Ot.default,radio:ft.default,range:pt.default,select:mt.default,tel:gt.default,term:yt.default,text:$t.default,textarea:vt.default,time:bt.default,title:St.default,toggle:wt.default,url:xt.default,week:Qt.default,wrapper:kt,wysiwyg:Tt.default};function zt(t){Array.isArray(t)?t.forEach(Rt):Rt(t)}function Rt(t){if(document.querySelector(`link[href="${t}"]`))return;const e=document.createElement("link");e.rel="stylesheet",e.href=t,document.head.appendChild(e)}function Et(t){t=t.trim();const e=["javascript:","data:"];for(const n of e)if(t.toLowerCase().startsWith(n))return"";if(t.startsWith("#")||t.startsWith("?"))return t;const n=["mailto:","tel:"];for(const e of n)if(t.toLowerCase().startsWith(e))return At(t,e);t.startsWith("//")?t="https:"+t:t.startsWith("http://")||t.startsWith("https://")||(t="https://"+t);try{return new URL(t).href}catch(t){return""}}function At(t,e){const n=t.slice(e.length);let i;return i="mailto:"===e?function(t){return t=(t=decodeURIComponent(t)).replace(/[^\w.!#$%&'*+/=?^`{|}~@-]/g,""),/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)?t:""}(n):"tel:"===e?function(t){return(t=decodeURIComponent(t)).replace(/[^\d+]/g,"")}(n):n,e+i}function Zt(t,e){return Ct[t]||(0,i.applyFilters)("wpifycf_field_"+t,Ct.text,e)}function Mt(t={},e,n=""){let i=e;const r=e.replace(/^#+/,""),o=e.length-r.length,s=n.split(".");return o>=s.length?console.error(`Invalid path "${e}" in field "${n}"`):o>0&&(i=s.slice(0,s.length-o).join(".")+r),i.split(".").reduce(((t,e)=>{const n=e.match(/^([^\[]+)\[(\d+)]$/);if(n){const e=n[1],i=parseInt(n[2],10);return t&&t[e]?t[e][i]:void 0}return t?t[e]:void 0}),t)}function Vt(t,e,n){try{switch(e){case"!=":return t!=n;case">":return t>n;case">=":return t>=n;case"<":case"<=":return t=(n[0]||-1/0)&&t<=(n[1]||1/0);case"contains":return t?.includes(n);case"not_contains":return!t?.includes(n);case"in":return n?.includes(t);case"not_in":return!n?.includes(t);case"empty":return!1===Boolean(t);case"not_empty":return Boolean(t);default:return t==n}}catch(i){return console.error("Error evaluating condition",e,t,n,i),!0}}function Xt(t,e,n){let i=null;try{if(!Array.isArray(e))return console.error("Conditions must be an array",e),!0;let r="and";for(let o=0;o"wrapper"!==t.type&&"columns"!==t.type||!Array.isArray(t.items)?[t]:qt(t.items))):[]}function Wt(t){const e=document.createElement("div");return e.innerHTML=t,e.textContent||e.innerText||""}function jt(t,e){if(!t||"object"!=typeof t)return t;const n={};for(const[i,r]of Object.entries(t))if("string"==typeof r&&r.includes("{{")&&r.includes("}}")){const t=r.match(/{{([^}]+)}}/);if(t&&t[1]){const o=e(t[1]);n[i]=r.replace(/{{[^}]+}}/g,o||"")}else n[i]=r}else n[i]=r;return n}},8759:(t,e,n)=>{"use strict";n.r(e);var i=n(3829);(0,n(2619).addFilter)("wpifycf_generator_uuid","wpify_custom_fields",((t,e)=>t||(0,i.A)()))},386:(t,e,n)=>{"use strict";n.d(e,{po:()=>De,AS:()=>cn,RZ:()=>on,OZ:()=>rn,Us:()=>Ye,VV:()=>nn,qr:()=>an,BS:()=>sn,tj:()=>Ue,NQ:()=>Be,II:()=>tn,oV:()=>un,P6:()=>Je,j6:()=>He,NW:()=>en,C_:()=>Ne,hf:()=>Ke,LD:()=>Fe,KL:()=>ln});var i=n(1609);function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function o(t){for(var e=1;e"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return!1}return!1}}function v(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function b(t,e,n,i){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&$(t,e):$(t,e))||i&&t===n)return t;if(t===n)break}while(t=v(t))}return null}var S,w=/\s+/g;function x(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var i=(" "+t.className+" ").replace(w," ").replace(" "+e+" "," ");t.className=(i+(n?" "+e:"")).replace(w," ")}}function Q(t,e,n){var i=t&&t.style;if(i){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in i||-1!==e.indexOf("webkit")||(e="-webkit-"+e),i[e]=n+("string"==typeof n?"":"px")}}function P(t,e){var n="";if("string"==typeof t)n=t;else do{var i=Q(t,"transform");i&&"none"!==i&&(n=i+" "+n)}while(!e&&(t=t.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(n)}function _(t,e,n){if(t){var i=t.getElementsByTagName(e),r=0,o=i.length;if(n)for(;r=o:r<=o))return i;if(i===k())break;i=Z(i,!1)}return!1}function z(t,e,n,i){for(var r=0,o=0,s=t.children;o2&&void 0!==arguments[2]?arguments[2]:{},i=n.evt,r=function(t,e){if(null==t)return{};var n,i,r=function(t,e){if(null==t)return{};var n,i,r={},o=Object.keys(t);for(i=0;i=0||(r[n]=t[n]);return r}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}(n,U);N.pluginEvent.bind(Xt)(t,e,o({dragEl:B,parentEl:G,ghostEl:F,rootEl:H,nextEl:K,lastDownEl:J,cloneEl:tt,cloneHidden:et,dragStarted:ft,putSortable:at,activeSortable:Xt.active,originalEvent:i,oldIndex:nt,oldDraggableIndex:rt,newIndex:it,newDraggableIndex:ot,hideGhostForTarget:At,unhideGhostForTarget:Zt,cloneNowHidden:function(){et=!0},cloneNowShown:function(){et=!1},dispatchSortableEvent:function(t){Y({sortable:e,name:t,originalEvent:i})}},r))};function Y(t){!function(t){var e=t.sortable,n=t.rootEl,i=t.name,r=t.targetEl,s=t.cloneEl,a=t.toEl,l=t.fromEl,c=t.oldIndex,d=t.newIndex,O=t.oldDraggableIndex,f=t.newDraggableIndex,p=t.originalEvent,m=t.putSortable,g=t.extraEventProperties;if(e=e||n&&n[j]){var y,$=e.options,v="on"+i.charAt(0).toUpperCase()+i.substr(1);!window.CustomEvent||u||h?(y=document.createEvent("Event")).initEvent(i,!0,!0):y=new CustomEvent(i,{bubbles:!0,cancelable:!0}),y.to=a||n,y.from=l||n,y.item=r||n,y.clone=s,y.oldIndex=c,y.newIndex=d,y.oldDraggableIndex=O,y.newDraggableIndex=f,y.originalEvent=p,y.pullMode=m?m.lastPutMode:void 0;var b=o(o({},g),N.getEventProperties(i,e));for(var S in b)y[S]=b[S];n&&n.dispatchEvent(y),$[v]&&$[v].call(e,y)}}(o({putSortable:at,cloneEl:tt,targetEl:B,rootEl:H,oldIndex:nt,oldDraggableIndex:rt,newIndex:it,newDraggableIndex:ot},t))}var B,G,F,H,K,J,tt,et,nt,it,rt,ot,st,at,lt,ct,ut,ht,dt,Ot,ft,pt,mt,gt,yt,$t=!1,vt=!1,bt=[],St=!1,wt=!1,xt=[],Qt=!1,Pt=[],_t="undefined"!=typeof document,kt=f,Tt=h||u?"cssFloat":"float",Ct=_t&&!p&&!f&&"draggable"in document.createElement("div"),zt=function(){if(_t){if(u)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),Rt=function(t,e){var n=Q(t),i=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),r=z(t,0,e),o=z(t,1,e),s=r&&Q(r),a=o&&Q(o),l=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+T(r).width,c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+T(o).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&s.float&&"none"!==s.float){var u="left"===s.float?"left":"right";return!o||"both"!==a.clear&&a.clear!==u?"horizontal":"vertical"}return r&&("block"===s.display||"flex"===s.display||"table"===s.display||"grid"===s.display||l>=i&&"none"===n[Tt]||o&&"none"===n[Tt]&&l+c>i)?"vertical":"horizontal"},Et=function(t){function e(t,n){return function(i,r,o,s){var a=i.options.group.name&&r.options.group.name&&i.options.group.name===r.options.group.name;if(null==t&&(n||a))return!0;if(null==t||!1===t)return!1;if(n&&"clone"===t)return t;if("function"==typeof t)return e(t(i,r,o,s),n)(i,r,o,s);var l=(n?i:r).options.group.name;return!0===t||"string"==typeof t&&t===l||t.join&&t.indexOf(l)>-1}}var n={},i=t.group;i&&"object"==s(i)||(i={name:i}),n.name=i.name,n.checkPull=e(i.pull,!0),n.checkPut=e(i.put),n.revertClone=i.revertClone,t.group=n},At=function(){!zt&&F&&Q(F,"display","none")},Zt=function(){!zt&&F&&Q(F,"display","")};_t&&!p&&document.addEventListener("click",(function(t){if(vt)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),vt=!1,!1}),!0);var Mt=function(t){if(B){t=t.touches?t.touches[0]:t;var e=(r=t.clientX,o=t.clientY,bt.some((function(t){var e=t[j].options.emptyInsertThreshold;if(e&&!R(t)){var n=T(t),i=r>=n.left-e&&r<=n.right+e,a=o>=n.top-e&&o<=n.bottom+e;return i&&a?s=t:void 0}})),s);if(e){var n={};for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[j]._onDragOver(n)}}var r,o,s},Vt=function(t){B&&B.parentNode[j]._isOutsideThisEl(t.target)};function Xt(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=l({},e),t[j]=this;var n,i,r={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Rt(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Xt.supportPointer&&"PointerEvent"in window&&!O,emptyInsertThreshold:5};for(var s in N.initializePlugins(this,t,r),r)!(s in e)&&(e[s]=r[s]);for(var a in Et(e),this)"_"===a.charAt(0)&&"function"==typeof this[a]&&(this[a]=this[a].bind(this));this.nativeDraggable=!e.forceFallback&&Ct,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?g(t,"pointerdown",this._onTapStart):(g(t,"mousedown",this._onTapStart),g(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(g(t,"dragover",this),g(t,"dragenter",this)),bt.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),l(this,(i=[],{captureAnimationState:function(){i=[],this.options.animation&&[].slice.call(this.el.children).forEach((function(t){if("none"!==Q(t,"display")&&t!==Xt.ghost){i.push({target:t,rect:T(t)});var e=o({},i[i.length-1].rect);if(t.thisAnimationDuration){var n=P(t,!0);n&&(e.top-=n.f,e.left-=n.e)}t.fromRect=e}}))},addAnimationState:function(t){i.push(t)},removeAnimationState:function(t){i.splice(function(t,e){for(var n in t)if(t.hasOwnProperty(n))for(var i in e)if(e.hasOwnProperty(i)&&e[i]===t[n][i])return Number(n);return-1}(i,{target:t}),1)},animateAll:function(t){var e=this;if(!this.options.animation)return clearTimeout(n),void("function"==typeof t&&t());var r=!1,o=0;i.forEach((function(t){var n=0,i=t.target,s=i.fromRect,a=T(i),l=i.prevFromRect,c=i.prevToRect,u=t.rect,h=P(i,!0);h&&(a.top-=h.f,a.left-=h.e),i.toRect=a,i.thisAnimationDuration&&M(l,a)&&!M(s,a)&&(u.top-a.top)/(u.left-a.left)==(s.top-a.top)/(s.left-a.left)&&(n=function(t,e,n,i){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))*i.animation}(u,l,c,e.options)),M(a,s)||(i.prevFromRect=s,i.prevToRect=a,n||(n=e.options.animation),e.animate(i,u,a,n)),n&&(r=!0,o=Math.max(o,n),clearTimeout(i.animationResetTimer),i.animationResetTimer=setTimeout((function(){i.animationTime=0,i.prevFromRect=null,i.fromRect=null,i.prevToRect=null,i.thisAnimationDuration=null}),n),i.thisAnimationDuration=n)})),clearTimeout(n),r?n=setTimeout((function(){"function"==typeof t&&t()}),o):"function"==typeof t&&t(),i=[]},animate:function(t,e,n,i){if(i){Q(t,"transition",""),Q(t,"transform","");var r=P(this.el),o=r&&r.a,s=r&&r.d,a=(e.left-n.left)/(o||1),l=(e.top-n.top)/(s||1);t.animatingX=!!a,t.animatingY=!!l,Q(t,"transform","translate3d("+a+"px,"+l+"px,0)"),this.forRepaintDummy=function(t){return t.offsetWidth}(t),Q(t,"transition","transform "+i+"ms"+(this.options.easing?" "+this.options.easing:"")),Q(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout((function(){Q(t,"transition",""),Q(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1}),i)}}}))}function qt(t,e,n,i,r,o,s,a){var l,c,d=t[j],O=d.options.onMove;return!window.CustomEvent||u||h?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=e,l.from=t,l.dragged=n,l.draggedRect=i,l.related=r||e,l.relatedRect=o||T(e),l.willInsertAfter=a,l.originalEvent=s,t.dispatchEvent(l),O&&(c=O.call(d,l,s)),c}function Wt(t){t.draggable=!1}function jt(){Qt=!1}function It(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,i=0;n--;)i+=e.charCodeAt(n);return i.toString(36)}function Lt(t){return setTimeout(t,0)}function Nt(t){return clearTimeout(t)}Xt.prototype={constructor:Xt,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(pt=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,B):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,i=this.options,r=i.preventOnFilter,o=t.type,s=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,a=(s||t).target,l=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||a,c=i.filter;if(function(t){Pt.length=0;for(var e=t.getElementsByTagName("input"),n=e.length;n--;){var i=e[n];i.checked&&Pt.push(i)}}(n),!B&&!(/mousedown|pointerdown/.test(o)&&0!==t.button||i.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!O||!a||"SELECT"!==a.tagName.toUpperCase())&&!((a=b(a,i.draggable,n,!1))&&a.animated||J===a)){if(nt=E(a),rt=E(a,i.draggable),"function"==typeof c){if(c.call(this,t,a,this))return Y({sortable:e,rootEl:l,name:"filter",targetEl:a,toEl:n,fromEl:n}),D("filter",e,{evt:t}),void(r&&t.cancelable&&t.preventDefault())}else if(c&&(c=c.split(",").some((function(i){if(i=b(l,i.trim(),n,!1))return Y({sortable:e,rootEl:i,name:"filter",targetEl:a,fromEl:n,toEl:n}),D("filter",e,{evt:t}),!0}))))return void(r&&t.cancelable&&t.preventDefault());i.handle&&!b(l,i.handle,n,!1)||this._prepareDragStart(t,s,a)}}},_prepareDragStart:function(t,e,n){var i,r=this,o=r.el,s=r.options,a=o.ownerDocument;if(n&&!B&&n.parentNode===o){var l=T(n);if(H=o,G=(B=n).parentNode,K=B.nextSibling,J=n,st=s.group,Xt.dragged=B,lt={target:B,clientX:(e||t).clientX,clientY:(e||t).clientY},dt=lt.clientX-l.left,Ot=lt.clientY-l.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,B.style["will-change"]="all",i=function(){D("delayEnded",r,{evt:t}),Xt.eventCanceled?r._onDrop():(r._disableDelayedDragEvents(),!d&&r.nativeDraggable&&(B.draggable=!0),r._triggerDragStart(t,e),Y({sortable:r,name:"choose",originalEvent:t}),x(B,s.chosenClass,!0))},s.ignore.split(",").forEach((function(t){_(B,t.trim(),Wt)})),g(a,"dragover",Mt),g(a,"mousemove",Mt),g(a,"touchmove",Mt),g(a,"mouseup",r._onDrop),g(a,"touchend",r._onDrop),g(a,"touchcancel",r._onDrop),d&&this.nativeDraggable&&(this.options.touchStartThreshold=4,B.draggable=!0),D("delayStart",this,{evt:t}),!s.delay||s.delayOnTouchOnly&&!e||this.nativeDraggable&&(h||u))i();else{if(Xt.eventCanceled)return void this._onDrop();g(a,"mouseup",r._disableDelayedDrag),g(a,"touchend",r._disableDelayedDrag),g(a,"touchcancel",r._disableDelayedDrag),g(a,"mousemove",r._delayedDragTouchMoveHandler),g(a,"touchmove",r._delayedDragTouchMoveHandler),s.supportPointer&&g(a,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(i,s.delay)}}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){B&&Wt(B),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;y(t,"mouseup",this._disableDelayedDrag),y(t,"touchend",this._disableDelayedDrag),y(t,"touchcancel",this._disableDelayedDrag),y(t,"mousemove",this._delayedDragTouchMoveHandler),y(t,"touchmove",this._delayedDragTouchMoveHandler),y(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?g(document,"pointermove",this._onTouchMove):g(document,e?"touchmove":"mousemove",this._onTouchMove):(g(B,"dragend",this),g(H,"dragstart",this._onDragStart));try{document.selection?Lt((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){if($t=!1,H&&B){D("dragStarted",this,{evt:e}),this.nativeDraggable&&g(document,"dragover",Vt);var n=this.options;!t&&x(B,n.dragClass,!1),x(B,n.ghostClass,!0),Xt.active=this,t&&this._appendGhost(),Y({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(ct){this._lastX=ct.clientX,this._lastY=ct.clientY,At();for(var t=document.elementFromPoint(ct.clientX,ct.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(ct.clientX,ct.clientY))!==e;)e=t;if(B.parentNode[j]._isOutsideThisEl(t),e)do{if(e[j]&&e[j]._onDragOver({clientX:ct.clientX,clientY:ct.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break;t=e}while(e=v(e));Zt()}},_onTouchMove:function(t){if(lt){var e=this.options,n=e.fallbackTolerance,i=e.fallbackOffset,r=t.touches?t.touches[0]:t,o=F&&P(F,!0),s=F&&o&&o.a,a=F&&o&&o.d,l=kt&&yt&&A(yt),c=(r.clientX-lt.clientX+i.x)/(s||1)+(l?l[0]-xt[0]:0)/(s||1),u=(r.clientY-lt.clientY+i.y)/(a||1)+(l?l[1]-xt[1]:0)/(a||1);if(!Xt.active&&!$t){if(n&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))r.right+10||t.clientY>i.bottom&&t.clientX>i.left:t.clientY>r.bottom+10||t.clientX>i.right&&t.clientY>i.top}(t,r,this)&&!m.animated){if(m===B)return L(!1);if(m&&s===t.target&&(a=m),a&&(n=T(a)),!1!==qt(H,s,B,e,a,n,t,!!a))return I(),m&&m.nextSibling?s.insertBefore(B,m.nextSibling):s.appendChild(B),G=s,N(),L(!0)}else if(m&&function(t,e,n){var i=T(z(n.el,0,n.options,!0)),r=W(n.el,n.options,F);return e?t.clientXu+c*o/2:lh-gt)return-mt}else if(l>u+c*(1-r)/2&&lh-c*o/2)?l>u+c/2?1:-1:0}(t,a,n,r,w?1:l.swapThreshold,null==l.invertedSwapThreshold?l.swapThreshold:l.invertedSwapThreshold,wt,pt===a),0!==y){var A=E(B);do{A-=y,v=G.children[A]}while(v&&("none"===Q(v,"display")||v===F))}if(0===y||v===a)return L(!1);pt=a,mt=y;var Z=a.nextElementSibling,M=!1,V=qt(H,s,B,e,a,n,t,M=1===y);if(!1!==V)return 1!==V&&-1!==V||(M=1===V),Qt=!0,setTimeout(jt,30),I(),M&&!Z?s.appendChild(B):a.parentNode.insertBefore(B,M?Z:a),_&&X(_,0,k-_.scrollTop),G=B.parentNode,void 0===$||wt||(gt=Math.abs($-T(a)[P])),N(),L(!0)}if(s.contains(B))return L(!1)}return!1}function q(l,c){D(l,f,o({evt:t,isOwner:h,axis:r?"vertical":"horizontal",revert:i,dragRect:e,targetRect:n,canSort:d,fromSortable:O,target:a,completed:L,onMove:function(n,i){return qt(H,s,B,e,n,T(n),t,i)},changed:N},c))}function I(){q("dragOverAnimationCapture"),f.captureAnimationState(),f!==O&&O.captureAnimationState()}function L(e){return q("dragOverCompleted",{insertion:e}),e&&(h?u._hideClone():u._showClone(f),f!==O&&(x(B,at?at.options.ghostClass:u.options.ghostClass,!1),x(B,l.ghostClass,!0)),at!==f&&f!==Xt.active?at=f:f===Xt.active&&at&&(at=null),O===f&&(f._ignoreWhileAnimating=a),f.animateAll((function(){q("dragOverAnimationComplete"),f._ignoreWhileAnimating=null})),f!==O&&(O.animateAll(),O._ignoreWhileAnimating=null)),(a===B&&!B.animated||a===s&&!a.animated)&&(pt=null),l.dragoverBubble||t.rootEl||a===document||(B.parentNode[j]._isOutsideThisEl(t.target),!e&&Mt(t)),!l.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),p=!0}function N(){it=E(B),ot=E(B,l.draggable),Y({sortable:f,name:"change",toEl:s,newIndex:it,newDraggableIndex:ot,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){y(document,"mousemove",this._onTouchMove),y(document,"touchmove",this._onTouchMove),y(document,"pointermove",this._onTouchMove),y(document,"dragover",Mt),y(document,"mousemove",Mt),y(document,"touchmove",Mt)},_offUpEvents:function(){var t=this.el.ownerDocument;y(t,"mouseup",this._onDrop),y(t,"touchend",this._onDrop),y(t,"pointerup",this._onDrop),y(t,"touchcancel",this._onDrop),y(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;it=E(B),ot=E(B,n.draggable),D("drop",this,{evt:t}),G=B&&B.parentNode,it=E(B),ot=E(B,n.draggable),Xt.eventCanceled||($t=!1,wt=!1,St=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Nt(this.cloneId),Nt(this._dragStartId),this.nativeDraggable&&(y(document,"drop",this),y(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),O&&Q(document.body,"user-select",""),Q(B,"transform",""),t&&(ft&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),F&&F.parentNode&&F.parentNode.removeChild(F),(H===G||at&&"clone"!==at.lastPutMode)&&tt&&tt.parentNode&&tt.parentNode.removeChild(tt),B&&(this.nativeDraggable&&y(B,"dragend",this),Wt(B),B.style["will-change"]="",ft&&!$t&&x(B,at?at.options.ghostClass:this.options.ghostClass,!1),x(B,this.options.chosenClass,!1),Y({sortable:this,name:"unchoose",toEl:G,newIndex:null,newDraggableIndex:null,originalEvent:t}),H!==G?(it>=0&&(Y({rootEl:G,name:"add",toEl:G,fromEl:H,originalEvent:t}),Y({sortable:this,name:"remove",toEl:G,originalEvent:t}),Y({rootEl:G,name:"sort",toEl:G,fromEl:H,originalEvent:t}),Y({sortable:this,name:"sort",toEl:G,originalEvent:t})),at&&at.save()):it!==nt&&it>=0&&(Y({sortable:this,name:"update",toEl:G,originalEvent:t}),Y({sortable:this,name:"sort",toEl:G,originalEvent:t})),Xt.active&&(null!=it&&-1!==it||(it=nt,ot=rt),Y({sortable:this,name:"end",toEl:G,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){D("nulling",this),H=B=G=F=K=tt=J=et=lt=ct=ft=it=ot=nt=rt=pt=mt=at=st=Xt.dragged=Xt.ghost=Xt.clone=Xt.active=null,Pt.forEach((function(t){t.checked=!0})),Pt.length=ut=ht=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":B&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],n=this.el.children,i=0,r=n.length,o=this.options;i{Object.defineProperty(n,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),e?.(i),t[i])})})),n}trackProp(t){this.#Q.add(t)}getCurrentQuery(){return this.#f}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#h.defaultQueryOptions(t),n=this.#h.getQueryCache().build(this.#h,e);return n.fetch().then((()=>this.createResult(n,e)))}fetch(t){return this.#P({...t,cancelRefetch:t.cancelRefetch??!0}).then((()=>(this.updateResult(),this.#m)))}#P(t){this.#C();let e=this.#f.fetch(this.options,t);return t?.throwOnError||(e=e.catch(de.lQ)),e}#z(){this.#k();const t=(0,de.d2)(this.options.staleTime,this.#f);if(de.S$||this.#m.isStale||!(0,de.gn)(t))return;const e=(0,de.j3)(this.#m.dataUpdatedAt,t)+1;this.#S=setTimeout((()=>{this.#m.isStale||this.updateResult()}),e)}#R(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#f):this.options.refetchInterval)??!1}#E(t){this.#T(),this.#x=t,!de.S$&&!1!==(0,de.Eh)(this.options.enabled,this.#f)&&(0,de.gn)(this.#x)&&0!==this.#x&&(this.#w=setInterval((()=>{(this.options.refetchIntervalInBackground||ae.m.isFocused())&&this.#P()}),this.#x))}#_(){this.#z(),this.#E(this.#R())}#k(){this.#S&&(clearTimeout(this.#S),this.#S=void 0)}#T(){this.#w&&(clearInterval(this.#w),this.#w=void 0)}createResult(t,e){const n=this.#f,i=this.options,r=this.#m,o=this.#g,s=this.#y,a=t!==n?t.state:this.#p,{state:l}=t;let c,u={...l},h=!1;if(e._optimisticResults){const r=this.hasListeners(),o=!r&&fe(t,e),s=r&&me(t,n,e,i);(o||s)&&(u={...u,...(0,ce.k)(l.data,t.options)}),"isRestoring"===e._optimisticResults&&(u.fetchStatus="idle")}let{error:d,errorUpdatedAt:O,status:f}=u;if(e.select&&void 0!==u.data)if(r&&u.data===o?.data&&e.select===this.#$)c=this.#v;else try{this.#$=e.select,c=e.select(u.data),c=(0,de.pl)(r?.data,c,e),this.#v=c,this.#d=null}catch(t){this.#d=t}else c=u.data;if(void 0!==e.placeholderData&&void 0===c&&"pending"===f){let t;if(r?.isPlaceholderData&&e.placeholderData===s?.placeholderData)t=r.data;else if(t="function"==typeof e.placeholderData?e.placeholderData(this.#b?.state.data,this.#b):e.placeholderData,e.select&&void 0!==t)try{t=e.select(t),this.#d=null}catch(t){this.#d=t}void 0!==t&&(f="success",c=(0,de.pl)(r?.data,t,e),h=!0)}this.#d&&(d=this.#d,c=this.#v,O=Date.now(),f="error");const p="fetching"===u.fetchStatus,m="pending"===f,g="error"===f,y=m&&p,$=void 0!==c,v={status:f,fetchStatus:u.fetchStatus,isPending:m,isSuccess:"success"===f,isError:g,isInitialLoading:y,isLoading:y,data:c,dataUpdatedAt:u.dataUpdatedAt,error:d,errorUpdatedAt:O,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>a.dataUpdateCount||u.errorUpdateCount>a.errorUpdateCount,isFetching:p,isRefetching:p&&!m,isLoadingError:g&&!$,isPaused:"paused"===u.fetchStatus,isPlaceholderData:h,isRefetchError:g&&$,isStale:ge(t,e),refetch:this.refetch,promise:this.#O};if(this.options.experimental_prefetchInRender){const e=t=>{"error"===v.status?t.reject(v.error):void 0!==v.data&&t.resolve(v.data)},i=()=>{const t=this.#O=v.promise=(0,he.T)();e(t)},r=this.#O;switch(r.status){case"pending":t.queryHash===n.queryHash&&e(r);break;case"fulfilled":"error"!==v.status&&v.data===r.value||i();break;case"rejected":"error"===v.status&&v.error===r.reason||i()}}return v}updateResult(t){const e=this.#m,n=this.createResult(this.#f,this.options);if(this.#g=this.#f.state,this.#y=this.options,void 0!==this.#g.data&&(this.#b=this.#f),(0,de.f8)(n,e))return;this.#m=n;const i={};!1!==t?.listeners&&(()=>{if(!e)return!0;const{notifyOnChangeProps:t}=this.options,n="function"==typeof t?t():t;if("all"===n||!n&&!this.#Q.size)return!0;const i=new Set(n??this.#Q);return this.options.throwOnError&&i.add("error"),Object.keys(this.#m).some((t=>{const n=t;return this.#m[n]!==e[n]&&i.has(n)}))})()&&(i.listeners=!0),this.#A({...i,...t})}#C(){const t=this.#h.getQueryCache().build(this.#h,this.options);if(t===this.#f)return;const e=this.#f;this.#f=t,this.#p=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#_()}#A(t){le.j.batch((()=>{t.listeners&&this.listeners.forEach((t=>{t(this.#m)})),this.#h.getQueryCache().notify({query:this.#f,type:"observerResultsUpdated"})}))}};function fe(t,e){return function(t,e){return!1!==(0,de.Eh)(e.enabled,t)&&void 0===t.state.data&&!("error"===t.state.status&&!1===e.retryOnMount)}(t,e)||void 0!==t.state.data&&pe(t,e,e.refetchOnMount)}function pe(t,e,n){if(!1!==(0,de.Eh)(e.enabled,t)){const i="function"==typeof n?n(t):n;return"always"===i||!1!==i&&ge(t,e)}return!1}function me(t,e,n,i){return(t!==e||!1===(0,de.Eh)(i.enabled,t))&&(!n.suspense||"error"!==t.state.status)&&ge(t,n)}function ge(t,e){return!1!==(0,de.Eh)(e.enabled,t)&&t.isStaleByTime((0,de.d2)(e.staleTime,t))}var ye=n(46);n(4848);var $e=i.createContext(function(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}()),ve=()=>i.useContext($e);function be(t,e){return"function"==typeof t?t(...e):!!t}function Se(){}var we=(t,e)=>{(t.suspense||t.throwOnError)&&(e.isReset()||(t.retryOnMount=!1))},xe=t=>{i.useEffect((()=>{t.clearReset()}),[t])},Qe=({result:t,errorResetBoundary:e,throwOnError:n,query:i})=>t.isError&&!e.isReset()&&!t.isFetching&&i&&be(n,[t.error,i]),Pe=i.createContext(!1),_e=()=>i.useContext(Pe),ke=(Pe.Provider,t=>{t.suspense&&(void 0===t.staleTime&&(t.staleTime=1e3),"number"==typeof t.gcTime&&(t.gcTime=Math.max(t.gcTime,1e3)))}),Te=(t,e)=>t.isLoading&&t.isFetching&&!e,Ce=(t,e)=>t?.suspense&&e.isPending,ze=(t,e,n)=>e.fetchOptimistic(t).catch((()=>{n.clearReset()}));function Re(t,e){return function(t,e,n){const r=(0,ye.jE)(n),o=_e(),s=ve(),a=r.defaultQueryOptions(t);r.getDefaultOptions().queries?._experimental_beforeQuery?.(a),a._optimisticResults=o?"isRestoring":"optimistic",ke(a),we(a,s),xe(s);const l=!r.getQueryCache().get(a.queryHash),[c]=i.useState((()=>new e(r,a))),u=c.getOptimisticResult(a);if(i.useSyncExternalStore(i.useCallback((t=>{const e=o?()=>{}:c.subscribe(le.j.batchCalls(t));return c.updateResult(),e}),[c,o]),(()=>c.getCurrentResult()),(()=>c.getCurrentResult())),i.useEffect((()=>{c.setOptions(a,{listeners:!1})}),[a,c]),Ce(a,u))throw ze(a,c,s);if(Qe({result:u,errorResetBoundary:s,throwOnError:a.throwOnError,query:r.getQueryCache().get(a.queryHash)}))throw u.error;if(r.getDefaultOptions().queries?._experimental_afterQuery?.(a,u),a.experimental_prefetchInRender&&!de.S$&&Te(u,o)){const t=l?ze(a,c,s):r.getQueryCache().get(a.queryHash)?.promise;t?.catch(Se).finally((()=>{c.hasListeners()||c.updateResult()}))}return a.notifyOnChangeProps?u:c.trackResult(u)}(t,Oe,e)}var Ee=n(6158),Ae=class extends ue.Q{#h;#m=void 0;#Z;#M;constructor(t,e){super(),this.#h=t,this.setOptions(e),this.bindMethods(),this.#V()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const e=this.options;this.options=this.#h.defaultMutationOptions(t),(0,de.f8)(this.options,e)||this.#h.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#Z,observer:this}),e?.mutationKey&&this.options.mutationKey&&(0,de.EN)(e.mutationKey)!==(0,de.EN)(this.options.mutationKey)?this.reset():"pending"===this.#Z?.state.status&&this.#Z.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#Z?.removeObserver(this)}onMutationUpdate(t){this.#V(),this.#A(t)}getCurrentResult(){return this.#m}reset(){this.#Z?.removeObserver(this),this.#Z=void 0,this.#V(),this.#A()}mutate(t,e){return this.#M=e,this.#Z?.removeObserver(this),this.#Z=this.#h.getMutationCache().build(this.#h,this.options),this.#Z.addObserver(this),this.#Z.execute(t)}#V(){const t=this.#Z?.state??(0,Ee.$)();this.#m={...t,isPending:"pending"===t.status,isSuccess:"success"===t.status,isError:"error"===t.status,isIdle:"idle"===t.status,mutate:this.mutate,reset:this.reset}}#A(t){le.j.batch((()=>{if(this.#M&&this.hasListeners()){const e=this.#m.variables,n=this.#m.context;"success"===t?.type?(this.#M.onSuccess?.(t.data,e,n),this.#M.onSettled?.(t.data,null,e,n)):"error"===t?.type&&(this.#M.onError?.(t.error,e,n),this.#M.onSettled?.(void 0,t.error,e,n))}this.listeners.forEach((t=>{t(this.#m)}))}))}};function Ze(t,e){const n=(0,ye.jE)(e),[r]=i.useState((()=>new Ae(n,t)));i.useEffect((()=>{r.setOptions(t)}),[r,t]);const o=i.useSyncExternalStore(i.useCallback((t=>r.subscribe(le.j.batchCalls(t))),[r]),(()=>r.getCurrentResult()),(()=>r.getCurrentResult())),s=i.useCallback(((t,e)=>{r.mutate(t,e).catch(Se)}),[r]);if(o.error&&be(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:s,mutateAsync:o.mutate}}const Me=window.wp.url,Ve=window.wp.apiFetch;var Xe=n.n(Ve);function qe(t,e={}){return t.match(/^https?:\/\//)?Xe()({url:(0,Me.addQueryArgs)(t,e)}):Xe()({path:(0,Me.addQueryArgs)(t,e)})}function We(t,e={},n){const i={method:"POST",data:e,...n};return t.match(/^https?:\/\//)?Xe()({url:t,...i}):Xe()({path:t,...i})}var je=n(7143);window.wp.coreData;var Ie=n(5103),Le=n(7316);function Ne({containerRef:t,draggable:e,handle:n,items:r,setItems:o,disabled:s=!1}){const a=(0,i.useCallback)((t=>{t.stopPropagation();const e=[...r],[n]=e.splice(t.oldIndex,1);e.splice(t.newIndex,0,n),o(e,t.oldIndex,t.newIndex)}),[r,o]),l=(0,i.useCallback)((t=>t.stopPropagation()),[]);(0,i.useEffect)((()=>(t.current&&(t.current.addEventListener("drag",l),t.current.addEventListener("dragend",l),t.current.addEventListener("dragenter",l),t.current.addEventListener("dragexit",l),t.current.addEventListener("dragleave",l),t.current.addEventListener("dragover",l),t.current.addEventListener("dragstart",l),t.current.addEventListener("drop",l)),()=>{t.current&&(t.current.removeEventListener("drag",l),t.current.removeEventListener("dragend",l),t.current.removeEventListener("dragenter",l),t.current.removeEventListener("dragexit",l),t.current.removeEventListener("dragleave",l),t.current.removeEventListener("dragover",l),t.current.removeEventListener("dragstart",l),t.current.removeEventListener("drop",l))})),[t.current,l]),(0,i.useEffect)((()=>{let i;const r={animation:150,onEnd:a,disabled:s};return e&&(r.draggable=e),n&&(r.handle=n),t.current&&(i=oe.create(t.current,r)),()=>{i&&i.destroy()}}),[t.current,a,e,n])}function Ue({value:t,onChange:e,multiple:n=!1,title:r,button:o,type:s}){return(0,i.useCallback)((()=>{const i={multiple:n,title:r};s&&(i.library={type:s}),o&&(i.button={text:o});const a=wp.media(i);a.on("select",(()=>{let i;if(n){const e=a.state().get("selection").toJSON();i=Array.from(new Set([...e.map((t=>t.id)),...t]))}else i=a.state().get("selection").first().toJSON().id;"function"==typeof e&&e(i)})).open()}),[t,e,n,r,o,s])}function De(t){const[e,n]=(0,i.useState)(null);return(0,i.useEffect)((()=>{t&&wp.media.attachment(t).fetch().then(n)}),[t]),{attachment:e,setAttachment:n}}function Ye(t,e){(0,i.useEffect)((()=>{"function"==typeof t&&t(null!=e&&""!==e?String(e):"")}),[t,e])}function Be({value:t,onChange:e,min:n,max:r,defaultValue:o,disabled_buttons:s=[],dragHandle:a,disabled:l=!1,collapse:c=!0,onMutate:u}){const h=(0,i.useRef)(null),[d,O]=(0,i.useState)((0,se.A)()),[f,p]=(0,i.useState)((()=>Array(t.length).fill(c)));(0,i.useEffect)((()=>{Array.isArray(t)||e([])}),[]),(0,i.useEffect)((()=>{p((e=>{const n=[];for(let i=0;i{const n=[...t,o];e(n),p((t=>[...t,!1])),O((0,se.A)()),u&&u({type:"add",value:n,oldValue:t})}),[t,o,e,u]),g=(0,i.useCallback)((n=>()=>{if(Array.isArray(t)){const i=[...t];i.splice(n,1),e(i),O((0,se.A)()),p((t=>{const e=[...t];return e.splice(n,1),e})),u&&u({type:"remove",value:i,oldValue:t,index:n})}else e([]),p([]),O((0,se.A)()),u&&u({type:"remove",value:[],oldValue:t,index:n})}),[t,e,u]),y=(0,i.useCallback)((n=>()=>{const i=[...t];i.splice(n,0,i[n]),e(i),O((0,se.A)()),p((t=>{const e=[...t];return e.splice(n+1,0,!1),e})),u&&u({type:"duplicate",value:i,oldValue:t,index:n})}),[e,t,u]),$=(0,i.useCallback)((n=>i=>{const r=[...t];r[n]=i,e(r)}),[t,e]),v=(0,i.useCallback)(((n,i,r)=>{if(!l){O((0,se.A)()),e(n);const o=Array.from({length:n.length},((t,e)=>e));o.splice(i,1),o.splice(r,0,i),p((t=>o.map((e=>t[e])))),u&&u({type:"sort",value:n,oldValue:t,indexMap:o})}}),[e,t,l,u]);Ne({containerRef:h,items:t,setItems:v,handle:a,disabled:l}),(0,i.useEffect)((()=>{if(void 0!==n&&t.length[...t,...i.map((()=>!1))]))}void 0!==r&&t.length>r&&(e(t.slice(0,r)),p((t=>t.slice(0,r))))}),[e,t,n,r,o]);const b=t.length,S=!l&&!s.includes("move")&&(void 0===r||bn),x=!l&&!s.includes("move")&&b>1,Q=!l&&!s.includes("duplicate"),P=(0,i.useCallback)(((t,e=null)=>c?()=>{p((n=>{const i=[...n];return i[t]=null!==e?e:!i[t],i}))}:()=>{}),[c]);return{add:m,remove:g,duplicate:y,handleChange:$,canAdd:S,canRemove:w,canMove:x,canDuplicate:Q,containerRef:h,keyPrefix:d,collapsed:f,toggleCollapsed:P}}const Ge={retry:1,retryOnMount:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1};function Fe(t){const{config:e}=(0,i.useContext)(Le.B);return Re({queryKey:["url-title",t],queryFn:()=>qe(e.api_path+"/url-title",{url:t}),enabled:!!e.api_path&&!!t,initialData:"",...Ge})}function He({postType:t,select:e,enabled:n=!0,initialData:r=[],...o}){const{config:s}=(0,i.useContext)(Le.B);return Re({queryKey:["posts",t,o.search,o],queryFn:()=>qe(s.api_path+"/posts",{post_type:t,...o}),initialData:r,enabled:n&&!!t&&!!s.api_path,select:e,...Ge})}function Ke({taxonomy:t,select:e,enabled:n=!0,initialData:r=[],...o}){const{config:s}=(0,i.useContext)(Le.B);return Re({queryKey:["terms",t,o],queryFn:()=>qe(s.api_path+"/terms",{taxonomy:t,...o}),initialData:r,enabled:n&&!!t&&!!s.api_path,select:e,...Ge})}function Je(t=[]){return(0,je.useSelect)((e=>{const n=e("core").getPostTypes();return n&&0!==t.length?n.filter((e=>!Array.isArray(t)||t.includes(e.slug))):[]}),[])}function tn({optionsKey:t,initialData:e=[{value:"",label:"Loading..."}],enabled:n=!0,select:r,...o}){const{config:s}=(0,i.useContext)(Le.B);return Re({queryKey:["options",t,o],queryFn:()=>qe(s.api_path+"/options/"+t,o),initialData:e,enabled:n&&!!s.api_path&&!!t,select:r,...Ge})}function en({blockName:t,attributes:e,postId:n}){const{config:r}=(0,i.useContext)(Le.B);return Re({queryKey:["render-block",n,t,e],queryFn:()=>We(r.api_path+"/render-block/"+t,{attributes:e,postId:n}),enabled:!!r.api_path,...Ge})}function nn(){const{config:t}=(0,i.useContext)(Le.B),e=(0,ye.jE)(),n=Re({queryKey:["mapycz-api-key"],queryFn:()=>qe(t.api_path+"/mapycz-api-key"),enabled:!!t.api_path,...Ge}),r=Ze({mutationFn:e=>We(t.api_path+"/mapycz-api-key",{api_key:e}),mutationKey:["mapycz-api-key"],onSuccess:()=>e.invalidateQueries(["mapycz-api-key"])}),o=(0,i.useCallback)((t=>r.mutate(t)),[r]),s=n.isLoading||r.isPending,a=n.isError||r.isError,l=n.isSuccess||r.isSuccess,c=n.isPending&&r.isIdle;return{apiKey:n.data,isFetching:s,isError:a,isSuccess:l,isIdle:c,handleUpdate:o}}function rn(){const{config:t}=(0,i.useContext)(Le.B);return Ze({mutationFn:async({file:e,fieldId:n,onProgress:i})=>{const r=new FormData;return r.append("file",e),n&&r.append("field_id",n),new Promise(((e,n)=>{const o=new XMLHttpRequest;o.upload.addEventListener("progress",(t=>{if(t.lengthComputable&&i){const e=t.loaded/t.total*100;i(e)}})),o.addEventListener("load",(()=>{if(200===o.status)try{e(JSON.parse(o.responseText))}catch(t){n(new Error("Invalid response from server"))}else try{const t=JSON.parse(o.responseText);n(new Error(t.message||"Upload failed"))}catch(t){n(new Error("Upload failed"))}})),o.addEventListener("error",(()=>{n(new Error("Upload failed"))})),o.open("POST",window.wpApiSettings.root+t.api_path+"/direct-file-upload"),o.setRequestHeader("X-WP-Nonce",window.wpApiSettings.nonce),o.send(r)}))}})}function on(t){const{config:e}=(0,i.useContext)(Le.B);return Re({queryKey:["direct-file-info",t],queryFn:()=>qe(e.api_path+"/direct-file-info",{file_path:t}),enabled:!!e.api_path&&!!t&&"string"==typeof t&&""!==t,...Ge})}function sn({query:t,apiKey:e,limit:n=10,lang:i="en"}){return Re({queryKey:["mapycz-suggestions",t],queryFn:()=>qe("https://api.mapy.cz/v1/suggest",{limit:n,query:t,apiKey:e,lang:i}),enabled:!!t&&!!e,initialData:{items:[],locality:[]},...Ge})}function an({apiKey:t,lang:e="en",latitude:n,longitude:i}){return Re({queryKey:["mapycz-reverse-geocode",n,i],queryFn:()=>qe("https://api.mapy.cz/v1/rgeocode/",{apikey:t,lang:e,lat:n,lon:i}),enabled:!!t&&!!n&&!!i,...Ge})}function ln({form:t}={}){const[e,n]=(0,i.useState)({}),[r,o]=(0,i.useState)(!1),s=(0,i.useCallback)((t=>e=>n((n=>JSON.stringify(n[t])===JSON.stringify(e)?n:{...n,[t]:e}))),[n]),a=(0,i.useCallback)((t=>{if(e&&Object.values(e).some((t=>t.length>0)))t.preventDefault(),t.target.querySelectorAll('.submitbox input[type="submit"].disabled').forEach((t=>t.classList.remove("disabled"))),t.target.querySelectorAll(".submitbox .spinner.is-active").forEach((t=>t.classList.remove("is-active"))),o(!0);else{const e=window.location.hash;if(e){const n=t.target.querySelector('input[name="_wp_http_referer"]');n&&(n.value=n.value.replace(/#.*$/,"")+e)}o(!1)}}),[e,o]);return(0,i.useEffect)((()=>(t&&t.addEventListener("submit",a),()=>{t&&t.removeEventListener("submit",a)})),[a,t]),{validity:e,validate:r,handleValidityChange:s}}function cn({conditions:t=[],fieldPath:e=""}){const{values:n}=(0,i.useContext)(Le.B);return(0,i.useMemo)((()=>0===Object.keys(n).length||!t||0===t.length||!e||(0,Ie.wz)(n,t,e)),[t,n,e])}function un(t){const{values:e}=(0,i.useContext)(Le.B),n=(0,i.useCallback)((n=>(0,Ie.Em)(e,n,t)),[t,e]);return{values:e,getValue:n}}},1014:(t,e,n)=>{"use strict";n.d(e,{Bd:()=>u,E2:()=>O,QH:()=>a,QM:()=>f,Vj:()=>l,XK:()=>g,e6:()=>s,gX:()=>h,jx:()=>m,l1:()=>y,qK:()=>p,u9:()=>$,wZ:()=>c,x4:()=>d});var i=n(7723),r=n(5103);function o(t){return"string"==typeof t&&""!==t.trim()}function s(t,e){const n=[];return e.required&&!o(t)&&n.push((0,i.__)("This field is required.","wpify-custom-fields")),n}function a(t,e){const n=[];return!e.required||parseInt(t)>0||n.push((0,i.__)("This field is required.","wpify-custom-fields")),n}function l(t,e){const n=[];return e.required&&!Boolean(t)&&n.push((0,i.__)("This field is required.","wpify-custom-fields")),n}function c(t,e){const n=[];return e.required&&!o(t)&&n.push((0,i.__)("This field is required.","wpify-custom-fields")),n}function u(t,e){const n=[];return e.required&&!o(t)&&n.push((0,i.__)("This field is required.","wpify-custom-fields")),o(t)&&!/^.+@.+\..+$/.test(t)&&n.push((0,i.__)("This field must be a valid email address.","wpify-custom-fields")),n}function h(t={},e){const n=[];return Array.isArray(e.items)&&(0,r.of)(e.items).forEach((e=>{const i=(0,r.JC)(e.type);if("function"==typeof i.checkValidity){const r=i.checkValidity(t[e.id],e);r.length>0&&n.push({[e.id]:r})}})),n}function d(t,e){const n=[];return Array.isArray(t)&&t.forEach(((t,i)=>{const r=h(t,e);r.length>0&&n.push({[i]:r})})),n}function O(t){return(e,n)=>{const o=[];if(!n.required||Array.isArray(e)&&0!==e.length||o.push((0,i.__)("This field is required.","wpify-custom-fields")),Array.isArray(e)){const i=(0,r.JC)(t);e.forEach(((t,e)=>{if("function"==typeof i.checkValidity){const r=i.checkValidity(t,n);r.length>0&&o.push({[e]:r})}}))}return o}}function f(t,e){const n=[];return!e.required||"object"==typeof t&&Object.keys(t).map((e=>t[e])).some(Boolean)||n.push((0,i.__)("This field is required.","wpify-custom-fields")),n}function p(t,e){const n=[];return e.required&&isNaN(t)&&n.push((0,i.__)("This field is required.","wpify-custom-fields")),e.required&&isNaN(parseFloat(t))&&n.push((0,i.__)("This field must be a number.","wpify-custom-fields")),e.min&&parseFloat(t)e.max&&n.push((0,i.__)("This field must be less than or equal to the maximum value.","wpify-custom-fields")),e.step&&parseFloat(t)%e.step!=0&&n.push((0,i.__)("This field must be a multiple of the step value.","wpify-custom-fields")),n}function m(t,e){const n=[];return(e.required&&("object"!=typeof t||!t.url&&!t.post)||"object"!=typeof t)&&n.push((0,i.__)("This field is required.","wpify-custom-fields")),n}function g(t,e){const n=[];return!e.required||Array.isArray(t)&&t.every((t=>t>0))&&0!==t.length||n.push((0,i.__)("This field is required.","wpify-custom-fields")),n}function y(t,e){const n=[];return!e.required||Array.isArray(t)&&t.every((t=>o(t)))||n.push((0,i.__)("This field is required.","wpify-custom-fields")),n}function $(t,e){const n=[];if(e.required&&(!t||!t[0]&&!t[1]))return n.push((0,i.__)("This field is required.","wpify-custom-fields")),n;if(t&&t[0]&&t[1]&&new Date(t[0])>new Date(t[1])&&n.push((0,i.__)("The start date must be before or equal to the end date.","wpify-custom-fields")),t&&e.min){const r=new Date(e.min);t[0]&&new Date(t[0])r&&n.push((0,i.__)("The start date must not be after the maximum date.","wpify-custom-fields")),t[1]&&new Date(t[1])>r&&n.push((0,i.__)("The end date must not be after the maximum date.","wpify-custom-fields"))}return n}},5413:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.Doctype=e.CDATA=e.Tag=e.Style=e.Script=e.Comment=e.Directive=e.Text=e.Root=e.isTag=e.ElementType=void 0,function(t){t.Root="root",t.Text="text",t.Directive="directive",t.Comment="comment",t.Script="script",t.Style="style",t.Tag="tag",t.CDATA="cdata",t.Doctype="doctype"}(n=e.ElementType||(e.ElementType={})),e.isTag=function(t){return t.type===n.Tag||t.type===n.Script||t.type===n.Style},e.Root=n.Root,e.Text=n.Text,e.Directive=n.Directive,e.Comment=n.Comment,e.Script=n.Script,e.Style=n.Style,e.Tag=n.Tag,e.CDATA=n.CDATA,e.Doctype=n.Doctype},1141:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(e,n);r&&!("get"in r?!e.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,i,r)}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||i(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.DomHandler=void 0;var o=n(5413),s=n(6957);r(n(6957),e);var a={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},l=function(){function t(t,e,n){this.dom=[],this.root=new s.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,"function"==typeof e&&(n=e,e=a),"object"==typeof t&&(e=t,t=void 0),this.callback=null!=t?t:null,this.options=null!=e?e:a,this.elementCB=null!=n?n:null}return t.prototype.onparserinit=function(t){this.parser=t},t.prototype.onreset=function(){this.dom=[],this.root=new s.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},t.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},t.prototype.onerror=function(t){this.handleCallback(t)},t.prototype.onclosetag=function(){this.lastNode=null;var t=this.tagStack.pop();this.options.withEndIndices&&(t.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(t)},t.prototype.onopentag=function(t,e){var n=this.options.xmlMode?o.ElementType.Tag:void 0,i=new s.Element(t,e,void 0,n);this.addNode(i),this.tagStack.push(i)},t.prototype.ontext=function(t){var e=this.lastNode;if(e&&e.type===o.ElementType.Text)e.data+=t,this.options.withEndIndices&&(e.endIndex=this.parser.endIndex);else{var n=new s.Text(t);this.addNode(n),this.lastNode=n}},t.prototype.oncomment=function(t){if(this.lastNode&&this.lastNode.type===o.ElementType.Comment)this.lastNode.data+=t;else{var e=new s.Comment(t);this.addNode(e),this.lastNode=e}},t.prototype.oncommentend=function(){this.lastNode=null},t.prototype.oncdatastart=function(){var t=new s.Text(""),e=new s.CDATA([t]);this.addNode(e),t.parent=e,this.lastNode=t},t.prototype.oncdataend=function(){this.lastNode=null},t.prototype.onprocessinginstruction=function(t,e){var n=new s.ProcessingInstruction(t,e);this.addNode(n)},t.prototype.handleCallback=function(t){if("function"==typeof this.callback)this.callback(t,this.dom);else if(t)throw t},t.prototype.addNode=function(t){var e=this.tagStack[this.tagStack.length-1],n=e.children[e.children.length-1];this.options.withStartIndices&&(t.startIndex=this.parser.startIndex),this.options.withEndIndices&&(t.endIndex=this.parser.endIndex),e.children.push(t),n&&(t.prev=n,n.next=t),t.parent=e,this.lastNode=null},t}();e.DomHandler=l,e.default=l},6957:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function __(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)}),o=this&&this.__assign||function(){return o=Object.assign||function(t){for(var e,n=1,i=arguments.length;n0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"childNodes",{get:function(){return this.children},set:function(t){this.children=t},enumerable:!1,configurable:!0}),e}(a);e.NodeWithChildren=d;var O=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=s.ElementType.CDATA,e}return r(e,t),Object.defineProperty(e.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),e}(d);e.CDATA=O;var f=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=s.ElementType.Root,e}return r(e,t),Object.defineProperty(e.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),e}(d);e.Document=f;var p=function(t){function e(e,n,i,r){void 0===i&&(i=[]),void 0===r&&(r="script"===e?s.ElementType.Script:"style"===e?s.ElementType.Style:s.ElementType.Tag);var o=t.call(this,i)||this;return o.name=e,o.attribs=n,o.type=r,o}return r(e,t),Object.defineProperty(e.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tagName",{get:function(){return this.name},set:function(t){this.name=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"attributes",{get:function(){var t=this;return Object.keys(this.attribs).map((function(e){var n,i;return{name:e,value:t.attribs[e],namespace:null===(n=t["x-attribsNamespace"])||void 0===n?void 0:n[e],prefix:null===(i=t["x-attribsPrefix"])||void 0===i?void 0:i[e]}}))},enumerable:!1,configurable:!0}),e}(d);function m(t){return(0,s.isTag)(t)}function g(t){return t.type===s.ElementType.CDATA}function y(t){return t.type===s.ElementType.Text}function $(t){return t.type===s.ElementType.Comment}function v(t){return t.type===s.ElementType.Directive}function b(t){return t.type===s.ElementType.Root}function S(t,e){var n;if(void 0===e&&(e=!1),y(t))n=new c(t.data);else if($(t))n=new u(t.data);else if(m(t)){var i=e?w(t.children):[],r=new p(t.name,o({},t.attribs),i);i.forEach((function(t){return t.parent=r})),null!=t.namespace&&(r.namespace=t.namespace),t["x-attribsNamespace"]&&(r["x-attribsNamespace"]=o({},t["x-attribsNamespace"])),t["x-attribsPrefix"]&&(r["x-attribsPrefix"]=o({},t["x-attribsPrefix"])),n=r}else if(g(t)){i=e?w(t.children):[];var s=new O(i);i.forEach((function(t){return t.parent=s})),n=s}else if(b(t)){i=e?w(t.children):[];var a=new f(i);i.forEach((function(t){return t.parent=a})),t["x-mode"]&&(a["x-mode"]=t["x-mode"]),n=a}else{if(!v(t))throw new Error("Not implemented yet: ".concat(t.type));var l=new h(t.name,t.data);null!=t["x-name"]&&(l["x-name"]=t["x-name"],l["x-publicId"]=t["x-publicId"],l["x-systemId"]=t["x-systemId"]),n=l}return n.startIndex=t.startIndex,n.endIndex=t.endIndex,null!=t.sourceCodeLocation&&(n.sourceCodeLocation=t.sourceCodeLocation),n}function w(t){for(var e=t.map((function(t){return S(t,!0)})),n=1;n{"use strict";var i=n(4363),r={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function l(t){return i.isMemo(t)?s:a[t.$$typeof]||r}a[i.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[i.Memo]=s;var c=Object.defineProperty,u=Object.getOwnPropertyNames,h=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,O=Object.getPrototypeOf,f=Object.prototype;t.exports=function t(e,n,i){if("string"!=typeof n){if(f){var r=O(n);r&&r!==f&&t(e,r,i)}var s=u(n);h&&(s=s.concat(h(n)));for(var a=l(e),p=l(n),m=0;m{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CARRIAGE_RETURN_PLACEHOLDER_REGEX=e.CARRIAGE_RETURN_PLACEHOLDER=e.CARRIAGE_RETURN_REGEX=e.CARRIAGE_RETURN=e.CASE_SENSITIVE_TAG_NAMES_MAP=e.CASE_SENSITIVE_TAG_NAMES=void 0,e.CASE_SENSITIVE_TAG_NAMES=["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"],e.CASE_SENSITIVE_TAG_NAMES_MAP=e.CASE_SENSITIVE_TAG_NAMES.reduce((function(t,e){return t[e.toLowerCase()]=e,t}),{}),e.CARRIAGE_RETURN="\r",e.CARRIAGE_RETURN_REGEX=new RegExp(e.CARRIAGE_RETURN,"g"),e.CARRIAGE_RETURN_PLACEHOLDER="__HTML_DOM_PARSER_CARRIAGE_RETURN_PLACEHOLDER_".concat(Date.now(),"__"),e.CARRIAGE_RETURN_PLACEHOLDER_REGEX=new RegExp(e.CARRIAGE_RETURN_PLACEHOLDER,"g")},5496:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e,n,d=(t=(0,i.escapeSpecialCharacters)(t)).match(a),O=d&&d[1]?d[1].toLowerCase():"";switch(O){case r:var f=h(t);return l.test(t)||null===(e=null==(g=f.querySelector(o))?void 0:g.parentNode)||void 0===e||e.removeChild(g),c.test(t)||null===(n=null==(g=f.querySelector(s))?void 0:g.parentNode)||void 0===n||n.removeChild(g),f.querySelectorAll(r);case o:case s:var m=u(t).querySelectorAll(O);return c.test(t)&&l.test(t)?m[0].parentNode.childNodes:m;default:return p?p(t):(g=u(t,s).querySelector(s)).childNodes;var g}};var i=n(7731),r="html",o="head",s="body",a=/<([a-zA-Z]+[0-9]?)/,l=//i,c=//i,u=function(t,e){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},h=function(t,e){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")},d="object"==typeof window&&window.DOMParser;if("function"==typeof d){var O=new d;u=h=function(t,e){return e&&(t="<".concat(e,">").concat(t,"")),O.parseFromString(t,"text/html")}}if("object"==typeof document&&document.implementation){var f=document.implementation.createHTMLDocument();u=function(t,e){if(e){var n=f.documentElement.querySelector(e);return n&&(n.innerHTML=t),f}return f.documentElement.innerHTML=t,f}}var p,m="object"==typeof document&&document.createElement("template");m&&m.content&&(p=function(t){return m.innerHTML=t,m.content.childNodes})},2471:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){if("string"!=typeof t)throw new TypeError("First argument must be a string");if(!t)return[];var e=t.match(s),n=e?e[1]:void 0;return(0,o.formatDOM)((0,r.default)(t),null,n)};var r=i(n(5496)),o=n(7731),s=/<(![a-zA-Z\s]+)>/},7731:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.formatAttributes=o,e.escapeSpecialCharacters=function(t){return t.replace(r.CARRIAGE_RETURN_REGEX,r.CARRIAGE_RETURN_PLACEHOLDER)},e.revertEscapedCharacters=a,e.formatDOM=function t(e,n,r){void 0===n&&(n=null);for(var l,c=[],u=0,h=e.length;u{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){void 0===t&&(t={});var n={},c=Boolean(t.type&&a[t.type]);for(var u in t){var h=t[u];if((0,i.isCustomAttribute)(u))n[u]=h;else{var d=u.toLowerCase(),O=l(d);if(O){var f=(0,i.getPropertyInfo)(O);switch(o.includes(O)&&s.includes(e)&&!c&&(O=l("default"+d)),n[O]=h,f&&f.type){case i.BOOLEAN:n[O]=!0;break;case i.OVERLOADED_BOOLEAN:""===h&&(n[O]=!0)}}else r.PRESERVE_CUSTOM_ATTRIBUTES&&(n[u]=h)}}return(0,r.setStyleProp)(t.style,n),n};var i=n(4210),r=n(2577),o=["checked","value"],s=["input","select","textarea"],a={reset:!0,submit:!0};function l(t){return i.possibleStandardNames[t]}},308:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=function t(e,n){void 0===n&&(n={});for(var i=[],r="function"==typeof n.replace,c=n.transform||s.returnFirstArg,u=n.library||a,h=u.cloneElement,d=u.createElement,O=u.isValidElement,f=e.length,p=0;p1&&(g=h(g,{key:g.key||p})),i.push(c(g,m,p));continue}}if("text"!==m.type){var y=m,$={};l(y)?((0,s.setStyleProp)(y.attribs.style,y.attribs),$=y.attribs):y.attribs&&($=(0,o.default)(y.attribs,y.name));var v=void 0;switch(m.type){case"script":case"style":m.children[0]&&($.dangerouslySetInnerHTML={__html:m.children[0].data});break;case"tag":"textarea"===m.name&&m.children[0]?$.defaultValue=m.children[0].data:m.children&&m.children.length&&(v=t(m.children,n));break;default:continue}f>1&&($.key=p),i.push(c(d(m.name,$,v),m,p))}else{var b=!m.data.trim().length;if(b&&m.parent&&!(0,s.canTextBeChildOfNode)(m.parent))continue;if(n.trim&&b)continue;i.push(c(m.data,m,p))}}return 1===i.length?i[0]:i};var r=n(1609),o=i(n(840)),s=n(2577),a={cloneElement:r.cloneElement,createElement:r.createElement,isValidElement:r.isValidElement};function l(t){return s.PRESERVE_CUSTOM_ATTRIBUTES&&"tag"===t.type&&(0,s.isCustomComponent)(t.name,t.attribs)}},442:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.htmlToDOM=e.domToReact=e.attributesToProps=e.Text=e.ProcessingInstruction=e.Element=e.Comment=void 0,e.default=function(t,e){if("string"!=typeof t)throw new TypeError("First argument must be a string");return t?(0,s.default)((0,r.default)(t,(null==e?void 0:e.htmlparser2)||l),e):[]};var r=i(n(2471));e.htmlToDOM=r.default;var o=i(n(840));e.attributesToProps=o.default;var s=i(n(308));e.domToReact=s.default;var a=n(1141);Object.defineProperty(e,"Comment",{enumerable:!0,get:function(){return a.Comment}}),Object.defineProperty(e,"Element",{enumerable:!0,get:function(){return a.Element}}),Object.defineProperty(e,"ProcessingInstruction",{enumerable:!0,get:function(){return a.ProcessingInstruction}}),Object.defineProperty(e,"Text",{enumerable:!0,get:function(){return a.Text}});var l={lowerCaseAttributeNames:!1}},2577:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.returnFirstArg=e.canTextBeChildOfNode=e.ELEMENTS_WITH_NO_TEXT_CHILDREN=e.PRESERVE_CUSTOM_ATTRIBUTES=void 0,e.isCustomComponent=function(t,e){return t.includes("-")?!s.has(t):Boolean(e&&"string"==typeof e.is)},e.setStyleProp=function(t,e){if("string"==typeof t)if(t.trim())try{e.style=(0,o.default)(t,a)}catch(t){e.style={}}else e.style={}};var r=n(1609),o=i(n(5229)),s=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]),a={reactCompat:!0};e.PRESERVE_CUSTOM_ATTRIBUTES=Number(r.version.split(".")[0])>=16,e.ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]),e.canTextBeChildOfNode=function(t){return!e.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(t.name)},e.returnFirstArg=function(t){return t}},5077:t=>{"use strict";var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,i=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,l=/^\s+|\s+$/g,c="";function u(t){return t?t.replace(l,c):c}t.exports=function(t,l){if("string"!=typeof t)throw new TypeError("First argument must be a string");if(!t)return[];l=l||{};var h=1,d=1;function O(t){var e=t.match(n);e&&(h+=e.length);var i=t.lastIndexOf("\n");d=~i?t.length-i:d+t.length}function f(){var t={line:h,column:d};return function(e){return e.position=new p(t),y(),e}}function p(t){this.start=t,this.end={line:h,column:d},this.source=l.source}function m(e){var n=new Error(l.source+":"+h+":"+d+": "+e);if(n.reason=e,n.filename=l.source,n.line=h,n.column=d,n.source=t,!l.silent)throw n}function g(e){var n=e.exec(t);if(n){var i=n[0];return O(i),t=t.slice(i.length),n}}function y(){g(i)}function $(t){var e;for(t=t||[];e=v();)!1!==e&&t.push(e);return t}function v(){var e=f();if("/"==t.charAt(0)&&"*"==t.charAt(1)){for(var n=2;c!=t.charAt(n)&&("*"!=t.charAt(n)||"/"!=t.charAt(n+1));)++n;if(n+=2,c===t.charAt(n-1))return m("End of comment missing");var i=t.slice(2,n-2);return d+=2,O(i),t=t.slice(n),d+=2,e({type:"comment",comment:i})}}function b(){var t=f(),n=g(r);if(n){if(v(),!g(o))return m("property missing ':'");var i=g(s),l=t({type:"declaration",property:u(n[0].replace(e,c)),value:i?u(i[0].replace(e,c)):c});return g(a),l}}return p.prototype.content=t,y(),function(){var t,e=[];for($(e);t=b();)!1!==t&&(e.push(t),$(e));return e}()}},3481:function(t,e){!function(t){"use strict";function e(t){var e,n,i,r;for(n=1,i=arguments.length;n0?Math.floor(t):Math.ceil(t)};function R(t,e,n){return t instanceof C?t:m(t)?new C(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new C(t.x,t.y):new C(t,e,n)}function E(t,e){if(t)for(var n=e?[t,e]:t,i=0,r=n.length;i=this.min.x&&n.x<=this.max.x&&e.y>=this.min.y&&n.y<=this.max.y},intersects:function(t){t=A(t);var e=this.min,n=this.max,i=t.min,r=t.max,o=r.x>=e.x&&i.x<=n.x,s=r.y>=e.y&&i.y<=n.y;return o&&s},overlaps:function(t){t=A(t);var e=this.min,n=this.max,i=t.min,r=t.max,o=r.x>e.x&&i.xe.y&&i.y=i.lat&&n.lat<=r.lat&&e.lng>=i.lng&&n.lng<=r.lng},intersects:function(t){t=M(t);var e=this._southWest,n=this._northEast,i=t.getSouthWest(),r=t.getNorthEast(),o=r.lat>=e.lat&&i.lat<=n.lat,s=r.lng>=e.lng&&i.lng<=n.lng;return o&&s},overlaps:function(t){t=M(t);var e=this._southWest,n=this._northEast,i=t.getSouthWest(),r=t.getNorthEast(),o=r.lat>e.lat&&i.late.lng&&i.lng1,kt=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",l,e),window.removeEventListener("testPassiveEventSupport",l,e)}catch(t){}return t}(),Tt=!!document.createElement("canvas").getContext,Ct=!(!document.createElementNS||!G("svg").createSVGRect),zt=!!Ct&&((H=document.createElement("div")).innerHTML="","http://www.w3.org/2000/svg"===(H.firstChild&&H.firstChild.namespaceURI)),Rt=!Ct&&function(){try{var t=document.createElement("div");t.innerHTML='';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(t){return!1}}();function Et(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var At={ie:J,ielt9:tt,edge:et,webkit:nt,android:it,android23:rt,androidStock:st,opera:at,chrome:lt,gecko:ct,safari:ut,phantom:ht,opera12:dt,win:Ot,ie3d:ft,webkit3d:pt,gecko3d:mt,any3d:gt,mobile:yt,mobileWebkit:$t,mobileWebkit3d:vt,msPointer:bt,pointer:St,touch:xt,touchNative:wt,mobileOpera:Qt,mobileGecko:Pt,retina:_t,passiveEvents:kt,canvas:Tt,svg:Ct,vml:Rt,inlineSvg:zt,mac:0===navigator.platform.indexOf("Mac"),linux:0===navigator.platform.indexOf("Linux")},Zt=At.msPointer?"MSPointerDown":"pointerdown",Mt=At.msPointer?"MSPointerMove":"pointermove",Vt=At.msPointer?"MSPointerUp":"pointerup",Xt=At.msPointer?"MSPointerCancel":"pointercancel",qt={touchstart:Zt,touchmove:Mt,touchend:Vt,touchcancel:Xt},Wt={touchstart:function(t,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&Ve(e),Yt(t,e)},touchmove:Yt,touchend:Yt,touchcancel:Yt},jt={},It=!1;function Lt(t,e,n){return"touchstart"===e&&(It||(document.addEventListener(Zt,Nt,!0),document.addEventListener(Mt,Ut,!0),document.addEventListener(Vt,Dt,!0),document.addEventListener(Xt,Dt,!0),It=!0)),Wt[e]?(n=Wt[e].bind(this,n),t.addEventListener(qt[e],n,!1),n):(console.warn("wrong event specified:",e),l)}function Nt(t){jt[t.pointerId]=t}function Ut(t){jt[t.pointerId]&&(jt[t.pointerId]=t)}function Dt(t){delete jt[t.pointerId]}function Yt(t,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||"mouse")){for(var n in e.touches=[],jt)e.touches.push(jt[n]);e.changedTouches=[e],t(e)}}var Bt,Gt,Ft,Ht,Kt,Jt=pe(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),te=pe(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),ee="webkitTransition"===te||"OTransition"===te?te+"End":"transitionend";function ne(t){return"string"==typeof t?document.getElementById(t):t}function ie(t,e){var n=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!n||"auto"===n)&&document.defaultView){var i=document.defaultView.getComputedStyle(t,null);n=i?i[e]:null}return"auto"===n?null:n}function re(t,e,n){var i=document.createElement(t);return i.className=e||"",n&&n.appendChild(i),i}function oe(t){var e=t.parentNode;e&&e.removeChild(t)}function se(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function ae(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function le(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function ce(t,e){if(void 0!==t.classList)return t.classList.contains(e);var n=Oe(t);return n.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(n)}function ue(t,e){if(void 0!==t.classList)for(var n=h(e),i=0,r=n.length;i0?2*window.devicePixelRatio:1;function Ie(t){return At.edge?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/je:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}function Le(t,e){var n=e.relatedTarget;if(!n)return!0;try{for(;n&&n!==t;)n=n.parentNode}catch(t){return!1}return n!==t}var Ne={__proto__:null,on:_e,off:Te,stopPropagation:Ae,disableScrollPropagation:Ze,disableClickPropagation:Me,preventDefault:Ve,stop:Xe,getPropagationPath:qe,getMousePosition:We,getWheelDelta:Ie,isExternalTarget:Le,addListener:_e,removeListener:Te},Ue=T.extend({run:function(t,e,n,i){this.stop(),this._el=t,this._inProgress=!0,this._duration=n||.25,this._easeOutPower=1/Math.max(i||.5,.2),this._startPos=ye(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=x(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,n=1e3*this._duration;ethis.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var n=this.getCenter(),i=this._limitCenter(n,this._zoom,M(t));return n.equals(i)||this.panTo(i,e),this._enforcingBounds=!1,this},panInside:function(t,e){var n=R((e=e||{}).paddingTopLeft||e.padding||[0,0]),i=R(e.paddingBottomRight||e.padding||[0,0]),r=this.project(this.getCenter()),o=this.project(t),s=this.getPixelBounds(),a=A([s.min.add(n),s.max.subtract(i)]),l=a.getSize();if(!a.contains(o)){this._enforcingBounds=!0;var c=o.subtract(a.getCenter()),u=a.extend(o).getSize().subtract(l);r.x+=c.x<0?-u.x:u.x,r.y+=c.y<0?-u.y:u.y,this.panTo(this.unproject(r),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=e({animate:!1,pan:!0},!0===t?{animate:!0}:t);var n=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var r=this.getSize(),o=n.divideBy(2).round(),s=r.divideBy(2).round(),a=o.subtract(s);return a.x||a.y?(t.animate&&t.pan?this.panBy(a):(t.pan&&this._rawPanBy(a),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(i(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:n,newSize:r})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=e({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var n=i(this._handleGeolocationResponse,this),r=i(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(n,r,t):navigator.geolocation.getCurrentPosition(n,r,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){if(this._container._leaflet_id){var e=t.code,n=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+n+"."})}},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var e=new V(t.coords.latitude,t.coords.longitude),n=e.toBounds(2*t.coords.accuracy),i=this._locateOptions;if(i.setView){var r=this.getBoundsZoom(n);this.setView(e,i.maxZoom?Math.min(r,i.maxZoom):r)}var o={latlng:e,bounds:n,timestamp:t.timestamp};for(var s in t.coords)"number"==typeof t.coords[s]&&(o[s]=t.coords[s]);this.fire("locationfound",o)}},addHandler:function(t,e){if(!e)return this;var n=this[t]=new e(this);return this._handlers.push(n),this.options[t]&&n.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(t){this._container._leaflet_id=void 0,this._containerId=void 0}var t;for(t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),oe(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(Q(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)oe(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var n=re("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=n),n},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new Z(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,n){t=M(t),n=R(n||[0,0]);var i=this.getZoom()||0,r=this.getMinZoom(),o=this.getMaxZoom(),s=t.getNorthWest(),a=t.getSouthEast(),l=this.getSize().subtract(n),c=A(this.project(a,i),this.project(s,i)).getSize(),u=At.any3d?this.options.zoomSnap:1,h=l.x/c.x,d=l.y/c.y,O=e?Math.max(h,d):Math.min(h,d);return i=this.getScaleZoom(O,i),u&&(i=Math.round(i/(u/100))*(u/100),i=e?Math.ceil(i/u)*u:Math.floor(i/u)*u),Math.max(r,Math.min(o,i))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new C(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var n=this._getTopLeftPoint(t,e);return new E(n,n.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var n=this.options.crs;return e=void 0===e?this._zoom:e,n.scale(t)/n.scale(e)},getScaleZoom:function(t,e){var n=this.options.crs;e=void 0===e?this._zoom:e;var i=n.zoom(t*n.scale(e));return isNaN(i)?1/0:i},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(X(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(R(t),e)},layerPointToLatLng:function(t){var e=R(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project(X(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(X(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(M(t))},distance:function(t,e){return this.options.crs.distance(X(t),X(e))},containerPointToLayerPoint:function(t){return R(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return R(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(R(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(X(t)))},mouseEventToContainerPoint:function(t){return We(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=ne(t);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");_e(e,"scroll",this._onScroll,this),this._containerId=o(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&At.any3d,ue(t,"leaflet-container"+(At.touch?" leaflet-touch":"")+(At.retina?" leaflet-retina":"")+(At.ielt9?" leaflet-oldie":"")+(At.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=ie(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&"sticky"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),ge(this._mapPane,new C(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(ue(t.markerPane,"leaflet-zoom-hide"),ue(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e,n){ge(this._mapPane,new C(0,0));var i=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var r=this._zoom!==e;this._moveStart(r,n)._move(t,e)._moveEnd(r),this.fire("viewreset"),i&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,n,i){void 0===e&&(e=this._zoom);var r=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),i?n&&n.pinch&&this.fire("zoom",n):((r||n&&n.pinch)&&this.fire("zoom",n),this.fire("move",n)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return Q(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){ge(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[o(this._container)]=this;var e=t?Te:_e;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),At.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){Q(this._resizeRequest),this._resizeRequest=x((function(){this.invalidateSize({debounceMoveend:!0})}),this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var n,i=[],r="mouseout"===e||"mouseover"===e,s=t.target||t.srcElement,a=!1;s;){if((n=this._targets[o(s)])&&("click"===e||"preclick"===e)&&this._draggableMoved(n)){a=!0;break}if(n&&n.listens(e,!0)){if(r&&!Le(s,t))break;if(i.push(n),r)break}if(s===this._container)break;s=s.parentNode}return i.length||a||r||!this.listens(e,!0)||(i=[this]),i},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var e=t.target||t.srcElement;if(!(!this._loaded||e._leaflet_disable_events||"click"===t.type&&this._isClickDisabled(e))){var n=t.type;"mousedown"===n&&Se(e),this._fireDOMEvent(t,n)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,n,i){if("click"===t.type){var r=e({},t);r.type="preclick",this._fireDOMEvent(r,r.type,i)}var o=this._findEventTargets(t,n);if(i){for(var s=[],a=0;a0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),n=this.getMaxZoom(),i=At.any3d?this.options.zoomSnap:1;return i&&(t=Math.round(t/i)*i),Math.max(e,Math.min(n,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){he(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var n=this._getCenterOffset(t)._trunc();return!(!0!==(e&&e.animate)&&!this.getSize().contains(n)||(this.panBy(n,e),0))},_createAnimProxy:function(){var t=this._proxy=re("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",(function(t){var e=Jt,n=this._proxy.style[e];me(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),n===this._proxy.style[e]&&this._animatingZoom&&this._onZoomTransitionEnd()}),this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){oe(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();me(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,n){if(this._animatingZoom)return!0;if(n=n||{},!this._zoomAnimated||!1===n.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var i=this.getZoomScale(e),r=this._getCenterOffset(t)._divideBy(1-1/i);return!(!0!==n.animate&&!this.getSize().contains(r)||(x((function(){this._moveStart(!0,n.noMoveStart||!1)._animateZoom(t,e,!0)}),this),0))},_animateZoom:function(t,e,n,r){this._mapPane&&(n&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,ue(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:r}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(i(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&he(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});var Ye=_.extend({options:{position:"topright"},initialize:function(t){d(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),n=this.getPosition(),i=t._controlCorners[n];return ue(e,"leaflet-control"),-1!==n.indexOf("bottom")?i.insertBefore(e,i.firstChild):i.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(oe(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),Be=function(t){return new Ye(t)};De.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},e="leaflet-",n=this._controlContainer=re("div",e+"control-container",this._container);function i(i,r){var o=e+i+" "+e+r;t[i+r]=re("div",o,n)}i("top","left"),i("top","right"),i("bottom","left"),i("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)oe(this._controlCorners[t]);oe(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Ge=Ye.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,n,i){return n1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(o(t.target)),n=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;n&&this._map.fire(n,e)},_createRadioElement:function(t,e){var n='",i=document.createElement("div");return i.innerHTML=n,i.firstChild},_addItem:function(t){var e,n=document.createElement("label"),i=this._map.hasLayer(t.layer);t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=i):e=this._createRadioElement("leaflet-base-layers_"+o(this),i),this._layerControlInputs.push(e),e.layerId=o(t.layer),_e(e,"click",this._onInputClick,this);var r=document.createElement("span");r.innerHTML=" "+t.name;var s=document.createElement("span");return n.appendChild(s),s.appendChild(e),s.appendChild(r),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(n),this._checkDisabledLayers(),n},_onInputClick:function(){if(!this._preventClick){var t,e,n=this._layerControlInputs,i=[],r=[];this._handlingClick=!0;for(var o=n.length-1;o>=0;o--)t=n[o],e=this._getLayer(t.layerId).layer,t.checked?i.push(e):t.checked||r.push(e);for(o=0;o=0;r--)t=n[r],e=this._getLayer(t.layerId).layer,t.disabled=void 0!==e.options.minZoom&&ie.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var t=this._section;this._preventClick=!0,_e(t,"click",Ve),this.expand();var e=this;setTimeout((function(){Te(t,"click",Ve),e._preventClick=!1}))}}),Fe=Ye.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",n=re("div",e+" leaflet-bar"),i=this.options;return this._zoomInButton=this._createButton(i.zoomInText,i.zoomInTitle,e+"-in",n,this._zoomIn),this._zoomOutButton=this._createButton(i.zoomOutText,i.zoomOutTitle,e+"-out",n,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),n},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,n,i,r){var o=re("a",n,i);return o.innerHTML=t,o.href="#",o.title=e,o.setAttribute("role","button"),o.setAttribute("aria-label",e),Me(o),_e(o,"click",Xe),_e(o,"click",r,this),_e(o,"click",this._refocusOnMap,this),o},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";he(this._zoomInButton,e),he(this._zoomOutButton,e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||t._zoom===t.getMinZoom())&&(ue(this._zoomOutButton,e),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||t._zoom===t.getMaxZoom())&&(ue(this._zoomInButton,e),this._zoomInButton.setAttribute("aria-disabled","true"))}});De.mergeOptions({zoomControl:!0}),De.addInitHook((function(){this.options.zoomControl&&(this.zoomControl=new Fe,this.addControl(this.zoomControl))}));var He=Ye.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",n=re("div",e),i=this.options;return this._addScales(i,e+"-line",n),t.on(i.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),n},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,n){t.metric&&(this._mScale=re("div",e,n)),t.imperial&&(this._iScale=re("div",e,n))},_update:function(){var t=this._map,e=t.getSize().y/2,n=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(n)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t),n=e<1e3?e+" m":e/1e3+" km";this._updateScale(this._mScale,n,e/t)},_updateImperial:function(t){var e,n,i,r=3.2808399*t;r>5280?(e=r/5280,n=this._getRoundNum(e),this._updateScale(this._iScale,n+" mi",n/e)):(i=this._getRoundNum(r),this._updateScale(this._iScale,i+" ft",i/r))},_updateScale:function(t,e,n){t.style.width=Math.round(this.options.maxWidth*n)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),n=t/e;return e*(n>=10?10:n>=5?5:n>=3?3:n>=2?2:1)}}),Ke=Ye.extend({options:{position:"bottomright",prefix:''+(At.inlineSvg?' ':"")+"Leaflet"},initialize:function(t){d(this,t),this._attributions={}},onAdd:function(t){for(var e in t.attributionControl=this,this._container=re("div","leaflet-control-attribution"),Me(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",(function(){this.removeAttribution(t.layer.getAttribution())}),this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var n=[];this.options.prefix&&n.push(this.options.prefix),t.length&&n.push(t.join(", ")),this._container.innerHTML=n.join(' ')}}});De.mergeOptions({attributionControl:!0}),De.addInitHook((function(){this.options.attributionControl&&(new Ke).addTo(this)}));Ye.Layers=Ge,Ye.Zoom=Fe,Ye.Scale=He,Ye.Attribution=Ke,Be.layers=function(t,e,n){return new Ge(t,e,n)},Be.zoom=function(t){return new Fe(t)},Be.scale=function(t){return new He(t)},Be.attribution=function(t){return new Ke(t)};var Je=_.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Je.addTo=function(t,e){return t.addHandler(e,this),this};var tn={Events:k},en=At.touch?"touchstart mousedown":"mousedown",nn=T.extend({options:{clickTolerance:3},initialize:function(t,e,n,i){d(this,i),this._element=t,this._dragStartTarget=e||t,this._preventOutline=n},enable:function(){this._enabled||(_e(this._dragStartTarget,en,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(nn._dragging===this&&this.finishDrag(!0),Te(this._dragStartTarget,en,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(this._enabled&&(this._moved=!1,!ce(this._element,"leaflet-zoom-anim")))if(t.touches&&1!==t.touches.length)nn._dragging===this&&this.finishDrag();else if(!(nn._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(nn._dragging=this,this._preventOutline&&Se(this._element),ve(),Bt(),this._moving))){this.fire("down");var e=t.touches?t.touches[0]:t,n=xe(this._element);this._startPoint=new C(e.clientX,e.clientY),this._startPos=ye(this._element),this._parentScale=Qe(n);var i="mousedown"===t.type;_e(document,i?"mousemove":"touchmove",this._onMove,this),_e(document,i?"mouseup":"touchend touchcancel",this._onUp,this)}},_onMove:function(t){if(this._enabled)if(t.touches&&t.touches.length>1)this._moved=!0;else{var e=t.touches&&1===t.touches.length?t.touches[0]:t,n=new C(e.clientX,e.clientY)._subtract(this._startPoint);(n.x||n.y)&&(Math.abs(n.x)+Math.abs(n.y)e&&(n.push(t[i]),r=i);return rl&&(o=s,l=a);l>n&&(e[o]=1,hn(t,e,n,i,o),hn(t,e,n,o,r))}function dn(t,e,n,i,r){var o,s,a,l=i?an:fn(t,n),c=fn(e,n);for(an=c;;){if(!(l|c))return[t,e];if(l&c)return!1;a=fn(s=On(t,e,o=l||c,n,r),n),o===l?(t=s,l=a):(e=s,c=a)}}function On(t,e,n,i,r){var o,s,a=e.x-t.x,l=e.y-t.y,c=i.min,u=i.max;return 8&n?(o=t.x+a*(u.y-t.y)/l,s=u.y):4&n?(o=t.x+a*(c.y-t.y)/l,s=c.y):2&n?(o=u.x,s=t.y+l*(u.x-t.x)/a):1&n&&(o=c.x,s=t.y+l*(c.x-t.x)/a),new C(o,s,r)}function fn(t,e){var n=0;return t.xe.max.x&&(n|=2),t.ye.max.y&&(n|=8),n}function pn(t,e){var n=e.x-t.x,i=e.y-t.y;return n*n+i*i}function mn(t,e,n,i){var r,o=e.x,s=e.y,a=n.x-o,l=n.y-s,c=a*a+l*l;return c>0&&((r=((t.x-o)*a+(t.y-s)*l)/c)>1?(o=n.x,s=n.y):r>0&&(o+=a*r,s+=l*r)),a=t.x-o,l=t.y-s,i?a*a+l*l:new C(o,s)}function gn(t){return!m(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function yn(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),gn(t)}function $n(t,e){var n,i,r,o,s,a,l,c;if(!t||0===t.length)throw new Error("latlngs not passed");gn(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var u=X([0,0]),h=M(t);h.getNorthWest().distanceTo(h.getSouthWest())*h.getNorthEast().distanceTo(h.getNorthWest())<1700&&(u=sn(t));var d=t.length,O=[];for(n=0;ni){l=(o-i)/r,c=[a.x-l*(a.x-s.x),a.y-l*(a.y-s.y)];break}var p=e.unproject(R(c));return X([p.lat+u.lat,p.lng+u.lng])}var vn={__proto__:null,simplify:cn,pointToSegmentDistance:un,closestPointOnSegment:function(t,e,n){return mn(t,e,n)},clipSegment:dn,_getEdgeIntersection:On,_getBitCode:fn,_sqClosestPointOnSegment:mn,isFlat:gn,_flat:yn,polylineCenter:$n},bn={project:function(t){return new C(t.lng,t.lat)},unproject:function(t){return new V(t.y,t.x)},bounds:new E([-180,-90],[180,90])},Sn={R:6378137,R_MINOR:6356752.314245179,bounds:new E([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var e=Math.PI/180,n=this.R,i=t.lat*e,r=this.R_MINOR/n,o=Math.sqrt(1-r*r),s=o*Math.sin(i),a=Math.tan(Math.PI/4-i/2)/Math.pow((1-s)/(1+s),o/2);return i=-n*Math.log(Math.max(a,1e-10)),new C(t.lng*e*n,i)},unproject:function(t){for(var e,n=180/Math.PI,i=this.R,r=this.R_MINOR/i,o=Math.sqrt(1-r*r),s=Math.exp(-t.y/i),a=Math.PI/2-2*Math.atan(s),l=0,c=.1;l<15&&Math.abs(c)>1e-7;l++)e=o*Math.sin(a),e=Math.pow((1-e)/(1+e),o/2),a+=c=Math.PI/2-2*Math.atan(s*e)-a;return new V(a*n,t.x*n/i)}},wn={__proto__:null,LonLat:bn,Mercator:Sn,SphericalMercator:N},xn=e({},j,{code:"EPSG:3395",projection:Sn,transformation:function(){var t=.5/(Math.PI*Sn.R);return D(t,.5,-t,.5)}()}),Qn=e({},j,{code:"EPSG:4326",projection:bn,transformation:D(1/180,1,-1/180,.5)}),Pn=e({},W,{projection:bn,transformation:D(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var n=e.lng-t.lng,i=e.lat-t.lat;return Math.sqrt(n*n+i*i)},infinite:!0});W.Earth=j,W.EPSG3395=xn,W.EPSG3857=Y,W.EPSG900913=B,W.EPSG4326=Qn,W.Simple=Pn;var kn=T.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[o(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[o(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var n=this.getEvents();e.on(n,this),this.once("remove",(function(){e.off(n,this)}),this)}this.onAdd(e),this.fire("add"),e.fire("layeradd",{layer:this})}}});De.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=o(t);return this._layers[e]||(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this},removeLayer:function(t){var e=o(t);return this._layers[e]?(this._loaded&&t.onRemove(this),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return o(t)in this._layers},eachLayer:function(t,e){for(var n in this._layers)t.call(e,this._layers[n]);return this},_addLayers:function(t){for(var e=0,n=(t=t?m(t)?t:[t]:[]).length;ethis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()=2&&e[0]instanceof V&&e[0].equals(e[n-1])&&e.pop(),e},_setLatLngs:function(t){Xn.prototype._setLatLngs.call(this,t),gn(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return gn(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,n=new C(e,e);if(t=new E(t.min.subtract(n),t.max.add(n)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var i,r=0,o=this._rings.length;rt.y!=i.y>t.y&&t.x<(i.x-n.x)*(t.y-n.y)/(i.y-n.y)+n.x&&(c=!c);return c||Xn.prototype._containsPoint.call(this,t,!0)}});var Wn=Cn.extend({initialize:function(t,e){d(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,n,i,r=m(t)?t:t.features;if(r){for(e=0,n=r.length;e0&&r.push(r[0].slice()),r}function Yn(t,n){return t.feature?e({},t.feature,{geometry:n}):Bn(n)}function Bn(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}var Gn={toGeoJSON:function(t){return Yn(this,{type:"Point",coordinates:Un(this.getLatLng(),t)})}};function Fn(t,e){return new Wn(t,e)}An.include(Gn),Vn.include(Gn),Mn.include(Gn),Xn.include({toGeoJSON:function(t){var e=!gn(this._latlngs);return Yn(this,{type:(e?"Multi":"")+"LineString",coordinates:Dn(this._latlngs,e?1:0,!1,t)})}}),qn.include({toGeoJSON:function(t){var e=!gn(this._latlngs),n=e&&!gn(this._latlngs[0]),i=Dn(this._latlngs,n?2:e?1:0,!0,t);return e||(i=[i]),Yn(this,{type:(n?"Multi":"")+"Polygon",coordinates:i})}}),Tn.include({toMultiPoint:function(t){var e=[];return this.eachLayer((function(n){e.push(n.toGeoJSON(t).geometry.coordinates)})),Yn(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(t){var e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===e)return this.toMultiPoint(t);var n="GeometryCollection"===e,i=[];return this.eachLayer((function(e){if(e.toGeoJSON){var r=e.toGeoJSON(t);if(n)i.push(r.geometry);else{var o=Bn(r);"FeatureCollection"===o.type?i.push.apply(i,o.features):i.push(o)}}})),n?Yn(this,{geometries:i,type:"GeometryCollection"}):{type:"FeatureCollection",features:i}}});var Hn=Fn,Kn=kn.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,n){this._url=t,this._bounds=M(e),d(this,n)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(ue(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){oe(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&ae(this._image),this},bringToBack:function(){return this._map&&le(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=M(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t="IMG"===this._url.tagName,e=this._image=t?this._url:re("img");ue(e,"leaflet-image-layer"),this._zoomAnimated&&ue(e,"leaflet-zoom-animated"),this.options.className&&ue(e,this.options.className),e.onselectstart=l,e.onmousemove=l,e.onload=i(this.fire,this,"load"),e.onerror=i(this._overlayOnError,this,"error"),(this.options.crossOrigin||""===this.options.crossOrigin)&&(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=e.src:(e.src=this._url,e.alt=this.options.alt)},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),n=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;me(this._image,n,e)},_reset:function(){var t=this._image,e=new E(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),n=e.getSize();ge(t,e.min),t.style.width=n.x+"px",t.style.height=n.y+"px"},_updateOpacity:function(){fe(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)},getCenter:function(){return this._bounds.getCenter()}}),Jn=Kn.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var t="VIDEO"===this._url.tagName,e=this._image=t?this._url:re("video");if(ue(e,"leaflet-image-layer"),this._zoomAnimated&&ue(e,"leaflet-zoom-animated"),this.options.className&&ue(e,this.options.className),e.onselectstart=l,e.onmousemove=l,e.onloadeddata=i(this.fire,this,"load"),t){for(var n=e.getElementsByTagName("source"),r=[],o=0;o0?r:[e.src]}else{m(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted,e.playsInline=!!this.options.playsInline;for(var s=0;sr?(e.height=r+"px",ue(t,o)):he(t,o),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),n=this._getAnchor();ge(this._container,e.add(n))},_adjustPan:function(){if(this.options.autoPan)if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning)this._autopanning=!1;else{var t=this._map,e=parseInt(ie(this._container,"marginBottom"),10)||0,n=this._container.offsetHeight+e,i=this._containerWidth,r=new C(this._containerLeft,-n-this._containerBottom);r._add(ye(this._container));var o=t.layerPointToContainerPoint(r),s=R(this.options.autoPanPadding),a=R(this.options.autoPanPaddingTopLeft||s),l=R(this.options.autoPanPaddingBottomRight||s),c=t.getSize(),u=0,h=0;o.x+i+l.x>c.x&&(u=o.x+i-c.x+l.x),o.x-u-a.x<0&&(u=o.x-a.x),o.y+n+l.y>c.y&&(h=o.y+n-c.y+l.y),o.y-h-a.y<0&&(h=o.y-a.y),(u||h)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([u,h]))}},_getAnchor:function(){return R(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}});De.mergeOptions({closePopupOnClick:!0}),De.include({openPopup:function(t,e,n){return this._initOverlay(ni,t,e,n).openOn(this),this},closePopup:function(t){return(t=arguments.length?t:this._popup)&&t.close(),this}}),kn.include({bindPopup:function(t,e){return this._popup=this._initOverlay(ni,this._popup,t,e),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t){return this._popup&&(this instanceof Cn||(this._popup._source=this),this._popup._prepareOpen(t||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){if(this._popup&&this._map){Xe(t);var e=t.layer||t.target;this._popup._source!==e||e instanceof Zn?(this._popup._source=e,this.openPopup(t.latlng)):this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng)}},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var ii=ei.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){ei.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){ei.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=ei.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=re("div",t),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+o(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,n,i=this._map,r=this._container,o=i.latLngToContainerPoint(i.getCenter()),s=i.layerPointToContainerPoint(t),a=this.options.direction,l=r.offsetWidth,c=r.offsetHeight,u=R(this.options.offset),h=this._getAnchor();"top"===a?(e=l/2,n=c):"bottom"===a?(e=l/2,n=0):"center"===a?(e=l/2,n=c/2):"right"===a?(e=0,n=c/2):"left"===a?(e=l,n=c/2):s.xthis.options.maxZoom||ni&&this._retainParent(r,o,s,i))},_retainChildren:function(t,e,n,i){for(var r=2*t;r<2*t+2;r++)for(var o=2*e;o<2*e+2;o++){var s=new C(r,o);s.z=n+1;var a=this._tileCoordsToKey(s),l=this._tiles[a];l&&l.active?l.retain=!0:(l&&l.loaded&&(l.retain=!0),n+1this.options.maxZoom||void 0!==this.options.minZoom&&r1)this._setView(t,n);else{for(var h=r.min.y;h<=r.max.y;h++)for(var d=r.min.x;d<=r.max.x;d++){var O=new C(d,h);if(O.z=this._tileZoom,this._isValidTile(O)){var f=this._tiles[this._tileCoordsToKey(O)];f?f.current=!0:s.push(O)}}if(s.sort((function(t,e){return t.distanceTo(o)-e.distanceTo(o)})),0!==s.length){this._loading||(this._loading=!0,this.fire("loading"));var p=document.createDocumentFragment();for(d=0;dn.max.x)||!e.wrapLat&&(t.yn.max.y))return!1}if(!this.options.bounds)return!0;var i=this._tileCoordsToBounds(t);return M(this.options.bounds).overlaps(i)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,n=this.getTileSize(),i=t.scaleBy(n),r=i.add(n);return[e.unproject(i,t.z),e.unproject(r,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),n=new Z(e[0],e[1]);return this.options.noWrap||(n=this._map.wrapLatLngBounds(n)),n},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),n=new C(+e[0],+e[1]);return n.z=+e[2],n},_removeTile:function(t){var e=this._tiles[t];e&&(oe(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){ue(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=l,t.onmousemove=l,At.ielt9&&this.options.opacity<1&&fe(t,this.options.opacity)},_addTile:function(t,e){var n=this._getTilePos(t),r=this._tileCoordsToKey(t),o=this.createTile(this._wrapCoords(t),i(this._tileReady,this,t));this._initTile(o),this.createTile.length<2&&x(i(this._tileReady,this,t,null,o)),ge(o,n),this._tiles[r]={el:o,coords:t,current:!0},e.appendChild(o),this.fire("tileloadstart",{tile:o,coords:t})},_tileReady:function(t,e,n){e&&this.fire("tileerror",{error:e,tile:n,coords:t});var r=this._tileCoordsToKey(t);(n=this._tiles[r])&&(n.loaded=+new Date,this._map._fadeAnimated?(fe(n.el,0),Q(this._fadeFrame),this._fadeFrame=x(this._updateOpacity,this)):(n.active=!0,this._pruneTiles()),e||(ue(n.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:n.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),At.ielt9||!this._map._fadeAnimated?x(this._pruneTiles,this):setTimeout(i(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new C(this._wrapX?a(t.x,this._wrapX):t.x,this._wrapY?a(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new E(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});var si=oi.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,e){this._url=t,(e=d(this,e)).detectRetina&&At.retina&&e.maxZoom>0?(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom=Math.min(e.maxZoom,e.minZoom+1)):(e.zoomOffset++,e.maxZoom=Math.max(e.minZoom,e.maxZoom-1)),e.minZoom=Math.max(0,e.minZoom)):e.zoomReverse?e.minZoom=Math.min(e.maxZoom,e.minZoom):e.maxZoom=Math.max(e.minZoom,e.maxZoom),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var n=document.createElement("img");return _e(n,"load",i(this._tileOnLoad,this,e,n)),_e(n,"error",i(this._tileOnError,this,e,n)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(n.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),"string"==typeof this.options.referrerPolicy&&(n.referrerPolicy=this.options.referrerPolicy),n.alt="",n.src=this.getTileUrl(t),n},getTileUrl:function(t){var n={r:At.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var i=this._globalTileRange.max.y-t.y;this.options.tms&&(n.y=i),n["-y"]=i}return p(this._url,e(n,this.options))},_tileOnLoad:function(t,e){At.ielt9?setTimeout(i(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,n){var i=this.options.errorTileUrl;i&&e.getAttribute("src")!==i&&(e.src=i),t(n,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,e=this.options.maxZoom;return this.options.zoomReverse&&(t=e-t),t+this.options.zoomOffset},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)if(this._tiles[t].coords.z!==this._tileZoom&&((e=this._tiles[t].el).onload=l,e.onerror=l,!e.complete)){e.src=y;var n=this._tiles[t].coords;oe(e),delete this._tiles[t],this.fire("tileabort",{tile:e,coords:n})}},_removeTile:function(t){var e=this._tiles[t];if(e)return e.el.setAttribute("src",y),oi.prototype._removeTile.call(this,t)},_tileReady:function(t,e,n){if(this._map&&(!n||n.getAttribute("src")!==y))return oi.prototype._tileReady.call(this,t,e,n)}});function ai(t,e){return new si(t,e)}var li=si.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,n){this._url=t;var i=e({},this.defaultWmsParams);for(var r in n)r in this.options||(i[r]=n[r]);var o=(n=d(this,n)).detectRetina&&At.retina?2:1,s=this.getTileSize();i.width=s.x*o,i.height=s.y*o,this.wmsParams=i},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,si.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),n=this._crs,i=A(n.project(e[0]),n.project(e[1])),r=i.min,o=i.max,s=(this._wmsVersion>=1.3&&this._crs===Qn?[r.y,r.x,o.y,o.x]:[r.x,r.y,o.x,o.y]).join(","),a=si.prototype.getTileUrl.call(this,t);return a+O(this.wmsParams,a,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+s},setParams:function(t,n){return e(this.wmsParams,t),n||this.redraw(),this}});si.WMS=li,ai.wms=function(t,e){return new li(t,e)};var ci=kn.extend({options:{padding:.1},initialize:function(t){d(this,t),o(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),ue(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var n=this._map.getZoomScale(e,this._zoom),i=this._map.getSize().multiplyBy(.5+this.options.padding),r=this._map.project(this._center,e),o=i.multiplyBy(-n).add(r).subtract(this._map._getNewPixelOrigin(t,e));At.any3d?me(this._container,o,n):ge(this._container,o)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),n=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new E(n,n.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),ui=ci.extend({options:{tolerance:0},getEvents:function(){var t=ci.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){ci.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");_e(t,"mousemove",this._onMouseMove,this),_e(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),_e(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){Q(this._redrawRequest),delete this._ctx,oe(this._container),Te(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){ci.prototype._update.call(this);var t=this._bounds,e=this._container,n=t.getSize(),i=At.retina?2:1;ge(e,t.min),e.width=i*n.x,e.height=i*n.y,e.style.width=n.x+"px",e.style.height=n.y+"px",At.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){ci.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[o(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,n=e.next,i=e.prev;n?n.prev=i:this._drawLast=i,i?i.next=n:this._drawFirst=n,delete t._order,delete this._layers[o(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){var e,n,i=t.options.dashArray.split(/[, ]+/),r=[];for(n=0;n')}}catch(t){}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),Oi={_initContainer:function(){this._container=re("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(ci.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=di("shape");ue(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=di("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[o(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;oe(e),t.removeInteractiveTarget(e),delete this._layers[o(t)]},_updateStyle:function(t){var e=t._stroke,n=t._fill,i=t.options,r=t._container;r.stroked=!!i.stroke,r.filled=!!i.fill,i.stroke?(e||(e=t._stroke=di("stroke")),r.appendChild(e),e.weight=i.weight+"px",e.color=i.color,e.opacity=i.opacity,i.dashArray?e.dashStyle=m(i.dashArray)?i.dashArray.join(" "):i.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=i.lineCap.replace("butt","flat"),e.joinstyle=i.lineJoin):e&&(r.removeChild(e),t._stroke=null),i.fill?(n||(n=t._fill=di("fill")),r.appendChild(n),n.color=i.fillColor||i.color,n.opacity=i.fillOpacity):n&&(r.removeChild(n),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),n=Math.round(t._radius),i=Math.round(t._radiusY||n);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+n+","+i+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){ae(t._container)},_bringToBack:function(t){le(t._container)}},fi=At.vml?di:G,pi=ci.extend({_initContainer:function(){this._container=fi("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=fi("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){oe(this._container),Te(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!this._map._animatingZoom||!this._bounds){ci.prototype._update.call(this);var t=this._bounds,e=t.getSize(),n=this._container;this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,n.setAttribute("width",e.x),n.setAttribute("height",e.y)),ge(n,t.min),n.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=fi("path");t.options.className&&ue(e,t.options.className),t.options.interactive&&ue(e,"leaflet-interactive"),this._updateStyle(t),this._layers[o(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){oe(t._path),t.removeInteractiveTarget(t._path),delete this._layers[o(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,n=t.options;e&&(n.stroke?(e.setAttribute("stroke",n.color),e.setAttribute("stroke-opacity",n.opacity),e.setAttribute("stroke-width",n.weight),e.setAttribute("stroke-linecap",n.lineCap),e.setAttribute("stroke-linejoin",n.lineJoin),n.dashArray?e.setAttribute("stroke-dasharray",n.dashArray):e.removeAttribute("stroke-dasharray"),n.dashOffset?e.setAttribute("stroke-dashoffset",n.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),n.fill?(e.setAttribute("fill",n.fillColor||n.color),e.setAttribute("fill-opacity",n.fillOpacity),e.setAttribute("fill-rule",n.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,F(t._parts,e))},_updateCircle:function(t){var e=t._point,n=Math.max(Math.round(t._radius),1),i="a"+n+","+(Math.max(Math.round(t._radiusY),1)||n)+" 0 1,0 ",r=t._empty()?"M0 0":"M"+(e.x-n)+","+e.y+i+2*n+",0 "+i+2*-n+",0 ";this._setPath(t,r)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){ae(t._path)},_bringToBack:function(t){le(t._path)}});function mi(t){return At.svg||At.vml?new pi(t):null}At.vml&&pi.include(Oi),De.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&hi(t)||mi(t)}});var gi=qn.extend({initialize:function(t,e){qn.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=M(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});pi.create=fi,pi.pointsToPath=F,Wn.geometryToLayer=jn,Wn.coordsToLatLng=Ln,Wn.coordsToLatLngs=Nn,Wn.latLngToCoords=Un,Wn.latLngsToCoords=Dn,Wn.getFeature=Yn,Wn.asFeature=Bn,De.mergeOptions({boxZoom:!0});var yi=Je.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){_e(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Te(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){oe(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),Bt(),ve(),this._startPoint=this._map.mouseEventToContainerPoint(t),_e(document,{contextmenu:Xe,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=re("div","leaflet-zoom-box",this._container),ue(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new E(this._point,this._startPoint),n=e.getSize();ge(this._box,e.min),this._box.style.width=n.x+"px",this._box.style.height=n.y+"px"},_finish:function(){this._moved&&(oe(this._box),he(this._container,"leaflet-crosshair")),Gt(),be(),Te(document,{contextmenu:Xe,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(i(this._resetState,this),0);var e=new Z(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});De.addInitHook("addHandler","boxZoom",yi),De.mergeOptions({doubleClickZoom:!0});var $i=Je.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,n=e.getZoom(),i=e.options.zoomDelta,r=t.originalEvent.shiftKey?n-i:n+i;"center"===e.options.doubleClickZoom?e.setZoom(r):e.setZoomAround(t.containerPoint,r)}});De.addInitHook("addHandler","doubleClickZoom",$i),De.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var vi=Je.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new nn(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}ue(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){he(this._map._container,"leaflet-grab"),he(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=M(this._map.options.maxBounds);this._offsetLimit=A(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,n=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(n),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.xe.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),n=this._initialWorldOffset,i=this._draggable._newPos.x,r=(i-e+n)%t+e-n,o=(i+e+n)%t-e-n,s=Math.abs(r+n)0?o:-o))-e;this._delta=0,this._startTime=null,s&&("center"===t.options.scrollWheelZoom?t.setZoom(e+s):t.setZoomAround(this._lastMousePos,e+s))}});De.addInitHook("addHandler","scrollWheelZoom",Si);De.mergeOptions({tapHold:At.touchNative&&At.safari&&At.mobile,tapTolerance:15});var wi=Je.extend({addHooks:function(){_e(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Te(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(clearTimeout(this._holdTimeout),1===t.touches.length){var e=t.touches[0];this._startPos=this._newPos=new C(e.clientX,e.clientY),this._holdTimeout=setTimeout(i((function(){this._cancel(),this._isTapValid()&&(_e(document,"touchend",Ve),_e(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",e))}),this),600),_e(document,"touchend touchcancel contextmenu",this._cancel,this),_e(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function t(){Te(document,"touchend",Ve),Te(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),Te(document,"touchend touchcancel contextmenu",this._cancel,this),Te(document,"touchmove",this._onMove,this)},_onMove:function(t){var e=t.touches[0];this._newPos=new C(e.clientX,e.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,e){var n=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY});n._simulated=!0,e.target.dispatchEvent(n)}});De.addInitHook("addHandler","tapHold",wi),De.mergeOptions({touchZoom:At.touch,bounceAtZoomLimits:!0});var xi=Je.extend({addHooks:function(){ue(this._map._container,"leaflet-touch-zoom"),_e(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){he(this._map._container,"leaflet-touch-zoom"),Te(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(t.touches&&2===t.touches.length&&!e._animatingZoom&&!this._zooming){var n=e.mouseEventToContainerPoint(t.touches[0]),i=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),"center"!==e.options.touchZoom&&(this._pinchStartLatLng=e.containerPointToLatLng(n.add(i)._divideBy(2))),this._startDist=n.distanceTo(i),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),_e(document,"touchmove",this._onTouchMove,this),_e(document,"touchend touchcancel",this._onTouchEnd,this),Ve(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,n=e.mouseEventToContainerPoint(t.touches[0]),r=e.mouseEventToContainerPoint(t.touches[1]),o=n.distanceTo(r)/this._startDist;if(this._zoom=e.getScaleZoom(o,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoome.getMaxZoom()&&o>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===o)return}else{var s=n._add(r)._divideBy(2)._subtract(this._centerPoint);if(1===o&&0===s.x&&0===s.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(s),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),Q(this._animRequest);var a=i(e._move,e,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=x(a,this,!0),Ve(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,Q(this._animRequest),Te(document,"touchmove",this._onTouchMove,this),Te(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});De.addInitHook("addHandler","touchZoom",xi),De.BoxZoom=yi,De.DoubleClickZoom=$i,De.Drag=vi,De.Keyboard=bi,De.ScrollWheelZoom=Si,De.TapHold=wi,De.TouchZoom=xi,t.Bounds=E,t.Browser=At,t.CRS=W,t.Canvas=ui,t.Circle=Vn,t.CircleMarker=Mn,t.Class=_,t.Control=Ye,t.DivIcon=ri,t.DivOverlay=ei,t.DomEvent=Ne,t.DomUtil=Pe,t.Draggable=nn,t.Evented=T,t.FeatureGroup=Cn,t.GeoJSON=Wn,t.GridLayer=oi,t.Handler=Je,t.Icon=zn,t.ImageOverlay=Kn,t.LatLng=V,t.LatLngBounds=Z,t.Layer=kn,t.LayerGroup=Tn,t.LineUtil=vn,t.Map=De,t.Marker=An,t.Mixin=tn,t.Path=Zn,t.Point=C,t.PolyUtil=ln,t.Polygon=qn,t.Polyline=Xn,t.Popup=ni,t.PosAnimation=Ue,t.Projection=wn,t.Rectangle=gi,t.Renderer=ci,t.SVG=pi,t.SVGOverlay=ti,t.TileLayer=si,t.Tooltip=ii,t.Transformation=U,t.Util=P,t.VideoOverlay=Jn,t.bind=i,t.bounds=A,t.canvas=hi,t.circle=function(t,e,n){return new Vn(t,e,n)},t.circleMarker=function(t,e){return new Mn(t,e)},t.control=Be,t.divIcon=function(t){return new ri(t)},t.extend=e,t.featureGroup=function(t,e){return new Cn(t,e)},t.geoJSON=Fn,t.geoJson=Hn,t.gridLayer=function(t){return new oi(t)},t.icon=function(t){return new zn(t)},t.imageOverlay=function(t,e,n){return new Kn(t,e,n)},t.latLng=X,t.latLngBounds=M,t.layerGroup=function(t,e){return new Tn(t,e)},t.map=function(t,e){return new De(t,e)},t.marker=function(t,e){return new An(t,e)},t.point=R,t.polygon=function(t,e){return new qn(t,e)},t.polyline=function(t,e){return new Xn(t,e)},t.popup=function(t,e){return new ni(t,e)},t.rectangle=function(t,e){return new gi(t,e)},t.setOptions=d,t.stamp=o,t.svg=mi,t.svgOverlay=function(t,e,n){return new ti(t,e,n)},t.tileLayer=ai,t.tooltip=function(t,e){return new ii(t,e)},t.transformation=D,t.version="1.9.4",t.videoOverlay=function(t,e,n){return new Jn(t,e,n)};var Qi=window.L;t.noConflict=function(){return window.L=Qi,this},window.L=t}(e)},2694:(t,e,n)=>{"use strict";var i=n(6925);function r(){}function o(){}o.resetWarningCache=r,t.exports=function(){function t(t,e,n,r,o,s){if(s!==i){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function e(){return t}t.isRequired=t;var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:o,resetWarningCache:r};return n.PropTypes=n,n}},5556:(t,e,n)=>{t.exports=n(2694)()},6925:t=>{"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},5338:(t,e,n)=>{"use strict";var i=n(5795);e.H=i.createRoot,i.hydrateRoot},7665:(t,e,n)=>{"use strict";n.d(e,{tH:()=>s});var i=n(1609);const r=(0,i.createContext)(null),o={didCatch:!1,error:null};class s extends i.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=o}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(null!==t){for(var e,n,i=arguments.length,r=new Array(i),s=0;s0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.length!==e.length||t.some(((t,n)=>!Object.is(t,e[n])))}(t.resetKeys,i)&&(null===(r=(s=this.props).onReset)||void 0===r||r.call(s,{next:i,prev:t.resetKeys,reason:"keys"}),this.setState(o))}render(){const{children:t,fallbackRender:e,FallbackComponent:n,fallback:o}=this.props,{didCatch:s,error:a}=this.state;let l=t;if(s){const t={error:a,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof e)l=e(t);else if(n)l=(0,i.createElement)(n,t);else{if(void 0===o)throw a;l=o}}return(0,i.createElement)(r.Provider,{value:{didCatch:s,error:a,resetErrorBoundary:this.resetErrorBoundary}},l)}}},2799:(t,e)=>{"use strict";var n="function"==typeof Symbol&&Symbol.for,i=n?Symbol.for("react.element"):60103,r=n?Symbol.for("react.portal"):60106,o=n?Symbol.for("react.fragment"):60107,s=n?Symbol.for("react.strict_mode"):60108,a=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,h=n?Symbol.for("react.concurrent_mode"):60111,d=n?Symbol.for("react.forward_ref"):60112,O=n?Symbol.for("react.suspense"):60113,f=n?Symbol.for("react.suspense_list"):60120,p=n?Symbol.for("react.memo"):60115,m=n?Symbol.for("react.lazy"):60116,g=n?Symbol.for("react.block"):60121,y=n?Symbol.for("react.fundamental"):60117,$=n?Symbol.for("react.responder"):60118,v=n?Symbol.for("react.scope"):60119;function b(t){if("object"==typeof t&&null!==t){var e=t.$$typeof;switch(e){case i:switch(t=t.type){case u:case h:case o:case a:case s:case O:return t;default:switch(t=t&&t.$$typeof){case c:case d:case m:case p:case l:return t;default:return e}}case r:return e}}}function S(t){return b(t)===h}e.AsyncMode=u,e.ConcurrentMode=h,e.ContextConsumer=c,e.ContextProvider=l,e.Element=i,e.ForwardRef=d,e.Fragment=o,e.Lazy=m,e.Memo=p,e.Portal=r,e.Profiler=a,e.StrictMode=s,e.Suspense=O,e.isAsyncMode=function(t){return S(t)||b(t)===u},e.isConcurrentMode=S,e.isContextConsumer=function(t){return b(t)===c},e.isContextProvider=function(t){return b(t)===l},e.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===i},e.isForwardRef=function(t){return b(t)===d},e.isFragment=function(t){return b(t)===o},e.isLazy=function(t){return b(t)===m},e.isMemo=function(t){return b(t)===p},e.isPortal=function(t){return b(t)===r},e.isProfiler=function(t){return b(t)===a},e.isStrictMode=function(t){return b(t)===s},e.isSuspense=function(t){return b(t)===O},e.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===o||t===h||t===a||t===s||t===O||t===f||"object"==typeof t&&null!==t&&(t.$$typeof===m||t.$$typeof===p||t.$$typeof===l||t.$$typeof===c||t.$$typeof===d||t.$$typeof===y||t.$$typeof===$||t.$$typeof===v||t.$$typeof===g)},e.typeOf=b},4363:(t,e,n)=>{"use strict";t.exports=n(2799)},4210:(t,e,n)=>{"use strict";function i(t,e,n,i,r,o,s){this.acceptsBooleans=2===e||3===e||4===e,this.attributeName=i,this.attributeNamespace=r,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=o,this.removeEmptyString=s}const r={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach((t=>{r[t]=new i(t,0,!1,t,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((([t,e])=>{r[t]=new i(t,1,!1,e,null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((t=>{r[t]=new i(t,2,!1,t.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((t=>{r[t]=new i(t,2,!1,t,null,!1,!1)})),["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach((t=>{r[t]=new i(t,3,!1,t.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((t=>{r[t]=new i(t,3,!0,t,null,!1,!1)})),["capture","download"].forEach((t=>{r[t]=new i(t,4,!1,t,null,!1,!1)})),["cols","rows","size","span"].forEach((t=>{r[t]=new i(t,6,!1,t,null,!1,!1)})),["rowSpan","start"].forEach((t=>{r[t]=new i(t,5,!1,t.toLowerCase(),null,!1,!1)}));const o=/[\-\:]([a-z])/g,s=t=>t[1].toUpperCase();["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach((t=>{const e=t.replace(o,s);r[e]=new i(e,1,!1,t,null,!1,!1)})),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach((t=>{const e=t.replace(o,s);r[e]=new i(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((t=>{const e=t.replace(o,s);r[e]=new i(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((t=>{r[t]=new i(t,1,!1,t.toLowerCase(),null,!1,!1)})),r.xlinkHref=new i("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((t=>{r[t]=new i(t,1,!1,t.toLowerCase(),null,!0,!0)}));const{CAMELCASE:a,SAME:l,possibleStandardNames:c}=n(6811),u=RegExp.prototype.test.bind(new RegExp("^(data|aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$")),h=Object.keys(c).reduce(((t,e)=>{const n=c[e];return n===l?t[e]=e:n===a?t[e.toLowerCase()]=e:t[e]=n,t}),{});e.BOOLEAN=3,e.BOOLEANISH_STRING=2,e.NUMERIC=5,e.OVERLOADED_BOOLEAN=4,e.POSITIVE_NUMERIC=6,e.RESERVED=0,e.STRING=1,e.getPropertyInfo=function(t){return r.hasOwnProperty(t)?r[t]:null},e.isCustomAttribute=u,e.possibleStandardNames=h},6811:(t,e)=>{e.SAME=0,e.CAMELCASE=1,e.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1}},3762:(t,e,n)=>{"use strict";function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function r(t){var e=function(t){if("object"!=i(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==i(e)?e:e+""}function o(t,e,n){return(e=r(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function a(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,i=Array(e);ndi});var h=n(8587);function d(t,e){if(null==t)return{};var n,i,r=(0,h.A)(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i0?k(X,--M):0,A--,10===V&&(A=1,E--),V}function I(){return V=M2||D(V)>3?"":" "}function H(t,e){for(;--e&&I()&&!(V<48||V>102||V>57&&V<65||V>70&&V<97););return U(t,N()+(e<6&&32==L()&&32==I()))}function K(t){for(;I();)switch(V){case t:return M;case 34:case 39:34!==t&&39!==t&&K(V);break;case 40:41===t&&K(t);break;case 92:I()}return M}function J(t,e){for(;I()&&t+V!==57&&(t+V!==84||47!==L()););return"/*"+U(e,M-1)+"*"+w(47===t?t:I())}function tt(t){for(;!D(L());)I();return U(t,M)}var et="-ms-",nt="-moz-",it="-webkit-",rt="comm",ot="rule",st="decl",at="@keyframes";function lt(t,e){for(var n="",i=z(t),r=0;r0&&C(x)-h&&R(O>32?ft(x+";",i,n,h-1):ft(P(x," ","")+";",i,n,h-2),l);break;case 59:x+=";";default:if(R(S=dt(x,e,n,c,u,r,a,$,v=[],b=[],h),o),123===y)if(0===u)ht(x,e,S,S,v,o,h,a,b);else switch(99===d&&110===k(x,3)?100:d){case 100:case 108:case 109:case 115:ht(t,S,S,i&&R(dt(t,S,S,0,0,r,a,$,r,v=[],h),b),r,b,h,a,i?v:b);break;default:ht(x,S,S,S,[""],b,0,a,b)}}c=u=O=0,p=g=1,$=x="",h=s;break;case 58:h=1+C(x),O=f;default:if(p<1)if(123==y)--p;else if(125==y&&0==p++&&125==j())continue;switch(x+=w(y),y*p){case 38:g=u>0?1:(x+="\f",-1);break;case 44:a[c++]=(C(x)-1)*g,g=1;break;case 64:45===L()&&(x+=G(I())),d=L(),u=h=C($=x+=tt(N())),y++;break;case 45:45===f&&2==C(x)&&(p=0)}}return o}function dt(t,e,n,i,r,o,s,a,l,c,u){for(var h=r-1,d=0===r?o:[""],O=z(d),f=0,p=0,m=0;f0?d[g]+" "+y:P(y,/&\f/g,d[g])))&&(l[m++]=$);return q(t,e,n,0===r?ot:a,l,c,u)}function Ot(t,e,n){return q(t,e,n,rt,w(V),T(t,2,-2),0)}function ft(t,e,n,i){return q(t,e,n,st,T(t,0,i),T(t,i+1,-1),i)}var pt=function(t,e,n){for(var i=0,r=0;i=r,r=L(),38===i&&12===r&&(e[n]=1),!D(r);)I();return U(t,M)},mt=new WeakMap,gt=function(t){if("rule"===t.type&&t.parent&&!(t.length<1)){for(var e=t.value,n=t.parent,i=t.column===n.column&&t.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==t.props.length||58===e.charCodeAt(0)||mt.get(n))&&!i){mt.set(t,!0);for(var r=[],o=function(t,e){return B(function(t,e){var n=-1,i=44;do{switch(D(i)){case 0:38===i&&12===L()&&(e[n]=1),t[n]+=pt(M-1,e,n);break;case 2:t[n]+=G(i);break;case 4:if(44===i){t[++n]=58===L()?"&\f":"",e[n]=t[n].length;break}default:t[n]+=w(i)}}while(i=I());return t}(Y(t),e))}(e,r),s=n.props,a=0,l=0;a6)switch(k(t,e+1)){case 109:if(45!==k(t,e+4))break;case 102:return P(t,/(.+:)(.+)-([^]+)/,"$1"+it+"$2-$3$1"+nt+(108==k(t,e+3)?"$3":"$2-$3"))+t;case 115:return~_(t,"stretch")?$t(P(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(115!==k(t,e+1))break;case 6444:switch(k(t,C(t)-3-(~_(t,"!important")&&10))){case 107:return P(t,":",":"+it)+t;case 101:return P(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+it+(45===k(t,14)?"inline-":"")+"box$3$1"+it+"$2$3$1"+et+"$2box$3")+t}break;case 5936:switch(k(t,e+11)){case 114:return it+t+et+P(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return it+t+et+P(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return it+t+et+P(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return it+t+et+t+t}return t}var vt=[function(t,e,n,i){if(t.length>-1&&!t.return)switch(t.type){case st:t.return=$t(t.value,t.length);break;case at:return lt([W(t,{value:P(t.value,"@","@"+it)})],i);case ot:if(t.length)return function(t,e){return t.map(e).join("")}(t.props,(function(e){switch(function(t){return(t=/(::plac\w+|:read-\w+)/.exec(t))?t[0]:t}(e)){case":read-only":case":read-write":return lt([W(t,{props:[P(e,/:(read-\w+)/,":-moz-$1")]})],i);case"::placeholder":return lt([W(t,{props:[P(e,/:(plac\w+)/,":"+it+"input-$1")]}),W(t,{props:[P(e,/:(plac\w+)/,":-moz-$1")]}),W(t,{props:[P(e,/:(plac\w+)/,et+"input-$1")]})],i)}return""}))}}],bt=function(t){var e=t.key;if("css"===e){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(t){-1!==t.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(t),t.setAttribute("data-s",""))}))}var i,r,o=t.stylisPlugins||vt,s={},a=[];i=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+e+' "]'),(function(t){for(var e=t.getAttribute("data-emotion").split(" "),n=1;n=4;++i,r-=4)e=1540483477*(65535&(e=255&t.charCodeAt(i)|(255&t.charCodeAt(++i))<<8|(255&t.charCodeAt(++i))<<16|(255&t.charCodeAt(++i))<<24))+(59797*(e>>>16)<<16),n=1540483477*(65535&(e^=e>>>24))+(59797*(e>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(r){case 3:n^=(255&t.charCodeAt(i+2))<<16;case 2:n^=(255&t.charCodeAt(i+1))<<8;case 1:n=1540483477*(65535&(n^=255&t.charCodeAt(i)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(r)+l;return{name:c,styles:r,next:Rt}}var Zt=!!O.useInsertionEffect&&O.useInsertionEffect,Mt=Zt||function(t){return t()},Vt=(Zt||O.useLayoutEffect,O.createContext("undefined"!=typeof HTMLElement?bt({key:"css"}):null)),Xt=(Vt.Provider,function(t){return(0,O.forwardRef)((function(e,n){var i=(0,O.useContext)(Vt);return t(e,i,n)}))}),qt=O.createContext({}),Wt={}.hasOwnProperty,jt="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",It=function(t){var e=t.cache,n=t.serialized,i=t.isStringTag;return St(e,n,i),Mt((function(){return function(t,e,n){St(t,e,n);var i=t.key+"-"+e.name;if(void 0===t.inserted[e.name]){var r=e;do{t.insert(e===r?"."+i:"",r,t.sheet,!0),r=r.next}while(void 0!==r)}}(e,n,i)})),null},Lt=Xt((function(t,e,n){var i=t.css;"string"==typeof i&&void 0!==e.registered[i]&&(i=e.registered[i]);var r=t[jt],o=[i],s="";"string"==typeof t.className?s=function(t,e,n){var i="";return n.split(" ").forEach((function(n){void 0!==t[n]?e.push(t[n]+";"):n&&(i+=n+" ")})),i}(e.registered,o,t.className):null!=t.className&&(s=t.className+" ");var a=At(o,void 0,O.useContext(qt));s+=e.key+"-"+a.name;var l={};for(var c in t)Wt.call(t,c)&&"css"!==c&&c!==jt&&(l[c]=t[c]);return l.className=s,n&&(l.ref=n),O.createElement(O.Fragment,null,O.createElement(It,{cache:e,serialized:a,isStringTag:"string"==typeof r}),O.createElement(r,l))})),Nt=Lt,Ut=(n(4146),function(t,e){var n=arguments;if(null==e||!Wt.call(e,"css"))return O.createElement.apply(void 0,n);var i=n.length,r=new Array(i);r[0]=Nt,r[1]=function(t,e){var n={};for(var i in e)Wt.call(e,i)&&(n[i]=e[i]);return n[jt]=t,n}(t,e);for(var o=2;o({x:t,y:t});function Jt(){return"undefined"!=typeof window}function te(t){return ie(t)?(t.nodeName||"").toLowerCase():"#document"}function ee(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function ne(t){var e;return null==(e=(ie(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function ie(t){return!!Jt()&&(t instanceof Node||t instanceof ee(t).Node)}function re(t){return!!Jt()&&(t instanceof Element||t instanceof ee(t).Element)}function oe(t){return!!Jt()&&(t instanceof HTMLElement||t instanceof ee(t).HTMLElement)}function se(t){return!(!Jt()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof ee(t).ShadowRoot)}function ae(t){const{overflow:e,overflowX:n,overflowY:i,display:r}=le(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!["inline","contents"].includes(r)}function le(t){return ee(t).getComputedStyle(t)}function ce(t){const e=function(t){if("html"===te(t))return t;const e=t.assignedSlot||t.parentNode||se(t)&&t.host||ne(t);return se(e)?e.host:e}(t);return function(t){return["html","body","#document"].includes(te(t))}(e)?t.ownerDocument?t.ownerDocument.body:t.body:oe(e)&&ae(e)?e:ce(e)}function ue(t,e,n){var i;void 0===e&&(e=[]),void 0===n&&(n=!0);const r=ce(t),o=r===(null==(i=t.ownerDocument)?void 0:i.body),s=ee(r);if(o){const t=he(s);return e.concat(s,s.visualViewport||[],ae(r)?r:[],t&&n?ue(t):[])}return e.concat(r,ue(r,[],n))}function he(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function de(t){return re(t)?t:t.contextElement}function Oe(t){const e=de(t);if(!oe(e))return Kt(1);const n=e.getBoundingClientRect(),{width:i,height:r,$:o}=function(t){const e=le(t);let n=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=oe(t),o=r?t.offsetWidth:n,s=r?t.offsetHeight:i,a=Ft(n)!==o||Ft(i)!==s;return a&&(n=o,i=s),{width:n,height:i,$:a}}(e);let s=(o?Ft(n.width):n.width)/i,a=(o?Ft(n.height):n.height)/r;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const fe=Kt(0);function pe(t){const e=ee(t);return"undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:fe}function me(t,e,n,i){void 0===e&&(e=!1),void 0===n&&(n=!1);const r=t.getBoundingClientRect(),o=de(t);let s=Kt(1);e&&(i?re(i)&&(s=Oe(i)):s=Oe(t));const a=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==ee(t))&&e}(o,n,i)?pe(o):Kt(0);let l=(r.left+a.x)/s.x,c=(r.top+a.y)/s.y,u=r.width/s.x,h=r.height/s.y;if(o){const t=ee(o),e=i&&re(i)?ee(i):i;let n=t,r=he(n);for(;r&&i&&e!==n;){const t=Oe(r),e=r.getBoundingClientRect(),i=le(r),o=e.left+(r.clientLeft+parseFloat(i.paddingLeft))*t.x,s=e.top+(r.clientTop+parseFloat(i.paddingTop))*t.y;l*=t.x,c*=t.y,u*=t.x,h*=t.y,l+=o,c+=s,n=ee(r),r=he(n)}}return function(t){const{x:e,y:n,width:i,height:r}=t;return{width:i,height:r,top:n,left:e,right:e+i,bottom:n+r,x:e,y:n}}({width:u,height:h,x:l,y:c})}const ge=O.useLayoutEffect;var ye=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],$e=function(){};function ve(t,e){return e?"-"===e[0]?t+e:t+"__"+e:t}function be(t,e){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r-1}function Pe(t){return Qe(t)?window.pageYOffset:t.scrollTop}function _e(t,e){Qe(t)?window.scrollTo(0,e):t.scrollTop=e}function ke(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:$e,r=Pe(t),o=e-r,s=0;!function e(){var a,l=o*((a=(a=s+=10)/n-1)*a*a+1)+r;_e(t,l),sn.bottom?_e(t,Math.min(e.offsetTop+e.clientHeight-t.offsetHeight+r,t.scrollHeight)):i.top-r=f)return{placement:"bottom",maxHeight:e};if(x>=f&&!s)return o&&ke(l,Q,_),{placement:"bottom",maxHeight:e};if(!s&&x>=i||s&&S>=i)return o&&ke(l,Q,_),{placement:"bottom",maxHeight:s?S-$:x-$};if("auto"===r||s){var k=e,T=s?b:w;return T>=i&&(k=Math.min(T-$-a,e)),{placement:"top",maxHeight:k}}if("bottom"===r)return o&&_e(l,Q),{placement:"bottom",maxHeight:e};break;case"top":if(b>=f)return{placement:"top",maxHeight:e};if(w>=f&&!s)return o&&ke(l,P,_),{placement:"top",maxHeight:e};if(!s&&w>=i||s&&b>=i){var C=e;return(!s&&w>=i||s&&b>=i)&&(C=s?b-v:w-v),o&&ke(l,P,_),{placement:"top",maxHeight:C}}return{placement:"bottom",maxHeight:e};default:throw new Error('Invalid placement provided "'.concat(r,'".'))}return c}({maxHeight:i,menuEl:t,minHeight:n,placement:r,shouldScroll:s&&!e,isFixedPosition:e,controlHeight:$});p(a.maxHeight),y(a.placement),null==c||c(a.placement)}}),[i,r,o,s,n,c,$]),e({ref:h,placerProps:a(a({},t),{},{placement:g||Ie(r),maxHeight:f})})},Ue=function(t,e){var n=t.theme,i=n.spacing.baseUnit,r=n.colors;return a({textAlign:"center"},e?{}:{color:r.neutral40,padding:"".concat(2*i,"px ").concat(3*i,"px")})},De=Ue,Ye=Ue,Be=["size"],Ge=["innerProps","isRtl","size"],Fe={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},He=function(t){var e=t.size,n=d(t,Be);return Ut("svg",(0,p.A)({height:e,width:e,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:Fe},n))},Ke=function(t){return Ut(He,(0,p.A)({size:20},t),Ut("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},Je=function(t){return Ut(He,(0,p.A)({size:20},t),Ut("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},tn=function(t,e){var n=t.isFocused,i=t.theme,r=i.spacing.baseUnit,o=i.colors;return a({label:"indicatorContainer",display:"flex",transition:"color 150ms"},e?{}:{color:n?o.neutral60:o.neutral20,padding:2*r,":hover":{color:n?o.neutral80:o.neutral40}})},en=tn,nn=tn,rn=function(){var t=Dt.apply(void 0,arguments),e="animation-"+t.name;return{name:e,styles:"@keyframes "+e+"{"+t.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}(qe||(We=["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"],je||(je=We.slice(0)),qe=Object.freeze(Object.defineProperties(We,{raw:{value:Object.freeze(je)}})))),on=function(t){var e=t.delay,n=t.offset;return Ut("span",{css:Dt({animation:"".concat(rn," 1s ease-in-out ").concat(e,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},sn=["data"],an=["innerRef","isDisabled","isHidden","inputClassName"],ln={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},cn={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":a({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},ln)},un=function(t){return a({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},ln)},hn=function(t){var e=t.children,n=t.innerProps;return Ut("div",n,e)},dn={ClearIndicator:function(t){var e=t.children,n=t.innerProps;return Ut("div",(0,p.A)({},xe(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),n),e||Ut(Ke,null))},Control:function(t){var e=t.children,n=t.isDisabled,i=t.isFocused,r=t.innerRef,o=t.innerProps,s=t.menuIsOpen;return Ut("div",(0,p.A)({ref:r},xe(t,"control",{control:!0,"control--is-disabled":n,"control--is-focused":i,"control--menu-is-open":s}),o,{"aria-disabled":n||void 0}),e)},DropdownIndicator:function(t){var e=t.children,n=t.innerProps;return Ut("div",(0,p.A)({},xe(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),n),e||Ut(Je,null))},DownChevron:Je,CrossIcon:Ke,Group:function(t){var e=t.children,n=t.cx,i=t.getStyles,r=t.getClassNames,o=t.Heading,s=t.headingProps,a=t.innerProps,l=t.label,c=t.theme,u=t.selectProps;return Ut("div",(0,p.A)({},xe(t,"group",{group:!0}),a),Ut(o,(0,p.A)({},s,{selectProps:u,theme:c,getStyles:i,getClassNames:r,cx:n}),l),Ut("div",null,e))},GroupHeading:function(t){var e=we(t);e.data;var n=d(e,sn);return Ut("div",(0,p.A)({},xe(t,"groupHeading",{"group-heading":!0}),n))},IndicatorsContainer:function(t){var e=t.children,n=t.innerProps;return Ut("div",(0,p.A)({},xe(t,"indicatorsContainer",{indicators:!0}),n),e)},IndicatorSeparator:function(t){var e=t.innerProps;return Ut("span",(0,p.A)({},e,xe(t,"indicatorSeparator",{"indicator-separator":!0})))},Input:function(t){var e=t.cx,n=t.value,i=we(t),r=i.innerRef,o=i.isDisabled,s=i.isHidden,a=i.inputClassName,l=d(i,an);return Ut("div",(0,p.A)({},xe(t,"input",{"input-container":!0}),{"data-value":n||""}),Ut("input",(0,p.A)({className:e({input:!0},a),ref:r,style:un(s),disabled:o},l)))},LoadingIndicator:function(t){var e=t.innerProps,n=t.isRtl,i=t.size,r=void 0===i?4:i,o=d(t,Ge);return Ut("div",(0,p.A)({},xe(a(a({},o),{},{innerProps:e,isRtl:n,size:r}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),e),Ut(on,{delay:0,offset:n}),Ut(on,{delay:160,offset:!0}),Ut(on,{delay:320,offset:!n}))},Menu:function(t){var e=t.children,n=t.innerRef,i=t.innerProps;return Ut("div",(0,p.A)({},xe(t,"menu",{menu:!0}),{ref:n},i),e)},MenuList:function(t){var e=t.children,n=t.innerProps,i=t.innerRef,r=t.isMulti;return Ut("div",(0,p.A)({},xe(t,"menuList",{"menu-list":!0,"menu-list--is-multi":r}),{ref:i},n),e)},MenuPortal:function(t){var e=t.appendTo,n=t.children,i=t.controlElement,r=t.innerProps,o=t.menuPlacement,s=t.menuPosition,l=(0,O.useRef)(null),c=(0,O.useRef)(null),h=u((0,O.useState)(Ie(o)),2),d=h[0],f=h[1],m=(0,O.useMemo)((function(){return{setPortalPlacement:f}}),[]),g=u((0,O.useState)(null),2),y=g[0],$=g[1],v=(0,O.useCallback)((function(){if(i){var t=function(t){var e=t.getBoundingClientRect();return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width}}(i),e="fixed"===s?0:window.pageYOffset,n=t[d]+e;n===(null==y?void 0:y.offset)&&t.left===(null==y?void 0:y.rect.left)&&t.width===(null==y?void 0:y.rect.width)||$({offset:n,rect:t})}}),[i,s,d,null==y?void 0:y.offset,null==y?void 0:y.rect.left,null==y?void 0:y.rect.width]);ge((function(){v()}),[v]);var b=(0,O.useCallback)((function(){"function"==typeof c.current&&(c.current(),c.current=null),i&&l.current&&(c.current=function(t,e,n,i){void 0===i&&(i={});const{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=i,c=de(t),u=r||o?[...c?ue(c):[],...ue(e)]:[];u.forEach((t=>{r&&t.addEventListener("scroll",n,{passive:!0}),o&&t.addEventListener("resize",n)}));const h=c&&a?function(t,e){let n,i=null;const r=ne(t);function o(){var t;clearTimeout(n),null==(t=i)||t.disconnect(),i=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),o();const{left:c,top:u,width:h,height:d}=t.getBoundingClientRect();if(a||e(),!h||!d)return;const O={rootMargin:-Ht(u)+"px "+-Ht(r.clientWidth-(c+h))+"px "+-Ht(r.clientHeight-(u+d))+"px "+-Ht(c)+"px",threshold:Gt(0,Bt(1,l))||1};let f=!0;function p(t){const e=t[0].intersectionRatio;if(e!==l){if(!f)return s();e?s(!1,e):n=setTimeout((()=>{s(!1,1e-7)}),1e3)}f=!1}try{i=new IntersectionObserver(p,{...O,root:r.ownerDocument})}catch(t){i=new IntersectionObserver(p,O)}i.observe(t)}(!0),o}(c,n):null;let d,O=-1,f=null;s&&(f=new ResizeObserver((t=>{let[i]=t;i&&i.target===c&&f&&(f.unobserve(e),cancelAnimationFrame(O),O=requestAnimationFrame((()=>{var t;null==(t=f)||t.observe(e)}))),n()})),c&&!l&&f.observe(c),f.observe(e));let p=l?me(t):null;return l&&function e(){const i=me(t);!p||i.x===p.x&&i.y===p.y&&i.width===p.width&&i.height===p.height||n(),p=i,d=requestAnimationFrame(e)}(),n(),()=>{var t;u.forEach((t=>{r&&t.removeEventListener("scroll",n),o&&t.removeEventListener("resize",n)})),null==h||h(),null==(t=f)||t.disconnect(),f=null,l&&cancelAnimationFrame(d)}}(i,l.current,v,{elementResize:"ResizeObserver"in window}))}),[i,v]);ge((function(){b()}),[b]);var S=(0,O.useCallback)((function(t){l.current=t,b()}),[b]);if(!e&&"fixed"!==s||!y)return null;var w=Ut("div",(0,p.A)({ref:S},xe(a(a({},t),{},{offset:y.offset,position:s,rect:y.rect}),"menuPortal",{"menu-portal":!0}),r),n);return Ut(Le.Provider,{value:m},e?(0,Yt.createPortal)(w,e):w)},LoadingMessage:function(t){var e=t.children,n=void 0===e?"Loading...":e,i=t.innerProps,r=d(t,Xe);return Ut("div",(0,p.A)({},xe(a(a({},r),{},{children:n,innerProps:i}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),i),n)},NoOptionsMessage:function(t){var e=t.children,n=void 0===e?"No options":e,i=t.innerProps,r=d(t,Ve);return Ut("div",(0,p.A)({},xe(a(a({},r),{},{children:n,innerProps:i}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),i),n)},MultiValue:function(t){var e=t.children,n=t.components,i=t.data,r=t.innerProps,o=t.isDisabled,s=t.removeProps,l=t.selectProps,c=n.Container,u=n.Label,h=n.Remove;return Ut(c,{data:i,innerProps:a(a({},xe(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":o})),r),selectProps:l},Ut(u,{data:i,innerProps:a({},xe(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},e),Ut(h,{data:i,innerProps:a(a({},xe(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(e||"option")},s),selectProps:l}))},MultiValueContainer:hn,MultiValueLabel:hn,MultiValueRemove:function(t){var e=t.children,n=t.innerProps;return Ut("div",(0,p.A)({role:"button"},n),e||Ut(Ke,{size:14}))},Option:function(t){var e=t.children,n=t.isDisabled,i=t.isFocused,r=t.isSelected,o=t.innerRef,s=t.innerProps;return Ut("div",(0,p.A)({},xe(t,"option",{option:!0,"option--is-disabled":n,"option--is-focused":i,"option--is-selected":r}),{ref:o,"aria-disabled":n},s),e)},Placeholder:function(t){var e=t.children,n=t.innerProps;return Ut("div",(0,p.A)({},xe(t,"placeholder",{placeholder:!0}),n),e)},SelectContainer:function(t){var e=t.children,n=t.innerProps,i=t.isDisabled,r=t.isRtl;return Ut("div",(0,p.A)({},xe(t,"container",{"--is-disabled":i,"--is-rtl":r}),n),e)},SingleValue:function(t){var e=t.children,n=t.isDisabled,i=t.innerProps;return Ut("div",(0,p.A)({},xe(t,"singleValue",{"single-value":!0,"single-value--is-disabled":n}),i),e)},ValueContainer:function(t){var e=t.children,n=t.innerProps,i=t.isMulti,r=t.hasValue;return Ut("div",(0,p.A)({},xe(t,"valueContainer",{"value-container":!0,"value-container--is-multi":i,"value-container--has-value":r}),n),e)}},On=Number.isNaN||function(t){return"number"==typeof t&&t!=t};function fn(t,e){if(t.length!==e.length)return!1;for(var n=0;n1?"s":""," ").concat(r.join(","),", selected.");case"select-option":return"option ".concat(i,o?" is disabled. Select another option.":", selected.");default:return""}},onFocus:function(t){var e=t.context,n=t.focused,i=t.options,r=t.label,o=void 0===r?"":r,s=t.selectValue,a=t.isDisabled,l=t.isSelected,c=t.isAppleDevice,u=function(t,e){return t&&t.length?"".concat(t.indexOf(e)+1," of ").concat(t.length):""};if("value"===e&&s)return"value ".concat(o," focused, ").concat(u(s,n),".");if("menu"===e&&c){var h=a?" disabled":"",d="".concat(l?" selected":"").concat(h);return"".concat(o).concat(d,", ").concat(u(i,n),".")}return""},onFilter:function(t){var e=t.inputValue,n=t.resultsMessage;return"".concat(n).concat(e?" for search term "+e:"",".")}},yn=function(t){var e=t.ariaSelection,n=t.focusedOption,i=t.focusedValue,r=t.focusableOptions,o=t.isFocused,s=t.selectValue,l=t.selectProps,c=t.id,u=t.isAppleDevice,h=l.ariaLiveMessages,d=l.getOptionLabel,f=l.inputValue,p=l.isMulti,m=l.isOptionDisabled,g=l.isSearchable,y=l.menuIsOpen,$=l.options,v=l.screenReaderStatus,b=l.tabSelectsValue,S=l.isLoading,w=l["aria-label"],x=l["aria-live"],Q=(0,O.useMemo)((function(){return a(a({},gn),h||{})}),[h]),P=(0,O.useMemo)((function(){var t,n="";if(e&&Q.onChange){var i=e.option,r=e.options,o=e.removedValue,l=e.removedValues,c=e.value,u=o||i||(t=c,Array.isArray(t)?null:t),h=u?d(u):"",O=r||l||void 0,f=O?O.map(d):[],p=a({isDisabled:u&&m(u,s),label:h,labels:f},e);n=Q.onChange(p)}return n}),[e,Q,m,s,d]),_=(0,O.useMemo)((function(){var t="",e=n||i,o=!!(n&&s&&s.includes(n));if(e&&Q.onFocus){var a={focused:e,label:d(e),isDisabled:m(e,s),isSelected:o,options:r,context:e===n?"menu":"value",selectValue:s,isAppleDevice:u};t=Q.onFocus(a)}return t}),[n,i,d,m,Q,r,s,u]),k=(0,O.useMemo)((function(){var t="";if(y&&$.length&&!S&&Q.onFilter){var e=v({count:r.length});t=Q.onFilter({inputValue:f,resultsMessage:e})}return t}),[r,f,y,Q,$,v,S]),T="initial-input-focus"===(null==e?void 0:e.action),C=(0,O.useMemo)((function(){var t="";if(Q.guidance){var e=i?"value":y?"menu":"input";t=Q.guidance({"aria-label":w,context:e,isDisabled:n&&m(n,s),isMulti:p,isSearchable:g,tabSelectsValue:b,isInitialFocus:T})}return t}),[w,n,i,p,m,g,y,Q,s,b,T]),z=Ut(O.Fragment,null,Ut("span",{id:"aria-selection"},P),Ut("span",{id:"aria-focused"},_),Ut("span",{id:"aria-results"},k),Ut("span",{id:"aria-guidance"},C));return Ut(O.Fragment,null,Ut(mn,{id:c},T&&z),Ut(mn,{"aria-live":x,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},o&&!T&&z))},$n=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],vn=new RegExp("["+$n.map((function(t){return t.letters})).join("")+"]","g"),bn={},Sn=0;Sn<$n.length;Sn++)for(var wn=$n[Sn],xn=0;xn1?e-1:0),i=1;i0,p=h-d-u,m=!1;p>e&&s.current&&(i&&i(t),s.current=!1),f&&a.current&&(o&&o(t),a.current=!1),f&&e>p?(n&&!s.current&&n(t),O.scrollTop=h,m=!0,s.current=!0):!f&&-e>u&&(r&&!a.current&&r(t),O.scrollTop=0,m=!0,a.current=!0),m&&function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()}(t)}}),[n,i,r,o]),h=(0,O.useCallback)((function(t){u(t,t.deltaY)}),[u]),d=(0,O.useCallback)((function(t){l.current=t.changedTouches[0].clientY}),[]),f=(0,O.useCallback)((function(t){var e=l.current-t.changedTouches[0].clientY;u(t,e)}),[u]),p=(0,O.useCallback)((function(t){if(t){var e=!!Ae&&{passive:!1};t.addEventListener("wheel",h,e),t.addEventListener("touchstart",d,e),t.addEventListener("touchmove",f,e)}}),[f,d,h]),m=(0,O.useCallback)((function(t){t&&(t.removeEventListener("wheel",h,!1),t.removeEventListener("touchstart",d,!1),t.removeEventListener("touchmove",f,!1))}),[f,d,h]);return(0,O.useEffect)((function(){if(e){var t=c.current;return p(t),function(){m(t)}}}),[e,p,m]),function(t){c.current=t}}({isEnabled:void 0===i||i,onBottomArrive:t.onBottomArrive,onBottomLeave:t.onBottomLeave,onTopArrive:t.onTopArrive,onTopLeave:t.onTopLeave}),o=function(t){var e=t.isEnabled,n=t.accountForScrollbars,i=void 0===n||n,r=(0,O.useRef)({}),o=(0,O.useRef)(null),s=(0,O.useCallback)((function(t){if(Xn){var e=document.body,n=e&&e.style;if(i&&Rn.forEach((function(t){var e=n&&n[t];r.current[t]=e})),i&&qn<1){var o=parseInt(r.current.paddingRight,10)||0,s=document.body?document.body.clientWidth:0,a=window.innerWidth-s+o||0;Object.keys(En).forEach((function(t){var e=En[t];n&&(n[t]=e)})),n&&(n.paddingRight="".concat(a,"px"))}e&&Vn()&&(e.addEventListener("touchmove",An,Wn),t&&(t.addEventListener("touchstart",Mn,Wn),t.addEventListener("touchmove",Zn,Wn))),qn+=1}}),[i]),a=(0,O.useCallback)((function(t){if(Xn){var e=document.body,n=e&&e.style;qn=Math.max(qn-1,0),i&&qn<1&&Rn.forEach((function(t){var e=r.current[t];n&&(n[t]=e)})),e&&Vn()&&(e.removeEventListener("touchmove",An,Wn),t&&(t.removeEventListener("touchstart",Mn,Wn),t.removeEventListener("touchmove",Zn,Wn)))}}),[i]);return(0,O.useEffect)((function(){if(e){var t=o.current;return s(t),function(){a(t)}}}),[e,s,a]),function(t){o.current=t}}({isEnabled:n});return Ut(O.Fragment,null,n&&Ut("div",{onClick:jn,css:In}),e((function(t){r(t),o(t)})))}var Nn={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},Un=function(t){var e=t.name,n=t.onFocus;return Ut("input",{required:!0,name:e,tabIndex:-1,"aria-hidden":"true",onFocus:n,css:Nn,value:"",onChange:function(){}})};function Dn(t){var e;return"undefined"!=typeof window&&null!=window.navigator&&t.test((null===(e=window.navigator.userAgentData)||void 0===e?void 0:e.platform)||window.navigator.platform)}function Yn(){return Dn(/^Mac/i)}var Bn={clearIndicator:nn,container:function(t){var e=t.isDisabled;return{label:"container",direction:t.isRtl?"rtl":void 0,pointerEvents:e?"none":void 0,position:"relative"}},control:function(t,e){var n=t.isDisabled,i=t.isFocused,r=t.theme,o=r.colors,s=r.borderRadius;return a({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:r.spacing.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},e?{}:{backgroundColor:n?o.neutral5:o.neutral0,borderColor:n?o.neutral10:i?o.primary:o.neutral20,borderRadius:s,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(o.primary):void 0,"&:hover":{borderColor:i?o.primary:o.neutral30}})},dropdownIndicator:en,group:function(t,e){var n=t.theme.spacing;return e?{}:{paddingBottom:2*n.baseUnit,paddingTop:2*n.baseUnit}},groupHeading:function(t,e){var n=t.theme,i=n.colors,r=n.spacing;return a({label:"group",cursor:"default",display:"block"},e?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:3*r.baseUnit,paddingRight:3*r.baseUnit,textTransform:"uppercase"})},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(t,e){var n=t.isDisabled,i=t.theme,r=i.spacing.baseUnit,o=i.colors;return a({label:"indicatorSeparator",alignSelf:"stretch",width:1},e?{}:{backgroundColor:n?o.neutral10:o.neutral20,marginBottom:2*r,marginTop:2*r})},input:function(t,e){var n=t.isDisabled,i=t.value,r=t.theme,o=r.spacing,s=r.colors;return a(a({visibility:n?"hidden":"visible",transform:i?"translateZ(0)":""},cn),e?{}:{margin:o.baseUnit/2,paddingBottom:o.baseUnit/2,paddingTop:o.baseUnit/2,color:s.neutral80})},loadingIndicator:function(t,e){var n=t.isFocused,i=t.size,r=t.theme,o=r.colors,s=r.spacing.baseUnit;return a({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},e?{}:{color:n?o.neutral60:o.neutral20,padding:2*s})},loadingMessage:Ye,menu:function(t,e){var n,i=t.placement,r=t.theme,s=r.borderRadius,l=r.spacing,c=r.colors;return a((o(n={label:"menu"},function(t){return t?{bottom:"top",top:"bottom"}[t]:"bottom"}(i),"100%"),o(n,"position","absolute"),o(n,"width","100%"),o(n,"zIndex",1),n),e?{}:{backgroundColor:c.neutral0,borderRadius:s,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:l.menuGutter,marginTop:l.menuGutter})},menuList:function(t,e){var n=t.maxHeight,i=t.theme.spacing.baseUnit;return a({maxHeight:n,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},e?{}:{paddingBottom:i,paddingTop:i})},menuPortal:function(t){var e=t.rect,n=t.offset,i=t.position;return{left:e.left,position:i,top:n,width:e.width,zIndex:1}},multiValue:function(t,e){var n=t.theme,i=n.spacing,r=n.borderRadius,o=n.colors;return a({label:"multiValue",display:"flex",minWidth:0},e?{}:{backgroundColor:o.neutral10,borderRadius:r/2,margin:i.baseUnit/2})},multiValueLabel:function(t,e){var n=t.theme,i=n.borderRadius,r=n.colors,o=t.cropWithEllipsis;return a({overflow:"hidden",textOverflow:o||void 0===o?"ellipsis":void 0,whiteSpace:"nowrap"},e?{}:{borderRadius:i/2,color:r.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},multiValueRemove:function(t,e){var n=t.theme,i=n.spacing,r=n.borderRadius,o=n.colors,s=t.isFocused;return a({alignItems:"center",display:"flex"},e?{}:{borderRadius:r/2,backgroundColor:s?o.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}})},noOptionsMessage:De,option:function(t,e){var n=t.isDisabled,i=t.isFocused,r=t.isSelected,o=t.theme,s=o.spacing,l=o.colors;return a({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},e?{}:{backgroundColor:r?l.primary:i?l.primary25:"transparent",color:n?l.neutral20:r?l.neutral0:"inherit",padding:"".concat(2*s.baseUnit,"px ").concat(3*s.baseUnit,"px"),":active":{backgroundColor:n?void 0:r?l.primary:l.primary50}})},placeholder:function(t,e){var n=t.theme,i=n.spacing,r=n.colors;return a({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},e?{}:{color:r.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},singleValue:function(t,e){var n=t.isDisabled,i=t.theme,r=i.spacing,o=i.colors;return a({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},e?{}:{color:n?o.neutral40:o.neutral80,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},valueContainer:function(t,e){var n=t.theme.spacing,i=t.isMulti,r=t.hasValue,o=t.selectProps.controlShouldRenderValue;return a({alignItems:"center",display:i&&r&&o?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},e?{}:{padding:"".concat(n.baseUnit/2,"px ").concat(2*n.baseUnit,"px")})}},Gn={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},Fn={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Ce(),captureMenuScroll:!Ce(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(t,e){if(t.data.__isNew__)return!0;var n=a({ignoreCase:!0,ignoreAccents:!0,stringify:Tn,trim:!0,matchFrom:"any"},undefined),i=n.ignoreCase,r=n.ignoreAccents,o=n.stringify,s=n.trim,l=n.matchFrom,c=s?kn(e):e,u=s?kn(o(t)):o(t);return i&&(c=c.toLowerCase(),u=u.toLowerCase()),r&&(c=Pn(c),u=Qn(u)),"start"===l?u.substr(0,c.length)===c:u.indexOf(c)>-1},formatGroupLabel:function(t){return t.label},getOptionLabel:function(t){return t.label},getOptionValue:function(t){return t.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:function(t){return!!t.isDisabled},loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(t){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(t){var e=t.count;return"".concat(e," result").concat(1!==e?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function Hn(t,e,n,i){return{type:"option",data:e,isDisabled:oi(t,e,n),isSelected:si(t,e,n),label:ii(t,e),value:ri(t,e),index:i}}function Kn(t,e){return t.options.map((function(n,i){if("options"in n){var r=n.options.map((function(n,i){return Hn(t,n,e,i)})).filter((function(e){return ei(t,e)}));return r.length>0?{type:"group",data:n,options:r,index:i}:void 0}var o=Hn(t,n,e,i);return ei(t,o)?o:void 0})).filter(Ze)}function Jn(t){return t.reduce((function(t,e){return"group"===e.type?t.push.apply(t,v(e.options.map((function(t){return t.data})))):t.push(e.data),t}),[])}function ti(t,e){return t.reduce((function(t,n){return"group"===n.type?t.push.apply(t,v(n.options.map((function(t){return{data:t.data,id:"".concat(e,"-").concat(n.index,"-").concat(t.index)}})))):t.push({data:n.data,id:"".concat(e,"-").concat(n.index)}),t}),[])}function ei(t,e){var n=t.inputValue,i=void 0===n?"":n,r=e.data,o=e.isSelected,s=e.label,a=e.value;return(!li(t)||!o)&&ai(t,{label:s,value:a,data:r},i)}var ni=function(t,e){var n;return(null===(n=t.find((function(t){return t.data===e})))||void 0===n?void 0:n.id)||null},ii=function(t,e){return t.getOptionLabel(e)},ri=function(t,e){return t.getOptionValue(e)};function oi(t,e,n){return"function"==typeof t.isOptionDisabled&&t.isOptionDisabled(e,n)}function si(t,e,n){if(n.indexOf(e)>-1)return!0;if("function"==typeof t.isOptionSelected)return t.isOptionSelected(e,n);var i=ri(t,e);return n.some((function(e){return ri(t,e)===i}))}function ai(t,e,n){return!t.filterOption||t.filterOption(e,n)}var li=function(t){var e=t.hideSelectedOptions,n=t.isMulti;return void 0===e?n:e},ci=1,ui=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&g(t,e)}(n,t);var e=function(t){var e=$();return function(){var n,r=y(t);if(e){var o=y(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(t,e){if(e&&("object"==i(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}(n);function n(t){var i;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),(i=e.call(this,t)).state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},i.blockOptionHover=!1,i.isComposing=!1,i.commonProps=void 0,i.initialTouchX=0,i.initialTouchY=0,i.openAfterFocus=!1,i.scrollToFocusedOptionOnUpdate=!1,i.userIsDragging=void 0,i.isAppleDevice=Yn()||Dn(/^iPhone/i)||Dn(/^iPad/i)||Yn()&&navigator.maxTouchPoints>1,i.controlRef=null,i.getControlRef=function(t){i.controlRef=t},i.focusedOptionRef=null,i.getFocusedOptionRef=function(t){i.focusedOptionRef=t},i.menuListRef=null,i.getMenuListRef=function(t){i.menuListRef=t},i.inputRef=null,i.getInputRef=function(t){i.inputRef=t},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(t,e){var n=i.props,r=n.onChange,o=n.name;e.name=o,i.ariaOnChange(t,e),r(t,e)},i.setValue=function(t,e,n){var r=i.props,o=r.closeMenuOnSelect,s=r.isMulti,a=r.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:a}),o&&(i.setState({inputIsHiddenAfterUpdate:!s}),i.onMenuClose()),i.setState({clearFocusValueOnUpdate:!0}),i.onChange(t,{action:e,option:n})},i.selectOption=function(t){var e=i.props,n=e.blurInputOnSelect,r=e.isMulti,o=e.name,s=i.state.selectValue,a=r&&i.isOptionSelected(t,s),l=i.isOptionDisabled(t,s);if(a){var c=i.getOptionValue(t);i.setValue(s.filter((function(t){return i.getOptionValue(t)!==c})),"deselect-option",t)}else{if(l)return void i.ariaOnChange(t,{action:"select-option",option:t,name:o});r?i.setValue([].concat(v(s),[t]),"select-option",t):i.setValue(t,"select-option")}n&&i.blurInput()},i.removeValue=function(t){var e=i.props.isMulti,n=i.state.selectValue,r=i.getOptionValue(t),o=n.filter((function(t){return i.getOptionValue(t)!==r})),s=Me(e,o,o[0]||null);i.onChange(s,{action:"remove-value",removedValue:t}),i.focusInput()},i.clearValue=function(){var t=i.state.selectValue;i.onChange(Me(i.props.isMulti,[],null),{action:"clear",removedValues:t})},i.popValue=function(){var t=i.props.isMulti,e=i.state.selectValue,n=e[e.length-1],r=e.slice(0,e.length-1),o=Me(t,r,r[0]||null);n&&i.onChange(o,{action:"pop-value",removedValue:n})},i.getFocusedOptionId=function(t){return ni(i.state.focusableOptionsWithIds,t)},i.getFocusableOptionsWithIds=function(){return ti(Kn(i.props,i.state.selectValue),i.getElementId("option"))},i.getValue=function(){return i.state.selectValue},i.cx=function(){for(var t=arguments.length,e=new Array(t),n=0;n5||o>5}},i.onTouchEnd=function(t){i.userIsDragging||(i.controlRef&&!i.controlRef.contains(t.target)&&i.menuListRef&&!i.menuListRef.contains(t.target)&&i.blurInput(),i.initialTouchX=0,i.initialTouchY=0)},i.onControlTouchEnd=function(t){i.userIsDragging||i.onControlMouseDown(t)},i.onClearIndicatorTouchEnd=function(t){i.userIsDragging||i.onClearIndicatorMouseDown(t)},i.onDropdownIndicatorTouchEnd=function(t){i.userIsDragging||i.onDropdownIndicatorMouseDown(t)},i.handleInputChange=function(t){var e=i.props.inputValue,n=t.currentTarget.value;i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange(n,{action:"input-change",prevInputValue:e}),i.props.menuIsOpen||i.onMenuOpen()},i.onInputFocus=function(t){i.props.onFocus&&i.props.onFocus(t),i.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(i.openAfterFocus||i.props.openMenuOnFocus)&&i.openMenu("first"),i.openAfterFocus=!1},i.onInputBlur=function(t){var e=i.props.inputValue;i.menuListRef&&i.menuListRef.contains(document.activeElement)?i.inputRef.focus():(i.props.onBlur&&i.props.onBlur(t),i.onInputChange("",{action:"input-blur",prevInputValue:e}),i.onMenuClose(),i.setState({focusedValue:null,isFocused:!1}))},i.onOptionHover=function(t){if(!i.blockOptionHover&&i.state.focusedOption!==t){var e=i.getFocusableOptions().indexOf(t);i.setState({focusedOption:t,focusedOptionId:e>-1?i.getFocusedOptionId(t):null})}},i.shouldHideSelectedOptions=function(){return li(i.props)},i.onValueInputFocus=function(t){t.preventDefault(),t.stopPropagation(),i.focus()},i.onKeyDown=function(t){var e=i.props,n=e.isMulti,r=e.backspaceRemovesValue,o=e.escapeClearsValue,s=e.inputValue,a=e.isClearable,l=e.isDisabled,c=e.menuIsOpen,u=e.onKeyDown,h=e.tabSelectsValue,d=e.openMenuOnFocus,O=i.state,f=O.focusedOption,p=O.focusedValue,m=O.selectValue;if(!(l||"function"==typeof u&&(u(t),t.defaultPrevented))){switch(i.blockOptionHover=!0,t.key){case"ArrowLeft":if(!n||s)return;i.focusValue("previous");break;case"ArrowRight":if(!n||s)return;i.focusValue("next");break;case"Delete":case"Backspace":if(s)return;if(p)i.removeValue(p);else{if(!r)return;n?i.popValue():a&&i.clearValue()}break;case"Tab":if(i.isComposing)return;if(t.shiftKey||!c||!h||!f||d&&i.isOptionSelected(f,m))return;i.selectOption(f);break;case"Enter":if(229===t.keyCode)break;if(c){if(!f)return;if(i.isComposing)return;i.selectOption(f);break}return;case"Escape":c?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:s}),i.onMenuClose()):a&&o&&i.clearValue();break;case" ":if(s)return;if(!c){i.openMenu("first");break}if(!f)return;i.selectOption(f);break;case"ArrowUp":c?i.focusOption("up"):i.openMenu("last");break;case"ArrowDown":c?i.focusOption("down"):i.openMenu("first");break;case"PageUp":if(!c)return;i.focusOption("pageup");break;case"PageDown":if(!c)return;i.focusOption("pagedown");break;case"Home":if(!c)return;i.focusOption("first");break;case"End":if(!c)return;i.focusOption("last");break;default:return}t.preventDefault()}},i.state.instancePrefix="react-select-"+(i.props.instanceId||++ci),i.state.selectValue=Se(t.value),t.menuIsOpen&&i.state.selectValue.length){var r=i.getFocusableOptionsWithIds(),o=i.buildFocusableOptions(),s=o.indexOf(i.state.selectValue[0]);i.state.focusableOptionsWithIds=r,i.state.focusedOption=o[s],i.state.focusedOptionId=ni(r,o[s])}return i}return function(t,e,n){e&&m(t.prototype,e),n&&m(t,n),Object.defineProperty(t,"prototype",{writable:!1})}(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&Te(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(t){var e=this.props,n=e.isDisabled,i=e.menuIsOpen,r=this.state.isFocused;(r&&!n&&t.isDisabled||r&&i&&!t.menuIsOpen)&&this.focusInput(),r&&n&&!t.isDisabled?this.setState({isFocused:!1},this.onMenuClose):r||n||!t.isDisabled||this.inputRef!==document.activeElement||this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Te(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(t,e){this.props.onInputChange(t,e)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(t){var e=this,n=this.state,i=n.selectValue,r=n.isFocused,o=this.buildFocusableOptions(),s="first"===t?0:o.length-1;if(!this.props.isMulti){var a=o.indexOf(i[0]);a>-1&&(s=a)}this.scrollToFocusedOptionOnUpdate=!(r&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:o[s],focusedOptionId:this.getFocusedOptionId(o[s])},(function(){return e.onMenuOpen()}))}},{key:"focusValue",value:function(t){var e=this.state,n=e.selectValue,i=e.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var r=n.indexOf(i);i||(r=-1);var o=n.length-1,s=-1;if(n.length){switch(t){case"previous":s=0===r?0:-1===r?o:r-1;break;case"next":r>-1&&r0&&void 0!==arguments[0]?arguments[0]:"first",e=this.props.pageSize,n=this.state.focusedOption,i=this.getFocusableOptions();if(i.length){var r=0,o=i.indexOf(n);n||(o=-1),"up"===t?r=o>0?o-1:i.length-1:"down"===t?r=(o+1)%i.length:"pageup"===t?(r=o-e)<0&&(r=0):"pagedown"===t?(r=o+e)>i.length-1&&(r=i.length-1):"last"===t&&(r=i.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:i[r],focusedValue:null,focusedOptionId:this.getFocusedOptionId(i[r])})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(Gn):a(a({},Gn),this.props.theme):Gn}},{key:"getCommonProps",value:function(){var t=this.clearValue,e=this.cx,n=this.getStyles,i=this.getClassNames,r=this.getValue,o=this.selectOption,s=this.setValue,a=this.props,l=a.isMulti,c=a.isRtl,u=a.options;return{clearValue:t,cx:e,getStyles:n,getClassNames:i,getValue:r,hasValue:this.hasValue(),isMulti:l,isRtl:c,options:u,selectOption:o,selectProps:a,setValue:s,theme:this.getTheme()}}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var t=this.props,e=t.isClearable,n=t.isMulti;return void 0===e?n:e}},{key:"isOptionDisabled",value:function(t,e){return oi(this.props,t,e)}},{key:"isOptionSelected",value:function(t,e){return si(this.props,t,e)}},{key:"filterOption",value:function(t,e){return ai(this.props,t,e)}},{key:"formatOptionLabel",value:function(t,e){if("function"==typeof this.props.formatOptionLabel){var n=this.props.inputValue,i=this.state.selectValue;return this.props.formatOptionLabel(t,{context:e,inputValue:n,selectValue:i})}return this.getOptionLabel(t)}},{key:"formatGroupLabel",value:function(t){return this.props.formatGroupLabel(t)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var t=this.props,e=t.isDisabled,n=t.isSearchable,i=t.inputId,r=t.inputValue,o=t.tabIndex,s=t.form,l=t.menuIsOpen,c=t.required,u=this.getComponents().Input,h=this.state,d=h.inputIsHidden,f=h.ariaSelection,m=this.commonProps,g=i||this.getElementId("input"),y=a(a(a({"aria-autocomplete":"list","aria-expanded":l,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":c,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},l&&{"aria-controls":this.getElementId("listbox")}),!n&&{"aria-readonly":!0}),this.hasValue()?"initial-input-focus"===(null==f?void 0:f.action)&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return n?O.createElement(u,(0,p.A)({},m,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:g,innerRef:this.getInputRef,isDisabled:e,isHidden:d,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:o,form:s,type:"text",value:r},y)):O.createElement(zn,(0,p.A)({id:g,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:$e,onFocus:this.onInputFocus,disabled:e,tabIndex:o,inputMode:"none",form:s,value:""},y))}},{key:"renderPlaceholderOrValue",value:function(){var t=this,e=this.getComponents(),n=e.MultiValue,i=e.MultiValueContainer,r=e.MultiValueLabel,o=e.MultiValueRemove,s=e.SingleValue,a=e.Placeholder,l=this.commonProps,c=this.props,u=c.controlShouldRenderValue,h=c.isDisabled,d=c.isMulti,f=c.inputValue,m=c.placeholder,g=this.state,y=g.selectValue,$=g.focusedValue,v=g.isFocused;if(!this.hasValue()||!u)return f?null:O.createElement(a,(0,p.A)({},l,{key:"placeholder",isDisabled:h,isFocused:v,innerProps:{id:this.getElementId("placeholder")}}),m);if(d)return y.map((function(e,s){var a=e===$,c="".concat(t.getOptionLabel(e),"-").concat(t.getOptionValue(e));return O.createElement(n,(0,p.A)({},l,{components:{Container:i,Label:r,Remove:o},isFocused:a,isDisabled:h,key:c,index:s,removeProps:{onClick:function(){return t.removeValue(e)},onTouchEnd:function(){return t.removeValue(e)},onMouseDown:function(t){t.preventDefault()}},data:e}),t.formatOptionLabel(e,"value"))}));if(f)return null;var b=y[0];return O.createElement(s,(0,p.A)({},l,{data:b,isDisabled:h}),this.formatOptionLabel(b,"value"))}},{key:"renderClearIndicator",value:function(){var t=this.getComponents().ClearIndicator,e=this.commonProps,n=this.props,i=n.isDisabled,r=n.isLoading,o=this.state.isFocused;if(!this.isClearable()||!t||i||!this.hasValue()||r)return null;var s={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return O.createElement(t,(0,p.A)({},e,{innerProps:s,isFocused:o}))}},{key:"renderLoadingIndicator",value:function(){var t=this.getComponents().LoadingIndicator,e=this.commonProps,n=this.props,i=n.isDisabled,r=n.isLoading,o=this.state.isFocused;return t&&r?O.createElement(t,(0,p.A)({},e,{innerProps:{"aria-hidden":"true"},isDisabled:i,isFocused:o})):null}},{key:"renderIndicatorSeparator",value:function(){var t=this.getComponents(),e=t.DropdownIndicator,n=t.IndicatorSeparator;if(!e||!n)return null;var i=this.commonProps,r=this.props.isDisabled,o=this.state.isFocused;return O.createElement(n,(0,p.A)({},i,{isDisabled:r,isFocused:o}))}},{key:"renderDropdownIndicator",value:function(){var t=this.getComponents().DropdownIndicator;if(!t)return null;var e=this.commonProps,n=this.props.isDisabled,i=this.state.isFocused,r={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return O.createElement(t,(0,p.A)({},e,{innerProps:r,isDisabled:n,isFocused:i}))}},{key:"renderMenu",value:function(){var t=this,e=this.getComponents(),n=e.Group,i=e.GroupHeading,r=e.Menu,o=e.MenuList,s=e.MenuPortal,a=e.LoadingMessage,l=e.NoOptionsMessage,c=e.Option,u=this.commonProps,h=this.state.focusedOption,d=this.props,f=d.captureMenuScroll,m=d.inputValue,g=d.isLoading,y=d.loadingMessage,$=d.minMenuHeight,v=d.maxMenuHeight,b=d.menuIsOpen,S=d.menuPlacement,w=d.menuPosition,x=d.menuPortalTarget,Q=d.menuShouldBlockScroll,P=d.menuShouldScrollIntoView,_=d.noOptionsMessage,k=d.onMenuScrollToTop,T=d.onMenuScrollToBottom;if(!b)return null;var C,z=function(e,n){var i=e.type,r=e.data,o=e.isDisabled,s=e.isSelected,a=e.label,l=e.value,d=h===r,f=o?void 0:function(){return t.onOptionHover(r)},m=o?void 0:function(){return t.selectOption(r)},g="".concat(t.getElementId("option"),"-").concat(n),y={id:g,onClick:m,onMouseMove:f,onMouseOver:f,tabIndex:-1,role:"option","aria-selected":t.isAppleDevice?void 0:s};return O.createElement(c,(0,p.A)({},u,{innerProps:y,data:r,isDisabled:o,isSelected:s,key:g,label:a,type:i,value:l,isFocused:d,innerRef:d?t.getFocusedOptionRef:void 0}),t.formatOptionLabel(e.data,"menu"))};if(this.hasOptions())C=this.getCategorizedOptions().map((function(e){if("group"===e.type){var r=e.data,o=e.options,s=e.index,a="".concat(t.getElementId("group"),"-").concat(s),l="".concat(a,"-heading");return O.createElement(n,(0,p.A)({},u,{key:a,data:r,options:o,Heading:i,headingProps:{id:l,data:e.data},label:t.formatGroupLabel(e.data)}),e.options.map((function(t){return z(t,"".concat(s,"-").concat(t.index))})))}if("option"===e.type)return z(e,"".concat(e.index))}));else if(g){var R=y({inputValue:m});if(null===R)return null;C=O.createElement(a,u,R)}else{var E=_({inputValue:m});if(null===E)return null;C=O.createElement(l,u,E)}var A={minMenuHeight:$,maxMenuHeight:v,menuPlacement:S,menuPosition:w,menuShouldScrollIntoView:P},Z=O.createElement(Ne,(0,p.A)({},u,A),(function(e){var n=e.ref,i=e.placerProps,s=i.placement,a=i.maxHeight;return O.createElement(r,(0,p.A)({},u,A,{innerRef:n,innerProps:{onMouseDown:t.onMenuMouseDown,onMouseMove:t.onMenuMouseMove},isLoading:g,placement:s}),O.createElement(Ln,{captureEnabled:f,onTopArrive:k,onBottomArrive:T,lockEnabled:Q},(function(e){return O.createElement(o,(0,p.A)({},u,{innerRef:function(n){t.getMenuListRef(n),e(n)},innerProps:{role:"listbox","aria-multiselectable":u.isMulti,id:t.getElementId("listbox")},isLoading:g,maxHeight:a,focusedOption:h}),C)})))}));return x||"fixed"===w?O.createElement(s,(0,p.A)({},u,{appendTo:x,controlElement:this.controlRef,menuPlacement:S,menuPosition:w}),Z):Z}},{key:"renderFormField",value:function(){var t=this,e=this.props,n=e.delimiter,i=e.isDisabled,r=e.isMulti,o=e.name,s=e.required,a=this.state.selectValue;if(s&&!this.hasValue()&&!i)return O.createElement(Un,{name:o,onFocus:this.onValueInputFocus});if(o&&!i){if(r){if(n){var l=a.map((function(e){return t.getOptionValue(e)})).join(n);return O.createElement("input",{name:o,type:"hidden",value:l})}var c=a.length>0?a.map((function(e,n){return O.createElement("input",{key:"i-".concat(n),name:o,type:"hidden",value:t.getOptionValue(e)})})):O.createElement("input",{name:o,type:"hidden",value:""});return O.createElement("div",null,c)}var u=a[0]?this.getOptionValue(a[0]):"";return O.createElement("input",{name:o,type:"hidden",value:u})}}},{key:"renderLiveRegion",value:function(){var t=this.commonProps,e=this.state,n=e.ariaSelection,i=e.focusedOption,r=e.focusedValue,o=e.isFocused,s=e.selectValue,a=this.getFocusableOptions();return O.createElement(yn,(0,p.A)({},t,{id:this.getElementId("live-region"),ariaSelection:n,focusedOption:i,focusedValue:r,isFocused:o,selectValue:s,focusableOptions:a,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var t=this.getComponents(),e=t.Control,n=t.IndicatorsContainer,i=t.SelectContainer,r=t.ValueContainer,o=this.props,s=o.className,a=o.id,l=o.isDisabled,c=o.menuIsOpen,u=this.state.isFocused,h=this.commonProps=this.getCommonProps();return O.createElement(i,(0,p.A)({},h,{className:s,innerProps:{id:a,onKeyDown:this.onKeyDown},isDisabled:l,isFocused:u}),this.renderLiveRegion(),O.createElement(e,(0,p.A)({},h,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:l,isFocused:u,menuIsOpen:c}),O.createElement(r,(0,p.A)({},h,{isDisabled:l}),this.renderPlaceholderOrValue(),this.renderInput()),O.createElement(n,(0,p.A)({},h,{isDisabled:l}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(t,e){var n=e.prevProps,i=e.clearFocusValueOnUpdate,r=e.inputIsHiddenAfterUpdate,o=e.ariaSelection,s=e.isFocused,l=e.prevWasFocused,c=e.instancePrefix,u=t.options,h=t.value,d=t.menuIsOpen,O=t.inputValue,f=t.isMulti,p=Se(h),m={};if(n&&(h!==n.value||u!==n.options||d!==n.menuIsOpen||O!==n.inputValue)){var g=d?function(t,e){return Jn(Kn(t,e))}(t,p):[],y=d?ti(Kn(t,p),"".concat(c,"-option")):[],$=i?function(t,e){var n=t.focusedValue,i=t.selectValue.indexOf(n);if(i>-1){if(e.indexOf(n)>-1)return n;if(i-1?n:e[0]}(e,g);m={selectValue:p,focusedOption:v,focusedOptionId:ni(y,v),focusableOptionsWithIds:y,focusedValue:$,clearFocusValueOnUpdate:!1}}var b=null!=r&&t!==n?{inputIsHidden:r,inputIsHiddenAfterUpdate:void 0}:{},S=o,w=s&&l;return s&&!w&&(S={value:Me(f,p,p[0]||null),options:p,action:"initial-input-focus"},w=!l),"initial-input-focus"===(null==o?void 0:o.action)&&(S=null),a(a(a({},m),b),{},{prevProps:t,ariaSelection:S,prevWasFocused:w})}}]),n}(O.Component);ui.defaultProps=Fn;var hi=(0,O.forwardRef)((function(t,e){var n=function(t){var e=t.defaultInputValue,n=void 0===e?"":e,i=t.defaultMenuIsOpen,r=void 0!==i&&i,o=t.defaultValue,s=void 0===o?null:o,l=t.inputValue,c=t.menuIsOpen,h=t.onChange,p=t.onInputChange,m=t.onMenuClose,g=t.onMenuOpen,y=t.value,$=d(t,f),v=u((0,O.useState)(void 0!==l?l:n),2),b=v[0],S=v[1],w=u((0,O.useState)(void 0!==c?c:r),2),x=w[0],Q=w[1],P=u((0,O.useState)(void 0!==y?y:s),2),_=P[0],k=P[1],T=(0,O.useCallback)((function(t,e){"function"==typeof h&&h(t,e),k(t)}),[h]),C=(0,O.useCallback)((function(t,e){var n;"function"==typeof p&&(n=p(t,e)),S(void 0!==n?n:t)}),[p]),z=(0,O.useCallback)((function(){"function"==typeof g&&g(),Q(!0)}),[g]),R=(0,O.useCallback)((function(){"function"==typeof m&&m(),Q(!1)}),[m]),E=void 0!==l?l:b,A=void 0!==c?c:x,Z=void 0!==y?y:_;return a(a({},$),{},{inputValue:E,menuIsOpen:A,onChange:T,onInputChange:C,onMenuClose:R,onMenuOpen:z,value:Z})}(t);return O.createElement(ui,(0,p.A)({ref:e},n))})),di=hi},1020:(t,e,n)=>{"use strict";var i=n(1609),r=Symbol.for("react.element"),o=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),s=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function l(t,e,n){var i,l={},c=null,u=null;for(i in void 0!==n&&(c=""+n),void 0!==e.key&&(c=""+e.key),void 0!==e.ref&&(u=e.ref),e)o.call(e,i)&&!a.hasOwnProperty(i)&&(l[i]=e[i]);if(t&&t.defaultProps)for(i in e=t.defaultProps)void 0===l[i]&&(l[i]=e[i]);return{$$typeof:r,type:t,key:c,ref:u,props:l,_owner:s.current}}e.jsx=l,e.jsxs=l},4848:(t,e,n)=>{"use strict";t.exports=n(1020)},5229:function(t,e,n){"use strict";var i=(this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}})(n(1133)),r=n(8917);function o(t,e){var n={};return t&&"string"==typeof t?((0,i.default)(t,(function(t,i){t&&i&&(n[(0,r.camelCase)(t,e)]=i)})),n):n}o.default=o,t.exports=o},8917:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,i=/-([a-z])/g,r=/^[^-]+$/,o=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,a=function(t,e){return e.toUpperCase()},l=function(t,e){return"".concat(e,"-")};e.camelCase=function(t,e){return void 0===e&&(e={}),function(t){return!t||r.test(t)||n.test(t)}(t)?t:(t=t.toLowerCase(),(t=e.reactCompat?t.replace(s,l):t.replace(o,l)).replace(i,a))}},1133:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){let n=null;if(!t||"string"!=typeof t)return n;const i=(0,r.default)(t),o="function"==typeof e;return i.forEach((t=>{if("declaration"!==t.type)return;const{property:i,value:r}=t;o?e(i,r,t):r&&(n=n||{},n[i]=r)})),n};const r=i(n(5077))},3829:(t,e,n)=>{"use strict";n.d(e,{A:()=>c});const i={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};var r,o=new Uint8Array(16);function s(){if(!r&&!(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(o)}for(var a=[],l=0;l<256;++l)a.push((l+256).toString(16).slice(1));const c=function(t,e,n){if(i.randomUUID&&!e&&!t)return i.randomUUID();var r=(t=t||{}).random||(t.rng||s)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){n=n||0;for(var o=0;o<16;++o)e[n+o]=r[o];return e}return function(t,e=0){return(a[t[e+0]]+a[t[e+1]]+a[t[e+2]]+a[t[e+3]]+"-"+a[t[e+4]]+a[t[e+5]]+"-"+a[t[e+6]]+a[t[e+7]]+"-"+a[t[e+8]]+a[t[e+9]]+"-"+a[t[e+10]]+a[t[e+11]]+a[t[e+12]]+a[t[e+13]]+a[t[e+14]]+a[t[e+15]]).toLowerCase()}(r)}},1609:t=>{"use strict";t.exports=window.React},5795:t=>{"use strict";t.exports=window.ReactDOM},4715:t=>{"use strict";t.exports=window.wp.blockEditor},6427:t=>{"use strict";t.exports=window.wp.components},7143:t=>{"use strict";t.exports=window.wp.data},6087:t=>{"use strict";t.exports=window.wp.element},2619:t=>{"use strict";t.exports=window.wp.hooks},7723:t=>{"use strict";t.exports=window.wp.i18n},5573:t=>{"use strict";t.exports=window.wp.primitives},6942:(t,e)=>{var n;!function(){"use strict";var i={}.hasOwnProperty;function r(){for(var t="",e=0;e{"use strict";function i(){return i=Object.assign?Object.assign.bind():function(t){for(var e=1;ei})},8587:(t,e,n)=>{"use strict";function i(t,e){if(null==t)return{};var n={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(e.includes(i))continue;n[i]=t[i]}return n}n.d(e,{A:()=>i})},9658:(t,e,n)=>{"use strict";n.d(e,{m:()=>o});var i=n(6500),r=n(4880),o=new class extends i.Q{#X;#q;#W;constructor(){super(),this.#W=t=>{if(!r.S$&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#q||this.setEventListener(this.#W)}onUnsubscribe(){this.hasListeners()||(this.#q?.(),this.#q=void 0)}setEventListener(t){this.#W=t,this.#q?.(),this.#q=t((t=>{"boolean"==typeof t?this.setFocused(t):this.onFocus()}))}setFocused(t){this.#X!==t&&(this.#X=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach((e=>{e(t)}))}isFocused(){return"boolean"==typeof this.#X?this.#X:"hidden"!==globalThis.document?.visibilityState}}},6158:(t,e,n)=>{"use strict";n.d(e,{$:()=>a,s:()=>s});var i=n(6261),r=n(1692),o=n(8904),s=class extends r.k{#j;#r;#I;constructor(t){super(),this.mutationId=t.mutationId,this.#r=t.mutationCache,this.#j=[],this.state=t.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#j.includes(t)||(this.#j.push(t),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#j=this.#j.filter((e=>e!==t)),this.scheduleGc(),this.#r.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#j.length||("pending"===this.state.status?this.scheduleGc():this.#r.remove(this))}continue(){return this.#I?.continue()??this.execute(this.state.variables)}async execute(t){this.#I=(0,o.II)({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(t,e)=>{this.#L({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#L({type:"pause"})},onContinue:()=>{this.#L({type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#r.canRun(this)});const e="pending"===this.state.status,n=!this.#I.canStart();try{if(!e){this.#L({type:"pending",variables:t,isPaused:n}),await(this.#r.config.onMutate?.(t,this));const e=await(this.options.onMutate?.(t));e!==this.state.context&&this.#L({type:"pending",context:e,variables:t,isPaused:n})}const i=await this.#I.start();return await(this.#r.config.onSuccess?.(i,t,this.state.context,this)),await(this.options.onSuccess?.(i,t,this.state.context)),await(this.#r.config.onSettled?.(i,null,this.state.variables,this.state.context,this)),await(this.options.onSettled?.(i,null,t,this.state.context)),this.#L({type:"success",data:i}),i}catch(e){try{throw await(this.#r.config.onError?.(e,t,this.state.context,this)),await(this.options.onError?.(e,t,this.state.context)),await(this.#r.config.onSettled?.(void 0,e,this.state.variables,this.state.context,this)),await(this.options.onSettled?.(void 0,e,t,this.state.context)),e}finally{this.#L({type:"error",error:e})}}finally{this.#r.runNext(this)}}#L(t){this.state=(e=>{switch(t.type){case"failed":return{...e,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...e,isPaused:!0};case"continue":return{...e,isPaused:!1};case"pending":return{...e,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...e,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...e,data:void 0,error:t.error,failureCount:e.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}})(this.state),i.j.batch((()=>{this.#j.forEach((e=>{e.onMutationUpdate(t)})),this.#r.notify({mutation:this,type:"updated",action:t})}))}};function a(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},6261:(t,e,n)=>{"use strict";n.d(e,{j:()=>i});var i=function(){let t=[],e=0,n=t=>{t()},i=t=>{t()},r=t=>setTimeout(t,0);const o=i=>{e?t.push(i):r((()=>{n(i)}))};return{batch:o=>{let s;e++;try{s=o()}finally{e--,e||(()=>{const e=t;t=[],e.length&&r((()=>{i((()=>{e.forEach((t=>{n(t)}))}))}))})()}return s},batchCalls:t=>(...e)=>{o((()=>{t(...e)}))},schedule:o,setNotifyFunction:t=>{n=t},setBatchNotifyFunction:t=>{i=t},setScheduler:t=>{r=t}}}()},6035:(t,e,n)=>{"use strict";n.d(e,{t:()=>o});var i=n(6500),r=n(4880),o=new class extends i.Q{#N=!0;#q;#W;constructor(){super(),this.#W=t=>{if(!r.S$&&window.addEventListener){const e=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#q||this.setEventListener(this.#W)}onUnsubscribe(){this.hasListeners()||(this.#q?.(),this.#q=void 0)}setEventListener(t){this.#W=t,this.#q?.(),this.#q=t(this.setOnline.bind(this))}setOnline(t){this.#N!==t&&(this.#N=t,this.listeners.forEach((e=>{e(t)})))}isOnline(){return this.#N}}},9757:(t,e,n)=>{"use strict";n.d(e,{X:()=>a,k:()=>l});var i=n(4880),r=n(6261),o=n(8904),s=n(1692),a=class extends s.k{#U;#D;#Y;#I;#o;#B;constructor(t){super(),this.#B=!1,this.#o=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#Y=t.cache,this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#U=function(t){const e="function"==typeof t.initialData?t.initialData():t.initialData,n=void 0!==e,i=n?"function"==typeof t.initialDataUpdatedAt?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}(this.options),this.state=t.state??this.#U,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#I?.promise}setOptions(t){this.options={...this.#o,...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#Y.remove(this)}setData(t,e){const n=(0,i.pl)(this.state.data,t,this.options);return this.#L({data:n,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),n}setState(t,e){this.#L({type:"setState",state:t,setStateOptions:e})}cancel(t){const e=this.#I?.promise;return this.#I?.cancel(t),e?e.then(i.lQ).catch(i.lQ):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#U)}isActive(){return this.observers.some((t=>!1!==(0,i.Eh)(t.options.enabled,this)))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===i.hT||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return!!this.state.isInvalidated||(this.getObserversCount()>0?this.observers.some((t=>t.getCurrentResult().isStale)):void 0===this.state.data)}isStaleByTime(t=0){return this.state.isInvalidated||void 0===this.state.data||!(0,i.j3)(this.state.dataUpdatedAt,t)}onFocus(){const t=this.observers.find((t=>t.shouldFetchOnWindowFocus()));t?.refetch({cancelRefetch:!1}),this.#I?.continue()}onOnline(){const t=this.observers.find((t=>t.shouldFetchOnReconnect()));t?.refetch({cancelRefetch:!1}),this.#I?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#Y.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter((e=>e!==t)),this.observers.length||(this.#I&&(this.#B?this.#I.cancel({revert:!0}):this.#I.cancelRetry()),this.scheduleGc()),this.#Y.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#L({type:"invalidate"})}fetch(t,e){if("idle"!==this.state.fetchStatus)if(void 0!==this.state.data&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#I)return this.#I.continueRetry(),this.#I.promise;if(t&&this.setOptions(t),!this.options.queryFn){const t=this.observers.find((t=>t.options.queryFn));t&&this.setOptions(t.options)}const n=new AbortController,r=t=>{Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(this.#B=!0,n.signal)})},s={fetchOptions:e,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:()=>{const t=(0,i.ZM)(this.options,e),n={queryKey:this.queryKey,meta:this.meta};return r(n),this.#B=!1,this.options.persister?this.options.persister(t,n,this):t(n)}};r(s),this.options.behavior?.onFetch(s,this),this.#D=this.state,"idle"!==this.state.fetchStatus&&this.state.fetchMeta===s.fetchOptions?.meta||this.#L({type:"fetch",meta:s.fetchOptions?.meta});const a=t=>{(0,o.wm)(t)&&t.silent||this.#L({type:"error",error:t}),(0,o.wm)(t)||(this.#Y.config.onError?.(t,this),this.#Y.config.onSettled?.(this.state.data,t,this)),this.scheduleGc()};return this.#I=(0,o.II)({initialPromise:e?.initialPromise,fn:s.fetchFn,abort:n.abort.bind(n),onSuccess:t=>{if(void 0!==t){try{this.setData(t)}catch(t){return void a(t)}this.#Y.config.onSuccess?.(t,this),this.#Y.config.onSettled?.(t,this.state.error,this),this.scheduleGc()}else a(new Error(`${this.queryHash} data is undefined`))},onError:a,onFail:(t,e)=>{this.#L({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#L({type:"pause"})},onContinue:()=>{this.#L({type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0}),this.#I.start()}#L(t){this.state=(e=>{switch(t.type){case"failed":return{...e,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...e,fetchStatus:"paused"};case"continue":return{...e,fetchStatus:"fetching"};case"fetch":return{...e,...l(e.data,this.options),fetchMeta:t.meta??null};case"success":return{...e,data:t.data,dataUpdateCount:e.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const n=t.error;return(0,o.wm)(n)&&n.revert&&this.#D?{...this.#D,fetchStatus:"idle"}:{...e,error:n,errorUpdateCount:e.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:e.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error"};case"invalidate":return{...e,isInvalidated:!0};case"setState":return{...e,...t.state}}})(this.state),r.j.batch((()=>{this.observers.forEach((t=>{t.onQueryUpdate()})),this.#Y.notify({query:this,type:"updated",action:t})}))}};function l(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:(0,o.v_)(e.networkMode)?"fetching":"paused",...void 0===t&&{error:null,status:"pending"}}}},1692:(t,e,n)=>{"use strict";n.d(e,{k:()=>r});var i=n(4880),r=class{#G;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,i.gn)(this.gcTime)&&(this.#G=setTimeout((()=>{this.optionalRemove()}),this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(i.S$?1/0:3e5))}clearGcTimeout(){this.#G&&(clearTimeout(this.#G),this.#G=void 0)}}},8904:(t,e,n)=>{"use strict";n.d(e,{II:()=>h,v_:()=>l,wm:()=>u});var i=n(9658),r=n(6035),o=n(4658),s=n(4880);function a(t){return Math.min(1e3*2**t,3e4)}function l(t){return"online"!==(t??"online")||r.t.isOnline()}var c=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function u(t){return t instanceof c}function h(t){let e,n=!1,u=0,h=!1;const d=(0,o.T)(),O=()=>i.m.isFocused()&&("always"===t.networkMode||r.t.isOnline())&&t.canRun(),f=()=>l(t.networkMode)&&t.canRun(),p=n=>{h||(h=!0,t.onSuccess?.(n),e?.(),d.resolve(n))},m=n=>{h||(h=!0,t.onError?.(n),e?.(),d.reject(n))},g=()=>new Promise((n=>{e=t=>{(h||O())&&n(t)},t.onPause?.()})).then((()=>{e=void 0,h||t.onContinue?.()})),y=()=>{if(h)return;let e;const i=0===u?t.initialPromise:void 0;try{e=i??t.fn()}catch(t){e=Promise.reject(t)}Promise.resolve(e).then(p).catch((e=>{if(h)return;const i=t.retry??(s.S$?0:3),r=t.retryDelay??a,o="function"==typeof r?r(u,e):r,l=!0===i||"number"==typeof i&&uO()?void 0:g())).then((()=>{n?m(e):y()}))):m(e)}))};return{promise:d,cancel:e=>{h||(m(new c(e)),t.abort?.())},continue:()=>(e?.(),d),cancelRetry:()=>{n=!0},continueRetry:()=>{n=!1},canStart:f,start:()=>(f()?y():g().then(y),d)}}},6500:(t,e,n)=>{"use strict";n.d(e,{Q:()=>i});var i=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}},4658:(t,e,n)=>{"use strict";function i(){let t,e;const n=new Promise(((n,i)=>{t=n,e=i}));function i(t){Object.assign(n,t),delete n.resolve,delete n.reject}return n.status="pending",n.catch((()=>{})),n.resolve=e=>{i({status:"fulfilled",value:e}),t(e)},n.reject=t=>{i({status:"rejected",reason:t}),e(t)},n}n.d(e,{T:()=>i})},4880:(t,e,n)=>{"use strict";n.d(e,{Cp:()=>f,EN:()=>O,Eh:()=>c,F$:()=>d,MK:()=>u,S$:()=>i,ZM:()=>Q,ZZ:()=>w,Zw:()=>o,d2:()=>l,f8:()=>m,gn:()=>s,hT:()=>x,j3:()=>a,lQ:()=>r,nJ:()=>h,pl:()=>b,y9:()=>S,yy:()=>v});var i="undefined"==typeof window||"Deno"in globalThis;function r(){}function o(t,e){return"function"==typeof t?t(e):t}function s(t){return"number"==typeof t&&t>=0&&t!==1/0}function a(t,e){return Math.max(t+(e||0)-Date.now(),0)}function l(t,e){return"function"==typeof t?t(e):t}function c(t,e){return"function"==typeof t?t(e):t}function u(t,e){const{type:n="all",exact:i,fetchStatus:r,predicate:o,queryKey:s,stale:a}=t;if(s)if(i){if(e.queryHash!==d(s,e.options))return!1}else if(!f(e.queryKey,s))return!1;if("all"!==n){const t=e.isActive();if("active"===n&&!t)return!1;if("inactive"===n&&t)return!1}return!("boolean"==typeof a&&e.isStale()!==a||r&&r!==e.state.fetchStatus||o&&!o(e))}function h(t,e){const{exact:n,status:i,predicate:r,mutationKey:o}=t;if(o){if(!e.options.mutationKey)return!1;if(n){if(O(e.options.mutationKey)!==O(o))return!1}else if(!f(e.options.mutationKey,o))return!1}return!(i&&e.state.status!==i||r&&!r(e))}function d(t,e){return(e?.queryKeyHashFn||O)(t)}function O(t){return JSON.stringify(t,((t,e)=>y(e)?Object.keys(e).sort().reduce(((t,n)=>(t[n]=e[n],t)),{}):e))}function f(t,e){return t===e||typeof t==typeof e&&!(!t||!e||"object"!=typeof t||"object"!=typeof e)&&!Object.keys(e).some((n=>!f(t[n],e[n])))}function p(t,e){if(t===e)return t;const n=g(t)&&g(e);if(n||y(t)&&y(e)){const i=n?t:Object.keys(t),r=i.length,o=n?e:Object.keys(e),s=o.length,a=n?[]:{};let l=0;for(let r=0;r{setTimeout(e,t)}))}function b(t,e,n){return"function"==typeof n.structuralSharing?n.structuralSharing(t,e):!1!==n.structuralSharing?p(t,e):e}function S(t,e,n=0){const i=[...t,e];return n&&i.length>n?i.slice(1):i}function w(t,e,n=0){const i=[e,...t];return n&&i.length>n?i.slice(0,-1):i}var x=Symbol();function Q(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:t.queryFn&&t.queryFn!==x?t.queryFn:()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`))}},46:(t,e,n)=>{"use strict";n.d(e,{Ht:()=>a,jE:()=>s});var i=n(1609),r=n(4848),o=i.createContext(void 0),s=t=>{const e=i.useContext(o);if(t)return t;if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},a=({client:t,children:e})=>(i.useEffect((()=>(t.mount(),()=>{t.unmount()})),[t]),(0,r.jsx)(o.Provider,{value:t,children:e}))},5480:(t,e,n)=>{"use strict";n.d(e,{d7:()=>r});var i=n(1609);function r(t,e){const[n,r]=i.useState(t);return i.useEffect((()=>{const n=setTimeout((()=>{r(t)}),e);return()=>{clearTimeout(n)}}),[t,e]),n}},4164:(t,e,n)=>{"use strict";function i(t){var e,n,r="";if("string"==typeof t||"number"==typeof t)r+=t;else if("object"==typeof t)if(Array.isArray(t)){var o=t.length;for(e=0;er});const r=function(){for(var t,e,n=0,r="",o=arguments.length;n{if(!n){var s=1/0;for(u=0;u=o)&&Object.keys(i.O).every((t=>i.O[t](n[l])))?n.splice(l--,1):(a=!1,o0&&t[u-1][2]>o;u--)t[u]=t[u-1];t[u]=[n,r,o]},i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t={546:0,409:0};i.O.j=e=>0===t[e];var e=(e,n)=>{var r,o,[s,a,l]=n,c=0;if(s.some((e=>0!==t[e]))){for(r in a)i.o(a,r)&&(i.m[r]=a[r]);if(l)var u=l(i)}for(e&&e(n);ci(4006)));r=i.O(r)})(); \ No newline at end of file diff --git a/composer.lock b/composer.lock index c9144e65..cb75111a 100644 --- a/composer.lock +++ b/composer.lock @@ -297,27 +297,27 @@ }, { "name": "phpcsstandards/phpcsextra", - "version": "1.4.2", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHPCSExtra.git", - "reference": "8e89a01c7b8fed84a12a2a7f5a23a44cdbe4f62e" + "reference": "b598aa890815b8df16363271b659d73280129101" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/8e89a01c7b8fed84a12a2a7f5a23a44cdbe4f62e", - "reference": "8e89a01c7b8fed84a12a2a7f5a23a44cdbe4f62e", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/b598aa890815b8df16363271b659d73280129101", + "reference": "b598aa890815b8df16363271b659d73280129101", "shasum": "" }, "require": { "php": ">=5.4", - "phpcsstandards/phpcsutils": "^1.1.2", - "squizlabs/php_codesniffer": "^3.13.4 || ^4.0" + "phpcsstandards/phpcsutils": "^1.2.0", + "squizlabs/php_codesniffer": "^3.13.5 || ^4.0.1" }, "require-dev": { "php-parallel-lint/php-console-highlighter": "^1.0", "php-parallel-lint/php-parallel-lint": "^1.4.0", - "phpcsstandards/phpcsdevcs": "^1.1.6", + "phpcsstandards/phpcsdevcs": "^1.2.0", "phpcsstandards/phpcsdevtools": "^1.2.1", "phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" }, @@ -375,20 +375,20 @@ "type": "thanks_dev" } ], - "time": "2025-10-28T17:00:02+00:00" + "time": "2025-11-12T23:06:57+00:00" }, { "name": "phpcsstandards/phpcsutils", - "version": "1.2.0", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHPCSUtils.git", - "reference": "fa82d14ad1c1713224a52c66c78478145fe454ba" + "reference": "c216317e96c8b3f5932808f9b0f1f7a14e3bbf55" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/fa82d14ad1c1713224a52c66c78478145fe454ba", - "reference": "fa82d14ad1c1713224a52c66c78478145fe454ba", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/c216317e96c8b3f5932808f9b0f1f7a14e3bbf55", + "reference": "c216317e96c8b3f5932808f9b0f1f7a14e3bbf55", "shasum": "" }, "require": { @@ -468,7 +468,7 @@ "type": "thanks_dev" } ], - "time": "2025-11-11T00:17:56+00:00" + "time": "2025-12-08T14:27:58+00:00" }, { "name": "squizlabs/php_codesniffer", @@ -551,16 +551,16 @@ }, { "name": "wp-coding-standards/wpcs", - "version": "3.2.0", + "version": "3.3.0", "source": { "type": "git", "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", - "reference": "d2421de7cec3274ae622c22c744de9a62c7925af" + "reference": "7795ec6fa05663d716a549d0b44e47ffc8b0d4a6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/d2421de7cec3274ae622c22c744de9a62c7925af", - "reference": "d2421de7cec3274ae622c22c744de9a62c7925af", + "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/7795ec6fa05663d716a549d0b44e47ffc8b0d4a6", + "reference": "7795ec6fa05663d716a549d0b44e47ffc8b0d4a6", "shasum": "" }, "require": { @@ -568,17 +568,17 @@ "ext-libxml": "*", "ext-tokenizer": "*", "ext-xmlreader": "*", - "php": ">=5.4", - "phpcsstandards/phpcsextra": "^1.4.0", + "php": ">=7.2", + "phpcsstandards/phpcsextra": "^1.5.0", "phpcsstandards/phpcsutils": "^1.1.0", - "squizlabs/php_codesniffer": "^3.13.0" + "squizlabs/php_codesniffer": "^3.13.4" }, "require-dev": { "php-parallel-lint/php-console-highlighter": "^1.0.0", "php-parallel-lint/php-parallel-lint": "^1.4.0", - "phpcompatibility/php-compatibility": "^9.0", + "phpcompatibility/php-compatibility": "^10.0.0@dev", "phpcsstandards/phpcsdevtools": "^1.2.0", - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^8.0 || ^9.0" }, "suggest": { "ext-iconv": "For improved results", @@ -613,7 +613,7 @@ "type": "custom" } ], - "time": "2025-07-24T20:08:31+00:00" + "time": "2025-11-25T12:08:04+00:00" } ], "aliases": [], diff --git a/docs/features/extending.md b/docs/features/extending.md index b169f8a4..948fdd33 100644 --- a/docs/features/extending.md +++ b/docs/features/extending.md @@ -80,12 +80,14 @@ export function MyCustomField({ attributes = {}, className, disabled = false, - allValues = {}, + fieldPath, + allValues = {}, + getValue, }) { const handleChange = useCallback(event => onChange(event.target.value), [onChange]); - + return ( -
{/* Your field implementation */} @@ -102,6 +104,28 @@ export function MyCustomField({ } ``` +### Available Component Props + +Every field component receives the following props: + +- `id` _(string)_ — The field's unique identifier. +- `htmlId` _(string)_ — The HTML `id` attribute for the input element. +- `onChange` _(function)_ — Callback to update the field's value. +- `value` — The current field value. +- `attributes` _(object)_ — Additional HTML attributes from the field definition. +- `className` _(string)_ — Additional CSS class name. +- `disabled` _(boolean)_ — Whether the field is disabled. +- `fieldPath` _(string)_ — The current field's path in the form hierarchy. It identifies the field's position, which is especially useful for nested fields in groups or repeaters. The path uses dot notation (e.g., `parent_group.child_field`) and array indices for repeater items (e.g., `multi_group[0].field_name`). This property is used internally for relative path resolution and accessing sibling/parent field values. +- `allValues` _(object)_ — An object containing all current form field values, where keys are field IDs. This allows field components to access any other field's value in the form. +- `getValue` _(function)_ — A helper function to access other field values using path syntax. The function signature is `getValue(path: string): any`. The path syntax supports: + - Dot notation for nested fields: `parent.child` + - Relative references using hash: `#` (parent), `##` (grandparent) + - Array bracket notation: `multi_field[0]` + - Combinations: `#.sibling_field[0].name` +- `setTitle` _(function)_ — A callback prop `(title: string) => void` that lets a field report its human-readable title or summary to a parent container. This is used by `MultiGroup` to display collapsed row headers based on the field's current value. It is not configurable from PHP — it is an internal React prop passed by parent components. Use the `useFieldTitle(setTitle, titleValue)` helper hook from `@/helpers/hooks` to call `setTitle` reactively whenever the field's display value changes. + +The `fieldPath`, `allValues`, and `getValue` props are useful for building fields that depend on other field values, such as dependent dropdowns or dynamically computed values. + ### 2. Validation Method Add a validation method to your component: diff --git a/docs/features/field-factory.md b/docs/features/field-factory.md new file mode 100644 index 00000000..ffc1bad9 --- /dev/null +++ b/docs/features/field-factory.md @@ -0,0 +1,294 @@ +# Field Factory + +The Field Factory provides a fluent, IDE-friendly PHP API for building field definition arrays. Instead of writing associative arrays by hand, you can use named parameters with full autocomplete and type checking in your IDE. + +## Overview + +The Field Factory is a stateless helper that exposes one method per field type. Each method returns a plain array that is fully compatible with the existing `items` structure. You can mix Field Factory calls with hand-written arrays freely. + +## Getting Started + +Access the Field Factory via the `field_factory` property on the main `CustomFields` instance: + +```php +$custom_fields = new \Wpify\CustomFields\CustomFields(); +$f = $custom_fields->field_factory; +``` + +Or using the helper function: + +```php +$f = wpify_custom_fields()->field_factory; +``` + +## Common Parameters + +Every field method accepts these common parameters in addition to its type-specific ones: + +| Parameter | Type | Description | +|---|---|---| +| `label` | `string\|null` | Field label displayed in the admin interface | +| `description` | `string\|null` | Help text displayed below the field | +| `required` | `bool\|null` | Whether the field must have a value | +| `default` | `mixed` | Default value for the field | +| `disabled` | `bool\|null` | Whether the field is disabled | +| `tab` | `string\|null` | Tab identifier for organizing fields | +| `class_name` | `string\|null` | CSS class name (mapped to `className` in output) | +| `conditions` | `array\|null` | Conditional display rules | +| `attributes` | `array\|null` | HTML attributes for the field element | +| `unfiltered` | `bool\|null` | Whether to skip sanitization | +| `render_options` | `array\|null` | Options for customizing field rendering | +| `generator` | `string\|null` | Generator identifier (e.g. `'uuid'`) | + +Parameters set to `null` are omitted from the output array, so only explicitly set values are included. + +## Field Methods Reference + +### Basic Input + +| Method | Type-specific Parameters | +|---|---| +| `text()` | `counter` _(bool)_ | +| `textarea()` | `counter` _(bool)_ | +| `email()` | — | +| `password()` | — | +| `tel()` | — | +| `url()` | — | +| `hidden()` | — | + +### Numeric + +| Method | Type-specific Parameters | +|---|---| +| `number()` | `min` _(float)_, `max` _(float)_, `step` _(float)_ | +| `range()` | `min` _(float)_, `max` _(float)_, `step` _(float)_ | + +### Date / Time + +| Method | Type-specific Parameters | +|---|---| +| `date()` | — | +| `datetime()` | — | +| `time()` | — | +| `month()` | — | +| `week()` | — | +| `date_range()` | `min` _(string)_, `max` _(string)_ | + +### Selection + +| Method | Type-specific Parameters | +|---|---| +| `select()` | `options` _(array)_, `options_key` _(string)_, `async_params` _(array)_ | +| `radio()` | `options` _(array)_ | +| `checkbox()` | `title` _(string)_ | +| `toggle()` | `title` _(string)_ | +| `color()` | — | + +### Rich Content + +| Method | Type-specific Parameters | +|---|---| +| `wysiwyg()` | `height` _(int)_, `toolbar` _(string)_, `delay` _(bool)_, `tabs` _(string)_, `force_modal` _(bool)_ | +| `code()` | `language` _(string)_, `height` _(int)_, `theme` _(string)_ | +| `html()` | `content` _(string)_ | + +### File / Media + +| Method | Type-specific Parameters | +|---|---| +| `attachment()` | `attachment_type` _(string)_ | +| `direct_file()` | `allowed_types` _(array)_, `max_size` _(int)_ | + +### WordPress Objects + +| Method | Type-specific Parameters | +|---|---| +| `post()` | `post_type` _(string\|array)_ | +| `term()` | `taxonomy` _(string)_ | +| `link()` | `post_type` _(string\|array)_ | + +### Special + +| Method | Type-specific Parameters | +|---|---| +| `mapycz()` | `lang` _(string)_ | +| `button()` | `title` _(string)_, `action` _(string)_, `url` _(string)_, `target` _(string)_, `primary` _(bool)_ | +| `multi_button()` | `buttons` _(array)_ | +| `title()` | `title` _(string)_ | + +### Container + +| Method | Type-specific Parameters | +|---|---| +| `group()` | `items` _(array, required)_ | +| `wrapper()` | `items` _(array, required)_, `tag` _(string)_, `classname` _(string)_ | +| `inner_blocks()` | `allowed_blocks` _(array)_, `template` _(array)_, `template_lock` _(string)_, `orientation` _(string)_ | + +### Multi-field Variants + +All multi-field methods accept the base type-specific parameters plus these additional parameters: + +- `min` _(int)_ — Minimum number of items +- `max` _(int)_ — Maximum number of items +- `buttons` _(array)_ — Custom button labels +- `disabled_buttons` _(array)_ — Buttons to disable + +Available multi-field methods: `multi_text`, `multi_textarea`, `multi_email`, `multi_tel`, `multi_url`, `multi_number`, `multi_date`, `multi_datetime`, `multi_time`, `multi_month`, `multi_week`, `multi_date_range`, `multi_select`, `multi_checkbox`, `multi_toggle`, `multi_post`, `multi_term`, `multi_attachment`, `multi_direct_file`, `multi_link`, `multi_mapycz`, `multi_group`. + +## Usage Examples + +### Basic Usage with Named Parameters + +```php +$f = wpify_custom_fields()->field_factory; + +wpify_custom_fields()->create_metabox( + array( + 'id' => 'my_metabox', + 'title' => 'My Metabox', + 'post_types' => array( 'page' ), + 'items' => array( + 'title' => $f->text( + label: 'Title', + required: true, + counter: true, + ), + 'description' => $f->textarea( + label: 'Description', + description: 'Enter a short description.', + ), + 'category' => $f->select( + label: 'Category', + options: array( + 'news' => 'News', + 'blog' => 'Blog', + 'product' => 'Product', + ), + ), + ), + ) +); +``` + +### Integration Example — Options Page + +```php +$f = wpify_custom_fields()->field_factory; + +wpify_custom_fields()->create_options_page( + array( + 'page_title' => 'Theme Settings', + 'menu_title' => 'Theme Settings', + 'menu_slug' => 'theme-settings', + 'tabs' => array( + 'general' => 'General', + 'social' => 'Social Media', + ), + 'items' => array( + 'site_logo' => $f->attachment( + label: 'Site Logo', + attachment_type: 'image', + tab: 'general', + ), + 'footer_text' => $f->wysiwyg( + label: 'Footer Text', + height: 200, + tab: 'general', + ), + 'twitter_url' => $f->url( + label: 'Twitter URL', + tab: 'social', + ), + 'facebook_url' => $f->url( + label: 'Facebook URL', + tab: 'social', + ), + ), + ) +); +``` + +### Group with Nested Fields + +```php +$f = wpify_custom_fields()->field_factory; + +'address' => $f->group( + label: 'Address', + items: array( + 'street' => $f->text( label: 'Street' ), + 'city' => $f->text( label: 'City' ), + 'zip' => $f->text( label: 'ZIP Code' ), + 'country' => $f->select( + label: 'Country', + options: array( + 'us' => 'United States', + 'ca' => 'Canada', + 'uk' => 'United Kingdom', + ), + ), + ), +), +``` + +### Conditional Fields + +```php +$f = wpify_custom_fields()->field_factory; + +'enable_cta' => $f->toggle( + label: 'Enable CTA', + title: 'Show a call-to-action button', +), +'cta_text' => $f->text( + label: 'CTA Text', + conditions: array( + array( 'field' => 'enable_cta', 'value' => true ), + ), +), +'cta_url' => $f->url( + label: 'CTA URL', + conditions: array( + array( 'field' => 'enable_cta', 'value' => true ), + ), +), +``` + +### Multi-field Variants + +```php +$f = wpify_custom_fields()->field_factory; + +'gallery' => $f->multi_attachment( + label: 'Photo Gallery', + attachment_type: 'image', + min: 1, + max: 10, +), +'team_members' => $f->multi_group( + label: 'Team Members', + min: 1, + max: 20, + items: array( + 'name' => $f->text( label: 'Name', required: true ), + 'role' => $f->text( label: 'Role' ), + 'photo' => $f->attachment( label: 'Photo', attachment_type: 'image' ), + ), +), +``` + +## How It Works + +Each field method: + +1. Accepts type-specific parameters first, followed by common parameters. +2. Calls `build_field()` which assembles a plain array with `'type' => '{type}'` plus all non-null parameters. +3. Uses `extract_common()` to separate type-specific from common parameters and remap snake_case PHP names to camelCase JS keys (e.g., `class_name` → `className`, `force_modal` → `forceModal`). +4. Uses a sentinel value for the `default` parameter to distinguish "not passed" from "passed as null". + +## Notes + +- Field Factory returns plain arrays — the output is fully compatible with existing array-based definitions and can be mixed freely. +- Only explicitly set parameters are included in the output. Passing `null` (the default for most parameters) omits the key entirely. +- Use PHP 8.0+ named arguments for the best developer experience. Positional arguments also work but are less readable. +- The `$f->group()` and `$f->multi_group()` methods require the `items` parameter. diff --git a/docs/features/generators.md b/docs/features/generators.md new file mode 100644 index 00000000..135f54ca --- /dev/null +++ b/docs/features/generators.md @@ -0,0 +1,110 @@ +# Field Generators + +Generators auto-populate field values on first render when the current value is empty. They are useful for assigning unique identifiers, timestamps, or other computed values to new entries. + +## Overview + +A generator runs once when a field is first displayed and its value is falsy (empty string, `null`, `undefined`, `false`, or `0`). If the field already has a value, the generator does not run. + +## Usage + +Add the `generator` property to any field definition: + +```php +'unique_id' => array( + 'type' => 'text', + 'label' => 'Unique ID', + 'generator' => 'uuid', + 'disabled' => true, +), +``` + +Or with the Field Factory: + +```php +$f = wpify_custom_fields()->field_factory; + +'unique_id' => $f->text( + label: 'Unique ID', + generator: 'uuid', + disabled: true, +), +``` + +## Built-in Generators + +### UUID Generator + +The `uuid` generator creates a random UUID v4 string. + +```php +'order_token' => array( + 'type' => 'text', + 'label' => 'Order Token', + 'generator' => 'uuid', +), +``` + +This produces a value like `550e8400-e29b-41d4-a716-446655440000`. + +## How Generators Work + +1. When a field component mounts, the `Field` component checks if `value` is falsy and `generator` is a string. +2. It applies the WordPress filter `wpifycf_generator_{name}`, passing the current value and field props. +3. If the filter returns a new value different from the current one, `onChange` is called to update the field. + +```js +// Simplified internal logic +useEffect(() => { + if (!value && typeof generator === 'string') { + const nextValue = applyFilters('wpifycf_generator_' + generator, value, props); + if (nextValue && nextValue !== value) { + props.onChange(nextValue); + } + } +}, [value, generator]); +``` + +## Creating Custom Generators + +Register a custom generator by adding a JavaScript filter with the `wpifycf_generator_{name}` hook: + +```js +import { addFilter } from '@wordpress/hooks'; + +// Generator that creates a timestamp-based ID +addFilter( 'wpifycf_generator_timestamp_id', 'my-plugin', ( value, props ) => { + return value || 'id_' + Date.now().toString( 36 ); +} ); +``` + +Then use it in your field definition: + +```php +'entry_id' => array( + 'type' => 'text', + 'label' => 'Entry ID', + 'generator' => 'timestamp_id', +), +``` + +### Another Example — Slug Generator + +```js +import { addFilter } from '@wordpress/hooks'; + +addFilter( 'wpifycf_generator_slug', 'my-plugin', ( value, props ) => { + if ( value ) { + return value; + } + // Generate a random slug + return Math.random().toString( 36 ).substring( 2, 10 ); +} ); +``` + +## Best Practices + +- **Always check the existing value** in your generator filter. Return the existing value if it is truthy to avoid overwriting user data. +- **Combine with `disabled: true`** for immutable identifiers that should not be edited after generation. +- **Use with hidden fields** when you need auto-generated values that users should not see. +- **Generators run client-side only.** They execute in the browser when the field renders. They do not run during PHP processing or REST API calls. diff --git a/docs/features/rest-api.md b/docs/features/rest-api.md new file mode 100644 index 00000000..0de1e635 --- /dev/null +++ b/docs/features/rest-api.md @@ -0,0 +1,158 @@ +# REST API + +WPify Custom Fields registers internal REST API endpoints used by field components to fetch data, upload files, and manage configuration. + +## Overview + +The REST API is primarily consumed by the JavaScript field components (Post, Term, Link, Mapy.cz, DirectFile). You generally do not need to call these endpoints directly, but they are documented here for reference and debugging. + +## Namespace + +All endpoints are registered under: + +``` +{plugin-basename}/wpifycf/v1 +``` + +The `{plugin-basename}` is derived from the directory name of the plugin or theme that instantiated `CustomFields`. For example, if the plugin directory is `my-plugin`, the full namespace would be `my-plugin/wpifycf/v1`. + +## Permission + +All endpoints require the `edit_posts` capability. Unauthenticated or unauthorized requests receive a `403 Forbidden` response. + +## Endpoints + +### GET `url-title` + +Fetches the page title from a given URL. Used by the Link field to display a human-readable title. + +**Parameters:** + +| Parameter | Required | Description | +|---|---|---| +| `url` | Yes | The URL to fetch the title from | + +**Response:** The page title as a string. + +**Error cases:** +- Missing `url` parameter returns a WP_Error. +- Unreachable URL returns an empty or error response. + +--- + +### GET `posts` + +Searches and retrieves posts with pagination. Used by the Post, Multi Post, and Link fields. + +**Parameters:** + +| Parameter | Required | Description | +|---|---|---| +| `post_type` | Yes | Post type slug (or array of slugs) to search | +| `search` | No | Search query string | +| `page` | No | Page number for pagination | +| `per_page` | No | Number of results per page | +| `include` | No | Array of specific post IDs to include | + +**Response:** Array of post objects with `id`, `title`, and other relevant fields. + +--- + +### GET `terms` + +Retrieves taxonomy terms as a tree structure. Used by the Term and Multi Term fields. + +**Parameters:** + +| Parameter | Required | Description | +|---|---|---| +| `taxonomy` | Yes | Taxonomy slug to retrieve terms from | + +**Response:** Array of term objects arranged in a hierarchical tree. + +--- + +### GET `mapycz-api-key` + +Retrieves the stored Mapy.cz API key from the WordPress options table. + +**Parameters:** None. + +**Response:** The API key string, or empty if not set. + +--- + +### POST `mapycz-api-key` + +Saves a Mapy.cz API key to the WordPress options table. + +**Parameters:** + +| Parameter | Required | Description | +|---|---|---| +| `api_key` | Yes | The API key to store | + +**Response:** `true` on success. + +--- + +### POST `direct-file-upload` + +Uploads a file to a temporary directory on the server. Used by the Direct File field for file uploads that bypass the WordPress media library. + +**Parameters:** + +| Parameter | Required | Description | +|---|---|---| +| `file` | Yes | The file to upload (multipart form data) | +| `field_id` | No | The field ID associated with the upload | + +**Response:** + +```json +{ + "temp_path": "/path/to/wp-content/uploads/wpifycf-tmp/unique-filename.pdf", + "filename": "unique-filename.pdf", + "size": 102400, + "type": "application/pdf" +} +``` + +**Error cases:** + +| Error Code | Description | +|---|---| +| `no_file` | No file was included in the request | +| `upload_error` | The file upload failed at the PHP level | +| `file_too_large` | File exceeds `wp_max_upload_size()` | +| `directory_creation_failed` | Temp directory could not be created | +| `move_failed` | Uploaded file could not be moved to temp directory | + +--- + +### GET `direct-file-info` + +Retrieves metadata about a file at a given path. Used by the Direct File field to display file information. + +**Parameters:** + +| Parameter | Required | Description | +|---|---|---| +| `file_path` | Yes | Absolute path to the file | + +**Response:** + +```json +{ + "size": 102400, + "type": "application/pdf", + "filename": "document.pdf" +} +``` + +**Error cases:** + +| Error Code | Description | +|---|---| +| `no_file_path` | No file path was provided | +| `file_not_found` | The file does not exist at the given path | diff --git a/docs/features/type-aliases.md b/docs/features/type-aliases.md new file mode 100644 index 00000000..bdd6347a --- /dev/null +++ b/docs/features/type-aliases.md @@ -0,0 +1,45 @@ +# Type Aliases (Backward Compatibility) + +WPify Custom Fields maps several legacy field type names to their current equivalents. This ensures backward compatibility with older configurations and with the WPify Woo plugin. + +## Overview + +When field definitions are normalized, any legacy type name is automatically replaced with the current name. This happens transparently — you do not need to update existing code. + +## Alias Table + +| Legacy Name | Current Name | Notes | +|---|---|---| +| `multiswitch` | `multi_toggle` | Multi toggle field | +| `switch` | `toggle` | Single toggle field | +| `multiselect` | `multi_select` | Multi select field | +| `colorpicker` | `color` | Color picker field | +| `gallery` | `multi_attachment` | Multiple attachment field | +| `repeater` | `multi_group` | Repeatable group field | + +## Example + +These two definitions produce identical results: + +```php +// Legacy name (still works) +'my_field' => array( + 'type' => 'switch', + 'label' => 'Enable Feature', + 'title' => 'Turn on the feature', +), + +// Current name (preferred for new code) +'my_field' => array( + 'type' => 'toggle', + 'label' => 'Enable Feature', + 'title' => 'Turn on the feature', +), +``` + +## Notes + +- Legacy names work indefinitely and will not be removed. +- Use the current names in new code for clarity and consistency. +- The alias mapping exists primarily for compatibility with the WPify Woo plugin. +- Aliases are resolved during item normalization in `BaseIntegration::normalize_item()`. diff --git a/docs/features/validation.md b/docs/features/validation.md new file mode 100644 index 00000000..db429bb3 --- /dev/null +++ b/docs/features/validation.md @@ -0,0 +1,141 @@ +# Validation + +WPify Custom Fields includes a real-time client-side validation system. Fields are validated as users type or change values, and error messages are displayed immediately without requiring a page reload. + +## Overview + +Each field component can define a static `checkValidity(value, field)` method that receives the current value and field configuration and returns an array of error message strings. An empty array means the value is valid. + +## How It Works + +1. The `Field` component calls `FieldComponent.checkValidity(value, field)` whenever the value or field configuration changes. +2. The returned array of error strings is stored in state and displayed below the field. +3. Hidden fields (via conditions or tabs) skip validation — they always return an empty array. +4. Validation runs on every value change, providing real-time feedback. + +```js +// Simplified internal logic +const validity = useMemo( + () => !isHidden && typeof FieldComponent.checkValidity === 'function' + ? FieldComponent.checkValidity( value, { ...props, type } ) + : [], + [ FieldComponent, value, props, type, isHidden ], +); +``` + +## Built-in Validators + +The following validator functions are available in `assets/helpers/validators.js`: + +| Validator | What It Checks | Error Messages | Used By | +|---|---|---|---| +| `checkValidityStringType` | Required string is non-empty | "This field is required." | Text, Textarea, Password, URL, Tel, Hidden | +| `checkValidityEmailType` | Required + valid email format | "This field is required.", "This field must be a valid email address." | Email | +| `checkValidityNumberType` | Required, is number, min/max/step | "This field is required.", "This field must be a number.", min/max/step messages | Number, Range | +| `checkValidityBooleanType` | Required boolean is truthy | "This field is required." | Checkbox, Toggle | +| `checkValidityDateTimeType` | Required date/time is non-empty | "This field is required." | Date, Datetime, Time, Month, Week | +| `checkValidityDateRangeType` | Required, date order, min/max bounds | "This field is required.", "The start date must be before or equal to the end date.", min/max date messages | Date Range | +| `checkValidityNonZeroIntegerType` | Required integer > 0 | "This field is required." | Post, Attachment | +| `checkValidityLinkType` | Required link has URL or post | "This field is required." | Link | +| `checkValidityGroupType` | Recursively validates all children | Per-child errors | Group | +| `checkValidityMultiGroupType` | Validates each item as a group | Per-item, per-child errors | Multi Group | +| `checkValidityMultiFieldType` | Required array is non-empty, validates each item | "This field is required." + per-item errors | Multi Text, Multi Email, Multi Date, etc. | +| `checkValidityMultiBooleanType` | Required object has at least one truthy value | "This field is required." | Multi Checkbox, Multi Toggle | +| `checkValidityMultiNonZeroType` | Required array of integers > 0 | "This field is required." | Multi Post, Multi Attachment, Multi Term | +| `checkValidityMultiStringType` | Required array of non-empty strings | "This field is required." | Multi URL, Multi Tel | + +## Validation in Groups + +The `checkValidityGroupType` function recursively validates all child fields within a group. It uses `flattenWrapperItems()` to hoist wrapper children to the same level before validation, ensuring wrapper fields are transparent to the validation system. + +```js +function checkValidityGroupType( value = {}, field ) { + const validity = []; + + if ( Array.isArray( field.items ) ) { + flattenWrapperItems( field.items ).forEach( item => { + const FieldComponent = getFieldComponentByType( item.type ); + + if ( typeof FieldComponent.checkValidity === 'function' ) { + const fieldValidity = FieldComponent.checkValidity( value[ item.id ], item ); + + if ( fieldValidity.length > 0 ) { + validity.push( { [ item.id ]: fieldValidity } ); + } + } + } ); + } + + return validity; +} +``` + +The returned validity is an array of objects, where each object maps a child field ID to its error messages. + +## Validation in Multi-Fields + +The `checkValidityMultiFieldType(type)` is a factory function that creates a validator for any repeatable field type. It: + +1. Checks if the array itself is required and non-empty. +2. Iterates over each item in the array and validates it using the base field type's `checkValidity` method. + +```js +function checkValidityMultiFieldType( type ) { + return ( value, field ) => { + const validity = []; + + if ( field.required && ( ! Array.isArray( value ) || value.length === 0 ) ) { + validity.push( __( 'This field is required.', 'wpify-custom-fields' ) ); + } + + if ( Array.isArray( value ) ) { + const FieldComponent = getFieldComponentByType( type ); + + value.forEach( ( item, index ) => { + if ( typeof FieldComponent.checkValidity === 'function' ) { + const itemValidity = FieldComponent.checkValidity( item, field ); + + if ( itemValidity.length > 0 ) { + validity.push( { [ index ]: itemValidity } ); + } + } + } ); + } + + return validity; + }; +} +``` + +## Custom Validators + +To add validation to a custom field component, define a static `checkValidity` method on the component: + +```js +function MyCustomField( { id, value, onChange, ...props } ) { + // Field render logic + return onChange( e.target.value )} />; +} + +MyCustomField.checkValidity = function( value, field ) { + const errors = []; + + if ( field.required && ! value ) { + errors.push( __( 'This field is required.', 'my-plugin' ) ); + } + + if ( value && value.length < 3 ) { + errors.push( __( 'Value must be at least 3 characters.', 'my-plugin' ) ); + } + + return errors; +}; +``` + +The validation system will automatically pick up your `checkValidity` method and call it whenever the field value changes. + +## Notes + +- Validation is client-side only. Server-side sanitization is handled separately via the `wpifycf_sanitize_{type}` PHP filters. +- Hidden fields (hidden by conditions or not on the active tab) are not validated. +- The validation result is an array of strings for simple fields, or an array of strings and objects for compound fields (groups, multi-fields). Objects map child IDs or indices to their respective error arrays. diff --git a/docs/field-types.md b/docs/field-types.md index dc1aa1ab..54adacd8 100644 --- a/docs/field-types.md +++ b/docs/field-types.md @@ -125,27 +125,6 @@ Array of options that are passed to the field renderer. It can be used to custom * `noControlWrapper`: Boolean value that determines whether the field control should be wrapped in a div element. * `noFieldWrapper`: Boolean value that determines whether the field should be wrapped in a div element. -### `fieldPath` - -The current field's path in the form hierarchy. It identifies the field's position, which is especially useful for nested fields in groups or repeaters. The path uses dot notation (e.g., `parent_group.child_field`) and array indices for repeater items (e.g., `multi_group[0].field_name`). This property is used internally for relative path resolution and accessing sibling/parent field values. - -### `allValues` - -An object containing all current form field values, where keys are field IDs. This allows field components to access any other field's value in the form, which is useful for custom field implementations that need to read values from other fields. - -### `getValue` - -A helper function to access other field values using path syntax. The function signature is `getValue(path: string): any`. - -The path syntax supports: - -* Dot notation for nested fields: `parent.child` -* Relative references using hash: `#` (parent), `##` (grandparent) -* Array bracket notation: `multi_field[0]` -* Combinations: `#.sibling_field[0].name` - -This is useful for dependent dropdowns, dynamic field values based on other fields, and other scenarios where a field needs to react to values from other fields. - ## Simple field types * [Checkbox](field-types/checkbox.md) `checkbox` @@ -215,4 +194,9 @@ This is useful for dependent dropdowns, dynamic field values based on other fiel * [Multi Button](field-types/multi_button.md) `multi_button` * [HTML](field-types/html.md) `html` * [Title](field-types/title.md) `title` -* [Hidden](field-types/hidden.md) `hidden` \ No newline at end of file +* [Hidden](field-types/hidden.md) `hidden` + +## Visual field types + +* [Wrapper](field-types/wrapper.md) `wrapper` +* [Columns](field-types/columns.md) `columns` diff --git a/docs/field-types/attachment.md b/docs/field-types/attachment.md index 70b2e8dc..59a24415 100644 --- a/docs/field-types/attachment.md +++ b/docs/field-types/attachment.md @@ -6,44 +6,28 @@ The attachment field type allows selecting a single file from the WordPress medi ```php array( - 'type' => 'attachment', - 'id' => 'example_attachment', - 'label' => 'Example Attachment', - 'attachment_type' => '', // Optional, limit to specific media types + 'type' => 'attachment', + 'id' => 'hero_image', + 'label' => 'Hero Image', + 'attachment_type' => 'image', ) ``` ## Properties -### Default Field Properties - -These properties are available for all field types: - -- `id` _(string)_ - Unique identifier for the field -- `type` _(string)_ - Must be set to `attachment` for this field type -- `label` _(string)_ - The field label displayed in the admin interface -- `description` _(string)_ - Help text displayed below the field -- `required` _(boolean)_ - Whether the field must have a value -- `tab` _(string)_ - The tab ID where this field should appear (if using tabs) -- `className` _(string)_ - Additional CSS class for the field container -- `conditions` _(array)_ - Conditions that determine when to show this field -- `disabled` _(boolean)_ - Whether the field should be disabled -- `default` _(mixed)_ - Default value for the field -- `attributes` _(array)_ - HTML attributes to add to the field -- `unfiltered` _(boolean)_ - Whether the value should remain unfiltered when saved -- `render_options` _(array)_ - Options for customizing field rendering +For Default Field Properties, see [Field Types Definition](../field-types.md). ### Specific Properties -#### `attachment_type` _(string)_ +#### `attachment_type` _(string)_ — Optional -Optional parameter that limits the type of files that can be selected from the media library. Common values include: +Limits the type of files that can be selected from the media library. Common values include: -- Empty string (default) - allows all media types -- `image` - limits selection to images only -- `video` - limits selection to video files -- `audio` - limits selection to audio files -- `application/pdf` - limits selection to PDF documents +- Empty string (default) — allows all media types +- `image` — limits selection to images only +- `video` — limits selection to video files +- `audio` — limits selection to audio files +- `application/pdf` — limits selection to PDF documents ## Stored Value @@ -51,27 +35,87 @@ The field stores the attachment ID (integer) in the database. This ID can be use ## Example Usage +### Basic Image Field + ```php -// Define the field -'hero_image' => array( - 'type' => 'attachment', - 'id' => 'hero_image', - 'label' => 'Hero Image', +array( + 'type' => 'attachment', + 'id' => 'hero_image', + 'label' => 'Hero Image', 'attachment_type' => 'image', - 'description' => 'Select an image to display in the header.', + 'description' => 'Select an image to display in the header.', +), +``` + +### Document Attachment + +```php +array( + 'type' => 'attachment', + 'id' => 'pdf_document', + 'label' => 'PDF Document', + 'attachment_type' => 'application/pdf', + 'description' => 'Upload a PDF document.', ), +``` + +### Using Values in Your Theme -// Retrieve and use the attachment in your theme +```php $image_id = get_post_meta( get_the_ID(), 'hero_image', true ); + if ( ! empty( $image_id ) ) { + // Display the image echo wp_get_attachment_image( $image_id, 'full', false, array( 'class' => 'hero-image' ) ); + + // Or get the URL directly + $image_url = wp_get_attachment_url( $image_id ); + if ( $image_url ) { + echo '' . esc_attr( get_post_meta( $image_id, '_wp_attachment_image_alt', true ) ) . ''; + } } ``` +### With Conditional Logic + +```php +'show_hero' => array( + 'type' => 'toggle', + 'id' => 'show_hero', + 'label' => 'Show Hero Image', +), +'hero_image' => array( + 'type' => 'attachment', + 'id' => 'hero_image', + 'label' => 'Hero Image', + 'attachment_type' => 'image', + 'conditions' => array( + array( 'field' => 'show_hero', 'value' => true ), + ), +), +``` + ## User Interface The attachment field provides: 1. An "Add attachment" button when no file is selected 2. A preview of the selected file (thumbnail for images, icon for other file types) -3. Edit and remove buttons for managing the selected attachment \ No newline at end of file +3. Edit and remove buttons for managing the selected attachment + +## Field Factory + +```php +$f = new \Wpify\CustomFields\FieldFactory(); + +$f->attachment( + label: 'Hero Image', + attachment_type: 'image', +); +``` + +## Notes + +- The stored attachment ID can be used with all standard WordPress attachment functions +- For selecting multiple attachments, use the [`multi_attachment`](multi_attachment.md) field type instead +- When an attachment is deleted from the media library, the field will show an empty state when edited diff --git a/docs/field-types/button.md b/docs/field-types/button.md index 781b8410..641f2f74 100644 --- a/docs/field-types/button.md +++ b/docs/field-types/button.md @@ -1,59 +1,35 @@ # Button Field Type -The Button field type allows you to add interactive buttons to your custom fields interface. These buttons can be used for triggering actions through WordPress hooks or navigating to specific URLs. +The Button field type allows you to add interactive buttons to your custom fields interface. These buttons can trigger actions through WordPress hooks or navigate to specific URLs. ## Field Type: `button` ```php array( - 'type' => 'button', - 'id' => 'example_button', - 'title' => 'Click Me', - 'action' => 'my_custom_action', // Optional WordPress hook to trigger - 'url' => 'https://example.com', // Optional URL to navigate to - 'primary' => true, // Optional styling - 'target' => '_blank', + 'type' => 'button', + 'title' => 'Click Me', + 'action' => 'my_custom_action', + 'url' => 'https://example.com', + 'target' => '_blank', + 'primary' => true, ) ``` ## Properties -### Default Field Properties - -These properties are available for all field types: - -- `id` _(string)_ - Unique identifier for the field -- `type` _(string)_ - Must be set to `button` for this field type -- `label` _(string)_ - The field label displayed in the admin interface -- `description` _(string)_ - Help text displayed below the field -- `tab` _(string)_ - The tab ID where this field should appear (if using tabs) -- `className` _(string)_ - Additional CSS class for the field container -- `conditions` _(array)_ - Conditions that determine when to show this field -- `disabled` _(boolean)_ - Whether the button should be disabled -- `attributes` _(array)_ - HTML attributes to add to the field -- `render_options` _(array)_ - Options for customizing field rendering +For Default Field Properties, see [Field Types Definition](../field-types.md). ### Specific Properties -#### `title` _(string)_ - Required - -The text to display on the button. - -#### `action` _(string)_ - Optional - -Name of a WordPress hook action to trigger when the button is clicked. When the action is triggered, the field properties are passed as a parameter to the action callback. - -#### `url` or `href` _(string)_ - Optional - -URL to navigate to when the button is clicked. This property is ignored if `action` is specified. +- `title` _(string)_ — The text to display on the button. +- `action` _(string)_ — Name of a WordPress hook action to trigger when the button is clicked. When the action is triggered, the field properties are passed as a parameter to the action callback. +- `url` _(string)_ — URL to navigate to when the button is clicked. This property is ignored if `action` is specified. Also accepts `href` as an alias. +- `target` _(string)_ — The target attribute for the link, specifying where to open the URL (e.g., `_blank`, `_self`). Defaults to `_blank`. This property is ignored if `action` is specified. +- `primary` _(boolean)_ — Whether to style the button as a primary action button with highlight color. Defaults to `false`. -#### `target` _(string)_ - Optional, default: `_blank` +## Stored Value -The target attribute for the link, specifying where to open the URL. Common values are `_blank` (new tab) or `_self` (same tab). This property is ignored if `action` is specified. - -#### `primary` _(boolean)_ - Optional, default: `false` - -Whether to style the button as a primary action button (with highlight color). +This field does not store any value. ## Example Usage @@ -61,11 +37,10 @@ Whether to style the button as a primary action button (with highlight color). ```php 'regenerate_button' => array( - 'type' => 'button', - 'id' => 'regenerate_button', - 'title' => 'Regenerate Thumbnails', - 'action' => 'my_regenerate_thumbnails_action', - 'primary' => true, + 'type' => 'button', + 'title' => 'Regenerate Thumbnails', + 'action' => 'my_regenerate_thumbnails_action', + 'primary' => true, ), ``` @@ -84,16 +59,29 @@ wp.hooks.addAction('my_regenerate_thumbnails_action', 'my-plugin', function(prop ```php 'documentation_button' => array( - 'type' => 'button', - 'id' => 'documentation_button', - 'title' => 'View Documentation', - 'url' => 'https://docs.example.com', + 'type' => 'button', + 'title' => 'View Documentation', + 'url' => 'https://docs.example.com', + 'target' => '_blank', ), ``` +## Field Factory + +```php +$f = new \Wpify\CustomFields\FieldFactory(); + +$f->button( + title: 'Click Me', + url: 'https://example.com', + target: '_blank', + primary: true, +); +``` + ## Notes -- The Button field type is a static field that does not store any data -- It's useful for triggering JavaScript actions or providing quick navigation links -- You can combine it with conditional logic to show/hide buttons based on other field values -- To make buttons work with custom JavaScript actions, you need to register your action handlers using WordPress hooks API +- The Button field type is a static field that does not store any data. +- It is useful for triggering JavaScript actions or providing quick navigation links. +- You can combine it with conditional logic to show or hide buttons based on other field values. +- To make buttons work with custom JavaScript actions, register your action handlers using the WordPress hooks API. diff --git a/docs/field-types/checkbox.md b/docs/field-types/checkbox.md index f0dc26e4..6efe7971 100644 --- a/docs/field-types/checkbox.md +++ b/docs/field-types/checkbox.md @@ -15,29 +15,13 @@ array( ## Properties -### Default Field Properties - -These properties are available for all field types: - -- `id` _(string)_ - Unique identifier for the field -- `type` _(string)_ - Must be set to `checkbox` for this field type -- `label` _(string)_ - The field label displayed in the admin interface -- `description` _(string)_ - Help text displayed below the field -- `required` _(boolean)_ - Whether the field must be checked -- `tab` _(string)_ - The tab ID where this field should appear (if using tabs) -- `className` _(string)_ - Additional CSS class for the field container -- `conditions` _(array)_ - Conditions that determine when to show this field -- `disabled` _(boolean)_ - Whether the field should be disabled -- `default` _(boolean)_ - Default value for the field (true or false) -- `attributes` _(array)_ - HTML attributes to add to the field -- `unfiltered` _(boolean)_ - Whether the value should remain unfiltered when saved -- `render_options` _(array)_ - Options for customizing field rendering +For Default Field Properties, see [Field Types Definition](../field-types.md). ### Specific Properties -#### `title` _(string)_ +#### `title` _(string)_ — Optional -The title property is used to set the text that will be displayed on the right side of the checkbox. +The text displayed on the right side of the checkbox. ## Stored Value @@ -45,8 +29,9 @@ The field stores a boolean value (`true` when checked, `false` when unchecked) i ## Example Usage +### Basic Checkbox + ```php -// Define the field 'show_related_posts' => array( 'type' => 'checkbox', 'id' => 'show_related_posts', @@ -55,20 +40,55 @@ The field stores a boolean value (`true` when checked, `false` when unchecked) i 'description' => 'When enabled, related posts will appear below the content.', 'default' => true, ), +``` -// Retrieve and use the checkbox value in your theme +### Using Values in Your Theme + +```php $show_related = get_post_meta( get_the_ID(), 'show_related_posts', true ); + if ( $show_related ) { // Display related posts display_related_posts(); } ``` -## User Interface +### With Conditional Logic + +```php +'show_sidebar' => array( + 'type' => 'checkbox', + 'id' => 'show_sidebar', + 'label' => 'Sidebar', + 'title' => 'Show the sidebar on this page', +), +'sidebar_position' => array( + 'type' => 'select', + 'id' => 'sidebar_position', + 'label' => 'Sidebar Position', + 'options' => array( + 'left' => 'Left', + 'right' => 'Right', + ), + 'conditions' => array( + array( 'field' => 'show_sidebar', 'value' => true ), + ), +), +``` + +## Field Factory + +```php +$f = new \Wpify\CustomFields\FieldFactory(); + +$f->checkbox( + label: 'Terms', + title: 'I agree to the terms and conditions', +); +``` -The checkbox field provides: +## Notes -1. A single checkbox input -2. A title next to the checkbox (defined by the `title` property) -3. A label above the field (defined by the `label` property) -4. Optional description text below the field \ No newline at end of file +- The checkbox renders a single input with an optional title next to it +- For multiple checkboxes, use the [`multi_checkbox`](multi_checkbox.md) field type instead +- The `title` property supports plain text displayed beside the checkbox control diff --git a/docs/field-types/code.md b/docs/field-types/code.md index 1828ffb1..e8602ad9 100644 --- a/docs/field-types/code.md +++ b/docs/field-types/code.md @@ -1,45 +1,29 @@ # Code Field Type -The Code field type provides a syntax-highlighted code editor for various programming languages. It uses CodeMirror for a rich code editing experience with features like line wrapping, syntax highlighting, and more. +The Code field type provides a syntax-highlighted code editor powered by CodeMirror. It supports multiple programming languages with features like line wrapping, syntax highlighting, and configurable themes. ## Field Type: `code` ```php array( - 'type' => 'code', - 'id' => 'example_code', - 'label' => 'Custom CSS', - 'language' => 'css', - 'height' => 300, - 'theme' => 'dark', + 'type' => 'code', + 'id' => 'example_code', + 'label' => 'Custom CSS', + 'language' => 'css', + 'height' => 300, + 'theme' => 'dark', ) ``` ## Properties -### Default Field Properties - -These properties are available for all field types: - -- `id` _(string)_ - Unique identifier for the field -- `type` _(string)_ - Must be set to `code` for this field type -- `label` _(string)_ - The field label displayed in the admin interface -- `description` _(string)_ - Help text displayed below the field -- `required` _(boolean)_ - Whether the field must have a value -- `tab` _(string)_ - The tab ID where this field should appear (if using tabs) -- `className` _(string)_ - Additional CSS class for the field container -- `conditions` _(array)_ - Conditions that determine when to show this field -- `disabled` _(boolean)_ - Whether the field should be disabled -- `default` _(string)_ - Default value for the field -- `attributes` _(array)_ - HTML attributes to add to the field -- `unfiltered` _(boolean)_ - Whether the value should remain unfiltered when saved -- `render_options` _(array)_ - Options for customizing field rendering +For Default Field Properties, see [Field Types Definition](../field-types.md). ### Specific Properties -#### `language` _(string)_ - Optional, default: `'html'` +#### `language` _(string)_ — Optional -The programming language for syntax highlighting. Supported languages: +The programming language for syntax highlighting. Defaults to `'html'`. Supported languages: - `html` (default) - `javascript` or `js` @@ -50,60 +34,97 @@ The programming language for syntax highlighting. Supported languages: - `xml` - `json` -#### `height` _(integer)_ - Optional, default: `200` +#### `height` _(integer)_ — Optional -The height of the code editor in pixels. +The height of the code editor in pixels. Defaults to `200`. -#### `theme` _(string)_ - Optional, default: `'dark'` +#### `theme` _(string)_ — Optional -The color theme for the editor. Options: -- `dark` - Uses VS Code dark theme -- Any other value - Uses default light theme +The color theme for the editor. Defaults to `'dark'` (VS Code dark theme). Any other value uses the default light theme. ## Stored Value -The field stores the code as a string in the database. The content is not processed or modified in any way when saved. +The field stores the code as a string in the database. The content is not processed or modified when saved. ## Example Usage ### Custom CSS Code Block ```php -'custom_css' => array( - 'type' => 'code', - 'id' => 'custom_css', - 'label' => 'Custom CSS', - 'description' => 'Add custom CSS styles for this page.', - 'language' => 'css', - 'height' => 250, - 'theme' => 'dark', -), +array( + 'type' => 'code', + 'id' => 'custom_css', + 'label' => 'Custom CSS', + 'description' => 'Add custom CSS styles for this page.', + 'language' => 'css', + 'height' => 250, + 'theme' => 'dark', +) ``` ### JavaScript Snippet ```php -'tracking_script' => array( - 'type' => 'code', - 'id' => 'tracking_script', - 'label' => 'Tracking Script', - 'description' => 'Add custom JavaScript for analytics tracking.', - 'language' => 'javascript', - 'height' => 300, -), +array( + 'type' => 'code', + 'id' => 'tracking_script', + 'label' => 'Tracking Script', + 'description' => 'Add custom JavaScript for analytics tracking.', + 'language' => 'javascript', + 'height' => 300, +) ``` -### HTML Template Fragment +### Using Values in Your Theme ```php -'email_template' => array( - 'type' => 'code', - 'id' => 'email_template', - 'label' => 'Email Template', - 'description' => 'Customize the HTML template for emails.', - 'language' => 'html', - 'height' => 400, +// Get the code content from the meta field +$custom_css = get_post_meta( get_the_ID(), 'custom_css', true ); + +if ( ! empty( $custom_css ) ) { + echo ''; +} + +// Output a tracking script +$tracking_script = get_post_meta( get_the_ID(), 'tracking_script', true ); + +if ( ! empty( $tracking_script ) ) { + echo ''; +} +``` + +### With Conditional Logic + +```php +array( + 'type' => 'toggle', + 'id' => 'enable_custom_css', + 'label' => 'Custom CSS', + 'title' => 'Add custom CSS to this page', ), +array( + 'type' => 'code', + 'id' => 'custom_css', + 'label' => 'Custom CSS', + 'description' => 'Enter CSS styles for this page.', + 'language' => 'css', + 'height' => 300, + 'conditions' => array( + array( 'field' => 'enable_custom_css', 'value' => true ), + ), +) +``` + +## Field Factory + +```php +$f = new \Wpify\CustomFields\FieldFactory(); + +$f->code( + label: 'Custom CSS', + language: 'css', + height: 300, +); ``` ## Notes @@ -111,4 +132,5 @@ The field stores the code as a string in the database. The content is not proces - The code editor includes an error boundary that falls back to a simple textarea if the editor fails to load - Code fields are well-suited for storing custom code snippets, templates, or configuration data - The field does not provide code execution, validation, or sanitization beyond basic string handling -- For very large code blocks, consider increasing the height or providing external editing capabilities \ No newline at end of file +- For very large code blocks, consider increasing the height or providing external editing capabilities +- For rich text editing without syntax highlighting, use the [`wysiwyg`](wysiwyg.md) field type instead diff --git a/docs/field-types/color.md b/docs/field-types/color.md index 8bfa0667..8680a47e 100644 --- a/docs/field-types/color.md +++ b/docs/field-types/color.md @@ -15,27 +15,11 @@ array( ## Properties -### Default Field Properties - -These properties are available for all field types: - -- `id` _(string)_ - Unique identifier for the field -- `type` _(string)_ - Must be set to `color` for this field type -- `label` _(string)_ - The field label displayed in the admin interface -- `description` _(string)_ - Help text displayed below the field -- `required` _(boolean)_ - Whether the field must have a value -- `tab` _(string)_ - The tab ID where this field should appear (if using tabs) -- `className` _(string)_ - Additional CSS class for the field container -- `conditions` _(array)_ - Conditions that determine when to show this field -- `disabled` _(boolean)_ - Whether the field should be disabled -- `default` _(string)_ - Default color value in hexadecimal format (e.g., `#ff0000`) -- `attributes` _(array)_ - HTML attributes to add to the field -- `unfiltered` _(boolean)_ - Whether the value should remain unfiltered when saved -- `render_options` _(array)_ - Options for customizing field rendering +For Default Field Properties, see [Field Types Definition](../field-types.md). ### Specific Properties -This field type doesn't have any additional specific properties beyond the default ones. +This field type has no additional specific properties beyond the default ones. ## Stored Value @@ -55,13 +39,11 @@ The field stores the color value as a string in hexadecimal format (e.g., `#ff00 ), ``` -### Using the Color Value in Your Theme +### Using Values in Your Theme ```php -// Get the color value from the meta field $header_color = get_post_meta( get_the_ID(), 'header_color', true ); -// Use the color value in your CSS echo ''; ``` -### Color Field with Conditional Logic +### With Conditional Logic ```php 'use_custom_color' => array( 'type' => 'toggle', 'id' => 'use_custom_color', 'label' => 'Use Custom Color', + 'title' => 'Enable custom color', ), 'custom_color' => array( 'type' => 'color', @@ -88,8 +71,19 @@ echo ''; // Display the selected value echo '
'; -echo 'Overlay Opacity: ' . esc_html($opacity) . '%'; +echo 'Overlay Opacity: ' . esc_html( $opacity ) . '%'; echo '
'; ``` -### Range Field with Conditional Logic +### With Conditional Logic ```php -'use_custom_brightness' => array( - 'type' => 'toggle', - 'id' => 'use_custom_brightness', - 'label' => 'Use Custom Brightness', -), -'brightness_level' => array( - 'type' => 'range', - 'id' => 'brightness_level', - 'label' => 'Brightness Level', - 'min' => -100, - 'max' => 100, - 'step' => 10, - 'default' => 0, - 'conditions' => array( - array('field' => 'use_custom_brightness', 'value' => true), - ), +array( + 'type' => 'toggle', + 'id' => 'use_custom_brightness', + 'label' => 'Use Custom Brightness', ), +array( + 'type' => 'range', + 'id' => 'brightness_level', + 'label' => 'Brightness Level', + 'min' => -100, + 'max' => 100, + 'step' => 10, + 'default' => 0, + 'conditions' => array( + array( 'field' => 'use_custom_brightness', 'value' => true ), + ), +) +``` + +## Field Factory + +```php +$f = new \Wpify\CustomFields\FieldFactory(); + +$f->range( + label: 'Volume', + min: 0, + max: 100, + step: 5, +); ``` ## Notes @@ -149,5 +146,4 @@ echo '
'; - Range fields are particularly useful for settings that are best represented visually - Consider using appropriate step values to provide the right level of precision for your use case - Validation ensures the value is a number within the specified min/max range -- For fine-tuned control, use smaller step values (e.g., 0.1) -- For more coarse selection, use larger step values (e.g., 10) \ No newline at end of file +- For fine-tuned control, use smaller step values (e.g., `0.1`); for coarse selection, use larger step values (e.g., `10`) diff --git a/docs/field-types/select.md b/docs/field-types/select.md index ca5053c1..5f81e400 100644 --- a/docs/field-types/select.md +++ b/docs/field-types/select.md @@ -19,27 +19,11 @@ array( ## Properties -### Default Field Properties - -These properties are available for all field types: - -- `id` _(string)_ - Unique identifier for the field -- `type` _(string)_ - Must be set to `select` for this field type -- `label` _(string)_ - The field label displayed in the admin interface -- `description` _(string)_ - Help text displayed below the field -- `required` _(boolean)_ - Whether the field must have a value -- `tab` _(string)_ - The tab ID where this field should appear (if using tabs) -- `className` _(string)_ - Additional CSS class for the field container -- `conditions` _(array)_ - Conditions that determine when to show this field -- `disabled` _(boolean)_ - Whether the field should be disabled -- `default` _(string)_ - Default selected value -- `attributes` _(array)_ - HTML attributes to add to the field -- `unfiltered` _(boolean)_ - Whether the value should remain unfiltered when saved -- `render_options` _(array)_ - Options for customizing field rendering +For Default Field Properties, see [Field Types Definition](../field-types.md). ### Specific Properties -#### `options` _(array|callable)_ - Required +#### `options` _(array|callable)_ — Required An associative array of options where the keys are the values to store and the array values are the labels to display. **Please be aware that value must be always string!** Alternatively, you can use an array of objects with `value` and `label` properties: @@ -55,9 +39,9 @@ You can also use an associative array: ```php 'options' => array( - 'red' => 'Red', - 'green' => 'Green', - 'blue' => 'Blue', + 'red' => 'Red', + 'green' => 'Green', + 'blue' => 'Blue', ), ``` @@ -71,15 +55,16 @@ You have to define the `custom_get_colors` function in your theme or plugin: ```php function custom_get_colors( array $args ): array { - // Perform any logic to fetch or generate options - - return array( - 'red' => 'Red', - 'green' => 'Green', - 'blue' => 'Blue', - ); + // Perform any logic to fetch or generate options + + return array( + 'red' => 'Red', + 'green' => 'Green', + 'blue' => 'Blue', + ); } ``` + The function accepts an array of arguments with the following keys: - `value`: The current value of the field - `search`: The search term entered by the user @@ -87,7 +72,11 @@ The function accepts an array of arguments with the following keys: The function should return the option that is currently selected (value) and options that match the search term. The returned array should be in the same format as the static options. -#### `async_params` _(array)_ - Optional +#### `options_key` _(string)_ — Optional + +A registered options key for loading options asynchronously through the REST API. When set, options are fetched dynamically rather than embedded in the page. + +#### `async_params` _(array)_ — Optional Additional parameters to pass to the API when fetching options with `options_key`. Useful for filtering or customizing the returned options. @@ -95,23 +84,23 @@ The `async_params` support dynamic value replacement using placeholders. You can ```php 'category_select' => array( - 'type' => 'select', - 'id' => 'category', - 'label' => 'Category', - 'options' => array( - 'products' => 'Products', - 'services' => 'Services', - 'resources' => 'Resources', - ), + 'type' => 'select', + 'id' => 'category', + 'label' => 'Category', + 'options' => array( + 'products' => 'Products', + 'services' => 'Services', + 'resources' => 'Resources', + ), ), 'subcategory_select' => array( - 'type' => 'select', - 'id' => 'subcategory', - 'label' => 'Subcategory', - 'options' => 'get_subcategories', - 'async_params' => array( - 'category' => '{{category}}', // Will be replaced with the value from category field - ), + 'type' => 'select', + 'id' => 'subcategory', + 'label' => 'Subcategory', + 'options' => 'get_subcategories', + 'async_params' => array( + 'category' => '{{category}}', // Will be replaced with the value from category field + ), ), ``` @@ -130,35 +119,35 @@ The field path syntax follows the same rules as described in the [Conditions doc ```php 'group_field' => array( - 'type' => 'group', - 'id' => 'location_group', - 'items' => array( - 'country' => array( - 'type' => 'select', - 'id' => 'country', - 'label' => 'Country', - 'options' => 'get_countries', - ), - 'state' => array( - 'type' => 'select', - 'id' => 'state', - 'label' => 'State/Province', - 'options' => 'get_states', - 'async_params' => array( - 'country' => '{{#.country}}', // References the country field in the same group - ), - ), - 'city' => array( - 'type' => 'select', - 'id' => 'city', - 'label' => 'City', - 'options' => 'get_cities', - 'async_params' => array( - 'country' => '{{#.country}}', - 'state' => '{{#.state}}', - ), - ), - ), + 'type' => 'group', + 'id' => 'location_group', + 'items' => array( + 'country' => array( + 'type' => 'select', + 'id' => 'country', + 'label' => 'Country', + 'options' => 'get_countries', + ), + 'state' => array( + 'type' => 'select', + 'id' => 'state', + 'label' => 'State/Province', + 'options' => 'get_states', + 'async_params' => array( + 'country' => '{{#.country}}', // References the country field in the same group + ), + ), + 'city' => array( + 'type' => 'select', + 'id' => 'city', + 'label' => 'City', + 'options' => 'get_cities', + 'async_params' => array( + 'country' => '{{#.country}}', + 'state' => '{{#.state}}', + ), + ), + ), ), ``` @@ -192,36 +181,32 @@ The field stores the value (key) of the selected option as a string in the datab 'label' => 'Country', 'description' => 'Select the country.', 'options' => function ( array $args ): array { - return array( - array( 'value' => 'us', 'label' => 'United States' ), - array( 'value' => 'ca', 'label' => 'Canada' ), - array( 'value' => 'mx', 'label' => 'Mexico' ), - // More countries... - ); - }, + return array( + array( 'value' => 'us', 'label' => 'United States' ), + array( 'value' => 'ca', 'label' => 'Canada' ), + array( 'value' => 'mx', 'label' => 'Mexico' ), + // More countries... + ); + }, 'default' => 'us', ), ``` -### Using Select Values in Your Theme +### Using Values in Your Theme ```php -// Get the selected value from the meta field $color_scheme = get_post_meta( get_the_ID(), 'color_scheme', true ); -// Use the value to customize functionality if ( $color_scheme === 'dark' ) { - add_filter( 'body_class', function( $classes ) { + add_filter( 'body_class', function ( $classes ) { $classes[] = 'dark-mode'; return $classes; } ); } elseif ( $color_scheme === 'custom' ) { - // Load custom color settings $custom_colors = get_post_meta( get_the_ID(), 'custom_colors', true ); // Apply custom colors... } -// Display the selected option label $color_options = array( 'light' => 'Light Mode', 'dark' => 'Dark Mode', @@ -233,6 +218,17 @@ echo 'Selected Theme: ' . esc_html( $color_options[ $color_scheme ] ?? '' ); echo '
'; ``` +## Field Factory + +```php +$f = new \Wpify\CustomFields\FieldFactory(); + +$f->select( + label: 'Color', + options: array( 'red' => 'Red', 'green' => 'Green', 'blue' => 'Blue' ), +); +``` + ## Notes - The Select field uses React Select, which provides a modern, searchable dropdown experience diff --git a/docs/field-types/tel.md b/docs/field-types/tel.md index 888eefbb..63e564fb 100644 --- a/docs/field-types/tel.md +++ b/docs/field-types/tel.md @@ -6,39 +6,22 @@ The Tel field type provides a specialized input for phone numbers with internati ```php array( - 'type' => 'tel', - 'id' => 'example_tel', - 'label' => 'Contact Phone', - 'default_country' => 'US', + 'type' => 'tel', + 'id' => 'example_tel', + 'label' => 'Contact Phone', + 'default_country' => 'US', ) ``` ## Properties -**For Default Field Properties, see [Field Types Definition](../field-types.md)**. +For Default Field Properties, see [Field Types Definition](../field-types.md). -### `default_country` _(string)_ - Optional, default: `'US'` +### Specific Properties -The default country code to pre-select in the dropdown. Uses ISO 3166-1 alpha-2 country codes (e.g., 'US', 'GB', 'DE', 'FR', etc.). +#### `default_country` _(string)_ — Optional -### `attributes` _(array)_ - Optional - -You can pass HTML attributes to the telephone input field. For example: - -```php -'attributes' => array( - 'placeholder' => 'Enter phone number', - 'class' => 'custom-tel-field', -), -``` - -## User Interface - -The Tel field provides a rich interface with: - -1. **Country Code Dropdown**: Select the country code prefix -2. **Phone Number Input**: Enter the phone number with automatic formatting -3. **International Format**: Automatically displays in standardized E.164 format +The default country code to pre-select in the dropdown. Uses ISO 3166-1 alpha-2 country codes (e.g., `'US'`, `'GB'`, `'DE'`, `'FR'`). Defaults to `'US'`. ## Stored Value @@ -49,84 +32,84 @@ The field stores the phone number as a string in international E.164 format (e.g ### Basic Phone Number Field ```php -'contact_phone' => array( - 'type' => 'tel', - 'id' => 'contact_phone', - 'label' => 'Contact Phone Number', - 'description' => 'Enter a phone number where you can be reached.', - 'default_country' => 'US', - 'required' => true, -), +array( + 'type' => 'tel', + 'id' => 'contact_phone', + 'label' => 'Contact Phone Number', + 'description' => 'Enter a phone number where you can be reached.', + 'default_country' => 'US', + 'required' => true, +) ``` ### Phone Number with Different Default Country ```php -'uk_office_phone' => array( - 'type' => 'tel', - 'id' => 'uk_office_phone', - 'label' => 'UK Office Phone', - 'description' => 'Enter the UK office contact number.', - 'default_country' => 'GB', -), +array( + 'type' => 'tel', + 'id' => 'uk_office_phone', + 'label' => 'UK Office Phone', + 'description' => 'Enter the UK office contact number.', + 'default_country' => 'GB', +) ``` -### Using Phone Number Values in Your Theme +### Using Values in Your Theme ```php // Get the phone number from the meta field -$contact_phone = get_post_meta(get_the_ID(), 'contact_phone', true); - -if (!empty($contact_phone)) { - echo '
'; - - // Display phone number with clickable link - echo '

'; - echo 'Phone: '; - echo ''; - echo esc_html($contact_phone); - echo ''; - echo '

'; - - echo '
'; +$contact_phone = get_post_meta( get_the_ID(), 'contact_phone', true ); + +if ( ! empty( $contact_phone ) ) { + echo '
'; + echo '

'; + echo 'Phone: '; + echo ''; + echo esc_html( $contact_phone ); + echo ''; + echo '

'; + echo '
'; } ``` -### Phone Number with Conditional Logic +### With Conditional Logic ```php -'preferred_contact' => array( - 'type' => 'select', - 'id' => 'preferred_contact', - 'label' => 'Preferred Contact Method', - 'options' => array( - 'email' => 'Email', - 'phone' => 'Phone', - ), -), -'contact_phone' => array( - 'type' => 'tel', - 'id' => 'contact_phone', - 'label' => 'Phone Number', - 'default_country' => 'US', - 'conditions' => array( - array('field' => 'preferred_contact', 'value' => 'phone'), - ), +array( + 'type' => 'select', + 'id' => 'preferred_contact', + 'label' => 'Preferred Contact Method', + 'options' => array( + 'email' => 'Email', + 'phone' => 'Phone', + ), ), +array( + 'type' => 'tel', + 'id' => 'contact_phone', + 'label' => 'Phone Number', + 'default_country' => 'US', + 'conditions' => array( + array( 'field' => 'preferred_contact', 'value' => 'phone' ), + ), +) ``` -## Features +## Field Factory -1. **Country Code Selection**: Dropdown to select the appropriate country code -2. **Automatic Formatting**: Ensures consistent international phone number format -3. **Input Validation**: Basic validation to ensure the phone number is properly formatted -4. **International Support**: Works with phone numbers from any country +```php +$f = new \Wpify\CustomFields\FieldFactory(); + +$f->tel( + label: 'Phone Number', + required: true, +); +``` ## Notes - The Tel field automatically formats phone numbers in the E.164 international format (e.g., `+12025550123`) - The country code dropdown displays flags to make country selection more intuitive - For multiple phone numbers, consider using the `multi_tel` field type -- The field validates that the input is a string when required -- When working with phone numbers in your code, remember they're in international format with the '+' prefix -- The field is particularly useful for ensuring consistent phone number formatting across your application \ No newline at end of file +- When working with phone numbers in your code, remember they are in international format with the `+` prefix +- The field is particularly useful for ensuring consistent phone number formatting across your application diff --git a/docs/field-types/term.md b/docs/field-types/term.md index 01b6eddc..cab4824a 100644 --- a/docs/field-types/term.md +++ b/docs/field-types/term.md @@ -6,122 +6,123 @@ The Term field type provides an interface for selecting a single WordPress taxon ```php array( - 'type' => 'term', - 'id' => 'example_term', - 'label' => 'Category', - 'taxonomy' => 'category', + 'type' => 'term', + 'id' => 'primary_category', + 'label' => 'Category', + 'taxonomy' => 'category', ) ``` ## Properties -**For Default Field Properties, see [Field Types Definition](../field-types.md)**. +For Default Field Properties, see [Field Types Definition](../field-types.md). -### `taxonomy` _(string)_ - Required +### Specific Properties + +#### `taxonomy` _(string)_ — Required The WordPress taxonomy slug that this field will use. Common values include: -- `category` - WordPress post categories -- `post_tag` - WordPress post tags + +- `category` — WordPress post categories +- `post_tag` — WordPress post tags - Custom taxonomy slugs (e.g., `product_cat`, `event_type`, etc.) ## Stored Value The field stores the term ID as an integer in the database. -## User Interface - -The Term field provides two different interfaces based on the taxonomy structure: - -1. **For Hierarchical Taxonomies**: Displays an expandable tree view with radio buttons - - Parent terms can be expanded/collapsed using +/- icons - - Terms are selected with radio buttons (only one can be selected) - - Automatically expands parents of selected terms - -2. **For Non-Hierarchical Taxonomies**: Displays a searchable dropdown menu - - Uses the Select component with search functionality - - Shows all available terms in a flat list - ## Example Usage ### Basic Category Selector ```php -'post_category' => array( - 'type' => 'term', - 'id' => 'post_category', - 'label' => 'Primary Category', - 'description' => 'Select the primary category for this content.', - 'taxonomy' => 'category', - 'required' => true, +array( + 'type' => 'term', + 'id' => 'post_category', + 'label' => 'Primary Category', + 'description' => 'Select the primary category for this content.', + 'taxonomy' => 'category', + 'required' => true, ), ``` ### Custom Taxonomy Selector ```php -'product_type' => array( - 'type' => 'term', - 'id' => 'product_type', - 'label' => 'Product Type', - 'description' => 'Select the product type.', - 'taxonomy' => 'product_type', // Custom taxonomy +array( + 'type' => 'term', + 'id' => 'product_type', + 'label' => 'Product Type', + 'description' => 'Select the product type.', + 'taxonomy' => 'product_type', ), ``` -### Using Term Values in Your Theme +### Using Values in Your Theme ```php -// Get the term ID from the meta field -$category_id = get_post_meta(get_the_ID(), 'post_category', true); - -if (!empty($category_id)) { - // Get the full term object - $term = get_term($category_id); - - if (!is_wp_error($term) && $term) { - echo '
'; - echo '

Primary Category:

'; - - // Display term name with link - echo ''; - echo esc_html($term->name); - echo ''; - - // Optionally display term description - if (!empty($term->description)) { - echo '

' . esc_html($term->description) . '

'; - } - - echo '
'; - } +$category_id = get_post_meta( get_the_ID(), 'post_category', true ); + +if ( ! empty( $category_id ) ) { + $term = get_term( $category_id ); + + if ( ! is_wp_error( $term ) && $term ) { + echo '
'; + echo ''; + echo esc_html( $term->name ); + echo ''; + + if ( ! empty( $term->description ) ) { + echo '

' . esc_html( $term->description ) . '

'; + } + + echo '
'; + } } ``` -### Term Field with Conditional Logic +### With Conditional Logic ```php 'show_location' => array( - 'type' => 'toggle', - 'id' => 'show_location', - 'label' => 'Specify Location', + 'type' => 'toggle', + 'id' => 'show_location', + 'label' => 'Specify Location', ), 'location_type' => array( - 'type' => 'term', - 'id' => 'location_type', - 'label' => 'Location', - 'taxonomy' => 'location', - 'conditions' => array( - array('field' => 'show_location', 'value' => true), - ), + 'type' => 'term', + 'id' => 'location_type', + 'label' => 'Location', + 'taxonomy' => 'location', + 'conditions' => array( + array( 'field' => 'show_location', 'value' => true ), + ), ), ``` -## Features +## User Interface + +The Term field provides two different interfaces based on the taxonomy structure: + +1. **For Hierarchical Taxonomies**: Displays an expandable tree view with radio buttons + - Parent terms can be expanded/collapsed using +/- icons + - Terms are selected with radio buttons (only one can be selected) + - Automatically expands parents of selected terms + +2. **For Non-Hierarchical Taxonomies**: Displays a searchable dropdown menu + - Uses the Select component with search functionality + - Shows all available terms in a flat list -1. **Adaptive UI**: Automatically adjusts between dropdown and tree view based on taxonomy structure -2. **Hierarchical Support**: Displays parent-child relationships for hierarchical taxonomies -3. **Expandable Tree**: Allows collapsing/expanding branches of the taxonomy tree -4. **Search Capability**: For non-hierarchical taxonomies, provides search functionality +## Field Factory + +```php +$f = new \Wpify\CustomFields\FieldFactory(); + +$f->term( + label: 'Category', + taxonomy: 'category', +); +``` ## Notes @@ -131,4 +132,3 @@ if (!empty($category_id)) { - For hierarchical taxonomies, the tree structure maintains proper parent-child relationships - The stored term ID can be used with WordPress functions like `get_term()` and `get_term_link()` - If no terms exist in the specified taxonomy, a "No terms found" message is displayed -- The field shows a loading state while terms are being fetched \ No newline at end of file diff --git a/docs/field-types/text.md b/docs/field-types/text.md index 948510ee..5580e3ba 100644 --- a/docs/field-types/text.md +++ b/docs/field-types/text.md @@ -6,42 +6,23 @@ The Text field type provides a single-line text input for short text content. It ```php array( - 'type' => 'text', - 'id' => 'example_text', - 'label' => 'Title', + 'type' => 'text', + 'id' => 'example_text', + 'label' => 'Title', + 'counter' => true, ) ``` ## Properties -**For Default Field Properties, see [Field Types Definition](../field-types.md)**. +For Default Field Properties, see [Field Types Definition](../field-types.md). -### `attributes` _(array)_ - Optional +### Specific Properties -You can pass HTML attributes to the input element. Common attributes include: - -```php -'attributes' => array( - 'placeholder' => 'Enter text here...', - 'maxlength' => 100, - 'class' => 'custom-text-input', -), -``` - -The most useful attributes for text inputs are: - -- `placeholder`: Hint text displayed when the field is empty -- `maxlength`: Maximum number of characters allowed -- `class`: Additional CSS classes for styling - -### `counter` _(boolean)_ - Optional +#### `counter` _(boolean)_ — Optional When set to `true`, displays a character counter below the input showing the current character count. -```php -'counter' => true, -``` - ## Stored Value The field stores the text content as a string in the database. Values are sanitized using WordPress's `sanitize_text_field()` function, which removes HTML tags and line breaks. @@ -51,19 +32,19 @@ The field stores the text content as a string in the database. Values are saniti ### Basic Text Field ```php -'product_title' => array( +array( 'type' => 'text', 'id' => 'product_title', 'label' => 'Product Title', 'description' => 'Enter the product title.', 'required' => true, -), +) ``` ### Text Field with Character Counter ```php -'meta_title' => array( +array( 'type' => 'text', 'id' => 'meta_title', 'label' => 'Meta Title', @@ -72,13 +53,13 @@ The field stores the text content as a string in the database. Values are saniti 'attributes' => array( 'maxlength' => 60, ), -), +) ``` ### Text Field with Attributes ```php -'company_name' => array( +array( 'type' => 'text', 'id' => 'company_name', 'label' => 'Company Name', @@ -88,10 +69,10 @@ The field stores the text content as a string in the database. Values are saniti 'maxlength' => 100, 'class' => 'company-name-input', ), -), +) ``` -### Using Text Values in Your Theme +### Using Values in Your Theme ```php // Get the text content from the meta field @@ -109,15 +90,15 @@ if ( ! empty( $company_name ) ) { } ``` -### Text Field with Conditional Logic +### With Conditional Logic ```php -'enable_custom_title' => array( +array( 'type' => 'toggle', 'id' => 'enable_custom_title', 'label' => 'Use Custom Title', ), -'custom_title' => array( +array( 'type' => 'text', 'id' => 'custom_title', 'label' => 'Custom Title', @@ -128,7 +109,19 @@ if ( ! empty( $company_name ) ) { 'conditions' => array( array( 'field' => 'enable_custom_title', 'value' => true ), ), -), +) +``` + +## Field Factory + +```php +$f = new \Wpify\CustomFields\FieldFactory(); + +$f->text( + label: 'Title', + required: true, + counter: true, +); ``` ## Notes @@ -139,4 +132,3 @@ if ( ! empty( $company_name ) ) { - The `counter` property is useful for SEO fields or any input where character count matters - Use the `maxlength` attribute to enforce a character limit at the browser level - The field validates that a value is provided when the `required` property is set to `true` -- CSS classes follow the pattern `wpifycf-field-text` and `wpifycf-field-text--{id}` for custom styling diff --git a/docs/field-types/textarea.md b/docs/field-types/textarea.md index 7e88bb1d..f7daf4ac 100644 --- a/docs/field-types/textarea.md +++ b/docs/field-types/textarea.md @@ -6,44 +6,22 @@ The Textarea field type provides a multi-line text input area for longer content ```php array( - 'type' => 'textarea', - 'id' => 'example_textarea', - 'label' => 'Description', + 'type' => 'textarea', + 'id' => 'example_textarea', + 'label' => 'Description', + 'counter' => true, ) ``` ## Properties -**For Default Field Properties, see [Field Types Definition](../field-types.md)**. +For Default Field Properties, see [Field Types Definition](../field-types.md). -### `counter` _(boolean)_ - Optional +### Specific Properties -When set to `true`, displays a character counter below the textarea showing the current character count. - -```php -'counter' => true, -``` - -### `attributes` _(array)_ - Optional - -You can pass HTML attributes to the textarea element. Common attributes include: - -```php -'attributes' => array( - 'placeholder' => 'Enter your description here...', - 'rows' => 5, - 'cols' => 40, - 'maxlength' => 500, - 'class' => 'custom-textarea', -), -``` +#### `counter` _(boolean)_ — Optional -The most useful attributes for textareas are: - -- `rows`: Number of visible text lines (height) -- `cols`: Number of average character widths (width) -- `maxlength`: Maximum number of characters allowed -- `placeholder`: Hint text displayed when the field is empty +When set to `true`, displays a character counter below the textarea showing the current character count. ## Stored Value @@ -54,109 +32,105 @@ The field stores the text content as a string in the database, preserving line b ### Basic Description Field ```php -'product_description' => array( - 'type' => 'textarea', - 'id' => 'product_description', - 'label' => 'Product Description', - 'description' => 'Provide a detailed description of the product.', - 'required' => true, - 'attributes' => array( - 'placeholder' => 'Describe the product features, benefits, and specifications...', - 'rows' => 6, - ), -), +array( + 'type' => 'textarea', + 'id' => 'product_description', + 'label' => 'Product Description', + 'description' => 'Provide a detailed description of the product.', + 'required' => true, + 'attributes' => array( + 'placeholder' => 'Describe the product features, benefits, and specifications...', + 'rows' => 6, + ), +) ``` ### Address Field ```php -'mailing_address' => array( - 'type' => 'textarea', - 'id' => 'mailing_address', - 'label' => 'Mailing Address', - 'description' => 'Enter the complete mailing address.', - 'attributes' => array( - 'placeholder' => "Street Address\nCity, State ZIP\nCountry", - 'rows' => 4, - ), -), +array( + 'type' => 'textarea', + 'id' => 'mailing_address', + 'label' => 'Mailing Address', + 'description' => 'Enter the complete mailing address.', + 'attributes' => array( + 'placeholder' => "Street Address\nCity, State ZIP\nCountry", + 'rows' => 4, + ), +) ``` ### Textarea with Character Counter ```php -'meta_description' => array( - 'type' => 'textarea', - 'id' => 'meta_description', - 'label' => 'Meta Description', - 'description' => 'SEO description for search engines (recommended: 150-160 characters).', - 'counter' => true, - 'attributes' => array( - 'maxlength' => 160, - 'rows' => 3, - ), -), +array( + 'type' => 'textarea', + 'id' => 'meta_description', + 'label' => 'Meta Description', + 'description' => 'SEO description for search engines (recommended: 150-160 characters).', + 'counter' => true, + 'attributes' => array( + 'maxlength' => 160, + 'rows' => 3, + ), +) ``` -### Notes Field with Character Limit +### Using Values in Your Theme ```php -'editor_notes' => array( - 'type' => 'textarea', - 'id' => 'editor_notes', - 'label' => 'Editor\'s Notes', - 'description' => 'Internal notes (maximum 300 characters).', - 'attributes' => array( - 'maxlength' => 300, - 'rows' => 3, - ), -), -``` +// Get the textarea content from the meta field +$product_description = get_post_meta( get_the_ID(), 'product_description', true ); -### Using Textarea Values in Your Theme +if ( ! empty( $product_description ) ) { + echo '
'; -```php -// Get the textarea content from the meta field -$product_description = get_post_meta(get_the_ID(), 'product_description', true); - -if (!empty($product_description)) { - echo '
'; - - // Option 1: Preserve line breaks but apply escaping - echo nl2br(esc_html($product_description)); - - // Option 2: Convert to paragraphs (similar to wpautop but with more control) - $paragraphs = explode("\n\n", $product_description); - foreach ($paragraphs as $paragraph) { - if (trim($paragraph)) { - echo '

' . nl2br(esc_html($paragraph)) . '

'; - } - } - - echo '
'; + // Option 1: Preserve line breaks but apply escaping + echo nl2br( esc_html( $product_description ) ); + + // Option 2: Convert to paragraphs (similar to wpautop but with more control) + $paragraphs = explode( "\n\n", $product_description ); + foreach ( $paragraphs as $paragraph ) { + if ( trim( $paragraph ) ) { + echo '

' . nl2br( esc_html( $paragraph ) ) . '

'; + } + } + + echo '
'; } ``` -### Textarea Field with Conditional Logic +### With Conditional Logic ```php -'needs_special_instructions' => array( - 'type' => 'toggle', - 'id' => 'needs_special_instructions', - 'label' => 'Add Special Instructions', -), -'special_instructions' => array( - 'type' => 'textarea', - 'id' => 'special_instructions', - 'label' => 'Special Instructions', - 'description' => 'Provide any special instructions or requirements.', - 'attributes' => array( - 'rows' => 4, - ), - 'conditions' => array( - array('field' => 'needs_special_instructions', 'value' => true), - ), +array( + 'type' => 'toggle', + 'id' => 'needs_special_instructions', + 'label' => 'Add Special Instructions', ), +array( + 'type' => 'textarea', + 'id' => 'special_instructions', + 'label' => 'Special Instructions', + 'description' => 'Provide any special instructions or requirements.', + 'attributes' => array( + 'rows' => 4, + ), + 'conditions' => array( + array( 'field' => 'needs_special_instructions', 'value' => true ), + ), +) +``` + +## Field Factory + +```php +$f = new \Wpify\CustomFields\FieldFactory(); + +$f->textarea( + label: 'Description', + counter: true, +); ``` ## Notes @@ -168,5 +142,4 @@ if (!empty($product_description)) { - For security, always use `esc_html()` when outputting textarea content to prevent XSS attacks - Consider using the `maxlength` attribute to limit the amount of text users can enter - For very large text content, adjust the `rows` attribute to provide an appropriately sized input area -- The field validates that a value is provided when the field is required -- Textarea fields are well-suited for unformatted content like addresses, notes, code snippets, or biographical information \ No newline at end of file +- Textarea fields are well-suited for unformatted content like addresses, notes, code snippets, or biographical information diff --git a/docs/field-types/time.md b/docs/field-types/time.md index 2e8b4d1d..56ff07ee 100644 --- a/docs/field-types/time.md +++ b/docs/field-types/time.md @@ -6,40 +6,23 @@ The Time field type provides a specialized input for selecting time values. It u ```php array( - 'type' => 'time', - 'id' => 'example_time', - 'label' => 'Start Time', - 'min' => '09:00', - 'max' => '17:00', + 'type' => 'time', + 'id' => 'example_time', + 'label' => 'Start Time', + 'min' => '09:00', + 'max' => '17:00', ) ``` ## Properties -**For Default Field Properties, see [Field Types Definition](../field-types.md)**. +For Default Field Properties, see [Field Types Definition](../field-types.md). -### `min` _(string)_ - Optional +### Specific Properties -The earliest time that can be selected. The value should be in 24-hour format (HH:MM). +`min` _(string)_ — The earliest time that can be selected. The value should be in 24-hour format (HH:MM). -### `max` _(string)_ - Optional - -The latest time that can be selected. The value should be in 24-hour format (HH:MM). - -### `attributes` _(array)_ - Optional - -You can pass HTML attributes to the time input field. For example: - -```php -'attributes' => array( - 'step' => '900', // 15-minute intervals (in seconds) - 'class' => 'custom-time-picker', -), -``` - -The most useful attributes for time inputs: - -- `step`: Controls the time increments in seconds (e.g., `900` for 15-minute intervals, `1800` for 30-minute intervals) +`max` _(string)_ — The latest time that can be selected. The value should be in 24-hour format (HH:MM). ## Stored Value @@ -51,12 +34,12 @@ The field stores the time value as a string in 24-hour format (HH:MM), for examp ```php 'opening_time' => array( - 'type' => 'time', - 'id' => 'opening_time', - 'label' => 'Opening Time', - 'description' => 'Select the business opening time.', - 'default' => '09:00', - 'required' => true, + 'type' => 'time', + 'id' => 'opening_time', + 'label' => 'Opening Time', + 'description' => 'Select the business opening time.', + 'default' => '09:00', + 'required' => true, ), ``` @@ -64,99 +47,128 @@ The field stores the time value as a string in 24-hour format (HH:MM), for examp ```php 'appointment_time' => array( - 'type' => 'time', - 'id' => 'appointment_time', - 'label' => 'Appointment Time', - 'description' => 'Select an appointment time (business hours only).', - 'min' => '09:00', - 'max' => '17:00', - 'attributes' => array( - 'step' => '1800', // 30-minute intervals - ), - 'required' => true, + 'type' => 'time', + 'id' => 'appointment_time', + 'label' => 'Appointment Time', + 'description' => 'Select an appointment time (business hours only).', + 'min' => '09:00', + 'max' => '17:00', + 'attributes' => array( + 'step' => '1800', // 30-minute intervals + ), + 'required' => true, ), ``` -### Using Time Values in Your Theme - -```php -// Get the time value from the meta field -$opening_time = get_post_meta(get_the_ID(), 'opening_time', true); - -if (!empty($opening_time)) { - // Format the time according to site settings or custom format - $formatted_time = date_i18n(get_option('time_format'), strtotime($opening_time)); - - echo '
'; - echo 'Opens at: ' . esc_html($formatted_time); - echo '
'; -} -``` - ### Time Fields for Business Hours ```php 'monday_open' => array( - 'type' => 'time', - 'id' => 'monday_open', - 'label' => 'Monday Opening Time', - 'default' => '09:00', - 'attributes' => array( - 'step' => '1800', // 30-minute intervals - ), + 'type' => 'time', + 'id' => 'monday_open', + 'label' => 'Monday Opening Time', + 'default' => '09:00', + 'attributes' => array( + 'step' => '1800', // 30-minute intervals + ), ), 'monday_close' => array( - 'type' => 'time', - 'id' => 'monday_close', - 'label' => 'Monday Closing Time', - 'default' => '17:00', - 'attributes' => array( - 'step' => '1800', // 30-minute intervals - ), + 'type' => 'time', + 'id' => 'monday_close', + 'label' => 'Monday Closing Time', + 'default' => '17:00', + 'attributes' => array( + 'step' => '1800', // 30-minute intervals + ), ), ``` +### Using Values in Your Theme + +```php +// Get the time value from the meta field. +$opening_time = get_post_meta( get_the_ID(), 'opening_time', true ); + +if ( ! empty( $opening_time ) ) { + // Format the time according to site settings. + $formatted_time = date_i18n( get_option( 'time_format' ), strtotime( $opening_time ) ); + + echo '
'; + echo 'Opens at: ' . esc_html( $formatted_time ); + echo '
'; +} +``` + ### Displaying Multiple Time Fields ```php -// Get business hours from meta fields -$days = array('monday', 'tuesday', 'wednesday', 'thursday', 'friday'); +// Get business hours from meta fields. +$days = array( 'monday', 'tuesday', 'wednesday', 'thursday', 'friday' ); $business_hours = array(); -foreach ($days as $day) { - $open_time = get_post_meta(get_the_ID(), $day . '_open', true); - $close_time = get_post_meta(get_the_ID(), $day . '_close', true); - - if (!empty($open_time) && !empty($close_time)) { - $business_hours[$day] = array( - 'open' => date_i18n(get_option('time_format'), strtotime($open_time)), - 'close' => date_i18n(get_option('time_format'), strtotime($close_time)), - ); - } +foreach ( $days as $day ) { + $open_time = get_post_meta( get_the_ID(), $day . '_open', true ); + $close_time = get_post_meta( get_the_ID(), $day . '_close', true ); + + if ( ! empty( $open_time ) && ! empty( $close_time ) ) { + $business_hours[ $day ] = array( + 'open' => date_i18n( get_option( 'time_format' ), strtotime( $open_time ) ), + 'close' => date_i18n( get_option( 'time_format' ), strtotime( $close_time ) ), + ); + } } -// Display business hours table -if (!empty($business_hours)) { - echo ''; - echo ''; - echo ''; - - foreach ($business_hours as $day => $hours) { - echo ''; - echo ''; - echo ''; - echo ''; - } - - echo '
DayHours
' . ucfirst($day) . '' . $hours['open'] . ' - ' . $hours['close'] . '
'; +// Display business hours table. +if ( ! empty( $business_hours ) ) { + echo ''; + echo ''; + echo ''; + + foreach ( $business_hours as $day => $hours ) { + echo ''; + echo ''; + echo ''; + echo ''; + } + + echo '
DayHours
' . esc_html( ucfirst( $day ) ) . '' . esc_html( $hours['open'] ) . ' - ' . esc_html( $hours['close'] ) . '
'; } ``` +### With Conditional Logic + +```php +'has_opening_hours' => array( + 'type' => 'toggle', + 'id' => 'has_opening_hours', + 'label' => 'Set Opening Hours', +), +'opening_time' => array( + 'type' => 'time', + 'id' => 'opening_time', + 'label' => 'Opening Time', + 'description' => 'Select the business opening time.', + 'default' => '09:00', + 'conditions' => array( + array( 'field' => 'has_opening_hours', 'value' => true ), + ), +), +``` + +## Field Factory + +```php +$f = new \Wpify\CustomFields\FieldFactory(); + +$f->time( + label: 'Opening Time', +); +``` + ## Notes - The time picker uses the browser's native time input, which may look different across different browsers and operating systems - The saved value is always in 24-hour format (HH:MM), regardless of the display format shown to the user -- When retrieving time values, you may want to convert them to a more user-friendly format using PHP's `date()` function or WordPress's `date_i18n()` function +- The `step` attribute can be used to limit time selection to specific intervals (value in seconds, e.g., `900` for 15-minute intervals) +- The `min` and `max` constraints are passed through the field definition array; the FieldFactory method does not expose them as named parameters - For date and time together, use the `datetime` field type instead -- The `step` attribute can be used to limit time selection to specific intervals -- The field validates that a value is provided when the field is required \ No newline at end of file diff --git a/docs/field-types/title.md b/docs/field-types/title.md index 68b9f496..b954a241 100644 --- a/docs/field-types/title.md +++ b/docs/field-types/title.md @@ -1,36 +1,27 @@ # Title Field Type -The Title field type provides a way to add section headings or dividers within your custom fields interface. It's a display-only field that doesn't store any data but helps organize and structure your form layout. +The Title field type provides a way to add section headings or dividers within your custom fields interface. It is a display-only field that helps organize and structure your form layout. ## Field Type: `title` ```php array( - 'type' => 'title', - 'id' => 'section_heading', - 'title' => 'Advanced Settings', + 'type' => 'title', + 'title' => 'Advanced Settings', ) ``` ## Properties -**For Default Field Properties, see [Field Types Definition](../field-types.md)**. +For Default Field Properties, see [Field Types Definition](../field-types.md). -### `title` _(string)_ - Required +### Specific Properties -The text to display as the section heading. HTML tags are allowed and will be rendered properly. - -### `className` _(string)_ - Optional - -Additional CSS class to apply to the title container for custom styling. - -## User Interface - -The Title field renders as an `

` heading element within a container div. It doesn't display the standard field wrapper, label, or description elements that other field types use. +- `title` _(string)_ — The text to display as the section heading. HTML tags are allowed and will be rendered properly. ## Stored Value -The Title field type doesn't store any data in the database. It's purely for visual organization of your custom fields interface. +This field does not store any value. ## Example Usage @@ -38,9 +29,8 @@ The Title field type doesn't store any data in the database. It's purely for vis ```php 'general_section' => array( - 'type' => 'title', - 'id' => 'general_section', - 'title' => 'General Information', + 'type' => 'title', + 'title' => 'General Information', ), ``` @@ -48,9 +38,8 @@ The Title field type doesn't store any data in the database. It's purely for vis ```php 'advanced_section' => array( - 'type' => 'title', - 'id' => 'advanced_section', - 'title' => 'Advanced Settings Beta', + 'type' => 'title', + 'title' => 'Advanced Settings Beta', ), ``` @@ -59,79 +48,64 @@ The Title field type doesn't store any data in the database. It's purely for vis ```php // Example of using title fields to organize a complex form $fields = array( - 'general_section' => array( - 'type' => 'title', - 'id' => 'general_section', - 'title' => 'General Information', - ), - 'name' => array( - 'type' => 'text', - 'id' => 'name', - 'label' => 'Name', - 'required' => true, - ), - 'email' => array( - 'type' => 'email', - 'id' => 'email', - 'label' => 'Email Address', - 'required' => true, - ), - - 'appearance_section' => array( - 'type' => 'title', - 'id' => 'appearance_section', - 'title' => 'Appearance Settings', - ), - 'theme_color' => array( - 'type' => 'color', - 'id' => 'theme_color', - 'label' => 'Theme Color', - 'default' => '#3366cc', - ), - 'font_size' => array( - 'type' => 'select', - 'id' => 'font_size', - 'label' => 'Font Size', - 'options' => array( - 'small' => 'Small', - 'medium' => 'Medium', - 'large' => 'Large', - ), - ), - - 'advanced_section' => array( - 'type' => 'title', - 'id' => 'advanced_section', - 'title' => 'Advanced Options', - ), - // More fields... + 'general_section' => array( + 'type' => 'title', + 'title' => 'General Information', + ), + 'name' => array( + 'type' => 'text', + 'label' => 'Name', + 'required' => true, + ), + 'email' => array( + 'type' => 'email', + 'label' => 'Email Address', + 'required' => true, + ), + + 'appearance_section' => array( + 'type' => 'title', + 'title' => 'Appearance Settings', + ), + 'theme_color' => array( + 'type' => 'color', + 'label' => 'Theme Color', + 'default' => '#3366cc', + ), + 'font_size' => array( + 'type' => 'select', + 'label' => 'Font Size', + 'options' => array( + 'small' => 'Small', + 'medium' => 'Medium', + 'large' => 'Large', + ), + ), + + 'advanced_section' => array( + 'type' => 'title', + 'title' => 'Advanced Options', + ), + // More fields... ); ``` -## Styling Title Fields +## Field Factory -You can customize the appearance of title fields using CSS: - -```css -/* Target all title fields */ -.wpify-field-title h2 { - border-bottom: 1px solid #ddd; - padding-bottom: 10px; - color: #23282d; -} +```php +$f = new \Wpify\CustomFields\FieldFactory(); -/* Target a specific title field */ -.wpify-field-title--advanced_section h2 { - color: #dc3232; -} +$f->title( + title: 'Section Title', +); ``` ## Notes -- The Title field doesn't store or retrieve any data -- It's purely for visual organization of your custom fields interface -- Unlike most field types, it doesn't have a label or description -- It doesn't participate in validation or conditional logic evaluations -- The field can accept HTML in the title property, allowing for rich formatting -- Consider using title fields to break up long forms into logical sections -- When combined with the `tab` property for fields, you can organize complex forms with multiple sections under different tabs \ No newline at end of file +- The Title field does not store or retrieve any data. +- It is purely for visual organization of your custom fields interface. +- Unlike most field types, it does not have a label or description. +- The field renders as an `

` heading element within a container div. +- The field can accept HTML in the title property, allowing for rich formatting. +- Consider using title fields to break up long forms into logical sections. +- When combined with the `tab` property for fields, you can organize complex forms with multiple sections under different tabs. diff --git a/docs/field-types/toggle.md b/docs/field-types/toggle.md index c81571f3..a68c099b 100644 --- a/docs/field-types/toggle.md +++ b/docs/field-types/toggle.md @@ -1,37 +1,27 @@ # Toggle Field Type -The Toggle field type provides a modern on/off switch control for boolean values. It's a user-friendly alternative to checkboxes, offering a clear visual indication of the current state while taking up minimal space in the interface. +The Toggle field type provides a modern on/off switch control for boolean values. It is a user-friendly alternative to checkboxes, offering a clear visual indication of the current state while taking up minimal space in the interface. ## Field Type: `toggle` ```php array( - 'type' => 'toggle', - 'id' => 'example_toggle', - 'label' => 'Feature Setting', - 'title' => 'Enable this feature', + 'type' => 'toggle', + 'id' => 'example_toggle', + 'label' => 'Feature Setting', + 'title' => 'Enable this feature', ) ``` ## Properties -**For Default Field Properties, see [Field Types Definition](../field-types.md)**. +For Default Field Properties, see [Field Types Definition](../field-types.md). -### `title` _(string)_ - Required +### Specific Properties -The text displayed directly next to the toggle switch, explaining what the toggle controls. HTML tags are allowed in this property. - -### `default` _(boolean)_ - Optional, default: `false` - -The default state of the toggle (true for on, false for off). - -## User Interface +#### `title` _(string)_ — Required -The Toggle field renders as a switch control with: - -1. A label above (from the `label` property) -2. A title next to the switch (from the `title` property) -3. An animated switch that slides between on and off states +The text displayed directly next to the toggle switch, explaining what the toggle controls. HTML tags are allowed in this property. ## Stored Value @@ -45,12 +35,12 @@ The field stores a boolean value in the database: ```php 'enable_feature' => array( - 'type' => 'toggle', - 'id' => 'enable_feature', - 'label' => 'Feature Control', - 'title' => 'Enable this feature', - 'description' => 'Turn this feature on or off.', - 'default' => false, + 'type' => 'toggle', + 'id' => 'enable_feature', + 'label' => 'Feature Control', + 'title' => 'Enable this feature', + 'description' => 'Turn this feature on or off.', + 'default' => false, ), ``` @@ -58,79 +48,81 @@ The field stores a boolean value in the database: ```php 'show_related' => array( - 'type' => 'toggle', - 'id' => 'show_related', - 'label' => 'Related Content', - 'title' => 'Show related content (Recommended)', - 'default' => true, + 'type' => 'toggle', + 'id' => 'show_related', + 'label' => 'Related Content', + 'title' => 'Show related content (Recommended)', + 'default' => true, ), ``` -### Using Toggle Values in Your Theme +### Using Values in Your Theme ```php -// Get the toggle value from the meta field -$enable_feature = get_post_meta(get_the_ID(), 'enable_feature', true); +$enable_feature = get_post_meta( get_the_ID(), 'enable_feature', true ); // Convert to proper boolean if needed -$enable_feature = filter_var($enable_feature, FILTER_VALIDATE_BOOLEAN); - -if ($enable_feature) { - // Feature is enabled, implement the functionality - echo '
'; - // Feature content... - echo '
'; - - // Add specific classes or functionality - add_filter('body_class', function($classes) { - $classes[] = 'feature-enabled'; - return $classes; - }); +$enable_feature = filter_var( $enable_feature, FILTER_VALIDATE_BOOLEAN ); + +if ( $enable_feature ) { + echo '
'; + // Feature content... + echo '
'; + + add_filter( 'body_class', function ( $classes ) { + $classes[] = 'feature-enabled'; + return $classes; + } ); } ``` -### Toggle Field Controlling Other Fields +### With Conditional Logic Toggles are commonly used with conditional logic to show/hide other fields: ```php 'custom_colors' => array( - 'type' => 'toggle', - 'id' => 'custom_colors', - 'label' => 'Custom Colors', - 'title' => 'Use custom colors instead of theme defaults', - 'default' => false, + 'type' => 'toggle', + 'id' => 'custom_colors', + 'label' => 'Custom Colors', + 'title' => 'Use custom colors instead of theme defaults', + 'default' => false, ), 'primary_color' => array( - 'type' => 'color', - 'id' => 'primary_color', - 'label' => 'Primary Color', - 'description' => 'Select a custom primary color.', - 'conditions' => array( - array('field' => 'custom_colors', 'value' => true), - ), + 'type' => 'color', + 'id' => 'primary_color', + 'label' => 'Primary Color', + 'conditions' => array( + array( 'field' => 'custom_colors', 'value' => true ), + ), ), 'secondary_color' => array( - 'type' => 'color', - 'id' => 'secondary_color', - 'label' => 'Secondary Color', - 'description' => 'Select a custom secondary color.', - 'conditions' => array( - array('field' => 'custom_colors', 'value' => true), - ), + 'type' => 'color', + 'id' => 'secondary_color', + 'label' => 'Secondary Color', + 'conditions' => array( + array( 'field' => 'custom_colors', 'value' => true ), + ), ), ``` +## Field Factory + +```php +$f = new \Wpify\CustomFields\FieldFactory(); + +$f->toggle( + label: 'Feature', + title: 'Enable this feature', + default: false, +); +``` + ## Notes -- The Toggle field automatically updates its title to match the `title` property when toggled on -- When toggled off, the field title is empty -- Toggle fields are particularly useful for: - - Enabling/disabling features - - Showing/hiding additional form fields (with conditional logic) - - Boolean settings like yes/no or on/off options -- The field provides visual feedback when toggled, making it more intuitive than checkboxes +- The Toggle field automatically updates its title to match the `title` property when toggled on; when toggled off, the field title is empty +- Toggle fields are particularly useful for enabling/disabling features, showing/hiding additional form fields (with conditional logic), and boolean settings like yes/no or on/off options - The field validates as a boolean type when required -- Unlike checkboxes, the toggle UI clearly communicates its current state +- Unlike checkboxes, the toggle UI clearly communicates its current state with visual feedback - For multiple boolean options that should be toggled independently, use separate Toggle fields -- For selecting multiple options from a set, consider using the `multi_toggle` field type instead \ No newline at end of file +- For selecting multiple options from a set, consider using the `multi_toggle` field type instead diff --git a/docs/field-types/url.md b/docs/field-types/url.md index c76c0d05..c8b156cd 100644 --- a/docs/field-types/url.md +++ b/docs/field-types/url.md @@ -6,42 +6,28 @@ The URL field type provides a specialized input for collecting and validating we ```php array( - 'type' => 'url', - 'id' => 'example_url', - 'label' => 'Website', + 'type' => 'url', + 'id' => 'example_url', + 'label' => 'Website', ) ``` ## Properties -**For Default Field Properties, see [Field Types Definition](../field-types.md)**. +For Default Field Properties, see [Field Types Definition](../field-types.md). -### `attributes` _(array)_ - Optional +### Specific Properties -You can pass HTML attributes to the URL input field. For example: - -```php -'attributes' => array( - 'placeholder' => 'https://example.com', - 'class' => 'custom-url-field', -), -``` - -## User Interface - -The URL field provides a standard text input with: - -1. Type validation from the browser's native URL input -2. Automatic URL normalization when the field loses focus +This field type has no additional properties beyond the defaults. ## Stored Value The field stores the URL as a normalized string in the database. The normalization process: 1. Trims whitespace -2. Adds 'https://' prefix if no protocol is specified -3. Converts protocol-relative URLs (starting with '//') to use 'https:' -4. Blocks disallowed schemes like 'javascript:' or 'data:' for security +2. Adds `https://` prefix if no protocol is specified +3. Converts protocol-relative URLs (starting with `//`) to use `https:` +4. Blocks disallowed schemes like `javascript:` or `data:` for security 5. Validates the URL structure ## Example Usage @@ -49,90 +35,87 @@ The field stores the URL as a normalized string in the database. The normalizati ### Basic Website Field ```php -'company_website' => array( - 'type' => 'url', - 'id' => 'company_website', - 'label' => 'Company Website', - 'description' => 'Enter the company website URL.', - 'required' => true, - 'attributes' => array( - 'placeholder' => 'https://example.com', - ), -), +array( + 'type' => 'url', + 'id' => 'company_website', + 'label' => 'Company Website', + 'description' => 'Enter the company website URL.', + 'required' => true, + 'attributes' => array( + 'placeholder' => 'https://example.com', + ), +) ``` ### Social Media Link ```php -'twitter_profile' => array( - 'type' => 'url', - 'id' => 'twitter_profile', - 'label' => 'Twitter Profile', - 'description' => 'Enter your Twitter/X profile URL.', - 'attributes' => array( - 'placeholder' => 'https://twitter.com/username', - ), -), +array( + 'type' => 'url', + 'id' => 'twitter_profile', + 'label' => 'Twitter Profile', + 'description' => 'Enter your Twitter/X profile URL.', + 'attributes' => array( + 'placeholder' => 'https://twitter.com/username', + ), +) ``` -### Using URL Values in Your Theme +### Using Values in Your Theme ```php // Get the URL from the meta field -$company_website = get_post_meta(get_the_ID(), 'company_website', true); - -if (!empty($company_website)) { - echo ''; +$company_website = get_post_meta( get_the_ID(), 'company_website', true ); + +if ( ! empty( $company_website ) ) { + echo ''; } ``` -### URL Field with Conditional Logic +### With Conditional Logic ```php -'has_website' => array( - 'type' => 'toggle', - 'id' => 'has_website', - 'label' => 'Has Website', - 'title' => 'This company has a website', -), -'website_url' => array( - 'type' => 'url', - 'id' => 'website_url', - 'label' => 'Website URL', - 'description' => 'Enter the company website URL.', - 'conditions' => array( - array('field' => 'has_website', 'value' => true), - ), +array( + 'type' => 'toggle', + 'id' => 'has_website', + 'label' => 'Has Website', + 'title' => 'This company has a website', ), +array( + 'type' => 'url', + 'id' => 'website_url', + 'label' => 'Website URL', + 'description' => 'Enter the company website URL.', + 'conditions' => array( + array( 'field' => 'has_website', 'value' => true ), + ), +) ``` -## Security Features +## Field Factory -The URL field implements several security measures: +```php +$f = new \Wpify\CustomFields\FieldFactory(); -1. **Disallowed Schemes**: Blocks potentially dangerous URL schemes like `javascript:` and `data:` that could be used for XSS attacks -2. **HTTPS by Default**: Automatically upgrades URLs to use the HTTPS protocol -3. **URL Validation**: Ensures the URL has valid structure using the browser's native URL parser +$f->url( + label: 'Website URL', + required: true, +); +``` ## Notes - The URL field uses the browser's native URL input type, which may provide additional validation or specialized keyboards on mobile devices -- When the field loses focus, it automatically normalizes the URL +- When the field loses focus, it automatically normalizes the URL (adds `https://` prefix, blocks dangerous schemes) - When retrieving URL values for use in PHP, always use WordPress's `esc_url()` function when outputting the URL in HTML -- The field is particularly useful for: - - Website addresses - - Social media profiles - - Document URLs - - API endpoints - For multiple URLs, consider using the `multi_url` field type -- For more complex link data that includes both URL and text, consider using the `link` field type -- The field validates that a value is provided when the field is required \ No newline at end of file +- For more complex link data that includes both URL and text, consider using the [`link`](link.md) field type diff --git a/docs/field-types/week.md b/docs/field-types/week.md index 10793607..9df0ab52 100644 --- a/docs/field-types/week.md +++ b/docs/field-types/week.md @@ -6,35 +6,23 @@ The Week field type provides a specialized input for selecting a specific week o ```php array( - 'type' => 'week', - 'id' => 'example_week', - 'label' => 'Reporting Week', - 'min' => '2023-W01', - 'max' => '2023-W52', + 'type' => 'week', + 'id' => 'example_week', + 'label' => 'Reporting Week', + 'min' => '2023-W01', + 'max' => '2023-W52', ) ``` ## Properties -**For Default Field Properties, see [Field Types Definition](../field-types.md)**. +For Default Field Properties, see [Field Types Definition](../field-types.md). -### `min` _(string)_ - Optional +### Specific Properties -The earliest week that can be selected. The value should be in ISO format (YYYY-Www), where YYYY is the year and ww is the week number (e.g., `2023-W01`). +`min` _(string)_ — The earliest week that can be selected. The value should be in ISO format (YYYY-Www), where YYYY is the year and ww is the week number (e.g., `2023-W01`). -### `max` _(string)_ - Optional - -The latest week that can be selected. The value should be in ISO format (YYYY-Www). - -### `attributes` _(array)_ - Optional - -You can pass HTML attributes to the week input field. For example: - -```php -'attributes' => array( - 'class' => 'custom-week-picker', -), -``` +`max` _(string)_ — The latest week that can be selected. The value should be in ISO format (YYYY-Www). ## Stored Value @@ -46,11 +34,11 @@ The field stores the week value as a string in ISO format (YYYY-Www), for exampl ```php 'report_week' => array( - 'type' => 'week', - 'id' => 'report_week', - 'label' => 'Weekly Report Period', - 'description' => 'Select the week this report covers.', - 'required' => true, + 'type' => 'week', + 'id' => 'report_week', + 'label' => 'Weekly Report Period', + 'description' => 'Select the week this report covers.', + 'required' => true, ), ``` @@ -58,109 +46,105 @@ The field stores the week value as a string in ISO format (YYYY-Www), for exampl ```php 'fiscal_quarter_1' => array( - 'type' => 'week', - 'id' => 'fiscal_quarter_1', - 'label' => 'Q1 Planning Week', - 'description' => 'Select a week in the first quarter for planning.', - 'min' => date('Y') . '-W01', // First week of current year - 'max' => date('Y') . '-W13', // 13th week (roughly Q1) + 'type' => 'week', + 'id' => 'fiscal_quarter_1', + 'label' => 'Q1 Planning Week', + 'description' => 'Select a week in the first quarter for planning.', + 'min' => date( 'Y' ) . '-W01', // First week of current year + 'max' => date( 'Y' ) . '-W13', // 13th week (roughly Q1) ), ``` -### Current Year Weeks +### Using Values in Your Theme ```php -// Dynamic min/max constraints for the current year -'current_year_week' => array( - 'type' => 'week', - 'id' => 'current_year_week', - 'label' => 'Week Selection', - 'description' => 'Select a week in the current year.', - 'min' => date('Y') . '-W01', // First week of current year - 'max' => date('Y') . '-W52', // Last week of current year (may be W53 in some years) -), +// Get the week value from the meta field. +$report_week = get_post_meta( get_the_ID(), 'report_week', true ); + +if ( ! empty( $report_week ) ) { + // Parse the week value. + list( $year, $week_number ) = explode( '-W', $report_week ); + + // Calculate the date of the first day of the week (Monday). + $date = new DateTime(); + $date->setISODate( (int) $year, (int) $week_number ); + $start_date = $date->format( 'M j, Y' ); + + // Calculate the end date (Sunday). + $date->modify( '+6 days' ); + $end_date = $date->format( 'M j, Y' ); + + echo '
'; + echo 'Report Period: Week ' . esc_html( $week_number ) . ', ' . esc_html( $year ); + echo ' (' . esc_html( $start_date ) . ' to ' . esc_html( $end_date ) . ')'; + echo '
'; +} ``` -### Using Week Values in Your Theme +### Working with Week Data + +The ISO week format (YYYY-Www) requires some special handling to convert to dates: ```php -// Get the week value from the meta field -$report_week = get_post_meta(get_the_ID(), 'report_week', true); - -if (!empty($report_week)) { - // Parse the week value - list($year, $week_number) = explode('-W', $report_week); - - // Calculate the date of the first day of the week (Monday) - $date = new DateTime(); - $date->setISODate($year, $week_number); - $start_date = $date->format('M j, Y'); - - // Calculate the end date (Sunday) - $date->modify('+6 days'); - $end_date = $date->format('M j, Y'); - - echo '
'; - echo 'Report Period: Week ' . esc_html($week_number) . ', ' . esc_html($year); - echo ' (' . esc_html($start_date) . ' to ' . esc_html($end_date) . ')'; - echo '
'; +/** + * Convert a week string to start and end dates. + * + * @param string $week_string ISO week string (e.g., '2023-W16'). + * @return array Array with start and end dates. + */ +function convert_week_to_dates( $week_string ) { + list( $year, $week ) = explode( '-W', $week_string ); + + // Create DateTime object for the first day of the week (Monday). + $date_start = new DateTime(); + $date_start->setISODate( (int) $year, (int) $week ); + + // Create DateTime object for the last day of the week (Sunday). + $date_end = clone $date_start; + $date_end->modify( '+6 days' ); + + return array( + 'start' => $date_start, + 'end' => $date_end, + 'year' => (int) $year, + 'week' => (int) $week, + ); } + +// Usage. +$week_data = convert_week_to_dates( '2023-W16' ); +echo 'Week starts on: ' . esc_html( $week_data['start']->format( 'F j, Y' ) ); +echo 'Week ends on: ' . esc_html( $week_data['end']->format( 'F j, Y' ) ); ``` -### Week Field with Conditional Logic +### With Conditional Logic ```php 'weekly_report' => array( - 'type' => 'toggle', - 'id' => 'weekly_report', - 'label' => 'Weekly Report', - 'title' => 'Include weekly report data', + 'type' => 'toggle', + 'id' => 'weekly_report', + 'label' => 'Weekly Report', + 'title' => 'Include weekly report data', ), 'report_week' => array( - 'type' => 'week', - 'id' => 'report_week', - 'label' => 'Report Week', - 'description' => 'Select the week for this report.', - 'conditions' => array( - array('field' => 'weekly_report', 'value' => true), - ), + 'type' => 'week', + 'id' => 'report_week', + 'label' => 'Report Week', + 'description' => 'Select the week for this report.', + 'conditions' => array( + array( 'field' => 'weekly_report', 'value' => true ), + ), ), ``` -## Working with Week Data - -The ISO week format (YYYY-Www) requires some special handling to convert to dates: +## Field Factory ```php -/** - * Convert a week string to start and end dates - * - * @param string $week_string ISO week string (e.g., '2023-W16') - * @return array Array with start and end dates - */ -function convert_week_to_dates($week_string) { - list($year, $week) = explode('-W', $week_string); - - // Create DateTime object for the first day of the week (Monday) - $date_start = new DateTime(); - $date_start->setISODate((int)$year, (int)$week); - - // Create DateTime object for the last day of the week (Sunday) - $date_end = clone $date_start; - $date_end->modify('+6 days'); - - return array( - 'start' => $date_start, - 'end' => $date_end, - 'year' => (int)$year, - 'week' => (int)$week, - ); -} +$f = new \Wpify\CustomFields\FieldFactory(); -// Usage -$week_data = convert_week_to_dates('2023-W16'); -echo 'Week starts on: ' . $week_data['start']->format('F j, Y'); -echo 'Week ends on: ' . $week_data['end']->format('F j, Y'); +$f->week( + label: 'Start Week', +); ``` ## Notes @@ -170,6 +154,6 @@ echo 'Week ends on: ' . $week_data['end']->format('F j, Y'); - Weeks in ISO 8601 start on Monday and end on Sunday - The first week of the year (W01) is the week containing the first Thursday of the year - Some years have 53 weeks according to ISO 8601 -- When retrieving week values, use PHP's DateTime class with setISODate() to properly handle week calculations -- The field validates that a value is provided when the field is required -- The week format is particularly useful for applications requiring week-based reporting, scheduling, or planning \ No newline at end of file +- When retrieving week values, use PHP's DateTime class with `setISODate()` to properly handle week calculations +- The `min` and `max` constraints are passed through the field definition array; the FieldFactory method does not expose them as named parameters +- The week format is particularly useful for applications requiring week-based reporting, scheduling, or planning diff --git a/docs/field-types/wrapper.md b/docs/field-types/wrapper.md new file mode 100644 index 00000000..9f629d82 --- /dev/null +++ b/docs/field-types/wrapper.md @@ -0,0 +1,225 @@ +# Wrapper Field Type + +The Wrapper field type allows you to visually group multiple fields together without nesting their values. Unlike the [Group](group.md) field type, which stores child values in a nested array, the Wrapper is a purely visual container — its children store their values flat at the parent level. + +## Field Type: `wrapper` + +```php +array( + 'type' => 'wrapper', + 'items' => array( + 'name' => array( + 'type' => 'text', + 'label' => 'Name', + ), + 'email' => array( + 'type' => 'email', + 'label' => 'Email Address', + ), + 'phone' => array( + 'type' => 'tel', + 'label' => 'Phone Number', + ), + ), +) +``` + +## Properties + +For Default Field Properties, see [Field Types Definition](../field-types.md). + +### Specific Properties + +- `items` _(array)_ — An array of field definitions that make up the wrapper's content. Each item is a complete field definition with its own type, label, and other properties. +- `tag` _(string)_ — The HTML tag used for the wrapper container element. Defaults to `div`. You can use any valid HTML tag such as `section`, `fieldset`, `aside`, etc. +- `classname` _(string)_ — A CSS class name added to the wrapper container element. This is applied alongside the default `wpifycf-field-wrapper` class. + +## Stored Value + +This field does not store its own value. Children store their values flat at the parent level. + +### Comparison with Group + +Given the same child fields, here is how values are stored: + +**Group** stores nested values: + +```php +// group field with id 'contact_group' +array( + 'contact_group' => array( + 'name' => 'John Doe', + 'email' => 'john@example.com', + 'phone' => '555-123-4567', + ), +) +``` + +**Wrapper** stores flat values: + +```php +// wrapper field with id 'contact_wrapper' +// Children are stored at the same level as the wrapper: +array( + 'name' => 'John Doe', + 'email' => 'john@example.com', + 'phone' => '555-123-4567', +) +``` + +## Example Usage + +### Basic Visual Grouping + +Use a wrapper to visually separate a section of fields without affecting data structure: + +```php +'contact_section' => array( + 'type' => 'wrapper', + 'items' => array( + 'first_name' => array( + 'type' => 'text', + 'label' => 'First Name', + 'required' => true, + ), + 'last_name' => array( + 'type' => 'text', + 'label' => 'Last Name', + 'required' => true, + ), + 'email' => array( + 'type' => 'email', + 'label' => 'Email', + ), + ), +) +``` + +All three values (`first_name`, `last_name`, `email`) are stored flat at the root level. + +### Wrapper Inside a Group + +When a wrapper is placed inside a group, its children's values stay flat within the group's namespace: + +```php +'profile' => array( + 'type' => 'group', + 'label' => 'Profile', + 'items' => array( + 'avatar' => array( + 'type' => 'attachment', + 'label' => 'Avatar', + ), + 'details_wrapper' => array( + 'type' => 'wrapper', + 'items' => array( + 'bio' => array( + 'type' => 'textarea', + 'label' => 'Bio', + ), + 'website' => array( + 'type' => 'url', + 'label' => 'Website', + ), + ), + ), + ), +) +``` + +The stored value looks like this — `bio` and `website` sit alongside `avatar` inside the group: + +```php +array( + 'profile' => array( + 'avatar' => 123, + 'bio' => 'A short bio...', + 'website' => 'https://example.com', + ), +) +``` + +### Custom HTML Tag + +You can change the wrapper's HTML tag to add semantic meaning: + +```php +'settings_section' => array( + 'type' => 'wrapper', + 'tag' => 'section', + 'classname' => 'my-settings-section', + 'items' => array( + 'enable_feature' => array( + 'type' => 'toggle', + 'label' => 'Enable Feature', + 'title' => 'Turn on the advanced feature', + ), + 'feature_mode' => array( + 'type' => 'select', + 'label' => 'Feature Mode', + 'options' => array( + 'basic' => 'Basic', + 'advanced' => 'Advanced', + ), + ), + ), +) +``` + +### With Conditions + +Use a wrapper to show or hide a block of related fields together based on a condition: + +```php +'show_social' => array( + 'type' => 'toggle', + 'label' => 'Show Social Links', + 'title' => 'Display social media links', +), +'social_wrapper' => array( + 'type' => 'wrapper', + 'conditions' => array( + array( 'field' => 'show_social', 'value' => true ), + ), + 'items' => array( + 'twitter' => array( + 'type' => 'url', + 'label' => 'Twitter URL', + ), + 'facebook' => array( + 'type' => 'url', + 'label' => 'Facebook URL', + ), + 'linkedin' => array( + 'type' => 'url', + 'label' => 'LinkedIn URL', + ), + ), +) +``` + +When the toggle is off, all three social link fields are hidden together. + +## Field Factory + +```php +$f = new \Wpify\CustomFields\FieldFactory(); + +$f->wrapper( + items: array( + $f->text( label: 'First Name' ), + $f->text( label: 'Last Name' ), + ), + tag: 'div', + classname: 'my-wrapper', +); +``` + +## Notes + +- The key difference from the [Group](group.md) field type is that the wrapper does **not** nest values. Children store their values flat at the parent level. +- By default, the wrapper sets `renderOptions` to `noLabel: true`, `noFieldWrapper: true`, and `noControlWrapper: true`, so it renders with no label or extra wrapping markup. +- Wrapper children participate in validation at the parent level. The validation system flattens wrapper items using `flattenWrapperItems()` so each child is validated individually. +- Wrappers can be nested inside other wrappers or inside groups. +- In PHP, the `flatten_items()` method hoists wrapper children to the parent level for meta registration and sanitization. This ensures each child field is registered as its own meta key. +- The wrapper is ideal for applying conditions to a block of fields, adding semantic HTML structure, or visually organizing fields without changing how data is stored. diff --git a/docs/field-types/wysiwyg.md b/docs/field-types/wysiwyg.md index a2f0cee7..11303fb1 100644 --- a/docs/field-types/wysiwyg.md +++ b/docs/field-types/wysiwyg.md @@ -1,6 +1,6 @@ # WYSIWYG Field Type -The WYSIWYG (What You See Is What You Get) field type provides a rich text editor for creating formatted content. It integrates WordPress's TinyMCE editor, offering a familiar interface for creating HTML content with buttons for text formatting, links, lists, and more. +The WYSIWYG (What You See Is What You Get) field type provides a rich text editor powered by WordPress's TinyMCE, offering a familiar interface for creating HTML content with formatting, links, lists, and more. ## Field Type: `wysiwyg` @@ -15,72 +15,61 @@ array( ## Properties -### Default Field Properties +For Default Field Properties, see [Field Types Definition](../field-types.md). -These properties are available for all field types: +### Specific Properties -- `id` _(string)_ - Unique identifier for the field -- `type` _(string)_ - Must be set to `wysiwyg` for this field type -- `label` _(string)_ - The field label displayed in the admin interface -- `description` _(string)_ - Help text displayed below the field -- `required` _(boolean)_ - Whether the field must have a value -- `tab` _(string)_ - The tab ID where this field should appear (if using tabs) -- `className` _(string)_ - Additional CSS class for the field container -- `conditions` _(array)_ - Conditions that determine when to show this field -- `disabled` _(boolean)_ - Whether the field should be disabled -- `default` _(string)_ - Default HTML content for the editor -- `attributes` _(array)_ - HTML attributes to add to the field -- `unfiltered` _(boolean)_ - Whether the value should remain unfiltered when saved -- `render_options` _(array)_ - Options for customizing field rendering +#### `height` _(integer)_ — Optional -### Specific Properties +The height of the editor in pixels. Defaults to `200`. + +#### `toolbar` _(string)_ — Optional + +The toolbar configuration for the editor. Controls which formatting options are available. -#### `height` _(integer)_ - Optional, default: `200` +#### `delay` _(boolean)_ — Optional -The height of the editor in pixels. This controls the vertical size of the editing area. +When set to `true`, delays the initialization of the editor until the field is interacted with. -## User Interface +#### `tabs` _(string)_ — Optional -The WYSIWYG field provides a comprehensive editing experience with: +Controls the visibility of Visual/HTML editing tabs in the editor. -1. **Visual/HTML Tabs**: Switch between visual editing and HTML code view -2. **Formatting Toolbar**: Standard WordPress editor toolbar with formatting options -3. **Content Area**: The main editing area where content is created and formatted -4. **Modal Dialog**: When used within the Gutenberg editor, the WYSIWYG opens in a modal dialog +#### `force_modal` _(boolean)_ — Optional + +When set to `true`, forces the editor to always open in a modal dialog regardless of context. ## Stored Value -The field stores the content as HTML markup in the database. +The field stores the content as an HTML string in the database. ## Example Usage ### Basic Content Editor ```php -'product_description' => array( +array( 'type' => 'wysiwyg', 'id' => 'product_description', 'label' => 'Product Description', 'description' => 'Add a detailed product description with formatting.', 'height' => 300, -), +) ``` ### Editor with Initial Content ```php -'terms_conditions' => array( - 'type' => 'wysiwyg', - 'id' => 'terms_conditions', - 'label' => 'Terms and Conditions', - 'description' => 'Modify the default terms and conditions as needed.', - 'default' => '

Terms and Conditions

-

Welcome to our website. If you continue to browse and use this website, you are agreeing to comply with and be bound by the following terms and conditions of use.

-

The content of the pages of this website is for your general information and use only. It is subject to change without notice.

', -), +array( + 'type' => 'wysiwyg', + 'id' => 'terms_conditions', + 'label' => 'Terms and Conditions', + 'default' => '

Terms and Conditions

Welcome to our website.

', + 'height' => 400, +) ``` -### Using WYSIWYG Content in Your Theme +### Using Values in Your Theme ```php // Get the WYSIWYG content from the meta field @@ -88,27 +77,24 @@ $product_description = get_post_meta( get_the_ID(), 'product_description', true if ( ! empty( $product_description ) ) { echo '
'; - - // Apply WordPress filters to the content (optional) - echo apply_filters( 'the_content', $product_description ); - - // Or output the raw HTML content directly - // echo $product_description; - + + // Apply WordPress filters for auto-paragraphs and other content features + echo wp_kses_post( apply_filters( 'the_content', $product_description ) ); + echo '
'; } ``` -### WYSIWYG Field with Conditional Logic +### With Conditional Logic ```php -'show_extra_content' => array( +array( 'type' => 'toggle', 'id' => 'show_extra_content', 'label' => 'Additional Content', 'title' => 'Include additional content', ), -'extra_content' => array( +array( 'type' => 'wysiwyg', 'id' => 'extra_content', 'label' => 'Additional Content', @@ -117,41 +103,27 @@ if ( ! empty( $product_description ) ) { 'conditions' => array( array( 'field' => 'show_extra_content', 'value' => true ), ), -), +) ``` -## Modes - -The WYSIWYG editor provides two editing modes: - -### Visual Editor Mode +## Field Factory -The visual mode provides a WYSIWYG interface with formatting buttons similar to word processors. This is suitable for most users who want to create formatted content without writing HTML code directly. - -### HTML Mode - -The HTML mode provides a code editor view where you can directly edit the HTML markup. This is useful for: -- Adding custom HTML elements not available in the visual editor -- Fine-tuning the HTML structure -- Adding custom attributes to elements -- Including embedded content like iframes - -## Gutenberg Integration - -When used within the Gutenberg editor, the WYSIWYG field behaves slightly differently: +```php +$f = new \Wpify\CustomFields\FieldFactory(); -1. It initially displays as a preview of the content -2. Clicking the content or the "Edit" button opens a modal dialog with the full editor -3. The modal includes a fullscreen option for larger editing space -4. Changes are applied when clicking the "OK" button +$f->wysiwyg( + label: 'Content', + height: 300, + toolbar: 'full', +); +``` ## Notes -- The WYSIWYG field uses WordPress's TinyMCE editor, providing a familiar editing experience -- The editor includes the standard WordPress formatting options -- Content is stored as HTML, which can be output directly or processed with `apply_filters( 'the_content', $content )` -- The field tracks changes and updates the value as you type -- For simple text without formatting, consider using the `textarea` field type instead -- For code editing with syntax highlighting, use the `code` field type -- The field doesn't support file uploads directly through the editor - use separate attachment fields -- When displaying WYSIWYG content, apply WordPress's content filters with `apply_filters( 'the_content', $content )` to enable auto-paragraphs and other WordPress content features \ No newline at end of file +- The WYSIWYG field uses WordPress's TinyMCE editor, providing a familiar editing experience with standard formatting options +- The editor provides two editing modes: Visual (WYSIWYG) and HTML (code view) for direct markup editing +- When used within the Gutenberg editor, the field displays as a content preview; clicking it opens a modal dialog with the full editor and a fullscreen option +- Content is stored as HTML, which can be output with `wp_kses_post( apply_filters( 'the_content', $content ) )` to enable auto-paragraphs and other WordPress content features +- For simple text without formatting, consider using the [`textarea`](textarea.md) field type instead +- For code editing with syntax highlighting, use the [`code`](code.md) field type instead +- The field does not support file uploads directly through the editor; use separate [`attachment`](attachment.md) fields for media diff --git a/docs/index.md b/docs/index.md index 6f2d7c07..341b7b2b 100644 --- a/docs/index.md +++ b/docs/index.md @@ -87,6 +87,26 @@ Organize your custom fields into tabs. Learn how to create new custom field types. +### [► Field Factory](features/field-factory.md) + +Build field definitions with a fluent, IDE-friendly PHP API. + +### [► Generators](features/generators.md) + +Auto-populate field values (e.g., UUID) on first render. + +### [► Validation](features/validation.md) + +Client-side validation system for all field types. + +### [► REST API](features/rest-api.md) + +Internal REST endpoints used by field components. + +### [► Type Aliases](features/type-aliases.md) + +Backward-compatible field type name mappings. + ## Migration guides * [From v3.x to v4.x migration guide](migration-3-to-4.md) diff --git a/docs/integrations.md b/docs/integrations.md index 27104326..ee7490e8 100644 --- a/docs/integrations.md +++ b/docs/integrations.md @@ -23,4 +23,5 @@ * [Order Metabox](integrations/order-metabox.md) * [WooCommerce Settings](integrations/woocommerce-settings.md) * [Subscription Metabox](integrations/subscription-metabox.md) +* [Coupon Options](integrations/coupon-options.md) * [WooCommerce Membership Plan Options](integrations/wc-membership-plan-options.md) diff --git a/docs/integrations/coupon-options.md b/docs/integrations/coupon-options.md new file mode 100644 index 00000000..5a2f46eb --- /dev/null +++ b/docs/integrations/coupon-options.md @@ -0,0 +1,169 @@ +# Coupon Options Integration + +The Coupon Options integration allows you to add custom fields to WooCommerce coupon edit screens. Fields can be added to existing coupon data tabs or organized in new custom tabs. + +## Requirements + +- WooCommerce plugin must be installed and active. + +## Usage + +```php +$custom_fields = new \Wpify\CustomFields\CustomFields(); + +// Add fields to a new custom tab +$custom_fields->create_coupon_options( + array( + 'tab' => array( + 'label' => 'Custom Coupon Data', + 'priority' => 50, + ), + 'items' => array( + array( + 'id' => 'custom_text_field', + 'type' => 'text', + 'label' => 'Custom Text', + ), + array( + 'id' => 'custom_select', + 'type' => 'select', + 'label' => 'Options', + 'options' => array( + 'option1' => 'Option 1', + 'option2' => 'Option 2', + ), + ), + ), + ) +); + +// Add fields to an existing WooCommerce coupon tab +$custom_fields->create_coupon_options( + array( + 'tab' => array( + 'id' => 'general', // Use existing WooCommerce tab ID + 'label' => 'General', // For reference only, won't change original tab name + ), + 'items' => array( + array( + 'id' => 'custom_coupon_field', + 'type' => 'text', + 'label' => 'Additional Coupon Info', + 'description' => 'Enter additional coupon information', + ), + ), + ) +); +``` + +## Parameters + +### Required Parameters + +- `tab` (array): Information about the tab where fields will appear + - `label` (string): Tab display name + - `id` (string, optional): Unique ID (auto-generated from label if not provided) + - `target` (string, optional): Target container ID (defaults to tab id) + - `priority` (integer, optional): Order priority in tab list + - `class` (array, optional): CSS classes for the tab +- `items` (array): Array of field definitions to display + +### Optional Parameters + +- `capability` (string): Permission required to view/edit fields (default: 'manage_options') +- `callback` (callable): Function to run during field rendering +- `hook_priority` (integer): Priority for hooks (default: 10) +- `help_tabs` (array): Help tab information +- `help_sidebar` (string): Content for help sidebar +- `display` (callable|boolean): Boolean or callback to determine if fields should be displayed +- `meta_key` (string): Base meta key for storing values +- `tabs` (array): Additional tab configuration for organizing fields + +## Existing WooCommerce Coupon Tabs + +You can add fields to these existing WooCommerce coupon data tabs: + +- `general`: General coupon settings (discount type, amount, free shipping, expiry) +- `usage_restriction`: Usage restriction settings (minimum/maximum spend, products, categories) +- `usage_limits`: Usage limits settings (per-coupon limit, per-user limit) + +## Data Storage + +Custom field data is stored as coupon (post) meta. Each field is saved as a separate meta entry by default, or you can specify a `meta_key` to store all fields as a single meta entry. + +## Retrieving Data + +You can retrieve the custom field values from a coupon using standard WooCommerce methods: + +```php +$coupon = new WC_Coupon( $coupon_id ); +$custom_text = $coupon->get_meta( 'custom_text_field' ); +$custom_option = $coupon->get_meta( 'custom_select' ); +``` + +Alternatively, you can use WordPress functions since coupons are stored as posts: + +```php +$custom_text = get_post_meta( $coupon_id, 'custom_text_field', true ); +``` + +## Conditional Display + +You can conditionally display fields based on a callback function: + +```php +$custom_fields->create_coupon_options( + array( + 'tab' => array( + 'label' => 'Custom Data', + ), + 'items' => array( + // Field definitions + ), + 'display' => function( $coupon_id ) { + $coupon = new WC_Coupon( $coupon_id ); + + // Only show for percentage discount coupons + return $coupon->get_discount_type() === 'percent'; + }, + ) +); +``` + +## Organizing Fields in Tabs + +You can organize fields into tabs within your coupon data panel: + +```php +$custom_fields->create_coupon_options( + array( + 'tab' => array( + 'label' => 'Custom Data', + ), + 'tabs' => array( + array( + 'id' => 'first_tab', + 'label' => 'First Tab', + ), + array( + 'id' => 'second_tab', + 'label' => 'Second Tab', + ), + ), + 'items' => array( + array( + 'id' => 'field_in_first_tab', + 'type' => 'text', + 'label' => 'Field in First Tab', + 'tab' => 'first_tab', + ), + array( + 'id' => 'field_in_second_tab', + 'type' => 'text', + 'label' => 'Field in Second Tab', + 'tab' => 'second_tab', + ), + ), + ) +); +``` diff --git a/phpcs.xml b/phpcs.xml index c6e50a38..edfcc39f 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -152,4 +152,12 @@ /path/to/Tests/*Test\.php --> + + + + src/FieldFactory.php + + + src/FieldFactory.php + diff --git a/readme.md b/readme.md index aa81494b..7fdf8747 100644 --- a/readme.md +++ b/readme.md @@ -1,88 +1,263 @@ # WPify Custom Fields -WPify Custom Fields is a powerful, developer-oriented WordPress library for creating custom fields. It provides a comprehensive solution for integrating custom fields into various parts of WordPress and WooCommerce, from post metaboxes to product options, options pages, taxonomies, and much more. +![PHP 8.1+](https://img.shields.io/badge/PHP-8.1%2B-7A86B8) +![WordPress 6.2+](https://img.shields.io/badge/WordPress-6.2%2B-21759B) +![License](https://img.shields.io/badge/License-GPL--3.0--or--later-blue) +![Packagist Version](https://img.shields.io/packagist/v/wpify/custom-fields) -Built with modern React.js and PHP 8.1+, this library offers maximum flexibility for developers while maintaining a clean, intuitive interface for end-users. +A developer-oriented WordPress library for custom fields. 58 field types, 15 integration points (metaboxes, options pages, taxonomies, users, Gutenberg blocks, WooCommerce products/orders/coupons, and more), zero PHP dependencies, native WordPress storage — values are plain `get_post_meta()` / `get_option()` calls with no proprietary getters. -## Key Features +## Quick Start -- **Extensive Integration Options**: Add custom fields to 14+ different contexts: - - WordPress Core: Post Metaboxes, Taxonomies, Options Pages, Menu Items, Gutenberg Blocks, User Profiles, Comments - - WooCommerce: Product Options, Product Variations, Order Metaboxes, Settings Pages, Subscriptions, Membership Plans - - Multisite: Site Options, Network Options +```php +// Register a metabox with custom fields. +wpify_custom_fields()->create_metabox( + array( + 'id' => 'project_details', + 'title' => __( 'Project Details', 'my-plugin' ), + 'post_types' => array( 'post' ), + 'items' => array( + 'project_name' => array( + 'type' => 'text', + 'label' => __( 'Project Name', 'my-plugin' ), + 'required' => true, + ), + 'budget' => array( + 'type' => 'number', + 'label' => __( 'Budget', 'my-plugin' ), + ), + 'is_featured' => array( + 'type' => 'toggle', + 'label' => __( 'Featured', 'my-plugin' ), + 'title' => __( 'Show on the homepage', 'my-plugin' ), + ), + 'cover_image' => array( + 'type' => 'attachment', + 'label' => __( 'Cover Image', 'my-plugin' ), + 'conditions' => array( + array( 'field' => 'is_featured', 'value' => true ), + ), + ), + ), + ) +); +``` -- **50+ Field Types**: Build anything from simple forms to complex interfaces: - - Simple Fields: Text, Textarea, Number, Select, Toggle, Checkbox, Date/Time, Color, etc. - - Relational Fields: Post, Term, Attachment, Links - - Complex Fields: Group, Code Editor, WYSIWYG, Map integration - - Repeater Fields: Multi versions of all field types - - Static Fields: HTML, Button, Title, Hidden +Reading values — standard WordPress functions, no proprietary API required: -- **Powerful Conditional Logic**: Dynamically show/hide fields based on complex conditions: - - Multiple comparison operators (equals, contains, greater than, etc.) - - Complex AND/OR logic and nested condition groups - - Advanced path references with dot notation for nested fields +```php +$name = get_post_meta( $post_id, 'project_name', true ); +$image = get_post_meta( $post_id, 'cover_image', true ); // Attachment ID. +``` -- **Organized Field Groups**: Create better user experiences: - - Tabbed interface for organizing related fields - - Nested tabs for complex hierarchies - - Collapsible field groups +## Why This Library -- **Developer-Friendly**: - - Strong typing with PHP 8.1+ features - - Clean, standardized API - - Extendable architecture for custom field types - - Well-documented with consistent examples +- **58 field types** in 6 categories — from simple inputs to repeaters, groups, maps, code editors, and more +- **15 integration points** — post metaboxes, options pages, taxonomies, users, comments, menu items, Gutenberg blocks, WooCommerce products/variations/orders/coupons/settings/subscriptions/memberships, multisite +- **Native WordPress storage** — uses `post_meta`, `term_meta`, `options`, block attributes; no custom tables, no lock-in +- **Zero PHP dependencies** — a single Composer package, nothing extra to manage +- **Modern stack** — PHP 8.1+ with strict typing, React 18 UI, container queries, CSS custom properties +- **Conditional logic** — show/hide fields with 12 operators, AND/OR groups, nested conditions, dot-notation paths +- **Fluent FieldFactory API** — IDE-friendly PHP 8 named parameters with full autocomplete +- **Extensible** — register custom field types via PHP filters and JS hooks -## Requirements +## Field Types -- PHP 8.1 or later -- WordPress 6.2 or later -- Modern browser (Chrome, Firefox, Safari, Edge) +### Simple (22) -## Installation +| Type | Description | +|---|---| +| `text` | Single-line text input | +| `textarea` | Multi-line text input | +| `number` | Numeric input with min/max/step | +| `email` | Email address input | +| `password` | Password input | +| `tel` | Phone number input | +| `url` | URL input | +| `date` | Date picker | +| `datetime` | Date and time picker | +| `time` | Time picker | +| `month` | Month picker | +| `week` | Week picker | +| `date_range` | Start and end date pair | +| `select` | Dropdown select (sync or async options) | +| `multi_select` | Multiple selection dropdown | +| `radio` | Radio button group | +| `checkbox` | Single checkbox | +| `multi_checkbox` | Checkbox group | +| `toggle` | On/off switch | +| `multi_toggle` | Toggle group | +| `color` | Color picker | +| `range` | Range slider | -### Via Composer (Recommended) +### Relational (10) -```bash -composer require wpify/custom-fields +| Type | Description | +|---|---| +| `post` | Single post selector | +| `multi_post` | Multiple post selector | +| `term` | Single term selector | +| `multi_term` | Multiple term selector | +| `attachment` | Media library file picker | +| `multi_attachment` | Gallery / multiple files | +| `direct_file` | Direct file upload (no media library) | +| `multi_direct_file` | Multiple direct file uploads | +| `link` | Link with URL, title, and target | +| `multi_link` | Multiple links | + +### Complex (5) + +| Type | Description | +|---|---| +| `group` | Field group (nested fields) | +| `code` | Code editor with syntax highlighting | +| `wysiwyg` | TinyMCE rich text editor | +| `mapycz` | Mapy.cz map with coordinates | +| `inner_blocks` | Gutenberg InnerBlocks | + +### Repeater (14) + +| Type | Description | +|---|---| +| `multi_group` | Repeatable field group | +| `multi_text` | Repeatable text | +| `multi_textarea` | Repeatable textarea | +| `multi_number` | Repeatable number | +| `multi_email` | Repeatable email | +| `multi_tel` | Repeatable phone | +| `multi_url` | Repeatable URL | +| `multi_date` | Repeatable date | +| `multi_datetime` | Repeatable datetime | +| `multi_time` | Repeatable time | +| `multi_month` | Repeatable month | +| `multi_week` | Repeatable week | +| `multi_date_range` | Repeatable date range | +| `multi_mapycz` | Repeatable map | + +### Static (5) + +| Type | Description | +|---|---| +| `html` | Custom HTML content | +| `button` | Action button | +| `multi_button` | Button group | +| `title` | Section title / heading | +| `hidden` | Hidden input | + +### Visual (2) + +| Type | Description | +|---|---| +| `wrapper` | Visual wrapper around fields | +| `columns` | Multi-column layout | + +## Integration Points + +### WordPress Core + +| Method | Context | +|---|---| +| `create_metabox()` | Post / CPT meta box | +| `create_gutenberg_block()` | Gutenberg block | +| `create_options_page()` | Admin options page | +| `create_taxonomy_options()` | Taxonomy term fields | +| `create_user_options()` | User profile fields | +| `create_comment_metabox()` | Comment meta fields | +| `create_menu_item_options()` | Nav menu item fields | + +### WooCommerce + +| Method | Context | +|---|---| +| `create_product_options()` | Product data tab | +| `create_product_variation_options()` | Product variation fields | +| `create_order_metabox()` | Order meta box (HPOS compatible) | +| `create_woocommerce_settings()` | WooCommerce settings tab | +| `create_coupon_options()` | Coupon fields | +| `create_subscription_metabox()` | Subscription meta box | +| `create_membership_plan_options()` | Membership plan fields | + +### Multisite + +| Method | Context | +|---|---| +| `create_site_options()` | Site options page | + +All methods are called on the `wpify_custom_fields()` singleton instance. + +## Features + +### Conditional Logic + +Show or hide fields based on other field values: + +```php +'show_subtitle' => array( + 'type' => 'toggle', + 'label' => __( 'Show Subtitle', 'my-plugin' ), +), +'subtitle' => array( + 'type' => 'text', + 'label' => __( 'Subtitle', 'my-plugin' ), + 'conditions' => array( + array( 'field' => 'show_subtitle', 'value' => true ), + ), +), ``` -### Manual Installation +Supported operators: `==`, `!=`, `>`, `>=`, `<`, `<=`, `between`, `contains`, `not_contains`, `in`, `not_in`, `empty`, `not_empty`. Conditions support AND/OR logic, nested groups, and dot-notation paths for nested fields. -1. Download the latest release from the [Releases page](https://github.com/wpify/custom-fields/releases) -2. Upload to your `/wp-content/plugins/` directory -3. Activate through the WordPress admin interface +### Tabs -## Quick Example +Organize fields into a tabbed interface: ```php -// Create a custom metabox for posts wpify_custom_fields()->create_metabox( array( - 'id' => 'demo_metabox', - 'title' => __( 'Demo Metabox', 'textdomain' ), - 'post_type' => 'post', - 'items' => array( - 'text_field' => array( - 'type' => 'text', - 'label' => __( 'Text Field', 'textdomain' ), - 'description' => __( 'This is a simple text field', 'textdomain' ), - 'required' => true, + 'id' => 'my_metabox', + 'title' => __( 'Settings', 'my-plugin' ), + 'tabs' => array( + 'general' => __( 'General', 'my-plugin' ), + 'advanced' => __( 'Advanced', 'my-plugin' ), + ), + 'items' => array( + 'title' => array( + 'type' => 'text', + 'label' => __( 'Title', 'my-plugin' ), + 'tab' => 'general', ), - 'select_field' => array( - 'type' => 'select', - 'label' => __( 'Select Field', 'textdomain' ), - 'options' => array( - 'option1' => __( 'Option 1', 'textdomain' ), - 'option2' => __( 'Option 2', 'textdomain' ), - ), - 'conditions' => array( - array( - 'field' => 'text_field', - 'condition' => '!=', - 'value' => '', - ), + 'custom_css' => array( + 'type' => 'code', + 'label' => __( 'Custom CSS', 'my-plugin' ), + 'language' => 'css', + 'tab' => 'advanced', + ), + ), + ) +); +``` + +### Fluent FieldFactory API + +Build field definitions with PHP 8 named parameters and full IDE autocomplete: + +```php +$f = wpify_custom_fields()->field_factory; + +wpify_custom_fields()->create_metabox( + array( + 'id' => 'team_metabox', + 'title' => __( 'Team', 'my-plugin' ), + 'post_types' => array( 'page' ), + 'items' => array( + 'team_members' => $f->multi_group( + label: __( 'Team Members', 'my-plugin' ), + min: 1, + max: 20, + items: array( + 'name' => $f->text( label: __( 'Name', 'my-plugin' ), required: true ), + 'role' => $f->text( label: __( 'Role', 'my-plugin' ) ), + 'photo' => $f->attachment( label: __( 'Photo', 'my-plugin' ), attachment_type: 'image' ), ), ), ), @@ -90,31 +265,54 @@ wpify_custom_fields()->create_metabox( ); ``` -## Why Choose WPify Custom Fields? +### Extensibility -- **Flexible API**: Provides a consistent API across all WordPress and WooCommerce contexts -- **Modern Architecture**: Built with React and modern PHP principles -- **Performance Optimized**: Loads only the resources needed for each context -- **Comprehensive Solution**: No need for multiple plugins to handle different field contexts -- **Future-Proof**: Regularly updated and maintained -- **Extendable**: Create custom field types when needed +- **PHP filters**: `wpifycf_sanitize_{type}`, `wpifycf_wp_type_{type}`, `wpifycf_default_value_{type}`, `wpifycf_items` +- **JS hooks** (`@wordpress/hooks`): `wpifycf_field_{type}`, `wpifycf_definition`, `wpifycf_generator_{name}` -## Documentation +See the [Extending documentation](docs/features/extending.md) for a full guide on creating custom field types. -For comprehensive documentation, visit: +## Installation -- [Main Documentation](docs/index.md) +### Via Composer (Recommended) + +```bash +composer require wpify/custom-fields +``` + +Include the Composer autoloader in your plugin or theme: + +```php +require_once __DIR__ . '/vendor/autoload.php'; +``` + +### As a WordPress Plugin + +Download from the [Releases page](https://github.com/wpify/custom-fields/releases), upload to `/wp-content/plugins/`, and activate. + +## Requirements + +- PHP 8.1+ +- WordPress 6.2+ +- `ext-json` +- Modern browser (Chrome, Firefox, Safari, Edge) +- WooCommerce 8.0+ (optional, for WooCommerce integrations) + +## Documentation + +- [Getting Started](docs/index.md) - [Field Types](docs/field-types.md) - [Integrations](docs/integrations.md) - [Conditional Logic](docs/features/conditions.md) -- [Tabs System](docs/features/tabs.md) +- [Tabs](docs/features/tabs.md) +- [Validation](docs/features/validation.md) +- [Field Factory](docs/features/field-factory.md) +- [Generators](docs/features/generators.md) - [Extending](docs/features/extending.md) +- [REST API](docs/features/rest-api.md) +- [Type Aliases](docs/features/type-aliases.md) - [Migration from 3.x to 4.x](docs/migration-3-to-4.md) -## Support & Issues - -If you encounter any issues or have questions, please [open an issue](https://github.com/wpify/custom-fields/issues) on our GitHub repository. - ## License -WPify Custom Fields is released under the GPL v2 or later license. +WPify Custom Fields is released under the [GPL-3.0-or-later](https://www.gnu.org/licenses/gpl-3.0.html) license. diff --git a/src/CustomFields.php b/src/CustomFields.php index ae25256c..93842fa1 100644 --- a/src/CustomFields.php +++ b/src/CustomFields.php @@ -55,6 +55,13 @@ class CustomFields { */ public readonly DirectFileField $direct_file_field; + /** + * FieldFactory class. + * + * @var FieldFactory + */ + public readonly FieldFactory $field_factory; + /** * Custom fields constructor. */ @@ -62,6 +69,7 @@ public function __construct() { $this->helpers = new Helpers(); $this->api = new Api( $this, $this->helpers ); $this->direct_file_field = new DirectFileField( $this ); + $this->field_factory = new FieldFactory(); $this->init_temp_cleanup(); } @@ -361,6 +369,30 @@ public function get_script_handle(): string { return 'wpifycf_' . str_replace( '/', '_', $this->get_api_basename() ); } + /** + * Recursively flattens wrapper items, hoisting their children to the parent level. + * + * Wrapper fields are purely visual containers and do not nest values. + * This method is used by storage operations to iterate over actual data fields. + * + * @param array $items The items array, potentially containing wrapper items. + * + * @return array Flattened items with wrapper children promoted to the parent level. + */ + public function flatten_items( array $items ): array { + $result = array(); + + foreach ( $items as $item ) { + if ( in_array( $item['type'] ?? '', array( 'wrapper', 'columns' ), true ) && ! empty( $item['items'] ) ) { + $result = array_merge( $result, $this->flatten_items( $item['items'] ) ); + } else { + $result[] = $item; + } + } + + return $result; + } + /** * Sanitizes a given item's value based on its type using a closure. * @@ -412,7 +444,7 @@ public function sanitize_item_value( array $item ): Closure { } elseif ( 'group' === $item['type'] ) { $value = is_string( $value ) ? json_decode( $value, true ) : (array) $value; $sanitized_value = $value; - foreach ( $item['items'] as $sub_item ) { + foreach ( $this->flatten_items( $item['items'] ) as $sub_item ) { $sanitized_value[ $sub_item['id'] ] = $this->sanitize_item_value( $sub_item )( $value[ $sub_item['id'] ] ?? null ); } } elseif ( 'link' === $item['type'] ) { @@ -495,6 +527,8 @@ public function sanitize_item_value( array $item ): Closure { * @return Closure A closure that accepts an array of values to be sanitized and returns the sanitized array. */ public function sanitize_option_value( array $items = array(), mixed $previous_value = array() ): Closure { + $items = $this->flatten_items( $items ); + return function ( array $value = array() ) use ( $items, $previous_value ): array { $next_value = is_array( $previous_value ) ? $previous_value : array(); foreach ( $items as $item ) { @@ -558,6 +592,10 @@ public function get_wp_type( array $item ): string { * @return mixed The default value for the item. */ public function get_default_value( array $item ): mixed { + if ( in_array( $item['type'] ?? '', array( 'wrapper', 'columns' ), true ) ) { + return null; + } + if ( isset( $item['default'] ) ) { $default_value = $item['default']; } elseif ( 'date_range' === $item['type'] ) { diff --git a/src/FieldFactory.php b/src/FieldFactory.php new file mode 100644 index 00000000..65914085 --- /dev/null +++ b/src/FieldFactory.php @@ -0,0 +1,2842 @@ + $type ); + + foreach ( $type_args as $key => $value ) { + if ( null !== $value ) { + $field[ $key ] = $value; + } + } + + foreach ( $common_args as $key => $value ) { + if ( 'default' === $key ) { + if ( self::UNSET !== $value ) { + $field['default'] = $value; + } + } elseif ( null !== $value ) { + $field[ $key ] = $value; + } + } + + return $field; + } + + /** + * Extracts common parameters by removing type-specific keys from all variables. + * + * @param array $all_vars The result of get_defined_vars() inside a field method. + * @param array $exclude Keys to exclude (type-specific parameter names). + * + * @return array The remaining common parameters. + */ + private function extract_common( array $all_vars, array $exclude = array() ): array { + foreach ( $exclude as $key ) { + unset( $all_vars[ $key ] ); + } + + // Remap snake_case PHP parameters to camelCase keys expected by JS. + $remap = array( + 'class_name' => 'className', + 'force_modal' => 'forceModal', + ); + + foreach ( $remap as $snake => $camel ) { + if ( array_key_exists( $snake, $all_vars ) ) { + $all_vars[ $camel ] = $all_vars[ $snake ]; + unset( $all_vars[ $snake ] ); + } + } + + return $all_vars; + } + + /** + * Creates a text field definition. + * + * @param bool|null $counter Whether to show a character counter. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function text( + ?bool $counter = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'text', + array( 'counter' => $counter ), + $this->extract_common( get_defined_vars(), array( 'counter' ) ), + ); + } + + /** + * Creates a textarea field definition. + * + * @param bool|null $counter Whether to show a character counter. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function textarea( + ?bool $counter = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'textarea', + array( 'counter' => $counter ), + $this->extract_common( get_defined_vars(), array( 'counter' ) ), + ); + } + + /** + * Creates an email field definition. + * + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function email( + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'email', + array(), + $this->extract_common( get_defined_vars() ), + ); + } + + /** + * Creates a password field definition. + * + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function password( + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'password', + array(), + $this->extract_common( get_defined_vars() ), + ); + } + + /** + * Creates a tel field definition. + * + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function tel( + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'tel', + array(), + $this->extract_common( get_defined_vars() ), + ); + } + + /** + * Creates a url field definition. + * + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function url( + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'url', + array(), + $this->extract_common( get_defined_vars() ), + ); + } + + /** + * Creates a number field definition. + * + * @param float|null $min Minimum value. + * @param float|null $max Maximum value. + * @param float|null $step Step increment. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function number( + ?float $min = null, + ?float $max = null, + ?float $step = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'number', + array( + 'min' => $min, + 'max' => $max, + 'step' => $step, + ), + $this->extract_common( get_defined_vars(), array( 'min', 'max', 'step' ) ), + ); + } + + /** + * Creates a range field definition. + * + * @param float|null $min Minimum value. + * @param float|null $max Maximum value. + * @param float|null $step Step increment. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function range( + ?float $min = null, + ?float $max = null, + ?float $step = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'range', + array( + 'min' => $min, + 'max' => $max, + 'step' => $step, + ), + $this->extract_common( get_defined_vars(), array( 'min', 'max', 'step' ) ), + ); + } + + /** + * Creates a date field definition. + * + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function date( + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'date', + array(), + $this->extract_common( get_defined_vars() ), + ); + } + + /** + * Creates a datetime field definition. + * + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function datetime( + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'datetime', + array(), + $this->extract_common( get_defined_vars() ), + ); + } + + /** + * Creates a time field definition. + * + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function time( + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'time', + array(), + $this->extract_common( get_defined_vars() ), + ); + } + + /** + * Creates a month field definition. + * + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function month( + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'month', + array(), + $this->extract_common( get_defined_vars() ), + ); + } + + /** + * Creates a week field definition. + * + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function week( + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'week', + array(), + $this->extract_common( get_defined_vars() ), + ); + } + + /** + * Creates a color field definition. + * + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function color( + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'color', + array(), + $this->extract_common( get_defined_vars() ), + ); + } + + /** + * Creates a checkbox field definition. + * + * @param string|null $title Checkbox title text. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function checkbox( + ?string $title = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'checkbox', + array( 'title' => $title ), + $this->extract_common( get_defined_vars(), array( 'title' ) ), + ); + } + + /** + * Creates a toggle field definition. + * + * @param string|null $title Toggle title text. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function toggle( + ?string $title = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'toggle', + array( 'title' => $title ), + $this->extract_common( get_defined_vars(), array( 'title' ) ), + ); + } + + /** + * Creates a hidden field definition. + * + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function hidden( + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'hidden', + array(), + $this->extract_common( get_defined_vars() ), + ); + } + + /** + * Creates a select field definition. + * + * @param array|null $options Select options. + * @param string|null $options_key Options key for dynamic options. + * @param array|null $async_params Async loading parameters. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function select( + ?array $options = null, + ?string $options_key = null, + ?array $async_params = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'select', + array( + 'options' => $options, + 'options_key' => $options_key, + 'async_params' => $async_params, + ), + $this->extract_common( get_defined_vars(), array( 'options', 'options_key', 'async_params' ) ), + ); + } + + /** + * Creates a radio field definition. + * + * @param array|null $options Radio options. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function radio( + ?array $options = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'radio', + array( 'options' => $options ), + $this->extract_common( get_defined_vars(), array( 'options' ) ), + ); + } + + /** + * Creates a code editor field definition. + * + * @param string|null $language Code language for syntax highlighting. + * @param int|null $height Editor height in pixels. + * @param string|null $theme Editor theme. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function code( + ?string $language = null, + ?int $height = null, + ?string $theme = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'code', + array( + 'language' => $language, + 'height' => $height, + 'theme' => $theme, + ), + $this->extract_common( get_defined_vars(), array( 'language', 'height', 'theme' ) ), + ); + } + + /** + * Creates a WYSIWYG editor field definition. + * + * @param int|null $height Editor height in pixels. + * @param string|null $toolbar Toolbar configuration. + * @param bool|null $delay Whether to delay initialization. + * @param string|null $tabs Visible tabs configuration. + * @param bool|null $force_modal Whether to force modal editing. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function wysiwyg( + ?int $height = null, + ?string $toolbar = null, + ?bool $delay = null, + ?string $tabs = null, + ?bool $force_modal = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'wysiwyg', + array( + 'height' => $height, + 'toolbar' => $toolbar, + 'delay' => $delay, + 'tabs' => $tabs, + 'forceModal' => $force_modal, + ), + $this->extract_common( get_defined_vars(), array( 'height', 'toolbar', 'delay', 'tabs', 'force_modal' ) ), + ); + } + + /** + * Creates an attachment field definition. + * + * @param string|null $attachment_type Allowed attachment type (e.g. image, video). + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function attachment( + ?string $attachment_type = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'attachment', + array( 'attachment_type' => $attachment_type ), + $this->extract_common( get_defined_vars(), array( 'attachment_type' ) ), + ); + } + + /** + * Creates a direct file upload field definition. + * + * @param array|null $allowed_types Allowed MIME types. + * @param int|null $max_size Maximum file size in bytes. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function direct_file( + ?array $allowed_types = null, + ?int $max_size = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'direct_file', + array( + 'allowed_types' => $allowed_types, + 'max_size' => $max_size, + ), + $this->extract_common( get_defined_vars(), array( 'allowed_types', 'max_size' ) ), + ); + } + + /** + * Creates a post field definition. + * + * @param string|array|null $post_type Post type(s) to query. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function post( + string|array|null $post_type = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'post', + array( 'post_type' => $post_type ), + $this->extract_common( get_defined_vars(), array( 'post_type' ) ), + ); + } + + /** + * Creates a term field definition. + * + * @param string|null $taxonomy Taxonomy to query. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function term( + ?string $taxonomy = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'term', + array( 'taxonomy' => $taxonomy ), + $this->extract_common( get_defined_vars(), array( 'taxonomy' ) ), + ); + } + + /** + * Creates a link field definition. + * + * @param string|array|null $post_type Post type(s) for post picker. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function link( + string|array|null $post_type = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'link', + array( 'post_type' => $post_type ), + $this->extract_common( get_defined_vars(), array( 'post_type' ) ), + ); + } + + /** + * Creates a Mapy.cz map field definition. + * + * @param string|null $lang Map language. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function mapycz( + ?string $lang = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'mapycz', + array( 'lang' => $lang ), + $this->extract_common( get_defined_vars(), array( 'lang' ) ), + ); + } + + /** + * Creates an HTML field definition. + * + * @param string|null $content HTML content to display. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function html( + ?string $content = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'html', + array( 'content' => $content ), + $this->extract_common( get_defined_vars(), array( 'content' ) ), + ); + } + + /** + * Creates a title field definition. + * + * @param string|null $title Title text to display. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function title( + ?string $title = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'title', + array( 'title' => $title ), + $this->extract_common( get_defined_vars(), array( 'title' ) ), + ); + } + + /** + * Creates a button field definition. + * + * @param string|null $title Button text. + * @param string|null $action Button action identifier. + * @param string|null $url Button URL. + * @param string|null $target Link target attribute. + * @param bool|null $primary Whether the button is a primary button. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function button( + ?string $title = null, + ?string $action = null, + ?string $url = null, + ?string $target = null, + ?bool $primary = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'button', + array( + 'title' => $title, + 'action' => $action, + 'url' => $url, + 'target' => $target, + 'primary' => $primary, + ), + $this->extract_common( get_defined_vars(), array( 'title', 'action', 'url', 'target', 'primary' ) ), + ); + } + + /** + * Creates a multi-button field definition. + * + * @param array|null $buttons Array of button definitions. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function multi_button( + ?array $buttons = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'multi_button', + array( 'buttons' => $buttons ), + $this->extract_common( get_defined_vars(), array( 'buttons' ) ), + ); + } + + /** + * Creates a group field definition. + * + * @param array $items Child field definitions. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function group( + array $items = array(), + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'group', + array( 'items' => $items ), + $this->extract_common( get_defined_vars(), array( 'items' ) ), + ); + } + + /** + * Creates a wrapper field definition. + * + * @param array $items Child field definitions. + * @param string|null $tag HTML tag for the wrapper. + * @param string|null $classname CSS class for the wrapper element. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function wrapper( + array $items = array(), + ?string $tag = null, + ?string $classname = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'wrapper', + array( + 'items' => $items, + 'tag' => $tag, + 'classname' => $classname, + ), + $this->extract_common( get_defined_vars(), array( 'items', 'tag', 'classname' ) ), + ); + } + + /** + * Creates a columns layout field definition. + * + * @param array $items Child field definitions. + * @param int|null $columns Number of columns (default 2). + * @param string|null $gap CSS gap override. + * @param string|null $classname CSS class for the columns element. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function columns( + array $items = array(), + ?int $columns = null, + ?string $gap = null, + ?string $classname = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'columns', + array( + 'items' => $items, + 'columns' => $columns, + 'gap' => $gap, + 'classname' => $classname, + ), + $this->extract_common( get_defined_vars(), array( 'items', 'columns', 'gap', 'classname' ) ), + ); + } + + /** + * Creates an inner blocks field definition for Gutenberg. + * + * @param array|null $allowed_blocks Allowed block types. + * @param array|null $template Block template. + * @param string|null $template_lock Template lock mode. + * @param string|null $orientation Block orientation. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function inner_blocks( + ?array $allowed_blocks = null, + ?array $template = null, + ?string $template_lock = null, + ?string $orientation = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'inner_blocks', + array( + 'allowed_blocks' => $allowed_blocks, + 'template' => $template, + 'template_lock' => $template_lock, + 'orientation' => $orientation, + ), + $this->extract_common( get_defined_vars(), array( 'allowed_blocks', 'template', 'template_lock', 'orientation' ) ), + ); + } + + /** + * Creates a date range field definition. + * + * @param string|null $min Minimum date. + * @param string|null $max Maximum date. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function date_range( + ?string $min = null, + ?string $max = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'date_range', + array( + 'min' => $min, + 'max' => $max, + ), + $this->extract_common( get_defined_vars(), array( 'min', 'max' ) ), + ); + } + + // ------------------------------------------------------------------------- + // Multi-field variants + // ------------------------------------------------------------------------- + + /** + * Creates a multi-text field definition. + * + * @param bool|null $counter Whether to show a character counter. + * @param int|null $min Minimum number of items. + * @param int|null $max Maximum number of items. + * @param array|null $buttons Custom buttons for the multi-field. + * @param array|null $disabled_buttons Buttons to disable. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function multi_text( + ?bool $counter = null, + ?int $min = null, + ?int $max = null, + ?array $buttons = null, + ?array $disabled_buttons = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'multi_text', + array( + 'counter' => $counter, + 'min' => $min, + 'max' => $max, + 'buttons' => $buttons, + 'disabled_buttons' => $disabled_buttons, + ), + $this->extract_common( get_defined_vars(), array( 'counter', 'min', 'max', 'buttons', 'disabled_buttons' ) ), + ); + } + + /** + * Creates a multi-textarea field definition. + * + * @param bool|null $counter Whether to show a character counter. + * @param int|null $min Minimum number of items. + * @param int|null $max Maximum number of items. + * @param array|null $buttons Custom buttons for the multi-field. + * @param array|null $disabled_buttons Buttons to disable. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function multi_textarea( + ?bool $counter = null, + ?int $min = null, + ?int $max = null, + ?array $buttons = null, + ?array $disabled_buttons = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'multi_textarea', + array( + 'counter' => $counter, + 'min' => $min, + 'max' => $max, + 'buttons' => $buttons, + 'disabled_buttons' => $disabled_buttons, + ), + $this->extract_common( get_defined_vars(), array( 'counter', 'min', 'max', 'buttons', 'disabled_buttons' ) ), + ); + } + + /** + * Creates a multi-email field definition. + * + * @param int|null $min Minimum number of items. + * @param int|null $max Maximum number of items. + * @param array|null $buttons Custom buttons for the multi-field. + * @param array|null $disabled_buttons Buttons to disable. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function multi_email( + ?int $min = null, + ?int $max = null, + ?array $buttons = null, + ?array $disabled_buttons = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'multi_email', + array( + 'min' => $min, + 'max' => $max, + 'buttons' => $buttons, + 'disabled_buttons' => $disabled_buttons, + ), + $this->extract_common( get_defined_vars(), array( 'min', 'max', 'buttons', 'disabled_buttons' ) ), + ); + } + + /** + * Creates a multi-tel field definition. + * + * @param int|null $min Minimum number of items. + * @param int|null $max Maximum number of items. + * @param array|null $buttons Custom buttons for the multi-field. + * @param array|null $disabled_buttons Buttons to disable. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function multi_tel( + ?int $min = null, + ?int $max = null, + ?array $buttons = null, + ?array $disabled_buttons = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'multi_tel', + array( + 'min' => $min, + 'max' => $max, + 'buttons' => $buttons, + 'disabled_buttons' => $disabled_buttons, + ), + $this->extract_common( get_defined_vars(), array( 'min', 'max', 'buttons', 'disabled_buttons' ) ), + ); + } + + /** + * Creates a multi-url field definition. + * + * @param int|null $min Minimum number of items. + * @param int|null $max Maximum number of items. + * @param array|null $buttons Custom buttons for the multi-field. + * @param array|null $disabled_buttons Buttons to disable. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function multi_url( + ?int $min = null, + ?int $max = null, + ?array $buttons = null, + ?array $disabled_buttons = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'multi_url', + array( + 'min' => $min, + 'max' => $max, + 'buttons' => $buttons, + 'disabled_buttons' => $disabled_buttons, + ), + $this->extract_common( get_defined_vars(), array( 'min', 'max', 'buttons', 'disabled_buttons' ) ), + ); + } + + /** + * Creates a multi-number field definition. + * + * @param float|null $step Step increment for each number field. + * @param int|null $min Minimum number of items. + * @param int|null $max Maximum number of items. + * @param array|null $buttons Custom buttons for the multi-field. + * @param array|null $disabled_buttons Buttons to disable. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function multi_number( + ?float $step = null, + ?int $min = null, + ?int $max = null, + ?array $buttons = null, + ?array $disabled_buttons = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'multi_number', + array( + 'step' => $step, + 'min' => $min, + 'max' => $max, + 'buttons' => $buttons, + 'disabled_buttons' => $disabled_buttons, + ), + $this->extract_common( get_defined_vars(), array( 'step', 'min', 'max', 'buttons', 'disabled_buttons' ) ), + ); + } + + /** + * Creates a multi-date field definition. + * + * @param int|null $min Minimum number of items. + * @param int|null $max Maximum number of items. + * @param array|null $buttons Custom buttons for the multi-field. + * @param array|null $disabled_buttons Buttons to disable. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function multi_date( + ?int $min = null, + ?int $max = null, + ?array $buttons = null, + ?array $disabled_buttons = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'multi_date', + array( + 'min' => $min, + 'max' => $max, + 'buttons' => $buttons, + 'disabled_buttons' => $disabled_buttons, + ), + $this->extract_common( get_defined_vars(), array( 'min', 'max', 'buttons', 'disabled_buttons' ) ), + ); + } + + /** + * Creates a multi-datetime field definition. + * + * @param int|null $min Minimum number of items. + * @param int|null $max Maximum number of items. + * @param array|null $buttons Custom buttons for the multi-field. + * @param array|null $disabled_buttons Buttons to disable. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function multi_datetime( + ?int $min = null, + ?int $max = null, + ?array $buttons = null, + ?array $disabled_buttons = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'multi_datetime', + array( + 'min' => $min, + 'max' => $max, + 'buttons' => $buttons, + 'disabled_buttons' => $disabled_buttons, + ), + $this->extract_common( get_defined_vars(), array( 'min', 'max', 'buttons', 'disabled_buttons' ) ), + ); + } + + /** + * Creates a multi-time field definition. + * + * @param int|null $min Minimum number of items. + * @param int|null $max Maximum number of items. + * @param array|null $buttons Custom buttons for the multi-field. + * @param array|null $disabled_buttons Buttons to disable. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function multi_time( + ?int $min = null, + ?int $max = null, + ?array $buttons = null, + ?array $disabled_buttons = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'multi_time', + array( + 'min' => $min, + 'max' => $max, + 'buttons' => $buttons, + 'disabled_buttons' => $disabled_buttons, + ), + $this->extract_common( get_defined_vars(), array( 'min', 'max', 'buttons', 'disabled_buttons' ) ), + ); + } + + /** + * Creates a multi-month field definition. + * + * @param int|null $min Minimum number of items. + * @param int|null $max Maximum number of items. + * @param array|null $buttons Custom buttons for the multi-field. + * @param array|null $disabled_buttons Buttons to disable. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function multi_month( + ?int $min = null, + ?int $max = null, + ?array $buttons = null, + ?array $disabled_buttons = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'multi_month', + array( + 'min' => $min, + 'max' => $max, + 'buttons' => $buttons, + 'disabled_buttons' => $disabled_buttons, + ), + $this->extract_common( get_defined_vars(), array( 'min', 'max', 'buttons', 'disabled_buttons' ) ), + ); + } + + /** + * Creates a multi-week field definition. + * + * @param int|null $min Minimum number of items. + * @param int|null $max Maximum number of items. + * @param array|null $buttons Custom buttons for the multi-field. + * @param array|null $disabled_buttons Buttons to disable. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function multi_week( + ?int $min = null, + ?int $max = null, + ?array $buttons = null, + ?array $disabled_buttons = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'multi_week', + array( + 'min' => $min, + 'max' => $max, + 'buttons' => $buttons, + 'disabled_buttons' => $disabled_buttons, + ), + $this->extract_common( get_defined_vars(), array( 'min', 'max', 'buttons', 'disabled_buttons' ) ), + ); + } + + /** + * Creates a multi-select field definition. + * + * @param array|null $options Select options. + * @param string|null $options_key Options key for dynamic options. + * @param array|null $async_params Async loading parameters. + * @param int|null $min Minimum number of items. + * @param int|null $max Maximum number of items. + * @param array|null $buttons Custom buttons for the multi-field. + * @param array|null $disabled_buttons Buttons to disable. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function multi_select( + ?array $options = null, + ?string $options_key = null, + ?array $async_params = null, + ?int $min = null, + ?int $max = null, + ?array $buttons = null, + ?array $disabled_buttons = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'multi_select', + array( + 'options' => $options, + 'options_key' => $options_key, + 'async_params' => $async_params, + 'min' => $min, + 'max' => $max, + 'buttons' => $buttons, + 'disabled_buttons' => $disabled_buttons, + ), + $this->extract_common( get_defined_vars(), array( 'options', 'options_key', 'async_params', 'min', 'max', 'buttons', 'disabled_buttons' ) ), + ); + } + + /** + * Creates a multi-checkbox field definition. + * + * @param string|null $title Checkbox title text. + * @param int|null $min Minimum number of items. + * @param int|null $max Maximum number of items. + * @param array|null $buttons Custom buttons for the multi-field. + * @param array|null $disabled_buttons Buttons to disable. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function multi_checkbox( + ?string $title = null, + ?int $min = null, + ?int $max = null, + ?array $buttons = null, + ?array $disabled_buttons = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'multi_checkbox', + array( + 'title' => $title, + 'min' => $min, + 'max' => $max, + 'buttons' => $buttons, + 'disabled_buttons' => $disabled_buttons, + ), + $this->extract_common( get_defined_vars(), array( 'title', 'min', 'max', 'buttons', 'disabled_buttons' ) ), + ); + } + + /** + * Creates a multi-toggle field definition. + * + * @param string|null $title Toggle title text. + * @param int|null $min Minimum number of items. + * @param int|null $max Maximum number of items. + * @param array|null $buttons Custom buttons for the multi-field. + * @param array|null $disabled_buttons Buttons to disable. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function multi_toggle( + ?string $title = null, + ?int $min = null, + ?int $max = null, + ?array $buttons = null, + ?array $disabled_buttons = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'multi_toggle', + array( + 'title' => $title, + 'min' => $min, + 'max' => $max, + 'buttons' => $buttons, + 'disabled_buttons' => $disabled_buttons, + ), + $this->extract_common( get_defined_vars(), array( 'title', 'min', 'max', 'buttons', 'disabled_buttons' ) ), + ); + } + + /** + * Creates a multi-post field definition. + * + * @param string|array|null $post_type Post type(s) to query. + * @param int|null $min Minimum number of items. + * @param int|null $max Maximum number of items. + * @param array|null $buttons Custom buttons for the multi-field. + * @param array|null $disabled_buttons Buttons to disable. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function multi_post( + string|array|null $post_type = null, + ?int $min = null, + ?int $max = null, + ?array $buttons = null, + ?array $disabled_buttons = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'multi_post', + array( + 'post_type' => $post_type, + 'min' => $min, + 'max' => $max, + 'buttons' => $buttons, + 'disabled_buttons' => $disabled_buttons, + ), + $this->extract_common( get_defined_vars(), array( 'post_type', 'min', 'max', 'buttons', 'disabled_buttons' ) ), + ); + } + + /** + * Creates a multi-term field definition. + * + * @param string|null $taxonomy Taxonomy to query. + * @param int|null $min Minimum number of items. + * @param int|null $max Maximum number of items. + * @param array|null $buttons Custom buttons for the multi-field. + * @param array|null $disabled_buttons Buttons to disable. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function multi_term( + ?string $taxonomy = null, + ?int $min = null, + ?int $max = null, + ?array $buttons = null, + ?array $disabled_buttons = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'multi_term', + array( + 'taxonomy' => $taxonomy, + 'min' => $min, + 'max' => $max, + 'buttons' => $buttons, + 'disabled_buttons' => $disabled_buttons, + ), + $this->extract_common( get_defined_vars(), array( 'taxonomy', 'min', 'max', 'buttons', 'disabled_buttons' ) ), + ); + } + + /** + * Creates a multi-attachment field definition. + * + * @param string|null $attachment_type Allowed attachment type. + * @param int|null $min Minimum number of items. + * @param int|null $max Maximum number of items. + * @param array|null $buttons Custom buttons for the multi-field. + * @param array|null $disabled_buttons Buttons to disable. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function multi_attachment( + ?string $attachment_type = null, + ?int $min = null, + ?int $max = null, + ?array $buttons = null, + ?array $disabled_buttons = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'multi_attachment', + array( + 'attachment_type' => $attachment_type, + 'min' => $min, + 'max' => $max, + 'buttons' => $buttons, + 'disabled_buttons' => $disabled_buttons, + ), + $this->extract_common( get_defined_vars(), array( 'attachment_type', 'min', 'max', 'buttons', 'disabled_buttons' ) ), + ); + } + + /** + * Creates a multi-direct-file field definition. + * + * @param array|null $allowed_types Allowed MIME types. + * @param int|null $max_size Maximum file size in bytes. + * @param int|null $min Minimum number of items. + * @param int|null $max Maximum number of items. + * @param array|null $buttons Custom buttons for the multi-field. + * @param array|null $disabled_buttons Buttons to disable. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function multi_direct_file( + ?array $allowed_types = null, + ?int $max_size = null, + ?int $min = null, + ?int $max = null, + ?array $buttons = null, + ?array $disabled_buttons = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'multi_direct_file', + array( + 'allowed_types' => $allowed_types, + 'max_size' => $max_size, + 'min' => $min, + 'max' => $max, + 'buttons' => $buttons, + 'disabled_buttons' => $disabled_buttons, + ), + $this->extract_common( get_defined_vars(), array( 'allowed_types', 'max_size', 'min', 'max', 'buttons', 'disabled_buttons' ) ), + ); + } + + /** + * Creates a multi-link field definition. + * + * @param string|array|null $post_type Post type(s) for post picker. + * @param int|null $min Minimum number of items. + * @param int|null $max Maximum number of items. + * @param array|null $buttons Custom buttons for the multi-field. + * @param array|null $disabled_buttons Buttons to disable. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function multi_link( + string|array|null $post_type = null, + ?int $min = null, + ?int $max = null, + ?array $buttons = null, + ?array $disabled_buttons = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'multi_link', + array( + 'post_type' => $post_type, + 'min' => $min, + 'max' => $max, + 'buttons' => $buttons, + 'disabled_buttons' => $disabled_buttons, + ), + $this->extract_common( get_defined_vars(), array( 'post_type', 'min', 'max', 'buttons', 'disabled_buttons' ) ), + ); + } + + /** + * Creates a multi-mapycz field definition. + * + * @param string|null $lang Map language. + * @param int|null $min Minimum number of items. + * @param int|null $max Maximum number of items. + * @param array|null $buttons Custom buttons for the multi-field. + * @param array|null $disabled_buttons Buttons to disable. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function multi_mapycz( + ?string $lang = null, + ?int $min = null, + ?int $max = null, + ?array $buttons = null, + ?array $disabled_buttons = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'multi_mapycz', + array( + 'lang' => $lang, + 'min' => $min, + 'max' => $max, + 'buttons' => $buttons, + 'disabled_buttons' => $disabled_buttons, + ), + $this->extract_common( get_defined_vars(), array( 'lang', 'min', 'max', 'buttons', 'disabled_buttons' ) ), + ); + } + + /** + * Creates a multi-date-range field definition. + * + * @param int|null $min Minimum number of items. + * @param int|null $max Maximum number of items. + * @param array|null $buttons Custom buttons for the multi-field. + * @param array|null $disabled_buttons Buttons to disable. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function multi_date_range( + ?int $min = null, + ?int $max = null, + ?array $buttons = null, + ?array $disabled_buttons = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'multi_date_range', + array( + 'min' => $min, + 'max' => $max, + 'buttons' => $buttons, + 'disabled_buttons' => $disabled_buttons, + ), + $this->extract_common( get_defined_vars(), array( 'min', 'max', 'buttons', 'disabled_buttons' ) ), + ); + } + + /** + * Creates a multi-group field definition. + * + * @param array $items Child field definitions. + * @param int|null $min Minimum number of items. + * @param int|null $max Maximum number of items. + * @param array|null $buttons Custom buttons for the multi-field. + * @param array|null $disabled_buttons Buttons to disable. + * @param bool|null $collapse Whether items can be collapsed. + * @param string|null $label Field label. + * @param string|null $description Field description. + * @param bool|null $required Whether the field is required. + * @param mixed $default Default value. + * @param bool|null $disabled Whether the field is disabled. + * @param string|null $tab Tab identifier. + * @param string|null $class_name CSS class name. + * @param array|null $conditions Conditional display rules. + * @param array|null $attributes HTML attributes. + * @param bool|null $unfiltered Whether to skip sanitization. + * @param array|null $render_options Render options. + * @param string|null $generator Generator identifier. + * + * @return array Field definition array. + */ + public function multi_group( + array $items = array(), + ?int $min = null, + ?int $max = null, + ?array $buttons = null, + ?array $disabled_buttons = null, + ?bool $collapse = null, + ?string $label = null, + ?string $description = null, + ?bool $required = null, + mixed $default = self::UNSET, + ?bool $disabled = null, + ?string $tab = null, + ?string $class_name = null, + ?array $conditions = null, + ?array $attributes = null, + ?bool $unfiltered = null, + ?array $render_options = null, + ?string $generator = null, + ): array { + return $this->build_field( + 'multi_group', + array( + 'items' => $items, + 'min' => $min, + 'max' => $max, + 'buttons' => $buttons, + 'disabled_buttons' => $disabled_buttons, + 'collapse' => $collapse, + ), + $this->extract_common( get_defined_vars(), array( 'items', 'min', 'max', 'buttons', 'disabled_buttons', 'collapse' ) ), + ); + } +} diff --git a/src/Integrations/Comment.php b/src/Integrations/Comment.php index 9085b0e9..a92a511b 100644 --- a/src/Integrations/Comment.php +++ b/src/Integrations/Comment.php @@ -190,6 +190,7 @@ public function save_meta_box( int $comment_id ): void { */ public function register_meta(): void { $items = $this->normalize_items( $this->items ); + $items = $this->custom_fields->flatten_items( $items ); foreach ( $items as $item ) { register_meta( @@ -220,13 +221,11 @@ public function render( WP_Comment $comment ): void { $this->set_comment( $comment->comment_ID ); $this->enqueue(); - $this->print_app( 'comment', $this->tabs ); wp_nonce_field( $this->id, $this->nonce ); - foreach ( $items as $item ) { - $this->print_field( $item ); - } + $prepared = $this->prepare_items_for_js( $items ); + $this->print_app( 'comment', $this->tabs, array(), $prepared ); } /** diff --git a/src/Integrations/CouponOptions.php b/src/Integrations/CouponOptions.php index f6573077..623b5c27 100644 --- a/src/Integrations/CouponOptions.php +++ b/src/Integrations/CouponOptions.php @@ -295,15 +295,8 @@ public function render(): void { ?>
print_app( 'coupon-options', $this->tabs ); - - foreach ( $items as $item ) { - ?> -
- print_field( $item ); ?> -
- prepare_items_for_js( $items ); + $this->print_app( 'coupon-options', $this->tabs, array(), $prepared ); ?>
normalize_items( $this->items ); + $items = $this->custom_fields->flatten_items( $items ); foreach ( $items as $item ) { register_post_meta( diff --git a/src/Integrations/GutenbergBlock.php b/src/Integrations/GutenbergBlock.php index 3b46522e..a0631b74 100644 --- a/src/Integrations/GutenbergBlock.php +++ b/src/Integrations/GutenbergBlock.php @@ -414,6 +414,7 @@ public function get_args(): array { */ public function get_attributes(): array { $items = $this->normalize_items( $this->items ); + $items = $this->custom_fields->flatten_items( $items ); $attributes = array(); foreach ( $items as $item ) { diff --git a/src/Integrations/MenuItem.php b/src/Integrations/MenuItem.php index 4e62601a..813db649 100644 --- a/src/Integrations/MenuItem.php +++ b/src/Integrations/MenuItem.php @@ -100,20 +100,11 @@ public function maybe_enqueue( WP_Screen $current_screen ): void { public function render( string $item_id ): void { $this->item_id = $item_id; $this->enqueue(); - $this->print_app( - 'menu-item', - $this->tabs, - array( 'loop' => $item_id ), - ); - - $items = $this->normalize_items( $this->items ); - - foreach ( $items as $item ) { - $this->print_field( - $item, - array( 'loop' => $item_id ), - ); - } + + $data_attributes = array( 'loop' => $item_id ); + $items = $this->normalize_items( $this->items ); + $prepared = $this->prepare_items_for_js( $items, $data_attributes ); + $this->print_app( 'menu-item', $this->tabs, $data_attributes, $prepared ); } /** diff --git a/src/Integrations/Metabox.php b/src/Integrations/Metabox.php index ceffc2f2..20a6ccc6 100644 --- a/src/Integrations/Metabox.php +++ b/src/Integrations/Metabox.php @@ -236,6 +236,7 @@ public function save_meta_box( int $post_id, WP_Post $post ): void { */ public function register_meta(): void { $items = $this->normalize_items( $this->items ); + $items = $this->custom_fields->flatten_items( $items ); foreach ( $this->post_types as $post_type ) { foreach ( $items as $item ) { @@ -268,13 +269,11 @@ public function render( WP_Post $post ): void { $this->set_post( $post ); $this->enqueue(); - $this->print_app( 'metabox', $this->tabs ); wp_nonce_field( $this->id, $this->nonce ); - foreach ( $items as $item ) { - $this->print_field( $item ); - } + $prepared = $this->prepare_items_for_js( $items ); + $this->print_app( 'metabox', $this->tabs, array(), $prepared ); } /** diff --git a/src/Integrations/Options.php b/src/Integrations/Options.php index 4aa59aa2..7318ac47 100644 --- a/src/Integrations/Options.php +++ b/src/Integrations/Options.php @@ -160,20 +160,6 @@ class Options extends OptionsIntegration { */ public readonly array $items; - /** - * List of the sections to be defined. - * - * @var array - */ - public readonly array $sections; - - /** - * Default section name. - * - * @var string - */ - public readonly string $default_section; - /** * Tabs used for the custom fields. * @@ -253,33 +239,6 @@ public function __construct( ? __( 'Settings saved', 'wpify-custom-fields' ) : $args['success_message']; - if ( empty( $args['sections'] ) ) { - $args['sections'] = array(); - } - - $sections = array(); - - foreach ( $args['sections'] as $key => $section ) { - if ( empty( $section['id'] ) && is_string( $key ) ) { - $section['id'] = $key; - } - - $sections[ $section['id'] ] = $section; - } - - if ( empty( $sections ) ) { - $sections = array( - 'default' => array( - 'id' => 'default', - 'title' => '', - 'callback' => '__return_true', - 'page' => $this->menu_slug, - ), - ); - } - - $this->sections = $sections; - $this->id = sanitize_title( join( '-', @@ -293,11 +252,6 @@ public function __construct( ), ); - foreach ( $this->sections as $section ) { - $this->default_section = $section['id']; - break; - } - if ( ! defined( 'WP_CLI' ) || false === WP_CLI ) { if ( ! empty( $this->option_name ) ) { add_filter( @@ -435,13 +389,13 @@ public function render(): void { wp_nonce_field( $this->get_network_save_action() ); } - $this->print_app( 'options', $this->tabs ); - if ( $this->type !== $this::TYPE_NETWORK ) { settings_fields( $this->option_group ); } - do_settings_sections( $this->menu_slug ); + $items = $this->normalize_items( $this->items ); + $prepared = $this->prepare_items_for_js( $items ); + $this->print_app( 'options', $this->tabs, array(), $prepared ); if ( false !== $this->submit_button ) { if ( is_array( $this->submit_button ) ) { @@ -552,6 +506,7 @@ public function get_items_for_option_name( array $items ): array { */ public function register_settings(): void { $items = $this->normalize_items( $this->items ); + $items = $this->custom_fields->flatten_items( $items ); if ( empty( $this->option_name ) ) { foreach ( $items as $item ) { @@ -583,32 +538,6 @@ public function register_settings(): void { ), ); } - - foreach ( $this->sections as $id => $section ) { - add_settings_section( - $id, - $section['title'] ?? '', - $section['callback'] ?? '__return_true', - $this->menu_slug, - $section['args'] ?? array(), - ); - } - - foreach ( $items as $item ) { - $section = $this->sections[ $item['section'] ]['id'] ?? $this->default_section; - - add_settings_field( - $item['id'], - $item['label'], - array( $this, 'print_field' ), - $this->menu_slug, - $section, - array( - 'label_for' => $item['id'], - ...$item, - ), - ); - } } /** diff --git a/src/Integrations/OptionsIntegration.php b/src/Integrations/OptionsIntegration.php index 1b95e158..45bb3bfc 100644 --- a/src/Integrations/OptionsIntegration.php +++ b/src/Integrations/OptionsIntegration.php @@ -21,8 +21,9 @@ abstract class OptionsIntegration extends BaseIntegration { * @param string $context The context in which the app is used. * @param array $tabs Tabs data to be used in the app. * @param array $data_attributes Optional. Additional data attributes. + * @param array $items Optional. Prepared field items to embed as data-fields. */ - public function print_app( string $context, array $tabs, array $data_attributes = array() ): void { + public function print_app( string $context, array $tabs, array $data_attributes = array(), array $items = array() ): void { if ( ! apply_filters( 'wpifycf_print_app', true, $this, $context, $tabs, $data_attributes ) ) { return; } @@ -36,6 +37,7 @@ public function print_app( string $context, array $tabs, array $data_attributes data-integration-id="" data-tabs="custom_fields->helpers->json_encode( $tabs ) ); ?>" data-context="" + data-fields="custom_fields->helpers->json_encode( $items ) ); ?>" $value ) { printf( ' data-%s="%s"', esc_attr( $key ), esc_attr( $value ) ); @@ -46,16 +48,46 @@ public function print_app( string $context, array $tabs, array $data_attributes } /** - * Prints a field element with specific data attributes. + * Prepares items for embedding as JSON in the app container. * - * @param array $item Item data to print as field. - * @param array $data_attributes Optional. Additional data attributes. - * @param string $tag Optional. HTML tag to use. - * @param string $class_name Optional. Additional CSS class for the field element. + * Extracts name-building and value-fetching logic from print_field() into a reusable method. + * + * @param array $items Normalized items to prepare. + * @param array $data_attributes Optional. Additional data attributes (e.g. loop). + * + * @return array Prepared items with name, value, and loop set. */ - public function print_field( array $item, array $data_attributes = array(), string $tag = 'div', string $class_name = '' ): void { + public function prepare_items_for_js( array $items, array $data_attributes = array() ): array { + $prepared = array(); + + foreach ( $items as $item ) { + if ( in_array( $item['type'] ?? '', array( 'wrapper', 'columns' ), true ) && ! empty( $item['items'] ) ) { + $item['items'] = $this->prepare_items_for_js( $item['items'], $data_attributes ); + $prepared[] = $item; + } else { + $name = $this->build_field_name( $item['id'], $data_attributes ); + + $item['name'] = $name; + $item['value'] = $this->get_field( $item['id'], $item ); + $item['loop'] = $data_attributes['loop'] ?? ''; + $prepared[] = $item; + } + } + + return $prepared; + } + + /** + * Builds the input name attribute for a field. + * + * @param string $field_id The field ID. + * @param array $data_attributes Optional. Additional data attributes (e.g. loop). + * + * @return string The constructed field name. + */ + private function build_field_name( string $field_id, array $data_attributes = array() ): string { if ( empty( $this->option_name ) ) { - $name = $item['id']; + $name = $field_id; if ( isset( $data_attributes['loop'] ) ) { $name .= '[' . $data_attributes['loop'] . ']'; @@ -67,9 +99,23 @@ public function print_field( array $item, array $data_attributes = array(), stri $name .= '[' . $data_attributes['loop'] . ']'; } - $name .= '[' . $item['id'] . ']'; + $name .= '[' . $field_id . ']'; } + return $name; + } + + /** + * Prints a field element with specific data attributes. + * + * @param array $item Item data to print as field. + * @param array $data_attributes Optional. Additional data attributes. + * @param string $tag Optional. HTML tag to use. + * @param string $class_name Optional. Additional CSS class for the field element. + */ + public function print_field( array $item, array $data_attributes = array(), string $tag = 'div', string $class_name = '' ): void { + $name = $this->build_field_name( $item['id'], $data_attributes ); + $item['name'] = $name; $item['value'] = $this->get_field( $item['id'], $item ); $item['loop'] = $data_attributes['loop'] ?? ''; @@ -139,7 +185,8 @@ public function set_field( string $name, mixed $value, array $item = array() ): * @return void */ public function set_fields( string $option_name, array $sanitized_values, array $items ): void { - $data = array(); + $items = $this->custom_fields->flatten_items( $items ); + $data = array(); foreach ( $items as $item ) { if ( isset( $sanitized_values[ $item['id'] ] ) ) { @@ -185,6 +232,8 @@ public function set_fields_from_post_request( array $items, mixed $loop_id = nul // Nonce verification not needed here, is verified by caller. // phpcs:disable WordPress.Security.NonceVerification.Missing + $items = $this->custom_fields->flatten_items( $items ); + if ( ! empty( $this->option_name ) ) { if ( is_null( $loop_id ) ) { $post_data = isset( $_POST[ $this->option_name ] ) ? wp_unslash( $_POST[ $this->option_name ] ) : array(); diff --git a/src/Integrations/OrderMetabox.php b/src/Integrations/OrderMetabox.php index e4fa26ef..290cd122 100644 --- a/src/Integrations/OrderMetabox.php +++ b/src/Integrations/OrderMetabox.php @@ -242,15 +242,9 @@ public function render( WP_Post|WC_Abstract_Order $post ): void { } wp_nonce_field( $this->id, $this->nonce ); - $this->print_app( 'order-meta', $this->tabs ); - - foreach ( $items as $item ) { - ?> -
- print_field( $item ); ?> -
- prepare_items_for_js( $items ); + $this->print_app( 'order-meta', $this->tabs, array(), $prepared ); } /** diff --git a/src/Integrations/ProductOptions.php b/src/Integrations/ProductOptions.php index a17bd8df..ef3cc87e 100644 --- a/src/Integrations/ProductOptions.php +++ b/src/Integrations/ProductOptions.php @@ -301,15 +301,8 @@ public function render(): void { ?>
print_app( 'product-options', $this->tabs ); - - foreach ( $items as $item ) { - ?> -
- print_field( $item ); ?> -
- prepare_items_for_js( $items ); + $this->print_app( 'product-options', $this->tabs, array(), $prepared ); ?>
normalize_items( $this->items ); + $items = $this->custom_fields->flatten_items( $items ); foreach ( $items as $item ) { register_post_meta( diff --git a/src/Integrations/ProductVariationOptions.php b/src/Integrations/ProductVariationOptions.php index 7ca67c58..2d4d1d13 100644 --- a/src/Integrations/ProductVariationOptions.php +++ b/src/Integrations/ProductVariationOptions.php @@ -267,14 +267,12 @@ public function render( int $loop, array $variation_data, WP_Post $variation ): if ( is_callable( $this->callback ) ) { call_user_func( $this->callback ); } + $data_attributes = array( 'loop' => $loop ); ?>
print_app( 'product-variation', $this->tabs, array( 'loop' => $loop ) ); - - foreach ( $items as $item ) { - $this->print_field( $item, array( 'loop' => $loop ), 'div', 'form-field' ); - } + $prepared = $this->prepare_items_for_js( $items, $data_attributes ); + $this->print_app( 'product-variation', $this->tabs, $data_attributes, $prepared ); ?>
normalize_items( $this->items ); + $items = $this->custom_fields->flatten_items( $items ); foreach ( $items as $item ) { register_post_meta( diff --git a/src/Integrations/SiteOptions.php b/src/Integrations/SiteOptions.php index 6d3ce71b..1f216098 100644 --- a/src/Integrations/SiteOptions.php +++ b/src/Integrations/SiteOptions.php @@ -135,20 +135,6 @@ class SiteOptions extends OptionsIntegration { */ public readonly array $items; - /** - * List of the sections to be defined. - * - * @var array - */ - public readonly array $sections; - - /** - * Default section name. - * - * @var string - */ - public readonly string $default_section; - /** * Tabs used for the custom fields. * @@ -219,33 +205,6 @@ public function __construct( ? __( 'Settings saved', 'wpify-custom-fields' ) : $args['success_message']; - if ( empty( $args['sections'] ) ) { - $args['sections'] = array(); - } - - $sections = array(); - - foreach ( $args['sections'] as $key => $section ) { - if ( empty( $section['id'] ) && is_string( $key ) ) { - $section['id'] = $key; - } - - $sections[ $section['id'] ] = $section; - } - - if ( empty( $sections ) ) { - $sections = array( - 'default' => array( - 'id' => 'default', - 'title' => '', - 'callback' => '__return_true', - 'page' => $this->menu_slug, - ), - ); - } - - $this->sections = $sections; - $this->id = sanitize_title( join( '-', @@ -257,11 +216,6 @@ public function __construct( ), ); - foreach ( $this->sections as $section ) { - $this->default_section = $section['id']; - break; - } - if ( ! defined( 'WP_CLI' ) || false === WP_CLI ) { add_filter( 'network_edit_site_nav_links', array( $this, 'create_tab' ) ); add_action( 'network_admin_menu', array( $this, 'register' ) ); @@ -387,9 +341,11 @@ public function render(): void { print_app( 'site-options', $this->tabs ); settings_fields( $this->option_group ); - do_settings_sections( $this->menu_slug ); + + $items = $this->normalize_items( $this->items ); + $prepared = $this->prepare_items_for_js( $items ); + $this->print_app( 'site-options', $this->tabs, array(), $prepared ); if ( false !== $this->submit_button ) { if ( is_array( $this->submit_button ) ) { @@ -482,6 +438,7 @@ public function save_site_options(): void { */ public function register_settings(): void { $items = $this->normalize_items( $this->items ); + $items = $this->custom_fields->flatten_items( $items ); if ( empty( $this->option_name ) ) { foreach ( $items as $item ) { @@ -510,32 +467,6 @@ public function register_settings(): void { ), ); } - - foreach ( $this->sections as $id => $section ) { - add_settings_section( - $id, - $section['label'] ?? '', - $section['callback'] ?? '__return_true', - $this->menu_slug, - $section['args'] ?? array(), - ); - } - - foreach ( $items as $item ) { - $section = $this->sections[ $item['section'] ]['id'] ?? $this->default_section; - - add_settings_field( - $item['id'], - $item['label'], - array( $this, 'print_field' ), - $this->menu_slug, - $section, - array( - 'label_for' => $item['id'], - ...$item, - ), - ); - } } /** diff --git a/src/Integrations/SubscriptionMetabox.php b/src/Integrations/SubscriptionMetabox.php index 12b946b0..3b822222 100644 --- a/src/Integrations/SubscriptionMetabox.php +++ b/src/Integrations/SubscriptionMetabox.php @@ -251,15 +251,9 @@ public function render( WC_Order $order ): void { } wp_nonce_field( $this->id, $this->nonce ); - $this->print_app( 'order-meta', $this->tabs ); - - foreach ( $items as $item ) { - ?> -
- print_field( $item ); ?> -
- prepare_items_for_js( $items ); + $this->print_app( 'subscription-meta', $this->tabs, array(), $prepared ); } /** diff --git a/src/Integrations/Taxonomy.php b/src/Integrations/Taxonomy.php index 25eda9c6..7526e2b6 100644 --- a/src/Integrations/Taxonomy.php +++ b/src/Integrations/Taxonomy.php @@ -131,13 +131,10 @@ public function __construct( public function render_add_form(): void { $this->term_id = 0; $this->enqueue(); - $this->print_app( 'add_term', $this->tabs ); - $items = $this->normalize_items( $this->items ); - - foreach ( $items as $item ) { - $this->print_field( $item, array(), 'div', 'form-field' ); - } + $items = $this->normalize_items( $this->items ); + $prepared = $this->prepare_items_for_js( $items ); + $this->print_app( 'add_term', $this->tabs, array(), $prepared ); } /** @@ -150,19 +147,16 @@ public function render_add_form(): void { public function render_edit_form( WP_Term $term ): void { $this->term_id = $term->term_id; $this->enqueue(); + + $items = $this->normalize_items( $this->items ); + $prepared = $this->prepare_items_for_js( $items ); ?> - print_app( 'edit_term', $this->tabs ); ?> + print_app( 'edit_term', $this->tabs, array(), $prepared ); ?> normalize_items( $this->items ); - - foreach ( $items as $item ) { - $this->print_field( $item, array(), 'tr' ); - } } /** @@ -175,6 +169,7 @@ public function render_edit_form( WP_Term $term ): void { */ public function register_meta(): void { $items = $this->normalize_items( $this->items ); + $items = $this->custom_fields->flatten_items( $items ); foreach ( $items as $item ) { register_term_meta( diff --git a/src/Integrations/User.php b/src/Integrations/User.php index 453d16ef..25e870ff 100644 --- a/src/Integrations/User.php +++ b/src/Integrations/User.php @@ -121,6 +121,7 @@ public function __construct( */ public function register_meta(): void { $items = $this->normalize_items( $this->items ); + $items = $this->custom_fields->flatten_items( $items ); foreach ( $items as $item ) { register_meta( @@ -161,29 +162,9 @@ public function render_edit_form( WP_User $user ): void {

title ); ?>

print_app( 'user', $this->tabs ); - ?> - - - - - - - - - - - prepare_items_for_js( $items ); + $this->print_app( 'user', $this->tabs, array(), $prepared ); } /** diff --git a/src/Integrations/WcMembershipPlanOptions.php b/src/Integrations/WcMembershipPlanOptions.php index cf049a32..2f5f75e6 100644 --- a/src/Integrations/WcMembershipPlanOptions.php +++ b/src/Integrations/WcMembershipPlanOptions.php @@ -304,15 +304,8 @@ public function render(): void { ?>
print_app( 'product-options', $this->tabs ); - - foreach ( $items as $item ) { - ?> -
- print_field( $item ); ?> -
- prepare_items_for_js( $items ); + $this->print_app( 'product-options', $this->tabs, array(), $prepared ); ?>
normalize_items( $this->items ); + $items = $this->custom_fields->flatten_items( $items ); foreach ( $items as $item ) { register_post_meta( diff --git a/src/Integrations/WooCommerceSettings.php b/src/Integrations/WooCommerceSettings.php index c114ac96..cf82b24c 100644 --- a/src/Integrations/WooCommerceSettings.php +++ b/src/Integrations/WooCommerceSettings.php @@ -240,13 +240,10 @@ class="" } $this->enqueue(); - $this->print_app( 'woocommerce-options', $this->tabs ); - $items = $this->normalize_items( $this->items ); - - foreach ( $items as $item ) { - $this->print_field( $item ); - } + $items = $this->normalize_items( $this->items ); + $prepared = $this->prepare_items_for_js( $items ); + $this->print_app( 'woocommerce-options', $this->tabs, array(), $prepared ); } /**