diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..c82b426 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 4 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +trim_trailing_whitespace = false + +[*.{yml,yaml}] +indent_size = 2 \ No newline at end of file diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..e7875d1 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,17 @@ +# Ignore all test and documentation with "export-ignore". +/.github export-ignore +/.gitattributes export-ignore +/.gitignore export-ignore +/phpunit.xml.dist export-ignore +/art export-ignore +/docs export-ignore +/tests export-ignore +/workbench export-ignore +/.editorconfig export-ignore +/.php_cs.dist.php export-ignore +/psalm.xml export-ignore +/psalm.xml.dist export-ignore +/testbench.yaml export-ignore +/UPGRADING.md export-ignore +/phpstan.neon.dist export-ignore +/phpstan-baseline.neon export-ignore \ No newline at end of file diff --git a/.gitignore b/.gitignore index 21739ce..a8bac1c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,9 @@ -/vendor -/node_modules -composer.phar -composer.lock \ No newline at end of file +.idea +.phpunit.cache +build +composer.lock +coverage +docs +phpstan.neon +vendor +node_modules \ No newline at end of file diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..d144a6d --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,5 @@ +{ + "plugins": ["prettier-plugin-tailwindcss"], + "bracketSameLine": false, + "htmlWhitespaceSensitivity": "ignore" +} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ab7577f..0000000 --- a/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: php - -sudo: true - -php: - - 7.0 - - 7.1 - - 7.2 - -services: - - sqlite - -install: travis_retry composer install --no-interaction --prefer-dist --no-suggest - -script: - - vendor/bin/phpunit --verbose \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..7805b9b --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,6 @@ +# Release Notes + +## [v2.0.0](https://github.com/antoniputra/ngeblog/compare/v11.0.5...v11.0.6) - 2024-04-11 + +* Fix PHPUnit constraint by [@szepeviktor](https://github.com/szepeviktor) in https://github.com/laravel/laravel/pull/6389 +* [11.x] Add missing roundrobin transport driver config by [@u01jmg3](https://github.com/u01jmg3) in https://github.com/laravel/laravel/pull/6392 \ No newline at end of file diff --git a/LICENSE b/LICENSE index d7695c1..cb3a007 100644 --- a/LICENSE +++ b/LICENSE @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +SOFTWARE. \ No newline at end of file diff --git a/publishable/assets/img/logo.png b/art/logo.png similarity index 100% rename from publishable/assets/img/logo.png rename to art/logo.png diff --git a/composer.json b/composer.json index 09b59cf..1a15fa3 100644 --- a/composer.json +++ b/composer.json @@ -1,50 +1,84 @@ { "name": "antoniputra/ngeblog", - "description": "Quickstart Blogging for Laravel application.", - "keywords": [ - "laravel", - "blog" - ], + "description": "Quickstart Blogging for your brand-new or existing Laravel App.", + "keywords": ["laravel", "blog", "vue", "spa"], + "type": "library", + "homepage": "https://github.com/antoniputra/ngeblog", "license": "MIT", + "support": { + "issues": "https://github.com/antoniputra/ngeblog/issues", + "source": "https://github.com/antoniputra/ngeblog" + }, "authors": [ { - "name": "Antoni Putra", + "name": "antoniputra", "email": "akiddcode@gmail.com" } ], "require": { - "php": ">=7.0.0", - "illuminate/support": "~5.5", - "laravelcollective/html": "^5.5", - "erusev/parsedown": "^1.6" + "php": "^8.2", + "illuminate/support": "^11.0" }, "require-dev": { - "mockery/mockery": "0.9.*", - "orchestra/testbench": "~3.5", - "orchestra/database": "~3.5", - "orchestra/testbench-browser-kit": "~3.5", - "phpunit/phpunit": "~6.0", - "laravel/browser-kit-testing": "^2.0" + "laravel/pint": "^1.15", + "orchestra/testbench": "^9.0", + "pestphp/pest": "^2.34", + "phpstan/phpstan": "^1.10" }, "autoload": { "psr-4": { - "Antoniputra\\Ngeblog\\": "src/" + "AntoniPutra\\Ngeblog\\": "src/" } }, "autoload-dev": { "psr-4": { - "Antoniputra\\Ngeblog\\Tests\\": "tests/" + "AntoniPutra\\Ngeblog\\Tests\\": "tests/", + "Workbench\\App\\": "workbench/app/", + "Workbench\\Database\\Factories\\": "workbench/database/factories/", + "Workbench\\Database\\Seeders\\": "workbench/database/seeders/" } }, - "minimum-stability": "stable", "extra": { "laravel": { "providers": [ - "Antoniputra\\Ngeblog\\NgeblogServiceProvider" + "AntoniPutra\\Ngeblog\\NgeblogServiceProvider" ], "aliases": { - "Ngeblog": "Antoniputra\\Ngeblog\\Facade" + "Ngeblog": "AntoniPutra\\Ngeblog\\Facades\\Ngeblog" } } + }, + "config": { + "sort-packages": true, + "optimize-autoloader": true, + "allow-plugins": { + "pestphp/pest-plugin": true + } + }, + "minimum-stability": "dev", + "prefer-stable": true, + "scripts": { + "post-autoload-dump": [ + "@clear", + "@prepare" + ], + "clear": "@php vendor/bin/testbench package:purge-skeleton --ansi", + "prepare": "@php vendor/bin/testbench package:discover --ansi", + "build": "@php vendor/bin/testbench workbench:build --ansi", + "serve": [ + "npm run build", + "Composer\\Config::disableProcessTimeout", + "@build", + "@php vendor/bin/testbench serve" + ], + "lint": [ + "@php vendor/bin/phpstan analyse" + ], + "test": [ + "@php vendor/bin/pest" + ], + "test-coverage": "vendor/bin/pest --coverage", + "format": "vendor/bin/pint", + "analyse": "vendor/bin/phpstan analyse" } } diff --git a/config/ngeblog.php b/config/ngeblog.php new file mode 100644 index 0000000..d95791b --- /dev/null +++ b/config/ngeblog.php @@ -0,0 +1,59 @@ + env('NGEBLOG_DOMAIN'), + + /* + |-------------------------------------------------------------------------- + | Ngeblog Path + |-------------------------------------------------------------------------- + | + | This is the URI path where Ngeblog will be accessible from. Feel free + | to change this path to anything you like. + | + */ + + 'path' => env('NGEBLOG_PATH', 'ngeblog'), + + /* + |-------------------------------------------------------------------------- + | Ngeblog Route Middleware + |-------------------------------------------------------------------------- + | + | These middleware will get attached onto each Ngeblog route, giving you + | the chance to add your own middleware to this list or change any of + | the existing middleware. Or, you can simply stick with this list. + | + */ + + 'middleware' => [ + 'web', + AdminAuthorization::class + ], + + /* + |-------------------------------------------------------------------------- + | Ngeblog Filesystem Disk + |-------------------------------------------------------------------------- + | + | Here you may specify the default filesystem disk that should be used + | by the Ngeblog to handle Blog Image. + | + */ + + 'disk' => env('NGEBLOG_DISK', 'public'), +]; diff --git a/database/migrations/2024_04_10_000005_create_posts_table.php b/database/migrations/2024_04_10_000005_create_posts_table.php new file mode 100644 index 0000000..9a717cf --- /dev/null +++ b/database/migrations/2024_04_10_000005_create_posts_table.php @@ -0,0 +1,38 @@ +id(); + $table->foreignId('author_id')->nullable(); + $table->string('title'); + $table->string('slug')->unique(); + $table->boolean('is_visible')->default(false); + $table->enum('editor_type', ['markdown', 'richtext'])->default('markdown'); + $table->string('cover_image_path')->nullable(); + $table->timestamp('first_published_at')->nullable(); + $table->timestamp('schedule_publish_at')->nullable(); + $table->text('excerpt')->nullable(); + $table->longText('content'); + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('ngeblog_posts'); + } +}; diff --git a/publishable/database/migrations/2017_10_06_225258_create_ngeblog_categories_table.php b/database/migrations/2024_04_10_000006_create_tags_table.php similarity index 52% rename from publishable/database/migrations/2017_10_06_225258_create_ngeblog_categories_table.php rename to database/migrations/2024_04_10_000006_create_tags_table.php index c00f498..5254afc 100644 --- a/publishable/database/migrations/2017_10_06_225258_create_ngeblog_categories_table.php +++ b/database/migrations/2024_04_10_000006_create_tags_table.php @@ -4,20 +4,18 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -class CreateNgeblogCategoriesTable extends Migration +return new class extends Migration { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { - Schema::create('ngeblog_categories', function (Blueprint $table) { - $table->increments('id'); - $table->integer('user_id')->index()->unsigned(); + Schema::create('ngeblog_tags', function (Blueprint $table) { + $table->id(); $table->string('title'); $table->string('slug')->unique(); + $table->boolean('is_visible')->default(false); $table->text('description')->nullable(); $table->timestamps(); }); @@ -25,11 +23,9 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { - Schema::dropIfExists('ngeblog_categories'); + Schema::dropIfExists('ngeblog_tags'); } -} +}; diff --git a/database/migrations/2024_04_10_000007_create_post_tag_table.php b/database/migrations/2024_04_10_000007_create_post_tag_table.php new file mode 100644 index 0000000..fc7434f --- /dev/null +++ b/database/migrations/2024_04_10_000007_create_post_tag_table.php @@ -0,0 +1,31 @@ +id(); + $table->foreignId('post_id')->constrained('ngeblog_posts')->cascadeOnDelete(); + $table->foreignId('tag_id')->constrained('ngeblog_tags')->cascadeOnDelete(); + $table->timestamps(); + + $table->unique(['post_id', 'tag_id']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('ngeblog_post_tag'); + } +}; diff --git a/dist/resolve-ngeblog-dist/Form-IChnj1V9.js b/dist/resolve-ngeblog-dist/Form-IChnj1V9.js new file mode 100644 index 0000000..4b04b8f --- /dev/null +++ b/dist/resolve-ngeblog-dist/Form-IChnj1V9.js @@ -0,0 +1,670 @@ +import{o as Wf,a as $e,c as Ge,u as El,b as Xn,d as kv,w as Ml,r as Cv,e as Nt,f as Qt,C as Tv,g as xv,h as we,i as Sl,j,F as Ol,t as cn,k as Ev,l as Mv,_ as Yn,m as fn,v as Ia,n as Ll,p as Al,q as Sv,s as Ov,x as Lv,y as Av,z as Nv,S as Dv}from"./ngeblog.js";function le(r){this.content=r}le.prototype={constructor:le,find:function(r){for(var e=0;e>1}};le.from=function(r){if(r instanceof le)return r;var e=[];if(r)for(var t in r)e.push(t,r[t]);return new le(e)};function jf(r,e,t){for(let n=0;;n++){if(n==r.childCount||n==e.childCount)return r.childCount==e.childCount?null:t;let i=r.child(n),a=e.child(n);if(i==a){t+=i.nodeSize;continue}if(!i.sameMarkup(a))return t;if(i.isText&&i.text!=a.text){for(let o=0;i.text[o]==a.text[o];o++)t++;return t}if(i.content.size||a.content.size){let o=jf(i.content,a.content,t+1);if(o!=null)return o}t+=i.nodeSize}}function Gf(r,e,t,n){for(let i=r.childCount,a=e.childCount;;){if(i==0||a==0)return i==a?null:{a:t,b:n};let o=r.child(--i),s=e.child(--a),l=o.nodeSize;if(o==s){t-=l,n-=l;continue}if(!o.sameMarkup(s))return{a:t,b:n};if(o.isText&&o.text!=s.text){let u=0,c=Math.min(o.text.length,s.text.length);for(;ue&&n(l,i+s,a||null,o)!==!1&&l.content.size){let c=s+1;l.nodesBetween(Math.max(0,e-c),Math.min(l.content.size,t-c),n,i+c)}s=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,i){let a="",o=!0;return this.nodesBetween(e,t,(s,l)=>{let u=s.isText?s.text.slice(Math.max(e,l)-l,t-l):s.isLeaf?i?typeof i=="function"?i(s):i:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&u||s.isTextblock)&&n&&(o?o=!1:a+=n),a+=u},0),a}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,i=this.content.slice(),a=0;for(t.isText&&t.sameMarkup(n)&&(i[i.length-1]=t.withText(t.text+n.text),a=1);ae)for(let a=0,o=0;oe&&((ot)&&(s.isText?s=s.cut(Math.max(0,e-o),Math.min(s.text.length,t-o)):s=s.cut(Math.max(0,e-o-1),Math.min(s.content.size,t-o-1))),n.push(s),i+=s.nodeSize),o=l}return new k(n,i)}cutByIndex(e,t){return e==t?k.empty:e==0&&t==this.content.length?this:new k(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let i=this.content.slice(),a=this.size+t.nodeSize-n.nodeSize;return i[e]=t,new k(i,a)}addToStart(e){return new k([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new k(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;tthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,i=0;;n++){let a=this.child(n),o=i+a.nodeSize;if(o>=e)return o==e||t>0?Qn(n+1,o):Qn(n,i);i=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return k.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new k(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return k.empty;let t,n=0;for(let i=0;ithis.type.rank&&(t||(t=e.slice(0,i)),t.push(this),n=!0),t&&t.push(a)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;tn.type.rank-i.type.rank),t}};z.none=[];class Ci extends Error{}class S{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=Jf(this.content,e+this.openStart,t);return n&&new S(n,this.openStart,this.openEnd)}removeBetween(e,t){return new S(Kf(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return S.empty;let n=t.openStart||0,i=t.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new S(k.fromJSON(e,t.content),n,i)}static maxOpen(e,t=!0){let n=0,i=0;for(let a=e.firstChild;a&&!a.isLeaf&&(t||!a.type.spec.isolating);a=a.firstChild)n++;for(let a=e.lastChild;a&&!a.isLeaf&&(t||!a.type.spec.isolating);a=a.lastChild)i++;return new S(e,n,i)}}S.empty=new S(k.empty,0,0);function Kf(r,e,t){let{index:n,offset:i}=r.findIndex(e),a=r.maybeChild(n),{index:o,offset:s}=r.findIndex(t);if(i==e||a.isText){if(s!=t&&!r.child(o).isText)throw new RangeError("Removing non-flat range");return r.cut(0,e).append(r.cut(t))}if(n!=o)throw new RangeError("Removing non-flat range");return r.replaceChild(n,a.copy(Kf(a.content,e-i-1,t-i-1)))}function Jf(r,e,t,n){let{index:i,offset:a}=r.findIndex(e),o=r.maybeChild(i);if(a==e||o.isText)return n&&!n.canReplace(i,i,t)?null:r.cut(0,e).append(t).append(r.cut(e));let s=Jf(o.content,e-a-1,t);return s&&r.replaceChild(i,o.copy(s))}function Iv(r,e,t){if(t.openStart>r.depth)throw new Ci("Inserted content deeper than insertion position");if(r.depth-t.openStart!=e.depth-t.openEnd)throw new Ci("Inconsistent open depths");return Xf(r,e,t,0)}function Xf(r,e,t,n){let i=r.index(n),a=r.node(n);if(i==e.index(n)&&n=0&&r.isText&&r.sameMarkup(e[t])?e[t]=r.withText(e[t].text+r.text):e.push(r)}function Tn(r,e,t,n){let i=(e||r).node(t),a=0,o=e?e.index(t):i.childCount;r&&(a=r.index(t),r.depth>t?a++:r.textOffset&&(lr(r.nodeAfter,n),a++));for(let s=a;si&&To(r,e,i+1),o=n.depth>i&&To(t,n,i+1),s=[];return Tn(null,r,i,s),a&&o&&e.index(i)==t.index(i)?(Yf(a,o),lr(ur(a,Qf(r,e,t,n,i+1)),s)):(a&&lr(ur(a,Ti(r,e,i+1)),s),Tn(e,t,i,s),o&&lr(ur(o,Ti(t,n,i+1)),s)),Tn(n,null,i,s),new k(s)}function Ti(r,e,t){let n=[];if(Tn(null,r,t,n),r.depth>t){let i=To(r,e,t+1);lr(ur(i,Ti(r,e,t+1)),n)}return Tn(e,null,t,n),new k(n)}function Rv(r,e){let t=e.depth-r.openStart,i=e.node(t).copy(r.content);for(let a=t-1;a>=0;a--)i=e.node(a).copy(k.from(i));return{start:i.resolveNoCache(r.openStart+t),end:i.resolveNoCache(i.content.size-r.openEnd-t)}}class Ln{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],i=e.child(t);return n?e.child(t).cut(n):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let a=0;a0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new xi(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],i=0,a=t;for(let o=e;;){let{index:s,offset:l}=o.content.findIndex(a),u=a-l;if(n.push(o,s,i+l),!u||(o=o.child(s),o.isText))break;a=u-1,i+=l+1}return new Ln(t,n,a)}static resolveCached(e,t){for(let i=0;ie&&this.nodesBetween(e,t,a=>(n.isInSet(a.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Zf(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=k.empty,i=0,a=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,i,a),s=o&&o.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let l=i;lt.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let i=k.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,n)}};$t.prototype.text=void 0;class Ei extends $t{constructor(e,t,n,i){if(super(e,t,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Zf(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Ei(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Ei(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Zf(r,e){for(let t=r.length-1;t>=0;t--)e=r[t].type.name+"("+e+")";return e}class hr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new Hv(e,t);if(n.next==null)return hr.empty;let i=ed(n);n.next&&n.err("Unexpected trailing text");let a=Uv(Vv(i));return Wv(a,n),a}matchType(e){for(let t=0;tu.createAndFill()));for(let u=0;u=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let i=0;i{let a=i+(n.validEnd?"*":" ")+" ";for(let o=0;o"+e.indexOf(n.next[o].next);return a}).join(` +`)}}hr.empty=new hr(!0);class Hv{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function ed(r){let e=[];do e.push(Fv(r));while(r.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Fv(r){let e=[];do e.push(qv(r));while(r.next&&r.next!=")"&&r.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function qv(r){let e=zv(r);for(;;)if(r.eat("+"))e={type:"plus",expr:e};else if(r.eat("*"))e={type:"star",expr:e};else if(r.eat("?"))e={type:"opt",expr:e};else if(r.eat("{"))e=_v(r,e);else break;return e}function Nl(r){/\D/.test(r.next)&&r.err("Expected number, got '"+r.next+"'");let e=Number(r.next);return r.pos++,e}function _v(r,e){let t=Nl(r),n=t;return r.eat(",")&&(r.next!="}"?n=Nl(r):n=-1),r.eat("}")||r.err("Unclosed braced range"),{type:"range",min:t,max:n,expr:e}}function $v(r,e){let t=r.nodeTypes,n=t[e];if(n)return[n];let i=[];for(let a in t){let o=t[a];o.groups.indexOf(e)>-1&&i.push(o)}return i.length==0&&r.err("No node type or group '"+e+"' found"),i}function zv(r){if(r.eat("(")){let e=ed(r);return r.eat(")")||r.err("Missing closing paren"),e}else if(/\W/.test(r.next))r.err("Unexpected token '"+r.next+"'");else{let e=$v(r,r.next).map(t=>(r.inline==null?r.inline=t.isInline:r.inline!=t.isInline&&r.err("Mixing inline and block content"),{type:"name",value:t}));return r.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Vv(r){let e=[[]];return i(a(r,0),t()),e;function t(){return e.push([])-1}function n(o,s,l){let u={term:l,to:s};return e[o].push(u),u}function i(o,s){o.forEach(l=>l.to=s)}function a(o,s){if(o.type=="choice")return o.exprs.reduce((l,u)=>l.concat(a(u,s)),[]);if(o.type=="seq")for(let l=0;;l++){let u=a(o.exprs[l],s);if(l==o.exprs.length-1)return u;i(u,s=t())}else if(o.type=="star"){let l=t();return n(s,l),i(a(o.expr,l),l),[n(l)]}else if(o.type=="plus"){let l=t();return i(a(o.expr,s),l),i(a(o.expr,l),l),[n(l)]}else{if(o.type=="opt")return[n(s)].concat(a(o.expr,s));if(o.type=="range"){let l=s;for(let u=0;u{r[o].forEach(({term:s,to:l})=>{if(!s)return;let u;for(let c=0;c{u||i.push([s,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let a=e[n.join(",")]=new hr(n.indexOf(r.length-1)>-1);for(let o=0;o-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;tn[a]=new ad(a,t,o));let i=t.spec.topNode||"doc";if(!n[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let a in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};class jv{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class Qi{constructor(e,t,n,i){this.name=e,this.rank=t,this.schema=n,this.spec=i,this.attrs=id(i.attrs),this.excluded=null;let a=rd(this.attrs);this.instance=a?new z(this,a):null}create(e=null){return!e&&this.instance?this.instance:new z(this,nd(this.attrs,e))}static compile(e,t){let n=Object.create(null),i=0;return e.forEach((a,o)=>n[a]=new Qi(a,i++,t,o)),n}removeFromSet(e){for(var t=0;t-1}}class od{constructor(e){this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=le.from(e.nodes),t.marks=le.from(e.marks||{}),this.nodes=Il.compile(this.spec.nodes,this),this.marks=Qi.compile(this.spec.marks,this);let n=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let a=this.nodes[i],o=a.spec.content||"",s=a.spec.marks;a.contentMatch=n[o]||(n[o]=hr.parse(o,this.nodes)),a.inlineContent=a.contentMatch.inlineContent,a.markSet=s=="_"?null:s?Rl(this,s.split(" ")):s==""||!a.inlineContent?[]:null}for(let i in this.marks){let a=this.marks[i],o=a.spec.excludes;a.excluded=o==null?[a]:o==""?[]:Rl(this,o.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Il){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,n,i)}text(e,t){let n=this.nodes.text;return new Ei(n,n.defaultAttrs,e,z.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return $t.fromJSON(this,e)}markFromJSON(e){return z.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Rl(r,e){let t=[];for(let n=0;n-1)&&t.push(o=l)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[n]+"'")}return t}function Gv(r){return r.tag!=null}function Kv(r){return r.style!=null}class pr{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach(n=>{Gv(n)?this.tags.push(n):Kv(n)&&this.styles.push(n)}),this.normalizeLists=!this.tags.some(n=>{if(!/^(ul|ol)\b/.test(n.tag)||!n.node)return!1;let i=e.nodes[n.node];return i.contentMatch.matchType(i)})}parse(e,t={}){let n=new Pl(this,t,!1);return n.addAll(e,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new Pl(this,t,!0);return n.addAll(e,t.from,t.to),S.maxOpen(n.finish())}matchTag(e,t,n){for(let i=n?this.tags.indexOf(n)+1:0;ie.length&&(s.charCodeAt(e.length)!=61||s.slice(e.length+1)!=t))){if(o.getAttrs){let l=o.getAttrs(t);if(l===!1)continue;o.attrs=l||void 0}return o}}}static schemaRules(e){let t=[];function n(i){let a=i.priority==null?50:i.priority,o=0;for(;o{n(o=Hl(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let a=e.nodes[i].spec.parseDOM;a&&a.forEach(o=>{n(o=Hl(o)),o.node||o.ignore||o.mark||(o.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new pr(e,pr.schemaRules(e)))}}const sd={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Jv={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},ld={ol:!0,ul:!0},Mi=1,Si=2,xn=4;function Bl(r,e,t){return e!=null?(e?Mi:0)|(e==="full"?Si:0):r&&r.whitespace=="pre"?Mi|Si:t&~xn}class Zn{constructor(e,t,n,i,a,o,s){this.type=e,this.attrs=t,this.marks=n,this.pendingMarks=i,this.solid=a,this.options=s,this.content=[],this.activeMarks=z.none,this.stashMarks=[],this.match=o||(s&xn?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(k.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let n=this.type.contentMatch,i;return(i=n.findWrapping(e.type))?(this.match=n,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Mi)){let n=this.content[this.content.length-1],i;if(n&&n.isText&&(i=/[ \t\r\n\u000c]+$/.exec(n.text))){let a=n;n.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=a.withText(a.text.slice(0,a.text.length-i[0].length))}}let t=k.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(k.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,n=this.pendingMarks;tthis.addAll(e)),o&&this.sync(s),this.needsBlock=l}else this.withStyleRules(e,()=>{this.addElementByRule(e,a,a.consuming===!1?i:void 0)})}leafFallback(e){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(` +`))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=z.none,n=z.none;for(let i=0;i{o.clearMark(s)&&(n=s.addToSet(n))}):t=this.parser.schema.marks[o.mark].create(o.attrs).addToSet(t),o.consuming===!1)a=o;else break}return[t,n]}addElementByRule(e,t,n){let i,a,o;t.node?(a=this.parser.schema.nodes[t.node],a.isLeaf?this.insertNode(a.create(t.attrs))||this.leafFallback(e):i=this.enter(a,t.attrs||null,t.preserveWhitespace)):(o=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(o));let s=this.top;if(a&&a.isLeaf)this.findInside(e);else if(n)this.addElement(e,n);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l));else{let l=e;typeof t.contentElement=="string"?l=e.querySelector(t.contentElement):typeof t.contentElement=="function"?l=t.contentElement(e):t.contentElement&&(l=t.contentElement),this.findAround(e,l,!0),this.addAll(l)}i&&this.sync(s)&&this.open--,o&&this.removePendingMark(o,s)}addAll(e,t,n){let i=t||0;for(let a=t?e.childNodes[t]:e.firstChild,o=n==null?null:e.childNodes[n];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a);this.findAtPoint(e,i)}findPlace(e){let t,n;for(let i=this.open;i>=0;i--){let a=this.nodes[i],o=a.findWrapping(e);if(o&&(!t||t.length>o.length)&&(t=o,n=a,!o.length)||a.solid)break}if(!t)return!1;this.sync(n);for(let i=0;ithis.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let i=n.length-1;i>=0;i--)e+=n[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,i=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),a=-(n?n.depth+1:0)+(i?0:1),o=(s,l)=>{for(;s>=0;s--){let u=t[s];if(u==""){if(s==t.length-1||s==0)continue;for(;l>=a;l--)if(o(s-1,l))return!0;return!1}else{let c=l>0||l==0&&i?this.nodes[l].type:n&&l>=a?n.node(l-a).type:null;if(!c||c.name!=u&&c.groups.indexOf(u)==-1)return!1;l--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let n=this.parser.schema.nodes[t];if(n.isTextblock&&n.defaultAttrs)return n}}addPendingMark(e){let t=em(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let n=this.open;n>=0;n--){let i=this.nodes[n];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let o=i.popFromStashMark(e);o&&i.type&&i.type.allowsMarkType(o.type)&&(i.activeMarks=o.addToSet(i.activeMarks))}if(i==t)break}}}function Xv(r){for(let e=r.firstChild,t=null;e;e=e.nextSibling){let n=e.nodeType==1?e.nodeName.toLowerCase():null;n&&ld.hasOwnProperty(n)&&t?(t.appendChild(e),e=t):n=="li"?t=e:n&&(t=null)}}function Yv(r,e){return(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,e)}function Qv(r){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,t,n=[];for(;t=e.exec(r);)n.push(t[1],t[2].trim());return n}function Hl(r){let e={};for(let t in r)e[t]=r[t];return e}function Zv(r,e){let t=e.schema.nodes;for(let n in t){let i=t[n];if(!i.allowsMarkType(r))continue;let a=[],o=s=>{a.push(s);for(let l=0;l{if(a.length||o.marks.length){let s=0,l=0;for(;s=0;i--){let a=this.serializeMark(e.marks[i],e.isInline,t);a&&((a.contentDOM||a.dom).appendChild(n),n=a.dom)}return n}serializeMark(e,t,n={}){let i=this.marks[e.type.name];return i&&Ct.renderSpec(Ha(n),i(e,t))}static renderSpec(e,t,n=null){if(typeof t=="string")return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],a=i.indexOf(" ");a>0&&(n=i.slice(0,a),i=i.slice(a+1));let o,s=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l=="object"&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let c in l)if(l[c]!=null){let f=c.indexOf(" ");f>0?s.setAttributeNS(c.slice(0,f),c.slice(f+1),l[c]):s.setAttribute(c,l[c])}}for(let c=u;cu)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}else{let{dom:d,contentDOM:p}=Ct.renderSpec(e,f,n);if(s.appendChild(d),p){if(o)throw new RangeError("Multiple content holes");o=p}}}return{dom:s,contentDOM:o}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Ct(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Fl(e.nodes);return t.text||(t.text=n=>n.text),t}static marksFromSchema(e){return Fl(e.marks)}}function Fl(r){let e={};for(let t in r){let n=r[t].spec.toDOM;n&&(e[t]=n)}return e}function Ha(r){return r.document||window.document}const ud=65535,cd=Math.pow(2,16);function tm(r,e){return r+e*cd}function ql(r){return r&ud}function rm(r){return(r-(r&ud))/cd}const fd=1,dd=2,di=4,hd=8;class Eo{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&hd)>0}get deletedBefore(){return(this.delInfo&(fd|di))>0}get deletedAfter(){return(this.delInfo&(dd|di))>0}get deletedAcross(){return(this.delInfo&di)>0}}class Ie{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Ie.empty)return Ie.empty}recover(e){let t=0,n=ql(e);if(!this.inverted)for(let i=0;ie)break;let u=this.ranges[s+a],c=this.ranges[s+o],f=l+u;if(e<=f){let d=u?e==l?-1:e==f?1:t:t,p=l+i+(d<0?0:c);if(n)return p;let h=e==(t<0?l:f)?null:tm(s/3,e-l),v=e==l?dd:e==f?fd:di;return(t<0?e!=l:e!=f)&&(v|=hd),new Eo(p,v,h)}i+=c-u}return n?e+i:new Eo(e+i,0,null)}touches(e,t){let n=0,i=ql(t),a=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;se)break;let u=this.ranges[s+a],c=l+u;if(e<=c&&s==i*3)return!0;n+=this.ranges[s+o]-u}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let i=0,a=0;i=0;t--){let i=e.getMirror(t);this.appendMap(e.maps[t].invert(),i!=null&&i>t?n-i-1:void 0)}}invert(){let e=new $r;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;na&&l!o.isAtom||!s.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),t.openStart,t.openEnd);return Z.fromReplace(e,this.from,this.to,a)}invert(){return new st(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new Ft(t.pos,n.pos,this.mark)}merge(e){return e instanceof Ft&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ft(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ft(t.from,t.to,e.markFromJSON(t.mark))}}xe.jsonID("addMark",Ft);class st extends xe{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new S(fs(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return Z.fromReplace(e,this.from,this.to,n)}invert(){return new Ft(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new st(t.pos,n.pos,this.mark)}merge(e){return e instanceof st&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new st(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new st(t.from,t.to,e.markFromJSON(t.mark))}}xe.jsonID("removeMark",st);class qt extends xe{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Z.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Z.fromReplace(e,this.pos,this.pos+1,new S(k.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let n=this.mark.addToSet(t.marks);if(n.length==t.marks.length){for(let i=0;in.pos?null:new ae(t.pos,n.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new ae(t.from,t.to,t.gapFrom,t.gapTo,S.fromJSON(e,t.slice),t.insert,!!t.structure)}}xe.jsonID("replaceAround",ae);function Mo(r,e,t){let n=r.resolve(e),i=t-e,a=n.depth;for(;i>0&&a>0&&n.indexAfter(a)==n.node(a).childCount;)a--,i--;if(i>0){let o=n.node(a).maybeChild(n.indexAfter(a));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function nm(r,e,t,n){let i=[],a=[],o,s;r.doc.nodesBetween(e,t,(l,u,c)=>{if(!l.isInline)return;let f=l.marks;if(!n.isInSet(f)&&c.type.allowsMarkType(n.type)){let d=Math.max(u,e),p=Math.min(u+l.nodeSize,t),h=n.addToSet(f);for(let v=0;vr.step(l)),a.forEach(l=>r.step(l))}function im(r,e,t,n){let i=[],a=0;r.doc.nodesBetween(e,t,(o,s)=>{if(!o.isInline)return;a++;let l=null;if(n instanceof Qi){let u=o.marks,c;for(;c=n.isInSet(u);)(l||(l=[])).push(c),u=c.removeFromSet(u)}else n?n.isInSet(o.marks)&&(l=[n]):l=o.marks;if(l&&l.length){let u=Math.min(s+o.nodeSize,t);for(let c=0;cr.step(new st(o.from,o.to,o.style)))}function am(r,e,t,n=t.contentMatch){let i=r.doc.nodeAt(e),a=[],o=e+1;for(let s=0;s=0;s--)r.step(a[s])}function om(r,e,t){return(e==0||r.canReplace(e,r.childCount))&&(t==r.childCount||r.canReplace(0,t))}function Zi(r){let t=r.parent.content.cutByIndex(r.startIndex,r.endIndex);for(let n=r.depth;;--n){let i=r.$from.node(n),a=r.$from.index(n),o=r.$to.indexAfter(n);if(nt;h--)v||n.index(h)>0?(v=!0,c=k.from(n.node(h).copy(c)),f++):l--;let d=k.empty,p=0;for(let h=a,v=!1;h>t;h--)v||i.after(h+1)=0;o--){if(n.size){let s=t[o].type.contentMatch.matchFragment(n);if(!s||!s.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=k.from(t[o].type.create(t[o].attrs,n))}let i=e.start,a=e.end;r.step(new ae(i,a,i,a,new S(n,0,0),t.length,!0))}function dm(r,e,t,n,i){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let a=r.steps.length;r.doc.nodesBetween(e,t,(o,s)=>{if(o.isTextblock&&!o.hasMarkup(n,i)&&hm(r.doc,r.mapping.slice(a).map(s),n)){r.clearIncompatible(r.mapping.slice(a).map(s,1),n);let l=r.mapping.slice(a),u=l.map(s,1),c=l.map(s+o.nodeSize,1);return r.step(new ae(u,c,u+1,c-1,new S(k.from(n.create(i,null,o.marks)),0,0),1,!0)),!1}})}function hm(r,e,t){let n=r.resolve(e),i=n.index();return n.parent.canReplaceWith(i,i+1,t)}function pm(r,e,t,n,i){let a=r.doc.nodeAt(e);if(!a)throw new RangeError("No node at given position");t||(t=a.type);let o=t.create(n,null,i||a.marks);if(a.isLeaf)return r.replaceWith(e,e+a.nodeSize,o);if(!t.validContent(a.content))throw new RangeError("Invalid content for node type "+t.name);r.step(new ae(e,e+a.nodeSize,e+1,e+a.nodeSize-1,new S(k.from(o),0,0),1,!0))}function zr(r,e,t=1,n){let i=r.resolve(e),a=i.depth-t,o=n&&n[n.length-1]||i.parent;if(a<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let u=i.depth-1,c=t-2;u>a;u--,c--){let f=i.node(u),d=i.index(u);if(f.type.spec.isolating)return!1;let p=f.content.cutByIndex(d,f.childCount),h=n&&n[c+1];h&&(p=p.replaceChild(0,h.type.create(h.attrs)));let v=n&&n[c]||f;if(!f.canReplace(d+1,f.childCount)||!v.type.validContent(p))return!1}let s=i.indexAfter(a),l=n&&n[0];return i.node(a).canReplaceWith(s,s,l?l.type:i.node(a+1).type)}function vm(r,e,t=1,n){let i=r.doc.resolve(e),a=k.empty,o=k.empty;for(let s=i.depth,l=i.depth-t,u=t-1;s>l;s--,u--){a=k.from(i.node(s).copy(a));let c=n&&n[u];o=k.from(c?c.type.create(c.attrs,o):i.node(s).copy(o))}r.step(new Ce(e,e,new S(a.append(o),t,t),!0))}function pd(r,e){let t=r.resolve(e),n=t.index();return mm(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(n,n+1)}function mm(r,e){return!!(r&&e&&!r.isLeaf&&r.canAppend(e))}function gm(r,e,t){let n=new Ce(e-t,e+t,S.empty,!0);r.step(n)}function ym(r,e,t){let n=r.resolve(e);if(n.parent.canReplaceWith(n.index(),n.index(),t))return e;if(n.parentOffset==0)for(let i=n.depth-1;i>=0;i--){let a=n.index(i);if(n.node(i).canReplaceWith(a,a,t))return n.before(i+1);if(a>0)return null}if(n.parentOffset==n.parent.content.size)for(let i=n.depth-1;i>=0;i--){let a=n.indexAfter(i);if(n.node(i).canReplaceWith(a,a,t))return n.after(i+1);if(a=0;o--){let s=o==n.depth?0:n.pos<=(n.start(o+1)+n.end(o+1))/2?-1:1,l=n.index(o)+(s>0?1:0),u=n.node(o),c=!1;if(a==1)c=u.canReplace(l,l,i);else{let f=u.contentMatchAt(l).findWrapping(i.firstChild.type);c=f&&u.canReplaceWith(l,l,f[0])}if(c)return s==0?n.pos:s<0?n.before(o+1):n.after(o+1)}return null}function ds(r,e,t=e,n=S.empty){if(e==t&&!n.size)return null;let i=r.resolve(e),a=r.resolve(t);return vd(i,a,n)?new Ce(e,t,n):new wm(i,a,n).fit()}function vd(r,e,t){return!t.openStart&&!t.openEnd&&r.start()==e.start()&&r.parent.canReplace(r.index(),e.index(),t.content)}class wm{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=k.empty;for(let i=0;i<=e.depth;i++){let a=e.node(i);this.frontier.push({type:a.type,match:a.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=k.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(e<0?this.$to:n.doc.resolve(e));if(!i)return null;let a=this.placed,o=n.depth,s=i.depth;for(;o&&s&&a.childCount==1;)a=a.firstChild.content,o--,s--;let l=new S(a,o,s);return e>-1?new ae(n.pos,e,this.$to.pos,this.$to.end(),l,t):l.size||n.pos!=this.$to.pos?new Ce(n.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,i=this.unplaced.openEnd;n1&&(i=0),a.type.spec.isolating&&i<=n){e=n;break}t=a.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let i,a=null;n?(a=qa(this.unplaced.content,n-1).firstChild,i=a.content):i=this.unplaced.content;let o=i.firstChild;for(let s=this.depth;s>=0;s--){let{type:l,match:u}=this.frontier[s],c,f=null;if(t==1&&(o?u.matchType(o.type)||(f=u.fillBefore(k.from(o),!1)):a&&l.compatibleContent(a.type)))return{sliceDepth:n,frontierDepth:s,parent:a,inject:f};if(t==2&&o&&(c=u.findWrapping(o.type)))return{sliceDepth:n,frontierDepth:s,parent:a,wrap:c};if(a&&u.matchType(a.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=qa(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new S(e,t+1,Math.max(n,i.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=qa(e,t);if(i.childCount<=1&&t>0){let a=e.size-t<=t+i.size;this.unplaced=new S(yn(e,t-1,1),t-1,a?t-1:n)}else this.unplaced=new S(yn(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:i,wrap:a}){for(;this.depth>t;)this.closeFrontierNode();if(a)for(let v=0;v1||l==0||v.content.size)&&(f=m,c.push(md(v.mark(d.allowedMarks(v.marks)),u==1?l:0,u==s.childCount?p:-1)))}let h=u==s.childCount;h||(p=-1),this.placed=bn(this.placed,t,k.from(c)),this.frontier[t].match=f,h&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let v=0,m=s;v1&&i==this.$to.end(--n);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:i}=this.frontier[t],a=t=0;s--){let{match:l,type:u}=this.frontier[s],c=_a(e,s,u,l,!0);if(!c||c.childCount)continue e}return{depth:t,fit:o,move:a?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=bn(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let i=e.node(n),a=i.type.contentMatch.fillBefore(i.content,!0,e.index(n));this.openFrontierNode(i.type,i.attrs,a)}return e}openFrontierNode(e,t=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=bn(this.placed,this.depth,k.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(k.empty,!0);t.childCount&&(this.placed=bn(this.placed,this.frontier.length,t))}}function yn(r,e,t){return e==0?r.cutByIndex(t,r.childCount):r.replaceChild(0,r.firstChild.copy(yn(r.firstChild.content,e-1,t)))}function bn(r,e,t){return e==0?r.append(t):r.replaceChild(r.childCount-1,r.lastChild.copy(bn(r.lastChild.content,e-1,t)))}function qa(r,e){for(let t=0;t1&&(n=n.replaceChild(0,md(n.firstChild,e-1,n.childCount==1?t-1:0))),e>0&&(n=r.type.contentMatch.fillBefore(n).append(n),t<=0&&(n=n.append(r.type.contentMatch.matchFragment(n).fillBefore(k.empty,!0)))),r.copy(n)}function _a(r,e,t,n,i){let a=r.node(e),o=i?r.indexAfter(e):r.index(e);if(o==a.childCount&&!t.compatibleContent(a.type))return null;let s=n.fillBefore(a.content,!0,o);return s&&!km(t,a.content,o)?s:null}function km(r,e,t){for(let n=t;n0;d--,p--){let h=i.node(d).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;o.indexOf(d)>-1?s=d:i.before(d)==p&&o.splice(1,0,-d)}let l=o.indexOf(s),u=[],c=n.openStart;for(let d=n.content,p=0;;p++){let h=d.firstChild;if(u.push(h),p==n.openStart)break;d=h.content}for(let d=c-1;d>=0;d--){let p=u[d],h=Cm(p.type);if(h&&!p.sameMarkup(i.node(Math.abs(s)-1)))c=d;else if(h||!p.type.isTextblock)break}for(let d=n.openStart;d>=0;d--){let p=(d+c+1)%(n.openStart+1),h=u[p];if(h)for(let v=0;v=0&&(r.replace(e,t,n),!(r.steps.length>f));d--){let p=o[d];p<0||(e=i.before(p),t=a.after(p))}}function gd(r,e,t,n,i){if(en){let a=i.contentMatchAt(0),o=a.fillBefore(r).append(r);r=o.append(a.matchFragment(o).fillBefore(k.empty,!0))}return r}function xm(r,e,t,n){if(!n.isInline&&e==t&&r.doc.resolve(e).parent.content.size){let i=ym(r.doc,e,n.type);i!=null&&(e=t=i)}r.replaceRange(e,t,new S(k.from(n),0,0))}function Em(r,e,t){let n=r.doc.resolve(e),i=r.doc.resolve(t),a=yd(n,i);for(let o=0;o0&&(l||n.node(s-1).canReplace(n.index(s-1),i.indexAfter(s-1))))return r.delete(n.before(s),i.after(s))}for(let o=1;o<=n.depth&&o<=i.depth;o++)if(e-n.start(o)==n.depth-o&&t>n.end(o)&&i.end(o)-t!=i.depth-o)return r.delete(n.before(o),t);r.delete(e,t)}function yd(r,e){let t=[],n=Math.min(r.depth,e.depth);for(let i=n;i>=0;i--){let a=r.start(i);if(ae.pos+(e.depth-i)||r.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(a==e.start(i)||i==r.depth&&i==e.depth&&r.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==a-1)&&t.push(i)}return t}class Vr extends xe{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return Z.fail("No node at attribute step's position");let n=Object.create(null);for(let a in t.attrs)n[a]=t.attrs[a];n[this.attr]=this.value;let i=t.type.create(n,null,t.marks);return Z.fromReplace(e,this.pos,this.pos+1,new S(k.from(i),0,t.isLeaf?0:1))}getMap(){return Ie.empty}invert(e){return new Vr(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Vr(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Vr(t.pos,t.attr,t.value)}}xe.jsonID("attr",Vr);class An extends xe{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return Z.ok(n)}getMap(){return Ie.empty}invert(e){return new An(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new An(t.attr,t.value)}}xe.jsonID("docAttr",An);let jr=class extends Error{};jr=function r(e){let t=Error.call(this,e);return t.__proto__=r.prototype,t};jr.prototype=Object.create(Error.prototype);jr.prototype.constructor=jr;jr.prototype.name="TransformError";class Mm{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new $r}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new jr(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=S.empty){let i=ds(this.doc,e,t,n);return i&&this.step(i),this}replaceWith(e,t,n){return this.replace(e,t,new S(k.from(n),0,0))}delete(e,t){return this.replace(e,t,S.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return Tm(this,e,t,n),this}replaceRangeWith(e,t,n){return xm(this,e,t,n),this}deleteRange(e,t){return Em(this,e,t),this}lift(e,t){return sm(this,e,t),this}join(e,t=1){return gm(this,e,t),this}wrap(e,t){return fm(this,e,t),this}setBlockType(e,t=e,n,i=null){return dm(this,e,t,n,i),this}setNodeMarkup(e,t,n=null,i){return pm(this,e,t,n,i),this}setNodeAttribute(e,t,n){return this.step(new Vr(e,t,n)),this}setDocAttribute(e,t){return this.step(new An(e,t)),this}addNodeMark(e,t){return this.step(new qt(e,t)),this}removeNodeMark(e,t){if(!(t instanceof z)){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(t=t.isInSet(n.marks),!t)return this}return this.step(new Wr(e,t)),this}split(e,t=1,n){return vm(this,e,t,n),this}addMark(e,t,n){return nm(this,e,t,n),this}removeMark(e,t,n){return im(this,e,t,n),this}clearIncompatible(e,t,n){return am(this,e,t,n),this}}const $a=Object.create(null);class F{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new bd(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t=0;a--){let o=t<0?Pr(e.node(0),e.node(a),e.before(a+1),e.index(a),t,n):Pr(e.node(0),e.node(a),e.after(a+1),e.index(a)+1,t,n);if(o)return o}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Se(e.node(0))}static atStart(e){return Pr(e,e,0,0,1)||new Se(e)}static atEnd(e){return Pr(e,e,e.content.size,e.childCount,-1)||new Se(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=$a[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in $a)throw new RangeError("Duplicate use of selection JSON ID "+e);return $a[e]=t,t.prototype.jsonID=e,t}getBookmark(){return $.between(this.$anchor,this.$head).getBookmark()}}F.prototype.visible=!0;class bd{constructor(e,t){this.$from=e,this.$to=t}}let $l=!1;function zl(r){!$l&&!r.parent.inlineContent&&($l=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+r.parent.type.name+")"))}class $ extends F{constructor(e,t=e){zl(e),zl(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return F.near(n);let i=e.resolve(t.map(this.anchor));return new $(i.parent.inlineContent?i:n,n)}replace(e,t=S.empty){if(super.replace(e,t),t==S.empty){let n=this.$from.marksAcross(this.$to);n&&e.ensureMarks(n)}}eq(e){return e instanceof $&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new ea(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new $(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let i=e.resolve(t);return new this(i,n==t?i:e.resolve(n))}static between(e,t,n){let i=e.pos-t.pos;if((!n||i)&&(n=i>=0?1:-1),!t.parent.inlineContent){let a=F.findFrom(t,n,!0)||F.findFrom(t,-n,!0);if(a)t=a.$head;else return F.near(t,n)}return e.parent.inlineContent||(i==0?e=t:(e=(F.findFrom(e,-n,!0)||F.findFrom(e,n,!0)).$anchor,e.pos0?0:1);i>0?o=0;o+=i){let s=e.child(o);if(s.isAtom){if(!a&&B.isSelectable(s))return B.create(r,t-(i<0?s.nodeSize:0))}else{let l=Pr(r,s,t+i,i<0?s.childCount:0,i,a);if(l)return l}t+=s.nodeSize*i}return null}function Vl(r,e,t){let n=r.steps.length-1;if(n{o==null&&(o=c)}),r.setSelection(F.near(r.doc.resolve(o),t))}const Ul=1,ei=2,Wl=4;class Om extends Mm{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=ei,this}ensureMarks(e){return z.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&ei)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~ei,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||z.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let i=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(n==null&&(n=t),n=n??t,!e)return this.deleteRange(t,n);let a=this.storedMarks;if(!a){let o=this.doc.resolve(t);a=n==t?o.marks():o.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,i.text(e,a)),this.selection.empty||this.setSelection(F.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Wl,this}get scrolledIntoView(){return(this.updated&Wl)>0}}function jl(r,e){return!e||!r?r:r.bind(e)}class wn{constructor(e,t,n){this.name=e,this.init=jl(t.init,n),this.apply=jl(t.apply,n)}}const Lm=[new wn("doc",{init(r){return r.doc||r.schema.topNodeType.createAndFill()},apply(r){return r.doc}}),new wn("selection",{init(r,e){return r.selection||F.atStart(e.doc)},apply(r){return r.selection}}),new wn("storedMarks",{init(r){return r.storedMarks||null},apply(r,e,t,n){return n.selection.$cursor?r.storedMarks:null}}),new wn("scrollToSelection",{init(){return 0},apply(r,e){return r.scrolledIntoView?e+1:e}})];class za{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Lm.slice(),t&&t.forEach(n=>{if(this.pluginsByKey[n.key])throw new RangeError("Adding different instances of a keyed plugin ("+n.key+")");this.plugins.push(n),this.pluginsByKey[n.key]=n,n.spec.state&&this.fields.push(new wn(n.key,n.spec.state,n))})}}class ar{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;nn.toJSON())),e&&typeof e=="object")for(let n in e){if(n=="doc"||n=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[n],a=i.spec.state;a&&a.toJSON&&(t[n]=a.toJSON.call(i,this[i.key]))}return t}static fromJSON(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new za(e.schema,e.plugins),a=new ar(i);return i.fields.forEach(o=>{if(o.name=="doc")a.doc=$t.fromJSON(e.schema,t.doc);else if(o.name=="selection")a.selection=F.fromJSON(a.doc,t.selection);else if(o.name=="storedMarks")t.storedMarks&&(a.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let s in n){let l=n[s],u=l.spec.state;if(l.key==o.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(t,s)){a[o.name]=u.fromJSON.call(l,e,t[s],a);return}}a[o.name]=o.init(e,a)}}),a}}function wd(r,e,t){for(let n in r){let i=r[n];i instanceof Function?i=i.bind(e):n=="handleDOMEvents"&&(i=wd(i,e,{})),t[n]=i}return t}class He{constructor(e){this.spec=e,this.props={},e.props&&wd(e.props,this,this.props),this.key=e.key?e.key.key:kd("plugin")}getState(e){return e[this.key]}}const Va=Object.create(null);function kd(r){return r in Va?r+"$"+ ++Va[r]:(Va[r]=0,r+"$")}class Fn{constructor(e="key"){this.key=kd(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const fe=function(r){for(var e=0;;e++)if(r=r.previousSibling,!r)return e},Nn=function(r){let e=r.assignedSlot||r.parentNode;return e&&e.nodeType==11?e.host:e};let So=null;const bt=function(r,e,t){let n=So||(So=document.createRange());return n.setEnd(r,t??r.nodeValue.length),n.setStart(r,e||0),n},Am=function(){So=null},vr=function(r,e,t,n){return t&&(Gl(r,e,t,n,-1)||Gl(r,e,t,n,1))},Nm=/^(img|br|input|textarea|hr)$/i;function Gl(r,e,t,n,i){for(;;){if(r==t&&e==n)return!0;if(e==(i<0?0:ot(r))){let a=r.parentNode;if(!a||a.nodeType!=1||qn(r)||Nm.test(r.nodeName)||r.contentEditable=="false")return!1;e=fe(r)+(i<0?0:1),r=a}else if(r.nodeType==1){if(r=r.childNodes[e+(i<0?-1:0)],r.contentEditable=="false")return!1;e=i<0?ot(r):0}else return!1}}function ot(r){return r.nodeType==3?r.nodeValue.length:r.childNodes.length}function Dm(r,e){for(;;){if(r.nodeType==3&&e)return r;if(r.nodeType==1&&e>0){if(r.contentEditable=="false")return null;r=r.childNodes[e-1],e=ot(r)}else if(r.parentNode&&!qn(r))e=fe(r),r=r.parentNode;else return null}}function Im(r,e){for(;;){if(r.nodeType==3&&e2),ze=Gr||(ct?/Mac/.test(ct.platform):!1),Fm=ct?/Win/.test(ct.platform):!1,Ke=/Android \d/.test(Xt),_n=!!Kl&&"webkitFontSmoothing"in Kl.documentElement.style,qm=_n?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function _m(r){let e=r.defaultView&&r.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:r.documentElement.clientWidth,top:0,bottom:r.documentElement.clientHeight}}function gt(r,e){return typeof r=="number"?r:r[e]}function $m(r){let e=r.getBoundingClientRect(),t=e.width/r.offsetWidth||1,n=e.height/r.offsetHeight||1;return{left:e.left,right:e.left+r.clientWidth*t,top:e.top,bottom:e.top+r.clientHeight*n}}function Jl(r,e,t){let n=r.someProp("scrollThreshold")||0,i=r.someProp("scrollMargin")||5,a=r.dom.ownerDocument;for(let o=t||r.dom;o;o=Nn(o)){if(o.nodeType!=1)continue;let s=o,l=s==a.body,u=l?_m(a):$m(s),c=0,f=0;if(e.topu.bottom-gt(n,"bottom")&&(f=e.bottom-e.top>u.bottom-u.top?e.top+gt(i,"top")-u.top:e.bottom-u.bottom+gt(i,"bottom")),e.leftu.right-gt(n,"right")&&(c=e.right-u.right+gt(i,"right")),c||f)if(l)a.defaultView.scrollBy(c,f);else{let d=s.scrollLeft,p=s.scrollTop;f&&(s.scrollTop+=f),c&&(s.scrollLeft+=c);let h=s.scrollLeft-d,v=s.scrollTop-p;e={left:e.left-h,top:e.top-v,right:e.right-h,bottom:e.bottom-v}}if(l||/^(fixed|sticky)$/.test(getComputedStyle(o).position))break}}function zm(r){let e=r.dom.getBoundingClientRect(),t=Math.max(0,e.top),n,i;for(let a=(e.left+e.right)/2,o=t+1;o=t-20){n=s,i=l.top;break}}return{refDOM:n,refTop:i,stack:Td(r.dom)}}function Td(r){let e=[],t=r.ownerDocument;for(let n=r;n&&(e.push({dom:n,top:n.scrollTop,left:n.scrollLeft}),r!=t);n=Nn(n));return e}function Vm({refDOM:r,refTop:e,stack:t}){let n=r?r.getBoundingClientRect().top:0;xd(t,n==0?0:n-e)}function xd(r,e){for(let t=0;t=s){o=Math.max(h.bottom,o),s=Math.min(h.top,s);let v=h.left>e.left?h.left-e.left:h.right=(h.left+h.right)/2?1:0));continue}}else h.top>e.top&&!l&&h.left<=e.left&&h.right>=e.left&&(l=c,u={left:Math.max(h.left,Math.min(h.right,e.left)),top:h.top});!t&&(e.left>=h.right&&e.top>=h.top||e.left>=h.left&&e.top>=h.bottom)&&(a=f+1)}}return!t&&l&&(t=l,i=u,n=0),t&&t.nodeType==3?Wm(t,i):!t||n&&t.nodeType==1?{node:r,offset:a}:Ed(t,i)}function Wm(r,e){let t=r.nodeValue.length,n=document.createRange();for(let i=0;i=(a.left+a.right)/2?1:0)}}return{node:r,offset:0}}function ps(r,e){return r.left>=e.left-1&&r.left<=e.right+1&&r.top>=e.top-1&&r.top<=e.bottom+1}function jm(r,e){let t=r.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left(o.left+o.right)/2?1:-1}return r.docView.posFromDOM(n,i,a)}function Km(r,e,t,n){let i=-1;for(let a=e,o=!1;a!=r.dom;){let s=r.docView.nearestDesc(a,!0);if(!s)return null;if(s.dom.nodeType==1&&(s.node.isBlock&&s.parent&&!o||!s.contentDOM)){let l=s.dom.getBoundingClientRect();if(s.node.isBlock&&s.parent&&!o&&(o=!0,l.left>n.left||l.top>n.top?i=s.posBefore:(l.right-1?i:r.docView.posFromDOM(e,t,-1)}function Md(r,e,t){let n=r.childNodes.length;if(n&&t.tope.top&&i++}let u;_n&&i&&n.nodeType==1&&(u=n.childNodes[i-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=e.top&&i--,n==r.dom&&i==n.childNodes.length-1&&n.lastChild.nodeType==1&&e.top>n.lastChild.getBoundingClientRect().bottom?s=r.state.doc.content.size:(i==0||n.nodeType!=1||n.childNodes[i-1].nodeName!="BR")&&(s=Km(r,n,i,e))}s==null&&(s=Gm(r,o,e));let l=r.docView.nearestDesc(o,!0);return{pos:s,inside:l?l.posAtStart-l.border:-1}}function Xl(r){return r.top=0&&i==n.nodeValue.length?(l--,c=1):t<0?l--:u++,dn(It(bt(n,l,u),c),c<0)}if(!r.state.doc.resolve(e-(a||0)).parent.inlineContent){if(a==null&&i&&(t<0||i==ot(n))){let l=n.childNodes[i-1];if(l.nodeType==1)return Ua(l.getBoundingClientRect(),!1)}if(a==null&&i=0)}if(a==null&&i&&(t<0||i==ot(n))){let l=n.childNodes[i-1],u=l.nodeType==3?bt(l,ot(l)-(o?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(u)return dn(It(u,1),!1)}if(a==null&&i=0)}function dn(r,e){if(r.width==0)return r;let t=e?r.left:r.right;return{top:r.top,bottom:r.bottom,left:t,right:t}}function Ua(r,e){if(r.height==0)return r;let t=e?r.top:r.bottom;return{top:t,bottom:t,left:r.left,right:r.right}}function Od(r,e,t){let n=r.state,i=r.root.activeElement;n!=e&&r.updateState(e),i!=r.dom&&r.focus();try{return t()}finally{n!=e&&r.updateState(n),i!=r.dom&&i&&i.focus()}}function Ym(r,e,t){let n=e.selection,i=t=="up"?n.$from:n.$to;return Od(r,e,()=>{let{node:a}=r.docView.domFromPos(i.pos,t=="up"?-1:1);for(;;){let s=r.docView.nearestDesc(a,!0);if(!s)break;if(s.node.isBlock){a=s.contentDOM||s.dom;break}a=s.dom.parentNode}let o=Sd(r,i.pos,1);for(let s=a.firstChild;s;s=s.nextSibling){let l;if(s.nodeType==1)l=s.getClientRects();else if(s.nodeType==3)l=bt(s,0,s.nodeValue.length).getClientRects();else continue;for(let u=0;uc.top+1&&(t=="up"?o.top-c.top>(c.bottom-o.top)*2:c.bottom-o.bottom>(o.bottom-c.top)*2))return!1}}return!0})}const Qm=/[\u0590-\u08ac]/;function Zm(r,e,t){let{$head:n}=e.selection;if(!n.parent.isTextblock)return!1;let i=n.parentOffset,a=!i,o=i==n.parent.content.size,s=r.domSelection();return!Qm.test(n.parent.textContent)||!s.modify?t=="left"||t=="backward"?a:o:Od(r,e,()=>{let{focusNode:l,focusOffset:u,anchorNode:c,anchorOffset:f}=r.domSelectionRange(),d=s.caretBidiLevel;s.modify("move",t,"character");let p=n.depth?r.docView.domAfterPos(n.before()):r.dom,{focusNode:h,focusOffset:v}=r.domSelectionRange(),m=h&&!p.contains(h.nodeType==1?h:h.parentNode)||l==h&&u==v;try{s.collapse(c,f),l&&(l!=c||u!=f)&&s.extend&&s.extend(l,u)}catch{}return d!=null&&(s.caretBidiLevel=d),m})}let Yl=null,Ql=null,Zl=!1;function eg(r,e,t){return Yl==e&&Ql==t?Zl:(Yl=e,Ql=t,Zl=t=="up"||t=="down"?Ym(r,e,t):Zm(r,e,t))}const Ve=0,eu=1,or=2,ft=3;class $n{constructor(e,t,n,i){this.parent=e,this.children=t,this.dom=n,this.contentDOM=i,this.dirty=Ve,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;tfe(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let a=e;;a=a.parentNode){if(a==this.dom){i=!1;break}if(a.previousSibling)break}if(i==null&&t==e.childNodes.length)for(let a=e;;a=a.parentNode){if(a==this.dom){i=!0;break}if(a.nextSibling)break}}return i??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,i=e;i;i=i.parentNode){let a=this.getDesc(i),o;if(a&&(!t||a.node))if(n&&(o=a.nodeDOM)&&!(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))n=!1;else return a}}getDesc(e){let t=e.pmViewDesc;for(let n=t;n;n=n.parent)if(n==this)return t}posFromDOM(e,t,n){for(let i=e;i;i=i.parentNode){let a=this.getDesc(i);if(a)return a.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;te||o instanceof Ad){i=e-a;break}a=s}if(i)return this.children[n].domFromPos(i-this.children[n].border,t);for(let a;n&&!(a=this.children[n-1]).size&&a instanceof Ld&&a.side>=0;n--);if(t<=0){let a,o=!0;for(;a=n?this.children[n-1]:null,!(!a||a.dom.parentNode==this.contentDOM);n--,o=!1);return a&&t&&o&&!a.border&&!a.domAtom?a.domFromPos(a.size,t):{node:this.contentDOM,offset:a?fe(a.dom)+1:0}}else{let a,o=!0;for(;a=n=c&&t<=u-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,t,c);e=o;for(let f=s;f>0;f--){let d=this.children[f-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){i=fe(d.dom)+1;break}e-=d.size}i==-1&&(i=0)}if(i>-1&&(u>t||s==this.children.length-1)){t=u;for(let c=s+1;cp&&ot){let p=s;s=l,l=p}let d=document.createRange();d.setEnd(l.node,l.offset),d.setStart(s.node,s.offset),u.removeAllRanges(),u.addRange(d)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,i=0;i=n:en){let s=n+a.border,l=o-a.border;if(e>=s&&t<=l){this.dirty=e==n||t==o?or:eu,e==s&&t==l&&(a.contentLost||a.dom.parentNode!=this.contentDOM)?a.dirty=ft:a.markDirty(e-s,t-s);return}else a.dirty=a.dom==a.contentDOM&&a.dom.parentNode==this.contentDOM&&!a.children.length?or:ft}n=o}this.dirty=or}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?or:eu;t.dirty{if(!a)return i;if(a.parent)return a.parent.posBeforeChild(a)})),!t.type.spec.raw){if(o.nodeType!=1){let s=document.createElement("span");s.appendChild(o),o=s}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,a=this}matchesWidget(e){return this.dirty==Ve&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class tg extends $n{constructor(e,t,n,i){super(e,[],t,null),this.textDOM=n,this.text=i}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class mr extends $n{constructor(e,t,n,i){super(e,[],n,i),this.mark=t}static create(e,t,n,i){let a=i.nodeViews[t.type.name],o=a&&a(t,i,n);return(!o||!o.dom)&&(o=Ct.renderSpec(document,t.type.spec.toDOM(t,n))),new mr(e,t,o.dom,o.contentDOM||o.dom)}parseRule(){return this.dirty&ft||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=ft&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=Ve){let n=this.parent;for(;!n.node;)n=n.parent;n.dirty0&&(a=Io(a,0,e,n));for(let s=0;s{if(!l)return o;if(l.parent)return l.parent.posBeforeChild(l)},n,i),c=u&&u.dom,f=u&&u.contentDOM;if(t.isText){if(!c)c=document.createTextNode(t.text);else if(c.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else c||({dom:c,contentDOM:f}=Ct.renderSpec(document,t.type.spec.toDOM(t)));!f&&!t.isText&&c.nodeName!="BR"&&(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let d=c;return c=Id(c,n,t),u?l=new rg(e,t,n,i,c,f||null,d,u,a,o+1):t.isText?new ra(e,t,n,i,c,d,a):new Vt(e,t,n,i,c,f||null,d,a,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>k.empty)}return e}matchesNode(e,t,n){return this.dirty==Ve&&e.eq(this.node)&&Do(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,i=t,a=e.composing?this.localCompositionInfo(e,t):null,o=a&&a.pos>-1?a:null,s=a&&a.pos<0,l=new ig(this,o&&o.node,e);sg(this.node,this.innerDeco,(u,c,f)=>{u.spec.marks?l.syncToMarks(u.spec.marks,n,e):u.type.side>=0&&!f&&l.syncToMarks(c==this.node.childCount?z.none:this.node.child(c).marks,n,e),l.placeWidget(u,e,i)},(u,c,f,d)=>{l.syncToMarks(u.marks,n,e);let p;l.findNodeMatch(u,c,f,d)||s&&e.state.selection.from>i&&e.state.selection.to-1&&l.updateNodeAt(u,c,f,p,e)||l.updateNextNode(u,c,f,e,d,i)||l.addNode(u,c,f,e,i),i+=u.nodeSize}),l.syncToMarks([],n,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==or)&&(o&&this.protectLocalComposition(e,o),Nd(this.contentDOM,this.children,e),Gr&&lg(this.dom))}localCompositionInfo(e,t){let{from:n,to:i}=e.state.selection;if(!(e.state.selection instanceof $)||nt+this.node.content.size)return null;let a=e.input.compositionNode;if(!a||!this.dom.contains(a.parentNode))return null;if(this.node.inlineContent){let o=a.nodeValue,s=ug(this.node.content,o,n-t,i-t);return s<0?null:{node:a,pos:s,text:o}}else return{node:a,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:i}){if(this.getDesc(t))return;let a=t;for(;a.parentNode!=this.contentDOM;a=a.parentNode){for(;a.previousSibling;)a.parentNode.removeChild(a.previousSibling);for(;a.nextSibling;)a.parentNode.removeChild(a.nextSibling);a.pmViewDesc&&(a.pmViewDesc=void 0)}let o=new tg(this,a,t,i);e.input.compositionNodes.push(o),this.children=Io(this.children,n,n+i.length,e,o)}update(e,t,n,i){return this.dirty==ft||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,n,i),!0)}updateInner(e,t,n,i){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Ve}updateOuterDeco(e){if(Do(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=Dd(this.dom,this.nodeDOM,No(this.outerDeco,this.node,t),No(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function tu(r,e,t,n,i){Id(n,e,r);let a=new Vt(void 0,r,e,t,n,n,n,i,0);return a.contentDOM&&a.updateChildren(i,0),a}class ra extends Vt{constructor(e,t,n,i,a,o,s){super(e,t,n,i,a,null,o,s,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,i){return this.dirty==ft||this.dirty!=Ve&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=Ve||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=Ve,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,t,n){let i=this.node.cut(e,t),a=document.createTextNode(i.text);return new ra(this.parent,i,this.outerDeco,this.innerDeco,a,a,n)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=ft)}get domAtom(){return!1}isText(e){return this.node.text==e}}class Ad extends $n{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Ve&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class rg extends Vt{constructor(e,t,n,i,a,o,s,l,u,c){super(e,t,n,i,a,o,s,u,c),this.spec=l}update(e,t,n,i){if(this.dirty==ft)return!1;if(this.spec.update){let a=this.spec.update(e,t,n);return a&&this.updateInner(e,t,n,i),a}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,n,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,i){this.spec.setSelection?this.spec.setSelection(e,t,n):super.setSelection(e,t,n,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Nd(r,e,t){let n=r.firstChild,i=!1;for(let a=0;a>1,o=Math.min(a,e.length);for(;i-1)s>this.index&&(this.changed=!0,this.destroyBetween(this.index,s)),this.top=this.top.children[this.index];else{let l=mr.create(this.top,e[a],t,n);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,a++}}findNodeMatch(e,t,n,i){let a=-1,o;if(i>=this.preMatch.index&&(o=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))a=this.top.children.indexOf(o,this.index);else for(let s=this.index,l=Math.min(this.top.children.length,s+5);s0;){let s;for(;;)if(n){let u=t.children[n-1];if(u instanceof mr)t=u,n=u.children.length;else{s=u,n--;break}}else{if(t==e)break e;n=t.parent.children.indexOf(t),t=t.parent}let l=s.node;if(l){if(l!=r.child(i-1))break;--i,a.set(s,i),o.push(s)}}return{index:i,matched:a,matches:o.reverse()}}function og(r,e){return r.type.side-e.type.side}function sg(r,e,t,n){let i=e.locals(r),a=0;if(i.length==0){for(let u=0;ua;)s.push(i[o++]);let h=a+d.nodeSize;if(d.isText){let m=h;o!m.inline):s.slice();n(d,v,e.forChild(a,d),p),a=h}}function lg(r){if(r.nodeName=="UL"||r.nodeName=="OL"){let e=r.style.cssText;r.style.cssText=e+"; list-style: square !important",window.getComputedStyle(r).listStyle,r.style.cssText=e}}function ug(r,e,t,n){for(let i=0,a=0;i=t){if(a>=n&&l.slice(n-e.length-s,n-s)==e)return n-e.length;let u=s=0&&u+e.length+s>=t)return s+u;if(t==n&&l.length>=n+e.length-s&&l.slice(n-s,n-s+e.length)==e)return n}}return-1}function Io(r,e,t,n,i){let a=[];for(let o=0,s=0;o=t||c<=e?a.push(l):(ut&&a.push(l.slice(t-u,l.size,n)))}return a}function vs(r,e=null){let t=r.domSelectionRange(),n=r.state.doc;if(!t.focusNode)return null;let i=r.docView.nearestDesc(t.focusNode),a=i&&i.size==0,o=r.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(o<0)return null;let s=n.resolve(o),l,u;if(ta(t)){for(l=s;i&&!i.node;)i=i.parent;let c=i.node;if(i&&c.isAtom&&B.isSelectable(c)&&i.parent&&!(c.isInline&&Rm(t.focusNode,t.focusOffset,i.dom))){let f=i.posBefore;u=new B(o==f?s:n.resolve(f))}}else{let c=r.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(c<0)return null;l=n.resolve(c)}if(!u){let c=e=="pointer"||r.state.selection.head{(t.anchorNode!=n||t.anchorOffset!=i)&&(e.removeEventListener("selectionchange",r.input.hideSelectionGuard),setTimeout(()=>{(!Rd(r)||r.state.selection.visible)&&r.dom.classList.remove("ProseMirror-hideselection")},20))})}function fg(r){let e=r.domSelection(),t=document.createRange(),n=r.cursorWrapper.dom,i=n.nodeName=="IMG";i?t.setEnd(n.parentNode,fe(n)+1):t.setEnd(n,0),t.collapse(!1),e.removeAllRanges(),e.addRange(t),!i&&!r.state.selection.visible&&Be&&zt<=11&&(n.disabled=!0,n.disabled=!1)}function Bd(r,e){if(e instanceof B){let t=r.docView.descAt(e.from);t!=r.lastSelectedViewDesc&&(ou(r),t&&t.selectNode(),r.lastSelectedViewDesc=t)}else ou(r)}function ou(r){r.lastSelectedViewDesc&&(r.lastSelectedViewDesc.parent&&r.lastSelectedViewDesc.deselectNode(),r.lastSelectedViewDesc=void 0)}function ms(r,e,t,n){return r.someProp("createSelectionBetween",i=>i(r,e,t))||$.between(e,t,n)}function su(r){return r.editable&&!r.hasFocus()?!1:Pd(r)}function Pd(r){let e=r.domSelectionRange();if(!e.anchorNode)return!1;try{return r.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(r.editable||r.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function dg(r){let e=r.docView.domFromPos(r.state.selection.anchor,0),t=r.domSelectionRange();return vr(e.node,e.offset,t.anchorNode,t.anchorOffset)}function Ro(r,e){let{$anchor:t,$head:n}=r.selection,i=e>0?t.max(n):t.min(n),a=i.parent.inlineContent?i.depth?r.doc.resolve(e>0?i.after():i.before()):null:i;return a&&F.findFrom(a,e)}function Rt(r,e){return r.dispatch(r.state.tr.setSelection(e).scrollIntoView()),!0}function lu(r,e,t){let n=r.state.selection;if(n instanceof $)if(t.indexOf("s")>-1){let{$head:i}=n,a=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!a||a.isText||!a.isLeaf)return!1;let o=r.state.doc.resolve(i.pos+a.nodeSize*(e<0?-1:1));return Rt(r,new $(n.$anchor,o))}else if(n.empty){if(r.endOfTextblock(e>0?"forward":"backward")){let i=Ro(r.state,e);return i&&i instanceof B?Rt(r,i):!1}else if(!(ze&&t.indexOf("m")>-1)){let i=n.$head,a=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,o;if(!a||a.isText)return!1;let s=e<0?i.pos-a.nodeSize:i.pos;return a.isAtom||(o=r.docView.descAt(s))&&!o.contentDOM?B.isSelectable(a)?Rt(r,new B(e<0?r.state.doc.resolve(i.pos-a.nodeSize):i)):_n?Rt(r,new $(r.state.doc.resolve(e<0?s:s+a.nodeSize))):!1:!1}}else return!1;else{if(n instanceof B&&n.node.isInline)return Rt(r,new $(e>0?n.$to:n.$from));{let i=Ro(r.state,e);return i?Rt(r,i):!1}}}function Oi(r){return r.nodeType==3?r.nodeValue.length:r.childNodes.length}function Mn(r,e){let t=r.pmViewDesc;return t&&t.size==0&&(e<0||r.nextSibling||r.nodeName!="BR")}function Dr(r,e){return e<0?hg(r):pg(r)}function hg(r){let e=r.domSelectionRange(),t=e.focusNode,n=e.focusOffset;if(!t)return;let i,a,o=!1;for(Ze&&t.nodeType==1&&n0){if(t.nodeType!=1)break;{let s=t.childNodes[n-1];if(Mn(s,-1))i=t,a=--n;else if(s.nodeType==3)t=s,n=t.nodeValue.length;else break}}else{if(Hd(t))break;{let s=t.previousSibling;for(;s&&Mn(s,-1);)i=t.parentNode,a=fe(s),s=s.previousSibling;if(s)t=s,n=Oi(t);else{if(t=t.parentNode,t==r.dom)break;n=0}}}o?Bo(r,t,n):i&&Bo(r,i,a)}function pg(r){let e=r.domSelectionRange(),t=e.focusNode,n=e.focusOffset;if(!t)return;let i=Oi(t),a,o;for(;;)if(n{r.state==i&&xt(r)},50)}function uu(r,e){let t=r.state.doc.resolve(e);if(!(Me||Fm)&&t.parent.inlineContent){let i=r.coordsAtPos(e);if(e>t.start()){let a=r.coordsAtPos(e-1),o=(a.top+a.bottom)/2;if(o>i.top&&o1)return a.lefti.top&&o1)return a.left>i.left?"ltr":"rtl"}}return getComputedStyle(r.dom).direction=="rtl"?"rtl":"ltr"}function cu(r,e,t){let n=r.state.selection;if(n instanceof $&&!n.empty||t.indexOf("s")>-1||ze&&t.indexOf("m")>-1)return!1;let{$from:i,$to:a}=n;if(!i.parent.inlineContent||r.endOfTextblock(e<0?"up":"down")){let o=Ro(r.state,e);if(o&&o instanceof B)return Rt(r,o)}if(!i.parent.inlineContent){let o=e<0?i:a,s=n instanceof Se?F.near(o,e):F.findFrom(o,e);return s?Rt(r,s):!1}return!1}function fu(r,e){if(!(r.state.selection instanceof $))return!0;let{$head:t,$anchor:n,empty:i}=r.state.selection;if(!t.sameParent(n))return!0;if(!i)return!1;if(r.endOfTextblock(e>0?"forward":"backward"))return!0;let a=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(a&&!a.isText){let o=r.state.tr;return e<0?o.delete(t.pos-a.nodeSize,t.pos):o.delete(t.pos,t.pos+a.nodeSize),r.dispatch(o),!0}return!1}function du(r,e,t){r.domObserver.stop(),e.contentEditable=t,r.domObserver.start()}function gg(r){if(!Oe||r.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=r.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let n=e.firstChild;du(r,n,"true"),setTimeout(()=>du(r,n,"false"),20)}return!1}function yg(r){let e="";return r.ctrlKey&&(e+="c"),r.metaKey&&(e+="m"),r.altKey&&(e+="a"),r.shiftKey&&(e+="s"),e}function bg(r,e){let t=e.keyCode,n=yg(e);if(t==8||ze&&t==72&&n=="c")return fu(r,-1)||Dr(r,-1);if(t==46&&!e.shiftKey||ze&&t==68&&n=="c")return fu(r,1)||Dr(r,1);if(t==13||t==27)return!0;if(t==37||ze&&t==66&&n=="c"){let i=t==37?uu(r,r.state.selection.from)=="ltr"?-1:1:-1;return lu(r,i,n)||Dr(r,i)}else if(t==39||ze&&t==70&&n=="c"){let i=t==39?uu(r,r.state.selection.from)=="ltr"?1:-1:1;return lu(r,i,n)||Dr(r,i)}else{if(t==38||ze&&t==80&&n=="c")return cu(r,-1,n)||Dr(r,-1);if(t==40||ze&&t==78&&n=="c")return gg(r)||cu(r,1,n)||Dr(r,1);if(n==(ze?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function Fd(r,e){r.someProp("transformCopied",p=>{e=p(e,r)});let t=[],{content:n,openStart:i,openEnd:a}=e;for(;i>1&&a>1&&n.childCount==1&&n.firstChild.childCount==1;){i--,a--;let p=n.firstChild;t.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),n=p.content}let o=r.someProp("clipboardSerializer")||Ct.fromSchema(r.state.schema),s=Ud(),l=s.createElement("div");l.appendChild(o.serializeFragment(n,{document:s}));let u=l.firstChild,c,f=0;for(;u&&u.nodeType==1&&(c=Vd[u.nodeName.toLowerCase()]);){for(let p=c.length-1;p>=0;p--){let h=s.createElement(c[p]);for(;l.firstChild;)h.appendChild(l.firstChild);l.appendChild(h),f++}u=l.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${i} ${a}${f?` -${f}`:""} ${JSON.stringify(t)}`);let d=r.someProp("clipboardTextSerializer",p=>p(e,r))||e.content.textBetween(0,e.content.size,` + +`);return{dom:l,text:d}}function qd(r,e,t,n,i){let a=i.parent.type.spec.code,o,s;if(!t&&!e)return null;let l=e&&(n||a||!t);if(l){if(r.someProp("transformPastedText",d=>{e=d(e,a||n,r)}),a)return e?new S(k.from(r.state.schema.text(e.replace(/\r\n?/g,` +`))),0,0):S.empty;let f=r.someProp("clipboardTextParser",d=>d(e,i,n,r));if(f)s=f;else{let d=i.marks(),{schema:p}=r.state,h=Ct.fromSchema(p);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(v=>{let m=o.appendChild(document.createElement("p"));v&&m.appendChild(h.serializeNode(p.text(v,d)))})}}else r.someProp("transformPastedHTML",f=>{t=f(t,r)}),o=Cg(t),_n&&Tg(o);let u=o&&o.querySelector("[data-pm-slice]"),c=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let f=+c[3];f>0;f--){let d=o.firstChild;for(;d&&d.nodeType!=1;)d=d.nextSibling;if(!d)break;o=d}if(s||(s=(r.someProp("clipboardParser")||r.someProp("domParser")||pr.fromSchema(r.state.schema)).parseSlice(o,{preserveWhitespace:!!(l||c),context:i,ruleFromNode(d){return d.nodeName=="BR"&&!d.nextSibling&&d.parentNode&&!wg.test(d.parentNode.nodeName)?{ignore:!0}:null}})),c)s=xg(hu(s,+c[1],+c[2]),c[4]);else if(s=S.maxOpen(kg(s.content,i),!0),s.openStart||s.openEnd){let f=0,d=0;for(let p=s.content.firstChild;f{s=f(s,r)}),s}const wg=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function kg(r,e){if(r.childCount<2)return r;for(let t=e.depth;t>=0;t--){let i=e.node(t).contentMatchAt(e.index(t)),a,o=[];if(r.forEach(s=>{if(!o)return;let l=i.findWrapping(s.type),u;if(!l)return o=null;if(u=o.length&&a.length&&$d(l,a,s,o[o.length-1],0))o[o.length-1]=u;else{o.length&&(o[o.length-1]=zd(o[o.length-1],a.length));let c=_d(s,l);o.push(c),i=i.matchType(c.type),a=l}}),o)return k.from(o)}return r}function _d(r,e,t=0){for(let n=e.length-1;n>=t;n--)r=e[n].create(null,k.from(r));return r}function $d(r,e,t,n,i){if(i1&&(a=0),i=t&&(s=e<0?o.contentMatchAt(0).fillBefore(s,a<=i).append(s):s.append(o.contentMatchAt(o.childCount).fillBefore(k.empty,!0))),r.replaceChild(e<0?0:r.childCount-1,o.copy(s))}function hu(r,e,t){return e]*>)*/.exec(r);e&&(r=r.slice(e[0].length));let t=Ud().createElement("div"),n=/<([a-z][^>\s]+)/i.exec(r),i;if((i=n&&Vd[n[1].toLowerCase()])&&(r=i.map(a=>"<"+a+">").join("")+r+i.map(a=>"").reverse().join("")),t.innerHTML=r,i)for(let a=0;a=0;s-=2){let l=t.nodes[n[s]];if(!l||l.hasRequiredAttrs())break;i=k.from(l.create(n[s+1],i)),a++,o++}return new S(i,a,o)}const Le={},Ae={},Eg={touchstart:!0,touchmove:!0};class Mg{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function Sg(r){for(let e in Le){let t=Le[e];r.dom.addEventListener(e,r.input.eventHandlers[e]=n=>{Lg(r,n)&&!gs(r,n)&&(r.editable||!(n.type in Ae))&&t(r,n)},Eg[e]?{passive:!0}:void 0)}Oe&&r.dom.addEventListener("input",()=>null),Ho(r)}function _t(r,e){r.input.lastSelectionOrigin=e,r.input.lastSelectionTime=Date.now()}function Og(r){r.domObserver.stop();for(let e in r.input.eventHandlers)r.dom.removeEventListener(e,r.input.eventHandlers[e]);clearTimeout(r.input.composingTimeout),clearTimeout(r.input.lastIOSEnterFallbackTimeout)}function Ho(r){r.someProp("handleDOMEvents",e=>{for(let t in e)r.input.eventHandlers[t]||r.dom.addEventListener(t,r.input.eventHandlers[t]=n=>gs(r,n))})}function gs(r,e){return r.someProp("handleDOMEvents",t=>{let n=t[e.type];return n?n(r,e)||e.defaultPrevented:!1})}function Lg(r,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=r.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function Ag(r,e){!gs(r,e)&&Le[e.type]&&(r.editable||!(e.type in Ae))&&Le[e.type](r,e)}Ae.keydown=(r,e)=>{let t=e;if(r.input.shiftKey=t.keyCode==16||t.shiftKey,!jd(r,t)&&(r.input.lastKeyCode=t.keyCode,r.input.lastKeyCodeTime=Date.now(),!(Ke&&Me&&t.keyCode==13)))if(t.keyCode!=229&&r.domObserver.forceFlush(),Gr&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let n=Date.now();r.input.lastIOSEnter=n,r.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{r.input.lastIOSEnter==n&&(r.someProp("handleKeyDown",i=>i(r,ir(13,"Enter"))),r.input.lastIOSEnter=0)},200)}else r.someProp("handleKeyDown",n=>n(r,t))||bg(r,t)?t.preventDefault():_t(r,"key")};Ae.keyup=(r,e)=>{e.keyCode==16&&(r.input.shiftKey=!1)};Ae.keypress=(r,e)=>{let t=e;if(jd(r,t)||!t.charCode||t.ctrlKey&&!t.altKey||ze&&t.metaKey)return;if(r.someProp("handleKeyPress",i=>i(r,t))){t.preventDefault();return}let n=r.state.selection;if(!(n instanceof $)||!n.$from.sameParent(n.$to)){let i=String.fromCharCode(t.charCode);!/[\r\n]/.test(i)&&!r.someProp("handleTextInput",a=>a(r,n.$from.pos,n.$to.pos,i))&&r.dispatch(r.state.tr.insertText(i).scrollIntoView()),t.preventDefault()}};function na(r){return{left:r.clientX,top:r.clientY}}function Ng(r,e){let t=e.x-r.clientX,n=e.y-r.clientY;return t*t+n*n<100}function ys(r,e,t,n,i){if(n==-1)return!1;let a=r.state.doc.resolve(n);for(let o=a.depth+1;o>0;o--)if(r.someProp(e,s=>o>a.depth?s(r,t,a.nodeAfter,a.before(o),i,!0):s(r,t,a.node(o),a.before(o),i,!1)))return!0;return!1}function Ur(r,e,t){r.focused||r.focus();let n=r.state.tr.setSelection(e);t=="pointer"&&n.setMeta("pointer",!0),r.dispatch(n)}function Dg(r,e){if(e==-1)return!1;let t=r.state.doc.resolve(e),n=t.nodeAfter;return n&&n.isAtom&&B.isSelectable(n)?(Ur(r,new B(t),"pointer"),!0):!1}function Ig(r,e){if(e==-1)return!1;let t=r.state.selection,n,i;t instanceof B&&(n=t.node);let a=r.state.doc.resolve(e);for(let o=a.depth+1;o>0;o--){let s=o>a.depth?a.nodeAfter:a.node(o);if(B.isSelectable(s)){n&&t.$from.depth>0&&o>=t.$from.depth&&a.before(t.$from.depth+1)==t.$from.pos?i=a.before(t.$from.depth):i=a.before(o);break}}return i!=null?(Ur(r,B.create(r.state.doc,i),"pointer"),!0):!1}function Rg(r,e,t,n,i){return ys(r,"handleClickOn",e,t,n)||r.someProp("handleClick",a=>a(r,e,n))||(i?Ig(r,t):Dg(r,t))}function Bg(r,e,t,n){return ys(r,"handleDoubleClickOn",e,t,n)||r.someProp("handleDoubleClick",i=>i(r,e,n))}function Pg(r,e,t,n){return ys(r,"handleTripleClickOn",e,t,n)||r.someProp("handleTripleClick",i=>i(r,e,n))||Hg(r,t,n)}function Hg(r,e,t){if(t.button!=0)return!1;let n=r.state.doc;if(e==-1)return n.inlineContent?(Ur(r,$.create(n,0,n.content.size),"pointer"),!0):!1;let i=n.resolve(e);for(let a=i.depth+1;a>0;a--){let o=a>i.depth?i.nodeAfter:i.node(a),s=i.before(a);if(o.inlineContent)Ur(r,$.create(n,s+1,s+1+o.content.size),"pointer");else if(B.isSelectable(o))Ur(r,B.create(n,s),"pointer");else continue;return!0}}function bs(r){return Li(r)}const Wd=ze?"metaKey":"ctrlKey";Le.mousedown=(r,e)=>{let t=e;r.input.shiftKey=t.shiftKey;let n=bs(r),i=Date.now(),a="singleClick";i-r.input.lastClick.time<500&&Ng(t,r.input.lastClick)&&!t[Wd]&&(r.input.lastClick.type=="singleClick"?a="doubleClick":r.input.lastClick.type=="doubleClick"&&(a="tripleClick")),r.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:a};let o=r.posAtCoords(na(t));o&&(a=="singleClick"?(r.input.mouseDown&&r.input.mouseDown.done(),r.input.mouseDown=new Fg(r,o,t,!!n)):(a=="doubleClick"?Bg:Pg)(r,o.pos,o.inside,t)?t.preventDefault():_t(r,"pointer"))};class Fg{constructor(e,t,n,i){this.view=e,this.pos=t,this.event=n,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[Wd],this.allowDefault=n.shiftKey;let a,o;if(t.inside>-1)a=e.state.doc.nodeAt(t.inside),o=t.inside;else{let c=e.state.doc.resolve(t.pos);a=c.parent,o=c.depth?c.before():0}const s=i?null:n.target,l=s?e.docView.nearestDesc(s,!0):null;this.target=l?l.dom:null;let{selection:u}=e.state;(n.button==0&&a.type.spec.draggable&&a.type.spec.selectable!==!1||u instanceof B&&u.from<=o&&u.to>o)&&(this.mightDrag={node:a,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Ze&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),_t(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>xt(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(na(e))),this.updateAllowDefault(e),this.allowDefault||!t?_t(this.view,"pointer"):Rg(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Oe&&this.mightDrag&&!this.mightDrag.node.isAtom||Me&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Ur(this.view,F.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):_t(this.view,"pointer")}move(e){this.updateAllowDefault(e),_t(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}Le.touchstart=r=>{r.input.lastTouch=Date.now(),bs(r),_t(r,"pointer")};Le.touchmove=r=>{r.input.lastTouch=Date.now(),_t(r,"pointer")};Le.contextmenu=r=>bs(r);function jd(r,e){return r.composing?!0:Oe&&Math.abs(e.timeStamp-r.input.compositionEndedAt)<500?(r.input.compositionEndedAt=-2e8,!0):!1}const qg=Ke?5e3:-1;Ae.compositionstart=Ae.compositionupdate=r=>{if(!r.composing){r.domObserver.flush();let{state:e}=r,t=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(n=>n.type.spec.inclusive===!1)))r.markCursor=r.state.storedMarks||t.marks(),Li(r,!0),r.markCursor=null;else if(Li(r),Ze&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let n=r.domSelectionRange();for(let i=n.focusNode,a=n.focusOffset;i&&i.nodeType==1&&a!=0;){let o=a<0?i.lastChild:i.childNodes[a-1];if(!o)break;if(o.nodeType==3){r.domSelection().collapse(o,o.nodeValue.length);break}else i=o,a=-1}}r.input.composing=!0}Gd(r,qg)};Ae.compositionend=(r,e)=>{r.composing&&(r.input.composing=!1,r.input.compositionEndedAt=e.timeStamp,r.input.compositionPendingChanges=r.domObserver.pendingRecords().length?r.input.compositionID:0,r.input.compositionNode=null,r.input.compositionPendingChanges&&Promise.resolve().then(()=>r.domObserver.flush()),r.input.compositionID++,Gd(r,20))};function Gd(r,e){clearTimeout(r.input.composingTimeout),e>-1&&(r.input.composingTimeout=setTimeout(()=>Li(r),e))}function Kd(r){for(r.composing&&(r.input.composing=!1,r.input.compositionEndedAt=$g());r.input.compositionNodes.length>0;)r.input.compositionNodes.pop().markParentsDirty()}function _g(r){let e=r.domSelectionRange();if(!e.focusNode)return null;let t=Dm(e.focusNode,e.focusOffset),n=Im(e.focusNode,e.focusOffset);if(t&&n&&t!=n){let i=n.pmViewDesc;if(!i||!i.isText(n.nodeValue))return n;if(r.input.compositionNode==n){let a=t.pmViewDesc;if(!(!a||!a.isText(t.nodeValue)))return n}}return t}function $g(){let r=document.createEvent("Event");return r.initEvent("event",!0,!0),r.timeStamp}function Li(r,e=!1){if(!(Ke&&r.domObserver.flushingSoon>=0)){if(r.domObserver.forceFlush(),Kd(r),e||r.docView&&r.docView.dirty){let t=vs(r);return t&&!t.eq(r.state.selection)?r.dispatch(r.state.tr.setSelection(t)):r.updateState(r.state),!0}return!1}}function zg(r,e){if(!r.dom.parentNode)return;let t=r.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let n=getSelection(),i=document.createRange();i.selectNodeContents(e),r.dom.blur(),n.removeAllRanges(),n.addRange(i),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),r.focus()},50)}const Dn=Be&&zt<15||Gr&&qm<604;Le.copy=Ae.cut=(r,e)=>{let t=e,n=r.state.selection,i=t.type=="cut";if(n.empty)return;let a=Dn?null:t.clipboardData,o=n.content(),{dom:s,text:l}=Fd(r,o);a?(t.preventDefault(),a.clearData(),a.setData("text/html",s.innerHTML),a.setData("text/plain",l)):zg(r,s),i&&r.dispatch(r.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Vg(r){return r.openStart==0&&r.openEnd==0&&r.content.childCount==1?r.content.firstChild:null}function Ug(r,e){if(!r.dom.parentNode)return;let t=r.input.shiftKey||r.state.selection.$from.parent.type.spec.code,n=r.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus();let i=r.input.shiftKey&&r.input.lastKeyCode!=45;setTimeout(()=>{r.focus(),n.parentNode&&n.parentNode.removeChild(n),t?In(r,n.value,null,i,e):In(r,n.textContent,n.innerHTML,i,e)},50)}function In(r,e,t,n,i){let a=qd(r,e,t,n,r.state.selection.$from);if(r.someProp("handlePaste",l=>l(r,i,a||S.empty)))return!0;if(!a)return!1;let o=Vg(a),s=o?r.state.tr.replaceSelectionWith(o,n):r.state.tr.replaceSelection(a);return r.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Jd(r){let e=r.getData("text/plain")||r.getData("Text");if(e)return e;let t=r.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}Ae.paste=(r,e)=>{let t=e;if(r.composing&&!Ke)return;let n=Dn?null:t.clipboardData,i=r.input.shiftKey&&r.input.lastKeyCode!=45;n&&In(r,Jd(n),n.getData("text/html"),i,t)?t.preventDefault():Ug(r,t)};class Xd{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}const Yd=ze?"altKey":"ctrlKey";Le.dragstart=(r,e)=>{let t=e,n=r.input.mouseDown;if(n&&n.done(),!t.dataTransfer)return;let i=r.state.selection,a=i.empty?null:r.posAtCoords(na(t)),o;if(!(a&&a.pos>=i.from&&a.pos<=(i instanceof B?i.to-1:i.to))){if(n&&n.mightDrag)o=B.create(r.state.doc,n.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let c=r.docView.nearestDesc(t.target,!0);c&&c.node.type.spec.draggable&&c!=r.docView&&(o=B.create(r.state.doc,c.posBefore))}}let s=(o||r.state.selection).content(),{dom:l,text:u}=Fd(r,s);t.dataTransfer.clearData(),t.dataTransfer.setData(Dn?"Text":"text/html",l.innerHTML),t.dataTransfer.effectAllowed="copyMove",Dn||t.dataTransfer.setData("text/plain",u),r.dragging=new Xd(s,!t[Yd],o)};Le.dragend=r=>{let e=r.dragging;window.setTimeout(()=>{r.dragging==e&&(r.dragging=null)},50)};Ae.dragover=Ae.dragenter=(r,e)=>e.preventDefault();Ae.drop=(r,e)=>{let t=e,n=r.dragging;if(r.dragging=null,!t.dataTransfer)return;let i=r.posAtCoords(na(t));if(!i)return;let a=r.state.doc.resolve(i.pos),o=n&&n.slice;o?r.someProp("transformPasted",h=>{o=h(o,r)}):o=qd(r,Jd(t.dataTransfer),Dn?null:t.dataTransfer.getData("text/html"),!1,a);let s=!!(n&&!t[Yd]);if(r.someProp("handleDrop",h=>h(r,t,o||S.empty,s))){t.preventDefault();return}if(!o)return;t.preventDefault();let l=o?bm(r.state.doc,a.pos,o):a.pos;l==null&&(l=a.pos);let u=r.state.tr;if(s){let{node:h}=n;h?h.replace(u):u.deleteSelection()}let c=u.mapping.map(l),f=o.openStart==0&&o.openEnd==0&&o.content.childCount==1,d=u.doc;if(f?u.replaceRangeWith(c,c,o.content.firstChild):u.replaceRange(c,c,o),u.doc.eq(d))return;let p=u.doc.resolve(c);if(f&&B.isSelectable(o.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(o.content.firstChild))u.setSelection(new B(p));else{let h=u.mapping.map(l);u.mapping.maps[u.mapping.maps.length-1].forEach((v,m,g,w)=>h=w),u.setSelection(ms(r,p,u.doc.resolve(h)))}r.focus(),r.dispatch(u.setMeta("uiEvent","drop"))};Le.focus=r=>{r.input.lastFocus=Date.now(),r.focused||(r.domObserver.stop(),r.dom.classList.add("ProseMirror-focused"),r.domObserver.start(),r.focused=!0,setTimeout(()=>{r.docView&&r.hasFocus()&&!r.domObserver.currentSelection.eq(r.domSelectionRange())&&xt(r)},20))};Le.blur=(r,e)=>{let t=e;r.focused&&(r.domObserver.stop(),r.dom.classList.remove("ProseMirror-focused"),r.domObserver.start(),t.relatedTarget&&r.dom.contains(t.relatedTarget)&&r.domObserver.currentSelection.clear(),r.focused=!1)};Le.beforeinput=(r,e)=>{if(Me&&Ke&&e.inputType=="deleteContentBackward"){r.domObserver.flushSoon();let{domChangeCount:n}=r.input;setTimeout(()=>{if(r.input.domChangeCount!=n||(r.dom.blur(),r.focus(),r.someProp("handleKeyDown",a=>a(r,ir(8,"Backspace")))))return;let{$cursor:i}=r.state.selection;i&&i.pos>0&&r.dispatch(r.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let r in Ae)Le[r]=Ae[r];function Rn(r,e){if(r==e)return!0;for(let t in r)if(r[t]!==e[t])return!1;for(let t in e)if(!(t in r))return!1;return!0}class Ai{constructor(e,t){this.toDOM=e,this.spec=t||cr,this.side=this.spec.side||0}map(e,t,n,i){let{pos:a,deleted:o}=e.mapResult(t.from+i,this.side<0?-1:1);return o?null:new Re(a-n,a-n,this)}valid(){return!0}eq(e){return this==e||e instanceof Ai&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Rn(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Ut{constructor(e,t){this.attrs=e,this.spec=t||cr}map(e,t,n,i){let a=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-n;return a>=o?null:new Re(a,o,this)}valid(e,t){return t.from=e&&(!a||a(s.spec))&&n.push(s.copy(s.from+i,s.to+i))}for(let o=0;oe){let s=this.children[o]+1;this.children[o+2].findInner(e-s,t-s,n,i+s,a)}}map(e,t,n){return this==ke||e.maps.length==0?this:this.mapInner(e,t,0,0,n||cr)}mapInner(e,t,n,i,a){let o;for(let s=0;s{let u=l+n,c;if(c=Zd(t,s,u)){for(i||(i=this.children.slice());as&&f.to=e){this.children[s]==e&&(n=this.children[s+2]);break}let a=e+1,o=a+t.content.size;for(let s=0;sa&&l.type instanceof Ut){let u=Math.max(a,l.from)-a,c=Math.min(o,l.to)-a;ui.map(e,t,cr));return Pt.from(n)}forChild(e,t){if(t.isLeaf)return Q.empty;let n=[];for(let i=0;it instanceof Q)?e:e.reduce((t,n)=>t.concat(n instanceof Q?n:n.members),[]))}}}function Wg(r,e,t,n,i,a,o){let s=r.slice();for(let u=0,c=a;u{let m=v-h-(p-d);for(let g=0;gw+c-f)continue;let C=s[g]+c-f;p>=C?s[g+1]=d<=C?-2:-1:d>=c&&m&&(s[g]+=m,s[g+1]+=m)}f+=m}),c=t.maps[u].map(c,-1)}let l=!1;for(let u=0;u=n.content.size){l=!0;continue}let d=t.map(r[u+1]+a,-1),p=d-i,{index:h,offset:v}=n.content.findIndex(f),m=n.maybeChild(h);if(m&&v==f&&v+m.nodeSize==p){let g=s[u+2].mapInner(t,m,c+1,r[u]+a+1,o);g!=ke?(s[u]=f,s[u+1]=p,s[u+2]=g):(s[u+1]=-2,l=!0)}else l=!0}if(l){let u=jg(s,r,e,t,i,a,o),c=Ni(u,n,0,o);e=c.local;for(let f=0;ft&&o.to{let u=Zd(r,s,l+t);if(u){a=!0;let c=Ni(u,s,t+l+1,n);c!=ke&&i.push(l,l+s.nodeSize,c)}});let o=Qd(a?eh(r):r,-t).sort(fr);for(let s=0;s0;)e++;r.splice(e,0,t)}function ja(r){let e=[];return r.someProp("decorations",t=>{let n=t(r.state);n&&n!=ke&&e.push(n)}),r.cursorWrapper&&e.push(Q.create(r.state.doc,[r.cursorWrapper.deco])),Pt.from(e)}const Gg={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Kg=Be&&zt<=11;class Jg{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class Xg{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Jg,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(n=>{for(let i=0;ii.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),Kg&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Gg)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;tthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(su(this.view)){if(this.suppressingSelectionUpdates)return xt(this.view);if(Be&&zt<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&vr(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let a=e.focusNode;a;a=Nn(a))t.add(a);for(let a=e.anchorNode;a;a=Nn(a))if(t.has(a)){n=a;break}let i=n&&this.view.docView.nearestDesc(n);if(i&&i.ignoreMutation({type:"selection",target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&su(e)&&!this.ignoreSelectionChange(n),a=-1,o=-1,s=!1,l=[];if(e.editable)for(let c=0;c1){let c=l.filter(f=>f.nodeName=="BR");if(c.length==2){let f=c[0],d=c[1];f.parentNode&&f.parentNode.parentNode==d.parentNode?d.remove():f.remove()}}let u=null;a<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||i)&&(a>-1&&(e.docView.markDirty(a,o),Yg(e)),this.handleDOMChange(a,o,s,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||xt(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(n==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!n||n.ignoreMutation(e))return null;if(e.type=="childList"){for(let c=0;ci;m--){let g=n.childNodes[m-1],w=g.pmViewDesc;if(g.nodeName=="BR"&&!w){a=m;break}if(!w||w.size)break}let f=r.state.doc,d=r.someProp("domParser")||pr.fromSchema(r.state.schema),p=f.resolve(o),h=null,v=d.parse(n,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:a,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:ey,context:p});if(u&&u[0].pos!=null){let m=u[0].pos,g=u[1]&&u[1].pos;g==null&&(g=m),h={anchor:m+o,head:g+o}}return{doc:v,sel:h,from:o,to:s}}function ey(r){let e=r.pmViewDesc;if(e)return e.parseRule();if(r.nodeName=="BR"&&r.parentNode){if(Oe&&/^(ul|ol)$/i.test(r.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}else if(r.parentNode.lastChild==r||Oe&&/^(tr|table)$/i.test(r.parentNode.nodeName))return{ignore:!0}}else if(r.nodeName=="IMG"&&r.getAttribute("mark-placeholder"))return{ignore:!0};return null}const ty=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function ry(r,e,t,n,i){let a=r.input.compositionPendingChanges||(r.composing?r.input.compositionID:0);if(r.input.compositionPendingChanges=0,e<0){let A=r.input.lastSelectionTime>Date.now()-50?r.input.lastSelectionOrigin:null,V=vs(r,A);if(V&&!r.state.selection.eq(V)){if(Me&&Ke&&r.input.lastKeyCode===13&&Date.now()-100De(r,ir(13,"Enter"))))return;let X=r.state.tr.setSelection(V);A=="pointer"?X.setMeta("pointer",!0):A=="key"&&X.scrollIntoView(),a&&X.setMeta("composition",a),r.dispatch(X)}return}let o=r.state.doc.resolve(e),s=o.sharedDepth(t);e=o.before(s+1),t=r.state.doc.resolve(t).after(s+1);let l=r.state.selection,u=Zg(r,e,t),c=r.state.doc,f=c.slice(u.from,u.to),d,p;r.input.lastKeyCode===8&&Date.now()-100Date.now()-225||Ke)&&i.some(A=>A.nodeType==1&&!ty.test(A.nodeName))&&(!h||h.endA>=h.endB)&&r.someProp("handleKeyDown",A=>A(r,ir(13,"Enter")))){r.input.lastIOSEnter=0;return}if(!h)if(n&&l instanceof $&&!l.empty&&l.$head.sameParent(l.$anchor)&&!r.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))h={start:l.from,endA:l.to,endB:l.to};else{if(u.sel){let A=bu(r,r.state.doc,u.sel);if(A&&!A.eq(r.state.selection)){let V=r.state.tr.setSelection(A);a&&V.setMeta("composition",a),r.dispatch(V)}}return}r.input.domChangeCount++,r.state.selection.fromr.state.selection.from&&h.start<=r.state.selection.from+2&&r.state.selection.from>=u.from?h.start=r.state.selection.from:h.endA=r.state.selection.to-2&&r.state.selection.to<=u.to&&(h.endB+=r.state.selection.to-h.endA,h.endA=r.state.selection.to)),Be&&zt<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>u.from&&u.doc.textBetween(h.start-u.from-1,h.start-u.from+1)=="  "&&(h.start--,h.endA--,h.endB--);let v=u.doc.resolveNoCache(h.start-u.from),m=u.doc.resolveNoCache(h.endB-u.from),g=c.resolve(h.start),w=v.sameParent(m)&&v.parent.inlineContent&&g.end()>=h.endA,C;if((Gr&&r.input.lastIOSEnter>Date.now()-225&&(!w||i.some(A=>A.nodeName=="DIV"||A.nodeName=="P"))||!w&&v.posA(r,ir(13,"Enter")))){r.input.lastIOSEnter=0;return}if(r.state.selection.anchor>h.start&&iy(c,h.start,h.endA,v,m)&&r.someProp("handleKeyDown",A=>A(r,ir(8,"Backspace")))){Ke&&Me&&r.domObserver.suppressSelectionUpdates();return}Me&&Ke&&h.endB==h.start&&(r.input.lastAndroidDelete=Date.now()),Ke&&!w&&v.start()!=m.start()&&m.parentOffset==0&&v.depth==m.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==h.endA&&(h.endB-=2,m=u.doc.resolveNoCache(h.endB-u.from),setTimeout(()=>{r.someProp("handleKeyDown",function(A){return A(r,ir(13,"Enter"))})},20));let T=h.start,x=h.endA,M,D,R;if(w){if(v.pos==m.pos)Be&&zt<=11&&v.parentOffset==0&&(r.domObserver.suppressSelectionUpdates(),setTimeout(()=>xt(r),20)),M=r.state.tr.delete(T,x),D=c.resolve(h.start).marksAcross(c.resolve(h.endA));else if(h.endA==h.endB&&(R=ny(v.parent.content.cut(v.parentOffset,m.parentOffset),g.parent.content.cut(g.parentOffset,h.endA-g.start()))))M=r.state.tr,R.type=="add"?M.addMark(T,x,R.mark):M.removeMark(T,x,R.mark);else if(v.parent.child(v.index()).isText&&v.index()==m.index()-(m.textOffset?0:1)){let A=v.parent.textBetween(v.parentOffset,m.parentOffset);if(r.someProp("handleTextInput",V=>V(r,T,x,A)))return;M=r.state.tr.insertText(A,T,x)}}if(M||(M=r.state.tr.replace(T,x,u.doc.slice(h.start-u.from,h.endB-u.from))),u.sel){let A=bu(r,M.doc,u.sel);A&&!(Me&&Ke&&r.composing&&A.empty&&(h.start!=h.endB||r.input.lastAndroidDeletee.content.size?null:ms(r,e.resolve(t.anchor),e.resolve(t.head))}function ny(r,e){let t=r.firstChild.marks,n=e.firstChild.marks,i=t,a=n,o,s,l;for(let c=0;cc.mark(s.addToSet(c.marks));else if(i.length==0&&a.length==1)s=a[0],o="remove",l=c=>c.mark(s.removeFromSet(c.marks));else return null;let u=[];for(let c=0;ct||Ga(o,!0,!1)0&&(e||r.indexAfter(n)==r.node(n).childCount);)n--,i++,e=!1;if(t){let a=r.node(n).maybeChild(r.indexAfter(n));for(;a&&!a.isLeaf;)a=a.firstChild,i++}return i}function ay(r,e,t,n,i){let a=r.findDiffStart(e,t);if(a==null)return null;let{a:o,b:s}=r.findDiffEnd(e,t+r.size,t+e.size);if(i=="end"){let l=Math.max(0,a-Math.min(o,s));n-=o+l-a}if(o=o?a-n:0;a-=l,a&&a=s?a-n:0;a-=l,a&&a=56320&&e<=57343&&t>=55296&&t<=56319}class Cs{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Mg,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Eu),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Tu(this),Cu(this),this.nodeViews=xu(this),this.docView=tu(this.state.doc,ku(this),ja(this),this.dom,this),this.domObserver=new Xg(this,(n,i,a,o)=>ry(this,n,i,a,o)),this.domObserver.start(),Sg(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Ho(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Eu),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let n in this._props)t[n]=this._props[n];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var n;let i=this.state,a=!1,o=!1;e.storedMarks&&this.composing&&(Kd(this),o=!0),this.state=e;let s=i.plugins!=e.plugins||this._props.plugins!=t.plugins;if(s||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let p=xu(this);sy(p,this.nodeViews)&&(this.nodeViews=p,a=!0)}(s||t.handleDOMEvents!=this._props.handleDOMEvents)&&Ho(this),this.editable=Tu(this),Cu(this);let l=ja(this),u=ku(this),c=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",f=a||!this.docView.matchesNode(e.doc,u,l);(f||!e.selection.eq(i.selection))&&(o=!0);let d=c=="preserve"&&o&&this.dom.style.overflowAnchor==null&&zm(this);if(o){this.domObserver.stop();let p=f&&(Be||Me)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&oy(i.selection,e.selection);if(f){let h=Me?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=_g(this)),(a||!this.docView.update(e.doc,u,l,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=tu(e.doc,u,l,this.dom,this)),h&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&dg(this))?xt(this,p):(Bd(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((n=this.dragging)===null||n===void 0)&&n.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():d&&Vm(d)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof B){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&Jl(this,t.getBoundingClientRect(),e)}else Jl(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;t0&&this.state.doc.nodeAt(a))==n.node&&(i=a)}this.dragging=new Xd(e.slice,e.move,i<0?void 0:B.create(this.state.doc,i))}someProp(e,t){let n=this._props&&this._props[e],i;if(n!=null&&(i=t?t(n):n))return i;for(let o=0;ot.ownerDocument.getSelection()),this._root=t}return e||document}updateRoot(){this._root=null}posAtCoords(e){return Jm(this,e)}coordsAtPos(e,t=1){return Sd(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let i=this.docView.posFromDOM(e,t,n);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,t){return eg(this,t||this.state,e)}pasteHTML(e,t){return In(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return In(this,e,null,!0,t||new ClipboardEvent("paste"))}destroy(){this.docView&&(Og(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],ja(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Am())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Ag(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return Oe&&this.root.nodeType===11&&Bm(this.dom.ownerDocument)==this.dom&&Qg(this,e)||e}domSelection(){return this.root.getSelection()}}function ku(r){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(r.editable),r.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(r.state)),t)for(let n in t)n=="class"?e.class+=" "+t[n]:n=="style"?e.style=(e.style?e.style+";":"")+t[n]:!e[n]&&n!="contenteditable"&&n!="nodeName"&&(e[n]=String(t[n]))}),e.translate||(e.translate="no"),[Re.node(0,r.state.doc.content.size,e)]}function Cu(r){if(r.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),r.cursorWrapper={dom:e,deco:Re.widget(r.state.selection.head,e,{raw:!0,marks:r.markCursor})}}else r.cursorWrapper=null}function Tu(r){return!r.someProp("editable",e=>e(r.state)===!1)}function oy(r,e){let t=Math.min(r.$anchor.sharedDepth(r.head),e.$anchor.sharedDepth(e.head));return r.$anchor.start(t)!=e.$anchor.start(t)}function xu(r){let e=Object.create(null);function t(n){for(let i in n)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=n[i])}return r.someProp("nodeViews",t),r.someProp("markViews",t),e}function sy(r,e){let t=0,n=0;for(let i in r){if(r[i]!=e[i])return!0;t++}for(let i in e)n++;return t!=n}function Eu(r){if(r.spec.state||r.spec.filterTransaction||r.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Kt={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Di={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},ly=typeof navigator<"u"&&/Mac/.test(navigator.platform),uy=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var de=0;de<10;de++)Kt[48+de]=Kt[96+de]=String(de);for(var de=1;de<=24;de++)Kt[de+111]="F"+de;for(var de=65;de<=90;de++)Kt[de]=String.fromCharCode(de+32),Di[de]=String.fromCharCode(de);for(var Ka in Kt)Di.hasOwnProperty(Ka)||(Di[Ka]=Kt[Ka]);function cy(r){var e=ly&&r.metaKey&&r.shiftKey&&!r.ctrlKey&&!r.altKey||uy&&r.shiftKey&&r.key&&r.key.length==1||r.key=="Unidentified",t=!e&&r.key||(r.shiftKey?Di:Kt)[r.keyCode]||r.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const fy=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function dy(r){let e=r.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let n,i,a,o;for(let s=0;s127)&&(a=Kt[n.keyCode])&&a!=i){let s=e[Ja(a,n)];if(s&&s(t.state,t.dispatch,t))return!0}}return!1}}const Ts=(r,e)=>r.selection.empty?!1:(e&&e(r.tr.deleteSelection().scrollIntoView()),!0);function vy(r,e){let{$cursor:t}=r.selection;return!t||(e?!e.endOfTextblock("backward",r):t.parentOffset>0)?null:t}const my=(r,e,t)=>{let n=vy(r,t);if(!n)return!1;let i=th(n);if(!i){let o=n.blockRange(),s=o&&Zi(o);return s==null?!1:(e&&e(r.tr.lift(o,s).scrollIntoView()),!0)}let a=i.nodeBefore;if(!a.type.spec.isolating&&oh(r,i,e))return!0;if(n.parent.content.size==0&&(Kr(a,"end")||B.isSelectable(a))){let o=ds(r.doc,n.before(),n.after(),S.empty);if(o&&o.slice.size{let{$head:n,empty:i}=r.selection,a=n;if(!i)return!1;if(n.parent.isTextblock){if(t?!t.endOfTextblock("backward",r):n.parentOffset>0)return!1;a=th(n)}let o=a&&a.nodeBefore;return!o||!B.isSelectable(o)?!1:(e&&e(r.tr.setSelection(B.create(r.doc,a.pos-o.nodeSize)).scrollIntoView()),!0)};function th(r){if(!r.parent.type.spec.isolating)for(let e=r.depth-1;e>=0;e--){if(r.index(e)>0)return r.doc.resolve(r.before(e+1));if(r.node(e).type.spec.isolating)break}return null}function yy(r,e){let{$cursor:t}=r.selection;return!t||(e?!e.endOfTextblock("forward",r):t.parentOffset{let n=yy(r,t);if(!n)return!1;let i=nh(n);if(!i)return!1;let a=i.nodeAfter;if(oh(r,i,e))return!0;if(n.parent.content.size==0&&(Kr(a,"start")||B.isSelectable(a))){let o=ds(r.doc,n.before(),n.after(),S.empty);if(o&&o.slice.size{let{$head:n,empty:i}=r.selection,a=n;if(!i)return!1;if(n.parent.isTextblock){if(t?!t.endOfTextblock("forward",r):n.parentOffset=0;e--){let t=r.node(e);if(r.index(e)+1{let{$head:t,$anchor:n}=r.selection;return!t.parent.type.spec.code||!t.sameParent(n)?!1:(e&&e(r.tr.insertText(` +`).scrollIntoView()),!0)};function xs(r){for(let e=0;e{let{$head:t,$anchor:n}=r.selection;if(!t.parent.type.spec.code||!t.sameParent(n))return!1;let i=t.node(-1),a=t.indexAfter(-1),o=xs(i.contentMatchAt(a));if(!o||!i.canReplaceWith(a,a,o))return!1;if(e){let s=t.after(),l=r.tr.replaceWith(s,s,o.createAndFill());l.setSelection(F.near(l.doc.resolve(s),1)),e(l.scrollIntoView())}return!0},wy=(r,e)=>{let t=r.selection,{$from:n,$to:i}=t;if(t instanceof Se||n.parent.inlineContent||i.parent.inlineContent)return!1;let a=xs(i.parent.contentMatchAt(i.indexAfter()));if(!a||!a.isTextblock)return!1;if(e){let o=(!n.parentOffset&&i.index(){let{$cursor:t}=r.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let a=t.before();if(zr(r.doc,a))return e&&e(r.tr.split(a).scrollIntoView()),!0}let n=t.blockRange(),i=n&&Zi(n);return i==null?!1:(e&&e(r.tr.lift(n,i).scrollIntoView()),!0)};function Cy(r){return(e,t)=>{let{$from:n,$to:i}=e.selection;if(e.selection instanceof B&&e.selection.node.isBlock)return!n.parentOffset||!zr(e.doc,n.pos)?!1:(t&&t(e.tr.split(n.pos).scrollIntoView()),!0);if(!n.parent.isBlock)return!1;if(t){let a=i.parentOffset==i.parent.content.size,o=e.tr;(e.selection instanceof $||e.selection instanceof Se)&&o.deleteSelection();let s=n.depth==0?null:xs(n.node(-1).contentMatchAt(n.indexAfter(-1))),l=r&&r(i.parent,a),u=l?[l]:a&&s?[{type:s}]:void 0,c=zr(o.doc,o.mapping.map(n.pos),1,u);if(!u&&!c&&zr(o.doc,o.mapping.map(n.pos),1,s?[{type:s}]:void 0)&&(s&&(u=[{type:s}]),c=!0),c&&(o.split(o.mapping.map(n.pos),1,u),!a&&!n.parentOffset&&n.parent.type!=s)){let f=o.mapping.map(n.before()),d=o.doc.resolve(f);s&&n.node(-1).canReplaceWith(d.index(),d.index()+1,s)&&o.setNodeMarkup(o.mapping.map(n.before()),s)}t(o.scrollIntoView())}return!0}}const Ty=Cy(),ah=(r,e)=>(e&&e(r.tr.setSelection(new Se(r.doc))),!0);function xy(r,e,t){let n=e.nodeBefore,i=e.nodeAfter,a=e.index();return!n||!i||!n.type.compatibleContent(i.type)?!1:!n.content.size&&e.parent.canReplace(a-1,a)?(t&&t(r.tr.delete(e.pos-n.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(a,a+1)||!(i.isTextblock||pd(r.doc,e.pos))?!1:(t&&t(r.tr.clearIncompatible(e.pos,n.type,n.contentMatchAt(n.childCount)).join(e.pos).scrollIntoView()),!0)}function oh(r,e,t){let n=e.nodeBefore,i=e.nodeAfter,a,o;if(n.type.spec.isolating||i.type.spec.isolating)return!1;if(xy(r,e,t))return!0;let s=e.parent.canReplace(e.index(),e.index()+1);if(s&&(a=(o=n.contentMatchAt(n.childCount)).findWrapping(i.type))&&o.matchType(a[0]||i.type).validEnd){if(t){let f=e.pos+i.nodeSize,d=k.empty;for(let v=a.length-1;v>=0;v--)d=k.from(a[v].create(null,d));d=k.from(n.copy(d));let p=r.tr.step(new ae(e.pos-1,f,e.pos,f,new S(d,1,0),a.length,!0)),h=f+2*a.length;pd(p.doc,h)&&p.join(h),t(p.scrollIntoView())}return!0}let l=F.findFrom(e,1),u=l&&l.$from.blockRange(l.$to),c=u&&Zi(u);if(c!=null&&c>=e.depth)return t&&t(r.tr.lift(u,c).scrollIntoView()),!0;if(s&&Kr(i,"start",!0)&&Kr(n,"end")){let f=n,d=[];for(;d.push(f),!f.isTextblock;)f=f.lastChild;let p=i,h=1;for(;!p.isTextblock;p=p.firstChild)h++;if(f.canReplace(f.childCount,f.childCount,p.content)){if(t){let v=k.empty;for(let g=d.length-1;g>=0;g--)v=k.from(d[g].copy(v));let m=r.tr.step(new ae(e.pos-d.length,e.pos+i.nodeSize,e.pos+h,e.pos+i.nodeSize-h,new S(v,d.length,0),0,!0));t(m.scrollIntoView())}return!0}}return!1}function sh(r){return function(e,t){let n=e.selection,i=r<0?n.$from:n.$to,a=i.depth;for(;i.node(a).isInline;){if(!a)return!1;a--}return i.node(a).isTextblock?(t&&t(e.tr.setSelection($.create(e.doc,r<0?i.start(a):i.end(a)))),!0):!1}}const Ey=sh(-1),My=sh(1);function Sy(r,e=null){return function(t,n){let{$from:i,$to:a}=t.selection,o=i.blockRange(a),s=o&&lm(o,r,e);return s?(n&&n(t.tr.wrap(o,s).scrollIntoView()),!0):!1}}function Ms(r,e=null){return function(t,n){let i=!1;for(let a=0;a{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(r,e)))if(l.type==r)i=!0;else{let c=t.doc.resolve(u),f=c.index();i=c.parent.canReplaceWith(f,f+1,r)}})}if(!i)return!1;if(n){let a=t.tr;for(let o=0;o{if(o)return!1;o=s.inlineContent&&s.type.allowsMarkType(t)}),o)return!0}return!1}function zn(r,e=null){return function(t,n){let{empty:i,$cursor:a,ranges:o}=t.selection;if(i&&!a||!Oy(t.doc,o,r))return!1;if(n)if(a)r.isInSet(t.storedMarks||a.marks())?n(t.tr.removeStoredMark(r)):n(t.tr.addStoredMark(r.create(e)));else{let s=!1,l=t.tr;for(let u=0;!s&&u0&&(a=t[0].slice(o-s,o)+a,n=i)}return e.tr.insertText(a,n,i)}}const Ny=500;function uh({rules:r}){let e=new He({state:{init(){return null},apply(t,n){let i=t.getMeta(this);return i||(t.selectionSet||t.docChanged?null:n)}},props:{handleTextInput(t,n,i,a){return Ou(t,n,i,a,r,e)},handleDOMEvents:{compositionend:t=>{setTimeout(()=>{let{$cursor:n}=t.state.selection;n&&Ou(t,n.pos,n.pos,"",r,e)})}}},isInputRules:!0});return e}function Ou(r,e,t,n,i,a){if(r.composing)return!1;let o=r.state,s=o.doc.resolve(e),l=s.parent.textBetween(Math.max(0,s.parentOffset-Ny),s.parentOffset,null,"")+n;for(let u=0;u{let t=r.plugins;for(let n=0;n=0;l--)o.step(s.steps[l].invert(s.docs[l]));if(a.text){let l=o.doc.resolve(a.from).marks();o.replaceWith(a.from,a.to,r.schema.text(a.text,l))}else o.delete(a.from,a.to);e(o)}return!0}}return!1};new Yt(/--$/,"—");new Yt(/\.\.\.$/,"…");new Yt(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“");new Yt(/"$/,"”");new Yt(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘");new Yt(/'$/,"’");var Ii=200,oe=function(){};oe.prototype.append=function(e){return e.length?(e=oe.from(e),!this.length&&e||e.length=t?oe.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))};oe.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};oe.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)};oe.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var i=[];return this.forEach(function(a,o){return i.push(e(a,o))},t,n),i};oe.from=function(e){return e instanceof oe?e:e&&e.length?new ch(e):oe.empty};var ch=function(r){function e(n){r.call(this),this.values=n}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,a){return i==0&&a==this.length?this:new e(this.values.slice(i,a))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,a,o,s){for(var l=a;l=o;l--)if(i(this.values[l],s+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Ii)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Ii)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(oe);oe.empty=new ch([]);var Iy=function(r){function e(t,n){r.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return ns&&this.right.forEachInner(n,Math.max(i-s,0),Math.min(this.length,a)-s,o+s)===!1)return!1},e.prototype.forEachInvertedInner=function(n,i,a,o){var s=this.left.length;if(i>s&&this.right.forEachInvertedInner(n,i-s,Math.max(a,s)-s,o+s)===!1||a=a?this.right.slice(n-a,i-a):this.left.slice(n,a).append(this.right.slice(0,i-a))},e.prototype.leafAppend=function(n){var i=this.right.leafAppend(n);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(n){var i=this.left.leafPrepend(n);if(i)return new e(i,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e}(oe);const Ry=500;class Je{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let n=this.items.length;for(;;n--)if(this.items.get(n-1).selection){--n;break}let i,a;t&&(i=this.remapping(n,this.items.length),a=i.maps.length);let o=e.tr,s,l,u=[],c=[];return this.items.forEach((f,d)=>{if(!f.step){i||(i=this.remapping(n,d+1),a=i.maps.length),a--,c.push(f);return}if(i){c.push(new at(f.map));let p=f.step.map(i.slice(a)),h;p&&o.maybeStep(p).doc&&(h=o.mapping.maps[o.mapping.maps.length-1],u.push(new at(h,void 0,void 0,u.length+c.length))),a--,h&&i.appendMap(h,a)}else o.maybeStep(f.step);if(f.selection)return s=i?f.selection.map(i.slice(a)):f.selection,l=new Je(this.items.slice(0,n).append(c.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:o,selection:s}}addTransform(e,t,n,i){let a=[],o=this.eventCount,s=this.items,l=!i&&s.length?s.get(s.length-1):null;for(let c=0;cPy&&(s=By(s,u),o-=u),new Je(s.append(a),o)}remapping(e,t){let n=new $r;return this.items.forEach((i,a)=>{let o=i.mirrorOffset!=null&&a-i.mirrorOffset>=e?n.maps.length-i.mirrorOffset:void 0;n.appendMap(i.map,o)},e,t),n}addMaps(e){return this.eventCount==0?this:new Je(this.items.append(e.map(t=>new at(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],i=Math.max(0,this.items.length-t),a=e.mapping,o=e.steps.length,s=this.eventCount;this.items.forEach(d=>{d.selection&&s--},i);let l=t;this.items.forEach(d=>{let p=a.getMirror(--l);if(p==null)return;o=Math.min(o,p);let h=a.maps[p];if(d.step){let v=e.steps[p].invert(e.docs[p]),m=d.selection&&d.selection.map(a.slice(l+1,p));m&&s++,n.push(new at(h,v,m))}else n.push(new at(h))},i);let u=[];for(let d=t;dRy&&(f=f.compress(this.items.length-n.length)),f}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,i=[],a=0;return this.items.forEach((o,s)=>{if(s>=e)i.push(o),o.selection&&a++;else if(o.step){let l=o.step.map(t.slice(n)),u=l&&l.getMap();if(n--,u&&t.appendMap(u,n),l){let c=o.selection&&o.selection.map(t.slice(n));c&&a++;let f=new at(u.invert(),l,c),d,p=i.length-1;(d=i.length&&i[p].merge(f))?i[p]=d:i.push(f)}}else o.map&&n--},this.items.length,0),new Je(oe.from(i.reverse()),a)}}Je.empty=new Je(oe.empty,0);function By(r,e){let t;return r.forEach((n,i)=>{if(n.selection&&e--==0)return t=i,!1}),r.slice(t)}class at{constructor(e,t,n,i){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new at(t.getMap().invert(),t,this.selection)}}}class Bt{constructor(e,t,n,i,a){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=i,this.prevComposition=a}}const Py=20;function Hy(r,e,t,n){let i=t.getMeta(Wt),a;if(i)return i.historyState;t.getMeta(_y)&&(r=new Bt(r.done,r.undone,null,0,-1));let o=t.getMeta("appendedTransaction");if(t.steps.length==0)return r;if(o&&o.getMeta(Wt))return o.getMeta(Wt).redo?new Bt(r.done.addTransform(t,void 0,n,hi(e)),r.undone,Lu(t.mapping.maps[t.steps.length-1]),r.prevTime,r.prevComposition):new Bt(r.done,r.undone.addTransform(t,void 0,n,hi(e)),null,r.prevTime,r.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let s=t.getMeta("composition"),l=r.prevTime==0||!o&&r.prevComposition!=s&&(r.prevTime<(t.time||0)-n.newGroupDelay||!Fy(t,r.prevRanges)),u=o?Ya(r.prevRanges,t.mapping):Lu(t.mapping.maps[t.steps.length-1]);return new Bt(r.done.addTransform(t,l?e.selection.getBookmark():void 0,n,hi(e)),Je.empty,u,t.time,s??r.prevComposition)}else return(a=t.getMeta("rebased"))?new Bt(r.done.rebased(t,a),r.undone.rebased(t,a),Ya(r.prevRanges,t.mapping),r.prevTime,r.prevComposition):new Bt(r.done.addMaps(t.mapping.maps),r.undone.addMaps(t.mapping.maps),Ya(r.prevRanges,t.mapping),r.prevTime,r.prevComposition)}function Fy(r,e){if(!e)return!1;if(!r.docChanged)return!0;let t=!1;return r.mapping.maps[0].forEach((n,i)=>{for(let a=0;a=e[a]&&(t=!0)}),t}function Lu(r){let e=[];return r.forEach((t,n,i,a)=>e.push(i,a)),e}function Ya(r,e){if(!r)return null;let t=[];for(let n=0;n{let i=Wt.getState(t);if(!i||(r?i.undone:i.done).eventCount==0)return!1;if(n){let a=qy(i,t,r);a&&n(e?a.scrollIntoView():a)}return!0}}const Sn=dh(!1,!0),Ss=dh(!0,!0);function $y(r){let e=Wt.getState(r);return e?e.done.eventCount:0}/** + * @toast-ui/editor + * @version 3.2.2 | Fri Feb 17 2023 + * @author NHN Cloud FE Development Lab + * @license MIT + *//*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var Fo=function(r,e){return Fo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},Fo(r,e)};function O(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Fo(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var b=function(){return b=Object.assign||function(e){for(var t,n=1,i=arguments.length;n=0&&nTb}function Eb(r,e){var t="https://www.google-analytics.com/collect",n=location.hostname,i="event",a="use",o="TOAST UI "+r+" for "+n+": Statistics",s=window.localStorage.getItem(o);!kb(window.tui)&&window.tui.usageStatistics===!1||s&&!xb(s)||(window.localStorage.setItem(o,new Date().getTime()),setTimeout(function(){(document.readyState==="interactive"||document.readyState==="complete")&&Cb(t,{v:1,t:i,tid:e,cid:n,dp:n,dh:r,el:r,ec:a})},1e3))}var Mb=Eb,Sb=/[\u0020]+/g,Ob=/[>(){}[\]+-.!#|]/g,Iu=/<([a-zA-Z_][a-zA-Z0-9\-._]*)(\s|[^\\>])*\/?>|<(\/)([a-zA-Z_][a-zA-Z0-9\-._]*)\s*\/?>||<([a-zA-Z_][a-zA-Z0-9\-.:/]*)>/g,Ru=/\\[!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~\\]/g,Lb=/[*_~`]/g,Bu=/!\[.*\]\(.*\)/g,Ab=/[[\]]/g,Pu=/(?:^|[^\\])\\(?!\\)/g,Nb='[&<>"]',Hu=new RegExp(Nb,"g");function Db(r){switch(r){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";default:return r}}function qr(r){return Hu.test(r)?r.replace(Hu,Db):r}function Ib(){Mb("editor","UA-129966929-1")}function pe(r,e){return r.indexOf(e)!==-1}var Rb=["rel","target","hreflang","type"],Bb={codeblock:/(^ {4}[^\n]+\n*)+/,thematicBreak:/^ *((\* *){3,}|(- *){3,} *|(_ *){3,}) */,atxHeading:/^(#{1,6}) +[\s\S]+/,seTextheading:/^([^\n]+)\n *(=|-){2,} */,blockquote:/^( *>[^\n]+.*)+/,list:/^ *(\*+|-+|\d+\.) [\s\S]+/,def:/^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? */,link:/!?\[.*\]\(.*\)/,reflink:/!?\[.*\]\s*\[([^\]]*)\]/,verticalBar:/\u007C/,fencedCodeblock:/^((`|~){3,})/};function ph(r){if(!r)return null;var e={};return Rb.forEach(function(t){et(r[t])||(e[t]=r[t])}),e}function Bi(r,e){for(var t="",n=0;no[0]&&i=e&&r<=t}function Ns(r){return typeof r=="object"&&r!==null}function Hi(r,e){var t=b({},r);return r&&e&&Object.keys(e).forEach(function(n){Ns(t[n])?Array.isArray(e[n])?t[n]=Ds(e[n]):t.hasOwnProperty(n)?t[n]=Hi(t[n],e[n]):t[n]=Is(e[n]):t[n]=e[n]}),t}function Ds(r){return r.map(function(e){return Ns(e)?Array.isArray(e)?Ds(e):Is(e):e})}function Is(r){var e=Object.keys(r);return e.length?e.reduce(function(t,n){return Ns(r[n])?t[n]=Array.isArray(r[n])?Ds(r[n]):Is(r[n]):t[n]=r[n],t},{}):r}function Rs(r,e){return e===void 0&&(e={}),Object.keys(e).forEach(function(t){r.hasOwnProperty(t)&&typeof r[t]=="object"?Array.isArray(e[t])?r[t]=e[t]:Rs(r[t],e[t]):r[t]=e[t]}),r}function Fu(r,e){return r>e?[e,r]:[r,e]}var _b=Xr;function $b(r){var e;try{e=Array.prototype.slice.call(r)}catch{e=[],_b(r,function(n){e.push(n)})}return e}var ht=$b;function Fi(r,e){var t=r.nodes.paragraph;return e?t.create(null,Ot(e)?r.text(e):e):t.createAndFill()}function he(r,e,t){return r.text(e,t)}function K(r,e,t){t===void 0&&(t=e);var n=r.doc.content.size,i=n>0?n-1:1;return $.create(r.doc,Math.min(e,i),Math.min(t,i))}function Bs(r,e,t){var n=e.pos;return r.replaceWith(n,n,Fi(t)),r.setSelection(K(r,n+1))}function qi(r){for(var e=r.state,t=r.from,n=r.startIndex,i=r.endIndex,a=r.createText,o=e.tr,s=e.doc,l=e.schema,u=n;u<=i;u+=1){var c=s.child(u),f=c.nodeSize,d=c.textContent,p=c.content,h=a(d),v=h?he(l,h):k.empty,m=o.mapping.map(t),g=m+p.size;o.replaceWith(m,g,v),t+=f}return o}function Ps(r,e,t,n){var i=t.length;r.split(e).delete(e-i,e).insert(r.mapping.map(e),n).setSelection(K(r,r.mapping.map(e)-i))}function Vn(r){return r.sourcepos[0][0]}function oa(r){return r.sourcepos[1][0]}function sa(r){return r.sourcepos[0][1]}function jt(r){return r.sourcepos[1][1]}function zb(r){var e=r.type;return e==="htmlBlock"||e==="htmlInline"}function Vb(r){var e=r.type;return e==="strike"||e==="strong"||e==="emph"||e==="code"||e==="link"||e==="image"}function Ub(r){return r&&r.type==="codeBlock"}function yr(r){return r&&(r.type==="item"||r.type==="list")}function vh(r){return yr(r)&&r.listData.type==="ordered"}function Wb(r){return yr(r)&&r.listData.type!=="ordered"}function qu(r){return r&&(r.type==="tableCell"||r.type==="tableDelimCell")}function jb(r){switch(r.type){case"code":case"text":case"emph":case"strong":case"strike":case"link":case"image":case"htmlInline":case"linebreak":case"softbreak":case"customInline":return!0;default:return!1}}function Yr(r,e,t){for(t===void 0&&(t=!0),r=t?r:r.parent;r&&r.type!=="document";){if(e(r))return r;r=r.parent}return null}function Gb(r,e,t){for(t===void 0&&(t=!0),r=t?r:r.parent;r&&r.type!=="document";)e(r),r=r.parent}function ie(r,e){return[r[0],r[1]+e]}function Gt(r,e){return[r[0],e]}function Kb(r){var e=r.firstChild.literal;switch(r.type){case"emph":return"*"+e+"*";case"strong":return"**"+e+"**";case"strike":return"~~"+e+"~~";case"code":return"`"+e+"`";case"link":case"image":var t=r,n=t.destination,i=t.title,a=r.type==="link"?"":"!";return a+"["+e+"]("+n+(i?' "'+i+'"':"")+")";default:return null}}function Jb(r){switch(r.type){case"document":case"blockQuote":case"list":case"item":case"paragraph":case"heading":case"emph":case"strong":case"strike":case"link":case"image":case"table":case"tableHead":case"tableBody":case"tableRow":case"tableCell":case"tableDelimRow":case"customInline":return!0;default:return!1}}function Xb(r){for(var e=[],t=r.walker(),n=null;n=t.next();){var i=n.node;i.type==="text"&&e.push(i.literal)}return e.join("")}var Pn=[],mh={},_u=/\$\$widget\d+\s/;function la(r){var e=r.search(_u);if(e!==-1){var t=r.substring(e),n=t.replace(_u,"").replace("$$","");r=r.substring(0,e),r+=la(n)}return r}function gh(r,e){return"$$"+r+" "+e+"$$"}function yh(r,e){var t=mh[r],n=t.rule,i=t.toDOM,a=la(e).match(n);return a&&(e=a[0]),i(e)}function Yb(){return Pn}function Qb(r){Pn=r,Pn.forEach(function(e,t){mh["widget"+t]=e})}function Za(r,e,t,n){return r.concat(dr(e,t,n))}function dr(r,e,t){t===void 0&&(t=0);var n=[],i=(Pn[t]||{}).rule,a=t+1;if(r=la(r),i&&i.test(r)){for(var o=void 0;(o=r.search(i))!==-1;){var s=r.substring(0,o);s&&(n=Za(n,s,e,a)),r=r.substring(o);var l=r.match(i)[0],u="widget"+t;n.push(e.nodes.widget.create({info:u},e.text(gh(u,l)))),r=r.substring(l.length)}r&&(n=Za(n,r,e,a))}else r&&(n=t-1)}var kh=rw,nw=gr,iw=ht,ti=Element.prototype,aw=ti.matches||ti.webkitMatchesSelector||ti.mozMatchesSelector||ti.msMatchesSelector||function(r){var e=this.document||this.ownerDocument;return nw(this,iw(e.querySelectorAll(r)))>-1};function ow(r,e){return aw.call(r,e)}var sw=ow,Ch="[A-Za-z][A-Za-z0-9-]*",lw="[a-zA-Z_:][a-zA-Z0-9:._-]*",uw="[^\"'=<>`\\x00-\\x20]+",cw="'[^']*'",fw='"[^"]*"',dw="(?:"+uw+"|"+cw+"|"+fw+")",hw="(?:\\s*=\\s*"+dw+")",Th="(?:\\s+"+lw+hw+"?)",xh="<("+Ch+")("+Th+")*\\s*/?>",pw="]",Eh="(?:"+xh+"|"+pw+")",Qr=new RegExp("^"+Eh,"i"),_o=//i,vw=/|/,Mh="

";function Hs(r,e,t){var n=parseInt(r.left,10),i=parseInt(r.top,10),a=parseInt(r.width,10)+parseInt(r.paddingLeft,10)+parseInt(r.paddingRight,10),o=parseInt(r.height,10)+parseInt(r.paddingTop,10)+parseInt(r.paddingBottom,10);return e>=n&&e<=n+a&&t>=i&&t<=i+o}var Sh="toastui-editor-";function L(){for(var r=[],e=0;e<\/p>/gi,"

"),t=new RegExp(Eh,"ig"),n=e.match(t);return n==null||n.forEach(function(i,a){if(_o.test(i)){var o=Mh;if(a){var s=n[a-1],l=s.match(xh);if(l&&!/br/i.test(l[1])){var u=l[1];o="<"+u+">"}}e=e.replace(_o,o)}}),e}function $s(r){var e=//g,t=/ class="ProseMirror-trailingBreak"/g,n=r;return n=n.replace(e,""),n=n.replace(t,""),n}var Ah=new Fn("widget"),$u=5,Cw=function(){function r(e,t){var n=this;this.popup=null,this.removeWidget=function(){n.popup&&(n.rootEl.removeChild(n.popup),n.popup=null)},this.rootEl=e.dom.parentElement,this.eventEmitter=t,this.eventEmitter.listen("blur",this.removeWidget),this.eventEmitter.listen("loadUI",function(){n.rootEl=ut(e.dom.parentElement,"."+L("defaultUI"))}),this.eventEmitter.listen("removePopupWidget",this.removeWidget)}return r.prototype.update=function(e){var t=Ah.getState(e.state);if(this.removeWidget(),t){var n=t.node,i=t.style,a=e.coordsAtPos(t.pos),o=a.top,s=a.left,l=a.bottom,u=l-o,c=this.rootEl.getBoundingClientRect(),f=o-c.top;dt(n,{opacity:"0"}),this.rootEl.appendChild(n),dt(n,{position:"absolute",left:s-c.left+$u+"px",top:(i==="bottom"?f+u-$u:f-u)+"px",opacity:"1"}),this.popup=n,e.focus()}},r.prototype.destroy=function(){this.eventEmitter.removeEventHandler("blur",this.removeWidget)},r}();function Tw(r){return new He({key:Ah,state:{init:function(){return null},apply:function(e){return e.getMeta("widget")}},view:function(e){return new Cw(e,r)}})}function xw(r){r.listen("addImageBlobHook",function(e,t){var n=new FileReader;n.onload=function(i){var a=i.target;return t(a.result)},n.readAsDataURL(e)})}function zs(r,e,t){var n=function(i,a){r.emit("command","addImage",{imageUrl:i,altText:a||e.name||"image"})};r.emit("addImageBlobHook",e,n,t)}function Nh(r){var e=ht(r).filter(function(n){var i=n.type;return i.indexOf("image")!==-1});if(e.length===1){var t=e[0];if(t)return t.getAsFile()}return null}function Ew(r){var e=r.eventEmitter;return new He({props:{handleDOMEvents:{drop:function(t,n){var i,a=(i=n.dataTransfer)===null||i===void 0?void 0:i.files;return a&&Xr(a,function(o){return o.type.indexOf("image")!==-1?(n.preventDefault(),n.stopPropagation(),zs(e,o,n.type),!1):!0}),!0}}}})}var G=function(){function r(){}return Object.defineProperty(r.prototype,"type",{get:function(){return"node"},enumerable:!1,configurable:!0}),r.prototype.setContext=function(e){this.context=e},r}();function Dh(r){var e=document.createElement("span"),t=yh(r.attrs.info,r.textContent);return e.className="tui-widget",e.appendChild(t),{dom:e}}function $o(r){return r.type.name==="widget"}var Ih=function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"widget"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{attrs:{info:{default:null}},group:"inline",inline:!0,content:"text*",selectable:!1,atom:!0,toDOM:function(){return["span",{class:"tui-widget"},0]},parseDOM:[{tag:"span.tui-widget",getAttrs:function(t){var n=t.textContent,i=n.match(/\$\$(widget\d+)/),a=i[1];return{info:a}}}]}},enumerable:!1,configurable:!0}),e}(G),Rh=function(){function r(e){this.timer=null,this.el=document.createElement("div"),this.el.className="toastui-editor",this.eventEmitter=e,this.placeholder={text:""}}return r.prototype.createState=function(){return ar.create({schema:this.schema,plugins:this.createPlugins()})},r.prototype.initEvent=function(){var e=this,t=e.eventEmitter,n=e.view,i=e.editorType;n.dom.addEventListener("focus",function(){return t.emit("focus",i)}),n.dom.addEventListener("blur",function(){return t.emit("blur",i)})},r.prototype.emitChangeEvent=function(e){this.eventEmitter.emit("caretChange",this.editorType),e.docChanged&&this.eventEmitter.emit("change",this.editorType)},Object.defineProperty(r.prototype,"defaultPlugins",{get:function(){var e=this.createInputRules(),t=Pe(Pe([],this.keymaps),[Bn(b({"Shift-Enter":Su.Enter},Su)),fh(),Zb(this.placeholder),Tw(this.eventEmitter),Ew(this.context)]);return e?t.concat(e):t},enumerable:!1,configurable:!0}),r.prototype.createInputRules=function(){var e=Yb(),t=e.map(function(n){var i=n.rule;return new Yt(i,function(a,o,s,l){var u=a.schema,c=a.tr,f=a.doc,d=o.input.match(new RegExp(i,"g")),p=f.resolve(s),h=p.parent,v=0;if($o(h)&&(h=p.node(p.depth-1)),h.forEach(function(w){return $o(w)&&(v+=1)}),d.length>v){var m=Te(d),g=dr(m,u);return c.replaceWith(l-m.length+1,l,g)}return null})});return t.length?uh({rules:t}):null},r.prototype.clearTimer=function(){this.timer&&(clearTimeout(this.timer),this.timer=null)},r.prototype.createSchema=function(){return new od({nodes:this.specs.nodes,marks:this.specs.marks})},r.prototype.createKeymaps=function(e){var t=wh(),n=t.undo,i=t.redo,a=this.specs.keymaps(e),o={"Mod-z":n(),"Shift-Mod-z":i()};return e?a.concat(Bn(o)):a},r.prototype.createCommands=function(){return this.specs.commands(this.view)},r.prototype.createPluginProps=function(){var e=this;return this.extraPlugins.map(function(t){return t(e.eventEmitter)})},r.prototype.focus=function(){var e=this;this.clearTimer(),this.timer=setTimeout(function(){e.view.focus(),e.view.dispatch(e.view.state.tr.scrollIntoView())})},r.prototype.blur=function(){this.view.dom.blur()},r.prototype.destroy=function(){var e=this;this.clearTimer(),this.view.destroy(),Object.keys(this).forEach(function(t){delete e[t]})},r.prototype.moveCursorToStart=function(e){var t=this.view.state.tr;this.view.dispatch(t.setSelection(K(t,1)).scrollIntoView()),e&&this.focus()},r.prototype.moveCursorToEnd=function(e){var t=this.view.state.tr;this.view.dispatch(t.setSelection(K(t,t.doc.content.size-1)).scrollIntoView()),e&&this.focus()},r.prototype.setScrollTop=function(e){this.view.dom.scrollTop=e},r.prototype.getScrollTop=function(){return this.view.dom.scrollTop},r.prototype.setPlaceholder=function(e){this.placeholder.text=e,this.view.dispatch(this.view.state.tr.scrollIntoView())},r.prototype.setHeight=function(e){dt(this.el,{height:e+"px"})},r.prototype.setMinHeight=function(e){dt(this.el,{minHeight:e+"px"})},r.prototype.getElement=function(){return this.el},r}();function Mw(r){return r instanceof Function}var Ue=Mw,Sw=["Enter","Shift-Enter","Mod-Enter","Tab","Shift-Tab","Delete","Backspace","Mod-Delete","Mod-Backspace","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Mod-d","Mod-D","Alt-ArrowUp","Alt-ArrowDown"];function ri(r,e,t){return r.focus(),e(t)(r.state,r.dispatch,r)}var Bh=function(){function r(e){this.specs=e}return Object.defineProperty(r.prototype,"nodes",{get:function(){return this.specs.filter(function(e){return e.type==="node"}).reduce(function(e,t){var n,i=t.name,a=t.schema;return b(b({},e),(n={},n[i]=a,n))},{})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"marks",{get:function(){return this.specs.filter(function(e){return e.type==="mark"}).reduce(function(e,t){var n,i=t.name,a=t.schema;return b(b({},e),(n={},n[i]=a,n))},{})},enumerable:!1,configurable:!0}),r.prototype.commands=function(e,t){var n=this.specs.filter(function(a){var o=a.commands;return o}).reduce(function(a,o){var s={},l=o.commands();return Ue(l)?s[o.name]=function(u){return ri(e,l,u)}:Object.keys(l).forEach(function(u){s[u]=function(c){return ri(e,l[u],c)}}),b(b({},a),s)},{}),i=wh();return Object.keys(i).forEach(function(a){n[a]=function(o){return ri(e,i[a],o)}}),t&&Object.keys(t).forEach(function(a){n[a]=function(o){return ri(e,t[a],o)}}),n},r.prototype.keymaps=function(e){var t=this.specs.filter(function(n){return n.keymaps}).map(function(n){return n.keymaps()});return t.map(function(n){return e||Object.keys(n).forEach(function(i){pe(Sw,i)||delete n[i]}),Bn(n)})},r.prototype.setContext=function(e){this.specs.forEach(function(t){t.setContext(e)})},r}();function Ph(r){var e=r.from,t=r.to;return r instanceof Se?[e+1,t-1]:[e,t]}function zu(r){return r.index(0)+1}function Zr(r,e,t){t===void 0&&(t=1);var n=0;return r.forEach(function(i,a){$o(i)&&a+2 ?/,sk=function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"blockQuote"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:ne("block-quote")},0]}}},enumerable:!1,configurable:!0}),e.prototype.createBlockQuoteText=function(t,n){return n?t.replace(kn,"").trim():"> "+t.trim()},e.prototype.extendBlockQuote=function(){var t=this;return function(n,i){var a=n.selection,o=n.doc,s=n.tr,l=n.schema,u=re(a),c=u.endFromOffset,f=u.endToOffset,d=u.endIndex,p=u.to,h=Jt(o,d),v=kn.test(h);if(v&&p>c&&a.empty){var m=!h.replace(kn,"").trim();if(m)s.deleteRange(c,f).split(s.mapping.map(f));else{var g=h.slice(p-c).trim(),w=he(l,t.createBlockQuoteText(g));Ps(s,f,g,w)}return i(s),!0}return!1}},e.prototype.commands=function(){var t=this;return function(){return function(n,i){var a=n.selection,o=n.doc,s=re(a),l=s.startFromOffset,u=s.endToOffset,c=s.startIndex,f=s.endIndex,d=kn.test(Jt(o,c)),p=qi({state:n,startIndex:c,endIndex:f,from:l,createText:function(h){return t.createBlockQuoteText(h,d)}});return i(p.setSelection(K(p,p.mapping.map(u)))),!0}}},e.prototype.keymaps=function(){var t=this.commands()();return{"alt-q":t,"alt-Q":t,Enter:this.extendBlockQuote()}},e}(J),kr=/(^\s*)([-*+] |[\d]+\. )/,Us=/(^\s*)([\d])+\.( \[[ xX]])? /,Et=/^(\s*)((\d+)([.)]\s(?:\[(?:x|\s)\]\s)?))(.*)/,$i=/(^\s*)([-*+]|[\d]+\.)( \[[ xX]])? /,lk=/^(\s*)([-*+]+(\s(?:\[(?:x|\s)\]\s)?))(.*)/,uk=/(^\s*)([-*+] |[\d]+\. )(\[[ xX]] )/,ck=/(^\s*)([-*+])( \[[ xX]]) /;function Ws(r){return Us.test(r)?"ordered":"bullet"}function js(r){for(var e=0;r&&r.type!=="document";)r.type==="list"&&(e+=1),r=r.parent;return e}function zo(r,e,t,n){for(var i=r.getLineTexts(),a=i.length,o=[],s=e;n?s1;){s=n?s+1:s-1;var l=r.findFirstNodeAtLine(s),u=js(l);if(u===t)o.push({line:s,depth:t,mdNode:l});else if(u0;u-=1){var c=e.findFirstNodeAtLine(u),f=Fe(t,u),d=f&&!!Yr(c,function(C){return yr(C)}),p=Et.exec(Fe(t,u));if(!p&&!d)break;if(!p&&d){l+=1;continue}var h=p,v=h[1],m=h[3];if(!v){o=Number(m),s=u;break}}var g=o+n-s-l,w=[{text:g+". "+a,line:n}];return{changedResults:w}},task:function(r){var e=r.doc,t=r.line,n=Fe(e,t),i=[{text:"* [ ] "+n,line:t}];return{changedResults:i}}},mk={bullet:function(r){var e=r.line,t=r.doc,n=Fe(t,e),i=lk.exec(n),a=i[1],o=i[2];return{listSyntax:""+a+o}},ordered:function(r){var e=r.toastMark,t=r.line,n=r.mdNode,i=r.doc,a=js(n),o=Fe(i,t),s=Et.exec(o),l=s[1],u=s[3],c=s[4],f=Number(u)+1,d=""+l+f+c,p=zo(e,t,a,!0),h=p.filter(function(v){var m=Et.exec(Fe(i,v.line));return m&&m[1].length===l.length&&!!Yr(v.mdNode,function(g){return vh(g)})});return b({listSyntax:d},$h(i,h,"ordered",f))}};function zh(r,e,t,n,i){for(var a=[],o=Fe(r,t),s=Et.exec(o);s;){var l=s[1],u=s[4],c=s[5],f=l.length;if(f===i)a.push(he(e,""+l+n+u+c)),n+=1,t+=1;else if(f>i){var d=zh(r,e,t,1,f);t=d.line,a=a.concat(d.nodes)}if(fr.childCount)break;o=Fe(r,t),s=Et.exec(o)}return{nodes:a,line:t}}var Ku=/(^\s{1,4})(.*)/;function Ju(r,e,t){return r0){var d=a.child(f-1),p=d.nodeSize,h=d.textContent;return i.delete(u-p,u).split(i.mapping.map(c)).insert(i.mapping.map(c),he(s,h)),n(i),!0}return!1}},e.prototype.commands=function(){return{indent:this.indent(),outdent:this.outdent()}},e.prototype.keymaps=function(){return{Tab:this.indent(!0)(),"Shift-Tab":this.outdent(!0)(),"Mod-d":this.deleteLines(),"Mod-D":this.deleteLines(),"Alt-ArrowUp":this.moveUp(),"Alt-ArrowDown":this.moveDown()}},e}(G),yk=function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"text"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{group:"inline"}},enumerable:!1,configurable:!0}),e}(G),bk=/^#{1,6}\s/,wk=function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"heading"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{attrs:{level:{default:1},seText:{default:!1}},toDOM:function(t){var n=t.attrs,i=n.level,a=n.seText,o="heading|heading"+i;return a&&(o+="|delimiter|setext"),["span",{class:ne.apply(void 0,o.split("|"))},0]}}},enumerable:!1,configurable:!0}),e.prototype.createHeadingText=function(t,n,i){for(var a=n.replace(i,"").trim(),o="";t>0;)o+="#",t-=1;return o+" "+a},e.prototype.commands=function(){var t=this;return function(n){return function(i,a){var o=n.level,s=re(i.selection),l=s.startFromOffset,u=s.endToOffset,c=s.startIndex,f=s.endIndex,d=qi({state:i,from:l,startIndex:c,endIndex:f,createText:function(p){var h=p.match(bk),v=h?h[0]:"";return t.createHeadingText(o,p,v)}});return a(d.setSelection(K(d,d.mapping.map(u)))),!0}}},e}(J),to="```",kk=function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"codeBlock"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:ne("code-block")},0]}}},enumerable:!1,configurable:!0}),e.prototype.commands=function(){return function(){return function(t,n){var i=t.selection,a=t.schema,o=t.tr,s=re(i),l=s.startFromOffset,u=s.endToOffset,c=he(a,to);return o.insert(l,c).split(l+to.length),o.split(o.mapping.map(u)).insert(o.mapping.map(u),c),n(o.setSelection(K(o,o.mapping.map(u)-(to.length+2)))),!0}}},e.prototype.keepIndentation=function(){var t=this;return function(n,i){var a=n.selection,o=n.tr,s=n.doc,l=n.schema,u=t.context.toastMark,c=re(a),f=c.startFromOffset,d=c.endToOffset,p=c.endIndex,h=c.from,v=c.to,m=Jt(s,p);if(h===v&&m.trim()){var g=m.match(/^\s+/),w=u.findFirstNodeAtLine(p+1);if(Ub(w)&&g){var C=g[0],T=m.slice(v-f),x=he(l,C+T);return Ps(o,d,T,x),i(o),!0}}return!1}},e.prototype.keymaps=function(){var t=this.commands()();return{"Shift-Mod-p":t,"Shift-Mod-P":t,Enter:this.keepIndentation()}},e}(J),Ck=/\||\s/g;function Tk(r){return[zi(r),zi(r,!0)]}function xk(r,e){for(var t=[],n=0;n0&&(n+=` +`)}),n},e.prototype.setSelection=function(t,n){n===void 0&&(n=t);var i=this.view.state.tr,a=nr(i.doc,t,n),o=a[0],s=a[1];this.view.dispatch(i.setSelection(K(i,o,s)).scrollIntoView())},e.prototype.replaceSelection=function(t,n,i){var a,o=this.view.state,s=o.tr,l=o.schema,u=o.doc,c=t.split(Qu),f=c.map(function(m){return Fi(l,dr(m,l))}),d=new S(k.from(f),1,1);if(this.focus(),n&&i){var p=nr(u,n,i),h=p[0],v=p[1];a=s.replaceRange(h,v,d)}else a=s.replaceSelection(d);this.view.dispatch(a.scrollIntoView())},e.prototype.deleteSelection=function(t,n){var i,a=this.view.state,o=a.tr,s=a.doc;if(t&&n){var l=nr(s,t,n),u=l[0],c=l[1];i=o.deleteRange(u,c)}else i=o.deleteSelection();this.view.dispatch(i.scrollIntoView())},e.prototype.getSelectedText=function(t,n){var i=this.view.state,a=i.doc,o=i.selection,s=o.from,l=o.to;if(t&&n){var u=nr(a,t,n);s=u[0],l=u[1]}return a.textBetween(s,l,` +`)},e.prototype.getSelection=function(){var t=this.view.state.selection,n=t.from,i=t.to;return pi(this.view.state.tr.doc,n,i)},e.prototype.setMarkdown=function(t,n){n===void 0&&(n=!0);var i=t.split(Qu),a=this.view.state,o=a.tr,s=a.doc,l=a.schema,u=i.map(function(c){return Fi(l,dr(c,l))});this.view.dispatch(o.replaceWith(0,s.content.size,u)),n&&this.moveCursorToEnd(!0)},e.prototype.addWidget=function(t,n,i){var a=this.view.state,o=a.tr,s=a.doc,l=a.selection,u=i?nr(s,i,i)[0]:l.to;this.view.dispatch(o.setMeta("widget",{pos:u,node:t,style:n}))},e.prototype.replaceWithWidget=function(t,n,i){var a=this.view.state,o=a.tr,s=a.schema,l=a.doc,u=nr(l,t,n),c=dr(i,s);this.view.dispatch(o.replaceWith(u[0],u[1],c))},e.prototype.getRangeInfoOfNode=function(t){var n=this.view.state,i=n.doc,a=n.selection,o=t||pi(i,a.from)[0],s=this.toastMark.findNodeAtPosition(o);return s.type==="text"&&s.parent.type!=="paragraph"&&(s=s.parent),s.sourcepos[1][1]+=1,{range:s.sourcepos,type:s.type}},e.prototype.getMarkdown=function(){return this.toastMark.getLineTexts().map(function(t){return la(t)}).join(` +`)},e.prototype.getToastMark=function(){return this.toastMark},e}(Rh),Zu="_feEventKey";function tC(r,e){var t=r[Zu],n;return t||(t=r[Zu]={}),n=t[e],n||(n=t[e]=[]),n}var Vh=tC,rC=Ot,Vi=aa,nC=Vh;function iC(r,e,t){if(rC(e)){Vi(e.split(/\s+/g),function(n){ec(r,n,t)});return}Vi(e,function(n,i){ec(r,i,n)})}function ec(r,e,t){var n=nC(r,e),i;t?(Vi(n,function(a,o){return t===a.handler?(tc(r,e,a.wrappedHandler),i=o,!1):!0}),n.splice(i,1)):(Vi(n,function(a){tc(r,e,a.wrappedHandler)}),n.splice(0,n.length))}function tc(r,e,t){"removeEventListener"in r?r.removeEventListener(e,t):"detachEvent"in r&&r.detachEvent("on"+e,t)}var Uh=iC,aC=Ot,Vo=aa,oC=Vh;function sC(r,e,t,n){if(aC(e)){Vo(e.split(/\s+/g),function(i){rc(r,i,t,n)});return}Vo(e,function(i,a){rc(r,a,i,t)})}function rc(r,e,t,n){function i(a){t.call(n||r,a||window.event)}"addEventListener"in r?r.addEventListener(e,i):"attachEvent"in r&&r.attachEvent("on"+e,i),lC(r,e,t,i)}function lC(r,e,t,n){var i=oC(r,e),a=!1;Vo(i,function(o){return o.handler===t?(a=!0,!1):!0}),a||i.push({handler:t,wrappedHandler:n})}var Wh=sC;/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var Uo=function(r,e){return Uo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},Uo(r,e)};function We(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Uo(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var ce=function(){return ce=Object.assign||function(e){for(var t,n=1,i=arguments.length;n"u"&&(t=!0),s=uC(e),n=0,i=r.length;n=55296&&a<=57343){if(a>=55296&&a<=56319&&n+1=56320&&o<=57343)){l+=encodeURIComponent(r[n]+r[n+1]),n++;continue}l+="%EF%BF%BD";continue}l+=encodeURIComponent(r[n])}return l}da.defaultChars=";/?:@&=+$,-_.!~*'()#";da.componentChars="-_.!~*'()";var cC=da,Gs={},Mt={},fC="Á",dC="á",hC="Ă",pC="ă",vC="∾",mC="∿",gC="∾̳",yC="Â",bC="â",wC="´",kC="А",CC="а",TC="Æ",xC="æ",EC="⁡",MC="𝔄",SC="𝔞",OC="À",LC="à",AC="ℵ",NC="ℵ",DC="Α",IC="α",RC="Ā",BC="ā",PC="⨿",HC="&",FC="&",qC="⩕",_C="⩓",$C="∧",zC="⩜",VC="⩘",UC="⩚",WC="∠",jC="⦤",GC="∠",KC="⦨",JC="⦩",XC="⦪",YC="⦫",QC="⦬",ZC="⦭",e0="⦮",t0="⦯",r0="∡",n0="∟",i0="⊾",a0="⦝",o0="∢",s0="Å",l0="⍼",u0="Ą",c0="ą",f0="𝔸",d0="𝕒",h0="⩯",p0="≈",v0="⩰",m0="≊",g0="≋",y0="'",b0="⁡",w0="≈",k0="≊",C0="Å",T0="å",x0="𝒜",E0="𝒶",M0="≔",S0="*",O0="≈",L0="≍",A0="Ã",N0="ã",D0="Ä",I0="ä",R0="∳",B0="⨑",P0="≌",H0="϶",F0="‵",q0="∽",_0="⋍",$0="∖",z0="⫧",V0="⊽",U0="⌅",W0="⌆",j0="⌅",G0="⎵",K0="⎶",J0="≌",X0="Б",Y0="б",Q0="„",Z0="∵",e1="∵",t1="∵",r1="⦰",n1="϶",i1="ℬ",a1="ℬ",o1="Β",s1="β",l1="ℶ",u1="≬",c1="𝔅",f1="𝔟",d1="⋂",h1="◯",p1="⋃",v1="⨀",m1="⨁",g1="⨂",y1="⨆",b1="★",w1="▽",k1="△",C1="⨄",T1="⋁",x1="⋀",E1="⤍",M1="⧫",S1="▪",O1="▴",L1="▾",A1="◂",N1="▸",D1="␣",I1="▒",R1="░",B1="▓",P1="█",H1="=⃥",F1="≡⃥",q1="⫭",_1="⌐",$1="𝔹",z1="𝕓",V1="⊥",U1="⊥",W1="⋈",j1="⧉",G1="┐",K1="╕",J1="╖",X1="╗",Y1="┌",Q1="╒",Z1="╓",eT="╔",tT="─",rT="═",nT="┬",iT="╤",aT="╥",oT="╦",sT="┴",lT="╧",uT="╨",cT="╩",fT="⊟",dT="⊞",hT="⊠",pT="┘",vT="╛",mT="╜",gT="╝",yT="└",bT="╘",wT="╙",kT="╚",CT="│",TT="║",xT="┼",ET="╪",MT="╫",ST="╬",OT="┤",LT="╡",AT="╢",NT="╣",DT="├",IT="╞",RT="╟",BT="╠",PT="‵",HT="˘",FT="˘",qT="¦",_T="𝒷",$T="ℬ",zT="⁏",VT="∽",UT="⋍",WT="⧅",jT="\\",GT="⟈",KT="•",JT="•",XT="≎",YT="⪮",QT="≏",ZT="≎",ex="≏",tx="Ć",rx="ć",nx="⩄",ix="⩉",ax="⩋",ox="∩",sx="⋒",lx="⩇",ux="⩀",cx="ⅅ",fx="∩︀",dx="⁁",hx="ˇ",px="ℭ",vx="⩍",mx="Č",gx="č",yx="Ç",bx="ç",wx="Ĉ",kx="ĉ",Cx="∰",Tx="⩌",xx="⩐",Ex="Ċ",Mx="ċ",Sx="¸",Ox="¸",Lx="⦲",Ax="¢",Nx="·",Dx="·",Ix="𝔠",Rx="ℭ",Bx="Ч",Px="ч",Hx="✓",Fx="✓",qx="Χ",_x="χ",$x="ˆ",zx="≗",Vx="↺",Ux="↻",Wx="⊛",jx="⊚",Gx="⊝",Kx="⊙",Jx="®",Xx="Ⓢ",Yx="⊖",Qx="⊕",Zx="⊗",eE="○",tE="⧃",rE="≗",nE="⨐",iE="⫯",aE="⧂",oE="∲",sE="”",lE="’",uE="♣",cE="♣",fE=":",dE="∷",hE="⩴",pE="≔",vE="≔",mE=",",gE="@",yE="∁",bE="∘",wE="∁",kE="ℂ",CE="≅",TE="⩭",xE="≡",EE="∮",ME="∯",SE="∮",OE="𝕔",LE="ℂ",AE="∐",NE="∐",DE="©",IE="©",RE="℗",BE="∳",PE="↵",HE="✗",FE="⨯",qE="𝒞",_E="𝒸",$E="⫏",zE="⫑",VE="⫐",UE="⫒",WE="⋯",jE="⤸",GE="⤵",KE="⋞",JE="⋟",XE="↶",YE="⤽",QE="⩈",ZE="⩆",eM="≍",tM="∪",rM="⋓",nM="⩊",iM="⊍",aM="⩅",oM="∪︀",sM="↷",lM="⤼",uM="⋞",cM="⋟",fM="⋎",dM="⋏",hM="¤",pM="↶",vM="↷",mM="⋎",gM="⋏",yM="∲",bM="∱",wM="⌭",kM="†",CM="‡",TM="ℸ",xM="↓",EM="↡",MM="⇓",SM="‐",OM="⫤",LM="⊣",AM="⤏",NM="˝",DM="Ď",IM="ď",RM="Д",BM="д",PM="‡",HM="⇊",FM="ⅅ",qM="ⅆ",_M="⤑",$M="⩷",zM="°",VM="∇",UM="Δ",WM="δ",jM="⦱",GM="⥿",KM="𝔇",JM="𝔡",XM="⥥",YM="⇃",QM="⇂",ZM="´",eS="˙",tS="˝",rS="`",nS="˜",iS="⋄",aS="⋄",oS="⋄",sS="♦",lS="♦",uS="¨",cS="ⅆ",fS="ϝ",dS="⋲",hS="÷",pS="÷",vS="⋇",mS="⋇",gS="Ђ",yS="ђ",bS="⌞",wS="⌍",kS="$",CS="𝔻",TS="𝕕",xS="¨",ES="˙",MS="⃜",SS="≐",OS="≑",LS="≐",AS="∸",NS="∔",DS="⊡",IS="⌆",RS="∯",BS="¨",PS="⇓",HS="⇐",FS="⇔",qS="⫤",_S="⟸",$S="⟺",zS="⟹",VS="⇒",US="⊨",WS="⇑",jS="⇕",GS="∥",KS="⤓",JS="↓",XS="↓",YS="⇓",QS="⇵",ZS="̑",eO="⇊",tO="⇃",rO="⇂",nO="⥐",iO="⥞",aO="⥖",oO="↽",sO="⥟",lO="⥗",uO="⇁",cO="↧",fO="⊤",dO="⤐",hO="⌟",pO="⌌",vO="𝒟",mO="𝒹",gO="Ѕ",yO="ѕ",bO="⧶",wO="Đ",kO="đ",CO="⋱",TO="▿",xO="▾",EO="⇵",MO="⥯",SO="⦦",OO="Џ",LO="џ",AO="⟿",NO="É",DO="é",IO="⩮",RO="Ě",BO="ě",PO="Ê",HO="ê",FO="≖",qO="≕",_O="Э",$O="э",zO="⩷",VO="Ė",UO="ė",WO="≑",jO="ⅇ",GO="≒",KO="𝔈",JO="𝔢",XO="⪚",YO="È",QO="è",ZO="⪖",eL="⪘",tL="⪙",rL="∈",nL="⏧",iL="ℓ",aL="⪕",oL="⪗",sL="Ē",lL="ē",uL="∅",cL="∅",fL="◻",dL="∅",hL="▫",pL=" ",vL=" ",mL=" ",gL="Ŋ",yL="ŋ",bL=" ",wL="Ę",kL="ę",CL="𝔼",TL="𝕖",xL="⋕",EL="⧣",ML="⩱",SL="ε",OL="Ε",LL="ε",AL="ϵ",NL="≖",DL="≕",IL="≂",RL="⪖",BL="⪕",PL="⩵",HL="=",FL="≂",qL="≟",_L="⇌",$L="≡",zL="⩸",VL="⧥",UL="⥱",WL="≓",jL="ℯ",GL="ℰ",KL="≐",JL="⩳",XL="≂",YL="Η",QL="η",ZL="Ð",eA="ð",tA="Ë",rA="ë",nA="€",iA="!",aA="∃",oA="∃",sA="ℰ",lA="ⅇ",uA="ⅇ",cA="≒",fA="Ф",dA="ф",hA="♀",pA="ffi",vA="ff",mA="ffl",gA="𝔉",yA="𝔣",bA="fi",wA="◼",kA="▪",CA="fj",TA="♭",xA="fl",EA="▱",MA="ƒ",SA="𝔽",OA="𝕗",LA="∀",AA="∀",NA="⋔",DA="⫙",IA="ℱ",RA="⨍",BA="½",PA="⅓",HA="¼",FA="⅕",qA="⅙",_A="⅛",$A="⅔",zA="⅖",VA="¾",UA="⅗",WA="⅜",jA="⅘",GA="⅚",KA="⅝",JA="⅞",XA="⁄",YA="⌢",QA="𝒻",ZA="ℱ",eN="ǵ",tN="Γ",rN="γ",nN="Ϝ",iN="ϝ",aN="⪆",oN="Ğ",sN="ğ",lN="Ģ",uN="Ĝ",cN="ĝ",fN="Г",dN="г",hN="Ġ",pN="ġ",vN="≥",mN="≧",gN="⪌",yN="⋛",bN="≥",wN="≧",kN="⩾",CN="⪩",TN="⩾",xN="⪀",EN="⪂",MN="⪄",SN="⋛︀",ON="⪔",LN="𝔊",AN="𝔤",NN="≫",DN="⋙",IN="⋙",RN="ℷ",BN="Ѓ",PN="ѓ",HN="⪥",FN="≷",qN="⪒",_N="⪤",$N="⪊",zN="⪊",VN="⪈",UN="≩",WN="⪈",jN="≩",GN="⋧",KN="𝔾",JN="𝕘",XN="`",YN="≥",QN="⋛",ZN="≧",eD="⪢",tD="≷",rD="⩾",nD="≳",iD="𝒢",aD="ℊ",oD="≳",sD="⪎",lD="⪐",uD="⪧",cD="⩺",fD=">",dD=">",hD="≫",pD="⋗",vD="⦕",mD="⩼",gD="⪆",yD="⥸",bD="⋗",wD="⋛",kD="⪌",CD="≷",TD="≳",xD="≩︀",ED="≩︀",MD="ˇ",SD=" ",OD="½",LD="ℋ",AD="Ъ",ND="ъ",DD="⥈",ID="↔",RD="⇔",BD="↭",PD="^",HD="ℏ",FD="Ĥ",qD="ĥ",_D="♥",$D="♥",zD="…",VD="⊹",UD="𝔥",WD="ℌ",jD="ℋ",GD="⤥",KD="⤦",JD="⇿",XD="∻",YD="↩",QD="↪",ZD="𝕙",eI="ℍ",tI="―",rI="─",nI="𝒽",iI="ℋ",aI="ℏ",oI="Ħ",sI="ħ",lI="≎",uI="≏",cI="⁃",fI="‐",dI="Í",hI="í",pI="⁣",vI="Î",mI="î",gI="И",yI="и",bI="İ",wI="Е",kI="е",CI="¡",TI="⇔",xI="𝔦",EI="ℑ",MI="Ì",SI="ì",OI="ⅈ",LI="⨌",AI="∭",NI="⧜",DI="℩",II="IJ",RI="ij",BI="Ī",PI="ī",HI="ℑ",FI="ⅈ",qI="ℐ",_I="ℑ",$I="ı",zI="ℑ",VI="⊷",UI="Ƶ",WI="⇒",jI="℅",GI="∞",KI="⧝",JI="ı",XI="⊺",YI="∫",QI="∬",ZI="ℤ",eR="∫",tR="⊺",rR="⋂",nR="⨗",iR="⨼",aR="⁣",oR="⁢",sR="Ё",lR="ё",uR="Į",cR="į",fR="𝕀",dR="𝕚",hR="Ι",pR="ι",vR="⨼",mR="¿",gR="𝒾",yR="ℐ",bR="∈",wR="⋵",kR="⋹",CR="⋴",TR="⋳",xR="∈",ER="⁢",MR="Ĩ",SR="ĩ",OR="І",LR="і",AR="Ï",NR="ï",DR="Ĵ",IR="ĵ",RR="Й",BR="й",PR="𝔍",HR="𝔧",FR="ȷ",qR="𝕁",_R="𝕛",$R="𝒥",zR="𝒿",VR="Ј",UR="ј",WR="Є",jR="є",GR="Κ",KR="κ",JR="ϰ",XR="Ķ",YR="ķ",QR="К",ZR="к",eB="𝔎",tB="𝔨",rB="ĸ",nB="Х",iB="х",aB="Ќ",oB="ќ",sB="𝕂",lB="𝕜",uB="𝒦",cB="𝓀",fB="⇚",dB="Ĺ",hB="ĺ",pB="⦴",vB="ℒ",mB="Λ",gB="λ",yB="⟨",bB="⟪",wB="⦑",kB="⟨",CB="⪅",TB="ℒ",xB="«",EB="⇤",MB="⤟",SB="←",OB="↞",LB="⇐",AB="⤝",NB="↩",DB="↫",IB="⤹",RB="⥳",BB="↢",PB="⤙",HB="⤛",FB="⪫",qB="⪭",_B="⪭︀",$B="⤌",zB="⤎",VB="❲",UB="{",WB="[",jB="⦋",GB="⦏",KB="⦍",JB="Ľ",XB="ľ",YB="Ļ",QB="ļ",ZB="⌈",eP="{",tP="Л",rP="л",nP="⤶",iP="“",aP="„",oP="⥧",sP="⥋",lP="↲",uP="≤",cP="≦",fP="⟨",dP="⇤",hP="←",pP="←",vP="⇐",mP="⇆",gP="↢",yP="⌈",bP="⟦",wP="⥡",kP="⥙",CP="⇃",TP="⌊",xP="↽",EP="↼",MP="⇇",SP="↔",OP="↔",LP="⇔",AP="⇆",NP="⇋",DP="↭",IP="⥎",RP="↤",BP="⊣",PP="⥚",HP="⋋",FP="⧏",qP="⊲",_P="⊴",$P="⥑",zP="⥠",VP="⥘",UP="↿",WP="⥒",jP="↼",GP="⪋",KP="⋚",JP="≤",XP="≦",YP="⩽",QP="⪨",ZP="⩽",eH="⩿",tH="⪁",rH="⪃",nH="⋚︀",iH="⪓",aH="⪅",oH="⋖",sH="⋚",lH="⪋",uH="⋚",cH="≦",fH="≶",dH="≶",hH="⪡",pH="≲",vH="⩽",mH="≲",gH="⥼",yH="⌊",bH="𝔏",wH="𝔩",kH="≶",CH="⪑",TH="⥢",xH="↽",EH="↼",MH="⥪",SH="▄",OH="Љ",LH="љ",AH="⇇",NH="≪",DH="⋘",IH="⌞",RH="⇚",BH="⥫",PH="◺",HH="Ŀ",FH="ŀ",qH="⎰",_H="⎰",$H="⪉",zH="⪉",VH="⪇",UH="≨",WH="⪇",jH="≨",GH="⋦",KH="⟬",JH="⇽",XH="⟦",YH="⟵",QH="⟵",ZH="⟸",eF="⟷",tF="⟷",rF="⟺",nF="⟼",iF="⟶",aF="⟶",oF="⟹",sF="↫",lF="↬",uF="⦅",cF="𝕃",fF="𝕝",dF="⨭",hF="⨴",pF="∗",vF="_",mF="↙",gF="↘",yF="◊",bF="◊",wF="⧫",kF="(",CF="⦓",TF="⇆",xF="⌟",EF="⇋",MF="⥭",SF="‎",OF="⊿",LF="‹",AF="𝓁",NF="ℒ",DF="↰",IF="↰",RF="≲",BF="⪍",PF="⪏",HF="[",FF="‘",qF="‚",_F="Ł",$F="ł",zF="⪦",VF="⩹",UF="<",WF="<",jF="≪",GF="⋖",KF="⋋",JF="⋉",XF="⥶",YF="⩻",QF="◃",ZF="⊴",eq="◂",tq="⦖",rq="⥊",nq="⥦",iq="≨︀",aq="≨︀",oq="¯",sq="♂",lq="✠",uq="✠",cq="↦",fq="↦",dq="↧",hq="↤",pq="↥",vq="▮",mq="⨩",gq="М",yq="м",bq="—",wq="∺",kq="∡",Cq=" ",Tq="ℳ",xq="𝔐",Eq="𝔪",Mq="℧",Sq="µ",Oq="*",Lq="⫰",Aq="∣",Nq="·",Dq="⊟",Iq="−",Rq="∸",Bq="⨪",Pq="∓",Hq="⫛",Fq="…",qq="∓",_q="⊧",$q="𝕄",zq="𝕞",Vq="∓",Uq="𝓂",Wq="ℳ",jq="∾",Gq="Μ",Kq="μ",Jq="⊸",Xq="⊸",Yq="∇",Qq="Ń",Zq="ń",e_="∠⃒",t_="≉",r_="⩰̸",n_="≋̸",i_="ʼn",a_="≉",o_="♮",s_="ℕ",l_="♮",u_=" ",c_="≎̸",f_="≏̸",d_="⩃",h_="Ň",p_="ň",v_="Ņ",m_="ņ",g_="≇",y_="⩭̸",b_="⩂",w_="Н",k_="н",C_="–",T_="⤤",x_="↗",E_="⇗",M_="↗",S_="≠",O_="≐̸",L_="​",A_="​",N_="​",D_="​",I_="≢",R_="⤨",B_="≂̸",P_="≫",H_="≪",F_=` +`,q_="∄",__="∄",$_="𝔑",z_="𝔫",V_="≧̸",U_="≱",W_="≱",j_="≧̸",G_="⩾̸",K_="⩾̸",J_="⋙̸",X_="≵",Y_="≫⃒",Q_="≯",Z_="≯",e$="≫̸",t$="↮",r$="⇎",n$="⫲",i$="∋",a$="⋼",o$="⋺",s$="∋",l$="Њ",u$="њ",c$="↚",f$="⇍",d$="‥",h$="≦̸",p$="≰",v$="↚",m$="⇍",g$="↮",y$="⇎",b$="≰",w$="≦̸",k$="⩽̸",C$="⩽̸",T$="≮",x$="⋘̸",E$="≴",M$="≪⃒",S$="≮",O$="⋪",L$="⋬",A$="≪̸",N$="∤",D$="⁠",I$=" ",R$="𝕟",B$="ℕ",P$="⫬",H$="¬",F$="≢",q$="≭",_$="∦",$$="∉",z$="≠",V$="≂̸",U$="∄",W$="≯",j$="≱",G$="≧̸",K$="≫̸",J$="≹",X$="⩾̸",Y$="≵",Q$="≎̸",Z$="≏̸",ez="∉",tz="⋵̸",rz="⋹̸",nz="∉",iz="⋷",az="⋶",oz="⧏̸",sz="⋪",lz="⋬",uz="≮",cz="≰",fz="≸",dz="≪̸",hz="⩽̸",pz="≴",vz="⪢̸",mz="⪡̸",gz="∌",yz="∌",bz="⋾",wz="⋽",kz="⊀",Cz="⪯̸",Tz="⋠",xz="∌",Ez="⧐̸",Mz="⋫",Sz="⋭",Oz="⊏̸",Lz="⋢",Az="⊐̸",Nz="⋣",Dz="⊂⃒",Iz="⊈",Rz="⊁",Bz="⪰̸",Pz="⋡",Hz="≿̸",Fz="⊃⃒",qz="⊉",_z="≁",$z="≄",zz="≇",Vz="≉",Uz="∤",Wz="∦",jz="∦",Gz="⫽⃥",Kz="∂̸",Jz="⨔",Xz="⊀",Yz="⋠",Qz="⊀",Zz="⪯̸",eV="⪯̸",tV="⤳̸",rV="↛",nV="⇏",iV="↝̸",aV="↛",oV="⇏",sV="⋫",lV="⋭",uV="⊁",cV="⋡",fV="⪰̸",dV="𝒩",hV="𝓃",pV="∤",vV="∦",mV="≁",gV="≄",yV="≄",bV="∤",wV="∦",kV="⋢",CV="⋣",TV="⊄",xV="⫅̸",EV="⊈",MV="⊂⃒",SV="⊈",OV="⫅̸",LV="⊁",AV="⪰̸",NV="⊅",DV="⫆̸",IV="⊉",RV="⊃⃒",BV="⊉",PV="⫆̸",HV="≹",FV="Ñ",qV="ñ",_V="≸",$V="⋪",zV="⋬",VV="⋫",UV="⋭",WV="Ν",jV="ν",GV="#",KV="№",JV=" ",XV="≍⃒",YV="⊬",QV="⊭",ZV="⊮",e2="⊯",t2="≥⃒",r2=">⃒",n2="⤄",i2="⧞",a2="⤂",o2="≤⃒",s2="<⃒",l2="⊴⃒",u2="⤃",c2="⊵⃒",f2="∼⃒",d2="⤣",h2="↖",p2="⇖",v2="↖",m2="⤧",g2="Ó",y2="ó",b2="⊛",w2="Ô",k2="ô",C2="⊚",T2="О",x2="о",E2="⊝",M2="Ő",S2="ő",O2="⨸",L2="⊙",A2="⦼",N2="Œ",D2="œ",I2="⦿",R2="𝔒",B2="𝔬",P2="˛",H2="Ò",F2="ò",q2="⧁",_2="⦵",$2="Ω",z2="∮",V2="↺",U2="⦾",W2="⦻",j2="‾",G2="⧀",K2="Ō",J2="ō",X2="Ω",Y2="ω",Q2="Ο",Z2="ο",eU="⦶",tU="⊖",rU="𝕆",nU="𝕠",iU="⦷",aU="“",oU="‘",sU="⦹",lU="⊕",uU="↻",cU="⩔",fU="∨",dU="⩝",hU="ℴ",pU="ℴ",vU="ª",mU="º",gU="⊶",yU="⩖",bU="⩗",wU="⩛",kU="Ⓢ",CU="𝒪",TU="ℴ",xU="Ø",EU="ø",MU="⊘",SU="Õ",OU="õ",LU="⨶",AU="⨷",NU="⊗",DU="Ö",IU="ö",RU="⌽",BU="‾",PU="⏞",HU="⎴",FU="⏜",qU="¶",_U="∥",$U="∥",zU="⫳",VU="⫽",UU="∂",WU="∂",jU="П",GU="п",KU="%",JU=".",XU="‰",YU="⊥",QU="‱",ZU="𝔓",eW="𝔭",tW="Φ",rW="φ",nW="ϕ",iW="ℳ",aW="☎",oW="Π",sW="π",lW="⋔",uW="ϖ",cW="ℏ",fW="ℎ",dW="ℏ",hW="⨣",pW="⊞",vW="⨢",mW="+",gW="∔",yW="⨥",bW="⩲",wW="±",kW="±",CW="⨦",TW="⨧",xW="±",EW="ℌ",MW="⨕",SW="𝕡",OW="ℙ",LW="£",AW="⪷",NW="⪻",DW="≺",IW="≼",RW="⪷",BW="≺",PW="≼",HW="≺",FW="⪯",qW="≼",_W="≾",$W="⪯",zW="⪹",VW="⪵",UW="⋨",WW="⪯",jW="⪳",GW="≾",KW="′",JW="″",XW="ℙ",YW="⪹",QW="⪵",ZW="⋨",e3="∏",t3="∏",r3="⌮",n3="⌒",i3="⌓",a3="∝",o3="∝",s3="∷",l3="∝",u3="≾",c3="⊰",f3="𝒫",d3="𝓅",h3="Ψ",p3="ψ",v3=" ",m3="𝔔",g3="𝔮",y3="⨌",b3="𝕢",w3="ℚ",k3="⁗",C3="𝒬",T3="𝓆",x3="ℍ",E3="⨖",M3="?",S3="≟",O3='"',L3='"',A3="⇛",N3="∽̱",D3="Ŕ",I3="ŕ",R3="√",B3="⦳",P3="⟩",H3="⟫",F3="⦒",q3="⦥",_3="⟩",$3="»",z3="⥵",V3="⇥",U3="⤠",W3="⤳",j3="→",G3="↠",K3="⇒",J3="⤞",X3="↪",Y3="↬",Q3="⥅",Z3="⥴",ej="⤖",tj="↣",rj="↝",nj="⤚",ij="⤜",aj="∶",oj="ℚ",sj="⤍",lj="⤏",uj="⤐",cj="❳",fj="}",dj="]",hj="⦌",pj="⦎",vj="⦐",mj="Ř",gj="ř",yj="Ŗ",bj="ŗ",wj="⌉",kj="}",Cj="Р",Tj="р",xj="⤷",Ej="⥩",Mj="”",Sj="”",Oj="↳",Lj="ℜ",Aj="ℛ",Nj="ℜ",Dj="ℝ",Ij="ℜ",Rj="▭",Bj="®",Pj="®",Hj="∋",Fj="⇋",qj="⥯",_j="⥽",$j="⌋",zj="𝔯",Vj="ℜ",Uj="⥤",Wj="⇁",jj="⇀",Gj="⥬",Kj="Ρ",Jj="ρ",Xj="ϱ",Yj="⟩",Qj="⇥",Zj="→",eG="→",tG="⇒",rG="⇄",nG="↣",iG="⌉",aG="⟧",oG="⥝",sG="⥕",lG="⇂",uG="⌋",cG="⇁",fG="⇀",dG="⇄",hG="⇌",pG="⇉",vG="↝",mG="↦",gG="⊢",yG="⥛",bG="⋌",wG="⧐",kG="⊳",CG="⊵",TG="⥏",xG="⥜",EG="⥔",MG="↾",SG="⥓",OG="⇀",LG="˚",AG="≓",NG="⇄",DG="⇌",IG="‏",RG="⎱",BG="⎱",PG="⫮",HG="⟭",FG="⇾",qG="⟧",_G="⦆",$G="𝕣",zG="ℝ",VG="⨮",UG="⨵",WG="⥰",jG=")",GG="⦔",KG="⨒",JG="⇉",XG="⇛",YG="›",QG="𝓇",ZG="ℛ",e4="↱",t4="↱",r4="]",n4="’",i4="’",a4="⋌",o4="⋊",s4="▹",l4="⊵",u4="▸",c4="⧎",f4="⧴",d4="⥨",h4="℞",p4="Ś",v4="ś",m4="‚",g4="⪸",y4="Š",b4="š",w4="⪼",k4="≻",C4="≽",T4="⪰",x4="⪴",E4="Ş",M4="ş",S4="Ŝ",O4="ŝ",L4="⪺",A4="⪶",N4="⋩",D4="⨓",I4="≿",R4="С",B4="с",P4="⊡",H4="⋅",F4="⩦",q4="⤥",_4="↘",$4="⇘",z4="↘",V4="§",U4=";",W4="⤩",j4="∖",G4="∖",K4="✶",J4="𝔖",X4="𝔰",Y4="⌢",Q4="♯",Z4="Щ",e5="щ",t5="Ш",r5="ш",n5="↓",i5="←",a5="∣",o5="∥",s5="→",l5="↑",u5="­",c5="Σ",f5="σ",d5="ς",h5="ς",p5="∼",v5="⩪",m5="≃",g5="≃",y5="⪞",b5="⪠",w5="⪝",k5="⪟",C5="≆",T5="⨤",x5="⥲",E5="←",M5="∘",S5="∖",O5="⨳",L5="⧤",A5="∣",N5="⌣",D5="⪪",I5="⪬",R5="⪬︀",B5="Ь",P5="ь",H5="⌿",F5="⧄",q5="/",_5="𝕊",$5="𝕤",z5="♠",V5="♠",U5="∥",W5="⊓",j5="⊓︀",G5="⊔",K5="⊔︀",J5="√",X5="⊏",Y5="⊑",Q5="⊏",Z5="⊑",e8="⊐",t8="⊒",r8="⊐",n8="⊒",i8="□",a8="□",o8="⊓",s8="⊏",l8="⊑",u8="⊐",c8="⊒",f8="⊔",d8="▪",h8="□",p8="▪",v8="→",m8="𝒮",g8="𝓈",y8="∖",b8="⌣",w8="⋆",k8="⋆",C8="☆",T8="★",x8="ϵ",E8="ϕ",M8="¯",S8="⊂",O8="⋐",L8="⪽",A8="⫅",N8="⊆",D8="⫃",I8="⫁",R8="⫋",B8="⊊",P8="⪿",H8="⥹",F8="⊂",q8="⋐",_8="⊆",$8="⫅",z8="⊆",V8="⊊",U8="⫋",W8="⫇",j8="⫕",G8="⫓",K8="⪸",J8="≻",X8="≽",Y8="≻",Q8="⪰",Z8="≽",eK="≿",tK="⪰",rK="⪺",nK="⪶",iK="⋩",aK="≿",oK="∋",sK="∑",lK="∑",uK="♪",cK="¹",fK="²",dK="³",hK="⊃",pK="⋑",vK="⪾",mK="⫘",gK="⫆",yK="⊇",bK="⫄",wK="⊃",kK="⊇",CK="⟉",TK="⫗",xK="⥻",EK="⫂",MK="⫌",SK="⊋",OK="⫀",LK="⊃",AK="⋑",NK="⊇",DK="⫆",IK="⊋",RK="⫌",BK="⫈",PK="⫔",HK="⫖",FK="⤦",qK="↙",_K="⇙",$K="↙",zK="⤪",VK="ß",UK=" ",WK="⌖",jK="Τ",GK="τ",KK="⎴",JK="Ť",XK="ť",YK="Ţ",QK="ţ",ZK="Т",e6="т",t6="⃛",r6="⌕",n6="𝔗",i6="𝔱",a6="∴",o6="∴",s6="∴",l6="Θ",u6="θ",c6="ϑ",f6="ϑ",d6="≈",h6="∼",p6="  ",v6=" ",m6=" ",g6="≈",y6="∼",b6="Þ",w6="þ",k6="˜",C6="∼",T6="≃",x6="≅",E6="≈",M6="⨱",S6="⊠",O6="×",L6="⨰",A6="∭",N6="⤨",D6="⌶",I6="⫱",R6="⊤",B6="𝕋",P6="𝕥",H6="⫚",F6="⤩",q6="‴",_6="™",$6="™",z6="▵",V6="▿",U6="◃",W6="⊴",j6="≜",G6="▹",K6="⊵",J6="◬",X6="≜",Y6="⨺",Q6="⃛",Z6="⨹",eJ="⧍",tJ="⨻",rJ="⏢",nJ="𝒯",iJ="𝓉",aJ="Ц",oJ="ц",sJ="Ћ",lJ="ћ",uJ="Ŧ",cJ="ŧ",fJ="≬",dJ="↞",hJ="↠",pJ="Ú",vJ="ú",mJ="↑",gJ="↟",yJ="⇑",bJ="⥉",wJ="Ў",kJ="ў",CJ="Ŭ",TJ="ŭ",xJ="Û",EJ="û",MJ="У",SJ="у",OJ="⇅",LJ="Ű",AJ="ű",NJ="⥮",DJ="⥾",IJ="𝔘",RJ="𝔲",BJ="Ù",PJ="ù",HJ="⥣",FJ="↿",qJ="↾",_J="▀",$J="⌜",zJ="⌜",VJ="⌏",UJ="◸",WJ="Ū",jJ="ū",GJ="¨",KJ="_",JJ="⏟",XJ="⎵",YJ="⏝",QJ="⋃",ZJ="⊎",e9="Ų",t9="ų",r9="𝕌",n9="𝕦",i9="⤒",a9="↑",o9="↑",s9="⇑",l9="⇅",u9="↕",c9="↕",f9="⇕",d9="⥮",h9="↿",p9="↾",v9="⊎",m9="↖",g9="↗",y9="υ",b9="ϒ",w9="ϒ",k9="Υ",C9="υ",T9="↥",x9="⊥",E9="⇈",M9="⌝",S9="⌝",O9="⌎",L9="Ů",A9="ů",N9="◹",D9="𝒰",I9="𝓊",R9="⋰",B9="Ũ",P9="ũ",H9="▵",F9="▴",q9="⇈",_9="Ü",$9="ü",z9="⦧",V9="⦜",U9="ϵ",W9="ϰ",j9="∅",G9="ϕ",K9="ϖ",J9="∝",X9="↕",Y9="⇕",Q9="ϱ",Z9="ς",e7="⊊︀",t7="⫋︀",r7="⊋︀",n7="⫌︀",i7="ϑ",a7="⊲",o7="⊳",s7="⫨",l7="⫫",u7="⫩",c7="В",f7="в",d7="⊢",h7="⊨",p7="⊩",v7="⊫",m7="⫦",g7="⊻",y7="∨",b7="⋁",w7="≚",k7="⋮",C7="|",T7="‖",x7="|",E7="‖",M7="∣",S7="|",O7="❘",L7="≀",A7=" ",N7="𝔙",D7="𝔳",I7="⊲",R7="⊂⃒",B7="⊃⃒",P7="𝕍",H7="𝕧",F7="∝",q7="⊳",_7="𝒱",$7="𝓋",z7="⫋︀",V7="⊊︀",U7="⫌︀",W7="⊋︀",j7="⊪",G7="⦚",K7="Ŵ",J7="ŵ",X7="⩟",Y7="∧",Q7="⋀",Z7="≙",eX="℘",tX="𝔚",rX="𝔴",nX="𝕎",iX="𝕨",aX="℘",oX="≀",sX="≀",lX="𝒲",uX="𝓌",cX="⋂",fX="◯",dX="⋃",hX="▽",pX="𝔛",vX="𝔵",mX="⟷",gX="⟺",yX="Ξ",bX="ξ",wX="⟵",kX="⟸",CX="⟼",TX="⋻",xX="⨀",EX="𝕏",MX="𝕩",SX="⨁",OX="⨂",LX="⟶",AX="⟹",NX="𝒳",DX="𝓍",IX="⨆",RX="⨄",BX="△",PX="⋁",HX="⋀",FX="Ý",qX="ý",_X="Я",$X="я",zX="Ŷ",VX="ŷ",UX="Ы",WX="ы",jX="¥",GX="𝔜",KX="𝔶",JX="Ї",XX="ї",YX="𝕐",QX="𝕪",ZX="𝒴",eY="𝓎",tY="Ю",rY="ю",nY="ÿ",iY="Ÿ",aY="Ź",oY="ź",sY="Ž",lY="ž",uY="З",cY="з",fY="Ż",dY="ż",hY="ℨ",pY="​",vY="Ζ",mY="ζ",gY="𝔷",yY="ℨ",bY="Ж",wY="ж",kY="⇝",CY="𝕫",TY="ℤ",xY="𝒵",EY="𝓏",MY="‍",SY="‌",jh={Aacute:fC,aacute:dC,Abreve:hC,abreve:pC,ac:vC,acd:mC,acE:gC,Acirc:yC,acirc:bC,acute:wC,Acy:kC,acy:CC,AElig:TC,aelig:xC,af:EC,Afr:MC,afr:SC,Agrave:OC,agrave:LC,alefsym:AC,aleph:NC,Alpha:DC,alpha:IC,Amacr:RC,amacr:BC,amalg:PC,amp:HC,AMP:FC,andand:qC,And:_C,and:$C,andd:zC,andslope:VC,andv:UC,ang:WC,ange:jC,angle:GC,angmsdaa:KC,angmsdab:JC,angmsdac:XC,angmsdad:YC,angmsdae:QC,angmsdaf:ZC,angmsdag:e0,angmsdah:t0,angmsd:r0,angrt:n0,angrtvb:i0,angrtvbd:a0,angsph:o0,angst:s0,angzarr:l0,Aogon:u0,aogon:c0,Aopf:f0,aopf:d0,apacir:h0,ap:p0,apE:v0,ape:m0,apid:g0,apos:y0,ApplyFunction:b0,approx:w0,approxeq:k0,Aring:C0,aring:T0,Ascr:x0,ascr:E0,Assign:M0,ast:S0,asymp:O0,asympeq:L0,Atilde:A0,atilde:N0,Auml:D0,auml:I0,awconint:R0,awint:B0,backcong:P0,backepsilon:H0,backprime:F0,backsim:q0,backsimeq:_0,Backslash:$0,Barv:z0,barvee:V0,barwed:U0,Barwed:W0,barwedge:j0,bbrk:G0,bbrktbrk:K0,bcong:J0,Bcy:X0,bcy:Y0,bdquo:Q0,becaus:Z0,because:e1,Because:t1,bemptyv:r1,bepsi:n1,bernou:i1,Bernoullis:a1,Beta:o1,beta:s1,beth:l1,between:u1,Bfr:c1,bfr:f1,bigcap:d1,bigcirc:h1,bigcup:p1,bigodot:v1,bigoplus:m1,bigotimes:g1,bigsqcup:y1,bigstar:b1,bigtriangledown:w1,bigtriangleup:k1,biguplus:C1,bigvee:T1,bigwedge:x1,bkarow:E1,blacklozenge:M1,blacksquare:S1,blacktriangle:O1,blacktriangledown:L1,blacktriangleleft:A1,blacktriangleright:N1,blank:D1,blk12:I1,blk14:R1,blk34:B1,block:P1,bne:H1,bnequiv:F1,bNot:q1,bnot:_1,Bopf:$1,bopf:z1,bot:V1,bottom:U1,bowtie:W1,boxbox:j1,boxdl:G1,boxdL:K1,boxDl:J1,boxDL:X1,boxdr:Y1,boxdR:Q1,boxDr:Z1,boxDR:eT,boxh:tT,boxH:rT,boxhd:nT,boxHd:iT,boxhD:aT,boxHD:oT,boxhu:sT,boxHu:lT,boxhU:uT,boxHU:cT,boxminus:fT,boxplus:dT,boxtimes:hT,boxul:pT,boxuL:vT,boxUl:mT,boxUL:gT,boxur:yT,boxuR:bT,boxUr:wT,boxUR:kT,boxv:CT,boxV:TT,boxvh:xT,boxvH:ET,boxVh:MT,boxVH:ST,boxvl:OT,boxvL:LT,boxVl:AT,boxVL:NT,boxvr:DT,boxvR:IT,boxVr:RT,boxVR:BT,bprime:PT,breve:HT,Breve:FT,brvbar:qT,bscr:_T,Bscr:$T,bsemi:zT,bsim:VT,bsime:UT,bsolb:WT,bsol:jT,bsolhsub:GT,bull:KT,bullet:JT,bump:XT,bumpE:YT,bumpe:QT,Bumpeq:ZT,bumpeq:ex,Cacute:tx,cacute:rx,capand:nx,capbrcup:ix,capcap:ax,cap:ox,Cap:sx,capcup:lx,capdot:ux,CapitalDifferentialD:cx,caps:fx,caret:dx,caron:hx,Cayleys:px,ccaps:vx,Ccaron:mx,ccaron:gx,Ccedil:yx,ccedil:bx,Ccirc:wx,ccirc:kx,Cconint:Cx,ccups:Tx,ccupssm:xx,Cdot:Ex,cdot:Mx,cedil:Sx,Cedilla:Ox,cemptyv:Lx,cent:Ax,centerdot:Nx,CenterDot:Dx,cfr:Ix,Cfr:Rx,CHcy:Bx,chcy:Px,check:Hx,checkmark:Fx,Chi:qx,chi:_x,circ:$x,circeq:zx,circlearrowleft:Vx,circlearrowright:Ux,circledast:Wx,circledcirc:jx,circleddash:Gx,CircleDot:Kx,circledR:Jx,circledS:Xx,CircleMinus:Yx,CirclePlus:Qx,CircleTimes:Zx,cir:eE,cirE:tE,cire:rE,cirfnint:nE,cirmid:iE,cirscir:aE,ClockwiseContourIntegral:oE,CloseCurlyDoubleQuote:sE,CloseCurlyQuote:lE,clubs:uE,clubsuit:cE,colon:fE,Colon:dE,Colone:hE,colone:pE,coloneq:vE,comma:mE,commat:gE,comp:yE,compfn:bE,complement:wE,complexes:kE,cong:CE,congdot:TE,Congruent:xE,conint:EE,Conint:ME,ContourIntegral:SE,copf:OE,Copf:LE,coprod:AE,Coproduct:NE,copy:DE,COPY:IE,copysr:RE,CounterClockwiseContourIntegral:BE,crarr:PE,cross:HE,Cross:FE,Cscr:qE,cscr:_E,csub:$E,csube:zE,csup:VE,csupe:UE,ctdot:WE,cudarrl:jE,cudarrr:GE,cuepr:KE,cuesc:JE,cularr:XE,cularrp:YE,cupbrcap:QE,cupcap:ZE,CupCap:eM,cup:tM,Cup:rM,cupcup:nM,cupdot:iM,cupor:aM,cups:oM,curarr:sM,curarrm:lM,curlyeqprec:uM,curlyeqsucc:cM,curlyvee:fM,curlywedge:dM,curren:hM,curvearrowleft:pM,curvearrowright:vM,cuvee:mM,cuwed:gM,cwconint:yM,cwint:bM,cylcty:wM,dagger:kM,Dagger:CM,daleth:TM,darr:xM,Darr:EM,dArr:MM,dash:SM,Dashv:OM,dashv:LM,dbkarow:AM,dblac:NM,Dcaron:DM,dcaron:IM,Dcy:RM,dcy:BM,ddagger:PM,ddarr:HM,DD:FM,dd:qM,DDotrahd:_M,ddotseq:$M,deg:zM,Del:VM,Delta:UM,delta:WM,demptyv:jM,dfisht:GM,Dfr:KM,dfr:JM,dHar:XM,dharl:YM,dharr:QM,DiacriticalAcute:ZM,DiacriticalDot:eS,DiacriticalDoubleAcute:tS,DiacriticalGrave:rS,DiacriticalTilde:nS,diam:iS,diamond:aS,Diamond:oS,diamondsuit:sS,diams:lS,die:uS,DifferentialD:cS,digamma:fS,disin:dS,div:hS,divide:pS,divideontimes:vS,divonx:mS,DJcy:gS,djcy:yS,dlcorn:bS,dlcrop:wS,dollar:kS,Dopf:CS,dopf:TS,Dot:xS,dot:ES,DotDot:MS,doteq:SS,doteqdot:OS,DotEqual:LS,dotminus:AS,dotplus:NS,dotsquare:DS,doublebarwedge:IS,DoubleContourIntegral:RS,DoubleDot:BS,DoubleDownArrow:PS,DoubleLeftArrow:HS,DoubleLeftRightArrow:FS,DoubleLeftTee:qS,DoubleLongLeftArrow:_S,DoubleLongLeftRightArrow:$S,DoubleLongRightArrow:zS,DoubleRightArrow:VS,DoubleRightTee:US,DoubleUpArrow:WS,DoubleUpDownArrow:jS,DoubleVerticalBar:GS,DownArrowBar:KS,downarrow:JS,DownArrow:XS,Downarrow:YS,DownArrowUpArrow:QS,DownBreve:ZS,downdownarrows:eO,downharpoonleft:tO,downharpoonright:rO,DownLeftRightVector:nO,DownLeftTeeVector:iO,DownLeftVectorBar:aO,DownLeftVector:oO,DownRightTeeVector:sO,DownRightVectorBar:lO,DownRightVector:uO,DownTeeArrow:cO,DownTee:fO,drbkarow:dO,drcorn:hO,drcrop:pO,Dscr:vO,dscr:mO,DScy:gO,dscy:yO,dsol:bO,Dstrok:wO,dstrok:kO,dtdot:CO,dtri:TO,dtrif:xO,duarr:EO,duhar:MO,dwangle:SO,DZcy:OO,dzcy:LO,dzigrarr:AO,Eacute:NO,eacute:DO,easter:IO,Ecaron:RO,ecaron:BO,Ecirc:PO,ecirc:HO,ecir:FO,ecolon:qO,Ecy:_O,ecy:$O,eDDot:zO,Edot:VO,edot:UO,eDot:WO,ee:jO,efDot:GO,Efr:KO,efr:JO,eg:XO,Egrave:YO,egrave:QO,egs:ZO,egsdot:eL,el:tL,Element:rL,elinters:nL,ell:iL,els:aL,elsdot:oL,Emacr:sL,emacr:lL,empty:uL,emptyset:cL,EmptySmallSquare:fL,emptyv:dL,EmptyVerySmallSquare:hL,emsp13:pL,emsp14:vL,emsp:mL,ENG:gL,eng:yL,ensp:bL,Eogon:wL,eogon:kL,Eopf:CL,eopf:TL,epar:xL,eparsl:EL,eplus:ML,epsi:SL,Epsilon:OL,epsilon:LL,epsiv:AL,eqcirc:NL,eqcolon:DL,eqsim:IL,eqslantgtr:RL,eqslantless:BL,Equal:PL,equals:HL,EqualTilde:FL,equest:qL,Equilibrium:_L,equiv:$L,equivDD:zL,eqvparsl:VL,erarr:UL,erDot:WL,escr:jL,Escr:GL,esdot:KL,Esim:JL,esim:XL,Eta:YL,eta:QL,ETH:ZL,eth:eA,Euml:tA,euml:rA,euro:nA,excl:iA,exist:aA,Exists:oA,expectation:sA,exponentiale:lA,ExponentialE:uA,fallingdotseq:cA,Fcy:fA,fcy:dA,female:hA,ffilig:pA,fflig:vA,ffllig:mA,Ffr:gA,ffr:yA,filig:bA,FilledSmallSquare:wA,FilledVerySmallSquare:kA,fjlig:CA,flat:TA,fllig:xA,fltns:EA,fnof:MA,Fopf:SA,fopf:OA,forall:LA,ForAll:AA,fork:NA,forkv:DA,Fouriertrf:IA,fpartint:RA,frac12:BA,frac13:PA,frac14:HA,frac15:FA,frac16:qA,frac18:_A,frac23:$A,frac25:zA,frac34:VA,frac35:UA,frac38:WA,frac45:jA,frac56:GA,frac58:KA,frac78:JA,frasl:XA,frown:YA,fscr:QA,Fscr:ZA,gacute:eN,Gamma:tN,gamma:rN,Gammad:nN,gammad:iN,gap:aN,Gbreve:oN,gbreve:sN,Gcedil:lN,Gcirc:uN,gcirc:cN,Gcy:fN,gcy:dN,Gdot:hN,gdot:pN,ge:vN,gE:mN,gEl:gN,gel:yN,geq:bN,geqq:wN,geqslant:kN,gescc:CN,ges:TN,gesdot:xN,gesdoto:EN,gesdotol:MN,gesl:SN,gesles:ON,Gfr:LN,gfr:AN,gg:NN,Gg:DN,ggg:IN,gimel:RN,GJcy:BN,gjcy:PN,gla:HN,gl:FN,glE:qN,glj:_N,gnap:$N,gnapprox:zN,gne:VN,gnE:UN,gneq:WN,gneqq:jN,gnsim:GN,Gopf:KN,gopf:JN,grave:XN,GreaterEqual:YN,GreaterEqualLess:QN,GreaterFullEqual:ZN,GreaterGreater:eD,GreaterLess:tD,GreaterSlantEqual:rD,GreaterTilde:nD,Gscr:iD,gscr:aD,gsim:oD,gsime:sD,gsiml:lD,gtcc:uD,gtcir:cD,gt:fD,GT:dD,Gt:hD,gtdot:pD,gtlPar:vD,gtquest:mD,gtrapprox:gD,gtrarr:yD,gtrdot:bD,gtreqless:wD,gtreqqless:kD,gtrless:CD,gtrsim:TD,gvertneqq:xD,gvnE:ED,Hacek:MD,hairsp:SD,half:OD,hamilt:LD,HARDcy:AD,hardcy:ND,harrcir:DD,harr:ID,hArr:RD,harrw:BD,Hat:PD,hbar:HD,Hcirc:FD,hcirc:qD,hearts:_D,heartsuit:$D,hellip:zD,hercon:VD,hfr:UD,Hfr:WD,HilbertSpace:jD,hksearow:GD,hkswarow:KD,hoarr:JD,homtht:XD,hookleftarrow:YD,hookrightarrow:QD,hopf:ZD,Hopf:eI,horbar:tI,HorizontalLine:rI,hscr:nI,Hscr:iI,hslash:aI,Hstrok:oI,hstrok:sI,HumpDownHump:lI,HumpEqual:uI,hybull:cI,hyphen:fI,Iacute:dI,iacute:hI,ic:pI,Icirc:vI,icirc:mI,Icy:gI,icy:yI,Idot:bI,IEcy:wI,iecy:kI,iexcl:CI,iff:TI,ifr:xI,Ifr:EI,Igrave:MI,igrave:SI,ii:OI,iiiint:LI,iiint:AI,iinfin:NI,iiota:DI,IJlig:II,ijlig:RI,Imacr:BI,imacr:PI,image:HI,ImaginaryI:FI,imagline:qI,imagpart:_I,imath:$I,Im:zI,imof:VI,imped:UI,Implies:WI,incare:jI,in:"∈",infin:GI,infintie:KI,inodot:JI,intcal:XI,int:YI,Int:QI,integers:ZI,Integral:eR,intercal:tR,Intersection:rR,intlarhk:nR,intprod:iR,InvisibleComma:aR,InvisibleTimes:oR,IOcy:sR,iocy:lR,Iogon:uR,iogon:cR,Iopf:fR,iopf:dR,Iota:hR,iota:pR,iprod:vR,iquest:mR,iscr:gR,Iscr:yR,isin:bR,isindot:wR,isinE:kR,isins:CR,isinsv:TR,isinv:xR,it:ER,Itilde:MR,itilde:SR,Iukcy:OR,iukcy:LR,Iuml:AR,iuml:NR,Jcirc:DR,jcirc:IR,Jcy:RR,jcy:BR,Jfr:PR,jfr:HR,jmath:FR,Jopf:qR,jopf:_R,Jscr:$R,jscr:zR,Jsercy:VR,jsercy:UR,Jukcy:WR,jukcy:jR,Kappa:GR,kappa:KR,kappav:JR,Kcedil:XR,kcedil:YR,Kcy:QR,kcy:ZR,Kfr:eB,kfr:tB,kgreen:rB,KHcy:nB,khcy:iB,KJcy:aB,kjcy:oB,Kopf:sB,kopf:lB,Kscr:uB,kscr:cB,lAarr:fB,Lacute:dB,lacute:hB,laemptyv:pB,lagran:vB,Lambda:mB,lambda:gB,lang:yB,Lang:bB,langd:wB,langle:kB,lap:CB,Laplacetrf:TB,laquo:xB,larrb:EB,larrbfs:MB,larr:SB,Larr:OB,lArr:LB,larrfs:AB,larrhk:NB,larrlp:DB,larrpl:IB,larrsim:RB,larrtl:BB,latail:PB,lAtail:HB,lat:FB,late:qB,lates:_B,lbarr:$B,lBarr:zB,lbbrk:VB,lbrace:UB,lbrack:WB,lbrke:jB,lbrksld:GB,lbrkslu:KB,Lcaron:JB,lcaron:XB,Lcedil:YB,lcedil:QB,lceil:ZB,lcub:eP,Lcy:tP,lcy:rP,ldca:nP,ldquo:iP,ldquor:aP,ldrdhar:oP,ldrushar:sP,ldsh:lP,le:uP,lE:cP,LeftAngleBracket:fP,LeftArrowBar:dP,leftarrow:hP,LeftArrow:pP,Leftarrow:vP,LeftArrowRightArrow:mP,leftarrowtail:gP,LeftCeiling:yP,LeftDoubleBracket:bP,LeftDownTeeVector:wP,LeftDownVectorBar:kP,LeftDownVector:CP,LeftFloor:TP,leftharpoondown:xP,leftharpoonup:EP,leftleftarrows:MP,leftrightarrow:SP,LeftRightArrow:OP,Leftrightarrow:LP,leftrightarrows:AP,leftrightharpoons:NP,leftrightsquigarrow:DP,LeftRightVector:IP,LeftTeeArrow:RP,LeftTee:BP,LeftTeeVector:PP,leftthreetimes:HP,LeftTriangleBar:FP,LeftTriangle:qP,LeftTriangleEqual:_P,LeftUpDownVector:$P,LeftUpTeeVector:zP,LeftUpVectorBar:VP,LeftUpVector:UP,LeftVectorBar:WP,LeftVector:jP,lEg:GP,leg:KP,leq:JP,leqq:XP,leqslant:YP,lescc:QP,les:ZP,lesdot:eH,lesdoto:tH,lesdotor:rH,lesg:nH,lesges:iH,lessapprox:aH,lessdot:oH,lesseqgtr:sH,lesseqqgtr:lH,LessEqualGreater:uH,LessFullEqual:cH,LessGreater:fH,lessgtr:dH,LessLess:hH,lesssim:pH,LessSlantEqual:vH,LessTilde:mH,lfisht:gH,lfloor:yH,Lfr:bH,lfr:wH,lg:kH,lgE:CH,lHar:TH,lhard:xH,lharu:EH,lharul:MH,lhblk:SH,LJcy:OH,ljcy:LH,llarr:AH,ll:NH,Ll:DH,llcorner:IH,Lleftarrow:RH,llhard:BH,lltri:PH,Lmidot:HH,lmidot:FH,lmoustache:qH,lmoust:_H,lnap:$H,lnapprox:zH,lne:VH,lnE:UH,lneq:WH,lneqq:jH,lnsim:GH,loang:KH,loarr:JH,lobrk:XH,longleftarrow:YH,LongLeftArrow:QH,Longleftarrow:ZH,longleftrightarrow:eF,LongLeftRightArrow:tF,Longleftrightarrow:rF,longmapsto:nF,longrightarrow:iF,LongRightArrow:aF,Longrightarrow:oF,looparrowleft:sF,looparrowright:lF,lopar:uF,Lopf:cF,lopf:fF,loplus:dF,lotimes:hF,lowast:pF,lowbar:vF,LowerLeftArrow:mF,LowerRightArrow:gF,loz:yF,lozenge:bF,lozf:wF,lpar:kF,lparlt:CF,lrarr:TF,lrcorner:xF,lrhar:EF,lrhard:MF,lrm:SF,lrtri:OF,lsaquo:LF,lscr:AF,Lscr:NF,lsh:DF,Lsh:IF,lsim:RF,lsime:BF,lsimg:PF,lsqb:HF,lsquo:FF,lsquor:qF,Lstrok:_F,lstrok:$F,ltcc:zF,ltcir:VF,lt:UF,LT:WF,Lt:jF,ltdot:GF,lthree:KF,ltimes:JF,ltlarr:XF,ltquest:YF,ltri:QF,ltrie:ZF,ltrif:eq,ltrPar:tq,lurdshar:rq,luruhar:nq,lvertneqq:iq,lvnE:aq,macr:oq,male:sq,malt:lq,maltese:uq,Map:"⤅",map:cq,mapsto:fq,mapstodown:dq,mapstoleft:hq,mapstoup:pq,marker:vq,mcomma:mq,Mcy:gq,mcy:yq,mdash:bq,mDDot:wq,measuredangle:kq,MediumSpace:Cq,Mellintrf:Tq,Mfr:xq,mfr:Eq,mho:Mq,micro:Sq,midast:Oq,midcir:Lq,mid:Aq,middot:Nq,minusb:Dq,minus:Iq,minusd:Rq,minusdu:Bq,MinusPlus:Pq,mlcp:Hq,mldr:Fq,mnplus:qq,models:_q,Mopf:$q,mopf:zq,mp:Vq,mscr:Uq,Mscr:Wq,mstpos:jq,Mu:Gq,mu:Kq,multimap:Jq,mumap:Xq,nabla:Yq,Nacute:Qq,nacute:Zq,nang:e_,nap:t_,napE:r_,napid:n_,napos:i_,napprox:a_,natural:o_,naturals:s_,natur:l_,nbsp:u_,nbump:c_,nbumpe:f_,ncap:d_,Ncaron:h_,ncaron:p_,Ncedil:v_,ncedil:m_,ncong:g_,ncongdot:y_,ncup:b_,Ncy:w_,ncy:k_,ndash:C_,nearhk:T_,nearr:x_,neArr:E_,nearrow:M_,ne:S_,nedot:O_,NegativeMediumSpace:L_,NegativeThickSpace:A_,NegativeThinSpace:N_,NegativeVeryThinSpace:D_,nequiv:I_,nesear:R_,nesim:B_,NestedGreaterGreater:P_,NestedLessLess:H_,NewLine:F_,nexist:q_,nexists:__,Nfr:$_,nfr:z_,ngE:V_,nge:U_,ngeq:W_,ngeqq:j_,ngeqslant:G_,nges:K_,nGg:J_,ngsim:X_,nGt:Y_,ngt:Q_,ngtr:Z_,nGtv:e$,nharr:t$,nhArr:r$,nhpar:n$,ni:i$,nis:a$,nisd:o$,niv:s$,NJcy:l$,njcy:u$,nlarr:c$,nlArr:f$,nldr:d$,nlE:h$,nle:p$,nleftarrow:v$,nLeftarrow:m$,nleftrightarrow:g$,nLeftrightarrow:y$,nleq:b$,nleqq:w$,nleqslant:k$,nles:C$,nless:T$,nLl:x$,nlsim:E$,nLt:M$,nlt:S$,nltri:O$,nltrie:L$,nLtv:A$,nmid:N$,NoBreak:D$,NonBreakingSpace:I$,nopf:R$,Nopf:B$,Not:P$,not:H$,NotCongruent:F$,NotCupCap:q$,NotDoubleVerticalBar:_$,NotElement:$$,NotEqual:z$,NotEqualTilde:V$,NotExists:U$,NotGreater:W$,NotGreaterEqual:j$,NotGreaterFullEqual:G$,NotGreaterGreater:K$,NotGreaterLess:J$,NotGreaterSlantEqual:X$,NotGreaterTilde:Y$,NotHumpDownHump:Q$,NotHumpEqual:Z$,notin:ez,notindot:tz,notinE:rz,notinva:nz,notinvb:iz,notinvc:az,NotLeftTriangleBar:oz,NotLeftTriangle:sz,NotLeftTriangleEqual:lz,NotLess:uz,NotLessEqual:cz,NotLessGreater:fz,NotLessLess:dz,NotLessSlantEqual:hz,NotLessTilde:pz,NotNestedGreaterGreater:vz,NotNestedLessLess:mz,notni:gz,notniva:yz,notnivb:bz,notnivc:wz,NotPrecedes:kz,NotPrecedesEqual:Cz,NotPrecedesSlantEqual:Tz,NotReverseElement:xz,NotRightTriangleBar:Ez,NotRightTriangle:Mz,NotRightTriangleEqual:Sz,NotSquareSubset:Oz,NotSquareSubsetEqual:Lz,NotSquareSuperset:Az,NotSquareSupersetEqual:Nz,NotSubset:Dz,NotSubsetEqual:Iz,NotSucceeds:Rz,NotSucceedsEqual:Bz,NotSucceedsSlantEqual:Pz,NotSucceedsTilde:Hz,NotSuperset:Fz,NotSupersetEqual:qz,NotTilde:_z,NotTildeEqual:$z,NotTildeFullEqual:zz,NotTildeTilde:Vz,NotVerticalBar:Uz,nparallel:Wz,npar:jz,nparsl:Gz,npart:Kz,npolint:Jz,npr:Xz,nprcue:Yz,nprec:Qz,npreceq:Zz,npre:eV,nrarrc:tV,nrarr:rV,nrArr:nV,nrarrw:iV,nrightarrow:aV,nRightarrow:oV,nrtri:sV,nrtrie:lV,nsc:uV,nsccue:cV,nsce:fV,Nscr:dV,nscr:hV,nshortmid:pV,nshortparallel:vV,nsim:mV,nsime:gV,nsimeq:yV,nsmid:bV,nspar:wV,nsqsube:kV,nsqsupe:CV,nsub:TV,nsubE:xV,nsube:EV,nsubset:MV,nsubseteq:SV,nsubseteqq:OV,nsucc:LV,nsucceq:AV,nsup:NV,nsupE:DV,nsupe:IV,nsupset:RV,nsupseteq:BV,nsupseteqq:PV,ntgl:HV,Ntilde:FV,ntilde:qV,ntlg:_V,ntriangleleft:$V,ntrianglelefteq:zV,ntriangleright:VV,ntrianglerighteq:UV,Nu:WV,nu:jV,num:GV,numero:KV,numsp:JV,nvap:XV,nvdash:YV,nvDash:QV,nVdash:ZV,nVDash:e2,nvge:t2,nvgt:r2,nvHarr:n2,nvinfin:i2,nvlArr:a2,nvle:o2,nvlt:s2,nvltrie:l2,nvrArr:u2,nvrtrie:c2,nvsim:f2,nwarhk:d2,nwarr:h2,nwArr:p2,nwarrow:v2,nwnear:m2,Oacute:g2,oacute:y2,oast:b2,Ocirc:w2,ocirc:k2,ocir:C2,Ocy:T2,ocy:x2,odash:E2,Odblac:M2,odblac:S2,odiv:O2,odot:L2,odsold:A2,OElig:N2,oelig:D2,ofcir:I2,Ofr:R2,ofr:B2,ogon:P2,Ograve:H2,ograve:F2,ogt:q2,ohbar:_2,ohm:$2,oint:z2,olarr:V2,olcir:U2,olcross:W2,oline:j2,olt:G2,Omacr:K2,omacr:J2,Omega:X2,omega:Y2,Omicron:Q2,omicron:Z2,omid:eU,ominus:tU,Oopf:rU,oopf:nU,opar:iU,OpenCurlyDoubleQuote:aU,OpenCurlyQuote:oU,operp:sU,oplus:lU,orarr:uU,Or:cU,or:fU,ord:dU,order:hU,orderof:pU,ordf:vU,ordm:mU,origof:gU,oror:yU,orslope:bU,orv:wU,oS:kU,Oscr:CU,oscr:TU,Oslash:xU,oslash:EU,osol:MU,Otilde:SU,otilde:OU,otimesas:LU,Otimes:AU,otimes:NU,Ouml:DU,ouml:IU,ovbar:RU,OverBar:BU,OverBrace:PU,OverBracket:HU,OverParenthesis:FU,para:qU,parallel:_U,par:$U,parsim:zU,parsl:VU,part:UU,PartialD:WU,Pcy:jU,pcy:GU,percnt:KU,period:JU,permil:XU,perp:YU,pertenk:QU,Pfr:ZU,pfr:eW,Phi:tW,phi:rW,phiv:nW,phmmat:iW,phone:aW,Pi:oW,pi:sW,pitchfork:lW,piv:uW,planck:cW,planckh:fW,plankv:dW,plusacir:hW,plusb:pW,pluscir:vW,plus:mW,plusdo:gW,plusdu:yW,pluse:bW,PlusMinus:wW,plusmn:kW,plussim:CW,plustwo:TW,pm:xW,Poincareplane:EW,pointint:MW,popf:SW,Popf:OW,pound:LW,prap:AW,Pr:NW,pr:DW,prcue:IW,precapprox:RW,prec:BW,preccurlyeq:PW,Precedes:HW,PrecedesEqual:FW,PrecedesSlantEqual:qW,PrecedesTilde:_W,preceq:$W,precnapprox:zW,precneqq:VW,precnsim:UW,pre:WW,prE:jW,precsim:GW,prime:KW,Prime:JW,primes:XW,prnap:YW,prnE:QW,prnsim:ZW,prod:e3,Product:t3,profalar:r3,profline:n3,profsurf:i3,prop:a3,Proportional:o3,Proportion:s3,propto:l3,prsim:u3,prurel:c3,Pscr:f3,pscr:d3,Psi:h3,psi:p3,puncsp:v3,Qfr:m3,qfr:g3,qint:y3,qopf:b3,Qopf:w3,qprime:k3,Qscr:C3,qscr:T3,quaternions:x3,quatint:E3,quest:M3,questeq:S3,quot:O3,QUOT:L3,rAarr:A3,race:N3,Racute:D3,racute:I3,radic:R3,raemptyv:B3,rang:P3,Rang:H3,rangd:F3,range:q3,rangle:_3,raquo:$3,rarrap:z3,rarrb:V3,rarrbfs:U3,rarrc:W3,rarr:j3,Rarr:G3,rArr:K3,rarrfs:J3,rarrhk:X3,rarrlp:Y3,rarrpl:Q3,rarrsim:Z3,Rarrtl:ej,rarrtl:tj,rarrw:rj,ratail:nj,rAtail:ij,ratio:aj,rationals:oj,rbarr:sj,rBarr:lj,RBarr:uj,rbbrk:cj,rbrace:fj,rbrack:dj,rbrke:hj,rbrksld:pj,rbrkslu:vj,Rcaron:mj,rcaron:gj,Rcedil:yj,rcedil:bj,rceil:wj,rcub:kj,Rcy:Cj,rcy:Tj,rdca:xj,rdldhar:Ej,rdquo:Mj,rdquor:Sj,rdsh:Oj,real:Lj,realine:Aj,realpart:Nj,reals:Dj,Re:Ij,rect:Rj,reg:Bj,REG:Pj,ReverseElement:Hj,ReverseEquilibrium:Fj,ReverseUpEquilibrium:qj,rfisht:_j,rfloor:$j,rfr:zj,Rfr:Vj,rHar:Uj,rhard:Wj,rharu:jj,rharul:Gj,Rho:Kj,rho:Jj,rhov:Xj,RightAngleBracket:Yj,RightArrowBar:Qj,rightarrow:Zj,RightArrow:eG,Rightarrow:tG,RightArrowLeftArrow:rG,rightarrowtail:nG,RightCeiling:iG,RightDoubleBracket:aG,RightDownTeeVector:oG,RightDownVectorBar:sG,RightDownVector:lG,RightFloor:uG,rightharpoondown:cG,rightharpoonup:fG,rightleftarrows:dG,rightleftharpoons:hG,rightrightarrows:pG,rightsquigarrow:vG,RightTeeArrow:mG,RightTee:gG,RightTeeVector:yG,rightthreetimes:bG,RightTriangleBar:wG,RightTriangle:kG,RightTriangleEqual:CG,RightUpDownVector:TG,RightUpTeeVector:xG,RightUpVectorBar:EG,RightUpVector:MG,RightVectorBar:SG,RightVector:OG,ring:LG,risingdotseq:AG,rlarr:NG,rlhar:DG,rlm:IG,rmoustache:RG,rmoust:BG,rnmid:PG,roang:HG,roarr:FG,robrk:qG,ropar:_G,ropf:$G,Ropf:zG,roplus:VG,rotimes:UG,RoundImplies:WG,rpar:jG,rpargt:GG,rppolint:KG,rrarr:JG,Rrightarrow:XG,rsaquo:YG,rscr:QG,Rscr:ZG,rsh:e4,Rsh:t4,rsqb:r4,rsquo:n4,rsquor:i4,rthree:a4,rtimes:o4,rtri:s4,rtrie:l4,rtrif:u4,rtriltri:c4,RuleDelayed:f4,ruluhar:d4,rx:h4,Sacute:p4,sacute:v4,sbquo:m4,scap:g4,Scaron:y4,scaron:b4,Sc:w4,sc:k4,sccue:C4,sce:T4,scE:x4,Scedil:E4,scedil:M4,Scirc:S4,scirc:O4,scnap:L4,scnE:A4,scnsim:N4,scpolint:D4,scsim:I4,Scy:R4,scy:B4,sdotb:P4,sdot:H4,sdote:F4,searhk:q4,searr:_4,seArr:$4,searrow:z4,sect:V4,semi:U4,seswar:W4,setminus:j4,setmn:G4,sext:K4,Sfr:J4,sfr:X4,sfrown:Y4,sharp:Q4,SHCHcy:Z4,shchcy:e5,SHcy:t5,shcy:r5,ShortDownArrow:n5,ShortLeftArrow:i5,shortmid:a5,shortparallel:o5,ShortRightArrow:s5,ShortUpArrow:l5,shy:u5,Sigma:c5,sigma:f5,sigmaf:d5,sigmav:h5,sim:p5,simdot:v5,sime:m5,simeq:g5,simg:y5,simgE:b5,siml:w5,simlE:k5,simne:C5,simplus:T5,simrarr:x5,slarr:E5,SmallCircle:M5,smallsetminus:S5,smashp:O5,smeparsl:L5,smid:A5,smile:N5,smt:D5,smte:I5,smtes:R5,SOFTcy:B5,softcy:P5,solbar:H5,solb:F5,sol:q5,Sopf:_5,sopf:$5,spades:z5,spadesuit:V5,spar:U5,sqcap:W5,sqcaps:j5,sqcup:G5,sqcups:K5,Sqrt:J5,sqsub:X5,sqsube:Y5,sqsubset:Q5,sqsubseteq:Z5,sqsup:e8,sqsupe:t8,sqsupset:r8,sqsupseteq:n8,square:i8,Square:a8,SquareIntersection:o8,SquareSubset:s8,SquareSubsetEqual:l8,SquareSuperset:u8,SquareSupersetEqual:c8,SquareUnion:f8,squarf:d8,squ:h8,squf:p8,srarr:v8,Sscr:m8,sscr:g8,ssetmn:y8,ssmile:b8,sstarf:w8,Star:k8,star:C8,starf:T8,straightepsilon:x8,straightphi:E8,strns:M8,sub:S8,Sub:O8,subdot:L8,subE:A8,sube:N8,subedot:D8,submult:I8,subnE:R8,subne:B8,subplus:P8,subrarr:H8,subset:F8,Subset:q8,subseteq:_8,subseteqq:$8,SubsetEqual:z8,subsetneq:V8,subsetneqq:U8,subsim:W8,subsub:j8,subsup:G8,succapprox:K8,succ:J8,succcurlyeq:X8,Succeeds:Y8,SucceedsEqual:Q8,SucceedsSlantEqual:Z8,SucceedsTilde:eK,succeq:tK,succnapprox:rK,succneqq:nK,succnsim:iK,succsim:aK,SuchThat:oK,sum:sK,Sum:lK,sung:uK,sup1:cK,sup2:fK,sup3:dK,sup:hK,Sup:pK,supdot:vK,supdsub:mK,supE:gK,supe:yK,supedot:bK,Superset:wK,SupersetEqual:kK,suphsol:CK,suphsub:TK,suplarr:xK,supmult:EK,supnE:MK,supne:SK,supplus:OK,supset:LK,Supset:AK,supseteq:NK,supseteqq:DK,supsetneq:IK,supsetneqq:RK,supsim:BK,supsub:PK,supsup:HK,swarhk:FK,swarr:qK,swArr:_K,swarrow:$K,swnwar:zK,szlig:VK,Tab:UK,target:WK,Tau:jK,tau:GK,tbrk:KK,Tcaron:JK,tcaron:XK,Tcedil:YK,tcedil:QK,Tcy:ZK,tcy:e6,tdot:t6,telrec:r6,Tfr:n6,tfr:i6,there4:a6,therefore:o6,Therefore:s6,Theta:l6,theta:u6,thetasym:c6,thetav:f6,thickapprox:d6,thicksim:h6,ThickSpace:p6,ThinSpace:v6,thinsp:m6,thkap:g6,thksim:y6,THORN:b6,thorn:w6,tilde:k6,Tilde:C6,TildeEqual:T6,TildeFullEqual:x6,TildeTilde:E6,timesbar:M6,timesb:S6,times:O6,timesd:L6,tint:A6,toea:N6,topbot:D6,topcir:I6,top:R6,Topf:B6,topf:P6,topfork:H6,tosa:F6,tprime:q6,trade:_6,TRADE:$6,triangle:z6,triangledown:V6,triangleleft:U6,trianglelefteq:W6,triangleq:j6,triangleright:G6,trianglerighteq:K6,tridot:J6,trie:X6,triminus:Y6,TripleDot:Q6,triplus:Z6,trisb:eJ,tritime:tJ,trpezium:rJ,Tscr:nJ,tscr:iJ,TScy:aJ,tscy:oJ,TSHcy:sJ,tshcy:lJ,Tstrok:uJ,tstrok:cJ,twixt:fJ,twoheadleftarrow:dJ,twoheadrightarrow:hJ,Uacute:pJ,uacute:vJ,uarr:mJ,Uarr:gJ,uArr:yJ,Uarrocir:bJ,Ubrcy:wJ,ubrcy:kJ,Ubreve:CJ,ubreve:TJ,Ucirc:xJ,ucirc:EJ,Ucy:MJ,ucy:SJ,udarr:OJ,Udblac:LJ,udblac:AJ,udhar:NJ,ufisht:DJ,Ufr:IJ,ufr:RJ,Ugrave:BJ,ugrave:PJ,uHar:HJ,uharl:FJ,uharr:qJ,uhblk:_J,ulcorn:$J,ulcorner:zJ,ulcrop:VJ,ultri:UJ,Umacr:WJ,umacr:jJ,uml:GJ,UnderBar:KJ,UnderBrace:JJ,UnderBracket:XJ,UnderParenthesis:YJ,Union:QJ,UnionPlus:ZJ,Uogon:e9,uogon:t9,Uopf:r9,uopf:n9,UpArrowBar:i9,uparrow:a9,UpArrow:o9,Uparrow:s9,UpArrowDownArrow:l9,updownarrow:u9,UpDownArrow:c9,Updownarrow:f9,UpEquilibrium:d9,upharpoonleft:h9,upharpoonright:p9,uplus:v9,UpperLeftArrow:m9,UpperRightArrow:g9,upsi:y9,Upsi:b9,upsih:w9,Upsilon:k9,upsilon:C9,UpTeeArrow:T9,UpTee:x9,upuparrows:E9,urcorn:M9,urcorner:S9,urcrop:O9,Uring:L9,uring:A9,urtri:N9,Uscr:D9,uscr:I9,utdot:R9,Utilde:B9,utilde:P9,utri:H9,utrif:F9,uuarr:q9,Uuml:_9,uuml:$9,uwangle:z9,vangrt:V9,varepsilon:U9,varkappa:W9,varnothing:j9,varphi:G9,varpi:K9,varpropto:J9,varr:X9,vArr:Y9,varrho:Q9,varsigma:Z9,varsubsetneq:e7,varsubsetneqq:t7,varsupsetneq:r7,varsupsetneqq:n7,vartheta:i7,vartriangleleft:a7,vartriangleright:o7,vBar:s7,Vbar:l7,vBarv:u7,Vcy:c7,vcy:f7,vdash:d7,vDash:h7,Vdash:p7,VDash:v7,Vdashl:m7,veebar:g7,vee:y7,Vee:b7,veeeq:w7,vellip:k7,verbar:C7,Verbar:T7,vert:x7,Vert:E7,VerticalBar:M7,VerticalLine:S7,VerticalSeparator:O7,VerticalTilde:L7,VeryThinSpace:A7,Vfr:N7,vfr:D7,vltri:I7,vnsub:R7,vnsup:B7,Vopf:P7,vopf:H7,vprop:F7,vrtri:q7,Vscr:_7,vscr:$7,vsubnE:z7,vsubne:V7,vsupnE:U7,vsupne:W7,Vvdash:j7,vzigzag:G7,Wcirc:K7,wcirc:J7,wedbar:X7,wedge:Y7,Wedge:Q7,wedgeq:Z7,weierp:eX,Wfr:tX,wfr:rX,Wopf:nX,wopf:iX,wp:aX,wr:oX,wreath:sX,Wscr:lX,wscr:uX,xcap:cX,xcirc:fX,xcup:dX,xdtri:hX,Xfr:pX,xfr:vX,xharr:mX,xhArr:gX,Xi:yX,xi:bX,xlarr:wX,xlArr:kX,xmap:CX,xnis:TX,xodot:xX,Xopf:EX,xopf:MX,xoplus:SX,xotime:OX,xrarr:LX,xrArr:AX,Xscr:NX,xscr:DX,xsqcup:IX,xuplus:RX,xutri:BX,xvee:PX,xwedge:HX,Yacute:FX,yacute:qX,YAcy:_X,yacy:$X,Ycirc:zX,ycirc:VX,Ycy:UX,ycy:WX,yen:jX,Yfr:GX,yfr:KX,YIcy:JX,yicy:XX,Yopf:YX,yopf:QX,Yscr:ZX,yscr:eY,YUcy:tY,yucy:rY,yuml:nY,Yuml:iY,Zacute:aY,zacute:oY,Zcaron:sY,zcaron:lY,Zcy:uY,zcy:cY,Zdot:fY,zdot:dY,zeetrf:hY,ZeroWidthSpace:pY,Zeta:vY,zeta:mY,zfr:gY,Zfr:yY,ZHcy:bY,zhcy:wY,zigrarr:kY,zopf:CY,Zopf:TY,Zscr:xY,zscr:EY,zwj:MY,zwnj:SY},OY="Á",LY="á",AY="Â",NY="â",DY="´",IY="Æ",RY="æ",BY="À",PY="à",HY="&",FY="&",qY="Å",_Y="å",$Y="Ã",zY="ã",VY="Ä",UY="ä",WY="¦",jY="Ç",GY="ç",KY="¸",JY="¢",XY="©",YY="©",QY="¤",ZY="°",eQ="÷",tQ="É",rQ="é",nQ="Ê",iQ="ê",aQ="È",oQ="è",sQ="Ð",lQ="ð",uQ="Ë",cQ="ë",fQ="½",dQ="¼",hQ="¾",pQ=">",vQ=">",mQ="Í",gQ="í",yQ="Î",bQ="î",wQ="¡",kQ="Ì",CQ="ì",TQ="¿",xQ="Ï",EQ="ï",MQ="«",SQ="<",OQ="<",LQ="¯",AQ="µ",NQ="·",DQ=" ",IQ="¬",RQ="Ñ",BQ="ñ",PQ="Ó",HQ="ó",FQ="Ô",qQ="ô",_Q="Ò",$Q="ò",zQ="ª",VQ="º",UQ="Ø",WQ="ø",jQ="Õ",GQ="õ",KQ="Ö",JQ="ö",XQ="¶",YQ="±",QQ="£",ZQ='"',eZ='"',tZ="»",rZ="®",nZ="®",iZ="§",aZ="­",oZ="¹",sZ="²",lZ="³",uZ="ß",cZ="Þ",fZ="þ",dZ="×",hZ="Ú",pZ="ú",vZ="Û",mZ="û",gZ="Ù",yZ="ù",bZ="¨",wZ="Ü",kZ="ü",CZ="Ý",TZ="ý",xZ="¥",EZ="ÿ",MZ={Aacute:OY,aacute:LY,Acirc:AY,acirc:NY,acute:DY,AElig:IY,aelig:RY,Agrave:BY,agrave:PY,amp:HY,AMP:FY,Aring:qY,aring:_Y,Atilde:$Y,atilde:zY,Auml:VY,auml:UY,brvbar:WY,Ccedil:jY,ccedil:GY,cedil:KY,cent:JY,copy:XY,COPY:YY,curren:QY,deg:ZY,divide:eQ,Eacute:tQ,eacute:rQ,Ecirc:nQ,ecirc:iQ,Egrave:aQ,egrave:oQ,ETH:sQ,eth:lQ,Euml:uQ,euml:cQ,frac12:fQ,frac14:dQ,frac34:hQ,gt:pQ,GT:vQ,Iacute:mQ,iacute:gQ,Icirc:yQ,icirc:bQ,iexcl:wQ,Igrave:kQ,igrave:CQ,iquest:TQ,Iuml:xQ,iuml:EQ,laquo:MQ,lt:SQ,LT:OQ,macr:LQ,micro:AQ,middot:NQ,nbsp:DQ,not:IQ,Ntilde:RQ,ntilde:BQ,Oacute:PQ,oacute:HQ,Ocirc:FQ,ocirc:qQ,Ograve:_Q,ograve:$Q,ordf:zQ,ordm:VQ,Oslash:UQ,oslash:WQ,Otilde:jQ,otilde:GQ,Ouml:KQ,ouml:JQ,para:XQ,plusmn:YQ,pound:QQ,quot:ZQ,QUOT:eZ,raquo:tZ,reg:rZ,REG:nZ,sect:iZ,shy:aZ,sup1:oZ,sup2:sZ,sup3:lZ,szlig:uZ,THORN:cZ,thorn:fZ,times:dZ,Uacute:hZ,uacute:pZ,Ucirc:vZ,ucirc:mZ,Ugrave:gZ,ugrave:yZ,uml:bZ,Uuml:wZ,uuml:kZ,Yacute:CZ,yacute:TZ,yen:xZ,yuml:EZ},SZ="&",OZ="'",LZ=">",AZ="<",NZ='"',Gh={amp:SZ,apos:OZ,gt:LZ,lt:AZ,quot:NZ},Ks={},DZ={0:65533,128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376},IZ=en&&en.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ks,"__esModule",{value:!0});var ic=IZ(DZ),RZ=String.fromCodePoint||function(r){var e="";return r>65535&&(r-=65536,e+=String.fromCharCode(r>>>10&1023|55296),r=56320|r&1023),e+=String.fromCharCode(r),e};function BZ(r){return r>=55296&&r<=57343||r>1114111?"�":(r in ic.default&&(r=ic.default[r]),RZ(r))}Ks.default=BZ;var ha=en&&en.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Mt,"__esModule",{value:!0});Mt.decodeHTML=Mt.decodeHTMLStrict=Mt.decodeXML=void 0;var jo=ha(jh),PZ=ha(MZ),HZ=ha(Gh),ac=ha(Ks),FZ=/&(?:[a-zA-Z0-9]+|#[xX][\da-fA-F]+|#\d+);/g;Mt.decodeXML=Kh(HZ.default);Mt.decodeHTMLStrict=Kh(jo.default);function Kh(r){var e=Jh(r);return function(t){return String(t).replace(FZ,e)}}var oc=function(r,e){return r1?zZ(r):r.charCodeAt(0)).toString(16).toUpperCase()+";"}function VZ(r,e){return function(t){return t.replace(e,function(n){return r[n]}).replace(tp,pa)}}var rp=new RegExp(Qh.source+"|"+tp.source,"g");function UZ(r){return r.replace(rp,pa)}qe.escape=UZ;function WZ(r){return r.replace(Qh,pa)}qe.escapeUTF8=WZ;function np(r){return function(e){return e.replace(rp,function(t){return r[t]||pa(t)})}}(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.decodeXMLStrict=r.decodeHTML5Strict=r.decodeHTML4Strict=r.decodeHTML5=r.decodeHTML4=r.decodeHTMLStrict=r.decodeHTML=r.decodeXML=r.encodeHTML5=r.encodeHTML4=r.escapeUTF8=r.escape=r.encodeNonAsciiHTML=r.encodeHTML=r.encodeXML=r.encode=r.decodeStrict=r.decode=void 0;var e=Mt,t=qe;function n(l,u){return(!u||u<=0?e.decodeXML:e.decodeHTML)(l)}r.decode=n;function i(l,u){return(!u||u<=0?e.decodeXML:e.decodeHTMLStrict)(l)}r.decodeStrict=i;function a(l,u){return(!u||u<=0?t.encodeXML:t.encodeHTML)(l)}r.encode=a;var o=qe;Object.defineProperty(r,"encodeXML",{enumerable:!0,get:function(){return o.encodeXML}}),Object.defineProperty(r,"encodeHTML",{enumerable:!0,get:function(){return o.encodeHTML}}),Object.defineProperty(r,"encodeNonAsciiHTML",{enumerable:!0,get:function(){return o.encodeNonAsciiHTML}}),Object.defineProperty(r,"escape",{enumerable:!0,get:function(){return o.escape}}),Object.defineProperty(r,"escapeUTF8",{enumerable:!0,get:function(){return o.escapeUTF8}}),Object.defineProperty(r,"encodeHTML4",{enumerable:!0,get:function(){return o.encodeHTML}}),Object.defineProperty(r,"encodeHTML5",{enumerable:!0,get:function(){return o.encodeHTML}});var s=Mt;Object.defineProperty(r,"decodeXML",{enumerable:!0,get:function(){return s.decodeXML}}),Object.defineProperty(r,"decodeHTML",{enumerable:!0,get:function(){return s.decodeHTML}}),Object.defineProperty(r,"decodeHTMLStrict",{enumerable:!0,get:function(){return s.decodeHTMLStrict}}),Object.defineProperty(r,"decodeHTML4",{enumerable:!0,get:function(){return s.decodeHTML}}),Object.defineProperty(r,"decodeHTML5",{enumerable:!0,get:function(){return s.decodeHTML}}),Object.defineProperty(r,"decodeHTML4Strict",{enumerable:!0,get:function(){return s.decodeHTMLStrict}}),Object.defineProperty(r,"decodeHTML5Strict",{enumerable:!0,get:function(){return s.decodeHTMLStrict}}),Object.defineProperty(r,"decodeXMLStrict",{enumerable:!0,get:function(){return s.decodeXML}})})(Gs);var ip="&(?:#x[a-f0-9]{1,6}|#[0-9]{1,7}|[a-z][a-z0-9]{1,31});",jZ=92,GZ=/[\\&]/,Xs="[!\"#$%&'()*+,./:;<=>?@[\\\\\\]^_`{|}~-]",KZ=new RegExp("\\\\"+Xs+"|"+ip,"gi"),JZ='[&<>"]',sc=new RegExp(JZ,"g"),XZ=function(r){return r.charCodeAt(0)===jZ?r.charAt(1):Gs.decodeHTML(r)};function On(r){return GZ.test(r)?r.replace(KZ,XZ):r}function ii(r){try{return cC(r)}catch{return r}}function YZ(r){switch(r){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";default:return r}}function Fr(r){return sc.test(r)?r.replace(sc,YZ):r}function Go(r,e){for(var t=[],n=0;n`\\x00-\\x20]+",bee="'[^']*'",wee='"[^"]*"',kee="(?:"+yee+"|"+bee+"|"+wee+")",Cee="(?:\\s*=\\s*"+kee+")",Tee="(?:\\s+"+gee+Cee+"?)",lp="<"+sp+Tee+"*\\s*/?>",up="]",xee="|",Eee="[<][?].*?[?][>]",Mee="]*>",See="",Oee="(?:"+lp+"|"+up+"|"+xee+"|"+Eee+"|"+Mee+"|"+See+")",Lee=new RegExp("^"+Oee,"i");/*! http://mths.be/fromcodepoint v0.2.1 by @mathias */var Jo;if(String.fromCodePoint)Jo=function(r){try{return String.fromCodePoint(r)}catch(e){if(e instanceof RangeError)return"�";throw e}};else{var Aee=String.fromCharCode,Nee=Math.floor;Jo=function(){for(var r=[],e=0;e1114111||Nee(u)!==u)return"�";u<=65535?n.push(u):(u-=65536,i=(u>>10)+55296,a=u%1024+56320,n.push(i,a)),(o+1===s||n.length>t)&&(l+=Aee.apply(void 0,n),n.length=0)}return l}}var io=Jo,Dee="(?:[w-]+.)*[A-Za-z0-9-]+.[A-Za-z0-9-]+",Iee="[^<\\s]*[^l&&p.push(te(o.substring(l,g[0]),d(l,g[0]-1)));var T=Y("link",d.apply(void 0,g));T.appendChild(te(C,d.apply(void 0,g))),T.destination=w,T.extendedAutolink=!0,p.push(T),l=g[1]+1}l?@\[\]\\^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/),Kee=new RegExp('^(?:"('+so+'|[^"\\x00])*"|'+("'("+so+"|[^'\\x00])*'")+"|"+("\\(("+so+"|[^()\\x00])*\\))")),Jee=/^(?:<(?:[^<>\n\\\x00]|\\.)*>)/,mc=new RegExp("^"+Xs),Xee=new RegExp("^"+ip,"i"),Yee=/`+/,Qee=/^`+/,Zee=/\.\.\./g,ete=/--+/g,tte=/^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/,rte=/^<[A-Za-z][A-Za-z0-9.+-]{1,31}:[^<>\x00-\x20]*>/i,nte=/^ *(?:\n *)?/,lo=/^[ \t\n\x0b\x0c\x0d]/,gc=/^\s/,ite=/ *$/,ate=/^ */,yc=/^ *(?:\n|$)/,ote=/^\[(?:[^\\\[\]]|\\.){0,1000}\]/,ste=/^[^\n`\[\]\\!<&*_'"~$]+/m,lte=function(){function r(e){this.subject="",this.delimiters=null,this.brackets=null,this.pos=0,this.lineStartNum=0,this.lineIdx=0,this.lineOffsets=[0],this.linePosOffset=0,this.refMap={},this.refLinkCandidateMap={},this.refDefCandidateMap={},this.options=e}return r.prototype.sourcepos=function(e,t){var n=this.linePosOffset+this.lineOffsets[this.lineIdx],i=this.lineStartNum+this.lineIdx,a=[i,e+n];return typeof t=="number"?[a,[i,t+n]]:a},r.prototype.nextLine=function(){this.lineIdx+=1,this.linePosOffset=-this.pos},r.prototype.match=function(e){var t=e.exec(this.subject.slice(this.pos));return t===null?null:(this.pos+=t.index+t[0].length,t[0])},r.prototype.peek=function(){return this.pos1){var u=Ui(l);this.lineIdx+=l.length-1,this.linePosOffset=-(this.pos-u.length-n.length),s[1]=this.sourcepos(this.pos),o=l.join(" ")}var c=Y("code",s);return o.length>0&&o.match(/[^ ]/)!==null&&o[0]==" "&&o[o.length-1]==" "?c.literal=o.slice(1,o.length-1):c.literal=o,c.tickCount=n.length,e.appendChild(c),!0}return this.pos=i,e.appendChild(te(n,this.sourcepos(t,this.pos-1))),!0},r.prototype.parseBackslash=function(e){var t=this.subject,n;this.pos+=1;var i=this.pos;return this.peek()===Xo?(this.pos+=1,n=Y("linebreak",this.sourcepos(this.pos-1,this.pos)),e.appendChild(n),this.nextLine()):mc.test(t.charAt(this.pos))?(e.appendChild(te(t.charAt(this.pos),this.sourcepos(i,this.pos))),this.pos+=1):e.appendChild(te("\\",this.sourcepos(i,i))),!0},r.prototype.parseAutolink=function(e){var t,n,i,a=this.pos+1;return(t=this.match(tte))?(n=t.slice(1,t.length-1),i=Y("link",this.sourcepos(a,this.pos)),i.destination=ii("mailto:"+n),i.title="",i.appendChild(te(n,this.sourcepos(a+1,this.pos-1))),e.appendChild(i),!0):(t=this.match(rte))?(n=t.slice(1,t.length-1),i=Y("link",this.sourcepos(a,this.pos)),i.destination=ii(n),i.title="",i.appendChild(te(n,this.sourcepos(a+1,this.pos-1))),e.appendChild(i),!0):!1},r.prototype.parseHtmlTag=function(e){var t=this.pos+1,n=this.match(Lee);if(n===null)return!1;var i=Y("htmlInline",this.sourcepos(t,this.pos));return i.literal=n,e.appendChild(i),!0},r.prototype.scanDelims=function(e){var t=0,n=this.pos;if(e===Zt||e===er)t++,this.pos++;else for(;this.peek()===e;)t++,this.pos++;if(t===0||t<2&&(e===si||e===tr))return this.pos=n,null;var i=n===0?` +`:this.subject.charAt(n-1),a=this.peek(),o;a===-1?o=` +`:o=io(a);var s=gc.test(o),l=vc.test(o),u=gc.test(i),c=vc.test(i),f=!s&&(!l||u||c),d=!u&&(!c||s||l),p,h;return e===oi?(p=f&&(!d||c),h=d&&(!f||l)):e===Zt||e===er?(p=f&&!d,h=d):e===tr?(p=!s,h=!u):(p=f,h=d),this.pos=n,{numdelims:t,canOpen:p,canClose:h}},r.prototype.handleDelim=function(e,t){var n=this.scanDelims(e);if(!n)return!1;var i=n.numdelims,a=this.pos+1,o;this.pos+=i,e===Zt?o="’":e===er?o="“":o=this.subject.slice(a-1,this.pos);var s=te(o,this.sourcepos(a,this.pos));return t.appendChild(s),(n.canOpen||n.canClose)&&(this.options.smart||e!==Zt&&e!==er)&&(this.delimiters={cc:e,numdelims:i,origdelims:i,node:s,previous:this.delimiters,next:null,canOpen:n.canOpen,canClose:n.canClose},this.delimiters.previous&&(this.delimiters.previous.next=this.delimiters)),!0},r.prototype.removeDelimiter=function(e){e.previous!==null&&(e.previous.next=e.next),e.next===null?this.delimiters=e.previous:e.next.previous=e.previous},r.prototype.removeDelimitersBetween=function(e,t){e.next!==t&&(e.next=t,t.previous=e)},r.prototype.processEmphasis=function(e){var t,n,i,a,o,s,l,u=!1,c=(t={},t[oi]=[e,e,e],t[ao]=[e,e,e],t[Zt]=[e],t[er]=[e],t[si]=[e],t[tr]=[e],t);for(i=this.delimiters;i!==null&&i.previous!==e;)i=i.previous;for(;i!==null;){var f=i.cc,d=f===oi||f===ao;if(!i.canClose)i=i.next;else{for(n=i.previous,l=!1;n!==null&&n!==e&&n!==c[f][d?i.origdelims%3:0];){if(u=d&&(i.canOpen||n.canClose)&&i.origdelims%3!==0&&(n.origdelims+i.origdelims)%3===0,n.cc===i.cc&&n.canOpen&&!u){l=!0;break}n=n.previous}if(a=i,d||f===si||f===tr){if(!l)i=i.next;else if(n){var p=i.numdelims>=2&&n.numdelims>=2?2:1,h=d?0:1;o=n.node,s=i.node;var v=d?p===1?"emph":"strong":"strike";f===tr&&(v="customInline");var m=Y(v),g=o.sourcepos[1],w=s.sourcepos[0];m.sourcepos=[[g[0],g[1]-p+1],[w[0],w[1]+p-1]],o.sourcepos[1][1]-=p,s.sourcepos[0][1]+=p,o.literal=o.literal.slice(p),s.literal=s.literal.slice(p),n.numdelims-=p,i.numdelims-=p;for(var C=o.next,T=void 0;C&&C!==s;)T=C.next,C.unlink(),m.appendChild(C),C=T;if(f===tr){var x=m.firstChild,M=x.literal||"",D=M.split(/\s/)[0];m.info=D,M.length<=D.length?x.unlink():(x.sourcepos[0][1]+=D.length,x.literal=M.replace(D+" ",""))}if(o.insertAfter(m),this.removeDelimitersBetween(n,i),n.numdelims<=h&&(n.numdelims===0&&o.unlink(),this.removeDelimiter(n)),i.numdelims<=h){i.numdelims===0&&s.unlink();var R=i.next;this.removeDelimiter(i),i=R}}}else f===Zt?(i.node.literal="’",l&&(n.node.literal="‘"),i=i.next):f===er&&(i.node.literal="”",l&&(n.node.literal="“"),i=i.next);l||(c[f][d?a.origdelims%3:0]=a.previous,a.canOpen||this.removeDelimiter(a))}}for(;this.delimiters!==null&&this.delimiters!==e;)this.removeDelimiter(this.delimiters)},r.prototype.parseLinkTitle=function(){var e=this.match(Kee);return e===null?null:On(e.substr(1,e.length-2))},r.prototype.parseLinkDestination=function(){var e=this.match(Jee);if(e===null){if(this.peek()===dc)return null;for(var t=this.pos,n=0,i=void 0;(i=this.peek())!==-1;)if(i===hc&&mc.test(this.subject.charAt(this.pos+1)))this.pos+=1,this.peek()!==-1&&(this.pos+=1);else if(i===pc)this.pos+=1,n+=1;else if(i===oo){if(n<1)break;this.pos+=1,n-=1}else{if(lo.exec(io(i))!==null)break;this.pos+=1}return this.pos===t&&i!==oo||n!==0?null:(e=this.subject.substr(t,this.pos-t),ii(On(e)))}return ii(On(e.substr(1,e.length-2)))},r.prototype.parseLinkLabel=function(){var e=this.match(ote);return e===null||e.length>1001?0:e.length},r.prototype.parseOpenBracket=function(e){var t=this.pos;this.pos+=1;var n=te("[",this.sourcepos(this.pos,this.pos));return e.appendChild(n),this.addBracket(n,t,!1),!0},r.prototype.parseBang=function(e){var t=this.pos;if(this.pos+=1,this.peek()===fc){this.pos+=1;var n=te("![",this.sourcepos(this.pos-1,this.pos));e.appendChild(n),this.addBracket(n,t+1,!0)}else{var n=te("!",this.sourcepos(this.pos,this.pos));e.appendChild(n)}return!0},r.prototype.parseCloseBracket=function(e){var t=null,n=null,i=!1;this.pos+=1;var a=this.pos,o=this.brackets;if(o===null)return e.appendChild(te("]",this.sourcepos(a,a))),!0;if(!o.active)return e.appendChild(te("]",this.sourcepos(a,a))),this.removeBracket(),!0;var s=o.image,l=this.pos;this.peek()===pc&&(this.pos++,this.spnl()&&(t=this.parseLinkDestination())!==null&&this.spnl()&&(lo.test(this.subject.charAt(this.pos-1))&&(n=this.parseLinkTitle())||!0)&&this.spnl()&&this.peek()===oo?(this.pos+=1,i=!0):this.pos=l);var u="";if(!i){var c=this.pos,f=this.parseLinkLabel();if(f>2?u=this.subject.slice(c,c+f):o.bracketAfter||(u=this.subject.slice(o.index,a)),f===0&&(this.pos=l),u){u=cc(u);var d=this.refMap[u];d&&(t=d.destination,n=d.title,i=!0)}}if(i){var p=Y(s?"image":"link");p.destination=t,p.title=n||"",p.sourcepos=[o.startpos,this.sourcepos(this.pos)];for(var h=o.node.next,v=void 0;h;)v=h.next,h.unlink(),p.appendChild(h),h=v;if(e.appendChild(p),this.processEmphasis(o.previousDelimiter),this.removeBracket(),o.node.unlink(),!s)for(o=this.brackets;o!==null;)o.image||(o.active=!1),o=o.previous;return this.options.referenceDefinition&&(this.refLinkCandidateMap[e.id]={node:e,refLabel:u}),!0}return this.removeBracket(),this.pos=a,e.appendChild(te("]",this.sourcepos(a,a))),this.options.referenceDefinition&&(this.refLinkCandidateMap[e.id]={node:e,refLabel:u}),!0},r.prototype.addBracket=function(e,t,n){this.brackets!==null&&(this.brackets.bracketAfter=!0),this.brackets={node:e,startpos:this.sourcepos(t+(n?0:1)),previous:this.brackets,previousDelimiter:this.delimiters,index:t,image:n,active:!0}},r.prototype.removeBracket=function(){this.brackets&&(this.brackets=this.brackets.previous)},r.prototype.parseEntity=function(e){var t,n=this.pos+1;return(t=this.match(Xee))?(e.appendChild(te(Gs.decodeHTML(t),this.sourcepos(n,this.pos))),!0):!1},r.prototype.parseString=function(e){var t,n=this.pos+1;if(t=this.match(ste)){if(this.options.smart){var i=t.replace(Zee,"…").replace(ete,function(o){var s=0,l=0;return o.length%3===0?l=o.length/3:o.length%2===0?s=o.length/2:o.length%3===2?(s=1,l=(o.length-2)/3):(s=2,l=(o.length-4)/3),Go("—",l)+Go("–",s)});e.appendChild(te(i,this.sourcepos(n,this.pos)))}else{var a=te(t,this.sourcepos(n,this.pos));e.appendChild(a)}return!0}return!1},r.prototype.parseNewline=function(e){this.pos+=1;var t=e.lastChild;if(t&&t.type==="text"&&t.literal[t.literal.length-1]===" "){var n=t.literal[t.literal.length-2]===" ",i=t.literal.length;t.literal=t.literal.replace(ite,"");var a=i-t.literal.length;t.sourcepos[1][1]-=a,e.appendChild(Y(n?"linebreak":"softbreak",this.sourcepos(this.pos-a,this.pos)))}else e.appendChild(Y("softbreak",this.sourcepos(this.pos,this.pos)));return this.nextLine(),this.match(ate),!0},r.prototype.parseReference=function(e,t){if(!this.options.referenceDefinition)return 0;this.subject=e.stringContent,this.pos=0;var n=null,i=this.pos,a=this.parseLinkLabel();if(a===0)return 0;var o=this.subject.substr(0,a);if(this.peek()===Gee)this.pos++;else return this.pos=i,0;this.spnl();var s=this.parseLinkDestination();if(s===null)return this.pos=i,0;var l=this.pos;this.spnl(),this.pos!==l&&(n=this.parseLinkTitle()),n===null&&(n="",this.pos=l);var u=!0;if(this.match(yc)===null&&(n===""?u=!1:(n="",this.pos=l,u=this.match(yc)!==null)),!u)return this.pos=i,0;var c=cc(o);if(c==="")return this.pos=i,0;var f=this.getReferenceDefSourcepos(e);e.sourcepos[0][0]=f[1][0]+1;var d=Y("refDef",f);return d.title=n,d.dest=s,d.label=c,e.insertBefore(d),t[c]?this.refDefCandidateMap[d.id]=d:t[c]=Zo(d),this.pos-i},r.prototype.mergeTextNodes=function(e){for(var t,n=[];t=e.next();){var i=t.entering,a=t.node;if(i&&a.type==="text")n.push(a);else if(n.length===1)n=[];else if(n.length>1){var o=n[0],s=n[n.length-1];o.sourcepos&&s.sourcepos&&(o.sourcepos[1]=s.sourcepos[1]),o.next=s.next,o.next&&(o.next.prev=o);for(var l=1;l0&&tn(_e(t,r.offset));)r.advanceOffset(1,!0),i--;return 0},finalize:function(r,e){if(e.stringContent!==null){var t=e.stringContent,n=t.indexOf(` +`),i=t.slice(0,n),a=t.slice(n+1),o=i.match(/^(\s*)(.*)/);e.info=On(o[2].trim()),e.literal=a,e.stringContent=null}},canContain:function(){return!1},acceptsLines:!0},mp={continue:function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!0},Cte={continue:function(){return 0},finalize:function(){},canContain:function(r){return r!=="item"},acceptsLines:!1},Tte={continue:function(){return 0},finalize:function(r,e){for(var t=e.firstChild;t;){if(bc(t)&&t.next){e.listData.tight=!1;break}for(var n=t.firstChild;n;){if(bc(n)&&(t.next||n.next)){e.listData.tight=!1;break}n=n.next}t=t.next}},canContain:function(r){return r==="item"},acceptsLines:!1},xte={continue:function(r){var e=r.currentLine;if(!r.indented&&_e(e,r.nextNonspace)===fp)r.advanceNextNonspace(),r.advanceOffset(1,!1),tn(_e(e,r.offset))&&r.advanceOffset(1,!0);else return 1;return 0},finalize:function(){},canContain:function(r){return r!=="item"},acceptsLines:!1},Ete={continue:function(r,e){if(r.blank){if(e.firstChild===null)return 1;r.advanceNextNonspace()}else if(r.indent>=e.listData.markerOffset+e.listData.padding)r.advanceOffset(e.listData.markerOffset+e.listData.padding,!0);else return 1;return 0},finalize:cte,canContain:function(r){return r!=="item"},acceptsLines:!1},Mte={continue:function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!1},Ste={continue:function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!1},Ote={continue:function(r,e){var t=r.currentLine,n=r.indent;if(e.isFenced){var i=n<=3&&t.charAt(r.nextNonspace)===e.fenceChar&&t.slice(r.nextNonspace).match(bte);if(i&&i[0].length>=e.fenceLength)return r.lastLineLength=r.offset+n+i[0].length,r.finalize(e,r.lineNumber),2;for(var a=e.fenceOffset;a>0&&tn(_e(t,r.offset));)r.advanceOffset(1,!0),a--}else if(n>=Wi)r.advanceOffset(Wi,!0);else if(r.blank)r.advanceNextNonspace();else return 1;return 0},finalize:function(r,e){var t;if(e.stringContent!==null){if(e.isFenced){var n=e.stringContent,i=n.indexOf(` +`),a=n.slice(0,i),o=n.slice(i+1),s=a.match(/^(\s*)(.*)/);e.infoPadding=s[1].length,e.info=On(s[2].trim()),e.literal=o}else e.literal=(t=e.stringContent)===null||t===void 0?void 0:t.replace(/(\n *)+$/,` +`);e.stringContent=null}},canContain:function(){return!1},acceptsLines:!0},Lte={continue:function(r,e){return r.blank&&(e.htmlBlockType===6||e.htmlBlockType===7)?1:0},finalize:function(r,e){var t;e.literal=((t=e.stringContent)===null||t===void 0?void 0:t.replace(/(\n *)+$/,""))||null,e.stringContent=null},canContain:function(){return!1},acceptsLines:!0},Ate={continue:function(r){return r.blank?1:0},finalize:function(r,e){if(e.stringContent!==null){for(var t,n=!1;_e(e.stringContent,0)===hp&&(t=r.inlineParser.parseReference(e,r.refMap));)e.stringContent=e.stringContent.slice(t),n=!0;n&&vp(e.stringContent)&&e.unlink()}},canContain:function(){return!1},acceptsLines:!0},Nte=mp,Dte=mp,Br={document:Cte,list:Tte,blockQuote:xte,item:Ete,heading:Mte,thematicBreak:Ste,codeBlock:Ote,htmlBlock:Lte,paragraph:Ate,table:fte,tableBody:dte,tableHead:hte,tableRow:mte,tableCell:gte,tableDelimRow:pte,tableDelimCell:vte,refDef:Nte,customBlock:kte,frontMatter:Dte};function Yo(r){for(var e=0,t=0,n=[],i=0;i=a.columns.length&&(c.ignored=!0),i.appendChild(c)}),2},Pte=/^(\$\$)(\s*[a-zA-Z])+/,Hte=/^(\$\$)(\s*[a-zA-Z])+.*(\$\$)/,Fte=function(r){var e;if(!r.indented&&!Hte.test(r.currentLine)&&(e=r.currentLine.match(Pte))){var t=e[1].length;r.closeUnmatchedBlocks();var n=r.addChild("customBlock",r.nextNonspace);return n.syntaxLength=t,n.offset=r.indent,r.advanceNextNonspace(),r.advanceOffset(t,!1),2}return 0},qte=/^`{3,}(?!.*`)|^~{3,}/,_te=[/./,/^<(?:script|pre|style)(?:\s|>|$)/i,/^/,/\?>/,/>/,/\]\]>/],nre=/^[#`~*+_=<>0-9-;$]/,ire=/\r\n|\n|\r/;function co(){return Y("document",[[1,1],[0,0]])}var are={smart:!1,tagFilter:!1,extendedAutolinks:!1,disallowedHtmlBlockTags:[],referenceDefinition:!1,disallowDeepHeading:!1,customParser:null,frontMatter:!1},ore=function(){function r(e){this.options=ce(ce({},are),e),this.doc=co(),this.tip=this.doc,this.oldtip=this.doc,this.lineNumber=0,this.offset=0,this.column=0,this.nextNonspace=0,this.nextNonspaceColumn=0,this.indent=0,this.currentLine="",this.indented=!1,this.blank=!1,this.partiallyConsumedTab=!1,this.allClosed=!0,this.lastMatchedContainer=this.doc,this.refMap={},this.refLinkCandidateMap={},this.refDefCandidateMap={},this.lastLineLength=0,this.lines=[],this.options.frontMatter&&(Br.frontMatter=tre,uo.unshift(ere)),this.inlineParser=new lte(this.options)}return r.prototype.advanceOffset=function(e,t){t===void 0&&(t=!1);for(var n=this.currentLine,i,a,o;e>0&&(o=n[this.offset]);)o===" "?(i=4-this.column%4,t?(this.partiallyConsumedTab=i>e,a=i>e?e:i,this.column+=a,this.offset+=this.partiallyConsumedTab?0:1,e-=a):(this.partiallyConsumedTab=!1,this.column+=i,this.offset+=1,e-=1)):(this.partiallyConsumedTab=!1,this.offset+=1,this.column+=1,e-=1)},r.prototype.advanceNextNonspace=function(){this.offset=this.nextNonspace,this.column=this.nextNonspaceColumn,this.partiallyConsumedTab=!1},r.prototype.findNextNonspace=function(){for(var e=this.currentLine,t=this.offset,n=this.column,i;(i=e.charAt(t))!=="";)if(i===" ")t++,n++;else if(i===" ")t++,n+=4-n%4;else break;this.blank=i===` +`||i==="\r"||i==="",this.nextNonspace=t,this.nextNonspaceColumn=n,this.indent=this.nextNonspaceColumn-this.column,this.indented=this.indent>=Wi},r.prototype.addLine=function(){if(this.partiallyConsumedTab){this.offset+=1;var e=4-this.column%4;this.tip.stringContent+=Go(" ",e)}this.tip.lineOffsets?this.tip.lineOffsets.push(this.offset):this.tip.lineOffsets=[this.offset],this.tip.stringContent+=this.currentLine.slice(this.offset)+` +`},r.prototype.addChild=function(e,t){for(;!Br[this.tip.type].canContain(e);)this.finalize(this.tip,this.lineNumber-1);var n=t+1,i=Y(e,[[this.lineNumber,n],[0,0]]);return i.stringContent="",this.tip.appendChild(i),this.tip=i,i},r.prototype.closeUnmatchedBlocks=function(){if(!this.allClosed){for(;this.oldtip!==this.lastMatchedContainer;){var e=this.oldtip.parent;this.finalize(this.oldtip,this.lineNumber-1),this.oldtip=e}this.allClosed=!0}},r.prototype.finalize=function(e,t){var n=e.parent;e.open=!1,e.sourcepos[1]=[t,this.lastLineLength],Br[e.type].finalize(this,e),this.tip=n},r.prototype.processInlines=function(e){var t,n=this.options.customParser,i=e.walker();for(this.inlineParser.refMap=this.refMap,this.inlineParser.refLinkCandidateMap=this.refLinkCandidateMap,this.inlineParser.refDefCandidateMap=this.refDefCandidateMap,this.inlineParser.options=this.options;t=i.next();){var a=t.node,o=t.entering,s=a.type;n&&n[s]&&n[s](a,{entering:o,options:this.options}),!o&&(s==="paragraph"||s==="heading"||s==="tableCell"&&!a.ignored)&&this.inlineParser.parse(a)}},r.prototype.incorporateLine=function(e){var t=this.doc;this.oldtip=this.tip,this.offset=0,this.column=0,this.blank=!1,this.partiallyConsumedTab=!1,this.lineNumber+=1,e.indexOf("\0")!==-1&&(e=e.replace(/\0/g,"�")),this.currentLine=e;for(var n=!0,i;(i=t.lastChild)&&i.open;){switch(t=i,this.findNextNonspace(),Br[t.type].continue(this,t)){case 0:break;case 1:n=!1;break;case 2:this.lastLineLength=e.length;return;default:throw new Error("continue returned illegal value, must be 0, 1, or 2")}if(!n){t=t.parent;break}}this.allClosed=t===this.oldtip,this.lastMatchedContainer=t;for(var a=t.type!=="paragraph"&&Br[t.type].acceptsLines,o=uo.length;!a;){if(this.findNextNonspace(),t.type!=="table"&&t.type!=="tableBody"&&t.type!=="paragraph"&&!this.indented&&!nre.test(e.slice(this.nextNonspace))){this.advanceNextNonspace();break}for(var s=0;s=1&&t.htmlBlockType<=5&&rre[t.htmlBlockType].test(this.currentLine.slice(this.offset))&&(this.lastLineLength=e.length,this.finalize(t,this.lineNumber))):this.offsete[0]?-1:r[1]e[1]?-1:0}function sre(r,e){var t=r[0],n=r[1];return wc(n,e)===1?1:wc(t,e)===-1?-1:0}function lre(r,e){if(!(r.parent!==e.parent||r===e)){for(var t=r.next;t&&t!==e;){for(var n=t.next,i=0,a=["parent","prev","next"];i=0;t-=1)r.prependChild(e[t])}function fre(r,e){if(!(!r||!r.parent||e===0)){var t=r.parent.walker();t.resumeAt(r,!0);for(var n;n=t.next();){var i=n.node,a=n.entering;a&&(i.sourcepos[0][0]+=e,i.sourcepos[1][0]+=e)}}}function kp(r,e){var t=r[0],n=r[1];return n[0]e?-1:0}function li(r,e){for(var t=r.firstChild;t;){var n=kp(t.sourcepos,e);if(n===0)return t;if(n===-1)return t.prev||t;t=t.next}return r.lastChild}function dre(r){for(;r.lastChild;)r=r.lastChild;return r}function hre(r){for(;r.parent&&r.parent.type!=="document"&&r.parent.sourcepos[0][0]===r.sourcepos[0][0];)r=r.parent;return r}function pre(r,e){for(var t=r.firstChild,n=null;t;){var i=kp(t.sourcepos,e);if(i===0){if(t.sourcepos[0][0]===e||!t.firstChild)return t;n=t,t=t.firstChild}else{if(i===-1)break;n=t,t=t.next}}return n?hre(dre(n)):null}function vre(r,e){for(var t=r,n=null;t;){var i=sre(t.sourcepos,e);if(i===0)if(t.firstChild)n=t,t=t.firstChild;else return t;else{if(i===-1)return n;if(t.next)t=t.next;else return n}}return t}function Cp(r){return eee(r)||null}function fo(r,e,t){if(t===void 0&&(t=null),e)for(var n=e.walker();e&&e!==t;){r(e);var i=n.next();if(i)e=i.node;else break}}function mre(r){var e=Cp(r);if(!e)return!0;for(;e&&e.type!=="document";){if(!e.parent&&!e.prev&&!e.next)return!0;e=e.parent}return!1}var Cc=/\r\n|\n|\r/;function gre(r){var e=r.match(/^[ \t]+/);if(e&&(e[0].length>=2||/\t/.test(e[0])))return!0;var t=e?r.slice(e.length):r;return gp.test(t)||yp.test(t)}function yre(r){return!vp(r)&&r.indexOf("|")!==-1}function Zo(r){var e=r.id,t=r.title,n=r.sourcepos,i=r.dest;return{id:e,title:t,sourcepos:n,unlinked:!1,destination:i}}var Tp=function(){function r(e,t){this.refMap={},this.refLinkCandidateMap={},this.refDefCandidateMap={},this.referenceDefinition=!!(t!=null&&t.referenceDefinition),this.parser=new ore(t),this.parser.setRefMaps(this.refMap,this.refLinkCandidateMap,this.refDefCandidateMap),this.eventHandlerMap={change:[]},e=e||"",this.lineTexts=e.split(Cc),this.root=this.parser.parse(e,this.lineTexts)}return r.prototype.updateLineTexts=function(e,t,n){var i,a=e[0],o=e[1],s=t[0],l=t[1],u=n.split(Cc),c=u.length,f=this.lineTexts[a-1],d=this.lineTexts[s-1];u[0]=f.slice(0,o-1)+u[0],u[c-1]=u[c-1]+d.slice(l-1);var p=s-a+1;return(i=this.lineTexts).splice.apply(i,Wo([a-1,p],u)),c-p},r.prototype.updateRootNodeState=function(){if(this.lineTexts.length===1&&this.lineTexts[0]===""){this.root.lastLineBlank=!0,this.root.sourcepos=[[1,1],[1,0]];return}this.root.lastChild&&(this.root.lastLineBlank=this.root.lastChild.lastLineBlank);for(var e=this.lineTexts,t=e.length-1;e[t]==="";)t-=1;e.length-2>t&&(t+=1),this.root.sourcepos[1]=[t+1,e[t].length]},r.prototype.replaceRangeNodes=function(e,t,n){e?(kc(e,n),lre(e,t),[e.id,t.id].forEach(function(i){return Ko(i)}),e.unlink()):t?(kc(t,n),Ko(t.id),t.unlink()):cre(this.root,n)},r.prototype.getNodeRange=function(e,t){var n=li(this.root,e[0]),i=li(this.root,t[0]);return i&&i.next&&t[0]+1===i.next.sourcepos[0][0]&&(i=i.next),[n,i]},r.prototype.trigger=function(e,t){this.eventHandlerMap[e].forEach(function(n){n(t)})},r.prototype.extendEndLine=function(e){for(;this.lineTexts[e]==="";)e+=1;return e},r.prototype.parseRange=function(e,t,n,i){e&&e.prev&&(uc(e.prev)&&gre(this.lineTexts[n-1])||vee(e.prev)&&yre(this.lineTexts[n-1]))&&(e=e.prev,n=e.sourcepos[0][0]);for(var a=this.lineTexts.slice(n-1,i),o=this.parser.partialParseStart(n,a),s=t?t.next:this.root.firstChild,l=o.lastChild,u=l&&ap(l)&&l.open,c=l&&op(l)&&l.open,f=l&&uc(l);(u||c)&&s||f&&s&&(s.type==="list"||s.sourcepos[0][1]>=2);){var d=this.extendEndLine(s.sourcepos[1][0]);this.parser.partialParseExtends(this.lineTexts.slice(i,d)),e||(e=t),t=s,i=d,s=s.next}this.parser.partialParseFinish();var p=ure(o);return{newNodes:p,extStartNode:e,extEndNode:t}},r.prototype.getRemovedNodeRange=function(e,t){return!e||e&&Ir(e)||t&&Ir(t)?null:{id:[e.id,t.id],line:[e.sourcepos[0][0]-1,t.sourcepos[1][0]-1]}},r.prototype.markDeletedRefMap=function(e,t){var n=this;if(!Rr(this.refMap)){var i=function(a){if(Ir(a)){var o=n.refMap[a.label];o&&a.id===o.id&&(o.unlinked=!0)}};e&&fo(i,e.parent,t),t&&fo(i,t)}},r.prototype.replaceWithNewRefDefState=function(e){var t=this;if(!Rr(this.refMap)){var n=function(i){if(Ir(i)){var a=i.label,o=t.refMap[a];(!o||o.unlinked)&&(t.refMap[a]=Zo(i))}};e.forEach(function(i){fo(n,i)})}},r.prototype.replaceWithRefDefCandidate=function(){var e=this;Rr(this.refDefCandidateMap)||ai(this.refDefCandidateMap,function(t,n){var i=n.label,a=n.sourcepos,o=e.refMap[i];(!o||o.unlinked||o.sourcepos[0][0]>a[0][0])&&(e.refMap[i]=Zo(n))})},r.prototype.getRangeWithRefDef=function(e,t,n,i,a){if(this.referenceDefinition&&!Rr(this.refMap)){var o=li(this.root,e-1),s=li(this.root,t+1);o&&Ir(o)&&o!==n&&o!==i&&(n=o,e=n.sourcepos[0][0]),s&&Ir(s)&&s!==n&&s!==i&&(i=s,t=this.extendEndLine(i.sourcepos[1][0]+a))}return[n,i,e,t]},r.prototype.parse=function(e,t,n){n===void 0&&(n=0);var i=this.getNodeRange(e,t),a=i[0],o=i[1],s=a?Math.min(a.sourcepos[0][0],e[0]):e[0],l=this.extendEndLine((o?Math.max(o.sourcepos[1][0],t[0]):t[0])+n),u=this.parseRange.apply(this,this.getRangeWithRefDef(s,l,a,o,n)),c=u.newNodes,f=u.extStartNode,d=u.extEndNode,p=this.getRemovedNodeRange(f,d),h=d?d.next:this.root.firstChild;return this.referenceDefinition?(this.markDeletedRefMap(f,d),this.replaceRangeNodes(f,d,c),this.replaceWithNewRefDefState(c)):this.replaceRangeNodes(f,d,c),{nodes:c,removedNodeRange:p,nextNode:h}},r.prototype.parseRefLink=function(){var e=this,t=[];return Rr(this.refMap)||ai(this.refMap,function(n,i){i.unlinked&&delete e.refMap[n],ai(e.refLinkCandidateMap,function(a,o){var s=o.node,l=o.refLabel;l===n&&t.push(e.parse(s.sourcepos[0],s.sourcepos[1]))})}),t},r.prototype.removeUnlinkedCandidate=function(){Rr(this.refDefCandidateMap)||[this.refLinkCandidateMap,this.refDefCandidateMap].forEach(function(e){ai(e,function(t){mre(t)&&delete e[t]})})},r.prototype.editMarkdown=function(e,t,n){var i=this.updateLineTexts(e,t,n),a=this.parse(e,t,i),o=$ee(a,"nextNode");fre(a.nextNode,i),this.updateRootNodeState();var s=[o];return this.referenceDefinition&&(this.removeUnlinkedCandidate(),this.replaceWithRefDefCandidate(),s=s.concat(this.parseRefLink())),this.trigger("change",s),s},r.prototype.getLineTexts=function(){return this.lineTexts},r.prototype.getRootNode=function(){return this.root},r.prototype.findNodeAtPosition=function(e){var t=vre(this.root,e);return!t||t===this.root?null:t},r.prototype.findFirstNodeAtLine=function(e){return pre(this.root,e)},r.prototype.on=function(e,t){this.eventHandlerMap[e].push(t)},r.prototype.off=function(e,t){var n=this.eventHandlerMap[e],i=n.indexOf(t);n.splice(i,1)},r.prototype.findNodeById=function(e){return Cp(e)},r.prototype.removeAllNode=function(){tee()},r}(),bre=["title","textarea","style","xmp","iframe","noembed","noframes","script","plaintext"],Tc=new RegExp("<(/?(?:"+bre.join("|")+")[^>]*>)","ig");function xc(r){return Tc.test(r)?r.replace(Tc,function(e,t){return"<"+t}):r}var Ec={heading:function(r,e){var t=e.entering;return{type:t?"openTag":"closeTag",tagName:"h"+r.level,outerNewLine:!0}},text:function(r){return{type:"text",content:r.literal}},softbreak:function(r,e){var t=e.options;return{type:"html",content:t.softbreak}},linebreak:function(){return{type:"html",content:`
+`}},emph:function(r,e){var t=e.entering;return{type:t?"openTag":"closeTag",tagName:"em"}},strong:function(r,e){var t=e.entering;return{type:t?"openTag":"closeTag",tagName:"strong"}},paragraph:function(r,e){var t,n=e.entering,i=(t=r.parent)===null||t===void 0?void 0:t.parent;return i&&i.type==="list"&&i.listData.tight?null:{type:n?"openTag":"closeTag",tagName:"p",outerNewLine:!0}},thematicBreak:function(){return{type:"openTag",tagName:"hr",outerNewLine:!0,selfClose:!0}},blockQuote:function(r,e){var t=e.entering;return{type:t?"openTag":"closeTag",tagName:"blockquote",outerNewLine:!0,innerNewLine:!0}},list:function(r,e){var t=e.entering,n=r.listData,i=n.type,a=n.start,o=i==="bullet"?"ul":"ol",s={};return o==="ol"&&a!==null&&a!==1&&(s.start=a.toString()),{type:t?"openTag":"closeTag",tagName:o,attributes:s,outerNewLine:!0}},item:function(r,e){var t=e.entering;return{type:t?"openTag":"closeTag",tagName:"li",outerNewLine:!0}},htmlInline:function(r,e){var t=e.options,n=t.tagFilter?xc(r.literal):r.literal;return{type:"html",content:n}},htmlBlock:function(r,e){var t=e.options,n=t.tagFilter?xc(r.literal):r.literal;return t.nodeId?[{type:"openTag",tagName:"div",outerNewLine:!0},{type:"html",content:n},{type:"closeTag",tagName:"div",outerNewLine:!0}]:{type:"html",content:n,outerNewLine:!0}},code:function(r){return[{type:"openTag",tagName:"code"},{type:"text",content:r.literal},{type:"closeTag",tagName:"code"}]},codeBlock:function(r){var e=r.info,t=e?e.split(/\s+/):[],n=[];return t.length>0&&t[0].length>0&&n.push("language-"+Fr(t[0])),[{type:"openTag",tagName:"pre",outerNewLine:!0},{type:"openTag",tagName:"code",classNames:n},{type:"text",content:r.literal},{type:"closeTag",tagName:"code"},{type:"closeTag",tagName:"pre",outerNewLine:!0}]},link:function(r,e){var t=e.entering;if(t){var n=r,i=n.title,a=n.destination;return{type:"openTag",tagName:"a",attributes:ce({href:Fr(a)},i&&{title:Fr(i)})}}return{type:"closeTag",tagName:"a"}},image:function(r,e){var t=e.getChildrenText,n=e.skipChildren,i=r,a=i.title,o=i.destination;return n(),{type:"openTag",tagName:"img",selfClose:!0,attributes:ce({src:Fr(o),alt:t(r)},a&&{title:Fr(a)})}},customBlock:function(r,e,t){var n=r.info.trim().toLowerCase(),i=t[n];if(i)try{return i(r,e)}catch(a){console.warn("[@toast-ui/editor] - The error occurred when "+n+" block node was parsed in markdown renderer: "+a)}return[{type:"openTag",tagName:"div",outerNewLine:!0},{type:"text",content:r.literal},{type:"closeTag",tagName:"div",outerNewLine:!0}]},frontMatter:function(r){return[{type:"openTag",tagName:"div",outerNewLine:!0,attributes:{style:"white-space: pre; display: none;"}},{type:"text",content:r.literal},{type:"closeTag",tagName:"div",outerNewLine:!0}]},customInline:function(r,e,t){var n=r,i=n.info,a=n.firstChild,o=i.trim().toLowerCase(),s=t[o],l=e.entering;if(s)try{return s(r,e)}catch(u){console.warn("[@toast-ui/editor] - The error occurred when "+o+" inline node was parsed in markdown renderer: "+u)}return l?[{type:"openTag",tagName:"span"},{type:"text",content:"$$"+i+(a?" ":"")}]:[{type:"text",content:"$$"},{type:"closeTag",tagName:"span"}]}},Mc={strike:function(r,e){var t=e.entering;return{type:t?"openTag":"closeTag",tagName:"del"}},item:function(r,e){var t=e.entering,n=r.listData,i=n.checked,a=n.task;if(t){var o={type:"openTag",tagName:"li",outerNewLine:!0};return a?[o,{type:"openTag",tagName:"input",selfClose:!0,attributes:ce(ce({},i&&{checked:""}),{disabled:"",type:"checkbox"})},{type:"text",content:" "}]:o}return{type:"closeTag",tagName:"li",outerNewLine:!0}},table:function(r,e){var t=e.entering;return{type:t?"openTag":"closeTag",tagName:"table",outerNewLine:!0}},tableHead:function(r,e){var t=e.entering;return{type:t?"openTag":"closeTag",tagName:"thead",outerNewLine:!0}},tableBody:function(r,e){var t=e.entering;return{type:t?"openTag":"closeTag",tagName:"tbody",outerNewLine:!0}},tableRow:function(r,e){var t=e.entering;if(t)return{type:"openTag",tagName:"tr",outerNewLine:!0};var n=[];if(r.lastChild)for(var i=r.parent.parent.columns.length,a=r.lastChild.endIdx,o=a+1;o0&&this.buffer.push(' class="'+i.join(" ")+'"'),a&&Object.keys(a).forEach(function(o){var s=a[o];t.buffer.push(" "+o+'="'+s+'"')}),e.selfClose&&this.buffer.push(" /"),this.buffer.push(">")},r.prototype.generateCloseTagString=function(e){var t=e.tagName;this.buffer.push("")},r.prototype.addNewLine=function(){this.buffer.length&&Ui(Ui(this.buffer))!==` +`&&this.buffer.push(` +`)},r.prototype.addOuterNewLine=function(e){e.outerNewLine&&this.addNewLine()},r.prototype.addInnerNewLine=function(e){e.innerNewLine&&this.addNewLine()},r.prototype.renderTextNode=function(e){this.buffer.push(Fr(e.content))},r.prototype.renderRawHtmlNode=function(e){this.addOuterNewLine(e),this.buffer.push(e.content),this.addOuterNewLine(e)},r.prototype.renderElementNode=function(e){e.type==="openTag"?(this.addOuterNewLine(e),this.generateOpenTagString(e),e.selfClose?this.addOuterNewLine(e):this.addInnerNewLine(e)):(this.addInnerNewLine(e),this.generateCloseTagString(e),this.addOuterNewLine(e))},r}();/*! @license DOMPurify 2.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.3/LICENSE */function Cre(r){if(Array.isArray(r)){for(var e=0,t=Array(r.length);e1?t-1:0),i=1;i/gm),Pre=St(/^data-[\-\w.\u00B7-\uFFFF]/),Hre=St(/^aria-[\-\w]+$/),Fre=St(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),qre=St(/^(?:\w+script|data):/i),_re=St(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Cn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r};function nt(r){if(Array.isArray(r)){for(var e=0,t=Array(r.length);e"u"?null:window},zre=function(e,t){if((typeof e>"u"?"undefined":Cn(e))!=="object"||typeof e.createPolicy!="function")return null;var n=null,i="data-tt-policy-suffix";t.currentScript&&t.currentScript.hasAttribute(i)&&(n=t.currentScript.getAttribute(i));var a="dompurify"+(n?"#"+n:"");try{return e.createPolicy(a,{createHTML:function(s){return s}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}};function Ep(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:$re(),e=function(y){return Ep(y)};if(e.version="2.3.3",e.removed=[],!r||!r.document||r.document.nodeType!==9)return e.isSupported=!1,e;var t=r.document,n=r.document,i=r.DocumentFragment,a=r.HTMLTemplateElement,o=r.Node,s=r.Element,l=r.NodeFilter,u=r.NamedNodeMap,c=u===void 0?r.NamedNodeMap||r.MozNamedAttrMap:u,f=r.Text,d=r.Comment,p=r.DOMParser,h=r.trustedTypes,v=s.prototype,m=ui(v,"cloneNode"),g=ui(v,"nextSibling"),w=ui(v,"childNodes"),C=ui(v,"parentNode");if(typeof a=="function"){var T=n.createElement("template");T.content&&T.content.ownerDocument&&(n=T.content.ownerDocument)}var x=zre(h,t),M=x&&Gn?x.createHTML(""):"",D=n,R=D.implementation,A=D.createNodeIterator,V=D.createDocumentFragment,X=D.getElementsByTagName,De=t.importNode,Wn={};try{Wn=rr(n).documentMode?n.documentMode:{}}catch{}var rt={};e.isSupported=typeof C=="function"&&R&&typeof R.createHTMLDocument<"u"&&Wn!==9;var ya=Rre,ba=Bre,fv=Pre,dv=Hre,hv=qre,al=_re,wa=Fre,ve=null,ol=H({},[].concat(nt(Nc),nt(ho),nt(po),nt(vo),nt(Dc))),me=null,sl=H({},[].concat(nt(Ic),nt(mo),nt(Rc),nt(ci))),ka=null,Ca=null,ll=!0,Ta=!0,ul=!1,Tr=!1,xr=!1,xa=!1,Ea=!1,Er=!1,jn=!1,cl=!0,Gn=!1,fl=!0,Ma=!0,sn=!1,Mr={},Sr=null,dl=H({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),hl=null,pl=H({},["audio","video","img","source","image","track"]),Sa=null,vl=H({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Oa="http://www.w3.org/1998/Math/MathML",La="http://www.w3.org/2000/svg",At="http://www.w3.org/1999/xhtml",Kn=At,Aa=!1,Or=void 0,pv=["application/xhtml+xml","text/html"],vv="text/html",Lr=void 0,Ar=null,mv=n.createElement("form"),Na=function(y){Ar&&Ar===y||((!y||(typeof y>"u"?"undefined":Cn(y))!=="object")&&(y={}),y=rr(y),ve="ALLOWED_TAGS"in y?H({},y.ALLOWED_TAGS):ol,me="ALLOWED_ATTR"in y?H({},y.ALLOWED_ATTR):sl,Sa="ADD_URI_SAFE_ATTR"in y?H(rr(vl),y.ADD_URI_SAFE_ATTR):vl,hl="ADD_DATA_URI_TAGS"in y?H(rr(pl),y.ADD_DATA_URI_TAGS):pl,Sr="FORBID_CONTENTS"in y?H({},y.FORBID_CONTENTS):dl,ka="FORBID_TAGS"in y?H({},y.FORBID_TAGS):{},Ca="FORBID_ATTR"in y?H({},y.FORBID_ATTR):{},Mr="USE_PROFILES"in y?y.USE_PROFILES:!1,ll=y.ALLOW_ARIA_ATTR!==!1,Ta=y.ALLOW_DATA_ATTR!==!1,ul=y.ALLOW_UNKNOWN_PROTOCOLS||!1,Tr=y.SAFE_FOR_TEMPLATES||!1,xr=y.WHOLE_DOCUMENT||!1,Er=y.RETURN_DOM||!1,jn=y.RETURN_DOM_FRAGMENT||!1,cl=y.RETURN_DOM_IMPORT!==!1,Gn=y.RETURN_TRUSTED_TYPE||!1,Ea=y.FORCE_BODY||!1,fl=y.SANITIZE_DOM!==!1,Ma=y.KEEP_CONTENT!==!1,sn=y.IN_PLACE||!1,wa=y.ALLOWED_URI_REGEXP||wa,Kn=y.NAMESPACE||At,Or=pv.indexOf(y.PARSER_MEDIA_TYPE)===-1?Or=vv:Or=y.PARSER_MEDIA_TYPE,Lr=Or==="application/xhtml+xml"?function(E){return E}:mi,Tr&&(Ta=!1),jn&&(Er=!0),Mr&&(ve=H({},[].concat(nt(Dc))),me=[],Mr.html===!0&&(H(ve,Nc),H(me,Ic)),Mr.svg===!0&&(H(ve,ho),H(me,mo),H(me,ci)),Mr.svgFilters===!0&&(H(ve,po),H(me,mo),H(me,ci)),Mr.mathMl===!0&&(H(ve,vo),H(me,Rc),H(me,ci))),y.ADD_TAGS&&(ve===ol&&(ve=rr(ve)),H(ve,y.ADD_TAGS)),y.ADD_ATTR&&(me===sl&&(me=rr(me)),H(me,y.ADD_ATTR)),y.ADD_URI_SAFE_ATTR&&H(Sa,y.ADD_URI_SAFE_ATTR),y.FORBID_CONTENTS&&(Sr===dl&&(Sr=rr(Sr)),H(Sr,y.FORBID_CONTENTS)),Ma&&(ve["#text"]=!0),xr&&H(ve,["html","head","body"]),ve.table&&(H(ve,["tbody"]),delete ka.tbody),Ne&&Ne(y),Ar=y)},ml=H({},["mi","mo","mn","ms","mtext"]),gl=H({},["foreignobject","desc","title","annotation-xml"]),Jn=H({},ho);H(Jn,po),H(Jn,Dre);var Da=H({},vo);H(Da,Ire);var gv=function(y){var E=C(y);(!E||!E.tagName)&&(E={namespaceURI:At,tagName:"template"});var N=mi(y.tagName),W=mi(E.tagName);if(y.namespaceURI===La)return E.namespaceURI===At?N==="svg":E.namespaceURI===Oa?N==="svg"&&(W==="annotation-xml"||ml[W]):!!Jn[N];if(y.namespaceURI===Oa)return E.namespaceURI===At?N==="math":E.namespaceURI===La?N==="math"&&gl[W]:!!Da[N];if(y.namespaceURI===At){if(E.namespaceURI===La&&!gl[W]||E.namespaceURI===Oa&&!ml[W])return!1;var ge=H({},["title","style","font","a","script"]);return!Da[N]&&(ge[N]||!Jn[N])}return!1},pt=function(y){hn(e.removed,{element:y});try{y.parentNode.removeChild(y)}catch{try{y.outerHTML=M}catch{y.remove()}}},yl=function(y,E){try{hn(e.removed,{attribute:E.getAttributeNode(y),from:E})}catch{hn(e.removed,{attribute:null,from:E})}if(E.removeAttribute(y),y==="is"&&!me[y])if(Er||jn)try{pt(E)}catch{}else try{E.setAttribute(y,"")}catch{}},bl=function(y){var E=void 0,N=void 0;if(Ea)y=""+y;else{var W=Lc(y,/^[\r\n\t ]+/);N=W&&W[0]}Or==="application/xhtml+xml"&&(y=''+y+"");var ge=x?x.createHTML(y):y;if(Kn===At)try{E=new p().parseFromString(ge,Or)}catch{}if(!E||!E.documentElement){E=R.createDocument(Kn,"template",null);try{E.documentElement.innerHTML=Aa?"":ge}catch{}}var ye=E.body||E.documentElement;return y&&N&&ye.insertBefore(n.createTextNode(N),ye.childNodes[0]||null),Kn===At?X.call(E,xr?"html":"body")[0]:xr?E.documentElement:ye},wl=function(y){return A.call(y.ownerDocument||y,y,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT,null,!1)},yv=function(y){return y instanceof f||y instanceof d?!1:typeof y.nodeName!="string"||typeof y.textContent!="string"||typeof y.removeChild!="function"||!(y.attributes instanceof c)||typeof y.removeAttribute!="function"||typeof y.setAttribute!="function"||typeof y.namespaceURI!="string"||typeof y.insertBefore!="function"},ln=function(y){return(typeof o>"u"?"undefined":Cn(o))==="object"?y instanceof o:y&&(typeof y>"u"?"undefined":Cn(y))==="object"&&typeof y.nodeType=="number"&&typeof y.nodeName=="string"},vt=function(y,E,N){rt[y]&&Ore(rt[y],function(W){W.call(e,E,N,Ar)})},kl=function(y){var E=void 0;if(vt("beforeSanitizeElements",y,null),yv(y)||Lc(y.nodeName,/[\u0080-\uFFFF]/))return pt(y),!0;var N=Lr(y.nodeName);if(vt("uponSanitizeElement",y,{tagName:N,allowedTags:ve}),!ln(y.firstElementChild)&&(!ln(y.content)||!ln(y.content.firstElementChild))&&yt(/<[/\w]/g,y.innerHTML)&&yt(/<[/\w]/g,y.textContent)||N==="select"&&yt(/ - - There is no meta. Click here to create meta configuration. - - - -
- loading prend.... -
- - - - \ No newline at end of file diff --git a/resources/assets/js/components/Markdown.vue b/resources/assets/js/components/Markdown.vue deleted file mode 100644 index 05ae687..0000000 --- a/resources/assets/js/components/Markdown.vue +++ /dev/null @@ -1,90 +0,0 @@ - - - - - \ No newline at end of file diff --git a/resources/assets/js/components/MetaField.vue b/resources/assets/js/components/MetaField.vue deleted file mode 100644 index 43e726e..0000000 --- a/resources/assets/js/components/MetaField.vue +++ /dev/null @@ -1,36 +0,0 @@ - - - \ No newline at end of file diff --git a/resources/assets/js/link-method.js b/resources/assets/js/link-method.js deleted file mode 100644 index 204f1aa..0000000 --- a/resources/assets/js/link-method.js +++ /dev/null @@ -1,101 +0,0 @@ -/** - * This Javascript Vanilla will help you to transform anchor link into triggered form. - * - * You write this: - * Delete - * - * When above link clicked, below will rendered & triggered: - *
- * - * - *
- * -* @see [jquery version] https://gist.github.com/JeffreyWay/5112282 - */ - -(function() { - - var LinkSangar = { - init: function () { - this.links = document.querySelectorAll('a[data-method]') - this.registerEvents() - }, - - registerEvents: function () { - Array.from(this.links).forEach(function (l) { - l.addEventListener('click', LinkSangar.render) - }) - }, - - render: function (e) { - var el = this, - httpMethod, - form - - httpMethod = el.getAttribute('data-method') - - // Ignore when the data-method attribute is not PUT or DELETE, - if (['PUT', 'DELETE'].indexOf(httpMethod.toUpperCase()) === -1) { - return; - } - - // Allow user to optionally provide data-confirm="Are you sure?" - if (el.hasAttribute('data-confirm') && ! LinkSangar.verifyConfirm(el) ) { - e.preventDefault() - return false; - } - - form = LinkSangar.createForm(el) - form.submit() - - e.preventDefault() - }, - - verifyConfirm: function (link) { - return confirm(link.getAttribute('data-confirm')) - }, - - createForm: function (link) { - var form = document.createElement('form') - LinkSangar.setAttributes(form, { - method: 'POST', - action: link.getAttribute('href') - }) - - var laravelToken = document.querySelector("meta[name=csrf-token]").getAttribute('content'); - - if (!laravelToken) { - console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token'); - } - - var inputToken = document.createElement('input') - LinkSangar.setAttributes(inputToken, { - type: 'text', - name: '_token', - value: laravelToken - }) - - var inputMethod = document.createElement('input') - LinkSangar.setAttributes(inputMethod, { - type: 'text', - name: '_method', - value: link.getAttribute('data-method') - }) - - form.appendChild(inputToken) - form.appendChild(inputMethod) - document.body.appendChild(form) - - return form - }, - - setAttributes: function (el, attrs) { - for (var key in attrs) { - el.setAttribute(key, attrs[key]); - } - } - } - - LinkSangar.init() - -})(); \ No newline at end of file diff --git a/resources/assets/scss/app.scss b/resources/assets/scss/app.scss deleted file mode 100644 index 3fb790e..0000000 --- a/resources/assets/scss/app.scss +++ /dev/null @@ -1,36 +0,0 @@ -@import "~bulma/bulma"; - -$ionicons-font-path: "/vendor/ngeblog/fonts/vendor/ionicons"; -@import "~ionicons/scss/ionicons"; - -// normalize -h1, h2, h3, h4, h5, h6 { - font-size: 2em; - font-weight: bold; -} - -.ngeblog-navbar { - margin-bottom: 40px; - border-bottom: 1px solid #ddd; - padding-top: 10px; - padding-bottom: 10px; -} - -.ngeblog-content { - min-height: 350px; - margin-bottom: 80px; -} - -.ngeblog-sidebar { - border-right: 1px solid #e7e7e7; -} - -.ngeblog-footer { - padding: 20px 0px 60px 0px; - border-top: 1px solid #ddd; -} - -.drag-handle { - font-size: 24px; - cursor: move; -} \ No newline at end of file diff --git a/resources/assets/scss/site.scss b/resources/assets/scss/site.scss deleted file mode 100644 index b40a49b..0000000 --- a/resources/assets/scss/site.scss +++ /dev/null @@ -1 +0,0 @@ -@import "~bulma/bulma"; \ No newline at end of file diff --git a/resources/css/ngeblog.css b/resources/css/ngeblog.css new file mode 100644 index 0000000..f7c1a9a --- /dev/null +++ b/resources/css/ngeblog.css @@ -0,0 +1,15 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +[v-cloak] { + display: none; +} + +.router-link-active { + @apply bg-teal-200; +} + +.prend { + background-color: red; +} diff --git a/resources/js/App.vue b/resources/js/App.vue new file mode 100644 index 0000000..dfdfaf8 --- /dev/null +++ b/resources/js/App.vue @@ -0,0 +1,16 @@ + + + diff --git a/resources/js/components/Container.vue b/resources/js/components/Container.vue new file mode 100644 index 0000000..e827658 --- /dev/null +++ b/resources/js/components/Container.vue @@ -0,0 +1,7 @@ + + + diff --git a/resources/js/components/Footer.vue b/resources/js/components/Footer.vue new file mode 100644 index 0000000..3acb7b8 --- /dev/null +++ b/resources/js/components/Footer.vue @@ -0,0 +1,56 @@ + + + diff --git a/resources/js/components/FormControl.vue b/resources/js/components/FormControl.vue new file mode 100644 index 0000000..b06c637 --- /dev/null +++ b/resources/js/components/FormControl.vue @@ -0,0 +1,39 @@ + + + diff --git a/resources/js/components/Header.vue b/resources/js/components/Header.vue new file mode 100644 index 0000000..461aeca --- /dev/null +++ b/resources/js/components/Header.vue @@ -0,0 +1,106 @@ + + + diff --git a/resources/js/components/MenuList.vue b/resources/js/components/MenuList.vue new file mode 100644 index 0000000..cc71dd6 --- /dev/null +++ b/resources/js/components/MenuList.vue @@ -0,0 +1,33 @@ + + + diff --git a/resources/js/components/Modal.vue b/resources/js/components/Modal.vue new file mode 100644 index 0000000..cbdf6c1 --- /dev/null +++ b/resources/js/components/Modal.vue @@ -0,0 +1,108 @@ + + + diff --git a/resources/js/components/ModalConfirmation.vue b/resources/js/components/ModalConfirmation.vue new file mode 100644 index 0000000..9466721 --- /dev/null +++ b/resources/js/components/ModalConfirmation.vue @@ -0,0 +1,60 @@ + + + diff --git a/resources/js/components/NotFound.vue b/resources/js/components/NotFound.vue new file mode 100644 index 0000000..b1affa3 --- /dev/null +++ b/resources/js/components/NotFound.vue @@ -0,0 +1,11 @@ + + + diff --git a/resources/js/components/Pagination.vue b/resources/js/components/Pagination.vue new file mode 100644 index 0000000..3d71def --- /dev/null +++ b/resources/js/components/Pagination.vue @@ -0,0 +1,24 @@ + + + diff --git a/resources/js/components/SkeletonContent.vue b/resources/js/components/SkeletonContent.vue new file mode 100644 index 0000000..f0b81d5 --- /dev/null +++ b/resources/js/components/SkeletonContent.vue @@ -0,0 +1,10 @@ + + + diff --git a/resources/js/components/TextEditor.vue b/resources/js/components/TextEditor.vue new file mode 100644 index 0000000..3e0759e --- /dev/null +++ b/resources/js/components/TextEditor.vue @@ -0,0 +1,32 @@ + + + + + diff --git a/resources/js/composables/confirmable.js b/resources/js/composables/confirmable.js new file mode 100644 index 0000000..4b86037 --- /dev/null +++ b/resources/js/composables/confirmable.js @@ -0,0 +1,41 @@ +import { reactive } from "vue"; + +export function useConfirmable( + config = { + setTitle: (data) => null, + setMessage: (data) => null, + confirm: (data) => null, + }, +) { + return reactive({ + ...config, + props: { + title: "Are you sure?", + message: "This action cannot be irreversible.", + }, + data: null, + show: false, + open(data) { + this.show = true; + this.data = data; + + if (typeof this.setTitle !== "undefined") { + this.props.title = this.setTitle(this.data); + } + + if (typeof this.setMessage !== "undefined") { + this.props.message = this.setMessage(this.data); + } + }, + close() { + this.show = false; + this.data = null; + }, + cancel() { + this.close(); + }, + triggerConfirm() { + this.confirm(this.data, this); + }, + }); +} diff --git a/resources/js/composables/loadData.js b/resources/js/composables/loadData.js new file mode 100644 index 0000000..4ddb943 --- /dev/null +++ b/resources/js/composables/loadData.js @@ -0,0 +1,28 @@ +import axios from "axios"; +import { reactive } from "vue"; + +export function useLoadData(defaultUrl = null) { + return reactive({ + loading: false, + data: null, + fetchData(overrideUrl = null, cb = null) { + const self = this; + self.loading = true; + + let url = overrideUrl ? overrideUrl : defaultUrl; + + axios + .get(url) + .then((response) => { + self.data = response.data; + + if (typeof cb === "function") { + cb(self.data); + } + }) + .finally(() => { + self.loading = false; + }); + }, + }); +} diff --git a/resources/js/ngeblog.js b/resources/js/ngeblog.js new file mode 100644 index 0000000..0db05bf --- /dev/null +++ b/resources/js/ngeblog.js @@ -0,0 +1,14 @@ +import { createApp } from "vue"; +import App from "./App.vue"; +import router from "./routes"; +import axios from "axios"; + +const token = document.head.querySelector('meta[name="csrf-token"]'); + +axios.defaults.headers.common["X-Requested-With"] = "XMLHttpRequest"; + +if (token) { + axios.defaults.headers.common["X-CSRF-TOKEN"] = token.content; +} + +createApp(App).use(router).mount("#ngeblog-app"); diff --git a/resources/js/pages/Dashboard.vue b/resources/js/pages/Dashboard.vue new file mode 100644 index 0000000..f71d787 --- /dev/null +++ b/resources/js/pages/Dashboard.vue @@ -0,0 +1,11 @@ + + + diff --git a/resources/js/pages/posts/Form.vue b/resources/js/pages/posts/Form.vue new file mode 100644 index 0000000..11a9e8a --- /dev/null +++ b/resources/js/pages/posts/Form.vue @@ -0,0 +1,243 @@ + + + diff --git a/resources/js/pages/posts/Index.vue b/resources/js/pages/posts/Index.vue new file mode 100644 index 0000000..b7f76a3 --- /dev/null +++ b/resources/js/pages/posts/Index.vue @@ -0,0 +1,229 @@ + + + diff --git a/resources/js/pages/tags/Form.vue b/resources/js/pages/tags/Form.vue new file mode 100644 index 0000000..1295094 --- /dev/null +++ b/resources/js/pages/tags/Form.vue @@ -0,0 +1,200 @@ + + + diff --git a/resources/js/pages/tags/Index.vue b/resources/js/pages/tags/Index.vue new file mode 100644 index 0000000..7a977bd --- /dev/null +++ b/resources/js/pages/tags/Index.vue @@ -0,0 +1,206 @@ + + + diff --git a/resources/js/routes.js b/resources/js/routes.js new file mode 100644 index 0000000..df42cd2 --- /dev/null +++ b/resources/js/routes.js @@ -0,0 +1,57 @@ +import { createRouter, createWebHistory } from "vue-router"; +import Dashboard from "@/pages/Dashboard.vue"; +import PostIndex from "@/pages/posts/Index.vue"; +import TagIndex from "@/pages/tags/Index.vue"; +import TagForm from "@/pages/tags/Form.vue"; +import NotFound from "./components/NotFound.vue"; +import { resolveRouterBasePath } from "./utils"; + +const routes = [ + { + path: "/:pathMatch(.*)*", + name: "NotFound", + component: NotFound, + }, + { + path: "/", + name: "dashboard", + component: Dashboard, + }, + { + path: "/posts", + name: "posts-index", + component: PostIndex, + }, + { + path: "/posts/create", + name: "posts-create", + component: () => import("@/pages/posts/Form.vue"), + }, + { + path: "/posts/:id/edit", + name: "posts-edit", + component: () => import("@/pages/posts/Form.vue"), + }, + { + path: "/tags", + name: "tags-index", + component: TagIndex, + }, + { + path: "/tags/create", + name: "tags-create", + component: TagForm, + }, + { + path: "/tags/:id/edit", + name: "tags-edit", + component: TagForm, + }, +]; + +const router = createRouter({ + history: createWebHistory(resolveRouterBasePath()), + routes, +}); + +export default router; diff --git a/resources/js/utils.js b/resources/js/utils.js new file mode 100644 index 0000000..759767c --- /dev/null +++ b/resources/js/utils.js @@ -0,0 +1,76 @@ +/** + * Expected output is string that starts and ends with "/". + * e.g: "/whatever/" + * + * @returns string + */ +export const resolveRouterBasePath = () => { + let result = window.Ngeblog.path; + if (result === "" || result === "/") { + return "/ngeblog/"; + } + + if (!result.endsWith("/")) { + result = result + "/"; + } + if (!result.startsWith("/")) { + result = "/" + result; + } + + return result; +}; + +export const apiBasePath = (path) => { + if (!path.startsWith("/")) { + path = "/" + path; + } + return resolveRouterBasePath() + "api" + path; +}; + +export const formatDate = ( + theDate, + config = { + timeZone: null, + withTime: false, + withDayName: false, + locale: "en-US", + }, +) => { + const options = { + year: "numeric", + month: "long", + day: "2-digit", + }; + + if (config.timeZone) { + options.timeZone = config.timeZone; + } + + if (config.withTime) { + options.hour = "numeric"; + options.minute = "numeric"; + options.hour12 = false; + } + + // * in case we need to display Day Name (Monday) + if (config.withDayName) { + options.weekday = "long"; + } + + if (theDate instanceof Date) { + return theDate.toLocaleString(config.locale, options); + } + + if (typeof theDate === "string") { + return new Date(theDate).toLocaleString(config.locale, options); + } +}; + +export const slugify = (str, divider = "-") => { + return str + .toLowerCase() + .trim() + .replace(/[^\w\s-]/g, "") + .replace(/[\s_-]+/g, divider) + .replace(/^-+|-+$/g, ""); +}; diff --git a/resources/views/admin/_alert.blade.php b/resources/views/admin/_alert.blade.php deleted file mode 100644 index 46712fa..0000000 --- a/resources/views/admin/_alert.blade.php +++ /dev/null @@ -1,17 +0,0 @@ -@if (isset($errors) && count($errors) > 0) -
- -

Whoops something went wrong!

- -
    - @foreach ($errors->all() as $error) -
  • {{ $error }}
  • - @endforeach -
-
-@elseif(session('message')) -
- - {{ session('message.content') }} -
-@endif diff --git a/resources/views/admin/_sidebar.blade.php b/resources/views/admin/_sidebar.blade.php deleted file mode 100644 index 02ee550..0000000 --- a/resources/views/admin/_sidebar.blade.php +++ /dev/null @@ -1,41 +0,0 @@ - diff --git a/resources/views/admin/blog/_form.blade.php b/resources/views/admin/blog/_form.blade.php deleted file mode 100644 index ae47089..0000000 --- a/resources/views/admin/blog/_form.blade.php +++ /dev/null @@ -1,91 +0,0 @@ -@section('styles') - - - -@stop - -@section('scripts') - - - - -@stop - -
- -
- {!! Form::text('title', null, ['class' => 'input is-medium']) !!} -
-
- -
- -
-
- - {!! Form::select('category_id', $cat_dropdown, null, ['v-model' => 'category_id', '@change' => 'categoryChangeForMeta']) !!} -
-
-
- -
- -
- - -
-
-
- -
- -
- {!! Form::hidden('editor_type', 'quill') !!} - {!! Form::textarea('content', null, ['style' => 'display: none;']) !!} -
{!! old('content', @$blog['content']) !!}
-
-
- - - -{{--
- -
- -
-
--}} - -

- -
-
- -
-
- Cancel -
-
diff --git a/resources/views/admin/blog/create.blade.php b/resources/views/admin/blog/create.blade.php deleted file mode 100644 index 75ff3f2..0000000 --- a/resources/views/admin/blog/create.blade.php +++ /dev/null @@ -1,13 +0,0 @@ -@extends('ngeblog::admin.layout') - -@section('content') - - {!! Form::open(['url' => route('ngeblog.blog.store'), 'class' => 'form-horizontal']) !!} -
-
- @include('ngeblog::admin.blog._form') -
-
- {!! Form::close() !!} - -@stop diff --git a/resources/views/admin/blog/edit.blade.php b/resources/views/admin/blog/edit.blade.php deleted file mode 100644 index 57ffd4a..0000000 --- a/resources/views/admin/blog/edit.blade.php +++ /dev/null @@ -1,14 +0,0 @@ -@extends('ngeblog::admin.layout') - -@section('content') - - {!! Form::model($blog, ['url' => route('ngeblog.blog.update', $blog['id']), 'class' => 'form-horizontal']) !!} -
-
- {{ method_field('PUT') }} - @include('ngeblog::admin.blog._form') -
-
- {!! Form::close() !!} - -@stop diff --git a/resources/views/admin/blog/index.blade.php b/resources/views/admin/blog/index.blade.php deleted file mode 100644 index 89ef69b..0000000 --- a/resources/views/admin/blog/index.blade.php +++ /dev/null @@ -1,71 +0,0 @@ -@extends('ngeblog::admin.layout') - -@section('button-title') - {!! Form::open(['method' => 'GET']) !!} - {!! Form::text('keyword', null, ['class' => 'input', 'placeholder' => 'search title, or category', 'style' => 'width: 200px;']) !!} - - {!! Form::close() !!} -     - - - - - Create - -@stop - -@section('content') - @if ($blogs->isEmpty()) - - @else - - - - - - - - - - - - @php - $no = $blogs->firstItem(); - @endphp - @foreach ($blogs as $b) - - - - - - - - @endforeach - -
NoTitleCategoryStatusAction
{{ $no++ }}{{ $b['title'] }}{{ $b['category']['title'] }} - @if ($b['status'] == 'publish') - published - @else - {{ $b['status'] }} - @endif - - - - Edit - - - - Delete - -
- - {!! $blogs->links('ngeblog::pagination-bulma') !!} - @endif -@stop diff --git a/resources/views/admin/category/_form.blade.php b/resources/views/admin/category/_form.blade.php deleted file mode 100644 index 29d3de3..0000000 --- a/resources/views/admin/category/_form.blade.php +++ /dev/null @@ -1,22 +0,0 @@ -
- -
- {!! Form::text('title', null, ['class' => 'input']) !!} -
-
- -
- -
- {!! Form::textarea('description', null, ['class' => 'textarea', 'rows' => 4]) !!} -
-
- -
-
- -
-
- Cancel -
-
diff --git a/resources/views/admin/category/create.blade.php b/resources/views/admin/category/create.blade.php deleted file mode 100644 index aa1f6d5..0000000 --- a/resources/views/admin/category/create.blade.php +++ /dev/null @@ -1,13 +0,0 @@ -@extends('ngeblog::admin.layout') - -@section('content') - - {!! Form::open(['url' => route('ngeblog.category.store'), 'class' => 'form-horizontal']) !!} -
-
- @include('ngeblog::admin.category._form') -
-
- {!! Form::close() !!} - -@stop diff --git a/resources/views/admin/category/edit.blade.php b/resources/views/admin/category/edit.blade.php deleted file mode 100644 index 8926dcc..0000000 --- a/resources/views/admin/category/edit.blade.php +++ /dev/null @@ -1,14 +0,0 @@ -@extends('ngeblog::admin.layout') - -@section('content') - - {!! Form::model($category, ['url' => route('ngeblog.category.update', $category['id']), 'class' => 'form-horizontal']) !!} -
-
- {!! method_field('PUT') !!} - @include('ngeblog::admin.category._form') -
-
- {!! Form::close() !!} - -@stop diff --git a/resources/views/admin/category/index.blade.php b/resources/views/admin/category/index.blade.php deleted file mode 100644 index c4f4c04..0000000 --- a/resources/views/admin/category/index.blade.php +++ /dev/null @@ -1,58 +0,0 @@ -@extends('ngeblog::admin.layout') - -@section('button-title') - - - - - Create - -@stop - -@section('content') - @if ($categories->isEmpty()) - - @else - - - - - - - - - - - @php - $no = $categories->firstItem(); - @endphp - @foreach ($categories as $cat) - - - - - - - @endforeach - -
NoTitleTotal BlogAction
{{ $no++ }}{{ $cat['title'] }}{{ $cat['blogs_count'] }} - - - Edit - - - - Delete - -
- - {!! $categories->links('ngeblog::pagination-bulma') !!} - @endif -@stop diff --git a/resources/views/admin/dashboard.blade.php b/resources/views/admin/dashboard.blade.php deleted file mode 100644 index 59123db..0000000 --- a/resources/views/admin/dashboard.blade.php +++ /dev/null @@ -1,20 +0,0 @@ -@extends('ngeblog::admin.layout') - -@section('content') - - - -@stop diff --git a/resources/views/admin/layout.blade.php b/resources/views/admin/layout.blade.php deleted file mode 100644 index c2f74ca..0000000 --- a/resources/views/admin/layout.blade.php +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - Ngeblog @yield('title', isset($title) ? ' - '. $title : '') - - - @yield('styles') - - -
- - -
-
-
- @include('ngeblog::admin._sidebar') -
-
-
- - - @include('ngeblog::admin._alert') - - @yield('content') -
-
-
-
- - -
- - - @yield('scripts') - - - diff --git a/resources/views/admin/meta/_form.blade.php b/resources/views/admin/meta/_form.blade.php deleted file mode 100644 index ef473ea..0000000 --- a/resources/views/admin/meta/_form.blade.php +++ /dev/null @@ -1,44 +0,0 @@ -
- -
-
- {!! Form::select('meta_field', $fields_dropdown, null, []) !!} -
-
-
- -
- -
- {!! Form::text('meta_default_key', null, ['class' => 'input']) !!} -
-
- -
- -
- {!! Form::textarea('meta_default_value', null, ['class' => 'textarea', 'rows' => 3]) !!} -
-
- -
- -
-
- {!! Form::select('category_id', $category_dropdown, null, []) !!} -
-
-
- -
- Post Meta configuration only visible on blog post with selected category. If you want this configuration visible for all blog post just left category blank -
- -
-
- -
-
- Cancel -
-
diff --git a/resources/views/admin/meta/create.blade.php b/resources/views/admin/meta/create.blade.php deleted file mode 100644 index 76551da..0000000 --- a/resources/views/admin/meta/create.blade.php +++ /dev/null @@ -1,13 +0,0 @@ -@extends('ngeblog::admin.layout') - -@section('content') - - {!! Form::open(['method' => 'POST', 'url' => route('ngeblog.meta.store'), 'class' => 'form-horizontal']) !!} -
-
- @include('ngeblog::admin.meta._form') -
-
- {!! Form::close() !!} - -@endsection diff --git a/resources/views/admin/meta/edit.blade.php b/resources/views/admin/meta/edit.blade.php deleted file mode 100644 index f353e40..0000000 --- a/resources/views/admin/meta/edit.blade.php +++ /dev/null @@ -1,13 +0,0 @@ -@extends('ngeblog::admin.layout') - -@section('content') - - {!! Form::model($meta, ['method' => 'PUT', 'url' => route('ngeblog.meta.update', $meta['id']), 'class' => 'form-horizontal']) !!} -
-
- @include('ngeblog::admin.meta._form') -
-
- {!! Form::close() !!} - -@endsection diff --git a/resources/views/admin/meta/index.blade.php b/resources/views/admin/meta/index.blade.php deleted file mode 100644 index 14d0a3e..0000000 --- a/resources/views/admin/meta/index.blade.php +++ /dev/null @@ -1,60 +0,0 @@ -@extends('ngeblog::admin.layout') - -@section('button-title') - - - - - Create - -@stop - -@section('content') - @if ($metas->isEmpty()) - - @else - - - - - - - - - - - - @php - $no = $metas->firstItem(); - @endphp - @foreach ($metas as $m) - - - - - - - - @endforeach - -
NoMeta FieldMeta KeyBlog CategoryAction
{{ $no++ }}{{ $m['meta_field'] }}{{ $m['meta_default_key'] }}{!! !empty($m['category']) ? $m['category']['title'] : "All Blog" !!} - - - Edit - - - - Delete - -
- - {!! $metas->links('ngeblog::pagination-bulma') !!} - @endif -@endsection diff --git a/resources/views/ngeblog.blade.php b/resources/views/ngeblog.blade.php new file mode 100644 index 0000000..81764ec --- /dev/null +++ b/resources/views/ngeblog.blade.php @@ -0,0 +1,22 @@ + + + + + + + + Ngeblog Administration + + + + + + + + + +
+ + diff --git a/resources/views/pagination-bulma.blade.php b/resources/views/pagination-bulma.blade.php deleted file mode 100644 index a9d7871..0000000 --- a/resources/views/pagination-bulma.blade.php +++ /dev/null @@ -1,42 +0,0 @@ -@if ($paginator->hasPages()) -