From b3ad58fa04fb2447d1a788d1fe61b2ed581a403e Mon Sep 17 00:00:00 2001
From: hugoreleaser
Date: Wed, 14 Aug 2024 16:31:14 +0000
Subject: [PATCH 001/570] releaser: Prepare repository for 0.133.0-DEV
[ci skip]
---
common/hugo/version_current.go | 6 +++---
hugoreleaser.env | 5 +++--
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/common/hugo/version_current.go b/common/hugo/version_current.go
index 58abd1d59..a33ff5106 100644
--- a/common/hugo/version_current.go
+++ b/common/hugo/version_current.go
@@ -17,7 +17,7 @@ package hugo
// This should be the only one.
var CurrentVersion = Version{
Major: 0,
- Minor: 132,
- PatchLevel: 2,
- Suffix: "",
+ Minor: 133,
+ PatchLevel: 0,
+ Suffix: "-DEV",
}
diff --git a/hugoreleaser.env b/hugoreleaser.env
index 66bcfd0d8..9cca7015f 100644
--- a/hugoreleaser.env
+++ b/hugoreleaser.env
@@ -1,7 +1,8 @@
# Release env.
# These will be replaced by script before release.
-HUGORELEASER_TAG=v0.132.1
-HUGORELEASER_COMMITISH=1bde700dfc0770bb11eb8445aff1ab5abdccb46e
+HUGORELEASER_TAG=v0.132.2
+HUGORELEASER_COMMITISH=3fd26c70dff5934ec1802b9563530130ed1bca75
+
From 2168c5b125020a1841450730edc1b0ed2141d239 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?=
Date: Wed, 14 Aug 2024 11:34:21 +0200
Subject: [PATCH 002/570] Upgrade to Go 1.23
Fixes #12763
---
.circleci/config.yml | 4 +-
.github/workflows/test.yml | 2 +-
go.mod | 2 +-
hugofs/fs.go | 3 +-
modules/client.go | 12 -
scripts/fork_go_templates/main.go | 2 +-
testscripts/commands/mod.txt | 3 +-
testscripts/commands/mod_npm.txt | 2 +
testscripts/commands/mod_npm_withexisting.txt | 1 +
tpl/internal/go_templates/cfg/cfg.go | 2 +
tpl/internal/go_templates/fmtsort/sort.go | 113 +----
.../go_templates/fmtsort/sort_test.go | 17 +-
.../go_templates/htmltemplate/content.go | 5 +-
tpl/internal/go_templates/htmltemplate/doc.go | 10 +-
.../htmltemplate/examplefiles_test.go | 3 -
.../go_templates/htmltemplate/exec_test.go | 6 +-
tpl/internal/go_templates/htmltemplate/js.go | 5 +-
.../go_templates/htmltemplate/template.go | 22 +-
.../go_templates/htmltemplate/transition.go | 2 +-
tpl/internal/go_templates/testenv/testenv.go | 21 +-
tpl/internal/go_templates/texttemplate/doc.go | 7 +
.../go_templates/texttemplate/example_test.go | 2 +-
.../texttemplate/examplefiles_test.go | 3 -
.../go_templates/texttemplate/exec.go | 39 +-
.../go_templates/texttemplate/exec_test.go | 102 +++-
.../go_templates/texttemplate/funcs.go | 46 +-
.../go_templates/texttemplate/helper.go | 34 +-
.../texttemplate/hugo_template.go | 13 +-
.../go_templates/texttemplate/link_test.go | 8 +-
.../go_templates/texttemplate/parse/node.go | 12 +-
.../go_templates/texttemplate/parse/parse.go | 60 +--
.../texttemplate/parse/parse_test.go | 435 ++++++++++++------
.../go_templates/texttemplate/template.go | 6 +-
tpl/tplimpl/tplimpl_integration_test.go | 14 +
34 files changed, 616 insertions(+), 402 deletions(-)
diff --git a/.circleci/config.yml b/.circleci/config.yml
index beee3b536..0ff955936 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -4,7 +4,7 @@ parameters:
defaults: &defaults
resource_class: large
docker:
- - image: bepsays/ci-hugoreleaser:1.22200.20501
+ - image: bepsays/ci-hugoreleaser:1.22300.20000
environment: &buildenv
GOMODCACHE: /root/project/gomodcache
version: 2
@@ -60,7 +60,7 @@ jobs:
environment:
<<: [*buildenv]
docker:
- - image: bepsays/ci-hugoreleaser-linux-arm64:1.22200.20501
+ - image: bepsays/ci-hugoreleaser-linux-arm64:1.22300.20000
steps:
- *restore-cache
- &attach-workspace
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index b5491090e..120262098 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -16,7 +16,7 @@ jobs:
test:
strategy:
matrix:
- go-version: [1.21.x, 1.22.x]
+ go-version: [1.22.x, 1.23.x]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
diff --git a/go.mod b/go.mod
index f9776279e..40f90c45f 100644
--- a/go.mod
+++ b/go.mod
@@ -170,4 +170,4 @@ require (
software.sslmate.com/src/go-pkcs12 v0.2.0 // indirect
)
-go 1.21.8
+go 1.22.6
diff --git a/hugofs/fs.go b/hugofs/fs.go
index fc0ea71c6..fab0d3886 100644
--- a/hugofs/fs.go
+++ b/hugofs/fs.go
@@ -147,7 +147,8 @@ func isWrite(flag int) bool {
// TODO(bep) move this to a more suitable place.
func MakeReadableAndRemoveAllModulePkgDir(fs afero.Fs, dir string) (int, error) {
// Safe guard
- if !strings.Contains(dir, "pkg") {
+ // Note that the base directory changed from pkg to gomod_cache in Go 1.23.
+ if !strings.Contains(dir, "pkg") && !strings.Contains(dir, "gomod") {
panic(fmt.Sprint("invalid dir:", dir))
}
diff --git a/modules/client.go b/modules/client.go
index a6caec23c..dce40d2db 100644
--- a/modules/client.go
+++ b/modules/client.go
@@ -365,18 +365,6 @@ func (c *Client) Get(args ...string) error {
}
func (c *Client) get(args ...string) error {
- var hasD bool
- for _, arg := range args {
- if arg == "-d" {
- hasD = true
- break
- }
- }
- if !hasD {
- // go get without the -d flag does not make sense to us, as
- // it will try to build and install go packages.
- args = append([]string{"-d"}, args...)
- }
if err := c.runGo(context.Background(), c.logger.Out(), append([]string{"get"}, args...)...); err != nil {
return fmt.Errorf("failed to get %q: %w", args, err)
}
diff --git a/scripts/fork_go_templates/main.go b/scripts/fork_go_templates/main.go
index 476fe480b..c4dad3224 100644
--- a/scripts/fork_go_templates/main.go
+++ b/scripts/fork_go_templates/main.go
@@ -16,7 +16,7 @@ import (
)
func main() {
- // The current is built with 8e1fdea8316d840fd07e9d6e026048e53290948b go1.22.5
+ // The current is built with 6885bad7dd86880be6929c02085e5c7a67ff2887 go1.23.0
// TODO(bep) preserve the staticcheck.conf file.
fmt.Println("Forking ...")
defer fmt.Println("Done ...")
diff --git a/testscripts/commands/mod.txt b/testscripts/commands/mod.txt
index 56cea2c00..2fa17dbbe 100644
--- a/testscripts/commands/mod.txt
+++ b/testscripts/commands/mod.txt
@@ -18,7 +18,8 @@ hugo mod clean
! stderr .
stdout 'hugo: removed 1 dirs in module cache for \"github.com/bep/empty-hugo-module\"'
hugo mod clean --all
-stdout 'Deleted 2\d{2} files from module cache\.'
+# Currently this is 299 on MacOS and 301 on Linux.
+stdout 'Deleted (2|3)\d{2} files from module cache\.'
cd submod
hugo mod init testsubmod
cmpenv go.mod $WORK/golden/go.mod.testsubmod
diff --git a/testscripts/commands/mod_npm.txt b/testscripts/commands/mod_npm.txt
index 32cc37f06..3d8903e6a 100644
--- a/testscripts/commands/mod_npm.txt
+++ b/testscripts/commands/mod_npm.txt
@@ -2,6 +2,7 @@
dostounix golden/package.json
+
hugo mod npm pack
cmp package.json golden/package.json
@@ -41,3 +42,4 @@ path="github.com/gohugoio/hugoTestModule2"
}
-- go.mod --
module github.com/gohugoio/hugoTestModule
+go 1.20
diff --git a/testscripts/commands/mod_npm_withexisting.txt b/testscripts/commands/mod_npm_withexisting.txt
index e92eba3fd..073af0f07 100644
--- a/testscripts/commands/mod_npm_withexisting.txt
+++ b/testscripts/commands/mod_npm_withexisting.txt
@@ -55,3 +55,4 @@ path="github.com/gohugoio/hugoTestModule2"
}
-- go.mod --
module github.com/gohugoio/hugoTestModule
+go 1.20
diff --git a/tpl/internal/go_templates/cfg/cfg.go b/tpl/internal/go_templates/cfg/cfg.go
index 2af0ec707..08d210b79 100644
--- a/tpl/internal/go_templates/cfg/cfg.go
+++ b/tpl/internal/go_templates/cfg/cfg.go
@@ -36,6 +36,7 @@ const KnownEnv = `
GOAMD64
GOARCH
GOARM
+ GOARM64
GOBIN
GOCACHE
GOCACHEPROG
@@ -57,6 +58,7 @@ const KnownEnv = `
GOPPC64
GOPRIVATE
GOPROXY
+ GORISCV64
GOROOT
GOSUMDB
GOTMPDIR
diff --git a/tpl/internal/go_templates/fmtsort/sort.go b/tpl/internal/go_templates/fmtsort/sort.go
index 278a89bd7..f51cdc708 100644
--- a/tpl/internal/go_templates/fmtsort/sort.go
+++ b/tpl/internal/go_templates/fmtsort/sort.go
@@ -9,25 +9,23 @@
package fmtsort
import (
+ "cmp"
"reflect"
- "sort"
+ "slices"
)
// Note: Throughout this package we avoid calling reflect.Value.Interface as
// it is not always legal to do so and it's easier to avoid the issue than to face it.
-// SortedMap represents a map's keys and values. The keys and values are
-// aligned in index order: Value[i] is the value in the map corresponding to Key[i].
-type SortedMap struct {
- Key []reflect.Value
- Value []reflect.Value
-}
+// SortedMap is a slice of KeyValue pairs that simplifies sorting
+// and iterating over map entries.
+//
+// Each KeyValue pair contains a map key and its corresponding value.
+type SortedMap []KeyValue
-func (o *SortedMap) Len() int { return len(o.Key) }
-func (o *SortedMap) Less(i, j int) bool { return compare(o.Key[i], o.Key[j]) < 0 }
-func (o *SortedMap) Swap(i, j int) {
- o.Key[i], o.Key[j] = o.Key[j], o.Key[i]
- o.Value[i], o.Value[j] = o.Value[j], o.Value[i]
+// KeyValue holds a single key and value pair found in a map.
+type KeyValue struct {
+ Key, Value reflect.Value
}
// Sort accepts a map and returns a SortedMap that has the same keys and
@@ -48,7 +46,7 @@ func (o *SortedMap) Swap(i, j int) {
// Otherwise identical arrays compare by length.
// - interface values compare first by reflect.Type describing the concrete type
// and then by concrete value as described in the previous rules.
-func Sort(mapValue reflect.Value) *SortedMap {
+func Sort(mapValue reflect.Value) SortedMap {
if mapValue.Type().Kind() != reflect.Map {
return nil
}
@@ -56,18 +54,14 @@ func Sort(mapValue reflect.Value) *SortedMap {
// of a concurrent map update. The runtime is responsible for
// yelling loudly if that happens. See issue 33275.
n := mapValue.Len()
- key := make([]reflect.Value, 0, n)
- value := make([]reflect.Value, 0, n)
+ sorted := make(SortedMap, 0, n)
iter := mapValue.MapRange()
for iter.Next() {
- key = append(key, iter.Key())
- value = append(value, iter.Value())
+ sorted = append(sorted, KeyValue{iter.Key(), iter.Value()})
}
- sorted := &SortedMap{
- Key: key,
- Value: value,
- }
- sort.Stable(sorted)
+ slices.SortStableFunc(sorted, func(a, b KeyValue) int {
+ return compare(a.Key, b.Key)
+ })
return sorted
}
@@ -82,43 +76,19 @@ func compare(aVal, bVal reflect.Value) int {
}
switch aVal.Kind() {
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
- a, b := aVal.Int(), bVal.Int()
- switch {
- case a < b:
- return -1
- case a > b:
- return 1
- default:
- return 0
- }
+ return cmp.Compare(aVal.Int(), bVal.Int())
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
- a, b := aVal.Uint(), bVal.Uint()
- switch {
- case a < b:
- return -1
- case a > b:
- return 1
- default:
- return 0
- }
+ return cmp.Compare(aVal.Uint(), bVal.Uint())
case reflect.String:
- a, b := aVal.String(), bVal.String()
- switch {
- case a < b:
- return -1
- case a > b:
- return 1
- default:
- return 0
- }
+ return cmp.Compare(aVal.String(), bVal.String())
case reflect.Float32, reflect.Float64:
- return floatCompare(aVal.Float(), bVal.Float())
+ return cmp.Compare(aVal.Float(), bVal.Float())
case reflect.Complex64, reflect.Complex128:
a, b := aVal.Complex(), bVal.Complex()
- if c := floatCompare(real(a), real(b)); c != 0 {
+ if c := cmp.Compare(real(a), real(b)); c != 0 {
return c
}
- return floatCompare(imag(a), imag(b))
+ return cmp.Compare(imag(a), imag(b))
case reflect.Bool:
a, b := aVal.Bool(), bVal.Bool()
switch {
@@ -130,28 +100,12 @@ func compare(aVal, bVal reflect.Value) int {
return -1
}
case reflect.Pointer, reflect.UnsafePointer:
- a, b := aVal.Pointer(), bVal.Pointer()
- switch {
- case a < b:
- return -1
- case a > b:
- return 1
- default:
- return 0
- }
+ return cmp.Compare(aVal.Pointer(), bVal.Pointer())
case reflect.Chan:
if c, ok := nilCompare(aVal, bVal); ok {
return c
}
- ap, bp := aVal.Pointer(), bVal.Pointer()
- switch {
- case ap < bp:
- return -1
- case ap > bp:
- return 1
- default:
- return 0
- }
+ return cmp.Compare(aVal.Pointer(), bVal.Pointer())
case reflect.Struct:
for i := 0; i < aVal.NumField(); i++ {
if c := compare(aVal.Field(i), bVal.Field(i)); c != 0 {
@@ -198,22 +152,3 @@ func nilCompare(aVal, bVal reflect.Value) (int, bool) {
}
return 0, false
}
-
-// floatCompare compares two floating-point values. NaNs compare low.
-func floatCompare(a, b float64) int {
- switch {
- case isNaN(a):
- return -1 // No good answer if b is a NaN so don't bother checking.
- case isNaN(b):
- return 1
- case a < b:
- return -1
- case a > b:
- return 1
- }
- return 0
-}
-
-func isNaN(a float64) bool {
- return a != a
-}
diff --git a/tpl/internal/go_templates/fmtsort/sort_test.go b/tpl/internal/go_templates/fmtsort/sort_test.go
index e86b4c673..0986dbb6d 100644
--- a/tpl/internal/go_templates/fmtsort/sort_test.go
+++ b/tpl/internal/go_templates/fmtsort/sort_test.go
@@ -5,12 +5,13 @@
package fmtsort_test
import (
+ "cmp"
"fmt"
"github.com/gohugoio/hugo/tpl/internal/go_templates/fmtsort"
"math"
"reflect"
"runtime"
- "sort"
+ "slices"
"strings"
"testing"
"unsafe"
@@ -67,10 +68,6 @@ func TestCompare(t *testing.T) {
switch {
case i == j:
expect = 0
- // NaNs are tricky.
- if typ := v0.Type(); (typ.Kind() == reflect.Float32 || typ.Kind() == reflect.Float64) && math.IsNaN(v0.Float()) {
- expect = -1
- }
case i < j:
expect = -1
case i > j:
@@ -142,13 +139,13 @@ func sprint(data any) string {
return "nil"
}
b := new(strings.Builder)
- for i, key := range om.Key {
+ for i, m := range om {
if i > 0 {
b.WriteRune(' ')
}
- b.WriteString(sprintKey(key))
+ b.WriteString(sprintKey(m.Key))
b.WriteRune(':')
- fmt.Fprint(b, om.Value[i])
+ fmt.Fprint(b, m.Value)
}
return b.String()
}
@@ -200,8 +197,8 @@ func makeChans() []chan int {
for i := range cs {
pin.Pin(reflect.ValueOf(cs[i]).UnsafePointer())
}
- sort.Slice(cs, func(i, j int) bool {
- return uintptr(reflect.ValueOf(cs[i]).UnsafePointer()) < uintptr(reflect.ValueOf(cs[j]).UnsafePointer())
+ slices.SortFunc(cs, func(a, b chan int) int {
+ return cmp.Compare(reflect.ValueOf(a).Pointer(), reflect.ValueOf(b).Pointer())
})
return cs
}
diff --git a/tpl/internal/go_templates/htmltemplate/content.go b/tpl/internal/go_templates/htmltemplate/content.go
index 9c61cfac0..d19b1ec12 100644
--- a/tpl/internal/go_templates/htmltemplate/content.go
+++ b/tpl/internal/go_templates/htmltemplate/content.go
@@ -29,7 +29,6 @@ const (
// indirect returns the value, after dereferencing as many times
// as necessary to reach the base type (or nil).
-// Signature modified by Hugo. TODO(bep) script this.
func doIndirect(a any) any {
if a == nil {
return nil
@@ -46,8 +45,8 @@ func doIndirect(a any) any {
}
var (
- errorType = reflect.TypeOf((*error)(nil)).Elem()
- fmtStringerType = reflect.TypeOf((*fmt.Stringer)(nil)).Elem()
+ errorType = reflect.TypeFor[error]()
+ fmtStringerType = reflect.TypeFor[fmt.Stringer]()
)
// indirectToStringerOrError returns the value, after dereferencing as many times
diff --git a/tpl/internal/go_templates/htmltemplate/doc.go b/tpl/internal/go_templates/htmltemplate/doc.go
index 6be5e0f84..7442194f7 100644
--- a/tpl/internal/go_templates/htmltemplate/doc.go
+++ b/tpl/internal/go_templates/htmltemplate/doc.go
@@ -232,11 +232,9 @@ Least Surprise Property:
knows that contextual autoescaping happens should be able to look at a {{.}}
and correctly infer what sanitization happens."
-As a consequence of the Least Surprise Property, template actions within an
-ECMAScript 6 template literal are disabled by default.
-Handling string interpolation within these literals is rather complex resulting
-in no clear safe way to support it.
-To re-enable template actions within ECMAScript 6 template literals, use the
-GODEBUG=jstmpllitinterp=1 environment variable.
+Previously, ECMAScript 6 template literal were disabled by default, and could be
+enabled with the GODEBUG=jstmpllitinterp=1 environment variable. Template
+literals are now supported by default, and setting jstmpllitinterp has no
+effect.
*/
package template
diff --git a/tpl/internal/go_templates/htmltemplate/examplefiles_test.go b/tpl/internal/go_templates/htmltemplate/examplefiles_test.go
index 43cc3bf01..24b22d984 100644
--- a/tpl/internal/go_templates/htmltemplate/examplefiles_test.go
+++ b/tpl/internal/go_templates/htmltemplate/examplefiles_test.go
@@ -2,9 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build go1.13
-// +build go1.13
-
package template_test
import (
diff --git a/tpl/internal/go_templates/htmltemplate/exec_test.go b/tpl/internal/go_templates/htmltemplate/exec_test.go
index 428cddc0d..e01813e68 100644
--- a/tpl/internal/go_templates/htmltemplate/exec_test.go
+++ b/tpl/internal/go_templates/htmltemplate/exec_test.go
@@ -273,8 +273,8 @@ type execTest struct {
// of the max int boundary.
// We do it this way so the test doesn't depend on ints being 32 bits.
var (
- bigInt = fmt.Sprintf("0x%x", int(1<': `\u003e`,
}
-
var jsRegexpReplacementTable = []string{
0: `\u0000`,
'\t': `\t`,
diff --git a/tpl/internal/go_templates/htmltemplate/template.go b/tpl/internal/go_templates/htmltemplate/template.go
index d7454f101..4582ddd5f 100644
--- a/tpl/internal/go_templates/htmltemplate/template.go
+++ b/tpl/internal/go_templates/htmltemplate/template.go
@@ -179,7 +179,7 @@ func (t *Template) DefinedTemplates() string {
// definition of t itself.
//
// Templates can be redefined in successive calls to Parse,
-// before the first use of Execute on t or any associated template.
+// before the first use of [Template.Execute] on t or any associated template.
// A template definition with a body containing only white space and comments
// is considered empty and will not replace an existing template's body.
// This allows using Parse to add new named template definitions without
@@ -238,8 +238,8 @@ func (t *Template) AddParseTree(name string, tree *parse.Tree) (*Template, error
// Clone returns a duplicate of the template, including all associated
// templates. The actual representation is not copied, but the name space of
-// associated templates is, so further calls to Parse in the copy will add
-// templates to the copy but not to the original. Clone can be used to prepare
+// associated templates is, so further calls to [Template.Parse] in the copy will add
+// templates to the copy but not to the original. [Template.Clone] can be used to prepare
// common templates and use them with variant definitions for other templates
// by adding the variants after the clone is made.
//
@@ -342,7 +342,7 @@ func (t *Template) Funcs(funcMap FuncMap) *Template {
}
// Delims sets the action delimiters to the specified strings, to be used in
-// subsequent calls to Parse, ParseFiles, or ParseGlob. Nested template
+// subsequent calls to [Template.Parse], [ParseFiles], or [ParseGlob]. Nested template
// definitions will inherit the settings. An empty delimiter stands for the
// corresponding default: {{ or }}.
// The return value is the template, so calls can be chained.
@@ -359,7 +359,7 @@ func (t *Template) Lookup(name string) *Template {
return t.set[name]
}
-// Must is a helper that wraps a call to a function returning (*Template, error)
+// Must is a helper that wraps a call to a function returning ([*Template], error)
// and panics if the error is non-nil. It is intended for use in variable initializations
// such as
//
@@ -371,10 +371,10 @@ func Must(t *Template, err error) *Template {
return t
}
-// ParseFiles creates a new Template and parses the template definitions from
+// ParseFiles creates a new [Template] and parses the template definitions from
// the named files. The returned template's name will have the (base) name and
// (parsed) contents of the first file. There must be at least one file.
-// If an error occurs, parsing stops and the returned *Template is nil.
+// If an error occurs, parsing stops and the returned [*Template] is nil.
//
// When parsing multiple files with the same name in different directories,
// the last one mentioned will be the one that results.
@@ -436,12 +436,12 @@ func parseFiles(t *Template, readFile func(string) (string, []byte, error), file
return t, nil
}
-// ParseGlob creates a new Template and parses the template definitions from
+// ParseGlob creates a new [Template] and parses the template definitions from
// the files identified by the pattern. The files are matched according to the
// semantics of filepath.Match, and the pattern must match at least one file.
// The returned template will have the (base) name and (parsed) contents of the
// first file matched by the pattern. ParseGlob is equivalent to calling
-// ParseFiles with the list of files matched by the pattern.
+// [ParseFiles] with the list of files matched by the pattern.
//
// When parsing multiple files with the same name in different directories,
// the last one mentioned will be the one that results.
@@ -485,7 +485,7 @@ func IsTrue(val any) (truth, ok bool) {
return template.IsTrue(val)
}
-// ParseFS is like ParseFiles or ParseGlob but reads from the file system fs
+// ParseFS is like [ParseFiles] or [ParseGlob] but reads from the file system fs
// instead of the host operating system's file system.
// It accepts a list of glob patterns.
// (Note that most file names serve as glob patterns matching only themselves.)
@@ -493,7 +493,7 @@ func ParseFS(fs fs.FS, patterns ...string) (*Template, error) {
return parseFS(nil, fs, patterns)
}
-// ParseFS is like ParseFiles or ParseGlob but reads from the file system fs
+// ParseFS is like [Template.ParseFiles] or [Template.ParseGlob] but reads from the file system fs
// instead of the host operating system's file system.
// It accepts a list of glob patterns.
// (Note that most file names serve as glob patterns matching only themselves.)
diff --git a/tpl/internal/go_templates/htmltemplate/transition.go b/tpl/internal/go_templates/htmltemplate/transition.go
index d5a05f66d..c430389a3 100644
--- a/tpl/internal/go_templates/htmltemplate/transition.go
+++ b/tpl/internal/go_templates/htmltemplate/transition.go
@@ -414,7 +414,7 @@ func tJSDelimited(c context, s []byte) (context, int) {
// If " 0 && i+7 <= len(s) && bytes.Compare(bytes.ToLower(s[i-1:i+7]), []byte(" 0 && i+7 <= len(s) && bytes.Equal(bytes.ToLower(s[i-1:i+7]), []byte(" 0 {
@@ -346,12 +350,12 @@ type IdentifierNode struct {
Ident string // The identifier's name.
}
-// NewIdentifier returns a new IdentifierNode with the given identifier name.
+// NewIdentifier returns a new [IdentifierNode] with the given identifier name.
func NewIdentifier(ident string) *IdentifierNode {
return &IdentifierNode{NodeType: NodeIdentifier, Ident: ident}
}
-// SetPos sets the position. NewIdentifier is a public method so we can't modify its signature.
+// SetPos sets the position. [NewIdentifier] is a public method so we can't modify its signature.
// Chained for convenience.
// TODO: fix one day?
func (i *IdentifierNode) SetPos(pos Pos) *IdentifierNode {
@@ -359,7 +363,7 @@ func (i *IdentifierNode) SetPos(pos Pos) *IdentifierNode {
return i
}
-// SetTree sets the parent tree for the node. NewIdentifier is a public method so we can't modify its signature.
+// SetTree sets the parent tree for the node. [NewIdentifier] is a public method so we can't modify its signature.
// Chained for convenience.
// TODO: fix one day?
func (i *IdentifierNode) SetTree(t *Tree) *IdentifierNode {
diff --git a/tpl/internal/go_templates/texttemplate/parse/parse.go b/tpl/internal/go_templates/texttemplate/parse/parse.go
index d43d5334b..27c84f31e 100644
--- a/tpl/internal/go_templates/texttemplate/parse/parse.go
+++ b/tpl/internal/go_templates/texttemplate/parse/parse.go
@@ -42,7 +42,7 @@ const (
SkipFuncCheck // do not check that functions are defined
)
-// Copy returns a copy of the Tree. Any parsing state is discarded.
+// Copy returns a copy of the [Tree]. Any parsing state is discarded.
func (t *Tree) Copy() *Tree {
if t == nil {
return nil
@@ -55,7 +55,7 @@ func (t *Tree) Copy() *Tree {
}
}
-// Parse returns a map from template name to parse.Tree, created by parsing the
+// Parse returns a map from template name to [Tree], created by parsing the
// templates described in the argument string. The top-level template will be
// given the specified name. If an error is encountered, parsing stops and an
// empty map is returned with the error.
@@ -521,7 +521,7 @@ func (t *Tree) checkPipeline(pipe *PipeNode, context string) {
}
}
-func (t *Tree) parseControl(allowElseIf bool, context string) (pos Pos, line int, pipe *PipeNode, list, elseList *ListNode) {
+func (t *Tree) parseControl(context string) (pos Pos, line int, pipe *PipeNode, list, elseList *ListNode) {
defer t.popVars(len(t.vars))
pipe = t.pipeline(context, itemRightDelim)
if context == "range" {
@@ -535,27 +535,30 @@ func (t *Tree) parseControl(allowElseIf bool, context string) (pos Pos, line int
switch next.Type() {
case nodeEnd: //done
case nodeElse:
- if allowElseIf {
- // Special case for "else if". If the "else" is followed immediately by an "if",
- // the elseControl will have left the "if" token pending. Treat
- // {{if a}}_{{else if b}}_{{end}}
- // as
- // {{if a}}_{{else}}{{if b}}_{{end}}{{end}}.
- // To do this, parse the if as usual and stop at it {{end}}; the subsequent{{end}}
- // is assumed. This technique works even for long if-else-if chains.
- // TODO: Should we allow else-if in with and range?
- if t.peek().typ == itemIf {
- t.next() // Consume the "if" token.
- elseList = t.newList(next.Position())
- elseList.append(t.ifControl())
- // Do not consume the next item - only one {{end}} required.
- break
+ // Special case for "else if" and "else with".
+ // If the "else" is followed immediately by an "if" or "with",
+ // the elseControl will have left the "if" or "with" token pending. Treat
+ // {{if a}}_{{else if b}}_{{end}}
+ // {{with a}}_{{else with b}}_{{end}}
+ // as
+ // {{if a}}_{{else}}{{if b}}_{{end}}{{end}}
+ // {{with a}}_{{else}}{{with b}}_{{end}}{{end}}.
+ // To do this, parse the "if" or "with" as usual and stop at it {{end}};
+ // the subsequent{{end}} is assumed. This technique works even for long if-else-if chains.
+ if context == "if" && t.peek().typ == itemIf {
+ t.next() // Consume the "if" token.
+ elseList = t.newList(next.Position())
+ elseList.append(t.ifControl())
+ } else if context == "with" && t.peek().typ == itemWith {
+ t.next()
+ elseList = t.newList(next.Position())
+ elseList.append(t.withControl())
+ } else {
+ elseList, next = t.itemList()
+ if next.Type() != nodeEnd {
+ t.errorf("expected end; found %s", next)
}
}
- elseList, next = t.itemList()
- if next.Type() != nodeEnd {
- t.errorf("expected end; found %s", next)
- }
}
return pipe.Position(), pipe.Line, pipe, list, elseList
}
@@ -567,7 +570,7 @@ func (t *Tree) parseControl(allowElseIf bool, context string) (pos Pos, line int
//
// If keyword is past.
func (t *Tree) ifControl() Node {
- return t.newIf(t.parseControl(true, "if"))
+ return t.newIf(t.parseControl("if"))
}
// Range:
@@ -577,7 +580,7 @@ func (t *Tree) ifControl() Node {
//
// Range keyword is past.
func (t *Tree) rangeControl() Node {
- r := t.newRange(t.parseControl(false, "range"))
+ r := t.newRange(t.parseControl("range"))
return r
}
@@ -588,7 +591,7 @@ func (t *Tree) rangeControl() Node {
//
// If keyword is past.
func (t *Tree) withControl() Node {
- return t.newWith(t.parseControl(false, "with"))
+ return t.newWith(t.parseControl("with"))
}
// End:
@@ -606,10 +609,11 @@ func (t *Tree) endControl() Node {
//
// Else keyword is past.
func (t *Tree) elseControl() Node {
- // Special case for "else if".
peek := t.peekNonSpace()
- if peek.typ == itemIf {
- // We see "{{else if ... " but in effect rewrite it to {{else}}{{if ... ".
+ // The "{{else if ... " and "{{else with ..." will be
+ // treated as "{{else}}{{if ..." and "{{else}}{{with ...".
+ // So return the else node here.
+ if peek.typ == itemIf || peek.typ == itemWith {
return t.newElse(peek.pos, peek.line)
}
token := t.expect(itemRightDelim, "else")
diff --git a/tpl/internal/go_templates/texttemplate/parse/parse_test.go b/tpl/internal/go_templates/texttemplate/parse/parse_test.go
index 59e0a1741..80e7f53fa 100644
--- a/tpl/internal/go_templates/texttemplate/parse/parse_test.go
+++ b/tpl/internal/go_templates/texttemplate/parse/parse_test.go
@@ -33,9 +33,9 @@ var numberTests = []numberTest{
{"7_3", true, true, true, false, 73, 73, 73, 0},
{"0b10_010_01", true, true, true, false, 73, 73, 73, 0},
{"0B10_010_01", true, true, true, false, 73, 73, 73, 0},
- {"073", true, true, true, false, 073, 073, 073, 0},
- {"0o73", true, true, true, false, 073, 073, 073, 0},
- {"0O73", true, true, true, false, 073, 073, 073, 0},
+ {"073", true, true, true, false, 0o73, 0o73, 0o73, 0},
+ {"0o73", true, true, true, false, 0o73, 0o73, 0o73, 0},
+ {"0O73", true, true, true, false, 0o73, 0o73, 0o73, 0},
{"0x73", true, true, true, false, 0x73, 0x73, 0x73, 0},
{"0X73", true, true, true, false, 0x73, 0x73, 0x73, 0},
{"0x7_3", true, true, true, false, 0x73, 0x73, 0x73, 0},
@@ -61,7 +61,7 @@ var numberTests = []numberTest{
{"-12+0i", true, false, true, true, -12, 0, -12, -12},
{"13+0i", true, true, true, true, 13, 13, 13, 13},
// funny bases
- {"0123", true, true, true, false, 0123, 0123, 0123, 0},
+ {"0123", true, true, true, false, 0o123, 0o123, 0o123, 0},
{"-0x0", true, true, true, false, 0, 0, 0, 0},
{"0xdeadbeef", true, true, true, false, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0},
// character constants
@@ -176,74 +176,150 @@ const (
)
var parseTests = []parseTest{
- {"empty", "", noError,
- ``},
- {"comment", "{{/*\n\n\n*/}}", noError,
- ``},
- {"spaces", " \t\n", noError,
- `" \t\n"`},
- {"text", "some text", noError,
- `"some text"`},
- {"emptyAction", "{{}}", hasError,
- `{{}}`},
- {"field", "{{.X}}", noError,
- `{{.X}}`},
- {"simple command", "{{printf}}", noError,
- `{{printf}}`},
- {"$ invocation", "{{$}}", noError,
- "{{$}}"},
- {"variable invocation", "{{with $x := 3}}{{$x 23}}{{end}}", noError,
- "{{with $x := 3}}{{$x 23}}{{end}}"},
- {"variable with fields", "{{$.I}}", noError,
- "{{$.I}}"},
- {"multi-word command", "{{printf `%d` 23}}", noError,
- "{{printf `%d` 23}}"},
- {"pipeline", "{{.X|.Y}}", noError,
- `{{.X | .Y}}`},
- {"pipeline with decl", "{{$x := .X|.Y}}", noError,
- `{{$x := .X | .Y}}`},
- {"nested pipeline", "{{.X (.Y .Z) (.A | .B .C) (.E)}}", noError,
- `{{.X (.Y .Z) (.A | .B .C) (.E)}}`},
- {"field applied to parentheses", "{{(.Y .Z).Field}}", noError,
- `{{(.Y .Z).Field}}`},
- {"simple if", "{{if .X}}hello{{end}}", noError,
- `{{if .X}}"hello"{{end}}`},
- {"if with else", "{{if .X}}true{{else}}false{{end}}", noError,
- `{{if .X}}"true"{{else}}"false"{{end}}`},
- {"if with else if", "{{if .X}}true{{else if .Y}}false{{end}}", noError,
- `{{if .X}}"true"{{else}}{{if .Y}}"false"{{end}}{{end}}`},
- {"if else chain", "+{{if .X}}X{{else if .Y}}Y{{else if .Z}}Z{{end}}+", noError,
- `"+"{{if .X}}"X"{{else}}{{if .Y}}"Y"{{else}}{{if .Z}}"Z"{{end}}{{end}}{{end}}"+"`},
- {"simple range", "{{range .X}}hello{{end}}", noError,
- `{{range .X}}"hello"{{end}}`},
- {"chained field range", "{{range .X.Y.Z}}hello{{end}}", noError,
- `{{range .X.Y.Z}}"hello"{{end}}`},
- {"nested range", "{{range .X}}hello{{range .Y}}goodbye{{end}}{{end}}", noError,
- `{{range .X}}"hello"{{range .Y}}"goodbye"{{end}}{{end}}`},
- {"range with else", "{{range .X}}true{{else}}false{{end}}", noError,
- `{{range .X}}"true"{{else}}"false"{{end}}`},
- {"range over pipeline", "{{range .X|.M}}true{{else}}false{{end}}", noError,
- `{{range .X | .M}}"true"{{else}}"false"{{end}}`},
- {"range []int", "{{range .SI}}{{.}}{{end}}", noError,
- `{{range .SI}}{{.}}{{end}}`},
- {"range 1 var", "{{range $x := .SI}}{{.}}{{end}}", noError,
- `{{range $x := .SI}}{{.}}{{end}}`},
- {"range 2 vars", "{{range $x, $y := .SI}}{{.}}{{end}}", noError,
- `{{range $x, $y := .SI}}{{.}}{{end}}`},
- {"range with break", "{{range .SI}}{{.}}{{break}}{{end}}", noError,
- `{{range .SI}}{{.}}{{break}}{{end}}`},
- {"range with continue", "{{range .SI}}{{.}}{{continue}}{{end}}", noError,
- `{{range .SI}}{{.}}{{continue}}{{end}}`},
- {"constants", "{{range .SI 1 -3.2i true false 'a' nil}}{{end}}", noError,
- `{{range .SI 1 -3.2i true false 'a' nil}}{{end}}`},
- {"template", "{{template `x`}}", noError,
- `{{template "x"}}`},
- {"template with arg", "{{template `x` .Y}}", noError,
- `{{template "x" .Y}}`},
- {"with", "{{with .X}}hello{{end}}", noError,
- `{{with .X}}"hello"{{end}}`},
- {"with with else", "{{with .X}}hello{{else}}goodbye{{end}}", noError,
- `{{with .X}}"hello"{{else}}"goodbye"{{end}}`},
+ {
+ "empty", "", noError,
+ ``,
+ },
+ {
+ "comment", "{{/*\n\n\n*/}}", noError,
+ ``,
+ },
+ {
+ "spaces", " \t\n", noError,
+ `" \t\n"`,
+ },
+ {
+ "text", "some text", noError,
+ `"some text"`,
+ },
+ {
+ "emptyAction", "{{}}", hasError,
+ `{{}}`,
+ },
+ {
+ "field", "{{.X}}", noError,
+ `{{.X}}`,
+ },
+ {
+ "simple command", "{{printf}}", noError,
+ `{{printf}}`,
+ },
+ {
+ "$ invocation", "{{$}}", noError,
+ "{{$}}",
+ },
+ {
+ "variable invocation", "{{with $x := 3}}{{$x 23}}{{end}}", noError,
+ "{{with $x := 3}}{{$x 23}}{{end}}",
+ },
+ {
+ "variable with fields", "{{$.I}}", noError,
+ "{{$.I}}",
+ },
+ {
+ "multi-word command", "{{printf `%d` 23}}", noError,
+ "{{printf `%d` 23}}",
+ },
+ {
+ "pipeline", "{{.X|.Y}}", noError,
+ `{{.X | .Y}}`,
+ },
+ {
+ "pipeline with decl", "{{$x := .X|.Y}}", noError,
+ `{{$x := .X | .Y}}`,
+ },
+ {
+ "nested pipeline", "{{.X (.Y .Z) (.A | .B .C) (.E)}}", noError,
+ `{{.X (.Y .Z) (.A | .B .C) (.E)}}`,
+ },
+ {
+ "field applied to parentheses", "{{(.Y .Z).Field}}", noError,
+ `{{(.Y .Z).Field}}`,
+ },
+ {
+ "simple if", "{{if .X}}hello{{end}}", noError,
+ `{{if .X}}"hello"{{end}}`,
+ },
+ {
+ "if with else", "{{if .X}}true{{else}}false{{end}}", noError,
+ `{{if .X}}"true"{{else}}"false"{{end}}`,
+ },
+ {
+ "if with else if", "{{if .X}}true{{else if .Y}}false{{end}}", noError,
+ `{{if .X}}"true"{{else}}{{if .Y}}"false"{{end}}{{end}}`,
+ },
+ {
+ "if else chain", "+{{if .X}}X{{else if .Y}}Y{{else if .Z}}Z{{end}}+", noError,
+ `"+"{{if .X}}"X"{{else}}{{if .Y}}"Y"{{else}}{{if .Z}}"Z"{{end}}{{end}}{{end}}"+"`,
+ },
+ {
+ "simple range", "{{range .X}}hello{{end}}", noError,
+ `{{range .X}}"hello"{{end}}`,
+ },
+ {
+ "chained field range", "{{range .X.Y.Z}}hello{{end}}", noError,
+ `{{range .X.Y.Z}}"hello"{{end}}`,
+ },
+ {
+ "nested range", "{{range .X}}hello{{range .Y}}goodbye{{end}}{{end}}", noError,
+ `{{range .X}}"hello"{{range .Y}}"goodbye"{{end}}{{end}}`,
+ },
+ {
+ "range with else", "{{range .X}}true{{else}}false{{end}}", noError,
+ `{{range .X}}"true"{{else}}"false"{{end}}`,
+ },
+ {
+ "range over pipeline", "{{range .X|.M}}true{{else}}false{{end}}", noError,
+ `{{range .X | .M}}"true"{{else}}"false"{{end}}`,
+ },
+ {
+ "range []int", "{{range .SI}}{{.}}{{end}}", noError,
+ `{{range .SI}}{{.}}{{end}}`,
+ },
+ {
+ "range 1 var", "{{range $x := .SI}}{{.}}{{end}}", noError,
+ `{{range $x := .SI}}{{.}}{{end}}`,
+ },
+ {
+ "range 2 vars", "{{range $x, $y := .SI}}{{.}}{{end}}", noError,
+ `{{range $x, $y := .SI}}{{.}}{{end}}`,
+ },
+ {
+ "range with break", "{{range .SI}}{{.}}{{break}}{{end}}", noError,
+ `{{range .SI}}{{.}}{{break}}{{end}}`,
+ },
+ {
+ "range with continue", "{{range .SI}}{{.}}{{continue}}{{end}}", noError,
+ `{{range .SI}}{{.}}{{continue}}{{end}}`,
+ },
+ {
+ "constants", "{{range .SI 1 -3.2i true false 'a' nil}}{{end}}", noError,
+ `{{range .SI 1 -3.2i true false 'a' nil}}{{end}}`,
+ },
+ {
+ "template", "{{template `x`}}", noError,
+ `{{template "x"}}`,
+ },
+ {
+ "template with arg", "{{template `x` .Y}}", noError,
+ `{{template "x" .Y}}`,
+ },
+ {
+ "with", "{{with .X}}hello{{end}}", noError,
+ `{{with .X}}"hello"{{end}}`,
+ },
+ {
+ "with with else", "{{with .X}}hello{{else}}goodbye{{end}}", noError,
+ `{{with .X}}"hello"{{else}}"goodbye"{{end}}`,
+ },
+ {
+ "with with else with", "{{with .X}}hello{{else with .Y}}goodbye{{end}}", noError,
+ `{{with .X}}"hello"{{else}}{{with .Y}}"goodbye"{{end}}{{end}}`,
+ },
+ {
+ "with else chain", "{{with .X}}X{{else with .Y}}Y{{else with .Z}}Z{{end}}", noError,
+ `{{with .X}}"X"{{else}}{{with .Y}}"Y"{{else}}{{with .Z}}"Z"{{end}}{{end}}{{end}}`,
+ },
// Trimming spaces.
{"trim left", "x \r\n\t{{- 3}}", noError, `"x"{{3}}`},
{"trim right", "{{3 -}}\n\n\ty", noError, `{{3}}"y"`},
@@ -252,18 +328,24 @@ var parseTests = []parseTest{
{"comment trim left", "x \r\n\t{{- /* hi */}}", noError, `"x"`},
{"comment trim right", "{{/* hi */ -}}\n\n\ty", noError, `"y"`},
{"comment trim left and right", "x \r\n\t{{- /* */ -}}\n\n\ty", noError, `"x""y"`},
- {"block definition", `{{block "foo" .}}hello{{end}}`, noError,
- `{{template "foo" .}}`},
+ {
+ "block definition", `{{block "foo" .}}hello{{end}}`, noError,
+ `{{template "foo" .}}`,
+ },
{"newline in assignment", "{{ $x \n := \n 1 \n }}", noError, "{{$x := 1}}"},
{"newline in empty action", "{{\n}}", hasError, "{{\n}}"},
{"newline in pipeline", "{{\n\"x\"\n|\nprintf\n}}", noError, `{{"x" | printf}}`},
{"newline in comment", "{{/*\nhello\n*/}}", noError, ""},
{"newline in comment", "{{-\n/*\nhello\n*/\n-}}", noError, ""},
- {"spaces around continue", "{{range .SI}}{{.}}{{ continue }}{{end}}", noError,
- `{{range .SI}}{{.}}{{continue}}{{end}}`},
- {"spaces around break", "{{range .SI}}{{.}}{{ break }}{{end}}", noError,
- `{{range .SI}}{{.}}{{break}}{{end}}`},
+ {
+ "spaces around continue", "{{range .SI}}{{.}}{{ continue }}{{end}}", noError,
+ `{{range .SI}}{{.}}{{continue}}{{end}}`,
+ },
+ {
+ "spaces around break", "{{range .SI}}{{.}}{{ break }}{{end}}", noError,
+ `{{range .SI}}{{.}}{{break}}{{end}}`,
+ },
// Errors.
{"unclosed action", "hello{{range", hasError, ""},
@@ -302,6 +384,9 @@ var parseTests = []parseTest{
{"bug1a", "{{$x:=.}}{{$x!2}}", hasError, ""}, // ! is just illegal here.
{"bug1b", "{{$x:=.}}{{$x+2}}", hasError, ""}, // $x+2 should not parse as ($x) (+2).
{"bug1c", "{{$x:=.}}{{$x +2}}", noError, "{{$x := .}}{{$x +2}}"}, // It's OK with a space.
+ // Check the range handles assignment vs. declaration properly.
+ {"bug2a", "{{range $x := 0}}{{$x}}{{end}}", noError, "{{range $x := 0}}{{$x}}{{end}}"},
+ {"bug2b", "{{range $x = 0}}{{$x}}{{end}}", noError, "{{range $x = 0}}{{$x}}{{end}}"},
// dot following a literal value
{"dot after integer", "{{1.E}}", hasError, ""},
{"dot after float", "{{0.1.E}}", hasError, ""},
@@ -402,7 +487,7 @@ func TestKeywordsAndFuncs(t *testing.T) {
{
// 'break' is a defined function, don't treat it as a keyword: it should
// accept an argument successfully.
- var funcsWithKeywordFunc = map[string]any{
+ funcsWithKeywordFunc := map[string]any{
"break": func(in any) any { return in },
}
tmpl, err := New("").Parse(inp, "", "", make(map[string]*Tree), funcsWithKeywordFunc)
@@ -489,104 +574,168 @@ func TestErrorContextWithTreeCopy(t *testing.T) {
// All failures, and the result is a string that must appear in the error message.
var errorTests = []parseTest{
// Check line numbers are accurate.
- {"unclosed1",
+ {
+ "unclosed1",
"line1\n{{",
- hasError, `unclosed1:2: unclosed action`},
- {"unclosed2",
+ hasError, `unclosed1:2: unclosed action`,
+ },
+ {
+ "unclosed2",
"line1\n{{define `x`}}line2\n{{",
- hasError, `unclosed2:3: unclosed action`},
- {"unclosed3",
+ hasError, `unclosed2:3: unclosed action`,
+ },
+ {
+ "unclosed3",
"line1\n{{\"x\"\n\"y\"\n",
- hasError, `unclosed3:4: unclosed action started at unclosed3:2`},
- {"unclosed4",
+ hasError, `unclosed3:4: unclosed action started at unclosed3:2`,
+ },
+ {
+ "unclosed4",
"{{\n\n\n\n\n",
- hasError, `unclosed4:6: unclosed action started at unclosed4:1`},
- {"var1",
+ hasError, `unclosed4:6: unclosed action started at unclosed4:1`,
+ },
+ {
+ "var1",
"line1\n{{\nx\n}}",
- hasError, `var1:3: function "x" not defined`},
+ hasError, `var1:3: function "x" not defined`,
+ },
// Specific errors.
- {"function",
+ {
+ "function",
"{{foo}}",
- hasError, `function "foo" not defined`},
- {"comment1",
+ hasError, `function "foo" not defined`,
+ },
+ {
+ "comment1",
"{{/*}}",
- hasError, `comment1:1: unclosed comment`},
- {"comment2",
+ hasError, `comment1:1: unclosed comment`,
+ },
+ {
+ "comment2",
"{{/*\nhello\n}}",
- hasError, `comment2:1: unclosed comment`},
- {"lparen",
+ hasError, `comment2:1: unclosed comment`,
+ },
+ {
+ "lparen",
"{{.X (1 2 3}}",
- hasError, `unclosed left paren`},
- {"rparen",
+ hasError, `unclosed left paren`,
+ },
+ {
+ "rparen",
"{{.X 1 2 3 ) }}",
- hasError, "unexpected right paren"},
- {"rparen2",
+ hasError, "unexpected right paren",
+ },
+ {
+ "rparen2",
"{{(.X 1 2 3",
- hasError, `unclosed action`},
- {"space",
+ hasError, `unclosed action`,
+ },
+ {
+ "space",
"{{`x`3}}",
- hasError, `in operand`},
- {"idchar",
+ hasError, `in operand`,
+ },
+ {
+ "idchar",
"{{a#}}",
- hasError, `'#'`},
- {"charconst",
+ hasError, `'#'`,
+ },
+ {
+ "charconst",
"{{'a}}",
- hasError, `unterminated character constant`},
- {"stringconst",
+ hasError, `unterminated character constant`,
+ },
+ {
+ "stringconst",
`{{"a}}`,
- hasError, `unterminated quoted string`},
- {"rawstringconst",
+ hasError, `unterminated quoted string`,
+ },
+ {
+ "rawstringconst",
"{{`a}}",
- hasError, `unterminated raw quoted string`},
- {"number",
+ hasError, `unterminated raw quoted string`,
+ },
+ {
+ "number",
"{{0xi}}",
- hasError, `number syntax`},
- {"multidefine",
+ hasError, `number syntax`,
+ },
+ {
+ "multidefine",
"{{define `a`}}a{{end}}{{define `a`}}b{{end}}",
- hasError, `multiple definition of template`},
- {"eof",
+ hasError, `multiple definition of template`,
+ },
+ {
+ "eof",
"{{range .X}}",
- hasError, `unexpected EOF`},
- {"variable",
+ hasError, `unexpected EOF`,
+ },
+ {
+ "variable",
// Declare $x so it's defined, to avoid that error, and then check we don't parse a declaration.
"{{$x := 23}}{{with $x.y := 3}}{{$x 23}}{{end}}",
- hasError, `unexpected ":="`},
- {"multidecl",
+ hasError, `unexpected ":="`,
+ },
+ {
+ "multidecl",
"{{$a,$b,$c := 23}}",
- hasError, `too many declarations`},
- {"undefvar",
+ hasError, `too many declarations`,
+ },
+ {
+ "undefvar",
"{{$a}}",
- hasError, `undefined variable`},
- {"wrongdot",
+ hasError, `undefined variable`,
+ },
+ {
+ "wrongdot",
"{{true.any}}",
- hasError, `unexpected . after term`},
- {"wrongpipeline",
+ hasError, `unexpected . after term`,
+ },
+ {
+ "wrongpipeline",
"{{12|false}}",
- hasError, `non executable command in pipeline`},
- {"emptypipeline",
+ hasError, `non executable command in pipeline`,
+ },
+ {
+ "emptypipeline",
`{{ ( ) }}`,
- hasError, `missing value for parenthesized pipeline`},
- {"multilinerawstring",
+ hasError, `missing value for parenthesized pipeline`,
+ },
+ {
+ "multilinerawstring",
"{{ $v := `\n` }} {{",
- hasError, `multilinerawstring:2: unclosed action`},
- {"rangeundefvar",
+ hasError, `multilinerawstring:2: unclosed action`,
+ },
+ {
+ "rangeundefvar",
"{{range $k}}{{end}}",
- hasError, `undefined variable`},
- {"rangeundefvars",
+ hasError, `undefined variable`,
+ },
+ {
+ "rangeundefvars",
"{{range $k, $v}}{{end}}",
- hasError, `undefined variable`},
- {"rangemissingvalue1",
+ hasError, `undefined variable`,
+ },
+ {
+ "rangemissingvalue1",
"{{range $k,}}{{end}}",
- hasError, `missing value for range`},
- {"rangemissingvalue2",
+ hasError, `missing value for range`,
+ },
+ {
+ "rangemissingvalue2",
"{{range $k, $v := }}{{end}}",
- hasError, `missing value for range`},
- {"rangenotvariable1",
+ hasError, `missing value for range`,
+ },
+ {
+ "rangenotvariable1",
"{{range $k, .}}{{end}}",
- hasError, `range can only initialize variables`},
- {"rangenotvariable2",
+ hasError, `range can only initialize variables`,
+ },
+ {
+ "rangenotvariable2",
"{{range $k, 123 := .}}{{end}}",
- hasError, `range can only initialize variables`},
+ hasError, `range can only initialize variables`,
+ },
}
func TestErrors(t *testing.T) {
diff --git a/tpl/internal/go_templates/texttemplate/template.go b/tpl/internal/go_templates/texttemplate/template.go
index 1ba72c194..536932a60 100644
--- a/tpl/internal/go_templates/texttemplate/template.go
+++ b/tpl/internal/go_templates/texttemplate/template.go
@@ -24,7 +24,7 @@ type common struct {
}
// Template is the representation of a parsed template. The *parse.Tree
-// field is exported only for use by html/template and should be treated
+// field is exported only for use by [html/template] and should be treated
// as unexported by all other clients.
type Template struct {
name string
@@ -79,7 +79,7 @@ func (t *Template) init() {
// Clone returns a duplicate of the template, including all associated
// templates. The actual representation is not copied, but the name space of
-// associated templates is, so further calls to Parse in the copy will add
+// associated templates is, so further calls to [Template.Parse] in the copy will add
// templates to the copy but not to the original. Clone can be used to prepare
// common templates and use them with variant definitions for other templates
// by adding the variants after the clone is made.
@@ -157,7 +157,7 @@ func (t *Template) Templates() []*Template {
}
// Delims sets the action delimiters to the specified strings, to be used in
-// subsequent calls to Parse, ParseFiles, or ParseGlob. Nested template
+// subsequent calls to [Template.Parse], [Template.ParseFiles], or [Template.ParseGlob]. Nested template
// definitions will inherit the settings. An empty delimiter stands for the
// corresponding default: {{ or }}.
// The return value is the template, so calls can be chained.
diff --git a/tpl/tplimpl/tplimpl_integration_test.go b/tpl/tplimpl/tplimpl_integration_test.go
index 41257912d..a8599bbad 100644
--- a/tpl/tplimpl/tplimpl_integration_test.go
+++ b/tpl/tplimpl/tplimpl_integration_test.go
@@ -116,6 +116,20 @@ counter2: 3
`)
}
+func TestGo23ElseWith(t *testing.T) {
+ t.Parallel()
+
+ files := `
+-- hugo.toml --
+title = "Hugo"
+-- layouts/index.html --
+{{ with false }}{{ else with .Site }}{{ .Title }}{{ end }}|
+`
+ b := hugolib.Test(t, files)
+
+ b.AssertFileContent("public/index.html", "Hugo|")
+}
+
// Issue 10495
func TestCommentsBeforeBlockDefinition(t *testing.T) {
t.Parallel()
From 133eeafeb428ee484edd7c13e9e56bdbb0b1d0ac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?=
Date: Thu, 15 Aug 2024 10:20:43 +0200
Subject: [PATCH 003/570] deps: Upgrade github.com/tetratelabs/wazero
v1.7.4-0.20240805170331-2b12e189eeec => v1.8.0
---
go.mod | 2 +-
go.sum | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/go.mod b/go.mod
index 40f90c45f..cd6b2345c 100644
--- a/go.mod
+++ b/go.mod
@@ -69,7 +69,7 @@ require (
github.com/spf13/pflag v1.0.5
github.com/tdewolff/minify/v2 v2.20.37
github.com/tdewolff/parse/v2 v2.7.15
- github.com/tetratelabs/wazero v1.7.4-0.20240805170331-2b12e189eeec
+ github.com/tetratelabs/wazero v1.8.0
github.com/yuin/goldmark v1.7.4
github.com/yuin/goldmark-emoji v1.0.3
go.uber.org/automaxprocs v1.5.3
diff --git a/go.sum b/go.sum
index ca963c250..257a3ef8c 100644
--- a/go.sum
+++ b/go.sum
@@ -463,6 +463,8 @@ github.com/tdewolff/test v1.0.11-0.20240106005702-7de5f7df4739 h1:IkjBCtQOOjIn03
github.com/tdewolff/test v1.0.11-0.20240106005702-7de5f7df4739/go.mod h1:XPuWBzvdUzhCuxWO1ojpXsyzsA5bFoS3tO/Q3kFuTG8=
github.com/tetratelabs/wazero v1.7.4-0.20240805170331-2b12e189eeec h1:KeQseLFSWb9qjW4PSWxciTBk1hbG7KsVx3rs1hIQnbQ=
github.com/tetratelabs/wazero v1.7.4-0.20240805170331-2b12e189eeec/go.mod h1:ytl6Zuh20R/eROuyDaGPkp82O9C/DJfXAwJfQ3X6/7Y=
+github.com/tetratelabs/wazero v1.8.0 h1:iEKu0d4c2Pd+QSRieYbnQC9yiFlMS9D+Jr0LsRmcF4g=
+github.com/tetratelabs/wazero v1.8.0/go.mod h1:yAI0XTsMBhREkM/YDAK/zNou3GoiAce1P6+rp/wQhjs=
github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0=
github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
From 53c0ddfcb4ec2f4d021f6f51c04f0ba9db741b20 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Thu, 15 Aug 2024 08:47:59 +0000
Subject: [PATCH 004/570] build(deps): bump gocloud.dev from 0.38.0 to 0.39.0
Bumps [gocloud.dev](https://github.com/google/go-cloud) from 0.38.0 to 0.39.0.
- [Release notes](https://github.com/google/go-cloud/releases)
- [Commits](https://github.com/google/go-cloud/compare/v0.38.0...v0.39.0)
---
updated-dependencies:
- dependency-name: gocloud.dev
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
---
go.mod | 77 ++++++++++++++-------------
go.sum | 160 ++++++++++++++++++++++++++++-----------------------------
2 files changed, 118 insertions(+), 119 deletions(-)
diff --git a/go.mod b/go.mod
index cd6b2345c..834322730 100644
--- a/go.mod
+++ b/go.mod
@@ -73,7 +73,7 @@ require (
github.com/yuin/goldmark v1.7.4
github.com/yuin/goldmark-emoji v1.0.3
go.uber.org/automaxprocs v1.5.3
- gocloud.dev v0.38.0
+ gocloud.dev v0.39.0
golang.org/x/exp v0.0.0-20221031165847-c99f073a8326
golang.org/x/image v0.19.0
golang.org/x/mod v0.19.0
@@ -81,42 +81,42 @@ require (
golang.org/x/sync v0.8.0
golang.org/x/text v0.17.0
golang.org/x/tools v0.23.0
- google.golang.org/api v0.189.0
+ google.golang.org/api v0.191.0
gopkg.in/yaml.v2 v2.4.0
)
require (
cloud.google.com/go v0.115.0 // indirect
- cloud.google.com/go/auth v0.7.2 // indirect
- cloud.google.com/go/auth/oauth2adapt v0.2.3 // indirect
+ cloud.google.com/go/auth v0.8.1 // indirect
+ cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect
cloud.google.com/go/compute/metadata v0.5.0 // indirect
- cloud.google.com/go/iam v1.1.10 // indirect
- cloud.google.com/go/storage v1.41.0 // indirect
- github.com/Azure/azure-sdk-for-go/sdk/azcore v1.12.0 // indirect
+ cloud.google.com/go/iam v1.1.13 // indirect
+ cloud.google.com/go/storage v1.43.0 // indirect
+ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 // indirect
- github.com/Azure/azure-sdk-for-go/sdk/internal v1.9.0 // indirect
+ github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.3.2 // indirect
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest/to v0.4.0 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect
- github.com/aws/aws-sdk-go v1.51.30 // indirect
- github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2 // indirect
- github.com/aws/aws-sdk-go-v2/config v1.27.11 // indirect
- github.com/aws/aws-sdk-go-v2/credentials v1.17.11 // indirect
- github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.1 // indirect
- github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.16.15 // indirect
+ github.com/aws/aws-sdk-go v1.55.5 // indirect
+ github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.3 // indirect
+ github.com/aws/aws-sdk-go-v2/config v1.27.27 // indirect
+ github.com/aws/aws-sdk-go-v2/credentials v1.17.27 // indirect
+ github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.11 // indirect
+ github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.10 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.15 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.15 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect
- github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.5 // indirect
- github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 // indirect
- github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.7 // indirect
- github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.7 // indirect
- github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.5 // indirect
- github.com/aws/aws-sdk-go-v2/service/s3 v1.53.1 // indirect
- github.com/aws/aws-sdk-go-v2/service/sso v1.20.5 // indirect
- github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.4 // indirect
- github.com/aws/aws-sdk-go-v2/service/sts v1.28.6 // indirect
+ github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.15 // indirect
+ github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3 // indirect
+ github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.17 // indirect
+ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.17 // indirect
+ github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.15 // indirect
+ github.com/aws/aws-sdk-go-v2/service/s3 v1.58.3 // indirect
+ github.com/aws/aws-sdk-go-v2/service/sso v1.22.4 // indirect
+ github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.4 // indirect
+ github.com/aws/aws-sdk-go-v2/service/sts v1.30.3 // indirect
github.com/aws/smithy-go v1.20.3 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
github.com/dlclark/regexp2 v1.11.0 // indirect
@@ -127,12 +127,11 @@ require (
github.com/go-openapi/swag v0.22.8 // indirect
github.com/golang-jwt/jwt/v5 v5.2.1 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
- github.com/golang/protobuf v1.5.4 // indirect
- github.com/google/s2a-go v0.1.7 // indirect
+ github.com/google/s2a-go v0.1.8 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/google/wire v0.6.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
- github.com/googleapis/gax-go/v2 v2.12.5 // indirect
+ github.com/googleapis/gax-go/v2 v2.13.0 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/invopop/yaml v0.2.0 // indirect
@@ -150,20 +149,20 @@ require (
github.com/pkg/errors v0.9.1 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
go.opencensus.io v0.24.0 // indirect
- go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.51.0 // indirect
- go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.51.0 // indirect
- go.opentelemetry.io/otel v1.26.0 // indirect
- go.opentelemetry.io/otel/metric v1.26.0 // indirect
- go.opentelemetry.io/otel/trace v1.26.0 // indirect
+ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 // indirect
+ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
+ go.opentelemetry.io/otel v1.28.0 // indirect
+ go.opentelemetry.io/otel/metric v1.28.0 // indirect
+ go.opentelemetry.io/otel/trace v1.28.0 // indirect
golang.org/x/crypto v0.26.0 // indirect
- golang.org/x/oauth2 v0.21.0 // indirect
- golang.org/x/sys v0.23.0 // indirect
- golang.org/x/time v0.5.0 // indirect
- golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
- google.golang.org/genproto v0.0.0-20240722135656-d784300faade // indirect
- google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect
- google.golang.org/genproto/googleapis/rpc v0.0.0-20240722135656-d784300faade // indirect
- google.golang.org/grpc v1.64.1 // indirect
+ golang.org/x/oauth2 v0.22.0 // indirect
+ golang.org/x/sys v0.24.0 // indirect
+ golang.org/x/time v0.6.0 // indirect
+ golang.org/x/xerrors v0.0.0-20240716161551-93cc26a95ae9 // indirect
+ google.golang.org/genproto v0.0.0-20240812133136-8ffd90a71988 // indirect
+ google.golang.org/genproto/googleapis/api v0.0.0-20240812133136-8ffd90a71988 // indirect
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20240812133136-8ffd90a71988 // indirect
+ google.golang.org/grpc v1.65.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
howett.net/plist v1.0.0 // indirect
diff --git a/go.sum b/go.sum
index 257a3ef8c..a278f94bb 100644
--- a/go.sum
+++ b/go.sum
@@ -19,10 +19,10 @@ cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmW
cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY=
cloud.google.com/go v0.115.0 h1:CnFSK6Xo3lDYRoBKEcAtia6VSC837/ZkJuRduSFnr14=
cloud.google.com/go v0.115.0/go.mod h1:8jIM5vVgoAEoiVxQ/O4BFTfHqulPZgs/ufEzMcFMdWU=
-cloud.google.com/go/auth v0.7.2 h1:uiha352VrCDMXg+yoBtaD0tUF4Kv9vrtrWPYXwutnDE=
-cloud.google.com/go/auth v0.7.2/go.mod h1:VEc4p5NNxycWQTMQEDQF0bd6aTMb6VgYDXEwiJJQAbs=
-cloud.google.com/go/auth/oauth2adapt v0.2.3 h1:MlxF+Pd3OmSudg/b1yZ5lJwoXCEaeedAguodky1PcKI=
-cloud.google.com/go/auth/oauth2adapt v0.2.3/go.mod h1:tMQXOfZzFuNuUxOypHlQEXgdfX5cuhwU+ffUuXRJE8I=
+cloud.google.com/go/auth v0.8.1 h1:QZW9FjC5lZzN864p13YxvAtGUlQ+KgRL+8Sg45Z6vxo=
+cloud.google.com/go/auth v0.8.1/go.mod h1:qGVp/Y3kDRSDZ5gFD/XPUfYQ9xW1iI7q8RIRoCyBbJc=
+cloud.google.com/go/auth/oauth2adapt v0.2.4 h1:0GWE/FUsXhf6C+jAkWgYm7X9tK8cuEIfy19DBn6B6bY=
+cloud.google.com/go/auth/oauth2adapt v0.2.4/go.mod h1:jC/jOpwFP6JBxhB3P5Rr0a9HLMC/Pe3eaL4NmdvqPtc=
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc=
@@ -33,8 +33,10 @@ cloud.google.com/go/compute/metadata v0.5.0 h1:Zr0eK8JbFv6+Wi4ilXAR8FJ3wyNdpxHKJ
cloud.google.com/go/compute/metadata v0.5.0/go.mod h1:aHnloV2TPI38yx4s9+wAZhHykWvVCfu7hQbF+9CWoiY=
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk=
-cloud.google.com/go/iam v1.1.10 h1:ZSAr64oEhQSClwBL670MsJAW5/RLiC6kfw3Bqmd5ZDI=
-cloud.google.com/go/iam v1.1.10/go.mod h1:iEgMq62sg8zx446GCaijmA2Miwg5o3UbO+nI47WHJps=
+cloud.google.com/go/iam v1.1.13 h1:7zWBXG9ERbMLrzQBRhFliAV+kjcRToDTgQT3CTwYyv4=
+cloud.google.com/go/iam v1.1.13/go.mod h1:K8mY0uSXwEXS30KrnVb+j54LB/ntfZu1dr+4zFMNbus=
+cloud.google.com/go/longrunning v0.5.12 h1:5LqSIdERr71CqfUsFlJdBpOkBH8FBCFD7P1nTWy3TYE=
+cloud.google.com/go/longrunning v0.5.12/go.mod h1:S5hMV8CDJ6r50t2ubVJSKQVv5u0rmik5//KgLO3k4lU=
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA=
@@ -45,15 +47,15 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
-cloud.google.com/go/storage v1.41.0 h1:RusiwatSu6lHeEXe3kglxakAmAbfV+rhtPqA6i8RBx0=
-cloud.google.com/go/storage v1.41.0/go.mod h1:J1WCa/Z2FcgdEDuPUY8DxT5I+d9mFKsCepp5vR6Sq80=
+cloud.google.com/go/storage v1.43.0 h1:CcxnSohZwizt4LCzQHWvBf1/kvtHUn7gk9QERXPyXFs=
+cloud.google.com/go/storage v1.43.0/go.mod h1:ajvxEa7WmZS1PxvKRq4bq0tFT3vMd502JwstCcYv0Q0=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
-github.com/Azure/azure-sdk-for-go/sdk/azcore v1.12.0 h1:1nGuui+4POelzDwI7RG56yfQJHCnKvwfMoU7VsEp+Zg=
-github.com/Azure/azure-sdk-for-go/sdk/azcore v1.12.0/go.mod h1:99EvauvlcJ1U06amZiksfYz/3aFGyIhWGHVyiZXtBAI=
+github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 h1:nyQWyZvwGTvunIMxi1Y9uXkcyr+I7TeNrr/foo4Kpk8=
+github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0/go.mod h1:l38EPgmsp71HHLq9j7De57JcKOWPyhrsW1Awm1JS6K0=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 h1:tfLQ34V6F7tVSwoTf/4lH5sE0o6eCJuNDTmH09nDpbc=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg=
-github.com/Azure/azure-sdk-for-go/sdk/internal v1.9.0 h1:H+U3Gk9zY56G3u872L82bk4thcsy2Gghb9ExT4Zvm1o=
-github.com/Azure/azure-sdk-for-go/sdk/internal v1.9.0/go.mod h1:mgrmMSgaLp9hmax62XQTd0N4aAqSE5E0DulSpVYK7vc=
+github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY=
+github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.5.0 h1:AifHbc4mg0x9zW52WOpKbsHaDKuRhlI7TVl47thgQ70=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.5.0/go.mod h1:T5RfihdXtBDxt1Ch2wobif3TvzTdumDy29kahv6AV9A=
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.3.2 h1:YUUxeiOWgdAQE3pXt2H7QXzZs0q8UBjgRbl56qo8GYM=
@@ -77,46 +79,46 @@ github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc
github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
github.com/armon/go-radix v1.0.1-0.20221118154546-54df44f2176c h1:651/eoCRnQ7YtSjAnSzRucrJz+3iGEFt+ysraELS81M=
github.com/armon/go-radix v1.0.1-0.20221118154546-54df44f2176c/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
-github.com/aws/aws-sdk-go v1.51.30 h1:RVFkjn9P0JMwnuZCVH0TlV5k9zepHzlbc4943eZMhGw=
-github.com/aws/aws-sdk-go v1.51.30/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk=
+github.com/aws/aws-sdk-go v1.55.5 h1:KKUZBfBoyqy5d3swXyiC7Q76ic40rYcbqH7qjh59kzU=
+github.com/aws/aws-sdk-go v1.55.5/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU=
github.com/aws/aws-sdk-go-v2 v1.30.3 h1:jUeBtG0Ih+ZIFH0F4UkmL9w3cSpaMv9tYYDbzILP8dY=
github.com/aws/aws-sdk-go-v2 v1.30.3/go.mod h1:nIQjQVp5sfpQcTc9mPSr1B0PaWK5ByX9MOoDadSN4lc=
-github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2 h1:x6xsQXGSmW6frevwDA+vi/wqhp1ct18mVXYN08/93to=
-github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2/go.mod h1:lPprDr1e6cJdyYeGXnRaJoP4Md+cDBvi2eOj00BlGmg=
-github.com/aws/aws-sdk-go-v2/config v1.27.11 h1:f47rANd2LQEYHda2ddSCKYId18/8BhSRM4BULGmfgNA=
-github.com/aws/aws-sdk-go-v2/config v1.27.11/go.mod h1:SMsV78RIOYdve1vf36z8LmnszlRWkwMQtomCAI0/mIE=
-github.com/aws/aws-sdk-go-v2/credentials v1.17.11 h1:YuIB1dJNf1Re822rriUOTxopaHHvIq0l/pX3fwO+Tzs=
-github.com/aws/aws-sdk-go-v2/credentials v1.17.11/go.mod h1:AQtFPsDH9bI2O+71anW6EKL+NcD7LG3dpKGMV4SShgo=
-github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.1 h1:FVJ0r5XTHSmIHJV6KuDmdYhEpvlHpiSd38RQWhut5J4=
-github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.1/go.mod h1:zusuAeqezXzAB24LGuzuekqMAEgWkVYukBec3kr3jUg=
-github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.16.15 h1:7Zwtt/lP3KNRkeZre7soMELMGNoBrutx8nobg1jKWmo=
-github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.16.15/go.mod h1:436h2adoHb57yd+8W+gYPrrA9U/R/SuAuOO42Ushzhw=
+github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.3 h1:tW1/Rkad38LA15X4UQtjXZXNKsCgkshC3EbmcUmghTg=
+github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.3/go.mod h1:UbnqO+zjqk3uIt9yCACHJ9IVNhyhOCnYk8yA19SAWrM=
+github.com/aws/aws-sdk-go-v2/config v1.27.27 h1:HdqgGt1OAP0HkEDDShEl0oSYa9ZZBSOmKpdpsDMdO90=
+github.com/aws/aws-sdk-go-v2/config v1.27.27/go.mod h1:MVYamCg76dFNINkZFu4n4RjDixhVr51HLj4ErWzrVwg=
+github.com/aws/aws-sdk-go-v2/credentials v1.17.27 h1:2raNba6gr2IfA0eqqiP2XiQ0UVOpGPgDSi0I9iAP+UI=
+github.com/aws/aws-sdk-go-v2/credentials v1.17.27/go.mod h1:gniiwbGahQByxan6YjQUMcW4Aov6bLC3m+evgcoN4r4=
+github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.11 h1:KreluoV8FZDEtI6Co2xuNk/UqI9iwMrOx/87PBNIKqw=
+github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.11/go.mod h1:SeSUYBLsMYFoRvHE0Tjvn7kbxaUhl75CJi1sbfhMxkU=
+github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.10 h1:zeN9UtUlA6FTx0vFSayxSX32HDw73Yb6Hh2izDSFxXY=
+github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.10/go.mod h1:3HKuexPDcwLWPaqpW2UR/9n8N/u/3CKcGAzSs8p8u8g=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.15 h1:SoNJ4RlFEQEbtDcCEt+QG56MY4fm4W8rYirAmq+/DdU=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.15/go.mod h1:U9ke74k1n2bf+RIgoX1SXFed1HLs51OgUSs+Ph0KJP8=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.15 h1:C6WHdGnTDIYETAm5iErQUiVNsclNx9qbJVPIt03B6bI=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.15/go.mod h1:ZQLZqhcu+JhSrA9/NXRm8SkDvsycE+JkV3WGY41e+IM=
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 h1:hT8rVHwugYE2lEfdFE0QWVo81lF7jMrYJVDWI+f+VxU=
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0/go.mod h1:8tu/lYfQfFe6IGnaOdrpVgEL2IrrDOf6/m9RQum4NkY=
-github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.5 h1:81KE7vaZzrl7yHBYHVEzYB8sypz11NMOZ40YlWvPxsU=
-github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.5/go.mod h1:LIt2rg7Mcgn09Ygbdh/RdIm0rQ+3BNkbP1gyVMFtRK0=
+github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.15 h1:Z5r7SycxmSllHYmaAZPpmN8GviDrSGhMS6bldqtXZPw=
+github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.15/go.mod h1:CetW7bDE00QoGEmPUoZuRog07SGVAUVW6LFpNP0YfIg=
github.com/aws/aws-sdk-go-v2/service/cloudfront v1.38.4 h1:I/sQ9uGOs72/483obb2SPoa9ZEsYGbel6jcTTwD/0zU=
github.com/aws/aws-sdk-go-v2/service/cloudfront v1.38.4/go.mod h1:P6ByphKl2oNQZlv4WsCaLSmRncKEcOnbitYLtJPfqZI=
-github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 h1:Ji0DY1xUsUr3I8cHps0G+XM3WWU16lP6yG8qu1GAZAs=
-github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2/go.mod h1:5CsjAbs3NlGQyZNFACh+zztPDI7fU6eW9QsxjfnuBKg=
-github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.7 h1:ZMeFZ5yk+Ek+jNr1+uwCd2tG89t6oTS5yVWpa6yy2es=
-github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.7/go.mod h1:mxV05U+4JiHqIpGqqYXOHLPKUC6bDXC44bsUhNjOEwY=
-github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.7 h1:ogRAwT1/gxJBcSWDMZlgyFUM962F51A5CRhDLbxLdmo=
-github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.7/go.mod h1:YCsIZhXfRPLFFCl5xxY+1T9RKzOKjCut+28JSX2DnAk=
-github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.5 h1:f9RyWNtS8oH7cZlbn+/JNPpjUk5+5fLd5lM9M0i49Ys=
-github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.5/go.mod h1:h5CoMZV2VF297/VLhRhO1WF+XYWOzXo+4HsObA4HjBQ=
-github.com/aws/aws-sdk-go-v2/service/s3 v1.53.1 h1:6cnno47Me9bRykw9AEv9zkXE+5or7jz8TsskTTccbgc=
-github.com/aws/aws-sdk-go-v2/service/s3 v1.53.1/go.mod h1:qmdkIIAC+GCLASF7R2whgNrJADz0QZPX+Seiw/i4S3o=
-github.com/aws/aws-sdk-go-v2/service/sso v1.20.5 h1:vN8hEbpRnL7+Hopy9dzmRle1xmDc7o8tmY0klsr175w=
-github.com/aws/aws-sdk-go-v2/service/sso v1.20.5/go.mod h1:qGzynb/msuZIE8I75DVRCUXw3o3ZyBmUvMwQ2t/BrGM=
-github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.4 h1:Jux+gDDyi1Lruk+KHF91tK2KCuY61kzoCpvtvJJBtOE=
-github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.4/go.mod h1:mUYPBhaF2lGiukDEjJX2BLRRKTmoUSitGDUgM4tRxak=
-github.com/aws/aws-sdk-go-v2/service/sts v1.28.6 h1:cwIxeBttqPN3qkaAjcEcsh8NYr8n2HZPkcKgPAi1phU=
-github.com/aws/aws-sdk-go-v2/service/sts v1.28.6/go.mod h1:FZf1/nKNEkHdGGJP/cI2MoIMquumuRK6ol3QQJNDxmw=
+github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3 h1:dT3MqvGhSoaIhRseqw2I0yH81l7wiR2vjs57O51EAm8=
+github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3/go.mod h1:GlAeCkHwugxdHaueRr4nhPuY+WW+gR8UjlcqzPr1SPI=
+github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.17 h1:YPYe6ZmvUfDDDELqEKtAd6bo8zxhkm+XEFEzQisqUIE=
+github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.17/go.mod h1:oBtcnYua/CgzCWYN7NZ5j7PotFDaFSUjCYVTtfyn7vw=
+github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.17 h1:HGErhhrxZlQ044RiM+WdoZxp0p+EGM62y3L6pwA4olE=
+github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.17/go.mod h1:RkZEx4l0EHYDJpWppMJ3nD9wZJAa8/0lq9aVC+r2UII=
+github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.15 h1:246A4lSTXWJw/rmlQI+TT2OcqeDMKBdyjEQrafMaQdA=
+github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.15/go.mod h1:haVfg3761/WF7YPuJOER2MP0k4UAXyHaLclKXB6usDg=
+github.com/aws/aws-sdk-go-v2/service/s3 v1.58.3 h1:hT8ZAZRIfqBqHbzKTII+CIiY8G2oC9OpLedkZ51DWl8=
+github.com/aws/aws-sdk-go-v2/service/s3 v1.58.3/go.mod h1:Lcxzg5rojyVPU/0eFwLtcyTaek/6Mtic5B1gJo7e/zE=
+github.com/aws/aws-sdk-go-v2/service/sso v1.22.4 h1:BXx0ZIxvrJdSgSvKTZ+yRBeSqqgPM89VPlulEcl37tM=
+github.com/aws/aws-sdk-go-v2/service/sso v1.22.4/go.mod h1:ooyCOXjvJEsUw7x+ZDHeISPMhtwI3ZCB7ggFMcFfWLU=
+github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.4 h1:yiwVzJW2ZxZTurVbYWA7QOrAaCYQR72t0wrSBfoesUE=
+github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.4/go.mod h1:0oxfLkpz3rQ/CHlx5hB7H69YUpFiI1tql6Q6Ne+1bCw=
+github.com/aws/aws-sdk-go-v2/service/sts v1.30.3 h1:ZsDKRLXGWHk8WdtyYMoGNO7bTudrvuKpDKgMVRlepGE=
+github.com/aws/aws-sdk-go-v2/service/sts v1.30.3/go.mod h1:zwySh8fpFyXp9yOr/KVzxOl8SRqgf/IDw5aUt9UKFcQ=
github.com/aws/smithy-go v1.20.3 h1:ryHwveWzPV5BIof6fyDvor6V3iUL7nTfiTKXHiW05nE=
github.com/aws/smithy-go v1.20.3/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E=
github.com/bep/clocks v0.5.0 h1:hhvKVGLPQWRVsBP/UB7ErrHYIO42gINVbvqxvYTPVps=
@@ -137,8 +139,6 @@ github.com/bep/gowebp v0.3.0 h1:MhmMrcf88pUY7/PsEhMgEP0T6fDUnRTMpN8OclDrbrY=
github.com/bep/gowebp v0.3.0/go.mod h1:ZhFodwdiFp8ehGJpF4LdPl6unxZm9lLFjxD3z2h2AgI=
github.com/bep/helpers v0.4.0 h1:ab9veaAiWY4ST48Oxp5usaqivDmYdB744fz+tcZ3Ifs=
github.com/bep/helpers v0.4.0/go.mod h1:/QpHdmcPagDw7+RjkLFCvnlUc8lQ5kg4KDrEkb2Yyco=
-github.com/bep/imagemeta v0.7.6 h1:No64uhsEgUg/wz19yUC8BmHkFNMGhNu3X5puvsuvi2E=
-github.com/bep/imagemeta v0.7.6/go.mod h1:5piPAq5Qomh07m/dPPCLN3mDJyFusvUG7VwdRD/vX0s=
github.com/bep/imagemeta v0.8.0 h1:4lqI839akl6lR61D7hmvaw2LDOxiXFZ4D0VIyHyGpc4=
github.com/bep/imagemeta v0.8.0/go.mod h1:5piPAq5Qomh07m/dPPCLN3mDJyFusvUG7VwdRD/vX0s=
github.com/bep/lazycache v0.4.0 h1:X8yVyWNVupPd4e1jV7efi3zb7ZV/qcjKQgIQ5aPbkYI=
@@ -291,8 +291,8 @@ github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
-github.com/google/go-replayers/grpcreplay v1.1.0 h1:S5+I3zYyZ+GQz68OfbURDdt/+cSMqCK1wrvNx7WBzTE=
-github.com/google/go-replayers/grpcreplay v1.1.0/go.mod h1:qzAvJ8/wi57zq7gWqaE6AwLM6miiXUQwP1S+I9icmhk=
+github.com/google/go-replayers/grpcreplay v1.3.0 h1:1Keyy0m1sIpqstQmgz307zhiJ1pV4uIlFds5weTmxbo=
+github.com/google/go-replayers/grpcreplay v1.3.0/go.mod h1:v6NgKtkijC0d3e3RW8il6Sy5sqRVUwoQa4mHOGEy8DI=
github.com/google/go-replayers/httpreplay v1.2.0 h1:VM1wEyyjaoU53BwrOnaf9VhAyQQEEioJvFYxYcLRKzk=
github.com/google/go-replayers/httpreplay v1.2.0/go.mod h1:WahEFFZZ7a1P4VM1qEeHy+tME4bwyqPcwWbNlUI1Mcg=
github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no=
@@ -312,8 +312,8 @@ github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLe
github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
-github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o=
-github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw=
+github.com/google/s2a-go v0.1.8 h1:zZDs9gcbt9ZPLV0ndSyQk6Kacx2g/X+SKYovpnz3SMM=
+github.com/google/s2a-go v0.1.8/go.mod h1:6iNWHTpQ+nfNRN5E00MSdfDwVesa8hhS32PhPO8deJA=
github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
@@ -324,8 +324,8 @@ github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfF
github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
-github.com/googleapis/gax-go/v2 v2.12.5 h1:8gw9KZK8TiVKB6q3zHY3SBzLnrGp6HQjyfYBYGmXdxA=
-github.com/googleapis/gax-go/v2 v2.12.5/go.mod h1:BUDKcWo+RaKq5SC9vVYL0wLADa3VcfswbOMMRmB9H3E=
+github.com/googleapis/gax-go/v2 v2.13.0 h1:yitjD5f7jQHhyDsnhKEBU52NdvvdSeGzlAnDPT0hH1s=
+github.com/googleapis/gax-go/v2 v2.13.0/go.mod h1:Z/fvTZXF8/uw7Xu5GuslPw+bplx6SS338j1Is2S+B7A=
github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g=
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
@@ -486,22 +486,22 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
-go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.51.0 h1:A3SayB3rNyt+1S6qpI9mHPkeHTZbD7XILEqWnYZb2l0=
-go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.51.0/go.mod h1:27iA5uvhuRNmalO+iEUdVn5ZMj2qy10Mm+XRIpRmyuU=
-go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.51.0 h1:Xs2Ncz0gNihqu9iosIZ5SkBbWo5T8JhhLJFMQL1qmLI=
-go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.51.0/go.mod h1:vy+2G/6NvVMpwGX/NyLqcC41fxepnuKHk16E6IZUcJc=
-go.opentelemetry.io/otel v1.26.0 h1:LQwgL5s/1W7YiiRwxf03QGnWLb2HW4pLiAhaA5cZXBs=
-go.opentelemetry.io/otel v1.26.0/go.mod h1:UmLkJHUAidDval2EICqBMbnAd0/m2vmpf/dAM+fvFs4=
-go.opentelemetry.io/otel/metric v1.26.0 h1:7S39CLuY5Jgg9CrnA9HHiEjGMF/X2VHvoXGgSllRz30=
-go.opentelemetry.io/otel/metric v1.26.0/go.mod h1:SY+rHOI4cEawI9a7N1A4nIg/nTQXe1ccCNWYOJUrpX4=
+go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 h1:9G6E0TXzGFVfTnawRzrPl83iHOAV7L8NJiR8RSGYV1g=
+go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0/go.mod h1:azvtTADFQJA8mX80jIH/akaE7h+dbm/sVuaHqN13w74=
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 h1:4K4tsIXefpVJtvA/8srF4V4y0akAoPHkIslgAkjixJA=
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0/go.mod h1:jjdQuTGVsXV4vSs+CJ2qYDeDPf9yIJV23qlIzBm73Vg=
+go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo=
+go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4=
+go.opentelemetry.io/otel/metric v1.28.0 h1:f0HGvSl1KRAU1DLgLGFjrwVyismPlnuU6JD6bOeuA5Q=
+go.opentelemetry.io/otel/metric v1.28.0/go.mod h1:Fb1eVBFZmLVTMb6PPohq3TO9IIhUisDsbJoL/+uQW4s=
go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
-go.opentelemetry.io/otel/trace v1.26.0 h1:1ieeAUb4y0TE26jUFrCIXKpTuVK7uJGN9/Z/2LP5sQA=
-go.opentelemetry.io/otel/trace v1.26.0/go.mod h1:4iDxvGDQuUkHve82hJJ8UqrwswHYsZuWCBllGV2U2y0=
+go.opentelemetry.io/otel/trace v1.28.0 h1:GhQ9cUuQGmNDd5BTCP2dAvv75RdMxEfTmYejp+lkx9g=
+go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI=
go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8=
go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0=
-gocloud.dev v0.38.0 h1:SpxfaOc/Fp4PeO8ui7wRcCZV0EgXZ+IWcVSLn6ZMSw0=
-gocloud.dev v0.38.0/go.mod h1:3XjKvd2E5iVNu/xFImRzjN0d/fkNHe4s0RiKidpEUMQ=
+gocloud.dev v0.39.0 h1:EYABYGhAalPUaMrbSKOr5lejxoxvXj99nE8XFtsDgds=
+gocloud.dev v0.39.0/go.mod h1:drz+VyYNBvrMTW0KZiBAYEdl8lbNZx+OQ7oQvdrFmSQ=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
@@ -610,8 +610,8 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ
golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
-golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs=
-golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
+golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA=
+golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -676,8 +676,8 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM=
-golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
+golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
@@ -701,8 +701,8 @@ golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
-golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
-golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
+golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U=
+golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
@@ -761,8 +761,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU=
-golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90=
+golang.org/x/xerrors v0.0.0-20240716161551-93cc26a95ae9 h1:LLhsEBxRTBLuKlQxFBYUOU8xyFgXv6cOTp2HASDlsDk=
+golang.org/x/xerrors v0.0.0-20240716161551-93cc26a95ae9/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90=
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
@@ -782,8 +782,8 @@ google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz513
google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg=
google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE=
google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8=
-google.golang.org/api v0.189.0 h1:equMo30LypAkdkLMBqfeIqtyAnlyig1JSZArl4XPwdI=
-google.golang.org/api v0.189.0/go.mod h1:FLWGJKb0hb+pU2j+rJqwbnsF+ym+fQs73rbJ+KAUgy8=
+google.golang.org/api v0.191.0 h1:cJcF09Z+4HAB2t5qTQM1ZtfL/PemsLFkcFG67qq2afk=
+google.golang.org/api v0.191.0/go.mod h1:tD5dsFGxFza0hnQveGfVk9QQYKcfp+VzgRqyXFxE0+E=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
@@ -827,12 +827,12 @@ google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6D
google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
-google.golang.org/genproto v0.0.0-20240722135656-d784300faade h1:lKFsS7wpngDgSCeFn7MoLy+wBDQZ1UQIJD4UNM1Qvkg=
-google.golang.org/genproto v0.0.0-20240722135656-d784300faade/go.mod h1:FfBgJBJg9GcpPvKIuHSZ/aE1g2ecGL74upMzGZjiGEY=
-google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 h1:0+ozOGcrp+Y8Aq8TLNN2Aliibms5LEzsq99ZZmAGYm0=
-google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094/go.mod h1:fJ/e3If/Q67Mj99hin0hMhiNyCRmt6BQ2aWIJshUSJw=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20240722135656-d784300faade h1:oCRSWfwGXQsqlVdErcyTt4A93Y8fo0/9D4b1gnI++qo=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20240722135656-d784300faade/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY=
+google.golang.org/genproto v0.0.0-20240812133136-8ffd90a71988 h1:CT2Thj5AuPV9phrYMtzX11k+XkzMGfRAet42PmoTATM=
+google.golang.org/genproto v0.0.0-20240812133136-8ffd90a71988/go.mod h1:7uvplUBj4RjHAxIZ//98LzOvrQ04JBkaixRmCMI29hc=
+google.golang.org/genproto/googleapis/api v0.0.0-20240812133136-8ffd90a71988 h1:+/tmTy5zAieooKIXfzDm9KiA3Bv6JBwriRN9LY+yayk=
+google.golang.org/genproto/googleapis/api v0.0.0-20240812133136-8ffd90a71988/go.mod h1:4+X6GvPs+25wZKbQq9qyAXrwIRExv7w0Ea6MgZLZiDM=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240812133136-8ffd90a71988 h1:V71AcdLZr2p8dC9dbOIMCpqi4EmRl8wUwnJzXXLmbmc=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240812133136-8ffd90a71988/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
@@ -849,8 +849,8 @@ google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8=
google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
-google.golang.org/grpc v1.64.1 h1:LKtvyfbX3UGVPFcGqJ9ItpVWW6oN/2XqTxfAnwRRXiA=
-google.golang.org/grpc v1.64.1/go.mod h1:hiQF4LFZelK2WKaP6W0L92zGHtiQdZxk8CrSdvyjeP0=
+google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc=
+google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
From 01008ba51259e68191b14f8a4725d6116c0c2466 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?=
Date: Sat, 17 Aug 2024 15:16:09 +0200
Subject: [PATCH 005/570] Add config options
page.nextPrevSortOrder/nextPrevInSectionSortOrder
See #12776
---
config/allconfig/allconfig.go | 3 +
config/allconfig/alldecoders.go | 19 +++++
config/commonConfig.go | 15 ++++
docs/data/docs.yaml | 5 ++
hugolib/site.go | 9 +-
.../page/pages_prev_next_integration_test.go | 82 +++++++++++++++++++
6 files changed, 132 insertions(+), 1 deletion(-)
create mode 100644 resources/page/pages_prev_next_integration_test.go
diff --git a/config/allconfig/allconfig.go b/config/allconfig/allconfig.go
index afa72fb11..802000f97 100644
--- a/config/allconfig/allconfig.go
+++ b/config/allconfig/allconfig.go
@@ -182,6 +182,9 @@ type Config struct {
// Pagination configuration.
Pagination config.Pagination `mapstructure:"-"`
+ // Page configuration.
+ Page config.PageConfig `mapstructure:"-"`
+
// Privacy configuration.
Privacy privacy.Config `mapstructure:"-"`
diff --git a/config/allconfig/alldecoders.go b/config/allconfig/alldecoders.go
index c09aa0ff0..45cdd0de6 100644
--- a/config/allconfig/alldecoders.go
+++ b/config/allconfig/alldecoders.go
@@ -327,6 +327,25 @@ var allDecoderSetups = map[string]decodeWeight{
return err
},
},
+ "page": {
+ key: "page",
+ decode: func(d decodeWeight, p decodeConfig) error {
+ p.c.Page = config.PageConfig{
+ NextPrevSortOrder: "desc",
+ NextPrevInSectionSortOrder: "desc",
+ }
+ if p.p.IsSet(d.key) {
+ if err := mapstructure.WeakDecode(p.p.Get(d.key), &p.c.Page); err != nil {
+ return err
+ }
+ }
+
+ return nil
+ },
+ getCompiler: func(c *Config) configCompiler {
+ return &c.Page
+ },
+ },
"pagination": {
key: "pagination",
decode: func(d decodeWeight, p decodeConfig) error {
diff --git a/config/commonConfig.go b/config/commonConfig.go
index a615c51a7..9dea4a2fc 100644
--- a/config/commonConfig.go
+++ b/config/commonConfig.go
@@ -422,3 +422,18 @@ type Pagination struct {
// Whether to disable generation of alias for the first pagination page.
DisableAliases bool
}
+
+// PageConfig configures the behavior of pages.
+type PageConfig struct {
+ // Sort order for Page.Next and Page.Prev. Default "desc" (the default page sort order in Hugo).
+ NextPrevSortOrder string
+
+ // Sort order for Page.NextInSection and Page.PrevInSection. Default "desc".
+ NextPrevInSectionSortOrder string
+}
+
+func (c *PageConfig) CompileConfig(loggers.Logger) error {
+ c.NextPrevInSectionSortOrder = strings.ToLower(c.NextPrevInSectionSortOrder)
+ c.NextPrevSortOrder = strings.ToLower(c.NextPrevSortOrder)
+ return nil
+}
diff --git a/docs/data/docs.yaml b/docs/data/docs.yaml
index e399426b6..7ac76ee39 100644
--- a/docs/data/docs.yaml
+++ b/docs/data/docs.yaml
@@ -1600,6 +1600,9 @@ config:
term:
- html
- rss
+ page:
+ nextPrevInSectionSortOrder: desc
+ nextPrevSortOrder: desc
paginate: 0
paginatePath: ""
pagination:
@@ -1784,6 +1787,8 @@ config_helpers:
_merge: shallow
outputs:
_merge: none
+ page:
+ _merge: none
pagination:
_merge: none
params:
diff --git a/hugolib/site.go b/hugolib/site.go
index bbf110d1d..a93bbdbe6 100644
--- a/hugolib/site.go
+++ b/hugolib/site.go
@@ -117,6 +117,9 @@ func (s *Site) prepareInits() {
s.init.prevNext = init.Branch(func(context.Context) (any, error) {
regularPages := s.RegularPages()
+ if s.conf.Page.NextPrevSortOrder == "asc" {
+ regularPages = regularPages.Reverse()
+ }
for i, p := range regularPages {
np, ok := p.(nextPrevProvider)
if !ok {
@@ -181,7 +184,11 @@ func (s *Site) prepareInits() {
)
for _, section := range sections {
- setNextPrev(section.RegularPages())
+ ps := section.RegularPages()
+ if s.conf.Page.NextPrevInSectionSortOrder == "asc" {
+ ps = ps.Reverse()
+ }
+ setNextPrev(ps)
}
return nil, nil
diff --git a/resources/page/pages_prev_next_integration_test.go b/resources/page/pages_prev_next_integration_test.go
new file mode 100644
index 000000000..d61d23cf0
--- /dev/null
+++ b/resources/page/pages_prev_next_integration_test.go
@@ -0,0 +1,82 @@
+// Copyright 2024 The Hugo Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+package page_test
+
+import (
+ "strings"
+ "testing"
+
+ "github.com/gohugoio/hugo/hugolib"
+)
+
+func TestNextPrevConfig(t *testing.T) {
+ filesTemplate := `
+-- hugo.toml --
+-- content/mysection/_index.md --
+-- content/mysection/p1.md --
+---
+title: "Page 1"
+weight: 10
+---
+-- content/mysection/p2.md --
+---
+title: "Page 2"
+weight: 20
+---
+-- content/mysection/p3.md --
+---
+title: "Page 3"
+weight: 30
+---
+-- layouts/_default/single.html --
+{{ .Title }}|Next: {{ with .Next}}{{ .Title}}{{ end }}|Prev: {{ with .Prev}}{{ .Title}}{{ end }}|NextInSection: {{ with .NextInSection}}{{ .Title}}{{ end }}|PrevInSection: {{ with .PrevInSection}}{{ .Title}}{{ end }}|
+
+`
+ b := hugolib.Test(t, filesTemplate)
+
+ b.AssertFileContent("public/mysection/p1/index.html", "Page 1|Next: |Prev: Page 2|NextInSection: |PrevInSection: Page 2|")
+ b.AssertFileContent("public/mysection/p2/index.html", "Page 2|Next: Page 1|Prev: Page 3|NextInSection: Page 1|PrevInSection: Page 3|")
+ b.AssertFileContent("public/mysection/p3/index.html", "Page 3|Next: Page 2|Prev: |NextInSection: Page 2|PrevInSection: |")
+
+ files := strings.ReplaceAll(filesTemplate, "-- hugo.toml --", `-- hugo.toml --
+[page]
+nextPrevSortOrder="aSc"
+nextPrevInSectionSortOrder="asC"
+`)
+
+ b = hugolib.Test(t, files)
+
+ b.AssertFileContent("public/mysection/p1/index.html", "Page 1|Next: Page 2|Prev: |NextInSection: Page 2|PrevInSection: |")
+ b.AssertFileContent("public/mysection/p2/index.html", "Page 2|Next: Page 3|Prev: Page 1|NextInSection: Page 3|PrevInSection: Page 1|")
+ b.AssertFileContent("public/mysection/p3/index.html", "Page 3|Next: |Prev: Page 2|NextInSection: |PrevInSection: Page 2|")
+
+ files = strings.ReplaceAll(filesTemplate, "-- hugo.toml --", `-- hugo.toml --
+[page]
+nextPrevSortOrder="aSc"
+`)
+
+ b = hugolib.Test(t, files)
+
+ b.AssertFileContent("public/mysection/p1/index.html", "Page 1|Next: Page 2|Prev: |NextInSection: |PrevInSection: Page 2|")
+ b.AssertFileContent("public/mysection/p2/index.html", "Page 2|Next: Page 3|Prev: Page 1|NextInSection: Page 1|PrevInSection: Page 3|")
+ b.AssertFileContent("public/mysection/p3/index.html", "Page 3|Next: |Prev: Page 2|NextInSection: Page 2|PrevInSection: |")
+
+ files = strings.ReplaceAll(filesTemplate, "-- hugo.toml --", `-- hugo.toml --
+[page]
+nextPrevInSectionSortOrder="aSc"
+`)
+
+ b = hugolib.Test(t, files)
+
+ b.AssertFileContent("public/mysection/p1/index.html", "Page 1|Next: |Prev: Page 2|NextInSection: Page 2|PrevInSection: |")
+}
From c9777473d1369f812d727a6c07dc57ad7be7bf62 Mon Sep 17 00:00:00 2001
From: hugoreleaser
Date: Sat, 17 Aug 2024 19:57:41 +0000
Subject: [PATCH 006/570] releaser: Bump versions for release of 0.133.0
[ci skip]
---
common/hugo/version_current.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/common/hugo/version_current.go b/common/hugo/version_current.go
index a33ff5106..0603fa596 100644
--- a/common/hugo/version_current.go
+++ b/common/hugo/version_current.go
@@ -19,5 +19,5 @@ var CurrentVersion = Version{
Major: 0,
Minor: 133,
PatchLevel: 0,
- Suffix: "-DEV",
+ Suffix: "",
}
From c054cba0423fa7e677506fcec67d702486dec01e Mon Sep 17 00:00:00 2001
From: hugoreleaser
Date: Sat, 17 Aug 2024 20:11:05 +0000
Subject: [PATCH 007/570] releaser: Prepare repository for 0.134.0-DEV
[ci skip]
---
common/hugo/version_current.go | 4 ++--
hugoreleaser.env | 5 +++--
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/common/hugo/version_current.go b/common/hugo/version_current.go
index 0603fa596..be502515a 100644
--- a/common/hugo/version_current.go
+++ b/common/hugo/version_current.go
@@ -17,7 +17,7 @@ package hugo
// This should be the only one.
var CurrentVersion = Version{
Major: 0,
- Minor: 133,
+ Minor: 134,
PatchLevel: 0,
- Suffix: "",
+ Suffix: "-DEV",
}
diff --git a/hugoreleaser.env b/hugoreleaser.env
index 9cca7015f..145cab866 100644
--- a/hugoreleaser.env
+++ b/hugoreleaser.env
@@ -1,7 +1,8 @@
# Release env.
# These will be replaced by script before release.
-HUGORELEASER_TAG=v0.132.2
-HUGORELEASER_COMMITISH=3fd26c70dff5934ec1802b9563530130ed1bca75
+HUGORELEASER_TAG=v0.133.0
+HUGORELEASER_COMMITISH=c9777473d1369f812d727a6c07dc57ad7be7bf62
+
From 777534b2a46127ad0392562b4de56ba3ff70a810 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?=
Date: Sun, 18 Aug 2024 11:47:51 +0200
Subject: [PATCH 008/570] releaser: Rework the run conditions
Closes #12753
---
.circleci/config.yml | 13 ++++++++++---
releaser/releaser.go | 3 ++-
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 0ff955936..52ce01f6a 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -98,9 +98,16 @@ workflows:
release:
jobs:
- prepare_release:
- filters:
- branches:
- only: /release-.*/
+ when:
+ and:
+ - matches:
+ pattern: "^release-"
+ value: << pipeline.git.branch >>
+ - not:
+ - matches:
+ pattern: "NOCIRCLECI"
+ value: << pipeline.trigger_parameters.github_app.commit_message >>
+
- build_container1:
requires:
- prepare_release
diff --git a/releaser/releaser.go b/releaser/releaser.go
index f2244842a..1cc8413e9 100644
--- a/releaser/releaser.go
+++ b/releaser/releaser.go
@@ -101,7 +101,8 @@ func (r *ReleaseHandler) Run() error {
return err
}
- if _, err := r.git("commit", "-a", "-m", fmt.Sprintf("%s Bump versions for release of %s\n\n[ci skip]", commitPrefix, newVersion)); err != nil {
+ // About NOCIRCLECI, see issue #12753.
+ if _, err := r.git("commit", "-a", "-m", fmt.Sprintf("%s Bump versions for release of %s\n\nNOCIRCLECI", commitPrefix, newVersion)); err != nil {
return err
}
From 73d32e7737082118a48adb8db3ff1ed7407f4d3f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?=
Date: Sun, 18 Aug 2024 12:00:47 +0200
Subject: [PATCH 009/570] Revert "releaser: Rework the run conditions"
This reverts commit 777534b2a46127ad0392562b4de56ba3ff70a810.
Circle ci throws validation errors:
```
Config does not conform to schema: {:workflows {:release {:jobs [{:prepare_release (not (map? nil)), :when {:and disallowed-key}} nil nil nil]}}}
```
---
.circleci/config.yml | 13 +++----------
releaser/releaser.go | 3 +--
2 files changed, 4 insertions(+), 12 deletions(-)
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 52ce01f6a..0ff955936 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -98,16 +98,9 @@ workflows:
release:
jobs:
- prepare_release:
- when:
- and:
- - matches:
- pattern: "^release-"
- value: << pipeline.git.branch >>
- - not:
- - matches:
- pattern: "NOCIRCLECI"
- value: << pipeline.trigger_parameters.github_app.commit_message >>
-
+ filters:
+ branches:
+ only: /release-.*/
- build_container1:
requires:
- prepare_release
diff --git a/releaser/releaser.go b/releaser/releaser.go
index 1cc8413e9..f2244842a 100644
--- a/releaser/releaser.go
+++ b/releaser/releaser.go
@@ -101,8 +101,7 @@ func (r *ReleaseHandler) Run() error {
return err
}
- // About NOCIRCLECI, see issue #12753.
- if _, err := r.git("commit", "-a", "-m", fmt.Sprintf("%s Bump versions for release of %s\n\nNOCIRCLECI", commitPrefix, newVersion)); err != nil {
+ if _, err := r.git("commit", "-a", "-m", fmt.Sprintf("%s Bump versions for release of %s\n\n[ci skip]", commitPrefix, newVersion)); err != nil {
return err
}
From 702b1e8b81c889f72207b5b8d0478c300c8ccf3e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?=
Date: Sun, 18 Aug 2024 18:39:55 +0200
Subject: [PATCH 010/570] releaser: Rework the run conditions
Now after actually reading the CircleCI docs...
Closes #12753
---
.circleci/config.yml | 9 +++++++++
releaser/releaser.go | 3 ++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 0ff955936..3093b28d4 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -96,6 +96,15 @@ jobs:
workflows:
version: 2
release:
+ when:
+ and:
+ - matches:
+ pattern: "^release-"
+ value: << pipeline.git.branch >>
+ - not:
+ matches:
+ pattern: "NOCIRCLECI"
+ value: << pipeline.trigger_parameters.github_app.commit_message >>
jobs:
- prepare_release:
filters:
diff --git a/releaser/releaser.go b/releaser/releaser.go
index f2244842a..1cc8413e9 100644
--- a/releaser/releaser.go
+++ b/releaser/releaser.go
@@ -101,7 +101,8 @@ func (r *ReleaseHandler) Run() error {
return err
}
- if _, err := r.git("commit", "-a", "-m", fmt.Sprintf("%s Bump versions for release of %s\n\n[ci skip]", commitPrefix, newVersion)); err != nil {
+ // About NOCIRCLECI, see issue #12753.
+ if _, err := r.git("commit", "-a", "-m", fmt.Sprintf("%s Bump versions for release of %s\n\nNOCIRCLECI", commitPrefix, newVersion)); err != nil {
return err
}
From c8f850ae1734def05687b07213e124c2b585349d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?=
Date: Sun, 18 Aug 2024 18:49:42 +0200
Subject: [PATCH 011/570] circleci: Upgrade to version 2.1 of the schema
Updates #12753
---
.circleci/config.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 3093b28d4..e7ad970e4 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -7,7 +7,7 @@ defaults: &defaults
- image: bepsays/ci-hugoreleaser:1.22300.20000
environment: &buildenv
GOMODCACHE: /root/project/gomodcache
-version: 2
+version: 2.1
jobs:
prepare_release:
<<: *defaults
From 0e5a26057c69078faa4a533b75761cda352a2a7e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?=
Date: Sun, 18 Aug 2024 19:12:02 +0200
Subject: [PATCH 012/570] Revert "circleci: Upgrade to version 2.1 of the
schema"
This reverts commit c8f850ae1734def05687b07213e124c2b585349d.
---
.circleci/config.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.circleci/config.yml b/.circleci/config.yml
index e7ad970e4..3093b28d4 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -7,7 +7,7 @@ defaults: &defaults
- image: bepsays/ci-hugoreleaser:1.22300.20000
environment: &buildenv
GOMODCACHE: /root/project/gomodcache
-version: 2.1
+version: 2
jobs:
prepare_release:
<<: *defaults
From 46484bff84c82136740479e6420a7f88e2b20e94 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?=
Date: Sun, 18 Aug 2024 19:12:03 +0200
Subject: [PATCH 013/570] Revert "releaser: Rework the run conditions"
This reverts commit 702b1e8b81c889f72207b5b8d0478c300c8ccf3e.
---
.circleci/config.yml | 9 ---------
releaser/releaser.go | 3 +--
2 files changed, 1 insertion(+), 11 deletions(-)
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 3093b28d4..0ff955936 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -96,15 +96,6 @@ jobs:
workflows:
version: 2
release:
- when:
- and:
- - matches:
- pattern: "^release-"
- value: << pipeline.git.branch >>
- - not:
- matches:
- pattern: "NOCIRCLECI"
- value: << pipeline.trigger_parameters.github_app.commit_message >>
jobs:
- prepare_release:
filters:
diff --git a/releaser/releaser.go b/releaser/releaser.go
index 1cc8413e9..f2244842a 100644
--- a/releaser/releaser.go
+++ b/releaser/releaser.go
@@ -101,8 +101,7 @@ func (r *ReleaseHandler) Run() error {
return err
}
- // About NOCIRCLECI, see issue #12753.
- if _, err := r.git("commit", "-a", "-m", fmt.Sprintf("%s Bump versions for release of %s\n\nNOCIRCLECI", commitPrefix, newVersion)); err != nil {
+ if _, err := r.git("commit", "-a", "-m", fmt.Sprintf("%s Bump versions for release of %s\n\n[ci skip]", commitPrefix, newVersion)); err != nil {
return err
}
From 7792392a6f6fda7b1654ba0517e78c62f0a8c905 Mon Sep 17 00:00:00 2001
From: Joe Mooring
Date: Wed, 21 Aug 2024 12:05:20 -0700
Subject: [PATCH 014/570] config: Fix pagination deprecation messages
---
config/allconfig/allconfig.go | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/config/allconfig/allconfig.go b/config/allconfig/allconfig.go
index 802000f97..f6dfa7260 100644
--- a/config/allconfig/allconfig.go
+++ b/config/allconfig/allconfig.go
@@ -381,12 +381,12 @@ func (c *Config) CompileConfig(logger loggers.Logger) error {
// Legacy paginate values.
if c.Paginate != 0 {
- hugo.Deprecate("site config key paginate", "Use paginator.pagerSize instead.", "v0.128.0")
+ hugo.Deprecate("site config key paginate", "Use pagination.pagerSize instead.", "v0.128.0")
c.Pagination.PagerSize = c.Paginate
}
if c.PaginatePath != "" {
- hugo.Deprecate("site config key paginatePath", "Use paginator.path instead.", "v0.128.0")
+ hugo.Deprecate("site config key paginatePath", "Use pagination.path instead.", "v0.128.0")
c.Pagination.Path = c.PaginatePath
}
From e1becf1dfe31bec65eca585ac66a2d10f1651e42 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?=
Date: Sat, 24 Aug 2024 18:52:03 +0200
Subject: [PATCH 015/570] deps: Upgraded github.com/bep/imagemeta v0.8.0 =>
v0.8.1
Closes #12793
---
go.mod | 2 +-
go.sum | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/go.mod b/go.mod
index 834322730..6c103ceb5 100644
--- a/go.mod
+++ b/go.mod
@@ -15,7 +15,7 @@ require (
github.com/bep/golibsass v1.1.1
github.com/bep/gowebp v0.3.0
github.com/bep/helpers v0.4.0
- github.com/bep/imagemeta v0.8.0
+ github.com/bep/imagemeta v0.8.1
github.com/bep/lazycache v0.4.0
github.com/bep/logg v0.4.0
github.com/bep/mclib v1.20400.20402
diff --git a/go.sum b/go.sum
index a278f94bb..8117c41e0 100644
--- a/go.sum
+++ b/go.sum
@@ -141,6 +141,8 @@ github.com/bep/helpers v0.4.0 h1:ab9veaAiWY4ST48Oxp5usaqivDmYdB744fz+tcZ3Ifs=
github.com/bep/helpers v0.4.0/go.mod h1:/QpHdmcPagDw7+RjkLFCvnlUc8lQ5kg4KDrEkb2Yyco=
github.com/bep/imagemeta v0.8.0 h1:4lqI839akl6lR61D7hmvaw2LDOxiXFZ4D0VIyHyGpc4=
github.com/bep/imagemeta v0.8.0/go.mod h1:5piPAq5Qomh07m/dPPCLN3mDJyFusvUG7VwdRD/vX0s=
+github.com/bep/imagemeta v0.8.1 h1:tjZLPRftjxU7PTI87o5e5WKOFQ4S9S0engiP1OTpJTI=
+github.com/bep/imagemeta v0.8.1/go.mod h1:5piPAq5Qomh07m/dPPCLN3mDJyFusvUG7VwdRD/vX0s=
github.com/bep/lazycache v0.4.0 h1:X8yVyWNVupPd4e1jV7efi3zb7ZV/qcjKQgIQ5aPbkYI=
github.com/bep/lazycache v0.4.0/go.mod h1:NmRm7Dexh3pmR1EignYR8PjO2cWybFQ68+QgY3VMCSc=
github.com/bep/logg v0.4.0 h1:luAo5mO4ZkhA5M1iDVDqDqnBBnlHjmtZF6VAyTp+nCQ=
From 5f667f8796fb051e110449dd8d775e947cc1801e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?=
Date: Sun, 25 Aug 2024 22:51:38 +0200
Subject: [PATCH 016/570] Fix missing method NameNormalized panic
Closes #12795
---
hugolib/content_map_page.go | 2 +-
resources/resource/resourcetypes.go | 8 ++++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/hugolib/content_map_page.go b/hugolib/content_map_page.go
index e3b29f186..c3f06a592 100644
--- a/hugolib/content_map_page.go
+++ b/hugolib/content_map_page.go
@@ -560,7 +560,7 @@ func (m *pageMap) getOrCreateResourcesForPage(ps *pageState) resource.Resources
for _, r := range res2 {
var found bool
for _, r2 := range res {
- if r2.(resource.NameNormalizedProvider).NameNormalized() == r.(resource.NameNormalizedProvider).NameNormalized() {
+ if resource.NameNormalizedOrName(r2) == resource.NameNormalizedOrName(r) {
found = true
break
}
diff --git a/resources/resource/resourcetypes.go b/resources/resource/resourcetypes.go
index 8d982b00a..0fb87f371 100644
--- a/resources/resource/resourcetypes.go
+++ b/resources/resource/resourcetypes.go
@@ -298,3 +298,11 @@ func (r resourceTypesHolder) ResourceType() string {
func NewResourceTypesProvider(mediaType media.Type, resourceType string) ResourceTypesProvider {
return resourceTypesHolder{mediaType: mediaType, resourceType: resourceType}
}
+
+// NameNormalizedOrName returns the normalized name if available, otherwise the name.
+func NameNormalizedOrName(r Resource) string {
+ if nn, ok := r.(NameNormalizedProvider); ok {
+ return nn.NameNormalized()
+ }
+ return r.Name()
+}
From 445283a5932b4e0f5fc377478fa1351547ea0426 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?=
Date: Mon, 26 Aug 2024 12:39:07 +0200
Subject: [PATCH 017/570] Adjust Circleci workflow to make the Docker images
build
Closes #12753
---
.circleci/build.yml | 120 +++++++++++++++++++++++++++++++++++++++
.circleci/config.yml | 132 +++++++------------------------------------
releaser/releaser.go | 3 +-
3 files changed, 143 insertions(+), 112 deletions(-)
create mode 100644 .circleci/build.yml
diff --git a/.circleci/build.yml b/.circleci/build.yml
new file mode 100644
index 000000000..e3e0073f6
--- /dev/null
+++ b/.circleci/build.yml
@@ -0,0 +1,120 @@
+version: 2.1
+
+# Passed from config.yml
+parameters:
+ skip:
+ type: boolean
+ default: true
+
+defaults: &defaults
+ resource_class: large
+ docker:
+ - image: bepsays/ci-hugoreleaser:1.22300.20000
+environment: &buildenv
+ GOMODCACHE: /root/project/gomodcache
+jobs:
+ prepare_release:
+ <<: *defaults
+ environment: &buildenv
+ GOMODCACHE: /root/project/gomodcache
+ steps:
+ - &remote-docker
+ setup_remote_docker:
+ version: 20.10.14
+ - checkout:
+ path: hugo
+ - &git-config
+ run:
+ command: |
+ git config --global user.email "bjorn.erik.pedersen+hugoreleaser@gmail.com"
+ git config --global user.name "hugoreleaser"
+ - run:
+ command: |
+ cd hugo
+ go mod download
+ go run -tags release main.go release --step 1
+ - save_cache:
+ key: git-sha-{{ .Revision }}
+ paths:
+ - hugo
+ - gomodcache
+ build_container1:
+ <<: [*defaults]
+ environment:
+ <<: [*buildenv]
+ steps:
+ - &restore-cache
+ restore_cache:
+ key: git-sha-{{ .Revision }}
+ - run:
+ no_output_timeout: 20m
+ command: |
+ mkdir -p /tmp/files/dist1
+ cd hugo
+ hugoreleaser build -paths "builds/container1/**" -workers 3 -dist /tmp/files/dist1 -chunks $CIRCLE_NODE_TOTAL -chunk-index $CIRCLE_NODE_INDEX
+ - &persist-workspace
+ persist_to_workspace:
+ root: /tmp/files
+ paths:
+ - dist1
+ - dist2
+ parallelism: 7
+ build_container2:
+ <<: [*defaults]
+ environment:
+ <<: [*buildenv]
+ docker:
+ - image: bepsays/ci-hugoreleaser-linux-arm64:1.22300.20000
+ steps:
+ - *restore-cache
+ - &attach-workspace
+ attach_workspace:
+ at: /tmp/workspace
+ - run:
+ command: |
+ mkdir -p /tmp/files/dist2
+ cd hugo
+ hugoreleaser build -paths "builds/container2/**" -workers 1 -dist /tmp/files/dist2
+ - *persist-workspace
+ archive_and_release:
+ <<: [*defaults]
+ environment:
+ <<: [*buildenv]
+ steps:
+ - *restore-cache
+ - *attach-workspace
+ - *git-config
+ - run:
+ name: Add github.com to known hosts
+ command: ssh-keyscan github.com >> ~/.ssh/known_hosts
+ - run:
+ command: |
+ cp -a /tmp/workspace/dist1/. ./hugo/dist
+ cp -a /tmp/workspace/dist2/. ./hugo/dist
+ - run:
+ command: |
+ cd hugo
+ hugoreleaser archive
+ hugoreleaser release
+ go run -tags release main.go release --step 2
+workflows:
+ release:
+ when:
+ and:
+ - equal: [false, << pipeline.parameters.skip >>]
+ jobs:
+ - prepare_release:
+ filters:
+ branches:
+ only: /release-.*/
+ - build_container1:
+ requires:
+ - prepare_release
+ - build_container2:
+ requires:
+ - prepare_release
+ - archive_and_release:
+ context: org-global
+ requires:
+ - build_container1
+ - build_container2
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 0ff955936..588d3d894 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -1,117 +1,27 @@
-parameters:
-
-# v2: 11m.
-defaults: &defaults
- resource_class: large
- docker:
- - image: bepsays/ci-hugoreleaser:1.22300.20000
-environment: &buildenv
- GOMODCACHE: /root/project/gomodcache
-version: 2
+version: 2.1
+setup: true
+orbs:
+ continuation: circleci/continuation@1
jobs:
- prepare_release:
- <<: *defaults
- environment: &buildenv
- GOMODCACHE: /root/project/gomodcache
- steps:
- - &remote-docker
- setup_remote_docker:
- version: 20.10.14
- - checkout:
- path: hugo
- - &git-config
- run:
- command: |
- git config --global user.email "bjorn.erik.pedersen+hugoreleaser@gmail.com"
- git config --global user.name "hugoreleaser"
- - run:
- command: |
- cd hugo
- go mod download
- go run -tags release main.go release --step 1
- - save_cache:
- key: git-sha-{{ .Revision }}
- paths:
- - hugo
- - gomodcache
- build_container1:
- <<: [*defaults]
- environment:
- <<: [*buildenv]
- steps:
- - &restore-cache
- restore_cache:
- key: git-sha-{{ .Revision }}
- - run:
- no_output_timeout: 20m
- command: |
- mkdir -p /tmp/files/dist1
- cd hugo
- hugoreleaser build -paths "builds/container1/**" -workers 3 -dist /tmp/files/dist1 -chunks $CIRCLE_NODE_TOTAL -chunk-index $CIRCLE_NODE_INDEX
- - &persist-workspace
- persist_to_workspace:
- root: /tmp/files
- paths:
- - dist1
- - dist2
- parallelism: 7
- build_container2:
- <<: [*defaults]
- environment:
- <<: [*buildenv]
+ setup:
docker:
- - image: bepsays/ci-hugoreleaser-linux-arm64:1.22300.20000
+ - image: cimg/go:1.21
steps:
- - *restore-cache
- - &attach-workspace
- attach_workspace:
- at: /tmp/workspace
+ - checkout
- run:
command: |
- mkdir -p /tmp/files/dist2
- cd hugo
- hugoreleaser build -paths "builds/container2/**" -workers 1 -dist /tmp/files/dist2
- - *persist-workspace
- archive_and_release:
- <<: [*defaults]
- environment:
- <<: [*buildenv]
- steps:
- - *restore-cache
- - *attach-workspace
- - *git-config
- - run:
- name: Add github.com to known hosts
- command: ssh-keyscan github.com >> ~/.ssh/known_hosts
- - run:
- command: |
- cp -a /tmp/workspace/dist1/. ./hugo/dist
- cp -a /tmp/workspace/dist2/. ./hugo/dist
- - run:
- command: |
- cd hugo
- hugoreleaser archive
- hugoreleaser release
- go run -tags release main.go release --step 2
+ export SKIP=$(git log -n 1 $CIRCLE_SHA1 --pretty=%B | grep -q "NOCIRCLECI" && echo "true" || echo "false")
+ echo "{\"skip\": $SKIP}" >> set-up-params.json
+ - continuation/continue:
+ parameters: set-up-params.json
+ configuration_path: .circleci/build.yml
+
workflows:
- version: 2
- release:
- jobs:
- - prepare_release:
- filters:
- branches:
- only: /release-.*/
- - build_container1:
- requires:
- - prepare_release
- - build_container2:
- requires:
- - prepare_release
- - archive_and_release:
- context: org-global
- requires:
- - build_container1
- - build_container2
-
-
-
+ configure:
+ when:
+ and:
+ - matches:
+ pattern: "^release.+"
+ value: << pipeline.git.branch >>
+ jobs:
+ - setup
diff --git a/releaser/releaser.go b/releaser/releaser.go
index f2244842a..953d33bdc 100644
--- a/releaser/releaser.go
+++ b/releaser/releaser.go
@@ -101,7 +101,8 @@ func (r *ReleaseHandler) Run() error {
return err
}
- if _, err := r.git("commit", "-a", "-m", fmt.Sprintf("%s Bump versions for release of %s\n\n[ci skip]", commitPrefix, newVersion)); err != nil {
+ // The reason we use NOCIRCLECI, see https://github.com/gohugoio/hugo/issues/12753
+ if _, err := r.git("commit", "-a", "-m", fmt.Sprintf("%s Bump versions for release of %s\n\nNOCIRCLECI", commitPrefix, newVersion)); err != nil {
return err
}
From 261d7a03ae1e3bb38c59fb88134c2b56fc9e6cb7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?=
Date: Mon, 26 Aug 2024 15:56:39 +0200
Subject: [PATCH 018/570] Revert "Adjust Circleci workflow to make the Docker
images build"
This reverts commit 445283a5932b4e0f5fc377478fa1351547ea0426.
---
.circleci/build.yml | 120 --------------------------------------
.circleci/config.yml | 134 ++++++++++++++++++++++++++++++++++++-------
releaser/releaser.go | 3 +-
3 files changed, 113 insertions(+), 144 deletions(-)
delete mode 100644 .circleci/build.yml
diff --git a/.circleci/build.yml b/.circleci/build.yml
deleted file mode 100644
index e3e0073f6..000000000
--- a/.circleci/build.yml
+++ /dev/null
@@ -1,120 +0,0 @@
-version: 2.1
-
-# Passed from config.yml
-parameters:
- skip:
- type: boolean
- default: true
-
-defaults: &defaults
- resource_class: large
- docker:
- - image: bepsays/ci-hugoreleaser:1.22300.20000
-environment: &buildenv
- GOMODCACHE: /root/project/gomodcache
-jobs:
- prepare_release:
- <<: *defaults
- environment: &buildenv
- GOMODCACHE: /root/project/gomodcache
- steps:
- - &remote-docker
- setup_remote_docker:
- version: 20.10.14
- - checkout:
- path: hugo
- - &git-config
- run:
- command: |
- git config --global user.email "bjorn.erik.pedersen+hugoreleaser@gmail.com"
- git config --global user.name "hugoreleaser"
- - run:
- command: |
- cd hugo
- go mod download
- go run -tags release main.go release --step 1
- - save_cache:
- key: git-sha-{{ .Revision }}
- paths:
- - hugo
- - gomodcache
- build_container1:
- <<: [*defaults]
- environment:
- <<: [*buildenv]
- steps:
- - &restore-cache
- restore_cache:
- key: git-sha-{{ .Revision }}
- - run:
- no_output_timeout: 20m
- command: |
- mkdir -p /tmp/files/dist1
- cd hugo
- hugoreleaser build -paths "builds/container1/**" -workers 3 -dist /tmp/files/dist1 -chunks $CIRCLE_NODE_TOTAL -chunk-index $CIRCLE_NODE_INDEX
- - &persist-workspace
- persist_to_workspace:
- root: /tmp/files
- paths:
- - dist1
- - dist2
- parallelism: 7
- build_container2:
- <<: [*defaults]
- environment:
- <<: [*buildenv]
- docker:
- - image: bepsays/ci-hugoreleaser-linux-arm64:1.22300.20000
- steps:
- - *restore-cache
- - &attach-workspace
- attach_workspace:
- at: /tmp/workspace
- - run:
- command: |
- mkdir -p /tmp/files/dist2
- cd hugo
- hugoreleaser build -paths "builds/container2/**" -workers 1 -dist /tmp/files/dist2
- - *persist-workspace
- archive_and_release:
- <<: [*defaults]
- environment:
- <<: [*buildenv]
- steps:
- - *restore-cache
- - *attach-workspace
- - *git-config
- - run:
- name: Add github.com to known hosts
- command: ssh-keyscan github.com >> ~/.ssh/known_hosts
- - run:
- command: |
- cp -a /tmp/workspace/dist1/. ./hugo/dist
- cp -a /tmp/workspace/dist2/. ./hugo/dist
- - run:
- command: |
- cd hugo
- hugoreleaser archive
- hugoreleaser release
- go run -tags release main.go release --step 2
-workflows:
- release:
- when:
- and:
- - equal: [false, << pipeline.parameters.skip >>]
- jobs:
- - prepare_release:
- filters:
- branches:
- only: /release-.*/
- - build_container1:
- requires:
- - prepare_release
- - build_container2:
- requires:
- - prepare_release
- - archive_and_release:
- context: org-global
- requires:
- - build_container1
- - build_container2
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 588d3d894..0ff955936 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -1,27 +1,117 @@
-version: 2.1
-setup: true
-orbs:
- continuation: circleci/continuation@1
+parameters:
+
+# v2: 11m.
+defaults: &defaults
+ resource_class: large
+ docker:
+ - image: bepsays/ci-hugoreleaser:1.22300.20000
+environment: &buildenv
+ GOMODCACHE: /root/project/gomodcache
+version: 2
jobs:
- setup:
- docker:
- - image: cimg/go:1.21
+ prepare_release:
+ <<: *defaults
+ environment: &buildenv
+ GOMODCACHE: /root/project/gomodcache
steps:
- - checkout
+ - &remote-docker
+ setup_remote_docker:
+ version: 20.10.14
+ - checkout:
+ path: hugo
+ - &git-config
+ run:
+ command: |
+ git config --global user.email "bjorn.erik.pedersen+hugoreleaser@gmail.com"
+ git config --global user.name "hugoreleaser"
- run:
command: |
- export SKIP=$(git log -n 1 $CIRCLE_SHA1 --pretty=%B | grep -q "NOCIRCLECI" && echo "true" || echo "false")
- echo "{\"skip\": $SKIP}" >> set-up-params.json
- - continuation/continue:
- parameters: set-up-params.json
- configuration_path: .circleci/build.yml
-
+ cd hugo
+ go mod download
+ go run -tags release main.go release --step 1
+ - save_cache:
+ key: git-sha-{{ .Revision }}
+ paths:
+ - hugo
+ - gomodcache
+ build_container1:
+ <<: [*defaults]
+ environment:
+ <<: [*buildenv]
+ steps:
+ - &restore-cache
+ restore_cache:
+ key: git-sha-{{ .Revision }}
+ - run:
+ no_output_timeout: 20m
+ command: |
+ mkdir -p /tmp/files/dist1
+ cd hugo
+ hugoreleaser build -paths "builds/container1/**" -workers 3 -dist /tmp/files/dist1 -chunks $CIRCLE_NODE_TOTAL -chunk-index $CIRCLE_NODE_INDEX
+ - &persist-workspace
+ persist_to_workspace:
+ root: /tmp/files
+ paths:
+ - dist1
+ - dist2
+ parallelism: 7
+ build_container2:
+ <<: [*defaults]
+ environment:
+ <<: [*buildenv]
+ docker:
+ - image: bepsays/ci-hugoreleaser-linux-arm64:1.22300.20000
+ steps:
+ - *restore-cache
+ - &attach-workspace
+ attach_workspace:
+ at: /tmp/workspace
+ - run:
+ command: |
+ mkdir -p /tmp/files/dist2
+ cd hugo
+ hugoreleaser build -paths "builds/container2/**" -workers 1 -dist /tmp/files/dist2
+ - *persist-workspace
+ archive_and_release:
+ <<: [*defaults]
+ environment:
+ <<: [*buildenv]
+ steps:
+ - *restore-cache
+ - *attach-workspace
+ - *git-config
+ - run:
+ name: Add github.com to known hosts
+ command: ssh-keyscan github.com >> ~/.ssh/known_hosts
+ - run:
+ command: |
+ cp -a /tmp/workspace/dist1/. ./hugo/dist
+ cp -a /tmp/workspace/dist2/. ./hugo/dist
+ - run:
+ command: |
+ cd hugo
+ hugoreleaser archive
+ hugoreleaser release
+ go run -tags release main.go release --step 2
workflows:
- configure:
- when:
- and:
- - matches:
- pattern: "^release.+"
- value: << pipeline.git.branch >>
- jobs:
- - setup
+ version: 2
+ release:
+ jobs:
+ - prepare_release:
+ filters:
+ branches:
+ only: /release-.*/
+ - build_container1:
+ requires:
+ - prepare_release
+ - build_container2:
+ requires:
+ - prepare_release
+ - archive_and_release:
+ context: org-global
+ requires:
+ - build_container1
+ - build_container2
+
+
+
diff --git a/releaser/releaser.go b/releaser/releaser.go
index 953d33bdc..f2244842a 100644
--- a/releaser/releaser.go
+++ b/releaser/releaser.go
@@ -101,8 +101,7 @@ func (r *ReleaseHandler) Run() error {
return err
}
- // The reason we use NOCIRCLECI, see https://github.com/gohugoio/hugo/issues/12753
- if _, err := r.git("commit", "-a", "-m", fmt.Sprintf("%s Bump versions for release of %s\n\nNOCIRCLECI", commitPrefix, newVersion)); err != nil {
+ if _, err := r.git("commit", "-a", "-m", fmt.Sprintf("%s Bump versions for release of %s\n\n[ci skip]", commitPrefix, newVersion)); err != nil {
return err
}
From 47d00202e7e61769ce4d14691e43b27852c9cce4 Mon Sep 17 00:00:00 2001
From: hugoreleaser
Date: Mon, 26 Aug 2024 13:58:46 +0000
Subject: [PATCH 019/570] releaser: Bump versions for release of 0.133.1
[ci skip]
---
common/hugo/version_current.go | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/common/hugo/version_current.go b/common/hugo/version_current.go
index be502515a..8acc3341e 100644
--- a/common/hugo/version_current.go
+++ b/common/hugo/version_current.go
@@ -17,7 +17,7 @@ package hugo
// This should be the only one.
var CurrentVersion = Version{
Major: 0,
- Minor: 134,
- PatchLevel: 0,
- Suffix: "-DEV",
+ Minor: 133,
+ PatchLevel: 1,
+ Suffix: "",
}
From aa0f66b290b4e736670eb7135c76eb4e80677691 Mon Sep 17 00:00:00 2001
From: hugoreleaser
Date: Mon, 26 Aug 2024 14:13:52 +0000
Subject: [PATCH 020/570] releaser: Prepare repository for 0.134.0-DEV
[ci skip]
---
common/hugo/version_current.go | 6 +++---
hugoreleaser.env | 5 +++--
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/common/hugo/version_current.go b/common/hugo/version_current.go
index 8acc3341e..be502515a 100644
--- a/common/hugo/version_current.go
+++ b/common/hugo/version_current.go
@@ -17,7 +17,7 @@ package hugo
// This should be the only one.
var CurrentVersion = Version{
Major: 0,
- Minor: 133,
- PatchLevel: 1,
- Suffix: "",
+ Minor: 134,
+ PatchLevel: 0,
+ Suffix: "-DEV",
}
diff --git a/hugoreleaser.env b/hugoreleaser.env
index 145cab866..988c80653 100644
--- a/hugoreleaser.env
+++ b/hugoreleaser.env
@@ -1,7 +1,8 @@
# Release env.
# These will be replaced by script before release.
-HUGORELEASER_TAG=v0.133.0
-HUGORELEASER_COMMITISH=c9777473d1369f812d727a6c07dc57ad7be7bf62
+HUGORELEASER_TAG=v0.133.1
+HUGORELEASER_COMMITISH=47d00202e7e61769ce4d14691e43b27852c9cce4
+
From 371246de25c258343ef7688945c7a2d9b471214a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?=
Date: Wed, 28 Aug 2024 08:17:16 +0200
Subject: [PATCH 021/570] hugolib: Add a test for overriding _internal
templates
---
hugolib/template_test.go | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/hugolib/template_test.go b/hugolib/template_test.go
index 1c60a88b3..a610b4d59 100644
--- a/hugolib/template_test.go
+++ b/hugolib/template_test.go
@@ -706,3 +706,17 @@ a: {{ $a }}
b.AssertFileContent("public/index.html", `a: [a b c]`)
}
+
+func TestOverrideInternalTemplate(t *testing.T) {
+ files := `
+-- hugo.toml --
+baseURL = "https://example.org"
+-- layouts/index.html --
+{{ template "_internal/google_analytics_async.html" . }}
+-- layouts/_internal/google_analytics_async.html --
+Overridden.
+`
+ b := Test(t, files)
+
+ b.AssertFileContent("public/index.html", "Overridden.")
+}
From 1ecd0596a3df62c6ad266e70d7cad51f8e916a08 Mon Sep 17 00:00:00 2001
From: Joe Mooring
Date: Mon, 26 Aug 2024 07:27:43 -0700
Subject: [PATCH 022/570] output: Fix docshelper template lookup order for AMP
pages
Fixes #12797
---
docs/data/docs.yaml | 14 +++++++-------
output/docshelper.go | 4 ++--
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/docs/data/docs.yaml b/docs/data/docs.yaml
index 7ac76ee39..8d97c21e0 100644
--- a/docs/data/docs.yaml
+++ b/docs/data/docs.yaml
@@ -1865,7 +1865,7 @@ output:
- layouts/_default/demolayout-baseof.html
- layouts/_default/single-baseof.html
- layouts/_default/baseof.html
- - Example: AMP single page
+ - Example: AMP single page in "posts" section
Kind: page
OutputFormat: amp
Suffix: html
@@ -1874,17 +1874,17 @@ output:
- layouts/posts/single.html
- layouts/_default/single.amp.html
- layouts/_default/single.html
- - Example: AMP single page, French language
+ - Example: AMP single page in "posts" section, French language
Kind: page
- OutputFormat: html
+ OutputFormat: amp
Suffix: html
Template Lookup Order:
- - layouts/posts/single.fr.html.html
- - layouts/posts/single.html.html
+ - layouts/posts/single.fr.amp.html
+ - layouts/posts/single.amp.html
- layouts/posts/single.fr.html
- layouts/posts/single.html
- - layouts/_default/single.fr.html.html
- - layouts/_default/single.html.html
+ - layouts/_default/single.fr.amp.html
+ - layouts/_default/single.amp.html
- layouts/_default/single.fr.html
- layouts/_default/single.html
- Example: Home page
diff --git a/output/docshelper.go b/output/docshelper.go
index f7f3b0c4a..0f2a0eff6 100644
--- a/output/docshelper.go
+++ b/output/docshelper.go
@@ -46,8 +46,8 @@ func createLayoutExamples() any {
{"Base template for single page in \"posts\" section", layouts.LayoutDescriptor{Baseof: true, Kind: "page", Type: "posts", OutputFormatName: "html", Suffix: "html"}},
{"Single page in \"posts\" section with layout set to \"demolayout\"", layouts.LayoutDescriptor{Kind: "page", Type: "posts", Layout: demoLayout, OutputFormatName: "html", Suffix: "html"}},
{"Base template for single page in \"posts\" section with layout set to \"demolayout\"", layouts.LayoutDescriptor{Baseof: true, Kind: "page", Type: "posts", Layout: demoLayout, OutputFormatName: "html", Suffix: "html"}},
- {"AMP single page", layouts.LayoutDescriptor{Kind: "page", Type: "posts", OutputFormatName: "amp", Suffix: "html"}},
- {"AMP single page, French language", layouts.LayoutDescriptor{Kind: "page", Type: "posts", Lang: "fr", OutputFormatName: "html", Suffix: "html"}},
+ {"AMP single page in \"posts\" section", layouts.LayoutDescriptor{Kind: "page", Type: "posts", OutputFormatName: "amp", Suffix: "html"}},
+ {"AMP single page in \"posts\" section, French language", layouts.LayoutDescriptor{Kind: "page", Type: "posts", Lang: "fr", OutputFormatName: "amp", Suffix: "html"}},
// Typeless pages get "page" as type
{"Home page", layouts.LayoutDescriptor{Kind: "home", Type: "page", OutputFormatName: "html", Suffix: "html"}},
{"Base template for home page", layouts.LayoutDescriptor{Baseof: true, Kind: "home", Type: "page", OutputFormatName: "html", Suffix: "html"}},
From 4ded32d077d18c73537ce2679fb61bd6e6b466c9 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 26 Aug 2024 08:38:16 +0000
Subject: [PATCH 023/570] build(deps): bump github.com/pelletier/go-toml/v2
from 2.2.2 to 2.2.3
Bumps [github.com/pelletier/go-toml/v2](https://github.com/pelletier/go-toml) from 2.2.2 to 2.2.3.
- [Release notes](https://github.com/pelletier/go-toml/releases)
- [Changelog](https://github.com/pelletier/go-toml/blob/v2/.goreleaser.yaml)
- [Commits](https://github.com/pelletier/go-toml/compare/v2.2.2...v2.2.3)
---
updated-dependencies:
- dependency-name: github.com/pelletier/go-toml/v2
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
---
go.mod | 2 +-
go.sum | 10 ++--------
2 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/go.mod b/go.mod
index 6c103ceb5..02ec0efc8 100644
--- a/go.mod
+++ b/go.mod
@@ -59,7 +59,7 @@ require (
github.com/niklasfasching/go-org v1.7.0
github.com/olekukonko/tablewriter v0.0.5
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58
- github.com/pelletier/go-toml/v2 v2.2.2
+ github.com/pelletier/go-toml/v2 v2.2.3
github.com/rogpeppe/go-internal v1.12.0
github.com/sanity-io/litter v1.5.5
github.com/spf13/afero v1.11.0
diff --git a/go.sum b/go.sum
index 8117c41e0..89b6e2388 100644
--- a/go.sum
+++ b/go.sum
@@ -139,8 +139,6 @@ github.com/bep/gowebp v0.3.0 h1:MhmMrcf88pUY7/PsEhMgEP0T6fDUnRTMpN8OclDrbrY=
github.com/bep/gowebp v0.3.0/go.mod h1:ZhFodwdiFp8ehGJpF4LdPl6unxZm9lLFjxD3z2h2AgI=
github.com/bep/helpers v0.4.0 h1:ab9veaAiWY4ST48Oxp5usaqivDmYdB744fz+tcZ3Ifs=
github.com/bep/helpers v0.4.0/go.mod h1:/QpHdmcPagDw7+RjkLFCvnlUc8lQ5kg4KDrEkb2Yyco=
-github.com/bep/imagemeta v0.8.0 h1:4lqI839akl6lR61D7hmvaw2LDOxiXFZ4D0VIyHyGpc4=
-github.com/bep/imagemeta v0.8.0/go.mod h1:5piPAq5Qomh07m/dPPCLN3mDJyFusvUG7VwdRD/vX0s=
github.com/bep/imagemeta v0.8.1 h1:tjZLPRftjxU7PTI87o5e5WKOFQ4S9S0engiP1OTpJTI=
github.com/bep/imagemeta v0.8.1/go.mod h1:5piPAq5Qomh07m/dPPCLN3mDJyFusvUG7VwdRD/vX0s=
github.com/bep/lazycache v0.4.0 h1:X8yVyWNVupPd4e1jV7efi3zb7ZV/qcjKQgIQ5aPbkYI=
@@ -402,8 +400,8 @@ github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 h1:onHthvaw9LFnH4t2DcNVpwGmV9E1BkGknEliJkfwQj0=
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58/go.mod h1:DXv8WO4yhMYhSNPKjeNKa5WY9YCIEBRbNzFFPJbWO6Y=
-github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM=
-github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs=
+github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M=
+github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc=
github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s=
github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw=
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ=
@@ -444,7 +442,6 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
-github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
github.com/stretchr/testify v0.0.0-20161117074351-18a02ba4a312/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
@@ -453,7 +450,6 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
-github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/tdewolff/minify/v2 v2.20.37 h1:Q97cx4STXCh1dlWDlNHZniE8BJ2EBL0+2b0n92BJQhw=
@@ -463,8 +459,6 @@ github.com/tdewolff/parse/v2 v2.7.15/go.mod h1:3FbJWZp3XT9OWVN3Hmfp0p/a08v4h8J9W
github.com/tdewolff/test v1.0.11-0.20231101010635-f1265d231d52/go.mod h1:6DAvZliBAAnD7rhVgwaM7DE5/d9NMOAJ09SqYqeK4QE=
github.com/tdewolff/test v1.0.11-0.20240106005702-7de5f7df4739 h1:IkjBCtQOOjIn03u/dMQK9g+Iw9ewps4mCl1nB8Sscbo=
github.com/tdewolff/test v1.0.11-0.20240106005702-7de5f7df4739/go.mod h1:XPuWBzvdUzhCuxWO1ojpXsyzsA5bFoS3tO/Q3kFuTG8=
-github.com/tetratelabs/wazero v1.7.4-0.20240805170331-2b12e189eeec h1:KeQseLFSWb9qjW4PSWxciTBk1hbG7KsVx3rs1hIQnbQ=
-github.com/tetratelabs/wazero v1.7.4-0.20240805170331-2b12e189eeec/go.mod h1:ytl6Zuh20R/eROuyDaGPkp82O9C/DJfXAwJfQ3X6/7Y=
github.com/tetratelabs/wazero v1.8.0 h1:iEKu0d4c2Pd+QSRieYbnQC9yiFlMS9D+Jr0LsRmcF4g=
github.com/tetratelabs/wazero v1.8.0/go.mod h1:yAI0XTsMBhREkM/YDAK/zNou3GoiAce1P6+rp/wQhjs=
github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0=
From 12a28ef7738764d998c201060fce47097d96f48e Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 19 Aug 2024 08:45:03 +0000
Subject: [PATCH 024/570] build(deps): bump github.com/evanw/esbuild from
0.23.0 to 0.23.1
Bumps [github.com/evanw/esbuild](https://github.com/evanw/esbuild) from 0.23.0 to 0.23.1.
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG.md)
- [Commits](https://github.com/evanw/esbuild/compare/v0.23.0...v0.23.1)
---
updated-dependencies:
- dependency-name: github.com/evanw/esbuild
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
---
go.mod | 2 +-
go.sum | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/go.mod b/go.mod
index 02ec0efc8..e75154289 100644
--- a/go.mod
+++ b/go.mod
@@ -27,7 +27,7 @@ require (
github.com/cli/safeexec v1.0.1
github.com/disintegration/gift v1.2.1
github.com/dustin/go-humanize v1.0.1
- github.com/evanw/esbuild v0.23.0
+ github.com/evanw/esbuild v0.23.1
github.com/fatih/color v1.17.0
github.com/fortytw2/leaktest v1.3.0
github.com/frankban/quicktest v1.14.6
diff --git a/go.sum b/go.sum
index 89b6e2388..1426701dc 100644
--- a/go.sum
+++ b/go.sum
@@ -189,8 +189,8 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m
github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po=
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
-github.com/evanw/esbuild v0.23.0 h1:PLUwTn2pzQfIBRrMKcD3M0g1ALOKIHMDefdFCk7avwM=
-github.com/evanw/esbuild v0.23.0/go.mod h1:D2vIQZqV/vIf/VRHtViaUtViZmG7o+kKmlBfVQuRi48=
+github.com/evanw/esbuild v0.23.1 h1:ociewhY6arjTarKLdrXfDTgy25oxhTZmzP8pfuBTfTA=
+github.com/evanw/esbuild v0.23.1/go.mod h1:D2vIQZqV/vIf/VRHtViaUtViZmG7o+kKmlBfVQuRi48=
github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
From 2b5c335e933cbd8e4e8569f206add5ec1bccd8e9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?=
Date: Wed, 28 Aug 2024 14:35:24 +0200
Subject: [PATCH 025/570] deps: Upgrade github.com/bep/golibsass v1.1.1 =>
v1.2.0
Fixes #12649
---
common/hugo/hugo.go | 2 +-
go.mod | 2 +-
go.sum | 2 ++
3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/common/hugo/hugo.go b/common/hugo/hugo.go
index 0589ac9a3..456968973 100644
--- a/common/hugo/hugo.go
+++ b/common/hugo/hugo.go
@@ -276,7 +276,7 @@ func GetDependencyListNonGo() []string {
if IsExtended {
deps = append(
deps,
- formatDep("github.com/sass/libsass", "3.6.5"),
+ formatDep("github.com/sass/libsass", "3.6.6"),
formatDep("github.com/webmproject/libwebp", "v1.3.2"),
)
}
diff --git a/go.mod b/go.mod
index e75154289..353f3b872 100644
--- a/go.mod
+++ b/go.mod
@@ -12,7 +12,7 @@ require (
github.com/bep/goat v0.5.0
github.com/bep/godartsass v1.2.0
github.com/bep/godartsass/v2 v2.1.0
- github.com/bep/golibsass v1.1.1
+ github.com/bep/golibsass v1.2.0
github.com/bep/gowebp v0.3.0
github.com/bep/helpers v0.4.0
github.com/bep/imagemeta v0.8.1
diff --git a/go.sum b/go.sum
index 1426701dc..77c8f8849 100644
--- a/go.sum
+++ b/go.sum
@@ -135,6 +135,8 @@ github.com/bep/godartsass/v2 v2.1.0 h1:fq5Y1xYf4diu4tXABiekZUCA+5l/dmNjGKCeQwdy+
github.com/bep/godartsass/v2 v2.1.0/go.mod h1:AcP8QgC+OwOXEq6im0WgDRYK7scDsmZCEW62o1prQLo=
github.com/bep/golibsass v1.1.1 h1:xkaet75ygImMYjM+FnHIT3xJn7H0xBA9UxSOJjk8Khw=
github.com/bep/golibsass v1.1.1/go.mod h1:DL87K8Un/+pWUS75ggYv41bliGiolxzDKWJAq3eJ1MA=
+github.com/bep/golibsass v1.2.0 h1:nyZUkKP/0psr8nT6GR2cnmt99xS93Ji82ZD9AgOK6VI=
+github.com/bep/golibsass v1.2.0/go.mod h1:DL87K8Un/+pWUS75ggYv41bliGiolxzDKWJAq3eJ1MA=
github.com/bep/gowebp v0.3.0 h1:MhmMrcf88pUY7/PsEhMgEP0T6fDUnRTMpN8OclDrbrY=
github.com/bep/gowebp v0.3.0/go.mod h1:ZhFodwdiFp8ehGJpF4LdPl6unxZm9lLFjxD3z2h2AgI=
github.com/bep/helpers v0.4.0 h1:ab9veaAiWY4ST48Oxp5usaqivDmYdB744fz+tcZ3Ifs=
From 37609262dcddac6d3358412b10214111b4d4dc3d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?=
Date: Tue, 13 Aug 2024 15:49:56 +0200
Subject: [PATCH 026/570] Add Page.Contents with scope support
Note that this also adds a new `.ContentWithoutSummary` method, and to do that we had to unify the different summary types:
Both `auto` and `manual` now returns HTML. Before this commit, `auto` would return plain text. This could be considered to be a slightly breaking change, but for the better: Now you can treat the `.Summary` the same without thinking about where it comes from, and if you want plain text, pipe it into `{{ .Summary | plainify }}`.
Fixes #8680
Fixes #12761
Fixes #12778
Fixes #716
---
common/hugo/hugo.go | 25 +
common/hugo/hugo_test.go | 14 +
common/paths/pathparser.go | 4 +-
common/types/types.go | 12 +-
common/types/types_test.go | 22 +
helpers/content.go | 74 ---
helpers/content_test.go | 79 ---
hugolib/page.go | 9 +-
hugolib/page__content.go | 586 ++++++++++++++----
hugolib/page__meta.go | 2 +-
hugolib/page__output.go | 5 +-
hugolib/page__per_output.go | 464 ++++----------
hugolib/page_test.go | 204 +-----
hugolib/shortcode_page.go | 4 +
hugolib/shortcode_test.go | 31 +-
resources/page/page.go | 10 +-
resources/page/page_lazy_contentprovider.go | 11 +
resources/page/page_markup.go | 344 ++++++++++
.../page/page_markup_integration_test.go | 337 ++++++++++
resources/page/page_markup_test.go | 151 +++++
resources/page/page_nop.go | 76 +++
resources/page/testhelpers_test.go | 8 +
22 files changed, 1614 insertions(+), 858 deletions(-)
create mode 100644 resources/page/page_markup.go
create mode 100644 resources/page/page_markup_integration_test.go
create mode 100644 resources/page/page_markup_test.go
diff --git a/common/hugo/hugo.go b/common/hugo/hugo.go
index 456968973..f21103940 100644
--- a/common/hugo/hugo.go
+++ b/common/hugo/hugo.go
@@ -14,6 +14,7 @@
package hugo
import (
+ "context"
"fmt"
"html/template"
"os"
@@ -29,6 +30,7 @@ import (
"github.com/mitchellh/mapstructure"
"github.com/bep/godartsass/v2"
+ "github.com/gohugoio/hugo/common/hcontext"
"github.com/gohugoio/hugo/common/hexec"
"github.com/gohugoio/hugo/common/loggers"
"github.com/gohugoio/hugo/hugofs/files"
@@ -69,6 +71,9 @@ type HugoInfo struct {
conf ConfigProvider
deps []*Dependency
+
+ // Context gives access to some of the context scoped variables.
+ Context Context
}
// Version returns the current version as a comparable version string.
@@ -127,6 +132,26 @@ func (i HugoInfo) IsMultilingual() bool {
return i.conf.IsMultilingual()
}
+type contextKey string
+
+var markupScope = hcontext.NewContextDispatcher[string](contextKey("markupScope"))
+
+type Context struct{}
+
+func (c Context) MarkupScope(ctx context.Context) string {
+ return GetMarkupScope(ctx)
+}
+
+// SetMarkupScope sets the markup scope in the context.
+func SetMarkupScope(ctx context.Context, s string) context.Context {
+ return markupScope.Set(ctx, s)
+}
+
+// GetMarkupScope gets the markup scope from the context.
+func GetMarkupScope(ctx context.Context) string {
+ return markupScope.Get(ctx)
+}
+
// ConfigProvider represents the config options that are relevant for HugoInfo.
type ConfigProvider interface {
Environment() string
diff --git a/common/hugo/hugo_test.go b/common/hugo/hugo_test.go
index 6e8b2620e..241d8c0ae 100644
--- a/common/hugo/hugo_test.go
+++ b/common/hugo/hugo_test.go
@@ -14,6 +14,7 @@
package hugo
import (
+ "context"
"fmt"
"testing"
@@ -64,6 +65,19 @@ func TestDeprecationLogLevelFromVersion(t *testing.T) {
c.Assert(deprecationLogLevelFromVersion(ver.String()), qt.Equals, logg.LevelError)
}
+func TestMarkupScope(t *testing.T) {
+ c := qt.New(t)
+
+ conf := testConfig{environment: "production", workingDir: "/mywork", running: false}
+ info := NewInfo(conf, nil)
+
+ ctx := context.Background()
+
+ ctx = SetMarkupScope(ctx, "foo")
+
+ c.Assert(info.Context.MarkupScope(ctx), qt.Equals, "foo")
+}
+
type testConfig struct {
environment string
running bool
diff --git a/common/paths/pathparser.go b/common/paths/pathparser.go
index 5fa798fb0..94329fe7a 100644
--- a/common/paths/pathparser.go
+++ b/common/paths/pathparser.go
@@ -153,7 +153,7 @@ func (pp *PathParser) doParse(component, s string, p *Path) (*Path, error) {
} else {
high = len(p.s)
}
- id := types.LowHigh{Low: i + 1, High: high}
+ id := types.LowHigh[string]{Low: i + 1, High: high}
if len(p.identifiers) == 0 {
p.identifiers = append(p.identifiers, id)
} else if len(p.identifiers) == 1 {
@@ -260,7 +260,7 @@ type Path struct {
component string
bundleType PathType
- identifiers []types.LowHigh
+ identifiers []types.LowHigh[string]
posIdentifierLanguage int
disabled bool
diff --git a/common/types/types.go b/common/types/types.go
index 322dfe592..d32391a88 100644
--- a/common/types/types.go
+++ b/common/types/types.go
@@ -107,12 +107,20 @@ func Unwrapv(v any) any {
return v
}
-// LowHigh is typically used to represent a slice boundary.
-type LowHigh struct {
+// LowHigh represents a byte or slice boundary.
+type LowHigh[S ~[]byte | string] struct {
Low int
High int
}
+func (l LowHigh[S]) IsZero() bool {
+ return l.Low < 0 || (l.Low == 0 && l.High == 0)
+}
+
+func (l LowHigh[S]) Value(source S) S {
+ return source[l.Low:l.High]
+}
+
// This is only used for debugging purposes.
var InvocationCounter atomic.Int64
diff --git a/common/types/types_test.go b/common/types/types_test.go
index 6f13ae834..795733047 100644
--- a/common/types/types_test.go
+++ b/common/types/types_test.go
@@ -27,3 +27,25 @@ func TestKeyValues(t *testing.T) {
c.Assert(kv.KeyString(), qt.Equals, "key")
c.Assert(kv.Values, qt.DeepEquals, []any{"a1", "a2"})
}
+
+func TestLowHigh(t *testing.T) {
+ c := qt.New(t)
+
+ lh := LowHigh[string]{
+ Low: 2,
+ High: 10,
+ }
+
+ s := "abcdefghijklmnopqrstuvwxyz"
+ c.Assert(lh.IsZero(), qt.IsFalse)
+ c.Assert(lh.Value(s), qt.Equals, "cdefghij")
+
+ lhb := LowHigh[[]byte]{
+ Low: 2,
+ High: 10,
+ }
+
+ sb := []byte(s)
+ c.Assert(lhb.IsZero(), qt.IsFalse)
+ c.Assert(lhb.Value(sb), qt.DeepEquals, []byte("cdefghij"))
+}
diff --git a/helpers/content.go b/helpers/content.go
index 49283d526..9d74a3d31 100644
--- a/helpers/content.go
+++ b/helpers/content.go
@@ -22,7 +22,6 @@ import (
"html/template"
"strings"
"unicode"
- "unicode/utf8"
"github.com/gohugoio/hugo/common/hexec"
"github.com/gohugoio/hugo/common/loggers"
@@ -165,75 +164,6 @@ func TotalWords(s string) int {
return n
}
-// TruncateWordsByRune truncates words by runes.
-func (c *ContentSpec) TruncateWordsByRune(in []string) (string, bool) {
- words := make([]string, len(in))
- copy(words, in)
-
- count := 0
- for index, word := range words {
- if count >= c.Cfg.SummaryLength() {
- return strings.Join(words[:index], " "), true
- }
- runeCount := utf8.RuneCountInString(word)
- if len(word) == runeCount {
- count++
- } else if count+runeCount < c.Cfg.SummaryLength() {
- count += runeCount
- } else {
- for ri := range word {
- if count >= c.Cfg.SummaryLength() {
- truncatedWords := append(words[:index], word[:ri])
- return strings.Join(truncatedWords, " "), true
- }
- count++
- }
- }
- }
-
- return strings.Join(words, " "), false
-}
-
-// TruncateWordsToWholeSentence takes content and truncates to whole sentence
-// limited by max number of words. It also returns whether it is truncated.
-func (c *ContentSpec) TruncateWordsToWholeSentence(s string) (string, bool) {
- var (
- wordCount = 0
- lastWordIndex = -1
- )
-
- for i, r := range s {
- if unicode.IsSpace(r) {
- wordCount++
- lastWordIndex = i
-
- if wordCount >= c.Cfg.SummaryLength() {
- break
- }
-
- }
- }
-
- if lastWordIndex == -1 {
- return s, false
- }
-
- endIndex := -1
-
- for j, r := range s[lastWordIndex:] {
- if isEndOfSentence(r) {
- endIndex = j + lastWordIndex + utf8.RuneLen(r)
- break
- }
- }
-
- if endIndex == -1 {
- return s, false
- }
-
- return strings.TrimSpace(s[:endIndex]), endIndex < len(s)
-}
-
// TrimShortHTML removes the outer tags from HTML input where (a) the opening
// tag is present only once with the input, and (b) the opening and closing
// tags wrap the input after white space removal.
@@ -256,7 +186,3 @@ func (c *ContentSpec) TrimShortHTML(input []byte, markup string) []byte {
}
return input
}
-
-func isEndOfSentence(r rune) bool {
- return r == '.' || r == '?' || r == '!' || r == '"' || r == '\n'
-}
diff --git a/helpers/content_test.go b/helpers/content_test.go
index 22d468191..dd7c5a4c5 100644
--- a/helpers/content_test.go
+++ b/helpers/content_test.go
@@ -20,7 +20,6 @@ import (
"testing"
qt "github.com/frankban/quicktest"
- "github.com/gohugoio/hugo/config"
"github.com/gohugoio/hugo/helpers"
)
@@ -66,84 +65,6 @@ func TestBytesToHTML(t *testing.T) {
c.Assert(helpers.BytesToHTML([]byte("dobedobedo")), qt.Equals, template.HTML("dobedobedo"))
}
-var benchmarkTruncateString = strings.Repeat("This is a sentence about nothing.", 20)
-
-func BenchmarkTestTruncateWordsToWholeSentence(b *testing.B) {
- c := newTestContentSpec(nil)
- b.ResetTimer()
- for i := 0; i < b.N; i++ {
- c.TruncateWordsToWholeSentence(benchmarkTruncateString)
- }
-}
-
-func TestTruncateWordsToWholeSentence(t *testing.T) {
- type test struct {
- input, expected string
- max int
- truncated bool
- }
- data := []test{
- {"a b c", "a b c", 12, false},
- {"a b c", "a b c", 3, false},
- {"a", "a", 1, false},
- {"This is a sentence.", "This is a sentence.", 5, false},
- {"This is also a sentence!", "This is also a sentence!", 1, false},
- {"To be. Or not to be. That's the question.", "To be.", 1, true},
- {" \nThis is not a sentence\nAnd this is another", "This is not a sentence", 4, true},
- {"", "", 10, false},
- {"This... is a more difficult test?", "This... is a more difficult test?", 1, false},
- }
- for i, d := range data {
- cfg := config.New()
- cfg.Set("summaryLength", d.max)
- c := newTestContentSpec(cfg)
- output, truncated := c.TruncateWordsToWholeSentence(d.input)
- if d.expected != output {
- t.Errorf("Test %d failed. Expected %q got %q", i, d.expected, output)
- }
-
- if d.truncated != truncated {
- t.Errorf("Test %d failed. Expected truncated=%t got %t", i, d.truncated, truncated)
- }
- }
-}
-
-func TestTruncateWordsByRune(t *testing.T) {
- type test struct {
- input, expected string
- max int
- truncated bool
- }
- data := []test{
- {"", "", 1, false},
- {"a b c", "a b c", 12, false},
- {"a b c", "a b c", 3, false},
- {"a", "a", 1, false},
- {"Hello 中国", "", 0, true},
- {"这是中文,全中文。", "这是中文,", 5, true},
- {"Hello 中国", "Hello 中", 2, true},
- {"Hello 中国", "Hello 中国", 3, false},
- {"Hello中国 Good 好的", "Hello中国 Good 好", 9, true},
- {"This is a sentence.", "This is", 2, true},
- {"This is also a sentence!", "This", 1, true},
- {"To be. Or not to be. That's the question.", "To be. Or not", 4, true},
- {" \nThis is not a sentence\n ", "This is not", 3, true},
- }
- for i, d := range data {
- cfg := config.New()
- cfg.Set("summaryLength", d.max)
- c := newTestContentSpec(cfg)
- output, truncated := c.TruncateWordsByRune(strings.Fields(d.input))
- if d.expected != output {
- t.Errorf("Test %d failed. Expected %q got %q", i, d.expected, output)
- }
-
- if d.truncated != truncated {
- t.Errorf("Test %d failed. Expected truncated=%t got %t", i, d.truncated, truncated)
- }
- }
-}
-
func TestExtractTOCNormalContent(t *testing.T) {
content := []byte("\n\nTOC 2 {
+ return "", errors.New("want 1 or 2 arguments")
+ }
+
+ pco := c.pco
+
+ var contentToRender string
+ opts := defaultRenderStringOpts
+ sidx := 1
+
+ if len(args) == 1 {
+ sidx = 0
+ } else {
+ m, ok := args[0].(map[string]any)
+ if !ok {
+ return "", errors.New("first argument must be a map")
+ }
+
+ if err := mapstructure.WeakDecode(m, &opts); err != nil {
+ return "", fmt.Errorf("failed to decode options: %w", err)
+ }
+ if opts.Markup != "" {
+ opts.Markup = markup.ResolveMarkup(opts.Markup)
+ }
+ }
+
+ contentToRenderv := args[sidx]
+
+ if _, ok := contentToRenderv.(hstring.RenderedString); ok {
+ // This content is already rendered, this is potentially
+ // a infinite recursion.
+ return "", errors.New("text is already rendered, repeating it may cause infinite recursion")
+ }
+
+ var err error
+ contentToRender, err = cast.ToStringE(contentToRenderv)
+ if err != nil {
+ return "", err
+ }
+
+ if err = pco.initRenderHooks(); err != nil {
+ return "", err
+ }
+
+ conv := pco.po.p.getContentConverter()
+
+ if opts.Markup != "" && opts.Markup != pco.po.p.m.pageConfig.ContentMediaType.SubType {
+ var err error
+ conv, err = pco.po.p.m.newContentConverter(pco.po.p, opts.Markup)
+ if err != nil {
+ return "", pco.po.p.wrapError(err)
+ }
+ }
+
+ var rendered []byte
+
+ parseInfo := &contentParseInfo{
+ h: pco.po.p.s.h,
+ pid: pco.po.p.pid,
+ }
+
+ if pageparser.HasShortcode(contentToRender) {
+ contentToRenderb := []byte(contentToRender)
+ // String contains a shortcode.
+ parseInfo.itemsStep1, err = pageparser.ParseBytes(contentToRenderb, pageparser.Config{
+ NoFrontMatter: true,
+ NoSummaryDivider: true,
+ })
+ if err != nil {
+ return "", err
+ }
+
+ s := newShortcodeHandler(pco.po.p.pathOrTitle(), pco.po.p.s)
+ if err := parseInfo.mapItemsAfterFrontMatter(contentToRenderb, s); err != nil {
+ return "", err
+ }
+
+ placeholders, err := s.prepareShortcodesForPage(ctx, pco.po.p, pco.po.f, true)
+ if err != nil {
+ return "", err
+ }
+
+ contentToRender, hasVariants, err := parseInfo.contentToRender(ctx, contentToRenderb, placeholders)
+ if err != nil {
+ return "", err
+ }
+ if hasVariants {
+ pco.po.p.pageOutputTemplateVariationsState.Add(1)
+ }
+ b, err := pco.renderContentWithConverter(ctx, conv, contentToRender, false)
+ if err != nil {
+ return "", pco.po.p.wrapError(err)
+ }
+ rendered = b.Bytes()
+
+ if parseInfo.hasNonMarkdownShortcode {
+ var hasShortcodeVariants bool
+
+ tokenHandler := func(ctx context.Context, token string) ([]byte, error) {
+ if token == tocShortcodePlaceholder {
+ toc, err := c.contentToC(ctx)
+ if err != nil {
+ return nil, err
+ }
+ // The Page's TableOfContents was accessed in a shortcode.
+ return []byte(toc.tableOfContentsHTML), nil
+ }
+ renderer, found := placeholders[token]
+ if found {
+ repl, more, err := renderer.renderShortcode(ctx)
+ if err != nil {
+ return nil, err
+ }
+ hasShortcodeVariants = hasShortcodeVariants || more
+ return repl, nil
+ }
+ // This should not happen.
+ return nil, fmt.Errorf("unknown shortcode token %q", token)
+ }
+
+ rendered, err = expandShortcodeTokens(ctx, rendered, tokenHandler)
+ if err != nil {
+ return "", err
+ }
+ if hasShortcodeVariants {
+ pco.po.p.pageOutputTemplateVariationsState.Add(1)
+ }
+ }
+
+ // We need a consolidated view in $page.HasShortcode
+ pco.po.p.m.content.shortcodeState.transferNames(s)
+
+ } else {
+ c, err := pco.renderContentWithConverter(ctx, conv, []byte(contentToRender), false)
+ if err != nil {
+ return "", pco.po.p.wrapError(err)
+ }
+
+ rendered = c.Bytes()
+ }
+
+ if opts.Display == "inline" {
+ markup := pco.po.p.m.pageConfig.Content.Markup
+ if opts.Markup != "" {
+ markup = pco.po.p.s.ContentSpec.ResolveMarkup(opts.Markup)
+ }
+ rendered = pco.po.p.s.ContentSpec.TrimShortHTML(rendered, markup)
+ }
+
+ return template.HTML(string(rendered)), nil
+}
+
+func (c *cachedContentScope) RenderShortcodes(ctx context.Context) (template.HTML, error) {
+ ctx = c.prepareContext(ctx)
+
+ pco := c.pco
+ content := pco.po.p.m.content
+
+ source, err := content.pi.contentSource(content)
+ if err != nil {
+ return "", err
+ }
+ ct, err := c.contentToC(ctx)
+ if err != nil {
+ return "", err
+ }
+
+ var insertPlaceholders bool
+ var hasVariants bool
+ cb := setGetContentCallbackInContext.Get(ctx)
+ if cb != nil {
+ insertPlaceholders = true
+ }
+ cc := make([]byte, 0, len(source)+(len(source)/10))
+ for _, it := range content.pi.itemsStep2 {
+ switch v := it.(type) {
+ case pageparser.Item:
+ cc = append(cc, source[v.Pos():v.Pos()+len(v.Val(source))]...)
+ case pageContentReplacement:
+ // Ignore.
+ case *shortcode:
+ if !insertPlaceholders || !v.insertPlaceholder() {
+ // Insert the rendered shortcode.
+ renderedShortcode, found := ct.contentPlaceholders[v.placeholder]
+ if !found {
+ // This should never happen.
+ panic(fmt.Sprintf("rendered shortcode %q not found", v.placeholder))
+ }
+
+ b, more, err := renderedShortcode.renderShortcode(ctx)
+ if err != nil {
+ return "", fmt.Errorf("failed to render shortcode: %w", err)
+ }
+ hasVariants = hasVariants || more
+ cc = append(cc, []byte(b)...)
+
+ } else {
+ // Insert the placeholder so we can insert the content after
+ // markdown processing.
+ cc = append(cc, []byte(v.placeholder)...)
+ }
+ default:
+ panic(fmt.Sprintf("unknown item type %T", it))
+ }
+ }
+
+ if hasVariants {
+ pco.po.p.pageOutputTemplateVariationsState.Add(1)
+ }
+
+ if cb != nil {
+ cb(pco, ct)
+ }
+
+ if tpl.Context.IsInGoldmark.Get(ctx) {
+ // This content will be parsed and rendered by Goldmark.
+ // Wrap it in a special Hugo markup to assign the correct Page from
+ // the stack.
+ return template.HTML(hugocontext.Wrap(cc, pco.po.p.pid)), nil
+ }
+
+ return helpers.BytesToHTML(cc), nil
+}
+
+func (c *cachedContentScope) Plain(ctx context.Context) string {
+ ctx = c.prepareContext(ctx)
+ return c.mustContentPlain(ctx).plain
+}
+
+func (c *cachedContentScope) PlainWords(ctx context.Context) []string {
+ ctx = c.prepareContext(ctx)
+ return c.mustContentPlain(ctx).plainWords
+}
+
+func (c *cachedContentScope) WordCount(ctx context.Context) int {
+ ctx = c.prepareContext(ctx)
+ return c.mustContentPlain(ctx).wordCount
+}
+
+func (c *cachedContentScope) FuzzyWordCount(ctx context.Context) int {
+ ctx = c.prepareContext(ctx)
+ return c.mustContentPlain(ctx).fuzzyWordCount
+}
+
+func (c *cachedContentScope) ReadingTime(ctx context.Context) int {
+ ctx = c.prepareContext(ctx)
+ return c.mustContentPlain(ctx).readingTime
+}
+
+func (c *cachedContentScope) Len(ctx context.Context) int {
+ ctx = c.prepareContext(ctx)
+ return len(c.mustContentRendered(ctx).content)
+}
+
+func (c *cachedContentScope) Fragments(ctx context.Context) *tableofcontents.Fragments {
+ ctx = c.prepareContext(ctx)
+ toc := c.mustContentToC(ctx).tableOfContents
+ if toc == nil {
+ return nil
+ }
+ return toc
+}
+
+func (c *cachedContentScope) fragmentsHTML(ctx context.Context) template.HTML {
+ ctx = c.prepareContext(ctx)
+ return c.mustContentToC(ctx).tableOfContentsHTML
+}
+
+func (c *cachedContentScope) mustContentPlain(ctx context.Context) contentPlainPlainWords {
+ r, err := c.contentPlain(ctx)
+ if err != nil {
+ c.pco.fail(err)
+ }
+ return r
+}
+
+func (c *cachedContentScope) mustContentRendered(ctx context.Context) contentSummary {
+ r, err := c.contentRendered(ctx)
+ if err != nil {
+ c.pco.fail(err)
+ }
+ return r
+}
diff --git a/hugolib/page__meta.go b/hugolib/page__meta.go
index b23084a47..56e26ecdb 100644
--- a/hugolib/page__meta.go
+++ b/hugolib/page__meta.go
@@ -821,7 +821,7 @@ func (p *pageMeta) newContentConverter(ps *pageState, markup string) (converter.
// This prevents infinite recursion in some cases.
return doc
}
- if v, ok := ps.pageOutput.pco.otherOutputs[id]; ok {
+ if v, ok := ps.pageOutput.pco.otherOutputs.Get(id); ok {
return v.po.p
}
return nil
diff --git a/hugolib/page__output.go b/hugolib/page__output.go
index 2f4d6c205..b8086bb48 100644
--- a/hugolib/page__output.go
+++ b/hugolib/page__output.go
@@ -65,6 +65,7 @@ func newPageOutput(
p: ps,
f: f,
pagePerOutputProviders: providers,
+ MarkupProvider: page.NopPage,
ContentProvider: page.NopPage,
PageRenderProvider: page.NopPage,
TableOfContentsProvider: page.NopPage,
@@ -95,6 +96,7 @@ type pageOutput struct {
// output format.
contentRenderer page.ContentRenderer
pagePerOutputProviders
+ page.MarkupProvider
page.ContentProvider
page.PageRenderProvider
page.TableOfContentsProvider
@@ -119,7 +121,7 @@ func (po *pageOutput) isRendered() bool {
if po.renderState > 0 {
return true
}
- if po.pco != nil && po.pco.contentRendered {
+ if po.pco != nil && po.pco.contentRendered.Load() {
return true
}
return false
@@ -139,6 +141,7 @@ func (p *pageOutput) setContentProvider(cp *pageContentOutput) {
}
p.contentRenderer = cp
p.ContentProvider = cp
+ p.MarkupProvider = cp
p.PageRenderProvider = cp
p.TableOfContentsProvider = cp
p.RenderShortcodesProvider = cp
diff --git a/hugolib/page__per_output.go b/hugolib/page__per_output.go
index 59cb574df..f074e8db7 100644
--- a/hugolib/page__per_output.go
+++ b/hugolib/page__per_output.go
@@ -21,18 +21,14 @@ import (
"html/template"
"strings"
"sync"
+ "sync/atomic"
+ "github.com/gohugoio/hugo/common/maps"
"github.com/gohugoio/hugo/common/text"
- "github.com/gohugoio/hugo/common/types/hstring"
"github.com/gohugoio/hugo/identity"
- "github.com/gohugoio/hugo/markup"
- "github.com/gohugoio/hugo/media"
- "github.com/gohugoio/hugo/parser/pageparser"
- "github.com/mitchellh/mapstructure"
"github.com/spf13/cast"
"github.com/gohugoio/hugo/markup/converter/hooks"
- "github.com/gohugoio/hugo/markup/goldmark/hugocontext"
"github.com/gohugoio/hugo/markup/highlight/chromalexers"
"github.com/gohugoio/hugo/markup/tableofcontents"
@@ -41,7 +37,6 @@ import (
bp "github.com/gohugoio/hugo/bufferpool"
"github.com/gohugoio/hugo/tpl"
- "github.com/gohugoio/hugo/helpers"
"github.com/gohugoio/hugo/output"
"github.com/gohugoio/hugo/resources/page"
"github.com/gohugoio/hugo/resources/resource"
@@ -73,7 +68,7 @@ func newPageContentOutput(po *pageOutput) (*pageContentOutput, error) {
cp := &pageContentOutput{
po: po,
renderHooks: &renderHooks{},
- otherOutputs: make(map[uint64]*pageContentOutput),
+ otherOutputs: maps.NewCache[uint64, *pageContentOutput](),
}
return cp, nil
}
@@ -89,10 +84,10 @@ type pageContentOutput struct {
// Other pages involved in rendering of this page,
// typically included with .RenderShortcodes.
- otherOutputs map[uint64]*pageContentOutput
+ otherOutputs *maps.Cache[uint64, *pageContentOutput]
- contentRenderedVersion uint32 // Incremented on reset.
- contentRendered bool // Set on content render.
+ contentRenderedVersion uint32 // Incremented on reset.
+ contentRendered atomic.Bool // Set on content render.
// Renders Markdown hooks.
renderHooks *renderHooks
@@ -107,294 +102,10 @@ func (pco *pageContentOutput) Reset() {
return
}
pco.contentRenderedVersion++
- pco.contentRendered = false
+ pco.contentRendered.Store(false)
pco.renderHooks = &renderHooks{}
}
-func (pco *pageContentOutput) Fragments(ctx context.Context) *tableofcontents.Fragments {
- return pco.po.p.m.content.mustContentToC(ctx, pco).tableOfContents
-}
-
-func (pco *pageContentOutput) RenderShortcodes(ctx context.Context) (template.HTML, error) {
- content := pco.po.p.m.content
- source, err := content.pi.contentSource(content)
- if err != nil {
- return "", err
- }
- ct, err := content.contentToC(ctx, pco)
- if err != nil {
- return "", err
- }
-
- var insertPlaceholders bool
- var hasVariants bool
- cb := setGetContentCallbackInContext.Get(ctx)
- if cb != nil {
- insertPlaceholders = true
- }
- c := make([]byte, 0, len(source)+(len(source)/10))
- for _, it := range content.pi.itemsStep2 {
- switch v := it.(type) {
- case pageparser.Item:
- c = append(c, source[v.Pos():v.Pos()+len(v.Val(source))]...)
- case pageContentReplacement:
- // Ignore.
- case *shortcode:
- if !insertPlaceholders || !v.insertPlaceholder() {
- // Insert the rendered shortcode.
- renderedShortcode, found := ct.contentPlaceholders[v.placeholder]
- if !found {
- // This should never happen.
- panic(fmt.Sprintf("rendered shortcode %q not found", v.placeholder))
- }
-
- b, more, err := renderedShortcode.renderShortcode(ctx)
- if err != nil {
- return "", fmt.Errorf("failed to render shortcode: %w", err)
- }
- hasVariants = hasVariants || more
- c = append(c, []byte(b)...)
-
- } else {
- // Insert the placeholder so we can insert the content after
- // markdown processing.
- c = append(c, []byte(v.placeholder)...)
- }
- default:
- panic(fmt.Sprintf("unknown item type %T", it))
- }
- }
-
- if hasVariants {
- pco.po.p.pageOutputTemplateVariationsState.Add(1)
- }
-
- if cb != nil {
- cb(pco, ct)
- }
-
- if tpl.Context.IsInGoldmark.Get(ctx) {
- // This content will be parsed and rendered by Goldmark.
- // Wrap it in a special Hugo markup to assign the correct Page from
- // the stack.
- return template.HTML(hugocontext.Wrap(c, pco.po.p.pid)), nil
- }
-
- return helpers.BytesToHTML(c), nil
-}
-
-func (pco *pageContentOutput) Content(ctx context.Context) (any, error) {
- r, err := pco.po.p.m.content.contentRendered(ctx, pco)
- return r.content, err
-}
-
-func (pco *pageContentOutput) TableOfContents(ctx context.Context) template.HTML {
- return pco.po.p.m.content.mustContentToC(ctx, pco).tableOfContentsHTML
-}
-
-func (p *pageContentOutput) Len(ctx context.Context) int {
- return len(p.mustContentRendered(ctx).content)
-}
-
-func (pco *pageContentOutput) mustContentRendered(ctx context.Context) contentSummary {
- r, err := pco.po.p.m.content.contentRendered(ctx, pco)
- if err != nil {
- pco.fail(err)
- }
- return r
-}
-
-func (pco *pageContentOutput) mustContentPlain(ctx context.Context) contentPlainPlainWords {
- r, err := pco.po.p.m.content.contentPlain(ctx, pco)
- if err != nil {
- pco.fail(err)
- }
- return r
-}
-
-func (pco *pageContentOutput) fail(err error) {
- pco.po.p.s.h.FatalError(pco.po.p.wrapError(err))
-}
-
-func (pco *pageContentOutput) Plain(ctx context.Context) string {
- return pco.mustContentPlain(ctx).plain
-}
-
-func (pco *pageContentOutput) PlainWords(ctx context.Context) []string {
- return pco.mustContentPlain(ctx).plainWords
-}
-
-func (pco *pageContentOutput) ReadingTime(ctx context.Context) int {
- return pco.mustContentPlain(ctx).readingTime
-}
-
-func (pco *pageContentOutput) WordCount(ctx context.Context) int {
- return pco.mustContentPlain(ctx).wordCount
-}
-
-func (pco *pageContentOutput) FuzzyWordCount(ctx context.Context) int {
- return pco.mustContentPlain(ctx).fuzzyWordCount
-}
-
-func (pco *pageContentOutput) Summary(ctx context.Context) template.HTML {
- return pco.mustContentPlain(ctx).summary
-}
-
-func (pco *pageContentOutput) Truncated(ctx context.Context) bool {
- return pco.mustContentPlain(ctx).summaryTruncated
-}
-
-func (pco *pageContentOutput) RenderString(ctx context.Context, args ...any) (template.HTML, error) {
- if len(args) < 1 || len(args) > 2 {
- return "", errors.New("want 1 or 2 arguments")
- }
-
- var contentToRender string
- opts := defaultRenderStringOpts
- sidx := 1
-
- if len(args) == 1 {
- sidx = 0
- } else {
- m, ok := args[0].(map[string]any)
- if !ok {
- return "", errors.New("first argument must be a map")
- }
-
- if err := mapstructure.WeakDecode(m, &opts); err != nil {
- return "", fmt.Errorf("failed to decode options: %w", err)
- }
- if opts.Markup != "" {
- opts.Markup = markup.ResolveMarkup(opts.Markup)
- }
- }
-
- contentToRenderv := args[sidx]
-
- if _, ok := contentToRenderv.(hstring.RenderedString); ok {
- // This content is already rendered, this is potentially
- // a infinite recursion.
- return "", errors.New("text is already rendered, repeating it may cause infinite recursion")
- }
-
- var err error
- contentToRender, err = cast.ToStringE(contentToRenderv)
- if err != nil {
- return "", err
- }
-
- if err = pco.initRenderHooks(); err != nil {
- return "", err
- }
-
- conv := pco.po.p.getContentConverter()
-
- if opts.Markup != "" && opts.Markup != pco.po.p.m.pageConfig.ContentMediaType.SubType {
- var err error
- conv, err = pco.po.p.m.newContentConverter(pco.po.p, opts.Markup)
- if err != nil {
- return "", pco.po.p.wrapError(err)
- }
- }
-
- var rendered []byte
-
- parseInfo := &contentParseInfo{
- h: pco.po.p.s.h,
- pid: pco.po.p.pid,
- }
-
- if pageparser.HasShortcode(contentToRender) {
- contentToRenderb := []byte(contentToRender)
- // String contains a shortcode.
- parseInfo.itemsStep1, err = pageparser.ParseBytes(contentToRenderb, pageparser.Config{
- NoFrontMatter: true,
- NoSummaryDivider: true,
- })
- if err != nil {
- return "", err
- }
-
- s := newShortcodeHandler(pco.po.p.pathOrTitle(), pco.po.p.s)
- if err := parseInfo.mapItemsAfterFrontMatter(contentToRenderb, s); err != nil {
- return "", err
- }
-
- placeholders, err := s.prepareShortcodesForPage(ctx, pco.po.p, pco.po.f, true)
- if err != nil {
- return "", err
- }
-
- contentToRender, hasVariants, err := parseInfo.contentToRender(ctx, contentToRenderb, placeholders)
- if err != nil {
- return "", err
- }
- if hasVariants {
- pco.po.p.pageOutputTemplateVariationsState.Add(1)
- }
- b, err := pco.renderContentWithConverter(ctx, conv, contentToRender, false)
- if err != nil {
- return "", pco.po.p.wrapError(err)
- }
- rendered = b.Bytes()
-
- if parseInfo.hasNonMarkdownShortcode {
- var hasShortcodeVariants bool
-
- tokenHandler := func(ctx context.Context, token string) ([]byte, error) {
- if token == tocShortcodePlaceholder {
- toc, err := pco.po.p.m.content.contentToC(ctx, pco)
- if err != nil {
- return nil, err
- }
- // The Page's TableOfContents was accessed in a shortcode.
- return []byte(toc.tableOfContentsHTML), nil
- }
- renderer, found := placeholders[token]
- if found {
- repl, more, err := renderer.renderShortcode(ctx)
- if err != nil {
- return nil, err
- }
- hasShortcodeVariants = hasShortcodeVariants || more
- return repl, nil
- }
- // This should not happen.
- return nil, fmt.Errorf("unknown shortcode token %q", token)
- }
-
- rendered, err = expandShortcodeTokens(ctx, rendered, tokenHandler)
- if err != nil {
- return "", err
- }
- if hasShortcodeVariants {
- pco.po.p.pageOutputTemplateVariationsState.Add(1)
- }
- }
-
- // We need a consolidated view in $page.HasShortcode
- pco.po.p.m.content.shortcodeState.transferNames(s)
-
- } else {
- c, err := pco.renderContentWithConverter(ctx, conv, []byte(contentToRender), false)
- if err != nil {
- return "", pco.po.p.wrapError(err)
- }
-
- rendered = c.Bytes()
- }
-
- if opts.Display == "inline" {
- markup := pco.po.p.m.pageConfig.Content.Markup
- if opts.Markup != "" {
- markup = pco.po.p.s.ContentSpec.ResolveMarkup(opts.Markup)
- }
- rendered = pco.po.p.s.ContentSpec.TrimShortHTML(rendered, markup)
- }
-
- return template.HTML(string(rendered)), nil
-}
-
func (pco *pageContentOutput) Render(ctx context.Context, layout ...string) (template.HTML, error) {
if len(layout) == 0 {
return "", errors.New("no layout given")
@@ -416,6 +127,105 @@ func (pco *pageContentOutput) Render(ctx context.Context, layout ...string) (tem
return template.HTML(res), nil
}
+func (pco *pageContentOutput) Fragments(ctx context.Context) *tableofcontents.Fragments {
+ return pco.c().Fragments(ctx)
+}
+
+func (pco *pageContentOutput) RenderShortcodes(ctx context.Context) (template.HTML, error) {
+ return pco.c().RenderShortcodes(ctx)
+}
+
+func (pco *pageContentOutput) Markup(opts ...any) page.Markup {
+ if len(opts) > 1 {
+ panic("too many arguments, expected 0 or 1")
+ }
+ var scope string
+ if len(opts) == 1 {
+ scope = cast.ToString(opts[0])
+ }
+ return pco.po.p.m.content.getOrCreateScope(scope, pco)
+}
+
+func (pco *pageContentOutput) c() page.Markup {
+ return pco.po.p.m.content.getOrCreateScope("", pco)
+}
+
+func (pco *pageContentOutput) Content(ctx context.Context) (any, error) {
+ r, err := pco.c().Render(ctx)
+ if err != nil {
+ return nil, err
+ }
+ return r.Content(ctx)
+}
+
+func (pco *pageContentOutput) ContentWithoutSummary(ctx context.Context) (template.HTML, error) {
+ r, err := pco.c().Render(ctx)
+ if err != nil {
+ return "", err
+ }
+ return r.ContentWithoutSummary(ctx)
+}
+
+func (pco *pageContentOutput) TableOfContents(ctx context.Context) template.HTML {
+ return pco.c().(*cachedContentScope).fragmentsHTML(ctx)
+}
+
+func (pco *pageContentOutput) Len(ctx context.Context) int {
+ return pco.mustRender(ctx).Len(ctx)
+}
+
+func (pco *pageContentOutput) mustRender(ctx context.Context) page.Content {
+ c, err := pco.c().Render(ctx)
+ if err != nil {
+ pco.fail(err)
+ }
+ return c
+}
+
+func (pco *pageContentOutput) fail(err error) {
+ pco.po.p.s.h.FatalError(pco.po.p.wrapError(err))
+}
+
+func (pco *pageContentOutput) Plain(ctx context.Context) string {
+ return pco.mustRender(ctx).Plain(ctx)
+}
+
+func (pco *pageContentOutput) PlainWords(ctx context.Context) []string {
+ return pco.mustRender(ctx).PlainWords(ctx)
+}
+
+func (pco *pageContentOutput) ReadingTime(ctx context.Context) int {
+ return pco.mustRender(ctx).ReadingTime(ctx)
+}
+
+func (pco *pageContentOutput) WordCount(ctx context.Context) int {
+ return pco.mustRender(ctx).WordCount(ctx)
+}
+
+func (pco *pageContentOutput) FuzzyWordCount(ctx context.Context) int {
+ return pco.mustRender(ctx).FuzzyWordCount(ctx)
+}
+
+func (pco *pageContentOutput) Summary(ctx context.Context) template.HTML {
+ summary, err := pco.mustRender(ctx).Summary(ctx)
+ if err != nil {
+ pco.fail(err)
+ }
+ return summary.Text
+}
+
+func (pco *pageContentOutput) Truncated(ctx context.Context) bool {
+ summary, err := pco.mustRender(ctx).Summary(ctx)
+ if err != nil {
+ pco.fail(err)
+ }
+ return summary.Truncated
+}
+
+func (pco *pageContentOutput) RenderString(ctx context.Context, args ...any) (template.HTML, error) {
+ return pco.c().RenderString(ctx, args...)
+}
+
func (pco *pageContentOutput) initRenderHooks() error {
if pco == nil {
return nil
@@ -660,65 +470,3 @@ func executeToString(ctx context.Context, h tpl.TemplateHandler, templ tpl.Templ
}
return b.String(), nil
}
-
-func splitUserDefinedSummaryAndContent(markup string, c []byte) (summary []byte, content []byte, err error) {
- defer func() {
- if r := recover(); r != nil {
- err = fmt.Errorf("summary split failed: %s", r)
- }
- }()
-
- startDivider := bytes.Index(c, internalSummaryDividerBaseBytes)
-
- if startDivider == -1 {
- return
- }
-
- startTag := "p"
- switch markup {
- case media.DefaultContentTypes.AsciiDoc.SubType:
- startTag = "div"
- }
-
- // Walk back and forward to the surrounding tags.
- start := bytes.LastIndex(c[:startDivider], []byte("<"+startTag))
- end := bytes.Index(c[startDivider:], []byte(""+startTag))
-
- if start == -1 {
- start = startDivider
- } else {
- start = startDivider - (startDivider - start)
- }
-
- if end == -1 {
- end = startDivider + len(internalSummaryDividerBase)
- } else {
- end = startDivider + end + len(startTag) + 3
- }
-
- var addDiv bool
-
- switch markup {
- case "rst":
- addDiv = true
- }
-
- withoutDivider := append(c[:start], bytes.Trim(c[end:], "\n")...)
-
- if len(withoutDivider) > 0 {
- summary = bytes.TrimSpace(withoutDivider[:start])
- }
-
- if addDiv {
- // For the rst
- summary = append(append([]byte(nil), summary...), []byte("")...)
- }
-
- if err != nil {
- return
- }
-
- content = bytes.TrimSpace(withoutDivider)
-
- return
-}
diff --git a/hugolib/page_test.go b/hugolib/page_test.go
index a1eb43430..47f7c59c9 100644
--- a/hugolib/page_test.go
+++ b/hugolib/page_test.go
@@ -63,15 +63,6 @@ Summary Next Line
Some more text
-`
-
- simplePageWithBlankSummary = `---
-title: SimpleWithBlankSummary
----
-
-
-
-Some text.
`
simplePageWithSummaryParameter = `---
@@ -322,7 +313,8 @@ func checkPageTOC(t *testing.T, page page.Page, toc string) {
}
func checkPageSummary(t *testing.T, page page.Page, summary string, msg ...any) {
- a := normalizeContent(string(page.Summary(context.Background())))
+ s := string(page.Summary(context.Background()))
+ a := normalizeContent(s)
b := normalizeContent(summary)
if a != b {
t.Fatalf("Page summary is:\n%q.\nExpected\n%q (%q)", a, b, msg)
@@ -593,26 +585,6 @@ date: 2012-01-12
b.Assert(s.Site().Lastmod().Year(), qt.Equals, 2018)
}
-func TestCreateNewPage(t *testing.T) {
- t.Parallel()
- c := qt.New(t)
- assertFunc := func(t *testing.T, ext string, pages page.Pages) {
- p := pages[0]
-
- // issue #2290: Path is relative to the content dir and will continue to be so.
- c.Assert(p.File().Path(), qt.Equals, fmt.Sprintf("p0.%s", ext))
- c.Assert(p.IsHome(), qt.Equals, false)
- checkPageTitle(t, p, "Simple")
- checkPageContent(t, p, normalizeExpected(ext, "Simple Page
\n"))
- checkPageSummary(t, p, "Simple Page")
- checkPageType(t, p, "page")
- }
-
- settings := map[string]any{}
-
- testAllMarkdownEnginesForPages(t, assertFunc, settings, simplePage)
-}
-
func TestPageSummary(t *testing.T) {
t.Parallel()
assertFunc := func(t *testing.T, ext string, pages page.Pages) {
@@ -621,7 +593,7 @@ func TestPageSummary(t *testing.T) {
// Source is not Asciidoctor- or RST-compatible so don't test them
if ext != "ad" && ext != "rst" {
checkPageContent(t, p, normalizeExpected(ext, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
\n\nAdditional text.
\n\nFurther text.
\n"), ext)
- checkPageSummary(t, p, normalizeExpected(ext, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Additional text."), ext)
+ checkPageSummary(t, p, normalizeExpected(ext, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
"), ext)
}
checkPageType(t, p, "page")
}
@@ -642,19 +614,6 @@ func TestPageWithDelimiter(t *testing.T) {
testAllMarkdownEnginesForPages(t, assertFunc, nil, simplePageWithSummaryDelimiter)
}
-func TestPageWithBlankSummary(t *testing.T) {
- t.Parallel()
- assertFunc := func(t *testing.T, ext string, pages page.Pages) {
- p := pages[0]
- checkPageTitle(t, p, "SimpleWithBlankSummary")
- checkPageContent(t, p, normalizeExpected(ext, "Some text.
\n"), ext)
- checkPageSummary(t, p, normalizeExpected(ext, ""), ext)
- checkPageType(t, p, "page")
- }
-
- testAllMarkdownEnginesForPages(t, assertFunc, nil, simplePageWithBlankSummary)
-}
-
func TestPageWithSummaryParameter(t *testing.T) {
t.Parallel()
assertFunc := func(t *testing.T, ext string, pages page.Pages) {
@@ -729,19 +688,6 @@ title: "empty"
b.AssertFileContent("public/empty/index.html", "! title")
}
-func TestPageWithShortCodeInSummary(t *testing.T) {
- t.Parallel()
- assertFunc := func(t *testing.T, ext string, pages page.Pages) {
- p := pages[0]
- checkPageTitle(t, p, "Simple")
- checkPageContent(t, p, normalizeExpected(ext, "Summary Next Line. . More text here.
Some more text
"))
- checkPageSummary(t, p, "Summary Next Line. . More text here. Some more text")
- checkPageType(t, p, "page")
- }
-
- testAllMarkdownEnginesForPages(t, assertFunc, nil, simplePageWithShortcodeInSummary)
-}
-
func TestTableOfContents(t *testing.T) {
c := qt.New(t)
cfg, fs := newTestCfg()
@@ -853,7 +799,7 @@ Summary: {{ .Summary }}|Truncated: {{ .Truncated }}|
Content: {{ .Content }}|
`).AssertFileContent("public/simple/index.html",
- "Summary: This is summary. This is more summary. This is even more summary*.|",
+ "Summary: This is summary .\nThis is more summary .\nThis is even more summary *.\nThis is more summary .
|",
"Truncated: true|",
"Content: This is summary .")
}
@@ -1242,11 +1188,6 @@ func TestWordCountWithMainEnglishWithCJKRunes(t *testing.T) {
if p.WordCount(context.Background()) != 74 {
t.Fatalf("[%s] incorrect word count, expected %v, got %v", ext, 74, p.WordCount(context.Background()))
}
-
- if p.Summary(context.Background()) != simplePageWithMainEnglishWithCJKRunesSummary {
- t.Fatalf("[%s] incorrect Summary for content '%s'. expected\n%v, got\n%v", ext, p.Plain(context.Background()),
- simplePageWithMainEnglishWithCJKRunesSummary, p.Summary(context.Background()))
- }
}
testAllMarkdownEnginesForPages(t, assertFunc, settings, simplePageWithMainEnglishWithCJKRunes)
@@ -1263,11 +1204,6 @@ func TestWordCountWithIsCJKLanguageFalse(t *testing.T) {
if p.WordCount(context.Background()) != 75 {
t.Fatalf("[%s] incorrect word count for content '%s'. expected %v, got %v", ext, p.Plain(context.Background()), 74, p.WordCount(context.Background()))
}
-
- if p.Summary(context.Background()) != simplePageWithIsCJKLanguageFalseSummary {
- t.Fatalf("[%s] incorrect Summary for content '%s'. expected %v, got %v", ext, p.Plain(context.Background()),
- simplePageWithIsCJKLanguageFalseSummary, p.Summary(context.Background()))
- }
}
testAllMarkdownEnginesForPages(t, assertFunc, settings, simplePageWithIsCJKLanguageFalse)
@@ -1485,42 +1421,6 @@ func TestChompBOM(t *testing.T) {
checkPageTitle(t, p, "Simple")
}
-func TestPageHTMLContent(t *testing.T) {
- b := newTestSitesBuilder(t)
- b.WithSimpleConfigFile()
-
- frontmatter := `---
-title: "HTML Content"
----
-`
- b.WithContent("regular.html", frontmatter+`
Hugo `)
- b.WithContent("nomarkdownforyou.html", frontmatter+`**Hugo!**`)
- b.WithContent("manualsummary.html", frontmatter+`
-This is summary
-
-This is the main content.
`)
-
- b.Build(BuildCfg{})
-
- b.AssertFileContent(
- "public/regular/index.html",
- "Single: HTML Content|Hello|en|RelPermalink: /regular/|",
- "Summary: Hugo|Truncated: false")
-
- b.AssertFileContent(
- "public/nomarkdownforyou/index.html",
- "Permalink: http://example.com/nomarkdownforyou/|**Hugo!**|",
- )
-
- // https://github.com/gohugoio/hugo/issues/5723
- b.AssertFileContent(
- "public/manualsummary/index.html",
- "Single: HTML Content|Hello|en|RelPermalink: /manualsummary/|",
- "Summary: \nThis is summary
\n|Truncated: true",
- "|This is the main content.
|",
- )
-}
-
// https://github.com/gohugoio/hugo/issues/5381
func TestPageManualSummary(t *testing.T) {
b := newTestSitesBuilder(t)
@@ -1761,102 +1661,6 @@ Single: {{ .Title}}|{{ .RelPermalink }}|{{ .Path }}|
b.AssertFileContent("public/sect3/Pag.E4/index.html", "Single: Pag.E4|/sect3/Pag.E4/|/sect3/p4|")
}
-// https://github.com/gohugoio/hugo/issues/4675
-func TestWordCountAndSimilarVsSummary(t *testing.T) {
- t.Parallel()
- c := qt.New(t)
-
- single := []string{"_default/single.html", `
-WordCount: {{ .WordCount }}
-FuzzyWordCount: {{ .FuzzyWordCount }}
-ReadingTime: {{ .ReadingTime }}
-Len Plain: {{ len .Plain }}
-Len PlainWords: {{ len .PlainWords }}
-Truncated: {{ .Truncated }}
-Len Summary: {{ len .Summary }}
-Len Content: {{ len .Content }}
-
-SUMMARY:{{ .Summary }}:{{ len .Summary }}:END
-
-`}
-
- b := newTestSitesBuilder(t)
- b.WithSimpleConfigFile().WithTemplatesAdded(single...).WithContent("p1.md", fmt.Sprintf(`---
-title: p1
----
-
-%s
-
-`, strings.Repeat("word ", 510)),
-
- "p2.md", fmt.Sprintf(`---
-title: p2
----
-This is a summary.
-
-
-
-%s
-
-`, strings.Repeat("word ", 310)),
- "p3.md", fmt.Sprintf(`---
-title: p3
-isCJKLanguage: true
----
-Summary: In Chinese, 好 means good.
-
-
-
-%s
-
-`, strings.Repeat("好", 200)),
- "p4.md", fmt.Sprintf(`---
-title: p4
-isCJKLanguage: false
----
-Summary: In Chinese, 好 means good.
-
-
-
-%s
-
-`, strings.Repeat("好", 200)),
-
- "p5.md", fmt.Sprintf(`---
-title: p4
-isCJKLanguage: true
----
-Summary: In Chinese, 好 means good.
-
-%s
-
-`, strings.Repeat("好", 200)),
- "p6.md", fmt.Sprintf(`---
-title: p4
-isCJKLanguage: false
----
-Summary: In Chinese, 好 means good.
-
-%s
-
-`, strings.Repeat("好", 200)),
- )
-
- b.CreateSites().Build(BuildCfg{})
-
- c.Assert(len(b.H.Sites), qt.Equals, 1)
- c.Assert(len(b.H.Sites[0].RegularPages()), qt.Equals, 6)
-
- b.AssertFileContent("public/p1/index.html", "WordCount: 510\nFuzzyWordCount: 600\nReadingTime: 3\nLen Plain: 2550\nLen PlainWords: 510\nTruncated: false\nLen Summary: 2549\nLen Content: 2557")
-
- b.AssertFileContent("public/p2/index.html", "WordCount: 314\nFuzzyWordCount: 400\nReadingTime: 2\nLen Plain: 1569\nLen PlainWords: 314\nTruncated: true\nLen Summary: 25\nLen Content: 1582")
-
- b.AssertFileContent("public/p3/index.html", "WordCount: 206\nFuzzyWordCount: 300\nReadingTime: 1\nLen Plain: 638\nLen PlainWords: 7\nTruncated: true\nLen Summary: 43\nLen Content: 651")
- b.AssertFileContent("public/p4/index.html", "WordCount: 7\nFuzzyWordCount: 100\nReadingTime: 1\nLen Plain: 638\nLen PlainWords: 7\nTruncated: true\nLen Summary: 43\nLen Content: 651")
- b.AssertFileContent("public/p5/index.html", "WordCount: 206\nFuzzyWordCount: 300\nReadingTime: 1\nLen Plain: 638\nLen PlainWords: 7\nTruncated: true\nLen Summary: 229\nLen Content: 652")
- b.AssertFileContent("public/p6/index.html", "WordCount: 7\nFuzzyWordCount: 100\nReadingTime: 1\nLen Plain: 638\nLen PlainWords: 7\nTruncated: false\nLen Summary: 637\nLen Content: 652")
-}
-
func TestScratch(t *testing.T) {
t.Parallel()
diff --git a/hugolib/shortcode_page.go b/hugolib/shortcode_page.go
index 7c32f2ea1..8030b0285 100644
--- a/hugolib/shortcode_page.go
+++ b/hugolib/shortcode_page.go
@@ -65,6 +65,7 @@ var zeroShortcode = prerenderedShortcode{}
type pageForShortcode struct {
page.PageWithoutContent
page.TableOfContentsProvider
+ page.MarkupProvider
page.ContentProvider
// We need to replace it after we have rendered it, so provide a
@@ -80,6 +81,7 @@ func newPageForShortcode(p *pageState) page.Page {
return &pageForShortcode{
PageWithoutContent: p,
TableOfContentsProvider: p,
+ MarkupProvider: page.NopPage,
ContentProvider: page.NopPage,
toc: template.HTML(tocShortcodePlaceholder),
p: p,
@@ -105,6 +107,7 @@ var _ types.Unwrapper = (*pageForRenderHooks)(nil)
type pageForRenderHooks struct {
page.PageWithoutContent
page.TableOfContentsProvider
+ page.MarkupProvider
page.ContentProvider
p *pageState
}
@@ -112,6 +115,7 @@ type pageForRenderHooks struct {
func newPageForRenderHook(p *pageState) page.Page {
return &pageForRenderHooks{
PageWithoutContent: p,
+ MarkupProvider: page.NopPage,
ContentProvider: page.NopPage,
TableOfContentsProvider: p,
p: p,
diff --git a/hugolib/shortcode_test.go b/hugolib/shortcode_test.go
index a1c5c0aea..21436d980 100644
--- a/hugolib/shortcode_test.go
+++ b/hugolib/shortcode_test.go
@@ -756,12 +756,15 @@ title: "Hugo Rocks!"
func TestShortcodeParams(t *testing.T) {
t.Parallel()
- c := qt.New(t)
- builder := newTestSitesBuilder(t).WithSimpleConfigFile()
-
- builder.WithContent("page.md", `---
+ files := `
+-- hugo.toml --
+baseURL = "https://example.org"
+-- layouts/shortcodes/hello.html --
+{{ range $i, $v := .Params }}{{ printf "- %v: %v (%T) " $i $v $v -}}{{ end }}
+-- content/page.md --
title: "Hugo Rocks!"
+summary: "Foo"
---
# doc
@@ -770,23 +773,15 @@ types positional: {{< hello true false 33 3.14 >}}
types named: {{< hello b1=true b2=false i1=33 f1=3.14 >}}
types string: {{< hello "true" trues "33" "3.14" >}}
escaped quoute: {{< hello "hello \"world\"." >}}
+-- layouts/_default/single.html --
+Content: {{ .Content }}|
+`
+ b := Test(t, files)
-`).WithTemplatesAdded(
- "layouts/shortcodes/hello.html",
- `{{ range $i, $v := .Params }}
-- {{ printf "%v: %v (%T)" $i $v $v }}
-{{ end }}
-{{ $b1 := .Get "b1" }}
-Get: {{ printf "%v (%T)" $b1 $b1 | safeHTML }}
-`).Build(BuildCfg{})
-
- s := builder.H.Sites[0]
- c.Assert(len(s.RegularPages()), qt.Equals, 1)
-
- builder.AssertFileContent("public/page/index.html",
+ b.AssertFileContent("public/page/index.html",
"types positional: - 0: true (bool) - 1: false (bool) - 2: 33 (int) - 3: 3.14 (float64)",
- "types named: - b1: true (bool) - b2: false (bool) - f1: 3.14 (float64) - i1: 33 (int) Get: true (bool) ",
+ "types named: - b1: true (bool) - b2: false (bool) - f1: 3.14 (float64) - i1: 33 (int)",
"types string: - 0: true (string) - 1: trues (string) - 2: 33 (string) - 3: 3.14 (string) ",
"hello "world". (string)",
)
diff --git a/resources/page/page.go b/resources/page/page.go
index 9647a916b..4cda8d31f 100644
--- a/resources/page/page.go
+++ b/resources/page/page.go
@@ -74,10 +74,17 @@ type ChildCareProvider interface {
Resources() resource.Resources
}
+type MarkupProvider interface {
+ Markup(opts ...any) Markup
+}
+
// ContentProvider provides the content related values for a Page.
type ContentProvider interface {
Content(context.Context) (any, error)
+ // ContentWithoutSummary returns the Page Content stripped of the summary.
+ ContentWithoutSummary(ctx context.Context) (template.HTML, error)
+
// Plain returns the Page Content stripped of HTML markup.
Plain(context.Context) string
@@ -169,6 +176,7 @@ type PageProvider interface {
// Page is the core interface in Hugo and what you get as the top level data context in your templates.
type Page interface {
+ MarkupProvider
ContentProvider
TableOfContentsProvider
PageWithoutContent
@@ -260,7 +268,7 @@ type PageMetaInternalProvider interface {
type PageRenderProvider interface {
// Render renders the given layout with this Page as context.
Render(ctx context.Context, layout ...string) (template.HTML, error)
- // RenderString renders the first value in args with tPaginatorhe content renderer defined
+ // RenderString renders the first value in args with the content renderer defined
// for this Page.
// It takes an optional map as a second argument:
//
diff --git a/resources/page/page_lazy_contentprovider.go b/resources/page/page_lazy_contentprovider.go
index 665b2d003..8e66a03e4 100644
--- a/resources/page/page_lazy_contentprovider.go
+++ b/resources/page/page_lazy_contentprovider.go
@@ -35,6 +35,7 @@ type OutputFormatContentProvider interface {
// OutputFormatPageContentProvider holds the exported methods from Page that are "outputFormat aware".
type OutputFormatPageContentProvider interface {
+ MarkupProvider
ContentProvider
TableOfContentsProvider
PageRenderProvider
@@ -74,6 +75,11 @@ func (lcp *LazyContentProvider) Reset() {
lcp.init.Reset()
}
+func (lcp *LazyContentProvider) Markup(opts ...any) Markup {
+ lcp.init.Do(context.Background())
+ return lcp.cp.Markup(opts...)
+}
+
func (lcp *LazyContentProvider) TableOfContents(ctx context.Context) template.HTML {
lcp.init.Do(ctx)
return lcp.cp.TableOfContents(ctx)
@@ -89,6 +95,11 @@ func (lcp *LazyContentProvider) Content(ctx context.Context) (any, error) {
return lcp.cp.Content(ctx)
}
+func (lcp *LazyContentProvider) ContentWithoutSummary(ctx context.Context) (template.HTML, error) {
+ lcp.init.Do(ctx)
+ return lcp.cp.ContentWithoutSummary(ctx)
+}
+
func (lcp *LazyContentProvider) Plain(ctx context.Context) string {
lcp.init.Do(ctx)
return lcp.cp.Plain(ctx)
diff --git a/resources/page/page_markup.go b/resources/page/page_markup.go
new file mode 100644
index 000000000..ef4a56e3a
--- /dev/null
+++ b/resources/page/page_markup.go
@@ -0,0 +1,344 @@
+// Copyright 2024 The Hugo Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package page
+
+import (
+ "context"
+ "html/template"
+ "regexp"
+ "strings"
+ "unicode"
+ "unicode/utf8"
+
+ "github.com/gohugoio/hugo/common/types"
+ "github.com/gohugoio/hugo/markup/tableofcontents"
+ "github.com/gohugoio/hugo/media"
+ "github.com/gohugoio/hugo/tpl"
+)
+
+type Content interface {
+ Content(context.Context) (template.HTML, error)
+ ContentWithoutSummary(context.Context) (template.HTML, error)
+ Summary(context.Context) (Summary, error)
+ Plain(context.Context) string
+ PlainWords(context.Context) []string
+ WordCount(context.Context) int
+ FuzzyWordCount(context.Context) int
+ ReadingTime(context.Context) int
+ Len(context.Context) int
+}
+
+type Markup interface {
+ Render(context.Context) (Content, error)
+ RenderString(ctx context.Context, args ...any) (template.HTML, error)
+ RenderShortcodes(context.Context) (template.HTML, error)
+ Fragments(context.Context) *tableofcontents.Fragments
+}
+
+var _ types.PrintableValueProvider = Summary{}
+
+const (
+ SummaryTypeAuto = "auto"
+ SummaryTypeManual = "manual"
+ SummaryTypeFrontMatter = "frontmatter"
+)
+
+type Summary struct {
+ Text template.HTML
+ Type string // "auto", "manual" or "frontmatter"
+ Truncated bool
+}
+
+func (s Summary) IsZero() bool {
+ return s.Text == ""
+}
+
+func (s Summary) PrintableValue() any {
+ return s.Text
+}
+
+var _ types.PrintableValueProvider = (*Summary)(nil)
+
+type HtmlSummary struct {
+ source string
+ SummaryLowHigh types.LowHigh[string]
+ SummaryEndTag types.LowHigh[string]
+ WrapperStart types.LowHigh[string]
+ WrapperEnd types.LowHigh[string]
+ Divider types.LowHigh[string]
+}
+
+func (s HtmlSummary) wrap(ss string) string {
+ if s.WrapperStart.IsZero() {
+ return ss
+ }
+ return s.source[s.WrapperStart.Low:s.WrapperStart.High] + ss + s.source[s.WrapperEnd.Low:s.WrapperEnd.High]
+}
+
+func (s HtmlSummary) wrapLeft(ss string) string {
+ if s.WrapperStart.IsZero() {
+ return ss
+ }
+
+ return s.source[s.WrapperStart.Low:s.WrapperStart.High] + ss
+}
+
+func (s HtmlSummary) Value(l types.LowHigh[string]) string {
+ return s.source[l.Low:l.High]
+}
+
+func (s HtmlSummary) trimSpace(ss string) string {
+ return strings.TrimSpace(ss)
+}
+
+func (s HtmlSummary) Content() string {
+ if s.Divider.IsZero() {
+ return s.source
+ }
+ ss := s.source[:s.Divider.Low]
+ ss += s.source[s.Divider.High:]
+ return s.trimSpace(ss)
+}
+
+func (s HtmlSummary) Summary() string {
+ if s.Divider.IsZero() {
+ return s.trimSpace(s.wrap(s.Value(s.SummaryLowHigh)))
+ }
+ ss := s.source[s.SummaryLowHigh.Low:s.Divider.Low]
+ if s.SummaryLowHigh.High > s.Divider.High {
+ ss += s.source[s.Divider.High:s.SummaryLowHigh.High]
+ }
+ if !s.SummaryEndTag.IsZero() {
+ ss += s.Value(s.SummaryEndTag)
+ }
+ return s.trimSpace(s.wrap(ss))
+}
+
+func (s HtmlSummary) ContentWithoutSummary() string {
+ if s.Divider.IsZero() {
+ if s.SummaryLowHigh.Low == s.WrapperStart.High && s.SummaryLowHigh.High == s.WrapperEnd.Low {
+ return ""
+ }
+ return s.trimSpace(s.wrapLeft(s.source[s.SummaryLowHigh.High:]))
+ }
+ if s.SummaryEndTag.IsZero() {
+ return s.trimSpace(s.wrapLeft(s.source[s.Divider.High:]))
+ }
+ return s.trimSpace(s.wrapLeft(s.source[s.SummaryEndTag.High:]))
+}
+
+func (s HtmlSummary) Truncated() bool {
+ return s.SummaryLowHigh.High < len(s.source)
+}
+
+func (s *HtmlSummary) resolveParagraphTagAndSetWrapper(mt media.Type) tagReStartEnd {
+ ptag := startEndP
+
+ switch mt.SubType {
+ case media.DefaultContentTypes.AsciiDoc.SubType:
+ ptag = startEndDiv
+ case media.DefaultContentTypes.ReStructuredText.SubType:
+ const markerStart = ""
+ const markerEnd = "
"
+ i1 := strings.Index(s.source, markerStart)
+ i2 := strings.LastIndex(s.source, markerEnd)
+ if i1 > -1 && i2 > -1 {
+ s.WrapperStart = types.LowHigh[string]{Low: 0, High: i1 + len(markerStart)}
+ s.WrapperEnd = types.LowHigh[string]{Low: i2, High: len(s.source)}
+ }
+ }
+ return ptag
+}
+
+// ExtractSummaryFromHTML extracts a summary from the given HTML content.
+func ExtractSummaryFromHTML(mt media.Type, input string, numWords int, isCJK bool) (result HtmlSummary) {
+ result.source = input
+ ptag := result.resolveParagraphTagAndSetWrapper(mt)
+
+ if numWords <= 0 {
+ return result
+ }
+
+ var count int
+
+ countWord := func(word string) int {
+ if isCJK {
+ word = tpl.StripHTML(word)
+ runeCount := utf8.RuneCountInString(word)
+ if len(word) == runeCount {
+ return 1
+ } else {
+ return runeCount
+ }
+ }
+
+ return 1
+ }
+
+ high := len(input)
+ if result.WrapperEnd.Low > 0 {
+ high = result.WrapperEnd.Low
+ }
+
+ for j := result.WrapperStart.High; j < high; {
+ s := input[j:]
+ closingIndex := strings.Index(s, ""+ptag.tagName)
+
+ if closingIndex == -1 {
+ break
+ }
+
+ s = s[:closingIndex]
+
+ // Count the words in the current paragraph.
+ var wi int
+
+ for i, r := range s {
+ if unicode.IsSpace(r) || (i+utf8.RuneLen(r) == len(s)) {
+ word := s[wi:i]
+ count += countWord(word)
+ wi = i
+ if count >= numWords {
+ break
+ }
+ }
+ }
+
+ if count >= numWords {
+ result.SummaryLowHigh = types.LowHigh[string]{
+ Low: result.WrapperStart.High,
+ High: j + closingIndex + len(ptag.tagName) + 3,
+ }
+ return
+ }
+
+ j += closingIndex + len(ptag.tagName) + 2
+
+ }
+
+ result.SummaryLowHigh = types.LowHigh[string]{
+ Low: result.WrapperStart.High,
+ High: high,
+ }
+
+ return
+}
+
+// ExtractSummaryFromHTMLWithDivider extracts a summary from the given HTML content with
+// a manual summary divider.
+func ExtractSummaryFromHTMLWithDivider(mt media.Type, input, divider string) (result HtmlSummary) {
+ result.source = input
+ result.Divider.Low = strings.Index(input, divider)
+ result.Divider.High = result.Divider.Low + len(divider)
+
+ if result.Divider.Low == -1 {
+ // No summary.
+ return
+ }
+
+ ptag := result.resolveParagraphTagAndSetWrapper(mt)
+
+ if !mt.IsHTML() {
+ result.Divider, result.SummaryEndTag = expandSummaryDivider(result.source, ptag, result.Divider)
+ }
+
+ result.SummaryLowHigh = types.LowHigh[string]{
+ Low: result.WrapperStart.High,
+ High: result.Divider.Low,
+ }
+
+ return
+}
+
+var (
+ pOrDiv = regexp.MustCompile(`]?>|
]?>$`)
+
+ startEndDiv = tagReStartEnd{
+ startEndOfString: regexp.MustCompile(`
]*?>$`),
+ endEndOfString: regexp.MustCompile(`
$`),
+ tagName: "div",
+ }
+
+ startEndP = tagReStartEnd{
+ startEndOfString: regexp.MustCompile(`
]*?>$`),
+ endEndOfString: regexp.MustCompile(`
$`),
+ tagName: "p",
+ }
+)
+
+type tagReStartEnd struct {
+ startEndOfString *regexp.Regexp
+ endEndOfString *regexp.Regexp
+ tagName string
+}
+
+func expandSummaryDivider(s string, re tagReStartEnd, divider types.LowHigh[string]) (types.LowHigh[string], types.LowHigh[string]) {
+ var endMarkup types.LowHigh[string]
+
+ if divider.IsZero() {
+ return divider, endMarkup
+ }
+
+ lo, hi := divider.Low, divider.High
+
+ var preserveEndMarkup bool
+
+ // Find the start of the paragraph.
+
+ for i := lo - 1; i >= 0; i-- {
+ if s[i] == '>' {
+ if match := re.startEndOfString.FindString(s[:i+1]); match != "" {
+ lo = i - len(match) + 1
+ break
+ }
+ if match := pOrDiv.FindString(s[:i+1]); match != "" {
+ i -= len(match) - 1
+ continue
+ }
+ }
+
+ r, _ := utf8.DecodeRuneInString(s[i:])
+ if !unicode.IsSpace(r) {
+ preserveEndMarkup = true
+ break
+ }
+ }
+
+ divider.Low = lo
+
+ // Now walk forward to the end of the paragraph.
+ for ; hi < len(s); hi++ {
+ if s[hi] != '>' {
+ continue
+ }
+ if match := re.endEndOfString.FindString(s[:hi+1]); match != "" {
+ hi++
+ break
+ }
+ }
+
+ if preserveEndMarkup {
+ endMarkup.Low = divider.High
+ endMarkup.High = hi
+ } else {
+ divider.High = hi
+ }
+
+ // Consume trailing newline if any.
+ if divider.High < len(s) && s[divider.High] == '\n' {
+ divider.High++
+ }
+
+ return divider, endMarkup
+}
diff --git a/resources/page/page_markup_integration_test.go b/resources/page/page_markup_integration_test.go
new file mode 100644
index 000000000..fc3c6a569
--- /dev/null
+++ b/resources/page/page_markup_integration_test.go
@@ -0,0 +1,337 @@
+// Copyright 2024 The Hugo Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package page_test
+
+import (
+ "testing"
+
+ "github.com/gohugoio/hugo/hugolib"
+ "github.com/gohugoio/hugo/markup/asciidocext"
+ "github.com/gohugoio/hugo/markup/rst"
+)
+
+func TestPageMarkupMethods(t *testing.T) {
+ t.Parallel()
+
+ files := `
+-- hugo.toml --
+summaryLength=2
+-- content/p1.md --
+---
+title: "Post 1"
+date: "2020-01-01"
+---
+{{% foo %}}
+-- layouts/shortcodes/foo.html --
+Two *words*.
+{{/* Test that markup scope is set in all relevant constructs. */}}
+{{ if eq hugo.Context.MarkupScope "foo" }}
+
+## Heading 1
+Sint ad mollit qui Lorem ut occaecat culpa officia. Et consectetur aute voluptate non sit ullamco adipisicing occaecat. Sunt deserunt amet sit ad. Deserunt enim voluptate proident ipsum dolore dolor ut sit velit esse est mollit irure esse. Mollit incididunt veniam laboris magna et excepteur sit duis. Magna adipisicing reprehenderit tempor irure.
+### Heading 2
+Exercitation quis est consectetur occaecat nostrud. Ullamco aute mollit aliqua est amet. Exercitation ullamco consectetur dolor labore et non irure eu cillum Lorem.
+{{ end }}
+-- layouts/index.html --
+Home.
+{{ .Content }}
+-- layouts/_default/single.html --
+Single.
+Page.ContentWithoutSummmary: {{ .ContentWithoutSummary }}|
+{{ template "render-scope" (dict "page" . "scope" "main") }}
+{{ template "render-scope" (dict "page" . "scope" "foo") }}
+{{ define "render-scope" }}
+{{ $c := .page.Markup .scope }}
+{{ with $c.Render }}
+{{ $.scope }}: Content: {{ .Content }}|
+ {{ $.scope }}: ContentWithoutSummary: {{ .ContentWithoutSummary }}|
+{{ $.scope }}: Plain: {{ .Plain }}|
+{{ $.scope }}: PlainWords: {{ .PlainWords }}|
+{{ $.scope }}: WordCount: {{ .WordCount }}|
+{{ $.scope }}: FuzzyWordCount: {{ .FuzzyWordCount }}|
+{{ $.scope }}: ReadingTime: {{ .ReadingTime }}|
+{{ $.scope }}: Len: {{ .Len }}|
+{{ $.scope }}: Summary: {{ with .Summary }}{{ . }}{{ else }}nil{{ end }}|
+{{ end }}
+{{ $.scope }}: Fragments: {{ $c.Fragments.Identifiers }}|
+{{ end }}
+
+
+
+`
+
+ b := hugolib.Test(t, files)
+
+ // Main scope.
+ b.AssertFileContent("public/p1/index.html",
+ "Page.ContentWithoutSummmary: |",
+ "main: Content:
Two words .
\n|",
+ "main: ContentWithoutSummary: |",
+ "main: Plain: Two words.\n|",
+ "PlainWords: [Two words.]|\nmain: WordCount: 2|\nmain: FuzzyWordCount: 100|\nmain: ReadingTime: 1|",
+ "main: Summary:
Two words .
|\n\nmain: Fragments: []|",
+ "main: Len: 27|",
+ )
+
+ // Foo scope (has more content).
+ b.AssertFileContent("public/p1/index.html",
+ "foo: Content:
Two words .
\n
Two words .|",
+ "foo: Fragments: [heading-1 heading-2]|",
+ )
+}
+
+func TestPageMarkupScope(t *testing.T) {
+ t.Parallel()
+
+ files := `
+-- hugo.toml --
+disableKinds = ["taxonomy", "term", "rss", "section"]
+-- content/p1.md --
+---
+title: "Post 1"
+date: "2020-01-01"
+---
+
+# P1
+
+{{< foo >}}
+
+Begin:{{% includerendershortcodes "p2" %}}:End
+Begin:{{< includecontent "p3" >}}:End
+
+-- content/p2.md --
+---
+title: "Post 2"
+date: "2020-01-02"
+---
+
+# P2
+-- content/p3.md --
+---
+title: "Post 3"
+date: "2020-01-03"
+---
+
+# P3
+
+{{< foo >}}
+
+-- layouts/index.html --
+Home.
+{{ with site.GetPage "p1" }}
+ {{ with .Markup "home" }}
+ {{ .Render.Content }}
+ {{ end }}
+{{ end }}
+-- layouts/_default/single.html --
+Single.
+{{ with .Markup }}
+ {{ with .Render }}
+ {{ .Content }}
+ {{ end }}
+{{ end }}
+-- layouts/_default/_markup/render-heading.html --
+Render heading: title: {{ .Text}} scope: {{ hugo.Context.MarkupScope }}|
+-- layouts/shortcodes/foo.html --
+Foo scope: {{ hugo.Context.MarkupScope }}|
+-- layouts/shortcodes/includerendershortcodes.html --
+{{ $p := site.GetPage (.Get 0) }}
+includerendershortcodes: {{ hugo.Context.MarkupScope }}|{{ $p.Markup.RenderShortcodes }}|
+-- layouts/shortcodes/includecontent.html --
+{{ $p := site.GetPage (.Get 0) }}
+includecontent: {{ hugo.Context.MarkupScope }}|{{ $p.Markup.Render.Content }}|
+
+`
+
+ b := hugolib.Test(t, files)
+
+ b.AssertFileContent("public/p1/index.html", "Render heading: title: P1 scope: |", "Foo scope: |")
+
+ b.AssertFileContent("public/index.html",
+ "Render heading: title: P1 scope: home|",
+ "Foo scope: home|",
+ "Begin:\nincluderendershortcodes: home|\nRender heading: title: P2 scope: home| |:End",
+ "Begin:\nincludecontent: home|Render heading: title: P3 scope: home|Foo scope: home|\n|\n:End",
+ )
+}
+
+func TestPageMarkupWithoutSummary(t *testing.T) {
+ t.Parallel()
+
+ files := `
+-- hugo.toml --
+summaryLength=5
+-- content/p1.md --
+---
+title: "Post 1"
+date: "2020-01-01"
+---
+This is summary.
+
+This is content.
+-- content/p2.md --
+---
+title: "Post 2"
+date: "2020-01-01"
+---
+This is some content about a summary and more.
+
+Another paragraph.
+
+Third paragraph.
+-- layouts/_default/single.html --
+Single.
+Page.Summary: {{ .Summary }}|
+{{ with .Markup.Render }}
+Content: {{ .Content }}|
+ContentWithoutSummary: {{ .ContentWithoutSummary }}|
+WordCount: {{ .WordCount }}|
+FuzzyWordCount: {{ .FuzzyWordCount }}|
+{{ with .Summary }}
+Summary: {{ . }}|
+Summary Type: {{ .Type }}|
+Summary Truncated: {{ .Truncated }}|
+{{ end }}
+{{ end }}
+
+`
+ b := hugolib.Test(t, files)
+
+ b.AssertFileContentExact("public/p1/index.html",
+ "Content:
This is summary.
\n
This is content.
",
+ "ContentWithoutSummary:
This is content.
|",
+ "WordCount: 6|",
+ "FuzzyWordCount: 100|",
+ "Summary:
This is summary.
|",
+ "Summary Type: manual|",
+ "Summary Truncated: true|",
+ )
+ b.AssertFileContent("public/p2/index.html",
+ "Summary:
This is some content about a summary and more.
|",
+ "WordCount: 13|",
+ "FuzzyWordCount: 100|",
+ "Summary Type: auto",
+ "Summary Truncated: true",
+ )
+}
+
+func TestPageMarkupWithoutSummaryRST(t *testing.T) {
+ t.Parallel()
+ if !rst.Supports() {
+ t.Skip("Skip RST test as not supported")
+ }
+
+ files := `
+-- hugo.toml --
+summaryLength=5
+[security.exec]
+allow = ["rst", "python"]
+
+-- content/p1.rst --
+This is a story about a summary and more.
+
+Another paragraph.
+-- content/p2.rst --
+This is summary.
+
+This is content.
+-- layouts/_default/single.html --
+Single.
+Page.Summary: {{ .Summary }}|
+{{ with .Markup.Render }}
+Content: {{ .Content }}|
+ContentWithoutSummary: {{ .ContentWithoutSummary }}|
+{{ with .Summary }}
+Summary: {{ . }}|
+Summary Type: {{ .Type }}|
+Summary Truncated: {{ .Truncated }}|
+{{ end }}
+{{ end }}
+
+`
+
+ b := hugolib.Test(t, files)
+
+ // Auto summary.
+ b.AssertFileContentExact("public/p1/index.html",
+ "Content:
\n\n\n
This is a story about a summary and more.
\n
Another paragraph.
\n
|",
+ "Summary:
\n\n\n
This is a story about a summary and more.
|\nSummary Type: auto|\nSummary Truncated: true|",
+ "ContentWithoutSummary:
|",
+ )
+
+ // Manual summary.
+ b.AssertFileContentExact("public/p2/index.html",
+ "Content:
\n\n\n
This is summary.
\n
This is content.
\n
|",
+ "ContentWithoutSummary:
|",
+ "Summary:
|\nSummary Type: manual|\nSummary Truncated: true|",
+ )
+}
+
+func TestPageMarkupWithoutSummaryAsciidoc(t *testing.T) {
+ t.Parallel()
+ if !asciidocext.Supports() {
+ t.Skip("Skip asiidoc test as not supported")
+ }
+
+ files := `
+-- hugo.toml --
+summaryLength=5
+[security.exec]
+allow = ["asciidoc", "python"]
+
+-- content/p1.ad --
+This is a story about a summary and more.
+
+Another paragraph.
+-- content/p2.ad --
+This is summary.
+
+This is content.
+-- layouts/_default/single.html --
+Single.
+Page.Summary: {{ .Summary }}|
+{{ with .Markup.Render }}
+Content: {{ .Content }}|
+ContentWithoutSummary: {{ .ContentWithoutSummary }}|
+{{ with .Summary }}
+Summary: {{ . }}|
+Summary Type: {{ .Type }}|
+Summary Truncated: {{ .Truncated }}|
+{{ end }}
+{{ end }}
+
+`
+
+ b := hugolib.Test(t, files)
+
+ // Auto summary.
+ b.AssertFileContentExact("public/p1/index.html",
+ "Content:
\n
This is a story about a summary and more.
\n
\n
\n|",
+ "Summary:
\n
This is a story about a summary and more.
\n
|",
+ "Summary Type: auto|\nSummary Truncated: true|",
+ "ContentWithoutSummary:
|",
+ )
+
+ // Manual summary.
+ b.AssertFileContentExact("public/p2/index.html",
+ "Content:
\n
|",
+ "ContentWithoutSummary:
|",
+ "Summary:
|\nSummary Type: manual|\nSummary Truncated: true|",
+ )
+}
diff --git a/resources/page/page_markup_test.go b/resources/page/page_markup_test.go
new file mode 100644
index 000000000..b7d363f8f
--- /dev/null
+++ b/resources/page/page_markup_test.go
@@ -0,0 +1,151 @@
+// Copyright 2024 The Hugo Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package page
+
+import (
+ "strings"
+ "testing"
+
+ qt "github.com/frankban/quicktest"
+ "github.com/gohugoio/hugo/common/types"
+ "github.com/gohugoio/hugo/media"
+)
+
+func TestExtractSummaryFromHTML(t *testing.T) {
+ c := qt.New(t)
+
+ tests := []struct {
+ mt media.Type
+ input string
+ isCJK bool
+ numWords int
+ expectSummary string
+ expectContentWithoutSummary string
+ }{
+ {media.Builtin.ReStructuredTextType, "
", false, 70, "
", ""},
+ {media.Builtin.ReStructuredTextType, "
First paragraph
Second paragraph
", false, 2, `
`, "
"},
+ {media.Builtin.MarkdownType, "
First paragraph
", false, 10, "
First paragraph
", ""},
+ {media.Builtin.MarkdownType, "
First paragraph
Second paragraph
", false, 2, "
First paragraph
", "
Second paragraph
"},
+ {media.Builtin.MarkdownType, "
First paragraph
Second paragraph
Third paragraph
", false, 3, "
First paragraph
Second paragraph
", "
Third paragraph
"},
+ {media.Builtin.AsciiDocType, "
", false, 2, "
", "
"},
+ {media.Builtin.MarkdownType, "
这是中文,全中文
a这是中文,全中文
", true, 5, "
这是中文,全中文
", "
a这是中文,全中文
"},
+ }
+
+ for i, test := range tests {
+ summary := ExtractSummaryFromHTML(test.mt, test.input, test.numWords, test.isCJK)
+ c.Assert(summary.Summary(), qt.Equals, test.expectSummary, qt.Commentf("Summary %d", i))
+ c.Assert(summary.ContentWithoutSummary(), qt.Equals, test.expectContentWithoutSummary, qt.Commentf("ContentWithoutSummary %d", i))
+ }
+}
+
+func TestExtractSummaryFromHTMLWithDivider(t *testing.T) {
+ c := qt.New(t)
+
+ const divider = "FOOO"
+
+ tests := []struct {
+ mt media.Type
+ input string
+ expectSummary string
+ expectContentWithoutSummary string
+ expectContent string
+ }{
+ {media.Builtin.MarkdownType, "
First paragraph
FOOO
Second paragraph
", "
First paragraph
", "
Second paragraph
", "
First paragraph
Second paragraph
"},
+ {media.Builtin.MarkdownType, "
First paragraph
\n
FOOO
\n
Second paragraph
", "
First paragraph
", "
Second paragraph
", "
First paragraph
\n
Second paragraph
"},
+ {media.Builtin.MarkdownType, "
FOOO
\n
First paragraph
", "", "
First paragraph
", "
First paragraph
"},
+ {media.Builtin.MarkdownType, "
First paragraph
Second paragraphFOOO
Third paragraph
", "
First paragraph
Second paragraph
", "
Third paragraph
", "
First paragraph
Second paragraph
Third paragraph
"},
+ {media.Builtin.MarkdownType, "
这是中文,全中文FOOO
a这是中文,全中文
", "
这是中文,全中文
", "
a这是中文,全中文
", "
这是中文,全中文
a这是中文,全中文
"},
+ {media.Builtin.MarkdownType, `
a b ` + "\v" + ` c
` + "\n
FOOO
", "
a b \v c
", "", "
a b \v c
"},
+
+ {media.Builtin.HTMLType, "
First paragraph
FOOO
Second paragraph
", "
First paragraph
", "
Second paragraph
", "
First paragraph
Second paragraph
"},
+
+ {media.Builtin.ReStructuredTextType, "
\n\n\n
This is summary.
\n
FOOO
\n
This is content.
\n
", "
", "
", "
\n\n\n
This is summary.
\n
This is content.
\n
"},
+ {media.Builtin.ReStructuredTextType, "
First paragraphFOOO
Second paragraph
", "
", "
", `
First paragraph
Second paragraph
`},
+
+ {media.Builtin.AsciiDocType, "
", "
", "
", "
"},
+ {media.Builtin.AsciiDocType, "
\n
\n
\n", "
", "
", "
\n
"},
+ {media.Builtin.AsciiDocType, "
", "", "
", "
"},
+ {media.Builtin.AsciiDocType, "
", "
", "
", "
"},
+ }
+
+ for i, test := range tests {
+ summary := ExtractSummaryFromHTMLWithDivider(test.mt, test.input, divider)
+ c.Assert(summary.Summary(), qt.Equals, test.expectSummary, qt.Commentf("Summary %d", i))
+ c.Assert(summary.ContentWithoutSummary(), qt.Equals, test.expectContentWithoutSummary, qt.Commentf("ContentWithoutSummary %d", i))
+ c.Assert(summary.Content(), qt.Equals, test.expectContent, qt.Commentf("Content %d", i))
+ }
+}
+
+func TestExpandDivider(t *testing.T) {
+ c := qt.New(t)
+
+ for i, test := range []struct {
+ input string
+ divider string
+ ptag tagReStartEnd
+ expect string
+ expectEndMarkup string
+ }{
+ {"
First paragraph
\n
FOOO
\n
Second paragraph
", "FOOO", startEndP, "
FOOO
\n", ""},
+ {"
", "FOOO", startEndDiv, "
", ""},
+ {"
", "FOOO", startEndDiv, "
", ""},
+ {"
", "FOOO", startEndDiv, "FOOO", "
"},
+ {" abc FOOO
", "FOOO", startEndP, "FOOO", "
"},
+ {" FOOO
", "FOOO", startEndP, " FOOO
", ""},
+ {" \n \nFOOO
", "FOOO", startEndP, "\n \nFOOO
", ""},
+ {" FOOO
", "FOOO", startEndDiv, " FOOO
", ""},
+ } {
+
+ l := types.LowHigh[string]{Low: strings.Index(test.input, test.divider), High: strings.Index(test.input, test.divider) + len(test.divider)}
+ e, t := expandSummaryDivider(test.input, test.ptag, l)
+ c.Assert(test.input[e.Low:e.High], qt.Equals, test.expect, qt.Commentf("[%d] Test.expect %q", i, test.input))
+ c.Assert(test.input[t.Low:t.High], qt.Equals, test.expectEndMarkup, qt.Commentf("[%d] Test.expectEndMarkup %q", i, test.input))
+ }
+}
+
+func BenchmarkSummaryFromHTML(b *testing.B) {
+ b.StopTimer()
+ input := "First paragraph
Second paragraph
"
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ summary := ExtractSummaryFromHTML(media.Builtin.MarkdownType, input, 2, false)
+ if s := summary.Content(); s != input {
+ b.Fatalf("unexpected content: %q", s)
+ }
+ if s := summary.ContentWithoutSummary(); s != "Second paragraph
" {
+ b.Fatalf("unexpected content without summary: %q", s)
+ }
+ if s := summary.Summary(); s != "First paragraph
" {
+ b.Fatalf("unexpected summary: %q", s)
+ }
+ }
+}
+
+func BenchmarkSummaryFromHTMLWithDivider(b *testing.B) {
+ b.StopTimer()
+ input := "First paragraph
FOOO
Second paragraph
"
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ summary := ExtractSummaryFromHTMLWithDivider(media.Builtin.MarkdownType, input, "FOOO")
+ if s := summary.Content(); s != "First paragraph
Second paragraph
" {
+ b.Fatalf("unexpected content: %q", s)
+ }
+ if s := summary.ContentWithoutSummary(); s != "Second paragraph
" {
+ b.Fatalf("unexpected content without summary: %q", s)
+ }
+ if s := summary.Summary(); s != "First paragraph
" {
+ b.Fatalf("unexpected summary: %q", s)
+ }
+ }
+}
diff --git a/resources/page/page_nop.go b/resources/page/page_nop.go
index f745d8622..2b40dbb73 100644
--- a/resources/page/page_nop.go
+++ b/resources/page/page_nop.go
@@ -44,6 +44,8 @@ import (
var (
NopPage Page = new(nopPage)
NopContentRenderer ContentRenderer = new(nopContentRenderer)
+ NopMarkup Markup = new(nopMarkup)
+ NopContent Content = new(nopContent)
NopCPageContentRenderer = struct {
OutputFormatPageContentProvider
ContentRenderer
@@ -109,10 +111,18 @@ func (p *nopPage) BundleType() string {
return ""
}
+func (p *nopPage) Markup(...any) Markup {
+ return NopMarkup
+}
+
func (p *nopPage) Content(context.Context) (any, error) {
return "", nil
}
+func (p *nopPage) ContentWithoutSummary(ctx context.Context) (template.HTML, error) {
+ return "", nil
+}
+
func (p *nopPage) ContentBaseName() string {
return ""
}
@@ -547,3 +557,69 @@ func (r *nopContentRenderer) ParseContent(ctx context.Context, content []byte) (
func (r *nopContentRenderer) RenderContent(ctx context.Context, content []byte, doc any) (converter.ResultRender, bool, error) {
return nil, false, nil
}
+
+type (
+ nopMarkup int
+ nopContent int
+)
+
+var (
+ _ Markup = (*nopMarkup)(nil)
+ _ Content = (*nopContent)(nil)
+)
+
+func (c *nopMarkup) Render(context.Context) (Content, error) {
+ return NopContent, nil
+}
+
+func (c *nopMarkup) RenderString(ctx context.Context, args ...any) (template.HTML, error) {
+ return "", nil
+}
+
+func (c *nopMarkup) RenderShortcodes(context.Context) (template.HTML, error) {
+ return "", nil
+}
+
+func (c *nopContent) Plain(context.Context) string {
+ return ""
+}
+
+func (c *nopContent) PlainWords(context.Context) []string {
+ return nil
+}
+
+func (c *nopContent) WordCount(context.Context) int {
+ return 0
+}
+
+func (c *nopContent) FuzzyWordCount(context.Context) int {
+ return 0
+}
+
+func (c *nopContent) ReadingTime(context.Context) int {
+ return 0
+}
+
+func (c *nopContent) Len(context.Context) int {
+ return 0
+}
+
+func (c *nopContent) Content(context.Context) (template.HTML, error) {
+ return "", nil
+}
+
+func (c *nopContent) ContentWithoutSummary(context.Context) (template.HTML, error) {
+ return "", nil
+}
+
+func (c *nopMarkup) Fragments(context.Context) *tableofcontents.Fragments {
+ return nil
+}
+
+func (c *nopMarkup) FragmentsHTML(context.Context) template.HTML {
+ return ""
+}
+
+func (c *nopContent) Summary(context.Context) (Summary, error) {
+ return Summary{}, nil
+}
diff --git a/resources/page/testhelpers_test.go b/resources/page/testhelpers_test.go
index cedbc74e9..9eefeeea4 100644
--- a/resources/page/testhelpers_test.go
+++ b/resources/page/testhelpers_test.go
@@ -149,6 +149,10 @@ func (p *testPage) Content(context.Context) (any, error) {
panic("testpage: not implemented")
}
+func (p *testPage) Markup(...any) Markup {
+ panic("testpage: not implemented")
+}
+
func (p *testPage) ContentBaseName() string {
panic("testpage: not implemented")
}
@@ -177,6 +181,10 @@ func (p *testPage) Description() string {
return ""
}
+func (p *testPage) ContentWithoutSummary(ctx context.Context) (template.HTML, error) {
+ return "", nil
+}
+
func (p *testPage) Dir() string {
panic("testpage: not implemented")
}
From 53a8de21b86977efd9187955fb4bd0e75375d666 Mon Sep 17 00:00:00 2001
From: Patrice Chalin
Date: Thu, 29 Aug 2024 15:32:46 -0400
Subject: [PATCH 027/570] tpl: Trim whitespace from google_analytics.html
---
.../embedded/templates/google_analytics.html | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/tpl/tplimpl/embedded/templates/google_analytics.html b/tpl/tplimpl/embedded/templates/google_analytics.html
index b8930d4bd..49856630f 100644
--- a/tpl/tplimpl/embedded/templates/google_analytics.html
+++ b/tpl/tplimpl/embedded/templates/google_analytics.html
@@ -1,8 +1,8 @@
{{ if not site.Config.Privacy.GoogleAnalytics.Disable }}
- {{ with site.Config.Services.GoogleAnalytics.ID }}
- {{ if strings.HasPrefix (lower .) "ua-" }}
- {{ warnf "Google Analytics 4 (GA4) replaced Google Universal Analytics (UA) effective 1 July 2023. See https://support.google.com/analytics/answer/11583528. Create a GA4 property and data stream, then replace the Google Analytics ID in your site configuration with the new value." }}
- {{ else }}
+ {{- with site.Config.Services.GoogleAnalytics.ID }}
+ {{- if strings.HasPrefix (lower .) "ua-" }}
+ {{- warnf "Google Analytics 4 (GA4) replaced Google Universal Analytics (UA) effective 1 July 2023. See https://support.google.com/analytics/answer/11583528. Create a GA4 property and data stream, then replace the Google Analytics ID in your site configuration with the new value." }}
+ {{- else }}
- {{ end }}
- {{ end }}
-{{ end }}
+ {{- end }}
+ {{- end }}
+{{- end -}}
From a3684c836111a51d5827f89144f63b8318de6995 Mon Sep 17 00:00:00 2001
From: Joe Mooring
Date: Thu, 29 Aug 2024 15:28:49 -0700
Subject: [PATCH 028/570] tpl/resources: Improve resources.Concat error message
Closes #7428
---
tpl/resources/resources.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tpl/resources/resources.go b/tpl/resources/resources.go
index 78340b1ff..5c2068b68 100644
--- a/tpl/resources/resources.go
+++ b/tpl/resources/resources.go
@@ -224,7 +224,7 @@ func (ns *Namespace) Concat(targetPathIn any, r any) (resource.Resource, error)
case resource.ResourcesConverter:
rr = v.ToResources()
default:
- return nil, fmt.Errorf("slice %T not supported in concat", r)
+ return nil, fmt.Errorf("expected slice of Resource objects, received %T instead", r)
}
if len(rr) == 0 {
From 8fb933550f5269e2f21ec09ab66801b28e603bea Mon Sep 17 00:00:00 2001
From: Andreas Deininger
Date: Fri, 30 Aug 2024 22:15:29 +0200
Subject: [PATCH 029/570] Fix deprecation warning for resources.ToCSS
---
tpl/resources/resources.go | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tpl/resources/resources.go b/tpl/resources/resources.go
index 5c2068b68..beace14e6 100644
--- a/tpl/resources/resources.go
+++ b/tpl/resources/resources.go
@@ -310,14 +310,14 @@ func (ns *Namespace) Minify(r resources.ResourceTransformer) (resource.Resource,
// for the converted CSS resource.
// Deprecated: Moved to the css namespace in Hugo 0.128.0.
func (ns *Namespace) ToCSS(args ...any) (resource.Resource, error) {
- hugo.Deprecate("resources.ToCSS", "Use css.SASS.", "v0.128.0")
+ hugo.Deprecate("resources.ToCSS", "Use css.Sass instead.", "v0.128.0")
return ns.cssNs.Sass(args...)
}
// PostCSS processes the given Resource with PostCSS.
// Deprecated: Moved to the css namespace in Hugo 0.128.0.
func (ns *Namespace) PostCSS(args ...any) (resource.Resource, error) {
- hugo.Deprecate("resources.PostCSS", "Use css.PostCSS.", "v0.128.0")
+ hugo.Deprecate("resources.PostCSS", "Use css.PostCSS instead.", "v0.128.0")
return ns.cssNs.PostCSS(args...)
}
From b63f24adc78e09c1044b448daa7c6cb375cebee6 Mon Sep 17 00:00:00 2001
From: Joe Mooring
Date: Sat, 31 Aug 2024 07:49:53 -0700
Subject: [PATCH 030/570] create/skeletons: Clean up lang attribute in base
template
---
create/skeletons/theme/layouts/_default/baseof.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/create/skeletons/theme/layouts/_default/baseof.html b/create/skeletons/theme/layouts/_default/baseof.html
index 479c89713..39dcbec61 100644
--- a/create/skeletons/theme/layouts/_default/baseof.html
+++ b/create/skeletons/theme/layouts/_default/baseof.html
@@ -1,5 +1,5 @@
-
+
{{ partial "head.html" . }}
From f738669a4d09ca04619f4d0f89d90c9b414e9f2e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?=
Date: Fri, 30 Aug 2024 10:58:43 +0200
Subject: [PATCH 031/570] Add Markdown render hooks for tables
Fixes #9316
Fixes #12811
---
hugolib/page__per_output.go | 16 +-
hugolib/site.go | 4 +
markup/converter/hooks/hooks.go | 50 +++--
markup/goldmark/blockquotes/blockquotes.go | 103 ++--------
markup/goldmark/codeblocks/render.go | 71 +------
markup/goldmark/convert.go | 2 +
markup/goldmark/convert_test.go | 22 ++-
markup/goldmark/internal/render/context.go | 150 +++++++++++++++
markup/goldmark/passthrough/passthrough.go | 70 +------
markup/goldmark/render_hooks.go | 49 ++---
markup/goldmark/tables/tables.go | 175 +++++++++++++++++
.../tables/tables_integration_test.go | 181 ++++++++++++++++++
.../_default/_markup/render-table.html | 29 +++
13 files changed, 651 insertions(+), 271 deletions(-)
create mode 100644 markup/goldmark/tables/tables.go
create mode 100644 markup/goldmark/tables/tables_integration_test.go
create mode 100644 tpl/tplimpl/embedded/templates/_default/_markup/render-table.html
diff --git a/hugolib/page__per_output.go b/hugolib/page__per_output.go
index f074e8db7..6ebddbe44 100644
--- a/hugolib/page__per_output.go
+++ b/hugolib/page__per_output.go
@@ -296,6 +296,8 @@ func (pco *pageContentOutput) initRenderHooks() error {
if id != nil {
layoutDescriptor.KindVariants = id.(string)
}
+ case hooks.TableRendererType:
+ layoutDescriptor.Kind = "render-table"
case hooks.CodeBlockRendererType:
layoutDescriptor.Kind = "render-codeblock"
if id != nil {
@@ -334,13 +336,23 @@ func (pco *pageContentOutput) initRenderHooks() error {
templ, found1 := getHookTemplate(pco.po.f)
- if pco.po.p.reusePageOutputContent() {
+ if !found1 || pco.po.p.reusePageOutputContent() {
+ // Some hooks may only be available in HTML, and if
+ // this site is configured to not have HTML output, we need to
+ // make sure we have a fallback. This should be very rare.
+ candidates := pco.po.p.s.renderFormats
+ if pco.po.f.MediaType.FirstSuffix.Suffix != "html" {
+ if _, found := candidates.GetBySuffix("html"); !found {
+ candidates = append(candidates, output.HTMLFormat)
+ }
+ }
// Check if some of the other output formats would give a different template.
- for _, f := range pco.po.p.s.renderFormats {
+ for _, f := range candidates {
if f.Name == pco.po.f.Name {
continue
}
templ2, found2 := getHookTemplate(f)
+
if found2 {
if !found1 {
templ = templ2
diff --git a/hugolib/site.go b/hugolib/site.go
index a93bbdbe6..d0546e910 100644
--- a/hugolib/site.go
+++ b/hugolib/site.go
@@ -930,6 +930,10 @@ func (hr hookRendererTemplate) RenderBlockquote(cctx context.Context, w hugio.Fl
return hr.templateHandler.ExecuteWithContext(cctx, hr.templ, w, ctx)
}
+func (hr hookRendererTemplate) RenderTable(cctx context.Context, w hugio.FlexiWriter, ctx hooks.TableContext) error {
+ return hr.templateHandler.ExecuteWithContext(cctx, hr.templ, w, ctx)
+}
+
func (hr hookRendererTemplate) ResolvePosition(ctx any) text.Position {
return hr.resolvePosition(ctx)
}
diff --git a/markup/converter/hooks/hooks.go b/markup/converter/hooks/hooks.go
index 29e848d80..9487fd0a7 100644
--- a/markup/converter/hooks/hooks.go
+++ b/markup/converter/hooks/hooks.go
@@ -61,9 +61,8 @@ type ImageLinkContext interface {
// CodeblockContext is the context passed to a code block render hook.
type CodeblockContext interface {
+ BaseContext
AttributesProvider
- text.Positioner
- PageProvider
// Chroma highlighting processing options. This will only be filled if Type is a known Chroma Lexer.
Options() map[string]any
@@ -73,19 +72,31 @@ type CodeblockContext interface {
// The text between the code fences.
Inner() string
+}
- // Zero-based ordinal for all code blocks in the current document.
+// TableContext is the context passed to a table render hook.
+type TableContext interface {
+ BaseContext
+ AttributesProvider
+
+ THead() []TableRow
+ TBody() []TableRow
+}
+
+// BaseContext is the base context used in most render hooks.
+type BaseContext interface {
+ text.Positioner
+ PageProvider
+
+ // Zero-based ordinal for all elements of this kind in the current document.
Ordinal() int
}
// BlockquoteContext is the context passed to a blockquote render hook.
type BlockquoteContext interface {
- AttributesProvider
- text.Positioner
- PageProvider
+ BaseContext
- // Zero-based ordinal for all block quotes in the current document.
- Ordinal() int
+ AttributesProvider
// The blockquote text.
// If type is "alert", this will be the alert text.
@@ -107,18 +118,14 @@ type PositionerSourceTargetProvider interface {
// PassThroughContext is the context passed to a passthrough render hook.
type PassthroughContext interface {
+ BaseContext
AttributesProvider
- text.Positioner
- PageProvider
// Currently one of "inline" or "block".
Type() string
// The inner content of the passthrough element, excluding the delimiters.
Inner() string
-
- // Zero-based ordinal for all passthrough elements in the document.
- Ordinal() int
}
type AttributesOptionsSliceProvider interface {
@@ -138,6 +145,10 @@ type BlockquoteRenderer interface {
RenderBlockquote(cctx context.Context, w hugio.FlexiWriter, ctx BlockquoteContext) error
}
+type TableRenderer interface {
+ RenderTable(cctx context.Context, w hugio.FlexiWriter, ctx TableContext) error
+}
+
type PassthroughRenderer interface {
RenderPassthrough(cctx context.Context, w io.Writer, ctx PassthroughContext) error
}
@@ -196,6 +207,19 @@ const (
CodeBlockRendererType
PassthroughRendererType
BlockquoteRendererType
+ TableRendererType
)
type GetRendererFunc func(t RendererType, id any) any
+
+type TableCell struct {
+ Text hstring.RenderedString
+ Alignment string // left, center, or right
+}
+
+type TableRow []TableCell
+
+type Table struct {
+ THead []TableRow
+ TBody []TableRow
+}
diff --git a/markup/goldmark/blockquotes/blockquotes.go b/markup/goldmark/blockquotes/blockquotes.go
index d26c92669..a261ec4fe 100644
--- a/markup/goldmark/blockquotes/blockquotes.go
+++ b/markup/goldmark/blockquotes/blockquotes.go
@@ -16,10 +16,8 @@ package blockquotes
import (
"regexp"
"strings"
- "sync"
"github.com/gohugoio/hugo/common/herrors"
- htext "github.com/gohugoio/hugo/common/text"
"github.com/gohugoio/hugo/common/types/hstring"
"github.com/gohugoio/hugo/markup/converter/hooks"
"github.com/gohugoio/hugo/markup/goldmark/internal/render"
@@ -71,70 +69,36 @@ func (r *htmlRenderer) renderBlockquote(w util.BufWriter, src []byte, node ast.N
return ast.WalkContinue, nil
}
- pos := ctx.PopPos()
- text := ctx.Buffer.Bytes()[pos:]
- ctx.Buffer.Truncate(pos)
+ text := ctx.PopRenderedString()
ordinal := ctx.GetAndIncrementOrdinal(ast.KindBlockquote)
- texts := string(text)
typ := typeRegular
- alertType := resolveGitHubAlert(texts)
+ alertType := resolveGitHubAlert(string(text))
if alertType != "" {
typ = typeAlert
}
renderer := ctx.RenderContext().GetRenderer(hooks.BlockquoteRendererType, typ)
if renderer == nil {
- return r.renderBlockquoteDefault(w, n, texts)
+ return r.renderBlockquoteDefault(w, n, text)
}
if typ == typeAlert {
// Trim preamble: [!NOTE] \n but preserve leading paragraph.
// We could possibly complicate this by moving this to the parser, but
// keep it simple for now.
- texts = "
" + texts[strings.Index(texts, "\n")+1:]
- }
-
- var sourceRef []byte
-
- // Extract a source sample to use for position information.
- if nn := n.FirstChild(); nn != nil {
- var start, stop int
- for i := 0; i < nn.Lines().Len() && i < 2; i++ {
- line := nn.Lines().At(i)
- if i == 0 {
- start = line.Start
- }
- stop = line.Stop
- }
- // We do not mutate the source, so this is safe.
- sourceRef = src[start:stop]
+ text = "
" + text[strings.Index(text, "\n")+1:]
}
bqctx := &blockquoteContext{
- page: ctx.DocumentContext().Document,
- pageInner: r.getPageInner(ctx),
+ BaseContext: render.NewBaseContext(ctx, renderer, n, src, nil, ordinal),
typ: typ,
alertType: alertType,
- text: hstring.RenderedString(texts),
- sourceRef: sourceRef,
- ordinal: ordinal,
+ text: hstring.RenderedString(text),
AttributesHolder: attributes.New(n.Attributes(), attributes.AttributesOwnerGeneral),
}
- bqctx.createPos = func() htext.Position {
- if resolver, ok := renderer.(hooks.ElementPositionResolver); ok {
- return resolver.ResolvePosition(bqctx)
- }
-
- return htext.Position{
- Filename: ctx.DocumentContext().Filename,
- LineNumber: 1,
- ColumnNumber: 1,
- }
- }
-
cr := renderer.(hooks.BlockquoteRenderer)
err := cr.RenderBlockquote(
@@ -143,24 +107,12 @@ func (r *htmlRenderer) renderBlockquote(w util.BufWriter, src []byte, node ast.N
bqctx,
)
if err != nil {
- return ast.WalkContinue, herrors.NewFileErrorFromPos(err, bqctx.createPos())
+ return ast.WalkContinue, herrors.NewFileErrorFromPos(err, bqctx.Position())
}
return ast.WalkContinue, nil
}
-func (r *htmlRenderer) getPageInner(rctx *render.Context) any {
- pid := rctx.PeekPid()
- if pid > 0 {
- if lookup := rctx.DocumentContext().DocumentLookup; lookup != nil {
- if v := rctx.DocumentContext().DocumentLookup(pid); v != nil {
- return v
- }
- }
- }
- return rctx.DocumentContext().Document
-}
-
// Code borrowed from goldmark's html renderer.
func (r *htmlRenderer) renderBlockquoteDefault(
w util.BufWriter, n ast.Node, text string,
@@ -180,19 +132,11 @@ func (r *htmlRenderer) renderBlockquoteDefault(
}
type blockquoteContext struct {
- page any
- pageInner any
- text hstring.RenderedString
- typ string
- sourceRef []byte
- alertType string
- ordinal int
+ hooks.BaseContext
- // This is only used in error situations and is expensive to create,
- // so delay creation until needed.
- pos htext.Position
- posInit sync.Once
- createPos func() htext.Position
+ text hstring.RenderedString
+ alertType string
+ typ string
*attributes.AttributesHolder
}
@@ -205,35 +149,10 @@ func (c *blockquoteContext) AlertType() string {
return c.alertType
}
-func (c *blockquoteContext) Page() any {
- return c.page
-}
-
-func (c *blockquoteContext) PageInner() any {
- return c.pageInner
-}
-
func (c *blockquoteContext) Text() hstring.RenderedString {
return c.text
}
-func (c *blockquoteContext) Ordinal() int {
- return c.ordinal
-}
-
-func (c *blockquoteContext) Position() htext.Position {
- c.posInit.Do(func() {
- c.pos = c.createPos()
- })
- return c.pos
-}
-
-func (c *blockquoteContext) PositionerSourceTarget() []byte {
- return c.sourceRef
-}
-
-var _ hooks.PositionerSourceTargetProvider = (*blockquoteContext)(nil)
-
// https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts
// Five types:
// [!NOTE], [!TIP], [!WARNING], [!IMPORTANT], [!CAUTION]
diff --git a/markup/goldmark/codeblocks/render.go b/markup/goldmark/codeblocks/render.go
index fad3ac458..4164f0e0a 100644
--- a/markup/goldmark/codeblocks/render.go
+++ b/markup/goldmark/codeblocks/render.go
@@ -18,7 +18,6 @@ import (
"errors"
"fmt"
"strings"
- "sync"
"github.com/gohugoio/hugo/common/herrors"
htext "github.com/gohugoio/hugo/common/text"
@@ -101,26 +100,14 @@ func (r *htmlRenderer) renderCodeBlock(w util.BufWriter, src []byte, node ast.No
if err != nil {
return ast.WalkStop, &herrors.TextSegmentError{Err: err, Segment: attrStr}
}
+
cbctx := &codeBlockContext{
- page: ctx.DocumentContext().Document,
- pageInner: r.getPageInner(ctx),
+ BaseContext: render.NewBaseContext(ctx, renderer, node, src, func() []byte { return []byte(s) }, ordinal),
lang: lang,
code: s,
- ordinal: ordinal,
AttributesHolder: attributes.New(attrs, attrtp),
}
- cbctx.createPos = func() htext.Position {
- if resolver, ok := renderer.(hooks.ElementPositionResolver); ok {
- return resolver.ResolvePosition(cbctx)
- }
- return htext.Position{
- Filename: ctx.DocumentContext().Filename,
- LineNumber: 1,
- ColumnNumber: 1,
- }
- }
-
cr := renderer.(hooks.CodeBlockRenderer)
err = cr.RenderCodeblock(
@@ -129,50 +116,20 @@ func (r *htmlRenderer) renderCodeBlock(w util.BufWriter, src []byte, node ast.No
cbctx,
)
if err != nil {
- return ast.WalkContinue, herrors.NewFileErrorFromPos(err, cbctx.createPos())
+ return ast.WalkContinue, herrors.NewFileErrorFromPos(err, cbctx.Position())
}
return ast.WalkContinue, nil
}
-func (r *htmlRenderer) getPageInner(rctx *render.Context) any {
- pid := rctx.PeekPid()
- if pid > 0 {
- if lookup := rctx.DocumentContext().DocumentLookup; lookup != nil {
- if v := rctx.DocumentContext().DocumentLookup(pid); v != nil {
- return v
- }
- }
- }
- return rctx.DocumentContext().Document
-}
-
-var _ hooks.PositionerSourceTargetProvider = (*codeBlockContext)(nil)
-
type codeBlockContext struct {
- page any
- pageInner any
- lang string
- code string
- ordinal int
-
- // This is only used in error situations and is expensive to create,
- // so delay creation until needed.
- pos htext.Position
- posInit sync.Once
- createPos func() htext.Position
+ hooks.BaseContext
+ lang string
+ code string
*attributes.AttributesHolder
}
-func (c *codeBlockContext) Page() any {
- return c.page
-}
-
-func (c *codeBlockContext) PageInner() any {
- return c.pageInner
-}
-
func (c *codeBlockContext) Type() string {
return c.lang
}
@@ -181,22 +138,6 @@ func (c *codeBlockContext) Inner() string {
return c.code
}
-func (c *codeBlockContext) Ordinal() int {
- return c.ordinal
-}
-
-func (c *codeBlockContext) Position() htext.Position {
- c.posInit.Do(func() {
- c.pos = c.createPos()
- })
- return c.pos
-}
-
-// For internal use.
-func (c *codeBlockContext) PositionerSourceTarget() []byte {
- return []byte(c.code)
-}
-
func getLang(node *ast.FencedCodeBlock, src []byte) string {
langWithAttributes := string(node.Language(src))
lang, _, _ := strings.Cut(langWithAttributes, "{")
diff --git a/markup/goldmark/convert.go b/markup/goldmark/convert.go
index 357be7328..5c31eee40 100644
--- a/markup/goldmark/convert.go
+++ b/markup/goldmark/convert.go
@@ -26,6 +26,7 @@ import (
"github.com/gohugoio/hugo/markup/goldmark/internal/extensions/attributes"
"github.com/gohugoio/hugo/markup/goldmark/internal/render"
"github.com/gohugoio/hugo/markup/goldmark/passthrough"
+ "github.com/gohugoio/hugo/markup/goldmark/tables"
"github.com/yuin/goldmark/util"
"github.com/yuin/goldmark"
@@ -131,6 +132,7 @@ func newMarkdown(pcfg converter.ProviderConfig) goldmark.Markdown {
if cfg.Extensions.Table {
extensions = append(extensions, extension.Table)
+ extensions = append(extensions, tables.New())
}
if cfg.Extensions.Strikethrough {
diff --git a/markup/goldmark/convert_test.go b/markup/goldmark/convert_test.go
index 4c5039e74..6048bce39 100644
--- a/markup/goldmark/convert_test.go
+++ b/markup/goldmark/convert_test.go
@@ -14,6 +14,7 @@
package goldmark_test
import (
+ "context"
"fmt"
"strings"
"testing"
@@ -30,6 +31,7 @@ import (
"github.com/gohugoio/hugo/markup/markup_config"
+ "github.com/gohugoio/hugo/common/hugio"
"github.com/gohugoio/hugo/common/loggers"
"github.com/gohugoio/hugo/common/maps"
@@ -60,9 +62,13 @@ func convert(c *qt.C, conf config.AllProvider, content string) converter.ResultR
h := highlight.New(mconf.Highlight)
getRenderer := func(t hooks.RendererType, id any) any {
- if t == hooks.CodeBlockRendererType {
+ switch t {
+ case hooks.CodeBlockRendererType:
return h
+ case hooks.TableRendererType:
+ return tableRenderer(0)
}
+
return nil
}
@@ -168,8 +174,6 @@ unsafe = true
b := convert(c, testconfig.GetTestConfig(nil, cfg), content)
got := string(b.Bytes())
- fmt.Println(got)
-
// Links
c.Assert(got, qt.Contains, `Live Demo here! `)
c.Assert(got, qt.Contains, `https://foo.bar/ `)
@@ -191,7 +195,7 @@ unsafe = true
// Extensions
c.Assert(got, qt.Contains, `Autolink: https://gohugo.io/ `)
c.Assert(got, qt.Contains, `Strikethrough:Hi Hello, world`)
- c.Assert(got, qt.Contains, `
foo `)
+ c.Assert(got, qt.Contains, `Table`)
c.Assert(got, qt.Contains, ` Push my commits to GitHub `)
c.Assert(got, qt.Contains, `Straight double “quotes” and single ‘quotes’`)
@@ -378,7 +382,7 @@ func TestConvertAttributes(t *testing.T) {
| ------------- |:-------------:| -----:|
| AV | BV |
{.myclass }`,
- "\n",
+ "Table",
},
{
"Title and Blockquote",
@@ -741,3 +745,11 @@ escapedSpace=true
c.Assert(got, qt.Contains, "私は太郎です。\nプログラミングが好きです。運動が苦手です。
\n")
}
+
+type tableRenderer int
+
+func (hr tableRenderer) RenderTable(cctx context.Context, w hugio.FlexiWriter, ctx hooks.TableContext) error {
+ // This is set up with a render hook in the hugolib package, make it simple here.
+ fmt.Fprintln(w, "Table")
+ return nil
+}
diff --git a/markup/goldmark/internal/render/context.go b/markup/goldmark/internal/render/context.go
index 712e1f053..b8cf9ba54 100644
--- a/markup/goldmark/internal/render/context.go
+++ b/markup/goldmark/internal/render/context.go
@@ -16,8 +16,12 @@ package render
import (
"bytes"
"math/bits"
+ "sync"
+
+ htext "github.com/gohugoio/hugo/common/text"
"github.com/gohugoio/hugo/markup/converter"
+ "github.com/gohugoio/hugo/markup/converter/hooks"
"github.com/yuin/goldmark/ast"
)
@@ -45,6 +49,7 @@ type Context struct {
positions []int
pids []uint64
ordinals map[ast.NodeKind]int
+ values map[ast.NodeKind][]any
}
func (ctx *Context) GetAndIncrementOrdinal(kind ast.NodeKind) int {
@@ -67,6 +72,13 @@ func (ctx *Context) PopPos() int {
return p
}
+func (ctx *Context) PopRenderedString() string {
+ pos := ctx.PopPos()
+ text := string(ctx.Bytes()[pos:])
+ ctx.Truncate(pos)
+ return text
+}
+
// PushPid pushes a new page ID to the stack.
func (ctx *Context) PushPid(pid uint64) {
ctx.pids = append(ctx.pids, pid)
@@ -91,6 +103,38 @@ func (ctx *Context) PopPid() uint64 {
return p
}
+func (ctx *Context) PushValue(k ast.NodeKind, v any) {
+ if ctx.values == nil {
+ ctx.values = make(map[ast.NodeKind][]any)
+ }
+ ctx.values[k] = append(ctx.values[k], v)
+}
+
+func (ctx *Context) PopValue(k ast.NodeKind) any {
+ if ctx.values == nil {
+ return nil
+ }
+ v := ctx.values[k]
+ if len(v) == 0 {
+ return nil
+ }
+ i := len(v) - 1
+ r := v[i]
+ ctx.values[k] = v[:i]
+ return r
+}
+
+func (ctx *Context) PeekValue(k ast.NodeKind) any {
+ if ctx.values == nil {
+ return nil
+ }
+ v := ctx.values[k]
+ if len(v) == 0 {
+ return nil
+ }
+ return v[len(v)-1]
+}
+
type ContextData interface {
RenderContext() converter.RenderContext
DocumentContext() converter.DocumentContext
@@ -108,3 +152,109 @@ func (ctx *RenderContextDataHolder) RenderContext() converter.RenderContext {
func (ctx *RenderContextDataHolder) DocumentContext() converter.DocumentContext {
return ctx.Dctx
}
+
+// extractSourceSample returns a sample of the source for the given node.
+// Note that this is not a copy of the source, but a slice of it,
+// so it assumes that the source is not mutated.
+func extractSourceSample(n ast.Node, src []byte) []byte {
+ var sample []byte
+
+ // Extract a source sample to use for position information.
+ if nn := n.FirstChild(); nn != nil {
+ var start, stop int
+ for i := 0; i < nn.Lines().Len() && i < 2; i++ {
+ line := nn.Lines().At(i)
+ if i == 0 {
+ start = line.Start
+ }
+ stop = line.Stop
+ }
+ // We do not mutate the source, so this is safe.
+ sample = src[start:stop]
+ }
+ return sample
+}
+
+// GetPageAndPageInner returns the current page and the inner page for the given context.
+func GetPageAndPageInner(rctx *Context) (any, any) {
+ p := rctx.DocumentContext().Document
+ pid := rctx.PeekPid()
+ if pid > 0 {
+ if lookup := rctx.DocumentContext().DocumentLookup; lookup != nil {
+ if v := rctx.DocumentContext().DocumentLookup(pid); v != nil {
+ return p, v
+ }
+ }
+ }
+ return p, p
+}
+
+// NewBaseContext creates a new BaseContext.
+func NewBaseContext(rctx *Context, renderer any, n ast.Node, src []byte, getSourceSample func() []byte, ordinal int) hooks.BaseContext {
+ if getSourceSample == nil {
+ getSourceSample = func() []byte {
+ return extractSourceSample(n, src)
+ }
+ }
+ page, pageInner := GetPageAndPageInner(rctx)
+ b := &hookBase{
+ page: page,
+ pageInner: pageInner,
+
+ getSourceSample: getSourceSample,
+ ordinal: ordinal,
+ }
+
+ b.createPos = func() htext.Position {
+ if resolver, ok := renderer.(hooks.ElementPositionResolver); ok {
+ return resolver.ResolvePosition(b)
+ }
+
+ return htext.Position{
+ Filename: rctx.DocumentContext().Filename,
+ LineNumber: 1,
+ ColumnNumber: 1,
+ }
+ }
+
+ return b
+}
+
+var _ hooks.PositionerSourceTargetProvider = (*hookBase)(nil)
+
+type hookBase struct {
+ page any
+ pageInner any
+ ordinal int
+
+ // This is only used in error situations and is expensive to create,
+ // so delay creation until needed.
+ pos htext.Position
+ posInit sync.Once
+ createPos func() htext.Position
+ getSourceSample func() []byte
+}
+
+func (c *hookBase) Page() any {
+ return c.page
+}
+
+func (c *hookBase) PageInner() any {
+ return c.pageInner
+}
+
+func (c *hookBase) Ordinal() int {
+ return c.ordinal
+}
+
+func (c *hookBase) Position() htext.Position {
+ c.posInit.Do(func() {
+ c.pos = c.createPos()
+ })
+ return c.pos
+}
+
+// For internal use.
+func (c *hookBase) PositionerSourceTarget() []byte {
+ return c.getSourceSample()
+}
diff --git a/markup/goldmark/passthrough/passthrough.go b/markup/goldmark/passthrough/passthrough.go
index aafb1544b..4d72e7c80 100644
--- a/markup/goldmark/passthrough/passthrough.go
+++ b/markup/goldmark/passthrough/passthrough.go
@@ -15,9 +15,6 @@ package passthrough
import (
"bytes"
- "sync"
-
- htext "github.com/gohugoio/hugo/common/text"
"github.com/gohugoio/hugo-goldmark-extensions/passthrough"
"github.com/gohugoio/hugo/markup/converter/hooks"
@@ -136,25 +133,12 @@ func (r *htmlRenderer) renderPassthroughBlock(w util.BufWriter, src []byte, node
s = s[len(delims.Open) : len(s)-len(delims.Close)]
pctx := &passthroughContext{
- ordinal: ordinal,
- page: ctx.DocumentContext().Document,
- pageInner: r.getPageInner(ctx),
+ BaseContext: render.NewBaseContext(ctx, renderer, node, src, nil, ordinal),
inner: s,
typ: typ,
AttributesHolder: attributes.New(node.Attributes(), attributes.AttributesOwnerGeneral),
}
- pctx.createPos = func() htext.Position {
- if resolver, ok := renderer.(hooks.ElementPositionResolver); ok {
- return resolver.ResolvePosition(pctx)
- }
- return htext.Position{
- Filename: ctx.DocumentContext().Filename,
- LineNumber: 1,
- ColumnNumber: 1,
- }
- }
-
pr := renderer.(hooks.PassthroughRenderer)
if err := pr.RenderPassthrough(ctx.RenderContext().Ctx, w, pctx); err != nil {
@@ -164,41 +148,15 @@ func (r *htmlRenderer) renderPassthroughBlock(w util.BufWriter, src []byte, node
return ast.WalkContinue, nil
}
-func (r *htmlRenderer) getPageInner(rctx *render.Context) any {
- pid := rctx.PeekPid()
- if pid > 0 {
- if lookup := rctx.DocumentContext().DocumentLookup; lookup != nil {
- if v := rctx.DocumentContext().DocumentLookup(pid); v != nil {
- return v
- }
- }
- }
- return rctx.DocumentContext().Document
-}
-
type passthroughContext struct {
- page any
- pageInner any
- typ string // inner or block
- inner string
- ordinal int
+ hooks.BaseContext
+
+ typ string // inner or block
+ inner string
- // This is only used in error situations and is expensive to create,
- // so delay creation until needed.
- pos htext.Position
- posInit sync.Once
- createPos func() htext.Position
*attributes.AttributesHolder
}
-func (p *passthroughContext) Page() any {
- return p.page
-}
-
-func (p *passthroughContext) PageInner() any {
- return p.pageInner
-}
-
func (p *passthroughContext) Type() string {
return p.typ
}
@@ -206,21 +164,3 @@ func (p *passthroughContext) Type() string {
func (p *passthroughContext) Inner() string {
return p.inner
}
-
-func (p *passthroughContext) Ordinal() int {
- return p.ordinal
-}
-
-func (p *passthroughContext) Position() htext.Position {
- p.posInit.Do(func() {
- p.pos = p.createPos()
- })
- return p.pos
-}
-
-// For internal use.
-func (p *passthroughContext) PositionerSourceTarget() []byte {
- return []byte(p.inner)
-}
-
-var _ hooks.PositionerSourceTargetProvider = (*passthroughContext)(nil)
diff --git a/markup/goldmark/render_hooks.go b/markup/goldmark/render_hooks.go
index c127a2c0e..790b2f4ca 100644
--- a/markup/goldmark/render_hooks.go
+++ b/markup/goldmark/render_hooks.go
@@ -169,9 +169,7 @@ func (r *hookedRenderer) renderImage(w util.BufWriter, source []byte, node ast.N
return ast.WalkContinue, nil
}
- pos := ctx.PopPos()
- text := ctx.Buffer.Bytes()[pos:]
- ctx.Buffer.Truncate(pos)
+ text := ctx.PopRenderedString()
var (
isBlock bool
@@ -190,13 +188,15 @@ func (r *hookedRenderer) renderImage(w util.BufWriter, source []byte, node ast.N
// internal attributes before rendering.
attrs := r.filterInternalAttributes(n.Attributes())
+ page, pageInner := render.GetPageAndPageInner(ctx)
+
err := lr.RenderLink(
ctx.RenderContext().Ctx,
w,
imageLinkContext{
linkContext: linkContext{
- page: ctx.DocumentContext().Document,
- pageInner: r.getPageInner(ctx),
+ page: page,
+ pageInner: pageInner,
destination: string(n.Destination),
title: string(n.Title),
text: hstring.RenderedString(text),
@@ -211,18 +211,6 @@ func (r *hookedRenderer) renderImage(w util.BufWriter, source []byte, node ast.N
return ast.WalkContinue, err
}
-func (r *hookedRenderer) getPageInner(rctx *render.Context) any {
- pid := rctx.PeekPid()
- if pid > 0 {
- if lookup := rctx.DocumentContext().DocumentLookup; lookup != nil {
- if v := rctx.DocumentContext().DocumentLookup(pid); v != nil {
- return v
- }
- }
- }
- return rctx.DocumentContext().Document
-}
-
func (r *hookedRenderer) filterInternalAttributes(attrs []ast.Attribute) []ast.Attribute {
n := 0
for _, x := range attrs {
@@ -288,16 +276,16 @@ func (r *hookedRenderer) renderLink(w util.BufWriter, source []byte, node ast.No
return ast.WalkContinue, nil
}
- pos := ctx.PopPos()
- text := ctx.Buffer.Bytes()[pos:]
- ctx.Buffer.Truncate(pos)
+ text := ctx.PopRenderedString()
+
+ page, pageInner := render.GetPageAndPageInner(ctx)
err := lr.RenderLink(
ctx.RenderContext().Ctx,
w,
linkContext{
- page: ctx.DocumentContext().Document,
- pageInner: r.getPageInner(ctx),
+ page: page,
+ pageInner: pageInner,
destination: string(n.Destination),
title: string(n.Title),
text: hstring.RenderedString(text),
@@ -358,12 +346,14 @@ func (r *hookedRenderer) renderAutoLink(w util.BufWriter, source []byte, node as
url = "mailto:" + url
}
+ page, pageInner := render.GetPageAndPageInner(ctx)
+
err := lr.RenderLink(
ctx.RenderContext().Ctx,
w,
linkContext{
- page: ctx.DocumentContext().Document,
- pageInner: r.getPageInner(ctx),
+ page: page,
+ pageInner: pageInner,
destination: url,
text: hstring.RenderedString(label),
plainText: label,
@@ -435,20 +425,21 @@ func (r *hookedRenderer) renderHeading(w util.BufWriter, source []byte, node ast
return ast.WalkContinue, nil
}
- pos := ctx.PopPos()
- text := ctx.Buffer.Bytes()[pos:]
- ctx.Buffer.Truncate(pos)
+ text := ctx.PopRenderedString()
+
// All ast.Heading nodes are guaranteed to have an attribute called "id"
// that is an array of bytes that encode a valid string.
anchori, _ := n.AttributeString("id")
anchor := anchori.([]byte)
+ page, pageInner := render.GetPageAndPageInner(ctx)
+
err := hr.RenderHeading(
ctx.RenderContext().Ctx,
w,
headingContext{
- page: ctx.DocumentContext().Document,
- pageInner: r.getPageInner(ctx),
+ page: page,
+ pageInner: pageInner,
level: n.Level,
anchor: string(anchor),
text: hstring.RenderedString(text),
diff --git a/markup/goldmark/tables/tables.go b/markup/goldmark/tables/tables.go
new file mode 100644
index 000000000..61c9b893f
--- /dev/null
+++ b/markup/goldmark/tables/tables.go
@@ -0,0 +1,175 @@
+// Copyright 2024 The Hugo Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package tables
+
+import (
+ "github.com/gohugoio/hugo/common/herrors"
+ "github.com/gohugoio/hugo/common/types/hstring"
+ "github.com/gohugoio/hugo/markup/converter/hooks"
+ "github.com/gohugoio/hugo/markup/goldmark/internal/render"
+ "github.com/gohugoio/hugo/markup/internal/attributes"
+ "github.com/yuin/goldmark"
+ "github.com/yuin/goldmark/ast"
+ gast "github.com/yuin/goldmark/extension/ast"
+ "github.com/yuin/goldmark/renderer"
+ "github.com/yuin/goldmark/util"
+)
+
+type (
+ ext struct{}
+ htmlRenderer struct{}
+)
+
+func New() goldmark.Extender {
+ return &ext{}
+}
+
+func (e *ext) Extend(m goldmark.Markdown) {
+ m.Renderer().AddOptions(renderer.WithNodeRenderers(
+ util.Prioritized(newHTMLRenderer(), 100),
+ ))
+}
+
+func newHTMLRenderer() renderer.NodeRenderer {
+ r := &htmlRenderer{}
+ return r
+}
+
+func (r *htmlRenderer) RegisterFuncs(reg renderer.NodeRendererFuncRegisterer) {
+ reg.Register(gast.KindTable, r.renderTable)
+ reg.Register(gast.KindTableHeader, r.renderHeaderOrRow)
+ reg.Register(gast.KindTableRow, r.renderHeaderOrRow)
+ reg.Register(gast.KindTableCell, r.renderCell)
+}
+
+func (r *htmlRenderer) renderTable(w util.BufWriter, source []byte, n ast.Node, entering bool) (ast.WalkStatus, error) {
+ ctx := w.(*render.Context)
+ if entering {
+ // This will be modified below.
+ table := &hooks.Table{}
+ ctx.PushValue(gast.KindTable, table)
+ return ast.WalkContinue, nil
+ }
+
+ v := ctx.PopValue(gast.KindTable)
+ if v == nil {
+ panic("table not found")
+ }
+
+ table := v.(*hooks.Table)
+
+ renderer := ctx.RenderContext().GetRenderer(hooks.TableRendererType, nil)
+ if renderer == nil {
+ panic("table hook renderer not found")
+ }
+
+ ordinal := ctx.GetAndIncrementOrdinal(gast.KindTable)
+
+ tctx := &tableContext{
+ BaseContext: render.NewBaseContext(ctx, renderer, n, source, nil, ordinal),
+ AttributesHolder: attributes.New(n.Attributes(), attributes.AttributesOwnerGeneral),
+ tHead: table.THead,
+ tBody: table.TBody,
+ }
+
+ cr := renderer.(hooks.TableRenderer)
+
+ err := cr.RenderTable(
+ ctx.RenderContext().Ctx,
+ w,
+ tctx,
+ )
+ if err != nil {
+ return ast.WalkContinue, herrors.NewFileErrorFromPos(err, tctx.Position())
+ }
+
+ return ast.WalkContinue, nil
+}
+
+func (r *htmlRenderer) peekTable(ctx *render.Context) *hooks.Table {
+ v := ctx.PeekValue(gast.KindTable)
+ if v == nil {
+ panic("table not found")
+ }
+ return v.(*hooks.Table)
+}
+
+func (r *htmlRenderer) renderCell(w util.BufWriter, source []byte, node ast.Node, entering bool) (ast.WalkStatus, error) {
+ ctx := w.(*render.Context)
+
+ if entering {
+ // Store the current pos so we can capture the rendered text.
+ ctx.PushPos(ctx.Buffer.Len())
+ return ast.WalkContinue, nil
+ }
+
+ n := node.(*gast.TableCell)
+
+ text := ctx.PopRenderedString()
+
+ table := r.peekTable(ctx)
+
+ var alignment string
+ switch n.Alignment {
+ case gast.AlignLeft:
+ alignment = "left"
+ case gast.AlignRight:
+ alignment = "right"
+ case gast.AlignCenter:
+ alignment = "center"
+ default:
+ alignment = "left"
+ }
+
+ cell := hooks.TableCell{Text: hstring.RenderedString(text), Alignment: alignment}
+
+ if node.Parent().Kind() == gast.KindTableHeader {
+ table.THead[len(table.THead)-1] = append(table.THead[len(table.THead)-1], cell)
+ } else {
+ table.TBody[len(table.TBody)-1] = append(table.TBody[len(table.TBody)-1], cell)
+ }
+
+ return ast.WalkContinue, nil
+}
+
+func (r *htmlRenderer) renderHeaderOrRow(w util.BufWriter, source []byte, n ast.Node, entering bool) (ast.WalkStatus, error) {
+ ctx := w.(*render.Context)
+ table := r.peekTable(ctx)
+ if entering {
+ if n.Kind() == gast.KindTableHeader {
+ table.THead = append(table.THead, hooks.TableRow{})
+ } else {
+ table.TBody = append(table.TBody, hooks.TableRow{})
+ }
+ return ast.WalkContinue, nil
+ }
+
+ return ast.WalkContinue, nil
+}
+
+type tableContext struct {
+ hooks.BaseContext
+ *attributes.AttributesHolder
+
+ tHead []hooks.TableRow
+ tBody []hooks.TableRow
+}
+
+func (c *tableContext) THead() []hooks.TableRow {
+ return c.tHead
+}
+
+func (c *tableContext) TBody() []hooks.TableRow {
+ return c.tBody
+}
diff --git a/markup/goldmark/tables/tables_integration_test.go b/markup/goldmark/tables/tables_integration_test.go
new file mode 100644
index 000000000..8055265c8
--- /dev/null
+++ b/markup/goldmark/tables/tables_integration_test.go
@@ -0,0 +1,181 @@
+// Copyright 2024 The Hugo Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package tables_test
+
+import (
+ "testing"
+
+ "github.com/gohugoio/hugo/hugolib"
+)
+
+func TestTableHook(t *testing.T) {
+ t.Parallel()
+ files := `
+-- hugo.toml --
+[markup.goldmark.parser.attribute]
+block = true
+title = true
+-- content/p1.md --
+## Table 1
+
+| Item | In Stock | Price |
+| :---------------- | :------: | ----: |
+| Python Hat | True | 23.99 |
+| SQL Hat | True | 23.99 |
+| Codecademy Tee | False | 19.99 |
+| Codecademy Hoodie | False | 42.99 |
+{.foo foo="bar"}
+
+## Table 2
+
+| Month | Savings |
+| -------- | ------- |
+| January | $250 |
+| February | $80 |
+| March | $420 |
+
+-- layouts/_default/single.html --
+{{ .Content }}
+-- layouts/_default/_markup/render-table.html --
+Attributes: {{ .Attributes }}|
+{{ template "print" (dict "what" (printf "table-%d-thead" $.Ordinal) "rows" .THead) }}
+{{ template "print" (dict "what" (printf "table-%d-tbody" $.Ordinal) "rows" .TBody) }}
+{{ define "print" }}
+ {{ .what }}:{{ range $i, $a := .rows }} {{ $i }}:{{ range $j, $b := . }} {{ $j }}: {{ .Alignment }}: {{ .Text }}|{{ end }}{{ end }}$
+{{ end }}
+
+`
+ b := hugolib.Test(t, files)
+
+ b.AssertFileContent("public/p1/index.html",
+ "Attributes: map[class:foo foo:bar]|",
+ "table-0-thead: 0: 0: left: Item| 1: center: In Stock| 2: right: Price|$",
+ "table-0-tbody: 0: 0: left: Python Hat| 1: center: True| 2: right: 23.99| 1: 0: left: SQL Hat| 1: center: True| 2: right: 23.99| 2: 0: left: Codecademy Tee| 1: center: False| 2: right: 19.99| 3: 0: left: Codecademy Hoodie| 1: center: False| 2: right: 42.99|$",
+ )
+
+ b.AssertFileContent("public/p1/index.html",
+ "table-1-thead: 0: 0: left: Month| 1: left: Savings|$",
+ "table-1-tbody: 0: 0: left: January| 1: left: $250| 1: 0: left: February| 1: left: $80| 2: 0: left: March| 1: left: $420|$",
+ )
+}
+
+func TestTableDefault(t *testing.T) {
+ t.Parallel()
+ files := `
+-- hugo.toml --
+[markup.goldmark.parser.attribute]
+block = true
+title = true
+-- content/p1.md --
+
+## Table 1
+
+| Item | In Stock | Price |
+| :---------------- | :------: | ----: |
+| Python Hat | True | 23.99 |
+| SQL Hat | True | 23.99 |
+| Codecademy Tee | False | 19.99 |
+| Codecademy Hoodie | False | 42.99 |
+{.foo}
+
+
+-- layouts/_default/single.html --
+Summary: {{ .Summary }}
+Content: {{ .Content }}
+
+`
+ b := hugolib.Test(t, files)
+
+ b.AssertFileContent("public/p1/index.html", "")
+}
+
+// Issue 12811.
+func TestTableDefaultRSSAndHTML(t *testing.T) {
+ t.Parallel()
+ files := `
+-- hugo.toml --
+[outputFormats]
+ [outputFormats.rss]
+ weight = 30
+ [outputFormats.html]
+ weight = 20
+-- content/_index.md --
+---
+title: "Home"
+output: ["rss", "html"]
+---
+
+| Item | In Stock | Price |
+| :---------------- | :------: | ----: |
+| Python Hat | True | 23.99 |
+| SQL Hat | True | 23.99 |
+| Codecademy Tee | False | 19.99 |
+| Codecademy Hoodie | False | 42.99 |
+
+{{< foo >}}
+
+-- layouts/index.html --
+Content: {{ .Content }}
+-- layouts/index.xml --
+Content: {{ .Content }}
+-- layouts/shortcodes/foo.xml --
+foo xml
+-- layouts/shortcodes/foo.html --
+foo html
+
+`
+ b := hugolib.Test(t, files)
+
+ b.AssertFileContent("public/index.xml", "")
+ b.AssertFileContent("public/index.html", "")
+}
+
+func TestTableDefaultRSSOnly(t *testing.T) {
+ t.Parallel()
+ files := `
+-- hugo.toml --
+[outputs]
+ home = ['rss']
+ section = ['rss']
+ taxonomy = ['rss']
+ term = ['rss']
+ page = ['rss']
+disableKinds = ["taxonomy", "term", "page", "section"]
+-- content/_index.md --
+---
+title: "Home"
+---
+
+## Table 1
+
+| Item | In Stock | Price |
+| :---------------- | :------: | ----: |
+| Python Hat | True | 23.99 |
+| SQL Hat | True | 23.99 |
+| Codecademy Tee | False | 19.99 |
+| Codecademy Hoodie | False | 42.99 |
+
+
+
+
+
+-- layouts/index.xml --
+Content: {{ .Content }}
+
+
+`
+ b := hugolib.Test(t, files)
+
+ b.AssertFileContent("public/index.xml", "")
+}
diff --git a/tpl/tplimpl/embedded/templates/_default/_markup/render-table.html b/tpl/tplimpl/embedded/templates/_default/_markup/render-table.html
new file mode 100644
index 000000000..307f0a5a3
--- /dev/null
+++ b/tpl/tplimpl/embedded/templates/_default/_markup/render-table.html
@@ -0,0 +1,29 @@
+
+
+ {{- range .THead }}
+
+ {{- range . }}
+
+ {{- .Text | safeHTML -}}
+
+ {{- end }}
+
+ {{- end }}
+
+
+ {{- range .TBody }}
+
+ {{- range . }}
+
+ {{- .Text | safeHTML -}}
+
+ {{- end }}
+
+ {{- end }}
+
+
From 6d97ee711e834ad4a0d2aca44fafb042008a8429 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?=
Date: Sat, 31 Aug 2024 17:25:15 +0200
Subject: [PATCH 032/570] Make all renderhook Text methods return template.HTML
---
common/types/hstring/stringtypes.go | 18 ++++++++++++++++--
common/types/hstring/stringtypes_test.go | 4 ++--
hugolib/content_render_hooks_test.go | 4 ++--
hugolib/page__content.go | 2 +-
markup/converter/hooks/hooks.go | 8 ++++----
markup/goldmark/blockquotes/blockquotes.go | 6 +++---
.../blockquotes_integration_test.go | 4 ++--
markup/goldmark/goldmark_integration_test.go | 12 ++++++------
markup/goldmark/render_hooks.go | 16 ++++++++--------
markup/goldmark/tables/tables.go | 2 +-
.../goldmark/tables/tables_integration_test.go | 4 ++--
.../_default/_markup/render-link.html | 2 +-
.../_default/_markup/render-table.html | 4 ++--
13 files changed, 50 insertions(+), 36 deletions(-)
diff --git a/common/types/hstring/stringtypes.go b/common/types/hstring/stringtypes.go
index 5e8e3a23d..05977ddce 100644
--- a/common/types/hstring/stringtypes.go
+++ b/common/types/hstring/stringtypes.go
@@ -13,8 +13,22 @@
package hstring
-type RenderedString string
+import (
+ "html/template"
-func (s RenderedString) String() string {
+ "github.com/gohugoio/hugo/common/types"
+)
+
+var _ types.PrintableValueProvider = RenderedHTML("")
+
+// RenderedHTML is a string that represents rendered HTML.
+// When printed in templates it will be rendered as template.HTML and considered safe.
+type RenderedHTML string
+
+func (s RenderedHTML) String() string {
return string(s)
}
+
+func (s RenderedHTML) PrintableValue() any {
+ return template.HTML(s)
+}
diff --git a/common/types/hstring/stringtypes_test.go b/common/types/hstring/stringtypes_test.go
index 2f1f865c8..75b7af13c 100644
--- a/common/types/hstring/stringtypes_test.go
+++ b/common/types/hstring/stringtypes_test.go
@@ -25,6 +25,6 @@ func TestRenderedString(t *testing.T) {
c := qt.New(t)
// Validate that it will behave like a string in Hugo settings.
- c.Assert(cast.ToString(RenderedString("Hugo")), qt.Equals, "Hugo")
- c.Assert(template.HTML(RenderedString("Hugo")), qt.Equals, template.HTML("Hugo"))
+ c.Assert(cast.ToString(RenderedHTML("Hugo")), qt.Equals, "Hugo")
+ c.Assert(template.HTML(RenderedHTML("Hugo")), qt.Equals, template.HTML("Hugo"))
}
diff --git a/hugolib/content_render_hooks_test.go b/hugolib/content_render_hooks_test.go
index abe305762..593d01da8 100644
--- a/hugolib/content_render_hooks_test.go
+++ b/hugolib/content_render_hooks_test.go
@@ -98,8 +98,8 @@ baseURL="https://example.org"
P1: {{ $p.Content }}
`,
- "_default/_markup/render-link.html", `html-link: {{ .Destination | safeURL }}|Text: {{ .Text | safeHTML }}|Plain: {{ .PlainText | safeHTML }}`,
- "_default/_markup/render-image.html", `html-image: {{ .Destination | safeURL }}|Text: {{ .Text | safeHTML }}|Plain: {{ .PlainText | safeHTML }}`,
+ "_default/_markup/render-link.html", `html-link: {{ .Destination | safeURL }}|Text: {{ .Text }}|Plain: {{ .PlainText | safeHTML }}`,
+ "_default/_markup/render-image.html", `html-image: {{ .Destination | safeURL }}|Text: {{ .Text }}|Plain: {{ .PlainText | safeHTML }}`,
)
b.WithContent("p1.md", `---
diff --git a/hugolib/page__content.go b/hugolib/page__content.go
index 30caebed0..31080b929 100644
--- a/hugolib/page__content.go
+++ b/hugolib/page__content.go
@@ -928,7 +928,7 @@ func (c *cachedContentScope) RenderString(ctx context.Context, args ...any) (tem
contentToRenderv := args[sidx]
- if _, ok := contentToRenderv.(hstring.RenderedString); ok {
+ if _, ok := contentToRenderv.(hstring.RenderedHTML); ok {
// This content is already rendered, this is potentially
// a infinite recursion.
return "", errors.New("text is already rendered, repeating it may cause infinite recursion")
diff --git a/markup/converter/hooks/hooks.go b/markup/converter/hooks/hooks.go
index 9487fd0a7..0232b619f 100644
--- a/markup/converter/hooks/hooks.go
+++ b/markup/converter/hooks/hooks.go
@@ -41,7 +41,7 @@ type LinkContext interface {
Title() string
// The rendered (HTML) text.
- Text() hstring.RenderedString
+ Text() hstring.RenderedHTML
// The plain variant of Text.
PlainText() string
@@ -100,7 +100,7 @@ type BlockquoteContext interface {
// The blockquote text.
// If type is "alert", this will be the alert text.
- Text() hstring.RenderedString
+ Text() hstring.RenderedHTML
/// Returns the blockquote type, one of "regular" and "alert".
// Type "alert" indicates that this is a GitHub type alert.
@@ -166,7 +166,7 @@ type HeadingContext interface {
// Anchor is the HTML id assigned to the heading.
Anchor() string
// Text is the rendered (HTML) heading text, excluding the heading marker.
- Text() hstring.RenderedString
+ Text() hstring.RenderedHTML
// PlainText is the unrendered version of Text.
PlainText() string
@@ -213,7 +213,7 @@ const (
type GetRendererFunc func(t RendererType, id any) any
type TableCell struct {
- Text hstring.RenderedString
+ Text hstring.RenderedHTML
Alignment string // left, center, or right
}
diff --git a/markup/goldmark/blockquotes/blockquotes.go b/markup/goldmark/blockquotes/blockquotes.go
index a261ec4fe..f68cccd06 100644
--- a/markup/goldmark/blockquotes/blockquotes.go
+++ b/markup/goldmark/blockquotes/blockquotes.go
@@ -95,7 +95,7 @@ func (r *htmlRenderer) renderBlockquote(w util.BufWriter, src []byte, node ast.N
BaseContext: render.NewBaseContext(ctx, renderer, n, src, nil, ordinal),
typ: typ,
alertType: alertType,
- text: hstring.RenderedString(text),
+ text: hstring.RenderedHTML(text),
AttributesHolder: attributes.New(n.Attributes(), attributes.AttributesOwnerGeneral),
}
@@ -134,7 +134,7 @@ func (r *htmlRenderer) renderBlockquoteDefault(
type blockquoteContext struct {
hooks.BaseContext
- text hstring.RenderedString
+ text hstring.RenderedHTML
alertType string
typ string
@@ -149,7 +149,7 @@ func (c *blockquoteContext) AlertType() string {
return c.alertType
}
-func (c *blockquoteContext) Text() hstring.RenderedString {
+func (c *blockquoteContext) Text() hstring.RenderedHTML {
return c.text
}
diff --git a/markup/goldmark/blockquotes/blockquotes_integration_test.go b/markup/goldmark/blockquotes/blockquotes_integration_test.go
index e4447e5e9..f12600b42 100644
--- a/markup/goldmark/blockquotes/blockquotes_integration_test.go
+++ b/markup/goldmark/blockquotes/blockquotes_integration_test.go
@@ -32,9 +32,9 @@ func TestBlockquoteHook(t *testing.T) {
block = true
title = true
-- layouts/_default/_markup/render-blockquote.html --
-Blockquote: |{{ .Text | safeHTML }}|{{ .Type }}|
+Blockquote: |{{ .Text }}|{{ .Type }}|
-- layouts/_default/_markup/render-blockquote-alert.html --
-{{ $text := .Text | safeHTML }}
+{{ $text := .Text }}
Blockquote Alert: |{{ $text }}|{{ .Type }}|
Blockquote Alert Attributes: |{{ $text }}|{{ .Attributes }}|
Blockquote Alert Page: |{{ $text }}|{{ .Page.Title }}|{{ .PageInner.Title }}|
diff --git a/markup/goldmark/goldmark_integration_test.go b/markup/goldmark/goldmark_integration_test.go
index 19338310c..c691435ee 100644
--- a/markup/goldmark/goldmark_integration_test.go
+++ b/markup/goldmark/goldmark_integration_test.go
@@ -76,7 +76,7 @@ title: "p1"
{{- range $k, $v := .Attributes -}}
{{- printf " %s=%q" $k $v | safeHTMLAttr -}}
{{- end -}}
->{{ .Text | safeHTML }}
+>{{ .Text }}
`
b := hugolib.Test(t, files)
@@ -146,11 +146,11 @@ title: "p1"
{{ .Content }}
-- layouts/_default/_markup/render-heading.html --
- {{ .Text | safeHTML }}
+ {{ .Text }}
#
-- layouts/_default/_markup/render-link.html --
-{{ .Text | safeHTML }}
+{{ .Text }}
`
@@ -236,11 +236,11 @@ func BenchmarkRenderHooks(b *testing.B) {
-- config.toml --
-- layouts/_default/_markup/render-heading.html --
- {{ .Text | safeHTML }}
+ {{ .Text }}
#
-- layouts/_default/_markup/render-link.html --
-{{ .Text | safeHTML }}
+{{ .Text }}
-- layouts/_default/single.html --
{{ .Content }}
`
@@ -452,7 +452,7 @@ Link https procol: https://www.example.org
if withHook {
files += `-- layouts/_default/_markup/render-link.html --
-{{ .Text | safeHTML }} `
+{{ .Text }} `
}
return hugolib.NewIntegrationTestBuilder(
diff --git a/markup/goldmark/render_hooks.go b/markup/goldmark/render_hooks.go
index 790b2f4ca..d72300434 100644
--- a/markup/goldmark/render_hooks.go
+++ b/markup/goldmark/render_hooks.go
@@ -52,7 +52,7 @@ type linkContext struct {
pageInner any
destination string
title string
- text hstring.RenderedString
+ text hstring.RenderedHTML
plainText string
*attributes.AttributesHolder
}
@@ -69,7 +69,7 @@ func (ctx linkContext) PageInner() any {
return ctx.pageInner
}
-func (ctx linkContext) Text() hstring.RenderedString {
+func (ctx linkContext) Text() hstring.RenderedHTML {
return ctx.text
}
@@ -100,7 +100,7 @@ type headingContext struct {
pageInner any
level int
anchor string
- text hstring.RenderedString
+ text hstring.RenderedHTML
plainText string
*attributes.AttributesHolder
}
@@ -121,7 +121,7 @@ func (ctx headingContext) Anchor() string {
return ctx.anchor
}
-func (ctx headingContext) Text() hstring.RenderedString {
+func (ctx headingContext) Text() hstring.RenderedHTML {
return ctx.text
}
@@ -199,7 +199,7 @@ func (r *hookedRenderer) renderImage(w util.BufWriter, source []byte, node ast.N
pageInner: pageInner,
destination: string(n.Destination),
title: string(n.Title),
- text: hstring.RenderedString(text),
+ text: hstring.RenderedHTML(text),
plainText: string(n.Text(source)),
AttributesHolder: attributes.New(attrs, attributes.AttributesOwnerGeneral),
},
@@ -288,7 +288,7 @@ func (r *hookedRenderer) renderLink(w util.BufWriter, source []byte, node ast.No
pageInner: pageInner,
destination: string(n.Destination),
title: string(n.Title),
- text: hstring.RenderedString(text),
+ text: hstring.RenderedHTML(text),
plainText: string(n.Text(source)),
AttributesHolder: attributes.Empty,
},
@@ -355,7 +355,7 @@ func (r *hookedRenderer) renderAutoLink(w util.BufWriter, source []byte, node as
page: page,
pageInner: pageInner,
destination: url,
- text: hstring.RenderedString(label),
+ text: hstring.RenderedHTML(label),
plainText: label,
AttributesHolder: attributes.Empty,
},
@@ -442,7 +442,7 @@ func (r *hookedRenderer) renderHeading(w util.BufWriter, source []byte, node ast
pageInner: pageInner,
level: n.Level,
anchor: string(anchor),
- text: hstring.RenderedString(text),
+ text: hstring.RenderedHTML(text),
plainText: string(n.Text(source)),
AttributesHolder: attributes.New(n.Attributes(), attributes.AttributesOwnerGeneral),
},
diff --git a/markup/goldmark/tables/tables.go b/markup/goldmark/tables/tables.go
index 61c9b893f..943da974e 100644
--- a/markup/goldmark/tables/tables.go
+++ b/markup/goldmark/tables/tables.go
@@ -132,7 +132,7 @@ func (r *htmlRenderer) renderCell(w util.BufWriter, source []byte, node ast.Node
alignment = "left"
}
- cell := hooks.TableCell{Text: hstring.RenderedString(text), Alignment: alignment}
+ cell := hooks.TableCell{Text: hstring.RenderedHTML(text), Alignment: alignment}
if node.Parent().Kind() == gast.KindTableHeader {
table.THead[len(table.THead)-1] = append(table.THead[len(table.THead)-1], cell)
diff --git a/markup/goldmark/tables/tables_integration_test.go b/markup/goldmark/tables/tables_integration_test.go
index 8055265c8..dadce5c81 100644
--- a/markup/goldmark/tables/tables_integration_test.go
+++ b/markup/goldmark/tables/tables_integration_test.go
@@ -32,7 +32,7 @@ title = true
| Item | In Stock | Price |
| :---------------- | :------: | ----: |
| Python Hat | True | 23.99 |
-| SQL Hat | True | 23.99 |
+| SQL **Hat** | True | 23.99 |
| Codecademy Tee | False | 19.99 |
| Codecademy Hoodie | False | 42.99 |
{.foo foo="bar"}
@@ -61,7 +61,7 @@ Attributes: {{ .Attributes }}|
b.AssertFileContent("public/p1/index.html",
"Attributes: map[class:foo foo:bar]|",
"table-0-thead: 0: 0: left: Item| 1: center: In Stock| 2: right: Price|$",
- "table-0-tbody: 0: 0: left: Python Hat| 1: center: True| 2: right: 23.99| 1: 0: left: SQL Hat| 1: center: True| 2: right: 23.99| 2: 0: left: Codecademy Tee| 1: center: False| 2: right: 19.99| 3: 0: left: Codecademy Hoodie| 1: center: False| 2: right: 42.99|$",
+ "table-0-tbody: 0: 0: left: Python Hat| 1: center: True| 2: right: 23.99| 1: 0: left: SQL Hat | 1: center: True| 2: right: 23.99| 2: 0: left: Codecademy Tee| 1: center: False| 2: right: 19.99| 3: 0: left: Codecademy Hoodie| 1: center: False| 2: right: 42.99|$",
)
b.AssertFileContent("public/p1/index.html",
diff --git a/tpl/tplimpl/embedded/templates/_default/_markup/render-link.html b/tpl/tplimpl/embedded/templates/_default/_markup/render-link.html
index daf3f11e1..f82158a2d 100644
--- a/tpl/tplimpl/embedded/templates/_default/_markup/render-link.html
+++ b/tpl/tplimpl/embedded/templates/_default/_markup/render-link.html
@@ -25,5 +25,5 @@
{{- printf " %s=%q" $k $v | safeHTMLAttr -}}
{{- end -}}
{{- end -}}
- >{{ .Text | safeHTML }}
+ >{{ .Text }}
{{- /**/ -}}
diff --git a/tpl/tplimpl/embedded/templates/_default/_markup/render-table.html b/tpl/tplimpl/embedded/templates/_default/_markup/render-table.html
index 307f0a5a3..a0b0cc34d 100644
--- a/tpl/tplimpl/embedded/templates/_default/_markup/render-table.html
+++ b/tpl/tplimpl/embedded/templates/_default/_markup/render-table.html
@@ -9,7 +9,7 @@
{{- range . }}
- {{- .Text | safeHTML -}}
+ {{- .Text -}}
{{- end }}
@@ -20,7 +20,7 @@
{{- range . }}
- {{- .Text | safeHTML -}}
+ {{- .Text -}}
{{- end }}
From 96afea4acc7ca8cdfce460127b8ae17e303c77c0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?=
Date: Sat, 31 Aug 2024 18:07:57 +0200
Subject: [PATCH 033/570] github: Try to fix "no space left on device" on MacOS
---
.github/workflows/test.yml | 2 +-
magefile.go | 14 +++++++++++++-
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 120262098..b513863c5 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
go-version: [1.22.x, 1.23.x]
- os: [ubuntu-latest, macos-latest, windows-latest]
+ os: [ubuntu-latest, windows-latest] # macos disabled for now because of disk space issues.
runs-on: ${{ matrix.os }}
steps:
- if: matrix.os == 'ubuntu-latest'
diff --git a/magefile.go b/magefile.go
index ce2cd41ea..142b9160a 100644
--- a/magefile.go
+++ b/magefile.go
@@ -148,7 +148,11 @@ func Check() {
fmt.Printf("Skip Test386 on %s and/or %s\n", runtime.GOARCH, runtime.GOOS)
}
- mg.Deps(Fmt, Vet)
+ if isCi() && isDarwin() {
+ // Skip on macOS in CI (disk space issues)
+ } else {
+ mg.Deps(Fmt, Vet)
+ }
// don't run two tests in parallel, they saturate the CPUs anyway, and running two
// causes memory issues in CI.
@@ -239,6 +243,14 @@ func Lint() error {
return nil
}
+func isCi() bool {
+ return os.Getenv("CI") != ""
+}
+
+func isDarwin() bool {
+ return runtime.GOOS == "darwin"
+}
+
// Run go vet linter
func Vet() error {
if err := sh.Run(goexe, "vet", "./..."); err != nil {
From 469124823c8cb4477816686f56efdeebc79a9044 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?=
Date: Sun, 1 Sep 2024 10:03:10 +0200
Subject: [PATCH 034/570] Rename hstring.RenderedHTML => hstring.HTML
And add a comment about why it exists.
---
common/types/hstring/stringtypes.go | 14 ++++++++------
common/types/hstring/stringtypes_test.go | 4 ++--
hugolib/page__content.go | 2 +-
markup/converter/hooks/hooks.go | 8 ++++----
markup/goldmark/blockquotes/blockquotes.go | 6 +++---
markup/goldmark/render_hooks.go | 16 ++++++++--------
markup/goldmark/tables/tables.go | 2 +-
7 files changed, 27 insertions(+), 25 deletions(-)
diff --git a/common/types/hstring/stringtypes.go b/common/types/hstring/stringtypes.go
index 05977ddce..53ce2068f 100644
--- a/common/types/hstring/stringtypes.go
+++ b/common/types/hstring/stringtypes.go
@@ -19,16 +19,18 @@ import (
"github.com/gohugoio/hugo/common/types"
)
-var _ types.PrintableValueProvider = RenderedHTML("")
+var _ types.PrintableValueProvider = HTML("")
-// RenderedHTML is a string that represents rendered HTML.
-// When printed in templates it will be rendered as template.HTML and considered safe.
-type RenderedHTML string
+// HTML is a string that represents rendered HTML.
+// When printed in templates it will be rendered as template.HTML and considered safe so no need to pipe it into `safeHTML`.
+// This type was introduced as a wasy to prevent a common case of inifinite recursion in the template rendering
+// when the `linkify` option is enabled with a common (wrong) construct like `{{ .Text | .Page.RenderString }}` in a hook template.
+type HTML string
-func (s RenderedHTML) String() string {
+func (s HTML) String() string {
return string(s)
}
-func (s RenderedHTML) PrintableValue() any {
+func (s HTML) PrintableValue() any {
return template.HTML(s)
}
diff --git a/common/types/hstring/stringtypes_test.go b/common/types/hstring/stringtypes_test.go
index 75b7af13c..05e2c22b9 100644
--- a/common/types/hstring/stringtypes_test.go
+++ b/common/types/hstring/stringtypes_test.go
@@ -25,6 +25,6 @@ func TestRenderedString(t *testing.T) {
c := qt.New(t)
// Validate that it will behave like a string in Hugo settings.
- c.Assert(cast.ToString(RenderedHTML("Hugo")), qt.Equals, "Hugo")
- c.Assert(template.HTML(RenderedHTML("Hugo")), qt.Equals, template.HTML("Hugo"))
+ c.Assert(cast.ToString(HTML("Hugo")), qt.Equals, "Hugo")
+ c.Assert(template.HTML(HTML("Hugo")), qt.Equals, template.HTML("Hugo"))
}
diff --git a/hugolib/page__content.go b/hugolib/page__content.go
index 31080b929..cc93fe5d5 100644
--- a/hugolib/page__content.go
+++ b/hugolib/page__content.go
@@ -928,7 +928,7 @@ func (c *cachedContentScope) RenderString(ctx context.Context, args ...any) (tem
contentToRenderv := args[sidx]
- if _, ok := contentToRenderv.(hstring.RenderedHTML); ok {
+ if _, ok := contentToRenderv.(hstring.HTML); ok {
// This content is already rendered, this is potentially
// a infinite recursion.
return "", errors.New("text is already rendered, repeating it may cause infinite recursion")
diff --git a/markup/converter/hooks/hooks.go b/markup/converter/hooks/hooks.go
index 0232b619f..96c165321 100644
--- a/markup/converter/hooks/hooks.go
+++ b/markup/converter/hooks/hooks.go
@@ -41,7 +41,7 @@ type LinkContext interface {
Title() string
// The rendered (HTML) text.
- Text() hstring.RenderedHTML
+ Text() hstring.HTML
// The plain variant of Text.
PlainText() string
@@ -100,7 +100,7 @@ type BlockquoteContext interface {
// The blockquote text.
// If type is "alert", this will be the alert text.
- Text() hstring.RenderedHTML
+ Text() hstring.HTML
/// Returns the blockquote type, one of "regular" and "alert".
// Type "alert" indicates that this is a GitHub type alert.
@@ -166,7 +166,7 @@ type HeadingContext interface {
// Anchor is the HTML id assigned to the heading.
Anchor() string
// Text is the rendered (HTML) heading text, excluding the heading marker.
- Text() hstring.RenderedHTML
+ Text() hstring.HTML
// PlainText is the unrendered version of Text.
PlainText() string
@@ -213,7 +213,7 @@ const (
type GetRendererFunc func(t RendererType, id any) any
type TableCell struct {
- Text hstring.RenderedHTML
+ Text hstring.HTML
Alignment string // left, center, or right
}
diff --git a/markup/goldmark/blockquotes/blockquotes.go b/markup/goldmark/blockquotes/blockquotes.go
index f68cccd06..bf1e848b8 100644
--- a/markup/goldmark/blockquotes/blockquotes.go
+++ b/markup/goldmark/blockquotes/blockquotes.go
@@ -95,7 +95,7 @@ func (r *htmlRenderer) renderBlockquote(w util.BufWriter, src []byte, node ast.N
BaseContext: render.NewBaseContext(ctx, renderer, n, src, nil, ordinal),
typ: typ,
alertType: alertType,
- text: hstring.RenderedHTML(text),
+ text: hstring.HTML(text),
AttributesHolder: attributes.New(n.Attributes(), attributes.AttributesOwnerGeneral),
}
@@ -134,7 +134,7 @@ func (r *htmlRenderer) renderBlockquoteDefault(
type blockquoteContext struct {
hooks.BaseContext
- text hstring.RenderedHTML
+ text hstring.HTML
alertType string
typ string
@@ -149,7 +149,7 @@ func (c *blockquoteContext) AlertType() string {
return c.alertType
}
-func (c *blockquoteContext) Text() hstring.RenderedHTML {
+func (c *blockquoteContext) Text() hstring.HTML {
return c.text
}
diff --git a/markup/goldmark/render_hooks.go b/markup/goldmark/render_hooks.go
index d72300434..bacb41a37 100644
--- a/markup/goldmark/render_hooks.go
+++ b/markup/goldmark/render_hooks.go
@@ -52,7 +52,7 @@ type linkContext struct {
pageInner any
destination string
title string
- text hstring.RenderedHTML
+ text hstring.HTML
plainText string
*attributes.AttributesHolder
}
@@ -69,7 +69,7 @@ func (ctx linkContext) PageInner() any {
return ctx.pageInner
}
-func (ctx linkContext) Text() hstring.RenderedHTML {
+func (ctx linkContext) Text() hstring.HTML {
return ctx.text
}
@@ -100,7 +100,7 @@ type headingContext struct {
pageInner any
level int
anchor string
- text hstring.RenderedHTML
+ text hstring.HTML
plainText string
*attributes.AttributesHolder
}
@@ -121,7 +121,7 @@ func (ctx headingContext) Anchor() string {
return ctx.anchor
}
-func (ctx headingContext) Text() hstring.RenderedHTML {
+func (ctx headingContext) Text() hstring.HTML {
return ctx.text
}
@@ -199,7 +199,7 @@ func (r *hookedRenderer) renderImage(w util.BufWriter, source []byte, node ast.N
pageInner: pageInner,
destination: string(n.Destination),
title: string(n.Title),
- text: hstring.RenderedHTML(text),
+ text: hstring.HTML(text),
plainText: string(n.Text(source)),
AttributesHolder: attributes.New(attrs, attributes.AttributesOwnerGeneral),
},
@@ -288,7 +288,7 @@ func (r *hookedRenderer) renderLink(w util.BufWriter, source []byte, node ast.No
pageInner: pageInner,
destination: string(n.Destination),
title: string(n.Title),
- text: hstring.RenderedHTML(text),
+ text: hstring.HTML(text),
plainText: string(n.Text(source)),
AttributesHolder: attributes.Empty,
},
@@ -355,7 +355,7 @@ func (r *hookedRenderer) renderAutoLink(w util.BufWriter, source []byte, node as
page: page,
pageInner: pageInner,
destination: url,
- text: hstring.RenderedHTML(label),
+ text: hstring.HTML(label),
plainText: label,
AttributesHolder: attributes.Empty,
},
@@ -442,7 +442,7 @@ func (r *hookedRenderer) renderHeading(w util.BufWriter, source []byte, node ast
pageInner: pageInner,
level: n.Level,
anchor: string(anchor),
- text: hstring.RenderedHTML(text),
+ text: hstring.HTML(text),
plainText: string(n.Text(source)),
AttributesHolder: attributes.New(n.Attributes(), attributes.AttributesOwnerGeneral),
},
diff --git a/markup/goldmark/tables/tables.go b/markup/goldmark/tables/tables.go
index 943da974e..0aa6ee269 100644
--- a/markup/goldmark/tables/tables.go
+++ b/markup/goldmark/tables/tables.go
@@ -132,7 +132,7 @@ func (r *htmlRenderer) renderCell(w util.BufWriter, source []byte, node ast.Node
alignment = "left"
}
- cell := hooks.TableCell{Text: hstring.RenderedHTML(text), Alignment: alignment}
+ cell := hooks.TableCell{Text: hstring.HTML(text), Alignment: alignment}
if node.Parent().Kind() == gast.KindTableHeader {
table.THead[len(table.THead)-1] = append(table.THead[len(table.THead)-1], cell)
From dec8cd4ada29218971743333f8ac662a9c06aad8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?=
Date: Sun, 1 Sep 2024 14:51:15 +0200
Subject: [PATCH 035/570] Squashed 'docs/' changes from fcc3ed651..a49697e53
a49697e53 Add private use subtag requirements to multilingual page
a5c6bb4da Add INFINI Pizza search engine
45b732efa Fix template lookup order for AMP pages
30c672d0b netlify: Hugo 0.133.1
7c766e724 Update page resources documentation
ca802fbec Document how to enable AsciiDoc syntax highlighting
c3350f4cf Update definition of falsy to include zero time.Time values
b0e5ab051 Fir typo
60f6cb63b Update migrations.md
ec52c7ba1 Improve formatting of example code
e5681ad01 Improve formatting of example code
bdf3ffc73 Clarify the various next/prev methods
b5505d22a Clarify template lookup order for shortcodes
cf8dd7034 Improve embedded.md
e5dee2651 Update transform.ToMath
4d419a128 Update pagination configuration to use new struct
05d4fd597 Update PrevInSection.md
fd33370ed Add new-in 0.133.0
f9062042f Add the new page config section
205645e97 Remove out-dated new-in
3ed3673f7 Fix typo
41df91659 Document the 'else with' construct introduced with Go 1.23
9c4697ab3 netlify: Hugo 0.133.0
62506b052 Merge branch 'temp133'
877e1bfcd Add config options page.nextPrevSortOrder/nextPrevInSectionSortOrder
eb159fe62 Update menu.md
efa7795a0 Update theme
dbe8911ad netlify: Hugo 0.132.2
2f793d328 Document passthrough render hooks
a7ce9a5e8 netlify: Hugo 0.132.1
2c137cb48 Update blockquotes.md
e0fa2f0d1 Add new-in badge to blockquote render hook page
bf42bbe6b Update references to render hooks
85a3d9958 Update theme
2dae72128 Document blockquote render hooks
8f5afb55d Update plainify return type
160f22d0e netlify: Hugo 0.132.0
82b5586fb Document transform.ToMath
1efcbcddb tpl/transform: Make Plainify and ToMath return template.HTML
31727be2e docs: Regen docshelper
88a421426 Merge commit 'a6e635ca7d905d9ec3ffd708db2694f680b03aae'
git-subtree-dir: docs
git-subtree-split: a49697e536ee0d477ab4e552cfa8dc74debeff27
---
.../layouts/_default/documentation-home.html | 2 +-
.../gohugoioTheme/layouts/_default/list.html | 2 +-
.../layouts/shortcodes/gomodules-info.html | 3 +-
_vendor/modules.txt | 2 +-
content/en/about/features.md | 2 +-
.../en/content-management/content-adapters.md | 4 +-
content/en/content-management/multilingual.md | 17 +-
.../en/content-management/page-resources.md | 127 +++---
content/en/contribute/development.md | 2 +-
.../go-template/_common/truthy-falsy.md | 4 +-
content/en/functions/go-template/if.md | 2 +-
content/en/functions/go-template/with.md | 14 +
content/en/functions/transform/Plainify.md | 2 +-
content/en/functions/transform/ToMath.md | 112 +++++
.../getting-started/configuration-markup.md | 47 ++-
content/en/getting-started/configuration.md | 51 ++-
content/en/methods/_common/_index.md | 13 -
...next-prev-on-page-vs-next-prev-on-pages.md | 37 --
content/en/methods/page/Next.md | 40 +-
content/en/methods/page/NextInSection.md | 60 +--
content/en/methods/page/Prev.md | 44 +-
content/en/methods/page/PrevInSection.md | 61 +--
.../en/methods/page/_common/next-and-prev.md | 60 +++
.../nextinsection-and-previnsection.md | 78 ++++
content/en/methods/pages/Next.md | 44 +-
content/en/methods/pages/Prev.md | 44 +-
.../en/methods/pages/_common/next-and-prev.md | 72 ++++
content/en/render-hooks/blockquotes.md | 171 ++++++++
content/en/render-hooks/code-blocks.md | 4 +-
content/en/render-hooks/headings.md | 8 +-
content/en/render-hooks/images.md | 8 +-
content/en/render-hooks/introduction.md | 3 +
content/en/render-hooks/links.md | 4 +-
content/en/render-hooks/passthrough.md | 125 ++++++
content/en/templates/embedded.md | 4 +-
content/en/templates/introduction.md | 14 +
content/en/templates/menu.md | 2 +-
content/en/templates/shortcode.md | 25 +-
content/en/tools/migrations.md | 14 +-
content/en/tools/search.md | 4 +
data/docs.yaml | 31 +-
go.mod | 2 +-
go.sum | 4 +
hugo.toml | 4 +-
layouts/shortcodes/img.html | 381 ++++++++++++++++++
netlify.toml | 2 +-
46 files changed, 1309 insertions(+), 447 deletions(-)
create mode 100644 content/en/functions/transform/ToMath.md
delete mode 100644 content/en/methods/_common/_index.md
delete mode 100644 content/en/methods/_common/next-prev-on-page-vs-next-prev-on-pages.md
create mode 100644 content/en/methods/page/_common/next-and-prev.md
create mode 100644 content/en/methods/page/_common/nextinsection-and-previnsection.md
create mode 100644 content/en/methods/pages/_common/next-and-prev.md
create mode 100755 content/en/render-hooks/blockquotes.md
create mode 100755 content/en/render-hooks/passthrough.md
create mode 100644 layouts/shortcodes/img.html
diff --git a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/_default/documentation-home.html b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/_default/documentation-home.html
index 91f744c30..f3cf291be 100644
--- a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/_default/documentation-home.html
+++ b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/_default/documentation-home.html
@@ -1,4 +1,4 @@
{{ define "main" }}
-{{ $section_to_display := (.Site.Taxonomies.categories.fundamentals).Pages | lang.Merge (.Sites.First.Taxonomies.categories.fundamentals).Pages }}
+{{ $section_to_display := (.Site.Taxonomies.categories.fundamentals).Pages | lang.Merge (.Sites.Default.Taxonomies.categories.fundamentals).Pages }}
{{ partial "pagelayout.html" (dict "context" . "section_to_display" $section_to_display ) }}
{{ end }}
diff --git a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/_default/list.html b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/_default/list.html
index 3b7a2307e..94057aafe 100644
--- a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/_default/list.html
+++ b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/_default/list.html
@@ -1,5 +1,5 @@
{{ define "main" }}
- {{ $paginator := .Paginate (.Pages | lang.Merge (where .Sites.First.RegularPages "Section" .Section)) }}
+ {{ $paginator := .Paginate (.Pages | lang.Merge (where .Sites.Default.RegularPages "Section" .Section)) }}
{{ $section_to_display := .Sections | default $paginator.Pages }}
{{ partial "pagelayout.html" (dict "context" . "section_to_display" $section_to_display ) }}
{{ end }}
diff --git a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/gomodules-info.html b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/gomodules-info.html
index b56758ac3..31d860394 100644
--- a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/gomodules-info.html
+++ b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/gomodules-info.html
@@ -1,5 +1,6 @@
{{ $text := `
-Most of the commands for **Hugo Modules** require a newer version of Go installed (see https://golang.org/dl/) and the relevant VCS client (e.g. Git, see https://git-scm.com/downloads/ ). If you have an "older" site running on Netlify, you may have to set GO_VERSION to 1.12 in your Environment settings.
+Most of the commands for **Hugo Modules** require a newer version (>= 1.18) of Go installed (see https://golang.org/dl/) and the relevant VCS client (e.g. Git, see https://git-scm.com/downloads/ ).
+If you have an "older" site running on Netlify, you may have to set GO_VERSION to 1.19 or newer in your Environment settings.
For more information about Go Modules, see:
diff --git a/_vendor/modules.txt b/_vendor/modules.txt
index 1bde873a0..492b3e6ac 100644
--- a/_vendor/modules.txt
+++ b/_vendor/modules.txt
@@ -1 +1 @@
-# github.com/gohugoio/gohugoioTheme v0.0.0-20240728210410-d42c342ce472
+# github.com/gohugoio/gohugoioTheme v0.0.0-20240815082608-66ccd383a90f
diff --git a/content/en/about/features.md b/content/en/about/features.md
index cb710aa4b..835384723 100644
--- a/content/en/about/features.md
+++ b/content/en/about/features.md
@@ -49,7 +49,7 @@ toc: true
: Leverage the embedded Markdown extensions to create tables, definition lists, footnotes, task lists, inserted text, mark text, subscripts, superscripts, and more.
[Markdown render hooks]
-: Override the conversion of Markdown to HTML when rendering fenced code blocks, headings, images, and links. For example, render every standalone image as an HTML `figure` element.
+: Override the conversion of Markdown to HTML when rendering blockquotes, fenced code blocks, headings, images, and links. For example, render every standalone image as an HTML `figure` element.
[Diagrams]
: Use fenced code blocks and Markdown render hooks to include diagrams in your content.
diff --git a/content/en/content-management/content-adapters.md b/content/en/content-management/content-adapters.md
index ea5ec62ca..4d5bd0890 100644
--- a/content/en/content-management/content-adapters.md
+++ b/content/en/content-management/content-adapters.md
@@ -125,7 +125,7 @@ Set any [front matter field] in the map passed to the [`AddPage`](#addpage) meth
This table describes the fields most commonly passed to the `AddPage` method.
-Key|Descripion|Required
+Key|Description|Required
:--|:--|:-:
`content.mediaType`|The content [media type]. Default is `text/markdown`. See [content formats] for examples.|
`content.value`|The content value as a string.|
@@ -148,7 +148,7 @@ When setting the `path`, Hugo transforms the given string to a logical path. For
Construct the map passed to the [`AddResource`](#addresource) method using the fields below.
-Key|Descripion|Required
+Key|Description|Required
:--|:--|:-:
`content.mediaType`|The content [media type].|:heavy_check_mark:
`content.value`|The content value as a string or resource.|:heavy_check_mark:
diff --git a/content/en/content-management/multilingual.md b/content/en/content-management/multilingual.md
index 4529eb1c4..b8ba80dfd 100644
--- a/content/en/content-management/multilingual.md
+++ b/content/en/content-management/multilingual.md
@@ -21,15 +21,22 @@ This is the default language configuration:
In the above, `en` is the language key.
-{{% note %}}
-Each language key must conform to the syntax described in [RFC 5646]. You must use hyphens to separate subtags. For example:
+
+Language keys must conform to the syntax described in [RFC 5646]. For example:
- `en`
-- `en-GB`
-- `pt-BR`
+- `en-US`
+
+Artificial languages with private use subtags as defined in [RFC 5646 § 2.2.7] are also supported. Omit the `art-x-` prefix from the language key. For example:
+
+- `hugolang`
+
+{{% note %}}
+Private use subtags must not exceed 8 alphanumeric characters.
+{{% /note %}}
[RFC 5646]: https://datatracker.ietf.org/doc/html/rfc5646#section-2.1
-{{% /note %}}
+[RFC 5646 § 2.2.7]: https://datatracker.ietf.org/doc/html/rfc5646#section-2.2.7
This is an example of a site configuration for a multilingual project. Any key not defined in a `languages` object will fall back to the global value in the root of your site configuration.
diff --git a/content/en/content-management/page-resources.md b/content/en/content-management/page-resources.md
index 6f746488c..4f902a67f 100644
--- a/content/en/content-management/page-resources.md
+++ b/content/en/content-management/page-resources.md
@@ -1,6 +1,6 @@
---
title: Page resources
-description: Page resources -- images, other pages, documents, etc. -- have page-relative URLs and their own metadata.
+description: Use page resources to logically associate assets with a page.
categories: [content management]
keywords: [bundle,content,resources]
menu:
@@ -37,82 +37,83 @@ content
└── index.md (root of page bundle)
```
-## Properties
+## Examples
-ResourceType
-: The main type of the resource's [Media Type](/templates/output-formats/#media-types). For example, a file of MIME type `image/jpeg` has the ResourceType `image`. A `Page` will have `ResourceType` with value `page`.
+Use any of these methods on a `Page` object to capture page resources:
-Name
-: Default value is the file name (relative to the owning page). Can be set in front matter.
+ - [`Resources.ByType`]
+ - [`Resources.Get`]
+ - [`Resources.GetMatch`]
+ - [`Resources.Match`]
-Title
-: Default value is the same as `.Name`. Can be set in front matter.
+ Once you have captured a resource, use any of the applicable [`Resource`] methods to return a value or perform an action.
-Permalink
-: The absolute URL to the resource. Resources of type `page` will have no value.
+[`Resource`]: /methods/resource
+[`Resources.ByType`]: /methods/page/resources#bytype
+[`Resources.GetMatch`]: /methods/page/resources#getmatch
+[`Resources.Get`]: /methods/page/resources#get
+[`Resources.Match`]: /methods/page/resources#match
-RelPermalink
-: The relative URL to the resource. Resources of type `page` will have no value.
+The following examples assume this content structure:
-Content
-: The content of the resource itself. For most resources, this returns a string
-with the contents of the file. Use this to create inline resources.
+```text
+content/
+└── example/
+ ├── data/
+ │ └── books.json <-- page resource
+ ├── images/
+ │ ├── a.jpg <-- page resource
+ │ └── b.jpg <-- page resource
+ ├── snippets/
+ │ └── text.md <-- page resource
+ └── index.md
+```
+
+Render a single image, and throw an error if the file does not exist:
```go-html-template
-{{ with .Resources.GetMatch "script.js" }}
-
-{{ end }}
-
-{{ with .Resources.GetMatch "style.css" }}
-
-{{ end }}
-
-{{ with .Resources.GetMatch "img.png" }}
-
+{{ $path := "images/a.jpg" }}
+{{ with .Resources.Get $path }}
+
+{{ else }}
+ {{ errorf "Unable to get page resource %q" $path }}
{{ end }}
```
-MediaType.Type
-: The media type (formerly known as a MIME type) of the resource (e.g., `image/jpeg`).
-
-MediaType.MainType
-: The main type of the resource's media type (e.g., `image`).
-
-MediaType.SubType
-: The subtype of the resource's type (e.g., `jpeg`). This may or may not correspond to the file suffix.
-
-MediaType.Suffixes
-: A slice of possible file suffixes for the resource's media type (e.g., `[jpg jpeg jpe jif jfif]`).
-
-## Methods
-
-ByType
-: Returns the page resources of the given type.
+Render all images, resized to 300 px wide:
```go-html-template
-{{ .Resources.ByType "image" }}
+{{ range .Resources.ByType "image" }}
+ {{ with .Resize "300x" }}
+
+ {{ end }}
+{{ end }}
```
-Match
-: Returns all the page resources (as a slice) whose `Name` matches the given Glob pattern ([examples](https://github.com/gobwas/glob/blob/master/readme.md)). The matching is case-insensitive.
+
+Render the markdown snippet:
```go-html-template
-{{ .Resources.Match "images/*" }}
+{{ with .Resources.Get "snippets/text.md" }}
+ {{ .Content }}
+{{ end }}
```
-GetMatch
-: Same as `Match` but will return the first match.
+List the titles in the data file, and throw an error if the file does not exist.
-### Pattern matching
-
-```go
-// Using Match/GetMatch to find this images/sunset.jpg ?
-.Resources.Match "images/sun*" ✅
-.Resources.Match "**/sunset.jpg" ✅
-.Resources.Match "images/*.jpg" ✅
-.Resources.Match "**.jpg" ✅
-.Resources.Match "*" 🚫
-.Resources.Match "sunset.jpg" 🚫
-.Resources.Match "*sunset.jpg" 🚫
+```go-html-template
+{{ $path := "data/books.json" }}
+{{ with .Resources.Get $path }}
+ {{ with . | transform.Unmarshal }}
+ Books:
+
+ {{ range . }}
+ {{ .title }}
+ {{ end }}
+
+ {{ end }}
+{{ else }}
+ {{ errorf "Unable to get page resource %q" $path }}
+{{ end }}
```
## Metadata
@@ -124,21 +125,21 @@ Resources of type `page` get `Title` etc. from their own front matter.
{{% /note %}}
name
-: Sets the value returned in `Name`.
+: (`string`) Sets the value returned in `Name`.
{{% note %}}
The methods `Match`, `Get` and `GetMatch` use `Name` to match the resources.
{{% /note %}}
title
-: Sets the value returned in `Title`
+: (`string`) Sets the value returned in `Title`
params
-: A map of custom key-value pairs.
+: (`map`) A map of custom key-value pairs.
### Resources metadata example
-{{< code-toggle >}}
+{{< code-toggle file=content/example.md fm=true >}}
title: Application
date : 2018-01-25
resources :
@@ -173,7 +174,7 @@ From the example above:
- Every docx in the bundle will receive the `word` icon.
{{% note %}}
-The __order matters__ --- Only the **first set** values of the `title`, `name` and `params`-**keys** will be used. Consecutive parameters will be set only for the ones not already set. In the above example, `.Params.icon` is first set to `"photo"` in `src = "documents/photo_specs.pdf"`. So that would not get overridden to `"pdf"` by the later set `src = "**.pdf"` rule.
+The order matters; only the first set values of the `title`, `name` and `params` keys will be used. Consecutive parameters will be set only for the ones not already set. In the above example, `.Params.icon` is first set to `"photo"` in `src = "documents/photo_specs.pdf"`. So that would not get overridden to `"pdf"` by the later set `src = "**.pdf"` rule.
{{% /note %}}
### The `:counter` placeholder in `name` and `title`
diff --git a/content/en/contribute/development.md b/content/en/contribute/development.md
index f6ff44ced..e4b183e93 100644
--- a/content/en/contribute/development.md
+++ b/content/en/contribute/development.md
@@ -48,7 +48,7 @@ For a complete guide to contributing to Hugo, see the [Contribution Guide].
To build the extended edition of Hugo from source you must:
1. Install [Git]
-1. Install [Go] version 1.20 or later
+1. Install [Go] version 1.23.0 or later
1. Install a C compiler, either [GCC] or [Clang]
1. Update your `PATH` environment variable as described in the [Go documentation]
diff --git a/content/en/functions/go-template/_common/truthy-falsy.md b/content/en/functions/go-template/_common/truthy-falsy.md
index c8fc9e09e..c41bb6561 100644
--- a/content/en/functions/go-template/_common/truthy-falsy.md
+++ b/content/en/functions/go-template/_common/truthy-falsy.md
@@ -2,4 +2,6 @@
# Do not remove front matter.
---
-In Go templates, the falsy values are `false`, `0`, any nil pointer or interface value, and any array, slice, map, or string of length zero. Everything else is truthy.
+The falsy values are `false`, `0`, any `nil` pointer or interface value, any array, slice, map, or string of length zero, and zero `time.Time` values.
+
+Everything else is truthy.
diff --git a/content/en/functions/go-template/if.md b/content/en/functions/go-template/if.md
index 19c887f25..9fdf80e99 100644
--- a/content/en/functions/go-template/if.md
+++ b/content/en/functions/go-template/if.md
@@ -34,7 +34,7 @@ Use with the [`else`] statement:
{{ end }}
```
-Use `else if` to check multiple conditions.
+Use `else if` to check multiple conditions:
```go-html-template
{{ $var := 12 }}
diff --git a/content/en/functions/go-template/with.md b/content/en/functions/go-template/with.md
index 3a73d54bb..3d628e28d 100644
--- a/content/en/functions/go-template/with.md
+++ b/content/en/functions/go-template/with.md
@@ -36,6 +36,20 @@ Use with the [`else`] statement:
{{ end }}
```
+Use `else with` to check multiple conditions:
+
+```go-html-template
+{{ $v1 := 0 }}
+{{ $v2 := 42 }}
+{{ with $v1 }}
+ {{ . }}
+{{ else with $v2 }}
+ {{ . }} → 42
+{{ else }}
+ {{ print "v1 and v2 are falsy" }}
+{{ end }}
+```
+
Initialize a variable, scoped to the current block:
```go-html-template
diff --git a/content/en/functions/transform/Plainify.md b/content/en/functions/transform/Plainify.md
index 040145170..681d41f72 100644
--- a/content/en/functions/transform/Plainify.md
+++ b/content/en/functions/transform/Plainify.md
@@ -6,7 +6,7 @@ keywords: []
action:
aliases: [plainify]
related: []
- returnType: string
+ returnType: template.HTML
signatures: [transform.Plainify INPUT]
aliases: [/functions/plainify]
---
diff --git a/content/en/functions/transform/ToMath.md b/content/en/functions/transform/ToMath.md
new file mode 100644
index 000000000..db93a7382
--- /dev/null
+++ b/content/en/functions/transform/ToMath.md
@@ -0,0 +1,112 @@
+---
+title: transform.ToMath
+description: Renders a math expression using KaTeX.
+categories: []
+keywords: []
+action:
+ aliases: []
+ related:
+ - content-management/mathematics
+ returnType: types.Result[template.HTML]
+ signatures: ['transform.ToMath EXPRESSION [OPTIONS]']
+aliases: [/functions/tomath]
+toc: true
+---
+
+{{< new-in "0.132.0" >}}
+
+{{% note %}}
+This feature was introduced in Hugo 0.132.0 and is marked as experimental.
+
+This does not mean that it's going to be removed, but this is our first use of WASI/Wasm in Hugo, and we need to see how it [works in the wild](https://github.com/gohugoio/hugo/issues/12736) before we can set it in stone.
+{{% /note %}}
+
+## Arguments
+
+EXPRESSION
+: The math expression to render using KaTeX.
+
+OPTIONS
+: A map of zero or more options.
+
+## Options
+
+These are a subset of the [KaTeX options].
+
+output
+: (`string`). Determines the markup language of the output. One of `html`, `mathml`, or `htmlAndMathml`. Default is `mathml`.
+
+
+
+ With `html` and `htmlAndMathml` you must include KaTeX CSS within the `head` element of your base template. For example:
+
+ ```html
+
+ ...
+
+ ...
+
+ ```
+
+displayMode
+: (`bool`) If `true` render in display mode, else render in inline mode. Default is `false`.
+
+leqno
+: (`bool`) If `true` render with the equation numbers on the left. Default is `false`.
+
+fleqn
+: (`bool`) If `true` render flush left with a 2em left margin. Default is `false`.
+
+minRuleThickness
+: (`float`) The minimum thickness of the fraction lines in `em`. Default is `0.04`.
+
+macros
+: (`map`) A map of macros to be used in the math expression. Default is `{}`.
+
+throwOnError
+: (`bool`) If `true` throw a `ParseError` when KaTeX encounters an unsupported command or invalid LaTex. See [error handling]. Default is `true`.
+
+errorColor
+: (`string`) The color of the error messages expressed as an RGB [hexadecimal color]. Default is `#cc0000`.
+
+## Examples
+
+### Basic
+
+```go-html-template
+{{ transform.ToMath "c = \\pm\\sqrt{a^2 + b^2}" }}
+```
+
+### Macros
+
+```go-html-template
+{{ $macros := dict
+ "\\addBar" "\\bar{#1}"
+ "\\bold" "\\mathbf{#1}"
+}}
+{{ $opts := dict "macros" $macros }}
+{{ transform.ToMath "\\addBar{y} + \\bold{H}" $opts }}
+```
+
+## Error handling
+
+There are 3 ways to handle errors from KaTeX:
+
+1. Let KaTeX throw an error and make the build fail. This is the default behavior.
+1. Handle the error in your template. See the render hook example below.
+1. Set the `throwOnError` option to `false` to make KaTeX render the expression as an error instead of throwing an error. See [options].
+
+{{< code file=layouts/_default/_markup/render-passthrough-inline.html copy=true >}}
+{{ with transform.ToMath .Inner }}
+ {{ with .Err }}
+ {{ errorf "Failed to render KaTeX: %q. See %s" . $.Position }}
+ {{ else }}
+ {{ . }}
+ {{ end }}
+{{ end }}
+{{- /* chomp trailing newline */ -}}
+{{< /code >}}
+
+[error handling]: #error-handling
+[KaTeX options]: https://katex.org/docs/options.html
+[hexadecimal color]: https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color
diff --git a/content/en/getting-started/configuration-markup.md b/content/en/getting-started/configuration-markup.md
index 4ba4a60fe..0046ff1ed 100644
--- a/content/en/getting-started/configuration-markup.md
+++ b/content/en/getting-started/configuration-markup.md
@@ -238,7 +238,7 @@ This is the default configuration for the AsciiDoc renderer:
###### attributes
-(`map`) A map of key-value pairs, each a document attributes,See Asciidoctor’s [attributes].
+(`map`) A map of key-value pairs, each a document attributes. See Asciidoctor’s [attributes].
[attributes]: https://asciidoctor.org/docs/asciidoc-syntax-quick-reference/#attributes-and-substitutions
@@ -302,6 +302,51 @@ To mitigate security risks, entries in the extension array may not contain forwa
my-attribute-name = "my value"
{{< /code-toggle >}}
+### AsciiDoc syntax highlighting
+
+Follow the steps below to enable syntax highlighting.
+
+Step 1
+: Set the `source-highlighter` attribute in your site configuration. For example:
+
+{{< code-toggle file=hugo >}}
+[markup.asciidocExt.attributes]
+source-highlighter = 'rouge'
+{{< /code-toggle >}}
+
+Step 2
+: Generate the highlighter CSS. For example:
+
+```text
+rougify style monokai.sublime > assets/css/syntax.css
+```
+
+Step 3
+: In your base template add a link to the CSS file:
+
+{{< code file=layouts/_default/baseof.html >}}
+
+ ...
+ {{ with resources.Get "css/syntax.css" }}
+
+ {{ end }}
+ ...
+
+{{< /code >}}
+
+Then add the code to be highlighted to your markup:
+
+```text
+[#hello,ruby]
+----
+require 'sinatra'
+
+get '/hi' do
+ "Hello World!"
+end
+----
+```
+
### AsciiDoc troubleshooting
Run `hugo --logLevel debug` to examine Hugo's call to the Asciidoctor executable:
diff --git a/content/en/getting-started/configuration.md b/content/en/getting-started/configuration.md
index 13474c770..b0a6cae66 100644
--- a/content/en/getting-started/configuration.md
+++ b/content/en/getting-started/configuration.md
@@ -378,6 +378,10 @@ Module configuration see [module configuration](/hugo-modules/configuration/).
See [custom output formats].
+###### page
+
+See [configure page](#configure-page).
+
###### pagination
See [configure pagination](/templates/pagination/#configuration).
@@ -496,6 +500,50 @@ enableemoji: true
```
{{% /note %}}
+## Configure page
+
+{{< new-in 0.133.0 >}}
+
+These methods on a `Page` object navigate to the next or previous page within a page collection, relative to the current page:
+
+- [Next](/methods/page/next/)
+- [NextInSection](/methods/page/nextinsection/)
+- [Prev](/methods/page/prev/)
+- [PrevInSection](/methods/page/previnsection/)
+
+Hugo determines the _next_ and _previous_ page by sorting a page collection according to this sorting hierarchy:
+
+Field|Precedence|Sort direction
+:--|:--|:--
+[`weight`]|1|descending
+[`date`]|2|descending
+[`linkTitle`]|3|descending
+[`path`]|4|descending
+
+[`date`]: /methods/page/date/
+[`weight`]: /methods/page/weight/
+[`linkTitle`]: /methods/page/linktitle/
+[`path`]: /methods/page/path/
+
+The sort direction in the table above corresponds to these default site configuration values:
+
+{{< code-toggle config=page />}}
+
+To sort all fields in ascending order:
+
+{{< code-toggle file=hugo >}}
+[page]
+ nextPrevInSectionSortOrder = 'asc'
+ nextPrevSortOrder = 'asc'
+{{< /code-toggle >}}
+
+{{% note %}}
+These settings do not apply to the [`Next`] or [`Prev`] methods on a `Pages` object.
+
+[`Next`]: /methods/pages/next
+[`Prev`]: /methods/pages/next
+{{% /note %}}
+
## Configure build
The `build` configuration section contains global build-related configuration options.
@@ -609,8 +657,6 @@ Setting `force=true` will make a redirect even if there is existing content in t
## 404 server error page {#_404-server-error-page}
-{{< new-in 0.103.0 >}}
-
Hugo will, by default, render all 404 errors when running `hugo server` with the `404.html` template. Note that if you have already added one or more redirects to your [server configuration](#configure-server), you need to add the 404 redirect explicitly, e.g:
{{< code-toggle file=config/development/server >}}
@@ -924,7 +970,6 @@ output
It is recommended to put coarse grained filters (e.g. for language and output format) in the excludes section, e.g.:
-
{{< code-toggle file=hugo >}}
[segments.segment1]
[[segments.segment1.excludes]]
diff --git a/content/en/methods/_common/_index.md b/content/en/methods/_common/_index.md
deleted file mode 100644
index 4328d4d14..000000000
--- a/content/en/methods/_common/_index.md
+++ /dev/null
@@ -1,13 +0,0 @@
----
-cascade:
- _build:
- list: never
- publishResources: false
- render: never
----
-
-
diff --git a/content/en/methods/_common/next-prev-on-page-vs-next-prev-on-pages.md b/content/en/methods/_common/next-prev-on-page-vs-next-prev-on-pages.md
deleted file mode 100644
index f65037878..000000000
--- a/content/en/methods/_common/next-prev-on-page-vs-next-prev-on-pages.md
+++ /dev/null
@@ -1,37 +0,0 @@
----
-# Do not remove front matter.
----
-
-The `Next` and `Prev` methods on a `Pages` object are more flexible than the `Next` and `Prev` methods on a `Page` object.
-
-||Page collection|Custom sort order
-:--|:--|:-:
-[`PAGES.Next`] and [`PAGES.Prev`]|locally defined|✔️
-[`PAGE.Next`] and [`PAGE.Prev`]|globally defined|❌
-
-[`PAGES.Next`]: /methods/pages/next/
-[`PAGES.Prev`]: /methods/pages/prev/
-[`PAGE.Next`]: /methods/page/next/
-[`PAGE.Prev`]: /methods/page/prev/
-
-locally defined
-: Build the page collection every time you call `PAGES.Next` and `PAGES.Prev`. Navigation between pages is relative to the current page's position within the local collection, independent of the global collection.
-
-With a local collection, the navigation sort order is the same as the collection sort order.
-
-globally defined
-: Build the page collection once, on a list page. Navigation between pages is relative to the current page's position within the global collection.
-
-With a global collection, the navigation sort order is fixed, using Hugo's default sort order. In order of precedence:
-
-1. Page [weight]
-2. Page [date] (descending)
-3. Page [linkTitle], falling back to page [title]
-4. Page file path if the page is backed by a file
-
-For example, with a global collection sorted by title, the navigation sort order will use Hugo's default sort order. This is probably not what you want or expect. For this reason, the `Next` and `Prev` methods on a `Pages` object are generally a better choice.
-
-[date]: /methods/page/date/
-[weight]: /methods/page/weight/
-[linkTitle]: /methods/page/linktitle/
-[title]: /methods/page/title/
diff --git a/content/en/methods/page/Next.md b/content/en/methods/page/Next.md
index 57fc1f2f8..ff0525700 100644
--- a/content/en/methods/page/Next.md
+++ b/content/en/methods/page/Next.md
@@ -1,6 +1,6 @@
---
title: Next
-description: Returns the next page in a global page collection, relative to the given page.
+description: Returns the next page in a site's collection of regular pages, relative to the current page.
categories: []
keywords: []
action:
@@ -12,42 +12,6 @@ action:
- methods/pages/Prev
returnType: page.Page
signatures: [PAGE.Next]
-toc: true
---
-The behavior of the `Prev` and `Next` methods on a `Page` object is probably the reverse of what you expect.
-
-With this content structure:
-
-```text
-content/
-├── pages/
-│ ├── _index.md
-│ ├── page-1.md <-- front matter: weight = 10
-│ ├── page-2.md <-- front matter: weight = 20
-│ └── page-3.md <-- front matter: weight = 30
-└── _index.md
-```
-
-When you visit page-2:
-
-- The `Prev` method points to page-3
-- The `Next` method points to page-1
-
-{{% note %}}
-Use the opposite label in your navigation links as shown in the example below.
-{{% /note %}}
-
-```go-html-template
-{{ with .Next }}
- Prev
-{{ end }}
-
-{{ with .Prev }}
- Next
-{{ end }}
-```
-
-## Compare to Pages methods
-
-{{% include "methods/_common/next-prev-on-page-vs-next-prev-on-pages.md" %}}
+{{% include "methods/page/_common/next-and-prev.md" %}}
diff --git a/content/en/methods/page/NextInSection.md b/content/en/methods/page/NextInSection.md
index 59a35d03d..640e9b44a 100644
--- a/content/en/methods/page/NextInSection.md
+++ b/content/en/methods/page/NextInSection.md
@@ -1,71 +1,15 @@
---
title: NextInSection
-description: Returns the next page within a section, relative to the given page.
+description: Returns the next regular page in a section, relative to the given page.
categories: []
keywords: []
action:
related:
- methods/page/PrevInSection
- - methods/page/Next
- - methods/page/Prev
- methods/pages/Next
- methods/pages/Prev
returnType: page.Page
signatures: [PAGE.NextInSection]
---
-The behavior of the `PrevInSection` and `NextInSection` methods on a `Page` object is probably the reverse of what you expect.
-
-With this content structure:
-
-```text
-content/
-├── books/
-│ ├── _index.md
-│ ├── book-1.md
-│ ├── book-2.md
-│ └── book-3.md
-├── films/
-│ ├── _index.md
-│ ├── film-1.md
-│ ├── film-2.md
-│ └── film-3.md
-└── _index.md
-```
-
-When you visit book-2:
-
-- The `PrevInSection` method points to book-3
-- The `NextInSection` method points to book-1
-
-{{% note %}}
-Use the opposite label in your navigation links as shown in the example below.
-{{% /note %}}
-
-```go-html-template
-{{ with .NextInSection }}
- Previous in section
-{{ end }}
-
-{{ with .PrevInSection }}
- Next in section
-{{ end }}
-```
-
-{{% note %}}
-The navigation sort order may be different than the page collection sort order.
-{{% /note %}}
-
-With the `PrevInSection` and `NextInSection` methods, the navigation sort order is fixed, using Hugo’s default sort order. In order of precedence:
-
-1. Page [weight]
-2. Page [date] (descending)
-3. Page [linkTitle], falling back to page [title]
-4. Page file path if the page is backed by a file
-
-For example, with a page collection sorted by title, the navigation sort order will use Hugo’s default sort order. This is probably not what you want or expect. For this reason, the Next and Prev methods on a Pages object are generally a better choice.
-
-[date]: /methods/page/date/
-[weight]: /methods/page/weight/
-[linkTitle]: /methods/page/linktitle/
-[title]: /methods/page/title/
+{{% include "methods/page/_common/nextinsection-and-previnsection.md" %}}
diff --git a/content/en/methods/page/Prev.md b/content/en/methods/page/Prev.md
index b1a503af5..d28b50265 100644
--- a/content/en/methods/page/Prev.md
+++ b/content/en/methods/page/Prev.md
@@ -1,53 +1,17 @@
---
title: Prev
-description: Returns the previous page in a global page collection, relative to the given page.
+description: Returns the previous page in a site's collection of regular pages, relative to the current page.
categories: []
keywords: []
action:
related:
- methods/page/Next
- - methods/page/PrevInSection
- methods/page/NextInSection
- - methods/pages/Prev
+ - methods/page/PrevInSection
- methods/pages/Next
+ - methods/pages/Prev
returnType: page.Page
signatures: [PAGE.Prev]
-toc: true
---
-The behavior of the `Prev` and `Next` methods on a `Page` object is probably the reverse of what you expect.
-
-With this content structure:
-
-```text
-content/
-├── pages/
-│ ├── _index.md
-│ ├── page-1.md <-- front matter: weight = 10
-│ ├── page-2.md <-- front matter: weight = 20
-│ └── page-3.md <-- front matter: weight = 30
-└── _index.md
-```
-
-When you visit page-2:
-
-- The `Prev` method points to page-3
-- The `Next` method points to page-1
-
-{{% note %}}
-Use the opposite label in your navigation links as shown in the example below.
-{{% /note %}}
-
-```go-html-template
-{{ with .Next }}
- Prev
-{{ end }}
-
-{{ with .Prev }}
- Next
-{{ end }}
-```
-
-## Compare to Pages methods
-
-{{% include "methods/_common/next-prev-on-page-vs-next-prev-on-pages.md" %}}
+{{% include "methods/page/_common/next-and-prev.md" %}}
diff --git a/content/en/methods/page/PrevInSection.md b/content/en/methods/page/PrevInSection.md
index e6daf66c4..aaafb367e 100644
--- a/content/en/methods/page/PrevInSection.md
+++ b/content/en/methods/page/PrevInSection.md
@@ -1,72 +1,15 @@
---
title: PrevInSection
-description: Returns the previous page within a section, relative to the given page.
+description: Returns the previous regular page in a section, relative to the given page.
categories: []
keywords: []
action:
related:
- methods/page/NextInSection
- - methods/page/Next
- methods/pages/Next
- - methods/page/Prev
- methods/pages/Prev
returnType: page.Page
signatures: [PAGE.PrevInSection]
---
-
-The behavior of the `PrevInSection` and `NextInSection` methods on a `Page` object is probably the reverse of what you expect.
-
-With this content structure:
-
-```text
-content/
-├── books/
-│ ├── _index.md
-│ ├── book-1.md
-│ ├── book-2.md
-│ └── book-3.md
-├── films/
-│ ├── _index.md
-│ ├── film-1.md
-│ ├── film-2.md
-│ └── film-3.md
-└── _index.md
-```
-
-When you visit book-2:
-
-- The `PrevInSection` method points to book-3
-- The `NextInSection` method points to book-1
-
-{{% note %}}
-Use the opposite label in your navigation links as shown in the example below.
-{{% /note %}}
-
-```go-html-template
-{{ with .NextInSection }}
- Previous in section
-{{ end }}
-
-{{ with .PrevInSection }}
- Next in section
-{{ end }}
-```
-
-{{% note %}}
-The navigation sort order may be different than the page collection sort order.
-{{% /note %}}
-
-With the `PrevInSection` and `NextInSection` methods, the navigation sort order is fixed, using Hugo’s default sort order. In order of precedence:
-
-1. Page [weight]
-2. Page [date] (descending)
-3. Page [linkTitle], falling back to page [title]
-4. Page file path if the page is backed by a file
-
-For example, with a page collection sorted by title, the navigation sort order will use Hugo’s default sort order. This is probably not what you want or expect. For this reason, the Next and Prev methods on a Pages object are generally a better choice.
-
-[date]: /methods/page/date/
-[weight]: /methods/page/weight/
-[linkTitle]: /methods/page/linktitle/
-[title]: /methods/page/title/
+{{% include "methods/page/_common/nextinsection-and-previnsection.md" %}}
diff --git a/content/en/methods/page/_common/next-and-prev.md b/content/en/methods/page/_common/next-and-prev.md
new file mode 100644
index 000000000..0d1436e11
--- /dev/null
+++ b/content/en/methods/page/_common/next-and-prev.md
@@ -0,0 +1,60 @@
+---
+# Do not remove front matter.
+---
+
+Hugo determines the _next_ and _previous_ page by sorting the site's collection of regular pages according to this sorting hierarchy:
+
+Field|Precedence|Sort direction
+:--|:--|:--
+[`weight`]|1|descending
+[`date`]|2|descending
+[`linkTitle`]|3|descending
+[`path`]|4|descending
+
+[`date`]: /methods/page/date/
+[`weight`]: /methods/page/weight/
+[`linkTitle`]: /methods/page/linktitle/
+[`path`]: /methods/page/path/
+
+The sorted page collection used to determine the _next_ and _previous_ page is independent of other page collections, which may lead to unexpected behavior.
+
+For example, with this content structure:
+
+```text
+content/
+├── pages/
+│ ├── _index.md
+│ ├── page-1.md <-- front matter: weight = 10
+│ ├── page-2.md <-- front matter: weight = 20
+│ └── page-3.md <-- front matter: weight = 30
+└── _index.md
+```
+
+And these templates:
+
+{{< code file=layouts/_default/list.html >}}
+{{ range .Pages.ByWeight }}
+
+{{ end }}
+{{< /code >}}
+
+{{< code file=layouts/_default/single.html >}}
+{{ with .Prev }}
+ Previous
+{{ end }}
+
+{{ with .Next }}
+ Next
+{{ end }}
+{{< /code >}}
+
+When you visit page-2:
+
+- The `Prev` method points to page-3
+- The `Next` method points to page-1
+
+To reverse the meaning of _next_ and _previous_ you can change the sort direction in your [site configuration], or use the [`Next`] and [`Prev`] methods on a `Pages` object for more flexibility.
+
+[site configuration]: getting-started/configuration/#configure-page
+[`Next`]: /methods/pages/prev
+[`Prev`]: /methods/pages/prev
diff --git a/content/en/methods/page/_common/nextinsection-and-previnsection.md b/content/en/methods/page/_common/nextinsection-and-previnsection.md
new file mode 100644
index 000000000..6c558b69e
--- /dev/null
+++ b/content/en/methods/page/_common/nextinsection-and-previnsection.md
@@ -0,0 +1,78 @@
+---
+# Do not remove front matter.
+---
+
+Hugo determines the _next_ and _previous_ page by sorting the current section's regular pages according to this sorting hierarchy:
+
+Field|Precedence|Sort direction
+:--|:--|:--
+[`weight`]|1|descending
+[`date`]|2|descending
+[`linkTitle`]|3|descending
+[`path`]|4|descending
+
+[`date`]: /methods/page/date/
+[`weight`]: /methods/page/weight/
+[`linkTitle`]: /methods/page/linktitle/
+[`path`]: /methods/page/path/
+
+The sorted page collection used to determine the _next_ and _previous_ page is independent of other page collections, which may lead to unexpected behavior.
+
+For example, with this content structure:
+
+```text
+content/
+├── pages/
+│ ├── _index.md
+│ ├── page-1.md <-- front matter: weight = 10
+│ ├── page-2.md <-- front matter: weight = 20
+│ └── page-3.md <-- front matter: weight = 30
+└── _index.md
+```
+
+And these templates:
+
+{{< code file=layouts/_default/list.html >}}
+{{ range .Pages.ByWeight }}
+
+{{ end }}
+{{< /code >}}
+
+{{< code file=layouts/_default/single.html >}}
+{{ with .PrevInSection }}
+ Previous
+{{ end }}
+
+{{ with .NextInSection }}
+ Next
+{{ end }}
+{{< /code >}}
+
+When you visit page-2:
+
+- The `PrevInSection` method points to page-3
+- The `NextInSection` method points to page-1
+
+To reverse the meaning of _next_ and _previous_ you can change the sort direction in your [site configuration], or use the [`Next`] and [`Prev`] methods on a `Pages` object for more flexibility.
+
+[site configuration]: getting-started/configuration/#configure-page
+[`Next`]: /methods/pages/prev
+[`Prev`]: /methods/pages/prev
+
+## Example
+
+Code defensively by checking for page existence:
+
+```go-html-template
+{{ with .PrevInSection }}
+ Previous
+{{ end }}
+
+{{ with .NextInSection }}
+ Next
+{{ end }}
+```
+
+## Alternative
+
+Use the [`Next`] and [`Prev`] methods on a `Pages` object for more flexibility.
diff --git a/content/en/methods/pages/Next.md b/content/en/methods/pages/Next.md
index b7284609f..dcf1231ac 100644
--- a/content/en/methods/pages/Next.md
+++ b/content/en/methods/pages/Next.md
@@ -1,55 +1,17 @@
---
title: Next
-description: Returns the next page in a local page collection, relative to the given page.
+description: Returns the next page in a page collection, relative to the given page.
categories: []
keywords: []
action:
related:
- methods/pages/Prev
- methods/page/Next
- - methods/page/NextInSection
- methods/page/Prev
+ - methods/page/NextInSection
- methods/page/PrevInSection
returnType: page.Page
signatures: [PAGES.Next PAGE]
-toc: true
---
-The behavior of the `Prev` and `Next` methods on a `Pages` objects is probably the reverse of what you expect.
-
-With this content structure and the page collection sorted by weight in ascending order:
-
-```text
-content/
-├── pages/
-│ ├── _index.md
-│ ├── page-1.md <-- front matter: weight = 10
-│ ├── page-2.md <-- front matter: weight = 20
-│ └── page-3.md <-- front matter: weight = 30
-└── _index.md
-```
-
-When you visit page-2:
-
-- The `Prev` method points to page-3
-- The `Next` method points to page-1
-
-{{% note %}}
-Use the opposite label in your navigation links as shown in the example below.
-{{% /note %}}
-
-```go-html-template
-{{ $pages := where .Site.RegularPages.ByWeight "Section" "pages" }}
-
-{{ with $pages.Next . }}
- Previous
-{{ end }}
-
-{{ with $pages.Prev . }}
- Next
-{{ end }}
-```
-
-## Compare to Page methods
-
-{{% include "methods/_common/next-prev-on-page-vs-next-prev-on-pages.md" %}}
+{{% include "methods/pages/_common/next-and-prev.md" %}}
diff --git a/content/en/methods/pages/Prev.md b/content/en/methods/pages/Prev.md
index b9ef27a45..2d8738521 100644
--- a/content/en/methods/pages/Prev.md
+++ b/content/en/methods/pages/Prev.md
@@ -1,55 +1,17 @@
---
title: Prev
-description: Returns the previous page in a local page collection, relative to the given page.
+description: Returns the previous page in a page collection, relative to the given page.
categories: []
keywords: []
action:
related:
- methods/pages/Next
- methods/page/Next
- - methods/page/NextInSection
- methods/page/Prev
+ - methods/page/NextInSection
- methods/page/PrevInSection
returnType: page.Pages
signatures: [PAGES.Prev PAGE]
-toc: true
---
-The behavior of the `Prev` and `Next` methods on a `Pages` objects is probably the reverse of what you expect.
-
-With this content structure and the page collection sorted by weight in ascending order:
-
-```text
-content/
-├── pages/
-│ ├── _index.md
-│ ├── page-1.md <-- front matter: weight = 10
-│ ├── page-2.md <-- front matter: weight = 20
-│ └── page-3.md <-- front matter: weight = 30
-└── _index.md
-```
-
-When you visit page-2:
-
-- The `Prev` method points to page-3
-- The `Next` method points to page-1
-
-{{% note %}}
-Use the opposite label in your navigation links as shown in the example below.
-{{% /note %}}
-
-```go-html-template
-{{ $pages := where .Site.RegularPages.ByWeight "Section" "pages" }}
-
-{{ with $pages.Next . }}
- Previous
-{{ end }}
-
-{{ with $pages.Prev . }}
- Next
-{{ end }}
-```
-
-## Compare to Page methods
-
-{{% include "methods/_common/next-prev-on-page-vs-next-prev-on-pages.md" %}}
+{{% include "methods/pages/_common/next-and-prev.md" %}}
diff --git a/content/en/methods/pages/_common/next-and-prev.md b/content/en/methods/pages/_common/next-and-prev.md
new file mode 100644
index 000000000..e0d05de84
--- /dev/null
+++ b/content/en/methods/pages/_common/next-and-prev.md
@@ -0,0 +1,72 @@
+---
+# Do not remove front matter.
+---
+
+Hugo determines the _next_ and _previous_ page by sorting the page collection according to this sorting hierarchy:
+
+Field|Precedence|Sort direction
+:--|:--|:--
+[`weight`]|1|descending
+[`date`]|2|descending
+[`linkTitle`]|3|descending
+[`path`]|4|descending
+
+[`date`]: /methods/page/date/
+[`weight`]: /methods/page/weight/
+[`linkTitle`]: /methods/page/linktitle/
+[`path`]: /methods/page/path/
+
+The sorted page collection used to determine the _next_ and _previous_ page is independent of other page collections, which may lead to unexpected behavior.
+
+For example, with this content structure:
+
+```text
+content/
+├── pages/
+│ ├── _index.md
+│ ├── page-1.md <-- front matter: weight = 10
+│ ├── page-2.md <-- front matter: weight = 20
+│ └── page-3.md <-- front matter: weight = 30
+└── _index.md
+```
+
+And these templates:
+
+{{< code file=layouts/_default/list.html >}}
+{{ range .Pages.ByWeight}}
+
+{{ end }}
+{{< /code >}}
+
+{{< code file=layouts/_default/single.html >}}
+{{ $pages := .CurrentSection.Pages.ByWeight }}
+
+{{ with $pages.Prev . }}
+ Previous
+{{ end }}
+
+{{ with $pages.Next . }}
+ Next
+{{ end }}
+{{< /code >}}
+
+When you visit page-2:
+
+- The `Prev` method points to page-3
+- The `Next` method points to page-1
+
+To reverse the meaning of _next_ and _previous_ you can chain the [`Reverse`] method to the page collection definition:
+
+{{< code file=layouts/_default/single.html >}}
+{{ $pages := .CurrentSection.Pages.ByWeight.Reverse }}
+
+{{ with $pages.Prev . }}
+ Previous
+{{ end }}
+
+{{ with $pages.Next . }}
+ Next
+{{ end }}
+{{< /code >}}
+
+[`Reverse`]: /methods/pages/reverse/
diff --git a/content/en/render-hooks/blockquotes.md b/content/en/render-hooks/blockquotes.md
new file mode 100755
index 000000000..e0eda5c51
--- /dev/null
+++ b/content/en/render-hooks/blockquotes.md
@@ -0,0 +1,171 @@
+---
+title: Blockquote render hooks
+linkTitle: Blockquotes
+description: Create a blockquote render hook to override the rendering of Markdown blockquotes to HTML.
+categories: [render hooks]
+keywords: []
+menu:
+ docs:
+ parent: render-hooks
+ weight: 30
+weight: 30
+toc: true
+---
+
+{{< new-in 0.132.0 >}}
+
+## Context
+
+Blockquote render hook templates receive the following [context]:
+
+[context]: /getting-started/glossary/#context
+
+###### AlertType
+
+(`string`) Applicable when [`Type`](#type) is `alert`, this is the alert type converted to lowercase. See the [alerts](#alerts) section below.
+
+###### Attributes
+
+(`map`) The [Markdown attributes], available if you configure your site as follows:
+
+[Markdown attributes]: /content-management/markdown-attributes/
+
+{{< code-toggle file=hugo >}}
+[markup.goldmark.parser.attribute]
+block = true
+{{< /code-toggle >}}
+
+###### Ordinal
+
+(`int`) The zero-based ordinal of the blockquote on the page.
+
+###### Page
+
+(`page`) A reference to the current page.
+
+###### PageInner
+
+(`page`) A reference to a page nested via the [`RenderShortcodes`] method.
+
+[`RenderShortcodes`]: /methods/page/rendershortcodes
+
+###### Position
+
+(`string`) The position of the blockquote within the page content.
+
+###### Text
+(`string`) The blockquote text, excluding the alert designator if present. See the [alerts](#alerts) section below.
+
+###### Type
+
+(`bool`) The blockquote type. Returns `alert` if the blockquote has an alert designator, else `regular`. See the [alerts](#alerts) section below.
+
+## Examples
+
+In its default configuration, Hugo renders Markdown blockquotes according to the [CommonMark specification]. To create a render hook that does the same thing:
+
+[CommonMark specification]: https://spec.commonmark.org/current/
+
+{{< code file=layouts/_default/_markup/render-blockquote.html copy=true >}}
+
+ {{ .Text | safeHTML }}
+
+{{< /code >}}
+
+To render a blockquote as an HTML `figure` element with an optional citation and caption:
+
+{{< code file=layouts/_default/_markup/render-blockquote.html copy=true >}}
+
+
+ {{ .Text | safeHTML }}
+
+ {{ with .Attributes.caption }}
+
+ {{ . | safeHTML }}
+
+ {{ end }}
+
+{{< /code >}}
+
+Then in your markdown:
+
+```text
+> Some text
+{cite="https://gohugo.io" caption="Some caption"}
+```
+
+## Alerts
+
+Also known as _callouts_ or _admonitions_, alerts are blockquotes used to emphasize critical information. For example:
+
+{{< code file=content/example.md lang=text >}}
+> [!NOTE]
+> Useful information that users should know, even when skimming content.
+
+> [!TIP]
+> Helpful advice for doing things better or more easily.
+
+> [!IMPORTANT]
+> Key information users need to know to achieve their goal.
+
+> [!WARNING]
+> Urgent info that needs immediate user attention to avoid problems.
+
+> [!CAUTION]
+> Advises about risks or negative outcomes of certain actions.
+{{< /code >}}
+
+
+{{% note %}}
+This syntax is compatible with the GitHub Alert Markdown extension.
+{{% /note %}}
+
+
+The first line of each alert is an alert designator consisting of an exclamation point followed by the alert type, wrapped within brackets.
+
+The blockquote render hook below renders a multilingual alert if an alert desginator is present, otherwise it renders a blockquote according to the CommonMark specification.
+
+{{< code file=layouts/_default/_markup/render-blockquote.html copy=true >}}
+{{ $emojis := dict
+ "caution" ":exclamation:"
+ "important" ":information_source:"
+ "note" ":information_source:"
+ "tip" ":bulb:"
+ "warning" ":information_source:"
+}}
+
+{{ if eq .Type "alert" }}
+
+
+ {{ transform.Emojify (index $emojis .AlertType) }}
+ {{ or (i18n .AlertType) (title .AlertType) }}
+
+ {{ .Text | safeHTML }}
+
+{{ else }}
+
+ {{ .Text | safeHTML }}
+
+{{ end }}
+{{< /code >}}
+
+To override the label, create these entries in your i18n files:
+
+{{< code-toggle file=i18n/en.toml >}}
+caution = 'Caution'
+important = 'Important'
+note = 'Note'
+tip = 'Tip'
+warning = 'Warning'
+{{< /code-toggle >}}
+
+
+Although you can use one template with conditional logic as shown above, you can also create separate templates for each [`Type`](#type) of blockquote:
+
+```text
+layouts/
+└── _default/
+ └── _markup/
+ ├── render-blockquote-alert.html
+ └── render-blockquote-regular.html
+```
diff --git a/content/en/render-hooks/code-blocks.md b/content/en/render-hooks/code-blocks.md
index 0c11c7864..d322cb88d 100755
--- a/content/en/render-hooks/code-blocks.md
+++ b/content/en/render-hooks/code-blocks.md
@@ -7,8 +7,8 @@ keywords: []
menu:
docs:
parent: render-hooks
- weight: 30
-weight: 30
+ weight: 40
+weight: 40
toc: true
---
diff --git a/content/en/render-hooks/headings.md b/content/en/render-hooks/headings.md
index c48bb11e1..8ae3b808a 100755
--- a/content/en/render-hooks/headings.md
+++ b/content/en/render-hooks/headings.md
@@ -7,8 +7,8 @@ keywords: []
menu:
docs:
parent: render-hooks
- weight: 40
-weight: 40
+ weight: 50
+weight: 50
toc: true
---
@@ -24,7 +24,9 @@ Heading render hook templates receive the following [context]:
###### Attributes
-(`map`) The Markdown attributes, available if you configure your site as follows:
+(`map`) The [Markdown attributes], available if you configure your site as follows:
+
+[Markdown attributes]: /content-management/markdown-attributes/
{{< code-toggle file=hugo >}}
[markup.goldmark.parser.attribute]
diff --git a/content/en/render-hooks/images.md b/content/en/render-hooks/images.md
index 2d9b5e2e5..1638ceeae 100755
--- a/content/en/render-hooks/images.md
+++ b/content/en/render-hooks/images.md
@@ -7,8 +7,8 @@ keywords: []
menu:
docs:
parent: render-hooks
- weight: 50
-weight: 50
+ weight: 60
+weight: 60
toc: true
---
@@ -32,7 +32,9 @@ Image render hook templates receive the following context:
###### Attributes
-(`map`) The Markdown attributes, available if you configure your site as follows:
+(`map`) The [Markdown attributes], available if you configure your site as follows:
+
+[Markdown attributes]: /content-management/markdown-attributes/
{{< code-toggle file=hugo >}}
[markup.goldmark.parser]
diff --git a/content/en/render-hooks/introduction.md b/content/en/render-hooks/introduction.md
index 8268b2ec7..3745fc398 100755
--- a/content/en/render-hooks/introduction.md
+++ b/content/en/render-hooks/introduction.md
@@ -13,10 +13,12 @@ weight: 20
When rendering Markdown to HTML, render hooks override the conversion. Each render hook is a template, with one template for each supported element type:
+- [Blockquotes](/render-hooks/blockquotes)
- [Code blocks](/render-hooks/code-blocks)
- [Headings](/render-hooks/headings)
- [Images](/render-hooks/images)
- [Links](/render-hooks/links)
+- [Passthrough elements](/render-hooks/passthrough)
{{% note %}}
Hugo supports multiple [content formats] including Markdown, HTML, AsciiDoc, Emacs Org Mode, Pandoc, and reStructuredText.
@@ -54,6 +56,7 @@ Each render hook is a template, with one template for each supported element typ
layouts/
└── _default/
└── _markup/
+ ├── render-blockquote.html
├── render-codeblock.html
├── render-heading.html
├── render-image.html
diff --git a/content/en/render-hooks/links.md b/content/en/render-hooks/links.md
index bf0485068..79c3d6926 100755
--- a/content/en/render-hooks/links.md
+++ b/content/en/render-hooks/links.md
@@ -7,8 +7,8 @@ keywords: []
menu:
docs:
parent: render-hooks
- weight: 60
-weight: 60
+ weight: 70
+weight: 70
toc: true
---
diff --git a/content/en/render-hooks/passthrough.md b/content/en/render-hooks/passthrough.md
new file mode 100755
index 000000000..3b82116e6
--- /dev/null
+++ b/content/en/render-hooks/passthrough.md
@@ -0,0 +1,125 @@
+---
+title: Passthrough render hooks
+linkTitle: Passthrough
+description: Create a passthrough render hook to override the rendering of text snippets captured by the Goldmark passthrough extension.
+categories: [render hooks]
+keywords: []
+menu:
+ docs:
+ parent: render-hooks
+ weight: 80
+weight: 80
+toc: true
+---
+
+{{< new-in 0.132.0 >}}
+
+## Overview
+
+Hugo uses [Goldmark] to render Markdown to HTML. Goldmark supports custom extensions to extend its core functionality. The Goldmark [passthrough extension] captures and preserves raw Markdown within delimited snippets of text, including the delimiters themselves. These are known as _passthrough elements_.
+
+[Goldmark]: https://github.com/yuin/goldmark
+[passthrough extension]: /getting-started/configuration-markup/#passthrough
+
+Depending on your choice of delimiters, Hugo will classify a passthrough element as either _block_ or _inline_. Consider this contrived example:
+
+{{< code file=content/sample.md >}}
+This is a
+
+\[block\]
+
+passthrough element with opening and closing block delimiters.
+
+This is an \(inline\) passthrough element with opening and closing inline delimiters.
+{{< /code >}}
+
+Update your site configuration to enable the passthrough extension and define opening and closing delimiters for each passthrough element type, either `block` or `inline`. For example:
+
+{{< code-toggle file=hugo >}}
+[markup.goldmark.extensions.passthrough]
+enable = true
+[markup.goldmark.extensions.passthrough.delimiters]
+block = [['\[', '\]'], ['$$', '$$']]
+inline = [['\(', '\)']]
+{{< /code-toggle >}}
+
+In the example above there are two sets of `block` delimiters. You may use either one in your Markdown.
+
+The Goldmark passthrough extension is often used in conjunction with the MathJax or KaTeX display engine to render [mathematical expressions] written in [LaTeX] or [Tex].
+
+[mathematical expressions]: /content-management/mathematics/
+[LaTeX]: https://www.latex-project.org/
+[Tex]: https://en.wikipedia.org/wiki/TeX
+
+To enable custom rendering of passthrough elements, create a render hook.
+
+## Context
+
+Passthrough render hook templates receive the following [context]:
+
+[context]: /getting-started/glossary/#context
+
+###### Attributes
+
+(`map`) The [Markdown attributes], available if you configure your site as follows:
+
+[Markdown attributes]: /content-management/markdown-attributes/
+
+{{< code-toggle file=hugo >}}
+[markup.goldmark.parser.attribute]
+block = true
+{{< /code-toggle >}}
+
+Hugo populates the `Attributes` map for _block_ passthrough elements. Markdown attributes are not applicable to _inline_ elements.
+
+###### Inner
+(`string`) The inner content of the passthrough element, excluding the delimiters.
+
+###### Ordinal
+
+(`int`) The zero-based ordinal of the passthrough element on the page.
+
+###### Page
+
+(`page`) A reference to the current page.
+
+###### PageInner
+
+(`page`) A reference to a page nested via the [`RenderShortcodes`] method. [See details](#pageinner-details).
+
+[`RenderShortcodes`]: /methods/page/rendershortcodes
+
+###### Position
+
+(`string`) The position of the passthrough element within the page content.
+
+###### Type
+
+(`bool`) The passthrough element type, either `block` or `inline`.
+
+## Example
+
+As an alternative to rendering mathematical expressions with the MathJax or KaTeX display engine, create a passthrough render hook which calls the [`transform.ToMath`] function:
+
+[`transform.ToMath`]: /functions/transform/tomath/
+
+{{< code file=layouts/_default/_markup/render-passthrough.html copy=true >}}
+{{ if eq .Type "block" }}
+ {{ $opts := dict "displayMode" true }}
+ {{ transform.ToMath .Inner $opts }}
+{{ else }}
+ {{ transform.ToMath .Inner }}
+{{ end }}
+{{< /code >}}
+
+Although you can use one template with conditional logic as shown above, you can also create separate templates for each [`Type`](#type) of passthrough element:
+
+```text
+layouts/
+└── _default/
+ └── _markup/
+ ├── render-passthrough-block.html
+ └── render-passthrough-inline.html
+```
+
+{{% include "/render-hooks/_common/pageinner.md" %}}
diff --git a/content/en/templates/embedded.md b/content/en/templates/embedded.md
index 5fbbb8d96..888f4f342 100644
--- a/content/en/templates/embedded.md
+++ b/content/en/templates/embedded.md
@@ -135,7 +135,7 @@ tags = []
Hugo uses the page title and description for the title and description metadata.
The first 6 URLs from the `images` array are used for image metadata.
-If [page bundles](/content-management/page-bundles/) are used and the `images` array is empty or undefined, images with file names matching `*feature*` or `*cover*,*thumbnail*` are used for image metadata.
+If [page bundles](/content-management/page-bundles/) are used and the `images` array is empty or undefined, images with file names matching `*feature*`, `*cover*`, or `*thumbnail*` are used for image metadata.
Various optional metadata can also be set:
@@ -203,7 +203,7 @@ description = "Text about this post"
images = ["post-cover.png"]
{{ code-toggle >}}
-If `images` aren't specified in the page front-matter, then hugo searches for [image page resources](/content-management/image-processing/) with `feature`, `cover`, or `thumbnail` in their name.
+If [page bundles](/content-management/page-bundles/) are used and the `images` array is empty or undefined, images with file names matching `*feature*`, `*cover*`, or `*thumbnail*` are used for image metadata.
If no image resources with those names are found, the images defined in the [site config](/getting-started/configuration/) are used instead.
If no images are found at all, then an image-less Twitter `summary` card is used instead of `summary_large_image`.
diff --git a/content/en/templates/introduction.md b/content/en/templates/introduction.md
index bb8702717..0a3ff2b0f 100644
--- a/content/en/templates/introduction.md
+++ b/content/en/templates/introduction.md
@@ -509,6 +509,20 @@ See documentation for [`with`], [`else`], and [`end`].
{{ end }}
```
+To test multiple conditions:
+
+```go-html-template
+{{ $v1 := 0 }}
+{{ $v2 := 42 }}
+{{ with $v1 }}
+ {{ . }}
+{{ else with $v2 }}
+ {{ . }} → 42
+{{ else }}
+ {{ print "v1 and v2 are falsy" }}
+{{ end }}
+```
+
### Access site parameters
See documentation for the [`Params`](/methods/site/params/) method on a `Site` object.
diff --git a/content/en/templates/menu.md b/content/en/templates/menu.md
index de103803c..bd0bc5569 100644
--- a/content/en/templates/menu.md
+++ b/content/en/templates/menu.md
@@ -129,5 +129,5 @@ Hugo provides two methods to localize your menu entries. See [multilingual].
[localize the menu entries]: /content-management/multilingual/#menus
[menu entry defined in front matter]: /content-management/menus/#example-front-matter
[menu entry defined in site configuration]: /content-management/menus/#example-site-configuration
-[menu and methods]: /methods/menu/
+[menu methods]: /methods/menu/
[multilingual]: /content-management/multilingual/#menus
diff --git a/content/en/templates/shortcode.md b/content/en/templates/shortcode.md
index 6d9234f71..5587c7479 100644
--- a/content/en/templates/shortcode.md
+++ b/content/en/templates/shortcode.md
@@ -37,12 +37,29 @@ You can organize your shortcodes in subdirectories, e.g. in `layouts/shortcodes/
Note the forward slash.
-### Shortcode template lookup order
+### Template lookup order
-Shortcode templates have a simple [lookup order]:
+Hugo selects shortcode templates based on the shortcode name, the current output format, and the current language. The examples below are sorted by specificity in descending order. The least specific path is at the bottom of the list.
-1. `/layouts/shortcodes/.html`
-2. `/themes//layouts/shortcodes/.html`
+Shortcode name|Output format|Language|Template path
+:--|:--|:--|:--
+foo|html|en|layouts/shortcodes/foo.en.html
+foo|html|en|layouts/shortcodes/foo.html.html
+foo|html|en|layouts/shortcodes/foo.html
+foo|html|en|layouts/shortcodes/foo.html.en.html
+
+Shortcode name|Output format|Language|Template path
+:--|:--|:--|:--
+foo|rss|en|layouts/shortcodes/foo.en.xml
+foo|rss|en|layouts/shortcodes/foo.rss.xml
+foo|rss|en|layouts/shortcodes/foo.en.html
+foo|rss|en|layouts/shortcodes/foo.rss.en.xml
+foo|rss|en|layouts/shortcodes/foo.xml
+foo|rss|en|layouts/shortcodes/foo.html.en.html
+foo|rss|en|layouts/shortcodes/foo.html.html
+foo|rss|en|layouts/shortcodes/foo.html
+
+Note that templates provided by a theme or module always take precedence.
### Positional vs. named arguments
diff --git a/content/en/tools/migrations.md b/content/en/tools/migrations.md
index 3a2cdac35..99064e271 100644
--- a/content/en/tools/migrations.md
+++ b/content/en/tools/migrations.md
@@ -13,9 +13,9 @@ toc: true
aliases: [/developer-tools/migrations/, /developer-tools/migrated/]
---
-This section highlights some projects around Hugo that are independently developed. These tools try to extend the functionality of our static site generator or help you to get started.
+This section highlights some independently developed projects related to Hugo. These tools extend functionality or help you to get started.
-Take a look at this list of migration tools if you currently use other blogging tools like Jekyll or WordPress but intend to switch to Hugo instead. They'll take care to export your content into Hugo-friendly formats.
+Take a look at this list of migration tools if you currently use other blogging tools like Jekyll or WordPress but intend to switch to Hugo instead. They'll help you export your content into Hugo-friendly formats.
## Jekyll
@@ -35,18 +35,18 @@ Alternatively, you can use the [Jekyll import command](/commands/hugo_import_jek
## DokuWiki
[dokuwiki-to-hugo](https://github.com/wgroeneveld/dokuwiki-to-hugo)
-: Migrates your DokuWiki source pages from [DokuWiki syntax](https://www.dokuwiki.org/wiki:syntax) to Hugo Markdown syntax. Includes extra's like the TODO plugin. Written with extensibility in mind using python 3. Also generates a TOML header for each page. Designed to copypaste the wiki directory into your /content directory.
+: Migrates your DokuWiki source pages from [DokuWiki syntax](https://www.dokuwiki.org/wiki:syntax) to Hugo Markdown syntax. Includes extras like the TODO plugin. Written with extensibility in mind using Python 3. Also generates a TOML header for each page. Designed to copy-paste the wiki directory into your /content directory.
## WordPress
[wordpress-to-hugo-exporter](https://github.com/SchumacherFM/wordpress-to-hugo-exporter)
-: A one-click WordPress plugin that converts all posts, pages, taxonomies, metadata, and settings to Markdown and YAML which can be dropped into Hugo. (Note: If you have trouble using this plugin, you can [export your site for Jekyll](https://wordpress.org/plugins/jekyll-exporter/) and use Hugo's built in Jekyll converter listed above.)
+: A one-click WordPress plugin that converts all posts, pages, taxonomies, metadata, and settings to Markdown and YAML which can be dropped into Hugo. (Note: If you have trouble using this plugin, you can [export your site for Jekyll](https://wordpress.org/plugins/jekyll-exporter/) and use Hugo's built-in Jekyll converter listed above.)
[blog2md](https://github.com/palaniraja/blog2md)
: Works with [exported xml](https://en.support.wordpress.com/export/) file of your free YOUR-TLD.wordpress.com website. It also saves approved comments to `YOUR-POST-NAME-comments.md` file along with posts.
[wordhugopress](https://github.com/nantipov/wordhugopress)
-: A small utility written in Java, exports the entire WordPress site from the database and resource (e.g. images) files stored locally or remotely. Therefore, migration from the backup files is possible. Supports merging of the multiple WordPress sites into a single Hugo one.
+: A small utility written in Java that exports the entire WordPress site from the database and resource (e.g., images) files stored locally or remotely. Therefore, migration from the backup files is possible. Supports merging multiple WordPress sites into a single Hugo site.
[wp2hugo](https://github.com/ashishb/wp2hugo)
: A Go-based CLI tool to migrate WordPress website to Hugo while preserving original URLs, GUIDs (for feeds), image URLs, code highlights, table of contents, YouTube embeds, Google Maps embeds, and original WordPress navigation categories.
@@ -57,7 +57,7 @@ Alternatively, you can use the [Jekyll import command](/commands/hugo_import_jek
: A simple Medium to Hugo exporter able to import stories in one command, including front matter.
[medium-to-hugo](https://github.com/bgadrian/medium-to-hugo)
-: CLI tool written in Go to export medium posts into a Hugo compatible Markdown format. Tags and images are included. All images will be downloaded locally and linked appropriately.
+: A CLI tool written in Go to export medium posts into a Hugo-compatible Markdown format. Tags and images are included. All images will be downloaded locally and linked appropriately.
## Tumblr
@@ -68,7 +68,7 @@ Alternatively, you can use the [Jekyll import command](/commands/hugo_import_jek
: Export all your Tumblr content to Hugo Markdown files with preserved original formatting.
[Tumblr to Hugo](https://github.com/jipiboily/tumblr-to-hugo)
-: A migration tool that converts each of your Tumblr posts to a content file with a proper title and path. Furthermore, "Tumblr to Hugo" creates a CSV file with the original URL and the new path on Hugo, to help you setup the redirections.
+: A migration tool that converts each of your Tumblr posts to a content file with a proper title and path. It also generates a CSV file to help you set up URL redirects.
## Drupal
diff --git a/content/en/tools/search.md b/content/en/tools/search.md
index 921d52f82..614bc511c 100644
--- a/content/en/tools/search.md
+++ b/content/en/tools/search.md
@@ -43,6 +43,10 @@ A static website with a dynamic search function? Yes, Hugo provides an alternati
[Hugo Lyra](https://github.com/paolomainardi/hugo-lyra)
: Hugo-Lyra is a JavaScript module to integrate [Lyra](https://github.com/LyraSearch/lyra) into a Hugo website. It contains the server-side part to generate the index and the client-side library (optional) to bootstrap the search engine easily.
+[INFINI Pizza for WebAssembly](https://github.com/infinilabs/pizza-docsearch)
+: Pizza is a super-lightweight yet fully featured search engine written in Rust. You can quickly add offline search functionality to your Hugo website in just five minutes with only three lines of code. For a step-by-step guide on integrating it with Hugo, check out [this blog tutorial](https://dev.to/medcl/adding-search-functionality-to-a-hugo-static-site-based-on-infini-pizza-for-webassembly-4h5e).
+
+
## Commercial
[Algolia](https://www.algolia.com/)
diff --git a/data/docs.yaml b/data/docs.yaml
index eecf2041e..8d97c21e0 100644
--- a/data/docs.yaml
+++ b/data/docs.yaml
@@ -978,6 +978,9 @@ config:
images:
dir: :resourceDir/_gen
maxAge: -1
+ misc:
+ dir: :cacheDir/:project
+ maxAge: -1
modules:
dir: :cacheDir/modules
maxAge: -1
@@ -1597,6 +1600,9 @@ config:
term:
- html
- rss
+ page:
+ nextPrevInSectionSortOrder: desc
+ nextPrevSortOrder: desc
paginate: 0
paginatePath: ""
pagination:
@@ -1781,6 +1787,8 @@ config_helpers:
_merge: shallow
outputs:
_merge: none
+ page:
+ _merge: none
pagination:
_merge: none
params:
@@ -1857,7 +1865,7 @@ output:
- layouts/_default/demolayout-baseof.html
- layouts/_default/single-baseof.html
- layouts/_default/baseof.html
- - Example: AMP single page
+ - Example: AMP single page in "posts" section
Kind: page
OutputFormat: amp
Suffix: html
@@ -1866,17 +1874,17 @@ output:
- layouts/posts/single.html
- layouts/_default/single.amp.html
- layouts/_default/single.html
- - Example: AMP single page, French language
+ - Example: AMP single page in "posts" section, French language
Kind: page
- OutputFormat: html
+ OutputFormat: amp
Suffix: html
Template Lookup Order:
- - layouts/posts/single.fr.html.html
- - layouts/posts/single.html.html
+ - layouts/posts/single.fr.amp.html
+ - layouts/posts/single.amp.html
- layouts/posts/single.fr.html
- layouts/posts/single.html
- - layouts/_default/single.fr.html.html
- - layouts/_default/single.html.html
+ - layouts/_default/single.fr.amp.html
+ - layouts/_default/single.amp.html
- layouts/_default/single.fr.html
- layouts/_default/single.html
- Example: Home page
@@ -2442,9 +2450,7 @@ tpl:
EchoParam returns the value in the collection c with key k if is set; otherwise, it returns an
empty string.
Deprecated: Use the index function instead.
- Examples:
- - - '{{ echoParam .Params "langCode" }}'
- - en
+ Examples: []
First:
Aliases:
- first
@@ -4673,6 +4679,11 @@ tpl:
{
"title": "Hello World"
}
+ ToMath:
+ Aliases: null
+ Args: null
+ Description: ""
+ Examples: null
Unmarshal:
Aliases:
- unmarshal
diff --git a/go.mod b/go.mod
index 51d5f3a43..7fd269069 100644
--- a/go.mod
+++ b/go.mod
@@ -2,4 +2,4 @@ module github.com/gohugoio/hugoDocs
go 1.16
-require github.com/gohugoio/gohugoioTheme v0.0.0-20240728210410-d42c342ce472 // indirect
+require github.com/gohugoio/gohugoioTheme v0.0.0-20240815082608-66ccd383a90f // indirect
diff --git a/go.sum b/go.sum
index 633446af0..4e5e32477 100644
--- a/go.sum
+++ b/go.sum
@@ -10,3 +10,7 @@ github.com/gohugoio/gohugoioTheme v0.0.0-20240623150114-cc7096eab3fd h1:I8X7c0oB
github.com/gohugoio/gohugoioTheme v0.0.0-20240623150114-cc7096eab3fd/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
github.com/gohugoio/gohugoioTheme v0.0.0-20240728210410-d42c342ce472 h1:AYZUibKKFRBp2VCQpDHW+JmQKvCvyhX7z7/SOLUSCcw=
github.com/gohugoio/gohugoioTheme v0.0.0-20240728210410-d42c342ce472/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
+github.com/gohugoio/gohugoioTheme v0.0.0-20240812175901-cc0ef8e4a14a h1:E3JbZo69eqFBz6B+meQlKyy/ZBZQ73ldVDw8TADiIrQ=
+github.com/gohugoio/gohugoioTheme v0.0.0-20240812175901-cc0ef8e4a14a/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
+github.com/gohugoio/gohugoioTheme v0.0.0-20240815082608-66ccd383a90f h1:Eo5z3uUYfmrtIxQvHm388dFOERZwWGTjLuUO6vobzLc=
+github.com/gohugoio/gohugoioTheme v0.0.0-20240815082608-66ccd383a90f/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
diff --git a/hugo.toml b/hugo.toml
index 63cc32798..2a271b6e3 100644
--- a/hugo.toml
+++ b/hugo.toml
@@ -5,7 +5,6 @@ defaultContentLanguage = "en"
enableEmoji = true
ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"]
languageCode = "en-us"
-paginate = 100
pluralizeListTitles = false
timeZone = "Europe/Oslo"
title = "Hugo"
@@ -13,6 +12,9 @@ title = "Hugo"
# We do redirects via Netlify's _redirects file, generated by Hugo (see "outputs" below).
disableAliases = true
+[pagination]
+pagerSize = 100
+
[services.googleAnalytics]
ID = 'G-MBZGKNMDWC'
diff --git a/layouts/shortcodes/img.html b/layouts/shortcodes/img.html
new file mode 100644
index 000000000..34476b3d8
--- /dev/null
+++ b/layouts/shortcodes/img.html
@@ -0,0 +1,381 @@
+{{- /*
+Renders the given image using the given filter, if any.
+
+@param {string} src The path to the image which must be a remote, page, or global resource.
+@param {string} [filter] The filter to apply to the image (case-insensitive).
+@param {string} [filterArgs] A comma-delimited list of arguments to pass to the filter.
+@param {bool} [example=false] If true, renders a before/after example.
+@param {int} [exampleWidth=384] Image width, in pixels, when rendering a before/after example.
+
+@returns {template.HTML}
+
+@examples
+
+ {{< img src="zion-national-park.jpg" >}}
+
+ {{< img src="zion-national-park.jpg" alt="Zion National Park" >}}
+
+ {{< img
+ src="zion-national-park.jpg"
+ alt="Zion National Park"
+ filter="grayscale"
+ >}}
+
+ {{< img
+ src="zion-national-park.jpg"
+ alt="Zion National Park"
+ filter="process"
+ filterArgs="resize 400x webp"
+ >}}
+
+ {{< img
+ src="zion-national-park.jpg"
+ alt="Zion National Park"
+ filter="colorize"
+ filterArgs="180,50,20"
+ >}}
+
+ {{< img
+ src="zion-national-park.jpg"
+ alt="Zion National Park"
+ filter="grayscale"
+ example=true
+ >}}
+
+ {{< img
+ src="zion-national-park.jpg"
+ alt="Zion National Park"
+ filter="grayscale"
+ example=true
+ exampleWidth=400
+ >}}
+
+ When using the text filter, provide the arguments in this order:
+
+ 0. The text
+ 1. The horizontal offset, in pixels, relative to the left of the image (default 20)
+ 2. The vertical offset, in pixels, relative to the top of the image (default 20)
+ 3. The font size in pixels (default 64)
+ 4. The line height (default 1.2)
+ 5. The font color (default #ffffff)
+
+ {{< img
+ src="images/examples/zion-national-park.jpg"
+ alt="Zion National Park"
+ filter="Text"
+ filterArgs="Zion National Park,25,250,56"
+ example=true
+ >}}
+
+ When using the padding filter, provide all arguments in this order:
+
+ 0. Padding top
+ 1. Padding right
+ 2. Padding bottom
+ 3. Padding right
+ 4. Canvas color
+
+ {{< img
+ src="images/examples/zion-national-park.jpg"
+ alt="Zion National Park"
+ filter="Padding"
+ filterArgs="20,50,20,50,#0705"
+ example=true
+ >}}
+
+*/}}
+
+{{- /* Initialize. */}}
+{{- $alt := "" }}
+{{- $src := "" }}
+{{- $filter := "" }}
+{{- $filterArgs := slice }}
+{{- $example := false }}
+{{- $exampleWidth := 384 }}
+
+{{- /* Default values to use with the text filter. */}}
+{{ $textFilterOpts := dict
+ "xOffset" 20
+ "yOffset" 20
+ "fontSize" 64
+ "lineHeight" 1.2
+ "fontColor" "#ffffff"
+ "fontPath" "https://github.com/google/fonts/raw/main/ofl/lato/Lato-Regular.ttf"
+}}
+
+{{- /* Get and validate parameters. */}}
+{{- with .Get "alt" }}
+ {{- $alt = .}}
+{{- end }}
+
+{{- with .Get "src" }}
+ {{- $src = . }}
+{{- else }}
+ {{- errorf "The %q shortcode requires a file parameter. See %s" .Name .Position }}
+{{- end }}
+
+{{- with .Get "filter" }}
+ {{- $filter = . | lower }}
+{{- end }}
+
+{{- $validFilters := slice
+ "autoorient" "brightness" "colorbalance" "colorize" "contrast" "dither"
+ "gamma" "gaussianblur" "grayscale" "hue" "invert" "none" "opacity" "overlay"
+ "padding" "pixelate" "process" "saturation" "sepia" "sigmoid" "text"
+ "unsharpmask"
+}}
+
+{{- with $filter }}
+ {{- if not (in $validFilters .) }}
+ {{- errorf "The filter passed to the %q shortcode is invalid. The filter must be one of %s. See %s" $.Name (delimit $validFilters ", " ", or ") $.Position }}
+ {{- end }}
+{{- end }}
+
+{{- with .Get "filterArgs" }}
+ {{- $filterArgs = split . "," }}
+ {{- $filterArgs = apply $filterArgs "trim" "." " " }}
+{{- end }}
+
+{{- if in (slice "false" false 0) (.Get "example") }}
+ {{- $example = false }}
+{{- else if in (slice "true" true 1) (.Get "example")}}
+ {{- $example = true }}
+{{- end }}
+
+{{- with .Get "exampleWidth" }}
+ {{- $exampleWidth = . | int }}
+{{- end }}
+
+{{- /* Get image. */}}
+{{- $ctx := dict "page" .Page "src" $src "name" .Name "position" .Position }}
+{{- $i := partial "inline/get-resource.html" $ctx }}
+
+{{- /* Resize if rendering before/after examples. */}}
+{{- if $example }}
+ {{- $i = $i.Resize (printf "%dx" $exampleWidth) }}
+{{- end }}
+
+{{- /* Create filter. */}}
+{{- $f := "" }}
+{{- $ctx := dict "filter" $filter "args" $filterArgs "name" .Name "position" .Position }}
+{{- if eq $filter "autoorient" }}
+ {{- $ctx = merge $ctx (dict "argsRequired" 0) }}
+ {{- template "validate-arg-count" $ctx }}
+ {{- $f = images.AutoOrient }}
+{{- else if eq $filter "brightness" }}
+ {{- $ctx = merge $ctx (dict "argsRequired" 1) }}
+ {{- template "validate-arg-count" $ctx }}
+ {{- $filterArgs = apply $filterArgs "float" "." }}
+ {{- $ctx = merge $ctx (dict "argName" "percentage" "argValue" (index $filterArgs 0) "min" -100 "max" 100) }}
+ {{- template "validate-arg-value" $ctx }}
+ {{- $f = images.Brightness (index $filterArgs 0) }}
+{{- else if eq $filter "colorbalance" }}
+ {{- $ctx = merge $ctx (dict "argsRequired" 3) }}
+ {{- template "validate-arg-count" $ctx }}
+ {{- $filterArgs = apply $filterArgs "float" "." }}
+ {{- $ctx = merge $ctx (dict "argName" "percentage red" "argValue" (index $filterArgs 0) "min" -100 "max" 500) }}
+ {{- template "validate-arg-value" $ctx }}
+ {{- $ctx = merge $ctx (dict "argName" "percentage green" "argValue" (index $filterArgs 1) "min" -100 "max" 500) }}
+ {{- template "validate-arg-value" $ctx }}
+ {{- $ctx = merge $ctx (dict "argName" "percentage blue" "argValue" (index $filterArgs 2) "min" -100 "max" 500) }}
+ {{- template "validate-arg-value" $ctx }}
+ {{- $f = images.ColorBalance (index $filterArgs 0) (index $filterArgs 1) (index $filterArgs 2) }}
+{{- else if eq $filter "colorize" }}
+ {{- $ctx = merge $ctx (dict "argsRequired" 3) }}
+ {{- template "validate-arg-count" $ctx }}
+ {{- $filterArgs = apply $filterArgs "float" "." }}
+ {{- $ctx = merge $ctx (dict "argName" "hue" "argValue" (index $filterArgs 0) "min" 0 "max" 360) }}
+ {{- template "validate-arg-value" $ctx }}
+ {{- $ctx = merge $ctx (dict "argName" "saturation" "argValue" (index $filterArgs 1) "min" 0 "max" 100) }}
+ {{- template "validate-arg-value" $ctx }}
+ {{- $ctx = merge $ctx (dict "argName" "percentage" "argValue" (index $filterArgs 2) "min" 0 "max" 100) }}
+ {{- template "validate-arg-value" $ctx }}
+ {{- $f = images.Colorize (index $filterArgs 0) (index $filterArgs 1) (index $filterArgs 2) }}
+{{- else if eq $filter "contrast" }}
+ {{- $ctx = merge $ctx (dict "argsRequired" 1) }}
+ {{- template "validate-arg-count" $ctx }}
+ {{- $filterArgs = apply $filterArgs "float" "." }}
+ {{- $ctx = merge $ctx (dict "argName" "percentage" "argValue" (index $filterArgs 0) "min" -100 "max" 100) }}
+ {{- template "validate-arg-value" $ctx }}
+ {{- $f = images.Contrast (index $filterArgs 0) }}
+{{- else if eq $filter "dither" }}
+ {{- $f = images.Dither }}
+{{- else if eq $filter "gamma" }}
+ {{- $ctx = merge $ctx (dict "argsRequired" 1) }}
+ {{- template "validate-arg-count" $ctx }}
+ {{- $filterArgs = apply $filterArgs "float" "." }}
+ {{- $ctx = merge $ctx (dict "argName" "gamma" "argValue" (index $filterArgs 0) "min" 0 "max" 100) }}
+ {{- template "validate-arg-value" $ctx }}
+ {{- $f = images.Gamma (index $filterArgs 0) }}
+{{- else if eq $filter "gaussianblur" }}
+ {{- $ctx = merge $ctx (dict "argsRequired" 1) }}
+ {{- template "validate-arg-count" $ctx }}
+ {{- $filterArgs = apply $filterArgs "float" "." }}
+ {{- $ctx = merge $ctx (dict "argName" "sigma" "argValue" (index $filterArgs 0) "min" 0 "max" 1000) }}
+ {{- template "validate-arg-value" $ctx }}
+ {{- $f = images.GaussianBlur (index $filterArgs 0) }}
+{{- else if eq $filter "grayscale" }}
+ {{- $ctx = merge $ctx (dict "argsRequired" 0) }}
+ {{- template "validate-arg-count" $ctx }}
+ {{- $f = images.Grayscale }}
+{{- else if eq $filter "hue" }}
+ {{- $ctx = merge $ctx (dict "argsRequired" 1) }}
+ {{- template "validate-arg-count" $ctx }}
+ {{- $filterArgs = apply $filterArgs "float" "." }}
+ {{- $ctx = merge $ctx (dict "argName" "shift" "argValue" (index $filterArgs 0) "min" -180 "max" 180) }}
+ {{- template "validate-arg-value" $ctx }}
+ {{- $f = images.Hue (index $filterArgs 0) }}
+{{- else if eq $filter "invert" }}
+ {{- $ctx = merge $ctx (dict "argsRequired" 0) }}
+ {{- template "validate-arg-count" $ctx }}
+ {{- $f = images.Invert }}
+{{- else if eq $filter "opacity" }}
+ {{- $ctx = merge $ctx (dict "argsRequired" 1) }}
+ {{- template "validate-arg-count" $ctx }}
+ {{- $filterArgs = apply $filterArgs "float" "." }}
+ {{- $ctx = merge $ctx (dict "argName" "opacity" "argValue" (index $filterArgs 0) "min" 0 "max" 1) }}
+ {{- template "validate-arg-value" $ctx }}
+ {{- $f = images.Opacity (index $filterArgs 0) }}
+{{- else if eq $filter "overlay" }}
+ {{- $ctx = merge $ctx (dict "argsRequired" 3) }}
+ {{- template "validate-arg-count" $ctx }}
+ {{- $ctx := dict "src" (index $filterArgs 0) "name" .Name "position" .Position }}
+ {{- $overlayImg := partial "inline/get-resource.html" $ctx }}
+ {{- $f = images.Overlay $overlayImg (index $filterArgs 1 | float ) (index $filterArgs 2 | float) }}
+{{- else if eq $filter "padding" }}
+ {{- $ctx = merge $ctx (dict "argsRequired" 5) }}
+ {{- template "validate-arg-count" $ctx }}
+ {{- $f = images.Padding
+ (index $filterArgs 0 | int)
+ (index $filterArgs 1 | int)
+ (index $filterArgs 2 | int)
+ (index $filterArgs 3 | int)
+ (index $filterArgs 4)
+ }}
+{{- else if eq $filter "pixelate" }}
+ {{- $ctx = merge $ctx (dict "argsRequired" 1) }}
+ {{- template "validate-arg-count" $ctx }}
+ {{- $filterArgs = apply $filterArgs "float" "." }}
+ {{- $ctx = merge $ctx (dict "argName" "size" "argValue" (index $filterArgs 0) "min" 0 "max" 1000) }}
+ {{- template "validate-arg-value" $ctx }}
+ {{- $f = images.Pixelate (index $filterArgs 0) }}
+{{- else if eq $filter "process" }}
+ {{- $ctx = merge $ctx (dict "argsRequired" 1) }}
+ {{- template "validate-arg-count" $ctx }}
+ {{- $f = images.Process (index $filterArgs 0) }}
+{{- else if eq $filter "saturation" }}
+ {{- $ctx = merge $ctx (dict "argsRequired" 1) }}
+ {{- template "validate-arg-count" $ctx }}
+ {{- $filterArgs = apply $filterArgs "float" "." }}
+ {{- $ctx = merge $ctx (dict "argName" "percentage" "argValue" (index $filterArgs 0) "min" -100 "max" 500) }}
+ {{- template "validate-arg-value" $ctx }}
+ {{- $f = images.Saturation (index $filterArgs 0) }}
+{{- else if eq $filter "sepia" }}
+ {{- $ctx = merge $ctx (dict "argsRequired" 1) }}
+ {{- template "validate-arg-count" $ctx }}
+ {{- $filterArgs = apply $filterArgs "float" "." }}
+ {{- $ctx = merge $ctx (dict "argName" "percentage" "argValue" (index $filterArgs 0) "min" 0 "max" 100) }}
+ {{- template "validate-arg-value" $ctx }}
+ {{- $f = images.Sepia (index $filterArgs 0) }}
+{{- else if eq $filter "sigmoid" }}
+ {{- $ctx = merge $ctx (dict "argsRequired" 2) }}
+ {{- template "validate-arg-count" $ctx }}
+ {{- $filterArgs = apply $filterArgs "float" "." }}
+ {{- $ctx = merge $ctx (dict "argName" "midpoint" "argValue" (index $filterArgs 0) "min" 0 "max" 1) }}
+ {{- template "validate-arg-value" $ctx }}
+ {{- $ctx = merge $ctx (dict "argName" "factor" "argValue" (index $filterArgs 1) "min" -10 "max" 10) }}
+ {{- template "validate-arg-value" $ctx }}
+ {{- $f = images.Sigmoid (index $filterArgs 0) (index $filterArgs 1) }}
+{{- else if eq $filter "text" }}
+ {{- $ctx = merge $ctx (dict "argsRequired" 1) }}
+ {{- template "validate-arg-count" $ctx }}
+ {{- $ctx := dict "src" $textFilterOpts.fontPath "name" .Name "position" .Position }}
+ {{- $font := or (partial "inline/get-resource.html" $ctx) }}
+ {{- $fontSize := or (index $filterArgs 3 | int) $textFilterOpts.fontSize }}
+ {{- $lineHeight := math.Max (or (index $filterArgs 4 | float) $textFilterOpts.lineHeight) 1 }}
+ {{- $opts := dict
+ "x" (or (index $filterArgs 1 | int) $textFilterOpts.xOffset)
+ "y" (or (index $filterArgs 2 | int) $textFilterOpts.yOffset)
+ "size" $fontSize
+ "linespacing" (mul (sub $lineHeight 1) $fontSize)
+ "color" (or (index $filterArgs 5) $textFilterOpts.fontColor)
+ "font" $font
+ }}
+ {{- $f = images.Text (index $filterArgs 0) $opts }}
+{{- else if eq $filter "unsharpmask" }}
+ {{- $ctx = merge $ctx (dict "argsRequired" 3) }}
+ {{- template "validate-arg-count" $ctx }}
+ {{- $filterArgs = apply $filterArgs "float" "." }}
+ {{- $ctx = merge $ctx (dict "argName" "sigma" "argValue" (index $filterArgs 0) "min" 0 "max" 500) }}
+ {{- template "validate-arg-value" $ctx }}
+ {{- $ctx = merge $ctx (dict "argName" "amount" "argValue" (index $filterArgs 1) "min" 0 "max" 100) }}
+ {{- template "validate-arg-value" $ctx }}
+ {{- $ctx = merge $ctx (dict "argName" "threshold" "argValue" (index $filterArgs 2) "min" 0 "max" 1) }}
+ {{- template "validate-arg-value" $ctx }}
+ {{- $f = images.UnsharpMask (index $filterArgs 0) (index $filterArgs 1) (index $filterArgs 2) }}
+{{- end }}
+
+{{- /* Apply filter. */}}
+{{- $fi := $i }}
+{{- with $f }}
+ {{- $fi = $i.Filter . }}
+{{- end }}
+
+{{- /* Render. */}}
+{{- if $example }}
+ Original
+
+ Processed
+
+{{- else -}}
+
+{{- end }}
+
+{{- define "validate-arg-count" }}
+ {{- $msg := "When using the %q filter, the %q shortcode requires an args parameter with %d %s. See %s" }}
+ {{- if lt (len .args) .argsRequired }}
+ {{- $text := "values" }}
+ {{- if eq 1 .argsRequired }}
+ {{- $text = "value" }}
+ {{- end }}
+ {{- errorf $msg .filter .name .argsRequired $text .position }}
+ {{- end }}
+{{- end }}
+
+{{- define "validate-arg-value" }}
+ {{- $msg := "The %q argument passed to the %q shortcode is invalid. Expected a value in the range [%v,%v], but received %v. See %s" }}
+ {{- if or (lt .argValue .min) (gt .argValue .max) }}
+ {{- errorf $msg .argName .name .min .max .argValue .position }}
+ {{- end }}
+{{- end }}
+
+{{- define "partials/inline/get-resource.html" }}
+ {{- $r := "" }}
+ {{- $u := urls.Parse .src }}
+ {{- $msg := "The %q shortcode was unable to resolve %s. See %s" }}
+ {{- if $u.IsAbs }}
+ {{- with resources.GetRemote $u.String }}
+ {{- with .Err }}
+ {{- errorf "%s" }}
+ {{- else }}
+ {{- /* This is a remote resource. */}}
+ {{- $r = . }}
+ {{- end }}
+ {{- else }}
+ {{- errorf $msg $.name $u.String $.position }}
+ {{- end }}
+ {{- else }}
+ {{- with .page.Resources.Get (strings.TrimPrefix "./" $u.Path) }}
+ {{- /* This is a page resource. */}}
+ {{- $r = . }}
+ {{- else }}
+ {{- with resources.Get $u.Path }}
+ {{- /* This is a global resource. */}}
+ {{- $r = . }}
+ {{- else }}
+ {{- errorf $msg $.name $u.Path $.position }}
+ {{- end }}
+ {{- end }}
+ {{- end }}
+ {{- return $r}}
+{{- end -}}
diff --git a/netlify.toml b/netlify.toml
index f7f1a5f04..44c10a3c9 100644
--- a/netlify.toml
+++ b/netlify.toml
@@ -3,7 +3,7 @@
command = "hugo --gc --minify"
[build.environment]
- HUGO_VERSION = "0.131.0"
+ HUGO_VERSION = "0.133.1"
[context.production.environment]
HUGO_ENV = "production"
From e651d29801325095cb6a684fb7ce31934ce2906c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?=
Date: Sun, 1 Sep 2024 12:00:13 +0200
Subject: [PATCH 036/570] Add support for Obsidian type blockquote alerts
* Make the alert type parsing more flexible to support more types
* Add `AlertTitle` and `AlertSign` (for folding)
Note that GitHub will not render callouts with alert title/sign.
See https://help.obsidian.md/Editing+and+formatting/Callouts
Closes #12805
Closes #12801
---
docs/content/en/render-hooks/blockquotes.md | 20 ++++++-
markup/converter/hooks/hooks.go | 10 ++++
markup/goldmark/blockquotes/blockquotes.go | 55 ++++++++++++-------
.../blockquotes_integration_test.go | 45 +++++++++++++++
.../goldmark/blockquotes/blockquotes_test.go | 38 ++++++++-----
5 files changed, 129 insertions(+), 39 deletions(-)
diff --git a/docs/content/en/render-hooks/blockquotes.md b/docs/content/en/render-hooks/blockquotes.md
index e0eda5c51..607514f04 100755
--- a/docs/content/en/render-hooks/blockquotes.md
+++ b/docs/content/en/render-hooks/blockquotes.md
@@ -24,6 +24,20 @@ Blockquote render hook templates receive the following [context]:
(`string`) Applicable when [`Type`](#type) is `alert`, this is the alert type converted to lowercase. See the [alerts](#alerts) section below.
+###### AlertTitle
+
+{{< new-in 0.134.0 >}}
+
+(`hstring.HTML`) Applicable when [`Type`](#type) is `alert` when using [Obsidian callouts] syntax, this is the alert title converted to HTML.
+
+###### AlertSign
+
+{{< new-in 0.134.0 >}}
+
+(`string`) Applicable when [`Type`](#type) is `alert` when using [Obsidian callouts] syntax, this is one of "+", "-" or "" (empty string) to indicate the presence of a foldable sign.
+
+[Obsidian callouts]: https://help.obsidian.md/Editing+and+formatting/Callouts
+
###### Attributes
(`map`) The [Markdown attributes], available if you configure your site as follows:
@@ -117,13 +131,13 @@ Also known as _callouts_ or _admonitions_, alerts are blockquotes used to emphas
{{% note %}}
-This syntax is compatible with the GitHub Alert Markdown extension.
+This syntax is compatible with both the GitHub Alert Markdown extension and Obsidian's callout syntax.
+But note that GitHub will not recognize callouts with one of Obsidian's extensions (e.g. callout title or the foldable sign).
{{% /note %}}
-
The first line of each alert is an alert designator consisting of an exclamation point followed by the alert type, wrapped within brackets.
-The blockquote render hook below renders a multilingual alert if an alert desginator is present, otherwise it renders a blockquote according to the CommonMark specification.
+The blockquote render hook below renders a multilingual alert if an alert designator is present, otherwise it renders a blockquote according to the CommonMark specification.
{{< code file=layouts/_default/_markup/render-blockquote.html copy=true >}}
{{ $emojis := dict
diff --git a/markup/converter/hooks/hooks.go b/markup/converter/hooks/hooks.go
index 96c165321..1fc513acb 100644
--- a/markup/converter/hooks/hooks.go
+++ b/markup/converter/hooks/hooks.go
@@ -109,6 +109,16 @@ type BlockquoteContext interface {
// The GitHub alert type converted to lowercase, e.g. "note".
// Only set if Type is "alert".
AlertType() string
+
+ // The alert title.
+ // Currently only relevant for Obsidian alerts.
+ // GitHub does not suport alert titles and will not render alerts with titles.
+ AlertTitle() hstring.HTML
+
+ // The alert sign, "+" or "-" or "" used to indicate folding.
+ // Currently only relevant for Obsidian alerts.
+ // GitHub does not suport alert signs and will not render alerts with signs.
+ AlertSign() string
}
type PositionerSourceTargetProvider interface {
diff --git a/markup/goldmark/blockquotes/blockquotes.go b/markup/goldmark/blockquotes/blockquotes.go
index bf1e848b8..f6d1a590e 100644
--- a/markup/goldmark/blockquotes/blockquotes.go
+++ b/markup/goldmark/blockquotes/blockquotes.go
@@ -74,8 +74,8 @@ func (r *htmlRenderer) renderBlockquote(w util.BufWriter, src []byte, node ast.N
ordinal := ctx.GetAndIncrementOrdinal(ast.KindBlockquote)
typ := typeRegular
- alertType := resolveGitHubAlert(string(text))
- if alertType != "" {
+ alert := resolveBlockQuoteAlert(string(text))
+ if alert.typ != "" {
typ = typeAlert
}
@@ -94,7 +94,7 @@ func (r *htmlRenderer) renderBlockquote(w util.BufWriter, src []byte, node ast.N
bqctx := &blockquoteContext{
BaseContext: render.NewBaseContext(ctx, renderer, n, src, nil, ordinal),
typ: typ,
- alertType: alertType,
+ alert: alert,
text: hstring.HTML(text),
AttributesHolder: attributes.New(n.Attributes(), attributes.AttributesOwnerGeneral),
}
@@ -133,11 +133,9 @@ func (r *htmlRenderer) renderBlockquoteDefault(
type blockquoteContext struct {
hooks.BaseContext
-
- text hstring.HTML
- alertType string
- typ string
-
+ text hstring.HTML
+ typ string
+ alert blockQuoteAlert
*attributes.AttributesHolder
}
@@ -146,25 +144,40 @@ func (c *blockquoteContext) Type() string {
}
func (c *blockquoteContext) AlertType() string {
- return c.alertType
+ return c.alert.typ
+}
+
+func (c *blockquoteContext) AlertTitle() hstring.HTML {
+ return hstring.HTML(c.alert.title)
+}
+
+func (c *blockquoteContext) AlertSign() string {
+ return c.alert.sign
}
func (c *blockquoteContext) Text() hstring.HTML {
return c.text
}
-// https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts
-// Five types:
-// [!NOTE], [!TIP], [!WARNING], [!IMPORTANT], [!CAUTION]
-// Note that GitHub's implementation is case-insensitive.
-var gitHubAlertRe = regexp.MustCompile(`(?i)^\[!(NOTE|TIP|WARNING|IMPORTANT|CAUTION)\]`)
+var blockQuoteAlertRe = regexp.MustCompile(`^
\[!([a-zA-Z]+)\](-|\+)?[^\S\r\n]?([^\n]*)\n?`)
-// resolveGitHubAlert returns one of note, tip, warning, important or caution.
-// An empty string if no match.
-func resolveGitHubAlert(s string) string {
- m := gitHubAlertRe.FindStringSubmatch(s)
- if len(m) == 2 {
- return strings.ToLower(m[1])
+func resolveBlockQuoteAlert(s string) blockQuoteAlert {
+ m := blockQuoteAlertRe.FindStringSubmatch(s)
+ if len(m) == 4 {
+ return blockQuoteAlert{
+ typ: strings.ToLower(m[1]),
+ sign: m[2],
+ title: m[3],
+ }
}
- return ""
+
+ return blockQuoteAlert{}
+}
+
+// Blockquote alert syntax was introduced by GitHub, but is also used
+// by Obsidian which also support some extended attributes: More types, alert titles and a +/- sign for folding.
+type blockQuoteAlert struct {
+ typ string
+ sign string
+ title string
}
diff --git a/markup/goldmark/blockquotes/blockquotes_integration_test.go b/markup/goldmark/blockquotes/blockquotes_integration_test.go
index f12600b42..ae52b9ba7 100644
--- a/markup/goldmark/blockquotes/blockquotes_integration_test.go
+++ b/markup/goldmark/blockquotes/blockquotes_integration_test.go
@@ -109,3 +109,48 @@ Content: {{ .Content }}
b := hugolib.Test(t, files)
b.AssertFileContent("public/p1/index.html", "Content:
\n \n")
}
+
+func TestBlockquObsidianWithTitleAndSign(t *testing.T) {
+ t.Parallel()
+
+ files := `
+-- hugo.toml --
+-- content/_index.md --
+---
+title: "Home"
+---
+
+> [!danger]
+> Do not approach or handle without protective gear.
+
+
+> [!tip] Callouts can have custom titles
+> Like this one.
+
+> [!tip] Title-only callout
+
+> [!faq]- Foldable negated callout
+> Yes! In a foldable callout, the contents are hidden when the callout is collapsed
+
+> [!faq]+ Foldable callout
+> Yes! In a foldable callout, the contents are hidden when the callout is collapsed
+
+-- layouts/index.html --
+{{ .Content }}
+-- layouts/_default/_markup/render-blockquote.html --
+AlertType: {{ .AlertType }}|
+AlertTitle: {{ .AlertTitle }}|
+AlertSign: {{ .AlertSign | safeHTML }}|
+Text: {{ .Text }}|
+
+ `
+
+ b := hugolib.Test(t, files)
+ b.AssertFileContent("public/index.html",
+ "AlertType: tip|\nAlertTitle: Callouts can have custom titles|\nAlertSign: |",
+ "AlertType: tip|\nAlertTitle: Title-only callout|\nAlertSign: |",
+ "AlertType: faq|\nAlertTitle: Foldable negated callout|\nAlertSign: -|\nText: Yes!",
+ "AlertType: faq|\nAlertTitle: Foldable callout|\nAlertSign: +|",
+ "AlertType: danger|\nAlertTitle: |\nAlertSign: |\nText:
Do not approach or handle without protective gear.
\n|",
+ )
+}
diff --git a/markup/goldmark/blockquotes/blockquotes_test.go b/markup/goldmark/blockquotes/blockquotes_test.go
index 5b2680a0d..8b948af08 100644
--- a/markup/goldmark/blockquotes/blockquotes_test.go
+++ b/markup/goldmark/blockquotes/blockquotes_test.go
@@ -19,42 +19,50 @@ import (
qt "github.com/frankban/quicktest"
)
-func TestResolveGitHubAlert(t *testing.T) {
+func TestResolveBlockQuoteAlert(t *testing.T) {
t.Parallel()
c := qt.New(t)
tests := []struct {
input string
- expected string
+ expected blockQuoteAlert
}{
{
input: "[!NOTE]",
- expected: "note",
+ expected: blockQuoteAlert{typ: "note"},
},
{
- input: "[!WARNING]",
- expected: "warning",
+ input: "[!FaQ]",
+ expected: blockQuoteAlert{typ: "faq"},
},
{
- input: "[!TIP]",
- expected: "tip",
+ input: "[!NOTE]+",
+ expected: blockQuoteAlert{typ: "note", sign: "+"},
},
{
- input: "[!IMPORTANT]",
- expected: "important",
+ input: "[!NOTE]-",
+ expected: blockQuoteAlert{typ: "note", sign: "-"},
},
{
- input: "[!CAUTION]",
- expected: "caution",
+ input: "[!NOTE] This is a note",
+ expected: blockQuoteAlert{typ: "note", title: "This is a note"},
},
{
- input: "[!FOO]",
- expected: "",
+ input: "[!NOTE]+ This is a note",
+ expected: blockQuoteAlert{typ: "note", sign: "+", title: "This is a note"},
+ },
+ {
+ input: "[!NOTE]+ This is a title\nThis is not.",
+ expected: blockQuoteAlert{typ: "note", sign: "+", title: "This is a title"},
+ },
+ {
+ input: "[!NOTE]\nThis is not.",
+ expected: blockQuoteAlert{typ: "note"},
},
}
- for _, test := range tests {
- c.Assert(resolveGitHubAlert(""+test.input), qt.Equals, test.expected)
+ for i, test := range tests {
+ c.Assert(resolveBlockQuoteAlert("
"+test.input), qt.Equals, test.expected, qt.Commentf("Test %d", i))
}
}
From 504a23184f035a0de816cc29070e5d0920e23ed0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?=
Date: Sun, 1 Sep 2024 18:25:10 +0200
Subject: [PATCH 037/570] markup/goldmark/blockquotes: Improve some tests
---
.../blockquotes_integration_test.go | 21 ++++++++-----------
1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/markup/goldmark/blockquotes/blockquotes_integration_test.go b/markup/goldmark/blockquotes/blockquotes_integration_test.go
index ae52b9ba7..af3c1fba4 100644
--- a/markup/goldmark/blockquotes/blockquotes_integration_test.go
+++ b/markup/goldmark/blockquotes/blockquotes_integration_test.go
@@ -76,7 +76,7 @@ title: "p1"
`
b := hugolib.Test(t, files)
- b.AssertFileContent("public/p1/index.html",
+ b.AssertFileContentExact("public/p1/index.html",
"Blockquote Alert: |This is a note with some whitespace after the alert type.
\n|alert|",
"Blockquote Alert: |This is a tip.
",
"Blockquote Alert: |This is a caution with some whitespace before the alert type.
\n|alert|",
@@ -107,7 +107,7 @@ Content: {{ .Content }}
`
b := hugolib.Test(t, files)
- b.AssertFileContent("public/p1/index.html", "Content: \n \n")
+ b.AssertFileContentExact("public/p1/index.html", "Content: \n \n")
}
func TestBlockquObsidianWithTitleAndSign(t *testing.T) {
@@ -138,19 +138,16 @@ title: "Home"
-- layouts/index.html --
{{ .Content }}
-- layouts/_default/_markup/render-blockquote.html --
-AlertType: {{ .AlertType }}|
-AlertTitle: {{ .AlertTitle }}|
-AlertSign: {{ .AlertSign | safeHTML }}|
-Text: {{ .Text }}|
+AlertType: {{ .AlertType }}|AlertTitle: {{ .AlertTitle }}|AlertSign: {{ .AlertSign | safeHTML }}|Text: {{ .Text }}|
`
b := hugolib.Test(t, files)
- b.AssertFileContent("public/index.html",
- "AlertType: tip|\nAlertTitle: Callouts can have custom titles|\nAlertSign: |",
- "AlertType: tip|\nAlertTitle: Title-only callout
|\nAlertSign: |",
- "AlertType: faq|\nAlertTitle: Foldable negated callout|\nAlertSign: -|\nText: Yes!",
- "AlertType: faq|\nAlertTitle: Foldable callout|\nAlertSign: +|",
- "AlertType: danger|\nAlertTitle: |\nAlertSign: |\nText:
Do not approach or handle without protective gear.
\n|",
+ b.AssertFileContentExact("public/index.html",
+ "AlertType: tip|AlertTitle: Callouts can have custom titles|AlertSign: |",
+ "AlertType: tip|AlertTitle: Title-only callout|AlertSign: |",
+ "AlertType: faq|AlertTitle: Foldable negated callout|AlertSign: -|Text: Yes!",
+ "AlertType: faq|AlertTitle: Foldable callout|AlertSign: +|",
+ "AlertType: danger|AlertTitle: |AlertSign: |Text:
Do not approach or handle without protective gear.
\n|",
)
}
From ae3815898f22da507944ac6f394680079b2c7cf3 Mon Sep 17 00:00:00 2001
From: Aymen Rachdi <45432048+offgrid88@users.noreply.github.com>
Date: Mon, 2 Sep 2024 13:06:10 +0100
Subject: [PATCH 038/570] Update Dockerfile
---
Dockerfile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Dockerfile b/Dockerfile
index cc41d0ca1..fb72b77f1 100755
--- a/Dockerfile
+++ b/Dockerfile
@@ -2,7 +2,7 @@
# Twitter: https://twitter.com/gohugoio
# Website: https://gohugo.io/
-FROM golang:1.21-alpine AS build
+FROM golang:1.22.6-alpine AS build
# Optionally set HUGO_BUILD_TAGS to "extended" or "nodeploy" when building like so:
# docker build --build-arg HUGO_BUILD_TAGS=extended .
From 77df7bbbff8ce6b56ed693270088de973a87d5ce Mon Sep 17 00:00:00 2001
From: hugoreleaser
Date: Tue, 3 Sep 2024 09:54:22 +0000
Subject: [PATCH 039/570] releaser: Bump versions for release of 0.134.0
[ci skip]
---
common/hugo/version_current.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/common/hugo/version_current.go b/common/hugo/version_current.go
index be502515a..3371b2ae3 100644
--- a/common/hugo/version_current.go
+++ b/common/hugo/version_current.go
@@ -19,5 +19,5 @@ var CurrentVersion = Version{
Major: 0,
Minor: 134,
PatchLevel: 0,
- Suffix: "-DEV",
+ Suffix: "",
}
From aacff7aff4fefd88bc7da9f7e4517ca33a9bac7b Mon Sep 17 00:00:00 2001
From: hugoreleaser
Date: Tue, 3 Sep 2024 10:14:44 +0000
Subject: [PATCH 040/570] releaser: Prepare repository for 0.135.0-DEV
[ci skip]
---
common/hugo/version_current.go | 4 ++--
hugoreleaser.env | 5 +++--
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/common/hugo/version_current.go b/common/hugo/version_current.go
index 3371b2ae3..21442b238 100644
--- a/common/hugo/version_current.go
+++ b/common/hugo/version_current.go
@@ -17,7 +17,7 @@ package hugo
// This should be the only one.
var CurrentVersion = Version{
Major: 0,
- Minor: 134,
+ Minor: 135,
PatchLevel: 0,
- Suffix: "",
+ Suffix: "-DEV",
}
diff --git a/hugoreleaser.env b/hugoreleaser.env
index 988c80653..1c0d4a820 100644
--- a/hugoreleaser.env
+++ b/hugoreleaser.env
@@ -1,7 +1,8 @@
# Release env.
# These will be replaced by script before release.
-HUGORELEASER_TAG=v0.133.1
-HUGORELEASER_COMMITISH=47d00202e7e61769ce4d14691e43b27852c9cce4
+HUGORELEASER_TAG=v0.134.0
+HUGORELEASER_COMMITISH=77df7bbbff8ce6b56ed693270088de973a87d5ce
+
From 39fd3b557014e339bc6c68a7ff34a7734a735ee0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?=
Date: Wed, 4 Sep 2024 18:52:05 +0200
Subject: [PATCH 041/570] Squashed 'docs/' changes from a49697e53..ccb1b97cb
ccb1b97cb Update blockquotes.md
a5f51431c Add new-in label
39dac5838 Document ContentWithoutSummary
de3c75694 Clarify blockquote render hook Markdown syntax
d32f7856d Document change to data type returned by render hook Text methods
83fe7ccc3 Document table render hooks
601234147 netlify: Hugo 0.134.0
a583640a0 Add support for Obsidian type blockquote alerts
3e0080861 Merge commit 'dec8cd4ada29218971743333f8ac662a9c06aad8'
2dde06576 output: Fix docshelper template lookup order for AMP pages
git-subtree-dir: docs
git-subtree-split: ccb1b97cbb11e60aab0108b33a270cccdd2218f6
---
content/en/about/features.md | 2 +-
content/en/content-management/summaries.md | 10 +-
content/en/methods/page/Content.md | 6 +-
.../en/methods/page/ContentWithoutSummary.md | 28 +++++
content/en/methods/page/Plain.md | 4 +-
content/en/methods/page/PlainWords.md | 3 +
content/en/methods/page/RawContent.md | 2 +
content/en/methods/page/RenderShortcodes.md | 4 +-
content/en/render-hooks/blockquotes.md | 62 +++++++---
content/en/render-hooks/headings.md | 6 +-
content/en/render-hooks/images.md | 4 +-
content/en/render-hooks/introduction.md | 5 +-
content/en/render-hooks/links.md | 8 +-
content/en/render-hooks/tables.md | 106 ++++++++++++++++++
netlify.toml | 2 +-
15 files changed, 217 insertions(+), 35 deletions(-)
create mode 100644 content/en/methods/page/ContentWithoutSummary.md
create mode 100755 content/en/render-hooks/tables.md
diff --git a/content/en/about/features.md b/content/en/about/features.md
index 835384723..58d324853 100644
--- a/content/en/about/features.md
+++ b/content/en/about/features.md
@@ -49,7 +49,7 @@ toc: true
: Leverage the embedded Markdown extensions to create tables, definition lists, footnotes, task lists, inserted text, mark text, subscripts, superscripts, and more.
[Markdown render hooks]
-: Override the conversion of Markdown to HTML when rendering blockquotes, fenced code blocks, headings, images, and links. For example, render every standalone image as an HTML `figure` element.
+: Override the conversion of Markdown to HTML when rendering blockquotes, fenced code blocks, headings, images, links, and tables. For example, render every standalone image as an HTML `figure` element.
[Diagrams]
: Use fenced code blocks and Markdown render hooks to include diagrams in your content.
diff --git a/content/en/content-management/summaries.md b/content/en/content-management/summaries.md
index 7b81cf0a0..e0b2c9590 100644
--- a/content/en/content-management/summaries.md
+++ b/content/en/content-management/summaries.md
@@ -92,11 +92,11 @@ Note that the `summaryLength` is an approximate number of words.
Each summary type has different characteristics:
-Type|Precedence|Renders markdown|Renders shortcodes|Strips HTML tags|Wraps single lines with ``
-:--|:-:|:-:|:-:|:-:|:-:
-Manual|1|:heavy_check_mark:|:heavy_check_mark:|:x:|:heavy_check_mark:
-Front matter|2|:heavy_check_mark:|:x:|:x:|:x:
-Automatic|3|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:x:
+Type|Precedence|Renders markdown|Renders shortcodes|Wraps single lines with `
`
+:--|:-:|:-:|:-:|:-:
+Manual|1|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:
+Front matter|2|:heavy_check_mark:|:x:|:x:
+Automatic|3|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:
## Rendering
diff --git a/content/en/methods/page/Content.md b/content/en/methods/page/Content.md
index a9d38367c..373c6590a 100644
--- a/content/en/methods/page/Content.md
+++ b/content/en/methods/page/Content.md
@@ -5,6 +5,8 @@ categories: []
keywords: []
action:
related:
+ - methods/page/Summary
+ - methods/page/ContentWithoutSummary
- methods/page/RawContent
- methods/page/Plain
- methods/page/PlainWords
@@ -13,9 +15,7 @@ action:
signatures: [PAGE.Content]
---
-The `Content` method on a `Page` object renders Markdown and shortcodes to HTML. The content does not include front matter.
-
-[shortcodes]: /getting-started/glossary/#shortcode
+The `Content` method on a `Page` object renders Markdown and shortcodes to HTML.
```go-html-template
{{ .Content }}
diff --git a/content/en/methods/page/ContentWithoutSummary.md b/content/en/methods/page/ContentWithoutSummary.md
new file mode 100644
index 000000000..5080f6717
--- /dev/null
+++ b/content/en/methods/page/ContentWithoutSummary.md
@@ -0,0 +1,28 @@
+---
+title: ContentWithoutSummary
+description: Returns the rendered content of the given page, excluding the content summary.
+categories: []
+keywords: []
+action:
+ related:
+ - methods/page/Content
+ - methods/page/Summary
+ - methods/page/RawContent
+ - methods/page/Plain
+ - methods/page/PlainWords
+ - methods/page/RenderShortcodes
+ returnType: template.HTML
+ signatures: [PAGE.ContentWithoutSummary]
+---
+
+{{< new-in 0.134.0 >}}
+
+Applicable when using manual or automatic [content summaries], the `ContentWithoutSummary` method on a `Page` object renders Markdown and shortcodes to HTML, excluding the content summary from the result.
+
+[content summaries]: /content-management/summaries/#manual-summary
+
+```go-html-template
+{{ .ContentWithoutSummary }}
+```
+
+The `ContentWithoutSummary` method returns an empty string if you define the content summary in front matter.
diff --git a/content/en/methods/page/Plain.md b/content/en/methods/page/Plain.md
index 3aae1ed61..06d2bde48 100644
--- a/content/en/methods/page/Plain.md
+++ b/content/en/methods/page/Plain.md
@@ -6,6 +6,8 @@ keywords: []
action:
related:
- methods/page/Content
+ - methods/page/Summary
+ - methods/page/ContentWithoutSummary
- methods/page/RawContent
- methods/page/PlainWords
- methods/page/RenderShortcodes
@@ -13,7 +15,7 @@ action:
signatures: [PAGE.Plain]
---
-The `Plain` method on a `Page` object renders Markdown and [shortcodes] to HTML, then strips the HTML [tags]. It does not strip HTML [entities]. The plain content does not include front matter.
+The `Plain` method on a `Page` object renders Markdown and [shortcodes] to HTML, then strips the HTML [tags]. It does not strip HTML [entities].
To prevent Go's [html/template] package from escaping HTML entities, pass the result through the [`htmlUnescape`] function.
diff --git a/content/en/methods/page/PlainWords.md b/content/en/methods/page/PlainWords.md
index 4f70193fe..221fd741b 100644
--- a/content/en/methods/page/PlainWords.md
+++ b/content/en/methods/page/PlainWords.md
@@ -6,8 +6,11 @@ keywords: []
action:
related:
- methods/page/Content
+ - methods/page/Summary
+ - methods/page/ContentWithoutSummary
- methods/page/RawContent
- methods/page/Plain
+ - methods/page/RenderShortcodes
returnType: '[]string'
signatures: [PAGE.PlainWords]
---
diff --git a/content/en/methods/page/RawContent.md b/content/en/methods/page/RawContent.md
index 12686c695..e4ab8a28e 100644
--- a/content/en/methods/page/RawContent.md
+++ b/content/en/methods/page/RawContent.md
@@ -6,6 +6,8 @@ keywords: []
action:
related:
- methods/page/Content
+ - methods/page/Summary
+ - methods/page/ContentWithoutSummary
- methods/page/Plain
- methods/page/PlainWords
- methods/page/RenderShortcodes
diff --git a/content/en/methods/page/RenderShortcodes.md b/content/en/methods/page/RenderShortcodes.md
index a4120f69a..9679fc8d5 100644
--- a/content/en/methods/page/RenderShortcodes.md
+++ b/content/en/methods/page/RenderShortcodes.md
@@ -5,11 +5,13 @@ categories: []
keywords: []
action:
related:
- - methods/page/RenderString
- methods/page/Content
+ - methods/page/Summary
+ - methods/page/ContentWithoutSummary
- methods/page/RawContent
- methods/page/Plain
- methods/page/PlainWords
+ - methods/page/RenderString
returnType: template.HTML
signatures: [PAGE.RenderShortcodes]
toc: true
diff --git a/content/en/render-hooks/blockquotes.md b/content/en/render-hooks/blockquotes.md
index e0eda5c51..143c536d1 100755
--- a/content/en/render-hooks/blockquotes.md
+++ b/content/en/render-hooks/blockquotes.md
@@ -24,6 +24,18 @@ Blockquote render hook templates receive the following [context]:
(`string`) Applicable when [`Type`](#type) is `alert`, this is the alert type converted to lowercase. See the [alerts](#alerts) section below.
+###### AlertTitle
+
+{{< new-in 0.134.0 >}}
+
+(`template.HTML`) Applicable when [`Type`](#type) is `alert`, this is the alert title. See the [alerts](#alerts) section below.
+
+###### AlertSign
+
+{{< new-in 0.134.0 >}}
+
+(`string`) Applicable when [`Type`](#type) is `alert`, this is the alert sign. Typically used to indicate whether an alert is graphically foldable, this is one of `+`, `-`, or an empty string. See the [alerts](#alerts) section below.
+
###### Attributes
(`map`) The [Markdown attributes], available if you configure your site as follows:
@@ -45,7 +57,7 @@ block = true
###### PageInner
-(`page`) A reference to a page nested via the [`RenderShortcodes`] method.
+(`page`) A reference to a page nested via the [`RenderShortcodes`] method. [See details](#pageinner-details).
[`RenderShortcodes`]: /methods/page/rendershortcodes
@@ -54,7 +66,7 @@ block = true
(`string`) The position of the blockquote within the page content.
###### Text
-(`string`) The blockquote text, excluding the alert designator if present. See the [alerts](#alerts) section below.
+(`template.HTML`) The blockquote text, excluding the first line if [`Type`](#type) is `alert`. See the [alerts](#alerts) section below.
###### Type
@@ -68,7 +80,7 @@ In its default configuration, Hugo renders Markdown blockquotes according to the
{{< code file=layouts/_default/_markup/render-blockquote.html copy=true >}}
- {{ .Text | safeHTML }}
+ {{ .Text }}
{{< /code >}}
@@ -77,7 +89,7 @@ To render a blockquote as an HTML `figure` element with an optional citation and
{{< code file=layouts/_default/_markup/render-blockquote.html copy=true >}}
- {{ .Text | safeHTML }}
+ {{ .Text }}
{{ with .Attributes.caption }}
@@ -96,7 +108,11 @@ Then in your markdown:
## Alerts
-Also known as _callouts_ or _admonitions_, alerts are blockquotes used to emphasize critical information. For example:
+Also known as _callouts_ or _admonitions_, alerts are blockquotes used to emphasize critical information.
+
+### Basic syntax
+
+With the basic Markdown syntax, the first line of each alert is an alert designator consisting of an exclamation point followed by the alert type, wrapped within brackets. For example:
{{< code file=content/example.md lang=text >}}
> [!NOTE]
@@ -115,15 +131,30 @@ Also known as _callouts_ or _admonitions_, alerts are blockquotes used to emphas
> Advises about risks or negative outcomes of certain actions.
{{< /code >}}
+The basic syntax is compatible with [GitHub], [Obsidian], and [Typora].
+
+[GitHub]: https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts
+[Obsidian]: https://help.obsidian.md/Editing+and+formatting/Callouts
+[Typora]: https://support.typora.io/Markdown-Reference/#callouts--github-style-alerts
+
+### Extended syntax
+
+With the extended Markdown syntax, you may optionally include an alert sign and/or an alert title. The alert sign is one of `+` or `-`, typically used to indicate whether an alert is graphically foldable. For example:
+
+{{< code file=content/example.md lang=text >}}
+> [!WARNING]+ Radiation hazard
+> Do not approach or handle without protective gear.
+{{< /code >}}
+
+The extended syntax is compatible with [Obsidian].
{{% note %}}
-This syntax is compatible with the GitHub Alert Markdown extension.
+The extended syntax is not compatible with GitHub or Typora. If you include an alert sign or an alert title, these applications render the Markdown as a blockquote.
{{% /note %}}
+### Example
-The first line of each alert is an alert designator consisting of an exclamation point followed by the alert type, wrapped within brackets.
-
-The blockquote render hook below renders a multilingual alert if an alert desginator is present, otherwise it renders a blockquote according to the CommonMark specification.
+This blockquote render hook renders a multilingual alert if an alert designator is present, otherwise it renders a blockquote according to the CommonMark specification.
{{< code file=layouts/_default/_markup/render-blockquote.html copy=true >}}
{{ $emojis := dict
@@ -138,13 +169,17 @@ The blockquote render hook below renders a multilingual alert if an alert desgin
{{ transform.Emojify (index $emojis .AlertType) }}
- {{ or (i18n .AlertType) (title .AlertType) }}
+ {{ with .AlertTitle }}
+ {{ . }}
+ {{ else }}
+ {{ or (i18n .AlertType) (title .AlertType) }}
+ {{ end }}
- {{ .Text | safeHTML }}
+ {{ .Text }}
{{ else }}
- {{ .Text | safeHTML }}
+ {{ .Text }}
{{ end }}
{{< /code >}}
@@ -159,7 +194,6 @@ tip = 'Tip'
warning = 'Warning'
{{< /code-toggle >}}
-
Although you can use one template with conditional logic as shown above, you can also create separate templates for each [`Type`](#type) of blockquote:
```text
@@ -169,3 +203,5 @@ layouts/
├── render-blockquote-alert.html
└── render-blockquote-regular.html
```
+
+{{% include "/render-hooks/_common/pageinner.md" %}}
diff --git a/content/en/render-hooks/headings.md b/content/en/render-hooks/headings.md
index 8ae3b808a..dc64296ea 100755
--- a/content/en/render-hooks/headings.md
+++ b/content/en/render-hooks/headings.md
@@ -55,7 +55,7 @@ title = true
###### Text
-(`string`) The heading text.
+(`template.HTML`) The heading text.
## Examples
@@ -65,7 +65,7 @@ In its default configuration, Hugo renders Markdown headings according to the [C
{{< code file=layouts/_default/_markup/render-heading.html copy=true >}}
- {{- .Text | safeHTML -}}
+ {{- .Text -}}
{{< /code >}}
@@ -73,7 +73,7 @@ To add an anchor link to the right of each heading:
{{< code file=layouts/_default/_markup/render-heading.html copy=true >}}
- {{ .Text | safeHTML }}
+ {{ .Text }}
#
{{< /code >}}
diff --git a/content/en/render-hooks/images.md b/content/en/render-hooks/images.md
index 1638ceeae..eca346c10 100755
--- a/content/en/render-hooks/images.md
+++ b/content/en/render-hooks/images.md
@@ -73,7 +73,7 @@ block = true
###### Text
-(`string`) The image description.
+(`template.HTML`) The image description.
###### Title
@@ -143,7 +143,7 @@ The embedded image render hook is automatically enabled for multilingual single-
[duplication of shared page resources]: /getting-started/configuration-markup/#duplicateresourcefiles
{{% /note %}}
-The embedded image render hook resolves internal Markdown destinations by looking for a matching [page resource], falling back to a matching [global resource]. Remote destinations are passed through, and the render hook will not throw an error or warning if it is unable to resolve a destination.
+The embedded image render hook resolves internal Markdown destinations by looking for a matching [page resource], falling back to a matching [global resource]. Remote destinations are passed through, and the render hook will not throw an error or warning if unable to resolve a destination.
[page resource]: /getting-started/glossary/#page-resource
[global resource]: /getting-started/glossary/#global-resource
diff --git a/content/en/render-hooks/introduction.md b/content/en/render-hooks/introduction.md
index 3745fc398..2d1598fcb 100755
--- a/content/en/render-hooks/introduction.md
+++ b/content/en/render-hooks/introduction.md
@@ -19,6 +19,7 @@ When rendering Markdown to HTML, render hooks override the conversion. Each rend
- [Images](/render-hooks/images)
- [Links](/render-hooks/links)
- [Passthrough elements](/render-hooks/passthrough)
+- [Tables](/render-hooks/tables)
{{% note %}}
Hugo supports multiple [content formats] including Markdown, HTML, AsciiDoc, Emacs Org Mode, Pandoc, and reStructuredText.
@@ -60,7 +61,9 @@ layouts/
├── render-codeblock.html
├── render-heading.html
├── render-image.html
- └── render-link.html
+ ├── render-link.html
+ ├── render-passthrough.html
+ └── render-table.html
```
The template lookup order allows you to create different render hooks for each page [type], [kind], language, and [output format]. For example:
diff --git a/content/en/render-hooks/links.md b/content/en/render-hooks/links.md
index 79c3d6926..9505e989b 100755
--- a/content/en/render-hooks/links.md
+++ b/content/en/render-hooks/links.md
@@ -54,7 +54,7 @@ Link render hook templates receive the following context:
###### Text
-(`string`) The link description.
+(`template.HTML`) The link description.
###### Title
@@ -74,7 +74,7 @@ In its default configuration, Hugo renders Markdown links according to the [Comm
- {{- with .Text | safeHTML }}{{ . }}{{ end -}}
+ {{- with .Text }}{{ . }}{{ end -}}
{{- /* chomp trailing newline */ -}}
{{< /code >}}
@@ -87,7 +87,7 @@ To include a `rel` attribute set to `external` for external links:
{{- with .Title }} title="{{ . }}"{{ end -}}
{{- if $u.IsAbs }} rel="external"{{ end -}}
>
- {{- with .Text | safeHTML }}{{ . }}{{ end -}}
+ {{- with .Text }}{{ . }}{{ end -}}
{{- /* chomp trailing newline */ -}}
{{< /code >}}
@@ -113,7 +113,7 @@ The embedded link render hook is automatically enabled for multilingual single-h
[duplication of shared page resources]: /getting-started/configuration-markup/#duplicateresourcefiles
{{% /note %}}
-The embedded link render hook resolves internal Markdown destinations by looking for a matching page, falling back to a matching [page resource], then falling back to a matching [global resource]. Remote destinations are passed through, and the render hook will not throw an error or warning if it is unable to resolve a destination.
+The embedded link render hook resolves internal Markdown destinations by looking for a matching page, falling back to a matching [page resource], then falling back to a matching [global resource]. Remote destinations are passed through, and the render hook will not throw an error or warning if unable to resolve a destination.
[page resource]: /getting-started/glossary/#page-resource
[global resource]: /getting-started/glossary/#global-resource
diff --git a/content/en/render-hooks/tables.md b/content/en/render-hooks/tables.md
new file mode 100755
index 000000000..41eadad7b
--- /dev/null
+++ b/content/en/render-hooks/tables.md
@@ -0,0 +1,106 @@
+---
+title: Table render hooks
+linkTitle: Tables
+description: Create a table render hook to override the rendering of Markdown tables to HTML.
+categories: [render hooks]
+keywords: []
+menu:
+ docs:
+ parent: render-hooks
+ weight: 90
+weight: 90
+toc: true
+---
+
+{{< new-in 0.134.0 >}}
+
+## Context
+
+Table render hook templates receive the following [context]:
+
+[context]: /getting-started/glossary/#context
+
+###### Attributes
+
+(`map`) The [Markdown attributes], available if you configure your site as follows:
+
+[Markdown attributes]: /content-management/markdown-attributes/
+
+{{< code-toggle file=hugo >}}
+[markup.goldmark.parser.attribute]
+block = true
+{{< /code-toggle >}}
+
+###### Ordinal
+
+(`int`) The zero-based ordinal of the table on the page.
+
+###### Page
+
+(`page`) A reference to the current page.
+
+###### PageInner
+
+(`page`) A reference to a page nested via the [`RenderShortcodes`] method. [See details](#pageinner-details).
+
+[`RenderShortcodes`]: /methods/page/rendershortcodes
+
+###### Position
+
+(`string`) The position of the table within the page content.
+
+###### THead
+(`slice`) A slice of table header rows, where each element is a slice of table cells.
+
+###### TBody
+(`slice`) A slice of table body rows, where each element is a slice of table cells.
+
+## Table cells
+
+Each table cell within the slice of slices returned by the `THead` and `TBody` methods has the following fields:
+
+###### Alignment
+(`string`) The alignment of the text within the table cell, one of `left`, `center`, or `right`.
+
+###### Text
+(`template.HTML`) The text within the table cell.
+
+## Example
+
+In its default configuration, Hugo renders Markdown tables according to the [GitHub Flavored Markdown specification]. To create a render hook that does the same thing:
+
+[GitHub Flavored Markdown specification]: https://github.github.com/gfm/#tables-extension-
+
+{{< code file=layouts/_default/_markup/render-table.html copy=true >}}
+
+
+ {{- range .THead }}
+
+ {{- range . }}
+
+ {{- .Text -}}
+
+ {{- end }}
+
+ {{- end }}
+
+
+ {{- range .TBody }}
+
+ {{- range . }}
+
+ {{- .Text -}}
+
+ {{- end }}
+
+ {{- end }}
+
+
+{{< /code >}}
+
+{{% include "/render-hooks/_common/pageinner.md" %}}
diff --git a/netlify.toml b/netlify.toml
index 44c10a3c9..2780fe747 100644
--- a/netlify.toml
+++ b/netlify.toml
@@ -3,7 +3,7 @@
command = "hugo --gc --minify"
[build.environment]
- HUGO_VERSION = "0.133.1"
+ HUGO_VERSION = "0.134.0"
[context.production.environment]
HUGO_ENV = "production"
From 8f2eac0195cf02f7edbcbce4b7e02768b12762fe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?=
Date: Wed, 4 Sep 2024 19:07:59 +0200
Subject: [PATCH 042/570] Make ContentWithoutSummary return Content when
summary is fetched from front matter
Fixes #12822
---
hugolib/page__content.go | 9 +++++----
resources/page/page_markup_integration_test.go | 14 +++++++++++++-
2 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/hugolib/page__content.go b/hugolib/page__content.go
index cc93fe5d5..4ec91f7b5 100644
--- a/hugolib/page__content.go
+++ b/hugolib/page__content.go
@@ -504,7 +504,7 @@ type contentTableOfContents struct {
}
type contentSummary struct {
- content string
+ content template.HTML
contentWithoutSummary template.HTML
summary page.Summary
}
@@ -612,9 +612,9 @@ func (c *cachedContentScope) contentRendered(ctx context.Context) (contentSummar
Truncated: summarized.Truncated(),
}
result.contentWithoutSummary = template.HTML(summarized.ContentWithoutSummary())
- result.content = summarized.Content()
+ result.content = template.HTML(summarized.Content())
} else {
- result.content = string(b)
+ result.content = template.HTML(string(b))
}
if !c.pi.hasSummaryDivider && cp.po.p.m.pageConfig.Summary == "" {
@@ -646,6 +646,7 @@ func (c *cachedContentScope) contentRendered(ctx context.Context) (contentSummar
Text: helpers.BytesToHTML(html),
Type: page.SummaryTypeFrontMatter,
}
+ rs.Value.contentWithoutSummary = rs.Value.content
}
return rs, err
@@ -879,7 +880,7 @@ func (c *cachedContentScope) Content(ctx context.Context) (template.HTML, error)
if err != nil {
return "", err
}
- return template.HTML(cr.content), nil
+ return cr.content, nil
}
func (c *cachedContentScope) ContentWithoutSummary(ctx context.Context) (template.HTML, error) {
diff --git a/resources/page/page_markup_integration_test.go b/resources/page/page_markup_integration_test.go
index fc3c6a569..010a9d729 100644
--- a/resources/page/page_markup_integration_test.go
+++ b/resources/page/page_markup_integration_test.go
@@ -171,7 +171,7 @@ includecontent: {{ hugo.Context.MarkupScope }}|{{ $p.Markup.Render.Content }}|
)
}
-func TestPageMarkupWithoutSummary(t *testing.T) {
+func TestPageContentWithoutSummary(t *testing.T) {
t.Parallel()
files := `
@@ -195,6 +195,13 @@ This is some content about a summary and more.
Another paragraph.
Third paragraph.
+-- content/p3.md --
+---
+title: "Post 3"
+date: "2020-01-01"
+summary: "This is summary in front matter."
+---
+This is content.
-- layouts/_default/single.html --
Single.
Page.Summary: {{ .Summary }}|
@@ -229,6 +236,11 @@ Summary Truncated: {{ .Truncated }}|
"Summary Type: auto",
"Summary Truncated: true",
)
+
+ b.AssertFileContentExact("public/p3/index.html",
+ "Summary: This is summary in front matter.|",
+ "ContentWithoutSummary: This is content.
\n|",
+ )
}
func TestPageMarkupWithoutSummaryRST(t *testing.T) {
From 66a3a1100167e26a13078c311318cd0576dd14ee Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?=
Date: Thu, 5 Sep 2024 10:46:47 +0200
Subject: [PATCH 043/570] Fix stray end p tag in Obsidian callout titles
Also remove test references to deprecated funcs now in ERROR.
Closes #12828
---
hugolib/page_test.go | 2 +-
hugolib/securitypolicies_test.go | 29 -------------------
hugolib/site_stats_test.go | 3 +-
hugolib/site_test.go | 4 +--
markup/goldmark/blockquotes/blockquotes.go | 4 ++-
.../blockquotes_integration_test.go | 13 ++++++---
.../goldmark/blockquotes/blockquotes_test.go | 2 +-
7 files changed, 17 insertions(+), 40 deletions(-)
diff --git a/hugolib/page_test.go b/hugolib/page_test.go
index 47f7c59c9..66afd7d96 100644
--- a/hugolib/page_test.go
+++ b/hugolib/page_test.go
@@ -523,7 +523,7 @@ categories: ["cool stuff"]
for _, p := range s.Pages() {
checkDated(p, p.Kind())
}
- checkDate(s.LastChange(), "site")
+ checkDate(s.Lastmod(), "site")
}
func TestPageDatesSections(t *testing.T) {
diff --git a/hugolib/securitypolicies_test.go b/hugolib/securitypolicies_test.go
index b0d39c697..3ddda7d6a 100644
--- a/hugolib/securitypolicies_test.go
+++ b/hugolib/securitypolicies_test.go
@@ -185,35 +185,6 @@ urls="none"
[security.http]
mediaTypes=["application/json"]
-`)
- })
- })
-
- c.Run("getJSON, OK", func(c *qt.C) {
- c.Parallel()
- httpTestVariant(c, `{{ $json := getJSON "%[1]s/fruits.json" }}{{ $json.Content }}`, "", nil)
- })
-
- c.Run("getJSON, denied URL", func(c *qt.C) {
- c.Parallel()
- httpTestVariant(c, `{{ $json := getJSON "%[1]s/fruits.json" }}{{ $json.Content }}`, `(?s).*is not whitelisted in policy "security\.http\.urls".*`,
- func(b *sitesBuilder) {
- b.WithConfigFile("toml", `
-[security]
-[security.http]
-urls="none"
-`)
- })
- })
-
- c.Run("getCSV, denied URL", func(c *qt.C) {
- c.Parallel()
- httpTestVariant(c, `{{ $d := getCSV ";" "%[1]s/cities.csv" }}{{ $d.Content }}`, `(?s).*is not whitelisted in policy "security\.http\.urls".*`,
- func(b *sitesBuilder) {
- b.WithConfigFile("toml", `
-[security]
-[security.http]
-urls="none"
`)
})
})
diff --git a/hugolib/site_stats_test.go b/hugolib/site_stats_test.go
index 167194ef5..7fd68ff44 100644
--- a/hugolib/site_stats_test.go
+++ b/hugolib/site_stats_test.go
@@ -121,11 +121,10 @@ date: 2023-04-01
---
-- layouts/index.html --
site.Lastmod: {{ .Site.Lastmod.Format "2006-01-02" }}
-site.LastChange: {{ .Site.LastChange.Format "2006-01-02" }}
home.Lastmod: {{ site.Home.Lastmod.Format "2006-01-02" }}
`
b := Test(t, files)
- b.AssertFileContent("public/index.html", "site.Lastmod: 2023-04-01\nsite.LastChange: 2023-04-01\nhome.Lastmod: 2023-01-01")
+ b.AssertFileContent("public/index.html", "site.Lastmod: 2023-04-01\nhome.Lastmod: 2023-01-01")
}
diff --git a/hugolib/site_test.go b/hugolib/site_test.go
index 37546824a..2ee33da24 100644
--- a/hugolib/site_test.go
+++ b/hugolib/site_test.go
@@ -147,8 +147,8 @@ func TestLastChange(t *testing.T) {
s := buildSingleSite(t, deps.DepsCfg{Fs: fs, Configs: configs}, BuildCfg{SkipRender: true})
- c.Assert(s.LastChange().IsZero(), qt.Equals, false)
- c.Assert(s.LastChange().Year(), qt.Equals, 2017)
+ c.Assert(s.Lastmod().IsZero(), qt.Equals, false)
+ c.Assert(s.Lastmod().Year(), qt.Equals, 2017)
}
// Issue #_index
diff --git a/markup/goldmark/blockquotes/blockquotes.go b/markup/goldmark/blockquotes/blockquotes.go
index f6d1a590e..f9d518850 100644
--- a/markup/goldmark/blockquotes/blockquotes.go
+++ b/markup/goldmark/blockquotes/blockquotes.go
@@ -164,10 +164,12 @@ var blockQuoteAlertRe = regexp.MustCompile(`^\[!([a-zA-Z]+)\](-|\+)?[^\S\r\n]
func resolveBlockQuoteAlert(s string) blockQuoteAlert {
m := blockQuoteAlertRe.FindStringSubmatch(s)
if len(m) == 4 {
+ title := strings.TrimSpace(m[3])
+ title = strings.TrimRight(title, "
")
return blockQuoteAlert{
typ: strings.ToLower(m[1]),
sign: m[2],
- title: m[3],
+ title: title,
}
}
diff --git a/markup/goldmark/blockquotes/blockquotes_integration_test.go b/markup/goldmark/blockquotes/blockquotes_integration_test.go
index af3c1fba4..1f671df2b 100644
--- a/markup/goldmark/blockquotes/blockquotes_integration_test.go
+++ b/markup/goldmark/blockquotes/blockquotes_integration_test.go
@@ -123,7 +123,6 @@ title: "Home"
> [!danger]
> Do not approach or handle without protective gear.
-
> [!tip] Callouts can have custom titles
> Like this one.
@@ -135,6 +134,10 @@ title: "Home"
> [!faq]+ Foldable callout
> Yes! In a foldable callout, the contents are hidden when the callout is collapsed
+> [!info] Can callouts be nested?
+> > [!important] Yes!, they can.
+> > > [!tip] You can even use multiple layers of nesting.
+
-- layouts/index.html --
{{ .Content }}
-- layouts/_default/_markup/render-blockquote.html --
@@ -145,9 +148,11 @@ AlertType: {{ .AlertType }}|AlertTitle: {{ .AlertTitle }}|AlertSign: {{ .AlertSi
b := hugolib.Test(t, files)
b.AssertFileContentExact("public/index.html",
"AlertType: tip|AlertTitle: Callouts can have custom titles|AlertSign: |",
- "AlertType: tip|AlertTitle: Title-only callout|AlertSign: |",
- "AlertType: faq|AlertTitle: Foldable negated callout|AlertSign: -|Text: Yes!",
- "AlertType: faq|AlertTitle: Foldable callout|AlertSign: +|",
+ "AlertType: tip|AlertTitle: Title-only callout|AlertSign: |",
+ "AlertType: faq|AlertTitle: Foldable negated callout|AlertSign: -|Text:
Yes! In a foldable callout, the contents are hidden when the callout is collapsed
\n|",
+ "AlertType: faq|AlertTitle: Foldable callout|AlertSign: +|Text: Yes! In a foldable callout, the contents are hidden when the callout is collapsed
\n|",
"AlertType: danger|AlertTitle: |AlertSign: |Text: Do not approach or handle without protective gear.
\n|",
+ "AlertTitle: Can callouts be nested?|",
+ "AlertTitle: You can even use multiple layers of nesting.|",
)
}
diff --git a/markup/goldmark/blockquotes/blockquotes_test.go b/markup/goldmark/blockquotes/blockquotes_test.go
index 8b948af08..067cf366e 100644
--- a/markup/goldmark/blockquotes/blockquotes_test.go
+++ b/markup/goldmark/blockquotes/blockquotes_test.go
@@ -63,6 +63,6 @@ func TestResolveBlockQuoteAlert(t *testing.T) {
}
for i, test := range tests {
- c.Assert(resolveBlockQuoteAlert(""+test.input), qt.Equals, test.expected, qt.Commentf("Test %d", i))
+ c.Assert(resolveBlockQuoteAlert("
"+test.input+"
"), qt.Equals, test.expected, qt.Commentf("Test %d", i))
}
}
From 2f89169baa87a9db47e288b60705f4e99e21a945 Mon Sep 17 00:00:00 2001
From: hugoreleaser
Date: Thu, 5 Sep 2024 10:17:50 +0000
Subject: [PATCH 044/570] releaser: Bump versions for release of 0.134.1
[ci skip]
---
common/hugo/version_current.go | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/common/hugo/version_current.go b/common/hugo/version_current.go
index 21442b238..9017027d9 100644
--- a/common/hugo/version_current.go
+++ b/common/hugo/version_current.go
@@ -17,7 +17,7 @@ package hugo
// This should be the only one.
var CurrentVersion = Version{
Major: 0,
- Minor: 135,
- PatchLevel: 0,
- Suffix: "-DEV",
+ Minor: 134,
+ PatchLevel: 1,
+ Suffix: "",
}
From 84ee00bbc24328295237695a39e6e876ed186312 Mon Sep 17 00:00:00 2001
From: hugoreleaser
Date: Thu, 5 Sep 2024 10:32:40 +0000
Subject: [PATCH 045/570] releaser: Prepare repository for 0.135.0-DEV
[ci skip]
---
common/hugo/version_current.go | 6 +++---
hugoreleaser.env | 5 +++--
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/common/hugo/version_current.go b/common/hugo/version_current.go
index 9017027d9..21442b238 100644
--- a/common/hugo/version_current.go
+++ b/common/hugo/version_current.go
@@ -17,7 +17,7 @@ package hugo
// This should be the only one.
var CurrentVersion = Version{
Major: 0,
- Minor: 134,
- PatchLevel: 1,
- Suffix: "",
+ Minor: 135,
+ PatchLevel: 0,
+ Suffix: "-DEV",
}
diff --git a/hugoreleaser.env b/hugoreleaser.env
index 1c0d4a820..9880a7785 100644
--- a/hugoreleaser.env
+++ b/hugoreleaser.env
@@ -1,7 +1,8 @@
# Release env.
# These will be replaced by script before release.
-HUGORELEASER_TAG=v0.134.0
-HUGORELEASER_COMMITISH=77df7bbbff8ce6b56ed693270088de973a87d5ce
+HUGORELEASER_TAG=v0.134.1
+HUGORELEASER_COMMITISH=2f89169baa87a9db47e288b60705f4e99e21a945
+
From 3d6baedaec306300f2c6f7ed471e774dca0f112a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?=
Date: Tue, 10 Sep 2024 08:54:03 +0200
Subject: [PATCH 046/570] Don't count HTML markup in auto summaries
This commit also fixes a bug where a `` end tag was wrongly used to detect a end paragraph. This should be very rare, though.
Closes #12837
---
hugolib/page_test.go | 2 +-
resources/page/page_markup.go | 20 ++++++++++-
resources/page/page_markup_test.go | 57 ++++++++++++++++++++++++++++++
3 files changed, 77 insertions(+), 2 deletions(-)
diff --git a/hugolib/page_test.go b/hugolib/page_test.go
index 66afd7d96..429ab2659 100644
--- a/hugolib/page_test.go
+++ b/hugolib/page_test.go
@@ -593,7 +593,7 @@ func TestPageSummary(t *testing.T) {
// Source is not Asciidoctor- or RST-compatible so don't test them
if ext != "ad" && ext != "rst" {
checkPageContent(t, p, normalizeExpected(ext, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
\n\nAdditional text.
\n\nFurther text.
\n"), ext)
- checkPageSummary(t, p, normalizeExpected(ext, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
"), ext)
+ checkPageSummary(t, p, normalizeExpected(ext, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Additional text.
"), ext)
}
checkPageType(t, p, "page")
}
diff --git a/resources/page/page_markup.go b/resources/page/page_markup.go
index ef4a56e3a..44980e8b0 100644
--- a/resources/page/page_markup.go
+++ b/resources/page/page_markup.go
@@ -161,6 +161,16 @@ func (s *HtmlSummary) resolveParagraphTagAndSetWrapper(mt media.Type) tagReStart
return ptag
}
+// Avoid counting words that are most likely HTML tokens.
+var (
+ isProbablyHTMLTag = regexp.MustCompile(`^<\/?[A-Za-z]+>?$`)
+ isProablyHTMLAttribute = regexp.MustCompile(`^[A-Za-z]+=["']`)
+)
+
+func isProbablyHTMLToken(s string) bool {
+ return s == ">" || isProbablyHTMLTag.MatchString(s) || isProablyHTMLAttribute.MatchString(s)
+}
+
// ExtractSummaryFromHTML extracts a summary from the given HTML content.
func ExtractSummaryFromHTML(mt media.Type, input string, numWords int, isCJK bool) (result HtmlSummary) {
result.source = input
@@ -173,6 +183,14 @@ func ExtractSummaryFromHTML(mt media.Type, input string, numWords int, isCJK boo
var count int
countWord := func(word string) int {
+ word = strings.TrimSpace(word)
+ if len(word) == 0 {
+ return 0
+ }
+ if isProbablyHTMLToken(word) {
+ return 0
+ }
+
if isCJK {
word = tpl.StripHTML(word)
runeCount := utf8.RuneCountInString(word)
@@ -193,7 +211,7 @@ func ExtractSummaryFromHTML(mt media.Type, input string, numWords int, isCJK boo
for j := result.WrapperStart.High; j < high; {
s := input[j:]
- closingIndex := strings.Index(s, ""+ptag.tagName)
+ closingIndex := strings.Index(s, ""+ptag.tagName+">")
if closingIndex == -1 {
break
diff --git a/resources/page/page_markup_test.go b/resources/page/page_markup_test.go
index b7d363f8f..43eaae6f6 100644
--- a/resources/page/page_markup_test.go
+++ b/resources/page/page_markup_test.go
@@ -49,6 +49,46 @@ func TestExtractSummaryFromHTML(t *testing.T) {
}
}
+// See https://discourse.gohugo.io/t/automatic-summarys-summarylength-seems-broken-in-the-case-of-plainify/51466/4
+// Also issue 12837
+func TestExtractSummaryFromHTMLLotsOfHTMLInSummary(t *testing.T) {
+ c := qt.New(t)
+
+ input := `
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+This is a story about a cat.
+
+
+The cat was white and fluffy.
+
+
+And it liked milk.
+
+`
+
+ summary := ExtractSummaryFromHTML(media.Builtin.MarkdownType, input, 10, false)
+ c.Assert(strings.HasSuffix(summary.Summary(), "\nThis is a story about a cat.\n
\n\nThe cat was white and fluffy.\n
"), qt.IsTrue)
+}
+
func TestExtractSummaryFromHTMLWithDivider(t *testing.T) {
c := qt.New(t)
@@ -114,6 +154,23 @@ func TestExpandDivider(t *testing.T) {
}
}
+func TestIsProbablyHTMLToken(t *testing.T) {
+ c := qt.New(t)
+
+ for i, test := range []struct {
+ input string
+ expect bool
+ }{
+ {"", true},
+ {"
Æøå", false},
+ } {
+ c.Assert(isProbablyHTMLToken(test.input), qt.Equals, test.expect, qt.Commentf("[%d] Test.expect %q", i, test.input))
+ }
+}
+
func BenchmarkSummaryFromHTML(b *testing.B) {
b.StopTimer()
input := "
First paragraph
Second paragraph
"
From 1c74abd26070b0c12849550c974a9f3f1e7afb06 Mon Sep 17 00:00:00 2001
From: hugoreleaser
Date: Tue, 10 Sep 2024 10:46:33 +0000
Subject: [PATCH 047/570] releaser: Bump versions for release of 0.134.2
[ci skip]
---
common/hugo/version_current.go | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/common/hugo/version_current.go b/common/hugo/version_current.go
index 21442b238..45d3e917c 100644
--- a/common/hugo/version_current.go
+++ b/common/hugo/version_current.go
@@ -17,7 +17,7 @@ package hugo
// This should be the only one.
var CurrentVersion = Version{
Major: 0,
- Minor: 135,
- PatchLevel: 0,
- Suffix: "-DEV",
+ Minor: 134,
+ PatchLevel: 2,
+ Suffix: "",
}
From fe7e137e28de66fb68af1089c6248b01fb318b49 Mon Sep 17 00:00:00 2001
From: hugoreleaser
Date: Tue, 10 Sep 2024 11:00:15 +0000
Subject: [PATCH 048/570] releaser: Prepare repository for 0.135.0-DEV
[ci skip]
---
common/hugo/version_current.go | 6 +++---
hugoreleaser.env | 5 +++--
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/common/hugo/version_current.go b/common/hugo/version_current.go
index 45d3e917c..21442b238 100644
--- a/common/hugo/version_current.go
+++ b/common/hugo/version_current.go
@@ -17,7 +17,7 @@ package hugo
// This should be the only one.
var CurrentVersion = Version{
Major: 0,
- Minor: 134,
- PatchLevel: 2,
- Suffix: "",
+ Minor: 135,
+ PatchLevel: 0,
+ Suffix: "-DEV",
}
diff --git a/hugoreleaser.env b/hugoreleaser.env
index 9880a7785..6bb01efa1 100644
--- a/hugoreleaser.env
+++ b/hugoreleaser.env
@@ -1,7 +1,8 @@
# Release env.
# These will be replaced by script before release.
-HUGORELEASER_TAG=v0.134.1
-HUGORELEASER_COMMITISH=2f89169baa87a9db47e288b60705f4e99e21a945
+HUGORELEASER_TAG=v0.134.2
+HUGORELEASER_COMMITISH=1c74abd26070b0c12849550c974a9f3f1e7afb06
+
From 28f621d4a73ca7e97e23b33cbf3780ddab188d24 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?=
Date: Thu, 12 Sep 2024 09:13:47 +0200
Subject: [PATCH 049/570] internal/warpc: Improve the JS plugin API
* Move the error handling into commons and make sure the error returned also returns message errors
* Make the protocol version an int so it can be more easily compared
---
internal/warpc/js/common.js | 14 +++++--
internal/warpc/js/greet.bundle.js | 4 +-
internal/warpc/js/renderkatex.bundle.js | 10 ++---
internal/warpc/js/renderkatex.js | 10 ++---
internal/warpc/warpc.go | 16 ++++++--
internal/warpc/warpc_test.go | 52 ++++++++++++++++--------
internal/warpc/wasm/greet.wasm | Bin 2226 -> 2361 bytes
internal/warpc/wasm/renderkatex.wasm | Bin 472553 -> 472649 bytes
tpl/transform/transform.go | 5 +--
9 files changed, 68 insertions(+), 43 deletions(-)
diff --git a/internal/warpc/js/common.js b/internal/warpc/js/common.js
index 90ea1a1bc..49aba9b4b 100644
--- a/internal/warpc/js/common.js
+++ b/internal/warpc/js/common.js
@@ -41,13 +41,21 @@ export function readInput(handle) {
if (currentLine[i] === 10) {
const chunk = currentLine.splice(j, i + 1);
const arr = new Uint8Array(chunk);
- let json;
+ let message;
try {
- json = JSON.parse(new TextDecoder().decode(arr));
+ message = JSON.parse(new TextDecoder().decode(arr));
} catch (e) {
throw new Error(`Error parsing JSON '${new TextDecoder().decode(arr)}' from stdin: ${e.message}`);
}
- handle(json);
+
+ try {
+ handle(message);
+ } catch (e) {
+ let header = message.header;
+ header.err = e.message;
+ writeOutput({ header: header });
+ }
+
j = i + 1;
}
}
diff --git a/internal/warpc/js/greet.bundle.js b/internal/warpc/js/greet.bundle.js
index f6776cf53..c5aa4a13a 100644
--- a/internal/warpc/js/greet.bundle.js
+++ b/internal/warpc/js/greet.bundle.js
@@ -1,2 +1,2 @@
-(()=>{function s(r){let e=[],c=new Uint8Array(1024);for(;;){let n=0;try{n=Javy.IO.readSync(0,c)}catch(o){if(o.message.includes("os error 29"))break;throw new Error("Error reading from stdin")}if(n<0)throw new Error("Error reading from stdin");if(n===0)break;if(e=[...e,...c.subarray(0,n)],!e.includes(10))continue;let t=0;for(let o=0;t{function l(r){let e=[],a=new Uint8Array(1024);for(;;){let n=0;try{n=Javy.IO.readSync(0,a)}catch(o){if(o.message.includes("os error 29"))break;throw new Error("Error reading from stdin")}if(n<0)throw new Error("Error reading from stdin");if(n===0)break;if(e=[...e,...a.subarray(0,n)],!e.includes(10))continue;let t=0;for(let o=0;t{function Ut(r){let t=[],a=new Uint8Array(1024);for(;;){let s=0;try{s=Javy.IO.readSync(0,a)}catch(h){if(h.message.includes("os error 29"))break;throw new Error("Error reading from stdin")}if(s<0)throw new Error("Error reading from stdin");if(s===0)break;if(t=[...t,...a.subarray(0,s)],!t.includes(10))continue;let o=0;for(let h=0;o{function Ut(r){let t=[],a=new Uint8Array(1024);for(;;){let s=0;try{s=Javy.IO.readSync(0,a)}catch(h){if(h.message.includes("os error 29"))break;throw new Error("Error reading from stdin")}if(s<0)throw new Error("Error reading from stdin");if(s===0)break;if(t=[...t,...a.subarray(0,s)],!t.includes(10))continue;let o=0;for(let h=0;o15?p="\u2026"+h.slice(n-15,n):p=h.slice(0,n);var g;s+15":">","<":"<",'"':""","'":"'"},za=/[&><"']/g;function Aa(r){return String(r).replace(za,e=>Ma[e])}var wr=function r(e){return e.type==="ordgroup"||e.type==="color"?e.body.length===1?r(e.body[0]):e:e.type==="font"?r(e.body):e},Ta=function(e){var t=wr(e);return t.type==="mathord"||t.type==="textord"||t.type==="atom"},Ba=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e},Da=function(e){var t=/^[\x00-\x20]*([^\\/#?]*?)(:|*58|*3a|&colon)/i.exec(e);return t?t[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():"_relative"},N={contains:xa,deflt:wa,escape:Aa,hyphenate:Sa,getBaseElem:wr,isCharacterBox:Ta,protocolFromUrl:Da},qe={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:r=>"#"+r},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(r,e)=>(e.push(r),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:r=>Math.max(0,r),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:r=>Math.max(0,r),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:r=>Math.max(0,r),cli:"-e, --max-expand ",cliProcessor:r=>r==="Infinity"?1/0:parseInt(r)},globalGroup:{type:"boolean",cli:!1}};function Ca(r){if(r.default)return r.default;var e=r.type,t=Array.isArray(e)?e[0]:e;if(typeof t!="string")return t.enum[0];switch(t){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}var he=class{constructor(e){this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(var t in qe)if(qe.hasOwnProperty(t)){var a=qe[t];this[t]=e[t]!==void 0?a.processor?a.processor(e[t]):e[t]:Ca(a)}}reportNonstrict(e,t,a){var n=this.strict;if(typeof n=="function"&&(n=n(e,t,a)),!(!n||n==="ignore")){if(n===!0||n==="error")throw new M("LaTeX-incompatible input and strict mode is set to 'error': "+(t+" ["+e+"]"),a);n==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+n+"': "+t+" ["+e+"]"))}}useStrictBehavior(e,t,a){var n=this.strict;if(typeof n=="function")try{n=n(e,t,a)}catch{n="error"}return!n||n==="ignore"?!1:n===!0||n==="error"?!0:n==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+n+"': "+t+" ["+e+"]")),!1)}isTrusted(e){if(e.url&&!e.protocol){var t=N.protocolFromUrl(e.url);if(t==null)return!1;e.protocol=t}var a=typeof this.trust=="function"?this.trust(e):this.trust;return!!a}},x0=class{constructor(e,t,a){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=a}sup(){return w0[qa[this.id]]}sub(){return w0[Na[this.id]]}fracNum(){return w0[Ea[this.id]]}fracDen(){return w0[Ra[this.id]]}cramp(){return w0[Ia[this.id]]}text(){return w0[Oa[this.id]]}isTight(){return this.size>=2}},kt=0,Ee=1,te=2,C0=3,me=4,f0=5,re=6,n0=7,w0=[new x0(kt,0,!1),new x0(Ee,0,!0),new x0(te,1,!1),new x0(C0,1,!0),new x0(me,2,!1),new x0(f0,2,!0),new x0(re,3,!1),new x0(n0,3,!0)],qa=[me,f0,me,f0,re,n0,re,n0],Na=[f0,f0,f0,f0,n0,n0,n0,n0],Ea=[te,C0,me,f0,re,n0,re,n0],Ra=[C0,C0,f0,f0,n0,n0,n0,n0],Ia=[Ee,Ee,C0,C0,f0,f0,n0,n0],Oa=[kt,Ee,te,C0,te,C0,te,C0],R={DISPLAY:w0[kt],TEXT:w0[te],SCRIPT:w0[me],SCRIPTSCRIPT:w0[re]},ht=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function Ha(r){for(var e=0;e=n[0]&&r<=n[1])return t.name}return null}var Ne=[];ht.forEach(r=>r.blocks.forEach(e=>Ne.push(...e)));function kr(r){for(var e=0;e=Ne[e]&&r<=Ne[e+1])return!0;return!1}var ee=80,Fa=function(e,t){return"M95,"+(622+e+t)+`
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
@@ -253,10 +253,10 @@ c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6
c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
--470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}},X0=class{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return N.contains(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),t=0;tt.toText();return this.children.map(e).join("")}},k0={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},xe={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},Yt={\u00C5:"A",\u00D0:"D",\u00DE:"o",\u00E5:"a",\u00F0:"d",\u00FE:"o",\u0410:"A",\u0411:"B",\u0412:"B",\u0413:"F",\u0414:"A",\u0415:"E",\u0416:"K",\u0417:"3",\u0418:"N",\u0419:"N",\u041A:"K",\u041B:"N",\u041C:"M",\u041D:"H",\u041E:"O",\u041F:"N",\u0420:"P",\u0421:"C",\u0422:"T",\u0423:"y",\u0424:"O",\u0425:"X",\u0426:"U",\u0427:"h",\u0428:"W",\u0429:"W",\u042A:"B",\u042B:"X",\u042C:"B",\u042D:"3",\u042E:"X",\u042F:"R",\u0430:"a",\u0431:"b",\u0432:"a",\u0433:"r",\u0434:"y",\u0435:"e",\u0436:"m",\u0437:"e",\u0438:"n",\u0439:"n",\u043A:"n",\u043B:"n",\u043C:"m",\u043D:"n",\u043E:"o",\u043F:"n",\u0440:"p",\u0441:"c",\u0442:"o",\u0443:"y",\u0444:"b",\u0445:"x",\u0446:"n",\u0447:"n",\u0448:"w",\u0449:"w",\u044A:"a",\u044B:"m",\u044C:"a",\u044D:"e",\u044E:"m",\u044F:"r"};function ja(r,e){k0[r]=e}function St(r,e,t){if(!k0[e])throw new Error("Font metrics not found for font: "+e+".");var a=r.charCodeAt(0),n=k0[e][a];if(!n&&r[0]in Yt&&(a=Yt[r[0]].charCodeAt(0),n=k0[e][a]),!n&&t==="text"&&kr(a)&&(n=k0[e][77]),n)return{depth:n[0],height:n[1],italic:n[2],skew:n[3],width:n[4]}}var Qe={};function Za(r){var e;if(r>=5?e=0:r>=3?e=1:e=2,!Qe[e]){var t=Qe[e]={cssEmPerMu:xe.quad[e]/18};for(var a in xe)xe.hasOwnProperty(a)&&(t[a]=xe[a][e])}return Qe[e]}var Ka=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],Xt=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Wt=function(e,t){return t.size<2?e:Ka[e-1][t.size-1]},Re=class r{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||r.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=Xt[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var a in e)e.hasOwnProperty(a)&&(t[a]=e[a]);return new r(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:Wt(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:Xt[e-1]})}havingBaseStyle(e){e=e||this.style.text();var t=Wt(r.BASESIZE,e);return this.size===t&&this.textSize===r.BASESIZE&&this.style===e?this:this.extend({style:e,size:t})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==r.BASESIZE?["sizing","reset-size"+this.size,"size"+r.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=Za(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}};Re.BASESIZE=6;var mt={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},Ja={ex:!0,em:!0,mu:!0},Sr=function(e){return typeof e!="string"&&(e=e.unit),e in mt||e in Ja||e==="ex"},J=function(e,t){var a;if(e.unit in mt)a=mt[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(e.unit==="mu")a=t.fontMetrics().cssEmPerMu;else{var n;if(t.style.isTight()?n=t.havingStyle(t.style.text()):n=t,e.unit==="ex")a=n.fontMetrics().xHeight;else if(e.unit==="em")a=n.fontMetrics().quad;else throw new M("Invalid unit: '"+e.unit+"'");n!==t&&(a*=n.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*a,t.maxSize)},A=function(e){return+e.toFixed(4)+"em"},P0=function(e){return e.filter(t=>t).join(" ")},Mr=function(e,t,a){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=a||{},t){t.style.isTight()&&this.classes.push("mtight");var n=t.getColor();n&&(this.style.color=n)}},zr=function(e){var t=document.createElement(e);t.className=P0(this.classes);for(var a in this.style)this.style.hasOwnProperty(a)&&(t.style[a]=this.style[a]);for(var n in this.attributes)this.attributes.hasOwnProperty(n)&&t.setAttribute(n,this.attributes[n]);for(var s=0;s";for(var o=0;o",t},W0=class{constructor(e,t,a,n){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,Mr.call(this,e,a,n),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return N.contains(this.classes,e)}toNode(){return zr.call(this,"span")}toMarkup(){return Ar.call(this,"span")}},ce=class{constructor(e,t,a,n){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,Mr.call(this,t,n),this.children=a||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return N.contains(this.classes,e)}toNode(){return zr.call(this,"a")}toMarkup(){return Ar.call(this,"a")}},ct=class{constructor(e,t,a){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=["mord"],this.style=a}hasClass(e){return N.contains(this.classes,e)}toNode(){var e=document.createElement("img");e.src=this.src,e.alt=this.alt,e.className="mord";for(var t in this.style)this.style.hasOwnProperty(t)&&(e.style[t]=this.style[t]);return e}toMarkup(){var e=' ",e}},Qa={\u00EE:"\u0131\u0302",\u00EF:"\u0131\u0308",\u00ED:"\u0131\u0301",\u00EC:"\u0131\u0300"},u0=class{constructor(e,t,a,n,s,o,h,c){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=a||0,this.italic=n||0,this.skew=s||0,this.width=o||0,this.classes=h||[],this.style=c||{},this.maxFontSize=0;var p=Ha(this.text.charCodeAt(0));p&&this.classes.push(p+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=Qa[this.text])}hasClass(e){return N.contains(this.classes,e)}toNode(){var e=document.createTextNode(this.text),t=null;this.italic>0&&(t=document.createElement("span"),t.style.marginRight=A(this.italic)),this.classes.length>0&&(t=t||document.createElement("span"),t.className=P0(this.classes));for(var a in this.style)this.style.hasOwnProperty(a)&&(t=t||document.createElement("span"),t.style[a]=this.style[a]);return t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t="0&&(a+="margin-right:"+this.italic+"em;");for(var n in this.style)this.style.hasOwnProperty(n)&&(a+=N.hyphenate(n)+":"+this.style[n]+";");a&&(e=!0,t+=' style="'+N.escape(a)+'"');var s=N.escape(this.text);return e?(t+=">",t+=s,t+=" ",t):s}},y0=class{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");for(var a in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,a)&&t.setAttribute(a,this.attributes[a]);for(var n=0;n";for(var a=0;a",e}},S0=class{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"path");return this.alternate?t.setAttribute("d",this.alternate):t.setAttribute("d",$t[this.pathName]),t}toMarkup(){return this.alternate?' ':' '}},de=class{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"line");for(var a in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,a)&&t.setAttribute(a,this.attributes[a]);return t}toMarkup(){var e=" ",e}};function jt(r){if(r instanceof u0)return r;throw new Error("Expected symbolNode but got "+String(r)+".")}function _a(r){if(r instanceof W0)return r;throw new Error("Expected span but got "+String(r)+".")}var e1={bin:1,close:1,inner:1,open:1,punct:1,rel:1},t1={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},X={math:{},text:{}};function i(r,e,t,a,n,s){X[r][n]={font:e,group:t,replace:a},s&&a&&(X[r][a]=X[r][n])}var l="math",k="text",u="main",d="ams",W="accent-token",D="bin",i0="close",ae="inner",E="mathord",_="op-token",c0="open",Ge="punct",f="rel",R0="spacing",v="textord";i(l,u,f,"\u2261","\\equiv",!0);i(l,u,f,"\u227A","\\prec",!0);i(l,u,f,"\u227B","\\succ",!0);i(l,u,f,"\u223C","\\sim",!0);i(l,u,f,"\u22A5","\\perp");i(l,u,f,"\u2AAF","\\preceq",!0);i(l,u,f,"\u2AB0","\\succeq",!0);i(l,u,f,"\u2243","\\simeq",!0);i(l,u,f,"\u2223","\\mid",!0);i(l,u,f,"\u226A","\\ll",!0);i(l,u,f,"\u226B","\\gg",!0);i(l,u,f,"\u224D","\\asymp",!0);i(l,u,f,"\u2225","\\parallel");i(l,u,f,"\u22C8","\\bowtie",!0);i(l,u,f,"\u2323","\\smile",!0);i(l,u,f,"\u2291","\\sqsubseteq",!0);i(l,u,f,"\u2292","\\sqsupseteq",!0);i(l,u,f,"\u2250","\\doteq",!0);i(l,u,f,"\u2322","\\frown",!0);i(l,u,f,"\u220B","\\ni",!0);i(l,u,f,"\u221D","\\propto",!0);i(l,u,f,"\u22A2","\\vdash",!0);i(l,u,f,"\u22A3","\\dashv",!0);i(l,u,f,"\u220B","\\owns");i(l,u,Ge,".","\\ldotp");i(l,u,Ge,"\u22C5","\\cdotp");i(l,u,v,"#","\\#");i(k,u,v,"#","\\#");i(l,u,v,"&","\\&");i(k,u,v,"&","\\&");i(l,u,v,"\u2135","\\aleph",!0);i(l,u,v,"\u2200","\\forall",!0);i(l,u,v,"\u210F","\\hbar",!0);i(l,u,v,"\u2203","\\exists",!0);i(l,u,v,"\u2207","\\nabla",!0);i(l,u,v,"\u266D","\\flat",!0);i(l,u,v,"\u2113","\\ell",!0);i(l,u,v,"\u266E","\\natural",!0);i(l,u,v,"\u2663","\\clubsuit",!0);i(l,u,v,"\u2118","\\wp",!0);i(l,u,v,"\u266F","\\sharp",!0);i(l,u,v,"\u2662","\\diamondsuit",!0);i(l,u,v,"\u211C","\\Re",!0);i(l,u,v,"\u2661","\\heartsuit",!0);i(l,u,v,"\u2111","\\Im",!0);i(l,u,v,"\u2660","\\spadesuit",!0);i(l,u,v,"\xA7","\\S",!0);i(k,u,v,"\xA7","\\S");i(l,u,v,"\xB6","\\P",!0);i(k,u,v,"\xB6","\\P");i(l,u,v,"\u2020","\\dag");i(k,u,v,"\u2020","\\dag");i(k,u,v,"\u2020","\\textdagger");i(l,u,v,"\u2021","\\ddag");i(k,u,v,"\u2021","\\ddag");i(k,u,v,"\u2021","\\textdaggerdbl");i(l,u,i0,"\u23B1","\\rmoustache",!0);i(l,u,c0,"\u23B0","\\lmoustache",!0);i(l,u,i0,"\u27EF","\\rgroup",!0);i(l,u,c0,"\u27EE","\\lgroup",!0);i(l,u,D,"\u2213","\\mp",!0);i(l,u,D,"\u2296","\\ominus",!0);i(l,u,D,"\u228E","\\uplus",!0);i(l,u,D,"\u2293","\\sqcap",!0);i(l,u,D,"\u2217","\\ast");i(l,u,D,"\u2294","\\sqcup",!0);i(l,u,D,"\u25EF","\\bigcirc",!0);i(l,u,D,"\u2219","\\bullet",!0);i(l,u,D,"\u2021","\\ddagger");i(l,u,D,"\u2240","\\wr",!0);i(l,u,D,"\u2A3F","\\amalg");i(l,u,D,"&","\\And");i(l,u,f,"\u27F5","\\longleftarrow",!0);i(l,u,f,"\u21D0","\\Leftarrow",!0);i(l,u,f,"\u27F8","\\Longleftarrow",!0);i(l,u,f,"\u27F6","\\longrightarrow",!0);i(l,u,f,"\u21D2","\\Rightarrow",!0);i(l,u,f,"\u27F9","\\Longrightarrow",!0);i(l,u,f,"\u2194","\\leftrightarrow",!0);i(l,u,f,"\u27F7","\\longleftrightarrow",!0);i(l,u,f,"\u21D4","\\Leftrightarrow",!0);i(l,u,f,"\u27FA","\\Longleftrightarrow",!0);i(l,u,f,"\u21A6","\\mapsto",!0);i(l,u,f,"\u27FC","\\longmapsto",!0);i(l,u,f,"\u2197","\\nearrow",!0);i(l,u,f,"\u21A9","\\hookleftarrow",!0);i(l,u,f,"\u21AA","\\hookrightarrow",!0);i(l,u,f,"\u2198","\\searrow",!0);i(l,u,f,"\u21BC","\\leftharpoonup",!0);i(l,u,f,"\u21C0","\\rightharpoonup",!0);i(l,u,f,"\u2199","\\swarrow",!0);i(l,u,f,"\u21BD","\\leftharpoondown",!0);i(l,u,f,"\u21C1","\\rightharpoondown",!0);i(l,u,f,"\u2196","\\nwarrow",!0);i(l,u,f,"\u21CC","\\rightleftharpoons",!0);i(l,d,f,"\u226E","\\nless",!0);i(l,d,f,"\uE010","\\@nleqslant");i(l,d,f,"\uE011","\\@nleqq");i(l,d,f,"\u2A87","\\lneq",!0);i(l,d,f,"\u2268","\\lneqq",!0);i(l,d,f,"\uE00C","\\@lvertneqq");i(l,d,f,"\u22E6","\\lnsim",!0);i(l,d,f,"\u2A89","\\lnapprox",!0);i(l,d,f,"\u2280","\\nprec",!0);i(l,d,f,"\u22E0","\\npreceq",!0);i(l,d,f,"\u22E8","\\precnsim",!0);i(l,d,f,"\u2AB9","\\precnapprox",!0);i(l,d,f,"\u2241","\\nsim",!0);i(l,d,f,"\uE006","\\@nshortmid");i(l,d,f,"\u2224","\\nmid",!0);i(l,d,f,"\u22AC","\\nvdash",!0);i(l,d,f,"\u22AD","\\nvDash",!0);i(l,d,f,"\u22EA","\\ntriangleleft");i(l,d,f,"\u22EC","\\ntrianglelefteq",!0);i(l,d,f,"\u228A","\\subsetneq",!0);i(l,d,f,"\uE01A","\\@varsubsetneq");i(l,d,f,"\u2ACB","\\subsetneqq",!0);i(l,d,f,"\uE017","\\@varsubsetneqq");i(l,d,f,"\u226F","\\ngtr",!0);i(l,d,f,"\uE00F","\\@ngeqslant");i(l,d,f,"\uE00E","\\@ngeqq");i(l,d,f,"\u2A88","\\gneq",!0);i(l,d,f,"\u2269","\\gneqq",!0);i(l,d,f,"\uE00D","\\@gvertneqq");i(l,d,f,"\u22E7","\\gnsim",!0);i(l,d,f,"\u2A8A","\\gnapprox",!0);i(l,d,f,"\u2281","\\nsucc",!0);i(l,d,f,"\u22E1","\\nsucceq",!0);i(l,d,f,"\u22E9","\\succnsim",!0);i(l,d,f,"\u2ABA","\\succnapprox",!0);i(l,d,f,"\u2246","\\ncong",!0);i(l,d,f,"\uE007","\\@nshortparallel");i(l,d,f,"\u2226","\\nparallel",!0);i(l,d,f,"\u22AF","\\nVDash",!0);i(l,d,f,"\u22EB","\\ntriangleright");i(l,d,f,"\u22ED","\\ntrianglerighteq",!0);i(l,d,f,"\uE018","\\@nsupseteqq");i(l,d,f,"\u228B","\\supsetneq",!0);i(l,d,f,"\uE01B","\\@varsupsetneq");i(l,d,f,"\u2ACC","\\supsetneqq",!0);i(l,d,f,"\uE019","\\@varsupsetneqq");i(l,d,f,"\u22AE","\\nVdash",!0);i(l,d,f,"\u2AB5","\\precneqq",!0);i(l,d,f,"\u2AB6","\\succneqq",!0);i(l,d,f,"\uE016","\\@nsubseteqq");i(l,d,D,"\u22B4","\\unlhd");i(l,d,D,"\u22B5","\\unrhd");i(l,d,f,"\u219A","\\nleftarrow",!0);i(l,d,f,"\u219B","\\nrightarrow",!0);i(l,d,f,"\u21CD","\\nLeftarrow",!0);i(l,d,f,"\u21CF","\\nRightarrow",!0);i(l,d,f,"\u21AE","\\nleftrightarrow",!0);i(l,d,f,"\u21CE","\\nLeftrightarrow",!0);i(l,d,f,"\u25B3","\\vartriangle");i(l,d,v,"\u210F","\\hslash");i(l,d,v,"\u25BD","\\triangledown");i(l,d,v,"\u25CA","\\lozenge");i(l,d,v,"\u24C8","\\circledS");i(l,d,v,"\xAE","\\circledR");i(k,d,v,"\xAE","\\circledR");i(l,d,v,"\u2221","\\measuredangle",!0);i(l,d,v,"\u2204","\\nexists");i(l,d,v,"\u2127","\\mho");i(l,d,v,"\u2132","\\Finv",!0);i(l,d,v,"\u2141","\\Game",!0);i(l,d,v,"\u2035","\\backprime");i(l,d,v,"\u25B2","\\blacktriangle");i(l,d,v,"\u25BC","\\blacktriangledown");i(l,d,v,"\u25A0","\\blacksquare");i(l,d,v,"\u29EB","\\blacklozenge");i(l,d,v,"\u2605","\\bigstar");i(l,d,v,"\u2222","\\sphericalangle",!0);i(l,d,v,"\u2201","\\complement",!0);i(l,d,v,"\xF0","\\eth",!0);i(k,u,v,"\xF0","\xF0");i(l,d,v,"\u2571","\\diagup");i(l,d,v,"\u2572","\\diagdown");i(l,d,v,"\u25A1","\\square");i(l,d,v,"\u25A1","\\Box");i(l,d,v,"\u25CA","\\Diamond");i(l,d,v,"\xA5","\\yen",!0);i(k,d,v,"\xA5","\\yen",!0);i(l,d,v,"\u2713","\\checkmark",!0);i(k,d,v,"\u2713","\\checkmark");i(l,d,v,"\u2136","\\beth",!0);i(l,d,v,"\u2138","\\daleth",!0);i(l,d,v,"\u2137","\\gimel",!0);i(l,d,v,"\u03DD","\\digamma",!0);i(l,d,v,"\u03F0","\\varkappa");i(l,d,c0,"\u250C","\\@ulcorner",!0);i(l,d,i0,"\u2510","\\@urcorner",!0);i(l,d,c0,"\u2514","\\@llcorner",!0);i(l,d,i0,"\u2518","\\@lrcorner",!0);i(l,d,f,"\u2266","\\leqq",!0);i(l,d,f,"\u2A7D","\\leqslant",!0);i(l,d,f,"\u2A95","\\eqslantless",!0);i(l,d,f,"\u2272","\\lesssim",!0);i(l,d,f,"\u2A85","\\lessapprox",!0);i(l,d,f,"\u224A","\\approxeq",!0);i(l,d,D,"\u22D6","\\lessdot");i(l,d,f,"\u22D8","\\lll",!0);i(l,d,f,"\u2276","\\lessgtr",!0);i(l,d,f,"\u22DA","\\lesseqgtr",!0);i(l,d,f,"\u2A8B","\\lesseqqgtr",!0);i(l,d,f,"\u2251","\\doteqdot");i(l,d,f,"\u2253","\\risingdotseq",!0);i(l,d,f,"\u2252","\\fallingdotseq",!0);i(l,d,f,"\u223D","\\backsim",!0);i(l,d,f,"\u22CD","\\backsimeq",!0);i(l,d,f,"\u2AC5","\\subseteqq",!0);i(l,d,f,"\u22D0","\\Subset",!0);i(l,d,f,"\u228F","\\sqsubset",!0);i(l,d,f,"\u227C","\\preccurlyeq",!0);i(l,d,f,"\u22DE","\\curlyeqprec",!0);i(l,d,f,"\u227E","\\precsim",!0);i(l,d,f,"\u2AB7","\\precapprox",!0);i(l,d,f,"\u22B2","\\vartriangleleft");i(l,d,f,"\u22B4","\\trianglelefteq");i(l,d,f,"\u22A8","\\vDash",!0);i(l,d,f,"\u22AA","\\Vvdash",!0);i(l,d,f,"\u2323","\\smallsmile");i(l,d,f,"\u2322","\\smallfrown");i(l,d,f,"\u224F","\\bumpeq",!0);i(l,d,f,"\u224E","\\Bumpeq",!0);i(l,d,f,"\u2267","\\geqq",!0);i(l,d,f,"\u2A7E","\\geqslant",!0);i(l,d,f,"\u2A96","\\eqslantgtr",!0);i(l,d,f,"\u2273","\\gtrsim",!0);i(l,d,f,"\u2A86","\\gtrapprox",!0);i(l,d,D,"\u22D7","\\gtrdot");i(l,d,f,"\u22D9","\\ggg",!0);i(l,d,f,"\u2277","\\gtrless",!0);i(l,d,f,"\u22DB","\\gtreqless",!0);i(l,d,f,"\u2A8C","\\gtreqqless",!0);i(l,d,f,"\u2256","\\eqcirc",!0);i(l,d,f,"\u2257","\\circeq",!0);i(l,d,f,"\u225C","\\triangleq",!0);i(l,d,f,"\u223C","\\thicksim");i(l,d,f,"\u2248","\\thickapprox");i(l,d,f,"\u2AC6","\\supseteqq",!0);i(l,d,f,"\u22D1","\\Supset",!0);i(l,d,f,"\u2290","\\sqsupset",!0);i(l,d,f,"\u227D","\\succcurlyeq",!0);i(l,d,f,"\u22DF","\\curlyeqsucc",!0);i(l,d,f,"\u227F","\\succsim",!0);i(l,d,f,"\u2AB8","\\succapprox",!0);i(l,d,f,"\u22B3","\\vartriangleright");i(l,d,f,"\u22B5","\\trianglerighteq");i(l,d,f,"\u22A9","\\Vdash",!0);i(l,d,f,"\u2223","\\shortmid");i(l,d,f,"\u2225","\\shortparallel");i(l,d,f,"\u226C","\\between",!0);i(l,d,f,"\u22D4","\\pitchfork",!0);i(l,d,f,"\u221D","\\varpropto");i(l,d,f,"\u25C0","\\blacktriangleleft");i(l,d,f,"\u2234","\\therefore",!0);i(l,d,f,"\u220D","\\backepsilon");i(l,d,f,"\u25B6","\\blacktriangleright");i(l,d,f,"\u2235","\\because",!0);i(l,d,f,"\u22D8","\\llless");i(l,d,f,"\u22D9","\\gggtr");i(l,d,D,"\u22B2","\\lhd");i(l,d,D,"\u22B3","\\rhd");i(l,d,f,"\u2242","\\eqsim",!0);i(l,u,f,"\u22C8","\\Join");i(l,d,f,"\u2251","\\Doteq",!0);i(l,d,D,"\u2214","\\dotplus",!0);i(l,d,D,"\u2216","\\smallsetminus");i(l,d,D,"\u22D2","\\Cap",!0);i(l,d,D,"\u22D3","\\Cup",!0);i(l,d,D,"\u2A5E","\\doublebarwedge",!0);i(l,d,D,"\u229F","\\boxminus",!0);i(l,d,D,"\u229E","\\boxplus",!0);i(l,d,D,"\u22C7","\\divideontimes",!0);i(l,d,D,"\u22C9","\\ltimes",!0);i(l,d,D,"\u22CA","\\rtimes",!0);i(l,d,D,"\u22CB","\\leftthreetimes",!0);i(l,d,D,"\u22CC","\\rightthreetimes",!0);i(l,d,D,"\u22CF","\\curlywedge",!0);i(l,d,D,"\u22CE","\\curlyvee",!0);i(l,d,D,"\u229D","\\circleddash",!0);i(l,d,D,"\u229B","\\circledast",!0);i(l,d,D,"\u22C5","\\centerdot");i(l,d,D,"\u22BA","\\intercal",!0);i(l,d,D,"\u22D2","\\doublecap");i(l,d,D,"\u22D3","\\doublecup");i(l,d,D,"\u22A0","\\boxtimes",!0);i(l,d,f,"\u21E2","\\dashrightarrow",!0);i(l,d,f,"\u21E0","\\dashleftarrow",!0);i(l,d,f,"\u21C7","\\leftleftarrows",!0);i(l,d,f,"\u21C6","\\leftrightarrows",!0);i(l,d,f,"\u21DA","\\Lleftarrow",!0);i(l,d,f,"\u219E","\\twoheadleftarrow",!0);i(l,d,f,"\u21A2","\\leftarrowtail",!0);i(l,d,f,"\u21AB","\\looparrowleft",!0);i(l,d,f,"\u21CB","\\leftrightharpoons",!0);i(l,d,f,"\u21B6","\\curvearrowleft",!0);i(l,d,f,"\u21BA","\\circlearrowleft",!0);i(l,d,f,"\u21B0","\\Lsh",!0);i(l,d,f,"\u21C8","\\upuparrows",!0);i(l,d,f,"\u21BF","\\upharpoonleft",!0);i(l,d,f,"\u21C3","\\downharpoonleft",!0);i(l,u,f,"\u22B6","\\origof",!0);i(l,u,f,"\u22B7","\\imageof",!0);i(l,d,f,"\u22B8","\\multimap",!0);i(l,d,f,"\u21AD","\\leftrightsquigarrow",!0);i(l,d,f,"\u21C9","\\rightrightarrows",!0);i(l,d,f,"\u21C4","\\rightleftarrows",!0);i(l,d,f,"\u21A0","\\twoheadrightarrow",!0);i(l,d,f,"\u21A3","\\rightarrowtail",!0);i(l,d,f,"\u21AC","\\looparrowright",!0);i(l,d,f,"\u21B7","\\curvearrowright",!0);i(l,d,f,"\u21BB","\\circlearrowright",!0);i(l,d,f,"\u21B1","\\Rsh",!0);i(l,d,f,"\u21CA","\\downdownarrows",!0);i(l,d,f,"\u21BE","\\upharpoonright",!0);i(l,d,f,"\u21C2","\\downharpoonright",!0);i(l,d,f,"\u21DD","\\rightsquigarrow",!0);i(l,d,f,"\u21DD","\\leadsto");i(l,d,f,"\u21DB","\\Rrightarrow",!0);i(l,d,f,"\u21BE","\\restriction");i(l,u,v,"\u2018","`");i(l,u,v,"$","\\$");i(k,u,v,"$","\\$");i(k,u,v,"$","\\textdollar");i(l,u,v,"%","\\%");i(k,u,v,"%","\\%");i(l,u,v,"_","\\_");i(k,u,v,"_","\\_");i(k,u,v,"_","\\textunderscore");i(l,u,v,"\u2220","\\angle",!0);i(l,u,v,"\u221E","\\infty",!0);i(l,u,v,"\u2032","\\prime");i(l,u,v,"\u25B3","\\triangle");i(l,u,v,"\u0393","\\Gamma",!0);i(l,u,v,"\u0394","\\Delta",!0);i(l,u,v,"\u0398","\\Theta",!0);i(l,u,v,"\u039B","\\Lambda",!0);i(l,u,v,"\u039E","\\Xi",!0);i(l,u,v,"\u03A0","\\Pi",!0);i(l,u,v,"\u03A3","\\Sigma",!0);i(l,u,v,"\u03A5","\\Upsilon",!0);i(l,u,v,"\u03A6","\\Phi",!0);i(l,u,v,"\u03A8","\\Psi",!0);i(l,u,v,"\u03A9","\\Omega",!0);i(l,u,v,"A","\u0391");i(l,u,v,"B","\u0392");i(l,u,v,"E","\u0395");i(l,u,v,"Z","\u0396");i(l,u,v,"H","\u0397");i(l,u,v,"I","\u0399");i(l,u,v,"K","\u039A");i(l,u,v,"M","\u039C");i(l,u,v,"N","\u039D");i(l,u,v,"O","\u039F");i(l,u,v,"P","\u03A1");i(l,u,v,"T","\u03A4");i(l,u,v,"X","\u03A7");i(l,u,v,"\xAC","\\neg",!0);i(l,u,v,"\xAC","\\lnot");i(l,u,v,"\u22A4","\\top");i(l,u,v,"\u22A5","\\bot");i(l,u,v,"\u2205","\\emptyset");i(l,d,v,"\u2205","\\varnothing");i(l,u,E,"\u03B1","\\alpha",!0);i(l,u,E,"\u03B2","\\beta",!0);i(l,u,E,"\u03B3","\\gamma",!0);i(l,u,E,"\u03B4","\\delta",!0);i(l,u,E,"\u03F5","\\epsilon",!0);i(l,u,E,"\u03B6","\\zeta",!0);i(l,u,E,"\u03B7","\\eta",!0);i(l,u,E,"\u03B8","\\theta",!0);i(l,u,E,"\u03B9","\\iota",!0);i(l,u,E,"\u03BA","\\kappa",!0);i(l,u,E,"\u03BB","\\lambda",!0);i(l,u,E,"\u03BC","\\mu",!0);i(l,u,E,"\u03BD","\\nu",!0);i(l,u,E,"\u03BE","\\xi",!0);i(l,u,E,"\u03BF","\\omicron",!0);i(l,u,E,"\u03C0","\\pi",!0);i(l,u,E,"\u03C1","\\rho",!0);i(l,u,E,"\u03C3","\\sigma",!0);i(l,u,E,"\u03C4","\\tau",!0);i(l,u,E,"\u03C5","\\upsilon",!0);i(l,u,E,"\u03D5","\\phi",!0);i(l,u,E,"\u03C7","\\chi",!0);i(l,u,E,"\u03C8","\\psi",!0);i(l,u,E,"\u03C9","\\omega",!0);i(l,u,E,"\u03B5","\\varepsilon",!0);i(l,u,E,"\u03D1","\\vartheta",!0);i(l,u,E,"\u03D6","\\varpi",!0);i(l,u,E,"\u03F1","\\varrho",!0);i(l,u,E,"\u03C2","\\varsigma",!0);i(l,u,E,"\u03C6","\\varphi",!0);i(l,u,D,"\u2217","*",!0);i(l,u,D,"+","+");i(l,u,D,"\u2212","-",!0);i(l,u,D,"\u22C5","\\cdot",!0);i(l,u,D,"\u2218","\\circ",!0);i(l,u,D,"\xF7","\\div",!0);i(l,u,D,"\xB1","\\pm",!0);i(l,u,D,"\xD7","\\times",!0);i(l,u,D,"\u2229","\\cap",!0);i(l,u,D,"\u222A","\\cup",!0);i(l,u,D,"\u2216","\\setminus",!0);i(l,u,D,"\u2227","\\land");i(l,u,D,"\u2228","\\lor");i(l,u,D,"\u2227","\\wedge",!0);i(l,u,D,"\u2228","\\vee",!0);i(l,u,v,"\u221A","\\surd");i(l,u,c0,"\u27E8","\\langle",!0);i(l,u,c0,"\u2223","\\lvert");i(l,u,c0,"\u2225","\\lVert");i(l,u,i0,"?","?");i(l,u,i0,"!","!");i(l,u,i0,"\u27E9","\\rangle",!0);i(l,u,i0,"\u2223","\\rvert");i(l,u,i0,"\u2225","\\rVert");i(l,u,f,"=","=");i(l,u,f,":",":");i(l,u,f,"\u2248","\\approx",!0);i(l,u,f,"\u2245","\\cong",!0);i(l,u,f,"\u2265","\\ge");i(l,u,f,"\u2265","\\geq",!0);i(l,u,f,"\u2190","\\gets");i(l,u,f,">","\\gt",!0);i(l,u,f,"\u2208","\\in",!0);i(l,u,f,"\uE020","\\@not");i(l,u,f,"\u2282","\\subset",!0);i(l,u,f,"\u2283","\\supset",!0);i(l,u,f,"\u2286","\\subseteq",!0);i(l,u,f,"\u2287","\\supseteq",!0);i(l,d,f,"\u2288","\\nsubseteq",!0);i(l,d,f,"\u2289","\\nsupseteq",!0);i(l,u,f,"\u22A8","\\models");i(l,u,f,"\u2190","\\leftarrow",!0);i(l,u,f,"\u2264","\\le");i(l,u,f,"\u2264","\\leq",!0);i(l,u,f,"<","\\lt",!0);i(l,u,f,"\u2192","\\rightarrow",!0);i(l,u,f,"\u2192","\\to");i(l,d,f,"\u2271","\\ngeq",!0);i(l,d,f,"\u2270","\\nleq",!0);i(l,u,R0,"\xA0","\\ ");i(l,u,R0,"\xA0","\\space");i(l,u,R0,"\xA0","\\nobreakspace");i(k,u,R0,"\xA0","\\ ");i(k,u,R0,"\xA0"," ");i(k,u,R0,"\xA0","\\space");i(k,u,R0,"\xA0","\\nobreakspace");i(l,u,R0,null,"\\nobreak");i(l,u,R0,null,"\\allowbreak");i(l,u,Ge,",",",");i(l,u,Ge,";",";");i(l,d,D,"\u22BC","\\barwedge",!0);i(l,d,D,"\u22BB","\\veebar",!0);i(l,u,D,"\u2299","\\odot",!0);i(l,u,D,"\u2295","\\oplus",!0);i(l,u,D,"\u2297","\\otimes",!0);i(l,u,v,"\u2202","\\partial",!0);i(l,u,D,"\u2298","\\oslash",!0);i(l,d,D,"\u229A","\\circledcirc",!0);i(l,d,D,"\u22A1","\\boxdot",!0);i(l,u,D,"\u25B3","\\bigtriangleup");i(l,u,D,"\u25BD","\\bigtriangledown");i(l,u,D,"\u2020","\\dagger");i(l,u,D,"\u22C4","\\diamond");i(l,u,D,"\u22C6","\\star");i(l,u,D,"\u25C3","\\triangleleft");i(l,u,D,"\u25B9","\\triangleright");i(l,u,c0,"{","\\{");i(k,u,v,"{","\\{");i(k,u,v,"{","\\textbraceleft");i(l,u,i0,"}","\\}");i(k,u,v,"}","\\}");i(k,u,v,"}","\\textbraceright");i(l,u,c0,"{","\\lbrace");i(l,u,i0,"}","\\rbrace");i(l,u,c0,"[","\\lbrack",!0);i(k,u,v,"[","\\lbrack",!0);i(l,u,i0,"]","\\rbrack",!0);i(k,u,v,"]","\\rbrack",!0);i(l,u,c0,"(","\\lparen",!0);i(l,u,i0,")","\\rparen",!0);i(k,u,v,"<","\\textless",!0);i(k,u,v,">","\\textgreater",!0);i(l,u,c0,"\u230A","\\lfloor",!0);i(l,u,i0,"\u230B","\\rfloor",!0);i(l,u,c0,"\u2308","\\lceil",!0);i(l,u,i0,"\u2309","\\rceil",!0);i(l,u,v,"\\","\\backslash");i(l,u,v,"\u2223","|");i(l,u,v,"\u2223","\\vert");i(k,u,v,"|","\\textbar",!0);i(l,u,v,"\u2225","\\|");i(l,u,v,"\u2225","\\Vert");i(k,u,v,"\u2225","\\textbardbl");i(k,u,v,"~","\\textasciitilde");i(k,u,v,"\\","\\textbackslash");i(k,u,v,"^","\\textasciicircum");i(l,u,f,"\u2191","\\uparrow",!0);i(l,u,f,"\u21D1","\\Uparrow",!0);i(l,u,f,"\u2193","\\downarrow",!0);i(l,u,f,"\u21D3","\\Downarrow",!0);i(l,u,f,"\u2195","\\updownarrow",!0);i(l,u,f,"\u21D5","\\Updownarrow",!0);i(l,u,_,"\u2210","\\coprod");i(l,u,_,"\u22C1","\\bigvee");i(l,u,_,"\u22C0","\\bigwedge");i(l,u,_,"\u2A04","\\biguplus");i(l,u,_,"\u22C2","\\bigcap");i(l,u,_,"\u22C3","\\bigcup");i(l,u,_,"\u222B","\\int");i(l,u,_,"\u222B","\\intop");i(l,u,_,"\u222C","\\iint");i(l,u,_,"\u222D","\\iiint");i(l,u,_,"\u220F","\\prod");i(l,u,_,"\u2211","\\sum");i(l,u,_,"\u2A02","\\bigotimes");i(l,u,_,"\u2A01","\\bigoplus");i(l,u,_,"\u2A00","\\bigodot");i(l,u,_,"\u222E","\\oint");i(l,u,_,"\u222F","\\oiint");i(l,u,_,"\u2230","\\oiiint");i(l,u,_,"\u2A06","\\bigsqcup");i(l,u,_,"\u222B","\\smallint");i(k,u,ae,"\u2026","\\textellipsis");i(l,u,ae,"\u2026","\\mathellipsis");i(k,u,ae,"\u2026","\\ldots",!0);i(l,u,ae,"\u2026","\\ldots",!0);i(l,u,ae,"\u22EF","\\@cdots",!0);i(l,u,ae,"\u22F1","\\ddots",!0);i(l,u,v,"\u22EE","\\varvdots");i(l,u,W,"\u02CA","\\acute");i(l,u,W,"\u02CB","\\grave");i(l,u,W,"\xA8","\\ddot");i(l,u,W,"~","\\tilde");i(l,u,W,"\u02C9","\\bar");i(l,u,W,"\u02D8","\\breve");i(l,u,W,"\u02C7","\\check");i(l,u,W,"^","\\hat");i(l,u,W,"\u20D7","\\vec");i(l,u,W,"\u02D9","\\dot");i(l,u,W,"\u02DA","\\mathring");i(l,u,E,"\uE131","\\@imath");i(l,u,E,"\uE237","\\@jmath");i(l,u,v,"\u0131","\u0131");i(l,u,v,"\u0237","\u0237");i(k,u,v,"\u0131","\\i",!0);i(k,u,v,"\u0237","\\j",!0);i(k,u,v,"\xDF","\\ss",!0);i(k,u,v,"\xE6","\\ae",!0);i(k,u,v,"\u0153","\\oe",!0);i(k,u,v,"\xF8","\\o",!0);i(k,u,v,"\xC6","\\AE",!0);i(k,u,v,"\u0152","\\OE",!0);i(k,u,v,"\xD8","\\O",!0);i(k,u,W,"\u02CA","\\'");i(k,u,W,"\u02CB","\\`");i(k,u,W,"\u02C6","\\^");i(k,u,W,"\u02DC","\\~");i(k,u,W,"\u02C9","\\=");i(k,u,W,"\u02D8","\\u");i(k,u,W,"\u02D9","\\.");i(k,u,W,"\xB8","\\c");i(k,u,W,"\u02DA","\\r");i(k,u,W,"\u02C7","\\v");i(k,u,W,"\xA8",'\\"');i(k,u,W,"\u02DD","\\H");i(k,u,W,"\u25EF","\\textcircled");var Tr={"--":!0,"---":!0,"``":!0,"''":!0};i(k,u,v,"\u2013","--",!0);i(k,u,v,"\u2013","\\textendash");i(k,u,v,"\u2014","---",!0);i(k,u,v,"\u2014","\\textemdash");i(k,u,v,"\u2018","`",!0);i(k,u,v,"\u2018","\\textquoteleft");i(k,u,v,"\u2019","'",!0);i(k,u,v,"\u2019","\\textquoteright");i(k,u,v,"\u201C","``",!0);i(k,u,v,"\u201C","\\textquotedblleft");i(k,u,v,"\u201D","''",!0);i(k,u,v,"\u201D","\\textquotedblright");i(l,u,v,"\xB0","\\degree",!0);i(k,u,v,"\xB0","\\degree");i(k,u,v,"\xB0","\\textdegree",!0);i(l,u,v,"\xA3","\\pounds");i(l,u,v,"\xA3","\\mathsterling",!0);i(k,u,v,"\xA3","\\pounds");i(k,u,v,"\xA3","\\textsterling",!0);i(l,d,v,"\u2720","\\maltese");i(k,d,v,"\u2720","\\maltese");var Zt='0123456789/@."';for(we=0;we0)return b0(s,p,n,t,o.concat(g));if(c){var b,w;if(c==="boldsymbol"){var x=n1(s,n,t,o,a);b=x.fontName,w=[x.fontClass]}else h?(b=Cr[c].fontName,w=[c]):(b=Ae(c,t.fontWeight,t.fontShape),w=[c,t.fontWeight,t.fontShape]);if(Ve(s,b,n).metrics)return b0(s,b,n,t,o.concat(w));if(Tr.hasOwnProperty(s)&&b.slice(0,10)==="Typewriter"){for(var z=[],T=0;T{if(P0(r.classes)!==P0(e.classes)||r.skew!==e.skew||r.maxFontSize!==e.maxFontSize)return!1;if(r.classes.length===1){var t=r.classes[0];if(t==="mbin"||t==="mord")return!1}for(var a in r.style)if(r.style.hasOwnProperty(a)&&r.style[a]!==e.style[a])return!1;for(var n in e.style)if(e.style.hasOwnProperty(n)&&r.style[n]!==e.style[n])return!1;return!0},l1=r=>{for(var e=0;et&&(t=o.height),o.depth>a&&(a=o.depth),o.maxFontSize>n&&(n=o.maxFontSize)}e.height=t,e.depth=a,e.maxFontSize=n},l0=function(e,t,a,n){var s=new W0(e,t,a,n);return Mt(s),s},Br=(r,e,t,a)=>new W0(r,e,t,a),o1=function(e,t,a){var n=l0([e],[],t);return n.height=Math.max(a||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),n.style.borderBottomWidth=A(n.height),n.maxFontSize=1,n},u1=function(e,t,a,n){var s=new ce(e,t,a,n);return Mt(s),s},Dr=function(e){var t=new X0(e);return Mt(t),t},h1=function(e,t){return e instanceof X0?l0([],[e],t):e},m1=function(e){if(e.positionType==="individualShift"){for(var t=e.children,a=[t[0]],n=-t[0].shift-t[0].elem.depth,s=n,o=1;o{var t=l0(["mspace"],[],e),a=J(r,e);return t.style.marginRight=A(a),t},Ae=function(e,t,a){var n="";switch(e){case"amsrm":n="AMS";break;case"textrm":n="Main";break;case"textsf":n="SansSerif";break;case"texttt":n="Typewriter";break;default:n=e}var s;return t==="textbf"&&a==="textit"?s="BoldItalic":t==="textbf"?s="Bold":t==="textit"?s="Italic":s="Regular",n+"-"+s},Cr={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},qr={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},f1=function(e,t){var[a,n,s]=qr[e],o=new S0(a),h=new y0([o],{width:A(n),height:A(s),style:"width:"+A(n),viewBox:"0 0 "+1e3*n+" "+1e3*s,preserveAspectRatio:"xMinYMin"}),c=Br(["overlay"],[h],t);return c.height=s,c.style.height=A(s),c.style.width=A(n),c},y={fontMap:Cr,makeSymbol:b0,mathsym:a1,makeSpan:l0,makeSvgSpan:Br,makeLineSpan:o1,makeAnchor:u1,makeFragment:Dr,wrapFragment:h1,makeVList:c1,makeOrd:i1,makeGlue:d1,staticSvg:f1,svgData:qr,tryCombineChars:l1},K={number:3,unit:"mu"},$0={number:4,unit:"mu"},D0={number:5,unit:"mu"},p1={mord:{mop:K,mbin:$0,mrel:D0,minner:K},mop:{mord:K,mop:K,mrel:D0,minner:K},mbin:{mord:$0,mop:$0,mopen:$0,minner:$0},mrel:{mord:D0,mop:D0,mopen:D0,minner:D0},mopen:{},mclose:{mop:K,mbin:$0,mrel:D0,minner:K},mpunct:{mord:K,mop:K,mrel:D0,mopen:K,mclose:K,mpunct:K,minner:K},minner:{mord:K,mop:K,mbin:$0,mrel:D0,mopen:K,mpunct:K,minner:K}},v1={mord:{mop:K},mop:{mord:K,mop:K},mbin:{},mrel:{},mopen:{},mclose:{mop:K},mpunct:{},minner:{mop:K}},Nr={},Oe={},He={};function B(r){for(var{type:e,names:t,props:a,handler:n,htmlBuilder:s,mathmlBuilder:o}=r,h={type:e,numArgs:a.numArgs,argTypes:a.argTypes,allowedInArgument:!!a.allowedInArgument,allowedInText:!!a.allowedInText,allowedInMath:a.allowedInMath===void 0?!0:a.allowedInMath,numOptionalArgs:a.numOptionalArgs||0,infix:!!a.infix,primitive:!!a.primitive,handler:n},c=0;c{var C=T.classes[0],q=z.classes[0];C==="mbin"&&N.contains(b1,q)?T.classes[0]="mord":q==="mbin"&&N.contains(g1,C)&&(z.classes[0]="mord")},{node:b},w,x),Qt(s,(z,T)=>{var C=ft(T),q=ft(z),O=C&&q?z.hasClass("mtight")?v1[C][q]:p1[C][q]:null;if(O)return y.makeGlue(O,p)},{node:b},w,x),s},Qt=function r(e,t,a,n,s){n&&e.push(n);for(var o=0;ow=>{e.splice(b+1,0,w),o++})(o)}n&&e.pop()},Er=function(e){return e instanceof X0||e instanceof ce||e instanceof W0&&e.hasClass("enclosing")?e:null},w1=function r(e,t){var a=Er(e);if(a){var n=a.children;if(n.length){if(t==="right")return r(n[n.length-1],"right");if(t==="left")return r(n[0],"left")}}return e},ft=function(e,t){return e?(t&&(e=w1(e,t)),x1[e.classes[0]]||null):null},fe=function(e,t){var a=["nulldelimiter"].concat(e.baseSizingClasses());return N0(t.concat(a))},P=function(e,t,a){if(!e)return N0();if(Oe[e.type]){var n=Oe[e.type](e,t);if(a&&t.size!==a.size){n=N0(t.sizingClasses(a),[n],t);var s=t.sizeMultiplier/a.sizeMultiplier;n.height*=s,n.depth*=s}return n}else throw new M("Got group of unknown type: '"+e.type+"'")};function Te(r,e){var t=N0(["base"],r,e),a=N0(["strut"]);return a.style.height=A(t.height+t.depth),t.depth&&(a.style.verticalAlign=A(-t.depth)),t.children.unshift(a),t}function pt(r,e){var t=null;r.length===1&&r[0].type==="tag"&&(t=r[0].tag,r=r[0].body);var a=t0(r,e,"root"),n;a.length===2&&a[1].hasClass("tag")&&(n=a.pop());for(var s=[],o=[],h=0;h0&&(s.push(Te(o,e)),o=[]),s.push(a[h]));o.length>0&&s.push(Te(o,e));var p;t?(p=Te(t0(t,e,!0)),p.classes=["tag"],s.push(p)):n&&s.push(n);var g=N0(["katex-html"],s);if(g.setAttribute("aria-hidden","true"),p){var b=p.children[0];b.style.height=A(g.height+g.depth),g.depth&&(b.style.verticalAlign=A(-g.depth))}return g}function Rr(r){return new X0(r)}var o0=class{constructor(e,t,a){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=a||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=P0(this.classes));for(var a=0;a0&&(e+=' class ="'+N.escape(P0(this.classes))+'"'),e+=">";for(var a=0;a",e}toText(){return this.children.map(e=>e.toText()).join("")}},Y0=class{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return N.escape(this.toText())}toText(){return this.text}},vt=class{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character="\u200A":e>=.1666&&e<=.1667?this.character="\u2009":e>=.2222&&e<=.2223?this.character="\u2005":e>=.2777&&e<=.2778?this.character="\u2005\u200A":e>=-.05556&&e<=-.05555?this.character="\u200A\u2063":e>=-.1667&&e<=-.1666?this.character="\u2009\u2063":e>=-.2223&&e<=-.2222?this.character="\u205F\u2063":e>=-.2778&&e<=-.2777?this.character="\u2005\u2063":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",A(this.width)),e}toMarkup(){return this.character?""+this.character+" ":' '}toText(){return this.character?this.character:" "}},S={MathNode:o0,TextNode:Y0,SpaceNode:vt,newDocumentFragment:Rr},v0=function(e,t,a){return X[t][e]&&X[t][e].replace&&e.charCodeAt(0)!==55349&&!(Tr.hasOwnProperty(e)&&a&&(a.fontFamily&&a.fontFamily.slice(4,6)==="tt"||a.font&&a.font.slice(4,6)==="tt"))&&(e=X[t][e].replace),new S.TextNode(e)},zt=function(e){return e.length===1?e[0]:new S.MathNode("mrow",e)},At=function(e,t){if(t.fontFamily==="texttt")return"monospace";if(t.fontFamily==="textsf")return t.fontShape==="textit"&&t.fontWeight==="textbf"?"sans-serif-bold-italic":t.fontShape==="textit"?"sans-serif-italic":t.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(t.fontShape==="textit"&&t.fontWeight==="textbf")return"bold-italic";if(t.fontShape==="textit")return"italic";if(t.fontWeight==="textbf")return"bold";var a=t.font;if(!a||a==="mathnormal")return null;var n=e.mode;if(a==="mathit")return"italic";if(a==="boldsymbol")return e.type==="textord"?"bold":"bold-italic";if(a==="mathbf")return"bold";if(a==="mathbb")return"double-struck";if(a==="mathfrak")return"fraktur";if(a==="mathscr"||a==="mathcal")return"script";if(a==="mathsf")return"sans-serif";if(a==="mathtt")return"monospace";var s=e.text;if(N.contains(["\\imath","\\jmath"],s))return null;X[n][s]&&X[n][s].replace&&(s=X[n][s].replace);var o=y.fontMap[a].fontName;return St(s,o,n)?y.fontMap[a].variant:null},h0=function(e,t,a){if(e.length===1){var n=Y(e[0],t);return a&&n instanceof o0&&n.type==="mo"&&(n.setAttribute("lspace","0em"),n.setAttribute("rspace","0em")),[n]}for(var s=[],o,h=0;h0&&(b.text=b.text.slice(0,1)+"\u0338"+b.text.slice(1),s.pop())}}}s.push(c),o=c}return s},G0=function(e,t,a){return zt(h0(e,t,a))},Y=function(e,t){if(!e)return new S.MathNode("mrow");if(He[e.type]){var a=He[e.type](e,t);return a}else throw new M("Got group of unknown type: '"+e.type+"'")};function _t(r,e,t,a,n){var s=h0(r,t),o;s.length===1&&s[0]instanceof o0&&N.contains(["mrow","mtable"],s[0].type)?o=s[0]:o=new S.MathNode("mrow",s);var h=new S.MathNode("annotation",[new S.TextNode(e)]);h.setAttribute("encoding","application/x-tex");var c=new S.MathNode("semantics",[o,h]),p=new S.MathNode("math",[c]);p.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),a&&p.setAttribute("display","block");var g=n?"katex":"katex-mathml";return y.makeSpan([g],[p])}var Ir=function(e){return new Re({style:e.displayMode?R.DISPLAY:R.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},Or=function(e,t){if(t.displayMode){var a=["katex-display"];t.leqno&&a.push("leqno"),t.fleqn&&a.push("fleqn"),e=y.makeSpan(a,[e])}return e},k1=function(e,t,a){var n=Ir(a),s;if(a.output==="mathml")return _t(e,t,n,a.displayMode,!0);if(a.output==="html"){var o=pt(e,n);s=y.makeSpan(["katex"],[o])}else{var h=_t(e,t,n,a.displayMode,!1),c=pt(e,n);s=y.makeSpan(["katex"],[h,c])}return Or(s,a)},S1=function(e,t,a){var n=Ir(a),s=pt(e,n),o=y.makeSpan(["katex"],[s]);return Or(o,a)},M1={widehat:"^",widecheck:"\u02C7",widetilde:"~",utilde:"~",overleftarrow:"\u2190",underleftarrow:"\u2190",xleftarrow:"\u2190",overrightarrow:"\u2192",underrightarrow:"\u2192",xrightarrow:"\u2192",underbrace:"\u23DF",overbrace:"\u23DE",overgroup:"\u23E0",undergroup:"\u23E1",overleftrightarrow:"\u2194",underleftrightarrow:"\u2194",xleftrightarrow:"\u2194",Overrightarrow:"\u21D2",xRightarrow:"\u21D2",overleftharpoon:"\u21BC",xleftharpoonup:"\u21BC",overrightharpoon:"\u21C0",xrightharpoonup:"\u21C0",xLeftarrow:"\u21D0",xLeftrightarrow:"\u21D4",xhookleftarrow:"\u21A9",xhookrightarrow:"\u21AA",xmapsto:"\u21A6",xrightharpoondown:"\u21C1",xleftharpoondown:"\u21BD",xrightleftharpoons:"\u21CC",xleftrightharpoons:"\u21CB",xtwoheadleftarrow:"\u219E",xtwoheadrightarrow:"\u21A0",xlongequal:"=",xtofrom:"\u21C4",xrightleftarrows:"\u21C4",xrightequilibrium:"\u21CC",xleftequilibrium:"\u21CB","\\cdrightarrow":"\u2192","\\cdleftarrow":"\u2190","\\cdlongequal":"="},z1=function(e){var t=new S.MathNode("mo",[new S.TextNode(M1[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},A1={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},T1=function(e){return e.type==="ordgroup"?e.body.length:1},B1=function(e,t){function a(){var h=4e5,c=e.label.slice(1);if(N.contains(["widehat","widecheck","widetilde","utilde"],c)){var p=e,g=T1(p.base),b,w,x;if(g>5)c==="widehat"||c==="widecheck"?(b=420,h=2364,x=.42,w=c+"4"):(b=312,h=2340,x=.34,w="tilde4");else{var z=[1,1,2,2,3,3][g];c==="widehat"||c==="widecheck"?(h=[0,1062,2364,2364,2364][z],b=[0,239,300,360,420][z],x=[0,.24,.3,.3,.36,.42][z],w=c+z):(h=[0,600,1033,2339,2340][z],b=[0,260,286,306,312][z],x=[0,.26,.286,.3,.306,.34][z],w="tilde"+z)}var T=new S0(w),C=new y0([T],{width:"100%",height:A(x),viewBox:"0 0 "+h+" "+b,preserveAspectRatio:"none"});return{span:y.makeSvgSpan([],[C],t),minWidth:0,height:x}}else{var q=[],O=A1[c],[H,V,L]=O,U=L/1e3,G=H.length,j,$;if(G===1){var T0=O[3];j=["hide-tail"],$=[T0]}else if(G===2)j=["halfarrow-left","halfarrow-right"],$=["xMinYMin","xMaxYMin"];else if(G===3)j=["brace-left","brace-center","brace-right"],$=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
- `+G+" children.");for(var a0=0;a00&&(n.style.minWidth=A(s)),n},D1=function(e,t,a,n,s){var o,h=e.height+e.depth+a+n;if(/fbox|color|angl/.test(t)){if(o=y.makeSpan(["stretchy",t],[],s),t==="fbox"){var c=s.color&&s.getColor();c&&(o.style.borderColor=c)}}else{var p=[];/^[bx]cancel$/.test(t)&&p.push(new de({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&p.push(new de({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var g=new y0(p,{width:"100%",height:A(h)});o=y.makeSvgSpan([],[g],s)}return o.height=h,o.style.height=A(h),o},E0={encloseSpan:D1,mathMLnode:z1,svgSpan:B1};function F(r,e){if(!r||r.type!==e)throw new Error("Expected node of type "+e+", but got "+(r?"node of type "+r.type:String(r)));return r}function Tt(r){var e=Ue(r);if(!e)throw new Error("Expected node of symbol group type, but got "+(r?"node of type "+r.type:String(r)));return e}function Ue(r){return r&&(r.type==="atom"||t1.hasOwnProperty(r.type))?r:null}var Bt=(r,e)=>{var t,a,n;r&&r.type==="supsub"?(a=F(r.base,"accent"),t=a.base,r.base=t,n=_a(P(r,e)),r.base=a):(a=F(r,"accent"),t=a.base);var s=P(t,e.havingCrampedStyle()),o=a.isShifty&&N.isCharacterBox(t),h=0;if(o){var c=N.getBaseElem(t),p=P(c,e.havingCrampedStyle());h=jt(p).skew}var g=a.label==="\\c",b=g?s.height+s.depth:Math.min(s.height,e.fontMetrics().xHeight),w;if(a.isStretchy)w=E0.svgSpan(a,e),w=y.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:w,wrapperClasses:["svg-align"],wrapperStyle:h>0?{width:"calc(100% - "+A(2*h)+")",marginLeft:A(2*h)}:void 0}]},e);else{var x,z;a.label==="\\vec"?(x=y.staticSvg("vec",e),z=y.svgData.vec[1]):(x=y.makeOrd({mode:a.mode,text:a.label},e,"textord"),x=jt(x),x.italic=0,z=x.width,g&&(b+=x.depth)),w=y.makeSpan(["accent-body"],[x]);var T=a.label==="\\textcircled";T&&(w.classes.push("accent-full"),b=s.height);var C=h;T||(C-=z/2),w.style.left=A(C),a.label==="\\textcircled"&&(w.style.top=".2em"),w=y.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-b},{type:"elem",elem:w}]},e)}var q=y.makeSpan(["mord","accent"],[w],e);return n?(n.children[0]=q,n.height=Math.max(q.height,n.height),n.classes[0]="mord",n):q},Hr=(r,e)=>{var t=r.isStretchy?E0.mathMLnode(r.label):new S.MathNode("mo",[v0(r.label,r.mode)]),a=new S.MathNode("mover",[Y(r.base,e),t]);return a.setAttribute("accent","true"),a},C1=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(r=>"\\"+r).join("|"));B({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(r,e)=>{var t=Fe(e[0]),a=!C1.test(r.funcName),n=!a||r.funcName==="\\widehat"||r.funcName==="\\widetilde"||r.funcName==="\\widecheck";return{type:"accent",mode:r.parser.mode,label:r.funcName,isStretchy:a,isShifty:n,base:t}},htmlBuilder:Bt,mathmlBuilder:Hr});B({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(r,e)=>{var t=e[0],a=r.parser.mode;return a==="math"&&(r.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+r.funcName+" works only in text mode"),a="text"),{type:"accent",mode:a,label:r.funcName,isStretchy:!1,isShifty:!0,base:t}},htmlBuilder:Bt,mathmlBuilder:Hr});B({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(r,e)=>{var{parser:t,funcName:a}=r,n=e[0];return{type:"accentUnder",mode:t.mode,label:a,base:n}},htmlBuilder:(r,e)=>{var t=P(r.base,e),a=E0.svgSpan(r,e),n=r.label==="\\utilde"?.12:0,s=y.makeVList({positionType:"top",positionData:t.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:n},{type:"elem",elem:t}]},e);return y.makeSpan(["mord","accentunder"],[s],e)},mathmlBuilder:(r,e)=>{var t=E0.mathMLnode(r.label),a=new S.MathNode("munder",[Y(r.base,e),t]);return a.setAttribute("accentunder","true"),a}});var Be=r=>{var e=new S.MathNode("mpadded",r?[r]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};B({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(r,e,t){var{parser:a,funcName:n}=r;return{type:"xArrow",mode:a.mode,label:n,body:e[0],below:t[0]}},htmlBuilder(r,e){var t=e.style,a=e.havingStyle(t.sup()),n=y.wrapFragment(P(r.body,a,e),e),s=r.label.slice(0,2)==="\\x"?"x":"cd";n.classes.push(s+"-arrow-pad");var o;r.below&&(a=e.havingStyle(t.sub()),o=y.wrapFragment(P(r.below,a,e),e),o.classes.push(s+"-arrow-pad"));var h=E0.svgSpan(r,e),c=-e.fontMetrics().axisHeight+.5*h.height,p=-e.fontMetrics().axisHeight-.5*h.height-.111;(n.depth>.25||r.label==="\\xleftequilibrium")&&(p-=n.depth);var g;if(o){var b=-e.fontMetrics().axisHeight+o.height+.5*h.height+.111;g=y.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:p},{type:"elem",elem:h,shift:c},{type:"elem",elem:o,shift:b}]},e)}else g=y.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:p},{type:"elem",elem:h,shift:c}]},e);return g.children[0].children[0].children[1].classes.push("svg-align"),y.makeSpan(["mrel","x-arrow"],[g],e)},mathmlBuilder(r,e){var t=E0.mathMLnode(r.label);t.setAttribute("minsize",r.label.charAt(0)==="x"?"1.75em":"3.0em");var a;if(r.body){var n=Be(Y(r.body,e));if(r.below){var s=Be(Y(r.below,e));a=new S.MathNode("munderover",[t,s,n])}else a=new S.MathNode("mover",[t,n])}else if(r.below){var o=Be(Y(r.below,e));a=new S.MathNode("munder",[t,o])}else a=Be(),a=new S.MathNode("mover",[t,a]);return a}});var q1=y.makeSpan;function Fr(r,e){var t=t0(r.body,e,!0);return q1([r.mclass],t,e)}function Lr(r,e){var t,a=h0(r.body,e);return r.mclass==="minner"?t=new S.MathNode("mpadded",a):r.mclass==="mord"?r.isCharacterBox?(t=a[0],t.type="mi"):t=new S.MathNode("mi",a):(r.isCharacterBox?(t=a[0],t.type="mo"):t=new S.MathNode("mo",a),r.mclass==="mbin"?(t.attributes.lspace="0.22em",t.attributes.rspace="0.22em"):r.mclass==="mpunct"?(t.attributes.lspace="0em",t.attributes.rspace="0.17em"):r.mclass==="mopen"||r.mclass==="mclose"?(t.attributes.lspace="0em",t.attributes.rspace="0em"):r.mclass==="minner"&&(t.attributes.lspace="0.0556em",t.attributes.width="+0.1111em")),t}B({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(r,e){var{parser:t,funcName:a}=r,n=e[0];return{type:"mclass",mode:t.mode,mclass:"m"+a.slice(5),body:Q(n),isCharacterBox:N.isCharacterBox(n)}},htmlBuilder:Fr,mathmlBuilder:Lr});var $e=r=>{var e=r.type==="ordgroup"&&r.body.length?r.body[0]:r;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};B({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(r,e){var{parser:t}=r;return{type:"mclass",mode:t.mode,mclass:$e(e[0]),body:Q(e[1]),isCharacterBox:N.isCharacterBox(e[1])}}});B({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(r,e){var{parser:t,funcName:a}=r,n=e[1],s=e[0],o;a!=="\\stackrel"?o=$e(n):o="mrel";var h={type:"op",mode:n.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:a!=="\\stackrel",body:Q(n)},c={type:"supsub",mode:s.mode,base:h,sup:a==="\\underset"?null:s,sub:a==="\\underset"?s:null};return{type:"mclass",mode:t.mode,mclass:o,body:[c],isCharacterBox:N.isCharacterBox(c)}},htmlBuilder:Fr,mathmlBuilder:Lr});B({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"pmb",mode:t.mode,mclass:$e(e[0]),body:Q(e[0])}},htmlBuilder(r,e){var t=t0(r.body,e,!0),a=y.makeSpan([r.mclass],t,e);return a.style.textShadow="0.02em 0.01em 0.04px",a},mathmlBuilder(r,e){var t=h0(r.body,e),a=new S.MathNode("mstyle",t);return a.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),a}});var N1={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},er=()=>({type:"styling",body:[],mode:"math",style:"display"}),tr=r=>r.type==="textord"&&r.text==="@",E1=(r,e)=>(r.type==="mathord"||r.type==="atom")&&r.text===e;function R1(r,e,t){var a=N1[r];switch(a){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return t.callFunction(a,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var n=t.callFunction("\\\\cdleft",[e[0]],[]),s={type:"atom",text:a,mode:"math",family:"rel"},o=t.callFunction("\\Big",[s],[]),h=t.callFunction("\\\\cdright",[e[1]],[]),c={type:"ordgroup",mode:"math",body:[n,o,h]};return t.callFunction("\\\\cdparent",[c],[])}case"\\\\cdlongequal":return t.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var p={type:"textord",text:"\\Vert",mode:"math"};return t.callFunction("\\Big",[p],[])}default:return{type:"textord",text:" ",mode:"math"}}}function I1(r){var e=[];for(r.gullet.beginGroup(),r.gullet.macros.set("\\cr","\\\\\\relax"),r.gullet.beginGroup();;){e.push(r.parseExpression(!1,"\\\\")),r.gullet.endGroup(),r.gullet.beginGroup();var t=r.fetch().text;if(t==="&"||t==="\\\\")r.consume();else if(t==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new M("Expected \\\\ or \\cr or \\end",r.nextToken)}for(var a=[],n=[a],s=0;s-1))if("<>AV".indexOf(p)>-1)for(var b=0;b<2;b++){for(var w=!0,x=c+1;xAV=|." after @',o[c]);var z=R1(p,g,r),T={type:"styling",body:[z],mode:"math",style:"display"};a.push(T),h=er()}s%2===0?a.push(h):a.shift(),a=[],n.push(a)}r.gullet.endGroup(),r.gullet.endGroup();var C=new Array(n[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:n,arraystretch:1,addJot:!0,rowGaps:[null],cols:C,colSeparationType:"CD",hLinesBeforeRow:new Array(n.length+1).fill([])}}B({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:a}=r;return{type:"cdlabel",mode:t.mode,side:a.slice(4),label:e[0]}},htmlBuilder(r,e){var t=e.havingStyle(e.style.sup()),a=y.wrapFragment(P(r.label,t,e),e);return a.classes.push("cd-label-"+r.side),a.style.bottom=A(.8-a.depth),a.height=0,a.depth=0,a},mathmlBuilder(r,e){var t=new S.MathNode("mrow",[Y(r.label,e)]);return t=new S.MathNode("mpadded",[t]),t.setAttribute("width","0"),r.side==="left"&&t.setAttribute("lspace","-1width"),t.setAttribute("voffset","0.7em"),t=new S.MathNode("mstyle",[t]),t.setAttribute("displaystyle","false"),t.setAttribute("scriptlevel","1"),t}});B({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(r,e){var{parser:t}=r;return{type:"cdlabelparent",mode:t.mode,fragment:e[0]}},htmlBuilder(r,e){var t=y.wrapFragment(P(r.fragment,e),e);return t.classes.push("cd-vert-arrow"),t},mathmlBuilder(r,e){return new S.MathNode("mrow",[Y(r.fragment,e)])}});B({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(r,e){for(var{parser:t}=r,a=F(e[0],"ordgroup"),n=a.body,s="",o=0;o=1114111)throw new M("\\@char with invalid code point "+s);return c<=65535?p=String.fromCharCode(c):(c-=65536,p=String.fromCharCode((c>>10)+55296,(c&1023)+56320)),{type:"textord",mode:t.mode,text:p}}});var Pr=(r,e)=>{var t=t0(r.body,e.withColor(r.color),!1);return y.makeFragment(t)},Gr=(r,e)=>{var t=h0(r.body,e.withColor(r.color)),a=new S.MathNode("mstyle",t);return a.setAttribute("mathcolor",r.color),a};B({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(r,e){var{parser:t}=r,a=F(e[0],"color-token").color,n=e[1];return{type:"color",mode:t.mode,color:a,body:Q(n)}},htmlBuilder:Pr,mathmlBuilder:Gr});B({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(r,e){var{parser:t,breakOnTokenText:a}=r,n=F(e[0],"color-token").color;t.gullet.macros.set("\\current@color",n);var s=t.parseExpression(!0,a);return{type:"color",mode:t.mode,color:n,body:s}},htmlBuilder:Pr,mathmlBuilder:Gr});B({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(r,e,t){var{parser:a}=r,n=a.gullet.future().text==="["?a.parseSizeGroup(!0):null,s=!a.settings.displayMode||!a.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:a.mode,newLine:s,size:n&&F(n,"size").value}},htmlBuilder(r,e){var t=y.makeSpan(["mspace"],[],e);return r.newLine&&(t.classes.push("newline"),r.size&&(t.style.marginTop=A(J(r.size,e)))),t},mathmlBuilder(r,e){var t=new S.MathNode("mspace");return r.newLine&&(t.setAttribute("linebreak","newline"),r.size&&t.setAttribute("height",A(J(r.size,e)))),t}});var gt={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},Vr=r=>{var e=r.text;if(/^(?:[\\{}$^_]|EOF)$/.test(e))throw new M("Expected a control sequence",r);return e},O1=r=>{var e=r.gullet.popToken();return e.text==="="&&(e=r.gullet.popToken(),e.text===" "&&(e=r.gullet.popToken())),e},Ur=(r,e,t,a)=>{var n=r.gullet.macros.get(t.text);n==null&&(t.noexpand=!0,n={tokens:[t],numArgs:0,unexpandable:!r.gullet.isExpandable(t.text)}),r.gullet.macros.set(e,n,a)};B({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(r){var{parser:e,funcName:t}=r;e.consumeSpaces();var a=e.fetch();if(gt[a.text])return(t==="\\global"||t==="\\\\globallong")&&(a.text=gt[a.text]),F(e.parseFunction(),"internal");throw new M("Invalid token after macro prefix",a)}});B({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,a=e.gullet.popToken(),n=a.text;if(/^(?:[\\{}$^_]|EOF)$/.test(n))throw new M("Expected a control sequence",a);for(var s=0,o,h=[[]];e.gullet.future().text!=="{";)if(a=e.gullet.popToken(),a.text==="#"){if(e.gullet.future().text==="{"){o=e.gullet.future(),h[s].push("{");break}if(a=e.gullet.popToken(),!/^[1-9]$/.test(a.text))throw new M('Invalid argument number "'+a.text+'"');if(parseInt(a.text)!==s+1)throw new M('Argument number "'+a.text+'" out of order');s++,h.push([])}else{if(a.text==="EOF")throw new M("Expected a macro definition");h[s].push(a.text)}var{tokens:c}=e.gullet.consumeArg();return o&&c.unshift(o),(t==="\\edef"||t==="\\xdef")&&(c=e.gullet.expandTokens(c),c.reverse()),e.gullet.macros.set(n,{tokens:c,numArgs:s,delimiters:h},t===gt[t]),{type:"internal",mode:e.mode}}});B({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,a=Vr(e.gullet.popToken());e.gullet.consumeSpaces();var n=O1(e);return Ur(e,a,n,t==="\\\\globallet"),{type:"internal",mode:e.mode}}});B({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,a=Vr(e.gullet.popToken()),n=e.gullet.popToken(),s=e.gullet.popToken();return Ur(e,a,s,t==="\\\\globalfuture"),e.gullet.pushToken(s),e.gullet.pushToken(n),{type:"internal",mode:e.mode}}});var oe=function(e,t,a){var n=X.math[e]&&X.math[e].replace,s=St(n||e,t,a);if(!s)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return s},Dt=function(e,t,a,n){var s=a.havingBaseStyle(t),o=y.makeSpan(n.concat(s.sizingClasses(a)),[e],a),h=s.sizeMultiplier/a.sizeMultiplier;return o.height*=h,o.depth*=h,o.maxFontSize=s.sizeMultiplier,o},$r=function(e,t,a){var n=t.havingBaseStyle(a),s=(1-t.sizeMultiplier/n.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=A(s),e.height-=s,e.depth+=s},H1=function(e,t,a,n,s,o){var h=y.makeSymbol(e,"Main-Regular",s,n),c=Dt(h,t,n,o);return a&&$r(c,n,t),c},F1=function(e,t,a,n){return y.makeSymbol(e,"Size"+t+"-Regular",a,n)},Yr=function(e,t,a,n,s,o){var h=F1(e,t,s,n),c=Dt(y.makeSpan(["delimsizing","size"+t],[h],n),R.TEXT,n,o);return a&&$r(c,n,R.TEXT),c},tt=function(e,t,a){var n;t==="Size1-Regular"?n="delim-size1":n="delim-size4";var s=y.makeSpan(["delimsizinginner",n],[y.makeSpan([],[y.makeSymbol(e,t,a)])]);return{type:"elem",elem:s}},rt=function(e,t,a){var n=k0["Size4-Regular"][e.charCodeAt(0)]?k0["Size4-Regular"][e.charCodeAt(0)][4]:k0["Size1-Regular"][e.charCodeAt(0)][4],s=new S0("inner",Xa(e,Math.round(1e3*t))),o=new y0([s],{width:A(n),height:A(t),style:"width:"+A(n),viewBox:"0 0 "+1e3*n+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),h=y.makeSvgSpan([],[o],a);return h.height=t,h.style.height=A(t),h.style.width=A(n),{type:"elem",elem:h}},bt=.008,De={type:"kern",size:-1*bt},L1=["|","\\lvert","\\rvert","\\vert"],P1=["\\|","\\lVert","\\rVert","\\Vert"],Xr=function(e,t,a,n,s,o){var h,c,p,g,b="",w=0;h=p=g=e,c=null;var x="Size1-Regular";e==="\\uparrow"?p=g="\u23D0":e==="\\Uparrow"?p=g="\u2016":e==="\\downarrow"?h=p="\u23D0":e==="\\Downarrow"?h=p="\u2016":e==="\\updownarrow"?(h="\\uparrow",p="\u23D0",g="\\downarrow"):e==="\\Updownarrow"?(h="\\Uparrow",p="\u2016",g="\\Downarrow"):N.contains(L1,e)?(p="\u2223",b="vert",w=333):N.contains(P1,e)?(p="\u2225",b="doublevert",w=556):e==="["||e==="\\lbrack"?(h="\u23A1",p="\u23A2",g="\u23A3",x="Size4-Regular",b="lbrack",w=667):e==="]"||e==="\\rbrack"?(h="\u23A4",p="\u23A5",g="\u23A6",x="Size4-Regular",b="rbrack",w=667):e==="\\lfloor"||e==="\u230A"?(p=h="\u23A2",g="\u23A3",x="Size4-Regular",b="lfloor",w=667):e==="\\lceil"||e==="\u2308"?(h="\u23A1",p=g="\u23A2",x="Size4-Regular",b="lceil",w=667):e==="\\rfloor"||e==="\u230B"?(p=h="\u23A5",g="\u23A6",x="Size4-Regular",b="rfloor",w=667):e==="\\rceil"||e==="\u2309"?(h="\u23A4",p=g="\u23A5",x="Size4-Regular",b="rceil",w=667):e==="("||e==="\\lparen"?(h="\u239B",p="\u239C",g="\u239D",x="Size4-Regular",b="lparen",w=875):e===")"||e==="\\rparen"?(h="\u239E",p="\u239F",g="\u23A0",x="Size4-Regular",b="rparen",w=875):e==="\\{"||e==="\\lbrace"?(h="\u23A7",c="\u23A8",g="\u23A9",p="\u23AA",x="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(h="\u23AB",c="\u23AC",g="\u23AD",p="\u23AA",x="Size4-Regular"):e==="\\lgroup"||e==="\u27EE"?(h="\u23A7",g="\u23A9",p="\u23AA",x="Size4-Regular"):e==="\\rgroup"||e==="\u27EF"?(h="\u23AB",g="\u23AD",p="\u23AA",x="Size4-Regular"):e==="\\lmoustache"||e==="\u23B0"?(h="\u23A7",g="\u23AD",p="\u23AA",x="Size4-Regular"):(e==="\\rmoustache"||e==="\u23B1")&&(h="\u23AB",g="\u23A9",p="\u23AA",x="Size4-Regular");var z=oe(h,x,s),T=z.height+z.depth,C=oe(p,x,s),q=C.height+C.depth,O=oe(g,x,s),H=O.height+O.depth,V=0,L=1;if(c!==null){var U=oe(c,x,s);V=U.height+U.depth,L=2}var G=T+H+V,j=Math.max(0,Math.ceil((t-G)/(L*q))),$=G+j*L*q,T0=n.fontMetrics().axisHeight;a&&(T0*=n.sizeMultiplier);var a0=$/2-T0,e0=[];if(b.length>0){var U0=$-T-H,s0=Math.round($*1e3),g0=Wa(b,Math.round(U0*1e3)),I0=new S0(b,g0),Z0=(w/1e3).toFixed(3)+"em",K0=(s0/1e3).toFixed(3)+"em",We=new y0([I0],{width:Z0,height:K0,viewBox:"0 0 "+w+" "+s0}),O0=y.makeSvgSpan([],[We],n);O0.height=s0/1e3,O0.style.width=Z0,O0.style.height=K0,e0.push({type:"elem",elem:O0})}else{if(e0.push(tt(g,x,s)),e0.push(De),c===null){var H0=$-T-H+2*bt;e0.push(rt(p,H0,n))}else{var d0=($-T-H-V)/2+2*bt;e0.push(rt(p,d0,n)),e0.push(De),e0.push(tt(c,x,s)),e0.push(De),e0.push(rt(p,d0,n))}e0.push(De),e0.push(tt(h,x,s))}var ie=n.havingBaseStyle(R.TEXT),je=y.makeVList({positionType:"bottom",positionData:a0,children:e0},ie);return Dt(y.makeSpan(["delimsizing","mult"],[je],ie),R.TEXT,n,o)},at=80,nt=.08,it=function(e,t,a,n,s){var o=Ya(e,n,a),h=new S0(e,o),c=new y0([h],{width:"400em",height:A(t),viewBox:"0 0 400000 "+a,preserveAspectRatio:"xMinYMin slice"});return y.makeSvgSpan(["hide-tail"],[c],s)},G1=function(e,t){var a=t.havingBaseSizing(),n=Kr("\\surd",e*a.sizeMultiplier,Zr,a),s=a.sizeMultiplier,o=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),h,c=0,p=0,g=0,b;return n.type==="small"?(g=1e3+1e3*o+at,e<1?s=1:e<1.4&&(s=.7),c=(1+o+nt)/s,p=(1+o)/s,h=it("sqrtMain",c,g,o,t),h.style.minWidth="0.853em",b=.833/s):n.type==="large"?(g=(1e3+at)*ue[n.size],p=(ue[n.size]+o)/s,c=(ue[n.size]+o+nt)/s,h=it("sqrtSize"+n.size,c,g,o,t),h.style.minWidth="1.02em",b=1/s):(c=e+o+nt,p=e+o,g=Math.floor(1e3*e+o)+at,h=it("sqrtTall",c,g,o,t),h.style.minWidth="0.742em",b=1.056),h.height=p,h.style.height=A(c),{span:h,advanceWidth:b,ruleWidth:(t.fontMetrics().sqrtRuleThickness+o)*s}},Wr=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230A","\u230B","\\lceil","\\rceil","\u2308","\u2309","\\surd"],V1=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27EE","\u27EF","\\lmoustache","\\rmoustache","\u23B0","\u23B1"],jr=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],ue=[0,1.2,1.8,2.4,3],U1=function(e,t,a,n,s){if(e==="<"||e==="\\lt"||e==="\u27E8"?e="\\langle":(e===">"||e==="\\gt"||e==="\u27E9")&&(e="\\rangle"),N.contains(Wr,e)||N.contains(jr,e))return Yr(e,t,!1,a,n,s);if(N.contains(V1,e))return Xr(e,ue[t],!1,a,n,s);throw new M("Illegal delimiter: '"+e+"'")},$1=[{type:"small",style:R.SCRIPTSCRIPT},{type:"small",style:R.SCRIPT},{type:"small",style:R.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Y1=[{type:"small",style:R.SCRIPTSCRIPT},{type:"small",style:R.SCRIPT},{type:"small",style:R.TEXT},{type:"stack"}],Zr=[{type:"small",style:R.SCRIPTSCRIPT},{type:"small",style:R.SCRIPT},{type:"small",style:R.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],X1=function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},Kr=function(e,t,a,n){for(var s=Math.min(2,3-n.style.size),o=s;ot)return a[o]}return a[a.length-1]},Jr=function(e,t,a,n,s,o){e==="<"||e==="\\lt"||e==="\u27E8"?e="\\langle":(e===">"||e==="\\gt"||e==="\u27E9")&&(e="\\rangle");var h;N.contains(jr,e)?h=$1:N.contains(Wr,e)?h=Zr:h=Y1;var c=Kr(e,t,h,n);return c.type==="small"?H1(e,c.style,a,n,s,o):c.type==="large"?Yr(e,c.size,a,n,s,o):Xr(e,t,a,n,s,o)},W1=function(e,t,a,n,s,o){var h=n.fontMetrics().axisHeight*n.sizeMultiplier,c=901,p=5/n.fontMetrics().ptPerEm,g=Math.max(t-h,a+h),b=Math.max(g/500*c,2*g-p);return Jr(e,b,!0,n,s,o)},q0={sqrtImage:G1,sizedDelim:U1,sizeToMaxHeight:ue,customSizedDelim:Jr,leftRightDelim:W1},rr={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},j1=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230A","\u230B","\\lceil","\\rceil","\u2308","\u2309","<",">","\\langle","\u27E8","\\rangle","\u27E9","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27EE","\u27EF","\\lmoustache","\\rmoustache","\u23B0","\u23B1","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function Ye(r,e){var t=Ue(r);if(t&&N.contains(j1,t.text))return t;throw t?new M("Invalid delimiter '"+t.text+"' after '"+e.funcName+"'",r):new M("Invalid delimiter type '"+r.type+"'",r)}B({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(r,e)=>{var t=Ye(e[0],r);return{type:"delimsizing",mode:r.parser.mode,size:rr[r.funcName].size,mclass:rr[r.funcName].mclass,delim:t.text}},htmlBuilder:(r,e)=>r.delim==="."?y.makeSpan([r.mclass]):q0.sizedDelim(r.delim,r.size,e,r.mode,[r.mclass]),mathmlBuilder:r=>{var e=[];r.delim!=="."&&e.push(v0(r.delim,r.mode));var t=new S.MathNode("mo",e);r.mclass==="mopen"||r.mclass==="mclose"?t.setAttribute("fence","true"):t.setAttribute("fence","false"),t.setAttribute("stretchy","true");var a=A(q0.sizeToMaxHeight[r.size]);return t.setAttribute("minsize",a),t.setAttribute("maxsize",a),t}});function ar(r){if(!r.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}B({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=r.parser.gullet.macros.get("\\current@color");if(t&&typeof t!="string")throw new M("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:r.parser.mode,delim:Ye(e[0],r).text,color:t}}});B({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=Ye(e[0],r),a=r.parser;++a.leftrightDepth;var n=a.parseExpression(!1);--a.leftrightDepth,a.expect("\\right",!1);var s=F(a.parseFunction(),"leftright-right");return{type:"leftright",mode:a.mode,body:n,left:t.text,right:s.delim,rightColor:s.color}},htmlBuilder:(r,e)=>{ar(r);for(var t=t0(r.body,e,!0,["mopen","mclose"]),a=0,n=0,s=!1,o=0;o{ar(r);var t=h0(r.body,e);if(r.left!=="."){var a=new S.MathNode("mo",[v0(r.left,r.mode)]);a.setAttribute("fence","true"),t.unshift(a)}if(r.right!=="."){var n=new S.MathNode("mo",[v0(r.right,r.mode)]);n.setAttribute("fence","true"),r.rightColor&&n.setAttribute("mathcolor",r.rightColor),t.push(n)}return zt(t)}});B({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=Ye(e[0],r);if(!r.parser.leftrightDepth)throw new M("\\middle without preceding \\left",t);return{type:"middle",mode:r.parser.mode,delim:t.text}},htmlBuilder:(r,e)=>{var t;if(r.delim===".")t=fe(e,[]);else{t=q0.sizedDelim(r.delim,1,e,r.mode,[]);var a={delim:r.delim,options:e};t.isMiddle=a}return t},mathmlBuilder:(r,e)=>{var t=r.delim==="\\vert"||r.delim==="|"?v0("|","text"):v0(r.delim,r.mode),a=new S.MathNode("mo",[t]);return a.setAttribute("fence","true"),a.setAttribute("lspace","0.05em"),a.setAttribute("rspace","0.05em"),a}});var Ct=(r,e)=>{var t=y.wrapFragment(P(r.body,e),e),a=r.label.slice(1),n=e.sizeMultiplier,s,o=0,h=N.isCharacterBox(r.body);if(a==="sout")s=y.makeSpan(["stretchy","sout"]),s.height=e.fontMetrics().defaultRuleThickness/n,o=-.5*e.fontMetrics().xHeight;else if(a==="phase"){var c=J({number:.6,unit:"pt"},e),p=J({number:.35,unit:"ex"},e),g=e.havingBaseSizing();n=n/g.sizeMultiplier;var b=t.height+t.depth+c+p;t.style.paddingLeft=A(b/2+c);var w=Math.floor(1e3*b*n),x=Ua(w),z=new y0([new S0("phase",x)],{width:"400em",height:A(w/1e3),viewBox:"0 0 400000 "+w,preserveAspectRatio:"xMinYMin slice"});s=y.makeSvgSpan(["hide-tail"],[z],e),s.style.height=A(b),o=t.depth+c+p}else{/cancel/.test(a)?h||t.classes.push("cancel-pad"):a==="angl"?t.classes.push("anglpad"):t.classes.push("boxpad");var T=0,C=0,q=0;/box/.test(a)?(q=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),T=e.fontMetrics().fboxsep+(a==="colorbox"?0:q),C=T):a==="angl"?(q=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),T=4*q,C=Math.max(0,.25-t.depth)):(T=h?.2:0,C=T),s=E0.encloseSpan(t,a,T,C,e),/fbox|boxed|fcolorbox/.test(a)?(s.style.borderStyle="solid",s.style.borderWidth=A(q)):a==="angl"&&q!==.049&&(s.style.borderTopWidth=A(q),s.style.borderRightWidth=A(q)),o=t.depth+C,r.backgroundColor&&(s.style.backgroundColor=r.backgroundColor,r.borderColor&&(s.style.borderColor=r.borderColor))}var O;if(r.backgroundColor)O=y.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:o},{type:"elem",elem:t,shift:0}]},e);else{var H=/cancel|phase/.test(a)?["svg-align"]:[];O=y.makeVList({positionType:"individualShift",children:[{type:"elem",elem:t,shift:0},{type:"elem",elem:s,shift:o,wrapperClasses:H}]},e)}return/cancel/.test(a)&&(O.height=t.height,O.depth=t.depth),/cancel/.test(a)&&!h?y.makeSpan(["mord","cancel-lap"],[O],e):y.makeSpan(["mord"],[O],e)},qt=(r,e)=>{var t=0,a=new S.MathNode(r.label.indexOf("colorbox")>-1?"mpadded":"menclose",[Y(r.body,e)]);switch(r.label){case"\\cancel":a.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":a.setAttribute("notation","downdiagonalstrike");break;case"\\phase":a.setAttribute("notation","phasorangle");break;case"\\sout":a.setAttribute("notation","horizontalstrike");break;case"\\fbox":a.setAttribute("notation","box");break;case"\\angl":a.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(t=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,a.setAttribute("width","+"+2*t+"pt"),a.setAttribute("height","+"+2*t+"pt"),a.setAttribute("lspace",t+"pt"),a.setAttribute("voffset",t+"pt"),r.label==="\\fcolorbox"){var n=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);a.setAttribute("style","border: "+n+"em solid "+String(r.borderColor))}break;case"\\xcancel":a.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return r.backgroundColor&&a.setAttribute("mathbackground",r.backgroundColor),a};B({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(r,e,t){var{parser:a,funcName:n}=r,s=F(e[0],"color-token").color,o=e[1];return{type:"enclose",mode:a.mode,label:n,backgroundColor:s,body:o}},htmlBuilder:Ct,mathmlBuilder:qt});B({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(r,e,t){var{parser:a,funcName:n}=r,s=F(e[0],"color-token").color,o=F(e[1],"color-token").color,h=e[2];return{type:"enclose",mode:a.mode,label:n,backgroundColor:o,borderColor:s,body:h}},htmlBuilder:Ct,mathmlBuilder:qt});B({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"enclose",mode:t.mode,label:"\\fbox",body:e[0]}}});B({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:a}=r,n=e[0];return{type:"enclose",mode:t.mode,label:a,body:n}},htmlBuilder:Ct,mathmlBuilder:qt});B({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(r,e){var{parser:t}=r;return{type:"enclose",mode:t.mode,label:"\\angl",body:e[0]}}});var Qr={};function M0(r){for(var{type:e,names:t,props:a,handler:n,htmlBuilder:s,mathmlBuilder:o}=r,h={type:e,numArgs:a.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:n},c=0;c{var e=r.parser.settings;if(!e.displayMode)throw new M("{"+r.envName+"} can be used only in display mode.")};function Nt(r){if(r.indexOf("ed")===-1)return r.indexOf("*")===-1}function V0(r,e,t){var{hskipBeforeAndAfter:a,addJot:n,cols:s,arraystretch:o,colSeparationType:h,autoTag:c,singleRow:p,emptySingleRow:g,maxNumCols:b,leqno:w}=e;if(r.gullet.beginGroup(),p||r.gullet.macros.set("\\cr","\\\\\\relax"),!o){var x=r.gullet.expandMacroAsText("\\arraystretch");if(x==null)o=1;else if(o=parseFloat(x),!o||o<0)throw new M("Invalid \\arraystretch: "+x)}r.gullet.beginGroup();var z=[],T=[z],C=[],q=[],O=c!=null?[]:void 0;function H(){c&&r.gullet.macros.set("\\@eqnsw","1",!0)}function V(){O&&(r.gullet.macros.get("\\df@tag")?(O.push(r.subparse([new p0("\\df@tag")])),r.gullet.macros.set("\\df@tag",void 0,!0)):O.push(!!c&&r.gullet.macros.get("\\@eqnsw")==="1"))}for(H(),q.push(nr(r));;){var L=r.parseExpression(!1,p?"\\end":"\\\\");r.gullet.endGroup(),r.gullet.beginGroup(),L={type:"ordgroup",mode:r.mode,body:L},t&&(L={type:"styling",mode:r.mode,style:t,body:[L]}),z.push(L);var U=r.fetch().text;if(U==="&"){if(b&&z.length===b){if(p||h)throw new M("Too many tab characters: &",r.nextToken);r.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}r.consume()}else if(U==="\\end"){V(),z.length===1&&L.type==="styling"&&L.body[0].body.length===0&&(T.length>1||!g)&&T.pop(),q.length0&&(H+=.25),p.push({pos:H,isDashed:be[ye]})}for(V(o[0]),a=0;a0&&(a0+=O,Gbe))for(a=0;a=h)){var Q0=void 0;(n>0||e.hskipBeforeAndAfter)&&(Q0=N.deflt(d0.pregap,w),Q0!==0&&(g0=y.makeSpan(["arraycolsep"],[]),g0.style.width=A(Q0),s0.push(g0)));var _0=[];for(a=0;a0){for(var ba=y.makeLineSpan("hline",t,g),ya=y.makeLineSpan("hdashline",t,g),Ze=[{type:"elem",elem:c,shift:0}];p.length>0;){var Gt=p.pop(),Vt=Gt.pos-e0;Gt.isDashed?Ze.push({type:"elem",elem:ya,shift:Vt}):Ze.push({type:"elem",elem:ba,shift:Vt})}c=y.makeVList({positionType:"individualShift",children:Ze},t)}if(Z0.length===0)return y.makeSpan(["mord"],[c],t);var Ke=y.makeVList({positionType:"individualShift",children:Z0},t);return Ke=y.makeSpan(["tag"],[Ke],t),y.makeFragment([c,Ke])},Z1={c:"center ",l:"left ",r:"right "},A0=function(e,t){for(var a=[],n=new S.MathNode("mtd",[],["mtr-glue"]),s=new S.MathNode("mtd",[],["mml-eqn-num"]),o=0;o0){var z=e.cols,T="",C=!1,q=0,O=z.length;z[0].type==="separator"&&(w+="top ",q=1),z[z.length-1].type==="separator"&&(w+="bottom ",O-=1);for(var H=q;H0?"left ":"",w+=j[j.length-1].length>0?"right ":"";for(var $=1;$-1?"alignat":"align",s=e.envName==="split",o=V0(e.parser,{cols:a,addJot:!0,autoTag:s?void 0:Nt(e.envName),emptySingleRow:!0,colSeparationType:n,maxNumCols:s?2:void 0,leqno:e.parser.settings.leqno},"display"),h,c=0,p={type:"ordgroup",mode:e.mode,body:[]};if(t[0]&&t[0].type==="ordgroup"){for(var g="",b=0;b0&&x&&(C=1),a[z]={type:"align",align:T,pregap:C,postgap:0}}return o.colSeparationType=x?"align":"alignat",o};M0({type:"array",names:["array","darray"],props:{numArgs:1},handler(r,e){var t=Ue(e[0]),a=t?[e[0]]:F(e[0],"ordgroup").body,n=a.map(function(o){var h=Tt(o),c=h.text;if("lcr".indexOf(c)!==-1)return{type:"align",align:c};if(c==="|")return{type:"separator",separator:"|"};if(c===":")return{type:"separator",separator:":"};throw new M("Unknown column alignment: "+c,o)}),s={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return V0(r.parser,s,Et(r.envName))},htmlBuilder:z0,mathmlBuilder:A0});M0({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(r){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[r.envName.replace("*","")],t="c",a={hskipBeforeAndAfter:!1,cols:[{type:"align",align:t}]};if(r.envName.charAt(r.envName.length-1)==="*"){var n=r.parser;if(n.consumeSpaces(),n.fetch().text==="["){if(n.consume(),n.consumeSpaces(),t=n.fetch().text,"lcr".indexOf(t)===-1)throw new M("Expected l or c or r",n.nextToken);n.consume(),n.consumeSpaces(),n.expect("]"),n.consume(),a.cols=[{type:"align",align:t}]}}var s=V0(r.parser,a,Et(r.envName)),o=Math.max(0,...s.body.map(h=>h.length));return s.cols=new Array(o).fill({type:"align",align:t}),e?{type:"leftright",mode:r.mode,body:[s],left:e[0],right:e[1],rightColor:void 0}:s},htmlBuilder:z0,mathmlBuilder:A0});M0({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(r){var e={arraystretch:.5},t=V0(r.parser,e,"script");return t.colSeparationType="small",t},htmlBuilder:z0,mathmlBuilder:A0});M0({type:"array",names:["subarray"],props:{numArgs:1},handler(r,e){var t=Ue(e[0]),a=t?[e[0]]:F(e[0],"ordgroup").body,n=a.map(function(o){var h=Tt(o),c=h.text;if("lc".indexOf(c)!==-1)return{type:"align",align:c};throw new M("Unknown column alignment: "+c,o)});if(n.length>1)throw new M("{subarray} can contain only one column");var s={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5};if(s=V0(r.parser,s,"script"),s.body.length>0&&s.body[0].length>1)throw new M("{subarray} can contain only one column");return s},htmlBuilder:z0,mathmlBuilder:A0});M0({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(r){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},t=V0(r.parser,e,Et(r.envName));return{type:"leftright",mode:r.mode,body:[t],left:r.envName.indexOf("r")>-1?".":"\\{",right:r.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:z0,mathmlBuilder:A0});M0({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:ea,htmlBuilder:z0,mathmlBuilder:A0});M0({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(r){N.contains(["gather","gather*"],r.envName)&&Xe(r);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Nt(r.envName),emptySingleRow:!0,leqno:r.parser.settings.leqno};return V0(r.parser,e,"display")},htmlBuilder:z0,mathmlBuilder:A0});M0({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:ea,htmlBuilder:z0,mathmlBuilder:A0});M0({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(r){Xe(r);var e={autoTag:Nt(r.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:r.parser.settings.leqno};return V0(r.parser,e,"display")},htmlBuilder:z0,mathmlBuilder:A0});M0({type:"array",names:["CD"],props:{numArgs:0},handler(r){return Xe(r),I1(r.parser)},htmlBuilder:z0,mathmlBuilder:A0});m("\\nonumber","\\gdef\\@eqnsw{0}");m("\\notag","\\nonumber");B({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(r,e){throw new M(r.funcName+" valid only within array environment")}});var ir=Qr;B({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(r,e){var{parser:t,funcName:a}=r,n=e[0];if(n.type!=="ordgroup")throw new M("Invalid environment name",n);for(var s="",o=0;o{var t=r.font,a=e.withFont(t);return P(r.body,a)},ra=(r,e)=>{var t=r.font,a=e.withFont(t);return Y(r.body,a)},sr={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};B({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(r,e)=>{var{parser:t,funcName:a}=r,n=Fe(e[0]),s=a;return s in sr&&(s=sr[s]),{type:"font",mode:t.mode,font:s.slice(1),body:n}},htmlBuilder:ta,mathmlBuilder:ra});B({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(r,e)=>{var{parser:t}=r,a=e[0],n=N.isCharacterBox(a);return{type:"mclass",mode:t.mode,mclass:$e(a),body:[{type:"font",mode:t.mode,font:"boldsymbol",body:a}],isCharacterBox:n}}});B({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(r,e)=>{var{parser:t,funcName:a,breakOnTokenText:n}=r,{mode:s}=t,o=t.parseExpression(!0,n),h="math"+a.slice(1);return{type:"font",mode:s,font:h,body:{type:"ordgroup",mode:t.mode,body:o}}},htmlBuilder:ta,mathmlBuilder:ra});var aa=(r,e)=>{var t=e;return r==="display"?t=t.id>=R.SCRIPT.id?t.text():R.DISPLAY:r==="text"&&t.size===R.DISPLAY.size?t=R.TEXT:r==="script"?t=R.SCRIPT:r==="scriptscript"&&(t=R.SCRIPTSCRIPT),t},Rt=(r,e)=>{var t=aa(r.size,e.style),a=t.fracNum(),n=t.fracDen(),s;s=e.havingStyle(a);var o=P(r.numer,s,e);if(r.continued){var h=8.5/e.fontMetrics().ptPerEm,c=3.5/e.fontMetrics().ptPerEm;o.height=o.height0?z=3*w:z=7*w,T=e.fontMetrics().denom1):(b>0?(x=e.fontMetrics().num2,z=w):(x=e.fontMetrics().num3,z=3*w),T=e.fontMetrics().denom2);var C;if(g){var O=e.fontMetrics().axisHeight;x-o.depth-(O+.5*b){var t=new S.MathNode("mfrac",[Y(r.numer,e),Y(r.denom,e)]);if(!r.hasBarLine)t.setAttribute("linethickness","0px");else if(r.barSize){var a=J(r.barSize,e);t.setAttribute("linethickness",A(a))}var n=aa(r.size,e.style);if(n.size!==e.style.size){t=new S.MathNode("mstyle",[t]);var s=n.size===R.DISPLAY.size?"true":"false";t.setAttribute("displaystyle",s),t.setAttribute("scriptlevel","0")}if(r.leftDelim!=null||r.rightDelim!=null){var o=[];if(r.leftDelim!=null){var h=new S.MathNode("mo",[new S.TextNode(r.leftDelim.replace("\\",""))]);h.setAttribute("fence","true"),o.push(h)}if(o.push(t),r.rightDelim!=null){var c=new S.MathNode("mo",[new S.TextNode(r.rightDelim.replace("\\",""))]);c.setAttribute("fence","true"),o.push(c)}return zt(o)}return t};B({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(r,e)=>{var{parser:t,funcName:a}=r,n=e[0],s=e[1],o,h=null,c=null,p="auto";switch(a){case"\\dfrac":case"\\frac":case"\\tfrac":o=!0;break;case"\\\\atopfrac":o=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":o=!1,h="(",c=")";break;case"\\\\bracefrac":o=!1,h="\\{",c="\\}";break;case"\\\\brackfrac":o=!1,h="[",c="]";break;default:throw new Error("Unrecognized genfrac command")}switch(a){case"\\dfrac":case"\\dbinom":p="display";break;case"\\tfrac":case"\\tbinom":p="text";break}return{type:"genfrac",mode:t.mode,continued:!1,numer:n,denom:s,hasBarLine:o,leftDelim:h,rightDelim:c,size:p,barSize:null}},htmlBuilder:Rt,mathmlBuilder:It});B({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(r,e)=>{var{parser:t,funcName:a}=r,n=e[0],s=e[1];return{type:"genfrac",mode:t.mode,continued:!0,numer:n,denom:s,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}});B({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(r){var{parser:e,funcName:t,token:a}=r,n;switch(t){case"\\over":n="\\frac";break;case"\\choose":n="\\binom";break;case"\\atop":n="\\\\atopfrac";break;case"\\brace":n="\\\\bracefrac";break;case"\\brack":n="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:n,token:a}}});var lr=["display","text","script","scriptscript"],or=function(e){var t=null;return e.length>0&&(t=e,t=t==="."?null:t),t};B({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(r,e){var{parser:t}=r,a=e[4],n=e[5],s=Fe(e[0]),o=s.type==="atom"&&s.family==="open"?or(s.text):null,h=Fe(e[1]),c=h.type==="atom"&&h.family==="close"?or(h.text):null,p=F(e[2],"size"),g,b=null;p.isBlank?g=!0:(b=p.value,g=b.number>0);var w="auto",x=e[3];if(x.type==="ordgroup"){if(x.body.length>0){var z=F(x.body[0],"textord");w=lr[Number(z.text)]}}else x=F(x,"textord"),w=lr[Number(x.text)];return{type:"genfrac",mode:t.mode,numer:a,denom:n,continued:!1,hasBarLine:g,barSize:b,leftDelim:o,rightDelim:c,size:w}},htmlBuilder:Rt,mathmlBuilder:It});B({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(r,e){var{parser:t,funcName:a,token:n}=r;return{type:"infix",mode:t.mode,replaceWith:"\\\\abovefrac",size:F(e[0],"size").value,token:n}}});B({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(r,e)=>{var{parser:t,funcName:a}=r,n=e[0],s=Ba(F(e[1],"infix").size),o=e[2],h=s.number>0;return{type:"genfrac",mode:t.mode,numer:n,denom:o,continued:!1,hasBarLine:h,barSize:s,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:Rt,mathmlBuilder:It});var na=(r,e)=>{var t=e.style,a,n;r.type==="supsub"?(a=r.sup?P(r.sup,e.havingStyle(t.sup()),e):P(r.sub,e.havingStyle(t.sub()),e),n=F(r.base,"horizBrace")):n=F(r,"horizBrace");var s=P(n.base,e.havingBaseStyle(R.DISPLAY)),o=E0.svgSpan(n,e),h;if(n.isOver?(h=y.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:o}]},e),h.children[0].children[0].children[1].classes.push("svg-align")):(h=y.makeVList({positionType:"bottom",positionData:s.depth+.1+o.height,children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:s}]},e),h.children[0].children[0].children[0].classes.push("svg-align")),a){var c=y.makeSpan(["mord",n.isOver?"mover":"munder"],[h],e);n.isOver?h=y.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:c},{type:"kern",size:.2},{type:"elem",elem:a}]},e):h=y.makeVList({positionType:"bottom",positionData:c.depth+.2+a.height+a.depth,children:[{type:"elem",elem:a},{type:"kern",size:.2},{type:"elem",elem:c}]},e)}return y.makeSpan(["mord",n.isOver?"mover":"munder"],[h],e)},K1=(r,e)=>{var t=E0.mathMLnode(r.label);return new S.MathNode(r.isOver?"mover":"munder",[Y(r.base,e),t])};B({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:a}=r;return{type:"horizBrace",mode:t.mode,label:a,isOver:/^\\over/.test(a),base:e[0]}},htmlBuilder:na,mathmlBuilder:K1});B({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,a=e[1],n=F(e[0],"url").url;return t.settings.isTrusted({command:"\\href",url:n})?{type:"href",mode:t.mode,href:n,body:Q(a)}:t.formatUnsupportedCmd("\\href")},htmlBuilder:(r,e)=>{var t=t0(r.body,e,!1);return y.makeAnchor(r.href,[],t,e)},mathmlBuilder:(r,e)=>{var t=G0(r.body,e);return t instanceof o0||(t=new o0("mrow",[t])),t.setAttribute("href",r.href),t}});B({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,a=F(e[0],"url").url;if(!t.settings.isTrusted({command:"\\url",url:a}))return t.formatUnsupportedCmd("\\url");for(var n=[],s=0;s{var{parser:t,funcName:a,token:n}=r,s=F(e[0],"raw").string,o=e[1];t.settings.strict&&t.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var h,c={};switch(a){case"\\htmlClass":c.class=s,h={command:"\\htmlClass",class:s};break;case"\\htmlId":c.id=s,h={command:"\\htmlId",id:s};break;case"\\htmlStyle":c.style=s,h={command:"\\htmlStyle",style:s};break;case"\\htmlData":{for(var p=s.split(","),g=0;g{var t=t0(r.body,e,!1),a=["enclosing"];r.attributes.class&&a.push(...r.attributes.class.trim().split(/\s+/));var n=y.makeSpan(a,t,e);for(var s in r.attributes)s!=="class"&&r.attributes.hasOwnProperty(s)&&n.setAttribute(s,r.attributes[s]);return n},mathmlBuilder:(r,e)=>G0(r.body,e)});B({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r;return{type:"htmlmathml",mode:t.mode,html:Q(e[0]),mathml:Q(e[1])}},htmlBuilder:(r,e)=>{var t=t0(r.html,e,!1);return y.makeFragment(t)},mathmlBuilder:(r,e)=>G0(r.mathml,e)});var st=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new M("Invalid size: '"+e+"' in \\includegraphics");var a={number:+(t[1]+t[2]),unit:t[3]};if(!Sr(a))throw new M("Invalid unit: '"+a.unit+"' in \\includegraphics.");return a};B({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(r,e,t)=>{var{parser:a}=r,n={number:0,unit:"em"},s={number:.9,unit:"em"},o={number:0,unit:"em"},h="";if(t[0])for(var c=F(t[0],"raw").string,p=c.split(","),g=0;g{var t=J(r.height,e),a=0;r.totalheight.number>0&&(a=J(r.totalheight,e)-t);var n=0;r.width.number>0&&(n=J(r.width,e));var s={height:A(t+a)};n>0&&(s.width=A(n)),a>0&&(s.verticalAlign=A(-a));var o=new ct(r.src,r.alt,s);return o.height=t,o.depth=a,o},mathmlBuilder:(r,e)=>{var t=new S.MathNode("mglyph",[]);t.setAttribute("alt",r.alt);var a=J(r.height,e),n=0;if(r.totalheight.number>0&&(n=J(r.totalheight,e)-a,t.setAttribute("valign",A(-n))),t.setAttribute("height",A(a+n)),r.width.number>0){var s=J(r.width,e);t.setAttribute("width",A(s))}return t.setAttribute("src",r.src),t}});B({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(r,e){var{parser:t,funcName:a}=r,n=F(e[0],"size");if(t.settings.strict){var s=a[1]==="m",o=n.value.unit==="mu";s?(o||t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" supports only mu units, "+("not "+n.value.unit+" units")),t.mode!=="math"&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" works only in math mode")):o&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" doesn't support mu units")}return{type:"kern",mode:t.mode,dimension:n.value}},htmlBuilder(r,e){return y.makeGlue(r.dimension,e)},mathmlBuilder(r,e){var t=J(r.dimension,e);return new S.SpaceNode(t)}});B({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t,funcName:a}=r,n=e[0];return{type:"lap",mode:t.mode,alignment:a.slice(5),body:n}},htmlBuilder:(r,e)=>{var t;r.alignment==="clap"?(t=y.makeSpan([],[P(r.body,e)]),t=y.makeSpan(["inner"],[t],e)):t=y.makeSpan(["inner"],[P(r.body,e)]);var a=y.makeSpan(["fix"],[]),n=y.makeSpan([r.alignment],[t,a],e),s=y.makeSpan(["strut"]);return s.style.height=A(n.height+n.depth),n.depth&&(s.style.verticalAlign=A(-n.depth)),n.children.unshift(s),n=y.makeSpan(["thinbox"],[n],e),y.makeSpan(["mord","vbox"],[n],e)},mathmlBuilder:(r,e)=>{var t=new S.MathNode("mpadded",[Y(r.body,e)]);if(r.alignment!=="rlap"){var a=r.alignment==="llap"?"-1":"-0.5";t.setAttribute("lspace",a+"width")}return t.setAttribute("width","0px"),t}});B({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(r,e){var{funcName:t,parser:a}=r,n=a.mode;a.switchMode("math");var s=t==="\\("?"\\)":"$",o=a.parseExpression(!1,s);return a.expect(s),a.switchMode(n),{type:"styling",mode:a.mode,style:"text",body:o}}});B({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(r,e){throw new M("Mismatched "+r.funcName)}});var ur=(r,e)=>{switch(e.style.size){case R.DISPLAY.size:return r.display;case R.TEXT.size:return r.text;case R.SCRIPT.size:return r.script;case R.SCRIPTSCRIPT.size:return r.scriptscript;default:return r.text}};B({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(r,e)=>{var{parser:t}=r;return{type:"mathchoice",mode:t.mode,display:Q(e[0]),text:Q(e[1]),script:Q(e[2]),scriptscript:Q(e[3])}},htmlBuilder:(r,e)=>{var t=ur(r,e),a=t0(t,e,!1);return y.makeFragment(a)},mathmlBuilder:(r,e)=>{var t=ur(r,e);return G0(t,e)}});var ia=(r,e,t,a,n,s,o)=>{r=y.makeSpan([],[r]);var h=t&&N.isCharacterBox(t),c,p;if(e){var g=P(e,a.havingStyle(n.sup()),a);p={elem:g,kern:Math.max(a.fontMetrics().bigOpSpacing1,a.fontMetrics().bigOpSpacing3-g.depth)}}if(t){var b=P(t,a.havingStyle(n.sub()),a);c={elem:b,kern:Math.max(a.fontMetrics().bigOpSpacing2,a.fontMetrics().bigOpSpacing4-b.height)}}var w;if(p&&c){var x=a.fontMetrics().bigOpSpacing5+c.elem.height+c.elem.depth+c.kern+r.depth+o;w=y.makeVList({positionType:"bottom",positionData:x,children:[{type:"kern",size:a.fontMetrics().bigOpSpacing5},{type:"elem",elem:c.elem,marginLeft:A(-s)},{type:"kern",size:c.kern},{type:"elem",elem:r},{type:"kern",size:p.kern},{type:"elem",elem:p.elem,marginLeft:A(s)},{type:"kern",size:a.fontMetrics().bigOpSpacing5}]},a)}else if(c){var z=r.height-o;w=y.makeVList({positionType:"top",positionData:z,children:[{type:"kern",size:a.fontMetrics().bigOpSpacing5},{type:"elem",elem:c.elem,marginLeft:A(-s)},{type:"kern",size:c.kern},{type:"elem",elem:r}]},a)}else if(p){var T=r.depth+o;w=y.makeVList({positionType:"bottom",positionData:T,children:[{type:"elem",elem:r},{type:"kern",size:p.kern},{type:"elem",elem:p.elem,marginLeft:A(s)},{type:"kern",size:a.fontMetrics().bigOpSpacing5}]},a)}else return r;var C=[w];if(c&&s!==0&&!h){var q=y.makeSpan(["mspace"],[],a);q.style.marginRight=A(s),C.unshift(q)}return y.makeSpan(["mop","op-limits"],C,a)},sa=["\\smallint"],ne=(r,e)=>{var t,a,n=!1,s;r.type==="supsub"?(t=r.sup,a=r.sub,s=F(r.base,"op"),n=!0):s=F(r,"op");var o=e.style,h=!1;o.size===R.DISPLAY.size&&s.symbol&&!N.contains(sa,s.name)&&(h=!0);var c;if(s.symbol){var p=h?"Size2-Regular":"Size1-Regular",g="";if((s.name==="\\oiint"||s.name==="\\oiiint")&&(g=s.name.slice(1),s.name=g==="oiint"?"\\iint":"\\iiint"),c=y.makeSymbol(s.name,p,"math",e,["mop","op-symbol",h?"large-op":"small-op"]),g.length>0){var b=c.italic,w=y.staticSvg(g+"Size"+(h?"2":"1"),e);c=y.makeVList({positionType:"individualShift",children:[{type:"elem",elem:c,shift:0},{type:"elem",elem:w,shift:h?.08:0}]},e),s.name="\\"+g,c.classes.unshift("mop"),c.italic=b}}else if(s.body){var x=t0(s.body,e,!0);x.length===1&&x[0]instanceof u0?(c=x[0],c.classes[0]="mop"):c=y.makeSpan(["mop"],x,e)}else{for(var z=[],T=1;T{var t;if(r.symbol)t=new o0("mo",[v0(r.name,r.mode)]),N.contains(sa,r.name)&&t.setAttribute("largeop","false");else if(r.body)t=new o0("mo",h0(r.body,e));else{t=new o0("mi",[new Y0(r.name.slice(1))]);var a=new o0("mo",[v0("\u2061","text")]);r.parentIsSupSub?t=new o0("mrow",[t,a]):t=Rr([t,a])}return t},J1={"\u220F":"\\prod","\u2210":"\\coprod","\u2211":"\\sum","\u22C0":"\\bigwedge","\u22C1":"\\bigvee","\u22C2":"\\bigcap","\u22C3":"\\bigcup","\u2A00":"\\bigodot","\u2A01":"\\bigoplus","\u2A02":"\\bigotimes","\u2A04":"\\biguplus","\u2A06":"\\bigsqcup"};B({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\u220F","\u2210","\u2211","\u22C0","\u22C1","\u22C2","\u22C3","\u2A00","\u2A01","\u2A02","\u2A04","\u2A06"],props:{numArgs:0},handler:(r,e)=>{var{parser:t,funcName:a}=r,n=a;return n.length===1&&(n=J1[n]),{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:ne,mathmlBuilder:pe});B({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var{parser:t}=r,a=e[0];return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Q(a)}},htmlBuilder:ne,mathmlBuilder:pe});var Q1={"\u222B":"\\int","\u222C":"\\iint","\u222D":"\\iiint","\u222E":"\\oint","\u222F":"\\oiint","\u2230":"\\oiiint"};B({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(r){var{parser:e,funcName:t}=r;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:ne,mathmlBuilder:pe});B({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(r){var{parser:e,funcName:t}=r;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:ne,mathmlBuilder:pe});B({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\u222B","\u222C","\u222D","\u222E","\u222F","\u2230"],props:{numArgs:0},handler(r){var{parser:e,funcName:t}=r,a=t;return a.length===1&&(a=Q1[a]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:a}},htmlBuilder:ne,mathmlBuilder:pe});var la=(r,e)=>{var t,a,n=!1,s;r.type==="supsub"?(t=r.sup,a=r.sub,s=F(r.base,"operatorname"),n=!0):s=F(r,"operatorname");var o;if(s.body.length>0){for(var h=s.body.map(b=>{var w=b.text;return typeof w=="string"?{type:"textord",mode:b.mode,text:w}:b}),c=t0(h,e.withFont("mathrm"),!0),p=0;p{for(var t=h0(r.body,e.withFont("mathrm")),a=!0,n=0;ng.toText()).join("");t=[new S.TextNode(h)]}var c=new S.MathNode("mi",t);c.setAttribute("mathvariant","normal");var p=new S.MathNode("mo",[v0("\u2061","text")]);return r.parentIsSupSub?new S.MathNode("mrow",[c,p]):S.newDocumentFragment([c,p])};B({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(r,e)=>{var{parser:t,funcName:a}=r,n=e[0];return{type:"operatorname",mode:t.mode,body:Q(n),alwaysHandleSupSub:a==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:la,mathmlBuilder:_1});m("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");j0({type:"ordgroup",htmlBuilder(r,e){return r.semisimple?y.makeFragment(t0(r.body,e,!1)):y.makeSpan(["mord"],t0(r.body,e,!0),e)},mathmlBuilder(r,e){return G0(r.body,e,!0)}});B({type:"overline",names:["\\overline"],props:{numArgs:1},handler(r,e){var{parser:t}=r,a=e[0];return{type:"overline",mode:t.mode,body:a}},htmlBuilder(r,e){var t=P(r.body,e.havingCrampedStyle()),a=y.makeLineSpan("overline-line",e),n=e.fontMetrics().defaultRuleThickness,s=y.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:t},{type:"kern",size:3*n},{type:"elem",elem:a},{type:"kern",size:n}]},e);return y.makeSpan(["mord","overline"],[s],e)},mathmlBuilder(r,e){var t=new S.MathNode("mo",[new S.TextNode("\u203E")]);t.setAttribute("stretchy","true");var a=new S.MathNode("mover",[Y(r.body,e),t]);return a.setAttribute("accent","true"),a}});B({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,a=e[0];return{type:"phantom",mode:t.mode,body:Q(a)}},htmlBuilder:(r,e)=>{var t=t0(r.body,e.withPhantom(),!1);return y.makeFragment(t)},mathmlBuilder:(r,e)=>{var t=h0(r.body,e);return new S.MathNode("mphantom",t)}});B({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,a=e[0];return{type:"hphantom",mode:t.mode,body:a}},htmlBuilder:(r,e)=>{var t=y.makeSpan([],[P(r.body,e.withPhantom())]);if(t.height=0,t.depth=0,t.children)for(var a=0;a{var t=h0(Q(r.body),e),a=new S.MathNode("mphantom",t),n=new S.MathNode("mpadded",[a]);return n.setAttribute("height","0px"),n.setAttribute("depth","0px"),n}});B({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,a=e[0];return{type:"vphantom",mode:t.mode,body:a}},htmlBuilder:(r,e)=>{var t=y.makeSpan(["inner"],[P(r.body,e.withPhantom())]),a=y.makeSpan(["fix"],[]);return y.makeSpan(["mord","rlap"],[t,a],e)},mathmlBuilder:(r,e)=>{var t=h0(Q(r.body),e),a=new S.MathNode("mphantom",t),n=new S.MathNode("mpadded",[a]);return n.setAttribute("width","0px"),n}});B({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(r,e){var{parser:t}=r,a=F(e[0],"size").value,n=e[1];return{type:"raisebox",mode:t.mode,dy:a,body:n}},htmlBuilder(r,e){var t=P(r.body,e),a=J(r.dy,e);return y.makeVList({positionType:"shift",positionData:-a,children:[{type:"elem",elem:t}]},e)},mathmlBuilder(r,e){var t=new S.MathNode("mpadded",[Y(r.body,e)]),a=r.dy.number+r.dy.unit;return t.setAttribute("voffset",a),t}});B({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0},handler(r){var{parser:e}=r;return{type:"internal",mode:e.mode}}});B({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,argTypes:["size","size","size"]},handler(r,e,t){var{parser:a}=r,n=t[0],s=F(e[0],"size"),o=F(e[1],"size");return{type:"rule",mode:a.mode,shift:n&&F(n,"size").value,width:s.value,height:o.value}},htmlBuilder(r,e){var t=y.makeSpan(["mord","rule"],[],e),a=J(r.width,e),n=J(r.height,e),s=r.shift?J(r.shift,e):0;return t.style.borderRightWidth=A(a),t.style.borderTopWidth=A(n),t.style.bottom=A(s),t.width=a,t.height=n+s,t.depth=-s,t.maxFontSize=n*1.125*e.sizeMultiplier,t},mathmlBuilder(r,e){var t=J(r.width,e),a=J(r.height,e),n=r.shift?J(r.shift,e):0,s=e.color&&e.getColor()||"black",o=new S.MathNode("mspace");o.setAttribute("mathbackground",s),o.setAttribute("width",A(t)),o.setAttribute("height",A(a));var h=new S.MathNode("mpadded",[o]);return n>=0?h.setAttribute("height",A(n)):(h.setAttribute("height",A(n)),h.setAttribute("depth",A(-n))),h.setAttribute("voffset",A(n)),h}});function oa(r,e,t){for(var a=t0(r,e,!1),n=e.sizeMultiplier/t.sizeMultiplier,s=0;s{var t=e.havingSize(r.size);return oa(r.body,t,e)};B({type:"sizing",names:hr,props:{numArgs:0,allowedInText:!0},handler:(r,e)=>{var{breakOnTokenText:t,funcName:a,parser:n}=r,s=n.parseExpression(!1,t);return{type:"sizing",mode:n.mode,size:hr.indexOf(a)+1,body:s}},htmlBuilder:e4,mathmlBuilder:(r,e)=>{var t=e.havingSize(r.size),a=h0(r.body,t),n=new S.MathNode("mstyle",a);return n.setAttribute("mathsize",A(t.sizeMultiplier)),n}});B({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(r,e,t)=>{var{parser:a}=r,n=!1,s=!1,o=t[0]&&F(t[0],"ordgroup");if(o)for(var h="",c=0;c{var t=y.makeSpan([],[P(r.body,e)]);if(!r.smashHeight&&!r.smashDepth)return t;if(r.smashHeight&&(t.height=0,t.children))for(var a=0;a{var t=new S.MathNode("mpadded",[Y(r.body,e)]);return r.smashHeight&&t.setAttribute("height","0px"),r.smashDepth&&t.setAttribute("depth","0px"),t}});B({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(r,e,t){var{parser:a}=r,n=t[0],s=e[0];return{type:"sqrt",mode:a.mode,body:s,index:n}},htmlBuilder(r,e){var t=P(r.body,e.havingCrampedStyle());t.height===0&&(t.height=e.fontMetrics().xHeight),t=y.wrapFragment(t,e);var a=e.fontMetrics(),n=a.defaultRuleThickness,s=n;e.style.idt.height+t.depth+o&&(o=(o+b-t.height-t.depth)/2);var w=c.height-t.height-o-p;t.style.paddingLeft=A(g);var x=y.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:t,wrapperClasses:["svg-align"]},{type:"kern",size:-(t.height+w)},{type:"elem",elem:c},{type:"kern",size:p}]},e);if(r.index){var z=e.havingStyle(R.SCRIPTSCRIPT),T=P(r.index,z,e),C=.6*(x.height-x.depth),q=y.makeVList({positionType:"shift",positionData:-C,children:[{type:"elem",elem:T}]},e),O=y.makeSpan(["root"],[q]);return y.makeSpan(["mord","sqrt"],[O,x],e)}else return y.makeSpan(["mord","sqrt"],[x],e)},mathmlBuilder(r,e){var{body:t,index:a}=r;return a?new S.MathNode("mroot",[Y(t,e),Y(a,e)]):new S.MathNode("msqrt",[Y(t,e)])}});var mr={display:R.DISPLAY,text:R.TEXT,script:R.SCRIPT,scriptscript:R.SCRIPTSCRIPT};B({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r,e){var{breakOnTokenText:t,funcName:a,parser:n}=r,s=n.parseExpression(!0,t),o=a.slice(1,a.length-5);return{type:"styling",mode:n.mode,style:o,body:s}},htmlBuilder(r,e){var t=mr[r.style],a=e.havingStyle(t).withFont("");return oa(r.body,a,e)},mathmlBuilder(r,e){var t=mr[r.style],a=e.havingStyle(t),n=h0(r.body,a),s=new S.MathNode("mstyle",n),o={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},h=o[r.style];return s.setAttribute("scriptlevel",h[0]),s.setAttribute("displaystyle",h[1]),s}});var t4=function(e,t){var a=e.base;if(a)if(a.type==="op"){var n=a.limits&&(t.style.size===R.DISPLAY.size||a.alwaysHandleSupSub);return n?ne:null}else if(a.type==="operatorname"){var s=a.alwaysHandleSupSub&&(t.style.size===R.DISPLAY.size||a.limits);return s?la:null}else{if(a.type==="accent")return N.isCharacterBox(a.base)?Bt:null;if(a.type==="horizBrace"){var o=!e.sub;return o===a.isOver?na:null}else return null}else return null};j0({type:"supsub",htmlBuilder(r,e){var t=t4(r,e);if(t)return t(r,e);var{base:a,sup:n,sub:s}=r,o=P(a,e),h,c,p=e.fontMetrics(),g=0,b=0,w=a&&N.isCharacterBox(a);if(n){var x=e.havingStyle(e.style.sup());h=P(n,x,e),w||(g=o.height-x.fontMetrics().supDrop*x.sizeMultiplier/e.sizeMultiplier)}if(s){var z=e.havingStyle(e.style.sub());c=P(s,z,e),w||(b=o.depth+z.fontMetrics().subDrop*z.sizeMultiplier/e.sizeMultiplier)}var T;e.style===R.DISPLAY?T=p.sup1:e.style.cramped?T=p.sup3:T=p.sup2;var C=e.sizeMultiplier,q=A(.5/p.ptPerEm/C),O=null;if(c){var H=r.base&&r.base.type==="op"&&r.base.name&&(r.base.name==="\\oiint"||r.base.name==="\\oiiint");(o instanceof u0||H)&&(O=A(-o.italic))}var V;if(h&&c){g=Math.max(g,T,h.depth+.25*p.xHeight),b=Math.max(b,p.sub2);var L=p.defaultRuleThickness,U=4*L;if(g-h.depth-(c.height-b)0&&(g+=G,b-=G)}var j=[{type:"elem",elem:c,shift:b,marginRight:q,marginLeft:O},{type:"elem",elem:h,shift:-g,marginRight:q}];V=y.makeVList({positionType:"individualShift",children:j},e)}else if(c){b=Math.max(b,p.sub1,c.height-.8*p.xHeight);var $=[{type:"elem",elem:c,marginLeft:O,marginRight:q}];V=y.makeVList({positionType:"shift",positionData:b,children:$},e)}else if(h)g=Math.max(g,T,h.depth+.25*p.xHeight),V=y.makeVList({positionType:"shift",positionData:-g,children:[{type:"elem",elem:h,marginRight:q}]},e);else throw new Error("supsub must have either sup or sub.");var T0=ft(o,"right")||"mord";return y.makeSpan([T0],[o,y.makeSpan(["msupsub"],[V])],e)},mathmlBuilder(r,e){var t=!1,a,n;r.base&&r.base.type==="horizBrace"&&(n=!!r.sup,n===r.base.isOver&&(t=!0,a=r.base.isOver)),r.base&&(r.base.type==="op"||r.base.type==="operatorname")&&(r.base.parentIsSupSub=!0);var s=[Y(r.base,e)];r.sub&&s.push(Y(r.sub,e)),r.sup&&s.push(Y(r.sup,e));var o;if(t)o=a?"mover":"munder";else if(r.sub)if(r.sup){var p=r.base;p&&p.type==="op"&&p.limits&&e.style===R.DISPLAY||p&&p.type==="operatorname"&&p.alwaysHandleSupSub&&(e.style===R.DISPLAY||p.limits)?o="munderover":o="msubsup"}else{var c=r.base;c&&c.type==="op"&&c.limits&&(e.style===R.DISPLAY||c.alwaysHandleSupSub)||c&&c.type==="operatorname"&&c.alwaysHandleSupSub&&(c.limits||e.style===R.DISPLAY)?o="munder":o="msub"}else{var h=r.base;h&&h.type==="op"&&h.limits&&(e.style===R.DISPLAY||h.alwaysHandleSupSub)||h&&h.type==="operatorname"&&h.alwaysHandleSupSub&&(h.limits||e.style===R.DISPLAY)?o="mover":o="msup"}return new S.MathNode(o,s)}});j0({type:"atom",htmlBuilder(r,e){return y.mathsym(r.text,r.mode,e,["m"+r.family])},mathmlBuilder(r,e){var t=new S.MathNode("mo",[v0(r.text,r.mode)]);if(r.family==="bin"){var a=At(r,e);a==="bold-italic"&&t.setAttribute("mathvariant",a)}else r.family==="punct"?t.setAttribute("separator","true"):(r.family==="open"||r.family==="close")&&t.setAttribute("stretchy","false");return t}});var ua={mi:"italic",mn:"normal",mtext:"normal"};j0({type:"mathord",htmlBuilder(r,e){return y.makeOrd(r,e,"mathord")},mathmlBuilder(r,e){var t=new S.MathNode("mi",[v0(r.text,r.mode,e)]),a=At(r,e)||"italic";return a!==ua[t.type]&&t.setAttribute("mathvariant",a),t}});j0({type:"textord",htmlBuilder(r,e){return y.makeOrd(r,e,"textord")},mathmlBuilder(r,e){var t=v0(r.text,r.mode,e),a=At(r,e)||"normal",n;return r.mode==="text"?n=new S.MathNode("mtext",[t]):/[0-9]/.test(r.text)?n=new S.MathNode("mn",[t]):r.text==="\\prime"?n=new S.MathNode("mo",[t]):n=new S.MathNode("mi",[t]),a!==ua[n.type]&&n.setAttribute("mathvariant",a),n}});var lt={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},ot={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};j0({type:"spacing",htmlBuilder(r,e){if(ot.hasOwnProperty(r.text)){var t=ot[r.text].className||"";if(r.mode==="text"){var a=y.makeOrd(r,e,"textord");return a.classes.push(t),a}else return y.makeSpan(["mspace",t],[y.mathsym(r.text,r.mode,e)],e)}else{if(lt.hasOwnProperty(r.text))return y.makeSpan(["mspace",lt[r.text]],[],e);throw new M('Unknown type of space "'+r.text+'"')}},mathmlBuilder(r,e){var t;if(ot.hasOwnProperty(r.text))t=new S.MathNode("mtext",[new S.TextNode("\xA0")]);else{if(lt.hasOwnProperty(r.text))return new S.MathNode("mspace");throw new M('Unknown type of space "'+r.text+'"')}return t}});var cr=()=>{var r=new S.MathNode("mtd",[]);return r.setAttribute("width","50%"),r};j0({type:"tag",mathmlBuilder(r,e){var t=new S.MathNode("mtable",[new S.MathNode("mtr",[cr(),new S.MathNode("mtd",[G0(r.body,e)]),cr(),new S.MathNode("mtd",[G0(r.tag,e)])])]);return t.setAttribute("width","100%"),t}});var dr={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},fr={"\\textbf":"textbf","\\textmd":"textmd"},r4={"\\textit":"textit","\\textup":"textup"},pr=(r,e)=>{var t=r.font;if(t){if(dr[t])return e.withTextFontFamily(dr[t]);if(fr[t])return e.withTextFontWeight(fr[t]);if(t==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(r4[t])};B({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(r,e){var{parser:t,funcName:a}=r,n=e[0];return{type:"text",mode:t.mode,body:Q(n),font:a}},htmlBuilder(r,e){var t=pr(r,e),a=t0(r.body,t,!0);return y.makeSpan(["mord","text"],a,t)},mathmlBuilder(r,e){var t=pr(r,e);return G0(r.body,t)}});B({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"underline",mode:t.mode,body:e[0]}},htmlBuilder(r,e){var t=P(r.body,e),a=y.makeLineSpan("underline-line",e),n=e.fontMetrics().defaultRuleThickness,s=y.makeVList({positionType:"top",positionData:t.height,children:[{type:"kern",size:n},{type:"elem",elem:a},{type:"kern",size:3*n},{type:"elem",elem:t}]},e);return y.makeSpan(["mord","underline"],[s],e)},mathmlBuilder(r,e){var t=new S.MathNode("mo",[new S.TextNode("\u203E")]);t.setAttribute("stretchy","true");var a=new S.MathNode("munder",[Y(r.body,e),t]);return a.setAttribute("accentunder","true"),a}});B({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(r,e){var{parser:t}=r;return{type:"vcenter",mode:t.mode,body:e[0]}},htmlBuilder(r,e){var t=P(r.body,e),a=e.fontMetrics().axisHeight,n=.5*(t.height-a-(t.depth+a));return y.makeVList({positionType:"shift",positionData:n,children:[{type:"elem",elem:t}]},e)},mathmlBuilder(r,e){return new S.MathNode("mpadded",[Y(r.body,e)],["vcenter"])}});B({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(r,e,t){throw new M("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(r,e){for(var t=vr(r),a=[],n=e.havingStyle(e.style.text()),s=0;sr.body.replace(/ /g,r.star?"\u2423":"\xA0"),L0=Nr,ha=`[ \r
+-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}},X0=class{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return N.contains(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),t=0;tt.toText();return this.children.map(e).join("")}},k0={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},xe={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},Yt={\u00C5:"A",\u00D0:"D",\u00DE:"o",\u00E5:"a",\u00F0:"d",\u00FE:"o",\u0410:"A",\u0411:"B",\u0412:"B",\u0413:"F",\u0414:"A",\u0415:"E",\u0416:"K",\u0417:"3",\u0418:"N",\u0419:"N",\u041A:"K",\u041B:"N",\u041C:"M",\u041D:"H",\u041E:"O",\u041F:"N",\u0420:"P",\u0421:"C",\u0422:"T",\u0423:"y",\u0424:"O",\u0425:"X",\u0426:"U",\u0427:"h",\u0428:"W",\u0429:"W",\u042A:"B",\u042B:"X",\u042C:"B",\u042D:"3",\u042E:"X",\u042F:"R",\u0430:"a",\u0431:"b",\u0432:"a",\u0433:"r",\u0434:"y",\u0435:"e",\u0436:"m",\u0437:"e",\u0438:"n",\u0439:"n",\u043A:"n",\u043B:"n",\u043C:"m",\u043D:"n",\u043E:"o",\u043F:"n",\u0440:"p",\u0441:"c",\u0442:"o",\u0443:"y",\u0444:"b",\u0445:"x",\u0446:"n",\u0447:"n",\u0448:"w",\u0449:"w",\u044A:"a",\u044B:"m",\u044C:"a",\u044D:"e",\u044E:"m",\u044F:"r"};function ja(r,e){k0[r]=e}function St(r,e,t){if(!k0[e])throw new Error("Font metrics not found for font: "+e+".");var a=r.charCodeAt(0),n=k0[e][a];if(!n&&r[0]in Yt&&(a=Yt[r[0]].charCodeAt(0),n=k0[e][a]),!n&&t==="text"&&kr(a)&&(n=k0[e][77]),n)return{depth:n[0],height:n[1],italic:n[2],skew:n[3],width:n[4]}}var Qe={};function Za(r){var e;if(r>=5?e=0:r>=3?e=1:e=2,!Qe[e]){var t=Qe[e]={cssEmPerMu:xe.quad[e]/18};for(var a in xe)xe.hasOwnProperty(a)&&(t[a]=xe[a][e])}return Qe[e]}var Ka=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],Xt=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Wt=function(e,t){return t.size<2?e:Ka[e-1][t.size-1]},Re=class r{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||r.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=Xt[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var a in e)e.hasOwnProperty(a)&&(t[a]=e[a]);return new r(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:Wt(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:Xt[e-1]})}havingBaseStyle(e){e=e||this.style.text();var t=Wt(r.BASESIZE,e);return this.size===t&&this.textSize===r.BASESIZE&&this.style===e?this:this.extend({style:e,size:t})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==r.BASESIZE?["sizing","reset-size"+this.size,"size"+r.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=Za(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}};Re.BASESIZE=6;var mt={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},Ja={ex:!0,em:!0,mu:!0},Sr=function(e){return typeof e!="string"&&(e=e.unit),e in mt||e in Ja||e==="ex"},J=function(e,t){var a;if(e.unit in mt)a=mt[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(e.unit==="mu")a=t.fontMetrics().cssEmPerMu;else{var n;if(t.style.isTight()?n=t.havingStyle(t.style.text()):n=t,e.unit==="ex")a=n.fontMetrics().xHeight;else if(e.unit==="em")a=n.fontMetrics().quad;else throw new M("Invalid unit: '"+e.unit+"'");n!==t&&(a*=n.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*a,t.maxSize)},A=function(e){return+e.toFixed(4)+"em"},P0=function(e){return e.filter(t=>t).join(" ")},Mr=function(e,t,a){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=a||{},t){t.style.isTight()&&this.classes.push("mtight");var n=t.getColor();n&&(this.style.color=n)}},zr=function(e){var t=document.createElement(e);t.className=P0(this.classes);for(var a in this.style)this.style.hasOwnProperty(a)&&(t.style[a]=this.style[a]);for(var n in this.attributes)this.attributes.hasOwnProperty(n)&&t.setAttribute(n,this.attributes[n]);for(var s=0;s";for(var o=0;o",t},W0=class{constructor(e,t,a,n){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,Mr.call(this,e,a,n),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return N.contains(this.classes,e)}toNode(){return zr.call(this,"span")}toMarkup(){return Ar.call(this,"span")}},ce=class{constructor(e,t,a,n){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,Mr.call(this,t,n),this.children=a||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return N.contains(this.classes,e)}toNode(){return zr.call(this,"a")}toMarkup(){return Ar.call(this,"a")}},ct=class{constructor(e,t,a){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=["mord"],this.style=a}hasClass(e){return N.contains(this.classes,e)}toNode(){var e=document.createElement("img");e.src=this.src,e.alt=this.alt,e.className="mord";for(var t in this.style)this.style.hasOwnProperty(t)&&(e.style[t]=this.style[t]);return e}toMarkup(){var e=' ",e}},Qa={\u00EE:"\u0131\u0302",\u00EF:"\u0131\u0308",\u00ED:"\u0131\u0301",\u00EC:"\u0131\u0300"},u0=class{constructor(e,t,a,n,s,o,h,c){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=a||0,this.italic=n||0,this.skew=s||0,this.width=o||0,this.classes=h||[],this.style=c||{},this.maxFontSize=0;var p=Ha(this.text.charCodeAt(0));p&&this.classes.push(p+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=Qa[this.text])}hasClass(e){return N.contains(this.classes,e)}toNode(){var e=document.createTextNode(this.text),t=null;this.italic>0&&(t=document.createElement("span"),t.style.marginRight=A(this.italic)),this.classes.length>0&&(t=t||document.createElement("span"),t.className=P0(this.classes));for(var a in this.style)this.style.hasOwnProperty(a)&&(t=t||document.createElement("span"),t.style[a]=this.style[a]);return t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t="0&&(a+="margin-right:"+this.italic+"em;");for(var n in this.style)this.style.hasOwnProperty(n)&&(a+=N.hyphenate(n)+":"+this.style[n]+";");a&&(e=!0,t+=' style="'+N.escape(a)+'"');var s=N.escape(this.text);return e?(t+=">",t+=s,t+=" ",t):s}},y0=class{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");for(var a in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,a)&&t.setAttribute(a,this.attributes[a]);for(var n=0;n";for(var a=0;a",e}},S0=class{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"path");return this.alternate?t.setAttribute("d",this.alternate):t.setAttribute("d",$t[this.pathName]),t}toMarkup(){return this.alternate?' ':' '}},de=class{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"line");for(var a in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,a)&&t.setAttribute(a,this.attributes[a]);return t}toMarkup(){var e=" ",e}};function jt(r){if(r instanceof u0)return r;throw new Error("Expected symbolNode but got "+String(r)+".")}function _a(r){if(r instanceof W0)return r;throw new Error("Expected span but got "+String(r)+".")}var e1={bin:1,close:1,inner:1,open:1,punct:1,rel:1},t1={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},X={math:{},text:{}};function i(r,e,t,a,n,s){X[r][n]={font:e,group:t,replace:a},s&&a&&(X[r][a]=X[r][n])}var l="math",k="text",u="main",d="ams",W="accent-token",D="bin",i0="close",ae="inner",E="mathord",_="op-token",c0="open",Ge="punct",f="rel",R0="spacing",v="textord";i(l,u,f,"\u2261","\\equiv",!0);i(l,u,f,"\u227A","\\prec",!0);i(l,u,f,"\u227B","\\succ",!0);i(l,u,f,"\u223C","\\sim",!0);i(l,u,f,"\u22A5","\\perp");i(l,u,f,"\u2AAF","\\preceq",!0);i(l,u,f,"\u2AB0","\\succeq",!0);i(l,u,f,"\u2243","\\simeq",!0);i(l,u,f,"\u2223","\\mid",!0);i(l,u,f,"\u226A","\\ll",!0);i(l,u,f,"\u226B","\\gg",!0);i(l,u,f,"\u224D","\\asymp",!0);i(l,u,f,"\u2225","\\parallel");i(l,u,f,"\u22C8","\\bowtie",!0);i(l,u,f,"\u2323","\\smile",!0);i(l,u,f,"\u2291","\\sqsubseteq",!0);i(l,u,f,"\u2292","\\sqsupseteq",!0);i(l,u,f,"\u2250","\\doteq",!0);i(l,u,f,"\u2322","\\frown",!0);i(l,u,f,"\u220B","\\ni",!0);i(l,u,f,"\u221D","\\propto",!0);i(l,u,f,"\u22A2","\\vdash",!0);i(l,u,f,"\u22A3","\\dashv",!0);i(l,u,f,"\u220B","\\owns");i(l,u,Ge,".","\\ldotp");i(l,u,Ge,"\u22C5","\\cdotp");i(l,u,v,"#","\\#");i(k,u,v,"#","\\#");i(l,u,v,"&","\\&");i(k,u,v,"&","\\&");i(l,u,v,"\u2135","\\aleph",!0);i(l,u,v,"\u2200","\\forall",!0);i(l,u,v,"\u210F","\\hbar",!0);i(l,u,v,"\u2203","\\exists",!0);i(l,u,v,"\u2207","\\nabla",!0);i(l,u,v,"\u266D","\\flat",!0);i(l,u,v,"\u2113","\\ell",!0);i(l,u,v,"\u266E","\\natural",!0);i(l,u,v,"\u2663","\\clubsuit",!0);i(l,u,v,"\u2118","\\wp",!0);i(l,u,v,"\u266F","\\sharp",!0);i(l,u,v,"\u2662","\\diamondsuit",!0);i(l,u,v,"\u211C","\\Re",!0);i(l,u,v,"\u2661","\\heartsuit",!0);i(l,u,v,"\u2111","\\Im",!0);i(l,u,v,"\u2660","\\spadesuit",!0);i(l,u,v,"\xA7","\\S",!0);i(k,u,v,"\xA7","\\S");i(l,u,v,"\xB6","\\P",!0);i(k,u,v,"\xB6","\\P");i(l,u,v,"\u2020","\\dag");i(k,u,v,"\u2020","\\dag");i(k,u,v,"\u2020","\\textdagger");i(l,u,v,"\u2021","\\ddag");i(k,u,v,"\u2021","\\ddag");i(k,u,v,"\u2021","\\textdaggerdbl");i(l,u,i0,"\u23B1","\\rmoustache",!0);i(l,u,c0,"\u23B0","\\lmoustache",!0);i(l,u,i0,"\u27EF","\\rgroup",!0);i(l,u,c0,"\u27EE","\\lgroup",!0);i(l,u,D,"\u2213","\\mp",!0);i(l,u,D,"\u2296","\\ominus",!0);i(l,u,D,"\u228E","\\uplus",!0);i(l,u,D,"\u2293","\\sqcap",!0);i(l,u,D,"\u2217","\\ast");i(l,u,D,"\u2294","\\sqcup",!0);i(l,u,D,"\u25EF","\\bigcirc",!0);i(l,u,D,"\u2219","\\bullet",!0);i(l,u,D,"\u2021","\\ddagger");i(l,u,D,"\u2240","\\wr",!0);i(l,u,D,"\u2A3F","\\amalg");i(l,u,D,"&","\\And");i(l,u,f,"\u27F5","\\longleftarrow",!0);i(l,u,f,"\u21D0","\\Leftarrow",!0);i(l,u,f,"\u27F8","\\Longleftarrow",!0);i(l,u,f,"\u27F6","\\longrightarrow",!0);i(l,u,f,"\u21D2","\\Rightarrow",!0);i(l,u,f,"\u27F9","\\Longrightarrow",!0);i(l,u,f,"\u2194","\\leftrightarrow",!0);i(l,u,f,"\u27F7","\\longleftrightarrow",!0);i(l,u,f,"\u21D4","\\Leftrightarrow",!0);i(l,u,f,"\u27FA","\\Longleftrightarrow",!0);i(l,u,f,"\u21A6","\\mapsto",!0);i(l,u,f,"\u27FC","\\longmapsto",!0);i(l,u,f,"\u2197","\\nearrow",!0);i(l,u,f,"\u21A9","\\hookleftarrow",!0);i(l,u,f,"\u21AA","\\hookrightarrow",!0);i(l,u,f,"\u2198","\\searrow",!0);i(l,u,f,"\u21BC","\\leftharpoonup",!0);i(l,u,f,"\u21C0","\\rightharpoonup",!0);i(l,u,f,"\u2199","\\swarrow",!0);i(l,u,f,"\u21BD","\\leftharpoondown",!0);i(l,u,f,"\u21C1","\\rightharpoondown",!0);i(l,u,f,"\u2196","\\nwarrow",!0);i(l,u,f,"\u21CC","\\rightleftharpoons",!0);i(l,d,f,"\u226E","\\nless",!0);i(l,d,f,"\uE010","\\@nleqslant");i(l,d,f,"\uE011","\\@nleqq");i(l,d,f,"\u2A87","\\lneq",!0);i(l,d,f,"\u2268","\\lneqq",!0);i(l,d,f,"\uE00C","\\@lvertneqq");i(l,d,f,"\u22E6","\\lnsim",!0);i(l,d,f,"\u2A89","\\lnapprox",!0);i(l,d,f,"\u2280","\\nprec",!0);i(l,d,f,"\u22E0","\\npreceq",!0);i(l,d,f,"\u22E8","\\precnsim",!0);i(l,d,f,"\u2AB9","\\precnapprox",!0);i(l,d,f,"\u2241","\\nsim",!0);i(l,d,f,"\uE006","\\@nshortmid");i(l,d,f,"\u2224","\\nmid",!0);i(l,d,f,"\u22AC","\\nvdash",!0);i(l,d,f,"\u22AD","\\nvDash",!0);i(l,d,f,"\u22EA","\\ntriangleleft");i(l,d,f,"\u22EC","\\ntrianglelefteq",!0);i(l,d,f,"\u228A","\\subsetneq",!0);i(l,d,f,"\uE01A","\\@varsubsetneq");i(l,d,f,"\u2ACB","\\subsetneqq",!0);i(l,d,f,"\uE017","\\@varsubsetneqq");i(l,d,f,"\u226F","\\ngtr",!0);i(l,d,f,"\uE00F","\\@ngeqslant");i(l,d,f,"\uE00E","\\@ngeqq");i(l,d,f,"\u2A88","\\gneq",!0);i(l,d,f,"\u2269","\\gneqq",!0);i(l,d,f,"\uE00D","\\@gvertneqq");i(l,d,f,"\u22E7","\\gnsim",!0);i(l,d,f,"\u2A8A","\\gnapprox",!0);i(l,d,f,"\u2281","\\nsucc",!0);i(l,d,f,"\u22E1","\\nsucceq",!0);i(l,d,f,"\u22E9","\\succnsim",!0);i(l,d,f,"\u2ABA","\\succnapprox",!0);i(l,d,f,"\u2246","\\ncong",!0);i(l,d,f,"\uE007","\\@nshortparallel");i(l,d,f,"\u2226","\\nparallel",!0);i(l,d,f,"\u22AF","\\nVDash",!0);i(l,d,f,"\u22EB","\\ntriangleright");i(l,d,f,"\u22ED","\\ntrianglerighteq",!0);i(l,d,f,"\uE018","\\@nsupseteqq");i(l,d,f,"\u228B","\\supsetneq",!0);i(l,d,f,"\uE01B","\\@varsupsetneq");i(l,d,f,"\u2ACC","\\supsetneqq",!0);i(l,d,f,"\uE019","\\@varsupsetneqq");i(l,d,f,"\u22AE","\\nVdash",!0);i(l,d,f,"\u2AB5","\\precneqq",!0);i(l,d,f,"\u2AB6","\\succneqq",!0);i(l,d,f,"\uE016","\\@nsubseteqq");i(l,d,D,"\u22B4","\\unlhd");i(l,d,D,"\u22B5","\\unrhd");i(l,d,f,"\u219A","\\nleftarrow",!0);i(l,d,f,"\u219B","\\nrightarrow",!0);i(l,d,f,"\u21CD","\\nLeftarrow",!0);i(l,d,f,"\u21CF","\\nRightarrow",!0);i(l,d,f,"\u21AE","\\nleftrightarrow",!0);i(l,d,f,"\u21CE","\\nLeftrightarrow",!0);i(l,d,f,"\u25B3","\\vartriangle");i(l,d,v,"\u210F","\\hslash");i(l,d,v,"\u25BD","\\triangledown");i(l,d,v,"\u25CA","\\lozenge");i(l,d,v,"\u24C8","\\circledS");i(l,d,v,"\xAE","\\circledR");i(k,d,v,"\xAE","\\circledR");i(l,d,v,"\u2221","\\measuredangle",!0);i(l,d,v,"\u2204","\\nexists");i(l,d,v,"\u2127","\\mho");i(l,d,v,"\u2132","\\Finv",!0);i(l,d,v,"\u2141","\\Game",!0);i(l,d,v,"\u2035","\\backprime");i(l,d,v,"\u25B2","\\blacktriangle");i(l,d,v,"\u25BC","\\blacktriangledown");i(l,d,v,"\u25A0","\\blacksquare");i(l,d,v,"\u29EB","\\blacklozenge");i(l,d,v,"\u2605","\\bigstar");i(l,d,v,"\u2222","\\sphericalangle",!0);i(l,d,v,"\u2201","\\complement",!0);i(l,d,v,"\xF0","\\eth",!0);i(k,u,v,"\xF0","\xF0");i(l,d,v,"\u2571","\\diagup");i(l,d,v,"\u2572","\\diagdown");i(l,d,v,"\u25A1","\\square");i(l,d,v,"\u25A1","\\Box");i(l,d,v,"\u25CA","\\Diamond");i(l,d,v,"\xA5","\\yen",!0);i(k,d,v,"\xA5","\\yen",!0);i(l,d,v,"\u2713","\\checkmark",!0);i(k,d,v,"\u2713","\\checkmark");i(l,d,v,"\u2136","\\beth",!0);i(l,d,v,"\u2138","\\daleth",!0);i(l,d,v,"\u2137","\\gimel",!0);i(l,d,v,"\u03DD","\\digamma",!0);i(l,d,v,"\u03F0","\\varkappa");i(l,d,c0,"\u250C","\\@ulcorner",!0);i(l,d,i0,"\u2510","\\@urcorner",!0);i(l,d,c0,"\u2514","\\@llcorner",!0);i(l,d,i0,"\u2518","\\@lrcorner",!0);i(l,d,f,"\u2266","\\leqq",!0);i(l,d,f,"\u2A7D","\\leqslant",!0);i(l,d,f,"\u2A95","\\eqslantless",!0);i(l,d,f,"\u2272","\\lesssim",!0);i(l,d,f,"\u2A85","\\lessapprox",!0);i(l,d,f,"\u224A","\\approxeq",!0);i(l,d,D,"\u22D6","\\lessdot");i(l,d,f,"\u22D8","\\lll",!0);i(l,d,f,"\u2276","\\lessgtr",!0);i(l,d,f,"\u22DA","\\lesseqgtr",!0);i(l,d,f,"\u2A8B","\\lesseqqgtr",!0);i(l,d,f,"\u2251","\\doteqdot");i(l,d,f,"\u2253","\\risingdotseq",!0);i(l,d,f,"\u2252","\\fallingdotseq",!0);i(l,d,f,"\u223D","\\backsim",!0);i(l,d,f,"\u22CD","\\backsimeq",!0);i(l,d,f,"\u2AC5","\\subseteqq",!0);i(l,d,f,"\u22D0","\\Subset",!0);i(l,d,f,"\u228F","\\sqsubset",!0);i(l,d,f,"\u227C","\\preccurlyeq",!0);i(l,d,f,"\u22DE","\\curlyeqprec",!0);i(l,d,f,"\u227E","\\precsim",!0);i(l,d,f,"\u2AB7","\\precapprox",!0);i(l,d,f,"\u22B2","\\vartriangleleft");i(l,d,f,"\u22B4","\\trianglelefteq");i(l,d,f,"\u22A8","\\vDash",!0);i(l,d,f,"\u22AA","\\Vvdash",!0);i(l,d,f,"\u2323","\\smallsmile");i(l,d,f,"\u2322","\\smallfrown");i(l,d,f,"\u224F","\\bumpeq",!0);i(l,d,f,"\u224E","\\Bumpeq",!0);i(l,d,f,"\u2267","\\geqq",!0);i(l,d,f,"\u2A7E","\\geqslant",!0);i(l,d,f,"\u2A96","\\eqslantgtr",!0);i(l,d,f,"\u2273","\\gtrsim",!0);i(l,d,f,"\u2A86","\\gtrapprox",!0);i(l,d,D,"\u22D7","\\gtrdot");i(l,d,f,"\u22D9","\\ggg",!0);i(l,d,f,"\u2277","\\gtrless",!0);i(l,d,f,"\u22DB","\\gtreqless",!0);i(l,d,f,"\u2A8C","\\gtreqqless",!0);i(l,d,f,"\u2256","\\eqcirc",!0);i(l,d,f,"\u2257","\\circeq",!0);i(l,d,f,"\u225C","\\triangleq",!0);i(l,d,f,"\u223C","\\thicksim");i(l,d,f,"\u2248","\\thickapprox");i(l,d,f,"\u2AC6","\\supseteqq",!0);i(l,d,f,"\u22D1","\\Supset",!0);i(l,d,f,"\u2290","\\sqsupset",!0);i(l,d,f,"\u227D","\\succcurlyeq",!0);i(l,d,f,"\u22DF","\\curlyeqsucc",!0);i(l,d,f,"\u227F","\\succsim",!0);i(l,d,f,"\u2AB8","\\succapprox",!0);i(l,d,f,"\u22B3","\\vartriangleright");i(l,d,f,"\u22B5","\\trianglerighteq");i(l,d,f,"\u22A9","\\Vdash",!0);i(l,d,f,"\u2223","\\shortmid");i(l,d,f,"\u2225","\\shortparallel");i(l,d,f,"\u226C","\\between",!0);i(l,d,f,"\u22D4","\\pitchfork",!0);i(l,d,f,"\u221D","\\varpropto");i(l,d,f,"\u25C0","\\blacktriangleleft");i(l,d,f,"\u2234","\\therefore",!0);i(l,d,f,"\u220D","\\backepsilon");i(l,d,f,"\u25B6","\\blacktriangleright");i(l,d,f,"\u2235","\\because",!0);i(l,d,f,"\u22D8","\\llless");i(l,d,f,"\u22D9","\\gggtr");i(l,d,D,"\u22B2","\\lhd");i(l,d,D,"\u22B3","\\rhd");i(l,d,f,"\u2242","\\eqsim",!0);i(l,u,f,"\u22C8","\\Join");i(l,d,f,"\u2251","\\Doteq",!0);i(l,d,D,"\u2214","\\dotplus",!0);i(l,d,D,"\u2216","\\smallsetminus");i(l,d,D,"\u22D2","\\Cap",!0);i(l,d,D,"\u22D3","\\Cup",!0);i(l,d,D,"\u2A5E","\\doublebarwedge",!0);i(l,d,D,"\u229F","\\boxminus",!0);i(l,d,D,"\u229E","\\boxplus",!0);i(l,d,D,"\u22C7","\\divideontimes",!0);i(l,d,D,"\u22C9","\\ltimes",!0);i(l,d,D,"\u22CA","\\rtimes",!0);i(l,d,D,"\u22CB","\\leftthreetimes",!0);i(l,d,D,"\u22CC","\\rightthreetimes",!0);i(l,d,D,"\u22CF","\\curlywedge",!0);i(l,d,D,"\u22CE","\\curlyvee",!0);i(l,d,D,"\u229D","\\circleddash",!0);i(l,d,D,"\u229B","\\circledast",!0);i(l,d,D,"\u22C5","\\centerdot");i(l,d,D,"\u22BA","\\intercal",!0);i(l,d,D,"\u22D2","\\doublecap");i(l,d,D,"\u22D3","\\doublecup");i(l,d,D,"\u22A0","\\boxtimes",!0);i(l,d,f,"\u21E2","\\dashrightarrow",!0);i(l,d,f,"\u21E0","\\dashleftarrow",!0);i(l,d,f,"\u21C7","\\leftleftarrows",!0);i(l,d,f,"\u21C6","\\leftrightarrows",!0);i(l,d,f,"\u21DA","\\Lleftarrow",!0);i(l,d,f,"\u219E","\\twoheadleftarrow",!0);i(l,d,f,"\u21A2","\\leftarrowtail",!0);i(l,d,f,"\u21AB","\\looparrowleft",!0);i(l,d,f,"\u21CB","\\leftrightharpoons",!0);i(l,d,f,"\u21B6","\\curvearrowleft",!0);i(l,d,f,"\u21BA","\\circlearrowleft",!0);i(l,d,f,"\u21B0","\\Lsh",!0);i(l,d,f,"\u21C8","\\upuparrows",!0);i(l,d,f,"\u21BF","\\upharpoonleft",!0);i(l,d,f,"\u21C3","\\downharpoonleft",!0);i(l,u,f,"\u22B6","\\origof",!0);i(l,u,f,"\u22B7","\\imageof",!0);i(l,d,f,"\u22B8","\\multimap",!0);i(l,d,f,"\u21AD","\\leftrightsquigarrow",!0);i(l,d,f,"\u21C9","\\rightrightarrows",!0);i(l,d,f,"\u21C4","\\rightleftarrows",!0);i(l,d,f,"\u21A0","\\twoheadrightarrow",!0);i(l,d,f,"\u21A3","\\rightarrowtail",!0);i(l,d,f,"\u21AC","\\looparrowright",!0);i(l,d,f,"\u21B7","\\curvearrowright",!0);i(l,d,f,"\u21BB","\\circlearrowright",!0);i(l,d,f,"\u21B1","\\Rsh",!0);i(l,d,f,"\u21CA","\\downdownarrows",!0);i(l,d,f,"\u21BE","\\upharpoonright",!0);i(l,d,f,"\u21C2","\\downharpoonright",!0);i(l,d,f,"\u21DD","\\rightsquigarrow",!0);i(l,d,f,"\u21DD","\\leadsto");i(l,d,f,"\u21DB","\\Rrightarrow",!0);i(l,d,f,"\u21BE","\\restriction");i(l,u,v,"\u2018","`");i(l,u,v,"$","\\$");i(k,u,v,"$","\\$");i(k,u,v,"$","\\textdollar");i(l,u,v,"%","\\%");i(k,u,v,"%","\\%");i(l,u,v,"_","\\_");i(k,u,v,"_","\\_");i(k,u,v,"_","\\textunderscore");i(l,u,v,"\u2220","\\angle",!0);i(l,u,v,"\u221E","\\infty",!0);i(l,u,v,"\u2032","\\prime");i(l,u,v,"\u25B3","\\triangle");i(l,u,v,"\u0393","\\Gamma",!0);i(l,u,v,"\u0394","\\Delta",!0);i(l,u,v,"\u0398","\\Theta",!0);i(l,u,v,"\u039B","\\Lambda",!0);i(l,u,v,"\u039E","\\Xi",!0);i(l,u,v,"\u03A0","\\Pi",!0);i(l,u,v,"\u03A3","\\Sigma",!0);i(l,u,v,"\u03A5","\\Upsilon",!0);i(l,u,v,"\u03A6","\\Phi",!0);i(l,u,v,"\u03A8","\\Psi",!0);i(l,u,v,"\u03A9","\\Omega",!0);i(l,u,v,"A","\u0391");i(l,u,v,"B","\u0392");i(l,u,v,"E","\u0395");i(l,u,v,"Z","\u0396");i(l,u,v,"H","\u0397");i(l,u,v,"I","\u0399");i(l,u,v,"K","\u039A");i(l,u,v,"M","\u039C");i(l,u,v,"N","\u039D");i(l,u,v,"O","\u039F");i(l,u,v,"P","\u03A1");i(l,u,v,"T","\u03A4");i(l,u,v,"X","\u03A7");i(l,u,v,"\xAC","\\neg",!0);i(l,u,v,"\xAC","\\lnot");i(l,u,v,"\u22A4","\\top");i(l,u,v,"\u22A5","\\bot");i(l,u,v,"\u2205","\\emptyset");i(l,d,v,"\u2205","\\varnothing");i(l,u,E,"\u03B1","\\alpha",!0);i(l,u,E,"\u03B2","\\beta",!0);i(l,u,E,"\u03B3","\\gamma",!0);i(l,u,E,"\u03B4","\\delta",!0);i(l,u,E,"\u03F5","\\epsilon",!0);i(l,u,E,"\u03B6","\\zeta",!0);i(l,u,E,"\u03B7","\\eta",!0);i(l,u,E,"\u03B8","\\theta",!0);i(l,u,E,"\u03B9","\\iota",!0);i(l,u,E,"\u03BA","\\kappa",!0);i(l,u,E,"\u03BB","\\lambda",!0);i(l,u,E,"\u03BC","\\mu",!0);i(l,u,E,"\u03BD","\\nu",!0);i(l,u,E,"\u03BE","\\xi",!0);i(l,u,E,"\u03BF","\\omicron",!0);i(l,u,E,"\u03C0","\\pi",!0);i(l,u,E,"\u03C1","\\rho",!0);i(l,u,E,"\u03C3","\\sigma",!0);i(l,u,E,"\u03C4","\\tau",!0);i(l,u,E,"\u03C5","\\upsilon",!0);i(l,u,E,"\u03D5","\\phi",!0);i(l,u,E,"\u03C7","\\chi",!0);i(l,u,E,"\u03C8","\\psi",!0);i(l,u,E,"\u03C9","\\omega",!0);i(l,u,E,"\u03B5","\\varepsilon",!0);i(l,u,E,"\u03D1","\\vartheta",!0);i(l,u,E,"\u03D6","\\varpi",!0);i(l,u,E,"\u03F1","\\varrho",!0);i(l,u,E,"\u03C2","\\varsigma",!0);i(l,u,E,"\u03C6","\\varphi",!0);i(l,u,D,"\u2217","*",!0);i(l,u,D,"+","+");i(l,u,D,"\u2212","-",!0);i(l,u,D,"\u22C5","\\cdot",!0);i(l,u,D,"\u2218","\\circ",!0);i(l,u,D,"\xF7","\\div",!0);i(l,u,D,"\xB1","\\pm",!0);i(l,u,D,"\xD7","\\times",!0);i(l,u,D,"\u2229","\\cap",!0);i(l,u,D,"\u222A","\\cup",!0);i(l,u,D,"\u2216","\\setminus",!0);i(l,u,D,"\u2227","\\land");i(l,u,D,"\u2228","\\lor");i(l,u,D,"\u2227","\\wedge",!0);i(l,u,D,"\u2228","\\vee",!0);i(l,u,v,"\u221A","\\surd");i(l,u,c0,"\u27E8","\\langle",!0);i(l,u,c0,"\u2223","\\lvert");i(l,u,c0,"\u2225","\\lVert");i(l,u,i0,"?","?");i(l,u,i0,"!","!");i(l,u,i0,"\u27E9","\\rangle",!0);i(l,u,i0,"\u2223","\\rvert");i(l,u,i0,"\u2225","\\rVert");i(l,u,f,"=","=");i(l,u,f,":",":");i(l,u,f,"\u2248","\\approx",!0);i(l,u,f,"\u2245","\\cong",!0);i(l,u,f,"\u2265","\\ge");i(l,u,f,"\u2265","\\geq",!0);i(l,u,f,"\u2190","\\gets");i(l,u,f,">","\\gt",!0);i(l,u,f,"\u2208","\\in",!0);i(l,u,f,"\uE020","\\@not");i(l,u,f,"\u2282","\\subset",!0);i(l,u,f,"\u2283","\\supset",!0);i(l,u,f,"\u2286","\\subseteq",!0);i(l,u,f,"\u2287","\\supseteq",!0);i(l,d,f,"\u2288","\\nsubseteq",!0);i(l,d,f,"\u2289","\\nsupseteq",!0);i(l,u,f,"\u22A8","\\models");i(l,u,f,"\u2190","\\leftarrow",!0);i(l,u,f,"\u2264","\\le");i(l,u,f,"\u2264","\\leq",!0);i(l,u,f,"<","\\lt",!0);i(l,u,f,"\u2192","\\rightarrow",!0);i(l,u,f,"\u2192","\\to");i(l,d,f,"\u2271","\\ngeq",!0);i(l,d,f,"\u2270","\\nleq",!0);i(l,u,R0,"\xA0","\\ ");i(l,u,R0,"\xA0","\\space");i(l,u,R0,"\xA0","\\nobreakspace");i(k,u,R0,"\xA0","\\ ");i(k,u,R0,"\xA0"," ");i(k,u,R0,"\xA0","\\space");i(k,u,R0,"\xA0","\\nobreakspace");i(l,u,R0,null,"\\nobreak");i(l,u,R0,null,"\\allowbreak");i(l,u,Ge,",",",");i(l,u,Ge,";",";");i(l,d,D,"\u22BC","\\barwedge",!0);i(l,d,D,"\u22BB","\\veebar",!0);i(l,u,D,"\u2299","\\odot",!0);i(l,u,D,"\u2295","\\oplus",!0);i(l,u,D,"\u2297","\\otimes",!0);i(l,u,v,"\u2202","\\partial",!0);i(l,u,D,"\u2298","\\oslash",!0);i(l,d,D,"\u229A","\\circledcirc",!0);i(l,d,D,"\u22A1","\\boxdot",!0);i(l,u,D,"\u25B3","\\bigtriangleup");i(l,u,D,"\u25BD","\\bigtriangledown");i(l,u,D,"\u2020","\\dagger");i(l,u,D,"\u22C4","\\diamond");i(l,u,D,"\u22C6","\\star");i(l,u,D,"\u25C3","\\triangleleft");i(l,u,D,"\u25B9","\\triangleright");i(l,u,c0,"{","\\{");i(k,u,v,"{","\\{");i(k,u,v,"{","\\textbraceleft");i(l,u,i0,"}","\\}");i(k,u,v,"}","\\}");i(k,u,v,"}","\\textbraceright");i(l,u,c0,"{","\\lbrace");i(l,u,i0,"}","\\rbrace");i(l,u,c0,"[","\\lbrack",!0);i(k,u,v,"[","\\lbrack",!0);i(l,u,i0,"]","\\rbrack",!0);i(k,u,v,"]","\\rbrack",!0);i(l,u,c0,"(","\\lparen",!0);i(l,u,i0,")","\\rparen",!0);i(k,u,v,"<","\\textless",!0);i(k,u,v,">","\\textgreater",!0);i(l,u,c0,"\u230A","\\lfloor",!0);i(l,u,i0,"\u230B","\\rfloor",!0);i(l,u,c0,"\u2308","\\lceil",!0);i(l,u,i0,"\u2309","\\rceil",!0);i(l,u,v,"\\","\\backslash");i(l,u,v,"\u2223","|");i(l,u,v,"\u2223","\\vert");i(k,u,v,"|","\\textbar",!0);i(l,u,v,"\u2225","\\|");i(l,u,v,"\u2225","\\Vert");i(k,u,v,"\u2225","\\textbardbl");i(k,u,v,"~","\\textasciitilde");i(k,u,v,"\\","\\textbackslash");i(k,u,v,"^","\\textasciicircum");i(l,u,f,"\u2191","\\uparrow",!0);i(l,u,f,"\u21D1","\\Uparrow",!0);i(l,u,f,"\u2193","\\downarrow",!0);i(l,u,f,"\u21D3","\\Downarrow",!0);i(l,u,f,"\u2195","\\updownarrow",!0);i(l,u,f,"\u21D5","\\Updownarrow",!0);i(l,u,_,"\u2210","\\coprod");i(l,u,_,"\u22C1","\\bigvee");i(l,u,_,"\u22C0","\\bigwedge");i(l,u,_,"\u2A04","\\biguplus");i(l,u,_,"\u22C2","\\bigcap");i(l,u,_,"\u22C3","\\bigcup");i(l,u,_,"\u222B","\\int");i(l,u,_,"\u222B","\\intop");i(l,u,_,"\u222C","\\iint");i(l,u,_,"\u222D","\\iiint");i(l,u,_,"\u220F","\\prod");i(l,u,_,"\u2211","\\sum");i(l,u,_,"\u2A02","\\bigotimes");i(l,u,_,"\u2A01","\\bigoplus");i(l,u,_,"\u2A00","\\bigodot");i(l,u,_,"\u222E","\\oint");i(l,u,_,"\u222F","\\oiint");i(l,u,_,"\u2230","\\oiiint");i(l,u,_,"\u2A06","\\bigsqcup");i(l,u,_,"\u222B","\\smallint");i(k,u,ae,"\u2026","\\textellipsis");i(l,u,ae,"\u2026","\\mathellipsis");i(k,u,ae,"\u2026","\\ldots",!0);i(l,u,ae,"\u2026","\\ldots",!0);i(l,u,ae,"\u22EF","\\@cdots",!0);i(l,u,ae,"\u22F1","\\ddots",!0);i(l,u,v,"\u22EE","\\varvdots");i(l,u,W,"\u02CA","\\acute");i(l,u,W,"\u02CB","\\grave");i(l,u,W,"\xA8","\\ddot");i(l,u,W,"~","\\tilde");i(l,u,W,"\u02C9","\\bar");i(l,u,W,"\u02D8","\\breve");i(l,u,W,"\u02C7","\\check");i(l,u,W,"^","\\hat");i(l,u,W,"\u20D7","\\vec");i(l,u,W,"\u02D9","\\dot");i(l,u,W,"\u02DA","\\mathring");i(l,u,E,"\uE131","\\@imath");i(l,u,E,"\uE237","\\@jmath");i(l,u,v,"\u0131","\u0131");i(l,u,v,"\u0237","\u0237");i(k,u,v,"\u0131","\\i",!0);i(k,u,v,"\u0237","\\j",!0);i(k,u,v,"\xDF","\\ss",!0);i(k,u,v,"\xE6","\\ae",!0);i(k,u,v,"\u0153","\\oe",!0);i(k,u,v,"\xF8","\\o",!0);i(k,u,v,"\xC6","\\AE",!0);i(k,u,v,"\u0152","\\OE",!0);i(k,u,v,"\xD8","\\O",!0);i(k,u,W,"\u02CA","\\'");i(k,u,W,"\u02CB","\\`");i(k,u,W,"\u02C6","\\^");i(k,u,W,"\u02DC","\\~");i(k,u,W,"\u02C9","\\=");i(k,u,W,"\u02D8","\\u");i(k,u,W,"\u02D9","\\.");i(k,u,W,"\xB8","\\c");i(k,u,W,"\u02DA","\\r");i(k,u,W,"\u02C7","\\v");i(k,u,W,"\xA8",'\\"');i(k,u,W,"\u02DD","\\H");i(k,u,W,"\u25EF","\\textcircled");var Tr={"--":!0,"---":!0,"``":!0,"''":!0};i(k,u,v,"\u2013","--",!0);i(k,u,v,"\u2013","\\textendash");i(k,u,v,"\u2014","---",!0);i(k,u,v,"\u2014","\\textemdash");i(k,u,v,"\u2018","`",!0);i(k,u,v,"\u2018","\\textquoteleft");i(k,u,v,"\u2019","'",!0);i(k,u,v,"\u2019","\\textquoteright");i(k,u,v,"\u201C","``",!0);i(k,u,v,"\u201C","\\textquotedblleft");i(k,u,v,"\u201D","''",!0);i(k,u,v,"\u201D","\\textquotedblright");i(l,u,v,"\xB0","\\degree",!0);i(k,u,v,"\xB0","\\degree");i(k,u,v,"\xB0","\\textdegree",!0);i(l,u,v,"\xA3","\\pounds");i(l,u,v,"\xA3","\\mathsterling",!0);i(k,u,v,"\xA3","\\pounds");i(k,u,v,"\xA3","\\textsterling",!0);i(l,d,v,"\u2720","\\maltese");i(k,d,v,"\u2720","\\maltese");var Zt='0123456789/@."';for(we=0;we0)return b0(s,p,n,t,o.concat(g));if(c){var b,x;if(c==="boldsymbol"){var w=n1(s,n,t,o,a);b=w.fontName,x=[w.fontClass]}else h?(b=Cr[c].fontName,x=[c]):(b=Ae(c,t.fontWeight,t.fontShape),x=[c,t.fontWeight,t.fontShape]);if(Ve(s,b,n).metrics)return b0(s,b,n,t,o.concat(x));if(Tr.hasOwnProperty(s)&&b.slice(0,10)==="Typewriter"){for(var z=[],T=0;T{if(P0(r.classes)!==P0(e.classes)||r.skew!==e.skew||r.maxFontSize!==e.maxFontSize)return!1;if(r.classes.length===1){var t=r.classes[0];if(t==="mbin"||t==="mord")return!1}for(var a in r.style)if(r.style.hasOwnProperty(a)&&r.style[a]!==e.style[a])return!1;for(var n in e.style)if(e.style.hasOwnProperty(n)&&r.style[n]!==e.style[n])return!1;return!0},l1=r=>{for(var e=0;et&&(t=o.height),o.depth>a&&(a=o.depth),o.maxFontSize>n&&(n=o.maxFontSize)}e.height=t,e.depth=a,e.maxFontSize=n},l0=function(e,t,a,n){var s=new W0(e,t,a,n);return Mt(s),s},Br=(r,e,t,a)=>new W0(r,e,t,a),o1=function(e,t,a){var n=l0([e],[],t);return n.height=Math.max(a||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),n.style.borderBottomWidth=A(n.height),n.maxFontSize=1,n},u1=function(e,t,a,n){var s=new ce(e,t,a,n);return Mt(s),s},Dr=function(e){var t=new X0(e);return Mt(t),t},h1=function(e,t){return e instanceof X0?l0([],[e],t):e},m1=function(e){if(e.positionType==="individualShift"){for(var t=e.children,a=[t[0]],n=-t[0].shift-t[0].elem.depth,s=n,o=1;o{var t=l0(["mspace"],[],e),a=J(r,e);return t.style.marginRight=A(a),t},Ae=function(e,t,a){var n="";switch(e){case"amsrm":n="AMS";break;case"textrm":n="Main";break;case"textsf":n="SansSerif";break;case"texttt":n="Typewriter";break;default:n=e}var s;return t==="textbf"&&a==="textit"?s="BoldItalic":t==="textbf"?s="Bold":t==="textit"?s="Italic":s="Regular",n+"-"+s},Cr={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},qr={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},f1=function(e,t){var[a,n,s]=qr[e],o=new S0(a),h=new y0([o],{width:A(n),height:A(s),style:"width:"+A(n),viewBox:"0 0 "+1e3*n+" "+1e3*s,preserveAspectRatio:"xMinYMin"}),c=Br(["overlay"],[h],t);return c.height=s,c.style.height=A(s),c.style.width=A(n),c},y={fontMap:Cr,makeSymbol:b0,mathsym:a1,makeSpan:l0,makeSvgSpan:Br,makeLineSpan:o1,makeAnchor:u1,makeFragment:Dr,wrapFragment:h1,makeVList:c1,makeOrd:i1,makeGlue:d1,staticSvg:f1,svgData:qr,tryCombineChars:l1},K={number:3,unit:"mu"},$0={number:4,unit:"mu"},D0={number:5,unit:"mu"},p1={mord:{mop:K,mbin:$0,mrel:D0,minner:K},mop:{mord:K,mop:K,mrel:D0,minner:K},mbin:{mord:$0,mop:$0,mopen:$0,minner:$0},mrel:{mord:D0,mop:D0,mopen:D0,minner:D0},mopen:{},mclose:{mop:K,mbin:$0,mrel:D0,minner:K},mpunct:{mord:K,mop:K,mrel:D0,mopen:K,mclose:K,mpunct:K,minner:K},minner:{mord:K,mop:K,mbin:$0,mrel:D0,mopen:K,mpunct:K,minner:K}},v1={mord:{mop:K},mop:{mord:K,mop:K},mbin:{},mrel:{},mopen:{},mclose:{mop:K},mpunct:{},minner:{mop:K}},Nr={},Oe={},He={};function B(r){for(var{type:e,names:t,props:a,handler:n,htmlBuilder:s,mathmlBuilder:o}=r,h={type:e,numArgs:a.numArgs,argTypes:a.argTypes,allowedInArgument:!!a.allowedInArgument,allowedInText:!!a.allowedInText,allowedInMath:a.allowedInMath===void 0?!0:a.allowedInMath,numOptionalArgs:a.numOptionalArgs||0,infix:!!a.infix,primitive:!!a.primitive,handler:n},c=0;c{var C=T.classes[0],q=z.classes[0];C==="mbin"&&N.contains(b1,q)?T.classes[0]="mord":q==="mbin"&&N.contains(g1,C)&&(z.classes[0]="mord")},{node:b},x,w),Qt(s,(z,T)=>{var C=ft(T),q=ft(z),O=C&&q?z.hasClass("mtight")?v1[C][q]:p1[C][q]:null;if(O)return y.makeGlue(O,p)},{node:b},x,w),s},Qt=function r(e,t,a,n,s){n&&e.push(n);for(var o=0;ox=>{e.splice(b+1,0,x),o++})(o)}n&&e.pop()},Er=function(e){return e instanceof X0||e instanceof ce||e instanceof W0&&e.hasClass("enclosing")?e:null},w1=function r(e,t){var a=Er(e);if(a){var n=a.children;if(n.length){if(t==="right")return r(n[n.length-1],"right");if(t==="left")return r(n[0],"left")}}return e},ft=function(e,t){return e?(t&&(e=w1(e,t)),x1[e.classes[0]]||null):null},fe=function(e,t){var a=["nulldelimiter"].concat(e.baseSizingClasses());return N0(t.concat(a))},P=function(e,t,a){if(!e)return N0();if(Oe[e.type]){var n=Oe[e.type](e,t);if(a&&t.size!==a.size){n=N0(t.sizingClasses(a),[n],t);var s=t.sizeMultiplier/a.sizeMultiplier;n.height*=s,n.depth*=s}return n}else throw new M("Got group of unknown type: '"+e.type+"'")};function Te(r,e){var t=N0(["base"],r,e),a=N0(["strut"]);return a.style.height=A(t.height+t.depth),t.depth&&(a.style.verticalAlign=A(-t.depth)),t.children.unshift(a),t}function pt(r,e){var t=null;r.length===1&&r[0].type==="tag"&&(t=r[0].tag,r=r[0].body);var a=t0(r,e,"root"),n;a.length===2&&a[1].hasClass("tag")&&(n=a.pop());for(var s=[],o=[],h=0;h0&&(s.push(Te(o,e)),o=[]),s.push(a[h]));o.length>0&&s.push(Te(o,e));var p;t?(p=Te(t0(t,e,!0)),p.classes=["tag"],s.push(p)):n&&s.push(n);var g=N0(["katex-html"],s);if(g.setAttribute("aria-hidden","true"),p){var b=p.children[0];b.style.height=A(g.height+g.depth),g.depth&&(b.style.verticalAlign=A(-g.depth))}return g}function Rr(r){return new X0(r)}var o0=class{constructor(e,t,a){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=a||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=P0(this.classes));for(var a=0;a0&&(e+=' class ="'+N.escape(P0(this.classes))+'"'),e+=">";for(var a=0;a",e}toText(){return this.children.map(e=>e.toText()).join("")}},Y0=class{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return N.escape(this.toText())}toText(){return this.text}},vt=class{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character="\u200A":e>=.1666&&e<=.1667?this.character="\u2009":e>=.2222&&e<=.2223?this.character="\u2005":e>=.2777&&e<=.2778?this.character="\u2005\u200A":e>=-.05556&&e<=-.05555?this.character="\u200A\u2063":e>=-.1667&&e<=-.1666?this.character="\u2009\u2063":e>=-.2223&&e<=-.2222?this.character="\u205F\u2063":e>=-.2778&&e<=-.2777?this.character="\u2005\u2063":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",A(this.width)),e}toMarkup(){return this.character?""+this.character+" ":' '}toText(){return this.character?this.character:" "}},S={MathNode:o0,TextNode:Y0,SpaceNode:vt,newDocumentFragment:Rr},v0=function(e,t,a){return X[t][e]&&X[t][e].replace&&e.charCodeAt(0)!==55349&&!(Tr.hasOwnProperty(e)&&a&&(a.fontFamily&&a.fontFamily.slice(4,6)==="tt"||a.font&&a.font.slice(4,6)==="tt"))&&(e=X[t][e].replace),new S.TextNode(e)},zt=function(e){return e.length===1?e[0]:new S.MathNode("mrow",e)},At=function(e,t){if(t.fontFamily==="texttt")return"monospace";if(t.fontFamily==="textsf")return t.fontShape==="textit"&&t.fontWeight==="textbf"?"sans-serif-bold-italic":t.fontShape==="textit"?"sans-serif-italic":t.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(t.fontShape==="textit"&&t.fontWeight==="textbf")return"bold-italic";if(t.fontShape==="textit")return"italic";if(t.fontWeight==="textbf")return"bold";var a=t.font;if(!a||a==="mathnormal")return null;var n=e.mode;if(a==="mathit")return"italic";if(a==="boldsymbol")return e.type==="textord"?"bold":"bold-italic";if(a==="mathbf")return"bold";if(a==="mathbb")return"double-struck";if(a==="mathfrak")return"fraktur";if(a==="mathscr"||a==="mathcal")return"script";if(a==="mathsf")return"sans-serif";if(a==="mathtt")return"monospace";var s=e.text;if(N.contains(["\\imath","\\jmath"],s))return null;X[n][s]&&X[n][s].replace&&(s=X[n][s].replace);var o=y.fontMap[a].fontName;return St(s,o,n)?y.fontMap[a].variant:null},h0=function(e,t,a){if(e.length===1){var n=Y(e[0],t);return a&&n instanceof o0&&n.type==="mo"&&(n.setAttribute("lspace","0em"),n.setAttribute("rspace","0em")),[n]}for(var s=[],o,h=0;h0&&(b.text=b.text.slice(0,1)+"\u0338"+b.text.slice(1),s.pop())}}}s.push(c),o=c}return s},G0=function(e,t,a){return zt(h0(e,t,a))},Y=function(e,t){if(!e)return new S.MathNode("mrow");if(He[e.type]){var a=He[e.type](e,t);return a}else throw new M("Got group of unknown type: '"+e.type+"'")};function _t(r,e,t,a,n){var s=h0(r,t),o;s.length===1&&s[0]instanceof o0&&N.contains(["mrow","mtable"],s[0].type)?o=s[0]:o=new S.MathNode("mrow",s);var h=new S.MathNode("annotation",[new S.TextNode(e)]);h.setAttribute("encoding","application/x-tex");var c=new S.MathNode("semantics",[o,h]),p=new S.MathNode("math",[c]);p.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),a&&p.setAttribute("display","block");var g=n?"katex":"katex-mathml";return y.makeSpan([g],[p])}var Ir=function(e){return new Re({style:e.displayMode?R.DISPLAY:R.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},Or=function(e,t){if(t.displayMode){var a=["katex-display"];t.leqno&&a.push("leqno"),t.fleqn&&a.push("fleqn"),e=y.makeSpan(a,[e])}return e},k1=function(e,t,a){var n=Ir(a),s;if(a.output==="mathml")return _t(e,t,n,a.displayMode,!0);if(a.output==="html"){var o=pt(e,n);s=y.makeSpan(["katex"],[o])}else{var h=_t(e,t,n,a.displayMode,!1),c=pt(e,n);s=y.makeSpan(["katex"],[h,c])}return Or(s,a)},S1=function(e,t,a){var n=Ir(a),s=pt(e,n),o=y.makeSpan(["katex"],[s]);return Or(o,a)},M1={widehat:"^",widecheck:"\u02C7",widetilde:"~",utilde:"~",overleftarrow:"\u2190",underleftarrow:"\u2190",xleftarrow:"\u2190",overrightarrow:"\u2192",underrightarrow:"\u2192",xrightarrow:"\u2192",underbrace:"\u23DF",overbrace:"\u23DE",overgroup:"\u23E0",undergroup:"\u23E1",overleftrightarrow:"\u2194",underleftrightarrow:"\u2194",xleftrightarrow:"\u2194",Overrightarrow:"\u21D2",xRightarrow:"\u21D2",overleftharpoon:"\u21BC",xleftharpoonup:"\u21BC",overrightharpoon:"\u21C0",xrightharpoonup:"\u21C0",xLeftarrow:"\u21D0",xLeftrightarrow:"\u21D4",xhookleftarrow:"\u21A9",xhookrightarrow:"\u21AA",xmapsto:"\u21A6",xrightharpoondown:"\u21C1",xleftharpoondown:"\u21BD",xrightleftharpoons:"\u21CC",xleftrightharpoons:"\u21CB",xtwoheadleftarrow:"\u219E",xtwoheadrightarrow:"\u21A0",xlongequal:"=",xtofrom:"\u21C4",xrightleftarrows:"\u21C4",xrightequilibrium:"\u21CC",xleftequilibrium:"\u21CB","\\cdrightarrow":"\u2192","\\cdleftarrow":"\u2190","\\cdlongequal":"="},z1=function(e){var t=new S.MathNode("mo",[new S.TextNode(M1[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},A1={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},T1=function(e){return e.type==="ordgroup"?e.body.length:1},B1=function(e,t){function a(){var h=4e5,c=e.label.slice(1);if(N.contains(["widehat","widecheck","widetilde","utilde"],c)){var p=e,g=T1(p.base),b,x,w;if(g>5)c==="widehat"||c==="widecheck"?(b=420,h=2364,w=.42,x=c+"4"):(b=312,h=2340,w=.34,x="tilde4");else{var z=[1,1,2,2,3,3][g];c==="widehat"||c==="widecheck"?(h=[0,1062,2364,2364,2364][z],b=[0,239,300,360,420][z],w=[0,.24,.3,.3,.36,.42][z],x=c+z):(h=[0,600,1033,2339,2340][z],b=[0,260,286,306,312][z],w=[0,.26,.286,.3,.306,.34][z],x="tilde"+z)}var T=new S0(x),C=new y0([T],{width:"100%",height:A(w),viewBox:"0 0 "+h+" "+b,preserveAspectRatio:"none"});return{span:y.makeSvgSpan([],[C],t),minWidth:0,height:w}}else{var q=[],O=A1[c],[H,V,L]=O,U=L/1e3,G=H.length,j,$;if(G===1){var T0=O[3];j=["hide-tail"],$=[T0]}else if(G===2)j=["halfarrow-left","halfarrow-right"],$=["xMinYMin","xMaxYMin"];else if(G===3)j=["brace-left","brace-center","brace-right"],$=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
+ `+G+" children.");for(var a0=0;a00&&(n.style.minWidth=A(s)),n},D1=function(e,t,a,n,s){var o,h=e.height+e.depth+a+n;if(/fbox|color|angl/.test(t)){if(o=y.makeSpan(["stretchy",t],[],s),t==="fbox"){var c=s.color&&s.getColor();c&&(o.style.borderColor=c)}}else{var p=[];/^[bx]cancel$/.test(t)&&p.push(new de({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&p.push(new de({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var g=new y0(p,{width:"100%",height:A(h)});o=y.makeSvgSpan([],[g],s)}return o.height=h,o.style.height=A(h),o},E0={encloseSpan:D1,mathMLnode:z1,svgSpan:B1};function F(r,e){if(!r||r.type!==e)throw new Error("Expected node of type "+e+", but got "+(r?"node of type "+r.type:String(r)));return r}function Tt(r){var e=Ue(r);if(!e)throw new Error("Expected node of symbol group type, but got "+(r?"node of type "+r.type:String(r)));return e}function Ue(r){return r&&(r.type==="atom"||t1.hasOwnProperty(r.type))?r:null}var Bt=(r,e)=>{var t,a,n;r&&r.type==="supsub"?(a=F(r.base,"accent"),t=a.base,r.base=t,n=_a(P(r,e)),r.base=a):(a=F(r,"accent"),t=a.base);var s=P(t,e.havingCrampedStyle()),o=a.isShifty&&N.isCharacterBox(t),h=0;if(o){var c=N.getBaseElem(t),p=P(c,e.havingCrampedStyle());h=jt(p).skew}var g=a.label==="\\c",b=g?s.height+s.depth:Math.min(s.height,e.fontMetrics().xHeight),x;if(a.isStretchy)x=E0.svgSpan(a,e),x=y.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:x,wrapperClasses:["svg-align"],wrapperStyle:h>0?{width:"calc(100% - "+A(2*h)+")",marginLeft:A(2*h)}:void 0}]},e);else{var w,z;a.label==="\\vec"?(w=y.staticSvg("vec",e),z=y.svgData.vec[1]):(w=y.makeOrd({mode:a.mode,text:a.label},e,"textord"),w=jt(w),w.italic=0,z=w.width,g&&(b+=w.depth)),x=y.makeSpan(["accent-body"],[w]);var T=a.label==="\\textcircled";T&&(x.classes.push("accent-full"),b=s.height);var C=h;T||(C-=z/2),x.style.left=A(C),a.label==="\\textcircled"&&(x.style.top=".2em"),x=y.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-b},{type:"elem",elem:x}]},e)}var q=y.makeSpan(["mord","accent"],[x],e);return n?(n.children[0]=q,n.height=Math.max(q.height,n.height),n.classes[0]="mord",n):q},Hr=(r,e)=>{var t=r.isStretchy?E0.mathMLnode(r.label):new S.MathNode("mo",[v0(r.label,r.mode)]),a=new S.MathNode("mover",[Y(r.base,e),t]);return a.setAttribute("accent","true"),a},C1=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(r=>"\\"+r).join("|"));B({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(r,e)=>{var t=Fe(e[0]),a=!C1.test(r.funcName),n=!a||r.funcName==="\\widehat"||r.funcName==="\\widetilde"||r.funcName==="\\widecheck";return{type:"accent",mode:r.parser.mode,label:r.funcName,isStretchy:a,isShifty:n,base:t}},htmlBuilder:Bt,mathmlBuilder:Hr});B({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(r,e)=>{var t=e[0],a=r.parser.mode;return a==="math"&&(r.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+r.funcName+" works only in text mode"),a="text"),{type:"accent",mode:a,label:r.funcName,isStretchy:!1,isShifty:!0,base:t}},htmlBuilder:Bt,mathmlBuilder:Hr});B({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(r,e)=>{var{parser:t,funcName:a}=r,n=e[0];return{type:"accentUnder",mode:t.mode,label:a,base:n}},htmlBuilder:(r,e)=>{var t=P(r.base,e),a=E0.svgSpan(r,e),n=r.label==="\\utilde"?.12:0,s=y.makeVList({positionType:"top",positionData:t.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:n},{type:"elem",elem:t}]},e);return y.makeSpan(["mord","accentunder"],[s],e)},mathmlBuilder:(r,e)=>{var t=E0.mathMLnode(r.label),a=new S.MathNode("munder",[Y(r.base,e),t]);return a.setAttribute("accentunder","true"),a}});var Be=r=>{var e=new S.MathNode("mpadded",r?[r]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};B({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(r,e,t){var{parser:a,funcName:n}=r;return{type:"xArrow",mode:a.mode,label:n,body:e[0],below:t[0]}},htmlBuilder(r,e){var t=e.style,a=e.havingStyle(t.sup()),n=y.wrapFragment(P(r.body,a,e),e),s=r.label.slice(0,2)==="\\x"?"x":"cd";n.classes.push(s+"-arrow-pad");var o;r.below&&(a=e.havingStyle(t.sub()),o=y.wrapFragment(P(r.below,a,e),e),o.classes.push(s+"-arrow-pad"));var h=E0.svgSpan(r,e),c=-e.fontMetrics().axisHeight+.5*h.height,p=-e.fontMetrics().axisHeight-.5*h.height-.111;(n.depth>.25||r.label==="\\xleftequilibrium")&&(p-=n.depth);var g;if(o){var b=-e.fontMetrics().axisHeight+o.height+.5*h.height+.111;g=y.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:p},{type:"elem",elem:h,shift:c},{type:"elem",elem:o,shift:b}]},e)}else g=y.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:p},{type:"elem",elem:h,shift:c}]},e);return g.children[0].children[0].children[1].classes.push("svg-align"),y.makeSpan(["mrel","x-arrow"],[g],e)},mathmlBuilder(r,e){var t=E0.mathMLnode(r.label);t.setAttribute("minsize",r.label.charAt(0)==="x"?"1.75em":"3.0em");var a;if(r.body){var n=Be(Y(r.body,e));if(r.below){var s=Be(Y(r.below,e));a=new S.MathNode("munderover",[t,s,n])}else a=new S.MathNode("mover",[t,n])}else if(r.below){var o=Be(Y(r.below,e));a=new S.MathNode("munder",[t,o])}else a=Be(),a=new S.MathNode("mover",[t,a]);return a}});var q1=y.makeSpan;function Fr(r,e){var t=t0(r.body,e,!0);return q1([r.mclass],t,e)}function Lr(r,e){var t,a=h0(r.body,e);return r.mclass==="minner"?t=new S.MathNode("mpadded",a):r.mclass==="mord"?r.isCharacterBox?(t=a[0],t.type="mi"):t=new S.MathNode("mi",a):(r.isCharacterBox?(t=a[0],t.type="mo"):t=new S.MathNode("mo",a),r.mclass==="mbin"?(t.attributes.lspace="0.22em",t.attributes.rspace="0.22em"):r.mclass==="mpunct"?(t.attributes.lspace="0em",t.attributes.rspace="0.17em"):r.mclass==="mopen"||r.mclass==="mclose"?(t.attributes.lspace="0em",t.attributes.rspace="0em"):r.mclass==="minner"&&(t.attributes.lspace="0.0556em",t.attributes.width="+0.1111em")),t}B({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(r,e){var{parser:t,funcName:a}=r,n=e[0];return{type:"mclass",mode:t.mode,mclass:"m"+a.slice(5),body:Q(n),isCharacterBox:N.isCharacterBox(n)}},htmlBuilder:Fr,mathmlBuilder:Lr});var $e=r=>{var e=r.type==="ordgroup"&&r.body.length?r.body[0]:r;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};B({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(r,e){var{parser:t}=r;return{type:"mclass",mode:t.mode,mclass:$e(e[0]),body:Q(e[1]),isCharacterBox:N.isCharacterBox(e[1])}}});B({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(r,e){var{parser:t,funcName:a}=r,n=e[1],s=e[0],o;a!=="\\stackrel"?o=$e(n):o="mrel";var h={type:"op",mode:n.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:a!=="\\stackrel",body:Q(n)},c={type:"supsub",mode:s.mode,base:h,sup:a==="\\underset"?null:s,sub:a==="\\underset"?s:null};return{type:"mclass",mode:t.mode,mclass:o,body:[c],isCharacterBox:N.isCharacterBox(c)}},htmlBuilder:Fr,mathmlBuilder:Lr});B({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"pmb",mode:t.mode,mclass:$e(e[0]),body:Q(e[0])}},htmlBuilder(r,e){var t=t0(r.body,e,!0),a=y.makeSpan([r.mclass],t,e);return a.style.textShadow="0.02em 0.01em 0.04px",a},mathmlBuilder(r,e){var t=h0(r.body,e),a=new S.MathNode("mstyle",t);return a.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),a}});var N1={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},er=()=>({type:"styling",body:[],mode:"math",style:"display"}),tr=r=>r.type==="textord"&&r.text==="@",E1=(r,e)=>(r.type==="mathord"||r.type==="atom")&&r.text===e;function R1(r,e,t){var a=N1[r];switch(a){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return t.callFunction(a,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var n=t.callFunction("\\\\cdleft",[e[0]],[]),s={type:"atom",text:a,mode:"math",family:"rel"},o=t.callFunction("\\Big",[s],[]),h=t.callFunction("\\\\cdright",[e[1]],[]),c={type:"ordgroup",mode:"math",body:[n,o,h]};return t.callFunction("\\\\cdparent",[c],[])}case"\\\\cdlongequal":return t.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var p={type:"textord",text:"\\Vert",mode:"math"};return t.callFunction("\\Big",[p],[])}default:return{type:"textord",text:" ",mode:"math"}}}function I1(r){var e=[];for(r.gullet.beginGroup(),r.gullet.macros.set("\\cr","\\\\\\relax"),r.gullet.beginGroup();;){e.push(r.parseExpression(!1,"\\\\")),r.gullet.endGroup(),r.gullet.beginGroup();var t=r.fetch().text;if(t==="&"||t==="\\\\")r.consume();else if(t==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new M("Expected \\\\ or \\cr or \\end",r.nextToken)}for(var a=[],n=[a],s=0;s-1))if("<>AV".indexOf(p)>-1)for(var b=0;b<2;b++){for(var x=!0,w=c+1;wAV=|." after @',o[c]);var z=R1(p,g,r),T={type:"styling",body:[z],mode:"math",style:"display"};a.push(T),h=er()}s%2===0?a.push(h):a.shift(),a=[],n.push(a)}r.gullet.endGroup(),r.gullet.endGroup();var C=new Array(n[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:n,arraystretch:1,addJot:!0,rowGaps:[null],cols:C,colSeparationType:"CD",hLinesBeforeRow:new Array(n.length+1).fill([])}}B({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:a}=r;return{type:"cdlabel",mode:t.mode,side:a.slice(4),label:e[0]}},htmlBuilder(r,e){var t=e.havingStyle(e.style.sup()),a=y.wrapFragment(P(r.label,t,e),e);return a.classes.push("cd-label-"+r.side),a.style.bottom=A(.8-a.depth),a.height=0,a.depth=0,a},mathmlBuilder(r,e){var t=new S.MathNode("mrow",[Y(r.label,e)]);return t=new S.MathNode("mpadded",[t]),t.setAttribute("width","0"),r.side==="left"&&t.setAttribute("lspace","-1width"),t.setAttribute("voffset","0.7em"),t=new S.MathNode("mstyle",[t]),t.setAttribute("displaystyle","false"),t.setAttribute("scriptlevel","1"),t}});B({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(r,e){var{parser:t}=r;return{type:"cdlabelparent",mode:t.mode,fragment:e[0]}},htmlBuilder(r,e){var t=y.wrapFragment(P(r.fragment,e),e);return t.classes.push("cd-vert-arrow"),t},mathmlBuilder(r,e){return new S.MathNode("mrow",[Y(r.fragment,e)])}});B({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(r,e){for(var{parser:t}=r,a=F(e[0],"ordgroup"),n=a.body,s="",o=0;o=1114111)throw new M("\\@char with invalid code point "+s);return c<=65535?p=String.fromCharCode(c):(c-=65536,p=String.fromCharCode((c>>10)+55296,(c&1023)+56320)),{type:"textord",mode:t.mode,text:p}}});var Pr=(r,e)=>{var t=t0(r.body,e.withColor(r.color),!1);return y.makeFragment(t)},Gr=(r,e)=>{var t=h0(r.body,e.withColor(r.color)),a=new S.MathNode("mstyle",t);return a.setAttribute("mathcolor",r.color),a};B({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(r,e){var{parser:t}=r,a=F(e[0],"color-token").color,n=e[1];return{type:"color",mode:t.mode,color:a,body:Q(n)}},htmlBuilder:Pr,mathmlBuilder:Gr});B({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(r,e){var{parser:t,breakOnTokenText:a}=r,n=F(e[0],"color-token").color;t.gullet.macros.set("\\current@color",n);var s=t.parseExpression(!0,a);return{type:"color",mode:t.mode,color:n,body:s}},htmlBuilder:Pr,mathmlBuilder:Gr});B({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(r,e,t){var{parser:a}=r,n=a.gullet.future().text==="["?a.parseSizeGroup(!0):null,s=!a.settings.displayMode||!a.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:a.mode,newLine:s,size:n&&F(n,"size").value}},htmlBuilder(r,e){var t=y.makeSpan(["mspace"],[],e);return r.newLine&&(t.classes.push("newline"),r.size&&(t.style.marginTop=A(J(r.size,e)))),t},mathmlBuilder(r,e){var t=new S.MathNode("mspace");return r.newLine&&(t.setAttribute("linebreak","newline"),r.size&&t.setAttribute("height",A(J(r.size,e)))),t}});var gt={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},Vr=r=>{var e=r.text;if(/^(?:[\\{}$^_]|EOF)$/.test(e))throw new M("Expected a control sequence",r);return e},O1=r=>{var e=r.gullet.popToken();return e.text==="="&&(e=r.gullet.popToken(),e.text===" "&&(e=r.gullet.popToken())),e},Ur=(r,e,t,a)=>{var n=r.gullet.macros.get(t.text);n==null&&(t.noexpand=!0,n={tokens:[t],numArgs:0,unexpandable:!r.gullet.isExpandable(t.text)}),r.gullet.macros.set(e,n,a)};B({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(r){var{parser:e,funcName:t}=r;e.consumeSpaces();var a=e.fetch();if(gt[a.text])return(t==="\\global"||t==="\\\\globallong")&&(a.text=gt[a.text]),F(e.parseFunction(),"internal");throw new M("Invalid token after macro prefix",a)}});B({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,a=e.gullet.popToken(),n=a.text;if(/^(?:[\\{}$^_]|EOF)$/.test(n))throw new M("Expected a control sequence",a);for(var s=0,o,h=[[]];e.gullet.future().text!=="{";)if(a=e.gullet.popToken(),a.text==="#"){if(e.gullet.future().text==="{"){o=e.gullet.future(),h[s].push("{");break}if(a=e.gullet.popToken(),!/^[1-9]$/.test(a.text))throw new M('Invalid argument number "'+a.text+'"');if(parseInt(a.text)!==s+1)throw new M('Argument number "'+a.text+'" out of order');s++,h.push([])}else{if(a.text==="EOF")throw new M("Expected a macro definition");h[s].push(a.text)}var{tokens:c}=e.gullet.consumeArg();return o&&c.unshift(o),(t==="\\edef"||t==="\\xdef")&&(c=e.gullet.expandTokens(c),c.reverse()),e.gullet.macros.set(n,{tokens:c,numArgs:s,delimiters:h},t===gt[t]),{type:"internal",mode:e.mode}}});B({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,a=Vr(e.gullet.popToken());e.gullet.consumeSpaces();var n=O1(e);return Ur(e,a,n,t==="\\\\globallet"),{type:"internal",mode:e.mode}}});B({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,a=Vr(e.gullet.popToken()),n=e.gullet.popToken(),s=e.gullet.popToken();return Ur(e,a,s,t==="\\\\globalfuture"),e.gullet.pushToken(s),e.gullet.pushToken(n),{type:"internal",mode:e.mode}}});var oe=function(e,t,a){var n=X.math[e]&&X.math[e].replace,s=St(n||e,t,a);if(!s)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return s},Dt=function(e,t,a,n){var s=a.havingBaseStyle(t),o=y.makeSpan(n.concat(s.sizingClasses(a)),[e],a),h=s.sizeMultiplier/a.sizeMultiplier;return o.height*=h,o.depth*=h,o.maxFontSize=s.sizeMultiplier,o},$r=function(e,t,a){var n=t.havingBaseStyle(a),s=(1-t.sizeMultiplier/n.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=A(s),e.height-=s,e.depth+=s},H1=function(e,t,a,n,s,o){var h=y.makeSymbol(e,"Main-Regular",s,n),c=Dt(h,t,n,o);return a&&$r(c,n,t),c},F1=function(e,t,a,n){return y.makeSymbol(e,"Size"+t+"-Regular",a,n)},Yr=function(e,t,a,n,s,o){var h=F1(e,t,s,n),c=Dt(y.makeSpan(["delimsizing","size"+t],[h],n),R.TEXT,n,o);return a&&$r(c,n,R.TEXT),c},tt=function(e,t,a){var n;t==="Size1-Regular"?n="delim-size1":n="delim-size4";var s=y.makeSpan(["delimsizinginner",n],[y.makeSpan([],[y.makeSymbol(e,t,a)])]);return{type:"elem",elem:s}},rt=function(e,t,a){var n=k0["Size4-Regular"][e.charCodeAt(0)]?k0["Size4-Regular"][e.charCodeAt(0)][4]:k0["Size1-Regular"][e.charCodeAt(0)][4],s=new S0("inner",Xa(e,Math.round(1e3*t))),o=new y0([s],{width:A(n),height:A(t),style:"width:"+A(n),viewBox:"0 0 "+1e3*n+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),h=y.makeSvgSpan([],[o],a);return h.height=t,h.style.height=A(t),h.style.width=A(n),{type:"elem",elem:h}},bt=.008,De={type:"kern",size:-1*bt},L1=["|","\\lvert","\\rvert","\\vert"],P1=["\\|","\\lVert","\\rVert","\\Vert"],Xr=function(e,t,a,n,s,o){var h,c,p,g,b="",x=0;h=p=g=e,c=null;var w="Size1-Regular";e==="\\uparrow"?p=g="\u23D0":e==="\\Uparrow"?p=g="\u2016":e==="\\downarrow"?h=p="\u23D0":e==="\\Downarrow"?h=p="\u2016":e==="\\updownarrow"?(h="\\uparrow",p="\u23D0",g="\\downarrow"):e==="\\Updownarrow"?(h="\\Uparrow",p="\u2016",g="\\Downarrow"):N.contains(L1,e)?(p="\u2223",b="vert",x=333):N.contains(P1,e)?(p="\u2225",b="doublevert",x=556):e==="["||e==="\\lbrack"?(h="\u23A1",p="\u23A2",g="\u23A3",w="Size4-Regular",b="lbrack",x=667):e==="]"||e==="\\rbrack"?(h="\u23A4",p="\u23A5",g="\u23A6",w="Size4-Regular",b="rbrack",x=667):e==="\\lfloor"||e==="\u230A"?(p=h="\u23A2",g="\u23A3",w="Size4-Regular",b="lfloor",x=667):e==="\\lceil"||e==="\u2308"?(h="\u23A1",p=g="\u23A2",w="Size4-Regular",b="lceil",x=667):e==="\\rfloor"||e==="\u230B"?(p=h="\u23A5",g="\u23A6",w="Size4-Regular",b="rfloor",x=667):e==="\\rceil"||e==="\u2309"?(h="\u23A4",p=g="\u23A5",w="Size4-Regular",b="rceil",x=667):e==="("||e==="\\lparen"?(h="\u239B",p="\u239C",g="\u239D",w="Size4-Regular",b="lparen",x=875):e===")"||e==="\\rparen"?(h="\u239E",p="\u239F",g="\u23A0",w="Size4-Regular",b="rparen",x=875):e==="\\{"||e==="\\lbrace"?(h="\u23A7",c="\u23A8",g="\u23A9",p="\u23AA",w="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(h="\u23AB",c="\u23AC",g="\u23AD",p="\u23AA",w="Size4-Regular"):e==="\\lgroup"||e==="\u27EE"?(h="\u23A7",g="\u23A9",p="\u23AA",w="Size4-Regular"):e==="\\rgroup"||e==="\u27EF"?(h="\u23AB",g="\u23AD",p="\u23AA",w="Size4-Regular"):e==="\\lmoustache"||e==="\u23B0"?(h="\u23A7",g="\u23AD",p="\u23AA",w="Size4-Regular"):(e==="\\rmoustache"||e==="\u23B1")&&(h="\u23AB",g="\u23A9",p="\u23AA",w="Size4-Regular");var z=oe(h,w,s),T=z.height+z.depth,C=oe(p,w,s),q=C.height+C.depth,O=oe(g,w,s),H=O.height+O.depth,V=0,L=1;if(c!==null){var U=oe(c,w,s);V=U.height+U.depth,L=2}var G=T+H+V,j=Math.max(0,Math.ceil((t-G)/(L*q))),$=G+j*L*q,T0=n.fontMetrics().axisHeight;a&&(T0*=n.sizeMultiplier);var a0=$/2-T0,e0=[];if(b.length>0){var U0=$-T-H,s0=Math.round($*1e3),g0=Wa(b,Math.round(U0*1e3)),I0=new S0(b,g0),Z0=(x/1e3).toFixed(3)+"em",K0=(s0/1e3).toFixed(3)+"em",We=new y0([I0],{width:Z0,height:K0,viewBox:"0 0 "+x+" "+s0}),O0=y.makeSvgSpan([],[We],n);O0.height=s0/1e3,O0.style.width=Z0,O0.style.height=K0,e0.push({type:"elem",elem:O0})}else{if(e0.push(tt(g,w,s)),e0.push(De),c===null){var H0=$-T-H+2*bt;e0.push(rt(p,H0,n))}else{var d0=($-T-H-V)/2+2*bt;e0.push(rt(p,d0,n)),e0.push(De),e0.push(tt(c,w,s)),e0.push(De),e0.push(rt(p,d0,n))}e0.push(De),e0.push(tt(h,w,s))}var ie=n.havingBaseStyle(R.TEXT),je=y.makeVList({positionType:"bottom",positionData:a0,children:e0},ie);return Dt(y.makeSpan(["delimsizing","mult"],[je],ie),R.TEXT,n,o)},at=80,nt=.08,it=function(e,t,a,n,s){var o=Ya(e,n,a),h=new S0(e,o),c=new y0([h],{width:"400em",height:A(t),viewBox:"0 0 400000 "+a,preserveAspectRatio:"xMinYMin slice"});return y.makeSvgSpan(["hide-tail"],[c],s)},G1=function(e,t){var a=t.havingBaseSizing(),n=Kr("\\surd",e*a.sizeMultiplier,Zr,a),s=a.sizeMultiplier,o=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),h,c=0,p=0,g=0,b;return n.type==="small"?(g=1e3+1e3*o+at,e<1?s=1:e<1.4&&(s=.7),c=(1+o+nt)/s,p=(1+o)/s,h=it("sqrtMain",c,g,o,t),h.style.minWidth="0.853em",b=.833/s):n.type==="large"?(g=(1e3+at)*ue[n.size],p=(ue[n.size]+o)/s,c=(ue[n.size]+o+nt)/s,h=it("sqrtSize"+n.size,c,g,o,t),h.style.minWidth="1.02em",b=1/s):(c=e+o+nt,p=e+o,g=Math.floor(1e3*e+o)+at,h=it("sqrtTall",c,g,o,t),h.style.minWidth="0.742em",b=1.056),h.height=p,h.style.height=A(c),{span:h,advanceWidth:b,ruleWidth:(t.fontMetrics().sqrtRuleThickness+o)*s}},Wr=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230A","\u230B","\\lceil","\\rceil","\u2308","\u2309","\\surd"],V1=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27EE","\u27EF","\\lmoustache","\\rmoustache","\u23B0","\u23B1"],jr=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],ue=[0,1.2,1.8,2.4,3],U1=function(e,t,a,n,s){if(e==="<"||e==="\\lt"||e==="\u27E8"?e="\\langle":(e===">"||e==="\\gt"||e==="\u27E9")&&(e="\\rangle"),N.contains(Wr,e)||N.contains(jr,e))return Yr(e,t,!1,a,n,s);if(N.contains(V1,e))return Xr(e,ue[t],!1,a,n,s);throw new M("Illegal delimiter: '"+e+"'")},$1=[{type:"small",style:R.SCRIPTSCRIPT},{type:"small",style:R.SCRIPT},{type:"small",style:R.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Y1=[{type:"small",style:R.SCRIPTSCRIPT},{type:"small",style:R.SCRIPT},{type:"small",style:R.TEXT},{type:"stack"}],Zr=[{type:"small",style:R.SCRIPTSCRIPT},{type:"small",style:R.SCRIPT},{type:"small",style:R.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],X1=function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},Kr=function(e,t,a,n){for(var s=Math.min(2,3-n.style.size),o=s;ot)return a[o]}return a[a.length-1]},Jr=function(e,t,a,n,s,o){e==="<"||e==="\\lt"||e==="\u27E8"?e="\\langle":(e===">"||e==="\\gt"||e==="\u27E9")&&(e="\\rangle");var h;N.contains(jr,e)?h=$1:N.contains(Wr,e)?h=Zr:h=Y1;var c=Kr(e,t,h,n);return c.type==="small"?H1(e,c.style,a,n,s,o):c.type==="large"?Yr(e,c.size,a,n,s,o):Xr(e,t,a,n,s,o)},W1=function(e,t,a,n,s,o){var h=n.fontMetrics().axisHeight*n.sizeMultiplier,c=901,p=5/n.fontMetrics().ptPerEm,g=Math.max(t-h,a+h),b=Math.max(g/500*c,2*g-p);return Jr(e,b,!0,n,s,o)},q0={sqrtImage:G1,sizedDelim:U1,sizeToMaxHeight:ue,customSizedDelim:Jr,leftRightDelim:W1},rr={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},j1=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230A","\u230B","\\lceil","\\rceil","\u2308","\u2309","<",">","\\langle","\u27E8","\\rangle","\u27E9","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27EE","\u27EF","\\lmoustache","\\rmoustache","\u23B0","\u23B1","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function Ye(r,e){var t=Ue(r);if(t&&N.contains(j1,t.text))return t;throw t?new M("Invalid delimiter '"+t.text+"' after '"+e.funcName+"'",r):new M("Invalid delimiter type '"+r.type+"'",r)}B({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(r,e)=>{var t=Ye(e[0],r);return{type:"delimsizing",mode:r.parser.mode,size:rr[r.funcName].size,mclass:rr[r.funcName].mclass,delim:t.text}},htmlBuilder:(r,e)=>r.delim==="."?y.makeSpan([r.mclass]):q0.sizedDelim(r.delim,r.size,e,r.mode,[r.mclass]),mathmlBuilder:r=>{var e=[];r.delim!=="."&&e.push(v0(r.delim,r.mode));var t=new S.MathNode("mo",e);r.mclass==="mopen"||r.mclass==="mclose"?t.setAttribute("fence","true"):t.setAttribute("fence","false"),t.setAttribute("stretchy","true");var a=A(q0.sizeToMaxHeight[r.size]);return t.setAttribute("minsize",a),t.setAttribute("maxsize",a),t}});function ar(r){if(!r.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}B({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=r.parser.gullet.macros.get("\\current@color");if(t&&typeof t!="string")throw new M("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:r.parser.mode,delim:Ye(e[0],r).text,color:t}}});B({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=Ye(e[0],r),a=r.parser;++a.leftrightDepth;var n=a.parseExpression(!1);--a.leftrightDepth,a.expect("\\right",!1);var s=F(a.parseFunction(),"leftright-right");return{type:"leftright",mode:a.mode,body:n,left:t.text,right:s.delim,rightColor:s.color}},htmlBuilder:(r,e)=>{ar(r);for(var t=t0(r.body,e,!0,["mopen","mclose"]),a=0,n=0,s=!1,o=0;o{ar(r);var t=h0(r.body,e);if(r.left!=="."){var a=new S.MathNode("mo",[v0(r.left,r.mode)]);a.setAttribute("fence","true"),t.unshift(a)}if(r.right!=="."){var n=new S.MathNode("mo",[v0(r.right,r.mode)]);n.setAttribute("fence","true"),r.rightColor&&n.setAttribute("mathcolor",r.rightColor),t.push(n)}return zt(t)}});B({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=Ye(e[0],r);if(!r.parser.leftrightDepth)throw new M("\\middle without preceding \\left",t);return{type:"middle",mode:r.parser.mode,delim:t.text}},htmlBuilder:(r,e)=>{var t;if(r.delim===".")t=fe(e,[]);else{t=q0.sizedDelim(r.delim,1,e,r.mode,[]);var a={delim:r.delim,options:e};t.isMiddle=a}return t},mathmlBuilder:(r,e)=>{var t=r.delim==="\\vert"||r.delim==="|"?v0("|","text"):v0(r.delim,r.mode),a=new S.MathNode("mo",[t]);return a.setAttribute("fence","true"),a.setAttribute("lspace","0.05em"),a.setAttribute("rspace","0.05em"),a}});var Ct=(r,e)=>{var t=y.wrapFragment(P(r.body,e),e),a=r.label.slice(1),n=e.sizeMultiplier,s,o=0,h=N.isCharacterBox(r.body);if(a==="sout")s=y.makeSpan(["stretchy","sout"]),s.height=e.fontMetrics().defaultRuleThickness/n,o=-.5*e.fontMetrics().xHeight;else if(a==="phase"){var c=J({number:.6,unit:"pt"},e),p=J({number:.35,unit:"ex"},e),g=e.havingBaseSizing();n=n/g.sizeMultiplier;var b=t.height+t.depth+c+p;t.style.paddingLeft=A(b/2+c);var x=Math.floor(1e3*b*n),w=Ua(x),z=new y0([new S0("phase",w)],{width:"400em",height:A(x/1e3),viewBox:"0 0 400000 "+x,preserveAspectRatio:"xMinYMin slice"});s=y.makeSvgSpan(["hide-tail"],[z],e),s.style.height=A(b),o=t.depth+c+p}else{/cancel/.test(a)?h||t.classes.push("cancel-pad"):a==="angl"?t.classes.push("anglpad"):t.classes.push("boxpad");var T=0,C=0,q=0;/box/.test(a)?(q=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),T=e.fontMetrics().fboxsep+(a==="colorbox"?0:q),C=T):a==="angl"?(q=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),T=4*q,C=Math.max(0,.25-t.depth)):(T=h?.2:0,C=T),s=E0.encloseSpan(t,a,T,C,e),/fbox|boxed|fcolorbox/.test(a)?(s.style.borderStyle="solid",s.style.borderWidth=A(q)):a==="angl"&&q!==.049&&(s.style.borderTopWidth=A(q),s.style.borderRightWidth=A(q)),o=t.depth+C,r.backgroundColor&&(s.style.backgroundColor=r.backgroundColor,r.borderColor&&(s.style.borderColor=r.borderColor))}var O;if(r.backgroundColor)O=y.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:o},{type:"elem",elem:t,shift:0}]},e);else{var H=/cancel|phase/.test(a)?["svg-align"]:[];O=y.makeVList({positionType:"individualShift",children:[{type:"elem",elem:t,shift:0},{type:"elem",elem:s,shift:o,wrapperClasses:H}]},e)}return/cancel/.test(a)&&(O.height=t.height,O.depth=t.depth),/cancel/.test(a)&&!h?y.makeSpan(["mord","cancel-lap"],[O],e):y.makeSpan(["mord"],[O],e)},qt=(r,e)=>{var t=0,a=new S.MathNode(r.label.indexOf("colorbox")>-1?"mpadded":"menclose",[Y(r.body,e)]);switch(r.label){case"\\cancel":a.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":a.setAttribute("notation","downdiagonalstrike");break;case"\\phase":a.setAttribute("notation","phasorangle");break;case"\\sout":a.setAttribute("notation","horizontalstrike");break;case"\\fbox":a.setAttribute("notation","box");break;case"\\angl":a.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(t=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,a.setAttribute("width","+"+2*t+"pt"),a.setAttribute("height","+"+2*t+"pt"),a.setAttribute("lspace",t+"pt"),a.setAttribute("voffset",t+"pt"),r.label==="\\fcolorbox"){var n=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);a.setAttribute("style","border: "+n+"em solid "+String(r.borderColor))}break;case"\\xcancel":a.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return r.backgroundColor&&a.setAttribute("mathbackground",r.backgroundColor),a};B({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(r,e,t){var{parser:a,funcName:n}=r,s=F(e[0],"color-token").color,o=e[1];return{type:"enclose",mode:a.mode,label:n,backgroundColor:s,body:o}},htmlBuilder:Ct,mathmlBuilder:qt});B({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(r,e,t){var{parser:a,funcName:n}=r,s=F(e[0],"color-token").color,o=F(e[1],"color-token").color,h=e[2];return{type:"enclose",mode:a.mode,label:n,backgroundColor:o,borderColor:s,body:h}},htmlBuilder:Ct,mathmlBuilder:qt});B({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"enclose",mode:t.mode,label:"\\fbox",body:e[0]}}});B({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:a}=r,n=e[0];return{type:"enclose",mode:t.mode,label:a,body:n}},htmlBuilder:Ct,mathmlBuilder:qt});B({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(r,e){var{parser:t}=r;return{type:"enclose",mode:t.mode,label:"\\angl",body:e[0]}}});var Qr={};function M0(r){for(var{type:e,names:t,props:a,handler:n,htmlBuilder:s,mathmlBuilder:o}=r,h={type:e,numArgs:a.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:n},c=0;c{var e=r.parser.settings;if(!e.displayMode)throw new M("{"+r.envName+"} can be used only in display mode.")};function Nt(r){if(r.indexOf("ed")===-1)return r.indexOf("*")===-1}function V0(r,e,t){var{hskipBeforeAndAfter:a,addJot:n,cols:s,arraystretch:o,colSeparationType:h,autoTag:c,singleRow:p,emptySingleRow:g,maxNumCols:b,leqno:x}=e;if(r.gullet.beginGroup(),p||r.gullet.macros.set("\\cr","\\\\\\relax"),!o){var w=r.gullet.expandMacroAsText("\\arraystretch");if(w==null)o=1;else if(o=parseFloat(w),!o||o<0)throw new M("Invalid \\arraystretch: "+w)}r.gullet.beginGroup();var z=[],T=[z],C=[],q=[],O=c!=null?[]:void 0;function H(){c&&r.gullet.macros.set("\\@eqnsw","1",!0)}function V(){O&&(r.gullet.macros.get("\\df@tag")?(O.push(r.subparse([new p0("\\df@tag")])),r.gullet.macros.set("\\df@tag",void 0,!0)):O.push(!!c&&r.gullet.macros.get("\\@eqnsw")==="1"))}for(H(),q.push(nr(r));;){var L=r.parseExpression(!1,p?"\\end":"\\\\");r.gullet.endGroup(),r.gullet.beginGroup(),L={type:"ordgroup",mode:r.mode,body:L},t&&(L={type:"styling",mode:r.mode,style:t,body:[L]}),z.push(L);var U=r.fetch().text;if(U==="&"){if(b&&z.length===b){if(p||h)throw new M("Too many tab characters: &",r.nextToken);r.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}r.consume()}else if(U==="\\end"){V(),z.length===1&&L.type==="styling"&&L.body[0].body.length===0&&(T.length>1||!g)&&T.pop(),q.length0&&(H+=.25),p.push({pos:H,isDashed:be[ye]})}for(V(o[0]),a=0;a0&&(a0+=O,Gbe))for(a=0;a=h)){var Q0=void 0;(n>0||e.hskipBeforeAndAfter)&&(Q0=N.deflt(d0.pregap,x),Q0!==0&&(g0=y.makeSpan(["arraycolsep"],[]),g0.style.width=A(Q0),s0.push(g0)));var _0=[];for(a=0;a0){for(var ba=y.makeLineSpan("hline",t,g),ya=y.makeLineSpan("hdashline",t,g),Ze=[{type:"elem",elem:c,shift:0}];p.length>0;){var Gt=p.pop(),Vt=Gt.pos-e0;Gt.isDashed?Ze.push({type:"elem",elem:ya,shift:Vt}):Ze.push({type:"elem",elem:ba,shift:Vt})}c=y.makeVList({positionType:"individualShift",children:Ze},t)}if(Z0.length===0)return y.makeSpan(["mord"],[c],t);var Ke=y.makeVList({positionType:"individualShift",children:Z0},t);return Ke=y.makeSpan(["tag"],[Ke],t),y.makeFragment([c,Ke])},Z1={c:"center ",l:"left ",r:"right "},A0=function(e,t){for(var a=[],n=new S.MathNode("mtd",[],["mtr-glue"]),s=new S.MathNode("mtd",[],["mml-eqn-num"]),o=0;o0){var z=e.cols,T="",C=!1,q=0,O=z.length;z[0].type==="separator"&&(x+="top ",q=1),z[z.length-1].type==="separator"&&(x+="bottom ",O-=1);for(var H=q;H0?"left ":"",x+=j[j.length-1].length>0?"right ":"";for(var $=1;$-1?"alignat":"align",s=e.envName==="split",o=V0(e.parser,{cols:a,addJot:!0,autoTag:s?void 0:Nt(e.envName),emptySingleRow:!0,colSeparationType:n,maxNumCols:s?2:void 0,leqno:e.parser.settings.leqno},"display"),h,c=0,p={type:"ordgroup",mode:e.mode,body:[]};if(t[0]&&t[0].type==="ordgroup"){for(var g="",b=0;b0&&w&&(C=1),a[z]={type:"align",align:T,pregap:C,postgap:0}}return o.colSeparationType=w?"align":"alignat",o};M0({type:"array",names:["array","darray"],props:{numArgs:1},handler(r,e){var t=Ue(e[0]),a=t?[e[0]]:F(e[0],"ordgroup").body,n=a.map(function(o){var h=Tt(o),c=h.text;if("lcr".indexOf(c)!==-1)return{type:"align",align:c};if(c==="|")return{type:"separator",separator:"|"};if(c===":")return{type:"separator",separator:":"};throw new M("Unknown column alignment: "+c,o)}),s={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return V0(r.parser,s,Et(r.envName))},htmlBuilder:z0,mathmlBuilder:A0});M0({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(r){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[r.envName.replace("*","")],t="c",a={hskipBeforeAndAfter:!1,cols:[{type:"align",align:t}]};if(r.envName.charAt(r.envName.length-1)==="*"){var n=r.parser;if(n.consumeSpaces(),n.fetch().text==="["){if(n.consume(),n.consumeSpaces(),t=n.fetch().text,"lcr".indexOf(t)===-1)throw new M("Expected l or c or r",n.nextToken);n.consume(),n.consumeSpaces(),n.expect("]"),n.consume(),a.cols=[{type:"align",align:t}]}}var s=V0(r.parser,a,Et(r.envName)),o=Math.max(0,...s.body.map(h=>h.length));return s.cols=new Array(o).fill({type:"align",align:t}),e?{type:"leftright",mode:r.mode,body:[s],left:e[0],right:e[1],rightColor:void 0}:s},htmlBuilder:z0,mathmlBuilder:A0});M0({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(r){var e={arraystretch:.5},t=V0(r.parser,e,"script");return t.colSeparationType="small",t},htmlBuilder:z0,mathmlBuilder:A0});M0({type:"array",names:["subarray"],props:{numArgs:1},handler(r,e){var t=Ue(e[0]),a=t?[e[0]]:F(e[0],"ordgroup").body,n=a.map(function(o){var h=Tt(o),c=h.text;if("lc".indexOf(c)!==-1)return{type:"align",align:c};throw new M("Unknown column alignment: "+c,o)});if(n.length>1)throw new M("{subarray} can contain only one column");var s={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5};if(s=V0(r.parser,s,"script"),s.body.length>0&&s.body[0].length>1)throw new M("{subarray} can contain only one column");return s},htmlBuilder:z0,mathmlBuilder:A0});M0({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(r){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},t=V0(r.parser,e,Et(r.envName));return{type:"leftright",mode:r.mode,body:[t],left:r.envName.indexOf("r")>-1?".":"\\{",right:r.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:z0,mathmlBuilder:A0});M0({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:ea,htmlBuilder:z0,mathmlBuilder:A0});M0({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(r){N.contains(["gather","gather*"],r.envName)&&Xe(r);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Nt(r.envName),emptySingleRow:!0,leqno:r.parser.settings.leqno};return V0(r.parser,e,"display")},htmlBuilder:z0,mathmlBuilder:A0});M0({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:ea,htmlBuilder:z0,mathmlBuilder:A0});M0({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(r){Xe(r);var e={autoTag:Nt(r.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:r.parser.settings.leqno};return V0(r.parser,e,"display")},htmlBuilder:z0,mathmlBuilder:A0});M0({type:"array",names:["CD"],props:{numArgs:0},handler(r){return Xe(r),I1(r.parser)},htmlBuilder:z0,mathmlBuilder:A0});m("\\nonumber","\\gdef\\@eqnsw{0}");m("\\notag","\\nonumber");B({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(r,e){throw new M(r.funcName+" valid only within array environment")}});var ir=Qr;B({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(r,e){var{parser:t,funcName:a}=r,n=e[0];if(n.type!=="ordgroup")throw new M("Invalid environment name",n);for(var s="",o=0;o{var t=r.font,a=e.withFont(t);return P(r.body,a)},ra=(r,e)=>{var t=r.font,a=e.withFont(t);return Y(r.body,a)},sr={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};B({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(r,e)=>{var{parser:t,funcName:a}=r,n=Fe(e[0]),s=a;return s in sr&&(s=sr[s]),{type:"font",mode:t.mode,font:s.slice(1),body:n}},htmlBuilder:ta,mathmlBuilder:ra});B({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(r,e)=>{var{parser:t}=r,a=e[0],n=N.isCharacterBox(a);return{type:"mclass",mode:t.mode,mclass:$e(a),body:[{type:"font",mode:t.mode,font:"boldsymbol",body:a}],isCharacterBox:n}}});B({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(r,e)=>{var{parser:t,funcName:a,breakOnTokenText:n}=r,{mode:s}=t,o=t.parseExpression(!0,n),h="math"+a.slice(1);return{type:"font",mode:s,font:h,body:{type:"ordgroup",mode:t.mode,body:o}}},htmlBuilder:ta,mathmlBuilder:ra});var aa=(r,e)=>{var t=e;return r==="display"?t=t.id>=R.SCRIPT.id?t.text():R.DISPLAY:r==="text"&&t.size===R.DISPLAY.size?t=R.TEXT:r==="script"?t=R.SCRIPT:r==="scriptscript"&&(t=R.SCRIPTSCRIPT),t},Rt=(r,e)=>{var t=aa(r.size,e.style),a=t.fracNum(),n=t.fracDen(),s;s=e.havingStyle(a);var o=P(r.numer,s,e);if(r.continued){var h=8.5/e.fontMetrics().ptPerEm,c=3.5/e.fontMetrics().ptPerEm;o.height=o.height0?z=3*x:z=7*x,T=e.fontMetrics().denom1):(b>0?(w=e.fontMetrics().num2,z=x):(w=e.fontMetrics().num3,z=3*x),T=e.fontMetrics().denom2);var C;if(g){var O=e.fontMetrics().axisHeight;w-o.depth-(O+.5*b){var t=new S.MathNode("mfrac",[Y(r.numer,e),Y(r.denom,e)]);if(!r.hasBarLine)t.setAttribute("linethickness","0px");else if(r.barSize){var a=J(r.barSize,e);t.setAttribute("linethickness",A(a))}var n=aa(r.size,e.style);if(n.size!==e.style.size){t=new S.MathNode("mstyle",[t]);var s=n.size===R.DISPLAY.size?"true":"false";t.setAttribute("displaystyle",s),t.setAttribute("scriptlevel","0")}if(r.leftDelim!=null||r.rightDelim!=null){var o=[];if(r.leftDelim!=null){var h=new S.MathNode("mo",[new S.TextNode(r.leftDelim.replace("\\",""))]);h.setAttribute("fence","true"),o.push(h)}if(o.push(t),r.rightDelim!=null){var c=new S.MathNode("mo",[new S.TextNode(r.rightDelim.replace("\\",""))]);c.setAttribute("fence","true"),o.push(c)}return zt(o)}return t};B({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(r,e)=>{var{parser:t,funcName:a}=r,n=e[0],s=e[1],o,h=null,c=null,p="auto";switch(a){case"\\dfrac":case"\\frac":case"\\tfrac":o=!0;break;case"\\\\atopfrac":o=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":o=!1,h="(",c=")";break;case"\\\\bracefrac":o=!1,h="\\{",c="\\}";break;case"\\\\brackfrac":o=!1,h="[",c="]";break;default:throw new Error("Unrecognized genfrac command")}switch(a){case"\\dfrac":case"\\dbinom":p="display";break;case"\\tfrac":case"\\tbinom":p="text";break}return{type:"genfrac",mode:t.mode,continued:!1,numer:n,denom:s,hasBarLine:o,leftDelim:h,rightDelim:c,size:p,barSize:null}},htmlBuilder:Rt,mathmlBuilder:It});B({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(r,e)=>{var{parser:t,funcName:a}=r,n=e[0],s=e[1];return{type:"genfrac",mode:t.mode,continued:!0,numer:n,denom:s,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}});B({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(r){var{parser:e,funcName:t,token:a}=r,n;switch(t){case"\\over":n="\\frac";break;case"\\choose":n="\\binom";break;case"\\atop":n="\\\\atopfrac";break;case"\\brace":n="\\\\bracefrac";break;case"\\brack":n="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:n,token:a}}});var lr=["display","text","script","scriptscript"],or=function(e){var t=null;return e.length>0&&(t=e,t=t==="."?null:t),t};B({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(r,e){var{parser:t}=r,a=e[4],n=e[5],s=Fe(e[0]),o=s.type==="atom"&&s.family==="open"?or(s.text):null,h=Fe(e[1]),c=h.type==="atom"&&h.family==="close"?or(h.text):null,p=F(e[2],"size"),g,b=null;p.isBlank?g=!0:(b=p.value,g=b.number>0);var x="auto",w=e[3];if(w.type==="ordgroup"){if(w.body.length>0){var z=F(w.body[0],"textord");x=lr[Number(z.text)]}}else w=F(w,"textord"),x=lr[Number(w.text)];return{type:"genfrac",mode:t.mode,numer:a,denom:n,continued:!1,hasBarLine:g,barSize:b,leftDelim:o,rightDelim:c,size:x}},htmlBuilder:Rt,mathmlBuilder:It});B({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(r,e){var{parser:t,funcName:a,token:n}=r;return{type:"infix",mode:t.mode,replaceWith:"\\\\abovefrac",size:F(e[0],"size").value,token:n}}});B({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(r,e)=>{var{parser:t,funcName:a}=r,n=e[0],s=Ba(F(e[1],"infix").size),o=e[2],h=s.number>0;return{type:"genfrac",mode:t.mode,numer:n,denom:o,continued:!1,hasBarLine:h,barSize:s,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:Rt,mathmlBuilder:It});var na=(r,e)=>{var t=e.style,a,n;r.type==="supsub"?(a=r.sup?P(r.sup,e.havingStyle(t.sup()),e):P(r.sub,e.havingStyle(t.sub()),e),n=F(r.base,"horizBrace")):n=F(r,"horizBrace");var s=P(n.base,e.havingBaseStyle(R.DISPLAY)),o=E0.svgSpan(n,e),h;if(n.isOver?(h=y.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:o}]},e),h.children[0].children[0].children[1].classes.push("svg-align")):(h=y.makeVList({positionType:"bottom",positionData:s.depth+.1+o.height,children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:s}]},e),h.children[0].children[0].children[0].classes.push("svg-align")),a){var c=y.makeSpan(["mord",n.isOver?"mover":"munder"],[h],e);n.isOver?h=y.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:c},{type:"kern",size:.2},{type:"elem",elem:a}]},e):h=y.makeVList({positionType:"bottom",positionData:c.depth+.2+a.height+a.depth,children:[{type:"elem",elem:a},{type:"kern",size:.2},{type:"elem",elem:c}]},e)}return y.makeSpan(["mord",n.isOver?"mover":"munder"],[h],e)},K1=(r,e)=>{var t=E0.mathMLnode(r.label);return new S.MathNode(r.isOver?"mover":"munder",[Y(r.base,e),t])};B({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:a}=r;return{type:"horizBrace",mode:t.mode,label:a,isOver:/^\\over/.test(a),base:e[0]}},htmlBuilder:na,mathmlBuilder:K1});B({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,a=e[1],n=F(e[0],"url").url;return t.settings.isTrusted({command:"\\href",url:n})?{type:"href",mode:t.mode,href:n,body:Q(a)}:t.formatUnsupportedCmd("\\href")},htmlBuilder:(r,e)=>{var t=t0(r.body,e,!1);return y.makeAnchor(r.href,[],t,e)},mathmlBuilder:(r,e)=>{var t=G0(r.body,e);return t instanceof o0||(t=new o0("mrow",[t])),t.setAttribute("href",r.href),t}});B({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,a=F(e[0],"url").url;if(!t.settings.isTrusted({command:"\\url",url:a}))return t.formatUnsupportedCmd("\\url");for(var n=[],s=0;s{var{parser:t,funcName:a,token:n}=r,s=F(e[0],"raw").string,o=e[1];t.settings.strict&&t.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var h,c={};switch(a){case"\\htmlClass":c.class=s,h={command:"\\htmlClass",class:s};break;case"\\htmlId":c.id=s,h={command:"\\htmlId",id:s};break;case"\\htmlStyle":c.style=s,h={command:"\\htmlStyle",style:s};break;case"\\htmlData":{for(var p=s.split(","),g=0;g{var t=t0(r.body,e,!1),a=["enclosing"];r.attributes.class&&a.push(...r.attributes.class.trim().split(/\s+/));var n=y.makeSpan(a,t,e);for(var s in r.attributes)s!=="class"&&r.attributes.hasOwnProperty(s)&&n.setAttribute(s,r.attributes[s]);return n},mathmlBuilder:(r,e)=>G0(r.body,e)});B({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r;return{type:"htmlmathml",mode:t.mode,html:Q(e[0]),mathml:Q(e[1])}},htmlBuilder:(r,e)=>{var t=t0(r.html,e,!1);return y.makeFragment(t)},mathmlBuilder:(r,e)=>G0(r.mathml,e)});var st=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new M("Invalid size: '"+e+"' in \\includegraphics");var a={number:+(t[1]+t[2]),unit:t[3]};if(!Sr(a))throw new M("Invalid unit: '"+a.unit+"' in \\includegraphics.");return a};B({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(r,e,t)=>{var{parser:a}=r,n={number:0,unit:"em"},s={number:.9,unit:"em"},o={number:0,unit:"em"},h="";if(t[0])for(var c=F(t[0],"raw").string,p=c.split(","),g=0;g{var t=J(r.height,e),a=0;r.totalheight.number>0&&(a=J(r.totalheight,e)-t);var n=0;r.width.number>0&&(n=J(r.width,e));var s={height:A(t+a)};n>0&&(s.width=A(n)),a>0&&(s.verticalAlign=A(-a));var o=new ct(r.src,r.alt,s);return o.height=t,o.depth=a,o},mathmlBuilder:(r,e)=>{var t=new S.MathNode("mglyph",[]);t.setAttribute("alt",r.alt);var a=J(r.height,e),n=0;if(r.totalheight.number>0&&(n=J(r.totalheight,e)-a,t.setAttribute("valign",A(-n))),t.setAttribute("height",A(a+n)),r.width.number>0){var s=J(r.width,e);t.setAttribute("width",A(s))}return t.setAttribute("src",r.src),t}});B({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(r,e){var{parser:t,funcName:a}=r,n=F(e[0],"size");if(t.settings.strict){var s=a[1]==="m",o=n.value.unit==="mu";s?(o||t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" supports only mu units, "+("not "+n.value.unit+" units")),t.mode!=="math"&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" works only in math mode")):o&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" doesn't support mu units")}return{type:"kern",mode:t.mode,dimension:n.value}},htmlBuilder(r,e){return y.makeGlue(r.dimension,e)},mathmlBuilder(r,e){var t=J(r.dimension,e);return new S.SpaceNode(t)}});B({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t,funcName:a}=r,n=e[0];return{type:"lap",mode:t.mode,alignment:a.slice(5),body:n}},htmlBuilder:(r,e)=>{var t;r.alignment==="clap"?(t=y.makeSpan([],[P(r.body,e)]),t=y.makeSpan(["inner"],[t],e)):t=y.makeSpan(["inner"],[P(r.body,e)]);var a=y.makeSpan(["fix"],[]),n=y.makeSpan([r.alignment],[t,a],e),s=y.makeSpan(["strut"]);return s.style.height=A(n.height+n.depth),n.depth&&(s.style.verticalAlign=A(-n.depth)),n.children.unshift(s),n=y.makeSpan(["thinbox"],[n],e),y.makeSpan(["mord","vbox"],[n],e)},mathmlBuilder:(r,e)=>{var t=new S.MathNode("mpadded",[Y(r.body,e)]);if(r.alignment!=="rlap"){var a=r.alignment==="llap"?"-1":"-0.5";t.setAttribute("lspace",a+"width")}return t.setAttribute("width","0px"),t}});B({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(r,e){var{funcName:t,parser:a}=r,n=a.mode;a.switchMode("math");var s=t==="\\("?"\\)":"$",o=a.parseExpression(!1,s);return a.expect(s),a.switchMode(n),{type:"styling",mode:a.mode,style:"text",body:o}}});B({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(r,e){throw new M("Mismatched "+r.funcName)}});var ur=(r,e)=>{switch(e.style.size){case R.DISPLAY.size:return r.display;case R.TEXT.size:return r.text;case R.SCRIPT.size:return r.script;case R.SCRIPTSCRIPT.size:return r.scriptscript;default:return r.text}};B({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(r,e)=>{var{parser:t}=r;return{type:"mathchoice",mode:t.mode,display:Q(e[0]),text:Q(e[1]),script:Q(e[2]),scriptscript:Q(e[3])}},htmlBuilder:(r,e)=>{var t=ur(r,e),a=t0(t,e,!1);return y.makeFragment(a)},mathmlBuilder:(r,e)=>{var t=ur(r,e);return G0(t,e)}});var ia=(r,e,t,a,n,s,o)=>{r=y.makeSpan([],[r]);var h=t&&N.isCharacterBox(t),c,p;if(e){var g=P(e,a.havingStyle(n.sup()),a);p={elem:g,kern:Math.max(a.fontMetrics().bigOpSpacing1,a.fontMetrics().bigOpSpacing3-g.depth)}}if(t){var b=P(t,a.havingStyle(n.sub()),a);c={elem:b,kern:Math.max(a.fontMetrics().bigOpSpacing2,a.fontMetrics().bigOpSpacing4-b.height)}}var x;if(p&&c){var w=a.fontMetrics().bigOpSpacing5+c.elem.height+c.elem.depth+c.kern+r.depth+o;x=y.makeVList({positionType:"bottom",positionData:w,children:[{type:"kern",size:a.fontMetrics().bigOpSpacing5},{type:"elem",elem:c.elem,marginLeft:A(-s)},{type:"kern",size:c.kern},{type:"elem",elem:r},{type:"kern",size:p.kern},{type:"elem",elem:p.elem,marginLeft:A(s)},{type:"kern",size:a.fontMetrics().bigOpSpacing5}]},a)}else if(c){var z=r.height-o;x=y.makeVList({positionType:"top",positionData:z,children:[{type:"kern",size:a.fontMetrics().bigOpSpacing5},{type:"elem",elem:c.elem,marginLeft:A(-s)},{type:"kern",size:c.kern},{type:"elem",elem:r}]},a)}else if(p){var T=r.depth+o;x=y.makeVList({positionType:"bottom",positionData:T,children:[{type:"elem",elem:r},{type:"kern",size:p.kern},{type:"elem",elem:p.elem,marginLeft:A(s)},{type:"kern",size:a.fontMetrics().bigOpSpacing5}]},a)}else return r;var C=[x];if(c&&s!==0&&!h){var q=y.makeSpan(["mspace"],[],a);q.style.marginRight=A(s),C.unshift(q)}return y.makeSpan(["mop","op-limits"],C,a)},sa=["\\smallint"],ne=(r,e)=>{var t,a,n=!1,s;r.type==="supsub"?(t=r.sup,a=r.sub,s=F(r.base,"op"),n=!0):s=F(r,"op");var o=e.style,h=!1;o.size===R.DISPLAY.size&&s.symbol&&!N.contains(sa,s.name)&&(h=!0);var c;if(s.symbol){var p=h?"Size2-Regular":"Size1-Regular",g="";if((s.name==="\\oiint"||s.name==="\\oiiint")&&(g=s.name.slice(1),s.name=g==="oiint"?"\\iint":"\\iiint"),c=y.makeSymbol(s.name,p,"math",e,["mop","op-symbol",h?"large-op":"small-op"]),g.length>0){var b=c.italic,x=y.staticSvg(g+"Size"+(h?"2":"1"),e);c=y.makeVList({positionType:"individualShift",children:[{type:"elem",elem:c,shift:0},{type:"elem",elem:x,shift:h?.08:0}]},e),s.name="\\"+g,c.classes.unshift("mop"),c.italic=b}}else if(s.body){var w=t0(s.body,e,!0);w.length===1&&w[0]instanceof u0?(c=w[0],c.classes[0]="mop"):c=y.makeSpan(["mop"],w,e)}else{for(var z=[],T=1;T{var t;if(r.symbol)t=new o0("mo",[v0(r.name,r.mode)]),N.contains(sa,r.name)&&t.setAttribute("largeop","false");else if(r.body)t=new o0("mo",h0(r.body,e));else{t=new o0("mi",[new Y0(r.name.slice(1))]);var a=new o0("mo",[v0("\u2061","text")]);r.parentIsSupSub?t=new o0("mrow",[t,a]):t=Rr([t,a])}return t},J1={"\u220F":"\\prod","\u2210":"\\coprod","\u2211":"\\sum","\u22C0":"\\bigwedge","\u22C1":"\\bigvee","\u22C2":"\\bigcap","\u22C3":"\\bigcup","\u2A00":"\\bigodot","\u2A01":"\\bigoplus","\u2A02":"\\bigotimes","\u2A04":"\\biguplus","\u2A06":"\\bigsqcup"};B({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\u220F","\u2210","\u2211","\u22C0","\u22C1","\u22C2","\u22C3","\u2A00","\u2A01","\u2A02","\u2A04","\u2A06"],props:{numArgs:0},handler:(r,e)=>{var{parser:t,funcName:a}=r,n=a;return n.length===1&&(n=J1[n]),{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:ne,mathmlBuilder:pe});B({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var{parser:t}=r,a=e[0];return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Q(a)}},htmlBuilder:ne,mathmlBuilder:pe});var Q1={"\u222B":"\\int","\u222C":"\\iint","\u222D":"\\iiint","\u222E":"\\oint","\u222F":"\\oiint","\u2230":"\\oiiint"};B({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(r){var{parser:e,funcName:t}=r;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:ne,mathmlBuilder:pe});B({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(r){var{parser:e,funcName:t}=r;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:ne,mathmlBuilder:pe});B({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\u222B","\u222C","\u222D","\u222E","\u222F","\u2230"],props:{numArgs:0},handler(r){var{parser:e,funcName:t}=r,a=t;return a.length===1&&(a=Q1[a]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:a}},htmlBuilder:ne,mathmlBuilder:pe});var la=(r,e)=>{var t,a,n=!1,s;r.type==="supsub"?(t=r.sup,a=r.sub,s=F(r.base,"operatorname"),n=!0):s=F(r,"operatorname");var o;if(s.body.length>0){for(var h=s.body.map(b=>{var x=b.text;return typeof x=="string"?{type:"textord",mode:b.mode,text:x}:b}),c=t0(h,e.withFont("mathrm"),!0),p=0;p{for(var t=h0(r.body,e.withFont("mathrm")),a=!0,n=0;ng.toText()).join("");t=[new S.TextNode(h)]}var c=new S.MathNode("mi",t);c.setAttribute("mathvariant","normal");var p=new S.MathNode("mo",[v0("\u2061","text")]);return r.parentIsSupSub?new S.MathNode("mrow",[c,p]):S.newDocumentFragment([c,p])};B({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(r,e)=>{var{parser:t,funcName:a}=r,n=e[0];return{type:"operatorname",mode:t.mode,body:Q(n),alwaysHandleSupSub:a==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:la,mathmlBuilder:_1});m("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");j0({type:"ordgroup",htmlBuilder(r,e){return r.semisimple?y.makeFragment(t0(r.body,e,!1)):y.makeSpan(["mord"],t0(r.body,e,!0),e)},mathmlBuilder(r,e){return G0(r.body,e,!0)}});B({type:"overline",names:["\\overline"],props:{numArgs:1},handler(r,e){var{parser:t}=r,a=e[0];return{type:"overline",mode:t.mode,body:a}},htmlBuilder(r,e){var t=P(r.body,e.havingCrampedStyle()),a=y.makeLineSpan("overline-line",e),n=e.fontMetrics().defaultRuleThickness,s=y.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:t},{type:"kern",size:3*n},{type:"elem",elem:a},{type:"kern",size:n}]},e);return y.makeSpan(["mord","overline"],[s],e)},mathmlBuilder(r,e){var t=new S.MathNode("mo",[new S.TextNode("\u203E")]);t.setAttribute("stretchy","true");var a=new S.MathNode("mover",[Y(r.body,e),t]);return a.setAttribute("accent","true"),a}});B({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,a=e[0];return{type:"phantom",mode:t.mode,body:Q(a)}},htmlBuilder:(r,e)=>{var t=t0(r.body,e.withPhantom(),!1);return y.makeFragment(t)},mathmlBuilder:(r,e)=>{var t=h0(r.body,e);return new S.MathNode("mphantom",t)}});B({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,a=e[0];return{type:"hphantom",mode:t.mode,body:a}},htmlBuilder:(r,e)=>{var t=y.makeSpan([],[P(r.body,e.withPhantom())]);if(t.height=0,t.depth=0,t.children)for(var a=0;a{var t=h0(Q(r.body),e),a=new S.MathNode("mphantom",t),n=new S.MathNode("mpadded",[a]);return n.setAttribute("height","0px"),n.setAttribute("depth","0px"),n}});B({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,a=e[0];return{type:"vphantom",mode:t.mode,body:a}},htmlBuilder:(r,e)=>{var t=y.makeSpan(["inner"],[P(r.body,e.withPhantom())]),a=y.makeSpan(["fix"],[]);return y.makeSpan(["mord","rlap"],[t,a],e)},mathmlBuilder:(r,e)=>{var t=h0(Q(r.body),e),a=new S.MathNode("mphantom",t),n=new S.MathNode("mpadded",[a]);return n.setAttribute("width","0px"),n}});B({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(r,e){var{parser:t}=r,a=F(e[0],"size").value,n=e[1];return{type:"raisebox",mode:t.mode,dy:a,body:n}},htmlBuilder(r,e){var t=P(r.body,e),a=J(r.dy,e);return y.makeVList({positionType:"shift",positionData:-a,children:[{type:"elem",elem:t}]},e)},mathmlBuilder(r,e){var t=new S.MathNode("mpadded",[Y(r.body,e)]),a=r.dy.number+r.dy.unit;return t.setAttribute("voffset",a),t}});B({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0},handler(r){var{parser:e}=r;return{type:"internal",mode:e.mode}}});B({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,argTypes:["size","size","size"]},handler(r,e,t){var{parser:a}=r,n=t[0],s=F(e[0],"size"),o=F(e[1],"size");return{type:"rule",mode:a.mode,shift:n&&F(n,"size").value,width:s.value,height:o.value}},htmlBuilder(r,e){var t=y.makeSpan(["mord","rule"],[],e),a=J(r.width,e),n=J(r.height,e),s=r.shift?J(r.shift,e):0;return t.style.borderRightWidth=A(a),t.style.borderTopWidth=A(n),t.style.bottom=A(s),t.width=a,t.height=n+s,t.depth=-s,t.maxFontSize=n*1.125*e.sizeMultiplier,t},mathmlBuilder(r,e){var t=J(r.width,e),a=J(r.height,e),n=r.shift?J(r.shift,e):0,s=e.color&&e.getColor()||"black",o=new S.MathNode("mspace");o.setAttribute("mathbackground",s),o.setAttribute("width",A(t)),o.setAttribute("height",A(a));var h=new S.MathNode("mpadded",[o]);return n>=0?h.setAttribute("height",A(n)):(h.setAttribute("height",A(n)),h.setAttribute("depth",A(-n))),h.setAttribute("voffset",A(n)),h}});function oa(r,e,t){for(var a=t0(r,e,!1),n=e.sizeMultiplier/t.sizeMultiplier,s=0;s{var t=e.havingSize(r.size);return oa(r.body,t,e)};B({type:"sizing",names:hr,props:{numArgs:0,allowedInText:!0},handler:(r,e)=>{var{breakOnTokenText:t,funcName:a,parser:n}=r,s=n.parseExpression(!1,t);return{type:"sizing",mode:n.mode,size:hr.indexOf(a)+1,body:s}},htmlBuilder:e4,mathmlBuilder:(r,e)=>{var t=e.havingSize(r.size),a=h0(r.body,t),n=new S.MathNode("mstyle",a);return n.setAttribute("mathsize",A(t.sizeMultiplier)),n}});B({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(r,e,t)=>{var{parser:a}=r,n=!1,s=!1,o=t[0]&&F(t[0],"ordgroup");if(o)for(var h="",c=0;c{var t=y.makeSpan([],[P(r.body,e)]);if(!r.smashHeight&&!r.smashDepth)return t;if(r.smashHeight&&(t.height=0,t.children))for(var a=0;a{var t=new S.MathNode("mpadded",[Y(r.body,e)]);return r.smashHeight&&t.setAttribute("height","0px"),r.smashDepth&&t.setAttribute("depth","0px"),t}});B({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(r,e,t){var{parser:a}=r,n=t[0],s=e[0];return{type:"sqrt",mode:a.mode,body:s,index:n}},htmlBuilder(r,e){var t=P(r.body,e.havingCrampedStyle());t.height===0&&(t.height=e.fontMetrics().xHeight),t=y.wrapFragment(t,e);var a=e.fontMetrics(),n=a.defaultRuleThickness,s=n;e.style.idt.height+t.depth+o&&(o=(o+b-t.height-t.depth)/2);var x=c.height-t.height-o-p;t.style.paddingLeft=A(g);var w=y.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:t,wrapperClasses:["svg-align"]},{type:"kern",size:-(t.height+x)},{type:"elem",elem:c},{type:"kern",size:p}]},e);if(r.index){var z=e.havingStyle(R.SCRIPTSCRIPT),T=P(r.index,z,e),C=.6*(w.height-w.depth),q=y.makeVList({positionType:"shift",positionData:-C,children:[{type:"elem",elem:T}]},e),O=y.makeSpan(["root"],[q]);return y.makeSpan(["mord","sqrt"],[O,w],e)}else return y.makeSpan(["mord","sqrt"],[w],e)},mathmlBuilder(r,e){var{body:t,index:a}=r;return a?new S.MathNode("mroot",[Y(t,e),Y(a,e)]):new S.MathNode("msqrt",[Y(t,e)])}});var mr={display:R.DISPLAY,text:R.TEXT,script:R.SCRIPT,scriptscript:R.SCRIPTSCRIPT};B({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r,e){var{breakOnTokenText:t,funcName:a,parser:n}=r,s=n.parseExpression(!0,t),o=a.slice(1,a.length-5);return{type:"styling",mode:n.mode,style:o,body:s}},htmlBuilder(r,e){var t=mr[r.style],a=e.havingStyle(t).withFont("");return oa(r.body,a,e)},mathmlBuilder(r,e){var t=mr[r.style],a=e.havingStyle(t),n=h0(r.body,a),s=new S.MathNode("mstyle",n),o={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},h=o[r.style];return s.setAttribute("scriptlevel",h[0]),s.setAttribute("displaystyle",h[1]),s}});var t4=function(e,t){var a=e.base;if(a)if(a.type==="op"){var n=a.limits&&(t.style.size===R.DISPLAY.size||a.alwaysHandleSupSub);return n?ne:null}else if(a.type==="operatorname"){var s=a.alwaysHandleSupSub&&(t.style.size===R.DISPLAY.size||a.limits);return s?la:null}else{if(a.type==="accent")return N.isCharacterBox(a.base)?Bt:null;if(a.type==="horizBrace"){var o=!e.sub;return o===a.isOver?na:null}else return null}else return null};j0({type:"supsub",htmlBuilder(r,e){var t=t4(r,e);if(t)return t(r,e);var{base:a,sup:n,sub:s}=r,o=P(a,e),h,c,p=e.fontMetrics(),g=0,b=0,x=a&&N.isCharacterBox(a);if(n){var w=e.havingStyle(e.style.sup());h=P(n,w,e),x||(g=o.height-w.fontMetrics().supDrop*w.sizeMultiplier/e.sizeMultiplier)}if(s){var z=e.havingStyle(e.style.sub());c=P(s,z,e),x||(b=o.depth+z.fontMetrics().subDrop*z.sizeMultiplier/e.sizeMultiplier)}var T;e.style===R.DISPLAY?T=p.sup1:e.style.cramped?T=p.sup3:T=p.sup2;var C=e.sizeMultiplier,q=A(.5/p.ptPerEm/C),O=null;if(c){var H=r.base&&r.base.type==="op"&&r.base.name&&(r.base.name==="\\oiint"||r.base.name==="\\oiiint");(o instanceof u0||H)&&(O=A(-o.italic))}var V;if(h&&c){g=Math.max(g,T,h.depth+.25*p.xHeight),b=Math.max(b,p.sub2);var L=p.defaultRuleThickness,U=4*L;if(g-h.depth-(c.height-b)0&&(g+=G,b-=G)}var j=[{type:"elem",elem:c,shift:b,marginRight:q,marginLeft:O},{type:"elem",elem:h,shift:-g,marginRight:q}];V=y.makeVList({positionType:"individualShift",children:j},e)}else if(c){b=Math.max(b,p.sub1,c.height-.8*p.xHeight);var $=[{type:"elem",elem:c,marginLeft:O,marginRight:q}];V=y.makeVList({positionType:"shift",positionData:b,children:$},e)}else if(h)g=Math.max(g,T,h.depth+.25*p.xHeight),V=y.makeVList({positionType:"shift",positionData:-g,children:[{type:"elem",elem:h,marginRight:q}]},e);else throw new Error("supsub must have either sup or sub.");var T0=ft(o,"right")||"mord";return y.makeSpan([T0],[o,y.makeSpan(["msupsub"],[V])],e)},mathmlBuilder(r,e){var t=!1,a,n;r.base&&r.base.type==="horizBrace"&&(n=!!r.sup,n===r.base.isOver&&(t=!0,a=r.base.isOver)),r.base&&(r.base.type==="op"||r.base.type==="operatorname")&&(r.base.parentIsSupSub=!0);var s=[Y(r.base,e)];r.sub&&s.push(Y(r.sub,e)),r.sup&&s.push(Y(r.sup,e));var o;if(t)o=a?"mover":"munder";else if(r.sub)if(r.sup){var p=r.base;p&&p.type==="op"&&p.limits&&e.style===R.DISPLAY||p&&p.type==="operatorname"&&p.alwaysHandleSupSub&&(e.style===R.DISPLAY||p.limits)?o="munderover":o="msubsup"}else{var c=r.base;c&&c.type==="op"&&c.limits&&(e.style===R.DISPLAY||c.alwaysHandleSupSub)||c&&c.type==="operatorname"&&c.alwaysHandleSupSub&&(c.limits||e.style===R.DISPLAY)?o="munder":o="msub"}else{var h=r.base;h&&h.type==="op"&&h.limits&&(e.style===R.DISPLAY||h.alwaysHandleSupSub)||h&&h.type==="operatorname"&&h.alwaysHandleSupSub&&(h.limits||e.style===R.DISPLAY)?o="mover":o="msup"}return new S.MathNode(o,s)}});j0({type:"atom",htmlBuilder(r,e){return y.mathsym(r.text,r.mode,e,["m"+r.family])},mathmlBuilder(r,e){var t=new S.MathNode("mo",[v0(r.text,r.mode)]);if(r.family==="bin"){var a=At(r,e);a==="bold-italic"&&t.setAttribute("mathvariant",a)}else r.family==="punct"?t.setAttribute("separator","true"):(r.family==="open"||r.family==="close")&&t.setAttribute("stretchy","false");return t}});var ua={mi:"italic",mn:"normal",mtext:"normal"};j0({type:"mathord",htmlBuilder(r,e){return y.makeOrd(r,e,"mathord")},mathmlBuilder(r,e){var t=new S.MathNode("mi",[v0(r.text,r.mode,e)]),a=At(r,e)||"italic";return a!==ua[t.type]&&t.setAttribute("mathvariant",a),t}});j0({type:"textord",htmlBuilder(r,e){return y.makeOrd(r,e,"textord")},mathmlBuilder(r,e){var t=v0(r.text,r.mode,e),a=At(r,e)||"normal",n;return r.mode==="text"?n=new S.MathNode("mtext",[t]):/[0-9]/.test(r.text)?n=new S.MathNode("mn",[t]):r.text==="\\prime"?n=new S.MathNode("mo",[t]):n=new S.MathNode("mi",[t]),a!==ua[n.type]&&n.setAttribute("mathvariant",a),n}});var lt={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},ot={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};j0({type:"spacing",htmlBuilder(r,e){if(ot.hasOwnProperty(r.text)){var t=ot[r.text].className||"";if(r.mode==="text"){var a=y.makeOrd(r,e,"textord");return a.classes.push(t),a}else return y.makeSpan(["mspace",t],[y.mathsym(r.text,r.mode,e)],e)}else{if(lt.hasOwnProperty(r.text))return y.makeSpan(["mspace",lt[r.text]],[],e);throw new M('Unknown type of space "'+r.text+'"')}},mathmlBuilder(r,e){var t;if(ot.hasOwnProperty(r.text))t=new S.MathNode("mtext",[new S.TextNode("\xA0")]);else{if(lt.hasOwnProperty(r.text))return new S.MathNode("mspace");throw new M('Unknown type of space "'+r.text+'"')}return t}});var cr=()=>{var r=new S.MathNode("mtd",[]);return r.setAttribute("width","50%"),r};j0({type:"tag",mathmlBuilder(r,e){var t=new S.MathNode("mtable",[new S.MathNode("mtr",[cr(),new S.MathNode("mtd",[G0(r.body,e)]),cr(),new S.MathNode("mtd",[G0(r.tag,e)])])]);return t.setAttribute("width","100%"),t}});var dr={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},fr={"\\textbf":"textbf","\\textmd":"textmd"},r4={"\\textit":"textit","\\textup":"textup"},pr=(r,e)=>{var t=r.font;if(t){if(dr[t])return e.withTextFontFamily(dr[t]);if(fr[t])return e.withTextFontWeight(fr[t]);if(t==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(r4[t])};B({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(r,e){var{parser:t,funcName:a}=r,n=e[0];return{type:"text",mode:t.mode,body:Q(n),font:a}},htmlBuilder(r,e){var t=pr(r,e),a=t0(r.body,t,!0);return y.makeSpan(["mord","text"],a,t)},mathmlBuilder(r,e){var t=pr(r,e);return G0(r.body,t)}});B({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"underline",mode:t.mode,body:e[0]}},htmlBuilder(r,e){var t=P(r.body,e),a=y.makeLineSpan("underline-line",e),n=e.fontMetrics().defaultRuleThickness,s=y.makeVList({positionType:"top",positionData:t.height,children:[{type:"kern",size:n},{type:"elem",elem:a},{type:"kern",size:3*n},{type:"elem",elem:t}]},e);return y.makeSpan(["mord","underline"],[s],e)},mathmlBuilder(r,e){var t=new S.MathNode("mo",[new S.TextNode("\u203E")]);t.setAttribute("stretchy","true");var a=new S.MathNode("munder",[Y(r.body,e),t]);return a.setAttribute("accentunder","true"),a}});B({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(r,e){var{parser:t}=r;return{type:"vcenter",mode:t.mode,body:e[0]}},htmlBuilder(r,e){var t=P(r.body,e),a=e.fontMetrics().axisHeight,n=.5*(t.height-a-(t.depth+a));return y.makeVList({positionType:"shift",positionData:n,children:[{type:"elem",elem:t}]},e)},mathmlBuilder(r,e){return new S.MathNode("mpadded",[Y(r.body,e)],["vcenter"])}});B({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(r,e,t){throw new M("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(r,e){for(var t=vr(r),a=[],n=e.havingStyle(e.style.text()),s=0;sr.body.replace(/ /g,r.star?"\u2423":"\xA0"),L0=Nr,ha=`[ \r
]`,a4="\\\\[a-zA-Z@]+",n4="\\\\[^\uD800-\uDFFF]",i4="("+a4+")"+ha+"*",s4=`\\\\(
|[ \r ]+
?)[ \r ]*`,yt="[\u0300-\u036F]",l4=new RegExp(yt+"+$"),o4="("+ha+"+)|"+(s4+"|")+"([!-\\[\\]-\u2027\u202A-\uD7FF\uF900-\uFFFF]"+(yt+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(yt+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+i4)+("|"+n4+")"),Le=class{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(o4,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new p0("EOF",new m0(this,t,t));var a=this.tokenRegex.exec(e);if(a===null||a.index!==t)throw new M("Unexpected character: '"+e[t]+"'",new p0(e[t],new m0(this,t,t+1)));var n=a[6]||a[3]||(a[2]?"\\ ":" ");if(this.catcodes[n]===14){var s=e.indexOf(`
-`,this.tokenRegex.lastIndex);return s===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=s+1,this.lex()}return new p0(n,new m0(this,t,this.tokenRegex.lastIndex))}},xt=class{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new M("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(e[t]==null?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,a){if(a===void 0&&(a=!1),a){for(var n=0;n0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var s=this.undefStack[this.undefStack.length-1];s&&!s.hasOwnProperty(e)&&(s[e]=this.current[e])}t==null?delete this.current[e]:this.current[e]=t}},u4=_r;m("\\noexpand",function(r){var e=r.popToken();return r.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});m("\\expandafter",function(r){var e=r.popToken();return r.expandOnce(!0),{tokens:[e],numArgs:0}});m("\\@firstoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[0],numArgs:0}});m("\\@secondoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[1],numArgs:0}});m("\\@ifnextchar",function(r){var e=r.consumeArgs(3);r.consumeSpaces();var t=r.future();return e[0].length===1&&e[0][0].text===t.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});m("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");m("\\TextOrMath",function(r){var e=r.consumeArgs(2);return r.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var gr={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};m("\\char",function(r){var e=r.popToken(),t,a="";if(e.text==="'")t=8,e=r.popToken();else if(e.text==='"')t=16,e=r.popToken();else if(e.text==="`")if(e=r.popToken(),e.text[0]==="\\")a=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new M("\\char` missing argument");a=e.text.charCodeAt(0)}else t=10;if(t){if(a=gr[e.text],a==null||a>=t)throw new M("Invalid base-"+t+" digit "+e.text);for(var n;(n=gr[r.future().text])!=null&&n{var a=r.consumeArg().tokens;if(a.length!==1)throw new M("\\newcommand's first argument must be a macro name");var n=a[0].text,s=r.isDefined(n);if(s&&!e)throw new M("\\newcommand{"+n+"} attempting to redefine "+(n+"; use \\renewcommand"));if(!s&&!t)throw new M("\\renewcommand{"+n+"} when command "+n+" does not yet exist; use \\newcommand");var o=0;if(a=r.consumeArg().tokens,a.length===1&&a[0].text==="["){for(var h="",c=r.expandNextToken();c.text!=="]"&&c.text!=="EOF";)h+=c.text,c=r.expandNextToken();if(!h.match(/^\s*[0-9]+\s*$/))throw new M("Invalid number of arguments: "+h);o=parseInt(h),a=r.consumeArg().tokens}return r.macros.set(n,{tokens:a,numArgs:o}),""};m("\\newcommand",r=>Ot(r,!1,!0));m("\\renewcommand",r=>Ot(r,!0,!1));m("\\providecommand",r=>Ot(r,!0,!0));m("\\message",r=>{var e=r.consumeArgs(1)[0];return console.log(e.reverse().map(t=>t.text).join("")),""});m("\\errmessage",r=>{var e=r.consumeArgs(1)[0];return console.error(e.reverse().map(t=>t.text).join("")),""});m("\\show",r=>{var e=r.popToken(),t=e.text;return console.log(e,r.macros.get(t),L0[t],X.math[t],X.text[t]),""});m("\\bgroup","{");m("\\egroup","}");m("~","\\nobreakspace");m("\\lq","`");m("\\rq","'");m("\\aa","\\r a");m("\\AA","\\r A");m("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`\xA9}");m("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");m("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`\xAE}");m("\u212C","\\mathscr{B}");m("\u2130","\\mathscr{E}");m("\u2131","\\mathscr{F}");m("\u210B","\\mathscr{H}");m("\u2110","\\mathscr{I}");m("\u2112","\\mathscr{L}");m("\u2133","\\mathscr{M}");m("\u211B","\\mathscr{R}");m("\u212D","\\mathfrak{C}");m("\u210C","\\mathfrak{H}");m("\u2128","\\mathfrak{Z}");m("\\Bbbk","\\Bbb{k}");m("\xB7","\\cdotp");m("\\llap","\\mathllap{\\textrm{#1}}");m("\\rlap","\\mathrlap{\\textrm{#1}}");m("\\clap","\\mathclap{\\textrm{#1}}");m("\\mathstrut","\\vphantom{(}");m("\\underbar","\\underline{\\text{#1}}");m("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');m("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`\u2260}}");m("\\ne","\\neq");m("\u2260","\\neq");m("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`\u2209}}");m("\u2209","\\notin");m("\u2258","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`\u2258}}");m("\u2259","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`\u2258}}");m("\u225A","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`\u225A}}");m("\u225B","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`\u225B}}");m("\u225D","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`\u225D}}");m("\u225E","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`\u225E}}");m("\u225F","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`\u225F}}");m("\u27C2","\\perp");m("\u203C","\\mathclose{!\\mkern-0.8mu!}");m("\u220C","\\notni");m("\u231C","\\ulcorner");m("\u231D","\\urcorner");m("\u231E","\\llcorner");m("\u231F","\\lrcorner");m("\xA9","\\copyright");m("\xAE","\\textregistered");m("\uFE0F","\\textregistered");m("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');m("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');m("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');m("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');m("\\vdots","\\mathord{\\varvdots\\rule{0pt}{15pt}}");m("\u22EE","\\vdots");m("\\varGamma","\\mathit{\\Gamma}");m("\\varDelta","\\mathit{\\Delta}");m("\\varTheta","\\mathit{\\Theta}");m("\\varLambda","\\mathit{\\Lambda}");m("\\varXi","\\mathit{\\Xi}");m("\\varPi","\\mathit{\\Pi}");m("\\varSigma","\\mathit{\\Sigma}");m("\\varUpsilon","\\mathit{\\Upsilon}");m("\\varPhi","\\mathit{\\Phi}");m("\\varPsi","\\mathit{\\Psi}");m("\\varOmega","\\mathit{\\Omega}");m("\\substack","\\begin{subarray}{c}#1\\end{subarray}");m("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");m("\\boxed","\\fbox{$\\displaystyle{#1}$}");m("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");m("\\implies","\\DOTSB\\;\\Longrightarrow\\;");m("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");var br={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};m("\\dots",function(r){var e="\\dotso",t=r.expandAfterFuture().text;return t in br?e=br[t]:(t.slice(0,4)==="\\not"||t in X.math&&N.contains(["bin","rel"],X.math[t].group))&&(e="\\dotsb"),e});var Ht={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};m("\\dotso",function(r){var e=r.future().text;return e in Ht?"\\ldots\\,":"\\ldots"});m("\\dotsc",function(r){var e=r.future().text;return e in Ht&&e!==","?"\\ldots\\,":"\\ldots"});m("\\cdots",function(r){var e=r.future().text;return e in Ht?"\\@cdots\\,":"\\@cdots"});m("\\dotsb","\\cdots");m("\\dotsm","\\cdots");m("\\dotsi","\\!\\cdots");m("\\dotsx","\\ldots\\,");m("\\DOTSI","\\relax");m("\\DOTSB","\\relax");m("\\DOTSX","\\relax");m("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");m("\\,","\\tmspace+{3mu}{.1667em}");m("\\thinspace","\\,");m("\\>","\\mskip{4mu}");m("\\:","\\tmspace+{4mu}{.2222em}");m("\\medspace","\\:");m("\\;","\\tmspace+{5mu}{.2777em}");m("\\thickspace","\\;");m("\\!","\\tmspace-{3mu}{.1667em}");m("\\negthinspace","\\!");m("\\negmedspace","\\tmspace-{4mu}{.2222em}");m("\\negthickspace","\\tmspace-{5mu}{.277em}");m("\\enspace","\\kern.5em ");m("\\enskip","\\hskip.5em\\relax");m("\\quad","\\hskip1em\\relax");m("\\qquad","\\hskip2em\\relax");m("\\tag","\\@ifstar\\tag@literal\\tag@paren");m("\\tag@paren","\\tag@literal{({#1})}");m("\\tag@literal",r=>{if(r.macros.get("\\df@tag"))throw new M("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});m("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");m("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");m("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");m("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");m("\\newline","\\\\\\relax");m("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var ma=A(k0["Main-Regular"][84][1]-.7*k0["Main-Regular"][65][1]);m("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+ma+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");m("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+ma+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");m("\\hspace","\\@ifstar\\@hspacer\\@hspace");m("\\@hspace","\\hskip #1\\relax");m("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");m("\\ordinarycolon",":");m("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");m("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');m("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');m("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');m("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');m("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');m("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');m("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');m("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');m("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');m("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');m("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');m("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');m("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');m("\u2237","\\dblcolon");m("\u2239","\\eqcolon");m("\u2254","\\coloneqq");m("\u2255","\\eqqcolon");m("\u2A74","\\Coloneqq");m("\\ratio","\\vcentcolon");m("\\coloncolon","\\dblcolon");m("\\colonequals","\\coloneqq");m("\\coloncolonequals","\\Coloneqq");m("\\equalscolon","\\eqqcolon");m("\\equalscoloncolon","\\Eqqcolon");m("\\colonminus","\\coloneq");m("\\coloncolonminus","\\Coloneq");m("\\minuscolon","\\eqcolon");m("\\minuscoloncolon","\\Eqcolon");m("\\coloncolonapprox","\\Colonapprox");m("\\coloncolonsim","\\Colonsim");m("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");m("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");m("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");m("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");m("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`\u220C}}");m("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");m("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");m("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");m("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");m("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");m("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");m("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");m("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");m("\\gvertneqq","\\html@mathml{\\@gvertneqq}{\u2269}");m("\\lvertneqq","\\html@mathml{\\@lvertneqq}{\u2268}");m("\\ngeqq","\\html@mathml{\\@ngeqq}{\u2271}");m("\\ngeqslant","\\html@mathml{\\@ngeqslant}{\u2271}");m("\\nleqq","\\html@mathml{\\@nleqq}{\u2270}");m("\\nleqslant","\\html@mathml{\\@nleqslant}{\u2270}");m("\\nshortmid","\\html@mathml{\\@nshortmid}{\u2224}");m("\\nshortparallel","\\html@mathml{\\@nshortparallel}{\u2226}");m("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{\u2288}");m("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{\u2289}");m("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{\u228A}");m("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{\u2ACB}");m("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{\u228B}");m("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{\u2ACC}");m("\\imath","\\html@mathml{\\@imath}{\u0131}");m("\\jmath","\\html@mathml{\\@jmath}{\u0237}");m("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`\u27E6}}");m("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`\u27E7}}");m("\u27E6","\\llbracket");m("\u27E7","\\rrbracket");m("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`\u2983}}");m("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`\u2984}}");m("\u2983","\\lBrace");m("\u2984","\\rBrace");m("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`\u29B5}}");m("\u29B5","\\minuso");m("\\darr","\\downarrow");m("\\dArr","\\Downarrow");m("\\Darr","\\Downarrow");m("\\lang","\\langle");m("\\rang","\\rangle");m("\\uarr","\\uparrow");m("\\uArr","\\Uparrow");m("\\Uarr","\\Uparrow");m("\\N","\\mathbb{N}");m("\\R","\\mathbb{R}");m("\\Z","\\mathbb{Z}");m("\\alef","\\aleph");m("\\alefsym","\\aleph");m("\\Alpha","\\mathrm{A}");m("\\Beta","\\mathrm{B}");m("\\bull","\\bullet");m("\\Chi","\\mathrm{X}");m("\\clubs","\\clubsuit");m("\\cnums","\\mathbb{C}");m("\\Complex","\\mathbb{C}");m("\\Dagger","\\ddagger");m("\\diamonds","\\diamondsuit");m("\\empty","\\emptyset");m("\\Epsilon","\\mathrm{E}");m("\\Eta","\\mathrm{H}");m("\\exist","\\exists");m("\\harr","\\leftrightarrow");m("\\hArr","\\Leftrightarrow");m("\\Harr","\\Leftrightarrow");m("\\hearts","\\heartsuit");m("\\image","\\Im");m("\\infin","\\infty");m("\\Iota","\\mathrm{I}");m("\\isin","\\in");m("\\Kappa","\\mathrm{K}");m("\\larr","\\leftarrow");m("\\lArr","\\Leftarrow");m("\\Larr","\\Leftarrow");m("\\lrarr","\\leftrightarrow");m("\\lrArr","\\Leftrightarrow");m("\\Lrarr","\\Leftrightarrow");m("\\Mu","\\mathrm{M}");m("\\natnums","\\mathbb{N}");m("\\Nu","\\mathrm{N}");m("\\Omicron","\\mathrm{O}");m("\\plusmn","\\pm");m("\\rarr","\\rightarrow");m("\\rArr","\\Rightarrow");m("\\Rarr","\\Rightarrow");m("\\real","\\Re");m("\\reals","\\mathbb{R}");m("\\Reals","\\mathbb{R}");m("\\Rho","\\mathrm{P}");m("\\sdot","\\cdot");m("\\sect","\\S");m("\\spades","\\spadesuit");m("\\sub","\\subset");m("\\sube","\\subseteq");m("\\supe","\\supseteq");m("\\Tau","\\mathrm{T}");m("\\thetasym","\\vartheta");m("\\weierp","\\wp");m("\\Zeta","\\mathrm{Z}");m("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");m("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");m("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");m("\\bra","\\mathinner{\\langle{#1}|}");m("\\ket","\\mathinner{|{#1}\\rangle}");m("\\braket","\\mathinner{\\langle{#1}\\rangle}");m("\\Bra","\\left\\langle#1\\right|");m("\\Ket","\\left|#1\\right\\rangle");var ca=r=>e=>{var t=e.consumeArg().tokens,a=e.consumeArg().tokens,n=e.consumeArg().tokens,s=e.consumeArg().tokens,o=e.macros.get("|"),h=e.macros.get("\\|");e.macros.beginGroup();var c=b=>w=>{r&&(w.macros.set("|",o),n.length&&w.macros.set("\\|",h));var x=b;if(!b&&n.length){var z=w.future();z.text==="|"&&(w.popToken(),x=!0)}return{tokens:x?n:a,numArgs:0}};e.macros.set("|",c(!1)),n.length&&e.macros.set("\\|",c(!0));var p=e.consumeArg().tokens,g=e.expandTokens([...s,...p,...t]);return e.macros.endGroup(),{tokens:g.reverse(),numArgs:0}};m("\\bra@ket",ca(!1));m("\\bra@set",ca(!0));m("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");m("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");m("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");m("\\angln","{\\angl n}");m("\\blue","\\textcolor{##6495ed}{#1}");m("\\orange","\\textcolor{##ffa500}{#1}");m("\\pink","\\textcolor{##ff00af}{#1}");m("\\red","\\textcolor{##df0030}{#1}");m("\\green","\\textcolor{##28ae7b}{#1}");m("\\gray","\\textcolor{gray}{#1}");m("\\purple","\\textcolor{##9d38bd}{#1}");m("\\blueA","\\textcolor{##ccfaff}{#1}");m("\\blueB","\\textcolor{##80f6ff}{#1}");m("\\blueC","\\textcolor{##63d9ea}{#1}");m("\\blueD","\\textcolor{##11accd}{#1}");m("\\blueE","\\textcolor{##0c7f99}{#1}");m("\\tealA","\\textcolor{##94fff5}{#1}");m("\\tealB","\\textcolor{##26edd5}{#1}");m("\\tealC","\\textcolor{##01d1c1}{#1}");m("\\tealD","\\textcolor{##01a995}{#1}");m("\\tealE","\\textcolor{##208170}{#1}");m("\\greenA","\\textcolor{##b6ffb0}{#1}");m("\\greenB","\\textcolor{##8af281}{#1}");m("\\greenC","\\textcolor{##74cf70}{#1}");m("\\greenD","\\textcolor{##1fab54}{#1}");m("\\greenE","\\textcolor{##0d923f}{#1}");m("\\goldA","\\textcolor{##ffd0a9}{#1}");m("\\goldB","\\textcolor{##ffbb71}{#1}");m("\\goldC","\\textcolor{##ff9c39}{#1}");m("\\goldD","\\textcolor{##e07d10}{#1}");m("\\goldE","\\textcolor{##a75a05}{#1}");m("\\redA","\\textcolor{##fca9a9}{#1}");m("\\redB","\\textcolor{##ff8482}{#1}");m("\\redC","\\textcolor{##f9685d}{#1}");m("\\redD","\\textcolor{##e84d39}{#1}");m("\\redE","\\textcolor{##bc2612}{#1}");m("\\maroonA","\\textcolor{##ffbde0}{#1}");m("\\maroonB","\\textcolor{##ff92c6}{#1}");m("\\maroonC","\\textcolor{##ed5fa6}{#1}");m("\\maroonD","\\textcolor{##ca337c}{#1}");m("\\maroonE","\\textcolor{##9e034e}{#1}");m("\\purpleA","\\textcolor{##ddd7ff}{#1}");m("\\purpleB","\\textcolor{##c6b9fc}{#1}");m("\\purpleC","\\textcolor{##aa87ff}{#1}");m("\\purpleD","\\textcolor{##7854ab}{#1}");m("\\purpleE","\\textcolor{##543b78}{#1}");m("\\mintA","\\textcolor{##f5f9e8}{#1}");m("\\mintB","\\textcolor{##edf2df}{#1}");m("\\mintC","\\textcolor{##e0e5cc}{#1}");m("\\grayA","\\textcolor{##f6f7f7}{#1}");m("\\grayB","\\textcolor{##f0f1f2}{#1}");m("\\grayC","\\textcolor{##e3e5e6}{#1}");m("\\grayD","\\textcolor{##d6d8da}{#1}");m("\\grayE","\\textcolor{##babec2}{#1}");m("\\grayF","\\textcolor{##888d93}{#1}");m("\\grayG","\\textcolor{##626569}{#1}");m("\\grayH","\\textcolor{##3b3e40}{#1}");m("\\grayI","\\textcolor{##21242c}{#1}");m("\\kaBlue","\\textcolor{##314453}{#1}");m("\\kaGreen","\\textcolor{##71B307}{#1}");var da={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},wt=class{constructor(e,t,a){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new xt(u4,t.macros),this.mode=a,this.stack=[]}feed(e){this.lexer=new Le(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,a,n;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;t=this.popToken(),{tokens:n,end:a}=this.consumeArg(["]"])}else({tokens:n,start:t,end:a}=this.consumeArg());return this.pushToken(new p0("EOF",a.loc)),this.pushTokens(n),t.range(a,"")}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var t=[],a=e&&e.length>0;a||this.consumeSpaces();var n=this.future(),s,o=0,h=0;do{if(s=this.popToken(),t.push(s),s.text==="{")++o;else if(s.text==="}"){if(--o,o===-1)throw new M("Extra }",s)}else if(s.text==="EOF")throw new M("Unexpected end of input in a macro argument, expected '"+(e&&a?e[h]:"}")+"'",s);if(e&&a)if((o===0||o===1&&e[h]==="{")&&s.text===e[h]){if(++h,h===e.length){t.splice(-h,h);break}}else h=0}while(o!==0||a);return n.text==="{"&&t[t.length-1].text==="}"&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:n,end:s}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new M("The length of delimiters doesn't match the number of args!");for(var a=t[0],n=0;nthis.settings.maxExpand)throw new M("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var t=this.popToken(),a=t.text,n=t.noexpand?null:this._getExpansion(a);if(n==null||e&&n.unexpandable){if(e&&n==null&&a[0]==="\\"&&!this.isDefined(a))throw new M("Undefined control sequence: "+a);return this.pushToken(t),!1}this.countExpansion(1);var s=n.tokens,o=this.consumeArgs(n.numArgs,n.delimiters);if(n.numArgs){s=s.slice();for(var h=s.length-1;h>=0;--h){var c=s[h];if(c.text==="#"){if(h===0)throw new M("Incomplete placeholder at end of macro body",c);if(c=s[--h],c.text==="#")s.splice(h+1,1);else if(/^[1-9]$/.test(c.text))s.splice(h,2,...o[+c.text-1]);else throw new M("Not a valid argument number",c)}}}return this.pushTokens(s),s.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new p0(e)]):void 0}expandTokens(e){var t=[],a=this.stack.length;for(this.pushTokens(e);this.stack.length>a;)if(this.expandOnce(!0)===!1){var n=this.stack.pop();n.treatAsRelax&&(n.noexpand=!1,n.treatAsRelax=!1),t.push(n)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t&&t.map(a=>a.text).join("")}_getExpansion(e){var t=this.macros.get(e);if(t==null)return t;if(e.length===1){var a=this.lexer.catcodes[e];if(a!=null&&a!==13)return}var n=typeof t=="function"?t(this):t;if(typeof n=="string"){var s=0;if(n.indexOf("#")!==-1)for(var o=n.replace(/##/g,"");o.indexOf("#"+(s+1))!==-1;)++s;for(var h=new Le(n,this.settings),c=[],p=h.lex();p.text!=="EOF";)c.push(p),p=h.lex();c.reverse();var g={tokens:c,numArgs:s};return g}return n}isDefined(e){return this.macros.has(e)||L0.hasOwnProperty(e)||X.math.hasOwnProperty(e)||X.text.hasOwnProperty(e)||da.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return t!=null?typeof t=="string"||typeof t=="function"||!t.unexpandable:L0.hasOwnProperty(e)&&!L0[e].primitive}},yr=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Ce=Object.freeze({"\u208A":"+","\u208B":"-","\u208C":"=","\u208D":"(","\u208E":")","\u2080":"0","\u2081":"1","\u2082":"2","\u2083":"3","\u2084":"4","\u2085":"5","\u2086":"6","\u2087":"7","\u2088":"8","\u2089":"9","\u2090":"a","\u2091":"e","\u2095":"h","\u1D62":"i","\u2C7C":"j","\u2096":"k","\u2097":"l","\u2098":"m","\u2099":"n","\u2092":"o","\u209A":"p","\u1D63":"r","\u209B":"s","\u209C":"t","\u1D64":"u","\u1D65":"v","\u2093":"x","\u1D66":"\u03B2","\u1D67":"\u03B3","\u1D68":"\u03C1","\u1D69":"\u03D5","\u1D6A":"\u03C7","\u207A":"+","\u207B":"-","\u207C":"=","\u207D":"(","\u207E":")","\u2070":"0","\xB9":"1","\xB2":"2","\xB3":"3","\u2074":"4","\u2075":"5","\u2076":"6","\u2077":"7","\u2078":"8","\u2079":"9","\u1D2C":"A","\u1D2E":"B","\u1D30":"D","\u1D31":"E","\u1D33":"G","\u1D34":"H","\u1D35":"I","\u1D36":"J","\u1D37":"K","\u1D38":"L","\u1D39":"M","\u1D3A":"N","\u1D3C":"O","\u1D3E":"P","\u1D3F":"R","\u1D40":"T","\u1D41":"U","\u2C7D":"V","\u1D42":"W","\u1D43":"a","\u1D47":"b","\u1D9C":"c","\u1D48":"d","\u1D49":"e","\u1DA0":"f","\u1D4D":"g",\u02B0:"h","\u2071":"i",\u02B2:"j","\u1D4F":"k",\u02E1:"l","\u1D50":"m",\u207F:"n","\u1D52":"o","\u1D56":"p",\u02B3:"r",\u02E2:"s","\u1D57":"t","\u1D58":"u","\u1D5B":"v",\u02B7:"w",\u02E3:"x",\u02B8:"y","\u1DBB":"z","\u1D5D":"\u03B2","\u1D5E":"\u03B3","\u1D5F":"\u03B4","\u1D60":"\u03D5","\u1D61":"\u03C7","\u1DBF":"\u03B8"}),ut={"\u0301":{text:"\\'",math:"\\acute"},"\u0300":{text:"\\`",math:"\\grave"},"\u0308":{text:'\\"',math:"\\ddot"},"\u0303":{text:"\\~",math:"\\tilde"},"\u0304":{text:"\\=",math:"\\bar"},"\u0306":{text:"\\u",math:"\\breve"},"\u030C":{text:"\\v",math:"\\check"},"\u0302":{text:"\\^",math:"\\hat"},"\u0307":{text:"\\.",math:"\\dot"},"\u030A":{text:"\\r",math:"\\mathring"},"\u030B":{text:"\\H"},"\u0327":{text:"\\c"}},xr={\u00E1:"a\u0301",\u00E0:"a\u0300",\u00E4:"a\u0308",\u01DF:"a\u0308\u0304",\u00E3:"a\u0303",\u0101:"a\u0304",\u0103:"a\u0306",\u1EAF:"a\u0306\u0301",\u1EB1:"a\u0306\u0300",\u1EB5:"a\u0306\u0303",\u01CE:"a\u030C",\u00E2:"a\u0302",\u1EA5:"a\u0302\u0301",\u1EA7:"a\u0302\u0300",\u1EAB:"a\u0302\u0303",\u0227:"a\u0307",\u01E1:"a\u0307\u0304",\u00E5:"a\u030A",\u01FB:"a\u030A\u0301",\u1E03:"b\u0307",\u0107:"c\u0301",\u1E09:"c\u0327\u0301",\u010D:"c\u030C",\u0109:"c\u0302",\u010B:"c\u0307",\u00E7:"c\u0327",\u010F:"d\u030C",\u1E0B:"d\u0307",\u1E11:"d\u0327",\u00E9:"e\u0301",\u00E8:"e\u0300",\u00EB:"e\u0308",\u1EBD:"e\u0303",\u0113:"e\u0304",\u1E17:"e\u0304\u0301",\u1E15:"e\u0304\u0300",\u0115:"e\u0306",\u1E1D:"e\u0327\u0306",\u011B:"e\u030C",\u00EA:"e\u0302",\u1EBF:"e\u0302\u0301",\u1EC1:"e\u0302\u0300",\u1EC5:"e\u0302\u0303",\u0117:"e\u0307",\u0229:"e\u0327",\u1E1F:"f\u0307",\u01F5:"g\u0301",\u1E21:"g\u0304",\u011F:"g\u0306",\u01E7:"g\u030C",\u011D:"g\u0302",\u0121:"g\u0307",\u0123:"g\u0327",\u1E27:"h\u0308",\u021F:"h\u030C",\u0125:"h\u0302",\u1E23:"h\u0307",\u1E29:"h\u0327",\u00ED:"i\u0301",\u00EC:"i\u0300",\u00EF:"i\u0308",\u1E2F:"i\u0308\u0301",\u0129:"i\u0303",\u012B:"i\u0304",\u012D:"i\u0306",\u01D0:"i\u030C",\u00EE:"i\u0302",\u01F0:"j\u030C",\u0135:"j\u0302",\u1E31:"k\u0301",\u01E9:"k\u030C",\u0137:"k\u0327",\u013A:"l\u0301",\u013E:"l\u030C",\u013C:"l\u0327",\u1E3F:"m\u0301",\u1E41:"m\u0307",\u0144:"n\u0301",\u01F9:"n\u0300",\u00F1:"n\u0303",\u0148:"n\u030C",\u1E45:"n\u0307",\u0146:"n\u0327",\u00F3:"o\u0301",\u00F2:"o\u0300",\u00F6:"o\u0308",\u022B:"o\u0308\u0304",\u00F5:"o\u0303",\u1E4D:"o\u0303\u0301",\u1E4F:"o\u0303\u0308",\u022D:"o\u0303\u0304",\u014D:"o\u0304",\u1E53:"o\u0304\u0301",\u1E51:"o\u0304\u0300",\u014F:"o\u0306",\u01D2:"o\u030C",\u00F4:"o\u0302",\u1ED1:"o\u0302\u0301",\u1ED3:"o\u0302\u0300",\u1ED7:"o\u0302\u0303",\u022F:"o\u0307",\u0231:"o\u0307\u0304",\u0151:"o\u030B",\u1E55:"p\u0301",\u1E57:"p\u0307",\u0155:"r\u0301",\u0159:"r\u030C",\u1E59:"r\u0307",\u0157:"r\u0327",\u015B:"s\u0301",\u1E65:"s\u0301\u0307",\u0161:"s\u030C",\u1E67:"s\u030C\u0307",\u015D:"s\u0302",\u1E61:"s\u0307",\u015F:"s\u0327",\u1E97:"t\u0308",\u0165:"t\u030C",\u1E6B:"t\u0307",\u0163:"t\u0327",\u00FA:"u\u0301",\u00F9:"u\u0300",\u00FC:"u\u0308",\u01D8:"u\u0308\u0301",\u01DC:"u\u0308\u0300",\u01D6:"u\u0308\u0304",\u01DA:"u\u0308\u030C",\u0169:"u\u0303",\u1E79:"u\u0303\u0301",\u016B:"u\u0304",\u1E7B:"u\u0304\u0308",\u016D:"u\u0306",\u01D4:"u\u030C",\u00FB:"u\u0302",\u016F:"u\u030A",\u0171:"u\u030B",\u1E7D:"v\u0303",\u1E83:"w\u0301",\u1E81:"w\u0300",\u1E85:"w\u0308",\u0175:"w\u0302",\u1E87:"w\u0307",\u1E98:"w\u030A",\u1E8D:"x\u0308",\u1E8B:"x\u0307",\u00FD:"y\u0301",\u1EF3:"y\u0300",\u00FF:"y\u0308",\u1EF9:"y\u0303",\u0233:"y\u0304",\u0177:"y\u0302",\u1E8F:"y\u0307",\u1E99:"y\u030A",\u017A:"z\u0301",\u017E:"z\u030C",\u1E91:"z\u0302",\u017C:"z\u0307",\u00C1:"A\u0301",\u00C0:"A\u0300",\u00C4:"A\u0308",\u01DE:"A\u0308\u0304",\u00C3:"A\u0303",\u0100:"A\u0304",\u0102:"A\u0306",\u1EAE:"A\u0306\u0301",\u1EB0:"A\u0306\u0300",\u1EB4:"A\u0306\u0303",\u01CD:"A\u030C",\u00C2:"A\u0302",\u1EA4:"A\u0302\u0301",\u1EA6:"A\u0302\u0300",\u1EAA:"A\u0302\u0303",\u0226:"A\u0307",\u01E0:"A\u0307\u0304",\u00C5:"A\u030A",\u01FA:"A\u030A\u0301",\u1E02:"B\u0307",\u0106:"C\u0301",\u1E08:"C\u0327\u0301",\u010C:"C\u030C",\u0108:"C\u0302",\u010A:"C\u0307",\u00C7:"C\u0327",\u010E:"D\u030C",\u1E0A:"D\u0307",\u1E10:"D\u0327",\u00C9:"E\u0301",\u00C8:"E\u0300",\u00CB:"E\u0308",\u1EBC:"E\u0303",\u0112:"E\u0304",\u1E16:"E\u0304\u0301",\u1E14:"E\u0304\u0300",\u0114:"E\u0306",\u1E1C:"E\u0327\u0306",\u011A:"E\u030C",\u00CA:"E\u0302",\u1EBE:"E\u0302\u0301",\u1EC0:"E\u0302\u0300",\u1EC4:"E\u0302\u0303",\u0116:"E\u0307",\u0228:"E\u0327",\u1E1E:"F\u0307",\u01F4:"G\u0301",\u1E20:"G\u0304",\u011E:"G\u0306",\u01E6:"G\u030C",\u011C:"G\u0302",\u0120:"G\u0307",\u0122:"G\u0327",\u1E26:"H\u0308",\u021E:"H\u030C",\u0124:"H\u0302",\u1E22:"H\u0307",\u1E28:"H\u0327",\u00CD:"I\u0301",\u00CC:"I\u0300",\u00CF:"I\u0308",\u1E2E:"I\u0308\u0301",\u0128:"I\u0303",\u012A:"I\u0304",\u012C:"I\u0306",\u01CF:"I\u030C",\u00CE:"I\u0302",\u0130:"I\u0307",\u0134:"J\u0302",\u1E30:"K\u0301",\u01E8:"K\u030C",\u0136:"K\u0327",\u0139:"L\u0301",\u013D:"L\u030C",\u013B:"L\u0327",\u1E3E:"M\u0301",\u1E40:"M\u0307",\u0143:"N\u0301",\u01F8:"N\u0300",\u00D1:"N\u0303",\u0147:"N\u030C",\u1E44:"N\u0307",\u0145:"N\u0327",\u00D3:"O\u0301",\u00D2:"O\u0300",\u00D6:"O\u0308",\u022A:"O\u0308\u0304",\u00D5:"O\u0303",\u1E4C:"O\u0303\u0301",\u1E4E:"O\u0303\u0308",\u022C:"O\u0303\u0304",\u014C:"O\u0304",\u1E52:"O\u0304\u0301",\u1E50:"O\u0304\u0300",\u014E:"O\u0306",\u01D1:"O\u030C",\u00D4:"O\u0302",\u1ED0:"O\u0302\u0301",\u1ED2:"O\u0302\u0300",\u1ED6:"O\u0302\u0303",\u022E:"O\u0307",\u0230:"O\u0307\u0304",\u0150:"O\u030B",\u1E54:"P\u0301",\u1E56:"P\u0307",\u0154:"R\u0301",\u0158:"R\u030C",\u1E58:"R\u0307",\u0156:"R\u0327",\u015A:"S\u0301",\u1E64:"S\u0301\u0307",\u0160:"S\u030C",\u1E66:"S\u030C\u0307",\u015C:"S\u0302",\u1E60:"S\u0307",\u015E:"S\u0327",\u0164:"T\u030C",\u1E6A:"T\u0307",\u0162:"T\u0327",\u00DA:"U\u0301",\u00D9:"U\u0300",\u00DC:"U\u0308",\u01D7:"U\u0308\u0301",\u01DB:"U\u0308\u0300",\u01D5:"U\u0308\u0304",\u01D9:"U\u0308\u030C",\u0168:"U\u0303",\u1E78:"U\u0303\u0301",\u016A:"U\u0304",\u1E7A:"U\u0304\u0308",\u016C:"U\u0306",\u01D3:"U\u030C",\u00DB:"U\u0302",\u016E:"U\u030A",\u0170:"U\u030B",\u1E7C:"V\u0303",\u1E82:"W\u0301",\u1E80:"W\u0300",\u1E84:"W\u0308",\u0174:"W\u0302",\u1E86:"W\u0307",\u1E8C:"X\u0308",\u1E8A:"X\u0307",\u00DD:"Y\u0301",\u1EF2:"Y\u0300",\u0178:"Y\u0308",\u1EF8:"Y\u0303",\u0232:"Y\u0304",\u0176:"Y\u0302",\u1E8E:"Y\u0307",\u0179:"Z\u0301",\u017D:"Z\u030C",\u1E90:"Z\u0302",\u017B:"Z\u0307",\u03AC:"\u03B1\u0301",\u1F70:"\u03B1\u0300",\u1FB1:"\u03B1\u0304",\u1FB0:"\u03B1\u0306",\u03AD:"\u03B5\u0301",\u1F72:"\u03B5\u0300",\u03AE:"\u03B7\u0301",\u1F74:"\u03B7\u0300",\u03AF:"\u03B9\u0301",\u1F76:"\u03B9\u0300",\u03CA:"\u03B9\u0308",\u0390:"\u03B9\u0308\u0301",\u1FD2:"\u03B9\u0308\u0300",\u1FD1:"\u03B9\u0304",\u1FD0:"\u03B9\u0306",\u03CC:"\u03BF\u0301",\u1F78:"\u03BF\u0300",\u03CD:"\u03C5\u0301",\u1F7A:"\u03C5\u0300",\u03CB:"\u03C5\u0308",\u03B0:"\u03C5\u0308\u0301",\u1FE2:"\u03C5\u0308\u0300",\u1FE1:"\u03C5\u0304",\u1FE0:"\u03C5\u0306",\u03CE:"\u03C9\u0301",\u1F7C:"\u03C9\u0300",\u038E:"\u03A5\u0301",\u1FEA:"\u03A5\u0300",\u03AB:"\u03A5\u0308",\u1FE9:"\u03A5\u0304",\u1FE8:"\u03A5\u0306",\u038F:"\u03A9\u0301",\u1FFA:"\u03A9\u0300"},Pe=class r{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new wt(e,t,this.mode),this.settings=t,this.leftrightDepth=0}expect(e,t){if(t===void 0&&(t=!0),this.fetch().text!==e)throw new M("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new p0("}")),this.gullet.pushTokens(e);var a=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,a}parseExpression(e,t){for(var a=[];;){this.mode==="math"&&this.consumeSpaces();var n=this.fetch();if(r.endOfExpression.indexOf(n.text)!==-1||t&&n.text===t||e&&L0[n.text]&&L0[n.text].infix)break;var s=this.parseAtom(t);if(s){if(s.type==="internal")continue}else break;a.push(s)}return this.mode==="text"&&this.formLigatures(a),this.handleInfixNodes(a)}handleInfixNodes(e){for(var t=-1,a,n=0;n=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var h=X[this.mode][t].group,c=m0.range(e),p;if(e1.hasOwnProperty(h)){var g=h;p={type:"atom",mode:this.mode,family:g,loc:c,text:t}}else p={type:h,mode:this.mode,loc:c,text:t};o=p}else if(t.charCodeAt(0)>=128)this.settings.strict&&(kr(t.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'"'+(" ("+t.charCodeAt(0)+")"),e)),o={type:"textord",mode:"text",loc:m0.range(e),text:t};else return null;if(this.consume(),s)for(var b=0;b0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,a){if(a===void 0&&(a=!1),a){for(var n=0;n0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var s=this.undefStack[this.undefStack.length-1];s&&!s.hasOwnProperty(e)&&(s[e]=this.current[e])}t==null?delete this.current[e]:this.current[e]=t}},u4=_r;m("\\noexpand",function(r){var e=r.popToken();return r.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});m("\\expandafter",function(r){var e=r.popToken();return r.expandOnce(!0),{tokens:[e],numArgs:0}});m("\\@firstoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[0],numArgs:0}});m("\\@secondoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[1],numArgs:0}});m("\\@ifnextchar",function(r){var e=r.consumeArgs(3);r.consumeSpaces();var t=r.future();return e[0].length===1&&e[0][0].text===t.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});m("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");m("\\TextOrMath",function(r){var e=r.consumeArgs(2);return r.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var gr={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};m("\\char",function(r){var e=r.popToken(),t,a="";if(e.text==="'")t=8,e=r.popToken();else if(e.text==='"')t=16,e=r.popToken();else if(e.text==="`")if(e=r.popToken(),e.text[0]==="\\")a=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new M("\\char` missing argument");a=e.text.charCodeAt(0)}else t=10;if(t){if(a=gr[e.text],a==null||a>=t)throw new M("Invalid base-"+t+" digit "+e.text);for(var n;(n=gr[r.future().text])!=null&&n{var a=r.consumeArg().tokens;if(a.length!==1)throw new M("\\newcommand's first argument must be a macro name");var n=a[0].text,s=r.isDefined(n);if(s&&!e)throw new M("\\newcommand{"+n+"} attempting to redefine "+(n+"; use \\renewcommand"));if(!s&&!t)throw new M("\\renewcommand{"+n+"} when command "+n+" does not yet exist; use \\newcommand");var o=0;if(a=r.consumeArg().tokens,a.length===1&&a[0].text==="["){for(var h="",c=r.expandNextToken();c.text!=="]"&&c.text!=="EOF";)h+=c.text,c=r.expandNextToken();if(!h.match(/^\s*[0-9]+\s*$/))throw new M("Invalid number of arguments: "+h);o=parseInt(h),a=r.consumeArg().tokens}return r.macros.set(n,{tokens:a,numArgs:o}),""};m("\\newcommand",r=>Ot(r,!1,!0));m("\\renewcommand",r=>Ot(r,!0,!1));m("\\providecommand",r=>Ot(r,!0,!0));m("\\message",r=>{var e=r.consumeArgs(1)[0];return console.log(e.reverse().map(t=>t.text).join("")),""});m("\\errmessage",r=>{var e=r.consumeArgs(1)[0];return console.error(e.reverse().map(t=>t.text).join("")),""});m("\\show",r=>{var e=r.popToken(),t=e.text;return console.log(e,r.macros.get(t),L0[t],X.math[t],X.text[t]),""});m("\\bgroup","{");m("\\egroup","}");m("~","\\nobreakspace");m("\\lq","`");m("\\rq","'");m("\\aa","\\r a");m("\\AA","\\r A");m("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`\xA9}");m("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");m("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`\xAE}");m("\u212C","\\mathscr{B}");m("\u2130","\\mathscr{E}");m("\u2131","\\mathscr{F}");m("\u210B","\\mathscr{H}");m("\u2110","\\mathscr{I}");m("\u2112","\\mathscr{L}");m("\u2133","\\mathscr{M}");m("\u211B","\\mathscr{R}");m("\u212D","\\mathfrak{C}");m("\u210C","\\mathfrak{H}");m("\u2128","\\mathfrak{Z}");m("\\Bbbk","\\Bbb{k}");m("\xB7","\\cdotp");m("\\llap","\\mathllap{\\textrm{#1}}");m("\\rlap","\\mathrlap{\\textrm{#1}}");m("\\clap","\\mathclap{\\textrm{#1}}");m("\\mathstrut","\\vphantom{(}");m("\\underbar","\\underline{\\text{#1}}");m("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');m("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`\u2260}}");m("\\ne","\\neq");m("\u2260","\\neq");m("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`\u2209}}");m("\u2209","\\notin");m("\u2258","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`\u2258}}");m("\u2259","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`\u2258}}");m("\u225A","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`\u225A}}");m("\u225B","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`\u225B}}");m("\u225D","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`\u225D}}");m("\u225E","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`\u225E}}");m("\u225F","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`\u225F}}");m("\u27C2","\\perp");m("\u203C","\\mathclose{!\\mkern-0.8mu!}");m("\u220C","\\notni");m("\u231C","\\ulcorner");m("\u231D","\\urcorner");m("\u231E","\\llcorner");m("\u231F","\\lrcorner");m("\xA9","\\copyright");m("\xAE","\\textregistered");m("\uFE0F","\\textregistered");m("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');m("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');m("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');m("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');m("\\vdots","\\mathord{\\varvdots\\rule{0pt}{15pt}}");m("\u22EE","\\vdots");m("\\varGamma","\\mathit{\\Gamma}");m("\\varDelta","\\mathit{\\Delta}");m("\\varTheta","\\mathit{\\Theta}");m("\\varLambda","\\mathit{\\Lambda}");m("\\varXi","\\mathit{\\Xi}");m("\\varPi","\\mathit{\\Pi}");m("\\varSigma","\\mathit{\\Sigma}");m("\\varUpsilon","\\mathit{\\Upsilon}");m("\\varPhi","\\mathit{\\Phi}");m("\\varPsi","\\mathit{\\Psi}");m("\\varOmega","\\mathit{\\Omega}");m("\\substack","\\begin{subarray}{c}#1\\end{subarray}");m("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");m("\\boxed","\\fbox{$\\displaystyle{#1}$}");m("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");m("\\implies","\\DOTSB\\;\\Longrightarrow\\;");m("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");var br={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};m("\\dots",function(r){var e="\\dotso",t=r.expandAfterFuture().text;return t in br?e=br[t]:(t.slice(0,4)==="\\not"||t in X.math&&N.contains(["bin","rel"],X.math[t].group))&&(e="\\dotsb"),e});var Ht={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};m("\\dotso",function(r){var e=r.future().text;return e in Ht?"\\ldots\\,":"\\ldots"});m("\\dotsc",function(r){var e=r.future().text;return e in Ht&&e!==","?"\\ldots\\,":"\\ldots"});m("\\cdots",function(r){var e=r.future().text;return e in Ht?"\\@cdots\\,":"\\@cdots"});m("\\dotsb","\\cdots");m("\\dotsm","\\cdots");m("\\dotsi","\\!\\cdots");m("\\dotsx","\\ldots\\,");m("\\DOTSI","\\relax");m("\\DOTSB","\\relax");m("\\DOTSX","\\relax");m("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");m("\\,","\\tmspace+{3mu}{.1667em}");m("\\thinspace","\\,");m("\\>","\\mskip{4mu}");m("\\:","\\tmspace+{4mu}{.2222em}");m("\\medspace","\\:");m("\\;","\\tmspace+{5mu}{.2777em}");m("\\thickspace","\\;");m("\\!","\\tmspace-{3mu}{.1667em}");m("\\negthinspace","\\!");m("\\negmedspace","\\tmspace-{4mu}{.2222em}");m("\\negthickspace","\\tmspace-{5mu}{.277em}");m("\\enspace","\\kern.5em ");m("\\enskip","\\hskip.5em\\relax");m("\\quad","\\hskip1em\\relax");m("\\qquad","\\hskip2em\\relax");m("\\tag","\\@ifstar\\tag@literal\\tag@paren");m("\\tag@paren","\\tag@literal{({#1})}");m("\\tag@literal",r=>{if(r.macros.get("\\df@tag"))throw new M("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});m("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");m("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");m("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");m("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");m("\\newline","\\\\\\relax");m("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var ma=A(k0["Main-Regular"][84][1]-.7*k0["Main-Regular"][65][1]);m("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+ma+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");m("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+ma+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");m("\\hspace","\\@ifstar\\@hspacer\\@hspace");m("\\@hspace","\\hskip #1\\relax");m("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");m("\\ordinarycolon",":");m("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");m("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');m("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');m("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');m("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');m("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');m("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');m("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');m("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');m("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');m("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');m("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');m("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');m("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');m("\u2237","\\dblcolon");m("\u2239","\\eqcolon");m("\u2254","\\coloneqq");m("\u2255","\\eqqcolon");m("\u2A74","\\Coloneqq");m("\\ratio","\\vcentcolon");m("\\coloncolon","\\dblcolon");m("\\colonequals","\\coloneqq");m("\\coloncolonequals","\\Coloneqq");m("\\equalscolon","\\eqqcolon");m("\\equalscoloncolon","\\Eqqcolon");m("\\colonminus","\\coloneq");m("\\coloncolonminus","\\Coloneq");m("\\minuscolon","\\eqcolon");m("\\minuscoloncolon","\\Eqcolon");m("\\coloncolonapprox","\\Colonapprox");m("\\coloncolonsim","\\Colonsim");m("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");m("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");m("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");m("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");m("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`\u220C}}");m("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");m("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");m("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");m("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");m("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");m("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");m("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");m("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");m("\\gvertneqq","\\html@mathml{\\@gvertneqq}{\u2269}");m("\\lvertneqq","\\html@mathml{\\@lvertneqq}{\u2268}");m("\\ngeqq","\\html@mathml{\\@ngeqq}{\u2271}");m("\\ngeqslant","\\html@mathml{\\@ngeqslant}{\u2271}");m("\\nleqq","\\html@mathml{\\@nleqq}{\u2270}");m("\\nleqslant","\\html@mathml{\\@nleqslant}{\u2270}");m("\\nshortmid","\\html@mathml{\\@nshortmid}{\u2224}");m("\\nshortparallel","\\html@mathml{\\@nshortparallel}{\u2226}");m("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{\u2288}");m("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{\u2289}");m("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{\u228A}");m("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{\u2ACB}");m("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{\u228B}");m("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{\u2ACC}");m("\\imath","\\html@mathml{\\@imath}{\u0131}");m("\\jmath","\\html@mathml{\\@jmath}{\u0237}");m("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`\u27E6}}");m("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`\u27E7}}");m("\u27E6","\\llbracket");m("\u27E7","\\rrbracket");m("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`\u2983}}");m("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`\u2984}}");m("\u2983","\\lBrace");m("\u2984","\\rBrace");m("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`\u29B5}}");m("\u29B5","\\minuso");m("\\darr","\\downarrow");m("\\dArr","\\Downarrow");m("\\Darr","\\Downarrow");m("\\lang","\\langle");m("\\rang","\\rangle");m("\\uarr","\\uparrow");m("\\uArr","\\Uparrow");m("\\Uarr","\\Uparrow");m("\\N","\\mathbb{N}");m("\\R","\\mathbb{R}");m("\\Z","\\mathbb{Z}");m("\\alef","\\aleph");m("\\alefsym","\\aleph");m("\\Alpha","\\mathrm{A}");m("\\Beta","\\mathrm{B}");m("\\bull","\\bullet");m("\\Chi","\\mathrm{X}");m("\\clubs","\\clubsuit");m("\\cnums","\\mathbb{C}");m("\\Complex","\\mathbb{C}");m("\\Dagger","\\ddagger");m("\\diamonds","\\diamondsuit");m("\\empty","\\emptyset");m("\\Epsilon","\\mathrm{E}");m("\\Eta","\\mathrm{H}");m("\\exist","\\exists");m("\\harr","\\leftrightarrow");m("\\hArr","\\Leftrightarrow");m("\\Harr","\\Leftrightarrow");m("\\hearts","\\heartsuit");m("\\image","\\Im");m("\\infin","\\infty");m("\\Iota","\\mathrm{I}");m("\\isin","\\in");m("\\Kappa","\\mathrm{K}");m("\\larr","\\leftarrow");m("\\lArr","\\Leftarrow");m("\\Larr","\\Leftarrow");m("\\lrarr","\\leftrightarrow");m("\\lrArr","\\Leftrightarrow");m("\\Lrarr","\\Leftrightarrow");m("\\Mu","\\mathrm{M}");m("\\natnums","\\mathbb{N}");m("\\Nu","\\mathrm{N}");m("\\Omicron","\\mathrm{O}");m("\\plusmn","\\pm");m("\\rarr","\\rightarrow");m("\\rArr","\\Rightarrow");m("\\Rarr","\\Rightarrow");m("\\real","\\Re");m("\\reals","\\mathbb{R}");m("\\Reals","\\mathbb{R}");m("\\Rho","\\mathrm{P}");m("\\sdot","\\cdot");m("\\sect","\\S");m("\\spades","\\spadesuit");m("\\sub","\\subset");m("\\sube","\\subseteq");m("\\supe","\\supseteq");m("\\Tau","\\mathrm{T}");m("\\thetasym","\\vartheta");m("\\weierp","\\wp");m("\\Zeta","\\mathrm{Z}");m("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");m("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");m("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");m("\\bra","\\mathinner{\\langle{#1}|}");m("\\ket","\\mathinner{|{#1}\\rangle}");m("\\braket","\\mathinner{\\langle{#1}\\rangle}");m("\\Bra","\\left\\langle#1\\right|");m("\\Ket","\\left|#1\\right\\rangle");var ca=r=>e=>{var t=e.consumeArg().tokens,a=e.consumeArg().tokens,n=e.consumeArg().tokens,s=e.consumeArg().tokens,o=e.macros.get("|"),h=e.macros.get("\\|");e.macros.beginGroup();var c=b=>x=>{r&&(x.macros.set("|",o),n.length&&x.macros.set("\\|",h));var w=b;if(!b&&n.length){var z=x.future();z.text==="|"&&(x.popToken(),w=!0)}return{tokens:w?n:a,numArgs:0}};e.macros.set("|",c(!1)),n.length&&e.macros.set("\\|",c(!0));var p=e.consumeArg().tokens,g=e.expandTokens([...s,...p,...t]);return e.macros.endGroup(),{tokens:g.reverse(),numArgs:0}};m("\\bra@ket",ca(!1));m("\\bra@set",ca(!0));m("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");m("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");m("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");m("\\angln","{\\angl n}");m("\\blue","\\textcolor{##6495ed}{#1}");m("\\orange","\\textcolor{##ffa500}{#1}");m("\\pink","\\textcolor{##ff00af}{#1}");m("\\red","\\textcolor{##df0030}{#1}");m("\\green","\\textcolor{##28ae7b}{#1}");m("\\gray","\\textcolor{gray}{#1}");m("\\purple","\\textcolor{##9d38bd}{#1}");m("\\blueA","\\textcolor{##ccfaff}{#1}");m("\\blueB","\\textcolor{##80f6ff}{#1}");m("\\blueC","\\textcolor{##63d9ea}{#1}");m("\\blueD","\\textcolor{##11accd}{#1}");m("\\blueE","\\textcolor{##0c7f99}{#1}");m("\\tealA","\\textcolor{##94fff5}{#1}");m("\\tealB","\\textcolor{##26edd5}{#1}");m("\\tealC","\\textcolor{##01d1c1}{#1}");m("\\tealD","\\textcolor{##01a995}{#1}");m("\\tealE","\\textcolor{##208170}{#1}");m("\\greenA","\\textcolor{##b6ffb0}{#1}");m("\\greenB","\\textcolor{##8af281}{#1}");m("\\greenC","\\textcolor{##74cf70}{#1}");m("\\greenD","\\textcolor{##1fab54}{#1}");m("\\greenE","\\textcolor{##0d923f}{#1}");m("\\goldA","\\textcolor{##ffd0a9}{#1}");m("\\goldB","\\textcolor{##ffbb71}{#1}");m("\\goldC","\\textcolor{##ff9c39}{#1}");m("\\goldD","\\textcolor{##e07d10}{#1}");m("\\goldE","\\textcolor{##a75a05}{#1}");m("\\redA","\\textcolor{##fca9a9}{#1}");m("\\redB","\\textcolor{##ff8482}{#1}");m("\\redC","\\textcolor{##f9685d}{#1}");m("\\redD","\\textcolor{##e84d39}{#1}");m("\\redE","\\textcolor{##bc2612}{#1}");m("\\maroonA","\\textcolor{##ffbde0}{#1}");m("\\maroonB","\\textcolor{##ff92c6}{#1}");m("\\maroonC","\\textcolor{##ed5fa6}{#1}");m("\\maroonD","\\textcolor{##ca337c}{#1}");m("\\maroonE","\\textcolor{##9e034e}{#1}");m("\\purpleA","\\textcolor{##ddd7ff}{#1}");m("\\purpleB","\\textcolor{##c6b9fc}{#1}");m("\\purpleC","\\textcolor{##aa87ff}{#1}");m("\\purpleD","\\textcolor{##7854ab}{#1}");m("\\purpleE","\\textcolor{##543b78}{#1}");m("\\mintA","\\textcolor{##f5f9e8}{#1}");m("\\mintB","\\textcolor{##edf2df}{#1}");m("\\mintC","\\textcolor{##e0e5cc}{#1}");m("\\grayA","\\textcolor{##f6f7f7}{#1}");m("\\grayB","\\textcolor{##f0f1f2}{#1}");m("\\grayC","\\textcolor{##e3e5e6}{#1}");m("\\grayD","\\textcolor{##d6d8da}{#1}");m("\\grayE","\\textcolor{##babec2}{#1}");m("\\grayF","\\textcolor{##888d93}{#1}");m("\\grayG","\\textcolor{##626569}{#1}");m("\\grayH","\\textcolor{##3b3e40}{#1}");m("\\grayI","\\textcolor{##21242c}{#1}");m("\\kaBlue","\\textcolor{##314453}{#1}");m("\\kaGreen","\\textcolor{##71B307}{#1}");var da={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},wt=class{constructor(e,t,a){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new xt(u4,t.macros),this.mode=a,this.stack=[]}feed(e){this.lexer=new Le(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,a,n;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;t=this.popToken(),{tokens:n,end:a}=this.consumeArg(["]"])}else({tokens:n,start:t,end:a}=this.consumeArg());return this.pushToken(new p0("EOF",a.loc)),this.pushTokens(n),t.range(a,"")}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var t=[],a=e&&e.length>0;a||this.consumeSpaces();var n=this.future(),s,o=0,h=0;do{if(s=this.popToken(),t.push(s),s.text==="{")++o;else if(s.text==="}"){if(--o,o===-1)throw new M("Extra }",s)}else if(s.text==="EOF")throw new M("Unexpected end of input in a macro argument, expected '"+(e&&a?e[h]:"}")+"'",s);if(e&&a)if((o===0||o===1&&e[h]==="{")&&s.text===e[h]){if(++h,h===e.length){t.splice(-h,h);break}}else h=0}while(o!==0||a);return n.text==="{"&&t[t.length-1].text==="}"&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:n,end:s}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new M("The length of delimiters doesn't match the number of args!");for(var a=t[0],n=0;nthis.settings.maxExpand)throw new M("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var t=this.popToken(),a=t.text,n=t.noexpand?null:this._getExpansion(a);if(n==null||e&&n.unexpandable){if(e&&n==null&&a[0]==="\\"&&!this.isDefined(a))throw new M("Undefined control sequence: "+a);return this.pushToken(t),!1}this.countExpansion(1);var s=n.tokens,o=this.consumeArgs(n.numArgs,n.delimiters);if(n.numArgs){s=s.slice();for(var h=s.length-1;h>=0;--h){var c=s[h];if(c.text==="#"){if(h===0)throw new M("Incomplete placeholder at end of macro body",c);if(c=s[--h],c.text==="#")s.splice(h+1,1);else if(/^[1-9]$/.test(c.text))s.splice(h,2,...o[+c.text-1]);else throw new M("Not a valid argument number",c)}}}return this.pushTokens(s),s.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new p0(e)]):void 0}expandTokens(e){var t=[],a=this.stack.length;for(this.pushTokens(e);this.stack.length>a;)if(this.expandOnce(!0)===!1){var n=this.stack.pop();n.treatAsRelax&&(n.noexpand=!1,n.treatAsRelax=!1),t.push(n)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t&&t.map(a=>a.text).join("")}_getExpansion(e){var t=this.macros.get(e);if(t==null)return t;if(e.length===1){var a=this.lexer.catcodes[e];if(a!=null&&a!==13)return}var n=typeof t=="function"?t(this):t;if(typeof n=="string"){var s=0;if(n.indexOf("#")!==-1)for(var o=n.replace(/##/g,"");o.indexOf("#"+(s+1))!==-1;)++s;for(var h=new Le(n,this.settings),c=[],p=h.lex();p.text!=="EOF";)c.push(p),p=h.lex();c.reverse();var g={tokens:c,numArgs:s};return g}return n}isDefined(e){return this.macros.has(e)||L0.hasOwnProperty(e)||X.math.hasOwnProperty(e)||X.text.hasOwnProperty(e)||da.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return t!=null?typeof t=="string"||typeof t=="function"||!t.unexpandable:L0.hasOwnProperty(e)&&!L0[e].primitive}},yr=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Ce=Object.freeze({"\u208A":"+","\u208B":"-","\u208C":"=","\u208D":"(","\u208E":")","\u2080":"0","\u2081":"1","\u2082":"2","\u2083":"3","\u2084":"4","\u2085":"5","\u2086":"6","\u2087":"7","\u2088":"8","\u2089":"9","\u2090":"a","\u2091":"e","\u2095":"h","\u1D62":"i","\u2C7C":"j","\u2096":"k","\u2097":"l","\u2098":"m","\u2099":"n","\u2092":"o","\u209A":"p","\u1D63":"r","\u209B":"s","\u209C":"t","\u1D64":"u","\u1D65":"v","\u2093":"x","\u1D66":"\u03B2","\u1D67":"\u03B3","\u1D68":"\u03C1","\u1D69":"\u03D5","\u1D6A":"\u03C7","\u207A":"+","\u207B":"-","\u207C":"=","\u207D":"(","\u207E":")","\u2070":"0","\xB9":"1","\xB2":"2","\xB3":"3","\u2074":"4","\u2075":"5","\u2076":"6","\u2077":"7","\u2078":"8","\u2079":"9","\u1D2C":"A","\u1D2E":"B","\u1D30":"D","\u1D31":"E","\u1D33":"G","\u1D34":"H","\u1D35":"I","\u1D36":"J","\u1D37":"K","\u1D38":"L","\u1D39":"M","\u1D3A":"N","\u1D3C":"O","\u1D3E":"P","\u1D3F":"R","\u1D40":"T","\u1D41":"U","\u2C7D":"V","\u1D42":"W","\u1D43":"a","\u1D47":"b","\u1D9C":"c","\u1D48":"d","\u1D49":"e","\u1DA0":"f","\u1D4D":"g",\u02B0:"h","\u2071":"i",\u02B2:"j","\u1D4F":"k",\u02E1:"l","\u1D50":"m",\u207F:"n","\u1D52":"o","\u1D56":"p",\u02B3:"r",\u02E2:"s","\u1D57":"t","\u1D58":"u","\u1D5B":"v",\u02B7:"w",\u02E3:"x",\u02B8:"y","\u1DBB":"z","\u1D5D":"\u03B2","\u1D5E":"\u03B3","\u1D5F":"\u03B4","\u1D60":"\u03D5","\u1D61":"\u03C7","\u1DBF":"\u03B8"}),ut={"\u0301":{text:"\\'",math:"\\acute"},"\u0300":{text:"\\`",math:"\\grave"},"\u0308":{text:'\\"',math:"\\ddot"},"\u0303":{text:"\\~",math:"\\tilde"},"\u0304":{text:"\\=",math:"\\bar"},"\u0306":{text:"\\u",math:"\\breve"},"\u030C":{text:"\\v",math:"\\check"},"\u0302":{text:"\\^",math:"\\hat"},"\u0307":{text:"\\.",math:"\\dot"},"\u030A":{text:"\\r",math:"\\mathring"},"\u030B":{text:"\\H"},"\u0327":{text:"\\c"}},xr={\u00E1:"a\u0301",\u00E0:"a\u0300",\u00E4:"a\u0308",\u01DF:"a\u0308\u0304",\u00E3:"a\u0303",\u0101:"a\u0304",\u0103:"a\u0306",\u1EAF:"a\u0306\u0301",\u1EB1:"a\u0306\u0300",\u1EB5:"a\u0306\u0303",\u01CE:"a\u030C",\u00E2:"a\u0302",\u1EA5:"a\u0302\u0301",\u1EA7:"a\u0302\u0300",\u1EAB:"a\u0302\u0303",\u0227:"a\u0307",\u01E1:"a\u0307\u0304",\u00E5:"a\u030A",\u01FB:"a\u030A\u0301",\u1E03:"b\u0307",\u0107:"c\u0301",\u1E09:"c\u0327\u0301",\u010D:"c\u030C",\u0109:"c\u0302",\u010B:"c\u0307",\u00E7:"c\u0327",\u010F:"d\u030C",\u1E0B:"d\u0307",\u1E11:"d\u0327",\u00E9:"e\u0301",\u00E8:"e\u0300",\u00EB:"e\u0308",\u1EBD:"e\u0303",\u0113:"e\u0304",\u1E17:"e\u0304\u0301",\u1E15:"e\u0304\u0300",\u0115:"e\u0306",\u1E1D:"e\u0327\u0306",\u011B:"e\u030C",\u00EA:"e\u0302",\u1EBF:"e\u0302\u0301",\u1EC1:"e\u0302\u0300",\u1EC5:"e\u0302\u0303",\u0117:"e\u0307",\u0229:"e\u0327",\u1E1F:"f\u0307",\u01F5:"g\u0301",\u1E21:"g\u0304",\u011F:"g\u0306",\u01E7:"g\u030C",\u011D:"g\u0302",\u0121:"g\u0307",\u0123:"g\u0327",\u1E27:"h\u0308",\u021F:"h\u030C",\u0125:"h\u0302",\u1E23:"h\u0307",\u1E29:"h\u0327",\u00ED:"i\u0301",\u00EC:"i\u0300",\u00EF:"i\u0308",\u1E2F:"i\u0308\u0301",\u0129:"i\u0303",\u012B:"i\u0304",\u012D:"i\u0306",\u01D0:"i\u030C",\u00EE:"i\u0302",\u01F0:"j\u030C",\u0135:"j\u0302",\u1E31:"k\u0301",\u01E9:"k\u030C",\u0137:"k\u0327",\u013A:"l\u0301",\u013E:"l\u030C",\u013C:"l\u0327",\u1E3F:"m\u0301",\u1E41:"m\u0307",\u0144:"n\u0301",\u01F9:"n\u0300",\u00F1:"n\u0303",\u0148:"n\u030C",\u1E45:"n\u0307",\u0146:"n\u0327",\u00F3:"o\u0301",\u00F2:"o\u0300",\u00F6:"o\u0308",\u022B:"o\u0308\u0304",\u00F5:"o\u0303",\u1E4D:"o\u0303\u0301",\u1E4F:"o\u0303\u0308",\u022D:"o\u0303\u0304",\u014D:"o\u0304",\u1E53:"o\u0304\u0301",\u1E51:"o\u0304\u0300",\u014F:"o\u0306",\u01D2:"o\u030C",\u00F4:"o\u0302",\u1ED1:"o\u0302\u0301",\u1ED3:"o\u0302\u0300",\u1ED7:"o\u0302\u0303",\u022F:"o\u0307",\u0231:"o\u0307\u0304",\u0151:"o\u030B",\u1E55:"p\u0301",\u1E57:"p\u0307",\u0155:"r\u0301",\u0159:"r\u030C",\u1E59:"r\u0307",\u0157:"r\u0327",\u015B:"s\u0301",\u1E65:"s\u0301\u0307",\u0161:"s\u030C",\u1E67:"s\u030C\u0307",\u015D:"s\u0302",\u1E61:"s\u0307",\u015F:"s\u0327",\u1E97:"t\u0308",\u0165:"t\u030C",\u1E6B:"t\u0307",\u0163:"t\u0327",\u00FA:"u\u0301",\u00F9:"u\u0300",\u00FC:"u\u0308",\u01D8:"u\u0308\u0301",\u01DC:"u\u0308\u0300",\u01D6:"u\u0308\u0304",\u01DA:"u\u0308\u030C",\u0169:"u\u0303",\u1E79:"u\u0303\u0301",\u016B:"u\u0304",\u1E7B:"u\u0304\u0308",\u016D:"u\u0306",\u01D4:"u\u030C",\u00FB:"u\u0302",\u016F:"u\u030A",\u0171:"u\u030B",\u1E7D:"v\u0303",\u1E83:"w\u0301",\u1E81:"w\u0300",\u1E85:"w\u0308",\u0175:"w\u0302",\u1E87:"w\u0307",\u1E98:"w\u030A",\u1E8D:"x\u0308",\u1E8B:"x\u0307",\u00FD:"y\u0301",\u1EF3:"y\u0300",\u00FF:"y\u0308",\u1EF9:"y\u0303",\u0233:"y\u0304",\u0177:"y\u0302",\u1E8F:"y\u0307",\u1E99:"y\u030A",\u017A:"z\u0301",\u017E:"z\u030C",\u1E91:"z\u0302",\u017C:"z\u0307",\u00C1:"A\u0301",\u00C0:"A\u0300",\u00C4:"A\u0308",\u01DE:"A\u0308\u0304",\u00C3:"A\u0303",\u0100:"A\u0304",\u0102:"A\u0306",\u1EAE:"A\u0306\u0301",\u1EB0:"A\u0306\u0300",\u1EB4:"A\u0306\u0303",\u01CD:"A\u030C",\u00C2:"A\u0302",\u1EA4:"A\u0302\u0301",\u1EA6:"A\u0302\u0300",\u1EAA:"A\u0302\u0303",\u0226:"A\u0307",\u01E0:"A\u0307\u0304",\u00C5:"A\u030A",\u01FA:"A\u030A\u0301",\u1E02:"B\u0307",\u0106:"C\u0301",\u1E08:"C\u0327\u0301",\u010C:"C\u030C",\u0108:"C\u0302",\u010A:"C\u0307",\u00C7:"C\u0327",\u010E:"D\u030C",\u1E0A:"D\u0307",\u1E10:"D\u0327",\u00C9:"E\u0301",\u00C8:"E\u0300",\u00CB:"E\u0308",\u1EBC:"E\u0303",\u0112:"E\u0304",\u1E16:"E\u0304\u0301",\u1E14:"E\u0304\u0300",\u0114:"E\u0306",\u1E1C:"E\u0327\u0306",\u011A:"E\u030C",\u00CA:"E\u0302",\u1EBE:"E\u0302\u0301",\u1EC0:"E\u0302\u0300",\u1EC4:"E\u0302\u0303",\u0116:"E\u0307",\u0228:"E\u0327",\u1E1E:"F\u0307",\u01F4:"G\u0301",\u1E20:"G\u0304",\u011E:"G\u0306",\u01E6:"G\u030C",\u011C:"G\u0302",\u0120:"G\u0307",\u0122:"G\u0327",\u1E26:"H\u0308",\u021E:"H\u030C",\u0124:"H\u0302",\u1E22:"H\u0307",\u1E28:"H\u0327",\u00CD:"I\u0301",\u00CC:"I\u0300",\u00CF:"I\u0308",\u1E2E:"I\u0308\u0301",\u0128:"I\u0303",\u012A:"I\u0304",\u012C:"I\u0306",\u01CF:"I\u030C",\u00CE:"I\u0302",\u0130:"I\u0307",\u0134:"J\u0302",\u1E30:"K\u0301",\u01E8:"K\u030C",\u0136:"K\u0327",\u0139:"L\u0301",\u013D:"L\u030C",\u013B:"L\u0327",\u1E3E:"M\u0301",\u1E40:"M\u0307",\u0143:"N\u0301",\u01F8:"N\u0300",\u00D1:"N\u0303",\u0147:"N\u030C",\u1E44:"N\u0307",\u0145:"N\u0327",\u00D3:"O\u0301",\u00D2:"O\u0300",\u00D6:"O\u0308",\u022A:"O\u0308\u0304",\u00D5:"O\u0303",\u1E4C:"O\u0303\u0301",\u1E4E:"O\u0303\u0308",\u022C:"O\u0303\u0304",\u014C:"O\u0304",\u1E52:"O\u0304\u0301",\u1E50:"O\u0304\u0300",\u014E:"O\u0306",\u01D1:"O\u030C",\u00D4:"O\u0302",\u1ED0:"O\u0302\u0301",\u1ED2:"O\u0302\u0300",\u1ED6:"O\u0302\u0303",\u022E:"O\u0307",\u0230:"O\u0307\u0304",\u0150:"O\u030B",\u1E54:"P\u0301",\u1E56:"P\u0307",\u0154:"R\u0301",\u0158:"R\u030C",\u1E58:"R\u0307",\u0156:"R\u0327",\u015A:"S\u0301",\u1E64:"S\u0301\u0307",\u0160:"S\u030C",\u1E66:"S\u030C\u0307",\u015C:"S\u0302",\u1E60:"S\u0307",\u015E:"S\u0327",\u0164:"T\u030C",\u1E6A:"T\u0307",\u0162:"T\u0327",\u00DA:"U\u0301",\u00D9:"U\u0300",\u00DC:"U\u0308",\u01D7:"U\u0308\u0301",\u01DB:"U\u0308\u0300",\u01D5:"U\u0308\u0304",\u01D9:"U\u0308\u030C",\u0168:"U\u0303",\u1E78:"U\u0303\u0301",\u016A:"U\u0304",\u1E7A:"U\u0304\u0308",\u016C:"U\u0306",\u01D3:"U\u030C",\u00DB:"U\u0302",\u016E:"U\u030A",\u0170:"U\u030B",\u1E7C:"V\u0303",\u1E82:"W\u0301",\u1E80:"W\u0300",\u1E84:"W\u0308",\u0174:"W\u0302",\u1E86:"W\u0307",\u1E8C:"X\u0308",\u1E8A:"X\u0307",\u00DD:"Y\u0301",\u1EF2:"Y\u0300",\u0178:"Y\u0308",\u1EF8:"Y\u0303",\u0232:"Y\u0304",\u0176:"Y\u0302",\u1E8E:"Y\u0307",\u0179:"Z\u0301",\u017D:"Z\u030C",\u1E90:"Z\u0302",\u017B:"Z\u0307",\u03AC:"\u03B1\u0301",\u1F70:"\u03B1\u0300",\u1FB1:"\u03B1\u0304",\u1FB0:"\u03B1\u0306",\u03AD:"\u03B5\u0301",\u1F72:"\u03B5\u0300",\u03AE:"\u03B7\u0301",\u1F74:"\u03B7\u0300",\u03AF:"\u03B9\u0301",\u1F76:"\u03B9\u0300",\u03CA:"\u03B9\u0308",\u0390:"\u03B9\u0308\u0301",\u1FD2:"\u03B9\u0308\u0300",\u1FD1:"\u03B9\u0304",\u1FD0:"\u03B9\u0306",\u03CC:"\u03BF\u0301",\u1F78:"\u03BF\u0300",\u03CD:"\u03C5\u0301",\u1F7A:"\u03C5\u0300",\u03CB:"\u03C5\u0308",\u03B0:"\u03C5\u0308\u0301",\u1FE2:"\u03C5\u0308\u0300",\u1FE1:"\u03C5\u0304",\u1FE0:"\u03C5\u0306",\u03CE:"\u03C9\u0301",\u1F7C:"\u03C9\u0300",\u038E:"\u03A5\u0301",\u1FEA:"\u03A5\u0300",\u03AB:"\u03A5\u0308",\u1FE9:"\u03A5\u0304",\u1FE8:"\u03A5\u0306",\u038F:"\u03A9\u0301",\u1FFA:"\u03A9\u0300"},Pe=class r{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new wt(e,t,this.mode),this.settings=t,this.leftrightDepth=0}expect(e,t){if(t===void 0&&(t=!0),this.fetch().text!==e)throw new M("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new p0("}")),this.gullet.pushTokens(e);var a=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,a}parseExpression(e,t){for(var a=[];;){this.mode==="math"&&this.consumeSpaces();var n=this.fetch();if(r.endOfExpression.indexOf(n.text)!==-1||t&&n.text===t||e&&L0[n.text]&&L0[n.text].infix)break;var s=this.parseAtom(t);if(s){if(s.type==="internal")continue}else break;a.push(s)}return this.mode==="text"&&this.formLigatures(a),this.handleInfixNodes(a)}handleInfixNodes(e){for(var t=-1,a,n=0;n=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var h=X[this.mode][t].group,c=m0.range(e),p;if(e1.hasOwnProperty(h)){var g=h;p={type:"atom",mode:this.mode,family:g,loc:c,text:t}}else p={type:h,mode:this.mode,loc:c,text:t};o=p}else if(t.charCodeAt(0)>=128)this.settings.strict&&(kr(t.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'"'+(" ("+t.charCodeAt(0)+")"),e)),o={type:"textord",mode:"text",loc:m0.range(e),text:t};else return null;if(this.consume(),s)for(var b=0;bCh5{lIsK%Z9;|`Gn>+YCIZ3GI3OU*OHYPoROA8q!Sh*_0w66
z+(2X!Swt>TKqM0;B8kXj{ZWZRl4>?2nXP=Y)hf;gvJ>b_p#%vLOp#Ky
ziU?yS$R|YPB_&)`&5^&xq0;|0uy$NgEfNrvU{9(Md>EAhfdT)B06Sa%5qv@jKZnyqi7*=G
z@{2L3!N3*HKHy2c|2rd%g)SrFuCWE1M6P2zR>2P-z7wm;3K$ba|koUA;n$*jyIp`>D_?8abKcS_ZrhTEbKT@^dN
zjeBsYV&IEA?uMheLzmQJmNEO%8;NIo8Yd{bbFg50mUAxd;I7Nw*|+w;2|EjaY+YFu
ze6aY*t9`nvs*SwJgwe=`6Kj4?f0augQ1Ge`EsX9YEALj5@3k>0wq--n>+TCVBTi>a
zwr7_jWSL**?O6Rjw0x^i<8+D7Mn9kN;6F7!%~##pQnvPmp2?SEc4ahqUMf64rWB5&
z=T0|!Tu(e{ZS@=O{eyZo-)MGc_Sk=SlZx!*LeqX{x
zkt@%{hWdFiDwnVA)a)ML`^9Q|!--U{>cAMCa-TvucI>bE$h)5R6kQ%eEd}1l;cnWY
z6Y4HT(7g87BIl!L?swc=d1+qjib!1P?jCrnG_X>0=9NHUdT~?yzK;6Rduw%5K_Blf
z*gLKcyLR(HY`?!IBBW$Y`A+
zw&>zV{t~I{;o!8z*?vT4uZcUA@o27NaJwNsayqSJytBnI()hLcc3VQkUa{vwGHbFO
Y7EHE==2d>S)PH#4-16~=Zsj}hH+zR`F#rGn
delta 1100
zcmZ8edrVt(6h6P-y_C{hD}`+0HlZjGsJs@atHn85WD{h{!)Q7krY#Ukcq}ax7lcY8
z#bhi2?;hA~We7urImsSj8_b~tLBMUwL|$Qr5Oo8_AmJfn;OY3oWdD5m&iCDO&Ufzb
zipP0rWqZUp=MFD|8r0+5st`ctB<_UcCOAUIxfr=uMnSG2-L=swdz_L295Nkvs^!nIlKBR~_l}ml4>15&Q^DGm;>s9l4ZULG&dM7N)1r
zT0ianlG_lgNu;;qyY*q`F
zIw9y>K__tPnpOUHCfNNk%E~nasV{2lz)M+QD-h(VPdPZs)ft&3=ytk2xy6s!h&-Sd
z!kh$GU3N$fE|`LaFAOY5X2aHL2qi86iOe8_VQnk{*$_jBOh-V62VuQ&
zkP8xJEncD#ARBPTcSYhr(x+^8o{jnNulFnee?K99a9OhPfI%3P^mVg*iNKHEa^vd-
z+XLOuPjCXqiVz3X9HLr@!yK#_sUzVT!~~9iEHGLxF