├── .eslintignore ├── .prettierignore ├── .prettierrc.js ├── src ├── index.html ├── index.css └── index.tsx ├── tsconfig.json ├── .eslintrc.js ├── .gitignore ├── .babelrc ├── LICENSE ├── docs ├── src.a8b20bb6.css └── src.abfa7487.js ├── package.json ├── extension.json └── README.md /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .coverage/ 3 | dist/ 4 | build/ 5 | .cache/ 6 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .coverage/ 3 | dist/ 4 | build/ 5 | .cache/ 6 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | printWidth: 100, 3 | tabWidth: 2, 4 | useTabs: false, 5 | singleQuote: true, 6 | jsxBracketSameLine: true 7 | }; 8 | -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "strict": true, 6 | "jsx": "react", 7 | "rootDir": "./src", 8 | "experimentalDecorators": true, 9 | "esModuleInterop": true, 10 | "lib": ["dom", "es2015"], 11 | "resolveJsonModule": true 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: [ 3 | require.resolve('@contentful/eslint-config-extension/typescript'), 4 | require.resolve('@contentful/eslint-config-extension/jest'), 5 | require.resolve('@contentful/eslint-config-extension/jsx-a11y'), 6 | require.resolve('@contentful/eslint-config-extension/react') 7 | ] 8 | }; 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # dotenv environment variables file 9 | .env 10 | .contentfulrc.json 11 | 12 | # Parcel-bundler cache 13 | .cache 14 | 15 | # Dependency directories 16 | node_modules/ 17 | 18 | # Coverage 19 | .coverage 20 | 21 | # Build 22 | build/* 23 | !/build/index.html 24 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | [ 4 | "@babel/preset-env", 5 | { 6 | "useBuiltIns": false 7 | } 8 | ], 9 | [ 10 | "@babel/preset-react", 11 | { 12 | "useBuiltIns": true 13 | } 14 | ] 15 | ], 16 | "plugins": [ 17 | [ 18 | "@babel/plugin-proposal-class-properties", 19 | { 20 | "loose": true 21 | } 22 | ], 23 | [ 24 | "@babel/plugin-transform-runtime", 25 | { 26 | "corejs": false, 27 | "helpers": false, 28 | "regenerator": true 29 | } 30 | ] 31 | ] 32 | } 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Paulo Gomes 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /docs/src.a8b20bb6.css: -------------------------------------------------------------------------------- 1 | body,div,html{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol}.iframe{height:50px,}.container{display:flex;flex-wrap:nowrap;align-items:center;margin:3px}.container input{-webkit-appearance:textfield;background-color:#fff;border:1px solid #cfd9e0;border-radius:6px;-webkit-box-shadow:inset 0 2px 0 rgba(225,228,232,.2);box-shadow:inset 0 2px 0 rgba(225,228,232,.2);color:#414d63;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;font-size:.875rem;margin:0;max-height:2.5rem;outline:none;padding:.65625rem;width:100%}.container input:focus{border:1px solid #036fe3;-webkit-box-shadow:0 0 0 3px #98cbff;box-shadow:0 0 0 3px #98cbff;outline:none}.container button{position:absolute;right:7px;margin-left:4px;-webkit-box-sizing:border-box;box-sizing:border-box;height:2rem;display:inline-block;padding:0 8px;border:1px solid #c3cfd5;border-radius:.125rem;font-size:.875rem;overflow:hidden;background-size:100% 200%;background-color:#e5ebed;color:#536171;vertical-align:middle;text-decoration:none;cursor:pointer;transition-duration:.1s;transition-timing-function:ease-in-out;transition-property:all} -------------------------------------------------------------------------------- /src/index.css: -------------------------------------------------------------------------------- 1 | html, 2 | body, 3 | div { 4 | margin: 0; 5 | padding: 0; 6 | border: 0; 7 | font-size: 100%; 8 | font: inherit; 9 | vertical-align: baseline; 10 | font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, 11 | Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol; 12 | } 13 | 14 | .iframe { 15 | height: 50px, 16 | } 17 | .container { 18 | display: flex; 19 | flex-wrap: nowrap; 20 | align-items: center; 21 | margin: 3px; 22 | } 23 | .container input { 24 | -webkit-appearance: textfield; 25 | background-color: #fff; 26 | border: 1px solid #cfd9e0; 27 | border-radius: 6px; 28 | -webkit-box-shadow: inset 0 2px 0 #e1e4e833; 29 | box-shadow: inset 0 2px 0 #e1e4e833; 30 | color: #414d63; 31 | font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, 32 | Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol; 33 | font-size: 0.875rem; 34 | margin: 0; 35 | max-height: 2.5rem; 36 | outline: none; 37 | padding: 0.65625rem; 38 | width: 100%; 39 | } 40 | .container input:focus { 41 | border: 1px solid #036fe3; 42 | -webkit-box-shadow: 0 0 0 3px #98cbff; 43 | box-shadow: 0 0 0 3px #98cbff; 44 | outline: none; 45 | } 46 | .container button { 47 | position: absolute; 48 | right: 7px; 49 | margin-left: 4px; 50 | -webkit-box-sizing: border-box; 51 | box-sizing: border-box; 52 | height: 2rem; 53 | display: inline-block; 54 | padding: 0 8px; 55 | border: 1px solid #c3cfd5; 56 | border-radius: 0.125rem; 57 | font-size: 0.875rem; 58 | overflow: hidden; 59 | background-size: 100% 200%; 60 | background-color: #e5ebed; 61 | color: #536171; 62 | vertical-align: middle; 63 | text-decoration: none; 64 | cursor: pointer; 65 | transition-duration: 0.1s; 66 | transition-timing-function: ease-in-out; 67 | transition-property: all; 68 | } 69 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "better-slugs", 3 | "version": "1.0.0", 4 | "author": "Paulo Gomes", 5 | "license": "MIT", 6 | "repository": { 7 | "type": "git", 8 | "url": "git+https://github.com/pauloamgomes/contentful-better-slugs.git" 9 | }, 10 | "devDependencies": { 11 | "@babel/core": "7.3.4", 12 | "@babel/plugin-proposal-class-properties": "7.3.4", 13 | "@babel/plugin-transform-runtime": "7.3.4", 14 | "@babel/preset-env": "7.3.4", 15 | "@babel/preset-react": "7.0.0", 16 | "@contentful/contentful-extension-scripts": "^0.20.3", 17 | "@contentful/eslint-config-extension": "0.3.1", 18 | "@types/jest": "24.0.15", 19 | "@types/react": "^16.8.17", 20 | "@types/react-dom": "^16.8.4", 21 | "@types/speakingurl": "^13.0.2", 22 | "@types/webpack-env": "1.13.9", 23 | "contentful-cli": "^1.4.51", 24 | "cssnano": "4.1.10", 25 | "eslint": "^6.0.1", 26 | "typescript": "3.5.2" 27 | }, 28 | "scripts": { 29 | "start": "contentful-extension-scripts start", 30 | "build": "contentful-extension-scripts build", 31 | "dist": "rm -rf ./build/* && yarn build && rm -rf ./docs/* && cp ./build/* ./docs/", 32 | "lint": "eslint ./ --ext .js,.jsx,.ts,.tsx && tsc -p ./ --noEmit", 33 | "deploy": "npm run build && contentful extension update --force", 34 | "configure": "contentful space use && contentful space environment use", 35 | "login": "contentful login", 36 | "logout": "contentful logout", 37 | "help": "contentful-extension-scripts help" 38 | }, 39 | "dependencies": { 40 | "@contentful/forma-36-fcss": "^0.0.20", 41 | "@contentful/forma-36-react-components": "^3.11.3", 42 | "@contentful/forma-36-tokens": "^0.3.0", 43 | "contentful-ui-extensions-sdk": "^3.13.0", 44 | "react": "^16.8.6", 45 | "react-dom": "^16.8.6", 46 | "speakingurl": "^14.0.1" 47 | }, 48 | "browserslist": [ 49 | "last 5 Chrome version", 50 | "> 1%", 51 | "not ie <= 11" 52 | ], 53 | "resolutions": { 54 | "node-forge": "0.10.0" 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /extension.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "better-slugs", 3 | "name": "Better Slugs", 4 | "srcdoc": "./build/index.html", 5 | "fieldTypes": ["Symbol"], 6 | "parameters": { 7 | "instance": [ 8 | { 9 | "id": "pattern", 10 | "name": "Slug Pattern", 11 | "description": "Use replacement tokens: [locale], [field:name], [field:reference:name], e.g. [locale]/[field:category:title]/[field:title]", 12 | "type": "Symbol", 13 | "required": true, 14 | "default": "[field:title]" 15 | }, 16 | { 17 | "id": "translations1", 18 | "name": "String translations 1", 19 | "description": "To provide translations from a string, for example having a pattern like /products/[field:name] and nl, fr and de locales, you can use products=nl:producten,fr:produits,de:produkte", 20 | "type": "Symbol", 21 | "required": false, 22 | "default": "" 23 | }, 24 | { 25 | "id": "translations2", 26 | "name": "String translations 2", 27 | "description": "Optional translations for a second string (if it exists)", 28 | "type": "Symbol", 29 | "required": false, 30 | "default": "" 31 | }, 32 | { 33 | "id": "translations3", 34 | "name": "String translations 3", 35 | "description": "Optional translations for a third string (if it exists)", 36 | "type": "Symbol", 37 | "required": false, 38 | "default": "" 39 | }, 40 | { 41 | "id": "displayDefaultLocale", 42 | "name": "Display the default locale", 43 | "description": "When using the [locale] token, display or hide the locale in the slug for the default locale.", 44 | "type": "Boolean", 45 | "required": true, 46 | "default": true 47 | }, 48 | { 49 | "id": "lockWhenPublished", 50 | "name": "Do not update slug if entry is published", 51 | "description": "If the entry is published sometimes is desirable to not change the slug", 52 | "type": "Boolean", 53 | "required": true, 54 | "default": false 55 | }, 56 | { 57 | "id": "hideReset", 58 | "name": "Hide the reset button", 59 | "description": "If enabled it will hide the reset button", 60 | "type": "Boolean", 61 | "required": false, 62 | "default": false 63 | }, 64 | { 65 | "id": "caseOption", 66 | "name": "Case Option", 67 | "description": "Set the case mode (if not defined uses lowercase)", 68 | "type": "Enum", 69 | "required": false, 70 | "options": [{"maintainCase": "Maintain Case"}, {"titleCase": "Title Case"}] 71 | } 72 | ] 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | :warning: 2 | This UI Extension is deprecated and superseded by https://github.com/pauloamgomes/contentful-better-slugs-app 3 | 4 | # Contentful Better Slugs 5 | 6 | The Better Slugs is a simple UI extension for Contentful CMS that provides a more enhanced way to deal with slug fields. 7 | The existing slug functionality in Contentful is limited to one field (title) and therefore a bit limited for most of cases like: 8 | 9 | - Work with Gatsby Preview 10 | - Ability to automatically generate the slug with information from other fields (including referenced fields) 11 | - Autogeneration of slug doesn't end when the entry is published 12 | 13 | ## Overview 14 | 15 | The extension has the following features: 16 | 17 | - Generate a dynamic slug based on a pattern defined for each Content Model 18 | 19 | ![Screenshot](https://i.snipboard.io/zMLGUX.jpg) 20 | 21 | ## Requirements 22 | 23 | - Contentful CMS account with permissions to manage extensions 24 | 25 | ## Instalation (UI - using this repo) 26 | 27 | The UI Extension can be installed manually from the Contentful UI following the below steps: 28 | 29 | 1. Navigate to Settings > Extensions 30 | 2. Click on "Add extension > Install from Github" 31 | 3. Use `https://raw.githubusercontent.com/pauloamgomes/contentful-better-slugs/master/extension.json` in the url 32 | 4. On the extension settings screen change Hosting to Self-hosted using the url `https://pauloamgomes.github.io/contentful-better-slugs/` 33 | 34 | ## Usage 35 | 36 | 1. Add a new text field to your content model, it can be localized. 37 | 2. On the Appearance tab ensure that Better Slugs is selected 38 | 3. Provide your slug pattern, the pattern can use the following tokens: 39 | 40 | - **`[locale]`** - Will replace the token with the node locale 41 | - **`[field:your-field-name]`** - Will replace the token with the value of the field 42 | - **`[field:your-reference-field-name:field-name]`** - Will replace the token with the value of field that belongs to the reference. 43 | 44 | Example patterns: 45 | 46 | ``` 47 | [field:title] 48 | ``` 49 | 50 | Thats the default pattern, and probably for most of the cases would be enough. 51 | 52 | ``` 53 | [locale]/[field:category:title]/[field:title] 54 | ``` 55 | 56 | Assuming your locale is English, you have a reference field named category with title value `Computers` and your entry title is `Laptop 15"` the slug will be: `en/computers/laptop-15` 57 | 58 | ``` 59 | [field:date]/[field:title] 60 | ``` 61 | 62 | Assuming your locale is English, you have a date field named date with value `Friday, April 10th 2020` and your entry title is `London Event` the slug will be: `2020-04-10/london-event` 63 | 64 | If you have non dynamic strings in the path and you want to localize them, that would be possible (until a max of 3) using the translations fields, for example having a pattern like `/products/[field:name]` and `nl`, `fr` and `de` locales, you can use `products=nl:producten,fr:produits,de:produkte` and `products` will be `produkte` on the slug field for `de` locale. 65 | 66 | Other options: 67 | 68 | Ability to translate strings from the pattern: 69 | 70 | ![Screenshot](https://i.snipboard.io/f6td87.jpg) 71 | 72 | Option to not update the slug automatically if entry is published, hide the reset button and set the case mode (lowercase, maintain case, title case): 73 | 74 | ![Screenshot](https://i.snipboard.io/h6f30r.jpg) 75 | 76 | ## Optional Usage for Development 77 | 78 | After cloning, install the dependencies 79 | 80 | ```bash 81 | yarn install 82 | ``` 83 | 84 | To bundle the extension 85 | 86 | ```bash 87 | yarn build 88 | ``` 89 | 90 | To host the extension for development on `http://localhost:1234` 91 | 92 | ```bash 93 | yarn start 94 | ``` 95 | 96 | To install the extension: 97 | 98 | ```bash 99 | contentful extension update --force 100 | ``` 101 | 102 | ## Limitations 103 | 104 | Tested only with text and date fields, so not sure how it can behave with custom fields, it will depend on the value stored in the field. 105 | 106 | The slug generation is based on the speakingurl library - https://github.com/pid/speakingurl 107 | 108 | ## Todo 109 | 110 | - Improve the handling of reference fields 111 | - Improve the handling of date fields by providing a date format. 112 | 113 | ## Copyright and license 114 | 115 | Copyright 2020 pauloamgomes under the MIT license. 116 | -------------------------------------------------------------------------------- /src/index.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-explicit-any */ 2 | /* eslint-disable @typescript-eslint/no-use-before-define */ 3 | import React, { useState, useRef, useEffect } from 'react'; 4 | import { render } from 'react-dom'; 5 | import { init, FieldExtensionSDK } from 'contentful-ui-extensions-sdk'; 6 | import getSlug from 'speakingurl'; 7 | //== 8 | import './index.css'; 9 | 10 | interface BetterSlugsProps { 11 | sdk: FieldExtensionSDK; 12 | } 13 | 14 | const languages: any = { 15 | ar: 'ar', 16 | az: 'az', 17 | cs: 'cs', 18 | de: 'de', 19 | dv: 'dv', 20 | en: 'en', 21 | es: 'es', 22 | fa: 'fa', 23 | fi: 'fi', 24 | fr: 'fr', 25 | ge: 'ge', 26 | gr: 'gr', 27 | hu: 'hu', 28 | it: 'it', 29 | lt: 'lt', 30 | lv: 'lv', 31 | my: 'my', 32 | mk: 'mk', 33 | nl: 'nl', 34 | pl: 'pl', 35 | pt: 'pt', 36 | ro: 'ro', 37 | ru: 'ru', 38 | sk: 'sk', 39 | sr: 'sr', 40 | tr: 'tr', 41 | uk: 'uk', 42 | vn: 'vn', 43 | }; 44 | 45 | const BetterSlugs = ({ sdk }: BetterSlugsProps) => { 46 | const debounceInterval: any = useRef(false); 47 | const detachExternalChangeHandler: any = useRef(null); 48 | const parameters: any = sdk.parameters; 49 | const pattern: string = parameters.instance.pattern || ''; 50 | const displayDefaultLocale: boolean = parameters.instance.displayDefaultLocale; 51 | const lockWhenPublished: boolean = parameters.instance.lockWhenPublished; 52 | const translations1: string = parameters.instance.translations1 || ''; 53 | const translations2: string = parameters.instance.translations2 || ''; 54 | const translations3: string = parameters.instance.translations3 || ''; 55 | const hideReset: boolean = parameters.instance.hideReset || false; 56 | const caseOption: string = parameters.instance.caseOption; 57 | const slugOptions: any = {}; 58 | if (caseOption) { 59 | slugOptions[caseOption] = true; 60 | } 61 | 62 | const parts = pattern.split('/').map((part: string) => part.replace(/(\[|\])/gi, '').trim()); 63 | 64 | const [value, setValue] = useState(''); 65 | const fields: string[] = []; 66 | 67 | useEffect(() => { 68 | sdk.window.startAutoResizer(); 69 | 70 | // Extract fields used in slug parts. 71 | parts.forEach((part: string) => { 72 | if (part.startsWith('field:')) { 73 | fields.push(part.replace('field:', '')); 74 | } 75 | }); 76 | 77 | // Create a listener for each field and matching locales. 78 | fields.forEach((field: string) => { 79 | const fieldParts = field.split(':'); 80 | const fieldName = fieldParts.length === 1 ? field : fieldParts[0]; 81 | if (Object.prototype.hasOwnProperty.call(sdk.entry.fields, fieldName)) { 82 | const locales = sdk.entry.fields[fieldName].locales; 83 | 84 | locales.forEach((locale: string) => { 85 | sdk.entry.fields[fieldName].onValueChanged(locale, () => { 86 | if (debounceInterval.current) { 87 | clearInterval(debounceInterval.current); 88 | } 89 | debounceInterval.current = setTimeout(() => { 90 | updateSlug(locale); 91 | }, 500); 92 | }); 93 | }); 94 | } 95 | }); 96 | 97 | // Handler for external field value changes (e.g. when multiple authors are working on the same entry). 98 | if (sdk.field) { 99 | detachExternalChangeHandler.current = sdk.field.onValueChanged(onExternalChange); 100 | } 101 | 102 | return () => { 103 | if (detachExternalChangeHandler.current) { 104 | detachExternalChangeHandler.current(); 105 | } 106 | }; 107 | // eslint-disable-next-line react-hooks/exhaustive-deps 108 | }, []); 109 | 110 | /** 111 | * Retrieves the raw value from a referenced field. 112 | */ 113 | const getReferenceFieldValue = async ( 114 | fieldName: string, 115 | subFieldName: string, 116 | locale: string 117 | ) => { 118 | const defaultLocale = sdk.locales.default; 119 | const referenceLocale = sdk.entry.fields[fieldName].locales.includes(locale) 120 | ? locale 121 | : defaultLocale; 122 | 123 | const reference = sdk.entry.fields[fieldName].getValue(referenceLocale); 124 | if (!reference || !reference.sys || !reference.sys.id) { 125 | return ''; 126 | } 127 | 128 | // eslint-disable-next-line @typescript-eslint/no-explicit-any 129 | const result: any = await sdk.space.getEntry(reference.sys.id); 130 | const { fields } = result; 131 | 132 | if (!fields) { 133 | return ''; 134 | } 135 | 136 | if (!Object.prototype.hasOwnProperty.call(fields, subFieldName)) { 137 | return ''; 138 | } 139 | 140 | if (Object.prototype.hasOwnProperty.call(fields[subFieldName], locale)) { 141 | return fields[subFieldName][locale]; 142 | } 143 | 144 | if (Object.prototype.hasOwnProperty.call(fields[subFieldName], defaultLocale)) { 145 | return fields[subFieldName][defaultLocale]; 146 | } 147 | 148 | return ''; 149 | }; 150 | 151 | const isLocked = () => { 152 | const sys: any = sdk.entry.getSys(); 153 | 154 | const published = !!sys.publishedVersion && sys.version == sys.publishedVersion + 1; 155 | const changed = !!sys.publishedVersion && sys.version >= sys.publishedVersion + 2; 156 | 157 | return published || changed; 158 | }; 159 | 160 | const translatePart = (part: string, locale: string) => { 161 | const regex = new RegExp(`^${part}=`); 162 | let translationConfig = ''; 163 | let translation = ''; 164 | 165 | if (regex.test(translations1)) { 166 | translationConfig = translations1; 167 | } else if (regex.test(translations2)) { 168 | translationConfig = translations2; 169 | } else if (regex.test(translations3)) { 170 | translationConfig = translations3; 171 | } 172 | 173 | translationConfig 174 | .replace(`${part}=`, '') 175 | .split(',') 176 | .find((val) => { 177 | const [transKey, transValue] = val.split(':'); 178 | if (transKey === locale) { 179 | translation = transValue; 180 | return true; 181 | } 182 | }); 183 | 184 | return translation || part; 185 | }; 186 | 187 | const partIsTranslatable = (part: string) => { 188 | const regex = new RegExp(`^${part}=`); 189 | return regex.test(translations1) || regex.test(translations2) || regex.test(translations3); 190 | }; 191 | 192 | /** 193 | * Updates the slug based on the defined pattern. 194 | */ 195 | const updateSlug = async (locale: string, force = false) => { 196 | if (sdk.field.locale !== locale || (!force && lockWhenPublished && isLocked())) { 197 | return; 198 | } 199 | 200 | const defaultLocale = sdk.locales.default; 201 | const slugParts: string[] = []; 202 | 203 | for (const part of parts) { 204 | if (part.startsWith('field:')) { 205 | const fieldParts = part.split(':'); 206 | let raw = ''; 207 | let slug = ''; 208 | 209 | const lang: string = languages[locale.slice(0, 2).toLowerCase()] || 'en'; 210 | 211 | if (fieldParts.length === 2) { 212 | if (sdk.entry.fields[fieldParts[1]] !== undefined) { 213 | if (sdk.entry.fields[fieldParts[1]].locales.includes(locale)) { 214 | raw = sdk.entry.fields[fieldParts[1]].getValue(locale); 215 | } else { 216 | raw = sdk.entry.fields[fieldParts[1]].getValue(defaultLocale); 217 | } 218 | } 219 | // eslint-disable-next-line no-misleading-character-class 220 | slug = getSlug(raw, { ...slugOptions, lang }).replace(/[-\ufe0f]+$/gu, ''); 221 | } else { 222 | raw = (await getReferenceFieldValue(fieldParts[1], fieldParts[2], locale)) || ''; 223 | slug = getSlug(raw, { ...slugOptions, lang, custom: { '/': '/' } }) 224 | // eslint-disable-next-line no-misleading-character-class 225 | .replace(/[-\ufe0f]+$/gu, ''); 226 | } 227 | 228 | slugParts.push(slug); 229 | } else if (part === 'locale') { 230 | if (locale !== defaultLocale || (locale === defaultLocale && displayDefaultLocale)) { 231 | slugParts.push(locale); 232 | } 233 | } else if (partIsTranslatable(part)) { 234 | slugParts.push(translatePart(part, locale)); 235 | } else { 236 | slugParts.push(part); 237 | } 238 | } 239 | 240 | sdk.entry.fields[sdk.field.id].setValue( 241 | slugParts.join('/').replace('//', '/').replace(/\/$/, ''), 242 | locale 243 | ); 244 | }; 245 | 246 | const onExternalChange = (value: string) => { 247 | setValue(value); 248 | }; 249 | 250 | const onChange = async (e: React.ChangeEvent) => { 251 | const value = e.currentTarget.value; 252 | 253 | setValue(value); 254 | 255 | if (value) { 256 | await sdk.field.setValue(value); 257 | } else { 258 | await sdk.field.removeValue(); 259 | } 260 | }; 261 | 262 | return ( 263 |
264 | 265 | {!hideReset ? ( 266 | 267 | ) : null} 268 |
269 | ); 270 | }; 271 | 272 | init((sdk) => { 273 | render(, document.getElementById('root')); 274 | }); 275 | -------------------------------------------------------------------------------- /docs/src.abfa7487.js: -------------------------------------------------------------------------------- 1 | parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;cP.length&&P.push(e)}function A(e,r,o,u){var f=typeof e;"undefined"!==f&&"boolean"!==f||(e=null);var c=!1;if(null===e)c=!0;else switch(f){case"string":case"number":c=!0;break;case"object":switch(e.$$typeof){case t:case n:c=!0}}if(c)return o(u,e,""===r?"."+U(e,0):r),1;if(c=0,r=""===r?".":r+":",Array.isArray(e))for(var l=0;l=y},o=function(){},exports.unstable_forceFrameRate=function(e){0>e||125>>1,o=e[r];if(!(void 0!==o&&0P(l,t))void 0!==u&&0>P(u,l)?(e[r]=u,e[i]=t,r=i):(e[r]=l,e[a]=t,r=a);else{if(!(void 0!==u&&0>P(u,t)))break e;e[r]=u,e[i]=t,r=i}}}return n}return null}function P(e,n){var t=e.sortIndex-n.sortIndex;return 0!==t?t:e.id-n.id}var F=[],I=[],M=1,C=null,A=3,L=!1,q=!1,D=!1;function R(e){for(var n=T(I);null!==n;){if(null===n.callback)g(I);else{if(!(n.startTime<=e))break;g(I),n.sortIndex=n.expirationTime,k(F,n)}n=T(I)}}function j(t){if(D=!1,R(t),!q)if(null!==T(F))q=!0,e(E);else{var r=T(I);null!==r&&n(j,r.startTime-t)}}function E(e,o){q=!1,D&&(D=!1,t()),L=!0;var a=A;try{for(R(o),C=T(F);null!==C&&(!(C.expirationTime>o)||e&&!r());){var l=C.callback;if(null!==l){C.callback=null,A=C.priorityLevel;var i=l(C.expirationTime<=o);o=exports.unstable_now(),"function"==typeof i?C.callback=i:C===T(F)&&g(F),R(o)}else g(F);C=T(F)}if(null!==C)var u=!0;else{var s=T(I);null!==s&&n(j,s.startTime-o),u=!1}return u}finally{C=null,A=a,L=!1}}function N(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var B=o;exports.unstable_IdlePriority=5,exports.unstable_ImmediatePriority=1,exports.unstable_LowPriority=4,exports.unstable_NormalPriority=3,exports.unstable_Profiling=null,exports.unstable_UserBlockingPriority=2,exports.unstable_cancelCallback=function(e){e.callback=null},exports.unstable_continueExecution=function(){q||L||(q=!0,e(E))},exports.unstable_getCurrentPriorityLevel=function(){return A},exports.unstable_getFirstCallbackNode=function(){return T(F)},exports.unstable_next=function(e){switch(A){case 1:case 2:case 3:var n=3;break;default:n=A}var t=A;A=n;try{return e()}finally{A=t}},exports.unstable_pauseExecution=function(){},exports.unstable_requestPaint=B,exports.unstable_runWithPriority=function(e,n){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var t=A;A=e;try{return n()}finally{A=t}},exports.unstable_scheduleCallback=function(r,o,a){var l=exports.unstable_now();if("object"==typeof a&&null!==a){var i=a.delay;i="number"==typeof i&&0l?(r.sortIndex=i,k(I,r),null===T(F)&&r===T(I)&&(D?t():D=!0,n(j,i-l))):(r.sortIndex=a,k(F,r),q||L||(q=!0,e(E))),r},exports.unstable_shouldYield=function(){var e=exports.unstable_now();R(e);var n=T(F);return n!==C&&null!==C&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTimet}return!1}function $(e,t,n,r,l,i){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i}var q={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){q[e]=new $(e,0,!1,e,null,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];q[t]=new $(t,1,!1,e[1],null,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){q[e]=new $(e,2,!1,e.toLowerCase(),null,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){q[e]=new $(e,2,!1,e,null,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){q[e]=new $(e,3,!1,e.toLowerCase(),null,!1)}),["checked","multiple","muted","selected"].forEach(function(e){q[e]=new $(e,3,!0,e,null,!1)}),["capture","download"].forEach(function(e){q[e]=new $(e,4,!1,e,null,!1)}),["cols","rows","size","span"].forEach(function(e){q[e]=new $(e,6,!1,e,null,!1)}),["rowSpan","start"].forEach(function(e){q[e]=new $(e,5,!1,e.toLowerCase(),null,!1)});var Y=/[\-:]([a-z])/g;function X(e){return e[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".split(" ").forEach(function(e){var t=e.replace(Y,X);q[t]=new $(t,1,!1,e,null,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Y,X);q[t]=new $(t,1,!1,e,"http://www.w3.org/1999/xlink",!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Y,X);q[t]=new $(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1)}),["tabIndex","crossOrigin"].forEach(function(e){q[e]=new $(e,1,!1,e.toLowerCase(),null,!1)}),q.xlinkHref=new $("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0),["src","href","action","formAction"].forEach(function(e){q[e]=new $(e,1,!1,e.toLowerCase(),null,!0)});var G=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function Z(e,t,n,r){var l=q.hasOwnProperty(t)?q[t]:null;(null!==l?0===l.type:!r&&(2=n.length))throw Error(r(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:we(n)}}function De(e,t){var n=we(t.value),r=we(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function Le(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var Ue={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function Ae(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ve(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?Ae(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var Qe,We=function(e){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,l){MSApp.execUnsafeLocalFunction(function(){return e(t,n)})}:e}(function(e,t){if(e.namespaceURI!==Ue.svg||"innerHTML"in e)e.innerHTML=t;else{for((Qe=Qe||document.createElement("div")).innerHTML=""+t.valueOf().toString()+"",t=Qe.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function He(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}function je(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Be={animationend:je("Animation","AnimationEnd"),animationiteration:je("Animation","AnimationIteration"),animationstart:je("Animation","AnimationStart"),transitionend:je("Transition","TransitionEnd")},Ke={},$e={};function qe(e){if(Ke[e])return Ke[e];if(!Be[e])return e;var t,n=Be[e];for(t in n)if(n.hasOwnProperty(t)&&t in $e)return Ke[e]=n[t];return e}S&&($e=document.createElement("div").style,"AnimationEvent"in window||(delete Be.animationend.animation,delete Be.animationiteration.animation,delete Be.animationstart.animation),"TransitionEvent"in window||delete Be.transitionend.transition);var Ye=qe("animationend"),Xe=qe("animationiteration"),Ge=qe("animationstart"),Ze=qe("transitionend"),Je="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),et=new("function"==typeof WeakMap?WeakMap:Map);function tt(e){var t=et.get(e);return void 0===t&&(t=new Map,et.set(e,t)),t}function nt(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!=(1026&(t=e).effectTag)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function rt(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function lt(e){if(nt(e)!==e)throw Error(r(188))}function it(e){var t=e.alternate;if(!t){if(null===(t=nt(e)))throw Error(r(188));return t!==e?null:e}for(var n=e,l=t;;){var i=n.return;if(null===i)break;var a=i.alternate;if(null===a){if(null!==(l=i.return)){n=l;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return lt(i),e;if(a===l)return lt(i),t;a=a.sibling}throw Error(r(188))}if(n.return!==l.return)n=i,l=a;else{for(var o=!1,u=i.child;u;){if(u===n){o=!0,n=i,l=a;break}if(u===l){o=!0,l=i,n=a;break}u=u.sibling}if(!o){for(u=a.child;u;){if(u===n){o=!0,n=a,l=i;break}if(u===l){o=!0,l=a,n=i;break}u=u.sibling}if(!o)throw Error(r(189))}}if(n.alternate!==l)throw Error(r(190))}if(3!==n.tag)throw Error(r(188));return n.stateNode.current===n?e:t}function at(e){if(!(e=it(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function ot(e,t){if(null==t)throw Error(r(30));return null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}function ut(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}var ct=null;function st(e){if(e){var t=e._dispatchListeners,n=e._dispatchInstances;if(Array.isArray(t))for(var r=0;rmt.length&&mt.push(e)}function gt(e,t,n,r){if(mt.length){var l=mt.pop();return l.topLevelType=e,l.eventSystemFlags=r,l.nativeEvent=t,l.targetInst=n,l}return{topLevelType:e,eventSystemFlags:r,nativeEvent:t,targetInst:n,ancestors:[]}}function vt(e){var t=e.targetInst,n=t;do{if(!n){e.ancestors.push(n);break}var r=n;if(3===r.tag)r=r.stateNode.containerInfo;else{for(;r.return;)r=r.return;r=3!==r.tag?null:r.stateNode.containerInfo}if(!r)break;5!==(t=n.tag)&&6!==t||e.ancestors.push(n),n=Un(r)}while(n);for(n=0;n=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=vn(r)}}function bn(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?bn(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function wn(){for(var e=window,t=gn();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=gn((e=t.contentWindow).document)}return t}function kn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var xn="$",Tn="/$",En="$?",Sn="$!",Cn=null,Pn=null;function _n(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function Nn(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var zn="function"==typeof setTimeout?setTimeout:void 0,Mn="function"==typeof clearTimeout?clearTimeout:void 0;function In(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function Fn(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if(n===xn||n===Sn||n===En){if(0===t)return e;t--}else n===Tn&&t++}e=e.previousSibling}return null}var On=Math.random().toString(36).slice(2),Rn="__reactInternalInstance$"+On,Dn="__reactEventHandlers$"+On,Ln="__reactContainere$"+On;function Un(e){var t=e[Rn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ln]||n[Rn]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=Fn(e);null!==e;){if(n=e[Rn])return n;e=Fn(e)}return t}n=(e=n).parentNode}return null}function An(e){return!(e=e[Rn]||e[Ln])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function Vn(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(r(33))}function Qn(e){return e[Dn]||null}function Wn(e){do{e=e.return}while(e&&5!==e.tag);return e||null}function Hn(e,t){var n=e.stateNode;if(!n)return null;var l=d(n);if(!l)return null;n=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(l=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!l;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(r(231,t,typeof n));return n}function jn(e,t,n){(t=Hn(e,n.dispatchConfig.phasedRegistrationNames[t]))&&(n._dispatchListeners=ot(n._dispatchListeners,t),n._dispatchInstances=ot(n._dispatchInstances,e))}function Bn(e){if(e&&e.dispatchConfig.phasedRegistrationNames){for(var t=e._targetInst,n=[];t;)n.push(t),t=Wn(t);for(t=n.length;0this.eventPool.length&&this.eventPool.push(e)}function lr(e){e.eventPool=[],e.getPooled=nr,e.release=rr}t(tr.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=Jn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=Jn)},persist:function(){this.isPersistent=Jn},isPersistent:er,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=er,this._dispatchInstances=this._dispatchListeners=null}}),tr.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},tr.extend=function(e){function n(){}function r(){return l.apply(this,arguments)}var l=this;n.prototype=l.prototype;var i=new n;return t(i,r.prototype),r.prototype=i,r.prototype.constructor=r,r.Interface=t({},l.Interface,e),r.extend=l.extend,lr(r),r},lr(tr);var ir=tr.extend({data:null}),ar=tr.extend({data:null}),or=[9,13,27,32],ur=S&&"CompositionEvent"in window,cr=null;S&&"documentMode"in document&&(cr=document.documentMode);var sr=S&&"TextEvent"in window&&!cr,fr=S&&(!ur||cr&&8=cr),dr=String.fromCharCode(32),pr={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},mr=!1;function hr(e,t){switch(e){case"keyup":return-1!==or.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function gr(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var vr=!1;function yr(e,t){switch(e){case"compositionend":return gr(t);case"keypress":return 32!==t.which?null:(mr=!0,dr);case"textInput":return(e=t.data)===dr&&mr?null:e;default:return null}}function br(e,t){if(vr)return"compositionend"===e||!ur&&hr(e,t)?(e=Zn(),Gn=Xn=Yn=null,vr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=document.documentMode,tl={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},nl=null,rl=null,ll=null,il=!1;function al(e,t){var n=t.window===t?t.document:9===t.nodeType?t:t.ownerDocument;return il||null==nl||nl!==gn(n)?null:("selectionStart"in(n=nl)&&kn(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},ll&&Jr(ll,n)?null:(ll=n,(e=tr.getPooled(tl.select,rl,e,t)).type="select",e.target=nl,qn(e),e))}var ol={eventTypes:tl,extractEvents:function(e,t,n,r,l,i){if(!(i=!(l=i||(r.window===r?r.document:9===r.nodeType?r:r.ownerDocument)))){e:{l=tt(l),i=T.onSelect;for(var a=0;axl||(e.current=kl[xl],kl[xl]=null,xl--)}function El(e,t){kl[++xl]=e.current,e.current=t}var Sl={},Cl={current:Sl},Pl={current:!1},_l=Sl;function Nl(e,t){var n=e.type.contextTypes;if(!n)return Sl;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l,i={};for(l in n)i[l]=t[l];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function zl(e){return null!=(e=e.childContextTypes)}function Ml(){Tl(Pl),Tl(Cl)}function Il(e,t,n){if(Cl.current!==Sl)throw Error(r(168));El(Cl,t),El(Pl,n)}function Fl(e,n,l){var i=e.stateNode;if(e=n.childContextTypes,"function"!=typeof i.getChildContext)return l;for(var a in i=i.getChildContext())if(!(a in e))throw Error(r(108,ye(n)||"Unknown",a));return t({},l,{},i)}function Ol(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Sl,_l=Cl.current,El(Cl,e),El(Pl,Pl.current),!0}function Rl(e,t,n){var l=e.stateNode;if(!l)throw Error(r(169));n?(e=Fl(e,t,_l),l.__reactInternalMemoizedMergedChildContext=e,Tl(Pl),Tl(Cl),El(Cl,e)):Tl(Pl),El(Pl,n)}var Dl=n.unstable_runWithPriority,Ll=n.unstable_scheduleCallback,Ul=n.unstable_cancelCallback,Al=n.unstable_requestPaint,Vl=n.unstable_now,Ql=n.unstable_getCurrentPriorityLevel,Wl=n.unstable_ImmediatePriority,Hl=n.unstable_UserBlockingPriority,jl=n.unstable_NormalPriority,Bl=n.unstable_LowPriority,Kl=n.unstable_IdlePriority,$l={},ql=n.unstable_shouldYield,Yl=void 0!==Al?Al:function(){},Xl=null,Gl=null,Zl=!1,Jl=Vl(),ei=1e4>Jl?Vl:function(){return Vl()-Jl};function ti(){switch(Ql()){case Wl:return 99;case Hl:return 98;case jl:return 97;case Bl:return 96;case Kl:return 95;default:throw Error(r(332))}}function ni(e){switch(e){case 99:return Wl;case 98:return Hl;case 97:return jl;case 96:return Bl;case 95:return Kl;default:throw Error(r(332))}}function ri(e,t){return e=ni(e),Dl(e,t)}function li(e,t,n){return e=ni(e),Ll(e,t,n)}function ii(e){return null===Xl?(Xl=[e],Gl=Ll(Wl,oi)):Xl.push(e),$l}function ai(){if(null!==Gl){var e=Gl;Gl=null,Ul(e)}oi()}function oi(){if(!Zl&&null!==Xl){Zl=!0;var e=0;try{var t=Xl;ri(99,function(){for(;e=t&&(ja=!0),e.firstContext=null)}function yi(e,t){if(pi!==e&&!1!==t&&0!==t)if("number"==typeof t&&1073741823!==t||(pi=e,t=1073741823),t={context:e,observedBits:t,next:null},null===di){if(null===fi)throw Error(r(308));di=t,fi.dependencies={expirationTime:0,firstContext:t,responders:null}}else di=di.next=t;return e._currentValue}var bi=!1;function wi(e){e.updateQueue={baseState:e.memoizedState,baseQueue:null,shared:{pending:null},effects:null}}function ki(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,baseQueue:e.baseQueue,shared:e.shared,effects:e.effects})}function xi(e,t){return(e={expirationTime:e,suspenseConfig:t,tag:0,payload:null,callback:null,next:null}).next=e}function Ti(e,t){if(null!==(e=e.updateQueue)){var n=(e=e.shared).pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}}function Ei(e,t){var n=e.alternate;null!==n&&ki(n,e),null===(n=(e=e.updateQueue).baseQueue)?(e.baseQueue=t.next=t,t.next=t):(t.next=n.next,n.next=t)}function Si(e,n,r,l){var i=e.updateQueue;bi=!1;var a=i.baseQueue,o=i.shared.pending;if(null!==o){if(null!==a){var u=a.next;a.next=o.next,o.next=u}a=o,i.shared.pending=null,null!==(u=e.alternate)&&(null!==(u=u.updateQueue)&&(u.baseQueue=o))}if(null!==a){u=a.next;var c=i.baseState,s=0,f=null,d=null,p=null;if(null!==u)for(var m=u;;){if((o=m.expirationTime)s&&(s=o)}else{null!==p&&(p=p.next={expirationTime:1073741823,suspenseConfig:m.suspenseConfig,tag:m.tag,payload:m.payload,callback:m.callback,next:null}),Fu(o,m.suspenseConfig);e:{var g=e,v=m;switch(o=n,h=r,v.tag){case 1:if("function"==typeof(g=v.payload)){c=g.call(h,c,o);break e}c=g;break e;case 3:g.effectTag=-4097&g.effectTag|64;case 0:if(null==(o="function"==typeof(g=v.payload)?g.call(h,c,o):g))break e;c=t({},c,o);break e;case 2:bi=!0}}null!==m.callback&&(e.effectTag|=32,null===(o=i.effects)?i.effects=[m]:o.push(m))}if(null===(m=m.next)||m===u){if(null===(o=i.shared.pending))break;m=a.next=o.next,o.next=u,i.baseQueue=a=o,i.shared.pending=null}}null===p?f=c:p.next=d,i.baseState=f,i.baseQueue=p,Ou(s),e.expirationTime=s,e.memoizedState=c}}function Ci(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;th?(g=f,f=null):g=f.sibling;var v=p(r,f,o[h],u);if(null===v){null===f&&(f=g);break}e&&f&&null===v.alternate&&t(r,f),i=a(v,i,h),null===s?c=v:s.sibling=v,s=v,f=g}if(h===o.length)return n(r,f),c;if(null===f){for(;hg?(v=h,h=null):v=h.sibling;var b=p(i,h,y.value,c);if(null===b){null===h&&(h=v);break}e&&h&&null===b.alternate&&t(i,h),o=a(b,o,g),null===f?s=b:f.sibling=b,f=b,h=v}if(y.done)return n(i,h),s;if(null===h){for(;!y.done;g++,y=u.next())null!==(y=d(i,y.value,c))&&(o=a(y,o,g),null===f?s=y:f.sibling=y,f=y);return s}for(h=l(i,h);!y.done;g++,y=u.next())null!==(y=m(h,i,g,y.value,c))&&(e&&null!==y.alternate&&h.delete(null===y.key?g:y.key),o=a(y,o,g),null===f?s=y:f.sibling=y,f=y);return e&&h.forEach(function(e){return t(i,e)}),s}return function(e,l,a,u){var c="object"==typeof a&&null!==a&&a.type===re&&null===a.key;c&&(a=a.props.children);var s="object"==typeof a&&null!==a;if(s)switch(a.$$typeof){case te:e:{for(s=a.key,c=l;null!==c;){if(c.key===s){switch(c.tag){case 7:if(a.type===re){n(e,c.sibling),(l=i(c,a.props.children)).return=e,e=l;break e}break;default:if(c.elementType===a.type){n(e,c.sibling),(l=i(c,a.props)).ref=Di(e,c,a),l.return=e,e=l;break e}}n(e,c);break}t(e,c),c=c.sibling}a.type===re?((l=lc(a.props.children,e.mode,u,a.key)).return=e,e=l):((u=rc(a.type,a.key,a.props,null,e.mode,u)).ref=Di(e,l,a),u.return=e,e=u)}return o(e);case ne:e:{for(c=a.key;null!==l;){if(l.key===c){if(4===l.tag&&l.stateNode.containerInfo===a.containerInfo&&l.stateNode.implementation===a.implementation){n(e,l.sibling),(l=i(l,a.children||[])).return=e,e=l;break e}n(e,l);break}t(e,l),l=l.sibling}(l=ac(a,e.mode,u)).return=e,e=l}return o(e)}if("string"==typeof a||"number"==typeof a)return a=""+a,null!==l&&6===l.tag?(n(e,l.sibling),(l=i(l,a)).return=e,e=l):(n(e,l),(l=ic(a,e.mode,u)).return=e,e=l),o(e);if(Ri(a))return h(e,l,a,u);if(ge(a))return g(e,l,a,u);if(s&&Li(e,a),void 0===a&&!c)switch(e.tag){case 1:case 0:throw e=e.type,Error(r(152,e.displayName||e.name||"Component"))}return n(e,l)}}var Ai=Ui(!0),Vi=Ui(!1),Qi={},Wi={current:Qi},Hi={current:Qi},ji={current:Qi};function Bi(e){if(e===Qi)throw Error(r(174));return e}function Ki(e,t){switch(El(ji,t),El(Hi,e),El(Wi,Qi),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ve(null,"");break;default:t=Ve(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}Tl(Wi),El(Wi,t)}function $i(){Tl(Wi),Tl(Hi),Tl(ji)}function qi(e){Bi(ji.current);var t=Bi(Wi.current),n=Ve(t,e.type);t!==n&&(El(Hi,e),El(Wi,n))}function Yi(e){Hi.current===e&&(Tl(Wi),Tl(Hi))}var Xi={current:0};function Gi(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||n.data===En||n.data===Sn))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(64&t.effectTag))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function Zi(e,t){return{responder:e,props:t}}var Ji=G.ReactCurrentDispatcher,ea=G.ReactCurrentBatchConfig,ta=0,na=null,ra=null,la=null,ia=!1;function aa(){throw Error(r(321))}function oa(e,t){if(null===t)return!1;for(var n=0;na))throw Error(r(301));a+=1,la=ra=null,t.updateQueue=null,Ji.current=Fa,e=n(l,i)}while(t.expirationTime===ta)}if(Ji.current=za,t=null!==ra&&null!==ra.next,ta=0,la=ra=na=null,ia=!1,t)throw Error(r(300));return e}function ca(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===la?na.memoizedState=la=e:la=la.next=e,la}function sa(){if(null===ra){var e=na.alternate;e=null!==e?e.memoizedState:null}else e=ra.next;var t=null===la?na.memoizedState:la.next;if(null!==t)la=t,ra=e;else{if(null===e)throw Error(r(310));e={memoizedState:(ra=e).memoizedState,baseState:ra.baseState,baseQueue:ra.baseQueue,queue:ra.queue,next:null},null===la?na.memoizedState=la=e:la=la.next=e}return la}function fa(e,t){return"function"==typeof t?t(e):t}function da(e){var t=sa(),n=t.queue;if(null===n)throw Error(r(311));n.lastRenderedReducer=e;var l=ra,i=l.baseQueue,a=n.pending;if(null!==a){if(null!==i){var o=i.next;i.next=a.next,a.next=o}l.baseQueue=i=a,n.pending=null}if(null!==i){i=i.next,l=l.baseState;var u=o=a=null,c=i;do{var s=c.expirationTime;if(sna.expirationTime&&(na.expirationTime=s,Ou(s))}else null!==u&&(u=u.next={expirationTime:1073741823,suspenseConfig:c.suspenseConfig,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null}),Fu(s,c.suspenseConfig),l=c.eagerReducer===e?c.eagerState:e(l,c.action);c=c.next}while(null!==c&&c!==i);null===u?a=l:u.next=o,Gr(l,t.memoizedState)||(ja=!0),t.memoizedState=l,t.baseState=a,t.baseQueue=u,n.lastRenderedState=l}return[t.memoizedState,n.dispatch]}function pa(e){var t=sa(),n=t.queue;if(null===n)throw Error(r(311));n.lastRenderedReducer=e;var l=n.dispatch,i=n.pending,a=t.memoizedState;if(null!==i){n.pending=null;var o=i=i.next;do{a=e(a,o.action),o=o.next}while(o!==i);Gr(a,t.memoizedState)||(ja=!0),t.memoizedState=a,null===t.baseQueue&&(t.baseState=a),n.lastRenderedState=a}return[a,l]}function ma(e){var t=ca();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:fa,lastRenderedState:e}).dispatch=Na.bind(null,na,e),[t.memoizedState,e]}function ha(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=na.updateQueue)?(t={lastEffect:null},na.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ga(){return sa().memoizedState}function va(e,t,n,r){var l=ca();na.effectTag|=e,l.memoizedState=ha(1|t,n,void 0,void 0===r?null:r)}function ya(e,t,n,r){var l=sa();r=void 0===r?null:r;var i=void 0;if(null!==ra){var a=ra.memoizedState;if(i=a.destroy,null!==r&&oa(r,a.deps))return void ha(t,n,i,r)}na.effectTag|=e,l.memoizedState=ha(1|t,n,i,r)}function ba(e,t){return va(516,4,e,t)}function wa(e,t){return ya(516,4,e,t)}function ka(e,t){return ya(4,2,e,t)}function xa(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Ta(e,t,n){return n=null!=n?n.concat([e]):null,ya(4,2,xa.bind(null,t,e),n)}function Ea(){}function Sa(e,t){return ca().memoizedState=[e,void 0===t?null:t],e}function Ca(e,t){var n=sa();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&oa(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Pa(e,t){var n=sa();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&oa(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function _a(e,t,n){var r=ti();ri(98>r?98:r,function(){e(!0)}),ri(97<\/script>",e=e.removeChild(e.firstChild)):"string"==typeof i.is?e=u.createElement(a,{is:i.is}):(e=u.createElement(a),"select"===a&&(u=e,i.multiple?u.multiple=!0:i.size&&(u.size=i.size))):e=u.createElementNS(e,a),e[Rn]=n,e[Dn]=i,eo(e,n,!1,!1),n.stateNode=e,u=dn(a,i),a){case"iframe":case"object":case"embed":Jt("load",e),c=i;break;case"video":case"audio":for(c=0;ci.tailExpiration&&1t)&&hu.set(e,t))}}function xu(e,t){e.expirationTime=(e=n>(e=e.nextKnownPendingLevel)?n:e)&&t!==e?0:e}function Eu(e){if(0!==e.lastExpiredTime)e.callbackExpirationTime=1073741823,e.callbackPriority=99,e.callbackNode=ii(Cu.bind(null,e));else{var t=Tu(e),n=e.callbackNode;if(0===t)null!==n&&(e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90);else{var r=bu();if(1073741823===t?r=99:1===t||2===t?r=95:r=0>=(r=10*(1073741821-t)-10*(1073741821-r))?99:250>=r?98:5250>=r?97:95,null!==n){var l=e.callbackPriority;if(e.callbackExpirationTime===t&&l>=r)return;n!==$l&&Ul(n)}e.callbackExpirationTime=t,e.callbackPriority=r,t=1073741823===t?ii(Cu.bind(null,e)):li(r,Su.bind(null,e),{timeout:10*(1073741821-t)-ei()}),e.callbackNode=t}}}function Su(e,t){if(yu=0,t)return fc(e,t=bu()),Eu(e),null;var n=Tu(e);if(0!==n){if(t=e.callbackNode,(Yo&(Qo|Wo))!==Ao)throw Error(r(327));if(Hu(),e===Xo&&n===Zo||zu(e,n),null!==Go){var l=Yo;Yo|=Qo;for(var i=Iu();;)try{Du();break}catch(u){Mu(e,u)}if(mi(),Yo=l,Lo.current=i,Jo===jo)throw t=eu,zu(e,n),cc(e,n),Eu(e),t;if(null===Go)switch(i=e.finishedWork=e.current.alternate,e.finishedExpirationTime=n,l=Jo,Xo=null,l){case Ho:case jo:throw Error(r(345));case Bo:fc(e,2=n){e.lastPingedTime=n,zu(e,n);break}}if(0!==(a=Tu(e))&&a!==n)break;if(0!==l&&l!==n){e.lastPingedTime=l;break}e.timeoutHandle=zn(Vu.bind(null,e),i);break}Vu(e);break;case $o:if(cc(e,n),n===(l=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=Au(i)),iu&&(0===(i=e.lastPingedTime)||i>=n)){e.lastPingedTime=n,zu(e,n);break}if(0!==(i=Tu(e))&&i!==n)break;if(0!==l&&l!==n){e.lastPingedTime=l;break}if(1073741823!==nu?l=10*(1073741821-nu)-ei():1073741823===tu?l=0:(l=10*(1073741821-tu)-5e3,0>(l=(i=ei())-l)&&(l=0),(n=10*(1073741821-n)-i)<(l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*Do(l/1960))-l)&&(l=n)),10=(l=0|o.busyMinDurationMs)?l=0:(i=0|o.busyDelayMs,l=(a=ei()-(10*(1073741821-a)-(0|o.timeoutMs||5e3)))<=i?0:i+l-a),10 component higher in the tree to provide a loading indicator or placeholder to display."+be(a))}Jo!==qo&&(Jo=Bo),o=mo(o,a),f=i;do{switch(f.tag){case 3:u=o,f.effectTag|=4096,f.expirationTime=t,Ei(f,Fo(f,u,t));break e;case 1:u=o;var w=f.type,k=f.stateNode;if(0==(64&f.effectTag)&&("function"==typeof w.getDerivedStateFromError||null!==k&&"function"==typeof k.componentDidCatch&&(null===fu||!fu.has(k)))){f.effectTag|=4096,f.expirationTime=t,Ei(f,Oo(f,u,t));break e}}f=f.return}while(null!==f)}Go=Uu(Go)}catch(x){t=x;continue}break}}function Iu(){var e=Lo.current;return Lo.current=za,null===e?za:e}function Fu(e,t){elu&&(lu=e)}function Ru(){for(;null!==Go;)Go=Lu(Go)}function Du(){for(;null!==Go&&!ql();)Go=Lu(Go)}function Lu(e){var t=Ro(e.alternate,e,Zo);return e.memoizedProps=e.pendingProps,null===t&&(t=Uu(e)),Uo.current=null,t}function Uu(e){Go=e;do{var t=Go.alternate;if(e=Go.return,0==(2048&Go.effectTag)){if(t=fo(t,Go,Zo),1===Zo||1!==Go.childExpirationTime){for(var n=0,r=Go.child;null!==r;){var l=r.expirationTime,i=r.childExpirationTime;l>n&&(n=l),i>n&&(n=i),r=r.sibling}Go.childExpirationTime=n}if(null!==t)return t;null!==e&&0==(2048&e.effectTag)&&(null===e.firstEffect&&(e.firstEffect=Go.firstEffect),null!==Go.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=Go.firstEffect),e.lastEffect=Go.lastEffect),1(e=e.childExpirationTime)?t:e}function Vu(e){var t=ti();return ri(99,Qu.bind(null,e,t)),null}function Qu(e,t){do{Hu()}while(null!==pu);if((Yo&(Qo|Wo))!==Ao)throw Error(r(327));var n=e.finishedWork,l=e.finishedExpirationTime;if(null===n)return null;if(e.finishedWork=null,e.finishedExpirationTime=0,n===e.current)throw Error(r(177));e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90,e.nextKnownPendingLevel=0;var i=Au(n);if(e.firstPendingTime=i,l<=e.lastSuspendedTime?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:l<=e.firstSuspendedTime&&(e.firstSuspendedTime=l-1),l<=e.lastPingedTime&&(e.lastPingedTime=0),l<=e.lastExpiredTime&&(e.lastExpiredTime=0),e===Xo&&(Go=Xo=null,Zo=0),1u&&(s=u,u=o,o=s),s=yn(w,o),f=yn(w,u),s&&f&&(1!==x.rangeCount||x.anchorNode!==s.node||x.anchorOffset!==s.offset||x.focusNode!==f.node||x.focusOffset!==f.offset)&&((k=k.createRange()).setStart(s.node,s.offset),x.removeAllRanges(),o>u?(x.addRange(k),x.extend(f.node,f.offset)):(k.setEnd(f.node,f.offset),x.addRange(k))))),k=[];for(x=w;x=x.parentNode;)1===x.nodeType&&k.push({element:x,left:x.scrollLeft,top:x.scrollTop});for("function"==typeof w.focus&&w.focus(),w=0;w=n?io(e,t,n):(El(Xi,1&Xi.current),null!==(t=co(e,t,n))?t.sibling:null);El(Xi,1&Xi.current);break;case 19:if(l=t.childExpirationTime>=n,0!=(64&e.effectTag)){if(l)return uo(e,t,n);t.effectTag|=64}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null),El(Xi,Xi.current),!l)return null}return co(e,t,n)}ja=!1}}else ja=!1;switch(t.expirationTime=0,t.tag){case 2:if(l=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,i=Nl(t,Cl.current),vi(t,n),i=ua(null,t,l,e,i,n),t.effectTag|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,zl(l)){var a=!0;Ol(t)}else a=!1;t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,wi(t);var o=l.getDerivedStateFromProps;"function"==typeof o&&Ni(t,l,o,e),i.updater=zi,t.stateNode=i,i._reactInternalFiber=t,Oi(t,l,e,n),t=Za(null,t,l,!0,a,n)}else t.tag=0,Ba(null,t,i,n),t=t.child;return t;case 16:e:{if(i=t.elementType,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,ve(i),1!==i._status)throw i._result;switch(i=i._result,t.type=i,a=t.tag=tc(i),e=ci(i,e),a){case 0:t=Xa(null,t,i,e,n);break e;case 1:t=Ga(null,t,i,e,n);break e;case 11:t=Ka(null,t,i,e,n);break e;case 14:t=$a(null,t,i,ci(i.type,e),l,n);break e}throw Error(r(306,i,""))}return t;case 0:return l=t.type,i=t.pendingProps,Xa(e,t,l,i=t.elementType===l?i:ci(l,i),n);case 1:return l=t.type,i=t.pendingProps,Ga(e,t,l,i=t.elementType===l?i:ci(l,i),n);case 3:if(Ja(t),l=t.updateQueue,null===e||null===l)throw Error(r(282));if(l=t.pendingProps,i=null!==(i=t.memoizedState)?i.element:null,ki(e,t),Si(t,l,null,n),(l=t.memoizedState.element)===i)Wa(),t=co(e,t,n);else{if((i=t.stateNode.hydrate)&&(Ra=In(t.stateNode.containerInfo.firstChild),Oa=t,i=Da=!0),i)for(n=Vi(t,null,l,n),t.child=n;n;)n.effectTag=-3&n.effectTag|1024,n=n.sibling;else Ba(e,t,l,n),Wa();t=t.child}return t;case 5:return qi(t),null===e&&Aa(t),l=t.type,i=t.pendingProps,a=null!==e?e.memoizedProps:null,o=i.children,Nn(l,i)?o=null:null!==a&&Nn(l,a)&&(t.effectTag|=16),Ya(e,t),4&t.mode&&1!==n&&i.hidden?(t.expirationTime=t.childExpirationTime=1,t=null):(Ba(e,t,o,n),t=t.child),t;case 6:return null===e&&Aa(t),null;case 13:return io(e,t,n);case 4:return Ki(t,t.stateNode.containerInfo),l=t.pendingProps,null===e?t.child=Ai(t,null,l,n):Ba(e,t,l,n),t.child;case 11:return l=t.type,i=t.pendingProps,Ka(e,t,l,i=t.elementType===l?i:ci(l,i),n);case 7:return Ba(e,t,t.pendingProps,n),t.child;case 8:case 12:return Ba(e,t,t.pendingProps.children,n),t.child;case 10:e:{l=t.type._context,i=t.pendingProps,o=t.memoizedProps,a=i.value;var u=t.type._context;if(El(si,u._currentValue),u._currentValue=a,null!==o)if(u=o.value,0===(a=Gr(u,a)?0:0|("function"==typeof l._calculateChangedBits?l._calculateChangedBits(u,a):1073741823))){if(o.children===i.children&&!Pl.current){t=co(e,t,n);break e}}else for(null!==(u=t.child)&&(u.return=t);null!==u;){var c=u.dependencies;if(null!==c){o=u.child;for(var s=c.firstContext;null!==s;){if(s.context===l&&0!=(s.observedBits&a)){1===u.tag&&((s=xi(n,null)).tag=2,Ti(u,s)),u.expirationTime=t&&e<=t}function cc(e,t){var n=e.firstSuspendedTime,r=e.lastSuspendedTime;nt||0===n)&&(e.lastSuspendedTime=t),t<=e.lastPingedTime&&(e.lastPingedTime=0),t<=e.lastExpiredTime&&(e.lastExpiredTime=0)}function sc(e,t){t>e.firstPendingTime&&(e.firstPendingTime=t);var n=e.firstSuspendedTime;0!==n&&(t>=n?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:t>=e.lastSuspendedTime&&(e.lastSuspendedTime=t+1),t>e.nextKnownPendingLevel&&(e.nextKnownPendingLevel=t))}function fc(e,t){var n=e.lastExpiredTime;(0===n||n>t)&&(e.lastExpiredTime=t)}function dc(e,t,n,l){var i=t.current,a=bu(),o=Pi.suspense;a=wu(a,i,o);e:if(n){t:{if(nt(n=n._reactInternalFiber)!==n||1!==n.tag)throw Error(r(170));var u=n;do{switch(u.tag){case 3:u=u.stateNode.context;break t;case 1:if(zl(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break t}}u=u.return}while(null!==u);throw Error(r(171))}if(1===n.tag){var c=n.type;if(zl(c)){n=Fl(n,c,u);break e}}n=u}else n=Sl;return null===t.context?t.context=n:t.pendingContext=n,(t=xi(a,o)).payload={element:e},null!==(l=void 0===l?null:l)&&(t.callback=l),Ti(i,t),ku(i,a),a}function pc(e){if(!(e=e.current).child)return null;switch(e.child.tag){case 5:default:return e.child.stateNode}}function mc(e,t){null!==(e=e.memoizedState)&&null!==e.dehydrated&&e.retryTime=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function r(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function o(e){return this instanceof o?(this.v=e,this):new o(e)}var i=Object.freeze({__proto__:null,__extends:function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)},get __assign(){return t},__rest:function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o=0;l--)(o=e[l])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},__param:function(e,t){return function(n,r){t(n,r,e)}},__metadata:function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},__awaiter:function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function l(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,l)}u((r=r.apply(e,t||[])).next())})},__generator:function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]1||u(e,t)})})}function u(e,t){try{(n=i[e](t)).value instanceof o?Promise.resolve(n.value.v).then(s,c):f(a[0][2],n)}catch(e){f(a[0][3],e)}var n}function s(e){u("next",e)}function c(e){u("throw",e)}function f(e,t){e(t),a.shift(),a.length&&u(a[0][0],a[0][1])}},__asyncDelegator:function(e){var t,n;return t={},r("next"),r("throw",function(e){throw e}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:o(e[r](t)),done:"return"===r}:i?i(t):t}:i}},__asyncValues:function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=n(e),t={},o("next"),o("throw"),o("return"),t[Symbol.asyncIterator]=function(){return this},t);function o(n){t[n]=e[n]&&function(t){return new Promise(function(r,o){!function(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}(r,o,(t=e[n](t)).done,t.value)})}}},__makeTemplateObject:function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},__importStar:function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},__importDefault:function(e){return e&&e.__esModule?e:{default:e}}});function a(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&n.path)}},n.exports),n.exports}var l=a(function(e,t){var n;Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){this._id=0,this._listeners={}}return e.prototype.dispatch=function(){for(var e,t=[],n=0;n":"akbar-men","∑":"majmou","¤":"omla"},az:{},ca:{"∆":"delta","∞":"infinit","♥":"amor","&":"i","|":"o","<":"menys que",">":"mes que","∑":"suma dels","¤":"moneda"},cs:{"∆":"delta","∞":"nekonecno","♥":"laska","&":"a","|":"nebo","<":"mensi nez",">":"vetsi nez","∑":"soucet","¤":"mena"},de:{"∆":"delta","∞":"unendlich","♥":"Liebe","&":"und","|":"oder","<":"kleiner als",">":"groesser als","∑":"Summe von","¤":"Waehrung"},dv:{"∆":"delta","∞":"kolunulaa","♥":"loabi","&":"aai","|":"noonee","<":"ah vure kuda",">":"ah vure bodu","∑":"jumula","¤":"faisaa"},en:{"∆":"delta","∞":"infinity","♥":"love","&":"and","|":"or","<":"less than",">":"greater than","∑":"sum","¤":"currency"},es:{"∆":"delta","∞":"infinito","♥":"amor","&":"y","|":"u","<":"menos que",">":"mas que","∑":"suma de los","¤":"moneda"},fa:{"∆":"delta","∞":"bi-nahayat","♥":"eshgh","&":"va","|":"ya","<":"kamtar-az",">":"bishtar-az","∑":"majmooe","¤":"vahed"},fi:{"∆":"delta","∞":"aarettomyys","♥":"rakkaus","&":"ja","|":"tai","<":"pienempi kuin",">":"suurempi kuin","∑":"summa","¤":"valuutta"},fr:{"∆":"delta","∞":"infiniment","♥":"Amour","&":"et","|":"ou","<":"moins que",">":"superieure a","∑":"somme des","¤":"monnaie"},ge:{"∆":"delta","∞":"usasruloba","♥":"siqvaruli","&":"da","|":"an","<":"naklebi",">":"meti","∑":"jami","¤":"valuta"},gr:{},hu:{"∆":"delta","∞":"vegtelen","♥":"szerelem","&":"es","|":"vagy","<":"kisebb mint",">":"nagyobb mint","∑":"szumma","¤":"penznem"},it:{"∆":"delta","∞":"infinito","♥":"amore","&":"e","|":"o","<":"minore di",">":"maggiore di","∑":"somma","¤":"moneta"},lt:{"∆":"delta","∞":"begalybe","♥":"meile","&":"ir","|":"ar","<":"maziau nei",">":"daugiau nei","∑":"suma","¤":"valiuta"},lv:{"∆":"delta","∞":"bezgaliba","♥":"milestiba","&":"un","|":"vai","<":"mazak neka",">":"lielaks neka","∑":"summa","¤":"valuta"},my:{"∆":"kwahkhyaet","∞":"asaonasme","♥":"akhyait","&":"nhin","|":"tho","<":"ngethaw",">":"kyithaw","∑":"paungld","¤":"ngwekye"},mk:{},nl:{"∆":"delta","∞":"oneindig","♥":"liefde","&":"en","|":"of","<":"kleiner dan",">":"groter dan","∑":"som","¤":"valuta"},pl:{"∆":"delta","∞":"nieskonczonosc","♥":"milosc","&":"i","|":"lub","<":"mniejsze niz",">":"wieksze niz","∑":"suma","¤":"waluta"},pt:{"∆":"delta","∞":"infinito","♥":"amor","&":"e","|":"ou","<":"menor que",">":"maior que","∑":"soma","¤":"moeda"},ro:{"∆":"delta","∞":"infinit","♥":"dragoste","&":"si","|":"sau","<":"mai mic ca",">":"mai mare ca","∑":"suma","¤":"valuta"},ru:{"∆":"delta","∞":"beskonechno","♥":"lubov","&":"i","|":"ili","<":"menshe",">":"bolshe","∑":"summa","¤":"valjuta"},sk:{"∆":"delta","∞":"nekonecno","♥":"laska","&":"a","|":"alebo","<":"menej ako",">":"viac ako","∑":"sucet","¤":"mena"},sr:{},tr:{"∆":"delta","∞":"sonsuzluk","♥":"ask","&":"ve","|":"veya","<":"kucuktur",">":"buyuktur","∑":"toplam","¤":"para birimi"},uk:{"∆":"delta","∞":"bezkinechnist","♥":"lubov","&":"i","|":"abo","<":"menshe",">":"bilshe","∑":"suma","¤":"valjuta"},vn:{"∆":"delta","∞":"vo cuc","♥":"yeu","&":"va","|":"hoac","<":"nho hon",">":"lon hon","∑":"tong","¤":"tien te"}},s=[";","?",":","@","&","=","+","$",",","/"].join(""),l=[";","?",":","@","&","=","+","$",","].join(""),r=[".","!","~","*","'","(",")"].join(""),m=function(a,e){var m,h,g,k,y,f,p,z,b,A,v,E,O,j,S="-",w="",U="",C=!0,N={},R="";if("string"!=typeof a)return"";if("string"==typeof e&&(S=e),p=u.en,z=o.en,"object"==typeof e)for(v in m=e.maintainCase||!1,N=e.custom&&"object"==typeof e.custom?e.custom:N,g=+e.truncate>1&&e.truncate||!1,k=e.uric||!1,y=e.uricNoSlash||!1,f=e.mark||!1,C=!1!==e.symbols&&!1!==e.lang,S=e.separator||S,k&&(R+=s),y&&(R+=l),f&&(R+=r),p=e.lang&&u[e.lang]&&C?u[e.lang]:C?u.en:{},z=e.lang&&o[e.lang]?o[e.lang]:!1===e.lang||!0===e.lang?{}:o.en,e.titleCase&&"number"==typeof e.titleCase.length&&Array.prototype.toString.call(e.titleCase)?(e.titleCase.forEach(function(a){N[a+""]=a+""}),h=!0):h=!!e.titleCase,e.custom&&"number"==typeof e.custom.length&&Array.prototype.toString.call(e.custom)&&e.custom.forEach(function(a){N[a+""]=a+""}),Object.keys(N).forEach(function(e){var n;n=e.length>1?new RegExp("\\b"+c(e)+"\\b","gi"):new RegExp(c(e),"gi"),a=a.replace(n,N[e])}),N)R+=v;for(R=c(R+=S),O=!1,j=!1,A=0,E=(a=a.replace(/(^\s+|\s+$)/g,"")).length;A=0?(U+=v,v=""):!0===j?(v=i[U]+n[v],U=""):v=O&&n[v].match(/[A-Za-z0-9]/)?" "+n[v]:n[v],O=!1,j=!1):v in i?(U+=v,v="",A===E-1&&(v=i[U]),j=!0):!p[v]||k&&-1!==s.indexOf(v)||y&&-1!==l.indexOf(v)?(!0===j?(v=i[U]+v,U="",j=!1):O&&(/[A-Za-z0-9]/.test(v)||w.substr(-1).match(/A-Za-z0-9]/))&&(v=" "+v),O=!1):(v=O||w.substr(-1).match(/[A-Za-z0-9]/)?S+p[v]:p[v],v+=void 0!==a[A+1]&&a[A+1].match(/[A-Za-z0-9]/)?S:"",O=!0),w+=v.replace(new RegExp("[^\\w\\s"+R+"_-]","g"),S);return h&&(w=w.replace(/(\w)(\S*)/g,function(a,e,n){var t=e.toUpperCase()+(null!==n?n:"");return Object.keys(N).indexOf(t.toLowerCase())<0?t:t.toLowerCase()})),w=w.replace(/\s+/g,S).replace(new RegExp("\\"+S+"+","g"),S).replace(new RegExp("(^\\"+S+"+|\\"+S+"+$)","g"),""),g&&w.length>g&&(b=w.charAt(g)===S,w=w.slice(0,g),b||(w=w.slice(0,w.lastIndexOf(S)))),m||h||(w=w.toLowerCase()),w},h=function(a){return function(e){return m(e,a)}},c=function(a){return a.replace(/[-\\^$*+?.()|[\]{}\/]/g,"\\$&")},d=function(a,e){for(var n in e)if(e[n]===a)return!0};if("undefined"!=typeof module&&module.exports)module.exports=m,module.exports.createSlug=h;else if(void 0!==a&&a.amd)a([],function(){return m});else try{if(e.getSlug||e.createSlug)throw"speakingurl: globals exists /(getSlug|createSlug)/";e.getSlug=m,e.createSlug=h}catch(g){}}(this); 21 | },{}],"WDG1":[function(require,module,exports) { 22 | module.exports=require("./lib/speakingurl"); 23 | },{"./lib/speakingurl":"ztNz"}],"vKFU":[function(require,module,exports) { 24 | 25 | },{}],"zo2T":[function(require,module,exports) { 26 | "use strict";var e=this&&this.__assign||function(){return(e=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&a[a.length-1])&&(6===i[0]||2===i[0])){l=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]=O.publishedVersion+2,E||V))return[2];t=a.locales.default,i=[],s=0,u=k,n.label=1;case 1:return s