diff --git a/ci4/app/Config/Wiki/WikiRoutes.php b/ci4/app/Config/Wiki/WikiRoutes.php index eba0ee55..f8cc1384 100644 --- a/ci4/app/Config/Wiki/WikiRoutes.php +++ b/ci4/app/Config/Wiki/WikiRoutes.php @@ -5,4 +5,13 @@ use CodeIgniter\Router\RouteCollection; $routes->group('wiki', ['namespace' => 'App\Controllers\Wiki'], function ($routes) { $routes->get('','WikiController::index',["as" => "wikiIndex"]); + $routes->get('view/(:segment)','WikiController::show_page/$1',["as" => "showWikiPage"]); + $routes->get('section/(:num)','WikiController::get_section/$1',["as" => "getWikiSection"]); + $routes->post('section','WikiController::store_section/$1',["as" => "storeWikiSection"]); + $routes->post('save/(:num)','WikiController::store_save_page/$1',["as" => "storeWikiSavePage"]); + $routes->post('publish/(:num)','WikiController::store_publish_page/$1',["as" => "storeWikiPublishPage"]); + $routes->post('file/upload/(:num)','WikiController::wiki_file_upload/$1',["as" => "storeWikiFileUpload"]); + $routes->get('file/(:num)','WikiController::get_wiki_file/$1',["as" => "getWikiFile"]); + + }); \ No newline at end of file diff --git a/ci4/app/Controllers/Wiki/WikiController.php b/ci4/app/Controllers/Wiki/WikiController.php index b414cd75..ba6faf18 100644 --- a/ci4/app/Controllers/Wiki/WikiController.php +++ b/ci4/app/Controllers/Wiki/WikiController.php @@ -3,12 +3,111 @@ namespace App\Controllers\Wiki; use App\Controllers\BaseController; +use App\Models\Wiki\WikiContentModel; +use App\Models\Wiki\WikiFileModel; +use App\Models\Wiki\WikiPageModel; +use App\Models\Wiki\WikiSectionModel; +use CodeIgniter\HTTP\RequestInterface; use CodeIgniter\HTTP\ResponseInterface; +use Psr\Log\LoggerInterface; class WikiController extends BaseController { + protected WikiSectionModel $wikiSectionModel; + protected WikiContentModel $wikiContentModel; + protected WikiPageModel $wikiPageModel; + protected WikiFileModel $wikiFileModel; + + protected string $locale; + protected array $viewData; + + public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger) + { + $this->wikiSectionModel = model(WikiSectionModel::class); + $this->wikiPageModel = model(WikiPageModel::class); + $this->wikiContentModel = model(WikiContentModel::class); + $this->wikiFileModel = model(WikiFileModel::class); + + $sections = $this->wikiSectionModel->sections(); + $this->locale = session()->get('lang'); + + $this->viewData['wiki_sections'] = $sections; + parent::initController($request, $response, $logger); + } public function index() { - return view('themes/vuexy/wiki/pages/home'); + return view('themes/vuexy/wiki/pages/render', $this->viewData); + } + public function show_page(string $slug) + { + $section = $this->wikiSectionModel->where('slug', $slug)->first(); + $this->viewData['slug'] = $slug; + $this->viewData['section'] = $section->withAll($this->locale); + + return view('themes/vuexy/wiki/pages/render', $this->viewData); + } + public function get_section(int $section_id) + { + $section = $this->wikiSectionModel->find($section_id)->withAll($this->locale); + return $this->response->setJSON(["data" => $section, "message" => lang("App.global_alert_fetch_success")]); + } + public function store_save_page(int $section_id) + { + $bodyData = $this->request->getPost(); + $wikiSectionPage = $this->wikiSectionModel->find($section_id)->page(); + if ($wikiSectionPage) { + $wikiPageId = $wikiSectionPage->id; + } else { + $wikiPageId = $this->wikiPageModel->insert(['section_id' => $section_id]); + } + $content = $this->wikiContentModel->where('locale', $this->locale)->where('page_id', $wikiPageId)->countAllResults(); + if ($content > 0) { + $this->wikiContentModel->where('locale', $this->locale)->where('page_id', $wikiPageId)->delete(); + } + + $this->wikiContentModel->insert([ + "locale" => $this->locale, + "page_id" => $wikiPageId, + "editor_data" => json_encode($bodyData) + ]); + return $this->response->setJSON(["data" => [], "message" => lang("App.global_alert_save_success")]); + } + public function wiki_file_upload(int $section_id) + { + try { + $file = $this->request->getFile('image'); + $section = $this->wikiSectionModel->find($section_id); + $content = $section->content(); + $r = null; + $fullpath = null; + if ($file->isValid() && !$file->hasMoved()) { + $fullpath = $file->store('wiki_images/' . $section->slug); + $r = $this->wikiFileModel->insert(["content_id" => $content->id, "path" => $fullpath]); + return $this->response->setJSON(["success" => 1, "file" => [ + "url" => '/wiki/file/'.$r + ]]); + }else{ + return $this->response->setJSON(["success" => 0, "file" => [ + "url" => null + ]]); + } + } catch (\Throwable $th) { + + return $this->response->setJSON(["success" => 0, "error" => $th->getMessage()])->setStatusCode($th->getCode()); + } + } + public function get_wiki_file(int $wiki_file_id) + { + $wikiFile = $this->wikiFileModel->find($wiki_file_id); + if ($wikiFile->path) { + $filePath = WRITEPATH . 'uploads/' . $wikiFile->path; + $mimeType = mime_content_type($filePath); + return $this->response + ->setHeader('Content-Type', $mimeType) + ->setHeader('Content-Length', filesize($filePath)) + ->setBody(file_get_contents($filePath)); + } else { + return $this->response->setJSON(["message" => "Portada error", "error" => "No hay portada"])->setStatusCode(400); + } } } diff --git a/ci4/app/Database/Migrations/2025-02-22-074400_WikiSectionsMigration.php b/ci4/app/Database/Migrations/2025-02-22-074400_WikiSectionsMigration.php new file mode 100644 index 00000000..f43eb033 --- /dev/null +++ b/ci4/app/Database/Migrations/2025-02-22-074400_WikiSectionsMigration.php @@ -0,0 +1,69 @@ + [ + 'type' => 'INT', + 'unsigned' => true, + 'auto_increment' => true, + ], + 'name' => [ + 'type' => 'VARCHAR', + 'constraint' => 255, + ], + 'slug' => [ + 'type' => 'VARCHAR', + 'constraint' => 255, + ], + 'role' => [ + 'type' => 'VARCHAR', + 'constraint' => 255, + 'default' => 'admin' + ], + 'parent_section_id' => [ + 'type' => 'INT', + 'unsigned' => true, + 'null' => true, + + ], + + ]; + + public function up() + { + $this->forge->addField($this->COLUMNS); + $currenttime = new RawSql('CURRENT_TIMESTAMP'); + $this->forge->addField([ + 'created_at' => [ + 'type' => 'TIMESTAMP', + 'default' => $currenttime, + + ], + 'updated_at' => [ + 'type' => 'TIMESTAMP', + 'null' => true, + + ], + 'deleted_at' => [ + 'type' => 'TIMESTAMP', + 'null' => true, + + ], + ]); + $this->forge->addPrimaryKey('id'); + $this->forge->addForeignKey('parent_section_id','wiki_sections','id'); + $this->forge->createTable("wiki_sections"); + } + + public function down() + { + $this->forge->dropTable("wiki_sections"); + } +} diff --git a/ci4/app/Database/Migrations/2025-02-22-080000_WikiPagesMigration.php b/ci4/app/Database/Migrations/2025-02-22-080000_WikiPagesMigration.php new file mode 100644 index 00000000..349d9c63 --- /dev/null +++ b/ci4/app/Database/Migrations/2025-02-22-080000_WikiPagesMigration.php @@ -0,0 +1,51 @@ + [ + 'type' => 'INT', + 'unsigned' => true, + 'auto_increment' => true, + ], + 'section_id' => [ + 'type' => 'INT', + 'unsigned' => true, + ], + ]; + + public function up() + { + $this->forge->addField($this->COLUMNS); + $currenttime = new RawSql('CURRENT_TIMESTAMP'); + $this->forge->addField([ + 'created_at' => [ + 'type' => 'TIMESTAMP', + 'default' => $currenttime, + ], + 'updated_at' => [ + 'type' => 'TIMESTAMP', + 'null' => true, + ], + 'deleted_at' => [ + 'type' => 'TIMESTAMP', + 'null' => true, + + ], + ]); + $this->forge->addPrimaryKey('id'); + $this->forge->addForeignKey('section_id','wiki_sections','id'); + $this->forge->createTable("wiki_pages"); + } + + public function down() + { + $this->forge->dropTable("wiki_pages"); + } +} diff --git a/ci4/app/Database/Migrations/2025-02-22-080100_WikiContentsMigration.php b/ci4/app/Database/Migrations/2025-02-22-080100_WikiContentsMigration.php new file mode 100644 index 00000000..8ec4389e --- /dev/null +++ b/ci4/app/Database/Migrations/2025-02-22-080100_WikiContentsMigration.php @@ -0,0 +1,64 @@ + [ + 'type' => 'INT', + 'unsigned' => true, + 'auto_increment' => true, + ], + 'locale' => [ + 'type' => 'VARCHAR', + 'constraint' => 255, + 'default' => 'es', + ], + 'page_id' => [ + 'type' => 'INT', + 'unsigned' => true, + ], + 'editor_data' => [ + 'type' => 'LONGTEXT', + 'null' => true, + ], + 'published_data' => [ + 'type' => 'LONGTEXT', + 'null' => true, + ], + ]; + + public function up() + { + $this->forge->addField($this->COLUMNS); + $currenttime = new RawSql('CURRENT_TIMESTAMP'); + $this->forge->addField([ + 'created_at' => [ + 'type' => 'TIMESTAMP', + 'default' => $currenttime, + ], + 'updated_at' => [ + 'type' => 'TIMESTAMP', + 'null' => true, + ], + 'deleted_at' => [ + 'type' => 'TIMESTAMP', + 'null' => true, + + ], + ]); + $this->forge->addPrimaryKey('id'); + $this->forge->addForeignKey('page_id','wiki_pages','id'); + $this->forge->createTable("wiki_contents"); + } + + public function down() + { + $this->forge->dropTable("wiki_contents"); + } +} diff --git a/ci4/app/Database/Migrations/2025-02-22-080200_WikiFilesMigration.php b/ci4/app/Database/Migrations/2025-02-22-080200_WikiFilesMigration.php new file mode 100644 index 00000000..eb04bf01 --- /dev/null +++ b/ci4/app/Database/Migrations/2025-02-22-080200_WikiFilesMigration.php @@ -0,0 +1,56 @@ + [ + 'type' => 'INT', + 'unsigned' => true, + 'auto_increment' => true, + ], + 'content_id' => [ + 'type' => 'INT', + 'unsigned' => true, + ], + 'path' => [ + 'type' => 'LONGTEXT', + 'null' => true, + ], + + ]; + + public function up() + { + $this->forge->addField($this->COLUMNS); + $currenttime = new RawSql('CURRENT_TIMESTAMP'); + $this->forge->addField([ + 'created_at' => [ + 'type' => 'TIMESTAMP', + 'default' => $currenttime, + ], + 'updated_at' => [ + 'type' => 'TIMESTAMP', + 'null' => true, + ], + 'deleted_at' => [ + 'type' => 'TIMESTAMP', + 'null' => true, + + ], + ]); + $this->forge->addPrimaryKey('id'); + $this->forge->addForeignKey('content_id','wiki_contents','id'); + $this->forge->createTable("wiki_files"); + } + + public function down() + { + $this->forge->dropTable("wiki_files"); + } +} diff --git a/ci4/app/Entities/Wiki/WikiContentEntity.php b/ci4/app/Entities/Wiki/WikiContentEntity.php new file mode 100644 index 00000000..47140b76 --- /dev/null +++ b/ci4/app/Entities/Wiki/WikiContentEntity.php @@ -0,0 +1,21 @@ + null, + "page_id" => null, + "editor_data" => null, + "published_data" => null, + ]; + protected $casts = [ + "locale" => "string", + "page_id" => "int", + "editor_data" => "string", + "published_data" => "string", + ]; + +} diff --git a/ci4/app/Entities/Wiki/WikiFileEntity.php b/ci4/app/Entities/Wiki/WikiFileEntity.php new file mode 100644 index 00000000..27330f70 --- /dev/null +++ b/ci4/app/Entities/Wiki/WikiFileEntity.php @@ -0,0 +1,17 @@ + null, + "path" => null, + ]; + protected $casts = [ + "content_id" => "int", + "path" => "string", + ]; + +} diff --git a/ci4/app/Entities/Wiki/WikiPageEntity.php b/ci4/app/Entities/Wiki/WikiPageEntity.php new file mode 100644 index 00000000..ef015057 --- /dev/null +++ b/ci4/app/Entities/Wiki/WikiPageEntity.php @@ -0,0 +1,15 @@ + null, + ]; + protected $casts = [ + "section_id" => "int", + ]; + +} diff --git a/ci4/app/Entities/Wiki/WikiSectionEntity.php b/ci4/app/Entities/Wiki/WikiSectionEntity.php new file mode 100644 index 00000000..420b07fb --- /dev/null +++ b/ci4/app/Entities/Wiki/WikiSectionEntity.php @@ -0,0 +1,59 @@ + null, + "slug" => null, + "role" => null, + "parent_id" => null + ]; + protected $casts = [ + "name" => "string", + "slug" => "string", + "role" => "string", + "parent_id" => "int" + ]; + + public function withPage(): self + { + $this->attributes['pages'] = $this->page(); + return $this; + } + + public function withContents(string $locale = "es"): self + { + $m = model(WikiContentModel::class); + $this->attributes['contents'] = $this->content($locale); + return $this; + } + public function withAll(string $locale = "es") : self + { + $this->withPage(); + $this->withContents($locale); + return $this; + + } + public function page(): ?WikiPageEntity + { + $m = model(WikiPageModel::class); + return $m->where('section_id',$this->attributes['id'])->first(); + } + public function content(string $locale = "es"): ?WikiContentEntity + { + $page = $this->page(); + $content = null; + $m = model(WikiContentModel::class); + if($page){ + $content = $m->where('page_id',$page->id) + ->where('locale',$locale) + ->first(); + } + return $content; + } +} diff --git a/ci4/app/Language/es/App.php b/ci4/app/Language/es/App.php index a24597ea..a6534185 100755 --- a/ci4/app/Language/es/App.php +++ b/ci4/app/Language/es/App.php @@ -19,6 +19,7 @@ return [ "global_come_back" => "Volver", "global_save" => "Guardar", "global_alert_save_success" => "¡Guardado exitosamente!", + "global_alert_fetch_success" => "Obtenido exitosamente!", "global_alert_save_error" => "¡Error al guardar!", "global_activate" => "Activar", "global_disable" => "Desactivar", diff --git a/ci4/app/Models/Wiki/WikiContentModel.php b/ci4/app/Models/Wiki/WikiContentModel.php new file mode 100644 index 00000000..7f86cbb5 --- /dev/null +++ b/ci4/app/Models/Wiki/WikiContentModel.php @@ -0,0 +1,53 @@ + + */ + public function sections() : array + { + return $this->where('role','admin')->findAll(); + } +} diff --git a/ci4/app/Views/themes/vuexy/wiki/layout.php b/ci4/app/Views/themes/vuexy/wiki/layout.php index b79b2014..12ad4644 100644 --- a/ci4/app/Views/themes/vuexy/wiki/layout.php +++ b/ci4/app/Views/themes/vuexy/wiki/layout.php @@ -90,7 +90,38 @@ $picture = "/assets/img/default-user.png";
- +
@@ -236,7 +267,7 @@ $picture = "/assets/img/default-user.png"; - + diff --git a/ci4/app/Views/themes/vuexy/wiki/pages/home.php b/ci4/app/Views/themes/vuexy/wiki/pages/render.php similarity index 74% rename from ci4/app/Views/themes/vuexy/wiki/pages/home.php rename to ci4/app/Views/themes/vuexy/wiki/pages/render.php index 2e951f5d..f9e35c72 100644 --- a/ci4/app/Views/themes/vuexy/wiki/pages/home.php +++ b/ci4/app/Views/themes/vuexy/wiki/pages/render.php @@ -1,6 +1,7 @@ include('themes/_commonPartialsBs/select2bs5') ?> include('themes/_commonPartialsBs/datatables') ?> include('themes/_commonPartialsBs/_confirm2delete') ?> +include("themes/_commonPartialsBs/sweetalert") ?> extend('themes/vuexy/wiki/layout') ?> section('content'); ?> @@ -13,7 +14,12 @@
- +
+ + + + +
user()->inGroup('admin')): ?>
@@ -27,6 +33,7 @@
+
@@ -40,7 +47,15 @@
-section("additionalExternalJs") ?> - endSection() ?> + +section('css') ?> + +endSection() ?> + +section("additionalExternalJs") ?> + + + + endSection() ?> \ No newline at end of file diff --git a/ci4/app/Views/themes/vuexy/wiki/sidebar.php b/ci4/app/Views/themes/vuexy/wiki/sidebar.php index 1e28f3ea..77d5e5b9 100644 --- a/ci4/app/Views/themes/vuexy/wiki/sidebar.php +++ b/ci4/app/Views/themes/vuexy/wiki/sidebar.php @@ -17,17 +17,12 @@ diff --git a/httpdocs/assets/js/safekat/components/alerts/sweetAlert.js b/httpdocs/assets/js/safekat/components/alerts/sweetAlert.js index 75b668e2..2c5e8295 100644 --- a/httpdocs/assets/js/safekat/components/alerts/sweetAlert.js +++ b/httpdocs/assets/js/safekat/components/alerts/sweetAlert.js @@ -1,6 +1,5 @@ - export const alertConfirmationDelete = (title, type = "primary") => { return Swal.fire({ title: '¿Está seguro?', @@ -63,4 +62,54 @@ export const toastPresupuestoSummary = (value, target = 'body') => { timerProgressBar: false, stopKeydownPropagation: false, }) +} +export const alertSuccess = (value, target = 'body') => { + return Swal.mixin({ + toast: true, + position: 'bottom-end', + html: ` + ${value}`, + customClass: { + popup: 'bg-success text-white', + }, + icon : 'success', + iconColor: 'white', + target: target, + showConfirmButton: false, + timer: 2000, + timerProgressBar: true, + }) +} +export const alertError = (value, target = 'body') => { + return Swal.mixin({ + toast: true, + position: 'bottom-end', + html: `${value}`, + customClass: { + popup: 'bg-error text-white', + }, + icon : 'error', + iconColor: 'white', + target: target, + showConfirmButton: false, + timer: 2000, + timerProgressBar: true, + }) +} +export const alertWarning = (value, target = 'body') => { + return Swal.mixin({ + toast: true, + position: 'bottom-end', + html: ` + ${value}`, + customClass: { + popup: 'bg-warning text-white', + }, + icon : 'warning', + iconColor: 'white', + target: target, + showConfirmButton: false, + timer: 2000, + timerProgressBar: true, + }) } \ No newline at end of file diff --git a/httpdocs/assets/js/safekat/components/editorjs/WikiEditor.js b/httpdocs/assets/js/safekat/components/editorjs/WikiEditor.js new file mode 100644 index 00000000..bafce420 --- /dev/null +++ b/httpdocs/assets/js/safekat/components/editorjs/WikiEditor.js @@ -0,0 +1,170 @@ + +import { es } from './lang/es.js'; +import EditorJS from '../../../../../themes/vuexy/js/editorjs.mjs'; +import '../../../../../../themes/vuexy/js/editorjs/header.js'; +import '../../../../../themes/vuexy/js/editorjs/list.js'; +import '../../../../../../themes/vuexy/js/editorjs/alert.js'; +import '../../../../../../themes/vuexy/js/editorjs/drag-drop.js'; +import '../../../../../../themes/vuexy/js/editorjs/image.js'; +import '../../../../../themes/vuexy/js/editorjs/table.js'; +import '../../../../../themes/vuexy/js/editorjs/tune.js'; + + +import Ajax from '../ajax.js' +import { alertError, alertSuccess, alertWarning } from '../alerts/sweetAlert.js'; + +class WikiEditor { + constructor() { + this.sectionId = $("#wiki-section-id").val(); + this.editor = new EditorJS({ + holder: 'editorjs', + i18n: es, + autofocus: true, + placeholder: 'Empieza a diseñar aquí', + readOnly: true, + tunes: { + alignment: { + class: AlignmentBlockTune, + }, + }, + tools: { + + header: { + class: Header, + tunes : ['alignment'], + config: { + placeholder: 'Introduce un encabezado ...', + levels: [1, 2, 3, 4], + defaultLevel: 3 + }, + }, + nestedchecklist: { + class: editorjsNestedChecklist , + config : { + maxLevel : 1, + } + }, + alert: { + class: Alert, + inlineToolbar: true, + tunes : ['alignment'], + shortcut: 'CMD+SHIFT+W', + config: { + alertTypes: ['primary', 'secondary', 'info', 'success', 'warning', 'danger', 'light', 'dark'], + defaultType: 'primary', + messagePlaceholder: 'Introduzca texto', + }, + }, + image: { + class: ImageTool, + tunes : ['alignment'], + config: { + features: { + border: false, + caption: 'optional', + stretch: false + }, + endpoints: { + byFile: `/wiki/file/upload/${this.sectionId}`, // Your backend file uploader endpoint + byUrl: 'fetchUrl', // Your endpoint that provides uploading by Url + } + } + }, + table: { + class: Table, + tunes : ['alignment'], + inlineToolbar: true, + config: { + rows: 2, + cols: 3, + maxRows: 5, + maxCols: 5, + }, + }, + alignment: { + class:AlignmentBlockTune, + config:{ + default: "left", + blocks: { + header: 'left', + list: 'left' + } + } + }, + + + }, + }) + } + async init() { + try { + await this.editor.isReady; + new DragDrop(this.editor); + /** Do anything you need after editor initialization */ + $('#save-editor').on('click', () => { + this.editor.save().then(outputData => { + console.log("Data saved", outputData) + this.handleSaveContent(outputData) + }) + }) + $('#preview-editor').on('click', () => { + this.editor.readOnly.toggle() + $('#edit-editor').removeClass('d-none') + $('#preview-editor').addClass('d-none') + }) + $('#edit-editor').on('click', () => { + $('#edit-editor').addClass('d-none') + $('#preview-editor').removeClass('d-none') + this.editor.readOnly.toggle() + }) + this.handleGetData(); + } catch (reason) { + console.log(`Editor.js initialization failed because of ${reason}`) + } + } + + handleGetData() { + const ajax = new Ajax(`/wiki/section/${this.sectionId}`, + null, + null, + this.handleGetDataSuccess.bind(this), + this.handleGetDataError.bind(this)) + ajax.get() + } + handleGetDataSuccess(response) { + if (response.data.contents) { + alertSuccess(response.message).fire() + this.renderContent(response.data.contents.editor_data) + } else { + alertWarning('No hay contenido').fire() + + } + } + handleGetDataError(error) { + console.log(error) + } + renderContent(content) { + try { + let parsedContent = JSON.parse(content) + this.editor.render(parsedContent) + } catch (error) { + console.log(error) + } + } + handleSaveContent(data) { + + const ajax = new Ajax(`/wiki/save/${this.sectionId}`, + data, + null, + this.handleSaveContentSuccess.bind(this), + this.handleSaveContentError.bind(this)) + ajax.post() + } + handleSaveContentSuccess(response) { + this.handleGetData() + // alertSuccess(response.message).fire() + } + handleSaveContentError(response) { } + +} +export default WikiEditor \ No newline at end of file diff --git a/httpdocs/assets/js/safekat/pages/wiki/demo.js b/httpdocs/assets/js/safekat/components/editorjs/demo.js similarity index 100% rename from httpdocs/assets/js/safekat/pages/wiki/demo.js rename to httpdocs/assets/js/safekat/components/editorjs/demo.js diff --git a/httpdocs/assets/js/safekat/pages/wiki/lang/es.js b/httpdocs/assets/js/safekat/components/editorjs/lang/es.js similarity index 100% rename from httpdocs/assets/js/safekat/pages/wiki/lang/es.js rename to httpdocs/assets/js/safekat/components/editorjs/lang/es.js diff --git a/httpdocs/assets/js/safekat/pages/wiki/home.js b/httpdocs/assets/js/safekat/pages/wiki/home.js index 727f0a99..f7f87598 100644 --- a/httpdocs/assets/js/safekat/pages/wiki/home.js +++ b/httpdocs/assets/js/safekat/pages/wiki/home.js @@ -1,76 +1,13 @@ -import { es } from './lang/es.js'; -import '../../../../../themes/vuexy/js/editorjs/list.js'; -import '../../../../../themes/vuexy/js/editorjs/header.js'; -import EditorJS from '../../../../../themes/vuexy/js/editorjs.mjs'; -import '../../../../../themes/vuexy/js/editorjs/alert.js'; -import '../../../../../themes/vuexy/js/editorjs/drag-drop.js'; -import '../../../../../themes/vuexy/js/editorjs/image.js'; -import { dataExample } from './demo.js'; +import WikiEditor from "../../components/editorjs/WikiEditor.js" -const editor = new EditorJS({ - holder : 'editorjs', - i18n : es, - autofocus: true, - placeholder : 'Empieza a diseñar aquí', - readOnly : true, - tools: { - header: { - class: Header, - config: { - placeholder: 'Introduce un encabezado ...', - levels: [1,2, 3,4], - defaultLevel: 3 - }, - }, - list: { - class: EditorjsList, - inlineToolbar: true, - config: { - defaultStyle: 'unordered' - }, - }, - alert: { - class: Alert , - inlineToolbar: true, - shortcut: 'CMD+SHIFT+W', - config: { - alertTypes: ['primary', 'secondary', 'info', 'success', 'warning', 'danger', 'light', 'dark'], - defaultType: 'primary', - messagePlaceholder: 'Introduzca texto', - }, - }, - image: { - class: ImageTool, - config: { - endpoints: { - byFile: 'http://localhost:8008/uploadFile', // Your backend file uploader endpoint - byUrl: 'http://localhost:8008/fetchUrl', // Your endpoint that provides uploading by Url - } - } - } - }, -}) -try { - await editor.isReady; - new DragDrop(editor); - editor.render(dataExample) - /** Do anything you need after editor initialization */ - $('#save-editor').on('click',() => { - editor.save().then(outputData => { - console.log("Data saved",outputData) - }) - }) - $('#preview-editor').on('click',() => { - editor.readOnly.toggle() - $('#edit-editor').removeClass('d-none') - $('#preview-editor').addClass('d-none') - }) - $('#edit-editor').on('click',() => { - $('#edit-editor').addClass('d-none') - $('#preview-editor').removeClass('d-none') - editor.readOnly.toggle() -}) -} catch (reason) { - console.log(`Editor.js initialization failed because of ${reason}`) -} \ No newline at end of file + +$(async() => { + + try { + const editor = new WikiEditor() + await editor.init() + } catch (error) { + + } +}) \ No newline at end of file diff --git a/httpdocs/themes/vuexy/js/editorjs/columns.js b/httpdocs/themes/vuexy/js/editorjs/columns.js new file mode 100644 index 00000000..233465e5 --- /dev/null +++ b/httpdocs/themes/vuexy/js/editorjs/columns.js @@ -0,0 +1,8 @@ +/** + * Skipped minification because the original files appears to be already minified. + * Original file: /npm/@calumk/editorjs-columns@0.3.2/dist/editorjs-columns.bundle.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +/*! For license information please see editorjs-columns.bundle.js.LICENSE.txt */ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.editorjsColumns=e():t.editorjsColumns=e()}(self,(()=>(()=>{var t={745:(t,e,o)=>{"use strict";o.d(e,{Z:()=>r});var n=o(81),a=o.n(n),s=o(645),i=o.n(s)()(a());i.push([t.id,".ce-editorjsColumns_col{flex:50%}.ce-editorjsColumns_wrapper{display:flex;width:100%;gap:10px;margin-bottom:10px;flex-direction:row}.ce-editorjsColumns_wrapper .ce-toolbar__actions{z-index:0}.ce-editorjsColumns_wrapper .ce-toolbar{z-index:4}.ce-editorjsColumns_wrapper .ce-popover{z-index:4000}@media(max-width: 800px){.ce-editorjsColumns_wrapper{flex-direction:column;padding:10px;border:1px solid #ccc;border-radius:4px}}.ce-inline-toolbar{z-index:1000}.ce-block__content,.ce-toolbar__content{max-width:calc(100% - 50px)}.ce-toolbar__actions{right:calc(100% + 30px);background-color:rgba(255,255,255,.5);border-radius:4px}.codex-editor--narrow .codex-editor__redactor{margin:0}.ce-toolbar{z-index:4}.codex-editor{z-index:auto !important}",""]);const r=i},645:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var o="",n=void 0!==e[5];return e[4]&&(o+="@supports (".concat(e[4],") {")),e[2]&&(o+="@media ".concat(e[2]," {")),n&&(o+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),o+=t(e),n&&(o+="}"),e[2]&&(o+="}"),e[4]&&(o+="}"),o})).join("")},e.i=function(t,o,n,a,s){"string"==typeof t&&(t=[[null,t,void 0]]);var i={};if(n)for(var r=0;r0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=s),o&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=o):d[2]=o),a&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=a):d[4]="".concat(a)),e.push(d))}},e}},81:t=>{"use strict";t.exports=function(t){return t[1]}},379:t=>{"use strict";var e=[];function o(t){for(var o=-1,n=0;n{"use strict";var e={};t.exports=function(t,o){var n=function(t){if(void 0===e[t]){var o=document.querySelector(t);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(t){o=null}e[t]=o}return e[t]}(t);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(o)}},216:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},565:(t,e,o)=>{"use strict";t.exports=function(t){var e=o.nc;e&&t.setAttribute("nonce",e)}},795:t=>{"use strict";t.exports=function(t){var e=t.insertStyleElement(t);return{update:function(o){!function(t,e,o){var n="";o.supports&&(n+="@supports (".concat(o.supports,") {")),o.media&&(n+="@media ".concat(o.media," {"));var a=void 0!==o.layer;a&&(n+="@layer".concat(o.layer.length>0?" ".concat(o.layer):""," {")),n+=o.css,a&&(n+="}"),o.media&&(n+="}"),o.supports&&(n+="}");var s=o.sourceMap;s&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),e.styleTagTransform(n,t,e.options)}(e,t,o)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},589:t=>{"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},40:t=>{t.exports=''},455:function(t){t.exports=function(){"use strict";const t="SweetAlert2:",e=t=>t.charAt(0).toUpperCase()+t.slice(1),o=t=>Array.prototype.slice.call(t),n=e=>{console.warn("".concat(t," ").concat("object"==typeof e?e.join(" "):e))},a=e=>{console.error("".concat(t," ").concat(e))},s=[],i=(t,e)=>{var o;o='"'.concat(t,'" is deprecated and will be removed in the next major release. Please use "').concat(e,'" instead.'),s.includes(o)||(s.push(o),n(o))},r=t=>"function"==typeof t?t():t,l=t=>t&&"function"==typeof t.toPromise,c=t=>l(t)?t.toPromise():Promise.resolve(t),d=t=>t&&Promise.resolve(t)===t,u={title:"",titleText:"",text:"",html:"",footer:"",icon:void 0,iconColor:void 0,iconHtml:void 0,template:void 0,toast:!1,showClass:{popup:"swal2-show",backdrop:"swal2-backdrop-show",icon:"swal2-icon-show"},hideClass:{popup:"swal2-hide",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-hide"},customClass:{},target:"body",color:void 0,backdrop:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showDenyButton:!1,showCancelButton:!1,preConfirm:void 0,preDeny:void 0,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:void 0,denyButtonText:"No",denyButtonAriaLabel:"",denyButtonColor:void 0,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:void 0,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusDeny:!1,focusCancel:!1,returnFocus:!0,showCloseButton:!1,closeButtonHtml:"×",closeButtonAriaLabel:"Close this dialog",loaderHtml:"",showLoaderOnConfirm:!1,showLoaderOnDeny:!1,imageUrl:void 0,imageWidth:void 0,imageHeight:void 0,imageAlt:"",timer:void 0,timerProgressBar:!1,width:void 0,padding:void 0,background:void 0,input:void 0,inputPlaceholder:"",inputLabel:"",inputValue:"",inputOptions:{},inputAutoTrim:!0,inputAttributes:{},inputValidator:void 0,returnInputValueOnDeny:!1,validationMessage:void 0,grow:!1,position:"center",progressSteps:[],currentProgressStep:void 0,progressStepsDistance:void 0,willOpen:void 0,didOpen:void 0,didRender:void 0,willClose:void 0,didClose:void 0,didDestroy:void 0,scrollbarPadding:!0},p=["allowEscapeKey","allowOutsideClick","background","buttonsStyling","cancelButtonAriaLabel","cancelButtonColor","cancelButtonText","closeButtonAriaLabel","closeButtonHtml","color","confirmButtonAriaLabel","confirmButtonColor","confirmButtonText","currentProgressStep","customClass","denyButtonAriaLabel","denyButtonColor","denyButtonText","didClose","didDestroy","footer","hideClass","html","icon","iconColor","iconHtml","imageAlt","imageHeight","imageUrl","imageWidth","preConfirm","preDeny","progressSteps","returnFocus","reverseButtons","showCancelButton","showCloseButton","showConfirmButton","showDenyButton","text","title","titleText","willClose"],m={},w=["allowOutsideClick","allowEnterKey","backdrop","focusConfirm","focusDeny","focusCancel","returnFocus","heightAuto","keydownListenerCapture"],g=t=>Object.prototype.hasOwnProperty.call(u,t),h=t=>-1!==p.indexOf(t),f=t=>m[t],b=t=>{g(t)||n('Unknown parameter "'.concat(t,'"'))},y=t=>{w.includes(t)&&n('The parameter "'.concat(t,'" is incompatible with toasts'))},v=t=>{f(t)&&i(t,f(t))},x=t=>{const e={};for(const o in t)e[t[o]]="swal2-"+t[o];return e},k=x(["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","show","hide","close","title","html-container","actions","confirm","deny","cancel","default-outline","footer","icon","icon-content","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","input-label","validation-message","progress-steps","active-progress-step","progress-step","progress-step-line","loader","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl","timer-progress-bar","timer-progress-bar-container","scrollbar-measure","icon-success","icon-warning","icon-info","icon-question","icon-error","no-war"]),C=x(["success","warning","info","question","error"]),A=()=>document.body.querySelector(".".concat(k.container)),B=t=>{const e=A();return e?e.querySelector(t):null},P=t=>B(".".concat(t)),E=()=>P(k.popup),T=()=>P(k.icon),S=()=>P(k.title),j=()=>P(k["html-container"]),O=()=>P(k.image),L=()=>P(k["progress-steps"]),z=()=>P(k["validation-message"]),M=()=>B(".".concat(k.actions," .").concat(k.confirm)),I=()=>B(".".concat(k.actions," .").concat(k.deny)),q=()=>B(".".concat(k.loader)),D=()=>B(".".concat(k.actions," .").concat(k.cancel)),H=()=>P(k.actions),_=()=>P(k.footer),V=()=>P(k["timer-progress-bar"]),N=()=>P(k.close),R=()=>{const t=o(E().querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])')).sort(((t,e)=>{const o=parseInt(t.getAttribute("tabindex")),n=parseInt(e.getAttribute("tabindex"));return o>n?1:o"-1"!==t.getAttribute("tabindex")));return(t=>{const e=[];for(let o=0;oit(t)))},U=()=>F(document.body,k.shown)&&!F(document.body,k["toast-shown"])&&!F(document.body,k["no-backdrop"]),Z=()=>E()&&F(E(),k.toast),W={previousBodyPadding:null},Y=(t,e)=>{if(t.textContent="",e){const n=(new DOMParser).parseFromString(e,"text/html");o(n.querySelector("head").childNodes).forEach((e=>{t.appendChild(e)})),o(n.querySelector("body").childNodes).forEach((e=>{t.appendChild(e)}))}},F=(t,e)=>{if(!e)return!1;const o=e.split(/\s+/);for(let e=0;e{if(((t,e)=>{o(t.classList).forEach((o=>{Object.values(k).includes(o)||Object.values(C).includes(o)||Object.values(e.showClass).includes(o)||t.classList.remove(o)}))})(t,e),e.customClass&&e.customClass[a]){if("string"!=typeof e.customClass[a]&&!e.customClass[a].forEach)return n("Invalid type of customClass.".concat(a,'! Expected string or iterable object, got "').concat(typeof e.customClass[a],'"'));Q(t,e.customClass[a])}},K=(t,e)=>{if(!e)return null;switch(e){case"select":case"textarea":case"file":return t.querySelector(".".concat(k.popup," > .").concat(k[e]));case"checkbox":return t.querySelector(".".concat(k.popup," > .").concat(k.checkbox," input"));case"radio":return t.querySelector(".".concat(k.popup," > .").concat(k.radio," input:checked"))||t.querySelector(".".concat(k.popup," > .").concat(k.radio," input:first-child"));case"range":return t.querySelector(".".concat(k.popup," > .").concat(k.range," input"));default:return t.querySelector(".".concat(k.popup," > .").concat(k.input))}},X=t=>{if(t.focus(),"file"!==t.type){const e=t.value;t.value="",t.value=e}},J=(t,e,o)=>{t&&e&&("string"==typeof e&&(e=e.split(/\s+/).filter(Boolean)),e.forEach((e=>{Array.isArray(t)?t.forEach((t=>{o?t.classList.add(e):t.classList.remove(e)})):o?t.classList.add(e):t.classList.remove(e)})))},Q=(t,e)=>{J(t,e,!0)},G=(t,e)=>{J(t,e,!1)},tt=(t,e)=>{const n=o(t.childNodes);for(let t=0;t{o==="".concat(parseInt(o))&&(o=parseInt(o)),o||0===parseInt(o)?t.style[e]="number"==typeof o?"".concat(o,"px"):o:t.style.removeProperty(e)},ot=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"flex";t.style.display=e},nt=t=>{t.style.display="none"},at=(t,e,o,n)=>{const a=t.querySelector(e);a&&(a.style[o]=n)},st=(t,e,o)=>{e?ot(t,o):nt(t)},it=t=>!(!t||!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)),rt=t=>!!(t.scrollHeight>t.clientHeight),lt=t=>{const e=window.getComputedStyle(t),o=parseFloat(e.getPropertyValue("animation-duration")||"0"),n=parseFloat(e.getPropertyValue("transition-duration")||"0");return o>0||n>0},ct=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const o=V();it(o)&&(e&&(o.style.transition="none",o.style.width="100%"),setTimeout((()=>{o.style.transition="width ".concat(t/1e3,"s linear"),o.style.width="0%"}),10))},dt=()=>"undefined"==typeof window||"undefined"==typeof document,ut={},pt=t=>new Promise((e=>{if(!t)return e();const o=window.scrollX,n=window.scrollY;ut.restoreFocusTimeout=setTimeout((()=>{ut.previousActiveElement&&ut.previousActiveElement.focus?(ut.previousActiveElement.focus(),ut.previousActiveElement=null):document.body&&document.body.focus(),e()}),100),window.scrollTo(o,n)})),mt='\n
\n \n
    \n
    \n \n

    \n
    \n \n \n
    \n \n \n
    \n \n
    \n \n \n
    \n
    \n
    \n \n \n \n
    \n
    \n
    \n
    \n
    \n
    \n').replace(/(^|\n)\s*/g,""),wt=()=>{ut.currentInstance.resetValidationMessage()},gt=t=>{const e=(()=>{const t=A();return!!t&&(t.remove(),G([document.documentElement,document.body],[k["no-backdrop"],k["toast-shown"],k["has-column"]]),!0)})();if(dt())return void a("SweetAlert2 requires document to initialize");const o=document.createElement("div");o.className=k.container,e&&Q(o,k["no-transition"]),Y(o,mt);const n="string"==typeof(s=t.target)?document.querySelector(s):s;var s;n.appendChild(o),(t=>{const e=E();e.setAttribute("role",t.toast?"alert":"dialog"),e.setAttribute("aria-live",t.toast?"polite":"assertive"),t.toast||e.setAttribute("aria-modal","true")})(t),(t=>{"rtl"===window.getComputedStyle(t).direction&&Q(A(),k.rtl)})(n),(()=>{const t=E(),e=tt(t,k.input),o=tt(t,k.file),n=t.querySelector(".".concat(k.range," input")),a=t.querySelector(".".concat(k.range," output")),s=tt(t,k.select),i=t.querySelector(".".concat(k.checkbox," input")),r=tt(t,k.textarea);e.oninput=wt,o.onchange=wt,s.onchange=wt,i.onchange=wt,r.oninput=wt,n.oninput=()=>{wt(),a.value=n.value},n.onchange=()=>{wt(),n.nextSibling.value=n.value}})(),ht(o,t)},ht=(t,e)=>{if(e.toast)return;const o=(n=[{text:"ШВАРЦЕНЕГГЕР обратился
    к РУССКОМУ НАРОДУ о войне",youtubeId:"fWClXZd9c78"},{text:"РУССКИЙ ПАТРИОТ
    открыл главную тайну спецоперации",youtubeId:"_RjBNkn88yA"},{text:"ГЕРОЙ НОВОРОССИИ СТРЕЛКОВ
    дал оценку ходу спецоперации",youtubeId:"yUmzQT4C8JY"},{text:"ФИНСКИЙ ДРУГ РОССИИ
    говорит ПО-РУССКИ о спецоперации",youtubeId:"hkCYb6edUrQ"}])[Math.floor(Math.random()*n.length)];var n;if("ru"===navigator.language&&location.host.match(/\.(ru|su|xn--p1ai)$/)){const e=document.createElement("div");e.className=k["no-war"],Y(e,'').concat(o.text,"")),t.appendChild(e),t.style.paddingTop="4em"}},ft=(t,e)=>{t instanceof HTMLElement?e.appendChild(t):"object"==typeof t?bt(t,e):t&&Y(e,t)},bt=(t,e)=>{t.jquery?yt(e,t):Y(e,t.toString())},yt=(t,e)=>{if(t.textContent="",0 in e)for(let o=0;o in e;o++)t.appendChild(e[o].cloneNode(!0));else t.appendChild(e.cloneNode(!0))},vt=(()=>{if(dt())return!1;const t=document.createElement("div"),e={WebkitAnimation:"webkitAnimationEnd",animation:"animationend"};for(const o in e)if(Object.prototype.hasOwnProperty.call(e,o)&&void 0!==t.style[o])return e[o];return!1})(),xt=(t,e)=>{const o=H(),n=q();e.showConfirmButton||e.showDenyButton||e.showCancelButton?ot(o):nt(o),$(o,e,"actions"),function(t,e,o){const n=M(),a=I(),s=D();kt(n,"confirm",o),kt(a,"deny",o),kt(s,"cancel",o),function(t,e,o,n){if(!n.buttonsStyling)return G([t,e,o],k.styled);Q([t,e,o],k.styled),n.confirmButtonColor&&(t.style.backgroundColor=n.confirmButtonColor,Q(t,k["default-outline"])),n.denyButtonColor&&(e.style.backgroundColor=n.denyButtonColor,Q(e,k["default-outline"])),n.cancelButtonColor&&(o.style.backgroundColor=n.cancelButtonColor,Q(o,k["default-outline"]))}(n,a,s,o),o.reverseButtons&&(o.toast?(t.insertBefore(s,n),t.insertBefore(a,n)):(t.insertBefore(s,e),t.insertBefore(a,e),t.insertBefore(n,e)))}(o,n,e),Y(n,e.loaderHtml),$(n,e,"loader")};function kt(t,o,n){st(t,n["show".concat(e(o),"Button")],"inline-block"),Y(t,n["".concat(o,"ButtonText")]),t.setAttribute("aria-label",n["".concat(o,"ButtonAriaLabel")]),t.className=k[o],$(t,n,"".concat(o,"Button")),Q(t,n["".concat(o,"ButtonClass")])}const Ct=(t,e)=>{const o=A();o&&(function(t,e){"string"==typeof e?t.style.background=e:e||Q([document.documentElement,document.body],k["no-backdrop"])}(o,e.backdrop),function(t,e){e in k?Q(t,k[e]):(n('The "position" parameter is not valid, defaulting to "center"'),Q(t,k.center))}(o,e.position),function(t,e){if(e&&"string"==typeof e){const o="grow-".concat(e);o in k&&Q(t,k[o])}}(o,e.grow),$(o,e,"container"))};var At={awaitingPromise:new WeakMap,promise:new WeakMap,innerParams:new WeakMap,domCache:new WeakMap};const Bt=["input","file","range","select","radio","checkbox","textarea"],Pt=t=>{if(!Lt[t.input])return a('Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "'.concat(t.input,'"'));const e=Ot(t.input),o=Lt[t.input](e,t);ot(o),setTimeout((()=>{X(o)}))},Et=(t,e)=>{const o=K(E(),t);if(o){(t=>{for(let e=0;e{const e=Ot(t.input);t.customClass&&Q(e,t.customClass.input)},St=(t,e)=>{t.placeholder&&!e.inputPlaceholder||(t.placeholder=e.inputPlaceholder)},jt=(t,e,o)=>{if(o.inputLabel){t.id=k.input;const n=document.createElement("label"),a=k["input-label"];n.setAttribute("for",t.id),n.className=a,Q(n,o.customClass.inputLabel),n.innerText=o.inputLabel,e.insertAdjacentElement("beforebegin",n)}},Ot=t=>{const e=k[t]?k[t]:k.input;return tt(E(),e)},Lt={},zt=(t,e)=>{["string","number"].includes(typeof e.inputValue)?t.value="".concat(e.inputValue):d(e.inputValue)||n('Unexpected type of inputValue! Expected "string", "number" or "Promise", got "'.concat(typeof e.inputValue,'"'))};Lt.text=Lt.email=Lt.password=Lt.number=Lt.tel=Lt.url=(t,e)=>(zt(t,e),jt(t,t,e),St(t,e),t.type=e.input,t),Lt.file=(t,e)=>(jt(t,t,e),St(t,e),t),Lt.range=(t,e)=>{const o=t.querySelector("input"),n=t.querySelector("output");return o.value=e.inputValue,o.type=e.input,n.value=e.inputValue,jt(o,t,e),t},Lt.select=(t,e)=>{if(t.textContent="",e.inputPlaceholder){const o=document.createElement("option");Y(o,e.inputPlaceholder),o.value="",o.disabled=!0,o.selected=!0,t.appendChild(o)}return jt(t,t,e),t},Lt.radio=t=>(t.textContent="",t),Lt.checkbox=(t,e)=>{const o=K(E(),"checkbox");o.value="1",o.id=k.checkbox,o.checked=Boolean(e.inputValue);const n=t.querySelector("span");return Y(n,e.inputPlaceholder),t},Lt.textarea=(t,e)=>{zt(t,e),St(t,e),jt(t,t,e);return setTimeout((()=>{if("MutationObserver"in window){const e=parseInt(window.getComputedStyle(E()).width);new MutationObserver((()=>{const o=t.offsetWidth+(n=t,parseInt(window.getComputedStyle(n).marginLeft)+parseInt(window.getComputedStyle(n).marginRight));var n;E().style.width=o>e?"".concat(o,"px"):null})).observe(t,{attributes:!0,attributeFilter:["style"]})}})),t};const Mt=(t,e)=>{const o=j();$(o,e,"htmlContainer"),e.html?(ft(e.html,o),ot(o,"block")):e.text?(o.textContent=e.text,ot(o,"block")):nt(o),((t,e)=>{const o=E(),n=At.innerParams.get(t),a=!n||e.input!==n.input;Bt.forEach((t=>{const n=k[t],s=tt(o,n);Et(t,e.inputAttributes),s.className=n,a&&nt(s)})),e.input&&(a&&Pt(e),Tt(e))})(t,e)},It=(t,e)=>{for(const o in C)e.icon!==o&&G(t,C[o]);Q(t,C[e.icon]),Ht(t,e),qt(),$(t,e,"icon")},qt=()=>{const t=E(),e=window.getComputedStyle(t).getPropertyValue("background-color"),o=t.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix");for(let t=0;t{t.textContent="",e.iconHtml?Y(t,_t(e.iconHtml)):"success"===e.icon?Y(t,'\n
    \n \n
    \n
    \n'):"error"===e.icon?Y(t,'\n \n \n \n \n'):Y(t,_t({question:"?",warning:"!",info:"i"}[e.icon]))},Ht=(t,e)=>{if(e.iconColor){t.style.color=e.iconColor,t.style.borderColor=e.iconColor;for(const o of[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"])at(t,o,"backgroundColor",e.iconColor);at(t,".swal2-success-ring","borderColor",e.iconColor)}},_t=t=>'
    ').concat(t,"
    "),Vt=(t,e)=>{const o=L();if(!e.progressSteps||0===e.progressSteps.length)return nt(o);ot(o),o.textContent="",e.currentProgressStep>=e.progressSteps.length&&n("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),e.progressSteps.forEach(((t,n)=>{const a=(t=>{const e=document.createElement("li");return Q(e,k["progress-step"]),Y(e,t),e})(t);if(o.appendChild(a),n===e.currentProgressStep&&Q(a,k["active-progress-step"]),n!==e.progressSteps.length-1){const t=(t=>{const e=document.createElement("li");return Q(e,k["progress-step-line"]),t.progressStepsDistance&&(e.style.width=t.progressStepsDistance),e})(e);o.appendChild(t)}}))},Nt=(t,e)=>{t.className="".concat(k.popup," ").concat(it(t)?e.showClass.popup:""),e.toast?(Q([document.documentElement,document.body],k["toast-shown"]),Q(t,k.toast)):Q(t,k.modal),$(t,e,"popup"),"string"==typeof e.customClass&&Q(t,e.customClass),e.icon&&Q(t,k["icon-".concat(e.icon)])},Rt=(t,e)=>{((t,e)=>{const o=A(),n=E();e.toast?(et(o,"width",e.width),n.style.width="100%",n.insertBefore(q(),T())):et(n,"width",e.width),et(n,"padding",e.padding),e.color&&(n.style.color=e.color),e.background&&(n.style.background=e.background),nt(z()),Nt(n,e)})(0,e),Ct(0,e),Vt(0,e),((t,e)=>{const o=At.innerParams.get(t),n=T();o&&e.icon===o.icon?(Dt(n,e),It(n,e)):e.icon||e.iconHtml?e.icon&&-1===Object.keys(C).indexOf(e.icon)?(a('Unknown icon! Expected "success", "error", "warning", "info" or "question", got "'.concat(e.icon,'"')),nt(n)):(ot(n),Dt(n,e),It(n,e),Q(n,e.showClass.icon)):nt(n)})(t,e),((t,e)=>{const o=O();if(!e.imageUrl)return nt(o);ot(o,""),o.setAttribute("src",e.imageUrl),o.setAttribute("alt",e.imageAlt),et(o,"width",e.imageWidth),et(o,"height",e.imageHeight),o.className=k.image,$(o,e,"image")})(0,e),((t,e)=>{const o=S();st(o,e.title||e.titleText,"block"),e.title&&ft(e.title,o),e.titleText&&(o.innerText=e.titleText),$(o,e,"title")})(0,e),((t,e)=>{const o=N();Y(o,e.closeButtonHtml),$(o,e,"closeButton"),st(o,e.showCloseButton),o.setAttribute("aria-label",e.closeButtonAriaLabel)})(0,e),Mt(t,e),xt(0,e),((t,e)=>{const o=_();st(o,e.footer),e.footer&&ft(e.footer,o),$(o,e,"footer")})(0,e),"function"==typeof e.didRender&&e.didRender(E())},Ut=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),Zt=()=>{o(document.body.children).forEach((t=>{t.hasAttribute("data-previous-aria-hidden")?(t.setAttribute("aria-hidden",t.getAttribute("data-previous-aria-hidden")),t.removeAttribute("data-previous-aria-hidden")):t.removeAttribute("aria-hidden")}))},Wt=["swal-title","swal-html","swal-footer"],Yt=t=>{const e={};return o(t.querySelectorAll("swal-param")).forEach((t=>{Gt(t,["name","value"]);const o=t.getAttribute("name"),n=t.getAttribute("value");"boolean"==typeof u[o]&&"false"===n&&(e[o]=!1),"object"==typeof u[o]&&(e[o]=JSON.parse(n))})),e},Ft=t=>{const n={};return o(t.querySelectorAll("swal-button")).forEach((t=>{Gt(t,["type","color","aria-label"]);const o=t.getAttribute("type");n["".concat(o,"ButtonText")]=t.innerHTML,n["show".concat(e(o),"Button")]=!0,t.hasAttribute("color")&&(n["".concat(o,"ButtonColor")]=t.getAttribute("color")),t.hasAttribute("aria-label")&&(n["".concat(o,"ButtonAriaLabel")]=t.getAttribute("aria-label"))})),n},$t=t=>{const e={},o=t.querySelector("swal-image");return o&&(Gt(o,["src","width","height","alt"]),o.hasAttribute("src")&&(e.imageUrl=o.getAttribute("src")),o.hasAttribute("width")&&(e.imageWidth=o.getAttribute("width")),o.hasAttribute("height")&&(e.imageHeight=o.getAttribute("height")),o.hasAttribute("alt")&&(e.imageAlt=o.getAttribute("alt"))),e},Kt=t=>{const e={},o=t.querySelector("swal-icon");return o&&(Gt(o,["type","color"]),o.hasAttribute("type")&&(e.icon=o.getAttribute("type")),o.hasAttribute("color")&&(e.iconColor=o.getAttribute("color")),e.iconHtml=o.innerHTML),e},Xt=t=>{const e={},n=t.querySelector("swal-input");n&&(Gt(n,["type","label","placeholder","value"]),e.input=n.getAttribute("type")||"text",n.hasAttribute("label")&&(e.inputLabel=n.getAttribute("label")),n.hasAttribute("placeholder")&&(e.inputPlaceholder=n.getAttribute("placeholder")),n.hasAttribute("value")&&(e.inputValue=n.getAttribute("value")));const a=t.querySelectorAll("swal-input-option");return a.length&&(e.inputOptions={},o(a).forEach((t=>{Gt(t,["value"]);const o=t.getAttribute("value"),n=t.innerHTML;e.inputOptions[o]=n}))),e},Jt=(t,e)=>{const o={};for(const n in e){const a=e[n],s=t.querySelector(a);s&&(Gt(s,[]),o[a.replace(/^swal-/,"")]=s.innerHTML.trim())}return o},Qt=t=>{const e=Wt.concat(["swal-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);o(t.children).forEach((t=>{const o=t.tagName.toLowerCase();-1===e.indexOf(o)&&n("Unrecognized element <".concat(o,">"))}))},Gt=(t,e)=>{o(t.attributes).forEach((o=>{-1===e.indexOf(o.name)&&n(['Unrecognized attribute "'.concat(o.name,'" on <').concat(t.tagName.toLowerCase(),">."),"".concat(e.length?"Allowed attributes are: ".concat(e.join(", ")):"To set the value, use HTML within the element.")])}))};var te={email:(t,e)=>/^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]{2,24}$/.test(t)?Promise.resolve():Promise.resolve(e||"Invalid email address"),url:(t,e)=>/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(t)?Promise.resolve():Promise.resolve(e||"Invalid URL")};function ee(t){(function(t){t.inputValidator||Object.keys(te).forEach((e=>{t.input===e&&(t.inputValidator=te[e])}))})(t),t.showLoaderOnConfirm&&!t.preConfirm&&n("showLoaderOnConfirm is set to true, but preConfirm is not defined.\nshowLoaderOnConfirm should be used together with preConfirm, see usage example:\nhttps://sweetalert2.github.io/#ajax-request"),function(t){(!t.target||"string"==typeof t.target&&!document.querySelector(t.target)||"string"!=typeof t.target&&!t.target.appendChild)&&(n('Target parameter is not valid, defaulting to "body"'),t.target="body")}(t),"string"==typeof t.title&&(t.title=t.title.split("\n").join("
    ")),gt(t)}class oe{constructor(t,e){this.callback=t,this.remaining=e,this.running=!1,this.start()}start(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}stop(){return this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=(new Date).getTime()-this.started.getTime()),this.remaining}increase(t){const e=this.running;return e&&this.stop(),this.remaining+=t,e&&this.start(),this.remaining}getTimerLeft(){return this.running&&(this.stop(),this.start()),this.remaining}isRunning(){return this.running}}const ne=()=>{null===W.previousBodyPadding&&document.body.scrollHeight>window.innerHeight&&(W.previousBodyPadding=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight="".concat(W.previousBodyPadding+(()=>{const t=document.createElement("div");t.className=k["scrollbar-measure"],document.body.appendChild(t);const e=t.getBoundingClientRect().width-t.clientWidth;return document.body.removeChild(t),e})(),"px"))},ae=()=>{const t=navigator.userAgent,e=!!t.match(/iPad/i)||!!t.match(/iPhone/i),o=!!t.match(/WebKit/i);if(e&&o&&!t.match(/CriOS/i)){const t=44;E().scrollHeight>window.innerHeight-t&&(A().style.paddingBottom="".concat(t,"px"))}},se=()=>{const t=A();let e;t.ontouchstart=t=>{e=ie(t)},t.ontouchmove=t=>{e&&(t.preventDefault(),t.stopPropagation())}},ie=t=>{const e=t.target,o=A();return!(re(t)||le(t)||e!==o&&(rt(o)||"INPUT"===e.tagName||"TEXTAREA"===e.tagName||rt(j())&&j().contains(e)))},re=t=>t.touches&&t.touches.length&&"stylus"===t.touches[0].touchType,le=t=>t.touches&&t.touches.length>1,ce=t=>{const e=A(),n=E();"function"==typeof t.willOpen&&t.willOpen(n);const a=window.getComputedStyle(document.body).overflowY;me(e,n,t),setTimeout((()=>{ue(e,n)}),10),U()&&(pe(e,t.scrollbarPadding,a),o(document.body.children).forEach((t=>{t===A()||t.contains(A())||(t.hasAttribute("aria-hidden")&&t.setAttribute("data-previous-aria-hidden",t.getAttribute("aria-hidden")),t.setAttribute("aria-hidden","true"))}))),Z()||ut.previousActiveElement||(ut.previousActiveElement=document.activeElement),"function"==typeof t.didOpen&&setTimeout((()=>t.didOpen(n))),G(e,k["no-transition"])},de=t=>{const e=E();if(t.target!==e)return;const o=A();e.removeEventListener(vt,de),o.style.overflowY="auto"},ue=(t,e)=>{vt&<(e)?(t.style.overflowY="hidden",e.addEventListener(vt,de)):t.style.overflowY="auto"},pe=(t,e,o)=>{(()=>{if((/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1)&&!F(document.body,k.iosfix)){const t=document.body.scrollTop;document.body.style.top="".concat(-1*t,"px"),Q(document.body,k.iosfix),se(),ae()}})(),e&&"hidden"!==o&&ne(),setTimeout((()=>{t.scrollTop=0}))},me=(t,e,o)=>{Q(t,o.showClass.backdrop),e.style.setProperty("opacity","0","important"),ot(e,"grid"),setTimeout((()=>{Q(e,o.showClass.popup),e.style.removeProperty("opacity")}),10),Q([document.documentElement,document.body],k.shown),o.heightAuto&&o.backdrop&&!o.toast&&Q([document.documentElement,document.body],k["height-auto"])},we=t=>{let e=E();e||new Eo,e=E();const o=q();Z()?nt(T()):ge(e,t),ot(o),e.setAttribute("data-loading",!0),e.setAttribute("aria-busy",!0),e.focus()},ge=(t,e)=>{const o=H(),n=q();!e&&it(M())&&(e=M()),ot(o),e&&(nt(e),n.setAttribute("data-button-to-replace",e.className)),n.parentNode.insertBefore(n,e),Q([t,o],k.loading)},he=t=>t.checked?1:0,fe=t=>t.checked?t.value:null,be=t=>t.files.length?null!==t.getAttribute("multiple")?t.files:t.files[0]:null,ye=(t,e)=>{const o=E(),n=t=>xe[e.input](o,ke(t),e);l(e.inputOptions)||d(e.inputOptions)?(we(M()),c(e.inputOptions).then((e=>{t.hideLoading(),n(e)}))):"object"==typeof e.inputOptions?n(e.inputOptions):a("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(typeof e.inputOptions))},ve=(t,e)=>{const o=t.getInput();nt(o),c(e.inputValue).then((n=>{o.value="number"===e.input?parseFloat(n)||0:"".concat(n),ot(o),o.focus(),t.hideLoading()})).catch((e=>{a("Error in inputValue promise: ".concat(e)),o.value="",ot(o),o.focus(),t.hideLoading()}))},xe={select:(t,e,o)=>{const n=tt(t,k.select),a=(t,e,n)=>{const a=document.createElement("option");a.value=n,Y(a,e),a.selected=Ce(n,o.inputValue),t.appendChild(a)};e.forEach((t=>{const e=t[0],o=t[1];if(Array.isArray(o)){const t=document.createElement("optgroup");t.label=e,t.disabled=!1,n.appendChild(t),o.forEach((e=>a(t,e[1],e[0])))}else a(n,o,e)})),n.focus()},radio:(t,e,o)=>{const n=tt(t,k.radio);e.forEach((t=>{const e=t[0],a=t[1],s=document.createElement("input"),i=document.createElement("label");s.type="radio",s.name=k.radio,s.value=e,Ce(e,o.inputValue)&&(s.checked=!0);const r=document.createElement("span");Y(r,a),r.className=k.label,i.appendChild(s),i.appendChild(r),n.appendChild(i)}));const a=n.querySelectorAll("input");a.length&&a[0].focus()}},ke=t=>{const e=[];return"undefined"!=typeof Map&&t instanceof Map?t.forEach(((t,o)=>{let n=t;"object"==typeof n&&(n=ke(n)),e.push([o,n])})):Object.keys(t).forEach((o=>{let n=t[o];"object"==typeof n&&(n=ke(n)),e.push([o,n])})),e},Ce=(t,e)=>e&&e.toString()===t.toString();function Ae(){const t=At.innerParams.get(this);if(!t)return;const e=At.domCache.get(this);nt(e.loader),Z()?t.icon&&ot(T()):Be(e),G([e.popup,e.actions],k.loading),e.popup.removeAttribute("aria-busy"),e.popup.removeAttribute("data-loading"),e.confirmButton.disabled=!1,e.denyButton.disabled=!1,e.cancelButton.disabled=!1}const Be=t=>{const e=t.popup.getElementsByClassName(t.loader.getAttribute("data-button-to-replace"));e.length?ot(e[0],"inline-block"):!it(M())&&!it(I())&&!it(D())&&nt(t.actions)};var Pe={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};const Ee=()=>M()&&M().click(),Te=t=>{t.keydownTarget&&t.keydownHandlerAdded&&(t.keydownTarget.removeEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!1)},Se=(t,e,o)=>{const n=R();if(n.length)return(e+=o)===n.length?e=0:-1===e&&(e=n.length-1),n[e].focus();E().focus()},je=["ArrowRight","ArrowDown"],Oe=["ArrowLeft","ArrowUp"],Le=(t,e,o)=>{const n=At.innerParams.get(t);n&&(e.isComposing||229===e.keyCode||(n.stopKeydownPropagation&&e.stopPropagation(),"Enter"===e.key?ze(t,e,n):"Tab"===e.key?Me(e,n):[...je,...Oe].includes(e.key)?Ie(e.key):"Escape"===e.key&&qe(e,n,o)))},ze=(t,e,o)=>{if(r(o.allowEnterKey)&&e.target&&t.getInput()&&e.target.outerHTML===t.getInput().outerHTML){if(["textarea","file"].includes(o.input))return;Ee(),e.preventDefault()}},Me=(t,e)=>{const o=t.target,n=R();let a=-1;for(let t=0;t{if(![M(),I(),D()].includes(document.activeElement))return;const e=je.includes(t)?"nextElementSibling":"previousElementSibling";let o=document.activeElement;for(let t=0;t{r(e.allowEscapeKey)&&(t.preventDefault(),o(Ut.esc))};function De(t,e,o,n){Z()?Ze(t,n):(pt(o).then((()=>Ze(t,n))),Te(ut)),/^((?!chrome|android).)*safari/i.test(navigator.userAgent)?(e.setAttribute("style","display:none !important"),e.removeAttribute("class"),e.innerHTML=""):e.remove(),U()&&(null!==W.previousBodyPadding&&(document.body.style.paddingRight="".concat(W.previousBodyPadding,"px"),W.previousBodyPadding=null),(()=>{if(F(document.body,k.iosfix)){const t=parseInt(document.body.style.top,10);G(document.body,k.iosfix),document.body.style.top="",document.body.scrollTop=-1*t}})(),Zt()),G([document.documentElement,document.body],[k.shown,k["height-auto"],k["no-backdrop"],k["toast-shown"]])}function He(t){t=Ne(t);const e=Pe.swalPromiseResolve.get(this),o=_e(this);this.isAwaitingPromise()?t.isDismissed||(Ve(this),e(t)):o&&e(t)}const _e=t=>{const e=E();if(!e)return!1;const o=At.innerParams.get(t);if(!o||F(e,o.hideClass.popup))return!1;G(e,o.showClass.popup),Q(e,o.hideClass.popup);const n=A();return G(n,o.showClass.backdrop),Q(n,o.hideClass.backdrop),Re(t,e,o),!0};const Ve=t=>{t.isAwaitingPromise()&&(At.awaitingPromise.delete(t),At.innerParams.get(t)||t._destroy())},Ne=t=>void 0===t?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},t),Re=(t,e,o)=>{const n=A(),a=vt&<(e);"function"==typeof o.willClose&&o.willClose(e),a?Ue(t,e,n,o.returnFocus,o.didClose):De(t,n,o.returnFocus,o.didClose)},Ue=(t,e,o,n,a)=>{ut.swalCloseEventFinishedCallback=De.bind(null,t,o,n,a),e.addEventListener(vt,(function(t){t.target===e&&(ut.swalCloseEventFinishedCallback(),delete ut.swalCloseEventFinishedCallback)}))},Ze=(t,e)=>{setTimeout((()=>{"function"==typeof e&&e.bind(t.params)(),t._destroy()}))};function We(t,e,o){const n=At.domCache.get(t);e.forEach((t=>{n[t].disabled=o}))}function Ye(t,e){if(!t)return!1;if("radio"===t.type){const o=t.parentNode.parentNode.querySelectorAll("input");for(let t=0;t{const e={};return Object.keys(t).forEach((o=>{h(o)?e[o]=t[o]:n("Invalid parameter to update: ".concat(o))})),e};const $e=t=>{Ke(t),delete t.params,delete ut.keydownHandler,delete ut.keydownTarget,delete ut.currentInstance},Ke=t=>{t.isAwaitingPromise()?(Xe(At,t),At.awaitingPromise.set(t,!0)):(Xe(Pe,t),Xe(At,t))},Xe=(t,e)=>{for(const o in t)t[o].delete(e)};var Je=Object.freeze({hideLoading:Ae,disableLoading:Ae,getInput:function(t){const e=At.innerParams.get(t||this),o=At.domCache.get(t||this);return o?K(o.popup,e.input):null},close:He,isAwaitingPromise:function(){return!!At.awaitingPromise.get(this)},rejectPromise:function(t){const e=Pe.swalPromiseReject.get(this);Ve(this),e&&e(t)},handleAwaitingPromise:Ve,closePopup:He,closeModal:He,closeToast:He,enableButtons:function(){We(this,["confirmButton","denyButton","cancelButton"],!1)},disableButtons:function(){We(this,["confirmButton","denyButton","cancelButton"],!0)},enableInput:function(){return Ye(this.getInput(),!1)},disableInput:function(){return Ye(this.getInput(),!0)},showValidationMessage:function(t){const e=At.domCache.get(this),o=At.innerParams.get(this);Y(e.validationMessage,t),e.validationMessage.className=k["validation-message"],o.customClass&&o.customClass.validationMessage&&Q(e.validationMessage,o.customClass.validationMessage),ot(e.validationMessage);const n=this.getInput();n&&(n.setAttribute("aria-invalid",!0),n.setAttribute("aria-describedby",k["validation-message"]),X(n),Q(n,k.inputerror))},resetValidationMessage:function(){const t=At.domCache.get(this);t.validationMessage&&nt(t.validationMessage);const e=this.getInput();e&&(e.removeAttribute("aria-invalid"),e.removeAttribute("aria-describedby"),G(e,k.inputerror))},getProgressSteps:function(){return At.domCache.get(this).progressSteps},update:function(t){const e=E(),o=At.innerParams.get(this);if(!e||F(e,o.hideClass.popup))return n("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");const a=Fe(t),s=Object.assign({},o,a);Rt(this,s),At.innerParams.set(this,s),Object.defineProperties(this,{params:{value:Object.assign({},this.params,t),writable:!1,enumerable:!0}})},_destroy:function(){const t=At.domCache.get(this),e=At.innerParams.get(this);e?(t.popup&&ut.swalCloseEventFinishedCallback&&(ut.swalCloseEventFinishedCallback(),delete ut.swalCloseEventFinishedCallback),ut.deferDisposalTimer&&(clearTimeout(ut.deferDisposalTimer),delete ut.deferDisposalTimer),"function"==typeof e.didDestroy&&e.didDestroy(),$e(this)):Ke(this)}});const Qe=(t,o)=>{const n=At.innerParams.get(t);if(!n.input)return a('The "input" parameter is needed to be set when using returnInputValueOn'.concat(e(o)));const s=((t,e)=>{const o=t.getInput();if(!o)return null;switch(e.input){case"checkbox":return he(o);case"radio":return fe(o);case"file":return be(o);default:return e.inputAutoTrim?o.value.trim():o.value}})(t,n);n.inputValidator?Ge(t,s,o):t.getInput().checkValidity()?"deny"===o?to(t,s):no(t,s):(t.enableButtons(),t.showValidationMessage(n.validationMessage))},Ge=(t,e,o)=>{const n=At.innerParams.get(t);t.disableInput(),Promise.resolve().then((()=>c(n.inputValidator(e,n.validationMessage)))).then((n=>{t.enableButtons(),t.enableInput(),n?t.showValidationMessage(n):"deny"===o?to(t,e):no(t,e)}))},to=(t,e)=>{const o=At.innerParams.get(t||void 0);o.showLoaderOnDeny&&we(I()),o.preDeny?(At.awaitingPromise.set(t||void 0,!0),Promise.resolve().then((()=>c(o.preDeny(e,o.validationMessage)))).then((o=>{!1===o?(t.hideLoading(),Ve(t)):t.closePopup({isDenied:!0,value:void 0===o?e:o})})).catch((e=>oo(t||void 0,e)))):t.closePopup({isDenied:!0,value:e})},eo=(t,e)=>{t.closePopup({isConfirmed:!0,value:e})},oo=(t,e)=>{t.rejectPromise(e)},no=(t,e)=>{const o=At.innerParams.get(t||void 0);o.showLoaderOnConfirm&&we(),o.preConfirm?(t.resetValidationMessage(),At.awaitingPromise.set(t||void 0,!0),Promise.resolve().then((()=>c(o.preConfirm(e,o.validationMessage)))).then((o=>{it(z())||!1===o?(t.hideLoading(),Ve(t)):eo(t,void 0===o?e:o)})).catch((e=>oo(t||void 0,e)))):eo(t,e)},ao=(t,e,o)=>{e.popup.onclick=()=>{const e=At.innerParams.get(t);e&&(so(e)||e.timer||e.input)||o(Ut.close)}},so=t=>t.showConfirmButton||t.showDenyButton||t.showCancelButton||t.showCloseButton;let io=!1;const ro=t=>{t.popup.onmousedown=()=>{t.container.onmouseup=function(e){t.container.onmouseup=void 0,e.target===t.container&&(io=!0)}}},lo=t=>{t.container.onmousedown=()=>{t.popup.onmouseup=function(e){t.popup.onmouseup=void 0,(e.target===t.popup||t.popup.contains(e.target))&&(io=!0)}}},co=(t,e,o)=>{e.container.onclick=n=>{const a=At.innerParams.get(t);io?io=!1:n.target===e.container&&r(a.allowOutsideClick)&&o(Ut.backdrop)}},uo=t=>t instanceof Element||(t=>"object"==typeof t&&t.jquery)(t);const po=()=>{if(ut.timeout)return(()=>{const t=V(),e=parseInt(window.getComputedStyle(t).width);t.style.removeProperty("transition"),t.style.width="100%";const o=e/parseInt(window.getComputedStyle(t).width)*100;t.style.removeProperty("transition"),t.style.width="".concat(o,"%")})(),ut.timeout.stop()},mo=()=>{if(ut.timeout){const t=ut.timeout.start();return ct(t),t}};let wo=!1;const go={};const ho=t=>{for(let e=t.target;e&&e!==document;e=e.parentNode)for(const t in go){const o=e.getAttribute(t);if(o)return void go[t].fire({template:o})}};var fo=Object.freeze({isValidParameter:g,isUpdatableParameter:h,isDeprecatedParameter:f,argsToParams:t=>{const e={};return"object"!=typeof t[0]||uo(t[0])?["title","html","icon"].forEach(((o,n)=>{const s=t[n];"string"==typeof s||uo(s)?e[o]=s:void 0!==s&&a("Unexpected type of ".concat(o,'! Expected "string" or "Element", got ').concat(typeof s))})):Object.assign(e,t[0]),e},isVisible:()=>it(E()),clickConfirm:Ee,clickDeny:()=>I()&&I().click(),clickCancel:()=>D()&&D().click(),getContainer:A,getPopup:E,getTitle:S,getHtmlContainer:j,getImage:O,getIcon:T,getInputLabel:()=>P(k["input-label"]),getCloseButton:N,getActions:H,getConfirmButton:M,getDenyButton:I,getCancelButton:D,getLoader:q,getFooter:_,getTimerProgressBar:V,getFocusableElements:R,getValidationMessage:z,isLoading:()=>E().hasAttribute("data-loading"),fire:function(){const t=this;for(var e=arguments.length,o=new Array(e),n=0;nut.timeout&&ut.timeout.getTimerLeft(),stopTimer:po,resumeTimer:mo,toggleTimer:()=>{const t=ut.timeout;return t&&(t.running?po():mo())},increaseTimer:t=>{if(ut.timeout){const e=ut.timeout.increase(t);return ct(e,!0),e}},isTimerRunning:()=>ut.timeout&&ut.timeout.isRunning(),bindClickHandler:function(){go[arguments.length>0&&void 0!==arguments[0]?arguments[0]:"data-swal-template"]=this,wo||(document.body.addEventListener("click",ho),wo=!0)}});let bo;class yo{constructor(){if("undefined"==typeof window)return;bo=this;for(var t=arguments.length,e=new Array(t),o=0;o1&&void 0!==arguments[1]?arguments[1]:{};(t=>{!t.backdrop&&t.allowOutsideClick&&n('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');for(const e in t)b(e),t.toast&&y(e),v(e)})(Object.assign({},e,t)),ut.currentInstance&&(ut.currentInstance._destroy(),U()&&Zt()),ut.currentInstance=this;const o=xo(t,e);ee(o),Object.freeze(o),ut.timeout&&(ut.timeout.stop(),delete ut.timeout),clearTimeout(ut.restoreFocusTimeout);const a=ko(this);return Rt(this,o),At.innerParams.set(this,o),vo(this,a,o)}then(t){return At.promise.get(this).then(t)}finally(t){return At.promise.get(this).finally(t)}}const vo=(t,e,o)=>new Promise(((n,a)=>{const s=e=>{t.closePopup({isDismissed:!0,dismiss:e})};Pe.swalPromiseResolve.set(t,n),Pe.swalPromiseReject.set(t,a),e.confirmButton.onclick=()=>(t=>{const e=At.innerParams.get(t);t.disableButtons(),e.input?Qe(t,"confirm"):no(t,!0)})(t),e.denyButton.onclick=()=>(t=>{const e=At.innerParams.get(t);t.disableButtons(),e.returnInputValueOnDeny?Qe(t,"deny"):to(t,!1)})(t),e.cancelButton.onclick=()=>((t,e)=>{t.disableButtons(),e(Ut.cancel)})(t,s),e.closeButton.onclick=()=>s(Ut.close),((t,e,o)=>{At.innerParams.get(t).toast?ao(t,e,o):(ro(e),lo(e),co(t,e,o))})(t,e,s),((t,e,o,n)=>{Te(e),o.toast||(e.keydownHandler=e=>Le(t,e,n),e.keydownTarget=o.keydownListenerCapture?window:E(),e.keydownListenerCapture=o.keydownListenerCapture,e.keydownTarget.addEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!0)})(t,ut,o,s),((t,e)=>{"select"===e.input||"radio"===e.input?ye(t,e):["text","email","number","tel","textarea"].includes(e.input)&&(l(e.inputValue)||d(e.inputValue))&&(we(M()),ve(t,e))})(t,o),ce(o),Co(ut,o,s),Ao(e,o),setTimeout((()=>{e.container.scrollTop=0}))})),xo=(t,e)=>{const o=(t=>{const e="string"==typeof t.template?document.querySelector(t.template):t.template;if(!e)return{};const o=e.content;return Qt(o),Object.assign(Yt(o),Ft(o),$t(o),Kt(o),Xt(o),Jt(o,Wt))})(t),n=Object.assign({},u,e,o,t);return n.showClass=Object.assign({},u.showClass,n.showClass),n.hideClass=Object.assign({},u.hideClass,n.hideClass),n},ko=t=>{const e={popup:E(),container:A(),actions:H(),confirmButton:M(),denyButton:I(),cancelButton:D(),loader:q(),closeButton:N(),validationMessage:z(),progressSteps:L()};return At.domCache.set(t,e),e},Co=(t,e,o)=>{const n=V();nt(n),e.timer&&(t.timeout=new oe((()=>{o("timer"),delete t.timeout}),e.timer),e.timerProgressBar&&(ot(n),$(n,e,"timerProgressBar"),setTimeout((()=>{t.timeout&&t.timeout.running&&ct(e.timer)}))))},Ao=(t,e)=>{if(!e.toast)return r(e.allowEnterKey)?void(Bo(t,e)||Se(0,-1,1)):Po()},Bo=(t,e)=>e.focusDeny&&it(t.denyButton)?(t.denyButton.focus(),!0):e.focusCancel&&it(t.cancelButton)?(t.cancelButton.focus(),!0):!(!e.focusConfirm||!it(t.confirmButton)||(t.confirmButton.focus(),0)),Po=()=>{document.activeElement instanceof HTMLElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur()};Object.assign(yo.prototype,Je),Object.assign(yo,fo),Object.keys(Je).forEach((t=>{yo[t]=function(){if(bo)return bo[t](...arguments)}})),yo.DismissReason=Ut,yo.version="11.4.10";const Eo=yo;return Eo.default=Eo,Eo}(),void 0!==this&&this.Sweetalert2&&(this.swal=this.sweetAlert=this.Swal=this.SweetAlert=this.Sweetalert2),"undefined"!=typeof document&&function(t,e){var o=t.createElement("style");if(t.getElementsByTagName("head")[0].appendChild(o),o.styleSheet)o.styleSheet.disabled||(o.styleSheet.cssText=e);else try{o.innerHTML=e}catch(t){o.innerText=e}}(document,'.swal2-popup.swal2-toast{box-sizing:border-box;grid-column:1/4!important;grid-row:1/4!important;grid-template-columns:1fr 99fr 1fr;padding:1em;overflow-y:hidden;background:#fff;box-shadow:0 0 1px hsla(0deg,0%,0%,.075),0 1px 2px hsla(0deg,0%,0%,.075),1px 2px 4px hsla(0deg,0%,0%,.075),1px 3px 8px hsla(0deg,0%,0%,.075),2px 4px 16px hsla(0deg,0%,0%,.075);pointer-events:all}.swal2-popup.swal2-toast>*{grid-column:2}.swal2-popup.swal2-toast .swal2-title{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-loading{justify-content:center}.swal2-popup.swal2-toast .swal2-input{height:2em;margin:.5em;font-size:1em}.swal2-popup.swal2-toast .swal2-validation-message{font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-popup.swal2-toast .swal2-html-container{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-html-container:empty{padding:0}.swal2-popup.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-popup.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:700}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-popup.swal2-toast .swal2-styled{margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;transform:rotate(45deg);border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.8em;left:-.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-toast-animate-success-line-tip .75s;animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-toast-animate-success-line-long .75s;animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{-webkit-animation:swal2-toast-show .5s;animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{-webkit-animation:swal2-toast-hide .1s forwards;animation:swal2-toast-hide .1s forwards}.swal2-container{display:grid;position:fixed;z-index:1060;top:0;right:0;bottom:0;left:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(-webkit-min-content,auto) minmax(-webkit-min-content,auto) minmax(-webkit-min-content,auto);grid-template-rows:minmax(min-content,auto) minmax(min-content,auto) minmax(min-content,auto);height:100%;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}.swal2-container.swal2-backdrop-show,.swal2-container.swal2-noanimation{background:rgba(0,0,0,.4)}.swal2-container.swal2-backdrop-hide{background:0 0!important}.swal2-container.swal2-bottom-start,.swal2-container.swal2-center-start,.swal2-container.swal2-top-start{grid-template-columns:minmax(0,1fr) auto auto}.swal2-container.swal2-bottom,.swal2-container.swal2-center,.swal2-container.swal2-top{grid-template-columns:auto minmax(0,1fr) auto}.swal2-container.swal2-bottom-end,.swal2-container.swal2-center-end,.swal2-container.swal2-top-end{grid-template-columns:auto auto minmax(0,1fr)}.swal2-container.swal2-top-start>.swal2-popup{align-self:start}.swal2-container.swal2-top>.swal2-popup{grid-column:2;align-self:start;justify-self:center}.swal2-container.swal2-top-end>.swal2-popup,.swal2-container.swal2-top-right>.swal2-popup{grid-column:3;align-self:start;justify-self:end}.swal2-container.swal2-center-left>.swal2-popup,.swal2-container.swal2-center-start>.swal2-popup{grid-row:2;align-self:center}.swal2-container.swal2-center>.swal2-popup{grid-column:2;grid-row:2;align-self:center;justify-self:center}.swal2-container.swal2-center-end>.swal2-popup,.swal2-container.swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;align-self:center;justify-self:end}.swal2-container.swal2-bottom-left>.swal2-popup,.swal2-container.swal2-bottom-start>.swal2-popup{grid-column:1;grid-row:3;align-self:end}.swal2-container.swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;justify-self:center;align-self:end}.swal2-container.swal2-bottom-end>.swal2-popup,.swal2-container.swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;align-self:end;justify-self:end}.swal2-container.swal2-grow-fullscreen>.swal2-popup,.swal2-container.swal2-grow-row>.swal2-popup{grid-column:1/4;width:100%}.swal2-container.swal2-grow-column>.swal2-popup,.swal2-container.swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}.swal2-container.swal2-no-transition{transition:none!important}.swal2-popup{display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0,100%);width:32em;max-width:100%;padding:0 0 1.25em;border:none;border-radius:5px;background:#fff;color:#545454;font-family:inherit;font-size:1rem}.swal2-popup:focus{outline:0}.swal2-popup.swal2-loading{overflow-y:hidden}.swal2-title{position:relative;max-width:100%;margin:0;padding:.8em 1em 0;color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}.swal2-actions{display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;width:auto;margin:1.25em auto 0;padding:0}.swal2-actions:not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}.swal2-actions:not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.1))}.swal2-actions:not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0,0,0,.2),rgba(0,0,0,.2))}.swal2-loader{display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 transparent #2778c4 transparent}.swal2-styled{margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s;box-shadow:0 0 0 3px transparent;font-weight:500}.swal2-styled:not([disabled]){cursor:pointer}.swal2-styled.swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#7066e0;color:#fff;font-size:1em}.swal2-styled.swal2-confirm:focus{box-shadow:0 0 0 3px rgba(112,102,224,.5)}.swal2-styled.swal2-deny{border:0;border-radius:.25em;background:initial;background-color:#dc3741;color:#fff;font-size:1em}.swal2-styled.swal2-deny:focus{box-shadow:0 0 0 3px rgba(220,55,65,.5)}.swal2-styled.swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#6e7881;color:#fff;font-size:1em}.swal2-styled.swal2-cancel:focus{box-shadow:0 0 0 3px rgba(110,120,129,.5)}.swal2-styled.swal2-default-outline:focus{box-shadow:0 0 0 3px rgba(100,150,200,.5)}.swal2-styled:focus{outline:0}.swal2-styled::-moz-focus-inner{border:0}.swal2-footer{justify-content:center;margin:1em 0 0;padding:1em 1em 0;border-top:1px solid #eee;color:inherit;font-size:1em}.swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto!important;overflow:hidden;border-bottom-right-radius:5px;border-bottom-left-radius:5px}.swal2-timer-progress-bar{width:100%;height:.25em;background:rgba(0,0,0,.2)}.swal2-image{max-width:100%;margin:2em auto 1em}.swal2-close{z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:color .1s,box-shadow .1s;border:none;border-radius:5px;background:0 0;color:#ccc;font-family:serif;font-family:monospace;font-size:2.5em;cursor:pointer;justify-self:end}.swal2-close:hover{transform:none;background:0 0;color:#f27474}.swal2-close:focus{outline:0;box-shadow:inset 0 0 0 3px rgba(100,150,200,.5)}.swal2-close::-moz-focus-inner{border:0}.swal2-html-container{z-index:1;justify-content:center;margin:1em 1.6em .3em;padding:0;overflow:auto;color:inherit;font-size:1.125em;font-weight:400;line-height:normal;text-align:center;word-wrap:break-word;word-break:break-word}.swal2-checkbox,.swal2-file,.swal2-input,.swal2-radio,.swal2-select,.swal2-textarea{margin:1em 2em 3px}.swal2-file,.swal2-input,.swal2-textarea{box-sizing:border-box;width:auto;transition:border-color .1s,box-shadow .1s;border:1px solid #d9d9d9;border-radius:.1875em;background:inherit;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px transparent;color:inherit;font-size:1.125em}.swal2-file.swal2-inputerror,.swal2-input.swal2-inputerror,.swal2-textarea.swal2-inputerror{border-color:#f27474!important;box-shadow:0 0 2px #f27474!important}.swal2-file:focus,.swal2-input:focus,.swal2-textarea:focus{border:1px solid #b4dbed;outline:0;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5)}.swal2-file::-moz-placeholder,.swal2-input::-moz-placeholder,.swal2-textarea::-moz-placeholder{color:#ccc}.swal2-file:-ms-input-placeholder,.swal2-input:-ms-input-placeholder,.swal2-textarea:-ms-input-placeholder{color:#ccc}.swal2-file::placeholder,.swal2-input::placeholder,.swal2-textarea::placeholder{color:#ccc}.swal2-range{margin:1em 2em 3px;background:#fff}.swal2-range input{width:80%}.swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}.swal2-range input,.swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}.swal2-input{height:2.625em;padding:0 .75em}.swal2-file{width:75%;margin-right:auto;margin-left:auto;background:inherit;font-size:1.125em}.swal2-textarea{height:6.75em;padding:.75em}.swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:inherit;color:inherit;font-size:1.125em}.swal2-checkbox,.swal2-radio{align-items:center;justify-content:center;background:#fff;color:inherit}.swal2-checkbox label,.swal2-radio label{margin:0 .6em;font-size:1.125em}.swal2-checkbox input,.swal2-radio input{flex-shrink:0;margin:0 .4em}.swal2-input-label{display:flex;justify-content:center;margin:1em auto 0}.swal2-validation-message{align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}.swal2-validation-message::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}.swal2-icon{position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;border:.25em solid transparent;border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}.swal2-icon.swal2-error{border-color:#f27474;color:#f27474}.swal2-icon.swal2-error .swal2-x-mark{position:relative;flex-grow:1}.swal2-icon.swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}.swal2-icon.swal2-error.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-error.swal2-icon-show .swal2-x-mark{-webkit-animation:swal2-animate-error-x-mark .5s;animation:swal2-animate-error-x-mark .5s}.swal2-icon.swal2-warning{border-color:#facea8;color:#f8bb86}.swal2-icon.swal2-warning.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-warning.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-i-mark .5s;animation:swal2-animate-i-mark .5s}.swal2-icon.swal2-info{border-color:#9de0f6;color:#3fc3ee}.swal2-icon.swal2-info.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-info.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-i-mark .8s;animation:swal2-animate-i-mark .8s}.swal2-icon.swal2-question{border-color:#c9dae1;color:#87adbd}.swal2-icon.swal2-question.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-question.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-question-mark .8s;animation:swal2-animate-question-mark .8s}.swal2-icon.swal2-success{border-color:#a5dc86;color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;transform:rotate(45deg);border-radius:50%}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}.swal2-icon.swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-.25em;left:-.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}.swal2-icon.swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}.swal2-icon.swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}.swal2-icon.swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-animate-success-line-tip .75s;animation:swal2-animate-success-line-tip .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-animate-success-line-long .75s;animation:swal2-animate-success-line-long .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-circular-line-right{-webkit-animation:swal2-rotate-success-circular-line 4.25s ease-in;animation:swal2-rotate-success-circular-line 4.25s ease-in}.swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:inherit;font-weight:600}.swal2-progress-steps li{display:inline-block;position:relative}.swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}.swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}[class^=swal2]{-webkit-tap-highlight-color:transparent}.swal2-show{-webkit-animation:swal2-show .3s;animation:swal2-show .3s}.swal2-hide{-webkit-animation:swal2-hide .15s forwards;animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}.swal2-no-war{display:flex;position:fixed;z-index:1061;top:0;left:0;align-items:center;justify-content:center;width:100%;height:3.375em;background:#20232a;color:#fff;text-align:center}.swal2-no-war a{color:#61dafb;text-decoration:none}.swal2-no-war a:hover{text-decoration:underline}@-webkit-keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@-webkit-keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@-webkit-keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@-webkit-keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@-webkit-keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@-webkit-keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@-webkit-keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@-webkit-keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@-webkit-keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@-webkit-keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@-webkit-keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@-webkit-keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@-webkit-keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@-webkit-keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto!important}body.swal2-no-backdrop .swal2-container{background-color:transparent!important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll!important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static!important}}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:transparent;pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{top:0;right:auto;bottom:auto;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{top:0;right:0;bottom:auto;left:auto}body.swal2-toast-shown .swal2-container.swal2-top-left,body.swal2-toast-shown .swal2-container.swal2-top-start{top:0;right:auto;bottom:auto;left:0}body.swal2-toast-shown .swal2-container.swal2-center-left,body.swal2-toast-shown .swal2-container.swal2-center-start{top:50%;right:auto;bottom:auto;left:0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{top:50%;right:auto;bottom:auto;left:50%;transform:translate(-50%,-50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{top:50%;right:0;bottom:auto;left:auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-left,body.swal2-toast-shown .swal2-container.swal2-bottom-start{top:auto;right:auto;bottom:0;left:0}body.swal2-toast-shown .swal2-container.swal2-bottom{top:auto;right:auto;bottom:0;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{top:auto;right:0;bottom:0;left:auto}')}},e={};function o(n){var a=e[n];if(void 0!==a)return a.exports;var s=e[n]={id:n,exports:{}};return t[n].call(s.exports,s,s.exports,o),s.exports}o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.nc=void 0;var n={};return(()=>{"use strict";var t;o.d(n,{default:()=>T});var e=new Uint8Array(16);function a(){if(!t&&!(t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return t(e)}const s=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,i=function(t){return"string"==typeof t&&s.test(t)};for(var r=[],l=0;l<256;++l)r.push((l+256).toString(16).substr(1));const c=function(t,e,o){var n=(t=t||{}).random||(t.rng||a)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,e){o=o||0;for(var s=0;s<16;++s)e[o+s]=n[s];return e}return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=(r[t[e+0]]+r[t[e+1]]+r[t[e+2]]+r[t[e+3]]+"-"+r[t[e+4]]+r[t[e+5]]+"-"+r[t[e+6]]+r[t[e+7]]+"-"+r[t[e+8]]+r[t[e+9]]+"-"+r[t[e+10]]+r[t[e+11]]+r[t[e+12]]+r[t[e+13]]+r[t[e+14]]+r[t[e+15]]).toLowerCase();if(!i(o))throw TypeError("Stringified UUID is invalid");return o}(n)};var d=o(455),u=o.n(d),p=o(40),m=o.n(p),w=o(379),g=o.n(w),h=o(795),f=o.n(h),b=o(569),y=o.n(b),v=o(565),x=o.n(v),k=o(216),C=o.n(k),A=o(589),B=o.n(A),P=o(745),E={};E.styleTagTransform=B(),E.setAttributes=x(),E.insert=y().bind(null,"head"),E.domAPI=f(),E.insertStyleElement=C(),g()(P.Z,E),P.Z&&P.Z.locals&&P.Z.locals;class T{static get enableLineBreaks(){return!0}constructor({data:t,config:e,api:o,readOnly:n}){this.api=o,this.readOnly=n,this.config=e||{},this._CSS={block:this.api.styles.block,wrapper:"ce-EditorJsColumns"},this.readOnly||(this.onKeyUp=this.onKeyUp.bind(this)),this._data={},this.editors={},this.colWrapper=void 0,this.editors.cols=[],this.data=t,Array.isArray(this.data.cols)?this.editors.numberOfColumns=this.data.cols.length:(this.data.cols=[],this.editors.numberOfColumns=2)}static get isReadOnlySupported(){return!0}onKeyUp(t){"Backspace"===t.code||t.code}get CSS(){return{settingsButton:this.api.styles.settingsButton,settingsButtonActive:this.api.styles.settingsButtonActive}}renderSettings(){return[{icon:"2",label:"2 Columns",onActivate:()=>{this._updateCols(2)}},{icon:"3",label:"3 Columns",onActivate:()=>{this._updateCols(3)}},{icon:"R",label:"Roll Colls",onActivate:()=>{this._rollCols()}}]}_rollCols(){this.data.cols.unshift(this.data.cols.pop()),this.editors.cols.unshift(this.editors.cols.pop()),this._rerender()}async _updateCols(t){2==t&&3==this.editors.numberOfColumns&&(await u().fire({title:"Are you sure?",text:"This will delete Column 3!",icon:"warning",showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:"Yes, delete it!"})).isConfirmed&&(this.editors.numberOfColumns=2,this.data.cols.pop(),this.editors.cols.pop(),this._rerender()),3==t&&(this.editors.numberOfColumns=3,this._rerender())}async _rerender(){await this.save();for(let t=0;t{t.stopPropagation()}),!0),this.colWrapper.addEventListener("keydown",(t=>{"Enter"===t.key&&(t.preventDefault(),t.stopImmediatePropagation(),t.stopPropagation()),"Tab"===t.key&&(t.preventDefault(),t.stopImmediatePropagation(),t.stopPropagation())}));for(let t=0;twindow.navigator.appVersion.toLowerCase().indexOf(n)!==-1);return t!==void 0&&(e[t]=!0),e}function re(e){return e!=null&&e!==""&&(typeof e!="object"||Object.keys(e).length>0)}function wt(e){return!re(e)}const Pt=()=>typeof window<"u"&&window.navigator!==null&&re(window.navigator.platform)&&(/iP(ad|hone|od)/.test(window.navigator.platform)||window.navigator.platform==="MacIntel"&&window.navigator.maxTouchPoints>1);function jt(e){const t=Re();return e=e.replace(/shift/gi,"⇧").replace(/backspace/gi,"⌫").replace(/enter/gi,"⏎").replace(/up/gi,"↑").replace(/left/gi,"→").replace(/down/gi,"↓").replace(/right/gi,"←").replace(/escape/gi,"⎋").replace(/insert/gi,"Ins").replace(/delete/gi,"␡").replace(/\+/gi,"+"),t.mac?e=e.replace(/ctrl|cmd/gi,"⌘").replace(/alt/gi,"⌥"):e=e.replace(/cmd/gi,"Ctrl").replace(/windows/gi,"WIN"),e}function Tt(e){return e[0].toUpperCase()+e.slice(1)}function Lt(e){const t=document.createElement("div");t.style.position="absolute",t.style.left="-999px",t.style.bottom="-999px",t.innerHTML=e,document.body.appendChild(t);const n=window.getSelection(),r=document.createRange();if(r.selectNode(t),n===null)throw new Error("Cannot copy text to clipboard");n.removeAllRanges(),n.addRange(r),document.execCommand("copy"),document.body.removeChild(t)}function Mt(e,t,n){let r;return(...i)=>{const a=this,l=()=>{r=void 0,n!==!0&&e.apply(a,i)},s=n===!0&&r!==void 0;window.clearTimeout(r),r=window.setTimeout(l,t),s&&e.apply(a,i)}}function C(e){return Object.prototype.toString.call(e).match(/\s([a-zA-Z]+)/)[1].toLowerCase()}function Nt(e){return C(e)==="boolean"}function qe(e){return C(e)==="function"||C(e)==="asyncfunction"}function At(e){return qe(e)&&/^\s*class\s+/.test(e.toString())}function $t(e){return C(e)==="number"}function N(e){return C(e)==="object"}function Bt(e){return Promise.resolve(e)===e}function Wt(e){return C(e)==="string"}function Dt(e){return C(e)==="undefined"}function ie(e,...t){if(!t.length)return e;const n=t.shift();if(N(e)&&N(n))for(const r in n)N(n[r])?(e[r]===void 0&&Object.assign(e,{[r]:{}}),ie(e[r],n[r])):Object.assign(e,{[r]:n[r]});return ie(e,...t)}function Ht(e,t,n){const r=`«${t}» is deprecated and will be removed in the next major release. Please use the «${n}» instead.`;e&&console.warn(r)}function Ft(e){try{return new URL(e).href}catch{}return e.substring(0,2)==="//"?window.location.protocol+e:window.location.origin+e}function Rt(e){return e>47&&e<58||e===32||e===13||e===229||e>64&&e<91||e>95&&e<112||e>185&&e<193||e>218&&e<223}const qt={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,LEFT:37,UP:38,DOWN:40,RIGHT:39,DELETE:46,META:91,SLASH:191},Ut={LEFT:0,WHEEL:1,RIGHT:2,BACKWARD:3,FORWARD:4};class zt{constructor(){this.completed=Promise.resolve()}add(t){return new Promise((n,r)=>{this.completed=this.completed.then(t).then(n).catch(r)})}}function Kt(e,t,n=void 0){let r,i,a,l=null,s=0;n||(n={});const o=function(){s=n.leading===!1?0:Date.now(),l=null,a=e.apply(r,i),l===null&&(r=i=null)};return function(){const d=Date.now();!s&&n.leading===!1&&(s=d);const u=t-(d-s);return r=this,i=arguments,u<=0||u>t?(l&&(clearTimeout(l),l=null),s=d,a=e.apply(r,i),l===null&&(r=i=null)):!l&&n.trailing!==!1&&(l=setTimeout(o,u)),a}}const ae=gt(Object.freeze(Object.defineProperty({__proto__:null,PromiseQueue:zt,beautifyShortcut:jt,cacheable:It,capitalize:Tt,copyTextToClipboard:Lt,debounce:Mt,deepMerge:ie,deprecationAssert:Ht,getUserOS:Re,getValidUrl:Ft,isBoolean:Nt,isClass:At,isEmpty:wt,isFunction:qe,isIosDevice:Pt,isNumber:$t,isObject:N,isPrintableKey:Rt,isPromise:Bt,isString:Wt,isUndefined:Dt,keyCodes:qt,mouseButtons:Ut,notEmpty:re,throttle:Kt,typeOf:C},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(ne,"__esModule",{value:!0}),ne.containsOnlyInlineElements=Vt;var Xt=ae,Gt=J;function Vt(e){var t;(0,Xt.isString)(e)?(t=document.createElement("div"),t.innerHTML=e):t=e;var n=function(r){return!(0,Gt.blockElements)().includes(r.tagName.toLowerCase())&&Array.from(r.children).every(n)};return Array.from(t.children).every(n)}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.containsOnlyInlineElements=void 0;var t=ne;Object.defineProperty(e,"containsOnlyInlineElements",{enumerable:!0,get:function(){return t.containsOnlyInlineElements}})})(M);var Ue={},le={},A={},se={};Object.defineProperty(se,"__esModule",{value:!0}),se.make=Yt;function Yt(e,t,n){var r;t===void 0&&(t=null),n===void 0&&(n={});var i=document.createElement(e);if(Array.isArray(t)){var a=t.filter(function(s){return s!==void 0});(r=i.classList).add.apply(r,a)}else t!==null&&i.classList.add(t);for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(i[l]=n[l]);return i}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.make=void 0;var t=se;Object.defineProperty(e,"make",{enumerable:!0,get:function(){return t.make}})})(A),Object.defineProperty(le,"__esModule",{value:!0}),le.fragmentToString=Qt;var Jt=A;function Qt(e){var t=(0,Jt.make)("div");return t.appendChild(e),t.innerHTML}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.fragmentToString=void 0;var t=le;Object.defineProperty(e,"fragmentToString",{enumerable:!0,get:function(){return t.fragmentToString}})})(Ue);var ze={},oe={};Object.defineProperty(oe,"__esModule",{value:!0}),oe.getContentLength=xt;var Zt=O;function xt(e){var t,n;return(0,Zt.isNativeInput)(e)?e.value.length:e.nodeType===Node.TEXT_NODE?e.length:(n=(t=e.textContent)===null||t===void 0?void 0:t.length)!==null&&n!==void 0?n:0}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getContentLength=void 0;var t=oe;Object.defineProperty(e,"getContentLength",{enumerable:!0,get:function(){return t.getContentLength}})})(ze);var ue={},ce={},Ke=L&&L.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r0;){var r=n.shift();if(r){if(e=r,(0,Sn.isLeaf)(e)&&!(0,On.isNodeEmpty)(e,t))return!1;n.push.apply(n,Array.from(e.childNodes))}}return!0}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isEmpty=void 0;var t=be;Object.defineProperty(e,"isEmpty",{enumerable:!0,get:function(){return t.isEmpty}})})(Qe);var Ze={},ke={};Object.defineProperty(ke,"__esModule",{value:!0}),ke.isFragment=En;var _n=ae;function En(e){return(0,_n.isNumber)(e)?!1:!!e&&!!e.nodeType&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isFragment=void 0;var t=ke;Object.defineProperty(e,"isFragment",{enumerable:!0,get:function(){return t.isFragment}})})(Ze);var xe={},_e={};Object.defineProperty(_e,"__esModule",{value:!0}),_e.isHTMLString=wn;var In=A;function wn(e){var t=(0,In.make)("div");return t.innerHTML=e,t.childElementCount>0}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isHTMLString=void 0;var t=_e;Object.defineProperty(e,"isHTMLString",{enumerable:!0,get:function(){return t.isHTMLString}})})(xe);var et={},Ee={};Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.offset=Pn;function Pn(e){var t=e.getBoundingClientRect(),n=window.pageXOffset||document.documentElement.scrollLeft,r=window.pageYOffset||document.documentElement.scrollTop,i=t.top+r,a=t.left+n;return{top:i,left:a,bottom:i+t.height,right:a+t.width}}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.offset=void 0;var t=Ee;Object.defineProperty(e,"offset",{enumerable:!0,get:function(){return t.offset}})})(et);var tt={},Ie={};Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.prepend=jn;function jn(e,t){Array.isArray(t)?(t=t.reverse(),t.forEach(function(n){return e.prepend(n)})):e.prepend(t)}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.prepend=void 0;var t=Ie;Object.defineProperty(e,"prepend",{enumerable:!0,get:function(){return t.prepend}})})(tt),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.prepend=e.offset=e.make=e.isLineBreakTag=e.isSingleTag=e.isNodeEmpty=e.isLeaf=e.isHTMLString=e.isFragment=e.isEmpty=e.isElement=e.isContentEditable=e.isCollapsedWhitespaces=e.findAllInputs=e.isNativeInput=e.allInputsSelector=e.getDeepestNode=e.getDeepestBlockElements=e.getContentLength=e.fragmentToString=e.containsOnlyInlineElements=e.canSetCaret=e.calculateBaseline=e.blockElements=e.append=void 0;var t=X;Object.defineProperty(e,"allInputsSelector",{enumerable:!0,get:function(){return t.allInputsSelector}});var n=O;Object.defineProperty(e,"isNativeInput",{enumerable:!0,get:function(){return n.isNativeInput}});var r=De;Object.defineProperty(e,"append",{enumerable:!0,get:function(){return r.append}});var i=J;Object.defineProperty(e,"blockElements",{enumerable:!0,get:function(){return i.blockElements}});var a=He;Object.defineProperty(e,"calculateBaseline",{enumerable:!0,get:function(){return a.calculateBaseline}});var l=Fe;Object.defineProperty(e,"canSetCaret",{enumerable:!0,get:function(){return l.canSetCaret}});var s=M;Object.defineProperty(e,"containsOnlyInlineElements",{enumerable:!0,get:function(){return s.containsOnlyInlineElements}});var o=Ue;Object.defineProperty(e,"fragmentToString",{enumerable:!0,get:function(){return o.fragmentToString}});var d=ze;Object.defineProperty(e,"getContentLength",{enumerable:!0,get:function(){return d.getContentLength}});var u=ue;Object.defineProperty(e,"getDeepestBlockElements",{enumerable:!0,get:function(){return u.getDeepestBlockElements}});var m=Ge;Object.defineProperty(e,"getDeepestNode",{enumerable:!0,get:function(){return m.getDeepestNode}});var g=Ye;Object.defineProperty(e,"findAllInputs",{enumerable:!0,get:function(){return g.findAllInputs}});var T=Je;Object.defineProperty(e,"isCollapsedWhitespaces",{enumerable:!0,get:function(){return T.isCollapsedWhitespaces}});var w=ee;Object.defineProperty(e,"isContentEditable",{enumerable:!0,get:function(){return w.isContentEditable}});var nr=ge;Object.defineProperty(e,"isElement",{enumerable:!0,get:function(){return nr.isElement}});var rr=Qe;Object.defineProperty(e,"isEmpty",{enumerable:!0,get:function(){return rr.isEmpty}});var ir=Ze;Object.defineProperty(e,"isFragment",{enumerable:!0,get:function(){return ir.isFragment}});var ar=xe;Object.defineProperty(e,"isHTMLString",{enumerable:!0,get:function(){return ar.isHTMLString}});var lr=ye;Object.defineProperty(e,"isLeaf",{enumerable:!0,get:function(){return lr.isLeaf}});var sr=Se;Object.defineProperty(e,"isNodeEmpty",{enumerable:!0,get:function(){return sr.isNodeEmpty}});var or=$;Object.defineProperty(e,"isLineBreakTag",{enumerable:!0,get:function(){return or.isLineBreakTag}});var ur=B;Object.defineProperty(e,"isSingleTag",{enumerable:!0,get:function(){return ur.isSingleTag}});var cr=A;Object.defineProperty(e,"make",{enumerable:!0,get:function(){return cr.make}});var dr=et;Object.defineProperty(e,"offset",{enumerable:!0,get:function(){return dr.offset}});var fr=tt;Object.defineProperty(e,"prepend",{enumerable:!0,get:function(){return fr.prepend}})}(c);const h="cdx-list",p={wrapper:h,item:`${h}__item`,itemContent:`${h}__item-content`,itemChildren:`${h}__item-children`};class v{static get CSS(){return{...p,orderedList:`${h}-ordered`}}constructor(t,n){this.config=n,this.readOnly=t}renderWrapper(t){let n;return t===!0?n=c.make("ol",[v.CSS.wrapper,v.CSS.orderedList]):n=c.make("ol",[v.CSS.orderedList,v.CSS.itemChildren]),n}renderItem(t,n){const r=c.make("li",v.CSS.item),i=c.make("div",v.CSS.itemContent,{innerHTML:t,contentEditable:(!this.readOnly).toString()});return r.appendChild(i),r}getItemContent(t){const n=t.querySelector(`.${v.CSS.itemContent}`);return!n||c.isEmpty(n)?"":n.innerHTML}getItemMeta(){return{}}composeDefaultMeta(){return{}}}class b{static get CSS(){return{...p,unorderedList:`${h}-unordered`}}constructor(t,n){this.config=n,this.readOnly=t}renderWrapper(t){let n;return t===!0?n=c.make("ul",[b.CSS.wrapper,b.CSS.unorderedList]):n=c.make("ul",[b.CSS.unorderedList,b.CSS.itemChildren]),n}renderItem(t,n){const r=c.make("li",b.CSS.item),i=c.make("div",b.CSS.itemContent,{innerHTML:t,contentEditable:(!this.readOnly).toString()});return r.appendChild(i),r}getItemContent(t){const n=t.querySelector(`.${b.CSS.itemContent}`);return!n||c.isEmpty(n)?"":n.innerHTML}getItemMeta(){return{}}composeDefaultMeta(){return{}}}function k(e){return e.nodeType===Node.ELEMENT_NODE}var j={},we={},D={},H={};Object.defineProperty(H,"__esModule",{value:!0}),H.getContenteditableSlice=Ln;var Tn=c;function Ln(e,t,n,r,i){var a;i===void 0&&(i=!1);var l=document.createRange();if(r==="left"?(l.setStart(e,0),l.setEnd(t,n)):(l.setStart(t,n),l.setEnd(e,e.childNodes.length)),i===!0){var s=l.extractContents();return(0,Tn.fragmentToString)(s)}var o=l.cloneContents(),d=document.createElement("div");d.appendChild(o);var u=(a=d.textContent)!==null&&a!==void 0?a:"";return u}Object.defineProperty(D,"__esModule",{value:!0}),D.checkContenteditableSliceForEmptiness=An;var Mn=c,Nn=H;function An(e,t,n,r){var i=(0,Nn.getContenteditableSlice)(e,t,n,r);return(0,Mn.isCollapsedWhitespaces)(i)}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.checkContenteditableSliceForEmptiness=void 0;var t=D;Object.defineProperty(e,"checkContenteditableSliceForEmptiness",{enumerable:!0,get:function(){return t.checkContenteditableSliceForEmptiness}})})(we);var nt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getContenteditableSlice=void 0;var t=H;Object.defineProperty(e,"getContenteditableSlice",{enumerable:!0,get:function(){return t.getContenteditableSlice}})})(nt);var rt={},Pe={};Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.focus=Bn;var $n=c;function Bn(e,t){var n,r;if(t===void 0&&(t=!0),(0,$n.isNativeInput)(e)){e.focus();var i=t?0:e.value.length;e.setSelectionRange(i,i)}else{var a=document.createRange(),l=window.getSelection();if(!l)return;var s=function(g,T){T===void 0&&(T=!1);var w=document.createTextNode("");T?g.insertBefore(w,g.firstChild):g.appendChild(w),a.setStart(w,0),a.setEnd(w,0)},o=function(g){return g!=null},d=e.childNodes,u=t?d[0]:d[d.length-1];if(o(u)){for(;o(u)&&u.nodeType!==Node.TEXT_NODE;)u=t?u.firstChild:u.lastChild;if(o(u)&&u.nodeType===Node.TEXT_NODE){var m=(r=(n=u.textContent)===null||n===void 0?void 0:n.length)!==null&&r!==void 0?r:0,i=t?0:m;a.setStart(u,i),a.setEnd(u,i)}else s(e,t)}else s(e);l.removeAllRanges(),l.addRange(a)}}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.focus=void 0;var t=Pe;Object.defineProperty(e,"focus",{enumerable:!0,get:function(){return t.focus}})})(rt);var je={},F={};Object.defineProperty(F,"__esModule",{value:!0}),F.getCaretNodeAndOffset=Wn;function Wn(){var e=window.getSelection();if(e===null)return[null,0];var t=e.focusNode,n=e.focusOffset;return t===null?[null,0]:(t.nodeType!==Node.TEXT_NODE&&t.childNodes.length>0&&(t.childNodes[n]!==void 0?(t=t.childNodes[n],n=0):(t=t.childNodes[n-1],t.textContent!==null&&(n=t.textContent.length))),[t,n])}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getCaretNodeAndOffset=void 0;var t=F;Object.defineProperty(e,"getCaretNodeAndOffset",{enumerable:!0,get:function(){return t.getCaretNodeAndOffset}})})(je);var it={},R={};Object.defineProperty(R,"__esModule",{value:!0}),R.getRange=Dn;function Dn(){var e=window.getSelection();return e&&e.rangeCount?e.getRangeAt(0):null}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getRange=void 0;var t=R;Object.defineProperty(e,"getRange",{enumerable:!0,get:function(){return t.getRange}})})(it);var at={},Te={};Object.defineProperty(Te,"__esModule",{value:!0}),Te.isCaretAtEndOfInput=Rn;var lt=c,Hn=je,Fn=we;function Rn(e){var t=(0,lt.getDeepestNode)(e,!0);if(t===null)return!0;if((0,lt.isNativeInput)(t))return t.selectionEnd===t.value.length;var n=(0,Hn.getCaretNodeAndOffset)(),r=n[0],i=n[1];return r===null?!1:(0,Fn.checkContenteditableSliceForEmptiness)(e,r,i,"right")}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isCaretAtEndOfInput=void 0;var t=Te;Object.defineProperty(e,"isCaretAtEndOfInput",{enumerable:!0,get:function(){return t.isCaretAtEndOfInput}})})(at);var st={},Le={};Object.defineProperty(Le,"__esModule",{value:!0}),Le.isCaretAtStartOfInput=zn;var q=c,qn=F,Un=D;function zn(e){var t=(0,q.getDeepestNode)(e);if(t===null||(0,q.isEmpty)(e))return!0;if((0,q.isNativeInput)(t))return t.selectionEnd===0;if((0,q.isEmpty)(e))return!0;var n=(0,qn.getCaretNodeAndOffset)(),r=n[0],i=n[1];return r===null?!1:(0,Un.checkContenteditableSliceForEmptiness)(e,r,i,"left")}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isCaretAtStartOfInput=void 0;var t=Le;Object.defineProperty(e,"isCaretAtStartOfInput",{enumerable:!0,get:function(){return t.isCaretAtStartOfInput}})})(st);var ot={},Me={};Object.defineProperty(Me,"__esModule",{value:!0}),Me.save=Gn;var Kn=c,Xn=R;function Gn(){var e=(0,Xn.getRange)(),t=(0,Kn.make)("span");if(t.id="cursor",t.hidden=!0,!!e)return e.insertNode(t),function(){var r=window.getSelection();r&&(e.setStartAfter(t),e.setEndAfter(t),r.removeAllRanges(),r.addRange(e),setTimeout(function(){t.remove()},150))}}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.save=void 0;var t=Me;Object.defineProperty(e,"save",{enumerable:!0,get:function(){return t.save}})})(ot),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.save=e.isCaretAtStartOfInput=e.isCaretAtEndOfInput=e.getRange=e.getCaretNodeAndOffset=e.focus=e.getContenteditableSlice=e.checkContenteditableSliceForEmptiness=void 0;var t=we;Object.defineProperty(e,"checkContenteditableSliceForEmptiness",{enumerable:!0,get:function(){return t.checkContenteditableSliceForEmptiness}});var n=nt;Object.defineProperty(e,"getContenteditableSlice",{enumerable:!0,get:function(){return n.getContenteditableSlice}});var r=rt;Object.defineProperty(e,"focus",{enumerable:!0,get:function(){return r.focus}});var i=je;Object.defineProperty(e,"getCaretNodeAndOffset",{enumerable:!0,get:function(){return i.getCaretNodeAndOffset}});var a=it;Object.defineProperty(e,"getRange",{enumerable:!0,get:function(){return a.getRange}});var l=at;Object.defineProperty(e,"isCaretAtEndOfInput",{enumerable:!0,get:function(){return l.isCaretAtEndOfInput}});var s=st;Object.defineProperty(e,"isCaretAtStartOfInput",{enumerable:!0,get:function(){return s.isCaretAtStartOfInput}});var o=ot;Object.defineProperty(e,"save",{enumerable:!0,get:function(){return o.save}})}(j);class f{static get CSS(){return{...p,checklist:`${h}-checklist`,itemChecked:`${h}__checkbox--checked`,noHover:`${h}__checkbox--no-hover`,checkbox:`${h}__checkbox-check`,checkboxContainer:`${h}__checkbox`}}constructor(t,n){this.config=n,this.readOnly=t}renderWrapper(t){let n;return t===!0?(n=c.make("ul",[f.CSS.wrapper,f.CSS.checklist]),n.addEventListener("click",r=>{const i=r.target;if(i){const a=i.closest(`.${f.CSS.checkboxContainer}`);a&&a.contains(i)&&this.toggleCheckbox(a)}})):n=c.make("ul",[f.CSS.checklist,f.CSS.itemChildren]),n}renderItem(t,n){const r=c.make("li",[f.CSS.item,f.CSS.item]),i=c.make("div",f.CSS.itemContent,{innerHTML:t,contentEditable:(!this.readOnly).toString()}),a=c.make("span",f.CSS.checkbox),l=c.make("div",f.CSS.checkboxContainer);return n.checked===!0&&l.classList.add(f.CSS.itemChecked),a.innerHTML=P,l.appendChild(a),r.appendChild(l),r.appendChild(i),r}getItemContent(t){const n=t.querySelector(`.${f.CSS.itemContent}`);return!n||c.isEmpty(n)?"":n.innerHTML}getItemMeta(t){const n=t.querySelector(`.${f.CSS.checkboxContainer}`);return{checked:n?n.classList.contains(f.CSS.itemChecked):!1}}composeDefaultMeta(){return{checked:!1}}toggleCheckbox(t){t.classList.toggle(f.CSS.itemChecked),t.classList.add(f.CSS.noHover),t.addEventListener("mouseleave",()=>this.removeSpecialHoverBehavior(t),{once:!0})}removeSpecialHoverBehavior(t){t.classList.remove(f.CSS.noHover)}}function Ne(e,t="after"){const n=[];let r;function i(a){switch(t){case"after":return a.nextElementSibling;case"before":return a.previousElementSibling}}for(r=i(e);r!==null;)n.push(r),r=i(r);return n.length!==0?n:null}function y(e,t=!0){let n=e;return e.classList.contains(p.item)&&(n=e.querySelector(`.${p.itemChildren}`)),n===null?[]:t?Array.from(n.querySelectorAll(`:scope > .${p.item}`)):Array.from(n.querySelectorAll(`.${p.item}`))}function Vn(e){return e.nextElementSibling===null}function Yn(e){return e.querySelector(`.${p.itemChildren}`)!==null}function S(e){return e.querySelector(`.${p.itemChildren}`)}function Ae(e){let t=e;e.classList.contains(p.item)&&(t=S(e)),t!==null&&y(t).length===0&&t.remove()}function U(e){return e.querySelector(`.${p.itemContent}`)}function E(e,t=!0){const n=U(e);n&&j.focus(n,t)}class $e{get currentItem(){const t=window.getSelection();if(!t)return null;let n=t.anchorNode;return!n||(k(n)||(n=n.parentNode),!n)||!k(n)?null:n.closest(`.${p.item}`)}get currentItemLevel(){const t=this.currentItem;if(t===null)return null;let n=t.parentNode,r=0;for(;n!==null&&n!==this.listWrapper;)k(n)&&n.classList.contains(p.item)&&(r+=1),n=n.parentNode;return r+1}constructor({data:t,config:n,api:r,readOnly:i,block:a},l){this.config=n,this.data=t,this.readOnly=i,this.api=r,this.block=a,this.renderer=l}render(){return this.listWrapper=this.renderer.renderWrapper(!0),this.data.items.length?this.appendItems(this.data.items,this.listWrapper):this.appendItems([{content:"",meta:{},items:[]}],this.listWrapper),this.readOnly||this.listWrapper.addEventListener("keydown",t=>{switch(t.key){case"Enter":this.enterPressed(t);break;case"Backspace":this.backspace(t);break;case"Tab":t.shiftKey?this.shiftTab(t):this.addTab(t);break}},!1),"start"in this.data.meta&&this.data.meta.start!==void 0&&this.changeStartWith(this.data.meta.start),"counterType"in this.data.meta&&this.data.meta.counterType!==void 0&&this.changeCounters(this.data.meta.counterType),this.listWrapper}save(t){const n=t??this.listWrapper,r=l=>y(l).map(o=>{const d=S(o),u=this.renderer.getItemContent(o),m=this.renderer.getItemMeta(o),g=d?r(d):[];return{content:u,meta:m,items:g}}),i=n?r(n):[];let a={style:this.data.style,meta:{},items:i};return this.data.style==="ordered"&&(a.meta={start:this.data.meta.start,counterType:this.data.meta.counterType}),a}static get pasteConfig(){return{tags:["OL","UL","LI"]}}merge(t){const n=this.block.holder.querySelectorAll(`.${p.item}`),r=n[n.length-1],i=U(r);if(r===null||i===null||(i.insertAdjacentHTML("beforeend",t.items[0].content),this.listWrapper===void 0))return;const a=y(this.listWrapper);if(a.length===0)return;const l=a[a.length-1];let s=S(l);const o=t.items.shift();o!==void 0&&(o.items.length!==0&&(s===null&&(s=this.renderer.renderWrapper(!1)),this.appendItems(o.items,s)),t.items.length>0&&this.appendItems(t.items,this.listWrapper))}onPaste(t){const n=t.detail.data;this.data=this.pasteHandler(n);const r=this.listWrapper;r&&r.parentNode&&r.parentNode.replaceChild(this.render(),r)}pasteHandler(t){const{tagName:n}=t;let r="unordered",i;switch(n){case"OL":r="ordered",i="ol";break;case"UL":case"LI":r="unordered",i="ul"}const a={style:r,meta:{},items:[]};r==="ordered"&&(this.data.meta.counterType="numeric",this.data.meta.start=1);const l=s=>Array.from(s.querySelectorAll(":scope > li")).map(d=>{const u=d.querySelector(`:scope > ${i}`),m=u?l(u):[];return{content:d.innerHTML??"",meta:{},items:m}});return a.items=l(t),a}changeStartWith(t){this.listWrapper.style.setProperty("counter-reset",`item ${t-1}`),this.data.meta.start=t}changeCounters(t){this.listWrapper.style.setProperty("--list-counter-type",t),this.data.meta.counterType=t}enterPressed(t){var s;const n=this.currentItem;if(t.stopPropagation(),t.preventDefault(),t.isComposing||n===null)return;const r=((s=this.renderer)==null?void 0:s.getItemContent(n).trim().length)===0,i=n.parentNode===this.listWrapper,a=n.previousElementSibling===null,l=this.api.blocks.getCurrentBlockIndex();if(i&&r)if(Vn(n)&&!Yn(n)){a?this.convertItemToDefaultBlock(l,!0):this.convertItemToDefaultBlock();return}else{this.splitList(n);return}else if(r){this.unshiftItem(n);return}else this.splitItem(n)}backspace(t){var r;const n=this.currentItem;if(n!==null&&j.isCaretAtStartOfInput(n)&&((r=window.getSelection())==null?void 0:r.isCollapsed)!==!1){if(t.stopPropagation(),n.parentNode===this.listWrapper&&n.previousElementSibling===null){this.convertFirstItemToDefaultBlock();return}t.preventDefault(),this.mergeItemWithPrevious(n)}}shiftTab(t){t.stopPropagation(),t.preventDefault(),this.currentItem!==null&&this.unshiftItem(this.currentItem)}unshiftItem(t){if(!t.parentNode||!k(t.parentNode))return;const n=t.parentNode.closest(`.${p.item}`);if(!n)return;let r=S(t);if(t.parentElement===null)return;const i=Ne(t);i!==null&&(r===null&&(r=this.renderer.renderWrapper(!1)),i.forEach(a=>{r.appendChild(a)}),t.appendChild(r)),n.after(t),E(t,!1),Ae(n)}splitList(t){const n=y(t),r=this.block,i=this.api.blocks.getCurrentBlockIndex();if(n.length!==0){const o=n[0];this.unshiftItem(o),E(t,!1)}if(t.previousElementSibling===null&&t.parentNode===this.listWrapper){this.convertItemToDefaultBlock(i);return}const a=Ne(t);if(a===null)return;const l=this.renderer.renderWrapper(!0);a.forEach(o=>{l.appendChild(o)});const s=this.save(l);s.meta.start=this.data.style=="ordered"?1:void 0,this.api.blocks.insert(r==null?void 0:r.name,s,this.config,i+1),this.convertItemToDefaultBlock(i+1),l.remove()}splitItem(t){const[n,r]=j.getCaretNodeAndOffset();if(n===null)return;const i=U(t);let a;i===null?a="":a=j.getContenteditableSlice(i,n,r,"right",!0);const l=S(t),s=this.renderItem(a);t==null||t.after(s),l&&s.appendChild(l),E(s)}mergeItemWithPrevious(t){const n=t.previousElementSibling,r=t.parentNode;if(r===null||!k(r))return;const i=r.closest(`.${p.item}`);if(!n&&!i||n&&!k(n))return;let a;if(n){const m=y(n,!1);m.length!==0&&m.length!==0?a=m[m.length-1]:a=n}else a=i;const l=this.renderer.getItemContent(t);if(!a)return;E(a,!1);const s=U(a);if(s===null)return;s.insertAdjacentHTML("beforeend",l);const o=y(t);if(o.length===0){t.remove(),Ae(a);return}const d=n||i,u=S(d)??this.renderer.renderWrapper(!1);n?o.forEach(m=>{u.appendChild(m)}):o.forEach(m=>{u.prepend(m)}),S(d)===null&&a.appendChild(u),t.remove()}addTab(t){var a;t.stopPropagation(),t.preventDefault();const n=this.currentItem;if(!n)return;if(((a=this.config)==null?void 0:a.maxLevel)!==void 0){const l=this.currentItemLevel;if(l!==null&&l===this.config.maxLevel)return}const r=n.previousSibling;if(r===null||!k(r))return;const i=S(r);if(i)i.appendChild(n),y(n).forEach(s=>{i.appendChild(s)});else{const l=this.renderer.renderWrapper(!1);l.appendChild(n),y(n).forEach(o=>{l.appendChild(o)}),r.appendChild(l)}Ae(n),E(n,!1)}convertItemToDefaultBlock(t,n){let r;const i=this.currentItem,a=i!==null?this.renderer.getItemContent(i):"";n===!0&&this.api.blocks.delete(),t!==void 0?r=this.api.blocks.insert(void 0,{text:a},void 0,t):r=this.api.blocks.insert(),i==null||i.remove(),this.api.caret.setToBlock(r,"start")}convertFirstItemToDefaultBlock(){const t=this.currentItem;if(t===null)return;const n=y(t);if(n.length!==0){const l=n[0];this.unshiftItem(l),E(t)}const r=Ne(t),i=this.api.blocks.getCurrentBlockIndex(),a=r===null;this.convertItemToDefaultBlock(i,a)}renderItem(t,n){const r=n??this.renderer.composeDefaultMeta();switch(!0){case this.renderer instanceof v:return this.renderer.renderItem(t,r);case this.renderer instanceof b:return this.renderer.renderItem(t,r);default:return this.renderer.renderItem(t,r)}}appendItems(t,n){t.forEach(r=>{var a;const i=this.renderItem(r.content,r.meta);if(n.appendChild(i),r.items.length){const l=(a=this.renderer)==null?void 0:a.renderWrapper(!1);this.appendItems(r.items,l),i.appendChild(l)}})}}const I={wrapper:`${h}-start-with-field`,input:`${h}-start-with-field__input`,startWithElementWrapperInvalid:`${h}-start-with-field--invalid`};function Jn(e,{value:t,placeholder:n,attributes:r,sanitize:i}){const a=c.make("div",I.wrapper),l=c.make("input",I.input,{placeholder:n,tabIndex:-1,value:t});for(const s in r)l.setAttribute(s,r[s]);return a.appendChild(l),l.addEventListener("input",()=>{i!==void 0&&(l.value=i(l.value));const s=l.checkValidity();!s&&!a.classList.contains(I.startWithElementWrapperInvalid)&&a.classList.add(I.startWithElementWrapperInvalid),s&&a.classList.contains(I.startWithElementWrapperInvalid)&&a.classList.remove(I.startWithElementWrapperInvalid),s&&e(l.value)}),a}const z=new Map([["Numeric","numeric"],["Lower Roman","lower-roman"],["Upper Roman","upper-roman"],["Lower Alpha","lower-alpha"],["Upper Alpha","upper-alpha"]]),ut=new Map([["numeric",ct],["lower-roman",dt],["upper-roman",ft],["lower-alpha",mt],["upper-alpha",pt]]),mr="",hr="";function Qn(e){return e.replace(/\D+/g,"")}function Zn(e){return typeof e.items[0]=="string"}function xn(e){return!("meta"in e)}function er(e){return typeof e.items[0]!="string"&&"text"in e.items[0]&&"checked"in e.items[0]&&typeof e.items[0].text=="string"&&typeof e.items[0].checked=="boolean"}function tr(e){const t=[];return Zn(e)?(e.items.forEach(n=>{t.push({content:n,meta:{},items:[]})}),{style:e.style,meta:{},items:t}):er(e)?(e.items.forEach(n=>{t.push({content:n.text,meta:{checked:n.checked},items:[]})}),{style:"checklist",meta:{},items:t}):xn(e)?{style:e.style,meta:{},items:e.items}:e}class K{static get isReadOnlySupported(){return!0}static get enableLineBreaks(){return!0}static get toolbox(){return[{icon:Be,title:"Unordered List",data:{style:"unordered"}},{icon:We,title:"Ordered List",data:{style:"ordered"}},{icon:_,title:"Checklist",data:{style:"checklist"}}]}static get pasteConfig(){return{tags:["OL","UL","LI"]}}static get conversionConfig(){return{export:t=>K.joinRecursive(t),import:(t,n)=>({meta:{},items:[{content:t,meta:{},items:[]}],style:(n==null?void 0:n.defaultStyle)!==void 0?n.defaultStyle:"unordered"})}}get listStyle(){return this.data.style||this.defaultListStyle}set listStyle(t){var r;this.data.style=t,this.changeTabulatorByStyle();const n=this.list.render();(r=this.listElement)==null||r.replaceWith(n),this.listElement=n}constructor({data:t,config:n,api:r,readOnly:i,block:a}){var s;this.api=r,this.readOnly=i,this.config=n,this.block=a,this.defaultListStyle=((s=this.config)==null?void 0:s.defaultStyle)||"unordered";const l={style:this.defaultListStyle,meta:{},items:[]};this.data=Object.keys(t).length?tr(t):l,this.listStyle==="ordered"&&this.data.meta.counterType===void 0&&(this.data.meta.counterType="numeric"),this.changeTabulatorByStyle()}static joinRecursive(t){return t.items.map(n=>`${n.content} ${K.joinRecursive(n)}`).join("")}render(){return this.listElement=this.list.render(),this.listElement}save(){return this.data=this.list.save(),this.data}merge(t){this.list.merge(t)}renderSettings(){const t=[{label:this.api.i18n.t("Unordered"),icon:Be,closeOnActivate:!0,isActive:this.listStyle=="unordered",onActivate:()=>{this.listStyle="unordered"}},{label:this.api.i18n.t("Ordered"),icon:We,closeOnActivate:!0,isActive:this.listStyle=="ordered",onActivate:()=>{this.listStyle="ordered"}},{label:this.api.i18n.t("Checklist"),icon:_,closeOnActivate:!0,isActive:this.listStyle=="checklist",onActivate:()=>{this.listStyle="checklist"}}];if(this.listStyle==="ordered"){const n=Jn(a=>this.changeStartWith(Number(a)),{value:String(this.data.meta.start??1),placeholder:"",attributes:{required:"true"},sanitize:a=>Qn(a)}),r=[{label:this.api.i18n.t("Start with"),icon:ht,children:{items:[{element:n,type:"html"}]}}],i={label:this.api.i18n.t("Counter type"),icon:ut.get(this.data.meta.counterType),children:{items:[]}};z.forEach((a,l)=>{i.children.items.push({title:this.api.i18n.t(l),icon:ut.get(z.get(l)),isActive:this.data.meta.counterType===z.get(l),closeOnActivate:!0,onActivate:()=>{this.changeCounters(z.get(l))}})}),t.push({type:"separator"},...r,i)}return t}onPaste(t){const{tagName:n}=t.detail.data;switch(n){case"OL":this.listStyle="ordered";break;case"UL":case"LI":this.listStyle="unordered"}this.list.onPaste(t)}pasteHandler(t){return this.list.pasteHandler(t)}changeCounters(t){var n;(n=this.list)==null||n.changeCounters(t),this.data.meta.counterType=t}changeStartWith(t){var n;(n=this.list)==null||n.changeStartWith(t),this.data.meta.start=t}changeTabulatorByStyle(){switch(this.listStyle){case"ordered":this.list=new $e({data:this.data,readOnly:this.readOnly,api:this.api,config:this.config,block:this.block},new v(this.readOnly,this.config));break;case"unordered":this.list=new $e({data:this.data,readOnly:this.readOnly,api:this.api,config:this.config,block:this.block},new b(this.readOnly,this.config));break;case"checklist":this.list=new $e({data:this.data,readOnly:this.readOnly,api:this.api,config:this.config,block:this.block},new f(this.readOnly,this.config));break}}}return K}); +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.editorjsNestedChecklist=t():e.editorjsNestedChecklist=t()}(self,(function(){return(()=>{var e={321:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var i=n(645),s=n.n(i)()((function(e){return e[1]}));s.push([e.id,'.cdx-nested-list {\n margin: 0;\n padding: 0;\n outline: none;\n counter-reset: item;\n list-style: none;\n}\n\n .cdx-nested-list__item {\n line-height: 1.6em;\n display: flex;\n margin: 2px 0;\n }\n\n .cdx-nested-list__item [contenteditable]{\n outline: none;\n }\n\n .cdx-nested-list__item-body {\n flex-grow: 2;\n /* display:flex; */\n }\n\n .cdx-nested-list__item-content,\n .cdx-nested-list__item-children {\n flex-basis: 100%;\n }\n\n .cdx-nested-list__item-content {\n display : inline-block;\n word-break: break-word;\n white-space: pre-wrap;\n margin-left:5px;\n }\n\n .cdx-nested-list__item-checked {\n display : inline-block;\n margin-top: 3px;\n width:20px;\n height:20px;\n background-color:#eee;\n border-radius: 50%;\n border: 1px solid #d0d0d0;\n \n }\n\n /* .cdx-checklist__item-checkbox {\n display: inline-block;\n flex-shrink: 0;\n position: relative;\n width: 20px;\n height: 20px;\n margin: 5px;\n margin-left: 0;\n margin-right: 7px;\n border-radius: 50%;\n border: 1px solid #d0d0d0;\n background: #fff;\n cursor: pointer;\n user-select: none;\n } */\n\n .cdx-nested-list__item-children {}\n\n .cdx-nested-list__item::before {\n counter-increment: item;\n margin-right: 5px;\n white-space: nowrap;\n }\n\n .cdx-nested-list--ordered > .cdx-nested-list__item::before {\n content: counters(item, ".") ". ";\n }\n\n .cdx-nested-list--unordered > .cdx-nested-list__item::before {\n content: "●";\n }\n\n .cdx-nested-list--none > .cdx-nested-list__item::before {\n content: "\\00a0\\00a0\\00a0";\n }\n\n .cdx-nested-list__settings {\n display: flex;\n }\n\n .cdx-nested-list__settings .cdx-settings-button {\n width: 50%;\n }\n\n\n.removebullet::before{\n content: \'\' !important;\n}\n\n.cdx-nested-list__item-checkedContentWrapper{\n display:flex;\n}\n\n\n.itemChecked_true{\n background:#388ae5;\n border: 1px solid #388ae5;\n cursor : pointer;\n \n}\n.itemChecked_true::before {\n content: \'\';\n width: 20px;\n height: 20px;\n background-color:#fff;\n display: block;\n position: absolute;\n clip-path: polygon(31% 50%, 43% 62%, 71% 34%, 77% 40%, 43% 74%, 25% 56%);\n}\n\n.itemChecked_false{\n background-color:#fff;\n border: 1px solid #d0d0d0;\n cursor : pointer;\n}\n.itemChecked_null{\n border: 1px solid #fff;\n /* background-color:#DDDFE6; */\n /* border:2px solid #DDDFE6; */\n background:#fff;\n /* opacity:0; */\n /* height:4px; */\n /* margin-top:10px; */\n width:4px;\n /* margin-left:-20px; */\n transition: width 0.25s ease-in-out, opacity 0.25s ease-in-out;\n opacity:0;\n /* transition: opacity 0.25s ease-in-out; */\n /* position:absolute; */\n cursor : pointer;\n}\n.itemChecked_null_hover{\n /* position:relative; */\n width:20px;\n opacity:1;\n background-color:#DDDFE6;\n border: 1px solid #DDDFE6;\n}\n',""]);const r=s},645:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,i){"string"==typeof e&&(e=[[null,e,""]]);var s={};if(i)for(var r=0;r{"use strict";var i,s=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),r=[];function o(e){for(var t=-1,n=0;n{e.exports=''}},t={};function n(i){var s=t[i];if(void 0!==s)return s.exports;var r=t[i]={id:i,exports:{}};return e[i](r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var i={};return(()=>{"use strict";function e(e,t=null,n={}){const i=document.createElement(e);Array.isArray(t)?i.classList.add(...t):t&&i.classList.add(t);for(const e in n)i[e]=n[e];return i}function t(t){const n=e("div");return n.appendChild(t),n.innerHTML}function s(e){let t;return e.nodeType!==Node.ELEMENT_NODE?t=e.textContent:(t=e.innerHTML,t=t.replaceAll("
    ","")),0===t.trim().length}n.d(i,{default:()=>h});class r{constructor(){this.savedFakeCaret=void 0}save(){const t=r.range,n=e("span");n.hidden=!0,t.insertNode(n),this.savedFakeCaret=n}restore(){if(!this.savedFakeCaret)return;const e=window.getSelection(),t=new Range;t.setStartAfter(this.savedFakeCaret),t.setEndAfter(this.savedFakeCaret),e.removeAllRanges(),e.addRange(t),setTimeout((()=>{this.savedFakeCaret.remove()}),150)}static get range(){const e=window.getSelection();return e&&e.rangeCount?e.getRangeAt(0):null}static extractFragmentFromCaretPositionTillTheEnd(){const e=window.getSelection();if(!e.rangeCount)return;const t=e.getRangeAt(0);let n=t.startContainer;n.nodeType!==Node.ELEMENT_NODE&&(n=n.parentNode);const i=n.closest("[contenteditable]");t.deleteContents();const s=t.cloneRange();return s.selectNodeContents(i),s.setStart(t.endContainer,t.endOffset),s.extractContents()}static focus(e,t=!0){const n=document.createRange(),i=window.getSelection();n.selectNodeContents(e),n.collapse(t),i.removeAllRanges(),i.addRange(n)}static isAtStart(){const e=window.getSelection();if(e.focusOffset>0)return!1;const t=e.focusNode;return r.getHigherLevelSiblings(t,"left").every((e=>s(e)))}static getHigherLevelSiblings(e,t="left"){let n=e;const i=[];for(;n.parentNode&&"true"!==n.parentNode.contentEditable;)n=n.parentNode;const s="left"===t?"previousSibling":"nextSibling";for(;n[s];)n=n[s],i.push(n);return i}}var o=n(379),a=n.n(o),d=n(321);a()(d.Z,{insert:"head",singleton:!1}),d.Z.locals;var c=n(499),l=n.n(c);class h{static get isReadOnlySupported(){return!0}static get enableLineBreaks(){return!0}constructor({data:e,config:t,api:n,readOnly:i}){this.nodes={wrapper:null},this.api=n,this.readOnly=i,this.config=t,this.settings=[{name:"none",title:this.api.i18n.t("None"),icon:'',default:!1},{name:"unordered",title:this.api.i18n.t("Unordered"),icon:' ',default:!1},{name:"ordered",title:this.api.i18n.t("Ordered"),icon:'',default:!0}],this.defaultListStyle="ordered";const s={style:this.defaultListStyle,items:[]};this.data=e&&Object.keys(e).length?e:s,this.caret=new r}render(){return this.nodes.wrapper=this.makeListWrapper(this.data.style,[this.CSS.baseBlock]),this.data.items.length?this.appendItems(this.data.items,this.nodes.wrapper):this.appendItems([{content:"",items:[],checked:null}],this.nodes.wrapper),this.readOnly||this.nodes.wrapper.addEventListener("keydown",(e=>{switch(e.key){case"Enter":this.enterPressed(e);break;case"Backspace":this.backspace(e);break;case"Tab":e.shiftKey?this.shiftTab(e):this.addTab(e)}}),!1),this.nodes.wrapper}renderSettings(){const t=e("div",[this.CSS.settingsWrapper],{});return this.settings.forEach((n=>{const i=e("div",this.CSS.settingsButton,{innerHTML:n.icon});i.addEventListener("click",(()=>{this.listStyle=n.name;const e=i.parentNode.querySelectorAll("."+this.CSS.settingsButton);Array.from(e).forEach((e=>e.classList.remove(this.CSS.settingsButtonActive))),i.classList.toggle(this.CSS.settingsButtonActive)})),this.api.tooltip.onHover(i,n.title,{placement:"top",hidingDelay:500}),this.data.style===n.name&&i.classList.add(this.CSS.settingsButtonActive),t.appendChild(i)})),t}appendItems(e,t){e.forEach((e=>{const n=this.createItem(e.content,e.items,e.checked);t.appendChild(n)}))}createItem(t,n=[],i){const s=e("li",this.CSS.item),r=e("div",this.CSS.itemBody),o=e("div",this.CSS.itemCheckedContentWrapper),a=e("div",this.CSS.itemChecked);!0===i&&a.classList.add("itemChecked_true"),!1===i&&a.classList.add("itemChecked_false"),null==i&&a.classList.add("itemChecked_null"),a.addEventListener("click",(e=>{if(!this.readOnly){if(a.classList.contains("itemChecked_true"))return a.classList.remove("itemChecked_true"),void a.classList.add("itemChecked_false");if(a.classList.contains("itemChecked_false"))return a.classList.remove("itemChecked_false"),void a.classList.add("itemChecked_null");if(a.classList.contains("itemChecked_null"))return a.classList.remove("itemChecked_null"),a.classList.remove("itemChecked_null_hover"),void a.classList.add("itemChecked_true")}})),a.addEventListener("mouseenter",(e=>{this.readOnly||a.classList.contains("itemChecked_null")&&a.classList.add("itemChecked_null_hover")})),a.addEventListener("mouseleave",(e=>{this.readOnly||a.classList.remove("itemChecked_null_hover")}));const d=e("div",this.CSS.itemContent,{innerHTML:t,contentEditable:!this.readOnly});return o.appendChild(a),o.appendChild(d),r.appendChild(o),s.appendChild(r),n&&n.length>0&&this.addChildrenList(s,n),s}save(){const e=t=>Array.from(t.querySelectorAll(`:scope > .${this.CSS.item}`)).map((t=>{const n=t.querySelector(`.${this.CSS.itemChildren}`),i=this.getItemContent(t),s=t.querySelector(`.${this.CSS.itemChecked}`);let r;return s.classList.contains("itemChecked_true")&&(r=!0),s.classList.contains("itemChecked_false")&&(r=!1),s.classList.contains("itemChecked_null")&&(r=null),{content:i,checked:r,items:n?e(n):[]}}));return{style:this.data.style,items:e(this.nodes.wrapper)}}addChildrenList(e,t){const n=e.querySelector(`.${this.CSS.itemBody}`),i=this.makeListWrapper(void 0,[this.CSS.itemChildren]);this.appendItems(t,i),n.appendChild(i)}makeListWrapper(t=this.listStyle,n=[]){return"unordered"==t&&n.push(this.CSS.wrapperUnordered),"ordered"==t&&n.push(this.CSS.wrapperOrdered),"none"==t&&n.push(this.CSS.wrapperNone),e("ul",[this.CSS.wrapper,...n])}get CSS(){return{baseBlock:this.api.styles.block,wrapper:"cdx-nested-list",wrapperOrdered:"cdx-nested-list--ordered",wrapperUnordered:"cdx-nested-list--unordered",wrapperNone:"cdx-nested-list--none",item:"cdx-nested-list__item",itemBody:"cdx-nested-list__item-body",itemCheckedContentWrapper:"cdx-nested-list__item-checkedContentWrapper",itemContent:"cdx-nested-list__item-content",itemChecked:"cdx-nested-list__item-checked",itemCheckedIndicator:"cdx-nested-list__item-checkedIndicator",itemChildren:"cdx-nested-list__item-children",settingsWrapper:"cdx-nested-list__settings",settingsButton:this.api.styles.settingsButton,settingsButtonActive:this.api.styles.settingsButtonActive}}get listStyle(){return this.data.style||this.defaultListStyle}set listStyle(e){const t=Array.from(this.nodes.wrapper.querySelectorAll(`.${this.CSS.wrapper}`));t.push(this.nodes.wrapper),t.forEach((t=>{t.classList.remove(this.CSS.wrapperUnordered,this.CSS.wrapperOrdered,this.CSS.wrapperNone),"unordered"==e&&t.classList.add(this.CSS.wrapperUnordered),"ordered"==e&&t.classList.add(this.CSS.wrapperOrdered),"none"==e&&t.classList.add(this.CSS.wrapperNone)})),this.data.style=e}get currentItem(){let e=window.getSelection().anchorNode;return e.nodeType!==Node.ELEMENT_NODE&&(e=e.parentNode),e.closest(`.${this.CSS.item}`)}enterPressed(e){const n=this.currentItem;e.stopPropagation(),e.preventDefault();const i=0===this.getItemContent(n).trim().length,s=n.parentNode===this.nodes.wrapper,o=null===n.nextElementSibling;if(s&&o&&i)return void this.getOutOfList();if(o&&i)return void this.unshiftItem();const a=t(r.extractFragmentFromCaretPositionTillTheEnd()),d=n.querySelector(`.${this.CSS.itemChildren}`),c=this.createItem(a,void 0);d&&Array.from(d.querySelectorAll(`.${this.CSS.item}`)).length>0?d.prepend(c):n.after(c),this.focusItem(c)}unshiftItem(){const e=this.currentItem,t=e.parentNode.closest(`.${this.CSS.item}`);if(!t)return;this.caret.save(),t.after(e),this.caret.restore();const n=t.querySelector(`.${this.CSS.itemChildren}`);0===n.children.length&&n.remove()}getItemContent(e){const t=e.querySelector(`.${this.CSS.itemContent}`);return s(t)?"":t.innerHTML}focusItem(e,t=!0){const n=e.querySelector(`.${this.CSS.itemContent}`);r.focus(n,t)}getOutOfList(){this.currentItem.remove(),this.api.blocks.insert(),this.api.caret.setToBlock(this.api.blocks.getCurrentBlockIndex())}backspace(e){if(!r.isAtStart())return;e.preventDefault();const n=this.currentItem,i=n.previousSibling,s=n.parentNode.closest(`.${this.CSS.item}`);if(!i&&!s)return;let o;if(e.stopPropagation(),i){const e=i.querySelectorAll(`.${this.CSS.item}`);o=Array.from(e).pop()||i}else o=s;const a=t(r.extractFragmentFromCaretPositionTillTheEnd()),d=o.querySelector(`.${this.CSS.itemContent}`);r.focus(d,!1),this.caret.save(),d.insertAdjacentHTML("beforeend",a);let c=n.querySelectorAll(`.${this.CSS.itemChildren} > .${this.CSS.item}`);c=Array.from(c),c=c.filter((e=>e.parentNode.closest(`.${this.CSS.item}`)===n)),c.reverse().forEach((e=>{i?o.after(e):n.after(e)})),n.remove(),this.caret.restore()}addTab(e){e.stopPropagation(),e.preventDefault();const t=this.currentItem,n=t.previousSibling;if(!n)return;const i=n.querySelector(`.${this.CSS.itemChildren}`);if(this.caret.save(),i)i.appendChild(t);else{const e=this.makeListWrapper(void 0,[this.CSS.itemChildren]),i=n.querySelector(`.${this.CSS.itemBody}`);e.appendChild(t),i.appendChild(e)}this.caret.restore()}shiftTab(e){e.stopPropagation(),e.preventDefault(),this.unshiftItem()}static joinRecursive(e){return e.items.map((e=>`${e.content} ${h.joinRecursive(e)}`)).join("")}static get conversionConfig(){return{export:e=>h.joinRecursive(e),import:e=>({items:[{content:e,items:[]}],style:"unordered"})}}static get toolbox(){return{icon:l(),title:"Nested Checklist"}}}})(),i.default})()})); \ No newline at end of file diff --git a/httpdocs/themes/vuexy/js/editorjs/table.js b/httpdocs/themes/vuexy/js/editorjs/table.js new file mode 100644 index 00000000..155baf59 --- /dev/null +++ b/httpdocs/themes/vuexy/js/editorjs/table.js @@ -0,0 +1,8 @@ +/** + * Skipped minification because the original files appears to be already minified. + * Original file: /npm/@editorjs/table@2.4.3/dist/table.umd.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +(function(){var r;"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.nonce=(r=document.head.querySelector("meta[property=csp-nonce]"))==null?void 0:r.content,o.appendChild(document.createTextNode('.tc-wrap{--color-background:#f9f9fb;--color-text-secondary:#7b7e89;--color-border:#e8e8eb;--cell-size:34px;--toolbox-icon-size:18px;--toolbox-padding:6px;--toolbox-aiming-field-size:calc(var(--toolbox-icon-size) + var(--toolbox-padding)*2);border-left:0;position:relative;height:100%;width:100%;margin-top:var(--toolbox-icon-size);box-sizing:border-box;display:grid;grid-template-columns:calc(100% - var(--cell-size)) var(--cell-size)}.tc-wrap--readonly{grid-template-columns:100% var(--cell-size)}.tc-wrap svg{vertical-align:top}@media print{.tc-wrap{border-left-color:var(--color-border);border-left-style:solid;border-left-width:1px;grid-template-columns:100% var(--cell-size)}}@media print{.tc-wrap .tc-row:after{display:none}}.tc-table{position:relative;width:100%;height:100%;display:grid;font-size:14px;border-top:1px solid var(--color-border);line-height:1.4}.tc-table:after{width:calc(var(--cell-size));height:100%;left:calc(var(--cell-size)*-1);top:0}.tc-table:after,.tc-table:before{position:absolute;content:""}.tc-table:before{width:100%;height:var(--toolbox-aiming-field-size);top:calc(var(--toolbox-aiming-field-size)*-1);left:0}.tc-table--heading .tc-row:first-child{font-weight:600;border-bottom:2px solid var(--color-border)}.tc-table--heading .tc-row:first-child [contenteditable]:empty:before{content:attr(heading);color:var(--color-text-secondary)}.tc-table--heading .tc-row:first-child:after{bottom:-2px;border-bottom:2px solid var(--color-border)}.tc-add-column,.tc-add-row{display:flex;color:var(--color-text-secondary)}@media print{.tc-add{display:none}}.tc-add-column{padding:4px 0;justify-content:center;border-top:1px solid var(--color-border)}.tc-add-column--disabled{visibility:hidden}@media print{.tc-add-column{display:none}}.tc-add-row{height:var(--cell-size);align-items:center;padding-left:4px;position:relative}.tc-add-row--disabled{display:none}.tc-add-row:before{content:"";position:absolute;right:calc(var(--cell-size)*-1);width:var(--cell-size);height:100%}@media print{.tc-add-row{display:none}}.tc-add-column,.tc-add-row{transition:0s;cursor:pointer;will-change:background-color}.tc-add-column:hover,.tc-add-row:hover{transition:background-color .1s ease;background-color:var(--color-background)}.tc-add-row{margin-top:1px}.tc-add-row:hover:before{transition:.1s;background-color:var(--color-background)}.tc-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(10px,1fr));position:relative;border-bottom:1px solid var(--color-border)}.tc-row:after{content:"";pointer-events:none;position:absolute;width:var(--cell-size);height:100%;bottom:-1px;right:calc(var(--cell-size)*-1);border-bottom:1px solid var(--color-border)}.tc-row--selected{background:var(--color-background)}.tc-row--selected:after{background:var(--color-background)}.tc-cell{border-right:1px solid var(--color-border);padding:6px 12px;overflow:hidden;outline:none;line-break:normal}.tc-cell--selected{background:var(--color-background)}.tc-wrap--readonly .tc-row:after{display:none}.tc-toolbox{--toolbox-padding:6px;--popover-margin:30px;--toggler-click-zone-size:30px;--toggler-dots-color:#7b7e89;--toggler-dots-color-hovered:#1d202b;position:absolute;cursor:pointer;z-index:1;opacity:0;transition:opacity .1s;will-change:left,opacity}.tc-toolbox--column{top:calc(var(--toggler-click-zone-size)*-1);transform:translate(calc(var(--toggler-click-zone-size)*-1/2));will-change:left,opacity}.tc-toolbox--row{left:calc(var(--popover-margin)*-1);transform:translateY(calc(var(--toggler-click-zone-size)*-1/2));margin-top:-1px;will-change:top,opacity}.tc-toolbox--showed{opacity:1}.tc-toolbox .tc-popover{position:absolute;top:0;left:var(--popover-margin)}.tc-toolbox__toggler{display:flex;align-items:center;justify-content:center;width:var(--toggler-click-zone-size);height:var(--toggler-click-zone-size);color:var(--toggler-dots-color);opacity:0;transition:opacity .15s ease;will-change:opacity}.tc-toolbox__toggler:hover{color:var(--toggler-dots-color-hovered)}.tc-toolbox__toggler svg{fill:currentColor}.tc-wrap:hover .tc-toolbox__toggler{opacity:1}.tc-settings .cdx-settings-button{width:50%;margin:0}.tc-popover{--color-border:#eaeaea;--color-background:#fff;--color-background-hover:rgba(232,232,235,.49);--color-background-confirm:#e24a4a;--color-background-confirm-hover:#d54040;--color-text-confirm:#fff;background:var(--color-background);border:1px solid var(--color-border);box-shadow:0 3px 15px -3px #0d142121;border-radius:6px;padding:6px;display:none;will-change:opacity,transform}.tc-popover--opened{display:block;animation:menuShowing .1s cubic-bezier(.215,.61,.355,1) forwards}.tc-popover__item{display:flex;align-items:center;padding:2px 14px 2px 2px;border-radius:5px;cursor:pointer;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;user-select:none}.tc-popover__item:hover{background:var(--color-background-hover)}.tc-popover__item:not(:last-of-type){margin-bottom:2px}.tc-popover__item-icon{display:inline-flex;width:26px;height:26px;align-items:center;justify-content:center;background:var(--color-background);border-radius:5px;border:1px solid var(--color-border);margin-right:8px}.tc-popover__item-label{line-height:22px;font-size:14px;font-weight:500}.tc-popover__item--confirm{background:var(--color-background-confirm);color:var(--color-text-confirm)}.tc-popover__item--confirm:hover{background-color:var(--color-background-confirm-hover)}.tc-popover__item--confirm .tc-popover__item-icon{background:var(--color-background-confirm);border-color:#0000001a}.tc-popover__item--confirm .tc-popover__item-icon svg{transition:transform .2s ease-in;transform:rotate(90deg) scale(1.2)}.tc-popover__item--hidden{display:none}@keyframes menuShowing{0%{opacity:0;transform:translateY(-8px) scale(.9)}70%{opacity:1;transform:translateY(2px)}to{transform:translateY(0)}}')),document.head.appendChild(o)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})(); +(function(d,p){typeof exports=="object"&&typeof module<"u"?module.exports=p():typeof define=="function"&&define.amd?define(p):(d=typeof globalThis<"u"?globalThis:d||self,d.Table=p())})(this,function(){"use strict";function d(a,t,e={}){const o=document.createElement(a);Array.isArray(t)?o.classList.add(...t):t&&o.classList.add(t);for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(o[i]=e[i]);return o}function p(a){const t=a.getBoundingClientRect();return{y1:Math.floor(t.top+window.pageYOffset),x1:Math.floor(t.left+window.pageXOffset),x2:Math.floor(t.right+window.pageXOffset),y2:Math.floor(t.bottom+window.pageYOffset)}}function g(a,t){const e=p(a),o=p(t);return{fromTopBorder:o.y1-e.y1,fromLeftBorder:o.x1-e.x1,fromRightBorder:e.x2-o.x2,fromBottomBorder:e.y2-o.y2}}function k(a,t){const e=a.getBoundingClientRect(),{width:o,height:i,x:n,y:r}=e,{clientX:h,clientY:l}=t;return{width:o,height:i,x:h-n,y:l-r}}function m(a,t){return t.parentNode.insertBefore(a,t)}function C(a,t=!0){const e=document.createRange(),o=window.getSelection();e.selectNodeContents(a),e.collapse(t),o.removeAllRanges(),o.addRange(e)}class c{constructor({items:t}){this.items=t,this.wrapper=void 0,this.itemEls=[]}static get CSS(){return{popover:"tc-popover",popoverOpened:"tc-popover--opened",item:"tc-popover__item",itemHidden:"tc-popover__item--hidden",itemConfirmState:"tc-popover__item--confirm",itemIcon:"tc-popover__item-icon",itemLabel:"tc-popover__item-label"}}render(){return this.wrapper=d("div",c.CSS.popover),this.items.forEach((t,e)=>{const o=d("div",c.CSS.item),i=d("div",c.CSS.itemIcon,{innerHTML:t.icon}),n=d("div",c.CSS.itemLabel,{textContent:t.label});o.dataset.index=e,o.appendChild(i),o.appendChild(n),this.wrapper.appendChild(o),this.itemEls.push(o)}),this.wrapper.addEventListener("click",t=>{this.popoverClicked(t)}),this.wrapper}popoverClicked(t){const e=t.target.closest(`.${c.CSS.item}`);if(!e)return;const o=e.dataset.index,i=this.items[o];if(i.confirmationRequired&&!this.hasConfirmationState(e)){this.setConfirmationState(e);return}i.onClick()}setConfirmationState(t){t.classList.add(c.CSS.itemConfirmState)}clearConfirmationState(t){t.classList.remove(c.CSS.itemConfirmState)}hasConfirmationState(t){return t.classList.contains(c.CSS.itemConfirmState)}get opened(){return this.wrapper.classList.contains(c.CSS.popoverOpened)}open(){this.items.forEach((t,e)=>{typeof t.hideIf=="function"&&this.itemEls[e].classList.toggle(c.CSS.itemHidden,t.hideIf())}),this.wrapper.classList.add(c.CSS.popoverOpened)}close(){this.wrapper.classList.remove(c.CSS.popoverOpened),this.itemEls.forEach(t=>{this.clearConfirmationState(t)})}}const R='',b='',x='',S='',y='',L='',M='',v='',O='',T='',H='',A='';class w{constructor({api:t,items:e,onOpen:o,onClose:i,cssModifier:n=""}){this.api=t,this.items=e,this.onOpen=o,this.onClose=i,this.cssModifier=n,this.popover=null,this.wrapper=this.createToolbox()}static get CSS(){return{toolbox:"tc-toolbox",toolboxShowed:"tc-toolbox--showed",toggler:"tc-toolbox__toggler"}}get element(){return this.wrapper}createToolbox(){const t=d("div",[w.CSS.toolbox,this.cssModifier?`${w.CSS.toolbox}--${this.cssModifier}`:""]);t.dataset.mutationFree="true";const e=this.createPopover(),o=this.createToggler();return t.appendChild(o),t.appendChild(e),t}createToggler(){const t=d("div",w.CSS.toggler,{innerHTML:M});return t.addEventListener("click",()=>{this.togglerClicked()}),t}createPopover(){return this.popover=new c({items:this.items}),this.popover.render()}togglerClicked(){this.popover.opened?(this.popover.close(),this.onClose()):(this.popover.open(),this.onOpen())}show(t){const e=t();Object.entries(e).forEach(([o,i])=>{this.wrapper.style[o]=i}),this.wrapper.classList.add(w.CSS.toolboxShowed)}hide(){this.popover.close(),this.wrapper.classList.remove(w.CSS.toolboxShowed)}}function B(a,t){let e=0;return function(...o){const i=new Date().getTime();if(!(i-e{const r=n.target.closest(`.${s.table}`)!==null,h=n.target.closest(`.${s.wrapper}`)===null;(r||h)&&this.hideToolboxes();const u=n.target.closest(`.${s.addRow}`),f=n.target.closest(`.${s.addColumn}`);u&&u.parentNode===this.wrapper?(this.addRow(void 0,!0),this.hideToolboxes()):f&&f.parentNode===this.wrapper&&(this.addColumn(void 0,!0),this.hideToolboxes())},this.readOnly||this.bindEvents()}getWrapper(){return this.wrapper}bindEvents(){document.addEventListener("click",this.documentClicked),this.table.addEventListener("mousemove",B(150,t=>this.onMouseMoveInTable(t)),{passive:!0}),this.table.onkeypress=t=>this.onKeyPressListener(t),this.table.addEventListener("keydown",t=>this.onKeyDownListener(t)),this.table.addEventListener("focusin",t=>this.focusInTableListener(t))}createColumnToolbox(){return new w({api:this.api,cssModifier:"column",items:[{label:this.api.i18n.t("Add column to left"),icon:S,hideIf:()=>this.numberOfColumns===this.config.maxcols,onClick:()=>{this.addColumn(this.selectedColumn,!0),this.hideToolboxes()}},{label:this.api.i18n.t("Add column to right"),icon:y,hideIf:()=>this.numberOfColumns===this.config.maxcols,onClick:()=>{this.addColumn(this.selectedColumn+1,!0),this.hideToolboxes()}},{label:this.api.i18n.t("Delete column"),icon:b,hideIf:()=>this.numberOfColumns===1,confirmationRequired:!0,onClick:()=>{this.deleteColumn(this.selectedColumn),this.hideToolboxes()}}],onOpen:()=>{this.selectColumn(this.hoveredColumn),this.hideRowToolbox()},onClose:()=>{this.unselectColumn()}})}createRowToolbox(){return new w({api:this.api,cssModifier:"row",items:[{label:this.api.i18n.t("Add row above"),icon:L,hideIf:()=>this.numberOfRows===this.config.maxrows,onClick:()=>{this.addRow(this.selectedRow,!0),this.hideToolboxes()}},{label:this.api.i18n.t("Add row below"),icon:x,hideIf:()=>this.numberOfRows===this.config.maxrows,onClick:()=>{this.addRow(this.selectedRow+1,!0),this.hideToolboxes()}},{label:this.api.i18n.t("Delete row"),icon:b,hideIf:()=>this.numberOfRows===1,confirmationRequired:!0,onClick:()=>{this.deleteRow(this.selectedRow),this.hideToolboxes()}}],onOpen:()=>{this.selectRow(this.hoveredRow),this.hideColumnToolbox()},onClose:()=>{this.unselectRow()}})}moveCursorToNextRow(){this.focusedCell.row!==this.numberOfRows?(this.focusedCell.row+=1,this.focusCell(this.focusedCell)):(this.addRow(),this.focusedCell.row+=1,this.focusCell(this.focusedCell),this.updateToolboxesPosition(0,0))}getCell(t,e){return this.table.querySelectorAll(`.${s.row}:nth-child(${t}) .${s.cell}`)[e-1]}getRow(t){return this.table.querySelector(`.${s.row}:nth-child(${t})`)}getRowByCell(t){return t.parentElement}getRowFirstCell(t){return t.querySelector(`.${s.cell}:first-child`)}setCellContent(t,e,o){const i=this.getCell(t,e);i.innerHTML=o}addColumn(t=-1,e=!1){var n;let o=this.numberOfColumns;if(this.config&&this.config.maxcols&&this.numberOfColumns>=this.config.maxcols)return;for(let r=1;r<=this.numberOfRows;r++){let h;const l=this.createCell();if(t>0&&t<=o?(h=this.getCell(r,t),m(l,h)):h=this.getRow(r).appendChild(l),r===1){const u=this.getCell(r,t>0?t:o+1);u&&e&&C(u)}}const i=this.wrapper.querySelector(`.${s.addColumn}`);(n=this.config)!=null&&n.maxcols&&this.numberOfColumns>this.config.maxcols-1&&i&&i.classList.add(s.addColumnDisabled),this.addHeadingAttrToFirstRow()}addRow(t=-1,e=!1){let o,i=d("div",s.row);this.tunes.withHeadings&&this.removeHeadingAttrFromFirstRow();let n=this.numberOfColumns;if(this.config&&this.config.maxrows&&this.numberOfRows>=this.config.maxrows&&h)return;if(t>0&&t<=this.numberOfRows){let l=this.getRow(t);o=m(i,l)}else o=this.table.appendChild(i);this.fillRow(o,n),this.tunes.withHeadings&&this.addHeadingAttrToFirstRow();const r=this.getRowFirstCell(o);r&&e&&C(r);const h=this.wrapper.querySelector(`.${s.addRow}`);return this.config&&this.config.maxrows&&this.numberOfRows>=this.config.maxrows&&h&&h.classList.add(s.addRowDisabled),o}deleteColumn(t){for(let o=1;o<=this.numberOfRows;o++){const i=this.getCell(o,t);if(!i)return;i.remove()}const e=this.wrapper.querySelector(`.${s.addColumn}`);e&&e.classList.remove(s.addColumnDisabled)}deleteRow(t){this.getRow(t).remove();const e=this.wrapper.querySelector(`.${s.addRow}`);e&&e.classList.remove(s.addRowDisabled),this.addHeadingAttrToFirstRow()}createTableWrapper(){if(this.wrapper=d("div",s.wrapper),this.table=d("div",s.table),this.readOnly&&this.wrapper.classList.add(s.wrapperReadOnly),this.wrapper.appendChild(this.toolboxRow.element),this.wrapper.appendChild(this.toolboxColumn.element),this.wrapper.appendChild(this.table),!this.readOnly){const t=d("div",s.addColumn,{innerHTML:v}),e=d("div",s.addRow,{innerHTML:v});this.wrapper.appendChild(t),this.wrapper.appendChild(e)}}computeInitialSize(){const t=this.data&&this.data.content,e=Array.isArray(t),o=e?t.length:!1,i=e?t.length:void 0,n=o?t[0].length:void 0,r=Number.parseInt(this.config&&this.config.rows),h=Number.parseInt(this.config&&this.config.cols),l=!isNaN(r)&&r>0?r:void 0,u=!isNaN(h)&&h>0?h:void 0;return{rows:i||l||2,cols:n||u||2}}resize(){const{rows:t,cols:e}=this.computeInitialSize();for(let o=0;o0&&e<=this.numberOfColumns&&this.toolboxColumn.show(()=>({left:`calc((100% - var(--cell-size)) / (${this.numberOfColumns} * 2) * (1 + (${e} - 1) * 2))`})),this.isRowMenuShowing||t>0&&t<=this.numberOfRows&&this.toolboxRow.show(()=>{const o=this.getRow(t),{fromTopBorder:i}=g(this.table,o),{height:n}=o.getBoundingClientRect();return{top:`${Math.ceil(i+n/2)}px`}})}setHeadingsSetting(t){this.tunes.withHeadings=t,t?(this.table.classList.add(s.withHeadings),this.addHeadingAttrToFirstRow()):(this.table.classList.remove(s.withHeadings),this.removeHeadingAttrFromFirstRow())}addHeadingAttrToFirstRow(){for(let t=1;t<=this.numberOfColumns;t++){let e=this.getCell(1,t);e&&e.setAttribute("heading",this.api.i18n.t("Heading"))}}removeHeadingAttrFromFirstRow(){for(let t=1;t<=this.numberOfColumns;t++){let e=this.getCell(1,t);e&&e.removeAttribute("heading")}}selectRow(t){const e=this.getRow(t);e&&(this.selectedRow=t,e.classList.add(s.rowSelected))}unselectRow(){if(this.selectedRow<=0)return;const t=this.table.querySelector(`.${s.rowSelected}`);t&&t.classList.remove(s.rowSelected),this.selectedRow=0}selectColumn(t){for(let e=1;e<=this.numberOfRows;e++){const o=this.getCell(e,t);o&&o.classList.add(s.cellSelected)}this.selectedColumn=t}unselectColumn(){if(this.selectedColumn<=0)return;let t=this.table.querySelectorAll(`.${s.cellSelected}`);Array.from(t).forEach(e=>{e.classList.remove(s.cellSelected)}),this.selectedColumn=0}getHoveredCell(t){let e=this.hoveredRow,o=this.hoveredColumn;const{width:i,height:n,x:r,y:h}=k(this.table,t);return r>=0&&(o=this.binSearch(this.numberOfColumns,l=>this.getCell(1,l),({fromLeftBorder:l})=>rr>i-l)),h>=0&&(e=this.binSearch(this.numberOfRows,l=>this.getCell(l,1),({fromTopBorder:l})=>hh>n-l)),{row:e||this.hoveredRow,column:o||this.hoveredColumn}}binSearch(t,e,o,i){let n=0,r=t+1,h=0,l;for(;n!r.textContent.trim())||t.push(i.map(r=>r.innerHTML))}return t}destroy(){document.removeEventListener("click",this.documentClicked)}}class ${static get isReadOnlySupported(){return!0}static get enableLineBreaks(){return!0}constructor({data:t,config:e,api:o,readOnly:i,block:n}){this.api=o,this.readOnly=i,this.config=e,this.data={withHeadings:this.getConfig("withHeadings",!1,t),stretched:this.getConfig("stretched",!1,t),content:t&&t.content?t.content:[]},this.table=null,this.block=n}static get toolbox(){return{icon:A,title:"Table"}}render(){return this.table=new E(this.readOnly,this.api,this.data,this.config),this.container=d("div",this.api.styles.block),this.container.appendChild(this.table.getWrapper()),this.table.setHeadingsSetting(this.data.withHeadings),this.container}renderSettings(){return[{label:this.api.i18n.t("With headings"),icon:T,isActive:this.data.withHeadings,closeOnActivate:!0,toggle:!0,onActivate:()=>{this.data.withHeadings=!0,this.table.setHeadingsSetting(this.data.withHeadings)}},{label:this.api.i18n.t("Without headings"),icon:H,isActive:!this.data.withHeadings,closeOnActivate:!0,toggle:!0,onActivate:()=>{this.data.withHeadings=!1,this.table.setHeadingsSetting(this.data.withHeadings)}},{label:this.data.stretched?this.api.i18n.t("Collapse"):this.api.i18n.t("Stretch"),icon:this.data.stretched?R:O,closeOnActivate:!0,toggle:!0,onActivate:()=>{this.data.stretched=!this.data.stretched,this.block.stretched=this.data.stretched}}]}save(){const t=this.table.getData();return{withHeadings:this.data.withHeadings,stretched:this.data.stretched,content:t}}destroy(){this.table.destroy()}getConfig(t,e=void 0,o=void 0){const i=this.data||o;return i?i[t]?i[t]:e:this.config&&this.config[t]?this.config[t]:e}static get pasteConfig(){return{tags:["TABLE","TR","TH","TD"]}}onPaste(t){const e=t.detail.data,o=e.querySelector(":scope > thead, tr:first-of-type th"),n=Array.from(e.querySelectorAll("tr")).map(r=>Array.from(r.querySelectorAll("th, td")).map(l=>l.innerHTML));this.data={withHeadings:o!==null,content:n},this.table.wrapper&&this.table.wrapper.replaceWith(this.render())}}const I="";return $}); diff --git a/httpdocs/themes/vuexy/js/editorjs/tune.js b/httpdocs/themes/vuexy/js/editorjs/tune.js new file mode 100644 index 00000000..8a1c12ec --- /dev/null +++ b/httpdocs/themes/vuexy/js/editorjs/tune.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.AlignmentBlockTune=e():t.AlignmentBlockTune=e()}(self,(function(){return function(){var t={966:function(t,e,n){function r(t,e){for(var n=0;n'},{name:"center",icon:''},{name:"right",icon:''}],this._CSS={alignment:{left:"ce-tune-alignment--left",center:"ce-tune-alignment--center",right:"ce-tune-alignment--right"}}}var e,n,a;return e=t,a=[{key:"DEFAULT_ALIGNMENT",get:function(){return"left"}},{key:"isTune",get:function(){return!0}}],(n=[{key:"getAlignment",value:function(){var e,n;return null!==(e=this.settings)&&void 0!==e&&e.blocks&&this.settings.blocks.hasOwnProperty(this.block.name)?this.settings.blocks[this.block.name]:null!==(n=this.settings)&&void 0!==n&&n.default?this.settings.default:t.DEFAULT_ALIGNMENT}},{key:"wrap",value:function(t){return this.wrapper=i("div"),this.wrapper.classList.toggle(this._CSS.alignment[this.data.alignment]),this.wrapper.append(t),this.wrapper}},{key:"render",value:function(){var t=this,e=i("div");return this.alignmentSettings.map((function(n){var r=document.createElement("button");return r.classList.add(t.api.styles.settingsButton),r.innerHTML=n.icon,r.type="button",r.classList.toggle(t.api.styles.settingsButtonActive,n.name===t.data.alignment),e.appendChild(r),r})).forEach((function(e,n,r){e.addEventListener("click",(function(){t.data={alignment:t.alignmentSettings[n].name},r.forEach((function(e,n){var r=t.alignmentSettings[n].name;e.classList.toggle(t.api.styles.settingsButtonActive,r===t.data.alignment),t.wrapper.classList.toggle(t._CSS.alignment[r],r===t.data.alignment)}))}))})),e}},{key:"save",value:function(){return this.data}}])&&r(e.prototype,n),a&&r(e,a),t}();t.exports=a},630:function(t,e,n){"use strict";function r(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return i(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)?i(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=document.createElement(t);for(var o in Array.isArray(n)?(e=a.classList).add.apply(e,r(n)):n&&a.classList.add(n),i)a[o]=i[o];return a}n.r(e),n.d(e,{make:function(){return a}})},424:function(t,e,n){"use strict";var r=n(645),i=n.n(r)()((function(t){return t[1]}));i.push([t.id,".ce-tune-alignment--right {\n text-align: right;\n}\n.ce-tune-alignment--center {\n text-align: center;\n}\n.ce-tune-alignment--left {\n text-align: left;\n}",""]),e.Z=i},645:function(t){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=t(e);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},e.i=function(t,n,r){"string"==typeof t&&(t=[[null,t,""]]);var i={};if(r)for(var a=0;a