avo 4.2.9 → 4.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b41c3ba58f0ab1ef220255cc5c20ba5e284abc5d4a897ba8f3e8012504f63cb1
4
- data.tar.gz: ed2cf44570794d776d01d75f71b60b29d0da117169f164af703201862f6df923
3
+ metadata.gz: 18c1a6d6cba88e86f5ae63180935d7c14f310a40ae9748c61a57b86f2c12620a
4
+ data.tar.gz: d8fc18580740e6abdaf05fb03d8dbf8f25c95cf9006fd4c4bb6d156849a57d4d
5
5
  SHA512:
6
- metadata.gz: 227c5342e55ee329942530fea36edcba37cf099419fa41685750d080af3e921fc63f5f23388809875ea3088d048e937afaefc3162f4b82e7fab978f2bb4da036
7
- data.tar.gz: 26a173c552844e228357464dcb6a2f8c3389b309953269d584c769db7b7fb6dc74002f82ee7056f897e95be74e6f25a7a442f86daecaa45737bbc21aca15a783
6
+ metadata.gz: 6024cd9b5166afbb37cac095c067d2df1cc02c3821c99e34e26374e0e876ceb6f8f4ad419149da668bf879ee6c8a63581ea49b7b33d8f0efd1ee225ef52371b4
7
+ data.tar.gz: cb2d5ab08387132a76101f08fa644c321a3934507b62c7eba5f5b67a856cebfd78f5b721c75c00767667a818ceb06995b003b466642fcf9940f0af4758957265
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- avo (4.2.9)
4
+ avo (4.2.10)
5
5
  actionview (>= 6.1)
6
6
  active_link_to
7
7
  activerecord (>= 6.1)
@@ -2547,6 +2547,9 @@
2547
2547
  --tw-tracking: var(--tracking-widest);
2548
2548
  letter-spacing: var(--tracking-widest);
2549
2549
  }
2550
+ .wrap-anywhere {
2551
+ overflow-wrap: anywhere;
2552
+ }
2550
2553
  .break-all {
2551
2554
  word-break: break-all;
2552
2555
  }
@@ -4106,7 +4109,18 @@ tag.tagify__tag {
4106
4109
  .dark {
4107
4110
  --color-background: var(--color-avo-neutral-900);
4108
4111
  --color-foreground: var(--color-avo-neutral-50);
4109
- --color-primary: var(--color-avo-neutral-950);
4112
+ --color-primary: color-mix(
4113
+ in oklab,
4114
+ oklch(20.46% 0 89.88),
4115
+ oklch(98.51% 0 89.88) 20%
4116
+ );
4117
+ @supports (color: color-mix(in lab, red, red)) {
4118
+ --color-primary: color-mix(
4119
+ in oklab,
4120
+ var(--color-avo-neutral-950),
4121
+ var(--color-background) 20%
4122
+ );
4123
+ }
4110
4124
  --color-secondary: var(--color-avo-neutral-800);
4111
4125
  --color-tertiary: var(--color-avo-neutral-700);
4112
4126
  --color-quaternary: var(--color-avo-neutral-600);
@@ -4134,130 +4148,144 @@ tag.tagify__tag {
4134
4148
  }
4135
4149
  @layer components {
4136
4150
  .neutral-theme-slate {
4137
- --color-avo-neutral-25: oklch(98.51% 0 89.88);
4138
- --color-avo-neutral-50: var(--color-slate-50);
4139
- --color-avo-neutral-100: var(--color-slate-100);
4140
- --color-avo-neutral-200: var(--color-slate-200);
4141
- --color-avo-neutral-300: var(--color-slate-300);
4142
- --color-avo-neutral-400: var(--color-slate-400);
4143
- --color-avo-neutral-500: var(--color-slate-500);
4144
- --color-avo-neutral-600: var(--color-slate-600);
4145
- --color-avo-neutral-700: var(--color-slate-700);
4146
- --color-avo-neutral-800: var(--color-slate-800);
4147
- --color-avo-neutral-900: var(--color-slate-900);
4148
- --color-avo-neutral-950: var(--color-slate-950);
4151
+ --avo-neutral-source-25: var(--color-slate-50);
4152
+ --avo-neutral-source-50: var(--color-slate-50);
4153
+ --avo-neutral-source-100: var(--color-slate-100);
4154
+ --avo-neutral-source-200: var(--color-slate-200);
4155
+ --avo-neutral-source-300: var(--color-slate-300);
4156
+ --avo-neutral-source-400: var(--color-slate-400);
4157
+ --avo-neutral-source-500: var(--color-slate-500);
4158
+ --avo-neutral-source-600: var(--color-slate-600);
4159
+ --avo-neutral-source-700: var(--color-slate-700);
4160
+ --avo-neutral-source-800: var(--color-slate-800);
4161
+ --avo-neutral-source-900: var(--color-slate-900);
4162
+ --avo-neutral-source-950: var(--color-slate-950);
4149
4163
  }
4150
4164
  .neutral-theme-stone {
4151
- --color-avo-neutral-25: oklch(98.51% 0 89.88);
4152
- --color-avo-neutral-50: var(--color-stone-50);
4153
- --color-avo-neutral-100: var(--color-stone-100);
4154
- --color-avo-neutral-200: var(--color-stone-200);
4155
- --color-avo-neutral-300: var(--color-stone-300);
4156
- --color-avo-neutral-400: var(--color-stone-400);
4157
- --color-avo-neutral-500: var(--color-stone-500);
4158
- --color-avo-neutral-600: var(--color-stone-600);
4159
- --color-avo-neutral-700: var(--color-stone-700);
4160
- --color-avo-neutral-800: var(--color-stone-800);
4161
- --color-avo-neutral-900: var(--color-stone-900);
4162
- --color-avo-neutral-950: var(--color-stone-950);
4165
+ --avo-neutral-source-25: var(--color-stone-50);
4166
+ --avo-neutral-source-50: var(--color-stone-50);
4167
+ --avo-neutral-source-100: var(--color-stone-100);
4168
+ --avo-neutral-source-200: var(--color-stone-200);
4169
+ --avo-neutral-source-300: var(--color-stone-300);
4170
+ --avo-neutral-source-400: var(--color-stone-400);
4171
+ --avo-neutral-source-500: var(--color-stone-500);
4172
+ --avo-neutral-source-600: var(--color-stone-600);
4173
+ --avo-neutral-source-700: var(--color-stone-700);
4174
+ --avo-neutral-source-800: var(--color-stone-800);
4175
+ --avo-neutral-source-900: var(--color-stone-900);
4176
+ --avo-neutral-source-950: var(--color-stone-950);
4163
4177
  }
4164
4178
  .neutral-theme-taupe {
4165
- --color-avo-neutral-25: oklch(98.5% 0.004 70);
4166
- --color-avo-neutral-50: var(--color-taupe-50);
4167
- --color-avo-neutral-100: var(--color-taupe-100);
4168
- --color-avo-neutral-200: var(--color-taupe-200);
4169
- --color-avo-neutral-300: var(--color-taupe-300);
4170
- --color-avo-neutral-400: var(--color-taupe-400);
4171
- --color-avo-neutral-500: var(--color-taupe-500);
4172
- --color-avo-neutral-600: var(--color-taupe-600);
4173
- --color-avo-neutral-700: var(--color-taupe-700);
4174
- --color-avo-neutral-800: var(--color-taupe-800);
4175
- --color-avo-neutral-900: var(--color-taupe-900);
4176
- --color-avo-neutral-950: var(--color-taupe-950);
4179
+ --avo-neutral-source-25: var(--color-taupe-50);
4180
+ --avo-neutral-source-50: var(--color-taupe-50);
4181
+ --avo-neutral-source-100: var(--color-taupe-100);
4182
+ --avo-neutral-source-200: var(--color-taupe-200);
4183
+ --avo-neutral-source-300: var(--color-taupe-300);
4184
+ --avo-neutral-source-400: var(--color-taupe-400);
4185
+ --avo-neutral-source-500: var(--color-taupe-500);
4186
+ --avo-neutral-source-600: var(--color-taupe-600);
4187
+ --avo-neutral-source-700: var(--color-taupe-700);
4188
+ --avo-neutral-source-800: var(--color-taupe-800);
4189
+ --avo-neutral-source-900: var(--color-taupe-900);
4190
+ --avo-neutral-source-950: var(--color-taupe-950);
4177
4191
  }
4178
4192
  .neutral-theme-mauve {
4179
- --color-avo-neutral-25: oklch(98.5% 0.005 310);
4180
- --color-avo-neutral-50: var(--color-mauve-50);
4181
- --color-avo-neutral-100: var(--color-mauve-100);
4182
- --color-avo-neutral-200: var(--color-mauve-200);
4183
- --color-avo-neutral-300: var(--color-mauve-300);
4184
- --color-avo-neutral-400: var(--color-mauve-400);
4185
- --color-avo-neutral-500: var(--color-mauve-500);
4186
- --color-avo-neutral-600: var(--color-mauve-600);
4187
- --color-avo-neutral-700: var(--color-mauve-700);
4188
- --color-avo-neutral-800: var(--color-mauve-800);
4189
- --color-avo-neutral-900: var(--color-mauve-900);
4190
- --color-avo-neutral-950: var(--color-mauve-950);
4193
+ --avo-neutral-source-25: var(--color-mauve-50);
4194
+ --avo-neutral-source-50: var(--color-mauve-50);
4195
+ --avo-neutral-source-100: var(--color-mauve-100);
4196
+ --avo-neutral-source-200: var(--color-mauve-200);
4197
+ --avo-neutral-source-300: var(--color-mauve-300);
4198
+ --avo-neutral-source-400: var(--color-mauve-400);
4199
+ --avo-neutral-source-500: var(--color-mauve-500);
4200
+ --avo-neutral-source-600: var(--color-mauve-600);
4201
+ --avo-neutral-source-700: var(--color-mauve-700);
4202
+ --avo-neutral-source-800: var(--color-mauve-800);
4203
+ --avo-neutral-source-900: var(--color-mauve-900);
4204
+ --avo-neutral-source-950: var(--color-mauve-950);
4191
4205
  }
4192
4206
  .neutral-theme-mist {
4193
- --color-avo-neutral-25: oklch(98.5% 0.004 240);
4194
- --color-avo-neutral-50: var(--color-mist-50);
4195
- --color-avo-neutral-100: var(--color-mist-100);
4196
- --color-avo-neutral-200: var(--color-mist-200);
4197
- --color-avo-neutral-300: var(--color-mist-300);
4198
- --color-avo-neutral-400: var(--color-mist-400);
4199
- --color-avo-neutral-500: var(--color-mist-500);
4200
- --color-avo-neutral-600: var(--color-mist-600);
4201
- --color-avo-neutral-700: var(--color-mist-700);
4202
- --color-avo-neutral-800: var(--color-mist-800);
4203
- --color-avo-neutral-900: var(--color-mist-900);
4204
- --color-avo-neutral-950: var(--color-mist-950);
4207
+ --avo-neutral-source-25: var(--color-mist-50);
4208
+ --avo-neutral-source-50: var(--color-mist-50);
4209
+ --avo-neutral-source-100: var(--color-mist-100);
4210
+ --avo-neutral-source-200: var(--color-mist-200);
4211
+ --avo-neutral-source-300: var(--color-mist-300);
4212
+ --avo-neutral-source-400: var(--color-mist-400);
4213
+ --avo-neutral-source-500: var(--color-mist-500);
4214
+ --avo-neutral-source-600: var(--color-mist-600);
4215
+ --avo-neutral-source-700: var(--color-mist-700);
4216
+ --avo-neutral-source-800: var(--color-mist-800);
4217
+ --avo-neutral-source-900: var(--color-mist-900);
4218
+ --avo-neutral-source-950: var(--color-mist-950);
4205
4219
  }
4206
4220
  .neutral-theme-gray {
4207
- --color-avo-neutral-25: oklch(98.51% 0 89.88);
4208
- --color-avo-neutral-50: var(--color-gray-50);
4209
- --color-avo-neutral-100: var(--color-gray-100);
4210
- --color-avo-neutral-200: var(--color-gray-200);
4211
- --color-avo-neutral-300: var(--color-gray-300);
4212
- --color-avo-neutral-400: var(--color-gray-400);
4213
- --color-avo-neutral-500: var(--color-gray-500);
4214
- --color-avo-neutral-600: var(--color-gray-600);
4215
- --color-avo-neutral-700: var(--color-gray-700);
4216
- --color-avo-neutral-800: var(--color-gray-800);
4217
- --color-avo-neutral-900: var(--color-gray-900);
4218
- --color-avo-neutral-950: var(--color-gray-950);
4221
+ --avo-neutral-source-25: var(--color-gray-50);
4222
+ --avo-neutral-source-50: var(--color-gray-50);
4223
+ --avo-neutral-source-100: var(--color-gray-100);
4224
+ --avo-neutral-source-200: var(--color-gray-200);
4225
+ --avo-neutral-source-300: var(--color-gray-300);
4226
+ --avo-neutral-source-400: var(--color-gray-400);
4227
+ --avo-neutral-source-500: var(--color-gray-500);
4228
+ --avo-neutral-source-600: var(--color-gray-600);
4229
+ --avo-neutral-source-700: var(--color-gray-700);
4230
+ --avo-neutral-source-800: var(--color-gray-800);
4231
+ --avo-neutral-source-900: var(--color-gray-900);
4232
+ --avo-neutral-source-950: var(--color-gray-950);
4219
4233
  }
4220
4234
  .neutral-theme-zinc {
4221
- --color-avo-neutral-25: oklch(98.51% 0 89.88);
4222
- --color-avo-neutral-50: var(--color-zinc-50);
4223
- --color-avo-neutral-100: var(--color-zinc-100);
4224
- --color-avo-neutral-200: var(--color-zinc-200);
4225
- --color-avo-neutral-300: var(--color-zinc-300);
4226
- --color-avo-neutral-400: var(--color-zinc-400);
4227
- --color-avo-neutral-500: var(--color-zinc-500);
4228
- --color-avo-neutral-600: var(--color-zinc-600);
4229
- --color-avo-neutral-700: var(--color-zinc-700);
4230
- --color-avo-neutral-800: var(--color-zinc-800);
4231
- --color-avo-neutral-900: var(--color-zinc-900);
4232
- --color-avo-neutral-950: var(--color-zinc-950);
4235
+ --avo-neutral-source-25: var(--color-zinc-50);
4236
+ --avo-neutral-source-50: var(--color-zinc-50);
4237
+ --avo-neutral-source-100: var(--color-zinc-100);
4238
+ --avo-neutral-source-200: var(--color-zinc-200);
4239
+ --avo-neutral-source-300: var(--color-zinc-300);
4240
+ --avo-neutral-source-400: var(--color-zinc-400);
4241
+ --avo-neutral-source-500: var(--color-zinc-500);
4242
+ --avo-neutral-source-600: var(--color-zinc-600);
4243
+ --avo-neutral-source-700: var(--color-zinc-700);
4244
+ --avo-neutral-source-800: var(--color-zinc-800);
4245
+ --avo-neutral-source-900: var(--color-zinc-900);
4246
+ --avo-neutral-source-950: var(--color-zinc-950);
4233
4247
  }
4234
4248
  .neutral-theme-neutral {
4235
- --color-avo-neutral-25: oklch(98.51% 0 89.88);
4236
- --color-avo-neutral-50: var(--color-neutral-50);
4237
- --color-avo-neutral-100: var(--color-neutral-100);
4238
- --color-avo-neutral-200: var(--color-neutral-200);
4239
- --color-avo-neutral-300: var(--color-neutral-300);
4240
- --color-avo-neutral-400: var(--color-neutral-400);
4241
- --color-avo-neutral-500: var(--color-neutral-500);
4242
- --color-avo-neutral-600: var(--color-neutral-600);
4243
- --color-avo-neutral-700: var(--color-neutral-700);
4244
- --color-avo-neutral-800: var(--color-neutral-800);
4245
- --color-avo-neutral-900: var(--color-neutral-900);
4246
- --color-avo-neutral-950: var(--color-neutral-950);
4249
+ --avo-neutral-source-25: var(--color-neutral-50);
4250
+ --avo-neutral-source-50: var(--color-neutral-50);
4251
+ --avo-neutral-source-100: var(--color-neutral-100);
4252
+ --avo-neutral-source-200: var(--color-neutral-200);
4253
+ --avo-neutral-source-300: var(--color-neutral-300);
4254
+ --avo-neutral-source-400: var(--color-neutral-400);
4255
+ --avo-neutral-source-500: var(--color-neutral-500);
4256
+ --avo-neutral-source-600: var(--color-neutral-600);
4257
+ --avo-neutral-source-700: var(--color-neutral-700);
4258
+ --avo-neutral-source-800: var(--color-neutral-800);
4259
+ --avo-neutral-source-900: var(--color-neutral-900);
4260
+ --avo-neutral-source-950: var(--color-neutral-950);
4247
4261
  }
4248
4262
  .neutral-theme-olive {
4249
- --color-avo-neutral-25: oklch(98.5% 0.005 140);
4250
- --color-avo-neutral-50: var(--color-olive-50);
4251
- --color-avo-neutral-100: var(--color-olive-100);
4252
- --color-avo-neutral-200: var(--color-olive-200);
4253
- --color-avo-neutral-300: var(--color-olive-300);
4254
- --color-avo-neutral-400: var(--color-olive-400);
4255
- --color-avo-neutral-500: var(--color-olive-500);
4256
- --color-avo-neutral-600: var(--color-olive-600);
4257
- --color-avo-neutral-700: var(--color-olive-700);
4258
- --color-avo-neutral-800: var(--color-olive-800);
4259
- --color-avo-neutral-900: var(--color-olive-900);
4260
- --color-avo-neutral-950: var(--color-olive-950);
4263
+ --avo-neutral-source-25: var(--color-olive-50);
4264
+ --avo-neutral-source-50: var(--color-olive-50);
4265
+ --avo-neutral-source-100: var(--color-olive-100);
4266
+ --avo-neutral-source-200: var(--color-olive-200);
4267
+ --avo-neutral-source-300: var(--color-olive-300);
4268
+ --avo-neutral-source-400: var(--color-olive-400);
4269
+ --avo-neutral-source-500: var(--color-olive-500);
4270
+ --avo-neutral-source-600: var(--color-olive-600);
4271
+ --avo-neutral-source-700: var(--color-olive-700);
4272
+ --avo-neutral-source-800: var(--color-olive-800);
4273
+ --avo-neutral-source-900: var(--color-olive-900);
4274
+ --avo-neutral-source-950: var(--color-olive-950);
4275
+ }
4276
+ :is( .neutral-theme-slate, .neutral-theme-stone, .neutral-theme-gray, .neutral-theme-zinc, .neutral-theme-neutral, .neutral-theme-taupe, .neutral-theme-mauve, .neutral-theme-mist, .neutral-theme-olive ) {
4277
+ --color-avo-neutral-25: oklch(from var(--avo-neutral-source-25) 99.71% c h);
4278
+ --color-avo-neutral-50: oklch(from var(--avo-neutral-source-50) 98.51% c h);
4279
+ --color-avo-neutral-100: oklch(from var(--avo-neutral-source-100) 97.31% c h);
4280
+ --color-avo-neutral-200: oklch(from var(--avo-neutral-source-200) 92.8% c h);
4281
+ --color-avo-neutral-300: oklch(from var(--avo-neutral-source-300) 75.72% c h);
4282
+ --color-avo-neutral-400: oklch(from var(--avo-neutral-source-400) 62.68% c h);
4283
+ --color-avo-neutral-500: oklch(from var(--avo-neutral-source-500) 53.48% c h);
4284
+ --color-avo-neutral-600: oklch(from var(--avo-neutral-source-600) 47.84% c h);
4285
+ --color-avo-neutral-700: oklch(from var(--avo-neutral-source-700) 42.76% c h);
4286
+ --color-avo-neutral-800: oklch(from var(--avo-neutral-source-800) 39.04% c h);
4287
+ --color-avo-neutral-900: oklch(from var(--avo-neutral-source-900) 27.68% c h);
4288
+ --color-avo-neutral-950: oklch(from var(--avo-neutral-source-950) 20.46% c h);
4261
4289
  }
4262
4290
  .accent-theme-red {
4263
4291
  --color-accent: var(--color-red-500);
@@ -756,7 +756,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
756
756
  </div>`:""}
757
757
  <span>${r.label}</span>
758
758
  </div>
759
- `}var qqe=(r,e)=>{let t;return(...n)=>(t&&clearTimeout(t),new Promise(i=>{t=setTimeout(()=>i(r(...n)),e)}))};function Nqe(r){return mm(r)??document.body}function Bqe(r){let e=r.dropdown.position;r.dropdown.position=t=>{e(t),b$t(r,t)}}function b$t(r,e){let t=r.DOM.dropdown;if(!mm(r.DOM.scope)||!t)return;let n=r.DOM.scope.getBoundingClientRect(),i=e||t.offsetHeight,a=t.getAttribute("placement")==="top"?n.top-i:n.bottom;t.style.top=`${Math.round(a)}px`,t.style.left=`${Math.round(n.left)}px`}var HN=class extends Wt{static targets=["input","fakeInput"];static values={whitelistItems:{type:Array,default:[]},disallowedItems:{type:Array,default:[]},enforceSuggestions:{type:Boolean,default:!1},closeOnSelect:{type:Boolean,default:!1},delimiters:{type:Array,default:[]},suggestionsMaxItems:{type:Number,default:20},mode:String,fetchValuesFrom:String};tagify=null;searchDebounce=500;debouncedFetch=qqe(fetch,this.searchDebounce);get suggestionsAreObjects(){return(0,u_.isObject)((0,u_.first)(this.whitelistItemsValue))||this.fetchValuesFromValue}get tagifyOptions(){let r={whitelist:this.whitelistItemsValue,blacklist:this.disallowedItemsValue,enforceWhitelist:this.enforceSuggestionsValue,delimiters:this.delimitersValue.join("|"),dropdown:{maxItems:this.suggestionsMaxItemsValue,enabled:0,searchKeys:[this.labelAttributeValue],closeOnSelect:this.closeOnSelectValue,appendTarget:()=>Nqe(this.element)}};return this.modeValue&&(r.mode=this.modeValue),this.suggestionsAreObjects?r=(0,u_.merge)(r,{tagTextProp:"label",dropdown:{searchKeys:["label"],mapValueTo:"value"},templates:{tag:Rqe,dropdownItem:Fqe},originalInputValueFormat:e=>e.map(t=>t.value)}):r=(0,u_.merge)(r,{originalInputValueFormat:e=>e.map(t=>t.value).join(this.delimitersValue[0])}),r}connect(){this.hasInputTarget&&(this.hideFakeInput(),this.showRealInput(),this.initTagify())}disconnect(){this.tagify&&(this.tagify.destroy(),this.tagify=null)}initTagify(){this.tagify=new dD(this.inputTarget,this.tagifyOptions);let r=this;Bqe(this.tagify);function e(t){let n=t.detail.value,i=new zqe.default(r.fetchValuesFromValue);i.addSearch({q:n}),r.tagify.whitelist=null,r.tagify.loading(!0),r.fetchResults(i.toString()).then(o=>{r.tagify.settings.whitelist=o,r.tagify.loading(!1).dropdown.show(t.detail.value)}).catch(()=>r.tagify.dropdown.hide())}this.fetchValuesFromValue&&this.tagify.on("input",e)}fetchResults(r){return this.debouncedFetch(r).then(e=>e.json())}hideFakeInput(){this.fakeInputTarget.classList.add("!hidden")}showRealInput(){this.inputTarget.classList.remove("!hidden")}};var WN=class extends xf{static targets=["text"];getFilterValue(){return this.textTarget.value}tryToSubmit(r){if(r.keyCode===13)return this.changeFilter()}getFilterClass(){let{filterClass:r}=this.textTarget.dataset;return r}};var $N=class extends Wt{static values={lightUrl:String,darkUrl:String};connect(){if(!this.lightUrlValue||!this.darkUrlValue)return;let r=document.documentElement;this.observer=new MutationObserver(()=>this.sync()),this.observer.observe(r,{attributes:!0,attributeFilter:["class"]}),this.sync()}disconnect(){this.observer&&this.observer.disconnect()}sync(){let r=this.element,e=document.documentElement.classList.contains("dark")?this.darkUrlValue:this.lightUrlValue;!e||r.getAttribute("href")===e||r.setAttribute("href",e)}};var KN=class extends Wt{static targets=["source","content"];connect(){this.tippyInstance=iS(this.sourceTarget,{content:this.contentTarget.innerHTML,allowHTML:!0,theme:"basic",appendTo:r=>mm(r)??document.body})}disconnect(){this.tippyInstance&&(this.tippyInstance.destroy(),this.tippyInstance=null)}};var Uqe=Object.defineProperty,jqe=(r,e)=>{let t={};for(var n in r)Uqe(t,n,{get:r[n],enumerable:!0});return e||Uqe(t,Symbol.toStringTag,{value:"Module"}),t};function Gc(r){this.content=r}Gc.prototype={constructor:Gc,find:function(r){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===r)return e;return-1},get:function(r){var e=this.find(r);return e==-1?void 0:this.content[e+1]},update:function(r,e,t){var n=t&&t!=r?this.remove(t):this,i=n.find(r),o=n.content.slice();return i==-1?o.push(t||r,e):(o[i+1]=e,t&&(o[i]=t)),new Gc(o)},remove:function(r){var e=this.find(r);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Gc(t)},addToStart:function(r,e){return new Gc([r,e].concat(this.remove(r).content))},addToEnd:function(r,e){var t=this.remove(r).content.slice();return t.push(r,e),new Gc(t)},addBefore:function(r,e,t){var n=this.remove(e),i=n.content.slice(),o=n.find(r);return i.splice(o==-1?i.length:o,0,e,t),new Gc(i)},forEach:function(r){for(var e=0;e<this.content.length;e+=2)r(this.content[e],this.content[e+1])},prepend:function(r){return r=Gc.from(r),r.size?new Gc(r.content.concat(this.subtract(r).content)):this},append:function(r){return r=Gc.from(r),r.size?new Gc(this.subtract(r).content.concat(r.content)):this},subtract:function(r){var e=this;r=Gc.from(r);for(var t=0;t<r.content.length;t+=2)e=e.remove(r.content[t]);return e},toObject:function(){var r={};return this.forEach(function(e,t){r[e]=t}),r},get size(){return this.content.length>>1}};Gc.from=function(r){if(r instanceof Gc)return r;var e=[];if(r)for(var t in r)e.push(t,r[t]);return new Gc(e)};var AG=Gc;function Zqe(r,e,t){for(let n=0;;n++){if(n==r.childCount||n==e.childCount)return r.childCount==e.childCount?null:t;let i=r.child(n),o=e.child(n);if(i==o){t+=i.nodeSize;continue}if(!i.sameMarkup(o))return t;if(i.isText&&i.text!=o.text){for(let a=0;i.text[a]==o.text[a];a++)t++;return t}if(i.content.size||o.content.size){let a=Zqe(i.content,o.content,t+1);if(a!=null)return a}t+=i.nodeSize}}function Jqe(r,e,t,n){for(let i=r.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:t,b:n};let a=r.child(--i),s=e.child(--o),u=a.nodeSize;if(a==s){t-=u,n-=u;continue}if(!a.sameMarkup(s))return{a:t,b:n};if(a.isText&&a.text!=s.text){let f=0,d=Math.min(a.text.length,s.text.length);for(;f<d&&a.text[a.text.length-f-1]==s.text[s.text.length-f-1];)f++,t--,n--;return{a:t,b:n}}if(a.content.size||s.content.size){let f=Jqe(a.content,s.content,t-1,n-1);if(f)return f}t-=u,n-=u}}var Wr=class r{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,t,n,i=0,o){for(let a=0,s=0;s<t;a++){let u=this.content[a],f=s+u.nodeSize;if(f>e&&n(u,i+s,o||null,a)!==!1&&u.content.size){let d=s+1;u.nodesBetween(Math.max(0,e-d),Math.min(u.content.size,t-d),n,i+d)}s=f}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,i){let o="",a=!0;return this.nodesBetween(e,t,(s,u)=>{let f=s.isText?s.text.slice(Math.max(e,u)-u,t-u):s.isLeaf?i?typeof i=="function"?i(s):i:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&f||s.isTextblock)&&n&&(a?a=!1:o+=n),o+=f},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,i=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(n)&&(i[i.length-1]=t.withText(t.text+n.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new r(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let n=[],i=0;if(t>e)for(let o=0,a=0;a<t;o++){let s=this.content[o],u=a+s.nodeSize;u>e&&((a<e||u>t)&&(s.isText?s=s.cut(Math.max(0,e-a),Math.min(s.text.length,t-a)):s=s.cut(Math.max(0,e-a-1),Math.min(s.content.size,t-a-1))),n.push(s),i+=s.nodeSize),a=u}return new r(n,i)}cutByIndex(e,t){return e==t?r.empty:e==0&&t==this.content.length?this:new r(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let i=this.content.slice(),o=this.size+t.nodeSize-n.nodeSize;return i[e]=t,new r(i,o)}addToStart(e){return new r([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new r(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let i=this.content[t];e(i,n,t),n+=i.nodeSize}}findDiffStart(e,t=0){return Zqe(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return Jqe(this,e,t,n)}findIndex(e,t=-1){if(e==0)return GN(0,e);if(e==this.size)return GN(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,i=0;;n++){let o=this.child(n),a=i+o.nodeSize;if(a>=e)return a==e||t>0?GN(n+1,a):GN(n,i);i=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return r.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new r(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return r.empty;let t,n=0;for(let i=0;i<e.length;i++){let o=e[i];n+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(t||(t=e.slice(0,i)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new r(t||e,n)}static from(e){if(!e)return r.empty;if(e instanceof r)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new r([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}};Wr.empty=new Wr([],0);var CG={index:0,offset:0};function GN(r,e){return CG.index=r,CG.offset=e,CG}function XN(r,e){if(r===e)return!0;if(!(r&&typeof r=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(r);if(Array.isArray(e)!=t)return!1;if(t){if(r.length!=e.length)return!1;for(let n=0;n<r.length;n++)if(!XN(r[n],e[n]))return!1}else{for(let n in r)if(!(n in e)||!XN(r[n],e[n]))return!1;for(let n in e)if(!(n in r))return!1}return!0}var $o=class r{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!n&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),n=!0),t&&t.push(o)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&XN(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);let i=n.create(t.attrs);return n.checkAttrs(i.attrs),i}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return r.none;if(e instanceof r)return[e];let t=e.slice();return t.sort((n,i)=>n.type.rank-i.type.rank),t}};$o.none=[];var f_=class extends Error{},Dn=class r{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=eNe(this.content,e+this.openStart,t);return n&&new r(n,this.openStart,this.openEnd)}removeBetween(e,t){return new r(Qqe(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return r.empty;let n=t.openStart||0,i=t.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new r(Wr.fromJSON(e,t.content),n,i)}static maxOpen(e,t=!0){let n=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)n++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)i++;return new r(e,n,i)}};Dn.empty=new Dn(Wr.empty,0,0);function Qqe(r,e,t){let{index:n,offset:i}=r.findIndex(e),o=r.maybeChild(n),{index:a,offset:s}=r.findIndex(t);if(i==e||o.isText){if(s!=t&&!r.child(a).isText)throw new RangeError("Removing non-flat range");return r.cut(0,e).append(r.cut(t))}if(n!=a)throw new RangeError("Removing non-flat range");return r.replaceChild(n,o.copy(Qqe(o.content,e-i-1,t-i-1)))}function eNe(r,e,t,n){let{index:i,offset:o}=r.findIndex(e),a=r.maybeChild(i);if(o==e||a.isText)return n&&!n.canReplace(i,i,t)?null:r.cut(0,e).append(t).append(r.cut(e));let s=eNe(a.content,e-o-1,t);return s&&r.replaceChild(i,a.copy(s))}function x$t(r,e,t){if(t.openStart>r.depth)throw new f_("Inserted content deeper than insertion position");if(r.depth-t.openStart!=e.depth-t.openEnd)throw new f_("Inconsistent open depths");return tNe(r,e,t,0)}function tNe(r,e,t,n){let i=r.index(n),o=r.node(n);if(i==e.index(n)&&n<r.depth-t.openStart){let a=tNe(r,e,t,n+1);return o.copy(o.content.replaceChild(i,a))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&r.depth==n&&e.depth==n){let a=r.parent,s=a.content;return h_(a,s.cut(0,r.parentOffset).append(t.content).append(s.cut(e.parentOffset)))}else{let{start:a,end:s}=_$t(t,r);return h_(o,nNe(r,a,s,e,n))}else return h_(o,ZN(r,e,n))}function rNe(r,e){if(!e.type.compatibleContent(r.type))throw new f_("Cannot join "+e.type.name+" onto "+r.type.name)}function IG(r,e,t){let n=r.node(t);return rNe(n,e.node(t)),n}function c_(r,e){let t=e.length-1;t>=0&&r.isText&&r.sameMarkup(e[t])?e[t]=r.withText(e[t].text+r.text):e.push(r)}function pD(r,e,t,n){let i=(e||r).node(t),o=0,a=e?e.index(t):i.childCount;r&&(o=r.index(t),r.depth>t?o++:r.textOffset&&(c_(r.nodeAfter,n),o++));for(let s=o;s<a;s++)c_(i.child(s),n);e&&e.depth==t&&e.textOffset&&c_(e.nodeBefore,n)}function h_(r,e){return r.type.checkContent(e),r.copy(e)}function nNe(r,e,t,n,i){let o=r.depth>i&&IG(r,e,i+1),a=n.depth>i&&IG(t,n,i+1),s=[];return pD(null,r,i,s),o&&a&&e.index(i)==t.index(i)?(rNe(o,a),c_(h_(o,nNe(r,e,t,n,i+1)),s)):(o&&c_(h_(o,ZN(r,e,i+1)),s),pD(e,t,i,s),a&&c_(h_(a,ZN(t,n,i+1)),s)),pD(n,null,i,s),new Wr(s)}function ZN(r,e,t){let n=[];if(pD(null,r,t,n),r.depth>t){let i=IG(r,e,t+1);c_(h_(i,ZN(r,e,t+1)),n)}return pD(e,null,t,n),new Wr(n)}function _$t(r,e){let t=e.depth-r.openStart,i=e.node(t).copy(r.content);for(let o=t-1;o>=0;o--)i=e.node(o).copy(Wr.from(i));return{start:i.resolveNoCache(r.openStart+t),end:i.resolveNoCache(i.content.size-r.openEnd-t)}}var JN=class r{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],i=e.child(t);return n?e.child(t).cut(n):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let o=0;o<e;o++)i+=n.child(o).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return $o.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),i=e.maybeChild(t);if(!n){let s=n;n=i,i=s}let o=n.marks;for(var a=0;a<o.length;a++)o[a].type.spec.inclusive===!1&&(!i||!o[a].isInSet(i.marks))&&(o=o[a--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<n.length;o++)n[o].type.spec.inclusive===!1&&(!i||!n[o].isInSet(i.marks))&&(n=n[o--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new d_(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],i=0,o=t;for(let a=e;;){let{index:s,offset:u}=a.content.findIndex(o),f=o-u;if(n.push(a,s,i+u),!f||(a=a.child(s),a.isText))break;o=f-1,i+=u+1}return new r(t,n,o)}static resolveCached(e,t){let n=Vqe.get(e);if(n)for(let o=0;o<n.elts.length;o++){let a=n.elts[o];if(a.pos==t)return a}else Vqe.set(e,n=new OG);let i=n.elts[n.i]=r.resolve(e,t);return n.i=(n.i+1)%w$t,i}},OG=class{constructor(){this.elts=[],this.i=0}},w$t=12,Vqe=new WeakMap,d_=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},S$t=Object.create(null),Sm=class r{constructor(e,t,n,i=$o.none){this.type=e,this.attrs=t,this.marks=i,this.content=n||Wr.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,i=0){this.content.nodesBetween(e,t,n,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,n,i){return this.content.textBetween(e,t,n,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&XN(this.attrs,t||e.defaultAttrs||S$t)&&$o.sameSet(this.marks,n||$o.none)}copy(e=null){return e==this.content?this:new r(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new r(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return Dn.empty;let i=this.resolve(e),o=this.resolve(t),a=n?0:i.sharedDepth(t),s=i.start(a),f=i.node(a).content.cut(i.pos-s,o.pos-s);return new Dn(f,i.depth-a,o.depth-a)}replace(e,t,n){return x$t(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let i=this.content.child(t-1);return{node:i,index:t-1,offset:n-i.nodeSize}}resolve(e){return JN.resolveCached(this,e)}resolveNoCache(e){return JN.resolve(this,e)}rangeHasMark(e,t,n){let i=!1;return t>e&&this.nodesBetween(e,t,o=>(n.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()+")"),iNe(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=Wr.empty,i=0,o=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,i,o),s=a&&a.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let u=i;u<o;u++)if(!this.type.allowsMarks(n.child(u).marks))return!1;return!0}canReplaceWith(e,t,n,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(n),a=o&&o.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=$o.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!$o.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let i=Wr.fromJSON(e,t.content),o=e.nodeType(t.type).create(t.attrs,i,n);return o.type.checkAttrs(o.attrs),o}};Sm.prototype.text=void 0;var MG=class r extends Sm{constructor(e,t,n,i){if(super(e,t,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):iNe(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new r(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new r(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function iNe(r,e){for(let t=r.length-1;t>=0;t--)e=r[t].type.name+"("+e+")";return e}var p_=class r{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new LG(e,t);if(n.next==null)return r.empty;let i=oNe(n);n.next&&n.err("Unexpected trailing text");let o=I$t(D$t(i));return O$t(o,n),o}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let i=this;for(let o=t;i&&o<n;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let i=[this];function o(a,s){let u=a.matchFragment(e,n);if(u&&(!t||u.validEnd))return Wr.from(s.map(f=>f.createAndFill()));for(let f=0;f<a.next.length;f++){let{type:d,next:b}=a.next[f];if(!(d.isText||d.hasRequiredAttrs())&&i.indexOf(b)==-1){i.push(b);let S=o(b,s.concat(d));if(S)return S}}return null}return o(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let i=n.shift(),o=i.match;if(o.matchType(e)){let a=[];for(let s=i;s.type;s=s.via)a.push(s.type);return a.reverse()}for(let a=0;a<o.next.length;a++){let{type:s,next:u}=o.next[a];!s.isLeaf&&!s.hasRequiredAttrs()&&!(s.name in t)&&(!i.type||u.validEnd)&&(n.push({match:s.contentMatch,type:s,via:i}),t[s.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let i=0;i<n.next.length;i++)e.indexOf(n.next[i].next)==-1&&t(n.next[i].next)}return t(this),e.map((n,i)=>{let o=i+(n.validEnd?"*":" ")+" ";for(let a=0;a<n.next.length;a++)o+=(a?", ":"")+n.next[a].type.name+"->"+e.indexOf(n.next[a].next);return o}).join(`
759
+ `}var qqe=(r,e)=>{let t;return(...n)=>(t&&clearTimeout(t),new Promise(i=>{t=setTimeout(()=>i(r(...n)),e)}))};function Nqe(r){return mm(r)??document.body}function Bqe(r){let e=r.dropdown.position;r.dropdown.position=t=>{e(t),b$t(r,t)}}function b$t(r,e){let t=r.DOM.dropdown;if(!mm(r.DOM.scope)||!t)return;let n=r.DOM.scope.getBoundingClientRect(),i=e||t.offsetHeight,a=t.getAttribute("placement")==="top"?n.top-i:n.bottom;t.style.top=`${Math.round(a)}px`,t.style.left=`${Math.round(n.left)}px`}var HN=class extends Wt{static targets=["input","fakeInput"];static values={whitelistItems:{type:Array,default:[]},disallowedItems:{type:Array,default:[]},enforceSuggestions:{type:Boolean,default:!1},closeOnSelect:{type:Boolean,default:!1},delimiters:{type:Array,default:[]},suggestionsMaxItems:{type:Number,default:20},mode:String,fetchValuesFrom:String};tagify=null;searchDebounce=500;searchCount=0;debouncedFetch=qqe(fetch,this.searchDebounce);get suggestionsAreObjects(){return(0,u_.isObject)((0,u_.first)(this.whitelistItemsValue))||this.fetchValuesFromValue}get tagifyOptions(){let r={whitelist:this.whitelistItemsValue,blacklist:this.disallowedItemsValue,enforceWhitelist:this.enforceSuggestionsValue,delimiters:this.delimitersValue.join("|"),dropdown:{maxItems:this.suggestionsMaxItemsValue,enabled:0,searchKeys:[this.labelAttributeValue],closeOnSelect:this.closeOnSelectValue,appendTarget:()=>Nqe(this.element)}};return this.modeValue&&(r.mode=this.modeValue),this.suggestionsAreObjects?r=(0,u_.merge)(r,{tagTextProp:"label",dropdown:{searchKeys:["label"],mapValueTo:"value"},templates:{tag:Rqe,dropdownItem:Fqe},originalInputValueFormat:e=>e.map(t=>t.value)}):r=(0,u_.merge)(r,{originalInputValueFormat:e=>e.map(t=>t.value).join(this.delimitersValue[0])}),r}connect(){this.hasInputTarget&&(this.hideFakeInput(),this.showRealInput(),this.initTagify())}disconnect(){this.tagify&&(this.tagify.destroy(),this.tagify=null)}initTagify(){this.tagify=new dD(this.inputTarget,this.tagifyOptions);let r=this;Bqe(this.tagify);function e(t){let n=t.detail.value,i=new zqe.default(r.fetchValuesFromValue);i.addSearch({q:n});let o=++r.searchCount;r.tagify.whitelist=null,r.tagify.loading(!0),r.fetchResults(i.toString()).then(a=>{o===r.searchCount&&(r.tagify.settings.whitelist=a,r.tagify.loading(!1).dropdown.show(t.detail.value))}).catch(()=>r.tagify.dropdown.hide())}this.fetchValuesFromValue&&this.tagify.on("input",e)}fetchResults(r){return this.debouncedFetch(r).then(e=>e.json())}hideFakeInput(){this.fakeInputTarget.classList.add("!hidden")}showRealInput(){this.inputTarget.classList.remove("!hidden")}};var WN=class extends xf{static targets=["text"];getFilterValue(){return this.textTarget.value}tryToSubmit(r){if(r.keyCode===13)return this.changeFilter()}getFilterClass(){let{filterClass:r}=this.textTarget.dataset;return r}};var $N=class extends Wt{static values={lightUrl:String,darkUrl:String};connect(){if(!this.lightUrlValue||!this.darkUrlValue)return;let r=document.documentElement;this.observer=new MutationObserver(()=>this.sync()),this.observer.observe(r,{attributes:!0,attributeFilter:["class"]}),this.sync()}disconnect(){this.observer&&this.observer.disconnect()}sync(){let r=this.element,e=document.documentElement.classList.contains("dark")?this.darkUrlValue:this.lightUrlValue;!e||r.getAttribute("href")===e||r.setAttribute("href",e)}};var KN=class extends Wt{static targets=["source","content"];connect(){this.tippyInstance=iS(this.sourceTarget,{content:this.contentTarget.innerHTML,allowHTML:!0,theme:"basic",appendTo:r=>mm(r)??document.body})}disconnect(){this.tippyInstance&&(this.tippyInstance.destroy(),this.tippyInstance=null)}};var Uqe=Object.defineProperty,jqe=(r,e)=>{let t={};for(var n in r)Uqe(t,n,{get:r[n],enumerable:!0});return e||Uqe(t,Symbol.toStringTag,{value:"Module"}),t};function Gc(r){this.content=r}Gc.prototype={constructor:Gc,find:function(r){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===r)return e;return-1},get:function(r){var e=this.find(r);return e==-1?void 0:this.content[e+1]},update:function(r,e,t){var n=t&&t!=r?this.remove(t):this,i=n.find(r),o=n.content.slice();return i==-1?o.push(t||r,e):(o[i+1]=e,t&&(o[i]=t)),new Gc(o)},remove:function(r){var e=this.find(r);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Gc(t)},addToStart:function(r,e){return new Gc([r,e].concat(this.remove(r).content))},addToEnd:function(r,e){var t=this.remove(r).content.slice();return t.push(r,e),new Gc(t)},addBefore:function(r,e,t){var n=this.remove(e),i=n.content.slice(),o=n.find(r);return i.splice(o==-1?i.length:o,0,e,t),new Gc(i)},forEach:function(r){for(var e=0;e<this.content.length;e+=2)r(this.content[e],this.content[e+1])},prepend:function(r){return r=Gc.from(r),r.size?new Gc(r.content.concat(this.subtract(r).content)):this},append:function(r){return r=Gc.from(r),r.size?new Gc(this.subtract(r).content.concat(r.content)):this},subtract:function(r){var e=this;r=Gc.from(r);for(var t=0;t<r.content.length;t+=2)e=e.remove(r.content[t]);return e},toObject:function(){var r={};return this.forEach(function(e,t){r[e]=t}),r},get size(){return this.content.length>>1}};Gc.from=function(r){if(r instanceof Gc)return r;var e=[];if(r)for(var t in r)e.push(t,r[t]);return new Gc(e)};var AG=Gc;function Zqe(r,e,t){for(let n=0;;n++){if(n==r.childCount||n==e.childCount)return r.childCount==e.childCount?null:t;let i=r.child(n),o=e.child(n);if(i==o){t+=i.nodeSize;continue}if(!i.sameMarkup(o))return t;if(i.isText&&i.text!=o.text){for(let a=0;i.text[a]==o.text[a];a++)t++;return t}if(i.content.size||o.content.size){let a=Zqe(i.content,o.content,t+1);if(a!=null)return a}t+=i.nodeSize}}function Jqe(r,e,t,n){for(let i=r.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:t,b:n};let a=r.child(--i),s=e.child(--o),u=a.nodeSize;if(a==s){t-=u,n-=u;continue}if(!a.sameMarkup(s))return{a:t,b:n};if(a.isText&&a.text!=s.text){let f=0,d=Math.min(a.text.length,s.text.length);for(;f<d&&a.text[a.text.length-f-1]==s.text[s.text.length-f-1];)f++,t--,n--;return{a:t,b:n}}if(a.content.size||s.content.size){let f=Jqe(a.content,s.content,t-1,n-1);if(f)return f}t-=u,n-=u}}var Wr=class r{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,t,n,i=0,o){for(let a=0,s=0;s<t;a++){let u=this.content[a],f=s+u.nodeSize;if(f>e&&n(u,i+s,o||null,a)!==!1&&u.content.size){let d=s+1;u.nodesBetween(Math.max(0,e-d),Math.min(u.content.size,t-d),n,i+d)}s=f}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,i){let o="",a=!0;return this.nodesBetween(e,t,(s,u)=>{let f=s.isText?s.text.slice(Math.max(e,u)-u,t-u):s.isLeaf?i?typeof i=="function"?i(s):i:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&f||s.isTextblock)&&n&&(a?a=!1:o+=n),o+=f},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,i=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(n)&&(i[i.length-1]=t.withText(t.text+n.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new r(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let n=[],i=0;if(t>e)for(let o=0,a=0;a<t;o++){let s=this.content[o],u=a+s.nodeSize;u>e&&((a<e||u>t)&&(s.isText?s=s.cut(Math.max(0,e-a),Math.min(s.text.length,t-a)):s=s.cut(Math.max(0,e-a-1),Math.min(s.content.size,t-a-1))),n.push(s),i+=s.nodeSize),a=u}return new r(n,i)}cutByIndex(e,t){return e==t?r.empty:e==0&&t==this.content.length?this:new r(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let i=this.content.slice(),o=this.size+t.nodeSize-n.nodeSize;return i[e]=t,new r(i,o)}addToStart(e){return new r([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new r(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let i=this.content[t];e(i,n,t),n+=i.nodeSize}}findDiffStart(e,t=0){return Zqe(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return Jqe(this,e,t,n)}findIndex(e,t=-1){if(e==0)return GN(0,e);if(e==this.size)return GN(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,i=0;;n++){let o=this.child(n),a=i+o.nodeSize;if(a>=e)return a==e||t>0?GN(n+1,a):GN(n,i);i=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return r.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new r(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return r.empty;let t,n=0;for(let i=0;i<e.length;i++){let o=e[i];n+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(t||(t=e.slice(0,i)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new r(t||e,n)}static from(e){if(!e)return r.empty;if(e instanceof r)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new r([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}};Wr.empty=new Wr([],0);var CG={index:0,offset:0};function GN(r,e){return CG.index=r,CG.offset=e,CG}function XN(r,e){if(r===e)return!0;if(!(r&&typeof r=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(r);if(Array.isArray(e)!=t)return!1;if(t){if(r.length!=e.length)return!1;for(let n=0;n<r.length;n++)if(!XN(r[n],e[n]))return!1}else{for(let n in r)if(!(n in e)||!XN(r[n],e[n]))return!1;for(let n in e)if(!(n in r))return!1}return!0}var $o=class r{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!n&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),n=!0),t&&t.push(o)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&XN(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);let i=n.create(t.attrs);return n.checkAttrs(i.attrs),i}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return r.none;if(e instanceof r)return[e];let t=e.slice();return t.sort((n,i)=>n.type.rank-i.type.rank),t}};$o.none=[];var f_=class extends Error{},Dn=class r{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=eNe(this.content,e+this.openStart,t);return n&&new r(n,this.openStart,this.openEnd)}removeBetween(e,t){return new r(Qqe(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return r.empty;let n=t.openStart||0,i=t.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new r(Wr.fromJSON(e,t.content),n,i)}static maxOpen(e,t=!0){let n=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)n++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)i++;return new r(e,n,i)}};Dn.empty=new Dn(Wr.empty,0,0);function Qqe(r,e,t){let{index:n,offset:i}=r.findIndex(e),o=r.maybeChild(n),{index:a,offset:s}=r.findIndex(t);if(i==e||o.isText){if(s!=t&&!r.child(a).isText)throw new RangeError("Removing non-flat range");return r.cut(0,e).append(r.cut(t))}if(n!=a)throw new RangeError("Removing non-flat range");return r.replaceChild(n,o.copy(Qqe(o.content,e-i-1,t-i-1)))}function eNe(r,e,t,n){let{index:i,offset:o}=r.findIndex(e),a=r.maybeChild(i);if(o==e||a.isText)return n&&!n.canReplace(i,i,t)?null:r.cut(0,e).append(t).append(r.cut(e));let s=eNe(a.content,e-o-1,t);return s&&r.replaceChild(i,a.copy(s))}function x$t(r,e,t){if(t.openStart>r.depth)throw new f_("Inserted content deeper than insertion position");if(r.depth-t.openStart!=e.depth-t.openEnd)throw new f_("Inconsistent open depths");return tNe(r,e,t,0)}function tNe(r,e,t,n){let i=r.index(n),o=r.node(n);if(i==e.index(n)&&n<r.depth-t.openStart){let a=tNe(r,e,t,n+1);return o.copy(o.content.replaceChild(i,a))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&r.depth==n&&e.depth==n){let a=r.parent,s=a.content;return h_(a,s.cut(0,r.parentOffset).append(t.content).append(s.cut(e.parentOffset)))}else{let{start:a,end:s}=_$t(t,r);return h_(o,nNe(r,a,s,e,n))}else return h_(o,ZN(r,e,n))}function rNe(r,e){if(!e.type.compatibleContent(r.type))throw new f_("Cannot join "+e.type.name+" onto "+r.type.name)}function IG(r,e,t){let n=r.node(t);return rNe(n,e.node(t)),n}function c_(r,e){let t=e.length-1;t>=0&&r.isText&&r.sameMarkup(e[t])?e[t]=r.withText(e[t].text+r.text):e.push(r)}function pD(r,e,t,n){let i=(e||r).node(t),o=0,a=e?e.index(t):i.childCount;r&&(o=r.index(t),r.depth>t?o++:r.textOffset&&(c_(r.nodeAfter,n),o++));for(let s=o;s<a;s++)c_(i.child(s),n);e&&e.depth==t&&e.textOffset&&c_(e.nodeBefore,n)}function h_(r,e){return r.type.checkContent(e),r.copy(e)}function nNe(r,e,t,n,i){let o=r.depth>i&&IG(r,e,i+1),a=n.depth>i&&IG(t,n,i+1),s=[];return pD(null,r,i,s),o&&a&&e.index(i)==t.index(i)?(rNe(o,a),c_(h_(o,nNe(r,e,t,n,i+1)),s)):(o&&c_(h_(o,ZN(r,e,i+1)),s),pD(e,t,i,s),a&&c_(h_(a,ZN(t,n,i+1)),s)),pD(n,null,i,s),new Wr(s)}function ZN(r,e,t){let n=[];if(pD(null,r,t,n),r.depth>t){let i=IG(r,e,t+1);c_(h_(i,ZN(r,e,t+1)),n)}return pD(e,null,t,n),new Wr(n)}function _$t(r,e){let t=e.depth-r.openStart,i=e.node(t).copy(r.content);for(let o=t-1;o>=0;o--)i=e.node(o).copy(Wr.from(i));return{start:i.resolveNoCache(r.openStart+t),end:i.resolveNoCache(i.content.size-r.openEnd-t)}}var JN=class r{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],i=e.child(t);return n?e.child(t).cut(n):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let o=0;o<e;o++)i+=n.child(o).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return $o.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),i=e.maybeChild(t);if(!n){let s=n;n=i,i=s}let o=n.marks;for(var a=0;a<o.length;a++)o[a].type.spec.inclusive===!1&&(!i||!o[a].isInSet(i.marks))&&(o=o[a--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<n.length;o++)n[o].type.spec.inclusive===!1&&(!i||!n[o].isInSet(i.marks))&&(n=n[o--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new d_(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],i=0,o=t;for(let a=e;;){let{index:s,offset:u}=a.content.findIndex(o),f=o-u;if(n.push(a,s,i+u),!f||(a=a.child(s),a.isText))break;o=f-1,i+=u+1}return new r(t,n,o)}static resolveCached(e,t){let n=Vqe.get(e);if(n)for(let o=0;o<n.elts.length;o++){let a=n.elts[o];if(a.pos==t)return a}else Vqe.set(e,n=new OG);let i=n.elts[n.i]=r.resolve(e,t);return n.i=(n.i+1)%w$t,i}},OG=class{constructor(){this.elts=[],this.i=0}},w$t=12,Vqe=new WeakMap,d_=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},S$t=Object.create(null),Sm=class r{constructor(e,t,n,i=$o.none){this.type=e,this.attrs=t,this.marks=i,this.content=n||Wr.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,i=0){this.content.nodesBetween(e,t,n,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,n,i){return this.content.textBetween(e,t,n,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&XN(this.attrs,t||e.defaultAttrs||S$t)&&$o.sameSet(this.marks,n||$o.none)}copy(e=null){return e==this.content?this:new r(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new r(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return Dn.empty;let i=this.resolve(e),o=this.resolve(t),a=n?0:i.sharedDepth(t),s=i.start(a),f=i.node(a).content.cut(i.pos-s,o.pos-s);return new Dn(f,i.depth-a,o.depth-a)}replace(e,t,n){return x$t(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let i=this.content.child(t-1);return{node:i,index:t-1,offset:n-i.nodeSize}}resolve(e){return JN.resolveCached(this,e)}resolveNoCache(e){return JN.resolve(this,e)}rangeHasMark(e,t,n){let i=!1;return t>e&&this.nodesBetween(e,t,o=>(n.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()+")"),iNe(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=Wr.empty,i=0,o=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,i,o),s=a&&a.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let u=i;u<o;u++)if(!this.type.allowsMarks(n.child(u).marks))return!1;return!0}canReplaceWith(e,t,n,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(n),a=o&&o.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=$o.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!$o.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let i=Wr.fromJSON(e,t.content),o=e.nodeType(t.type).create(t.attrs,i,n);return o.type.checkAttrs(o.attrs),o}};Sm.prototype.text=void 0;var MG=class r extends Sm{constructor(e,t,n,i){if(super(e,t,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):iNe(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new r(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new r(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function iNe(r,e){for(let t=r.length-1;t>=0;t--)e=r[t].type.name+"("+e+")";return e}var p_=class r{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new LG(e,t);if(n.next==null)return r.empty;let i=oNe(n);n.next&&n.err("Unexpected trailing text");let o=I$t(D$t(i));return O$t(o,n),o}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let i=this;for(let o=t;i&&o<n;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let i=[this];function o(a,s){let u=a.matchFragment(e,n);if(u&&(!t||u.validEnd))return Wr.from(s.map(f=>f.createAndFill()));for(let f=0;f<a.next.length;f++){let{type:d,next:b}=a.next[f];if(!(d.isText||d.hasRequiredAttrs())&&i.indexOf(b)==-1){i.push(b);let S=o(b,s.concat(d));if(S)return S}}return null}return o(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let i=n.shift(),o=i.match;if(o.matchType(e)){let a=[];for(let s=i;s.type;s=s.via)a.push(s.type);return a.reverse()}for(let a=0;a<o.next.length;a++){let{type:s,next:u}=o.next[a];!s.isLeaf&&!s.hasRequiredAttrs()&&!(s.name in t)&&(!i.type||u.validEnd)&&(n.push({match:s.contentMatch,type:s,via:i}),t[s.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let i=0;i<n.next.length;i++)e.indexOf(n.next[i].next)==-1&&t(n.next[i].next)}return t(this),e.map((n,i)=>{let o=i+(n.validEnd?"*":" ")+" ";for(let a=0;a<n.next.length;a++)o+=(a?", ":"")+n.next[a].type.name+"->"+e.indexOf(n.next[a].next);return o}).join(`
760
760
  `)}};p_.empty=new p_(!0);var LG=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}};function oNe(r){let e=[];do e.push(T$t(r));while(r.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function T$t(r){let e=[];do e.push(E$t(r));while(r.next&&r.next!=")"&&r.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function E$t(r){let e=C$t(r);for(;;)if(r.eat("+"))e={type:"plus",expr:e};else if(r.eat("*"))e={type:"star",expr:e};else if(r.eat("?"))e={type:"opt",expr:e};else if(r.eat("{"))e=k$t(r,e);else break;return e}function Hqe(r){/\D/.test(r.next)&&r.err("Expected number, got '"+r.next+"'");let e=Number(r.next);return r.pos++,e}function k$t(r,e){let t=Hqe(r),n=t;return r.eat(",")&&(r.next!="}"?n=Hqe(r):n=-1),r.eat("}")||r.err("Unclosed braced range"),{type:"range",min:t,max:n,expr:e}}function A$t(r,e){let t=r.nodeTypes,n=t[e];if(n)return[n];let i=[];for(let o in t){let a=t[o];a.groups.indexOf(e)>-1&&i.push(a)}return i.length==0&&r.err("No node type or group '"+e+"' found"),i}function C$t(r){if(r.eat("(")){let e=oNe(r);return r.eat(")")||r.err("Missing closing paren"),e}else if(/\W/.test(r.next))r.err("Unexpected token '"+r.next+"'");else{let e=A$t(r,r.next).map(t=>(r.inline==null?r.inline=t.isInline:r.inline!=t.isInline&&r.err("Mixing inline and block content"),{type:"name",value:t}));return r.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function D$t(r){let e=[[]];return i(o(r,0),t()),e;function t(){return e.push([])-1}function n(a,s,u){let f={term:u,to:s};return e[a].push(f),f}function i(a,s){a.forEach(u=>u.to=s)}function o(a,s){if(a.type=="choice")return a.exprs.reduce((u,f)=>u.concat(o(f,s)),[]);if(a.type=="seq")for(let u=0;;u++){let f=o(a.exprs[u],s);if(u==a.exprs.length-1)return f;i(f,s=t())}else if(a.type=="star"){let u=t();return n(s,u),i(o(a.expr,u),u),[n(u)]}else if(a.type=="plus"){let u=t();return i(o(a.expr,s),u),i(o(a.expr,u),u),[n(u)]}else{if(a.type=="opt")return[n(s)].concat(o(a.expr,s));if(a.type=="range"){let u=s;for(let f=0;f<a.min;f++){let d=t();i(o(a.expr,u),d),u=d}if(a.max==-1)i(o(a.expr,u),u);else for(let f=a.min;f<a.max;f++){let d=t();n(u,d),i(o(a.expr,u),d),u=d}return[n(u)]}else{if(a.type=="name")return[n(s,void 0,a.value)];throw new Error("Unknown expr type")}}}}function aNe(r,e){return e-r}function Wqe(r,e){let t=[];return n(e),t.sort(aNe);function n(i){let o=r[i];if(o.length==1&&!o[0].term)return n(o[0].to);t.push(i);for(let a=0;a<o.length;a++){let{term:s,to:u}=o[a];!s&&t.indexOf(u)==-1&&n(u)}}}function I$t(r){let e=Object.create(null);return t(Wqe(r,0));function t(n){let i=[];n.forEach(a=>{r[a].forEach(({term:s,to:u})=>{if(!s)return;let f;for(let d=0;d<i.length;d++)i[d][0]==s&&(f=i[d][1]);Wqe(r,u).forEach(d=>{f||i.push([s,f=[]]),f.indexOf(d)==-1&&f.push(d)})})});let o=e[n.join(",")]=new p_(n.indexOf(r.length-1)>-1);for(let a=0;a<i.length;a++){let s=i[a][1].sort(aNe);o.next.push({type:i[a][0],next:e[s.join(",")]||t(s)})}return o}}function O$t(r,e){for(let t=0,n=[r];t<n.length;t++){let i=n[t],o=!i.validEnd,a=[];for(let s=0;s<i.next.length;s++){let{type:u,next:f}=i.next[s];a.push(u.name),o&&!(u.isText||u.hasRequiredAttrs())&&(o=!1),n.indexOf(f)==-1&&n.push(f)}o&&e.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function sNe(r){let e=Object.create(null);for(let t in r){let n=r[t];if(!n.hasDefault)return null;e[t]=n.default}return e}function lNe(r,e){let t=Object.create(null);for(let n in r){let i=e&&e[n];if(i===void 0){let o=r[n];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+n)}t[n]=i}return t}function uNe(r,e,t,n){for(let i in e)if(!(i in r))throw new RangeError(`Unsupported attribute ${i} for ${t} of type ${i}`);for(let i in r){let o=r[i];o.validate&&o.validate(e[i])}}function cNe(r,e){let t=Object.create(null);if(e)for(let n in e)t[n]=new PG(r,n,e[n]);return t}var QN=class r{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=cNe(e,n.attrs),this.defaultAttrs=sNe(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==p_.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:lNe(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Sm(this,this.computeAttrs(e),Wr.from(t),$o.setFrom(n))}createChecked(e=null,t,n){return t=Wr.from(t),this.checkContent(t),new Sm(this,this.computeAttrs(e),t,$o.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=Wr.from(t),t.size){let a=this.contentMatch.fillBefore(t);if(!a)return null;t=a.append(t)}let i=this.contentMatch.matchFragment(t),o=i&&i.fillBefore(Wr.empty,!0);return o?new Sm(this,e,t.append(o),$o.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){uNe(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:$o.none:e}static compile(e,t){let n=Object.create(null);e.forEach((o,a)=>n[o]=new r(o,t,a));let i=t.spec.topNode||"doc";if(!n[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let o in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};function M$t(r,e,t){let n=t.split("|");return i=>{let o=i===null?"null":typeof i;if(n.indexOf(o)<0)throw new RangeError(`Expected value of type ${n} for attribute ${e} on type ${r}, got ${o}`)}}var PG=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate=typeof n.validate=="string"?M$t(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},gD=class r{constructor(e,t,n,i){this.name=e,this.rank=t,this.schema=n,this.spec=i,this.attrs=cNe(e,i.attrs),this.excluded=null;let o=sNe(this.attrs);this.instance=o?new $o(this,o):null}create(e=null){return!e&&this.instance?this.instance:new $o(this,lNe(this.attrs,e))}static compile(e,t){let n=Object.create(null),i=0;return e.forEach((o,a)=>n[o]=new r(o,i++,t,a)),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){uNe(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},vD=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=AG.from(e.nodes),t.marks=AG.from(e.marks||{}),this.nodes=QN.compile(this.spec.nodes,this),this.marks=gD.compile(this.spec.marks,this);let n=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],a=o.spec.content||"",s=o.spec.marks;if(o.contentMatch=n[a]||(n[a]=p_.parse(a,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=s=="_"?null:s?$qe(this,s.split(" ")):s==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],a=o.spec.excludes;o.excluded=a==null?[o]:a==""?[]:$qe(this,a.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof QN){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,n,i)}text(e,t){let n=this.nodes.text;return new MG(n,n.defaultAttrs,e,$o.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return Sm.fromJSON(this,e)}markFromJSON(e){return $o.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}};function $qe(r,e){let t=[];for(let n=0;n<e.length;n++){let i=e[n],o=r.marks[i],a=o;if(o)t.push(o);else for(let s in r.marks){let u=r.marks[s];(i=="_"||u.spec.group&&u.spec.group.split(" ").indexOf(i)>-1)&&t.push(a=u)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[n]+"'")}return t}function L$t(r){return r.tag!=null}function P$t(r){return r.style!=null}var $v=class r{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(i=>{if(L$t(i))this.tags.push(i);else if(P$t(i)){let o=/[^=]*/.exec(i.style)[0];n.indexOf(o)<0&&n.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=e.nodes[i.node];return o.contentMatch.matchType(o)})}parse(e,t={}){let n=new rB(this,t,!1);return n.addAll(e,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new rB(this,t,!0);return n.addAll(e,t.from,t.to),Dn.maxOpen(n.finish())}matchTag(e,t,n){for(let i=n?this.tags.indexOf(n)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(q$t(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||t.matchesContext(o.context))){if(o.getAttrs){let a=o.getAttrs(e);if(a===!1)continue;o.attrs=a||void 0}return o}}}matchStyle(e,t,n,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let a=this.styles[o],s=a.style;if(!(s.indexOf(e)!=0||a.context&&!n.matchesContext(a.context)||s.length>e.length&&(s.charCodeAt(e.length)!=61||s.slice(e.length+1)!=t))){if(a.getAttrs){let u=a.getAttrs(t);if(u===!1)continue;a.attrs=u||void 0}return a}}}static schemaRules(e){let t=[];function n(i){let o=i.priority==null?50:i.priority,a=0;for(;a<t.length;a++){let s=t[a];if((s.priority==null?50:s.priority)<o)break}t.splice(a,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(a=>{n(a=Gqe(a)),a.mark||a.ignore||a.clearMark||(a.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(a=>{n(a=Gqe(a)),a.node||a.ignore||a.mark||(a.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new r(e,r.schemaRules(e)))}},hNe={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},R$t={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},fNe={ol:!0,ul:!0},eB=1,tB=2,mD=4;function Kqe(r,e,t){return e!=null?(e?eB:0)|(e==="full"?tB:0):r&&r.whitespace=="pre"?eB|tB:t&~mD}var GS=class{constructor(e,t,n,i,o,a,s){this.type=e,this.attrs=t,this.marks=n,this.pendingMarks=i,this.solid=o,this.options=s,this.content=[],this.activeMarks=$o.none,this.stashMarks=[],this.match=a||(s&mD?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(Wr.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let n=this.type.contentMatch,i;return(i=n.findWrapping(e.type))?(this.match=n,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&eB)){let n=this.content[this.content.length-1],i;if(n&&n.isText&&(i=/[ \t\r\n\u000c]+$/.exec(n.text))){let o=n;n.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 t=Wr.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(Wr.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,n=this.pendingMarks;t<n.length;t++){let i=n[t];(this.type?this.type.allowsMarkType(i.type):N$t(i.type,e))&&!i.isInSet(this.activeMarks)&&(this.activeMarks=i.addToSet(this.activeMarks),this.pendingMarks=i.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!hNe.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},rB=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0;let i=t.topNode,o,a=Kqe(null,t.preserveWhitespace,0)|(n?mD:0);i?o=new GS(i.type,i.attrs,$o.none,$o.none,!0,t.topMatch||i.type.contentMatch,a):n?o=new GS(null,null,$o.none,$o.none,!0,null,a):o=new GS(e.schema.topNodeType,null,$o.none,$o.none,!0,null,a),this.nodes=[o],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){e.nodeType==3?this.addTextNode(e):e.nodeType==1&&this.addElement(e)}withStyleRules(e,t){let n=e.style;if(!n||!n.length)return t();let i=this.readStyles(e.style);if(!i)return;let[o,a]=i,s=this.top;for(let u=0;u<a.length;u++)this.removePendingMark(a[u],s);for(let u=0;u<o.length;u++)this.addPendingMark(o[u]);t();for(let u=0;u<o.length;u++)this.removePendingMark(o[u],s);for(let u=0;u<a.length;u++)this.addPendingMark(a[u])}addTextNode(e){let t=e.nodeValue,n=this.top;if(n.options&tB||n.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(n.options&eB)n.options&tB?t=t.replace(/\r\n?/g,`
761
761
  `):t=t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){let i=n.content[n.content.length-1],o=e.previousSibling;(!i||o&&o.nodeName=="BR"||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)}addElement(e,t){let n=e.nodeName.toLowerCase(),i;fNe.hasOwnProperty(n)&&this.parser.normalizeLists&&F$t(e);let o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(i=this.parser.matchTag(e,this,t));if(o?o.ignore:R$t.hasOwnProperty(n))this.findInside(e),this.ignoreFallback(e);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(e=o.skip);let a,s=this.top,u=this.needsBlock;if(hNe.hasOwnProperty(n))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),a=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e);return}o&&o.skip?this.addAll(e):this.withStyleRules(e,()=>this.addAll(e)),a&&this.sync(s),this.needsBlock=u}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(`
762
762
  `))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=$o.none,n=$o.none;if(e.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let o=this.parser.matchedStyles[i],a=e.getPropertyValue(o);if(a)for(let s=void 0;;){let u=this.parser.matchStyle(o,a,this,s);if(!u)break;if(u.ignore)return null;if(u.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach(f=>{u.clearMark(f)&&(n=f.addToSet(n))}):t=this.parser.schema.marks[u.mark].create(u.attrs).addToSet(t),u.consuming===!1)s=u;else break}}return[t,n]}addElementByRule(e,t,n){let i,o,a;t.node?(o=this.parser.schema.nodes[t.node],o.isLeaf?this.insertNode(o.create(t.attrs))||this.leafFallback(e):i=this.enter(o,t.attrs||null,t.preserveWhitespace)):(a=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(a));let s=this.top;if(o&&o.isLeaf)this.findInside(e);else if(n)this.addElement(e,n);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(u=>this.insertNode(u));else{let u=e;typeof t.contentElement=="string"?u=e.querySelector(t.contentElement):typeof t.contentElement=="function"?u=t.contentElement(e):t.contentElement&&(u=t.contentElement),this.findAround(e,u,!0),this.addAll(u)}i&&this.sync(s)&&this.open--,a&&this.removePendingMark(a,s)}addAll(e,t,n){let i=t||0;for(let o=t?e.childNodes[t]:e.firstChild,a=n==null?null:e.childNodes[n];o!=a;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let t,n;for(let i=this.open;i>=0;i--){let o=this.nodes[i],a=o.findWrapping(e);if(a&&(!t||t.length>a.length)&&(t=a,n=o,!a.length)||o.solid)break}if(!t)return!1;this.sync(n);for(let i=0;i<t.length;i++)this.enterInner(t[i],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(e)){this.closeExtra();let t=this.top;t.applyPending(e.type),t.match&&(t.match=t.match.matchType(e.type));let n=t.activeMarks;for(let i=0;i<e.marks.length;i++)(!t.type||t.type.allowsMarkType(e.marks[i].type))&&(n=e.marks[i].addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n){let i=this.findPlace(e.create(t));return i&&this.enterInner(e,t,!0,n),i}enterInner(e,t=null,n=!1,i){this.closeExtra();let o=this.top;o.applyPending(e),o.match=o.match&&o.match.matchType(e);let a=Kqe(e,i,o.options);o.options&mD&&o.content.length==0&&(a|=mD),this.nodes.push(new GS(e,t,o.activeMarks,o.pendingMarks,n,null,a)),this.open++}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let i=n.length-1;i>=0;i--)e+=n[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&t.compareDocumentPosition(this.find[i].node)&(n?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,i=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),o=-(n?n.depth+1:0)+(i?0:1),a=(s,u)=>{for(;s>=0;s--){let f=t[s];if(f==""){if(s==t.length-1||s==0)continue;for(;u>=o;u--)if(a(s-1,u))return!0;return!1}else{let d=u>0||u==0&&i?this.nodes[u].type:n&&u>=o?n.node(u-o).type:null;if(!d||d.name!=f&&d.groups.indexOf(f)==-1)return!1;u--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let n=this.parser.schema.nodes[t];if(n.isTextblock&&n.defaultAttrs)return n}}addPendingMark(e){let t=B$t(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let n=this.open;n>=0;n--){let i=this.nodes[n];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let a=i.popFromStashMark(e);a&&i.type&&i.type.allowsMarkType(a.type)&&(i.activeMarks=a.addToSet(i.activeMarks))}if(i==t)break}}};function F$t(r){for(let e=r.firstChild,t=null;e;e=e.nextSibling){let n=e.nodeType==1?e.nodeName.toLowerCase():null;n&&fNe.hasOwnProperty(n)&&t?(t.appendChild(e),e=t):n=="li"?t=e:n&&(t=null)}}function q$t(r,e){return(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,e)}function Gqe(r){let e={};for(let t in r)e[t]=r[t];return e}function N$t(r,e){let t=e.schema.nodes;for(let n in t){let i=t[n];if(!i.allowsMarkType(r))continue;let o=[],a=s=>{o.push(s);for(let u=0;u<s.edgeCount;u++){let{type:f,next:d}=s.edge(u);if(f==e||o.indexOf(d)<0&&a(d))return!0}};if(a(i.contentMatch))return!0}}function B$t(r,e){for(let t=0;t<e.length;t++)if(r.eq(e[t]))return e[t]}var Kv=class r{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=DG(t).createDocumentFragment());let i=n,o=[];return e.forEach(a=>{if(o.length||a.marks.length){let s=0,u=0;for(;s<o.length&&u<a.marks.length;){let f=a.marks[u];if(!this.marks[f.type.name]){u++;continue}if(!f.eq(o[s][0])||f.type.spec.spanning===!1)break;s++,u++}for(;s<o.length;)i=o.pop()[1];for(;u<a.marks.length;){let f=a.marks[u++],d=this.serializeMark(f,a.isInline,t);d&&(o.push([f,i]),i.appendChild(d.dom),i=d.contentDOM||d.dom)}}i.appendChild(this.serializeNodeInner(a,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:i}=YN(DG(t),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}serializeMark(e,t,n={}){let i=this.marks[e.type.name];return i&&YN(DG(n),i(e,t),null,e.attrs)}static renderSpec(e,t,n=null,i){return YN(e,t,n,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new r(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Yqe(e.nodes);return t.text||(t.text=n=>n.text),t}static marksFromSchema(e){return Yqe(e.marks)}};function Yqe(r){let e={};for(let t in r){let n=r[t].spec.toDOM;n&&(e[t]=n)}return e}function DG(r){return r.document||window.document}var Xqe=new WeakMap;function z$t(r){let e=Xqe.get(r);return e===void 0&&Xqe.set(r,e=U$t(r)),e}function U$t(r){let e=null;function t(n){if(n&&typeof n=="object")if(Array.isArray(n))if(typeof n[0]=="string")e||(e=[]),e.push(n);else for(let i=0;i<n.length;i++)t(n[i]);else for(let i in n)t(n[i])}return t(r),e}function YN(r,e,t,n){if(typeof e=="string")return{dom:r.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],o;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(n&&(o=z$t(n))&&o.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let a=i.indexOf(" ");a>0&&(t=i.slice(0,a),i=i.slice(a+1));let s,u=t?r.createElementNS(t,i):r.createElement(i),f=e[1],d=1;if(f&&typeof f=="object"&&f.nodeType==null&&!Array.isArray(f)){d=2;for(let b in f)if(f[b]!=null){let S=b.indexOf(" ");S>0?u.setAttributeNS(b.slice(0,S),b.slice(S+1),f[b]):u.setAttribute(b,f[b])}}for(let b=d;b<e.length;b++){let S=e[b];if(S===0){if(b<e.length-1||b>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}else{let{dom:C,contentDOM:O}=YN(r,S,t,n);if(u.appendChild(C),O){if(s)throw new RangeError("Multiple content holes");s=O}}}return{dom:u,contentDOM:s}}var mNe=65535,gNe=Math.pow(2,16);function j$t(r,e){return r+e*gNe}function dNe(r){return r&mNe}function V$t(r){return(r-(r&mNe))/gNe}var vNe=1,yNe=2,nB=4,bNe=8,xD=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&bNe)>0}get deletedBefore(){return(this.delInfo&(vNe|nB))>0}get deletedAfter(){return(this.delInfo&(yNe|nB))>0}get deletedAcross(){return(this.delInfo&nB)>0}},Gv=class r{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&r.empty)return r.empty}recover(e){let t=0,n=dNe(e);if(!this.inverted)for(let i=0;i<n;i++)t+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[n*3]+t+V$t(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let i=0,o=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let u=this.ranges[s]-(this.inverted?i:0);if(u>e)break;let f=this.ranges[s+o],d=this.ranges[s+a],b=u+f;if(e<=b){let S=f?e==u?-1:e==b?1:t:t,C=u+i+(S<0?0:d);if(n)return C;let O=e==(t<0?u:b)?null:j$t(s/3,e-u),L=e==u?yNe:e==b?vNe:nB;return(t<0?e!=u:e!=b)&&(L|=bNe),new xD(C,L,O)}i+=d-f}return n?e+i:new xD(e+i,0,null)}touches(e,t){let n=0,i=dNe(t),o=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let u=this.ranges[s]-(this.inverted?n:0);if(u>e)break;let f=this.ranges[s+o],d=u+f;if(e<=d&&s==i*3)return!0;n+=this.ranges[s+a]-f}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let a=this.ranges[i],s=a-(this.inverted?o:0),u=a+(this.inverted?0:o),f=this.ranges[i+t],d=this.ranges[i+n];e(s,s+f,u,u+d),o+=d-f}}invert(){return new r(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?r.empty:new r(e<0?[0,-e,0]:[0,0,e])}};Gv.empty=new Gv([]);var NG=class r{constructor(e,t,n=0,i=e?e.length:0){this.mirror=t,this.from=n,this.to=i,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new r(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let i=e.getMirror(t);this.appendMap(e._maps[t],i!=null&&i<t?n+i:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e._maps[t].invert(),i!=null&&i>t?n-i-1:void 0)}}invert(){let e=new r;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let i=0;for(let o=this.from;o<this.to;o++){let a=this._maps[o],s=a.mapResult(e,t);if(s.recover!=null){let u=this.getMirror(o);if(u!=null&&u>o&&u<this.to){o=u,e=this._maps[u].recover(s.recover);continue}}i|=s.delInfo,e=s.pos}return n?e:new xD(e,i,null)}},RG=Object.create(null),ju=class{getMap(){return Gv.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=RG[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in RG)throw new RangeError("Duplicate use of step JSON ID "+e);return RG[e]=t,t.prototype.jsonID=e,t}},mc=class r{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new r(e,null)}static fail(e){return new r(null,e)}static fromReplace(e,t,n,i){try{return r.ok(e.replace(t,n,i))}catch(o){if(o instanceof f_)return r.fail(o.message);throw o}}};function UG(r,e,t){let n=[];for(let i=0;i<r.childCount;i++){let o=r.child(i);o.content.size&&(o=o.copy(UG(o.content,e,o))),o.isInline&&(o=e(o,t,i)),n.push(o)}return Wr.fromArray(n)}var _D=class r extends ju{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),i=n.node(n.sharedDepth(this.to)),o=new Dn(UG(t.content,(a,s)=>!a.isAtom||!s.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),t.openStart,t.openEnd);return mc.fromReplace(e,this.from,this.to,o)}invert(){return new Yv(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new r(t.pos,n.pos,this.mark)}merge(e){return e instanceof r&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new r(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new r(t.from,t.to,e.markFromJSON(t.mark))}};ju.jsonID("addMark",_D);var Yv=class r extends ju{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new Dn(UG(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return mc.fromReplace(e,this.from,this.to,n)}invert(){return new _D(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new r(t.pos,n.pos,this.mark)}merge(e){return e instanceof r&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new r(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new r(t.from,t.to,e.markFromJSON(t.mark))}};ju.jsonID("removeMark",Yv);var wD=class r extends ju{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return mc.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return mc.fromReplace(e,this.pos,this.pos+1,new Dn(Wr.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let n=this.mark.addToSet(t.marks);if(n.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(n))return new r(this.pos,t.marks[i]);return new r(this.pos,this.mark)}}return new YS(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new r(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new r(t.pos,e.markFromJSON(t.mark))}};ju.jsonID("addNodeMark",wD);var YS=class r extends ju{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return mc.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return mc.fromReplace(e,this.pos,this.pos+1,new Dn(Wr.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new wD(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new r(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new r(t.pos,e.markFromJSON(t.mark))}};ju.jsonID("removeNodeMark",YS);var gc=class r extends ju{constructor(e,t,n,i=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=i}apply(e){return this.structure&&BG(e,this.from,this.to)?mc.fail("Structure replace would overwrite content"):mc.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Gv([this.from,this.to-this.from,this.slice.size])}invert(e){return new r(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deletedAcross&&n.deletedAcross?null:new r(t.pos,Math.max(t.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof r)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?Dn.empty:new Dn(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new r(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?Dn.empty:new Dn(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new r(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new r(t.from,t.to,Dn.fromJSON(e,t.slice),!!t.structure)}};ju.jsonID("replace",gc);var Xl=class r extends ju{constructor(e,t,n,i,o,a,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=i,this.slice=o,this.insert=a,this.structure=s}apply(e){if(this.structure&&(BG(e,this.from,this.gapFrom)||BG(e,this.gapTo,this.to)))return mc.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return mc.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?mc.fromReplace(e,this.from,this.to,n):mc.fail("Content does not fit in gap")}getMap(){return new Gv([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new r(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),i=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||i<t.pos||o>n.pos?null:new r(t.pos,n.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,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new r(t.from,t.to,t.gapFrom,t.gapTo,Dn.fromJSON(e,t.slice),t.insert,!!t.structure)}};ju.jsonID("replaceAround",Xl);function BG(r,e,t){let n=r.resolve(e),i=t-e,o=n.depth;for(;i>0&&o>0&&n.indexAfter(o)==n.node(o).childCount;)o--,i--;if(i>0){let a=n.node(o).maybeChild(n.indexAfter(o));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function H$t(r,e,t,n){let i=[],o=[],a,s;r.doc.nodesBetween(e,t,(u,f,d)=>{if(!u.isInline)return;let b=u.marks;if(!n.isInSet(b)&&d.type.allowsMarkType(n.type)){let S=Math.max(f,e),C=Math.min(f+u.nodeSize,t),O=n.addToSet(b);for(let L=0;L<b.length;L++)b[L].isInSet(O)||(a&&a.to==S&&a.mark.eq(b[L])?a.to=C:i.push(a=new Yv(S,C,b[L])));s&&s.to==S?s.to=C:o.push(s=new _D(S,C,n))}}),i.forEach(u=>r.step(u)),o.forEach(u=>r.step(u))}function W$t(r,e,t,n){let i=[],o=0;r.doc.nodesBetween(e,t,(a,s)=>{if(!a.isInline)return;o++;let u=null;if(n instanceof gD){let f=a.marks,d;for(;d=n.isInSet(f);)(u||(u=[])).push(d),f=d.removeFromSet(f)}else n?n.isInSet(a.marks)&&(u=[n]):u=a.marks;if(u&&u.length){let f=Math.min(s+a.nodeSize,t);for(let d=0;d<u.length;d++){let b=u[d],S;for(let C=0;C<i.length;C++){let O=i[C];O.step==o-1&&b.eq(i[C].style)&&(S=O)}S?(S.to=f,S.step=o):i.push({style:b,from:Math.max(s,e),to:f,step:o})}}}),i.forEach(a=>r.step(new Yv(a.from,a.to,a.style)))}function jG(r,e,t,n=t.contentMatch,i=!0){let o=r.doc.nodeAt(e),a=[],s=e+1;for(let u=0;u<o.childCount;u++){let f=o.child(u),d=s+f.nodeSize,b=n.matchType(f.type);if(!b)a.push(new gc(s,d,Dn.empty));else{n=b;for(let S=0;S<f.marks.length;S++)t.allowsMarkType(f.marks[S].type)||r.step(new Yv(s,d,f.marks[S]));if(i&&f.isText&&t.whitespace!="pre"){let S,C=/\r?\n|\r/g,O;for(;S=C.exec(f.text);)O||(O=new Dn(Wr.from(t.schema.text(" ",t.allowedMarks(f.marks))),0,0)),a.push(new gc(s+S.index,s+S.index+S[0].length,O))}}s=d}if(!n.validEnd){let u=n.fillBefore(Wr.empty,!0);r.replace(s,s,new Dn(u,0,0))}for(let u=a.length-1;u>=0;u--)r.step(a[u])}function $$t(r,e,t){return(e==0||r.canReplace(e,r.childCount))&&(t==r.childCount||r.canReplace(0,t))}function Xv(r){let t=r.parent.content.cutByIndex(r.startIndex,r.endIndex);for(let n=r.depth;;--n){let i=r.$from.node(n),o=r.$from.index(n),a=r.$to.indexAfter(n);if(n<r.depth&&i.canReplace(o,a,t))return n;if(n==0||i.type.spec.isolating||!$$t(i,o,a))break}return null}function K$t(r,e,t){let{$from:n,$to:i,depth:o}=e,a=n.before(o+1),s=i.after(o+1),u=a,f=s,d=Wr.empty,b=0;for(let O=o,L=!1;O>t;O--)L||n.index(O)>0?(L=!0,d=Wr.from(n.node(O).copy(d)),b++):u--;let S=Wr.empty,C=0;for(let O=o,L=!1;O>t;O--)L||i.after(O+1)<i.end(O)?(L=!0,S=Wr.from(i.node(O).copy(S)),C++):f++;r.step(new Xl(u,f,a,s,new Dn(d.append(S),b,C),d.size-b,!0))}function JS(r,e,t=null,n=r){let i=G$t(r,e),o=i&&Y$t(n,e);return o?i.map(pNe).concat({type:e,attrs:t}).concat(o.map(pNe)):null}function pNe(r){return{type:r,attrs:null}}function G$t(r,e){let{parent:t,startIndex:n,endIndex:i}=r,o=t.contentMatchAt(n).findWrapping(e);if(!o)return null;let a=o.length?o[0]:e;return t.canReplaceWith(n,i,a)?o:null}function Y$t(r,e){let{parent:t,startIndex:n,endIndex:i}=r,o=t.child(n),a=e.contentMatch.findWrapping(o.type);if(!a)return null;let u=(a.length?a[a.length-1]:e).contentMatch;for(let f=n;u&&f<i;f++)u=u.matchType(t.child(f).type);return!u||!u.validEnd?null:a}function X$t(r,e,t){let n=Wr.empty;for(let a=t.length-1;a>=0;a--){if(n.size){let s=t[a].type.contentMatch.matchFragment(n);if(!s||!s.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=Wr.from(t[a].type.create(t[a].attrs,n))}let i=e.start,o=e.end;r.step(new Xl(i,o,i,o,new Dn(n,0,0),t.length,!0))}function Z$t(r,e,t,n,i){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=r.steps.length;r.doc.nodesBetween(e,t,(a,s)=>{let u=typeof i=="function"?i(a):i;if(a.isTextblock&&!a.hasMarkup(n,u)&&J$t(r.doc,r.mapping.slice(o).map(s),n)){let f=null;if(n.schema.linebreakReplacement){let C=n.whitespace=="pre",O=!!n.contentMatch.matchType(n.schema.linebreakReplacement);C&&!O?f=!1:!C&&O&&(f=!0)}f===!1&&_Ne(r,a,s,o),jG(r,r.mapping.slice(o).map(s,1),n,void 0,f===null);let d=r.mapping.slice(o),b=d.map(s,1),S=d.map(s+a.nodeSize,1);return r.step(new Xl(b,S,b+1,S-1,new Dn(Wr.from(n.create(u,null,a.marks)),0,0),1,!0)),f===!0&&xNe(r,a,s,o),!1}})}function xNe(r,e,t,n){e.forEach((i,o)=>{if(i.isText){let a,s=/\r?\n|\r/g;for(;a=s.exec(i.text);){let u=r.mapping.slice(n).map(t+1+o+a.index);r.replaceWith(u,u+1,e.type.schema.linebreakReplacement.create())}}})}function _Ne(r,e,t,n){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let a=r.mapping.slice(n).map(t+1+o);r.replaceWith(a,a+1,e.type.schema.text(`