From 7c36b06360a1be6f0ee82628ceb54fac316b32ee Mon Sep 17 00:00:00 2001 From: Alex Chang Date: Wed, 14 Oct 2026 07:28:30 -0400 Subject: [PATCH 01/10] feat: version catalogue units and error magnitude semantics --- internal/specnumeric/normalize.go | 63 ++++++++----- internal/specnumeric/predicate.go | 8 ++ internal/specnumeric/profile.go | 17 +++- internal/specnumeric/registry_v2.go | 114 +++++++++++++++++++++++ internal/specnumeric/registry_v2_test.go | 83 +++++++++++++++++ internal/specnumeric/units.go | 10 +- internal/specnumeric/value.go | 23 +++++ 7 files changed, 284 insertions(+), 34 deletions(-) create mode 100644 internal/specnumeric/registry_v2.go create mode 100644 internal/specnumeric/registry_v2_test.go diff --git a/internal/specnumeric/normalize.go b/internal/specnumeric/normalize.go index 3c2d3e7..808e40d 100644 --- a/internal/specnumeric/normalize.go +++ b/internal/specnumeric/normalize.go @@ -24,7 +24,10 @@ type rawSegment struct { lowerInclusive, upperInclusive bool } -type rawParser struct{ rest string } +type rawParser struct { + rest string + units map[string]unitDefinition +} // Normalize derives a candidate under an explicit profile. A nonempty Reason // always prevents treating that candidate as an unconditional numeric fact. @@ -50,12 +53,24 @@ func Normalize(raw string, profile Profile) Result { } input = rest } - p := rawParser{rest: input} + p := rawParser{rest: input, units: registryForVersion(profile.UnitRegistryVersion)} value := Value{SchemaVersion: profile.SchemaVersion, Quantity: profile.Quantity, SemanticRole: profile.SemanticRole, Unit: profile.CanonicalUnit, UnitRegistryVersion: profile.UnitRegistryVersion, Context: Context{Kind: ContextUnconditional}} var reason Reason - if operator := p.takeOne(">=", "<=", "≥", "≤", ">", "<"); operator != "" { + if profile.SemanticRole == RoleErrorMagnitude { + marker := p.takeOne("±", "<=", "≤", "<") + atom, failure := p.atom() + if failure != "" { + return Result{Reason: failure} + } + number, failure := canonicalAtom(atom, "", profile) + if failure != "" { + return Result{Reason: failure} + } + value.Shape = ShapeBoundClaim + value.Bound = &BoundClaim{Direction: BoundUpper, Value: number, Inclusive: marker != "<"} + } else if operator := p.takeOne(">=", "<=", "≥", "≤", ">", "<"); operator != "" { value.Shape = ShapeBoundClaim atom, failure := p.atom() if failure != "" { @@ -155,19 +170,12 @@ func (p *rawParser) atom() (rawAtom, Reason) { } rest = rest[len(text):] unitRest := strings.TrimLeftFunc(rest, unicode.IsSpace) - end := 0 - for end < len(unitRest) { - r, size := utf8.DecodeRuneInString(unitRest[end:]) - if !unicode.IsLetter(r) { - break - } - end += size - } + end := p.unitLength(unitRest) unit := unitRest[:end] // Only registered electrical units are consumed. Words marking roles or // conditions remain suffixes; other adjacent unit text fails closed. if unit != "" { - if _, known := electricalUnits[unit]; known { + if _, known := p.units[unit]; known { rest = unitRest[end:] } else if !conditionalSuffix(unitRest) && !startsRoleMarker(unitRest) { return rawAtom{}, ReasonUnsupportedUnit @@ -179,6 +187,22 @@ func (p *rawParser) atom() (rawAtom, Reason) { return rawAtom{number: number, unit: unit}, "" } +func (p *rawParser) unitLength(rest string) int { + if _, ok := p.units["1"]; ok && strings.HasPrefix(rest, "1") { + return 1 + } + _, percent := p.units["%"] + end := 0 + for end < len(rest) { + r, size := utf8.DecodeRuneInString(rest[end:]) + if !unicode.IsLetter(r) && !(percent && r == '%') { + break + } + end += size + } + return end +} + func (p *rawParser) segment() (rawSegment, Reason) { opening := p.takeOne("[", "(") lower, reason := p.atom() @@ -210,17 +234,10 @@ func (p *rawParser) segment() (rawSegment, Reason) { segment.upperInclusive = closing == "]" // A unit following the closing bracket applies to both endpoints. rest := strings.TrimLeftFunc(p.rest, unicode.IsSpace) - end := 0 - for end < len(rest) { - r, size := utf8.DecodeRuneInString(rest[end:]) - if !unicode.IsLetter(r) { - break - } - end += size - } + end := p.unitLength(rest) if end > 0 { unit := rest[:end] - if _, known := electricalUnits[unit]; known { + if _, known := p.units[unit]; known { if segment.lower.unit != "" || segment.upper.unit != "" { return rawSegment{}, ReasonAmbiguous } @@ -286,8 +303,8 @@ func (p *rawParser) tolerance(nominalAtom rawAtom, profile Profile) (*Tolerance, return nil, reason } tolerance := &Tolerance{Nominal: nominal, Type: ToleranceAbsolute} - if p.takeOne("%") != "" { - if amountAtom.unit != "" { + if amountAtom.unit == "%" || p.takeOne("%") != "" { + if amountAtom.unit != "" && amountAtom.unit != "%" { return nil, ReasonUnsupportedShape } tolerance.Type = ToleranceRelative diff --git a/internal/specnumeric/predicate.go b/internal/specnumeric/predicate.go index f14c79c..976da60 100644 --- a/internal/specnumeric/predicate.go +++ b/internal/specnumeric/predicate.go @@ -52,6 +52,9 @@ func NormalizePredicate(input Predicate, profile Profile) (Predicate, error) { } func predicateCompatible(role string, shape Shape, operator Operator) bool { + if role == RoleErrorMagnitude { + return shape == ShapeBoundClaim && (operator == OperatorLess || operator == OperatorLessEqual) + } switch operator { case OperatorContainsPoint, OperatorContainsRange, OperatorOverlapsRange: return role == RoleOperatingSupport && (shape == ShapeScalar || shape == ShapeDiscreteSet || shape == ShapeIntervalSet) @@ -72,6 +75,11 @@ func Evaluate(value *Value, profile Profile, predicate Predicate) Truth { if err != nil { return Unknown } + if profile.SemanticRole == RoleErrorMagnitude { + // Compare the declared maximum magnitude, not an unknown actual error + // inside the claim and not a nominal value of a tolerance expression. + return evaluateScalar(value.Bound.Value, query) + } switch query.Operator { case OperatorContainsPoint, OperatorContainsRange, OperatorOverlapsRange: return evaluateSupport(*value, query) diff --git a/internal/specnumeric/profile.go b/internal/specnumeric/profile.go index 3107368..236c5ac 100644 --- a/internal/specnumeric/profile.go +++ b/internal/specnumeric/profile.go @@ -28,20 +28,25 @@ type Profile struct { } func ValidateProfile(profile Profile) error { - if profile.SchemaVersion != SchemaVersion || profile.ParserVersion != ParserVersion || profile.UnitRegistryVersion != UnitRegistryVersion || profile.NumericFormat != NumericFormatDecimalDot { + if profile.SchemaVersion != SchemaVersion || !validProfileVersions(profile) || profile.NumericFormat != NumericFormatDecimalDot { return fmt.Errorf("unsupported profile version or numeric format") } switch profile.SemanticRole { case RoleOperatingSupport, RoleNominal, RoleTypical, RoleMinimumLimit, RoleMaximumLimit, RoleAbsoluteMaximum: + case RoleErrorMagnitude: + if profile.ParserVersion != CatalogParserVersion || profile.Quantity != "ratio" { + return fmt.Errorf("unsupported error magnitude profile") + } default: return fmt.Errorf("unsupported semantic role: %q", profile.SemanticRole) } - unit, ok := electricalUnits[profile.CanonicalUnit] + units := registryForVersion(profile.UnitRegistryVersion) + unit, ok := units[profile.CanonicalUnit] if !ok || unit.exponent != 0 || unit.canonical != profile.CanonicalUnit || unit.quantity != profile.Quantity { return fmt.Errorf("invalid canonical unit for quantity") } if profile.DeclaredInputUnit != "" { - input, ok := electricalUnits[profile.DeclaredInputUnit] + input, ok := units[profile.DeclaredInputUnit] if !ok || input.quantity != profile.Quantity { return fmt.Errorf("invalid declared input unit for quantity") } @@ -51,6 +56,9 @@ func ValidateProfile(profile Profile) error { } shapes := map[Shape]bool{} for _, shape := range profile.AllowedShapes { + if profile.SemanticRole == RoleErrorMagnitude && shape != ShapeBoundClaim || profile.Quantity == "count" && shape == ShapeTolerance { + return fmt.Errorf("shape incompatible with quantity or role") + } if !knownShape(shape) || shapes[shape] { return fmt.Errorf("invalid or duplicate allowed shape: %q", shape) } @@ -58,6 +66,9 @@ func ValidateProfile(profile Profile) error { } operators := map[Operator]bool{} for _, operator := range profile.AllowedOperators { + if profile.SemanticRole == RoleErrorMagnitude && operator != OperatorLess && operator != OperatorLessEqual { + return fmt.Errorf("unsupported error magnitude operator") + } if !knownOperator(operator) || operators[operator] { return fmt.Errorf("invalid or duplicate allowed operator: %q", operator) } diff --git a/internal/specnumeric/registry_v2.go b/internal/specnumeric/registry_v2.go new file mode 100644 index 0000000..a98d0b2 --- /dev/null +++ b/internal/specnumeric/registry_v2.go @@ -0,0 +1,114 @@ +package specnumeric + +import ( + "maps" + "math/big" + "sort" +) + +const ( + CatalogParserVersion = "catalog-parser-2" + CatalogUnitRegistryVersion = "catalog-units-2" + RoleErrorMagnitude = "error_magnitude" +) + +var catalogUnits = func() map[string]unitDefinition { + units := maps.Clone(electricalUnits) + for unit, quantity := range map[string]string{"%": "ratio", "dB": "log_gain", "bit": "memory", "W": "power", "m": "length", "H": "inductance", "cd": "luminous_intensity", "1": "count"} { + units[unit] = unitDefinition{quantity, unit, 0} + } + for unit, definition := range map[string]unitDefinition{ + "mW": {"power", "W", -3}, "kW": {"power", "W", 3}, + "mm": {"length", "m", -3}, "µm": {"length", "m", -6}, "um": {"length", "m", -6}, "μm": {"length", "m", -6}, "nm": {"length", "m", -9}, "cm": {"length", "m", -2}, + "mH": {"inductance", "H", -3}, "µH": {"inductance", "H", -6}, "uH": {"inductance", "H", -6}, "μH": {"inductance", "H", -6}, "nH": {"inductance", "H", -9}, + "mcd": {"luminous_intensity", "cd", -3}, "count": {"count", "1", 0}, + } { + units[unit] = definition + } + for unit := range memoryFactors { + units[unit] = unitDefinition{"memory", "bit", 0} + } + return units +}() + +var memoryFactors = map[string]int64{ + "bit": 1, "B": 8, "byte": 8, + "kbit": 1000, "Mbit": 1000000, "Gbit": 1000000000, + "kB": 8000, "MB": 8000000, "GB": 8000000000, + "Kibit": 1024, "Mibit": 1048576, "Gibit": 1073741824, + "KiB": 8192, "MiB": 8388608, "GiB": 8589934592, +} + +func registryForVersion(version string) map[string]unitDefinition { + switch version { + case UnitRegistryVersion: + return electricalUnits + case CatalogUnitRegistryVersion: + return catalogUnits + default: + return nil + } +} + +func validProfileVersions(p Profile) bool { + return p.ParserVersion == ParserVersion && p.UnitRegistryVersion == UnitRegistryVersion || p.ParserVersion == CatalogParserVersion && p.UnitRegistryVersion == CatalogUnitRegistryVersion +} + +func unitFactor(unit string, definition unitDefinition, version string) *big.Rat { + if version == CatalogUnitRegistryVersion { + if factor, ok := memoryFactors[unit]; ok { + return big.NewRat(factor, 1) + } + } + factor := new(big.Int).Exp(big.NewInt(10), big.NewInt(int64(abs(definition.exponent))), nil) + if definition.exponent < 0 { + return new(big.Rat).SetFrac(big.NewInt(1), factor) + } + return new(big.Rat).SetInt(factor) +} + +// SupportedProfiles returns explicit templates, never a rule inferred from a +// Spec's name or display unit. Callers may narrow shapes/operators deliberately. +func SupportedProfiles() []Profile { + canonical := make(map[string]string) + for unit, definition := range catalogUnits { + if unit == definition.canonical { + canonical[definition.quantity] = unit + } + } + quantities := make([]string, 0, len(canonical)) + for quantity := range canonical { + quantities = append(quantities, quantity) + } + sort.Strings(quantities) + var result []Profile + for _, quantity := range quantities { + for _, role := range []string{RoleNominal, RoleTypical, RoleOperatingSupport, RoleMinimumLimit, RoleMaximumLimit, RoleAbsoluteMaximum, RoleErrorMagnitude} { + p := Profile{Quantity: quantity, CanonicalUnit: canonical[quantity], SemanticRole: role, NumericFormat: NumericFormatDecimalDot, SchemaVersion: SchemaVersion, ParserVersion: CatalogParserVersion, UnitRegistryVersion: CatalogUnitRegistryVersion} + p.AllowedShapes = []Shape{ShapeScalar} + p.AllowedOperators = []Operator{OperatorEqual, OperatorLess, OperatorLessEqual, OperatorGreater, OperatorGreaterEqual, OperatorBetween} + switch role { + case RoleOperatingSupport: + p.AllowedShapes = []Shape{ShapeScalar, ShapeDiscreteSet, ShapeIntervalSet} + p.AllowedOperators = []Operator{OperatorContainsPoint, OperatorContainsRange, OperatorOverlapsRange} + case RoleNominal: + if quantity != "count" { + p.AllowedShapes = append(p.AllowedShapes, ShapeTolerance) + } + case RoleMinimumLimit, RoleMaximumLimit, RoleAbsoluteMaximum: + p.AllowedShapes = append(p.AllowedShapes, ShapeBoundClaim) + case RoleErrorMagnitude: + if quantity != "ratio" { + continue + } + p.AllowedShapes = []Shape{ShapeBoundClaim} + p.AllowedOperators = []Operator{OperatorLess, OperatorLessEqual} + } + if quantity == "count" { + p.DeclaredInputUnit = "1" + } + result = append(result, p) + } + } + return result +} diff --git a/internal/specnumeric/registry_v2_test.go b/internal/specnumeric/registry_v2_test.go new file mode 100644 index 0000000..a5b6a27 --- /dev/null +++ b/internal/specnumeric/registry_v2_test.go @@ -0,0 +1,83 @@ +package specnumeric + +import "testing" + +func catalogProfileForTest(quantity, unit string) Profile { + p := electricalProfile(quantity, unit) + p.ParserVersion, p.UnitRegistryVersion = "catalog-parser-2", "catalog-units-2" + return p +} + +func TestCatalogRegistryConvertsDeclaredQuantities(t *testing.T) { + for _, tc := range []struct{ quantity, canonical, raw, want string }{ + {"ratio", "%", "95 %", "95"}, + {"log_gain", "dB", "20 dB", "20"}, + {"memory", "bit", "1 kB", "8000"}, + {"memory", "bit", "1 KiB", "8192"}, + {"power", "W", "250 mW", "0.25"}, + {"length", "m", "2.54 mm", "0.00254"}, + {"inductance", "H", "10 µH", "0.00001"}, + {"luminous_intensity", "cd", "500 mcd", "0.5"}, + {"count", "1", "24", "24"}, + } { + t.Run(tc.raw, func(t *testing.T) { + p := catalogProfileForTest(tc.quantity, tc.canonical) + if tc.quantity == "count" { + p.DeclaredInputUnit = "1" + } + r := Normalize(tc.raw, p) + if r.Reason != "" || r.Candidate == nil || r.Candidate.Scalar == nil || r.Candidate.Scalar.String() != tc.want { + t.Fatalf("Normalize(%q) = %+v, want scalar %s %s", tc.raw, r, tc.want, tc.canonical) + } + }) + } +} + +func TestExtendedRegistryPreservesLegacyProfiles(t *testing.T) { + p := electricalProfile("voltage", "V") + r := Normalize("5000 mV", p) + if r.Reason != "" || r.Candidate == nil || r.Candidate.Scalar.String() != "5" { + t.Fatalf("legacy conversion: %+v", r) + } + p.Quantity, p.CanonicalUnit = "ratio", "%" + if err := ValidateProfile(p); err == nil { + t.Fatal("old registry acquired a new percentage meaning") + } +} + +func TestErrorMagnitudeUsesMaximumError(t *testing.T) { + p := catalogProfileForTest("ratio", "%") + p.SemanticRole, p.AllowedShapes, p.AllowedOperators = "error_magnitude", []Shape{ShapeBoundClaim}, []Operator{OperatorLessEqual} + threshold := decimalForTest(t, "1") + q := Predicate{SpecID: "accuracy", Operator: OperatorLessEqual, Unit: "%", Value: &threshold} + for _, tc := range []struct { + raw string + want Truth + }{{"±0.5 %", Match}, {"1.5 %", NoMatch}} { + r := Normalize(tc.raw, p) + if r.Reason != "" || r.Candidate == nil { + t.Fatalf("normalize %s: %+v", tc.raw, r) + } + if got := Evaluate(r.Candidate, p, q); got != tc.want { + t.Errorf("%s <= 1%%: %s, want %s", tc.raw, got, tc.want) + } + } +} + +func TestCountRejectsFractionalFacts(t *testing.T) { + p := catalogProfileForTest("count", "1") + p.DeclaredInputUnit = "1" + if err := ValidateProfile(p); err != nil { + t.Fatal(err) + } + r := Normalize("1.5", p) + if r.Reason == "" || r.Candidate != nil { + t.Fatalf("fractional count accepted: %+v", r) + } + v := Value{SchemaVersion: 1, Quantity: "count", SemanticRole: RoleOperatingSupport, Shape: ShapeScalar, Unit: "1", UnitRegistryVersion: "catalog-units-2", Context: Context{Kind: ContextUnconditional}} + n := decimalForTest(t, "1.5") + v.Scalar = &n + if err := ValidateValue(v, p); err == nil { + t.Fatal("manual fractional count accepted") + } +} diff --git a/internal/specnumeric/units.go b/internal/specnumeric/units.go index ce66621..f2fa0a1 100644 --- a/internal/specnumeric/units.go +++ b/internal/specnumeric/units.go @@ -2,7 +2,6 @@ package specnumeric import ( "fmt" - "math/big" ) const UnitRegistryVersion = "electrical-1" @@ -30,17 +29,12 @@ func Convert(value Decimal, unit string, profile Profile) (Decimal, error) { if unit == "" { unit = profile.DeclaredInputUnit } - definition, ok := electricalUnits[unit] + definition, ok := registryForVersion(profile.UnitRegistryVersion)[unit] if !ok || definition.quantity != profile.Quantity || definition.canonical != profile.CanonicalUnit { return Decimal{}, fmt.Errorf("unsupported_unit: %q", unit) } - factor := new(big.Int).Exp(big.NewInt(10), big.NewInt(int64(abs(definition.exponent))), nil) converted := value.rat() - if definition.exponent >= 0 { - converted.Mul(converted, new(big.Rat).SetInt(factor)) - } else { - converted.Quo(converted, new(big.Rat).SetInt(factor)) - } + converted.Mul(converted, unitFactor(unit, definition, profile.UnitRegistryVersion)) return decimalFromRat(converted) } diff --git a/internal/specnumeric/value.go b/internal/specnumeric/value.go index 9f5ec91..dfb3b5e 100644 --- a/internal/specnumeric/value.go +++ b/internal/specnumeric/value.go @@ -254,9 +254,32 @@ func ValidateValue(value Value, profile Profile) error { if value.Bound.Direction != BoundLower && value.Bound.Direction != BoundUpper { return fmt.Errorf("invalid bound direction") } + if profile.SemanticRole == RoleErrorMagnitude && (value.Bound.Direction != BoundUpper || value.Bound.Value.rat().Sign() < 0) { + return fmt.Errorf("error magnitude requires a nonnegative upper bound") + } default: return fmt.Errorf("unsupported shape") } + if profile.Quantity == "count" { + var numbers []Decimal + switch value.Shape { + case ShapeScalar: + numbers = append(numbers, *value.Scalar) + case ShapeDiscreteSet: + numbers = value.Values + case ShapeIntervalSet: + for _, interval := range value.Intervals { + numbers = append(numbers, interval.Lower, interval.Upper) + } + case ShapeBoundClaim: + numbers = append(numbers, value.Bound.Value) + } + for _, number := range numbers { + if number.rat().Sign() < 0 || !number.rat().IsInt() { + return fmt.Errorf("count requires nonnegative integers") + } + } + } return nil } From bb86ab3a162e55822b25c2817d50c339fa71932e Mon Sep 17 00:00:00 2001 From: Alex Chang Date: Wed, 14 Oct 2026 07:49:04 -0400 Subject: [PATCH 02/10] feat: persist explicit spec search profiles and durable normalization work --- internal/catalog/product.go | 5 +- internal/catalog/spec_search.go | 29 +++ internal/catalogfilter/clause.go | 15 ++ internal/catalogfilter/profile.go | 105 +++++++++ internal/publishing/protocol.go | 18 ++ internal/searchtext/fold.go | 10 + internal/storage/sqlite/jobs_store.go | 34 ++- internal/storage/sqlite/migrations.go | 54 ++++- .../sqlite/spec_filter_profile_work.go | 93 ++++++++ internal/storage/sqlite/spec_filter_store.go | 118 ++++++++++ .../storage/sqlite/spec_filter_store_test.go | 120 ++++++++++ internal/storage/sqlite/spec_filter_work.go | 220 ++++++++++++++++++ internal/storage/sqlite/spec_numeric_store.go | 210 +++++++++-------- .../storage/sqlite/spec_numeric_store_test.go | 9 +- internal/webapp/jobs.go | 13 +- internal/webapp/server.go | 6 + internal/webapp/spec_filter_settings.go | 115 +++++++++ internal/webapp/spec_numeric_test.go | 12 + 18 files changed, 1072 insertions(+), 114 deletions(-) create mode 100644 internal/catalog/spec_search.go create mode 100644 internal/catalogfilter/clause.go create mode 100644 internal/catalogfilter/profile.go create mode 100644 internal/searchtext/fold.go create mode 100644 internal/storage/sqlite/spec_filter_profile_work.go create mode 100644 internal/storage/sqlite/spec_filter_store.go create mode 100644 internal/storage/sqlite/spec_filter_store_test.go create mode 100644 internal/storage/sqlite/spec_filter_work.go create mode 100644 internal/webapp/spec_filter_settings.go diff --git a/internal/catalog/product.go b/internal/catalog/product.go index ceeda4a..154fdaa 100644 --- a/internal/catalog/product.go +++ b/internal/catalog/product.go @@ -4,8 +4,7 @@ import ( "errors" "strings" - "golang.org/x/text/cases" - "golang.org/x/text/unicode/norm" + "prods/internal/searchtext" ) const SearchProjectionVersion = "x-text-v0.25.0-nfc-casefold-fields-v2" @@ -276,7 +275,7 @@ func (p Product) DisplayName() string { } func FoldSearch(value string) string { - return norm.NFC.String(cases.Fold().String(norm.NFC.String(value))) + return searchtext.Fold(value) } func EscapeLike(value string) string { diff --git a/internal/catalog/spec_search.go b/internal/catalog/spec_search.go new file mode 100644 index 0000000..fd4686d --- /dev/null +++ b/internal/catalog/spec_search.go @@ -0,0 +1,29 @@ +package catalog + +import "prods/internal/catalogfilter" + +type SpecSearchProfile struct { + SpecID string `json:"spec_id"` + SpecSemanticVersion int64 `json:"spec_semantic_version"` + Revision int64 `json:"revision"` + Filterable bool `json:"filterable"` + Profile catalogfilter.Profile `json:"profile"` +} + +type SpecNormalizationWork struct { + ID string `json:"id"` + SpecID string `json:"spec_id"` + Status string `json:"status"` + Cursor string `json:"cursor"` + ProfileRevision int64 `json:"profile_revision"` + SemanticVersion int64 `json:"semantic_version"` + Processed int64 `json:"processed"` + Failed int64 `json:"failed"` + Skipped int64 `json:"skipped"` + Total int64 `json:"total"` +} +type SpecNormalizationWorkItem struct { + SpecValueID string `json:"spec_value_id"` + State string `json:"state"` + Reason string `json:"reason"` +} diff --git a/internal/catalogfilter/clause.go b/internal/catalogfilter/clause.go new file mode 100644 index 0000000..0fc5ba1 --- /dev/null +++ b/internal/catalogfilter/clause.go @@ -0,0 +1,15 @@ +package catalogfilter + +import "prods/internal/specnumeric" + +type Scope struct { + Kind string `json:"kind"` + ID string `json:"id,omitempty"` + Query string `json:"query,omitempty"` +} +type Clause struct { + Field string `json:"field"` + Operator string `json:"operator"` + Values []string `json:"values,omitempty"` + Numeric *specnumeric.Predicate `json:"numeric,omitempty"` +} diff --git a/internal/catalogfilter/profile.go b/internal/catalogfilter/profile.go new file mode 100644 index 0000000..cf547c7 --- /dev/null +++ b/internal/catalogfilter/profile.go @@ -0,0 +1,105 @@ +package catalogfilter + +import ( + "fmt" + "slices" + "strings" + + "prods/internal/searchtext" + "prods/internal/specnumeric" +) + +const TextRule = "unicode-fold-space-1" + +type Profile struct { + Version int `json:"version"` + Kind string `json:"kind"` + TextRule string `json:"text_rule,omitempty"` + Delimiter string `json:"delimiter,omitempty"` + Operators []string `json:"operators"` + Numeric *specnumeric.Profile `json:"numeric,omitempty"` +} + +func DefaultTextProfile() Profile { + return Profile{Version: 1, Kind: "text", TextRule: TextRule, Operators: []string{"equals", "contains"}} +} +func NumericProfile(p specnumeric.Profile) Profile { + result := Profile{Version: 1, Kind: "numeric", Numeric: &p} + for _, op := range p.AllowedOperators { + result.Operators = append(result.Operators, string(op)) + } + return result +} +func ValidateProfile(p Profile) error { + if p.Version != 1 || len(p.Operators) == 0 { + return fmt.Errorf("unsupported search profile version or empty operators") + } + allowed := []string{} + switch p.Kind { + case "text": + allowed = []string{"equals", "contains"} + case "choice", "multi_choice": + allowed = []string{"equals"} + case "numeric": + if p.Numeric == nil { + return fmt.Errorf("numeric profile required") + } + if err := specnumeric.ValidateProfile(*p.Numeric); err != nil { + return err + } + for _, op := range p.Numeric.AllowedOperators { + allowed = append(allowed, string(op)) + } + if len(allowed) != len(p.Operators) { + return fmt.Errorf("numeric operators must match their authoritative profile") + } + default: + return fmt.Errorf("unsupported search kind") + } + seen := map[string]bool{} + for _, op := range p.Operators { + if seen[op] || !slices.Contains(allowed, op) { + return fmt.Errorf("unsupported or duplicate search operator") + } + seen[op] = true + } + if p.Kind == "numeric" { + if p.TextRule != "" || p.Delimiter != "" { + return fmt.Errorf("numeric profile cannot declare text rules") + } + } else { + if p.Numeric != nil || p.TextRule != TextRule { + return fmt.Errorf("unsupported text rule") + } + if p.Kind == "multi_choice" { + if strings.TrimSpace(p.Delimiter) == "" || len(p.Delimiter) > 8 { + return fmt.Errorf("explicit literal delimiter required") + } + } else if p.Delimiter != "" { + return fmt.Errorf("delimiter only applies to declared multiple choices") + } + } + return nil +} + +func FoldText(value string) string { return searchtext.Fold(strings.Join(strings.Fields(value), " ")) } +func Values(raw string, p Profile) ([]string, error) { + if err := ValidateProfile(p); err != nil { + return nil, err + } + if p.Kind == "numeric" { + return nil, fmt.Errorf("numeric facts require controlled adoption") + } + parts := []string{raw} + if p.Kind == "multi_choice" { + parts = strings.Split(raw, p.Delimiter) + } + var result []string + for _, part := range parts { + value := FoldText(part) + if value != "" && !slices.Contains(result, value) { + result = append(result, value) + } + } + return result, nil +} diff --git a/internal/publishing/protocol.go b/internal/publishing/protocol.go index 2afd635..38e3faf 100644 --- a/internal/publishing/protocol.go +++ b/internal/publishing/protocol.go @@ -444,6 +444,24 @@ func (e *Engine) processOne(ctx context.Context) (bool, error) { return profileWorked, err } } + if worker, ok := e.repository.(interface { + ProcessSpecSearchProfileWork(context.Context, int) (bool, error) + }); ok { + worked, err := worker.ProcessSpecSearchProfileWork(ctx, 100) + profileWorked = profileWorked || worked + if err != nil { + return profileWorked, err + } + } + if worker, ok := e.repository.(interface { + ProcessSpecNormalizationWork(context.Context, int) (bool, error) + }); ok { + worked, err := worker.ProcessSpecNormalizationWork(ctx, 100) + profileWorked = profileWorked || worked + if err != nil { + return profileWorked, err + } + } intent, found, err := e.repository.ClaimPublicationIntent(ctx) if err != nil || !found { return profileWorked || found, err diff --git a/internal/searchtext/fold.go b/internal/searchtext/fold.go new file mode 100644 index 0000000..9211f93 --- /dev/null +++ b/internal/searchtext/fold.go @@ -0,0 +1,10 @@ +package searchtext + +import ( + "golang.org/x/text/cases" + "golang.org/x/text/unicode/norm" +) + +// Fold is the pinned NFC/full-case-fold rule shared by keyword and field +// queries. It intentionally preserves diacritics and literal wildcard text. +func Fold(value string) string { return norm.NFC.String(cases.Fold().String(norm.NFC.String(value))) } diff --git a/internal/storage/sqlite/jobs_store.go b/internal/storage/sqlite/jobs_store.go index b660d5e..8484e74 100644 --- a/internal/storage/sqlite/jobs_store.go +++ b/internal/storage/sqlite/jobs_store.go @@ -16,11 +16,12 @@ import ( var ErrJobNotRetryable = errors.New("job is not safely retryable") type JobKinds struct { - Publication bool - Import bool - Backup bool - SMTP bool - Search bool + Normalization bool + Publication bool + Import bool + Backup bool + SMTP bool + Search bool } // JobRecord is an Admin read model over each subsystem's durable metadata. @@ -53,6 +54,7 @@ func (s *Store) RecentJobs(ctx context.Context, kinds JobKinds, limit int) ([]Jo load func(context.Context, int) ([]JobRecord, error) }{ {kinds.Publication, s.recentPublicationJobs}, + {kinds.Normalization, s.recentSpecNormalizationJobs}, {kinds.Import, s.recentImportJobs}, {kinds.Backup, s.recentBackupJobs}, {kinds.SMTP, s.recentSMTPJobs}, @@ -295,3 +297,25 @@ func (s *Store) RetryPublicationJob(ctx context.Context, actorID, failedIntentID CreatedAt: now, UpdatedAt: now, }, nil } + +func (s *Store) recentSpecNormalizationJobs(ctx context.Context, limit int) ([]JobRecord, error) { + rows, err := s.db.QueryContext(ctx, `SELECT id,spec_id,status,processed,total,failed,skipped,created_at,updated_at FROM spec_normalization_work ORDER BY updated_at DESC,id DESC LIMIT ?`, limit) + if err != nil { + return nil, err + } + defer rows.Close() + jobs := []JobRecord{} + for rows.Next() { + job := JobRecord{Kind: "spec_normalization", Stage: "normalize_selected_sources", TargetType: "spec"} + var failed, skipped int64 + if err = rows.Scan(&job.ID, &job.TargetID, &job.Status, &job.ProgressCurrent, &job.ProgressTotal, &failed, &skipped, &job.CreatedAt, &job.UpdatedAt); err != nil { + return nil, err + } + job.Label = fmt.Sprintf("processed: %d; failed: %d; preserved manual: %d", job.ProgressCurrent, failed, skipped) + if failed > 0 { + job.ErrorMessage = fmt.Sprintf("%d source values need review", failed) + } + jobs = append(jobs, job) + } + return jobs, rows.Err() +} diff --git a/internal/storage/sqlite/migrations.go b/internal/storage/sqlite/migrations.go index 5b023fb..784db46 100644 --- a/internal/storage/sqlite/migrations.go +++ b/internal/storage/sqlite/migrations.go @@ -13,7 +13,7 @@ import ( const ( MinimumSupportedSchemaVersion = 1 - CurrentSchemaVersion = 19 + CurrentSchemaVersion = 20 ) var ( @@ -553,6 +553,58 @@ FROM products p WHERE p.record_state='current' AND p.status='published' UPDATE products SET revision=revision+1,updated_by=NULL,updated_at=strftime('%Y-%m-%dT%H:%M:%fZ','now') WHERE record_state='current' AND status='published';`, }, + { + Version: 20, Name: "published-field-filter-profiles-and-normalization-work", Transactional: true, + SQL: `CREATE TABLE spec_filter_profiles ( + spec_id TEXT PRIMARY KEY REFERENCES spec_definitions(id), + revision INTEGER NOT NULL CHECK(revision>=1), + profile_json TEXT NOT NULL, + updated_by TEXT REFERENCES users(id), + updated_at TEXT NOT NULL +); +INSERT INTO spec_filter_profiles(spec_id,revision,profile_json,updated_at) +SELECT sd.id,sd.revision,CASE WHEN np.spec_id IS NULL + THEN '{"version":1,"kind":"text","text_rule":"unicode-fold-space-1","operators":["equals","contains"]}' + ELSE json_object('version',1,'kind','numeric','operators',json_extract(np.profile_json,'$.allowed_operators')) END, + strftime('%Y-%m-%dT%H:%M:%fZ','now') +FROM spec_definitions sd LEFT JOIN spec_numeric_profiles np ON np.spec_id=sd.id; +CREATE TABLE spec_filter_profile_work ( + spec_id TEXT NOT NULL REFERENCES spec_definitions(id),profile_revision INTEGER NOT NULL, + spec_semantic_version INTEGER NOT NULL,cursor_product_id TEXT NOT NULL DEFAULT '', + status TEXT NOT NULL CHECK(status IN ('pending','completed')), + created_at TEXT NOT NULL,updated_at TEXT NOT NULL,PRIMARY KEY(spec_id,profile_revision) +); +CREATE INDEX spec_filter_profile_work_pending_idx ON spec_filter_profile_work(status,spec_id,profile_revision); +CREATE TABLE spec_normalization_work ( + id TEXT PRIMARY KEY,spec_id TEXT NOT NULL REFERENCES spec_definitions(id), + actor_id TEXT NOT NULL REFERENCES users(id),profile_revision INTEGER NOT NULL,spec_semantic_version INTEGER NOT NULL, + status TEXT NOT NULL CHECK(status IN ('pending','completed','superseded')), + cursor_spec_value_id TEXT NOT NULL DEFAULT '',processed INTEGER NOT NULL DEFAULT 0, + failed INTEGER NOT NULL DEFAULT 0,skipped INTEGER NOT NULL DEFAULT 0,total INTEGER NOT NULL, + created_at TEXT NOT NULL,updated_at TEXT NOT NULL +); +CREATE INDEX spec_normalization_work_pending_idx ON spec_normalization_work(status,created_at,id); +CREATE TABLE spec_normalization_work_items ( + work_id TEXT NOT NULL REFERENCES spec_normalization_work(id),spec_value_id TEXT NOT NULL REFERENCES product_spec_values(id), + status TEXT NOT NULL CHECK(status IN ('pending','completed','failed','skipped')), + reason TEXT NOT NULL DEFAULT '',PRIMARY KEY(work_id,spec_value_id) +); +INSERT INTO admin_log(id,actor_id,action,target_type,target_id,result,details_json,created_at) +SELECT 'log_'||lower(hex(randomblob(16))),NULL,'product.filter_model_migrated','product',p.id,'success', + json_object('migration',20,'old_revision',p.revision,'new_revision',p.revision+1),strftime('%Y-%m-%dT%H:%M:%fZ','now') +FROM products p WHERE p.record_state='current' AND p.status='published' + AND NOT EXISTS(SELECT 1 FROM publication_intents pi WHERE pi.entity_type='product' AND pi.entity_id=p.id AND pi.desired_revision=p.revision AND pi.status IN ('pending','processing')); +INSERT INTO publication_intents(id,entity_type,entity_id,desired_revision,cause,status,created_at,updated_at) +SELECT 'out_'||lower(hex(randomblob(16))),'product',p.id,p.revision+1,'product.filter_model_migrated','pending', + strftime('%Y-%m-%dT%H:%M:%fZ','now'),strftime('%Y-%m-%dT%H:%M:%fZ','now') +FROM products p WHERE p.record_state='current' AND p.status='published' + AND NOT EXISTS(SELECT 1 FROM publication_intents pi WHERE pi.entity_type='product' AND pi.entity_id=p.id AND pi.desired_revision=p.revision AND pi.status IN ('pending','processing')) + AND NOT EXISTS(SELECT 1 FROM publication_intents pi WHERE pi.entity_type='product' AND pi.entity_id=p.id + AND pi.desired_revision=p.revision+1 AND pi.status IN ('pending','processing')); +UPDATE products SET revision=revision+1,updated_by=NULL,updated_at=strftime('%Y-%m-%dT%H:%M:%fZ','now') +WHERE record_state='current' AND status='published' + AND NOT EXISTS(SELECT 1 FROM publication_intents pi WHERE pi.entity_type='product' AND pi.entity_id=products.id AND pi.desired_revision=products.revision AND pi.status IN ('pending','processing'));`, + }, } func SupportedSchemaVersion(version int) bool { diff --git a/internal/storage/sqlite/spec_filter_profile_work.go b/internal/storage/sqlite/spec_filter_profile_work.go new file mode 100644 index 0000000..6aceb7b --- /dev/null +++ b/internal/storage/sqlite/spec_filter_profile_work.go @@ -0,0 +1,93 @@ +package sqlite + +import ( + "context" + "database/sql" + "errors" + "time" +) + +// ProcessSpecSearchProfileWork advances one durable, bounded profile batch. +// Admission, target-version validation, stale marking, audit, publication intent, +// and the cursor commit together. Public activation snapshots are never edited. +func (s *Store) ProcessSpecSearchProfileWork(ctx context.Context, limit int) (bool, error) { + if limit <= 0 || limit > 100 { + limit = 100 + } + worked := false + err := s.withWriteTx(ctx, func(tx *sql.Tx) error { + var specID, cursor string + var revision, semantic int64 + err := tx.QueryRowContext(ctx, `SELECT spec_id,profile_revision,spec_semantic_version,cursor_product_id + FROM spec_filter_profile_work WHERE status='pending' ORDER BY created_at,spec_id,profile_revision LIMIT 1`).Scan(&specID, &revision, &semantic, &cursor) + if errors.Is(err, sql.ErrNoRows) { + return nil + } + if err != nil { + return err + } + worked = true + now := time.Now().UTC().Format(time.RFC3339Nano) + var current bool + if err = tx.QueryRowContext(ctx, `SELECT EXISTS(SELECT 1 FROM spec_filter_profiles np JOIN spec_definitions sd ON sd.id=np.spec_id + WHERE np.spec_id=? AND np.revision=? AND sd.semantic_version=? AND sd.semantic_version=?)`, specID, revision, semantic, semantic).Scan(¤t); err != nil { + return err + } + if !current { + // Superseded work may complete only its own durable record. + _, err = tx.ExecContext(ctx, `UPDATE spec_filter_profile_work SET status='completed',updated_at=? WHERE spec_id=? AND profile_revision=? AND spec_semantic_version=?`, now, specID, revision, semantic) + return err + } + rows, err := tx.QueryContext(ctx, `SELECT p.id,p.revision FROM products p WHERE p.record_state='current' AND p.id>? + AND (EXISTS(SELECT 1 FROM product_spec_values pv WHERE pv.product_id=p.id AND pv.spec_id=?) + OR EXISTS(SELECT 1 FROM category_spec_sets cs JOIN spec_set_members sm ON sm.spec_set_id=cs.spec_set_id WHERE cs.category_id=p.category_id AND sm.spec_id=?)) + ORDER BY p.id LIMIT ?`, cursor, specID, specID, limit) + if err != nil { + return err + } + type affectedProduct struct { + id string + revision int64 + } + products := make([]affectedProduct, 0, limit) + for rows.Next() { + var p affectedProduct + if err = rows.Scan(&p.id, &p.revision); err != nil { + rows.Close() + return err + } + products = append(products, p) + } + if err = rows.Err(); err != nil { + rows.Close() + return err + } + if err = rows.Close(); err != nil { + return err + } + for _, p := range products { + if _, err = tx.ExecContext(ctx, `UPDATE normalized_values SET status='stale' WHERE status='current' + AND spec_value_id IN (SELECT id FROM product_spec_values WHERE product_id=? AND spec_id=?) + AND (profile_revision<>? OR spec_semantic_version<>?)`, p.id, specID, revision, semantic); err != nil { + return err + } + if _, err = tx.ExecContext(ctx, `UPDATE products SET revision=revision+1,updated_by=NULL,updated_at=? WHERE id=? AND revision=?`, now, p.id, p.revision); err != nil { + return err + } + if err = appendAudit(ctx, tx, "", "product.spec_filter_profile_changed", "product", p.id, map[string]any{"spec_id": specID, "profile_revision": revision, "spec_semantic_version": semantic, "revision": p.revision + 1}); err != nil { + return err + } + if err = appendPublicationIntent(ctx, tx, p.id, p.revision+1, "product.spec_filter_profile_changed", now); err != nil { + return err + } + cursor = p.id + } + status := "pending" + if len(products) < limit { + status = "completed" + } + _, err = tx.ExecContext(ctx, `UPDATE spec_filter_profile_work SET cursor_product_id=?,status=?,updated_at=? WHERE spec_id=? AND profile_revision=? AND spec_semantic_version=? AND status='pending'`, cursor, status, now, specID, revision, semantic) + return err + }) + return worked, err +} diff --git a/internal/storage/sqlite/spec_filter_store.go b/internal/storage/sqlite/spec_filter_store.go new file mode 100644 index 0000000..b1c85d3 --- /dev/null +++ b/internal/storage/sqlite/spec_filter_store.go @@ -0,0 +1,118 @@ +package sqlite + +import ( + "context" + "database/sql" + "encoding/json" + "fmt" + "time" + + "prods/internal/catalog" + "prods/internal/catalogfilter" + "prods/internal/identity" + "prods/internal/specnumeric" +) + +type specProfileQuerier interface { + QueryRowContext(context.Context, string, ...any) *sql.Row +} + +func readSpecSearchProfile(ctx context.Context, q specProfileQuerier, id string) (catalog.SpecSearchProfile, error) { + var result catalog.SpecSearchProfile + var metadata, numeric string + var numericSemantic int64 + err := q.QueryRowContext(ctx, `SELECT sd.id,sd.semantic_version,sd.revision,sd.filterable,COALESCE(sf.profile_json,''),COALESCE(np.profile_json,''),COALESCE(np.spec_semantic_version,0) + FROM spec_definitions sd LEFT JOIN spec_filter_profiles sf ON sf.spec_id=sd.id LEFT JOIN spec_numeric_profiles np ON np.spec_id=sd.id WHERE sd.id=?`, id).Scan(&result.SpecID, &result.SpecSemanticVersion, &result.Revision, &result.Filterable, &metadata, &numeric, &numericSemantic) + if err != nil { + return result, err + } + if metadata == "" { + result.Profile = catalogfilter.DefaultTextProfile() + } else if err = json.Unmarshal([]byte(metadata), &result.Profile); err != nil { + return result, err + } + if result.Profile.Kind == "numeric" { + if numeric == "" || numericSemantic != result.SpecSemanticVersion { + return result, catalog.ErrInvalidSpec + } + var p specnumeric.Profile + if err = json.Unmarshal([]byte(numeric), &p); err != nil { + return result, err + } + result.Profile.Numeric = &p + } + if err = catalogfilter.ValidateProfile(result.Profile); err != nil { + return result, fmt.Errorf("%w: %v", catalog.ErrInvalidSpec, err) + } + return result, nil +} + +func (s *Store) SpecSearchProfile(ctx context.Context, id string) (catalog.SpecSearchProfile, error) { + return readSpecSearchProfile(ctx, s.db, id) +} + +func saveSpecSearchMetadataTx(ctx context.Context, tx *sql.Tx, actorID, id string, revision int64, p catalogfilter.Profile, now string) error { + // Numeric meaning lives solely in spec_numeric_profiles. Metadata records + // only presentation kind/operators; readers attach that authoritative row. + p.Numeric = nil + encoded, err := json.Marshal(p) + if err != nil { + return err + } + _, err = tx.ExecContext(ctx, `INSERT INTO spec_filter_profiles(spec_id,revision,profile_json,updated_by,updated_at) VALUES(?,?,?,?,?) + ON CONFLICT(spec_id) DO UPDATE SET revision=excluded.revision,profile_json=excluded.profile_json,updated_by=excluded.updated_by,updated_at=excluded.updated_at`, id, revision, string(encoded), actorID, now) + return err +} + +func (s *Store) ConfigureSpecSearchProfile(ctx context.Context, actorID, specID string, expectedRevision int64, desired catalog.SpecSearchProfile) (catalog.SpecSearchProfile, error) { + if err := catalogfilter.ValidateProfile(desired.Profile); err != nil { + return catalog.SpecSearchProfile{}, fmt.Errorf("%w: %v", catalog.ErrInvalidSpec, err) + } + var result catalog.SpecSearchProfile + err := s.withWriteTx(ctx, func(tx *sql.Tx) error { + if desired.Profile.Kind == "numeric" { + var numeric catalog.SpecNumericProfile + if err := configureSpecNumericProfileTx(ctx, tx, actorID, specID, expectedRevision, *desired.Profile.Numeric, &numeric); err != nil { + return err + } + if _, err := tx.ExecContext(ctx, `UPDATE spec_definitions SET filterable=? WHERE id=?`, desired.Filterable, specID); err != nil { + return err + } + var err error + result, err = readSpecSearchProfile(ctx, tx, specID) + return err + } + if err := requireActorCapability(ctx, tx, actorID, identity.CapabilityCatalogEdit); err != nil { + return err + } + var revision, semantic int64 + if err := tx.QueryRowContext(ctx, `SELECT revision,semantic_version FROM spec_definitions WHERE id=?`, specID).Scan(&revision, &semantic); err != nil { + return err + } + if revision != expectedRevision { + return catalog.ErrRevisionConflict + } + now := time.Now().UTC().Format(time.RFC3339Nano) + revision++ + semantic++ + if _, err := tx.ExecContext(ctx, `UPDATE spec_definitions SET filterable=?,revision=?,semantic_version=?,updated_by=?,updated_at=? WHERE id=? AND revision=?`, desired.Filterable, revision, semantic, actorID, now, specID, expectedRevision); err != nil { + return err + } + if err := saveSpecSearchMetadataTx(ctx, tx, actorID, specID, revision, desired.Profile, now); err != nil { + return err + } + if _, err := tx.ExecContext(ctx, `INSERT INTO spec_filter_profile_work(spec_id,profile_revision,spec_semantic_version,status,created_at,updated_at) VALUES(?,?,?,'pending',?,?)`, specID, revision, semantic, now, now); err != nil { + return err + } + if err := appendAudit(ctx, tx, actorID, "spec.search_profile_configured", "spec", specID, map[string]any{"revision": revision, "spec_semantic_version": semantic, "kind": desired.Profile.Kind, "filterable": desired.Filterable}); err != nil { + return err + } + var err error + result, err = readSpecSearchProfile(ctx, tx, specID) + return err + }) + if err != nil { + return catalog.SpecSearchProfile{}, err + } + return result, nil +} diff --git a/internal/storage/sqlite/spec_filter_store_test.go b/internal/storage/sqlite/spec_filter_store_test.go new file mode 100644 index 0000000..b0d358a --- /dev/null +++ b/internal/storage/sqlite/spec_filter_store_test.go @@ -0,0 +1,120 @@ +package sqlite + +import ( + "errors" + "testing" + + "prods/internal/catalog" + "prods/internal/catalogfilter" +) + +func TestSpecSearchProfileRequiresExpectedRevision(t *testing.T) { + s, owner := installedStore(t) + spec, err := s.CreateSpecDefinition(t.Context(), owner.ID, catalog.SpecDefinition{Name: "Interface", Filterable: true}) + if err != nil { + t.Fatal(err) + } + p := catalog.SpecSearchProfile{Filterable: true, Profile: catalogfilter.Profile{Version: 1, Kind: "choice", TextRule: "unicode-fold-space-1", Operators: []string{"equals"}}} + got, err := s.ConfigureSpecSearchProfile(t.Context(), owner.ID, spec.ID, spec.Revision, p) + if err != nil { + t.Fatal(err) + } + if got.Revision != spec.Revision+1 || got.Profile.Kind != "choice" { + t.Fatalf("configured: %+v", got) + } + p.Profile.Kind = "text" + if _, err = s.ConfigureSpecSearchProfile(t.Context(), owner.ID, spec.ID, spec.Revision, p); !errors.Is(err, catalog.ErrRevisionConflict) { + t.Fatalf("stale config: %v", err) + } + current, err := s.SpecSearchProfile(t.Context(), spec.ID) + if err != nil || current.Profile.Kind != "choice" { + t.Fatalf("config replaced: %+v %v", current, err) + } + var work int + if err = s.db.QueryRow(`SELECT COUNT(*) FROM spec_filter_profile_work WHERE spec_id=? AND status='pending'`, spec.ID).Scan(&work); err != nil || work != 1 { + t.Fatalf("durable work=%d err=%v", work, err) + } +} + +func TestNormalizationWorkPreservesManualPreferenceAndRaw(t *testing.T) { + f := newNormalizationFixture(t) + manual := f.adopt(t) + c := f.snapshot(t) + if _, err := f.store.SaveSpecValue(t.Context(), f.actor, c.ProductID, c.SpecID, "4–6V", "en-US", c.Expected.ProductRevision); err != nil { + t.Fatal(err) + } + p, err := f.store.SpecSearchProfile(t.Context(), c.SpecID) + if err != nil { + t.Fatal(err) + } + work, err := f.store.StartSpecNormalizationWork(t.Context(), f.actor, c.SpecID, p.Revision) + if err != nil { + t.Fatal(err) + } + for { + worked, err := f.store.ProcessSpecNormalizationWork(t.Context(), 1) + if err != nil { + t.Fatal(err) + } + if !worked { + break + } + } + current := f.snapshot(t) + if current.Raw != "4–6V" || current.Selection.Preference != catalog.NormalizedManual || current.Selection.SelectedNormalizedValueID != manual.NormalizedValueID { + t.Fatalf("manual/source changed: %+v", current) + } + state, err := f.store.SpecNormalizationWork(t.Context(), work.ID) + if err != nil || state.Status != "completed" || state.Skipped != 1 || state.Processed != 1 { + t.Fatalf("work: %+v err=%v", state, err) + } +} + +func TestTextSearchProfileInvalidatesNumericContext(t *testing.T) { + f := newNormalizationFixture(t) + c := f.snapshot(t) + p, err := f.store.SpecSearchProfile(t.Context(), c.SpecID) + if err != nil { + t.Fatal(err) + } + p.Profile = catalogfilter.DefaultTextProfile() + if _, err = f.store.ConfigureSpecSearchProfile(t.Context(), f.actor, c.SpecID, p.Revision, p); err != nil { + t.Fatal(err) + } + if _, err = f.store.SpecNormalizationContext(t.Context(), c.SpecValueID); !errors.Is(err, catalog.ErrRevisionConflict) { + t.Fatalf("obsolete numeric meaning remained editable: %v", err) + } +} + +func TestNormalizationWorkReportsUnsupportedRaw(t *testing.T) { + f := newNormalizationFixture(t) + c := f.snapshot(t) + if _, err := f.store.SaveSpecValue(t.Context(), f.actor, c.ProductID, c.SpecID, "62 accuracy", "en-US", c.Expected.ProductRevision); err != nil { + t.Fatal(err) + } + p, err := f.store.SpecSearchProfile(t.Context(), c.SpecID) + if err != nil { + t.Fatal(err) + } + work, err := f.store.StartSpecNormalizationWork(t.Context(), f.actor, c.SpecID, p.Revision) + if err != nil { + t.Fatal(err) + } + for { + worked, err := f.store.ProcessSpecNormalizationWork(t.Context(), 1) + if err != nil { + t.Fatal(err) + } + if !worked { + break + } + } + state, err := f.store.SpecNormalizationWork(t.Context(), work.ID) + if err != nil || state.Failed != 1 { + t.Fatalf("work: %+v err=%v", state, err) + } + current := f.snapshot(t) + if current.Raw != "62 accuracy" || current.Selection.SelectedNormalizedValueID != "" { + t.Fatalf("invented numeric fact: %+v", current) + } +} diff --git a/internal/storage/sqlite/spec_filter_work.go b/internal/storage/sqlite/spec_filter_work.go new file mode 100644 index 0000000..98b93d0 --- /dev/null +++ b/internal/storage/sqlite/spec_filter_work.go @@ -0,0 +1,220 @@ +package sqlite + +import ( + "context" + "database/sql" + "errors" + "time" + + "prods/internal/catalog" + "prods/internal/identity" + "prods/internal/specnumeric" +) + +func (s *Store) StartSpecNormalizationWork(ctx context.Context, actorID, specID string, expectedRevision int64) (catalog.SpecNormalizationWork, error) { + id, err := randomID("snw") + if err != nil { + return catalog.SpecNormalizationWork{}, err + } + err = s.withWriteTx(ctx, func(tx *sql.Tx) error { + if err := requireActorCapability(ctx, tx, actorID, identity.CapabilityCatalogEdit); err != nil { + return err + } + p, err := readSpecSearchProfile(ctx, tx, specID) + if err != nil { + return err + } + if p.Revision != expectedRevision { + return catalog.ErrRevisionConflict + } + if p.Profile.Kind != "numeric" { + return catalog.ErrInvalidSpec + } + var profileRevision int64 + if err = tx.QueryRowContext(ctx, `SELECT revision FROM spec_numeric_profiles WHERE spec_id=?`, specID).Scan(&profileRevision); err != nil { + return err + } + var existing string + err = tx.QueryRowContext(ctx, `SELECT id FROM spec_normalization_work WHERE spec_id=? AND profile_revision=? AND spec_semantic_version=? AND status='pending' ORDER BY created_at,id LIMIT 1`, specID, profileRevision, p.SpecSemanticVersion).Scan(&existing) + if err == nil { + id = existing + return nil + } + if !errors.Is(err, sql.ErrNoRows) { + return err + } + now := time.Now().UTC().Format(time.RFC3339Nano) + if _, err = tx.ExecContext(ctx, `INSERT INTO spec_normalization_work(id,spec_id,actor_id,profile_revision,spec_semantic_version,status,total,created_at,updated_at) VALUES(?,?,?,?,?,'pending',0,?,?)`, id, specID, actorID, profileRevision, p.SpecSemanticVersion, now, now); err != nil { + return err + } + if _, err = tx.ExecContext(ctx, `INSERT INTO spec_normalization_work_items(work_id,spec_value_id,status) + SELECT ?,pv.id,'pending' FROM product_spec_sources ps JOIN product_spec_values pv ON pv.id=ps.spec_value_id + JOIN products p ON p.id=pv.product_id JOIN spec_definitions sd ON sd.id=pv.spec_id + WHERE pv.spec_id=? AND ps.product_id=pv.product_id AND ps.spec_id=pv.spec_id AND pv.active=1 AND sd.status='active' AND p.record_state='current' + AND EXISTS(SELECT 1 FROM category_spec_sets cs JOIN spec_set_members sm ON sm.spec_set_id=cs.spec_set_id WHERE cs.category_id=p.category_id AND sm.spec_id=pv.spec_id)`, id, specID); err != nil { + return err + } + if _, err = tx.ExecContext(ctx, `UPDATE spec_normalization_work SET total=(SELECT COUNT(*) FROM spec_normalization_work_items WHERE work_id=?) WHERE id=?`, id, id); err != nil { + return err + } + return appendAudit(ctx, tx, actorID, "spec.normalization_work_started", "spec", specID, map[string]any{"work_id": id, "profile_revision": profileRevision, "spec_semantic_version": p.SpecSemanticVersion}) + }) + if err != nil { + return catalog.SpecNormalizationWork{}, err + } + return s.SpecNormalizationWork(ctx, id) +} + +func (s *Store) SpecNormalizationWork(ctx context.Context, id string) (catalog.SpecNormalizationWork, error) { + var w catalog.SpecNormalizationWork + err := s.db.QueryRowContext(ctx, `SELECT id,spec_id,status,cursor_spec_value_id,profile_revision,spec_semantic_version,processed,failed,skipped,total FROM spec_normalization_work WHERE id=?`, id).Scan(&w.ID, &w.SpecID, &w.Status, &w.Cursor, &w.ProfileRevision, &w.SemanticVersion, &w.Processed, &w.Failed, &w.Skipped, &w.Total) + return w, err +} + +func (s *Store) SpecNormalizationWorkItems(ctx context.Context, id string, page, pageSize int) ([]catalog.SpecNormalizationWorkItem, int, error) { + if page < 1 || pageSize < 1 || pageSize > 100 { + return nil, 0, catalog.ErrInvalidSpec + } + tx, err := s.db.BeginTx(ctx, &sql.TxOptions{ReadOnly: true}) + if err != nil { + return nil, 0, err + } + defer tx.Rollback() + var total int + if err = tx.QueryRowContext(ctx, `SELECT COUNT(*) FROM spec_normalization_work_items WHERE work_id=?`, id).Scan(&total); err != nil { + return nil, 0, err + } + rows, err := tx.QueryContext(ctx, `SELECT spec_value_id,status,reason FROM spec_normalization_work_items WHERE work_id=? ORDER BY spec_value_id LIMIT ? OFFSET ?`, id, pageSize, (page-1)*pageSize) + if err != nil { + return nil, 0, err + } + defer rows.Close() + result := []catalog.SpecNormalizationWorkItem{} + for rows.Next() { + var item catalog.SpecNormalizationWorkItem + if err = rows.Scan(&item.SpecValueID, &item.State, &item.Reason); err != nil { + return nil, 0, err + } + result = append(result, item) + } + return result, total, rows.Err() +} + +// Each item uses a frozen parsing context outside admission, then commits the +// controlled result, publication intent, audit and durable progress together. +func (s *Store) ProcessSpecNormalizationWork(ctx context.Context, limit int) (bool, error) { + if limit < 1 || limit > 100 { + limit = 100 + } + var id, actor string + err := s.db.QueryRowContext(ctx, `SELECT id,actor_id FROM spec_normalization_work WHERE status='pending' ORDER BY created_at,id LIMIT 1`).Scan(&id, &actor) + if errors.Is(err, sql.ErrNoRows) { + return false, nil + } + if err != nil { + return false, err + } + work, err := s.SpecNormalizationWork(ctx, id) + if err != nil { + return true, err + } + rows, err := s.db.QueryContext(ctx, `SELECT spec_value_id FROM spec_normalization_work_items WHERE work_id=? AND status='pending' ORDER BY spec_value_id LIMIT ?`, id, limit) + if err != nil { + return true, err + } + var values []string + for rows.Next() { + var value string + if err = rows.Scan(&value); err != nil { + rows.Close() + return true, err + } + values = append(values, value) + } + if err = rows.Err(); err != nil { + rows.Close() + return true, err + } + rows.Close() + for _, valueID := range values { + frozen, contextErr := s.SpecNormalizationContext(ctx, valueID) + state, reason, encoded := "completed", "", "" + if contextErr != nil { + state, reason = "failed", "context_changed" + } else if frozen.Selection.Preference == catalog.NormalizedManual { + state, reason = "skipped", "manual_preference" + } else { + parsed := specnumeric.Normalize(frozen.Raw, frozen.Profile) + reason = string(parsed.Reason) + if parsed.Candidate != nil { + encoded, err = specnumeric.MarshalValue(*parsed.Candidate) + if err != nil { + return true, err + } + } + if reason != "" || encoded == "" { + state = "failed" + } + } + err = s.withWriteTx(ctx, func(tx *sql.Tx) error { + var current bool + if err := tx.QueryRowContext(ctx, `SELECT EXISTS(SELECT 1 FROM spec_normalization_work w JOIN spec_numeric_profiles np ON np.spec_id=w.spec_id JOIN spec_definitions sd ON sd.id=w.spec_id + WHERE w.id=? AND w.status='pending' AND np.revision=w.profile_revision AND np.spec_semantic_version=w.spec_semantic_version AND sd.semantic_version=w.spec_semantic_version)`, id).Scan(¤t); err != nil { + return err + } + if !current { + _, err := tx.ExecContext(ctx, `UPDATE spec_normalization_work SET status='superseded',updated_at=? WHERE id=? AND status='pending'`, time.Now().UTC().Format(time.RFC3339Nano), id) + return err + } + if err := requireActorCapability(ctx, tx, actor, identity.CapabilityCatalogEdit); err != nil { + state, reason = "failed", "permission_changed" + } else if contextErr == nil { + if frozen.Expected.ProfileRevision != work.ProfileRevision || frozen.Expected.SpecSemanticVersion != work.SemanticVersion { + state, reason = "failed", "profile_changed" + } else if err := checkNormalizationContextTx(ctx, tx, actor, frozen, frozen.Expected); err != nil { + state, reason = "failed", "context_changed" + } else if state != "skipped" { + var outcome catalog.NormalizationOutcome + if err := recordControlledNormalizationTx(ctx, tx, actor, frozen, frozen.Expected, encoded, reason, catalog.NormalizedAutomatic, false, &outcome); err != nil { + return err + } + } + } + result, err := tx.ExecContext(ctx, `UPDATE spec_normalization_work_items SET status=?,reason=? WHERE work_id=? AND spec_value_id=? AND status='pending'`, state, reason, id, valueID) + if err != nil { + return err + } + n, err := result.RowsAffected() + if err != nil { + return err + } + if n == 0 { + return nil + } + failed, skipped := 0, 0 + if state == "failed" { + failed = 1 + } + if state == "skipped" { + skipped = 1 + } + _, err = tx.ExecContext(ctx, `UPDATE spec_normalization_work SET processed=processed+1,failed=failed+?,skipped=skipped+?,cursor_spec_value_id=?,updated_at=? WHERE id=? AND status='pending'`, failed, skipped, valueID, time.Now().UTC().Format(time.RFC3339Nano), id) + return err + }) + if err != nil { + return true, err + } + } + err = s.withWriteTx(ctx, func(tx *sql.Tx) error { + result, err := tx.ExecContext(ctx, `UPDATE spec_normalization_work SET status='completed',updated_at=? WHERE id=? AND status='pending' AND processed=total`, time.Now().UTC().Format(time.RFC3339Nano), id) + if err != nil { + return err + } + n, err := result.RowsAffected() + if err != nil || n == 0 { + return err + } + return appendAudit(ctx, tx, actor, "spec.normalization_work_completed", "spec", work.SpecID, map[string]any{"work_id": id}) + }) + return true, err +} diff --git a/internal/storage/sqlite/spec_numeric_store.go b/internal/storage/sqlite/spec_numeric_store.go index b7a588c..61756f3 100644 --- a/internal/storage/sqlite/spec_numeric_store.go +++ b/internal/storage/sqlite/spec_numeric_store.go @@ -9,6 +9,7 @@ import ( "time" "prods/internal/catalog" + "prods/internal/catalogfilter" "prods/internal/identity" "prods/internal/specnumeric" ) @@ -17,61 +18,68 @@ func (s *Store) ConfigureSpecNumericProfile(ctx context.Context, actorID, specID if err := specnumeric.ValidateProfile(profile); err != nil { return catalog.SpecNumericProfile{}, fmt.Errorf("%w: %v", catalog.ErrInvalidSpec, err) } - encoded, err := json.Marshal(profile) + var result catalog.SpecNumericProfile + err := s.withWriteTx(ctx, func(tx *sql.Tx) error { + return configureSpecNumericProfileTx(ctx, tx, actorID, specID, expectedRevision, profile, &result) + }) if err != nil { return catalog.SpecNumericProfile{}, err } - var result catalog.SpecNumericProfile - err = s.withWriteTx(ctx, func(tx *sql.Tx) error { - if err := requireActorCapability(ctx, tx, actorID, identity.CapabilityCatalogEdit); err != nil { - return err - } - var revision, semantic int64 - if err := tx.QueryRowContext(ctx, `SELECT revision,semantic_version FROM spec_definitions WHERE id=?`, specID).Scan(&revision, &semantic); err != nil { - return err - } - if revision != expectedRevision { - return catalog.ErrRevisionConflict - } - var previousJSON string - var profileRevision int64 - err := tx.QueryRowContext(ctx, `SELECT profile_json,revision FROM spec_numeric_profiles WHERE spec_id=?`, specID).Scan(&previousJSON, &profileRevision) - if err != nil && !errors.Is(err, sql.ErrNoRows) { - return err - } - if err == nil { - var previous specnumeric.Profile - if err := json.Unmarshal([]byte(previousJSON), &previous); err != nil { - return err - } - if previous.Quantity != profile.Quantity || previous.SemanticRole != profile.SemanticRole { - return catalog.ErrInvalidSpec - } - } - semantic++ - profileRevision++ - now := time.Now().UTC().Format(time.RFC3339Nano) - if _, err := tx.ExecContext(ctx, `INSERT INTO spec_numeric_profiles(spec_id,spec_semantic_version,revision,profile_json,updated_by,updated_at) - VALUES(?,?,?,?,?,?) ON CONFLICT(spec_id) DO UPDATE SET spec_semantic_version=excluded.spec_semantic_version, - revision=excluded.revision,profile_json=excluded.profile_json,updated_by=excluded.updated_by,updated_at=excluded.updated_at`, specID, semantic, profileRevision, string(encoded), actorID, now); err != nil { - return err - } - if _, err := tx.ExecContext(ctx, `UPDATE spec_definitions SET semantic_version=?,revision=revision+1,updated_by=?,updated_at=? WHERE id=? AND revision=?`, semantic, actorID, now, specID, expectedRevision); err != nil { - return err - } - if _, err := tx.ExecContext(ctx, `INSERT INTO spec_numeric_profile_work(spec_id,profile_revision,spec_semantic_version,status,created_at,updated_at) VALUES(?,?,?,'pending',?,?)`, specID, profileRevision, semantic, now, now); err != nil { + return result, nil +} + +func configureSpecNumericProfileTx(ctx context.Context, tx *sql.Tx, actorID, specID string, expectedRevision int64, profile specnumeric.Profile, result *catalog.SpecNumericProfile) error { + encoded, err := json.Marshal(profile) + if err != nil { + return err + } + if err := requireActorCapability(ctx, tx, actorID, identity.CapabilityCatalogEdit); err != nil { + return err + } + var revision, semantic int64 + if err := tx.QueryRowContext(ctx, `SELECT revision,semantic_version FROM spec_definitions WHERE id=?`, specID).Scan(&revision, &semantic); err != nil { + return err + } + if revision != expectedRevision { + return catalog.ErrRevisionConflict + } + var previousJSON string + var profileRevision int64 + err = tx.QueryRowContext(ctx, `SELECT profile_json,revision FROM spec_numeric_profiles WHERE spec_id=?`, specID).Scan(&previousJSON, &profileRevision) + if err != nil && !errors.Is(err, sql.ErrNoRows) { + return err + } + if err == nil { + var previous specnumeric.Profile + if err := json.Unmarshal([]byte(previousJSON), &previous); err != nil { return err } - if err := appendAudit(ctx, tx, actorID, "spec.numeric_profile_configured", "spec", specID, map[string]any{"profile_revision": profileRevision, "spec_semantic_version": semantic}); err != nil { - return err + if previous.Quantity != profile.Quantity || previous.SemanticRole != profile.SemanticRole { + return catalog.ErrInvalidSpec } - result = catalog.SpecNumericProfile{SpecID: specID, SpecSemanticVersion: semantic, Revision: profileRevision, Profile: profile} - return nil - }) - if err != nil { - return catalog.SpecNumericProfile{}, err } - return result, nil + semantic++ + profileRevision++ + now := time.Now().UTC().Format(time.RFC3339Nano) + if _, err := tx.ExecContext(ctx, `INSERT INTO spec_numeric_profiles(spec_id,spec_semantic_version,revision,profile_json,updated_by,updated_at) + VALUES(?,?,?,?,?,?) ON CONFLICT(spec_id) DO UPDATE SET spec_semantic_version=excluded.spec_semantic_version, + revision=excluded.revision,profile_json=excluded.profile_json,updated_by=excluded.updated_by,updated_at=excluded.updated_at`, specID, semantic, profileRevision, string(encoded), actorID, now); err != nil { + return err + } + if _, err := tx.ExecContext(ctx, `UPDATE spec_definitions SET semantic_version=?,revision=revision+1,updated_by=?,updated_at=? WHERE id=? AND revision=?`, semantic, actorID, now, specID, expectedRevision); err != nil { + return err + } + if _, err := tx.ExecContext(ctx, `INSERT INTO spec_numeric_profile_work(spec_id,profile_revision,spec_semantic_version,status,created_at,updated_at) VALUES(?,?,?,'pending',?,?)`, specID, profileRevision, semantic, now, now); err != nil { + return err + } + if err := appendAudit(ctx, tx, actorID, "spec.numeric_profile_configured", "spec", specID, map[string]any{"profile_revision": profileRevision, "spec_semantic_version": semantic}); err != nil { + return err + } + if err := saveSpecSearchMetadataTx(ctx, tx, actorID, specID, expectedRevision+1, catalogfilter.NumericProfile(profile), now); err != nil { + return err + } + *result = catalog.SpecNumericProfile{SpecID: specID, SpecSemanticVersion: semantic, Revision: profileRevision, Profile: profile} + return nil } // One statement freezes Raw, profile and all expectations in one read snapshot. @@ -79,10 +87,11 @@ func (s *Store) ConfigureSpecNumericProfile(ctx context.Context, actorID, specID func (s *Store) SpecNormalizationContext(ctx context.Context, specValueID string) (catalog.SpecNormalizationContext, error) { var result catalog.SpecNormalizationContext var encoded string + var profileSemantic int64 err := s.db.QueryRowContext(ctx, `SELECT pv.id,pv.product_id,pv.spec_id,pv.raw_value,pv.source_origin_locale, p.revision,pv.source_revision,sd.semantic_version,np.revision,np.profile_json, COALESCE(ns.selected_normalized_value_id,''),COALESCE(ns.preference,''),COALESCE(ns.revision,0), - COALESCE(ps.spec_value_id,''),COALESCE(ps.revision,0) + COALESCE(ps.spec_value_id,''),COALESCE(ps.revision,0),np.spec_semantic_version FROM product_spec_values pv JOIN products p ON p.id=pv.product_id JOIN spec_definitions sd ON sd.id=pv.spec_id JOIN spec_numeric_profiles np ON np.spec_id=pv.spec_id LEFT JOIN spec_normalization_selections ns ON ns.spec_value_id=pv.id @@ -90,10 +99,13 @@ func (s *Store) SpecNormalizationContext(ctx context.Context, specValueID string WHERE pv.id=?`, specValueID).Scan(&result.SpecValueID, &result.ProductID, &result.SpecID, &result.Raw, &result.SourceLocale, &result.Expected.ProductRevision, &result.Expected.SourceRevision, &result.Expected.SpecSemanticVersion, &result.Expected.ProfileRevision, &encoded, &result.Selection.SelectedNormalizedValueID, &result.Selection.Preference, - &result.Expected.SelectionRevision, &result.SourceSelection.SpecValueID, &result.SourceSelection.Revision) + &result.Expected.SelectionRevision, &result.SourceSelection.SpecValueID, &result.SourceSelection.Revision, &profileSemantic) if err != nil { return catalog.SpecNormalizationContext{}, err } + if profileSemantic != result.Expected.SpecSemanticVersion { + return catalog.SpecNormalizationContext{}, catalog.ErrRevisionConflict + } if err := json.Unmarshal([]byte(encoded), &result.Profile); err != nil { return catalog.SpecNormalizationContext{}, err } @@ -188,63 +200,67 @@ func checkNormalizationContextTx(ctx context.Context, tx *sql.Tx, actorID string } func (s *Store) recordControlledNormalization(ctx context.Context, actorID string, frozen catalog.SpecNormalizationContext, expected catalog.NormalizationExpectation, encoded, reason string, source catalog.NormalizedSource, explicit bool) (catalog.NormalizationOutcome, error) { - id, err := randomID("nrm") + var outcome catalog.NormalizationOutcome + err := s.withWriteTx(ctx, func(tx *sql.Tx) error { + return recordControlledNormalizationTx(ctx, tx, actorID, frozen, expected, encoded, reason, source, explicit, &outcome) + }) if err != nil { return catalog.NormalizationOutcome{}, err } - var outcome catalog.NormalizationOutcome - err = s.withWriteTx(ctx, func(tx *sql.Tx) error { - if err := checkNormalizationContextTx(ctx, tx, actorID, frozen, expected); err != nil { + return outcome, nil +} + +func recordControlledNormalizationTx(ctx context.Context, tx *sql.Tx, actorID string, frozen catalog.SpecNormalizationContext, expected catalog.NormalizationExpectation, encoded, reason string, source catalog.NormalizedSource, explicit bool, outcome *catalog.NormalizationOutcome) error { + id, err := randomID("nrm") + if err != nil { + return err + } + if err := checkNormalizationContextTx(ctx, tx, actorID, frozen, expected); err != nil { + return err + } + status := catalog.NormalizedCurrent + state := "candidate" + if reason != "" || encoded == "" { + status = catalog.NormalizedFailed + state = "failed" + } + now := time.Now().UTC().Format(time.RFC3339Nano) + if source == catalog.NormalizedAutomatic { + var previous string + err := tx.QueryRowContext(ctx, `SELECT id FROM normalized_values WHERE spec_value_id=? AND value_json=? AND source_revision=? + AND spec_semantic_version=? AND profile_revision=? AND source_origin_locale=? AND numeric_schema_version=? + AND normalizer_version=? AND source='automatic' AND status=? AND failure_reason=? ORDER BY created_at DESC,id DESC LIMIT 1`, + frozen.SpecValueID, encoded, expected.SourceRevision, expected.SpecSemanticVersion, expected.ProfileRevision, frozen.SourceLocale, specnumeric.SchemaVersion, frozen.Profile.ParserVersion, status, reason).Scan(&previous) + if err != nil && !errors.Is(err, sql.ErrNoRows) { return err } - status := catalog.NormalizedCurrent - state := "candidate" - if reason != "" || encoded == "" { - status = catalog.NormalizedFailed - state = "failed" - } - now := time.Now().UTC().Format(time.RFC3339Nano) - if source == catalog.NormalizedAutomatic { - var previous string - err := tx.QueryRowContext(ctx, `SELECT id FROM normalized_values WHERE spec_value_id=? AND value_json=? AND source_revision=? - AND spec_semantic_version=? AND profile_revision=? AND source_origin_locale=? AND numeric_schema_version=? - AND normalizer_version=? AND source='automatic' AND status=? AND failure_reason=? ORDER BY created_at DESC,id DESC LIMIT 1`, - frozen.SpecValueID, encoded, expected.SourceRevision, expected.SpecSemanticVersion, expected.ProfileRevision, frozen.SourceLocale, specnumeric.SchemaVersion, frozen.Profile.ParserVersion, status, reason).Scan(&previous) - if err != nil && !errors.Is(err, sql.ErrNoRows) { - return err - } - if err == nil { - outcome = catalog.NormalizationOutcome{State: state, ReasonCode: reason, NormalizedValueID: previous, ProductRevision: expected.ProductRevision, SelectionRevision: expected.SelectionRevision} - if status == catalog.NormalizedCurrent && frozen.Selection.Preference != catalog.NormalizedManual { - if frozen.Selection.SelectedNormalizedValueID == previous { - outcome.State = "recorded" - return nil - } - return adoptNormalizationTx(ctx, tx, actorID, frozen, previous, source, "product.spec_normalized", now, &outcome) + if err == nil { + *outcome = catalog.NormalizationOutcome{State: state, ReasonCode: reason, NormalizedValueID: previous, ProductRevision: expected.ProductRevision, SelectionRevision: expected.SelectionRevision} + if status == catalog.NormalizedCurrent && frozen.Selection.Preference != catalog.NormalizedManual { + if frozen.Selection.SelectedNormalizedValueID == previous { + outcome.State = "recorded" + return nil } - return nil + return adoptNormalizationTx(ctx, tx, actorID, frozen, previous, source, "product.spec_normalized", now, outcome) } + return nil } - if _, err := tx.ExecContext(ctx, `INSERT INTO normalized_values(id,spec_value_id,value_json,source_revision,spec_semantic_version, - normalizer_version,source,status,failure_reason,created_by,created_at,profile_revision,source_origin_locale,numeric_schema_version) - VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?)`, id, frozen.SpecValueID, encoded, expected.SourceRevision, expected.SpecSemanticVersion, - frozen.Profile.ParserVersion, source, status, reason, actorID, now, expected.ProfileRevision, frozen.SourceLocale, specnumeric.SchemaVersion); err != nil { - return err - } - outcome = catalog.NormalizationOutcome{State: state, ReasonCode: reason, NormalizedValueID: id, ProductRevision: expected.ProductRevision, SelectionRevision: expected.SelectionRevision} - if status == catalog.NormalizedCurrent && (explicit || frozen.Selection.Preference != catalog.NormalizedManual) { - action := "product.spec_normalized" - if source == catalog.NormalizedManual { - action = "product.spec_manual_adopted" - } - return adoptNormalizationTx(ctx, tx, actorID, frozen, id, source, action, now, &outcome) + } + if _, err := tx.ExecContext(ctx, `INSERT INTO normalized_values(id,spec_value_id,value_json,source_revision,spec_semantic_version, + normalizer_version,source,status,failure_reason,created_by,created_at,profile_revision,source_origin_locale,numeric_schema_version) + VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?)`, id, frozen.SpecValueID, encoded, expected.SourceRevision, expected.SpecSemanticVersion, + frozen.Profile.ParserVersion, source, status, reason, actorID, now, expected.ProfileRevision, frozen.SourceLocale, specnumeric.SchemaVersion); err != nil { + return err + } + *outcome = catalog.NormalizationOutcome{State: state, ReasonCode: reason, NormalizedValueID: id, ProductRevision: expected.ProductRevision, SelectionRevision: expected.SelectionRevision} + if status == catalog.NormalizedCurrent && (explicit || frozen.Selection.Preference != catalog.NormalizedManual) { + action := "product.spec_normalized" + if source == catalog.NormalizedManual { + action = "product.spec_manual_adopted" } - return appendAudit(ctx, tx, actorID, "product.spec_normalization_recorded", "product", frozen.ProductID, map[string]any{"spec_value_id": frozen.SpecValueID, "normalized_value_id": id, "state": state, "reason": reason}) - }) - if err != nil { - return catalog.NormalizationOutcome{}, err + return adoptNormalizationTx(ctx, tx, actorID, frozen, id, source, action, now, outcome) } - return outcome, nil + return appendAudit(ctx, tx, actorID, "product.spec_normalization_recorded", "product", frozen.ProductID, map[string]any{"spec_value_id": frozen.SpecValueID, "normalized_value_id": id, "state": state, "reason": reason}) } func adoptNormalizationTx(ctx context.Context, tx *sql.Tx, actorID string, frozen catalog.SpecNormalizationContext, id string, preference catalog.NormalizedSource, action, now string, outcome *catalog.NormalizationOutcome) error { diff --git a/internal/storage/sqlite/spec_numeric_store_test.go b/internal/storage/sqlite/spec_numeric_store_test.go index 744375c..34eded4 100644 --- a/internal/storage/sqlite/spec_numeric_store_test.go +++ b/internal/storage/sqlite/spec_numeric_store_test.go @@ -361,6 +361,11 @@ func removeNumericSchema(t *testing.T, store *Store) { if CurrentSchemaVersion < 19 { return } + if CurrentSchemaVersion >= 20 { + if _, err := store.db.Exec(`DROP TABLE spec_normalization_work_items; DROP TABLE spec_normalization_work; DROP TABLE spec_filter_profile_work; DROP TABLE spec_filter_profiles; DELETE FROM schema_migrations WHERE version>=20;`); err != nil { + t.Fatal(err) + } + } _, err := store.db.Exec(` DROP TABLE public_spec_projection_fields; DROP TABLE public_spec_projection_products; @@ -475,8 +480,8 @@ func TestNumericFreshInstallHasSameSchema(t *testing.T) { if err := store.db.QueryRow(`SELECT schema_version FROM system_state`).Scan(&version); err != nil { t.Fatal(err) } - if version != 19 { - t.Fatalf("fresh schema=%d, want 19", version) + if version != CurrentSchemaVersion { + t.Fatalf("fresh schema=%d, want %d", version, CurrentSchemaVersion) } if err := store.db.QueryRow(`SELECT COUNT(*) FROM sqlite_master WHERE type='table' AND name IN ('spec_numeric_profiles','spec_normalization_selections','product_spec_sources','spec_numeric_profile_work','public_spec_projection_products','public_spec_projection_fields')`).Scan(&tables); err != nil { diff --git a/internal/webapp/jobs.go b/internal/webapp/jobs.go index c2777ea..1fe6a59 100644 --- a/internal/webapp/jobs.go +++ b/internal/webapp/jobs.go @@ -35,11 +35,12 @@ func (s *Server) adminJobs(w http.ResponseWriter, r *http.Request) { limit = parsed } jobs, err := s.store.RecentJobs(r.Context(), sqlite.JobKinds{ - Publication: current.can(identity.CapabilityCatalogPublish), - Import: current.can(identity.CapabilityCatalogImport), - Backup: current.can(identity.CapabilitySystemManage), - SMTP: current.can(identity.CapabilityRFQManage), - Search: current.can(identity.CapabilitySystemManage), + Normalization: current.can(identity.CapabilityCatalogView), + Publication: current.can(identity.CapabilityCatalogPublish), + Import: current.can(identity.CapabilityCatalogImport), + Backup: current.can(identity.CapabilitySystemManage), + SMTP: current.can(identity.CapabilityRFQManage), + Search: current.can(identity.CapabilitySystemManage), }, limit) if err != nil { s.internalAPIError(w, r, err) @@ -49,7 +50,7 @@ func (s *Server) adminJobs(w http.ResponseWriter, r *http.Request) { Jobs: jobs, RetryPolicy: jobRetryPolicy{ SafeKinds: []string{"publication", "search_submission"}, - NewOperation: []string{"backup"}, + NewOperation: []string{"backup", "spec_normalization"}, NeverAutomatic: []string{"import_commit", "smtp_unknown", "restore", "migration"}, }, }) diff --git a/internal/webapp/server.go b/internal/webapp/server.go index 224994b..1572e76 100644 --- a/internal/webapp/server.go +++ b/internal/webapp/server.go @@ -611,6 +611,12 @@ func (s *Server) routes(static fs.FS) { s.mux.HandleFunc("POST /admin/api/products/{id}/spec-values", s.adminSaveSpecValue) s.mux.HandleFunc("POST /admin/api/spec-values/{id}/normalized", s.adminAdoptSpec) s.mux.HandleFunc("PUT /admin/api/specs/{id}/numeric-profile", s.adminConfigureNumericProfile) + s.mux.HandleFunc("GET /admin/api/spec-search-capabilities", s.adminSpecSearchCapabilities) + s.mux.HandleFunc("GET /admin/api/specs/{id}/search-profile", s.adminSpecSearchProfile) + s.mux.HandleFunc("POST /admin/api/specs/{id}/search-profile", s.adminConfigureSpecSearchProfile) + s.mux.HandleFunc("POST /admin/api/specs/{id}/normalization-work", s.adminStartSpecNormalizationWork) + s.mux.HandleFunc("GET /admin/api/spec-normalization-work/{id}", s.adminSpecNormalizationWork) + s.mux.HandleFunc("GET /admin/api/spec-normalization-work/{id}/items", s.adminSpecNormalizationWorkItems) s.mux.HandleFunc("GET /admin/api/spec-values/{id}/normalization-context", s.adminSpecNormalizationContext) s.mux.HandleFunc("POST /admin/api/spec-values/{id}/normalize", s.adminNormalizeSpec) s.mux.HandleFunc("POST /admin/api/spec-values/{id}/normalization/automatic", s.adminSelectAutomaticSpec) diff --git a/internal/webapp/spec_filter_settings.go b/internal/webapp/spec_filter_settings.go new file mode 100644 index 0000000..0e9fe64 --- /dev/null +++ b/internal/webapp/spec_filter_settings.go @@ -0,0 +1,115 @@ +package webapp + +import ( + "net/http" + "strconv" + + "prods/internal/catalog" + "prods/internal/catalogfilter" + "prods/internal/identity" + "prods/internal/specnumeric" +) + +func (s *Server) adminSpecSearchCapabilities(w http.ResponseWriter, r *http.Request) { + if _, ok := s.requireCapability(w, r, identity.CapabilityCatalogView, false); !ok { + return + } + writeJSON(w, http.StatusOK, map[string]any{"version": 1, "text_rule": catalogfilter.TextRule, "kinds": []string{"text", "choice", "multi_choice", "numeric"}, "numeric_profiles": specnumeric.SupportedProfiles()}) +} +func (s *Server) adminSpecSearchProfile(w http.ResponseWriter, r *http.Request) { + if _, ok := s.requireCapability(w, r, identity.CapabilityCatalogView, false); !ok { + return + } + result, err := s.store.SpecSearchProfile(r.Context(), r.PathValue("id")) + if err != nil { + s.writeCatalogError(w, r, err) + return + } + writeJSON(w, http.StatusOK, result) +} +func (s *Server) adminConfigureSpecSearchProfile(w http.ResponseWriter, r *http.Request) { + current, ok := s.requireCapability(w, r, identity.CapabilityCatalogEdit, true) + if !ok { + return + } + var request struct { + ExpectedRevision int64 `json:"expected_revision"` + Filterable bool `json:"filterable"` + Profile catalogfilter.Profile `json:"profile"` + } + if err := decodeJSON(r.Body, &request); err != nil || request.ExpectedRevision < 1 { + s.writeAPIError(w, r, http.StatusBadRequest, apiCodeInvalidJSON) + return + } + result, err := s.store.ConfigureSpecSearchProfile(r.Context(), current.UserID, r.PathValue("id"), request.ExpectedRevision, catalog.SpecSearchProfile{Filterable: request.Filterable, Profile: request.Profile}) + if err != nil { + s.writeCatalogError(w, r, err) + return + } + if s.publisher != nil { + s.publisher.Wake() + } + writeJSON(w, http.StatusOK, result) +} +func (s *Server) adminStartSpecNormalizationWork(w http.ResponseWriter, r *http.Request) { + current, ok := s.requireCapability(w, r, identity.CapabilityCatalogEdit, true) + if !ok { + return + } + var request struct { + ExpectedRevision int64 `json:"expected_revision"` + } + if err := decodeJSON(r.Body, &request); err != nil || request.ExpectedRevision < 1 { + s.writeAPIError(w, r, http.StatusBadRequest, apiCodeInvalidJSON) + return + } + result, err := s.store.StartSpecNormalizationWork(r.Context(), current.UserID, r.PathValue("id"), request.ExpectedRevision) + if err != nil { + s.writeCatalogError(w, r, err) + return + } + if s.publisher != nil { + s.publisher.Wake() + } + writeJSON(w, http.StatusAccepted, result) +} +func (s *Server) adminSpecNormalizationWork(w http.ResponseWriter, r *http.Request) { + if _, ok := s.requireCapability(w, r, identity.CapabilityCatalogView, false); !ok { + return + } + result, err := s.store.SpecNormalizationWork(r.Context(), r.PathValue("id")) + if err != nil { + s.writeCatalogError(w, r, err) + return + } + writeJSON(w, http.StatusOK, result) +} +func (s *Server) adminSpecNormalizationWorkItems(w http.ResponseWriter, r *http.Request) { + if _, ok := s.requireCapability(w, r, identity.CapabilityCatalogView, false); !ok { + return + } + page, size := 1, 50 + for _, entry := range []struct { + key string + target *int + }{{"page", &page}, {"page_size", &size}} { + if raw := r.URL.Query().Get(entry.key); raw != "" { + v, err := strconv.Atoi(raw) + if err != nil || v < 1 || entry.key == "page_size" && v > 100 { + s.writeAPIError(w, r, http.StatusBadRequest, apiCodeValidationFailed) + return + } + *entry.target = v + } + } + if _, err := s.store.SpecNormalizationWork(r.Context(), r.PathValue("id")); err != nil { + s.writeCatalogError(w, r, err) + return + } + items, total, err := s.store.SpecNormalizationWorkItems(r.Context(), r.PathValue("id"), page, size) + if err != nil { + s.writeCatalogError(w, r, err) + return + } + writeJSON(w, http.StatusOK, map[string]any{"items": items, "total": total, "page": page, "page_size": size}) +} diff --git a/internal/webapp/spec_numeric_test.go b/internal/webapp/spec_numeric_test.go index 24756be..023a59d 100644 --- a/internal/webapp/spec_numeric_test.go +++ b/internal/webapp/spec_numeric_test.go @@ -39,6 +39,18 @@ func TestNumericCommandUsesServerValidatedAdoption(t *testing.T) { t.Fatalf("client trust markers status=%d", response.StatusCode) } } + +func TestSpecSearchSettingsRequireSession(t *testing.T) { + _, server, _, _ := numericHTTPFixture(t) + response, err := http.Get(server.URL + "/admin/api/spec-search-capabilities") + if err != nil { + t.Fatal(err) + } + defer response.Body.Close() + if response.StatusCode != http.StatusUnauthorized { + t.Fatalf("settings without session: %d", response.StatusCode) + } +} func TestNumericCommandAdoptsValidatedValue(t *testing.T) { f, server, client, csrf := numericHTTPFixture(t) response, err := client.Get(server.URL + "/admin/api/spec-values/" + f.valueID + "/normalization-context") From 418917fc1a77acac7272e0523a1e538c12269418 Mon Sep 17 00:00:00 2001 From: Alex Chang Date: Wed, 14 Oct 2026 07:52:58 -0400 Subject: [PATCH 03/10] feat: freeze filter capabilities in public product snapshots --- internal/publishing/filter_definitions.go | 46 +++++++ .../publishing/filter_definitions_test.go | 25 ++++ internal/publishing/protocol.go | 18 +-- internal/publishing/view.go | 8 +- internal/storage/sqlite/publication_store.go | 43 +++++- .../sqlite/spec_filter_publication_test.go | 126 ++++++++++++++++++ 6 files changed, 252 insertions(+), 14 deletions(-) create mode 100644 internal/publishing/filter_definitions.go create mode 100644 internal/publishing/filter_definitions_test.go create mode 100644 internal/storage/sqlite/spec_filter_publication_test.go diff --git a/internal/publishing/filter_definitions.go b/internal/publishing/filter_definitions.go new file mode 100644 index 0000000..9b50bac --- /dev/null +++ b/internal/publishing/filter_definitions.go @@ -0,0 +1,46 @@ +package publishing + +import ( + "prods/internal/catalogfilter" + "reflect" + "sort" +) + +// PublicFilterDefinition is frozen with the product publication unit. +type PublicFilterDefinition struct { + Field string `json:"field"` + SemanticVersion int64 `json:"semantic_version"` + ProfileRevision int64 `json:"profile_revision"` + Profile catalogfilter.Profile `json:"profile"` +} + +// CommonFilterDefinitions uses formal applicability, independent of Raw presence. +func CommonFilterDefinitions(views []PublicView) []PublicFilterDefinition { + common := map[string]PublicFilterDefinition{} + if len(views) == 0 { + return nil + } + for _, d := range views[0].FilterDefinitions { + if catalogfilter.ValidateProfile(d.Profile) == nil { + common[d.Field] = d + } + } + for _, v := range views[1:] { + present := map[string]PublicFilterDefinition{} + for _, d := range v.FilterDefinitions { + present[d.Field] = d + } + for field, d := range common { + other, ok := present[field] + if !ok || !reflect.DeepEqual(d, other) { + delete(common, field) + } + } + } + result := make([]PublicFilterDefinition, 0, len(common)) + for _, d := range common { + result = append(result, d) + } + sort.Slice(result, func(i, j int) bool { return result[i].Field < result[j].Field }) + return result +} diff --git a/internal/publishing/filter_definitions_test.go b/internal/publishing/filter_definitions_test.go new file mode 100644 index 0000000..0fe967f --- /dev/null +++ b/internal/publishing/filter_definitions_test.go @@ -0,0 +1,25 @@ +package publishing + +import ( + "prods/internal/catalogfilter" + "testing" +) + +func TestCommonFiltersRejectMixedSemanticVersions(t *testing.T) { + d := PublicFilterDefinition{Field: "spec:interface", SemanticVersion: 1, ProfileRevision: 2, Profile: catalogfilter.DefaultTextProfile()} + a := PublicView{FilterDefinitions: []PublicFilterDefinition{d}} + t.Run("mixed meaning", func(t *testing.T) { + changed := d + changed.SemanticVersion++ + if got := CommonFilterDefinitions([]PublicView{a, {FilterDefinitions: []PublicFilterDefinition{changed}}}); len(got) != 0 { + t.Fatalf("mixed meanings: %+v", got) + } + }) + t.Run("missing raw remains applicable", func(t *testing.T) { + b := a + b.Specifications = []Specification{{ID: "interface", RawValue: "SPI"}} + if got := CommonFilterDefinitions([]PublicView{a, b}); len(got) != 1 { + t.Fatalf("missing Raw removed field: %+v", got) + } + }) +} diff --git a/internal/publishing/protocol.go b/internal/publishing/protocol.go index 38e3faf..2e95d8e 100644 --- a/internal/publishing/protocol.go +++ b/internal/publishing/protocol.go @@ -39,12 +39,13 @@ type Intent struct { } type SourceSpec struct { - SourceRevision int64 - ID string - Name string - RawValue string - PreferredUnit string - Language string + SemanticVersion int64 + SourceRevision int64 + ID string + Name string + RawValue string + PreferredUnit string + Language string } type SourceDocument struct { @@ -66,6 +67,7 @@ type SourceImage struct { } type Source struct { + FilterDefinitions []PublicFilterDefinition NumericFacts []PublicNumericFact NumericDefinitions []PublicNumericDefinition ApplicableSpecs []SourceSpec @@ -751,14 +753,14 @@ func (e *Engine) installLocked(ctx context.Context) error { func applicableSpecifications(specs []SourceSpec) []ApplicableSpecification { result := make([]ApplicableSpecification, 0, len(specs)) for _, spec := range specs { - result = append(result, ApplicableSpecification{ID: spec.ID, Name: spec.Name, PreferredUnit: spec.PreferredUnit}) + result = append(result, ApplicableSpecification{ID: spec.ID, SemanticVersion: spec.SemanticVersion, Name: spec.Name, PreferredUnit: spec.PreferredUnit}) } return result } func (e *Engine) viewFromSource(source Source) PublicView { view := PublicView{ - NumericFacts: source.NumericFacts, NumericDefinitions: source.NumericDefinitions, + FilterDefinitions: source.FilterDefinitions, NumericFacts: source.NumericFacts, NumericDefinitions: source.NumericDefinitions, PackageFormFactor: source.Product.PackageFormFactor, ApplicableSpecifications: applicableSpecifications(source.ApplicableSpecs), Site: source.Site, diff --git a/internal/publishing/view.go b/internal/publishing/view.go index dc17c6a..faf4bee 100644 --- a/internal/publishing/view.go +++ b/internal/publishing/view.go @@ -43,9 +43,10 @@ type Image struct { } type ApplicableSpecification struct { - ID string `json:"id"` - Name string `json:"name"` - PreferredUnit string `json:"preferred_unit,omitempty"` + SemanticVersion int64 `json:"semantic_version"` + ID string `json:"id"` + Name string `json:"name"` + PreferredUnit string `json:"preferred_unit,omitempty"` } // PublicNumericDefinition freezes an applicable, filterable semantic definition. @@ -64,6 +65,7 @@ type PublicNumericFact struct { } type PublicView struct { + FilterDefinitions []PublicFilterDefinition `json:"filter_definitions,omitempty"` NumericFacts []PublicNumericFact `json:"numeric_facts,omitempty"` NumericDefinitions []PublicNumericDefinition `json:"numeric_definitions,omitempty"` PackageFormFactor string `json:"package_form_factor,omitempty"` diff --git a/internal/storage/sqlite/publication_store.go b/internal/storage/sqlite/publication_store.go index 55a90ac..ed14f35 100644 --- a/internal/storage/sqlite/publication_store.go +++ b/internal/storage/sqlite/publication_store.go @@ -195,7 +195,7 @@ func (s *Store) PublicationSource(ctx context.Context, productID string) (publis if routeReason != "" { return publishing.Source{}, errors.New(routeReason) } - applicableRows, err := tx.QueryContext(ctx, `SELECT sd.id,sd.name,sd.preferred_unit + applicableRows, err := tx.QueryContext(ctx, `SELECT sd.id,sd.name,sd.preferred_unit,sd.semantic_version FROM products p JOIN category_spec_sets cs ON cs.category_id=p.category_id JOIN spec_set_members sm ON sm.spec_set_id=cs.spec_set_id @@ -206,7 +206,7 @@ func (s *Store) PublicationSource(ctx context.Context, productID string) (publis } for applicableRows.Next() { var spec publishing.SourceSpec - if err := applicableRows.Scan(&spec.ID, &spec.Name, &spec.PreferredUnit); err != nil { + if err := applicableRows.Scan(&spec.ID, &spec.Name, &spec.PreferredUnit, &spec.SemanticVersion); err != nil { applicableRows.Close() return publishing.Source{}, err } @@ -240,6 +240,9 @@ func (s *Store) PublicationSource(ctx context.Context, productID string) (publis if err := specRows.Err(); err != nil { return publishing.Source{}, err } + if err := loadPublicationFilterSnapshot(ctx, tx, productID, &source); err != nil { + return publishing.Source{}, err + } if err := loadPublicationNumericSnapshot(ctx, tx, productID, &source); err != nil { return publishing.Source{}, err } @@ -1400,5 +1403,39 @@ func publicationNumericSnapshotCurrent(ctx context.Context, tx *sql.Tx, activati if err := loadPublicationNumericSnapshot(ctx, tx, activation.ProductID, ¤t); err != nil { return false, err } - return reflect.DeepEqual(current.NumericDefinitions, activation.View.NumericDefinitions) && reflect.DeepEqual(current.NumericFacts, activation.View.NumericFacts), nil + if err := loadPublicationFilterSnapshot(ctx, tx, activation.ProductID, ¤t); err != nil { + return false, err + } + return reflect.DeepEqual(current.FilterDefinitions, activation.View.FilterDefinitions) && reflect.DeepEqual(current.NumericDefinitions, activation.View.NumericDefinitions) && reflect.DeepEqual(current.NumericFacts, activation.View.NumericFacts), nil +} + +// Read through the same transaction as Product and adopted facts. This is also +// checked at activation, before bounded profile fanout has bumped each Product. +func loadPublicationFilterSnapshot(ctx context.Context, tx *sql.Tx, productID string, source *publishing.Source) error { + rows, err := tx.QueryContext(ctx, `SELECT DISTINCT sd.id FROM products p JOIN category_spec_sets cs ON cs.category_id=p.category_id JOIN spec_set_members sm ON sm.spec_set_id=cs.spec_set_id JOIN spec_definitions sd ON sd.id=sm.spec_id AND sd.status='active' AND sd.filterable=1 WHERE p.id=? ORDER BY sd.id`, productID) + if err != nil { + return err + } + var ids []string + for rows.Next() { + var id string + if err = rows.Scan(&id); err != nil { + rows.Close() + return err + } + ids = append(ids, id) + } + err = rows.Err() + rows.Close() + if err != nil { + return err + } + for _, id := range ids { + profile, err := readSpecSearchProfile(ctx, tx, id) + if err != nil { + return err + } + source.FilterDefinitions = append(source.FilterDefinitions, publishing.PublicFilterDefinition{Field: "spec:" + id, SemanticVersion: profile.SpecSemanticVersion, ProfileRevision: profile.Revision, Profile: profile.Profile}) + } + return nil } diff --git a/internal/storage/sqlite/spec_filter_publication_test.go b/internal/storage/sqlite/spec_filter_publication_test.go new file mode 100644 index 0000000..b9ffcd4 --- /dev/null +++ b/internal/storage/sqlite/spec_filter_publication_test.go @@ -0,0 +1,126 @@ +package sqlite + +import ( + "prods/internal/catalog" + "prods/internal/catalogfilter" + "prods/internal/publishing" + "testing" + "time" +) + +func TestPublishedFilterDefinitionStaysFrozen(t *testing.T) { + f := newNormalizationFixture(t) + ctx := t.Context() + c := f.snapshot(t) + p, err := f.store.Product(ctx, c.ProductID) + if err != nil { + t.Fatal(err) + } + p.Status = catalog.Published + p, err = f.store.UpdateProduct(ctx, f.actor, p.Revision, p) + if err != nil { + t.Fatal(err) + } + source, err := f.store.PublicationSource(ctx, p.ID) + if err != nil { + t.Fatal(err) + } + intent, ok, err := f.store.ClaimPublicationIntent(ctx) + if err != nil || !ok { + t.Fatalf("claim: %v %v", ok, err) + } + view, err := publishing.FromProduct(p, "https://catalog.example.test") + if err != nil { + t.Fatal(err) + } + view.FilterDefinitions = source.FilterDefinitions + view.NumericDefinitions = source.NumericDefinitions + view.NumericFacts = source.NumericFacts + view.Specifications = []publishing.Specification{{ID: c.SpecID, RawValue: c.Raw}} + activation := publishing.ActivePublication{ProductID: p.ID, SourceRevision: p.Revision, PublicRevision: p.Revision, SiteEpoch: source.SiteEpoch, Route: source.Route, ArtifactID: "art_filter", ManifestHash: "hash_filter", ActivatedAt: time.Now().UTC(), View: view} + for range 5 { + ok, err = f.store.ActivatePublication(ctx, intent, activation, websiteVisibilityStub{}) + if err != nil { + t.Fatal(err) + } + if ok { + break + } + intent, ok, err = f.store.ClaimPublicationIntent(ctx) + if err != nil || !ok { + t.Fatalf("claim: %v %v", ok, err) + } + ok = false + } + if !ok { + t.Fatal("initial unit not activated") + } + profile, err := f.store.SpecSearchProfile(ctx, c.SpecID) + if err != nil { + t.Fatal(err) + } + profile.Profile = catalogfilter.DefaultTextProfile() + if _, err = f.store.ConfigureSpecSearchProfile(ctx, f.actor, c.SpecID, profile.Revision, profile); err != nil { + t.Fatal(err) + } + if _, err = f.store.SaveSpecValue(ctx, f.actor, p.ID, c.SpecID, "SPI", "en-US", p.Revision); err != nil { + t.Fatal(err) + } + active, err := f.store.ActivePublications(ctx) + if err != nil { + t.Fatal(err) + } + if len(active) != 1 || active[0].View.FilterDefinitions[0].Profile.Kind != "numeric" { + t.Fatalf("working config leaked: %+v", active) + } + if active[0].View.Specifications[0].RawValue != c.Raw { + t.Fatal("working Raw leaked") + } + tx, err := f.store.db.BeginTx(ctx, nil) + if err != nil { + t.Fatal(err) + } + defer tx.Rollback() + if current, err := publicationNumericSnapshotCurrent(ctx, tx, activation); err != nil || current { + t.Fatalf("stale candidate accepted before fanout: %v %v", current, err) + } + tx.Rollback() + if _, err = f.store.ProcessSpecSearchProfileWork(ctx, 100); err != nil { + t.Fatal(err) + } + source, err = f.store.PublicationSource(ctx, p.ID) + if err != nil { + t.Fatal(err) + } + activation.SourceRevision = source.Product.Revision + activation.PublicRevision = source.Product.Revision + activation.View.Revision = source.Product.Revision + activation.View.FilterDefinitions = source.FilterDefinitions + activation.View.NumericDefinitions = source.NumericDefinitions + activation.View.NumericFacts = source.NumericFacts + activation.View.Specifications = []publishing.Specification{{ID: c.SpecID, RawValue: source.Specs[0].RawValue}} + activated := false + for range 5 { + intent, found, err := f.store.ClaimPublicationIntent(ctx) + if err != nil || !found { + t.Fatalf("claim replacement: %v %v", found, err) + } + activated, err = f.store.ActivatePublication(ctx, intent, activation, websiteVisibilityStub{}) + if err != nil { + t.Fatal(err) + } + if activated { + break + } + } + if !activated { + t.Fatal("replacement not activated") + } + active, err = f.store.ActivePublications(ctx) + if err != nil { + t.Fatal(err) + } + if active[0].View.FilterDefinitions[0].Profile.Kind != "text" || active[0].View.Specifications[0].RawValue != "SPI" { + t.Fatalf("new unit missing: %+v", active[0].View) + } +} From c2a3d31d139dffc75eb8d8af1774eee52ca50a5f Mon Sep 17 00:00:00 2001 From: Alex Chang Date: Wed, 14 Oct 2026 07:56:33 -0400 Subject: [PATCH 04/10] feat: admit catalog filters and facets from one public snapshot --- internal/cataloglisting/listing.go | 13 +- internal/cataloglisting/listing_test.go | 19 ++ internal/publishing/catalog_query.go | 391 ++++++++++++++++++++++ internal/publishing/catalog_query_test.go | 39 +++ internal/publishing/spec_search.go | 51 +-- internal/webapp/catalog_query_test.go | 36 ++ 6 files changed, 499 insertions(+), 50 deletions(-) create mode 100644 internal/publishing/catalog_query.go create mode 100644 internal/publishing/catalog_query_test.go create mode 100644 internal/webapp/catalog_query_test.go diff --git a/internal/cataloglisting/listing.go b/internal/cataloglisting/listing.go index 954a3dd..20de6da 100644 --- a/internal/cataloglisting/listing.go +++ b/internal/cataloglisting/listing.go @@ -81,6 +81,14 @@ type CategoryNode struct { } func Resolve(views []publishing.PublicView, configuration site.Configuration, request Request) (Result, error) { + return resolve(views, nil, configuration, request) +} + +func ResolveSnapshot(snapshot publishing.CatalogSnapshot, request Request) (Result, error) { + return resolve(snapshot.Views, snapshot.ScopeViews, snapshot.Site, request) +} + +func resolve(views, columnViews []publishing.PublicView, configuration site.Configuration, request Request) (Result, error) { if request.Page < 1 { request.Page = 1 } @@ -104,6 +112,9 @@ func Resolve(views []publishing.PublicView, configuration site.Configuration, re } profile, hasProfile := configuration.CategoryListingProfiles[request.Scope.ID] common := commonApplicable(localized) + if columnViews != nil { + common = commonApplicable(columnViews) + } columns := resolveColumns(request.Scope, profile, hasProfile, common) sortKey, direction, err := resolveSort(request, profile, hasProfile) if err != nil { @@ -214,7 +225,7 @@ func commonApplicable(views []publishing.PublicView) map[string]publishing.Appli applicable[spec.ID] = spec } for id := range common { - if _, exists := applicable[id]; !exists { + if other, exists := applicable[id]; !exists || other.SemanticVersion != common[id].SemanticVersion { delete(common, id) } } diff --git a/internal/cataloglisting/listing_test.go b/internal/cataloglisting/listing_test.go index 4020280..a538dec 100644 --- a/internal/cataloglisting/listing_test.go +++ b/internal/cataloglisting/listing_test.go @@ -1,6 +1,7 @@ package cataloglisting import ( + "fmt" "reflect" "testing" @@ -9,6 +10,24 @@ import ( "prods/internal/site" ) +func TestFilteredSnapshotPaginatesWithScopeColumns(t *testing.T) { + var views []publishing.PublicView + for i := range 27 { + views = append(views, listingView(fmt.Sprintf("p%02d", i), fmt.Sprintf("P%02d", i), "cat", []publishing.ApplicableSpecification{spec("common"), spec("only_filtered")}, nil)) + } + scope := append(append([]publishing.PublicView{}, views...), listingView("other", "OTHER", "other", []publishing.ApplicableSpecification{spec("common")}, nil)) + snapshot := publishing.CatalogSnapshot{Views: views, ScopeViews: scope, Site: site.DefaultConfiguration()} + got, err := ResolveSnapshot(snapshot, Request{Scope: Scope{Kind: ScopeAll}, Page: 2, PageSize: 24}) + if err != nil || got.Total != 27 || len(got.Rows) != 3 || got.Rows[0].ProductID != "p24" { + t.Fatalf("page: %+v %v", got, err) + } + for _, column := range got.Columns { + if column.Key == "spec:only_filtered" { + t.Fatal("filtered subset expanded common fields") + } + } +} + func TestCommonUsesApplicabilityAcrossFullScopeNotCurrentPageValues(t *testing.T) { input := []publishing.PublicView{ listingView("ldo-1", "LDO-1", "cat_ldo", []publishing.ApplicableSpecification{spec("vin"), spec("vout"), spec("iout"), spec("iq")}, map[string]string{"vin": "3-6 V", "vout": "3.3 V"}), diff --git a/internal/publishing/catalog_query.go b/internal/publishing/catalog_query.go new file mode 100644 index 0000000..eb0fa55 --- /dev/null +++ b/internal/publishing/catalog_query.go @@ -0,0 +1,391 @@ +package publishing + +import ( + "context" + "errors" + "fmt" + "slices" + "sort" + "strings" + + "prods/internal/catalog" + "prods/internal/catalogfilter" + "prods/internal/site" + "prods/internal/specnumeric" +) + +type CatalogQuery struct { + Scope catalogfilter.Scope + Locale string + Clauses []catalogfilter.Clause +} +type CatalogFilterOption struct { + Value string + Label string +} +type CatalogSnapshot struct { + Views []PublicView + ScopeViews []PublicView + Definitions []PublicFilterDefinition + Options map[string][]CatalogFilterOption + Site site.Configuration + Locale string + Generation int64 +} +type CatalogFilterError struct{ Field, Message string } + +func (e *CatalogFilterError) Error() string { return e.Field + ": " + e.Message } + +func coreFilterDefinitions() []PublicFilterDefinition { + result := []PublicFilterDefinition{} + for _, field := range []string{"manufacturer", "brand", "category", "application", "lifecycle", "package"} { + p := catalogfilter.DefaultTextProfile() + if field != "package" { + p.Kind = "choice" + p.Operators = []string{"equals"} + } + result = append(result, PublicFilterDefinition{Field: field, SemanticVersion: 1, ProfileRevision: 1, Profile: p}) + } + return result +} + +// Candidate providers are read outside the public gate. Every fact, option, +// count and definition is then resolved against one admitted immutable index. +func (e *Engine) AdmitCatalog(ctx context.Context, request CatalogQuery) (CatalogSnapshot, error) { + var ids []string + var predicates []specnumeric.Predicate + for _, c := range request.Clauses { + if c.Numeric != nil { + ids = append(ids, c.Numeric.SpecID) + predicates = append(predicates, *c.Numeric) + } + } + var candidates SpecCandidateSnapshot + var projected bool + var candidateErr error + if len(ids) > 0 { + candidates, projected, candidateErr = e.readSpecCandidates(ctx, SpecSearchRequest{Predicates: predicates}) + } + e.gate.RLock() + defer e.gate.RUnlock() + if e.index == nil || e.index.unhealthy != nil { + return CatalogSnapshot{}, ErrPublicUnavailable + } + if err := ctx.Err(); err != nil { + return CatalogSnapshot{}, err + } + snapshot := CatalogSnapshot{Site: e.index.site, Generation: e.index.siteEpoch, Options: map[string][]CatalogFilterOption{}, Views: []PublicView{}, ScopeViews: []PublicView{}} + locale := request.Locale + if len(e.index.views) > 0 { + view := e.index.views[0] + if locale == "" { + locale = view.DefaultLocale + if locale == "" { + locale = view.Language + } + } + if !slices.Contains(publicSupportedLocales(view), locale) { + return snapshot, fmt.Errorf("%w: locale is not enabled", ErrInvalidSpecSearch) + } + } + if locale == "" { + locale = "en-US" + } + snapshot.Locale = locale + switch request.Scope.Kind { + case "all": + if request.Scope.ID != "" { + return snapshot, &CatalogFilterError{Message: "invalid scope"} + } + case "search": + if strings.TrimSpace(request.Scope.Query) == "" { + return snapshot, &CatalogFilterError{Message: "empty search scope"} + } + case "category", "manufacturer", "brand", "application": + if request.Scope.ID == "" { + return snapshot, &CatalogFilterError{Message: "missing scope ID"} + } + default: + return snapshot, &CatalogFilterError{Message: "unknown scope"} + } + for _, view := range e.index.views { + view = e.admittedViewLocked(view) + view.Applications = slices.Clone(view.Applications) + view.CategoryTrail = slices.Clone(view.CategoryTrail) + view = view.ForLocale(locale) + if catalogScopeMatches(view, request.Scope) { + snapshot.ScopeViews = append(snapshot.ScopeViews, view) + } + } + sort.SliceStable(snapshot.ScopeViews, func(i, j int) bool { + a, b := snapshot.ScopeViews[i], snapshot.ScopeViews[j] + if request.Scope.Kind == "search" { + ar, br := catalogKeywordRank(a, request.Scope.Query), catalogKeywordRank(b, request.Scope.Query) + if ar != br { + return ar < br + } + } + ap, bp := catalog.FoldSearch(a.PartNumber), catalog.FoldSearch(b.PartNumber) + if ap != bp { + return ap < bp + } + return a.ID < b.ID + }) + snapshot.Definitions = append(coreFilterDefinitions(), CommonFilterDefinitions(snapshot.ScopeViews)...) + byField := map[string]PublicFilterDefinition{} + for _, d := range snapshot.Definitions { + byField[d.Field] = d + if d.Profile.Kind == "numeric" { + continue + } + options := map[string]string{} + for _, view := range snapshot.ScopeViews { + for _, option := range catalogFieldOptions(view, d) { + if option.Value != "" { + if _, exists := options[option.Value]; !exists { + options[option.Value] = option.Label + } + } + } + } + for value, label := range options { + snapshot.Options[d.Field] = append(snapshot.Options[d.Field], CatalogFilterOption{Value: value, Label: label}) + } + sort.Slice(snapshot.Options[d.Field], func(i, j int) bool { + a, b := snapshot.Options[d.Field][i], snapshot.Options[d.Field][j] + if a.Label != b.Label { + return a.Label < b.Label + } + return a.Value < b.Value + }) + } + seen := map[string]bool{} + for _, clause := range request.Clauses { + d, ok := byField[clause.Field] + invalid := func(message string) (CatalogSnapshot, error) { + return snapshot, &CatalogFilterError{Field: clause.Field, Message: message} + } + if !ok { + return invalid("field is not applicable with one published meaning in this scope") + } + if seen[clause.Field] { + return invalid("duplicate condition") + } + seen[clause.Field] = true + if !slices.Contains(d.Profile.Operators, clause.Operator) { + return invalid("unsupported operator") + } + if d.Profile.Kind == "numeric" { + if clause.Numeric == nil || len(clause.Values) != 0 || clause.Numeric.SpecID != strings.TrimPrefix(clause.Field, "spec:") || string(clause.Numeric.Operator) != clause.Operator { + return invalid("numeric condition requires matching operands") + } + if err := validateSpecPredicate(*clause.Numeric); err != nil { + return invalid(err.Error()) + } + if _, err := specnumeric.NormalizePredicate(*clause.Numeric, *d.Profile.Numeric); err != nil { + return invalid(err.Error()) + } + } else { + if clause.Numeric != nil || len(clause.Values) == 0 || len(clause.Values) > 20 { + return invalid("condition requires one to twenty values") + } + for _, value := range clause.Values { + if len(value) > 512 || catalogfilter.FoldText(value) == "" { + return invalid("invalid text value") + } + } + } + } + var candidateIDs map[string]bool + if len(ids) > 0 { + candidateIDs, projected = e.admitSpecCandidatesLocked(candidates, projected, candidateErr) + } + for _, view := range snapshot.ScopeViews { + if projected && !candidateIDs[view.ID] { + continue + } + match := true + for _, c := range request.Clauses { + if c.Numeric != nil { + if specViewTruth(view, []specnumeric.Predicate{*c.Numeric}) != specnumeric.Match { + match = false + break + } + } else if !catalogTextMatches(view, byField[c.Field], c) { + match = false + break + } + } + if match { + snapshot.Views = append(snapshot.Views, view) + } + } + return snapshot, nil +} + +func catalogScopeMatches(v PublicView, s catalogfilter.Scope) bool { + switch s.Kind { + case "all": + return true + case "search": + return catalogKeywordRank(v, s.Query) >= 0 + case "manufacturer": + return v.ManufacturerID == s.ID + case "brand": + return v.BrandID == s.ID + case "category": + if v.CategoryID == s.ID { + return true + } + for _, c := range v.CategoryTrail { + if c.ID == s.ID { + return true + } + } + case "application": + for _, a := range v.Applications { + if a.ID == s.ID { + return true + } + } + } + return false +} +func catalogKeywordRank(v PublicView, q string) int { + q = catalog.FoldSearch(q) + part := catalog.FoldSearch(v.PartNumber) + if part == q { + return 0 + } + if strings.HasPrefix(part, q) { + return 1 + } + if strings.Contains(part, q) { + return 2 + } + for _, value := range []string{v.Name, v.Manufacturer, v.Brand} { + if strings.Contains(catalog.FoldSearch(value), q) { + return 3 + } + } + // Keep the existing keyword field boundary and enabled localized names. + all := []string{v.Category, v.Lifecycle, applicationNames(v.Applications)} + for _, localized := range v.Localizations { + all = append(all, localized.Name) + } + if strings.Contains(catalog.FoldSearch(strings.Join(all, " ")), q) { + return 4 + } + return -1 +} +func catalogFieldOptions(v PublicView, d PublicFilterDefinition) []CatalogFilterOption { + option := func(value, label string) []CatalogFilterOption { + return []CatalogFilterOption{{Value: value, Label: label}} + } + switch d.Field { + case "manufacturer": + return option(v.ManufacturerID, v.Manufacturer) + case "brand": + return option(v.BrandID, v.Brand) + case "category": + r := option(v.CategoryID, v.Category) + for _, c := range v.CategoryTrail { + r = append(r, CatalogFilterOption{Value: c.ID, Label: c.Name}) + } + return r + case "application": + r := []CatalogFilterOption{} + for _, a := range v.Applications { + r = append(r, CatalogFilterOption{Value: a.ID, Label: a.Name}) + } + return r + case "lifecycle": + return option(v.LifecycleID, v.Lifecycle) + case "package": + return option(v.PackageFormFactor, v.PackageFormFactor) + } + id := strings.TrimPrefix(d.Field, "spec:") + for _, s := range v.Specifications { + if s.ID == id { + values := []string{s.RawValue} + if d.Profile.Kind == "multi_choice" { + values = strings.Split(s.RawValue, d.Profile.Delimiter) + } + r := []CatalogFilterOption{} + for _, value := range values { + value = strings.TrimSpace(value) + if value != "" { + r = append(r, CatalogFilterOption{Value: value, Label: value}) + } + } + return r + } + } + return nil +} +func catalogTextMatches(v PublicView, d PublicFilterDefinition, c catalogfilter.Clause) bool { + for _, actual := range catalogFieldOptions(v, d) { + for _, value := range c.Values { + if d.Profile.Kind == "choice" && !strings.HasPrefix(d.Field, "spec:") { + if value == actual.Value { + return true + } + continue + } + a, b := catalogfilter.FoldText(actual.Value), catalogfilter.FoldText(value) + if (c.Operator == "equals" && a == b) || (c.Operator == "contains" && strings.Contains(a, b)) { + return true + } + } + } + return false +} + +func (e *Engine) readSpecCandidates(ctx context.Context, request SpecSearchRequest) (SpecCandidateSnapshot, bool, error) { + switch e.specBackend { + case "bleve": + if e.specBleve != nil { + snapshot, err := e.specBleve.candidates(ctx, request) + return snapshot, err == nil, err + } + case "sqlite": + if r, ok := e.repository.(SpecSearchRepository); ok { + ids := make([]string, 0, len(request.Predicates)) + for _, p := range request.Predicates { + ids = append(ids, p.SpecID) + } + snapshot, err := r.SpecSearchCandidates(ctx, ids, SpecProjectionVersion) + return snapshot, err == nil, err + } + } + return SpecCandidateSnapshot{}, false, errors.New("spec search candidate provider unavailable") +} +func (e *Engine) admitSpecCandidatesLocked(snapshot SpecCandidateSnapshot, projected bool, candidateErr error) (map[string]bool, bool) { + candidates := map[string]bool{} + if projected && e.index.specDigestError == nil && e.completeSpecInventory(snapshot) && (e.specBackend != "bleve" || snapshot.SourceDigest == e.index.specDigest) { + for _, candidate := range snapshot.Candidates { + current, exists := e.index.byID[candidate.ProductID] + if !exists || !specBindingMatches(candidate, current) { + projected = false + break + } + candidates[candidate.ProductID] = true + } + } else { + projected = false + } + if projected { + e.specCandidateQueries.Add(1) + e.specStatus.Store(&specSearchStatus{digest: e.index.specDigest}) + } else { + e.specFallbackQueries.Add(1) + if candidateErr == nil { + candidateErr = errors.New("spec search candidate snapshot does not match admitted public inventory") + } + if e.index.specDigestError != nil { + candidateErr = e.index.specDigestError + } + e.specStatus.Store(&specSearchStatus{digest: snapshot.SourceDigest, lastError: candidateErr.Error()}) + } + return candidates, projected +} diff --git a/internal/publishing/catalog_query_test.go b/internal/publishing/catalog_query_test.go new file mode 100644 index 0000000..f31883e --- /dev/null +++ b/internal/publishing/catalog_query_test.go @@ -0,0 +1,39 @@ +package publishing + +import ( + "fmt" + "prods/internal/catalogfilter" + "prods/internal/site" + "prods/internal/specnumeric" + "testing" +) + +func TestCatalogCombinesTextAndNumericBeforePagination(t *testing.T) { + base := blevePublication(t).View + base.Language = "en-US" + base.DefaultLocale = "en-US" + base.SupportedLocales = []string{"en-US"} + base.FilterDefinitions = []PublicFilterDefinition{{Field: "spec:voltage/opaque", SemanticVersion: 1, ProfileRevision: 1, Profile: catalogfilter.NumericProfile(base.NumericDefinitions[0].Profile)}, {Field: "spec:interface", SemanticVersion: 1, ProfileRevision: 1, Profile: catalogfilter.DefaultTextProfile()}} + e := &Engine{index: &publicIndex{byID: map[string]ActivePublication{}, site: site.DefaultConfiguration()}} + for i := range 30 { + v := base + v.ID = fmt.Sprintf("p%02d", i) + v.PartNumber = v.ID + raw := "SPI" + if i >= 27 { + raw = "I2C" + } + v.Specifications = []Specification{{ID: "interface", RawValue: raw}} + e.index.views = append(e.index.views, v) + e.index.byID[v.ID] = ActivePublication{ProductID: v.ID, View: v} + } + value := bleveDecimal(t, "3.2") + q := CatalogQuery{Scope: catalogfilter.Scope{Kind: "all"}, Clauses: []catalogfilter.Clause{{Field: "spec:interface", Operator: "equals", Values: []string{"spi"}}, {Field: "spec:voltage/opaque", Operator: "contains_point", Numeric: &specnumeric.Predicate{SpecID: "voltage/opaque", Operator: specnumeric.OperatorContainsPoint, Value: &value, Unit: "V"}}}} + got, err := e.AdmitCatalog(t.Context(), q) + if err != nil || len(got.Views) != 27 || len(got.ScopeViews) != 30 { + t.Fatalf("combined=%d scope=%d err=%v", len(got.Views), len(got.ScopeViews), err) + } + if got.Views[24].ID != "p24" || len(got.Views[24:]) != 3 { + t.Fatalf("second page: %+v", got.Views[24:]) + } +} diff --git a/internal/publishing/spec_search.go b/internal/publishing/spec_search.go index cb27f05..208dca3 100644 --- a/internal/publishing/spec_search.go +++ b/internal/publishing/spec_search.go @@ -86,28 +86,7 @@ func (e *Engine) SearchSpecs(ctx context.Context, request SpecSearchRequest) (Sp } ids = append(ids, predicate.SpecID) } - var snapshot SpecCandidateSnapshot - var projected bool - var candidateErr error - switch e.specBackend { - case "bleve": - if e.specBleve != nil { - snapshot, candidateErr = e.specBleve.candidates(ctx, request) - projected = candidateErr == nil - } else { - candidateErr = errors.New("Bleve spec search adapter unavailable") - if status := e.specStatus.Load(); status != nil && status.lastError != "" { - candidateErr = errors.New(status.lastError) - } - } - case "sqlite": - if repository, ok := e.repository.(SpecSearchRepository); ok { - snapshot, candidateErr = repository.SpecSearchCandidates(ctx, ids, SpecProjectionVersion) - projected = candidateErr == nil - } else { - candidateErr = errors.New("SQLite spec search repository unavailable") - } - } + snapshot, projected, candidateErr := e.readSpecCandidates(ctx, request) // The database read is outside the gate. Everything establishing truth, // visibility, scope, count and pagination uses this one current index. e.gate.RLock() @@ -162,33 +141,7 @@ func (e *Engine) SearchSpecs(ctx context.Context, request SpecSearchRequest) (Sp } } } - candidates := make(map[string]bool) - if projected && e.index.specDigestError == nil && e.completeSpecInventory(snapshot) && (e.specBackend != "bleve" || snapshot.SourceDigest == e.index.specDigest) { - for _, candidate := range snapshot.Candidates { - current, exists := e.index.byID[candidate.ProductID] - if !exists || !specBindingMatches(candidate, current) { - projected = false - break - } - candidates[candidate.ProductID] = true - } - } else { - projected = false - } - if projected { - e.specCandidateQueries.Add(1) - e.specStatus.Store(&specSearchStatus{digest: e.index.specDigest}) - } else { - e.specFallbackQueries.Add(1) - if candidateErr == nil { - candidateErr = errors.New("spec search candidate snapshot does not match admitted public inventory") - } - if e.index.specDigestError != nil { - candidateErr = e.index.specDigestError - } - // Atomic diagnostics cannot wait on refresh/adapter while the gate is held. - e.specStatus.Store(&specSearchStatus{digest: snapshot.SourceDigest, lastError: candidateErr.Error()}) - } + candidates, projected := e.admitSpecCandidatesLocked(snapshot, projected, candidateErr) matches := make([]PublicView, 0) for id, active := range e.index.byID { if err := ctx.Err(); err != nil { diff --git a/internal/webapp/catalog_query_test.go b/internal/webapp/catalog_query_test.go new file mode 100644 index 0000000..8e5b4dd --- /dev/null +++ b/internal/webapp/catalog_query_test.go @@ -0,0 +1,36 @@ +package webapp + +import ( + "prods/internal/catalogfilter" + "prods/internal/publishing" + "testing" +) + +func TestCatalogRevocationRemovesFacetValues(t *testing.T) { + f := newNumericPublicationFixture(t) + p, err := f.store.Product(t.Context(), f.productID) + if err != nil { + t.Fatal(err) + } + p.PackageFormFactor = "UNIQUE-PACKAGE" + if _, err = f.store.UpdateProduct(t.Context(), f.actor, p.Revision, p); err != nil { + t.Fatal(err) + } + f.drain(t) + request := publishing.CatalogQuery{Scope: catalogfilter.Scope{Kind: "all"}} + before, err := f.engine.AdmitCatalog(t.Context(), request) + if err != nil || len(before.Options["package"]) != 1 { + t.Fatalf("before: %+v %v", before.Options, err) + } + p, err = f.store.Product(t.Context(), f.productID) + if err != nil { + t.Fatal(err) + } + if err = f.engine.Revoke(t.Context(), publishing.RevokeRequest{ActorID: f.actor, ProductID: p.ID, ExpectedRevision: p.Revision}); err != nil { + t.Fatal(err) + } + after, err := f.engine.AdmitCatalog(t.Context(), request) + if err != nil || len(after.Views) != 0 || len(after.Options["package"]) != 0 { + t.Fatalf("revoked rows=%d options=%+v err=%v", len(after.Views), after.Options, err) + } +} From b032f3c07bac92fa916adcbb2476a9556e81f629 Mon Sep 17 00:00:00 2001 From: Alex Chang Date: Wed, 14 Oct 2026 08:06:03 -0400 Subject: [PATCH 05/10] fix: validate catalog value serialization with its pinned registry --- internal/specnumeric/registry_v2_test.go | 23 +++++++++++++++++++++++ internal/specnumeric/value.go | 6 ++++++ 2 files changed, 29 insertions(+) diff --git a/internal/specnumeric/registry_v2_test.go b/internal/specnumeric/registry_v2_test.go index a5b6a27..748b388 100644 --- a/internal/specnumeric/registry_v2_test.go +++ b/internal/specnumeric/registry_v2_test.go @@ -2,6 +2,29 @@ package specnumeric import "testing" +func TestCatalogValueRoundTrip(t *testing.T) { + p := catalogProfileForTest("ratio", "%") + p.SemanticRole = RoleErrorMagnitude + p.AllowedShapes = []Shape{ShapeBoundClaim} + p.AllowedOperators = []Operator{OperatorLessEqual} + result := Normalize("±0.5 %", p) + if result.Candidate == nil { + t.Fatalf("normalize: %+v", result) + } + encoded, err := MarshalValue(*result.Candidate) + if err != nil { + t.Fatal(err) + } + value, err := UnmarshalValue(encoded, p) + if err != nil { + t.Fatal(err) + } + ceiling, _ := ParseDecimal("1") + if Evaluate(&value, p, Predicate{SpecID: "accuracy", Operator: OperatorLessEqual, Value: &ceiling, Unit: "%"}) != Match { + t.Fatal("stored accuracy lost meaning") + } +} + func catalogProfileForTest(quantity, unit string) Profile { p := electricalProfile(quantity, unit) p.ParserVersion, p.UnitRegistryVersion = "catalog-parser-2", "catalog-units-2" diff --git a/internal/specnumeric/value.go b/internal/specnumeric/value.go index dfb3b5e..2eb53ca 100644 --- a/internal/specnumeric/value.go +++ b/internal/specnumeric/value.go @@ -329,6 +329,12 @@ func validateTolerance(tolerance Tolerance) error { func MarshalValue(value Value) (string, error) { profile := Profile{Quantity: value.Quantity, SemanticRole: value.SemanticRole, AllowedShapes: []Shape{value.Shape}, AllowedOperators: []Operator{OperatorEqual}, CanonicalUnit: value.Unit, NumericFormat: NumericFormatDecimalDot, SchemaVersion: value.SchemaVersion, ParserVersion: ParserVersion, UnitRegistryVersion: value.UnitRegistryVersion} + if value.UnitRegistryVersion == CatalogUnitRegistryVersion { + profile.ParserVersion = CatalogParserVersion + } + if value.SemanticRole == RoleErrorMagnitude { + profile.AllowedOperators = []Operator{OperatorLessEqual} + } if err := ValidateValue(value, profile); err != nil { return "", err } From 5253abb67f6c5036e6cd8c616cd73621e1b9b3ed Mon Sep 17 00:00:00 2001 From: Alex Chang Date: Wed, 14 Oct 2026 08:09:52 -0400 Subject: [PATCH 06/10] feat: add accessible catalog field filters with native GET forms --- internal/localization/catalog.go | 103 ++++--- internal/localization/catalog_filters.go | 34 +++ internal/localization/official_public_copy.go | 28 ++ internal/publishing/catalog_query.go | 98 ++++++- internal/publishing/protocol.go | 10 + internal/storage/sqlite/website_store.go | 5 + internal/webapp/catalog_filters.go | 269 ++++++++++++++++++ internal/webapp/catalog_filters_test.go | 65 +++++ internal/webapp/catalog_listing.go | 202 ++++++++----- internal/webapp/server.go | 5 +- internal/webapp/static/public/public.css | 18 ++ .../webapp/templates/catalog_filters.tmpl | 15 + internal/webapp/templates/pages.tmpl | 9 +- web/ui/src/public/style.css | 18 ++ 14 files changed, 735 insertions(+), 144 deletions(-) create mode 100644 internal/localization/catalog_filters.go create mode 100644 internal/webapp/catalog_filters.go create mode 100644 internal/webapp/catalog_filters_test.go create mode 100644 internal/webapp/templates/catalog_filters.tmpl diff --git a/internal/localization/catalog.go b/internal/localization/catalog.go index 4e36f95..3365222 100644 --- a/internal/localization/catalog.go +++ b/internal/localization/catalog.go @@ -31,51 +31,64 @@ func IsAvailable(locale string) bool { } type Messages struct { - Catalog string - RequestPart string - SearchLabel string - Search string - All string - Filters string - ClearFilters string - SelectForRFQ string - SelectedProducts string - ClearSelection string - MoreDetails string - LessDetails string - NoProducts string - NoProductsPrefix string - RequestThisPart string - PreviousPage string - NextPage string - PartNumber string - Manufacturer string - Brand string - Category string - Lifecycle string - Applications string - ProductImages string - Description string - Features string - Specification string - Specifications string - Documents string - RequestQuote string - RFQTitle string - CatalogProduct string - RequestedPart string - OriginalSearch string - Name string - Email string - QuantityOptional string - Notes string - SubmitRFQ string - RFQReceived string - Reference string - ReplayNotice string - Privacy string - Terms string - Language string + Package string + FilterEquals string + FilterContains string + FilterSupports string + FilterCovers string + FilterBetween string + FilterValue string + FilterLower string + FilterUpper string + FilterUnit string + FilterError string + FilterUnavailable string + FilterNumericHelp string + Catalog string + RequestPart string + SearchLabel string + Search string + All string + Filters string + ClearFilters string + SelectForRFQ string + SelectedProducts string + ClearSelection string + MoreDetails string + LessDetails string + NoProducts string + NoProductsPrefix string + RequestThisPart string + PreviousPage string + NextPage string + PartNumber string + Manufacturer string + Brand string + Category string + Lifecycle string + Applications string + ProductImages string + Description string + Features string + Specification string + Specifications string + Documents string + RequestQuote string + RFQTitle string + CatalogProduct string + RequestedPart string + OriginalSearch string + Name string + Email string + QuantityOptional string + Notes string + SubmitRFQ string + RFQReceived string + Reference string + ReplayNotice string + Privacy string + Terms string + Language string } var english = Messages{ diff --git a/internal/localization/catalog_filters.go b/internal/localization/catalog_filters.go new file mode 100644 index 0000000..08d6484 --- /dev/null +++ b/internal/localization/catalog_filters.go @@ -0,0 +1,34 @@ +package localization + +// Versioned defaults; professional language review remains outstanding. +func init() { + labels := map[string][]string{ + "en-US": {"Package / Form factor", "Equals", "Contains text", "Supports value", "Covers entire range", "Between", "Value", "Lower bound", "Upper bound", "Unit", "Check your filters", "Unavailable in this scope", "Use Value for a single value; use both bounds for a range."}, + "zh-TW": {"封裝/外形", "等於", "包含文字", "支援指定值", "涵蓋整段區間", "介於", "數值", "下限", "上限", "單位", "請檢查篩選條件", "此範圍不適用", "查單值請填數值;查區間請填下限與上限。"}, + "zh-CN": {"封装/外形", "等于", "包含文字", "支持指定值", "涵盖整个区间", "介于", "数值", "下限", "上限", "单位", "请检查筛选条件", "此范围不适用", "查单值请填数值;查区间请填下限与上限。"}, + "ja-JP": {"パッケージ/形状", "等しい", "文字を含む", "指定値に対応", "範囲全体に対応", "範囲内", "値", "下限", "上限", "単位", "絞り込み条件を確認してください", "この範囲では使用できません", "単一値には値を、範囲には下限と上限を入力してください。"}, + "ko-KR": {"패키지 / 형태", "같음", "텍스트 포함", "지정 값 지원", "전체 범위 지원", "범위 내", "값", "하한", "상한", "단위", "필터를 확인하세요", "이 범위에서 사용할 수 없음", "단일 값은 값에, 범위는 하한과 상한에 입력하세요."}, + "de-DE": {"Gehäuse / Bauform", "Gleich", "Text enthält", "Unterstützt Wert", "Deckt gesamten Bereich ab", "Zwischen", "Wert", "Untergrenze", "Obergrenze", "Einheit", "Filter prüfen", "In diesem Bereich nicht verfügbar", "Für einen Einzelwert das Wertfeld, für einen Bereich beide Grenzen ausfüllen."}, + "fr-FR": {"Boîtier / Format", "Égal à", "Contient le texte", "Prend en charge la valeur", "Couvre toute la plage", "Entre", "Valeur", "Borne inférieure", "Borne supérieure", "Unité", "Vérifiez les filtres", "Indisponible dans ce périmètre", "Pour une valeur, renseignez Valeur ; pour une plage, renseignez les deux bornes."}, + "it-IT": {"Contenitore / Formato", "Uguale a", "Contiene testo", "Supporta il valore", "Copre tutto l’intervallo", "Tra", "Valore", "Limite inferiore", "Limite superiore", "Unità", "Controlla i filtri", "Non disponibile in questo ambito", "Per un valore compila Valore; per un intervallo compila entrambi i limiti."}, + "es-ES": {"Encapsulado / Formato", "Igual a", "Contiene texto", "Admite el valor", "Cubre todo el intervalo", "Entre", "Valor", "Límite inferior", "Límite superior", "Unidad", "Comprueba los filtros", "No disponible en este ámbito", "Para un valor, rellena Valor; para un intervalo, rellena ambos límites."}, + "pt-BR": {"Encapsulamento / Formato", "Igual a", "Contém texto", "Suporta o valor", "Cobre todo o intervalo", "Entre", "Valor", "Limite inferior", "Limite superior", "Unidade", "Verifique os filtros", "Indisponível neste escopo", "Para um valor, preencha Valor; para um intervalo, preencha os dois limites."}, + } + for locale, values := range labels { + m := messageCatalogs[locale] + m.Package = values[0] + m.FilterEquals = values[1] + m.FilterContains = values[2] + m.FilterSupports = values[3] + m.FilterCovers = values[4] + m.FilterBetween = values[5] + m.FilterValue = values[6] + m.FilterLower = values[7] + m.FilterUpper = values[8] + m.FilterUnit = values[9] + m.FilterError = values[10] + m.FilterUnavailable = values[11] + m.FilterNumericHelp = values[12] + messageCatalogs[locale] = m + } +} diff --git a/internal/localization/official_public_copy.go b/internal/localization/official_public_copy.go index 86670a3..6572a2c 100644 --- a/internal/localization/official_public_copy.go +++ b/internal/localization/official_public_copy.go @@ -9,6 +9,20 @@ type officialCopyField struct { } var officialCopyFields = []officialCopyField{ + {"product.package", "Catalog filter Package", func(m Messages) string { return m.Package }}, + {"filter.equals", "Catalog filter FilterEquals", func(m Messages) string { return m.FilterEquals }}, + {"filter.contains", "Catalog filter FilterContains", func(m Messages) string { return m.FilterContains }}, + {"filter.supports_point", "Catalog filter FilterSupports", func(m Messages) string { return m.FilterSupports }}, + {"filter.covers_range", "Catalog filter FilterCovers", func(m Messages) string { return m.FilterCovers }}, + {"filter.between", "Catalog filter FilterBetween", func(m Messages) string { return m.FilterBetween }}, + {"filter.value", "Catalog filter FilterValue", func(m Messages) string { return m.FilterValue }}, + {"filter.lower", "Catalog filter FilterLower", func(m Messages) string { return m.FilterLower }}, + {"filter.upper", "Catalog filter FilterUpper", func(m Messages) string { return m.FilterUpper }}, + {"filter.unit", "Catalog filter FilterUnit", func(m Messages) string { return m.FilterUnit }}, + {"filter.error", "Catalog filter FilterError", func(m Messages) string { return m.FilterError }}, + {"filter.unavailable", "Catalog filter FilterUnavailable", func(m Messages) string { return m.FilterUnavailable }}, + {"filter.numeric_help", "Catalog filter FilterNumericHelp", func(m Messages) string { return m.FilterNumericHelp }}, + {"catalog.title", "Public catalog heading", func(m Messages) string { return m.Catalog }}, {"catalog.request_part", "Public catalog request-part action", func(m Messages) string { return m.RequestPart }}, {"search.label", "Public search field label", func(m Messages) string { return m.SearchLabel }}, @@ -80,6 +94,20 @@ func OfficialPublicCopyCatalog() PublicCopyCatalog { func ApplyPublicCopy(messages Messages, values map[string]string) Messages { targets := map[string]*string{ + "product.package": &messages.Package, + "filter.equals": &messages.FilterEquals, + "filter.contains": &messages.FilterContains, + "filter.supports_point": &messages.FilterSupports, + "filter.covers_range": &messages.FilterCovers, + "filter.between": &messages.FilterBetween, + "filter.value": &messages.FilterValue, + "filter.lower": &messages.FilterLower, + "filter.upper": &messages.FilterUpper, + "filter.unit": &messages.FilterUnit, + "filter.error": &messages.FilterError, + "filter.unavailable": &messages.FilterUnavailable, + "filter.numeric_help": &messages.FilterNumericHelp, + "catalog.title": &messages.Catalog, "catalog.request_part": &messages.RequestPart, "search.label": &messages.SearchLabel, "search.submit": &messages.Search, "search.all": &messages.All, "search.filters": &messages.Filters, "search.clear_filters": &messages.ClearFilters, diff --git a/internal/publishing/catalog_query.go b/internal/publishing/catalog_query.go index eb0fa55..b23011d 100644 --- a/internal/publishing/catalog_query.go +++ b/internal/publishing/catalog_query.go @@ -3,35 +3,42 @@ package publishing import ( "context" "errors" - "fmt" "slices" "sort" "strings" "prods/internal/catalog" "prods/internal/catalogfilter" + "prods/internal/localization" "prods/internal/site" "prods/internal/specnumeric" ) type CatalogQuery struct { - Scope catalogfilter.Scope - Locale string - Clauses []catalogfilter.Clause + ScopeURL string + Scope catalogfilter.Scope + Locale string + Clauses []catalogfilter.Clause } type CatalogFilterOption struct { Value string Label string } type CatalogSnapshot struct { - Views []PublicView - ScopeViews []PublicView - Definitions []PublicFilterDefinition - Options map[string][]CatalogFilterOption - Site site.Configuration - Locale string - Generation int64 + Scope catalogfilter.Scope + AllViews []PublicView + Presentation PublicView + Views []PublicView + ScopeViews []PublicView + Definitions []PublicFilterDefinition + Options map[string][]CatalogFilterOption + Site site.Configuration + Locale string + Generation int64 } + +var ErrCatalogScopeNotFound = errors.New("public catalog scope not found") + type CatalogFilterError struct{ Field, Message string } func (e *CatalogFilterError) Error() string { return e.Field + ": " + e.Message } @@ -75,7 +82,62 @@ func (e *Engine) AdmitCatalog(ctx context.Context, request CatalogQuery) (Catalo return CatalogSnapshot{}, err } snapshot := CatalogSnapshot{Site: e.index.site, Generation: e.index.siteEpoch, Options: map[string][]CatalogFilterOption{}, Views: []PublicView{}, ScopeViews: []PublicView{}} + presentation := PublicView{Site: e.index.site, SiteEpoch: e.index.siteEpoch, Language: e.index.localization.DefaultLocale, DefaultLocale: e.index.localization.DefaultLocale, SupportedLocales: slices.Clone(e.index.localization.EnabledLocales), PublicCopyDefaults: map[string]map[string]string{}, PublicCopyOverrides: e.index.localization.PublicCopyOverrides} + if len(e.index.views) > 0 { + presentation = e.admittedViewLocked(e.index.views[0]) + presentation.Site = e.index.site + presentation.SiteEpoch = e.index.siteEpoch + } + if presentation.DefaultLocale == "" { + presentation.DefaultLocale = "en-US" + } + if presentation.Language == "" { + presentation.Language = presentation.DefaultLocale + } + if len(presentation.SupportedLocales) == 0 { + presentation.SupportedLocales = []string{presentation.DefaultLocale} + } + if len(presentation.PublicCopyDefaults) == 0 { + presentation.PublicCopyDefaults = map[string]map[string]string{} + for _, item := range localization.OfficialPublicCopyCatalog().Defaults { + if presentation.PublicCopyDefaults[item.Key] == nil { + presentation.PublicCopyDefaults[item.Key] = map[string]string{} + } + presentation.PublicCopyDefaults[item.Key][item.Locale] = item.Value + } + } + snapshot.Presentation = presentation locale := request.Locale + if locale == "" { + locale = presentation.DefaultLocale + } + if !slices.Contains(presentation.SupportedLocales, locale) { + return snapshot, localization.ErrUnsupportedLocale + } + if request.ScopeURL != "" && request.Scope.ID == "" { + for _, v := range e.index.views { + switch request.Scope.Kind { + case "manufacturer": + if v.ManufacturerURL == request.ScopeURL { + request.Scope.ID = v.ManufacturerID + } + case "brand": + if v.BrandURL == request.ScopeURL { + request.Scope.ID = v.BrandID + } + case "application": + for _, a := range v.Applications { + if a.URL == request.ScopeURL { + request.Scope.ID = a.ID + } + } + } + } + if request.Scope.ID == "" { + return snapshot, ErrCatalogScopeNotFound + } + } + snapshot.Scope = request.Scope if len(e.index.views) > 0 { view := e.index.views[0] if locale == "" { @@ -85,7 +147,7 @@ func (e *Engine) AdmitCatalog(ctx context.Context, request CatalogQuery) (Catalo } } if !slices.Contains(publicSupportedLocales(view), locale) { - return snapshot, fmt.Errorf("%w: locale is not enabled", ErrInvalidSpecSearch) + return snapshot, localization.ErrUnsupportedLocale } } if locale == "" { @@ -113,7 +175,8 @@ func (e *Engine) AdmitCatalog(ctx context.Context, request CatalogQuery) (Catalo view.Applications = slices.Clone(view.Applications) view.CategoryTrail = slices.Clone(view.CategoryTrail) view = view.ForLocale(locale) - if catalogScopeMatches(view, request.Scope) { + snapshot.AllViews = append(snapshot.AllViews, view) + if catalogScopeMatches(view, request.Scope) && (request.Scope.Kind == "search" || strings.TrimSpace(request.Scope.Query) == "" || catalogKeywordRank(view, request.Scope.Query) >= 0) { snapshot.ScopeViews = append(snapshot.ScopeViews, view) } } @@ -389,3 +452,12 @@ func (e *Engine) admitSpecCandidatesLocked(snapshot SpecCandidateSnapshot, proje } return candidates, projected } + +// AdmitCatalogViews retains the explicitly enabled PoC fallback with the same oracle. +func AdmitCatalogViews(ctx context.Context, views []PublicView, configuration site.Configuration, query CatalogQuery) (CatalogSnapshot, error) { + e := &Engine{index: &publicIndex{views: views, byID: map[string]ActivePublication{}, site: configuration}} + for _, v := range views { + e.index.byID[v.ID] = ActivePublication{ProductID: v.ID, View: v} + } + return e.AdmitCatalog(ctx, query) +} diff --git a/internal/publishing/protocol.go b/internal/publishing/protocol.go index 2e95d8e..8d7ea31 100644 --- a/internal/publishing/protocol.go +++ b/internal/publishing/protocol.go @@ -217,6 +217,7 @@ type Config struct { } type publicIndex struct { + localization site.WebsiteLocalization specDigest string specDigestError error specInventory map[string]SpecCandidateBinding @@ -686,6 +687,15 @@ func (e *Engine) installLocked(ctx context.Context) error { return err } next := &publicIndex{byID: make(map[string]ActivePublication), byRoute: make(map[string]routeTarget), byAsset: make(map[string]assetTarget), history: make(map[string]RouteHistory), site: configuration, siteEpoch: siteEpoch, customCSSDisabled: customCSSDisabled, runtimeGeneration: runtimeGeneration} + if reader, ok := e.repository.(interface { + ActiveWebsiteLocalization(context.Context) (site.WebsiteLocalization, error) + }); ok { + next.localization, err = reader.ActiveWebsiteLocalization(ctx) + if err != nil { + e.index = &publicIndex{unhealthy: err} + return err + } + } siteAssets, err := e.assetsForSite(ctx, configuration, false) if err != nil { e.index = &publicIndex{unhealthy: err} diff --git a/internal/storage/sqlite/website_store.go b/internal/storage/sqlite/website_store.go index 2399253..5c62fd6 100644 --- a/internal/storage/sqlite/website_store.go +++ b/internal/storage/sqlite/website_store.go @@ -390,3 +390,8 @@ func (s *Store) RestoreWebsiteVersion(ctx context.Context, actorID string, expec } return s.WebsiteState(ctx) } + +func (s *Store) ActiveWebsiteLocalization(ctx context.Context) (site.WebsiteLocalization, error) { + state, err := s.WebsiteState(ctx) + return state.ActiveLocalization, err +} diff --git a/internal/webapp/catalog_filters.go b/internal/webapp/catalog_filters.go new file mode 100644 index 0000000..deb7746 --- /dev/null +++ b/internal/webapp/catalog_filters.go @@ -0,0 +1,269 @@ +package webapp + +import ( + "fmt" + "net/url" + "prods/internal/catalogfilter" + "prods/internal/localization" + "prods/internal/publishing" + "prods/internal/specnumeric" + "slices" + "sort" + "strings" +) + +type catalogFilterControl struct { + Field, Label, Kind, Operator, Value, Lower, Upper, Unit, Error string + Operators []catalogFilterOperator + Options []catalogFilterOption + Selected []string +} +type catalogFilterOperator struct { + Value, Label string + Selected bool +} +type catalogFilterOption struct { + Value, Label string + Selected bool +} +type catalogHiddenField struct{ Name, Value string } + +func filterField(key string) (string, string, bool) { + if !strings.HasPrefix(key, "f.") { + return "", "", false + } + field, property, ok := strings.Cut(strings.TrimPrefix(key, "f."), ".") + return field, property, ok && field != "" +} +func parseCatalogFilters(values url.Values) ([]catalogfilter.Clause, error) { + grouped := map[string]url.Values{} + invalid := func(field, message string) ([]catalogfilter.Clause, error) { + return nil, &publishing.CatalogFilterError{Field: field, Message: message} + } + for key, value := range values { + if !strings.HasPrefix(key, "f.") { + continue + } + field, property, ok := filterField(key) + if !ok || !slices.Contains([]string{"op", "value", "values", "lower", "upper", "unit"}, property) { + return invalid(field, "unknown filter parameter") + } + if property != "values" && len(value) != 1 { + return invalid(field, "duplicate filter parameter") + } + for _, v := range value { + if len(v) > 512 { + return invalid(field, "value exceeds 512 bytes") + } + } + if grouped[field] == nil { + grouped[field] = url.Values{} + } + grouped[field][property] = value + } + fields := make([]string, 0, len(grouped)) + for field := range grouped { + fields = append(fields, field) + } + sort.Strings(fields) + clauses := []catalogfilter.Clause{} + specs := 0 + for _, field := range fields { + v := grouped[field] + selected := []string{} + for _, value := range append(slices.Clone(v["values"]), v["value"]...) { + if strings.TrimSpace(value) != "" { + selected = append(selected, value) + } + } + if len(v["values"]) > 20 || len(selected) > 20 { + return invalid(field, "at most twenty values are allowed") + } + lower, upper := strings.TrimSpace(v.Get("lower")), strings.TrimSpace(v.Get("upper")) + if len(selected) == 0 && lower == "" && upper == "" { + continue + } + clause := catalogfilter.Clause{Field: field, Operator: v.Get("op"), Values: selected} + if clause.Operator == "" { + return invalid(field, "operator required") + } + if clause.Operator != "equals" && clause.Operator != "contains" { + if !strings.HasPrefix(field, "spec:") { + return invalid(field, "unsupported text operator") + } + predicate := specnumeric.Predicate{SpecID: strings.TrimPrefix(field, "spec:"), Operator: specnumeric.Operator(clause.Operator), Unit: v.Get("unit")} + decimal := func(raw string) (*specnumeric.Decimal, error) { + if raw == "" { + return nil, nil + } + value, err := specnumeric.ParseDecimal(raw) + return &value, err + } + var err error + if len(selected) > 1 { + return invalid(field, "numeric condition requires one operand") + } + if len(selected) == 1 { + predicate.Value, err = decimal(selected[0]) + if err != nil { + return invalid(field, "invalid number") + } + } + predicate.Lower, err = decimal(lower) + if err != nil { + return invalid(field, "invalid lower bound") + } + predicate.Upper, err = decimal(upper) + if err != nil { + return invalid(field, "invalid upper bound") + } + clause.Numeric = &predicate + clause.Values = nil + } else if lower != "" || upper != "" || v.Get("unit") != "" { + return invalid(field, "text condition cannot use numeric operands") + } + if strings.HasPrefix(field, "spec:") { + specs++ + if specs > 16 { + return invalid(field, "at most sixteen specification conditions are allowed") + } + } + clauses = append(clauses, clause) + } + // Preserve the existing stable-ID URL parameters as conditions. + for _, field := range []string{"manufacturer", "brand", "category"} { + if value := strings.TrimSpace(values.Get(field + "_id")); value != "" { + clauses = append(clauses, catalogfilter.Clause{Field: field, Operator: "equals", Values: []string{value}}) + } + } + return clauses, nil +} + +func catalogFilterForm(snapshot publishing.CatalogSnapshot, values url.Values) []catalogFilterControl { + text := localization.For(snapshot.Locale) + controls := []catalogFilterControl{} + labels := map[string]string{"manufacturer": text.Manufacturer, "brand": text.Brand, "category": text.Category, "application": text.Applications, "lifecycle": text.Lifecycle, "package": text.Package} + for _, view := range snapshot.ScopeViews { + for _, spec := range view.ApplicableSpecifications { + labels["spec:"+spec.ID] = spec.Name + } + } + definitions := slices.Clone(snapshot.Definitions) + known := map[string]bool{} + for _, d := range definitions { + known[d.Field] = true + } + unknown := map[string]bool{} + for key := range values { + field, _, ok := filterField(key) + if ok && !known[field] { + unknown[field] = true + } + } + keys := []string{} + for field := range unknown { + keys = append(keys, field) + } + sort.Strings(keys) + for _, field := range keys { + definitions = append(definitions, publishing.PublicFilterDefinition{Field: field, Profile: catalogfilter.DefaultTextProfile()}) + } + for _, d := range definitions { + prefix := "f." + d.Field + "." + control := catalogFilterControl{Field: d.Field, Label: labels[d.Field], Kind: d.Profile.Kind, Operator: values.Get(prefix + "op"), Value: values.Get(prefix + "value"), Lower: values.Get(prefix + "lower"), Upper: values.Get(prefix + "upper"), Unit: values.Get(prefix + "unit"), Selected: slices.Clone(values[prefix+"values"])} + if control.Label == "" { + control.Label = d.Field + } + if slices.Contains([]string{"manufacturer", "brand", "category"}, d.Field) { + if legacy := values.Get(d.Field + "_id"); legacy != "" { + control.Selected = append(control.Selected, legacy) + } + } + if !known[d.Field] { + control.Error = text.FilterUnavailable + } + if control.Operator == "" && len(d.Profile.Operators) > 0 { + control.Operator = d.Profile.Operators[0] + } + operators := slices.Clone(d.Profile.Operators) + if control.Operator != "" && !slices.Contains(operators, control.Operator) { + operators = append(operators, control.Operator) + } + for _, op := range operators { + label := op + switch op { + case "equals": + label = text.FilterEquals + case "contains": + label = text.FilterContains + case "contains_point": + label = text.FilterSupports + case "contains_range": + label = text.FilterCovers + case "between": + label = text.FilterBetween + } + control.Operators = append(control.Operators, catalogFilterOperator{Value: op, Label: label, Selected: op == control.Operator}) + } + if d.Profile.Numeric != nil && control.Unit == "" { + control.Unit = d.Profile.Numeric.CanonicalUnit + } + options := slices.Clone(snapshot.Options[d.Field]) + selected := append(slices.Clone(control.Selected), control.Value) + for _, value := range selected { + if value == "" { + continue + } + found := false + for _, option := range options { + if option.Value == value { + found = true + } + } + if !found { + options = append(options, publishing.CatalogFilterOption{Value: value, Label: value}) + } + } + for _, option := range options { + control.Options = append(control.Options, catalogFilterOption{Value: option.Value, Label: option.Label, Selected: slices.Contains(selected, option.Value)}) + } + controls = append(controls, control) + } + return controls +} +func validateCatalogFilterFields(snapshot publishing.CatalogSnapshot, values url.Values) error { + known := map[string]bool{} + for _, d := range snapshot.Definitions { + known[d.Field] = true + } + keys := []string{} + for key := range values { + keys = append(keys, key) + } + sort.Strings(keys) + for _, key := range keys { + if field, _, ok := filterField(key); ok && !known[field] { + return &publishing.CatalogFilterError{Field: field, Message: "field is not applicable with one published meaning in this scope"} + } + } + return nil +} +func catalogFilterHiddenFields(values url.Values) []catalogHiddenField { + keys := []string{} + for key := range values { + if strings.HasPrefix(key, "f.") || slices.Contains([]string{"manufacturer_id", "brand_id", "category_id", "page_size"}, key) { + keys = append(keys, key) + } + } + sort.Strings(keys) + result := []catalogHiddenField{} + for _, key := range keys { + for _, value := range values[key] { + result = append(result, catalogHiddenField{Name: key, Value: value}) + } + } + return result +} +func catalogFilterErrorLabel(err error, text localization.Messages) string { + return fmt.Sprintf("%s: %s", text.FilterError, err) +} diff --git a/internal/webapp/catalog_filters_test.go b/internal/webapp/catalog_filters_test.go new file mode 100644 index 0000000..16a1c57 --- /dev/null +++ b/internal/webapp/catalog_filters_test.go @@ -0,0 +1,65 @@ +package webapp + +import ( + "html" + "net/http" + "net/http/httptest" + "net/url" + "strings" + "testing" +) + +func TestPublicCatalogFilterFormWorksWithoutJavaScript(t *testing.T) { + f, server, client, _ := numericHTTPFixture(t) + p, err := f.store.Product(t.Context(), f.productID) + if err != nil { + t.Fatal(err) + } + p.PackageFormFactor = "QFN-32" + if _, err = f.store.UpdateProduct(t.Context(), f.actor, p.Revision, p); err != nil { + t.Fatal(err) + } + f.drain(t) + c := f.view(t) + field := "spec:" + c.NumericDefinitions[0].SpecID + values := url.Values{"f.package.op": {"contains"}, "f.package.value": {"QFN"}, "f." + field + ".op": {"contains_point"}, "f." + field + ".value": {"4"}, "f." + field + ".unit": {"V"}, "page_size": {"1"}} + response, err := client.Get(server.URL + "/catalog?" + values.Encode()) + if err != nil { + t.Fatal(err) + } + body := responseBody(t, response) + if response.StatusCode != http.StatusOK || !strings.Contains(body, `name="f.`+field+`.value"`) || !strings.Contains(body, `name="f.package.value"`) || !strings.Contains(body, "NUMERIC-PUBLIC") || !strings.Contains(body, `method="get"`) { + t.Fatalf("no-JS form status=%d body=%s", response.StatusCode, body) + } + values.Set("f."+field+".value", "8") + response, err = client.Get(server.URL + "/catalog?" + values.Encode()) + if err != nil { + t.Fatal(err) + } + body = responseBody(t, response) + if response.StatusCode != http.StatusOK || strings.Contains(body, `data-product-row="`+f.productID+`"`) || !strings.Contains(body, `value="8"`) { + t.Fatalf("numeric condition not applied: %d %s", response.StatusCode, body) + } + req := httptest.NewRequest("GET", "/catalog?"+values.Encode(), nil) + next, err := url.Parse(listingPageURL(req, 2)) + if err != nil { + t.Fatal(err) + } + if next.Query().Get("f."+field+".value") != "8" || next.Query().Get("f.package.value") != "QFN" { + t.Fatalf("pagination lost conditions: %s", next) + } +} + +func TestUnknownCatalogFilterPreservesQuery(t *testing.T) { + _, server, client, _ := numericHTTPFixture(t) + raw := "KEEP & edits" + values := url.Values{"q": {raw}, "f.spec:unknown.op": {"contains"}, "f.spec:unknown.value": {"original"}} + response, err := client.Get(server.URL + "/catalog?" + values.Encode()) + if err != nil { + t.Fatal(err) + } + body := responseBody(t, response) + if response.StatusCode != http.StatusUnprocessableEntity || !strings.Contains(body, html.EscapeString(raw)) || !strings.Contains(body, "spec:unknown") || !strings.Contains(body, "original") { + t.Fatalf("unknown condition lost input: %d %s", response.StatusCode, body) + } +} diff --git a/internal/webapp/catalog_listing.go b/internal/webapp/catalog_listing.go index 1699c55..d802b8d 100644 --- a/internal/webapp/catalog_listing.go +++ b/internal/webapp/catalog_listing.go @@ -4,6 +4,7 @@ import ( "crypto/sha256" "database/sql" "encoding/hex" + "encoding/json" "errors" "fmt" "net/http" @@ -13,13 +14,18 @@ import ( "strings" "prods/internal/catalog" + "prods/internal/catalogfilter" "prods/internal/cataloglisting" "prods/internal/publishing" + "prods/internal/site" ) const publicListingPageSize = 24 type catalogPage struct { + FilterControls []catalogFilterControl + FilterError string + FilterHidden []catalogHiddenField publicPage Title string Query string @@ -51,109 +57,147 @@ type publicCategoryLink struct { } func (s *Server) renderCatalogSearch(w http.ResponseWriter, r *http.Request) { - query := r.URL.Query().Get("q") - filters := publicSearchFilters{ - ManufacturerID: strings.TrimSpace(r.URL.Query().Get("manufacturer_id")), - BrandID: strings.TrimSpace(r.URL.Query().Get("brand_id")), - CategoryID: strings.TrimSpace(r.URL.Query().Get("category_id")), - } - allViews, err := s.publicViews(r.Context()) - if err != nil { - s.internalError(w, err) - return - } - views := allViews - if strings.TrimSpace(query) != "" && s.publisher != nil { - views, err = s.publisher.Search(r.Context(), query) - } - if err != nil { - s.internalError(w, err) - return - } - if strings.TrimSpace(query) != "" && s.publisher == nil { - views = fallbackPublicSearch(views, query) - } - views = filterPublicViews(views, filters) - presentation, err := s.currentPublicPage(r, views) - if err != nil { - s.writePublicPageError(w, err) + s.renderFilteredCatalog(w, r, "") +} +func (s *Server) renderCatalogAggregate(w http.ResponseWriter, r *http.Request, kind string) { + s.renderFilteredCatalog(w, r, kind) +} + +func (s *Server) renderFilteredCatalog(w http.ResponseWriter, r *http.Request, kind string) { + if len(r.URL.RawQuery) > 8192 { + http.Error(w, "catalog query exceeds 8192 bytes", http.StatusBadRequest) return } - scope := cataloglisting.Scope{Kind: cataloglisting.ScopeAll} + values := r.URL.Query() + query := values.Get("q") + scope := catalogfilter.Scope{Kind: "all", Query: query} if strings.TrimSpace(query) != "" { - scope = cataloglisting.Scope{Kind: cataloglisting.ScopeSearch, Query: query} + scope.Kind = "search" + } + var categories []catalog.Category + var err error + title := "" + scopeURL := "" + if kind != "" { + scope.Kind = kind + if kind == "category" { + categories, err = s.store.ListCategories(r.Context()) + if err != nil { + s.internalError(w, err) + return + } + urls := categoryURLs(categories) + for _, category := range categories { + if category.Status == catalog.EntryActive && urls[category.ID] == r.URL.Path { + scope.ID = category.ID + title = category.Name + break + } + } + if scope.ID == "" { + http.NotFound(w, r) + return + } + } else { + scopeURL = strings.TrimRight(s.config.BaseURL, "/") + r.URL.Path + } } - listing, err := cataloglisting.Resolve(views, presentation.Site, catalogListingRequest(r, scope, presentation.Language)) - if err != nil { - http.Error(w, "invalid catalog listing request", http.StatusBadRequest) - return + clauses, filterErr := parseCatalogFilters(values) + request := publishing.CatalogQuery{Scope: scope, ScopeURL: scopeURL, Locale: values.Get("lang"), Clauses: clauses} + var snapshot publishing.CatalogSnapshot + if s.publisher != nil { + snapshot, err = s.publisher.AdmitCatalog(r.Context(), request) + } else { + var views []publishing.PublicView + views, err = s.publicViews(r.Context()) + if err == nil { + configuration := site.DefaultConfiguration() + if len(views) > 0 { + configuration = views[0].Site + } + snapshot, err = publishing.AdmitCatalogViews(r.Context(), views, configuration, request) + } } - preparePublicListing(&listing, presentation) - manufacturerOptions, brandOptions, categoryOptions := publicSearchFilterOptions(allViews, filters) - categories, categoryErr := s.store.ListCategories(r.Context()) - if categoryErr != nil && !errors.Is(categoryErr, sql.ErrNoRows) { - s.internalError(w, categoryErr) + var conditionErr *publishing.CatalogFilterError + if errors.As(err, &conditionErr) { + filterErr = err + } else if errors.Is(err, publishing.ErrCatalogScopeNotFound) { + http.NotFound(w, r) + return + } else if err != nil { + s.writePublicPageError(w, err) return } - categoryLinks, _, _, _ := publicCategoryNavigation(categories, allViews, "") - data := catalogPage{ - publicPage: presentation, Title: presentation.Text.Catalog, Query: query, Listing: listing, - NoResults: strings.TrimSpace(query) != "" && listing.Total == 0, - RequestURL: withLanguage("/rfq?query="+url.QueryEscape(query), presentation.Language), - FormAction: r.URL.Path, ShowFilters: true, ManufacturerID: filters.ManufacturerID, BrandID: filters.BrandID, CategoryID: filters.CategoryID, - ManufacturerOptions: manufacturerOptions, BrandOptions: brandOptions, CategoryOptions: categoryOptions, - CategoryLinks: categoryLinks, - } - if strings.TrimSpace(query) != "" || filters.ManufacturerID != "" || filters.BrandID != "" || filters.CategoryID != "" || - strings.TrimSpace(r.URL.Query().Get("sort")) != "" || strings.TrimSpace(r.URL.Query().Get("direction")) != "" || - strings.TrimSpace(r.URL.Query().Get("page")) != "" || strings.TrimSpace(r.URL.Query().Get("page_size")) != "" { - data.ClearURL = withLanguage(r.URL.Path, presentation.Language) + if filterErr == nil { + filterErr = validateCatalogFilterFields(snapshot, values) } - setCatalogPagination(r, &data) - w.Header().Set("Content-Language", presentation.Language) - s.render(w, "catalog-listing", data) -} - -func (s *Server) renderCatalogAggregate(w http.ResponseWriter, r *http.Request, kind string) { - allViews, err := s.publicViews(r.Context()) + presentation, err := s.currentPublicPage(r, []publishing.PublicView{snapshot.Presentation}) if err != nil { - s.internalError(w, err) + s.writePublicPageError(w, err) return } - targetURL := strings.TrimRight(s.config.BaseURL, "/") + r.URL.Path - scope, title, categories, err := s.resolvePublicAggregate(r, kind, targetURL, allViews) - if err != nil { - if errors.Is(err, errPublicAggregateNotFound) { - http.NotFound(w, r) - return + if kind == "" { + title = presentation.Text.Catalog + } else if title == "" && len(snapshot.ScopeViews) > 0 { + v := snapshot.ScopeViews[0] + switch kind { + case "manufacturer": + title = v.Manufacturer + case "brand": + title = v.Brand + case "application": + for _, a := range v.Applications { + if a.ID == snapshot.Scope.ID { + title = a.Name + } + } } - s.internalError(w, err) - return } - presentation, err := s.currentPublicPage(r, allViews) - if err != nil { - s.writePublicPageError(w, err) - return + listingScope := cataloglisting.Scope{Kind: cataloglisting.ScopeKind(snapshot.Scope.Kind), ID: snapshot.Scope.ID, Query: snapshot.Scope.Query} + if filterErr != nil { + snapshot.Views = nil } - listing, err := cataloglisting.Resolve(allViews, presentation.Site, catalogListingRequest(r, scope, presentation.Language)) + listing, err := cataloglisting.ResolveSnapshot(snapshot, catalogListingRequest(r, listingScope, presentation.Language)) if err != nil { http.Error(w, "invalid catalog listing request", http.StatusBadRequest) return } preparePublicListing(&listing, presentation) - etag := aggregateListingETag(targetURL, listing, categories) - w.Header().Set("ETag", etag) - w.Header().Set("Cache-Control", "public, max-age=0, must-revalidate") - if r.Header.Get("If-None-Match") == etag { - w.WriteHeader(http.StatusNotModified) - return + data := catalogPage{publicPage: presentation, Title: title, Query: query, Listing: listing, NoResults: filterErr == nil && strings.TrimSpace(query) != "" && listing.Total == 0, RequestURL: withLanguage("/rfq?query="+url.QueryEscape(query), presentation.Language), FormAction: r.URL.Path, ShowFilters: true, FilterControls: catalogFilterForm(snapshot, values), FilterHidden: catalogFilterHiddenFields(values), ClearURL: withLanguage(r.URL.Path, presentation.Language)} + if kind == "" { + if categories == nil { + categories, err = s.store.ListCategories(r.Context()) + if err != nil && !errors.Is(err, sql.ErrNoRows) { + s.internalError(w, err) + return + } + } + data.CategoryLinks, _, _, _ = publicCategoryNavigation(categories, snapshot.AllViews, "") } - data := catalogPage{publicPage: presentation, Title: title, Listing: listing, FormAction: r.URL.Path} if kind == "category" { - _, data.Breadcrumbs, data.ChildCategories, _ = publicCategoryNavigation(categories, allViews, scope.ID) + _, data.Breadcrumbs, data.ChildCategories, _ = publicCategoryNavigation(categories, snapshot.AllViews, scope.ID) } setCatalogPagination(r, &data) w.Header().Set("Content-Language", presentation.Language) + w.Header().Set("Cache-Control", "public, max-age=0, must-revalidate") + if filterErr != nil { + data.FilterError = catalogFilterErrorLabel(filterErr, presentation.Text) + w.WriteHeader(http.StatusUnprocessableEntity) + } else { + material, _ := json.Marshal(struct { + Query string + Snapshot publishing.CatalogSnapshot + Listing cataloglisting.Result + Categories []catalog.Category + }{r.URL.RawQuery, snapshot, listing, categories}) + sum := sha256.Sum256(material) + etag := `"c-` + hex.EncodeToString(sum[:])[:32] + `"` + w.Header().Set("ETag", etag) + if r.Header.Get("If-None-Match") == etag { + w.WriteHeader(http.StatusNotModified) + return + } + } s.render(w, "catalog-listing", data) } diff --git a/internal/webapp/server.go b/internal/webapp/server.go index 1572e76..32c95ad 100644 --- a/internal/webapp/server.go +++ b/internal/webapp/server.go @@ -695,7 +695,10 @@ func (s *Server) currentPublicPage(r *http.Request, views []publishing.PublicVie if len(views) > 0 { configuration = views[0].Site epoch = views[0].SiteEpoch - defaultLocale = views[0].Language + defaultLocale = views[0].DefaultLocale + if defaultLocale == "" { + defaultLocale = views[0].Language + } supportedLocales = append([]string(nil), views[0].SupportedLocales...) } else { website, err := s.store.WebsiteState(ctx) diff --git a/internal/webapp/static/public/public.css b/internal/webapp/static/public/public.css index 33f5ade..38b9d7a 100644 --- a/internal/webapp/static/public/public.css +++ b/internal/webapp/static/public/public.css @@ -464,3 +464,21 @@ code { .row-more-control { display: inline-flex; } .rfq-selection-tray { align-items: stretch; flex-direction: column; width: 100%; } } + +/* The semantic GET form remains usable without enhancement. */ +.catalog-workspace { display: grid; grid-template-columns: minmax(14rem, 18rem) minmax(0, 1fr); gap: 1.5rem; align-items: start; } +.catalog-results, .catalog-filter-sidebar { min-width: 0; } +.catalog-filter-sidebar .catalog-filters { display: grid; gap: 1rem; margin: 0; padding: 1rem; } +.catalog-filter-sidebar summary { display: list-item; cursor: pointer; font-weight: 700; padding: .75rem; } +.catalog-filter-field { min-width: 0; margin: 0; padding: .65rem; border: 1px solid #c9d8df; border-radius: .4rem; } +.catalog-filter-field legend { padding-inline: .25rem; font-weight: 600; overflow-wrap: anywhere; } +.catalog-filter-field label { display: block; margin-block: .4rem; font-size: .9rem; } +.catalog-filter-sidebar input, .catalog-filter-sidebar select { width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; } +.catalog-filter-sidebar select[multiple] { min-height: 5rem; } +.filter-range { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .5rem; } +.filter-help { font-size: .8rem; line-height: 1.5; color: #4c6170; } +.filter-error { color: #9b231c; padding: .65rem; border: 1px solid currentColor; overflow-wrap: anywhere; } +.catalog-filter-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; } +.catalog-filter-sidebar :is(input, select, button, a):focus-visible { outline: 3px solid #147985; outline-offset: 2px; } +@media (max-width: 1024px) { .catalog-workspace { grid-template-columns: minmax(0, 1fr); } .catalog-filter-sidebar .catalog-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } .catalog-filter-actions { grid-column: 1 / -1; } } +@media (max-width: 640px) { .catalog-filter-sidebar .catalog-filters { grid-template-columns: minmax(0, 1fr); } } diff --git a/internal/webapp/templates/catalog_filters.tmpl b/internal/webapp/templates/catalog_filters.tmpl new file mode 100644 index 0000000..eccc726 --- /dev/null +++ b/internal/webapp/templates/catalog_filters.tmpl @@ -0,0 +1,15 @@ +{{define "catalog-filter-panel"}} + +{{end}} diff --git a/internal/webapp/templates/pages.tmpl b/internal/webapp/templates/pages.tmpl index a551d5b..30d4a74 100644 --- a/internal/webapp/templates/pages.tmpl +++ b/internal/webapp/templates/pages.tmpl @@ -43,15 +43,12 @@

{{.Text.Catalog}}

{{.Title}}

{{if .CategoryLinks}}
{{.Text.Category}}
{{end}} {{if .ChildCategories}}

{{.Text.Category}}

{{end}} -{{if .ShowFilters}}
{{.Text.Filters}}
-{{if .ManufacturerOptions}}{{end}} -{{if .BrandOptions}}{{end}} -{{if .CategoryOptions}}{{end}}{{if .ClearURL}}{{.Text.ClearFilters}}{{end}}
{{end}} +
{{template "catalog-filter-panel" .}}
{{if .NoResults}}

{{.Text.NoProducts}}

{{.Text.NoProductsPrefix}} {{.Query}}.

{{.Text.RequestThisPart}}
{{else}} -

{{.Listing.Total}} products

{{if .Query}}{{end}}{{if .ManufacturerID}}{{end}}{{if .BrandID}}{{end}}{{if .CategoryID}}{{end}}
+

{{.Listing.Total}} products

{{range .FilterHidden}}{{end}}
{{if .Listing.Rows}}{{$columns := .Listing.Columns}}
{{range $columns}}{{end}}{{range .Listing.Rows}}{{$row := .}}{{range $columns}}{{end}}{{end}}
{{.Label}}{{if .PreferredUnit}} ({{.PreferredUnit}}){{end}}
{{if eq .Key "part_number"}}{{index $row.Values .Key}}{{else if eq .Key "documents"}}{{if $row.Documents}}{{else}}—{{end}}{{else if eq .Key "rfq"}}{{$.Text.RequestQuote}}{{else}}{{with index $row.Values .Key}}{{.}}{{else}}—{{end}}{{end}}
{{else}}

{{.Text.NoProducts}}

This category is available but has no published products.

{{end}} {{end}} -{{template "public-footer" .}}{{end}} +
{{template "public-footer" .}}{{end}} {{define "product"}}{{template "public-header" .}}
diff --git a/web/ui/src/public/style.css b/web/ui/src/public/style.css index 33f5ade..38b9d7a 100644 --- a/web/ui/src/public/style.css +++ b/web/ui/src/public/style.css @@ -464,3 +464,21 @@ code { .row-more-control { display: inline-flex; } .rfq-selection-tray { align-items: stretch; flex-direction: column; width: 100%; } } + +/* The semantic GET form remains usable without enhancement. */ +.catalog-workspace { display: grid; grid-template-columns: minmax(14rem, 18rem) minmax(0, 1fr); gap: 1.5rem; align-items: start; } +.catalog-results, .catalog-filter-sidebar { min-width: 0; } +.catalog-filter-sidebar .catalog-filters { display: grid; gap: 1rem; margin: 0; padding: 1rem; } +.catalog-filter-sidebar summary { display: list-item; cursor: pointer; font-weight: 700; padding: .75rem; } +.catalog-filter-field { min-width: 0; margin: 0; padding: .65rem; border: 1px solid #c9d8df; border-radius: .4rem; } +.catalog-filter-field legend { padding-inline: .25rem; font-weight: 600; overflow-wrap: anywhere; } +.catalog-filter-field label { display: block; margin-block: .4rem; font-size: .9rem; } +.catalog-filter-sidebar input, .catalog-filter-sidebar select { width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; } +.catalog-filter-sidebar select[multiple] { min-height: 5rem; } +.filter-range { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .5rem; } +.filter-help { font-size: .8rem; line-height: 1.5; color: #4c6170; } +.filter-error { color: #9b231c; padding: .65rem; border: 1px solid currentColor; overflow-wrap: anywhere; } +.catalog-filter-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; } +.catalog-filter-sidebar :is(input, select, button, a):focus-visible { outline: 3px solid #147985; outline-offset: 2px; } +@media (max-width: 1024px) { .catalog-workspace { grid-template-columns: minmax(0, 1fr); } .catalog-filter-sidebar .catalog-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } .catalog-filter-actions { grid-column: 1 / -1; } } +@media (max-width: 640px) { .catalog-filter-sidebar .catalog-filters { grid-template-columns: minmax(0, 1fr); } } From 7deb72749a461942f9b5c474d0519838f5032208 Mon Sep 17 00:00:00 2001 From: Alex Chang Date: Wed, 14 Oct 2026 08:23:27 -0400 Subject: [PATCH 07/10] feat: expose spec search configuration and controlled adoption in admin --- internal/webapp/static/admin/admin.js | 42932 ++++++++-------- web/ui/src/admin/ProductDataModal.tsx | 12 +- web/ui/src/admin/SpecNormalizationPanel.tsx | 55 + web/ui/src/admin/SpecSearchSettings.tsx | 43 + web/ui/src/admin/TaxonomyPanel.tsx | 7 +- web/ui/src/admin/adminLocaleResources.test.ts | 4 +- web/ui/src/admin/locales.ts | 2 + web/ui/src/admin/specCommands.test.ts | 12 + web/ui/src/admin/specCommands.ts | 27 + web/ui/src/admin/specLocale.ts | 4 + web/ui/src/admin/specManualValue.test.ts | 6 + web/ui/src/admin/specManualValue.ts | 31 + web/ui/src/admin/types.ts | 1 + 13 files changed, 21849 insertions(+), 21287 deletions(-) create mode 100644 web/ui/src/admin/SpecNormalizationPanel.tsx create mode 100644 web/ui/src/admin/SpecSearchSettings.tsx create mode 100644 web/ui/src/admin/specCommands.test.ts create mode 100644 web/ui/src/admin/specCommands.ts create mode 100644 web/ui/src/admin/specLocale.ts create mode 100644 web/ui/src/admin/specManualValue.test.ts create mode 100644 web/ui/src/admin/specManualValue.ts diff --git a/internal/webapp/static/admin/admin.js b/internal/webapp/static/admin/admin.js index 282ee73..12e30dd 100644 --- a/internal/webapp/static/admin/admin.js +++ b/internal/webapp/static/admin/admin.js @@ -1,12 +1,12 @@ -var EU = (e, t) => () => { +var MU = (e, t) => () => { try { return t || e((t = { exports: {} }).exports, t), t.exports; } catch (n) { throw t = 0, n; } }; -var sbe = EU((Ci, $i) => { - function RU(e, t) { +var Sbe = MU(($i, wi) => { + function AU(e, t) { for (var n = 0; n < t.length; n++) { const r = t[n]; if (typeof r != "string" && !Array.isArray(r)) { @@ -22,11 +22,11 @@ var sbe = EU((Ci, $i) => { } return Object.freeze(Object.defineProperty(e, Symbol.toStringTag, { value: "Module" })); } - var F_ = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; + var X_ = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; function mo(e) { return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; } - function PU(e) { + function DU(e) { if (Object.prototype.hasOwnProperty.call(e, "__esModule")) return e; var t = e.default; if (typeof t == "function") { @@ -50,11 +50,11 @@ var sbe = EU((Ci, $i) => { }); }), n; } - var LS = { exports: {} }, Ed = {}; - var B_; - function TU() { - if (B_) return Ed; - B_ = 1; + var qS = { exports: {} }, Rd = {}; + var Q_; + function OU() { + if (Q_) return Rd; + Q_ = 1; var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), t = /* @__PURE__ */ Symbol.for("react.fragment"); function n(r, a, s) { var c = null; @@ -71,20 +71,20 @@ var sbe = EU((Ci, $i) => { props: s }; } - return Ed.Fragment = t, Ed.jsx = n, Ed.jsxs = n, Ed; + return Rd.Fragment = t, Rd.jsx = n, Rd.jsxs = n, Rd; } - var H_; - function NU() { - return H_ || (H_ = 1, LS.exports = TU()), LS.exports; + var Y_; + function LU() { + return Y_ || (Y_ = 1, qS.exports = OU()), qS.exports; } - var _ = NU(), kS = { exports: {} }, Ut = {}; - var U_; - function _U() { - if (U_) return Ut; - U_ = 1; + var P = LU(), WS = { exports: {} }, qt = {}; + var Z_; + function kU() { + if (Z_) return qt; + Z_ = 1; var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), t = /* @__PURE__ */ Symbol.for("react.portal"), n = /* @__PURE__ */ Symbol.for("react.fragment"), r = /* @__PURE__ */ Symbol.for("react.strict_mode"), a = /* @__PURE__ */ Symbol.for("react.profiler"), s = /* @__PURE__ */ Symbol.for("react.consumer"), c = /* @__PURE__ */ Symbol.for("react.context"), u = /* @__PURE__ */ Symbol.for("react.forward_ref"), f = /* @__PURE__ */ Symbol.for("react.suspense"), m = /* @__PURE__ */ Symbol.for("react.memo"), p = /* @__PURE__ */ Symbol.for("react.lazy"), g = /* @__PURE__ */ Symbol.for("react.activity"), v = /* @__PURE__ */ Symbol.for("react.view_transition"), y = Symbol.iterator; - function b(k) { - return k === null || typeof k != "object" ? null : (k = y && k[y] || k["@@iterator"], typeof k == "function" ? k : null); + function b(L) { + return L === null || typeof L != "object" ? null : (L = y && L[y] || L["@@iterator"], typeof L == "function" ? L : null); } var S = { isMounted: function() { @@ -97,400 +97,400 @@ var sbe = EU((Ci, $i) => { enqueueSetState: function() { } }, C = Object.assign, E = {}; - function R(k, B, J) { - this.props = k, this.context = B, this.refs = E, this.updater = J || S; + function R(L, j, Q) { + this.props = L, this.context = j, this.refs = E, this.updater = Q || S; } - R.prototype.isReactComponent = {}, R.prototype.setState = function(k, B) { - if (typeof k != "object" && typeof k != "function" && k != null) + R.prototype.isReactComponent = {}, R.prototype.setState = function(L, j) { + if (typeof L != "object" && typeof L != "function" && L != null) throw Error( "takes an object of state variables to update or a function which returns an object of state variables." ); - this.updater.enqueueSetState(this, k, B, "setState"); - }, R.prototype.forceUpdate = function(k) { - this.updater.enqueueForceUpdate(this, k, "forceUpdate"); + this.updater.enqueueSetState(this, L, j, "setState"); + }, R.prototype.forceUpdate = function(L) { + this.updater.enqueueForceUpdate(this, L, "forceUpdate"); }; function $() { } $.prototype = R.prototype; - function M(k, B, J) { - this.props = k, this.context = B, this.refs = E, this.updater = J || S; + function z(L, j, Q) { + this.props = L, this.context = j, this.refs = E, this.updater = Q || S; } - var I = M.prototype = new $(); - I.constructor = M, C(I, R.prototype), I.isPureReactComponent = !0; + var I = z.prototype = new $(); + I.constructor = z, C(I, R.prototype), I.isPureReactComponent = !0; var D = Array.isArray; - function N() { + function _() { } - var P = { H: null, A: null, T: null, S: null }, T = Object.prototype.hasOwnProperty; - function A(k, B, J) { - var re = J.ref; + var T = { H: null, A: null, T: null, S: null }, N = Object.prototype.hasOwnProperty; + function A(L, j, Q) { + var te = Q.ref; return { $$typeof: e, - type: k, - key: B, - ref: re !== void 0 ? re : null, - props: J + type: L, + key: j, + ref: te !== void 0 ? te : null, + props: Q }; } - function z(k, B) { - return A(k.type, B, k.props); + function M(L, j) { + return A(L.type, j, L.props); } - function O(k) { - return typeof k == "object" && k !== null && k.$$typeof === e; + function O(L) { + return typeof L == "object" && L !== null && L.$$typeof === e; } - function L(k) { - var B = { "=": "=0", ":": "=2" }; - return "$" + k.replace(/[=:]/g, function(J) { - return B[J]; + function k(L) { + var j = { "=": "=0", ":": "=2" }; + return "$" + L.replace(/[=:]/g, function(Q) { + return j[Q]; }); } var F = /\/+/g; - function U(k, B) { - return typeof k == "object" && k !== null && k.key != null ? L("" + k.key) : B.toString(36); + function q(L, j) { + return typeof L == "object" && L !== null && L.key != null ? k("" + L.key) : j.toString(36); } - function H(k) { - switch (k.status) { + function U(L) { + switch (L.status) { case "fulfilled": - return k.value; + return L.value; case "rejected": - throw k.reason; + throw L.reason; default: - switch (typeof k.status == "string" ? k.then(N, N) : (k.status = "pending", k.then( - function(B) { - k.status === "pending" && (k.status = "fulfilled", k.value = B); + switch (typeof L.status == "string" ? L.then(_, _) : (L.status = "pending", L.then( + function(j) { + L.status === "pending" && (L.status = "fulfilled", L.value = j); }, - function(B) { - k.status === "pending" && (k.status = "rejected", k.reason = B); + function(j) { + L.status === "pending" && (L.status = "rejected", L.reason = j); } - )), k.status) { + )), L.status) { case "fulfilled": - return k.value; + return L.value; case "rejected": - throw k.reason; + throw L.reason; } } - throw k; + throw L; } - function V(k, B, J, re, le) { - var ie = typeof k; - (ie === "undefined" || ie === "boolean") && (k = null); - var Y = !1; - if (k === null) Y = !0; + function V(L, j, Q, te, ce) { + var ie = typeof L; + (ie === "undefined" || ie === "boolean") && (L = null); + var ae = !1; + if (L === null) ae = !0; else switch (ie) { case "bigint": case "string": case "number": - Y = !0; + ae = !0; break; case "object": - switch (k.$$typeof) { + switch (L.$$typeof) { case e: case t: - Y = !0; + ae = !0; break; case p: - return Y = k._init, V( - Y(k._payload), - B, - J, - re, - le + return ae = L._init, V( + ae(L._payload), + j, + Q, + te, + ce ); } } - if (Y) - return le = le(k), Y = re === "" ? "." + U(k, 0) : re, D(le) ? (J = "", Y != null && (J = Y.replace(F, "$&/") + "/"), V(le, B, J, "", function(de) { - return de; - })) : le != null && (O(le) && (le = z( - le, - J + (le.key == null || k && k.key === le.key ? "" : ("" + le.key).replace( + if (ae) + return ce = ce(L), ae = te === "" ? "." + q(L, 0) : te, D(ce) ? (Q = "", ae != null && (Q = ae.replace(F, "$&/") + "/"), V(ce, j, Q, "", function(me) { + return me; + })) : ce != null && (O(ce) && (ce = M( + ce, + Q + (ce.key == null || L && L.key === ce.key ? "" : ("" + ce.key).replace( F, "$&/" - ) + "/") + Y - )), B.push(le)), 1; - Y = 0; - var q = re === "" ? "." : re + ":"; - if (D(k)) - for (var te = 0; te < k.length; te++) - re = k[te], ie = q + U(re, te), Y += V( - re, - B, - J, + ) + "/") + ae + )), j.push(ce)), 1; + ae = 0; + var X = te === "" ? "." : te + ":"; + if (D(L)) + for (var J = 0; J < L.length; J++) + te = L[J], ie = X + q(te, J), ae += V( + te, + j, + Q, ie, - le + ce ); - else if (te = b(k), typeof te == "function") - for (k = te.call(k), te = 0; !(re = k.next()).done; ) - re = re.value, ie = q + U(re, te++), Y += V( - re, - B, - J, + else if (J = b(L), typeof J == "function") + for (L = J.call(L), J = 0; !(te = L.next()).done; ) + te = te.value, ie = X + q(te, J++), ae += V( + te, + j, + Q, ie, - le + ce ); else if (ie === "object") { - if (typeof k.then == "function") + if (typeof L.then == "function") return V( - H(k), - B, - J, - re, - le + U(L), + j, + Q, + te, + ce ); - throw B = String(k), Error( - "Objects are not valid as a React child (found: " + (B === "[object Object]" ? "object with keys {" + Object.keys(k).join(", ") + "}" : B) + "). If you meant to render a collection of children, use an array instead." + throw j = String(L), Error( + "Objects are not valid as a React child (found: " + (j === "[object Object]" ? "object with keys {" + Object.keys(L).join(", ") + "}" : j) + "). If you meant to render a collection of children, use an array instead." ); } - return Y; - } - function ee(k, B, J) { - if (k == null) return k; - var re = [], le = 0; - return V(k, re, "", "", function(ie) { - return B.call(J, ie, le++); - }), re; - } - function X(k) { - if (k._status === -1) { - var B = k._result, J = B(); - J.then( - function(re) { - (k._status === 0 || k._status === -1) && (k._status = 1, k._result = re, J.status === void 0 && (J.status = "fulfilled", J.value = re)); + return ae; + } + function Z(L, j, Q) { + if (L == null) return L; + var te = [], ce = 0; + return V(L, te, "", "", function(ie) { + return j.call(Q, ie, ce++); + }), te; + } + function G(L) { + if (L._status === -1) { + var j = L._result, Q = j(); + Q.then( + function(te) { + (L._status === 0 || L._status === -1) && (L._status = 1, L._result = te, Q.status === void 0 && (Q.status = "fulfilled", Q.value = te)); }, - function(re) { - (k._status === 0 || k._status === -1) && (k._status = 2, k._result = re, J.status === void 0 && (J.status = "rejected", J.reason = re)); + function(te) { + (L._status === 0 || L._status === -1) && (L._status = 2, L._result = te, Q.status === void 0 && (Q.status = "rejected", Q.reason = te)); } - ), k._status === -1 && (k._status = 0, k._result = J); + ), L._status === -1 && (L._status = 0, L._result = Q); } - if (k._status === 1) return k._result.default; - throw k._result; + if (L._status === 1) return L._result.default; + throw L._result; } - var K = typeof reportError == "function" ? reportError : function(k) { + var K = typeof reportError == "function" ? reportError : function(L) { if (typeof window == "object" && typeof window.ErrorEvent == "function") { - var B = new window.ErrorEvent("error", { + var j = new window.ErrorEvent("error", { bubbles: !0, cancelable: !0, - message: typeof k == "object" && k !== null && typeof k.message == "string" ? String(k.message) : String(k), - error: k + message: typeof L == "object" && L !== null && typeof L.message == "string" ? String(L.message) : String(L), + error: L }); - if (!window.dispatchEvent(B)) return; + if (!window.dispatchEvent(j)) return; } else if (typeof process == "object" && typeof process.emit == "function") { - process.emit("uncaughtException", k); + process.emit("uncaughtException", L); return; } - console.error(k); + console.error(L); }; - function G(k) { - var B = P.T, J = {}; - J.types = B !== null ? B.types : null, P.T = J; + function Y(L) { + var j = T.T, Q = {}; + Q.types = j !== null ? j.types : null, T.T = Q; try { - var re = k(), le = P.S; - le !== null && le(J, re), typeof re == "object" && re !== null && typeof re.then == "function" && re.then(N, K); + var te = L(), ce = T.S; + ce !== null && ce(Q, te), typeof te == "object" && te !== null && typeof te.then == "function" && te.then(_, K); } catch (ie) { K(ie); } finally { - B !== null && J.types !== null && (B.types = J.types), P.T = B; + j !== null && Q.types !== null && (j.types = Q.types), T.T = j; } } - function W(k) { - var B = P.T; - if (B !== null) { - var J = B.types; - J === null ? B.types = [k] : J.indexOf(k) === -1 && J.push(k); - } else G(W.bind(null, k)); + function W(L) { + var j = T.T; + if (j !== null) { + var Q = j.types; + Q === null ? j.types = [L] : Q.indexOf(L) === -1 && Q.push(L); + } else Y(W.bind(null, L)); } - var Q = { - map: ee, - forEach: function(k, B, J) { - ee( - k, + var H = { + map: Z, + forEach: function(L, j, Q) { + Z( + L, function() { - B.apply(this, arguments); + j.apply(this, arguments); }, - J + Q ); }, - count: function(k) { - var B = 0; - return ee(k, function() { - B++; - }), B; + count: function(L) { + var j = 0; + return Z(L, function() { + j++; + }), j; }, - toArray: function(k) { - return ee(k, function(B) { - return B; + toArray: function(L) { + return Z(L, function(j) { + return j; }) || []; }, - only: function(k) { - if (!O(k)) + only: function(L) { + if (!O(L)) throw Error( "React.Children.only expected to receive a single React element child." ); - return k; + return L; } }; - return Ut.Activity = g, Ut.Children = Q, Ut.Component = R, Ut.Fragment = n, Ut.Profiler = a, Ut.PureComponent = M, Ut.StrictMode = r, Ut.Suspense = f, Ut.ViewTransition = v, Ut.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = P, Ut.__COMPILER_RUNTIME = { + return qt.Activity = g, qt.Children = H, qt.Component = R, qt.Fragment = n, qt.Profiler = a, qt.PureComponent = z, qt.StrictMode = r, qt.Suspense = f, qt.ViewTransition = v, qt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = T, qt.__COMPILER_RUNTIME = { __proto__: null, - c: function(k) { - return P.H.useMemoCache(k); + c: function(L) { + return T.H.useMemoCache(L); } - }, Ut.addTransitionType = W, Ut.cache = function(k) { + }, qt.addTransitionType = W, qt.cache = function(L) { return function() { - return k.apply(null, arguments); + return L.apply(null, arguments); }; - }, Ut.cacheSignal = function() { + }, qt.cacheSignal = function() { return null; - }, Ut.cloneElement = function(k, B, J) { - if (k == null) + }, qt.cloneElement = function(L, j, Q) { + if (L == null) throw Error( - "The argument must be a React element, but you passed " + k + "." + "The argument must be a React element, but you passed " + L + "." ); - var re = C({}, k.props), le = k.key; - if (B != null) - for (ie in B.key !== void 0 && (le = "" + B.key), B) - !T.call(B, ie) || ie === "key" || ie === "__self" || ie === "__source" || ie === "ref" && B.ref === void 0 || (re[ie] = B[ie]); + var te = C({}, L.props), ce = L.key; + if (j != null) + for (ie in j.key !== void 0 && (ce = "" + j.key), j) + !N.call(j, ie) || ie === "key" || ie === "__self" || ie === "__source" || ie === "ref" && j.ref === void 0 || (te[ie] = j[ie]); var ie = arguments.length - 2; - if (ie === 1) re.children = J; + if (ie === 1) te.children = Q; else if (1 < ie) { - for (var Y = Array(ie), q = 0; q < ie; q++) - Y[q] = arguments[q + 2]; - re.children = Y; + for (var ae = Array(ie), X = 0; X < ie; X++) + ae[X] = arguments[X + 2]; + te.children = ae; } - return A(k.type, le, re); - }, Ut.createContext = function(k) { - return k = { + return A(L.type, ce, te); + }, qt.createContext = function(L) { + return L = { $$typeof: c, - _currentValue: k, - _currentValue2: k, + _currentValue: L, + _currentValue2: L, _threadCount: 0, Provider: null, Consumer: null - }, k.Provider = k, k.Consumer = { + }, L.Provider = L, L.Consumer = { $$typeof: s, - _context: k - }, k; - }, Ut.createElement = function(k, B, J) { - var re, le = {}, ie = null; - if (B != null) - for (re in B.key !== void 0 && (ie = "" + B.key), B) - T.call(B, re) && re !== "key" && re !== "__self" && re !== "__source" && (le[re] = B[re]); - var Y = arguments.length - 2; - if (Y === 1) le.children = J; - else if (1 < Y) { - for (var q = Array(Y), te = 0; te < Y; te++) - q[te] = arguments[te + 2]; - le.children = q; - } - if (k && k.defaultProps) - for (re in Y = k.defaultProps, Y) - le[re] === void 0 && (le[re] = Y[re]); - return A(k, ie, le); - }, Ut.createRef = function() { + _context: L + }, L; + }, qt.createElement = function(L, j, Q) { + var te, ce = {}, ie = null; + if (j != null) + for (te in j.key !== void 0 && (ie = "" + j.key), j) + N.call(j, te) && te !== "key" && te !== "__self" && te !== "__source" && (ce[te] = j[te]); + var ae = arguments.length - 2; + if (ae === 1) ce.children = Q; + else if (1 < ae) { + for (var X = Array(ae), J = 0; J < ae; J++) + X[J] = arguments[J + 2]; + ce.children = X; + } + if (L && L.defaultProps) + for (te in ae = L.defaultProps, ae) + ce[te] === void 0 && (ce[te] = ae[te]); + return A(L, ie, ce); + }, qt.createRef = function() { return { current: null }; - }, Ut.forwardRef = function(k) { - return { $$typeof: u, render: k }; - }, Ut.isValidElement = O, Ut.lazy = function(k) { + }, qt.forwardRef = function(L) { + return { $$typeof: u, render: L }; + }, qt.isValidElement = O, qt.lazy = function(L) { return { $$typeof: p, - _payload: { _status: -1, _result: k }, - _init: X + _payload: { _status: -1, _result: L }, + _init: G }; - }, Ut.memo = function(k, B) { + }, qt.memo = function(L, j) { return { $$typeof: m, - type: k, - compare: B === void 0 ? null : B + type: L, + compare: j === void 0 ? null : j }; - }, Ut.startTransition = G, Ut.unstable_useCacheRefresh = function() { - return P.H.useCacheRefresh(); - }, Ut.use = function(k) { - return P.H.use(k); - }, Ut.useActionState = function(k, B, J) { - return P.H.useActionState(k, B, J); - }, Ut.useCallback = function(k, B) { - return P.H.useCallback(k, B); - }, Ut.useContext = function(k) { - return P.H.useContext(k); - }, Ut.useDebugValue = function() { - }, Ut.useDeferredValue = function(k, B) { - return P.H.useDeferredValue(k, B); - }, Ut.useEffect = function(k, B) { - return P.H.useEffect(k, B); - }, Ut.useEffectEvent = function(k) { - return P.H.useEffectEvent(k); - }, Ut.useId = function() { - return P.H.useId(); - }, Ut.useImperativeHandle = function(k, B, J) { - return P.H.useImperativeHandle(k, B, J); - }, Ut.useInsertionEffect = function(k, B) { - return P.H.useInsertionEffect(k, B); - }, Ut.useLayoutEffect = function(k, B) { - return P.H.useLayoutEffect(k, B); - }, Ut.useMemo = function(k, B) { - return P.H.useMemo(k, B); - }, Ut.useOptimistic = function(k, B) { - return P.H.useOptimistic(k, B); - }, Ut.useReducer = function(k, B, J) { - return P.H.useReducer(k, B, J); - }, Ut.useRef = function(k) { - return P.H.useRef(k); - }, Ut.useState = function(k) { - return P.H.useState(k); - }, Ut.useSyncExternalStore = function(k, B, J) { - return P.H.useSyncExternalStore( - k, - B, - J + }, qt.startTransition = Y, qt.unstable_useCacheRefresh = function() { + return T.H.useCacheRefresh(); + }, qt.use = function(L) { + return T.H.use(L); + }, qt.useActionState = function(L, j, Q) { + return T.H.useActionState(L, j, Q); + }, qt.useCallback = function(L, j) { + return T.H.useCallback(L, j); + }, qt.useContext = function(L) { + return T.H.useContext(L); + }, qt.useDebugValue = function() { + }, qt.useDeferredValue = function(L, j) { + return T.H.useDeferredValue(L, j); + }, qt.useEffect = function(L, j) { + return T.H.useEffect(L, j); + }, qt.useEffectEvent = function(L) { + return T.H.useEffectEvent(L); + }, qt.useId = function() { + return T.H.useId(); + }, qt.useImperativeHandle = function(L, j, Q) { + return T.H.useImperativeHandle(L, j, Q); + }, qt.useInsertionEffect = function(L, j) { + return T.H.useInsertionEffect(L, j); + }, qt.useLayoutEffect = function(L, j) { + return T.H.useLayoutEffect(L, j); + }, qt.useMemo = function(L, j) { + return T.H.useMemo(L, j); + }, qt.useOptimistic = function(L, j) { + return T.H.useOptimistic(L, j); + }, qt.useReducer = function(L, j, Q) { + return T.H.useReducer(L, j, Q); + }, qt.useRef = function(L) { + return T.H.useRef(L); + }, qt.useState = function(L) { + return T.H.useState(L); + }, qt.useSyncExternalStore = function(L, j, Q) { + return T.H.useSyncExternalStore( + L, + j, + Q ); - }, Ut.useTransition = function() { - return P.H.useTransition(); - }, Ut.version = "19.3.0", Ut; + }, qt.useTransition = function() { + return T.H.useTransition(); + }, qt.version = "19.3.0", qt; } - var q_; - function xE() { - return q_ || (q_ = 1, kS.exports = _U()), kS.exports; + var J_; + function IE() { + return J_ || (J_ = 1, WS.exports = kU()), WS.exports; } - var l = xE(); - const se = /* @__PURE__ */ mo(l), IU = /* @__PURE__ */ RU({ + var l = IE(); + const se = /* @__PURE__ */ mo(l), jU = /* @__PURE__ */ AU({ __proto__: null, default: se }, [l]); - var jS = { exports: {} }, Rd = {}, FS = { exports: {} }, BS = {}; - var W_; - function MU() { - return W_ || (W_ = 1, (function(e) { - function t(H, V) { - var ee = H.length; - H.push(V); - e: for (; 0 < ee; ) { - var X = ee - 1 >>> 1, K = H[X]; + var VS = { exports: {} }, Pd = {}, KS = { exports: {} }, GS = {}; + var eI; + function FU() { + return eI || (eI = 1, (function(e) { + function t(U, V) { + var Z = U.length; + U.push(V); + e: for (; 0 < Z; ) { + var G = Z - 1 >>> 1, K = U[G]; if (0 < a(K, V)) - H[X] = V, H[ee] = K, ee = X; + U[G] = V, U[Z] = K, Z = G; else break e; } } - function n(H) { - return H.length === 0 ? null : H[0]; - } - function r(H) { - if (H.length === 0) return null; - var V = H[0], ee = H.pop(); - if (ee !== V) { - H[0] = ee; - e: for (var X = 0, K = H.length, G = K >>> 1; X < G; ) { - var W = 2 * (X + 1) - 1, Q = H[W], k = W + 1, B = H[k]; - if (0 > a(Q, ee)) - k < K && 0 > a(B, Q) ? (H[X] = B, H[k] = ee, X = k) : (H[X] = Q, H[W] = ee, X = W); - else if (k < K && 0 > a(B, ee)) - H[X] = B, H[k] = ee, X = k; + function n(U) { + return U.length === 0 ? null : U[0]; + } + function r(U) { + if (U.length === 0) return null; + var V = U[0], Z = U.pop(); + if (Z !== V) { + U[0] = Z; + e: for (var G = 0, K = U.length, Y = K >>> 1; G < Y; ) { + var W = 2 * (G + 1) - 1, H = U[W], L = W + 1, j = U[L]; + if (0 > a(H, Z)) + L < K && 0 > a(j, H) ? (U[G] = j, U[L] = Z, G = L) : (U[G] = H, U[W] = Z, G = W); + else if (L < K && 0 > a(j, Z)) + U[G] = j, U[L] = Z, G = L; else break e; } } return V; } - function a(H, V) { - var ee = H.sortIndex - V.sortIndex; - return ee !== 0 ? ee : H.id - V.id; + function a(U, V) { + var Z = U.sortIndex - V.sortIndex; + return Z !== 0 ? Z : U.id - V.id; } if (e.unstable_now = void 0, typeof performance == "object" && typeof performance.now == "function") { var s = performance; @@ -504,66 +504,66 @@ var sbe = EU((Ci, $i) => { }; } var f = [], m = [], p = 1, g = null, v = 3, y = !1, b = !1, S = !1, C = !1, E = typeof setTimeout == "function" ? setTimeout : null, R = typeof clearTimeout == "function" ? clearTimeout : null, $ = typeof setImmediate < "u" ? setImmediate : null; - function M(H) { + function z(U) { for (var V = n(m); V !== null; ) { if (V.callback === null) r(m); - else if (V.startTime <= H) + else if (V.startTime <= U) r(m), V.sortIndex = V.expirationTime, t(f, V); else break; V = n(m); } } - function I(H) { - if (S = !1, M(H), !b) + function I(U) { + if (S = !1, z(U), !b) if (n(f) !== null) b = !0, D || (D = !0, O()); else { var V = n(m); - V !== null && U(I, V.startTime - H); + V !== null && q(I, V.startTime - U); } } - var D = !1, N = -1, P = 5, T = -1; + var D = !1, _ = -1, T = 5, N = -1; function A() { - return C ? !0 : !(e.unstable_now() - T < P); + return C ? !0 : !(e.unstable_now() - N < T); } - function z() { + function M() { if (C = !1, D) { - var H = e.unstable_now(); - T = H; + var U = e.unstable_now(); + N = U; var V = !0; try { e: { - b = !1, S && (S = !1, R(N), N = -1), y = !0; - var ee = v; + b = !1, S && (S = !1, R(_), _ = -1), y = !0; + var Z = v; try { t: { - for (M(H), g = n(f); g !== null && !(g.expirationTime > H && A()); ) { - var X = g.callback; - if (typeof X == "function") { + for (z(U), g = n(f); g !== null && !(g.expirationTime > U && A()); ) { + var G = g.callback; + if (typeof G == "function") { g.callback = null, v = g.priorityLevel; - var K = X( - g.expirationTime <= H + var K = G( + g.expirationTime <= U ); - if (H = e.unstable_now(), typeof K == "function") { - g.callback = K, M(H), V = !0; + if (U = e.unstable_now(), typeof K == "function") { + g.callback = K, z(U), V = !0; break t; } - g === n(f) && r(f), M(H); + g === n(f) && r(f), z(U); } else r(f); g = n(f); } if (g !== null) V = !0; else { - var G = n(m); - G !== null && U( + var Y = n(m); + Y !== null && q( I, - G.startTime - H + Y.startTime - U ), V = !1; } } break e; } finally { - g = null, v = ee, y = !1; + g = null, v = Z, y = !1; } V = void 0; } @@ -575,31 +575,31 @@ var sbe = EU((Ci, $i) => { var O; if (typeof $ == "function") O = function() { - $(z); + $(M); }; else if (typeof MessageChannel < "u") { - var L = new MessageChannel(), F = L.port2; - L.port1.onmessage = z, O = function() { + var k = new MessageChannel(), F = k.port2; + k.port1.onmessage = M, O = function() { F.postMessage(null); }; } else O = function() { - E(z, 0); + E(M, 0); }; - function U(H, V) { - N = E(function() { - H(e.unstable_now()); + function q(U, V) { + _ = E(function() { + U(e.unstable_now()); }, V); } - e.unstable_IdlePriority = 5, e.unstable_ImmediatePriority = 1, e.unstable_LowPriority = 4, e.unstable_NormalPriority = 3, e.unstable_Profiling = null, e.unstable_UserBlockingPriority = 2, e.unstable_cancelCallback = function(H) { - H.callback = null; - }, e.unstable_forceFrameRate = function(H) { - 0 > H || 125 < H ? console.error( + e.unstable_IdlePriority = 5, e.unstable_ImmediatePriority = 1, e.unstable_LowPriority = 4, e.unstable_NormalPriority = 3, e.unstable_Profiling = null, e.unstable_UserBlockingPriority = 2, e.unstable_cancelCallback = function(U) { + U.callback = null; + }, e.unstable_forceFrameRate = function(U) { + 0 > U || 125 < U ? console.error( "forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported" - ) : P = 0 < H ? Math.floor(1e3 / H) : 5; + ) : T = 0 < U ? Math.floor(1e3 / U) : 5; }, e.unstable_getCurrentPriorityLevel = function() { return v; - }, e.unstable_next = function(H) { + }, e.unstable_next = function(U) { switch (v) { case 1: case 2: @@ -609,17 +609,17 @@ var sbe = EU((Ci, $i) => { default: V = v; } - var ee = v; + var Z = v; v = V; try { - return H(); + return U(); } finally { - v = ee; + v = Z; } }, e.unstable_requestPaint = function() { C = !0; - }, e.unstable_runWithPriority = function(H, V) { - switch (H) { + }, e.unstable_runWithPriority = function(U, V) { + switch (U) { case 1: case 2: case 3: @@ -627,18 +627,18 @@ var sbe = EU((Ci, $i) => { case 5: break; default: - H = 3; + U = 3; } - var ee = v; - v = H; + var Z = v; + v = U; try { return V(); } finally { - v = ee; + v = Z; } - }, e.unstable_scheduleCallback = function(H, V, ee) { - var X = e.unstable_now(); - switch (typeof ee == "object" && ee !== null ? (ee = ee.delay, ee = typeof ee == "number" && 0 < ee ? X + ee : X) : ee = X, H) { + }, e.unstable_scheduleCallback = function(U, V, Z) { + var G = e.unstable_now(); + switch (typeof Z == "object" && Z !== null ? (Z = Z.delay, Z = typeof Z == "number" && 0 < Z ? G + Z : G) : Z = G, U) { case 1: var K = -1; break; @@ -654,38 +654,38 @@ var sbe = EU((Ci, $i) => { default: K = 5e3; } - return K = ee + K, H = { + return K = Z + K, U = { id: p++, callback: V, - priorityLevel: H, - startTime: ee, + priorityLevel: U, + startTime: Z, expirationTime: K, sortIndex: -1 - }, ee > X ? (H.sortIndex = ee, t(m, H), n(f) === null && H === n(m) && (S ? (R(N), N = -1) : S = !0, U(I, ee - X))) : (H.sortIndex = K, t(f, H), b || y || (b = !0, D || (D = !0, O()))), H; - }, e.unstable_shouldYield = A, e.unstable_wrapCallback = function(H) { + }, Z > G ? (U.sortIndex = Z, t(m, U), n(f) === null && U === n(m) && (S ? (R(_), _ = -1) : S = !0, q(I, Z - G))) : (U.sortIndex = K, t(f, U), b || y || (b = !0, D || (D = !0, O()))), U; + }, e.unstable_shouldYield = A, e.unstable_wrapCallback = function(U) { var V = v; return function() { - var ee = v; + var Z = v; v = V; try { - return H.apply(this, arguments); + return U.apply(this, arguments); } finally { - v = ee; + v = Z; } }; }; - })(BS)), BS; - } - var V_; - function zU() { - return V_ || (V_ = 1, FS.exports = MU()), FS.exports; - } - var HS = { exports: {} }, Wr = {}; - var K_; - function AU() { - if (K_) return Wr; - K_ = 1; - var e = xE(); + })(GS)), GS; + } + var tI; + function BU() { + return tI || (tI = 1, KS.exports = FU()), KS.exports; + } + var XS = { exports: {} }, Vr = {}; + var nI; + function HU() { + if (nI) return Vr; + nI = 1; + var e = IE(); function t(p) { var g = "https://react.dev/errors/" + p; if (1 < arguments.length) { @@ -730,25 +730,25 @@ var sbe = EU((Ci, $i) => { if (typeof g == "string") return g === "use-credentials" ? g : ""; } - return Wr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = r, Wr.browser = function(p) { + return Vr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = r, Vr.browser = function(p) { return { $$typeof: s, _reason: p }; - }, Wr.createPortal = function(p, g) { + }, Vr.createPortal = function(p, g) { var v = 2 < arguments.length && arguments[2] !== void 0 ? arguments[2] : null; if (!g || g.nodeType !== 1 && g.nodeType !== 9 && g.nodeType !== 11) throw Error(t(299)); return u(p, g, null, v); - }, Wr.flushSync = function(p) { + }, Vr.flushSync = function(p) { var g = f.T, v = r.p; try { if (f.T = null, r.p = 2, p) return p(); } finally { f.T = g, r.p = v, r.d.f(); } - }, Wr.preconnect = function(p, g) { + }, Vr.preconnect = function(p, g) { typeof p == "string" && (g ? (g = g.crossOrigin, g = typeof g == "string" ? g === "use-credentials" ? g : "" : void 0) : g = null, r.d.C(p, g)); - }, Wr.prefetchDNS = function(p) { + }, Vr.prefetchDNS = function(p) { typeof p == "string" && r.d.D(p); - }, Wr.preinit = function(p, g) { + }, Vr.preinit = function(p, g) { if (typeof p == "string" && g && typeof g.as == "string") { var v = g.as, y = m(v, g.crossOrigin), b = typeof g.integrity == "string" ? g.integrity : void 0, S = typeof g.fetchPriority == "string" ? g.fetchPriority : void 0; v === "style" ? r.d.S( @@ -766,7 +766,7 @@ var sbe = EU((Ci, $i) => { nonce: typeof g.nonce == "string" ? g.nonce : void 0 }); } - }, Wr.preinitModule = function(p, g) { + }, Vr.preinitModule = function(p, g) { if (typeof p == "string") if (typeof g == "object" && g !== null) { if (g.as == null || g.as === "script") { @@ -782,7 +782,7 @@ var sbe = EU((Ci, $i) => { }); } } else g == null && r.d.M(p); - }, Wr.preload = function(p, g) { + }, Vr.preload = function(p, g) { if (typeof p == "string" && typeof g == "object" && g !== null && typeof g.as == "string") { var v = g.as, y = m(v, g.crossOrigin); r.d.L(p, v, { @@ -797,7 +797,7 @@ var sbe = EU((Ci, $i) => { media: typeof g.media == "string" ? g.media : void 0 }); } - }, Wr.preloadModule = function(p, g) { + }, Vr.preloadModule = function(p, g) { if (typeof p == "string") if (g) { var v = m(g.as, g.crossOrigin); @@ -809,20 +809,20 @@ var sbe = EU((Ci, $i) => { fetchPriority: typeof g.fetchPriority == "string" ? g.fetchPriority : void 0 }); } else r.d.m(p); - }, Wr.requestFormReset = function(p) { + }, Vr.requestFormReset = function(p) { r.d.r(p); - }, Wr.unstable_batchedUpdates = function(p, g) { + }, Vr.unstable_batchedUpdates = function(p, g) { return p(g); - }, Wr.useFormState = function(p, g, v) { + }, Vr.useFormState = function(p, g, v) { return f.H.useFormState(p, g, v); - }, Wr.useFormStatus = function() { + }, Vr.useFormStatus = function() { return f.H.useHostTransitionStatus(); - }, Wr.version = "19.3.0", Wr; + }, Vr.version = "19.3.0", Vr; } - var G_; - function e2() { - if (G_) return HS.exports; - G_ = 1; + var rI; + function c2() { + if (rI) return XS.exports; + rI = 1; function e() { if (!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ > "u" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE != "function")) try { @@ -831,13 +831,13 @@ var sbe = EU((Ci, $i) => { console.error(t); } } - return e(), HS.exports = AU(), HS.exports; + return e(), XS.exports = HU(), XS.exports; } - var X_; - function DU() { - if (X_) return Rd; - X_ = 1; - var e = zU(), t = xE(), n = e2(); + var oI; + function UU() { + if (oI) return Pd; + oI = 1; + var e = BU(), t = IE(), n = c2(); function r(o) { var i = "https://react.dev/errors/" + o; if (1 < arguments.length) { @@ -901,30 +901,30 @@ var sbe = EU((Ci, $i) => { } if (d.return !== h.return) d = x, h = w; else { - for (var j = !1, ae = x.child; ae; ) { - if (ae === d) { - j = !0, d = x, h = w; + for (var B = !1, oe = x.child; oe; ) { + if (oe === d) { + B = !0, d = x, h = w; break; } - if (ae === h) { - j = !0, h = x, d = w; + if (oe === h) { + B = !0, h = x, d = w; break; } - ae = ae.sibling; + oe = oe.sibling; } - if (!j) { - for (ae = w.child; ae; ) { - if (ae === d) { - j = !0, d = w, h = x; + if (!B) { + for (oe = w.child; oe; ) { + if (oe === d) { + B = !0, d = w, h = x; break; } - if (ae === h) { - j = !0, h = w, d = x; + if (oe === h) { + B = !0, h = w, d = x; break; } - ae = ae.sibling; + oe = oe.sibling; } - if (!j) throw Error(r(189)); + if (!B) throw Error(r(189)); } } if (d.alternate !== h) throw Error(r(190)); @@ -1011,7 +1011,7 @@ var sbe = EU((Ci, $i) => { function $(o, i, d) { return o === d ? !0 : o === i ? (E = o, !0) : !1; } - function M(o, i, d) { + function z(o, i, d) { return o === d ? (R = o, !1) : o === i ? (R !== null && (E = o), !0) : !1; } function I(o) { @@ -1034,44 +1034,44 @@ var sbe = EU((Ci, $i) => { } return null; } - var N = Object.assign, P = /* @__PURE__ */ Symbol.for("react.element"), T = /* @__PURE__ */ Symbol.for("react.transitional.element"), A = /* @__PURE__ */ Symbol.for("react.portal"), z = /* @__PURE__ */ Symbol.for("react.fragment"), O = /* @__PURE__ */ Symbol.for("react.strict_mode"), L = /* @__PURE__ */ Symbol.for("react.profiler"), F = /* @__PURE__ */ Symbol.for("react.consumer"), U = /* @__PURE__ */ Symbol.for("react.context"), H = /* @__PURE__ */ Symbol.for("react.forward_ref"), V = /* @__PURE__ */ Symbol.for("react.suspense"), ee = /* @__PURE__ */ Symbol.for("react.suspense_list"), X = /* @__PURE__ */ Symbol.for("react.memo"), K = /* @__PURE__ */ Symbol.for("react.lazy"), G = /* @__PURE__ */ Symbol.for("react.activity"), W = /* @__PURE__ */ Symbol.for("react.legacy_hidden"), Q = /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel"), k = /* @__PURE__ */ Symbol.for("react.view_transition"), B = /* @__PURE__ */ Symbol.for("react.recoverable"), J = Symbol.iterator; - function re(o) { - return o === null || typeof o != "object" ? null : (o = J && o[J] || o["@@iterator"], typeof o == "function" ? o : null); + var _ = Object.assign, T = /* @__PURE__ */ Symbol.for("react.element"), N = /* @__PURE__ */ Symbol.for("react.transitional.element"), A = /* @__PURE__ */ Symbol.for("react.portal"), M = /* @__PURE__ */ Symbol.for("react.fragment"), O = /* @__PURE__ */ Symbol.for("react.strict_mode"), k = /* @__PURE__ */ Symbol.for("react.profiler"), F = /* @__PURE__ */ Symbol.for("react.consumer"), q = /* @__PURE__ */ Symbol.for("react.context"), U = /* @__PURE__ */ Symbol.for("react.forward_ref"), V = /* @__PURE__ */ Symbol.for("react.suspense"), Z = /* @__PURE__ */ Symbol.for("react.suspense_list"), G = /* @__PURE__ */ Symbol.for("react.memo"), K = /* @__PURE__ */ Symbol.for("react.lazy"), Y = /* @__PURE__ */ Symbol.for("react.activity"), W = /* @__PURE__ */ Symbol.for("react.legacy_hidden"), H = /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel"), L = /* @__PURE__ */ Symbol.for("react.view_transition"), j = /* @__PURE__ */ Symbol.for("react.recoverable"), Q = Symbol.iterator; + function te(o) { + return o === null || typeof o != "object" ? null : (o = Q && o[Q] || o["@@iterator"], typeof o == "function" ? o : null); } - var le = /* @__PURE__ */ Symbol.for("react.client.reference"); + var ce = /* @__PURE__ */ Symbol.for("react.client.reference"); function ie(o) { if (o == null) return null; if (typeof o == "function") - return o.$$typeof === le ? null : o.displayName || o.name || null; + return o.$$typeof === ce ? null : o.displayName || o.name || null; if (typeof o == "string") return o; switch (o) { - case z: + case M: return "Fragment"; - case L: + case k: return "Profiler"; case O: return "StrictMode"; case V: return "Suspense"; - case ee: + case Z: return "SuspenseList"; - case G: + case Y: return "Activity"; - case k: + case L: return "ViewTransition"; } if (typeof o == "object") switch (o.$$typeof) { case A: return "Portal"; - case U: + case q: return o.displayName || "Context"; case F: return (o._context.displayName || "Context") + ".Consumer"; - case H: + case U: var i = o.render; return o = o.displayName, o || (o = i.displayName || i.name || "", o = o !== "" ? "ForwardRef(" + o + ")" : "ForwardRef"), o; - case X: + case G: return i = o.displayName || null, i !== null ? i : ie(o.type) || "Memo"; case K: i = o._payload, o = o._init; @@ -1082,31 +1082,31 @@ var sbe = EU((Ci, $i) => { } return null; } - var Y = Array.isArray, q = t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, te = n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, de = { + var ae = Array.isArray, X = t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, J = n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, me = { pending: !1, data: null, method: null, action: null - }, fe = [], pe = -1; - function oe(o) { + }, re = [], fe = -1; + function ne(o) { return { current: o }; } - function ce(o) { - 0 > pe || (o.current = fe[pe], fe[pe] = null, pe--); + function ue(o) { + 0 > fe || (o.current = re[fe], re[fe] = null, fe--); } - function Z(o, i) { - pe++, fe[pe] = o.current, o.current = i; + function le(o, i) { + fe++, re[fe] = o.current, o.current = i; } - var me = oe(null), xe = oe(null), Me = oe(null), ve = oe(null); - function qe(o, i) { - switch (Z(Me, i), Z(xe, o), Z(me, null), i.nodeType) { + var ge = ne(null), pe = ne(null), $e = ne(null), be = ne(null); + function We(o, i) { + switch (le($e, i), le(pe, o), le(ge, null), i.nodeType) { case 9: case 11: - o = (o = i.documentElement) && (o = o.namespaceURI) ? XN(o) : 0; + o = (o = i.documentElement) && (o = o.namespaceURI) ? o_(o) : 0; break; default: if (o = i.tagName, i = i.namespaceURI) - i = XN(i), o = QN(i, o); + i = o_(i), o = a_(i, o); else switch (o) { case "svg": @@ -1119,35 +1119,35 @@ var sbe = EU((Ci, $i) => { o = 0; } } - ce(me), Z(me, o); + ue(ge), le(ge, o); } function ke() { - ce(me), ce(xe), ce(Me); + ue(ge), ue(pe), ue($e); } - function be(o) { + function ye(o) { var i = o.memoizedState; - i !== null && (Tc._currentValue = i.memoizedState, Z(ve, o)), i = me.current; - var d = QN(i, o.type); - i !== d && (Z(xe, o), Z(me, d)); + i !== null && (Nc._currentValue = i.memoizedState, le(be, o)), i = ge.current; + var d = a_(i, o.type); + i !== d && (le(pe, o), le(ge, d)); } - function Ee(o) { - xe.current === o && (ce(me), ce(xe)), ve.current === o && (ce(ve), Tc._currentValue = de); + function Re(o) { + pe.current === o && (ue(ge), ue(pe)), be.current === o && (ue(be), Nc._currentValue = me); } - var Se, et; - function We(o) { - if (Se === void 0) + var xe, et; + function Ve(o) { + if (xe === void 0) try { throw Error(); } catch (d) { var i = d.stack.trim().match(/\n( *(at )?)/); - Se = i && i[1] || "", et = -1 < d.stack.indexOf(` + xe = i && i[1] || "", et = -1 < d.stack.indexOf(` at`) ? " ()" : -1 < d.stack.indexOf("@") ? "@unknown:0:0" : ""; } return ` -` + Se + o + et; +` + xe + o + et; } var it = !1; - function ze(o, i) { + function Me(o, i) { if (!o || it) return ""; it = !0; var d = Error.prepareStackTrace; @@ -1167,15 +1167,15 @@ var sbe = EU((Ci, $i) => { }), typeof Reflect == "object" && Reflect.construct) { try { Reflect.construct(Ye, []); - } catch (ut) { - var Pe = ut; + } catch (dt) { + var Te = dt; } Reflect.construct(o, [], Ye); } else { try { Ye.call(); - } catch (ut) { - Pe = ut; + } catch (dt) { + Te = dt; } Ye = !1; try { @@ -1196,15 +1196,15 @@ var sbe = EU((Ci, $i) => { } else { try { throw Error(); - } catch (ut) { - Pe = ut; + } catch (dt) { + Te = dt; } (Ye = o()) && typeof Ye.catch == "function" && Ye.catch(function() { }); } - } catch (ut) { - if (ut && Pe && typeof ut.stack == "string") - return [ut.stack, Pe.stack]; + } catch (dt) { + if (dt && Te && typeof dt.stack == "string") + return [dt.stack, Te.stack]; } return [null, null]; } @@ -1219,27 +1219,27 @@ var sbe = EU((Ci, $i) => { "name", { value: "DetermineComponentFrameRoot" } ); - var w = h.DetermineComponentFrameRoot(), j = w[0], ae = w[1]; - if (j && ae) { - var ge = j.split(` -`), Ie = ae.split(` + var w = h.DetermineComponentFrameRoot(), B = w[0], oe = w[1]; + if (B && oe) { + var ve = B.split(` +`), ze = oe.split(` `); - for (x = h = 0; h < ge.length && !ge[h].includes("DetermineComponentFrameRoot"); ) + for (x = h = 0; h < ve.length && !ve[h].includes("DetermineComponentFrameRoot"); ) h++; - for (; x < Ie.length && !Ie[x].includes( + for (; x < ze.length && !ze[x].includes( "DetermineComponentFrameRoot" ); ) x++; - if (h === ge.length || x === Ie.length) - for (h = ge.length - 1, x = Ie.length - 1; 1 <= h && 0 <= x && ge[h] !== Ie[x]; ) + if (h === ve.length || x === ze.length) + for (h = ve.length - 1, x = ze.length - 1; 1 <= h && 0 <= x && ve[h] !== ze[x]; ) x--; for (; 1 <= h && 0 <= x; h--, x--) - if (ge[h] !== Ie[x]) { + if (ve[h] !== ze[x]) { if (h !== 1 || x !== 1) do - if (h--, x--, 0 > x || ge[h] !== Ie[x]) { + if (h--, x--, 0 > x || ve[h] !== ze[x]) { var je = ` -` + ge[h].replace(" at new ", " at "); +` + ve[h].replace(" at new ", " at "); return o.displayName && je.includes("") && (je = je.replace("", o.displayName)), je; } while (1 <= h && 0 <= x); @@ -1249,31 +1249,31 @@ var sbe = EU((Ci, $i) => { } finally { it = !1, Error.prepareStackTrace = d; } - return (d = o ? o.displayName || o.name : "") ? We(d) : ""; + return (d = o ? o.displayName || o.name : "") ? Ve(d) : ""; } function Oe(o, i) { switch (o.tag) { case 26: case 27: case 5: - return We(o.type); + return Ve(o.type); case 16: - return We("Lazy"); + return Ve("Lazy"); case 13: - return o.child !== i && i !== null ? We("Suspense Fallback") : We("Suspense"); + return o.child !== i && i !== null ? Ve("Suspense Fallback") : Ve("Suspense"); case 19: - return We("SuspenseList"); + return Ve("SuspenseList"); case 0: case 15: - return ze(o.type, !1); + return Me(o.type, !1); case 11: - return ze(o.type.render, !1); + return Me(o.type.render, !1); case 1: - return ze(o.type, !0); + return Me(o.type, !0); case 31: - return We("Activity"); + return Ve("Activity"); case 30: - return We("ViewTransition"); + return Ve("ViewTransition"); default: return ""; } @@ -1291,19 +1291,19 @@ Error generating stack: ` + h.message + ` ` + h.stack; } } - var Ue = Object.prototype.hasOwnProperty, Ze = e.unstable_scheduleCallback, he = e.unstable_cancelCallback, ye = e.unstable_shouldYield, Qe = e.unstable_requestPaint, Je = e.unstable_now, ot = e.unstable_getCurrentPriorityLevel, nt = e.unstable_ImmediatePriority, St = e.unstable_UserBlockingPriority, ft = e.unstable_NormalPriority, mt = e.unstable_LowPriority, Be = e.unstable_IdlePriority, at = e.log, Te = e.unstable_setDisableYieldValue, He = null, $e = null; - function Re(o) { - if (typeof at == "function" && Te(o), $e && typeof $e.setStrictMode == "function") + var qe = Object.prototype.hasOwnProperty, Ze = e.unstable_scheduleCallback, he = e.unstable_cancelCallback, Se = e.unstable_shouldYield, Qe = e.unstable_requestPaint, Je = e.unstable_now, ot = e.unstable_getCurrentPriorityLevel, nt = e.unstable_ImmediatePriority, Ct = e.unstable_UserBlockingPriority, ft = e.unstable_NormalPriority, mt = e.unstable_LowPriority, Be = e.unstable_IdlePriority, at = e.log, Ne = e.unstable_setDisableYieldValue, Ue = null, Ee = null; + function Pe(o) { + if (typeof at == "function" && Ne(o), Ee && typeof Ee.setStrictMode == "function") try { - $e.setStrictMode(He, o); + Ee.setStrictMode(Ue, o); } catch { } } - var Fe = Math.clz32 ? Math.clz32 : tt, Ne = Math.log, Ke = Math.LN2; + var Fe = Math.clz32 ? Math.clz32 : tt, _e = Math.log, Ke = Math.LN2; function tt(o) { - return o >>>= 0, o === 0 ? 32 : 31 - (Ne(o) / Ke | 0) | 0; + return o >>>= 0, o === 0 ? 32 : 31 - (_e(o) / Ke | 0) | 0; } - var st = 256, xt = 262144, zt = 4194304; + var st = 256, $t = 262144, Dt = 4194304; function Gt(o) { var i = o & 42; if (i !== 0) return i; @@ -1359,15 +1359,15 @@ Error generating stack: ` + h.message + ` return o; } } - function Bt(o, i, d) { + function Ht(o, i, d) { var h = o.pendingLanes; if (h === 0) return 0; - var x = 0, w = o.suspendedLanes, j = o.pingedLanes; + var x = 0, w = o.suspendedLanes, B = o.pingedLanes; o = o.warmLanes; - var ae = h & 134217727; - return ae !== 0 ? (h = ae & ~w, h !== 0 ? x = Gt(h) : (j &= ae, j !== 0 ? x = Gt(j) : d || (d = ae & ~o, d !== 0 && (x = Gt(d))))) : (ae = h & ~w, ae !== 0 ? x = Gt(ae) : j !== 0 ? x = Gt(j) : d || (d = h & ~o, d !== 0 && (x = Gt(d)))), x === 0 ? 0 : i !== 0 && i !== x && (i & w) === 0 && (w = x & -x, d = i & -i, w >= d || w === 32 && (d & 4194048) !== 0) ? i : x; + var oe = h & 134217727; + return oe !== 0 ? (h = oe & ~w, h !== 0 ? x = Gt(h) : (B &= oe, B !== 0 ? x = Gt(B) : d || (d = oe & ~o, d !== 0 && (x = Gt(d))))) : (oe = h & ~w, oe !== 0 ? x = Gt(oe) : B !== 0 ? x = Gt(B) : d || (d = h & ~o, d !== 0 && (x = Gt(d)))), x === 0 ? 0 : i !== 0 && i !== x && (i & w) === 0 && (w = x & -x, d = i & -i, w >= d || w === 32 && (d & 4194048) !== 0) ? i : x; } - function Sn(o, i) { + function Cn(o, i) { return (o.pendingLanes & ~(o.suspendedLanes & ~o.pingedLanes) & i) === 0; } function un(o, i) { @@ -1380,7 +1380,7 @@ Error generating stack: ` + h.message + ` } return i; } - function Nn(o, i) { + function _n(o, i) { switch (o) { case 1: case 2: @@ -1422,34 +1422,34 @@ Error generating stack: ` + h.message + ` } } function ht() { - var o = zt; - return zt <<= 1, (zt & 62914560) === 0 && (zt = 4194304), o; + var o = Dt; + return Dt <<= 1, (Dt & 62914560) === 0 && (Dt = 4194304), o; } - function Dt(o) { + function kt(o) { for (var i = [], d = 0; 31 > d; d++) i.push(o); return i; } - function At(o, i) { + function Ot(o, i) { o.pendingLanes |= i, i !== 268435456 && (o.suspendedLanes = 0, o.pingedLanes = 0, o.warmLanes = 0); } function pt(o, i, d, h, x, w) { - var j = o.pendingLanes; + var B = o.pendingLanes; o.pendingLanes = d, o.suspendedLanes = 0, o.pingedLanes = 0, o.warmLanes = 0, o.expiredLanes &= d, o.entangledLanes &= d, o.errorRecoveryDisabledLanes &= d, o.shellSuspendCounter = 0; - var ae = o.entanglements, ge = o.expirationTimes, Ie = o.hiddenUpdates; - for (d = j & ~d; 0 < d; ) { + var oe = o.entanglements, ve = o.expirationTimes, ze = o.hiddenUpdates; + for (d = B & ~d; 0 < d; ) { var je = 31 - Fe(d), Ye = 1 << je; - ae[je] = 0, ge[je] = -1; - var Pe = Ie[je]; - if (Pe !== null) - for (Ie[je] = null, je = 0; je < Pe.length; je++) { - var Le = Pe[je]; + oe[je] = 0, ve[je] = -1; + var Te = ze[je]; + if (Te !== null) + for (ze[je] = null, je = 0; je < Te.length; je++) { + var Le = Te[je]; Le !== null && (Le.lane &= -536870913); } d &= ~Ye; } - h !== 0 && Et(o, h, 0), w !== 0 && x === 0 && o.tag !== 0 && (o.suspendedLanes |= w & ~(j & ~i)); + h !== 0 && Pt(o, h, 0), w !== 0 && x === 0 && o.tag !== 0 && (o.suspendedLanes |= w & ~(B & ~i)); } - function Et(o, i, d) { + function Pt(o, i, d) { o.pendingLanes |= i, o.suspendedLanes &= ~i; var h = 31 - Fe(i); o.entangledLanes |= i, o.entanglements[h] = o.entanglements[h] | 1073741824 | d & 261930; @@ -1504,34 +1504,34 @@ Error generating stack: ` + h.message + ` } return o; } - function pn(o) { + function hn(o) { return o &= -o, 2 < o ? 8 < o ? (o & 134217727) !== 0 ? 32 : 268435456 : 8 : 2; } - function zn() { - var o = te.p; - return o !== 0 ? o : (o = window.event, o === void 0 ? 32 : z_(o.type)); + function Mn() { + var o = J.p; + return o !== 0 ? o : (o = window.event, o === void 0 ? 32 : H_(o.type)); } - function Qn(o, i) { - var d = te.p; + function Yn(o, i) { + var d = J.p; try { - return te.p = o, i(); + return J.p = o, i(); } finally { - te.p = d; + J.p = d; } } - var Un = Math.random().toString(36).slice(2), bn = "__reactFiber$" + Un, kn = "__reactProps$" + Un, fr = "__reactContainer$" + Un, Yr = "__reactEvents$" + Un, Eo = "__reactListeners$" + Un, rt = "__reactHandles$" + Un, wt = "__reactResources$" + Un, ct = "__reactMarker$" + Un, Ht = "__reactLoad$" + Un; + var Un = Math.random().toString(36).slice(2), yn = "__reactFiber$" + Un, kn = "__reactProps$" + Un, mr = "__reactContainer$" + Un, Zr = "__reactEvents$" + Un, Eo = "__reactListeners$" + Un, rt = "__reactHandles$" + Un, Rt = "__reactResources$" + Un, ct = "__reactMarker$" + Un, Ut = "__reactLoad$" + Un; function nn(o) { - delete o[bn], delete o[kn], delete o[Eo], delete o[rt]; + delete o[yn], delete o[kn], delete o[Eo], delete o[rt]; } function qn(o) { var i; - if (i = o[bn]) return i; + if (i = o[yn]) return i; for (var d = o.parentNode; d; ) { - if (i = d[fr] || d[bn]) { + if (i = d[mr] || d[yn]) { if (d = i.alternate, i.child !== null || d !== null && d.child !== null) - for (o = m_(o); o !== null; ) { - if (d = o[bn]) return d; - o = m_(o); + for (o = C_(o); o !== null; ) { + if (d = o[yn]) return d; + o = C_(o); } return i; } @@ -1540,49 +1540,49 @@ Error generating stack: ` + h.message + ` return null; } function Kn(o) { - if (o = o[bn] || o[fr]) { + if (o = o[yn] || o[mr]) { var i = o.tag; if (i === 5 || i === 6 || i === 13 || i === 31 || i === 26 || i === 27 || i === 3) return o; } return null; } - function wr(o) { + function Er(o) { var i = o.tag; if (i === 5 || i === 26 || i === 27 || i === 6) return o.stateNode; throw Error(r(33)); } - function Er(o) { - var i = o[wt]; - return i || (i = o[wt] = { hoistableStyles: /* @__PURE__ */ new Map(), hoistableScripts: /* @__PURE__ */ new Map() }), i; + function Rr(o) { + var i = o[Rt]; + return i || (i = o[Rt] = { hoistableStyles: /* @__PURE__ */ new Map(), hoistableScripts: /* @__PURE__ */ new Map() }), i; } function Wn(o) { o[ct] = !0; } - function ql(o) { - o[Ht] = void 0; + function Wl(o) { + o[Ut] = void 0; } - var Wl = /* @__PURE__ */ new Set(), gt = {}; + var Vl = /* @__PURE__ */ new Set(), gt = {}; function rn(o, i) { - aa(o, i), aa(o + "Capture", i); + ia(o, i), ia(o + "Capture", i); } - function aa(o, i) { + function ia(o, i) { for (gt[o] = i, o = 0; o < i.length; o++) - Wl.add(i[o]); + Vl.add(i[o]); } - var db = RegExp( + var bb = RegExp( "^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$" - ), Du = {}, Ou = {}; - function fb(o) { - return Ue.call(Ou, o) ? !0 : Ue.call(Du, o) ? !1 : db.test(o) ? Ou[o] = !0 : (Du[o] = !0, !1); + ), Ou = {}, Lu = {}; + function yb(o) { + return qe.call(Lu, o) ? !0 : qe.call(Ou, o) ? !1 : bb.test(o) ? Lu[o] = !0 : (Ou[o] = !0, !1); } var wn = !1; - function D1() { + function q1() { var o = wn; return wn = !1, o; } - function dp(o, i, d) { - if (fb(i)) + function hp(o, i, d) { + if (yb(i)) if (d === null) o.removeAttribute(i); else { switch (typeof d) { @@ -1601,7 +1601,7 @@ Error generating stack: ` + h.message + ` o.setAttribute(i, d); } } - function fp(o, i, d) { + function gp(o, i, d) { if (d === null) o.removeAttribute(i); else { switch (typeof d) { @@ -1615,7 +1615,7 @@ Error generating stack: ` + h.message + ` o.setAttribute(i, d); } } - function ni(o, i, d, h) { + function ri(o, i, d, h) { if (h === null) o.removeAttribute(d); else { switch (typeof h) { @@ -1643,11 +1643,11 @@ Error generating stack: ` + h.message + ` return ""; } } - function O1(o) { + function W1(o) { var i = o.type; return (o = o.nodeName) && o.toLowerCase() === "input" && (i === "checkbox" || i === "radio"); } - function W4(o, i, d) { + function J4(o, i, d) { var h = Object.getOwnPropertyDescriptor( o.constructor.prototype, i @@ -1659,8 +1659,8 @@ Error generating stack: ` + h.message + ` get: function() { return x.call(this); }, - set: function(j) { - d = "" + j, w.call(this, j); + set: function(B) { + d = "" + B, w.call(this, B); } }), Object.defineProperty(o, i, { enumerable: h.enumerable @@ -1668,8 +1668,8 @@ Error generating stack: ` + h.message + ` getValue: function() { return d; }, - setValue: function(j) { - d = "" + j; + setValue: function(B) { + d = "" + B; }, stopTracking: function() { o._valueTracker = null, delete o[i]; @@ -1677,49 +1677,49 @@ Error generating stack: ` + h.message + ` }; } } - function mb(o) { + function Sb(o) { if (!o._valueTracker) { - var i = O1(o) ? "checked" : "value"; - o._valueTracker = W4( + var i = W1(o) ? "checked" : "value"; + o._valueTracker = J4( o, i, "" + o[i] ); } } - function L1(o) { + function V1(o) { if (!o) return !1; var i = o._valueTracker; if (!i) return !0; var d = i.getValue(), h = ""; - return o && (h = O1(o) ? o.checked ? "true" : "false" : o.value), o = h, o !== d ? (i.setValue(o), !0) : !1; + return o && (h = W1(o) ? o.checked ? "true" : "false" : o.value), o = h, o !== d ? (i.setValue(o), !0) : !1; } - var V4 = /[\n"\\]/g; - function Ho(o) { + var e6 = /[\n"\\]/g; + function Uo(o) { return o.replace( - V4, + e6, function(i) { return "\\" + i.charCodeAt(0).toString(16) + " "; } ); } - function pb(o, i, d, h, x, w, j, ae) { - o.name = "", j != null && typeof j != "function" && typeof j != "symbol" && typeof j != "boolean" ? o.type = j : o.removeAttribute("type"), i != null ? j === "number" ? (i === 0 && o.value === "" || o.value != i) && (o.value = "" + Ro(i)) : o.value !== "" + Ro(i) && (o.value = "" + Ro(i)) : j !== "submit" && j !== "reset" || o.removeAttribute("value"), i != null ? j === "number" && o.value == i ? hb(o, Ro(o.value)) : hb(o, Ro(i)) : d != null ? hb(o, Ro(d)) : h != null && o.removeAttribute("value"), x == null && w != null && (o.defaultChecked = !!w), x != null && (o.checked = x && typeof x != "function" && typeof x != "symbol"), ae != null && typeof ae != "function" && typeof ae != "symbol" && typeof ae != "boolean" ? o.name = "" + Ro(ae) : o.removeAttribute("name"); + function xb(o, i, d, h, x, w, B, oe) { + o.name = "", B != null && typeof B != "function" && typeof B != "symbol" && typeof B != "boolean" ? o.type = B : o.removeAttribute("type"), i != null ? B === "number" ? (i === 0 && o.value === "" || o.value != i) && (o.value = "" + Ro(i)) : o.value !== "" + Ro(i) && (o.value = "" + Ro(i)) : B !== "submit" && B !== "reset" || o.removeAttribute("value"), i != null ? B === "number" && o.value == i ? Cb(o, Ro(o.value)) : Cb(o, Ro(i)) : d != null ? Cb(o, Ro(d)) : h != null && o.removeAttribute("value"), x == null && w != null && (o.defaultChecked = !!w), x != null && (o.checked = x && typeof x != "function" && typeof x != "symbol"), oe != null && typeof oe != "function" && typeof oe != "symbol" && typeof oe != "boolean" ? o.name = "" + Ro(oe) : o.removeAttribute("name"); } - function k1(o, i, d, h, x, w, j, ae) { + function K1(o, i, d, h, x, w, B, oe) { if (w != null && typeof w != "function" && typeof w != "symbol" && typeof w != "boolean" && (o.type = w), i != null || d != null) { if (!(w !== "submit" && w !== "reset" || i != null)) { - mb(o); + Sb(o); return; } - d = d != null ? "" + Ro(d) : "", i = i != null ? "" + Ro(i) : d, ae || i === o.value || (o.value = i), o.defaultValue = i; + d = d != null ? "" + Ro(d) : "", i = i != null ? "" + Ro(i) : d, oe || i === o.value || (o.value = i), o.defaultValue = i; } - h = h ?? x, h = typeof h != "function" && typeof h != "symbol" && !!h, o.checked = ae ? o.checked : !!h, o.defaultChecked = !!h, j != null && typeof j != "function" && typeof j != "symbol" && typeof j != "boolean" && (o.name = j), mb(o); + h = h ?? x, h = typeof h != "function" && typeof h != "symbol" && !!h, o.checked = oe ? o.checked : !!h, o.defaultChecked = !!h, B != null && typeof B != "function" && typeof B != "symbol" && typeof B != "boolean" && (o.name = B), Sb(o); } - function hb(o, i) { + function Cb(o, i) { o.defaultValue !== "" + i && (o.defaultValue = "" + i); } - function Vl(o, i, d, h) { + function Kl(o, i, d, h) { if (o = o.options, i) { i = {}; for (var x = 0; x < d.length; x++) @@ -1737,18 +1737,18 @@ Error generating stack: ` + h.message + ` i !== null && (i.selected = !0); } } - function j1(o, i, d) { + function G1(o, i, d) { if (i != null && (i = "" + Ro(i), i !== o.value && (o.value = i), d == null)) { o.defaultValue !== i && (o.defaultValue = i); return; } o.defaultValue = d != null ? "" + Ro(d) : ""; } - function F1(o, i, d, h) { + function X1(o, i, d, h) { if (i == null) { if (h != null) { if (d != null) throw Error(r(92)); - if (Y(h)) { + if (ae(h)) { if (1 < h.length) throw Error(r(93)); h = h[0]; } @@ -1756,9 +1756,9 @@ Error generating stack: ` + h.message + ` } d == null && (d = ""), i = d; } - d = Ro(i), o.defaultValue = d, h = o.textContent, h === d && h !== "" && h !== null && (o.value = h), mb(o); + d = Ro(i), o.defaultValue = d, h = o.textContent, h === d && h !== "" && h !== null && (o.value = h), Sb(o); } - function Kl(o, i) { + function Gl(o, i) { if (i) { var d = o.firstChild; if (d && d === o.lastChild && d.nodeType === 3) { @@ -1768,28 +1768,28 @@ Error generating stack: ` + h.message + ` } o.textContent = i; } - var K4 = new Set( + var t6 = new Set( "animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split( " " ) ); - function B1(o, i, d) { + function Q1(o, i, d) { var h = i.indexOf("--") === 0; - d == null || typeof d == "boolean" || d === "" ? h ? o.setProperty(i, "") : i === "float" ? o.cssFloat = "" : o[i] = "" : h ? o.setProperty(i, d) : typeof d != "number" || d === 0 || K4.has(i) ? i === "float" ? o.cssFloat = d : o[i] = ("" + d).trim() : o[i] = d + "px"; + d == null || typeof d == "boolean" || d === "" ? h ? o.setProperty(i, "") : i === "float" ? o.cssFloat = "" : o[i] = "" : h ? o.setProperty(i, d) : typeof d != "number" || d === 0 || t6.has(i) ? i === "float" ? o.cssFloat = d : o[i] = ("" + d).trim() : o[i] = d + "px"; } - function H1(o, i, d) { + function Y1(o, i, d) { if (i != null && typeof i != "object") throw Error(r(62)); if (o = o.style, d != null) { for (var h in d) !d.hasOwnProperty(h) || i != null && i.hasOwnProperty(h) || (h.indexOf("--") === 0 ? o.setProperty(h, "") : h === "float" ? o.cssFloat = "" : o[h] = "", wn = !0); for (var x in i) - h = i[x], i.hasOwnProperty(x) && d[x] !== h && (B1(o, x, h), wn = !0); + h = i[x], i.hasOwnProperty(x) && d[x] !== h && (Q1(o, x, h), wn = !0); } else for (var w in i) - i.hasOwnProperty(w) && B1(o, w, i[w]); + i.hasOwnProperty(w) && Q1(o, w, i[w]); } - function gb(o) { + function $b(o) { if (o.indexOf("-") === -1) return !1; switch (o) { case "annotation-xml": @@ -1805,7 +1805,7 @@ Error generating stack: ` + h.message + ` return !0; } } - var G4 = /* @__PURE__ */ new Map([ + var n6 = /* @__PURE__ */ new Map([ ["acceptCharset", "accept-charset"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"], @@ -1885,24 +1885,24 @@ Error generating stack: ` + h.message + ` ["writingMode", "writing-mode"], ["xmlnsXlink", "xmlns:xlink"], ["xHeight", "x-height"] - ]), X4 = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i; - function mp(o) { - return X4.test("" + o) ? "javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')" : o; + ]), r6 = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i; + function vp(o) { + return r6.test("" + o) ? "javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')" : o; } - function Pa() { + function Ta() { } - var vb = null; - function bb(o) { + var wb = null; + function Eb(o) { return o = o.target || o.srcElement || window, o.correspondingUseElement && (o = o.correspondingUseElement), o.nodeType === 3 ? o.parentNode : o; } - var Gl = null, Xl = null; - function U1(o) { + var Xl = null, Ql = null; + function Z1(o) { var i = Kn(o); if (i && (o = i.stateNode)) { var d = o[kn] || null; e: switch (o = i.stateNode, i.type) { case "input": - if (pb( + if (xb( o, d.value, d.defaultValue, @@ -1914,7 +1914,7 @@ Error generating stack: ` + h.message + ` ), i = d.name, d.type === "radio" && i != null) { for (d = o; d.parentNode; ) d = d.parentNode; for (d = d.querySelectorAll( - 'input[name="' + Ho( + 'input[name="' + Uo( "" + i ) + '"][type="radio"]' ), i = 0; i < d.length; i++) { @@ -1922,7 +1922,7 @@ Error generating stack: ` + h.message + ` if (h !== o && h.form === o.form) { var x = h[kn] || null; if (!x) throw Error(r(90)); - pb( + xb( h, x.value, x.defaultValue, @@ -1935,30 +1935,30 @@ Error generating stack: ` + h.message + ` } } for (i = 0; i < d.length; i++) - h = d[i], h.form === o.form && L1(h); + h = d[i], h.form === o.form && V1(h); } break e; case "textarea": - j1(o, d.value, d.defaultValue); + G1(o, d.value, d.defaultValue); break e; case "select": - i = d.value, i != null && Vl(o, !!d.multiple, i, !1); + i = d.value, i != null && Kl(o, !!d.multiple, i, !1); } } } - var yb = !1; - function q1(o, i, d) { - if (yb) return o(i, d); - yb = !0; + var Rb = !1; + function J1(o, i, d) { + if (Rb) return o(i, d); + Rb = !0; try { var h = o(i); return h; } finally { - if (yb = !1, (Gl !== null || Xl !== null) && (mh(), Gl && (i = Gl, o = Xl, Xl = Gl = null, U1(i), o))) - for (i = 0; i < o.length; i++) U1(o[i]); + if (Rb = !1, (Xl !== null || Ql !== null) && (vh(), Xl && (i = Xl, o = Ql, Ql = Xl = null, Z1(i), o))) + for (i = 0; i < o.length; i++) Z1(o[i]); } } - function Lu(o, i) { + function ku(o, i) { var d = o.stateNode; if (d === null) return null; var h = d[kn] || null; @@ -1988,60 +1988,60 @@ Error generating stack: ` + h.message + ` ); return d; } - var ri = !(typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u"), Sb = !1; - if (ri) + var oi = !(typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u"), Pb = !1; + if (oi) try { - var ku = {}; - Object.defineProperty(ku, "passive", { + var ju = {}; + Object.defineProperty(ju, "passive", { get: function() { - Sb = !0; + Pb = !0; } - }), window.addEventListener("test", ku, ku), window.removeEventListener("test", ku, ku); + }), window.addEventListener("test", ju, ju), window.removeEventListener("test", ju, ju); } catch { - Sb = !1; + Pb = !1; } - var Ai = null, xb = null, pp = null; - function W1() { - if (pp) return pp; - var o, i = xb, d = i.length, h, x = "value" in Ai ? Ai.value : Ai.textContent, w = x.length; + var Di = null, Tb = null, bp = null; + function eP() { + if (bp) return bp; + var o, i = Tb, d = i.length, h, x = "value" in Di ? Di.value : Di.textContent, w = x.length; for (o = 0; o < d && i[o] === x[o]; o++) ; - var j = d - o; - for (h = 1; h <= j && i[d - h] === x[w - h]; h++) ; - return pp = x.slice(o, 1 < h ? 1 - h : void 0); + var B = d - o; + for (h = 1; h <= B && i[d - h] === x[w - h]; h++) ; + return bp = x.slice(o, 1 < h ? 1 - h : void 0); } - function hp(o) { + function yp(o) { var i = o.keyCode; return "charCode" in o ? (o = o.charCode, o === 0 && i === 13 && (o = 13)) : o = i, o === 10 && (o = 13), 32 <= o || o === 13 ? o : 0; } - function gp() { + function Sp() { return !0; } - function V1() { + function tP() { return !1; } function io(o) { - function i(d, h, x, w, j) { - this._reactName = d, this._targetInst = x, this.type = h, this.nativeEvent = w, this.target = j, this.currentTarget = null; - for (var ae in o) - o.hasOwnProperty(ae) && (d = o[ae], this[ae] = d ? d(w) : w[ae]); - return this.isDefaultPrevented = (w.defaultPrevented != null ? w.defaultPrevented : w.returnValue === !1) ? gp : V1, this.isPropagationStopped = V1, this; + function i(d, h, x, w, B) { + this._reactName = d, this._targetInst = x, this.type = h, this.nativeEvent = w, this.target = B, this.currentTarget = null; + for (var oe in o) + o.hasOwnProperty(oe) && (d = o[oe], this[oe] = d ? d(w) : w[oe]); + return this.isDefaultPrevented = (w.defaultPrevented != null ? w.defaultPrevented : w.returnValue === !1) ? Sp : tP, this.isPropagationStopped = tP, this; } - return N(i.prototype, { + return _(i.prototype, { preventDefault: function() { this.defaultPrevented = !0; var d = this.nativeEvent; - d && (d.preventDefault ? d.preventDefault() : typeof d.returnValue != "unknown" && (d.returnValue = !1), this.isDefaultPrevented = gp); + d && (d.preventDefault ? d.preventDefault() : typeof d.returnValue != "unknown" && (d.returnValue = !1), this.isDefaultPrevented = Sp); }, stopPropagation: function() { var d = this.nativeEvent; - d && (d.stopPropagation ? d.stopPropagation() : typeof d.cancelBubble != "unknown" && (d.cancelBubble = !0), this.isPropagationStopped = gp); + d && (d.stopPropagation ? d.stopPropagation() : typeof d.cancelBubble != "unknown" && (d.cancelBubble = !0), this.isPropagationStopped = Sp); }, persist: function() { }, - isPersistent: gp + isPersistent: Sp }), i; } - var Di = { + var Oi = { eventPhase: 0, bubbles: 0, cancelable: 0, @@ -2050,7 +2050,7 @@ Error generating stack: ` + h.message + ` }, defaultPrevented: 0, isTrusted: 0 - }, vp = io(Di), ju = N({}, Di, { view: 0, detail: 0 }), Q4 = io(ju), Cb, $b, Fu, bp = N({}, ju, { + }, xp = io(Oi), Fu = _({}, Oi, { view: 0, detail: 0 }), o6 = io(Fu), Nb, _b, Bu, Cp = _({}, Fu, { screenX: 0, screenY: 0, clientX: 0, @@ -2061,27 +2061,27 @@ Error generating stack: ` + h.message + ` shiftKey: 0, altKey: 0, metaKey: 0, - getModifierState: Eb, + getModifierState: zb, button: 0, buttons: 0, relatedTarget: function(o) { return o.relatedTarget === void 0 ? o.fromElement === o.srcElement ? o.toElement : o.fromElement : o.relatedTarget; }, movementX: function(o) { - return "movementX" in o ? o.movementX : (o !== Fu && (Fu && o.type === "mousemove" ? (Cb = o.screenX - Fu.screenX, $b = o.screenY - Fu.screenY) : $b = Cb = 0, Fu = o), Cb); + return "movementX" in o ? o.movementX : (o !== Bu && (Bu && o.type === "mousemove" ? (Nb = o.screenX - Bu.screenX, _b = o.screenY - Bu.screenY) : _b = Nb = 0, Bu = o), Nb); }, movementY: function(o) { - return "movementY" in o ? o.movementY : $b; + return "movementY" in o ? o.movementY : _b; } - }), K1 = io(bp), Y4 = N({}, bp, { dataTransfer: 0 }), Z4 = io(Y4), J4 = N({}, ju, { relatedTarget: 0 }), wb = io(J4), e6 = N({}, Di, { + }), nP = io(Cp), a6 = _({}, Cp, { dataTransfer: 0 }), i6 = io(a6), s6 = _({}, Fu, { relatedTarget: 0 }), Ib = io(s6), l6 = _({}, Oi, { animationName: 0, elapsedTime: 0, pseudoElement: 0 - }), t6 = io(e6), n6 = N({}, Di, { + }), c6 = io(l6), u6 = _({}, Oi, { clipboardData: function(o) { return "clipboardData" in o ? o.clipboardData : window.clipboardData; } - }), r6 = io(n6), o6 = N({}, Di, { data: 0 }), G1 = io(o6), a6 = { + }), d6 = io(u6), f6 = _({}, Oi, { data: 0 }), rP = io(f6), m6 = { Esc: "Escape", Spacebar: " ", Left: "ArrowLeft", @@ -2094,7 +2094,7 @@ Error generating stack: ` + h.message + ` Apps: "ContextMenu", Scroll: "ScrollLock", MozPrintableKey: "Unidentified" - }, i6 = { + }, p6 = { 8: "Backspace", 9: "Tab", 12: "Clear", @@ -2131,26 +2131,26 @@ Error generating stack: ` + h.message + ` 144: "NumLock", 145: "ScrollLock", 224: "Meta" - }, s6 = { + }, h6 = { Alt: "altKey", Control: "ctrlKey", Meta: "metaKey", Shift: "shiftKey" }; - function l6(o) { + function g6(o) { var i = this.nativeEvent; - return i.getModifierState ? i.getModifierState(o) : (o = s6[o]) ? !!i[o] : !1; + return i.getModifierState ? i.getModifierState(o) : (o = h6[o]) ? !!i[o] : !1; } - function Eb() { - return l6; + function zb() { + return g6; } - var c6 = N({}, ju, { + var v6 = _({}, Fu, { key: function(o) { if (o.key) { - var i = a6[o.key] || o.key; + var i = m6[o.key] || o.key; if (i !== "Unidentified") return i; } - return o.type === "keypress" ? (o = hp(o), o === 13 ? "Enter" : String.fromCharCode(o)) : o.type === "keydown" || o.type === "keyup" ? i6[o.keyCode] || "Unidentified" : ""; + return o.type === "keypress" ? (o = yp(o), o === 13 ? "Enter" : String.fromCharCode(o)) : o.type === "keydown" || o.type === "keyup" ? p6[o.keyCode] || "Unidentified" : ""; }, code: 0, location: 0, @@ -2160,17 +2160,17 @@ Error generating stack: ` + h.message + ` metaKey: 0, repeat: 0, locale: 0, - getModifierState: Eb, + getModifierState: zb, charCode: function(o) { - return o.type === "keypress" ? hp(o) : 0; + return o.type === "keypress" ? yp(o) : 0; }, keyCode: function(o) { return o.type === "keydown" || o.type === "keyup" ? o.keyCode : 0; }, which: function(o) { - return o.type === "keypress" ? hp(o) : o.type === "keydown" || o.type === "keyup" ? o.keyCode : 0; + return o.type === "keypress" ? yp(o) : o.type === "keydown" || o.type === "keyup" ? o.keyCode : 0; } - }), u6 = io(c6), d6 = N({}, bp, { + }), b6 = io(v6), y6 = _({}, Cp, { pointerId: 0, width: 0, height: 0, @@ -2181,7 +2181,7 @@ Error generating stack: ` + h.message + ` twist: 0, pointerType: 0, isPrimary: 0 - }), X1 = io(d6), f6 = N({}, Di, { submitter: 0 }), m6 = io(f6), p6 = N({}, ju, { + }), oP = io(y6), S6 = _({}, Oi, { submitter: 0 }), x6 = io(S6), C6 = _({}, Fu, { touches: 0, targetTouches: 0, changedTouches: 0, @@ -2189,12 +2189,12 @@ Error generating stack: ` + h.message + ` metaKey: 0, ctrlKey: 0, shiftKey: 0, - getModifierState: Eb - }), h6 = io(p6), g6 = N({}, Di, { + getModifierState: zb + }), $6 = io(C6), w6 = _({}, Oi, { propertyName: 0, elapsedTime: 0, pseudoElement: 0 - }), v6 = io(g6), b6 = N({}, bp, { + }), E6 = io(w6), R6 = _({}, Cp, { deltaX: function(o) { return "deltaX" in o ? o.deltaX : "wheelDeltaX" in o ? -o.wheelDeltaX : 0; }, @@ -2203,17 +2203,17 @@ Error generating stack: ` + h.message + ` }, deltaZ: 0, deltaMode: 0 - }), y6 = io(b6), S6 = N({}, Di, { + }), P6 = io(R6), T6 = _({}, Oi, { newState: 0, oldState: 0, source: 0 - }), x6 = io(S6), C6 = [9, 13, 27, 32], Rb = ri && "CompositionEvent" in window, Bu = null; - ri && "documentMode" in document && (Bu = document.documentMode); - var $6 = ri && "TextEvent" in window && !Bu, Q1 = ri && (!Rb || Bu && 8 < Bu && 11 >= Bu), Y1 = " ", Z1 = !1; - function J1(o, i) { + }), N6 = io(T6), _6 = [9, 13, 27, 32], Mb = oi && "CompositionEvent" in window, Hu = null; + oi && "documentMode" in document && (Hu = document.documentMode); + var I6 = oi && "TextEvent" in window && !Hu, aP = oi && (!Mb || Hu && 8 < Hu && 11 >= Hu), iP = " ", sP = !1; + function lP(o, i) { switch (o) { case "keyup": - return C6.indexOf(i.keyCode) !== -1; + return _6.indexOf(i.keyCode) !== -1; case "keydown": return i.keyCode !== 229; case "keypress": @@ -2224,25 +2224,25 @@ Error generating stack: ` + h.message + ` return !1; } } - function eP(o) { + function cP(o) { return o = o.detail, typeof o == "object" && "data" in o ? o.data : null; } - var Ql = !1; - function w6(o, i) { + var Yl = !1; + function z6(o, i) { switch (o) { case "compositionend": - return eP(i); + return cP(i); case "keypress": - return i.which !== 32 ? null : (Z1 = !0, Y1); + return i.which !== 32 ? null : (sP = !0, iP); case "textInput": - return o = i.data, o === Y1 && Z1 ? null : o; + return o = i.data, o === iP && sP ? null : o; default: return null; } } - function E6(o, i) { - if (Ql) - return o === "compositionend" || !Rb && J1(o, i) ? (o = W1(), pp = xb = Ai = null, Ql = !1, o) : null; + function M6(o, i) { + if (Yl) + return o === "compositionend" || !Mb && lP(o, i) ? (o = eP(), bp = Tb = Di = null, Yl = !1, o) : null; switch (o) { case "paste": return null; @@ -2254,12 +2254,12 @@ Error generating stack: ` + h.message + ` } return null; case "compositionend": - return Q1 && i.locale !== "ko" ? null : i.data; + return aP && i.locale !== "ko" ? null : i.data; default: return null; } } - var R6 = { + var A6 = { color: !0, date: !0, datetime: !0, @@ -2276,12 +2276,12 @@ Error generating stack: ` + h.message + ` url: !0, week: !0 }; - function tP(o) { + function uP(o) { var i = o && o.nodeName && o.nodeName.toLowerCase(); - return i === "input" ? !!R6[o.type] : i === "textarea"; + return i === "input" ? !!A6[o.type] : i === "textarea"; } - function nP(o, i, d, h) { - Gl ? Xl ? Xl.push(h) : Xl = [h] : Gl = h, i = yh(i, "onChange"), 0 < i.length && (d = new vp( + function dP(o, i, d, h) { + Xl ? Ql ? Ql.push(h) : Ql = [h] : Xl = h, i = $h(i, "onChange"), 0 < i.length && (d = new xp( "onChange", "change", null, @@ -2289,63 +2289,63 @@ Error generating stack: ` + h.message + ` h ), o.push({ event: d, listeners: i })); } - var Hu = null, Uu = null; - function P6(o) { - UN(o, 0); + var Uu = null, qu = null; + function D6(o) { + ZN(o, 0); } - function yp(o) { - var i = wr(o); - if (L1(i)) return o; + function $p(o) { + var i = Er(o); + if (V1(i)) return o; } - function rP(o, i) { + function fP(o, i) { if (o === "change") return i; } - var oP = !1; - if (ri) { - var Pb; - if (ri) { - var Tb = "oninput" in document; - if (!Tb) { - var aP = document.createElement("div"); - aP.setAttribute("oninput", "return;"), Tb = typeof aP.oninput == "function"; + var mP = !1; + if (oi) { + var Ab; + if (oi) { + var Db = "oninput" in document; + if (!Db) { + var pP = document.createElement("div"); + pP.setAttribute("oninput", "return;"), Db = typeof pP.oninput == "function"; } - Pb = Tb; - } else Pb = !1; - oP = Pb && (!document.documentMode || 9 < document.documentMode); + Ab = Db; + } else Ab = !1; + mP = Ab && (!document.documentMode || 9 < document.documentMode); } - function iP() { - Hu && (Hu.detachEvent("onpropertychange", sP), Uu = Hu = null); + function hP() { + Uu && (Uu.detachEvent("onpropertychange", gP), qu = Uu = null); } - function sP(o) { - if (o.propertyName === "value" && yp(Uu)) { + function gP(o) { + if (o.propertyName === "value" && $p(qu)) { var i = []; - nP( + dP( i, - Uu, + qu, o, - bb(o) - ), q1(P6, i); + Eb(o) + ), J1(D6, i); } } - function T6(o, i, d) { - o === "focusin" ? (iP(), Hu = i, Uu = d, Hu.attachEvent("onpropertychange", sP)) : o === "focusout" && iP(); + function O6(o, i, d) { + o === "focusin" ? (hP(), Uu = i, qu = d, Uu.attachEvent("onpropertychange", gP)) : o === "focusout" && hP(); } - function N6(o) { + function L6(o) { if (o === "selectionchange" || o === "keyup" || o === "keydown") - return yp(Uu); + return $p(qu); } - function _6(o, i) { - if (o === "click") return yp(i); + function k6(o, i) { + if (o === "click") return $p(i); } - function I6(o, i) { + function j6(o, i) { if (o === "input" || o === "change") - return yp(i); + return $p(i); } - function M6(o, i) { + function F6(o, i) { return o === i && (o !== 0 || 1 / o === 1 / i) || o !== o && i !== i; } - var Po = typeof Object.is == "function" ? Object.is : M6; - function qu(o, i) { + var Po = typeof Object.is == "function" ? Object.is : F6; + function Wu(o, i) { if (Po(o, i)) return !0; if (typeof o != "object" || o === null || typeof i != "object" || i === null) return !1; @@ -2353,12 +2353,12 @@ Error generating stack: ` + h.message + ` if (d.length !== h.length) return !1; for (h = 0; h < d.length; h++) { var x = d[h]; - if (!Ue.call(i, x) || !Po(o[x], i[x])) + if (!qe.call(i, x) || !Po(o[x], i[x])) return !1; } return !0; } - function Nb(o) { + function Ob(o) { if (o = o || (typeof document < "u" ? document : void 0), typeof o > "u") return null; try { return o.activeElement || o.body; @@ -2366,12 +2366,12 @@ Error generating stack: ` + h.message + ` return o.body; } } - function lP(o) { + function vP(o) { for (; o && o.firstChild; ) o = o.firstChild; return o; } - function cP(o, i) { - var d = lP(o); + function bP(o, i) { + var d = vP(o); o = 0; for (var h; d; ) { if (d.nodeType === 3) { @@ -2389,15 +2389,15 @@ Error generating stack: ` + h.message + ` } d = void 0; } - d = lP(d); + d = vP(d); } } - function uP(o, i) { - return o && i ? o === i ? !0 : o && o.nodeType === 3 ? !1 : i && i.nodeType === 3 ? uP(o, i.parentNode) : "contains" in o ? o.contains(i) : o.compareDocumentPosition ? !!(o.compareDocumentPosition(i) & 16) : !1 : !1; + function yP(o, i) { + return o && i ? o === i ? !0 : o && o.nodeType === 3 ? !1 : i && i.nodeType === 3 ? yP(o, i.parentNode) : "contains" in o ? o.contains(i) : o.compareDocumentPosition ? !!(o.compareDocumentPosition(i) & 16) : !1 : !1; } - function dP(o) { + function SP(o) { o = o != null && o.ownerDocument != null && o.ownerDocument.defaultView != null ? o.ownerDocument.defaultView : window; - for (var i = Nb(o.document); i instanceof o.HTMLIFrameElement; ) { + for (var i = Ob(o.document); i instanceof o.HTMLIFrameElement; ) { try { var d = typeof i.contentWindow.location.href == "string"; } catch { @@ -2405,35 +2405,35 @@ Error generating stack: ` + h.message + ` } if (d) o = i.contentWindow; else break; - i = Nb(o.document); + i = Ob(o.document); } return i; } - function _b(o) { + function Lb(o) { var i = o && o.nodeName && o.nodeName.toLowerCase(); return i && (i === "input" && (o.type === "text" || o.type === "search" || o.type === "tel" || o.type === "url" || o.type === "password") || i === "textarea" || o.contentEditable === "true"); } - var z6 = ri && "documentMode" in document && 11 >= document.documentMode, Yl = null, Ib = null, Wu = null, Mb = !1; - function fP(o, i, d) { + var B6 = oi && "documentMode" in document && 11 >= document.documentMode, Zl = null, kb = null, Vu = null, jb = !1; + function xP(o, i, d) { var h = d.window === d ? d.document : d.nodeType === 9 ? d : d.ownerDocument; - Mb || Yl == null || Yl !== Nb(h) || (h = Yl, "selectionStart" in h && _b(h) ? h = { start: h.selectionStart, end: h.selectionEnd } : (h = (h.ownerDocument && h.ownerDocument.defaultView || window).getSelection(), h = { + jb || Zl == null || Zl !== Ob(h) || (h = Zl, "selectionStart" in h && Lb(h) ? h = { start: h.selectionStart, end: h.selectionEnd } : (h = (h.ownerDocument && h.ownerDocument.defaultView || window).getSelection(), h = { anchorNode: h.anchorNode, anchorOffset: h.anchorOffset, focusNode: h.focusNode, focusOffset: h.focusOffset - }), Wu && qu(Wu, h) || (Wu = h, h = yh(Ib, "onSelect"), 0 < h.length && (i = new vp( + }), Vu && Wu(Vu, h) || (Vu = h, h = $h(kb, "onSelect"), 0 < h.length && (i = new xp( "onSelect", "select", null, i, d - ), o.push({ event: i, listeners: h }), i.target = Yl))); + ), o.push({ event: i, listeners: h }), i.target = Zl))); } function Ms(o, i) { var d = {}; return d[o.toLowerCase()] = i.toLowerCase(), d["Webkit" + o] = "webkit" + i, d["Moz" + o] = "moz" + i, d; } - var Zl = { + var Jl = { animationend: Ms("Animation", "AnimationEnd"), animationiteration: Ms("Animation", "AnimationIteration"), animationstart: Ms("Animation", "AnimationStart"), @@ -2441,36 +2441,36 @@ Error generating stack: ` + h.message + ` transitionstart: Ms("Transition", "TransitionStart"), transitioncancel: Ms("Transition", "TransitionCancel"), transitionend: Ms("Transition", "TransitionEnd") - }, zb = {}, mP = {}; - ri && (mP = document.createElement("div").style, "AnimationEvent" in window || (delete Zl.animationend.animation, delete Zl.animationiteration.animation, delete Zl.animationstart.animation), "TransitionEvent" in window || delete Zl.transitionend.transition); - function zs(o) { - if (zb[o]) return zb[o]; - if (!Zl[o]) return o; - var i = Zl[o], d; + }, Fb = {}, CP = {}; + oi && (CP = document.createElement("div").style, "AnimationEvent" in window || (delete Jl.animationend.animation, delete Jl.animationiteration.animation, delete Jl.animationstart.animation), "TransitionEvent" in window || delete Jl.transitionend.transition); + function As(o) { + if (Fb[o]) return Fb[o]; + if (!Jl[o]) return o; + var i = Jl[o], d; for (d in i) - if (i.hasOwnProperty(d) && d in mP) - return zb[o] = i[d]; + if (i.hasOwnProperty(d) && d in CP) + return Fb[o] = i[d]; return o; } - var pP = zs("animationend"), hP = zs("animationiteration"), gP = zs("animationstart"), A6 = zs("transitionrun"), D6 = zs("transitionstart"), O6 = zs("transitioncancel"), vP = zs("transitionend"), bP = /* @__PURE__ */ new Map(), Ab = "abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split( + var $P = As("animationend"), wP = As("animationiteration"), EP = As("animationstart"), H6 = As("transitionrun"), U6 = As("transitionstart"), q6 = As("transitioncancel"), RP = As("transitionend"), PP = /* @__PURE__ */ new Map(), Bb = "abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split( " " ); - Ab.push("scrollEnd"); - function ia(o, i) { - bP.set(o, i), rn(i, [o]); + Bb.push("scrollEnd"); + function sa(o, i) { + PP.set(o, i), rn(i, [o]); } - var L6 = 0; - function oi(o, i) { + var W6 = 0; + function ai(o, i) { if (o.name != null && o.name !== "auto") return o.name; if (i.autoName !== null) return i.autoName; - o = ua.identifierPrefix; - var d = L6++; + o = da.identifierPrefix; + var d = W6++; return o = "_" + o + "t_" + d.toString(32) + "_", i.autoName = o; } - function yP(o) { + function TP(o) { if (o == null || typeof o == "string") return o; - var i = null, d = bc; + var i = null, d = yc; if (d !== null) for (var h = 0; h < d.length; h++) { var x = o[d[h]]; @@ -2481,10 +2481,10 @@ Error generating stack: ` + h.message + ` } return i ?? o.default; } - function ai(o, i) { - return o = yP(o), i = yP(i), i == null ? o === "auto" ? null : o : i === "auto" ? null : i; + function ii(o, i) { + return o = TP(o), i = TP(i), i == null ? o === "auto" ? null : o : i === "auto" ? null : i; } - var Sp = typeof reportError == "function" ? reportError : function(o) { + var wp = typeof reportError == "function" ? reportError : function(o) { if (typeof window == "object" && typeof window.ErrorEvent == "function") { var i = new window.ErrorEvent("error", { bubbles: !0, @@ -2498,33 +2498,33 @@ Error generating stack: ` + h.message + ` return; } console.error(o); - }, Uo = [], Jl = 0, Db = 0; - function xp() { - for (var o = Jl, i = Db = Jl = 0; i < o; ) { - var d = Uo[i]; - Uo[i++] = null; - var h = Uo[i]; - Uo[i++] = null; - var x = Uo[i]; - Uo[i++] = null; - var w = Uo[i]; - if (Uo[i++] = null, h !== null && x !== null) { - var j = h.pending; - j === null ? x.next = x : (x.next = j.next, j.next = x), h.pending = x; + }, qo = [], ec = 0, Hb = 0; + function Ep() { + for (var o = ec, i = Hb = ec = 0; i < o; ) { + var d = qo[i]; + qo[i++] = null; + var h = qo[i]; + qo[i++] = null; + var x = qo[i]; + qo[i++] = null; + var w = qo[i]; + if (qo[i++] = null, h !== null && x !== null) { + var B = h.pending; + B === null ? x.next = x : (x.next = B.next, B.next = x), h.pending = x; } - w !== 0 && SP(d, x, w); + w !== 0 && NP(d, x, w); } } - function Cp(o, i, d, h) { - Uo[Jl++] = o, Uo[Jl++] = i, Uo[Jl++] = d, Uo[Jl++] = h, Db |= h, o.lanes |= h, o = o.alternate, o !== null && (o.lanes |= h); + function Rp(o, i, d, h) { + qo[ec++] = o, qo[ec++] = i, qo[ec++] = d, qo[ec++] = h, Hb |= h, o.lanes |= h, o = o.alternate, o !== null && (o.lanes |= h); } - function Ob(o, i, d, h) { - return Cp(o, i, d, h), $p(o); + function Ub(o, i, d, h) { + return Rp(o, i, d, h), Pp(o); } - function As(o, i) { - return Cp(o, null, null, i), $p(o); + function Ds(o, i) { + return Rp(o, null, null, i), Pp(o); } - function SP(o, i, d) { + function NP(o, i, d) { o.lanes |= d; var h = o.alternate; h !== null && (h.lanes |= d); @@ -2532,24 +2532,24 @@ Error generating stack: ` + h.message + ` w.childLanes |= d, h = w.alternate, h !== null && (h.childLanes |= d), w.tag === 22 && (o = w.stateNode, o === null || o._visibility & 1 || (x = !0)), o = w, w = w.return; return o.tag === 3 ? (w = o.stateNode, x && i !== null && (x = 31 - Fe(d), o = w.hiddenUpdates, h = o[x], h === null ? o[x] = [i] : h.push(i), i.lane = d | 536870912), w) : null; } - function $p(o) { - if (50 < md) - throw md = 0, fh = null, Error(r(185)); + function Pp(o) { + if (50 < pd) + throw pd = 0, gh = null, Error(r(185)); for (var i = o.return; i !== null; ) o = i, i = o.return; return o.tag === 3 ? o.stateNode : null; } - var ec = {}; - function k6(o, i, d, h) { + var tc = {}; + function V6(o, i, d, h) { this.tag = o, this.key = d, this.sibling = this.child = this.return = this.stateNode = this.type = this.elementType = null, this.index = 0, this.refCleanup = this.ref = null, this.pendingProps = i, this.dependencies = this.memoizedState = this.updateQueue = this.memoizedProps = null, this.mode = h, this.subtreeFlags = this.flags = 0, this.deletions = null, this.childLanes = this.lanes = 0, this.alternate = null; } function po(o, i, d, h) { - return new k6(o, i, d, h); + return new V6(o, i, d, h); } - function Lb(o) { + function qb(o) { return o = o.prototype, !(!o || !o.isReactComponent); } - function ii(o, i) { + function si(o, i) { var d = o.alternate; return d === null ? (d = po( o.tag, @@ -2558,7 +2558,7 @@ Error generating stack: ` + h.message + ` o.mode ), d.elementType = o.elementType, d.type = o.type, d.stateNode = o.stateNode, d.alternate = o, o.alternate = d) : (d.pendingProps = i, d.type = o.type, d.flags = 0, d.subtreeFlags = 0, d.deletions = null), d.flags = o.flags & 1206910976, d.childLanes = o.childLanes, d.lanes = o.lanes, d.child = o.child, d.memoizedProps = o.memoizedProps, d.memoizedState = o.memoizedState, d.updateQueue = o.updateQueue, i = o.dependencies, d.dependencies = i === null ? null : { lanes: i.lanes, firstContext: i.firstContext }, d.sibling = o.sibling, d.index = o.index, d.ref = o.ref, d.refCleanup = o.refCleanup, d; } - function xP(o, i) { + function _P(o, i) { o.flags &= 1206910978; var d = o.alternate; return d === null ? (o.childLanes = 0, o.lanes = i, o.child = null, o.subtreeFlags = 0, o.memoizedProps = null, o.memoizedState = null, o.updateQueue = null, o.dependencies = null, o.stateNode = null) : (o.childLanes = d.childLanes, o.lanes = d.lanes, o.child = d.child, o.subtreeFlags = 0, o.deletions = null, o.memoizedProps = d.memoizedProps, o.memoizedState = d.memoizedState, o.updateQueue = d.updateQueue, o.type = d.type, i = d.dependencies, o.dependencies = i === null ? null : { @@ -2566,33 +2566,33 @@ Error generating stack: ` + h.message + ` firstContext: i.firstContext }), o; } - function wp(o, i, d, h, x, w) { - var j = 0; - if (h = o, typeof h == "function") Lb(h) && (j = 1); + function Tp(o, i, d, h, x, w) { + var B = 0; + if (h = o, typeof h == "function") qb(h) && (B = 1); else if (typeof h == "string") - j = fU( + B = SU( o, d, - me.current + ge.current ) ? 26 : o === "html" || o === "head" || o === "body" ? 27 : 5; else e: switch (h) { - case G: - return o = po(31, d, i, x), o.elementType = G, o.lanes = w, o; - case z: - return Ds(d.children, x, w, i); + case Y: + return o = po(31, d, i, x), o.elementType = Y, o.lanes = w, o; + case M: + return Os(d.children, x, w, i); case O: - j = 8, x |= 24; + B = 8, x |= 24; break; - case L: - return o = po(12, d, i, x | 2), o.elementType = L, o.lanes = w, o; + case k: + return o = po(12, d, i, x | 2), o.elementType = k, o.lanes = w, o; case V: return o = po(13, d, i, x), o.elementType = V, o.lanes = w, o; - case ee: - return o = po(19, d, i, x), o.elementType = ee, o.lanes = w, o; + case Z: + return o = po(19, d, i, x), o.elementType = Z, o.lanes = w, o; case W: - case k: - return o = x | 32, o = po(30, d, i, o), o.elementType = k, o.lanes = w, o.stateNode = { + case L: + return o = x | 32, o = po(30, d, i, o), o.elementType = L, o.lanes = w, o.stateNode = { autoName: null, paired: null, clones: null, @@ -2601,39 +2601,39 @@ Error generating stack: ` + h.message + ` default: if (typeof h == "object" && h !== null) switch (h.$$typeof) { - case U: - j = 10; + case q: + B = 10; break e; case F: - j = 9; + B = 9; break e; - case H: - j = 11; + case U: + B = 11; break e; - case X: - j = 14; + case G: + B = 14; break e; case K: - j = 16, h = null; + B = 16, h = null; break e; } - j = 29, d = Error( + B = 29, d = Error( r(130, o === null ? "null" : typeof o, "") ), h = null; } - return i = po(j, d, i, x), i.elementType = o, i.type = h, i.lanes = w, i; + return i = po(B, d, i, x), i.elementType = o, i.type = h, i.lanes = w, i; } - function Ds(o, i, d, h) { + function Os(o, i, d, h) { return o = po(7, o, h, i), o.lanes = d, o; } - function kb(o, i, d) { + function Wb(o, i, d) { return o = po(6, o, null, i), o.lanes = d, o; } - function CP(o) { + function IP(o) { var i = po(18, null, null, 0); return i.stateNode = o, i; } - function jb(o, i, d) { + function Vb(o, i, d) { return i = po( 4, o.children !== null ? o.children : [], @@ -2645,15 +2645,15 @@ Error generating stack: ` + h.message + ` implementation: o.implementation }, i; } - var $P = /* @__PURE__ */ new WeakMap(); - function qo(o, i) { + var zP = /* @__PURE__ */ new WeakMap(); + function Wo(o, i) { if (typeof o == "object" && o !== null) { - var d = $P.get(o); + var d = zP.get(o); return d !== void 0 ? d : (i = { value: o, source: i, stack: Ge(i) - }, $P.set(o, i), i); + }, zP.set(o, i), i); } return { value: o, @@ -2661,37 +2661,37 @@ Error generating stack: ` + h.message + ` stack: Ge(i) }; } - var tc = [], nc = 0, Ep = null, Vu = 0, Wo = [], Vo = 0, Oi = null, Ta = 1, Na = ""; - function si(o, i) { - tc[nc++] = Vu, tc[nc++] = Ep, Ep = o, Vu = i; + var nc = [], rc = 0, Np = null, Ku = 0, Vo = [], Ko = 0, Li = null, Na = 1, _a = ""; + function li(o, i) { + nc[rc++] = Ku, nc[rc++] = Np, Np = o, Ku = i; } - function wP(o, i, d) { - Wo[Vo++] = Ta, Wo[Vo++] = Na, Wo[Vo++] = Oi, Oi = o; - var h = Ta; - o = Na; + function MP(o, i, d) { + Vo[Ko++] = Na, Vo[Ko++] = _a, Vo[Ko++] = Li, Li = o; + var h = Na; + o = _a; var x = 32 - Fe(h) - 1; h &= ~(1 << x), d += 1; var w = 32 - Fe(i) + x; if (30 < w) { - var j = x - x % 5; - w = (h & (1 << j) - 1).toString(32), h >>= j, x -= j, Ta = 1 << 32 - Fe(i) + x | d << x | h, Na = w + o; + var B = x - x % 5; + w = (h & (1 << B) - 1).toString(32), h >>= B, x -= B, Na = 1 << 32 - Fe(i) + x | d << x | h, _a = w + o; } else - Ta = 1 << w | d << x | h, Na = o; + Na = 1 << w | d << x | h, _a = o; } - function Rp(o) { - o.return !== null && (si(o, 1), wP(o, 1, 0)); + function _p(o) { + o.return !== null && (li(o, 1), MP(o, 1, 0)); } - function Fb(o) { - for (; o === Ep; ) - Ep = tc[--nc], tc[nc] = null, Vu = tc[--nc], tc[nc] = null; - for (; o === Oi; ) - Oi = Wo[--Vo], Wo[Vo] = null, Na = Wo[--Vo], Wo[Vo] = null, Ta = Wo[--Vo], Wo[Vo] = null; + function Kb(o) { + for (; o === Np; ) + Np = nc[--rc], nc[rc] = null, Ku = nc[--rc], nc[rc] = null; + for (; o === Li; ) + Li = Vo[--Ko], Vo[Ko] = null, _a = Vo[--Ko], Vo[Ko] = null, Na = Vo[--Ko], Vo[Ko] = null; } - function EP(o, i) { - Wo[Vo++] = Ta, Wo[Vo++] = Na, Wo[Vo++] = Oi, Ta = i.id, Na = i.overflow, Oi = o; + function AP(o, i) { + Vo[Ko++] = Na, Vo[Ko++] = _a, Vo[Ko++] = Li, Na = i.id, _a = i.overflow, Li = o; } - var zr = null, Gn = null, on = !1, Li = null, Ko = !1, Bb = Error(r(519)); - function ki(o) { + var Ar = null, Gn = null, on = !1, ki = null, Go = !1, Gb = Error(r(519)); + function ji(o) { var i = Error( r( 418, @@ -2699,11 +2699,11 @@ Error generating stack: ` + h.message + ` "" ) ); - throw Ku(qo(i, o)), Bb; + throw Gu(Wo(i, o)), Gb; } - function RP(o) { + function DP(o) { var i = o.stateNode, d = o.type, h = o.memoizedProps; - switch (i[bn] = o, i[kn] = h, d) { + switch (i[yn] = o, i[kn] = h, d) { case "dialog": fn("cancel", i), fn("close", i); break; @@ -2714,8 +2714,8 @@ Error generating stack: ` + h.message + ` break; case "video": case "audio": - for (d = 0; d < hd.length; d++) - fn(hd[d], i); + for (d = 0; d < gd.length; d++) + fn(gd[d], i); break; case "source": fn("error", i); @@ -2729,7 +2729,7 @@ Error generating stack: ` + h.message + ` fn("toggle", i); break; case "input": - fn("invalid", i), k1( + fn("invalid", i), K1( i, h.value, h.defaultValue, @@ -2744,114 +2744,114 @@ Error generating stack: ` + h.message + ` fn("invalid", i); break; case "textarea": - fn("invalid", i), F1(i, h.value, h.defaultValue, h.children); + fn("invalid", i), X1(i, h.value, h.defaultValue, h.children); } - d = h.children, typeof d != "string" && typeof d != "number" && typeof d != "bigint" || i.textContent === "" + d || h.suppressHydrationWarning === !0 || KN(i.textContent, d) ? (h.popover != null && (fn("beforetoggle", i), fn("toggle", i)), h.onScroll != null && fn("scroll", i), h.onScrollEnd != null && fn("scrollend", i), h.onClick != null && (i.onclick = Pa), i = !0) : i = !1, i || ki(o, !0); + d = h.children, typeof d != "string" && typeof d != "number" && typeof d != "bigint" || i.textContent === "" + d || h.suppressHydrationWarning === !0 || n_(i.textContent, d) ? (h.popover != null && (fn("beforetoggle", i), fn("toggle", i)), h.onScroll != null && fn("scroll", i), h.onScrollEnd != null && fn("scrollend", i), h.onClick != null && (i.onclick = Ta), i = !0) : i = !1, i || ji(o, !0); } - function Pp(o) { - for (zr = o.return; zr; ) - switch (zr.tag) { + function Ip(o) { + for (Ar = o.return; Ar; ) + switch (Ar.tag) { case 5: case 31: case 13: - Ko = !1; + Go = !1; return; case 27: case 3: - Ko = !0; + Go = !0; return; default: - zr = zr.return; + Ar = Ar.return; } } - function rc(o) { - if (o !== zr) return !1; - if (!on) return Pp(o), on = !0, !1; + function oc(o) { + if (o !== Ar) return !1; + if (!on) return Ip(o), on = !0, !1; var i = o.tag, d; - if ((d = i !== 3 && i !== 27) && ((d = i === 5) && (d = o.type, d = !(d !== "form" && d !== "button") || vS(o.type, o.memoizedProps)), d = !d), d && Gn && ki(o), Pp(o), i === 13) { + if ((d = i !== 3 && i !== 27) && ((d = i === 5) && (d = o.type, d = !(d !== "form" && d !== "button") || wS(o.type, o.memoizedProps)), d = !d), d && Gn && ji(o), Ip(o), i === 13) { if (o = o.memoizedState, o = o !== null ? o.dehydrated : null, !o) throw Error(r(317)); - Gn = f_(o); + Gn = x_(o); } else if (i === 31) { if (o = o.memoizedState, o = o !== null ? o.dehydrated : null, !o) throw Error(r(317)); - Gn = f_(o); + Gn = x_(o); } else - i === 27 ? (i = Gn, es(o.type) ? (o = RS, RS = null, Gn = o) : Gn = i) : Gn = zr ? Xo(o.stateNode.nextSibling) : null; + i === 27 ? (i = Gn, ts(o.type) ? (o = MS, MS = null, Gn = o) : Gn = i) : Gn = Ar ? Qo(o.stateNode.nextSibling) : null; return !0; } - function Os() { - Gn = zr = null, on = !1; + function Ls() { + Gn = Ar = null, on = !1; } - function Hb() { - var o = Li; + function Xb() { + var o = ki; return o !== null && (vo === null ? vo = o : vo.push.apply( vo, o - ), Li = null), o; + ), ki = null), o; } - function Ku(o) { - Li === null ? Li = [o] : Li.push(o); + function Gu(o) { + ki === null ? ki = [o] : ki.push(o); } - var Ub = oe(null), Ls = null, li = null; - function ji(o, i, d) { - Z(Ub, i._currentValue), i._currentValue = d; + var Qb = ne(null), ks = null, ci = null; + function Fi(o, i, d) { + le(Qb, i._currentValue), i._currentValue = d; } - function ci(o) { - o._currentValue = Ub.current, ce(Ub); + function ui(o) { + o._currentValue = Qb.current, ue(Qb); } - function Tp(o, i, d) { + function zp(o, i, d) { for (; o !== null; ) { var h = o.alternate; if ((o.childLanes & i) !== i ? (o.childLanes |= i, h !== null && (h.childLanes |= i)) : h !== null && (h.childLanes & i) !== i && (h.childLanes |= i), o === d) break; o = o.return; } } - function qb(o, i, d, h) { + function Yb(o, i, d, h) { var x = o.child; for (x !== null && (x.return = o); x !== null; ) { var w = x.dependencies; if (w !== null) { - var j = x.child; + var B = x.child; w = w.firstContext; e: for (; w !== null; ) { - var ae = w; + var oe = w; w = x; - for (var ge = 0; ge < i.length; ge++) - if (ae.context === i[ge]) { - w.lanes |= d, ae = w.alternate, ae !== null && (ae.lanes |= d), Tp( + for (var ve = 0; ve < i.length; ve++) + if (oe.context === i[ve]) { + w.lanes |= d, oe = w.alternate, oe !== null && (oe.lanes |= d), zp( w.return, d, o - ), h || (j = null); + ), h || (B = null); break e; } - w = ae.next; + w = oe.next; } } else if (x.tag === 18) { - if (j = x.return, j === null) throw Error(r(341)); - j.lanes |= d, w = j.alternate, w !== null && (w.lanes |= d), Tp(j, d, o), j = null; + if (B = x.return, B === null) throw Error(r(341)); + B.lanes |= d, w = B.alternate, w !== null && (w.lanes |= d), zp(B, d, o), B = null; } else - x.tag === 13 && x.memoizedState !== null && x.memoizedState.dehydrated === null ? (x.lanes |= d, j = x.alternate, j !== null && (j.lanes |= d), Tp( + x.tag === 13 && x.memoizedState !== null && x.memoizedState.dehydrated === null ? (x.lanes |= d, B = x.alternate, B !== null && (B.lanes |= d), zp( x.return, d, o - ), j = x.child, j = j !== null ? j.sibling : null) : j = x.child; - if (j !== null) j.return = x; + ), B = x.child, B = B !== null ? B.sibling : null) : B = x.child; + if (B !== null) B.return = x; else - for (j = x; j !== null; ) { - if (j === o) { - j = null; + for (B = x; B !== null; ) { + if (B === o) { + B = null; break; } - if (x = j.sibling, x !== null) { - x.return = j.return, j = x; + if (x = B.sibling, x !== null) { + x.return = B.return, B = x; break; } - j = j.return; + B = B.return; } - x = j; + x = B; } } - function ks(o, i, d, h) { + function js(o, i, d, h) { o = null; for (var x = i, w = !1; x !== null; ) { if (!w) { @@ -2859,26 +2859,26 @@ Error generating stack: ` + h.message + ` else if ((x.flags & 262144) !== 0) break; } if (x.tag === 10) { - var j = x.alternate; - if (j === null) throw Error(r(387)); - if (j = j.memoizedProps, j !== null) { - var ae = x.type; - Po(x.pendingProps.value, j.value) || (o !== null ? o.push(ae) : o = [ae]); + var B = x.alternate; + if (B === null) throw Error(r(387)); + if (B = B.memoizedProps, B !== null) { + var oe = x.type; + Po(x.pendingProps.value, B.value) || (o !== null ? o.push(oe) : o = [oe]); } - } else if (x === ve.current) { - if (j = x.alternate, j === null) throw Error(r(387)); - j.memoizedState.memoizedState !== x.memoizedState.memoizedState && (o !== null ? o.push(Tc) : o = [Tc]); + } else if (x === be.current) { + if (B = x.alternate, B === null) throw Error(r(387)); + B.memoizedState.memoizedState !== x.memoizedState.memoizedState && (o !== null ? o.push(Nc) : o = [Nc]); } x = x.return; } - return o !== null && qb( + return o !== null && Yb( i, o, d, h ), i.flags |= 262144, o !== null; } - function Np(o) { + function Mp(o) { for (o = o.firstContext; o !== null; ) { if (!Po( o.context._currentValue, @@ -2889,24 +2889,24 @@ Error generating stack: ` + h.message + ` } return !1; } - function js(o) { - Ls = o, li = null, o = o.dependencies, o !== null && (o.firstContext = null); + function Fs(o) { + ks = o, ci = null, o = o.dependencies, o !== null && (o.firstContext = null); } - function Fr(o) { - return PP(Ls, o); + function Br(o) { + return OP(ks, o); } - function _p(o, i) { - return Ls === null && js(o), PP(o, i); + function Ap(o, i) { + return ks === null && Fs(o), OP(o, i); } - function PP(o, i) { + function OP(o, i) { var d = i._currentValue; - if (i = { context: i, memoizedValue: d, next: null }, li === null) { + if (i = { context: i, memoizedValue: d, next: null }, ci === null) { if (o === null) throw Error(r(308)); - li = i, o.dependencies = { lanes: 0, firstContext: i }, o.flags |= 524288; - } else li = li.next = i; + ci = i, o.dependencies = { lanes: 0, firstContext: i }, o.flags |= 524288; + } else ci = ci.next = i; return d; } - var j6 = typeof AbortController < "u" ? AbortController : function() { + var K6 = typeof AbortController < "u" ? AbortController : function() { var o = [], i = this.signal = { aborted: !1, addEventListener: function(d, h) { @@ -2918,27 +2918,27 @@ Error generating stack: ` + h.message + ` return d(); }); }; - }, F6 = e.unstable_scheduleCallback, B6 = e.unstable_NormalPriority, mr = { - $$typeof: U, + }, G6 = e.unstable_scheduleCallback, X6 = e.unstable_NormalPriority, pr = { + $$typeof: q, Consumer: null, Provider: null, _currentValue: null, _currentValue2: null, _threadCount: 0 }; - function Wb() { + function Zb() { return { - controller: new j6(), + controller: new K6(), data: /* @__PURE__ */ new Map(), refCount: 0 }; } - function Gu(o) { - o.refCount--, o.refCount === 0 && F6(B6, function() { + function Xu(o) { + o.refCount--, o.refCount === 0 && G6(X6, function() { o.controller.abort(); }); } - function TP(o, i) { + function LP(o, i) { if ((o.pendingLanes & 4194048) !== 0) { var d = o.transitionTypes; for (d === null && (d = o.transitionTypes = []), o = 0; o < i.length; o++) { @@ -2947,16 +2947,16 @@ Error generating stack: ` + h.message + ` } } } - var Xu = null; - function H6(o) { + var Qu = null; + function Q6(o) { var i = o.transitionTypes; return o.transitionTypes = null, i; } - var Qu = null, Vb = 0, Fs = 0, oc = null; - function U6(o, i) { - if (Qu === null) { - var d = Qu = []; - Vb = 0, Fs = lS(), oc = { + var Yu = null, Jb = 0, Bs = 0, ac = null; + function Y6(o, i) { + if (Yu === null) { + var d = Yu = []; + Jb = 0, Bs = hS(), ac = { status: "pending", value: void 0, then: function(h) { @@ -2964,17 +2964,17 @@ Error generating stack: ` + h.message + ` } }; } - return Vb++, i.then(NP, NP), i; + return Jb++, i.then(kP, kP), i; } - function NP() { - if (--Vb === 0 && (Xu = null, Qu !== null)) { - oc !== null && (oc.status = "fulfilled"); - var o = Qu; - Qu = null, Fs = 0, oc = null; + function kP() { + if (--Jb === 0 && (Qu = null, Yu !== null)) { + ac !== null && (ac.status = "fulfilled"); + var o = Yu; + Yu = null, Bs = 0, ac = null; for (var i = 0; i < o.length; i++) (0, o[i])(); } } - function q6(o, i) { + function Z6(o, i) { var d = [], h = { status: "pending", value: null, @@ -2994,49 +2994,49 @@ Error generating stack: ` + h.message + ` } ), h; } - var _P = q.S; - q.S = function(o, i) { - if (CN = Je(), typeof i == "object" && i !== null && typeof i.then == "function" && U6(o, i), Xu !== null) - for (var d = Cc; d !== null; ) - TP(d, Xu), d = d.next; + var jP = X.S; + X.S = function(o, i) { + if (IN = Je(), typeof i == "object" && i !== null && typeof i.then == "function" && Y6(o, i), Qu !== null) + for (var d = $c; d !== null; ) + LP(d, Qu), d = d.next; if (d = o.types, d !== null) { - for (var h = Cc; h !== null; ) - TP(h, d), h = h.next; - if (Fs !== 0) { - h = Xu, h === null && (h = Xu = []); + for (var h = $c; h !== null; ) + LP(h, d), h = h.next; + if (Bs !== 0) { + h = Qu, h === null && (h = Qu = []); for (var x = 0; x < d.length; x++) { var w = d[x]; h.indexOf(w) === -1 && h.push(w); } } } - _P !== null && _P(o, i); + jP !== null && jP(o, i); }; - var Bs = oe(null); - function Kb() { - var o = Bs.current; + var Hs = ne(null); + function ey() { + var o = Hs.current; return o !== null ? o : Vn.pooledCache; } - function Ip(o, i) { - i === null ? Z(Bs, Bs.current) : Z(Bs, i.pool); + function Dp(o, i) { + i === null ? le(Hs, Hs.current) : le(Hs, i.pool); } - function IP() { - var o = Kb(); - return o === null ? null : { parent: mr._currentValue, pool: o }; + function FP() { + var o = ey(); + return o === null ? null : { parent: pr._currentValue, pool: o }; } - var ac = Error(r(460)), Gb = Error(r(474)), Mp = Error(r(542)), zp = { then: function() { + var ic = Error(r(460)), ty = Error(r(474)), Op = Error(r(542)), Lp = { then: function() { } }; - function MP(o) { + function BP(o) { return o = o.status, o === "fulfilled" || o === "rejected"; } - function zP(o, i, d) { - switch (d = o[d], d === void 0 ? o.push(i) : d !== i && (i.then(Pa, Pa), i = d), i.status) { + function HP(o, i, d) { + switch (d = o[d], d === void 0 ? o.push(i) : d !== i && (i.then(Ta, Ta), i = d), i.status) { case "fulfilled": return i.value; case "rejected": - throw o = i.reason, DP(o), o === void 0 && !("reason" in i) ? Error(r(600)) : o; + throw o = i.reason, qP(o), o === void 0 && !("reason" in i) ? Error(r(600)) : o; default: - if (typeof i.status == "string") i.then(Pa, Pa); + if (typeof i.status == "string") i.then(Ta, Ta); else { if (o = Vn, o !== null && 100 < o.shellSuspendCounter) throw Error(r(482)); @@ -3059,420 +3059,420 @@ Error generating stack: ` + h.message + ` case "fulfilled": return i.value; case "rejected": - throw o = i.reason, DP(o), o; + throw o = i.reason, qP(o), o; } - throw Us = i, ac; + throw qs = i, ic; } } - function Hs(o) { + function Us(o) { try { var i = o._init; return i(o._payload); } catch (d) { - throw d !== null && typeof d == "object" && typeof d.then == "function" ? (Us = d, ac) : d; + throw d !== null && typeof d == "object" && typeof d.then == "function" ? (qs = d, ic) : d; } } - var Us = null; - function AP() { - if (Us === null) throw Error(r(459)); - var o = Us; - return Us = null, o; + var qs = null; + function UP() { + if (qs === null) throw Error(r(459)); + var o = qs; + return qs = null, o; } - function DP(o) { - if (o === ac || o === Mp) + function qP(o) { + if (o === ic || o === Op) throw Error(r(483)); } - var ic = null, Yu = 0; - function Ap(o) { - var i = Yu; - return Yu += 1, ic === null && (ic = []), zP(ic, o, i); + var sc = null, Zu = 0; + function kp(o) { + var i = Zu; + return Zu += 1, sc === null && (sc = []), HP(sc, o, i); } - function Fi(o, i) { + function Bi(o, i) { i = i.props.ref, o.ref = i !== void 0 ? i : null; } - function Dp(o, i) { - throw i.$$typeof === P ? Error(r(525)) : (o = Object.prototype.toString.call(i), Error( + function jp(o, i) { + throw i.$$typeof === T ? Error(r(525)) : (o = Object.prototype.toString.call(i), Error( r( 31, o === "[object Object]" ? "object with keys {" + Object.keys(i).join(", ") + "}" : o ) )); } - function OP(o) { - function i(_e, Ce) { + function WP(o) { + function i(Ie, we) { if (o) { - var Ae = _e.deletions; - Ae === null ? (_e.deletions = [Ce], _e.flags |= 16) : Ae.push(Ce); + var Ae = Ie.deletions; + Ae === null ? (Ie.deletions = [we], Ie.flags |= 16) : Ae.push(we); } } - function d(_e, Ce) { + function d(Ie, we) { if (!o) return null; - for (; Ce !== null; ) - i(_e, Ce), Ce = Ce.sibling; + for (; we !== null; ) + i(Ie, we), we = we.sibling; return null; } - function h(_e) { - for (var Ce = /* @__PURE__ */ new Map(); _e !== null; ) - _e.key === null ? Ce.set(_e.index, _e) : Ce.set(_e.key, _e), _e = _e.sibling; - return Ce; + function h(Ie) { + for (var we = /* @__PURE__ */ new Map(); Ie !== null; ) + Ie.key === null ? we.set(Ie.index, Ie) : we.set(Ie.key, Ie), Ie = Ie.sibling; + return we; } - function x(_e, Ce) { - return _e = ii(_e, Ce), _e.index = 0, _e.sibling = null, _e; + function x(Ie, we) { + return Ie = si(Ie, we), Ie.index = 0, Ie.sibling = null, Ie; } - function w(_e, Ce, Ae) { - return _e.index = Ae, o ? (Ae = _e.alternate, Ae !== null ? (Ae = Ae.index, Ae < Ce ? (_e.flags |= 2, Ce) : Ae) : (_e.flags |= 134217730, Ce)) : (_e.flags |= 1048576, Ce); + function w(Ie, we, Ae) { + return Ie.index = Ae, o ? (Ae = Ie.alternate, Ae !== null ? (Ae = Ae.index, Ae < we ? (Ie.flags |= 2, we) : Ae) : (Ie.flags |= 134217730, we)) : (Ie.flags |= 1048576, we); } - function j(_e) { - return o && _e.alternate === null && (_e.flags |= 134217730), _e; + function B(Ie) { + return o && Ie.alternate === null && (Ie.flags |= 134217730), Ie; } - function ae(_e, Ce, Ae, Xe) { - return Ce === null || Ce.tag !== 6 ? (Ce = kb(Ae, _e.mode, Xe), Ce.return = _e, Ce) : (Ce = x(Ce, Ae), Ce.return = _e, Ce); + function oe(Ie, we, Ae, Xe) { + return we === null || we.tag !== 6 ? (we = Wb(Ae, Ie.mode, Xe), we.return = Ie, we) : (we = x(we, Ae), we.return = Ie, we); } - function ge(_e, Ce, Ae, Xe) { - var bt = Ae.type; - return bt === z ? (_e = je( - _e, - Ce, + function ve(Ie, we, Ae, Xe) { + var St = Ae.type; + return St === M ? (Ie = je( + Ie, + we, Ae.props.children, Xe, Ae.key - ), Fi(_e, Ae), _e) : Ce !== null && (Ce.elementType === bt || typeof bt == "object" && bt !== null && bt.$$typeof === K && Hs(bt) === Ce.type) ? (Ce = x(Ce, Ae.props), Fi(Ce, Ae), Ce.return = _e, Ce) : (Ce = wp( + ), Bi(Ie, Ae), Ie) : we !== null && (we.elementType === St || typeof St == "object" && St !== null && St.$$typeof === K && Us(St) === we.type) ? (we = x(we, Ae.props), Bi(we, Ae), we.return = Ie, we) : (we = Tp( Ae.type, Ae.key, Ae.props, null, - _e.mode, + Ie.mode, Xe - ), Fi(Ce, Ae), Ce.return = _e, Ce); + ), Bi(we, Ae), we.return = Ie, we); } - function Ie(_e, Ce, Ae, Xe) { - return Ce === null || Ce.tag !== 4 || Ce.stateNode.containerInfo !== Ae.containerInfo || Ce.stateNode.implementation !== Ae.implementation ? (Ce = jb(Ae, _e.mode, Xe), Ce.return = _e, Ce) : (Ce = x(Ce, Ae.children || []), Ce.return = _e, Ce); + function ze(Ie, we, Ae, Xe) { + return we === null || we.tag !== 4 || we.stateNode.containerInfo !== Ae.containerInfo || we.stateNode.implementation !== Ae.implementation ? (we = Vb(Ae, Ie.mode, Xe), we.return = Ie, we) : (we = x(we, Ae.children || []), we.return = Ie, we); } - function je(_e, Ce, Ae, Xe, bt) { - return Ce === null || Ce.tag !== 7 ? (Ce = Ds( + function je(Ie, we, Ae, Xe, St) { + return we === null || we.tag !== 7 ? (we = Os( Ae, - _e.mode, + Ie.mode, Xe, - bt - ), Ce.return = _e, Ce) : (Ce = x(Ce, Ae), Ce.return = _e, Ce); - } - function Ye(_e, Ce, Ae) { - if (typeof Ce == "string" && Ce !== "" || typeof Ce == "number" || typeof Ce == "bigint") - return Ce = kb( - "" + Ce, - _e.mode, + St + ), we.return = Ie, we) : (we = x(we, Ae), we.return = Ie, we); + } + function Ye(Ie, we, Ae) { + if (typeof we == "string" && we !== "" || typeof we == "number" || typeof we == "bigint") + return we = Wb( + "" + we, + Ie.mode, Ae - ), Ce.return = _e, Ce; - if (typeof Ce == "object" && Ce !== null) { - switch (Ce.$$typeof) { - case T: - return Ae = wp( - Ce.type, - Ce.key, - Ce.props, + ), we.return = Ie, we; + if (typeof we == "object" && we !== null) { + switch (we.$$typeof) { + case N: + return Ae = Tp( + we.type, + we.key, + we.props, null, - _e.mode, + Ie.mode, Ae - ), Fi(Ae, Ce), Ae.return = _e, Ae; + ), Bi(Ae, we), Ae.return = Ie, Ae; case A: - return Ce = jb( - Ce, - _e.mode, + return we = Vb( + we, + Ie.mode, Ae - ), Ce.return = _e, Ce; + ), we.return = Ie, we; case K: - return Ce = Hs(Ce), Ye(_e, Ce, Ae); + return we = Us(we), Ye(Ie, we, Ae); } - if (Y(Ce) || re(Ce)) - return Ce = Ds( - Ce, - _e.mode, + if (ae(we) || te(we)) + return we = Os( + we, + Ie.mode, Ae, null - ), Ce.return = _e, Ce; - if (typeof Ce.then == "function") - return Ye(_e, Ap(Ce), Ae); - if (Ce.$$typeof === U) + ), we.return = Ie, we; + if (typeof we.then == "function") + return Ye(Ie, kp(we), Ae); + if (we.$$typeof === q) return Ye( - _e, - _p(_e, Ce), + Ie, + Ap(Ie, we), Ae ); - Dp(_e, Ce); + jp(Ie, we); } return null; } - function Pe(_e, Ce, Ae, Xe) { - var bt = Ce !== null ? Ce.key : null; + function Te(Ie, we, Ae, Xe) { + var St = we !== null ? we.key : null; if (typeof Ae == "string" && Ae !== "" || typeof Ae == "number" || typeof Ae == "bigint") - return bt !== null ? null : ae(_e, Ce, "" + Ae, Xe); + return St !== null ? null : oe(Ie, we, "" + Ae, Xe); if (typeof Ae == "object" && Ae !== null) { switch (Ae.$$typeof) { - case T: - return Ae.key === bt ? ge(_e, Ce, Ae, Xe) : null; + case N: + return Ae.key === St ? ve(Ie, we, Ae, Xe) : null; case A: - return Ae.key === bt ? Ie(_e, Ce, Ae, Xe) : null; + return Ae.key === St ? ze(Ie, we, Ae, Xe) : null; case K: - return Ae = Hs(Ae), Pe(_e, Ce, Ae, Xe); + return Ae = Us(Ae), Te(Ie, we, Ae, Xe); } - if (Y(Ae) || re(Ae)) - return bt !== null ? null : je(_e, Ce, Ae, Xe, null); + if (ae(Ae) || te(Ae)) + return St !== null ? null : je(Ie, we, Ae, Xe, null); if (typeof Ae.then == "function") - return Pe( - _e, - Ce, - Ap(Ae), + return Te( + Ie, + we, + kp(Ae), Xe ); - if (Ae.$$typeof === U) - return Pe( - _e, - Ce, - _p(_e, Ae), + if (Ae.$$typeof === q) + return Te( + Ie, + we, + Ap(Ie, Ae), Xe ); - Dp(_e, Ae); + jp(Ie, Ae); } return null; } - function Le(_e, Ce, Ae, Xe, bt) { + function Le(Ie, we, Ae, Xe, St) { if (typeof Xe == "string" && Xe !== "" || typeof Xe == "number" || typeof Xe == "bigint") - return _e = _e.get(Ae) || null, ae(Ce, _e, "" + Xe, bt); + return Ie = Ie.get(Ae) || null, oe(we, Ie, "" + Xe, St); if (typeof Xe == "object" && Xe !== null) { switch (Xe.$$typeof) { - case T: - return _e = _e.get( + case N: + return Ie = Ie.get( Xe.key === null ? Ae : Xe.key - ) || null, ge(Ce, _e, Xe, bt); + ) || null, ve(we, Ie, Xe, St); case A: - return _e = _e.get( + return Ie = Ie.get( Xe.key === null ? Ae : Xe.key - ) || null, Ie(Ce, _e, Xe, bt); + ) || null, ze(we, Ie, Xe, St); case K: - return Xe = Hs(Xe), Le( - _e, - Ce, + return Xe = Us(Xe), Le( + Ie, + we, Ae, Xe, - bt + St ); } - if (Y(Xe) || re(Xe)) - return _e = _e.get(Ae) || null, je(Ce, _e, Xe, bt, null); + if (ae(Xe) || te(Xe)) + return Ie = Ie.get(Ae) || null, je(we, Ie, Xe, St, null); if (typeof Xe.then == "function") return Le( - _e, - Ce, + Ie, + we, Ae, - Ap(Xe), - bt + kp(Xe), + St ); - if (Xe.$$typeof === U) + if (Xe.$$typeof === q) return Le( - _e, - Ce, + Ie, + we, Ae, - _p(Ce, Xe), - bt + Ap(we, Xe), + St ); - Dp(Ce, Xe); + jp(we, Xe); } return null; } - function ut(_e, Ce, Ae, Xe) { - for (var bt = null, gn = null, Mt = Ce, jt = Ce = 0, gr = null; Mt !== null && jt < Ae.length; jt++) { - Mt.index > jt ? (gr = Mt, Mt = null) : gr = Mt.sibling; - var yn = Pe( - _e, + function dt(Ie, we, Ae, Xe) { + for (var St = null, vn = null, Mt = we, jt = we = 0, vr = null; Mt !== null && jt < Ae.length; jt++) { + Mt.index > jt ? (vr = Mt, Mt = null) : vr = Mt.sibling; + var Sn = Te( + Ie, Mt, Ae[jt], Xe ); - if (yn === null) { - Mt === null && (Mt = gr); + if (Sn === null) { + Mt === null && (Mt = vr); break; } - o && Mt && yn.alternate === null && i(_e, Mt), Ce = w(yn, Ce, jt), gn === null ? bt = yn : gn.sibling = yn, gn = yn, Mt = gr; + o && Mt && Sn.alternate === null && i(Ie, Mt), we = w(Sn, we, jt), vn === null ? St = Sn : vn.sibling = Sn, vn = Sn, Mt = vr; } if (jt === Ae.length) - return d(_e, Mt), on && si(_e, jt), bt; + return d(Ie, Mt), on && li(Ie, jt), St; if (Mt === null) { for (; jt < Ae.length; jt++) - Mt = Ye(_e, Ae[jt], Xe), Mt !== null && (Ce = w( + Mt = Ye(Ie, Ae[jt], Xe), Mt !== null && (we = w( Mt, - Ce, + we, jt - ), gn === null ? bt = Mt : gn.sibling = Mt, gn = Mt); - return on && si(_e, jt), bt; + ), vn === null ? St = Mt : vn.sibling = Mt, vn = Mt); + return on && li(Ie, jt), St; } for (Mt = h(Mt); jt < Ae.length; jt++) - gr = Le( + vr = Le( Mt, - _e, + Ie, jt, Ae[jt], Xe - ), gr !== null && (o && (yn = gr.alternate, yn !== null && Mt.delete(yn.key === null ? jt : yn.key)), Ce = w( - gr, - Ce, + ), vr !== null && (o && (Sn = vr.alternate, Sn !== null && Mt.delete(Sn.key === null ? jt : Sn.key)), we = w( + vr, + we, jt - ), gn === null ? bt = gr : gn.sibling = gr, gn = gr); - return o && Mt.forEach(function(as) { - return i(_e, as); - }), on && si(_e, jt), bt; + ), vn === null ? St = vr : vn.sibling = vr, vn = vr); + return o && Mt.forEach(function(is) { + return i(Ie, is); + }), on && li(Ie, jt), St; } - function $t(_e, Ce, Ae, Xe) { + function Et(Ie, we, Ae, Xe) { if (Ae == null) throw Error(r(151)); - for (var bt = null, gn = null, Mt = Ce, jt = Ce = 0, gr = null, yn = Ae.next(); Mt !== null && !yn.done; jt++, yn = Ae.next()) { - Mt.index > jt ? (gr = Mt, Mt = null) : gr = Mt.sibling; - var as = Pe(_e, Mt, yn.value, Xe); - if (as === null) { - Mt === null && (Mt = gr); + for (var St = null, vn = null, Mt = we, jt = we = 0, vr = null, Sn = Ae.next(); Mt !== null && !Sn.done; jt++, Sn = Ae.next()) { + Mt.index > jt ? (vr = Mt, Mt = null) : vr = Mt.sibling; + var is = Te(Ie, Mt, Sn.value, Xe); + if (is === null) { + Mt === null && (Mt = vr); break; } - o && Mt && as.alternate === null && i(_e, Mt), Ce = w(as, Ce, jt), gn === null ? bt = as : gn.sibling = as, gn = as, Mt = gr; + o && Mt && is.alternate === null && i(Ie, Mt), we = w(is, we, jt), vn === null ? St = is : vn.sibling = is, vn = is, Mt = vr; } - if (yn.done) - return d(_e, Mt), on && si(_e, jt), bt; + if (Sn.done) + return d(Ie, Mt), on && li(Ie, jt), St; if (Mt === null) { - for (; !yn.done; jt++, yn = Ae.next()) - yn = Ye(_e, yn.value, Xe), yn !== null && (Ce = w(yn, Ce, jt), gn === null ? bt = yn : gn.sibling = yn, gn = yn); - return on && si(_e, jt), bt; - } - for (Mt = h(Mt); !yn.done; jt++, yn = Ae.next()) - yn = Le(Mt, _e, jt, yn.value, Xe), yn !== null && (o && (gr = yn.alternate, gr !== null && Mt.delete( - gr.key === null ? jt : gr.key - )), Ce = w(yn, Ce, jt), gn === null ? bt = yn : gn.sibling = yn, gn = yn); - return o && Mt.forEach(function(wU) { - return i(_e, wU); - }), on && si(_e, jt), bt; - } - function Yt(_e, Ce, Ae, Xe) { - if (typeof Ae == "object" && Ae !== null && Ae.type === z && Ae.key === null && Ae.props.ref === void 0 && (Ae = Ae.props.children), typeof Ae == "object" && Ae !== null) { + for (; !Sn.done; jt++, Sn = Ae.next()) + Sn = Ye(Ie, Sn.value, Xe), Sn !== null && (we = w(Sn, we, jt), vn === null ? St = Sn : vn.sibling = Sn, vn = Sn); + return on && li(Ie, jt), St; + } + for (Mt = h(Mt); !Sn.done; jt++, Sn = Ae.next()) + Sn = Le(Mt, Ie, jt, Sn.value, Xe), Sn !== null && (o && (vr = Sn.alternate, vr !== null && Mt.delete( + vr.key === null ? jt : vr.key + )), we = w(Sn, we, jt), vn === null ? St = Sn : vn.sibling = Sn, vn = Sn); + return o && Mt.forEach(function(zU) { + return i(Ie, zU); + }), on && li(Ie, jt), St; + } + function Yt(Ie, we, Ae, Xe) { + if (typeof Ae == "object" && Ae !== null && Ae.type === M && Ae.key === null && Ae.props.ref === void 0 && (Ae = Ae.props.children), typeof Ae == "object" && Ae !== null) { switch (Ae.$$typeof) { - case T: + case N: e: { - for (var bt = Ae.key; Ce !== null; ) { - if (Ce.key === bt) { - if (bt = Ae.type, bt === z) { - if (Ce.tag === 7) { + for (var St = Ae.key; we !== null; ) { + if (we.key === St) { + if (St = Ae.type, St === M) { + if (we.tag === 7) { d( - _e, - Ce.sibling + Ie, + we.sibling ), Xe = x( - Ce, + we, Ae.props.children - ), Fi(Xe, Ae), Xe.return = _e, _e = Xe; + ), Bi(Xe, Ae), Xe.return = Ie, Ie = Xe; break e; } - } else if (Ce.elementType === bt || typeof bt == "object" && bt !== null && bt.$$typeof === K && Hs(bt) === Ce.type) { + } else if (we.elementType === St || typeof St == "object" && St !== null && St.$$typeof === K && Us(St) === we.type) { d( - _e, - Ce.sibling - ), Xe = x(Ce, Ae.props), Fi(Xe, Ae), Xe.return = _e, _e = Xe; + Ie, + we.sibling + ), Xe = x(we, Ae.props), Bi(Xe, Ae), Xe.return = Ie, Ie = Xe; break e; } - d(_e, Ce); + d(Ie, we); break; - } else i(_e, Ce); - Ce = Ce.sibling; + } else i(Ie, we); + we = we.sibling; } - Ae.type === z ? (Xe = Ds( + Ae.type === M ? (Xe = Os( Ae.props.children, - _e.mode, + Ie.mode, Xe, Ae.key - ), Fi(Xe, Ae), Xe.return = _e, _e = Xe) : (Xe = wp( + ), Bi(Xe, Ae), Xe.return = Ie, Ie = Xe) : (Xe = Tp( Ae.type, Ae.key, Ae.props, null, - _e.mode, + Ie.mode, Xe - ), Fi(Xe, Ae), Xe.return = _e, _e = Xe); + ), Bi(Xe, Ae), Xe.return = Ie, Ie = Xe); } - return j(_e); + return B(Ie); case A: e: { - for (bt = Ae.key; Ce !== null; ) { - if (Ce.key === bt) - if (Ce.tag === 4 && Ce.stateNode.containerInfo === Ae.containerInfo && Ce.stateNode.implementation === Ae.implementation) { + for (St = Ae.key; we !== null; ) { + if (we.key === St) + if (we.tag === 4 && we.stateNode.containerInfo === Ae.containerInfo && we.stateNode.implementation === Ae.implementation) { d( - _e, - Ce.sibling - ), Xe = x(Ce, Ae.children || []), Xe.return = _e, _e = Xe; + Ie, + we.sibling + ), Xe = x(we, Ae.children || []), Xe.return = Ie, Ie = Xe; break e; } else { - d(_e, Ce); + d(Ie, we); break; } - else i(_e, Ce); - Ce = Ce.sibling; + else i(Ie, we); + we = we.sibling; } - Xe = jb(Ae, _e.mode, Xe), Xe.return = _e, _e = Xe; + Xe = Vb(Ae, Ie.mode, Xe), Xe.return = Ie, Ie = Xe; } - return j(_e); + return B(Ie); case K: - return Ae = Hs(Ae), Yt( - _e, - Ce, + return Ae = Us(Ae), Yt( + Ie, + we, Ae, Xe ); } - if (Y(Ae)) - return ut( - _e, - Ce, + if (ae(Ae)) + return dt( + Ie, + we, Ae, Xe ); - if (re(Ae)) { - if (bt = re(Ae), typeof bt != "function") throw Error(r(150)); - return Ae = bt.call(Ae), $t( - _e, - Ce, + if (te(Ae)) { + if (St = te(Ae), typeof St != "function") throw Error(r(150)); + return Ae = St.call(Ae), Et( + Ie, + we, Ae, Xe ); } if (typeof Ae.then == "function") return Yt( - _e, - Ce, - Ap(Ae), + Ie, + we, + kp(Ae), Xe ); - if (Ae.$$typeof === U) + if (Ae.$$typeof === q) return Yt( - _e, - Ce, - _p(_e, Ae), + Ie, + we, + Ap(Ie, Ae), Xe ); - Dp(_e, Ae); + jp(Ie, Ae); } - return typeof Ae == "string" && Ae !== "" || typeof Ae == "number" || typeof Ae == "bigint" ? (Ae = "" + Ae, Ce !== null && Ce.tag === 6 ? (d(_e, Ce.sibling), Xe = x(Ce, Ae), Xe.return = _e, _e = Xe) : (d(_e, Ce), Xe = kb(Ae, _e.mode, Xe), Xe.return = _e, _e = Xe), j(_e)) : d(_e, Ce); + return typeof Ae == "string" && Ae !== "" || typeof Ae == "number" || typeof Ae == "bigint" ? (Ae = "" + Ae, we !== null && we.tag === 6 ? (d(Ie, we.sibling), Xe = x(we, Ae), Xe.return = Ie, Ie = Xe) : (d(Ie, we), Xe = Wb(Ae, Ie.mode, Xe), Xe.return = Ie, Ie = Xe), B(Ie)) : d(Ie, we); } - return function(_e, Ce, Ae, Xe) { + return function(Ie, we, Ae, Xe) { try { - Yu = 0; - var bt = Yt( - _e, - Ce, + Zu = 0; + var St = Yt( + Ie, + we, Ae, Xe ); - return ic = null, bt; + return sc = null, St; } catch (Mt) { - if (Mt === ac || Mt === Mp) throw Mt; - var gn = po(29, Mt, null, _e.mode); - return gn.lanes = Xe, gn.return = _e, gn; + if (Mt === ic || Mt === Op) throw Mt; + var vn = po(29, Mt, null, Ie.mode); + return vn.lanes = Xe, vn.return = Ie, vn; } }; } - var qs = OP(!0), LP = OP(!1), Bi = !1; - function Xb(o) { + var Ws = WP(!0), VP = WP(!1), Hi = !1; + function ny(o) { o.updateQueue = { baseState: o.memoizedState, firstBaseUpdate: null, @@ -3481,7 +3481,7 @@ Error generating stack: ` + h.message + ` callbacks: null }; } - function Qb(o, i) { + function ry(o, i) { o = o.updateQueue, i.updateQueue === o && (i.updateQueue = { baseState: o.baseState, firstBaseUpdate: o.firstBaseUpdate, @@ -3490,38 +3490,38 @@ Error generating stack: ` + h.message + ` callbacks: null }); } - function Hi(o) { + function Ui(o) { return { lane: o, tag: 0, payload: null, callback: null, next: null }; } - function Ui(o, i, d) { + function qi(o, i, d) { var h = o.updateQueue; if (h === null) return null; if (h = h.shared, (Pn & 2) !== 0) { var x = h.pending; - return x === null ? i.next = i : (i.next = x.next, x.next = i), h.pending = i, i = $p(o), SP(o, null, d), i; + return x === null ? i.next = i : (i.next = x.next, x.next = i), h.pending = i, i = Pp(o), NP(o, null, d), i; } - return Cp(o, h, i, d), $p(o); + return Rp(o, h, i, d), Pp(o); } - function Zu(o, i, d) { + function Ju(o, i, d) { if (i = i.updateQueue, i !== null && (i = i.shared, (d & 4194048) !== 0)) { var h = i.lanes; h &= o.pendingLanes, d |= h, i.lanes = d, Xt(o, d); } } - function Yb(o, i) { + function oy(o, i) { var d = o.updateQueue, h = o.alternate; if (h !== null && (h = h.updateQueue, d === h)) { var x = null, w = null; if (d = d.firstBaseUpdate, d !== null) { do { - var j = { + var B = { lane: d.lane, tag: d.tag, payload: d.payload, callback: null, next: null }; - w === null ? x = w = j : w = w.next = j, d = d.next; + w === null ? x = w = B : w = w.next = B, d = d.next; } while (d !== null); w === null ? x = w = i : w = w.next = i; } else x = w = i; @@ -3536,128 +3536,128 @@ Error generating stack: ` + h.message + ` } o = d.lastBaseUpdate, o === null ? d.firstBaseUpdate = i : o.next = i, d.lastBaseUpdate = i; } - var Zb = !1; - function Ju() { - if (Zb) { - var o = oc; + var ay = !1; + function ed() { + if (ay) { + var o = ac; if (o !== null) throw o; } } - function ed(o, i, d, h) { - Zb = !1; + function td(o, i, d, h) { + ay = !1; var x = o.updateQueue; - Bi = !1; - var w = x.firstBaseUpdate, j = x.lastBaseUpdate, ae = x.shared.pending; - if (ae !== null) { + Hi = !1; + var w = x.firstBaseUpdate, B = x.lastBaseUpdate, oe = x.shared.pending; + if (oe !== null) { x.shared.pending = null; - var ge = ae, Ie = ge.next; - ge.next = null, j === null ? w = Ie : j.next = Ie, j = ge; + var ve = oe, ze = ve.next; + ve.next = null, B === null ? w = ze : B.next = ze, B = ve; var je = o.alternate; - je !== null && (je = je.updateQueue, ae = je.lastBaseUpdate, ae !== j && (ae === null ? je.firstBaseUpdate = Ie : ae.next = Ie, je.lastBaseUpdate = ge)); + je !== null && (je = je.updateQueue, oe = je.lastBaseUpdate, oe !== B && (oe === null ? je.firstBaseUpdate = ze : oe.next = ze, je.lastBaseUpdate = ve)); } if (w !== null) { var Ye = x.baseState; - j = 0, je = Ie = ge = null, ae = w; + B = 0, je = ze = ve = null, oe = w; do { - var Pe = ae.lane & -536870913, Le = Pe !== ae.lane; - if (Le ? (hn & Pe) === Pe : (h & Pe) === Pe) { - Pe !== 0 && Pe === Fs && (Zb = !0), je !== null && (je = je.next = { + var Te = oe.lane & -536870913, Le = Te !== oe.lane; + if (Le ? (gn & Te) === Te : (h & Te) === Te) { + Te !== 0 && Te === Bs && (ay = !0), je !== null && (je = je.next = { lane: 0, - tag: ae.tag, - payload: ae.payload, + tag: oe.tag, + payload: oe.payload, callback: null, next: null }); e: { - var ut = o, $t = ae; - Pe = i; + var dt = o, Et = oe; + Te = i; var Yt = d; - switch ($t.tag) { + switch (Et.tag) { case 1: - if (ut = $t.payload, typeof ut == "function") { - Ye = ut.call(Yt, Ye, Pe); + if (dt = Et.payload, typeof dt == "function") { + Ye = dt.call(Yt, Ye, Te); break e; } - Ye = ut; + Ye = dt; break e; case 3: - ut.flags = ut.flags & -65537 | 128; + dt.flags = dt.flags & -65537 | 128; case 0: - if (ut = $t.payload, Pe = typeof ut == "function" ? ut.call(Yt, Ye, Pe) : ut, Pe == null) break e; - Ye = N({}, Ye, Pe); + if (dt = Et.payload, Te = typeof dt == "function" ? dt.call(Yt, Ye, Te) : dt, Te == null) break e; + Ye = _({}, Ye, Te); break e; case 2: - Bi = !0; + Hi = !0; } } - Pe = ae.callback, Pe !== null && (o.flags |= 64, Le && (o.flags |= 8192), Le = x.callbacks, Le === null ? x.callbacks = [Pe] : Le.push(Pe)); + Te = oe.callback, Te !== null && (o.flags |= 64, Le && (o.flags |= 8192), Le = x.callbacks, Le === null ? x.callbacks = [Te] : Le.push(Te)); } else Le = { - lane: Pe, - tag: ae.tag, - payload: ae.payload, - callback: ae.callback, + lane: Te, + tag: oe.tag, + payload: oe.payload, + callback: oe.callback, next: null - }, je === null ? (Ie = je = Le, ge = Ye) : je = je.next = Le, j |= Pe; - if (ae = ae.next, ae === null) { - if (ae = x.shared.pending, ae === null) + }, je === null ? (ze = je = Le, ve = Ye) : je = je.next = Le, B |= Te; + if (oe = oe.next, oe === null) { + if (oe = x.shared.pending, oe === null) break; - Le = ae, ae = Le.next, Le.next = null, x.lastBaseUpdate = Le, x.shared.pending = null; + Le = oe, oe = Le.next, Le.next = null, x.lastBaseUpdate = Le, x.shared.pending = null; } } while (!0); - je === null && (ge = Ye), x.baseState = ge, x.firstBaseUpdate = Ie, x.lastBaseUpdate = je, w === null && (x.shared.lanes = 0), Qi |= j, o.lanes = j, o.memoizedState = Ye; + je === null && (ve = Ye), x.baseState = ve, x.firstBaseUpdate = ze, x.lastBaseUpdate = je, w === null && (x.shared.lanes = 0), Yi |= B, o.lanes = B, o.memoizedState = Ye; } } - function kP(o, i) { + function KP(o, i) { if (typeof o != "function") throw Error(r(191, o)); o.call(i); } - function jP(o, i) { + function GP(o, i) { var d = o.callbacks; if (d !== null) for (o.callbacks = null, o = 0; o < d.length; o++) - kP(d[o], i); + KP(d[o], i); } - var qi = oe(null), Op = oe(0); - function FP(o, i) { - o = pi, Z(Op, o), Z(qi, i), pi = o | i.baseLanes; + var Wi = ne(null), Fp = ne(0); + function XP(o, i) { + o = hi, le(Fp, o), le(Wi, i), hi = o | i.baseLanes; } - function Jb() { - Z(Op, pi), Z(qi, qi.current); + function iy() { + le(Fp, hi), le(Wi, Wi.current); } - function ey() { - pi = Op.current, ce(qi), ce(Op); + function sy() { + hi = Fp.current, ue(Wi), ue(Fp); } - var Br = oe(null), Zr = null; - function Wi(o) { + var Hr = ne(null), Jr = null; + function Vi(o) { var i = o.alternate; - Z(Hr, Hr.current & 1), Z(Br, o), Zr === null && (i === null || qi.current !== null || i.memoizedState !== null) && (Zr = o); + le(Ur, Ur.current & 1), le(Hr, o), Jr === null && (i === null || Wi.current !== null || i.memoizedState !== null) && (Jr = o); } - function ty(o) { - Z(Hr, Hr.current), Z(Br, o), Zr === null && (Zr = o); + function ly(o) { + le(Ur, Ur.current), le(Hr, o), Jr === null && (Jr = o); } - function BP(o) { - o.tag === 22 ? (Z(Hr, Hr.current), Z(Br, o), Zr === null && (Zr = o)) : Vi(); + function QP(o) { + o.tag === 22 ? (le(Ur, Ur.current), le(Hr, o), Jr === null && (Jr = o)) : Ki(); } - function Vi() { - Z(Hr, Hr.current), Z(Br, Br.current); + function Ki() { + le(Ur, Ur.current), le(Hr, Hr.current); } function To(o) { - ce(Br), Zr === o && (Zr = null), ce(Hr); + ue(Hr), Jr === o && (Jr = null), ue(Ur); } - var Hr = oe(0); - function td(o, i) { - Z(Br, Br.current), Z(Hr, i); + var Ur = ne(0); + function nd(o, i) { + le(Hr, Hr.current), le(Ur, i); } - function ny(o) { - ce(Hr), ce(Br), Zr === o && (Zr = null); + function cy(o) { + ue(Ur), ue(Hr), Jr === o && (Jr = null); } - function Lp(o) { + function Bp(o) { for (var i = o; i !== null; ) { if (i.tag === 13) { var d = i.memoizedState; - if (d !== null && (d = d.dehydrated, d === null || wS(d) || ES(d))) + if (d !== null && (d = d.dehydrated, d === null || IS(d) || zS(d))) return i; } else if (i.tag === 19 && i.memoizedProps.revealOrder !== "independent") { if ((i.flags & 128) !== 0) return i; @@ -3674,63 +3674,63 @@ Error generating stack: ` + h.message + ` } return null; } - var ui = 0, Qt = null, jn = null, pr = null, kp = !1, sc = !1, Ws = !1, jp = 0, nd = 0, lc = null, W6 = 0; + var di = 0, Qt = null, jn = null, hr = null, Hp = !1, lc = !1, Vs = !1, Up = 0, rd = 0, cc = null, J6 = 0; function or() { throw Error(r(321)); } - function ry(o, i) { + function uy(o, i) { if (i === null) return !1; for (var d = 0; d < i.length && d < o.length; d++) if (!Po(o[d], i[d])) return !1; return !0; } - function oy(o, i, d, h, x, w) { - return ui = w, Qt = i, i.memoizedState = null, i.updateQueue = null, i.lanes = 0, q.H = o === null || o.memoizedState === null ? wT : ET, Ws = !1, w = d(h, x), Ws = !1, sc && (w = UP( + function dy(o, i, d, h, x, w) { + return di = w, Qt = i, i.memoizedState = null, i.updateQueue = null, i.lanes = 0, X.H = o === null || o.memoizedState === null ? MT : AT, Vs = !1, w = d(h, x), Vs = !1, lc && (w = ZP( i, d, h, x - )), HP(o), w; + )), YP(o), w; } - function HP(o) { - q.H = Vp; + function YP(o) { + X.H = Qp; var i = jn !== null && jn.next !== null; - if (ui = 0, pr = jn = Qt = null, kp = !1, nd = 0, lc = null, i) throw Error(r(300)); - o === null || hr || (o = o.dependencies, o !== null && Np(o) && (hr = !0)); + if (di = 0, hr = jn = Qt = null, Hp = !1, rd = 0, cc = null, i) throw Error(r(300)); + o === null || gr || (o = o.dependencies, o !== null && Mp(o) && (gr = !0)); } - function UP(o, i, d, h) { + function ZP(o, i, d, h) { Qt = o; var x = 0; do { - if (sc && (lc = null), nd = 0, sc = !1, 25 <= x) throw Error(r(301)); - if (x += 1, pr = jn = null, o.updateQueue != null) { + if (lc && (cc = null), rd = 0, lc = !1, 25 <= x) throw Error(r(301)); + if (x += 1, hr = jn = null, o.updateQueue != null) { var w = o.updateQueue; w.lastEffect = null, w.events = null, w.stores = null, w.memoCache != null && (w.memoCache.index = 0); } - q.H = J6, w = i(d, h); - } while (sc); + X.H = s5, w = i(d, h); + } while (lc); return w; } - function V6() { - var o = q.H, i = o.useState()[0]; - return i = typeof i.then == "function" ? rd(i) : i, o = o.useState()[0], (jn !== null ? jn.memoizedState : null) !== o && (Qt.flags |= 1024), i; + function e5() { + var o = X.H, i = o.useState()[0]; + return i = typeof i.then == "function" ? od(i) : i, o = o.useState()[0], (jn !== null ? jn.memoizedState : null) !== o && (Qt.flags |= 1024), i; } - function ay() { - var o = jp !== 0; - return jp = 0, o; + function fy() { + var o = Up !== 0; + return Up = 0, o; } - function iy(o, i, d) { + function my(o, i, d) { i.updateQueue = o.updateQueue, i.flags &= -2053, o.lanes &= ~d; } - function sy(o) { - if (kp) { + function py(o) { + if (Hp) { for (o = o.memoizedState; o !== null; ) { var i = o.queue; i !== null && (i.pending = null), o = o.next; } - kp = !1; + Hp = !1; } - ui = 0, pr = jn = Qt = null, sc = !1, nd = jp = 0, lc = null; + di = 0, hr = jn = Qt = null, lc = !1, rd = Up = 0, cc = null; } function so() { var o = { @@ -3740,16 +3740,16 @@ Error generating stack: ` + h.message + ` queue: null, next: null }; - return pr === null ? Qt.memoizedState = pr = o : pr = pr.next = o, pr; + return hr === null ? Qt.memoizedState = hr = o : hr = hr.next = o, hr; } - function cr() { + function ur() { if (jn === null) { var o = Qt.alternate; o = o !== null ? o.memoizedState : null; } else o = jn.next; - var i = pr === null ? Qt.memoizedState : pr.next; + var i = hr === null ? Qt.memoizedState : hr.next; if (i !== null) - pr = i, jn = o; + hr = i, jn = o; else { if (o === null) throw Qt.alternate === null ? Error(r(467)) : Error(r(310)); @@ -3759,26 +3759,26 @@ Error generating stack: ` + h.message + ` baseQueue: jn.baseQueue, queue: jn.queue, next: null - }, pr === null ? Qt.memoizedState = pr = o : pr = pr.next = o; + }, hr === null ? Qt.memoizedState = hr = o : hr = hr.next = o; } - return pr; + return hr; } - function Fp() { + function qp() { return { lastEffect: null, events: null, stores: null, memoCache: null }; } - function rd(o) { - var i = nd; - return nd += 1, lc === null && (lc = []), o = zP(lc, o, i), i = Qt, (pr === null ? i.memoizedState : pr.next) === null && (i = i.alternate, q.H = i === null || i.memoizedState === null ? wT : ET), o; + function od(o) { + var i = rd; + return rd += 1, cc === null && (cc = []), o = HP(cc, o, i), i = Qt, (hr === null ? i.memoizedState : hr.next) === null && (i = i.alternate, X.H = i === null || i.memoizedState === null ? MT : AT), o; } - function Bp(o) { + function Wp(o) { if (o !== null && typeof o == "object") { - if (typeof o.then == "function") return rd(o); - if (o.$$typeof === B) return; - if (o.$$typeof === U) return Fr(o); + if (typeof o.then == "function") return od(o); + if (o.$$typeof === j) return; + if (o.$$typeof === q) return Br(o); } throw Error(r(438, String(o))); } - function ly(o) { + function hy(o) { var i = null, d = Qt.updateQueue; if (d !== null && (i = d.memoCache), i == null) { var h = Qt.alternate; @@ -3789,130 +3789,130 @@ Error generating stack: ` + h.message + ` index: 0 }))); } - if (i == null && (i = { data: [], index: 0 }), d === null && (d = Fp(), Qt.updateQueue = d), d.memoCache = i, d = i.data[i.index], d === void 0) + if (i == null && (i = { data: [], index: 0 }), d === null && (d = qp(), Qt.updateQueue = d), d.memoCache = i, d = i.data[i.index], d === void 0) for (d = i.data[i.index] = Array(o), h = 0; h < o; h++) - d[h] = Q; + d[h] = H; return i.index++, d; } - function di(o, i) { + function fi(o, i) { return typeof i == "function" ? i(o) : i; } - function Hp(o) { - var i = cr(); - return cy(i, jn, o); + function Vp(o) { + var i = ur(); + return gy(i, jn, o); } - function cy(o, i, d) { + function gy(o, i, d) { var h = o.queue; if (h === null) throw Error(r(311)); h.lastRenderedReducer = d; var x = o.baseQueue, w = h.pending; if (w !== null) { if (x !== null) { - var j = x.next; - x.next = w.next, w.next = j; + var B = x.next; + x.next = w.next, w.next = B; } i.baseQueue = x = w, h.pending = null; } if (w = o.baseState, x === null) o.memoizedState = w; else { i = x.next; - var ae = j = null, ge = null, Ie = i, je = !1; + var oe = B = null, ve = null, ze = i, je = !1; do { - var Ye = Ie.lane & -536870913; - if (Ye !== Ie.lane ? (hn & Ye) === Ye : (ui & Ye) === Ye) { - var Pe = Ie.revertLane; - if (Pe === 0) - ge !== null && (ge = ge.next = { + var Ye = ze.lane & -536870913; + if (Ye !== ze.lane ? (gn & Ye) === Ye : (di & Ye) === Ye) { + var Te = ze.revertLane; + if (Te === 0) + ve !== null && (ve = ve.next = { lane: 0, revertLane: 0, gesture: null, - action: Ie.action, - hasEagerState: Ie.hasEagerState, - eagerState: Ie.eagerState, + action: ze.action, + hasEagerState: ze.hasEagerState, + eagerState: ze.eagerState, next: null - }), Ye === Fs && (je = !0); - else if ((ui & Pe) === Pe) { - Ie = Ie.next, Pe === Fs && (je = !0); + }), Ye === Bs && (je = !0); + else if ((di & Te) === Te) { + ze = ze.next, Te === Bs && (je = !0); continue; } else Ye = { lane: 0, - revertLane: Ie.revertLane, + revertLane: ze.revertLane, gesture: null, - action: Ie.action, - hasEagerState: Ie.hasEagerState, - eagerState: Ie.eagerState, + action: ze.action, + hasEagerState: ze.hasEagerState, + eagerState: ze.eagerState, next: null - }, ge === null ? (ae = ge = Ye, j = w) : ge = ge.next = Ye, Qt.lanes |= Pe, Qi |= Pe; - Ye = Ie.action, Ws && d(w, Ye), w = Ie.hasEagerState ? Ie.eagerState : d(w, Ye); + }, ve === null ? (oe = ve = Ye, B = w) : ve = ve.next = Ye, Qt.lanes |= Te, Yi |= Te; + Ye = ze.action, Vs && d(w, Ye), w = ze.hasEagerState ? ze.eagerState : d(w, Ye); } else - Pe = { + Te = { lane: Ye, - revertLane: Ie.revertLane, - gesture: Ie.gesture, - action: Ie.action, - hasEagerState: Ie.hasEagerState, - eagerState: Ie.eagerState, + revertLane: ze.revertLane, + gesture: ze.gesture, + action: ze.action, + hasEagerState: ze.hasEagerState, + eagerState: ze.eagerState, next: null - }, ge === null ? (ae = ge = Pe, j = w) : ge = ge.next = Pe, Qt.lanes |= Ye, Qi |= Ye; - Ie = Ie.next; - } while (Ie !== null && Ie !== i); - if (ge === null ? j = w : ge.next = ae, !Po(w, o.memoizedState) && (hr = !0, je && (d = oc, d !== null))) + }, ve === null ? (oe = ve = Te, B = w) : ve = ve.next = Te, Qt.lanes |= Ye, Yi |= Ye; + ze = ze.next; + } while (ze !== null && ze !== i); + if (ve === null ? B = w : ve.next = oe, !Po(w, o.memoizedState) && (gr = !0, je && (d = ac, d !== null))) throw d; - o.memoizedState = w, o.baseState = j, o.baseQueue = ge, h.lastRenderedState = w; + o.memoizedState = w, o.baseState = B, o.baseQueue = ve, h.lastRenderedState = w; } return x === null && (h.lanes = 0), [o.memoizedState, h.dispatch]; } - function uy(o) { - var i = cr(), d = i.queue; + function vy(o) { + var i = ur(), d = i.queue; if (d === null) throw Error(r(311)); d.lastRenderedReducer = o; var h = d.dispatch, x = d.pending, w = i.memoizedState; if (x !== null) { d.pending = null; - var j = x = x.next; + var B = x = x.next; do - w = o(w, j.action), j = j.next; - while (j !== x); - Po(w, i.memoizedState) || (hr = !0), i.memoizedState = w, i.baseQueue === null && (i.baseState = w), d.lastRenderedState = w; + w = o(w, B.action), B = B.next; + while (B !== x); + Po(w, i.memoizedState) || (gr = !0), i.memoizedState = w, i.baseQueue === null && (i.baseState = w), d.lastRenderedState = w; } return [w, h]; } - function qP(o, i, d) { - var h = Qt, x = cr(), w = on; + function JP(o, i, d) { + var h = Qt, x = ur(), w = on; if (w) { if (d === void 0) throw Error(r(407)); d = d(); } else d = i(); - var j = !Po( + var B = !Po( (jn || x).memoizedState, d ); - if (j && (x.memoizedState = d, hr = !0), x = x.queue, my(KP.bind(null, h, x, o), [ + if (B && (x.memoizedState = d, gr = !0), x = x.queue, Sy(nT.bind(null, h, x, o), [ o - ]), o = x.getSnapshot !== i || j || pr !== null && (pr.memoizedState.tag & 1) !== 0, cc( + ]), o = x.getSnapshot !== i || B || hr !== null && (hr.memoizedState.tag & 1) !== 0, uc( o ? 9 : 8, { destroy: void 0 }, - VP.bind(null, h, x, d, i), + tT.bind(null, h, x, d, i), null ), o) { if (h.flags |= 2048, Vn === null) throw Error(r(349)); - w || (ui & 127) !== 0 || WP(h, i, d); + w || (di & 127) !== 0 || eT(h, i, d); } return d; } - function WP(o, i, d) { - o.flags |= 16384, o = { getSnapshot: i, value: d }, i = Qt.updateQueue, i === null ? (i = Fp(), Qt.updateQueue = i, i.stores = [o]) : (d = i.stores, d === null ? i.stores = [o] : d.push(o)); + function eT(o, i, d) { + o.flags |= 16384, o = { getSnapshot: i, value: d }, i = Qt.updateQueue, i === null ? (i = qp(), Qt.updateQueue = i, i.stores = [o]) : (d = i.stores, d === null ? i.stores = [o] : d.push(o)); } - function VP(o, i, d, h) { - i.value = d, i.getSnapshot = h, GP(i) && XP(o); + function tT(o, i, d, h) { + i.value = d, i.getSnapshot = h, rT(i) && oT(o); } - function KP(o, i, d) { + function nT(o, i, d) { return d(function() { - GP(i) && XP(o); + rT(i) && oT(o); }); } - function GP(o) { + function rT(o) { var i = o.getSnapshot; o = o.value; try { @@ -3922,20 +3922,20 @@ Error generating stack: ` + h.message + ` return !0; } } - function XP(o) { - var i = As(o, 2); + function oT(o) { + var i = Ds(o, 2); i !== null && bo(i, o, 2); } - function dy(o) { + function by(o) { var i = so(); if (typeof o == "function") { var d = o; - if (o = d(), Ws) { - Re(!0); + if (o = d(), Vs) { + Pe(!0); try { d(); } finally { - Re(!1); + Pe(!1); } } } @@ -3943,19 +3943,19 @@ Error generating stack: ` + h.message + ` pending: null, lanes: 0, dispatch: null, - lastRenderedReducer: di, + lastRenderedReducer: fi, lastRenderedState: o }, i; } - function QP(o, i, d, h) { - return o.baseState = d, cy( + function aT(o, i, d, h) { + return o.baseState = d, gy( o, jn, - typeof h == "function" ? h : di + typeof h == "function" ? h : fi ); } - function K6(o, i, d, h, x) { - if (Wp(o)) throw Error(r(485)); + function t5(o, i, d, h, x) { + if (Xp(o)) throw Error(r(485)); if (o = i.action, o !== null) { var w = { payload: x, @@ -3966,64 +3966,64 @@ Error generating stack: ` + h.message + ` value: null, reason: null, listeners: [], - then: function(j) { - w.listeners.push(j); + then: function(B) { + w.listeners.push(B); } }; - q.T !== null ? d(!0) : w.isTransition = !1, h(w), d = i.pending, d === null ? (w.next = i.pending = w, YP(i, w)) : (w.next = d.next, i.pending = d.next = w); + X.T !== null ? d(!0) : w.isTransition = !1, h(w), d = i.pending, d === null ? (w.next = i.pending = w, iT(i, w)) : (w.next = d.next, i.pending = d.next = w); } } - function YP(o, i) { + function iT(o, i) { var d = i.action, h = i.payload, x = o.state; if (i.isTransition) { - var w = q.T, j = {}; - j.types = w !== null ? w.types : null, q.T = j; + var w = X.T, B = {}; + B.types = w !== null ? w.types : null, X.T = B; try { - var ae = d(x, h), ge = q.S; - ge !== null && ge(j, ae), ZP(o, i, ae); - } catch (Ie) { - fy(o, i, Ie); + var oe = d(x, h), ve = X.S; + ve !== null && ve(B, oe), sT(o, i, oe); + } catch (ze) { + yy(o, i, ze); } finally { - w !== null && j.types !== null && (w.types = j.types), q.T = w; + w !== null && B.types !== null && (w.types = B.types), X.T = w; } } else try { - w = d(x, h), ZP(o, i, w); - } catch (Ie) { - fy(o, i, Ie); + w = d(x, h), sT(o, i, w); + } catch (ze) { + yy(o, i, ze); } } - function ZP(o, i, d) { + function sT(o, i, d) { d !== null && typeof d == "object" && typeof d.then == "function" ? d.then( function(h) { - JP(o, i, h); + lT(o, i, h); }, function(h) { - return fy(o, i, h); + return yy(o, i, h); } - ) : JP(o, i, d); + ) : lT(o, i, d); } - function JP(o, i, d) { - i.status = "fulfilled", i.value = d, eT(i), o.state = d, i = o.pending, i !== null && (d = i.next, d === i ? o.pending = null : (d = d.next, i.next = d, YP(o, d))); + function lT(o, i, d) { + i.status = "fulfilled", i.value = d, cT(i), o.state = d, i = o.pending, i !== null && (d = i.next, d === i ? o.pending = null : (d = d.next, i.next = d, iT(o, d))); } - function fy(o, i, d) { + function yy(o, i, d) { var h = o.pending; if (o.pending = null, h !== null) { h = h.next; do - i.status = "rejected", i.reason = d, eT(i), i = i.next; + i.status = "rejected", i.reason = d, cT(i), i = i.next; while (i !== h); } o.action = null; } - function eT(o) { + function cT(o) { o = o.listeners; for (var i = 0; i < o.length; i++) (0, o[i])(); } - function tT(o, i) { + function uT(o, i) { return i; } - function nT(o, i) { + function dT(o, i) { if (on) { var d = Vn.formState; if (d !== null) { @@ -4032,12 +4032,12 @@ Error generating stack: ` + h.message + ` if (on) { if (Gn) { t: { - for (var x = Gn, w = Ko; x.nodeType !== 8; ) { + for (var x = Gn, w = Go; x.nodeType !== 8; ) { if (!w) { x = null; break t; } - if (x = Xo( + if (x = Qo( x.nextSibling ), x === null) { x = null; @@ -4047,13 +4047,13 @@ Error generating stack: ` + h.message + ` w = x.data, x = w === "F!" || w === "F" ? x : null; } if (x) { - Gn = Xo( + Gn = Qo( x.nextSibling ), h = x.data === "F!"; break e; } } - ki(h); + ji(h); } h = !1; } @@ -4064,13 +4064,13 @@ Error generating stack: ` + h.message + ` pending: null, lanes: 0, dispatch: null, - lastRenderedReducer: tT, + lastRenderedReducer: uT, lastRenderedState: i - }, d.queue = h, d = xT.bind( + }, d.queue = h, d = _T.bind( null, Qt, h - ), h.dispatch = d, h = dy(!1), w = by.bind( + ), h.dispatch = d, h = by(!1), w = Ey.bind( null, Qt, !1, @@ -4080,7 +4080,7 @@ Error generating stack: ` + h.message + ` dispatch: null, action: o, pending: null - }, h.queue = x, d = K6.bind( + }, h.queue = x, d = t5.bind( null, Qt, x, @@ -4088,98 +4088,98 @@ Error generating stack: ` + h.message + ` d ), x.dispatch = d, h.memoizedState = o, [i, d, !1]; } - function rT(o) { - var i = cr(); - return oT(i, jn, o); + function fT(o) { + var i = ur(); + return mT(i, jn, o); } - function oT(o, i, d) { - if (i = cy( + function mT(o, i, d) { + if (i = gy( o, i, - tT - )[0], o = Hp(di)[0], typeof i == "object" && i !== null && typeof i.then == "function") + uT + )[0], o = Vp(fi)[0], typeof i == "object" && i !== null && typeof i.then == "function") try { - var h = rd(i); - } catch (j) { - throw j === ac ? Mp : j; + var h = od(i); + } catch (B) { + throw B === ic ? Op : B; } else h = i; - i = cr(); + i = ur(); var x = i.queue, w = x.dispatch; - return d !== i.memoizedState && (Qt.flags |= 2048, cc( + return d !== i.memoizedState && (Qt.flags |= 2048, uc( 9, { destroy: void 0 }, - G6.bind(null, x, d), + n5.bind(null, x, d), null )), [h, w, o]; } - function G6(o, i) { + function n5(o, i) { o.action = i; } - function aT(o) { - var i = cr(), d = jn; + function pT(o) { + var i = ur(), d = jn; if (d !== null) - return oT(i, d, o); - cr(), i = i.memoizedState, d = cr(); + return mT(i, d, o); + ur(), i = i.memoizedState, d = ur(); var h = d.queue.dispatch; return d.memoizedState = o, [i, h, !1]; } - function cc(o, i, d, h) { - return o = { tag: o, create: d, deps: h, inst: i, next: null }, i = Qt.updateQueue, i === null && (i = Fp(), Qt.updateQueue = i), d = i.lastEffect, d === null ? i.lastEffect = o.next = o : (h = d.next, d.next = o, o.next = h, i.lastEffect = o), o; + function uc(o, i, d, h) { + return o = { tag: o, create: d, deps: h, inst: i, next: null }, i = Qt.updateQueue, i === null && (i = qp(), Qt.updateQueue = i), d = i.lastEffect, d === null ? i.lastEffect = o.next = o : (h = d.next, d.next = o, o.next = h, i.lastEffect = o), o; } - function iT() { - return cr().memoizedState; + function hT() { + return ur().memoizedState; } - function Up(o, i, d, h) { + function Kp(o, i, d, h) { var x = so(); - Qt.flags |= o, x.memoizedState = cc( + Qt.flags |= o, x.memoizedState = uc( 1 | i, { destroy: void 0 }, d, h === void 0 ? null : h ); } - function qp(o, i, d, h) { - var x = cr(); + function Gp(o, i, d, h) { + var x = ur(); h = h === void 0 ? null : h; var w = x.memoizedState.inst; - jn !== null && h !== null && ry(h, jn.memoizedState.deps) ? x.memoizedState = cc(i, w, d, h) : (Qt.flags |= o, x.memoizedState = cc( + jn !== null && h !== null && uy(h, jn.memoizedState.deps) ? x.memoizedState = uc(i, w, d, h) : (Qt.flags |= o, x.memoizedState = uc( 1 | i, w, d, h )); } - function sT(o, i) { - Up(8390656, 8, o, i); + function gT(o, i) { + Kp(8390656, 8, o, i); } - function my(o, i) { - qp(2048, 8, o, i); + function Sy(o, i) { + Gp(2048, 8, o, i); } - function X6(o) { + function r5(o) { Qt.flags |= 4; var i = Qt.updateQueue; if (i === null) - i = Fp(), Qt.updateQueue = i, i.events = [o]; + i = qp(), Qt.updateQueue = i, i.events = [o]; else { var d = i.events; d === null ? i.events = [o] : d.push(o); } } - function lT(o) { - var i = cr().memoizedState; - return X6({ ref: i, nextImpl: o }), function() { + function vT(o) { + var i = ur().memoizedState; + return r5({ ref: i, nextImpl: o }), function() { if ((Pn & 2) !== 0) throw Error(r(440)); return i.impl.apply(void 0, arguments); }; } - function cT(o, i) { - return qp(4, 2, o, i); + function bT(o, i) { + return Gp(4, 2, o, i); } - function uT(o, i) { - return qp(4, 4, o, i); + function yT(o, i) { + return Gp(4, 4, o, i); } - function dT(o, i) { + function ST(o, i) { if (typeof i == "function") { o = o(); var d = i(o); @@ -4192,104 +4192,104 @@ Error generating stack: ` + h.message + ` i.current = null; }; } - function fT(o, i, d) { - d = d != null ? d.concat([o]) : null, qp(4, 4, dT.bind(null, i, o), d); + function xT(o, i, d) { + d = d != null ? d.concat([o]) : null, Gp(4, 4, ST.bind(null, i, o), d); } - function py() { + function xy() { } - function mT(o, i) { - var d = cr(); + function CT(o, i) { + var d = ur(); i = i === void 0 ? null : i; var h = d.memoizedState; - return i !== null && ry(i, h[1]) ? h[0] : (d.memoizedState = [o, i], o); + return i !== null && uy(i, h[1]) ? h[0] : (d.memoizedState = [o, i], o); } - function pT(o, i) { - var d = cr(); + function $T(o, i) { + var d = ur(); i = i === void 0 ? null : i; var h = d.memoizedState; - if (i !== null && ry(i, h[1])) + if (i !== null && uy(i, h[1])) return h[0]; - if (h = o(), Ws) { - Re(!0); + if (h = o(), Vs) { + Pe(!0); try { o(); } finally { - Re(!1); + Pe(!1); } } return d.memoizedState = [h, i], h; } - function hy(o, i, d) { - return d === void 0 || (ui & 1073741824) !== 0 && (hn & 261930) === 0 ? o.memoizedState = i : (o.memoizedState = d, o = wN(), Qt.lanes |= o, Qi |= o, d); + function Cy(o, i, d) { + return d === void 0 || (di & 1073741824) !== 0 && (gn & 261930) === 0 ? o.memoizedState = i : (o.memoizedState = d, o = MN(), Qt.lanes |= o, Yi |= o, d); } - function hT(o, i, d, h) { - return Po(d, i) ? d : qi.current !== null ? (o = hy(o, d, h), Po(o, i) || (hr = !0), o) : (ui & 106) === 0 || (ui & 1073741824) !== 0 && (hn & 261930) === 0 ? (hr = !0, o.memoizedState = d) : (o = wN(), Qt.lanes |= o, Qi |= o, i); + function wT(o, i, d, h) { + return Po(d, i) ? d : Wi.current !== null ? (o = Cy(o, d, h), Po(o, i) || (gr = !0), o) : (di & 106) === 0 || (di & 1073741824) !== 0 && (gn & 261930) === 0 ? (gr = !0, o.memoizedState = d) : (o = MN(), Qt.lanes |= o, Yi |= o, i); } - function gT(o, i, d, h, x) { - var w = te.p; - te.p = w !== 0 && 8 > w ? w : 8; - var j = q.T, ae = {}; - ae.types = j !== null ? j.types : null, q.T = ae, by(o, !1, i, d); + function ET(o, i, d, h, x) { + var w = J.p; + J.p = w !== 0 && 8 > w ? w : 8; + var B = X.T, oe = {}; + oe.types = B !== null ? B.types : null, X.T = oe, Ey(o, !1, i, d); try { - var ge = x(), Ie = q.S; - if (Ie !== null && Ie(ae, ge), ge !== null && typeof ge == "object" && typeof ge.then == "function") { - var je = q6( - ge, + var ve = x(), ze = X.S; + if (ze !== null && ze(oe, ve), ve !== null && typeof ve == "object" && typeof ve.then == "function") { + var je = Z6( + ve, h ); - od( + ad( o, i, je, - Mo(o) + zo(o) ); } else - od( + ad( o, i, h, - Mo(o) + zo(o) ); } catch (Ye) { - od( + ad( o, i, { then: function() { }, status: "rejected", reason: Ye }, - Mo() + zo() ); } finally { - te.p = w, j !== null && ae.types !== null && (j.types = ae.types), q.T = j; + J.p = w, B !== null && oe.types !== null && (B.types = oe.types), X.T = B; } } - function Q6() { + function o5() { } - function gy(o, i, d, h) { + function $y(o, i, d, h) { if (o.tag !== 5) throw Error(r(476)); - var x = vT(o).queue; - gT( + var x = RT(o).queue; + ET( o, x, i, - de, - d === null ? Q6 : function() { - return bT(o), d(h); + me, + d === null ? o5 : function() { + return PT(o), d(h); } ); } - function vT(o) { + function RT(o) { var i = o.memoizedState; if (i !== null) return i; i = { - memoizedState: de, - baseState: de, + memoizedState: me, + baseState: me, baseQueue: null, queue: { pending: null, lanes: 0, dispatch: null, - lastRenderedReducer: di, - lastRenderedState: de + lastRenderedReducer: fi, + lastRenderedState: me }, next: null }; @@ -4302,46 +4302,46 @@ Error generating stack: ` + h.message + ` pending: null, lanes: 0, dispatch: null, - lastRenderedReducer: di, + lastRenderedReducer: fi, lastRenderedState: d }, next: null }, o.memoizedState = i, o = o.alternate, o !== null && (o.memoizedState = i), i; } - function bT(o) { - var i = vT(o); - i.next === null && (i = o.alternate.memoizedState), od( + function PT(o) { + var i = RT(o); + i.next === null && (i = o.alternate.memoizedState), ad( o, i.next.queue, {}, - Mo() + zo() ); } - function vy() { - return Fr(Tc); + function wy() { + return Br(Nc); } - function yT() { - return cr().memoizedState; + function TT() { + return ur().memoizedState; } - function ST() { - return cr().memoizedState; + function NT() { + return ur().memoizedState; } - function Y6(o) { + function a5(o) { for (var i = o.return; i !== null; ) { switch (i.tag) { case 24: case 3: - var d = Mo(); - o = Hi(d); - var h = Ui(i, o, d); - h !== null && (bo(h, i, d), Zu(h, i, d)), i = { cache: Wb() }, o.payload = i; + var d = zo(); + o = Ui(d); + var h = qi(i, o, d); + h !== null && (bo(h, i, d), Ju(h, i, d)), i = { cache: Zb() }, o.payload = i; return; } i = i.return; } } - function Z6(o, i, d) { - var h = Mo(); + function i5(o, i, d) { + var h = zo(); d = { lane: h, revertLane: 0, @@ -4350,13 +4350,13 @@ Error generating stack: ` + h.message + ` hasEagerState: !1, eagerState: null, next: null - }, Wp(o) ? CT(i, d) : (d = Ob(o, i, d, h), d !== null && (bo(d, o, h), $T(d, i, h))); + }, Xp(o) ? IT(i, d) : (d = Ub(o, i, d, h), d !== null && (bo(d, o, h), zT(d, i, h))); } - function xT(o, i, d) { - var h = Mo(); - od(o, i, d, h); + function _T(o, i, d) { + var h = zo(); + ad(o, i, d, h); } - function od(o, i, d, h) { + function ad(o, i, d, h) { var x = { lane: h, revertLane: 0, @@ -4366,58 +4366,58 @@ Error generating stack: ` + h.message + ` eagerState: null, next: null }; - if (Wp(o)) CT(i, x); + if (Xp(o)) IT(i, x); else { var w = o.alternate; if (o.lanes === 0 && (w === null || w.lanes === 0) && (w = i.lastRenderedReducer, w !== null)) try { - var j = i.lastRenderedState, ae = w(j, d); - if (x.hasEagerState = !0, x.eagerState = ae, Po(ae, j)) - return Cp(o, i, x, 0), Vn === null && xp(), !1; + var B = i.lastRenderedState, oe = w(B, d); + if (x.hasEagerState = !0, x.eagerState = oe, Po(oe, B)) + return Rp(o, i, x, 0), Vn === null && Ep(), !1; } catch { } - if (d = Ob(o, i, x, h), d !== null) - return bo(d, o, h), $T(d, i, h), !0; + if (d = Ub(o, i, x, h), d !== null) + return bo(d, o, h), zT(d, i, h), !0; } return !1; } - function by(o, i, d, h) { + function Ey(o, i, d, h) { if (h = { lane: 2, - revertLane: lS(), + revertLane: hS(), gesture: null, action: h, hasEagerState: !1, eagerState: null, next: null - }, Wp(o)) { + }, Xp(o)) { if (i) throw Error(r(479)); } else - i = Ob( + i = Ub( o, d, h, 2 ), i !== null && bo(i, o, 2); } - function Wp(o) { + function Xp(o) { var i = o.alternate; return o === Qt || i !== null && i === Qt; } - function CT(o, i) { - sc = kp = !0; + function IT(o, i) { + lc = Hp = !0; var d = o.pending; d === null ? i.next = i : (i.next = d.next, d.next = i), o.pending = i; } - function $T(o, i, d) { + function zT(o, i, d) { if ((d & 4194048) !== 0) { var h = i.lanes; h &= o.pendingLanes, d |= h, i.lanes = d, Xt(o, d); } } - var Vp = { - readContext: Fr, - use: Bp, + var Qp = { + readContext: Br, + use: Wp, useCallback: or, useContext: or, useEffect: or, @@ -4440,41 +4440,41 @@ Error generating stack: ` + h.message + ` useMemoCache: or, useCacheRefresh: or, useEffectEvent: or - }, wT = { - readContext: Fr, - use: Bp, + }, MT = { + readContext: Br, + use: Wp, useCallback: function(o, i) { return so().memoizedState = [ o, i === void 0 ? null : i ], o; }, - useContext: Fr, - useEffect: sT, + useContext: Br, + useEffect: gT, useImperativeHandle: function(o, i, d) { - d = d != null ? d.concat([o]) : null, Up( + d = d != null ? d.concat([o]) : null, Kp( 4194308, 4, - dT.bind(null, i, o), + ST.bind(null, i, o), d ); }, useLayoutEffect: function(o, i) { - return Up(4194308, 4, o, i); + return Kp(4194308, 4, o, i); }, useInsertionEffect: function(o, i) { - Up(4, 2, o, i); + Kp(4, 2, o, i); }, useMemo: function(o, i) { var d = so(); i = i === void 0 ? null : i; var h = o(); - if (Ws) { - Re(!0); + if (Vs) { + Pe(!0); try { o(); } finally { - Re(!1); + Pe(!1); } } return d.memoizedState = [h, i], h; @@ -4483,12 +4483,12 @@ Error generating stack: ` + h.message + ` var h = so(); if (d !== void 0) { var x = d(i); - if (Ws) { - Re(!0); + if (Vs) { + Pe(!0); try { d(i); } finally { - Re(!1); + Pe(!1); } } } else x = i; @@ -4498,7 +4498,7 @@ Error generating stack: ` + h.message + ` dispatch: null, lastRenderedReducer: o, lastRenderedState: x - }, h.queue = o, o = o.dispatch = Z6.bind( + }, h.queue = o, o = o.dispatch = i5.bind( null, Qt, o @@ -4509,18 +4509,18 @@ Error generating stack: ` + h.message + ` return o = { current: o }, i.memoizedState = o; }, useState: function(o) { - o = dy(o); - var i = o.queue, d = xT.bind(null, Qt, i); + o = by(o); + var i = o.queue, d = _T.bind(null, Qt, i); return i.dispatch = d, [o.memoizedState, d]; }, - useDebugValue: py, + useDebugValue: xy, useDeferredValue: function(o, i) { var d = so(); - return hy(d, o, i); + return Cy(d, o, i); }, useTransition: function() { - var o = dy(!1); - return o = gT.bind( + var o = by(!1); + return o = ET.bind( null, Qt, o.queue, @@ -4537,16 +4537,16 @@ Error generating stack: ` + h.message + ` } else { if (d = i(), Vn === null) throw Error(r(349)); - (hn & 127) !== 0 || WP(h, i, d); + (gn & 127) !== 0 || eT(h, i, d); } x.memoizedState = d; var w = { value: d, getSnapshot: i }; - return x.queue = w, sT(KP.bind(null, h, w, o), [ + return x.queue = w, gT(nT.bind(null, h, w, o), [ o - ]), h.flags |= 2048, cc( + ]), h.flags |= 2048, uc( 9, { destroy: void 0 }, - VP.bind( + tT.bind( null, h, w, @@ -4559,15 +4559,15 @@ Error generating stack: ` + h.message + ` useId: function() { var o = so(), i = Vn.identifierPrefix; if (on) { - var d = Na, h = Ta; - d = (h & ~(1 << 32 - Fe(h) - 1)).toString(32) + d, i = "_" + i + "R_" + d, d = jp++, 0 < d && (i += "H" + d.toString(32)), i += "_"; + var d = _a, h = Na; + d = (h & ~(1 << 32 - Fe(h) - 1)).toString(32) + d, i = "_" + i + "R_" + d, d = Up++, 0 < d && (i += "H" + d.toString(32)), i += "_"; } else - d = W6++, i = "_" + i + "r_" + d.toString(32) + "_"; + d = J6++, i = "_" + i + "r_" + d.toString(32) + "_"; return o.memoizedState = i; }, - useHostTransitionStatus: vy, - useFormState: nT, - useActionState: nT, + useHostTransitionStatus: wy, + useFormState: dT, + useActionState: dT, useOptimistic: function(o) { var i = so(); i.memoizedState = i.baseState = o; @@ -4578,16 +4578,16 @@ Error generating stack: ` + h.message + ` lastRenderedReducer: null, lastRenderedState: null }; - return i.queue = d, i = by.bind( + return i.queue = d, i = Ey.bind( null, Qt, !0, d ), d.dispatch = i, [o, i]; }, - useMemoCache: ly, + useMemoCache: hy, useCacheRefresh: function() { - return so().memoizedState = Y6.bind( + return so().memoizedState = a5.bind( null, Qt ); @@ -4600,25 +4600,25 @@ Error generating stack: ` + h.message + ` return d.impl.apply(void 0, arguments); }; } - }, ET = { - readContext: Fr, - use: Bp, - useCallback: mT, - useContext: Fr, - useEffect: my, - useImperativeHandle: fT, - useInsertionEffect: cT, - useLayoutEffect: uT, - useMemo: pT, - useReducer: Hp, - useRef: iT, + }, AT = { + readContext: Br, + use: Wp, + useCallback: CT, + useContext: Br, + useEffect: Sy, + useImperativeHandle: xT, + useInsertionEffect: bT, + useLayoutEffect: yT, + useMemo: $T, + useReducer: Vp, + useRef: hT, useState: function() { - return Hp(di); + return Vp(fi); }, - useDebugValue: py, + useDebugValue: xy, useDeferredValue: function(o, i) { - var d = cr(); - return hT( + var d = ur(); + return wT( d, jn.memoizedState, o, @@ -4626,43 +4626,43 @@ Error generating stack: ` + h.message + ` ); }, useTransition: function() { - var o = Hp(di)[0], i = cr().memoizedState; + var o = Vp(fi)[0], i = ur().memoizedState; return [ - typeof o == "boolean" ? o : rd(o), + typeof o == "boolean" ? o : od(o), i ]; }, - useSyncExternalStore: qP, - useId: yT, - useHostTransitionStatus: vy, - useFormState: rT, - useActionState: rT, + useSyncExternalStore: JP, + useId: TT, + useHostTransitionStatus: wy, + useFormState: fT, + useActionState: fT, useOptimistic: function(o, i) { - var d = cr(); - return QP(d, jn, o, i); - }, - useMemoCache: ly, - useCacheRefresh: ST, - useEffectEvent: lT - }, J6 = { - readContext: Fr, - use: Bp, - useCallback: mT, - useContext: Fr, - useEffect: my, - useImperativeHandle: fT, - useInsertionEffect: cT, - useLayoutEffect: uT, - useMemo: pT, - useReducer: uy, - useRef: iT, + var d = ur(); + return aT(d, jn, o, i); + }, + useMemoCache: hy, + useCacheRefresh: NT, + useEffectEvent: vT + }, s5 = { + readContext: Br, + use: Wp, + useCallback: CT, + useContext: Br, + useEffect: Sy, + useImperativeHandle: xT, + useInsertionEffect: bT, + useLayoutEffect: yT, + useMemo: $T, + useReducer: vy, + useRef: hT, useState: function() { - return uy(di); + return vy(fi); }, - useDebugValue: py, + useDebugValue: xy, useDeferredValue: function(o, i) { - var d = cr(); - return jn === null ? hy(d, o, i) : hT( + var d = ur(); + return jn === null ? Cy(d, o, i) : wT( d, jn.memoizedState, o, @@ -4670,52 +4670,52 @@ Error generating stack: ` + h.message + ` ); }, useTransition: function() { - var o = uy(di)[0], i = cr().memoizedState; + var o = vy(fi)[0], i = ur().memoizedState; return [ - typeof o == "boolean" ? o : rd(o), + typeof o == "boolean" ? o : od(o), i ]; }, - useSyncExternalStore: qP, - useId: yT, - useHostTransitionStatus: vy, - useFormState: aT, - useActionState: aT, + useSyncExternalStore: JP, + useId: TT, + useHostTransitionStatus: wy, + useFormState: pT, + useActionState: pT, useOptimistic: function(o, i) { - var d = cr(); - return jn !== null ? QP(d, jn, o, i) : (d.baseState = o, [o, d.queue.dispatch]); + var d = ur(); + return jn !== null ? aT(d, jn, o, i) : (d.baseState = o, [o, d.queue.dispatch]); }, - useMemoCache: ly, - useCacheRefresh: ST, - useEffectEvent: lT + useMemoCache: hy, + useCacheRefresh: NT, + useEffectEvent: vT }; - function yy(o, i, d, h) { - i = o.memoizedState, d = d(h, i), d = d == null ? i : N({}, i, d), o.memoizedState = d, o.lanes === 0 && (o.updateQueue.baseState = d); + function Ry(o, i, d, h) { + i = o.memoizedState, d = d(h, i), d = d == null ? i : _({}, i, d), o.memoizedState = d, o.lanes === 0 && (o.updateQueue.baseState = d); } - var Sy = { + var Py = { enqueueSetState: function(o, i, d) { o = o._reactInternals; - var h = Mo(), x = Hi(h); - x.payload = i, d != null && (x.callback = d), i = Ui(o, x, h), i !== null && (bo(i, o, h), Zu(i, o, h)); + var h = zo(), x = Ui(h); + x.payload = i, d != null && (x.callback = d), i = qi(o, x, h), i !== null && (bo(i, o, h), Ju(i, o, h)); }, enqueueReplaceState: function(o, i, d) { o = o._reactInternals; - var h = Mo(), x = Hi(h); - x.tag = 1, x.payload = i, d != null && (x.callback = d), i = Ui(o, x, h), i !== null && (bo(i, o, h), Zu(i, o, h)); + var h = zo(), x = Ui(h); + x.tag = 1, x.payload = i, d != null && (x.callback = d), i = qi(o, x, h), i !== null && (bo(i, o, h), Ju(i, o, h)); }, enqueueForceUpdate: function(o, i) { o = o._reactInternals; - var d = Mo(), h = Hi(d); - h.tag = 2, i != null && (h.callback = i), i = Ui(o, h, d), i !== null && (bo(i, o, d), Zu(i, o, d)); + var d = zo(), h = Ui(d); + h.tag = 2, i != null && (h.callback = i), i = qi(o, h, d), i !== null && (bo(i, o, d), Ju(i, o, d)); } }; - function RT(o, i, d, h, x, w, j) { - return o = o.stateNode, typeof o.shouldComponentUpdate == "function" ? o.shouldComponentUpdate(h, w, j) : i.prototype && i.prototype.isPureReactComponent ? !qu(d, h) || !qu(x, w) : !0; + function DT(o, i, d, h, x, w, B) { + return o = o.stateNode, typeof o.shouldComponentUpdate == "function" ? o.shouldComponentUpdate(h, w, B) : i.prototype && i.prototype.isPureReactComponent ? !Wu(d, h) || !Wu(x, w) : !0; } - function PT(o, i, d, h) { - o = i.state, typeof i.componentWillReceiveProps == "function" && i.componentWillReceiveProps(d, h), typeof i.UNSAFE_componentWillReceiveProps == "function" && i.UNSAFE_componentWillReceiveProps(d, h), i.state !== o && Sy.enqueueReplaceState(i, i.state, null); + function OT(o, i, d, h) { + o = i.state, typeof i.componentWillReceiveProps == "function" && i.componentWillReceiveProps(d, h), typeof i.UNSAFE_componentWillReceiveProps == "function" && i.UNSAFE_componentWillReceiveProps(d, h), i.state !== o && Py.enqueueReplaceState(i, i.state, null); } - function Vs(o, i) { + function Ks(o, i) { var d = i; if ("ref" in i) { d = {}; @@ -4723,22 +4723,22 @@ Error generating stack: ` + h.message + ` h !== "ref" && (d[h] = i[h]); } if (o = o.defaultProps) { - d === i && (d = N({}, d)); + d === i && (d = _({}, d)); for (var x in o) d[x] === void 0 && (d[x] = o[x]); } return d; } - function TT(o) { - Sp(o); + function LT(o) { + wp(o); } - function NT(o) { + function kT(o) { console.error(o); } - function _T(o) { - Sp(o); + function jT(o) { + wp(o); } - function Kp(o, i) { + function Yp(o, i) { try { var d = o.onUncaughtError; d(i.value, { componentStack: i.stack }); @@ -4748,7 +4748,7 @@ Error generating stack: ` + h.message + ` }); } } - function IT(o, i, d) { + function FT(o, i, d) { try { var h = o.onCaughtError; h(d.value, { @@ -4761,82 +4761,82 @@ Error generating stack: ` + h.message + ` }); } } - function xy(o, i, d) { - return d = Hi(d), d.tag = 3, d.payload = { element: null }, d.callback = function() { - Kp(o, i); + function Ty(o, i, d) { + return d = Ui(d), d.tag = 3, d.payload = { element: null }, d.callback = function() { + Yp(o, i); }, d; } - function MT(o) { - return o = Hi(o), o.tag = 3, o; + function BT(o) { + return o = Ui(o), o.tag = 3, o; } - function zT(o, i, d, h) { + function HT(o, i, d, h) { var x = d.type.getDerivedStateFromError; if (typeof x == "function") { var w = h.value; o.payload = function() { return x(w); }, o.callback = function() { - IT(i, d, h); + FT(i, d, h); }; } - var j = d.stateNode; - j !== null && typeof j.componentDidCatch == "function" && (o.callback = function() { - IT(i, d, h), typeof x != "function" && (Yi === null ? Yi = /* @__PURE__ */ new Set([this]) : Yi.add(this)); - var ae = h.stack; + var B = d.stateNode; + B !== null && typeof B.componentDidCatch == "function" && (o.callback = function() { + FT(i, d, h), typeof x != "function" && (Zi === null ? Zi = /* @__PURE__ */ new Set([this]) : Zi.add(this)); + var oe = h.stack; this.componentDidCatch(h.value, { - componentStack: ae !== null ? ae : "" + componentStack: oe !== null ? oe : "" }); }); } - function e5(o, i, d, h, x) { + function l5(o, i, d, h, x) { if (d.flags |= 32768, h !== null && typeof h == "object" && typeof h.then == "function") { - if (i = d.alternate, i !== null && ks( + if (i = d.alternate, i !== null && js( i, d, x, !0 - ), d = Br.current, d !== null) { + ), d = Hr.current, d !== null) { switch (d.tag) { case 31: case 13: case 19: - return Zr === null ? ph() : d.alternate === null && ar === 0 && (ar = 3), d.flags &= -257, d.flags |= 65536, d.lanes = x, h === zp ? d.flags |= 16384 : (i = d.updateQueue, i === null ? d.updateQueue = /* @__PURE__ */ new Set([h]) : i.add(h), aS(o, h, x)), !1; + return Jr === null ? bh() : d.alternate === null && ar === 0 && (ar = 3), d.flags &= -257, d.flags |= 65536, d.lanes = x, h === Lp ? d.flags |= 16384 : (i = d.updateQueue, i === null ? d.updateQueue = /* @__PURE__ */ new Set([h]) : i.add(h), fS(o, h, x)), !1; case 22: - return d.flags |= 65536, h === zp ? d.flags |= 16384 : (i = d.updateQueue, i === null ? (i = { + return d.flags |= 65536, h === Lp ? d.flags |= 16384 : (i = d.updateQueue, i === null ? (i = { transitions: null, markerInstances: null, retryQueue: /* @__PURE__ */ new Set([h]) - }, d.updateQueue = i) : (d = i.retryQueue, d === null ? i.retryQueue = /* @__PURE__ */ new Set([h]) : d.add(h)), aS(o, h, x)), !1; + }, d.updateQueue = i) : (d = i.retryQueue, d === null ? i.retryQueue = /* @__PURE__ */ new Set([h]) : d.add(h)), fS(o, h, x)), !1; } throw Error(r(435, d.tag)); } - return aS(o, h, x), ph(), !1; + return fS(o, h, x), bh(), !1; } if (on) - return i = Br.current, i !== null ? ((i.flags & 65536) === 0 && (i.flags |= 256), i.flags |= 65536, i.lanes = x, h !== Bb && (o = Error(r(422), { cause: h }), Ku(qo(o, d)))) : (h !== Bb && (i = Error(r(423), { + return i = Hr.current, i !== null ? ((i.flags & 65536) === 0 && (i.flags |= 256), i.flags |= 65536, i.lanes = x, h !== Gb && (o = Error(r(422), { cause: h }), Gu(Wo(o, d)))) : (h !== Gb && (i = Error(r(423), { cause: h - }), Ku( - qo(i, d) - )), o = o.current.alternate, o.flags |= 65536, x &= -x, o.lanes |= x, h = qo(h, d), x = xy( + }), Gu( + Wo(i, d) + )), o = o.current.alternate, o.flags |= 65536, x &= -x, o.lanes |= x, h = Wo(h, d), x = Ty( o.stateNode, h, x - ), Yb(o, x), ar !== 4 && (ar = 2)), !1; + ), oy(o, x), ar !== 4 && (ar = 2)), !1; var w = Error(r(520), { cause: h }); - if (w = qo(w, d), fd === null ? fd = [w] : fd.push(w), ar !== 4 && (ar = 2), i === null) return !0; - h = qo(h, d), d = i; + if (w = Wo(w, d), md === null ? md = [w] : md.push(w), ar !== 4 && (ar = 2), i === null) return !0; + h = Wo(h, d), d = i; do { switch (d.tag) { case 3: - return d.flags |= 65536, o = x & -x, d.lanes |= o, o = xy(d.stateNode, h, o), Yb(d, o), !1; + return d.flags |= 65536, o = x & -x, d.lanes |= o, o = Ty(d.stateNode, h, o), oy(d, o), !1; case 1: - if (i = d.type, w = d.stateNode, (d.flags & 128) === 0 && (typeof i.getDerivedStateFromError == "function" || w !== null && typeof w.componentDidCatch == "function" && (Yi === null || !Yi.has(w)))) - return d.flags |= 65536, x &= -x, d.lanes |= x, x = MT(x), zT( + if (i = d.type, w = d.stateNode, (d.flags & 128) === 0 && (typeof i.getDerivedStateFromError == "function" || w !== null && typeof w.componentDidCatch == "function" && (Zi === null || !Zi.has(w)))) + return d.flags |= 65536, x &= -x, d.lanes |= x, x = BT(x), HT( x, o, d, h - ), Yb(d, x), !1; + ), oy(d, x), !1; break; case 22: if (d.memoizedState !== null) @@ -4846,42 +4846,42 @@ Error generating stack: ` + h.message + ` } while (d !== null); return !1; } - var Cy = Error(r(461)), hr = !1; - function Rr(o, i, d, h) { - i.child = o === null ? LP(i, null, d, h) : qs( + var Ny = Error(r(461)), gr = !1; + function Pr(o, i, d, h) { + i.child = o === null ? VP(i, null, d, h) : Ws( i, o.child, d, h ); } - function AT(o, i, d, h, x) { + function UT(o, i, d, h, x) { d = d.render; var w = i.ref; if ("ref" in h) { - var j = {}; - for (var ae in h) - ae !== "ref" && (j[ae] = h[ae]); - } else j = h; - return js(i), h = oy( + var B = {}; + for (var oe in h) + oe !== "ref" && (B[oe] = h[oe]); + } else B = h; + return Fs(i), h = dy( o, i, d, - j, + B, w, x - ), ae = ay(), o !== null && !hr ? (iy(o, i, x), fi(o, i, x)) : (on && ae && Rp(i), i.flags |= 1, Rr(o, i, h, x), i.child); + ), oe = fy(), o !== null && !gr ? (my(o, i, x), mi(o, i, x)) : (on && oe && _p(i), i.flags |= 1, Pr(o, i, h, x), i.child); } - function DT(o, i, d, h, x) { + function qT(o, i, d, h, x) { if (o === null) { var w = d.type; - return typeof w == "function" && !Lb(w) && w.defaultProps === void 0 && d.compare === null ? (i.tag = 15, i.type = w, OT( + return typeof w == "function" && !qb(w) && w.defaultProps === void 0 && d.compare === null ? (i.tag = 15, i.type = w, WT( o, i, w, h, x - )) : (o = wp( + )) : (o = Tp( d.type, null, h, @@ -4890,23 +4890,23 @@ Error generating stack: ` + h.message + ` x ), o.ref = i.ref, o.return = i, i.child = o); } - if (w = o.child, !_y(o, x)) { - var j = w.memoizedProps; - if (d = d.compare, d = d !== null ? d : qu, d(j, h) && o.ref === i.ref) - return fi(o, i, x); + if (w = o.child, !Ly(o, x)) { + var B = w.memoizedProps; + if (d = d.compare, d = d !== null ? d : Wu, d(B, h) && o.ref === i.ref) + return mi(o, i, x); } - return i.flags |= 1, o = ii(w, h), o.ref = i.ref, o.return = i, i.child = o; + return i.flags |= 1, o = si(w, h), o.ref = i.ref, o.return = i, i.child = o; } - function OT(o, i, d, h, x) { + function WT(o, i, d, h, x) { if (o !== null) { var w = o.memoizedProps; - if (qu(w, h) && o.ref === i.ref) - if (hr = !1, i.pendingProps = h = w, _y(o, x)) - (o.flags & 131072) !== 0 && (hr = !0); + if (Wu(w, h) && o.ref === i.ref) + if (gr = !1, i.pendingProps = h = w, Ly(o, x)) + (o.flags & 131072) !== 0 && (gr = !0); else - return i.lanes = o.lanes, fi(o, i, x); + return i.lanes = o.lanes, mi(o, i, x); } - return $y( + return _y( o, i, d, @@ -4914,7 +4914,7 @@ Error generating stack: ` + h.message + ` x ); } - function LT(o, i, d, h) { + function VT(o, i, d, h) { var x = h.children, w = o !== null ? o.memoizedState : null; if (o === null && i.stateNode === null && (i.stateNode = { _visibility: 1, @@ -4928,7 +4928,7 @@ Error generating stack: ` + h.message + ` x = x | h.lanes | h.childLanes, h = h.sibling; h = x & ~w; } else h = 0, i.child = null; - return kT( + return KT( o, i, w, @@ -4937,12 +4937,12 @@ Error generating stack: ` + h.message + ` ); } if ((d & 536870912) !== 0) - i.memoizedState = { baseLanes: 0, cachePool: null }, o !== null && Ip( + i.memoizedState = { baseLanes: 0, cachePool: null }, o !== null && Dp( i, w !== null ? w.cachePool : null - ), w !== null ? FP(i, w) : Jb(), BP(i); + ), w !== null ? XP(i, w) : iy(), QP(i); else - return h = i.lanes = 536870912, kT( + return h = i.lanes = 536870912, KT( o, i, w !== null ? w.baseLanes | d : d, @@ -4950,10 +4950,10 @@ Error generating stack: ` + h.message + ` h ); } else - w !== null ? (Ip(i, w.cachePool), FP(i, w), Vi(), i.memoizedState = null) : (o !== null && Ip(i, null), Jb(), Vi()); - return Rr(o, i, x, d), i.child; + w !== null ? (Dp(i, w.cachePool), XP(i, w), Ki(), i.memoizedState = null) : (o !== null && Dp(i, null), iy(), Ki()); + return Pr(o, i, x, d), i.child; } - function ad(o, i) { + function id(o, i) { return o !== null && o.tag === 22 || i.stateNode !== null || (i.stateNode = { _visibility: 1, _pendingMarkers: null, @@ -4961,47 +4961,47 @@ Error generating stack: ` + h.message + ` _transitions: null }), i.sibling; } - function kT(o, i, d, h, x) { - var w = Kb(); - return w = w === null ? null : { parent: mr._currentValue, pool: w }, i.memoizedState = { + function KT(o, i, d, h, x) { + var w = ey(); + return w = w === null ? null : { parent: pr._currentValue, pool: w }, i.memoizedState = { baseLanes: d, cachePool: w - }, o !== null && Ip(i, null), Jb(), BP(i), o !== null && ks(o, i, h, !0), i.childLanes = x, null; + }, o !== null && Dp(i, null), iy(), QP(i), o !== null && js(o, i, h, !0), i.childLanes = x, null; } - function Gp(o, i) { - return i = Xp( + function Zp(o, i) { + return i = Jp( { mode: i.mode, children: i.children }, o.mode ), i.ref = o.ref, o.child = i, i.return = o, i; } - function jT(o, i, d) { - return qs(i, o.child, null, d), o = Gp(i, i.pendingProps), o.flags |= 2, To(i), i.memoizedState = null, o; + function GT(o, i, d) { + return Ws(i, o.child, null, d), o = Zp(i, i.pendingProps), o.flags |= 2, To(i), i.memoizedState = null, o; } - function t5(o, i, d) { + function c5(o, i, d) { var h = i.pendingProps, x = (i.flags & 128) !== 0; if (i.flags &= -129, o === null) { if (on) { if (h.mode === "hidden") - return o = Gp(i, h), i.lanes = 536870912, o.memoizedState = { baseLanes: 0, cachePool: null }, ad(null, o); - if (ty(i), (o = Gn) ? (o = d_( + return o = Zp(i, h), i.lanes = 536870912, o.memoizedState = { baseLanes: 0, cachePool: null }, id(null, o); + if (ly(i), (o = Gn) ? (o = S_( o, - Ko + Go ), o = o !== null && o.data === "&" ? o : null, o !== null && (i.memoizedState = { dehydrated: o, - treeContext: Oi !== null ? { id: Ta, overflow: Na } : null, + treeContext: Li !== null ? { id: Na, overflow: _a } : null, retryLane: 536870912, hydrationErrors: null - }, d = CP(o), d.return = i, i.child = d, zr = i, Gn = null)) : o = null, o === null) throw ki(i); + }, d = IP(o), d.return = i, i.child = d, Ar = i, Gn = null)) : o = null, o === null) throw ji(i); return i.lanes = 536870912, null; } - return Gp(i, h); + return Zp(i, h); } var w = o.memoizedState; if (w !== null) { - var j = w.dehydrated; - if (ty(i), x) + var B = w.dehydrated; + if (ly(i), x) if (i.flags & 256) - i.flags &= -257, i = jT( + i.flags &= -257, i = GT( o, i, d @@ -5009,27 +5009,27 @@ Error generating stack: ` + h.message + ` else if (i.memoizedState !== null) i.child = o.child, i.flags |= 128, i = null; else throw Error(r(558)); - else if (hr || ks(o, i, d, !1), x = (d & o.childLanes) !== 0, hr || x) { - if (qi.current === null) { - if (h = Vn, h !== null && (j = $n(h, d), j !== 0 && j !== w.retryLane)) - throw w.retryLane = j, As(o, j), bo(h, o, j), Cy; - ph(); + else if (gr || js(o, i, d, !1), x = (d & o.childLanes) !== 0, gr || x) { + if (Wi.current === null) { + if (h = Vn, h !== null && (B = $n(h, d), B !== 0 && B !== w.retryLane)) + throw w.retryLane = B, Ds(o, B), bo(h, o, B), Ny; + bh(); } - i = jT( + i = GT( o, i, d ); } else - o = w.treeContext, Gn = Xo(j.nextSibling), zr = i, on = !0, Li = null, Ko = !1, o !== null && EP(i, o), i = Gp(i, h), i.flags |= 134221824; + o = w.treeContext, Gn = Qo(B.nextSibling), Ar = i, on = !0, ki = null, Go = !1, o !== null && AP(i, o), i = Zp(i, h), i.flags |= 134221824; return i; } - return o = ii(o.child, { + return o = si(o.child, { mode: h.mode, children: h.children }), o.ref = i.ref, i.child = o, o.return = i, o; } - function uc(o, i) { + function dc(o, i) { var d = i.ref; if (d === null) o !== null && o.ref !== null && (i.flags |= 4194816); @@ -5039,263 +5039,263 @@ Error generating stack: ` + h.message + ` (o === null || o.ref !== d) && (i.flags |= 4194816); } } - function $y(o, i, d, h, x) { - return js(i), d = oy( + function _y(o, i, d, h, x) { + return Fs(i), d = dy( o, i, d, h, void 0, x - ), h = ay(), o !== null && !hr ? (iy(o, i, x), fi(o, i, x)) : (on && h && Rp(i), i.flags |= 1, Rr(o, i, d, x), i.child); + ), h = fy(), o !== null && !gr ? (my(o, i, x), mi(o, i, x)) : (on && h && _p(i), i.flags |= 1, Pr(o, i, d, x), i.child); } - function FT(o, i, d, h, x, w) { - return js(i), i.updateQueue = null, d = UP( + function XT(o, i, d, h, x, w) { + return Fs(i), i.updateQueue = null, d = ZP( i, h, d, x - ), HP(o), h = ay(), o !== null && !hr ? (iy(o, i, w), fi(o, i, w)) : (on && h && Rp(i), i.flags |= 1, Rr(o, i, d, w), i.child); + ), YP(o), h = fy(), o !== null && !gr ? (my(o, i, w), mi(o, i, w)) : (on && h && _p(i), i.flags |= 1, Pr(o, i, d, w), i.child); } - function BT(o, i, d, h, x) { - if (js(i), i.stateNode === null) { - var w = ec, j = d.contextType; - typeof j == "object" && j !== null && (w = Fr(j)), w = new d(h, w), i.memoizedState = w.state !== null && w.state !== void 0 ? w.state : null, w.updater = Sy, i.stateNode = w, w._reactInternals = i, w = i.stateNode, w.props = h, w.state = i.memoizedState, w.refs = {}, Xb(i), j = d.contextType, w.context = typeof j == "object" && j !== null ? Fr(j) : ec, w.state = i.memoizedState, j = d.getDerivedStateFromProps, typeof j == "function" && (yy( + function QT(o, i, d, h, x) { + if (Fs(i), i.stateNode === null) { + var w = tc, B = d.contextType; + typeof B == "object" && B !== null && (w = Br(B)), w = new d(h, w), i.memoizedState = w.state !== null && w.state !== void 0 ? w.state : null, w.updater = Py, i.stateNode = w, w._reactInternals = i, w = i.stateNode, w.props = h, w.state = i.memoizedState, w.refs = {}, ny(i), B = d.contextType, w.context = typeof B == "object" && B !== null ? Br(B) : tc, w.state = i.memoizedState, B = d.getDerivedStateFromProps, typeof B == "function" && (Ry( i, d, - j, + B, h - ), w.state = i.memoizedState), typeof d.getDerivedStateFromProps == "function" || typeof w.getSnapshotBeforeUpdate == "function" || typeof w.UNSAFE_componentWillMount != "function" && typeof w.componentWillMount != "function" || (j = w.state, typeof w.componentWillMount == "function" && w.componentWillMount(), typeof w.UNSAFE_componentWillMount == "function" && w.UNSAFE_componentWillMount(), j !== w.state && Sy.enqueueReplaceState(w, w.state, null), ed(i, h, w, x), Ju(), w.state = i.memoizedState), typeof w.componentDidMount == "function" && (i.flags |= 4194308), h = !0; + ), w.state = i.memoizedState), typeof d.getDerivedStateFromProps == "function" || typeof w.getSnapshotBeforeUpdate == "function" || typeof w.UNSAFE_componentWillMount != "function" && typeof w.componentWillMount != "function" || (B = w.state, typeof w.componentWillMount == "function" && w.componentWillMount(), typeof w.UNSAFE_componentWillMount == "function" && w.UNSAFE_componentWillMount(), B !== w.state && Py.enqueueReplaceState(w, w.state, null), td(i, h, w, x), ed(), w.state = i.memoizedState), typeof w.componentDidMount == "function" && (i.flags |= 4194308), h = !0; } else if (o === null) { w = i.stateNode; - var ae = i.memoizedProps, ge = Vs(d, ae); - w.props = ge; - var Ie = w.context, je = d.contextType; - j = ec, typeof je == "object" && je !== null && (j = Fr(je)); + var oe = i.memoizedProps, ve = Ks(d, oe); + w.props = ve; + var ze = w.context, je = d.contextType; + B = tc, typeof je == "object" && je !== null && (B = Br(je)); var Ye = d.getDerivedStateFromProps; - je = typeof Ye == "function" || typeof w.getSnapshotBeforeUpdate == "function", ae = i.pendingProps !== ae, je || typeof w.UNSAFE_componentWillReceiveProps != "function" && typeof w.componentWillReceiveProps != "function" || (ae || Ie !== j) && PT( + je = typeof Ye == "function" || typeof w.getSnapshotBeforeUpdate == "function", oe = i.pendingProps !== oe, je || typeof w.UNSAFE_componentWillReceiveProps != "function" && typeof w.componentWillReceiveProps != "function" || (oe || ze !== B) && OT( i, w, h, - j - ), Bi = !1; - var Pe = i.memoizedState; - w.state = Pe, ed(i, h, w, x), Ju(), Ie = i.memoizedState, ae || Pe !== Ie || Bi ? (typeof Ye == "function" && (yy( + B + ), Hi = !1; + var Te = i.memoizedState; + w.state = Te, td(i, h, w, x), ed(), ze = i.memoizedState, oe || Te !== ze || Hi ? (typeof Ye == "function" && (Ry( i, d, Ye, h - ), Ie = i.memoizedState), (ge = Bi || RT( + ), ze = i.memoizedState), (ve = Hi || DT( i, d, - ge, + ve, h, - Pe, - Ie, - j - )) ? (je || typeof w.UNSAFE_componentWillMount != "function" && typeof w.componentWillMount != "function" || (typeof w.componentWillMount == "function" && w.componentWillMount(), typeof w.UNSAFE_componentWillMount == "function" && w.UNSAFE_componentWillMount()), typeof w.componentDidMount == "function" && (i.flags |= 4194308)) : (typeof w.componentDidMount == "function" && (i.flags |= 4194308), i.memoizedProps = h, i.memoizedState = Ie), w.props = h, w.state = Ie, w.context = j, h = ge) : (typeof w.componentDidMount == "function" && (i.flags |= 4194308), h = !1); + Te, + ze, + B + )) ? (je || typeof w.UNSAFE_componentWillMount != "function" && typeof w.componentWillMount != "function" || (typeof w.componentWillMount == "function" && w.componentWillMount(), typeof w.UNSAFE_componentWillMount == "function" && w.UNSAFE_componentWillMount()), typeof w.componentDidMount == "function" && (i.flags |= 4194308)) : (typeof w.componentDidMount == "function" && (i.flags |= 4194308), i.memoizedProps = h, i.memoizedState = ze), w.props = h, w.state = ze, w.context = B, h = ve) : (typeof w.componentDidMount == "function" && (i.flags |= 4194308), h = !1); } else { - w = i.stateNode, Qb(o, i), j = i.memoizedProps, je = Vs(d, j), w.props = je, Ye = i.pendingProps, Pe = w.context, Ie = d.contextType, ge = ec, typeof Ie == "object" && Ie !== null && (ge = Fr(Ie)), ae = d.getDerivedStateFromProps, (Ie = typeof ae == "function" || typeof w.getSnapshotBeforeUpdate == "function") || typeof w.UNSAFE_componentWillReceiveProps != "function" && typeof w.componentWillReceiveProps != "function" || (j !== Ye || Pe !== ge) && PT( + w = i.stateNode, ry(o, i), B = i.memoizedProps, je = Ks(d, B), w.props = je, Ye = i.pendingProps, Te = w.context, ze = d.contextType, ve = tc, typeof ze == "object" && ze !== null && (ve = Br(ze)), oe = d.getDerivedStateFromProps, (ze = typeof oe == "function" || typeof w.getSnapshotBeforeUpdate == "function") || typeof w.UNSAFE_componentWillReceiveProps != "function" && typeof w.componentWillReceiveProps != "function" || (B !== Ye || Te !== ve) && OT( i, w, h, - ge - ), Bi = !1, Pe = i.memoizedState, w.state = Pe, ed(i, h, w, x), Ju(); + ve + ), Hi = !1, Te = i.memoizedState, w.state = Te, td(i, h, w, x), ed(); var Le = i.memoizedState; - j !== Ye || Pe !== Le || Bi || o !== null && o.dependencies !== null && Np(o.dependencies) ? (typeof ae == "function" && (yy( + B !== Ye || Te !== Le || Hi || o !== null && o.dependencies !== null && Mp(o.dependencies) ? (typeof oe == "function" && (Ry( i, d, - ae, + oe, h - ), Le = i.memoizedState), (je = Bi || RT( + ), Le = i.memoizedState), (je = Hi || DT( i, d, je, h, - Pe, + Te, Le, - ge - ) || o !== null && o.dependencies !== null && Np(o.dependencies)) ? (Ie || typeof w.UNSAFE_componentWillUpdate != "function" && typeof w.componentWillUpdate != "function" || (typeof w.componentWillUpdate == "function" && w.componentWillUpdate(h, Le, ge), typeof w.UNSAFE_componentWillUpdate == "function" && w.UNSAFE_componentWillUpdate( + ve + ) || o !== null && o.dependencies !== null && Mp(o.dependencies)) ? (ze || typeof w.UNSAFE_componentWillUpdate != "function" && typeof w.componentWillUpdate != "function" || (typeof w.componentWillUpdate == "function" && w.componentWillUpdate(h, Le, ve), typeof w.UNSAFE_componentWillUpdate == "function" && w.UNSAFE_componentWillUpdate( h, Le, - ge - )), typeof w.componentDidUpdate == "function" && (i.flags |= 4), typeof w.getSnapshotBeforeUpdate == "function" && (i.flags |= 1024)) : (typeof w.componentDidUpdate != "function" || j === o.memoizedProps && Pe === o.memoizedState || (i.flags |= 4), typeof w.getSnapshotBeforeUpdate != "function" || j === o.memoizedProps && Pe === o.memoizedState || (i.flags |= 1024), i.memoizedProps = h, i.memoizedState = Le), w.props = h, w.state = Le, w.context = ge, h = je) : (typeof w.componentDidUpdate != "function" || j === o.memoizedProps && Pe === o.memoizedState || (i.flags |= 4), typeof w.getSnapshotBeforeUpdate != "function" || j === o.memoizedProps && Pe === o.memoizedState || (i.flags |= 1024), h = !1); + ve + )), typeof w.componentDidUpdate == "function" && (i.flags |= 4), typeof w.getSnapshotBeforeUpdate == "function" && (i.flags |= 1024)) : (typeof w.componentDidUpdate != "function" || B === o.memoizedProps && Te === o.memoizedState || (i.flags |= 4), typeof w.getSnapshotBeforeUpdate != "function" || B === o.memoizedProps && Te === o.memoizedState || (i.flags |= 1024), i.memoizedProps = h, i.memoizedState = Le), w.props = h, w.state = Le, w.context = ve, h = je) : (typeof w.componentDidUpdate != "function" || B === o.memoizedProps && Te === o.memoizedState || (i.flags |= 4), typeof w.getSnapshotBeforeUpdate != "function" || B === o.memoizedProps && Te === o.memoizedState || (i.flags |= 1024), h = !1); } - return w = h, uc(o, i), h = (i.flags & 128) !== 0, w || h ? (w = i.stateNode, d = h && typeof d.getDerivedStateFromError != "function" ? null : w.render(), i.flags |= 1, o !== null && h ? (i.child = qs( + return w = h, dc(o, i), h = (i.flags & 128) !== 0, w || h ? (w = i.stateNode, d = h && typeof d.getDerivedStateFromError != "function" ? null : w.render(), i.flags |= 1, o !== null && h ? (i.child = Ws( i, o.child, null, x - ), i.child = qs( + ), i.child = Ws( i, null, d, x - )) : Rr(o, i, d, x), i.memoizedState = w.state, o = i.child) : o = fi( + )) : Pr(o, i, d, x), i.memoizedState = w.state, o = i.child) : o = mi( o, i, x ), o; } - function HT(o, i, d, h) { - return Os(), i.flags |= 256, Rr(o, i, d, h), i.child; + function YT(o, i, d, h) { + return Ls(), i.flags |= 256, Pr(o, i, d, h), i.child; } - var wy = { + var Iy = { dehydrated: null, treeContext: null, retryLane: 0, hydrationErrors: null }; - function Ey(o) { - return { baseLanes: o, cachePool: IP() }; + function zy(o) { + return { baseLanes: o, cachePool: FP() }; } - function Ry(o, i, d) { + function My(o, i, d) { return o = o !== null ? o.childLanes & ~d : 0, i && (o |= Io), o; } - function UT(o, i, d) { - var h = i.pendingProps, x = !1, w = (i.flags & 128) !== 0, j; - if ((j = w) || (j = o !== null && o.memoizedState === null ? !1 : (Hr.current & 2) !== 0), j && (x = !0, i.flags &= -129), j = (i.flags & 32) !== 0, i.flags &= -33, o === null) { + function ZT(o, i, d) { + var h = i.pendingProps, x = !1, w = (i.flags & 128) !== 0, B; + if ((B = w) || (B = o !== null && o.memoizedState === null ? !1 : (Ur.current & 2) !== 0), B && (x = !0, i.flags &= -129), B = (i.flags & 32) !== 0, i.flags &= -33, o === null) { if (on) { - if (x ? Wi(i) : Vi(), (o = Gn) ? (o = d_( + if (x ? Vi(i) : Ki(), (o = Gn) ? (o = S_( o, - Ko + Go ), o = o !== null && o.data !== "&" ? o : null, o !== null && (i.memoizedState = { dehydrated: o, - treeContext: Oi !== null ? { id: Ta, overflow: Na } : null, + treeContext: Li !== null ? { id: Na, overflow: _a } : null, retryLane: 536870912, hydrationErrors: null - }, d = CP(o), d.return = i, i.child = d, zr = i, Gn = null)) : o = null, o === null) throw ki(i); - return ES(o) ? i.lanes = 32 : i.lanes = 536870912, null; + }, d = IP(o), d.return = i, i.child = d, Ar = i, Gn = null)) : o = null, o === null) throw ji(i); + return zS(o) ? i.lanes = 32 : i.lanes = 536870912, null; } - return w = h.children, h = h.fallback, x ? (Vi(), x = i.mode, w = Xp( + return w = h.children, h = h.fallback, x ? (Ki(), x = i.mode, w = Jp( { mode: "hidden", children: w }, x - ), h = Ds( + ), h = Os( h, x, d, null - ), w.return = i, h.return = i, w.sibling = h, i.child = w, h = i.child, h.memoizedState = Ey(d), h.childLanes = Ry( + ), w.return = i, h.return = i, w.sibling = h, i.child = w, h = i.child, h.memoizedState = zy(d), h.childLanes = My( o, - j, + B, d - ), i.memoizedState = wy, ad(null, h)) : (Wi(i), Py(i, w)); + ), i.memoizedState = Iy, id(null, h)) : (Vi(i), Ay(i, w)); } - var ae = o.memoizedState; - if (ae !== null) { - var ge = ae.dehydrated; - if (ge !== null) - return n5( + var oe = o.memoizedState; + if (oe !== null) { + var ve = oe.dehydrated; + if (ve !== null) + return u5( o, i, w, - j, + B, h, - ge, - ae, + ve, + oe, d ); } - return x ? (Vi(), x = h.fallback, w = i.mode, ae = o.child, ge = ae.sibling, h = ii(ae, { + return x ? (Ki(), x = h.fallback, w = i.mode, oe = o.child, ve = oe.sibling, h = si(oe, { mode: "hidden", children: h.children - }), h.subtreeFlags = ae.subtreeFlags & 1206910976, ge !== null ? x = ii(ge, x) : (x = Ds( + }), h.subtreeFlags = oe.subtreeFlags & 1206910976, ve !== null ? x = si(ve, x) : (x = Os( x, w, d, null - ), x.flags |= 2), x.return = i, h.return = i, h.sibling = x, i.child = h, ad(null, h), h = i.child, x = o.child.memoizedState, x === null ? x = Ey(d) : (w = x.cachePool, w !== null ? (ae = mr._currentValue, w = w.parent !== ae ? { parent: ae, pool: ae } : w) : w = IP(), x = { + ), x.flags |= 2), x.return = i, h.return = i, h.sibling = x, i.child = h, id(null, h), h = i.child, x = o.child.memoizedState, x === null ? x = zy(d) : (w = x.cachePool, w !== null ? (oe = pr._currentValue, w = w.parent !== oe ? { parent: oe, pool: oe } : w) : w = FP(), x = { baseLanes: x.baseLanes | d, cachePool: w - }), h.memoizedState = x, h.childLanes = Ry( + }), h.memoizedState = x, h.childLanes = My( o, - j, + B, d - ), i.memoizedState = wy, ad(o.child, h)) : (Wi(i), d = o.child, o = d.sibling, d = ii(d, { + ), i.memoizedState = Iy, id(o.child, h)) : (Vi(i), d = o.child, o = d.sibling, d = si(d, { mode: "visible", children: h.children - }), d.return = i, d.sibling = null, o !== null && (j = i.deletions, j === null ? (i.deletions = [o], i.flags |= 16) : j.push(o)), i.child = d, i.memoizedState = null, d); + }), d.return = i, d.sibling = null, o !== null && (B = i.deletions, B === null ? (i.deletions = [o], i.flags |= 16) : B.push(o)), i.child = d, i.memoizedState = null, d); } - function Py(o, i) { - return i = Xp( + function Ay(o, i) { + return i = Jp( { mode: "visible", children: i }, o.mode ), i.return = o, o.child = i; } - function Xp(o, i) { + function Jp(o, i) { return o = po(22, o, null, i), o.lanes = 0, o; } - function Qp(o, i, d) { - return qs(i, o.child, null, d), o = Py( + function eh(o, i, d) { + return Ws(i, o.child, null, d), o = Ay( i, i.pendingProps.children ), o.flags |= 2, i.memoizedState = null, o; } - function n5(o, i, d, h, x, w, j, ae) { + function u5(o, i, d, h, x, w, B, oe) { if (d) - return i.flags & 256 ? (Wi(i), i.flags &= -257, Qp( + return i.flags & 256 ? (Vi(i), i.flags &= -257, eh( o, i, - ae - )) : i.memoizedState !== null ? (Vi(), i.child = o.child, i.flags |= 128, null) : (Vi(), w = x.fallback, j = i.mode, x = Xp( + oe + )) : i.memoizedState !== null ? (Ki(), i.child = o.child, i.flags |= 128, null) : (Ki(), w = x.fallback, B = i.mode, x = Jp( { mode: "visible", children: x.children }, - j - ), w = Ds( + B + ), w = Os( w, - j, - ae, + B, + oe, null - ), w.flags |= 2, x.return = i, w.return = i, x.sibling = w, i.child = x, qs(i, o.child, null, ae), x = i.child, x.memoizedState = Ey(ae), x.childLanes = Ry( + ), w.flags |= 2, x.return = i, w.return = i, x.sibling = w, i.child = x, Ws(i, o.child, null, oe), x = i.child, x.memoizedState = zy(oe), x.childLanes = My( o, h, - ae - ), i.memoizedState = wy, ad(null, x)); - if (Wi(i), ES(w)) { - if (h = w.nextSibling && w.nextSibling.dataset, h) var ge = h.dgst; - return h = ge, h !== "" && (x = Error(r(419)), x.stack = "", x.digest = h, Ku({ value: x, source: null, stack: null })), Qp( + oe + ), i.memoizedState = Iy, id(null, x)); + if (Vi(i), zS(w)) { + if (h = w.nextSibling && w.nextSibling.dataset, h) var ve = h.dgst; + return h = ve, h !== "" && (x = Error(r(419)), x.stack = "", x.digest = h, Gu({ value: x, source: null, stack: null })), eh( o, i, - ae + oe ); } - if (hr || ks(o, i, ae, !1), h = (ae & o.childLanes) !== 0, hr || h) { - if (qi.current !== null) - return Qp( + if (gr || js(o, i, oe, !1), h = (oe & o.childLanes) !== 0, gr || h) { + if (Wi.current !== null) + return eh( o, i, - ae + oe ); if (h = Vn, h !== null && (x = $n( h, - ae - ), x !== 0 && x !== j.retryLane)) - throw j.retryLane = x, As(o, x), bo(h, o, x), Cy; - return wS(w) || ph(), Qp( + oe + ), x !== 0 && x !== B.retryLane)) + throw B.retryLane = x, Ds(o, x), bo(h, o, x), Ny; + return IS(w) || bh(), eh( o, i, - ae + oe ); } - return wS(w) ? (i.flags |= 192, i.child = o.child, null) : (o = j.treeContext, Gn = Xo(w.nextSibling), zr = i, on = !0, Li = null, Ko = !1, o !== null && EP(i, o), i = Py( + return IS(w) ? (i.flags |= 192, i.child = o.child, null) : (o = B.treeContext, Gn = Qo(w.nextSibling), Ar = i, on = !0, ki = null, Go = !1, o !== null && AP(i, o), i = Ay( i, x.children ), i.flags |= 134221824, i); } - function qT(o, i, d) { + function JT(o, i, d) { o.lanes |= i; var h = o.alternate; - h !== null && (h.lanes |= i), Tp(o.return, i, d); + h !== null && (h.lanes |= i), zp(o.return, i, d); } - function WT(o) { + function eN(o) { for (var i = null; o !== null; ) { var d = o.alternate; - d !== null && Lp(d) === null && (i = o), o = o.sibling; + d !== null && Bp(d) === null && (i = o), o = o.sibling; } return i; } - function Yp(o, i, d, h, x, w) { - var j = o.memoizedState; - j === null ? o.memoizedState = { + function th(o, i, d, h, x, w) { + var B = o.memoizedState; + B === null ? o.memoizedState = { isBackwards: i, rendering: null, renderingStartTime: 0, @@ -5303,28 +5303,28 @@ Error generating stack: ` + h.message + ` tail: d, tailMode: x, treeForkCount: w - } : (j.isBackwards = i, j.rendering = null, j.renderingStartTime = 0, j.last = h, j.tail = d, j.tailMode = x, j.treeForkCount = w); + } : (B.isBackwards = i, B.rendering = null, B.renderingStartTime = 0, B.last = h, B.tail = d, B.tailMode = x, B.treeForkCount = w); } - function Ty(o) { + function Dy(o) { var i = o.child; for (o.child = null; i !== null; ) { var d = i.sibling; i.sibling = o.child, o.child = i, i = d; } } - function Ny(o, i, d) { + function Oy(o, i, d) { var h = i.pendingProps, x = h.revealOrder, w = h.tail; h = h.children; - var j = Hr.current; + var B = Ur.current; if (i.flags & 128) - return td(i, j), null; - var ae = (j & 2) !== 0; - if (ae ? (j = j & 1 | 2, i.flags |= 128) : j &= 1, td(i, j), x === "backwards" && o !== null ? (Ty(o), Rr(o, i, h, d), Ty(o)) : Rr(o, i, h, d), h = on ? Vu : 0, !ae && o !== null && (o.flags & 128) !== 0) + return nd(i, B), null; + var oe = (B & 2) !== 0; + if (oe ? (B = B & 1 | 2, i.flags |= 128) : B &= 1, nd(i, B), x === "backwards" && o !== null ? (Dy(o), Pr(o, i, h, d), Dy(o)) : Pr(o, i, h, d), h = on ? Ku : 0, !oe && o !== null && (o.flags & 128) !== 0) e: for (o = i.child; o !== null; ) { if (o.tag === 13) - o.memoizedState !== null && qT(o, d, i); + o.memoizedState !== null && JT(o, d, i); else if (o.tag === 19) - qT(o, d, i); + JT(o, d, i); else if (o.child !== null) { o.child.return = o, o = o.child; continue; @@ -5339,7 +5339,7 @@ Error generating stack: ` + h.message + ` } switch (x) { case "backwards": - d = WT(i.child), d === null ? (x = i.child, i.child = null) : (x = d.sibling, d.sibling = null, Ty(i)), Yp( + d = eN(i.child), d === null ? (x = i.child, i.child = null) : (x = d.sibling, d.sibling = null, Dy(i)), th( i, !0, x, @@ -5350,13 +5350,13 @@ Error generating stack: ` + h.message + ` break; case "unstable_legacy-backwards": for (d = null, x = i.child, i.child = null; x !== null; ) { - if (o = x.alternate, o !== null && Lp(o) === null) { + if (o = x.alternate, o !== null && Bp(o) === null) { i.child = x; break; } o = x.sibling, x.sibling = d, d = x, x = o; } - Yp( + th( i, !0, d, @@ -5366,7 +5366,7 @@ Error generating stack: ` + h.message + ` ); break; case "together": - Yp( + th( i, !1, null, @@ -5379,7 +5379,7 @@ Error generating stack: ` + h.message + ` i.memoizedState = null; break; default: - d = WT(i.child), d === null ? (x = i.child, i.child = null) : (x = d.sibling, d.sibling = null), Yp( + d = eN(i.child), d === null ? (x = i.child, i.child = null) : (x = d.sibling, d.sibling = null), th( i, !1, x, @@ -5390,14 +5390,14 @@ Error generating stack: ` + h.message + ` } return i.child; } - function VT(o, i, d) { + function tN(o, i, d) { var h = i.pendingProps; - return ji(i, i.type, h.value), Rr(o, i, h.children, d), i.child; + return Fi(i, i.type, h.value), Pr(o, i, h.children, d), i.child; } - function fi(o, i, d) { - if (o !== null && (i.dependencies = o.dependencies), Qi |= i.lanes, (d & i.childLanes) === 0) + function mi(o, i, d) { + if (o !== null && (i.dependencies = o.dependencies), Yi |= i.lanes, (d & i.childLanes) === 0) if (o !== null) { - if (ks( + if (js( o, i, d, @@ -5408,29 +5408,29 @@ Error generating stack: ` + h.message + ` if (o !== null && i.child !== o.child) throw Error(r(153)); if (i.child !== null) { - for (o = i.child, d = ii(o, o.pendingProps), i.child = d, d.return = i; o.sibling !== null; ) - o = o.sibling, d = d.sibling = ii(o, o.pendingProps), d.return = i; + for (o = i.child, d = si(o, o.pendingProps), i.child = d, d.return = i; o.sibling !== null; ) + o = o.sibling, d = d.sibling = si(o, o.pendingProps), d.return = i; d.sibling = null; } return i.child; } - function _y(o, i) { - return (o.lanes & i) !== 0 ? !0 : (o = o.dependencies, !!(o !== null && Np(o))); + function Ly(o, i) { + return (o.lanes & i) !== 0 ? !0 : (o = o.dependencies, !!(o !== null && Mp(o))); } - function r5(o, i, d) { + function d5(o, i, d) { switch (i.tag) { case 3: - qe(i, i.stateNode.containerInfo), ji(i, mr, o.memoizedState.cache), Os(); + We(i, i.stateNode.containerInfo), Fi(i, pr, o.memoizedState.cache), Ls(); break; case 27: case 5: - be(i); + ye(i); break; case 4: - qe(i, i.stateNode.containerInfo); + We(i, i.stateNode.containerInfo); break; case 10: - ji( + Fi( i, i.type, i.memoizedProps.value @@ -5438,90 +5438,90 @@ Error generating stack: ` + h.message + ` break; case 31: if (i.memoizedState !== null) - return i.flags |= 128, ty(i), null; + return i.flags |= 128, ly(i), null; break; case 13: var h = i.memoizedState; if (h !== null) { if (h.dehydrated !== null) - return Wi(i), i.flags |= 128, null; - h = ks( + return Vi(i), i.flags |= 128, null; + h = js( o, i, d, !1 ); var x = i.child.childLanes; - return h || (d & x) !== 0 ? UT(o, i, d) : (Wi(i), o = fi( + return h || (d & x) !== 0 ? ZT(o, i, d) : (Vi(i), o = mi( o, i, d ), o !== null ? o.sibling : null); } - Wi(i); + Vi(i); break; case 19: if (i.flags & 128) - return Ny( + return Oy( o, i, d ); - if (x = (o.flags & 128) !== 0, h = (d & i.childLanes) !== 0, h || (ks( + if (x = (o.flags & 128) !== 0, h = (d & i.childLanes) !== 0, h || (js( o, i, d, !1 ), h = (d & i.childLanes) !== 0), x) { if (h) - return Ny( + return Oy( o, i, d ); i.flags |= 128; } - if (x = i.memoizedState, x !== null && (x.rendering = null, x.tail = null, x.lastEffect = null), td(i, Hr.current), h) break; + if (x = i.memoizedState, x !== null && (x.rendering = null, x.tail = null, x.lastEffect = null), nd(i, Ur.current), h) break; return null; case 22: - return i.lanes = 0, LT( + return i.lanes = 0, VT( o, i, d, i.pendingProps ); case 24: - ji(i, mr, o.memoizedState.cache); + Fi(i, pr, o.memoizedState.cache); } - return fi(o, i, d); + return mi(o, i, d); } - function KT(o, i, d) { + function nN(o, i, d) { if (o !== null) if (o.memoizedProps !== i.pendingProps) - hr = !0; + gr = !0; else { - if (!_y(o, d) && (i.flags & 128) === 0) - return hr = !1, r5( + if (!Ly(o, d) && (i.flags & 128) === 0) + return gr = !1, d5( o, i, d ); - hr = (o.flags & 131072) !== 0; + gr = (o.flags & 131072) !== 0; } else - hr = !1, on && (i.flags & 1048576) !== 0 && wP(i, Vu, i.index); + gr = !1, on && (i.flags & 1048576) !== 0 && MP(i, Ku, i.index); switch (i.lanes = 0, i.tag) { case 16: e: { var h = i.pendingProps; - if (o = Hs(i.elementType), i.type = o, typeof o == "function") - Lb(o) ? (h = Vs(o, h), i.tag = 1, i = BT( + if (o = Us(i.elementType), i.type = o, typeof o == "function") + qb(o) ? (h = Ks(o, h), i.tag = 1, i = QT( null, i, o, h, d - )) : (i.tag = 0, i = $y( + )) : (i.tag = 0, i = _y( null, i, o, @@ -5531,8 +5531,8 @@ Error generating stack: ` + h.message + ` else { if (o != null) { var x = o.$$typeof; - if (x === H) { - i.tag = 11, i = AT( + if (x === U) { + i.tag = 11, i = UT( null, i, o, @@ -5540,8 +5540,8 @@ Error generating stack: ` + h.message + ` d ); break e; - } else if (x === X) { - i.tag = 14, i = DT( + } else if (x === G) { + i.tag = 14, i = qT( null, i, o, @@ -5549,8 +5549,8 @@ Error generating stack: ` + h.message + ` d ); break e; - } else if (x === U) { - i.tag = 10, i.type = o, i = VT( + } else if (x === q) { + i.tag = 10, i.type = o, i = tN( null, i, d @@ -5563,7 +5563,7 @@ Error generating stack: ` + h.message + ` } return i; case 0: - return $y( + return _y( o, i, i.type, @@ -5571,10 +5571,10 @@ Error generating stack: ` + h.message + ` d ); case 1: - return h = i.type, x = Vs( + return h = i.type, x = Ks( h, i.pendingProps - ), BT( + ), QT( o, i, h, @@ -5583,26 +5583,26 @@ Error generating stack: ` + h.message + ` ); case 3: e: { - if (qe( + if (We( i, i.stateNode.containerInfo ), o === null) throw Error(r(387)); h = i.pendingProps; var w = i.memoizedState; - x = w.element, Qb(o, i), ed(i, h, null, d); - var j = i.memoizedState; - if (h = j.cache, ji(i, mr, h), h !== w.cache && qb( + x = w.element, ry(o, i), td(i, h, null, d); + var B = i.memoizedState; + if (h = B.cache, Fi(i, pr, h), h !== w.cache && Yb( i, - [mr], + [pr], d, !0 - ), Ju(), h = j.element, w.isDehydrated) + ), ed(), h = B.element, w.isDehydrated) if (w = { element: h, isDehydrated: !1, - cache: j.cache + cache: B.cache }, i.updateQueue.baseState = w, i.memoizedState = w, i.flags & 256) { - i = HT( + i = YT( o, i, h, @@ -5610,10 +5610,10 @@ Error generating stack: ` + h.message + ` ); break e; } else if (h !== x) { - x = qo( + x = Wo( Error(r(424)), i - ), Ku(x), i = HT( + ), Gu(x), i = YT( o, i, h, @@ -5621,7 +5621,7 @@ Error generating stack: ` + h.message + ` ); break e; } else - for (o = i.stateNode.containerInfo, o.nodeType === 9 ? o = o.body : o = o.nodeName === "HTML" ? o.ownerDocument.body : o, Gn = Xo(o.firstChild), zr = i, on = !0, Li = null, Ko = !0, d = LP( + for (o = i.stateNode.containerInfo, o.nodeType === 9 ? o = o.body : o = o.nodeName === "HTML" ? o.ownerDocument.body : o, Gn = Qo(o.firstChild), Ar = i, on = !0, ki = null, Go = !0, d = VP( i, null, h, @@ -5629,81 +5629,81 @@ Error generating stack: ` + h.message + ` ), i.child = d; d; ) d.flags = d.flags & -3 | 134221824, d = d.sibling; else { - if (Os(), h === x) { - i = fi( + if (Ls(), h === x) { + i = mi( o, i, d ); break e; } - Rr(o, i, h, d); + Pr(o, i, h, d); } i = i.child; } return i; case 26: - return uc(o, i), o === null ? (d = b_( + return dc(o, i), o === null ? (d = P_( i.type, null, i.pendingProps, null - )) ? i.memoizedState = d : on || (i.stateNode = YN( + )) ? i.memoizedState = d : on || (i.stateNode = i_( i.type, i.pendingProps, - Me.current, + $e.current, i - )) : i.memoizedState = b_( + )) : i.memoizedState = P_( i.type, o.memoizedProps, i.pendingProps, o.memoizedState ), null; case 27: - return be(i), o === null && on && (h = i.stateNode = p_( + return ye(i), o === null && on && (h = i.stateNode = $_( i.type, i.pendingProps, - Me.current - ), zr = i, Ko = !0, x = Gn, es(i.type) ? (RS = x, Gn = Xo(h.firstChild)) : Gn = x), Rr( + $e.current + ), Ar = i, Go = !0, x = Gn, ts(i.type) ? (MS = x, Gn = Qo(h.firstChild)) : Gn = x), Pr( o, i, i.pendingProps.children, d - ), uc(o, i), o === null && (i.flags |= 4194304), i.child; + ), dc(o, i), o === null && (i.flags |= 4194304), i.child; case 5: - return o === null && on && ((x = h = Gn) && (h = Y5( + return o === null && on && ((x = h = Gn) && (h = aU( h, i.type, i.pendingProps, - Ko - ), h !== null ? (i.stateNode = h, zr = i, Gn = Xo(h.firstChild), Ko = !1, x = !0) : x = !1), x || ki(i)), be(i), x = i.type, w = i.pendingProps, j = o !== null ? o.memoizedProps : null, h = w.children, vS(x, w) ? h = null : j !== null && vS(x, j) && (i.flags |= 32), i.memoizedState !== null && (x = oy( + Go + ), h !== null ? (i.stateNode = h, Ar = i, Gn = Qo(h.firstChild), Go = !1, x = !0) : x = !1), x || ji(i)), ye(i), x = i.type, w = i.pendingProps, B = o !== null ? o.memoizedProps : null, h = w.children, wS(x, w) ? h = null : B !== null && wS(x, B) && (i.flags |= 32), i.memoizedState !== null && (x = dy( o, i, - V6, + e5, null, null, d - ), Tc._currentValue = x), uc(o, i), Rr(o, i, h, d), i.child; + ), Nc._currentValue = x), dc(o, i), Pr(o, i, h, d), i.child; case 6: - return o === null && on && ((o = d = Gn) && (d = Z5( + return o === null && on && ((o = d = Gn) && (d = iU( d, i.pendingProps, - Ko - ), d !== null ? (i.stateNode = d, zr = i, Gn = null, o = !0) : o = !1), o || ki(i)), null; + Go + ), d !== null ? (i.stateNode = d, Ar = i, Gn = null, o = !0) : o = !1), o || ji(i)), null; case 13: - return UT(o, i, d); + return ZT(o, i, d); case 4: - return qe( + return We( i, i.stateNode.containerInfo - ), h = i.pendingProps, o === null ? i.child = qs( + ), h = i.pendingProps, o === null ? i.child = Ws( i, null, h, d - ) : Rr(o, i, h, d), i.child; + ) : Pr(o, i, h, d), i.child; case 11: - return AT( + return UT( o, i, i.type, @@ -5711,27 +5711,27 @@ Error generating stack: ` + h.message + ` d ); case 7: - return h = i.pendingProps, uc(o, i), Rr(o, i, h, d), i.child; + return h = i.pendingProps, dc(o, i), Pr(o, i, h, d), i.child; case 8: - return Rr( + return Pr( o, i, i.pendingProps.children, d ), i.child; case 12: - return Rr( + return Pr( o, i, i.pendingProps.children, d ), i.child; case 10: - return VT(o, i, d); + return tN(o, i, d); case 9: - return x = i.type._context, h = i.pendingProps.children, js(i), x = Fr(x), h = h(x), i.flags |= 1, Rr(o, i, h, d), i.child; + return x = i.type._context, h = i.pendingProps.children, Fs(i), x = Br(x), h = h(x), i.flags |= 1, Pr(o, i, h, d), i.child; case 14: - return DT( + return qT( o, i, i.type, @@ -5739,7 +5739,7 @@ Error generating stack: ` + h.message + ` d ); case 15: - return OT( + return WT( o, i, i.type, @@ -5747,23 +5747,23 @@ Error generating stack: ` + h.message + ` d ); case 19: - return Ny(o, i, d); + return Oy(o, i, d); case 31: - return t5(o, i, d); + return c5(o, i, d); case 22: - return LT( + return VT( o, i, d, i.pendingProps ); case 24: - return js(i), h = Fr(mr), o === null ? (x = Kb(), x === null && (x = Vn, w = Wb(), x.pooledCache = w, w.refCount++, w !== null && (x.pooledCacheLanes |= d), x = w), i.memoizedState = { parent: h, cache: x }, Xb(i), ji(i, mr, x)) : ((o.lanes & d) !== 0 && (Qb(o, i), ed(i, null, null, d), Ju()), x = o.memoizedState, w = i.memoizedState, x.parent !== h ? (x = { parent: h, cache: h }, i.memoizedState = x, i.lanes === 0 && (i.memoizedState = i.updateQueue.baseState = x), ji(i, mr, h)) : (h = w.cache, ji(i, mr, h), h !== x.cache && qb( + return Fs(i), h = Br(pr), o === null ? (x = ey(), x === null && (x = Vn, w = Zb(), x.pooledCache = w, w.refCount++, w !== null && (x.pooledCacheLanes |= d), x = w), i.memoizedState = { parent: h, cache: x }, ny(i), Fi(i, pr, x)) : ((o.lanes & d) !== 0 && (ry(o, i), td(i, null, null, d), ed()), x = o.memoizedState, w = i.memoizedState, x.parent !== h ? (x = { parent: h, cache: h }, i.memoizedState = x, i.lanes === 0 && (i.memoizedState = i.updateQueue.baseState = x), Fi(i, pr, h)) : (h = w.cache, Fi(i, pr, h), h !== x.cache && Yb( i, - [mr], + [pr], d, !0 - ))), Rr( + ))), Pr( o, i, i.pendingProps.children, @@ -5775,37 +5775,37 @@ Error generating stack: ` + h.message + ` paired: null, clones: null, ref: null - }), h = i.pendingProps, h.name != null && h.name !== "auto" ? i.flags |= o === null ? 18882560 : 18874368 : on && Rp(i), o !== null && o.memoizedProps.name !== h.name ? i.flags |= 4194816 : uc(o, i), Rr(o, i, h.children, d), i.child; + }), h = i.pendingProps, h.name != null && h.name !== "auto" ? i.flags |= o === null ? 18882560 : 18874368 : on && _p(i), o !== null && o.memoizedProps.name !== h.name ? i.flags |= 4194816 : dc(o, i), Pr(o, i, h.children, d), i.child; case 29: throw i.pendingProps; } throw Error(r(156, i.tag)); } - function mi(o) { + function pi(o) { o.flags |= 4; } - function Iy(o, i, d, h, x) { + function ky(o, i, d, h, x) { var w; - if ((w = (o.mode & 32) !== 0) && (w = d === null ? C_(i, h) : C_(i, h) && (h.src !== d.src || h.srcSet !== d.srcSet)), w) { + if ((w = (o.mode & 32) !== 0) && (w = d === null ? I_(i, h) : I_(i, h) && (h.src !== d.src || h.srcSet !== d.srcSet)), w) { if (o.flags |= 16777216, (x & 335544128) === x) if (o.stateNode.complete) o.flags |= 8192; - else if (TN()) o.flags |= 8192; + else if (LN()) o.flags |= 8192; else - throw Us = zp, Gb; + throw qs = Lp, ty; } else o.flags &= -16777217; } - function GT(o, i) { + function rN(o, i) { if (i.type !== "stylesheet" || (i.state.loading & 4) !== 0) o.flags &= -16777217; - else if (o.flags |= 16777216, !$_(i)) - if (TN()) o.flags |= 8192; + else if (o.flags |= 16777216, !z_(i)) + if (LN()) o.flags |= 8192; else - throw Us = zp, Gb; + throw qs = Lp, ty; } - function Zp(o, i) { - i !== null && (o.flags |= 4), o.flags & 16384 && (i = o.tag !== 22 ? ht() : 536870912, o.lanes |= i, hc |= i); + function nh(o, i) { + i !== null && (o.flags |= 4), o.flags & 16384 && (i = o.tag !== 22 ? ht() : 536870912, o.lanes |= i, gc |= i); } - function id(o, i) { + function sd(o, i) { if (!on) switch (o.tailMode) { case "visible": @@ -5831,9 +5831,9 @@ Error generating stack: ` + h.message + ` d |= x.lanes | x.childLanes, h |= x.subtreeFlags, h |= x.flags, x.return = o, x = x.sibling; return o.subtreeFlags |= h, o.childLanes = d, i; } - function o5(o, i, d) { + function f5(o, i, d) { var h = i.pendingProps; - switch (Fb(i), i.tag) { + switch (Kb(i), i.tag) { case 16: case 15: case 0: @@ -5847,16 +5847,16 @@ Error generating stack: ` + h.message + ` case 1: return Xn(i), null; case 3: - return d = i.stateNode, h = null, o !== null && (h = o.memoizedState.cache), i.memoizedState.cache !== h && (i.flags |= 2048), ci(mr), ke(), d.pendingContext && (d.context = d.pendingContext, d.pendingContext = null), (o === null || o.child === null) && (rc(i) ? mi(i) : o === null || o.memoizedState.isDehydrated && (i.flags & 256) === 0 || (i.flags |= 1024, Hb())), Xn(i), null; + return d = i.stateNode, h = null, o !== null && (h = o.memoizedState.cache), i.memoizedState.cache !== h && (i.flags |= 2048), ui(pr), ke(), d.pendingContext && (d.context = d.pendingContext, d.pendingContext = null), (o === null || o.child === null) && (oc(i) ? pi(i) : o === null || o.memoizedState.isDehydrated && (i.flags & 256) === 0 || (i.flags |= 1024, Xb())), Xn(i), null; case 26: var x = i.type, w = i.memoizedState; - return o === null ? (mi(i), w !== null ? (Xn(i), GT(i, w)) : (Xn(i), Iy( + return o === null ? (pi(i), w !== null ? (Xn(i), rN(i, w)) : (Xn(i), ky( i, x, null, h, d - ))) : w ? w !== o.memoizedState ? (mi(i), Xn(i), GT(i, w)) : (Xn(i), i.flags &= -16777217) : (o = o.memoizedProps, o !== h && mi(i), Xn(i), Iy( + ))) : w ? w !== o.memoizedState ? (pi(i), Xn(i), rN(i, w)) : (Xn(i), i.flags &= -16777217) : (o = o.memoizedProps, o !== h && pi(i), Xn(i), ky( i, x, o, @@ -5864,41 +5864,41 @@ Error generating stack: ` + h.message + ` d )), null; case 27: - if (Ee(i), d = Me.current, x = i.type, o !== null && i.stateNode != null) - o.memoizedProps !== h && mi(i); + if (Re(i), d = $e.current, x = i.type, o !== null && i.stateNode != null) + o.memoizedProps !== h && pi(i); else { if (!h) { if (i.stateNode === null) throw Error(r(166)); return Xn(i), i.subtreeFlags &= -33554433, null; } - o = me.current, rc(i) ? RP(i) : (o = p_(x, h, d), i.stateNode = o, mi(i)); + o = ge.current, oc(i) ? DP(i) : (o = $_(x, h, d), i.stateNode = o, pi(i)); } return Xn(i), i.subtreeFlags &= -33554433, null; case 5: - if (Ee(i), x = i.type, o !== null && i.stateNode != null) - o.memoizedProps !== h && mi(i); + if (Re(i), x = i.type, o !== null && i.stateNode != null) + o.memoizedProps !== h && pi(i); else { if (!h) { if (i.stateNode === null) throw Error(r(166)); return Xn(i), i.subtreeFlags &= -33554433, null; } - if (w = me.current, rc(i)) - RP(i); + if (w = ge.current, oc(i)) + DP(i); else { - var j = vd( - Me.current + var B = bd( + $e.current ); switch (w) { case 1: - w = j.createElementNS( + w = B.createElementNS( "http://www.w3.org/2000/svg", x ); break; case 2: - w = j.createElementNS( + w = B.createElementNS( "http://www.w3.org/1998/Math/MathML", x ); @@ -5906,49 +5906,49 @@ Error generating stack: ` + h.message + ` default: switch (x) { case "svg": - w = j.createElementNS( + w = B.createElementNS( "http://www.w3.org/2000/svg", x ); break; case "math": - w = j.createElementNS( + w = B.createElementNS( "http://www.w3.org/1998/Math/MathML", x ); break; case "script": - w = j.createElement("div"), w.innerHTML = "{{else}}

{{.Text.NoProducts}}

This category is available but has no published products.

{{end}} {{end}} {{template "public-footer" .}}{{end}}