diff --git a/app/Conference/Blocks/CommitteeBlock.php b/app/Conference/Blocks/CommitteeBlock.php new file mode 100644 index 000000000..0b46fcd27 --- /dev/null +++ b/app/Conference/Blocks/CommitteeBlock.php @@ -0,0 +1,36 @@ +whereHas('positions', function ($query) { + // Filter participants to include only those with 'committee' type positions. + $query->where('type', 'committee'); + }) + ->orderBy('order_column') // Order the retrieved data by the 'order_column'. + ->take(3) // Limit the query to retrieve only 3 participants. + ->get(); + + + + return [ + // Return the organized data with committee positions as keys and arrays of participants as values. + 'participants' => $participants + ]; + } +} \ No newline at end of file diff --git a/app/Website/Blocks/InformationBlock.php b/app/Conference/Blocks/InformationBlock.php similarity index 74% rename from app/Website/Blocks/InformationBlock.php rename to app/Conference/Blocks/InformationBlock.php index a4d999983..658623ff9 100644 --- a/app/Website/Blocks/InformationBlock.php +++ b/app/Conference/Blocks/InformationBlock.php @@ -1,13 +1,13 @@ Conference::where('status', ConferenceStatus::Archived)->get() + ]; + } +} diff --git a/app/Website/Blocks/SubmitBlock.php b/app/Conference/Blocks/SubmitBlock.php similarity index 73% rename from app/Website/Blocks/SubmitBlock.php rename to app/Conference/Blocks/SubmitBlock.php index af6324e10..5c57bd7c3 100644 --- a/app/Website/Blocks/SubmitBlock.php +++ b/app/Conference/Blocks/SubmitBlock.php @@ -1,12 +1,12 @@ getCurrentConference()?->getKey()) + ->where(function ($query) use ($today) { + // 1 day before now (yesterday) + $query->where('date', $today->subDay()->toDateString()) + ->orWhereBetween('date', [ + $today->addDays(1)->toDateString(), // Today + $today->addDays(2)->toDateString(), // 2 days ahead + ]); + }) + ->orWhere(function ($query) { + // If no data matches the above criteria, display only the latest 3 data + $query->latest()->limit(3); + }) + ->orderBy('date') + ->get(); + return [ - 'timelines' => Timeline::where('conference_id', app()->getCurrentConference()?->getKey())->get(), + 'timelines' => $timelines, ]; } } diff --git a/app/Conference/Pages/Committe.php b/app/Conference/Pages/Committe.php new file mode 100644 index 000000000..1ccb7c044 --- /dev/null +++ b/app/Conference/Pages/Committe.php @@ -0,0 +1,54 @@ +whereHas('positions', function ($query) { + // Filter participants to include only those with 'committee' type positions. + $query->where('type', 'committee'); + }) + ->orderBy('order_column') // Order the retrieved data by the 'order_column'. + ->get(); + + // Initialize an empty associative array to store organized data. + $groupedData = []; + + // Iterate through each participant and their associated committee positions. + foreach ($participants as $participant) { + foreach ($participant->positions as $position) { + $positionName = $position->name; + if (!isset($groupedData[$positionName])) { + // Create an array for the committee position if it doesn't exist in $groupedData. + $groupedData[$positionName] = []; + } + // Add the participant to the respective committee position in $groupedData. + $groupedData[$positionName][] = $participant; + } + } + + return [ + // Return the organized data with committee positions as keys and arrays of participants as values. + 'groupedCommittes' => $groupedData + ]; + } +} \ No newline at end of file diff --git a/app/Conference/Pages/Timeline.php b/app/Conference/Pages/Timeline.php new file mode 100644 index 000000000..0c12c34b5 --- /dev/null +++ b/app/Conference/Pages/Timeline.php @@ -0,0 +1,29 @@ + ConferenceTimeline::with('conference') + ->where('conference_id', app()->getCurrentConference()?->getKey())->get() + ]; + } +} diff --git a/app/Models/Timeline.php b/app/Models/Timeline.php index 7a10ecf0e..a28195af0 100644 --- a/app/Models/Timeline.php +++ b/app/Models/Timeline.php @@ -2,9 +2,11 @@ namespace App\Models; +use Carbon\Carbon; +use App\Models\Scopes\ConferenceScope; +use Illuminate\Database\Eloquent\Model; use App\Models\Concerns\BelongsToConference; use Illuminate\Database\Eloquent\Factories\HasFactory; -use Illuminate\Database\Eloquent\Model; class Timeline extends Model { @@ -22,4 +24,18 @@ class Timeline extends Model 'roles' => 'array', 'date' => 'datetime' ]; + + public static function getTimelinesInRange() + { + + return self::where('conference_id', app()->getCurrentConference()?->getKey()) + ->get(); + } + + // protected static function boot() + // { + // parent::boot(); + + // static::addGlobalScope(new ConferenceScope); + // } } diff --git a/app/Models/UserContent.php b/app/Models/UserContent.php index f298f30ec..99b3d61bb 100644 --- a/app/Models/UserContent.php +++ b/app/Models/UserContent.php @@ -82,13 +82,13 @@ public function user() public function scopeOrWhereMeta(Builder $q, string $key, $operator, $value = null): void { // Shift arguments if no operator is present. - if (! isset($value)) { + if (!isset($value)) { $value = $operator; $operator = '='; } // Convert value to its serialized version for comparison. - if (! is_string($value)) { + if (!is_string($value)) { $value = $this->makeMeta($key, $value)->getRawValue(); } diff --git a/app/Panel/Resources/Conferences/ParticipantResource.php b/app/Panel/Resources/Conferences/ParticipantResource.php index 30f102d2b..18f524715 100644 --- a/app/Panel/Resources/Conferences/ParticipantResource.php +++ b/app/Panel/Resources/Conferences/ParticipantResource.php @@ -52,6 +52,11 @@ public static function generalFormField(): array public static function additionalFormField(): array { return [ + Forms\Components\TagsInput::make('meta.expertise') + ->placeholder('') + ->columnSpan([ + 'lg' => 2 + ]), Forms\Components\TextInput::make('meta.affiliation') ->prefixIcon('heroicon-s-building-library') ->placeholder('University of Jakarta') @@ -61,7 +66,7 @@ public static function additionalFormField(): array Forms\Components\Select::make('meta.country') ->placeholder('Select a country') ->searchable() - ->options(fn () => Country::all()->mapWithKeys(fn ($country) => [$country->id => $country->flag.' '.$country->name])) + ->options(fn () => Country::all()->mapWithKeys(fn ($country) => [$country->id => $country->flag . ' ' . $country->name])) ->optionsLimit(250), Forms\Components\TextInput::make('meta.phone') ->prefixIcon('heroicon-s-phone') diff --git a/app/Providers/ConferenceServiceProvider.php b/app/Providers/ConferenceServiceProvider.php index 8d0fbfc2f..064e150b7 100644 --- a/app/Providers/ConferenceServiceProvider.php +++ b/app/Providers/ConferenceServiceProvider.php @@ -2,14 +2,22 @@ namespace App\Providers; +use App\Facades\Block; use App\Conference\Pages\Home; -use App\Http\Middleware\IdentifyArchiveConference; -use App\Http\Middleware\IdentifyCurrentConference; -use App\Http\Middleware\SetupDefaultData; +use App\Conference\Blocks\MenuBlock; +use App\Conference\Blocks\TopicBlock; use Illuminate\Support\Facades\Blade; +use App\Conference\Blocks\SubmitBlock; use Illuminate\Support\ServiceProvider; -use Rahmanramsi\LivewirePageGroup\Facades\LivewirePageGroup; +use App\Conference\Blocks\CalendarBlock; +use App\Conference\Blocks\CommitteeBlock; +use App\Conference\Blocks\PreviousBlock; +use App\Conference\Blocks\TimelineBlock; +use App\Http\Middleware\SetupDefaultData; use Rahmanramsi\LivewirePageGroup\PageGroup; +use App\Http\Middleware\IdentifyArchiveConference; +use App\Http\Middleware\IdentifyCurrentConference; +use Rahmanramsi\LivewirePageGroup\Facades\LivewirePageGroup; class ConferenceServiceProvider extends ServiceProvider { @@ -42,6 +50,18 @@ protected function currentConference(PageGroup $pageGroup): PageGroup ->path('current') ->layout('website.components.layouts.app') ->homePage(Home::class) + ->bootUsing(function () { + Block::registerBlocks([ + CalendarBlock::class, + TimelineBlock::class, + PreviousBlock::class, + SubmitBlock::class, + TopicBlock::class, + MenuBlock::class, + CommitteeBlock::class + ]); + Block::boot(); + }) ->middleware([ 'web', IdentifyCurrentConference::class, diff --git a/app/Providers/WebsiteServiceProvider.php b/app/Providers/WebsiteServiceProvider.php index f20189b41..967edc42c 100644 --- a/app/Providers/WebsiteServiceProvider.php +++ b/app/Providers/WebsiteServiceProvider.php @@ -5,24 +5,11 @@ use App\Facades\Block; use App\Conference\Pages\Home; use App\Http\Middleware\SetupDefaultData; -use App\Website\Blocks\ExampleBlock; -use App\Website\Blocks\LeftBlock; use App\Website\Blocks\LoginBlock; use App\Website\Blocks\SearchBlock; -use App\Conference\Blocks\MenuBlock; -use App\Conference\Blocks\TopicBlock; -use App\Website\Blocks\ScheduleBlock; use Illuminate\Support\Facades\Blade; -use App\Conference\Blocks\SubmitBlock; -use App\Conference\Blocks\CalendarBlock; -use App\Conference\Blocks\TimelineBlock; -use App\Http\Middleware\DefaultViewData; -use App\Website\Blocks\InformationBlock; -use App\Conference\Blocks\EditorialBlock; -use App\Conference\Blocks\PreviousBlock; use Rahmanramsi\LivewirePageGroup\PageGroup; -use App\Http\Middleware\IdentifyCurrentConference; use Rahmanramsi\LivewirePageGroup\PageGroupServiceProvider; class WebsiteServiceProvider extends PageGroupServiceProvider @@ -30,15 +17,6 @@ class WebsiteServiceProvider extends PageGroupServiceProvider public function register() { parent::register(); - Block::registerBlocks([ - CalendarBlock::class, - TimelineBlock::class, - PreviousBlock::class, - SubmitBlock::class, - TopicBlock::class, - MenuBlock::class, - EditorialBlock::class - ]); } public function pageGroup(PageGroup $pageGroup): PageGroup diff --git a/app/Website/Blocks/EditorialBlock.php b/app/Website/Blocks/EditorialBlock.php deleted file mode 100644 index 7501ce029..000000000 --- a/app/Website/Blocks/EditorialBlock.php +++ /dev/null @@ -1,16 +0,0 @@ -=3.0.0 || insiders" } }, + "node_modules/@uvarov.frontend/vanilla-calendar": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/@uvarov.frontend/vanilla-calendar/-/vanilla-calendar-2.6.7.tgz", + "integrity": "sha512-HvaxgPoAJZoXCjJsNPkvAA7K9LuFStPdAUIg7dcrom01TUm6IygiSH8xhuVRxuojskWEI3LIO8yFZ9goayXriQ==" + }, "node_modules/any-promise": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", diff --git a/package.json b/package.json index da28fe505..07256a0f2 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "vite": "^4.4.9" }, "dependencies": { + "@uvarov.frontend/vanilla-calendar": "^2.6.7", "masonry-layout": "^4.2.2", "motion": "^10.16.2", "photoswipe": "^5.3.9", diff --git a/public/build/manifest.json b/public/build/manifest.json index af461fb61..cecddfedd 100644 --- a/public/build/manifest.json +++ b/public/build/manifest.json @@ -14,12 +14,12 @@ "src": "resources/panel/js/panel.js" }, "resources/website/css/website.css": { - "file": "assets/website-e291770d.css", + "file": "assets/website-ad94c454.css", "isEntry": true, "src": "resources/website/css/website.css" }, "resources/website/js/website.js": { - "file": "assets/website-d409e8a4.js", + "file": "assets/website-02a4b6a2.js", "isEntry": true, "src": "resources/website/js/website.js" } diff --git a/public/js/awcodes/tiptap-editor/components/tiptap.js b/public/js/awcodes/tiptap-editor/components/tiptap.js index 0227cc96c..66b77fce2 100644 --- a/public/js/awcodes/tiptap-editor/components/tiptap.js +++ b/public/js/awcodes/tiptap-editor/components/tiptap.js @@ -1,16 +1,16 @@ -var Zb=Object.create;var da=Object.defineProperty;var Qb=Object.getOwnPropertyDescriptor;var ey=Object.getOwnPropertyNames;var ty=Object.getPrototypeOf,ny=Object.prototype.hasOwnProperty;var ry=(t,e,n)=>e in t?da(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Fu=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var iy=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ey(e))!ny.call(t,i)&&i!==n&&da(t,i,{get:()=>e[i],enumerable:!(r=Qb(e,i))||r.enumerable});return t};var zu=(t,e,n)=>(n=t!=null?Zb(ty(t)):{},iy(e||!t||!t.__esModule?da(n,"default",{value:t,enumerable:!0}):n,t));var at=(t,e,n)=>(ry(t,typeof e!="symbol"?e+"":e,n),n);var Rb=Fu((mL,Ab)=>{function Eb(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(e=>{let n=t[e],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&Eb(n)}),t}var Js=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function wb(t){return t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function qn(t,...e){let n=Object.create(null);for(let r in t)n[r]=t[r];return e.forEach(function(r){for(let i in r)n[i]=r[i]}),n}var SM="",pb=t=>!!t.scope,xM=(t,{prefix:e})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){let n=t.split(".");return[`${e}${n.shift()}`,...n.map((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${e}${t}`},Mu=class{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=wb(e)}openNode(e){if(!pb(e))return;let n=xM(e.scope,{prefix:this.classPrefix});this.span(n)}closeNode(e){pb(e)&&(this.buffer+=SM)}value(){return this.buffer}span(e){this.buffer+=``}},hb=(t={})=>{let e={children:[]};return Object.assign(e,t),e},oo=class{constructor(){this.rootNode=hb(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let n=hb({scope:e});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return typeof n=="string"?e.addText(n):n.children&&(e.openNode(n),n.children.forEach(r=>this._walk(e,r)),e.closeNode(n)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(n=>typeof n=="string")?e.children=[e.children.join("")]:e.children.forEach(n=>{oo._collapse(n)}))}},Tu=class extends oo{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,n){let r=e.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new Mu(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function so(t){return t?typeof t=="string"?t:t.source:null}function vb(t){return Or("(?=",t,")")}function kM(t){return Or("(?:",t,")*")}function MM(t){return Or("(?:",t,")?")}function Or(...t){return t.map(n=>so(n)).join("")}function TM(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function _u(...t){return"("+(TM(t).capture?"":"?:")+t.map(r=>so(r)).join("|")+")"}function Sb(t){return new RegExp(t.toString()+"|").exec("").length-1}function NM(t,e){let n=t&&t.exec(e);return n&&n.index===0}var _M=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Cu(t,{joinWith:e}){let n=0;return t.map(r=>{n+=1;let i=n,o=so(r),s="";for(;o.length>0;){let a=_M.exec(o);if(!a){s+=o;break}s+=o.substring(0,a.index),o=o.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?s+="\\"+String(Number(a[1])+i):(s+=a[0],a[0]==="("&&n++)}return s}).map(r=>`(${r})`).join(e)}var CM=/\b\B/,xb="[a-zA-Z]\\w*",Ou="[a-zA-Z_]\\w*",kb="\\b\\d+(\\.\\d+)?",Mb="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Tb="\\b(0b[01]+)",OM="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",AM=(t={})=>{let e=/^#![ ]*\//;return t.binary&&(t.begin=Or(e,/.*\b/,t.binary,/\b.*/)),qn({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},t)},ao={begin:"\\\\[\\s\\S]",relevance:0},RM={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[ao]},IM={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[ao]},DM={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Zs=function(t,e,n={}){let r=qn({scope:"comment",begin:t,end:e,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=_u("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:Or(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},LM=Zs("//","$"),PM=Zs("/\\*","\\*/"),BM=Zs("#","$"),HM={scope:"number",begin:kb,relevance:0},FM={scope:"number",begin:Mb,relevance:0},zM={scope:"number",begin:Tb,relevance:0},UM={begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[ao,{begin:/\[/,end:/\]/,relevance:0,contains:[ao]}]}]},$M={scope:"title",begin:xb,relevance:0},KM={scope:"title",begin:Ou,relevance:0},WM={begin:"\\.\\s*"+Ou,relevance:0},VM=function(t){return Object.assign(t,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})},Ys=Object.freeze({__proto__:null,MATCH_NOTHING_RE:CM,IDENT_RE:xb,UNDERSCORE_IDENT_RE:Ou,NUMBER_RE:kb,C_NUMBER_RE:Mb,BINARY_NUMBER_RE:Tb,RE_STARTERS_RE:OM,SHEBANG:AM,BACKSLASH_ESCAPE:ao,APOS_STRING_MODE:RM,QUOTE_STRING_MODE:IM,PHRASAL_WORDS_MODE:DM,COMMENT:Zs,C_LINE_COMMENT_MODE:LM,C_BLOCK_COMMENT_MODE:PM,HASH_COMMENT_MODE:BM,NUMBER_MODE:HM,C_NUMBER_MODE:FM,BINARY_NUMBER_MODE:zM,REGEXP_MODE:UM,TITLE_MODE:$M,UNDERSCORE_TITLE_MODE:KM,METHOD_GUARD:WM,END_SAME_AS_BEGIN:VM});function GM(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function qM(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className)}function jM(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=GM,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function YM(t,e){Array.isArray(t.illegal)&&(t.illegal=_u(...t.illegal))}function JM(t,e){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function XM(t,e){t.relevance===void 0&&(t.relevance=1)}var ZM=(t,e)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");let n=Object.assign({},t);Object.keys(t).forEach(r=>{delete t[r]}),t.keywords=n.keywords,t.begin=Or(n.beforeMatch,vb(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},QM=["of","and","for","in","not","or","if","then","parent","list","value"],eT="keyword";function Nb(t,e,n=eT){let r=Object.create(null);return typeof t=="string"?i(n,t.split(" ")):Array.isArray(t)?i(n,t):Object.keys(t).forEach(function(o){Object.assign(r,Nb(t[o],e,o))}),r;function i(o,s){e&&(s=s.map(a=>a.toLowerCase())),s.forEach(function(a){let l=a.split("|");r[l[0]]=[o,tT(l[0],l[1])]})}}function tT(t,e){return e?Number(e):nT(t)?0:1}function nT(t){return QM.includes(t.toLowerCase())}var mb={},Cr=t=>{console.error(t)},gb=(t,...e)=>{console.log(`WARN: ${t}`,...e)},pi=(t,e)=>{mb[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),mb[`${t}/${e}`]=!0)},Xs=new Error;function _b(t,e,{key:n}){let r=0,i=t[n],o={},s={};for(let a=1;a<=e.length;a++)s[a+r]=i[a],o[a+r]=!0,r+=Sb(e[a-1]);t[n]=s,t[n]._emit=o,t[n]._multi=!0}function rT(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw Cr("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Xs;if(typeof t.beginScope!="object"||t.beginScope===null)throw Cr("beginScope must be object"),Xs;_b(t,t.begin,{key:"beginScope"}),t.begin=Cu(t.begin,{joinWith:""})}}function iT(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw Cr("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Xs;if(typeof t.endScope!="object"||t.endScope===null)throw Cr("endScope must be object"),Xs;_b(t,t.end,{key:"endScope"}),t.end=Cu(t.end,{joinWith:""})}}function oT(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function sT(t){oT(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),rT(t),iT(t)}function aT(t){function e(s,a){return new RegExp(so(s),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(a?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(a,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,a]),this.matchAt+=Sb(a)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let a=this.regexes.map(l=>l[1]);this.matcherRe=e(Cu(a,{joinWith:"|"}),!0),this.lastIndex=0}exec(a){this.matcherRe.lastIndex=this.lastIndex;let l=this.matcherRe.exec(a);if(!l)return null;let c=l.findIndex((d,f)=>f>0&&d!==void 0),u=this.matchIndexes[c];return l.splice(0,c),Object.assign(l,u)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(a){if(this.multiRegexes[a])return this.multiRegexes[a];let l=new n;return this.rules.slice(a).forEach(([c,u])=>l.addRule(c,u)),l.compile(),this.multiRegexes[a]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(a,l){this.rules.push([a,l]),l.type==="begin"&&this.count++}exec(a){let l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let c=l.exec(a);if(this.resumingScanAtSamePosition()&&!(c&&c.index===this.lastIndex)){let u=this.getMatcher(0);u.lastIndex=this.lastIndex+1,c=u.exec(a)}return c&&(this.regexIndex+=c.position+1,this.regexIndex===this.count&&this.considerAll()),c}}function i(s){let a=new r;return s.contains.forEach(l=>a.addRule(l.begin,{rule:l,type:"begin"})),s.terminatorEnd&&a.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&a.addRule(s.illegal,{type:"illegal"}),a}function o(s,a){let l=s;if(s.isCompiled)return l;[qM,JM,sT,ZM].forEach(u=>u(s,a)),t.compilerExtensions.forEach(u=>u(s,a)),s.__beforeBegin=null,[jM,YM,XM].forEach(u=>u(s,a)),s.isCompiled=!0;let c=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),c=s.keywords.$pattern,delete s.keywords.$pattern),c=c||/\w+/,s.keywords&&(s.keywords=Nb(s.keywords,t.case_insensitive)),l.keywordPatternRe=e(c,!0),a&&(s.begin||(s.begin=/\B|\b/),l.beginRe=e(l.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(l.endRe=e(l.end)),l.terminatorEnd=so(l.end)||"",s.endsWithParent&&a.terminatorEnd&&(l.terminatorEnd+=(s.end?"|":"")+a.terminatorEnd)),s.illegal&&(l.illegalRe=e(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(u){return lT(u==="self"?s:u)})),s.contains.forEach(function(u){o(u,l)}),s.starts&&o(s.starts,a),l.matcher=i(l),l}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=qn(t.classNameAliases||{}),o(t)}function Cb(t){return t?t.endsWithParent||Cb(t.starts):!1}function lT(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return qn(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:Cb(t)?qn(t,{starts:t.starts?qn(t.starts):null}):Object.isFrozen(t)?qn(t):t}var cT="11.8.0",Nu=class extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}},ku=wb,bb=qn,yb=Symbol("nomatch"),uT=7,Ob=function(t){let e=Object.create(null),n=Object.create(null),r=[],i=!0,o="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]},a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Tu};function l(E){return a.noHighlightRe.test(E)}function c(E){let v=E.className+" ";v+=E.parentNode?E.parentNode.className:"";let C=a.languageDetectRe.exec(v);if(C){let P=O(C[1]);return P||(gb(o.replace("{}",C[1])),gb("Falling back to no-highlight mode for this block.",E)),P?C[1]:"no-highlight"}return v.split(/\s+/).find(P=>l(P)||O(P))}function u(E,v,C){let P="",Y="";typeof v=="object"?(P=E,C=v.ignoreIllegals,Y=v.language):(pi("10.7.0","highlight(lang, code, ...args) has been deprecated."),pi("10.7.0",`Please use highlight(code, options) instead. -https://github.com/highlightjs/highlight.js/issues/2277`),Y=E,P=v),C===void 0&&(C=!0);let Q={code:P,language:Y};ce("before:highlight",Q);let he=Q.result?Q.result:d(Q.language,Q.code,C);return he.code=Q.code,ce("after:highlight",he),he}function d(E,v,C,P){let Y=Object.create(null);function Q(T,A){return T.keywords[A]}function he(){if(!F.keywords){Ee.addText(ae);return}let T=0;F.keywordPatternRe.lastIndex=0;let A=F.keywordPatternRe.exec(ae),q="";for(;A;){q+=ae.substring(T,A.index);let oe=Pe.case_insensitive?A[0].toLowerCase():A[0],Be=Q(F,oe);if(Be){let[xt,la]=Be;if(Ee.addText(q),q="",Y[oe]=(Y[oe]||0)+1,Y[oe]<=uT&&(Qe+=la),xt.startsWith("_"))q+=A[0];else{let x=Pe.classNameAliases[xt]||xt;ke(A[0],x)}}else q+=A[0];T=F.keywordPatternRe.lastIndex,A=F.keywordPatternRe.exec(ae)}q+=ae.substring(T),Ee.addText(q)}function ye(){if(ae==="")return;let T=null;if(typeof F.subLanguage=="string"){if(!e[F.subLanguage]){Ee.addText(ae);return}T=d(F.subLanguage,ae,!0,le[F.subLanguage]),le[F.subLanguage]=T._top}else T=p(ae,F.subLanguage.length?F.subLanguage:null);F.relevance>0&&(Qe+=T.relevance),Ee.__addSublanguage(T._emitter,T.language)}function ue(){F.subLanguage!=null?ye():he(),ae=""}function ke(T,A){T!==""&&(Ee.startScope(A),Ee.addText(T),Ee.endScope())}function pt(T,A){let q=1,oe=A.length-1;for(;q<=oe;){if(!T._emit[q]){q++;continue}let Be=Pe.classNameAliases[T[q]]||T[q],xt=A[q];Be?ke(xt,Be):(ae=xt,he(),ae=""),q++}}function Ze(T,A){return T.scope&&typeof T.scope=="string"&&Ee.openNode(Pe.classNameAliases[T.scope]||T.scope),T.beginScope&&(T.beginScope._wrap?(ke(ae,Pe.classNameAliases[T.beginScope._wrap]||T.beginScope._wrap),ae=""):T.beginScope._multi&&(pt(T.beginScope,A),ae="")),F=Object.create(T,{parent:{value:F}}),F}function fe(T,A,q){let oe=NM(T.endRe,q);if(oe){if(T["on:end"]){let Be=new Js(T);T["on:end"](A,Be),Be.isMatchIgnored&&(oe=!1)}if(oe){for(;T.endsParent&&T.parent;)T=T.parent;return T}}if(T.endsWithParent)return fe(T.parent,A,q)}function ot(T){return F.matcher.regexIndex===0?(ae+=T[0],1):(U=!0,0)}function vt(T){let A=T[0],q=T.rule,oe=new Js(q),Be=[q.__beforeBegin,q["on:begin"]];for(let xt of Be)if(xt&&(xt(T,oe),oe.isMatchIgnored))return ot(A);return q.skip?ae+=A:(q.excludeBegin&&(ae+=A),ue(),!q.returnBegin&&!q.excludeBegin&&(ae=A)),Ze(q,T),q.returnBegin?0:A.length}function St(T){let A=T[0],q=v.substring(T.index),oe=fe(F,T,q);if(!oe)return yb;let Be=F;F.endScope&&F.endScope._wrap?(ue(),ke(A,F.endScope._wrap)):F.endScope&&F.endScope._multi?(ue(),pt(F.endScope,T)):Be.skip?ae+=A:(Be.returnEnd||Be.excludeEnd||(ae+=A),ue(),Be.excludeEnd&&(ae=A));do F.scope&&Ee.closeNode(),!F.skip&&!F.subLanguage&&(Qe+=F.relevance),F=F.parent;while(F!==oe.parent);return oe.starts&&Ze(oe.starts,T),Be.returnEnd?0:A.length}function jt(){let T=[];for(let A=F;A!==Pe;A=A.parent)A.scope&&T.unshift(A.scope);T.forEach(A=>Ee.openNode(A))}let Ke={};function dn(T,A){let q=A&&A[0];if(ae+=T,q==null)return ue(),0;if(Ke.type==="begin"&&A.type==="end"&&Ke.index===A.index&&q===""){if(ae+=v.slice(A.index,A.index+1),!i){let oe=new Error(`0 width match regex (${E})`);throw oe.languageName=E,oe.badRule=Ke.rule,oe}return 1}if(Ke=A,A.type==="begin")return vt(A);if(A.type==="illegal"&&!C){let oe=new Error('Illegal lexeme "'+q+'" for mode "'+(F.scope||"")+'"');throw oe.mode=F,oe}else if(A.type==="end"){let oe=St(A);if(oe!==yb)return oe}if(A.type==="illegal"&&q==="")return 1;if(L>1e5&&L>A.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ae+=q,q.length}let Pe=O(E);if(!Pe)throw Cr(o.replace("{}",E)),new Error('Unknown language: "'+E+'"');let X=aT(Pe),Ht="",F=P||X,le={},Ee=new a.__emitter(a);jt();let ae="",Qe=0,je=0,L=0,U=!1;try{if(Pe.__emitTokens)Pe.__emitTokens(v,Ee);else{for(F.matcher.considerAll();;){L++,U?U=!1:F.matcher.considerAll(),F.matcher.lastIndex=je;let T=F.matcher.exec(v);if(!T)break;let A=v.substring(je,T.index),q=dn(A,T);je=T.index+q}dn(v.substring(je))}return Ee.finalize(),Ht=Ee.toHTML(),{language:E,value:Ht,relevance:Qe,illegal:!1,_emitter:Ee,_top:F}}catch(T){if(T.message&&T.message.includes("Illegal"))return{language:E,value:ku(v),illegal:!0,relevance:0,_illegalBy:{message:T.message,index:je,context:v.slice(je-100,je+100),mode:T.mode,resultSoFar:Ht},_emitter:Ee};if(i)return{language:E,value:ku(v),illegal:!1,relevance:0,errorRaised:T,_emitter:Ee,_top:F};throw T}}function f(E){let v={value:ku(E),illegal:!1,relevance:0,_top:s,_emitter:new a.__emitter(a)};return v._emitter.addText(E),v}function p(E,v){v=v||a.languages||Object.keys(e);let C=f(E),P=v.filter(O).filter(ne).map(ue=>d(ue,E,!1));P.unshift(C);let Y=P.sort((ue,ke)=>{if(ue.relevance!==ke.relevance)return ke.relevance-ue.relevance;if(ue.language&&ke.language){if(O(ue.language).supersetOf===ke.language)return 1;if(O(ke.language).supersetOf===ue.language)return-1}return 0}),[Q,he]=Y,ye=Q;return ye.secondBest=he,ye}function h(E,v,C){let P=v&&n[v]||C;E.classList.add("hljs"),E.classList.add(`language-${P}`)}function m(E){let v=null,C=c(E);if(l(C))return;if(ce("before:highlightElement",{el:E,language:C}),E.children.length>0&&(a.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(E)),a.throwUnescapedHTML))throw new Nu("One of your code blocks includes unescaped HTML.",E.innerHTML);v=E;let P=v.textContent,Y=C?u(P,{language:C,ignoreIllegals:!0}):p(P);E.innerHTML=Y.value,h(E,C,Y.language),E.result={language:Y.language,re:Y.relevance,relevance:Y.relevance},Y.secondBest&&(E.secondBest={language:Y.secondBest.language,relevance:Y.secondBest.relevance}),ce("after:highlightElement",{el:E,result:Y,text:P})}function g(E){a=bb(a,E)}let y=()=>{b(),pi("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function S(){b(),pi("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let M=!1;function b(){if(document.readyState==="loading"){M=!0;return}document.querySelectorAll(a.cssSelector).forEach(m)}function _(){M&&b()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",_,!1);function w(E,v){let C=null;try{C=v(t)}catch(P){if(Cr("Language definition for '{}' could not be registered.".replace("{}",E)),i)Cr(P);else throw P;C=s}C.name||(C.name=E),e[E]=C,C.rawDefinition=v.bind(null,t),C.aliases&&J(C.aliases,{languageName:E})}function D(E){delete e[E];for(let v of Object.keys(n))n[v]===E&&delete n[v]}function K(){return Object.keys(e)}function O(E){return E=(E||"").toLowerCase(),e[E]||e[n[E]]}function J(E,{languageName:v}){typeof E=="string"&&(E=[E]),E.forEach(C=>{n[C.toLowerCase()]=v})}function ne(E){let v=O(E);return v&&!v.disableAutodetect}function ie(E){E["before:highlightBlock"]&&!E["before:highlightElement"]&&(E["before:highlightElement"]=v=>{E["before:highlightBlock"](Object.assign({block:v.el},v))}),E["after:highlightBlock"]&&!E["after:highlightElement"]&&(E["after:highlightElement"]=v=>{E["after:highlightBlock"](Object.assign({block:v.el},v))})}function Z(E){ie(E),r.push(E)}function re(E){let v=r.indexOf(E);v!==-1&&r.splice(v,1)}function ce(E,v){let C=E;r.forEach(function(P){P[C]&&P[C](v)})}function N(E){return pi("10.7.0","highlightBlock will be removed entirely in v12.0"),pi("10.7.0","Please use highlightElement now."),m(E)}Object.assign(t,{highlight:u,highlightAuto:p,highlightAll:b,highlightElement:m,highlightBlock:N,configure:g,initHighlighting:y,initHighlightingOnLoad:S,registerLanguage:w,unregisterLanguage:D,listLanguages:K,getLanguage:O,registerAliases:J,autoDetection:ne,inherit:bb,addPlugin:Z,removePlugin:re}),t.debugMode=function(){i=!1},t.safeMode=function(){i=!0},t.versionString=cT,t.regex={concat:Or,lookahead:vb,either:_u,optional:MM,anyNumberOfTimes:kM};for(let E in Ys)typeof Ys[E]=="object"&&Eb(Ys[E]);return Object.assign(t,Ys),t},hi=Ob({});hi.newInstance=()=>Ob({});Ab.exports=hi;hi.HighlightJS=hi;hi.default=hi});var Db=Fu((bL,Au)=>{(function(){var t;typeof Au<"u"?t=Au.exports=r:t=function(){return this||(0,eval)("this")}(),t.format=r,t.vsprintf=n,typeof console<"u"&&typeof console.log=="function"&&(t.printf=e);function e(){console.log(r.apply(null,arguments))}function n(i,o){return r.apply(null,[i].concat(o))}function r(i){for(var o=1,s=[].slice.call(arguments),a=0,l=i.length,c="",u,d=!1,f,p,h=!1,m,g=function(){return s[o++]},y=function(){for(var S="";/\d/.test(i[a]);)S+=i[a++],u=i[a];return S.length>0?parseInt(S):null};a>1}};et.from=function(t){if(t instanceof et)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new et(e)};var fa=et;function qu(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=qu(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function ju(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),a=e.child(--o),l=s.nodeSize;if(s==a){n-=l,r-=l;continue}if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let c=0,u=Math.min(s.text.length,a.text.length);for(;ce&&r(l,i+a,o||null,s)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,n-u),r,i+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(a,l)=>{a.isText?(o+=a.text.slice(Math.max(e,l)-l,n-l),s=!r):a.isLeaf?(i?o+=typeof i=="function"?i(a):i:a.type.spec.leafText&&(o+=a.type.spec.leafText(a)),s=!r):!s&&a.isBlock&&(o+=r,s=!0)},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);oe)for(let o=0,s=0;se&&((sn)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,n-s-1))),r.push(a),i+=a.nodeSize),s=l}return new k(r,i)}cutByIndex(e,n){return e==n?k.empty:e==0&&n==this.content.length?this:new k(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new k(i,o)}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 n=0;nthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||n>0?ho(r+1,s):ho(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return k.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new k(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return k.empty;let n,r=0;for(let i=0;ithis.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;nr.type.rank-i.type.rank),n}};de.none=[];var Zn=class extends Error{},R=class{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=Ju(this.content,e+this.openStart,n);return r&&new R(r,this.openStart,this.openEnd)}removeBetween(e,n){return new R(Yu(this.content,e+this.openStart,n+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,n){if(!n)return R.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new R(k.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new R(e,r,i)}};R.empty=new R(k.empty,0,0);function Yu(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(i==e||o.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(Yu(o.content,e-i-1,n-i-1)))}function Ju(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=Ju(s.content,e-o-1,n);return a&&t.replaceChild(i,s.copy(a))}function oy(t,e,n){if(n.openStart>t.depth)throw new Zn("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Zn("Inconsistent open depths");return Xu(t,e,n,0)}function Xu(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function bi(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(Jn(t.nodeAfter,r),o++));for(let a=o;ai&&ba(t,e,i+1),s=r.depth>i&&ba(n,r,i+1),a=[];return bi(null,t,i,a),o&&s&&e.index(i)==n.index(i)?(Zu(o,s),Jn(Xn(o,Qu(t,e,n,r,i+1)),a)):(o&&Jn(Xn(o,go(t,e,i+1)),a),bi(e,n,i,a),s&&Jn(Xn(s,go(n,r,i+1)),a)),bi(r,null,i,a),new k(a)}function go(t,e,n){let r=[];if(bi(null,t,n,r),t.depth>n){let i=ba(t,e,n+1);Jn(Xn(i,go(t,e,n+1)),r)}return bi(e,null,n,r),new k(r)}function sy(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(k.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}var Qn=class{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.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,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new er(this,e,r);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&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(o),c=o-l;if(r.push(s,a,i+l),!c||(s=s.child(a),s.isText))break;o=c-1,i+=l+1}return new Qn(n,r,o)}static resolveCached(e,n){for(let i=0;ie&&this.nodesBetween(e,n,o=>(r.isInSet(o.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()+")"),ed(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=k.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=i;ln.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n 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(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=k.fromJSON(e,n.content);return e.nodeType(n.type).create(n.attrs,i,r)}};mt.prototype.text=void 0;var Lr=class extends mt{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):ed(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Lr(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Lr(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function ed(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}var fn=class{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new ya(e,n);if(r.next==null)return fn.empty;let i=td(r);r.next&&r.err("Unexpected trailing text");let o=my(hy(i));return gy(o,r),o}matchType(e){for(let n=0;nc.createAndFill()));for(let c=0;c=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s"+e.indexOf(r.next[s].next);return o}).join(` -`)}};fn.empty=new fn(!0);var ya=class{constructor(e,n){this.string=e,this.nodeTypes=n,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 td(t){let e=[];do e.push(cy(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function cy(t){let e=[];do e.push(uy(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function uy(t){let e=py(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=dy(t,e);else break;return e}function Uu(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function dy(t,e){let n=Uu(t),r=n;return t.eat(",")&&(t.next!="}"?r=Uu(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function fy(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.groups.indexOf(e)>-1&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function py(t){if(t.eat("(")){let e=td(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=fy(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function hy(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(s,a,l){let c={term:l,to:a};return e[s].push(c),c}function i(s,a){s.forEach(l=>l.to=a)}function o(s,a){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(o(c,a)),[]);if(s.type=="seq")for(let l=0;;l++){let c=o(s.exprs[l],a);if(l==s.exprs.length-1)return c;i(c,a=n())}else if(s.type=="star"){let l=n();return r(a,l),i(o(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return i(o(s.expr,a),l),i(o(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(a)].concat(o(s.expr,a));if(s.type=="range"){let l=a;for(let c=0;c{t[s].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u{c||i.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let o=e[r.join(",")]=new fn(r.indexOf(t.length-1)>-1);for(let s=0;s-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;nr[o]=new Pr(o,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}},Ea=class{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}},tr=class{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=od(i.attrs),this.excluded=null;let o=rd(this.attrs);this.instance=o?new de(this,o):null}create(e=null){return!e&&this.instance?this.instance:new de(this,id(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new tr(o,i++,n,s)),r}removeFromSet(e){for(var n=0;n-1}},bo=class{constructor(e){this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=fa.from(e.nodes),n.marks=fa.from(e.marks||{}),this.nodes=Pr.compile(this.spec.nodes,this),this.marks=tr.compile(this.spec.marks,this);let r=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 o=this.nodes[i],s=o.spec.content||"",a=o.spec.marks;o.contentMatch=r[s]||(r[s]=fn.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet=a=="_"?null:a?Ku(this,a.split(" ")):a==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:Ku(this,s.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,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Pr){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(n,r,i)}text(e,n){let r=this.nodes.text;return new Lr(r,r.defaultAttrs,e,de.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return mt.fromJSON(this,e)}markFromJSON(e){return de.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}};function Ku(t,e){let n=[];for(let r=0;r-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}var Yt=class{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[],n.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let i=e.nodes[r.node];return i.contentMatch.matchType(i)})}parse(e,n={}){let r=new wo(this,n,!1);return r.addAll(e,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new wo(this,n,!0);return r.addAll(e,n.from,n.to),R.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;ie.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s{r(s=Vu(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=Vu(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Yt(e,Yt.schemaRules(e)))}},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},by={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},ad={ol:!0,ul:!0},yo=1,Eo=2,yi=4;function Wu(t,e,n){return e!=null?(e?yo:0)|(e==="full"?Eo:0):t&&t.whitespace=="pre"?yo|Eo:n&~yi}var Dr=class{constructor(e,n,r,i,o,s,a){this.type=e,this.attrs=n,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=a,this.content=[],this.activeMarks=de.none,this.stashMarks=[],this.match=s||(a&yi?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(k.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&yo)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=k.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(k.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}popFromStashMark(e){for(let n=this.stashMarks.length-1;n>=0;n--)if(e.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(e){for(let n=0,r=this.pendingMarks;nthis.addAll(e)),s&&this.sync(a),this.needsBlock=l}else this.withStyleRules(e,()=>{this.addElementByRule(e,o,o.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 n=de.none,r=de.none;for(let i=0;i{s.clearMark(a)&&(r=a.addToSet(r))}):n=this.parser.schema.marks[s.mark].create(s.attrs).addToSet(n),s.consuming===!1)o=s;else break}return[n,r]}addElementByRule(e,n,r){let i,o,s;n.node?(o=this.parser.schema.nodes[n.node],o.isLeaf?this.insertNode(o.create(n.attrs))||this.leafFallback(e):i=this.enter(o,n.attrs||null,n.preserveWhitespace)):(s=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(s));let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l)}i&&this.sync(a)&&this.open--,s&&this.removePendingMark(s,a)}addAll(e,n,r){let i=n||0;for(let o=n?e.childNodes[n]:e.firstChild,s=r==null?null:e.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let n,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],s=o.findWrapping(e);if(s&&(!n||n.length>s.length)&&(n=s,r=o,!s.length)||o.solid)break}if(!n)return!1;this.sync(r);for(let i=0;ithis.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].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 n=this.open;n>=0;n--)if(this.nodes[n]==e)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(a,l)=>{for(;a>=0;a--){let c=n[a];if(c==""){if(a==n.length-1||a==0)continue;for(;l>=o;l--)if(s(a-1,l))return!0;return!1}else{let u=l>0||l==0&&i?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!u||u.name!=c&&u.groups.indexOf(c)==-1)return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let n=Sy(e,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,n){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let s=i.popFromStashMark(e);s&&i.type&&i.type.allowsMarkType(s.type)&&(i.activeMarks=s.addToSet(i.activeMarks))}if(i==n)break}}};function yy(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&ad.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function Ey(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function wy(t){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,n,r=[];for(;n=e.exec(t);)r.push(n[1],n[2].trim());return r}function Vu(t){let e={};for(let n in t)e[n]=t[n];return e}function vy(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=a=>{o.push(a);for(let l=0;l{if(o.length||s.marks.length){let a=0,l=0;for(;a=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&ht.renderSpec(ga(r),i(e,n))}static renderSpec(e,n,r=null){if(typeof n=="string")return{dom:e.createTextNode(n)};if(n.nodeType!=null)return{dom:n};if(n.dom&&n.dom.nodeType!=null)return n;let i=n[0],o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let s,a=r?e.createElementNS(r,i):e.createElement(i),l=n[1],c=1;if(l&&typeof l=="object"&&l.nodeType==null&&!Array.isArray(l)){c=2;for(let u in l)if(l[u]!=null){let d=u.indexOf(" ");d>0?a.setAttributeNS(u.slice(0,d),u.slice(d+1),l[u]):a.setAttribute(u,l[u])}}for(let u=c;uc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:f,contentDOM:p}=ht.renderSpec(e,d,r);if(a.appendChild(f),p){if(s)throw new RangeError("Multiple content holes");s=p}}}return{dom:a,contentDOM:s}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ht(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Gu(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return Gu(e.marks)}};function Gu(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function ga(t){return t.document||window.document}var ud=65535,dd=Math.pow(2,16);function xy(t,e){return t+e*dd}function ld(t){return t&ud}function ky(t){return(t-(t&ud))/dd}var fd=1,pd=2,vo=4,hd=8,vi=class{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&hd)>0}get deletedBefore(){return(this.delInfo&(fd|vo))>0}get deletedAfter(){return(this.delInfo&(pd|vo))>0}get deletedAcross(){return(this.delInfo&vo)>0}},gt=class{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&>.empty)return gt.empty}recover(e){let n=0,r=ld(e);if(!this.inverted)for(let i=0;ie)break;let c=this.ranges[a+o],u=this.ranges[a+s],d=l+c;if(e<=d){let f=c?e==l?-1:e==d?1:n:n,p=l+i+(f<0?0:u);if(r)return p;let h=e==(n<0?l:d)?null:xy(a/3,e-l),m=e==l?pd:e==d?fd:vo;return(n<0?e!=l:e!=d)&&(m|=hd),new vi(p,m,h)}i+=u-c}return r?e+i:new vi(e+i,0,null)}touches(e,n){let r=0,i=ld(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;ae)break;let c=this.ranges[a+o],u=l+c;if(e<=u&&a==i*3)return!0;r+=this.ranges[a+s]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i=0;n--){let i=e.getMirror(n);this.appendMap(e.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new pn;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;ro&&l!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return Ie.fromReplace(e,this.from,this.to,o)}invert(){return new Tt(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Jt(n.pos,r.pos,this.mark)}merge(e){return e instanceof Jt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Jt(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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Jt(n.from,n.to,e.markFromJSON(n.mark))}};tt.jsonID("addMark",Jt);var Tt=class extends tt{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new R(Ma(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Ie.fromReplace(e,this.from,this.to,r)}invert(){return new Jt(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Tt(n.pos,r.pos,this.mark)}merge(e){return e instanceof Tt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Tt(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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Tt(n.from,n.to,e.markFromJSON(n.mark))}};tt.jsonID("removeMark",Tt);var Xt=class extends tt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Ie.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Ie.fromReplace(e,this.pos,this.pos+1,new R(k.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;ir.pos?null:new Te(n.pos,r.pos,i,o,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,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Te(n.from,n.to,n.gapFrom,n.gapTo,R.fromJSON(e,n.slice),n.insert,!!n.structure)}};tt.jsonID("replaceAround",Te);function xa(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function My(t,e,n,r){let i=[],o=[],s,a;t.doc.nodesBetween(e,n,(l,c,u)=>{if(!l.isInline)return;let d=l.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),p=Math.min(c+l.nodeSize,n),h=r.addToSet(d);for(let m=0;mt.step(l)),o.forEach(l=>t.step(l))}function Ty(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(s,a)=>{if(!s.isInline)return;o++;let l=null;if(r instanceof tr){let c=s.marks,u;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let c=Math.min(a+s.nodeSize,n);for(let u=0;ut.step(new Tt(s.from,s.to,s.style)))}function Ny(t,e,n,r=n.contentMatch){let i=t.doc.nodeAt(e),o=[],s=e+1;for(let a=0;a=0;a--)t.step(o[a])}function _y(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function hn(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),o=t.$from.index(r),s=t.$to.indexAfter(r);if(rn;h--)m||r.index(h)>0?(m=!0,u=k.from(r.node(h).copy(u)),d++):l--;let f=k.empty,p=0;for(let h=o,m=!1;h>n;h--)m||i.after(h+1)=0;s--){if(r.size){let a=n[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=k.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new Te(i,o,i,o,new R(r,0,0),n.length,!0))}function Iy(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(s,a)=>{if(s.isTextblock&&!s.hasMarkup(r,i)&&Dy(t.doc,t.mapping.slice(o).map(a),r)){t.clearIncompatible(t.mapping.slice(o).map(a,1),r);let l=t.mapping.slice(o),c=l.map(a,1),u=l.map(a+s.nodeSize,1);return t.step(new Te(c,u,c+1,u-1,new R(k.from(r.create(i,null,s.marks)),0,0),1,!0)),!1}})}function Dy(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function Ly(t,e,n,r,i){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Te(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new R(k.from(s),0,0),1,!0))}function Nt(t,e,n=1,r){let i=t.resolve(e),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,u=n-2;c>o;c--,u--){let d=i.node(c),f=i.index(c);if(d.type.spec.isolating)return!1;let p=d.content.cutByIndex(f,d.childCount),h=r&&r[u+1];h&&(p=p.replaceChild(0,h.type.create(h.attrs)));let m=r&&r[u]||d;if(!d.canReplace(f+1,d.childCount)||!m.type.validContent(p))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function Py(t,e,n=1,r){let i=t.doc.resolve(e),o=k.empty,s=k.empty;for(let a=i.depth,l=i.depth-n,c=n-1;a>l;a--,c--){o=k.from(i.node(a).copy(o));let u=r&&r[c];s=k.from(u?u.type.create(u.attrs,s):i.node(a).copy(s))}t.step(new Oe(e,e,new R(o.append(s),n,n),!0))}function Ft(t,e){let n=t.resolve(e),r=n.index();return md(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function md(t,e){return!!(t&&e&&!t.isLeaf&&t.canAppend(e))}function Ta(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let o,s,a=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):n>0?(o=r.node(i+1),a++,s=r.node(i).maybeChild(a)):(o=r.node(i).maybeChild(a-1),s=r.node(i+1)),o&&!o.isTextblock&&md(o,s)&&r.node(i).canReplace(a,a+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function By(t,e,n){let r=new Oe(e-n,e+n,R.empty,!0);t.step(r)}function Hy(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o=0;s--){let a=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,l=r.index(s)+(a>0?1:0),c=r.node(s),u=!1;if(o==1)u=c.canReplace(l,l,i);else{let d=c.contentMatchAt(l).findWrapping(i.firstChild.type);u=d&&c.canReplaceWith(l,l,d[0])}if(u)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function xo(t,e,n=e,r=R.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return gd(i,o,r)?new Oe(e,n,r):new ka(i,o,r).fit()}function gd(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}var ka=class{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=k.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.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 c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,a=i.depth;for(;s&&a&&o.childCount==1;)o=o.firstChild.content,s--,a--;let l=new R(o,s,a);return e>-1?new Te(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Oe(r.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=va(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],u,d=null;if(n==1&&(s?c.matchType(s.type)||(d=c.fillBefore(k.from(s),!1)):o&&l.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:a,parent:o,inject:d};if(n==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:o,wrap:u};if(o&&c.matchType(o.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=va(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new R(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=va(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new R(Ei(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new R(Ei(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let m=0;m1||l==0||m.content.size)&&(d=g,u.push(bd(m.mark(f.allowedMarks(m.marks)),c==1?l:0,c==a.childCount?p:-1)))}let h=c==a.childCount;h||(p=-1),this.placed=wi(this.placed,n,k.from(u)),this.frontier[n].match=d,h&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,g=a;m1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n=0;a--){let{match:l,type:c}=this.frontier[a],u=Sa(e,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:n,fit:s,move:o?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=wi(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=wi(this.placed,this.depth,k.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(k.empty,!0);n.childCount&&(this.placed=wi(this.placed,this.frontier.length,n))}};function Ei(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Ei(t.firstChild.content,e-1,n)))}function wi(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(wi(t.lastChild.content,e-1,n)))}function va(t,e){for(let n=0;n1&&(r=r.replaceChild(0,bd(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(k.empty,!0)))),t.copy(r)}function Sa(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!Fy(n,o.content,s)?a:null}function Fy(t,e,n){for(let r=n;r0;f--,p--){let h=i.node(f).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;s.indexOf(f)>-1?a=f:i.before(f)==p&&s.splice(1,0,-f)}let l=s.indexOf(a),c=[],u=r.openStart;for(let f=r.content,p=0;;p++){let h=f.firstChild;if(c.push(h),p==r.openStart)break;f=h.content}for(let f=u-1;f>=0;f--){let p=c[f].type,h=zy(p);if(h&&i.node(l).type!=p)u=f;else if(h||!p.isTextblock)break}for(let f=r.openStart;f>=0;f--){let p=(f+u+1)%(r.openStart+1),h=c[p];if(h)for(let m=0;m=0&&(t.replace(e,n,r),!(t.steps.length>d));f--){let p=s[f];p<0||(e=i.before(p),n=o.after(p))}}function yd(t,e,n,r,i){if(er){let o=i.contentMatchAt(0),s=o.fillBefore(t).append(t);t=s.append(o.matchFragment(s).fillBefore(k.empty,!0))}return t}function $y(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=Hy(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new R(k.from(r),0,0))}function Ky(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=Ed(r,i);for(let s=0;s0&&(l||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return t.delete(r.before(a),i.after(a))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s)return t.delete(r.before(s),n);t.delete(e,n)}function Ed(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let o=t.start(i);if(oe.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&n.push(i)}return n}var Nn=class extends tt{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return Ie.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Ie.fromReplace(e,this.pos,this.pos+1,new R(k.from(i),0,n.isLeaf?0:1))}getMap(){return gt.empty}invert(e){return new Nn(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Nn(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Nn(n.pos,n.attr,n.value)}};tt.jsonID("attr",Nn);var Br=class extends Error{};Br=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};Br.prototype=Object.create(Error.prototype);Br.prototype.constructor=Br;Br.prototype.name="TransformError";var Cn=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new pn}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Br(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=R.empty){let i=xo(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new R(k.from(r),0,0))}delete(e,n){return this.replace(e,n,R.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return Uy(this,e,n,r),this}replaceRangeWith(e,n,r){return $y(this,e,n,r),this}deleteRange(e,n){return Ky(this,e,n),this}lift(e,n){return Cy(this,e,n),this}join(e,n=1){return By(this,e,n),this}wrap(e,n){return Ry(this,e,n),this}setBlockType(e,n=e,r,i=null){return Iy(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return Ly(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new Nn(e,n,r)),this}addNodeMark(e,n){return this.step(new Xt(e,n)),this}removeNodeMark(e,n){if(!(n instanceof de)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new _n(e,n)),this}split(e,n=1,r){return Py(this,e,n,r),this}addMark(e,n,r){return My(this,e,n,r),this}removeMark(e,n,r){return Ty(this,e,n,r),this}clearIncompatible(e,n,r){return Ny(this,e,n,r),this}};var Na=Object.create(null),V=class{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new xi(e.min(n),e.max(n))]}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 n=0;n=0;o--){let s=n<0?Fr(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):Fr(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Ye(e.node(0))}static atStart(e){return Fr(e,e,0,0,1)||new Ye(e)}static atEnd(e){return Fr(e,e,e.content.size,e.childCount,-1)||new Ye(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Na[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Na)throw new RangeError("Duplicate use of selection JSON ID "+e);return Na[e]=n,n.prototype.jsonID=e,n}getBookmark(){return $.between(this.$anchor,this.$head).getBookmark()}};V.prototype.visible=!0;var xi=class{constructor(e,n){this.$from=e,this.$to=n}},wd=!1;function vd(t){!wd&&!t.parent.inlineContent&&(wd=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}var $=class extends V{constructor(e,n=e){vd(e),vd(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return V.near(r);let i=e.resolve(n.map(this.anchor));return new $(i.parent.inlineContent?i:r,r)}replace(e,n=R.empty){if(super.replace(e,n),n==R.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof $&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new zr(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new $(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=V.findFrom(n,r,!0)||V.findFrom(n,-r,!0);if(o)n=o.$head;else return V.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(V.findFrom(e,-r,!0)||V.findFrom(e,r,!0)).$anchor,e.pos0?0:1);i>0?s=0;s+=i){let a=e.child(s);if(a.isAtom){if(!o&&G.isSelectable(a))return G.create(t,n-(i<0?a.nodeSize:0))}else{let l=Fr(t,a,n+i,i<0?a.childCount:0,i,o);if(l)return l}n+=a.nodeSize*i}return null}function Sd(t,e,n){let r=t.steps.length-1;if(r{s==null&&(s=u)}),t.setSelection(V.near(t.doc.resolve(s),n))}var xd=1,ko=2,kd=4,Ca=class extends Cn{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|=ko,this}ensureMarks(e){return de.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&ko)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~ko,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||de.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(n);o=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,o)),this.selection.empty||this.setSelection(V.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,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|=kd,this}get scrolledIntoView(){return(this.updated&kd)>0}};function Md(t,e){return!e||!t?t:t.bind(e)}var nr=class{constructor(e,n,r){this.name=e,this.init=Md(n.init,r),this.apply=Md(n.apply,r)}},Vy=[new nr("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new nr("selection",{init(t,e){return t.selection||V.atStart(e.doc)},apply(t){return t.selection}}),new nr("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new nr("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})],Si=class{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Vy.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new nr(r.key,r.spec.state,r))})}},mn=class{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,n=-1){for(let r=0;rr.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new Si(e.schema,e.plugins),o=new mn(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=mt.fromJSON(e.schema,n.doc);else if(s.name=="selection")o.selection=V.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],c=l.spec.state;if(l.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){o[s.name]=c.fromJSON.call(l,e,n[a],o);return}}o[s.name]=s.init(e,o)}}),o}};function Td(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=Td(i,e,{})),n[r]=i}return n}var me=class{constructor(e){this.spec=e,this.props={},e.props&&Td(e.props,this,this.props),this.key=e.key?e.key.key:Nd("plugin")}getState(e){return e[this.key]}},_a=Object.create(null);function Nd(t){return t in _a?t+"$"+ ++_a[t]:(_a[t]=0,t+"$")}var ve=class{constructor(e="key"){this.key=Nd(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}};var lt=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Ci=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e},_d=null,bn=function(t,e,n){let r=_d||(_d=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},cr=function(t,e,n,r){return n&&(Cd(t,e,n,r,-1)||Cd(t,e,n,r,1))},Gy=/^(img|br|input|textarea|hr)$/i;function Cd(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Zt(t))){let o=t.parentNode;if(!o||o.nodeType!=1||Za(t)||Gy.test(t.nodeName)||t.contentEditable=="false")return!1;e=lt(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.contentEditable=="false")return!1;e=i<0?Zt(t):0}else return!1}}function Zt(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function qy(t,e,n){for(let r=e==0,i=e==Zt(t);r||i;){if(t==n)return!0;let o=lt(t);if(t=t.parentNode,!t)return!1;r=r&&o==0,i=i&&o==Zt(t)}}function Za(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}var Ao=function(t){return t.focusNode&&cr(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function rr(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function jy(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Yy(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:r.offset}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:r.startOffset}}}var nn=typeof navigator<"u"?navigator:null,Od=typeof document<"u"?document:null,In=nn&&nn.userAgent||"",Da=/Edge\/(\d+)/.exec(In),af=/MSIE \d/.exec(In),La=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(In),bt=!!(af||La||Da),Rn=af?document.documentMode:La?+La[1]:Da?+Da[1]:0,Ut=!bt&&/gecko\/(\d+)/i.test(In);Ut&&+(/Firefox\/(\d+)/.exec(In)||[0,0])[1];var Pa=!bt&&/Chrome\/(\d+)/.exec(In),rt=!!Pa,Jy=Pa?+Pa[1]:0,ct=!bt&&!!nn&&/Apple Computer/.test(nn.vendor),Wr=ct&&(/Mobile\/\w+/.test(In)||!!nn&&nn.maxTouchPoints>2),_t=Wr||(nn?/Mac/.test(nn.platform):!1),Xy=nn?/Win/.test(nn.platform):!1,zt=/Android \d/.test(In),Ro=!!Od&&"webkitFontSmoothing"in Od.documentElement.style,Zy=Ro?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Qy(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function gn(t,e){return typeof t=="number"?t:t[e]}function eE(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function Ad(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let s=n||t.dom;s;s=Ci(s)){if(s.nodeType!=1)continue;let a=s,l=a==o.body,c=l?Qy(o):eE(a),u=0,d=0;if(e.topc.bottom-gn(r,"bottom")&&(d=e.bottom-e.top>c.bottom-c.top?e.top+gn(i,"top")-c.top:e.bottom-c.bottom+gn(i,"bottom")),e.leftc.right-gn(r,"right")&&(u=e.right-c.right+gn(i,"right")),u||d)if(l)o.defaultView.scrollBy(u,d);else{let f=a.scrollLeft,p=a.scrollTop;d&&(a.scrollTop+=d),u&&(a.scrollLeft+=u);let h=a.scrollLeft-f,m=a.scrollTop-p;e={left:e.left-h,top:e.top-m,right:e.right-h,bottom:e.bottom-m}}if(l||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function tE(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=n+1;s=n-20){r=a,i=l.top;break}}return{refDOM:r,refTop:i,stack:lf(t.dom)}}function lf(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Ci(r));return e}function nE({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;cf(n,r==0?0:r-e)}function cf(t,e){for(let n=0;n=a){s=Math.max(h.bottom,s),a=Math.min(h.top,a);let m=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=u,c={left:Math.max(h.left,Math.min(h.right,e.left)),top:h.top});!n&&(e.left>=h.right&&e.top>=h.top||e.left>=h.left&&e.top>=h.bottom)&&(o=d+1)}}return!n&&l&&(n=l,i=c,r=0),n&&n.nodeType==3?iE(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:uf(n,i)}function iE(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function Qa(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function oE(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,i,o)}function aE(t,e,n,r){let i=-1;for(let o=e,s=!1;o!=t.dom;){let a=t.docView.nearestDesc(o,!0);if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent&&!s||!a.contentDOM)){let l=a.dom.getBoundingClientRect();if(a.node.isBlock&&a.parent&&!s&&(s=!0,l.left>r.left||l.top>r.top?i=a.posBefore:(l.right-1?i:t.docView.posFromDOM(e,n,-1)}function df(t,e,n){let r=t.childNodes.length;if(r&&n.tope.top&&i++}r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=aE(t,r,i,e))}a==null&&(a=sE(t,s,e));let l=t.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function Rd(t){return t.top=0&&i==r.nodeValue.length?(l--,u=1):n<0?l--:c++,Mi(On(bn(r,l,c),u),u<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==Zt(r))){let l=r.childNodes[i-1];if(l.nodeType==1)return Oa(l.getBoundingClientRect(),!1)}if(o==null&&i=0)}if(o==null&&i&&(n<0||i==Zt(r))){let l=r.childNodes[i-1],c=l.nodeType==3?bn(l,Zt(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return Mi(On(c,1),!1)}if(o==null&&i=0)}function Mi(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Oa(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function pf(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function uE(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return pf(t,e,()=>{let{node:o}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(o,!0);if(!a)break;if(a.node.isBlock){o=a.contentDOM||a.dom;break}o=a.dom.parentNode}let s=ff(t,i.pos,1);for(let a=o.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=bn(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;cu.top+1&&(n=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}var dE=/[\u0590-\u08ac]/;function fE(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=t.domSelection();return!dE.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?o:s:pf(t,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:d}=t.domSelectionRange(),f=a.caretBidiLevel;a.modify("move",n,"character");let p=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:h,focusOffset:m}=t.domSelectionRange(),g=h&&!p.contains(h.nodeType==1?h:h.parentNode)||l==h&&c==m;try{a.collapse(u,d),l&&(l!=u||c!=d)&&a.extend&&a.extend(l,c)}catch{}return f!=null&&(a.caretBidiLevel=f),g})}var Id=null,Dd=null,Ld=!1;function pE(t,e,n){return Id==e&&Dd==n?Ld:(Id=e,Dd=n,Ld=n=="up"||n=="down"?uE(t,e,n):fE(t,e,n))}var Ct=0,Pd=1,or=2,rn=3,ur=class{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Ct,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;nlt(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(n==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!n||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return o}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;ne||s instanceof To){i=e-o;break}o=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof Mo&&o.side>=0;r--);if(n<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&n&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?lt(o.dom)+1:0}}else{let o,s=!0;for(;o=r=u&&n<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,u);e=s;for(let d=a;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){i=lt(f.dom)+1;break}e-=f.size}i==-1&&(i=0)}if(i>-1&&(c>n||a==this.children.length-1)){n=c;for(let u=a+1;up&&sn){let p=a;a=l,l=p}let f=document.createRange();f.setEnd(l.node,l.offset),f.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(f)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i=r:er){let a=r+o.border,l=s-o.border;if(e>=a&&n<=l){this.dirty=e==r||n==s?or:Pd,e==a&&n==l&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=rn:o.markDirty(e-a,n-a);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?or:rn}r=s}this.dirty=or}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?or:Pd;n.dirty{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(e){return this.dirty==Ct&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(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}},Ba=class extends ur{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}},En=class extends ur{constructor(e,n,r,i){super(e,[],r,i),this.mark=n}static create(e,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=ht.renderSpec(document,n.type.spec.toDOM(n,r))),new En(e,n,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&rn||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=rn&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Ct){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(o=$a(o,0,e,r));for(let a=0;a{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},r,i),u=c&&c.dom,d=c&&c.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=ht.renderSpec(document,n.type.spec.toDOM(n)));!d&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=gf(u,r,n),c?l=new Ha(e,n,r,i,u,d||null,f,c,o,s+1):n.isText?new Vr(e,n,r,i,u,f,o):new en(e,n,r,i,u,d||null,f,o,s+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 n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>k.empty)}return e}matchesNode(e,n,r){return this.dirty==Ct&&e.eq(this.node)&&za(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,o=e.composing?this.localCompositionInfo(e,n):null,s=o&&o.pos>-1?o:null,a=o&&o.pos<0,l=new Ua(this,s&&s.node,e);bE(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!d&&l.syncToMarks(u==this.node.childCount?de.none:this.node.child(u).marks,r,e),l.placeWidget(c,e,i)},(c,u,d,f)=>{l.syncToMarks(c.marks,r,e);let p;l.findNodeMatch(c,u,d,f)||a&&e.state.selection.from>i&&e.state.selection.to-1&&l.updateNodeAt(c,u,d,p,e)||l.updateNextNode(c,u,d,e,f,i)||l.addNode(c,u,d,e,i),i+=c.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==or)&&(s&&this.protectLocalComposition(e,s),hf(this.contentDOM,this.children,e),Wr&&yE(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof $)||rn+this.node.content.size)return null;let o=e.domSelectionRange(),s=EE(o.focusNode,o.focusOffset);if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let a=s.nodeValue,l=wE(this.node.content,a,r-n,i-n);return l<0?null:{node:s,pos:l,text:a}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new Ba(this,o,n,i);e.input.compositionNodes.push(s),this.children=$a(this.children,r,r+i.length,e,s)}update(e,n,r,i){return this.dirty==rn||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Ct}updateOuterDeco(e){if(za(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=mf(this.dom,this.nodeDOM,Fa(this.outerDeco,this.node,n),Fa(e,this.node,n)),this.dom!=r&&(r.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 Bd(t,e,n,r,i){gf(r,e,t);let o=new en(void 0,t,e,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}var Vr=class extends en{constructor(e,n,r,i,o,s,a){super(e,n,r,i,o,null,s,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==rn||this.dirty!=Ct&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Ct||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=Ct,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),o=document.createTextNode(i.text);return new Vr(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=rn)}get domAtom(){return!1}},To=class extends ur{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Ct&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}},Ha=class extends en{constructor(e,n,r,i,o,s,a,l,c,u){super(e,n,r,i,o,s,a,c,u),this.spec=l}update(e,n,r,i){if(this.dirty==rn)return!1;if(this.spec.update){let o=this.spec.update(e,n,r);return o&&this.updateInner(e,n,r,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r):super.setSelection(e,n,r,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 hf(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o>1,s=Math.min(o,e.length);for(;i-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=En.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))o=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a0;){let a;for(;;)if(r){let c=n.children[r-1];if(c instanceof En)n=c,r=c.children.length;else{a=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}function gE(t,e){return t.type.side-e.type.side}function bE(t,e,n,r){let i=e.locals(t),o=0;if(i.length==0){for(let c=0;co;)a.push(i[s++]);let f=o+u.nodeSize;if(u.isText){let h=f;s!h.inline):a.slice();r(u,p,e.forChild(o,u),d),o=f}}function yE(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function EE(t,e){for(;;){if(t.nodeType==3)return t;if(t.nodeType==1&&e>0){if(t.childNodes.length>e&&t.childNodes[e].nodeType==3)return t.childNodes[e];t=t.childNodes[e-1],e=Zt(t)}else if(t.nodeType==1&&e=n){let c=a=0&&c+e.length+a>=n)return a+c;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function $a(t,e,n,r,i){let o=[];for(let s=0,a=0;s=n||u<=e?o.push(l):(cn&&o.push(l.slice(n-c,l.size,r)))}return o}function el(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=r.resolve(s),l,c;if(Ao(n)){for(l=a;i&&!i.node;)i=i.parent;let u=i.node;if(i&&u.isAtom&&G.isSelectable(u)&&i.parent&&!(u.isInline&&qy(n.focusNode,n.focusOffset,i.dom))){let d=i.posBefore;c=new G(s==d?a:r.resolve(d))}}else{let u=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(u<0)return null;l=r.resolve(u)}if(!c){let u=e=="pointer"||t.state.selection.head{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!bf(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function SE(t){let e=t.domSelection(),n=document.createRange(),r=t.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setEnd(r.parentNode,lt(r)+1):n.setEnd(r,0),n.collapse(!1),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&bt&&Rn<=11&&(r.disabled=!0,r.disabled=!1)}function yf(t,e){if(e instanceof G){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&($d(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else $d(t)}function $d(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function tl(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||$.between(e,n,r)}function Kd(t){return t.editable&&!t.hasFocus()?!1:Ef(t)}function Ef(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function xE(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return cr(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Ka(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return o&&V.findFrom(o,e)}function ir(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Wd(t,e,n){let r=t.state.selection;if(r instanceof $){if(!r.empty||n.indexOf("s")>-1)return!1;if(t.endOfTextblock(e>0?"forward":"backward")){let i=Ka(t.state,e);return i&&i instanceof G?ir(t,i):!1}else if(!(_t&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let a=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=t.docView.descAt(a))&&!s.contentDOM?G.isSelectable(o)?ir(t,new G(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):Ro?ir(t,new $(t.state.doc.resolve(e<0?a:a+o.nodeSize))):!1:!1}}else{if(r instanceof G&&r.node.isInline)return ir(t,new $(e>0?r.$to:r.$from));{let i=Ka(t.state,e);return i?ir(t,i):!1}}}function No(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function _i(t){if(t.contentEditable=="false")return!0;let e=t.pmViewDesc;return e&&e.size==0&&(t.nextSibling||t.nodeName!="BR")}function Ti(t,e){return e<0?kE(t):wf(t)}function kE(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;for(Ut&&n.nodeType==1&&r0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(_i(a))i=n,o=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(vf(n))break;{let a=n.previousSibling;for(;a&&_i(a);)i=n.parentNode,o=lt(a),a=a.previousSibling;if(a)n=a,r=No(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Wa(t,n,r):i&&Wa(t,i,o)}function wf(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=No(n),o,s;for(;;)if(r{t.state==i&&yn(t)},50)}function Vd(t,e){let n=t.state.doc.resolve(e);if(!(rt||Xy)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let o=t.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>i.top&&s1)return o.lefti.top&&s1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function Gd(t,e,n){let r=t.state.selection;if(r instanceof $&&!r.empty||n.indexOf("s")>-1||_t&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=Ka(t.state,e);if(s&&s instanceof G)return ir(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,a=r instanceof Ye?V.near(s,e):V.findFrom(s,e);return a?ir(t,a):!1}return!1}function qd(t,e){if(!(t.state.selection instanceof $))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let s=t.state.tr;return e<0?s.delete(n.pos-o.nodeSize,n.pos):s.delete(n.pos,n.pos+o.nodeSize),t.dispatch(s),!0}return!1}function jd(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function NE(t){if(!ct||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;jd(t,r,"true"),setTimeout(()=>jd(t,r,"false"),20)}return!1}function _E(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function CE(t,e){let n=e.keyCode,r=_E(e);if(n==8||_t&&n==72&&r=="c")return qd(t,-1)||Ti(t,-1);if(n==46&&!e.shiftKey||_t&&n==68&&r=="c")return qd(t,1)||Ti(t,1);if(n==13||n==27)return!0;if(n==37||_t&&n==66&&r=="c"){let i=n==37?Vd(t,t.state.selection.from)=="ltr"?-1:1:-1;return Wd(t,i,r)||Ti(t,i)}else if(n==39||_t&&n==70&&r=="c"){let i=n==39?Vd(t,t.state.selection.from)=="ltr"?1:-1:1;return Wd(t,i,r)||Ti(t,i)}else{if(n==38||_t&&n==80&&r=="c")return Gd(t,-1,r)||Ti(t,-1);if(n==40||_t&&n==78&&r=="c")return NE(t)||Gd(t,1,r)||wf(t);if(r==(_t?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Sf(t,e){t.someProp("transformCopied",p=>{e=p(e,t)});let n=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let s=t.someProp("clipboardSerializer")||ht.fromSchema(t.state.schema),a=_f(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c=l.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=Nf[c.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let h=a.createElement(u[p]);for(;l.firstChild;)h.appendChild(l.firstChild);l.appendChild(h),d++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${o}${d?` -${d}`:""} ${JSON.stringify(n)}`);let f=t.someProp("clipboardTextSerializer",p=>p(e,t))||e.content.textBetween(0,e.content.size,` - -`);return{dom:l,text:f}}function xf(t,e,n,r,i){let o=i.parent.type.spec.code,s,a;if(!n&&!e)return null;let l=e&&(r||o||!n);if(l){if(t.someProp("transformPastedText",f=>{e=f(e,o||r,t)}),o)return e?new R(k.from(t.state.schema.text(e.replace(/\r\n?/g,` -`))),0,0):R.empty;let d=t.someProp("clipboardTextParser",f=>f(e,i,r,t));if(d)a=d;else{let f=i.marks(),{schema:p}=t.state,h=ht.fromSchema(p);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let g=s.appendChild(document.createElement("p"));m&&g.appendChild(h.serializeNode(p.text(m,f)))})}}else t.someProp("transformPastedHTML",d=>{n=d(n,t)}),s=RE(n),Ro&&IE(s);let c=s&&s.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let f=s.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;s=f}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||Yt.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||u),context:i,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!OE.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)a=DE(Yd(a,+u[1],+u[2]),u[4]);else if(a=R.maxOpen(AE(a.content,i),!0),a.openStart||a.openEnd){let d=0,f=0;for(let p=a.content.firstChild;d{a=d(a,t)}),a}var OE=/^(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 AE(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),o,s=[];if(t.forEach(a=>{if(!s)return;let l=i.findWrapping(a.type),c;if(!l)return s=null;if(c=s.length&&o.length&&Mf(l,o,a,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=Tf(s[s.length-1],o.length));let u=kf(a,l);s.push(u),i=i.matchType(u.type),o=l}}),s)return k.from(s)}return t}function kf(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,k.from(t));return t}function Mf(t,e,n,r,i){if(i1&&(o=0),i=n&&(a=e<0?s.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(k.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function Yd(t,e,n){return e]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=_f().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&Nf[r[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"").reverse().join("")),n.innerHTML=t,i)for(let o=0;o=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;i=k.from(l.create(r[a+1],i)),o++,s++}return new R(i,o,s)}var ut={},dt={},LE={touchstart:!0,touchmove:!0},Ga=class{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.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 PE(t){for(let e in ut){let n=ut[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{HE(t,r)&&!nl(t,r)&&(t.editable||!(r.type in dt))&&n(t,r)},LE[e]?{passive:!0}:void 0)}ct&&t.dom.addEventListener("input",()=>null),qa(t)}function An(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function BE(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function qa(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>nl(t,r))})}function nl(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function HE(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function FE(t,e){!nl(t,e)&&ut[e.type]&&(t.editable||!(e.type in dt))&&ut[e.type](t,e)}dt.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!Of(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(zt&&rt&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Wr&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,rr(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||CE(t,n)?n.preventDefault():An(t,"key")};dt.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};dt.keypress=(t,e)=>{let n=e;if(Of(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||_t&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof $)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,i))&&t.dispatch(t.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function Io(t){return{left:t.clientX,top:t.clientY}}function zE(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function rl(t,e,n,r,i){if(r==-1)return!1;let o=t.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(t.someProp(e,a=>s>o.depth?a(t,n,o.nodeAfter,o.before(s),i,!0):a(t,n,o.node(s),o.before(s),i,!1)))return!0;return!1}function Kr(t,e,n){t.focused||t.focus();let r=t.state.tr.setSelection(e);n=="pointer"&&r.setMeta("pointer",!0),t.dispatch(r)}function UE(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&G.isSelectable(r)?(Kr(t,new G(n),"pointer"),!0):!1}function $E(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof G&&(r=n.node);let o=t.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let a=s>o.depth?o.nodeAfter:o.node(s);if(G.isSelectable(a)){r&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(s);break}}return i!=null?(Kr(t,G.create(t.state.doc,i),"pointer"),!0):!1}function KE(t,e,n,r,i){return rl(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?$E(t,n):UE(t,n))}function WE(t,e,n,r){return rl(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function VE(t,e,n,r){return rl(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||GE(t,n,r)}function GE(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Kr(t,$.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),a=i.before(o);if(s.inlineContent)Kr(t,$.create(r,a+1,a+1+s.content.size),"pointer");else if(G.isSelectable(s))Kr(t,G.create(r,a),"pointer");else continue;return!0}}function il(t){return _o(t)}var Cf=_t?"metaKey":"ctrlKey";ut.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=il(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&zE(n,t.input.lastClick)&&!n[Cf]&&(t.input.lastClick.type=="singleClick"?o="doubleClick":t.input.lastClick.type=="doubleClick"&&(o="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=t.posAtCoords(Io(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new ja(t,s,n,!!r)):(o=="doubleClick"?WE:VE)(t,s.pos,s.inside,n)?n.preventDefault():An(t,"pointer"))};var ja=class{constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[Cf],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=e.state.doc.nodeAt(n.inside),s=n.inside;else{let u=e.state.doc.resolve(n.pos);o=u.parent,s=u.depth?u.before():0}let a=i?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l?l.dom:null;let{selection:c}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||c instanceof G&&c.from<=s&&c.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Ut&&!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)),An(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(()=>yn(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Io(e))),this.updateAllowDefault(e),this.allowDefault||!n?An(this.view,"pointer"):KE(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||ct&&this.mightDrag&&!this.mightDrag.node.isAtom||rt&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Kr(this.view,V.near(this.view.state.doc.resolve(n.pos)),"pointer"),e.preventDefault()):An(this.view,"pointer")}move(e){this.updateAllowDefault(e),An(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)}};ut.touchstart=t=>{t.input.lastTouch=Date.now(),il(t),An(t,"pointer")};ut.touchmove=t=>{t.input.lastTouch=Date.now(),An(t,"pointer")};ut.contextmenu=t=>il(t);function Of(t,e){return t.composing?!0:ct&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}var qE=zt?5e3:-1;dt.compositionstart=dt.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),_o(t,!0),t.markCursor=null;else if(_o(t),Ut&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){t.domSelection().collapse(s,s.nodeValue.length);break}else i=s,o=-1}}t.input.composing=!0}Af(t,qE)};dt.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,Af(t,20))};function Af(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>_o(t),e))}function Rf(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=jE());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function jE(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function _o(t,e=!1){if(!(zt&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Rf(t),e||t.docView&&t.docView.dirty){let n=el(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):t.updateState(t.state),!0}return!1}}function YE(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}var Gr=bt&&Rn<15||Wr&&Zy<604;ut.copy=dt.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let o=Gr?null:n.clipboardData,s=r.content(),{dom:a,text:l}=Sf(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):YE(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function JE(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function XE(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Oi(t,r.value,null,i,e):Oi(t,r.textContent,r.innerHTML,i,e)},50)}function Oi(t,e,n,r,i){let o=xf(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,i,o||R.empty)))return!0;if(!o)return!1;let s=JE(o),a=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(o);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}dt.paste=(t,e)=>{let n=e;if(t.composing&&!zt)return;let r=Gr?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&Oi(t,r.getData("text/plain"),r.getData("text/html"),i,n)?n.preventDefault():XE(t,n)};var Ya=class{constructor(e,n){this.slice=e,this.move=n}},If=_t?"altKey":"ctrlKey";ut.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,o=i.empty?null:t.posAtCoords(Io(n));if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof G?i.to-1:i.to))){if(r&&r.mightDrag)t.dispatch(t.state.tr.setSelection(G.create(t.state.doc,r.mightDrag.pos)));else if(n.target&&n.target.nodeType==1){let c=t.docView.nearestDesc(n.target,!0);c&&c.node.type.spec.draggable&&c!=t.docView&&t.dispatch(t.state.tr.setSelection(G.create(t.state.doc,c.posBefore)))}}let s=t.state.selection.content(),{dom:a,text:l}=Sf(t,s);n.dataTransfer.clearData(),n.dataTransfer.setData(Gr?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",Gr||n.dataTransfer.setData("text/plain",l),t.dragging=new Ya(s,!n[If])};ut.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};dt.dragover=dt.dragenter=(t,e)=>e.preventDefault();dt.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(Io(n));if(!i)return;let o=t.state.doc.resolve(i.pos),s=r&&r.slice;s?t.someProp("transformPasted",h=>{s=h(s,t)}):s=xf(t,n.dataTransfer.getData(Gr?"Text":"text/plain"),Gr?null:n.dataTransfer.getData("text/html"),!1,o);let a=!!(r&&!n[If]);if(t.someProp("handleDrop",h=>h(t,n,s||R.empty,a))){n.preventDefault();return}if(!s)return;n.preventDefault();let l=s?So(t.state.doc,o.pos,s):o.pos;l==null&&(l=o.pos);let c=t.state.tr;a&&c.deleteSelection();let u=c.mapping.map(l),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,f=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(f))return;let p=c.doc.resolve(u);if(d&&G.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new G(p));else{let h=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((m,g,y,S)=>h=S),c.setSelection(tl(t,p,c.doc.resolve(h)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))};ut.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&yn(t)},20))};ut.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};ut.beforeinput=(t,e)=>{if(rt&&zt&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",o=>o(t,rr(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in dt)ut[t]=dt[t];function Ai(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}var Ri=class{constructor(e,n){this.toDOM=e,this.spec=n||ar,this.side=this.spec.side||0}map(e,n,r,i){let{pos:o,deleted:s}=e.mapResult(n.from+i,this.side<0?-1:1);return s?null:new De(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Ri&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Ai(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},tn=class{constructor(e,n){this.attrs=e,this.spec=n||ar}map(e,n,r,i){let o=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new De(o,s,this)}valid(e,n){return n.from=e&&(!o||o(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let s=0;se){let a=this.children[s]+1;this.children[s+2].findInner(e-a,n-a,r,i+a,o)}}map(e,n,r){return this==nt||e.maps.length==0?this:this.mapInner(e,n,0,0,r||ar)}mapInner(e,n,r,i,o){let s;for(let a=0;a{let c=l+r,u;if(u=Lf(n,a,c)){for(i||(i=this.children.slice());oa&&d.to=e){this.children[a]==e&&(r=this.children[a+2]);break}let o=e+1,s=o+n.content.size;for(let a=0;ao&&l.type instanceof tn){let c=Math.max(o,l.from)-o,u=Math.min(s,l.to)-o;ci.map(e,n,ar));return Qt.from(r)}forChild(e,n){if(n.isLeaf)return Se.empty;let r=[];for(let i=0;in instanceof Se)?e:e.reduce((n,r)=>n.concat(r instanceof Se?r:r.members),[]))}}};function ZE(t,e,n,r,i,o,s){let a=t.slice();for(let c=0,u=o;c{let g=m-h-(p-f);for(let y=0;yS+u-d)continue;let M=a[y]+u-d;p>=M?a[y+1]=f<=M?-2:-1:h>=i&&g&&(a[y]+=g,a[y+1]+=g)}d+=g}),u=n.maps[c].map(u,-1)}let l=!1;for(let c=0;c=r.content.size){l=!0;continue}let f=n.map(t[c+1]+o,-1),p=f-i,{index:h,offset:m}=r.content.findIndex(d),g=r.maybeChild(h);if(g&&m==d&&m+g.nodeSize==p){let y=a[c+2].mapInner(n,g,u+1,t[c]+o+1,s);y!=nt?(a[c]=d,a[c+1]=p,a[c+2]=y):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=QE(a,t,e,n,i,o,s),u=Co(c,r,0,s);e=u.local;for(let d=0;dn&&s.to{let c=Lf(t,a,l+n);if(c){o=!0;let u=Co(c,a,n+l+1,r);u!=nt&&i.push(l,l+a.nodeSize,u)}});let s=Df(o?Pf(t):t,-n).sort(lr);for(let a=0;a0;)e++;t.splice(e,0,n)}function Ra(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=nt&&e.push(r)}),t.cursorWrapper&&e.push(Se.create(t.state.doc,[t.cursorWrapper.deco])),Qt.from(e)}var e0={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},t0=bt&&Rn<=11,Ja=class{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}},Xa=class{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Ja,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;ii.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),t0&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.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,e0)),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 n=0;nthis.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(Kd(this.view)){if(this.suppressingSelectionUpdates)return yn(this.view);if(bt&&Rn<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&cr(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 n=new Set,r;for(let o=e.focusNode;o;o=Ci(o))n.add(o);for(let o=e.anchorNode;o;o=Ci(o))if(n.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))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 n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Kd(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,a=!1,l=[];if(e.editable)for(let u=0;u1){let u=l.filter(d=>d.nodeName=="BR");if(u.length==2){let d=u[0],f=u[1];d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}}let c=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||i)&&(o>-1&&(e.docView.markDirty(o,s),n0(e)),this.handleDOMChange(o,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||yn(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;ui;g--){let y=r.childNodes[g-1],S=y.pmViewDesc;if(y.nodeName=="BR"&&!S){o=g;break}if(!S||S.size)break}let d=t.state.doc,f=t.someProp("domParser")||Yt.fromSchema(t.state.schema),p=d.resolve(s),h=null,m=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:o,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:o0,context:p});if(c&&c[0].pos!=null){let g=c[0].pos,y=c[1]&&c[1].pos;y==null&&(y=g),h={anchor:g+s,head:y+s}}return{doc:m,sel:h,from:s,to:a}}function o0(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(ct&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||ct&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}var s0=/^(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 a0(t,e,n,r,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let O=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,J=el(t,O);if(J&&!t.state.selection.eq(J)){if(rt&&zt&&t.input.lastKeyCode===13&&Date.now()-100ie(t,rr(13,"Enter"))))return;let ne=t.state.tr.setSelection(J);O=="pointer"?ne.setMeta("pointer",!0):O=="key"&&ne.scrollIntoView(),o&&ne.setMeta("composition",o),t.dispatch(ne)}return}let s=t.state.doc.resolve(e),a=s.sharedDepth(n);e=s.before(a+1),n=t.state.doc.resolve(n).after(a+1);let l=t.state.selection,c=i0(t,e,n),u=t.state.doc,d=u.slice(c.from,c.to),f,p;t.input.lastKeyCode===8&&Date.now()-100Date.now()-225||zt)&&i.some(O=>O.nodeType==1&&!s0.test(O.nodeName))&&(!h||h.endA>=h.endB)&&t.someProp("handleKeyDown",O=>O(t,rr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!h)if(r&&l instanceof $&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))h={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let O=ef(t,t.state.doc,c.sel);if(O&&!O.eq(t.state.selection)){let J=t.state.tr.setSelection(O);o&&J.setMeta("composition",o),t.dispatch(J)}}return}if(rt&&t.cursorWrapper&&c.sel&&c.sel.anchor==t.cursorWrapper.deco.from&&c.sel.head==c.sel.anchor){let O=h.endB-h.start;c.sel={anchor:c.sel.anchor+O,head:c.sel.anchor+O}}t.input.domChangeCount++,t.state.selection.fromt.state.selection.from&&h.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?h.start=t.state.selection.from:h.endA=t.state.selection.to-2&&t.state.selection.to<=c.to&&(h.endB+=t.state.selection.to-h.endA,h.endA=t.state.selection.to)),bt&&Rn<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>c.from&&c.doc.textBetween(h.start-c.from-1,h.start-c.from+1)==" \xA0"&&(h.start--,h.endA--,h.endB--);let m=c.doc.resolveNoCache(h.start-c.from),g=c.doc.resolveNoCache(h.endB-c.from),y=u.resolve(h.start),S=m.sameParent(g)&&m.parent.inlineContent&&y.end()>=h.endA,M;if((Wr&&t.input.lastIOSEnter>Date.now()-225&&(!S||i.some(O=>O.nodeName=="DIV"||O.nodeName=="P"))||!S&&m.posO(t,rr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>h.start&&c0(u,h.start,h.endA,m,g)&&t.someProp("handleKeyDown",O=>O(t,rr(8,"Backspace")))){zt&&rt&&t.domObserver.suppressSelectionUpdates();return}rt&&zt&&h.endB==h.start&&(t.input.lastAndroidDelete=Date.now()),zt&&!S&&m.start()!=g.start()&&g.parentOffset==0&&m.depth==g.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==h.endA&&(h.endB-=2,g=c.doc.resolveNoCache(h.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(O){return O(t,rr(13,"Enter"))})},20));let b=h.start,_=h.endA,w,D,K;if(S){if(m.pos==g.pos)bt&&Rn<=11&&m.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>yn(t),20)),w=t.state.tr.delete(b,_),D=u.resolve(h.start).marksAcross(u.resolve(h.endA));else if(h.endA==h.endB&&(K=l0(m.parent.content.cut(m.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,h.endA-y.start()))))w=t.state.tr,K.type=="add"?w.addMark(b,_,K.mark):w.removeMark(b,_,K.mark);else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let O=m.parent.textBetween(m.parentOffset,g.parentOffset);if(t.someProp("handleTextInput",J=>J(t,b,_,O)))return;w=t.state.tr.insertText(O,b,_)}}if(w||(w=t.state.tr.replace(b,_,c.doc.slice(h.start-c.from,h.endB-c.from))),c.sel){let O=ef(t,w.doc,c.sel);O&&!(rt&&zt&&t.composing&&O.empty&&(h.start!=h.endB||t.input.lastAndroidDeletee.content.size?null:tl(t,e.resolve(n.anchor),e.resolve(n.head))}function l0(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,o=r,s,a,l;for(let u=0;uu.mark(a.addToSet(u.marks));else if(i.length==0&&o.length==1)a=o[0],s="remove",l=u=>u.mark(a.removeFromSet(u.marks));else return null;let c=[];for(let u=0;un||Ia(s,!0,!1)0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let o=t.node(r).maybeChild(t.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function u0(t,e,n,r,i){let o=t.findDiffStart(e,n);if(o==null)return null;let{a:s,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let l=Math.max(0,o-Math.min(s,a));r-=s+l-o}if(s=s?o-r:0;o-=l,a=o+(a-s),s=o}else if(a=a?o-r:0;o-=l,s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}var Oo=class{constructor(e,n){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 Ga,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(sf),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=rf(this),nf(this),this.nodeViews=of(this),this.docView=Bd(this.state.doc,tf(this),Ra(this),this.dom,this),this.domObserver=new Xa(this,(r,i,o,s)=>a0(this,r,i,o,s)),this.domObserver.start(),PE(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 n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&qa(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(sf),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){let r=this.state,i=!1,o=!1;e.storedMarks&&this.composing&&(Rf(this),o=!0),this.state=e;let s=r.plugins!=e.plugins||this._props.plugins!=n.plugins;if(s||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let f=of(this);f0(f,this.nodeViews)&&(this.nodeViews=f,i=!0)}(s||n.handleDOMEvents!=this._props.handleDOMEvents)&&qa(this),this.editable=rf(this),nf(this);let a=Ra(this),l=tf(this),c=r.plugins!=e.plugins&&!r.doc.eq(e.doc)?"reset":e.scrollToSelection>r.scrollToSelection?"to selection":"preserve",u=i||!this.docView.matchesNode(e.doc,l,a);(u||!e.selection.eq(r.selection))&&(o=!0);let d=c=="preserve"&&o&&this.dom.style.overflowAnchor==null&&tE(this);if(o){this.domObserver.stop();let f=u&&(bt||rt)&&!this.composing&&!r.selection.empty&&!e.selection.empty&&d0(r.selection,e.selection);if(u){let p=rt?this.trackWrites=this.domSelectionRange().focusNode:null;(i||!this.docView.update(e.doc,l,a,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Bd(e.doc,l,a,this.dom,this)),p&&!this.trackWrites&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&xE(this))?yn(this,f):(yf(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():d&&nE(d)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof G){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Ad(this,n.getBoundingClientRect(),e)}else Ad(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 n=0;nn.ownerDocument.getSelection()),this._root=n}return e||document}posAtCoords(e){return lE(this,e)}coordsAtPos(e,n=1){return ff(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return pE(this,n||this.state,e)}pasteHTML(e,n){return Oi(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return Oi(this,e,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(BE(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Ra(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(e){return FE(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){return ct&&this.root.nodeType===11&&jy(this.dom.ownerDocument)==this.dom?r0(this):this.domSelection()}domSelection(){return this.root.getSelection()}};function tf(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[De.node(0,t.state.doc.content.size,e)]}function nf(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:De.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function rf(t){return!t.someProp("editable",e=>e(t.state)===!1)}function d0(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function of(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function f0(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function sf(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var wn={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:"'"},Lo={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},p0=typeof navigator<"u"&&/Mac/.test(navigator.platform),h0=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(He=0;He<10;He++)wn[48+He]=wn[96+He]=String(He);var He;for(He=1;He<=24;He++)wn[He+111]="F"+He;var He;for(He=65;He<=90;He++)wn[He]=String.fromCharCode(He+32),Lo[He]=String.fromCharCode(He);var He;for(Do in wn)Lo.hasOwnProperty(Do)||(Lo[Do]=wn[Do]);var Do;function Bf(t){var e=p0&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||h0&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Lo:wn)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}var m0=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function g0(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let a=0;a127)&&(o=wn[r.keyCode])&&o!=i){let a=e[sl(o,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}var Po=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function y0(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}var ll=(t,e,n)=>{let r=y0(t,n);if(!r)return!1;let i=zf(r);if(!i){let s=r.blockRange(),a=s&&hn(s);return a==null?!1:(e&&e(t.tr.lift(s,a).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&Gf(t,i,e))return!0;if(r.parent.content.size==0&&(qr(o,"end")||G.isSelectable(o))){let s=xo(t.doc,r.before(),r.after(),R.empty);if(s&&s.slice.size{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;o=zf(r)}let s=o&&o.nodeBefore;return!s||!G.isSelectable(s)?!1:(e&&e(t.tr.setSelection(G.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function zf(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function E0(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset{let r=E0(t,n);if(!r)return!1;let i=Uf(r);if(!i)return!1;let o=i.nodeAfter;if(Gf(t,i,e))return!0;if(r.parent.content.size==0&&(qr(o,"start")||G.isSelectable(o))){let s=xo(t.doc,r.before(),r.after(),R.empty);if(s&&s.slice.size{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset=0;e--){let n=t.node(e);if(t.index(e)+1{let n=t.selection,r=n instanceof G,i;if(r){if(n.node.isTextblock||!Ft(t.doc,n.from))return!1;i=n.from}else if(i=Ta(t.doc,n.from,-1),i==null)return!1;if(e){let o=t.tr.join(i);r&&o.setSelection(G.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},Kf=(t,e)=>{let n=t.selection,r;if(n instanceof G){if(n.node.isTextblock||!Ft(t.doc,n.to))return!1;r=n.to}else if(r=Ta(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},Wf=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&hn(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},fl=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(` -`).scrollIntoView()),!0)};function pl(t){for(let e=0;e{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=pl(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,s.createAndFill());l.setSelection(V.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},ml=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof Ye||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=pl(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index(){let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(Nt(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&hn(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function w0(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof G&&e.selection.node.isBlock)return!r.parentOffset||!Nt(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.parent.isBlock)return!1;if(n){let o=i.parentOffset==i.parent.content.size,s=e.tr;(e.selection instanceof $||e.selection instanceof Ye)&&s.deleteSelection();let a=r.depth==0?null:pl(r.node(-1).contentMatchAt(r.indexAfter(-1))),l=t&&t(i.parent,o),c=l?[l]:o&&a?[{type:a}]:void 0,u=Nt(s.doc,s.mapping.map(r.pos),1,c);if(!c&&!u&&Nt(s.doc,s.mapping.map(r.pos),1,a?[{type:a}]:void 0)&&(a&&(c=[{type:a}]),u=!0),u&&(s.split(s.mapping.map(r.pos),1,c),!o&&!r.parentOffset&&r.parent.type!=a)){let d=s.mapping.map(r.before()),f=s.doc.resolve(d);a&&r.node(-1).canReplaceWith(f.index(),f.index()+1,a)&&s.setNodeMarkup(s.mapping.map(r.before()),a)}n(s.scrollIntoView())}return!0}}var v0=w0();var Vf=(t,e)=>{let{$from:n,to:r}=t.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),e&&e(t.tr.setSelection(G.create(t.doc,i))),!0)},S0=(t,e)=>(e&&e(t.tr.setSelection(new Ye(t.doc))),!0);function x0(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||Ft(t.doc,e.pos))?!1:(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function Gf(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o,s;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(x0(t,e,n))return!0;let a=e.parent.canReplace(e.index(),e.index()+1);if(a&&(o=(s=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&s.matchType(o[0]||i.type).validEnd){if(n){let d=e.pos+i.nodeSize,f=k.empty;for(let m=o.length-1;m>=0;m--)f=k.from(o[m].create(null,f));f=k.from(r.copy(f));let p=t.tr.step(new Te(e.pos-1,d,e.pos,d,new R(f,1,0),o.length,!0)),h=d+2*o.length;Ft(p.doc,h)&&p.join(h),n(p.scrollIntoView())}return!0}let l=V.findFrom(e,1),c=l&&l.$from.blockRange(l.$to),u=c&&hn(c);if(u!=null&&u>=e.depth)return n&&n(t.tr.lift(c,u).scrollIntoView()),!0;if(a&&qr(i,"start",!0)&&qr(r,"end")){let d=r,f=[];for(;f.push(d),!d.isTextblock;)d=d.lastChild;let p=i,h=1;for(;!p.isTextblock;p=p.firstChild)h++;if(d.canReplace(d.childCount,d.childCount,p.content)){if(n){let m=k.empty;for(let y=f.length-1;y>=0;y--)m=k.from(f[y].copy(m));let g=t.tr.step(new Te(e.pos-f.length,e.pos+i.nodeSize,e.pos+h,e.pos+i.nodeSize-h,new R(m,f.length,0),0,!0));n(g.scrollIntoView())}return!0}}return!1}function qf(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(e.tr.setSelection($.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}var bl=qf(-1),yl=qf(1);function jf(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&Hr(s,t,e);return a?(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function El(t,e=null){return function(n,r){let i=!1;for(let o=0;o{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)i=!0;else{let u=n.doc.resolve(c),d=u.index();i=u.parent.canReplaceWith(d,d+1,t)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s=2&&i.node(s.depth-1).type.compatibleContent(t)&&s.startIndex==0){if(i.index(s.depth-1)==0)return!1;let u=n.doc.resolve(s.start-2);l=new er(u,u,s.depth),s.endIndex=0;u--)o=k.from(n[u].type.create(n[u].attrs,o));t.step(new Te(e.start-(r?2:0),e.end,e.start,e.end,new R(o,0,0),n.length,!0));let s=0;for(let u=0;us.childCount>0&&s.firstChild.type==t);return o?n?r.node(o.depth-1).type==t?T0(e,n,t,o):N0(e,n,o):!0:!1}}function T0(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);om;h--)p-=i.child(h).nodeSize,r.delete(p-1,p+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==i.childCount,c=o.node(-1),u=o.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?k.empty:k.from(i))))return!1;let d=o.pos,f=d+s.nodeSize;return r.step(new Te(d-(a?1:0),f+(l?1:0),d+1,f-1,new R((a?k.empty:k.from(i.copy(k.empty))).append(l?k.empty:k.from(i.copy(k.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function Xf(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==t);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=t)return!1;if(n){let c=l.lastChild&&l.lastChild.type==a.type,u=k.from(c?t.create():null),d=new R(k.from(t.create(null,k.from(a.type.create(null,u)))),c?3:1,0),f=o.start,p=o.end;n(e.tr.step(new Te(f-(c?3:1),p,f,p,d,1,!0)).scrollIntoView())}return!0}}function Uo(t){let{state:e,transaction:n}=t,{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),filterTransaction:e.filterTransaction,plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}var jr=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,s=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...u)=>{let d=l(...u)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){let{rawCommands:r,editor:i,state:o}=this,{view:s}=i,a=[],l=!!e,c=e||o.tr,u=()=>(!l&&n&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(c),a.every(f=>f===!0)),d={...Object.fromEntries(Object.entries(r).map(([f,p])=>[f,(...m)=>{let g=this.buildProps(c,n),y=p(...m)(g);return a.push(y),d}])),run:u};return d}createCan(e){let{rawCommands:n,state:r}=this,i=!1,o=e||r.tr,s=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([l,c])=>[l,(...u)=>c(...u)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,n=!0){let{rawCommands:r,editor:i,state:o}=this,{view:s}=i;o.storedMarks&&e.setStoredMarks(o.storedMarks);let a={tr:e,editor:i,view:s,state:Uo({state:o,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([l,c])=>[l,(...u)=>c(...u)(a)]))}};return a}},Tl=class{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){let r=this.callbacks[e];return r&&r.forEach(i=>i.apply(this,n)),this}off(e,n){let r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(i=>i!==n):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}};function H(t,e,n){return t.config[e]===void 0&&t.parent?H(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?H(t.parent,e,n):null}):t.config[e]}function $o(t){let e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function op(t){let e=[],{nodeExtensions:n,markExtensions:r}=$o(t),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(s=>{let a={name:s.name,options:s.options,storage:s.storage},l=H(s,"addGlobalAttributes",a);if(!l)return;l().forEach(u=>{u.types.forEach(d=>{Object.entries(u.attributes).forEach(([f,p])=>{e.push({type:d,name:f,attribute:{...o,...p}})})})})}),i.forEach(s=>{let a={name:s.name,options:s.options,storage:s.storage},l=H(s,"addAttributes",a);if(!l)return;let c=l();Object.entries(c).forEach(([u,d])=>{let f={...o,...d};typeof f?.default=="function"&&(f.default=f.default()),f?.isRequired&&f?.default===void 0&&delete f.default,e.push({type:s.name,name:u,attribute:f})})}),e}function We(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function B(...t){return t.filter(e=>!!e).reduce((e,n)=>{let r={...e};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}i==="class"?r[i]=[r[i],o].join(" "):i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function Nl(t,e){return e.filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>B(n,r),{})}function sp(t){return typeof t=="function"}function ee(t,e=void 0,...n){return sp(t)?e?t.bind(e)(...n):t(...n):t}function _0(t={}){return Object.keys(t).length===0&&t.constructor===Object}function C0(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function Zf(t,e){return t.style?t:{...t,getAttrs:n=>{let r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;let i=e.reduce((o,s)=>{let a=s.attribute.parseHTML?s.attribute.parseHTML(n):C0(n.getAttribute(s.name));return a==null?o:{...o,[s.name]:a}},{});return{...r,...i}}}}function Qf(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&_0(n)?!1:n!=null))}function O0(t,e){var n;let r=op(t),{nodeExtensions:i,markExtensions:o}=$o(t),s=(n=i.find(c=>H(c,"topNode")))===null||n===void 0?void 0:n.name,a=Object.fromEntries(i.map(c=>{let u=r.filter(y=>y.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},f=t.reduce((y,S)=>{let M=H(S,"extendNodeSchema",d);return{...y,...M?M(c):{}}},{}),p=Qf({...f,content:ee(H(c,"content",d)),marks:ee(H(c,"marks",d)),group:ee(H(c,"group",d)),inline:ee(H(c,"inline",d)),atom:ee(H(c,"atom",d)),selectable:ee(H(c,"selectable",d)),draggable:ee(H(c,"draggable",d)),code:ee(H(c,"code",d)),defining:ee(H(c,"defining",d)),isolating:ee(H(c,"isolating",d)),attrs:Object.fromEntries(u.map(y=>{var S;return[y.name,{default:(S=y?.attribute)===null||S===void 0?void 0:S.default}]}))}),h=ee(H(c,"parseHTML",d));h&&(p.parseDOM=h.map(y=>Zf(y,u)));let m=H(c,"renderHTML",d);m&&(p.toDOM=y=>m({node:y,HTMLAttributes:Nl(y,u)}));let g=H(c,"renderText",d);return g&&(p.toText=g),[c.name,p]})),l=Object.fromEntries(o.map(c=>{let u=r.filter(g=>g.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},f=t.reduce((g,y)=>{let S=H(y,"extendMarkSchema",d);return{...g,...S?S(c):{}}},{}),p=Qf({...f,inclusive:ee(H(c,"inclusive",d)),excludes:ee(H(c,"excludes",d)),group:ee(H(c,"group",d)),spanning:ee(H(c,"spanning",d)),code:ee(H(c,"code",d)),attrs:Object.fromEntries(u.map(g=>{var y;return[g.name,{default:(y=g?.attribute)===null||y===void 0?void 0:y.default}]}))}),h=ee(H(c,"parseHTML",d));h&&(p.parseDOM=h.map(g=>Zf(g,u)));let m=H(c,"renderHTML",d);return m&&(p.toDOM=g=>m({mark:g,HTMLAttributes:Nl(g,u)})),[c.name,p]}));return new bo({topNode:s,nodes:a,marks:l})}function vl(t,e){return e.nodes[t]||e.marks[t]||null}function ep(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}var A0=(t,e=500)=>{let n="",r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,o,s,a)=>{var l,c;let u=((c=(l=i.type.spec).toText)===null||c===void 0?void 0:c.call(l,{node:i,pos:o,parent:s,index:a}))||i.textContent||"%leaf%";n+=u.slice(0,Math.max(0,r-o))}),n};function Al(t){return Object.prototype.toString.call(t)==="[object RegExp]"}var Yr=class{constructor(e){this.find=e.find,this.handler=e.handler}},R0=(t,e)=>{if(Al(e))return e.exec(t);let n=e(t);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function Sl(t){var e;let{editor:n,from:r,to:i,text:o,rules:s,plugin:a}=t,{view:l}=n;if(l.composing)return!1;let c=l.state.doc.resolve(r);if(c.parent.type.spec.code||!((e=c.nodeBefore||c.nodeAfter)===null||e===void 0)&&e.marks.find(f=>f.type.spec.code))return!1;let u=!1,d=A0(c)+o;return s.forEach(f=>{if(u)return;let p=R0(d,f.find);if(!p)return;let h=l.state.tr,m=Uo({state:l.state,transaction:h}),g={from:r-(p[0].length-o.length),to:i},{commands:y,chain:S,can:M}=new jr({editor:n,state:m});f.handler({state:m,range:g,match:p,commands:y,chain:S,can:M})===null||!h.steps.length||(h.setMeta(a,{transform:h,from:r,to:i,text:o}),l.dispatch(h),u=!0)}),u}function I0(t){let{editor:e,rules:n}=t,r=new me({state:{init(){return null},apply(i,o){let s=i.getMeta(r);return s||(i.selectionSet||i.docChanged?null:o)}},props:{handleTextInput(i,o,s,a){return Sl({editor:e,from:o,to:s,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{let{$cursor:o}=i.state.selection;o&&Sl({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;let{$cursor:s}=i.state.selection;return s?Sl({editor:e,from:s.pos,to:s.pos,text:` -`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function D0(t){return typeof t=="number"}var _l=class{constructor(e){this.find=e.find,this.handler=e.handler}},L0=(t,e)=>{if(Al(e))return[...t.matchAll(e)];let n=e(t);return n?n.map(r=>{let i=[r.text];return i.index=r.index,i.input=t,i.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(r.replaceWith)),i}):[]};function P0(t){let{editor:e,state:n,from:r,to:i,rule:o}=t,{commands:s,chain:a,can:l}=new jr({editor:e,state:n}),c=[];return n.doc.nodesBetween(r,i,(d,f)=>{if(!d.isTextblock||d.type.spec.code)return;let p=Math.max(r,f),h=Math.min(i,f+d.content.size),m=d.textBetween(p-f,h-f,void 0,"\uFFFC");L0(m,o.find).forEach(y=>{if(y.index===void 0)return;let S=p+y.index+1,M=S+y[0].length,b={from:n.tr.mapping.map(S),to:n.tr.mapping.map(M)},_=o.handler({state:n,range:b,match:y,commands:s,chain:a,can:l});c.push(_)})}),c.every(d=>d!==null)}function B0(t){let{editor:e,rules:n}=t,r=null,i=!1,o=!1;return n.map(a=>new me({view(l){let c=u=>{var d;r=!((d=l.dom.parentElement)===null||d===void 0)&&d.contains(u.target)?l.dom.parentElement:null};return window.addEventListener("dragstart",c),{destroy(){window.removeEventListener("dragstart",c)}}},props:{handleDOMEvents:{drop:l=>(o=r===l.dom.parentElement,!1),paste:(l,c)=>{var u;let d=(u=c.clipboardData)===null||u===void 0?void 0:u.getData("text/html");return i=!!d?.includes("data-pm-slice"),!1}}},appendTransaction:(l,c,u)=>{let d=l[0],f=d.getMeta("uiEvent")==="paste"&&!i,p=d.getMeta("uiEvent")==="drop"&&!o;if(!f&&!p)return;let h=c.doc.content.findDiffStart(u.doc.content),m=c.doc.content.findDiffEnd(u.doc.content);if(!D0(h)||!m||h===m.b)return;let g=u.tr,y=Uo({state:u,transaction:g});if(!(!P0({editor:e,state:y,from:Math.max(h-1,0),to:m.b-1,rule:a})||!g.steps.length))return g}}))}function H0(t){let e=t.filter((n,r)=>t.indexOf(n)!==r);return[...new Set(e)]}var Ln=class{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=Ln.resolve(e),this.schema=O0(this.extensions,n),this.extensions.forEach(r=>{var i;this.editor.extensionStorage[r.name]=r.storage;let o={name:r.name,options:r.options,storage:r.storage,editor:this.editor,type:vl(r.name,this.schema)};r.type==="mark"&&(!((i=ee(H(r,"keepOnSplit",o)))!==null&&i!==void 0)||i)&&this.splittableMarks.push(r.name);let s=H(r,"onBeforeCreate",o);s&&this.editor.on("beforeCreate",s);let a=H(r,"onCreate",o);a&&this.editor.on("create",a);let l=H(r,"onUpdate",o);l&&this.editor.on("update",l);let c=H(r,"onSelectionUpdate",o);c&&this.editor.on("selectionUpdate",c);let u=H(r,"onTransaction",o);u&&this.editor.on("transaction",u);let d=H(r,"onFocus",o);d&&this.editor.on("focus",d);let f=H(r,"onBlur",o);f&&this.editor.on("blur",f);let p=H(r,"onDestroy",o);p&&this.editor.on("destroy",p)})}static resolve(e){let n=Ln.sort(Ln.flatten(e)),r=H0(n.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{let r={name:n.name,options:n.options,storage:n.storage},i=H(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(e){return e.sort((r,i)=>{let o=H(r,"priority")||100,s=H(i,"priority")||100;return o>s?-1:o{let r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:vl(n.name,this.schema)},i=H(n,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){let{editor:e}=this,n=Ln.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(s=>{let a={name:s.name,options:s.options,storage:s.storage,editor:e,type:vl(s.name,this.schema)},l=[],c=H(s,"addKeyboardShortcuts",a),u={};if(s.type==="mark"&&s.config.exitable&&(u.ArrowRight=()=>be.handleExit({editor:e,mark:s})),c){let m=Object.fromEntries(Object.entries(c()).map(([g,y])=>[g,()=>y({editor:e})]));u={...u,...m}}let d=Hf(u);l.push(d);let f=H(s,"addInputRules",a);ep(s,e.options.enableInputRules)&&f&&r.push(...f());let p=H(s,"addPasteRules",a);ep(s,e.options.enablePasteRules)&&p&&i.push(...p());let h=H(s,"addProseMirrorPlugins",a);if(h){let m=h();l.push(...m)}return l}).flat();return[I0({editor:e,rules:r}),...B0({editor:e,rules:i}),...o]}get attributes(){return op(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:n}=$o(this.extensions);return Object.fromEntries(n.filter(r=>!!H(r,"addNodeView")).map(r=>{let i=this.attributes.filter(l=>l.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:e,type:We(r.name,this.schema)},s=H(r,"addNodeView",o);if(!s)return[];let a=(l,c,u,d)=>{let f=Nl(l,i);return s()({editor:e,node:l,getPos:u,decorations:d,HTMLAttributes:f,extension:r})};return[r.name,a]}))}};function F0(t){return Object.prototype.toString.call(t).slice(8,-1)}function xl(t){return F0(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function Ko(t,e){let n={...t};return xl(t)&&xl(e)&&Object.keys(e).forEach(r=>{xl(e[r])?r in t?n[r]=Ko(t[r],e[r]):Object.assign(n,{[r]:e[r]}):Object.assign(n,{[r]:e[r]})}),n}var Me=class{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ee(H(this,"addOptions",{name:this.name}))),this.storage=ee(H(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Me(e)}configure(e={}){let n=this.extend();return n.options=Ko(this.options,e),n.storage=ee(H(n,"addStorage",{name:n.name,options:n.options})),n}extend(e={}){let n=new Me(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=ee(H(n,"addOptions",{name:n.name})),n.storage=ee(H(n,"addStorage",{name:n.name,options:n.options})),n}};function ap(t,e,n){let{from:r,to:i}=e,{blockSeparator:o=` - -`,textSerializers:s={}}=n||{},a="",l=!0;return t.nodesBetween(r,i,(c,u,d,f)=>{var p;let h=s?.[c.type.name];h?(c.isBlock&&!l&&(a+=o,l=!0),d&&(a+=h({node:c,pos:u,parent:d,index:f,range:e}))):c.isText?(a+=(p=c?.text)===null||p===void 0?void 0:p.slice(Math.max(r,u)-u,i-u),l=!1):c.isBlock&&!l&&(a+=o,l=!0)}),a}function lp(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}var z0=Me.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new me({key:new ve("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{let{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(u=>u.$from.pos)),a=Math.max(...o.map(u=>u.$to.pos)),l=lp(n);return ap(r,{from:s,to:a},{textSerializers:l})}}})]}}),U0=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window?.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),$0=(t=!1)=>({commands:e})=>e.setContent("",t),K0=()=>({state:t,tr:e,dispatch:n})=>{let{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{t.doc.nodesBetween(o.pos,s.pos,(a,l)=>{if(a.type.isText)return;let{doc:c,mapping:u}=e,d=c.resolve(u.map(l)),f=c.resolve(u.map(l+a.nodeSize)),p=d.blockRange(f);if(!p)return;let h=hn(p);if(a.type.isTextblock){let{defaultType:m}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(p.start,m)}(h||h===0)&&e.lift(p,h)})}),!0},W0=t=>e=>t(e),V0=()=>({state:t,dispatch:e})=>ml(t,e),G0=()=>({tr:t,dispatch:e})=>{let{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;let i=t.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){let a=i.before(o),l=i.after(o);t.delete(a,l).scrollIntoView()}return!0}return!1},q0=t=>({tr:e,state:n,dispatch:r})=>{let i=We(t,n.schema),o=e.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){let l=o.before(s),c=o.after(s);e.delete(l,c).scrollIntoView()}return!0}return!1},j0=t=>({tr:e,dispatch:n})=>{let{from:r,to:i}=t;return n&&e.delete(r,i),!0},Y0=()=>({state:t,dispatch:e})=>Po(t,e),J0=()=>({commands:t})=>t.keyboardShortcut("Enter"),X0=()=>({state:t,dispatch:e})=>hl(t,e);function Ho(t,e,n={strict:!0}){let r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:Al(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function Cl(t,e,n={}){return t.find(r=>r.type===e&&Ho(r.attrs,n))}function Z0(t,e,n={}){return!!Cl(t,e,n)}function Rl(t,e,n={}){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if(t.parentOffset===r.offset&&r.offset!==0&&(r=t.parent.childBefore(t.parentOffset)),!r.node)return;let i=Cl([...r.node.marks],e,n);if(!i)return;let o=r.index,s=t.start()+r.offset,a=o+1,l=s+r.node.nodeSize;for(Cl([...r.node.marks],e,n);o>0&&i.isInSet(t.parent.child(o-1).marks);)o-=1,s-=t.parent.child(o).nodeSize;for(;a({tr:n,state:r,dispatch:i})=>{let o=Pn(t,r.schema),{doc:s,selection:a}=n,{$from:l,from:c,to:u}=a;if(i){let d=Rl(l,o,e);if(d&&d.from<=c&&d.to>=u){let f=$.create(s,d.from,d.to);n.setSelection(f)}}return!0},ew=t=>e=>{let n=typeof t=="function"?t(e):t;for(let r=0;r({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};let s=()=>{Il()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e?.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(o&&t===null&&!Wo(n.state.selection))return s(),!0;let a=cp(i.doc,t)||n.state.selection,l=n.state.selection.eq(a);return o&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},nw=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),rw=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e);function tp(t){let e=`${t}`;return new window.DOMParser().parseFromString(e,"text/html").body}function Fo(t,e,n){if(n={slice:!0,parseOptions:{},...n},typeof t=="object"&&t!==null)try{return Array.isArray(t)&&t.length>0?k.fromArray(t.map(r=>e.nodeFromJSON(r))):e.nodeFromJSON(t)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",r),Fo("",e,n)}if(typeof t=="string"){let r=Yt.fromSchema(e);return n.slice?r.parseSlice(tp(t),n.parseOptions).content:r.parse(tp(t),n.parseOptions)}return Fo("",e,n)}function iw(t,e,n){let r=t.steps.length-1;if(r{s===0&&(s=u)}),t.setSelection(V.near(t.doc.resolve(s),n))}var ow=t=>t.toString().startsWith("<"),sw=(t,e,n)=>({tr:r,dispatch:i,editor:o})=>{if(i){n={parseOptions:{},updateSelection:!0,...n};let s=Fo(e,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if(s.toString()==="<>")return!0;let{from:a,to:l}=typeof t=="number"?{from:t,to:t}:t,c=!0,u=!0;if((ow(s)?s:[s]).forEach(f=>{f.check(),c=c?f.isText&&f.marks.length===0:!1,u=u?f.isBlock:!1}),a===l&&u){let{parent:f}=r.doc.resolve(a);f.isTextblock&&!f.type.spec.code&&!f.childCount&&(a-=1,l+=1)}c?Array.isArray(e)?r.insertText(e.map(f=>f.text||"").join(""),a,l):typeof e=="object"&&e&&e.text?r.insertText(e.text,a,l):r.insertText(e,a,l):r.replaceWith(a,l,s),n.updateSelection&&iw(r,r.steps.length-1,-1)}return!0},aw=()=>({state:t,dispatch:e})=>$f(t,e),lw=()=>({state:t,dispatch:e})=>Kf(t,e),cw=()=>({state:t,dispatch:e})=>ll(t,e),uw=()=>({state:t,dispatch:e})=>ul(t,e);function up(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function dw(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let a=0;a({editor:e,view:n,tr:r,dispatch:i})=>{let o=dw(t).split(/-(?!$)/),s=o.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,a))});return l?.steps.forEach(c=>{let u=c.map(r.mapping);u&&i&&r.maybeStep(u)}),!0};function Li(t,e,n={}){let{from:r,to:i,empty:o}=t.selection,s=e?We(e,t.schema):null,a=[];t.doc.nodesBetween(r,i,(d,f)=>{if(d.isText)return;let p=Math.max(r,f),h=Math.min(i,f+d.nodeSize);a.push({node:d,from:p,to:h})});let l=i-r,c=a.filter(d=>s?s.name===d.node.type.name:!0).filter(d=>Ho(d.node.attrs,n,{strict:!1}));return o?!!c.length:c.reduce((d,f)=>d+f.to-f.from,0)>=l}var pw=(t,e={})=>({state:n,dispatch:r})=>{let i=We(t,n.schema);return Li(n,i,e)?Wf(n,r):!1},hw=()=>({state:t,dispatch:e})=>gl(t,e),mw=t=>({state:e,dispatch:n})=>{let r=We(t,e.schema);return Jf(r)(e,n)},gw=()=>({state:t,dispatch:e})=>fl(t,e);function Vo(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function np(t,e){let n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}var bw=(t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,a=Vo(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(o=We(t,r.schema)),a==="mark"&&(s=Pn(t,r.schema)),i&&n.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(c,u)=>{o&&o===c.type&&n.setNodeMarkup(u,void 0,np(c.attrs,e)),s&&c.marks.length&&c.marks.forEach(d=>{s===d.type&&n.addMark(u,u+c.nodeSize,s.create(np(d.attrs,e)))})})}),!0):!1},yw=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),Ew=()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),ww=()=>({state:t,dispatch:e})=>cl(t,e),vw=()=>({state:t,dispatch:e})=>dl(t,e),Sw=()=>({state:t,dispatch:e})=>Vf(t,e),xw=()=>({state:t,dispatch:e})=>yl(t,e),kw=()=>({state:t,dispatch:e})=>bl(t,e);function dp(t,e,n={}){return Fo(t,e,{slice:!1,parseOptions:n})}var Mw=(t,e=!1,n={})=>({tr:r,editor:i,dispatch:o})=>{let{doc:s}=r,a=dp(t,i.schema,n);return o&&r.replaceWith(0,s.content.size,a).setMeta("preventUpdate",!e),!0};function fp(t,e){let n=new Cn(t);return e.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function Dl(t){for(let e=0;e{e(r)&&n.push({node:r,pos:i})}),n}function pp(t,e,n){let r=[];return t.nodesBetween(e.from,e.to,(i,o)=>{n(i)&&r.push({node:i,pos:o})}),r}function Ll(t,e){for(let n=t.depth;n>0;n-=1){let r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function fr(t){return e=>Ll(e.$from,t)}function Tw(t,e){let n=ht.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function Nw(t,e){let n={from:0,to:t.content.size};return ap(t,n,e)}function Bn(t,e){let n=Pn(e,t.schema),{from:r,to:i,empty:o}=t.selection,s=[];o?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,l=>{s.push(...l.marks)});let a=s.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function _w(t,e){let n=We(e,t.schema),{from:r,to:i}=t.selection,o=[];t.doc.nodesBetween(r,i,a=>{o.push(a)});let s=o.reverse().find(a=>a.type.name===n.name);return s?{...s.attrs}:{}}function Pl(t,e){let n=Vo(typeof e=="string"?e:e.name,t.schema);return n==="node"?_w(t,e):n==="mark"?Bn(t,e):{}}function Cw(t,e=JSON.stringify){let n={};return t.filter(r=>{let i=e(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function Ow(t){let e=Cw(t);return e.length===1?e:e.filter((n,r)=>!e.filter((o,s)=>s!==r).some(o=>n.oldRange.from>=o.oldRange.from&&n.oldRange.to<=o.oldRange.to&&n.newRange.from>=o.newRange.from&&n.newRange.to<=o.newRange.to))}function hp(t){let{mapping:e,steps:n}=t,r=[];return e.maps.forEach((i,o)=>{let s=[];if(i.ranges.length)i.forEach((a,l)=>{s.push({from:a,to:l})});else{let{from:a,to:l}=n[o];if(a===void 0||l===void 0)return;s.push({from:a,to:l})}s.forEach(({from:a,to:l})=>{let c=e.slice(o).map(a,-1),u=e.slice(o).map(l),d=e.invert().map(c,-1),f=e.invert().map(u);r.push({oldRange:{from:d,to:f},newRange:{from:c,to:u}})})}),Ow(r)}function Pi(t,e,n){let r=[];return t===e?n.resolve(t).marks().forEach(i=>{let o=n.resolve(t-1),s=Rl(o,i.type);s&&r.push({mark:i,...s})}):n.nodesBetween(t,e,(i,o)=>{r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}function Bo(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{let i=t.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function Ol(t,e,n={}){let{empty:r,ranges:i}=t.selection,o=e?Pn(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(d=>o?o.name===d.type.name:!0).find(d=>Ho(d.attrs,n,{strict:!1}));let s=0,a=[];if(i.forEach(({$from:d,$to:f})=>{let p=d.pos,h=f.pos;t.doc.nodesBetween(p,h,(m,g)=>{if(!m.isText&&!m.marks.length)return;let y=Math.max(p,g),S=Math.min(h,g+m.nodeSize),M=S-y;s+=M,a.push(...m.marks.map(b=>({mark:b,from:y,to:S})))})}),s===0)return!1;let l=a.filter(d=>o?o.name===d.mark.type.name:!0).filter(d=>Ho(d.mark.attrs,n,{strict:!1})).reduce((d,f)=>d+f.to-f.from,0),c=a.filter(d=>o?d.mark.type!==o&&d.mark.type.excludes(o):!0).reduce((d,f)=>d+f.to-f.from,0);return(l>0?l+c:l)>=s}function $t(t,e,n={}){if(!e)return Li(t,null,n)||Ol(t,null,n);let r=Vo(e,t.schema);return r==="node"?Li(t,e,n):r==="mark"?Ol(t,e,n):!1}function rp(t,e){let{nodeExtensions:n}=$o(e),r=n.find(s=>s.name===t);if(!r)return!1;let i={name:r.name,options:r.options,storage:r.storage},o=ee(H(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function Aw(t){var e;let n=(e=t.type.createAndFill())===null||e===void 0?void 0:e.toJSON(),r=t.toJSON();return JSON.stringify(n)===JSON.stringify(r)}function mp(t){return t instanceof G}function Go(t,e,n){let i=t.state.doc.content.size,o=vn(e,0,i),s=vn(n,0,i),a=t.coordsAtPos(o),l=t.coordsAtPos(s,-1),c=Math.min(a.top,l.top),u=Math.max(a.bottom,l.bottom),d=Math.min(a.left,l.left),f=Math.max(a.right,l.right),p=f-d,h=u-c,y={top:c,bottom:u,left:d,right:f,width:p,height:h,x:d,y:c};return{...y,toJSON:()=>y}}function Rw(t,e,n){var r;let{selection:i}=e,o=null;if(Wo(i)&&(o=i.$cursor),o){let a=(r=t.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(a)||!a.some(l=>l.type.excludes(n))}let{ranges:s}=i;return s.some(({$from:a,$to:l})=>{let c=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(u,d,f)=>{if(c)return!1;if(u.isInline){let p=!f||f.type.allowsMarkType(n),h=!!n.isInSet(u.marks)||!u.marks.some(m=>m.type.excludes(n));c=p&&h}return!c}),c})}var Iw=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let{selection:o}=n,{empty:s,ranges:a}=o,l=Pn(t,r.schema);if(i)if(s){let c=Bn(r,l);n.addStoredMark(l.create({...c,...e}))}else a.forEach(c=>{let u=c.$from.pos,d=c.$to.pos;r.doc.nodesBetween(u,d,(f,p)=>{let h=Math.max(p,u),m=Math.min(p+f.nodeSize,d);f.marks.find(y=>y.type===l)?f.marks.forEach(y=>{l===y.type&&n.addMark(h,m,l.create({...y.attrs,...e}))}):n.addMark(h,m,l.create(e))})});return Rw(r,n,l)},Dw=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),Lw=(t,e={})=>({state:n,dispatch:r,chain:i})=>{let o=We(t,n.schema);return o.isTextblock?i().command(({commands:s})=>El(o,e)(n)?!0:s.clearNodes()).command(({state:s})=>El(o,e)(s,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},Pw=t=>({tr:e,dispatch:n})=>{if(n){let{doc:r}=e,i=vn(t,0,r.content.size),o=G.create(r,i);e.setSelection(o)}return!0},Bw=t=>({tr:e,dispatch:n})=>{if(n){let{doc:r}=e,{from:i,to:o}=typeof t=="number"?{from:t,to:t}:t,s=$.atStart(r).from,a=$.atEnd(r).to,l=vn(i,s,a),c=vn(o,s,a),u=$.create(r,l,c);e.setSelection(u)}return!0},Hw=t=>({state:e,dispatch:n})=>{let r=We(t,e.schema);return Xf(r)(e,n)};function ip(t,e){let n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){let r=n.filter(i=>e?.includes(i.type.name));t.tr.ensureMarks(r)}}var Fw=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{let{selection:o,doc:s}=e,{$from:a,$to:l}=o,c=i.extensionManager.attributes,u=Bo(c,a.node().type.name,a.node().attrs);if(o instanceof G&&o.node.isBlock)return!a.parentOffset||!Nt(s,a.pos)?!1:(r&&(t&&ip(n,i.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(r){let d=l.parentOffset===l.parent.content.size;o instanceof $&&e.deleteSelection();let f=a.depth===0?void 0:Dl(a.node(-1).contentMatchAt(a.indexAfter(-1))),p=d&&f?[{type:f,attrs:u}]:void 0,h=Nt(e.doc,e.mapping.map(a.pos),1,p);if(!p&&!h&&Nt(e.doc,e.mapping.map(a.pos),1,f?[{type:f}]:void 0)&&(h=!0,p=f?[{type:f,attrs:u}]:void 0),h&&(e.split(e.mapping.map(a.pos),1,p),f&&!d&&!a.parentOffset&&a.parent.type!==f)){let m=e.mapping.map(a.before()),g=e.doc.resolve(m);a.node(-1).canReplaceWith(g.index(),g.index()+1,f)&&e.setNodeMarkup(e.mapping.map(a.before()),f)}t&&ip(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},zw=t=>({tr:e,state:n,dispatch:r,editor:i})=>{var o;let s=We(t,n.schema),{$from:a,$to:l}=n.selection,c=n.selection.node;if(c&&c.isBlock||a.depth<2||!a.sameParent(l))return!1;let u=a.node(-1);if(u.type!==s)return!1;let d=i.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let g=k.empty,y=a.index(-1)?1:a.index(-2)?2:3;for(let D=a.depth-y;D>=a.depth-3;D-=1)g=k.from(a.node(D).copy(g));let S=a.indexAfter(-1){if(w>-1)return!1;D.isTextblock&&D.content.size===0&&(w=K+1)}),w>-1&&e.setSelection($.near(e.doc.resolve(w))),e.scrollIntoView()}return!0}let f=l.pos===a.end()?u.contentMatchAt(0).defaultType:null,p=Bo(d,u.type.name,u.attrs),h=Bo(d,a.node().type.name,a.node().attrs);e.delete(a.pos,l.pos);let m=f?[{type:s,attrs:p},{type:f,attrs:h}]:[{type:s,attrs:p}];if(!Nt(e.doc,a.pos,2))return!1;if(r){let{selection:g,storedMarks:y}=n,{splittableMarks:S}=i.extensionManager,M=y||g.$to.parentOffset&&g.$from.marks();if(e.split(a.pos,2,m).scrollIntoView(),!M||!r)return!0;let b=M.filter(_=>S.includes(_.type.name));e.ensureMarks(b)}return!0},kl=(t,e)=>{let n=fr(s=>s.type===e)(t.selection);if(!n)return!0;let r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let i=t.doc.nodeAt(r);return n.node.type===i?.type&&Ft(t.doc,n.pos)&&t.join(n.pos),!0},Ml=(t,e)=>{let n=fr(s=>s.type===e)(t.selection);if(!n)return!0;let r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let i=t.doc.nodeAt(r);return n.node.type===i?.type&&Ft(t.doc,r)&&t.join(r),!0},Uw=(t,e,n,r={})=>({editor:i,tr:o,state:s,dispatch:a,chain:l,commands:c,can:u})=>{let{extensions:d,splittableMarks:f}=i.extensionManager,p=We(t,s.schema),h=We(e,s.schema),{selection:m,storedMarks:g}=s,{$from:y,$to:S}=m,M=y.blockRange(S),b=g||m.$to.parentOffset&&m.$from.marks();if(!M)return!1;let _=fr(w=>rp(w.type.name,d))(m);if(M.depth>=1&&_&&M.depth-_.depth<=1){if(_.node.type===p)return c.liftListItem(h);if(rp(_.node.type.name,d)&&p.validContent(_.node.content)&&a)return l().command(()=>(o.setNodeMarkup(_.pos,p),!0)).command(()=>kl(o,p)).command(()=>Ml(o,p)).run()}return!n||!b||!a?l().command(()=>u().wrapInList(p,r)?!0:c.clearNodes()).wrapInList(p,r).command(()=>kl(o,p)).command(()=>Ml(o,p)).run():l().command(()=>{let w=u().wrapInList(p,r),D=b.filter(K=>f.includes(K.type.name));return o.ensureMarks(D),w?!0:c.clearNodes()}).wrapInList(p,r).command(()=>kl(o,p)).command(()=>Ml(o,p)).run()},$w=(t,e={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:o=!1}=n,s=Pn(t,r.schema);return Ol(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},Kw=(t,e,n={})=>({state:r,commands:i})=>{let o=We(t,r.schema),s=We(e,r.schema);return Li(r,o,n)?i.setNode(s):i.setNode(o,n)},Ww=(t,e={})=>({state:n,commands:r})=>{let i=We(t,n.schema);return Li(n,i,e)?r.lift(i):r.wrapIn(i,e)},Vw=()=>({state:t,dispatch:e})=>{let n=t.plugins;for(let r=0;r=0;l-=1)s.step(a.steps[l].invert(a.docs[l]));if(o.text){let l=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,t.schema.text(o.text,l))}else s.delete(o.from,o.to)}return!0}}return!1},Gw=()=>({tr:t,dispatch:e})=>{let{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(o=>{t.removeMark(o.$from.pos,o.$to.pos)}),!0},qw=(t,e={})=>({tr:n,state:r,dispatch:i})=>{var o;let{extendEmptyMarkRange:s=!1}=e,{selection:a}=n,l=Pn(t,r.schema),{$from:c,empty:u,ranges:d}=a;if(!i)return!0;if(u&&s){let{from:f,to:p}=a,h=(o=c.marks().find(g=>g.type===l))===null||o===void 0?void 0:o.attrs,m=Rl(c,l,h);m&&(f=m.from,p=m.to),n.removeMark(f,p,l)}else d.forEach(f=>{n.removeMark(f.$from.pos,f.$to.pos,l)});return n.removeStoredMark(l),!0},jw=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,a=Vo(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(o=We(t,r.schema)),a==="mark"&&(s=Pn(t,r.schema)),i&&n.selection.ranges.forEach(l=>{let c=l.$from.pos,u=l.$to.pos;r.doc.nodesBetween(c,u,(d,f)=>{o&&o===d.type&&n.setNodeMarkup(f,void 0,{...d.attrs,...e}),s&&d.marks.length&&d.marks.forEach(p=>{if(s===p.type){let h=Math.max(f,c),m=Math.min(f+d.nodeSize,u);n.addMark(h,m,s.create({...p.attrs,...e}))}})})}),!0):!1},Yw=(t,e={})=>({state:n,dispatch:r})=>{let i=We(t,n.schema);return jf(i,e)(n,r)},Jw=(t,e={})=>({state:n,dispatch:r})=>{let i=We(t,n.schema);return Yf(i,e)(n,r)},Xw=Object.freeze({__proto__:null,blur:U0,clearContent:$0,clearNodes:K0,command:W0,createParagraphNear:V0,deleteCurrentNode:G0,deleteNode:q0,deleteRange:j0,deleteSelection:Y0,enter:J0,exitCode:X0,extendMarkRange:Q0,first:ew,focus:tw,forEach:nw,insertContent:rw,insertContentAt:sw,joinUp:aw,joinDown:lw,joinBackward:cw,joinForward:uw,keyboardShortcut:fw,lift:pw,liftEmptyBlock:hw,liftListItem:mw,newlineInCode:gw,resetAttributes:bw,scrollIntoView:yw,selectAll:Ew,selectNodeBackward:ww,selectNodeForward:vw,selectParentNode:Sw,selectTextblockEnd:xw,selectTextblockStart:kw,setContent:Mw,setMark:Iw,setMeta:Dw,setNode:Lw,setNodeSelection:Pw,setTextSelection:Bw,sinkListItem:Hw,splitBlock:Fw,splitListItem:zw,toggleList:Uw,toggleMark:$w,toggleNode:Kw,toggleWrap:Ww,undoInputRule:Vw,unsetAllMarks:Gw,unsetMark:qw,updateAttributes:jw,wrapIn:Yw,wrapInList:Jw}),Zw=Me.create({name:"commands",addCommands(){return{...Xw}}}),Qw=Me.create({name:"editable",addProseMirrorPlugins(){return[new me({key:new ve("editable"),props:{editable:()=>this.editor.options.editable}})]}}),ev=Me.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:t}=this;return[new me({key:new ve("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;let r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;let r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),tv=Me.create({name:"keymap",addKeyboardShortcuts(){let t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{let{selection:l,doc:c}=a,{empty:u,$anchor:d}=l,{pos:f,parent:p}=d,h=V.atStart(c).from===f;return!u||!h||!p.type.isTextblock||p.textContent.length?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Il()||up()?o:i},addProseMirrorPlugins(){return[new me({key:new ve("clearDocument"),appendTransaction:(t,e,n)=>{if(!(t.some(h=>h.docChanged)&&!e.doc.eq(n.doc)))return;let{empty:i,from:o,to:s}=e.selection,a=V.atStart(e.doc).from,l=V.atEnd(e.doc).to;if(i||!(o===a&&s===l)||!(n.doc.textBetween(0,n.doc.content.size," "," ").length===0))return;let d=n.tr,f=Uo({state:n,transaction:d}),{commands:p}=new jr({editor:this.editor,state:f});if(p.clearNodes(),!!d.steps.length)return d}})]}}),nv=Me.create({name:"tabindex",addProseMirrorPlugins(){return[new me({key:new ve("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}}),rv=Object.freeze({__proto__:null,ClipboardTextSerializer:z0,Commands:Zw,Editable:Qw,FocusEvents:ev,Keymap:tv,Tabindex:nv}),iv=`.ProseMirror { +var Jb=Object.create;var sa=Object.defineProperty;var Xb=Object.getOwnPropertyDescriptor;var Zb=Object.getOwnPropertyNames;var Qb=Object.getPrototypeOf,ey=Object.prototype.hasOwnProperty;var ty=(t,e,n)=>e in t?sa(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var zu=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var ny=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Zb(e))!ey.call(t,i)&&i!==n&&sa(t,i,{get:()=>e[i],enumerable:!(r=Xb(e,i))||r.enumerable});return t};var $u=(t,e,n)=>(n=t!=null?Jb(Qb(t)):{},ny(e||!t||!t.__esModule?sa(n,"default",{value:t,enumerable:!0}):n,t));var ot=(t,e,n)=>(ty(t,typeof e!="symbol"?e+"":e,n),n);var Ob=zu((bL,Cb)=>{function bb(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(e=>{let n=t[e],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&bb(n)}),t}var Vs=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function yb(t){return t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function In(t,...e){let n=Object.create(null);for(let r in t)n[r]=t[r];return e.forEach(function(r){for(let i in r)n[i]=r[i]}),n}var kM="",db=t=>!!t.scope,MM=(t,{prefix:e})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){let n=t.split(".");return[`${e}${n.shift()}`,...n.map((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${e}${t}`},Mu=class{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=yb(e)}openNode(e){if(!db(e))return;let n=MM(e.scope,{prefix:this.classPrefix});this.span(n)}closeNode(e){db(e)&&(this.buffer+=kM)}value(){return this.buffer}span(e){this.buffer+=``}},fb=(t={})=>{let e={children:[]};return Object.assign(e,t),e},Nu=class t{constructor(){this.rootNode=fb(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let n=fb({scope:e});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return typeof n=="string"?e.addText(n):n.children&&(e.openNode(n),n.children.forEach(r=>this._walk(e,r)),e.closeNode(n)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(n=>typeof n=="string")?e.children=[e.children.join("")]:e.children.forEach(n=>{t._collapse(n)}))}},Tu=class extends Nu{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,n){let r=e.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new Mu(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function Gi(t){return t?typeof t=="string"?t:t.source:null}function Eb(t){return Er("(?=",t,")")}function NM(t){return Er("(?:",t,")*")}function TM(t){return Er("(?:",t,")?")}function Er(...t){return t.map(n=>Gi(n)).join("")}function _M(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function Cu(...t){return"("+(_M(t).capture?"":"?:")+t.map(r=>Gi(r)).join("|")+")"}function wb(t){return new RegExp(t.toString()+"|").exec("").length-1}function CM(t,e){let n=t&&t.exec(e);return n&&n.index===0}var OM=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Ou(t,{joinWith:e}){let n=0;return t.map(r=>{n+=1;let i=n,o=Gi(r),s="";for(;o.length>0;){let a=OM.exec(o);if(!a){s+=o;break}s+=o.substring(0,a.index),o=o.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?s+="\\"+String(Number(a[1])+i):(s+=a[0],a[0]==="("&&n++)}return s}).map(r=>`(${r})`).join(e)}var AM=/\b\B/,vb="[a-zA-Z]\\w*",Au="[a-zA-Z_]\\w*",Sb="\\b\\d+(\\.\\d+)?",xb="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",kb="\\b(0b[01]+)",RM="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",IM=(t={})=>{let e=/^#![ ]*\//;return t.binary&&(t.begin=Er(e,/.*\b/,t.binary,/\b.*/)),In({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},t)},qi={begin:"\\\\[\\s\\S]",relevance:0},DM={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[qi]},LM={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[qi]},PM={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},qs=function(t,e,n={}){let r=In({scope:"comment",begin:t,end:e,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=Cu("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:Er(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},BM=qs("//","$"),FM=qs("/\\*","\\*/"),HM=qs("#","$"),zM={scope:"number",begin:Sb,relevance:0},$M={scope:"number",begin:xb,relevance:0},UM={scope:"number",begin:kb,relevance:0},KM={begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[qi,{begin:/\[/,end:/\]/,relevance:0,contains:[qi]}]}]},WM={scope:"title",begin:vb,relevance:0},VM={scope:"title",begin:Au,relevance:0},GM={begin:"\\.\\s*"+Au,relevance:0},qM=function(t){return Object.assign(t,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})},Ws=Object.freeze({__proto__:null,MATCH_NOTHING_RE:AM,IDENT_RE:vb,UNDERSCORE_IDENT_RE:Au,NUMBER_RE:Sb,C_NUMBER_RE:xb,BINARY_NUMBER_RE:kb,RE_STARTERS_RE:RM,SHEBANG:IM,BACKSLASH_ESCAPE:qi,APOS_STRING_MODE:DM,QUOTE_STRING_MODE:LM,PHRASAL_WORDS_MODE:PM,COMMENT:qs,C_LINE_COMMENT_MODE:BM,C_BLOCK_COMMENT_MODE:FM,HASH_COMMENT_MODE:HM,NUMBER_MODE:zM,C_NUMBER_MODE:$M,BINARY_NUMBER_MODE:UM,REGEXP_MODE:KM,TITLE_MODE:WM,UNDERSCORE_TITLE_MODE:VM,METHOD_GUARD:GM,END_SAME_AS_BEGIN:qM});function jM(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function YM(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className)}function JM(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=jM,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function XM(t,e){Array.isArray(t.illegal)&&(t.illegal=Cu(...t.illegal))}function ZM(t,e){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function QM(t,e){t.relevance===void 0&&(t.relevance=1)}var eN=(t,e)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");let n=Object.assign({},t);Object.keys(t).forEach(r=>{delete t[r]}),t.keywords=n.keywords,t.begin=Er(n.beforeMatch,Eb(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},tN=["of","and","for","in","not","or","if","then","parent","list","value"],nN="keyword";function Mb(t,e,n=nN){let r=Object.create(null);return typeof t=="string"?i(n,t.split(" ")):Array.isArray(t)?i(n,t):Object.keys(t).forEach(function(o){Object.assign(r,Mb(t[o],e,o))}),r;function i(o,s){e&&(s=s.map(a=>a.toLowerCase())),s.forEach(function(a){let l=a.split("|");r[l[0]]=[o,rN(l[0],l[1])]})}}function rN(t,e){return e?Number(e):iN(t)?0:1}function iN(t){return tN.includes(t.toLowerCase())}var pb={},yr=t=>{console.error(t)},hb=(t,...e)=>{console.log(`WARN: ${t}`,...e)},ti=(t,e)=>{pb[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),pb[`${t}/${e}`]=!0)},Gs=new Error;function Nb(t,e,{key:n}){let r=0,i=t[n],o={},s={};for(let a=1;a<=e.length;a++)s[a+r]=i[a],o[a+r]=!0,r+=wb(e[a-1]);t[n]=s,t[n]._emit=o,t[n]._multi=!0}function oN(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw yr("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Gs;if(typeof t.beginScope!="object"||t.beginScope===null)throw yr("beginScope must be object"),Gs;Nb(t,t.begin,{key:"beginScope"}),t.begin=Ou(t.begin,{joinWith:""})}}function sN(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw yr("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Gs;if(typeof t.endScope!="object"||t.endScope===null)throw yr("endScope must be object"),Gs;Nb(t,t.end,{key:"endScope"}),t.end=Ou(t.end,{joinWith:""})}}function aN(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function lN(t){aN(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),oN(t),sN(t)}function cN(t){function e(s,a){return new RegExp(Gi(s),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(a?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(a,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,a]),this.matchAt+=wb(a)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let a=this.regexes.map(l=>l[1]);this.matcherRe=e(Ou(a,{joinWith:"|"}),!0),this.lastIndex=0}exec(a){this.matcherRe.lastIndex=this.lastIndex;let l=this.matcherRe.exec(a);if(!l)return null;let c=l.findIndex((d,f)=>f>0&&d!==void 0),u=this.matchIndexes[c];return l.splice(0,c),Object.assign(l,u)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(a){if(this.multiRegexes[a])return this.multiRegexes[a];let l=new n;return this.rules.slice(a).forEach(([c,u])=>l.addRule(c,u)),l.compile(),this.multiRegexes[a]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(a,l){this.rules.push([a,l]),l.type==="begin"&&this.count++}exec(a){let l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let c=l.exec(a);if(this.resumingScanAtSamePosition()&&!(c&&c.index===this.lastIndex)){let u=this.getMatcher(0);u.lastIndex=this.lastIndex+1,c=u.exec(a)}return c&&(this.regexIndex+=c.position+1,this.regexIndex===this.count&&this.considerAll()),c}}function i(s){let a=new r;return s.contains.forEach(l=>a.addRule(l.begin,{rule:l,type:"begin"})),s.terminatorEnd&&a.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&a.addRule(s.illegal,{type:"illegal"}),a}function o(s,a){let l=s;if(s.isCompiled)return l;[YM,ZM,lN,eN].forEach(u=>u(s,a)),t.compilerExtensions.forEach(u=>u(s,a)),s.__beforeBegin=null,[JM,XM,QM].forEach(u=>u(s,a)),s.isCompiled=!0;let c=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),c=s.keywords.$pattern,delete s.keywords.$pattern),c=c||/\w+/,s.keywords&&(s.keywords=Mb(s.keywords,t.case_insensitive)),l.keywordPatternRe=e(c,!0),a&&(s.begin||(s.begin=/\B|\b/),l.beginRe=e(l.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(l.endRe=e(l.end)),l.terminatorEnd=Gi(l.end)||"",s.endsWithParent&&a.terminatorEnd&&(l.terminatorEnd+=(s.end?"|":"")+a.terminatorEnd)),s.illegal&&(l.illegalRe=e(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(u){return uN(u==="self"?s:u)})),s.contains.forEach(function(u){o(u,l)}),s.starts&&o(s.starts,a),l.matcher=i(l),l}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=In(t.classNameAliases||{}),o(t)}function Tb(t){return t?t.endsWithParent||Tb(t.starts):!1}function uN(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return In(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:Tb(t)?In(t,{starts:t.starts?In(t.starts):null}):Object.isFrozen(t)?In(t):t}var dN="11.8.0",_u=class extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}},ku=yb,mb=In,gb=Symbol("nomatch"),fN=7,_b=function(t){let e=Object.create(null),n=Object.create(null),r=[],i=!0,o="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]},a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Tu};function l(E){return a.noHighlightRe.test(E)}function c(E){let v=E.className+" ";v+=E.parentNode?E.parentNode.className:"";let C=a.languageDetectRe.exec(v);if(C){let P=O(C[1]);return P||(hb(o.replace("{}",C[1])),hb("Falling back to no-highlight mode for this block.",E)),P?C[1]:"no-highlight"}return v.split(/\s+/).find(P=>l(P)||O(P))}function u(E,v,C){let P="",j="";typeof v=="object"?(P=E,C=v.ignoreIllegals,j=v.language):(ti("10.7.0","highlight(lang, code, ...args) has been deprecated."),ti("10.7.0",`Please use highlight(code, options) instead. +https://github.com/highlightjs/highlight.js/issues/2277`),j=E,P=v),C===void 0&&(C=!0);let Q={code:P,language:j};ce("before:highlight",Q);let pe=Q.result?Q.result:d(Q.language,Q.code,C);return pe.code=Q.code,ce("after:highlight",pe),pe}function d(E,v,C,P){let j=Object.create(null);function Q(k,A){return k.keywords[A]}function pe(){if(!H.keywords){ye.addText(ae);return}let k=0;H.keywordPatternRe.lastIndex=0;let A=H.keywordPatternRe.exec(ae),G="";for(;A;){G+=ae.substring(k,A.index);let oe=Ae.case_insensitive?A[0].toLowerCase():A[0],Re=Q(H,oe);if(Re){let[Et,ra]=Re;if(ye.addText(G),G="",j[oe]=(j[oe]||0)+1,j[oe]<=fN&&(Je+=ra),Et.startsWith("_"))G+=A[0];else{let S=Ae.classNameAliases[Et]||Et;xe(A[0],S)}}else G+=A[0];k=H.keywordPatternRe.lastIndex,A=H.keywordPatternRe.exec(ae)}G+=ae.substring(k),ye.addText(G)}function be(){if(ae==="")return;let k=null;if(typeof H.subLanguage=="string"){if(!e[H.subLanguage]){ye.addText(ae);return}k=d(H.subLanguage,ae,!0,le[H.subLanguage]),le[H.subLanguage]=k._top}else k=p(ae,H.subLanguage.length?H.subLanguage:null);H.relevance>0&&(Je+=k.relevance),ye.__addSublanguage(k._emitter,k.language)}function ue(){H.subLanguage!=null?be():pe(),ae=""}function xe(k,A){k!==""&&(ye.startScope(A),ye.addText(k),ye.endScope())}function ft(k,A){let G=1,oe=A.length-1;for(;G<=oe;){if(!k._emit[G]){G++;continue}let Re=Ae.classNameAliases[k[G]]||k[G],Et=A[G];Re?xe(Et,Re):(ae=Et,pe(),ae=""),G++}}function Ye(k,A){return k.scope&&typeof k.scope=="string"&&ye.openNode(Ae.classNameAliases[k.scope]||k.scope),k.beginScope&&(k.beginScope._wrap?(xe(ae,Ae.classNameAliases[k.beginScope._wrap]||k.beginScope._wrap),ae=""):k.beginScope._multi&&(ft(k.beginScope,A),ae="")),H=Object.create(k,{parent:{value:H}}),H}function de(k,A,G){let oe=CM(k.endRe,G);if(oe){if(k["on:end"]){let Re=new Vs(k);k["on:end"](A,Re),Re.isMatchIgnored&&(oe=!1)}if(oe){for(;k.endsParent&&k.parent;)k=k.parent;return k}}if(k.endsWithParent)return de(k.parent,A,G)}function rt(k){return H.matcher.regexIndex===0?(ae+=k[0],1):(z=!0,0)}function bt(k){let A=k[0],G=k.rule,oe=new Vs(G),Re=[G.__beforeBegin,G["on:begin"]];for(let Et of Re)if(Et&&(Et(k,oe),oe.isMatchIgnored))return rt(A);return G.skip?ae+=A:(G.excludeBegin&&(ae+=A),ue(),!G.returnBegin&&!G.excludeBegin&&(ae=A)),Ye(G,k),G.returnBegin?0:A.length}function yt(k){let A=k[0],G=v.substring(k.index),oe=de(H,k,G);if(!oe)return gb;let Re=H;H.endScope&&H.endScope._wrap?(ue(),xe(A,H.endScope._wrap)):H.endScope&&H.endScope._multi?(ue(),ft(H.endScope,k)):Re.skip?ae+=A:(Re.returnEnd||Re.excludeEnd||(ae+=A),ue(),Re.excludeEnd&&(ae=A));do H.scope&&ye.closeNode(),!H.skip&&!H.subLanguage&&(Je+=H.relevance),H=H.parent;while(H!==oe.parent);return oe.starts&&Ye(oe.starts,k),Re.returnEnd?0:A.length}function Kt(){let k=[];for(let A=H;A!==Ae;A=A.parent)A.scope&&k.unshift(A.scope);k.forEach(A=>ye.openNode(A))}let He={};function en(k,A){let G=A&&A[0];if(ae+=k,G==null)return ue(),0;if(He.type==="begin"&&A.type==="end"&&He.index===A.index&&G===""){if(ae+=v.slice(A.index,A.index+1),!i){let oe=new Error(`0 width match regex (${E})`);throw oe.languageName=E,oe.badRule=He.rule,oe}return 1}if(He=A,A.type==="begin")return bt(A);if(A.type==="illegal"&&!C){let oe=new Error('Illegal lexeme "'+G+'" for mode "'+(H.scope||"")+'"');throw oe.mode=H,oe}else if(A.type==="end"){let oe=yt(A);if(oe!==gb)return oe}if(A.type==="illegal"&&G==="")return 1;if(L>1e5&&L>A.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ae+=G,G.length}let Ae=O(E);if(!Ae)throw yr(o.replace("{}",E)),new Error('Unknown language: "'+E+'"');let X=cN(Ae),Rt="",H=P||X,le={},ye=new a.__emitter(a);Kt();let ae="",Je=0,Ve=0,L=0,z=!1;try{if(Ae.__emitTokens)Ae.__emitTokens(v,ye);else{for(H.matcher.considerAll();;){L++,z?z=!1:H.matcher.considerAll(),H.matcher.lastIndex=Ve;let k=H.matcher.exec(v);if(!k)break;let A=v.substring(Ve,k.index),G=en(A,k);Ve=k.index+G}en(v.substring(Ve))}return ye.finalize(),Rt=ye.toHTML(),{language:E,value:Rt,relevance:Je,illegal:!1,_emitter:ye,_top:H}}catch(k){if(k.message&&k.message.includes("Illegal"))return{language:E,value:ku(v),illegal:!0,relevance:0,_illegalBy:{message:k.message,index:Ve,context:v.slice(Ve-100,Ve+100),mode:k.mode,resultSoFar:Rt},_emitter:ye};if(i)return{language:E,value:ku(v),illegal:!1,relevance:0,errorRaised:k,_emitter:ye,_top:H};throw k}}function f(E){let v={value:ku(E),illegal:!1,relevance:0,_top:s,_emitter:new a.__emitter(a)};return v._emitter.addText(E),v}function p(E,v){v=v||a.languages||Object.keys(e);let C=f(E),P=v.filter(O).filter(ne).map(ue=>d(ue,E,!1));P.unshift(C);let j=P.sort((ue,xe)=>{if(ue.relevance!==xe.relevance)return xe.relevance-ue.relevance;if(ue.language&&xe.language){if(O(ue.language).supersetOf===xe.language)return 1;if(O(xe.language).supersetOf===ue.language)return-1}return 0}),[Q,pe]=j,be=Q;return be.secondBest=pe,be}function h(E,v,C){let P=v&&n[v]||C;E.classList.add("hljs"),E.classList.add(`language-${P}`)}function g(E){let v=null,C=c(E);if(l(C))return;if(ce("before:highlightElement",{el:E,language:C}),E.children.length>0&&(a.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(E)),a.throwUnescapedHTML))throw new _u("One of your code blocks includes unescaped HTML.",E.innerHTML);v=E;let P=v.textContent,j=C?u(P,{language:C,ignoreIllegals:!0}):p(P);E.innerHTML=j.value,h(E,C,j.language),E.result={language:j.language,re:j.relevance,relevance:j.relevance},j.secondBest&&(E.secondBest={language:j.secondBest.language,relevance:j.secondBest.relevance}),ce("after:highlightElement",{el:E,result:j,text:P})}function m(E){a=mb(a,E)}let y=()=>{b(),ti("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function M(){b(),ti("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let x=!1;function b(){if(document.readyState==="loading"){x=!0;return}document.querySelectorAll(a.cssSelector).forEach(g)}function _(){x&&b()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",_,!1);function w(E,v){let C=null;try{C=v(t)}catch(P){if(yr("Language definition for '{}' could not be registered.".replace("{}",E)),i)yr(P);else throw P;C=s}C.name||(C.name=E),e[E]=C,C.rawDefinition=v.bind(null,t),C.aliases&&J(C.aliases,{languageName:E})}function I(E){delete e[E];for(let v of Object.keys(n))n[v]===E&&delete n[v]}function U(){return Object.keys(e)}function O(E){return E=(E||"").toLowerCase(),e[E]||e[n[E]]}function J(E,{languageName:v}){typeof E=="string"&&(E=[E]),E.forEach(C=>{n[C.toLowerCase()]=v})}function ne(E){let v=O(E);return v&&!v.disableAutodetect}function ie(E){E["before:highlightBlock"]&&!E["before:highlightElement"]&&(E["before:highlightElement"]=v=>{E["before:highlightBlock"](Object.assign({block:v.el},v))}),E["after:highlightBlock"]&&!E["after:highlightElement"]&&(E["after:highlightElement"]=v=>{E["after:highlightBlock"](Object.assign({block:v.el},v))})}function Z(E){ie(E),r.push(E)}function re(E){let v=r.indexOf(E);v!==-1&&r.splice(v,1)}function ce(E,v){let C=E;r.forEach(function(P){P[C]&&P[C](v)})}function N(E){return ti("10.7.0","highlightBlock will be removed entirely in v12.0"),ti("10.7.0","Please use highlightElement now."),g(E)}Object.assign(t,{highlight:u,highlightAuto:p,highlightAll:b,highlightElement:g,highlightBlock:N,configure:m,initHighlighting:y,initHighlightingOnLoad:M,registerLanguage:w,unregisterLanguage:I,listLanguages:U,getLanguage:O,registerAliases:J,autoDetection:ne,inherit:mb,addPlugin:Z,removePlugin:re}),t.debugMode=function(){i=!1},t.safeMode=function(){i=!0},t.versionString=dN,t.regex={concat:Er,lookahead:Eb,either:Cu,optional:TM,anyNumberOfTimes:NM};for(let E in Ws)typeof Ws[E]=="object"&&bb(Ws[E]);return Object.assign(t,Ws),t},ni=_b({});ni.newInstance=()=>_b({});Cb.exports=ni;ni.HighlightJS=ni;ni.default=ni});var Rb=zu((EL,Ru)=>{(function(){var t;typeof Ru<"u"?t=Ru.exports=r:t=function(){return this||(0,eval)("this")}(),t.format=r,t.vsprintf=n,typeof console<"u"&&typeof console.log=="function"&&(t.printf=e);function e(){console.log(r.apply(null,arguments))}function n(i,o){return r.apply(null,[i].concat(o))}function r(i){for(var o=1,s=[].slice.call(arguments),a=0,l=i.length,c="",u,d=!1,f,p,h=!1,g,m=function(){return s[o++]},y=function(){for(var M="";/\d/.test(i[a]);)M+=i[a++],u=i[a];return M.length>0?parseInt(M):null};a>1}};Xe.from=function(t){if(t instanceof Xe)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Xe(e)};var aa=Xe;function ju(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=ju(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function Yu(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),a=e.child(--o),l=s.nodeSize;if(s==a){n-=l,r-=l;continue}if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let c=0,u=Math.min(s.text.length,a.text.length);for(;ce&&r(l,i+a,o||null,s)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,n-u),r,i+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(a,l)=>{a.isText?(o+=a.text.slice(Math.max(e,l)-l,n-l),s=!r):a.isLeaf?(i?o+=typeof i=="function"?i(a):i:a.type.spec.leafText&&(o+=a.type.spec.leafText(a)),s=!r):!s&&a.isBlock&&(o+=r,s=!0)},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);oe)for(let o=0,s=0;se&&((sn)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,n-s-1))),r.push(a),i+=a.nodeSize),s=l}return new t(r,i)}cutByIndex(e,n){return e==n?t.empty:e==0&&n==this.content.length?this:new t(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new t(i,o)}addToStart(e){return new t([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new t(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;nthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||n>0?Qi(r+1,s):Qi(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return t.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new t(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return t.empty;let n,r=0;for(let i=0;ithis.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;nr.type.rank-i.type.rank),n}};me.none=[];var Fn=class extends Error{},D=class t{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=Xu(this.content,e+this.openStart,n);return r&&new t(r,this.openStart,this.openEnd)}removeBetween(e,n){return new t(Ju(this.content,e+this.openStart,n+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,n){if(!n)return t.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new t(T.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new t(e,r,i)}};D.empty=new D(T.empty,0,0);function Ju(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(i==e||o.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(Ju(o.content,e-i-1,n-i-1)))}function Xu(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=Xu(s.content,e-o-1,n);return a&&t.replaceChild(i,s.copy(a))}function ry(t,e,n){if(n.openStart>t.depth)throw new Fn("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Fn("Inconsistent open depths");return Zu(t,e,n,0)}function Zu(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function oi(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(Pn(t.nodeAfter,r),o++));for(let a=o;ai&&fa(t,e,i+1),s=r.depth>i&&fa(n,r,i+1),a=[];return oi(null,t,i,a),o&&s&&e.index(i)==n.index(i)?(Qu(o,s),Pn(Bn(o,ed(t,e,n,r,i+1)),a)):(o&&Pn(Bn(o,to(t,e,i+1)),a),oi(e,n,i,a),s&&Pn(Bn(s,to(n,r,i+1)),a)),oi(r,null,i,a),new T(a)}function to(t,e,n){let r=[];if(oi(null,t,n,r),t.depth>n){let i=fa(t,e,n+1);Pn(Bn(i,to(t,e,n+1)),r)}return oi(e,null,n,r),new T(r)}function iy(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(T.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}var no=class t{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.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,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Hn(this,e,r);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&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(o),c=o-l;if(r.push(s,a,i+l),!c||(s=s.child(a),s.isText))break;o=c-1,i+=l+1}return new t(n,r,o)}static resolveCached(e,n){for(let i=0;ie&&this.nodesBetween(e,n,o=>(r.isInSet(o.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()+")"),td(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=T.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=i;ln.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n 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(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=T.fromJSON(e,n.content);return e.nodeType(n.type).create(n.attrs,i,r)}};It.prototype.text=void 0;var pa=class t extends It{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):td(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new t(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new t(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function td(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}var zn=class t{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new ha(e,n);if(r.next==null)return t.empty;let i=nd(r);r.next&&r.err("Unexpected trailing text");let o=py(fy(i));return hy(o,r),o}matchType(e){for(let n=0;nc.createAndFill()));for(let c=0;c=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s"+e.indexOf(r.next[s].next);return o}).join(` +`)}};zn.empty=new zn(!0);var ha=class{constructor(e,n){this.string=e,this.nodeTypes=n,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 nd(t){let e=[];do e.push(ay(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function ay(t){let e=[];do e.push(ly(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function ly(t){let e=dy(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=cy(t,e);else break;return e}function Uu(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function cy(t,e){let n=Uu(t),r=n;return t.eat(",")&&(t.next!="}"?r=Uu(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function uy(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.groups.indexOf(e)>-1&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function dy(t){if(t.eat("(")){let e=nd(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=uy(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function fy(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(s,a,l){let c={term:l,to:a};return e[s].push(c),c}function i(s,a){s.forEach(l=>l.to=a)}function o(s,a){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(o(c,a)),[]);if(s.type=="seq")for(let l=0;;l++){let c=o(s.exprs[l],a);if(l==s.exprs.length-1)return c;i(c,a=n())}else if(s.type=="star"){let l=n();return r(a,l),i(o(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return i(o(s.expr,a),l),i(o(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(a)].concat(o(s.expr,a));if(s.type=="range"){let l=a;for(let c=0;c{t[s].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u{c||i.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let o=e[r.join(",")]=new zn(r.indexOf(t.length-1)>-1);for(let s=0;s-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;nr[o]=new t(o,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}},ma=class{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}},ai=class t{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=sd(i.attrs),this.excluded=null;let o=id(this.attrs);this.instance=o?new me(this,o):null}create(e=null){return!e&&this.instance?this.instance:new me(this,od(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new t(o,i++,n,s)),r}removeFromSet(e){for(var n=0;n-1}},io=class{constructor(e){this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=aa.from(e.nodes),n.marks=aa.from(e.marks||{}),this.nodes=ro.compile(this.spec.nodes,this),this.marks=ai.compile(this.spec.marks,this);let r=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 o=this.nodes[i],s=o.spec.content||"",a=o.spec.marks;o.contentMatch=r[s]||(r[s]=zn.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet=a=="_"?null:a?Wu(this,a.split(" ")):a==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:Wu(this,s.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,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof ro){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(n,r,i)}text(e,n){let r=this.nodes.text;return new pa(r,r.defaultAttrs,e,me.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return It.fromJSON(this,e)}markFromJSON(e){return me.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}};function Wu(t,e){let n=[];for(let r=0;r-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}var $n=class t{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[],n.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let i=e.nodes[r.node];return i.contentMatch.matchType(i)})}parse(e,n={}){let r=new ao(this,n,!1);return r.addAll(e,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new ao(this,n,!0);return r.addAll(e,n.from,n.to),D.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;ie.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s{r(s=Gu(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=Gu(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new t(e,t.schemaRules(e)))}},ad={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},my={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},ld={ol:!0,ul:!0},oo=1,so=2,si=4;function Vu(t,e,n){return e!=null?(e?oo:0)|(e==="full"?so:0):t&&t.whitespace=="pre"?oo|so:n&~si}var xr=class{constructor(e,n,r,i,o,s,a){this.type=e,this.attrs=n,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=a,this.content=[],this.activeMarks=me.none,this.stashMarks=[],this.match=s||(a&si?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(T.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&oo)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=T.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(T.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}popFromStashMark(e){for(let n=this.stashMarks.length-1;n>=0;n--)if(e.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(e){for(let n=0,r=this.pendingMarks;nthis.addAll(e)),s&&this.sync(a),this.needsBlock=l}else this.withStyleRules(e,()=>{this.addElementByRule(e,o,o.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 n=me.none,r=me.none;for(let i=0;i{s.clearMark(a)&&(r=a.addToSet(r))}):n=this.parser.schema.marks[s.mark].create(s.attrs).addToSet(n),s.consuming===!1)o=s;else break}return[n,r]}addElementByRule(e,n,r){let i,o,s;n.node?(o=this.parser.schema.nodes[n.node],o.isLeaf?this.insertNode(o.create(n.attrs))||this.leafFallback(e):i=this.enter(o,n.attrs||null,n.preserveWhitespace)):(s=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(s));let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l)}i&&this.sync(a)&&this.open--,s&&this.removePendingMark(s,a)}addAll(e,n,r){let i=n||0;for(let o=n?e.childNodes[n]:e.firstChild,s=r==null?null:e.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let n,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],s=o.findWrapping(e);if(s&&(!n||n.length>s.length)&&(n=s,r=o,!s.length)||o.solid)break}if(!n)return!1;this.sync(r);for(let i=0;ithis.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].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 n=this.open;n>=0;n--)if(this.nodes[n]==e)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(a,l)=>{for(;a>=0;a--){let c=n[a];if(c==""){if(a==n.length-1||a==0)continue;for(;l>=o;l--)if(s(a-1,l))return!0;return!1}else{let u=l>0||l==0&&i?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!u||u.name!=c&&u.groups.indexOf(c)==-1)return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let n=wy(e,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,n){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let s=i.popFromStashMark(e);s&&i.type&&i.type.allowsMarkType(s.type)&&(i.activeMarks=s.addToSet(i.activeMarks))}if(i==n)break}}};function gy(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&ld.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function by(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function yy(t){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,n,r=[];for(;n=e.exec(t);)r.push(n[1],n[2].trim());return r}function Gu(t){let e={};for(let n in t)e[n]=t[n];return e}function Ey(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=a=>{o.push(a);for(let l=0;l{if(o.length||s.marks.length){let a=0,l=0;for(;a=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&t.renderSpec(da(r),i(e,n))}static renderSpec(e,n,r=null){if(typeof n=="string")return{dom:e.createTextNode(n)};if(n.nodeType!=null)return{dom:n};if(n.dom&&n.dom.nodeType!=null)return n;let i=n[0],o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let s,a=r?e.createElementNS(r,i):e.createElement(i),l=n[1],c=1;if(l&&typeof l=="object"&&l.nodeType==null&&!Array.isArray(l)){c=2;for(let u in l)if(l[u]!=null){let d=u.indexOf(" ");d>0?a.setAttributeNS(u.slice(0,d),u.slice(d+1),l[u]):a.setAttribute(u,l[u])}}for(let u=c;uc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:f,contentDOM:p}=t.renderSpec(e,d,r);if(a.appendChild(f),p){if(s)throw new RangeError("Multiple content holes");s=p}}}return{dom:a,contentDOM:s}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new t(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=qu(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return qu(e.marks)}};function qu(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function da(t){return t.document||window.document}var dd=65535,fd=Math.pow(2,16);function vy(t,e){return t+e*fd}function cd(t){return t&dd}function Sy(t){return(t-(t&dd))/fd}var pd=1,hd=2,lo=4,md=8,ui=class{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&md)>0}get deletedBefore(){return(this.delInfo&(pd|lo))>0}get deletedAfter(){return(this.delInfo&(hd|lo))>0}get deletedAcross(){return(this.delInfo&lo)>0}},nn=class t{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&t.empty)return t.empty}recover(e){let n=0,r=cd(e);if(!this.inverted)for(let i=0;ie)break;let c=this.ranges[a+o],u=this.ranges[a+s],d=l+c;if(e<=d){let f=c?e==l?-1:e==d?1:n:n,p=l+i+(f<0?0:u);if(r)return p;let h=e==(n<0?l:d)?null:vy(a/3,e-l),g=e==l?hd:e==d?pd:lo;return(n<0?e!=l:e!=d)&&(g|=md),new ui(p,g,h)}i+=u-c}return r?e+i:new ui(e+i,0,null)}touches(e,n){let r=0,i=cd(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;ae)break;let c=this.ranges[a+o],u=l+c;if(e<=u&&a==i*3)return!0;r+=this.ranges[a+s]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i=0;n--){let i=e.getMirror(n);this.appendMap(e.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new t;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;ro&&l!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return Ge.fromReplace(e,this.from,this.to,o)}invert(){return new Un(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new t(n.pos,r.pos,this.mark)}merge(e){return e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new t(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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))}};ze.jsonID("addMark",fi);var Un=class t extends ze{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new D(va(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Ge.fromReplace(e,this.from,this.to,r)}invert(){return new fi(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new t(n.pos,r.pos,this.mark)}merge(e){return e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new t(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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))}};ze.jsonID("removeMark",Un);var pi=class t extends ze{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Ge.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Ge.fromReplace(e,this.pos,this.pos+1,new D(T.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;ir.pos?null:new t(n.pos,r.pos,i,o,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,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new t(n.from,n.to,n.gapFrom,n.gapTo,D.fromJSON(e,n.slice),n.insert,!!n.structure)}};ze.jsonID("replaceAround",Ie);function Ea(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function xy(t,e,n,r){let i=[],o=[],s,a;t.doc.nodesBetween(e,n,(l,c,u)=>{if(!l.isInline)return;let d=l.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),p=Math.min(c+l.nodeSize,n),h=r.addToSet(d);for(let g=0;gt.step(l)),o.forEach(l=>t.step(l))}function ky(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(s,a)=>{if(!s.isInline)return;o++;let l=null;if(r instanceof ai){let c=s.marks,u;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let c=Math.min(a+s.nodeSize,n);for(let u=0;ut.step(new Un(s.from,s.to,s.style)))}function My(t,e,n,r=n.contentMatch){let i=t.doc.nodeAt(e),o=[],s=e+1;for(let a=0;a=0;a--)t.step(o[a])}function Ny(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function rn(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),o=t.$from.index(r),s=t.$to.indexAfter(r);if(rn;h--)g||r.index(h)>0?(g=!0,u=T.from(r.node(h).copy(u)),d++):l--;let f=T.empty,p=0;for(let h=o,g=!1;h>n;h--)g||i.after(h+1)=0;s--){if(r.size){let a=n[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=T.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new Ie(i,o,i,o,new D(r,0,0),n.length,!0))}function Ay(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(s,a)=>{if(s.isTextblock&&!s.hasMarkup(r,i)&&Ry(t.doc,t.mapping.slice(o).map(a),r)){t.clearIncompatible(t.mapping.slice(o).map(a,1),r);let l=t.mapping.slice(o),c=l.map(a,1),u=l.map(a+s.nodeSize,1);return t.step(new Ie(c,u,c+1,u-1,new D(T.from(r.create(i,null,s.marks)),0,0),1,!0)),!1}})}function Ry(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function Iy(t,e,n,r,i){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Ie(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new D(T.from(s),0,0),1,!0))}function St(t,e,n=1,r){let i=t.resolve(e),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,u=n-2;c>o;c--,u--){let d=i.node(c),f=i.index(c);if(d.type.spec.isolating)return!1;let p=d.content.cutByIndex(f,d.childCount),h=r&&r[u+1];h&&(p=p.replaceChild(0,h.type.create(h.attrs)));let g=r&&r[u]||d;if(!d.canReplace(f+1,d.childCount)||!g.type.validContent(p))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function Dy(t,e,n=1,r){let i=t.doc.resolve(e),o=T.empty,s=T.empty;for(let a=i.depth,l=i.depth-n,c=n-1;a>l;a--,c--){o=T.from(i.node(a).copy(o));let u=r&&r[c];s=T.from(u?u.type.create(u.attrs,s):i.node(a).copy(s))}t.step(new st(e,e,new D(o.append(s),n,n),!0))}function Dt(t,e){let n=t.resolve(e),r=n.index();return gd(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function gd(t,e){return!!(t&&e&&!t.isLeaf&&t.canAppend(e))}function Nr(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let o,s,a=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):n>0?(o=r.node(i+1),a++,s=r.node(i).maybeChild(a)):(o=r.node(i).maybeChild(a-1),s=r.node(i+1)),o&&!o.isTextblock&&gd(o,s)&&r.node(i).canReplace(a,a+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function Ly(t,e,n){let r=new st(e-n,e+n,D.empty,!0);t.step(r)}function Py(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o=0;s--){let a=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,l=r.index(s)+(a>0?1:0),c=r.node(s),u=!1;if(o==1)u=c.canReplace(l,l,i);else{let d=c.contentMatchAt(l).findWrapping(i.firstChild.type);u=d&&c.canReplaceWith(l,l,d[0])}if(u)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function po(t,e,n=e,r=D.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return bd(i,o,r)?new st(e,n,r):new wa(i,o,r).fit()}function bd(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}var wa=class{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=T.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=T.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,a=i.depth;for(;s&&a&&o.childCount==1;)o=o.firstChild.content,s--,a--;let l=new D(o,s,a);return e>-1?new Ie(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new st(r.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=ba(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],u,d=null;if(n==1&&(s?c.matchType(s.type)||(d=c.fillBefore(T.from(s),!1)):o&&l.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:a,parent:o,inject:d};if(n==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:o,wrap:u};if(o&&c.matchType(o.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=ba(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new D(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=ba(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new D(li(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new D(li(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let g=0;g1||l==0||g.content.size)&&(d=m,u.push(yd(g.mark(f.allowedMarks(g.marks)),c==1?l:0,c==a.childCount?p:-1)))}let h=c==a.childCount;h||(p=-1),this.placed=ci(this.placed,n,T.from(u)),this.frontier[n].match=d,h&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,m=a;g1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n=0;a--){let{match:l,type:c}=this.frontier[a],u=ya(e,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:n,fit:s,move:o?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=ci(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=ci(this.placed,this.depth,T.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(T.empty,!0);n.childCount&&(this.placed=ci(this.placed,this.frontier.length,n))}};function li(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(li(t.firstChild.content,e-1,n)))}function ci(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(ci(t.lastChild.content,e-1,n)))}function ba(t,e){for(let n=0;n1&&(r=r.replaceChild(0,yd(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(T.empty,!0)))),t.copy(r)}function ya(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!By(n,o.content,s)?a:null}function By(t,e,n){for(let r=n;r0;f--,p--){let h=i.node(f).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;s.indexOf(f)>-1?a=f:i.before(f)==p&&s.splice(1,0,-f)}let l=s.indexOf(a),c=[],u=r.openStart;for(let f=r.content,p=0;;p++){let h=f.firstChild;if(c.push(h),p==r.openStart)break;f=h.content}for(let f=u-1;f>=0;f--){let p=c[f],h=Fy(p.type);if(h&&!p.sameMarkup(i.node(Math.abs(a)-1)))u=f;else if(h||!p.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let p=(f+u+1)%(r.openStart+1),h=c[p];if(h)for(let g=0;g=0&&(t.replace(e,n,r),!(t.steps.length>d));f--){let p=s[f];p<0||(e=i.before(p),n=o.after(p))}}function Ed(t,e,n,r,i){if(er){let o=i.contentMatchAt(0),s=o.fillBefore(t).append(t);t=s.append(o.matchFragment(s).fillBefore(T.empty,!0))}return t}function zy(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=Py(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new D(T.from(r),0,0))}function $y(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=wd(r,i);for(let s=0;s0&&(l||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return t.delete(r.before(a),i.after(a))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s)return t.delete(r.before(s),n);t.delete(e,n)}function wd(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let o=t.start(i);if(oe.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&n.push(i)}return n}var co=class t extends ze{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return Ge.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Ge.fromReplace(e,this.pos,this.pos+1,new D(T.from(i),0,n.isLeaf?0:1))}getMap(){return nn.empty}invert(e){return new t(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new t(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new t(n.pos,n.attr,n.value)}};ze.jsonID("attr",co);var uo=class t extends ze{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return Ge.ok(r)}getMap(){return nn.empty}invert(e){return new t(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new t(n.attr,n.value)}};ze.jsonID("docAttr",uo);var kr=class extends Error{};kr=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};kr.prototype=Object.create(Error.prototype);kr.prototype.constructor=kr;kr.prototype.name="TransformError";var mn=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new di}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new kr(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=D.empty){let i=po(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new D(T.from(r),0,0))}delete(e,n){return this.replace(e,n,D.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return Hy(this,e,n,r),this}replaceRangeWith(e,n,r){return zy(this,e,n,r),this}deleteRange(e,n){return $y(this,e,n),this}lift(e,n){return Ty(this,e,n),this}join(e,n=1){return Ly(this,e,n),this}wrap(e,n){return Oy(this,e,n),this}setBlockType(e,n=e,r,i=null){return Ay(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return Iy(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new co(e,n,r)),this}setDocAttribute(e,n){return this.step(new uo(e,n)),this}addNodeMark(e,n){return this.step(new pi(e,n)),this}removeNodeMark(e,n){if(!(n instanceof me)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new hi(e,n)),this}split(e,n=1,r){return Dy(this,e,n,r),this}addMark(e,n,r){return xy(this,e,n,r),this}removeMark(e,n,r){return ky(this,e,n,r),this}clearIncompatible(e,n,r){return My(this,e,n,r),this}};var Sa=Object.create(null),V=class{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new gi(e.min(n),e.max(n))]}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 n=0;n=0;o--){let s=n<0?Tr(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):Tr(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new wt(e.node(0))}static atStart(e){return Tr(e,e,0,0,1)||new wt(e)}static atEnd(e){return Tr(e,e,e.content.size,e.childCount,-1)||new wt(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Sa[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Sa)throw new RangeError("Duplicate use of selection JSON ID "+e);return Sa[e]=n,n.prototype.jsonID=e,n}getBookmark(){return K.between(this.$anchor,this.$head).getBookmark()}};V.prototype.visible=!0;var gi=class{constructor(e,n){this.$from=e,this.$to=n}},vd=!1;function Sd(t){!vd&&!t.parent.inlineContent&&(vd=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}var K=class t extends V{constructor(e,n=e){Sd(e),Sd(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return V.near(r);let i=e.resolve(n.map(this.anchor));return new t(i.parent.inlineContent?i:r,r)}replace(e,n=D.empty){if(super.replace(e,n),n==D.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof t&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new mo(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new t(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=V.findFrom(n,r,!0)||V.findFrom(n,-r,!0);if(o)n=o.$head;else return V.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(V.findFrom(e,-r,!0)||V.findFrom(e,r,!0)).$anchor,e.pos0?0:1);i>0?s=0;s+=i){let a=e.child(s);if(a.isAtom){if(!o&&Y.isSelectable(a))return Y.create(t,n-(i<0?a.nodeSize:0))}else{let l=Tr(t,a,n+i,i<0?a.childCount:0,i,o);if(l)return l}n+=a.nodeSize*i}return null}function xd(t,e,n){let r=t.steps.length-1;if(r{s==null&&(s=u)}),t.setSelection(V.near(t.doc.resolve(s),n))}var kd=1,ho=2,Md=4,Ma=class extends mn{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|=ho,this}ensureMarks(e){return me.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&ho)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~ho,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||me.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(n);o=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,o)),this.selection.empty||this.setSelection(V.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,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|=Md,this}get scrolledIntoView(){return(this.updated&Md)>0}};function Nd(t,e){return!e||!t?t:t.bind(e)}var Kn=class{constructor(e,n,r){this.name=e,this.init=Nd(n.init,r),this.apply=Nd(n.apply,r)}},Ky=[new Kn("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Kn("selection",{init(t,e){return t.selection||V.atStart(e.doc)},apply(t){return t.selection}}),new Kn("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Kn("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})],mi=class{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Ky.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Kn(r.key,r.spec.state,r))})}},go=class t{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,n=-1){for(let r=0;rr.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new mi(e.schema,e.plugins),o=new t(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=It.fromJSON(e.schema,n.doc);else if(s.name=="selection")o.selection=V.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],c=l.spec.state;if(l.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){o[s.name]=c.fromJSON.call(l,e,n[a],o);return}}o[s.name]=s.init(e,o)}}),o}};function Td(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=Td(i,e,{})),n[r]=i}return n}var ge=class{constructor(e){this.spec=e,this.props={},e.props&&Td(e.props,this,this.props),this.key=e.key?e.key.key:_d("plugin")}getState(e){return e[this.key]}},xa=Object.create(null);function _d(t){return t in xa?t+"$"+ ++xa[t]:(xa[t]=0,t+"$")}var ve=class{constructor(e="key"){this.key=_d(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}};var at=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},wi=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e},Cd=null,sn=function(t,e,n){let r=Cd||(Cd=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},Xn=function(t,e,n,r){return n&&(Od(t,e,n,r,-1)||Od(t,e,n,r,1))},Wy=/^(img|br|input|textarea|hr)$/i;function Od(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Wt(t))){let o=t.parentNode;if(!o||o.nodeType!=1||Ya(t)||Wy.test(t.nodeName)||t.contentEditable=="false")return!1;e=at(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.contentEditable=="false")return!1;e=i<0?Wt(t):0}else return!1}}function Wt(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Vy(t,e,n){for(let r=e==0,i=e==Wt(t);r||i;){if(t==n)return!0;let o=at(t);if(t=t.parentNode,!t)return!1;r=r&&o==0,i=i&&o==Wt(t)}}function Ya(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}var No=function(t){return t.focusNode&&Xn(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Wn(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function Gy(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function qy(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:r.offset}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:r.startOffset}}}var Vt=typeof navigator<"u"?navigator:null,Ad=typeof document<"u"?document:null,wn=Vt&&Vt.userAgent||"",Oa=/Edge\/(\d+)/.exec(wn),lf=/MSIE \d/.exec(wn),Aa=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(wn),pt=!!(lf||Aa||Oa),yn=lf?document.documentMode:Aa?+Aa[1]:Oa?+Oa[1]:0,Pt=!pt&&/gecko\/(\d+)/i.test(wn);Pt&&+(/Firefox\/(\d+)/.exec(wn)||[0,0])[1];var Ra=!pt&&/Chrome\/(\d+)/.exec(wn),Qe=!!Ra,jy=Ra?+Ra[1]:0,lt=!pt&&!!Vt&&/Apple Computer/.test(Vt.vendor),Rr=lt&&(/Mobile\/\w+/.test(wn)||!!Vt&&Vt.maxTouchPoints>2),xt=Rr||(Vt?/Mac/.test(Vt.platform):!1),Yy=Vt?/Win/.test(Vt.platform):!1,Lt=/Android \d/.test(wn),xi=!!Ad&&"webkitFontSmoothing"in Ad.documentElement.style,Jy=xi?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Xy(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function on(t,e){return typeof t=="number"?t:t[e]}function Zy(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function Rd(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let s=n||t.dom;s;s=wi(s)){if(s.nodeType!=1)continue;let a=s,l=a==o.body,c=l?Xy(o):Zy(a),u=0,d=0;if(e.topc.bottom-on(r,"bottom")&&(d=e.bottom-e.top>c.bottom-c.top?e.top+on(i,"top")-c.top:e.bottom-c.bottom+on(i,"bottom")),e.leftc.right-on(r,"right")&&(u=e.right-c.right+on(i,"right")),u||d)if(l)o.defaultView.scrollBy(u,d);else{let f=a.scrollLeft,p=a.scrollTop;d&&(a.scrollTop+=d),u&&(a.scrollLeft+=u);let h=a.scrollLeft-f,g=a.scrollTop-p;e={left:e.left-h,top:e.top-g,right:e.right-h,bottom:e.bottom-g}}if(l||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function Qy(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=n+1;s=n-20){r=a,i=l.top;break}}return{refDOM:r,refTop:i,stack:cf(t.dom)}}function cf(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=wi(r));return e}function eE({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;uf(n,r==0?0:r-e)}function uf(t,e){for(let n=0;n=a){s=Math.max(h.bottom,s),a=Math.min(h.top,a);let g=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=u,c={left:Math.max(h.left,Math.min(h.right,e.left)),top:h.top});!n&&(e.left>=h.right&&e.top>=h.top||e.left>=h.left&&e.top>=h.bottom)&&(o=d+1)}}return!n&&l&&(n=l,i=c,r=0),n&&n.nodeType==3?nE(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:df(n,i)}function nE(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function Ja(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function rE(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,i,o)}function oE(t,e,n,r){let i=-1;for(let o=e,s=!1;o!=t.dom;){let a=t.docView.nearestDesc(o,!0);if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent&&!s||!a.contentDOM)){let l=a.dom.getBoundingClientRect();if(a.node.isBlock&&a.parent&&!s&&(s=!0,l.left>r.left||l.top>r.top?i=a.posBefore:(l.right-1?i:t.docView.posFromDOM(e,n,-1)}function ff(t,e,n){let r=t.childNodes.length;if(r&&n.tope.top&&i++}let c;xi&&i&&r.nodeType==1&&(c=r.childNodes[i-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=oE(t,r,i,e))}a==null&&(a=iE(t,s,e));let l=t.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function Id(t){return t.top=0&&i==r.nodeValue.length?(l--,u=1):n<0?l--:c++,bi(gn(sn(r,l,c),u),u<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==Wt(r))){let l=r.childNodes[i-1];if(l.nodeType==1)return Na(l.getBoundingClientRect(),!1)}if(o==null&&i=0)}if(o==null&&i&&(n<0||i==Wt(r))){let l=r.childNodes[i-1],c=l.nodeType==3?sn(l,Wt(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return bi(gn(c,1),!1)}if(o==null&&i=0)}function bi(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Na(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function hf(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function lE(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return hf(t,e,()=>{let{node:o}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(o,!0);if(!a)break;if(a.node.isBlock){o=a.contentDOM||a.dom;break}o=a.dom.parentNode}let s=pf(t,i.pos,1);for(let a=o.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=sn(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;cu.top+1&&(n=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}var cE=/[\u0590-\u08ac]/;function uE(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=t.domSelection();return!cE.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?o:s:hf(t,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:d}=t.domSelectionRange(),f=a.caretBidiLevel;a.modify("move",n,"character");let p=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:h,focusOffset:g}=t.domSelectionRange(),m=h&&!p.contains(h.nodeType==1?h:h.parentNode)||l==h&&c==g;try{a.collapse(u,d),l&&(l!=u||c!=d)&&a.extend&&a.extend(l,c)}catch{}return f!=null&&(a.caretBidiLevel=f),m})}var Dd=null,Ld=null,Pd=!1;function dE(t,e,n){return Dd==e&&Ld==n?Pd:(Dd=e,Ld=n,Pd=n=="up"||n=="down"?lE(t,e,n):uE(t,e,n))}var kt=0,Bd=1,Gn=2,Gt=3,Zn=class{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=kt,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;nat(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(n==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!n||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return o}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;ne||s instanceof Eo){i=e-o;break}o=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof bo&&o.side>=0;r--);if(n<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&n&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?at(o.dom)+1:0}}else{let o,s=!0;for(;o=r=u&&n<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,u);e=s;for(let d=a;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){i=at(f.dom)+1;break}e-=f.size}i==-1&&(i=0)}if(i>-1&&(c>n||a==this.children.length-1)){n=c;for(let u=a+1;up&&sn){let p=a;a=l,l=p}let f=document.createRange();f.setEnd(l.node,l.offset),f.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(f)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i=r:er){let a=r+o.border,l=s-o.border;if(e>=a&&n<=l){this.dirty=e==r||n==s?Gn:Bd,e==a&&n==l&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=Gt:o.markDirty(e-a,n-a);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?Gn:Gt}r=s}this.dirty=Gn}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Gn:Bd;n.dirty{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(e){return this.dirty==kt&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(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}},Ia=class extends Zn{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}},Ir=class t extends Zn{constructor(e,n,r,i){super(e,[],r,i),this.mark=n}static create(e,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=tn.renderSpec(document,n.type.spec.toDOM(n,r))),new t(e,n,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&Gt||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Gt&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=kt){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(o=Fa(o,0,e,r));for(let a=0;a{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},r,i),u=c&&c.dom,d=c&&c.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=tn.renderSpec(document,n.type.spec.toDOM(n)));!d&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=bf(u,r,n),c?l=new Da(e,n,r,i,u,d||null,f,c,o,s+1):n.isText?new yo(e,n,r,i,u,f,o):new t(e,n,r,i,u,d||null,f,o,s+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 n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>T.empty)}return e}matchesNode(e,n,r){return this.dirty==kt&&e.eq(this.node)&&Pa(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,o=e.composing?this.localCompositionInfo(e,n):null,s=o&&o.pos>-1?o:null,a=o&&o.pos<0,l=new Ba(this,s&&s.node,e);mE(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!d&&l.syncToMarks(u==this.node.childCount?me.none:this.node.child(u).marks,r,e),l.placeWidget(c,e,i)},(c,u,d,f)=>{l.syncToMarks(c.marks,r,e);let p;l.findNodeMatch(c,u,d,f)||a&&e.state.selection.from>i&&e.state.selection.to-1&&l.updateNodeAt(c,u,d,p,e)||l.updateNextNode(c,u,d,e,f,i)||l.addNode(c,u,d,e,i),i+=c.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Gn)&&(s&&this.protectLocalComposition(e,s),mf(this.contentDOM,this.children,e),Rr&&gE(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof K)||rn+this.node.content.size)return null;let o=e.domSelectionRange(),s=bE(o.focusNode,o.focusOffset);if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let a=s.nodeValue,l=yE(this.node.content,a,r-n,i-n);return l<0?null:{node:s,pos:l,text:a}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new Ia(this,o,n,i);e.input.compositionNodes.push(s),this.children=Fa(this.children,r,r+i.length,e,s)}update(e,n,r,i){return this.dirty==Gt||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=kt}updateOuterDeco(e){if(Pa(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=gf(this.dom,this.nodeDOM,La(this.outerDeco,this.node,n),La(e,this.node,n)),this.dom!=r&&(r.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 Fd(t,e,n,r,i){bf(r,e,t);let o=new En(void 0,t,e,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}var yo=class t extends En{constructor(e,n,r,i,o,s,a){super(e,n,r,i,o,null,s,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==Gt||this.dirty!=kt&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=kt||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=kt,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),o=document.createTextNode(i.text);return new t(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Gt)}get domAtom(){return!1}},Eo=class extends Zn{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==kt&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}},Da=class extends En{constructor(e,n,r,i,o,s,a,l,c,u){super(e,n,r,i,o,s,a,c,u),this.spec=l}update(e,n,r,i){if(this.dirty==Gt)return!1;if(this.spec.update){let o=this.spec.update(e,n,r);return o&&this.updateInner(e,n,r,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r):super.setSelection(e,n,r,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 mf(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o>1,s=Math.min(o,e.length);for(;i-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=Ir.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))o=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a0;){let a;for(;;)if(r){let c=n.children[r-1];if(c instanceof Ir)n=c,r=c.children.length;else{a=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}function hE(t,e){return t.type.side-e.type.side}function mE(t,e,n,r){let i=e.locals(t),o=0;if(i.length==0){for(let c=0;co;)a.push(i[s++]);let h=o+f.nodeSize;if(f.isText){let m=h;s!m.inline):a.slice();r(f,g,e.forChild(o,f),p),o=h}}function gE(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function bE(t,e){for(;;){if(t.nodeType==3)return t;if(t.nodeType==1&&e>0){if(t.childNodes.length>e&&t.childNodes[e].nodeType==3)return t.childNodes[e];t=t.childNodes[e-1],e=Wt(t)}else if(t.nodeType==1&&e=n){if(o>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let c=a=0&&c+e.length+a>=n)return a+c;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function Fa(t,e,n,r,i){let o=[];for(let s=0,a=0;s=n||u<=e?o.push(l):(cn&&o.push(l.slice(n-c,l.size,r)))}return o}function Xa(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=r.resolve(s),l,c;if(No(n)){for(l=a;i&&!i.node;)i=i.parent;let u=i.node;if(i&&u.isAtom&&Y.isSelectable(u)&&i.parent&&!(u.isInline&&Vy(n.focusNode,n.focusOffset,i.dom))){let d=i.posBefore;c=new Y(s==d?a:r.resolve(d))}}else{let u=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(u<0)return null;l=r.resolve(u)}if(!c){let u=e=="pointer"||t.state.selection.head{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!yf(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function wE(t){let e=t.domSelection(),n=document.createRange(),r=t.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setEnd(r.parentNode,at(r)+1):n.setEnd(r,0),n.collapse(!1),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&pt&&yn<=11&&(r.disabled=!0,r.disabled=!1)}function Ef(t,e){if(e instanceof Y){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(Kd(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else Kd(t)}function Kd(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Za(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||K.between(e,n,r)}function Wd(t){return t.editable&&!t.hasFocus()?!1:wf(t)}function wf(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function vE(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Xn(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Ha(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return o&&V.findFrom(o,e)}function Vn(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Vd(t,e,n){let r=t.state.selection;if(r instanceof K){if(!r.empty||n.indexOf("s")>-1)return!1;if(t.endOfTextblock(e>0?"forward":"backward")){let i=Ha(t.state,e);return i&&i instanceof Y?Vn(t,i):!1}else if(!(xt&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let a=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=t.docView.descAt(a))&&!s.contentDOM?Y.isSelectable(o)?Vn(t,new Y(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):xi?Vn(t,new K(t.state.doc.resolve(e<0?a:a+o.nodeSize))):!1:!1}}else{if(r instanceof Y&&r.node.isInline)return Vn(t,new K(e>0?r.$to:r.$from));{let i=Ha(t.state,e);return i?Vn(t,i):!1}}}function wo(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Ei(t,e){if(t.contentEditable=="false")return!0;let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Cr(t,e){return e<0?SE(t):xE(t)}function SE(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;for(Pt&&n.nodeType==1&&r0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(Ei(a,-1))i=n,o=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(vf(n))break;{let a=n.previousSibling;for(;a&&Ei(a,-1);)i=n.parentNode,o=at(a),a=a.previousSibling;if(a)n=a,r=wo(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?za(t,n,r):i&&za(t,i,o)}function xE(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=wo(n),o,s;for(;;)if(r{t.state==i&&an(t)},50)}function Gd(t,e){let n=t.state.doc.resolve(e);if(!(Qe||Yy)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let o=t.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>i.top&&s1)return o.lefti.top&&s1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function qd(t,e,n){let r=t.state.selection;if(r instanceof K&&!r.empty||n.indexOf("s")>-1||xt&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=Ha(t.state,e);if(s&&s instanceof Y)return Vn(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,a=r instanceof wt?V.near(s,e):V.findFrom(s,e);return a?Vn(t,a):!1}return!1}function jd(t,e){if(!(t.state.selection instanceof K))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let s=t.state.tr;return e<0?s.delete(n.pos-o.nodeSize,n.pos):s.delete(n.pos,n.pos+o.nodeSize),t.dispatch(s),!0}return!1}function Yd(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function NE(t){if(!lt||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;Yd(t,r,"true"),setTimeout(()=>Yd(t,r,"false"),20)}return!1}function TE(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function _E(t,e){let n=e.keyCode,r=TE(e);if(n==8||xt&&n==72&&r=="c")return jd(t,-1)||Cr(t,-1);if(n==46&&!e.shiftKey||xt&&n==68&&r=="c")return jd(t,1)||Cr(t,1);if(n==13||n==27)return!0;if(n==37||xt&&n==66&&r=="c"){let i=n==37?Gd(t,t.state.selection.from)=="ltr"?-1:1:-1;return Vd(t,i,r)||Cr(t,i)}else if(n==39||xt&&n==70&&r=="c"){let i=n==39?Gd(t,t.state.selection.from)=="ltr"?1:-1:1;return Vd(t,i,r)||Cr(t,i)}else{if(n==38||xt&&n==80&&r=="c")return qd(t,-1,r)||Cr(t,-1);if(n==40||xt&&n==78&&r=="c")return NE(t)||qd(t,1,r)||Cr(t,1);if(r==(xt?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Sf(t,e){t.someProp("transformCopied",p=>{e=p(e,t)});let n=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let s=t.someProp("clipboardSerializer")||tn.fromSchema(t.state.schema),a=_f(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c=l.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=Tf[c.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let h=a.createElement(u[p]);for(;l.firstChild;)h.appendChild(l.firstChild);l.appendChild(h),d++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${o}${d?` -${d}`:""} ${JSON.stringify(n)}`);let f=t.someProp("clipboardTextSerializer",p=>p(e,t))||e.content.textBetween(0,e.content.size,` + +`);return{dom:l,text:f}}function xf(t,e,n,r,i){let o=i.parent.type.spec.code,s,a;if(!n&&!e)return null;let l=e&&(r||o||!n);if(l){if(t.someProp("transformPastedText",f=>{e=f(e,o||r,t)}),o)return e?new D(T.from(t.state.schema.text(e.replace(/\r\n?/g,` +`))),0,0):D.empty;let d=t.someProp("clipboardTextParser",f=>f(e,i,r,t));if(d)a=d;else{let f=i.marks(),{schema:p}=t.state,h=tn.fromSchema(p);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let m=s.appendChild(document.createElement("p"));g&&m.appendChild(h.serializeNode(p.text(g,f)))})}}else t.someProp("transformPastedHTML",d=>{n=d(n,t)}),s=AE(n),xi&&RE(s);let c=s&&s.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let f=s.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;s=f}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||$n.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||u),context:i,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!CE.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)a=IE(Jd(a,+u[1],+u[2]),u[4]);else if(a=D.maxOpen(OE(a.content,i),!0),a.openStart||a.openEnd){let d=0,f=0;for(let p=a.content.firstChild;d{a=d(a,t)}),a}var CE=/^(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 OE(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),o,s=[];if(t.forEach(a=>{if(!s)return;let l=i.findWrapping(a.type),c;if(!l)return s=null;if(c=s.length&&o.length&&Mf(l,o,a,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=Nf(s[s.length-1],o.length));let u=kf(a,l);s.push(u),i=i.matchType(u.type),o=l}}),s)return T.from(s)}return t}function kf(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,T.from(t));return t}function Mf(t,e,n,r,i){if(i1&&(o=0),i=n&&(a=e<0?s.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(T.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function Jd(t,e,n){return e]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=_f().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&Tf[r[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"").reverse().join("")),n.innerHTML=t,i)for(let o=0;o=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;i=T.from(l.create(r[a+1],i)),o++,s++}return new D(i,o,s)}var ct={},ut={},DE={touchstart:!0,touchmove:!0},Ua=class{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.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 LE(t){for(let e in ct){let n=ct[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{BE(t,r)&&!Qa(t,r)&&(t.editable||!(r.type in ut))&&n(t,r)},DE[e]?{passive:!0}:void 0)}lt&&t.dom.addEventListener("input",()=>null),Ka(t)}function bn(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function PE(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function Ka(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Qa(t,r))})}function Qa(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function BE(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function FE(t,e){!Qa(t,e)&&ct[e.type]&&(t.editable||!(e.type in ut))&&ct[e.type](t,e)}ut.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!Of(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Lt&&Qe&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Rr&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,Wn(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||_E(t,n)?n.preventDefault():bn(t,"key")};ut.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};ut.keypress=(t,e)=>{let n=e;if(Of(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||xt&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof K)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,i))&&t.dispatch(t.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function To(t){return{left:t.clientX,top:t.clientY}}function HE(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function el(t,e,n,r,i){if(r==-1)return!1;let o=t.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(t.someProp(e,a=>s>o.depth?a(t,n,o.nodeAfter,o.before(s),i,!0):a(t,n,o.node(s),o.before(s),i,!1)))return!0;return!1}function Ar(t,e,n){t.focused||t.focus();let r=t.state.tr.setSelection(e);n=="pointer"&&r.setMeta("pointer",!0),t.dispatch(r)}function zE(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&Y.isSelectable(r)?(Ar(t,new Y(n),"pointer"),!0):!1}function $E(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof Y&&(r=n.node);let o=t.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let a=s>o.depth?o.nodeAfter:o.node(s);if(Y.isSelectable(a)){r&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(s);break}}return i!=null?(Ar(t,Y.create(t.state.doc,i),"pointer"),!0):!1}function UE(t,e,n,r,i){return el(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?$E(t,n):zE(t,n))}function KE(t,e,n,r){return el(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function WE(t,e,n,r){return el(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||VE(t,n,r)}function VE(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Ar(t,K.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),a=i.before(o);if(s.inlineContent)Ar(t,K.create(r,a+1,a+1+s.content.size),"pointer");else if(Y.isSelectable(s))Ar(t,Y.create(r,a),"pointer");else continue;return!0}}function tl(t){return vo(t)}var Cf=xt?"metaKey":"ctrlKey";ct.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=tl(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&HE(n,t.input.lastClick)&&!n[Cf]&&(t.input.lastClick.type=="singleClick"?o="doubleClick":t.input.lastClick.type=="doubleClick"&&(o="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=t.posAtCoords(To(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new Wa(t,s,n,!!r)):(o=="doubleClick"?KE:WE)(t,s.pos,s.inside,n)?n.preventDefault():bn(t,"pointer"))};var Wa=class{constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[Cf],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=e.state.doc.nodeAt(n.inside),s=n.inside;else{let u=e.state.doc.resolve(n.pos);o=u.parent,s=u.depth?u.before():0}let a=i?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l?l.dom:null;let{selection:c}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||c instanceof Y&&c.from<=s&&c.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Pt&&!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)),bn(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(()=>an(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(To(e))),this.updateAllowDefault(e),this.allowDefault||!n?bn(this.view,"pointer"):UE(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||lt&&this.mightDrag&&!this.mightDrag.node.isAtom||Qe&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Ar(this.view,V.near(this.view.state.doc.resolve(n.pos)),"pointer"),e.preventDefault()):bn(this.view,"pointer")}move(e){this.updateAllowDefault(e),bn(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)}};ct.touchstart=t=>{t.input.lastTouch=Date.now(),tl(t),bn(t,"pointer")};ct.touchmove=t=>{t.input.lastTouch=Date.now(),bn(t,"pointer")};ct.contextmenu=t=>tl(t);function Of(t,e){return t.composing?!0:lt&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}var GE=Lt?5e3:-1;ut.compositionstart=ut.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),vo(t,!0),t.markCursor=null;else if(vo(t),Pt&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){t.domSelection().collapse(s,s.nodeValue.length);break}else i=s,o=-1}}t.input.composing=!0}Af(t,GE)};ut.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,Af(t,20))};function Af(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>vo(t),e))}function Rf(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=qE());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function qE(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function vo(t,e=!1){if(!(Lt&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Rf(t),e||t.docView&&t.docView.dirty){let n=Xa(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):t.updateState(t.state),!0}return!1}}function jE(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}var Dr=pt&&yn<15||Rr&&Jy<604;ct.copy=ut.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let o=Dr?null:n.clipboardData,s=r.content(),{dom:a,text:l}=Sf(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):jE(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function YE(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function JE(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?vi(t,r.value,null,i,e):vi(t,r.textContent,r.innerHTML,i,e)},50)}function vi(t,e,n,r,i){let o=xf(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,i,o||D.empty)))return!0;if(!o)return!1;let s=YE(o),a=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(o);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}ut.paste=(t,e)=>{let n=e;if(t.composing&&!Lt)return;let r=Dr?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&vi(t,r.getData("text/plain"),r.getData("text/html"),i,n)?n.preventDefault():JE(t,n)};var Va=class{constructor(e,n){this.slice=e,this.move=n}},If=xt?"altKey":"ctrlKey";ct.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,o=i.empty?null:t.posAtCoords(To(n));if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof Y?i.to-1:i.to))){if(r&&r.mightDrag)t.dispatch(t.state.tr.setSelection(Y.create(t.state.doc,r.mightDrag.pos)));else if(n.target&&n.target.nodeType==1){let c=t.docView.nearestDesc(n.target,!0);c&&c.node.type.spec.draggable&&c!=t.docView&&t.dispatch(t.state.tr.setSelection(Y.create(t.state.doc,c.posBefore)))}}let s=t.state.selection.content(),{dom:a,text:l}=Sf(t,s);n.dataTransfer.clearData(),n.dataTransfer.setData(Dr?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",Dr||n.dataTransfer.setData("text/plain",l),t.dragging=new Va(s,!n[If])};ct.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};ut.dragover=ut.dragenter=(t,e)=>e.preventDefault();ut.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(To(n));if(!i)return;let o=t.state.doc.resolve(i.pos),s=r&&r.slice;s?t.someProp("transformPasted",h=>{s=h(s,t)}):s=xf(t,n.dataTransfer.getData(Dr?"Text":"text/plain"),Dr?null:n.dataTransfer.getData("text/html"),!1,o);let a=!!(r&&!n[If]);if(t.someProp("handleDrop",h=>h(t,n,s||D.empty,a))){n.preventDefault();return}if(!s)return;n.preventDefault();let l=s?fo(t.state.doc,o.pos,s):o.pos;l==null&&(l=o.pos);let c=t.state.tr;a&&c.deleteSelection();let u=c.mapping.map(l),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,f=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(f))return;let p=c.doc.resolve(u);if(d&&Y.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new Y(p));else{let h=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((g,m,y,M)=>h=M),c.setSelection(Za(t,p,c.doc.resolve(h)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))};ct.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&an(t)},20))};ct.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};ct.beforeinput=(t,e)=>{if(Qe&&Lt&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",o=>o(t,Wn(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in ut)ct[t]=ut[t];function Si(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}var So=class t{constructor(e,n){this.toDOM=e,this.spec=n||Yn,this.side=this.spec.side||0}map(e,n,r,i){let{pos:o,deleted:s}=e.mapResult(n.from+i,this.side<0?-1:1);return s?null:new et(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof t&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Si(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},jn=class t{constructor(e,n){this.attrs=e,this.spec=n||Yn}map(e,n,r,i){let o=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new et(o,s,this)}valid(e,n){return n.from=e&&(!o||o(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let s=0;se){let a=this.children[s]+1;this.children[s+2].findInner(e-a,n-a,r,i+a,o)}}map(e,n,r){return this==Ze||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Yn)}mapInner(e,n,r,i,o){let s;for(let a=0;a{let c=l+r,u;if(u=Lf(n,a,c)){for(i||(i=this.children.slice());oa&&d.to=e){this.children[a]==e&&(r=this.children[a+2]);break}let o=e+1,s=o+n.content.size;for(let a=0;ao&&l.type instanceof jn){let c=Math.max(o,l.from)-o,u=Math.min(s,l.to)-o;ci.map(e,n,Yn));return t.from(r)}forChild(e,n){if(n.isLeaf)return Ce.empty;let r=[];for(let i=0;in instanceof Ce)?e:e.reduce((n,r)=>n.concat(r instanceof Ce?r:r.members),[]))}}};function XE(t,e,n,r,i,o,s){let a=t.slice();for(let c=0,u=o;c{let m=g-h-(p-f);for(let y=0;yM+u-d)continue;let x=a[y]+u-d;p>=x?a[y+1]=f<=x?-2:-1:h>=i&&m&&(a[y]+=m,a[y+1]+=m)}d+=m}),u=n.maps[c].map(u,-1)}let l=!1;for(let c=0;c=r.content.size){l=!0;continue}let f=n.map(t[c+1]+o,-1),p=f-i,{index:h,offset:g}=r.content.findIndex(d),m=r.maybeChild(h);if(m&&g==d&&g+m.nodeSize==p){let y=a[c+2].mapInner(n,m,u+1,t[c]+o+1,s);y!=Ze?(a[c]=d,a[c+1]=p,a[c+2]=y):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=ZE(a,t,e,n,i,o,s),u=ko(c,r,0,s);e=u.local;for(let d=0;dn&&s.to{let c=Lf(t,a,l+n);if(c){o=!0;let u=ko(c,a,n+l+1,r);u!=Ze&&i.push(l,l+a.nodeSize,u)}});let s=Df(o?Pf(t):t,-n).sort(Jn);for(let a=0;a0;)e++;t.splice(e,0,n)}function _a(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=Ze&&e.push(r)}),t.cursorWrapper&&e.push(Ce.create(t.state.doc,[t.cursorWrapper.deco])),xo.from(e)}var QE={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},e0=pt&&yn<=11,qa=class{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}},ja=class{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new qa,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;ii.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),e0&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.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,QE)),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 n=0;nthis.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(Wd(this.view)){if(this.suppressingSelectionUpdates)return an(this.view);if(pt&&yn<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Xn(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 n=new Set,r;for(let o=e.focusNode;o;o=wi(o))n.add(o);for(let o=e.anchorNode;o;o=wi(o))if(n.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))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 n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Wd(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,a=!1,l=[];if(e.editable)for(let u=0;u1){let u=l.filter(d=>d.nodeName=="BR");if(u.length==2){let d=u[0],f=u[1];d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}}let c=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||i)&&(o>-1&&(e.docView.markDirty(o,s),t0(e)),this.handleDOMChange(o,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||an(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;ui;m--){let y=r.childNodes[m-1],M=y.pmViewDesc;if(y.nodeName=="BR"&&!M){o=m;break}if(!M||M.size)break}let d=t.state.doc,f=t.someProp("domParser")||$n.fromSchema(t.state.schema),p=d.resolve(s),h=null,g=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:o,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:i0,context:p});if(c&&c[0].pos!=null){let m=c[0].pos,y=c[1]&&c[1].pos;y==null&&(y=m),h={anchor:m+s,head:y+s}}return{doc:g,sel:h,from:s,to:a}}function i0(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(lt&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||lt&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}var o0=/^(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 s0(t,e,n,r,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let O=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,J=Xa(t,O);if(J&&!t.state.selection.eq(J)){if(Qe&&Lt&&t.input.lastKeyCode===13&&Date.now()-100ie(t,Wn(13,"Enter"))))return;let ne=t.state.tr.setSelection(J);O=="pointer"?ne.setMeta("pointer",!0):O=="key"&&ne.scrollIntoView(),o&&ne.setMeta("composition",o),t.dispatch(ne)}return}let s=t.state.doc.resolve(e),a=s.sharedDepth(n);e=s.before(a+1),n=t.state.doc.resolve(n).after(a+1);let l=t.state.selection,c=r0(t,e,n),u=t.state.doc,d=u.slice(c.from,c.to),f,p;t.input.lastKeyCode===8&&Date.now()-100Date.now()-225||Lt)&&i.some(O=>O.nodeType==1&&!o0.test(O.nodeName))&&(!h||h.endA>=h.endB)&&t.someProp("handleKeyDown",O=>O(t,Wn(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!h)if(r&&l instanceof K&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))h={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let O=tf(t,t.state.doc,c.sel);if(O&&!O.eq(t.state.selection)){let J=t.state.tr.setSelection(O);o&&J.setMeta("composition",o),t.dispatch(J)}}return}if(Qe&&t.cursorWrapper&&c.sel&&c.sel.anchor==t.cursorWrapper.deco.from&&c.sel.head==c.sel.anchor){let O=h.endB-h.start;c.sel={anchor:c.sel.anchor+O,head:c.sel.anchor+O}}t.input.domChangeCount++,t.state.selection.fromt.state.selection.from&&h.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?h.start=t.state.selection.from:h.endA=t.state.selection.to-2&&t.state.selection.to<=c.to&&(h.endB+=t.state.selection.to-h.endA,h.endA=t.state.selection.to)),pt&&yn<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>c.from&&c.doc.textBetween(h.start-c.from-1,h.start-c.from+1)==" \xA0"&&(h.start--,h.endA--,h.endB--);let g=c.doc.resolveNoCache(h.start-c.from),m=c.doc.resolveNoCache(h.endB-c.from),y=u.resolve(h.start),M=g.sameParent(m)&&g.parent.inlineContent&&y.end()>=h.endA,x;if((Rr&&t.input.lastIOSEnter>Date.now()-225&&(!M||i.some(O=>O.nodeName=="DIV"||O.nodeName=="P"))||!M&&g.posO(t,Wn(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>h.start&&l0(u,h.start,h.endA,g,m)&&t.someProp("handleKeyDown",O=>O(t,Wn(8,"Backspace")))){Lt&&Qe&&t.domObserver.suppressSelectionUpdates();return}Qe&&Lt&&h.endB==h.start&&(t.input.lastAndroidDelete=Date.now()),Lt&&!M&&g.start()!=m.start()&&m.parentOffset==0&&g.depth==m.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==h.endA&&(h.endB-=2,m=c.doc.resolveNoCache(h.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(O){return O(t,Wn(13,"Enter"))})},20));let b=h.start,_=h.endA,w,I,U;if(M){if(g.pos==m.pos)pt&&yn<=11&&g.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>an(t),20)),w=t.state.tr.delete(b,_),I=u.resolve(h.start).marksAcross(u.resolve(h.endA));else if(h.endA==h.endB&&(U=a0(g.parent.content.cut(g.parentOffset,m.parentOffset),y.parent.content.cut(y.parentOffset,h.endA-y.start()))))w=t.state.tr,U.type=="add"?w.addMark(b,_,U.mark):w.removeMark(b,_,U.mark);else if(g.parent.child(g.index()).isText&&g.index()==m.index()-(m.textOffset?0:1)){let O=g.parent.textBetween(g.parentOffset,m.parentOffset);if(t.someProp("handleTextInput",J=>J(t,b,_,O)))return;w=t.state.tr.insertText(O,b,_)}}if(w||(w=t.state.tr.replace(b,_,c.doc.slice(h.start-c.from,h.endB-c.from))),c.sel){let O=tf(t,w.doc,c.sel);O&&!(Qe&&Lt&&t.composing&&O.empty&&(h.start!=h.endB||t.input.lastAndroidDeletee.content.size?null:Za(t,e.resolve(n.anchor),e.resolve(n.head))}function a0(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,o=r,s,a,l;for(let u=0;uu.mark(a.addToSet(u.marks));else if(i.length==0&&o.length==1)a=o[0],s="remove",l=u=>u.mark(a.removeFromSet(u.marks));else return null;let c=[];for(let u=0;un||Ca(s,!0,!1)0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let o=t.node(r).maybeChild(t.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function c0(t,e,n,r,i){let o=t.findDiffStart(e,n);if(o==null)return null;let{a:s,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let l=Math.max(0,o-Math.min(s,a));r-=s+l-o}if(s=s?o-r:0;o-=l,a=o+(a-s),s=o}else if(a=a?o-r:0;o-=l,s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}var Mo=class{constructor(e,n){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 Ua,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(af),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=of(this),rf(this),this.nodeViews=sf(this),this.docView=Fd(this.state.doc,nf(this),_a(this),this.dom,this),this.domObserver=new ja(this,(r,i,o,s)=>s0(this,r,i,o,s)),this.domObserver.start(),LE(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 n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Ka(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(af),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){let r=this.state,i=!1,o=!1;e.storedMarks&&this.composing&&(Rf(this),o=!0),this.state=e;let s=r.plugins!=e.plugins||this._props.plugins!=n.plugins;if(s||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let f=sf(this);d0(f,this.nodeViews)&&(this.nodeViews=f,i=!0)}(s||n.handleDOMEvents!=this._props.handleDOMEvents)&&Ka(this),this.editable=of(this),rf(this);let a=_a(this),l=nf(this),c=r.plugins!=e.plugins&&!r.doc.eq(e.doc)?"reset":e.scrollToSelection>r.scrollToSelection?"to selection":"preserve",u=i||!this.docView.matchesNode(e.doc,l,a);(u||!e.selection.eq(r.selection))&&(o=!0);let d=c=="preserve"&&o&&this.dom.style.overflowAnchor==null&&Qy(this);if(o){this.domObserver.stop();let f=u&&(pt||Qe)&&!this.composing&&!r.selection.empty&&!e.selection.empty&&u0(r.selection,e.selection);if(u){let p=Qe?this.trackWrites=this.domSelectionRange().focusNode:null;(i||!this.docView.update(e.doc,l,a,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Fd(e.doc,l,a,this.dom,this)),p&&!this.trackWrites&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&vE(this))?an(this,f):(Ef(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():d&&eE(d)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof Y){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Rd(this,n.getBoundingClientRect(),e)}else Rd(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 n=0;nn.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return sE(this,e)}coordsAtPos(e,n=1){return pf(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return dE(this,n||this.state,e)}pasteHTML(e,n){return vi(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return vi(this,e,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(PE(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],_a(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(e){return FE(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){return lt&&this.root.nodeType===11&&Gy(this.dom.ownerDocument)==this.dom?n0(this):this.domSelection()}domSelection(){return this.root.getSelection()}};function nf(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[et.node(0,t.state.doc.content.size,e)]}function rf(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:et.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function of(t){return!t.someProp("editable",e=>e(t.state)===!1)}function u0(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function sf(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function d0(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function af(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var ln={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:"'"},Co={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},f0=typeof navigator<"u"&&/Mac/.test(navigator.platform),p0=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(De=0;De<10;De++)ln[48+De]=ln[96+De]=String(De);var De;for(De=1;De<=24;De++)ln[De+111]="F"+De;var De;for(De=65;De<=90;De++)ln[De]=String.fromCharCode(De+32),Co[De]=String.fromCharCode(De);var De;for(_o in ln)Co.hasOwnProperty(_o)||(Co[_o]=ln[_o]);var _o;function Bf(t){var e=f0&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||p0&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Co:ln)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}var h0=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function m0(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let a=0;a127)&&(o=ln[r.keyCode])&&o!=i){let a=e[rl(o,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}var Oo=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function b0(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}var ol=(t,e,n)=>{let r=b0(t,n);if(!r)return!1;let i=zf(r);if(!i){let s=r.blockRange(),a=s&&rn(s);return a==null?!1:(e&&e(t.tr.lift(s,a).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&Gf(t,i,e))return!0;if(r.parent.content.size==0&&(Lr(o,"end")||Y.isSelectable(o))){let s=po(t.doc,r.before(),r.after(),D.empty);if(s&&s.slice.size{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;o=zf(r)}let s=o&&o.nodeBefore;return!s||!Y.isSelectable(s)?!1:(e&&e(t.tr.setSelection(Y.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function zf(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function y0(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset{let r=y0(t,n);if(!r)return!1;let i=$f(r);if(!i)return!1;let o=i.nodeAfter;if(Gf(t,i,e))return!0;if(r.parent.content.size==0&&(Lr(o,"start")||Y.isSelectable(o))){let s=po(t.doc,r.before(),r.after(),D.empty);if(s&&s.slice.size{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset=0;e--){let n=t.node(e);if(t.index(e)+1{let n=t.selection,r=n instanceof Y,i;if(r){if(n.node.isTextblock||!Dt(t.doc,n.from))return!1;i=n.from}else if(i=Nr(t.doc,n.from,-1),i==null)return!1;if(e){let o=t.tr.join(i);r&&o.setSelection(Y.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},Kf=(t,e)=>{let n=t.selection,r;if(n instanceof Y){if(n.node.isTextblock||!Dt(t.doc,n.to))return!1;r=n.to}else if(r=Nr(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},Wf=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&rn(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},cl=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(` +`).scrollIntoView()),!0)};function ul(t){for(let e=0;e{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=ul(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,s.createAndFill());l.setSelection(V.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},fl=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof wt||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=ul(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index(){let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(St(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&rn(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function E0(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof Y&&e.selection.node.isBlock)return!r.parentOffset||!St(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.parent.isBlock)return!1;if(n){let o=i.parentOffset==i.parent.content.size,s=e.tr;(e.selection instanceof K||e.selection instanceof wt)&&s.deleteSelection();let a=r.depth==0?null:ul(r.node(-1).contentMatchAt(r.indexAfter(-1))),l=t&&t(i.parent,o),c=l?[l]:o&&a?[{type:a}]:void 0,u=St(s.doc,s.mapping.map(r.pos),1,c);if(!c&&!u&&St(s.doc,s.mapping.map(r.pos),1,a?[{type:a}]:void 0)&&(a&&(c=[{type:a}]),u=!0),u&&(s.split(s.mapping.map(r.pos),1,c),!o&&!r.parentOffset&&r.parent.type!=a)){let d=s.mapping.map(r.before()),f=s.doc.resolve(d);a&&r.node(-1).canReplaceWith(f.index(),f.index()+1,a)&&s.setNodeMarkup(s.mapping.map(r.before()),a)}n(s.scrollIntoView())}return!0}}var w0=E0();var Vf=(t,e)=>{let{$from:n,to:r}=t.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),e&&e(t.tr.setSelection(Y.create(t.doc,i))),!0)},v0=(t,e)=>(e&&e(t.tr.setSelection(new wt(t.doc))),!0);function S0(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||Dt(t.doc,e.pos))?!1:(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function Gf(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o,s;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(S0(t,e,n))return!0;let a=e.parent.canReplace(e.index(),e.index()+1);if(a&&(o=(s=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&s.matchType(o[0]||i.type).validEnd){if(n){let d=e.pos+i.nodeSize,f=T.empty;for(let g=o.length-1;g>=0;g--)f=T.from(o[g].create(null,f));f=T.from(r.copy(f));let p=t.tr.step(new Ie(e.pos-1,d,e.pos,d,new D(f,1,0),o.length,!0)),h=d+2*o.length;Dt(p.doc,h)&&p.join(h),n(p.scrollIntoView())}return!0}let l=V.findFrom(e,1),c=l&&l.$from.blockRange(l.$to),u=c&&rn(c);if(u!=null&&u>=e.depth)return n&&n(t.tr.lift(c,u).scrollIntoView()),!0;if(a&&Lr(i,"start",!0)&&Lr(r,"end")){let d=r,f=[];for(;f.push(d),!d.isTextblock;)d=d.lastChild;let p=i,h=1;for(;!p.isTextblock;p=p.firstChild)h++;if(d.canReplace(d.childCount,d.childCount,p.content)){if(n){let g=T.empty;for(let y=f.length-1;y>=0;y--)g=T.from(f[y].copy(g));let m=t.tr.step(new Ie(e.pos-f.length,e.pos+i.nodeSize,e.pos+h,e.pos+i.nodeSize-h,new D(g,f.length,0),0,!0));n(m.scrollIntoView())}return!0}}return!1}function qf(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(e.tr.setSelection(K.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}var hl=qf(-1),ml=qf(1);function jf(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&Mr(s,t,e);return a?(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function gl(t,e=null){return function(n,r){let i=!1;for(let o=0;o{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)i=!0;else{let u=n.doc.resolve(c),d=u.index();i=u.parent.canReplaceWith(d,d+1,t)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s=2&&i.node(s.depth-1).type.compatibleContent(t)&&s.startIndex==0){if(i.index(s.depth-1)==0)return!1;let u=n.doc.resolve(s.start-2);l=new Hn(u,u,s.depth),s.endIndex=0;u--)o=T.from(n[u].type.create(n[u].attrs,o));t.step(new Ie(e.start-(r?2:0),e.end,e.start,e.end,new D(o,0,0),n.length,!0));let s=0;for(let u=0;us.childCount>0&&s.firstChild.type==t);return o?n?r.node(o.depth-1).type==t?M0(e,n,t,o):N0(e,n,o):!0:!1}}function M0(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);og;h--)p-=i.child(h).nodeSize,r.delete(p-1,p+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==i.childCount,c=o.node(-1),u=o.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?T.empty:T.from(i))))return!1;let d=o.pos,f=d+s.nodeSize;return r.step(new Ie(d-(a?1:0),f+(l?1:0),d+1,f-1,new D((a?T.empty:T.from(i.copy(T.empty))).append(l?T.empty:T.from(i.copy(T.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function Xf(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==t);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=t)return!1;if(n){let c=l.lastChild&&l.lastChild.type==a.type,u=T.from(c?t.create():null),d=new D(T.from(t.create(null,T.from(a.type.create(null,u)))),c?3:1,0),f=o.start,p=o.end;n(e.tr.step(new Ie(f-(c?3:1),p,f,p,d,1,!0)).scrollIntoView())}return!0}}function Lo(t){let{state:e,transaction:n}=t,{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),filterTransaction:e.filterTransaction,plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}var Pr=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,s=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...u)=>{let d=l(...u)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){let{rawCommands:r,editor:i,state:o}=this,{view:s}=i,a=[],l=!!e,c=e||o.tr,u=()=>(!l&&n&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(c),a.every(f=>f===!0)),d={...Object.fromEntries(Object.entries(r).map(([f,p])=>[f,(...g)=>{let m=this.buildProps(c,n),y=p(...g)(m);return a.push(y),d}])),run:u};return d}createCan(e){let{rawCommands:n,state:r}=this,i=!1,o=e||r.tr,s=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([l,c])=>[l,(...u)=>c(...u)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,n=!0){let{rawCommands:r,editor:i,state:o}=this,{view:s}=i,a={tr:e,editor:i,view:s,state:Lo({state:o,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([l,c])=>[l,(...u)=>c(...u)(a)]))}};return a}},xl=class{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){let r=this.callbacks[e];return r&&r.forEach(i=>i.apply(this,n)),this}off(e,n){let r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(i=>i!==n):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}};function F(t,e,n){return t.config[e]===void 0&&t.parent?F(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?F(t.parent,e,n):null}):t.config[e]}function Po(t){let e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function op(t){let e=[],{nodeExtensions:n,markExtensions:r}=Po(t),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(s=>{let a={name:s.name,options:s.options,storage:s.storage},l=F(s,"addGlobalAttributes",a);if(!l)return;l().forEach(u=>{u.types.forEach(d=>{Object.entries(u.attributes).forEach(([f,p])=>{e.push({type:d,name:f,attribute:{...o,...p}})})})})}),i.forEach(s=>{let a={name:s.name,options:s.options,storage:s.storage},l=F(s,"addAttributes",a);if(!l)return;let c=l();Object.entries(c).forEach(([u,d])=>{let f={...o,...d};typeof f?.default=="function"&&(f.default=f.default()),f?.isRequired&&f?.default===void 0&&delete f.default,e.push({type:s.name,name:u,attribute:f})})}),e}function $e(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function B(...t){return t.filter(e=>!!e).reduce((e,n)=>{let r={...e};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){let a=o?o.split(" "):[],l=r[i]?r[i].split(" "):[],c=a.filter(u=>!l.includes(u));r[i]=[...l,...c].join(" ")}else i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function kl(t,e){return e.filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>B(n,r),{})}function sp(t){return typeof t=="function"}function ee(t,e=void 0,...n){return sp(t)?e?t.bind(e)(...n):t(...n):t}function T0(t={}){return Object.keys(t).length===0&&t.constructor===Object}function _0(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function Zf(t,e){return t.style?t:{...t,getAttrs:n=>{let r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;let i=e.reduce((o,s)=>{let a=s.attribute.parseHTML?s.attribute.parseHTML(n):_0(n.getAttribute(s.name));return a==null?o:{...o,[s.name]:a}},{});return{...r,...i}}}}function Qf(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&T0(n)?!1:n!=null))}function C0(t,e){var n;let r=op(t),{nodeExtensions:i,markExtensions:o}=Po(t),s=(n=i.find(c=>F(c,"topNode")))===null||n===void 0?void 0:n.name,a=Object.fromEntries(i.map(c=>{let u=r.filter(y=>y.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},f=t.reduce((y,M)=>{let x=F(M,"extendNodeSchema",d);return{...y,...x?x(c):{}}},{}),p=Qf({...f,content:ee(F(c,"content",d)),marks:ee(F(c,"marks",d)),group:ee(F(c,"group",d)),inline:ee(F(c,"inline",d)),atom:ee(F(c,"atom",d)),selectable:ee(F(c,"selectable",d)),draggable:ee(F(c,"draggable",d)),code:ee(F(c,"code",d)),defining:ee(F(c,"defining",d)),isolating:ee(F(c,"isolating",d)),attrs:Object.fromEntries(u.map(y=>{var M;return[y.name,{default:(M=y?.attribute)===null||M===void 0?void 0:M.default}]}))}),h=ee(F(c,"parseHTML",d));h&&(p.parseDOM=h.map(y=>Zf(y,u)));let g=F(c,"renderHTML",d);g&&(p.toDOM=y=>g({node:y,HTMLAttributes:kl(y,u)}));let m=F(c,"renderText",d);return m&&(p.toText=m),[c.name,p]})),l=Object.fromEntries(o.map(c=>{let u=r.filter(m=>m.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},f=t.reduce((m,y)=>{let M=F(y,"extendMarkSchema",d);return{...m,...M?M(c):{}}},{}),p=Qf({...f,inclusive:ee(F(c,"inclusive",d)),excludes:ee(F(c,"excludes",d)),group:ee(F(c,"group",d)),spanning:ee(F(c,"spanning",d)),code:ee(F(c,"code",d)),attrs:Object.fromEntries(u.map(m=>{var y;return[m.name,{default:(y=m?.attribute)===null||y===void 0?void 0:y.default}]}))}),h=ee(F(c,"parseHTML",d));h&&(p.parseDOM=h.map(m=>Zf(m,u)));let g=F(c,"renderHTML",d);return g&&(p.toDOM=m=>g({mark:m,HTMLAttributes:kl(m,u)})),[c.name,p]}));return new io({topNode:s,nodes:a,marks:l})}function yl(t,e){return e.nodes[t]||e.marks[t]||null}function ep(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}var O0=(t,e=500)=>{let n="",r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,o,s,a)=>{var l,c;let u=((c=(l=i.type.spec).toText)===null||c===void 0?void 0:c.call(l,{node:i,pos:o,parent:s,index:a}))||i.textContent||"%leaf%";n+=u.slice(0,Math.max(0,r-o))}),n};function Cl(t){return Object.prototype.toString.call(t)==="[object RegExp]"}var Br=class{constructor(e){this.find=e.find,this.handler=e.handler}},A0=(t,e)=>{if(Cl(e))return e.exec(t);let n=e(t);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function El(t){var e;let{editor:n,from:r,to:i,text:o,rules:s,plugin:a}=t,{view:l}=n;if(l.composing)return!1;let c=l.state.doc.resolve(r);if(c.parent.type.spec.code||!((e=c.nodeBefore||c.nodeAfter)===null||e===void 0)&&e.marks.find(f=>f.type.spec.code))return!1;let u=!1,d=O0(c)+o;return s.forEach(f=>{if(u)return;let p=A0(d,f.find);if(!p)return;let h=l.state.tr,g=Lo({state:l.state,transaction:h}),m={from:r-(p[0].length-o.length),to:i},{commands:y,chain:M,can:x}=new Pr({editor:n,state:g});f.handler({state:g,range:m,match:p,commands:y,chain:M,can:x})===null||!h.steps.length||(h.setMeta(a,{transform:h,from:r,to:i,text:o}),l.dispatch(h),u=!0)}),u}function R0(t){let{editor:e,rules:n}=t,r=new ge({state:{init(){return null},apply(i,o){let s=i.getMeta(r);return s||(i.selectionSet||i.docChanged?null:o)}},props:{handleTextInput(i,o,s,a){return El({editor:e,from:o,to:s,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{let{$cursor:o}=i.state.selection;o&&El({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;let{$cursor:s}=i.state.selection;return s?El({editor:e,from:s.pos,to:s.pos,text:` +`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function I0(t){return typeof t=="number"}var Ml=class{constructor(e){this.find=e.find,this.handler=e.handler}},D0=(t,e)=>{if(Cl(e))return[...t.matchAll(e)];let n=e(t);return n?n.map(r=>{let i=[r.text];return i.index=r.index,i.input=t,i.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(r.replaceWith)),i}):[]};function L0(t){let{editor:e,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:a}=t,{commands:l,chain:c,can:u}=new Pr({editor:e,state:n}),d=[];return n.doc.nodesBetween(r,i,(p,h)=>{if(!p.isTextblock||p.type.spec.code)return;let g=Math.max(r,h),m=Math.min(i,h+p.content.size),y=p.textBetween(g-h,m-h,void 0,"\uFFFC");D0(y,o.find).forEach(x=>{if(x.index===void 0)return;let b=g+x.index+1,_=b+x[0].length,w={from:n.tr.mapping.map(b),to:n.tr.mapping.map(_)},I=o.handler({state:n,range:w,match:x,commands:l,chain:c,can:u,pasteEvent:s,dropEvent:a});d.push(I)})}),d.every(p=>p!==null)}function P0(t){let{editor:e,rules:n}=t,r=null,i=!1,o=!1,s=new ClipboardEvent("paste"),a=new DragEvent("drop");return n.map(c=>new ge({view(u){let d=f=>{var p;r=!((p=u.dom.parentElement)===null||p===void 0)&&p.contains(f.target)?u.dom.parentElement:null};return window.addEventListener("dragstart",d),{destroy(){window.removeEventListener("dragstart",d)}}},props:{handleDOMEvents:{drop:(u,d)=>(o=r===u.dom.parentElement,a=d,!1),paste:(u,d)=>{var f;let p=(f=d.clipboardData)===null||f===void 0?void 0:f.getData("text/html");return s=d,i=!!p?.includes("data-pm-slice"),!1}}},appendTransaction:(u,d,f)=>{let p=u[0],h=p.getMeta("uiEvent")==="paste"&&!i,g=p.getMeta("uiEvent")==="drop"&&!o;if(!h&&!g)return;let m=d.doc.content.findDiffStart(f.doc.content),y=d.doc.content.findDiffEnd(f.doc.content);if(!I0(m)||!y||m===y.b)return;let M=f.tr,x=Lo({state:f,transaction:M});if(!(!L0({editor:e,state:x,from:Math.max(m-1,0),to:y.b-1,rule:c,pasteEvent:s,dropEvent:a})||!M.steps.length))return a=new DragEvent("drop"),s=new ClipboardEvent("paste"),M}}))}function B0(t){let e=t.filter((n,r)=>t.indexOf(n)!==r);return[...new Set(e)]}var Nl=class t{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=t.resolve(e),this.schema=C0(this.extensions,n),this.extensions.forEach(r=>{var i;this.editor.extensionStorage[r.name]=r.storage;let o={name:r.name,options:r.options,storage:r.storage,editor:this.editor,type:yl(r.name,this.schema)};r.type==="mark"&&(!((i=ee(F(r,"keepOnSplit",o)))!==null&&i!==void 0)||i)&&this.splittableMarks.push(r.name);let s=F(r,"onBeforeCreate",o);s&&this.editor.on("beforeCreate",s);let a=F(r,"onCreate",o);a&&this.editor.on("create",a);let l=F(r,"onUpdate",o);l&&this.editor.on("update",l);let c=F(r,"onSelectionUpdate",o);c&&this.editor.on("selectionUpdate",c);let u=F(r,"onTransaction",o);u&&this.editor.on("transaction",u);let d=F(r,"onFocus",o);d&&this.editor.on("focus",d);let f=F(r,"onBlur",o);f&&this.editor.on("blur",f);let p=F(r,"onDestroy",o);p&&this.editor.on("destroy",p)})}static resolve(e){let n=t.sort(t.flatten(e)),r=B0(n.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{let r={name:n.name,options:n.options,storage:n.storage},i=F(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(e){return e.sort((r,i)=>{let o=F(r,"priority")||100,s=F(i,"priority")||100;return o>s?-1:o{let r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:yl(n.name,this.schema)},i=F(n,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){let{editor:e}=this,n=t.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(s=>{let a={name:s.name,options:s.options,storage:s.storage,editor:e,type:yl(s.name,this.schema)},l=[],c=F(s,"addKeyboardShortcuts",a),u={};if(s.type==="mark"&&s.config.exitable&&(u.ArrowRight=()=>we.handleExit({editor:e,mark:s})),c){let g=Object.fromEntries(Object.entries(c()).map(([m,y])=>[m,()=>y({editor:e})]));u={...u,...g}}let d=Ff(u);l.push(d);let f=F(s,"addInputRules",a);ep(s,e.options.enableInputRules)&&f&&r.push(...f());let p=F(s,"addPasteRules",a);ep(s,e.options.enablePasteRules)&&p&&i.push(...p());let h=F(s,"addProseMirrorPlugins",a);if(h){let g=h();l.push(...g)}return l}).flat();return[R0({editor:e,rules:r}),...P0({editor:e,rules:i}),...o]}get attributes(){return op(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:n}=Po(this.extensions);return Object.fromEntries(n.filter(r=>!!F(r,"addNodeView")).map(r=>{let i=this.attributes.filter(l=>l.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:e,type:$e(r.name,this.schema)},s=F(r,"addNodeView",o);if(!s)return[];let a=(l,c,u,d)=>{let f=kl(l,i);return s()({editor:e,node:l,getPos:u,decorations:d,HTMLAttributes:f,extension:r})};return[r.name,a]}))}};function F0(t){return Object.prototype.toString.call(t).slice(8,-1)}function wl(t){return F0(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function Bo(t,e){let n={...t};return wl(t)&&wl(e)&&Object.keys(e).forEach(r=>{wl(e[r])?r in t?n[r]=Bo(t[r],e[r]):Object.assign(n,{[r]:e[r]}):Object.assign(n,{[r]:e[r]})}),n}var Ne=class t{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ee(F(this,"addOptions",{name:this.name}))),this.storage=ee(F(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new t(e)}configure(e={}){let n=this.extend();return n.options=Bo(this.options,e),n.storage=ee(F(n,"addStorage",{name:n.name,options:n.options})),n}extend(e={}){let n=new t(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=ee(F(n,"addOptions",{name:n.name})),n.storage=ee(F(n,"addStorage",{name:n.name,options:n.options})),n}};function ap(t,e,n){let{from:r,to:i}=e,{blockSeparator:o=` + +`,textSerializers:s={}}=n||{},a="",l=!0;return t.nodesBetween(r,i,(c,u,d,f)=>{var p;let h=s?.[c.type.name];h?(c.isBlock&&!l&&(a+=o,l=!0),d&&(a+=h({node:c,pos:u,parent:d,index:f,range:e}))):c.isText?(a+=(p=c?.text)===null||p===void 0?void 0:p.slice(Math.max(r,u)-u,i-u),l=!1):c.isBlock&&!l&&(a+=o,l=!0)}),a}function lp(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}var H0=Ne.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new ge({key:new ve("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{let{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(u=>u.$from.pos)),a=Math.max(...o.map(u=>u.$to.pos)),l=lp(n);return ap(r,{from:s,to:a},{textSerializers:l})}}})]}}),z0=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window?.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),$0=(t=!1)=>({commands:e})=>e.setContent("",t),U0=()=>({state:t,tr:e,dispatch:n})=>{let{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{t.doc.nodesBetween(o.pos,s.pos,(a,l)=>{if(a.type.isText)return;let{doc:c,mapping:u}=e,d=c.resolve(u.map(l)),f=c.resolve(u.map(l+a.nodeSize)),p=d.blockRange(f);if(!p)return;let h=rn(p);if(a.type.isTextblock){let{defaultType:g}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(p.start,g)}(h||h===0)&&e.lift(p,h)})}),!0},K0=t=>e=>t(e),W0=()=>({state:t,dispatch:e})=>fl(t,e),V0=(t,e)=>({editor:n,tr:r})=>{let{state:i}=n,o=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);let s=r.mapping.map(e);return r.insert(s,o.content),r.setSelection(new K(r.doc.resolve(s-1))),!0},G0=()=>({tr:t,dispatch:e})=>{let{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;let i=t.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){let a=i.before(o),l=i.after(o);t.delete(a,l).scrollIntoView()}return!0}return!1},q0=t=>({tr:e,state:n,dispatch:r})=>{let i=$e(t,n.schema),o=e.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){let l=o.before(s),c=o.after(s);e.delete(l,c).scrollIntoView()}return!0}return!1},j0=t=>({tr:e,dispatch:n})=>{let{from:r,to:i}=t;return n&&e.delete(r,i),!0},Y0=()=>({state:t,dispatch:e})=>Oo(t,e),J0=()=>({commands:t})=>t.keyboardShortcut("Enter"),X0=()=>({state:t,dispatch:e})=>dl(t,e);function Ro(t,e,n={strict:!0}){let r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:Cl(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function Tl(t,e,n={}){return t.find(r=>r.type===e&&Ro(r.attrs,n))}function Z0(t,e,n={}){return!!Tl(t,e,n)}function Ol(t,e,n={}){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if(t.parentOffset===r.offset&&r.offset!==0&&(r=t.parent.childBefore(t.parentOffset)),!r.node)return;let i=Tl([...r.node.marks],e,n);if(!i)return;let o=r.index,s=t.start()+r.offset,a=o+1,l=s+r.node.nodeSize;for(Tl([...r.node.marks],e,n);o>0&&i.isInSet(t.parent.child(o-1).marks);)o-=1,s-=t.parent.child(o).nodeSize;for(;a({tr:n,state:r,dispatch:i})=>{let o=Sn(t,r.schema),{doc:s,selection:a}=n,{$from:l,from:c,to:u}=a;if(i){let d=Ol(l,o,e);if(d&&d.from<=c&&d.to>=u){let f=K.create(s,d.from,d.to);n.setSelection(f)}}return!0},ew=t=>e=>{let n=typeof t=="function"?t(e):t;for(let r=0;r({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};let s=()=>{Al()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e?.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(o&&t===null&&!Fo(n.state.selection))return s(),!0;let a=cp(i.doc,t)||n.state.selection,l=n.state.selection.eq(a);return o&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},nw=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),rw=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e);function tp(t){let e=`${t}`;return new window.DOMParser().parseFromString(e,"text/html").body}function Io(t,e,n){if(n={slice:!0,parseOptions:{},...n},typeof t=="object"&&t!==null)try{return Array.isArray(t)&&t.length>0?T.fromArray(t.map(r=>e.nodeFromJSON(r))):e.nodeFromJSON(t)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",r),Io("",e,n)}if(typeof t=="string"){let r=$n.fromSchema(e);return n.slice?r.parseSlice(tp(t),n.parseOptions).content:r.parse(tp(t),n.parseOptions)}return Io("",e,n)}function iw(t,e,n){let r=t.steps.length-1;if(r{s===0&&(s=u)}),t.setSelection(V.near(t.doc.resolve(s),n))}var ow=t=>t.toString().startsWith("<"),sw=(t,e,n)=>({tr:r,dispatch:i,editor:o})=>{if(i){n={parseOptions:{},updateSelection:!0,...n};let s=Io(e,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if(s.toString()==="<>")return!0;let{from:a,to:l}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},c=!0,u=!0;if((ow(s)?s:[s]).forEach(f=>{f.check(),c=c?f.isText&&f.marks.length===0:!1,u=u?f.isBlock:!1}),a===l&&u){let{parent:f}=r.doc.resolve(a);f.isTextblock&&!f.type.spec.code&&!f.childCount&&(a-=1,l+=1)}c?Array.isArray(e)?r.insertText(e.map(f=>f.text||"").join(""),a,l):typeof e=="object"&&e&&e.text?r.insertText(e.text,a,l):r.insertText(e,a,l):r.replaceWith(a,l,s),n.updateSelection&&iw(r,r.steps.length-1,-1)}return!0},aw=()=>({state:t,dispatch:e})=>Uf(t,e),lw=()=>({state:t,dispatch:e})=>Kf(t,e),cw=()=>({state:t,dispatch:e})=>ol(t,e),uw=()=>({state:t,dispatch:e})=>al(t,e),dw=()=>({tr:t,state:e,dispatch:n})=>{try{let r=Nr(e.doc,e.selection.$from.pos,-1);return r==null?!1:(t.join(r,2),n&&n(t),!0)}catch{return!1}},fw=()=>({state:t,dispatch:e,tr:n})=>{try{let r=Nr(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}};function Ho(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function pw(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let a=0;a({editor:e,view:n,tr:r,dispatch:i})=>{let o=pw(t).split(/-(?!$)/),s=o.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,a))});return l?.steps.forEach(c=>{let u=c.map(r.mapping);u&&i&&r.maybeStep(u)}),!0};function Mi(t,e,n={}){let{from:r,to:i,empty:o}=t.selection,s=e?$e(e,t.schema):null,a=[];t.doc.nodesBetween(r,i,(d,f)=>{if(d.isText)return;let p=Math.max(r,f),h=Math.min(i,f+d.nodeSize);a.push({node:d,from:p,to:h})});let l=i-r,c=a.filter(d=>s?s.name===d.node.type.name:!0).filter(d=>Ro(d.node.attrs,n,{strict:!1}));return o?!!c.length:c.reduce((d,f)=>d+f.to-f.from,0)>=l}var mw=(t,e={})=>({state:n,dispatch:r})=>{let i=$e(t,n.schema);return Mi(n,i,e)?Wf(n,r):!1},gw=()=>({state:t,dispatch:e})=>pl(t,e),bw=t=>({state:e,dispatch:n})=>{let r=$e(t,e.schema);return Jf(r)(e,n)},yw=()=>({state:t,dispatch:e})=>cl(t,e);function zo(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function np(t,e){let n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}var Ew=(t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,a=zo(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(o=$e(t,r.schema)),a==="mark"&&(s=Sn(t,r.schema)),i&&n.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(c,u)=>{o&&o===c.type&&n.setNodeMarkup(u,void 0,np(c.attrs,e)),s&&c.marks.length&&c.marks.forEach(d=>{s===d.type&&n.addMark(u,u+c.nodeSize,s.create(np(d.attrs,e)))})})}),!0):!1},ww=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),vw=()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),Sw=()=>({state:t,dispatch:e})=>sl(t,e),xw=()=>({state:t,dispatch:e})=>ll(t,e),kw=()=>({state:t,dispatch:e})=>Vf(t,e),Mw=()=>({state:t,dispatch:e})=>ml(t,e),Nw=()=>({state:t,dispatch:e})=>hl(t,e);function up(t,e,n={}){return Io(t,e,{slice:!1,parseOptions:n})}var Tw=(t,e=!1,n={})=>({tr:r,editor:i,dispatch:o})=>{let{doc:s}=r,a=up(t,i.schema,n);return o&&r.replaceWith(0,s.content.size,a).setMeta("preventUpdate",!e),!0};function xn(t,e){let n=Sn(e,t.schema),{from:r,to:i,empty:o}=t.selection,s=[];o?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,l=>{s.push(...l.marks)});let a=s.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function dp(t,e){let n=new mn(t);return e.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function Rl(t){for(let e=0;e{e(r)&&n.push({node:r,pos:i})}),n}function fp(t,e,n){let r=[];return t.nodesBetween(e.from,e.to,(i,o)=>{n(i)&&r.push({node:i,pos:o})}),r}function Il(t,e){for(let n=t.depth;n>0;n-=1){let r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function er(t){return e=>Il(e.$from,t)}function _w(t,e){let n=tn.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function Cw(t,e){let n={from:0,to:t.content.size};return ap(t,n,e)}function Ow(t,e){let n=$e(e,t.schema),{from:r,to:i}=t.selection,o=[];t.doc.nodesBetween(r,i,a=>{o.push(a)});let s=o.reverse().find(a=>a.type.name===n.name);return s?{...s.attrs}:{}}function Dl(t,e){let n=zo(typeof e=="string"?e:e.name,t.schema);return n==="node"?Ow(t,e):n==="mark"?xn(t,e):{}}function Aw(t,e=JSON.stringify){let n={};return t.filter(r=>{let i=e(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function Rw(t){let e=Aw(t);return e.length===1?e:e.filter((n,r)=>!e.filter((o,s)=>s!==r).some(o=>n.oldRange.from>=o.oldRange.from&&n.oldRange.to<=o.oldRange.to&&n.newRange.from>=o.newRange.from&&n.newRange.to<=o.newRange.to))}function pp(t){let{mapping:e,steps:n}=t,r=[];return e.maps.forEach((i,o)=>{let s=[];if(i.ranges.length)i.forEach((a,l)=>{s.push({from:a,to:l})});else{let{from:a,to:l}=n[o];if(a===void 0||l===void 0)return;s.push({from:a,to:l})}s.forEach(({from:a,to:l})=>{let c=e.slice(o).map(a,-1),u=e.slice(o).map(l),d=e.invert().map(c,-1),f=e.invert().map(u);r.push({oldRange:{from:d,to:f},newRange:{from:c,to:u}})})}),Rw(r)}function $o(t,e,n){let r=[];return t===e?n.resolve(t).marks().forEach(i=>{let o=n.resolve(t-1),s=Ol(o,i.type);s&&r.push({mark:i,...s})}):n.nodesBetween(t,e,(i,o)=>{r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}function Ao(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{let i=t.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function _l(t,e,n={}){let{empty:r,ranges:i}=t.selection,o=e?Sn(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(d=>o?o.name===d.type.name:!0).find(d=>Ro(d.attrs,n,{strict:!1}));let s=0,a=[];if(i.forEach(({$from:d,$to:f})=>{let p=d.pos,h=f.pos;t.doc.nodesBetween(p,h,(g,m)=>{if(!g.isText&&!g.marks.length)return;let y=Math.max(p,m),M=Math.min(h,m+g.nodeSize),x=M-y;s+=x,a.push(...g.marks.map(b=>({mark:b,from:y,to:M})))})}),s===0)return!1;let l=a.filter(d=>o?o.name===d.mark.type.name:!0).filter(d=>Ro(d.mark.attrs,n,{strict:!1})).reduce((d,f)=>d+f.to-f.from,0),c=a.filter(d=>o?d.mark.type!==o&&d.mark.type.excludes(o):!0).reduce((d,f)=>d+f.to-f.from,0);return(l>0?l+c:l)>=s}function Bt(t,e,n={}){if(!e)return Mi(t,null,n)||_l(t,null,n);let r=zo(e,t.schema);return r==="node"?Mi(t,e,n):r==="mark"?_l(t,e,n):!1}function rp(t,e){let{nodeExtensions:n}=Po(e),r=n.find(s=>s.name===t);if(!r)return!1;let i={name:r.name,options:r.options,storage:r.storage},o=ee(F(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function Iw(t){var e;let n=(e=t.type.createAndFill())===null||e===void 0?void 0:e.toJSON(),r=t.toJSON();return JSON.stringify(n)===JSON.stringify(r)}function hp(t){return t instanceof Y}function Uo(t,e,n){let i=t.state.doc.content.size,o=cn(e,0,i),s=cn(n,0,i),a=t.coordsAtPos(o),l=t.coordsAtPos(s,-1),c=Math.min(a.top,l.top),u=Math.max(a.bottom,l.bottom),d=Math.min(a.left,l.left),f=Math.max(a.right,l.right),p=f-d,h=u-c,y={top:c,bottom:u,left:d,right:f,width:p,height:h,x:d,y:c};return{...y,toJSON:()=>y}}function Dw(t,e,n){var r;let{selection:i}=e,o=null;if(Fo(i)&&(o=i.$cursor),o){let a=(r=t.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(a)||!a.some(l=>l.type.excludes(n))}let{ranges:s}=i;return s.some(({$from:a,$to:l})=>{let c=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(u,d,f)=>{if(c)return!1;if(u.isInline){let p=!f||f.type.allowsMarkType(n),h=!!n.isInSet(u.marks)||!u.marks.some(g=>g.type.excludes(n));c=p&&h}return!c}),c})}var Lw=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let{selection:o}=n,{empty:s,ranges:a}=o,l=Sn(t,r.schema);if(i)if(s){let c=xn(r,l);n.addStoredMark(l.create({...c,...e}))}else a.forEach(c=>{let u=c.$from.pos,d=c.$to.pos;r.doc.nodesBetween(u,d,(f,p)=>{let h=Math.max(p,u),g=Math.min(p+f.nodeSize,d);f.marks.find(y=>y.type===l)?f.marks.forEach(y=>{l===y.type&&n.addMark(h,g,l.create({...y.attrs,...e}))}):n.addMark(h,g,l.create(e))})});return Dw(r,n,l)},Pw=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),Bw=(t,e={})=>({state:n,dispatch:r,chain:i})=>{let o=$e(t,n.schema);return o.isTextblock?i().command(({commands:s})=>gl(o,e)(n)?!0:s.clearNodes()).command(({state:s})=>gl(o,e)(s,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},Fw=t=>({tr:e,dispatch:n})=>{if(n){let{doc:r}=e,i=cn(t,0,r.content.size),o=Y.create(r,i);e.setSelection(o)}return!0},Hw=t=>({tr:e,dispatch:n})=>{if(n){let{doc:r}=e,{from:i,to:o}=typeof t=="number"?{from:t,to:t}:t,s=K.atStart(r).from,a=K.atEnd(r).to,l=cn(i,s,a),c=cn(o,s,a),u=K.create(r,l,c);e.setSelection(u)}return!0},zw=t=>({state:e,dispatch:n})=>{let r=$e(t,e.schema);return Xf(r)(e,n)};function ip(t,e){let n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){let r=n.filter(i=>e?.includes(i.type.name));t.tr.ensureMarks(r)}}var $w=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{let{selection:o,doc:s}=e,{$from:a,$to:l}=o,c=i.extensionManager.attributes,u=Ao(c,a.node().type.name,a.node().attrs);if(o instanceof Y&&o.node.isBlock)return!a.parentOffset||!St(s,a.pos)?!1:(r&&(t&&ip(n,i.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(r){let d=l.parentOffset===l.parent.content.size;o instanceof K&&e.deleteSelection();let f=a.depth===0?void 0:Rl(a.node(-1).contentMatchAt(a.indexAfter(-1))),p=d&&f?[{type:f,attrs:u}]:void 0,h=St(e.doc,e.mapping.map(a.pos),1,p);if(!p&&!h&&St(e.doc,e.mapping.map(a.pos),1,f?[{type:f}]:void 0)&&(h=!0,p=f?[{type:f,attrs:u}]:void 0),h&&(e.split(e.mapping.map(a.pos),1,p),f&&!d&&!a.parentOffset&&a.parent.type!==f)){let g=e.mapping.map(a.before()),m=e.doc.resolve(g);a.node(-1).canReplaceWith(m.index(),m.index()+1,f)&&e.setNodeMarkup(e.mapping.map(a.before()),f)}t&&ip(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},Uw=t=>({tr:e,state:n,dispatch:r,editor:i})=>{var o;let s=$e(t,n.schema),{$from:a,$to:l}=n.selection,c=n.selection.node;if(c&&c.isBlock||a.depth<2||!a.sameParent(l))return!1;let u=a.node(-1);if(u.type!==s)return!1;let d=i.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let m=T.empty,y=a.index(-1)?1:a.index(-2)?2:3;for(let I=a.depth-y;I>=a.depth-3;I-=1)m=T.from(a.node(I).copy(m));let M=a.indexAfter(-1){if(w>-1)return!1;I.isTextblock&&I.content.size===0&&(w=U+1)}),w>-1&&e.setSelection(K.near(e.doc.resolve(w))),e.scrollIntoView()}return!0}let f=l.pos===a.end()?u.contentMatchAt(0).defaultType:null,p=Ao(d,u.type.name,u.attrs),h=Ao(d,a.node().type.name,a.node().attrs);e.delete(a.pos,l.pos);let g=f?[{type:s,attrs:p},{type:f,attrs:h}]:[{type:s,attrs:p}];if(!St(e.doc,a.pos,2))return!1;if(r){let{selection:m,storedMarks:y}=n,{splittableMarks:M}=i.extensionManager,x=y||m.$to.parentOffset&&m.$from.marks();if(e.split(a.pos,2,g).scrollIntoView(),!x||!r)return!0;let b=x.filter(_=>M.includes(_.type.name));e.ensureMarks(b)}return!0},vl=(t,e)=>{let n=er(s=>s.type===e)(t.selection);if(!n)return!0;let r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let i=t.doc.nodeAt(r);return n.node.type===i?.type&&Dt(t.doc,n.pos)&&t.join(n.pos),!0},Sl=(t,e)=>{let n=er(s=>s.type===e)(t.selection);if(!n)return!0;let r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let i=t.doc.nodeAt(r);return n.node.type===i?.type&&Dt(t.doc,r)&&t.join(r),!0},Kw=(t,e,n,r={})=>({editor:i,tr:o,state:s,dispatch:a,chain:l,commands:c,can:u})=>{let{extensions:d,splittableMarks:f}=i.extensionManager,p=$e(t,s.schema),h=$e(e,s.schema),{selection:g,storedMarks:m}=s,{$from:y,$to:M}=g,x=y.blockRange(M),b=m||g.$to.parentOffset&&g.$from.marks();if(!x)return!1;let _=er(w=>rp(w.type.name,d))(g);if(x.depth>=1&&_&&x.depth-_.depth<=1){if(_.node.type===p)return c.liftListItem(h);if(rp(_.node.type.name,d)&&p.validContent(_.node.content)&&a)return l().command(()=>(o.setNodeMarkup(_.pos,p),!0)).command(()=>vl(o,p)).command(()=>Sl(o,p)).run()}return!n||!b||!a?l().command(()=>u().wrapInList(p,r)?!0:c.clearNodes()).wrapInList(p,r).command(()=>vl(o,p)).command(()=>Sl(o,p)).run():l().command(()=>{let w=u().wrapInList(p,r),I=b.filter(U=>f.includes(U.type.name));return o.ensureMarks(I),w?!0:c.clearNodes()}).wrapInList(p,r).command(()=>vl(o,p)).command(()=>Sl(o,p)).run()},Ww=(t,e={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:o=!1}=n,s=Sn(t,r.schema);return _l(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},Vw=(t,e,n={})=>({state:r,commands:i})=>{let o=$e(t,r.schema),s=$e(e,r.schema);return Mi(r,o,n)?i.setNode(s):i.setNode(o,n)},Gw=(t,e={})=>({state:n,commands:r})=>{let i=$e(t,n.schema);return Mi(n,i,e)?r.lift(i):r.wrapIn(i,e)},qw=()=>({state:t,dispatch:e})=>{let n=t.plugins;for(let r=0;r=0;l-=1)s.step(a.steps[l].invert(a.docs[l]));if(o.text){let l=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,t.schema.text(o.text,l))}else s.delete(o.from,o.to)}return!0}}return!1},jw=()=>({tr:t,dispatch:e})=>{let{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(o=>{t.removeMark(o.$from.pos,o.$to.pos)}),!0},Yw=(t,e={})=>({tr:n,state:r,dispatch:i})=>{var o;let{extendEmptyMarkRange:s=!1}=e,{selection:a}=n,l=Sn(t,r.schema),{$from:c,empty:u,ranges:d}=a;if(!i)return!0;if(u&&s){let{from:f,to:p}=a,h=(o=c.marks().find(m=>m.type===l))===null||o===void 0?void 0:o.attrs,g=Ol(c,l,h);g&&(f=g.from,p=g.to),n.removeMark(f,p,l)}else d.forEach(f=>{n.removeMark(f.$from.pos,f.$to.pos,l)});return n.removeStoredMark(l),!0},Jw=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,a=zo(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(o=$e(t,r.schema)),a==="mark"&&(s=Sn(t,r.schema)),i&&n.selection.ranges.forEach(l=>{let c=l.$from.pos,u=l.$to.pos;r.doc.nodesBetween(c,u,(d,f)=>{o&&o===d.type&&n.setNodeMarkup(f,void 0,{...d.attrs,...e}),s&&d.marks.length&&d.marks.forEach(p=>{if(s===p.type){let h=Math.max(f,c),g=Math.min(f+d.nodeSize,u);n.addMark(h,g,s.create({...p.attrs,...e}))}})})}),!0):!1},Xw=(t,e={})=>({state:n,dispatch:r})=>{let i=$e(t,n.schema);return jf(i,e)(n,r)},Zw=(t,e={})=>({state:n,dispatch:r})=>{let i=$e(t,n.schema);return Yf(i,e)(n,r)},Qw=Object.freeze({__proto__:null,blur:z0,clearContent:$0,clearNodes:U0,command:K0,createParagraphNear:W0,cut:V0,deleteCurrentNode:G0,deleteNode:q0,deleteRange:j0,deleteSelection:Y0,enter:J0,exitCode:X0,extendMarkRange:Q0,first:ew,focus:tw,forEach:nw,insertContent:rw,insertContentAt:sw,joinUp:aw,joinDown:lw,joinBackward:cw,joinForward:uw,joinItemBackward:dw,joinItemForward:fw,keyboardShortcut:hw,lift:mw,liftEmptyBlock:gw,liftListItem:bw,newlineInCode:yw,resetAttributes:Ew,scrollIntoView:ww,selectAll:vw,selectNodeBackward:Sw,selectNodeForward:xw,selectParentNode:kw,selectTextblockEnd:Mw,selectTextblockStart:Nw,setContent:Tw,setMark:Lw,setMeta:Pw,setNode:Bw,setNodeSelection:Fw,setTextSelection:Hw,sinkListItem:zw,splitBlock:$w,splitListItem:Uw,toggleList:Kw,toggleMark:Ww,toggleNode:Vw,toggleWrap:Gw,undoInputRule:qw,unsetAllMarks:jw,unsetMark:Yw,updateAttributes:Jw,wrapIn:Xw,wrapInList:Zw}),ev=Ne.create({name:"commands",addCommands(){return{...Qw}}}),tv=Ne.create({name:"editable",addProseMirrorPlugins(){return[new ge({key:new ve("editable"),props:{editable:()=>this.editor.options.editable}})]}}),nv=Ne.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:t}=this;return[new ge({key:new ve("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;let r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;let r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),rv=Ne.create({name:"keymap",addKeyboardShortcuts(){let t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{let{selection:l,doc:c}=a,{empty:u,$anchor:d}=l,{pos:f,parent:p}=d,h=d.parent.isTextblock?a.doc.resolve(f-1):d,g=h.parent.type.spec.isolating,m=d.pos-d.parentOffset,y=g&&h.parent.childCount===1?m===d.pos:V.atStart(c).from===f;return!u||!y||!p.type.isTextblock||p.textContent.length?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Al()||Ho()?o:i},addProseMirrorPlugins(){return[new ge({key:new ve("clearDocument"),appendTransaction:(t,e,n)=>{if(!(t.some(h=>h.docChanged)&&!e.doc.eq(n.doc)))return;let{empty:i,from:o,to:s}=e.selection,a=V.atStart(e.doc).from,l=V.atEnd(e.doc).to;if(i||!(o===a&&s===l)||!(n.doc.textBetween(0,n.doc.content.size," "," ").length===0))return;let d=n.tr,f=Lo({state:n,transaction:d}),{commands:p}=new Pr({editor:this.editor,state:f});if(p.clearNodes(),!!d.steps.length)return d}})]}}),iv=Ne.create({name:"tabindex",addProseMirrorPlugins(){return[new ge({key:new ve("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}}),ov=Object.freeze({__proto__:null,ClipboardTextSerializer:H0,Commands:ev,Editable:tv,FocusEvents:nv,Keymap:rv,Tabindex:iv}),sv=`.ProseMirror { position: relative; } @@ -84,17 +84,17 @@ img.ProseMirror-separator { .tippy-box[data-animation=fade][data-state=hidden] { opacity: 0 -}`;function ov(t,e,n){let r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:""}]`);if(r!==null)return r;let i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute(`data-tiptap-style${n?`-${n}`:""}`,""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}var zo=class extends Tl{constructor(e={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=ov(iv,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,n=!0){this.setOptions({editable:e}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,n){let r=sp(n)?n(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:r});this.view.updateState(i)}unregisterPlugin(e){if(this.isDestroyed)return;let n=typeof e=="string"?`${e}$`:e.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(i=>!i.key.startsWith(n))});this.view.updateState(r)}createExtensionManager(){let n=[...this.options.enableCoreExtensions?Object.values(rv):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(r?.type));this.extensionManager=new Ln(n,this)}createCommandManager(){this.commandManager=new jr({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){let e=dp(this.options.content,this.schema,this.options.parseOptions),n=cp(e,this.options.autofocus);this.view=new Oo(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:mn.create({doc:e,selection:n||void 0})});let r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews();let i=this.view.dom;i.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;let n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(s=>{var a;return(a=this.capturedTransaction)===null||a===void 0?void 0:a.step(s)});return}let n=this.state.apply(e),r=!this.state.selection.eq(n.selection);this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});let i=e.getMeta("focus"),o=e.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:e}),o&&this.emit("blur",{editor:this,event:o.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return Pl(this.state,e)}isActive(e,n){let r=typeof e=="string"?e:null,i=typeof e=="string"?n:e;return $t(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Tw(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:n=` +}`;function av(t,e,n){let r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:""}]`);if(r!==null)return r;let i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute(`data-tiptap-style${n?`-${n}`:""}`,""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}var Do=class extends xl{constructor(e={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=av(sv,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,n=!0){this.setOptions({editable:e}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,n){let r=sp(n)?n(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:r});this.view.updateState(i)}unregisterPlugin(e){if(this.isDestroyed)return;let n=typeof e=="string"?`${e}$`:e.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(i=>!i.key.startsWith(n))});this.view.updateState(r)}createExtensionManager(){let n=[...this.options.enableCoreExtensions?Object.values(ov):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(r?.type));this.extensionManager=new Nl(n,this)}createCommandManager(){this.commandManager=new Pr({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){let e=up(this.options.content,this.schema,this.options.parseOptions),n=cp(e,this.options.autofocus);this.view=new Mo(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:go.create({doc:e,selection:n||void 0})});let r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews(),this.prependClass();let i=this.view.dom;i.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;let n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(s=>{var a;return(a=this.capturedTransaction)===null||a===void 0?void 0:a.step(s)});return}let n=this.state.apply(e),r=!this.state.selection.eq(n.selection);this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});let i=e.getMeta("focus"),o=e.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:e}),o&&this.emit("blur",{editor:this,event:o.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return Dl(this.state,e)}isActive(e,n){let r=typeof e=="string"?e:null,i=typeof e=="string"?n:e;return Bt(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return _w(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:n=` -`,textSerializers:r={}}=e||{};return Nw(this.state.doc,{blockSeparator:n,textSerializers:{...lp(this.schema),...r}})}get isEmpty(){return Aw(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}};function Ot(t){return new Yr({find:t.find,handler:({state:e,range:n,match:r})=>{let i=ee(t.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:o}=e,s=r[r.length-1],a=r[0],l=n.to;if(s){let c=a.search(/\S/),u=n.from+a.indexOf(s),d=u+s.length;if(Pi(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(m=>m===t.type&&m!==p.mark.type)).filter(p=>p.to>u).length)return null;dn.from&&o.delete(n.from+c,u),l=n.from+c+s.length,o.addMark(n.from+c,l,t.type.create(i||{})),o.removeStoredMark(t.type)}}})}function qo(t){return new Yr({find:t.find,handler:({state:e,range:n,match:r})=>{let i=ee(t.getAttributes,void 0,r)||{},{tr:o}=e,s=n.from,a=n.to;if(r[1]){let l=r[0].lastIndexOf(r[1]),c=s+l;c>a?c=a:a=c+r[1].length;let u=r[0][r[0].length-1];o.insertText(u,s+r[0].length-1),o.replaceWith(c,a,t.type.create(i))}else r[0]&&o.replaceWith(s,a,t.type.create(i))}})}function Bi(t){return new Yr({find:t.find,handler:({state:e,range:n,match:r})=>{let i=e.doc.resolve(n.from),o=ee(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,o)}})}function Hn(t){return new Yr({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{let o=ee(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),l=s.doc.resolve(n.from).blockRange(),c=l&&Hr(l,t.type,o);if(!c)return null;if(s.wrap(l,c),t.keepMarks&&t.editor){let{selection:d,storedMarks:f}=e,{splittableMarks:p}=t.editor.extensionManager,h=f||d.$to.parentOffset&&d.$from.marks();if(h){let m=h.filter(g=>p.includes(g.type.name));s.ensureMarks(m)}}if(t.keepAttributes){let d=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(d,o).run()}let u=s.doc.resolve(n.from-1).nodeBefore;u&&u.type===t.type&&Ft(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,u))&&s.join(n.from-1)}})}var be=class{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ee(H(this,"addOptions",{name:this.name}))),this.storage=ee(H(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new be(e)}configure(e={}){let n=this.extend();return n.options=Ko(this.options,e),n.storage=ee(H(n,"addStorage",{name:n.name,options:n.options})),n}extend(e={}){let n=new be(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=ee(H(n,"addOptions",{name:n.name})),n.storage=ee(H(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){let{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){let s=i.marks();if(!!!s.find(c=>c?.type.name===n.name))return!1;let l=s.find(c=>c?.type.name===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}},z=class{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ee(H(this,"addOptions",{name:this.name}))),this.storage=ee(H(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new z(e)}configure(e={}){let n=this.extend();return n.options=Ko(this.options,e),n.storage=ee(H(n,"addStorage",{name:n.name,options:n.options})),n}extend(e={}){let n=new z(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=ee(H(n,"addOptions",{name:n.name})),n.storage=ee(H(n,"addStorage",{name:n.name,options:n.options})),n}};function yt(t){return new _l({find:t.find,handler:({state:e,range:n,match:r})=>{let i=ee(t.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:o}=e,s=r[r.length-1],a=r[0],l=n.to;if(s){let c=a.search(/\S/),u=n.from+a.indexOf(s),d=u+s.length;if(Pi(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(m=>m===t.type&&m!==p.mark.type)).filter(p=>p.to>u).length)return null;dn.from&&o.delete(n.from+c,u),l=n.from+c+s.length,o.addMark(n.from+c,l,t.type.create(i||{})),o.removeStoredMark(t.type)}}})}var sv=/^\s*>\s$/,gp=z.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",B(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Hn({find:sv,type:this.type})]}});var av=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,lv=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,cv=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,uv=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,bp=be.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",B(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Ot({find:av,type:this.type}),Ot({find:cv,type:this.type})]},addPasteRules(){return[yt({find:lv,type:this.type}),yt({find:uv,type:this.type})]}});var dv=z.create({name:"listItem",addOptions(){return{HTMLAttributes:{}}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",B(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),yp=be.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",B(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{let n=Bn(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),Ep=/^\s*([-+*])\s$/,wp=z.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",B(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(dv.name,this.editor.getAttributes(yp.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Hn({find:Ep,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Hn({find:Ep,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(yp.name),editor:this.editor})),[t]}});var fv=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,pv=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,vp=be.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",B(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Ot({find:fv,type:this.type})]},addPasteRules(){return[yt({find:pv,type:this.type})]}});var Sp=be.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",B(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{let n=Bn(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}});var xp=Me.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;return(e=t.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}});var kp=z.create({name:"doc",topNode:!0,content:"block+"});function Mp(t={}){return new me({view(e){return new Bl(e,t)}})}var Bl=class{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=s=>{this[i](s)};return e.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r;if(n){let a=e.nodeBefore,l=e.nodeAfter;if(a||l){let c=this.editorView.nodeDOM(this.cursorPos-(a?a.nodeSize:0));if(c){let u=c.getBoundingClientRect(),d=a?u.bottom:u.top;a&&l&&(d=(d+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:u.left,right:u.right,top:d-this.width/2,bottom:d+this.width/2}}}}if(!r){let a=this.editorView.coordsAtPos(this.cursorPos);r={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let o,s;if(!i||i==document.body&&getComputedStyle(i).position=="static")o=-pageXOffset,s=-pageYOffset;else{let a=i.getBoundingClientRect();o=a.left-i.scrollLeft,s=a.top-i.scrollTop}this.element.style.left=r.left-o+"px",this.element.style.top=r.top-s+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!o){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=So(this.editorView.state.doc,s,this.editorView.dragging.slice);a!=null&&(s=a)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}};var Tp=Me.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[Mp(this.options)]}});var Ne=class extends V{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return Ne.valid(r)?new Ne(r):V.near(r)}content(){return R.empty}eq(e){return e instanceof Ne&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Ne(e.resolve(n.pos))}getBookmark(){return new Hi(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!hv(e)||!mv(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&Ne.valid(e))return e;let i=e.pos,o=null;for(let s=e.depth;;s--){let a=e.node(s);if(n>0?e.indexAfter(s)0){o=a.child(n>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;i+=n;let l=e.doc.resolve(i);if(Ne.valid(l))return l}for(;;){let s=n>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!G.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*n),r=!1;continue e}break}o=s,i+=n;let a=e.doc.resolve(i);if(Ne.valid(a))return a}return null}}};Ne.prototype.visible=!1;Ne.findFrom=Ne.findGapCursorFrom;V.jsonID("gapcursor",Ne);var Hi=class{constructor(e){this.pos=e}map(e){return new Hi(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return Ne.valid(n)?new Ne(n):V.near(n)}};function hv(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function mv(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function Np(){return new me({props:{decorations:Ev,createSelectionBetween(t,e,n){return e.pos==n.pos&&Ne.valid(n)?new Ne(n):null},handleClick:bv,handleKeyDown:gv,handleDOMEvents:{beforeinput:yv}}})}var gv=Di({ArrowLeft:jo("horiz",-1),ArrowRight:jo("horiz",1),ArrowUp:jo("vert",-1),ArrowDown:jo("vert",1)});function jo(t,e){let n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,o){let s=r.selection,a=e>0?s.$to:s.$from,l=s.empty;if(s instanceof $){if(!o.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let c=Ne.findGapCursorFrom(a,e,l);return c?(i&&i(r.tr.setSelection(new Ne(c))),!0):!1}}function bv(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!Ne.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&G.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Ne(r))),!0)}function yv(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Ne))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=k.empty;for(let s=r.length-1;s>=0;s--)i=k.from(r[s].createAndFill(null,i));let o=t.state.tr.replace(n.pos,n.pos,new R(i,0,0));return o.setSelection($.near(o.doc.resolve(n.pos+1))),t.dispatch(o),!1}function Ev(t){if(!(t.selection instanceof Ne))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Se.create(t.doc,[De.widget(t.selection.head,e,{key:"gapcursor"})])}var _p=Me.create({name:"gapCursor",addProseMirrorPlugins(){return[Np()]},extendNodeSchema(t){var e;let n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=ee(H(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}});var Cp=z.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",B(this.options.HTMLAttributes,t)]},renderText(){return` -`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{let{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;let{keepMarks:s}=this.options,{splittableMarks:a}=r.extensionManager,l=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&l&&s){let d=l.filter(f=>a.includes(f.type.name));c.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}});var Op=z.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,B(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>Bi({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var Yo=200,Je=function(){};Je.prototype.append=function(e){return e.length?(e=Je.from(e),!this.length&&e||e.length=n?Je.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};Je.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};Je.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};Je.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},n,r),i};Je.from=function(e){return e instanceof Je?e:e&&e.length?new Ap(e):Je.empty};var Ap=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,s,a){for(var l=o;l=s;l--)if(i(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Yo)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Yo)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Je);Je.empty=new Ap([]);var wv=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return ra&&this.right.forEachInner(r,Math.max(i-a,0),Math.min(this.length,o)-a,s+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(r,i-a,Math.max(o,a)-a,s+a)===!1||o=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(Je),Hl=Je;var vv=500,kt=class{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,a,l,c=[],u=[];return this.items.forEach((d,f)=>{if(!d.step){i||(i=this.remapping(r,f+1),o=i.maps.length),o--,u.push(d);return}if(i){u.push(new At(d.map));let p=d.step.map(i.slice(o)),h;p&&s.maybeStep(p).doc&&(h=s.mapping.maps[s.mapping.maps.length-1],c.push(new At(h,void 0,void 0,c.length+u.length))),o--,h&&i.appendMap(h,o)}else s.maybeStep(d.step);if(d.selection)return a=i?d.selection.map(i.slice(o)):d.selection,l=new kt(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(e,n,r,i){let o=[],s=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let u=0;uxv&&(a=Sv(a,c),s-=c),new kt(a.append(o),s)}remapping(e,n){let r=new pn;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new kt(this.items.append(e.map(n=>new At(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=e.mapping,s=e.steps.length,a=this.eventCount;this.items.forEach(f=>{f.selection&&a--},i);let l=n;this.items.forEach(f=>{let p=o.getMirror(--l);if(p==null)return;s=Math.min(s,p);let h=o.maps[p];if(f.step){let m=e.steps[p].invert(e.docs[p]),g=f.selection&&f.selection.map(o.slice(l+1,p));g&&a++,r.push(new At(h,m,g))}else r.push(new At(h))},i);let c=[];for(let f=n;fvv&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],o=0;return this.items.forEach((s,a)=>{if(a>=e)i.push(s),s.selection&&o++;else if(s.step){let l=s.step.map(n.slice(r)),c=l&&l.getMap();if(r--,c&&n.appendMap(c,r),l){let u=s.selection&&s.selection.map(n.slice(r));u&&o++;let d=new At(c.invert(),l,u),f,p=i.length-1;(f=i.length&&i[p].merge(d))?i[p]=f:i.push(d)}}else s.map&&r--},this.items.length,0),new kt(Hl.from(i.reverse()),o)}};kt.empty=new kt(Hl.empty,0);function Sv(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}var At=class{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new At(n.getMap().invert(),n,this.selection)}}},on=class{constructor(e,n,r,i,o){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}},xv=20;function kv(t,e,n,r){let i=n.getMeta(Fn),o;if(i)return i.historyState;n.getMeta(Tv)&&(t=new on(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(Fn))return s.getMeta(Fn).redo?new on(t.done.addTransform(n,void 0,r,Jo(e)),t.undone,Rp(n.mapping.maps[n.steps.length-1]),t.prevTime,t.prevComposition):new on(t.done,t.undone.addTransform(n,void 0,r,Jo(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!s&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!Mv(n,t.prevRanges)),c=s?Fl(t.prevRanges,n.mapping):Rp(n.mapping.maps[n.steps.length-1]);return new on(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,Jo(e)),kt.empty,c,n.time,a??t.prevComposition)}else return(o=n.getMeta("rebased"))?new on(t.done.rebased(n,o),t.undone.rebased(n,o),Fl(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new on(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Fl(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function Mv(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let o=0;o=e[o]&&(n=!0)}),n}function Rp(t){let e=[];return t.forEach((n,r,i,o)=>e.push(i,o)),e}function Fl(t,e){if(!t)return null;let n=[];for(let r=0;r{let n=Fn.getState(t);return!n||n.done.eventCount==0?!1:(e&&Dp(n,t,e,!1),!0)},$l=(t,e)=>{let n=Fn.getState(t);return!n||n.undone.eventCount==0?!1:(e&&Dp(n,t,e,!0),!0)};var Pp=Me.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>Ul(t,e),redo:()=>({state:t,dispatch:e})=>$l(t,e)}},addProseMirrorPlugins(){return[Lp(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-\u044F":()=>this.editor.commands.undo(),"Shift-Mod-\u044F":()=>this.editor.commands.redo()}}});var Bp=z.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",B(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t})=>t().insertContent({type:this.name}).command(({tr:e,dispatch:n})=>{var r;if(n){let{$to:i}=e.selection,o=i.end();if(i.nodeAfter)e.setSelection($.create(e.doc,i.pos));else{let s=(r=i.parent.type.contentMatch.defaultType)===null||r===void 0?void 0:r.create();s&&(e.insert(o,s),e.setSelection($.create(e.doc,o)))}e.scrollIntoView()}return!0}).run()}},addInputRules(){return[qo({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}});var Nv=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,_v=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,Cv=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,Ov=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,Hp=be.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",B(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Ot({find:Nv,type:this.type}),Ot({find:Cv,type:this.type})]},addPasteRules(){return[yt({find:_v,type:this.type}),yt({find:Ov,type:this.type})]}});var Kl=z.create({name:"listItem",addOptions(){return{HTMLAttributes:{}}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",B(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}});var Av=z.create({name:"listItem",addOptions(){return{HTMLAttributes:{}}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",B(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Fp=be.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",B(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{let n=Bn(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),zp=/^(\d+)\.\s$/,Up=z.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){let{start:e,...n}=t;return e===1?["ol",B(this.options.HTMLAttributes,n),0]:["ol",B(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Av.name,this.editor.getAttributes(Fp.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Hn({find:zp,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Hn({find:zp,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Fp.name)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}});var Rv=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,Iv=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,$p=be.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",B(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-x":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Ot({find:Rv,type:this.type})]},addPasteRules(){return[yt({find:Iv,type:this.type})]}});var Kp=be.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",B(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}});var Wp=be.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(t){return t!=="super"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sup",B(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}});var Vl,Gl;if(typeof WeakMap<"u"){let t=new WeakMap;Vl=e=>t.get(e),Gl=(e,n)=>(t.set(e,n),n)}else{let t=[],n=0;Vl=r=>{for(let i=0;i(n==10&&(n=0),t[n++]=r,t[n++]=i)}var Ae=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e=n){(o||(o=[])).push({type:"overlong_rowspan",pos:u,n:y-M});break}let b=i+M*e;for(let _=0;_r&&(o+=c.attrs.colspan)}}for(let s=0;s1&&(n=!0)}e==-1?e=o:e!=o&&(e=Math.max(e,o))}return e}function Pv(t,e,n){t.problems||(t.problems=[]);let r={};for(let i=0;i0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function Hv(t){for(let e=t.depth;e>0;e--){let n=t.node(e).type.spec.tableRole;if(n==="cell"||n==="header_cell")return t.node(e)}return null}function Kt(t){let e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function ns(t){let e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;let n=Jr(e.$head)||Fv(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function Fv(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){let r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){let r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function ql(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function zv(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function Jl(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function Qp(t,e,n){let r=t.node(-1),i=Ae.get(r),o=t.start(-1),s=i.nextCell(t.pos-o,e,n);return s==null?null:t.node(0).resolve(o+s)}function pr(t,e,n=1){let r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(i=>i>0)||(r.colwidth=null)),r}function eh(t,e,n=1){let r={...t,colspan:t.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let i=0;ic!=e.pos-i);a.unshift(e.pos-i);let l=a.map(c=>{let u=n.nodeAt(c);if(!u)throw RangeError(`No cell with offset ${c} found`);let d=i+c+1;return new xi(s.resolve(d),s.resolve(d+u.content.size))});super(l[0].$from,l[0].$to,l),this.$anchorCell=t,this.$headCell=e}map(t,e){let n=t.resolve(e.map(this.$anchorCell.pos)),r=t.resolve(e.map(this.$headCell.pos));if(ql(n)&&ql(r)&&Jl(n,r)){let i=this.$anchorCell.node(-1)!=n.node(-1);return i&&this.isRowSelection()?pe.rowSelection(n,r):i&&this.isColSelection()?pe.colSelection(n,r):new pe(n,r)}return $.between(n,r)}content(){let t=this.$anchorCell.node(-1),e=Ae.get(t),n=this.$anchorCell.start(-1),r=e.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},o=[];for(let a=r.top;a0||m>0){let g=p.attrs;if(h>0&&(g=pr(g,0,h)),m>0&&(g=pr(g,g.colspan-m,m)),f.leftr.bottom){let g={...p.attrs,rowspan:Math.min(f.bottom,r.bottom)-Math.max(f.top,r.top)};f.top0)return!1;let n=t+this.$anchorCell.nodeAfter.attrs.rowspan,r=e+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(t,e=t){let n=t.node(-1),r=Ae.get(n),i=t.start(-1),o=r.findCell(t.pos-i),s=r.findCell(e.pos-i),a=t.node(0);return o.top<=s.top?(o.top>0&&(t=a.resolve(i+r.map[o.left])),s.bottom0&&(e=a.resolve(i+r.map[s.left])),o.bottom0)return!1;let o=r+this.$anchorCell.nodeAfter.attrs.colspan,s=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,s)==e.width}eq(t){return t instanceof pe&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,e=t){let n=t.node(-1),r=Ae.get(n),i=t.start(-1),o=r.findCell(t.pos-i),s=r.findCell(e.pos-i),a=t.node(0);return o.left<=s.left?(o.left>0&&(t=a.resolve(i+r.map[o.top*r.width])),s.right0&&(e=a.resolve(i+r.map[s.top*r.width])),o.right{e.push(De.node(r,r+n.nodeSize,{class:"selectedCell"}))}),Se.create(t.doc,e)}function Kv({$from:t,$to:e}){if(t.pos==e.pos||t.pos=0&&!(t.after(i+1)=0&&!(e.before(o+1)>e.start(o));o--,r--);return n==r&&/row|table/.test(t.node(i).type.spec.tableRole)}function Wv({$from:t,$to:e}){let n,r;for(let i=t.depth;i>0;i--){let o=t.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){n=o;break}}for(let i=e.depth;i>0;i--){let o=e.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){r=o;break}}return n!==r&&e.parentOffset===0}function Vv(t,e,n){let r=(e||t).selection,i=(e||t).doc,o,s;if(r instanceof G&&(s=r.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")o=pe.create(i,r.from);else if(s=="row"){let a=i.resolve(r.from+1);o=pe.rowSelection(a,a)}else if(!n){let a=Ae.get(r.node),l=r.from+1,c=l+a.map[a.width*a.height-1];o=pe.create(i,l+1,c)}}else r instanceof $&&Kv(r)?o=$.create(i,r.from):r instanceof $&&Wv(r)&&(o=$.create(i,r.$from.start(),r.$from.end()));return o&&(e||(e=t.tr)).setSelection(o),e}var Gv=new ve("fix-tables");function nh(t,e,n,r){let i=t.childCount,o=e.childCount;e:for(let s=0,a=0;s{i.type.spec.tableRole=="table"&&(n=qv(t,i,o,n))};return e?e.doc!=t.doc&&nh(e.doc,t.doc,0,r):t.doc.descendants(r),n}function qv(t,e,n,r){let i=Ae.get(e);if(!i.problems)return r;r||(r=t.tr);let o=[];for(let l=0;l0){let p="cell";u.firstChild&&(p=u.firstChild.type.spec.tableRole);let h=[];for(let g=0;g0&&r>0||e.child(0).type.spec.tableRole=="table");)n--,r--,e=e.child(0).content;let i=e.child(0),o=i.type.spec.tableRole,s=i.type.schema,a=[];if(o=="row")for(let l=0;l=0;s--){let{rowspan:a,colspan:l}=o.child(s).attrs;for(let c=i;c=e.length&&e.push(k.empty),n[i]r&&(f=f.type.createChecked(pr(f.attrs,f.attrs.colspan,u+f.attrs.colspan-r),f.content)),c.push(f),u+=f.attrs.colspan;for(let p=1;pi&&(d=d.type.create({...d.attrs,rowspan:Math.max(1,i-d.attrs.rowspan)},d.content)),l.push(d)}o.push(k.from(l))}n=o,e=i}return{width:t,height:e,rows:n}}function Xv(t,e,n,r,i,o,s){let a=t.doc.type.schema,l=it(a),c,u;if(i>e.width)for(let d=0,f=0;de.height){let d=[];for(let h=0,m=(e.height-1)*e.width;h=e.width?!1:n.nodeAt(e.map[m+h]).type==l.header_cell;d.push(g?u||(u=l.header_cell.createAndFill()):c||(c=l.cell.createAndFill()))}let f=l.row.create(null,k.from(d)),p=[];for(let h=e.height;h{if(!i)return!1;let o=n.selection;if(o instanceof pe)return es(n,r,V.near(o.$headCell,e));if(t!="horiz"&&!o.empty)return!1;let s=rh(i,t,e);if(s==null)return!1;if(t=="horiz")return es(n,r,V.near(n.doc.resolve(o.head+e),e));{let a=n.doc.resolve(s),l=Qp(a,t,e),c;return l?c=V.near(l,1):e<0?c=V.near(n.doc.resolve(a.before(-1)),-1):c=V.near(n.doc.resolve(a.after(-1)),1),es(n,r,c)}}}function Zo(t,e){return(n,r,i)=>{if(!i)return!1;let o=n.selection,s;if(o instanceof pe)s=o;else{let l=rh(i,t,e);if(l==null)return!1;s=new pe(n.doc.resolve(l))}let a=Qp(s.$headCell,t,e);return a?es(n,r,new pe(s.$anchorCell,a)):!1}}function Qo(t,e){let n=t.selection;if(!(n instanceof pe))return!1;if(e){let r=t.tr,i=it(t.schema).cell.createAndFill().content;n.forEachCell((o,s)=>{o.content.eq(i)||r.replace(r.mapping.map(s+1),r.mapping.map(s+o.nodeSize-1),new R(i,0,0))}),r.docChanged&&e(r)}return!0}function Qv(t,e){let n=t.state.doc,r=Jr(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new pe(r))),!0):!1}function eS(t,e,n){if(!Kt(t.state))return!1;let r=jv(n),i=t.state.selection;if(i instanceof pe){r||(r={width:1,height:1,rows:[k.from(jl(it(t.state.schema).cell,n))]});let o=i.$anchorCell.node(-1),s=i.$anchorCell.start(-1),a=Ae.get(o).rectBetween(i.$anchorCell.pos-s,i.$headCell.pos-s);return r=Jv(r,a.right-a.left,a.bottom-a.top),qp(t.state,t.dispatch,s,a,r),!0}else if(r){let o=ns(t.state),s=o.start(-1);return qp(t.state,t.dispatch,s,Ae.get(o.node(-1)).findCell(o.pos-s),r),!0}else return!1}function tS(t,e){var n;if(e.ctrlKey||e.metaKey)return;let r=jp(t,e.target),i;if(e.shiftKey&&t.state.selection instanceof pe)o(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(i=Jr(t.state.selection.$anchor))!=null&&((n=Wl(t,e))==null?void 0:n.pos)!=i.pos)o(i,e),e.preventDefault();else if(!r)return;function o(l,c){let u=Wl(t,c),d=zn.getState(t.state)==null;if(!u||!Jl(l,u))if(d)u=l;else return;let f=new pe(l,u);if(d||!t.state.selection.eq(f)){let p=t.state.tr.setSelection(f);d&&p.setMeta(zn,l.pos),t.dispatch(p)}}function s(){t.root.removeEventListener("mouseup",s),t.root.removeEventListener("dragstart",s),t.root.removeEventListener("mousemove",a),zn.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(zn,-1))}function a(l){let c=l,u=zn.getState(t.state),d;if(u!=null)d=t.state.doc.resolve(u);else if(jp(t,c.target)!=r&&(d=Wl(t,e),!d))return s();d&&o(d,c)}t.root.addEventListener("mouseup",s),t.root.addEventListener("dragstart",s),t.root.addEventListener("mousemove",a)}function rh(t,e,n){if(!(t.state.selection instanceof $))return null;let{$head:r}=t.state.selection;for(let i=r.depth-1;i>=0;i--){let o=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:o.childCount))return null;if(o.type.spec.tableRole=="cell"||o.type.spec.tableRole=="header_cell"){let a=r.before(i),l=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(l)?a:null}}return null}function jp(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function Wl(t,e){let n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?Jr(t.state.doc.resolve(n.pos)):null}var nS=class{constructor(t,e){this.node=t,this.cellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Yl(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,Yl(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function Yl(t,e,n,r,i,o){var s;let a=0,l=!0,c=e.firstChild,u=t.firstChild;if(u){for(let d=0,f=0;dnew n(a,e,l),new ts(-1,!1)},apply(o,s){return s.apply(o)}},props:{attributes:o=>{let s=Rt.getState(o);return s&&s.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(o,s)=>{rS(o,s,t,e,r)},mouseleave:o=>{iS(o)},mousedown:(o,s)=>{oS(o,s,e)}},decorations:o=>{let s=Rt.getState(o);if(s&&s.activeHandle>-1)return dS(o,s.activeHandle)},nodeViews:{}}});return i}var ts=class{constructor(t,e){this.activeHandle=t,this.dragging=e}apply(t){let e=this,n=t.getMeta(Rt);if(n&&n.setHandle!=null)return new ts(n.setHandle,!1);if(n&&n.setDragging!==void 0)return new ts(e.activeHandle,n.setDragging);if(e.activeHandle>-1&&t.docChanged){let r=t.mapping.map(e.activeHandle,-1);return ql(t.doc.resolve(r))||(r=-1),new ts(r,e.dragging)}return e}};function rS(t,e,n,r,i){let o=Rt.getState(t.state);if(o&&!o.dragging){let s=aS(e.target),a=-1;if(s){let{left:l,right:c}=s.getBoundingClientRect();e.clientX-l<=n?a=Yp(t,e,"left",n):c-e.clientX<=n&&(a=Yp(t,e,"right",n))}if(a!=o.activeHandle){if(!i&&a!==-1){let l=t.state.doc.resolve(a),c=l.node(-1),u=Ae.get(c),d=l.start(-1);if(u.colCount(l.pos-d)+l.nodeAfter.attrs.colspan-1==u.width-1)return}oh(t,a)}}}function iS(t){let e=Rt.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&oh(t,-1)}function oS(t,e,n){let r=Rt.getState(t.state);if(!r||r.activeHandle==-1||r.dragging)return!1;let i=t.state.doc.nodeAt(r.activeHandle),o=sS(t,r.activeHandle,i.attrs);t.dispatch(t.state.tr.setMeta(Rt,{setDragging:{startX:e.clientX,startWidth:o}}));function s(l){window.removeEventListener("mouseup",s),window.removeEventListener("mousemove",a);let c=Rt.getState(t.state);c?.dragging&&(lS(t,c.activeHandle,Jp(c.dragging,l,n)),t.dispatch(t.state.tr.setMeta(Rt,{setDragging:null})))}function a(l){if(!l.which)return s(l);let c=Rt.getState(t.state);if(c&&c.dragging){let u=Jp(c.dragging,l,n);cS(t,c.activeHandle,u,n)}}return window.addEventListener("mouseup",s),window.addEventListener("mousemove",a),e.preventDefault(),!0}function sS(t,e,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let o=t.domAtPos(e),a=o.node.childNodes[o.offset].offsetWidth,l=n;if(r)for(let c=0;c0?-1:0;Uv(e,r,i+o)&&(o=i==0||i==e.width?null:0);for(let s=0;s0&&i0&&e.map[a-1]==l||i0?-1:0;pS(e,r,i+l)&&(l=i==0||i==e.height?null:0);for(let c=0,u=e.width*i;c0&&i0&&u==e.map[c-e.width]){let d=n.nodeAt(u).attrs;t.setNodeMarkup(t.mapping.slice(a).map(u+r),null,{...d,rowspan:d.rowspan-1}),l+=d.colspan-1}else if(i0&&n[o]==n[o-1]||r.right0&&n[i]==n[i-t]||r.bottomn[r.type.spec.tableRole])(t,e)}function gS(t){return(e,n)=>{var r;let i=e.selection,o,s;if(i instanceof pe){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;o=i.$anchorCell.nodeAfter,s=i.$anchorCell.pos}else{if(o=Hv(i.$from),!o)return!1;s=(r=Jr(i.$from))==null?void 0:r.pos}if(o==null||s==null||o.attrs.colspan==1&&o.attrs.rowspan==1)return!1;if(n){let a=o.attrs,l=[],c=a.colwidth;a.rowspan>1&&(a={...a,rowspan:1}),a.colspan>1&&(a={...a,colspan:1});let u=sn(e),d=e.tr;for(let p=0;p{s.attrs[t]!==e&&o.setNodeMarkup(a,null,{...s.attrs,[t]:e})}):o.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[t]:e}),r(o)}return!0}}function bS(t){return function(e,n){if(!Kt(e))return!1;if(n){let r=it(e.schema),i=sn(e),o=e.tr,s=i.map.cellsInRect(t=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:t=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),a=s.map(l=>i.table.nodeAt(l));for(let l=0;l{let h=p+o.tableStart,m=s.doc.nodeAt(h);m&&s.setNodeMarkup(h,f,m.attrs)}),r(s)}return!0}}var W_=Xr("row",{useDeprecatedLogic:!0}),V_=Xr("column",{useDeprecatedLogic:!0}),mh=Xr("cell",{useDeprecatedLogic:!0});function yS(t,e){if(e<0){let n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,i=t.before();r>=0;r--){let o=t.node(-1).child(r),s=o.lastChild;if(s)return i-1-s.nodeSize;i-=o.nodeSize}}else{if(t.index()0;r--)if(n.node(r).type.spec.tableRole=="table")return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function bh({allowTableNodeSelection:t=!1}={}){return new me({key:zn,state:{init(){return null},apply(e,n){let r=e.getMeta(zn);if(r!=null)return r==-1?null:r;if(n==null||!e.docChanged)return n;let{deleted:i,pos:o}=e.mapping.mapResult(n);return i?null:o}},props:{decorations:$v,handleDOMEvents:{mousedown:tS},createSelectionBetween(e){return zn.getState(e.state)!=null?e.state.selection:null},handleTripleClick:Qv,handleKeyDown:Zv,handlePaste:eS},appendTransaction(e,n,r){return Vv(r,Xl(r,n),t)}})}function yh(t,e,n,r,i,o){let s=0,a=!0,l=e.firstChild,c=t.firstChild;for(let u=0,d=0;u{let r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),t.cached.tableNodeTypes=e,e}function wS(t,e,n,r,i){let o=ES(t),s=[],a=[];for(let c=0;c{let{selection:e}=t.state;if(!vS(e))return!1;let n=0,r=Ll(e.ranges[0].$from,o=>o.type.name==="table");return r?.node.descendants(o=>{if(o.type.name==="table")return!1;["tableCell","tableHeader"].includes(o.type.name)&&(n+=1)}),n===e.ranges.length?(t.commands.deleteTable(),!0):!1},wh=z.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:tc,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({HTMLAttributes:t}){return["table",B(this.options.HTMLAttributes,t),["tbody",0]]},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:o})=>{let s=wS(o.schema,t,e,n);if(i){let a=r.selection.anchor+1;r.replaceSelectionWith(s).scrollIntoView().setSelection($.near(r.doc.resolve(a)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>ah(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>lh(t,e),deleteColumn:()=>({state:t,dispatch:e})=>ch(t,e),addRowBefore:()=>({state:t,dispatch:e})=>dh(t,e),addRowAfter:()=>({state:t,dispatch:e})=>fh(t,e),deleteRow:()=>({state:t,dispatch:e})=>ph(t,e),deleteTable:()=>({state:t,dispatch:e})=>gh(t,e),mergeCells:()=>({state:t,dispatch:e})=>Zl(t,e),splitCell:()=>({state:t,dispatch:e})=>Ql(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>Xr("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>Xr("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>mh(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>Zl(t,e)?!0:Ql(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>hh(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>ec(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>ec(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&Xl(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){let r=pe.create(e.doc,t.anchorCell,t.headCell);e.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:rs,"Mod-Backspace":rs,Delete:rs,"Mod-Delete":rs}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[ih({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],bh({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){let e={name:t.name,options:t.options,storage:t.storage};return{tableRole:ee(H(t,"tableRole",e))}}});var vh=z.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{let e=t.getAttribute("colwidth");return e?[parseInt(e,10)]:null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",B(this.options.HTMLAttributes,t),0]}});var Sh=z.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{let e=t.getAttribute("colwidth");return e?[parseInt(e,10)]:null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",B(this.options.HTMLAttributes,t),0]}});var xh=z.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",B(this.options.HTMLAttributes,t),0]}});var kh=z.create({name:"text",group:"inline"});var Mh=be.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",B(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});var SS=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))$/,xS=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))/g,Th=be.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",B(this.options.HTMLAttributes,t),0]},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Ot({find:SS,type:this.type})]},addPasteRules(){return[yt({find:xS,type:this.type})]}});var nc=z.create({name:"checkedList",priority:50,addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{class:"checked-list"}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul",getAttrs:t=>t.classList.contains("checked-list"),priority:1e3}]},renderHTML({HTMLAttributes:t}){return["ul",B(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleCheckedList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}}});var rc=z.create({name:"lead",group:"block",content:"block+",addOptions(){return{HTMLAttributes:{class:"lead"}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("lead")}]},renderHTML({node:t,HTMLAttributes:e}){return["div",B(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleLead:()=>({commands:t})=>t.toggleWrap(this.name)}}});var kS="aaa1rp3barth4b0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0faromeo7ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re2s2c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y0eats7k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking0channel11l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t0isalat7u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0at2delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d0network8tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntdoor4ier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5gtv3iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0eles2s3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1nder2le4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster5ia3d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4de2k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0cys3drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7serati6ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic3tual5v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rthwesternmutual14on4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3ssagens7y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cher3ks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w0time7i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ffany5ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0channel7ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xF6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lkswagen7vo3te1ing3o2yage5u0elos6wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",MS="\u03B5\u03BB1\u03C52\u0431\u04331\u0435\u043B3\u0434\u0435\u0442\u04384\u0435\u044E2\u043A\u0430\u0442\u043E\u043B\u0438\u043A6\u043E\u043C3\u043C\u043A\u04342\u043E\u043D1\u0441\u043A\u0432\u04306\u043E\u043D\u043B\u0430\u0439\u043D5\u0440\u04333\u0440\u0443\u04412\u04442\u0441\u0430\u0439\u04423\u0440\u04313\u0443\u043A\u04403\u049B\u0430\u04373\u0570\u0561\u05753\u05D9\u05E9\u05E8\u05D0\u05DC5\u05E7\u05D5\u05DD3\u0627\u0628\u0648\u0638\u0628\u064A5\u062A\u0635\u0627\u0644\u0627\u062A6\u0631\u0627\u0645\u0643\u06485\u0644\u0627\u0631\u062F\u06464\u0628\u062D\u0631\u064A\u06465\u062C\u0632\u0627\u0626\u06315\u0633\u0639\u0648\u062F\u064A\u06296\u0639\u0644\u064A\u0627\u06465\u0645\u063A\u0631\u06285\u0645\u0627\u0631\u0627\u062A5\u06CC\u0631\u0627\u06465\u0628\u0627\u0631\u062A2\u0632\u0627\u06314\u064A\u062A\u06433\u06BE\u0627\u0631\u062A5\u062A\u0648\u0646\u06334\u0633\u0648\u062F\u0627\u06463\u0631\u064A\u06295\u0634\u0628\u0643\u06294\u0639\u0631\u0627\u06422\u06282\u0645\u0627\u06464\u0641\u0644\u0633\u0637\u064A\u06466\u0642\u0637\u06313\u0643\u0627\u062B\u0648\u0644\u064A\u06436\u0648\u06453\u0645\u0635\u06312\u0644\u064A\u0633\u064A\u06275\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u06277\u0642\u06394\u0647\u0645\u0631\u0627\u06475\u067E\u0627\u06A9\u0633\u062A\u0627\u06467\u0680\u0627\u0631\u062A4\u0915\u0949\u092E3\u0928\u0947\u091F3\u092D\u093E\u0930\u09240\u092E\u094D3\u094B\u09245\u0938\u0902\u0917\u0920\u09285\u09AC\u09BE\u0982\u09B2\u09BE5\u09AD\u09BE\u09B0\u09A42\u09F0\u09A44\u0A2D\u0A3E\u0A30\u0A244\u0AAD\u0ABE\u0AB0\u0AA44\u0B2D\u0B3E\u0B30\u0B244\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE6\u0BB2\u0B99\u0BCD\u0B95\u0BC86\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD11\u0C2D\u0C3E\u0C30\u0C24\u0C4D5\u0CAD\u0CBE\u0CB0\u0CA44\u0D2D\u0D3E\u0D30\u0D24\u0D025\u0DBD\u0D82\u0D9A\u0DCF4\u0E04\u0E2D\u0E213\u0E44\u0E17\u0E223\u0EA5\u0EB2\u0EA73\u10D2\u10D42\u307F\u3093\u306A3\u30A2\u30DE\u30BE\u30F34\u30AF\u30E9\u30A6\u30C94\u30B0\u30FC\u30B0\u30EB4\u30B3\u30E02\u30B9\u30C8\u30A23\u30BB\u30FC\u30EB3\u30D5\u30A1\u30C3\u30B7\u30E7\u30F36\u30DD\u30A4\u30F3\u30C84\u4E16\u754C2\u4E2D\u4FE11\u56FD1\u570B1\u6587\u7F513\u4E9A\u9A6C\u900A3\u4F01\u4E1A2\u4F5B\u5C712\u4FE1\u606F2\u5065\u5EB72\u516B\u53662\u516C\u53F81\u76CA2\u53F0\u6E7E1\u70632\u5546\u57CE1\u5E971\u68072\u5609\u91CC0\u5927\u9152\u5E975\u5728\u7EBF2\u5927\u62FF2\u5929\u4E3B\u65593\u5A31\u4E502\u5BB6\u96FB2\u5E7F\u4E1C2\u5FAE\u535A2\u6148\u55842\u6211\u7231\u4F603\u624B\u673A2\u62DB\u80582\u653F\u52A11\u5E9C2\u65B0\u52A0\u57612\u95FB2\u65F6\u5C1A2\u66F8\u7C4D2\u673A\u67842\u6DE1\u9A6C\u95213\u6E38\u620F2\u6FB3\u95802\u70B9\u770B2\u79FB\u52A82\u7EC4\u7EC7\u673A\u67844\u7F51\u57401\u5E971\u7AD91\u7EDC2\u8054\u901A2\u8C37\u6B4C2\u8D2D\u72692\u901A\u8CA92\u96C6\u56E22\u96FB\u8A0A\u76C8\u79D14\u98DE\u5229\u6D663\u98DF\u54C12\u9910\u53852\u9999\u683C\u91CC\u62C93\u6E2F2\uB2F7\uB1371\uCEF42\uC0BC\uC1312\uD55C\uAD6D2",ri=(t,e)=>{for(let n in e)t[n]=e[n];return t},lc="numeric",cc="ascii",uc="alpha",ls="asciinumeric",is="alphanumeric",dc="domain",Lh="emoji",TS="scheme",NS="slashscheme",Nh="whitespace";function _S(t,e){return t in e||(e[t]=[]),e[t]}function br(t,e,n){e[lc]&&(e[ls]=!0,e[is]=!0),e[cc]&&(e[ls]=!0,e[uc]=!0),e[ls]&&(e[is]=!0),e[uc]&&(e[is]=!0),e[is]&&(e[dc]=!0),e[Lh]&&(e[dc]=!0);for(let r in e){let i=_S(r,n);i.indexOf(t)<0&&i.push(t)}}function CS(t,e){let n={};for(let r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function Et(t){t===void 0&&(t=null),this.j={},this.jr=[],this.jd=null,this.t=t}Et.groups={};Et.prototype={accepts(){return!!this.t},go(t){let e=this,n=e.j[t];if(n)return n;for(let r=0;rt.ta(e,n,r,i),It=(t,e,n,r,i)=>t.tr(e,n,r,i),_h=(t,e,n,r,i)=>t.ts(e,n,r,i),I=(t,e,n,r,i)=>t.tt(e,n,r,i),Sn="WORD",fc="UWORD",Ki="LOCALHOST",pc="TLD",hc="UTLD",cs="SCHEME",Qr="SLASH_SCHEME",mc="NUM",Ph="WS",gc="NL",ei="OPENBRACE",Fi="OPENBRACKET",zi="OPENANGLEBRACKET",Ui="OPENPAREN",mr="CLOSEBRACE",ti="CLOSEBRACKET",ni="CLOSEANGLEBRACKET",gr="CLOSEPAREN",us="AMPERSAND",ds="APOSTROPHE",fs="ASTERISK",$n="AT",ps="BACKSLASH",hs="BACKTICK",ms="CARET",Kn="COLON",bc="COMMA",gs="DOLLAR",an="DOT",bs="EQUALS",yc="EXCLAMATION",ln="HYPHEN",ys="PERCENT",Es="PIPE",ws="PLUS",vs="POUND",Ss="QUERY",Ec="QUOTE",wc="SEMI",cn="SLASH",$i="TILDE",xs="UNDERSCORE",Bh="EMOJI",ks="SYM",Hh=Object.freeze({__proto__:null,WORD:Sn,UWORD:fc,LOCALHOST:Ki,TLD:pc,UTLD:hc,SCHEME:cs,SLASH_SCHEME:Qr,NUM:mc,WS:Ph,NL:gc,OPENBRACE:ei,OPENBRACKET:Fi,OPENANGLEBRACKET:zi,OPENPAREN:Ui,CLOSEBRACE:mr,CLOSEBRACKET:ti,CLOSEANGLEBRACKET:ni,CLOSEPAREN:gr,AMPERSAND:us,APOSTROPHE:ds,ASTERISK:fs,AT:$n,BACKSLASH:ps,BACKTICK:hs,CARET:ms,COLON:Kn,COMMA:bc,DOLLAR:gs,DOT:an,EQUALS:bs,EXCLAMATION:yc,HYPHEN:ln,PERCENT:ys,PIPE:Es,PLUS:ws,POUND:vs,QUERY:Ss,QUOTE:Ec,SEMI:wc,SLASH:cn,TILDE:$i,UNDERSCORE:xs,EMOJI:Bh,SYM:ks}),Zr=/[a-z]/,ic=/\p{L}/u,oc=/\p{Emoji}/u;var sc=/\d/,Ch=/\s/;var Oh=` -`,OS="\uFE0F",AS="\u200D",ss=null,as=null;function RS(t){t===void 0&&(t=[]);let e={};Et.groups=e;let n=new Et;ss==null&&(ss=Ah(kS)),as==null&&(as=Ah(MS)),I(n,"'",ds),I(n,"{",ei),I(n,"[",Fi),I(n,"<",zi),I(n,"(",Ui),I(n,"}",mr),I(n,"]",ti),I(n,">",ni),I(n,")",gr),I(n,"&",us),I(n,"*",fs),I(n,"@",$n),I(n,"`",hs),I(n,"^",ms),I(n,":",Kn),I(n,",",bc),I(n,"$",gs),I(n,".",an),I(n,"=",bs),I(n,"!",yc),I(n,"-",ln),I(n,"%",ys),I(n,"|",Es),I(n,"+",ws),I(n,"#",vs),I(n,"?",Ss),I(n,'"',Ec),I(n,"/",cn),I(n,";",wc),I(n,"~",$i),I(n,"_",xs),I(n,"\\",ps);let r=It(n,sc,mc,{[lc]:!0});It(r,sc,r);let i=It(n,Zr,Sn,{[cc]:!0});It(i,Zr,i);let o=It(n,ic,fc,{[uc]:!0});It(o,Zr),It(o,ic,o);let s=It(n,Ch,Ph,{[Nh]:!0});I(n,Oh,gc,{[Nh]:!0}),I(s,Oh),It(s,Ch,s);let a=It(n,oc,Bh,{[Lh]:!0});It(a,oc,a),I(a,OS,a);let l=I(a,AS);It(l,oc,a);let c=[[Zr,i]],u=[[Zr,null],[ic,o]];for(let d=0;dd[0]>f[0]?1:-1);for(let d=0;d=0?h[dc]=!0:Zr.test(f)?sc.test(f)?h[ls]=!0:h[cc]=!0:h[lc]=!0,_h(n,f,f,h)}return _h(n,"localhost",Ki,{ascii:!0}),n.jd=new Et(ks),{start:n,tokens:ri({groups:e},Hh)}}function IS(t,e){let n=DS(e.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,i=[],o=0,s=0;for(;s=0&&(d+=n[s].length,f++),c+=n[s].length,o+=n[s].length,s++;o-=d,s-=f,c-=d,i.push({t:u.t,v:e.slice(o-c,o),s:o-c,e:o})}return i}function DS(t){let e=[],n=t.length,r=0;for(;r56319||r+1===n||(o=t.charCodeAt(r+1))<56320||o>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}function Un(t,e,n,r,i){let o,s=e.length;for(let a=0;a=0;)o++;if(o>0){e.push(n.join(""));for(let s=parseInt(t.substring(r,r+o),10);s>0;s--)n.pop();r+=o}else n.push(t[r]),r++}return e}var Wi={defaultProtocol:"http",events:null,format:Rh,formatHref:Rh,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function vc(t,e){e===void 0&&(e=null);let n=ri({},Wi);t&&(n=ri(n,t instanceof vc?t.o:t));let r=n.ignoreTags,i=[];for(let o=0;on?r.substring(0,n)+"\u2026":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t){return t===void 0&&(t=Wi.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){let e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),i=t.get("tagName",n,e),o=this.toFormattedString(t),s={},a=t.get("className",n,e),l=t.get("target",n,e),c=t.get("rel",n,e),u=t.getObj("attributes",n,e),d=t.getObj("events",n,e);return s.href=r,a&&(s.class=a),l&&(s.target=l),c&&(s.rel=c),u&&ri(s,u),{tagName:i,attributes:s,content:o,eventListeners:d}}};function Ms(t,e){class n extends Fh{constructor(i,o){super(i,o),this.t=t}}for(let r in e)n.prototype[r]=e[r];return n.t=t,n}var Ih=Ms("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Dh=Ms("text"),LS=Ms("nl"),hr=Ms("url",{isLink:!0,toHref(t){return t===void 0&&(t=Wi.defaultProtocol),this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){let t=this.tk;return t.length>=2&&t[0].t!==Ki&&t[1].t===Kn}});var Ve=t=>new Et(t);function PS(t){let{groups:e}=t,n=e.domain.concat([us,fs,$n,ps,hs,ms,gs,bs,ln,mc,ys,Es,ws,vs,cn,ks,$i,xs]),r=[ds,ni,mr,ti,gr,Kn,bc,an,yc,zi,ei,Fi,Ui,Ss,Ec,wc],i=[us,ds,fs,ps,hs,ms,mr,gs,bs,ln,ei,ys,Es,ws,vs,Ss,cn,ks,$i,xs],o=Ve(),s=I(o,$i);j(s,i,s),j(s,e.domain,s);let a=Ve(),l=Ve(),c=Ve();j(o,e.domain,a),j(o,e.scheme,l),j(o,e.slashscheme,c),j(a,i,s),j(a,e.domain,a);let u=I(a,$n);I(s,$n,u),I(l,$n,u),I(c,$n,u);let d=I(s,an);j(d,i,s),j(d,e.domain,s);let f=Ve();j(u,e.domain,f),j(f,e.domain,f);let p=I(f,an);j(p,e.domain,f);let h=Ve(Ih);j(p,e.tld,h),j(p,e.utld,h),I(u,Ki,h);let m=I(f,ln);j(m,e.domain,f),j(h,e.domain,f),I(h,an,p),I(h,ln,m);let g=I(h,Kn);j(g,e.numeric,Ih);let y=I(a,ln),S=I(a,an);j(y,e.domain,a),j(S,i,s),j(S,e.domain,a);let M=Ve(hr);j(S,e.tld,M),j(S,e.utld,M),j(M,e.domain,a),j(M,i,s),I(M,an,S),I(M,ln,y),I(M,$n,u);let b=I(M,Kn),_=Ve(hr);j(b,e.numeric,_);let w=Ve(hr),D=Ve();j(w,n,w),j(w,r,D),j(D,n,w),j(D,r,D),I(M,cn,w),I(_,cn,w);let K=I(l,Kn),O=I(c,Kn),J=I(O,cn),ne=I(J,cn);j(l,e.domain,a),I(l,an,S),I(l,ln,y),j(c,e.domain,a),I(c,an,S),I(c,ln,y),j(K,e.domain,w),I(K,cn,w),j(ne,e.domain,w),j(ne,n,w),I(ne,cn,w);let ie=I(w,ei),Z=I(w,Fi),re=I(w,zi),ce=I(w,Ui);I(D,ei,ie),I(D,Fi,Z),I(D,zi,re),I(D,Ui,ce),I(ie,mr,w),I(Z,ti,w),I(re,ni,w),I(ce,gr,w),I(ie,mr,w);let N=Ve(hr),E=Ve(hr),v=Ve(hr),C=Ve(hr);j(ie,n,N),j(Z,n,E),j(re,n,v),j(ce,n,C);let P=Ve(),Y=Ve(),Q=Ve(),he=Ve();return j(ie,r),j(Z,r),j(re,r),j(ce,r),j(N,n,N),j(E,n,E),j(v,n,v),j(C,n,C),j(N,r,N),j(E,r,E),j(v,r,v),j(C,r,C),j(P,n,P),j(Y,n,E),j(Q,n,v),j(he,n,C),j(P,r,P),j(Y,r,Y),j(Q,r,Q),j(he,r,he),I(E,ti,w),I(v,ni,w),I(C,gr,w),I(N,mr,w),I(Y,ti,w),I(Q,ni,w),I(he,gr,w),I(P,gr,w),I(o,Ki,M),I(o,gc,LS),{start:o,tokens:Hh}}function BS(t,e,n){let r=n.length,i=0,o=[],s=[];for(;i=0&&f++,i++,u++;if(f<0)i-=u,i0&&(o.push(ac(Dh,e,s)),s=[]),i-=f,u-=f;let p=d.t,h=n.slice(i-u,i);o.push(ac(p,e,h))}}return s.length>0&&o.push(ac(Dh,e,s)),o}function ac(t,e,n){let r=n[0].s,i=n[n.length-1].e,o=e.slice(r,i);return new t(o,n)}var HS=typeof console<"u"&&console&&console.warn||(()=>{}),FS="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Ce={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function zh(){Et.groups={},Ce.scanner=null,Ce.parser=null,Ce.tokenQueue=[],Ce.pluginQueue=[],Ce.customSchemes=[],Ce.initialized=!1}function Sc(t,e){if(e===void 0&&(e=!1),Ce.initialized&&HS(`linkifyjs: already initialized - will not register custom scheme "${t}" ${FS}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format. +`,textSerializers:r={}}=e||{};return Cw(this.state.doc,{blockSeparator:n,textSerializers:{...lp(this.schema),...r}})}get isEmpty(){return Iw(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}};function Mt(t){return new Br({find:t.find,handler:({state:e,range:n,match:r})=>{let i=ee(t.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:o}=e,s=r[r.length-1],a=r[0];if(s){let l=a.search(/\S/),c=n.from+a.indexOf(s),u=c+s.length;if($o(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(g=>g===t.type&&g!==p.mark.type)).filter(p=>p.to>c).length)return null;un.from&&o.delete(n.from+l,c);let f=n.from+l+s.length;o.addMark(n.from+l,f,t.type.create(i||{})),o.removeStoredMark(t.type)}}})}function Ko(t){return new Br({find:t.find,handler:({state:e,range:n,match:r})=>{let i=ee(t.getAttributes,void 0,r)||{},{tr:o}=e,s=n.from,a=n.to,l=t.type.create(i);if(r[1]){let c=r[0].lastIndexOf(r[1]),u=s+c;u>a?u=a:a=u+r[1].length;let d=r[0][r[0].length-1];o.insertText(d,s+r[0].length-1),o.replaceWith(u,a,l)}else r[0]&&o.insert(s-1,t.type.create(i)).delete(o.mapping.map(s),o.mapping.map(a));o.scrollIntoView()}})}function Ni(t){return new Br({find:t.find,handler:({state:e,range:n,match:r})=>{let i=e.doc.resolve(n.from),o=ee(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,o)}})}function kn(t){return new Br({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{let o=ee(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),l=s.doc.resolve(n.from).blockRange(),c=l&&Mr(l,t.type,o);if(!c)return null;if(s.wrap(l,c),t.keepMarks&&t.editor){let{selection:d,storedMarks:f}=e,{splittableMarks:p}=t.editor.extensionManager,h=f||d.$to.parentOffset&&d.$from.marks();if(h){let g=h.filter(m=>p.includes(m.type.name));s.ensureMarks(g)}}if(t.keepAttributes){let d=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(d,o).run()}let u=s.doc.resolve(n.from-1).nodeBefore;u&&u.type===t.type&&Dt(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,u))&&s.join(n.from-1)}})}var we=class t{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ee(F(this,"addOptions",{name:this.name}))),this.storage=ee(F(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new t(e)}configure(e={}){let n=this.extend();return n.options=Bo(this.options,e),n.storage=ee(F(n,"addStorage",{name:n.name,options:n.options})),n}extend(e={}){let n=new t(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=ee(F(n,"addOptions",{name:n.name})),n.storage=ee(F(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){let{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){let s=i.marks();if(!!!s.find(c=>c?.type.name===n.name))return!1;let l=s.find(c=>c?.type.name===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}},$=class t{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ee(F(this,"addOptions",{name:this.name}))),this.storage=ee(F(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new t(e)}configure(e={}){let n=this.extend();return n.options=Bo(this.options,e),n.storage=ee(F(n,"addStorage",{name:n.name,options:n.options})),n}extend(e={}){let n=new t(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=ee(F(n,"addOptions",{name:n.name})),n.storage=ee(F(n,"addStorage",{name:n.name,options:n.options})),n}};function ht(t){return new Ml({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{let o=ee(t.getAttributes,void 0,r,i);if(o===!1||o===null)return null;let{tr:s}=e,a=r[r.length-1],l=r[0],c=n.to;if(a){let u=l.search(/\S/),d=n.from+l.indexOf(a),f=d+a.length;if($o(n.from,n.to,e.doc).filter(h=>h.mark.type.excluded.find(m=>m===t.type&&m!==h.mark.type)).filter(h=>h.to>d).length)return null;fn.from&&s.delete(n.from+u,d),c=n.from+u+a.length,s.addMark(n.from+u,c,t.type.create(o||{})),s.removeStoredMark(t.type)}}})}var lv=/^\s*>\s$/,mp=$.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",B(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[kn({find:lv,type:this.type})]}});var cv=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,uv=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,dv=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,fv=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,gp=we.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",B(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Mt({find:cv,type:this.type}),Mt({find:dv,type:this.type})]},addPasteRules(){return[ht({find:uv,type:this.type}),ht({find:fv,type:this.type})]}});var pv=$.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",B(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),bp=we.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",B(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{let n=xn(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),yp=/^\s*([-+*])\s$/,Ep=$.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",B(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(pv.name,this.editor.getAttributes(bp.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=kn({find:yp,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=kn({find:yp,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(bp.name),editor:this.editor})),[t]}});var hv=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,mv=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,wp=we.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",B(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Mt({find:hv,type:this.type})]},addPasteRules(){return[ht({find:mv,type:this.type})]}});var vp=we.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",B(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{let n=xn(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}});var Sp=Ne.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;return(e=t.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}});var xp=$.create({name:"doc",topNode:!0,content:"block+"});function kp(t={}){return new ge({view(e){return new Ll(e,t)}})}var Ll=class{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=s=>{this[i](s)};return e.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r;if(n){let a=e.nodeBefore,l=e.nodeAfter;if(a||l){let c=this.editorView.nodeDOM(this.cursorPos-(a?a.nodeSize:0));if(c){let u=c.getBoundingClientRect(),d=a?u.bottom:u.top;a&&l&&(d=(d+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:u.left,right:u.right,top:d-this.width/2,bottom:d+this.width/2}}}}if(!r){let a=this.editorView.coordsAtPos(this.cursorPos);r={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let o,s;if(!i||i==document.body&&getComputedStyle(i).position=="static")o=-pageXOffset,s=-pageYOffset;else{let a=i.getBoundingClientRect();o=a.left-i.scrollLeft,s=a.top-i.scrollTop}this.element.style.left=r.left-o+"px",this.element.style.top=r.top-s+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!o){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=fo(this.editorView.state.doc,s,this.editorView.dragging.slice);a!=null&&(s=a)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}};var Mp=Ne.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[kp(this.options)]}});var tt=class t extends V{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return t.valid(r)?new t(r):V.near(r)}content(){return D.empty}eq(e){return e instanceof t&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new t(e.resolve(n.pos))}getBookmark(){return new Pl(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!gv(e)||!bv(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&t.valid(e))return e;let i=e.pos,o=null;for(let s=e.depth;;s--){let a=e.node(s);if(n>0?e.indexAfter(s)0){o=a.child(n>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;i+=n;let l=e.doc.resolve(i);if(t.valid(l))return l}for(;;){let s=n>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!Y.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*n),r=!1;continue e}break}o=s,i+=n;let a=e.doc.resolve(i);if(t.valid(a))return a}return null}}};tt.prototype.visible=!1;tt.findFrom=tt.findGapCursorFrom;V.jsonID("gapcursor",tt);var Pl=class t{constructor(e){this.pos=e}map(e){return new t(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return tt.valid(n)?new tt(n):V.near(n)}};function gv(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function bv(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function Np(){return new ge({props:{decorations:vv,createSelectionBetween(t,e,n){return e.pos==n.pos&&tt.valid(n)?new tt(n):null},handleClick:Ev,handleKeyDown:yv,handleDOMEvents:{beforeinput:wv}}})}var yv=ki({ArrowLeft:Wo("horiz",-1),ArrowRight:Wo("horiz",1),ArrowUp:Wo("vert",-1),ArrowDown:Wo("vert",1)});function Wo(t,e){let n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,o){let s=r.selection,a=e>0?s.$to:s.$from,l=s.empty;if(s instanceof K){if(!o.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let c=tt.findGapCursorFrom(a,e,l);return c?(i&&i(r.tr.setSelection(new tt(c))),!0):!1}}function Ev(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!tt.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&Y.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new tt(r))),!0)}function wv(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof tt))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=T.empty;for(let s=r.length-1;s>=0;s--)i=T.from(r[s].createAndFill(null,i));let o=t.state.tr.replace(n.pos,n.pos,new D(i,0,0));return o.setSelection(K.near(o.doc.resolve(n.pos+1))),t.dispatch(o),!1}function vv(t){if(!(t.selection instanceof tt))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Ce.create(t.doc,[et.widget(t.selection.head,e,{key:"gapcursor"})])}var Tp=Ne.create({name:"gapCursor",addProseMirrorPlugins(){return[Np()]},extendNodeSchema(t){var e;let n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=ee(F(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}});var _p=$.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",B(this.options.HTMLAttributes,t)]},renderText(){return` +`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{let{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;let{keepMarks:s}=this.options,{splittableMarks:a}=r.extensionManager,l=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&l&&s){let d=l.filter(f=>a.includes(f.type.name));c.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}});var Cp=$.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,B(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>Ni({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var Vo=200,qe=function(){};qe.prototype.append=function(e){return e.length?(e=qe.from(e),!this.length&&e||e.length=n?qe.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};qe.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};qe.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};qe.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},n,r),i};qe.from=function(e){return e instanceof qe?e:e&&e.length?new Op(e):qe.empty};var Op=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,s,a){for(var l=o;l=s;l--)if(i(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Vo)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Vo)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(qe);qe.empty=new Op([]);var Sv=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return ra&&this.right.forEachInner(r,Math.max(i-a,0),Math.min(this.length,o)-a,s+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(r,i-a,Math.max(o,a)-a,s+a)===!1||o=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(qe),Bl=qe;var xv=500,tr=class t{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,a,l,c=[],u=[];return this.items.forEach((d,f)=>{if(!d.step){i||(i=this.remapping(r,f+1),o=i.maps.length),o--,u.push(d);return}if(i){u.push(new qt(d.map));let p=d.step.map(i.slice(o)),h;p&&s.maybeStep(p).doc&&(h=s.mapping.maps[s.mapping.maps.length-1],c.push(new qt(h,void 0,void 0,c.length+u.length))),o--,h&&i.appendMap(h,o)}else s.maybeStep(d.step);if(d.selection)return a=i?d.selection.map(i.slice(o)):d.selection,l=new t(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(e,n,r,i){let o=[],s=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let u=0;uMv&&(a=kv(a,c),s-=c),new t(a.append(o),s)}remapping(e,n){let r=new di;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new t(this.items.append(e.map(n=>new qt(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=e.mapping,s=e.steps.length,a=this.eventCount;this.items.forEach(f=>{f.selection&&a--},i);let l=n;this.items.forEach(f=>{let p=o.getMirror(--l);if(p==null)return;s=Math.min(s,p);let h=o.maps[p];if(f.step){let g=e.steps[p].invert(e.docs[p]),m=f.selection&&f.selection.map(o.slice(l+1,p));m&&a++,r.push(new qt(h,g,m))}else r.push(new qt(h))},i);let c=[];for(let f=n;fxv&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],o=0;return this.items.forEach((s,a)=>{if(a>=e)i.push(s),s.selection&&o++;else if(s.step){let l=s.step.map(n.slice(r)),c=l&&l.getMap();if(r--,c&&n.appendMap(c,r),l){let u=s.selection&&s.selection.map(n.slice(r));u&&o++;let d=new qt(c.invert(),l,u),f,p=i.length-1;(f=i.length&&i[p].merge(d))?i[p]=f:i.push(d)}}else s.map&&r--},this.items.length,0),new t(Bl.from(i.reverse()),o)}};tr.empty=new tr(Bl.empty,0);function kv(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}var qt=class t{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new t(n.getMap().invert(),n,this.selection)}}},jt=class{constructor(e,n,r,i,o){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}},Mv=20;function Nv(t,e,n,r){let i=n.getMeta(Mn),o;if(i)return i.historyState;n.getMeta(_v)&&(t=new jt(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(Mn))return s.getMeta(Mn).redo?new jt(t.done.addTransform(n,void 0,r,Go(e)),t.undone,Ap(n.mapping.maps[n.steps.length-1]),t.prevTime,t.prevComposition):new jt(t.done,t.undone.addTransform(n,void 0,r,Go(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!s&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!Tv(n,t.prevRanges)),c=s?Fl(t.prevRanges,n.mapping):Ap(n.mapping.maps[n.steps.length-1]);return new jt(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,Go(e)),tr.empty,c,n.time,a??t.prevComposition)}else return(o=n.getMeta("rebased"))?new jt(t.done.rebased(n,o),t.undone.rebased(n,o),Fl(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new jt(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Fl(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function Tv(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let o=0;o=e[o]&&(n=!0)}),n}function Ap(t){let e=[];return t.forEach((n,r,i,o)=>e.push(i,o)),e}function Fl(t,e){if(!t)return null;let n=[];for(let r=0;r{let n=Mn.getState(t);return!n||n.done.eventCount==0?!1:(e&&Ip(n,t,e,!1),!0)},$l=(t,e)=>{let n=Mn.getState(t);return!n||n.undone.eventCount==0?!1:(e&&Ip(n,t,e,!0),!0)};var Lp=Ne.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>zl(t,e),redo:()=>({state:t,dispatch:e})=>$l(t,e)}},addProseMirrorPlugins(){return[Dp(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-Z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-Y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Shift-Mod-Z":()=>this.editor.commands.redo(),"Mod-\u044F":()=>this.editor.commands.undo(),"Shift-Mod-\u044F":()=>this.editor.commands.redo()}}});var Pp=$.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",B(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{let{$to:n}=e.selection,r=t();return n.parentOffset===0?r.insertContentAt(Math.max(n.pos-2,0),{type:this.name}):r.insertContent({type:this.name}),r.command(({tr:i,dispatch:o})=>{var s;if(o){let{$to:a}=i.selection,l=a.end();if(a.nodeAfter)a.nodeAfter.isTextblock?i.setSelection(K.create(i.doc,a.pos+1)):a.nodeAfter.isBlock?i.setSelection(Y.create(i.doc,a.pos)):i.setSelection(K.create(i.doc,a.pos));else{let c=(s=a.parent.type.contentMatch.defaultType)===null||s===void 0?void 0:s.create();c&&(i.insert(l,c),i.setSelection(K.create(i.doc,l+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Ko({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}});var Cv=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,Ov=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,Av=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,Rv=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,Bp=we.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",B(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Mt({find:Cv,type:this.type}),Mt({find:Av,type:this.type})]},addPasteRules(){return[ht({find:Ov,type:this.type}),ht({find:Rv,type:this.type})]}});var Ul=$.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",B(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}});var Iv=$.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",B(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Fp=we.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",B(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{let n=xn(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),Hp=/^(\d+)\.\s$/,zp=$.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){let{start:e,...n}=t;return e===1?["ol",B(this.options.HTMLAttributes,n),0]:["ol",B(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Iv.name,this.editor.getAttributes(Fp.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=kn({find:Hp,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=kn({find:Hp,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Fp.name)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}});var Dv=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,Lv=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,$p=we.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",B(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){let t={};return Ho()?t["Mod-Shift-s"]=()=>this.editor.commands.toggleStrike():t["Ctrl-Shift-s"]=()=>this.editor.commands.toggleStrike(),t},addInputRules(){return[Mt({find:Dv,type:this.type})]},addPasteRules(){return[ht({find:Lv,type:this.type})]}});var Up=we.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",B(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}});var Kp=we.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(t){return t!=="super"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sup",B(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}});var Wl,Vl;if(typeof WeakMap<"u"){let t=new WeakMap;Wl=e=>t.get(e),Vl=(e,n)=>(t.set(e,n),n)}else{let t=[],n=0;Wl=r=>{for(let i=0;i(n==10&&(n=0),t[n++]=r,t[n++]=i)}var Te=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e=n){(o||(o=[])).push({type:"overlong_rowspan",pos:u,n:y-x});break}let b=i+x*e;for(let _=0;_r&&(o+=c.attrs.colspan)}}for(let s=0;s1&&(n=!0)}e==-1?e=o:e!=o&&(e=Math.max(e,o))}return e}function Fv(t,e,n){t.problems||(t.problems=[]);let r={};for(let i=0;i0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function zv(t){for(let e=t.depth;e>0;e--){let n=t.node(e).type.spec.tableRole;if(n==="cell"||n==="header_cell")return t.node(e)}return null}function Ft(t){let e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function Zo(t){let e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;let n=Fr(e.$head)||$v(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function $v(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){let r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){let r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function Gl(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function Uv(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function Yl(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function Zp(t,e,n){let r=t.node(-1),i=Te.get(r),o=t.start(-1),s=i.nextCell(t.pos-o,e,n);return s==null?null:t.node(0).resolve(o+s)}function nr(t,e,n=1){let r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(i=>i>0)||(r.colwidth=null)),r}function Qp(t,e,n=1){let r={...t,colspan:t.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let i=0;ic!=e.pos-i);a.unshift(e.pos-i);let l=a.map(c=>{let u=n.nodeAt(c);if(!u)throw RangeError(`No cell with offset ${c} found`);let d=i+c+1;return new gi(s.resolve(d),s.resolve(d+u.content.size))});super(l[0].$from,l[0].$to,l),this.$anchorCell=t,this.$headCell=e}map(t,e){let n=t.resolve(e.map(this.$anchorCell.pos)),r=t.resolve(e.map(this.$headCell.pos));if(Gl(n)&&Gl(r)&&Yl(n,r)){let i=this.$anchorCell.node(-1)!=n.node(-1);return i&&this.isRowSelection()?fe.rowSelection(n,r):i&&this.isColSelection()?fe.colSelection(n,r):new fe(n,r)}return K.between(n,r)}content(){let t=this.$anchorCell.node(-1),e=Te.get(t),n=this.$anchorCell.start(-1),r=e.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},o=[];for(let a=r.top;a0||g>0){let m=p.attrs;if(h>0&&(m=nr(m,0,h)),g>0&&(m=nr(m,m.colspan-g,g)),f.leftr.bottom){let m={...p.attrs,rowspan:Math.min(f.bottom,r.bottom)-Math.max(f.top,r.top)};f.top0)return!1;let n=t+this.$anchorCell.nodeAfter.attrs.rowspan,r=e+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(t,e=t){let n=t.node(-1),r=Te.get(n),i=t.start(-1),o=r.findCell(t.pos-i),s=r.findCell(e.pos-i),a=t.node(0);return o.top<=s.top?(o.top>0&&(t=a.resolve(i+r.map[o.left])),s.bottom0&&(e=a.resolve(i+r.map[s.left])),o.bottom0)return!1;let o=r+this.$anchorCell.nodeAfter.attrs.colspan,s=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,s)==e.width}eq(t){return t instanceof fe&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,e=t){let n=t.node(-1),r=Te.get(n),i=t.start(-1),o=r.findCell(t.pos-i),s=r.findCell(e.pos-i),a=t.node(0);return o.left<=s.left?(o.left>0&&(t=a.resolve(i+r.map[o.top*r.width])),s.right0&&(e=a.resolve(i+r.map[s.top*r.width])),o.right{e.push(et.node(r,r+n.nodeSize,{class:"selectedCell"}))}),Ce.create(t.doc,e)}function Vv({$from:t,$to:e}){if(t.pos==e.pos||t.pos=0&&!(t.after(i+1)=0&&!(e.before(o+1)>e.start(o));o--,r--);return n==r&&/row|table/.test(t.node(i).type.spec.tableRole)}function Gv({$from:t,$to:e}){let n,r;for(let i=t.depth;i>0;i--){let o=t.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){n=o;break}}for(let i=e.depth;i>0;i--){let o=e.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){r=o;break}}return n!==r&&e.parentOffset===0}function qv(t,e,n){let r=(e||t).selection,i=(e||t).doc,o,s;if(r instanceof Y&&(s=r.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")o=fe.create(i,r.from);else if(s=="row"){let a=i.resolve(r.from+1);o=fe.rowSelection(a,a)}else if(!n){let a=Te.get(r.node),l=r.from+1,c=l+a.map[a.width*a.height-1];o=fe.create(i,l+1,c)}}else r instanceof K&&Vv(r)?o=K.create(i,r.from):r instanceof K&&Gv(r)&&(o=K.create(i,r.$from.start(),r.$from.end()));return o&&(e||(e=t.tr)).setSelection(o),e}var jv=new ve("fix-tables");function th(t,e,n,r){let i=t.childCount,o=e.childCount;e:for(let s=0,a=0;s{i.type.spec.tableRole=="table"&&(n=Yv(t,i,o,n))};return e?e.doc!=t.doc&&th(e.doc,t.doc,0,r):t.doc.descendants(r),n}function Yv(t,e,n,r){let i=Te.get(e);if(!i.problems)return r;r||(r=t.tr);let o=[];for(let l=0;l0){let p="cell";u.firstChild&&(p=u.firstChild.type.spec.tableRole);let h=[];for(let m=0;m0&&r>0||e.child(0).type.spec.tableRole=="table");)n--,r--,e=e.child(0).content;let i=e.child(0),o=i.type.spec.tableRole,s=i.type.schema,a=[];if(o=="row")for(let l=0;l=0;s--){let{rowspan:a,colspan:l}=o.child(s).attrs;for(let c=i;c=e.length&&e.push(T.empty),n[i]r&&(f=f.type.createChecked(nr(f.attrs,f.attrs.colspan,u+f.attrs.colspan-r),f.content)),c.push(f),u+=f.attrs.colspan;for(let p=1;pi&&(d=d.type.create({...d.attrs,rowspan:Math.max(1,i-d.attrs.rowspan)},d.content)),l.push(d)}o.push(T.from(l))}n=o,e=i}return{width:t,height:e,rows:n}}function Qv(t,e,n,r,i,o,s){let a=t.doc.type.schema,l=nt(a),c,u;if(i>e.width)for(let d=0,f=0;de.height){let d=[];for(let h=0,g=(e.height-1)*e.width;h=e.width?!1:n.nodeAt(e.map[g+h]).type==l.header_cell;d.push(m?u||(u=l.header_cell.createAndFill()):c||(c=l.cell.createAndFill()))}let f=l.row.create(null,T.from(d)),p=[];for(let h=e.height;h{if(!i)return!1;let o=n.selection;if(o instanceof fe)return Jo(n,r,V.near(o.$headCell,e));if(t!="horiz"&&!o.empty)return!1;let s=nh(i,t,e);if(s==null)return!1;if(t=="horiz")return Jo(n,r,V.near(n.doc.resolve(o.head+e),e));{let a=n.doc.resolve(s),l=Zp(a,t,e),c;return l?c=V.near(l,1):e<0?c=V.near(n.doc.resolve(a.before(-1)),-1):c=V.near(n.doc.resolve(a.after(-1)),1),Jo(n,r,c)}}}function jo(t,e){return(n,r,i)=>{if(!i)return!1;let o=n.selection,s;if(o instanceof fe)s=o;else{let l=nh(i,t,e);if(l==null)return!1;s=new fe(n.doc.resolve(l))}let a=Zp(s.$headCell,t,e);return a?Jo(n,r,new fe(s.$anchorCell,a)):!1}}function Yo(t,e){let n=t.selection;if(!(n instanceof fe))return!1;if(e){let r=t.tr,i=nt(t.schema).cell.createAndFill().content;n.forEachCell((o,s)=>{o.content.eq(i)||r.replace(r.mapping.map(s+1),r.mapping.map(s+o.nodeSize-1),new D(i,0,0))}),r.docChanged&&e(r)}return!0}function tS(t,e){let n=t.state.doc,r=Fr(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new fe(r))),!0):!1}function nS(t,e,n){if(!Ft(t.state))return!1;let r=Jv(n),i=t.state.selection;if(i instanceof fe){r||(r={width:1,height:1,rows:[T.from(ql(nt(t.state.schema).cell,n))]});let o=i.$anchorCell.node(-1),s=i.$anchorCell.start(-1),a=Te.get(o).rectBetween(i.$anchorCell.pos-s,i.$headCell.pos-s);return r=Zv(r,a.right-a.left,a.bottom-a.top),Gp(t.state,t.dispatch,s,a,r),!0}else if(r){let o=Zo(t.state),s=o.start(-1);return Gp(t.state,t.dispatch,s,Te.get(o.node(-1)).findCell(o.pos-s),r),!0}else return!1}function rS(t,e){var n;if(e.ctrlKey||e.metaKey)return;let r=qp(t,e.target),i;if(e.shiftKey&&t.state.selection instanceof fe)o(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(i=Fr(t.state.selection.$anchor))!=null&&((n=Kl(t,e))==null?void 0:n.pos)!=i.pos)o(i,e),e.preventDefault();else if(!r)return;function o(l,c){let u=Kl(t,c),d=Nn.getState(t.state)==null;if(!u||!Yl(l,u))if(d)u=l;else return;let f=new fe(l,u);if(d||!t.state.selection.eq(f)){let p=t.state.tr.setSelection(f);d&&p.setMeta(Nn,l.pos),t.dispatch(p)}}function s(){t.root.removeEventListener("mouseup",s),t.root.removeEventListener("dragstart",s),t.root.removeEventListener("mousemove",a),Nn.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(Nn,-1))}function a(l){let c=l,u=Nn.getState(t.state),d;if(u!=null)d=t.state.doc.resolve(u);else if(qp(t,c.target)!=r&&(d=Kl(t,e),!d))return s();d&&o(d,c)}t.root.addEventListener("mouseup",s),t.root.addEventListener("dragstart",s),t.root.addEventListener("mousemove",a)}function nh(t,e,n){if(!(t.state.selection instanceof K))return null;let{$head:r}=t.state.selection;for(let i=r.depth-1;i>=0;i--){let o=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:o.childCount))return null;if(o.type.spec.tableRole=="cell"||o.type.spec.tableRole=="header_cell"){let a=r.before(i),l=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(l)?a:null}}return null}function qp(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function Kl(t,e){let n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?Fr(t.state.doc.resolve(n.pos)):null}var iS=class{constructor(t,e){this.node=t,this.cellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),jl(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,jl(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function jl(t,e,n,r,i,o){var s;let a=0,l=!0,c=e.firstChild,u=t.firstChild;if(u){for(let d=0,f=0;dnew n(a,e,l),new Xo(-1,!1)},apply(o,s){return s.apply(o)}},props:{attributes:o=>{let s=Nt.getState(o);return s&&s.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(o,s)=>{oS(o,s,t,e,r)},mouseleave:o=>{sS(o)},mousedown:(o,s)=>{aS(o,s,e)}},decorations:o=>{let s=Nt.getState(o);if(s&&s.activeHandle>-1)return pS(o,s.activeHandle)},nodeViews:{}}});return i}var Xo=class{constructor(t,e){this.activeHandle=t,this.dragging=e}apply(t){let e=this,n=t.getMeta(Nt);if(n&&n.setHandle!=null)return new Xo(n.setHandle,!1);if(n&&n.setDragging!==void 0)return new Xo(e.activeHandle,n.setDragging);if(e.activeHandle>-1&&t.docChanged){let r=t.mapping.map(e.activeHandle,-1);return Gl(t.doc.resolve(r))||(r=-1),new Xo(r,e.dragging)}return e}};function oS(t,e,n,r,i){let o=Nt.getState(t.state);if(o&&!o.dragging){let s=cS(e.target),a=-1;if(s){let{left:l,right:c}=s.getBoundingClientRect();e.clientX-l<=n?a=jp(t,e,"left",n):c-e.clientX<=n&&(a=jp(t,e,"right",n))}if(a!=o.activeHandle){if(!i&&a!==-1){let l=t.state.doc.resolve(a),c=l.node(-1),u=Te.get(c),d=l.start(-1);if(u.colCount(l.pos-d)+l.nodeAfter.attrs.colspan-1==u.width-1)return}ih(t,a)}}}function sS(t){let e=Nt.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&ih(t,-1)}function aS(t,e,n){let r=Nt.getState(t.state);if(!r||r.activeHandle==-1||r.dragging)return!1;let i=t.state.doc.nodeAt(r.activeHandle),o=lS(t,r.activeHandle,i.attrs);t.dispatch(t.state.tr.setMeta(Nt,{setDragging:{startX:e.clientX,startWidth:o}}));function s(l){window.removeEventListener("mouseup",s),window.removeEventListener("mousemove",a);let c=Nt.getState(t.state);c?.dragging&&(uS(t,c.activeHandle,Yp(c.dragging,l,n)),t.dispatch(t.state.tr.setMeta(Nt,{setDragging:null})))}function a(l){if(!l.which)return s(l);let c=Nt.getState(t.state);if(c&&c.dragging){let u=Yp(c.dragging,l,n);dS(t,c.activeHandle,u,n)}}return window.addEventListener("mouseup",s),window.addEventListener("mousemove",a),e.preventDefault(),!0}function lS(t,e,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let o=t.domAtPos(e),a=o.node.childNodes[o.offset].offsetWidth,l=n;if(r)for(let c=0;c0?-1:0;Kv(e,r,i+o)&&(o=i==0||i==e.width?null:0);for(let s=0;s0&&i0&&e.map[a-1]==l||i0?-1:0;mS(e,r,i+l)&&(l=i==0||i==e.height?null:0);for(let c=0,u=e.width*i;c0&&i0&&u==e.map[c-e.width]){let d=n.nodeAt(u).attrs;t.setNodeMarkup(t.mapping.slice(a).map(u+r),null,{...d,rowspan:d.rowspan-1}),l+=d.colspan-1}else if(i0&&n[o]==n[o-1]||r.right0&&n[i]==n[i-t]||r.bottomn[r.type.spec.tableRole])(t,e)}function yS(t){return(e,n)=>{var r;let i=e.selection,o,s;if(i instanceof fe){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;o=i.$anchorCell.nodeAfter,s=i.$anchorCell.pos}else{if(o=zv(i.$from),!o)return!1;s=(r=Fr(i.$from))==null?void 0:r.pos}if(o==null||s==null||o.attrs.colspan==1&&o.attrs.rowspan==1)return!1;if(n){let a=o.attrs,l=[],c=a.colwidth;a.rowspan>1&&(a={...a,rowspan:1}),a.colspan>1&&(a={...a,colspan:1});let u=Yt(e),d=e.tr;for(let p=0;p{s.attrs[t]!==e&&o.setNodeMarkup(a,null,{...s.attrs,[t]:e})}):o.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[t]:e}),r(o)}return!0}}function ES(t){return function(e,n){if(!Ft(e))return!1;if(n){let r=nt(e.schema),i=Yt(e),o=e.tr,s=i.map.cellsInRect(t=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:t=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),a=s.map(l=>i.table.nodeAt(l));for(let l=0;l{let h=p+o.tableStart,g=s.doc.nodeAt(h);g&&s.setNodeMarkup(h,f,g.attrs)}),r(s)}return!0}}var G_=Hr("row",{useDeprecatedLogic:!0}),q_=Hr("column",{useDeprecatedLogic:!0}),hh=Hr("cell",{useDeprecatedLogic:!0});function wS(t,e){if(e<0){let n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,i=t.before();r>=0;r--){let o=t.node(-1).child(r),s=o.lastChild;if(s)return i-1-s.nodeSize;i-=o.nodeSize}}else{if(t.index()0;r--)if(n.node(r).type.spec.tableRole=="table")return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function gh({allowTableNodeSelection:t=!1}={}){return new ge({key:Nn,state:{init(){return null},apply(e,n){let r=e.getMeta(Nn);if(r!=null)return r==-1?null:r;if(n==null||!e.docChanged)return n;let{deleted:i,pos:o}=e.mapping.mapResult(n);return i?null:o}},props:{decorations:Wv,handleDOMEvents:{mousedown:rS},createSelectionBetween(e){return Nn.getState(e.state)!=null?e.state.selection:null},handleTripleClick:tS,handleKeyDown:eS,handlePaste:nS},appendTransaction(e,n,r){return qv(r,Jl(r,n),t)}})}function bh(t,e,n,r,i,o){let s=0,a=!0,l=e.firstChild,c=t.firstChild;for(let u=0,d=0;u{let r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),t.cached.tableNodeTypes=e,e}function SS(t,e,n,r,i){let o=vS(t),s=[],a=[];for(let c=0;c{let{selection:e}=t.state;if(!xS(e))return!1;let n=0,r=Il(e.ranges[0].$from,o=>o.type.name==="table");return r?.node.descendants(o=>{if(o.type.name==="table")return!1;["tableCell","tableHeader"].includes(o.type.name)&&(n+=1)}),n===e.ranges.length?(t.commands.deleteTable(),!0):!1},Eh=$.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:ec,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({HTMLAttributes:t}){return["table",B(this.options.HTMLAttributes,t),["tbody",0]]},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:o})=>{let s=SS(o.schema,t,e,n);if(i){let a=r.selection.anchor+1;r.replaceSelectionWith(s).scrollIntoView().setSelection(K.near(r.doc.resolve(a)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>sh(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>ah(t,e),deleteColumn:()=>({state:t,dispatch:e})=>lh(t,e),addRowBefore:()=>({state:t,dispatch:e})=>uh(t,e),addRowAfter:()=>({state:t,dispatch:e})=>dh(t,e),deleteRow:()=>({state:t,dispatch:e})=>fh(t,e),deleteTable:()=>({state:t,dispatch:e})=>mh(t,e),mergeCells:()=>({state:t,dispatch:e})=>Xl(t,e),splitCell:()=>({state:t,dispatch:e})=>Zl(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>Hr("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>Hr("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>hh(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>Xl(t,e)?!0:Zl(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>ph(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>Ql(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>Ql(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&Jl(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){let r=fe.create(e.doc,t.anchorCell,t.headCell);e.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:Qo,"Mod-Backspace":Qo,Delete:Qo,"Mod-Delete":Qo}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[rh({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],gh({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){let e={name:t.name,options:t.options,storage:t.storage};return{tableRole:ee(F(t,"tableRole",e))}}});var wh=$.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{let e=t.getAttribute("colwidth");return e?[parseInt(e,10)]:null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",B(this.options.HTMLAttributes,t),0]}});var vh=$.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{let e=t.getAttribute("colwidth");return e?[parseInt(e,10)]:null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",B(this.options.HTMLAttributes,t),0]}});var Sh=$.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",B(this.options.HTMLAttributes,t),0]}});var xh=$.create({name:"text",group:"inline"});var kh=we.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",B(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});var kS=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))$/,MS=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))/g,Mh=we.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",B(this.options.HTMLAttributes,t),0]},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Mt({find:kS,type:this.type})]},addPasteRules(){return[ht({find:MS,type:this.type})]}});var tc=$.create({name:"checkedList",priority:50,addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{class:"checked-list"}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul",getAttrs:t=>t.classList.contains("checked-list"),priority:1e3}]},renderHTML({HTMLAttributes:t}){return["ul",B(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleCheckedList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}}});var nc=$.create({name:"lead",group:"block",content:"block+",addOptions(){return{HTMLAttributes:{class:"lead"}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("lead")}]},renderHTML({node:t,HTMLAttributes:e}){return["div",B(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleLead:()=>({commands:t})=>t.toggleWrap(this.name)}}});var NS="aaa1rp3barth4b0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0faromeo7ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re2s2c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y0eats7k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking0channel11l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t0isalat7u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0at2delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d0network8tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntdoor4ier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5gtv3iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0eles2s3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1nder2le4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster5ia3d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4de2k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0cys3drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7serati6ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic3tual5v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rthwesternmutual14on4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3ssagens7y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cher3ks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w0time7i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ffany5ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0channel7ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xF6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lkswagen7vo3te1ing3o2yage5u0elos6wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",TS="\u03B5\u03BB1\u03C52\u0431\u04331\u0435\u043B3\u0434\u0435\u0442\u04384\u0435\u044E2\u043A\u0430\u0442\u043E\u043B\u0438\u043A6\u043E\u043C3\u043C\u043A\u04342\u043E\u043D1\u0441\u043A\u0432\u04306\u043E\u043D\u043B\u0430\u0439\u043D5\u0440\u04333\u0440\u0443\u04412\u04442\u0441\u0430\u0439\u04423\u0440\u04313\u0443\u043A\u04403\u049B\u0430\u04373\u0570\u0561\u05753\u05D9\u05E9\u05E8\u05D0\u05DC5\u05E7\u05D5\u05DD3\u0627\u0628\u0648\u0638\u0628\u064A5\u062A\u0635\u0627\u0644\u0627\u062A6\u0631\u0627\u0645\u0643\u06485\u0644\u0627\u0631\u062F\u06464\u0628\u062D\u0631\u064A\u06465\u062C\u0632\u0627\u0626\u06315\u0633\u0639\u0648\u062F\u064A\u06296\u0639\u0644\u064A\u0627\u06465\u0645\u063A\u0631\u06285\u0645\u0627\u0631\u0627\u062A5\u06CC\u0631\u0627\u06465\u0628\u0627\u0631\u062A2\u0632\u0627\u06314\u064A\u062A\u06433\u06BE\u0627\u0631\u062A5\u062A\u0648\u0646\u06334\u0633\u0648\u062F\u0627\u06463\u0631\u064A\u06295\u0634\u0628\u0643\u06294\u0639\u0631\u0627\u06422\u06282\u0645\u0627\u06464\u0641\u0644\u0633\u0637\u064A\u06466\u0642\u0637\u06313\u0643\u0627\u062B\u0648\u0644\u064A\u06436\u0648\u06453\u0645\u0635\u06312\u0644\u064A\u0633\u064A\u06275\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u06277\u0642\u06394\u0647\u0645\u0631\u0627\u06475\u067E\u0627\u06A9\u0633\u062A\u0627\u06467\u0680\u0627\u0631\u062A4\u0915\u0949\u092E3\u0928\u0947\u091F3\u092D\u093E\u0930\u09240\u092E\u094D3\u094B\u09245\u0938\u0902\u0917\u0920\u09285\u09AC\u09BE\u0982\u09B2\u09BE5\u09AD\u09BE\u09B0\u09A42\u09F0\u09A44\u0A2D\u0A3E\u0A30\u0A244\u0AAD\u0ABE\u0AB0\u0AA44\u0B2D\u0B3E\u0B30\u0B244\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE6\u0BB2\u0B99\u0BCD\u0B95\u0BC86\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD11\u0C2D\u0C3E\u0C30\u0C24\u0C4D5\u0CAD\u0CBE\u0CB0\u0CA44\u0D2D\u0D3E\u0D30\u0D24\u0D025\u0DBD\u0D82\u0D9A\u0DCF4\u0E04\u0E2D\u0E213\u0E44\u0E17\u0E223\u0EA5\u0EB2\u0EA73\u10D2\u10D42\u307F\u3093\u306A3\u30A2\u30DE\u30BE\u30F34\u30AF\u30E9\u30A6\u30C94\u30B0\u30FC\u30B0\u30EB4\u30B3\u30E02\u30B9\u30C8\u30A23\u30BB\u30FC\u30EB3\u30D5\u30A1\u30C3\u30B7\u30E7\u30F36\u30DD\u30A4\u30F3\u30C84\u4E16\u754C2\u4E2D\u4FE11\u56FD1\u570B1\u6587\u7F513\u4E9A\u9A6C\u900A3\u4F01\u4E1A2\u4F5B\u5C712\u4FE1\u606F2\u5065\u5EB72\u516B\u53662\u516C\u53F81\u76CA2\u53F0\u6E7E1\u70632\u5546\u57CE1\u5E971\u68072\u5609\u91CC0\u5927\u9152\u5E975\u5728\u7EBF2\u5927\u62FF2\u5929\u4E3B\u65593\u5A31\u4E502\u5BB6\u96FB2\u5E7F\u4E1C2\u5FAE\u535A2\u6148\u55842\u6211\u7231\u4F603\u624B\u673A2\u62DB\u80582\u653F\u52A11\u5E9C2\u65B0\u52A0\u57612\u95FB2\u65F6\u5C1A2\u66F8\u7C4D2\u673A\u67842\u6DE1\u9A6C\u95213\u6E38\u620F2\u6FB3\u95802\u70B9\u770B2\u79FB\u52A82\u7EC4\u7EC7\u673A\u67844\u7F51\u57401\u5E971\u7AD91\u7EDC2\u8054\u901A2\u8C37\u6B4C2\u8D2D\u72692\u901A\u8CA92\u96C6\u56E22\u96FB\u8A0A\u76C8\u79D14\u98DE\u5229\u6D663\u98DF\u54C12\u9910\u53852\u9999\u683C\u91CC\u62C93\u6E2F2\uB2F7\uB1371\uCEF42\uC0BC\uC1312\uD55C\uAD6D2",Vr=(t,e)=>{for(let n in e)t[n]=e[n];return t},ac="numeric",lc="ascii",cc="alpha",rs="asciinumeric",es="alphanumeric",uc="domain",Dh="emoji",_S="scheme",CS="slashscheme",Nh="whitespace";function OS(t,e){return t in e||(e[t]=[]),e[t]}function sr(t,e,n){e[ac]&&(e[rs]=!0,e[es]=!0),e[lc]&&(e[rs]=!0,e[cc]=!0),e[rs]&&(e[es]=!0),e[cc]&&(e[es]=!0),e[es]&&(e[uc]=!0),e[Dh]&&(e[uc]=!0);for(let r in e){let i=OS(r,n);i.indexOf(t)<0&&i.push(t)}}function AS(t,e){let n={};for(let r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function mt(t){t===void 0&&(t=null),this.j={},this.jr=[],this.jd=null,this.t=t}mt.groups={};mt.prototype={accepts(){return!!this.t},go(t){let e=this,n=e.j[t];if(n)return n;for(let r=0;rt.ta(e,n,r,i),Tt=(t,e,n,r,i)=>t.tr(e,n,r,i),Th=(t,e,n,r,i)=>t.ts(e,n,r,i),R=(t,e,n,r,i)=>t.tt(e,n,r,i),un="WORD",dc="UWORD",Ai="LOCALHOST",fc="TLD",pc="UTLD",is="SCHEME",$r="SLASH_SCHEME",hc="NUM",Lh="WS",mc="NL",Ur="OPENBRACE",Ti="OPENBRACKET",_i="OPENANGLEBRACKET",Ci="OPENPAREN",ir="CLOSEBRACE",Kr="CLOSEBRACKET",Wr="CLOSEANGLEBRACKET",or="CLOSEPAREN",ss="AMPERSAND",as="APOSTROPHE",ls="ASTERISK",_n="AT",cs="BACKSLASH",us="BACKTICK",ds="CARET",Cn="COLON",gc="COMMA",fs="DOLLAR",Jt="DOT",ps="EQUALS",bc="EXCLAMATION",Xt="HYPHEN",hs="PERCENT",ms="PIPE",gs="PLUS",bs="POUND",ys="QUERY",yc="QUOTE",Ec="SEMI",Zt="SLASH",Oi="TILDE",Es="UNDERSCORE",Ph="EMOJI",ws="SYM",Bh=Object.freeze({__proto__:null,WORD:un,UWORD:dc,LOCALHOST:Ai,TLD:fc,UTLD:pc,SCHEME:is,SLASH_SCHEME:$r,NUM:hc,WS:Lh,NL:mc,OPENBRACE:Ur,OPENBRACKET:Ti,OPENANGLEBRACKET:_i,OPENPAREN:Ci,CLOSEBRACE:ir,CLOSEBRACKET:Kr,CLOSEANGLEBRACKET:Wr,CLOSEPAREN:or,AMPERSAND:ss,APOSTROPHE:as,ASTERISK:ls,AT:_n,BACKSLASH:cs,BACKTICK:us,CARET:ds,COLON:Cn,COMMA:gc,DOLLAR:fs,DOT:Jt,EQUALS:ps,EXCLAMATION:bc,HYPHEN:Xt,PERCENT:hs,PIPE:ms,PLUS:gs,POUND:bs,QUERY:ys,QUOTE:yc,SEMI:Ec,SLASH:Zt,TILDE:Oi,UNDERSCORE:Es,EMOJI:Ph,SYM:ws}),zr=/[a-z]/,rc=/\p{L}/u,ic=/\p{Emoji}/u;var oc=/\d/,_h=/\s/;var Ch=` +`,RS="\uFE0F",IS="\u200D",ts=null,ns=null;function DS(t){t===void 0&&(t=[]);let e={};mt.groups=e;let n=new mt;ts==null&&(ts=Oh(NS)),ns==null&&(ns=Oh(TS)),R(n,"'",as),R(n,"{",Ur),R(n,"[",Ti),R(n,"<",_i),R(n,"(",Ci),R(n,"}",ir),R(n,"]",Kr),R(n,">",Wr),R(n,")",or),R(n,"&",ss),R(n,"*",ls),R(n,"@",_n),R(n,"`",us),R(n,"^",ds),R(n,":",Cn),R(n,",",gc),R(n,"$",fs),R(n,".",Jt),R(n,"=",ps),R(n,"!",bc),R(n,"-",Xt),R(n,"%",hs),R(n,"|",ms),R(n,"+",gs),R(n,"#",bs),R(n,"?",ys),R(n,'"',yc),R(n,"/",Zt),R(n,";",Ec),R(n,"~",Oi),R(n,"_",Es),R(n,"\\",cs);let r=Tt(n,oc,hc,{[ac]:!0});Tt(r,oc,r);let i=Tt(n,zr,un,{[lc]:!0});Tt(i,zr,i);let o=Tt(n,rc,dc,{[cc]:!0});Tt(o,zr),Tt(o,rc,o);let s=Tt(n,_h,Lh,{[Nh]:!0});R(n,Ch,mc,{[Nh]:!0}),R(s,Ch),Tt(s,_h,s);let a=Tt(n,ic,Ph,{[Dh]:!0});Tt(a,ic,a),R(a,RS,a);let l=R(a,IS);Tt(l,ic,a);let c=[[zr,i]],u=[[zr,null],[rc,o]];for(let d=0;dd[0]>f[0]?1:-1);for(let d=0;d=0?h[uc]=!0:zr.test(f)?oc.test(f)?h[rs]=!0:h[lc]=!0:h[ac]=!0,Th(n,f,f,h)}return Th(n,"localhost",Ai,{ascii:!0}),n.jd=new mt(ws),{start:n,tokens:Vr({groups:e},Bh)}}function LS(t,e){let n=PS(e.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,i=[],o=0,s=0;for(;s=0&&(d+=n[s].length,f++),c+=n[s].length,o+=n[s].length,s++;o-=d,s-=f,c-=d,i.push({t:u.t,v:e.slice(o-c,o),s:o-c,e:o})}return i}function PS(t){let e=[],n=t.length,r=0;for(;r56319||r+1===n||(o=t.charCodeAt(r+1))<56320||o>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}function Tn(t,e,n,r,i){let o,s=e.length;for(let a=0;a=0;)o++;if(o>0){e.push(n.join(""));for(let s=parseInt(t.substring(r,r+o),10);s>0;s--)n.pop();r+=o}else n.push(t[r]),r++}return e}var Ri={defaultProtocol:"http",events:null,format:Ah,formatHref:Ah,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function wc(t,e){e===void 0&&(e=null);let n=Vr({},Ri);t&&(n=Vr(n,t instanceof wc?t.o:t));let r=n.ignoreTags,i=[];for(let o=0;on?r.substring(0,n)+"\u2026":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t){return t===void 0&&(t=Ri.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){let e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),i=t.get("tagName",n,e),o=this.toFormattedString(t),s={},a=t.get("className",n,e),l=t.get("target",n,e),c=t.get("rel",n,e),u=t.getObj("attributes",n,e),d=t.getObj("events",n,e);return s.href=r,a&&(s.class=a),l&&(s.target=l),c&&(s.rel=c),u&&Vr(s,u),{tagName:i,attributes:s,content:o,eventListeners:d}}};function vs(t,e){class n extends Fh{constructor(i,o){super(i,o),this.t=t}}for(let r in e)n.prototype[r]=e[r];return n.t=t,n}var Rh=vs("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Ih=vs("text"),BS=vs("nl"),rr=vs("url",{isLink:!0,toHref(t){return t===void 0&&(t=Ri.defaultProtocol),this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){let t=this.tk;return t.length>=2&&t[0].t!==Ai&&t[1].t===Cn}});var Ue=t=>new mt(t);function FS(t){let{groups:e}=t,n=e.domain.concat([ss,ls,_n,cs,us,ds,fs,ps,Xt,hc,hs,ms,gs,bs,Zt,ws,Oi,Es]),r=[as,Wr,ir,Kr,or,Cn,gc,Jt,bc,_i,Ur,Ti,Ci,ys,yc,Ec],i=[ss,as,ls,cs,us,ds,ir,fs,ps,Xt,Ur,hs,ms,gs,bs,ys,Zt,ws,Oi,Es],o=Ue(),s=R(o,Oi);q(s,i,s),q(s,e.domain,s);let a=Ue(),l=Ue(),c=Ue();q(o,e.domain,a),q(o,e.scheme,l),q(o,e.slashscheme,c),q(a,i,s),q(a,e.domain,a);let u=R(a,_n);R(s,_n,u),R(l,_n,u),R(c,_n,u);let d=R(s,Jt);q(d,i,s),q(d,e.domain,s);let f=Ue();q(u,e.domain,f),q(f,e.domain,f);let p=R(f,Jt);q(p,e.domain,f);let h=Ue(Rh);q(p,e.tld,h),q(p,e.utld,h),R(u,Ai,h);let g=R(f,Xt);q(g,e.domain,f),q(h,e.domain,f),R(h,Jt,p),R(h,Xt,g);let m=R(h,Cn);q(m,e.numeric,Rh);let y=R(a,Xt),M=R(a,Jt);q(y,e.domain,a),q(M,i,s),q(M,e.domain,a);let x=Ue(rr);q(M,e.tld,x),q(M,e.utld,x),q(x,e.domain,a),q(x,i,s),R(x,Jt,M),R(x,Xt,y),R(x,_n,u);let b=R(x,Cn),_=Ue(rr);q(b,e.numeric,_);let w=Ue(rr),I=Ue();q(w,n,w),q(w,r,I),q(I,n,w),q(I,r,I),R(x,Zt,w),R(_,Zt,w);let U=R(l,Cn),O=R(c,Cn),J=R(O,Zt),ne=R(J,Zt);q(l,e.domain,a),R(l,Jt,M),R(l,Xt,y),q(c,e.domain,a),R(c,Jt,M),R(c,Xt,y),q(U,e.domain,w),R(U,Zt,w),q(ne,e.domain,w),q(ne,n,w),R(ne,Zt,w);let ie=R(w,Ur),Z=R(w,Ti),re=R(w,_i),ce=R(w,Ci);R(I,Ur,ie),R(I,Ti,Z),R(I,_i,re),R(I,Ci,ce),R(ie,ir,w),R(Z,Kr,w),R(re,Wr,w),R(ce,or,w),R(ie,ir,w);let N=Ue(rr),E=Ue(rr),v=Ue(rr),C=Ue(rr);q(ie,n,N),q(Z,n,E),q(re,n,v),q(ce,n,C);let P=Ue(),j=Ue(),Q=Ue(),pe=Ue();return q(ie,r),q(Z,r),q(re,r),q(ce,r),q(N,n,N),q(E,n,E),q(v,n,v),q(C,n,C),q(N,r,N),q(E,r,E),q(v,r,v),q(C,r,C),q(P,n,P),q(j,n,E),q(Q,n,v),q(pe,n,C),q(P,r,P),q(j,r,j),q(Q,r,Q),q(pe,r,pe),R(E,Kr,w),R(v,Wr,w),R(C,or,w),R(N,ir,w),R(j,Kr,w),R(Q,Wr,w),R(pe,or,w),R(P,or,w),R(o,Ai,x),R(o,mc,BS),{start:o,tokens:Bh}}function HS(t,e,n){let r=n.length,i=0,o=[],s=[];for(;i=0&&f++,i++,u++;if(f<0)i-=u,i0&&(o.push(sc(Ih,e,s)),s=[]),i-=f,u-=f;let p=d.t,h=n.slice(i-u,i);o.push(sc(p,e,h))}}return s.length>0&&o.push(sc(Ih,e,s)),o}function sc(t,e,n){let r=n[0].s,i=n[n.length-1].e,o=e.slice(r,i);return new t(o,n)}var zS=typeof console<"u"&&console&&console.warn||(()=>{}),$S="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Me={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Hh(){mt.groups={},Me.scanner=null,Me.parser=null,Me.tokenQueue=[],Me.pluginQueue=[],Me.customSchemes=[],Me.initialized=!1}function vc(t,e){if(e===void 0&&(e=!1),Me.initialized&&zS(`linkifyjs: already initialized - will not register custom scheme "${t}" ${$S}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format. 1. Must only contain digits, lowercase ASCII letters or "-" 2. Cannot start or end with "-" - 3. "-" cannot repeat`);Ce.customSchemes.push([t,e])}function zS(){Ce.scanner=RS(Ce.customSchemes);for(let t=0;t{let i=e.some(u=>u.docChanged)&&!n.doc.eq(r.doc),o=e.some(u=>u.getMeta("preventAutolink"));if(!i||o)return;let{tr:s}=r,a=fp(n.doc,[...e]),{mapping:l}=a;if(hp(a).forEach(({oldRange:u,newRange:d})=>{Pi(u.from,u.to,n.doc).filter(m=>m.mark.type===t.type).forEach(m=>{let g=l.map(m.from),y=l.map(m.to),S=Pi(g,y,r.doc).filter(K=>K.mark.type===t.type);if(!S.length)return;let M=S[0],b=n.doc.textBetween(m.from,m.to,void 0," "),_=r.doc.textBetween(M.from,M.to,void 0," "),w=xc(b),D=xc(_);w&&!D&&s.removeMark(M.from,M.to,t.type)});let f=pp(r.doc,d,m=>m.isTextblock),p,h;if(f.length>1?(p=f[0],h=r.doc.textBetween(p.pos,p.pos+p.node.nodeSize,void 0," ")):f.length&&r.doc.textBetween(d.from,d.to," "," ").endsWith(" ")&&(p=f[0],h=r.doc.textBetween(p.pos,d.to,void 0," ")),p&&h){let m=h.split(" ").filter(S=>S!=="");if(m.length<=0)return!1;let g=m[m.length-1],y=p.pos+h.lastIndexOf(g);if(!g)return!1;Ts(g).filter(S=>S.isLink).filter(S=>t.validate?t.validate(S.value):!0).map(S=>({...S,from:y+S.start+1,to:y+S.end+1})).forEach(S=>{s.addMark(S.from,S.to,t.type.create({href:S.href}))})}}),!!s.steps.length)return s}})}function $S(t){return new me({key:new ve("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,o,s;if(r.button!==0)return!1;let a=Pl(e.state,t.type.name),l=(i=r.target)===null||i===void 0?void 0:i.closest("a"),c=(o=l?.href)!==null&&o!==void 0?o:a.href,u=(s=l?.target)!==null&&s!==void 0?s:a.target;return l&&c?(window.open(c,u),!0):!1}}})}function KS(t){return new me({key:new ve("handlePasteLink"),props:{handlePaste:(e,n,r)=>{let{state:i}=e,{selection:o}=i,{empty:s}=o;if(s)return!1;let a="";r.content.forEach(c=>{a+=c.textContent});let l=Ts(a).find(c=>c.isLink&&c.value===a);return!a||!l?!1:(t.editor.commands.setMark(t.type,{href:l.href}),!0)}}})}var $h=be.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach(t=>{if(typeof t=="string"){Sc(t);return}Sc(t.scheme,t.optionalSlashes)})},onDestroy(){zh()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}},addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:'a[href]:not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:t}){return["a",B(this.options.HTMLAttributes,t),0]},addCommands(){return{setLink:t=>({chain:e})=>e().setMark(this.name,t).setMeta("preventAutolink",!0).run(),toggleLink:t=>({chain:e})=>e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[yt({find:t=>Ts(t).filter(e=>this.options.validate?this.options.validate(e.value):!0).filter(e=>e.isLink).map(e=>({text:e.value,index:e.start,data:e})),type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){let t=[];return this.options.autolink&&t.push(US({type:this.type,validate:this.options.validate})),this.options.openOnClick&&t.push($S({type:this.type})),this.options.linkOnPaste&&t.push(KS({editor:this.editor,type:this.type})),t}});var kc=$h.extend({addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{},validate:void 0}},addAttributes(){return{href:{default:null},id:{default:null},target:{default:this.options.HTMLAttributes.target},hreflang:{default:null},rel:{default:null},referrerpolicy:{default:null},class:{default:null},as_button:{default:null,parseHTML:t=>t.getAttribute("data-as-button")||t.getAttribute("as_button"),renderHTML:t=>t.as_button?{"data-as-button":t.as_button}:{}},button_theme:{default:null,parseHTML:t=>t.getAttribute("data-as-button-theme")||t.getAttribute("button_theme"),renderHTML:t=>!t.button_theme||t.button_theme.length===0?{}:{"data-as-button-theme":t.button_theme}}}}});var WS=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Kh=z.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",B(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[qo({find:WS,type:this.type,getAttributes:t=>{let[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}});var Mc=Kh.extend({addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}}});var Wh=z.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",B(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}});var Tc=Wh.extend({addAttributes(){return{class:{default:null}}}});var Nc=be.create({name:"small",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"small"}]},renderHTML({HTMLAttributes:t}){return["small",B(this.options.HTMLAttributes,t),0]},addCommands(){return{setSmall:()=>({commands:t})=>t.setMark(this.name),toggleSmall:()=>({commands:t})=>t.toggleMark(this.name),unsetSmall:()=>({commands:t})=>t.unsetMark(this.name)}}});function Vh(t,e=null){return e?t.createChecked(null,e):t.createAndFill()}function Gh(t){if(t.cached.gridNodeTypes)return t.cached.gridNodeTypes;let e={};return Object.keys(t.nodes).forEach(n=>{let r=t.nodes[n];r.spec.gridRole&&(e[r.spec.gridRole]=r)}),t.cached.gridNodeTypes=e,e}function qh(t,e,n,r){let i=Gh(t),o=[];for(let s=0;st.getAttribute("type")},cols:{default:2,parseHTML:t=>t.getAttribute("cols")}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-grid")&&null}]},renderHTML({HTMLAttributes:t}){return["div",B(this.options.HTMLAttributes,t),0]},addCommands(){return{insertGrid:({cols:t=3,type:e="responsive"}={})=>({tr:n,dispatch:r,editor:i})=>{let o=qh(i.schema,t,e);if(r){let s=n.selection.anchor+1;n.replaceSelectionWith(o).scrollIntoView().setSelection($.near(n.doc.resolve(s)))}return!0}}},addKeyboardShortcuts(){return{"Mod-Alt-G":()=>this.editor.commands.insertGrid()}},extendNodeSchema(t){let e={name:t.name,options:t.options,storage:t.storage};return{gridRole:ee(H(t,"gridRole",e))}}});var Cc=z.create({name:"gridColumn",content:"block+",gridRole:"column",isolating:!0,addOptions(){return{HTMLAttributes:{class:"filament-tiptap-grid__column"}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-grid__column")&&null}]},renderHTML({HTMLAttributes:t}){return["div",B(this.options.HTMLAttributes,t),0]}});var Yh=t=>t.match(/(youtube\.com|youtu\.be)(.+)?$/),jh=(t=!1)=>t?"https://www.youtube-nocookie.com/embed/":"https://www.youtube.com/embed/",Jh=t=>{let{url:e,controls:n,nocookie:r,startAt:i}=t;if(e.includes("/embed/"))return e;if(e.includes("youtu.be")){let c=e.split("/").pop();return c?`${jh(r)}${c}`:null}let s=/v=([-\w]+)/gm.exec(e);if(!s||!s[1])return null;let a=`${jh(r)}${s[1]}`,l=[];return n?l.push("controls=1"):l.push("controls=0"),i&&l.push(`start=${i}`),l.length&&(a+=`?${l.join("&")}`),a};var Oc=z.create({name:"youtube",selectable:!0,draggable:!0,atom:!0,addOptions(){return{inline:!1,HTMLAttributes:{},width:640,height:480}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},addAttributes(){return{style:{default:null,parseHTML:t=>t.getAttribute("style")},src:{default:null},width:{default:this.options.width,parseHTML:t=>t.getAttribute("width")},height:{default:this.options.height,parseHTML:t=>t.getAttribute("height")},responsive:{default:!0,parseHTML:t=>t.classList.contains("responsive")??!1},start:{default:0},controls:{default:!0},nocookie:{default:!1},"data-aspect-width":{default:null,parseHTML:t=>t.getAttribute("data-aspect-width")},"data-aspect-height":{default:null,parseHTML:t=>t.getAttribute("data-aspect-height")}}},parseHTML(){return[{tag:"div[data-youtube-video] iframe"}]},addCommands(){return{setYoutubeVideo:t=>({commands:e})=>Yh(t.src)?e.insertContent({type:this.name,attrs:t}):!1}},renderHTML({HTMLAttributes:t}){let e=Jh({url:t.src,controls:t.controls,nocookie:t.nocookie,startAt:t.start||0});return["div",{"data-youtube-video":"",class:t.responsive?"responsive":null},["iframe",{src:e,width:t.width,height:t.height,allowfullscreen:this.options.allowFullscreen,style:t.responsive?`aspect-ratio: ${t["data-aspect-width"]} / ${t["data-aspect-height"]}; width: 100%; height: auto;`:null,"data-aspect-width":t.responsive?t["data-aspect-width"]:null,"data-aspect-height":t.responsive?t["data-aspect-height"]:null}]]}});var Xh=t=>t.match(/(vimeo\.com)(.+)?$/),Zh=t=>{let{url:e,autoplay:n,loop:r,title:i,byline:o,portrait:s}=t;if(e.includes("/video/"))return e;let l=/\.com\/([0-9]+)/gm.exec(e);if(!l||!l[1])return null;let c=`https://player.vimeo.com/video/${l[1]}`,u=[`autoplay=${n}`,`loop=${r}`,`title=${i}`,`byline=${o}`,`portrait=${s}`];return c+=`?${u.join("&")}`,c};var Ac=z.create({name:"vimeo",selectable:!0,draggable:!0,atom:!0,addOptions(){return{inline:!1,HTMLAttributes:{},allowFullscreen:!0,width:640,height:480}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},addAttributes(){return{style:{default:null,parseHTML:t=>t.getAttribute("style")},src:{default:null},width:{default:this.options.width,parseHTML:t=>t.getAttribute("width")},height:{default:this.options.height,parseHTML:t=>t.getAttribute("height")},autoplay:{default:0},loop:{default:0},title:{default:0},byline:{default:0},portrait:{default:0},responsive:{default:!0,parseHTML:t=>t.classList.contains("responsive")??!1},"data-aspect-width":{default:null,parseHTML:t=>t.getAttribute("data-aspect-width")},"data-aspect-height":{default:null,parseHTML:t=>t.getAttribute("data-aspect-height")}}},parseHTML(){return[{tag:"div[data-vimeo-video] iframe"}]},addCommands(){return{setVimeoVideo:t=>({commands:e})=>Xh(t.src)?e.insertContent({type:this.name,attrs:t}):!1}},renderHTML({HTMLAttributes:t}){let e=Zh({url:t.src,autoplay:t?.autoplay||0,loop:t?.loop||0,title:t?.title||0,byline:t?.byline||0,portrait:t?.portrait||0});return["div",{"data-vimeo-video":"",class:t.responsive?"responsive":null},["iframe",{src:e,width:t.width,height:t.height,allowfullscreen:this.options.allowfullscreen,frameborder:0,allow:"autoplay; fullscreen; picture-in-picture",style:t.responsive?`aspect-ratio: ${t["data-aspect-width"]} / ${t["data-aspect-height"]}; width: 100%; height: auto;`:null,"data-aspect-width":t.responsive?t["data-aspect-width"]:null,"data-aspect-height":t.responsive?t["data-aspect-height"]:null}]]}});var Rc=z.create({name:"video",selectable:!0,draggable:!0,atom:!0,inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},addOptions(){return{inline:!1,HTMLAttributes:{autoplay:null,controls:null,loop:null},width:640,height:480}},addAttributes(){return{style:{default:null,parseHTML:t=>t.getAttribute("style")},responsive:{default:!0,parseHTML:t=>t.classList.contains("responsive")??!1},src:{default:null},width:{default:this.options.width,parseHTML:t=>t.getAttribute("width")},height:{default:this.options.height,parseHTML:t=>t.getAttribute("height")},autoplay:{default:null,parseHTML:t=>t.getAttribute("autoplay")},controls:{default:null,parseHTML:t=>t.getAttribute("controls")},loop:{default:null,parseHTML:t=>t.getAttribute("loop")},"data-aspect-width":{default:null,parseHTML:t=>t.getAttribute("data-aspect-width")},"data-aspect-height":{default:null,parseHTML:t=>t.getAttribute("data-aspect-height")}}},parseHTML(){return[{tag:"div[data-native-video] video"}]},addCommands(){return{setVideo:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},renderHTML({HTMLAttributes:t}){return["div",{"data-native-video":"",class:t.responsive?"responsive":null},["video",{src:t.src,width:t.width,height:t.height,autoplay:t.autoplay?"true":null,controls:t.controls?"true":null,loop:t.loop?"true":null,style:t.responsive?`aspect-ratio: ${t["data-aspect-width"]} / ${t["data-aspect-height"]}; width: 100%; height: auto;`:null,"data-aspect-width":t.responsive?t["data-aspect-width"]:null,"data-aspect-height":t.responsive?t["data-aspect-height"]:null}]]}});var Qh=t=>{let e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".split("");t||(t=Math.floor(Math.random()*e.length));let n="";for(let r=0;r{let i=document.createElement("div"),o=document.createElement("div"),s=B(this.options.HTMLAttributes,r,{"data-type":this.name});return Object.entries(s).forEach(([a,l])=>i.setAttribute(a,l)),{dom:i,contentDOM:i,ignoreMutation(a){return a.type==="selection"?!1:!i.contains(a.target)||i===a.target},update:a=>a.type===this.type}}},addCommands(){return{setDetails:()=>({state:t,chain:e})=>{var n;let{schema:r,selection:i}=t,{$from:o,$to:s}=i,a=o.blockRange(s);if(!a)return!1;let l=t.doc.slice(a.start,a.end);if(!r.nodes.detailsContent.contentMatch.matchFragment(l.content))return!1;let u=((n=l.toJSON())===null||n===void 0?void 0:n.content)||[];return e().insertContentAt({from:a.start,to:a.end},{type:this.name,content:[{type:"detailsSummary"},{type:"detailsContent",content:u}]}).setTextSelection(a.start+2).run()},unsetDetails:()=>({state:t,chain:e})=>{let{selection:n,schema:r}=t,i=fr(y=>y.type===this.type)(n);if(!i)return!1;let o=dr(i.node,y=>y.type===r.nodes.detailsSummary),s=dr(i.node,y=>y.type===r.nodes.detailsContent);if(!o.length||!s.length)return!1;let a=o[0],l=s[0],c=i.pos,u=t.doc.resolve(c),d=c+i.node.nodeSize,f={from:c,to:d},p=l.node.content.toJSON()||[],h=u.parent.type.contentMatch.defaultType,g=[h?.create(null,a.node.content).toJSON(),...p];return e().insertContentAt(f,g).setTextSelection(c+1).run()}}},addKeyboardShortcuts(){return{Backspace:()=>{let{schema:t,selection:e}=this.editor.state,{empty:n,$anchor:r}=e;return!n||r.parent.type!==t.nodes.detailsSummary?!1:r.parentOffset!==0?this.editor.commands.command(({tr:i})=>{let o=r.pos-1,s=r.pos;return i.delete(o,s),!0}):this.editor.commands.unsetDetails()}}}});var Dc=z.create({name:"detailsSummary",content:"text*",defining:!0,selectable:!1,isolating:!0,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"summary"}]},renderHTML({HTMLAttributes:t}){return["summary",B(this.options.HTMLAttributes,t),0]}});var Lc=z.create({name:"detailsContent",content:"block+",defining:!0,selectable:!1,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:'div[data-type="details-content"]'}]},renderHTML({HTMLAttributes:t}){return["div",B(this.options.HTMLAttributes,t,{"data-type":"details-content"}),0]},addKeyboardShortcuts(){return{Enter:({editor:t})=>{let{state:e,view:n}=t,{selection:r}=e,{$from:i,empty:o}=r,s=fr(ne=>ne.type===this.type)(r);if(!o||!s||!s.node.childCount)return!1;let a=i.index(s.depth),{childCount:l}=s.node;if(!(l===a+1))return!1;let u=s.node.type.contentMatch.defaultType,d=u?.createAndFill();if(!d)return!1;let f=e.doc.resolve(s.pos+1),p=l-1,h=s.node.child(p),m=f.posAtIndex(p,s.depth);if(!h.eq(d))return!1;let y=i.node(-3);if(!y)return!1;let S=i.indexAfter(-3),M=Dl(y.contentMatchAt(S));if(!M||!y.canReplaceWith(S,S,M))return!1;let b=M.createAndFill();if(!b)return!1;let{tr:_}=e,w=i.after(-2);_.replaceWith(w,w,b);let D=_.doc.resolve(w),K=V.near(D,1);_.setSelection(K);let O=m,J=m+h.nodeSize;return _.delete(O,J),_.scrollIntoView(),n.dispatch(_),!0}}}});var VS=/^```([a-z]+)?[\s\n]$/,GS=/^~~~([a-z]+)?[\s\n]$/,em=z.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:t=>{var e;let{languageClassPrefix:n}=this.options,o=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(s=>s.startsWith(n)).map(s=>s.replace(n,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",B(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;let o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(` + 3. "-" cannot repeat`);Me.customSchemes.push([t,e])}function US(){Me.scanner=DS(Me.customSchemes);for(let t=0;t{let i=e.some(c=>c.docChanged)&&!n.doc.eq(r.doc),o=e.some(c=>c.getMeta("preventAutolink"));if(!i||o)return;let{tr:s}=r,a=dp(n.doc,[...e]);if(pp(a).forEach(({newRange:c})=>{let u=fp(r.doc,c,p=>p.isTextblock),d,f;if(u.length>1?(d=u[0],f=r.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ")):u.length&&r.doc.textBetween(c.from,c.to," "," ").endsWith(" ")&&(d=u[0],f=r.doc.textBetween(d.pos,c.to,void 0," ")),d&&f){let p=f.split(" ").filter(m=>m!=="");if(p.length<=0)return!1;let h=p[p.length-1],g=d.pos+f.lastIndexOf(h);if(!h)return!1;Sc(h).filter(m=>m.isLink).map(m=>({...m,from:g+m.start+1,to:g+m.end+1})).filter(m=>r.schema.marks.code?!r.doc.rangeHasMark(m.from,m.to,r.schema.marks.code):!0).filter(m=>t.validate?t.validate(m.value):!0).forEach(m=>{$o(m.from,m.to,r.doc).some(y=>y.mark.type===t.type)||s.addMark(m.from,m.to,t.type.create({href:m.href}))})}}),!!s.steps.length)return s}})}function VS(t){return new ge({key:new ve("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,o;if(r.button!==0||r.target.nodeName!=="A")return!1;let a=Dl(e.state,t.type.name),l=r.target,c=(i=l?.href)!==null&&i!==void 0?i:a.href,u=(o=l?.target)!==null&&o!==void 0?o:a.target;return l&&c?(e.editable&&window.open(c,u),!0):!1}}})}var zh=we.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach(t=>{if(typeof t=="string"){vc(t);return}vc(t.scheme,t.optionalSlashes)})},onDestroy(){Hh()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}},addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:'a[href]:not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:t}){return["a",B(this.options.HTMLAttributes,t),0]},addCommands(){return{setLink:t=>({chain:e})=>e().setMark(this.name,t).setMeta("preventAutolink",!0).run(),toggleLink:t=>({chain:e})=>e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[ht({find:t=>Sc(t).filter(e=>this.options.validate?this.options.validate(e.value):!0).filter(e=>e.isLink).map(e=>({text:e.value,index:e.start,data:e})),type:this.type,getAttributes:(t,e)=>{var n,r;let i=(n=e.clipboardData)===null||n===void 0?void 0:n.getData("text/html"),o=/href="([^"]*)"/,s=i?.match(o);return s?{href:s[1]}:{href:(r=t.data)===null||r===void 0?void 0:r.href}}})]},addProseMirrorPlugins(){let t=[];return this.options.autolink&&t.push(WS({type:this.type,validate:this.options.validate})),this.options.openOnClick&&t.push(VS({type:this.type})),t}});var xc=zh.extend({addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{},validate:void 0}},addAttributes(){return{href:{default:null},id:{default:null},target:{default:this.options.HTMLAttributes.target},hreflang:{default:null},rel:{default:null},referrerpolicy:{default:null},class:{default:null},as_button:{default:null,parseHTML:t=>t.getAttribute("data-as-button"),renderHTML:t=>({"data-as-button":t.as_button})},button_theme:{default:null,parseHTML:t=>t.getAttribute("data-as-button-theme"),renderHTML:t=>({"data-as-button-theme":t.button_theme})}}}});var GS=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,$h=$.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",B(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[Ko({find:GS,type:this.type,getAttributes:t=>{let[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}});var kc=$h.extend({addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}}});var Uh=$.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",B(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}});var Mc=Uh.extend({addAttributes(){return{class:{default:null}}}});var Nc=we.create({name:"small",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"small"}]},renderHTML({HTMLAttributes:t}){return["small",B(this.options.HTMLAttributes,t),0]},addCommands(){return{setSmall:()=>({commands:t})=>t.setMark(this.name),toggleSmall:()=>({commands:t})=>t.toggleMark(this.name),unsetSmall:()=>({commands:t})=>t.unsetMark(this.name)}}});function Kh(t,e=null){return e?t.createChecked(null,e):t.createAndFill()}function Wh(t){if(t.cached.gridNodeTypes)return t.cached.gridNodeTypes;let e={};return Object.keys(t.nodes).forEach(n=>{let r=t.nodes[n];r.spec.gridRole&&(e[r.spec.gridRole]=r)}),t.cached.gridNodeTypes=e,e}function Vh(t,e,n,r){let i=Wh(t),o=[];for(let s=0;st.getAttribute("type")},cols:{default:2,parseHTML:t=>t.getAttribute("cols")}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-grid")&&null}]},renderHTML({HTMLAttributes:t}){return["div",B(this.options.HTMLAttributes,t),0]},addCommands(){return{insertGrid:({cols:t=3,type:e="responsive"}={})=>({tr:n,dispatch:r,editor:i})=>{let o=Vh(i.schema,t,e);if(r){let s=n.selection.anchor+1;n.replaceSelectionWith(o).scrollIntoView().setSelection(K.near(n.doc.resolve(s)))}return!0}}},addKeyboardShortcuts(){return{"Mod-Alt-G":()=>this.editor.commands.insertGrid()}},extendNodeSchema(t){let e={name:t.name,options:t.options,storage:t.storage};return{gridRole:ee(F(t,"gridRole",e))}}});var _c=$.create({name:"gridColumn",content:"block+",gridRole:"column",isolating:!0,addOptions(){return{HTMLAttributes:{class:"filament-tiptap-grid__column"}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-grid__column")&&null}]},renderHTML({HTMLAttributes:t}){return["div",B(this.options.HTMLAttributes,t),0]}});var qh=t=>t.match(/(youtube\.com|youtu\.be)(.+)?$/),Gh=(t=!1)=>t?"https://www.youtube-nocookie.com/embed/":"https://www.youtube.com/embed/",jh=t=>{let{url:e,controls:n,nocookie:r,startAt:i}=t;if(e.includes("/embed/"))return e;if(e.includes("youtu.be")){let c=e.split("/").pop();return c?`${Gh(r)}${c}`:null}let s=/v=([-\w]+)/gm.exec(e);if(!s||!s[1])return null;let a=`${Gh(r)}${s[1]}`,l=[];return n?l.push("controls=1"):l.push("controls=0"),i&&l.push(`start=${i}`),l.length&&(a+=`?${l.join("&")}`),a};var Cc=$.create({name:"youtube",selectable:!0,draggable:!0,atom:!0,addOptions(){return{inline:!1,HTMLAttributes:{},width:640,height:480}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},addAttributes(){return{style:{default:null,parseHTML:t=>t.getAttribute("style")},src:{default:null},width:{default:this.options.width,parseHTML:t=>t.getAttribute("width")},height:{default:this.options.height,parseHTML:t=>t.getAttribute("height")},responsive:{default:!0,parseHTML:t=>t.classList.contains("responsive")??!1},start:{default:0},controls:{default:!0},nocookie:{default:!1},"data-aspect-width":{default:null,parseHTML:t=>t.getAttribute("data-aspect-width")},"data-aspect-height":{default:null,parseHTML:t=>t.getAttribute("data-aspect-height")}}},parseHTML(){return[{tag:"div[data-youtube-video] iframe"}]},addCommands(){return{setYoutubeVideo:t=>({commands:e})=>qh(t.src)?e.insertContent({type:this.name,attrs:t}):!1}},renderHTML({HTMLAttributes:t}){let e=jh({url:t.src,controls:t.controls,nocookie:t.nocookie,startAt:t.start||0});return["div",{"data-youtube-video":"",class:t.responsive?"responsive":null},["iframe",{src:e,width:t.width,height:t.height,allowfullscreen:this.options.allowFullscreen,style:t.responsive?`aspect-ratio: ${t["data-aspect-width"]} / ${t["data-aspect-height"]}; width: 100%; height: auto;`:null,"data-aspect-width":t.responsive?t["data-aspect-width"]:null,"data-aspect-height":t.responsive?t["data-aspect-height"]:null}]]}});var Yh=t=>t.match(/(vimeo\.com)(.+)?$/),Jh=t=>{let{url:e,autoplay:n,loop:r,title:i,byline:o,portrait:s}=t;if(e.includes("/video/"))return e;let l=/\.com\/([0-9]+)/gm.exec(e);if(!l||!l[1])return null;let c=`https://player.vimeo.com/video/${l[1]}`,u=[`autoplay=${n}`,`loop=${r}`,`title=${i}`,`byline=${o}`,`portrait=${s}`];return c+=`?${u.join("&")}`,c};var Oc=$.create({name:"vimeo",selectable:!0,draggable:!0,atom:!0,addOptions(){return{inline:!1,HTMLAttributes:{},allowFullscreen:!0,width:640,height:480}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},addAttributes(){return{style:{default:null,parseHTML:t=>t.getAttribute("style")},src:{default:null},width:{default:this.options.width,parseHTML:t=>t.getAttribute("width")},height:{default:this.options.height,parseHTML:t=>t.getAttribute("height")},autoplay:{default:0},loop:{default:0},title:{default:0},byline:{default:0},portrait:{default:0},responsive:{default:!0,parseHTML:t=>t.classList.contains("responsive")??!1},"data-aspect-width":{default:null,parseHTML:t=>t.getAttribute("data-aspect-width")},"data-aspect-height":{default:null,parseHTML:t=>t.getAttribute("data-aspect-height")}}},parseHTML(){return[{tag:"div[data-vimeo-video] iframe"}]},addCommands(){return{setVimeoVideo:t=>({commands:e})=>Yh(t.src)?e.insertContent({type:this.name,attrs:t}):!1}},renderHTML({HTMLAttributes:t}){let e=Jh({url:t.src,autoplay:t?.autoplay||0,loop:t?.loop||0,title:t?.title||0,byline:t?.byline||0,portrait:t?.portrait||0});return["div",{"data-vimeo-video":"",class:t.responsive?"responsive":null},["iframe",{src:e,width:t.width,height:t.height,allowfullscreen:this.options.allowfullscreen,frameborder:0,allow:"autoplay; fullscreen; picture-in-picture",style:t.responsive?`aspect-ratio: ${t["data-aspect-width"]} / ${t["data-aspect-height"]}; width: 100%; height: auto;`:null,"data-aspect-width":t.responsive?t["data-aspect-width"]:null,"data-aspect-height":t.responsive?t["data-aspect-height"]:null}]]}});var Ac=$.create({name:"video",selectable:!0,draggable:!0,atom:!0,inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},addOptions(){return{inline:!1,HTMLAttributes:{autoplay:null,controls:null,loop:null},width:640,height:480}},addAttributes(){return{style:{default:null,parseHTML:t=>t.getAttribute("style")},responsive:{default:!0,parseHTML:t=>t.classList.contains("responsive")??!1},src:{default:null},width:{default:this.options.width,parseHTML:t=>t.getAttribute("width")},height:{default:this.options.height,parseHTML:t=>t.getAttribute("height")},autoplay:{default:null,parseHTML:t=>t.getAttribute("autoplay")},controls:{default:null,parseHTML:t=>t.getAttribute("controls")},loop:{default:null,parseHTML:t=>t.getAttribute("loop")},"data-aspect-width":{default:null,parseHTML:t=>t.getAttribute("data-aspect-width")},"data-aspect-height":{default:null,parseHTML:t=>t.getAttribute("data-aspect-height")}}},parseHTML(){return[{tag:"div[data-native-video] video"}]},addCommands(){return{setVideo:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},renderHTML({HTMLAttributes:t}){return["div",{"data-native-video":"",class:t.responsive?"responsive":null},["video",{src:t.src,width:t.width,height:t.height,autoplay:t.autoplay?"true":null,controls:t.controls?"true":null,loop:t.loop?"true":null,style:t.responsive?`aspect-ratio: ${t["data-aspect-width"]} / ${t["data-aspect-height"]}; width: 100%; height: auto;`:null,"data-aspect-width":t.responsive?t["data-aspect-width"]:null,"data-aspect-height":t.responsive?t["data-aspect-height"]:null}]]}});var Xh=t=>{let e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".split("");t||(t=Math.floor(Math.random()*e.length));let n="";for(let r=0;r{let i=document.createElement("div"),o=document.createElement("div"),s=B(this.options.HTMLAttributes,r,{"data-type":this.name});return Object.entries(s).forEach(([a,l])=>i.setAttribute(a,l)),{dom:i,contentDOM:i,ignoreMutation(a){return a.type==="selection"?!1:!i.contains(a.target)||i===a.target},update:a=>a.type===this.type}}},addCommands(){return{setDetails:()=>({state:t,chain:e})=>{var n;let{schema:r,selection:i}=t,{$from:o,$to:s}=i,a=o.blockRange(s);if(!a)return!1;let l=t.doc.slice(a.start,a.end);if(!r.nodes.detailsContent.contentMatch.matchFragment(l.content))return!1;let u=((n=l.toJSON())===null||n===void 0?void 0:n.content)||[];return e().insertContentAt({from:a.start,to:a.end},{type:this.name,content:[{type:"detailsSummary"},{type:"detailsContent",content:u}]}).setTextSelection(a.start+2).run()},unsetDetails:()=>({state:t,chain:e})=>{let{selection:n,schema:r}=t,i=er(y=>y.type===this.type)(n);if(!i)return!1;let o=Qn(i.node,y=>y.type===r.nodes.detailsSummary),s=Qn(i.node,y=>y.type===r.nodes.detailsContent);if(!o.length||!s.length)return!1;let a=o[0],l=s[0],c=i.pos,u=t.doc.resolve(c),d=c+i.node.nodeSize,f={from:c,to:d},p=l.node.content.toJSON()||[],h=u.parent.type.contentMatch.defaultType,m=[h?.create(null,a.node.content).toJSON(),...p];return e().insertContentAt(f,m).setTextSelection(c+1).run()}}},addKeyboardShortcuts(){return{Backspace:()=>{let{schema:t,selection:e}=this.editor.state,{empty:n,$anchor:r}=e;return!n||r.parent.type!==t.nodes.detailsSummary?!1:r.parentOffset!==0?this.editor.commands.command(({tr:i})=>{let o=r.pos-1,s=r.pos;return i.delete(o,s),!0}):this.editor.commands.unsetDetails()}}}});var Ic=$.create({name:"detailsSummary",content:"text*",defining:!0,selectable:!1,isolating:!0,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"summary"}]},renderHTML({HTMLAttributes:t}){return["summary",B(this.options.HTMLAttributes,t),0]}});var Dc=$.create({name:"detailsContent",content:"block+",defining:!0,selectable:!1,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:'div[data-type="details-content"]'}]},renderHTML({HTMLAttributes:t}){return["div",B(this.options.HTMLAttributes,t,{"data-type":"details-content"}),0]},addKeyboardShortcuts(){return{Enter:({editor:t})=>{let{state:e,view:n}=t,{selection:r}=e,{$from:i,empty:o}=r,s=er(ne=>ne.type===this.type)(r);if(!o||!s||!s.node.childCount)return!1;let a=i.index(s.depth),{childCount:l}=s.node;if(!(l===a+1))return!1;let u=s.node.type.contentMatch.defaultType,d=u?.createAndFill();if(!d)return!1;let f=e.doc.resolve(s.pos+1),p=l-1,h=s.node.child(p),g=f.posAtIndex(p,s.depth);if(!h.eq(d))return!1;let y=i.node(-3);if(!y)return!1;let M=i.indexAfter(-3),x=Rl(y.contentMatchAt(M));if(!x||!y.canReplaceWith(M,M,x))return!1;let b=x.createAndFill();if(!b)return!1;let{tr:_}=e,w=i.after(-2);_.replaceWith(w,w,b);let I=_.doc.resolve(w),U=V.near(I,1);_.setSelection(U);let O=g,J=g+h.nodeSize;return _.delete(O,J),_.scrollIntoView(),n.dispatch(_),!0}}}});var qS=/^```([a-z]+)?[\s\n]$/,jS=/^~~~([a-z]+)?[\s\n]$/,Zh=$.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:t=>{var e;let{languageClassPrefix:n}=this.options,o=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(s=>s.startsWith(n)).map(s=>s.replace(n,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",B(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;let o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(` -`);return!o||!s?!1:t.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;let{state:e}=t,{selection:n,doc:r}=e,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;let a=i.after();return a===void 0||r.nodeAt(a)?!1:t.commands.exitCode()}}},addInputRules(){return[Bi({find:VS,type:this.type,getAttributes:t=>({language:t[1]})}),Bi({find:GS,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new me({key:new ve("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;let n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i?.mode;if(!n||!o)return!1;let{tr:s}=t.state;return s.replaceSelectionWith(this.type.create({language:o})),s.setSelection($.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.insertText(n.replace(/\r\n?/g,` -`)),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}});var zc={exports:{}};function Uc(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(function(e){var n=t[e];typeof n=="object"&&!Object.isFrozen(n)&&Uc(n)}),t}zc.exports=Uc;zc.exports.default=Uc;var _s=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function cm(t){return t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Wn(t,...e){let n=Object.create(null);for(let r in t)n[r]=t[r];return e.forEach(function(r){for(let i in r)n[i]=r[i]}),n}var qS="",tm=t=>!!t.scope||t.sublanguage&&t.language,jS=(t,{prefix:e})=>{if(t.includes(".")){let n=t.split(".");return[`${e}${n.shift()}`,...n.map((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${e}${t}`},Bc=class{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=cm(e)}openNode(e){if(!tm(e))return;let n="";e.sublanguage?n=`language-${e.language}`:n=jS(e.scope,{prefix:this.classPrefix}),this.span(n)}closeNode(e){tm(e)&&(this.buffer+=qS)}value(){return this.buffer}span(e){this.buffer+=``}},nm=(t={})=>{let e={children:[]};return Object.assign(e,t),e},Vi=class{constructor(){this.rootNode=nm(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let n=nm({scope:e});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return typeof n=="string"?e.addText(n):n.children&&(e.openNode(n),n.children.forEach(r=>this._walk(e,r)),e.closeNode(n)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(n=>typeof n=="string")?e.children=[e.children.join("")]:e.children.forEach(n=>{Vi._collapse(n)}))}},Hc=class extends Vi{constructor(e){super(),this.options=e}addKeyword(e,n){e!==""&&(this.openNode(n),this.addText(e),this.closeNode())}addText(e){e!==""&&this.add(e)}addSublanguage(e,n){let r=e.root;r.sublanguage=!0,r.language=n,this.add(r)}toHTML(){return new Bc(this,this.options).value()}finalize(){return!0}};function Gi(t){return t?typeof t=="string"?t:t.source:null}function um(t){return Er("(?=",t,")")}function YS(t){return Er("(?:",t,")*")}function JS(t){return Er("(?:",t,")?")}function Er(...t){return t.map(n=>Gi(n)).join("")}function XS(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function $c(...t){return"("+(XS(t).capture?"":"?:")+t.map(r=>Gi(r)).join("|")+")"}function dm(t){return new RegExp(t.toString()+"|").exec("").length-1}function ZS(t,e){let n=t&&t.exec(e);return n&&n.index===0}var QS=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Kc(t,{joinWith:e}){let n=0;return t.map(r=>{n+=1;let i=n,o=Gi(r),s="";for(;o.length>0;){let a=QS.exec(o);if(!a){s+=o;break}s+=o.substring(0,a.index),o=o.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?s+="\\"+String(Number(a[1])+i):(s+=a[0],a[0]==="("&&n++)}return s}).map(r=>`(${r})`).join(e)}var ex=/\b\B/,fm="[a-zA-Z]\\w*",Wc="[a-zA-Z_]\\w*",pm="\\b\\d+(\\.\\d+)?",hm="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",mm="\\b(0b[01]+)",tx="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",nx=(t={})=>{let e=/^#![ ]*\//;return t.binary&&(t.begin=Er(e,/.*\b/,t.binary,/\b.*/)),Wn({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},t)},qi={begin:"\\\\[\\s\\S]",relevance:0},rx={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[qi]},ix={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[qi]},ox={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Os=function(t,e,n={}){let r=Wn({scope:"comment",begin:t,end:e,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=$c("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:Er(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},sx=Os("//","$"),ax=Os("/\\*","\\*/"),lx=Os("#","$"),cx={scope:"number",begin:pm,relevance:0},ux={scope:"number",begin:hm,relevance:0},dx={scope:"number",begin:mm,relevance:0},fx={begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[qi,{begin:/\[/,end:/\]/,relevance:0,contains:[qi]}]}]},px={scope:"title",begin:fm,relevance:0},hx={scope:"title",begin:Wc,relevance:0},mx={begin:"\\.\\s*"+Wc,relevance:0},gx=function(t){return Object.assign(t,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})},Ns=Object.freeze({__proto__:null,MATCH_NOTHING_RE:ex,IDENT_RE:fm,UNDERSCORE_IDENT_RE:Wc,NUMBER_RE:pm,C_NUMBER_RE:hm,BINARY_NUMBER_RE:mm,RE_STARTERS_RE:tx,SHEBANG:nx,BACKSLASH_ESCAPE:qi,APOS_STRING_MODE:rx,QUOTE_STRING_MODE:ix,PHRASAL_WORDS_MODE:ox,COMMENT:Os,C_LINE_COMMENT_MODE:sx,C_BLOCK_COMMENT_MODE:ax,HASH_COMMENT_MODE:lx,NUMBER_MODE:cx,C_NUMBER_MODE:ux,BINARY_NUMBER_MODE:dx,REGEXP_MODE:fx,TITLE_MODE:px,UNDERSCORE_TITLE_MODE:hx,METHOD_GUARD:mx,END_SAME_AS_BEGIN:gx});function bx(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function yx(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className)}function Ex(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=bx,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function wx(t,e){Array.isArray(t.illegal)&&(t.illegal=$c(...t.illegal))}function vx(t,e){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function Sx(t,e){t.relevance===void 0&&(t.relevance=1)}var xx=(t,e)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");let n=Object.assign({},t);Object.keys(t).forEach(r=>{delete t[r]}),t.keywords=n.keywords,t.begin=Er(n.beforeMatch,um(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},kx=["of","and","for","in","not","or","if","then","parent","list","value"],Mx="keyword";function gm(t,e,n=Mx){let r=Object.create(null);return typeof t=="string"?i(n,t.split(" ")):Array.isArray(t)?i(n,t):Object.keys(t).forEach(function(o){Object.assign(r,gm(t[o],e,o))}),r;function i(o,s){e&&(s=s.map(a=>a.toLowerCase())),s.forEach(function(a){let l=a.split("|");r[l[0]]=[o,Tx(l[0],l[1])]})}}function Tx(t,e){return e?Number(e):Nx(t)?0:1}function Nx(t){return kx.includes(t.toLowerCase())}var rm={},yr=t=>{console.error(t)},im=(t,...e)=>{console.log(`WARN: ${t}`,...e)},ii=(t,e)=>{rm[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),rm[`${t}/${e}`]=!0)},Cs=new Error;function bm(t,e,{key:n}){let r=0,i=t[n],o={},s={};for(let a=1;a<=e.length;a++)s[a+r]=i[a],o[a+r]=!0,r+=dm(e[a-1]);t[n]=s,t[n]._emit=o,t[n]._multi=!0}function _x(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw yr("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Cs;if(typeof t.beginScope!="object"||t.beginScope===null)throw yr("beginScope must be object"),Cs;bm(t,t.begin,{key:"beginScope"}),t.begin=Kc(t.begin,{joinWith:""})}}function Cx(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw yr("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Cs;if(typeof t.endScope!="object"||t.endScope===null)throw yr("endScope must be object"),Cs;bm(t,t.end,{key:"endScope"}),t.end=Kc(t.end,{joinWith:""})}}function Ox(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function Ax(t){Ox(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),_x(t),Cx(t)}function Rx(t){function e(s,a){return new RegExp(Gi(s),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(a?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(a,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,a]),this.matchAt+=dm(a)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let a=this.regexes.map(l=>l[1]);this.matcherRe=e(Kc(a,{joinWith:"|"}),!0),this.lastIndex=0}exec(a){this.matcherRe.lastIndex=this.lastIndex;let l=this.matcherRe.exec(a);if(!l)return null;let c=l.findIndex((d,f)=>f>0&&d!==void 0),u=this.matchIndexes[c];return l.splice(0,c),Object.assign(l,u)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(a){if(this.multiRegexes[a])return this.multiRegexes[a];let l=new n;return this.rules.slice(a).forEach(([c,u])=>l.addRule(c,u)),l.compile(),this.multiRegexes[a]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(a,l){this.rules.push([a,l]),l.type==="begin"&&this.count++}exec(a){let l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let c=l.exec(a);if(this.resumingScanAtSamePosition()&&!(c&&c.index===this.lastIndex)){let u=this.getMatcher(0);u.lastIndex=this.lastIndex+1,c=u.exec(a)}return c&&(this.regexIndex+=c.position+1,this.regexIndex===this.count&&this.considerAll()),c}}function i(s){let a=new r;return s.contains.forEach(l=>a.addRule(l.begin,{rule:l,type:"begin"})),s.terminatorEnd&&a.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&a.addRule(s.illegal,{type:"illegal"}),a}function o(s,a){let l=s;if(s.isCompiled)return l;[yx,vx,Ax,xx].forEach(u=>u(s,a)),t.compilerExtensions.forEach(u=>u(s,a)),s.__beforeBegin=null,[Ex,wx,Sx].forEach(u=>u(s,a)),s.isCompiled=!0;let c=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),c=s.keywords.$pattern,delete s.keywords.$pattern),c=c||/\w+/,s.keywords&&(s.keywords=gm(s.keywords,t.case_insensitive)),l.keywordPatternRe=e(c,!0),a&&(s.begin||(s.begin=/\B|\b/),l.beginRe=e(l.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(l.endRe=e(l.end)),l.terminatorEnd=Gi(l.end)||"",s.endsWithParent&&a.terminatorEnd&&(l.terminatorEnd+=(s.end?"|":"")+a.terminatorEnd)),s.illegal&&(l.illegalRe=e(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(u){return Ix(u==="self"?s:u)})),s.contains.forEach(function(u){o(u,l)}),s.starts&&o(s.starts,a),l.matcher=i(l),l}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=Wn(t.classNameAliases||{}),o(t)}function ym(t){return t?t.endsWithParent||ym(t.starts):!1}function Ix(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return Wn(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:ym(t)?Wn(t,{starts:t.starts?Wn(t.starts):null}):Object.isFrozen(t)?Wn(t):t}var Dx="11.6.0",Fc=class extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}},Pc=cm,om=Wn,sm=Symbol("nomatch"),Lx=7,Px=function(t){let e=Object.create(null),n=Object.create(null),r=[],i=!0,o="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]},a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Hc};function l(N){return a.noHighlightRe.test(N)}function c(N){let E=N.className+" ";E+=N.parentNode?N.parentNode.className:"";let v=a.languageDetectRe.exec(E);if(v){let C=O(v[1]);return C||(im(o.replace("{}",v[1])),im("Falling back to no-highlight mode for this block.",N)),C?v[1]:"no-highlight"}return E.split(/\s+/).find(C=>l(C)||O(C))}function u(N,E,v){let C="",P="";typeof E=="object"?(C=N,v=E.ignoreIllegals,P=E.language):(ii("10.7.0","highlight(lang, code, ...args) has been deprecated."),ii("10.7.0",`Please use highlight(code, options) instead. -https://github.com/highlightjs/highlight.js/issues/2277`),P=N,C=E),v===void 0&&(v=!0);let Y={code:C,language:P};re("before:highlight",Y);let Q=Y.result?Y.result:d(Y.language,Y.code,v);return Q.code=Y.code,re("after:highlight",Q),Q}function d(N,E,v,C){let P=Object.create(null);function Y(L,U){return L.keywords[U]}function Q(){if(!X.keywords){F.addText(le);return}let L=0;X.keywordPatternRe.lastIndex=0;let U=X.keywordPatternRe.exec(le),T="";for(;U;){T+=le.substring(L,U.index);let A=Ke.case_insensitive?U[0].toLowerCase():U[0],q=Y(X,A);if(q){let[oe,Be]=q;if(F.addText(T),T="",P[A]=(P[A]||0)+1,P[A]<=Lx&&(Ee+=Be),oe.startsWith("_"))T+=U[0];else{let xt=Ke.classNameAliases[oe]||oe;F.addKeyword(U[0],xt)}}else T+=U[0];L=X.keywordPatternRe.lastIndex,U=X.keywordPatternRe.exec(le)}T+=le.substring(L),F.addText(T)}function he(){if(le==="")return;let L=null;if(typeof X.subLanguage=="string"){if(!e[X.subLanguage]){F.addText(le);return}L=d(X.subLanguage,le,!0,Ht[X.subLanguage]),Ht[X.subLanguage]=L._top}else L=p(le,X.subLanguage.length?X.subLanguage:null);X.relevance>0&&(Ee+=L.relevance),F.addSublanguage(L._emitter,L.language)}function ye(){X.subLanguage!=null?he():Q(),le=""}function ue(L,U){let T=1,A=U.length-1;for(;T<=A;){if(!L._emit[T]){T++;continue}let q=Ke.classNameAliases[L[T]]||L[T],oe=U[T];q?F.addKeyword(oe,q):(le=oe,Q(),le=""),T++}}function ke(L,U){return L.scope&&typeof L.scope=="string"&&F.openNode(Ke.classNameAliases[L.scope]||L.scope),L.beginScope&&(L.beginScope._wrap?(F.addKeyword(le,Ke.classNameAliases[L.beginScope._wrap]||L.beginScope._wrap),le=""):L.beginScope._multi&&(ue(L.beginScope,U),le="")),X=Object.create(L,{parent:{value:X}}),X}function pt(L,U,T){let A=ZS(L.endRe,T);if(A){if(L["on:end"]){let q=new _s(L);L["on:end"](U,q),q.isMatchIgnored&&(A=!1)}if(A){for(;L.endsParent&&L.parent;)L=L.parent;return L}}if(L.endsWithParent)return pt(L.parent,U,T)}function Ze(L){return X.matcher.regexIndex===0?(le+=L[0],1):(je=!0,0)}function fe(L){let U=L[0],T=L.rule,A=new _s(T),q=[T.__beforeBegin,T["on:begin"]];for(let oe of q)if(oe&&(oe(L,A),A.isMatchIgnored))return Ze(U);return T.skip?le+=U:(T.excludeBegin&&(le+=U),ye(),!T.returnBegin&&!T.excludeBegin&&(le=U)),ke(T,L),T.returnBegin?0:U.length}function ot(L){let U=L[0],T=E.substring(L.index),A=pt(X,L,T);if(!A)return sm;let q=X;X.endScope&&X.endScope._wrap?(ye(),F.addKeyword(U,X.endScope._wrap)):X.endScope&&X.endScope._multi?(ye(),ue(X.endScope,L)):q.skip?le+=U:(q.returnEnd||q.excludeEnd||(le+=U),ye(),q.excludeEnd&&(le=U));do X.scope&&F.closeNode(),!X.skip&&!X.subLanguage&&(Ee+=X.relevance),X=X.parent;while(X!==A.parent);return A.starts&&ke(A.starts,L),q.returnEnd?0:U.length}function vt(){let L=[];for(let U=X;U!==Ke;U=U.parent)U.scope&&L.unshift(U.scope);L.forEach(U=>F.openNode(U))}let St={};function jt(L,U){let T=U&&U[0];if(le+=L,T==null)return ye(),0;if(St.type==="begin"&&U.type==="end"&&St.index===U.index&&T===""){if(le+=E.slice(U.index,U.index+1),!i){let A=new Error(`0 width match regex (${N})`);throw A.languageName=N,A.badRule=St.rule,A}return 1}if(St=U,U.type==="begin")return fe(U);if(U.type==="illegal"&&!v){let A=new Error('Illegal lexeme "'+T+'" for mode "'+(X.scope||"")+'"');throw A.mode=X,A}else if(U.type==="end"){let A=ot(U);if(A!==sm)return A}if(U.type==="illegal"&&T==="")return 1;if(Qe>1e5&&Qe>U.index*3)throw new Error("potential infinite loop, way more iterations than matches");return le+=T,T.length}let Ke=O(N);if(!Ke)throw yr(o.replace("{}",N)),new Error('Unknown language: "'+N+'"');let dn=Rx(Ke),Pe="",X=C||dn,Ht={},F=new a.__emitter(a);vt();let le="",Ee=0,ae=0,Qe=0,je=!1;try{for(X.matcher.considerAll();;){Qe++,je?je=!1:X.matcher.considerAll(),X.matcher.lastIndex=ae;let L=X.matcher.exec(E);if(!L)break;let U=E.substring(ae,L.index),T=jt(U,L);ae=L.index+T}return jt(E.substring(ae)),F.closeAllNodes(),F.finalize(),Pe=F.toHTML(),{language:N,value:Pe,relevance:Ee,illegal:!1,_emitter:F,_top:X}}catch(L){if(L.message&&L.message.includes("Illegal"))return{language:N,value:Pc(E),illegal:!0,relevance:0,_illegalBy:{message:L.message,index:ae,context:E.slice(ae-100,ae+100),mode:L.mode,resultSoFar:Pe},_emitter:F};if(i)return{language:N,value:Pc(E),illegal:!1,relevance:0,errorRaised:L,_emitter:F,_top:X};throw L}}function f(N){let E={value:Pc(N),illegal:!1,relevance:0,_top:s,_emitter:new a.__emitter(a)};return E._emitter.addText(N),E}function p(N,E){E=E||a.languages||Object.keys(e);let v=f(N),C=E.filter(O).filter(ne).map(ye=>d(ye,N,!1));C.unshift(v);let P=C.sort((ye,ue)=>{if(ye.relevance!==ue.relevance)return ue.relevance-ye.relevance;if(ye.language&&ue.language){if(O(ye.language).supersetOf===ue.language)return 1;if(O(ue.language).supersetOf===ye.language)return-1}return 0}),[Y,Q]=P,he=Y;return he.secondBest=Q,he}function h(N,E,v){let C=E&&n[E]||v;N.classList.add("hljs"),N.classList.add(`language-${C}`)}function m(N){let E=null,v=c(N);if(l(v))return;if(re("before:highlightElement",{el:N,language:v}),N.children.length>0&&(a.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(N)),a.throwUnescapedHTML))throw new Fc("One of your code blocks includes unescaped HTML.",N.innerHTML);E=N;let C=E.textContent,P=v?u(C,{language:v,ignoreIllegals:!0}):p(C);N.innerHTML=P.value,h(N,v,P.language),N.result={language:P.language,re:P.relevance,relevance:P.relevance},P.secondBest&&(N.secondBest={language:P.secondBest.language,relevance:P.secondBest.relevance}),re("after:highlightElement",{el:N,result:P,text:C})}function g(N){a=om(a,N)}let y=()=>{b(),ii("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function S(){b(),ii("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let M=!1;function b(){if(document.readyState==="loading"){M=!0;return}document.querySelectorAll(a.cssSelector).forEach(m)}function _(){M&&b()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",_,!1);function w(N,E){let v=null;try{v=E(t)}catch(C){if(yr("Language definition for '{}' could not be registered.".replace("{}",N)),i)yr(C);else throw C;v=s}v.name||(v.name=N),e[N]=v,v.rawDefinition=E.bind(null,t),v.aliases&&J(v.aliases,{languageName:N})}function D(N){delete e[N];for(let E of Object.keys(n))n[E]===N&&delete n[E]}function K(){return Object.keys(e)}function O(N){return N=(N||"").toLowerCase(),e[N]||e[n[N]]}function J(N,{languageName:E}){typeof N=="string"&&(N=[N]),N.forEach(v=>{n[v.toLowerCase()]=E})}function ne(N){let E=O(N);return E&&!E.disableAutodetect}function ie(N){N["before:highlightBlock"]&&!N["before:highlightElement"]&&(N["before:highlightElement"]=E=>{N["before:highlightBlock"](Object.assign({block:E.el},E))}),N["after:highlightBlock"]&&!N["after:highlightElement"]&&(N["after:highlightElement"]=E=>{N["after:highlightBlock"](Object.assign({block:E.el},E))})}function Z(N){ie(N),r.push(N)}function re(N,E){let v=N;r.forEach(function(C){C[v]&&C[v](E)})}function ce(N){return ii("10.7.0","highlightBlock will be removed entirely in v12.0"),ii("10.7.0","Please use highlightElement now."),m(N)}Object.assign(t,{highlight:u,highlightAuto:p,highlightAll:b,highlightElement:m,highlightBlock:ce,configure:g,initHighlighting:y,initHighlightingOnLoad:S,registerLanguage:w,unregisterLanguage:D,listLanguages:K,getLanguage:O,registerAliases:J,autoDetection:ne,inherit:om,addPlugin:Z}),t.debugMode=function(){i=!1},t.safeMode=function(){i=!0},t.versionString=Dx,t.regex={concat:Er,lookahead:um,either:$c,optional:JS,anyNumberOfTimes:YS};for(let N in Ns)typeof Ns[N]=="object"&&zc.exports(Ns[N]);return Object.assign(t,Ns),t},ji=Px({}),Bx=ji;ji.HighlightJS=ji;ji.default=ji;var Hx=Bx;function Em(t,e=[]){return t.map(n=>{let r=[...e,...n.properties?n.properties.className:[]];return n.children?Em(n.children,r):{text:n.value,classes:r}}).flat()}function am(t){return t.value||t.children||[]}function Fx(t){return!!Hx.getLanguage(t)}function lm({doc:t,name:e,lowlight:n,defaultLanguage:r}){let i=[];return dr(t,o=>o.type.name===e).forEach(o=>{let s=o.pos+1,a=o.node.attrs.language||r,l=n.listLanguages(),c=a&&(l.includes(a)||Fx(a))?am(n.highlight(a,o.node.textContent)):am(n.highlightAuto(o.node.textContent));Em(c).forEach(u=>{let d=s+u.text.length;if(u.classes.length){let f=De.inline(s,d,{class:u.classes.join(" ")});i.push(f)}s=d})}),Se.create(t,i)}function zx(t){return typeof t=="function"}function Ux({name:t,lowlight:e,defaultLanguage:n}){if(!["highlight","highlightAuto","listLanguages"].every(i=>zx(e[i])))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");let r=new me({key:new ve("lowlight"),state:{init:(i,{doc:o})=>lm({doc:o,name:t,lowlight:e,defaultLanguage:n}),apply:(i,o,s,a)=>{let l=s.selection.$head.parent.type.name,c=a.selection.$head.parent.type.name,u=dr(s.doc,f=>f.type.name===t),d=dr(a.doc,f=>f.type.name===t);return i.docChanged&&([l,c].includes(t)||d.length!==u.length||i.steps.some(f=>f.from!==void 0&&f.to!==void 0&&u.some(p=>p.pos>=f.from&&p.pos+p.node.nodeSize<=f.to)))?lm({doc:i.doc,name:t,lowlight:e,defaultLanguage:n}):o.map(i.mapping,i.doc)}},props:{decorations(i){return r.getState(i)}}});return r}var wm=em.extend({addOptions(){var t;return{...(t=this.parent)===null||t===void 0?void 0:t.call(this),lowlight:{},defaultLanguage:null}},addProseMirrorPlugins(){var t;return[...((t=this.parent)===null||t===void 0?void 0:t.call(this))||[],Ux({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}});var Vc=wm.extend({addKeyboardShortcuts(){return{...this.parent?.(),ArrowDown:()=>{let t=this.editor.state,{from:e,to:n}=t.selection;if(e>1&&e===n){let r=!1;t.doc.nodesBetween(e-1,n-1,o=>{o.type.name==="codeBlock"&&(r=!0)});let i=!0;if(t.doc.nodesBetween(e+1,n+1,o=>{o&&(i=!1)}),r&&i)return this.editor.commands.setHardBreak()}return!1}}}});var Gc=z.create({name:"hurdle",group:"block",content:"block+",addOptions(){return{colors:["gray_light","gray","gray_dark","primary","secondary","tertiary","accent"],HTMLAttributes:{class:"filament-tiptap-hurdle"}}},addAttributes(){return{color:{default:"gray",parseHTML:t=>t.getAttribute("data-color"),renderHTML:t=>({"data-color":t.color})}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-hurdle")}]},renderHTML({node:t,HTMLAttributes:e}){return["div",B(this.options.HTMLAttributes,e),0]},addCommands(){return{setHurdle:t=>({commands:e})=>this.options.colors.includes(t.color)?e.toggleWrap(this.name,t):!1}}});var qc=Me.create({name:"textAlign",addOptions(){return{types:[],alignments:["start","center","end","justify"],defaultAlignment:"start"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>t.style.textAlign||this.options.defaultAlignment,renderHTML:t=>t.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${t.textAlign}`}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.every(n=>e.updateAttributes(n,{textAlign:t})):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.every(e=>t.resetAttributes(e,"textAlign"))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("start"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("end"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}});var Re="top",Ue="bottom",Fe="right",Le="left",As="auto",Vn=[Re,Ue,Fe,Le],xn="start",wr="end",vm="clippingParents",Rs="viewport",oi="popper",Sm="reference",jc=Vn.reduce(function(t,e){return t.concat([e+"-"+xn,e+"-"+wr])},[]),Is=[].concat(Vn,[As]).reduce(function(t,e){return t.concat([e,e+"-"+xn,e+"-"+wr])},[]),$x="beforeRead",Kx="read",Wx="afterRead",Vx="beforeMain",Gx="main",qx="afterMain",jx="beforeWrite",Yx="write",Jx="afterWrite",xm=[$x,Kx,Wx,Vx,Gx,qx,jx,Yx,Jx];function Ge(t){return t?(t.nodeName||"").toLowerCase():null}function _e(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Dt(t){var e=_e(t).Element;return t instanceof e||t instanceof Element}function $e(t){var e=_e(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function si(t){if(typeof ShadowRoot>"u")return!1;var e=_e(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Xx(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},o=e.elements[n];!$e(o)||!Ge(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var a=i[s];a===!1?o.removeAttribute(s):o.setAttribute(s,a===!0?"":a)}))})}function Zx(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),a=s.reduce(function(l,c){return l[c]="",l},{});!$e(i)||!Ge(i)||(Object.assign(i.style,a),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}var Yi={name:"applyStyles",enabled:!0,phase:"write",fn:Xx,effect:Zx,requires:["computeStyles"]};function qe(t){return t.split("-")[0]}var Wt=Math.max,vr=Math.min,kn=Math.round;function ai(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Ji(){return!/^((?!chrome|android).)*safari/i.test(ai())}function Lt(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&$e(t)&&(i=t.offsetWidth>0&&kn(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&kn(r.height)/t.offsetHeight||1);var s=Dt(t)?_e(t):window,a=s.visualViewport,l=!Ji()&&n,c=(r.left+(l&&a?a.offsetLeft:0))/i,u=(r.top+(l&&a?a.offsetTop:0))/o,d=r.width/i,f=r.height/o;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c,x:c,y:u}}function Sr(t){var e=Lt(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function Xi(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&si(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ft(t){return _e(t).getComputedStyle(t)}function Yc(t){return["table","td","th"].indexOf(Ge(t))>=0}function Xe(t){return((Dt(t)?t.ownerDocument:t.document)||window.document).documentElement}function Mn(t){return Ge(t)==="html"?t:t.assignedSlot||t.parentNode||(si(t)?t.host:null)||Xe(t)}function km(t){return!$e(t)||ft(t).position==="fixed"?null:t.offsetParent}function Qx(t){var e=/firefox/i.test(ai()),n=/Trident/i.test(ai());if(n&&$e(t)){var r=ft(t);if(r.position==="fixed")return null}var i=Mn(t);for(si(i)&&(i=i.host);$e(i)&&["html","body"].indexOf(Ge(i))<0;){var o=ft(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function Vt(t){for(var e=_e(t),n=km(t);n&&Yc(n)&&ft(n).position==="static";)n=km(n);return n&&(Ge(n)==="html"||Ge(n)==="body"&&ft(n).position==="static")?e:n||Qx(t)||e}function xr(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function kr(t,e,n){return Wt(t,vr(e,n))}function Mm(t,e,n){var r=kr(t,e,n);return r>n?n:r}function Zi(){return{top:0,right:0,bottom:0,left:0}}function Qi(t){return Object.assign({},Zi(),t)}function eo(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var ek=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,Qi(typeof e!="number"?e:eo(e,Vn))};function tk(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=qe(n.placement),l=xr(a),c=[Le,Fe].indexOf(a)>=0,u=c?"height":"width";if(!(!o||!s)){var d=ek(i.padding,n),f=Sr(o),p=l==="y"?Re:Le,h=l==="y"?Ue:Fe,m=n.rects.reference[u]+n.rects.reference[l]-s[l]-n.rects.popper[u],g=s[l]-n.rects.reference[l],y=Vt(o),S=y?l==="y"?y.clientHeight||0:y.clientWidth||0:0,M=m/2-g/2,b=d[p],_=S-f[u]-d[h],w=S/2-f[u]/2+M,D=kr(b,w,_),K=l;n.modifiersData[r]=(e={},e[K]=D,e.centerOffset=D-w,e)}}function nk(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||Xi(e.elements.popper,i)&&(e.elements.arrow=i))}var Tm={name:"arrow",enabled:!0,phase:"main",fn:tk,effect:nk,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Pt(t){return t.split("-")[1]}var rk={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ik(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:kn(n*i)/i||0,y:kn(r*i)/i||0}}function Nm(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,s=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,d=t.isFixed,f=s.x,p=f===void 0?0:f,h=s.y,m=h===void 0?0:h,g=typeof u=="function"?u({x:p,y:m}):{x:p,y:m};p=g.x,m=g.y;var y=s.hasOwnProperty("x"),S=s.hasOwnProperty("y"),M=Le,b=Re,_=window;if(c){var w=Vt(n),D="clientHeight",K="clientWidth";if(w===_e(n)&&(w=Xe(n),ft(w).position!=="static"&&a==="absolute"&&(D="scrollHeight",K="scrollWidth")),w=w,i===Re||(i===Le||i===Fe)&&o===wr){b=Ue;var O=d&&w===_&&_.visualViewport?_.visualViewport.height:w[D];m-=O-r.height,m*=l?1:-1}if(i===Le||(i===Re||i===Ue)&&o===wr){M=Fe;var J=d&&w===_&&_.visualViewport?_.visualViewport.width:w[K];p-=J-r.width,p*=l?1:-1}}var ne=Object.assign({position:a},c&&rk),ie=u===!0?ik({x:p,y:m},_e(n)):{x:p,y:m};if(p=ie.x,m=ie.y,l){var Z;return Object.assign({},ne,(Z={},Z[b]=S?"0":"",Z[M]=y?"0":"",Z.transform=(_.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",Z))}return Object.assign({},ne,(e={},e[b]=S?m+"px":"",e[M]=y?p+"px":"",e.transform="",e))}function ok(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,a=n.roundOffsets,l=a===void 0?!0:a,c={placement:qe(e.placement),variation:Pt(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Nm(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Nm(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var _m={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:ok,data:{}};var Ds={passive:!0};function sk(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,a=s===void 0?!0:s,l=_e(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach(function(u){u.addEventListener("scroll",n.update,Ds)}),a&&l.addEventListener("resize",n.update,Ds),function(){o&&c.forEach(function(u){u.removeEventListener("scroll",n.update,Ds)}),a&&l.removeEventListener("resize",n.update,Ds)}}var Cm={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:sk,data:{}};var ak={left:"right",right:"left",bottom:"top",top:"bottom"};function li(t){return t.replace(/left|right|bottom|top/g,function(e){return ak[e]})}var lk={start:"end",end:"start"};function Ls(t){return t.replace(/start|end/g,function(e){return lk[e]})}function Mr(t){var e=_e(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Tr(t){return Lt(Xe(t)).left+Mr(t).scrollLeft}function Jc(t,e){var n=_e(t),r=Xe(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;var c=Ji();(c||!c&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a+Tr(t),y:l}}function Xc(t){var e,n=Xe(t),r=Mr(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=Wt(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Wt(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+Tr(t),l=-r.scrollTop;return ft(i||n).direction==="rtl"&&(a+=Wt(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}function Nr(t){var e=ft(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Ps(t){return["html","body","#document"].indexOf(Ge(t))>=0?t.ownerDocument.body:$e(t)&&Nr(t)?t:Ps(Mn(t))}function Gn(t,e){var n;e===void 0&&(e=[]);var r=Ps(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=_e(r),s=i?[o].concat(o.visualViewport||[],Nr(r)?r:[]):r,a=e.concat(s);return i?a:a.concat(Gn(Mn(s)))}function ci(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function ck(t,e){var n=Lt(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function Om(t,e,n){return e===Rs?ci(Jc(t,n)):Dt(e)?ck(e,n):ci(Xc(Xe(t)))}function uk(t){var e=Gn(Mn(t)),n=["absolute","fixed"].indexOf(ft(t).position)>=0,r=n&&$e(t)?Vt(t):t;return Dt(r)?e.filter(function(i){return Dt(i)&&Xi(i,r)&&Ge(i)!=="body"}):[]}function Zc(t,e,n,r){var i=e==="clippingParents"?uk(t):[].concat(e),o=[].concat(i,[n]),s=o[0],a=o.reduce(function(l,c){var u=Om(t,c,r);return l.top=Wt(u.top,l.top),l.right=vr(u.right,l.right),l.bottom=vr(u.bottom,l.bottom),l.left=Wt(u.left,l.left),l},Om(t,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function to(t){var e=t.reference,n=t.element,r=t.placement,i=r?qe(r):null,o=r?Pt(r):null,s=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,l;switch(i){case Re:l={x:s,y:e.y-n.height};break;case Ue:l={x:s,y:e.y+e.height};break;case Fe:l={x:e.x+e.width,y:a};break;case Le:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var c=i?xr(i):null;if(c!=null){var u=c==="y"?"height":"width";switch(o){case xn:l[c]=l[c]-(e[u]/2-n[u]/2);break;case wr:l[c]=l[c]+(e[u]/2-n[u]/2);break;default:}}return l}function Gt(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,s=o===void 0?t.strategy:o,a=n.boundary,l=a===void 0?vm:a,c=n.rootBoundary,u=c===void 0?Rs:c,d=n.elementContext,f=d===void 0?oi:d,p=n.altBoundary,h=p===void 0?!1:p,m=n.padding,g=m===void 0?0:m,y=Qi(typeof g!="number"?g:eo(g,Vn)),S=f===oi?Sm:oi,M=t.rects.popper,b=t.elements[h?S:f],_=Zc(Dt(b)?b:b.contextElement||Xe(t.elements.popper),l,u,s),w=Lt(t.elements.reference),D=to({reference:w,element:M,strategy:"absolute",placement:i}),K=ci(Object.assign({},M,D)),O=f===oi?K:w,J={top:_.top-O.top+y.top,bottom:O.bottom-_.bottom+y.bottom,left:_.left-O.left+y.left,right:O.right-_.right+y.right},ne=t.modifiersData.offset;if(f===oi&&ne){var ie=ne[i];Object.keys(J).forEach(function(Z){var re=[Fe,Ue].indexOf(Z)>=0?1:-1,ce=[Re,Ue].indexOf(Z)>=0?"y":"x";J[Z]+=ie[ce]*re})}return J}function Qc(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?Is:l,u=Pt(r),d=u?a?jc:jc.filter(function(h){return Pt(h)===u}):Vn,f=d.filter(function(h){return c.indexOf(h)>=0});f.length===0&&(f=d);var p=f.reduce(function(h,m){return h[m]=Gt(t,{placement:m,boundary:i,rootBoundary:o,padding:s})[qe(m)],h},{});return Object.keys(p).sort(function(h,m){return p[h]-p[m]})}function dk(t){if(qe(t)===As)return[];var e=li(t);return[Ls(t),e,Ls(e)]}function fk(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!0:s,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,h=p===void 0?!0:p,m=n.allowedAutoPlacements,g=e.options.placement,y=qe(g),S=y===g,M=l||(S||!h?[li(g)]:dk(g)),b=[g].concat(M).reduce(function(ye,ue){return ye.concat(qe(ue)===As?Qc(e,{placement:ue,boundary:u,rootBoundary:d,padding:c,flipVariations:h,allowedAutoPlacements:m}):ue)},[]),_=e.rects.reference,w=e.rects.popper,D=new Map,K=!0,O=b[0],J=0;J=0,ce=re?"width":"height",N=Gt(e,{placement:ne,boundary:u,rootBoundary:d,altBoundary:f,padding:c}),E=re?Z?Fe:Le:Z?Ue:Re;_[ce]>w[ce]&&(E=li(E));var v=li(E),C=[];if(o&&C.push(N[ie]<=0),a&&C.push(N[E]<=0,N[v]<=0),C.every(function(ye){return ye})){O=ne,K=!1;break}D.set(ne,C)}if(K)for(var P=h?3:1,Y=function(ue){var ke=b.find(function(pt){var Ze=D.get(pt);if(Ze)return Ze.slice(0,ue).every(function(fe){return fe})});if(ke)return O=ke,"break"},Q=P;Q>0;Q--){var he=Y(Q);if(he==="break")break}e.placement!==O&&(e.modifiersData[r]._skip=!0,e.placement=O,e.reset=!0)}}var Am={name:"flip",enabled:!0,phase:"main",fn:fk,requiresIfExists:["offset"],data:{_skip:!1}};function Rm(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Im(t){return[Re,Fe,Ue,Le].some(function(e){return t[e]>=0})}function pk(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=Gt(e,{elementContext:"reference"}),a=Gt(e,{altBoundary:!0}),l=Rm(s,r),c=Rm(a,i,o),u=Im(l),d=Im(c);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}var Dm={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:pk};function hk(t,e,n){var r=qe(t),i=[Le,Re].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[Le,Fe].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function mk(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=Is.reduce(function(u,d){return u[d]=hk(d,e.rects,o),u},{}),a=s[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=s}var Lm={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:mk};function gk(t){var e=t.state,n=t.name;e.modifiersData[n]=to({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var Pm={name:"popperOffsets",enabled:!0,phase:"read",fn:gk,data:{}};function eu(t){return t==="x"?"y":"x"}function bk(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!1:s,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,f=n.tether,p=f===void 0?!0:f,h=n.tetherOffset,m=h===void 0?0:h,g=Gt(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),y=qe(e.placement),S=Pt(e.placement),M=!S,b=xr(y),_=eu(b),w=e.modifiersData.popperOffsets,D=e.rects.reference,K=e.rects.popper,O=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,J=typeof O=="number"?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),ne=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,ie={x:0,y:0};if(w){if(o){var Z,re=b==="y"?Re:Le,ce=b==="y"?Ue:Fe,N=b==="y"?"height":"width",E=w[b],v=E+g[re],C=E-g[ce],P=p?-K[N]/2:0,Y=S===xn?D[N]:K[N],Q=S===xn?-K[N]:-D[N],he=e.elements.arrow,ye=p&&he?Sr(he):{width:0,height:0},ue=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Zi(),ke=ue[re],pt=ue[ce],Ze=kr(0,D[N],ye[N]),fe=M?D[N]/2-P-Ze-ke-J.mainAxis:Y-Ze-ke-J.mainAxis,ot=M?-D[N]/2+P+Ze+pt+J.mainAxis:Q+Ze+pt+J.mainAxis,vt=e.elements.arrow&&Vt(e.elements.arrow),St=vt?b==="y"?vt.clientTop||0:vt.clientLeft||0:0,jt=(Z=ne?.[b])!=null?Z:0,Ke=E+fe-jt-St,dn=E+ot-jt,Pe=kr(p?vr(v,Ke):v,E,p?Wt(C,dn):C);w[b]=Pe,ie[b]=Pe-E}if(a){var X,Ht=b==="x"?Re:Le,F=b==="x"?Ue:Fe,le=w[_],Ee=_==="y"?"height":"width",ae=le+g[Ht],Qe=le-g[F],je=[Re,Le].indexOf(y)!==-1,L=(X=ne?.[_])!=null?X:0,U=je?ae:le-D[Ee]-K[Ee]-L+J.altAxis,T=je?le+D[Ee]+K[Ee]-L-J.altAxis:Qe,A=p&&je?Mm(U,le,T):kr(p?U:ae,le,p?T:Qe);w[_]=A,ie[_]=A-le}e.modifiersData[r]=ie}}var Bm={name:"preventOverflow",enabled:!0,phase:"main",fn:bk,requiresIfExists:["offset"]};function tu(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function nu(t){return t===_e(t)||!$e(t)?Mr(t):tu(t)}function yk(t){var e=t.getBoundingClientRect(),n=kn(e.width)/t.offsetWidth||1,r=kn(e.height)/t.offsetHeight||1;return n!==1||r!==1}function ru(t,e,n){n===void 0&&(n=!1);var r=$e(e),i=$e(e)&&yk(e),o=Xe(e),s=Lt(t,i,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((Ge(e)!=="body"||Nr(o))&&(a=nu(e)),$e(e)?(l=Lt(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):o&&(l.x=Tr(o))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function Ek(t){var e=new Map,n=new Set,r=[];t.forEach(function(o){e.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&i(l)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function iu(t){var e=Ek(t);return xm.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function ou(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function su(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var Hm={placement:"bottom",modifiers:[],strategy:"absolute"};function Fm(){for(var t=arguments.length,e=new Array(t),n=0;n-1}function eg(t,e){return typeof t=="function"?t.apply(void 0,e):t}function Um(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function xk(t){return t.split(/\s+/).filter(Boolean)}function ui(t){return[].concat(t)}function $m(t,e){t.indexOf(e)===-1&&t.push(e)}function kk(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function Mk(t){return t.split("-")[0]}function Hs(t){return[].slice.call(t)}function Km(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function no(){return document.createElement("div")}function Fs(t){return["Element","Fragment"].some(function(e){return hu(t,e)})}function Tk(t){return hu(t,"NodeList")}function Nk(t){return hu(t,"MouseEvent")}function _k(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function Ck(t){return Fs(t)?[t]:Tk(t)?Hs(t):Array.isArray(t)?t:Hs(document.querySelectorAll(t))}function cu(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function Wm(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function Ok(t){var e,n=ui(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function Ak(t,e){var n=e.clientX,r=e.clientY;return t.every(function(i){var o=i.popperRect,s=i.popperState,a=i.props,l=a.interactiveBorder,c=Mk(s.placement),u=s.modifiersData.offset;if(!u)return!0;var d=c==="bottom"?u.top.y:0,f=c==="top"?u.bottom.y:0,p=c==="right"?u.left.x:0,h=c==="left"?u.right.x:0,m=o.top-r+d>l,g=r-o.bottom-f>l,y=o.left-n+p>l,S=n-o.right-h>l;return m||g||y||S})}function uu(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function Vm(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var un={isTouch:!1},Gm=0;function Rk(){un.isTouch||(un.isTouch=!0,window.performance&&document.addEventListener("mousemove",tg))}function tg(){var t=performance.now();t-Gm<20&&(un.isTouch=!1,document.removeEventListener("mousemove",tg)),Gm=t}function Ik(){var t=document.activeElement;if(_k(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function Dk(){document.addEventListener("touchstart",Rk,_r),window.addEventListener("blur",Ik)}var Lk=typeof window<"u"&&typeof document<"u",Pk=Lk?!!window.msCrypto:!1;var Bk={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Hk={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},qt=Object.assign({appendTo:Qm,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Bk,Hk),Fk=Object.keys(qt),zk=function(e){var n=Object.keys(e);n.forEach(function(r){qt[r]=e[r]})};function ng(t){var e=t.plugins||[],n=e.reduce(function(r,i){var o=i.name,s=i.defaultValue;if(o){var a;r[o]=t[o]!==void 0?t[o]:(a=qt[o])!=null?a:s}return r},{});return Object.assign({},t,n)}function Uk(t,e){var n=e?Object.keys(ng(Object.assign({},qt,{plugins:e}))):Fk,r=n.reduce(function(i,o){var s=(t.getAttribute("data-tippy-"+o)||"").trim();if(!s)return i;if(o==="content")i[o]=s;else try{i[o]=JSON.parse(s)}catch{i[o]=s}return i},{});return r}function qm(t,e){var n=Object.assign({},e,{content:eg(e.content,[t])},e.ignoreAttributes?{}:Uk(t,e.plugins));return n.aria=Object.assign({},qt.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?e.interactive:n.aria.expanded,content:n.aria.content==="auto"?e.interactive?null:"describedby":n.aria.content},n}var $k=function(){return"innerHTML"};function fu(t,e){t[$k()]=e}function jm(t){var e=no();return t===!0?e.className=Xm:(e.className=Zm,Fs(t)?e.appendChild(t):fu(e,t)),e}function Ym(t,e){Fs(e.content)?(fu(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?fu(t,e.content):t.textContent=e.content)}function pu(t){var e=t.firstElementChild,n=Hs(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(Jm)}),arrow:n.find(function(r){return r.classList.contains(Xm)||r.classList.contains(Zm)}),backdrop:n.find(function(r){return r.classList.contains(Sk)})}}function rg(t){var e=no(),n=no();n.className=vk,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=no();r.className=Jm,r.setAttribute("data-state","hidden"),Ym(r,t.props),e.appendChild(n),n.appendChild(r),i(t.props,t.props);function i(o,s){var a=pu(e),l=a.box,c=a.content,u=a.arrow;s.theme?l.setAttribute("data-theme",s.theme):l.removeAttribute("data-theme"),typeof s.animation=="string"?l.setAttribute("data-animation",s.animation):l.removeAttribute("data-animation"),s.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?l.setAttribute("role",s.role):l.removeAttribute("role"),(o.content!==s.content||o.allowHTML!==s.allowHTML)&&Ym(c,t.props),s.arrow?u?o.arrow!==s.arrow&&(l.removeChild(u),l.appendChild(jm(s.arrow))):l.appendChild(jm(s.arrow)):u&&l.removeChild(u)}return{popper:e,onUpdate:i}}rg.$$tippy=!0;var Kk=1,Bs=[],du=[];function Wk(t,e){var n=qm(t,Object.assign({},qt,ng(Km(e)))),r,i,o,s=!1,a=!1,l=!1,c=!1,u,d,f,p=[],h=Um(Ke,n.interactiveDebounce),m,g=Kk++,y=null,S=kk(n.plugins),M={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},b={id:g,reference:t,popper:no(),popperInstance:y,props:n,state:M,plugins:S,clearDelayTimeouts:U,setProps:T,setContent:A,show:q,hide:oe,hideWithInteractivity:Be,enable:je,disable:L,unmount:xt,destroy:la};if(!n.render)return b;var _=n.render(b),w=_.popper,D=_.onUpdate;w.setAttribute("data-tippy-root",""),w.id="tippy-"+b.id,b.popper=w,t._tippy=b,w._tippy=b;var K=S.map(function(x){return x.fn(b)}),O=t.hasAttribute("aria-expanded");return vt(),P(),E(),v("onCreate",[b]),n.showOnCreate&&ae(),w.addEventListener("mouseenter",function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()}),w.addEventListener("mouseleave",function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&re().addEventListener("mousemove",h)}),b;function J(){var x=b.props.touch;return Array.isArray(x)?x:[x,0]}function ne(){return J()[0]==="hold"}function ie(){var x;return!!((x=b.props.render)!=null&&x.$$tippy)}function Z(){return m||t}function re(){var x=Z().parentNode;return x?Ok(x):document}function ce(){return pu(w)}function N(x){return b.state.isMounted&&!b.state.isVisible||un.isTouch||u&&u.type==="focus"?0:lu(b.props.delay,x?0:1,qt.delay)}function E(x){x===void 0&&(x=!1),w.style.pointerEvents=b.props.interactive&&!x?"":"none",w.style.zIndex=""+b.props.zIndex}function v(x,W,te){if(te===void 0&&(te=!0),K.forEach(function(ge){ge[x]&&ge[x].apply(ge,W)}),te){var we;(we=b.props)[x].apply(we,W)}}function C(){var x=b.props.aria;if(x.content){var W="aria-"+x.content,te=w.id,we=ui(b.props.triggerTarget||t);we.forEach(function(ge){var st=ge.getAttribute(W);if(b.state.isVisible)ge.setAttribute(W,st?st+" "+te:te);else{var Mt=st&&st.replace(te,"").trim();Mt?ge.setAttribute(W,Mt):ge.removeAttribute(W)}})}}function P(){if(!(O||!b.props.aria.expanded)){var x=ui(b.props.triggerTarget||t);x.forEach(function(W){b.props.interactive?W.setAttribute("aria-expanded",b.state.isVisible&&W===Z()?"true":"false"):W.removeAttribute("aria-expanded")})}}function Y(){re().removeEventListener("mousemove",h),Bs=Bs.filter(function(x){return x!==h})}function Q(x){if(!(un.isTouch&&(l||x.type==="mousedown"))){var W=x.composedPath&&x.composedPath()[0]||x.target;if(!(b.props.interactive&&Vm(w,W))){if(ui(b.props.triggerTarget||t).some(function(te){return Vm(te,W)})){if(un.isTouch||b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else v("onClickOutside",[b,x]);b.props.hideOnClick===!0&&(b.clearDelayTimeouts(),b.hide(),a=!0,setTimeout(function(){a=!1}),b.state.isMounted||ke())}}}function he(){l=!0}function ye(){l=!1}function ue(){var x=re();x.addEventListener("mousedown",Q,!0),x.addEventListener("touchend",Q,_r),x.addEventListener("touchstart",ye,_r),x.addEventListener("touchmove",he,_r)}function ke(){var x=re();x.removeEventListener("mousedown",Q,!0),x.removeEventListener("touchend",Q,_r),x.removeEventListener("touchstart",ye,_r),x.removeEventListener("touchmove",he,_r)}function pt(x,W){fe(x,function(){!b.state.isVisible&&w.parentNode&&w.parentNode.contains(w)&&W()})}function Ze(x,W){fe(x,W)}function fe(x,W){var te=ce().box;function we(ge){ge.target===te&&(uu(te,"remove",we),W())}if(x===0)return W();uu(te,"remove",d),uu(te,"add",we),d=we}function ot(x,W,te){te===void 0&&(te=!1);var we=ui(b.props.triggerTarget||t);we.forEach(function(ge){ge.addEventListener(x,W,te),p.push({node:ge,eventType:x,handler:W,options:te})})}function vt(){ne()&&(ot("touchstart",jt,{passive:!0}),ot("touchend",dn,{passive:!0})),xk(b.props.trigger).forEach(function(x){if(x!=="manual")switch(ot(x,jt),x){case"mouseenter":ot("mouseleave",dn);break;case"focus":ot(Pk?"focusout":"blur",Pe);break;case"focusin":ot("focusout",Pe);break}})}function St(){p.forEach(function(x){var W=x.node,te=x.eventType,we=x.handler,ge=x.options;W.removeEventListener(te,we,ge)}),p=[]}function jt(x){var W,te=!1;if(!(!b.state.isEnabled||X(x)||a)){var we=((W=u)==null?void 0:W.type)==="focus";u=x,m=x.currentTarget,P(),!b.state.isVisible&&Nk(x)&&Bs.forEach(function(ge){return ge(x)}),x.type==="click"&&(b.props.trigger.indexOf("mouseenter")<0||s)&&b.props.hideOnClick!==!1&&b.state.isVisible?te=!0:ae(x),x.type==="click"&&(s=!te),te&&!we&&Qe(x)}}function Ke(x){var W=x.target,te=Z().contains(W)||w.contains(W);if(!(x.type==="mousemove"&&te)){var we=Ee().concat(w).map(function(ge){var st,Mt=ge._tippy,Rr=(st=Mt.popperInstance)==null?void 0:st.state;return Rr?{popperRect:ge.getBoundingClientRect(),popperState:Rr,props:n}:null}).filter(Boolean);Ak(we,x)&&(Y(),Qe(x))}}function dn(x){var W=X(x)||b.props.trigger.indexOf("click")>=0&&s;if(!W){if(b.props.interactive){b.hideWithInteractivity(x);return}Qe(x)}}function Pe(x){b.props.trigger.indexOf("focusin")<0&&x.target!==Z()||b.props.interactive&&x.relatedTarget&&w.contains(x.relatedTarget)||Qe(x)}function X(x){return un.isTouch?ne()!==x.type.indexOf("touch")>=0:!1}function Ht(){F();var x=b.props,W=x.popperOptions,te=x.placement,we=x.offset,ge=x.getReferenceClientRect,st=x.moveTransition,Mt=ie()?pu(w).arrow:null,Rr=ge?{getBoundingClientRect:ge,contextElement:ge.contextElement||Z()}:t,Hu={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(fo){var Ir=fo.state;if(ie()){var Xb=ce(),ua=Xb.box;["placement","reference-hidden","escaped"].forEach(function(po){po==="placement"?ua.setAttribute("data-placement",Ir.placement):Ir.attributes.popper["data-popper-"+po]?ua.setAttribute("data-"+po,""):ua.removeAttribute("data-"+po)}),Ir.attributes.popper={}}}},Yn=[{name:"offset",options:{offset:we}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!st}},Hu];ie()&&Mt&&Yn.push({name:"arrow",options:{element:Mt,padding:3}}),Yn.push.apply(Yn,W?.modifiers||[]),b.popperInstance=au(Rr,w,Object.assign({},W,{placement:te,onFirstUpdate:f,modifiers:Yn}))}function F(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function le(){var x=b.props.appendTo,W,te=Z();b.props.interactive&&x===Qm||x==="parent"?W=te.parentNode:W=eg(x,[te]),W.contains(w)||W.appendChild(w),b.state.isMounted=!0,Ht()}function Ee(){return Hs(w.querySelectorAll("[data-tippy-root]"))}function ae(x){b.clearDelayTimeouts(),x&&v("onTrigger",[b,x]),ue();var W=N(!0),te=J(),we=te[0],ge=te[1];un.isTouch&&we==="hold"&&ge&&(W=ge),W?r=setTimeout(function(){b.show()},W):b.show()}function Qe(x){if(b.clearDelayTimeouts(),v("onUntrigger",[b,x]),!b.state.isVisible){ke();return}if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(x.type)>=0&&s)){var W=N(!1);W?i=setTimeout(function(){b.state.isVisible&&b.hide()},W):o=requestAnimationFrame(function(){b.hide()})}}function je(){b.state.isEnabled=!0}function L(){b.hide(),b.state.isEnabled=!1}function U(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function T(x){if(!b.state.isDestroyed){v("onBeforeUpdate",[b,x]),St();var W=b.props,te=qm(t,Object.assign({},W,Km(x),{ignoreAttributes:!0}));b.props=te,vt(),W.interactiveDebounce!==te.interactiveDebounce&&(Y(),h=Um(Ke,te.interactiveDebounce)),W.triggerTarget&&!te.triggerTarget?ui(W.triggerTarget).forEach(function(we){we.removeAttribute("aria-expanded")}):te.triggerTarget&&t.removeAttribute("aria-expanded"),P(),E(),D&&D(W,te),b.popperInstance&&(Ht(),Ee().forEach(function(we){requestAnimationFrame(we._tippy.popperInstance.forceUpdate)})),v("onAfterUpdate",[b,x])}}function A(x){b.setProps({content:x})}function q(){var x=b.state.isVisible,W=b.state.isDestroyed,te=!b.state.isEnabled,we=un.isTouch&&!b.props.touch,ge=lu(b.props.duration,0,qt.duration);if(!(x||W||te||we)&&!Z().hasAttribute("disabled")&&(v("onShow",[b],!1),b.props.onShow(b)!==!1)){if(b.state.isVisible=!0,ie()&&(w.style.visibility="visible"),E(),ue(),b.state.isMounted||(w.style.transition="none"),ie()){var st=ce(),Mt=st.box,Rr=st.content;cu([Mt,Rr],0)}f=function(){var Yn;if(!(!b.state.isVisible||c)){if(c=!0,w.offsetHeight,w.style.transition=b.props.moveTransition,ie()&&b.props.animation){var ca=ce(),fo=ca.box,Ir=ca.content;cu([fo,Ir],ge),Wm([fo,Ir],"visible")}C(),P(),$m(du,b),(Yn=b.popperInstance)==null||Yn.forceUpdate(),v("onMount",[b]),b.props.animation&&ie()&&Ze(ge,function(){b.state.isShown=!0,v("onShown",[b])})}},le()}}function oe(){var x=!b.state.isVisible,W=b.state.isDestroyed,te=!b.state.isEnabled,we=lu(b.props.duration,1,qt.duration);if(!(x||W||te)&&(v("onHide",[b],!1),b.props.onHide(b)!==!1)){if(b.state.isVisible=!1,b.state.isShown=!1,c=!1,s=!1,ie()&&(w.style.visibility="hidden"),Y(),ke(),E(!0),ie()){var ge=ce(),st=ge.box,Mt=ge.content;b.props.animation&&(cu([st,Mt],we),Wm([st,Mt],"hidden"))}C(),P(),b.props.animation?ie()&&pt(we,b.unmount):b.unmount()}}function Be(x){re().addEventListener("mousemove",h),$m(Bs,h),h(x)}function xt(){b.state.isVisible&&b.hide(),b.state.isMounted&&(F(),Ee().forEach(function(x){x._tippy.unmount()}),w.parentNode&&w.parentNode.removeChild(w),du=du.filter(function(x){return x!==b}),b.state.isMounted=!1,v("onHidden",[b]))}function la(){b.state.isDestroyed||(b.clearDelayTimeouts(),b.unmount(),St(),delete t._tippy,b.state.isDestroyed=!0,v("onDestroy",[b]))}}function ro(t,e){e===void 0&&(e={});var n=qt.plugins.concat(e.plugins||[]);Dk();var r=Object.assign({},e,{plugins:n}),i=Ck(t);if(!1)var o,s;var a=i.reduce(function(l,c){var u=c&&Wk(c,r);return u&&l.push(u),l},[]);return Fs(t)?a[0]:a}ro.defaultProps=qt;ro.setDefaultProps=zk;ro.currentInput=un;var AI=Object.assign({},Yi,{effect:function(e){var n=e.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});ro.setDefaultProps({render:rg});var zs=ro;var mu=class{constructor({editor:e,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:s}){at(this,"shouldShow",({view:e,state:n,from:r,to:i})=>{let{doc:o,selection:s}=n,{empty:a}=s,l=!o.textBetween(r,i).length&&Wo(n.selection),c=this.element.contains(document.activeElement);return!(!(e.hasFocus()||c)||a||l||!this.editor.isEditable)});at(this,"mousedownHandler",()=>{this.preventHide=!0});at(this,"dragstartHandler",()=>{this.hide()});at(this,"focusHandler",()=>{setTimeout(()=>this.update(this.editor.view))});at(this,"blurHandler",({event:e})=>{if(this.preventHide){this.preventHide=!1;return}e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||this.hide()});at(this,"tippyBlurHandler",e=>{this.blurHandler({event:e})});at(this,"handleDebouncedUpdate",(e,n)=>{let r=!n?.selection.eq(e.state.selection),i=!n?.doc.eq(e.state.doc);!r&&!i||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(e,r,i,n)},this.updateDelay))});at(this,"updateHandler",(e,n,r,i)=>{let{state:o,composing:s}=e,{selection:a}=o;if(s||!n&&!r)return;this.createTooltip();let{ranges:c}=a,u=Math.min(...c.map(p=>p.$from.pos)),d=Math.max(...c.map(p=>p.$to.pos));if(!this.shouldShow?.({editor:this.editor,view:e,state:o,oldState:i,from:u,to:d})){this.hide();return}o.selection.$anchor.pos!==i?.selection.$anchor.pos&&this.update(e,o),this.tippy?.setProps({getReferenceClientRect:this.tippyOptions?.getReferenceClientRect||(()=>{if(mp(o.selection)){let p=e.nodeDOM(u),h=p.dataset.nodeViewWrapper?p:p.querySelector("[data-node-view-wrapper]");if(h&&(p=h.firstChild),p)return p.getBoundingClientRect()}return Go(e,u,d)})}),this.show()});this.editor=e,this.element=n,this.view=r,this.updateDelay=o,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.style.visibility="hidden",this.element.style.position="absolute"}createTooltip(){let{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=zs(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){let{state:r}=e,i=r.selection.$from.pos!==r.selection.$to.pos;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(e,n);return}let o=!n?.selection.eq(e.state.selection),s=!n?.doc.eq(e.state.doc);this.updateHandler(e,o,s,n)}show(){this.element.style.position="relative",this.element.style.visibility="visible",this.tippy?.show()}hide(){this.element.style.position="absolute",this.element.style.visibility="hidden",this.tippy?.hide()}destroy(){this.tippy?.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),this.tippy?.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}},ig=t=>new me({key:typeof t.pluginKey=="string"?new ve(t.pluginKey):t.pluginKey,view:e=>new mu({view:e,...t})});var io=Me.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[ig({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});var gu=class{constructor({editor:e,element:n,view:r,tippyOptions:i={},shouldShow:o}){at(this,"shouldShow",({view:e,state:n})=>{let{selection:r}=n,{$anchor:i,empty:o}=r,s=i.depth===1,a=i.parent.isTextblock&&!i.parent.type.spec.code&&!i.parent.textContent;return!(!e.hasFocus()||!o||!s||!a||!this.editor.isEditable)});at(this,"mousedownHandler",()=>{this.preventHide=!0});at(this,"focusHandler",()=>{setTimeout(()=>this.update(this.editor.view))});at(this,"blurHandler",({event:e})=>{if(this.preventHide){this.preventHide=!1;return}e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||this.hide()});at(this,"tippyBlurHandler",e=>{this.blurHandler({event:e})});this.editor=e,this.element=n,this.view=r,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.style.visibility="hidden",this.element.style.position="absolute"}createTooltip(){let{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=zs(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){let{state:r}=e,{doc:i,selection:o}=r,{from:s,to:a}=o;if(n&&n.doc.eq(i)&&n.selection.eq(o))return;if(this.createTooltip(),!this.shouldShow?.({editor:this.editor,view:e,state:r,oldState:n})){this.hide();return}this.tippy?.setProps({getReferenceClientRect:this.tippyOptions?.getReferenceClientRect||(()=>Go(e,s,a))}),this.show()}show(){this.element.style.position="relative",this.element.style.visibility="visible",this.tippy?.show()}hide(){this.tippy?.hide()}destroy(){this.tippy?.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),this.tippy?.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}},og=t=>new me({key:typeof t.pluginKey=="string"?new ve(t.pluginKey):t.pluginKey,view:e=>new gu({view:e,...t})});var bu=Me.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[og({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});function Us(t,e,n=null){return n?t.createChecked({"data-col-span":e},n):t.createAndFill({"data-col-span":e})}function sg(t){if(t.cached.gridBuilderNodeTypes)return t.cached.gridBuilderNodeTypes;let e={};return Object.keys(t.nodes).forEach(n=>{let r=t.nodes[n];r.spec.gridBuilderRole&&(e[r.spec.gridBuilderRole]=r)}),t.cached.gridBuilderNodeTypes=e,e}function ag(t,e,n,r,i,o,s){let a=sg(t),l=[];if(n==="asymmetric")l.push(Us(a.builderColumn,i,s)),l.push(Us(a.builderColumn,o,s));else for(let c=0;ct.getAttribute("data-type")},"data-cols":{default:2,parseHTML:t=>t.getAttribute("data-cols")},"data-stack-at":{default:"md",parseHTML:t=>t.getAttribute("data-stack-at")},style:{default:null,parseHTML:t=>t.getAttribute("style"),renderHTML:t=>({style:`grid-template-columns: repeat(${t["data-cols"]}, 1fr);`})}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-grid-builder")&&null}]},renderHTML({HTMLAttributes:t}){return["div",B(this.options.HTMLAttributes,t),0]},addCommands(){return{insertGridBuilder:({cols:t=3,type:e="responsive",stackAt:n,asymmetricLeft:r=null,asymmetricRight:i=null}={})=>({tr:o,dispatch:s,editor:a})=>{let l=ag(a.schema,t,e,n,r,i);if(s){let c=o.selection.anchor+1;o.replaceSelectionWith(l).scrollIntoView().setSelection($.near(o.doc.resolve(c)))}return!0}}},addKeyboardShortcuts(){return{"Mod-Alt-G":()=>this.editor.commands.insertGridBuilder()}},extendNodeSchema(t){let e={name:t.name,options:t.options,storage:t.storage};return{gridBuilderRole:ee(H(t,"gridBuilderRole",e))}}});var Eu=z.create({name:"gridBuilderColumn",content:"block+",gridBuilderRole:"builderColumn",isolating:!0,addOptions(){return{HTMLAttributes:{class:"filament-tiptap-grid-builder__column"}}},addAttributes(){return{"data-col-span":{default:1,parseHTML:t=>t.getAttribute("data-col-span")},style:{default:null,parseHTML:t=>t.getAttribute("style"),renderHTML:t=>({style:`grid-column: span ${t["data-col-span"]};`})}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-grid-builder__column")&&null}]},renderHTML({HTMLAttributes:t}){return["div",B(this.options.HTMLAttributes,t),0]}});function Vk(t){let e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="<[^<>]+>",s="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional(o)+")",a={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},l="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+l+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},d={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},p=e.optional(i)+t.IDENT_RE+"\\s*\\(",h=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],m=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],g=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],b={type:m,keyword:h,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:g},_={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},w=[_,d,a,n,t.C_BLOCK_COMMENT_MODE,u,c],D={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:b,contains:w.concat([{begin:/\(/,end:/\)/,keywords:b,contains:w.concat(["self"]),relevance:0}]),relevance:0},K={className:"function",begin:"("+s+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:b,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:b,relevance:0},{begin:p,returnBegin:!0,contains:[f],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,u]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:b,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,c,u,a,{begin:/\(/,end:/\)/,keywords:b,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,c,u,a]}]},a,n,t.C_BLOCK_COMMENT_MODE,d]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:b,illegal:"",keywords:b,contains:["self",a]},{begin:t.IDENT_RE+"::",keywords:b},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function lg(t){let e={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=Vk(t),r=n.keywords;return r.type=[...r.type,...e.type],r.literal=[...r.literal,...e.literal],r.built_in=[...r.built_in,...e.built_in],r._hints=e._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function cg(t){let e=t.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});let i={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},s={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);let a={className:"",begin:/\\"/},l={className:"string",begin:/'/,end:/'/},c={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},u=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],d=t.SHEBANG({binary:`(${u.join("|")})`,relevance:10}),f={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},p=["if","then","else","elif","fi","for","while","until","in","do","done","case","esac","function","select"],h=["true","false"],m={match:/(\/[a-z._-]+)+/},g=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],y=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","type","typeset","ulimit","unalias"],S=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],M=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:p,literal:h,built_in:[...g,...y,"set","shopt",...S,...M]},contains:[d,t.SHEBANG(),f,c,t.HASH_COMMENT_MODE,o,m,s,a,l,n]}}function ug(t){let e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="<[^<>]+>",s="("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional(o)+")",a={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},l="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+l+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},d={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},p=e.optional(i)+t.IDENT_RE+"\\s*\\(",g={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal128","const","static","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},y=[d,a,n,t.C_BLOCK_COMMENT_MODE,u,c],S={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:g,contains:y.concat([{begin:/\(/,end:/\)/,keywords:g,contains:y.concat(["self"]),relevance:0}]),relevance:0},M={begin:"("+s+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:g,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:g,relevance:0},{begin:p,returnBegin:!0,contains:[t.inherit(f,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:g,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,c,u,a,{begin:/\(/,end:/\)/,keywords:g,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,c,u,a]}]},a,n,t.C_BLOCK_COMMENT_MODE,d]};return{name:"C",aliases:["h"],keywords:g,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:d,strings:c,keywords:g}}}function dg(t){let e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="<[^<>]+>",s="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional(o)+")",a={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},l="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+l+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},d={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},p=e.optional(i)+t.IDENT_RE+"\\s*\\(",h=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],m=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],g=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],b={type:m,keyword:h,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:g},_={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},w=[_,d,a,n,t.C_BLOCK_COMMENT_MODE,u,c],D={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:b,contains:w.concat([{begin:/\(/,end:/\)/,keywords:b,contains:w.concat(["self"]),relevance:0}]),relevance:0},K={className:"function",begin:"("+s+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:b,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:b,relevance:0},{begin:p,returnBegin:!0,contains:[f],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,u]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:b,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,c,u,a,{begin:/\(/,end:/\)/,keywords:b,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,c,u,a]}]},a,n,t.C_BLOCK_COMMENT_MODE,d]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:b,illegal:"",keywords:b,contains:["self",a]},{begin:t.IDENT_RE+"::",keywords:b},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function fg(t){let e=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],i=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],o=["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"],s={keyword:i.concat(o),built_in:e,literal:r},a=t.inherit(t.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},u=t.inherit(c,{illegal:/\n/}),d={className:"subst",begin:/\{/,end:/\}/,keywords:s},f=t.inherit(d,{illegal:/\n/}),p={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,f]},h={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},d]},m=t.inherit(h,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},f]});d.contains=[h,p,c,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,l,t.C_BLOCK_COMMENT_MODE],f.contains=[m,p,u,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,l,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let g={variants:[h,p,c,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},y={begin:"<",end:">",contains:[{beginKeywords:"in out"},a]},S=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",M={begin:"@"+t.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:s,illegal:/::/,contains:[t.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:""},{begin:""}]}]}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},g,l,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},a,y,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,y,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+S+"\\s+)+"+t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:s,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,y],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,relevance:0,contains:[g,l,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},M]}}var Gk=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),qk=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],jk=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],Yk=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],Jk=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],Xk=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();function pg(t){let e=t.regex,n=Gk(t),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",o=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",a=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Yk.join("|")+")"},{begin:":(:)?("+Jk.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Xk.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...a,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:o},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:jk.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...a,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+qk.join("|")+")\\b"}]}}function hg(t){let e=t.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:e.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:e.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function mg(t){let o={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:o,illegal:"Eg(t,e,n-1))}function wg(t){let e=t.regex,n="[\xC0-\u02B8a-zA-Z_$][\xC0-\u02B8a-zA-Z_$0-9]*",r=n+Eg("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),l={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},c={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},u={className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:l,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[e.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[u,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:l,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[c,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,yg,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},yg,c]}}var vg="[A-Za-z$_][0-9A-Za-z$_]*",Zk=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],Qk=["true","false","null","undefined","NaN","Infinity"],Sg=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],xg=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],kg=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],eM=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],tM=[].concat(kg,Sg,xg);function Mg(t){let e=t.regex,n=(v,{after:C})=>{let P="",end:""},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(v,C)=>{let P=v[0].length+v.index,Y=v.input[P];if(Y==="<"||Y===","){C.ignoreMatch();return}Y===">"&&(n(v,{after:P})||C.ignoreMatch());let Q,he=v.input.substring(P);if(Q=he.match(/^\s*=/)){C.ignoreMatch();return}if((Q=he.match(/^\s+extends\s+/))&&Q.index===0){C.ignoreMatch();return}}},a={$pattern:vg,keyword:Zk,literal:Qk,built_in:tM,"variable.language":eM},l="[0-9](_?[0-9])*",c=`\\.(${l})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${u})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${u})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},p={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},h={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"css"}},m={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},g={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,f]},S={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},M=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,p,h,m,g,{match:/\$\d+/},d];f.contains=M.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(M)});let b=[].concat(S,f.contains),_=b.concat([{begin:/\(/,end:/\)/,keywords:a,contains:["self"].concat(b)}]),w={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:_},D={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},K={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Sg,...xg]}},O={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},J={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[w],illegal:/%/},ne={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function ie(v){return e.concat("(?!",v.join("|"),")")}let Z={match:e.concat(/\b/,ie([...kg,"super","import"]),r,e.lookahead(/\(/)),className:"title.function",relevance:0},re={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ce={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},w]},N="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",E={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(N)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[w]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:_,CLASS_REFERENCE:K},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),O,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,p,h,m,g,S,{match:/\$\d+/},d,K,{className:"attr",begin:r+e.lookahead(":"),relevance:0},E,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[S,t.REGEXP_MODE,{className:"function",begin:N,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:_}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:o},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},J,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[w,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},re,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[w]},Z,ne,D,ce,{match:/\$[(.]/}]}}function Tg(t){let e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",keywords:{literal:r},contains:[e,n,t.QUOTE_STRING_MODE,i,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var fi="[0-9](_*[0-9])*",Ws=`\\.(${fi})`,Vs="[0-9a-fA-F](_*[0-9a-fA-F])*",nM={className:"number",variants:[{begin:`(\\b(${fi})((${Ws})|\\.)?|(${Ws}))[eE][+-]?(${fi})[fFdD]?\\b`},{begin:`\\b(${fi})((${Ws})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Ws})[fFdD]?\\b`},{begin:`\\b(${fi})[fFdD]\\b`},{begin:`\\b0[xX]((${Vs})\\.?|(${Vs})?\\.(${Vs}))[pP][+-]?(${fi})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Vs})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Ng(t){let e={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[t.C_NUMBER_MODE]},o={className:"variable",begin:"\\$"+t.UNDERSCORE_IDENT_RE},s={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[o,i]},{begin:"'",end:"'",illegal:/\n/,contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[t.BACKSLASH_ESCAPE,o,i]}]};i.contains.push(s);let a={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+t.UNDERSCORE_IDENT_RE+")?"},l={className:"meta",begin:"@"+t.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[t.inherit(s,{className:"string"}),"self"]}]},c=nM,u=t.COMMENT("/\\*","\\*/",{contains:[t.C_BLOCK_COMMENT_MODE]}),d={variants:[{className:"type",begin:t.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},f=d;return f.variants[1].contains=[d],d.variants[1].contains=[f],{name:"Kotlin",aliases:["kt","kts"],keywords:e,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),t.C_LINE_COMMENT_MODE,u,n,r,a,l,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:e,relevance:5,contains:[{begin:t.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[t.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:e,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[d,t.C_LINE_COMMENT_MODE,u],relevance:0},t.C_LINE_COMMENT_MODE,u,a,l,s,t.C_NUMBER_MODE]},u]},{begin:[/class|interface|trait/,/\s+/,t.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},t.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},a,l]},s,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` -`},c]}}var rM=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),iM=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],oM=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],_g=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],Cg=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],sM=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse(),aM=_g.concat(Cg);function Og(t){let e=rM(t),n=aM,r="and or not only",i="[\\w-]+",o="("+i+"|@\\{"+i+"\\})",s=[],a=[],l=function(M){return{className:"string",begin:"~?"+M+".*?"+M}},c=function(M,b,_){return{className:M,begin:b,relevance:_}},u={$pattern:/[a-z-]+/,keyword:r,attribute:oM.join(" ")},d={begin:"\\(",end:"\\)",contains:a,keywords:u,relevance:0};a.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,l("'"),l('"'),e.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},e.HEXCOLOR,d,c("variable","@@?"+i,10),c("variable","@\\{"+i+"\\}"),c("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},e.IMPORTANT,{beginKeywords:"and not"},e.FUNCTION_DISPATCH);let f=a.concat({begin:/\{/,end:/\}/,contains:s}),p={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(a)},h={begin:o+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+sM.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:a}}]},m={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:u,returnEnd:!0,contains:a,relevance:0}},g={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:f}},y={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:o,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,p,c("keyword","all\\b"),c("variable","@\\{"+i+"\\}"),{begin:"\\b("+iM.join("|")+")\\b",className:"selector-tag"},e.CSS_NUMBER_MODE,c("selector-tag",o,0),c("selector-id","#"+o),c("selector-class","\\."+o,0),c("selector-tag","&",0),e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+_g.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+Cg.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:f},{begin:"!important"},e.FUNCTION_DISPATCH]},S={begin:i+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[y]};return s.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,m,g,S,h,y,p,e.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:s}}function Ag(t){let e="\\[=*\\[",n="\\]=*\\]",r={begin:e,end:n,contains:["self"]},i=[t.COMMENT("--(?!"+e+")","$"),t.COMMENT("--"+e,n,{contains:[r],relevance:10})];return{name:"Lua",keywords:{$pattern:t.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},t.C_NUMBER_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:e,end:n,contains:[r],relevance:5}])}}function Rg(t){let e={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},i={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},o={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},a=/[A-Za-z][A-Za-z0-9+.-]*/,l={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,a,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},c={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},u={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},d=t.inherit(c,{contains:[]}),f=t.inherit(u,{contains:[]});c.contains.push(f),u.contains.push(d);let p=[n,l];return[c,u,d,f].forEach(g=>{g.contains=g.contains.concat(p)}),p=p.concat(c,u),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:p},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:p}]}]},n,o,c,u,{className:"quote",begin:"^>\\s+",contains:p,end:"$"},i,r,l,s]}}function Dg(t){let e={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,a={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},l={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:a,illegal:"/,end:/$/,illegal:"\\n"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+l.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:l,contains:[t.UNDERSCORE_TITLE_MODE]},{begin:"\\."+t.UNDERSCORE_IDENT_RE,relevance:0}]}}function Lg(t){let e=t.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(" ")},o={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},s={begin:/->\{/,end:/\}/},a={variants:[{begin:/\$\d/},{begin:e.concat(/[$%@](\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@][^\s\w{]/,relevance:0}]},l=[t.BACKSLASH_ESCAPE,o,a],c=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],u=(p,h,m="\\1")=>{let g=m==="\\1"?m:e.concat(m,h);return e.concat(e.concat("(?:",p,")"),h,/(?:\\.|[^\\\/])*?/,g,/(?:\\.|[^\\\/])*?/,m,r)},d=(p,h,m)=>e.concat(e.concat("(?:",p,")"),h,/(?:\\.|[^\\\/])*?/,m,r),f=[a,t.HASH_COMMENT_MODE,t.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),s,{className:"string",contains:l,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},{className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},{begin:"(\\/\\/|"+t.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[t.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:u("s|tr|y",e.either(...c,{capture:!0}))},{begin:u("s|tr|y","\\(","\\)")},{begin:u("s|tr|y","\\[","\\]")},{begin:u("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:d("(?:m|qr)?",/\//,/\//)},{begin:d("m|qr",e.either(...c,{capture:!0}),/\1/)},{begin:d("m|qr",/\(/,/\)/)},{begin:d("m|qr",/\[/,/\]/)},{begin:d("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return o.contains=f,s.contains=f,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:f}}function Pg(t){let e=t.regex,n=/(?![A-Za-z0-9])(?![$])/,r=e.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),o={scope:"variable",match:"\\$+"+r},s={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},a={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},l=t.inherit(t.APOS_STRING_MODE,{illegal:null}),c=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(a)}),u={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(a),"on:begin":(Z,re)=>{re.data._beginMatch=Z[1]||Z[2]},"on:end":(Z,re)=>{re.data._beginMatch!==Z[1]&&re.ignoreMatch()}},d=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),f=`[ -]`,p={scope:"string",variants:[c,l,u,d]},h={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},m=["false","null","true"],g=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],y=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],M={keyword:g,literal:(Z=>{let re=[];return Z.forEach(ce=>{re.push(ce),ce.toLowerCase()===ce?re.push(ce.toUpperCase()):re.push(ce.toLowerCase())}),re})(m),built_in:y},b=Z=>Z.map(re=>re.replace(/\|\d+$/,"")),_={variants:[{match:[/new/,e.concat(f,"+"),e.concat("(?!",b(y).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},w=e.concat(r,"\\b(?!\\()"),D={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),w],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,e.concat(/::/,e.lookahead(/(?!class\b)/)),w],scope:{1:"title.class",3:"variable.constant"}},{match:[i,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},K={scope:"attr",match:e.concat(r,e.lookahead(":"),e.lookahead(/(?!::)/))},O={relevance:0,begin:/\(/,end:/\)/,keywords:M,contains:[K,o,D,t.C_BLOCK_COMMENT_MODE,p,h,_]},J={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",b(g).join("\\b|"),"|",b(y).join("\\b|"),"\\b)"),r,e.concat(f,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[O]};O.contains.push(J);let ne=[K,D,t.C_BLOCK_COMMENT_MODE,p,h,_],ie={begin:e.concat(/#\[\s*/,i),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:m,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:m,keyword:["new","array"]},contains:["self",...ne]},...ne,{scope:"meta",match:i}]};return{case_insensitive:!1,keywords:M,contains:[ie,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},s,{scope:"variable.language",match:/\$this\b/},o,J,D,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},_,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:M,contains:["self",o,D,t.C_BLOCK_COMMENT_MODE,p,h]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},p,h]}}function Bg(t){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},t.inherit(t.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function Hg(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function Fg(t){let e=t.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],a={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},c={className:"subst",begin:/\{/,end:/\}/,keywords:a,illegal:/#/},u={begin:/\{\{/,relevance:0},d={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,l,u,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,l,u,c]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,u,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,u,c]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},f="[0-9](_?[0-9])*",p=`(\\b(${f}))?\\.(${f})|\\b(${f})\\.`,h=`\\b|${r.join("|")}`,m={className:"number",relevance:0,variants:[{begin:`(\\b(${f})|(${p}))[eE][+-]?(${f})[jJ]?(?=${h})`},{begin:`(${p})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${h})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${h})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${h})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${h})`},{begin:`\\b(${f})[jJ](?=${h})`}]},g={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:a,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:["self",l,m,d,t.HASH_COMMENT_MODE]}]};return c.contains=[d,m,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:a,illegal:/(<\/|\?)|=>/,contains:[l,m,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},d,g,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[y]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[m,y,d]}]}}function zg(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function Ug(t){let e=t.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=e.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,o=e.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[t.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:e.lookahead(e.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),t.HASH_COMMENT_MODE,{scope:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[o,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:o},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function $g(t){let e=t.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=e.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=e.concat(r,/(::\w+)*/),s={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},a={className:"doctag",begin:"@[A-Za-z]+"},l={begin:"#<",end:">"},c=[t.COMMENT("#","$",{contains:[a]}),t.COMMENT("^=begin","^=end",{contains:[a],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],u={className:"subst",begin:/#\{/,end:/\}/,keywords:s},d={className:"string",contains:[t.BACKSLASH_ESCAPE,u],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:e.concat(/<<[-~]?'?/,e.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,u]})]}]},f="[1-9](_?[0-9])*|0",p="[0-9](_?[0-9])*",h={className:"number",relevance:0,variants:[{begin:`\\b(${f})(\\.(${p}))?([eE][+-]?(${p})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},m={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:s}]},w=[d,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:s},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:s},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[m]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[d,{begin:n}],relevance:0},h,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:s},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.BACKSLASH_ESCAPE,u],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(l,c),relevance:0}].concat(l,c);u.contains=w,m.contains=w;let D="[>?]>",K="[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]",O="(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>",J=[{begin:/^\s*=>/,starts:{end:"$",contains:w}},{className:"meta.prompt",begin:"^("+D+"|"+K+"|"+O+")(?=[ ])",starts:{end:"$",keywords:s,contains:w}}];return c.unshift(l),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:s,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(J).concat(c).concat(w)}}function Kg(t){let e=t.regex,n={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let\b)/,t.IDENT_RE,e.lookahead(/\s*\(/))},r="([ui](8|16|32|64|128|size)|f(32|64))?",i=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","unsafe","unsized","use","virtual","where","while","yield"],o=["true","false","Some","None","Ok","Err"],s=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],a=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:a,keyword:i,literal:o,built_in:s},illegal:""},n]}}var lM=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),cM=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],uM=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],dM=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],fM=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],pM=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();function Wg(t){let e=lM(t),n=fM,r=dM,i="@[a-z-]+",o="and or not only",a={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,e.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+cM.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},a,{begin:/\(/,end:/\)/,contains:[e.CSS_NUMBER_MODE]},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+pM.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[e.BLOCK_COMMENT,a,e.HEXCOLOR,e.CSS_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.IMPORTANT,e.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:o,attribute:uM.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},a,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.HEXCOLOR,e.CSS_NUMBER_MODE]},e.FUNCTION_DISPATCH]}}function Vg(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function Gg(t){let e=t.regex,n=t.COMMENT("--","$"),r={className:"string",variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},i={begin:/"/,end:/"/,contains:[{begin:/""/}]},o=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],a=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],l=["add","asc","collation","desc","final","first","last","view"],c=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],u=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],d=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],f=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],p=u,h=[...c,...l].filter(M=>!u.includes(M)),m={className:"variable",begin:/@[a-z0-9][a-z0-9_]*/},g={className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={begin:e.concat(/\b/,e.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function S(M,{exceptions:b,when:_}={}){let w=_;return b=b||[],M.map(D=>D.match(/\|\d+$/)||b.includes(D)?D:w(D)?`${D}|0`:D)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:S(h,{when:M=>M.length<3}),literal:o,type:a,built_in:d},contains:[{begin:e.either(...f),relevance:0,keywords:{$pattern:/[\w\.]+/,keyword:h.concat(f),literal:o,type:a}},{className:"type",begin:e.either(...s)},y,m,r,i,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,g]}}function Jg(t){return t?typeof t=="string"?t:t.source:null}function Gs(t){return xe("(?=",t,")")}function xe(...t){return t.map(n=>Jg(n)).join("")}function hM(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function wt(...t){return"("+(hM(t).capture?"":"?:")+t.map(r=>Jg(r)).join("|")+")"}var xu=t=>xe(/\b/,t,/\w$/.test(t)?/\b/:/\B/),mM=["Protocol","Type"].map(xu),qg=["init","self"].map(xu),gM=["Any","Self"],wu=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","break","case","catch","class","continue","convenience","default","defer","deinit","didSet","distributed","do","dynamic","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],jg=["false","nil","true"],bM=["assignment","associativity","higherThan","left","lowerThan","none","right"],yM=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],Yg=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],Xg=wt(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),Zg=wt(Xg,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),vu=xe(Xg,Zg,"*"),Qg=wt(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),qs=wt(Qg,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Tn=xe(Qg,qs,"*"),Su=xe(/[A-Z]/,qs,"*"),EM=["autoclosure",xe(/convention\(/,wt("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",xe(/objc\(/,Tn,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","testable","UIApplicationMain","unknown","usableFromInline"],wM=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function eb(t){let e={match:/\s+/,relevance:0},n=t.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[t.C_LINE_COMMENT_MODE,n],i={match:[/\./,wt(...mM,...qg)],className:{2:"keyword"}},o={match:xe(/\./,wt(...wu)),relevance:0},s=wu.filter(fe=>typeof fe=="string").concat(["_|0"]),a=wu.filter(fe=>typeof fe!="string").concat(gM).map(xu),l={variants:[{className:"keyword",match:wt(...a,...qg)}]},c={$pattern:wt(/\b\w+/,/#\w+/),keyword:s.concat(yM),literal:jg},u=[i,o,l],d={match:xe(/\./,wt(...Yg)),relevance:0},f={className:"built_in",match:xe(/\b/,wt(...Yg),/(?=\()/)},p=[d,f],h={match:/->/,relevance:0},m={className:"operator",relevance:0,variants:[{match:vu},{match:`\\.(\\.|${Zg})+`}]},g=[h,m],y="([0-9]_*)+",S="([0-9a-fA-F]_*)+",M={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${S})(\\.(${S}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},b=(fe="")=>({className:"subst",variants:[{match:xe(/\\/,fe,/[0\\tnr"']/)},{match:xe(/\\/,fe,/u\{[0-9a-fA-F]{1,8}\}/)}]}),_=(fe="")=>({className:"subst",match:xe(/\\/,fe,/[\t ]*(?:[\r\n]|\r\n)/)}),w=(fe="")=>({className:"subst",label:"interpol",begin:xe(/\\/,fe,/\(/),end:/\)/}),D=(fe="")=>({begin:xe(fe,/"""/),end:xe(/"""/,fe),contains:[b(fe),_(fe),w(fe)]}),K=(fe="")=>({begin:xe(fe,/"/),end:xe(/"/,fe),contains:[b(fe),w(fe)]}),O={className:"string",variants:[D(),D("#"),D("##"),D("###"),K(),K("#"),K("##"),K("###")]},J={match:xe(/`/,Tn,/`/)},ne={className:"variable",match:/\$\d+/},ie={className:"variable",match:`\\$${qs}+`},Z=[J,ne,ie],re={match:/(@|#(un)?)available/,className:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:wM,contains:[...g,M,O]}]}},ce={className:"keyword",match:xe(/@/,wt(...EM))},N={className:"meta",match:xe(/@/,Tn)},E=[re,ce,N],v={match:Gs(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:xe(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,qs,"+")},{className:"type",match:Su,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:xe(/\s+&\s+/,Gs(Su)),relevance:0}]},C={begin://,keywords:c,contains:[...r,...u,...E,h,v]};v.contains.push(C);let P={match:xe(Tn,/\s*:/),keywords:"_|0",relevance:0},Y={begin:/\(/,end:/\)/,relevance:0,keywords:c,contains:["self",P,...r,...u,...p,...g,M,O,...Z,...E,v]},Q={begin://,contains:[...r,v]},he={begin:wt(Gs(xe(Tn,/\s*:/)),Gs(xe(Tn,/\s+/,Tn,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Tn}]},ye={begin:/\(/,end:/\)/,keywords:c,contains:[he,...r,...u,...g,M,O,...E,v,Y],endsParent:!0,illegal:/["']/},ue={match:[/func/,/\s+/,wt(J.match,Tn,vu)],className:{1:"keyword",3:"title.function"},contains:[Q,ye,e],illegal:[/\[/,/%/]},ke={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[Q,ye,e],illegal:/\[|%/},pt={match:[/operator/,/\s+/,vu],className:{1:"keyword",3:"title"}},Ze={begin:[/precedencegroup/,/\s+/,Su],className:{1:"keyword",3:"title"},contains:[v],keywords:[...bM,...jg],end:/}/};for(let fe of O.variants){let ot=fe.contains.find(St=>St.label==="interpol");ot.keywords=c;let vt=[...u,...p,...g,M,O,...Z];ot.contains=[...vt,{begin:/\(/,end:/\)/,contains:["self",...vt]}]}return{name:"Swift",keywords:c,contains:[...r,ue,ke,{beginKeywords:"struct protocol class extension enum actor",end:"\\{",excludeEnd:!0,keywords:c,contains:[t.inherit(t.TITLE_MODE,{className:"title.class",begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...u]},pt,Ze,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},...u,...p,...g,M,O,...Z,...E,v,Y]}}var js="[A-Za-z$_][0-9A-Za-z$_]*",tb=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],nb=["true","false","null","undefined","NaN","Infinity"],rb=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],ib=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],ob=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],sb=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],ab=[].concat(ob,rb,ib);function vM(t){let e=t.regex,n=(v,{after:C})=>{let P="",end:""},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(v,C)=>{let P=v[0].length+v.index,Y=v.input[P];if(Y==="<"||Y===","){C.ignoreMatch();return}Y===">"&&(n(v,{after:P})||C.ignoreMatch());let Q,he=v.input.substring(P);if(Q=he.match(/^\s*=/)){C.ignoreMatch();return}if((Q=he.match(/^\s+extends\s+/))&&Q.index===0){C.ignoreMatch();return}}},a={$pattern:js,keyword:tb,literal:nb,built_in:ab,"variable.language":sb},l="[0-9](_?[0-9])*",c=`\\.(${l})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${u})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${u})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},p={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},h={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"css"}},m={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},g={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,f]},S={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},M=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,p,h,m,g,{match:/\$\d+/},d];f.contains=M.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(M)});let b=[].concat(S,f.contains),_=b.concat([{begin:/\(/,end:/\)/,keywords:a,contains:["self"].concat(b)}]),w={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:_},D={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},K={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...rb,...ib]}},O={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},J={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[w],illegal:/%/},ne={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function ie(v){return e.concat("(?!",v.join("|"),")")}let Z={match:e.concat(/\b/,ie([...ob,"super","import"]),r,e.lookahead(/\(/)),className:"title.function",relevance:0},re={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ce={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},w]},N="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",E={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(N)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[w]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:_,CLASS_REFERENCE:K},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),O,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,p,h,m,g,S,{match:/\$\d+/},d,K,{className:"attr",begin:r+e.lookahead(":"),relevance:0},E,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[S,t.REGEXP_MODE,{className:"function",begin:N,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:_}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:o},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},J,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[w,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},re,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[w]},Z,ne,D,ce,{match:/\$[(.]/}]}}function lb(t){let e=vM(t),n=js,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={beginKeywords:"namespace",end:/\{/,excludeEnd:!0,contains:[e.exports.CLASS_REFERENCE]},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[e.exports.CLASS_REFERENCE]},s={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},a=["type","namespace","interface","public","private","protected","implements","declare","abstract","readonly","enum","override"],l={$pattern:js,keyword:tb.concat(a),literal:nb,built_in:ab.concat(r),"variable.language":sb},c={className:"meta",begin:"@"+n},u=(f,p,h)=>{let m=f.contains.findIndex(g=>g.label===p);if(m===-1)throw new Error("can not find mode to replace");f.contains.splice(m,1,h)};Object.assign(e.keywords,l),e.exports.PARAMS_CONTAINS.push(c),e.contains=e.contains.concat([c,i,o]),u(e,"shebang",t.SHEBANG()),u(e,"use_strict",s);let d=e.contains.find(f=>f.label==="func.def");return d.relevance=0,Object.assign(e,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),e}function cb(t){let e=t.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,o=/\d{4}-\d{1,2}-\d{1,2}/,s=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,a=/\d{1,2}(:\d{1,2}){1,2}/,l={className:"literal",variants:[{begin:e.concat(/# */,e.either(o,i),/ *#/)},{begin:e.concat(/# */,a,/ *#/)},{begin:e.concat(/# */,s,/ *#/)},{begin:e.concat(/# */,e.either(o,i),/ +/,e.either(s,a),/ *#/)}]},c={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},u={className:"label",begin:/^\w+:/},d=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),f=t.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,l,c,u,d,f,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[f]}]}}function ub(t){t.regex;let e=t.COMMENT(/\(;/,/;\)/);e.contains.push("self");let n=t.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},o={className:"variable",begin:/\$[\w_]+/},s={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},a={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},l={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},c={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,e,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},o,s,i,t.QUOTE_STRING_MODE,l,c,a]}}function db(t){let e=t.regex,n=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},o={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=t.inherit(o,{begin:/\(/,end:/\)/}),a=t.inherit(t.APOS_STRING_MODE,{className:"string"}),l=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),c={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[o,l,a,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[o,s,l,a]}]}]},t.COMMENT(//,{relevance:10}),{begin://,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[c],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[c],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:c}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function fb(t){let e="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:"\\w[\\w :\\/.-]*:(?=[ ]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ ]|$)'},{begin:"'\\w[\\w :\\/.-]*':(?=[ ]|$)"}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},o={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,i]},s=t.inherit(o,{variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),a="[0-9]{4}(-[0-9][0-9]){0,2}",l="([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?",c="(\\.[0-9]*)?",u="([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?",d={className:"number",begin:"\\b"+a+l+c+u+"\\b"},f={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},p={begin:/\{/,end:/\}/,contains:[f],illegal:"\\n",relevance:0},h={begin:"\\[",end:"\\]",contains:[f],illegal:"\\n",relevance:0},m=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},d,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},p,h,o],g=[...m];return g.pop(),g.push(s),f.contains=g,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:m}}var Ib=zu(Rb(),1);var Bt=Ib.default;var Lb=zu(Db(),1),lo=Object.assign(Ar(Error),{eval:Ar(EvalError),range:Ar(RangeError),reference:Ar(ReferenceError),syntax:Ar(SyntaxError),type:Ar(TypeError),uri:Ar(URIError)});function Ar(t){return e.displayName=t.displayName||t.name,e;function e(n,...r){let i=n&&(0,Lb.default)(n,...r);return new t(i)}}var dT={}.hasOwnProperty,Pb="hljs-";function Bb(t,e,n={}){let r=n.prefix;if(typeof t!="string")throw lo("Expected `string` for name, got `%s`",t);if(!Bt.getLanguage(t))throw lo("Unknown language: `%s` is not registered",t);if(typeof e!="string")throw lo("Expected `string` for value, got `%s`",e);r==null&&(r=Pb),Bt.configure({__emitter:Ru,classPrefix:r});let i=Bt.highlight(e,{language:t,ignoreIllegals:!0});if(Bt.configure({}),i.errorRaised)throw i.errorRaised;return i._emitter.root.data.language=i.language,i._emitter.root.data.relevance=i.relevance,i._emitter.root}function fT(t,e={}){let n=e.subset||Bt.listLanguages(),r=e.prefix,i=-1,o={type:"root",data:{language:null,relevance:0},children:[]};if(r==null&&(r=Pb),typeof t!="string")throw lo("Expected `string` for value, got `%s`",t);for(;++io.data.relevance&&(o=a)}return o}function pT(t,e){Bt.registerLanguage(t,e)}var hT=function(t,e){if(typeof t=="string")Bt.registerAliases(e,{languageName:t});else{let n;for(n in t)dT.call(t,n)&&Bt.registerAliases(t[n],{languageName:n})}};function mT(t){return!!Bt.getLanguage(t)}function gT(){return Bt.listLanguages()}var Ru=class{constructor(e){this.options=e,this.root={type:"root",data:{language:null,relevance:0},children:[]},this.stack=[this.root]}addText(e){if(e==="")return;let n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=e:n.children.push({type:"text",value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,n){let r=this.stack[this.stack.length-1],i=e.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:i}):r.children.push(...i)}openNode(e){let n=e.split(".").map((o,s)=>s?o+"_".repeat(s):this.options.classPrefix+o),r=this.stack[this.stack.length-1],i={type:"element",tagName:"span",properties:{className:n},children:[]};r.children.push(i),this.stack.push(i)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}},se={highlight:Bb,highlightAuto:fT,registerLanguage:pT,registered:mT,listLanguages:gT,registerAlias:hT};se.registerLanguage("arduino",lg);se.registerLanguage("bash",cg);se.registerLanguage("c",ug);se.registerLanguage("cpp",dg);se.registerLanguage("csharp",fg);se.registerLanguage("css",pg);se.registerLanguage("diff",hg);se.registerLanguage("go",mg);se.registerLanguage("graphql",gg);se.registerLanguage("ini",bg);se.registerLanguage("java",wg);se.registerLanguage("javascript",Mg);se.registerLanguage("json",Tg);se.registerLanguage("kotlin",Ng);se.registerLanguage("less",Og);se.registerLanguage("lua",Ag);se.registerLanguage("makefile",Rg);se.registerLanguage("markdown",Ig);se.registerLanguage("objectivec",Dg);se.registerLanguage("perl",Lg);se.registerLanguage("php",Pg);se.registerLanguage("php-template",Bg);se.registerLanguage("plaintext",Hg);se.registerLanguage("python",Fg);se.registerLanguage("python-repl",zg);se.registerLanguage("r",Ug);se.registerLanguage("ruby",$g);se.registerLanguage("rust",Kg);se.registerLanguage("scss",Wg);se.registerLanguage("shell",Vg);se.registerLanguage("sql",Gg);se.registerLanguage("swift",eb);se.registerLanguage("typescript",lb);se.registerLanguage("vbnet",cb);se.registerLanguage("wasm",ub);se.registerLanguage("xml",db);se.registerLanguage("yaml",fb);var jn=(t,e=0,n=1)=>t>n?n:tMath.round(n*t)/n;var uP={grad:360/400,turn:360,rad:360/(Math.PI*2)},Hb=t=>wT(ea(t)),ea=t=>(t[0]==="#"&&(t=t.substring(1)),t.length<6?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?ze(parseInt(t[3]+t[3],16)/255,2):1}:{r:parseInt(t.substring(0,2),16),g:parseInt(t.substring(2,4),16),b:parseInt(t.substring(4,6),16),a:t.length===8?ze(parseInt(t.substring(6,8),16)/255,2):1});var Fb=t=>ET(yT(t)),bT=({h:t,s:e,v:n,a:r})=>{let i=(200-e)*n/100;return{h:ze(t),s:ze(i>0&&i<200?e*n/100/(i<=100?i:200-i)*100:0),l:ze(i/2),a:ze(r,2)}};var co=t=>{let{h:e,s:n,l:r}=bT(t);return`hsl(${e}, ${n}%, ${r}%)`};var yT=({h:t,s:e,v:n,a:r})=>{t=t/360*6,e=e/100,n=n/100;let i=Math.floor(t),o=n*(1-e),s=n*(1-(t-i)*e),a=n*(1-(1-t+i)*e),l=i%6;return{r:ze([n,s,o,o,a,n][l]*255),g:ze([a,n,n,s,o,o][l]*255),b:ze([o,o,a,n,n,s][l]*255),a:ze(r,2)}};var Qs=t=>{let e=t.toString(16);return e.length<2?"0"+e:e},ET=({r:t,g:e,b:n,a:r})=>{let i=r<1?Qs(ze(r*255)):"";return"#"+Qs(t)+Qs(e)+Qs(n)+i},wT=({r:t,g:e,b:n,a:r})=>{let i=Math.max(t,e,n),o=i-Math.min(t,e,n),s=o?i===t?(e-n)/o:i===e?2+(n-t)/o:4+(t-e)/o:0;return{h:ze(60*(s<0?s+6:s)),s:ze(i?o/i*100:0),v:ze(i/255*100),a:r}};var Iu=(t,e)=>{if(t===e)return!0;for(let n in t)if(t[n]!==e[n])return!1;return!0};var zb=(t,e)=>t.toLowerCase()===e.toLowerCase()?!0:Iu(ea(t),ea(e));var Ub={},ta=t=>{let e=Ub[t];return e||(e=document.createElement("template"),e.innerHTML=t,Ub[t]=e),e},uo=(t,e,n)=>{t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:n}))};var mi=!1,Du=t=>"touches"in t,vT=t=>mi&&!Du(t)?!1:(mi||(mi=Du(t)),!0),$b=(t,e)=>{let n=Du(e)?e.touches[0]:e,r=t.el.getBoundingClientRect();uo(t.el,"move",t.getMove({x:jn((n.pageX-(r.left+window.pageXOffset))/r.width),y:jn((n.pageY-(r.top+window.pageYOffset))/r.height)}))},ST=(t,e)=>{let n=e.keyCode;n>40||t.xy&&n<37||n<33||(e.preventDefault(),uo(t.el,"move",t.getMove({x:n===39?.01:n===37?-.01:n===34?.05:n===33?-.05:n===35?1:n===36?-1:0,y:n===40?.01:n===38?-.01:0},!0)))},gi=class{constructor(e,n,r,i){let o=ta(`
`);e.appendChild(o.content.cloneNode(!0));let s=e.querySelector(`[part=${n}]`);s.addEventListener("mousedown",this),s.addEventListener("touchstart",this),s.addEventListener("keydown",this),this.el=s,this.xy=i,this.nodes=[s.firstChild,s]}set dragging(e){let n=e?document.addEventListener:document.removeEventListener;n(mi?"touchmove":"mousemove",this),n(mi?"touchend":"mouseup",this)}handleEvent(e){switch(e.type){case"mousedown":case"touchstart":if(e.preventDefault(),!vT(e)||!mi&&e.button!=0)return;this.el.focus(),$b(this,e),this.dragging=!0;break;case"mousemove":case"touchmove":e.preventDefault(),$b(this,e);break;case"mouseup":case"touchend":this.dragging=!1;break;case"keydown":ST(this,e);break}}style(e){e.forEach((n,r)=>{for(let i in n)this.nodes[r].style.setProperty(i,n[i])})}};var na=class extends gi{constructor(e){super(e,"hue",'aria-label="Hue" aria-valuemin="0" aria-valuemax="360"',!1)}update({h:e}){this.h=e,this.style([{left:`${e/360*100}%`,color:co({h:e,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuenow",`${ze(e)}`)}getMove(e,n){return{h:n?jn(this.h+e.x*360,0,360):360*e.x}}};var ra=class extends gi{constructor(e){super(e,"saturation",'aria-label="Color"',!0)}update(e){this.hsva=e,this.style([{top:`${100-e.v}%`,left:`${e.s}%`,color:co(e)},{"background-color":co({h:e.h,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuetext",`Saturation ${ze(e.s)}%, Brightness ${ze(e.v)}%`)}getMove(e,n){return{s:n?jn(this.hsva.s+e.x*100,0,100):e.x*100,v:n?jn(this.hsva.v-e.y*100,0,100):Math.round(100-e.y*100)}}};var Kb=':host{display:flex;flex-direction:column;position:relative;width:200px;height:200px;user-select:none;-webkit-user-select:none;cursor:default}:host([hidden]){display:none!important}[role=slider]{position:relative;touch-action:none;user-select:none;-webkit-user-select:none;outline:0}[role=slider]:last-child{border-radius:0 0 8px 8px}[part$=pointer]{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;display:flex;place-content:center center;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}[part$=pointer]::after{content:"";width:100%;height:100%;border-radius:inherit;background-color:currentColor}[role=slider]:focus [part$=pointer]{transform:translate(-50%,-50%) scale(1.1)}';var Wb="[part=hue]{flex:0 0 24px;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}[part=hue-pointer]{top:50%;z-index:2}";var Vb="[part=saturation]{flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part=saturation-pointer]{z-index:3}";var ia=Symbol("same"),Lu=Symbol("color"),Gb=Symbol("hsva"),Pu=Symbol("update"),qb=Symbol("parts"),jb=Symbol("css"),Yb=Symbol("sliders"),oa=class extends HTMLElement{static get observedAttributes(){return["color"]}get[jb](){return[Kb,Wb,Vb]}get[Yb](){return[ra,na]}get color(){return this[Lu]}set color(e){if(!this[ia](e)){let n=this.colorModel.toHsva(e);this[Pu](n),this[Lu]=e}}constructor(){super();let e=ta(``),n=this.attachShadow({mode:"open"});n.appendChild(e.content.cloneNode(!0)),n.addEventListener("move",this),this[qb]=this[Yb].map(r=>new r(n))}connectedCallback(){if(this.hasOwnProperty("color")){let e=this.color;delete this.color,this.color=e}else this.color||(this.color=this.colorModel.defaultColor)}attributeChangedCallback(e,n,r){let i=this.colorModel.fromAttr(r);this[ia](i)||(this.color=i)}handleEvent(e){let n=this[Gb],r={...n,...e.detail};this[Pu](r);let i;!Iu(r,n)&&!this[ia](i=this.colorModel.fromHsva(r))&&(this[Lu]=i,uo(this,"color-changed",{value:i}))}[ia](e){return this.color&&this.colorModel.equal(e,this.color)}[Pu](e){this[Gb]=e,this[qb].forEach(n=>n.update(e))}};var xT={defaultColor:"#000",toHsva:Hb,fromHsva:({h:t,s:e,v:n})=>Fb({h:t,s:e,v:n,a:1}),equal:zb,fromAttr:t=>t},sa=class extends oa{get colorModel(){return xT}};var Bu=class extends sa{};customElements.define("hex-color-picker",Bu);var kT={blockquote:[gp],bold:[bp],"bullet-list":[wp],"checked-list":[nc],code:[vp],"code-block":[Vc.configure({lowlight:se,HTMLAttributes:{class:"hljs"}})],color:[xp],details:[Ic,Dc,Lc],grid:[_c,Cc],"grid-builder":[yu,Eu],heading:[Op.configure({levels:[1,2,3,4,5,6]})],highlight:[Th],hr:[Bp],hurdle:[Gc],italic:[Hp],lead:[rc],link:[kc.configure({openOnClick:!1,autolink:!1,HTMLAttributes:{rel:null,hreflang:null,class:null}})],media:[Mc.configure({inline:!0})],oembed:[Oc,Ac,Rc],"ordered-list":[Up],small:[Nc],strike:[$p],subscript:[Kp],superscript:[Wp],table:[wh.configure({resizable:!0}),Sh,vh,xh],underline:[Mh]},MT=window.TiptapEditorExtensions||{},Jb={...kT,...MT},aa=document.getElementById("activeLocale");aa&&aa.addEventListener("change",()=>{let t=new CustomEvent("localeChange",{bubbles:!0,detail:{locale:aa.value}});aa.dispatchEvent(t)});function TT({state:t,statePath:e,tools:n=[],disabled:r=!1,locale:i="en",floatingMenuTools:o=[]}){let s=window.filamentTiptapEditors||{};return{id:null,tools:n,state:t,statePath:e,fullScreenMode:!1,updatedAt:Date.now(),focused:!1,locale:i,floatingMenuTools:o,getExtensions(a){let l=this.tools.map(u=>typeof u=="string"?u:u.id),c=[kp,kh,Tc,Tp,_p,Cp,Pp,Sp];if(l.length){let u=Object.keys(Jb),d=[],f=["paragraph"];c.push(io.configure({pluginKey:`defaultBubbleMenu${a}`,element:this.$refs.defaultBubbleMenu,tippyOptions:{duration:[500,0]},shouldShow:({state:p,from:h,to:m})=>!(h===m||$t(p,"link")||$t(p,"table")||$t(p,"image")||$t(p,"oembed")||$t(p,"vimeo")||$t(p,"youtube")||$t(p,"video"))})),this.floatingMenuTools.length&&(c.push(bu.configure({pluginKey:`defaultFloatingMenu${a}`,element:this.$refs.defaultFloatingMenu,tippyOptions:{duration:[500,0]}})),this.floatingMenuTools.forEach(p=>{l.includes(p)||l.push(p)})),l.forEach(p=>{u.includes(p)?Jb[p].forEach(h=>{["ordered-list","bullet-list","checked-list"].includes(p)?(c.push(h),c.includes(Kl)||c.push(Kl)):(p==="table"&&c.push(io.configure({pluginKey:`tableBubbleMenu${a}`,element:this.$refs.tableBubbleMenu,tippyOptions:{duration:[500,0]},shouldShow:({state:m})=>$t(m,"table")})),p==="link"&&c.push(io.configure({pluginKey:`linkBubbleMenu${a}`,element:this.$refs.linkBubbleMenu,tippyOptions:{duration:[500,0]},shouldShow:({state:m})=>$t(m,"link")})),c.push(h))}):["align-left","align-right","align-center","align-justify"].includes(p)&&(p==="align-left"&&d.push("start"),p==="align-center"&&d.push("center"),p==="align-right"&&d.push("end"),p==="align-justify"&&d.push("justify"),l.includes("heading")&&f.push("heading"),typeof c.find(m=>m.name==="textAlign")>"u"&&c.push(qc.configure({types:f,alignments:d})))})}return c},init(){this.initEditor(t.initialValue),window.filamentTiptapEditors=s,document.addEventListener("dblclick",function(l){(l.target&&(l.target.hasAttribute("data-youtube-video")||l.target.hasAttribute("data-vimeo-video"))||l.target.hasAttribute("data-native-video"))&&(l.target.firstChild.style.pointerEvents="all")}),window.addEventListener("localeChange",l=>{this.locale=l.detail.locale});let a=this.$el.parentElement.closest("[x-sortable]");a&&(window.Sortable.utils.on(a,"start",()=>{Object.values(s).forEach(function(l){l.setEditable(!1)})}),window.Sortable.utils.on(a,"end",()=>{Object.values(s).forEach(function(l){l.setEditable(!0)})})),this.$watch("state",l=>{l==="

"&&l!==this.editor().getHTML()&&(s[this.id].destroy(),this.initEditor(l)),this.state!==l&&this.updateEditorContent(l)}),this.$watch("locale",()=>{Livewire.hook("commit",({component:l,commit:c,respond:u,succeed:d,fail:f})=>{d(({snapshot:p,effect:h})=>{queueMicrotask(()=>{s[this.id].destroy(),this.initEditor(this.state)})})})})},editor(){return s[this.id]},initEditor(a){this.id=Qh(8);let l=this;s[this.id]=new zo({element:this.$refs.element,extensions:this.getExtensions(this.id),editable:!r,content:a,onUpdate({editor:c}){l.updatedAt=Date.now(),setTimeout(()=>{c.chain().focus()},500)},onSelectionUpdate(){l.updatedAt=Date.now()},onBlur(){l.updatedAt=Date.now(),l.focused=!1,l.state=l.editor().getHTML()},onFocus(){l.updatedAt=Date.now(),l.focused=!0}})},updateEditorContent(a){this.editor().commands.setContent(a)},refreshEditorContent(){this.$nextTick(()=>this.updateEditorContent(this.state))},insertMedia(a){Array.isArray(a)?a.forEach(l=>{this.executeMediaInsert(l)}):this.executeMediaInsert(a)},executeMediaInsert(a=null){if(!(!a||a?.url===null)&&a){let l=a?.url||a?.src,c=["jpg","jpeg","svg","png","webp"],d=/.*\.([a-zA-Z]*)\??/.exec(l);d!==null&&c.includes(d[1])?this.editor().chain().focus().setImage({src:l,alt:a?.alt,title:a?.title,width:a?.width,height:a?.height}).run():this.editor().chain().focus().extendMarkRange("link").setLink({href:l}).insertContent(a?.link_text).run()}},insertVideo(a){if(!a||a.url===null)return;let l={src:a.url,width:a.responsive?a.width*100:a.width,height:a.responsive?a.height*100:a.height,responsive:a.responsive??!0,"data-aspect-width":a.width,"data-aspect-height":a.height};a.url.includes("youtube")||a.url.includes("youtu.be")?this.editor().chain().focus().setYoutubeVideo({...l,controls:a.youtube_options.includes("controls"),nocookie:a.youtube_options.includes("nocookie"),start:a.start_at??0}).run():a.url.includes("vimeo")?this.editor().chain().focus().setVimeoVideo({...l,autoplay:a.vimeo_options.includes("autoplay"),loop:a.vimeo_options.includes("loop"),title:a.vimeo_options.includes("show_title"),byline:a.vimeo_options.includes("byline"),portrait:a.vimeo_options.includes("portrait")}).run():this.editor().chain().focus().setVideo({...l,autoplay:a.native_options.includes("autoplay"),loop:a.native_options.includes("loop"),controls:a.native_options.includes("controls")}).run()},insertLink(a){if(!(a.href===null&&a.id===null)){if(a.href===""&&a.id===null){this.unsetLink();return}this.editor().chain().focus().extendMarkRange("link").setLink({href:a.href,id:a.id??null,target:a.target??null,hreflang:a.hreflang??null,rel:a.rel??null,referrerpolicy:a.referrerpolicy??null,as_button:a.as_button??null,button_theme:a.button_theme??null}).selectTextblockEnd().run()}},insertSource(a){this.editor().commands.setContent(a,{emitUpdate:!0})},unsetLink(){this.editor().chain().focus().extendMarkRange("link").unsetLink().selectTextblockEnd().run()},insertGridBuilder(a){let l="responsive",c=parseInt(a.asymmetric_left)??null,u=parseInt(a.asymmetric_right)??null;a.fixed&&(l="fixed"),a.asymmetric&&(l="asymmetric"),this.editor().chain().focus().insertGridBuilder({cols:a.columns,type:l,stackAt:a.stack_at,asymmetricLeft:c,asymmetricRight:u}).run()}}}export{TT as default}; +`);return!o||!s?!1:t.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;let{state:e}=t,{selection:n,doc:r}=e,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;let a=i.after();return a===void 0||r.nodeAt(a)?!1:t.commands.exitCode()}}},addInputRules(){return[Ni({find:qS,type:this.type,getAttributes:t=>({language:t[1]})}),Ni({find:jS,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new ge({key:new ve("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;let n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i?.mode;if(!n||!o)return!1;let{tr:s}=t.state;return s.replaceSelectionWith(this.type.create({language:o})),s.setSelection(K.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.insertText(n.replace(/\r\n?/g,` +`)),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}});var zc={exports:{}};function $c(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(function(e){var n=t[e];typeof n=="object"&&!Object.isFrozen(n)&&$c(n)}),t}zc.exports=$c;zc.exports.default=$c;var xs=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function am(t){return t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function On(t,...e){let n=Object.create(null);for(let r in t)n[r]=t[r];return e.forEach(function(r){for(let i in r)n[i]=r[i]}),n}var YS="
",Qh=t=>!!t.scope||t.sublanguage&&t.language,JS=(t,{prefix:e})=>{if(t.includes(".")){let n=t.split(".");return[`${e}${n.shift()}`,...n.map((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${e}${t}`},Pc=class{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=am(e)}openNode(e){if(!Qh(e))return;let n="";e.sublanguage?n=`language-${e.language}`:n=JS(e.scope,{prefix:this.classPrefix}),this.span(n)}closeNode(e){Qh(e)&&(this.buffer+=YS)}value(){return this.buffer}span(e){this.buffer+=``}},em=(t={})=>{let e={children:[]};return Object.assign(e,t),e},Bc=class t{constructor(){this.rootNode=em(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let n=em({scope:e});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return typeof n=="string"?e.addText(n):n.children&&(e.openNode(n),n.children.forEach(r=>this._walk(e,r)),e.closeNode(n)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(n=>typeof n=="string")?e.children=[e.children.join("")]:e.children.forEach(n=>{t._collapse(n)}))}},Fc=class extends Bc{constructor(e){super(),this.options=e}addKeyword(e,n){e!==""&&(this.openNode(n),this.addText(e),this.closeNode())}addText(e){e!==""&&this.add(e)}addSublanguage(e,n){let r=e.root;r.sublanguage=!0,r.language=n,this.add(r)}toHTML(){return new Pc(this,this.options).value()}finalize(){return!0}};function Ii(t){return t?typeof t=="string"?t:t.source:null}function lm(t){return lr("(?=",t,")")}function XS(t){return lr("(?:",t,")*")}function ZS(t){return lr("(?:",t,")?")}function lr(...t){return t.map(n=>Ii(n)).join("")}function QS(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function Uc(...t){return"("+(QS(t).capture?"":"?:")+t.map(r=>Ii(r)).join("|")+")"}function cm(t){return new RegExp(t.toString()+"|").exec("").length-1}function ex(t,e){let n=t&&t.exec(e);return n&&n.index===0}var tx=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Kc(t,{joinWith:e}){let n=0;return t.map(r=>{n+=1;let i=n,o=Ii(r),s="";for(;o.length>0;){let a=tx.exec(o);if(!a){s+=o;break}s+=o.substring(0,a.index),o=o.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?s+="\\"+String(Number(a[1])+i):(s+=a[0],a[0]==="("&&n++)}return s}).map(r=>`(${r})`).join(e)}var nx=/\b\B/,um="[a-zA-Z]\\w*",Wc="[a-zA-Z_]\\w*",dm="\\b\\d+(\\.\\d+)?",fm="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",pm="\\b(0b[01]+)",rx="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",ix=(t={})=>{let e=/^#![ ]*\//;return t.binary&&(t.begin=lr(e,/.*\b/,t.binary,/\b.*/)),On({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},t)},Di={begin:"\\\\[\\s\\S]",relevance:0},ox={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Di]},sx={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Di]},ax={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Ms=function(t,e,n={}){let r=On({scope:"comment",begin:t,end:e,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=Uc("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:lr(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},lx=Ms("//","$"),cx=Ms("/\\*","\\*/"),ux=Ms("#","$"),dx={scope:"number",begin:dm,relevance:0},fx={scope:"number",begin:fm,relevance:0},px={scope:"number",begin:pm,relevance:0},hx={begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[Di,{begin:/\[/,end:/\]/,relevance:0,contains:[Di]}]}]},mx={scope:"title",begin:um,relevance:0},gx={scope:"title",begin:Wc,relevance:0},bx={begin:"\\.\\s*"+Wc,relevance:0},yx=function(t){return Object.assign(t,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})},Ss=Object.freeze({__proto__:null,MATCH_NOTHING_RE:nx,IDENT_RE:um,UNDERSCORE_IDENT_RE:Wc,NUMBER_RE:dm,C_NUMBER_RE:fm,BINARY_NUMBER_RE:pm,RE_STARTERS_RE:rx,SHEBANG:ix,BACKSLASH_ESCAPE:Di,APOS_STRING_MODE:ox,QUOTE_STRING_MODE:sx,PHRASAL_WORDS_MODE:ax,COMMENT:Ms,C_LINE_COMMENT_MODE:lx,C_BLOCK_COMMENT_MODE:cx,HASH_COMMENT_MODE:ux,NUMBER_MODE:dx,C_NUMBER_MODE:fx,BINARY_NUMBER_MODE:px,REGEXP_MODE:hx,TITLE_MODE:mx,UNDERSCORE_TITLE_MODE:gx,METHOD_GUARD:bx,END_SAME_AS_BEGIN:yx});function Ex(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function wx(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className)}function vx(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=Ex,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function Sx(t,e){Array.isArray(t.illegal)&&(t.illegal=Uc(...t.illegal))}function xx(t,e){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function kx(t,e){t.relevance===void 0&&(t.relevance=1)}var Mx=(t,e)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");let n=Object.assign({},t);Object.keys(t).forEach(r=>{delete t[r]}),t.keywords=n.keywords,t.begin=lr(n.beforeMatch,lm(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},Nx=["of","and","for","in","not","or","if","then","parent","list","value"],Tx="keyword";function hm(t,e,n=Tx){let r=Object.create(null);return typeof t=="string"?i(n,t.split(" ")):Array.isArray(t)?i(n,t):Object.keys(t).forEach(function(o){Object.assign(r,hm(t[o],e,o))}),r;function i(o,s){e&&(s=s.map(a=>a.toLowerCase())),s.forEach(function(a){let l=a.split("|");r[l[0]]=[o,_x(l[0],l[1])]})}}function _x(t,e){return e?Number(e):Cx(t)?0:1}function Cx(t){return Nx.includes(t.toLowerCase())}var tm={},ar=t=>{console.error(t)},nm=(t,...e)=>{console.log(`WARN: ${t}`,...e)},Gr=(t,e)=>{tm[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),tm[`${t}/${e}`]=!0)},ks=new Error;function mm(t,e,{key:n}){let r=0,i=t[n],o={},s={};for(let a=1;a<=e.length;a++)s[a+r]=i[a],o[a+r]=!0,r+=cm(e[a-1]);t[n]=s,t[n]._emit=o,t[n]._multi=!0}function Ox(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw ar("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ks;if(typeof t.beginScope!="object"||t.beginScope===null)throw ar("beginScope must be object"),ks;mm(t,t.begin,{key:"beginScope"}),t.begin=Kc(t.begin,{joinWith:""})}}function Ax(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw ar("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ks;if(typeof t.endScope!="object"||t.endScope===null)throw ar("endScope must be object"),ks;mm(t,t.end,{key:"endScope"}),t.end=Kc(t.end,{joinWith:""})}}function Rx(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function Ix(t){Rx(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),Ox(t),Ax(t)}function Dx(t){function e(s,a){return new RegExp(Ii(s),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(a?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(a,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,a]),this.matchAt+=cm(a)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let a=this.regexes.map(l=>l[1]);this.matcherRe=e(Kc(a,{joinWith:"|"}),!0),this.lastIndex=0}exec(a){this.matcherRe.lastIndex=this.lastIndex;let l=this.matcherRe.exec(a);if(!l)return null;let c=l.findIndex((d,f)=>f>0&&d!==void 0),u=this.matchIndexes[c];return l.splice(0,c),Object.assign(l,u)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(a){if(this.multiRegexes[a])return this.multiRegexes[a];let l=new n;return this.rules.slice(a).forEach(([c,u])=>l.addRule(c,u)),l.compile(),this.multiRegexes[a]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(a,l){this.rules.push([a,l]),l.type==="begin"&&this.count++}exec(a){let l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let c=l.exec(a);if(this.resumingScanAtSamePosition()&&!(c&&c.index===this.lastIndex)){let u=this.getMatcher(0);u.lastIndex=this.lastIndex+1,c=u.exec(a)}return c&&(this.regexIndex+=c.position+1,this.regexIndex===this.count&&this.considerAll()),c}}function i(s){let a=new r;return s.contains.forEach(l=>a.addRule(l.begin,{rule:l,type:"begin"})),s.terminatorEnd&&a.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&a.addRule(s.illegal,{type:"illegal"}),a}function o(s,a){let l=s;if(s.isCompiled)return l;[wx,xx,Ix,Mx].forEach(u=>u(s,a)),t.compilerExtensions.forEach(u=>u(s,a)),s.__beforeBegin=null,[vx,Sx,kx].forEach(u=>u(s,a)),s.isCompiled=!0;let c=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),c=s.keywords.$pattern,delete s.keywords.$pattern),c=c||/\w+/,s.keywords&&(s.keywords=hm(s.keywords,t.case_insensitive)),l.keywordPatternRe=e(c,!0),a&&(s.begin||(s.begin=/\B|\b/),l.beginRe=e(l.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(l.endRe=e(l.end)),l.terminatorEnd=Ii(l.end)||"",s.endsWithParent&&a.terminatorEnd&&(l.terminatorEnd+=(s.end?"|":"")+a.terminatorEnd)),s.illegal&&(l.illegalRe=e(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(u){return Lx(u==="self"?s:u)})),s.contains.forEach(function(u){o(u,l)}),s.starts&&o(s.starts,a),l.matcher=i(l),l}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=On(t.classNameAliases||{}),o(t)}function gm(t){return t?t.endsWithParent||gm(t.starts):!1}function Lx(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return On(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:gm(t)?On(t,{starts:t.starts?On(t.starts):null}):Object.isFrozen(t)?On(t):t}var Px="11.6.0",Hc=class extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}},Lc=am,rm=On,im=Symbol("nomatch"),Bx=7,Fx=function(t){let e=Object.create(null),n=Object.create(null),r=[],i=!0,o="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]},a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Fc};function l(N){return a.noHighlightRe.test(N)}function c(N){let E=N.className+" ";E+=N.parentNode?N.parentNode.className:"";let v=a.languageDetectRe.exec(E);if(v){let C=O(v[1]);return C||(nm(o.replace("{}",v[1])),nm("Falling back to no-highlight mode for this block.",N)),C?v[1]:"no-highlight"}return E.split(/\s+/).find(C=>l(C)||O(C))}function u(N,E,v){let C="",P="";typeof E=="object"?(C=N,v=E.ignoreIllegals,P=E.language):(Gr("10.7.0","highlight(lang, code, ...args) has been deprecated."),Gr("10.7.0",`Please use highlight(code, options) instead. +https://github.com/highlightjs/highlight.js/issues/2277`),P=N,C=E),v===void 0&&(v=!0);let j={code:C,language:P};re("before:highlight",j);let Q=j.result?j.result:d(j.language,j.code,v);return Q.code=j.code,re("after:highlight",Q),Q}function d(N,E,v,C){let P=Object.create(null);function j(L,z){return L.keywords[z]}function Q(){if(!X.keywords){H.addText(le);return}let L=0;X.keywordPatternRe.lastIndex=0;let z=X.keywordPatternRe.exec(le),k="";for(;z;){k+=le.substring(L,z.index);let A=He.case_insensitive?z[0].toLowerCase():z[0],G=j(X,A);if(G){let[oe,Re]=G;if(H.addText(k),k="",P[A]=(P[A]||0)+1,P[A]<=Bx&&(ye+=Re),oe.startsWith("_"))k+=z[0];else{let Et=He.classNameAliases[oe]||oe;H.addKeyword(z[0],Et)}}else k+=z[0];L=X.keywordPatternRe.lastIndex,z=X.keywordPatternRe.exec(le)}k+=le.substring(L),H.addText(k)}function pe(){if(le==="")return;let L=null;if(typeof X.subLanguage=="string"){if(!e[X.subLanguage]){H.addText(le);return}L=d(X.subLanguage,le,!0,Rt[X.subLanguage]),Rt[X.subLanguage]=L._top}else L=p(le,X.subLanguage.length?X.subLanguage:null);X.relevance>0&&(ye+=L.relevance),H.addSublanguage(L._emitter,L.language)}function be(){X.subLanguage!=null?pe():Q(),le=""}function ue(L,z){let k=1,A=z.length-1;for(;k<=A;){if(!L._emit[k]){k++;continue}let G=He.classNameAliases[L[k]]||L[k],oe=z[k];G?H.addKeyword(oe,G):(le=oe,Q(),le=""),k++}}function xe(L,z){return L.scope&&typeof L.scope=="string"&&H.openNode(He.classNameAliases[L.scope]||L.scope),L.beginScope&&(L.beginScope._wrap?(H.addKeyword(le,He.classNameAliases[L.beginScope._wrap]||L.beginScope._wrap),le=""):L.beginScope._multi&&(ue(L.beginScope,z),le="")),X=Object.create(L,{parent:{value:X}}),X}function ft(L,z,k){let A=ex(L.endRe,k);if(A){if(L["on:end"]){let G=new xs(L);L["on:end"](z,G),G.isMatchIgnored&&(A=!1)}if(A){for(;L.endsParent&&L.parent;)L=L.parent;return L}}if(L.endsWithParent)return ft(L.parent,z,k)}function Ye(L){return X.matcher.regexIndex===0?(le+=L[0],1):(Ve=!0,0)}function de(L){let z=L[0],k=L.rule,A=new xs(k),G=[k.__beforeBegin,k["on:begin"]];for(let oe of G)if(oe&&(oe(L,A),A.isMatchIgnored))return Ye(z);return k.skip?le+=z:(k.excludeBegin&&(le+=z),be(),!k.returnBegin&&!k.excludeBegin&&(le=z)),xe(k,L),k.returnBegin?0:z.length}function rt(L){let z=L[0],k=E.substring(L.index),A=ft(X,L,k);if(!A)return im;let G=X;X.endScope&&X.endScope._wrap?(be(),H.addKeyword(z,X.endScope._wrap)):X.endScope&&X.endScope._multi?(be(),ue(X.endScope,L)):G.skip?le+=z:(G.returnEnd||G.excludeEnd||(le+=z),be(),G.excludeEnd&&(le=z));do X.scope&&H.closeNode(),!X.skip&&!X.subLanguage&&(ye+=X.relevance),X=X.parent;while(X!==A.parent);return A.starts&&xe(A.starts,L),G.returnEnd?0:z.length}function bt(){let L=[];for(let z=X;z!==He;z=z.parent)z.scope&&L.unshift(z.scope);L.forEach(z=>H.openNode(z))}let yt={};function Kt(L,z){let k=z&&z[0];if(le+=L,k==null)return be(),0;if(yt.type==="begin"&&z.type==="end"&&yt.index===z.index&&k===""){if(le+=E.slice(z.index,z.index+1),!i){let A=new Error(`0 width match regex (${N})`);throw A.languageName=N,A.badRule=yt.rule,A}return 1}if(yt=z,z.type==="begin")return de(z);if(z.type==="illegal"&&!v){let A=new Error('Illegal lexeme "'+k+'" for mode "'+(X.scope||"")+'"');throw A.mode=X,A}else if(z.type==="end"){let A=rt(z);if(A!==im)return A}if(z.type==="illegal"&&k==="")return 1;if(Je>1e5&&Je>z.index*3)throw new Error("potential infinite loop, way more iterations than matches");return le+=k,k.length}let He=O(N);if(!He)throw ar(o.replace("{}",N)),new Error('Unknown language: "'+N+'"');let en=Dx(He),Ae="",X=C||en,Rt={},H=new a.__emitter(a);bt();let le="",ye=0,ae=0,Je=0,Ve=!1;try{for(X.matcher.considerAll();;){Je++,Ve?Ve=!1:X.matcher.considerAll(),X.matcher.lastIndex=ae;let L=X.matcher.exec(E);if(!L)break;let z=E.substring(ae,L.index),k=Kt(z,L);ae=L.index+k}return Kt(E.substring(ae)),H.closeAllNodes(),H.finalize(),Ae=H.toHTML(),{language:N,value:Ae,relevance:ye,illegal:!1,_emitter:H,_top:X}}catch(L){if(L.message&&L.message.includes("Illegal"))return{language:N,value:Lc(E),illegal:!0,relevance:0,_illegalBy:{message:L.message,index:ae,context:E.slice(ae-100,ae+100),mode:L.mode,resultSoFar:Ae},_emitter:H};if(i)return{language:N,value:Lc(E),illegal:!1,relevance:0,errorRaised:L,_emitter:H,_top:X};throw L}}function f(N){let E={value:Lc(N),illegal:!1,relevance:0,_top:s,_emitter:new a.__emitter(a)};return E._emitter.addText(N),E}function p(N,E){E=E||a.languages||Object.keys(e);let v=f(N),C=E.filter(O).filter(ne).map(be=>d(be,N,!1));C.unshift(v);let P=C.sort((be,ue)=>{if(be.relevance!==ue.relevance)return ue.relevance-be.relevance;if(be.language&&ue.language){if(O(be.language).supersetOf===ue.language)return 1;if(O(ue.language).supersetOf===be.language)return-1}return 0}),[j,Q]=P,pe=j;return pe.secondBest=Q,pe}function h(N,E,v){let C=E&&n[E]||v;N.classList.add("hljs"),N.classList.add(`language-${C}`)}function g(N){let E=null,v=c(N);if(l(v))return;if(re("before:highlightElement",{el:N,language:v}),N.children.length>0&&(a.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(N)),a.throwUnescapedHTML))throw new Hc("One of your code blocks includes unescaped HTML.",N.innerHTML);E=N;let C=E.textContent,P=v?u(C,{language:v,ignoreIllegals:!0}):p(C);N.innerHTML=P.value,h(N,v,P.language),N.result={language:P.language,re:P.relevance,relevance:P.relevance},P.secondBest&&(N.secondBest={language:P.secondBest.language,relevance:P.secondBest.relevance}),re("after:highlightElement",{el:N,result:P,text:C})}function m(N){a=rm(a,N)}let y=()=>{b(),Gr("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function M(){b(),Gr("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let x=!1;function b(){if(document.readyState==="loading"){x=!0;return}document.querySelectorAll(a.cssSelector).forEach(g)}function _(){x&&b()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",_,!1);function w(N,E){let v=null;try{v=E(t)}catch(C){if(ar("Language definition for '{}' could not be registered.".replace("{}",N)),i)ar(C);else throw C;v=s}v.name||(v.name=N),e[N]=v,v.rawDefinition=E.bind(null,t),v.aliases&&J(v.aliases,{languageName:N})}function I(N){delete e[N];for(let E of Object.keys(n))n[E]===N&&delete n[E]}function U(){return Object.keys(e)}function O(N){return N=(N||"").toLowerCase(),e[N]||e[n[N]]}function J(N,{languageName:E}){typeof N=="string"&&(N=[N]),N.forEach(v=>{n[v.toLowerCase()]=E})}function ne(N){let E=O(N);return E&&!E.disableAutodetect}function ie(N){N["before:highlightBlock"]&&!N["before:highlightElement"]&&(N["before:highlightElement"]=E=>{N["before:highlightBlock"](Object.assign({block:E.el},E))}),N["after:highlightBlock"]&&!N["after:highlightElement"]&&(N["after:highlightElement"]=E=>{N["after:highlightBlock"](Object.assign({block:E.el},E))})}function Z(N){ie(N),r.push(N)}function re(N,E){let v=N;r.forEach(function(C){C[v]&&C[v](E)})}function ce(N){return Gr("10.7.0","highlightBlock will be removed entirely in v12.0"),Gr("10.7.0","Please use highlightElement now."),g(N)}Object.assign(t,{highlight:u,highlightAuto:p,highlightAll:b,highlightElement:g,highlightBlock:ce,configure:m,initHighlighting:y,initHighlightingOnLoad:M,registerLanguage:w,unregisterLanguage:I,listLanguages:U,getLanguage:O,registerAliases:J,autoDetection:ne,inherit:rm,addPlugin:Z}),t.debugMode=function(){i=!1},t.safeMode=function(){i=!0},t.versionString=Px,t.regex={concat:lr,lookahead:lm,either:Uc,optional:ZS,anyNumberOfTimes:XS};for(let N in Ss)typeof Ss[N]=="object"&&zc.exports(Ss[N]);return Object.assign(t,Ss),t},Li=Fx({}),Hx=Li;Li.HighlightJS=Li;Li.default=Li;var zx=Hx;function bm(t,e=[]){return t.map(n=>{let r=[...e,...n.properties?n.properties.className:[]];return n.children?bm(n.children,r):{text:n.value,classes:r}}).flat()}function om(t){return t.value||t.children||[]}function $x(t){return!!zx.getLanguage(t)}function sm({doc:t,name:e,lowlight:n,defaultLanguage:r}){let i=[];return Qn(t,o=>o.type.name===e).forEach(o=>{let s=o.pos+1,a=o.node.attrs.language||r,l=n.listLanguages(),c=a&&(l.includes(a)||$x(a))?om(n.highlight(a,o.node.textContent)):om(n.highlightAuto(o.node.textContent));bm(c).forEach(u=>{let d=s+u.text.length;if(u.classes.length){let f=et.inline(s,d,{class:u.classes.join(" ")});i.push(f)}s=d})}),Ce.create(t,i)}function Ux(t){return typeof t=="function"}function Kx({name:t,lowlight:e,defaultLanguage:n}){if(!["highlight","highlightAuto","listLanguages"].every(i=>Ux(e[i])))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");let r=new ge({key:new ve("lowlight"),state:{init:(i,{doc:o})=>sm({doc:o,name:t,lowlight:e,defaultLanguage:n}),apply:(i,o,s,a)=>{let l=s.selection.$head.parent.type.name,c=a.selection.$head.parent.type.name,u=Qn(s.doc,f=>f.type.name===t),d=Qn(a.doc,f=>f.type.name===t);return i.docChanged&&([l,c].includes(t)||d.length!==u.length||i.steps.some(f=>f.from!==void 0&&f.to!==void 0&&u.some(p=>p.pos>=f.from&&p.pos+p.node.nodeSize<=f.to)))?sm({doc:i.doc,name:t,lowlight:e,defaultLanguage:n}):o.map(i.mapping,i.doc)}},props:{decorations(i){return r.getState(i)}}});return r}var ym=Zh.extend({addOptions(){var t;return{...(t=this.parent)===null||t===void 0?void 0:t.call(this),lowlight:{},defaultLanguage:null}},addProseMirrorPlugins(){var t;return[...((t=this.parent)===null||t===void 0?void 0:t.call(this))||[],Kx({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}});var Vc=ym.extend({addKeyboardShortcuts(){return{...this.parent?.(),ArrowDown:()=>{let t=this.editor.state,{from:e,to:n}=t.selection;if(e>1&&e===n){let r=!1;t.doc.nodesBetween(e-1,n-1,o=>{o.type.name==="codeBlock"&&(r=!0)});let i=!0;if(t.doc.nodesBetween(e+1,n+1,o=>{o&&(i=!1)}),r&&i)return this.editor.commands.setHardBreak()}return!1}}}});var Gc=$.create({name:"hurdle",group:"block",content:"block+",addOptions(){return{colors:["gray_light","gray","gray_dark","primary","secondary","tertiary","accent"],HTMLAttributes:{class:"filament-tiptap-hurdle"}}},addAttributes(){return{color:{default:"gray",parseHTML:t=>t.getAttribute("data-color"),renderHTML:t=>({"data-color":t.color})}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-hurdle")}]},renderHTML({node:t,HTMLAttributes:e}){return["div",B(this.options.HTMLAttributes,e),0]},addCommands(){return{setHurdle:t=>({commands:e})=>this.options.colors.includes(t.color)?e.toggleWrap(this.name,t):!1}}});var qc=Ne.create({name:"textAlign",addOptions(){return{types:[],alignments:["start","center","end","justify"],defaultAlignment:"start"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>t.style.textAlign||this.options.defaultAlignment,renderHTML:t=>t.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${t.textAlign}`}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.every(n=>e.updateAttributes(n,{textAlign:t})):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.every(e=>t.resetAttributes(e,"textAlign"))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("start"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("end"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}});var _e="top",Be="bottom",Le="right",Oe="left",Ns="auto",An=[_e,Be,Le,Oe],dn="start",cr="end",Em="clippingParents",Ts="viewport",qr="popper",wm="reference",jc=An.reduce(function(t,e){return t.concat([e+"-"+dn,e+"-"+cr])},[]),_s=[].concat(An,[Ns]).reduce(function(t,e){return t.concat([e,e+"-"+dn,e+"-"+cr])},[]),Wx="beforeRead",Vx="read",Gx="afterRead",qx="beforeMain",jx="main",Yx="afterMain",Jx="beforeWrite",Xx="write",Zx="afterWrite",vm=[Wx,Vx,Gx,qx,jx,Yx,Jx,Xx,Zx];function Ke(t){return t?(t.nodeName||"").toLowerCase():null}function ke(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function _t(t){var e=ke(t).Element;return t instanceof e||t instanceof Element}function Fe(t){var e=ke(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function jr(t){if(typeof ShadowRoot>"u")return!1;var e=ke(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Qx(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},o=e.elements[n];!Fe(o)||!Ke(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var a=i[s];a===!1?o.removeAttribute(s):o.setAttribute(s,a===!0?"":a)}))})}function ek(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),a=s.reduce(function(l,c){return l[c]="",l},{});!Fe(i)||!Ke(i)||(Object.assign(i.style,a),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}var Pi={name:"applyStyles",enabled:!0,phase:"write",fn:Qx,effect:ek,requires:["computeStyles"]};function We(t){return t.split("-")[0]}var Ht=Math.max,ur=Math.min,fn=Math.round;function Yr(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Bi(){return!/^((?!chrome|android).)*safari/i.test(Yr())}function Ct(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&Fe(t)&&(i=t.offsetWidth>0&&fn(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&fn(r.height)/t.offsetHeight||1);var s=_t(t)?ke(t):window,a=s.visualViewport,l=!Bi()&&n,c=(r.left+(l&&a?a.offsetLeft:0))/i,u=(r.top+(l&&a?a.offsetTop:0))/o,d=r.width/i,f=r.height/o;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c,x:c,y:u}}function dr(t){var e=Ct(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function Fi(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&jr(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function dt(t){return ke(t).getComputedStyle(t)}function Yc(t){return["table","td","th"].indexOf(Ke(t))>=0}function je(t){return((_t(t)?t.ownerDocument:t.document)||window.document).documentElement}function pn(t){return Ke(t)==="html"?t:t.assignedSlot||t.parentNode||(jr(t)?t.host:null)||je(t)}function Sm(t){return!Fe(t)||dt(t).position==="fixed"?null:t.offsetParent}function tk(t){var e=/firefox/i.test(Yr()),n=/Trident/i.test(Yr());if(n&&Fe(t)){var r=dt(t);if(r.position==="fixed")return null}var i=pn(t);for(jr(i)&&(i=i.host);Fe(i)&&["html","body"].indexOf(Ke(i))<0;){var o=dt(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function zt(t){for(var e=ke(t),n=Sm(t);n&&Yc(n)&&dt(n).position==="static";)n=Sm(n);return n&&(Ke(n)==="html"||Ke(n)==="body"&&dt(n).position==="static")?e:n||tk(t)||e}function fr(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function pr(t,e,n){return Ht(t,ur(e,n))}function xm(t,e,n){var r=pr(t,e,n);return r>n?n:r}function Hi(){return{top:0,right:0,bottom:0,left:0}}function zi(t){return Object.assign({},Hi(),t)}function $i(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var nk=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,zi(typeof e!="number"?e:$i(e,An))};function rk(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=We(n.placement),l=fr(a),c=[Oe,Le].indexOf(a)>=0,u=c?"height":"width";if(!(!o||!s)){var d=nk(i.padding,n),f=dr(o),p=l==="y"?_e:Oe,h=l==="y"?Be:Le,g=n.rects.reference[u]+n.rects.reference[l]-s[l]-n.rects.popper[u],m=s[l]-n.rects.reference[l],y=zt(o),M=y?l==="y"?y.clientHeight||0:y.clientWidth||0:0,x=g/2-m/2,b=d[p],_=M-f[u]-d[h],w=M/2-f[u]/2+x,I=pr(b,w,_),U=l;n.modifiersData[r]=(e={},e[U]=I,e.centerOffset=I-w,e)}}function ik(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||Fi(e.elements.popper,i)&&(e.elements.arrow=i))}var km={name:"arrow",enabled:!0,phase:"main",fn:rk,effect:ik,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ot(t){return t.split("-")[1]}var ok={top:"auto",right:"auto",bottom:"auto",left:"auto"};function sk(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:fn(n*i)/i||0,y:fn(r*i)/i||0}}function Mm(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,s=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,d=t.isFixed,f=s.x,p=f===void 0?0:f,h=s.y,g=h===void 0?0:h,m=typeof u=="function"?u({x:p,y:g}):{x:p,y:g};p=m.x,g=m.y;var y=s.hasOwnProperty("x"),M=s.hasOwnProperty("y"),x=Oe,b=_e,_=window;if(c){var w=zt(n),I="clientHeight",U="clientWidth";if(w===ke(n)&&(w=je(n),dt(w).position!=="static"&&a==="absolute"&&(I="scrollHeight",U="scrollWidth")),w=w,i===_e||(i===Oe||i===Le)&&o===cr){b=Be;var O=d&&w===_&&_.visualViewport?_.visualViewport.height:w[I];g-=O-r.height,g*=l?1:-1}if(i===Oe||(i===_e||i===Be)&&o===cr){x=Le;var J=d&&w===_&&_.visualViewport?_.visualViewport.width:w[U];p-=J-r.width,p*=l?1:-1}}var ne=Object.assign({position:a},c&&ok),ie=u===!0?sk({x:p,y:g},ke(n)):{x:p,y:g};if(p=ie.x,g=ie.y,l){var Z;return Object.assign({},ne,(Z={},Z[b]=M?"0":"",Z[x]=y?"0":"",Z.transform=(_.devicePixelRatio||1)<=1?"translate("+p+"px, "+g+"px)":"translate3d("+p+"px, "+g+"px, 0)",Z))}return Object.assign({},ne,(e={},e[b]=M?g+"px":"",e[x]=y?p+"px":"",e.transform="",e))}function ak(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,a=n.roundOffsets,l=a===void 0?!0:a,c={placement:We(e.placement),variation:Ot(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Mm(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Mm(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var Nm={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:ak,data:{}};var Cs={passive:!0};function lk(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,a=s===void 0?!0:s,l=ke(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach(function(u){u.addEventListener("scroll",n.update,Cs)}),a&&l.addEventListener("resize",n.update,Cs),function(){o&&c.forEach(function(u){u.removeEventListener("scroll",n.update,Cs)}),a&&l.removeEventListener("resize",n.update,Cs)}}var Tm={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:lk,data:{}};var ck={left:"right",right:"left",bottom:"top",top:"bottom"};function Jr(t){return t.replace(/left|right|bottom|top/g,function(e){return ck[e]})}var uk={start:"end",end:"start"};function Os(t){return t.replace(/start|end/g,function(e){return uk[e]})}function hr(t){var e=ke(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function mr(t){return Ct(je(t)).left+hr(t).scrollLeft}function Jc(t,e){var n=ke(t),r=je(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;var c=Bi();(c||!c&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a+mr(t),y:l}}function Xc(t){var e,n=je(t),r=hr(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=Ht(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Ht(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+mr(t),l=-r.scrollTop;return dt(i||n).direction==="rtl"&&(a+=Ht(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}function gr(t){var e=dt(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function As(t){return["html","body","#document"].indexOf(Ke(t))>=0?t.ownerDocument.body:Fe(t)&&gr(t)?t:As(pn(t))}function Rn(t,e){var n;e===void 0&&(e=[]);var r=As(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=ke(r),s=i?[o].concat(o.visualViewport||[],gr(r)?r:[]):r,a=e.concat(s);return i?a:a.concat(Rn(pn(s)))}function Xr(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function dk(t,e){var n=Ct(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function _m(t,e,n){return e===Ts?Xr(Jc(t,n)):_t(e)?dk(e,n):Xr(Xc(je(t)))}function fk(t){var e=Rn(pn(t)),n=["absolute","fixed"].indexOf(dt(t).position)>=0,r=n&&Fe(t)?zt(t):t;return _t(r)?e.filter(function(i){return _t(i)&&Fi(i,r)&&Ke(i)!=="body"}):[]}function Zc(t,e,n,r){var i=e==="clippingParents"?fk(t):[].concat(e),o=[].concat(i,[n]),s=o[0],a=o.reduce(function(l,c){var u=_m(t,c,r);return l.top=Ht(u.top,l.top),l.right=ur(u.right,l.right),l.bottom=ur(u.bottom,l.bottom),l.left=Ht(u.left,l.left),l},_m(t,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Ui(t){var e=t.reference,n=t.element,r=t.placement,i=r?We(r):null,o=r?Ot(r):null,s=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,l;switch(i){case _e:l={x:s,y:e.y-n.height};break;case Be:l={x:s,y:e.y+e.height};break;case Le:l={x:e.x+e.width,y:a};break;case Oe:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var c=i?fr(i):null;if(c!=null){var u=c==="y"?"height":"width";switch(o){case dn:l[c]=l[c]-(e[u]/2-n[u]/2);break;case cr:l[c]=l[c]+(e[u]/2-n[u]/2);break;default:}}return l}function $t(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,s=o===void 0?t.strategy:o,a=n.boundary,l=a===void 0?Em:a,c=n.rootBoundary,u=c===void 0?Ts:c,d=n.elementContext,f=d===void 0?qr:d,p=n.altBoundary,h=p===void 0?!1:p,g=n.padding,m=g===void 0?0:g,y=zi(typeof m!="number"?m:$i(m,An)),M=f===qr?wm:qr,x=t.rects.popper,b=t.elements[h?M:f],_=Zc(_t(b)?b:b.contextElement||je(t.elements.popper),l,u,s),w=Ct(t.elements.reference),I=Ui({reference:w,element:x,strategy:"absolute",placement:i}),U=Xr(Object.assign({},x,I)),O=f===qr?U:w,J={top:_.top-O.top+y.top,bottom:O.bottom-_.bottom+y.bottom,left:_.left-O.left+y.left,right:O.right-_.right+y.right},ne=t.modifiersData.offset;if(f===qr&&ne){var ie=ne[i];Object.keys(J).forEach(function(Z){var re=[Le,Be].indexOf(Z)>=0?1:-1,ce=[_e,Be].indexOf(Z)>=0?"y":"x";J[Z]+=ie[ce]*re})}return J}function Qc(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?_s:l,u=Ot(r),d=u?a?jc:jc.filter(function(h){return Ot(h)===u}):An,f=d.filter(function(h){return c.indexOf(h)>=0});f.length===0&&(f=d);var p=f.reduce(function(h,g){return h[g]=$t(t,{placement:g,boundary:i,rootBoundary:o,padding:s})[We(g)],h},{});return Object.keys(p).sort(function(h,g){return p[h]-p[g]})}function pk(t){if(We(t)===Ns)return[];var e=Jr(t);return[Os(t),e,Os(e)]}function hk(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!0:s,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,h=p===void 0?!0:p,g=n.allowedAutoPlacements,m=e.options.placement,y=We(m),M=y===m,x=l||(M||!h?[Jr(m)]:pk(m)),b=[m].concat(x).reduce(function(be,ue){return be.concat(We(ue)===Ns?Qc(e,{placement:ue,boundary:u,rootBoundary:d,padding:c,flipVariations:h,allowedAutoPlacements:g}):ue)},[]),_=e.rects.reference,w=e.rects.popper,I=new Map,U=!0,O=b[0],J=0;J=0,ce=re?"width":"height",N=$t(e,{placement:ne,boundary:u,rootBoundary:d,altBoundary:f,padding:c}),E=re?Z?Le:Oe:Z?Be:_e;_[ce]>w[ce]&&(E=Jr(E));var v=Jr(E),C=[];if(o&&C.push(N[ie]<=0),a&&C.push(N[E]<=0,N[v]<=0),C.every(function(be){return be})){O=ne,U=!1;break}I.set(ne,C)}if(U)for(var P=h?3:1,j=function(ue){var xe=b.find(function(ft){var Ye=I.get(ft);if(Ye)return Ye.slice(0,ue).every(function(de){return de})});if(xe)return O=xe,"break"},Q=P;Q>0;Q--){var pe=j(Q);if(pe==="break")break}e.placement!==O&&(e.modifiersData[r]._skip=!0,e.placement=O,e.reset=!0)}}var Cm={name:"flip",enabled:!0,phase:"main",fn:hk,requiresIfExists:["offset"],data:{_skip:!1}};function Om(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Am(t){return[_e,Le,Be,Oe].some(function(e){return t[e]>=0})}function mk(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=$t(e,{elementContext:"reference"}),a=$t(e,{altBoundary:!0}),l=Om(s,r),c=Om(a,i,o),u=Am(l),d=Am(c);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}var Rm={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:mk};function gk(t,e,n){var r=We(t),i=[Oe,_e].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[Oe,Le].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function bk(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=_s.reduce(function(u,d){return u[d]=gk(d,e.rects,o),u},{}),a=s[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=s}var Im={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:bk};function yk(t){var e=t.state,n=t.name;e.modifiersData[n]=Ui({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var Dm={name:"popperOffsets",enabled:!0,phase:"read",fn:yk,data:{}};function eu(t){return t==="x"?"y":"x"}function Ek(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!1:s,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,f=n.tether,p=f===void 0?!0:f,h=n.tetherOffset,g=h===void 0?0:h,m=$t(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),y=We(e.placement),M=Ot(e.placement),x=!M,b=fr(y),_=eu(b),w=e.modifiersData.popperOffsets,I=e.rects.reference,U=e.rects.popper,O=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,J=typeof O=="number"?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),ne=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,ie={x:0,y:0};if(w){if(o){var Z,re=b==="y"?_e:Oe,ce=b==="y"?Be:Le,N=b==="y"?"height":"width",E=w[b],v=E+m[re],C=E-m[ce],P=p?-U[N]/2:0,j=M===dn?I[N]:U[N],Q=M===dn?-U[N]:-I[N],pe=e.elements.arrow,be=p&&pe?dr(pe):{width:0,height:0},ue=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Hi(),xe=ue[re],ft=ue[ce],Ye=pr(0,I[N],be[N]),de=x?I[N]/2-P-Ye-xe-J.mainAxis:j-Ye-xe-J.mainAxis,rt=x?-I[N]/2+P+Ye+ft+J.mainAxis:Q+Ye+ft+J.mainAxis,bt=e.elements.arrow&&zt(e.elements.arrow),yt=bt?b==="y"?bt.clientTop||0:bt.clientLeft||0:0,Kt=(Z=ne?.[b])!=null?Z:0,He=E+de-Kt-yt,en=E+rt-Kt,Ae=pr(p?ur(v,He):v,E,p?Ht(C,en):C);w[b]=Ae,ie[b]=Ae-E}if(a){var X,Rt=b==="x"?_e:Oe,H=b==="x"?Be:Le,le=w[_],ye=_==="y"?"height":"width",ae=le+m[Rt],Je=le-m[H],Ve=[_e,Oe].indexOf(y)!==-1,L=(X=ne?.[_])!=null?X:0,z=Ve?ae:le-I[ye]-U[ye]-L+J.altAxis,k=Ve?le+I[ye]+U[ye]-L-J.altAxis:Je,A=p&&Ve?xm(z,le,k):pr(p?z:ae,le,p?k:Je);w[_]=A,ie[_]=A-le}e.modifiersData[r]=ie}}var Lm={name:"preventOverflow",enabled:!0,phase:"main",fn:Ek,requiresIfExists:["offset"]};function tu(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function nu(t){return t===ke(t)||!Fe(t)?hr(t):tu(t)}function wk(t){var e=t.getBoundingClientRect(),n=fn(e.width)/t.offsetWidth||1,r=fn(e.height)/t.offsetHeight||1;return n!==1||r!==1}function ru(t,e,n){n===void 0&&(n=!1);var r=Fe(e),i=Fe(e)&&wk(e),o=je(e),s=Ct(t,i,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((Ke(e)!=="body"||gr(o))&&(a=nu(e)),Fe(e)?(l=Ct(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):o&&(l.x=mr(o))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function vk(t){var e=new Map,n=new Set,r=[];t.forEach(function(o){e.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&i(l)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function iu(t){var e=vk(t);return vm.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function ou(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function su(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var Pm={placement:"bottom",modifiers:[],strategy:"absolute"};function Bm(){for(var t=arguments.length,e=new Array(t),n=0;n-1}function Zm(t,e){return typeof t=="function"?t.apply(void 0,e):t}function Hm(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function Mk(t){return t.split(/\s+/).filter(Boolean)}function Zr(t){return[].concat(t)}function zm(t,e){t.indexOf(e)===-1&&t.push(e)}function Nk(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function Tk(t){return t.split("-")[0]}function Is(t){return[].slice.call(t)}function $m(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function Ki(){return document.createElement("div")}function Ds(t){return["Element","Fragment"].some(function(e){return hu(t,e)})}function _k(t){return hu(t,"NodeList")}function Ck(t){return hu(t,"MouseEvent")}function Ok(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function Ak(t){return Ds(t)?[t]:_k(t)?Is(t):Array.isArray(t)?t:Is(document.querySelectorAll(t))}function cu(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function Um(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function Rk(t){var e,n=Zr(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function Ik(t,e){var n=e.clientX,r=e.clientY;return t.every(function(i){var o=i.popperRect,s=i.popperState,a=i.props,l=a.interactiveBorder,c=Tk(s.placement),u=s.modifiersData.offset;if(!u)return!0;var d=c==="bottom"?u.top.y:0,f=c==="top"?u.bottom.y:0,p=c==="right"?u.left.x:0,h=c==="left"?u.right.x:0,g=o.top-r+d>l,m=r-o.bottom-f>l,y=o.left-n+p>l,M=n-o.right-h>l;return g||m||y||M})}function uu(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function Km(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var Qt={isTouch:!1},Wm=0;function Dk(){Qt.isTouch||(Qt.isTouch=!0,window.performance&&document.addEventListener("mousemove",Qm))}function Qm(){var t=performance.now();t-Wm<20&&(Qt.isTouch=!1,document.removeEventListener("mousemove",Qm)),Wm=t}function Lk(){var t=document.activeElement;if(Ok(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function Pk(){document.addEventListener("touchstart",Dk,br),window.addEventListener("blur",Lk)}var Bk=typeof window<"u"&&typeof document<"u",Fk=Bk?!!window.msCrypto:!1;var Hk={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},zk={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Ut=Object.assign({appendTo:Xm,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Hk,zk),$k=Object.keys(Ut),Uk=function(e){var n=Object.keys(e);n.forEach(function(r){Ut[r]=e[r]})};function eg(t){var e=t.plugins||[],n=e.reduce(function(r,i){var o=i.name,s=i.defaultValue;if(o){var a;r[o]=t[o]!==void 0?t[o]:(a=Ut[o])!=null?a:s}return r},{});return Object.assign({},t,n)}function Kk(t,e){var n=e?Object.keys(eg(Object.assign({},Ut,{plugins:e}))):$k,r=n.reduce(function(i,o){var s=(t.getAttribute("data-tippy-"+o)||"").trim();if(!s)return i;if(o==="content")i[o]=s;else try{i[o]=JSON.parse(s)}catch{i[o]=s}return i},{});return r}function Vm(t,e){var n=Object.assign({},e,{content:Zm(e.content,[t])},e.ignoreAttributes?{}:Kk(t,e.plugins));return n.aria=Object.assign({},Ut.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?e.interactive:n.aria.expanded,content:n.aria.content==="auto"?e.interactive?null:"describedby":n.aria.content},n}var Wk=function(){return"innerHTML"};function fu(t,e){t[Wk()]=e}function Gm(t){var e=Ki();return t===!0?e.className=Ym:(e.className=Jm,Ds(t)?e.appendChild(t):fu(e,t)),e}function qm(t,e){Ds(e.content)?(fu(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?fu(t,e.content):t.textContent=e.content)}function pu(t){var e=t.firstElementChild,n=Is(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(jm)}),arrow:n.find(function(r){return r.classList.contains(Ym)||r.classList.contains(Jm)}),backdrop:n.find(function(r){return r.classList.contains(kk)})}}function tg(t){var e=Ki(),n=Ki();n.className=xk,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Ki();r.className=jm,r.setAttribute("data-state","hidden"),qm(r,t.props),e.appendChild(n),n.appendChild(r),i(t.props,t.props);function i(o,s){var a=pu(e),l=a.box,c=a.content,u=a.arrow;s.theme?l.setAttribute("data-theme",s.theme):l.removeAttribute("data-theme"),typeof s.animation=="string"?l.setAttribute("data-animation",s.animation):l.removeAttribute("data-animation"),s.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?l.setAttribute("role",s.role):l.removeAttribute("role"),(o.content!==s.content||o.allowHTML!==s.allowHTML)&&qm(c,t.props),s.arrow?u?o.arrow!==s.arrow&&(l.removeChild(u),l.appendChild(Gm(s.arrow))):l.appendChild(Gm(s.arrow)):u&&l.removeChild(u)}return{popper:e,onUpdate:i}}tg.$$tippy=!0;var Vk=1,Rs=[],du=[];function Gk(t,e){var n=Vm(t,Object.assign({},Ut,eg($m(e)))),r,i,o,s=!1,a=!1,l=!1,c=!1,u,d,f,p=[],h=Hm(He,n.interactiveDebounce),g,m=Vk++,y=null,M=Nk(n.plugins),x={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},b={id:m,reference:t,popper:Ki(),popperInstance:y,props:n,state:x,plugins:M,clearDelayTimeouts:z,setProps:k,setContent:A,show:G,hide:oe,hideWithInteractivity:Re,enable:Ve,disable:L,unmount:Et,destroy:ra};if(!n.render)return b;var _=n.render(b),w=_.popper,I=_.onUpdate;w.setAttribute("data-tippy-root",""),w.id="tippy-"+b.id,b.popper=w,t._tippy=b,w._tippy=b;var U=M.map(function(S){return S.fn(b)}),O=t.hasAttribute("aria-expanded");return bt(),P(),E(),v("onCreate",[b]),n.showOnCreate&&ae(),w.addEventListener("mouseenter",function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()}),w.addEventListener("mouseleave",function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&re().addEventListener("mousemove",h)}),b;function J(){var S=b.props.touch;return Array.isArray(S)?S:[S,0]}function ne(){return J()[0]==="hold"}function ie(){var S;return!!((S=b.props.render)!=null&&S.$$tippy)}function Z(){return g||t}function re(){var S=Z().parentNode;return S?Rk(S):document}function ce(){return pu(w)}function N(S){return b.state.isMounted&&!b.state.isVisible||Qt.isTouch||u&&u.type==="focus"?0:lu(b.props.delay,S?0:1,Ut.delay)}function E(S){S===void 0&&(S=!1),w.style.pointerEvents=b.props.interactive&&!S?"":"none",w.style.zIndex=""+b.props.zIndex}function v(S,W,te){if(te===void 0&&(te=!0),U.forEach(function(he){he[S]&&he[S].apply(he,W)}),te){var Ee;(Ee=b.props)[S].apply(Ee,W)}}function C(){var S=b.props.aria;if(S.content){var W="aria-"+S.content,te=w.id,Ee=Zr(b.props.triggerTarget||t);Ee.forEach(function(he){var it=he.getAttribute(W);if(b.state.isVisible)he.setAttribute(W,it?it+" "+te:te);else{var vt=it&&it.replace(te,"").trim();vt?he.setAttribute(W,vt):he.removeAttribute(W)}})}}function P(){if(!(O||!b.props.aria.expanded)){var S=Zr(b.props.triggerTarget||t);S.forEach(function(W){b.props.interactive?W.setAttribute("aria-expanded",b.state.isVisible&&W===Z()?"true":"false"):W.removeAttribute("aria-expanded")})}}function j(){re().removeEventListener("mousemove",h),Rs=Rs.filter(function(S){return S!==h})}function Q(S){if(!(Qt.isTouch&&(l||S.type==="mousedown"))){var W=S.composedPath&&S.composedPath()[0]||S.target;if(!(b.props.interactive&&Km(w,W))){if(Zr(b.props.triggerTarget||t).some(function(te){return Km(te,W)})){if(Qt.isTouch||b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else v("onClickOutside",[b,S]);b.props.hideOnClick===!0&&(b.clearDelayTimeouts(),b.hide(),a=!0,setTimeout(function(){a=!1}),b.state.isMounted||xe())}}}function pe(){l=!0}function be(){l=!1}function ue(){var S=re();S.addEventListener("mousedown",Q,!0),S.addEventListener("touchend",Q,br),S.addEventListener("touchstart",be,br),S.addEventListener("touchmove",pe,br)}function xe(){var S=re();S.removeEventListener("mousedown",Q,!0),S.removeEventListener("touchend",Q,br),S.removeEventListener("touchstart",be,br),S.removeEventListener("touchmove",pe,br)}function ft(S,W){de(S,function(){!b.state.isVisible&&w.parentNode&&w.parentNode.contains(w)&&W()})}function Ye(S,W){de(S,W)}function de(S,W){var te=ce().box;function Ee(he){he.target===te&&(uu(te,"remove",Ee),W())}if(S===0)return W();uu(te,"remove",d),uu(te,"add",Ee),d=Ee}function rt(S,W,te){te===void 0&&(te=!1);var Ee=Zr(b.props.triggerTarget||t);Ee.forEach(function(he){he.addEventListener(S,W,te),p.push({node:he,eventType:S,handler:W,options:te})})}function bt(){ne()&&(rt("touchstart",Kt,{passive:!0}),rt("touchend",en,{passive:!0})),Mk(b.props.trigger).forEach(function(S){if(S!=="manual")switch(rt(S,Kt),S){case"mouseenter":rt("mouseleave",en);break;case"focus":rt(Fk?"focusout":"blur",Ae);break;case"focusin":rt("focusout",Ae);break}})}function yt(){p.forEach(function(S){var W=S.node,te=S.eventType,Ee=S.handler,he=S.options;W.removeEventListener(te,Ee,he)}),p=[]}function Kt(S){var W,te=!1;if(!(!b.state.isEnabled||X(S)||a)){var Ee=((W=u)==null?void 0:W.type)==="focus";u=S,g=S.currentTarget,P(),!b.state.isVisible&&Ck(S)&&Rs.forEach(function(he){return he(S)}),S.type==="click"&&(b.props.trigger.indexOf("mouseenter")<0||s)&&b.props.hideOnClick!==!1&&b.state.isVisible?te=!0:ae(S),S.type==="click"&&(s=!te),te&&!Ee&&Je(S)}}function He(S){var W=S.target,te=Z().contains(W)||w.contains(W);if(!(S.type==="mousemove"&&te)){var Ee=ye().concat(w).map(function(he){var it,vt=he._tippy,vr=(it=vt.popperInstance)==null?void 0:it.state;return vr?{popperRect:he.getBoundingClientRect(),popperState:vr,props:n}:null}).filter(Boolean);Ik(Ee,S)&&(j(),Je(S))}}function en(S){var W=X(S)||b.props.trigger.indexOf("click")>=0&&s;if(!W){if(b.props.interactive){b.hideWithInteractivity(S);return}Je(S)}}function Ae(S){b.props.trigger.indexOf("focusin")<0&&S.target!==Z()||b.props.interactive&&S.relatedTarget&&w.contains(S.relatedTarget)||Je(S)}function X(S){return Qt.isTouch?ne()!==S.type.indexOf("touch")>=0:!1}function Rt(){H();var S=b.props,W=S.popperOptions,te=S.placement,Ee=S.offset,he=S.getReferenceClientRect,it=S.moveTransition,vt=ie()?pu(w).arrow:null,vr=he?{getBoundingClientRect:he,contextElement:he.contextElement||Z()}:t,Hu={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Xi){var Sr=Xi.state;if(ie()){var Yb=ce(),oa=Yb.box;["placement","reference-hidden","escaped"].forEach(function(Zi){Zi==="placement"?oa.setAttribute("data-placement",Sr.placement):Sr.attributes.popper["data-popper-"+Zi]?oa.setAttribute("data-"+Zi,""):oa.removeAttribute("data-"+Zi)}),Sr.attributes.popper={}}}},Ln=[{name:"offset",options:{offset:Ee}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!it}},Hu];ie()&&vt&&Ln.push({name:"arrow",options:{element:vt,padding:3}}),Ln.push.apply(Ln,W?.modifiers||[]),b.popperInstance=au(vr,w,Object.assign({},W,{placement:te,onFirstUpdate:f,modifiers:Ln}))}function H(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function le(){var S=b.props.appendTo,W,te=Z();b.props.interactive&&S===Xm||S==="parent"?W=te.parentNode:W=Zm(S,[te]),W.contains(w)||W.appendChild(w),b.state.isMounted=!0,Rt()}function ye(){return Is(w.querySelectorAll("[data-tippy-root]"))}function ae(S){b.clearDelayTimeouts(),S&&v("onTrigger",[b,S]),ue();var W=N(!0),te=J(),Ee=te[0],he=te[1];Qt.isTouch&&Ee==="hold"&&he&&(W=he),W?r=setTimeout(function(){b.show()},W):b.show()}function Je(S){if(b.clearDelayTimeouts(),v("onUntrigger",[b,S]),!b.state.isVisible){xe();return}if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(S.type)>=0&&s)){var W=N(!1);W?i=setTimeout(function(){b.state.isVisible&&b.hide()},W):o=requestAnimationFrame(function(){b.hide()})}}function Ve(){b.state.isEnabled=!0}function L(){b.hide(),b.state.isEnabled=!1}function z(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function k(S){if(!b.state.isDestroyed){v("onBeforeUpdate",[b,S]),yt();var W=b.props,te=Vm(t,Object.assign({},W,$m(S),{ignoreAttributes:!0}));b.props=te,bt(),W.interactiveDebounce!==te.interactiveDebounce&&(j(),h=Hm(He,te.interactiveDebounce)),W.triggerTarget&&!te.triggerTarget?Zr(W.triggerTarget).forEach(function(Ee){Ee.removeAttribute("aria-expanded")}):te.triggerTarget&&t.removeAttribute("aria-expanded"),P(),E(),I&&I(W,te),b.popperInstance&&(Rt(),ye().forEach(function(Ee){requestAnimationFrame(Ee._tippy.popperInstance.forceUpdate)})),v("onAfterUpdate",[b,S])}}function A(S){b.setProps({content:S})}function G(){var S=b.state.isVisible,W=b.state.isDestroyed,te=!b.state.isEnabled,Ee=Qt.isTouch&&!b.props.touch,he=lu(b.props.duration,0,Ut.duration);if(!(S||W||te||Ee)&&!Z().hasAttribute("disabled")&&(v("onShow",[b],!1),b.props.onShow(b)!==!1)){if(b.state.isVisible=!0,ie()&&(w.style.visibility="visible"),E(),ue(),b.state.isMounted||(w.style.transition="none"),ie()){var it=ce(),vt=it.box,vr=it.content;cu([vt,vr],0)}f=function(){var Ln;if(!(!b.state.isVisible||c)){if(c=!0,w.offsetHeight,w.style.transition=b.props.moveTransition,ie()&&b.props.animation){var ia=ce(),Xi=ia.box,Sr=ia.content;cu([Xi,Sr],he),Um([Xi,Sr],"visible")}C(),P(),zm(du,b),(Ln=b.popperInstance)==null||Ln.forceUpdate(),v("onMount",[b]),b.props.animation&&ie()&&Ye(he,function(){b.state.isShown=!0,v("onShown",[b])})}},le()}}function oe(){var S=!b.state.isVisible,W=b.state.isDestroyed,te=!b.state.isEnabled,Ee=lu(b.props.duration,1,Ut.duration);if(!(S||W||te)&&(v("onHide",[b],!1),b.props.onHide(b)!==!1)){if(b.state.isVisible=!1,b.state.isShown=!1,c=!1,s=!1,ie()&&(w.style.visibility="hidden"),j(),xe(),E(!0),ie()){var he=ce(),it=he.box,vt=he.content;b.props.animation&&(cu([it,vt],Ee),Um([it,vt],"hidden"))}C(),P(),b.props.animation?ie()&&ft(Ee,b.unmount):b.unmount()}}function Re(S){re().addEventListener("mousemove",h),zm(Rs,h),h(S)}function Et(){b.state.isVisible&&b.hide(),b.state.isMounted&&(H(),ye().forEach(function(S){S._tippy.unmount()}),w.parentNode&&w.parentNode.removeChild(w),du=du.filter(function(S){return S!==b}),b.state.isMounted=!1,v("onHidden",[b]))}function ra(){b.state.isDestroyed||(b.clearDelayTimeouts(),b.unmount(),yt(),delete t._tippy,b.state.isDestroyed=!0,v("onDestroy",[b]))}}function Wi(t,e){e===void 0&&(e={});var n=Ut.plugins.concat(e.plugins||[]);Pk();var r=Object.assign({},e,{plugins:n}),i=Ak(t);if(!1)var o,s;var a=i.reduce(function(l,c){var u=c&&Gk(c,r);return u&&l.push(u),l},[]);return Ds(t)?a[0]:a}Wi.defaultProps=Ut;Wi.setDefaultProps=Uk;Wi.currentInput=Qt;var II=Object.assign({},Pi,{effect:function(e){var n=e.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});Wi.setDefaultProps({render:tg});var Ls=Wi;var mu=class{constructor({editor:e,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:s}){ot(this,"shouldShow",({view:e,state:n,from:r,to:i})=>{let{doc:o,selection:s}=n,{empty:a}=s,l=!o.textBetween(r,i).length&&Fo(n.selection),c=this.element.contains(document.activeElement);return!(!(e.hasFocus()||c)||a||l||!this.editor.isEditable)});ot(this,"mousedownHandler",()=>{this.preventHide=!0});ot(this,"dragstartHandler",()=>{this.hide()});ot(this,"focusHandler",()=>{setTimeout(()=>this.update(this.editor.view))});ot(this,"blurHandler",({event:e})=>{if(this.preventHide){this.preventHide=!1;return}e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||this.hide()});ot(this,"tippyBlurHandler",e=>{this.blurHandler({event:e})});ot(this,"handleDebouncedUpdate",(e,n)=>{let r=!n?.selection.eq(e.state.selection),i=!n?.doc.eq(e.state.doc);!r&&!i||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(e,r,i,n)},this.updateDelay))});ot(this,"updateHandler",(e,n,r,i)=>{let{state:o,composing:s}=e,{selection:a}=o;if(s||!n&&!r)return;this.createTooltip();let{ranges:c}=a,u=Math.min(...c.map(p=>p.$from.pos)),d=Math.max(...c.map(p=>p.$to.pos));if(!this.shouldShow?.({editor:this.editor,view:e,state:o,oldState:i,from:u,to:d})){this.hide();return}o.selection.$anchor.pos!==i?.selection.$anchor.pos&&this.update(e,o),this.tippy?.setProps({getReferenceClientRect:this.tippyOptions?.getReferenceClientRect||(()=>{if(hp(o.selection)){let p=e.nodeDOM(u),h=p.dataset.nodeViewWrapper?p:p.querySelector("[data-node-view-wrapper]");if(h&&(p=h.firstChild),p)return p.getBoundingClientRect()}return Uo(e,u,d)})}),this.show()});this.editor=e,this.element=n,this.view=r,this.updateDelay=o,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.style.visibility="hidden",this.element.style.position="absolute"}createTooltip(){let{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=Ls(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){let{state:r}=e,i=r.selection.$from.pos!==r.selection.$to.pos;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(e,n);return}let o=!n?.selection.eq(e.state.selection),s=!n?.doc.eq(e.state.doc);this.updateHandler(e,o,s,n)}show(){this.element.style.position="relative",this.element.style.visibility="visible",this.tippy?.show()}hide(){this.element.style.position="absolute",this.element.style.visibility="hidden",this.tippy?.hide()}destroy(){this.tippy?.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),this.tippy?.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}},ng=t=>new ge({key:typeof t.pluginKey=="string"?new ve(t.pluginKey):t.pluginKey,view:e=>new mu({view:e,...t})});var Vi=Ne.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[ng({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});var gu=class{constructor({editor:e,element:n,view:r,tippyOptions:i={},shouldShow:o}){ot(this,"shouldShow",({view:e,state:n})=>{let{selection:r}=n,{$anchor:i,empty:o}=r,s=i.depth===1,a=i.parent.isTextblock&&!i.parent.type.spec.code&&!i.parent.textContent;return!(!e.hasFocus()||!o||!s||!a||!this.editor.isEditable)});ot(this,"mousedownHandler",()=>{this.preventHide=!0});ot(this,"focusHandler",()=>{setTimeout(()=>this.update(this.editor.view))});ot(this,"blurHandler",({event:e})=>{if(this.preventHide){this.preventHide=!1;return}e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||this.hide()});ot(this,"tippyBlurHandler",e=>{this.blurHandler({event:e})});this.editor=e,this.element=n,this.view=r,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.style.visibility="hidden",this.element.style.position="absolute"}createTooltip(){let{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=Ls(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){let{state:r}=e,{doc:i,selection:o}=r,{from:s,to:a}=o;if(n&&n.doc.eq(i)&&n.selection.eq(o))return;if(this.createTooltip(),!this.shouldShow?.({editor:this.editor,view:e,state:r,oldState:n})){this.hide();return}this.tippy?.setProps({getReferenceClientRect:this.tippyOptions?.getReferenceClientRect||(()=>Uo(e,s,a))}),this.show()}show(){this.element.style.position="relative",this.element.style.visibility="visible",this.tippy?.show()}hide(){this.tippy?.hide()}destroy(){this.tippy?.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),this.tippy?.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}},rg=t=>new ge({key:typeof t.pluginKey=="string"?new ve(t.pluginKey):t.pluginKey,view:e=>new gu({view:e,...t})});var bu=Ne.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[rg({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});function Ps(t,e,n=null){return n?t.createChecked({"data-col-span":e},n):t.createAndFill({"data-col-span":e})}function ig(t){if(t.cached.gridBuilderNodeTypes)return t.cached.gridBuilderNodeTypes;let e={};return Object.keys(t.nodes).forEach(n=>{let r=t.nodes[n];r.spec.gridBuilderRole&&(e[r.spec.gridBuilderRole]=r)}),t.cached.gridBuilderNodeTypes=e,e}function og(t,e,n,r,i,o,s){let a=ig(t),l=[];if(n==="asymmetric")l.push(Ps(a.builderColumn,i,s)),l.push(Ps(a.builderColumn,o,s));else for(let c=0;ct.getAttribute("data-type")},"data-cols":{default:2,parseHTML:t=>t.getAttribute("data-cols")},"data-stack-at":{default:"md",parseHTML:t=>t.getAttribute("data-stack-at")},style:{default:null,parseHTML:t=>t.getAttribute("style"),renderHTML:t=>({style:`grid-template-columns: repeat(${t["data-cols"]}, 1fr);`})}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-grid-builder")&&null}]},renderHTML({HTMLAttributes:t}){return["div",B(this.options.HTMLAttributes,t),0]},addCommands(){return{insertGridBuilder:({cols:t=3,type:e="responsive",stackAt:n,asymmetricLeft:r=null,asymmetricRight:i=null}={})=>({tr:o,dispatch:s,editor:a})=>{let l=og(a.schema,t,e,n,r,i);if(s){let c=o.selection.anchor+1;o.replaceSelectionWith(l).scrollIntoView().setSelection(K.near(o.doc.resolve(c)))}return!0}}},addKeyboardShortcuts(){return{"Mod-Alt-G":()=>this.editor.commands.insertGridBuilder()}},extendNodeSchema(t){let e={name:t.name,options:t.options,storage:t.storage};return{gridBuilderRole:ee(F(t,"gridBuilderRole",e))}}});var Eu=$.create({name:"gridBuilderColumn",content:"block+",gridBuilderRole:"builderColumn",isolating:!0,addOptions(){return{HTMLAttributes:{class:"filament-tiptap-grid-builder__column"}}},addAttributes(){return{"data-col-span":{default:1,parseHTML:t=>t.getAttribute("data-col-span")},style:{default:null,parseHTML:t=>t.getAttribute("style"),renderHTML:t=>({style:`grid-column: span ${t["data-col-span"]};`})}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-grid-builder__column")&&null}]},renderHTML({HTMLAttributes:t}){return["div",B(this.options.HTMLAttributes,t),0]}});function qk(t){let e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="<[^<>]+>",s="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional(o)+")",a={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},l="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+l+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},d={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},p=e.optional(i)+t.IDENT_RE+"\\s*\\(",h=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],g=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],m=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],b={type:g,keyword:h,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:m},_={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},w=[_,d,a,n,t.C_BLOCK_COMMENT_MODE,u,c],I={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:b,contains:w.concat([{begin:/\(/,end:/\)/,keywords:b,contains:w.concat(["self"]),relevance:0}]),relevance:0},U={className:"function",begin:"("+s+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:b,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:b,relevance:0},{begin:p,returnBegin:!0,contains:[f],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,u]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:b,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,c,u,a,{begin:/\(/,end:/\)/,keywords:b,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,c,u,a]}]},a,n,t.C_BLOCK_COMMENT_MODE,d]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:b,illegal:"",keywords:b,contains:["self",a]},{begin:t.IDENT_RE+"::",keywords:b},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function sg(t){let e={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=qk(t),r=n.keywords;return r.type=[...r.type,...e.type],r.literal=[...r.literal,...e.literal],r.built_in=[...r.built_in,...e.built_in],r._hints=e._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function ag(t){let e=t.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});let i={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},s={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);let a={className:"",begin:/\\"/},l={className:"string",begin:/'/,end:/'/},c={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},u=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],d=t.SHEBANG({binary:`(${u.join("|")})`,relevance:10}),f={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},p=["if","then","else","elif","fi","for","while","until","in","do","done","case","esac","function","select"],h=["true","false"],g={match:/(\/[a-z._-]+)+/},m=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],y=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","type","typeset","ulimit","unalias"],M=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],x=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:p,literal:h,built_in:[...m,...y,"set","shopt",...M,...x]},contains:[d,t.SHEBANG(),f,c,t.HASH_COMMENT_MODE,o,g,s,a,l,n]}}function lg(t){let e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="<[^<>]+>",s="("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional(o)+")",a={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},l="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+l+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},d={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},p=e.optional(i)+t.IDENT_RE+"\\s*\\(",m={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal128","const","static","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},y=[d,a,n,t.C_BLOCK_COMMENT_MODE,u,c],M={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:m,contains:y.concat([{begin:/\(/,end:/\)/,keywords:m,contains:y.concat(["self"]),relevance:0}]),relevance:0},x={begin:"("+s+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:m,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:m,relevance:0},{begin:p,returnBegin:!0,contains:[t.inherit(f,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:m,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,c,u,a,{begin:/\(/,end:/\)/,keywords:m,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,c,u,a]}]},a,n,t.C_BLOCK_COMMENT_MODE,d]};return{name:"C",aliases:["h"],keywords:m,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:d,strings:c,keywords:m}}}function cg(t){let e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="<[^<>]+>",s="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional(o)+")",a={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},l="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+l+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},d={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},p=e.optional(i)+t.IDENT_RE+"\\s*\\(",h=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],g=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],m=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],b={type:g,keyword:h,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:m},_={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},w=[_,d,a,n,t.C_BLOCK_COMMENT_MODE,u,c],I={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:b,contains:w.concat([{begin:/\(/,end:/\)/,keywords:b,contains:w.concat(["self"]),relevance:0}]),relevance:0},U={className:"function",begin:"("+s+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:b,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:b,relevance:0},{begin:p,returnBegin:!0,contains:[f],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,u]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:b,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,c,u,a,{begin:/\(/,end:/\)/,keywords:b,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,c,u,a]}]},a,n,t.C_BLOCK_COMMENT_MODE,d]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:b,illegal:"",keywords:b,contains:["self",a]},{begin:t.IDENT_RE+"::",keywords:b},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function ug(t){let e=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],i=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],o=["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"],s={keyword:i.concat(o),built_in:e,literal:r},a=t.inherit(t.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},u=t.inherit(c,{illegal:/\n/}),d={className:"subst",begin:/\{/,end:/\}/,keywords:s},f=t.inherit(d,{illegal:/\n/}),p={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,f]},h={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},d]},g=t.inherit(h,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},f]});d.contains=[h,p,c,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,l,t.C_BLOCK_COMMENT_MODE],f.contains=[g,p,u,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,l,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let m={variants:[h,p,c,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},y={begin:"<",end:">",contains:[{beginKeywords:"in out"},a]},M=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",x={begin:"@"+t.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:s,illegal:/::/,contains:[t.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:""},{begin:""}]}]}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},m,l,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},a,y,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,y,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+M+"\\s+)+"+t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:s,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,y],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,relevance:0,contains:[m,l,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},x]}}var jk=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),Yk=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Jk=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],Xk=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],Zk=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],Qk=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();function dg(t){let e=t.regex,n=jk(t),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",o=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",a=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Xk.join("|")+")"},{begin:":(:)?("+Zk.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Qk.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...a,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:o},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:Jk.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...a,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Yk.join("|")+")\\b"}]}}function fg(t){let e=t.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:e.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:e.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function pg(t){let o={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:o,illegal:"bg(t,e,n-1))}function yg(t){let e=t.regex,n="[\xC0-\u02B8a-zA-Z_$][\xC0-\u02B8a-zA-Z_$0-9]*",r=n+bg("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),l={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},c={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},u={className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:l,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[e.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[u,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:l,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[c,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,gg,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},gg,c]}}var Eg="[A-Za-z$_][0-9A-Za-z$_]*",eM=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],tM=["true","false","null","undefined","NaN","Infinity"],wg=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],vg=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Sg=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],nM=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],rM=[].concat(Sg,wg,vg);function xg(t){let e=t.regex,n=(v,{after:C})=>{let P="",end:""},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(v,C)=>{let P=v[0].length+v.index,j=v.input[P];if(j==="<"||j===","){C.ignoreMatch();return}j===">"&&(n(v,{after:P})||C.ignoreMatch());let Q,pe=v.input.substring(P);if(Q=pe.match(/^\s*=/)){C.ignoreMatch();return}if((Q=pe.match(/^\s+extends\s+/))&&Q.index===0){C.ignoreMatch();return}}},a={$pattern:Eg,keyword:eM,literal:tM,built_in:rM,"variable.language":nM},l="[0-9](_?[0-9])*",c=`\\.(${l})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${u})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${u})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},p={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},h={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"css"}},g={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},m={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,f]},M={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},x=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,p,h,g,m,{match:/\$\d+/},d];f.contains=x.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(x)});let b=[].concat(M,f.contains),_=b.concat([{begin:/\(/,end:/\)/,keywords:a,contains:["self"].concat(b)}]),w={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:_},I={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},U={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...wg,...vg]}},O={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},J={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[w],illegal:/%/},ne={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function ie(v){return e.concat("(?!",v.join("|"),")")}let Z={match:e.concat(/\b/,ie([...Sg,"super","import"]),r,e.lookahead(/\(/)),className:"title.function",relevance:0},re={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ce={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},w]},N="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",E={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(N)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[w]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:_,CLASS_REFERENCE:U},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),O,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,p,h,g,m,M,{match:/\$\d+/},d,U,{className:"attr",begin:r+e.lookahead(":"),relevance:0},E,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[M,t.REGEXP_MODE,{className:"function",begin:N,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:_}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:o},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},J,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[w,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},re,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[w]},Z,ne,I,ce,{match:/\$[(.]/}]}}function kg(t){let e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",keywords:{literal:r},contains:[e,n,t.QUOTE_STRING_MODE,i,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var ei="[0-9](_*[0-9])*",Hs=`\\.(${ei})`,zs="[0-9a-fA-F](_*[0-9a-fA-F])*",iM={className:"number",variants:[{begin:`(\\b(${ei})((${Hs})|\\.)?|(${Hs}))[eE][+-]?(${ei})[fFdD]?\\b`},{begin:`\\b(${ei})((${Hs})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Hs})[fFdD]?\\b`},{begin:`\\b(${ei})[fFdD]\\b`},{begin:`\\b0[xX]((${zs})\\.?|(${zs})?\\.(${zs}))[pP][+-]?(${ei})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${zs})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Mg(t){let e={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[t.C_NUMBER_MODE]},o={className:"variable",begin:"\\$"+t.UNDERSCORE_IDENT_RE},s={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[o,i]},{begin:"'",end:"'",illegal:/\n/,contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[t.BACKSLASH_ESCAPE,o,i]}]};i.contains.push(s);let a={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+t.UNDERSCORE_IDENT_RE+")?"},l={className:"meta",begin:"@"+t.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[t.inherit(s,{className:"string"}),"self"]}]},c=iM,u=t.COMMENT("/\\*","\\*/",{contains:[t.C_BLOCK_COMMENT_MODE]}),d={variants:[{className:"type",begin:t.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},f=d;return f.variants[1].contains=[d],d.variants[1].contains=[f],{name:"Kotlin",aliases:["kt","kts"],keywords:e,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),t.C_LINE_COMMENT_MODE,u,n,r,a,l,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:e,relevance:5,contains:[{begin:t.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[t.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:e,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[d,t.C_LINE_COMMENT_MODE,u],relevance:0},t.C_LINE_COMMENT_MODE,u,a,l,s,t.C_NUMBER_MODE]},u]},{begin:[/class|interface|trait/,/\s+/,t.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},t.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},a,l]},s,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` +`},c]}}var oM=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),sM=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],aM=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],Ng=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],Tg=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],lM=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse(),cM=Ng.concat(Tg);function _g(t){let e=oM(t),n=cM,r="and or not only",i="[\\w-]+",o="("+i+"|@\\{"+i+"\\})",s=[],a=[],l=function(x){return{className:"string",begin:"~?"+x+".*?"+x}},c=function(x,b,_){return{className:x,begin:b,relevance:_}},u={$pattern:/[a-z-]+/,keyword:r,attribute:aM.join(" ")},d={begin:"\\(",end:"\\)",contains:a,keywords:u,relevance:0};a.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,l("'"),l('"'),e.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},e.HEXCOLOR,d,c("variable","@@?"+i,10),c("variable","@\\{"+i+"\\}"),c("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},e.IMPORTANT,{beginKeywords:"and not"},e.FUNCTION_DISPATCH);let f=a.concat({begin:/\{/,end:/\}/,contains:s}),p={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(a)},h={begin:o+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+lM.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:a}}]},g={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:u,returnEnd:!0,contains:a,relevance:0}},m={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:f}},y={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:o,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,p,c("keyword","all\\b"),c("variable","@\\{"+i+"\\}"),{begin:"\\b("+sM.join("|")+")\\b",className:"selector-tag"},e.CSS_NUMBER_MODE,c("selector-tag",o,0),c("selector-id","#"+o),c("selector-class","\\."+o,0),c("selector-tag","&",0),e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+Ng.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+Tg.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:f},{begin:"!important"},e.FUNCTION_DISPATCH]},M={begin:i+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[y]};return s.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,g,m,M,h,y,p,e.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:s}}function Cg(t){let e="\\[=*\\[",n="\\]=*\\]",r={begin:e,end:n,contains:["self"]},i=[t.COMMENT("--(?!"+e+")","$"),t.COMMENT("--"+e,n,{contains:[r],relevance:10})];return{name:"Lua",keywords:{$pattern:t.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},t.C_NUMBER_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:e,end:n,contains:[r],relevance:5}])}}function Og(t){let e={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},i={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},o={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},a=/[A-Za-z][A-Za-z0-9+.-]*/,l={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,a,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},c={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},u={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},d=t.inherit(c,{contains:[]}),f=t.inherit(u,{contains:[]});c.contains.push(f),u.contains.push(d);let p=[n,l];return[c,u,d,f].forEach(m=>{m.contains=m.contains.concat(p)}),p=p.concat(c,u),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:p},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:p}]}]},n,o,c,u,{className:"quote",begin:"^>\\s+",contains:p,end:"$"},i,r,l,s]}}function Rg(t){let e={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,a={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},l={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:a,illegal:"/,end:/$/,illegal:"\\n"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+l.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:l,contains:[t.UNDERSCORE_TITLE_MODE]},{begin:"\\."+t.UNDERSCORE_IDENT_RE,relevance:0}]}}function Ig(t){let e=t.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(" ")},o={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},s={begin:/->\{/,end:/\}/},a={variants:[{begin:/\$\d/},{begin:e.concat(/[$%@](\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@][^\s\w{]/,relevance:0}]},l=[t.BACKSLASH_ESCAPE,o,a],c=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],u=(p,h,g="\\1")=>{let m=g==="\\1"?g:e.concat(g,h);return e.concat(e.concat("(?:",p,")"),h,/(?:\\.|[^\\\/])*?/,m,/(?:\\.|[^\\\/])*?/,g,r)},d=(p,h,g)=>e.concat(e.concat("(?:",p,")"),h,/(?:\\.|[^\\\/])*?/,g,r),f=[a,t.HASH_COMMENT_MODE,t.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),s,{className:"string",contains:l,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},{className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},{begin:"(\\/\\/|"+t.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[t.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:u("s|tr|y",e.either(...c,{capture:!0}))},{begin:u("s|tr|y","\\(","\\)")},{begin:u("s|tr|y","\\[","\\]")},{begin:u("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:d("(?:m|qr)?",/\//,/\//)},{begin:d("m|qr",e.either(...c,{capture:!0}),/\1/)},{begin:d("m|qr",/\(/,/\)/)},{begin:d("m|qr",/\[/,/\]/)},{begin:d("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return o.contains=f,s.contains=f,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:f}}function Dg(t){let e=t.regex,n=/(?![A-Za-z0-9])(?![$])/,r=e.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),o={scope:"variable",match:"\\$+"+r},s={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},a={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},l=t.inherit(t.APOS_STRING_MODE,{illegal:null}),c=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(a)}),u={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(a),"on:begin":(Z,re)=>{re.data._beginMatch=Z[1]||Z[2]},"on:end":(Z,re)=>{re.data._beginMatch!==Z[1]&&re.ignoreMatch()}},d=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),f=`[ +]`,p={scope:"string",variants:[c,l,u,d]},h={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},g=["false","null","true"],m=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],y=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],x={keyword:m,literal:(Z=>{let re=[];return Z.forEach(ce=>{re.push(ce),ce.toLowerCase()===ce?re.push(ce.toUpperCase()):re.push(ce.toLowerCase())}),re})(g),built_in:y},b=Z=>Z.map(re=>re.replace(/\|\d+$/,"")),_={variants:[{match:[/new/,e.concat(f,"+"),e.concat("(?!",b(y).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},w=e.concat(r,"\\b(?!\\()"),I={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),w],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,e.concat(/::/,e.lookahead(/(?!class\b)/)),w],scope:{1:"title.class",3:"variable.constant"}},{match:[i,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},U={scope:"attr",match:e.concat(r,e.lookahead(":"),e.lookahead(/(?!::)/))},O={relevance:0,begin:/\(/,end:/\)/,keywords:x,contains:[U,o,I,t.C_BLOCK_COMMENT_MODE,p,h,_]},J={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",b(m).join("\\b|"),"|",b(y).join("\\b|"),"\\b)"),r,e.concat(f,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[O]};O.contains.push(J);let ne=[U,I,t.C_BLOCK_COMMENT_MODE,p,h,_],ie={begin:e.concat(/#\[\s*/,i),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:g,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:g,keyword:["new","array"]},contains:["self",...ne]},...ne,{scope:"meta",match:i}]};return{case_insensitive:!1,keywords:x,contains:[ie,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},s,{scope:"variable.language",match:/\$this\b/},o,J,I,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},_,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:x,contains:["self",o,I,t.C_BLOCK_COMMENT_MODE,p,h]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},p,h]}}function Lg(t){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},t.inherit(t.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function Pg(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function Bg(t){let e=t.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],a={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},c={className:"subst",begin:/\{/,end:/\}/,keywords:a,illegal:/#/},u={begin:/\{\{/,relevance:0},d={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,l,u,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,l,u,c]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,u,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,u,c]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},f="[0-9](_?[0-9])*",p=`(\\b(${f}))?\\.(${f})|\\b(${f})\\.`,h=`\\b|${r.join("|")}`,g={className:"number",relevance:0,variants:[{begin:`(\\b(${f})|(${p}))[eE][+-]?(${f})[jJ]?(?=${h})`},{begin:`(${p})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${h})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${h})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${h})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${h})`},{begin:`\\b(${f})[jJ](?=${h})`}]},m={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:a,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:["self",l,g,d,t.HASH_COMMENT_MODE]}]};return c.contains=[d,g,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:a,illegal:/(<\/|\?)|=>/,contains:[l,g,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},d,m,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[y]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[g,y,d]}]}}function Fg(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function Hg(t){let e=t.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=e.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,o=e.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[t.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:e.lookahead(e.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),t.HASH_COMMENT_MODE,{scope:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[o,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:o},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function zg(t){let e=t.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=e.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=e.concat(r,/(::\w+)*/),s={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},a={className:"doctag",begin:"@[A-Za-z]+"},l={begin:"#<",end:">"},c=[t.COMMENT("#","$",{contains:[a]}),t.COMMENT("^=begin","^=end",{contains:[a],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],u={className:"subst",begin:/#\{/,end:/\}/,keywords:s},d={className:"string",contains:[t.BACKSLASH_ESCAPE,u],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:e.concat(/<<[-~]?'?/,e.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,u]})]}]},f="[1-9](_?[0-9])*|0",p="[0-9](_?[0-9])*",h={className:"number",relevance:0,variants:[{begin:`\\b(${f})(\\.(${p}))?([eE][+-]?(${p})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},g={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:s}]},w=[d,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:s},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:s},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[g]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[d,{begin:n}],relevance:0},h,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:s},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.BACKSLASH_ESCAPE,u],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(l,c),relevance:0}].concat(l,c);u.contains=w,g.contains=w;let I="[>?]>",U="[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]",O="(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>",J=[{begin:/^\s*=>/,starts:{end:"$",contains:w}},{className:"meta.prompt",begin:"^("+I+"|"+U+"|"+O+")(?=[ ])",starts:{end:"$",keywords:s,contains:w}}];return c.unshift(l),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:s,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(J).concat(c).concat(w)}}function $g(t){let e=t.regex,n={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let\b)/,t.IDENT_RE,e.lookahead(/\s*\(/))},r="([ui](8|16|32|64|128|size)|f(32|64))?",i=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","unsafe","unsized","use","virtual","where","while","yield"],o=["true","false","Some","None","Ok","Err"],s=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],a=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:a,keyword:i,literal:o,built_in:s},illegal:""},n]}}var uM=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),dM=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],fM=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],pM=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],hM=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],mM=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();function Ug(t){let e=uM(t),n=hM,r=pM,i="@[a-z-]+",o="and or not only",a={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,e.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+dM.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},a,{begin:/\(/,end:/\)/,contains:[e.CSS_NUMBER_MODE]},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+mM.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[e.BLOCK_COMMENT,a,e.HEXCOLOR,e.CSS_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.IMPORTANT,e.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:o,attribute:fM.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},a,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.HEXCOLOR,e.CSS_NUMBER_MODE]},e.FUNCTION_DISPATCH]}}function Kg(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function Wg(t){let e=t.regex,n=t.COMMENT("--","$"),r={className:"string",variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},i={begin:/"/,end:/"/,contains:[{begin:/""/}]},o=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],a=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],l=["add","asc","collation","desc","final","first","last","view"],c=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],u=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],d=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],f=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],p=u,h=[...c,...l].filter(x=>!u.includes(x)),g={className:"variable",begin:/@[a-z0-9][a-z0-9_]*/},m={className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={begin:e.concat(/\b/,e.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function M(x,{exceptions:b,when:_}={}){let w=_;return b=b||[],x.map(I=>I.match(/\|\d+$/)||b.includes(I)?I:w(I)?`${I}|0`:I)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:M(h,{when:x=>x.length<3}),literal:o,type:a,built_in:d},contains:[{begin:e.either(...f),relevance:0,keywords:{$pattern:/[\w\.]+/,keyword:h.concat(f),literal:o,type:a}},{className:"type",begin:e.either(...s)},y,g,r,i,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,m]}}function jg(t){return t?typeof t=="string"?t:t.source:null}function $s(t){return Se("(?=",t,")")}function Se(...t){return t.map(n=>jg(n)).join("")}function gM(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function gt(...t){return"("+(gM(t).capture?"":"?:")+t.map(r=>jg(r)).join("|")+")"}var xu=t=>Se(/\b/,t,/\w$/.test(t)?/\b/:/\B/),bM=["Protocol","Type"].map(xu),Vg=["init","self"].map(xu),yM=["Any","Self"],wu=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","break","case","catch","class","continue","convenience","default","defer","deinit","didSet","distributed","do","dynamic","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],Gg=["false","nil","true"],EM=["assignment","associativity","higherThan","left","lowerThan","none","right"],wM=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],qg=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],Yg=gt(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),Jg=gt(Yg,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),vu=Se(Yg,Jg,"*"),Xg=gt(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Us=gt(Xg,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),hn=Se(Xg,Us,"*"),Su=Se(/[A-Z]/,Us,"*"),vM=["autoclosure",Se(/convention\(/,gt("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Se(/objc\(/,hn,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","testable","UIApplicationMain","unknown","usableFromInline"],SM=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function Zg(t){let e={match:/\s+/,relevance:0},n=t.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[t.C_LINE_COMMENT_MODE,n],i={match:[/\./,gt(...bM,...Vg)],className:{2:"keyword"}},o={match:Se(/\./,gt(...wu)),relevance:0},s=wu.filter(de=>typeof de=="string").concat(["_|0"]),a=wu.filter(de=>typeof de!="string").concat(yM).map(xu),l={variants:[{className:"keyword",match:gt(...a,...Vg)}]},c={$pattern:gt(/\b\w+/,/#\w+/),keyword:s.concat(wM),literal:Gg},u=[i,o,l],d={match:Se(/\./,gt(...qg)),relevance:0},f={className:"built_in",match:Se(/\b/,gt(...qg),/(?=\()/)},p=[d,f],h={match:/->/,relevance:0},g={className:"operator",relevance:0,variants:[{match:vu},{match:`\\.(\\.|${Jg})+`}]},m=[h,g],y="([0-9]_*)+",M="([0-9a-fA-F]_*)+",x={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${M})(\\.(${M}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},b=(de="")=>({className:"subst",variants:[{match:Se(/\\/,de,/[0\\tnr"']/)},{match:Se(/\\/,de,/u\{[0-9a-fA-F]{1,8}\}/)}]}),_=(de="")=>({className:"subst",match:Se(/\\/,de,/[\t ]*(?:[\r\n]|\r\n)/)}),w=(de="")=>({className:"subst",label:"interpol",begin:Se(/\\/,de,/\(/),end:/\)/}),I=(de="")=>({begin:Se(de,/"""/),end:Se(/"""/,de),contains:[b(de),_(de),w(de)]}),U=(de="")=>({begin:Se(de,/"/),end:Se(/"/,de),contains:[b(de),w(de)]}),O={className:"string",variants:[I(),I("#"),I("##"),I("###"),U(),U("#"),U("##"),U("###")]},J={match:Se(/`/,hn,/`/)},ne={className:"variable",match:/\$\d+/},ie={className:"variable",match:`\\$${Us}+`},Z=[J,ne,ie],re={match:/(@|#(un)?)available/,className:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:SM,contains:[...m,x,O]}]}},ce={className:"keyword",match:Se(/@/,gt(...vM))},N={className:"meta",match:Se(/@/,hn)},E=[re,ce,N],v={match:$s(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Se(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Us,"+")},{className:"type",match:Su,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Se(/\s+&\s+/,$s(Su)),relevance:0}]},C={begin://,keywords:c,contains:[...r,...u,...E,h,v]};v.contains.push(C);let P={match:Se(hn,/\s*:/),keywords:"_|0",relevance:0},j={begin:/\(/,end:/\)/,relevance:0,keywords:c,contains:["self",P,...r,...u,...p,...m,x,O,...Z,...E,v]},Q={begin://,contains:[...r,v]},pe={begin:gt($s(Se(hn,/\s*:/)),$s(Se(hn,/\s+/,hn,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:hn}]},be={begin:/\(/,end:/\)/,keywords:c,contains:[pe,...r,...u,...m,x,O,...E,v,j],endsParent:!0,illegal:/["']/},ue={match:[/func/,/\s+/,gt(J.match,hn,vu)],className:{1:"keyword",3:"title.function"},contains:[Q,be,e],illegal:[/\[/,/%/]},xe={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[Q,be,e],illegal:/\[|%/},ft={match:[/operator/,/\s+/,vu],className:{1:"keyword",3:"title"}},Ye={begin:[/precedencegroup/,/\s+/,Su],className:{1:"keyword",3:"title"},contains:[v],keywords:[...EM,...Gg],end:/}/};for(let de of O.variants){let rt=de.contains.find(yt=>yt.label==="interpol");rt.keywords=c;let bt=[...u,...p,...m,x,O,...Z];rt.contains=[...bt,{begin:/\(/,end:/\)/,contains:["self",...bt]}]}return{name:"Swift",keywords:c,contains:[...r,ue,xe,{beginKeywords:"struct protocol class extension enum actor",end:"\\{",excludeEnd:!0,keywords:c,contains:[t.inherit(t.TITLE_MODE,{className:"title.class",begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...u]},ft,Ye,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},...u,...p,...m,x,O,...Z,...E,v,j]}}var Ks="[A-Za-z$_][0-9A-Za-z$_]*",Qg=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],eb=["true","false","null","undefined","NaN","Infinity"],tb=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],nb=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],rb=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],ib=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],ob=[].concat(rb,tb,nb);function xM(t){let e=t.regex,n=(v,{after:C})=>{let P="",end:""},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(v,C)=>{let P=v[0].length+v.index,j=v.input[P];if(j==="<"||j===","){C.ignoreMatch();return}j===">"&&(n(v,{after:P})||C.ignoreMatch());let Q,pe=v.input.substring(P);if(Q=pe.match(/^\s*=/)){C.ignoreMatch();return}if((Q=pe.match(/^\s+extends\s+/))&&Q.index===0){C.ignoreMatch();return}}},a={$pattern:Ks,keyword:Qg,literal:eb,built_in:ob,"variable.language":ib},l="[0-9](_?[0-9])*",c=`\\.(${l})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${u})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${u})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},p={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},h={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"css"}},g={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},m={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,f]},M={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},x=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,p,h,g,m,{match:/\$\d+/},d];f.contains=x.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(x)});let b=[].concat(M,f.contains),_=b.concat([{begin:/\(/,end:/\)/,keywords:a,contains:["self"].concat(b)}]),w={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:_},I={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},U={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...tb,...nb]}},O={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},J={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[w],illegal:/%/},ne={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function ie(v){return e.concat("(?!",v.join("|"),")")}let Z={match:e.concat(/\b/,ie([...rb,"super","import"]),r,e.lookahead(/\(/)),className:"title.function",relevance:0},re={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ce={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},w]},N="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",E={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(N)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[w]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:_,CLASS_REFERENCE:U},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),O,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,p,h,g,m,M,{match:/\$\d+/},d,U,{className:"attr",begin:r+e.lookahead(":"),relevance:0},E,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[M,t.REGEXP_MODE,{className:"function",begin:N,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:_}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:o},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},J,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[w,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},re,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[w]},Z,ne,I,ce,{match:/\$[(.]/}]}}function sb(t){let e=xM(t),n=Ks,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={beginKeywords:"namespace",end:/\{/,excludeEnd:!0,contains:[e.exports.CLASS_REFERENCE]},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[e.exports.CLASS_REFERENCE]},s={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},a=["type","namespace","interface","public","private","protected","implements","declare","abstract","readonly","enum","override"],l={$pattern:Ks,keyword:Qg.concat(a),literal:eb,built_in:ob.concat(r),"variable.language":ib},c={className:"meta",begin:"@"+n},u=(f,p,h)=>{let g=f.contains.findIndex(m=>m.label===p);if(g===-1)throw new Error("can not find mode to replace");f.contains.splice(g,1,h)};Object.assign(e.keywords,l),e.exports.PARAMS_CONTAINS.push(c),e.contains=e.contains.concat([c,i,o]),u(e,"shebang",t.SHEBANG()),u(e,"use_strict",s);let d=e.contains.find(f=>f.label==="func.def");return d.relevance=0,Object.assign(e,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),e}function ab(t){let e=t.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,o=/\d{4}-\d{1,2}-\d{1,2}/,s=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,a=/\d{1,2}(:\d{1,2}){1,2}/,l={className:"literal",variants:[{begin:e.concat(/# */,e.either(o,i),/ *#/)},{begin:e.concat(/# */,a,/ *#/)},{begin:e.concat(/# */,s,/ *#/)},{begin:e.concat(/# */,e.either(o,i),/ +/,e.either(s,a),/ *#/)}]},c={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},u={className:"label",begin:/^\w+:/},d=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),f=t.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,l,c,u,d,f,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[f]}]}}function lb(t){t.regex;let e=t.COMMENT(/\(;/,/;\)/);e.contains.push("self");let n=t.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},o={className:"variable",begin:/\$[\w_]+/},s={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},a={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},l={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},c={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,e,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},o,s,i,t.QUOTE_STRING_MODE,l,c,a]}}function cb(t){let e=t.regex,n=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},o={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=t.inherit(o,{begin:/\(/,end:/\)/}),a=t.inherit(t.APOS_STRING_MODE,{className:"string"}),l=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),c={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[o,l,a,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[o,s,l,a]}]}]},t.COMMENT(//,{relevance:10}),{begin://,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[c],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[c],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:c}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function ub(t){let e="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:"\\w[\\w :\\/.-]*:(?=[ ]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ ]|$)'},{begin:"'\\w[\\w :\\/.-]*':(?=[ ]|$)"}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},o={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,i]},s=t.inherit(o,{variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),a="[0-9]{4}(-[0-9][0-9]){0,2}",l="([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?",c="(\\.[0-9]*)?",u="([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?",d={className:"number",begin:"\\b"+a+l+c+u+"\\b"},f={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},p={begin:/\{/,end:/\}/,contains:[f],illegal:"\\n",relevance:0},h={begin:"\\[",end:"\\]",contains:[f],illegal:"\\n",relevance:0},g=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},d,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},p,h,o],m=[...g];return m.pop(),m.push(s),f.contains=m,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:g}}var Ab=$u(Ob(),1);var At=Ab.default;var Ib=$u(Rb(),1),ji=Object.assign(wr(Error),{eval:wr(EvalError),range:wr(RangeError),reference:wr(ReferenceError),syntax:wr(SyntaxError),type:wr(TypeError),uri:wr(URIError)});function wr(t){return e.displayName=t.displayName||t.name,e;function e(n,...r){let i=n&&(0,Ib.default)(n,...r);return new t(i)}}var pN={}.hasOwnProperty,Db="hljs-";function Lb(t,e,n={}){let r=n.prefix;if(typeof t!="string")throw ji("Expected `string` for name, got `%s`",t);if(!At.getLanguage(t))throw ji("Unknown language: `%s` is not registered",t);if(typeof e!="string")throw ji("Expected `string` for value, got `%s`",e);r==null&&(r=Db),At.configure({__emitter:Iu,classPrefix:r});let i=At.highlight(e,{language:t,ignoreIllegals:!0});if(At.configure({}),i.errorRaised)throw i.errorRaised;return i._emitter.root.data.language=i.language,i._emitter.root.data.relevance=i.relevance,i._emitter.root}function hN(t,e={}){let n=e.subset||At.listLanguages(),r=e.prefix,i=-1,o={type:"root",data:{language:null,relevance:0},children:[]};if(r==null&&(r=Db),typeof t!="string")throw ji("Expected `string` for value, got `%s`",t);for(;++io.data.relevance&&(o=a)}return o}function mN(t,e){At.registerLanguage(t,e)}var gN=function(t,e){if(typeof t=="string")At.registerAliases(e,{languageName:t});else{let n;for(n in t)pN.call(t,n)&&At.registerAliases(t[n],{languageName:n})}};function bN(t){return!!At.getLanguage(t)}function yN(){return At.listLanguages()}var Iu=class{constructor(e){this.options=e,this.root={type:"root",data:{language:null,relevance:0},children:[]},this.stack=[this.root]}addText(e){if(e==="")return;let n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=e:n.children.push({type:"text",value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,n){let r=this.stack[this.stack.length-1],i=e.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:i}):r.children.push(...i)}openNode(e){let n=e.split(".").map((o,s)=>s?o+"_".repeat(s):this.options.classPrefix+o),r=this.stack[this.stack.length-1],i={type:"element",tagName:"span",properties:{className:n},children:[]};r.children.push(i),this.stack.push(i)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}},se={highlight:Lb,highlightAuto:hN,registerLanguage:mN,registered:bN,listLanguages:yN,registerAlias:gN};se.registerLanguage("arduino",sg);se.registerLanguage("bash",ag);se.registerLanguage("c",lg);se.registerLanguage("cpp",cg);se.registerLanguage("csharp",ug);se.registerLanguage("css",dg);se.registerLanguage("diff",fg);se.registerLanguage("go",pg);se.registerLanguage("graphql",hg);se.registerLanguage("ini",mg);se.registerLanguage("java",yg);se.registerLanguage("javascript",xg);se.registerLanguage("json",kg);se.registerLanguage("kotlin",Mg);se.registerLanguage("less",_g);se.registerLanguage("lua",Cg);se.registerLanguage("makefile",Og);se.registerLanguage("markdown",Ag);se.registerLanguage("objectivec",Rg);se.registerLanguage("perl",Ig);se.registerLanguage("php",Dg);se.registerLanguage("php-template",Lg);se.registerLanguage("plaintext",Pg);se.registerLanguage("python",Bg);se.registerLanguage("python-repl",Fg);se.registerLanguage("r",Hg);se.registerLanguage("ruby",zg);se.registerLanguage("rust",$g);se.registerLanguage("scss",Ug);se.registerLanguage("shell",Kg);se.registerLanguage("sql",Wg);se.registerLanguage("swift",Zg);se.registerLanguage("typescript",sb);se.registerLanguage("vbnet",ab);se.registerLanguage("wasm",lb);se.registerLanguage("xml",cb);se.registerLanguage("yaml",ub);var Dn=(t,e=0,n=1)=>t>n?n:tMath.round(n*t)/n;var fP={grad:360/400,turn:360,rad:360/(Math.PI*2)},Pb=t=>SN(Ys(t)),Ys=t=>(t[0]==="#"&&(t=t.substring(1)),t.length<6?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?Pe(parseInt(t[3]+t[3],16)/255,2):1}:{r:parseInt(t.substring(0,2),16),g:parseInt(t.substring(2,4),16),b:parseInt(t.substring(4,6),16),a:t.length===8?Pe(parseInt(t.substring(6,8),16)/255,2):1});var Bb=t=>vN(wN(t)),EN=({h:t,s:e,v:n,a:r})=>{let i=(200-e)*n/100;return{h:Pe(t),s:Pe(i>0&&i<200?e*n/100/(i<=100?i:200-i)*100:0),l:Pe(i/2),a:Pe(r,2)}};var Yi=t=>{let{h:e,s:n,l:r}=EN(t);return`hsl(${e}, ${n}%, ${r}%)`};var wN=({h:t,s:e,v:n,a:r})=>{t=t/360*6,e=e/100,n=n/100;let i=Math.floor(t),o=n*(1-e),s=n*(1-(t-i)*e),a=n*(1-(1-t+i)*e),l=i%6;return{r:Pe([n,s,o,o,a,n][l]*255),g:Pe([a,n,n,s,o,o][l]*255),b:Pe([o,o,a,n,n,s][l]*255),a:Pe(r,2)}};var js=t=>{let e=t.toString(16);return e.length<2?"0"+e:e},vN=({r:t,g:e,b:n,a:r})=>{let i=r<1?js(Pe(r*255)):"";return"#"+js(t)+js(e)+js(n)+i},SN=({r:t,g:e,b:n,a:r})=>{let i=Math.max(t,e,n),o=i-Math.min(t,e,n),s=o?i===t?(e-n)/o:i===e?2+(n-t)/o:4+(t-e)/o:0;return{h:Pe(60*(s<0?s+6:s)),s:Pe(i?o/i*100:0),v:Pe(i/255*100),a:r}};var Du=(t,e)=>{if(t===e)return!0;for(let n in t)if(t[n]!==e[n])return!1;return!0};var Fb=(t,e)=>t.toLowerCase()===e.toLowerCase()?!0:Du(Ys(t),Ys(e));var Hb={},Js=t=>{let e=Hb[t];return e||(e=document.createElement("template"),e.innerHTML=t,Hb[t]=e),e},Ji=(t,e,n)=>{t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:n}))};var ri=!1,Lu=t=>"touches"in t,xN=t=>ri&&!Lu(t)?!1:(ri||(ri=Lu(t)),!0),zb=(t,e)=>{let n=Lu(e)?e.touches[0]:e,r=t.el.getBoundingClientRect();Ji(t.el,"move",t.getMove({x:Dn((n.pageX-(r.left+window.pageXOffset))/r.width),y:Dn((n.pageY-(r.top+window.pageYOffset))/r.height)}))},kN=(t,e)=>{let n=e.keyCode;n>40||t.xy&&n<37||n<33||(e.preventDefault(),Ji(t.el,"move",t.getMove({x:n===39?.01:n===37?-.01:n===34?.05:n===33?-.05:n===35?1:n===36?-1:0,y:n===40?.01:n===38?-.01:0},!0)))},ii=class{constructor(e,n,r,i){let o=Js(`
`);e.appendChild(o.content.cloneNode(!0));let s=e.querySelector(`[part=${n}]`);s.addEventListener("mousedown",this),s.addEventListener("touchstart",this),s.addEventListener("keydown",this),this.el=s,this.xy=i,this.nodes=[s.firstChild,s]}set dragging(e){let n=e?document.addEventListener:document.removeEventListener;n(ri?"touchmove":"mousemove",this),n(ri?"touchend":"mouseup",this)}handleEvent(e){switch(e.type){case"mousedown":case"touchstart":if(e.preventDefault(),!xN(e)||!ri&&e.button!=0)return;this.el.focus(),zb(this,e),this.dragging=!0;break;case"mousemove":case"touchmove":e.preventDefault(),zb(this,e);break;case"mouseup":case"touchend":this.dragging=!1;break;case"keydown":kN(this,e);break}}style(e){e.forEach((n,r)=>{for(let i in n)this.nodes[r].style.setProperty(i,n[i])})}};var Xs=class extends ii{constructor(e){super(e,"hue",'aria-label="Hue" aria-valuemin="0" aria-valuemax="360"',!1)}update({h:e}){this.h=e,this.style([{left:`${e/360*100}%`,color:Yi({h:e,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuenow",`${Pe(e)}`)}getMove(e,n){return{h:n?Dn(this.h+e.x*360,0,360):360*e.x}}};var Zs=class extends ii{constructor(e){super(e,"saturation",'aria-label="Color"',!0)}update(e){this.hsva=e,this.style([{top:`${100-e.v}%`,left:`${e.s}%`,color:Yi(e)},{"background-color":Yi({h:e.h,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuetext",`Saturation ${Pe(e.s)}%, Brightness ${Pe(e.v)}%`)}getMove(e,n){return{s:n?Dn(this.hsva.s+e.x*100,0,100):e.x*100,v:n?Dn(this.hsva.v-e.y*100,0,100):Math.round(100-e.y*100)}}};var $b=':host{display:flex;flex-direction:column;position:relative;width:200px;height:200px;user-select:none;-webkit-user-select:none;cursor:default}:host([hidden]){display:none!important}[role=slider]{position:relative;touch-action:none;user-select:none;-webkit-user-select:none;outline:0}[role=slider]:last-child{border-radius:0 0 8px 8px}[part$=pointer]{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;display:flex;place-content:center center;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}[part$=pointer]::after{content:"";width:100%;height:100%;border-radius:inherit;background-color:currentColor}[role=slider]:focus [part$=pointer]{transform:translate(-50%,-50%) scale(1.1)}';var Ub="[part=hue]{flex:0 0 24px;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}[part=hue-pointer]{top:50%;z-index:2}";var Kb="[part=saturation]{flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part=saturation-pointer]{z-index:3}";var Qs=Symbol("same"),Pu=Symbol("color"),Wb=Symbol("hsva"),Bu=Symbol("update"),Vb=Symbol("parts"),Gb=Symbol("css"),qb=Symbol("sliders"),ea=class extends HTMLElement{static get observedAttributes(){return["color"]}get[Gb](){return[$b,Ub,Kb]}get[qb](){return[Zs,Xs]}get color(){return this[Pu]}set color(e){if(!this[Qs](e)){let n=this.colorModel.toHsva(e);this[Bu](n),this[Pu]=e}}constructor(){super();let e=Js(``),n=this.attachShadow({mode:"open"});n.appendChild(e.content.cloneNode(!0)),n.addEventListener("move",this),this[Vb]=this[qb].map(r=>new r(n))}connectedCallback(){if(this.hasOwnProperty("color")){let e=this.color;delete this.color,this.color=e}else this.color||(this.color=this.colorModel.defaultColor)}attributeChangedCallback(e,n,r){let i=this.colorModel.fromAttr(r);this[Qs](i)||(this.color=i)}handleEvent(e){let n=this[Wb],r={...n,...e.detail};this[Bu](r);let i;!Du(r,n)&&!this[Qs](i=this.colorModel.fromHsva(r))&&(this[Pu]=i,Ji(this,"color-changed",{value:i}))}[Qs](e){return this.color&&this.colorModel.equal(e,this.color)}[Bu](e){this[Wb]=e,this[Vb].forEach(n=>n.update(e))}};var MN={defaultColor:"#000",toHsva:Pb,fromHsva:({h:t,s:e,v:n})=>Bb({h:t,s:e,v:n,a:1}),equal:Fb,fromAttr:t=>t},ta=class extends ea{get colorModel(){return MN}};var Fu=class extends ta{};customElements.define("hex-color-picker",Fu);var NN={blockquote:[mp],bold:[gp],"bullet-list":[Ep],"checked-list":[tc],code:[wp],"code-block":[Vc.configure({lowlight:se,HTMLAttributes:{class:"hljs"}})],color:[Sp],details:[Rc,Ic,Dc],grid:[Tc,_c],"grid-builder":[yu,Eu],heading:[Cp.configure({levels:[1,2,3,4,5,6]})],highlight:[Mh],hr:[Pp],hurdle:[Gc],italic:[Bp],lead:[nc],link:[xc.configure({openOnClick:!1,autolink:!1,HTMLAttributes:{rel:null,hreflang:null,class:null}})],media:[kc.configure({inline:!0})],oembed:[Cc,Oc,Ac],"ordered-list":[zp],small:[Nc],strike:[$p],subscript:[Up],superscript:[Kp],table:[Eh.configure({resizable:!0}),vh,wh,Sh],underline:[kh]},TN=window.TiptapEditorExtensions||{},jb={...NN,...TN},na=document.getElementById("activeLocale");na&&na.addEventListener("change",()=>{let t=new CustomEvent("localeChange",{bubbles:!0,detail:{locale:na.value}});na.dispatchEvent(t)});function _N({state:t,statePath:e,tools:n=[],disabled:r=!1,locale:i="en",floatingMenuTools:o=[]}){let s=window.filamentTiptapEditors||{};return{id:null,tools:n,state:t,statePath:e,fullScreenMode:!1,updatedAt:Date.now(),focused:!1,locale:i,floatingMenuTools:o,getExtensions(a){let l=this.tools.map(u=>typeof u=="string"?u:u.id),c=[xp,xh,Mc,Mp,Tp,_p,Lp,vp];if(l.length){let u=Object.keys(jb),d=[],f=["paragraph"];c.push(Vi.configure({pluginKey:`defaultBubbleMenu${a}`,element:this.$refs.defaultBubbleMenu,tippyOptions:{duration:[500,0]},shouldShow:({state:p,from:h,to:g})=>!(h===g||Bt(p,"link")||Bt(p,"table")||Bt(p,"image")||Bt(p,"oembed")||Bt(p,"vimeo")||Bt(p,"youtube")||Bt(p,"video"))})),this.floatingMenuTools.length&&(c.push(bu.configure({pluginKey:`defaultFloatingMenu${a}`,element:this.$refs.defaultFloatingMenu,tippyOptions:{duration:[500,0]}})),this.floatingMenuTools.forEach(p=>{l.includes(p)||l.push(p)})),l.forEach(p=>{u.includes(p)?jb[p].forEach(h=>{["ordered-list","bullet-list","checked-list"].includes(p)?(c.push(h),c.includes(Ul)||c.push(Ul)):(p==="table"&&c.push(Vi.configure({pluginKey:`tableBubbleMenu${a}`,element:this.$refs.tableBubbleMenu,tippyOptions:{duration:[500,0]},shouldShow:({state:g})=>Bt(g,"table")})),p==="link"&&c.push(Vi.configure({pluginKey:`linkBubbleMenu${a}`,element:this.$refs.linkBubbleMenu,tippyOptions:{duration:[500,0]},shouldShow:({state:g})=>Bt(g,"link")})),c.push(h))}):["align-left","align-right","align-center","align-justify"].includes(p)&&(p==="align-left"&&d.push("start"),p==="align-center"&&d.push("center"),p==="align-right"&&d.push("end"),p==="align-justify"&&d.push("justify"),l.includes("heading")&&f.push("heading"),typeof c.find(g=>g.name==="textAlign")>"u"&&c.push(qc.configure({types:f,alignments:d})))})}return c},init(){this.initEditor(t.initialValue),window.filamentTiptapEditors=s,document.addEventListener("dblclick",function(l){(l.target&&(l.target.hasAttribute("data-youtube-video")||l.target.hasAttribute("data-vimeo-video"))||l.target.hasAttribute("data-native-video"))&&(l.target.firstChild.style.pointerEvents="all")}),window.addEventListener("localeChange",l=>{this.locale=l.detail.locale});let a=this.$el.parentElement.closest("[x-sortable]");a&&(window.Sortable.utils.on(a,"start",()=>{Object.values(s).forEach(function(l){l.setEditable(!1)})}),window.Sortable.utils.on(a,"end",()=>{Object.values(s).forEach(function(l){l.setEditable(!0)})})),this.$watch("state",l=>{l==="

"&&l!==this.editor().getHTML()&&(s[this.id].destroy(),this.initEditor(l)),this.state!==l&&this.updateEditorContent(l)}),this.$watch("locale",()=>{Livewire.hook("commit",({component:l,commit:c,respond:u,succeed:d,fail:f})=>{d(({snapshot:p,effect:h})=>{queueMicrotask(()=>{s[this.id].destroy(),this.initEditor(this.state)})})})})},editor(){return s[this.id]},initEditor(a){this.id=Xh(8);let l=this;s[this.id]=new Do({element:this.$refs.element,extensions:this.getExtensions(this.id),editable:!r,content:a,onUpdate({editor:c}){l.updatedAt=Date.now(),setTimeout(()=>{c.chain().focus()},500)},onSelectionUpdate(){l.updatedAt=Date.now()},onBlur(){l.updatedAt=Date.now(),l.focused=!1,l.state=l.editor().getHTML()},onFocus(){l.updatedAt=Date.now(),l.focused=!0}})},updateEditorContent(a){this.editor().commands.setContent(a)},refreshEditorContent(){this.$nextTick(()=>this.updateEditorContent(this.state))},insertMedia(a){Array.isArray(a)?a.forEach(l=>{this.executeMediaInsert(l)}):this.executeMediaInsert(a)},executeMediaInsert(a=null){if(!(!a||a?.url===null)&&a){let l=a?.url||a?.src,c=["jpg","jpeg","svg","png","webp"],d=/.*\.([a-zA-Z]*)\??/.exec(l);d!==null&&c.includes(d[1])?this.editor().chain().focus().setImage({src:l,alt:a?.alt,title:a?.title,width:a?.width,height:a?.height}).run():this.editor().chain().focus().extendMarkRange("link").setLink({href:l}).insertContent(a?.link_text).run()}},insertVideo(a){if(!a||a.url===null)return;let l={src:a.url,width:a.responsive?a.width*100:a.width,height:a.responsive?a.height*100:a.height,responsive:a.responsive??!0,"data-aspect-width":a.width,"data-aspect-height":a.height};a.url.includes("youtube")||a.url.includes("youtu.be")?this.editor().chain().focus().setYoutubeVideo({...l,controls:a.youtube_options.includes("controls"),nocookie:a.youtube_options.includes("nocookie"),start:a.start_at??0}).run():a.url.includes("vimeo")?this.editor().chain().focus().setVimeoVideo({...l,autoplay:a.vimeo_options.includes("autoplay"),loop:a.vimeo_options.includes("loop"),title:a.vimeo_options.includes("show_title"),byline:a.vimeo_options.includes("byline"),portrait:a.vimeo_options.includes("portrait")}).run():this.editor().chain().focus().setVideo({...l,autoplay:a.native_options.includes("autoplay"),loop:a.native_options.includes("loop"),controls:a.native_options.includes("controls")}).run()},insertLink(a){if(!(a.href===null&&a.id===null)){if(a.href===""&&a.id===null){this.unsetLink();return}this.editor().chain().focus().extendMarkRange("link").setLink({href:a.href,id:a.id??null,target:a.target??null,hreflang:a.hreflang??null,rel:a.rel??null,referrerpolicy:a.referrerpolicy??null,as_button:a.as_button??null,button_theme:a.button_theme??null}).selectTextblockEnd().run()}},insertSource(a){this.editor().commands.setContent(a,{emitUpdate:!0})},unsetLink(){this.editor().chain().focus().extendMarkRange("link").unsetLink().selectTextblockEnd().run()},insertGridBuilder(a){let l="responsive",c=parseInt(a.asymmetric_left)??null,u=parseInt(a.asymmetric_right)??null;a.fixed&&(l="fixed"),a.asymmetric&&(l="asymmetric"),this.editor().chain().focus().insertGridBuilder({cols:a.columns,type:l,stackAt:a.stack_at,asymmetricLeft:c,asymmetricRight:u}).run()}}}export{_N as default}; diff --git a/resources/conference/css/calendar/themes/dark.min.css b/resources/conference/css/calendar/themes/dark.min.css deleted file mode 100644 index 3fe372079..000000000 --- a/resources/conference/css/calendar/themes/dark.min.css +++ /dev/null @@ -1,271 +0,0 @@ -[data-calendar-theme="dark"].vanilla-calendar { - @apply bg-slate-900 -} - -[data-calendar-theme="dark"].vanilla-calendar button:focus-visible { - @apply outline-orange-300 -} - -[data-calendar-theme="dark"].vanilla-calendar.vanilla-calendar_multiple .vanilla-calendar-month, -[data-calendar-theme="dark"].vanilla-calendar.vanilla-calendar_multiple .vanilla-calendar-year { - @apply text-white hover:text-white -} - -[data-calendar-theme="dark"].vanilla-calendar.vanilla-calendar_multiple .vanilla-calendar-month.vanilla-calendar-month_disabled, -[data-calendar-theme="dark"].vanilla-calendar.vanilla-calendar_multiple .vanilla-calendar-year.vanilla-calendar-year_disabled { - @apply text-white -} - -[data-calendar-theme="dark"] .vanilla-calendar-arrow::before { - @apply bg-white; -} - -[data-calendar-theme="dark"] .vanilla-calendar-arrow:hover::before { - @apply bg-slate-500 -} - -[data-calendar-theme="dark"] .vanilla-calendar-header__content { - @apply text-white; -} - -[data-calendar-theme="dark"] .vanilla-calendar-month, -[data-calendar-theme="dark"] .vanilla-calendar-year { - @apply text-white hover:text-slate-500 -} - -[data-calendar-theme="dark"] .vanilla-calendar-month.vanilla-calendar-month_not-active, -[data-calendar-theme="dark"] .vanilla-calendar-year.vanilla-calendar-year_not-active { - @apply text-slate-500 -} - -[data-calendar-theme="dark"] .vanilla-calendar-month.vanilla-calendar-month_disabled, -[data-calendar-theme="dark"] .vanilla-calendar-year.vanilla-calendar-year_disabled { - @apply text-slate-700 opacity-80 -} - -[data-calendar-theme="dark"] .vanilla-calendar-months__month, -[data-calendar-theme="dark"] .vanilla-calendar-years__year { - @apply bg-slate-900 text-white hover:bg-slate-800 -} - -[data-calendar-theme="dark"] .vanilla-calendar-months__month.vanilla-calendar-months__month_selected, -[data-calendar-theme="dark"] .vanilla-calendar-years__year.vanilla-calendar-years__year_selected { - @apply bg-slate-500 text-white hover:bg-slate-500 hover:text-white -} - -[data-calendar-theme="dark"] .vanilla-calendar-months__month.vanilla-calendar-months__month_disabled, -[data-calendar-theme="dark"] .vanilla-calendar-years__year.vanilla-calendar-years__year_disabled { - @apply text-slate-700 opacity-80 hover:text-slate-700 -} - -[data-calendar-theme="dark"] .vanilla-calendar-week-numbers__title { - @apply text-white -} - -[data-calendar-theme="dark"] .vanilla-calendar-week-number { - @apply text-white hover:text-slate-300 -} - -[data-calendar-theme="dark"] .vanilla-calendar-week__day { - @apply text-white -} - -[data-calendar-theme="dark"] .vanilla-calendar-week__day_weekend { - @apply text-rose-500 -} - -[data-calendar-theme="dark"] .vanilla-calendar-day__btn { - @apply text-slate-400 bg-slate-900 hover:bg-slate-800 hover:text-slate-200 -} - -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_today { - @apply text-cyan-500 hover:text-cyan-500 bg-slate-800 -} - -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_today.vanilla-calendar-day__btn_prev, -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_today.vanilla-calendar-day__btn_next { - @apply text-slate-600 -} - -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_prev, -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_next { - @apply text-slate-600 -} - -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_disabled { - @apply text-slate-700 opacity-80 -} - -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_hover { - @apply bg-slate-800 -} - -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_weekend, -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_holiday { - @apply text-rose-500 hover:bg-slate-800 hover:text-rose-500 -} - -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_hover, -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_hover { - @apply bg-slate-800 text-rose-500 -} - -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_disabled, -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_disabled { - @apply text-slate-700 opacity-80 -} - -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_today, -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_today { - @apply text-rose-500 -} - -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_today.vanilla-calendar-day__btn_disabled, -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_today.vanilla-calendar-day__btn_disabled { - @apply text-slate-700 -} - -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_prev, -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_prev, -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_next, -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_next { - @apply bg-slate-900 text-slate-600 hover:bg-slate-800 hover:text-slate-300 -} - -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_prev.vanilla-calendar-day__btn_hover, -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_prev.vanilla-calendar-day__btn_hover, -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_next.vanilla-calendar-day__btn_hover, -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_next.vanilla-calendar-day__btn_hover { - @apply bg-slate-800 -} - -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_prev.vanilla-calendar-day__btn_today, -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_prev.vanilla-calendar-day__btn_today, -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_next.vanilla-calendar-day__btn_today, -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_next.vanilla-calendar-day__btn_today { - @apply text-slate-400 -} - -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_prev.vanilla-calendar-day__btn_disabled, -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_prev.vanilla-calendar-day__btn_disabled, -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_next.vanilla-calendar-day__btn_disabled, -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_next.vanilla-calendar-day__btn_disabled { - @apply text-slate-700 opacity-80 -} - -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_selected, -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_selected { - @apply bg-rose-500 text-white hover:bg-rose-500 hover:text-white -} - -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_selected.vanilla-calendar-day__btn_intermediate, -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_selected.vanilla-calendar-day__btn_intermediate { - @apply bg-rose-500 bg-opacity-80 text-white hover:bg-rose-500 hover:bg-opacity-80 hover:text-white -} - -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_prev.vanilla-calendar-day__btn_selected, -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_prev.vanilla-calendar-day__btn_selected, -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_next.vanilla-calendar-day__btn_selected, -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_next.vanilla-calendar-day__btn_selected { - @apply bg-slate-700 text-slate-300 hover:bg-slate-700 hover:text-slate-300 -} - -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_prev.vanilla-calendar-day__btn_selected.vanilla-calendar-day__btn_intermediate, -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_prev.vanilla-calendar-day__btn_selected.vanilla-calendar-day__btn_intermediate, -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_next.vanilla-calendar-day__btn_selected.vanilla-calendar-day__btn_intermediate, -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_next.vanilla-calendar-day__btn_selected.vanilla-calendar-day__btn_intermediate { - @apply bg-slate-800 text-slate-300 hover:bg-slate-800 hover:text-slate-300 -} - -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_selected { - @apply bg-cyan-500 text-white hover:bg-cyan-500 hover:text-white -} - -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_selected.vanilla-calendar-day__btn_intermediate { - @apply bg-cyan-500 bg-opacity-80 text-white hover:bg-cyan-500 hover:bg-opacity-80 hover:text-white -} - -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_selected.vanilla-calendar-day__btn_prev, -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_selected.vanilla-calendar-day__btn_next { - @apply bg-slate-700 text-slate-300 hover:bg-slate-700 hover:text-slate-300 -} - -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_selected.vanilla-calendar-day__btn_prev.vanilla-calendar-day__btn_intermediate, -[data-calendar-theme="dark"] .vanilla-calendar-day__btn_selected.vanilla-calendar-day__btn_next.vanilla-calendar-day__btn_intermediate { - @apply bg-slate-800 text-slate-300 hover:bg-slate-800 hover:text-slate-300 -} - -[data-calendar-theme="dark"] .vanilla-calendar-day__popup { - @apply text-white -} - -[data-calendar-theme="dark"] .vanilla-calendar-day__popup::before { - @apply bg-slate-900 shadow-[inset_0_0_0_1px_rgb(255_255_255_/_0.1)] -} - -[data-calendar-theme="dark"] .vanilla-calendar-day__popup::after { - @apply border-b-slate-700 -} - -[data-calendar-theme="dark"] .vanilla-calendar-time { - @apply border-slate-800 -} - -[data-calendar-theme="dark"] .vanilla-calendar-time__hours { - @apply after:text-white -} - -[data-calendar-theme="dark"] .vanilla-calendar-time__hours input, -[data-calendar-theme="dark"] .vanilla-calendar-time__minutes input { - @apply text-white bg-slate-900 hover:bg-slate-700 focus-visible:outline-orange-300 -} - -[data-calendar-theme="dark"] .vanilla-calendar-time__hours input.vanilla-calendar-is-focus, -[data-calendar-theme="dark"] .vanilla-calendar-time__minutes input.vanilla-calendar-is-focus { - @apply bg-slate-700 -} - -[data-calendar-theme="dark"] .vanilla-calendar-time__keeping { - @apply text-slate-500 hover:bg-slate-700 hover:text-slate-400 focus-visible:outline-orange-300 -} - -[data-calendar-theme="dark"] .vanilla-calendar-time__range input { - @apply bg-slate-900 -} - -[data-calendar-theme="dark"] .vanilla-calendar-time__range::before, -[data-calendar-theme="dark"] .vanilla-calendar-time__range::after { - @apply bg-slate-600 -} - -[data-calendar-theme="dark"] .vanilla-calendar-time__range:hover input::-webkit-slider-thumb { - @apply border-slate-400 -} - -[data-calendar-theme="dark"] .vanilla-calendar-time__range:hover input::-moz-range-thumb { - @apply border-slate-400 -} - -[data-calendar-theme="dark"] .vanilla-calendar-time__range input:focus-visible::-webkit-slider-thumb { - @apply border-orange-300 -} - -[data-calendar-theme="dark"] .vanilla-calendar-time__range input:focus-visible::-moz-range-thumb { - @apply border-orange-300 -} - -[data-calendar-theme="dark"] .vanilla-calendar-time__range input::-webkit-slider-thumb { - @apply border-slate-600 bg-slate-800 -} - -[data-calendar-theme="dark"] .vanilla-calendar-time__range input::-moz-range-thumb { - @apply border-slate-600 bg-slate-800 -} - -[data-calendar-theme="dark"] .vanilla-calendar-time__range input::-webkit-slider-runnable-track { - @apply bg-slate-600 -} - -[data-calendar-theme="dark"] .vanilla-calendar-time__range input::-moz-range-track { - @apply bg-slate-600 -} diff --git a/resources/views/conference/blocks/calendar-block.blade.php b/resources/views/conference/blocks/calendar-block.blade.php index aff0109ea..0e5dba0df 100644 --- a/resources/views/conference/blocks/calendar-block.blade.php +++ b/resources/views/conference/blocks/calendar-block.blade.php @@ -1,12 +1,6 @@ -
-
-
-
+
+
-
- @once - - @endonce
+ + diff --git a/resources/views/conference/blocks/committe-block.blade.php b/resources/views/conference/blocks/committe-block.blade.php new file mode 100644 index 000000000..7dc870389 --- /dev/null +++ b/resources/views/conference/blocks/committe-block.blade.php @@ -0,0 +1,50 @@ +
+ + @if (count($participants) > 0) +

Committee

+ @foreach ($participants as $participant) + +
+
+ +
+ +
+ @if ($participant->hasMedia('profile')) + +
+
+ {{ $participant->fullName }} +
+
+ @endif +
+

{{ $participant->fullName }}

+ + @if ($participant->hasMeta('affiliation')) + + {{ $participant->getMeta('affiliation') }} + + @endif +
+
+ @if ($participant->hasMeta('expertise')) + +
+ @foreach ($participant->getMeta('expertise') as $expertise) + +
+ {{ $expertise }}
+ @endforeach +
+ @endif +
+
+
+ @endforeach + @endif +
+ More +
+
diff --git a/resources/views/website/blocks/menu-block.blade.php b/resources/views/conference/blocks/menu-block.blade.php similarity index 78% rename from resources/views/website/blocks/menu-block.blade.php rename to resources/views/conference/blocks/menu-block.blade.php index 416e0acf2..48863f4c9 100644 --- a/resources/views/website/blocks/menu-block.blade.php +++ b/resources/views/conference/blocks/menu-block.blade.php @@ -13,14 +13,15 @@ - {{ $content->title }}
- {{--
-
-
-
--}} +
+
+
+
@endforeach diff --git a/resources/views/conference/blocks/previous-block.blade.php b/resources/views/conference/blocks/previous-block.blade.php new file mode 100644 index 000000000..20478ee02 --- /dev/null +++ b/resources/views/conference/blocks/previous-block.blade.php @@ -0,0 +1,22 @@ +
+ @forelse ($archives as $archive) +

Previous Event

+
+
+ {{ $archive->name }} +
+ @if ($archive->hasMeta('date_held')) + + @endif + + + +
+
+
+ @empty + + @endforelse +
diff --git a/resources/views/website/blocks/submit-block.blade.php b/resources/views/conference/blocks/submit-block.blade.php similarity index 91% rename from resources/views/website/blocks/submit-block.blade.php rename to resources/views/conference/blocks/submit-block.blade.php index 69f7f5072..0a070de09 100644 --- a/resources/views/website/blocks/submit-block.blade.php +++ b/resources/views/conference/blocks/submit-block.blade.php @@ -2,7 +2,7 @@
-

Submit Now

+

Submit Now

diff --git a/resources/views/conference/blocks/timeline-block.blade.php b/resources/views/conference/blocks/timeline-block.blade.php index 48827f39e..05d899a42 100644 --- a/resources/views/conference/blocks/timeline-block.blade.php +++ b/resources/views/conference/blocks/timeline-block.blade.php @@ -8,12 +8,12 @@ $timelineMarker = ''; // Check if it's yesterday - if ($timeline->date <= now()->subDay()) { - // Set background and marker for past timeline - $timelineBackground = 'past-timeline'; - $timelineMarker = 'past-timeline-marker'; - } - // Check if it's today + if ($timeline->date <= now()->subDay()) { + // Set background and marker for past timeline + $timelineBackground = 'past-timeline'; + $timelineMarker = 'past-timeline-marker'; + } + // Check if it's today elseif ($timeline->date->isToday()) { // Set background and marker for current timeline $timelineBackground = 'current-timeline'; @@ -33,33 +33,41 @@
- @if (count($timeline->roles) > 0) - @foreach ($timeline->roles as $role) - @php - $badgeRole = ''; - $badgeRole = match ($role) { - 'Author' => 'author-badge', - 'Editor' => 'editor-badge', - 'Reviewer' => 'reviewer-badge', - 'Participant' => 'participant-badge', - default => '', - }; + @foreach ($timeline->roles as $key => $role) + @php + $countRole = count($timeline->roles); + $badgeRole = ''; + $badgeRole = match ($role) { + 'Author' => 'author-badge', + 'Editor' => 'editor-badge', + 'Reviewer' => 'reviewer-badge', + 'Participant' => 'participant-badge', + default => 'participant-badge', + }; - @endphp -
+ @endphp + @if ($key < 1) +
{{ $role }} + @if (count($timeline->roles) > 1) + +{{ $countRole - 1 }} more... + @endif
- @endforeach - @endif + @endif + @endforeach
-
{{ $timeline->title }}
+
{{ Str::words($timeline->title, 3, '...') }}
{{ $timeline->subtitle ?? '' }}
@endforeach @endif +
+ More +
diff --git a/resources/views/conference/pages/committe.blade.php b/resources/views/conference/pages/committe.blade.php new file mode 100644 index 000000000..476a130e9 --- /dev/null +++ b/resources/views/conference/pages/committe.blade.php @@ -0,0 +1,75 @@ +
+
+

Commitee List

+
+
+ @forelse ($groupedCommittes as $positionName => $members) +
+

{{ $positionName }}

+ @forelse ($members as $member) +
+
+ @if ($member->hasMedia('profile')) +
+
+ +
+
+ @endif +
+

{{ $member->fullName }}

+
+ @if ($member->hasMeta('affiliation')) +
+ +

{{ $member->getMeta('affiliation') }}

+
+ @endif +
+ +

{{ $member->email ?? '' }}

+
+
+ + @forelse ($member->getMeta('expertise') as $expertise) + {{ $expertise }} + @empty + @endforelse +
+ +
+ @if ($member->hasMeta('orcid_id')) + + + @endif + + @if ($member->hasMeta('google_scholar_id')) + + + + @endif + + @if ($member->hasMeta('scopus_id')) + + + @endif +
+
+
+
+
+ @empty + @endforelse +
+ + @empty + + @endforelse +
+
+ +
+
diff --git a/resources/views/conference/pages/timeline.blade.php b/resources/views/conference/pages/timeline.blade.php new file mode 100644 index 000000000..be64abe86 --- /dev/null +++ b/resources/views/conference/pages/timeline.blade.php @@ -0,0 +1,47 @@ + +
+
+
+
+

Event

+
+
+ +
    + @forelse ($events as $event) +
  1. +
    +
    +
    +

    {{ $event->title }}

    +
    +

    + {{ date(setting('format.date'), strtotime($event->date)) }} +

    + + +
    + @foreach ($event->roles as $role) + @php + $badgeRole = ''; + $badgeRole = match ($role) { + 'Author' => 'author-badge', + 'Editor' => 'editor-badge', + 'Reviewer' => 'reviewer-badge', + 'Participant' => 'participant-badge', + default => 'participant-badge', + }; + @endphp +
    {{ $role }}
    + @endforeach +
    +
  2. + @empty + @endforelse +
+
+
+ +
+
diff --git a/resources/views/website/blocks/editorial-block.blade.php b/resources/views/website/blocks/editorial-block.blade.php deleted file mode 100644 index 082119fd4..000000000 --- a/resources/views/website/blocks/editorial-block.blade.php +++ /dev/null @@ -1,56 +0,0 @@ -
-

Editorial Board

-
-
-
-
-
-
- -
-
- -
-

Dr Simon Laur

- Universitas Indonesia -
-
- -
-
Machine Learning
-
Artificial Intelegence
-
Bussiness Analysis
-
Financial Analysis
-
-
-
-
- -
-
-
-
-
-
- -
-
- -
-

Dr Simon Laur

- Universitas Indonesia -
-
- -
-
Machine Learning
-
Artificial Intelegence
-
Bussiness Analysis
-
Financial Analysis
-
-
-
-
-
diff --git a/resources/views/website/components/layouts/leftbar.blade.php b/resources/views/website/components/layouts/leftbar.blade.php index 88180f970..5a49b826d 100644 --- a/resources/views/website/components/layouts/leftbar.blade.php +++ b/resources/views/website/components/layouts/leftbar.blade.php @@ -1,5 +1,5 @@
-
+
@foreach(\App\Facades\Block::getBlocks(position: 'left') as $block) @livewire($block) @endforeach diff --git a/resources/views/website/components/layouts/rightbar.blade.php b/resources/views/website/components/layouts/rightbar.blade.php index 1173b1035..2a209644f 100644 --- a/resources/views/website/components/layouts/rightbar.blade.php +++ b/resources/views/website/components/layouts/rightbar.blade.php @@ -1,5 +1,5 @@
-
+
@foreach(\App\Facades\Block::getBlocks(position: 'right') as $block) @livewire($block) @endforeach diff --git a/resources/conference/css/calendar/themes/light.min.css b/resources/website/css/calendar/themes/light.css similarity index 99% rename from resources/conference/css/calendar/themes/light.min.css rename to resources/website/css/calendar/themes/light.css index a362c22ab..ad0438946 100644 --- a/resources/conference/css/calendar/themes/light.min.css +++ b/resources/website/css/calendar/themes/light.css @@ -1,3 +1,4 @@ + [data-calendar-theme="light"].vanilla-calendar { @apply bg-white } diff --git a/resources/website/css/calendar/themes/light.min.css b/resources/website/css/calendar/themes/light.min.css deleted file mode 100644 index a362c22ab..000000000 --- a/resources/website/css/calendar/themes/light.min.css +++ /dev/null @@ -1,280 +0,0 @@ -[data-calendar-theme="light"].vanilla-calendar { - @apply bg-white -} - -[data-calendar-theme="light"].vanilla-calendar button:focus-visible { - @apply outline-orange-300 -} - -[data-calendar-theme="light"].vanilla-calendar.vanilla-calendar_multiple .vanilla-calendar-month, -[data-calendar-theme="light"].vanilla-calendar.vanilla-calendar_multiple .vanilla-calendar-year { - @apply text-slate-900 hover:text-slate-900 -} - -[data-calendar-theme="light"].vanilla-calendar.vanilla-calendar_multiple .vanilla-calendar-month.vanilla-calendar-month_disabled, -[data-calendar-theme="light"].vanilla-calendar.vanilla-calendar_multiple .vanilla-calendar-year.vanilla-calendar-year_disabled { - @apply text-slate-900 -} - -[data-calendar-theme="light"] .vanilla-calendar-arrow::before { - @apply bg-slate-900; -} - -[data-calendar-theme="light"] .vanilla-calendar-arrow:hover::before { - @apply bg-slate-500 -} - -[data-calendar-theme="light"] .vanilla-calendar-header__content { - @apply text-slate-900 -} - -[data-calendar-theme="light"] .vanilla-calendar-month, -[data-calendar-theme="light"] .vanilla-calendar-year { - @apply hover:text-slate-500 -} - -[data-calendar-theme="light"] .vanilla-calendar-month.vanilla-calendar-month_not-active, -[data-calendar-theme="light"] .vanilla-calendar-year.vanilla-calendar-year_not-active { - @apply text-slate-400 -} - -[data-calendar-theme="light"] .vanilla-calendar-month.vanilla-calendar-month_disabled, -[data-calendar-theme="light"] .vanilla-calendar-year.vanilla-calendar-year_disabled { - @apply text-slate-300 -} - -[data-calendar-theme="light"] .vanilla-calendar-months__month { - @apply bg-white text-slate-500 hover:bg-slate-100 -} - -[data-calendar-theme="light"] .vanilla-calendar-months__month.vanilla-calendar-months__month_selected { - @apply bg-cyan-500 text-white hover:bg-cyan-500 hover:text-white -} - -[data-calendar-theme="light"] .vanilla-calendar-months__month.vanilla-calendar-months__month_disabled { - @apply text-slate-300 hover:text-slate-300 -} - -[data-calendar-theme="light"] .vanilla-calendar-years__year { - @apply bg-white text-slate-500 hover:bg-slate-100 -} - -[data-calendar-theme="light"] .vanilla-calendar-years__year.vanilla-calendar-years__year_selected { - @apply bg-cyan-500 text-white hover:bg-cyan-500 hover:text-white -} - -[data-calendar-theme="light"] .vanilla-calendar-years__year.vanilla-calendar-years__year_disabled { - @apply text-slate-300 hover:text-slate-300 -} - -[data-calendar-theme="light"] .vanilla-calendar-week-numbers__title { - @apply text-slate-500 -} - -[data-calendar-theme="light"] .vanilla-calendar-week-number { - @apply text-slate-500 hover:text-slate-600 -} - -[data-calendar-theme="light"] .vanilla-calendar-week__day { - @apply text-[#38BDF8] -} - -[data-calendar-theme="light"] .vanilla-calendar-week__day_weekend { - @apply text-[#38BDF8] -} - -[data-calendar-theme="light"] .vanilla-calendar-day__btn { - @apply text-[#38BDF8] bg-white hover:bg-slate-100 -} - -[data-calendar-theme="light"] .vanilla-calendar-day__btn_today { - @apply text-white bg-[#38BDF8] hover:text-gray-700 -} - -[data-calendar-theme="light"] .vanilla-calendar-day__btn_today.vanilla-calendar-day__btn_prev, -[data-calendar-theme="light"] .vanilla-calendar-day__btn_today.vanilla-calendar-day__btn_next { - @apply text-slate-500 -} - -[data-calendar-theme="light"] .vanilla-calendar-day__btn_prev, -[data-calendar-theme="light"] .vanilla-calendar-day__btn_next { - @apply text-slate-400 -} - -[data-calendar-theme="light"] .vanilla-calendar-day__btn_disabled { - @apply text-slate-300 -} - -[data-calendar-theme="light"] .vanilla-calendar-day__btn_hover { - @apply bg-slate-100 -} - -[data-calendar-theme="light"] .vanilla-calendar-day__btn_weekend, -[data-calendar-theme="light"] .vanilla-calendar-day__btn_holiday { - @apply text-[#38BDF8] hover:bg-rose-50 -} - -[data-calendar-theme="light"] .vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_hover, -[data-calendar-theme="light"] .vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_hover { - @apply bg-rose-50 -} - -[data-calendar-theme="light"] .vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_disabled, -[data-calendar-theme="light"] .vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_disabled { - @apply text-slate-300 -} - -[data-calendar-theme="light"] .vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_today, -[data-calendar-theme="light"] .vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_today { - @apply text-white -} - -[data-calendar-theme="light"] .vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_today.vanilla-calendar-day__btn_disabled, -[data-calendar-theme="light"] .vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_today.vanilla-calendar-day__btn_disabled { - @apply text-slate-300 -} - -[data-calendar-theme="light"] .vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_prev, -[data-calendar-theme="light"] .vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_prev, -[data-calendar-theme="light"] .vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_next, -[data-calendar-theme="light"] .vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_next { - @apply bg-white text-slate-400 hover:bg-slate-100 -} - -[data-calendar-theme="light"] .vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_prev.vanilla-calendar-day__btn_hover, -[data-calendar-theme="light"] .vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_prev.vanilla-calendar-day__btn_hover, -[data-calendar-theme="light"] .vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_next.vanilla-calendar-day__btn_hover, -[data-calendar-theme="light"] .vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_next.vanilla-calendar-day__btn_hover { - @apply bg-slate-100 -} - -[data-calendar-theme="light"] .vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_prev.vanilla-calendar-day__btn_today, -[data-calendar-theme="light"] .vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_prev.vanilla-calendar-day__btn_today, -[data-calendar-theme="light"] .vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_next.vanilla-calendar-day__btn_today, -[data-calendar-theme="light"] .vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_next.vanilla-calendar-day__btn_today { - @apply text-slate-400 -} - -[data-calendar-theme="light"] .vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_prev.vanilla-calendar-day__btn_disabled, -[data-calendar-theme="light"] .vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_prev.vanilla-calendar-day__btn_disabled, -[data-calendar-theme="light"] .vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_next.vanilla-calendar-day__btn_disabled, -[data-calendar-theme="light"] .vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_next.vanilla-calendar-day__btn_disabled { - @apply text-slate-300 -} - -[data-calendar-theme="light"] .vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_selected, -[data-calendar-theme="light"] .vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_selected { - @apply bg-rose-500 text-white hover:bg-rose-500 hover:text-white -} - -[data-calendar-theme="light"] .vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_selected.vanilla-calendar-day__btn_intermediate, -[data-calendar-theme="light"] .vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_selected.vanilla-calendar-day__btn_intermediate { - @apply bg-rose-500 bg-opacity-70 text-white hover:bg-rose-500 hover:bg-opacity-70 hover:text-white -} - -[data-calendar-theme="light"] .vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_prev.vanilla-calendar-day__btn_selected, -[data-calendar-theme="light"] .vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_prev.vanilla-calendar-day__btn_selected, -[data-calendar-theme="light"] .vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_next.vanilla-calendar-day__btn_selected, -[data-calendar-theme="light"] .vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_next.vanilla-calendar-day__btn_selected { - @apply bg-slate-300 text-slate-500 hover:bg-slate-300 hover:text-slate-500 -} - -[data-calendar-theme="light"] .vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_prev.vanilla-calendar-day__btn_selected.vanilla-calendar-day__btn_intermediate, -[data-calendar-theme="light"] .vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_prev.vanilla-calendar-day__btn_selected.vanilla-calendar-day__btn_intermediate, -[data-calendar-theme="light"] .vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_next.vanilla-calendar-day__btn_selected.vanilla-calendar-day__btn_intermediate, -[data-calendar-theme="light"] .vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_next.vanilla-calendar-day__btn_selected.vanilla-calendar-day__btn_intermediate { - @apply bg-slate-200 text-slate-500 hover:bg-slate-200 hover:text-slate-500 -} - -[data-calendar-theme="light"] .vanilla-calendar-day__btn_selected { - @apply bg-cyan-500 text-white hover:bg-cyan-500 hover:text-white -} - -[data-calendar-theme="light"] .vanilla-calendar-day__btn_selected.vanilla-calendar-day__btn_intermediate { - @apply bg-cyan-500 bg-opacity-70 text-white hover:bg-cyan-500 hover:bg-opacity-70 hover:text-white -} - -[data-calendar-theme="light"] .vanilla-calendar-day__btn_selected.vanilla-calendar-day__btn_prev, -[data-calendar-theme="light"] .vanilla-calendar-day__btn_selected.vanilla-calendar-day__btn_next { - @apply bg-slate-300 text-slate-500 hover:bg-slate-300 hover:text-slate-500 -} - -[data-calendar-theme="light"] .vanilla-calendar-day__btn_selected.vanilla-calendar-day__btn_prev.vanilla-calendar-day__btn_intermediate, -[data-calendar-theme="light"] .vanilla-calendar-day__btn_selected.vanilla-calendar-day__btn_next.vanilla-calendar-day__btn_intermediate { - @apply bg-slate-200 text-slate-500 hover:bg-slate-200 hover:text-slate-500 -} - -[data-calendar-theme="light"] .vanilla-calendar-day__popup { - @apply text-slate-900 -} - -[data-calendar-theme="light"] .vanilla-calendar-day__popup::before { - @apply bg-white shadow-[0_3px_15px_rgba(85,_85,_85,_0.2)] -} - -[data-calendar-theme="light"] .vanilla-calendar-day__popup::after { - @apply border-b-white -} - -[data-calendar-theme="light"] .vanilla-calendar-time { - @apply border-slate-300 -} - -[data-calendar-theme="light"] .vanilla-calendar-time__hours { - @apply after:text-slate-900 -} - -[data-calendar-theme="light"] .vanilla-calendar-time__hours input, -[data-calendar-theme="light"] .vanilla-calendar-time__minutes input { - @apply text-slate-900 bg-white hover:bg-orange-100 focus-visible:outline-orange-300 -} - -[data-calendar-theme="light"] .vanilla-calendar-time__hours input.vanilla-calendar-is-focus, -[data-calendar-theme="light"] .vanilla-calendar-time__minutes input.vanilla-calendar-is-focus { - @apply bg-orange-100 -} - -[data-calendar-theme="light"] .vanilla-calendar-time__keeping { - @apply text-slate-500 hover:bg-orange-100 focus-visible:outline-orange-300 -} - -[data-calendar-theme="light"] .vanilla-calendar-time__range input { - @apply bg-white -} - -[data-calendar-theme="light"] .vanilla-calendar-time__range::before, -[data-calendar-theme="light"] .vanilla-calendar-time__range::after { - @apply bg-slate-300 -} - -[data-calendar-theme="light"] .vanilla-calendar-time__range:hover input::-webkit-slider-thumb { - @apply border-slate-400 -} - -[data-calendar-theme="light"] .vanilla-calendar-time__range:hover input::-moz-range-thumb { - @apply border-slate-400 -} - -[data-calendar-theme="light"] .vanilla-calendar-time__range input:focus-visible::-webkit-slider-thumb { - @apply border-orange-300 -} - -[data-calendar-theme="light"] .vanilla-calendar-time__range input:focus-visible::-moz-range-thumb { - @apply border-orange-300 -} - -[data-calendar-theme="light"] .vanilla-calendar-time__range input::-webkit-slider-thumb { - @apply border-slate-300 bg-white -} - -[data-calendar-theme="light"] .vanilla-calendar-time__range input::-moz-range-thumb { - @apply border-slate-300 bg-white -} - -[data-calendar-theme="light"] .vanilla-calendar-time__range input::-webkit-slider-runnable-track { - @apply bg-slate-300 -} - -[data-calendar-theme="light"] .vanilla-calendar-time__range input::-moz-range-track { - @apply bg-slate-300 -} diff --git a/resources/website/css/calendar/vanila-calendar-min.css b/resources/website/css/calendar/vanila-calendar-min.css deleted file mode 100644 index 01b0f4d75..000000000 --- a/resources/website/css/calendar/vanila-calendar-min.css +++ /dev/null @@ -1,950 +0,0 @@ -/*! name: @uvarov.frontend/vanilla-calendar | url: https://github.com/uvarov-frontend/vanilla-calendar */ -.vanilla-calendar { - margin-top: -14px; - margin-left: -16px; - width: 310px; - position: relative; - min-width: -webkit-min-content; - min-width: min-content; - display: grid; - grid-gap: 12px; - gap: 12px; - grid-template-columns: 1fr; - background-color: #fff; - padding: 16px; - border-radius: 4px -} - -.vanilla-calendar_multiple .vanilla-calendar-month { - color: #000; - cursor: default -} - -.vanilla-calendar_multiple .vanilla-calendar-month:hover { - color: #000 -} - -.vanilla-calendar_multiple .vanilla-calendar-month_disabled { - color: #000; - pointer-events: auto -} - -.vanilla-calendar_multiple .vanilla-calendar-year { - color: #000; - cursor: default -} - -.vanilla-calendar_multiple .vanilla-calendar-year:hover { - color: #000 -} - -.vanilla-calendar_multiple .vanilla-calendar-year_disabled { - color: #000; - pointer-events: auto -} - -.vanilla-calendar button.focus-visible { - outline: 1px solid #ff8c00 -} - -.vanilla-calendar button:focus-visible { - outline: 1px solid #ff8c00 -} - -.vanilla-calendar-controls { - position: absolute; - z-index: 2; - left: 0; - right: 0; - display: flex; - justify-content: space-between; - align-items: center; - padding: 15px 12px; - pointer-events: none -} - -.vanilla-calendar-grid { - display: grid; - grid-auto-flow: column; - grid-gap: 30px; - gap: 30px -} - -.vanilla-calendar-column { - min-width: -webkit-min-content; - min-width: min-content; - display: grid; - grid-gap: 12px; - gap: 12px; - grid-template-columns: 1fr -} - -.vanilla-calendar-header { - position: relative; - margin-top: 4px; - display: flex; - padding-top: 16px; -} - -.vanilla-calendar-header__content { - flex-grow: 1; - display: grid; - grid-auto-flow: column; - grid-auto-columns: -webkit-max-content; - grid-auto-columns: max-content; - white-space: pre-wrap -} - -.vanilla-calendar-week-numbers { - display: flex; - flex-direction: column; - align-items: center -} - -.vanilla-calendar-week-numbers__title { - font-size: 12px; - line-height: 16px; - font-weight: 700; - color: #20b2aa; - width: 28px; - height: 18px; - margin-bottom: 5px; - display: flex; - align-items: center; - justify-content: center -} - -.vanilla-calendar-week-numbers__content { - display: grid; - grid-auto-flow: row; - align-items: center; - justify-items: center; - flex-grow: 1 -} - -.vanilla-calendar-wrapper { - height: 200px; - display: flex; - gap: 2px -} - -.vanilla-calendar-content { - display: flex; - flex-direction: column; - flex-grow: 1 -} - -.vanilla-calendar-arrow { - margin-top: -25px; - position: relative; - pointer-events: auto; - right: 2px; - display: block; - font-size: 0; - width: 18px; - height: 18px; - padding: 2px; - background-color: rgba(0, 0, 0, 0); - cursor: pointer; - border-radius: 4px; - border: 0 -} - -.vanilla-calendar-arrow::before { - content: ""; - position: absolute; - left: 5px; - top: 5px; - width: 10px; - height: 1px; - background-color: #000; - -webkit-transform: rotateZ(45deg); - transform: rotateZ(45deg) -} - -.vanilla-calendar-arrow::after { - content: ""; - position: absolute; - left: 5px; - bottom: 5px; - width: 10px; - height: 1px; - background-color: #000; - -webkit-transform: rotateZ(-45deg); - transform: rotateZ(-45deg) -} - -.vanilla-calendar-arrow:hover::before, -.vanilla-calendar-arrow:hover::after { - background-color: #20b2aa -} - -.vanilla-calendar-arrow_prev { - right: 0; - left: 4px; - -webkit-transform: rotateZ(180deg); - transform: rotateZ(180deg) -} - -.vanilla-calendar-months { - margin-top: -25px; - border-radius: 4px; - display: grid; - grid-column-gap: 6px; - -webkit-column-gap: 6px; - column-gap: 6px; - grid-row-gap: 12px; - row-gap: 12px; - grid-template-columns: repeat(4, 1fr); - background-color: #fff; - flex-grow: 1; - align-items: center -} - -.vanilla-calendar-months_selecting .vanilla-calendar-months__month { - cursor: pointer -} - -.vanilla-calendar-months_selecting .vanilla-calendar-months__month_disabled { - cursor: default -} - -.vanilla-calendar-months__month { - display: flex; - align-items: center; - justify-content: center; - text-align: center; - height: 40px; - font-size: 12px; - line-height: 16px; - font-weight: 700; - background-color: #fff; - color: #20b2aa; - padding: 2px; - border-radius: 4px; - border: 0; - word-break: break-all -} - -.vanilla-calendar-months__month:hover { - background-color: #f0f8ff -} - -.vanilla-calendar-months__month_selected { - background-color: #20b2aa; - color: #fff -} - -.vanilla-calendar-months__month_selected:hover { - background-color: #20b2aa; - color: #fff -} - -.vanilla-calendar-months__month_disabled { - pointer-events: none; - background-color: #fff; - color: silver -} - -.vanilla-calendar-months__month_disabled:hover { - background-color: #fff; - color: silver -} - -.vanilla-calendar-month { - margin-top: -25px; - font-size: 18px; - line-height: 20px; - font-weight: 00; - color: #000; - cursor: pointer; - border-radius: 4px; - padding: 2px; - border: 0; - background-color: rgba(0, 0, 0, 0) -} - -.vanilla-calendar-month:hover { - color: #20b2aa -} - -.vanilla-calendar-month_not-active { - color: silver -} - -.vanilla-calendar-month_disabled { - pointer-events: none; - color: silver -} - -.vanilla-calendar-years { - border-radius: 4px; - display: grid; - grid-column-gap: 6px; - -webkit-column-gap: 6px; - column-gap: 6px; - grid-row-gap: 12px; - row-gap: 12px; - grid-template-columns: repeat(5, 1fr); - background-color: #fff; - flex-grow: 1; - align-items: center -} - -.vanilla-calendar-years_selecting .vanilla-calendar-years__year { - cursor: pointer -} - -.vanilla-calendar-years_selecting .vanilla-calendar-years__year_disabled { - cursor: default -} - -.vanilla-calendar-years__year { - display: flex; - align-items: center; - justify-content: center; - text-align: center; - height: 40px; - font-size: 12px; - line-height: 20px; - font-weight: 700; - background-color: #fff; - color: #20b2aa; - padding: 2px; - border-radius: 4px; - border: 0; - word-break: break-all -} - -.vanilla-calendar-years__year:hover { - background-color: #f0f8ff -} - -.vanilla-calendar-years__year_selected { - background-color: #20b2aa; - color: #fff -} - -.vanilla-calendar-years__year_selected:hover { - background-color: #20b2aa; - color: #fff -} - -.vanilla-calendar-years__year_disabled { - pointer-events: none; - background-color: #fff; - color: silver -} - -.vanilla-calendar-years__year_disabled:hover { - background-color: #fff; - color: silver -} - -.vanilla-calendar-year { - margin-left: 5px; - margin-top: -30px; - font-size: 10px; - line-height: 20px; - font-weight: 400; - color: #3a3636; - cursor: pointer; - border-radius: 4px; - padding: 2px; - border: 0; - background-color: rgba(0, 0, 0, 0) -} - -.vanilla-calendar-year:hover { - color: #20b2aa -} - -.vanilla-calendar-year_not-active { - color: silver -} - -.vanilla-calendar-year_disabled { - pointer-events: none; - color: silver -} - -.vanilla-calendar-week { - display: grid; - grid-template-columns: repeat(7, 1fr); - justify-items: center; - margin-bottom: 5px -} - -.vanilla-calendar-week__day { - font-size: 12px; - line-height: 16px; - font-weight: 700; - color: #20b2aa; - width: 28px; - height: 18px; - display: flex; - align-items: center; - justify-content: center -} - -.vanilla-calendar-week__day_weekend { - color: coral -} - -.vanilla-calendar-week-number { - font-size: 12px; - line-height: 16px; - font-weight: 700; - color: #20b2aa; - width: 28px; - height: 28px; - display: flex; - align-items: center; - justify-content: center; - cursor: pointer -} - -.vanilla-calendar-week-number:hover { - color: #68cec9 -} - -.vanilla-calendar-days { - display: grid; - grid-template-columns: repeat(7, 1fr); - justify-items: center; - align-items: center; - flex-grow: 1 -} - -.vanilla-calendar-days_selecting .vanilla-calendar-day__btn { - cursor: pointer -} - -.vanilla-calendar-days_selecting .vanilla-calendar-day__btn_disabled { - cursor: default -} - -.vanilla-calendar-day { - position: relative; - width: 100%; - height: 100%; - display: flex; - align-items: center; - justify-content: center -} - -.vanilla-calendar-day.focus-visible .vanilla-calendar-day__popup, -.vanilla-calendar-day:hover .vanilla-calendar-day__popup { - opacity: 1; - pointer-events: auto -} - -.vanilla-calendar-day:focus-visible .vanilla-calendar-day__popup, -.vanilla-calendar-day:hover .vanilla-calendar-day__popup { - opacity: 1; - pointer-events: auto -} - -.vanilla-calendar-day_selected-first .vanilla-calendar-day__btn_selected { - border-radius: 0; - width: 100%; - border-top-left-radius: 8px; - border-bottom-left-radius: 8px -} - -.vanilla-calendar-day_selected-last .vanilla-calendar-day__btn_selected { - border-radius: 0; - width: 100%; - border-top-right-radius: 8px; - border-bottom-right-radius: 8px -} - -.vanilla-calendar-day_selected-intermediate .vanilla-calendar-day__btn_intermediate { - border-radius: 0; - width: 100% -} - -.vanilla-calendar-day__btn { - font-size: 12px; - line-height: 17px; - font-weight: 400; - width: 28px; - height: 28px; - display: flex; - align-items: center; - justify-content: center; - border-radius: 50%; - background-color: #fff; - border: 0; - cursor: default -} - -.vanilla-calendar-day__btn:hover { - background-color: #f0f8ff -} - -.vanilla-calendar-day__btn_today { - background-color: #f0f8ff; - color: #fefefe; - font-weight: 600 -} - -.vanilla-calendar-day__btn_today:hover { - color: #20b2aa; - background-color: #f0f8ff -} - -.vanilla-calendar-day__btn_today.vanilla-calendar-day__btn_prev, -.vanilla-calendar-day__btn_today.vanilla-calendar-day__btn_next { - background-color: #f5f5f5; - color: #a9a9a9 -} - -.vanilla-calendar-day__btn_selected { - background-color: #38BDF8!important; - color: #fff -} - -.past_timeline{ - background-color: #f1f4f7!important; - color:#fff; -} - - -.current_timeline { - background-color: #38bdf8!important; - color: #fff -} - -.upcoming_timeline { - background-color: #FFE600!important; - color: #fff -} - - -.vanilla-calendar-day__btn_selected:hover { - background-color: #38BDF8; - color: #fff -} - -.vanilla-calendar-day__btn_selected.vanilla-calendar-day__btn_intermediate { - background-color: #68cec9; - color: #fff -} - -.vanilla-calendar-day__btn_selected.vanilla-calendar-day__btn_intermediate:hover { - background-color: #68cec9; - color: #fff -} - -.vanilla-calendar-day__btn_selected.vanilla-calendar-day__btn_prev, -.vanilla-calendar-day__btn_selected.vanilla-calendar-day__btn_next { - background-color: #f5f5f5; - color: gray -} - -.vanilla-calendar-day__btn_selected.vanilla-calendar-day__btn_prev:hover, -.vanilla-calendar-day__btn_selected.vanilla-calendar-day__btn_next:hover { - background-color: #f5f5f5; - color: gray -} - -.vanilla-calendar-day__btn_weekend, -.vanilla-calendar-day__btn_holiday { - color: coral -} - -.vanilla-calendar-day__btn_weekend:hover, -.vanilla-calendar-day__btn_holiday:hover { - background-color: #fff5ee -} - -.vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_today, -.vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_today { - color: coral; - background-color: #fff5ee -} - -.vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_today.vanilla-calendar-day__btn_prev, -.vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_today.vanilla-calendar-day__btn_next, -.vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_today.vanilla-calendar-day__btn_prev, -.vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_today.vanilla-calendar-day__btn_next { - color: #a9a9a9; - background-color: #f5f5f5 -} - -.vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_today.vanilla-calendar-day__btn_prev.vanilla-calendar-day__btn_disabled, -.vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_today.vanilla-calendar-day__btn_next.vanilla-calendar-day__btn_disabled, -.vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_today.vanilla-calendar-day__btn_prev.vanilla-calendar-day__btn_disabled, -.vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_today.vanilla-calendar-day__btn_next.vanilla-calendar-day__btn_disabled { - color: #d3d3d3; - background-color: #f5f5f5 -} - -.vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_today.vanilla-calendar-day__btn_disabled, -.vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_today.vanilla-calendar-day__btn_disabled { - color: #d3d3d3; - background-color: #f5f5f5 -} - -.vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_selected, -.vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_selected { - background-color: coral; - color: #fff -} - -.vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_selected:hover, -.vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_selected:hover { - background-color: coral; - color: #fff -} - -.vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_selected.vanilla-calendar-day__btn_intermediate, -.vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_selected.vanilla-calendar-day__btn_intermediate { - background-color: #ffaa8a; - color: #fff -} - -.vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_selected.vanilla-calendar-day__btn_intermediate:hover, -.vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_selected.vanilla-calendar-day__btn_intermediate:hover { - background-color: #ffaa8a; - color: #fff -} - -.vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_selected.vanilla-calendar-day__btn_prev, -.vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_selected.vanilla-calendar-day__btn_next, -.vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_selected.vanilla-calendar-day__btn_prev, -.vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_selected.vanilla-calendar-day__btn_next { - background-color: #f5f5f5; - color: gray -} - -.vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_selected.vanilla-calendar-day__btn_prev:hover, -.vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_selected.vanilla-calendar-day__btn_next:hover, -.vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_selected.vanilla-calendar-day__btn_prev:hover, -.vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_selected.vanilla-calendar-day__btn_next:hover { - background-color: #f5f5f5; - color: gray -} - -.vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_prev, -.vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_next, -.vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_prev, -.vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_next { - color: #a9a9a9 -} - -.vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_prev.vanilla-calendar-day__btn_disabled, -.vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_next.vanilla-calendar-day__btn_disabled, -.vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_prev.vanilla-calendar-day__btn_disabled, -.vanilla-calendar-day__btn_holiday.vanilla-calendar-day__btn_next.vanilla-calendar-day__btn_disabled { - color: #d3d3d3 -} - -.vanilla-calendar-day__btn_prev, -.vanilla-calendar-day__btn_next { - background-color: #fff; - color: #a9a9a9 -} - -.vanilla-calendar-day__btn_prev:hover, -.vanilla-calendar-day__btn_next:hover { - background-color: #fff; - color: #a9a9a9 -} - -.vanilla-calendar-day__btn_disabled { - pointer-events: none; - background-color: #fff; - color: #d3d3d3 -} - -.vanilla-calendar-day__btn_disabled:hover { - background-color: #fff; - color: #d3d3d3 -} - -.vanilla-calendar-day__btn_hover { - border: 1px solid rgba(89, 137, 135, .5) -} - -.vanilla-calendar-day__popup { - position: absolute; - z-index: 2; - left: 50%; - top: 100%; - -webkit-transform: translateX(-50%); - transform: translateX(-50%); - width: 130px; - padding: 16px 12px 8px; - color: #000; - font-size: 12px; - line-height: 14px; - font-weight: 400; - opacity: 0; - pointer-events: none -} - -.vanilla-calendar-day__popup:hover { - opacity: 1; - pointer-events: auto -} - -.vanilla-calendar-day__popup::before { - content: ""; - position: absolute; - z-index: -1; - left: 0; - bottom: 0; - width: 100%; - height: calc(100% - 8px); - display: block; - border-radius: 4px; - background-color: #fff; - box-shadow: 0 2px 20px rgba(0, 0, 0, .1) -} - -.vanilla-calendar-day__popup::after { - content: ""; - position: absolute; - z-index: -1; - left: 50%; - -webkit-transform: translateX(-50%); - transform: translateX(-50%); - top: 2px; - display: block; - height: 0; - width: 0; - border-color: rgba(0, 0, 0, 0) rgba(0, 0, 0, 0) #fff; - border-style: solid; - border-width: 0 10px 8px -} - -.vanilla-calendar-time { - display: grid; - grid-template-columns: auto 1fr; - grid-gap: 12px; - gap: 12px; - border-top: 1px solid #dcdcdc; - padding: 12px 6px 0 -} - -.vanilla-calendar-time__content { - display: flex; - align-items: center -} - -.vanilla-calendar-time__content input { - box-sizing: border-box; - position: relative; - display: block; - font-size: 18px; - line-height: 18px; - font-weight: 600; - text-align: center; - color: #000; - background-color: #fff; - width: 100%; - padding: 2px; - margin: 0; - border: 0; - border-radius: 4px -} - -.vanilla-calendar-time__content input:hover { - background-color: #faebd7 -} - -.vanilla-calendar-time__content input:disabled { - cursor: default -} - -.vanilla-calendar-time__content input:disabled:hover { - background-color: rgba(0, 0, 0, 0) -} - -.vanilla-calendar-time__content input.focus-visible { - outline: 1px solid #ff8c00; - background-color: #fff -} - -.vanilla-calendar-time__content input:focus-visible { - outline: 1px solid #ff8c00; - background-color: #fff -} - -.vanilla-calendar-time__content input.vanilla-calendar-is-focus { - background-color: #faebd7 -} - -.vanilla-calendar-time__hours { - position: relative; - width: 25px; - margin-right: 6px -} - -.vanilla-calendar-time__hours::after { - content: ":"; - display: block; - position: absolute; - right: -5px; - top: 50%; - -webkit-transform: translateY(-50%); - transform: translateY(-50%); - margin-top: -1px; - font-size: 14px; - line-height: 14px; - font-weight: 600; - color: #000 -} - -.vanilla-calendar-time__minutes { - width: 25px -} - -.vanilla-calendar-time__keeping { - cursor: pointer; - display: block; - font-size: 11px; - line-height: 12px; - font-weight: 400; - color: gray; - margin-left: 1px; - margin-top: 5px; - padding: 2px; - border: 0; - background-color: rgba(0, 0, 0, 0); - border-radius: 4px; - width: 22px -} - -.vanilla-calendar-time__keeping:hover { - background-color: #faebd7 -} - -.vanilla-calendar-time__keeping:disabled { - cursor: default -} - -.vanilla-calendar-time__keeping:disabled:hover { - background-color: rgba(0, 0, 0, 0) -} - -.vanilla-calendar-time__ranges { - display: flex; - flex-direction: column -} - -.vanilla-calendar-time__range { - font-size: 0; - position: relative; - z-index: 1 -} - -.vanilla-calendar-time__range::before { - content: ""; - width: 1px; - height: 8px; - position: absolute; - z-index: 1; - pointer-events: none; - left: 0; - top: 5px; - margin-top: 1px; - background-color: #dcdcdc -} - -.vanilla-calendar-time__range::after { - content: ""; - width: 1px; - height: 8px; - position: absolute; - z-index: 1; - pointer-events: none; - right: 0; - top: 5px; - margin-top: 1px; - background-color: #dcdcdc -} - -.vanilla-calendar-time__range:hover input::-webkit-slider-thumb { - border-color: gray -} - -.vanilla-calendar-time__range:hover input::-moz-range-thumb { - border-color: gray -} - -.vanilla-calendar-time__range input { - width: 100%; - position: relative; - -webkit-appearance: none; - appearance: none; - height: 20px; - cursor: pointer; - margin: 0; - outline: none -} - -.vanilla-calendar-time__range input.focus-visible::-webkit-slider-thumb { - border-color: #ff8c00 -} - -.vanilla-calendar-time__range input:focus-visible::-webkit-slider-thumb { - border-color: #ff8c00 -} - -.vanilla-calendar-time__range input.focus-visible::-moz-range-thumb { - border-color: #ff8c00 -} - -.vanilla-calendar-time__range input:focus-visible::-moz-range-thumb { - border-color: #ff8c00 -} - -.vanilla-calendar-time__range input::-webkit-slider-thumb { - -webkit-appearance: none; - appearance: none; - margin-top: -8px; - position: relative; - z-index: 2; - box-sizing: border-box; - border: 1px solid #dcdcdc; - height: 16px; - width: 10px; - box-shadow: none; - border-radius: 3px; - background-color: #fff; - cursor: pointer -} - -.vanilla-calendar-time__range input::-moz-range-thumb { - position: relative; - z-index: 2; - box-sizing: border-box; - border: 1px solid #dcdcdc; - height: 16px; - width: 10px; - box-shadow: none; - border-radius: 3px; - background-color: #fff; - cursor: pointer -} - -.vanilla-calendar-time__range input::-webkit-slider-runnable-track { - box-sizing: border-box; - width: 100%; - height: 1px; - margin-top: 1px; - cursor: pointer; - background-color: #dcdcdc -} - -.vanilla-calendar-time__range input::-moz-range-track { - box-sizing: border-box; - width: 100%; - height: 1px; - margin-top: 1px; - cursor: pointer; - background-color: #dcdcdc -} diff --git a/resources/conference/css/calendar/vanila-calendar.min.css b/resources/website/css/calendar/vanilla-calendar-min.css similarity index 99% rename from resources/conference/css/calendar/vanila-calendar.min.css rename to resources/website/css/calendar/vanilla-calendar-min.css index 01b0f4d75..8b4f2d59e 100644 --- a/resources/conference/css/calendar/vanila-calendar.min.css +++ b/resources/website/css/calendar/vanilla-calendar-min.css @@ -1,7 +1,4 @@ -/*! name: @uvarov.frontend/vanilla-calendar | url: https://github.com/uvarov-frontend/vanilla-calendar */ .vanilla-calendar { - margin-top: -14px; - margin-left: -16px; width: 310px; position: relative; min-width: -webkit-min-content; @@ -507,7 +504,8 @@ .past_timeline{ background-color: #f1f4f7!important; - color:#fff; + color:#d1d5db!important; + text-decoration: line-through; } diff --git a/resources/website/css/website.css b/resources/website/css/website.css index 31c93982b..58f5e066d 100644 --- a/resources/website/css/website.css +++ b/resources/website/css/website.css @@ -1,9 +1,15 @@ +@import "./calendar/vanilla-calendar-min.css"; +@import "./calendar/themes/light.css"; +/* @import "../../../vendor/filament/filament/resources/css/theme.css"; */ @config './tailwind.config.js'; + @tailwind base; @tailwind components; @tailwind utilities; + + @layer components { .accordion-header { @apply py-1 px-1 cursor-pointer gap-1 flex items-center; @@ -56,19 +62,19 @@ } .author-badge{ - @apply badge badge-outline text-mini badge-xs w-16 h-5 text-yellow-400; + @apply badge badge-outline text-mini badge-xs h-5 text-yellow-400; } .editor-badge{ - @apply badge badge-outline text-mini badge-xs w-16 h-5 text-gray-400; + @apply badge badge-outline text-mini badge-xs h-5 text-gray-400; } .reviewer-badge{ - @apply badge badge-outline text-mini badge-xs w-16 h-5 text-gray-400; + @apply badge badge-outline text-mini badge-xs h-5 text-gray-400; } .participant-badge{ - @apply badge badge-outline text-mini badge-xs w-16 h-5 text-primary; + @apply badge badge-outline text-mini badge-xs h-5 text-primary; } .past-timeline-marker { diff --git a/resources/website/js/alpine/components/calendar.js b/resources/website/js/alpine/components/calendar.js index a306b1672..153c8fb40 100644 --- a/resources/website/js/alpine/components/calendar.js +++ b/resources/website/js/alpine/components/calendar.js @@ -1,23 +1,15 @@ import VanillaCalendar from '@uvarov.frontend/vanilla-calendar'; -// Reuse Style -// import '../../../css/calendar/vanila-calendar.min.css'; -// import '../../../css/calendar/themes/light.min.css'; -import '../../../css/calendar/vanila-calendar-min.css'; -import '../../../css/calendar/themes/light.min.css'; - - document.addEventListener('alpine:init', () => { - Alpine.data('calendar', () => { - // data from calendar block component - console.log(timelinesData); - return { - options: { + Alpine.directive('calendar', (el, { expression }, { effect, cleanup }) => { + const timelinesData = JSON.parse(expression); + effect(() => { + const options = { DOMTemplates: { default: `
- <#Month /> <#Year /> + <#Month /> <#Year />
<#ArrowPrev /> <#ArrowNext /> @@ -29,23 +21,24 @@ document.addEventListener('alpine:init', () => {
`, - }, + }, settings: { visibility: { theme: 'light', }, }, popups: timelinesData, - }, - init() { - this.initCalendar(); - }, - initCalendar() { - const calendar = new VanillaCalendar('#calendar', this.options); - calendar.init(); - }, - }; + }; + + const calendar = new VanillaCalendar(el, options); + calendar.init(); + }); + + cleanup(() => { + + }); }); }); +