@blade-hq/agent-react 2612.0.0-beta.77 → 2612.0.0-beta.78

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/README.md +12 -2
  2. package/dist/SessionPluginConfigForm-7LJ5SUNY.js +9 -0
  3. package/dist/SessionPluginConfigForm-7LJ5SUNY.js.map +1 -0
  4. package/dist/chat/LiteMessageList.d.ts +4 -0
  5. package/dist/{chunk-IVGTMWRV.js → chunk-66JXSDLB.js} +284 -289
  6. package/dist/chunk-66JXSDLB.js.map +1 -0
  7. package/dist/{chunk-VBHHFIII.js → chunk-C3LBNHVM.js} +12 -10
  8. package/dist/{chunk-VBHHFIII.js.map → chunk-C3LBNHVM.js.map} +1 -1
  9. package/dist/chunk-F4MWGSKX.js +1308 -0
  10. package/dist/chunk-F4MWGSKX.js.map +1 -0
  11. package/dist/{chunk-ZIECHNZA.js → chunk-FBGCDXRK.js} +110 -115
  12. package/dist/chunk-FBGCDXRK.js.map +1 -0
  13. package/dist/{chunk-26NE55SJ.js → chunk-FDB3J5QF.js} +8 -6
  14. package/dist/{chunk-26NE55SJ.js.map → chunk-FDB3J5QF.js.map} +1 -1
  15. package/dist/{chunk-WO2VCQ5N.js → chunk-FH5HA3GW.js} +551 -455
  16. package/dist/chunk-FH5HA3GW.js.map +1 -0
  17. package/dist/chunk-KHJEIHMJ.js +973 -0
  18. package/dist/chunk-KHJEIHMJ.js.map +1 -0
  19. package/dist/{chunk-XBEN2ASY.js → chunk-MWILWSPG.js} +4262 -3186
  20. package/dist/chunk-MWILWSPG.js.map +1 -0
  21. package/dist/{chunk-EQOKPZI2.js → chunk-NRYLAO3X.js} +87 -154
  22. package/dist/chunk-NRYLAO3X.js.map +1 -0
  23. package/dist/{chunk-F2IJZX2Z.js → chunk-SK43YNRX.js} +151 -1442
  24. package/dist/chunk-SK43YNRX.js.map +1 -0
  25. package/dist/components/BrowserConnectionDialog.d.ts +3 -2
  26. package/dist/components/ConfigConnection.d.ts +16 -0
  27. package/dist/components/ConnectorDetail.d.ts +46 -0
  28. package/dist/components/ConnectorRulesPanel.d.ts +2 -1
  29. package/dist/components/ConnectorRuntimeDiagnostics.d.ts +2 -2
  30. package/dist/components/DeviceConnection.d.ts +3 -1
  31. package/dist/components/FeishuPermissionStatus.d.ts +3 -1
  32. package/dist/components/ManagedConnection.d.ts +5 -2
  33. package/dist/components/PackEventNotice.d.ts +3 -0
  34. package/dist/components/SessionPluginConfigForm.d.ts +2 -1
  35. package/dist/connectors.d.ts +3 -0
  36. package/dist/connectors.js +7 -2
  37. package/dist/embed/entry.d.ts +4 -0
  38. package/dist/index.d.ts +3 -0
  39. package/dist/index.js +13 -7
  40. package/dist/internal.js +16 -9
  41. package/dist/internal.js.map +1 -1
  42. package/dist/questions.js +8 -6
  43. package/dist/questions.js.map +1 -1
  44. package/dist/rich-input.js +16 -13
  45. package/dist/rich-input.js.map +1 -1
  46. package/dist/style.full.css +1 -1
  47. package/dist/tool-details.js +5 -4
  48. package/dist/tool-details.js.map +1 -1
  49. package/package.json +2 -2
  50. package/public-api.md +41 -3
  51. package/dist/chunk-EQOKPZI2.js.map +0 -1
  52. package/dist/chunk-F2IJZX2Z.js.map +0 -1
  53. package/dist/chunk-IVGTMWRV.js.map +0 -1
  54. package/dist/chunk-WO2VCQ5N.js.map +0 -1
  55. package/dist/chunk-XBEN2ASY.js.map +0 -1
  56. package/dist/chunk-ZIECHNZA.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../node_modules/.pnpm/fast-uri@4.1.4/node_modules/fast-uri/lib/utils.js","../../../node_modules/.pnpm/fast-uri@4.1.4/node_modules/fast-uri/lib/schemes.js","../../../node_modules/.pnpm/fast-uri@4.1.4/node_modules/fast-uri/index.js","../../../node_modules/.pnpm/jsonpointer@5.0.1/node_modules/jsonpointer/jsonpointer.js","../../../node_modules/.pnpm/react-is@18.3.1/node_modules/react-is/cjs/react-is.development.js","../../../node_modules/.pnpm/react-is@18.3.1/node_modules/react-is/index.js","../../../node_modules/.pnpm/@cfworker+json-schema@4.1.1/node_modules/@cfworker/json-schema/dist/esm/deep-compare-strict.js","../../../node_modules/.pnpm/@cfworker+json-schema@4.1.1/node_modules/@cfworker/json-schema/dist/esm/pointer.js","../../../node_modules/.pnpm/@cfworker+json-schema@4.1.1/node_modules/@cfworker/json-schema/dist/esm/dereference.js","../../../node_modules/.pnpm/@cfworker+json-schema@4.1.1/node_modules/@cfworker/json-schema/dist/esm/format.js","../../../node_modules/.pnpm/@cfworker+json-schema@4.1.1/node_modules/@cfworker/json-schema/dist/esm/types.js","../../../node_modules/.pnpm/@cfworker+json-schema@4.1.1/node_modules/@cfworker/json-schema/dist/esm/ucs2-length.js","../../../node_modules/.pnpm/@cfworker+json-schema@4.1.1/node_modules/@cfworker/json-schema/dist/esm/validate.js","../../../node_modules/.pnpm/@cfworker+json-schema@4.1.1/node_modules/@cfworker/json-schema/dist/esm/validator.js","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/Form.tsx","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/isObject.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/allowAdditionalItems.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/getDecimalSeparator.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/asNumber.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/constants.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/getUiOptions.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/canExpand.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/isPlainObject.ts","../../../node_modules/.pnpm/fast-equals@6.0.3/node_modules/fast-equals/dist/es/index.mjs","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/deepEquals.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/findSchemaDefinition.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/pathUtils.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/getDiscriminatorFieldFromSchema.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/guessType.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/getSchemaType.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/mergeSchemas.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/getPropertySchema.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/getOptionMatchingSimpleDiscriminator.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/schema/getFirstMatchingOption.ts","../../../node_modules/.pnpm/@x0k+json-schema-merge@1.0.5/node_modules/@x0k/json-schema-merge/src/lib/object.ts","../../../node_modules/.pnpm/@x0k+json-schema-merge@1.0.5/node_modules/@x0k/json-schema-merge/src/lib/json-schema/json-schema.ts","../../../node_modules/.pnpm/@x0k+json-schema-merge@1.0.5/node_modules/@x0k/json-schema-merge/src/lib/ord.ts","../../../node_modules/.pnpm/@x0k+json-schema-merge@1.0.5/node_modules/@x0k/json-schema-merge/src/lib/array.ts","../../../node_modules/.pnpm/@x0k+json-schema-merge@1.0.5/node_modules/@x0k/json-schema-merge/src/lib/memoize.ts","../../../node_modules/.pnpm/@x0k+json-schema-merge@1.0.5/node_modules/@x0k/json-schema-merge/src/lib/json-schema/compare/compare.ts","../../../node_modules/.pnpm/@x0k+json-schema-merge@1.0.5/node_modules/@x0k/json-schema-merge/src/lib/function.ts","../../../node_modules/.pnpm/@x0k+json-schema-merge@1.0.5/node_modules/@x0k/json-schema-merge/src/lib/math.ts","../../../node_modules/.pnpm/@x0k+json-schema-merge@1.0.5/node_modules/@x0k/json-schema-merge/src/lib/json-schema/merge/patterns.ts","../../../node_modules/.pnpm/@x0k+json-schema-merge@1.0.5/node_modules/@x0k/json-schema-merge/src/lib/json-schema/merge/merge.ts","../../../node_modules/.pnpm/@x0k+json-schema-merge@1.0.5/node_modules/@x0k/json-schema-merge/src/lib/json-schema/merge/all-of-merge.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/schema/shallowAllOfMerge.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/schema/retrieveSchema.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/schema/findSelectedOptionInXxxOf.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/schema/getFromSchema.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/schema/findFieldInSchema.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/schema/getClosestMatchingOption.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/constIsAjvDataReference.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/isConstant.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/isFixedItems.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/mergeDefaultsWithFormData.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/mergeObjects.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/toConstant.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/optionsList.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/schema/isSelect.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/schema/isMultiSelect.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/schema/getDefaultFormState.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/isCustomWidget.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/schema/isFilesArray.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/schema/getDisplayLabel.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/schema/omitExtraData.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/schema/sanitizeDataForNewSchema.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/schema/toPathSchema.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/createSchemaUtils.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/dataURItoBlob.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/pad.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/dateRangeOptions.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/replaceStringParameters.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/englishStringTranslator.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/enumOptionsValueForIndex.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/enumOptionsDeselectValue.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/enumOptionsIsSelected.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/enumOptionsIndexForValue.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/enumOptionSelectedValue.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/enumOptionsSelectValue.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/enumOptionValueDecoder.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/enumOptionValueEncoder.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/ErrorSchemaBuilder.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/getChangedFields.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/getDateElementProps.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/rangeSpec.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/getInputProps.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/getOptionValueFormat.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/getSubmitButtonOptions.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/getTemplate.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/getTestIds.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/getWidget.tsx","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/hashForSchema.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/hasWidget.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/idGenerators.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/isFormDataAvailable.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/isRootSchema.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/labelValue.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/localToUTC.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/logUnsupportedDefaultForEnum.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/lookupFromFormContext.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/noop.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/orderProperties.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/parseDateString.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/resolveUiSchema.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/schemaRequiresTrueValue.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/SelectedOptionDescription.tsx","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/shallowEquals.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/shouldRender.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/shouldRenderOptionalField.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/toDateString.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/toErrorList.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/toFieldPathId.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/useAltDateWidgetProps.tsx","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/useDeepCompareMemo.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/useFileWidgetProps.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/utcToLocal.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/validationDataMerge.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/withIdRefPrefix.ts","../../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/src/enums.ts","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/fields/ArrayField.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/fields/BooleanField.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/fields/CyclicSchemaField.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/fields/FallbackField.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/fields/LayoutGridField.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/fields/LayoutHeaderField.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/fields/LayoutMultiSchemaField.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/fields/MultiSchemaField.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/fields/NullField.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/fields/NumberField.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/fields/ObjectField.tsx","../../../node_modules/.pnpm/markdown-to-jsx@9.10.2_react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/markdown-to-jsx/dist/react.js","../../../node_modules/.pnpm/markdown-to-jsx@9.10.2_react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/markdown-to-jsx/dist/entities.browser.js","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/constants.ts","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/fields/OptionalDataControlsField.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/fields/SchemaField.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/fields/StringField.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/fields/index.ts","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/templates/ArrayFieldDescriptionTemplate.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/templates/ArrayFieldItemButtonsTemplate.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/templates/ArrayFieldItemTemplate.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/templates/ArrayFieldTemplate.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/templates/ArrayFieldTitleTemplate.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/templates/BaseInputTemplate.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/SchemaExamples.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/templates/ButtonTemplates/IconButton.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/templates/ButtonTemplates/AddButton.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/templates/ButtonTemplates/SubmitButton.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/templates/ButtonTemplates/index.ts","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/templates/CyclicSchemaExpandTemplate.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/RichDescription.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/templates/DescriptionField.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/templates/ErrorList.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/templates/FallbackFieldTemplate.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/templates/FieldErrorTemplate.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/RichHelp.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/templates/FieldHelpTemplate.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/templates/FieldTemplate/Label.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/templates/FieldTemplate/FieldTemplate.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/templates/FieldTemplate/index.ts","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/templates/GridTemplate.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/templates/MultiSchemaFieldTemplate.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/templates/ObjectFieldTemplate.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/templates/OptionalDataControlsTemplate.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/templates/TitleField.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/templates/UnsupportedField.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/templates/WrapIfAdditionalTemplate.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/templates/index.ts","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/widgets/AltDateTimeWidget.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/widgets/AltDateWidget.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/widgets/CheckboxesWidget.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/widgets/CheckboxWidget.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/widgets/ColorWidget.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/widgets/DateTimeWidget.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/widgets/DateWidget.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/widgets/EmailWidget.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/widgets/FileWidget.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/widgets/HiddenWidget.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/widgets/PasswordWidget.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/widgets/RadioWidget.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/widgets/RangeWidget.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/widgets/RatingWidget.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/widgets/SelectWidget.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/widgets/TextareaWidget.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/widgets/TextWidget.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/widgets/TimeWidget.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/widgets/UpDownWidget.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/widgets/URLWidget.tsx","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/components/widgets/index.ts","../../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/src/getDefaultRegistry.ts","../src/components/SessionPluginConfigForm.tsx","../src/components/plugin-config-schema.ts","../src/components/plugin-config-draft.ts"],"sourcesContent":["'use strict'\n\n/** @type {(value: string) => boolean} */\nconst isUUID = RegExp.prototype.test.bind(/^[\\da-f]{8}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{12}$/iu)\n\n/** @type {(value: string) => boolean} */\nconst isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d)$/u)\n\n/** @type {(value: string) => boolean} */\nconst isPort = RegExp.prototype.test.bind(/^\\d*$/u)\n\n/** @type {(value: string) => boolean} */\nconst isHexPair = RegExp.prototype.test.bind(/^[\\da-f]{2}$/iu)\n\n/** @type {(value: string) => boolean} */\nconst isUnreserved = RegExp.prototype.test.bind(/^[\\da-z\\-._~]$/iu)\n\n/** @type {(value: string) => boolean} */\nconst isPathCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\\-._~!$&'()*+,;=:@/]$/u)\n\n/** @type {(value: string) => boolean} */\nconst isQueryFragmentCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\\-._~!$&'()*+,;=:@/?]$/u)\n\n/** @type {(value: string) => boolean} */\nconst isUserinfoCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\\-._~!$&'()*+,;=:]$/u)\n\n/**\n * @param {Array<string>} input\n * @returns {string}\n */\nfunction stringArrayToHexStripped (input) {\n let acc = ''\n let code = 0\n let i = 0\n\n for (i = 0; i < input.length; i++) {\n code = input[i].charCodeAt(0)\n if (code === 48) {\n continue\n }\n if (!((code >= 48 && code <= 57) || (code >= 65 && code <= 70) || (code >= 97 && code <= 102))) {\n return ''\n }\n acc += input[i]\n break\n }\n\n for (i += 1; i < input.length; i++) {\n code = input[i].charCodeAt(0)\n if (!((code >= 48 && code <= 57) || (code >= 65 && code <= 70) || (code >= 97 && code <= 102))) {\n return ''\n }\n acc += input[i]\n }\n return acc\n}\n\n/** @type {(value: string) => boolean} */\nconst isHextet = RegExp.prototype.test.bind(/^[\\dA-Fa-f]{1,4}$/)\n\n/** @type {(value: string) => boolean} */\nconst isIPvFuture = RegExp.prototype.test.bind(/^[vV][\\dA-Fa-f]+\\.[A-Za-z\\d\\-._~!$&'()*+,;=:]+$/)\n\n/** @type {(value: string) => boolean} */\nconst isZoneCharacter = RegExp.prototype.test.bind(/^[A-Za-z\\d\\-._~]$/)\n\n/**\n * @param {string} value\n * @returns {boolean}\n */\nconst nonSimpleDomain = RegExp.prototype.test.bind(/[^!\"$&'()*+,\\-.;=_`a-z{}~]/u)\n\n/** @type {(value: string) => boolean} */\nconst nonSimpleDomainChars = RegExp.prototype.test.bind(/[^\\d!\"$&'()*+,\\-.;=_`a-z{}~]/u)\n\n/** @type {(value: string) => boolean} */\nconst numericLastLabel = RegExp.prototype.test.bind(/(?:^|\\.)\\d+$/u)\n\n/**\n * True when `new URL('http://' + domain).hostname` may differ from `domain`,\n * i.e. when the caller must fall back to the WHATWG parser.\n *\n * Same purpose as `nonSimpleDomain`, but digits are allowed: for this character\n * set `hostname` is the identity, *except* that an all-numeric final label is\n * read as IPv4 shorthand (\"1.2.3\" -> \"1.2.0.3\", \"127.1\" -> \"127.0.0.1\",\n * \"a.b.1\" throws), which is why `nonSimpleDomain` excludes digits outright.\n * Rejecting that one shape lets the common `mail2.example.org` case stay on the\n * fast path.\n *\n * @param {string} domain - must already be lowercased\n * @returns {boolean}\n */\nfunction nonSimpleMailtoDomain (domain) {\n return nonSimpleDomainChars(domain) || numericLastLabel(domain)\n}\n\n/**\n * @param {string} zone\n * @returns {boolean}\n */\nfunction isZoneIdentifier (zone) {\n if (zone.length === 0) return false\n\n for (let i = 0; i < zone.length; i++) {\n if (isZoneCharacter(zone[i])) continue\n if (zone[i] === '%' && i + 2 < zone.length && isHexPair(zone.slice(i + 1, i + 3))) {\n i += 2\n continue\n }\n return false\n }\n\n return true\n}\n\n/**\n * Compresses the longest run of zero hextets to \"::\" per RFC 5952. A run of a\n * single zero hextet is left uncompressed. On ties the leftmost run wins.\n *\n * @param {string[]} hextets\n * @returns {string}\n */\nfunction compressIPv6ZeroRun (hextets) {\n let bestStart = -1\n let bestLength = 0\n let runStart = -1\n let runLength = 0\n for (let i = 0; i < hextets.length; i++) {\n if (hextets[i] === '0') {\n if (runStart === -1) runStart = i\n runLength++\n if (runLength > bestLength) {\n bestLength = runLength\n bestStart = runStart\n }\n } else {\n runStart = -1\n runLength = 0\n }\n }\n\n if (bestLength < 2) return hextets.join(':')\n\n const head = hextets.slice(0, bestStart).join(':')\n const tail = hextets.slice(bestStart + bestLength).join(':')\n return head + '::' + tail\n}\n\n/**\n * Validates an IPv6 address against the alternatives in RFC 3986 section\n * 3.2.2 and returns the same address with leading hextet zeroes removed.\n * An embedded IPv4 address counts as two hextets and is only valid at the end.\n *\n * @param {string} input\n * @returns {string|undefined}\n */\nfunction normalizeIPv6Address (input) {\n const compression = input.indexOf('::')\n if (compression !== -1 && input.indexOf('::', compression + 1) !== -1) return undefined\n\n const left = compression === -1 ? input.split(':') : input.slice(0, compression).split(':')\n const right = compression === -1 ? [] : input.slice(compression + 2).split(':')\n if (compression !== -1) {\n if (left.length === 1 && left[0] === '') left.length = 0\n if (right.length === 1 && right[0] === '') right.length = 0\n }\n\n const parts = left.concat(right)\n let hextetCount = 0\n for (let i = 0; i < parts.length; i++) {\n const part = parts[i]\n if (part === '') return undefined\n\n if (part.indexOf('.') !== -1) {\n if (i !== parts.length - 1 || (compression !== -1 && right.length === 0) || !isIPv4(part)) return undefined\n hextetCount += 2\n continue\n }\n\n if (!isHextet(part)) return undefined\n parts[i] = parseInt(part, 16).toString(16)\n hextetCount++\n }\n\n if (compression === -1) {\n if (hextetCount !== 8) return undefined\n return compressIPv6ZeroRun(parts)\n }\n if (hextetCount >= 8) return undefined\n\n // expand \"::\" then re-compress the longest run for a canonical result\n const expanded = parts.slice(0, left.length)\n for (let i = hextetCount; i < 8; i++) expanded.push('0')\n for (let i = left.length; i < parts.length; i++) expanded.push(parts[i])\n return compressIPv6ZeroRun(expanded)\n}\n\n/**\n * @typedef {Object} NormalizeIPv6Result\n * @property {string} host - The normalized host.\n * @property {string} [escapedHost] - The escaped host.\n * @property {boolean} isIPV6 - Indicates if the host is an IPv6 address.\n * @property {boolean} [isIPVFuture] - Indicates if the host is an IPvFuture literal.\n * @property {boolean} [error] - Indicates if a bracketed IP literal is malformed.\n */\n\n/**\n * Validates and normalizes a bracketed IP literal. Raw zone separators remain\n * accepted for backwards compatibility, while encoded separators and zone\n * contents follow RFC 6874.\n *\n * @param {string} host\n * @returns {NormalizeIPv6Result}\n */\nfunction normalizeIPv6 (host) {\n const bracketed = host[0] === '[' && host[host.length - 1] === ']'\n const hasBracket = host[0] === '[' || host[host.length - 1] === ']'\n if (hasBracket && !bracketed) return { host, isIPV6: false, error: true }\n\n let input = bracketed ? host.slice(1, -1) : host\n if (bracketed && isIPvFuture(input)) {\n input = input.toLowerCase()\n return { host: `[${input}]`, escapedHost: input, isIPV6: false, isIPVFuture: true }\n }\n\n if (findToken(input, ':') < 2) {\n return { host, isIPV6: false, error: bracketed }\n }\n\n let zoneIdentifier = ''\n const zoneSeparator = input.indexOf('%')\n if (zoneSeparator !== -1) {\n const separatorLength = input.slice(zoneSeparator, zoneSeparator + 3).toLowerCase() === '%25' ? 3 : 1\n zoneIdentifier = input.slice(zoneSeparator + separatorLength)\n if (!isZoneIdentifier(zoneIdentifier)) return { host, isIPV6: false, error: true }\n input = input.slice(0, zoneSeparator)\n }\n\n const address = normalizeIPv6Address(input)\n if (address === undefined) return { host, isIPV6: false, error: true }\n\n return {\n host: address + (zoneIdentifier ? '%' + zoneIdentifier : ''),\n escapedHost: address + (zoneIdentifier ? '%25' + zoneIdentifier : ''),\n isIPV6: true\n }\n}\n\n/**\n * @param {string} str\n * @param {string} token\n * @returns {number}\n */\nfunction findToken (str, token) {\n let ind = 0\n for (let i = 0; i < str.length; i++) {\n if (str[i] === token) ind++\n }\n return ind\n}\n\n/**\n * @param {string} path\n * @returns {string}\n *\n * @see https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4\n */\nfunction removeDotSegments (path) {\n let input = path\n const output = []\n let nextSlash = -1\n let len = 0\n\n // eslint-disable-next-line no-cond-assign\n while (len = input.length) {\n if (len === 1) {\n if (input === '.') {\n break\n } else if (input === '/') {\n output.push('/')\n break\n } else {\n output.push(input)\n break\n }\n } else if (len === 2) {\n if (input[0] === '.') {\n if (input[1] === '.') {\n break\n } else if (input[1] === '/') {\n input = input.slice(2)\n continue\n }\n } else if (input[0] === '/') {\n if (input[1] === '.') {\n output.push('/')\n break\n }\n }\n } else if (len === 3) {\n if (input === '/..') {\n if (output.length !== 0) {\n output.pop()\n }\n output.push('/')\n break\n }\n }\n if (input[0] === '.') {\n if (input[1] === '.') {\n if (input[2] === '/') {\n input = input.slice(3)\n continue\n }\n } else if (input[1] === '/') {\n input = input.slice(2)\n continue\n }\n } else if (input[0] === '/') {\n if (input[1] === '.') {\n if (input[2] === '/') {\n input = input.slice(2)\n continue\n } else if (input[2] === '.') {\n if (input[3] === '/') {\n input = input.slice(3)\n if (output.length !== 0) {\n output.pop()\n }\n continue\n }\n }\n }\n }\n\n // Rule 2E: Move normal path segment to output\n if ((nextSlash = input.indexOf('/', 1)) === -1) {\n output.push(input)\n break\n } else {\n output.push(input.slice(0, nextSlash))\n input = input.slice(nextSlash)\n }\n }\n\n return output.join('')\n}\n\n/**\n * Re-escape RFC 3986 gen-delims that must not appear literally in the host.\n * After the URI regex parses, these characters cannot be literal in the host\n * field, so any that appear after decoding came from percent-encoding and\n * must be restored to prevent authority structure changes.\n *\n * @param {string} host\n * @param {boolean} isIP - true for IPv4/IPv6 hosts (skip colon re-escaping)\n * @returns {string}\n */\nconst HOST_DELIMS = { '@': '%40', '/': '%2F', '?': '%3F', '#': '%23', ':': '%3A' }\nconst HOST_DELIM_RE = /[@/?#:]/g\nconst HOST_DELIM_NO_COLON_RE = /[@/?#]/g\n\nfunction reescapeHostDelimiters (host, isIP) {\n const re = isIP ? HOST_DELIM_NO_COLON_RE : HOST_DELIM_RE\n re.lastIndex = 0\n return host.replace(re, (ch) => HOST_DELIMS[ch])\n}\n\n/**\n * Normalizes percent escapes and optionally decodes only unreserved ASCII bytes.\n * Reserved delimiters such as `%2F` stay escaped; `%2E` is unreserved.\n *\n * @param {string} input\n * @param {boolean} [decodeUnreserved=false]\n * @returns {string}\n */\nfunction normalizePercentEncoding (input, decodeUnreserved = false) {\n if (input.indexOf('%') === -1) {\n return input\n }\n\n let output = ''\n\n for (let i = 0; i < input.length; i++) {\n if (input[i] === '%' && i + 2 < input.length) {\n const hex = input.slice(i + 1, i + 3)\n if (isHexPair(hex)) {\n const normalizedHex = hex.toUpperCase()\n const decoded = String.fromCharCode(parseInt(normalizedHex, 16))\n\n if (decodeUnreserved && isUnreserved(decoded)) {\n output += decoded\n } else {\n output += '%' + normalizedHex\n }\n\n i += 2\n continue\n }\n }\n\n output += input[i]\n }\n\n return output\n}\n\n/** Pre-built `%XX` strings for every byte. Avoids per-call hex math/concat. */\nconst BYTE_HEX = new Array(256)\n{\n const HEX_DIGITS = '0123456789ABCDEF'\n for (let i = 0; i < 256; i++) {\n BYTE_HEX[i] = '%' + HEX_DIGITS[i >> 4] + HEX_DIGITS[i & 0xF]\n }\n}\n\n/**\n * Mirrors the pass-through set of the deprecated `escape()` global:\n * `A-Z a-z 0-9 * + - . / @ _`. Keeps drop-in semantics for ASCII input.\n *\n * @param {number} cp\n * @returns {boolean}\n */\nfunction isEscapeSafe (cp) {\n return (\n (cp >= 0x30 && cp <= 0x39) ||\n (cp >= 0x41 && cp <= 0x5A) ||\n (cp >= 0x61 && cp <= 0x7A) ||\n cp === 0x2A || cp === 0x2B || cp === 0x2D || cp === 0x2E ||\n cp === 0x2F || cp === 0x40 || cp === 0x5F\n )\n}\n\n/**\n * RFC 3986 percent-encode a non-ASCII Unicode code point as UTF-8 bytes.\n * Caller handles the ASCII branch inline for speed.\n *\n * @param {number} cp - Unicode code point (>= 0x80, <= 0x10FFFF)\n * @returns {string}\n */\nfunction percentEncodeNonAscii (cp) {\n if (cp < 0x800) {\n return BYTE_HEX[0xC0 | (cp >> 6)] +\n BYTE_HEX[0x80 | (cp & 0x3F)]\n }\n if (cp < 0x10000) {\n return BYTE_HEX[0xE0 | (cp >> 12)] +\n BYTE_HEX[0x80 | ((cp >> 6) & 0x3F)] +\n BYTE_HEX[0x80 | (cp & 0x3F)]\n }\n return BYTE_HEX[0xF0 | (cp >> 18)] +\n BYTE_HEX[0x80 | ((cp >> 12) & 0x3F)] +\n BYTE_HEX[0x80 | ((cp >> 6) & 0x3F)] +\n BYTE_HEX[0x80 | (cp & 0x3F)]\n}\n\n/**\n * Normalizes path data without turning reserved escapes into live path syntax.\n * Valid escapes are uppercased, raw unsafe characters are escaped, and only\n * unreserved bytes that are not `.` are decoded.\n *\n * @param {string} input\n * @returns {string}\n */\nfunction normalizePathEncoding (input) {\n let output = ''\n\n for (let i = 0; i < input.length; i++) {\n const ch = input[i]\n if (ch === '%' && i + 2 < input.length) {\n const hex = input.slice(i + 1, i + 3)\n if (isHexPair(hex)) {\n const normalizedHex = hex.toUpperCase()\n const decoded = String.fromCharCode(parseInt(normalizedHex, 16))\n\n if (decoded !== '.' && isUnreserved(decoded)) {\n output += decoded\n } else {\n output += '%' + normalizedHex\n }\n\n i += 2\n continue\n }\n }\n\n if (isPathCharacter(ch)) {\n output += ch\n } else {\n const code = input.charCodeAt(i)\n if (code < 0x80) {\n output += isEscapeSafe(code) ? ch : BYTE_HEX[code]\n } else if (code < 0xD800 || code > 0xDFFF) {\n output += percentEncodeNonAscii(code)\n } else if (code <= 0xDBFF && i + 1 < input.length) {\n const low = input.charCodeAt(i + 1)\n if (low >= 0xDC00 && low <= 0xDFFF) {\n output += percentEncodeNonAscii(0x10000 + ((code - 0xD800) << 10) + (low - 0xDC00))\n i++\n } else {\n output += percentEncodeNonAscii(0xFFFD)\n }\n } else {\n output += percentEncodeNonAscii(0xFFFD)\n }\n }\n }\n\n return output\n}\n\n/**\n * Serializes a path without rewriting reserved data. Raw RFC 3986 path\n * characters remain literal, valid escapes are preserved and uppercased, and\n * everything else is UTF-8 percent-encoded. In a path-noscheme, a colon in the\n * first segment must be escaped so the result cannot be parsed as a scheme.\n *\n * @param {string} input\n * @param {boolean} [pathNoScheme=false]\n * @returns {string}\n */\nfunction serializePathEncoding (input, pathNoScheme = false) {\n let output = ''\n let firstSegment = pathNoScheme && input[0] !== '/'\n\n for (let i = 0; i < input.length; i++) {\n const ch = input[i]\n if (ch === '%' && i + 2 < input.length) {\n const hex = input.slice(i + 1, i + 3)\n if (isHexPair(hex)) {\n output += '%' + hex.toUpperCase()\n i += 2\n continue\n }\n }\n\n if (ch === '/') {\n firstSegment = false\n }\n\n if (isPathCharacter(ch) && (ch !== ':' || !firstSegment)) {\n output += ch\n } else {\n const code = input.charCodeAt(i)\n if (code < 0x80) {\n output += BYTE_HEX[code]\n } else if (code < 0xD800 || code > 0xDFFF) {\n output += percentEncodeNonAscii(code)\n } else if (code <= 0xDBFF && i + 1 < input.length) {\n const low = input.charCodeAt(i + 1)\n if (low >= 0xDC00 && low <= 0xDFFF) {\n output += percentEncodeNonAscii(0x10000 + ((code - 0xD800) << 10) + (low - 0xDC00))\n i++\n } else {\n output += percentEncodeNonAscii(0xFFFD)\n }\n } else {\n output += percentEncodeNonAscii(0xFFFD)\n }\n }\n }\n\n return output\n}\n\n/**\n * Normalizes the percent-encoding of a query or fragment component.\n *\n * Like `normalizePathEncoding`, but uses the query/fragment character set\n * (which additionally allows `?`) and decodes `.` since it has no dot-segment\n * meaning outside of a path.\n *\n * @param {string} input\n * @returns {string}\n */\nfunction normalizeQueryFragmentEncoding (input) {\n let output = ''\n\n for (let i = 0; i < input.length; i++) {\n const ch = input[i]\n if (ch === '%' && i + 2 < input.length) {\n const hex = input.slice(i + 1, i + 3)\n if (isHexPair(hex)) {\n const normalizedHex = hex.toUpperCase()\n const decoded = String.fromCharCode(parseInt(normalizedHex, 16))\n\n if (isUnreserved(decoded)) {\n output += decoded\n } else {\n output += '%' + normalizedHex\n }\n\n i += 2\n continue\n }\n }\n\n if (isQueryFragmentCharacter(ch)) {\n output += ch\n } else {\n const code = input.charCodeAt(i)\n if (code < 0x80) {\n output += isEscapeSafe(code) ? ch : BYTE_HEX[code]\n } else if (code < 0xD800 || code > 0xDFFF) {\n output += percentEncodeNonAscii(code)\n } else if (code <= 0xDBFF && i + 1 < input.length) {\n const low = input.charCodeAt(i + 1)\n if (low >= 0xDC00 && low <= 0xDFFF) {\n output += percentEncodeNonAscii(0x10000 + ((code - 0xD800) << 10) + (low - 0xDC00))\n i++\n } else {\n output += percentEncodeNonAscii(0xFFFD)\n }\n } else {\n output += percentEncodeNonAscii(0xFFFD)\n }\n }\n }\n\n return output\n}\n\n/**\n * Percent-encodes a URI component using its RFC 3986 literal character set.\n * Existing valid escapes are preserved and normalized to uppercase hex.\n *\n * @param {string} input\n * @param {(value: string) => boolean} isAllowed\n * @returns {string}\n */\nfunction encodeComponent (input, isAllowed) {\n let output = ''\n\n for (let i = 0; i < input.length; i++) {\n const ch = input[i]\n if (ch === '%' && i + 2 < input.length) {\n const hex = input.slice(i + 1, i + 3)\n if (isHexPair(hex)) {\n output += '%' + hex.toUpperCase()\n i += 2\n continue\n }\n }\n\n if (isAllowed(ch)) {\n output += ch\n } else {\n const code = input.charCodeAt(i)\n if (code < 0x80) {\n output += BYTE_HEX[code]\n } else if (code < 0xD800 || code > 0xDFFF) {\n output += percentEncodeNonAscii(code)\n } else if (code <= 0xDBFF && i + 1 < input.length) {\n const low = input.charCodeAt(i + 1)\n if (low >= 0xDC00 && low <= 0xDFFF) {\n output += percentEncodeNonAscii(0x10000 + ((code - 0xD800) << 10) + (low - 0xDC00))\n i++\n } else {\n output += percentEncodeNonAscii(0xFFFD)\n }\n } else {\n output += percentEncodeNonAscii(0xFFFD)\n }\n }\n }\n\n return output\n}\n\n/**\n * Encodes userinfo while preserving its RFC 3986 §3.2.1 literal characters.\n * In particular, authority delimiters such as `@`, `/`, `?`, and `#` are data.\n *\n * @param {string} input\n * @returns {string}\n */\nfunction encodeUserinfo (input) {\n return encodeComponent(input, isUserinfoCharacter)\n}\n\n/**\n * Encodes query data using the RFC 3986 §3.4 grammar. A literal `#` must be\n * escaped because it would otherwise begin the fragment component.\n *\n * @param {string} input\n * @returns {string}\n */\nfunction encodeQuery (input) {\n return encodeComponent(input, isQueryFragmentCharacter)\n}\n\n/**\n * Encodes fragment data using the RFC 3986 §3.5 grammar.\n *\n * @param {string} input\n * @returns {string}\n */\nfunction encodeFragment (input) {\n return encodeComponent(input, isQueryFragmentCharacter)\n}\n\n/**\n * Escapes a component while preserving existing valid percent escapes.\n *\n * @param {string} input\n * @returns {string}\n */\nfunction escapePreservingEscapes (input) {\n let output = ''\n\n for (let i = 0; i < input.length; i++) {\n const ch = input[i]\n if (ch === '%' && i + 2 < input.length) {\n const hex = input.slice(i + 1, i + 3)\n if (isHexPair(hex)) {\n output += '%' + hex.toUpperCase()\n i += 2\n continue\n }\n }\n\n const code = input.charCodeAt(i)\n if (code < 0x80) {\n output += isEscapeSafe(code) ? ch : BYTE_HEX[code]\n } else if (code < 0xD800 || code > 0xDFFF) {\n output += percentEncodeNonAscii(code)\n } else if (code <= 0xDBFF && i + 1 < input.length) {\n const low = input.charCodeAt(i + 1)\n if (low >= 0xDC00 && low <= 0xDFFF) {\n output += percentEncodeNonAscii(0x10000 + ((code - 0xD800) << 10) + (low - 0xDC00))\n i++\n } else {\n output += percentEncodeNonAscii(0xFFFD)\n }\n } else {\n output += percentEncodeNonAscii(0xFFFD)\n }\n }\n\n return output\n}\n\n/**\n * @param {import('../types/index').URIComponent} component\n * @returns {string|undefined}\n */\nfunction recomposeAuthority (component) {\n const uriTokens = []\n\n if (component.userinfo !== undefined) {\n uriTokens.push(encodeUserinfo(component.userinfo))\n uriTokens.push('@')\n }\n\n if (component.host !== undefined) {\n let host = component.host\n if (!isIPv4(host)) {\n let ipV6res = normalizeIPv6(host)\n if (ipV6res.isIPV6 !== true && ipV6res.isIPVFuture !== true) {\n // Decode only unreserved bytes, once. In particular, keep %25 encoded\n // so it cannot introduce a second escape during recomposition.\n host = normalizePercentEncoding(host, true)\n ipV6res = normalizeIPv6(host)\n }\n if (ipV6res.isIPV6 === true || ipV6res.isIPVFuture === true) {\n host = `[${ipV6res.escapedHost}]`\n } else {\n host = reescapeHostDelimiters(host, false)\n }\n }\n uriTokens.push(host)\n }\n\n if (typeof component.port === 'number' || typeof component.port === 'string') {\n const port = String(component.port)\n if (!isPort(port)) {\n throw new TypeError('URI port is malformed.')\n }\n uriTokens.push(':')\n uriTokens.push(port)\n }\n\n return uriTokens.length ? uriTokens.join('') : undefined\n};\n\nmodule.exports = {\n BYTE_HEX,\n percentEncodeNonAscii,\n nonSimpleDomain,\n nonSimpleMailtoDomain,\n recomposeAuthority,\n reescapeHostDelimiters,\n normalizePercentEncoding,\n normalizePathEncoding,\n serializePathEncoding,\n normalizeQueryFragmentEncoding,\n encodeUserinfo,\n encodeQuery,\n encodeFragment,\n escapePreservingEscapes,\n removeDotSegments,\n isIPv4,\n isUUID,\n normalizeIPv6,\n stringArrayToHexStripped\n}\n","'use strict'\n\nconst { isUUID, BYTE_HEX, percentEncodeNonAscii, nonSimpleMailtoDomain } = require('./utils')\nconst URN_REG = /^([\\da-z][\\d\\-a-z]{0,31}):((?:[\\w!$'()*+,\\-./:;=@]|%[\\da-f]{2})+)$/iu\n\nconst supportedSchemeNames = /** @type {const} */ (['http', 'https', 'ws',\n 'wss', 'urn', 'urn:uuid', 'mailto'])\n\n/** @typedef {supportedSchemeNames[number]} SchemeName */\n\n/**\n * @param {string} name\n * @returns {name is SchemeName}\n */\nfunction isValidSchemeName (name) {\n return supportedSchemeNames.indexOf(/** @type {*} */ (name)) !== -1\n}\n\n/**\n * @callback SchemeFn\n * @param {import('../types/index').URIComponent} component\n * @param {import('../types/index').Options} options\n * @returns {import('../types/index').URIComponent}\n */\n\n/**\n * @typedef {Object} SchemeHandler\n * @property {SchemeName} scheme - The scheme name.\n * @property {boolean} [domainHost] - Indicates if the scheme supports domain hosts.\n * @property {SchemeFn} parse - Function to parse the URI component for this scheme.\n * @property {SchemeFn} serialize - Function to serialize the URI component for this scheme.\n * @property {boolean} [skipNormalize] - Indicates if normalization should be skipped for this scheme.\n * @property {boolean} [absolutePath] - Indicates if the scheme uses absolute paths.\n * @property {boolean} [unicodeSupport] - Indicates if the scheme supports Unicode.\n */\n\n/**\n * @param {import('../types/index').URIComponent} wsComponent\n * @returns {boolean}\n */\nfunction wsIsSecure (wsComponent) {\n if (wsComponent.secure === true) {\n return true\n } else if (wsComponent.secure === false) {\n return false\n } else if (wsComponent.scheme) {\n return (\n wsComponent.scheme.length === 3 &&\n (wsComponent.scheme[0] === 'w' || wsComponent.scheme[0] === 'W') &&\n (wsComponent.scheme[1] === 's' || wsComponent.scheme[1] === 'S') &&\n (wsComponent.scheme[2] === 's' || wsComponent.scheme[2] === 'S')\n )\n } else {\n return false\n }\n}\n\n/** @type {SchemeFn} */\nfunction httpParse (component) {\n if (!component.host) {\n component.error = component.error || 'HTTP URIs must have a host.'\n }\n\n return component\n}\n\n/** @type {SchemeFn} */\nfunction httpSerialize (component) {\n const secure = String(component.scheme).toLowerCase() === 'https'\n\n // normalize the default port\n if (component.port === (secure ? 443 : 80) || component.port === '') {\n component.port = undefined\n }\n\n // normalize the empty path\n if (!component.path) {\n component.path = '/'\n }\n\n // NOTE: We do not parse query strings for HTTP URIs\n // as WWW Form Url Encoded query strings are part of the HTML4+ spec,\n // and not the HTTP spec.\n\n return component\n}\n\n/** @type {SchemeFn} */\nfunction wsParse (wsComponent) {\n// indicate if the secure flag is set\n wsComponent.secure = wsIsSecure(wsComponent)\n\n // construct resouce name\n wsComponent.resourceName = (wsComponent.path || '/') + (wsComponent.query ? '?' + wsComponent.query : '')\n wsComponent.path = undefined\n wsComponent.query = undefined\n\n return wsComponent\n}\n\n/** @type {SchemeFn} */\nfunction wsSerialize (wsComponent) {\n// normalize the default port\n if (wsComponent.port === (wsIsSecure(wsComponent) ? 443 : 80) || wsComponent.port === '') {\n wsComponent.port = undefined\n }\n\n // ensure scheme matches secure flag\n if (typeof wsComponent.secure === 'boolean') {\n wsComponent.scheme = (wsComponent.secure ? 'wss' : 'ws')\n wsComponent.secure = undefined\n }\n\n // reconstruct path from resource name\n if (wsComponent.resourceName) {\n const queryIndex = wsComponent.resourceName.indexOf('?')\n const path = queryIndex === -1\n ? wsComponent.resourceName\n : wsComponent.resourceName.slice(0, queryIndex)\n wsComponent.path = (path && path !== '/' ? path : undefined)\n wsComponent.query = queryIndex === -1\n ? undefined\n : wsComponent.resourceName.slice(queryIndex + 1)\n wsComponent.resourceName = undefined\n }\n\n // forbid fragment component\n wsComponent.fragment = undefined\n\n return wsComponent\n}\n\n/** @type {SchemeFn} */\nfunction urnParse (urnComponent, options) {\n if (!urnComponent.path) {\n urnComponent.error = 'URN can not be parsed'\n return urnComponent\n }\n const matches = urnComponent.path.match(URN_REG)\n if (matches && matches[0] === urnComponent.path) {\n const scheme = options.scheme || urnComponent.scheme || 'urn'\n urnComponent.nid = matches[1].toLowerCase()\n urnComponent.nss = matches[2]\n const urnScheme = `${scheme}:${options.nid || urnComponent.nid}`\n const schemeHandler = getSchemeHandler(urnScheme)\n urnComponent.path = undefined\n\n if (schemeHandler) {\n urnComponent = schemeHandler.parse(urnComponent, options)\n }\n } else {\n urnComponent.error = urnComponent.error || 'URN can not be parsed.'\n }\n\n return urnComponent\n}\n\n/** @type {SchemeFn} */\nfunction urnSerialize (urnComponent, options) {\n if (urnComponent.nid === undefined) {\n throw new Error('URN without nid cannot be serialized')\n }\n const scheme = options.scheme || urnComponent.scheme || 'urn'\n const nid = urnComponent.nid.toLowerCase()\n const urnScheme = `${scheme}:${options.nid || nid}`\n const schemeHandler = getSchemeHandler(urnScheme)\n\n if (schemeHandler) {\n urnComponent = schemeHandler.serialize(urnComponent, options)\n }\n\n const uriComponent = urnComponent\n const nss = urnComponent.nss\n uriComponent.path = `${nid || options.nid}:${nss}`\n\n options.skipEscape = true\n return uriComponent\n}\n\n/** @type {SchemeFn} */\nfunction urnuuidParse (urnComponent, options) {\n const uuidComponent = urnComponent\n uuidComponent.uuid = uuidComponent.nss\n uuidComponent.nss = undefined\n\n if (!options.tolerant && (!uuidComponent.uuid || !isUUID(uuidComponent.uuid))) {\n uuidComponent.error = uuidComponent.error || 'UUID is not valid.'\n }\n\n return uuidComponent\n}\n\n/** @type {SchemeFn} */\nfunction urnuuidSerialize (uuidComponent) {\n const urnComponent = uuidComponent\n // normalize UUID\n urnComponent.nss = (uuidComponent.uuid || '').toLowerCase()\n return urnComponent\n}\n\nconst http = /** @type {SchemeHandler} */ ({\n scheme: 'http',\n domainHost: true,\n parse: httpParse,\n serialize: httpSerialize\n})\n\nconst https = /** @type {SchemeHandler} */ ({\n scheme: 'https',\n domainHost: http.domainHost,\n parse: httpParse,\n serialize: httpSerialize\n})\n\nconst ws = /** @type {SchemeHandler} */ ({\n scheme: 'ws',\n domainHost: true,\n parse: wsParse,\n serialize: wsSerialize\n})\n\nconst wss = /** @type {SchemeHandler} */ ({\n scheme: 'wss',\n domainHost: ws.domainHost,\n parse: ws.parse,\n serialize: ws.serialize\n})\n\nconst urn = /** @type {SchemeHandler} */ ({\n scheme: 'urn',\n parse: urnParse,\n serialize: urnSerialize,\n skipNormalize: true\n})\n\nconst urnuuid = /** @type {SchemeHandler} */ ({\n scheme: 'urn:uuid',\n parse: urnuuidParse,\n serialize: urnuuidSerialize,\n skipNormalize: true\n})\n\n/**\n * Allow-sets for `encodeWithAllow`, each a `{ all, table, allowNonAscii }`\n * descriptor built by `allowSet`:\n *\n * - `LOCAL_PART` is the intersection of upstream uri-js's VCHAR and\n * NOT_PATH_NOSCHEME, minus \",\": the serializer joins recipients with \",\" and\n * `mailtoParse` splits the path on it, so a comma left literal inside a local\n * part would silently become a recipient delimiter.\n * - `HFNAME` is the qchar allow-set used for header names/values.\n * - `DTEXT` is RFC 6068 dtext-no-obs restricted to characters that are also\n * safe in a URI path; `DTEXT_IRI` additionally permits non-ASCII for\n * `unicodeSupport`.\n */\nconst LOCAL_PART_ALLOWED = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~!$'()*+=\"\nconst HFNAME_ALLOWED = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~!$'()*+,;:@\"\nconst DTEXT_ALLOWED = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~!$'()*+;:\"\n\n/**\n * @typedef {Object} AllowSet\n * @property {RegExp} all - matches a whole string needing no encoding at all.\n * @property {Uint8Array} table - per-ASCII-code allow lookup for the slow path.\n * @property {boolean} allowNonAscii - pass non-ASCII code points through (IRI).\n */\n\n/**\n * `all` deliberately excludes \"%\" and (for the IRI variant) surrogates, so any\n * input needing escape normalization or surrogate repair falls to the slow path.\n *\n * @param {string} chars\n * @param {boolean} [allowNonAscii=false]\n * @returns {AllowSet}\n */\nfunction allowSet (chars, allowNonAscii = false) {\n const table = new Uint8Array(128)\n for (let i = 0; i < chars.length; i++) {\n table[chars.charCodeAt(i)] = 1\n }\n const escaped = chars.replace(/[\\\\\\]^-]/gu, '\\\\$&')\n const cls = allowNonAscii ? `[${escaped}]|[^\\\\0-\\\\x7F\\\\uD800-\\\\uDFFF]` : `[${escaped}]`\n return { all: new RegExp(`^(?:${cls})*$`, 'u'), table, allowNonAscii }\n}\n\nconst LOCAL_PART = allowSet(LOCAL_PART_ALLOWED)\nconst HFNAME = allowSet(HFNAME_ALLOWED)\nconst DTEXT = allowSet(DTEXT_ALLOWED)\nconst DTEXT_IRI = allowSet(DTEXT_ALLOWED, true)\n\nconst HEX_PAIR = /^[\\da-f]{2}$/iu\nconst MAILTO_DOMAIN_LITERAL = /^\\[[\\x21-\\x5A\\x5E-\\x7E]*\\]$/u\nconst MAILTO_DOMAIN_ERROR = 'URI mailto has an invalid recipient domain.'\nconst HAS_SURROGATE = /[\\uD800-\\uDFFF]/u\n\n/**\n * @param {string} str\n * @returns {string}\n */\nfunction decodeHex (str) {\n if (typeof str !== 'string' || str.indexOf('%') === -1) {\n return str\n }\n try {\n return decodeURIComponent(str)\n } catch {\n return str\n }\n}\n\n/**\n * Replaces lone surrogates with U+FFFD, leaving valid pairs intact. Only called\n * when `HAS_SURROGATE` matched, so the scan cost is not on the common path.\n * (`String.prototype.toWellFormed` would do this natively but is Node 20+.)\n *\n * @param {string} input\n * @returns {string}\n */\nfunction replaceLoneSurrogates (input) {\n let result = ''\n for (let i = 0; i < input.length; i++) {\n const code = input.charCodeAt(i)\n if (code >= 0xD800 && code <= 0xDBFF && i + 1 < input.length) {\n const low = input.charCodeAt(i + 1)\n if (low >= 0xDC00 && low <= 0xDFFF) {\n result += input[i] + input[i + 1]\n i++\n continue\n }\n }\n result += (code >= 0xD800 && code <= 0xDFFF) ? '\\uFFFD' : input[i]\n }\n return result\n}\n\n/**\n * Percent-encodes everything outside `set`, preserving existing valid escapes\n * (uppercased) and repairing lone surrogates.\n *\n * ASCII uses `BYTE_HEX` rather than `encodeURIComponent`. That is equivalent\n * only because every character `encodeURIComponent` leaves unescaped\n * (`A-Za-z0-9-_.!~*'()`) is present in all of the allow-sets above, so no such\n * character ever reaches the encode branch. Re-check if a set is narrowed.\n *\n * @param {string} input\n * @param {AllowSet} set\n * @returns {string}\n */\nfunction encodeWithAllow (input, set) {\n if (set.all.test(input)) {\n return input\n }\n\n const table = set.table\n let result = ''\n for (let i = 0; i < input.length; i++) {\n const code = input.charCodeAt(i)\n\n if (code < 0x80) {\n if (table[code] === 1) {\n result += input[i]\n } else if (code === 0x25 && i + 2 < input.length && HEX_PAIR.test(input.slice(i + 1, i + 3))) {\n result += '%' + input.slice(i + 1, i + 3).toUpperCase()\n i += 2\n } else {\n result += BYTE_HEX[code]\n }\n continue\n }\n\n if (code < 0xD800 || code > 0xDFFF) {\n result += set.allowNonAscii ? input[i] : percentEncodeNonAscii(code)\n continue\n }\n\n if (code <= 0xDBFF && i + 1 < input.length) {\n const low = input.charCodeAt(i + 1)\n if (low >= 0xDC00 && low <= 0xDFFF) {\n result += set.allowNonAscii\n ? input[i] + input[i + 1]\n : percentEncodeNonAscii(0x10000 + ((code - 0xD800) << 10) + (low - 0xDC00))\n i++\n continue\n }\n }\n\n result += set.allowNonAscii ? '\\uFFFD' : percentEncodeNonAscii(0xFFFD)\n }\n return result\n}\n\n/**\n * @param {string} domain\n * @param {import('../types/index').Options} [options]\n * @param {{error?:string}} [component]\n * @returns {string}\n */\nfunction mailtoNormalizeDomain (domain, options, component) {\n const normalizedDomain = String(domain).toLowerCase()\n\n if (MAILTO_DOMAIN_LITERAL.test(normalizedDomain)) {\n return normalizedDomain\n }\n\n // `hostname` is the identity for these, so skip constructing a WHATWG URL.\n if (normalizedDomain !== '' && !nonSimpleMailtoDomain(normalizedDomain)) {\n return normalizedDomain\n }\n\n try {\n const parsedDomain = new URL('http://' + normalizedDomain)\n if (\n parsedDomain.username ||\n parsedDomain.password ||\n parsedDomain.port ||\n parsedDomain.pathname !== '/' ||\n parsedDomain.search ||\n parsedDomain.hash ||\n !parsedDomain.hostname\n ) {\n throw new Error(MAILTO_DOMAIN_ERROR)\n }\n\n return options && options.unicodeSupport\n ? normalizedDomain\n : parsedDomain.hostname\n } catch {\n if (component) {\n component.error = component.error || MAILTO_DOMAIN_ERROR\n }\n return normalizedDomain\n }\n}\n\n/**\n * Percent-encodes everything in a recipient domain that is not `dtext-no-obs`\n * (RFC 6068). Serialize-only: `mailtoNormalizeDomain` returns the domain\n * verbatim when validation fails, and `MAILTO_DOMAIN_LITERAL` accepts the full\n * RFC 5321 dcontent range (which includes \"?\", \"#\", \"&\" and \"/\"), so without\n * this an attacker-supplied recipient could inject header fields or a fragment\n * into the serialized URI. `mailtoParse` deliberately reports the raw domain\n * instead, so it must not use this.\n * @param {string} domain\n * @param {import('../types/index').Options} [options]\n * @returns {string}\n */\nfunction mailtoEncodeDomain (domain, options) {\n const set = options && options.unicodeSupport ? DTEXT_IRI : DTEXT\n\n // Keep the delimiters of a domain literal, encode its contents.\n if (domain.length > 1 && domain[0] === '[' && domain[domain.length - 1] === ']') {\n return '[' + encodeWithAllow(domain.slice(1, -1), set) + ']'\n }\n\n return encodeWithAllow(domain, set)\n}\n\n/**\n * @param {import('../types/index').URIComponent} component\n * @param {import('../types/index').Options} options\n * @returns {import('../types/index').URIComponent}\n */\nfunction mailtoParse (component, options) {\n const mailtoComponent = component\n\n // The handler sets `skipNormalize`, so path and query arrive raw. Everything\n // here goes through `decodeHex`, which subsumes the generic normalizers --\n // except that they also fold lone surrogates to U+FFFD, so do that here.\n let rawPath = mailtoComponent.path\n let rawQuery = mailtoComponent.query\n if (rawPath && HAS_SURROGATE.test(rawPath)) rawPath = replaceLoneSurrogates(rawPath)\n if (rawQuery && HAS_SURROGATE.test(rawQuery)) rawQuery = replaceLoneSurrogates(rawQuery)\n\n const to = rawPath\n ? (rawPath.indexOf(',') === -1 ? [rawPath] : rawPath.split(','))\n : []\n mailtoComponent.path = undefined\n\n if (rawQuery) {\n // Null prototype: header names come from untrusted input, so `headers[name]`\n // must not resolve to inherited members (\"constructor\", \"toString\", ...),\n // and \"__proto__\" has to land as a plain own property instead of hitting\n // Object.prototype's setter and being silently dropped. Allocated lazily so\n // the common subject/body-only URI does not pay for it.\n /** @type {Record<string,string>|null} */\n let headers = null\n let start = 0\n while (start <= rawQuery.length) {\n let end = rawQuery.indexOf('&', start)\n if (end === -1) end = rawQuery.length\n const token = rawQuery.slice(start, end)\n start = end + 1\n\n const eqIdx = token.indexOf('=')\n if (eqIdx !== token.lastIndexOf('=')) {\n mailtoComponent.error = mailtoComponent.error || 'URI mailto has malformed header fields.'\n continue\n }\n const name = eqIdx === -1 ? token : token.slice(0, eqIdx)\n const value = eqIdx === -1 ? '' : token.slice(eqIdx + 1)\n if (name === 'to') {\n const addrs = value.split(',')\n for (let j = 0; j < addrs.length; j++) to.push(addrs[j])\n continue\n }\n if (name === 'subject') {\n mailtoComponent.subject = decodeHex(value)\n continue\n }\n if (name === 'body') {\n mailtoComponent.body = decodeHex(value)\n continue\n }\n if (headers === null) headers = /** @type {Record<string,string>} */ (Object.create(null))\n headers[decodeHex(name)] = decodeHex(value)\n }\n if (headers !== null) mailtoComponent.headers = headers\n }\n\n mailtoComponent.query = undefined\n\n for (let i = 0; i < to.length; i++) {\n const rawAddr = to[i]\n const atIdx = rawAddr.lastIndexOf('@')\n if (atIdx < 0) {\n mailtoComponent.error = mailtoComponent.error || MAILTO_DOMAIN_ERROR\n to[i] = decodeHex(rawAddr)\n continue\n }\n const local = decodeHex(rawAddr.slice(0, atIdx))\n const domain = mailtoNormalizeDomain(decodeHex(rawAddr.slice(atIdx + 1)), options, mailtoComponent)\n to[i] = local + '@' + domain\n }\n\n if (to.length) mailtoComponent.to = to\n\n return mailtoComponent\n}\n\n/**\n * @param {import('../types/index').URIComponent} component\n * @param {import('../types/index').Options} options\n * @returns {import('../types/index').URIComponent}\n */\nfunction mailtoSerialize (component, options) {\n const mailtoComponent = component\n const to = Array.isArray(mailtoComponent.to) ? mailtoComponent.to.slice() : []\n if (to.length) {\n for (let i = 0; i < to.length; i++) {\n const addr = String(to[i])\n const atIdx = addr.lastIndexOf('@')\n const rawLocal = atIdx >= 0 ? addr.slice(0, atIdx) : addr\n const rawDomain = atIdx >= 0 ? addr.slice(atIdx + 1) : ''\n const local = encodeWithAllow(rawLocal, LOCAL_PART)\n const decodedDomain = decodeHex(rawDomain)\n // `component` is intentionally not passed: index.js's `serialize` writes\n // the error onto a private copy and returns only a string, so an error\n // recorded here would be unreachable. Safety comes from encoding instead.\n const normalizedDomain = mailtoNormalizeDomain(decodedDomain, options)\n to[i] = local + '@' + mailtoEncodeDomain(normalizedDomain, options)\n }\n // Every recipient is now fully encoded and only the joining commas are\n // literal, so bypass index.js's generic encoder, whose allow-set is\n // narrower than upstream's and would over-encode.\n mailtoComponent.path = to.join(',')\n options.skipEscape = true\n } else {\n // No recipients: drop any caller-supplied path, matching upstream uri-js.\n // `to` is the only recipient source, and `mailtoParse` always moves the\n // path into it, so a mailto component never legitimately carries one.\n mailtoComponent.path = undefined\n }\n\n const headers = mailtoComponent.headers && typeof mailtoComponent.headers === 'object'\n ? Object.assign(Object.create(null), mailtoComponent.headers)\n : Object.create(null)\n\n if (mailtoComponent.subject) headers.subject = mailtoComponent.subject\n if (mailtoComponent.body) headers.body = mailtoComponent.body\n mailtoComponent.headers = headers\n\n // `headers` has a null prototype and was filled via Object.assign, so every\n // enumerable key is an own property and no hasOwnProperty guard is needed.\n let query = ''\n let count = 0\n for (const name in headers) {\n if (count++ !== 0) query += '&'\n query += encodeWithAllow(name, HFNAME) + '=' + encodeWithAllow(String(headers[name]), HFNAME)\n }\n\n if (count !== 0) {\n mailtoComponent.query = query\n } else {\n mailtoComponent.headers = undefined\n }\n\n return mailtoComponent\n}\n\nconst mailto = /** @type {SchemeHandler} */ ({\n scheme: 'mailto',\n parse: mailtoParse,\n serialize: mailtoSerialize,\n domainHost: false,\n unicodeSupport: true,\n // `mailtoParse` re-derives every component from the raw path/query via\n // `decodeHex`, which subsumes the generic normalizers, so running them first\n // is wasted work (~28% of parsing a URI with header fields).\n skipNormalize: true,\n // A recipient list has no dot segments to remove, and `removeDotSegments`\n // would rewrite a \"./\"-prefixed local part.\n absolutePath: true\n})\n\nconst SCHEMES = /** @type {Record<SchemeName, SchemeHandler>} */ ({\n http,\n https,\n ws,\n wss,\n urn,\n 'urn:uuid': urnuuid,\n mailto\n})\n\nObject.setPrototypeOf(SCHEMES, null)\n\n/**\n * @param {string|undefined} scheme\n * @returns {SchemeHandler|undefined}\n */\nfunction getSchemeHandler (scheme) {\n return (\n scheme && (\n SCHEMES[/** @type {SchemeName} */ (scheme)] ||\n SCHEMES[/** @type {SchemeName} */(scheme.toLowerCase())])\n ) ||\n undefined\n}\n\nmodule.exports = {\n wsIsSecure,\n SCHEMES,\n isValidSchemeName,\n getSchemeHandler,\n}\n","'use strict'\n\nconst { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, serializePathEncoding, normalizeQueryFragmentEncoding, encodeQuery, encodeFragment, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require('./lib/utils')\nconst { SCHEMES, getSchemeHandler } = require('./lib/schemes')\n\nconst VALID_SCHEME = /^[A-Za-z][A-Za-z0-9+.-]*$/u\nconst MALFORMED_SCHEME_ERROR = 'URI scheme is malformed.'\n\n/**\n * @param {string} scheme\n * @returns {string}\n */\nfunction decodeValidScheme (scheme) {\n const decodedScheme = unescape(String(scheme))\n if (!VALID_SCHEME.test(decodedScheme)) {\n throw new TypeError(MALFORMED_SCHEME_ERROR)\n }\n return decodedScheme\n}\n\n/**\n * @template {import('./types/index').URIComponent|string} T\n * @param {T} uri\n * @param {import('./types/index').Options} [options]\n * @returns {T}\n */\nfunction normalize (uri, options) {\n if (typeof uri === 'string') {\n uri = /** @type {T} */ (normalizeString(uri, options))\n } else if (typeof uri === 'object') {\n uri = /** @type {T} */ (parse(serialize(uri, options), options))\n }\n return uri\n}\n\n/**\n * @param {string} baseURI\n * @param {string} relativeURI\n * @param {import('./types/index').Options} [options]\n * @returns {string}\n */\nfunction resolve (baseURI, relativeURI, options) {\n const schemelessOptions = options ? Object.assign({ scheme: 'null' }, options) : { scheme: 'null' }\n const {\n parsed: baseParsed,\n malformedAuthorityOrPort: baseMalformed,\n malformedPercentEncoding: baseMalformedPercentEncoding,\n malformedSchemeSpecific: baseMalformedSchemeSpecific,\n malformedHost: baseMalformedHost,\n malformedScheme: baseMalformedScheme\n } = parseWithStatus(baseURI, schemelessOptions)\n const {\n parsed: relativeParsed,\n malformedAuthorityOrPort: relativeMalformed,\n malformedPercentEncoding: relativeMalformedPercentEncoding,\n malformedSchemeSpecific: relativeMalformedSchemeSpecific,\n malformedHost: relativeMalformedHost,\n malformedScheme: relativeMalformedScheme\n } = parseWithStatus(relativeURI, schemelessOptions)\n if (\n baseMalformed ||\n relativeMalformed ||\n baseMalformedPercentEncoding ||\n relativeMalformedPercentEncoding ||\n baseMalformedSchemeSpecific ||\n relativeMalformedSchemeSpecific ||\n baseMalformedHost ||\n relativeMalformedHost ||\n baseMalformedScheme ||\n relativeMalformedScheme\n ) {\n throw new Error(baseParsed.error || relativeParsed.error || 'URI is malformed.')\n }\n const resolved = resolveComponent(baseParsed, relativeParsed, schemelessOptions, true)\n const resolvedSchemeHandler = getSchemeHandler((options && options.scheme) || resolved.scheme)\n const resolvedHost = resolved.host\n const resolvedHostIsIP = resolvedHost !== undefined && resolvedHost !== '' &&\n (isIPv4(resolvedHost) || normalizeIPv6(resolvedHost).isIPV6)\n canonicalizeHost(resolved, options || {}, resolvedSchemeHandler, resolvedHostIsIP)\n // Percent escapes in an ASCII reg-name are encoded data. The WHATWG hostname\n // parser can reject them even though fast-uri preserves them safely as RFC\n // 3986 data. A raw non-ASCII host must still fail closed if conversion fails.\n const encodedASCIIHost = resolvedHost && resolvedHost.indexOf('%') !== -1 &&\n !/\\P{ASCII}/u.test(resolvedHost)\n if (resolved.error && !encodedASCIIHost) {\n throw new Error(resolved.error)\n }\n schemelessOptions.skipEscape = true\n return serialize(resolved, schemelessOptions)\n}\n\n/**\n * @param {import ('./types/index').URIComponent} base\n * @param {import ('./types/index').URIComponent} relative\n * @param {import('./types/index').Options} [options]\n * @param {boolean} [skipNormalization=false]\n * @returns {import ('./types/index').URIComponent}\n */\nfunction resolveComponent (base, relative, options, skipNormalization) {\n /** @type {import('./types/index').URIComponent} */\n const target = {}\n if (!skipNormalization) {\n base = parse(serialize(base, options), options) // normalize base component\n relative = parse(serialize(relative, options), options) // normalize relative component\n }\n options = options || {}\n\n if (!options.tolerant && relative.scheme) {\n target.scheme = relative.scheme\n // target.authority = relative.authority;\n target.userinfo = relative.userinfo\n target.host = relative.host\n target.port = relative.port\n target.path = removeDotSegments(relative.path || '')\n target.query = relative.query\n } else {\n if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {\n // target.authority = relative.authority;\n target.userinfo = relative.userinfo\n target.host = relative.host\n target.port = relative.port\n target.path = removeDotSegments(relative.path || '')\n target.query = relative.query\n } else {\n if (!relative.path) {\n target.path = base.path\n if (relative.query !== undefined) {\n target.query = relative.query\n } else {\n target.query = base.query\n }\n } else {\n if (relative.path[0] === '/') {\n target.path = removeDotSegments(relative.path)\n } else {\n if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {\n target.path = '/' + relative.path\n } else if (!base.path) {\n target.path = relative.path\n } else {\n target.path = base.path.slice(0, base.path.lastIndexOf('/') + 1) + relative.path\n }\n target.path = removeDotSegments(target.path)\n }\n target.query = relative.query\n }\n // target.authority = base.authority;\n target.userinfo = base.userinfo\n target.host = base.host\n target.port = base.port\n }\n target.scheme = base.scheme\n }\n\n target.fragment = relative.fragment\n\n return target\n}\n\n/**\n * @param {import ('./types/index').URIComponent|string} uriA\n * @param {import ('./types/index').URIComponent|string} uriB\n * @param {import ('./types/index').Options} options\n * @returns {boolean}\n */\nfunction equal (uriA, uriB, options) {\n const normalizedA = normalizeComparableURI(uriA, options)\n const normalizedB = normalizeComparableURI(uriB, options)\n\n return normalizedA !== undefined && normalizedB !== undefined && normalizedA === normalizedB\n}\n\n/**\n * @param {Readonly<import('./types/index').URIComponent>} cmpts\n * @param {import('./types/index').Options} [opts]\n * @returns {string}\n */\nfunction serialize (cmpts, opts) {\n const component = {\n host: cmpts.host,\n scheme: cmpts.scheme,\n userinfo: cmpts.userinfo,\n port: cmpts.port,\n path: cmpts.path,\n query: cmpts.query,\n nid: cmpts.nid,\n nss: cmpts.nss,\n uuid: cmpts.uuid,\n fragment: cmpts.fragment,\n reference: cmpts.reference,\n resourceName: cmpts.resourceName,\n secure: cmpts.secure,\n to: cmpts.to,\n subject: cmpts.subject,\n body: cmpts.body,\n headers: cmpts.headers,\n error: ''\n }\n const options = Object.assign({}, opts)\n const uriTokens = []\n\n if (component.scheme) {\n component.scheme = decodeValidScheme(component.scheme)\n }\n\n // find scheme handler\n const schemeHandler = getSchemeHandler(options.scheme || component.scheme)\n\n // perform scheme specific serialization\n if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options)\n\n const hasAuthority = component.userinfo !== undefined || component.host !== undefined || component.port !== undefined\n const pathNoScheme = !options.skipEscape && component.scheme === undefined && !hasAuthority\n\n if (component.path !== undefined) {\n if (!options.skipEscape) {\n component.path = serializePathEncoding(component.path, pathNoScheme)\n } else {\n component.path = normalizePercentEncoding(component.path)\n }\n }\n\n if (options.reference !== 'suffix' && component.scheme) {\n // Scheme handlers may replace the scheme during serialization.\n component.scheme = decodeValidScheme(component.scheme)\n uriTokens.push(component.scheme, ':')\n }\n\n const authority = recomposeAuthority(component)\n if (authority !== undefined) {\n if (options.reference !== 'suffix') {\n uriTokens.push('//')\n }\n\n uriTokens.push(authority)\n\n if (component.path && component.path[0] !== '/') {\n uriTokens.push('/')\n }\n }\n if (component.path !== undefined) {\n let s = component.path\n\n if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {\n s = removeDotSegments(s)\n }\n\n // Dot-segment removal can expose a colon that was not originally in the\n // first segment (for example, \"./a:b\"). Reapply path-noscheme encoding so\n // the serialized relative reference cannot be reparsed as a URI scheme.\n if (pathNoScheme) {\n s = serializePathEncoding(s, true)\n }\n\n if (\n authority === undefined &&\n s[0] === '/' &&\n s[1] === '/'\n ) {\n // don't allow the path to start with \"//\"\n s = '/%2F' + s.slice(2)\n }\n\n uriTokens.push(s)\n }\n\n if (component.query !== undefined) {\n uriTokens.push('?', encodeQuery(component.query))\n }\n\n if (component.fragment !== undefined) {\n uriTokens.push('#', encodeFragment(component.fragment))\n }\n return uriTokens.join('')\n}\n\nconst URI_PARSE = /^(?:([^#/:?]+):)?(?:\\/\\/((?:([^#/?@]*)@)?(\\[[^#/?\\]]+\\]|[^#/:?]*)(?::(\\d*))?))?([^#?]*)(?:\\?([^#]*))?(?:#((?:.|[\\n\\r])*))?/u\n\n// Captures the authority component (between \"//\" and the next \"/\", \"?\" or \"#\"),\n// with or without a scheme prefix, for the literal-backslash rejection below.\nconst AUTHORITY_PREFIX = /^(?:[^#/:?]+:)?\\/\\/([^/?#]*)/\n\n// Captures the leading authority-introducer region after an optional scheme: a\n// run of forward slashes, backslashes, and the characters the WHATWG URL parser\n// removes before parsing (TAB U+0009, LF U+000A, CR U+000D). A valid introducer\n// is exactly \"//\". Node treats \"\\\" as \"/\" on special schemes and strips those\n// characters first, so forms like \"\\\\\", \"/\\\", \"\\/\", \"/<TAB>/\", or a leading\n// \"<TAB>//\" reach an authority in Node while fast-uri's URI_PARSE folds them into\n// the path group (host confusion / SSRF / redirect bypass).\nconst AUTHORITY_INTRODUCER_REGION = /^(?:[^#/:?]+:)?([/\\\\\\t\\n\\r]*)/\n\n/**\n * @param {import('./types/index').URIComponent} parsed\n * @param {RegExpMatchArray} matches\n * @returns {string|undefined}\n */\nfunction getParseError (parsed, matches) {\n if (matches[2] !== undefined && parsed.path && parsed.path[0] !== '/') {\n return 'URI path must start with \"/\" when authority is present.'\n }\n\n if (typeof parsed.port === 'number' && (parsed.port < 0 || parsed.port > 65535)) {\n return 'URI port is malformed.'\n }\n\n return undefined\n}\n\n/**\n * Checks percent syntax without decoding the represented octets. RFC 3986\n * percent-encoding is byte-oriented, so sequences such as `%FF` are valid even\n * though they are not independently valid UTF-8.\n *\n * @param {string|undefined} component\n * @returns {boolean}\n */\nfunction hasMalformedPercentEncoding (component) {\n if (component === undefined) return false\n\n let percent = component.indexOf('%')\n while (percent !== -1) {\n if (percent + 2 >= component.length || !/^[\\da-f]{2}$/iu.test(component.slice(percent + 1, percent + 3))) {\n return true\n }\n percent = component.indexOf('%', percent + 3)\n }\n\n return false\n}\n\n/**\n * Whether the host is a bracketed IP literal (RFC 3986 `IP-literal`).\n * An unterminated `[` is not a literal, so it must still be validated as a\n * reg-name instead of being waved through as an IP.\n *\n * @param {string} host\n * @returns {boolean}\n */\nfunction isIPLiteral (host) {\n return host[0] === '[' && host[host.length - 1] === ']'\n}\n\n/**\n * @param {RegExpMatchArray} matches\n * @returns {boolean}\n */\nfunction hasMalformedComponentPercentEncoding (matches) {\n // Bracketed IP literals use a raw \"%\" as the zone separator for historical\n // compatibility. Their parsing is intentionally left to normalizeIPv6.\n const host = matches[4]\n return hasMalformedPercentEncoding(matches[3]) ||\n (host !== undefined && !isIPLiteral(host) && hasMalformedPercentEncoding(host)) ||\n hasMalformedPercentEncoding(matches[6]) ||\n hasMalformedPercentEncoding(matches[7]) ||\n hasMalformedPercentEncoding(matches[8])\n}\n\n/**\n * @param {import('./types/index').URIComponent} parsed\n * @param {import('./types/index').Options} options\n * @param {{ domainHost?: boolean, unicodeSupport?: boolean }|undefined} schemeHandler\n * @param {boolean} isIP\n * @returns {boolean} whether host conversion failed\n */\nfunction canonicalizeHost (parsed, options, schemeHandler, isIP) {\n const bracketedIPLiteral =\n parsed.host &&\n parsed.host[0] === '[' &&\n parsed.host[parsed.host.length - 1] === ']'\n\n if (\n !options.unicodeSupport &&\n (!schemeHandler || !schemeHandler.unicodeSupport) &&\n parsed.host &&\n !isIPLiteral(parsed.host) &&\n (options.domainHost || (schemeHandler && schemeHandler.domainHost)) &&\n isIP === false &&\n !bracketedIPLiteral &&\n nonSimpleDomain(parsed.host)\n ) {\n try {\n parsed.host = new URL('http://' + parsed.host).hostname\n } catch (e) {\n parsed.error = parsed.error || \"Host's domain name can not be converted to ASCII: \" + e\n return true\n }\n }\n\n return false\n}\n\n/**\n * @param {string} uri\n * @param {import('./types/index').Options} [opts]\n * @returns {{ parsed: import('./types/index').URIComponent, malformedAuthorityOrPort: boolean, malformedPercentEncoding: boolean, malformedSchemeSpecific: boolean, malformedHost: boolean, malformedScheme: boolean }}\n */\nfunction parseWithStatus (uri, opts) {\n const options = Object.assign({}, opts)\n /** @type {import('./types/index').URIComponent} */\n const parsed = {\n scheme: undefined,\n userinfo: undefined,\n host: '',\n port: undefined,\n path: '',\n query: undefined,\n fragment: undefined\n }\n\n let malformedAuthorityOrPort = false\n let malformedPercentEncoding = false\n let malformedSchemeSpecific = false\n let malformedHost = false\n let malformedIPLiteral = false\n let malformedScheme = false\n\n let isIP = false\n if (options.reference === 'suffix') {\n if (options.scheme) {\n uri = options.scheme + ':' + uri\n } else {\n uri = '//' + uri\n }\n }\n\n // A literal backslash (U+005C) is not a valid RFC 3986 URI character and is\n // not an authority delimiter. Reject it in the authority rather than\n // rewriting it: normalizing \"\\\" -> \"/\" (WHATWG error recovery) could silently\n // change the resource identified by an otherwise-invalid input, and lets \"\\\"\n // act as a host delimiter here while Node's native URL parses a different\n // host (SSRF / redirect / origin-allowlist bypass). Percent-encoded %5C is\n // untouched and remains valid encoded data.\n const authorityMatch = uri.match(AUTHORITY_PREFIX)\n if (authorityMatch !== null && authorityMatch[1].indexOf('\\\\') !== -1) {\n parsed.error = 'URI authority must not contain a literal backslash.'\n malformedAuthorityOrPort = true\n }\n\n // Reject a malformed or whitespace-smuggled authority introducer. fast-uri\n // only recognizes a literal \"//\"; anything else in the leading separator run\n // (a backslash, or a \"//\" that appears only after removing the TAB/LF/CR that\n // Node strips) means the authority fast-uri parses differs from the one Node's\n // URL resolves. Reject rather than rewrite, mirroring the literal-backslash\n // guard above. Percent-encoded forms (%5C, %09) are untouched, valid data.\n const introducerMatch = uri.match(AUTHORITY_INTRODUCER_REGION)\n if (introducerMatch !== null) {\n const region = introducerMatch[1]\n const normalizedRegion = region.replace(/[\\t\\n\\r]/g, '')\n // Two or more leading separators introduce an authority.\n if (normalizedRegion.length >= 2) {\n if (normalizedRegion.slice(0, 2) !== '//') {\n parsed.error = parsed.error || 'URI authority must not contain a literal backslash.'\n malformedAuthorityOrPort = true\n } else if (region.length !== normalizedRegion.length) {\n parsed.error = parsed.error || 'URI authority introducer must not contain whitespace.'\n malformedAuthorityOrPort = true\n }\n }\n }\n\n const matches = uri.match(URI_PARSE)\n\n if (matches) {\n // store each component\n parsed.scheme = matches[1]\n parsed.userinfo = matches[3]\n parsed.host = matches[4]\n parsed.port = parseInt(matches[5], 10)\n parsed.path = matches[6] || ''\n parsed.query = matches[7]\n parsed.fragment = matches[8]\n\n if (parsed.scheme !== undefined) {\n const decodedScheme = unescape(parsed.scheme)\n if (VALID_SCHEME.test(decodedScheme)) {\n parsed.scheme = decodedScheme.toLowerCase()\n } else {\n parsed.error = parsed.error || MALFORMED_SCHEME_ERROR\n malformedScheme = true\n }\n }\n\n malformedPercentEncoding = hasMalformedComponentPercentEncoding(matches)\n if (malformedPercentEncoding) {\n parsed.error = parsed.error || 'URI contains malformed percent-encoding.'\n }\n\n // fix port number\n if (isNaN(parsed.port)) {\n parsed.port = matches[5]\n }\n\n const parseError = getParseError(parsed, matches)\n if (parseError !== undefined) {\n parsed.error = parsed.error || parseError\n malformedAuthorityOrPort = true\n }\n\n if (parsed.host) {\n const ipv4result = isIPv4(parsed.host)\n if (ipv4result === false) {\n const bracketedIPLiteral = isIPLiteral(parsed.host)\n const hasIPLiteralBracket = parsed.host.indexOf('[') !== -1 || parsed.host.indexOf(']') !== -1\n const ipv6result = normalizeIPv6(parsed.host)\n isIP = ipv6result.isIPV6 || ipv6result.isIPVFuture === true\n malformedIPLiteral = hasIPLiteralBracket && (!bracketedIPLiteral || ipv6result.error === true)\n parsed.host = isIP ? ipv6result.host : ipv6result.host.toLowerCase()\n\n if (malformedIPLiteral) {\n parsed.error = parsed.error || 'URI host is malformed.'\n malformedAuthorityOrPort = true\n }\n } else {\n isIP = true\n }\n }\n if (parsed.scheme === undefined && parsed.userinfo === undefined && parsed.host === undefined && parsed.port === undefined && parsed.query === undefined && !parsed.path) {\n parsed.reference = 'same-document'\n } else if (parsed.scheme === undefined) {\n parsed.reference = 'relative'\n } else if (parsed.fragment === undefined) {\n parsed.reference = 'absolute'\n } else {\n parsed.reference = 'uri'\n }\n\n // check for reference errors\n if (options.reference && options.reference !== 'suffix' && options.reference !== parsed.reference) {\n parsed.error = parsed.error || 'URI is not a ' + options.reference + ' reference.'\n }\n\n // find scheme handler\n const schemeHandler = getSchemeHandler(options.scheme || parsed.scheme)\n\n // convert Unicode IDN -> ASCII IDN when the effective scheme uses domain hosts\n if (!malformedIPLiteral) {\n malformedHost = canonicalizeHost(parsed, options, schemeHandler, isIP)\n }\n\n if (!schemeHandler || (schemeHandler && !schemeHandler.skipNormalize)) {\n if (uri.indexOf('%') !== -1) {\n if (parsed.host !== undefined && !malformedIPLiteral) {\n const host = isIP ? parsed.host : normalizePercentEncoding(parsed.host, true)\n parsed.host = reescapeHostDelimiters(host, isIP)\n }\n }\n if (parsed.path) {\n parsed.path = normalizePathEncoding(parsed.path)\n }\n if (parsed.query) {\n parsed.query = normalizeQueryFragmentEncoding(parsed.query)\n }\n if (parsed.fragment) {\n parsed.fragment = normalizeQueryFragmentEncoding(parsed.fragment)\n }\n }\n\n // perform scheme specific parsing\n if (schemeHandler && schemeHandler.parse) {\n schemeHandler.parse(parsed, options)\n if (schemeHandler === SCHEMES.urn && parsed.nid === undefined) {\n malformedSchemeSpecific = true\n }\n }\n } else {\n parsed.error = parsed.error || 'URI can not be parsed.'\n }\n return { parsed, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme }\n}\n\n/**\n * @param {string} uri\n * @param {import('./types/index').Options} [opts]\n * @returns\n */\nfunction parse (uri, opts) {\n return parseWithStatus(uri, opts).parsed\n}\n\n/**\n * @param {string} uri\n * @param {import('./types/index').Options} [opts]\n * @returns {string}\n */\nfunction normalizeString (uri, opts) {\n return normalizeStringWithStatus(uri, opts).normalized\n}\n\n/**\n * @param {string} uri\n * @param {import('./types/index').Options} [opts]\n * @returns {{ normalized: string, malformedAuthorityOrPort: boolean, malformedPercentEncoding: boolean, malformedSchemeSpecific: boolean, malformedHost: boolean, malformedScheme: boolean }}\n */\nfunction normalizeStringWithStatus (uri, opts) {\n const { parsed, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme } = parseWithStatus(uri, opts)\n return {\n normalized: malformedAuthorityOrPort || malformedPercentEncoding || malformedSchemeSpecific || malformedHost || malformedScheme ? uri : serialize(parsed, opts),\n malformedAuthorityOrPort,\n malformedPercentEncoding,\n malformedSchemeSpecific,\n malformedHost,\n malformedScheme\n }\n}\n\n/**\n * @param {import ('./types/index').URIComponent|string} uri\n * @param {import('./types/index').Options} [opts]\n * @returns {string|undefined}\n */\nfunction normalizeComparableURI (uri, opts) {\n if (typeof uri !== 'string' && typeof uri !== 'object') {\n return undefined\n }\n\n let value\n try {\n value = typeof uri === 'string' ? uri : serialize(uri, opts)\n } catch {\n return undefined\n }\n const { normalized, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme } = normalizeStringWithStatus(value, opts)\n return malformedAuthorityOrPort || malformedPercentEncoding || malformedSchemeSpecific || malformedHost || malformedScheme ? undefined : normalized\n}\n\nconst fastUri = {\n SCHEMES,\n normalize,\n resolve,\n resolveComponent,\n equal,\n serialize,\n parse\n}\n\nmodule.exports = fastUri\nmodule.exports.default = fastUri\nmodule.exports.fastUri = fastUri\n","var hasExcape = /~/\nvar escapeMatcher = /~[01]/g\nfunction escapeReplacer (m) {\n switch (m) {\n case '~1': return '/'\n case '~0': return '~'\n }\n throw new Error('Invalid tilde escape: ' + m)\n}\n\nfunction untilde (str) {\n if (!hasExcape.test(str)) return str\n return str.replace(escapeMatcher, escapeReplacer)\n}\n\nfunction setter (obj, pointer, value) {\n var part\n var hasNextPart\n\n for (var p = 1, len = pointer.length; p < len;) {\n if (pointer[p] === 'constructor' || pointer[p] === 'prototype' || pointer[p] === '__proto__') return obj\n\n part = untilde(pointer[p++])\n hasNextPart = len > p\n\n if (typeof obj[part] === 'undefined') {\n // support setting of /-\n if (Array.isArray(obj) && part === '-') {\n part = obj.length\n }\n\n // support nested objects/array when setting values\n if (hasNextPart) {\n if ((pointer[p] !== '' && pointer[p] < Infinity) || pointer[p] === '-') obj[part] = []\n else obj[part] = {}\n }\n }\n\n if (!hasNextPart) break\n obj = obj[part]\n }\n\n var oldValue = obj[part]\n if (value === undefined) delete obj[part]\n else obj[part] = value\n return oldValue\n}\n\nfunction compilePointer (pointer) {\n if (typeof pointer === 'string') {\n pointer = pointer.split('/')\n if (pointer[0] === '') return pointer\n throw new Error('Invalid JSON pointer.')\n } else if (Array.isArray(pointer)) {\n for (const part of pointer) {\n if (typeof part !== 'string' && typeof part !== 'number') {\n throw new Error('Invalid JSON pointer. Must be of type string or number.')\n }\n }\n return pointer\n }\n\n throw new Error('Invalid JSON pointer.')\n}\n\nfunction get (obj, pointer) {\n if (typeof obj !== 'object') throw new Error('Invalid input object.')\n pointer = compilePointer(pointer)\n var len = pointer.length\n if (len === 1) return obj\n\n for (var p = 1; p < len;) {\n obj = obj[untilde(pointer[p++])]\n if (len === p) return obj\n if (typeof obj !== 'object' || obj === null) return undefined\n }\n}\n\nfunction set (obj, pointer, value) {\n if (typeof obj !== 'object') throw new Error('Invalid input object.')\n pointer = compilePointer(pointer)\n if (pointer.length === 0) throw new Error('Invalid JSON pointer for set.')\n return setter(obj, pointer, value)\n}\n\nfunction compile (pointer) {\n var compiled = compilePointer(pointer)\n return {\n get: function (object) {\n return get(object, compiled)\n },\n set: function (object, value) {\n return set(object, compiled, value)\n }\n }\n}\n\nexports.get = get\nexports.set = set\nexports.compile = compile\n","/**\n * @license React\n * react-is.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_SERVER_CONTEXT_TYPE = Symbol.for('react.server_context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction typeOf(object) {\n if (typeof object === 'object' && object !== null) {\n var $$typeof = object.$$typeof;\n\n switch ($$typeof) {\n case REACT_ELEMENT_TYPE:\n var type = object.type;\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n case REACT_PROFILER_TYPE:\n case REACT_STRICT_MODE_TYPE:\n case REACT_SUSPENSE_TYPE:\n case REACT_SUSPENSE_LIST_TYPE:\n return type;\n\n default:\n var $$typeofType = type && type.$$typeof;\n\n switch ($$typeofType) {\n case REACT_SERVER_CONTEXT_TYPE:\n case REACT_CONTEXT_TYPE:\n case REACT_FORWARD_REF_TYPE:\n case REACT_LAZY_TYPE:\n case REACT_MEMO_TYPE:\n case REACT_PROVIDER_TYPE:\n return $$typeofType;\n\n default:\n return $$typeof;\n }\n\n }\n\n case REACT_PORTAL_TYPE:\n return $$typeof;\n }\n }\n\n return undefined;\n}\nvar ContextConsumer = REACT_CONTEXT_TYPE;\nvar ContextProvider = REACT_PROVIDER_TYPE;\nvar Element = REACT_ELEMENT_TYPE;\nvar ForwardRef = REACT_FORWARD_REF_TYPE;\nvar Fragment = REACT_FRAGMENT_TYPE;\nvar Lazy = REACT_LAZY_TYPE;\nvar Memo = REACT_MEMO_TYPE;\nvar Portal = REACT_PORTAL_TYPE;\nvar Profiler = REACT_PROFILER_TYPE;\nvar StrictMode = REACT_STRICT_MODE_TYPE;\nvar Suspense = REACT_SUSPENSE_TYPE;\nvar SuspenseList = REACT_SUSPENSE_LIST_TYPE;\nvar hasWarnedAboutDeprecatedIsAsyncMode = false;\nvar hasWarnedAboutDeprecatedIsConcurrentMode = false; // AsyncMode should be deprecated\n\nfunction isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint\n\n console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 18+.');\n }\n }\n\n return false;\n}\nfunction isConcurrentMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsConcurrentMode) {\n hasWarnedAboutDeprecatedIsConcurrentMode = true; // Using console['warn'] to evade Babel and ESLint\n\n console['warn']('The ReactIs.isConcurrentMode() alias has been deprecated, ' + 'and will be removed in React 18+.');\n }\n }\n\n return false;\n}\nfunction isContextConsumer(object) {\n return typeOf(object) === REACT_CONTEXT_TYPE;\n}\nfunction isContextProvider(object) {\n return typeOf(object) === REACT_PROVIDER_TYPE;\n}\nfunction isElement(object) {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n}\nfunction isForwardRef(object) {\n return typeOf(object) === REACT_FORWARD_REF_TYPE;\n}\nfunction isFragment(object) {\n return typeOf(object) === REACT_FRAGMENT_TYPE;\n}\nfunction isLazy(object) {\n return typeOf(object) === REACT_LAZY_TYPE;\n}\nfunction isMemo(object) {\n return typeOf(object) === REACT_MEMO_TYPE;\n}\nfunction isPortal(object) {\n return typeOf(object) === REACT_PORTAL_TYPE;\n}\nfunction isProfiler(object) {\n return typeOf(object) === REACT_PROFILER_TYPE;\n}\nfunction isStrictMode(object) {\n return typeOf(object) === REACT_STRICT_MODE_TYPE;\n}\nfunction isSuspense(object) {\n return typeOf(object) === REACT_SUSPENSE_TYPE;\n}\nfunction isSuspenseList(object) {\n return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;\n}\n\nexports.ContextConsumer = ContextConsumer;\nexports.ContextProvider = ContextProvider;\nexports.Element = Element;\nexports.ForwardRef = ForwardRef;\nexports.Fragment = Fragment;\nexports.Lazy = Lazy;\nexports.Memo = Memo;\nexports.Portal = Portal;\nexports.Profiler = Profiler;\nexports.StrictMode = StrictMode;\nexports.Suspense = Suspense;\nexports.SuspenseList = SuspenseList;\nexports.isAsyncMode = isAsyncMode;\nexports.isConcurrentMode = isConcurrentMode;\nexports.isContextConsumer = isContextConsumer;\nexports.isContextProvider = isContextProvider;\nexports.isElement = isElement;\nexports.isForwardRef = isForwardRef;\nexports.isFragment = isFragment;\nexports.isLazy = isLazy;\nexports.isMemo = isMemo;\nexports.isPortal = isPortal;\nexports.isProfiler = isProfiler;\nexports.isStrictMode = isStrictMode;\nexports.isSuspense = isSuspense;\nexports.isSuspenseList = isSuspenseList;\nexports.isValidElementType = isValidElementType;\nexports.typeOf = typeOf;\n })();\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","export function deepCompareStrict(a, b) {\n const typeofa = typeof a;\n if (typeofa !== typeof b) {\n return false;\n }\n if (Array.isArray(a)) {\n if (!Array.isArray(b)) {\n return false;\n }\n const length = a.length;\n if (length !== b.length) {\n return false;\n }\n for (let i = 0; i < length; i++) {\n if (!deepCompareStrict(a[i], b[i])) {\n return false;\n }\n }\n return true;\n }\n if (typeofa === 'object') {\n if (!a || !b) {\n return a === b;\n }\n const aKeys = Object.keys(a);\n const bKeys = Object.keys(b);\n const length = aKeys.length;\n if (length !== bKeys.length) {\n return false;\n }\n for (const k of aKeys) {\n if (!deepCompareStrict(a[k], b[k])) {\n return false;\n }\n }\n return true;\n }\n return a === b;\n}\n","export function encodePointer(p) {\n return encodeURI(escapePointer(p));\n}\nexport function escapePointer(p) {\n return p.replace(/~/g, '~0').replace(/\\//g, '~1');\n}\n","import { encodePointer } from './pointer.js';\nexport const schemaKeyword = {\n additionalItems: true,\n unevaluatedItems: true,\n items: true,\n contains: true,\n additionalProperties: true,\n unevaluatedProperties: true,\n propertyNames: true,\n not: true,\n if: true,\n then: true,\n else: true\n};\nexport const schemaArrayKeyword = {\n prefixItems: true,\n items: true,\n allOf: true,\n anyOf: true,\n oneOf: true\n};\nexport const schemaMapKeyword = {\n $defs: true,\n definitions: true,\n properties: true,\n patternProperties: true,\n dependentSchemas: true\n};\nexport const ignoredKeyword = {\n id: true,\n $id: true,\n $ref: true,\n $schema: true,\n $anchor: true,\n $vocabulary: true,\n $comment: true,\n default: true,\n enum: true,\n const: true,\n required: true,\n type: true,\n maximum: true,\n minimum: true,\n exclusiveMaximum: true,\n exclusiveMinimum: true,\n multipleOf: true,\n maxLength: true,\n minLength: true,\n pattern: true,\n format: true,\n maxItems: true,\n minItems: true,\n uniqueItems: true,\n maxProperties: true,\n minProperties: true\n};\nexport let initialBaseURI = typeof self !== 'undefined' &&\n self.location &&\n self.location.origin !== 'null'\n ?\n new URL(self.location.origin + self.location.pathname + location.search)\n : new URL('https://github.com/cfworker');\nexport function dereference(schema, lookup = Object.create(null), baseURI = initialBaseURI, basePointer = '') {\n if (schema && typeof schema === 'object' && !Array.isArray(schema)) {\n const id = schema.$id || schema.id;\n if (id) {\n const url = new URL(id, baseURI.href);\n if (url.hash.length > 1) {\n lookup[url.href] = schema;\n }\n else {\n url.hash = '';\n if (basePointer === '') {\n baseURI = url;\n }\n else {\n dereference(schema, lookup, baseURI);\n }\n }\n }\n }\n else if (schema !== true && schema !== false) {\n return lookup;\n }\n const schemaURI = baseURI.href + (basePointer ? '#' + basePointer : '');\n if (lookup[schemaURI] !== undefined) {\n throw new Error(`Duplicate schema URI \"${schemaURI}\".`);\n }\n lookup[schemaURI] = schema;\n if (schema === true || schema === false) {\n return lookup;\n }\n if (schema.__absolute_uri__ === undefined) {\n Object.defineProperty(schema, '__absolute_uri__', {\n enumerable: false,\n value: schemaURI\n });\n }\n if (schema.$ref && schema.__absolute_ref__ === undefined) {\n const url = new URL(schema.$ref, baseURI.href);\n url.hash = url.hash;\n Object.defineProperty(schema, '__absolute_ref__', {\n enumerable: false,\n value: url.href\n });\n }\n if (schema.$recursiveRef && schema.__absolute_recursive_ref__ === undefined) {\n const url = new URL(schema.$recursiveRef, baseURI.href);\n url.hash = url.hash;\n Object.defineProperty(schema, '__absolute_recursive_ref__', {\n enumerable: false,\n value: url.href\n });\n }\n if (schema.$anchor) {\n const url = new URL('#' + schema.$anchor, baseURI.href);\n lookup[url.href] = schema;\n }\n for (let key in schema) {\n if (ignoredKeyword[key]) {\n continue;\n }\n const keyBase = `${basePointer}/${encodePointer(key)}`;\n const subSchema = schema[key];\n if (Array.isArray(subSchema)) {\n if (schemaArrayKeyword[key]) {\n const length = subSchema.length;\n for (let i = 0; i < length; i++) {\n dereference(subSchema[i], lookup, baseURI, `${keyBase}/${i}`);\n }\n }\n }\n else if (schemaMapKeyword[key]) {\n for (let subKey in subSchema) {\n dereference(subSchema[subKey], lookup, baseURI, `${keyBase}/${encodePointer(subKey)}`);\n }\n }\n else {\n dereference(subSchema, lookup, baseURI, keyBase);\n }\n }\n return lookup;\n}\n","const DATE = /^(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)$/;\nconst DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nconst TIME = /^(\\d\\d):(\\d\\d):(\\d\\d)(\\.\\d+)?(z|[+-]\\d\\d(?::?\\d\\d)?)?$/i;\nconst HOSTNAME = /^(?=.{1,253}\\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\\.?$/i;\nconst URIREF = /^(?:[a-z][a-z0-9+\\-.]*:)?(?:\\/?\\/(?:(?:[a-z0-9\\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?))|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\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u{00a1}-\\u{ffff}0-9]+-?)*[a-z\\u{00a1}-\\u{ffff}0-9]+)(?:\\.(?:[a-z\\u{00a1}-\\u{ffff}0-9]+-?)*[a-z\\u{00a1}-\\u{ffff}0-9]+)*(?:\\.(?:[a-z\\u{00a1}-\\u{ffff}]{2,})))(?::\\d{2,5})?(?:\\/[^\\s]*)?$/iu;\nconst UUID = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;\nconst JSON_POINTER = /^(?:\\/(?:[^~/]|~0|~1)*)*$/;\nconst JSON_POINTER_URI_FRAGMENT = /^#(?:\\/(?:[a-z0-9_\\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;\nconst RELATIVE_JSON_POINTER = /^(?:0|[1-9][0-9]*)(?:#|(?:\\/(?:[^~/]|~0|~1)*)*)$/;\nconst EMAIL = (input) => {\n if (input[0] === '\"')\n return false;\n const [name, host, ...rest] = input.split('@');\n if (!name ||\n !host ||\n rest.length !== 0 ||\n name.length > 64 ||\n host.length > 253)\n return false;\n if (name[0] === '.' || name.endsWith('.') || name.includes('..'))\n return false;\n if (!/^[a-z0-9.-]+$/i.test(host) ||\n !/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(name))\n return false;\n return host\n .split('.')\n .every(part => /^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(part));\n};\nconst IPV4 = /^(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)$/;\nconst IPV6 = /^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))$/i;\nconst DURATION = (input) => input.length > 1 &&\n input.length < 80 &&\n (/^P\\d+([.,]\\d+)?W$/.test(input) ||\n (/^P[\\dYMDTHS]*(\\d[.,]\\d+)?[YMDHS]$/.test(input) &&\n /^P([.,\\d]+Y)?([.,\\d]+M)?([.,\\d]+D)?(T([.,\\d]+H)?([.,\\d]+M)?([.,\\d]+S)?)?$/.test(input)));\nfunction bind(r) {\n return r.test.bind(r);\n}\nexport const format = {\n date,\n time: time.bind(undefined, false),\n 'date-time': date_time,\n duration: DURATION,\n uri,\n 'uri-reference': bind(URIREF),\n 'uri-template': bind(URITEMPLATE),\n url: bind(URL_),\n email: EMAIL,\n hostname: bind(HOSTNAME),\n ipv4: bind(IPV4),\n ipv6: bind(IPV6),\n regex: regex,\n uuid: bind(UUID),\n 'json-pointer': bind(JSON_POINTER),\n 'json-pointer-uri-fragment': bind(JSON_POINTER_URI_FRAGMENT),\n 'relative-json-pointer': bind(RELATIVE_JSON_POINTER)\n};\nfunction isLeapYear(year) {\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n}\nfunction date(str) {\n const matches = str.match(DATE);\n if (!matches)\n return false;\n const year = +matches[1];\n const month = +matches[2];\n const day = +matches[3];\n return (month >= 1 &&\n month <= 12 &&\n day >= 1 &&\n day <= (month == 2 && isLeapYear(year) ? 29 : DAYS[month]));\n}\nfunction time(full, str) {\n const matches = str.match(TIME);\n if (!matches)\n return false;\n const hour = +matches[1];\n const minute = +matches[2];\n const second = +matches[3];\n const timeZone = !!matches[5];\n return (((hour <= 23 && minute <= 59 && second <= 59) ||\n (hour == 23 && minute == 59 && second == 60)) &&\n (!full || timeZone));\n}\nconst DATE_TIME_SEPARATOR = /t|\\s/i;\nfunction date_time(str) {\n const dateTime = str.split(DATE_TIME_SEPARATOR);\n return dateTime.length == 2 && date(dateTime[0]) && time(true, dateTime[1]);\n}\nconst NOT_URI_FRAGMENT = /\\/|:/;\nconst URI_PATTERN = /^(?:[a-z][a-z0-9+\\-.]*:)(?:\\/?\\/(?:(?:[a-z0-9\\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}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ERN.test(str);\n}\nconst Z_ANCHOR = /[^\\\\]\\\\Z/;\nfunction regex(str) {\n if (Z_ANCHOR.test(str))\n return false;\n try {\n new RegExp(str, 'u');\n return true;\n }\n catch (e) {\n return false;\n }\n}\n","export var OutputFormat;\n(function (OutputFormat) {\n OutputFormat[OutputFormat[\"Flag\"] = 1] = \"Flag\";\n OutputFormat[OutputFormat[\"Basic\"] = 2] = \"Basic\";\n OutputFormat[OutputFormat[\"Detailed\"] = 4] = \"Detailed\";\n})(OutputFormat || (OutputFormat = {}));\n","export function ucs2length(s) {\n let result = 0;\n let length = s.length;\n let index = 0;\n let charCode;\n while (index < length) {\n result++;\n charCode = s.charCodeAt(index++);\n if (charCode >= 0xd800 && charCode <= 0xdbff && index < length) {\n charCode = s.charCodeAt(index);\n if ((charCode & 0xfc00) == 0xdc00) {\n index++;\n }\n }\n }\n return result;\n}\n","import { deepCompareStrict } from './deep-compare-strict.js';\nimport { dereference } from './dereference.js';\nimport { format } from './format.js';\nimport { encodePointer } from './pointer.js';\nimport { ucs2length } from './ucs2-length.js';\nexport function validate(instance, schema, draft = '2019-09', lookup = dereference(schema), shortCircuit = true, recursiveAnchor = null, instanceLocation = '#', schemaLocation = '#', evaluated = Object.create(null)) {\n if (schema === true) {\n return { valid: true, errors: [] };\n }\n if (schema === false) {\n return {\n valid: false,\n errors: [\n {\n instanceLocation,\n keyword: 'false',\n keywordLocation: instanceLocation,\n error: 'False boolean schema.'\n }\n ]\n };\n }\n const rawInstanceType = typeof instance;\n let instanceType;\n switch (rawInstanceType) {\n case 'boolean':\n case 'number':\n case 'string':\n instanceType = rawInstanceType;\n break;\n case 'object':\n if (instance === null) {\n instanceType = 'null';\n }\n else if (Array.isArray(instance)) {\n instanceType = 'array';\n }\n else {\n instanceType = 'object';\n }\n break;\n default:\n throw new Error(`Instances of \"${rawInstanceType}\" type are not supported.`);\n }\n const { $ref, $recursiveRef, $recursiveAnchor, type: $type, const: $const, enum: $enum, required: $required, not: $not, anyOf: $anyOf, allOf: $allOf, oneOf: $oneOf, if: $if, then: $then, else: $else, format: $format, properties: $properties, patternProperties: $patternProperties, additionalProperties: $additionalProperties, unevaluatedProperties: $unevaluatedProperties, minProperties: $minProperties, maxProperties: $maxProperties, propertyNames: $propertyNames, dependentRequired: $dependentRequired, dependentSchemas: $dependentSchemas, dependencies: $dependencies, prefixItems: $prefixItems, items: $items, additionalItems: $additionalItems, unevaluatedItems: $unevaluatedItems, contains: $contains, minContains: $minContains, maxContains: $maxContains, minItems: $minItems, maxItems: $maxItems, uniqueItems: $uniqueItems, minimum: $minimum, maximum: $maximum, exclusiveMinimum: $exclusiveMinimum, exclusiveMaximum: $exclusiveMaximum, multipleOf: $multipleOf, minLength: $minLength, maxLength: $maxLength, pattern: $pattern, __absolute_ref__, __absolute_recursive_ref__ } = schema;\n const errors = [];\n if ($recursiveAnchor === true && recursiveAnchor === null) {\n recursiveAnchor = schema;\n }\n if ($recursiveRef === '#') {\n const refSchema = recursiveAnchor === null\n ? lookup[__absolute_recursive_ref__]\n : recursiveAnchor;\n const keywordLocation = `${schemaLocation}/$recursiveRef`;\n const result = validate(instance, recursiveAnchor === null ? schema : recursiveAnchor, draft, lookup, shortCircuit, refSchema, instanceLocation, keywordLocation, evaluated);\n if (!result.valid) {\n errors.push({\n instanceLocation,\n keyword: '$recursiveRef',\n keywordLocation,\n error: 'A subschema had errors.'\n }, ...result.errors);\n }\n }\n if ($ref !== undefined) {\n const uri = __absolute_ref__ || $ref;\n const refSchema = lookup[uri];\n if (refSchema === undefined) {\n let message = `Unresolved $ref \"${$ref}\".`;\n if (__absolute_ref__ && __absolute_ref__ !== $ref) {\n message += ` Absolute URI \"${__absolute_ref__}\".`;\n }\n message += `\\nKnown schemas:\\n- ${Object.keys(lookup).join('\\n- ')}`;\n throw new Error(message);\n }\n const keywordLocation = `${schemaLocation}/$ref`;\n const result = validate(instance, refSchema, draft, lookup, shortCircuit, recursiveAnchor, instanceLocation, keywordLocation, evaluated);\n if (!result.valid) {\n errors.push({\n instanceLocation,\n keyword: '$ref',\n keywordLocation,\n error: 'A subschema had errors.'\n }, ...result.errors);\n }\n if (draft === '4' || draft === '7') {\n return { valid: errors.length === 0, errors };\n }\n }\n if (Array.isArray($type)) {\n let length = $type.length;\n let valid = false;\n for (let i = 0; i < length; i++) {\n if (instanceType === $type[i] ||\n ($type[i] === 'integer' &&\n instanceType === 'number' &&\n instance % 1 === 0 &&\n instance === instance)) {\n valid = true;\n break;\n }\n }\n if (!valid) {\n errors.push({\n instanceLocation,\n keyword: 'type',\n keywordLocation: `${schemaLocation}/type`,\n error: `Instance type \"${instanceType}\" is invalid. Expected \"${$type.join('\", \"')}\".`\n });\n }\n }\n else if ($type === 'integer') {\n if (instanceType !== 'number' || instance % 1 || instance !== instance) {\n errors.push({\n instanceLocation,\n keyword: 'type',\n keywordLocation: `${schemaLocation}/type`,\n error: `Instance type \"${instanceType}\" is invalid. Expected \"${$type}\".`\n });\n }\n }\n else if ($type !== undefined && instanceType !== $type) {\n errors.push({\n instanceLocation,\n keyword: 'type',\n keywordLocation: `${schemaLocation}/type`,\n error: `Instance type \"${instanceType}\" is invalid. Expected \"${$type}\".`\n });\n }\n if ($const !== undefined) {\n if (instanceType === 'object' || instanceType === 'array') {\n if (!deepCompareStrict(instance, $const)) {\n errors.push({\n instanceLocation,\n keyword: 'const',\n keywordLocation: `${schemaLocation}/const`,\n error: `Instance does not match ${JSON.stringify($const)}.`\n });\n }\n }\n else if (instance !== $const) {\n errors.push({\n instanceLocation,\n keyword: 'const',\n keywordLocation: `${schemaLocation}/const`,\n error: `Instance does not match ${JSON.stringify($const)}.`\n });\n }\n }\n if ($enum !== undefined) {\n if (instanceType === 'object' || instanceType === 'array') {\n if (!$enum.some(value => deepCompareStrict(instance, value))) {\n errors.push({\n instanceLocation,\n keyword: 'enum',\n keywordLocation: `${schemaLocation}/enum`,\n error: `Instance does not match any of ${JSON.stringify($enum)}.`\n });\n }\n }\n else if (!$enum.some(value => instance === value)) {\n errors.push({\n instanceLocation,\n keyword: 'enum',\n keywordLocation: `${schemaLocation}/enum`,\n error: `Instance does not match any of ${JSON.stringify($enum)}.`\n });\n }\n }\n if ($not !== undefined) {\n const keywordLocation = `${schemaLocation}/not`;\n const result = validate(instance, $not, draft, lookup, shortCircuit, recursiveAnchor, instanceLocation, keywordLocation);\n if (result.valid) {\n errors.push({\n instanceLocation,\n keyword: 'not',\n keywordLocation,\n error: 'Instance matched \"not\" schema.'\n });\n }\n }\n let subEvaluateds = [];\n if ($anyOf !== undefined) {\n const keywordLocation = `${schemaLocation}/anyOf`;\n const errorsLength = errors.length;\n let anyValid = false;\n for (let i = 0; i < $anyOf.length; i++) {\n const subSchema = $anyOf[i];\n const subEvaluated = Object.create(evaluated);\n const result = validate(instance, subSchema, draft, lookup, shortCircuit, $recursiveAnchor === true ? recursiveAnchor : null, instanceLocation, `${keywordLocation}/${i}`, subEvaluated);\n errors.push(...result.errors);\n anyValid = anyValid || result.valid;\n if (result.valid) {\n subEvaluateds.push(subEvaluated);\n }\n }\n if (anyValid) {\n errors.length = errorsLength;\n }\n else {\n errors.splice(errorsLength, 0, {\n instanceLocation,\n keyword: 'anyOf',\n keywordLocation,\n error: 'Instance does not match any subschemas.'\n });\n }\n }\n if ($allOf !== undefined) {\n const keywordLocation = `${schemaLocation}/allOf`;\n const errorsLength = errors.length;\n let allValid = true;\n for (let i = 0; i < $allOf.length; i++) {\n const subSchema = $allOf[i];\n const subEvaluated = Object.create(evaluated);\n const result = validate(instance, subSchema, draft, lookup, shortCircuit, $recursiveAnchor === true ? recursiveAnchor : null, instanceLocation, `${keywordLocation}/${i}`, subEvaluated);\n errors.push(...result.errors);\n allValid = allValid && result.valid;\n if (result.valid) {\n subEvaluateds.push(subEvaluated);\n }\n }\n if (allValid) {\n errors.length = errorsLength;\n }\n else {\n errors.splice(errorsLength, 0, {\n instanceLocation,\n keyword: 'allOf',\n keywordLocation,\n error: `Instance does not match every subschema.`\n });\n }\n }\n if ($oneOf !== undefined) {\n const keywordLocation = `${schemaLocation}/oneOf`;\n const errorsLength = errors.length;\n const matches = $oneOf.filter((subSchema, i) => {\n const subEvaluated = Object.create(evaluated);\n const result = validate(instance, subSchema, draft, lookup, shortCircuit, $recursiveAnchor === true ? recursiveAnchor : null, instanceLocation, `${keywordLocation}/${i}`, subEvaluated);\n errors.push(...result.errors);\n if (result.valid) {\n subEvaluateds.push(subEvaluated);\n }\n return result.valid;\n }).length;\n if (matches === 1) {\n errors.length = errorsLength;\n }\n else {\n errors.splice(errorsLength, 0, {\n instanceLocation,\n keyword: 'oneOf',\n keywordLocation,\n error: `Instance does not match exactly one subschema (${matches} matches).`\n });\n }\n }\n if (instanceType === 'object' || instanceType === 'array') {\n Object.assign(evaluated, ...subEvaluateds);\n }\n if ($if !== undefined) {\n const keywordLocation = `${schemaLocation}/if`;\n const conditionResult = validate(instance, $if, draft, lookup, shortCircuit, recursiveAnchor, instanceLocation, keywordLocation, evaluated).valid;\n if (conditionResult) {\n if ($then !== undefined) {\n const thenResult = validate(instance, $then, draft, lookup, shortCircuit, recursiveAnchor, instanceLocation, `${schemaLocation}/then`, evaluated);\n if (!thenResult.valid) {\n errors.push({\n instanceLocation,\n keyword: 'if',\n keywordLocation,\n error: `Instance does not match \"then\" schema.`\n }, ...thenResult.errors);\n }\n }\n }\n else if ($else !== undefined) {\n const elseResult = validate(instance, $else, draft, lookup, shortCircuit, recursiveAnchor, instanceLocation, `${schemaLocation}/else`, evaluated);\n if (!elseResult.valid) {\n errors.push({\n instanceLocation,\n keyword: 'if',\n keywordLocation,\n error: `Instance does not match \"else\" schema.`\n }, ...elseResult.errors);\n }\n }\n }\n if (instanceType === 'object') {\n if ($required !== undefined) {\n for (const key of $required) {\n if (!(key in instance)) {\n errors.push({\n instanceLocation,\n keyword: 'required',\n keywordLocation: `${schemaLocation}/required`,\n error: `Instance does not have required property \"${key}\".`\n });\n }\n }\n }\n const keys = Object.keys(instance);\n if ($minProperties !== undefined && keys.length < $minProperties) {\n errors.push({\n instanceLocation,\n keyword: 'minProperties',\n keywordLocation: `${schemaLocation}/minProperties`,\n error: `Instance does not have at least ${$minProperties} properties.`\n });\n }\n if ($maxProperties !== undefined && keys.length > $maxProperties) {\n errors.push({\n instanceLocation,\n keyword: 'maxProperties',\n keywordLocation: `${schemaLocation}/maxProperties`,\n error: `Instance does not have at least ${$maxProperties} properties.`\n });\n }\n if ($propertyNames !== undefined) {\n const keywordLocation = `${schemaLocation}/propertyNames`;\n for (const key in instance) {\n const subInstancePointer = `${instanceLocation}/${encodePointer(key)}`;\n const result = validate(key, $propertyNames, draft, lookup, shortCircuit, recursiveAnchor, subInstancePointer, keywordLocation);\n if (!result.valid) {\n errors.push({\n instanceLocation,\n keyword: 'propertyNames',\n keywordLocation,\n error: `Property name \"${key}\" does not match schema.`\n }, ...result.errors);\n }\n }\n }\n if ($dependentRequired !== undefined) {\n const keywordLocation = `${schemaLocation}/dependantRequired`;\n for (const key in $dependentRequired) {\n if (key in instance) {\n const required = $dependentRequired[key];\n for (const dependantKey of required) {\n if (!(dependantKey in instance)) {\n errors.push({\n instanceLocation,\n keyword: 'dependentRequired',\n keywordLocation,\n error: `Instance has \"${key}\" but does not have \"${dependantKey}\".`\n });\n }\n }\n }\n }\n }\n if ($dependentSchemas !== undefined) {\n for (const key in $dependentSchemas) {\n const keywordLocation = `${schemaLocation}/dependentSchemas`;\n if (key in instance) {\n const result = validate(instance, $dependentSchemas[key], draft, lookup, shortCircuit, recursiveAnchor, instanceLocation, `${keywordLocation}/${encodePointer(key)}`, evaluated);\n if (!result.valid) {\n errors.push({\n instanceLocation,\n keyword: 'dependentSchemas',\n keywordLocation,\n error: `Instance has \"${key}\" but does not match dependant schema.`\n }, ...result.errors);\n }\n }\n }\n }\n if ($dependencies !== undefined) {\n const keywordLocation = `${schemaLocation}/dependencies`;\n for (const key in $dependencies) {\n if (key in instance) {\n const propsOrSchema = $dependencies[key];\n if (Array.isArray(propsOrSchema)) {\n for (const dependantKey of propsOrSchema) {\n if (!(dependantKey in instance)) {\n errors.push({\n instanceLocation,\n keyword: 'dependencies',\n keywordLocation,\n error: `Instance has \"${key}\" but does not have \"${dependantKey}\".`\n });\n }\n }\n }\n else {\n const result = validate(instance, propsOrSchema, draft, lookup, shortCircuit, recursiveAnchor, instanceLocation, `${keywordLocation}/${encodePointer(key)}`);\n if (!result.valid) {\n errors.push({\n instanceLocation,\n keyword: 'dependencies',\n keywordLocation,\n error: `Instance has \"${key}\" but does not match dependant schema.`\n }, ...result.errors);\n }\n }\n }\n }\n }\n const thisEvaluated = Object.create(null);\n let stop = false;\n if ($properties !== undefined) {\n const keywordLocation = `${schemaLocation}/properties`;\n for (const key in $properties) {\n if (!(key in instance)) {\n continue;\n }\n const subInstancePointer = `${instanceLocation}/${encodePointer(key)}`;\n const result = validate(instance[key], $properties[key], draft, lookup, shortCircuit, recursiveAnchor, subInstancePointer, `${keywordLocation}/${encodePointer(key)}`);\n if (result.valid) {\n evaluated[key] = thisEvaluated[key] = true;\n }\n else {\n stop = shortCircuit;\n errors.push({\n instanceLocation,\n keyword: 'properties',\n keywordLocation,\n error: `Property \"${key}\" does not match schema.`\n }, ...result.errors);\n if (stop)\n break;\n }\n }\n }\n if (!stop && $patternProperties !== undefined) {\n const keywordLocation = `${schemaLocation}/patternProperties`;\n for (const pattern in $patternProperties) {\n const regex = new RegExp(pattern, 'u');\n const subSchema = $patternProperties[pattern];\n for (const key in instance) {\n if (!regex.test(key)) {\n continue;\n }\n const subInstancePointer = `${instanceLocation}/${encodePointer(key)}`;\n const result = validate(instance[key], subSchema, draft, lookup, shortCircuit, recursiveAnchor, subInstancePointer, `${keywordLocation}/${encodePointer(pattern)}`);\n if (result.valid) {\n evaluated[key] = thisEvaluated[key] = true;\n }\n else {\n stop = shortCircuit;\n errors.push({\n instanceLocation,\n keyword: 'patternProperties',\n keywordLocation,\n error: `Property \"${key}\" matches pattern \"${pattern}\" but does not match associated schema.`\n }, ...result.errors);\n }\n }\n }\n }\n if (!stop && $additionalProperties !== undefined) {\n const keywordLocation = `${schemaLocation}/additionalProperties`;\n for (const key in instance) {\n if (thisEvaluated[key]) {\n continue;\n }\n const subInstancePointer = `${instanceLocation}/${encodePointer(key)}`;\n const result = validate(instance[key], $additionalProperties, draft, lookup, shortCircuit, recursiveAnchor, subInstancePointer, keywordLocation);\n if (result.valid) {\n evaluated[key] = true;\n }\n else {\n stop = shortCircuit;\n errors.push({\n instanceLocation,\n keyword: 'additionalProperties',\n keywordLocation,\n error: `Property \"${key}\" does not match additional properties schema.`\n }, ...result.errors);\n }\n }\n }\n else if (!stop && $unevaluatedProperties !== undefined) {\n const keywordLocation = `${schemaLocation}/unevaluatedProperties`;\n for (const key in instance) {\n if (!evaluated[key]) {\n const subInstancePointer = `${instanceLocation}/${encodePointer(key)}`;\n const result = validate(instance[key], $unevaluatedProperties, draft, lookup, shortCircuit, recursiveAnchor, subInstancePointer, keywordLocation);\n if (result.valid) {\n evaluated[key] = true;\n }\n else {\n errors.push({\n instanceLocation,\n keyword: 'unevaluatedProperties',\n keywordLocation,\n error: `Property \"${key}\" does not match unevaluated properties schema.`\n }, ...result.errors);\n }\n }\n }\n }\n }\n else if (instanceType === 'array') {\n if ($maxItems !== undefined && instance.length > $maxItems) {\n errors.push({\n instanceLocation,\n keyword: 'maxItems',\n keywordLocation: `${schemaLocation}/maxItems`,\n error: `Array has too many items (${instance.length} > ${$maxItems}).`\n });\n }\n if ($minItems !== undefined && instance.length < $minItems) {\n errors.push({\n instanceLocation,\n keyword: 'minItems',\n keywordLocation: `${schemaLocation}/minItems`,\n error: `Array has too few items (${instance.length} < ${$minItems}).`\n });\n }\n const length = instance.length;\n let i = 0;\n let stop = false;\n if ($prefixItems !== undefined) {\n const keywordLocation = `${schemaLocation}/prefixItems`;\n const length2 = Math.min($prefixItems.length, length);\n for (; i < length2; i++) {\n const result = validate(instance[i], $prefixItems[i], draft, lookup, shortCircuit, recursiveAnchor, `${instanceLocation}/${i}`, `${keywordLocation}/${i}`);\n evaluated[i] = true;\n if (!result.valid) {\n stop = shortCircuit;\n errors.push({\n instanceLocation,\n keyword: 'prefixItems',\n keywordLocation,\n error: `Items did not match schema.`\n }, ...result.errors);\n if (stop)\n break;\n }\n }\n }\n if ($items !== undefined) {\n const keywordLocation = `${schemaLocation}/items`;\n if (Array.isArray($items)) {\n const length2 = Math.min($items.length, length);\n for (; i < length2; i++) {\n const result = validate(instance[i], $items[i], draft, lookup, shortCircuit, recursiveAnchor, `${instanceLocation}/${i}`, `${keywordLocation}/${i}`);\n evaluated[i] = true;\n if (!result.valid) {\n stop = shortCircuit;\n errors.push({\n instanceLocation,\n keyword: 'items',\n keywordLocation,\n error: `Items did not match schema.`\n }, ...result.errors);\n if (stop)\n break;\n }\n }\n }\n else {\n for (; i < length; i++) {\n const result = validate(instance[i], $items, draft, lookup, shortCircuit, recursiveAnchor, `${instanceLocation}/${i}`, keywordLocation);\n evaluated[i] = true;\n if (!result.valid) {\n stop = shortCircuit;\n errors.push({\n instanceLocation,\n keyword: 'items',\n keywordLocation,\n error: `Items did not match schema.`\n }, ...result.errors);\n if (stop)\n break;\n }\n }\n }\n if (!stop && $additionalItems !== undefined) {\n const keywordLocation = `${schemaLocation}/additionalItems`;\n for (; i < length; i++) {\n const result = validate(instance[i], $additionalItems, draft, lookup, shortCircuit, recursiveAnchor, `${instanceLocation}/${i}`, keywordLocation);\n evaluated[i] = true;\n if (!result.valid) {\n stop = shortCircuit;\n errors.push({\n instanceLocation,\n keyword: 'additionalItems',\n keywordLocation,\n error: `Items did not match additional items schema.`\n }, ...result.errors);\n }\n }\n }\n }\n if ($contains !== undefined) {\n if (length === 0 && $minContains === undefined) {\n errors.push({\n instanceLocation,\n keyword: 'contains',\n keywordLocation: `${schemaLocation}/contains`,\n error: `Array is empty. It must contain at least one item matching the schema.`\n });\n }\n else if ($minContains !== undefined && length < $minContains) {\n errors.push({\n instanceLocation,\n keyword: 'minContains',\n keywordLocation: `${schemaLocation}/minContains`,\n error: `Array has less items (${length}) than minContains (${$minContains}).`\n });\n }\n else {\n const keywordLocation = `${schemaLocation}/contains`;\n const errorsLength = errors.length;\n let contained = 0;\n for (let j = 0; j < length; j++) {\n const result = validate(instance[j], $contains, draft, lookup, shortCircuit, recursiveAnchor, `${instanceLocation}/${j}`, keywordLocation);\n if (result.valid) {\n evaluated[j] = true;\n contained++;\n }\n else {\n errors.push(...result.errors);\n }\n }\n if (contained >= ($minContains || 0)) {\n errors.length = errorsLength;\n }\n if ($minContains === undefined &&\n $maxContains === undefined &&\n contained === 0) {\n errors.splice(errorsLength, 0, {\n instanceLocation,\n keyword: 'contains',\n keywordLocation,\n error: `Array does not contain item matching schema.`\n });\n }\n else if ($minContains !== undefined && contained < $minContains) {\n errors.push({\n instanceLocation,\n keyword: 'minContains',\n keywordLocation: `${schemaLocation}/minContains`,\n error: `Array must contain at least ${$minContains} items matching schema. Only ${contained} items were found.`\n });\n }\n else if ($maxContains !== undefined && contained > $maxContains) {\n errors.push({\n instanceLocation,\n keyword: 'maxContains',\n keywordLocation: `${schemaLocation}/maxContains`,\n error: `Array may contain at most ${$maxContains} items matching schema. ${contained} items were found.`\n });\n }\n }\n }\n if (!stop && $unevaluatedItems !== undefined) {\n const keywordLocation = `${schemaLocation}/unevaluatedItems`;\n for (i; i < length; i++) {\n if (evaluated[i]) {\n continue;\n }\n const result = validate(instance[i], $unevaluatedItems, draft, lookup, shortCircuit, recursiveAnchor, `${instanceLocation}/${i}`, keywordLocation);\n evaluated[i] = true;\n if (!result.valid) {\n errors.push({\n instanceLocation,\n keyword: 'unevaluatedItems',\n keywordLocation,\n error: `Items did not match unevaluated items schema.`\n }, ...result.errors);\n }\n }\n }\n if ($uniqueItems) {\n for (let j = 0; j < length; j++) {\n const a = instance[j];\n const ao = typeof a === 'object' && a !== null;\n for (let k = 0; k < length; k++) {\n if (j === k) {\n continue;\n }\n const b = instance[k];\n const bo = typeof b === 'object' && b !== null;\n if (a === b || (ao && bo && deepCompareStrict(a, b))) {\n errors.push({\n instanceLocation,\n keyword: 'uniqueItems',\n keywordLocation: `${schemaLocation}/uniqueItems`,\n error: `Duplicate items at indexes ${j} and ${k}.`\n });\n j = Number.MAX_SAFE_INTEGER;\n k = Number.MAX_SAFE_INTEGER;\n }\n }\n }\n }\n }\n else if (instanceType === 'number') {\n if (draft === '4') {\n if ($minimum !== undefined &&\n (($exclusiveMinimum === true && instance <= $minimum) ||\n instance < $minimum)) {\n errors.push({\n instanceLocation,\n keyword: 'minimum',\n keywordLocation: `${schemaLocation}/minimum`,\n error: `${instance} is less than ${$exclusiveMinimum ? 'or equal to ' : ''} ${$minimum}.`\n });\n }\n if ($maximum !== undefined &&\n (($exclusiveMaximum === true && instance >= $maximum) ||\n instance > $maximum)) {\n errors.push({\n instanceLocation,\n keyword: 'maximum',\n keywordLocation: `${schemaLocation}/maximum`,\n error: `${instance} is greater than ${$exclusiveMaximum ? 'or equal to ' : ''} ${$maximum}.`\n });\n }\n }\n else {\n if ($minimum !== undefined && instance < $minimum) {\n errors.push({\n instanceLocation,\n keyword: 'minimum',\n keywordLocation: `${schemaLocation}/minimum`,\n error: `${instance} is less than ${$minimum}.`\n });\n }\n if ($maximum !== undefined && instance > $maximum) {\n errors.push({\n instanceLocation,\n keyword: 'maximum',\n keywordLocation: `${schemaLocation}/maximum`,\n error: `${instance} is greater than ${$maximum}.`\n });\n }\n if ($exclusiveMinimum !== undefined && instance <= $exclusiveMinimum) {\n errors.push({\n instanceLocation,\n keyword: 'exclusiveMinimum',\n keywordLocation: `${schemaLocation}/exclusiveMinimum`,\n error: `${instance} is less than ${$exclusiveMinimum}.`\n });\n }\n if ($exclusiveMaximum !== undefined && instance >= $exclusiveMaximum) {\n errors.push({\n instanceLocation,\n keyword: 'exclusiveMaximum',\n keywordLocation: `${schemaLocation}/exclusiveMaximum`,\n error: `${instance} is greater than or equal to ${$exclusiveMaximum}.`\n });\n }\n }\n if ($multipleOf !== undefined) {\n const remainder = instance % $multipleOf;\n if (Math.abs(0 - remainder) >= 1.1920929e-7 &&\n Math.abs($multipleOf - remainder) >= 1.1920929e-7) {\n errors.push({\n instanceLocation,\n keyword: 'multipleOf',\n keywordLocation: `${schemaLocation}/multipleOf`,\n error: `${instance} is not a multiple of ${$multipleOf}.`\n });\n }\n }\n }\n else if (instanceType === 'string') {\n const length = $minLength === undefined && $maxLength === undefined\n ? 0\n : ucs2length(instance);\n if ($minLength !== undefined && length < $minLength) {\n errors.push({\n instanceLocation,\n keyword: 'minLength',\n keywordLocation: `${schemaLocation}/minLength`,\n error: `String is too short (${length} < ${$minLength}).`\n });\n }\n if ($maxLength !== undefined && length > $maxLength) {\n errors.push({\n instanceLocation,\n keyword: 'maxLength',\n keywordLocation: `${schemaLocation}/maxLength`,\n error: `String is too long (${length} > ${$maxLength}).`\n });\n }\n if ($pattern !== undefined && !new RegExp($pattern, 'u').test(instance)) {\n errors.push({\n instanceLocation,\n keyword: 'pattern',\n keywordLocation: `${schemaLocation}/pattern`,\n error: `String does not match pattern.`\n });\n }\n if ($format !== undefined &&\n format[$format] &&\n !format[$format](instance)) {\n errors.push({\n instanceLocation,\n keyword: 'format',\n keywordLocation: `${schemaLocation}/format`,\n error: `String does not match format \"${$format}\".`\n });\n }\n }\n return { valid: errors.length === 0, errors };\n}\n","import { dereference } from './dereference.js';\nimport { validate } from './validate.js';\nexport class Validator {\n schema;\n draft;\n shortCircuit;\n lookup;\n constructor(schema, draft = '2019-09', shortCircuit = true) {\n this.schema = schema;\n this.draft = draft;\n this.shortCircuit = shortCircuit;\n this.lookup = dereference(schema);\n }\n validate(instance) {\n return validate(instance, this.schema, this.draft, this.lookup, this.shortCircuit);\n }\n addSchema(schema, id) {\n if (id) {\n schema = { ...schema, $id: id };\n }\n dereference(schema, this.lookup);\n }\n}\n","import type { ElementType, FormEvent, ReactNode, Ref, RefObject } from 'react';\nimport { Component, createRef } from 'react';\nimport type {\n CustomValidator,\n ErrorSchema,\n ErrorTransformer,\n FieldPathId,\n FieldPathList,\n FormContextType,\n GenericObjectType,\n PathSchema,\n StrictRJSFSchema,\n Registry,\n RegistryFieldsType,\n RegistryWidgetsType,\n RJSFSchema,\n RJSFValidationError,\n SchemaUtilsType,\n TemplatesType,\n UiSchema,\n ValidationData,\n ValidatorType,\n Experimental_DefaultFormStateBehavior,\n Experimental_CustomMergeAllOf,\n GlobalFormOptions,\n NameGeneratorFunction,\n} from '@rjsf/utils';\nimport {\n getByPath,\n setByPath,\n toPath,\n unsetByPath,\n createSchemaUtils,\n deepEquals,\n ErrorSchemaBuilder,\n getChangedFields,\n getTemplate,\n getUiOptions,\n hashObject,\n isObject,\n mergeObjects,\n shouldRender,\n SUBMIT_BTN_OPTIONS_KEY,\n toErrorList,\n toFieldPathId,\n UI_DEFINITIONS_KEY,\n UI_GLOBAL_OPTIONS_KEY,\n UI_OPTIONS_KEY,\n validationDataMerge,\n DEFAULT_ID_SEPARATOR,\n DEFAULT_ID_PREFIX,\n ERRORS_KEY,\n ID_KEY,\n getUsedFormData,\n getFieldNames,\n ANY_OF_KEY,\n ONE_OF_KEY,\n} from '@rjsf/utils';\n\nimport getDefaultRegistry from '../getDefaultRegistry.ts';\nimport { ADDITIONAL_PROPERTY_KEY_REMOVE, IS_RESET } from './constants.ts';\n\n/** Represents a boolean option that is deprecated.\n * @deprecated - In a future major release, this type will be removed\n */\ntype DeprecatedBooleanOption = boolean;\n\n/** The properties that are passed to the `Form` */\nexport interface FormProps<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any> {\n /** The JSON schema object for the form */\n schema: S;\n /** An implementation of the `ValidatorType` interface that is needed for form validation to work */\n validator: ValidatorType<T, S, F>;\n /** The optional children for the form, if provided, it will replace the default `SubmitButton` */\n children?: ReactNode;\n /** The uiSchema for the form */\n uiSchema?: UiSchema<T, S, F>;\n /** The data for the form, used to load a \"controlled\" form with its current data. If you want an \"uncontrolled\" form\n * with initial data, then use `initialFormData` instead.\n */\n formData?: T;\n /** The initial data for the form, used to fill an \"uncontrolled\" form with existing data on the initial render and\n * when `reset()` is called programmatically.\n */\n initialFormData?: T;\n // Form presentation and behavior modifiers\n /** You can provide a `formContext` object to the form, which is passed down to all fields and widgets. Useful for\n * implementing context aware fields and widgets.\n *\n * NOTE: Setting `{readonlyAsDisabled: false}` on the formContext will make the antd theme treat readOnly fields as\n * disabled.\n */\n formContext?: F;\n /** To avoid collisions with existing ids in the DOM, it is possible to change the prefix used for ids;\n * Default is `root`\n */\n idPrefix?: string;\n /** To avoid using a path separator that is present in field names, it is possible to change the separator used for\n * ids (Default is `_`)\n */\n idSeparator?: string;\n /** It's possible to disable the whole form by setting the `disabled` prop. The `disabled` prop is then forwarded down\n * to each field of the form. If you just want to disable some fields, see the `ui:disabled` parameter in `uiSchema`\n */\n disabled?: boolean;\n /** It's possible to make the whole form read-only by setting the `readonly` prop. The `readonly` prop is then\n * forwarded down to each field of the form. If you just want to make some fields read-only, see the `ui:readonly`\n * parameter in `uiSchema`\n */\n readonly?: boolean;\n // Form registry\n /** The dictionary of registered fields in the form */\n fields?: RegistryFieldsType<T, S, F>;\n /** The dictionary of registered templates in the form; Partial allows a subset to be provided beyond the defaults */\n templates?: Partial<Omit<TemplatesType<T, S, F>, 'ButtonTemplates'>> & {\n ButtonTemplates?: Partial<TemplatesType<T, S, F>['ButtonTemplates']>;\n };\n /** The dictionary of registered widgets in the form */\n widgets?: RegistryWidgetsType<T, S, F>;\n // Callbacks\n /** If you plan on being notified every time the form data are updated, you can pass an `onChange` handler, which will\n * receive the same args as `onSubmit` any time a value is updated in the form. Can also return the `id` of the field\n * that caused the change\n */\n onChange?: (data: IChangeEvent<T, S, F>, id?: string) => void;\n /** To react when submitted form data are invalid, pass an `onError` handler. It will be passed the list of\n * encountered errors\n */\n onError?: (errors: RJSFValidationError[]) => void;\n /** You can pass a function as the `onSubmit` prop of your `Form` component to listen to when the form is submitted\n * and its data are valid. It will be passed a result object having a `formData` attribute, which is the valid form\n * data you're usually after. The original event will also be passed as a second parameter\n */\n onSubmit?: (data: IChangeEvent<T, S, F>, event: FormEvent<any>) => void;\n /** Sometimes you may want to trigger events or modify external state when a field has been touched, so you can pass\n * an `onBlur` handler, which will receive the id of the input that was blurred and the field value\n */\n onBlur?: (id: string, data: any) => void;\n /** Sometimes you may want to trigger events or modify external state when a field has been focused, so you can pass\n * an `onFocus` handler, which will receive the id of the input that is focused and the field value\n */\n onFocus?: (id: string, data: any) => void;\n /** The value of this prop will be passed to the `accept-charset` HTML attribute on the form */\n acceptCharset?: string;\n /** The value of this prop will be passed to the `action` HTML attribute on the form\n *\n * NOTE: this just renders the `action` attribute in the HTML markup. There is no real network request being sent to\n * this `action` on submit. Instead, react-jsonschema-form catches the submit event with `event.preventDefault()`\n * and then calls the `onSubmit` function, where you could send a request programmatically with `fetch` or similar.\n */\n action?: string;\n /** The value of this prop will be passed to the `autocomplete` HTML attribute on the form */\n autoComplete?: string;\n /** The value of this prop will be passed to the `class` HTML attribute on the form */\n className?: string;\n /** The value of this prop will be passed to the `enctype` HTML attribute on the form */\n enctype?: string;\n /** The value of this prop will be passed to the `id` HTML attribute on the form */\n id?: string;\n /** The value of this prop will be passed to the `name` HTML attribute on the form */\n name?: string;\n /** The value of this prop will be passed to the `method` HTML attribute on the form */\n method?: string;\n /** It's possible to change the default `form` tag name to a different HTML tag, which can be helpful if you are\n * nesting forms. However, native browser form behaviour, such as submitting when the `Enter` key is pressed, may no\n * longer work\n */\n tagName?: ElementType;\n /** The value of this prop will be passed to the `target` HTML attribute on the form */\n target?: string;\n // Errors and validation\n /** Formerly the `validate` prop; Takes a function that specifies custom validation rules for the form */\n customValidate?: CustomValidator<T, S, F>;\n /** This prop allows passing in custom errors that are augmented with the existing JSON Schema errors on the form; it\n * can be used to implement asynchronous validation. By default, these are non-blocking errors, meaning that you can\n * still submit the form when these are the only errors displayed to the user.\n */\n extraErrors?: ErrorSchema<T>;\n /** If set to true, causes the `extraErrors` to become blocking when the form is submitted */\n extraErrorsBlockSubmit?: boolean;\n /** If set to true, turns off HTML5 validation on the form; Set to `false` by default */\n noHtml5Validate?: boolean;\n /** If set to true, turns off all validation. Set to `false` by default\n *\n * @deprecated - In a future release, this switch may be replaced by making `validator` prop optional\n */\n noValidate?: boolean;\n /** Flag that describes when live validation will be performed. Live validation means that the form will perform\n * validation and show any validation errors whenever the form data is updated, rather than just on submit.\n *\n * If no value (or `false`) is provided, then live validation will not happen. If `true` or `onChange` is provided for\n * the flag, then live validation will be performed after processing of all pending changes has completed. If `onBlur`\n * is provided, then live validation will be performed when a field that was updated is blurred (as a performance\n * optimization).\n *\n * NOTE: In a future major release, the `boolean` options for this flag will be removed\n */\n // oxlint-disable-next-line typescript/no-deprecated\n liveValidate?: 'onChange' | 'onBlur' | DeprecatedBooleanOption;\n /** Flag that describes when live omit will be performed. Live omit happens only when `omitExtraData` is also set to\n * to `true` and the form's data is updated by the user.\n *\n * If no value (or `false`) is provided, then live omit will not happen. If `true` or `onChange` is provided for\n * the flag, then live omit will be performed after processing of all pending changes has completed. If `onBlur`\n * is provided, then live omit will be performed when a field that was updated is blurred (as a performance\n * optimization).\n *\n * NOTE: In a future major release, the `boolean` options for this flag will be removed\n */\n // oxlint-disable-next-line typescript/no-deprecated\n liveOmit?: 'onChange' | 'onBlur' | DeprecatedBooleanOption;\n /** If set to true, then extra form data values that are not in any form field will be removed whenever `onSubmit` is\n * called. Set to `false` by default.\n */\n omitExtraData?: boolean;\n /** This option no longer does anything as it has been co-opted into `omitExtraData`\n *\n * @deprecated - Will be removed in a future release use `omitExtraData` instead\n */\n removeEmptyOptionalObjects?: boolean;\n /** When this prop is set to `top` or 'bottom', a list of errors (or the custom error list defined in the `ErrorList`) will also\n * show. When set to false, only inline input validation errors will be shown. Set to `top` by default\n */\n showErrorList?: false | 'top' | 'bottom';\n /** A function can be passed to this prop in order to make modifications to the default errors resulting from JSON\n * Schema validation\n */\n transformErrors?: ErrorTransformer<T, S, F>;\n /** If set to true, then the first field with an error will receive the focus when the form is submitted with errors\n */\n focusOnFirstError?: boolean | ((error: RJSFValidationError) => void);\n /** Optional string translation function, if provided, allows users to change the translation of the RJSF internal\n * strings. Some strings contain replaceable parameter values as indicated by `%1`, `%2`, etc. The number after the\n * `%` indicates the order of the parameter. The ordering of parameters is important because some languages may choose\n * to put the second parameter before the first in its translation.\n */\n translateString?: Registry['translateString'];\n /** Optional function to generate custom HTML `name` attributes for form fields.\n */\n nameGenerator?: NameGeneratorFunction;\n /** Optional flag that, when set to true, will cause the `FallbackField` to render a type selector for unsupported\n * fields instead of the default UnsupportedField error UI.\n */\n useFallbackUiForUnsupportedType?: boolean;\n /** Optional configuration object with flags, if provided, allows users to override default form state behavior\n * Currently only affecting minItems on array fields and handling of setting defaults based on the value of\n * `emptyObjectFields`\n */\n experimental_defaultFormStateBehavior?: Experimental_DefaultFormStateBehavior;\n /**\n * Controls the component update strategy used by the Form's `shouldComponentUpdate` lifecycle method.\n *\n * - `'customDeep'`: Uses RJSF's custom deep equality checks via the `deepEquals` utility function,\n * which treats all functions as equivalent and provides optimized performance for form data comparisons.\n * - `'shallow'`: Uses shallow comparison of props and state (only compares direct properties). This matches React's PureComponent behavior.\n * - `'always'`: Always rerenders when called. This matches React's Component behavior.\n *\n * @default 'customDeep'\n */\n experimental_componentUpdateStrategy?: 'customDeep' | 'shallow' | 'always';\n /** Optional function that allows for custom merging of `allOf` schemas\n */\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>;\n // Private\n /**\n * _internalFormWrapper is currently used by the semantic-ui theme to provide a custom wrapper around `<Form />`\n * that supports the proper rendering of those themes. To use this prop, one must pass a component that takes two\n * props: `children` and `as`. That component, at minimum, should render the `children` inside of a <form /> tag\n * unless `as` is provided, in which case, use the `as` prop in place of `<form />`.\n * i.e.:\n * ```\n * export default function InternalForm({ children, as }) {\n * const FormTag = as || 'form';\n * return <FormTag>{children}</FormTag>;\n * }\n * ```\n *\n * Use at your own risk as this prop is private and may change at any time without notice.\n */\n _internalFormWrapper?: ElementType;\n /** Support receiving a React ref to the Form\n */\n ref?: Ref<Form<T, S, F>>;\n}\n\n/** The data that is contained within the state for the `Form` */\nexport interface FormState<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any> {\n /** The JSON schema object for the form */\n schema: S;\n /** The uiSchema for the form */\n uiSchema: UiSchema<T, S, F>;\n /** The `FieldPathId` for the form, computed from the `schema`, the `rootFieldId`, the `idPrefix` and\n * `idSeparator` props.\n */\n fieldPathId: FieldPathId;\n /** The schemaUtils implementation used by the `Form`, created from the `validator` and the `schema` */\n schemaUtils: SchemaUtilsType<T, S, F>;\n /** The current data for the form, computed from the `formData` prop and the changes made by the user */\n formData?: T;\n /** Flag indicating whether the form is in edit mode, true when `formData` is passed to the form, otherwise false */\n edit: boolean;\n /** The current list of errors for the form, includes `extraErrors` */\n errors: RJSFValidationError[];\n /** The current errors, in `ErrorSchema` format, for the form, includes `extraErrors` */\n errorSchema: ErrorSchema<T>;\n // Private\n /** The current list of errors for the form directly from schema validation, does NOT include `extraErrors` */\n schemaValidationErrors: RJSFValidationError[];\n /** The current errors, in `ErrorSchema` format, for the form directly from schema validation, does NOT include\n * `extraErrors`\n */\n schemaValidationErrorSchema: ErrorSchema<T>;\n /** A container used to handle custom errors provided via `onChange` */\n customErrors?: ErrorSchemaBuilder<T>;\n /** @description result of schemaUtils.retrieveSchema(schema, formData). This a memoized value to avoid re calculate at internal functions (getStateFromProps, onChange) */\n retrievedSchema: S;\n /** Flag indicating whether the initial form defaults have been generated */\n initialDefaultsGenerated: boolean;\n /** The registry (re)computed only when props changed */\n registry: Registry<T, S, F>;\n /** Tracks the previous `extraErrors` prop reference so that `getDerivedStateFromProps` can detect changes */\n prevExtraErrors?: ErrorSchema<T>;\n}\n\n/** The event data passed when changes have been made to the form, includes everything from the `FormState` except\n * the schema validation errors. An additional `status` is added when returned from `onSubmit`\n */\nexport interface IChangeEvent<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n> extends Pick<\n FormState<T, S, F>,\n 'schema' | 'uiSchema' | 'fieldPathId' | 'schemaUtils' | 'formData' | 'edit' | 'errors' | 'errorSchema'\n> {\n /** The status of the form when submitted */\n status?: 'submitted';\n}\n\n/** Converts the full `FormState` into the `IChangeEvent` version by picking out the public values\n *\n * @param state - The state of the form\n * @param status - The status provided by the onSubmit\n * @returns - The `IChangeEvent` for the state\n */\nfunction toIChangeEvent<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n state: FormState<T, S, F>,\n status?: IChangeEvent['status'],\n): IChangeEvent<T, S, F> {\n const { schema, uiSchema, fieldPathId, schemaUtils, formData, edit, errors, errorSchema } = state;\n return {\n schema,\n uiSchema,\n fieldPathId,\n schemaUtils,\n formData,\n edit,\n errors,\n errorSchema,\n ...(status !== undefined && { status }),\n };\n}\n\n/** The definition of a pending change that will be processed in the `onChange` handler\n */\ninterface PendingChange<T> {\n /** The path into the formData/errorSchema at which the `newValue`/`newErrorSchema` will be set */\n path: FieldPathList;\n /** The new value to set into the formData */\n newValue?: T;\n /** The new errors to be set into the errorSchema, if any */\n newErrorSchema?: ErrorSchema<T>;\n /** The optional id of the field for which the change is being made */\n id?: string;\n}\n\n/** The `Form` component renders the outer form and all the fields defined in the `schema` */\nexport default class Form<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n> extends Component<FormProps<T, S, F>, FormState<T, S, F>> {\n /** The ref used to hold the `form` element, this needs to be `any` because `tagName` or `_internalFormWrapper` can\n * provide any possible type here\n */\n formElement: RefObject<any>;\n\n /** The list of pending changes\n */\n pendingChanges: PendingChange<T>[] = [];\n\n /** Flag to track when we're processing a user-initiated field change.\n * This prevents componentDidUpdate from reverting oneOf/anyOf option switches.\n */\n private isProcessingUserChange = false;\n\n /** When the `extraErrors` prop changes, re-merges `schemaValidationErrors` + `extraErrors` + `customErrors` into\n * state before render, ensuring the updated errors are visible immediately in a single render cycle.\n *\n * @param props - The current props\n * @param state - The current state\n * @returns Partial state with re-merged errors if `extraErrors` changed, or `null` if no update is needed\n */\n static getDerivedStateFromProps<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n props: FormProps<T, S, F>,\n state: FormState<T, S, F>,\n ): Partial<FormState<T, S, F>> | null {\n if (props.extraErrors !== state.prevExtraErrors) {\n const baseErrors: ValidationData<T> = {\n errors: state.schemaValidationErrors || [],\n errorSchema: state.schemaValidationErrorSchema || {},\n };\n let { errors, errorSchema } = baseErrors;\n if (props.extraErrors) {\n ({ errors, errorSchema } = validationDataMerge<T>(baseErrors, props.extraErrors));\n }\n if (state.customErrors) {\n ({ errors, errorSchema } = validationDataMerge<T>(\n { errors, errorSchema },\n state.customErrors.ErrorSchema,\n true,\n ));\n }\n return { prevExtraErrors: props.extraErrors, errors, errorSchema };\n }\n return null;\n }\n\n /** Constructs the `Form` from the `props`. Will setup the initial state from the props. It will also call the\n * `onChange` handler if the initially provided `formData` is modified to add missing default values as part of the\n * state construction.\n *\n * @param props - The initial props for the `Form`\n */\n constructor(props: FormProps<T, S, F>) {\n super(props);\n\n if (!props.validator) {\n throw new Error('A validator is required for Form functionality to work');\n }\n\n const { formData: propsFormData, initialFormData, onChange } = props;\n const formData = propsFormData ?? initialFormData;\n this.state = {\n ...this.getStateFromProps(props, formData, undefined, undefined, undefined, true),\n prevExtraErrors: props.extraErrors,\n };\n if (onChange && !deepEquals(this.state.formData, formData)) {\n onChange(toIChangeEvent(this.state));\n }\n this.formElement = createRef();\n }\n\n /**\n * `getSnapshotBeforeUpdate` is a React lifecycle method that is invoked right before the most recently rendered\n * output is committed to the DOM. It enables your component to capture current values (e.g., scroll position) before\n * they are potentially changed.\n *\n * In this case, it checks if the props have changed since the last render. If they have, it computes the next state\n * of the component using `getStateFromProps` method and returns it along with a `shouldUpdate` flag set to `true` IF\n * the `nextState` and `prevState` are different, otherwise `false`. This ensures that we have the most up-to-date\n * state ready to be applied in `componentDidUpdate`.\n *\n * If `formData` hasn't changed, it simply returns an object with `shouldUpdate` set to `false`, indicating that a\n * state update is not necessary.\n *\n * @param prevProps - The previous set of props before the update.\n * @param prevState - The previous state before the update.\n * @returns Either an object containing the next state and a flag indicating that an update should occur, or an object\n * with a flag indicating that an update is not necessary.\n */\n getSnapshotBeforeUpdate(\n prevProps: FormProps<T, S, F>,\n prevState: FormState<T, S, F>,\n ): { nextState: FormState<T, S, F>; shouldUpdate: true } | { shouldUpdate: false } {\n if (!deepEquals(this.props, prevProps)) {\n // Compare the previous props formData against the current props formData\n const formDataChangedFields = getChangedFields(this.props.formData, prevProps.formData);\n // Compare the current props formData against the current state's formData to determine if the new props were the\n // result of the onChange from the existing state formData\n const stateDataChangedFields = getChangedFields(this.props.formData, this.state.formData);\n const isSchemaChanged = !deepEquals(prevProps.schema, this.props.schema);\n // When formData is not an object, getChangedFields returns an empty array.\n // In this case, deepEquals is most needed to check again.\n const isFormDataChanged =\n formDataChangedFields.length > 0 || !deepEquals(prevProps.formData, this.props.formData);\n const isStateDataChanged =\n stateDataChangedFields.length > 0 || !deepEquals(this.state.formData, this.props.formData);\n const nextState = this.getStateFromProps(\n this.props,\n this.props.formData,\n // If the `schema` has changed, we need to update the retrieved schema.\n // Or if the `formData` changes, for example in the case of a schema with dependencies that need to\n // match one of the subSchemas, the retrieved schema must be updated.\n isSchemaChanged || isFormDataChanged ? undefined : this.state.retrievedSchema,\n isSchemaChanged,\n // Only the error clearing needs the path of each changed field, and it runs only when live validation does\n // not, so the walk that produces them is left for `getStateFromProps` to ask for\n () => getChangedFields(this.props.formData, prevProps.formData, true),\n // Skip live validation for this request if no form data has changed from the last state\n !isStateDataChanged,\n );\n const shouldUpdate = !deepEquals(nextState, prevState);\n return { nextState, shouldUpdate };\n }\n return { shouldUpdate: false };\n }\n\n /**\n * `componentDidUpdate` is a React lifecycle method that is invoked immediately after updating occurs. This method is\n * not called for the initial render.\n *\n * Here, it checks if an update is necessary based on the `shouldUpdate` flag received from `getSnapshotBeforeUpdate`.\n * If an update is required, it applies the next state and, if needed, triggers the `onChange` handler to inform about\n * changes.\n *\n * @param _ - The previous set of props.\n * @param prevState - The previous state of the component before the update.\n * @param snapshot - The value returned from `getSnapshotBeforeUpdate`.\n */\n componentDidUpdate(\n _: FormProps<T, S, F>,\n prevState: FormState<T, S, F>,\n snapshot: { nextState: FormState<T, S, F>; shouldUpdate: true } | { shouldUpdate: false },\n ) {\n if (snapshot.shouldUpdate) {\n const { nextState } = snapshot;\n\n // Prevent oneOf/anyOf option switches from reverting when getStateFromProps\n // re-evaluates and produces stale formData.\n const nextStateDiffersFromProps = !deepEquals(nextState.formData, this.props.formData);\n const wasProcessingUserChange = this.isProcessingUserChange;\n this.isProcessingUserChange = false;\n\n if (wasProcessingUserChange && nextStateDiffersFromProps) {\n // Skip - the user's option switch is already applied via processPendingChange\n return;\n }\n\n if (nextStateDiffersFromProps && !deepEquals(nextState.formData, prevState.formData) && this.props.onChange) {\n this.props.onChange(toIChangeEvent(nextState));\n }\n // oxlint-disable-next-line react/no-did-update-set-state -- guarded to prevent infinite loop\n this.setState(nextState);\n }\n }\n\n /** Extracts the updated state from the given `props` and `inputFormData`. As part of this process, the\n * `inputFormData` is first processed to add any missing required defaults. After that, the data is run through the\n * validation process IF required by the `props`.\n *\n * @param props - The props passed to the `Form`\n * @param inputFormData - The new or current data for the `Form`\n * @param retrievedSchema - An expanded schema, if not provided, it will be retrieved from the `schema` and `formData`.\n * @param [isSchemaChanged=false] - A flag indicating whether the schema has changed.\n * @param [getFormDataChangedFields=() => []] - Optional function returning the path of each `formData` field that\n * changed, only called when those paths are needed, which is when live validation is not going to run\n * @param [skipLiveValidate=false] - Optional flag, if true, means that we are not running live validation\n * @param [shouldSanitize=false] - Optional flag, if true, means that we should attempt to sanitize formData\n * @returns - The new state for the `Form`\n */\n getStateFromProps(\n props: FormProps<T, S, F>,\n inputFormData?: T,\n retrievedSchema?: S,\n isSchemaChanged = false,\n getFormDataChangedFields: () => string[] = () => [],\n skipLiveValidate = false,\n shouldSanitize = false,\n ): FormState<T, S, F> {\n const state: FormState<T, S, F> = this.state || {};\n const schema = 'schema' in props ? props.schema : this.props.schema;\n const validator = 'validator' in props ? props.validator : this.props.validator;\n const uiSchema: UiSchema<T, S, F> = ('uiSchema' in props ? props.uiSchema! : this.props.uiSchema!) || {};\n const isUncontrolled = props.formData === undefined && this.props.formData === undefined;\n const edit = typeof inputFormData !== 'undefined';\n const liveValidate = 'liveValidate' in props ? props.liveValidate : this.props.liveValidate;\n // oxlint-disable-next-line typescript/no-deprecated\n const mustValidate = edit && !props.noValidate && liveValidate;\n const experimental_defaultFormStateBehavior =\n 'experimental_defaultFormStateBehavior' in props\n ? props.experimental_defaultFormStateBehavior\n : this.props.experimental_defaultFormStateBehavior;\n const experimental_customMergeAllOf =\n 'experimental_customMergeAllOf' in props\n ? props.experimental_customMergeAllOf\n : this.props.experimental_customMergeAllOf;\n let { schemaUtils } = state;\n if (\n !schemaUtils ||\n schemaUtils.doesSchemaUtilsDiffer(\n validator,\n schema,\n experimental_defaultFormStateBehavior,\n experimental_customMergeAllOf,\n )\n ) {\n schemaUtils = createSchemaUtils<T, S, F>(\n validator,\n schema,\n experimental_defaultFormStateBehavior,\n experimental_customMergeAllOf,\n );\n }\n\n const rootSchema = schemaUtils.getRootSchema();\n\n // Compute the formData for getDefaultFormState() function based on the inputFormData, isUncontrolled and state\n let defaultsFormData = inputFormData;\n if (inputFormData === IS_RESET) {\n defaultsFormData = undefined;\n } else if (inputFormData === undefined && isUncontrolled) {\n defaultsFormData = state.formData;\n }\n let formData: T;\n let computedRetrievedSchema: S;\n let wasSanitized = false;\n const preventInfiniteSanitize: string[] = [];\n do {\n formData = schemaUtils.getDefaultFormState(\n rootSchema,\n defaultsFormData,\n false,\n state.initialDefaultsGenerated,\n ) as T;\n // Only hash when sanitizing, wrapping `formData` in an object to deal with a scalar/undefined value\n const formHash = shouldSanitize ? hashObject({ formData }) : '';\n computedRetrievedSchema = this.updateRetrievedSchema(\n retrievedSchema ?? schemaUtils.retrieveSchema(rootSchema, formData),\n );\n if (\n shouldSanitize &&\n !preventInfiniteSanitize.includes(formHash) &&\n !deepEquals(computedRetrievedSchema, state.retrievedSchema)\n ) {\n // Sanitize the form data if shouldSanitize is true, we haven't already processed this same formData AND\n // we have a different retrieved schema from when we last ran the state\n const sanitizedFormData = schemaUtils.sanitizeDataForNewSchema(\n computedRetrievedSchema,\n state.retrievedSchema,\n formData,\n );\n wasSanitized = !deepEquals(sanitizedFormData, formData);\n if (wasSanitized) {\n // Update both the formData AND defaultsFormData due to the sanitize so the loop works with the new data\n formData = sanitizedFormData;\n defaultsFormData = sanitizedFormData;\n const sanitizedFormHash = hashObject({ formData: sanitizedFormData });\n // If we've seen the sanitized data before, we are done\n wasSanitized = !preventInfiniteSanitize.includes(sanitizedFormHash);\n preventInfiniteSanitize.push(sanitizedFormHash);\n }\n preventInfiniteSanitize.push(formHash);\n } else {\n wasSanitized = false;\n }\n } while (wasSanitized);\n\n const getCurrentErrors = (): ValidationData<T> => {\n // If the `props.noValidate` option is set or the schema has changed, we reset the error state.\n // oxlint-disable-next-line typescript/no-deprecated\n if (props.noValidate || isSchemaChanged) {\n return { errors: [], errorSchema: {} };\n }\n if (!props.liveValidate) {\n return {\n errors: state.schemaValidationErrors || [],\n errorSchema: state.schemaValidationErrorSchema || {},\n };\n }\n return {\n errors: state.errors || [],\n errorSchema: state.errorSchema || {},\n };\n };\n\n let errors: RJSFValidationError[];\n let errorSchema: ErrorSchema<T> | undefined;\n let { schemaValidationErrors, schemaValidationErrorSchema } = state;\n // If we are skipping live validate, it means that the state has already been updated with live validation errors\n if (mustValidate && !skipLiveValidate) {\n const liveValidation = this.liveValidate(\n rootSchema,\n schemaUtils,\n state.errorSchema,\n formData,\n undefined,\n state.customErrors,\n retrievedSchema,\n // If retrievedSchema is undefined which means the schema or formData has changed, we do not merge state.\n // Else in the case where it hasn't changed,\n retrievedSchema !== undefined,\n );\n errors = liveValidation.errors;\n errorSchema = liveValidation.errorSchema;\n schemaValidationErrors = liveValidation.schemaValidationErrors;\n schemaValidationErrorSchema = liveValidation.schemaValidationErrorSchema;\n } else {\n const currentErrors = getCurrentErrors();\n errors = currentErrors.errors;\n errorSchema = currentErrors.errorSchema;\n // We only update the error schema for changed fields if mustValidate is false\n if (!mustValidate) {\n const formDataChangedFields = getFormDataChangedFields();\n if (formDataChangedFields.length > 0) {\n // `formDataChangedFields` carries the path of each field that changed, so clearing has to follow that path\n // instead of dropping the whole branch it starts in. The path is split with `toPath()`, the same way\n // `toErrorSchema()` splits a validation error property, so the two address the same entry. Intermediate\n // objects are forced so the numeric segment of an array item stays an object key, which is how an\n // `ErrorSchema` addresses array items.\n const newErrorSchema = formDataChangedFields.reduce<GenericObjectType>((acc, path) => {\n const pathOfField = toPath(path);\n // Every container holding the field changed along with it, so an error of their own, such as the\n // `uniqueItems` of the array the field sits in, is cleared too. Only their own errors go: the other\n // fields they hold did not change and keep theirs.\n for (let i = 1; i < pathOfField.length; i++) {\n setByPath(acc, [...pathOfField.slice(0, i), ERRORS_KEY], undefined, true);\n }\n return setByPath(acc, pathOfField, undefined, true);\n }, {});\n schemaValidationErrorSchema = mergeObjects(\n currentErrors.errorSchema,\n newErrorSchema,\n 'preventDuplicates',\n ) as ErrorSchema<T>;\n errorSchema = schemaValidationErrorSchema;\n }\n }\n const mergedErrors = Form.mergeErrors<T>({ errorSchema, errors }, props.extraErrors, state.customErrors);\n errors = mergedErrors.errors;\n errorSchema = mergedErrors.errorSchema;\n }\n\n // Only store a new registry when the props cause a different one to be created\n const newRegistry = Form.getRegistry(props, rootSchema, schemaUtils);\n const registry = deepEquals(state.registry, newRegistry) ? state.registry : newRegistry;\n\n // Only compute a new `fieldPathId` when the `idPrefix` is different than the existing fieldPathId's ID_KEY\n const fieldPathId =\n state.fieldPathId && state.fieldPathId?.[ID_KEY] === registry.globalFormOptions.idPrefix\n ? state.fieldPathId\n : toFieldPathId('', registry.globalFormOptions);\n const nextState: FormState<T, S, F> = {\n schemaUtils,\n schema: rootSchema,\n uiSchema,\n fieldPathId,\n formData,\n edit,\n errors,\n errorSchema,\n schemaValidationErrors,\n schemaValidationErrorSchema,\n retrievedSchema: computedRetrievedSchema,\n initialDefaultsGenerated: true,\n registry,\n };\n return nextState;\n }\n\n /** React lifecycle method that is used to determine whether component should be updated.\n *\n * @param nextProps - The next version of the props\n * @param nextState - The next version of the state\n * @returns - True if the component should be updated, false otherwise\n */\n shouldComponentUpdate(nextProps: FormProps<T, S, F>, nextState: FormState<T, S, F>): boolean {\n const { experimental_componentUpdateStrategy = 'customDeep' } = this.props;\n return shouldRender(this, nextProps, nextState, experimental_componentUpdateStrategy);\n }\n\n /** Validates the `formData` against the `schema` using the `altSchemaUtils` (if provided otherwise it uses the\n * `schemaUtils` in the state), returning the results.\n *\n * @param formData - The new form data to validate\n * @param schema - The schema used to validate against\n * @param [altSchemaUtils] - The alternate schemaUtils to use for validation\n * @param [retrievedSchema] - An optionally retrieved schema for per\n */\n validate(\n formData: T | undefined,\n schema = this.state.schema,\n altSchemaUtils?: SchemaUtilsType<T, S, F>,\n retrievedSchema?: S,\n ): ValidationData<T> {\n const schemaUtils = altSchemaUtils || this.state.schemaUtils;\n const { customValidate, transformErrors, uiSchema } = this.props;\n // When a pre-resolved schema is provided (e.g., from live validation), use it directly.\n // Otherwise validate against the original schema so AJV sees the full constraint set.\n const validationSchema = retrievedSchema ?? schema;\n\n // JSON.stringify drops keys with `undefined` values; JSON.parse on the result gives AJV a clean\n // object that avoids spurious type errors for `type: \"string\"` fields that were cleared (#4518).\n const validationFormData = formData ? JSON.parse(JSON.stringify(formData)) : undefined;\n\n return schemaUtils\n .getValidator()\n .validateFormData(validationFormData, validationSchema, customValidate, transformErrors, uiSchema);\n }\n\n /** Renders any errors contained in the `state` in using the `ErrorList`, if not disabled by `showErrorList`. */\n renderErrors(registry: Registry<T, S, F>) {\n const { errors, errorSchema, schema, uiSchema } = this.state;\n const options = getUiOptions<T, S, F>(uiSchema);\n const ErrorListTemplate = getTemplate<'ErrorListTemplate', T, S, F>('ErrorListTemplate', registry, options);\n\n if (errors?.length) {\n return (\n <ErrorListTemplate\n errors={errors}\n errorSchema={errorSchema || {}}\n schema={schema}\n uiSchema={uiSchema}\n registry={registry}\n />\n );\n }\n return null;\n }\n\n /** Merges any `extraErrors` or `customErrors` into the given `schemaValidation` object, returning the result\n *\n * @param schemaValidation - The `ValidationData` object into which additional errors are merged\n * @param [extraErrors] - The extra errors from the props\n * @param [customErrors] - The customErrors from custom components\n * @return - The `extraErrors` and `customErrors` merged into the `schemaValidation`\n * @private\n */\n private static mergeErrors<T = any>(\n schemaValidation: ValidationData<T>,\n extraErrors?: FormProps['extraErrors'],\n customErrors?: ErrorSchemaBuilder,\n ): ValidationData<T> {\n let { errorSchema, errors } = schemaValidation;\n if (extraErrors) {\n const merged = validationDataMerge(schemaValidation, extraErrors);\n errorSchema = merged.errorSchema;\n errors = merged.errors;\n }\n if (customErrors) {\n const merged = validationDataMerge({ errors, errorSchema }, customErrors.ErrorSchema, true);\n errorSchema = merged.errorSchema;\n errors = merged.errors;\n }\n return { errors, errorSchema };\n }\n\n /** Performs live validation and then updates and returns the errors and error schemas by potentially merging in\n * `extraErrors` and `customErrors`.\n *\n * @param rootSchema - The `rootSchema` from the state\n * @param schemaUtils - The `SchemaUtilsType` from the state\n * @param originalErrorSchema - The original `ErrorSchema` from the state\n * @param [formData] - The new form data to validate\n * @param [extraErrors] - The extra errors from the props\n * @param [customErrors] - The customErrors from custom components\n * @param [retrievedSchema] - An expanded schema, if not provided, it will be retrieved from the `schema` and `formData`\n * @param [mergeIntoOriginalErrorSchema=false] - Optional flag indicating whether we merge into original schema\n * @returns - An object containing `errorSchema`, `errors`, `schemaValidationErrors` and `schemaValidationErrorSchema`\n * @private\n */\n private liveValidate(\n rootSchema: S,\n schemaUtils: SchemaUtilsType<T, S, F>,\n originalErrorSchema: ErrorSchema<S>,\n formData?: T,\n extraErrors?: FormProps['extraErrors'],\n customErrors?: ErrorSchemaBuilder<T>,\n retrievedSchema?: S,\n mergeIntoOriginalErrorSchema = false,\n ) {\n const schemaValidation = this.validate(formData, rootSchema, schemaUtils, retrievedSchema);\n const { errors } = schemaValidation;\n let { errorSchema } = schemaValidation;\n // We merge 'originalErrorSchema' with 'schemaValidation.errorSchema.'; This done to display the raised field error.\n if (mergeIntoOriginalErrorSchema) {\n errorSchema = mergeObjects(\n originalErrorSchema,\n schemaValidation.errorSchema,\n 'preventDuplicates',\n ) as ErrorSchema<T>;\n }\n const schemaValidationErrors = errors;\n const schemaValidationErrorSchema = errorSchema;\n const mergedErrors = Form.mergeErrors<T>({ errorSchema, errors }, extraErrors, customErrors);\n return { ...mergedErrors, schemaValidationErrors, schemaValidationErrorSchema };\n }\n\n /** Returns the `formData` with only the elements specified in the `fields` list\n *\n * @param formData - The data for the `Form`\n * @param fields - The fields to keep while filtering\n * @deprecated - To be removed as an exported `Form` function in a future release; there isn't a planned replacement\n */\n // oxlint-disable-next-line class-methods-use-this, typescript/no-deprecated\n getUsedFormData = (formData: T | undefined, fields: string[]): T | undefined => getUsedFormData(formData, fields);\n\n /** Returns the list of field names from inspecting the `pathSchema` as well as using the `formData`\n *\n * @param pathSchema - The `PathSchema` object for the form\n * @param [formData] - The form data to use while checking for empty objects/arrays\n * @deprecated - To be removed as an exported `Form` function in a future release; there isn't a planned replacement\n */\n // oxlint-disable-next-line class-methods-use-this, typescript/no-deprecated\n getFieldNames = (pathSchema: PathSchema<T>, formData?: T): string[][] => getFieldNames(pathSchema, formData);\n\n /** Returns the `formData` after filtering to remove any extra data not in a form field\n *\n * @param formData - The data for the `Form`\n * @returns The `formData` after omitting extra data\n * @deprecated - To be removed as an exported `Form` function in a future release, use `SchemaUtils.omitExtraData`\n * instead.\n */\n omitExtraData = (formData?: T): T | undefined => {\n const { schema, schemaUtils } = this.state;\n return schemaUtils.omitExtraData(schema, formData);\n };\n\n /** Allows a user to set a value for the provided `fieldPath`, which must be either a dotted path to the field OR a\n * `FieldPathList`. To set the root element, used either `''` or `[]` for the path. Passing undefined will clear the\n * value in the field.\n *\n * @param fieldPath - Either a dotted path to the field or the `FieldPathList` to the field\n * @param [newValue] - The new value for the field\n */\n setFieldValue = (fieldPath: string | FieldPathList, newValue?: T) => {\n const { registry } = this.state;\n const path = Array.isArray(fieldPath) ? fieldPath : fieldPath.split('.');\n const fieldPathId = toFieldPathId('', registry.globalFormOptions, path);\n this.onChange(newValue, path, undefined, fieldPathId[ID_KEY]);\n };\n\n /** Pushes the given change information into the `pendingChanges` array and then calls `processPendingChanges()` if\n * the array only contains a single pending change.\n *\n * @param newValue - The new form data from a change to a field\n * @param path - The path to the change into which to set the formData\n * @param [newErrorSchema] - The new `ErrorSchema` based on the field change\n * @param [id] - The id of the field that caused the change\n */\n onChange = (newValue: T | undefined, path: FieldPathList, newErrorSchema?: ErrorSchema<T>, id?: string) => {\n this.pendingChanges.push({ newValue, path, newErrorSchema, id });\n if (this.pendingChanges.length === 1) {\n this.processPendingChange();\n }\n };\n\n /** Function to handle changes made to a field in the `Form`. This handler gets the first change from the\n * `pendingChanges` list, containing the `newValue` for the `formData` and the `path` at which the `newValue` is to be\n * updated, along with a new, optional `ErrorSchema` for that same `path` and potentially the `id` of the field being\n * changed. It will first update the `formData` with any missing default fields and then, if `omitExtraData` and\n * `liveOmit` are turned on, the `formData` will be filtered to remove any extra data not in a form field. Then, the\n * resulting `formData` will be validated if required. The state will be updated with the new updated (potentially\n * filtered) `formData`, any errors that resulted from validation. Finally the `onChange` callback will be called, if\n * specified, with the updated state and the `processPendingChange()` function is called again.\n */\n processPendingChange() {\n if (this.pendingChanges.length === 0) {\n return;\n }\n // Mark that we're processing a user-initiated change.\n // This prevents componentDidUpdate from reverting oneOf/anyOf option switches.\n this.isProcessingUserChange = true;\n const { newValue, path, id } = this.pendingChanges[0];\n const { newErrorSchema } = this.pendingChanges[0];\n // oxlint-disable-next-line typescript/no-deprecated\n const { extraErrors, omitExtraData, liveOmit, noValidate, liveValidate, onChange, disabled, readonly } = this.props;\n const { formData: oldFormData, schemaUtils, schema, fieldPathId, schemaValidationErrorSchema, errors } = this.state;\n let { customErrors, retrievedSchema } = this.state;\n // Use the un-merged AJV-only schema as the base for re-merging extraErrors. Mirrors the\n // pattern in getStateFromProps/getDerivedStateFromProps and avoids the duplication that\n // happened when state.errorSchema (already containing merged extraErrors) was passed in.\n let mergeBaseErrorSchema: ErrorSchema<T> = schemaValidationErrorSchema;\n const rootPathId = fieldPathId.path[0] || '';\n\n const isRootPath = !path || path.length === 0 || (path.length === 1 && path[0] === rootPathId);\n let formData = isRootPath ? newValue : structuredClone(oldFormData);\n\n // When switching from null to an object option in oneOf, MultiSchemaField sends\n // an object with property names but undefined values (e.g., {types: undefined, content: undefined}).\n // In this case, pass undefined to getStateFromProps to trigger fresh default computation.\n // Only do this when the previous formData was null/undefined (switching FROM null).\n const hasOnlyUndefinedValues =\n isObject(formData) &&\n Object.keys(formData as object).length > 0 &&\n Object.values(formData as object).every((v) => v === undefined);\n const wasPreviouslyNull = oldFormData === null || oldFormData === undefined;\n const inputForDefaults = hasOnlyUndefinedValues && wasPreviouslyNull ? undefined : formData;\n\n if (isObject(formData) || Array.isArray(formData)) {\n // Tracks if the user cleared a plain (non-oneOf/anyOf) leaf field.\n // The key is removed twice: once before getStateFromProps so inputForDefaults\n // reflects an empty field for conditional schema resolution, and once after so\n // the user's clear overrides any schema default getStateFromProps re-applied (#5125)\n // and AJV never receives { key: undefined } for type:\"string\" fields (#4518).\n let plainLeafWasCleared = false;\n\n if (newValue === ADDITIONAL_PROPERTY_KEY_REMOVE) {\n // For additional properties, this key was explicitly removed, so unset it\n unsetByPath(formData, path);\n } else if (!isRootPath) {\n // Set the new value at its path in the form data.\n let valueForPath: T | null | undefined = newValue;\n\n if (newValue === undefined) {\n const lastSegment = path[path.length - 1];\n if (typeof lastSegment === 'number') {\n // Array items: match ArrayField `handleChange` — AJV needs `null`, not undefined.\n valueForPath = null as unknown as T;\n } else {\n const { field } = schemaUtils.findFieldInSchema(schema, path, oldFormData);\n const leaf = field as RJSFSchema | undefined;\n const isOneOfOrAnyOfLeaf = leaf && (ONE_OF_KEY in leaf || ANY_OF_KEY in leaf);\n // oneOf/anyOf and unresolved leaves keep `undefined` so mergeDefaults doesn't\n // re-apply a branch default when the user clears the widget.\n // Plain resolved leaves use plainLeafWasCleared instead (see below).\n if (!isOneOfOrAnyOfLeaf && leaf !== undefined) {\n plainLeafWasCleared = true;\n }\n }\n }\n\n if (plainLeafWasCleared) {\n setByPath(formData, path, undefined);\n } else {\n setByPath(formData, path, valueForPath);\n }\n }\n const shouldSanitize =\n retrievedSchema && !isRootPath && !isObject(newValue) && !Array.isArray(newValue) && !disabled && !readonly;\n // Skip live validation here; it runs later in this function.\n const newState = this.getStateFromProps(\n this.props,\n inputForDefaults,\n undefined,\n undefined,\n undefined,\n true,\n shouldSanitize,\n );\n formData = newState.formData;\n retrievedSchema = newState.retrievedSchema;\n\n // Re-set to undefined after merging defaults so the user's clear is preserved in\n // state (#5125 regression: without this, clearing a second field re-applies the\n // default to previously-cleared fields). The undefined key is stripped from the\n // formData copy passed to AJV via JSON.parse(JSON.stringify(...)) so the validator never\n // sees { [key]: undefined } for type:\"string\" or patternProperties fields (#4518).\n if (plainLeafWasCleared && formData) {\n setByPath(formData, path, undefined);\n }\n }\n\n const mustValidate = !noValidate && (liveValidate === true || liveValidate === 'onChange');\n let state: Partial<FormState<T, S, F>> = { formData, retrievedSchema };\n let newFormData = formData;\n\n if (omitExtraData === true && (liveOmit === true || liveOmit === 'onChange')) {\n // oxlint-disable-next-line typescript/no-deprecated\n newFormData = this.omitExtraData(formData);\n state = { ...state, formData: newFormData };\n }\n\n if (newErrorSchema) {\n // First check to see if there is an existing validation error on this path...\n const oldValidationError = !isRootPath\n ? getByPath(schemaValidationErrorSchema, path)\n : schemaValidationErrorSchema;\n // If there is an old validation error for this path, assume we are updating it directly\n if (oldValidationError && Object.keys(oldValidationError).length > 0) {\n // Apply the user-supplied newErrorSchema onto a clone of the AJV-only base, so that\n // mergeErrors below sees the user's error at this path without mutating shared state.\n if (!isRootPath) {\n mergeBaseErrorSchema = structuredClone(schemaValidationErrorSchema);\n // An `ErrorSchema` nests plain objects even at numeric segments, so never auto-vivify arrays\n setByPath(mergeBaseErrorSchema, path, newErrorSchema, true);\n } else {\n mergeBaseErrorSchema = newErrorSchema;\n }\n } else {\n if (!customErrors) {\n customErrors = new ErrorSchemaBuilder<T>();\n }\n if (isRootPath) {\n const pathErrors = newErrorSchema[ERRORS_KEY];\n if (pathErrors) {\n // only set errors when there are some\n customErrors.setErrors(pathErrors);\n }\n } else {\n // An `ErrorSchema` nests plain objects even at numeric segments, so never auto-vivify arrays\n setByPath(customErrors.ErrorSchema, path, newErrorSchema, true);\n }\n }\n } else if (customErrors && getByPath(customErrors.ErrorSchema, [...path, ERRORS_KEY])) {\n // If we have custom errors and the path has an error, then we need to clear it\n customErrors.clearErrors(path);\n }\n // If there are pending changes in the queue, skip live validation since it will happen with the last change\n if (mustValidate && this.pendingChanges.length === 1) {\n const liveValidation = this.liveValidate(\n schema,\n schemaUtils,\n mergeBaseErrorSchema,\n newFormData,\n extraErrors,\n customErrors,\n retrievedSchema,\n );\n state = { ...state, formData: newFormData, ...liveValidation, customErrors };\n } else if (!noValidate && newErrorSchema) {\n // Merging 'newErrorSchema' into 'errorSchema' to display the custom raised errors.\n const mergedErrors = Form.mergeErrors<T>(\n { errorSchema: mergeBaseErrorSchema, errors },\n extraErrors,\n customErrors,\n );\n state = { ...state, formData: newFormData, ...mergedErrors, customErrors };\n }\n\n this.setState(state as FormState<T, S, F>, () => {\n if (onChange) {\n onChange(toIChangeEvent({ ...this.state, ...state }), id);\n }\n // Now remove the change we just completed and call this again\n this.pendingChanges.shift();\n this.processPendingChange();\n });\n }\n\n /**\n * If the retrievedSchema has changed the new retrievedSchema is returned.\n * Otherwise, the old retrievedSchema is returned to persist reference.\n * - This ensures that AJV retrieves the schema from the cache when it has not changed,\n * avoiding the performance cost of recompiling the schema.\n *\n * @param retrievedSchema The new retrieved schema.\n * @returns The new retrieved schema if it has changed, else the old retrieved schema.\n */\n private updateRetrievedSchema(retrievedSchema: S) {\n const isTheSame = deepEquals(retrievedSchema, this.state?.retrievedSchema);\n return isTheSame ? this.state.retrievedSchema : retrievedSchema;\n }\n\n /**\n * Callback function to handle reset form data.\n * - Reset all fields with default values.\n * - Reset validations and errors\n *\n */\n reset = () => {\n // Cast the IS_RESET symbol to T to avoid type issues, we use this symbol to detect reset mode\n const { formData: propsFormData, initialFormData = IS_RESET as T, onChange } = this.props;\n const newState = this.getStateFromProps(\n this.props,\n propsFormData ?? initialFormData,\n undefined,\n undefined,\n undefined,\n true,\n );\n const newFormData = newState.formData;\n const state = {\n formData: newFormData,\n errorSchema: {},\n errors: [] as unknown,\n schemaValidationErrors: [] as unknown,\n schemaValidationErrorSchema: {},\n initialDefaultsGenerated: false,\n customErrors: undefined,\n } as FormState<T, S, F>;\n\n this.setState(state, () => onChange?.(toIChangeEvent({ ...this.state, ...state })));\n };\n\n /** Callback function to handle when a field on the form is blurred. Calls the `onBlur` callback for the `Form` if it\n * was provided. Also runs any live validation and/or live omit operations if the flags indicate they should happen\n * during `onBlur`.\n *\n * @param id - The unique `id` of the field that was blurred\n * @param data - The data associated with the field that was blurred\n */\n onBlur = (id: string, data: any) => {\n const { onBlur, omitExtraData, liveOmit, liveValidate } = this.props;\n if (onBlur) {\n onBlur(id, data);\n }\n if ((omitExtraData === true && liveOmit === 'onBlur') || liveValidate === 'onBlur') {\n const { onChange, extraErrors } = this.props;\n const { formData } = this.state;\n let newFormData: T | undefined = formData;\n let state: Partial<FormState<T, S, F>> = { formData: newFormData };\n if (omitExtraData === true && liveOmit === 'onBlur') {\n // oxlint-disable-next-line typescript/no-deprecated\n newFormData = this.omitExtraData(formData);\n state = { formData: newFormData };\n }\n if (liveValidate === 'onBlur') {\n const { schema, schemaUtils, errorSchema, customErrors, retrievedSchema } = this.state;\n const liveValidation = this.liveValidate(\n schema,\n schemaUtils,\n errorSchema,\n newFormData,\n extraErrors,\n customErrors,\n retrievedSchema,\n );\n state = { formData: newFormData, ...liveValidation, customErrors };\n }\n const hasChanges = Object.keys(state)\n // Filter out `schemaValidationErrors` and `schemaValidationErrorSchema` since they aren't IChangeEvent props\n .filter((key) => !key.startsWith('schemaValidation'))\n .some((key) => {\n const oldData = this.state[key as keyof FormState<T, S, F>];\n const newData = state[key as keyof FormState<T, S, F>];\n return !deepEquals(oldData, newData);\n });\n this.setState(state as FormState<T, S, F>, () => {\n if (onChange && hasChanges) {\n onChange(toIChangeEvent({ ...this.state, ...state }), id);\n }\n });\n }\n };\n\n /** Callback function to handle when a field on the form is focused. Calls the `onFocus` callback for the `Form` if it\n * was provided.\n *\n * @param id - The unique `id` of the field that was focused\n * @param data - The data associated with the field that was focused\n */\n onFocus = (id: string, data: any) => {\n const { onFocus } = this.props;\n if (onFocus) {\n onFocus(id, data);\n }\n };\n\n /** Callback function to handle when the form is submitted. First, it prevents the default event behavior. Nothing\n * happens if the target and currentTarget of the event are not the same. It will omit any extra data in the\n * `formData` in the state if `omitExtraData` is true. It will validate the resulting `formData`, reporting errors\n * via the `onError()` callback unless validation is disabled. Finally, it will add in any `extraErrors` and then call\n * back the `onSubmit` callback if it was provided.\n *\n * @param event - The submit HTML form event\n */\n onSubmit = (event: FormEvent<any>) => {\n event.preventDefault();\n if (event.target !== event.currentTarget) {\n return;\n }\n\n event.persist();\n // oxlint-disable-next-line typescript/no-deprecated\n const { omitExtraData, extraErrors, noValidate, onSubmit } = this.props;\n let { formData: newFormData } = this.state;\n\n if (omitExtraData === true) {\n // oxlint-disable-next-line typescript/no-deprecated\n newFormData = this.omitExtraData(newFormData);\n }\n\n if (noValidate || this.validateFormWithFormData(newFormData)) {\n // There are no errors generated through schema validation.\n // Check for user provided errors and update state accordingly.\n const errorSchema = extraErrors || {};\n const errors = extraErrors ? toErrorList(extraErrors) : [];\n this.setState(\n {\n formData: newFormData,\n errors,\n errorSchema,\n schemaValidationErrors: [],\n schemaValidationErrorSchema: {},\n },\n () => {\n if (onSubmit) {\n onSubmit(toIChangeEvent({ ...this.state, formData: newFormData }, 'submitted'), event);\n }\n },\n );\n }\n };\n\n /** Extracts the `GlobalFormOptions` from the given Form `props`\n *\n * @param props - The form props to extract the global form options from\n * @returns - The `GlobalFormOptions` from the props\n * @private\n */\n private static getGlobalFormOptions<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n >(props: FormProps<T, S, F>): GlobalFormOptions {\n const {\n uiSchema = {},\n experimental_componentUpdateStrategy,\n idSeparator = DEFAULT_ID_SEPARATOR,\n idPrefix = DEFAULT_ID_PREFIX,\n nameGenerator,\n useFallbackUiForUnsupportedType = false,\n } = props;\n // oxlint-disable-next-line typescript/no-deprecated\n const rootFieldId = uiSchema['ui:rootFieldId'];\n // Omit any options that are undefined or null\n return {\n idPrefix: rootFieldId || idPrefix,\n idSeparator,\n useFallbackUiForUnsupportedType,\n ...(experimental_componentUpdateStrategy !== undefined && { experimental_componentUpdateStrategy }),\n ...(nameGenerator !== undefined && { nameGenerator }),\n };\n }\n\n /** Computed the registry for the form using the given `props`, `schema` and `schemaUtils` */\n static getRegistry<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n props: FormProps<T, S, F>,\n schema: S,\n schemaUtils: SchemaUtilsType<T, S, F>,\n ): Registry<T, S, F> {\n const { translateString: customTranslateString, uiSchema = {} } = props;\n const { fields, templates, widgets, formContext, translateString } = getDefaultRegistry<T, S, F>();\n return {\n fields: { ...fields, ...props.fields },\n templates: {\n ...templates,\n ...props.templates,\n ButtonTemplates: {\n ...templates.ButtonTemplates,\n ...props.templates?.ButtonTemplates,\n },\n },\n widgets: { ...widgets, ...props.widgets },\n rootSchema: schema,\n formContext: props.formContext || formContext,\n schemaUtils,\n translateString: customTranslateString || translateString,\n globalUiOptions: uiSchema[UI_GLOBAL_OPTIONS_KEY],\n globalFormOptions: Form.getGlobalFormOptions(props),\n uiSchemaDefinitions: uiSchema[UI_DEFINITIONS_KEY] ?? {},\n };\n }\n\n /** Provides a function that can be used to programmatically submit the `Form` */\n submit = () => {\n if (this.formElement.current) {\n const submitCustomEvent = new CustomEvent('submit', {\n cancelable: true,\n });\n submitCustomEvent.preventDefault();\n this.formElement.current.dispatchEvent(submitCustomEvent);\n this.formElement.current.requestSubmit();\n }\n };\n\n /** Attempts to focus on the field associated with the `error`. Uses the `property` field to compute path of the error\n * field, then, using the `idPrefix` and `idSeparator` converts that path into an id. Then the input element with that\n * id is attempted to be found using the `formElement` ref. If it is located, then it is focused.\n *\n * @param error - The error on which to focus\n */\n focusOnError(error: RJSFValidationError) {\n const { idPrefix = 'root', idSeparator = '_' } = this.props;\n const { property } = error;\n const path = toPath(property ?? '');\n // The id of the root element is the idPrefix, so prepend it to the path\n path.unshift(idPrefix);\n\n const elementId = path.join(idSeparator);\n let field = this.formElement.current.elements[elementId];\n if (!field) {\n // if not an exact match, try finding a focusable element starting with the element id (like radio buttons or checkboxes)\n // some themes (e.g. shadcn) use button elements instead of native inputs for radio groups\n field = this.formElement.current.querySelector(`input[id^=\"${elementId}\"], button[id^=\"${elementId}\"]`);\n }\n if (field?.length) {\n // If we got a list with length > 0\n // oxlint-disable-next-line prefer-destructuring\n field = field[0];\n }\n if (field) {\n field.focus();\n }\n }\n\n /** Validates the form using the given `formData`. For use on form submission or on programmatic validation.\n * If `onError` is provided, then it will be called with the list of errors.\n *\n * @param formData - The form data to validate\n * @returns - True if the form is valid, false otherwise.\n */\n validateFormWithFormData = (formData?: T): boolean => {\n const { extraErrors, extraErrorsBlockSubmit, focusOnFirstError, onError } = this.props;\n const { errors: prevErrors } = this.state;\n const schemaValidation = this.validate(formData);\n // Always merge extraErrors so they remain visible in state regardless of extraErrorsBlockSubmit.\n const { errors, errorSchema } = extraErrors ? Form.mergeErrors<T>(schemaValidation, extraErrors) : schemaValidation;\n // hasError gates submission: schema errors always block; extraErrors only block when\n // extraErrorsBlockSubmit is set (non-breaking default: extraErrors are informational only).\n const hasError = schemaValidation.errors.length > 0 || (extraErrors && extraErrorsBlockSubmit);\n if (hasError) {\n if (focusOnFirstError) {\n if (typeof focusOnFirstError === 'function') {\n focusOnFirstError(errors[0]);\n } else {\n this.focusOnError(errors[0]);\n }\n }\n this.setState(\n {\n errors,\n errorSchema,\n schemaValidationErrors: schemaValidation.errors,\n schemaValidationErrorSchema: schemaValidation.errorSchema,\n },\n () => {\n if (onError) {\n onError(errors);\n } else {\n // oxlint-disable-next-line no-console\n console.error('Form validation failed', errors);\n }\n },\n );\n } else if (errors.length > 0) {\n // Non-blocking extraErrors are present — update display state without triggering onError.\n this.setState({\n errors,\n errorSchema,\n schemaValidationErrors: [],\n schemaValidationErrorSchema: {},\n });\n } else if (prevErrors.length > 0) {\n this.setState({\n errors: [],\n errorSchema: {},\n schemaValidationErrors: [],\n schemaValidationErrorSchema: {},\n });\n }\n return !hasError;\n };\n\n /** Programmatically validate the form. If `omitExtraData` is true, the `formData` will first be filtered to remove\n * any extra data not in a form field. If `onError` is provided, then it will be called with the list of errors the\n * same way as would happen on form submission.\n *\n * @returns - True if the form is valid, false otherwise.\n */\n validateForm() {\n const { omitExtraData } = this.props;\n let { formData: newFormData } = this.state;\n if (omitExtraData === true) {\n // oxlint-disable-next-line typescript/no-deprecated\n newFormData = this.omitExtraData(newFormData);\n }\n return this.validateFormWithFormData(newFormData);\n }\n\n /** Renders the `Form` fields inside the <form> | `tagName` or `_internalFormWrapper`, rendering any errors if\n * needed along with the submit button or any children of the form.\n */\n render() {\n const {\n children,\n id,\n className = '',\n tagName,\n name,\n method,\n target,\n action,\n autoComplete,\n enctype,\n acceptCharset,\n noHtml5Validate = false,\n disabled,\n readonly,\n showErrorList = 'top',\n _internalFormWrapper,\n } = this.props;\n\n const { schema, uiSchema, formData, errorSchema, fieldPathId, registry } = this.state;\n const { SchemaField: SchemaFieldComponent } = registry.fields;\n const { SubmitButton } = registry.templates.ButtonTemplates;\n // The `semantic-ui` and `material-ui` themes have `_internalFormWrapper`s that take an `as` prop that is the\n // PropTypes.elementType to use for the inner tag, so we'll need to pass `tagName` along if it is provided.\n // NOTE, the `as` prop is native to `semantic-ui` and is emulated in the `material-ui` theme\n const as = _internalFormWrapper ? tagName : undefined;\n const FormTag = _internalFormWrapper || tagName || 'form';\n\n let { [SUBMIT_BTN_OPTIONS_KEY]: submitOptions = {} } = getUiOptions<T, S, F>(uiSchema);\n if (disabled) {\n submitOptions = { ...submitOptions, props: { ...submitOptions.props, disabled: true } };\n }\n const submitUiSchema = { [UI_OPTIONS_KEY]: { [SUBMIT_BTN_OPTIONS_KEY]: submitOptions } };\n\n return (\n <FormTag\n className={className || 'rjsf'}\n id={id}\n name={name}\n method={method}\n target={target}\n action={action}\n autoComplete={autoComplete}\n encType={enctype}\n acceptCharset={acceptCharset}\n noValidate={noHtml5Validate}\n onSubmit={this.onSubmit}\n as={as}\n ref={this.formElement}\n >\n {showErrorList === 'top' && this.renderErrors(registry)}\n <SchemaFieldComponent\n name=''\n schema={schema}\n uiSchema={uiSchema}\n errorSchema={errorSchema}\n fieldPathId={fieldPathId}\n formData={formData}\n onChange={this.onChange}\n onBlur={this.onBlur}\n onFocus={this.onFocus}\n registry={registry}\n disabled={disabled}\n readonly={readonly}\n />\n\n {children || <SubmitButton uiSchema={submitUiSchema} registry={registry} />}\n {showErrorList === 'bottom' && this.renderErrors(registry)}\n </FormTag>\n );\n }\n}\n","import type { GenericObjectType } from './types.ts';\n\n/** Determines whether a `thing` is an object for the purposes of RJSF. In this case, `thing` is an object if it has\n * the type `object` but is NOT null, an array or a File.\n *\n * @param thing - The thing to check to see whether it is an object\n * @returns - True if it is a non-null, non-array, non-File object\n */\nexport default function isObject(thing: unknown): thing is GenericObjectType {\n if (typeof thing !== 'object' || thing === null) {\n return false;\n }\n // lastModified is guaranteed to be a number on a File instance\n // as per https://w3c.github.io/FileAPI/#dfn-lastModified\n if (\n 'lastModified' in thing &&\n typeof thing.lastModified === 'number' &&\n typeof File !== 'undefined' &&\n thing instanceof File\n ) {\n return false;\n }\n // getMonth is guaranteed to be a method on a Date instance\n // as per https://tc39.es/ecma262/multipage/numbers-and-dates.html#sec-date.prototype.getmonth\n if (\n 'getMonth' in thing &&\n typeof thing.getMonth === 'function' &&\n typeof Date !== 'undefined' &&\n thing instanceof Date\n ) {\n return false;\n }\n return !Array.isArray(thing);\n}\n","import isObject from './isObject.ts';\nimport type { RJSFSchema, StrictRJSFSchema } from './types.ts';\n\n/** Checks the schema to see if it is allowing additional items, by verifying that `schema.additionalItems` is an\n * object. The user is warned in the console if `schema.additionalItems` has the value `true`.\n *\n * @param schema - The schema object to check\n * @returns - True if additional items is allowed, otherwise false\n */\nexport default function allowAdditionalItems<S extends StrictRJSFSchema = RJSFSchema>(schema: S) {\n if (schema.additionalItems === true) {\n // oxlint-disable-next-line no-console\n console.warn('additionalItems=true is currently not supported');\n }\n return isObject(schema.additionalItems);\n}\n","/**\n * Determines the locale-specific decimal separator.\n * It uses the provided locale or the first locale in navigator.languages (if available) and falls back to \"en\".\n *\n * @param languages - Optional array of locales or a single locale string\n * @returns The decimal separator character (typically '.' or ',').\n */\nexport default function getDecimalSeparator(languages?: string | string[]): string {\n const locales = languages || (typeof navigator !== 'undefined' ? navigator.languages : undefined);\n if (locales) {\n try {\n const formatter = new Intl.NumberFormat(locales);\n const parts = formatter.formatToParts(1.1);\n return parts.find((part) => part.type === 'decimal')?.value || '.';\n } catch (e) {\n // Fallback\n }\n }\n return '.';\n}\n","import getDecimalSeparator from './getDecimalSeparator.ts';\n\n/** Attempts to convert the string into a number. If an empty string is provided, then `undefined` is returned.\n * If a `null` is provided, it is returned. If the string ends in a `.` or the locale-specific separator then the\n * string is returned because the user may be in the middle of typing a float number. If a number ends in a pattern\n * like `.0`, `.20`, `.030`, string is returned because the user may be typing number that will end in a non-zero\n * digit. Otherwise, the string is wrapped by `Number()` and if that result is not `NaN`, that number will be\n * returned, otherwise the string `value` will be.\n *\n * @param value - The string or null value to convert to a number\n * @returns - The `value` converted to a number when appropriate, otherwise the `value`\n */\nexport default function asNumber(value: string | null) {\n if (value === '') {\n return undefined;\n }\n if (value === null) {\n return null;\n }\n\n const separator = getDecimalSeparator();\n\n // Normalize separator to standard '.' for pattern checking and parsing\n const standardValue = typeof value === 'string' && separator !== '.' ? value.replace(separator, '.') : value;\n\n // oxlint-disable-next-line typescript/prefer-string-starts-ends-with -- regex test() coerces undefined to \"undefined\" safely; endsWith() throws on undefined values passed at runtime\n if (/\\.$/.test(standardValue)) {\n // '3.' can't really be considered a number even if it parses in js. The\n // user is most likely entering a float.\n return value;\n }\n // oxlint-disable-next-line typescript/prefer-string-starts-ends-with -- same as above\n if (/\\.0$/.test(standardValue)) {\n // we need to return this as a string here, to allow for input like 3.07\n return value;\n }\n\n if (/\\.\\d*0$/.test(standardValue)) {\n // It's a number, that's cool - but we need it as a string so it doesn't screw\n // with the user when entering dollar amounts or other values (such as those with\n // specific precision or number of significant digits)\n return value;\n }\n\n const n = Number(standardValue);\n const valid = typeof n === 'number' && !Number.isNaN(n);\n\n return valid ? n : value;\n}\n","/** Below are the list of all the keys into various elements of a RJSFSchema or UiSchema that are used by the various\n * utility functions. In addition to those keys, there are the special `ADDITIONAL_PROPERTY_FLAG`,\n * `RJSF_REF_KEY`, and `RJSF_REF_CYCLE_KEY` Symbols that are added to a schema under certain conditions by the\n * `retrieveSchema()` utility. Using Symbols keeps these internal markers invisible to JSON serialisation and\n * JSON Schema validators (AJV, ATA, etc.), which only enumerate string-keyed properties.\n */\nexport const ADDITIONAL_PROPERTY_FLAG = Symbol('__additional_property');\nexport const ADDITIONAL_PROPERTIES_KEY = 'additionalProperties';\nexport const ALL_OF_KEY = 'allOf';\nexport const ANY_OF_KEY = 'anyOf';\nexport const CONST_KEY = 'const';\nexport const DEFAULT_KEY = 'default';\nexport const DEFINITIONS_KEY = 'definitions';\nexport const DEPENDENCIES_KEY = 'dependencies';\nexport const ENUM_KEY = 'enum';\nexport const ERRORS_KEY = '__errors';\nexport const ID_KEY = '$id';\nexport const IF_KEY = 'if';\nexport const ITEMS_KEY = 'items';\nexport const JUNK_OPTION_ID = '_$junk_option_schema_id$_';\nexport const NAME_KEY = '$name';\nexport const ONE_OF_KEY = 'oneOf';\nexport const PATTERN_PROPERTIES_KEY = 'patternProperties';\nexport const PROPERTIES_KEY = 'properties';\nexport const READONLY_KEY = 'readonly';\nexport const REQUIRED_KEY = 'required';\nexport const SUBMIT_BTN_OPTIONS_KEY = 'submitButtonOptions';\nexport const REF_KEY = '$ref';\nexport const RJSF_REF_KEY = Symbol('__rjsf_ref');\nexport const RJSF_REF_CYCLE_KEY = Symbol('__rjsf_ref_cycle');\nexport const SCHEMA_KEY = '$schema';\nexport const DEFAULT_ID_PREFIX = 'root';\nexport const DEFAULT_ID_SEPARATOR = '_';\n/** The path of the discriminator value returned by the schema endpoint.\n * The discriminator is the value in a `oneOf` that determines which option is selected.\n */\nexport const DISCRIMINATOR_PATH = ['discriminator', 'propertyName'];\n/** The name of the `formContext` attribute in the React JSON Schema Form Registry\n */\nexport const FORM_CONTEXT_NAME = 'formContext';\n\n/** The name of the `layoutGridLookupMap` attribute in the form context\n */\nexport const LOOKUP_MAP_NAME = 'layoutGridLookupMap';\nexport const RJSF_PREFIX_KEY = '__rjsf';\nexport const RJSF_ADDITIONAL_PROPERTIES_FLAG = `${RJSF_PREFIX_KEY}_additionalProperties`;\nexport const ROOT_SCHEMA_PREFIX = `${RJSF_PREFIX_KEY}_rootSchema`;\nexport const UI_FIELD_KEY = 'ui:field';\nexport const UI_WIDGET_KEY = 'ui:widget';\nexport const UI_OPTIONS_KEY = 'ui:options';\nexport const UI_GLOBAL_OPTIONS_KEY = 'ui:globalOptions';\nexport const UI_DEFINITIONS_KEY = 'ui:definitions';\n\n/** The JSON Schema version strings\n */\nexport const JSON_SCHEMA_DRAFT_2019_09 = 'https://json-schema.org/draft/2019-09/schema';\nexport const JSON_SCHEMA_DRAFT_2020_12 = 'https://json-schema.org/draft/2020-12/schema';\n","import { UI_OPTIONS_KEY, UI_WIDGET_KEY } from './constants.ts';\nimport isObject from './isObject.ts';\nimport type {\n FormContextType,\n GlobalUISchemaOptions,\n RJSFSchema,\n StrictRJSFSchema,\n UIOptionsType,\n UiSchema,\n} from './types.ts';\n\n/** Get all passed options from ui:options, and ui:<optionName>, returning them in an object with the `ui:`\n * stripped off. Any `globalOptions` will always be returned, unless they are overridden by options in the `uiSchema`.\n *\n * @param [uiSchema={}] - The UI Schema from which to get any `ui:xxx` options\n * @param [globalOptions={}] - The optional Global UI Schema from which to get any fallback `xxx` options\n * @returns - An object containing all the `ui:xxx` options with the `ui:` stripped off along with all `globalOptions`\n */\nexport default function getUiOptions<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n uiSchema: UiSchema<T, S, F> = {},\n globalOptions: GlobalUISchemaOptions = {},\n): UIOptionsType<T, S, F> {\n // Handle null or undefined uiSchema\n if (!uiSchema) {\n return { ...globalOptions };\n }\n return Object.keys(uiSchema)\n .filter((key) => key.startsWith('ui:'))\n .reduce(\n (options, key) => {\n const value = uiSchema[key];\n if (key === UI_WIDGET_KEY && isObject(value)) {\n // oxlint-disable-next-line no-console\n console.error('Setting options via ui:widget object is no longer supported, use ui:options instead');\n return options;\n }\n if (key === UI_OPTIONS_KEY && isObject(value)) {\n return { ...options, ...value };\n }\n return { ...options, [key.substring(3)]: value };\n },\n { ...globalOptions },\n );\n}\n","import getUiOptions from './getUiOptions.ts';\nimport type { FormContextType, RJSFSchema, StrictRJSFSchema, UiSchema } from './types.ts';\n\n/** Checks whether the field described by `schema`, having the `uiSchema` and `formData` supports expanding. The UI for\n * the field can expand if it has additional properties, is not forced as non-expandable by the `uiSchema` and the\n * `formData` object doesn't already have `schema.maxProperties` elements.\n *\n * @param schema - The schema for the field that is being checked\n * @param [uiSchema={}] - The uiSchema for the field\n * @param [formData] - The formData for the field\n * @returns - True if the schema element has additionalProperties, is expandable, and not at the maxProperties limit\n */\nexport default function canExpand<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n schema: RJSFSchema,\n uiSchema: UiSchema<T, S, F> = {},\n formData?: T,\n) {\n if (!(schema.additionalProperties || schema.patternProperties)) {\n return false;\n }\n const { expandable = true } = getUiOptions<T, S, F>(uiSchema);\n if (expandable === false) {\n return expandable;\n }\n // if ui:options.expandable was not explicitly set to false, we can add\n // another property if we have not exceeded maxProperties yet\n if (schema.maxProperties !== undefined && formData) {\n return Object.keys(formData).length < schema.maxProperties;\n }\n return true;\n}\n","/** Determines whether `thing` is a plain object, i.e. one created by the `Object` constructor or with a `null`\n * prototype. Unlike `isObject()`, class instances such as `Error` are not plain objects, which matters when\n * recursively walking a structure whose nested values are expected to be plain data.\n *\n * @param thing - The thing to check to see whether it is a plain object\n * @returns - True if it is a plain object, otherwise false\n */\nexport default function isPlainObject(thing: unknown): thing is Record<string, unknown> {\n if (typeof thing !== 'object' || thing === null) {\n return false;\n }\n const proto = Object.getPrototypeOf(thing);\n return proto === null || proto === Object.prototype;\n}\n","const { getOwnPropertyNames, getOwnPropertySymbols } = Object;\nconst { hasOwnProperty } = Object.prototype;\n/**\n * Combine two comparators into a single comparators.\n */\nfunction combineComparators(comparatorA, comparatorB) {\n return function isEqual(a, b, state) {\n return comparatorA(a, b, state) && comparatorB(a, b, state);\n };\n}\n/**\n * Wrap the provided `areItemsEqual` method to manage the circular state, allowing\n * for circular references to be safely included in the comparison without creating\n * stack overflows.\n */\nfunction createIsCircular(areItemsEqual) {\n return function isCircular(a, b, state) {\n if (!a || !b || typeof a !== 'object' || typeof b !== 'object') {\n return areItemsEqual(a, b, state);\n }\n const { cache } = state;\n const cachedA = cache.get(a);\n const cachedB = cache.get(b);\n if (cachedA && cachedB) {\n return cachedA === b && cachedB === a;\n }\n cache.set(a, b);\n cache.set(b, a);\n const result = areItemsEqual(a, b, state);\n cache.delete(a);\n cache.delete(b);\n return result;\n };\n}\n/**\n * Get the properties to strictly examine, which include both own properties that are\n * not enumerable and symbol properties.\n */\nfunction getStrictProperties(object) {\n const symbols = getOwnPropertySymbols(object);\n return symbols.length\n ? getOwnPropertyNames(object).concat(symbols)\n : getOwnPropertyNames(object);\n}\n/**\n * Whether the object contains the property passed as an own property.\n */\nconst hasOwn = \n// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\nObject.hasOwn || ((object, property) => hasOwnProperty.call(object, property));\n\nconst PREACT_VNODE = '__v';\nconst PREACT_OWNER = '__o';\nconst REACT_OWNER = '_owner';\n// `Float16Array` is recent enough that it cannot be referenced unguarded, and capturing its\n// availability once keeps that detail out of the comparison itself.\nconst HAS_FLOAT_16_ARRAY = typeof Float16Array !== 'undefined';\nconst { getOwnPropertyDescriptor, keys } = Object;\n/**\n * Whether the values passed are equal based on a [SameValue](https://262.ecma-international.org/7.0/#sec-samevalue) basis.\n * Simplified, this maps to if the two values are referentially equal to one another (`a === b`) or both are `NaN`.\n *\n * @note\n * When available in the environment, this is just a re-export of the global\n * [`Object.is`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is) method.\n */\nconst sameValueEqual = \n// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\nObject.is\n || function sameValueEqual(a, b) {\n return a === b ? a !== 0 || 1 / a === 1 / b : a !== a && b !== b;\n };\n/**\n * Whether the values passed are equal based on a [SameValue](https://262.ecma-international.org/7.0/#sec-samevaluezero) basis.\n * Simplified, this maps to if the two values are referentially equal to one another (`a === b`), both are `NaN`, or both\n * are either positive or negative zero.\n */\nfunction sameValueZeroEqual(a, b) {\n return a === b || (a !== a && b !== b);\n}\n/**\n * Whether the values passed are equal based on a\n * [Strict Equality Comparison](https://262.ecma-international.org/7.0/#sec-strict-equality-comparison) basis.\n * Simplified, this maps to if the two values are referentially equal to one another (`a === b`).\n *\n * @note\n * This is mainly available as a convenience function, such as being a default when a function to determine equality between\n * two objects is used.\n */\nfunction strictEqual(a, b) {\n return a === b;\n}\n/**\n * Whether the array buffers are equal in value.\n */\nfunction areArrayBuffersEqual(a, b) {\n return a.byteLength === b.byteLength && areTypedArraysEqual(new Uint8Array(a), new Uint8Array(b));\n}\n/**\n * Whether the arrays are equal in value.\n */\nfunction areArraysEqual(a, b, state) {\n let index = a.length;\n if (b.length !== index) {\n return false;\n }\n while (index-- > 0) {\n if (!state.equals(a[index], b[index], index, index, a, b, state)) {\n return false;\n }\n }\n return true;\n}\n/**\n * Whether the dataviews are equal in value.\n */\nfunction areDataViewsEqual(a, b) {\n return (a.byteLength === b.byteLength\n && areTypedArraysEqual(new Uint8Array(a.buffer, a.byteOffset, a.byteLength), new Uint8Array(b.buffer, b.byteOffset, b.byteLength)));\n}\n/**\n * Whether the dates passed are equal in value.\n */\nfunction areDatesEqual(a, b) {\n return sameValueEqual(a.getTime(), b.getTime());\n}\n/**\n * Whether the errors passed are equal in value.\n *\n * @note\n * `name`, `message` and `stack` are own properties but are not enumerable, so they are compared\n * explicitly. `cause` is compared by value rather than by reference, matching how every other\n * nested value in the comparison is treated. Own enumerable properties (which custom `Error`\n * subclasses commonly add) are compared by composing this with the object comparator in the\n * comparator config, so that the strict and circular variants apply to them as well.\n */\nfunction areErrorsEqual(a, b, state) {\n return (a.name === b.name\n && a.message === b.message\n && a.stack === b.stack\n && state.equals(a.cause, b.cause, 'cause', 'cause', a, b, state));\n}\n/**\n * Whether the `Map`s are equal in value.\n */\nfunction areMapsEqual(a, b, state) {\n const size = a.size;\n if (size !== b.size) {\n return false;\n }\n if (!size) {\n return true;\n }\n const matchedIndices = new Uint8Array(size);\n const aIterable = a.entries();\n let aResult;\n let bResult;\n let index = 0;\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while ((aResult = aIterable.next())) {\n if (aResult.done) {\n break;\n }\n const bIterable = b.entries();\n let hasMatch = 0;\n let matchIndex = 0;\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while ((bResult = bIterable.next())) {\n if (bResult.done) {\n break;\n }\n if (matchedIndices[matchIndex]) {\n matchIndex++;\n continue;\n }\n const aEntry = aResult.value;\n const bEntry = bResult.value;\n if (state.equals(aEntry[0], bEntry[0], index, matchIndex, a, b, state)\n && state.equals(aEntry[1], bEntry[1], aEntry[0], bEntry[0], a, b, state)) {\n hasMatch = matchedIndices[matchIndex] = 1;\n break;\n }\n matchIndex++;\n }\n if (!hasMatch) {\n return false;\n }\n index++;\n }\n return true;\n}\n/**\n * Whether the objects are equal in value.\n */\nfunction areObjectsEqual(a, b, state) {\n const properties = keys(a);\n let index = properties.length;\n if (keys(b).length !== index) {\n return false;\n }\n // Decrementing `while` showed faster results than either incrementing or\n // decrementing `for` loop and than an incrementing `while` loop. Declarative\n // methods like `some` / `every` were not used to avoid incurring the garbage\n // cost of anonymous callbacks.\n while (index-- > 0) {\n if (!isPropertyEqual(a, b, state, properties[index])) {\n return false;\n }\n }\n return true;\n}\n/**\n * Whether the objects are equal in value with strict property checking.\n */\nfunction areObjectsEqualStrict(a, b, state) {\n const properties = getStrictProperties(a);\n let index = properties.length;\n if (getStrictProperties(b).length !== index) {\n return false;\n }\n let property;\n let descriptorA;\n let descriptorB;\n // Decrementing `while` showed faster results than either incrementing or\n // decrementing `for` loop and than an incrementing `while` loop. Declarative\n // methods like `some` / `every` were not used to avoid incurring the garbage\n // cost of anonymous callbacks.\n while (index-- > 0) {\n property = properties[index];\n if (!isPropertyEqual(a, b, state, property)) {\n return false;\n }\n descriptorA = getOwnPropertyDescriptor(a, property);\n descriptorB = getOwnPropertyDescriptor(b, property);\n if ((descriptorA || descriptorB)\n && (!descriptorA\n || !descriptorB\n || descriptorA.configurable !== descriptorB.configurable\n || descriptorA.enumerable !== descriptorB.enumerable\n || descriptorA.writable !== descriptorB.writable)) {\n return false;\n }\n }\n return true;\n}\n/**\n * Whether the primitive wrappers passed are equal in value.\n */\nfunction arePrimitiveWrappersEqual(a, b) {\n return sameValueEqual(a.valueOf(), b.valueOf());\n}\n/**\n * Whether the regexps passed are equal in value.\n */\nfunction areRegExpsEqual(a, b) {\n return a.source === b.source && a.flags === b.flags;\n}\n/**\n * Whether the `Set`s are equal in value.\n */\nfunction areSetsEqual(a, b, state) {\n const size = a.size;\n if (size !== b.size) {\n return false;\n }\n if (!size) {\n return true;\n }\n const matchedIndices = new Uint8Array(size);\n const aIterable = a.values();\n let aResult;\n let bResult;\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while ((aResult = aIterable.next())) {\n if (aResult.done) {\n break;\n }\n const bIterable = b.values();\n let hasMatch = 0;\n let matchIndex = 0;\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while ((bResult = bIterable.next())) {\n if (bResult.done) {\n break;\n }\n if (!matchedIndices[matchIndex]\n && state.equals(aResult.value, bResult.value, aResult.value, bResult.value, a, b, state)) {\n hasMatch = matchedIndices[matchIndex] = 1;\n break;\n }\n matchIndex++;\n }\n if (!hasMatch) {\n return false;\n }\n }\n return true;\n}\n/**\n * Whether the TypedArray instances are equal in value.\n */\nfunction areTypedArraysEqual(a, b) {\n let index = a.length;\n if (b.length !== index || a.byteOffset !== b.byteOffset) {\n return false;\n }\n // Only float-backed views can hold `NaN`, and the additional check needed to treat it as equal\n // to itself measurably slows the loop, so integer views keep the plain comparison. This is\n // hoisted out of the loop so the cost is paid once per call rather than once per element.\n if (a instanceof Float64Array || a instanceof Float32Array || (HAS_FLOAT_16_ARRAY && a instanceof Float16Array)) {\n while (index-- > 0) {\n // `NaN` is the only value not equal to itself, and it is treated as equal here to match\n // the SameValueZero semantics used for every other numeric comparison in the library.\n if (a[index] !== b[index] && (a[index] === a[index] || b[index] === b[index])) {\n return false;\n }\n }\n return true;\n }\n while (index-- > 0) {\n if (a[index] !== b[index]) {\n return false;\n }\n }\n return true;\n}\n/**\n * Whether the URL instances are equal in value.\n */\nfunction areUrlsEqual(a, b) {\n // `href` is the normalized serialization of every component, so matching hrefs are equal without\n // any further work. Only a difference in query parameter ordering can survive a mismatch here.\n if (a.href === b.href) {\n return true;\n }\n return (a.protocol === b.protocol\n && a.username === b.username\n && a.password === b.password\n // `host` covers both the hostname and the port.\n && a.host === b.host\n && a.pathname === b.pathname\n && a.hash === b.hash\n && areSearchParamsEqual(a.searchParams, b.searchParams));\n}\n/**\n * Whether the search params passed are equal in value.\n *\n * @note\n * Order is not significant, matching how the other unordered collections in the library are\n * compared. Repeated keys are, so this is a comparison of multisets rather than of sets:\n * `a=1&a=2` is equal to `a=2&a=1`, but not to `a=1&a=1`.\n */\nfunction areSearchParamsEqual(a, b) {\n const serializedA = a.toString();\n const serializedB = b.toString();\n // Identical serializations are equal under any ordering, and this is by far the common case, so\n // it is worth checking before sorting anything.\n return serializedA === serializedB || sortSearchParams(serializedA) === sortSearchParams(serializedB);\n}\n/**\n * Reorder a serialized query string so that params holding the same pairs compare as equal\n * regardless of the order they appear in.\n *\n * @note\n * The serializer percent-encodes `&` and `=` wherever they appear inside a name or a value, so\n * splitting on `&` recovers exactly the pairs and nothing else.\n */\nfunction sortSearchParams(serialized) {\n return serialized.split('&').sort().join('&');\n}\nfunction isPropertyEqual(a, b, state, property) {\n if ((property === REACT_OWNER || property === PREACT_OWNER || property === PREACT_VNODE)\n && (a.$$typeof || b.$$typeof)) {\n return true;\n }\n return hasOwn(b, property) && state.equals(a[property], b[property], property, property, a, b, state);\n}\n\nconst toString = Object.prototype.toString;\n/**\n * Create a comparator method based on the type-specific equality comparators passed.\n */\nfunction createEqualityComparator(config) {\n const supportedComparatorMap = createSupportedComparatorMap(config);\n const { areArraysEqual, areDatesEqual, areFunctionsEqual, areMapsEqual, areNumbersEqual, areObjectsEqual, areRegExpsEqual, areSetsEqual, getUnsupportedCustomComparator, } = config;\n /**\n * compare the value of the two objects and return true if they are equivalent in values\n */\n return function comparator(a, b, state) {\n // If the items are strictly equal, no need to do a value comparison.\n if (a === b) {\n return true;\n }\n // If either of the items are nullish and fail the strictly equal check\n // above, then they must be unequal.\n if (a == null || b == null) {\n return false;\n }\n const type = typeof a;\n if (type !== typeof b) {\n return false;\n }\n if (type !== 'object') {\n if (type === 'number' || type === 'bigint') {\n return areNumbersEqual(a, b, state);\n }\n if (type === 'function') {\n return areFunctionsEqual(a, b, state);\n }\n // If a primitive value that is not strictly equal, it must be unequal.\n return false;\n }\n const constructor = a.constructor;\n // Checks are listed in order of commonality of use-case:\n // 1. Common complex object types (plain object, array)\n // 2. Common data values (date, regexp)\n // 3. Less-common complex object types (map, set)\n // 4. Less-common data values (promise, primitive wrappers)\n // Inherently this is both subjective and assumptive, however\n // when reviewing comparable libraries in the wild this order\n // appears to be generally consistent.\n // Constructors should match, otherwise there is potential for false positives\n // between class and subclass or custom object and POJO.\n if (constructor !== b.constructor) {\n return false;\n }\n // Try to fast-path equality checks for other complex object types in the\n // same realm to avoid capturing the string tag. Strict equality is used\n // instead of `instanceof` because it is more performant for the common\n // use-case. If someone is creating a subclass from a native class, it will be\n // handled with the string tag comparison.\n if (constructor === Object) {\n return areObjectsEqual(a, b, state);\n }\n if (constructor === Array) {\n return areArraysEqual(a, b, state);\n }\n if (constructor === Date) {\n return areDatesEqual(a, b, state);\n }\n if (constructor === RegExp) {\n return areRegExpsEqual(a, b, state);\n }\n if (constructor === Map) {\n return areMapsEqual(a, b, state);\n }\n if (constructor === Set) {\n return areSetsEqual(a, b, state);\n }\n if (constructor === Promise) {\n // Avoid tag checks for promise values, since we know if they are not referentially equal\n // then they are not equal.\n return false;\n }\n // `isArray()` works on subclasses and is cross-realm, so we can avoid capturing\n // the string tag or doing an `instanceof` in edge cases.\n if (Array.isArray(a)) {\n return areArraysEqual(a, b, state);\n }\n // Since this is a custom object, capture the string tag to determining its type.\n // This is reasonably performant in modern environments like v8 and SpiderMonkey.\n const tag = toString.call(a);\n const supportedComparator = supportedComparatorMap[tag];\n if (supportedComparator) {\n return supportedComparator(a, b, state);\n }\n const unsupportedCustomComparator = getUnsupportedCustomComparator && getUnsupportedCustomComparator(a, b, state, tag);\n if (unsupportedCustomComparator) {\n return unsupportedCustomComparator(a, b, state);\n }\n // If not matching any tags that require a specific type of comparison, then we hard-code false because\n // the only thing remaining is strict equality, which has already been compared. This is for a few reasons:\n // - Certain types that cannot be introspected (e.g., `WeakMap`). For these types, this is the only\n // comparison that can be made.\n // - For types that can be introspected but do not have an objective definition of what\n // equality is (`Error`, etc.), the subjective decision is to be conservative and strictly compare.\n // In all cases, these decisions should be reevaluated based on changes to the language and\n // common development practices.\n return false;\n };\n}\n/**\n * Create the configuration object used for building comparators.\n */\nfunction createEqualityComparatorConfig({ circular, createCustomConfig, strict, }) {\n let config = {\n areArrayBuffersEqual,\n areArraysEqual: strict ? areObjectsEqualStrict : areArraysEqual,\n areDataViewsEqual,\n areDatesEqual: areDatesEqual,\n // `Error` subclasses routinely carry their own enumerable properties (`status`, `code`, ...),\n // which the error comparator alone does not see, so it is composed with the object comparator.\n // `name` / `message` / `stack` are own but not enumerable, which is why errors need a\n // comparator of their own rather than being treated as plain objects in the first place.\n areErrorsEqual: strict\n ? combineComparators(areErrorsEqual, areObjectsEqualStrict)\n : combineComparators(areErrorsEqual, areObjectsEqual),\n areFunctionsEqual: strictEqual,\n areMapsEqual: strict ? combineComparators(areMapsEqual, areObjectsEqualStrict) : areMapsEqual,\n areNumbersEqual: sameValueEqual,\n areObjectsEqual: strict ? areObjectsEqualStrict : areObjectsEqual,\n arePrimitiveWrappersEqual: arePrimitiveWrappersEqual,\n areRegExpsEqual: areRegExpsEqual,\n areSetsEqual: strict ? combineComparators(areSetsEqual, areObjectsEqualStrict) : areSetsEqual,\n areTypedArraysEqual: strict\n ? combineComparators(areTypedArraysEqual, areObjectsEqualStrict)\n : areTypedArraysEqual,\n areUrlsEqual: areUrlsEqual,\n getUnsupportedCustomComparator: undefined,\n };\n if (createCustomConfig) {\n config = Object.assign({}, config, createCustomConfig(config));\n }\n if (circular) {\n const areArraysEqual = createIsCircular(config.areArraysEqual);\n // Errors are included because comparing `cause` and own properties by value means an error\n // that references itself would otherwise recurse without bound.\n const areErrorsEqual = createIsCircular(config.areErrorsEqual);\n const areMapsEqual = createIsCircular(config.areMapsEqual);\n const areObjectsEqual = createIsCircular(config.areObjectsEqual);\n const areSetsEqual = createIsCircular(config.areSetsEqual);\n config = Object.assign({}, config, {\n areArraysEqual,\n areErrorsEqual,\n areMapsEqual,\n areObjectsEqual,\n areSetsEqual,\n });\n }\n return config;\n}\n/**\n * Default equality comparator pass-through, used as the standard `isEqual` creator for\n * use inside the built comparator.\n */\nfunction createInternalEqualityComparator(compare) {\n return function (a, b, _indexOrKeyA, _indexOrKeyB, _parentA, _parentB, state) {\n return compare(a, b, state);\n };\n}\n/**\n * Create the `isEqual` function used by the consuming application.\n */\nfunction createIsEqual({ circular, comparator, createState, equals, strict }) {\n if (createState) {\n return function isEqual(a, b) {\n const { cache = circular ? new WeakMap() : undefined, meta } = createState();\n return comparator(a, b, {\n cache,\n equals,\n meta,\n strict,\n });\n };\n }\n if (circular) {\n return function isEqual(a, b) {\n return comparator(a, b, {\n cache: new WeakMap(),\n equals,\n meta: undefined,\n strict,\n });\n };\n }\n const state = {\n cache: undefined,\n equals,\n meta: undefined,\n strict,\n };\n return function isEqual(a, b) {\n return comparator(a, b, state);\n };\n}\n/**\n * Create a map of `toString()` values to their respective handlers for `tag`-based lookups.\n */\nfunction createSupportedComparatorMap({ areArrayBuffersEqual, areArraysEqual, areDataViewsEqual, areDatesEqual, areErrorsEqual, areFunctionsEqual, areMapsEqual, areObjectsEqual, arePrimitiveWrappersEqual, areRegExpsEqual, areSetsEqual, areTypedArraysEqual, areUrlsEqual, }) {\n return {\n '[object Arguments]': areObjectsEqual,\n '[object Array]': areArraysEqual,\n '[object ArrayBuffer]': areArrayBuffersEqual,\n '[object AsyncGeneratorFunction]': areFunctionsEqual,\n '[object BigInt]': arePrimitiveWrappersEqual,\n '[object BigInt64Array]': areTypedArraysEqual,\n '[object BigUint64Array]': areTypedArraysEqual,\n '[object Boolean]': arePrimitiveWrappersEqual,\n '[object DataView]': areDataViewsEqual,\n '[object Date]': areDatesEqual,\n // If an error tag, it should be tested explicitly. Like RegExp, the properties are not\n // enumerable, and therefore will give false positives if tested like a standard object.\n '[object Error]': areErrorsEqual,\n '[object Float16Array]': areTypedArraysEqual,\n '[object Float32Array]': areTypedArraysEqual,\n '[object Float64Array]': areTypedArraysEqual,\n '[object Function]': areFunctionsEqual,\n '[object GeneratorFunction]': areFunctionsEqual,\n '[object Int8Array]': areTypedArraysEqual,\n '[object Int16Array]': areTypedArraysEqual,\n '[object Int32Array]': areTypedArraysEqual,\n '[object Map]': areMapsEqual,\n '[object Number]': arePrimitiveWrappersEqual,\n '[object Object]': (a, b, state) => \n // The exception for value comparison is custom `Promise`-like class instances. These should\n // be treated the same as standard `Promise` objects, which means strict equality, and if\n // it reaches this point then that strict equality comparison has already failed.\n typeof a.then !== 'function' && typeof b.then !== 'function' && areObjectsEqual(a, b, state),\n // For RegExp, the properties are not enumerable, and therefore will give false positives if\n // tested like a standard object.\n '[object RegExp]': areRegExpsEqual,\n '[object Set]': areSetsEqual,\n '[object String]': arePrimitiveWrappersEqual,\n '[object URL]': areUrlsEqual,\n '[object Uint8Array]': areTypedArraysEqual,\n '[object Uint8ClampedArray]': areTypedArraysEqual,\n '[object Uint16Array]': areTypedArraysEqual,\n '[object Uint32Array]': areTypedArraysEqual,\n };\n}\n\n/**\n * Whether the items passed are deeply-equal in value.\n */\nconst deepEqual = createCustomEqual();\n/**\n * Whether the items passed are deeply-equal in value based on strict comparison.\n */\nconst strictDeepEqual = createCustomEqual({ strict: true });\n/**\n * Whether the items passed are deeply-equal in value, including circular references.\n */\nconst circularDeepEqual = createCustomEqual({ circular: true });\n/**\n * Whether the items passed are deeply-equal in value, including circular references,\n * based on strict comparison.\n */\nconst strictCircularDeepEqual = createCustomEqual({\n circular: true,\n strict: true,\n});\n/**\n * Whether the items passed are shallowly-equal in value.\n */\nconst shallowEqual = createCustomEqual({\n createInternalComparator: () => sameValueEqual,\n});\n/**\n * Whether the items passed are shallowly-equal in value based on strict comparison\n */\nconst strictShallowEqual = createCustomEqual({\n strict: true,\n createInternalComparator: () => sameValueEqual,\n});\n/**\n * Whether the items passed are shallowly-equal in value, including circular references.\n */\nconst circularShallowEqual = createCustomEqual({\n circular: true,\n createInternalComparator: () => sameValueEqual,\n});\n/**\n * Whether the items passed are shallowly-equal in value, including circular references,\n * based on strict comparison.\n */\nconst strictCircularShallowEqual = createCustomEqual({\n circular: true,\n createInternalComparator: () => sameValueEqual,\n strict: true,\n});\n/**\n * Create a custom equality comparison method.\n *\n * This can be done to create very targeted comparisons in extreme hot-path scenarios\n * where the standard methods are not performant enough, but can also be used to provide\n * support for legacy environments that do not support expected features like\n * `RegExp.prototype.flags` out of the box.\n */\nfunction createCustomEqual(options = {}) {\n const { circular = false, createInternalComparator: createCustomInternalComparator, createState, strict = false, } = options;\n const config = createEqualityComparatorConfig(options);\n const comparator = createEqualityComparator(config);\n const equals = createCustomInternalComparator\n ? createCustomInternalComparator(comparator)\n : createInternalEqualityComparator(comparator);\n return createIsEqual({ circular, comparator, createState, equals, strict });\n}\n\nexport { circularDeepEqual, circularShallowEqual, createCustomEqual, deepEqual, sameValueEqual, sameValueZeroEqual, shallowEqual, strictCircularDeepEqual, strictCircularShallowEqual, strictDeepEqual, strictEqual, strictShallowEqual };\n","import { createCustomEqual } from 'fast-equals';\n\n/** Implements a deep equals using `fast-equals.createCustomEqual`. Functions\n * are always considered equal, and circular references are tracked to avoid\n * infinite recursion on self-referential inputs.\n *\n * @param a - The first element to compare\n * @param b - The second element to compare\n * @returns - True if the `a` and `b` are deeply equal, false otherwise\n */\nconst deepEquals = createCustomEqual({\n circular: true,\n createCustomConfig: () => ({\n areFunctionsEqual(_a, b) {\n return typeof b === 'function';\n },\n }),\n});\n\nexport default deepEquals;\n","import UriResolver from 'fast-uri';\nimport jsonpointer from 'jsonpointer';\n\nimport {\n ALL_OF_KEY,\n ID_KEY,\n JSON_SCHEMA_DRAFT_2019_09,\n JSON_SCHEMA_DRAFT_2020_12,\n REF_KEY,\n SCHEMA_KEY,\n} from './constants.ts';\nimport isObject from './isObject.ts';\nimport type { GenericObjectType, RJSFSchema, StrictRJSFSchema } from './types.ts';\n\n/** Looks for the `$id` pointed by `ref` in the schema definitions embedded in\n * a JSON Schema bundle\n *\n * @param schema - The schema wherein `ref` should be searched\n * @param ref - The `$id` of the reference to search for\n * @returns - The schema matching the reference, or `undefined` if no match is found\n */\nfunction findEmbeddedSchemaRecursive<S extends StrictRJSFSchema = RJSFSchema>(schema: S, ref: string): S | undefined {\n if (ID_KEY in schema && UriResolver.equal(schema[ID_KEY] as string, ref)) {\n return schema;\n }\n for (const subSchema of Object.values(schema)) {\n if (Array.isArray(subSchema)) {\n for (const item of subSchema) {\n if (isObject(item)) {\n const result = findEmbeddedSchemaRecursive<S>(item as S, ref);\n if (result !== undefined) {\n return result;\n }\n }\n }\n } else if (isObject(subSchema)) {\n const result = findEmbeddedSchemaRecursive<S>(subSchema as S, ref);\n if (result !== undefined) {\n return result;\n }\n }\n }\n return undefined;\n}\n\n/** Parses a JSONSchema and makes all references absolute with respect to\n * the `baseURI` argument\n * @param schema - The schema to be processed\n * @param baseURI - The base URI to be used for resolving relative references\n */\nexport function makeAllReferencesAbsolute<S extends StrictRJSFSchema = RJSFSchema>(schema: S, baseURI: string): S {\n const currentURI = schema[ID_KEY] ?? baseURI;\n let result = schema;\n // Make all other references absolute\n if (REF_KEY in result) {\n result = { ...result, [REF_KEY]: UriResolver.resolve(currentURI, result[REF_KEY]!) };\n }\n // Look for references in nested subschemas\n for (const [key, subSchema] of Object.entries(result)) {\n if (Array.isArray(subSchema)) {\n result = {\n ...result,\n [key]: subSchema.map((item) => (isObject(item) ? makeAllReferencesAbsolute(item as S, currentURI) : item)),\n };\n } else if (isObject(subSchema)) {\n result = { ...result, [key]: makeAllReferencesAbsolute(subSchema as S, currentURI) };\n }\n }\n return result;\n}\n\n/** Splits out the value at the `key` in `object` from the `object`, returning an array that contains in the first\n * location, the `object` minus the `key: value` and in the second location the `value`.\n *\n * @param key - The key from the object to extract\n * @param object - The object from which to extract the element\n * @returns - An array with the first value being the object minus the `key` element and the second element being the\n * value from `object[key]`\n */\nexport function splitKeyElementFromObject(key: string, object: GenericObjectType) {\n const { [key]: value, ...remaining } = object;\n return [remaining, value];\n}\n\n/** Given the name of a `$ref` from within a schema, using the `rootSchema`, recursively look up and return the\n * sub-schema using the path provided by that reference. If `#` is not the first character of the reference, the path\n * does not exist in the schema, or the reference resolves circularly back to itself, then throw an Error.\n * Otherwise return the sub-schema. Also deals with nested `$ref`s in the sub-schema.\n *\n * @param $ref - The ref string for which the schema definition is desired\n * @param [rootSchema={}] - The root schema in which to search for the definition\n * @param recurseList - List of $refs already resolved to prevent recursion\n * @param [baseURI=rootSchema['$id']] - The base URI to be used for resolving relative references\n * @returns - The sub-schema within the `rootSchema` which matches the `$ref` if it exists\n * @throws - Error indicating that no schema for that reference could be resolved\n */\nexport function findSchemaDefinitionRecursive<S extends StrictRJSFSchema = RJSFSchema>(\n $ref?: string,\n rootSchema: S = {} as S,\n recurseList: string[] = [],\n baseURI: string | undefined = rootSchema[ID_KEY],\n): S {\n const ref = $ref || '';\n let current: S | undefined = undefined;\n let currentBaseURI = baseURI;\n if (ref.startsWith('#')) {\n // Decode URI fragment representation.\n const decodedRef = decodeURIComponent(ref.substring(1));\n if (currentBaseURI === undefined || (ID_KEY in rootSchema && rootSchema[ID_KEY] === currentBaseURI)) {\n current = jsonpointer.get(rootSchema, decodedRef);\n } else if (rootSchema[SCHEMA_KEY] === JSON_SCHEMA_DRAFT_2020_12) {\n current = findEmbeddedSchemaRecursive<S>(rootSchema, currentBaseURI.replace(/\\/$/, ''));\n if (current !== undefined) {\n current = jsonpointer.get(current, decodedRef);\n }\n }\n } else if (rootSchema[SCHEMA_KEY] === JSON_SCHEMA_DRAFT_2020_12) {\n const resolvedRef = currentBaseURI ? UriResolver.resolve(currentBaseURI, ref) : ref;\n const [refId, ...refAnchor] = resolvedRef.replace(/#\\/?$/, '').split('#');\n current = findEmbeddedSchemaRecursive<S>(rootSchema, refId.replace(/\\/$/, ''));\n if (current !== undefined) {\n currentBaseURI = current[ID_KEY];\n if (refAnchor.length > 0) {\n current = jsonpointer.get(current, decodeURIComponent(refAnchor.join('#')));\n }\n }\n }\n if (current === undefined) {\n throw new Error(`Could not find a definition for ${$ref}.`);\n }\n const nextRef = current[REF_KEY];\n if (nextRef) {\n // Check for circular references.\n if (recurseList.includes(nextRef)) {\n if (recurseList.length === 1) {\n throw new Error(`Definition for ${$ref} is a circular reference`);\n }\n const [firstRef, ...restRefs] = recurseList;\n const circularPath = [...restRefs, ref, firstRef].join(' -> ');\n throw new Error(`Definition for ${firstRef} contains a circular reference through ${circularPath}`);\n }\n const [remaining, theRef] = splitKeyElementFromObject(REF_KEY, current);\n const subSchema = findSchemaDefinitionRecursive<S>(theRef, rootSchema, [...recurseList, ref], currentBaseURI);\n if (Object.keys(remaining).length > 0) {\n if (\n rootSchema[SCHEMA_KEY] === JSON_SCHEMA_DRAFT_2019_09 ||\n rootSchema[SCHEMA_KEY] === JSON_SCHEMA_DRAFT_2020_12\n ) {\n return { [ALL_OF_KEY]: [remaining, subSchema] } as S;\n }\n return { ...remaining, ...subSchema };\n }\n return subSchema;\n }\n return current;\n}\n\n/** Given the name of a `$ref` from within a schema, using the `rootSchema`, look up and return the sub-schema using the\n * path provided by that reference. If `#` is not the first character of the reference, the path does not exist in\n * the schema, or the reference resolves circularly back to itself, then throw an Error. Otherwise return the\n * sub-schema. Also deals with nested `$ref`s in the sub-schema.\n *\n * @param $ref - The ref string for which the schema definition is desired\n * @param [rootSchema={}] - The root schema in which to search for the definition\n * @param [baseURI=rootSchema['$id']] - The base URI to be used for resolving relative references\n * @returns - The sub-schema within the `rootSchema` which matches the `$ref` if it exists\n * @throws - Error indicating that no schema for that reference could be resolved\n */\nexport default function findSchemaDefinition<S extends StrictRJSFSchema = RJSFSchema>(\n $ref?: string,\n rootSchema: S = {} as S,\n baseURI: string | undefined = rootSchema[ID_KEY],\n): S {\n const recurseList: string[] = [];\n return findSchemaDefinitionRecursive($ref, rootSchema, recurseList, baseURI);\n}\n","import type { FieldPathList } from './types.ts';\n\n/** A path into an object: either a list of path segments or a single property key (string or number).\n * A bare string is ALWAYS treated as one literal key — `'a.b'` is the key `'a.b'`, not a deep path. To\n * traverse a dotted path string, convert it explicitly with {@link toPath}\n */\nexport type ObjectPath = string | number | FieldPathList;\n\n/** Matches unsigned integer strings that represent valid array indexes */\nconst reIsIndex = /^(?:0|[1-9]\\d*)$/;\n\n/** Converts a dotted path string, such as produced for validation error properties, into its list of\n * path segments. Array indexes may be written bracketed (`'a[0].b'`) or dotted (`'a.0.b'`), and empty\n * segments — from a leading `.`, a trailing `.` or a `..` run — are dropped.\n *\n * Only the grammar RJSF itself produces is supported: dots and brackets are always separators, so\n * quoted keys are not recognized and keys containing dots must be addressed with a segment list\n * instead of a string.\n *\n * @param path - The string path to convert, such as `'.level1.level2[2].level3'`\n * @returns - The list of path segments, such as `['level1', 'level2', '2', 'level3']`\n */\nexport function toPath(path: string): string[] {\n return path.split(/[.[\\]]+/).filter(Boolean);\n}\n\n/** Normalizes an `ObjectPath` into a list of path segments, wrapping a single key into a one-element list */\nfunction normalizePath(path: ObjectPath): FieldPathList {\n return Array.isArray(path) ? path : [path];\n}\n\n/** Determines whether a path segment could mutate the prototype chain. Only `__proto__` can: assigning to it\n * invokes the prototype setter rather than creating an own property. `constructor` and `prototype` are safe\n * here — and are legal JSON Schema property names — because both reads and writes below are own-property-only,\n * so `['constructor', 'prototype', 'polluted']` shadows `constructor` with a fresh object instead of walking\n * into `Object.prototype`. Only writes need this check; reads are already own-property-only\n */\nfunction isUnsafeSegment(segment: string | number): boolean {\n return segment === '__proto__';\n}\n\n/** Determines whether a path segment represents a valid array index */\nfunction isIndex(segment: string | number): boolean {\n return typeof segment === 'number' ? Number.isInteger(segment) && segment >= 0 : reIsIndex.test(segment);\n}\n\n/** Determines whether `value` can hold properties, i.e. is an object (arrays included) or a function */\nfunction isSettable(value: unknown): value is Record<PropertyKey, unknown> {\n return value != null && (typeof value === 'object' || typeof value === 'function');\n}\n\n/** Gets the value at `path` of `obj`, returning `defaultValue` when the resolved value is `undefined`\n *\n * Every segment must be an OWN property, matching {@link hasByPath}, so the two can be used as a\n * guard/read pair. Inherited members are never resolved: `getByPath({}, 'toString')` returns\n * `defaultValue`, not `Function.prototype.toString`. For the plain form data and schemas RJSF navigates,\n * an inherited member is never data, and the own-property rule also makes prototype internals such as\n * `__proto__` unreachable unless they are genuine own data keys\n *\n * An empty segment list resolves to nothing, so `defaultValue` is returned. This matches {@link hasByPath},\n * which is `false` for an empty path, and keeps a computed-but-empty path (`toPath('')` for a root-level\n * validation error, say) from resolving to the whole object\n *\n * The value at a runtime-computed path cannot be known statically, so `R` is the CALLER'S declaration of\n * the expected type (like `Map.get()`); it defaults to `unknown`, which forces narrowing when no type is given\n *\n * @param obj - The object to query\n * @param path - The single key or list of path segments at which to get the value\n * @param [defaultValue] - The value returned when the resolved value is `undefined`\n * @returns - The resolved value, otherwise `defaultValue`\n */\nexport function getByPath<R = unknown>(obj: unknown, path: ObjectPath, defaultValue?: R): R {\n let current: unknown;\n if (!Array.isArray(path)) {\n // Fast path for the most common call shape, a single constant key, avoiding the segment-list allocation\n current = isSettable(obj) && Object.hasOwn(obj, path) ? obj[path] : undefined;\n } else if (path.length === 0) {\n // An empty path resolves to nothing, mirroring `hasByPath()`\n current = undefined;\n } else {\n current = obj;\n for (let i = 0; i < path.length; i++) {\n const segment = path[i];\n // Only own data keys resolve, so inherited members and prototype internals are never read\n if (!isSettable(current) || !Object.hasOwn(current, segment)) {\n current = undefined;\n break;\n }\n current = current[segment];\n }\n }\n // The single deliberate cast in these utilities: the resolved value is trusted to be the `R` the caller declared\n return (current === undefined ? defaultValue : current) as R;\n}\n\n/** Sets `value` at `path` of `obj`, mutating and returning `obj`. Missing intermediate containers are\n * created: arrays when the next segment is a valid array index, plain objects otherwise (or always plain\n * objects when `createIntermediateObjects` is true)\n *\n * A `__proto__` segment is refused in any position — assigning to it would mutate the prototype chain rather\n * than create an own property — and the write is silently skipped. Every other key, `constructor` and\n * `prototype` included, is written as an own property\n *\n * @param obj - The object to modify\n * @param path - The single key or list of path segments at which to set the value\n * @param value - The value to set\n * @param [createIntermediateObjects] - When true, always create plain objects for missing intermediate\n * containers, even for numeric path segments\n * @returns - The mutated `obj`\n */\nexport function setByPath<O>(obj: O, path: ObjectPath, value: unknown, createIntermediateObjects = false): O {\n if (!isSettable(obj)) {\n return obj;\n }\n // Fast path for a single constant key, avoiding the segment-list allocation\n if (!Array.isArray(path)) {\n // Refuse a segment that could mutate the prototype chain (prototype pollution)\n if (!isUnsafeSegment(path)) {\n const target: Record<PropertyKey, unknown> = obj;\n target[path] = value;\n }\n return obj;\n }\n const segments = path;\n // Refuse paths that could mutate the prototype chain (prototype pollution)\n if (segments.some(isUnsafeSegment)) {\n return obj;\n }\n let current: Record<PropertyKey, unknown> = obj;\n for (let i = 0; i < segments.length; i++) {\n const segment = segments[i];\n if (i === segments.length - 1) {\n current[segment] = value;\n } else {\n // Own properties only, so an inherited member is never traversed into\n const existing = Object.hasOwn(current, segment) ? current[segment] : undefined;\n if (isSettable(existing)) {\n current = existing;\n } else {\n const next = createIntermediateObjects || !isIndex(segments[i + 1]) ? {} : [];\n current[segment] = next;\n /* v8 ignore next -- a fresh {} or [] is always settable; the guard exists only to narrow the type */\n if (isSettable(next)) {\n current = next;\n }\n }\n }\n }\n return obj;\n}\n\n/** Determines whether `obj` has an own property at `path`\n *\n * Every segment is checked with `Object.hasOwn()`, so inherited properties report `false` —\n * `hasByPath({}, 'toString')` is `false`. {@link getByPath} applies the same own-property rule, so the\n * two can be used as a guard/read pair\n *\n * @param obj - The object to query\n * @param path - The single key or list of path segments to check for\n * @returns - True if the own property exists at `path`, otherwise false\n */\nexport function hasByPath(obj: unknown, path: ObjectPath): boolean {\n // Fast path for a single constant key, avoiding the segment-list allocation\n if (!Array.isArray(path)) {\n return isSettable(obj) && Object.hasOwn(obj, path);\n }\n let current: unknown = obj;\n for (let i = 0; i < path.length; i++) {\n if (!isSettable(current) || !Object.hasOwn(current, path[i])) {\n return false;\n }\n current = current[path[i]];\n }\n return path.length > 0;\n}\n\n/** Removes the own property at `path` of `obj`, mutating `obj`\n *\n * Both the parent lookup and the delete are own-property-only, so no segment can reach the prototype chain and\n * no `UNSAFE_SEGMENTS`-style guard is needed: deleting a `__proto__` that is not an own property is a no-op\n *\n * @param obj - The object to modify\n * @param path - The single key or list of path segments at which to remove the property\n * @returns - True if the property was removed or did not exist, otherwise false\n */\nexport function unsetByPath(obj: unknown, path: ObjectPath): boolean {\n const segments = normalizePath(path);\n // An empty path names no property, so there is nothing to remove\n if (segments.length === 0) {\n return true;\n }\n const parent = segments.length > 1 ? getByPath(obj, segments.slice(0, -1)) : obj;\n if (parent == null) {\n return true;\n }\n try {\n // Returns false for a non-configurable property instead of throwing like `delete` in strict mode\n return Reflect.deleteProperty(parent, segments[segments.length - 1]);\n } catch {\n // Reflect.deleteProperty throws when the target is a primitive\n return false;\n }\n}\n","import { DISCRIMINATOR_PATH } from './constants.ts';\nimport { getByPath } from './pathUtils.ts';\nimport type { RJSFSchema, StrictRJSFSchema } from './types.ts';\n\n/** Returns the `discriminator.propertyName` when defined in the `schema` if it is a string. A warning is generated when\n * it is not a string. Returns `undefined` when a valid discriminator is not present.\n *\n * @param schema - The schema from which the discriminator is potentially obtained\n * @returns - The `discriminator.propertyName` if it exists in the schema, otherwise `undefined`\n */\nexport default function getDiscriminatorFieldFromSchema<S extends StrictRJSFSchema = RJSFSchema>(schema: S) {\n let discriminator: string | undefined;\n const maybeString = getByPath(schema, DISCRIMINATOR_PATH);\n if (typeof maybeString === 'string') {\n discriminator = maybeString;\n } else if (maybeString !== undefined) {\n // oxlint-disable-next-line no-console\n console.warn(`Expecting discriminator to be a string, got \"${typeof maybeString}\" instead`);\n }\n return discriminator;\n}\n","/** Given a specific `value` attempts to guess the type of a schema element. In the case where we have to implicitly\n * create a schema, it is useful to know what type to use based on the data we are defining.\n *\n * @param value - The value from which to guess the type\n * @returns - The best guess for the object type\n */\nexport default function guessType(value: any) {\n if (Array.isArray(value)) {\n return 'array';\n }\n if (typeof value === 'string') {\n return 'string';\n }\n if (value == null) {\n return 'null';\n }\n if (typeof value === 'boolean') {\n return 'boolean';\n }\n if (typeof value === 'number' && !Number.isNaN(value)) {\n return 'number';\n }\n if (typeof value === 'object') {\n return 'object';\n }\n // Default to string if we can't figure it out\n return 'string';\n}\n","import guessType from './guessType.ts';\nimport type { RJSFSchema, StrictRJSFSchema } from './types.ts';\n\n/** Gets the type of a given `schema`. If the type is not explicitly defined, then an attempt is made to infer it from\n * other elements of the schema as follows:\n * - schema.const: Returns the `guessType()` of that value\n * - schema.enum: Returns `string`\n * - schema.properties: Returns `object`\n * - schema.additionalProperties: Returns `object`\n * - schema.patternProperties: Returns `object`\n * - type is an array with a length of 2 and one type is 'null': Returns the other type\n *\n * @param schema - The schema for which to get the type\n * @returns - The type of the schema\n */\nexport default function getSchemaType<S extends StrictRJSFSchema = RJSFSchema>(\n schema: S,\n): string | string[] | undefined {\n let { type } = schema;\n\n if (!type && schema.const) {\n return guessType(schema.const);\n }\n\n if (!type && schema.enum) {\n return 'string';\n }\n\n if (!type && (schema.properties || schema.additionalProperties || schema.patternProperties)) {\n return 'object';\n }\n\n if (Array.isArray(type)) {\n if (type.length === 2 && type.includes('null')) {\n type = type.find((t) => t !== 'null');\n } else {\n // oxlint-disable-next-line prefer-destructuring\n type = type[0];\n }\n }\n\n return type;\n}\n","import { REQUIRED_KEY } from './constants.ts';\nimport getSchemaType from './getSchemaType.ts';\nimport isObject from './isObject.ts';\nimport type { GenericObjectType, GenericSymbolObjectType } from './types.ts';\n\n/** Recursively merge deeply nested schemas. The difference between `mergeSchemas` and `mergeObjects` is that\n * `mergeSchemas` only concats arrays for values under the 'required' keyword, and when it does, it doesn't include\n * duplicate values.\n *\n * @param obj1 - The first schema object to merge\n * @param obj2 - The second schema object to merge\n * @returns - The merged schema object\n */\nexport default function mergeSchemas(obj1: GenericObjectType, obj2: GenericObjectType) {\n const acc = { ...obj1 }; // Prevent mutation of source object.\n const result = Object.keys(obj2).reduce((accumulator, key) => {\n const left = obj1 ? obj1[key] : {},\n right = obj2[key];\n if (obj1 && key in obj1 && isObject(right)) {\n accumulator[key] = mergeSchemas(left, right);\n } else if (\n obj1 &&\n obj2 &&\n (getSchemaType(obj1) === 'object' || getSchemaType(obj2) === 'object') &&\n key === REQUIRED_KEY &&\n Array.isArray(left) &&\n Array.isArray(right)\n ) {\n // Don't include duplicate values when merging 'required' fields.\n accumulator[key] = [...new Set([...left, ...right])];\n } else {\n accumulator[key] = right;\n }\n return accumulator;\n }, acc);\n // Copy own Symbol-keyed properties from obj2 (Object.keys skips them).\n for (const sym of Object.getOwnPropertySymbols(obj2)) {\n // To avoid issues with symbols, we cast them to GenericSymbolObjectType. If we make the mergeSchema function take\n // in GenericSymbolObjectType rather than GenericObjectType, it causes a bunch of type errors downstream\n (result as GenericSymbolObjectType)[sym] = (obj2 as GenericSymbolObjectType)[sym];\n }\n return result;\n}\n","import { PROPERTIES_KEY } from './constants.ts';\nimport type { RJSFSchema, StrictRJSFSchema } from './types.ts';\n\n/** Returns the sub-schema declared for `property` in the `properties` of `schema`, falling back to an empty schema\n * when the schema has no such property. Callers treat the properties of a schema as schemas of the same type `S`,\n * which the `JSONSchema7` typing of `properties` cannot express, so this function owns that single assertion rather\n * than repeating it at every lookup.\n *\n * @param schema - The schema, if any, from which to read the property sub-schema\n * @param property - The name of the property whose sub-schema is desired\n * @returns - The sub-schema for `property`, or an empty schema when it is not declared\n */\nexport default function getPropertySchema<S extends StrictRJSFSchema = RJSFSchema>(\n schema: S | undefined,\n property: string,\n): S {\n return (schema?.[PROPERTIES_KEY]?.[property] ?? {}) as S;\n}\n","import getPropertySchema from './getPropertySchema.ts';\nimport { getByPath } from './pathUtils.ts';\nimport type { RJSFSchema, StrictRJSFSchema } from './types.ts';\n\n/** Compares the value of `discriminatorField` within `formData` against the value of `discriminatorField` within schema for each `option`.\n * Returns index of first `option` whose discriminator matches formData. Returns `undefined` if there is no match.\n * This function does not work with discriminators of `\"type\": \"object\"` and `\"type\": \"array\"`\n *\n * @param formData - The current formData, if any, used to figure out a match\n * @param options - The list of options to find a matching options from\n * @param [discriminatorField] - The optional name of the field within the options object whose value is used to\n * determine which option is selected\n * @returns - The index of the matched option or undefined if there is no match\n */\nexport default function getOptionMatchingSimpleDiscriminator<T = any, S extends StrictRJSFSchema = RJSFSchema>(\n formData: T | undefined,\n options: S[],\n discriminatorField?: string,\n): number | undefined {\n if (formData && discriminatorField) {\n const value = getByPath(formData, discriminatorField);\n\n if (value === undefined) {\n return undefined;\n }\n\n for (let i = 0; i < options.length; i += 1) {\n const option = options[i];\n const discriminator = getPropertySchema<S>(option, discriminatorField);\n\n if (discriminator.type !== 'object' && discriminator.type !== 'array') {\n if (discriminator.const === value) {\n return i;\n }\n const enumValues: readonly unknown[] | undefined = discriminator.enum;\n if (enumValues?.includes(value)) {\n return i;\n }\n }\n }\n }\n return undefined;\n}\n","import { PROPERTIES_KEY } from '../constants.ts';\nimport getOptionMatchingSimpleDiscriminator from '../getOptionMatchingSimpleDiscriminator.ts';\nimport { getByPath } from '../pathUtils.ts';\nimport type { FormContextType, RJSFSchema, StrictRJSFSchema, ValidatorType } from '../types.ts';\n\n/** Given the `formData` and list of `options`, attempts to find the index of the first option that matches the data.\n * Always returns the first option if there is nothing that matches.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be used when necessary\n * @param formData - The current formData, if any, used to figure out a match\n * @param options - The list of options to find a matching options from\n * @param rootSchema - The root schema, used to primarily to look up `$ref`s\n * @param [discriminatorField] - The optional name of the field within the options object whose value is used to\n * determine which option is selected\n * @returns - The index of the first matched option or 0 if none is available\n */\nexport default function getFirstMatchingOption<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n validator: ValidatorType<T, S, F>,\n formData: T | undefined,\n options: S[],\n rootSchema: S,\n discriminatorField?: string,\n): number {\n // For performance, skip validating subschemas if formData is undefined. We just\n // want to get the first option in that case.\n if (formData === undefined) {\n return 0;\n }\n\n const simpleDiscriminatorMatch = getOptionMatchingSimpleDiscriminator(formData, options, discriminatorField);\n if (typeof simpleDiscriminatorMatch === 'number') {\n return simpleDiscriminatorMatch;\n }\n\n for (let i = 0; i < options.length; i += 1) {\n const option = options[i];\n\n // If we have a discriminator field, then we will use this to make the determination\n const discriminator = discriminatorField\n ? (option[PROPERTIES_KEY]?.[discriminatorField] as S | undefined)\n : undefined;\n if (discriminatorField && discriminator !== undefined) {\n const value = getByPath<T>(formData, discriminatorField);\n if (validator.isValid(discriminator, value, rootSchema)) {\n return i;\n }\n } else if (option[PROPERTIES_KEY]) {\n // If the schema describes an object then we need to add slightly more\n // strict matching to the schema, because unless the schema uses the\n // \"requires\" keyword, an object will match the schema as long as it\n // doesn't have matching keys with a conflicting type. To do this we use an\n // \"anyOf\" with an array of requires. This augmentation expresses that the\n // schema should match if any of the keys in the schema are present on the\n // object and pass validation.\n //\n // Create an \"anyOf\" schema that requires at least one of the keys in the\n // \"properties\" object\n const requiresAnyOf = {\n anyOf: Object.keys(option[PROPERTIES_KEY]).map((key) => ({\n required: [key],\n })),\n };\n\n let augmentedSchema;\n\n // If the \"anyOf\" keyword already exists, wrap the augmentation in an \"allOf\"\n if (option.anyOf) {\n // Create a shallow clone of the option\n const { ...shallowClone } = option;\n\n if (!shallowClone.allOf) {\n shallowClone.allOf = [];\n } else {\n // If \"allOf\" already exists, shallow clone the array\n shallowClone.allOf = shallowClone.allOf.slice();\n }\n\n shallowClone.allOf.push(requiresAnyOf);\n\n augmentedSchema = shallowClone;\n } else {\n augmentedSchema = { ...option, ...requiresAnyOf };\n }\n\n // Remove the \"required\" field as it's likely that not all fields have\n // been filled in yet, which will mean that the schema is not valid\n delete augmentedSchema.required;\n\n if (validator.isValid(augmentedSchema, formData, rootSchema)) {\n return i;\n }\n } else if (validator.isValid(option, formData, rootSchema)) {\n return i;\n }\n }\n return 0;\n}\n","export function isObject(value: unknown): value is object {\n return value !== null && typeof value === \"object\";\n}\n\nconst objProto = Object.prototype;\n\nexport function isRecordEmpty<R extends Record<string, any>>(\n rec: R | Record<string, never>\n): rec is Record<string, never> {\n for (const key in rec) {\n if (objProto.hasOwnProperty.call(rec, key)) {\n return false;\n }\n }\n return true;\n}\n","import type {\n JSONSchema7,\n JSONSchema7TypeName,\n JSONSchema7Definition,\n} from \"json-schema\";\n\nimport { isRecordEmpty } from \"../object.ts\";\n\nexport const JSON_SCHEMA_TYPE_NAMES: string[] = [\n \"array\",\n \"boolean\",\n \"integer\",\n \"null\",\n \"number\",\n \"object\",\n \"string\",\n] as const satisfies JSONSchema7TypeName[];\n\nexport const SET_OF_JSON_SCHEMA_TYPE_NAMES = new Set(JSON_SCHEMA_TYPE_NAMES);\n\nexport function isJsonSchemaType(type: string): type is JSONSchema7TypeName {\n return SET_OF_JSON_SCHEMA_TYPE_NAMES.has(type);\n}\n\ntype SchemaKeys = Array<keyof JSONSchema7>;\n\n// WARN: Order is important\nexport const RECORDS_OF_SUB_SCHEMAS = [\n \"$defs\",\n \"definitions\",\n \"properties\",\n \"patternProperties\",\n \"dependencies\",\n] as const satisfies SchemaKeys;\n\nexport const SET_OF_RECORDS_OF_SUB_SCHEMAS = new Set(RECORDS_OF_SUB_SCHEMAS);\n\nexport type SubSchemasRecordKey = (typeof RECORDS_OF_SUB_SCHEMAS)[number];\n\n// WARN: Order is important\nexport const ARRAYS_OF_SUB_SCHEMAS = [\n \"items\",\n \"allOf\",\n \"oneOf\",\n \"anyOf\",\n] as const satisfies SchemaKeys;\n\nexport const SET_OF_ARRAYS_OF_SUB_SCHEMAS = new Set(ARRAYS_OF_SUB_SCHEMAS);\n\nexport type SubSchemasArrayKey = (typeof ARRAYS_OF_SUB_SCHEMAS)[number];\n\n// WARN: Order is important\nexport const SUB_SCHEMAS = [\n \"items\",\n \"additionalItems\",\n \"additionalProperties\",\n \"propertyNames\",\n \"contains\",\n \"if\",\n \"then\",\n \"else\",\n \"not\",\n] as const satisfies SchemaKeys;\n\nexport const SET_OF_SUB_SCHEMAS = new Set(SUB_SCHEMAS);\n\nexport type SubSchemaKey = (typeof SUB_SCHEMAS)[number];\n\n// WARN: Order is important\nexport const ALL_SUB_SCHEMA_KEYS = [\n ...RECORDS_OF_SUB_SCHEMAS,\n ...ARRAYS_OF_SUB_SCHEMAS,\n ...SUB_SCHEMAS,\n];\n\nexport type AnySubSchemaKey = (typeof ALL_SUB_SCHEMA_KEYS)[number];\n\nexport type TransformedSchema<R, S> = Omit<S, AnySubSchemaKey> & {\n items?: R | R[] | undefined;\n additionalItems?: R | undefined;\n contains?: R | undefined;\n additionalProperties?: R | undefined;\n propertyNames?: R | undefined;\n if?: R | undefined;\n then?: R | undefined;\n else?: R | undefined;\n not?: R | undefined;\n // Records\n $defs?: Record<string, R> | undefined;\n properties?: Record<string, R> | undefined;\n patternProperties?: Record<string, R> | undefined;\n dependencies?: Record<string, R | string[]> | undefined;\n definitions?: Record<string, R> | undefined;\n // Arrays\n allOf?: R[] | undefined;\n anyOf?: R[] | undefined;\n oneOf?: R[] | undefined;\n};\n\nexport type TransformedSchemaDefinition<R, S> =\n TransformedSchema<R, S> | boolean;\n\nexport function isSchemaObject<D extends JSONSchema7Definition>(\n schemaDef: D\n): schemaDef is Exclude<D, boolean> {\n return typeof schemaDef === \"object\";\n}\n\nexport function isAllowAnySchema(\n def: JSONSchema7Definition\n): def is true | Record<string, never> {\n return isSchemaObject(def) ? isRecordEmpty(def) : def === true;\n}\n","export type Comparator<T> = (a: T, b: T) => number;\n\nexport interface ComparableTypes {\n number: number;\n string: string;\n boolean: boolean;\n bigint: bigint;\n}\n\nexport type Comparable = ComparableTypes[keyof ComparableTypes];\n\nexport function ascComparator<T extends Comparable>(a: T, b: T) {\n if (a < b) return -1;\n if (a > b) return 1;\n return 0;\n}\n","import type { Comparator } from \"./ord.ts\";\n\nexport function union<T>(larger: T[], smaller: T[]): T[] {\n const ll = larger.length;\n if (ll === 0) {\n return smaller;\n }\n let sl = smaller.length;\n if (sl === 0) {\n return larger;\n }\n if (ll < sl) {\n const tmp = larger;\n larger = smaller;\n smaller = tmp;\n sl = ll;\n }\n const data = new Set(larger);\n for (let i = 0; i < sl; i++) {\n data.add(smaller[i]!);\n }\n return Array.from(data);\n}\n\nexport function intersection<T>(a: T[], b: T[]): T[] {\n const result: T[] = [];\n\n if (a.length === 0 || b.length === 0) {\n return result;\n }\n\n if (a.length > b.length) {\n const tmp = a;\n a = b;\n b = tmp;\n }\n\n const setB = new Set(b);\n for (let i = 0; i < a.length && setB.size > 0; i++) {\n const val = a[i]!;\n if (setB.delete(val)) {\n result.push(val);\n }\n }\n\n return result;\n}\n\nexport function isArrayEmpty<T>(arr: T[]): arr is [] {\n return arr.length === 0;\n}\n\nexport function createArrayComparator<T>(compare: (a: T, b: T) => number) {\n return (a: T[], b: T[]) => {\n const d = a.length - b.length;\n if (d !== 0) {\n return d;\n }\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n const d = compare(a[i]!, b[i]!);\n if (d !== 0) {\n return d;\n }\n }\n }\n return 0;\n };\n}\n\n/**\n * Function type for removing duplicates from an array.\n */\nexport type Deduplicator<T> = (data: T[]) => T[];\n\nexport interface DeduplicatorOptions {\n /** @default 12 */\n threshold?: number;\n}\n\nexport function createDeduplicator<T>(\n compare: Comparator<T>,\n { threshold = 12 }: DeduplicatorOptions = {}\n): Deduplicator<T> {\n return (arr) => {\n const al = arr.length;\n\n if (al === 0) {\n return arr;\n }\n\n if (al <= threshold) {\n const result: T[] = [];\n let rl = 0;\n outer: for (let i = 0; i < al; i++) {\n const item = arr[i]!;\n for (let j = 0; j < rl; j++) {\n if (compare(item, result[j]!) === 0) {\n continue outer;\n }\n }\n rl = result.push(item);\n }\n return result;\n }\n\n const sorted = arr.slice().sort(compare);\n let wIndex = 0;\n\n for (let rIndex = 1; rIndex < al; rIndex++) {\n if (compare(sorted[wIndex]!, sorted[rIndex]!) !== 0) {\n if (++wIndex !== rIndex) {\n sorted[wIndex] = sorted[rIndex]!;\n }\n }\n }\n sorted.length = wIndex + 1;\n return sorted;\n };\n}\n\n/**\n * Function type for intersecting two arrays of the same type.\n */\nexport type Intersector<T> = (a: T[], b: T[]) => T[];\n\nexport function createIntersector<T>(compare: Comparator<T>): Intersector<T> {\n return (a, b) => {\n const result: T[] = [];\n let al = a.length;\n let bl = b.length;\n\n if (al === 0 || bl === 0) {\n return result;\n }\n\n if (al > bl) {\n const tmpArr = a;\n a = b;\n b = tmpArr;\n const tmpL = al;\n al = bl;\n bl = tmpL;\n }\n\n const aSorted = [...a].sort(compare);\n const bSorted = [...b].sort(compare);\n\n let i = 0,\n j = 0;\n while (i < al && j < bl) {\n const cmp = compare(aSorted[i]!, bSorted[j]!);\n if (cmp === 0) {\n // Only push if result is empty OR last pushed value is different\n if (\n result.length === 0 ||\n compare(result[result.length - 1]!, aSorted[i]!) !== 0\n ) {\n result.push(aSorted[i]!);\n }\n i++;\n j++;\n } else if (cmp < 0) {\n i++;\n } else {\n j++;\n }\n }\n\n return result;\n };\n}\n","export interface MapLike<K, V> {\n has(key: K): boolean;\n get(key: K): V | undefined;\n set(key: K, value: V): void;\n}\n\nexport function memoize<Arg, Return>(\n cache: MapLike<Arg, Return>,\n func: (arg: Arg) => Return\n): (arg: Arg) => Return {\n return (arg: Arg) => {\n if (cache.has(arg)) {\n return cache.get(arg)!;\n }\n const ret = func(arg);\n cache.set(arg, ret);\n return ret;\n };\n}\n\nexport const weakMemoize = memoize as <Arg extends object, Return>(\n cache: WeakMap<Arg, Return>,\n fn: (arg: Arg) => Return\n) => (arg: Arg) => Return;\n","import type {\n JSONSchema7Type as SchemaValue,\n JSONSchema7TypeName as SchemaType,\n JSONSchema7Definition,\n JSONSchema7,\n JSONSchema7Object,\n} from \"json-schema\";\n\nimport { type Comparator, ascComparator } from \"../../ord.ts\";\nimport {\n createArrayComparator,\n createDeduplicator,\n isArrayEmpty,\n} from \"../../array.ts\";\nimport { isRecordEmpty } from \"../../object.ts\";\nimport { weakMemoize } from \"../../memoize.ts\";\n\nimport { isAllowAnySchema, isSchemaObject } from \"../json-schema.ts\";\n\nconst zero = () => 0;\nconst isUndefined = <T>(v: T | undefined): v is undefined => v === undefined;\n\ntype SchemaPrimitiveTypeExceptNullType = Extract<\n SchemaType,\n \"string\" | \"number\" | \"boolean\"\n>;\ntype SchemaPrimitiveTypeExceptNull = string | number | boolean;\n\nconst isSchemaPrimitiveExceptNull = (\n value: Exclude<SchemaValue, null>\n): value is SchemaPrimitiveTypeExceptNull => typeof value !== \"object\";\n\nconst PRIMITIVE_TYPE_ORDER: Record<\n SchemaPrimitiveTypeExceptNullType,\n 0 | 1 | 2\n> = {\n boolean: 0,\n number: 1,\n string: 2,\n};\n\nfunction compareSchemaPrimitive(\n a: SchemaPrimitiveTypeExceptNull,\n b: SchemaPrimitiveTypeExceptNull\n) {\n const ta = typeof a as SchemaPrimitiveTypeExceptNullType;\n const tb = typeof b as SchemaPrimitiveTypeExceptNullType;\n return ta === tb\n ? ascComparator(a, b)\n : PRIMITIVE_TYPE_ORDER[ta] - PRIMITIVE_TYPE_ORDER[tb];\n}\n\nfunction insertUniqueValues<K>(mutableTarget: K[], mutableSource: K[]): K[] {\n const tl = mutableTarget.length;\n if (tl === 0) return mutableSource;\n const sl = mutableSource.length;\n if (sl === 0) return mutableTarget;\n if (sl > tl) {\n const t = mutableTarget;\n mutableTarget = mutableSource;\n mutableSource = t;\n }\n const seen = new Set(mutableTarget);\n const l = mutableSource.length;\n for (let i = 0; i < l; i++) {\n const key = mutableSource[i]!;\n if (!seen.has(key)) {\n mutableTarget.push(key);\n }\n }\n return mutableTarget;\n}\n\nfunction createCmpMatcher<T, E extends T>(\n isEmpty: (v: T) => v is E,\n compare: Comparator<Exclude<T, E>>,\n compareEmpty: Comparator<E> = zero\n) {\n return (a: T, b: T) => {\n if (isEmpty(a)) {\n if (isEmpty(b)) {\n return compareEmpty(a, b);\n }\n return -1;\n }\n if (isEmpty(b)) {\n return 1;\n }\n return compare(a as Exclude<T, E>, b as Exclude<T, E>);\n };\n}\n\nfunction createOptionalComparator<T>(compare: Comparator<T>) {\n return createCmpMatcher<T | undefined, undefined>(isUndefined, compare);\n}\n\nfunction createNarrowingOptionalComparator<T, E extends T>(\n isEmpty: (v: T) => v is E,\n compare: Comparator<Exclude<T, E | undefined>>\n) {\n return createCmpMatcher<T | undefined, E | undefined>(\n (v: T | undefined): v is undefined | E => v === undefined || isEmpty(v),\n compare\n );\n}\n\nfunction createArrayOrItemComparator<T, T1>(\n compare: Comparator<T>,\n compareArray: Comparator<T1[]>\n) {\n return createCmpMatcher<T | T1[], T1[]>(Array.isArray, compare, compareArray);\n}\n\nconst compareOptionalSameTypeSchemaPrimitives =\n createOptionalComparator(ascComparator);\n\nconst compareNumbersWithZeroDefault = createNarrowingOptionalComparator(\n (v: number): v is 0 => v === 0,\n (a, b) => a - b\n);\n\nexport interface ComparatorOptions {\n deduplicationCache?: WeakMap<any[], any[]>;\n sortedKeysCache?: WeakMap<Record<string, any>, string[]>;\n}\n\nexport function createComparator({\n deduplicationCache = new WeakMap(),\n sortedKeysCache = new WeakMap(),\n}: ComparatorOptions = {}) {\n const getSortedKeys = weakMemoize(sortedKeysCache, (obj) =>\n Object.keys(obj).sort()\n );\n\n function createRecordsComparator<R extends Record<string, any>>(\n compare: <K extends keyof R>(a: R[K], b: R[K]) => number\n ) {\n return (a: R, b: R) => {\n const aKeys = getSortedKeys(a);\n const bKeys = getSortedKeys(b);\n const l = Math.min(aKeys.length, bKeys.length);\n for (let i = 0; i < l; i++) {\n const cmp = ascComparator(aKeys[i]!, bKeys[i]!);\n if (cmp !== 0) {\n return cmp;\n }\n }\n if (aKeys.length !== bKeys.length) {\n return aKeys.length - bKeys.length;\n }\n for (let i = 0; i < l; i++) {\n const key = aKeys[i]!;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n const cmp = compare(a[key], b[key]);\n if (cmp !== 0) {\n return cmp;\n }\n }\n return 0;\n };\n }\n\n function createArrayComparatorWithDeduplication<T>(compare: Comparator<T>) {\n const cmp = createArrayComparator(compare);\n const deduplicate = weakMemoize(\n deduplicationCache as WeakMap<T[], T[]>,\n // NOTE: Always sort output\n createDeduplicator(compare, { threshold: 0 })\n );\n return (a: T[], b: T[]) => cmp(deduplicate(a), deduplicate(b));\n }\n\n const compareArrayOfSameTypePrimitivesWithDeduplication =\n createArrayComparatorWithDeduplication(ascComparator);\n\n function compareSchemaDefinitions(\n a: JSONSchema7Definition,\n b: JSONSchema7Definition\n ) {\n if (isSchemaObject(a)) {\n if (isSchemaObject(b)) {\n const aKeys = Object.keys(a) as (keyof JSONSchema7)[];\n const bKeys = Object.keys(b) as (keyof JSONSchema7)[];\n const allKeys = insertUniqueValues(aKeys, bKeys);\n const l = allKeys.length;\n for (let i = 0; i < l; i++) {\n const key = allKeys[i]!;\n if (a[key] === b[key]) {\n continue;\n }\n const cmp = COMPARATORS[key] ?? compareOptionalSchemaValues;\n const d = cmp(a[key] as undefined, b[key] as undefined);\n if (d !== 0) {\n return d;\n }\n }\n return 0;\n }\n return b === true && isRecordEmpty(a) ? 0 : 1;\n }\n if (isSchemaObject(b)) {\n return a === true && isRecordEmpty(b) ? 0 : -1;\n }\n return ascComparator(a, b);\n }\n\n const compareOptionalSchemaValues =\n createOptionalComparator(compareSchemaValues);\n\n const compareNonNullSchemaValue = createCmpMatcher(\n isSchemaPrimitiveExceptNull,\n createArrayOrItemComparator(\n createRecordsComparator<JSONSchema7Object>(compareOptionalSchemaValues),\n createArrayComparator(compareSchemaValues)\n ),\n compareSchemaPrimitive\n );\n\n function compareSchemaValues(a: SchemaValue, b: SchemaValue): number {\n if (a === null) {\n return -1;\n }\n if (b === null) {\n return 1;\n }\n return compareNonNullSchemaValue(a, b);\n }\n\n const compareOptionalSchemaDefinitions = createOptionalComparator(\n compareSchemaDefinitions\n );\n\n const compareRecordOfOptionalSchemasWithEmptyRecordDefault =\n createNarrowingOptionalComparator(\n isRecordEmpty,\n createRecordsComparator<Record<string, JSONSchema7Definition>>(\n compareOptionalSchemaDefinitions\n )\n );\n\n const compareOptionalArrayOfSchemasWithDeduplication =\n createOptionalComparator(\n createArrayComparatorWithDeduplication(compareSchemaDefinitions)\n );\n\n const compareSchemaDefinitionsWithEmptyDefinitionDefault =\n createNarrowingOptionalComparator(\n isAllowAnySchema,\n compareSchemaDefinitions\n );\n\n const COMPARATORS: {\n [K in keyof JSONSchema7]-?: Comparator<JSONSchema7[K]>;\n } = {\n $id: compareOptionalSameTypeSchemaPrimitives,\n $comment: compareOptionalSameTypeSchemaPrimitives,\n $defs: compareRecordOfOptionalSchemasWithEmptyRecordDefault,\n $ref: compareOptionalSameTypeSchemaPrimitives,\n $schema: compareOptionalSameTypeSchemaPrimitives,\n const: compareOptionalSchemaValues,\n contains: compareOptionalSchemaDefinitions,\n contentEncoding: compareOptionalSameTypeSchemaPrimitives,\n contentMediaType: compareOptionalSameTypeSchemaPrimitives,\n default: compareOptionalSchemaValues,\n definitions: compareRecordOfOptionalSchemasWithEmptyRecordDefault,\n description: compareOptionalSameTypeSchemaPrimitives,\n else: compareOptionalSchemaDefinitions,\n examples: compareOptionalSchemaValues,\n exclusiveMaximum: compareOptionalSameTypeSchemaPrimitives,\n exclusiveMinimum: compareOptionalSameTypeSchemaPrimitives,\n format: compareOptionalSameTypeSchemaPrimitives,\n if: compareOptionalSchemaDefinitions,\n maximum: compareOptionalSameTypeSchemaPrimitives,\n maxItems: compareOptionalSameTypeSchemaPrimitives,\n maxLength: compareOptionalSameTypeSchemaPrimitives,\n maxProperties: compareOptionalSameTypeSchemaPrimitives,\n minimum: compareOptionalSameTypeSchemaPrimitives,\n multipleOf: compareOptionalSameTypeSchemaPrimitives,\n not: compareOptionalSchemaDefinitions,\n pattern: compareOptionalSameTypeSchemaPrimitives,\n propertyNames: compareOptionalSchemaDefinitions,\n readOnly: compareOptionalSameTypeSchemaPrimitives,\n then: compareOptionalSchemaDefinitions,\n title: compareOptionalSameTypeSchemaPrimitives,\n writeOnly: compareOptionalSameTypeSchemaPrimitives,\n uniqueItems: createNarrowingOptionalComparator(\n (v): v is false => v === false,\n zero\n ),\n minLength: compareNumbersWithZeroDefault,\n minItems: compareNumbersWithZeroDefault,\n minProperties: compareNumbersWithZeroDefault,\n required: createNarrowingOptionalComparator(\n isArrayEmpty,\n compareArrayOfSameTypePrimitivesWithDeduplication\n ),\n enum: createNarrowingOptionalComparator(\n isArrayEmpty,\n createArrayComparatorWithDeduplication(compareSchemaValues)\n ),\n type: createOptionalComparator((a, b) => {\n const isAArr = Array.isArray(a);\n const isBArr = Array.isArray(b);\n if (!isAArr && !isBArr) {\n return ascComparator(a, b);\n }\n return compareArrayOfSameTypePrimitivesWithDeduplication(\n isAArr ? a : [a],\n isBArr ? b : [b]\n );\n }),\n items: createNarrowingOptionalComparator(\n (v): v is true | JSONSchema7 => !Array.isArray(v) && isAllowAnySchema(v),\n createArrayOrItemComparator(\n compareSchemaDefinitions,\n createArrayComparator(compareSchemaDefinitions)\n )\n ),\n anyOf: compareOptionalArrayOfSchemasWithDeduplication,\n allOf: compareOptionalArrayOfSchemasWithDeduplication,\n oneOf: compareOptionalArrayOfSchemasWithDeduplication,\n properties: compareRecordOfOptionalSchemasWithEmptyRecordDefault,\n patternProperties: compareRecordOfOptionalSchemasWithEmptyRecordDefault,\n additionalProperties: compareSchemaDefinitionsWithEmptyDefinitionDefault,\n additionalItems: compareSchemaDefinitionsWithEmptyDefinitionDefault,\n dependencies: createNarrowingOptionalComparator(\n isRecordEmpty,\n createRecordsComparator(\n createOptionalComparator(\n createArrayOrItemComparator(\n compareSchemaDefinitions,\n compareArrayOfSameTypePrimitivesWithDeduplication\n )\n )\n )\n ),\n };\n\n return {\n compareSchemaValues,\n compareSchemaDefinitions,\n };\n}\n","export function identity<T>(v: T): T {\n return v;\n}\n","export const gcd = (a: number, b: number): number => (a ? gcd(b % a, a) : b);\nexport const lcm = (a: number, b: number): number =>\n Math.abs(a * b) / gcd(a, b);\n","export function legacyPatternsMerger(a: string, b: string): string {\n return a === b ? a : `(?=${a})(?=${b})`;\n}\n\nexport function simplePatternsMerger(a: string, b: string): string {\n return a === b ? a : `(?=.*(?:${a}))(?=.*(?:${b}))`;\n}\n","import type {\n JSONSchema7,\n JSONSchema7Definition,\n JSONSchema7Type,\n JSONSchema7TypeName,\n} from \"json-schema\";\n\nimport {\n intersection,\n union,\n type Deduplicator,\n type Intersector,\n} from \"../../array.ts\";\nimport { identity } from \"../../function.ts\";\nimport { lcm } from \"../../math.ts\";\nimport { isAllowAnySchema } from \"../json-schema.ts\";\n\nimport { simplePatternsMerger } from \"./patterns.ts\";\n\ntype SchemaKey = keyof JSONSchema7;\n\nfunction createPairCombinations<T, R>(\n l: T[],\n r: T[],\n action: (a: T, b: T) => R\n) {\n const ll = l.length;\n const rl = r.length;\n if (ll > 0 && rl > 0) {\n for (let i = 0; i < ll; i++) {\n const lv = l[i]!;\n for (let j = 0; j < rl; j++) {\n action(lv, r[j]!);\n }\n }\n }\n}\n\nfunction mergeBooleans(l: boolean, r: boolean) {\n return l || r;\n}\n\nfunction createRecordsMerge<T>(merge: (l: T, r: T) => T) {\n return (left: Record<string, T>, right: Record<string, T>) => {\n const target = { ...left };\n const keys = Object.keys(right);\n const l = keys.length;\n for (let i = 0; i < l; i++) {\n const key = keys[i]!;\n target[key] =\n left[key] === undefined ? right[key]! : merge(left[key], right[key]!);\n }\n return target;\n };\n}\n\n/**\n * An assigner function operates at the schema-object level.\n * It receives the partially merged `target` and the original\n * `left` and `right` schemas.\n *\n * In most cases, it modifies and returns the `target` object,\n * but it may also return a completely new schema object if needed.\n *\n * Assigners are used for keywords that cannot be merged by simple\n * value-level functions, often because they interact with other\n * keywords or require holistic decisions.\n */\nexport type Assigner<R extends {}> = (target: R, l: R, r: R) => R;\n\nfunction createMap<R>(items: Iterable<[SchemaKey[], R]>) {\n const map = new Map<SchemaKey, R>();\n for (const pair of items) {\n for (const key of pair[0]) {\n map.set(key, pair[1]);\n }\n }\n return map;\n}\n\nfunction assignSchemaDefinitionOrRecordOfSchemaDefinitions<\n K extends {\n [T in SchemaKey]: JSONSchema7[T] extends\n JSONSchema7Definition | Record<string, JSONSchema7Definition> | undefined\n ? T\n : never;\n }[SchemaKey],\n>(target: JSONSchema7, key: K, value: JSONSchema7[K]) {\n if (value === undefined || isAllowAnySchema(value)) {\n delete target[key];\n } else {\n target[key] = value;\n }\n}\n\nconst PROPERTIES_ASSIGNER_KEYS = [\n \"properties\",\n \"patternProperties\",\n \"additionalProperties\",\n] as const satisfies SchemaKey[];\n\ninterface CompiledPattern {\n regExp: RegExp;\n schema: JSONSchema7Definition;\n}\n\nfunction compilePatterns(patterns: Record<string, JSONSchema7Definition>) {\n const keys = Object.keys(patterns);\n const l = keys.length;\n const result: CompiledPattern[] = [];\n for (let i = 0; i < l; i++) {\n const source = keys[i]!;\n result.push({\n regExp: new RegExp(source),\n schema: patterns[source]!,\n });\n }\n return [result, keys] as const;\n}\n\nconst EMPTY_PATTERNS_AND_KEYS: [CompiledPattern[], string[]] = [[], []];\n\n/**\n * @returns `true` when `false` schema occurred\n */\nfunction appendKeyConstraints(\n target: (JSONSchema7 | true)[],\n key: string,\n patterns: CompiledPattern[]\n): boolean {\n const l = patterns.length;\n for (let i = 0; i < l; i++) {\n const p = patterns[i]!;\n if (!p.regExp.test(key)) {\n continue;\n }\n const s = p.schema;\n if (s === false) {\n return true;\n }\n target.push(s);\n }\n return false;\n}\n\nconst ITEMS_ASSIGNER_KEYS = [\n \"items\",\n \"additionalItems\",\n] as const satisfies SchemaKey[];\n\nconst CONDITION_ASSIGNER_KEYS = [\n \"if\",\n \"then\",\n \"else\",\n] as const satisfies SchemaKey[];\n\nfunction assignCondition(target: JSONSchema7, source: JSONSchema7) {\n if (source.if !== undefined) {\n target.if = source.if;\n }\n if (source.then !== undefined) {\n target.then = source.then;\n }\n if (source.else !== undefined) {\n target.else = source.else;\n }\n return target;\n}\n\ntype AssignerKey =\n | (typeof PROPERTIES_ASSIGNER_KEYS)[number]\n | (typeof ITEMS_ASSIGNER_KEYS)[number]\n | (typeof CONDITION_ASSIGNER_KEYS)[number];\n\nfunction intersectSchemaTypes(\n a: JSONSchema7TypeName,\n b: JSONSchema7TypeName\n): JSONSchema7TypeName | undefined {\n if (a === b) {\n return a;\n }\n switch (a) {\n case \"number\": {\n if (b === \"integer\") {\n return \"integer\";\n }\n }\n // eslint-disable-next-line no-fallthrough\n case \"integer\": {\n if (b === \"number\") {\n return \"integer\";\n }\n }\n // eslint-disable-next-line no-fallthrough\n default:\n return undefined;\n }\n}\n\n/**\n * A merger function combines two values for a specific JSON Schema keyword.\n */\nexport type Merger<T> = (a: T, b: T) => T;\n\n/**\n * A validation function that ensures consistency between two schema keywords.\n */\nexport type Check<K extends SchemaKey> = (\n target: Required<Pick<JSONSchema7, K>>\n) => boolean;\n\nexport type CheckEntry<A extends SchemaKey, B extends SchemaKey> = readonly [\n A,\n B,\n Check<A | B>,\n];\n\nexport function check<A extends SchemaKey, B extends SchemaKey>(\n a: A,\n b: B,\n check: Check<A | B>\n): CheckEntry<A, B> {\n return [a, b, check];\n}\n\nfunction createChecksMap(checks: Iterable<CheckEntry<SchemaKey, SchemaKey>>) {\n const map = new Map<\n SchemaKey,\n { oppositeKey: SchemaKey; check: (target: JSONSchema7) => void }[]\n >();\n for (const [a, b, check] of checks) {\n const fn = (target: JSONSchema7) => {\n if (!check(target as Required<JSONSchema7>)) {\n throw new Error(\n `Schema keys '${a}' and '${b}' are conflicting (${a}: ${JSON.stringify(target[a])}, ${b}: ${JSON.stringify(target[b])})`\n );\n }\n };\n for (const k of [\n [a, b],\n [b, a],\n ]) {\n let arr = map.get(k[0]);\n if (arr === undefined) {\n arr = [];\n map.set(k[0], arr);\n }\n arr.push({ oppositeKey: k[1], check: fn });\n }\n }\n return map;\n}\n\nexport interface MergeOptions {\n /**\n * Custom function to test whether a regular expression `subExpr`\n * is considered a subset of another `superExpr`.\n * @default Object.is\n */\n isSubRegExp?: (subExpr: string, superExpr: string) => boolean;\n\n /**\n * Merger function for combining regular expression patterns\n * @default simplePatternsMerger\n */\n mergePatterns?: Merger<string>;\n\n /**\n * Intersector function for merging JSON values (enum keyword)\n * @default intersection\n */\n intersectJson?: Intersector<JSONSchema7Type>;\n\n /**\n * Deduplication strategy for JSON Schema definitions.\n * @default identity\n */\n deduplicateJsonSchemaDef?: Deduplicator<JSONSchema7Definition>;\n\n /**\n * Fallback merger applied when no keyword-specific merger is defined.\n * @default identity\n */\n defaultMerger?: Merger<any>;\n\n /**\n * A mapping of schema keywords to merger functions.\n *\n * - A merger operates on **values of a single keyword** (`a`, `b` → merged value).\n * - When provided, a custom merger **overrides the default merger** for that keyword.\n */\n mergers?: Partial<{\n [K in SchemaKey]: Merger<Exclude<JSONSchema7[K], undefined>>;\n }>;\n\n /**\n * A collection of keyword groups with associated assigner functions.\n *\n * - An assigner operates at the **schema-object level** (`target`, `left`, `right`).\n * - Custom assigners are **appended** to the default assigners,\n * but can also **replace behavior** for specific keywords if they overlap.\n */\n assigners?: Iterable<[SchemaKey[], Assigner<JSONSchema7>]>;\n\n /**\n * Consistency checks to validate relationships between\n * pairs of schema keywords (e.g. `minimum` ≤ `maximum`).\n *\n * - A check ensures that two related keywords do not conflict.\n * - Providing this option **replaces the default checks** completely.\n *\n * @default DEFAULT_CHECKS\n */\n checks?: Iterable<CheckEntry<SchemaKey, SchemaKey>>;\n}\n\nexport const DEFAULT_CHECKS = [\n check(\"minimum\", \"maximum\", (t) => t.maximum >= t.minimum),\n check(\"exclusiveMinimum\", \"maximum\", (t) => t.maximum > t.exclusiveMinimum),\n check(\"minimum\", \"exclusiveMaximum\", (t) => t.exclusiveMaximum > t.minimum),\n check(\n \"exclusiveMinimum\",\n \"exclusiveMaximum\",\n (t) => t.exclusiveMaximum > t.exclusiveMinimum\n ),\n check(\"minLength\", \"maxLength\", (t) => t.maxLength >= t.minLength),\n check(\"minItems\", \"maxItems\", (t) => t.maxItems >= t.minItems),\n check(\n \"minProperties\",\n \"maxProperties\",\n (t) => t.maxProperties >= t.minProperties\n ),\n];\n\nexport function createMerger({\n mergePatterns = simplePatternsMerger,\n isSubRegExp = Object.is,\n intersectJson = intersection,\n deduplicateJsonSchemaDef = identity,\n defaultMerger = identity,\n assigners = [],\n checks = DEFAULT_CHECKS,\n mergers,\n}: MergeOptions = {}) {\n function mergeArrayOfSchemaDefinitions(\n schemas: JSONSchema7Definition[]\n ): JSONSchema7Definition {\n const l = schemas.length;\n let result = schemas[0]!;\n for (let i = 1; i < l; i++) {\n const r = mergeSchemaDefinitions(result, schemas[i]!);\n if (r === false) {\n return false;\n }\n if (isAllowAnySchema(r)) {\n continue;\n }\n result = r;\n }\n return result;\n }\n\n function createProperty(\n constraints: (JSONSchema7 | true)[],\n key: string,\n value: JSONSchema7Definition,\n patterns: CompiledPattern[],\n oppositeValue: JSONSchema7Definition | undefined,\n oppositePatterns: CompiledPattern[],\n oppositeAdditional: JSONSchema7 | false | undefined\n ): JSONSchema7Definition | undefined {\n constraints.length = 0;\n if (value === false) {\n return false;\n }\n constraints.push(value);\n const isOppositeValueDefined = oppositeValue !== undefined;\n if (isOppositeValueDefined) {\n if (oppositeValue === false) {\n return false;\n }\n constraints.push(oppositeValue);\n }\n if (appendKeyConstraints(constraints, key, oppositePatterns)) {\n return false;\n }\n const isNotYetAllowed = constraints.length < 2;\n if (oppositeAdditional === false) {\n // There are no allowing constraints from opposite side -> drop property\n if (isNotYetAllowed) {\n return undefined;\n }\n // Applying patterns of current schema cause they may disappear\n if (appendKeyConstraints(constraints, key, patterns)) {\n return false;\n }\n } else if (isNotYetAllowed && oppositeAdditional !== undefined) {\n constraints.push(oppositeAdditional);\n }\n const l = constraints.length;\n if (l === 1) {\n return constraints[0];\n }\n return mergeArrayOfSchemaDefinitions(constraints);\n }\n\n function assignPatternPropertiesAndAdditionalPropertiesMerge(\n target: Record<string, JSONSchema7Definition>,\n patterns: Record<string, JSONSchema7Definition> | undefined,\n patternKeys: string[],\n matchedPatterns: Set<string>,\n oppositeAdditional: JSONSchema7Definition,\n isOppositeTruthy: boolean\n ) {\n const l = patternKeys.length;\n if (l > 0 && oppositeAdditional !== false) {\n if (isOppositeTruthy) {\n // TODO: in some cases we can just assign new value instead of copying\n Object.assign(target, patterns);\n } else {\n for (let i = 0; i < l; i++) {\n const pattern = patternKeys[i]!;\n if (matchedPatterns.has(pattern)) {\n continue;\n }\n target[pattern] = mergeSchemaDefinitions(\n patterns![pattern]!,\n oppositeAdditional\n );\n }\n }\n }\n return target;\n }\n\n const propertiesAssigner: Assigner<JSONSchema7> = (\n target,\n {\n properties: lProps = {},\n patternProperties: lPatterns,\n additionalProperties: lAdditional = true,\n },\n {\n properties: rProps = {},\n patternProperties: rPatterns,\n additionalProperties: rAdditional = true,\n }\n ) => {\n // Special case\n const isLAddTruthy = isAllowAnySchema(lAdditional);\n const isRAddTruthy = isAllowAnySchema(rAdditional);\n if (isLAddTruthy && isRAddTruthy) {\n assignSchemaDefinitionOrRecordOfSchemaDefinitions(\n target,\n \"properties\",\n mergeRecordsOfSchemaDefinitions(lProps, rProps)\n );\n assignSchemaDefinitionOrRecordOfSchemaDefinitions(\n target,\n \"patternProperties\",\n lPatterns && rPatterns\n ? mergeRecordsOfSchemaDefinitions(lPatterns, rPatterns)\n : (lPatterns ?? rPatterns)\n );\n delete target.additionalProperties;\n return target;\n }\n // Additional Properties\n const additionalProperties = mergeSchemaDefinitions(\n lAdditional,\n rAdditional\n );\n assignSchemaDefinitionOrRecordOfSchemaDefinitions(\n target,\n \"additionalProperties\",\n additionalProperties\n );\n // Properties\n const properties: Record<string, JSONSchema7Definition> = {};\n const lKeys = Object.keys(lProps);\n const lKeysLen = lKeys.length;\n const [lCompiledPatterns, lPatternKeys] = lPatterns\n ? compilePatterns(lPatterns)\n : EMPTY_PATTERNS_AND_KEYS;\n const [rCompiledPatterns, rPatternKeys] = rPatterns\n ? compilePatterns(rPatterns)\n : EMPTY_PATTERNS_AND_KEYS;\n const constraints: (JSONSchema7 | true)[] = [];\n const lKeysSet = new Set<string>();\n const mappedRAdditional = isRAddTruthy ? undefined : rAdditional;\n for (let i = 0; i < lKeysLen; i++) {\n const key = lKeys[i]!;\n lKeysSet.add(key);\n const prop = createProperty(\n constraints,\n key,\n lProps[key]!,\n lCompiledPatterns,\n rProps[key],\n rCompiledPatterns,\n mappedRAdditional\n );\n if (prop !== undefined) {\n properties[key] = prop;\n }\n }\n const rKeys = Object.keys(rProps);\n const rKeysLen = rKeys.length;\n const mappedLAdditional = isLAddTruthy ? undefined : lAdditional;\n for (let i = 0; i < rKeysLen; i++) {\n const key = rKeys[i]!;\n if (lKeysSet.has(key)) {\n continue;\n }\n const prop = createProperty(\n constraints,\n key,\n rProps[key]!,\n rCompiledPatterns,\n undefined,\n lCompiledPatterns,\n mappedLAdditional\n );\n if (prop !== undefined) {\n properties[key] = prop;\n }\n }\n assignSchemaDefinitionOrRecordOfSchemaDefinitions(\n target,\n \"properties\",\n properties\n );\n // Pattern Properties\n // (lPatterns and rPatterns) or (lPatterns and rAdditional) or (rPatterns and lAdditional)\n let patterns: Record<string, JSONSchema7Definition> = {};\n const matchedPatterns = new Set<string>();\n if (lPatternKeys.length > 0 && rPatternKeys.length > 0) {\n createPairCombinations(lPatternKeys, rPatternKeys, (lKey, rKey) => {\n if (isSubRegExp(lKey, rKey)) {\n matchedPatterns.add(lKey);\n }\n if (isSubRegExp(rKey, lKey)) {\n matchedPatterns.add(rKey);\n }\n patterns[mergePatterns(lKey, rKey)] = mergeSchemaDefinitions(\n lPatterns![lKey]!,\n rPatterns![rKey]!\n );\n });\n }\n patterns = assignPatternPropertiesAndAdditionalPropertiesMerge(\n patterns,\n lPatterns,\n lPatternKeys,\n matchedPatterns,\n rAdditional,\n isRAddTruthy\n );\n patterns = assignPatternPropertiesAndAdditionalPropertiesMerge(\n patterns,\n rPatterns,\n rPatternKeys,\n matchedPatterns,\n lAdditional,\n isLAddTruthy\n );\n assignSchemaDefinitionOrRecordOfSchemaDefinitions(\n target,\n \"patternProperties\",\n patterns\n );\n return target;\n };\n\n const itemsAssigner: Assigner<JSONSchema7> = (\n target,\n // NOTE: Schema that has `additionalItems` without an `items` keyword is invalid\n // so the assigner should be triggered only be colliding `items` properties\n // so default values are used only for type narrowing\n { items: lItems = [], additionalItems: lAdditional },\n { items: rItems = [], additionalItems: rAdditional }\n ) => {\n const isLArr = Array.isArray(lItems);\n const isRArr = Array.isArray(rItems);\n const itemsArray: JSONSchema7Definition[] = [];\n target.items = itemsArray;\n if (isLArr && isRArr) {\n const [l, additional, tail] =\n lItems.length < rItems.length\n ? [lItems.length, lAdditional, rItems]\n : [rItems.length, rAdditional, lItems];\n let i = 0;\n for (; i < l; i++) {\n itemsArray.push(mergeSchemaDefinitions(lItems[i]!, rItems[i]!));\n }\n if (additional === false) {\n target.additionalItems = false;\n } else {\n const isAdditionalTruthy =\n additional === undefined || isAllowAnySchema(additional);\n for (; i < tail.length; i++) {\n itemsArray.push(\n isAdditionalTruthy\n ? tail[i]!\n : mergeSchemaDefinitions(tail[i]!, additional)\n );\n }\n assignSchemaDefinitionOrRecordOfSchemaDefinitions(\n target,\n \"additionalItems\",\n lAdditional !== undefined && rAdditional !== undefined\n ? mergeSchemaDefinitions(lAdditional, rAdditional)\n : (lAdditional ?? rAdditional)\n );\n }\n } else if (isLArr || isRArr) {\n const [arr, item, additional] = (\n isLArr ? [lItems, rItems, lAdditional] : [rItems, lItems, rAdditional]\n ) as [\n JSONSchema7Definition[],\n JSONSchema7Definition,\n JSONSchema7Definition | undefined,\n ];\n assignSchemaDefinitionOrRecordOfSchemaDefinitions(\n target,\n \"additionalItems\",\n additional && mergeSchemaDefinitions(additional, item)\n );\n for (let i = 0; i < arr.length; i++) {\n itemsArray.push(mergeSchemaDefinitions(arr[i]!, item));\n }\n } else {\n delete target.additionalItems;\n target.items = mergeSchemaDefinitions(lItems, rItems);\n }\n return target;\n };\n\n const conditionAssigner: Assigner<JSONSchema7> = (target, l, r) => {\n assignCondition(target, l);\n const cond = assignCondition({}, r);\n if (target.allOf === undefined) {\n target.allOf = [cond];\n } else {\n target.allOf = target.allOf.concat(cond);\n }\n return target;\n };\n\n function mergeArraysOfSchemaDefinition(\n l: JSONSchema7Definition[],\n r: JSONSchema7Definition[]\n ) {\n const definitions: JSONSchema7Definition[] = [];\n createPairCombinations(l, r, (a, b) => {\n try {\n definitions.push(mergeSchemaDefinitions(a, b));\n } catch {}\n });\n if (definitions.length === 0) {\n throw new Error(\n `No valid schema combinations could be produced for \"${JSON.stringify(l)}\" and \"${JSON.stringify(r)}\"; the merged result is empty`\n );\n }\n return deduplicateJsonSchemaDef(definitions);\n }\n\n const ASSIGNERS_MAP = createMap([\n [PROPERTIES_ASSIGNER_KEYS, propertiesAssigner],\n [ITEMS_ASSIGNER_KEYS, itemsAssigner],\n [CONDITION_ASSIGNER_KEYS, conditionAssigner],\n ...assigners,\n ]);\n\n const CHECKS_MAP = createChecksMap(checks);\n\n function mergeSchemaDefinitions(\n left: JSONSchema7Definition,\n right: JSONSchema7Definition\n ) {\n if (left === false || right === false) {\n return false;\n }\n if (isAllowAnySchema(left)) {\n if (isAllowAnySchema(right)) {\n return true;\n }\n return right;\n }\n if (isAllowAnySchema(right)) {\n return left;\n }\n let target = { ...left };\n const assigners = new Set<Assigner<JSONSchema7>>();\n const checks = new Set<(target: JSONSchema7) => void>();\n const rKeys = Reflect.ownKeys(right) as SchemaKey[];\n const l = rKeys.length;\n for (let i = 0; i < l; i++) {\n const rKey = rKeys[i]!;\n const rv = right[rKey];\n if (rv === undefined) {\n continue;\n }\n const checkData = CHECKS_MAP.get(rKey);\n if (checkData !== undefined) {\n const l = checkData.length;\n for (let j = 0; j < l; j++) {\n const item = checkData[j];\n if (left[item.oppositeKey] !== undefined) {\n checks.add(item.check);\n }\n }\n }\n const lv = left[rKey];\n if (lv === undefined) {\n // @ts-expect-error too complex\n target[rKey] = rv;\n continue;\n }\n const assign = ASSIGNERS_MAP.get(rKey);\n if (assign) {\n assigners.add(assign);\n continue;\n }\n const merge = MERGERS[rKey] ?? defaultMerger;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n target[rKey] = merge(lv as never, rv as never);\n }\n for (const assign of assigners) {\n target = assign(target, left, right);\n }\n for (const check of checks) {\n check(target);\n }\n return target;\n }\n\n const mergeRecordsOfSchemaDefinitions = createRecordsMerge(\n mergeSchemaDefinitions\n );\n\n const MERGERS: {\n [K in SchemaKey]?: Merger<Exclude<JSONSchema7[K], undefined>>;\n } = {\n $id: defaultMerger,\n $ref: defaultMerger,\n $schema: defaultMerger,\n $comment: defaultMerger,\n $defs: mergeRecordsOfSchemaDefinitions,\n definitions: mergeRecordsOfSchemaDefinitions,\n type: (a, b) => {\n if (a === b) {\n return a;\n }\n const isAArr = Array.isArray(a);\n const isBArr = Array.isArray(b);\n if (!isAArr && !isBArr) {\n const intersection = intersectSchemaTypes(a, b);\n if (intersection !== undefined) {\n return intersection;\n }\n } else if (isAArr || isBArr) {\n const r = new Set<JSONSchema7TypeName>();\n if (isAArr && isBArr) {\n createPairCombinations(a, b, (x, y) => {\n const type = intersectSchemaTypes(x, y);\n if (type !== undefined) {\n r.add(type);\n }\n });\n } else {\n const arr = (isAArr ? a : b) as JSONSchema7TypeName[];\n const el = (isAArr ? b : a) as JSONSchema7TypeName;\n const l = arr.length;\n for (let i = 0; i < l; i++) {\n const intersection = intersectSchemaTypes(el, arr[i]!);\n if (intersection !== undefined) {\n r.add(intersection);\n }\n }\n }\n const s = r.size;\n if (s === 1) {\n return r.values().next().value!;\n }\n if (s > 1) {\n return Array.from(r);\n }\n }\n throw new Error(\n `It is not possible to create an intersection of the following incompatible types: ${a.toString()}, ${b.toString()}`\n );\n },\n default: defaultMerger,\n description: defaultMerger,\n title: defaultMerger,\n const: defaultMerger,\n format: defaultMerger,\n contentEncoding: defaultMerger,\n contentMediaType: defaultMerger,\n not: (a, b) => {\n const items = deduplicateJsonSchemaDef([a, b]);\n return items.length === 1 ? items[0]! : { anyOf: items };\n },\n pattern: mergePatterns,\n readOnly: mergeBooleans,\n writeOnly: mergeBooleans,\n enum: (a, b) => {\n const data = intersectJson(a, b);\n if (data.length === 0) {\n throw new Error(\n `Intersection of the following enums is empty: \"${JSON.stringify(\n a\n )}\", \"${JSON.stringify(b)}\"`\n );\n }\n return data;\n },\n anyOf: mergeArraysOfSchemaDefinition,\n oneOf: mergeArraysOfSchemaDefinition,\n allOf: (l, r) => deduplicateJsonSchemaDef(l.concat(r)),\n propertyNames: mergeSchemaDefinitions,\n contains: mergeSchemaDefinitions,\n dependencies: createRecordsMerge((a, b) => {\n if (Array.isArray(a)) {\n if (Array.isArray(b)) {\n return union(a, b);\n }\n return mergeSchemaDefinitions(b, { required: a });\n }\n if (Array.isArray(b)) {\n return mergeSchemaDefinitions(a, { required: b });\n }\n return mergeSchemaDefinitions(a, b);\n }),\n examples: (l, r) => {\n // https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-validation-01#section-10.4\n if (!Array.isArray(l) || !Array.isArray(r)) {\n throw new Error(\n `Value of the 'examples' field should be an array, but got \"${JSON.stringify(\n l\n )}\" and \"${JSON.stringify(r)}\"`\n );\n }\n // TODO: Proper deduplication\n return union(l, r);\n },\n multipleOf: (a, b) => {\n let factor = 1;\n while (!Number.isInteger(a) || !Number.isInteger(b)) {\n factor *= 10;\n a *= 10;\n b *= 10;\n }\n return lcm(a, b) / factor;\n },\n exclusiveMaximum: Math.min,\n maximum: Math.min,\n maxItems: Math.min,\n maxLength: Math.min,\n maxProperties: Math.min,\n exclusiveMinimum: Math.max,\n minimum: Math.max,\n minItems: Math.max,\n minLength: Math.max,\n minProperties: Math.max,\n uniqueItems: mergeBooleans,\n required: union,\n ...mergers,\n } satisfies {\n [K in Exclude<SchemaKey, AssignerKey>]-?: Merger<\n Exclude<JSONSchema7[K], undefined>\n >;\n };\n\n return {\n mergeSchemaDefinitions,\n mergeArrayOfSchemaDefinitions,\n };\n}\n","import type { JSONSchema7Definition } from \"json-schema\";\n\nimport { transformSchemaDefinition } from \"../transform.ts\";\n\nfunction getAllOfSchemas(\n schema: JSONSchema7Definition\n): JSONSchema7Definition[] {\n const result: JSONSchema7Definition[] = [];\n const stack: JSONSchema7Definition[] = [schema];\n while (stack.length > 0) {\n const current = stack.pop()!;\n if (typeof current === \"boolean\" || current.allOf === undefined) {\n result.push(current);\n continue;\n }\n const { allOf, ...rest } = current;\n result.push(rest);\n for (let i = allOf.length - 1; i >= 0; i--) {\n stack.push(allOf[i]!);\n }\n }\n return result;\n}\n\nexport function createShallowAllOfMerge(\n mergeArrayOfSchemaDefinitions: (\n defs: JSONSchema7Definition[]\n ) => JSONSchema7Definition\n) {\n return (schema: JSONSchema7Definition) =>\n mergeArrayOfSchemaDefinitions(getAllOfSchemas(schema));\n}\n\nexport function createDeepAllOfMerge(\n shallowMerge: (def: JSONSchema7Definition) => JSONSchema7Definition\n) {\n return (schemaDef: JSONSchema7Definition) =>\n transformSchemaDefinition<JSONSchema7Definition>(schemaDef, (def) => {\n if (typeof def === \"boolean\" || def.allOf === undefined) {\n return def;\n }\n return shallowMerge(def);\n });\n}\n","import { createComparator, createMerger, createShallowAllOfMerge } from '@x0k/json-schema-merge';\nimport { createDeduplicator, createIntersector } from '@x0k/json-schema-merge/lib/array';\n\nconst { compareSchemaDefinitions, compareSchemaValues } = createComparator();\nconst { mergeArrayOfSchemaDefinitions } = createMerger({\n intersectJson: createIntersector(compareSchemaValues),\n deduplicateJsonSchemaDef: createDeduplicator(compareSchemaDefinitions),\n});\n\n/** Shared `@x0k/json-schema-merge` shallow-allOf merge function used by `retrieveSchema` and\n * `omitExtraData`. Constructed once from a single comparator/merger/intersector/deduplicator\n * pipeline so both consumers share the same configuration without duplicating setup code.\n *\n * Usage: pass a schema that contains an `allOf` keyword and receive the merged result.\n *\n * @example\n * const merged = shallowAllOfMerge(schema); // schema.allOf is merged into the parent schema\n */\nexport default createShallowAllOfMerge(mergeArrayOfSchemaDefinitions);\n","import {\n ADDITIONAL_PROPERTIES_KEY,\n ADDITIONAL_PROPERTY_FLAG,\n ALL_OF_KEY,\n ANY_OF_KEY,\n DEPENDENCIES_KEY,\n ID_KEY,\n IF_KEY,\n ITEMS_KEY,\n ONE_OF_KEY,\n PATTERN_PROPERTIES_KEY,\n PROPERTIES_KEY,\n REF_KEY,\n RJSF_REF_CYCLE_KEY,\n RJSF_REF_KEY,\n} from '../constants.ts';\nimport deepEquals from '../deepEquals.ts';\nimport findSchemaDefinition, { splitKeyElementFromObject } from '../findSchemaDefinition.ts';\nimport getDiscriminatorFieldFromSchema from '../getDiscriminatorFieldFromSchema.ts';\nimport guessType from '../guessType.ts';\nimport isObject from '../isObject.ts';\nimport mergeSchemas from '../mergeSchemas.ts';\nimport { getByPath } from '../pathUtils.ts';\nimport type {\n Experimental_CustomMergeAllOf,\n FormContextType,\n GenericObjectType,\n RJSFMarkedSchema,\n RJSFSchema,\n StrictRJSFSchema,\n ValidatorType,\n} from '../types.ts';\nimport getFirstMatchingOption from './getFirstMatchingOption.ts';\nimport shallowAllOfMerge from './shallowAllOfMerge.ts';\n\n/** Retrieves an expanded schema that has had all of its conditions, additional properties, references and dependencies\n * resolved and merged into the `schema` given a `validator`, `rootSchema` and `rawFormData` that is used to do the\n * potentially recursive resolution.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be forwarded to all the APIs\n * @param schema - The schema for which retrieving a schema is desired\n * @param [rootSchema={}] - The root schema that will be forwarded to all the APIs\n * @param [rawFormData] - The current formData, if any, to assist retrieving a schema\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @param [resolveAnyOfOrOneOfRefs = false] - Optional flag indicating whether to resolved refs in anyOf/oneOf lists\n * @returns - The schema having its conditions, additional properties, references and dependencies resolved\n */\nexport default function retrieveSchema<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n validator: ValidatorType<T, S, F>,\n schema: S,\n rootSchema: S = {} as S,\n rawFormData?: T,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n resolveAnyOfOrOneOfRefs = false,\n): S {\n return retrieveSchemaInternal<T, S, F>(\n validator,\n schema,\n rootSchema,\n rawFormData,\n undefined,\n undefined,\n experimental_customMergeAllOf,\n resolveAnyOfOrOneOfRefs,\n )[0];\n}\n\n/** Converts boolean schemas to equivalent object schemas for APIs that operate on `StrictRJSFSchema` objects.\n *\n * @param schema - The schema or boolean schema to normalize\n * @returns - The original schema or an equivalent object schema\n */\nfunction normalizeBooleanSchema<S extends StrictRJSFSchema = RJSFSchema>(schema: S | boolean): S {\n if (typeof schema !== 'boolean') {\n return schema;\n }\n return (schema ? {} : { not: {} }) as S;\n}\n\n/** Resolves a conditional block (if/else/then) by removing the condition and merging the appropriate conditional branch\n * with the rest of the schema. If `expandAllBranches` is true, then the `retrieveSchemaInteral()` results for both\n * conditions will be returned.\n *\n * @param validator - An implementation of the `ValidatorType` interface that is used to detect valid schema conditions\n * @param schema - The schema for which resolving a condition is desired\n * @param rootSchema - The root schema that will be forwarded to all the APIs\n * @param expandAllBranches - Flag, if true, will return all possible branches of conditions, any/oneOf and\n * dependencies as a list of schemas\n * @param recurseList - The list of recursive references already processed\n * @param [formData] - The current formData to assist retrieving a schema\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - A list of schemas with the appropriate conditions resolved, possibly with all branches expanded\n */\nexport function resolveCondition<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n validator: ValidatorType<T, S, F>,\n schema: S,\n rootSchema: S,\n expandAllBranches: boolean,\n recurseList: string[],\n formData?: T,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): S[] {\n const { if: expression, then, else: otherwise, ...resolvedSchemaLessConditional } = schema;\n\n const conditionValue = validator.isValid(expression as S, formData || ({} as T), rootSchema);\n let resolvedSchemas = [resolvedSchemaLessConditional as S];\n let schemas: S[] = [];\n if (expandAllBranches) {\n if (then && typeof then !== 'boolean') {\n const thenSchema = then as unknown as S;\n schemas = schemas.concat(\n retrieveSchemaInternal<T, S, F>(\n validator,\n thenSchema,\n rootSchema,\n formData,\n expandAllBranches,\n recurseList,\n experimental_customMergeAllOf,\n ),\n );\n }\n if (otherwise && typeof otherwise !== 'boolean') {\n const otherwiseSchema = otherwise as unknown as S;\n schemas = schemas.concat(\n retrieveSchemaInternal<T, S, F>(\n validator,\n otherwiseSchema,\n rootSchema,\n formData,\n expandAllBranches,\n recurseList,\n experimental_customMergeAllOf,\n ),\n );\n }\n } else {\n const conditionalBranch = (conditionValue ? then : otherwise) as S | boolean | undefined;\n if (conditionalBranch !== undefined) {\n const conditionalSchema = normalizeBooleanSchema<S>(conditionalBranch);\n schemas = schemas.concat(\n retrieveSchemaInternal<T, S, F>(\n validator,\n conditionalSchema,\n rootSchema,\n formData,\n expandAllBranches,\n recurseList,\n experimental_customMergeAllOf,\n ),\n );\n }\n }\n if (schemas.length) {\n resolvedSchemas = schemas.map((s) => mergeSchemas(resolvedSchemaLessConditional, s) as S);\n }\n return resolvedSchemas.flatMap((s) =>\n retrieveSchemaInternal<T, S, F>(\n validator,\n s,\n rootSchema,\n formData,\n expandAllBranches,\n recurseList,\n experimental_customMergeAllOf,\n ),\n );\n}\n\n/** Given a list of lists of allOf, anyOf or oneOf values, create a list of lists of all permutations of the values. The\n * `listOfLists` is expected to be all resolved values of the 1st...nth schemas within an `allOf`, `anyOf` or `oneOf`.\n * From those lists, build a matrix for each `xxxOf` where there is more than one schema for a row in the list of lists.\n *\n * For example:\n * - If there are three xxxOf rows (A, B, C) and they have been resolved such that there is only one A, two B and three\n * C schemas then:\n * - The permutation for the first row is `[[A]]`\n * - The permutations for the second row are `[[A,B1], [A,B2]]`\n * - The permutations for the third row are `[[A,B1,C1], [A,B1,C2], [A,B1,C3], [A,B2,C1], [A,B2,C2], [A,B2,C3]]`\n *\n * @param listOfLists - The list of lists of elements that represent the allOf, anyOf or oneOf resolved values in order\n * @returns - The list of all permutations of schemas for a set of `xxxOf`s\n */\nexport function getAllPermutationsOfXxxOf<S extends StrictRJSFSchema = RJSFSchema>(listOfLists: S[][]) {\n const allPermutations: S[][] = listOfLists.reduce<S[][]>(\n (permutations, list) => {\n // When there are more than one set of schemas for a row, duplicate the set of permutations and add in the values\n if (list.length > 1) {\n return list.flatMap((element) => permutations.map((permutation) => [...permutation, element]));\n }\n // Otherwise just push in the single value into the current set of permutations\n permutations.forEach((permutation) => permutation.push(list[0]));\n return permutations;\n },\n [[]], // Start with an empty list\n );\n\n return allPermutations;\n}\n\n/** Returns the subset of 'patternProperties' specifications that match the given 'key'\n *\n * @param schema - The schema whose 'patternProperties' are to be filtered\n * @param key - The key to match against the 'patternProperties' specifications\n * @returns - The subset of 'patternProperties' specifications that match the given 'key'\n */\nexport function getMatchingPatternProperties<S extends StrictRJSFSchema = RJSFSchema>(\n schema: S,\n key: string,\n): Required<S['patternProperties']> {\n const patternProperties = schema.patternProperties ?? {};\n return Object.fromEntries(\n Object.entries(patternProperties).filter(([pattern]) => RegExp(pattern).test(key)),\n ) as Required<S['patternProperties']>;\n}\n\n/** Resolves references and dependencies within a schema and its 'allOf' children. Passes the `expandAllBranches` flag\n * down to the `retrieveSchemaInternal()`, `resolveReference()` and `resolveDependencies()` helper calls. If\n * `expandAllBranches` is true, then all possible dependencies and/or allOf branches are returned.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be forwarded to all the APIs\n * @param schema - The schema for which resolving a schema is desired\n * @param rootSchema - The root schema that will be forwarded to all the APIs\n * @param expandAllBranches - Flag, if true, will return all possible branches of conditions, any/oneOf and dependencies\n * as a list of schemas\n * @param recurseList - The list of recursive references already processed\n * @param [formData] - The current formData, if any, to assist retrieving a schema\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @param [resolveAnyOfOrOneOfRefs] - Optional flag indicating whether to resolved refs in anyOf/oneOf lists\n * @returns - The list of schemas having its references, dependencies and allOf schemas resolved\n */\nexport function resolveSchema<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n validator: ValidatorType<T, S, F>,\n schema: S,\n rootSchema: S,\n expandAllBranches: boolean,\n recurseList: string[],\n formData?: T,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n resolveAnyOfOrOneOfRefs?: boolean,\n): S[] {\n const updatedSchemas = resolveReference<T, S, F>(\n validator,\n schema,\n rootSchema,\n expandAllBranches,\n recurseList,\n formData,\n experimental_customMergeAllOf,\n resolveAnyOfOrOneOfRefs,\n );\n if (updatedSchemas.length > 1 || updatedSchemas[0] !== schema) {\n // return the updatedSchemas array if it has either multiple schemas within it\n // OR the first schema is not the same as the original schema\n return updatedSchemas;\n }\n if (DEPENDENCIES_KEY in schema) {\n const resolvedSchemas = resolveDependencies<T, S, F>(\n validator,\n schema,\n rootSchema,\n expandAllBranches,\n recurseList,\n formData,\n experimental_customMergeAllOf,\n );\n return resolvedSchemas.flatMap((s) =>\n retrieveSchemaInternal<T, S, F>(\n validator,\n s,\n rootSchema,\n formData,\n expandAllBranches,\n recurseList,\n experimental_customMergeAllOf,\n ),\n );\n }\n if (ALL_OF_KEY in schema && Array.isArray(schema[ALL_OF_KEY])) {\n const allOfSchemaElements: S[][] = schema.allOf.map((allOfSubschema) =>\n retrieveSchemaInternal<T, S, F>(\n validator,\n allOfSubschema as S,\n rootSchema,\n formData,\n expandAllBranches,\n recurseList,\n experimental_customMergeAllOf,\n ),\n );\n const allPermutations = getAllPermutationsOfXxxOf<S>(allOfSchemaElements);\n return allPermutations.map((permutation) => ({\n ...schema,\n allOf: permutation,\n }));\n }\n // No $ref or dependencies or allOf attribute was found, returning the original schema.\n return [schema];\n}\n\n/** Resolves all references within a schema and then returns the `retrieveSchemaInternal()` if the resolved schema is\n * actually different than the original. Passes the `expandAllBranches` flag down to the `retrieveSchemaInternal()`\n * helper call.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be forwarded to all the APIs\n * @param schema - The schema for which resolving a reference is desired\n * @param rootSchema - The root schema that will be forwarded to all the APIs\n * @param expandAllBranches - Flag, if true, will return all possible branches of conditions, any/oneOf and dependencies\n * as a list of schemas\n * @param recurseList - The list of recursive references already processed\n * @param [formData] - The current formData, if any, to assist retrieving a schema\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @param [resolveAnyOfOrOneOfRefs] - Optional flag indicating whether to resolved refs in anyOf/oneOf lists\n * @returns - The list schemas retrieved after having all references resolved\n */\nexport function resolveReference<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n validator: ValidatorType<T, S, F>,\n schema: S,\n rootSchema: S,\n expandAllBranches: boolean,\n recurseList: string[],\n formData?: T,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n resolveAnyOfOrOneOfRefs?: boolean,\n): S[] {\n const updatedSchema = resolveAllReferences<S>(schema, rootSchema, recurseList, undefined, resolveAnyOfOrOneOfRefs);\n if (updatedSchema !== schema) {\n // Only call this if the schema was actually changed by the `resolveAllReferences()` function\n return retrieveSchemaInternal<T, S, F>(\n validator,\n updatedSchema,\n rootSchema,\n formData,\n expandAllBranches,\n recurseList,\n experimental_customMergeAllOf,\n resolveAnyOfOrOneOfRefs,\n );\n }\n return [schema];\n}\n\n/** Resolves all references within the schema itself as well as any of its properties and array items.\n *\n * @param schema - The schema for which resolving all references is desired\n * @param rootSchema - The root schema that will be forwarded to all the APIs\n * @param recurseList - List of $refs already resolved to prevent recursion\n * @param [baseURI] - The base URI to be used for resolving relative references\n * @param [resolveAnyOfOrOneOfRefs] - Optional flag indicating whether to resolved refs in anyOf/oneOf lists\n * @param [markCycleOnDetection=false] - When true and a recursive $ref is detected, the returned schema is tagged\n * with `__rjsf_ref_cycle: true` so that `SchemaField` can render a cycle indicator instead of recursing.\n * Should only be `true` when called from an **object-property** context, because object properties are always\n * rendered (creating an infinite loop), whereas array items and anyOf/oneOf branches are data-driven.\n * @returns - given schema will all references resolved or the original schema if no internal `$refs` were resolved\n */\nexport function resolveAllReferences<S extends StrictRJSFSchema = RJSFSchema>(\n schema: S,\n rootSchema: S,\n recurseList: string[],\n baseURI?: string,\n resolveAnyOfOrOneOfRefs?: boolean,\n markCycleOnDetection = false,\n): S {\n if (!isObject(schema)) {\n return schema;\n }\n let resolvedSchema: S = schema;\n let currentBaseURI = baseURI;\n // resolve top level ref\n if (REF_KEY in resolvedSchema) {\n const { $ref, ...localSchema } = resolvedSchema;\n // Check for a recursive reference and stop the loop\n if (recurseList.includes($ref!)) {\n return markCycleOnDetection ? ({ ...resolvedSchema, [RJSF_REF_CYCLE_KEY]: true } as S) : resolvedSchema;\n }\n recurseList.push($ref!);\n // Retrieve the referenced schema definition.\n const refSchema = findSchemaDefinition<S>($ref, rootSchema, currentBaseURI);\n resolvedSchema = { ...refSchema, ...localSchema, [RJSF_REF_KEY]: $ref };\n if (ID_KEY in resolvedSchema) {\n currentBaseURI = resolvedSchema[ID_KEY];\n }\n }\n\n if (PROPERTIES_KEY in resolvedSchema) {\n const childrenLists: string[][] = [];\n const updatedProps: RJSFSchema = {};\n for (const [key, value] of Object.entries(resolvedSchema[PROPERTIES_KEY] ?? {})) {\n const childList: string[] = [...recurseList];\n // Mark cycles only when NOT in resolveAnyOfOrOneOfRefs mode. When resolveAnyOfOrOneOfRefs=true\n // (e.g. from ObjectField), options are resolved against a shared recurseList that accumulates\n // refs across branches, causing false positives. In simple (non-anyOf) resolution, a $ref cycle\n // in an object property always causes an infinite render loop and must be caught.\n updatedProps[key] = resolveAllReferences(\n value as S,\n rootSchema,\n childList,\n currentBaseURI,\n resolveAnyOfOrOneOfRefs,\n !resolveAnyOfOrOneOfRefs,\n );\n childrenLists.push(childList);\n }\n for (const ref of new Set(childrenLists.flat())) {\n if (!recurseList.includes(ref)) {\n recurseList.push(ref);\n }\n }\n resolvedSchema = { ...resolvedSchema, [PROPERTIES_KEY]: updatedProps };\n }\n\n if (\n ITEMS_KEY in resolvedSchema &&\n !Array.isArray(resolvedSchema.items) &&\n typeof resolvedSchema.items !== 'boolean'\n ) {\n resolvedSchema = {\n ...resolvedSchema,\n // Array items are only rendered when data exists, so a $ref cycle here does NOT cause an infinite render.\n items: resolveAllReferences(\n resolvedSchema.items as S,\n rootSchema,\n recurseList,\n currentBaseURI,\n resolveAnyOfOrOneOfRefs,\n ),\n };\n }\n\n if (resolveAnyOfOrOneOfRefs) {\n let key: 'anyOf' | 'oneOf' | undefined;\n let schemas: S[] | undefined;\n if (ANY_OF_KEY in schema && Array.isArray(schema[ANY_OF_KEY])) {\n key = ANY_OF_KEY;\n schemas = resolvedSchema[ANY_OF_KEY] as S[];\n } else if (ONE_OF_KEY in schema && Array.isArray(schema[ONE_OF_KEY])) {\n key = ONE_OF_KEY;\n schemas = resolvedSchema[ONE_OF_KEY] as S[];\n }\n if (key && schemas) {\n resolvedSchema = {\n ...resolvedSchema,\n [key]: schemas.map((s: S) =>\n resolveAllReferences(s, rootSchema, recurseList, currentBaseURI, resolveAnyOfOrOneOfRefs),\n ),\n };\n }\n }\n\n return deepEquals(schema, resolvedSchema) ? schema : resolvedSchema;\n}\n\n/** Creates new 'properties' items for each key in the `formData`\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be used when necessary\n * @param theSchema - The schema for which the existing additional properties is desired\n * @param [rootSchema] - The root schema, used to primarily to look up `$ref`s * @param validator\n * @param [aFormData] - The current formData, if any, to assist retrieving a schema\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - The updated schema with additional properties stubbed\n */\nexport function stubExistingAdditionalProperties<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n validator: ValidatorType<T, S, F>,\n theSchema: S,\n rootSchema?: S,\n aFormData?: T,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): S {\n // Clone the schema so that we don't ruin the consumer's original\n const schema = {\n ...theSchema,\n properties: { ...theSchema.properties },\n };\n\n // make sure formData is an object\n const formData: GenericObjectType = aFormData && isObject(aFormData) ? aFormData : {};\n Object.keys(formData).forEach((key) => {\n if (key in schema.properties) {\n // No need to stub, our schema already has the property\n return;\n }\n if (PATTERN_PROPERTIES_KEY in schema) {\n const matchingProperties = getMatchingPatternProperties(schema, key);\n if (Object.keys(matchingProperties).length > 0) {\n schema.properties[key] = retrieveSchema<T, S, F>(\n validator,\n { [ALL_OF_KEY]: Object.values(matchingProperties) } as S,\n rootSchema,\n formData[key],\n experimental_customMergeAllOf,\n );\n (schema.properties[key] as RJSFMarkedSchema)[ADDITIONAL_PROPERTY_FLAG] = true;\n return;\n }\n }\n if (ADDITIONAL_PROPERTIES_KEY in schema && schema.additionalProperties !== false) {\n let additionalProperties: S['additionalProperties'];\n if (typeof schema.additionalProperties !== 'boolean') {\n if (REF_KEY in schema.additionalProperties!) {\n additionalProperties = retrieveSchema<T, S, F>(\n validator,\n { [REF_KEY]: (schema.additionalProperties as S)[REF_KEY] } as S,\n rootSchema,\n formData[key],\n experimental_customMergeAllOf,\n );\n } else if ('type' in schema.additionalProperties!) {\n additionalProperties = { ...schema.additionalProperties };\n } else if (ANY_OF_KEY in schema.additionalProperties! || ONE_OF_KEY in schema.additionalProperties!) {\n additionalProperties = {\n type: 'object',\n ...schema.additionalProperties,\n };\n } else {\n additionalProperties = { type: guessType(formData[key]) };\n }\n } else {\n additionalProperties = { type: guessType(formData[key]) };\n }\n\n // The type of our new key should match the additionalProperties value;\n schema.properties[key] = additionalProperties;\n // Set our additional property flag so we know it was dynamically added\n (schema.properties[key] as RJSFMarkedSchema)[ADDITIONAL_PROPERTY_FLAG] = true;\n } else {\n // Invalid property\n schema.properties[key] = { type: 'null' };\n // Set our additional property flag so we know it was dynamically added\n (schema.properties[key] as RJSFMarkedSchema)[ADDITIONAL_PROPERTY_FLAG] = true;\n }\n });\n\n return schema;\n}\n\n/**\n * Internal helper that merges allOf schemas using @x0k/json-schema-merge's shallow allOf merge\n * @param schema - The schema containing an `allOf` keyword\n * @returns The schema with allOf schemas merged\n */\nfunction mergeAllOf<S extends StrictRJSFSchema = RJSFSchema>(schema: S): S {\n return shallowAllOfMerge(schema) as S;\n}\n\n/** Internal handler that retrieves an expanded schema that has had all of its conditions, additional properties,\n * references and dependencies resolved and merged into the `schema` given a `validator`, `rootSchema` and `rawFormData`\n * that is used to do the potentially recursive resolution. If `expandAllBranches` is true, then all possible branches\n * of the schema and its references, conditions and dependencies are returned.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be forwarded to all the APIs\n * @param schema - The schema for which retrieving a schema is desired\n * @param rootSchema - The root schema that will be forwarded to all the APIs\n * @param [rawFormData] - The current formData, if any, to assist retrieving a schema\n * @param [expandAllBranches=false] - Flag, if true, will return all possible branches of conditions, any/oneOf and\n * dependencies as a list of schemas\n * @param [recurseList=[]] - The optional, list of recursive references already processed\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @param [resolveAnyOfOrOneOfRefs] - Optional flag indicating whether to resolved refs in anyOf/oneOf lists\n * @returns - The schema(s) resulting from having its conditions, additional properties, references and dependencies\n * resolved. Multiple schemas may be returned if `expandAllBranches` is true.\n */\nexport function retrieveSchemaInternal<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n validator: ValidatorType<T, S, F>,\n schema: S,\n rootSchema: S,\n rawFormData?: T,\n expandAllBranches = false,\n recurseList: string[] = [],\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n resolveAnyOfOrOneOfRefs?: boolean,\n): S[] {\n if (!isObject(schema)) {\n return [{} as S];\n }\n const resolvedSchemas = resolveSchema<T, S, F>(\n validator,\n schema,\n rootSchema,\n expandAllBranches,\n recurseList,\n rawFormData,\n experimental_customMergeAllOf,\n resolveAnyOfOrOneOfRefs,\n );\n return resolvedSchemas.flatMap((s: S) => {\n let resolvedSchema = s;\n if (IF_KEY in resolvedSchema) {\n return resolveCondition<T, S, F>(\n validator,\n resolvedSchema,\n rootSchema,\n expandAllBranches,\n recurseList,\n rawFormData as T,\n experimental_customMergeAllOf,\n );\n }\n if (ALL_OF_KEY in resolvedSchema) {\n // resolve allOf schemas\n if (expandAllBranches) {\n const { allOf, ...restOfSchema } = resolvedSchema;\n return [...(allOf as S[]), restOfSchema as S];\n }\n try {\n const withContainsSchemas = [] as S[];\n const withoutContainsSchemas = [] as S[];\n // Collect Symbol-keyed properties from allOf subschemas before merging; shallowAllOfMerge\n // (external library) only operates on string keys and will drop them.\n const allOfSymbols: Record<symbol, unknown> = {};\n resolvedSchema.allOf?.forEach((allOfItem) => {\n if (typeof allOfItem === 'object' && allOfItem.contains) {\n withContainsSchemas.push(allOfItem as S);\n } else {\n withoutContainsSchemas.push(allOfItem as S);\n for (const sym of Object.getOwnPropertySymbols(allOfItem)) {\n if (!(sym in allOfSymbols)) {\n allOfSymbols[sym] = (allOfItem as any)[sym];\n }\n }\n }\n });\n if (withContainsSchemas.length) {\n resolvedSchema = { ...resolvedSchema, allOf: withoutContainsSchemas };\n }\n resolvedSchema = experimental_customMergeAllOf\n ? experimental_customMergeAllOf(resolvedSchema)\n : mergeAllOf(resolvedSchema);\n // Re-apply collected Symbol properties that the merge dropped.\n for (const sym of Object.getOwnPropertySymbols(allOfSymbols)) {\n (resolvedSchema as any)[sym] = allOfSymbols[sym];\n }\n if (withContainsSchemas.length) {\n resolvedSchema.allOf = withContainsSchemas;\n }\n } catch (e) {\n // oxlint-disable-next-line no-console\n console.warn('could not merge subschemas in allOf:\\n', e);\n const { allOf, ...resolvedSchemaWithoutAllOf } = resolvedSchema;\n return resolvedSchemaWithoutAllOf as S;\n }\n }\n if (PROPERTIES_KEY in resolvedSchema && PATTERN_PROPERTIES_KEY in resolvedSchema) {\n resolvedSchema = Object.keys(resolvedSchema.properties!).reduce(\n (acc, key) => {\n const matchingProperties = getMatchingPatternProperties(acc, key);\n if (Object.keys(matchingProperties).length > 0) {\n acc.properties[key] = retrieveSchema<T, S, F>(\n validator,\n { allOf: [acc.properties[key], ...Object.values(matchingProperties)] } as S,\n rootSchema,\n getByPath<T>(rawFormData, key),\n experimental_customMergeAllOf,\n );\n }\n return acc;\n },\n {\n ...resolvedSchema,\n properties: { ...resolvedSchema.properties },\n },\n );\n }\n const hasAdditionalProperties =\n PATTERN_PROPERTIES_KEY in resolvedSchema ||\n (ADDITIONAL_PROPERTIES_KEY in resolvedSchema && resolvedSchema.additionalProperties !== false);\n if (hasAdditionalProperties) {\n return stubExistingAdditionalProperties<T, S, F>(\n validator,\n resolvedSchema,\n rootSchema,\n rawFormData as T,\n experimental_customMergeAllOf,\n );\n }\n\n return resolvedSchema;\n });\n}\n\n/** Resolves an `anyOf` or `oneOf` within a schema (if present) to the list of schemas returned from\n * `retrieveSchemaInternal()` for the best matching option. If `expandAllBranches` is true, then a list of schemas for ALL\n * options are retrieved and returned.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be forwarded to all the APIs\n * @param schema - The schema for which retrieving a schema is desired\n * @param rootSchema - The root schema that will be forwarded to all the APIs\n * @param expandAllBranches - Flag, if true, will return all possible branches of conditions, any/oneOf and dependencies\n * as a list of schemas\n * @param [rawFormData] - The current formData, if any, to assist retrieving a schema, defaults to an empty object\n * @returns - Either an array containing the best matching option or all options if `expandAllBranches` is true\n */\nexport function resolveAnyOrOneOfSchemas<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(validator: ValidatorType<T, S, F>, schema: S, rootSchema: S, expandAllBranches: boolean, rawFormData?: T) {\n let anyOrOneOf: S[] | undefined;\n const { oneOf, anyOf, ...remaining } = schema;\n if (Array.isArray(oneOf)) {\n anyOrOneOf = oneOf as S[];\n } else if (Array.isArray(anyOf)) {\n anyOrOneOf = anyOf as S[];\n }\n if (anyOrOneOf) {\n // Ensure that during expand all branches we pass an object rather than undefined so that all options are interrogated\n const formData = rawFormData === undefined && expandAllBranches ? ({} as T) : rawFormData;\n const discriminator = getDiscriminatorFieldFromSchema<S>(schema);\n anyOrOneOf = anyOrOneOf.map((s) => resolveAllReferences(s, rootSchema, []));\n // Call this to trigger the set of isValid() calls that the schema parser will need\n const option = getFirstMatchingOption<T, S, F>(validator, formData, anyOrOneOf, rootSchema, discriminator);\n if (expandAllBranches) {\n // Also trigger isValid() for the relaxed variants so that precompiled validators capture their hashes.\n // omitExtraData's handleOneOf relaxes additionalProperties:false → true before scoring; those mutated\n // schemas must be present in a precompiled validator's compiled set or isValid() will throw at runtime.\n // Using getFirstMatchingOption (rather than calling isValid directly) ensures that the augmented forms\n // of each option (as constructed internally by getFirstMatchingOption for options with properties) are\n // also captured. The return value is discarded — the call is purely for ParserValidator's side effect.\n const relaxed = relaxOptionsForScoring<S>(anyOrOneOf, false, rootSchema);\n getFirstMatchingOption<T, S, F>(validator, formData, relaxed, rootSchema, discriminator);\n return anyOrOneOf.map((item) => mergeSchemas(remaining, item) as S);\n }\n return [mergeSchemas(remaining, anyOrOneOf[option]) as S];\n }\n return [schema];\n}\n\n/** Normalises a list of `oneOf`/`anyOf` options for use in option-scoring only (not for filtering).\n * Boolean schemas are converted to their object equivalents (`true` → `{}`, `false` → `{not:{}}`).\n * When `resolveRefs` is `true`, each object option is first passed through `resolveAllReferences`\n * so that `$ref`-based options expose their `additionalProperties` constraint before relaxation.\n * Any option whose `additionalProperties` is `false` is widened to `true` so that\n * `getClosestMatchingOption` / `validator.isValid()` does not produce false negatives when the\n * form data contains keys not listed in `properties`.\n *\n * @param options - The raw `oneOf`/`anyOf` array, which may contain boolean schemas\n * @param [resolveRefs=false] - When `true`, resolve `$ref`s in each option before relaxing; pass\n * `rootSchema` as well. Set `false` (default) when refs are already resolved at the call site.\n * @param [rootSchema] - Required when `resolveRefs` is `true`; the root schema used to look up `$ref`s\n * @returns - A new array of plain schema objects with `additionalProperties` relaxed where needed\n */\nexport function relaxOptionsForScoring<S extends StrictRJSFSchema = RJSFSchema>(\n options: (S | boolean)[],\n resolveRefs = false,\n rootSchema?: S,\n): S[] {\n return options.map((d) => {\n if (!isObject(d)) {\n return normalizeBooleanSchema<S>(d);\n }\n const schema = resolveRefs && rootSchema ? resolveAllReferences<S>(d, rootSchema, []) : d;\n return schema.additionalProperties === false ? { ...schema, additionalProperties: true } : schema;\n });\n}\n\n/** Resolves dependencies within a schema and its 'anyOf/oneOf' children. Passes the `expandAllBranches` flag down to\n * the `resolveAnyOrOneOfSchema()` and `processDependencies()` helper calls.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be forwarded to all the APIs\n * @param schema - The schema for which resolving a dependency is desired\n * @param rootSchema - The root schema that will be forwarded to all the APIs\n * @param expandAllBranches - Flag, if true, will return all possible branches of conditions, any/oneOf and dependencies\n * as a list of schemas\n * @param recurseList - The list of recursive references already processed\n * @param [formData] - The current formData, if any, to assist retrieving a schema\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - The list of schemas with their dependencies resolved\n */\nexport function resolveDependencies<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n validator: ValidatorType<T, S, F>,\n schema: S,\n rootSchema: S,\n expandAllBranches: boolean,\n recurseList: string[],\n formData?: T,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): S[] {\n // Drop the dependencies from the source schema.\n const { dependencies, ...remainingSchema } = schema;\n const resolvedSchemas = resolveAnyOrOneOfSchemas<T, S, F>(\n validator,\n remainingSchema as S,\n rootSchema,\n expandAllBranches,\n formData,\n );\n return resolvedSchemas.flatMap((resolvedSchema) =>\n processDependencies<T, S, F>(\n validator,\n dependencies,\n resolvedSchema,\n rootSchema,\n expandAllBranches,\n recurseList,\n formData,\n experimental_customMergeAllOf,\n ),\n );\n}\n\n/** Processes all the `dependencies` recursively into the list of `resolvedSchema`s as needed. Passes the\n * `expandAllBranches` flag down to the `withDependentSchema()` and the recursive `processDependencies()` helper calls.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be forwarded to all the APIs\n * @param dependencies - The set of dependencies that needs to be processed\n * @param resolvedSchema - The schema for which processing dependencies is desired\n * @param rootSchema - The root schema that will be forwarded to all the APIs\n * @param expandAllBranches - Flag, if true, will return all possible branches of conditions, any/oneOf and dependencies\n * as a list of schemas\n * @param recurseList - The list of recursive references already processed\n * @param [formData] - The current formData, if any, to assist retrieving a schema\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - The schema with the `dependencies` resolved into it\n */\nexport function processDependencies<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n validator: ValidatorType<T, S, F>,\n dependencies: S['dependencies'],\n resolvedSchema: S,\n rootSchema: S,\n expandAllBranches: boolean,\n recurseList: string[],\n formData?: T,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): S[] {\n let schemas = [resolvedSchema];\n // Process dependencies updating the local schema properties as appropriate.\n for (const dependencyKey in dependencies) {\n if (\n (expandAllBranches || getByPath(formData, dependencyKey) !== undefined) &&\n (!resolvedSchema.properties || dependencyKey in resolvedSchema.properties)\n ) {\n const [remainingDependencies, dependencyValue] = splitKeyElementFromObject(\n dependencyKey,\n dependencies as GenericObjectType,\n );\n if (Array.isArray(dependencyValue)) {\n schemas[0] = withDependentProperties<S>(resolvedSchema, dependencyValue);\n } else if (isObject(dependencyValue)) {\n schemas = withDependentSchema<T, S, F>(\n validator,\n resolvedSchema,\n rootSchema,\n dependencyKey,\n dependencyValue as S,\n expandAllBranches,\n recurseList,\n formData,\n experimental_customMergeAllOf,\n );\n }\n return schemas.flatMap((schema) =>\n processDependencies<T, S, F>(\n validator,\n remainingDependencies,\n schema,\n rootSchema,\n expandAllBranches,\n recurseList,\n formData,\n experimental_customMergeAllOf,\n ),\n );\n }\n }\n return schemas;\n}\n\n/** Updates a schema with additionally required properties added\n *\n * @param schema - The schema for which resolving a dependent properties is desired\n * @param [additionallyRequired] - An optional array of additionally required names\n * @returns - The schema with the additional required values merged in\n */\nexport function withDependentProperties<S extends StrictRJSFSchema = RJSFSchema>(\n schema: S,\n additionallyRequired?: string[],\n) {\n if (!additionallyRequired) {\n return schema;\n }\n const required = Array.isArray(schema.required)\n ? Array.from(new Set([...schema.required, ...additionallyRequired]))\n : additionallyRequired;\n return { ...schema, required };\n}\n\n/** Merges a dependent schema into the `schema` dealing with oneOfs and references. Passes the `expandAllBranches` flag\n * down to the `retrieveSchemaInternal()`, `resolveReference()` and `withExactlyOneSubschema()` helper calls.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be forwarded to all the APIs\n * @param schema - The schema for which resolving a dependent schema is desired\n * @param rootSchema - The root schema that will be forwarded to all the APIs\n * @param dependencyKey - The key name of the dependency\n * @param dependencyValue - The potentially dependent schema\n * @param expandAllBranches - Flag, if true, will return all possible branches of conditions, any/oneOf and dependencies\n * as a list of schemas\n * @param recurseList - The list of recursive references already processed\n * @param [formData]- The current formData to assist retrieving a schema\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - The list of schemas with the dependent schema resolved into them\n */\nexport function withDependentSchema<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n validator: ValidatorType<T, S, F>,\n schema: S,\n rootSchema: S,\n dependencyKey: string,\n dependencyValue: S,\n expandAllBranches: boolean,\n recurseList: string[],\n formData?: T,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): S[] {\n const dependentSchemas = retrieveSchemaInternal<T, S, F>(\n validator,\n dependencyValue,\n rootSchema,\n formData,\n expandAllBranches,\n recurseList,\n experimental_customMergeAllOf,\n );\n return dependentSchemas.flatMap((dependent) => {\n const { oneOf, ...dependentSchema } = dependent;\n const mergedSchema = mergeSchemas(schema, dependentSchema) as S;\n // Since it does not contain oneOf, we return the original schema.\n if (oneOf === undefined) {\n return mergedSchema;\n }\n // Resolve $refs inside oneOf.\n const resolvedOneOfs = oneOf.map((subschema) => {\n if (typeof subschema === 'boolean' || !(REF_KEY in subschema)) {\n return [subschema as S];\n }\n return resolveReference<T, S, F>(validator, subschema as S, rootSchema, expandAllBranches, recurseList, formData);\n });\n const allPermutations = getAllPermutationsOfXxxOf(resolvedOneOfs);\n return allPermutations.flatMap((resolvedOneOf) =>\n withExactlyOneSubschema<T, S, F>(\n validator,\n mergedSchema,\n rootSchema,\n dependencyKey,\n resolvedOneOf,\n expandAllBranches,\n recurseList,\n formData,\n experimental_customMergeAllOf,\n ),\n );\n });\n}\n\n/** Returns a list of `schema`s with the best choice from the `oneOf` options merged into it. If `expandAllBranches` is\n * true, then a list of schemas for ALL options are retrieved and returned. Passes the `expandAllBranches` flag down to\n * the `retrieveSchemaInternal()` helper call.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be used to validate oneOf options\n * @param schema - The schema for which resolving a oneOf subschema is desired\n * @param rootSchema - The root schema that will be forwarded to all the APIs\n * @param dependencyKey - The key name of the oneOf dependency\n * @param oneOf - The list of schemas representing the oneOf options\n * @param expandAllBranches - Flag, if true, will return all possible branches of conditions, any/oneOf and dependencies\n * as a list of schemas\n * @param recurseList - The list of recursive references already processed\n * @param [formData] - The current formData to assist retrieving a schema\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - Either an array containing the best matching option or all options if `expandAllBranches` is true\n */\nexport function withExactlyOneSubschema<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n validator: ValidatorType<T, S, F>,\n schema: S,\n rootSchema: S,\n dependencyKey: string,\n oneOf: S['oneOf'],\n expandAllBranches: boolean,\n recurseList: string[],\n formData?: T,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): S[] {\n const validSubschemas = oneOf!.filter((subschema) => {\n if (typeof subschema === 'boolean' || !subschema?.properties) {\n return false;\n }\n const { [dependencyKey]: conditionPropertySchema } = subschema.properties;\n if (conditionPropertySchema) {\n const conditionSchema: S = {\n type: 'object',\n properties: {\n [dependencyKey]: conditionPropertySchema,\n },\n } as S;\n return validator.isValid(conditionSchema, formData, rootSchema) || expandAllBranches;\n }\n return false;\n });\n\n if (!expandAllBranches && validSubschemas.length !== 1) {\n // oxlint-disable-next-line no-console\n console.warn(\"ignoring oneOf in dependencies because there isn't exactly one subschema that is valid\");\n return [schema];\n }\n return validSubschemas.flatMap((s) => {\n const subschema: S = s as S;\n const [dependentSubschema] = splitKeyElementFromObject(dependencyKey, subschema.properties as GenericObjectType);\n const dependentSchema = { ...subschema, properties: dependentSubschema };\n const schemas = retrieveSchemaInternal<T, S, F>(\n validator,\n dependentSchema,\n rootSchema,\n formData,\n expandAllBranches,\n recurseList,\n experimental_customMergeAllOf,\n );\n return schemas.map((resolvedSubschema) => mergeSchemas(schema, resolvedSubschema) as S);\n });\n}\n","import { CONST_KEY, DEFAULT_KEY, PROPERTIES_KEY } from '../constants.ts';\nimport deepEquals from '../deepEquals.ts';\nimport getDiscriminatorFieldFromSchema from '../getDiscriminatorFieldFromSchema.ts';\nimport { getByPath } from '../pathUtils.ts';\nimport type {\n Experimental_CustomMergeAllOf,\n FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n ValidatorType,\n} from '../types.ts';\nimport retrieveSchema from './retrieveSchema.ts';\n\n/** Finds the option inside the `schema['any/oneOf']` list which has the `properties[selectorField].default` or\n * `properties[selectorField].const` that matches the `formData[selectorField]` value. For the purposes of this\n * function, `selectorField` is either `schema.discriminator.propertyName` or `fallbackField`. The `LayoutGridField`\n * works directly with schemas in a recursive manner, making this faster than `getFirstMatchingOption()`.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be forwarded to all the APIs\n * @param rootSchema - The root schema that will be forwarded to all the APIs\n * @param schema - The schema element in which to search for the selected anyOf/oneOf option\n * @param fallbackField - The field to use as a backup selector field if the schema does not have a required field\n * @param xxx - Either `anyOf` or `oneOf`, defines which value is being sought\n * @param [formData={}] - The form data that is used to determine which anyOf/oneOf option to descend\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - The anyOf/oneOf option that matches the selector field in the schema or undefined if nothing is selected\n */\nexport default function findSelectedOptionInXxxOf<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n validator: ValidatorType<T, S, F>,\n rootSchema: S,\n schema: S,\n fallbackField: string,\n xxx: 'anyOf' | 'oneOf',\n formData: T = {} as T,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): S | undefined {\n if (Array.isArray(schema[xxx])) {\n const discriminator = getDiscriminatorFieldFromSchema<S>(schema);\n const selectorField = discriminator || fallbackField;\n const xxxOfs = schema[xxx].map((xxxOf) =>\n retrieveSchema<T, S, F>(validator, xxxOf as S, rootSchema, formData, experimental_customMergeAllOf),\n );\n const data = getByPath(formData, selectorField);\n if (data !== undefined) {\n return xxxOfs.find((xxxOfOption) =>\n deepEquals(\n getByPath(\n xxxOfOption,\n [PROPERTIES_KEY, selectorField, DEFAULT_KEY],\n getByPath(xxxOfOption, [PROPERTIES_KEY, selectorField, CONST_KEY]),\n ),\n data,\n ),\n );\n }\n }\n return undefined;\n}\n","import { REF_KEY } from '../constants.ts';\nimport { getByPath, hasByPath, toPath } from '../pathUtils.ts';\nimport type {\n Experimental_CustomMergeAllOf,\n FormContextType,\n RJSFSchema,\n SchemaFieldPath,\n StrictRJSFSchema,\n ValidatorType,\n} from '../types.ts';\nimport retrieveSchema from './retrieveSchema.ts';\n\n/** Internal helper function that acts like `getByPath` but additionally retrieves `$ref`s as needed to get the path\n * for schemas containing potentially nested `$ref`s.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be forwarded to all the APIs\n * @param rootSchema - The root schema that will be forwarded to all the APIs\n * @param schema - The current node within the JSON schema recursion\n * @param path - The remaining keys in the path to the desired property\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - The internal schema from the `schema` for the given `path` or undefined if not found\n */\nfunction getFromSchemaInternal<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n validator: ValidatorType<T, S, F>,\n rootSchema: S,\n schema: S,\n path: SchemaFieldPath,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): T | S | undefined {\n let fieldSchema = schema;\n // hasByPath instead of `in` because `schema` can be undefined at runtime when drilling past a non-matching xxxOf\n if (hasByPath(schema, REF_KEY)) {\n fieldSchema = retrieveSchema<T, S, F>(validator, schema, rootSchema, undefined, experimental_customMergeAllOf);\n }\n if (path.length === 0) {\n return fieldSchema;\n }\n const pathList = Array.isArray(path) ? [...path] : toPath(path);\n const [part, ...nestedPath] = pathList;\n if (part !== undefined && part !== '' && hasByPath(fieldSchema, part)) {\n fieldSchema = getByPath<S>(fieldSchema, part);\n return getFromSchemaInternal<T, S, F>(\n validator,\n rootSchema,\n fieldSchema,\n nestedPath,\n experimental_customMergeAllOf,\n );\n }\n return undefined;\n}\n\n/** Helper that acts like `getByPath` but additionally retrieves `$ref`s as needed to get the path for schemas\n * containing potentially nested `$ref`s.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be forwarded to all the APIs\n * @param rootSchema - The root schema that will be forwarded to all the APIs\n * @param schema - The current node within the JSON schema recursion\n * @param path - The keys in the path to the desired field\n * @param defaultValue - The value to return if a value is not found for the `pathList` path\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - The inner schema from the `schema` for the given `path` or the `defaultValue` if not found\n */\nexport default function getFromSchema<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n validator: ValidatorType<T, S, F>,\n rootSchema: S,\n schema: S,\n path: SchemaFieldPath,\n defaultValue: T,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): T;\nexport default function getFromSchema<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n validator: ValidatorType<T, S, F>,\n rootSchema: S,\n schema: S,\n path: SchemaFieldPath,\n defaultValue: S,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): S;\nexport default function getFromSchema<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n validator: ValidatorType<T, S, F>,\n rootSchema: S,\n schema: S,\n path: SchemaFieldPath,\n defaultValue: T | S,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): T | S {\n const result = getFromSchemaInternal(validator, rootSchema, schema, path, experimental_customMergeAllOf);\n if (result === undefined) {\n return defaultValue;\n }\n return result;\n}\n","import { ANY_OF_KEY, ONE_OF_KEY, PROPERTIES_KEY, REQUIRED_KEY } from '../constants.ts';\nimport { getByPath, hasByPath } from '../pathUtils.ts';\nimport type {\n Experimental_CustomMergeAllOf,\n FormContextType,\n FoundFieldType,\n RJSFSchema,\n SchemaFieldPath,\n StrictRJSFSchema,\n ValidatorType,\n} from '../types.ts';\nimport findSelectedOptionInXxxOf from './findSelectedOptionInXxxOf.ts';\nimport getFromSchema from './getFromSchema.ts';\n\n/** Unique schema that represents no schema was found, exported for testing purposes */\nexport const NOT_FOUND_SCHEMA = { title: '!@#$_UNKNOWN_$#@!' };\n\n/** Finds the field specified by the `path` within the root or recursed `schema`. If there is no field for the specified\n * `path`, then the default `{ field: undefined, isRequired: undefined }` is returned. It determines whether a leaf\n * field is in the `required` list for its parent and if so, it is marked as required on return.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be forwarded to all the APIs\n * @param rootSchema - The root schema that will be forwarded to all the APIs\n * @param schema - The node within the JSON schema in which to search\n * @param path - The keys in the path to the desired field\n * @param [formData={}] - The form data that is used to determine which anyOf/oneOf option to descend\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - An object that contains the field and its required state. If no field can be found then\n * `{ field: undefined, isRequired: undefined }` is returned.\n */\nexport default function findFieldInSchema<\n T = undefined,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n validator: ValidatorType<T, S, F>,\n rootSchema: S,\n schema: S,\n path: SchemaFieldPath,\n formData: T = {} as T,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): FoundFieldType<S> {\n const pathList = Array.isArray(path) ? [...path] : path.split('.');\n let parentField = schema;\n\n // store the desired field into a variable and removing it from the `pathList`\n const fieldName = pathList.pop()!;\n const fieldNameKey = String(fieldName);\n\n if (pathList.length) {\n // drilling into the schema for each sub-path and taking into account of the any/oneOfs\n pathList.forEach((subPath) => {\n parentField = getFromSchema<T, S, F>(\n validator,\n rootSchema,\n parentField,\n [PROPERTIES_KEY, subPath],\n {} as S,\n experimental_customMergeAllOf,\n );\n if (hasByPath(parentField, ONE_OF_KEY)) {\n // if this sub-path has a `oneOf` then use the formData to drill into the schema with the selected option\n parentField = findSelectedOptionInXxxOf(\n validator,\n rootSchema,\n parentField,\n fieldNameKey,\n ONE_OF_KEY,\n getByPath<T>(formData, subPath),\n experimental_customMergeAllOf,\n )!;\n } else if (hasByPath(parentField, ANY_OF_KEY)) {\n // if this sub-path has a `anyOf` then use the formData to drill into the schema with the selected option\n parentField = findSelectedOptionInXxxOf(\n validator,\n rootSchema,\n parentField,\n fieldNameKey,\n ANY_OF_KEY,\n getByPath<T>(formData, subPath),\n experimental_customMergeAllOf,\n )!;\n }\n });\n }\n\n if (hasByPath(parentField, ONE_OF_KEY)) {\n // When oneOf is in the root schema, use the formData to drill into the schema with the selected option\n parentField = findSelectedOptionInXxxOf(\n validator,\n rootSchema,\n parentField,\n fieldNameKey,\n ONE_OF_KEY,\n formData,\n experimental_customMergeAllOf,\n )!;\n } else if (hasByPath(parentField, ANY_OF_KEY)) {\n // When anyOf is in the root schema, use the formData to drill into the schema with the selected option\n parentField = findSelectedOptionInXxxOf(\n validator,\n rootSchema,\n parentField,\n fieldNameKey,\n ANY_OF_KEY,\n formData,\n experimental_customMergeAllOf,\n )!;\n }\n\n // taking the most updated `parentField`, get our desired field\n let field: S | undefined = getFromSchema<T, S, F>(\n validator,\n rootSchema,\n parentField,\n [PROPERTIES_KEY, fieldName],\n NOT_FOUND_SCHEMA as S,\n experimental_customMergeAllOf,\n );\n if (field === NOT_FOUND_SCHEMA) {\n field = undefined;\n }\n // check to see if our desired field is in the `required` list for its parent\n const requiredArray = getFromSchema<T, S, F>(\n validator,\n rootSchema,\n parentField,\n REQUIRED_KEY,\n [] as T,\n experimental_customMergeAllOf,\n );\n let isRequired: boolean | undefined;\n if (field && Array.isArray(requiredArray)) {\n isRequired = requiredArray.includes(fieldNameKey);\n }\n\n return { field, isRequired };\n}\n","import { ONE_OF_KEY, REF_KEY, JUNK_OPTION_ID, ANY_OF_KEY } from '../constants.ts';\nimport getDiscriminatorFieldFromSchema from '../getDiscriminatorFieldFromSchema.ts';\nimport getOptionMatchingSimpleDiscriminator from '../getOptionMatchingSimpleDiscriminator.ts';\nimport guessType from '../guessType.ts';\nimport isObject from '../isObject.ts';\nimport { getByPath, hasByPath } from '../pathUtils.ts';\nimport type {\n Experimental_CustomMergeAllOf,\n FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n ValidatorType,\n} from '../types.ts';\nimport getFirstMatchingOption from './getFirstMatchingOption.ts';\nimport retrieveSchema, { resolveAllReferences } from './retrieveSchema.ts';\n\n/** A junk option used to determine when the getFirstMatchingOption call really matches an option rather than returning\n * the first item\n */\nexport const JUNK_OPTION: StrictRJSFSchema = {\n type: 'object',\n $id: JUNK_OPTION_ID,\n properties: {\n __not_really_there__: {\n type: 'number',\n },\n },\n};\n\n/** Recursive function that calculates the score of a `formData` against the given `schema`. The computation is fairly\n * simple. Initially the total score is 0. When `schema.properties` object exists, then all the `key/value` pairs within\n * the object are processed as follows after obtaining the formValue from `formData` using the `key`:\n * - If the `value` contains a `$ref`, `calculateIndexScore()` is called recursively with the formValue and the new\n * schema that is the result of the ref in the schema being resolved and that sub-schema's resulting score is added to\n * the total.\n * - If the `value` contains a `oneOf` and there is a formValue, then score based on the index returned from calling\n * `getClosestMatchingOption()` of that oneOf.\n * - If the type of the `value` is 'object', `calculateIndexScore()` is called recursively with the formValue and the\n * `value` itself as the sub-schema, and the score is added to the total.\n * - If the type of the `value` matches the guessed-type of the `formValue`, the score is incremented by 1, UNLESS the\n * value has a `default` or `const`. In those case, if the `default` or `const` and the `formValue` match, the score\n * is incremented by another 1 otherwise it is decremented by 1.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be used when necessary\n * @param rootSchema - The root JSON schema of the entire form\n * @param schema - The schema for which the score is being calculated\n * @param formData - The form data associated with the schema, used to calculate the score\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - The score a schema against the formData\n */\nexport function calculateIndexScore<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n validator: ValidatorType<T, S, F>,\n rootSchema: S,\n schema?: S,\n formData?: any,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): number {\n let totalScore = 0;\n if (schema) {\n if (isObject(schema.properties)) {\n totalScore += Object.entries(schema.properties).reduce((score, [key, value]) => {\n const formValue = formData?.[key];\n if (typeof value === 'boolean') {\n return score;\n }\n if (hasByPath(value, REF_KEY)) {\n const newSchema = retrieveSchema<T, S, F>(\n validator,\n value as S,\n rootSchema,\n formValue,\n experimental_customMergeAllOf,\n );\n return (\n score +\n calculateIndexScore<T, S, F>(\n validator,\n rootSchema,\n newSchema,\n formValue || {},\n experimental_customMergeAllOf,\n )\n );\n }\n if ((hasByPath(value, ONE_OF_KEY) || hasByPath(value, ANY_OF_KEY)) && formValue) {\n const xxxOfKey = hasByPath(value, ONE_OF_KEY) ? ONE_OF_KEY : ANY_OF_KEY;\n const discriminator = getDiscriminatorFieldFromSchema<S>(value as S);\n return (\n score +\n getClosestMatchingOption<T, S, F>(\n validator,\n rootSchema,\n formValue,\n getByPath<S[]>(value, xxxOfKey),\n -1,\n discriminator,\n experimental_customMergeAllOf,\n )\n );\n }\n if (value.type === 'object') {\n // If the structure is matching then give it a little boost in score\n const structureBoost = typeof formValue === 'object' && formValue !== null ? 1 : 0;\n return (\n score +\n structureBoost +\n calculateIndexScore<T, S, F>(validator, rootSchema, value as S, formValue, experimental_customMergeAllOf)\n );\n }\n if (value.type === guessType(formValue)) {\n // If the types match, then we bump the score by one\n let newScore = score + 1;\n if (value.default) {\n // If the schema contains a readonly default value score the value that matches the default higher and\n // any non-matching value lower\n newScore += formValue === value.default ? 1 : -1;\n } else if (value.const) {\n // If the schema contains a const value score the value that matches the default higher and\n // any non-matching value lower\n newScore += formValue === value.const ? 1 : -1;\n }\n // TODO eventually, deal with enums/arrays\n return newScore;\n }\n return score;\n }, 0);\n } else if (typeof schema.type === 'string' && schema.type === guessType(formData)) {\n totalScore += 1;\n }\n }\n return totalScore;\n}\n\n/** Determines which of the given `options` provided most closely matches the `formData`. Using\n * `getFirstMatchingOption()` to match two schemas that differ only by the readOnly, default or const value of a field\n * based on the `formData` and returns 0 when there is no match. Rather than passing in all the `options` at once to\n * this utility, instead an array of valid option indexes is created by iterating over the list of options, call\n * `getFirstMatchingOptions` with a list of one junk option and one good option, seeing if the good option is considered\n * matched.\n *\n * Once the list of valid indexes is created, if there is only one valid index, just return it. Otherwise, if there are\n * no valid indexes, then fill the valid indexes array with the indexes of all the options. Next, the index of the\n * option with the highest score is determined by iterating over the list of valid options, calling\n * `calculateIndexScore()` on each, comparing it against the current best score, and returning the index of the one that\n * eventually has the best score.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be used when necessary\n * @param rootSchema - The root JSON schema of the entire form\n * @param formData - The form data associated with the schema\n * @param options - The list of options that can be selected from\n * @param [selectedOption=-1] - The index of the currently selected option, defaulted to -1 if not specified\n * @param [discriminatorField] - The optional name of the field within the options object whose value is used to\n * determine which option is selected\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - The index of the option that is the closest match to the `formData` or the `selectedOption` if no match\n */\nexport default function getClosestMatchingOption<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n validator: ValidatorType<T, S, F>,\n rootSchema: S,\n formData: T | undefined,\n options: S[],\n selectedOption = -1,\n discriminatorField?: string,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): number {\n // First resolve any refs in the options\n const resolvedOptions = options.map((option) => resolveAllReferences<S>(option, rootSchema, []));\n\n const simpleDiscriminatorMatch = getOptionMatchingSimpleDiscriminator(formData, options, discriminatorField);\n if (typeof simpleDiscriminatorMatch === 'number') {\n return simpleDiscriminatorMatch;\n }\n\n // Reduce the array of options down to a list of the indexes that are considered matching options\n const allValidIndexes = resolvedOptions.reduce((validList: number[], option, index: number) => {\n const testOptions: S[] = [JUNK_OPTION as S, option];\n const match = getFirstMatchingOption<T, S, F>(validator, formData, testOptions, rootSchema, discriminatorField);\n // The match is the real option, so add its index to list of valid indexes\n if (match === 1) {\n validList.push(index);\n }\n return validList;\n }, []);\n\n // There is only one valid index, so return it!\n if (allValidIndexes.length === 1) {\n return allValidIndexes[0];\n }\n if (!allValidIndexes.length) {\n // No indexes were valid, so we'll score all the options, add all the indexes\n allValidIndexes.push(...resolvedOptions.keys());\n }\n interface BestType {\n bestIndex: number;\n bestScore: number;\n }\n const scoreCount = new Set<number>();\n // Score all the options in the list of valid indexes and return the index with the best score\n const { bestIndex }: BestType = allValidIndexes.reduce(\n (scoreData: BestType, index: number) => {\n const { bestScore } = scoreData;\n const option = resolvedOptions[index];\n const score = calculateIndexScore(validator, rootSchema, option, formData, experimental_customMergeAllOf);\n scoreCount.add(score);\n if (score > bestScore) {\n return { bestIndex: index, bestScore: score };\n }\n return scoreData;\n },\n { bestIndex: selectedOption, bestScore: 0 },\n );\n // if all scores are the same go with selectedOption\n if (scoreCount.size === 1 && selectedOption >= 0) {\n return selectedOption;\n }\n\n return bestIndex;\n}\n","import type { JSONSchema7Type } from 'json-schema';\n\nimport { CONST_KEY, getSchemaType, isObject } from './index.ts';\nimport type { RJSFSchema, StrictRJSFSchema } from './types.ts';\n\n/**\n * Checks if the schema const property value is an AJV $data reference\n * and the current schema is not an object or array\n *\n * @param schema - The schema to check if the const is an AJV $data reference\n * @returns - true if the schema const property value is an AJV $data reference otherwise false.\n */\nexport default function constIsAjvDataReference<S extends StrictRJSFSchema = RJSFSchema>(schema: S): boolean {\n const schemaConst = schema[CONST_KEY] as JSONSchema7Type & { $data: string };\n const schemaType = getSchemaType<S>(schema);\n return (\n isObject(schemaConst) && typeof schemaConst?.$data === 'string' && schemaType !== 'object' && schemaType !== 'array'\n );\n}\n","import { CONST_KEY } from './constants.ts';\nimport type { RJSFSchema, StrictRJSFSchema } from './types.ts';\n\n/** This function checks if the given `schema` matches a single constant value. This happens when either the schema has\n * an `enum` array with a single value or there is a `const` defined.\n *\n * @param schema - The schema for a field\n * @returns - True if the `schema` has a single constant value, false otherwise\n */\nexport default function isConstant<S extends StrictRJSFSchema = RJSFSchema>(schema: S) {\n return (Array.isArray(schema.enum) && schema.enum.length === 1) || CONST_KEY in schema;\n}\n","import isObject from './isObject.ts';\nimport type { RJSFSchema, StrictRJSFSchema } from './types.ts';\n\n/** Detects whether the given `schema` contains fixed items. This is the case when `schema.items` is an array that only\n * contains objects.\n *\n * @param schema - The schema in which to check for fixed items\n * @returns - True if there are fixed items in the schema, false otherwise\n */\nexport default function isFixedItems<S extends StrictRJSFSchema = RJSFSchema>(schema: S) {\n return Array.isArray(schema.items) && schema.items.every((item) => isObject(item));\n}\n","import type { GenericObjectType } from './index.ts';\nimport isObject from './isObject.ts';\n\n/** Merges the `defaults` object of type `T` into the `formData` of type `T`\n *\n * When merging defaults and form data, we want to merge in this specific way:\n * - objects are deeply merged\n * - arrays are merged in such a way that:\n * - when the array is set in form data, only array entries set in form data\n * are deeply merged; additional entries from the defaults are ignored unless `mergeExtraArrayDefaults` is true, in\n * which case the extras are appended onto the end of the form data\n * - when the array is not set in form data, the default is copied over\n * - scalars are overwritten/set by form data unless undefined and there is a default AND `defaultSupercedesUndefined`\n * is true\n *\n * @param [defaults] - The defaults to merge\n * @param [formData] - The form data into which the defaults will be merged\n * @param [mergeExtraArrayDefaults=false] - If true, any additional default array entries are appended onto the formData\n * @param [defaultSupercedesUndefined=false] - If true, an explicit undefined value will be overwritten by the default value\n * @param [overrideFormDataWithDefaults=false] - If true, the default value will overwrite the form data value. If the value\n * doesn't exist in the default, we take it from formData and in the case where the value is set to undefined in formData.\n * This is useful when we have already merged formData with defaults and want to add an additional field from formData\n * that does not exist in defaults.\n * @returns - The resulting merged form data with defaults\n */\nexport default function mergeDefaultsWithFormData<T = any>(\n defaults?: T,\n formData?: T,\n mergeExtraArrayDefaults = false,\n defaultSupercedesUndefined = false,\n overrideFormDataWithDefaults = false,\n): T | undefined {\n if (Array.isArray(formData)) {\n const defaultsArray = Array.isArray(defaults) ? defaults : [];\n\n // If overrideFormDataWithDefaults is true, we want to override the formData with the defaults\n const overrideArray = overrideFormDataWithDefaults ? defaultsArray : formData;\n const overrideOppositeArray = overrideFormDataWithDefaults ? formData : defaultsArray;\n\n const mapped = overrideArray.map((value, idx) => {\n // We want to explicitly make sure that the value is NOT undefined since null, 0 and empty space are valid values\n if (overrideOppositeArray[idx] !== undefined) {\n return mergeDefaultsWithFormData(\n defaultsArray[idx],\n formData[idx],\n mergeExtraArrayDefaults,\n defaultSupercedesUndefined,\n overrideFormDataWithDefaults,\n );\n }\n return value;\n });\n\n // Merge any extra defaults when mergeExtraArrayDefaults is true\n // Or when overrideFormDataWithDefaults is true and the default array is shorter than the formData array\n if ((mergeExtraArrayDefaults || overrideFormDataWithDefaults) && mapped.length < overrideOppositeArray.length) {\n mapped.push(...overrideOppositeArray.slice(mapped.length));\n }\n return mapped as unknown as T;\n }\n if (isObject(formData)) {\n // oxlint-disable-next-line prefer-object-spread -- spread loses T type, Object.assign preserves it\n const acc: { [key in keyof T]: any } = Object.assign({}, defaults); // Prevent mutation of source object.\n const formDataObj: GenericObjectType = formData;\n const defaultsObj: GenericObjectType | undefined = isObject(defaults) ? defaults : undefined;\n return Object.keys(formDataObj).reduce((accumulator, key) => {\n const keyValue = formDataObj[key];\n const keyExistsInDefaults = defaultsObj !== undefined && key in defaultsObj;\n const keyExistsInFormData = key in formDataObj;\n const keyDefault = defaultsObj?.[key] ?? {};\n // If any direct child of this key's default is itself an object or array,\n // the shallow spread below would bypass its merge rules. Route those cases\n // to the recursive path; the recursive call repeats this check one level deeper.\n const defaultValueNeedsDeepMerge =\n keyExistsInDefaults &&\n isObject(keyDefault) &&\n Object.values(keyDefault).some((v) => isObject(v) || Array.isArray(v));\n\n const keyDefaultIsObject = keyExistsInDefaults && isObject(defaultsObj?.[key]);\n const keyHasFormDataObject = keyExistsInFormData && isObject(keyValue);\n\n if (keyDefaultIsObject && keyHasFormDataObject && !defaultValueNeedsDeepMerge) {\n accumulator[key as keyof T] = {\n ...defaultsObj?.[key],\n ...keyValue,\n };\n return accumulator;\n }\n\n accumulator[key as keyof T] = mergeDefaultsWithFormData<T>(\n defaultsObj?.[key],\n keyValue,\n mergeExtraArrayDefaults,\n defaultSupercedesUndefined,\n // overrideFormDataWithDefaults can be true only when the key value exists in defaults\n // Or if the key value doesn't exist in formData\n overrideFormDataWithDefaults && (keyExistsInDefaults || !keyExistsInFormData),\n );\n return acc;\n }, acc);\n }\n\n /**\n * If the defaultSupercedesUndefined flag is true\n * And formData is set to undefined or null and defaults are defined\n * Or if formData is a number and is NaN return defaults\n * Or if overrideFormDataWithDefaults flag is true and formData is set to not undefined/null return defaults\n */\n if (\n (defaultSupercedesUndefined &&\n ((!(defaults === undefined) && formData == null) || (typeof formData === 'number' && Number.isNaN(formData)))) ||\n (overrideFormDataWithDefaults && formData != null)\n ) {\n return defaults;\n }\n\n return formData;\n}\n","import isObject from './isObject.ts';\nimport type { GenericObjectType } from './types.ts';\n\n/** Recursively merge deeply nested objects.\n *\n * @param obj1 - The first object to merge\n * @param obj2 - The second object to merge\n * @param [concatArrays=false] - Optional flag that, when true, will cause arrays to be concatenated. Use\n * \"preventDuplicates\" to merge arrays in a manner that prevents any duplicate entries from being merged.\n * NOTE: Uses shallow comparison for the duplicate checking.\n * @returns - A new object that is the merge of the two given objects\n */\nexport default function mergeObjects(\n obj1: GenericObjectType,\n obj2: GenericObjectType,\n concatArrays: boolean | 'preventDuplicates' = false,\n) {\n return Object.keys(obj2).reduce(\n (acc, key) => {\n const left = obj1 ? obj1[key] : {},\n right = obj2[key];\n if (obj1 && key in obj1 && isObject(right)) {\n acc[key] = mergeObjects(left, right, concatArrays);\n } else if (concatArrays && Array.isArray(left) && Array.isArray(right)) {\n let toMerge = right;\n if (concatArrays === 'preventDuplicates') {\n toMerge = right.reduce((result, value) => {\n if (!left.includes(value)) {\n result.push(value);\n }\n return result;\n }, []);\n }\n acc[key] = left.concat(toMerge);\n } else {\n acc[key] = right;\n }\n return acc;\n },\n { ...obj1 },\n ); // Prevent mutation of source object.\n}\n","import { CONST_KEY, ENUM_KEY } from './constants.ts';\nimport type { RJSFSchema, StrictRJSFSchema } from './types.ts';\n\n/** Returns the constant value from the schema when it is either a single value enum or has a const key. Otherwise\n * throws an error.\n *\n * @param schema - The schema from which to obtain the constant value\n * @returns - The constant value for the schema\n * @throws - Error when the schema does not have a constant value\n */\nexport default function toConstant<S extends StrictRJSFSchema = RJSFSchema>(schema: S) {\n if (ENUM_KEY in schema && Array.isArray(schema.enum) && schema.enum.length === 1) {\n return schema.enum[0];\n }\n if (CONST_KEY in schema) {\n return schema.const;\n }\n throw new Error('schema cannot be inferred as a constant');\n}\n","import { CONST_KEY, DEFAULT_KEY } from './constants.ts';\nimport getDiscriminatorFieldFromSchema from './getDiscriminatorFieldFromSchema.ts';\nimport getPropertySchema from './getPropertySchema.ts';\nimport getUiOptions from './getUiOptions.ts';\nimport { getByPath } from './pathUtils.ts';\nimport toConstant from './toConstant.ts';\nimport type { RJSFSchema, EnumOptionsType, EnumValue, StrictRJSFSchema, FormContextType, UiSchema } from './types.ts';\n\n/** Reorders `options` according to `order`, which may contain a `'*'` wildcard representing all\n * remaining options in their original order. Options not listed in `order` (and not covered by\n * a wildcard) are dropped.\n */\nfunction applyEnumOrder<S extends StrictRJSFSchema = RJSFSchema>(\n options: EnumOptionsType<S>[],\n order: EnumValue[],\n): EnumOptionsType<S>[] {\n const optionsByValue = new Map(options.map((opt) => [String(opt.value), opt]));\n const orderedKeys = new Set(order.filter((v) => v !== '*').map(String));\n const rest = options.filter((opt) => !orderedKeys.has(String(opt.value)));\n\n return order.flatMap((entry) => {\n if (entry === '*') {\n return rest;\n }\n const opt = optionsByValue.get(String(entry));\n return opt ? [opt] : [];\n });\n}\n\n/** Gets the list of options from the `schema`. If the schema has an enum list, then those enum values are returned. The\n * label will be the same as the `value`.\n *\n * If the schema has a `oneOf` or `anyOf`, then the value is the list of either:\n * - The `const` values from the schema if present\n * - If the schema has a discriminator and the label using either the `schema.title` or the value. If a `uiSchema` is\n * provided, and it has the `ui:enumNames` matched with `enum` or it has an associated `oneOf` or `anyOf` with a list of\n * objects containing `ui:title` then the UI schema values will replace the values from the schema.\n *\n * @param schema - The schema from which to extract the options list\n * @param [uiSchema] - The optional uiSchema from which to get alternate labels for the options\n * @returns - The list of options from the schema\n */\nexport default function optionsList<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n schema: S,\n uiSchema?: UiSchema<T, S, F>,\n): EnumOptionsType<S>[] | undefined {\n if (schema.enum) {\n let enumNames: string[] | Record<string | number, string> | undefined;\n let enumOrder: EnumValue[] | undefined;\n if (uiSchema) {\n const { enumNames: uiEnumNames, enumOrder: uiEnumOrder } = getUiOptions<T, S, F>(uiSchema);\n enumNames = uiEnumNames;\n enumOrder = uiEnumOrder;\n }\n let options = schema.enum.map((value, i) => {\n const label = Array.isArray(enumNames)\n ? enumNames[i] || String(value)\n : enumNames?.[String(value)] || String(value);\n return { label, value };\n });\n if (enumOrder) {\n options = applyEnumOrder(options, enumOrder);\n }\n return options;\n }\n let altSchemas: S['anyOf'] | S['oneOf'] = undefined;\n let altUiSchemas: UiSchema<T, S, F> | undefined = undefined;\n if (schema.anyOf) {\n altSchemas = schema.anyOf;\n altUiSchemas = uiSchema?.anyOf;\n } else if (schema.oneOf) {\n altSchemas = schema.oneOf;\n altUiSchemas = uiSchema?.oneOf;\n }\n // See if there is a discriminator path specified in the schema, and if so, use it as the selectorField, otherwise\n // pull one from the uiSchema\n let selectorField = getDiscriminatorFieldFromSchema<S>(schema);\n if (uiSchema) {\n const { optionsSchemaSelector = selectorField } = getUiOptions<T, S, F>(uiSchema);\n selectorField = optionsSchemaSelector;\n }\n return altSchemas?.map((aSchemaDef, index) => {\n const { title } = getUiOptions<T, S, F>(altUiSchemas?.[index]);\n const aSchema = aSchemaDef as S;\n let value: EnumOptionsType<S>['value'];\n let label = title;\n if (selectorField) {\n const innerSchema = getPropertySchema<S>(aSchema, selectorField);\n value = getByPath(innerSchema, DEFAULT_KEY, getByPath(innerSchema, CONST_KEY));\n // Use nullish coalescing so that an explicitly empty string title is preserved\n label = label ?? innerSchema?.title ?? aSchema.title ?? String(value);\n } else {\n value = toConstant(aSchema);\n label = label ?? aSchema.title ?? String(value);\n }\n return {\n schema: aSchema,\n label,\n value,\n };\n });\n}\n","import isConstant from '../isConstant.ts';\nimport type {\n FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n ValidatorType,\n Experimental_CustomMergeAllOf,\n} from '../types.ts';\nimport retrieveSchema from './retrieveSchema.ts';\n\n/** Checks to see if the `schema` combination represents a select\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be used when necessary\n * @param theSchema - The schema for which check for a select flag is desired\n * @param [rootSchema] - The root schema, used to primarily to look up `$ref`s\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - True if schema contains a select, otherwise false\n */\nexport default function isSelect<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n validator: ValidatorType<T, S, F>,\n theSchema: S,\n rootSchema: S = {} as S,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n) {\n const schema = retrieveSchema<T, S, F>(validator, theSchema, rootSchema, undefined, experimental_customMergeAllOf);\n const altSchemas = schema.oneOf || schema.anyOf;\n if (Array.isArray(schema.enum)) {\n return true;\n }\n if (Array.isArray(altSchemas)) {\n return altSchemas.every((altSchema) => typeof altSchema !== 'boolean' && isConstant(altSchema));\n }\n return false;\n}\n","import type {\n FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n ValidatorType,\n Experimental_CustomMergeAllOf,\n} from '../types.ts';\nimport isSelect from './isSelect.ts';\n\n/** Checks to see if the `schema` combination represents a multi-select\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be used when necessary\n * @param schema - The schema for which check for a multi-select flag is desired\n * @param [rootSchema] - The root schema, used to primarily to look up `$ref`s\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - True if schema contains a multi-select, otherwise false\n */\nexport default function isMultiSelect<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n validator: ValidatorType<T, S, F>,\n schema: S,\n rootSchema?: S,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n) {\n if (!schema.uniqueItems || !schema.items || typeof schema.items === 'boolean') {\n return false;\n }\n return isSelect<T, S, F>(validator, schema.items as S, rootSchema, experimental_customMergeAllOf);\n}\n","import type { JSONSchema7Object } from 'json-schema';\n\nimport {\n ALL_OF_KEY,\n ANY_OF_KEY,\n CONST_KEY,\n DEFAULT_KEY,\n DEPENDENCIES_KEY,\n IF_KEY,\n ONE_OF_KEY,\n REF_KEY,\n} from '../constants.ts';\nimport constIsAjvDataReference from '../constIsAjvDataReference.ts';\nimport deepEquals from '../deepEquals.ts';\nimport findSchemaDefinition from '../findSchemaDefinition.ts';\nimport getDiscriminatorFieldFromSchema from '../getDiscriminatorFieldFromSchema.ts';\nimport getPropertySchema from '../getPropertySchema.ts';\nimport getSchemaType from '../getSchemaType.ts';\nimport isConstant from '../isConstant.ts';\nimport isFixedItems from '../isFixedItems.ts';\nimport isObject from '../isObject.ts';\nimport mergeDefaultsWithFormData from '../mergeDefaultsWithFormData.ts';\nimport mergeObjects from '../mergeObjects.ts';\nimport mergeSchemas from '../mergeSchemas.ts';\nimport optionsList from '../optionsList.ts';\nimport { getByPath } from '../pathUtils.ts';\nimport type {\n Experimental_CustomMergeAllOf,\n Experimental_DefaultFormStateBehavior,\n FormContextType,\n GenericObjectType,\n RJSFSchema,\n StrictRJSFSchema,\n ValidatorType,\n} from '../types.ts';\nimport getClosestMatchingOption from './getClosestMatchingOption.ts';\nimport isMultiSelect from './isMultiSelect.ts';\nimport isSelect from './isSelect.ts';\nimport retrieveSchema, { resolveDependencies } from './retrieveSchema.ts';\n\nconst PRIMITIVE_TYPES = ['string', 'number', 'integer', 'boolean', 'null'];\n\n/** Enum that indicates how `schema.additionalItems` should be handled by the `getInnerSchemaForArrayItem()` function.\n */\nexport enum AdditionalItemsHandling {\n Ignore,\n Invert,\n Fallback,\n}\n\n/** Given a `schema` will return an inner schema that for an array item. This is computed differently based on the\n * `additionalItems` enum and the value of `idx`. There are four possible returns:\n * 1. If `idx` is >= 0, then if `schema.items` is an array the `idx`th element of the array is returned if it is a valid\n * index and not a boolean, otherwise it falls through to 3.\n * 2. If `schema.items` is not an array AND truthy and not a boolean, then `schema.items` is returned since it actually\n * is a schema, otherwise it falls through to 3.\n * 3. If `additionalItems` is not `AdditionalItemsHandling.Ignore` and `schema.additionalItems` is an object, then\n * `schema.additionalItems` is returned since it actually is a schema, otherwise it falls through to 4.\n * 4. {} is returned representing an empty schema\n *\n * @param schema - The schema from which to get the particular item\n * @param [additionalItems=AdditionalItemsHandling.Ignore] - How do we want to handle additional items?\n * @param [idx=-1] - Index, if non-negative, will be used to return the idx-th element in a `schema.items` array\n * @returns - The best fit schema object from the `schema` given the `additionalItems` and `idx` modifiers\n */\nexport function getInnerSchemaForArrayItem<S extends StrictRJSFSchema = RJSFSchema>(\n schema: S,\n additionalItems: AdditionalItemsHandling = AdditionalItemsHandling.Ignore,\n idx = -1,\n): S {\n if (idx >= 0) {\n if (Array.isArray(schema.items) && idx < schema.items.length) {\n const item = schema.items[idx];\n if (typeof item !== 'boolean') {\n return item as S;\n }\n }\n } else if (schema.items && !Array.isArray(schema.items) && typeof schema.items !== 'boolean') {\n return schema.items as S;\n }\n if (additionalItems !== AdditionalItemsHandling.Ignore && isObject(schema.additionalItems)) {\n return schema.additionalItems as S;\n }\n return {} as S;\n}\n\n/** Determines whether `value` holds anything: a non-empty string or array, or an object with at least one own key.\n * Everything else — including numbers, booleans, `null` and `undefined` — has no content.\n *\n * @param value - The value to inspect\n * @returns - True if the value holds content, otherwise false\n */\nfunction hasContent(value: unknown): boolean {\n if (typeof value === 'string' || Array.isArray(value)) {\n return value.length > 0;\n }\n if (typeof value === 'object' && value !== null) {\n return Object.keys(value).length > 0;\n }\n return false;\n}\n\n/** Checks if the given `schema` contains the `null` type along with another type AND if the `default` contained within\n * the schema is `null` AND the `computedDefault` is empty. If all of those conditions are true, then the `schema`'s\n * default should be `null` rather than `computedDefault`.\n *\n * @param schema - The schema to inspect\n * @param computedDefault - The computed default for the schema\n * @returns - Flag indicating whether a null should be returned instead of the computedDefault\n */\nexport function computeDefaultBasedOnSchemaTypeAndDefaults<T = any, S extends StrictRJSFSchema = RJSFSchema>(\n schema: S,\n computedDefault: T,\n) {\n const { default: schemaDefault, type } = schema;\n const shouldReturnNullAsDefault =\n Array.isArray(type) && type.includes('null') && !hasContent(computedDefault) && schemaDefault === null;\n return shouldReturnNullAsDefault ? (null as T) : computedDefault;\n}\n\n/** Either add `computedDefault` at `key` into `obj` or not add it based on its value, the value of\n * `includeUndefinedValues`, the value of `emptyObjectFields` and if its parent field is required. Generally undefined\n * `computedDefault` values are added only when `includeUndefinedValues` is either true/\"excludeObjectChildren\". If `\n * includeUndefinedValues` is false and `emptyObjectFields` is not \"skipDefaults\", then non-undefined and non-empty-object\n * values will be added based on certain conditions.\n *\n * @param acc - The object into which the computed default may be added\n * @param key - The key into the object at which the computed default may be added\n * @param computedDefault - The computed default value that maybe should be added to the obj\n * @param includeUndefinedValues - Optional flag, if true, cause undefined values to be added as defaults.\n * If \"excludeObjectChildren\", cause undefined values for this object and pass `includeUndefinedValues` as\n * false when computing defaults for any nested object properties. If \"allowEmptyObject\", prevents undefined\n * values in this object while allow the object itself to be empty and passing `includeUndefinedValues` as\n * false when computing defaults for any nested object properties.\n * @param isParentRequired - The optional boolean that indicates whether the parent field is required\n * @param requiredFields - The list of fields that are required\n * @param experimental_defaultFormStateBehavior - Optional configuration object, if provided, allows users to override\n * default form state behavior\n * @param isConst - Optional flag, if true, indicates that the schema has a const property defined, thus we should always return the computedDefault since it's coming from the const.\n * @param isNullType - The type of the schema is null\n */\nfunction maybeAddDefaultToObject<T = any>(\n acc: GenericObjectType,\n key: string,\n computedDefault: T | T[] | undefined,\n includeUndefinedValues: boolean | 'excludeObjectChildren',\n isParentRequired?: boolean,\n requiredFields: string[] = [],\n experimental_defaultFormStateBehavior: Experimental_DefaultFormStateBehavior = {},\n isConst = false,\n isNullType = false,\n) {\n const { emptyObjectFields = 'populateAllDefaults' } = experimental_defaultFormStateBehavior;\n\n if (includeUndefinedValues === true || isConst) {\n // If includeUndefinedValues is explicitly true\n // Or if the schema has a const property defined, then we should always return the computedDefault since it's coming from the const.\n acc[key] = computedDefault;\n } else if (includeUndefinedValues === 'excludeObjectChildren') {\n // Fix for Issue #4709: When in 'excludeObjectChildren' mode, don't set primitive fields to empty objects\n // Only add the computed default if it's not an empty object placeholder for a primitive field\n if (\n (isNullType && computedDefault !== undefined) ||\n !isObject(computedDefault) ||\n Object.keys(computedDefault).length > 0\n ) {\n acc[key] = computedDefault;\n }\n // If computedDefault is an empty object {}, don't add it - let the field stay undefined\n } else if (emptyObjectFields !== 'skipDefaults') {\n // If isParentRequired is undefined, then we are at the root level of the schema so defer to the requiredness of\n // the field key itself in the `requiredField` list\n const isSelfOrParentRequired = isParentRequired === undefined ? requiredFields.includes(key) : isParentRequired;\n\n if (isObject(computedDefault)) {\n // If emptyObjectFields 'skipEmptyDefaults' store computedDefault if it's a non-empty object(e.g. not {})\n if (emptyObjectFields === 'skipEmptyDefaults') {\n if (Object.keys(computedDefault).length > 0) {\n acc[key] = computedDefault;\n }\n } // Else store computedDefault if it's a non-empty object(e.g. not {}) and satisfies certain conditions\n // Condition 1: If computedDefault is not empty or if the key is a required field\n // Condition 2: If the parent object is required or emptyObjectFields is not 'populateRequiredDefaults'\n else if (\n (Object.keys(computedDefault).length > 0 || requiredFields.includes(key)) &&\n (isSelfOrParentRequired || emptyObjectFields !== 'populateRequiredDefaults')\n ) {\n acc[key] = computedDefault;\n }\n } else if (\n // Store computedDefault if it's a defined primitive (e.g., true) and satisfies certain conditions\n // Condition 1: computedDefault is not undefined\n // Condition 2: If emptyObjectFields is 'populateAllDefaults' or 'skipEmptyDefaults)\n // Or if isSelfOrParentRequired is 'true' and the key is a required field\n computedDefault !== undefined &&\n (emptyObjectFields === 'populateAllDefaults' ||\n emptyObjectFields === 'skipEmptyDefaults' ||\n (isSelfOrParentRequired && requiredFields.includes(key)))\n ) {\n acc[key] = computedDefault;\n }\n }\n}\n\ninterface ComputeDefaultsProps<T = any, S extends StrictRJSFSchema = RJSFSchema> {\n /** Any defaults provided by the parent field in the schema */\n parentDefaults?: T;\n /** The options root schema, used to primarily to look up `$ref`s */\n rootSchema?: S;\n /** The current formData, if any, onto which to provide any missing defaults */\n rawFormData?: T;\n /** Optional flag, if true, cause undefined values to be added as defaults.\n * If \"excludeObjectChildren\", cause undefined values for this object and pass `includeUndefinedValues` as\n * false when computing defaults for any nested object properties.\n */\n includeUndefinedValues?: boolean | 'excludeObjectChildren';\n /** The list of ref names currently being recursed, used to prevent infinite recursion */\n _recurseList?: string[];\n /** Optional configuration object, if provided, allows users to override default form state behavior */\n experimental_defaultFormStateBehavior?: Experimental_DefaultFormStateBehavior;\n /** Optional function that allows for custom merging of `allOf` schemas */\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>;\n /** Optional flag, if true, indicates this schema was required in the parent schema. */\n required?: boolean;\n /** Optional flag, if true, indicates this schema was required because it is the root. */\n requiredAsRoot?: boolean;\n /** Optional flag, if true, It will merge defaults into formData.\n * The formData should take precedence unless it's not valid. This is useful when for example the value from formData does not exist in the schema 'enum' property, in such cases we take the value from the defaults because the value from the formData is not valid.\n */\n shouldMergeDefaultsIntoFormData?: boolean;\n /** Indicates whether initial defaults have been generated */\n initialDefaultsGenerated?: boolean;\n}\n\n/** Computes the defaults for the current `schema` given the `rawFormData` and `parentDefaults` if any. This drills into\n * each level of the schema, recursively, to fill out every level of defaults provided by the schema.\n *\n * @param validator - an implementation of the `ValidatorType` interface that will be used when necessary\n * @param rawSchema - The schema for which the default state is desired\n * @param computeDefaultsProps - Optional props for this function\n * @returns - The resulting `formData` with all the defaults provided\n */\nexport function computeDefaults<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n validator: ValidatorType<T, S, F>,\n rawSchema: S,\n computeDefaultsProps: ComputeDefaultsProps<T, S> = {},\n): T | T[] | undefined {\n const {\n parentDefaults,\n rawFormData,\n rootSchema = {} as S,\n includeUndefinedValues = false,\n _recurseList = [],\n experimental_defaultFormStateBehavior,\n experimental_customMergeAllOf,\n required,\n shouldMergeDefaultsIntoFormData = false,\n initialDefaultsGenerated,\n } = computeDefaultsProps;\n let formData: T = (isObject(rawFormData) ? rawFormData : {}) as T;\n const schema: S = isObject(rawSchema) ? rawSchema : ({} as S);\n // Compute the defaults recursively: give highest priority to deepest nodes unless nestedDefaultsPrecedence is ancestorWins.\n let defaults: T | T[] | undefined = parentDefaults;\n const preferParentDefaults =\n defaults && experimental_defaultFormStateBehavior?.nestedDefaultsPrecedence === 'ancestorWins';\n // If we get a new schema, then we need to recompute defaults again for the new schema found.\n let schemaToCompute: S | null = null;\n let experimental_dfsb_to_compute = experimental_defaultFormStateBehavior;\n let updatedRecurseList = _recurseList;\n if (\n schema[CONST_KEY] !== undefined &&\n experimental_defaultFormStateBehavior?.constAsDefaults !== 'never' &&\n !constIsAjvDataReference(schema)\n ) {\n defaults = schema[CONST_KEY] as unknown as T;\n } else if (\n isObject(defaults) &&\n isObject(schema.default) &&\n !schema[ANY_OF_KEY] &&\n !schema[ONE_OF_KEY] &&\n !schema[REF_KEY]\n ) {\n // For object defaults, merge defaults by precedence setting.\n // Skip this for anyOf/oneOf/$ref schemas - they need special handling.\n if (preferParentDefaults) {\n // Use schema.default as the base and only override values that are defined in parent defaults.\n defaults = mergeObjects(schema.default as GenericObjectType, defaults) as T;\n } else {\n // Only override parent defaults that are defined in schema.default.\n defaults = mergeObjects(defaults, schema.default as GenericObjectType) as T;\n }\n } else if (\n DEFAULT_KEY in schema &&\n !preferParentDefaults &&\n !schema[ANY_OF_KEY] &&\n !schema[ONE_OF_KEY] &&\n !schema[REF_KEY]\n ) {\n // If the schema has a default value and parentDefaults does not have precedence\n // And if the schema does not have anyOf or oneOf (since we need to merge the defaults with the formData)\n // Then we should use it as the default.\n defaults = schema.default as unknown as T;\n } else if (REF_KEY in schema) {\n const refName = schema[REF_KEY];\n // Use referenced schema defaults for this node.\n if (!_recurseList.includes(refName!)) {\n updatedRecurseList = _recurseList.concat(refName!);\n schemaToCompute = findSchemaDefinition<S>(refName, rootSchema);\n }\n\n // If the referenced schema exists and parentDefaults is not set\n // Then set the defaults from the current schema for the referenced schema.\n // Only do this if rawFormData has no meaningful data - we don't want to override user's existing values.\n // Check for undefined OR empty object - rawFormData may be coerced to {} when not an object.\n const hasNoExistingData =\n rawFormData === undefined || (isObject(rawFormData) && Object.keys(rawFormData).length === 0);\n if (schemaToCompute && !defaults && hasNoExistingData) {\n defaults = schema.default as T | undefined;\n }\n\n // If shouldMergeDefaultsIntoFormData is true\n // And the schemaToCompute is set and the rawFormData is not an object\n // Then set the formData to the rawFormData\n if (shouldMergeDefaultsIntoFormData && schemaToCompute && !isObject(rawFormData)) {\n formData = rawFormData as T;\n }\n } else if (DEPENDENCIES_KEY in schema) {\n // Get the default if set from properties to ensure the dependencies conditions are resolved based on it\n const defaultFormData: T = {\n ...getDefaultBasedOnSchemaType(validator, schema, computeDefaultsProps, defaults),\n ...formData,\n };\n const resolvedSchema = resolveDependencies<T, S, F>(\n validator,\n schema,\n rootSchema,\n false,\n [],\n defaultFormData,\n experimental_customMergeAllOf,\n );\n [schemaToCompute] = resolvedSchema; // pick the first element from resolve dependencies\n } else if (isFixedItems(schema) && !preferParentDefaults) {\n // If the schema contains fixed items and parentDefaults does not have precedence\n // Then construct defaults from defaults of array items.\n defaults = (schema.items! as S[]).map((itemSchema: S, idx: number) =>\n computeDefaults<T, S>(validator, itemSchema, {\n rootSchema,\n includeUndefinedValues,\n _recurseList,\n experimental_defaultFormStateBehavior,\n experimental_customMergeAllOf,\n parentDefaults: Array.isArray(parentDefaults) ? parentDefaults[idx] : undefined,\n rawFormData: formData,\n required,\n shouldMergeDefaultsIntoFormData,\n }),\n ) as T[];\n } else if (ONE_OF_KEY in schema) {\n const { oneOf, ...remaining } = schema;\n if (oneOf!.length === 0) {\n return undefined;\n }\n const discriminator = getDiscriminatorFieldFromSchema<S>(schema);\n const { type = 'null' } = remaining;\n if (\n !Array.isArray(type) &&\n PRIMITIVE_TYPES.includes(type) &&\n experimental_dfsb_to_compute?.constAsDefaults === 'skipOneOf'\n ) {\n // If we are in a oneOf of a primitive type, then we want to pass constAsDefaults as 'never' for the recursion\n experimental_dfsb_to_compute = {\n ...experimental_dfsb_to_compute,\n constAsDefaults: 'never',\n };\n }\n schemaToCompute = oneOf![\n getClosestMatchingOption<T, S, F>(\n validator,\n rootSchema,\n rawFormData ?? (schema.default as T),\n oneOf as S[],\n 0,\n discriminator,\n experimental_customMergeAllOf,\n )\n ] as S;\n schemaToCompute = mergeSchemas(remaining, schemaToCompute) as S;\n } else if (ANY_OF_KEY in schema) {\n const { anyOf, ...remaining } = schema;\n if (anyOf!.length === 0) {\n return undefined;\n }\n const discriminator = getDiscriminatorFieldFromSchema<S>(schema);\n schemaToCompute = anyOf![\n getClosestMatchingOption<T, S, F>(\n validator,\n rootSchema,\n rawFormData ?? (schema.default as T),\n anyOf as S[],\n 0,\n discriminator,\n experimental_customMergeAllOf,\n )\n ] as S;\n schemaToCompute = mergeSchemas(remaining, schemaToCompute) as S;\n }\n\n if (schemaToCompute) {\n return computeDefaults<T, S, F>(validator, schemaToCompute, {\n rootSchema,\n includeUndefinedValues,\n _recurseList: updatedRecurseList,\n experimental_defaultFormStateBehavior: experimental_dfsb_to_compute,\n experimental_customMergeAllOf,\n parentDefaults: defaults as T | undefined,\n rawFormData: rawFormData ?? formData,\n required,\n shouldMergeDefaultsIntoFormData,\n initialDefaultsGenerated,\n });\n }\n\n // No defaults defined for this node, fallback to generic typed ones.\n if (defaults === undefined) {\n defaults = schema.default as unknown as T;\n }\n\n const defaultBasedOnSchemaType = getDefaultBasedOnSchemaType(validator, schema, computeDefaultsProps, defaults);\n\n let defaultsWithFormData = defaultBasedOnSchemaType ?? defaults;\n // if shouldMergeDefaultsIntoFormData is true, then merge the defaults into the formData.\n if (shouldMergeDefaultsIntoFormData) {\n const { arrayMinItems = {} } = experimental_defaultFormStateBehavior || {};\n const { mergeExtraDefaults } = arrayMinItems;\n\n const matchingFormData = ensureFormDataMatchingSchema(\n validator,\n schema,\n rootSchema,\n rawFormData,\n experimental_defaultFormStateBehavior,\n experimental_customMergeAllOf,\n );\n if (!isObject(rawFormData) || ALL_OF_KEY in schema) {\n // If the formData is not an object which means it's a primitive field, then we need to merge the defaults into the formData.\n // Or if the schema has allOf, we need to merge the defaults into the formData because we don't compute the defaults for allOf.\n defaultsWithFormData = mergeDefaultsWithFormData<T>(\n defaultsWithFormData as T,\n matchingFormData as T,\n mergeExtraDefaults,\n true,\n ) as T;\n }\n }\n\n return defaultsWithFormData;\n}\n\n/**\n * Ensure that the formData matches the given schema. If it's not matching in the case of a selectField, we change it to match the schema.\n *\n * @param validator - an implementation of the `ValidatorType` interface that will be used when necessary\n * @param schema - The schema for which the formData state is desired\n * @param rootSchema - The root schema, used to primarily to look up `$ref`s\n * @param formData - The current formData\n * @param [experimental_defaultFormStateBehavior] - Optional configuration object, if provided, allows users to override default form state behavior\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - valid formData that matches schema\n */\nexport function ensureFormDataMatchingSchema<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n validator: ValidatorType<T, S, F>,\n schema: S,\n rootSchema: S,\n formData: T | undefined,\n experimental_defaultFormStateBehavior?: Experimental_DefaultFormStateBehavior,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): T | T[] | undefined {\n const shouldRetrieveAllOf =\n experimental_defaultFormStateBehavior?.allOf === 'populateDefaults' && ALL_OF_KEY in schema;\n const schemaToMatch = shouldRetrieveAllOf\n ? retrieveSchema<T, S, F>(validator, schema, rootSchema, formData, experimental_customMergeAllOf)\n : schema;\n const isSelectField =\n !isConstant<S>(schemaToMatch) &&\n isSelect<T, S, F>(validator, schemaToMatch, rootSchema, experimental_customMergeAllOf);\n let validFormData: T | T[] | undefined = formData;\n if (isSelectField) {\n const getOptionsList = optionsList<T, S, F>(schemaToMatch);\n const isValid = getOptionsList?.some((option) => deepEquals(option.value, formData));\n validFormData = isValid ? formData : undefined;\n }\n\n // Override the formData with the const if the constAsDefaults is set to always\n const constTakesPrecedence =\n schemaToMatch[CONST_KEY] && experimental_defaultFormStateBehavior?.constAsDefaults === 'always';\n if (constTakesPrecedence) {\n validFormData = schemaToMatch.const as T;\n } else if (isObject(validFormData) && isObject(schemaToMatch.properties)) {\n validFormData = Object.keys(schemaToMatch.properties).reduce(\n (acc: GenericObjectType, key: string) => {\n const propertySchema = getPropertySchema<S>(schemaToMatch, key);\n if (key in acc && (shouldRetrieveAllOf || (isObject(propertySchema) && ALL_OF_KEY in propertySchema))) {\n acc[key] = ensureFormDataMatchingSchema<T, S, F>(\n validator,\n propertySchema,\n rootSchema,\n acc[key],\n experimental_defaultFormStateBehavior,\n experimental_customMergeAllOf,\n );\n }\n return acc;\n },\n { ...(validFormData as GenericObjectType) },\n ) as T;\n }\n\n return validFormData;\n}\n\n/** Computes the default value for objects.\n *\n * @param validator - an implementation of the `ValidatorType` interface that will be used when necessary\n * @param rawSchema - The schema for which the default state is desired\n * @param computeDefaultsProps - Optional props for this function\n * @param defaults - Optional props for this function\n * @returns - The default value based on the schema type if they are defined for object or array schemas.\n */\nexport function getObjectDefaults<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n validator: ValidatorType<T, S, F>,\n rawSchema: S,\n {\n rawFormData,\n rootSchema = {} as S,\n includeUndefinedValues = false,\n _recurseList = [],\n experimental_defaultFormStateBehavior,\n experimental_customMergeAllOf,\n required,\n shouldMergeDefaultsIntoFormData,\n initialDefaultsGenerated,\n }: ComputeDefaultsProps<T, S> = {},\n defaults?: T | T[],\n): T {\n {\n const formData: T = (isObject(rawFormData) ? rawFormData : {}) as T;\n const schema: S = rawSchema;\n // Retrieve the schema:\n // - If schema contains `allOf` AND `experimental_defaultFormStateBehavior.allOf` is set to `populateDefaults`\n // - OR if schema contains an 'if' AND `emptyObjectFields` is not set to `skipEmptyDefaults`\n // This ensures we compute defaults correctly for schemas with these keywords.\n const shouldRetrieveSchema =\n (experimental_defaultFormStateBehavior?.allOf === 'populateDefaults' && ALL_OF_KEY in schema) ||\n (experimental_defaultFormStateBehavior?.emptyObjectFields !== 'skipEmptyDefaults' && IF_KEY in schema);\n const retrievedSchema = shouldRetrieveSchema\n ? retrieveSchema<T, S, F>(validator, schema, rootSchema, formData, experimental_customMergeAllOf)\n : schema;\n const parentConst = retrievedSchema[CONST_KEY];\n const objectDefaults = Object.keys(retrievedSchema.properties || {}).reduce(\n (acc: GenericObjectType, key: string) => {\n const propertySchema = getPropertySchema<S>(retrievedSchema, key);\n // Check if the parent schema has a const property defined AND we are supporting const as defaults, then we\n // should always return the computedDefault since it's coming from the const.\n const hasParentConst = isObject(parentConst) && (parentConst as JSONSchema7Object)[key] !== undefined;\n const hasConst =\n ((isObject(propertySchema) && CONST_KEY in propertySchema) || hasParentConst) &&\n experimental_defaultFormStateBehavior?.constAsDefaults !== 'never' &&\n !constIsAjvDataReference(propertySchema);\n // Compute the defaults for this node, with the parent defaults we might\n // have from a previous run: defaults[key].\n const computedDefault = computeDefaults<T, S, F>(validator, propertySchema, {\n rootSchema,\n _recurseList,\n experimental_defaultFormStateBehavior,\n experimental_customMergeAllOf,\n includeUndefinedValues: includeUndefinedValues === true,\n parentDefaults: getByPath<T>(defaults, key),\n rawFormData: getByPath<T>(formData, key),\n required: retrievedSchema.required?.includes(key),\n shouldMergeDefaultsIntoFormData,\n initialDefaultsGenerated,\n });\n\n maybeAddDefaultToObject<T>(\n acc,\n key,\n computedDefault,\n includeUndefinedValues,\n required,\n retrievedSchema.required,\n experimental_defaultFormStateBehavior,\n hasConst,\n propertySchema?.type === 'null',\n );\n\n return acc;\n },\n {},\n ) as T;\n if (retrievedSchema.additionalProperties && !initialDefaultsGenerated) {\n // as per spec additionalProperties may be either schema or boolean\n const additionalPropertiesSchema = isObject(retrievedSchema.additionalProperties)\n ? retrievedSchema.additionalProperties\n : {};\n\n const keys = new Set<string>();\n const formDataRequired: string[] = [];\n Object.keys(formData as GenericObjectType)\n .filter((key) => !retrievedSchema.properties || !retrievedSchema.properties[key])\n .forEach((key) => {\n keys.add(key);\n formDataRequired.push(key);\n });\n // Only seed keys from schema defaults when formData has no additionalProperties of its own.\n // If the user already has data (e.g. after a key rename), injecting default keys would\n // re-add stale entries that no longer exist in formData.\n if (isObject(defaults) && formDataRequired.length === 0) {\n Object.keys(defaults as GenericObjectType)\n .filter((key) => !retrievedSchema.properties || !retrievedSchema.properties[key])\n .forEach((key) => keys.add(key));\n }\n keys.forEach((key) => {\n const computedDefault = computeDefaults(validator, additionalPropertiesSchema as S, {\n rootSchema,\n _recurseList,\n experimental_defaultFormStateBehavior,\n experimental_customMergeAllOf,\n includeUndefinedValues: includeUndefinedValues === true,\n parentDefaults: getByPath<T>(defaults, key),\n rawFormData: getByPath<T>(formData, key),\n required: retrievedSchema.required?.includes(key),\n shouldMergeDefaultsIntoFormData,\n initialDefaultsGenerated,\n });\n // Since these are additional properties we don't need to add the `experimental_defaultFormStateBehavior` prop\n maybeAddDefaultToObject<T>(\n objectDefaults as GenericObjectType,\n key,\n computedDefault,\n includeUndefinedValues,\n required,\n formDataRequired,\n );\n });\n }\n return computeDefaultBasedOnSchemaTypeAndDefaults<T, S>(rawSchema, objectDefaults);\n }\n}\n\n/** Computes the default value for arrays.\n *\n * @param validator - an implementation of the `ValidatorType` interface that will be used when necessary\n * @param rawSchema - The schema for which the default state is desired\n * @param computeDefaultsProps - Optional props for this function\n * @param initialDefaults - Optional props for this function\n * @returns - The default value based on the schema type if they are defined for object or array schemas.\n */\nexport function getArrayDefaults<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n validator: ValidatorType<T, S, F>,\n rawSchema: S,\n {\n rawFormData,\n rootSchema = {} as S,\n _recurseList = [],\n experimental_defaultFormStateBehavior,\n experimental_customMergeAllOf,\n required,\n requiredAsRoot = false,\n shouldMergeDefaultsIntoFormData,\n initialDefaultsGenerated,\n }: ComputeDefaultsProps<T, S> = {},\n initialDefaults?: T[],\n): T[] | undefined {\n let defaults = initialDefaults;\n const schema: S = rawSchema;\n\n const arrayMinItemsStateBehavior = experimental_defaultFormStateBehavior?.arrayMinItems ?? {};\n const { populate: arrayMinItemsPopulate, mergeExtraDefaults: arrayMergeExtraDefaults } = arrayMinItemsStateBehavior;\n\n const neverPopulate = arrayMinItemsPopulate === 'never';\n const ignoreMinItemsFlagSet = arrayMinItemsPopulate === 'requiredOnly';\n const isPopulateAll = arrayMinItemsPopulate === 'all' || (!neverPopulate && !ignoreMinItemsFlagSet);\n const computeSkipPopulate = arrayMinItemsStateBehavior?.computeSkipPopulate ?? (() => false);\n const isSkipEmptyDefaults = experimental_defaultFormStateBehavior?.emptyObjectFields === 'skipEmptyDefaults';\n\n const emptyDefault: T[] | undefined = isSkipEmptyDefaults ? undefined : [];\n\n // Inject defaults into existing array defaults\n if (Array.isArray(defaults)) {\n defaults = defaults.map((item, idx) => {\n const schemaItem: S = getInnerSchemaForArrayItem<S>(schema, AdditionalItemsHandling.Fallback, idx);\n const itemFormData = Array.isArray(rawFormData) ? rawFormData[idx] : undefined;\n return computeDefaults<T, S, F>(validator, schemaItem, {\n rootSchema,\n _recurseList,\n experimental_defaultFormStateBehavior,\n experimental_customMergeAllOf,\n parentDefaults: item,\n rawFormData: itemFormData,\n required,\n shouldMergeDefaultsIntoFormData,\n initialDefaultsGenerated,\n });\n }) as T[];\n }\n\n // Deeply inject defaults into already existing form data\n if (Array.isArray(rawFormData)) {\n const schemaItem: S = getInnerSchemaForArrayItem<S>(schema);\n if (neverPopulate) {\n defaults = rawFormData as typeof defaults;\n } else {\n const itemDefaults = rawFormData.map((item: T, idx: number) =>\n computeDefaults<T, S, F>(validator, schemaItem, {\n rootSchema,\n _recurseList,\n experimental_defaultFormStateBehavior,\n experimental_customMergeAllOf,\n rawFormData: item,\n parentDefaults: getByPath<T>(defaults, idx),\n required,\n shouldMergeDefaultsIntoFormData,\n initialDefaultsGenerated,\n }),\n ) as T[];\n\n // If the populate 'requiredOnly' flag is set then we only merge and include extra defaults if they are required.\n // Or if populate 'all' is set we merge and include extra defaults.\n const mergeExtraDefaults = ((ignoreMinItemsFlagSet && required) || isPopulateAll) && arrayMergeExtraDefaults;\n defaults = mergeDefaultsWithFormData(defaults, itemDefaults, mergeExtraDefaults);\n }\n }\n\n const defaultsLength = Array.isArray(defaults) ? defaults.length : 0;\n\n if (neverPopulate) {\n if (shouldMergeDefaultsIntoFormData && !required) {\n // Optional arrays with no existing data should be omitted entirely rather than defaulted to `[]`.\n // Required arrays still fall through to `defaults ?? emptyDefault` below so that `[]` is surfaced,\n // letting the validator report `minItems` violations instead of a missing-required-property error.\n return defaults;\n }\n return defaults ?? emptyDefault;\n }\n if (ignoreMinItemsFlagSet && !required) {\n // If no form data exists or defaults are set leave the field empty/non-existent, otherwise\n // return form data/defaults\n return defaults || undefined;\n }\n\n let arrayDefault: T[] | undefined;\n if (\n !schema.minItems ||\n isMultiSelect<T, S, F>(validator, schema, rootSchema, experimental_customMergeAllOf) ||\n computeSkipPopulate<T, S, F>(validator, schema, rootSchema) ||\n schema.minItems <= defaultsLength\n ) {\n // we don't want undefined defaults unless it is both not required or not required as root\n arrayDefault = defaults || (!required && !requiredAsRoot) ? defaults : emptyDefault;\n } else {\n const defaultEntries: T[] = defaults || [];\n const fillerSchema: S = getInnerSchemaForArrayItem<S>(schema, AdditionalItemsHandling.Invert);\n const fillerDefault = fillerSchema.default;\n\n // Calculate filler entries for remaining items (minItems - existing raw data/defaults)\n const fillerEntries: T[] = Array.from({ length: schema.minItems - defaultsLength }, () =>\n computeDefaults<any, S, F>(validator, fillerSchema, {\n parentDefaults: fillerDefault,\n rootSchema,\n _recurseList,\n experimental_defaultFormStateBehavior,\n experimental_customMergeAllOf,\n required,\n shouldMergeDefaultsIntoFormData,\n }),\n ) as T[];\n // then fill up the rest with either the item default or empty, up to minItems\n arrayDefault = defaultEntries.concat(fillerEntries);\n }\n\n return computeDefaultBasedOnSchemaTypeAndDefaults<T[] | undefined, S>(rawSchema, arrayDefault);\n}\n\n/** Computes the default value based on the schema type.\n *\n * @param validator - an implementation of the `ValidatorType` interface that will be used when necessary\n * @param rawSchema - The schema for which the default state is desired\n * @param computeDefaultsProps - Optional props for this function\n * @param defaults - Optional props for this function\n * @returns - The default value based on the schema type if they are defined for object or array schemas.\n */\nexport function getDefaultBasedOnSchemaType<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n validator: ValidatorType<T, S, F>,\n rawSchema: S,\n computeDefaultsProps: ComputeDefaultsProps<T, S> = {},\n defaults?: T | T[],\n): T | T[] | undefined {\n switch (getSchemaType<S>(rawSchema)) {\n // We need to recurse for object schema inner default values.\n case 'object': {\n return getObjectDefaults(validator, rawSchema, computeDefaultsProps, defaults);\n }\n case 'array': {\n return getArrayDefaults(validator, rawSchema, computeDefaultsProps, defaults as T[]);\n }\n case 'boolean': {\n // A required boolean with no explicit default gets false — it must be\n // present in the submitted data, and false is the natural zero-value.\n if (computeDefaultsProps.required && defaults === undefined) {\n return false as unknown as T;\n }\n return undefined;\n }\n default:\n return undefined;\n }\n}\n\n/** Returns the superset of `formData` that includes the given set updated to include any missing fields that have\n * computed to have defaults provided in the `schema`.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be used when necessary\n * @param theSchema - The schema for which the default state is desired\n * @param [formData] - The current formData, if any, onto which to provide any missing defaults\n * @param [rootSchema] - The root schema, used to primarily to look up `$ref`s\n * @param [includeUndefinedValues=false] - Optional flag, if true, cause undefined values to be added as defaults.\n * If \"excludeObjectChildren\", cause undefined values for this object and pass `includeUndefinedValues` as\n * false when computing defaults for any nested object properties.\n * @param [experimental_defaultFormStateBehavior] Optional configuration object, if provided, allows users to override default form state behavior\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @param initialDefaultsGenerated - Optional flag, indicates whether or not initial defaults have been generated\n * @returns - The resulting `formData` with all the defaults provided\n */\nexport default function getDefaultFormState<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n validator: ValidatorType<T, S, F>,\n theSchema: S,\n formData?: T,\n rootSchema?: S,\n includeUndefinedValues: boolean | 'excludeObjectChildren' = false,\n experimental_defaultFormStateBehavior?: Experimental_DefaultFormStateBehavior,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n initialDefaultsGenerated?: boolean,\n) {\n if (!isObject(theSchema)) {\n throw new Error(`Invalid schema: ${theSchema}`);\n }\n const schema = retrieveSchema<T, S, F>(validator, theSchema, rootSchema, formData, experimental_customMergeAllOf);\n\n // Get the computed defaults with 'shouldMergeDefaultsIntoFormData' set to true to merge defaults into formData.\n // This is done when for example the value from formData does not exist in the schema 'enum' property, in such\n // cases we take the value from the defaults because the value from the formData is not valid.\n const defaults = computeDefaults<T, S, F>(validator, schema, {\n rootSchema,\n includeUndefinedValues,\n experimental_defaultFormStateBehavior,\n experimental_customMergeAllOf,\n rawFormData: formData,\n shouldMergeDefaultsIntoFormData: true,\n initialDefaultsGenerated,\n requiredAsRoot: true,\n });\n\n if (schema.type !== 'object' && isObject(schema.default)) {\n return {\n ...defaults,\n ...formData,\n } as T;\n }\n\n // If the formData is an object or an array, add additional properties from formData and override formData with\n // defaults since the defaults are already merged with formData.\n if (isObject(formData) || Array.isArray(formData)) {\n const { mergeDefaultsIntoFormData } = experimental_defaultFormStateBehavior || {};\n const defaultSupercedesUndefined = mergeDefaultsIntoFormData === 'useDefaultIfFormDataUndefined';\n const matchingFormData = ensureFormDataMatchingSchema<T, S, F>(\n validator,\n schema,\n rootSchema ?? schema,\n formData,\n experimental_defaultFormStateBehavior,\n experimental_customMergeAllOf,\n );\n const result = mergeDefaultsWithFormData<T | T[]>(\n defaults,\n matchingFormData,\n true, // set to true to add any additional default array entries.\n defaultSupercedesUndefined,\n true, // set to true to override formData with defaults if they exist.\n );\n return result;\n }\n\n return defaults;\n}\n","import getUiOptions from './getUiOptions.ts';\nimport type { FormContextType, RJSFSchema, StrictRJSFSchema, UiSchema } from './types.ts';\n\n/** Checks to see if the `uiSchema` contains the `widget` field and that the widget is not `hidden`\n *\n * @param uiSchema - The UI Schema from which to detect if it is customized\n * @returns - True if the `uiSchema` describes a custom widget, false otherwise\n */\nexport default function isCustomWidget<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(uiSchema: UiSchema<T, S, F> = {}) {\n return (\n // TODO: Remove the `&& uiSchema['ui:widget'] !== 'hidden'` once we support hidden widgets for arrays.\n // https://rjsf-team.github.io/react-jsonschema-form/docs/usage/widgets/#hidden-widgets\n 'widget' in getUiOptions<T, S, F>(uiSchema) && getUiOptions<T, S, F>(uiSchema).widget !== 'hidden'\n );\n}\n","import { UI_WIDGET_KEY } from '../constants.ts';\nimport type {\n Experimental_CustomMergeAllOf,\n FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n UiSchema,\n ValidatorType,\n} from '../types.ts';\nimport retrieveSchema from './retrieveSchema.ts';\n\n/** Checks to see if the `schema` and `uiSchema` combination represents an array of files\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be used when necessary\n * @param schema - The schema for which check for array of files flag is desired\n * @param [uiSchema={}] - The UI schema from which to check the widget\n * @param [rootSchema] - The root schema, used to primarily to look up `$ref`s\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - True if schema/uiSchema contains an array of files, otherwise false\n */\nexport default function isFilesArray<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n validator: ValidatorType<T, S, F>,\n schema: S,\n uiSchema: UiSchema<T, S, F> = {},\n rootSchema?: S,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n) {\n if (uiSchema[UI_WIDGET_KEY] === 'files') {\n return true;\n }\n if (schema.items) {\n const itemsSchema = retrieveSchema<T, S, F>(\n validator,\n schema.items as S,\n rootSchema,\n undefined,\n experimental_customMergeAllOf,\n );\n return itemsSchema.type === 'string' && itemsSchema.format === 'data-url';\n }\n return false;\n}\n","import { ADDITIONAL_PROPERTY_FLAG, UI_FIELD_KEY, UI_WIDGET_KEY } from '../constants.ts';\nimport getSchemaType from '../getSchemaType.ts';\nimport getUiOptions from '../getUiOptions.ts';\nimport isCustomWidget from '../isCustomWidget.ts';\nimport type {\n FormContextType,\n GlobalUISchemaOptions,\n RJSFMarkedSchema,\n RJSFSchema,\n StrictRJSFSchema,\n UiSchema,\n ValidatorType,\n Experimental_CustomMergeAllOf,\n} from '../types.ts';\nimport isFilesArray from './isFilesArray.ts';\nimport isMultiSelect from './isMultiSelect.ts';\n\n/** Determines whether the combination of `schema` and `uiSchema` properties indicates that the label for the `schema`\n * should be displayed in a UI.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be used when necessary\n * @param schema - The schema for which the display label flag is desired\n * @param [uiSchema={}] - The UI schema from which to derive potentially displayable information\n * @param [rootSchema] - The root schema, used to primarily to look up `$ref`s\n * @param [globalOptions={}] - The optional Global UI Schema from which to get any fallback `xxx` options\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - True if the label should be displayed or false if it should not\n */\nexport default function getDisplayLabel<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n validator: ValidatorType<T, S, F>,\n schema: S,\n uiSchema: UiSchema<T, S, F> = {},\n rootSchema?: S,\n globalOptions?: GlobalUISchemaOptions,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): boolean {\n const uiOptions = getUiOptions<T, S, F>(uiSchema, globalOptions);\n const { label = true } = uiOptions;\n let displayLabel = Boolean(label);\n if (displayLabel) {\n const schemaType = getSchemaType<S>(schema);\n const addedByAdditionalProperty = Boolean((schema as RJSFMarkedSchema)[ADDITIONAL_PROPERTY_FLAG]);\n\n if (schemaType === 'array') {\n displayLabel =\n addedByAdditionalProperty ||\n isMultiSelect<T, S, F>(validator, schema, rootSchema, experimental_customMergeAllOf) ||\n isFilesArray<T, S, F>(validator, schema, uiSchema, rootSchema, experimental_customMergeAllOf) ||\n isCustomWidget(uiSchema);\n }\n\n if (schemaType === 'object') {\n displayLabel = addedByAdditionalProperty;\n }\n if (schemaType === 'boolean' && uiSchema && !uiSchema[UI_WIDGET_KEY]) {\n displayLabel = false;\n }\n if (uiSchema?.[UI_FIELD_KEY]) {\n displayLabel = false;\n }\n }\n return displayLabel;\n}\n","import { NAME_KEY, RJSF_ADDITIONAL_PROPERTIES_FLAG } from '../constants.ts';\nimport findSchemaDefinition from '../findSchemaDefinition.ts';\nimport getDiscriminatorFieldFromSchema from '../getDiscriminatorFieldFromSchema.ts';\nimport getSchemaType from '../getSchemaType.ts';\nimport isObject from '../isObject.ts';\nimport { getByPath, hasByPath, setByPath, toPath } from '../pathUtils.ts';\nimport type {\n Experimental_CustomMergeAllOf,\n FormContextType,\n GenericObjectType,\n PathSchema,\n RJSFSchema,\n StrictRJSFSchema,\n ValidatorType,\n} from '../types.ts';\nimport getClosestMatchingOption from './getClosestMatchingOption.ts';\nimport isSelect from './isSelect.ts';\nimport { relaxOptionsForScoring, resolveAllReferences } from './retrieveSchema.ts';\nimport shallowAllOfMerge from './shallowAllOfMerge.ts';\n\n/** Returns the `formData` with only the elements specified in the `fields` list\n *\n * @param formData - The data for the `Form`\n * @param fields - The fields to keep while filtering\n * @deprecated - To be removed as an exported `@rjsf/utils` function in a future release\n */\nexport function getUsedFormData<T = any>(formData: T | undefined, fields: string[]): T | undefined {\n // For the case of a single input form\n if (fields.length === 0 && typeof formData !== 'object') {\n return formData;\n }\n\n // Keep only the values at the given field paths; `fields` contains either dotted strings or the\n // deep path lists produced by `getFieldNames()`\n const data: GenericObjectType = {};\n fields.forEach((field) => {\n const path = Array.isArray(field) ? field : toPath(field);\n if (hasByPath(formData, path)) {\n setByPath(data, path, getByPath(formData, path));\n }\n });\n if (Array.isArray(formData)) {\n return Object.keys(data).map((key: string) => data[key]) as unknown as T;\n }\n\n return data as T;\n}\n\n/** Returns the list of field names from inspecting the `pathSchema` as well as using the `formData`\n *\n * @param pathSchema - The `PathSchema` object for the form\n * @param [formData] - The form data to use while checking for empty objects/arrays\n * @deprecated - To be removed as an exported `@rjsf/utils` function in a future release\n */\n// oxlint-disable-next-line typescript/no-deprecated\nexport function getFieldNames<T = any>(pathSchema: PathSchema<T>, formData?: T): string[][] {\n const formValueHasData = (value: unknown, isLeaf: boolean) => {\n if (typeof value !== 'object' || value === null) {\n return true;\n }\n const isEmptyValue = Array.isArray(value) ? value.length === 0 : Object.keys(value).length === 0;\n return isEmptyValue || isLeaf;\n };\n const getAllPaths = (_obj: GenericObjectType, acc: string[][] = [], paths: string[][] = [[]]) => {\n const objKeys = Object.keys(_obj);\n objKeys.forEach((key: string) => {\n const data = _obj[key];\n if (typeof data === 'object') {\n const newPaths = paths.map((path) => [...path, key]);\n // If an object is marked with additionalProperties, all its keys are valid\n if (data[RJSF_ADDITIONAL_PROPERTIES_FLAG] && data[NAME_KEY] !== '') {\n acc.push(data[NAME_KEY]);\n } else {\n getAllPaths(data, acc, newPaths);\n }\n } else if (key === NAME_KEY && data !== '') {\n paths.forEach((path) => {\n const formValue = getByPath(formData, path);\n const isLeaf = objKeys.length === 1;\n // adds path to fieldNames if it points to a value or an empty object/array which is not a leaf\n if (\n formValueHasData(formValue, isLeaf) ||\n (Array.isArray(formValue) && formValue.every((val: unknown) => formValueHasData(val, isLeaf)))\n ) {\n acc.push(path);\n }\n });\n }\n });\n return acc;\n };\n\n return getAllPaths(pathSchema);\n}\n\n/** Returns true when a form value is considered empty: null/undefined/'', an empty array, or a plain\n * object whose every own value is itself empty (recursive). Scalars like `0` and `false` are not empty.\n *\n * @param value - The value to check\n * @returns - True if the value is considered empty, false otherwise\n */\nexport function isValueEmpty(value: unknown): boolean {\n if (value == null || value === '') {\n return true;\n }\n if (Array.isArray(value)) {\n return value.length === 0;\n }\n if (isObject(value)) {\n return Object.values(value).every(isValueEmpty);\n }\n return false;\n}\n\n/** Merges an `allOf` schema into a single flat schema, delegating to `experimental_customMergeAllOf`\n * when provided or falling back to the module-level `shallowAllOfMerge` otherwise.\n *\n * @param schema - A schema containing an `allOf` array to be merged\n * @param [experimental_customMergeAllOf] - Optional custom merge function; see `Form` documentation\n * @returns - The merged schema with `allOf` resolved into a single schema object\n */\nfunction doMergeAllOf<S extends StrictRJSFSchema = RJSFSchema>(\n schema: S,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): S {\n return experimental_customMergeAllOf ? experimental_customMergeAllOf(schema) : (shallowAllOfMerge(schema) as S);\n}\n\n/** A recursive, schema-driven filter that walks `schema` and `formData` in lockstep, keeping only\n * values that are described by the schema. Handles `$ref`, `allOf`, `anyOf`, `oneOf`, `if/then/else`,\n * `patternProperties`, `additionalProperties`, `propertyNames`, and `dependencies`. Optional object\n * properties whose schema-filtered content is entirely empty (per `isValueEmpty`) are pruned; required\n * properties and scalar values are always kept when schema-defined.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be used when necessary\n * @param schema - The schema for which to filter the formData\n * @param [rootSchema] - The root schema, used primarily to look up `$ref`s\n * @param [formData] - The data for the `Form`\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - The `formData` after omitting extra data, or `undefined` when `formData` is undefined\n */\nexport default function omitExtraData<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n validator: ValidatorType<T, S, F>,\n schema: S,\n rootSchema: S = {} as S,\n formData?: T,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): T | undefined {\n /** Type predicate that narrows `value` to `GenericObjectType` — true when `value` is a plain,\n * non-array object (i.e. a JSON object). Used to distinguish JSON objects from arrays and primitives.\n *\n * @param value - The value to check\n * @returns - True if `value` is a plain non-array object\n */\n function isObjectValue(value: unknown): value is GenericObjectType {\n return isObject(value);\n }\n\n /** Type predicate that narrows a `S | boolean` schema definition to `S` — true when `schemaDef` is\n * a schema object rather than a JSON Schema boolean shorthand (`true` meaning allow-all, `false`\n * meaning deny-all).\n *\n * @param schemaDef - The schema definition to check\n * @returns - True if `schemaDef` is a schema object\n */\n function isSchemaObj(schemaDef: S | boolean): schemaDef is S {\n return isObject(schemaDef);\n }\n\n /** Copies schema-defined properties from `source` into `target`, applying `omit` recursively for\n * each value. Handles `properties`, `patternProperties`, and `additionalProperties`.\n * Optional object-valued properties are pruned when every key in the filtered result is both\n * optional (per the inner schema's `required`) and empty (per `isValueEmpty`). This preserves\n * optional objects whose required children have empty values, while still dropping objects whose\n * schema-filtered content is entirely optional-and-empty. Required properties and scalar values\n * are always written when defined. Always returns `target` — pruning of the object itself is\n * the caller's responsibility.\n *\n * @param childSchema - The object schema describing which properties are allowed\n * @param source - The source form data object to read values from\n * @param target - The accumulator object to write filtered values into\n * @returns - `target` after all schema-defined properties have been processed\n */\n function handleObject(childSchema: S, source: GenericObjectType, target: GenericObjectType): GenericObjectType {\n const { properties, additionalProperties, patternProperties } = childSchema;\n const requiredSet = new Set(childSchema.required ?? []);\n\n /** Recursively omits extra data from `value` via `omit`, then conditionally writes the result to\n * `target[key]`. Optional object-valued properties are dropped when every key in the filtered\n * result is both optional (within the inner schema's `required` list) and has an empty value per\n * `isValueEmpty`. This per-key approach prevents required-but-empty child properties — kept by\n * inner `setProperty` calls — from inadvertently causing the parent optional object to be dropped,\n * while still pruning optional objects whose schema-filtered content is entirely empty. Vacuously\n * true for `{}`, so empty results are always dropped. Scalar and array values are not pruned here.\n *\n * @param key - The property key to write on `target`\n * @param schemaDef - The schema (or boolean shorthand) that governs the value at `key`\n * @param value - The raw source value to filter\n * @param [required=false] - When true the property is never pruned regardless of its filtered value\n */\n function setProperty(key: string, schemaDef: S | boolean, value: unknown, required = false) {\n const v = omit(schemaDef, value, target[key]);\n if (!required && isObject(v)) {\n // Resolve $ref so we can inspect the effective required list for the inner schema.\n let sd = isSchemaObj(schemaDef) ? schemaDef : ({} as S);\n if (sd.$ref !== undefined) {\n sd = findSchemaDefinition<S>(sd.$ref, rootSchema);\n }\n const innerRequired = new Set(sd.required ?? []);\n // Drop this optional object when every key in v is both optional in the inner schema\n // and has an empty value. Vacuously true for {} so empty objects are always dropped.\n const shouldDrop = Object.entries(v).every(([k, val]) => !innerRequired.has(k) && isValueEmpty(val));\n if (shouldDrop) {\n return;\n }\n }\n if (v !== undefined) {\n // oxlint-disable-next-line no-param-reassign\n target[key] = v;\n }\n }\n\n if (properties !== undefined) {\n for (const [key, schemaDef] of Object.entries(properties)) {\n setProperty(key, schemaDef as S | boolean, source[key], requiredSet.has(key));\n }\n }\n\n // Track keys not handled by properties/patterns so additionalProperties can pick them up.\n let patternPropertiesRest: string[] | undefined;\n if (patternProperties !== undefined) {\n patternPropertiesRest = [];\n const patterns = Object.entries(patternProperties).map(([pattern, schemaDef]): [RegExp, S | boolean] => [\n new RegExp(pattern),\n schemaDef as S | boolean,\n ]);\n const knownProperties = new Set(Object.keys(properties ?? {}));\n for (const [key, value] of Object.entries(source)) {\n if (!knownProperties.has(key)) {\n const matched = patterns.find(([re]) => re.test(key));\n if (matched === undefined) {\n patternPropertiesRest.push(key);\n } else {\n setProperty(key, matched[1], value);\n }\n }\n }\n }\n\n // JSON Schema spec: absent additionalProperties defaults to true (allow all extra keys). Here\n // we treat it as false so omitExtraData never inadvertently passes through undescribed keys.\n if (additionalProperties !== undefined && additionalProperties !== false) {\n const addlSchema = additionalProperties as S | boolean;\n if (patternPropertiesRest !== undefined) {\n for (const key of patternPropertiesRest) {\n setProperty(key, addlSchema, source[key]);\n }\n } else {\n const knownProperties = new Set(Object.keys(properties ?? {}));\n for (const [key, value] of Object.entries(source)) {\n if (!knownProperties.has(key)) {\n setProperty(key, addlSchema, value);\n }\n }\n }\n }\n\n return target;\n }\n\n /** Filters array elements from `source` into `target` according to `schema.items` and\n * `schema.additionalItems`. Only called when `items` is defined (guarded in `omit`). Uses index\n * assignment (not push) so a pre-populated `target` from a prior branch is overwritten rather than\n * appended to, preventing item duplication. For tuple schemas (`items` is an array) elements up to\n * `min(items.length, source.length)` are filtered by their per-index schema; elements beyond the\n * tuple are covered by `additionalItems` when present, or the target is truncated when absent.\n * For list schemas (`items` is a single schema) every source element is filtered and `target.length`\n * is set to `source.length`.\n *\n * @param childSchema - The array schema describing `items` and optionally `additionalItems`\n * @param source - The source array to read elements from\n * @param target - The accumulator array to write filtered elements into\n * @returns - `target` after all applicable source elements have been written\n */\n function handleArray(childSchema: S, source: unknown[], target: unknown[]): unknown[] {\n const { items, additionalItems } = childSchema;\n if (Array.isArray(items)) {\n const tupleLength = Math.min(items.length, source.length);\n let i = 0;\n for (; i < tupleLength; i += 1) {\n // oxlint-disable-next-line no-param-reassign\n target[i] = omit(items[i] as S | boolean, source[i]);\n }\n // Without additionalItems, truncate at the tuple boundary to drop any pre-existing items.\n if (!additionalItems) {\n // oxlint-disable-next-line no-param-reassign\n target.length = tupleLength;\n return target;\n }\n for (; i < source.length; i += 1) {\n // oxlint-disable-next-line no-param-reassign\n target[i] = omit(additionalItems as S | boolean, source[i]);\n }\n } else {\n for (let i = 0; i < source.length; i += 1) {\n // oxlint-disable-next-line no-param-reassign\n target[i] = omit(items as S | boolean, source[i]);\n }\n }\n // Truncate any pre-existing items beyond the source length.\n // oxlint-disable-next-line no-param-reassign\n target.length = source.length;\n return target;\n }\n\n /** Applies the `if/then/else` conditional keywords from `schema` to `target`. When `schema.if` is\n * absent the original `target` is returned unchanged. Otherwise the condition is evaluated — using\n * `validator.isValid` for schema conditions or the boolean value directly — and the matching branch\n * (`then` or `else`) is applied via `omit`. When the selected branch is absent, `target` is returned\n * unchanged.\n *\n * @param childSchema - The schema potentially containing `if`, `then`, and `else` keywords\n * @param source - The current form data value, passed to `validator.isValid` and the branch `omit`\n * @param target - The already-filtered value to merge the branch result into\n * @returns - The result of applying the matched branch, or `target` when no branch applies\n */\n function handleConditions(childSchema: S, source: unknown, target: unknown): unknown {\n const { if: condition, then, else: otherwise } = childSchema;\n if (condition === undefined) {\n return target;\n }\n // validator.isValid signature: (schema, formData, rootSchema)\n const isThenBranch = isSchemaObj(condition as S | boolean)\n ? validator.isValid(condition as S, source as T, rootSchema)\n : condition;\n const branch = isThenBranch ? then : otherwise;\n return branch === undefined ? target : omit(branch as S | boolean, source, target, false);\n }\n\n /** Applies the best-matching `oneOf` option to `source`, merging the result into `target`. When\n * `oneOf` is not an array or the schema represents a select widget (enum-driven), `target` is\n * returned unchanged. `additionalProperties: false` is relaxed on each option before scoring so that\n * `getClosestMatchingOption` can validate freely, but the original option schema is used for the\n * actual `omit` call.\n *\n * @param oneOf - The `oneOf` array from the schema, or `undefined`\n * @param childSchema - The parent schema containing the `oneOf` keyword\n * @param source - The current form data value used to score each option\n * @param target - The already-filtered value to merge the winning option's result into\n * @returns - The result of applying the best-matching option, or `target` when no matching applies\n */\n function handleOneOf(oneOf: S['oneOf'], childSchema: S, source: unknown, target: unknown): unknown {\n if (!Array.isArray(oneOf) || isSelect(validator, childSchema, rootSchema, experimental_customMergeAllOf)) {\n return target;\n }\n // Resolve $refs and relax additionalProperties:false → true in one pass for scoring only.\n // The unrelaxed resolved schema is re-derived for the winning option so that omit() still\n // respects additionalProperties:false during filtering.\n const scoringOptions = relaxOptionsForScoring<S>(oneOf as (S | boolean)[], true, rootSchema);\n const bestIndex = getClosestMatchingOption<T, S, F>(\n validator,\n rootSchema,\n source as T,\n scoringOptions,\n 0,\n getDiscriminatorFieldFromSchema<S>(childSchema),\n experimental_customMergeAllOf,\n );\n const winning = (oneOf as (S | boolean)[])[bestIndex];\n // For object options, re-resolve without relaxation so additionalProperties:false is respected.\n // For boolean options, scoringOptions already holds the converted schema (true→{}, false→{not:{}}).\n const resolved: S = isObject(winning)\n ? resolveAllReferences<S>(winning, rootSchema, [])\n : scoringOptions[bestIndex];\n return omit(resolved, source, target, false);\n }\n\n /** Applies `anyOf` branches from `schema` to `source`, merging results into `target`. When `anyOf`\n * is absent or not an array, `target` is returned unchanged. For undefined or empty sources (so that\n * defaults can flow through all branches) every branch is applied in sequence. For non-empty sources\n * the best-matching branch is selected via `handleOneOf`.\n *\n * @param childSchema - The schema potentially containing an `anyOf` keyword\n * @param source - The current form data value; empty or undefined triggers all-branch application\n * @param target - The already-filtered value to merge branch results into\n * @returns - The result after applying the relevant `anyOf` branch(es), or `target` when inapplicable\n */\n function handleAnyOf(childSchema: S, source: unknown, target: unknown): unknown {\n const { anyOf } = childSchema;\n if (!Array.isArray(anyOf)) {\n return target;\n }\n // For undefined or empty collections, apply every branch so defaults flow through.\n if (\n source === undefined ||\n (Array.isArray(source) && source.length === 0) ||\n (isObject(source) && Object.keys(source).length === 0)\n ) {\n let result = target;\n for (const branch of anyOf as (S | boolean)[]) {\n result = omit(branch, source, result, false);\n }\n return result;\n }\n return handleOneOf(anyOf, childSchema, source, target);\n }\n\n /** Applies schema-based `dependencies` from `schema` to `source`, merging each active dependency's\n * schema into `target` via `omit`. Property dependencies (plain string arrays) are skipped — only\n * schema dependencies are processed. A dependency is considered active when its trigger key is\n * present on `source`.\n *\n * @param childSchema - The schema potentially containing a `dependencies` keyword\n * @param source - The current form data value; must be a plain object for dependencies to apply\n * @param target - The already-filtered value to merge dependency results into\n * @returns - The result after applying all active schema dependencies, or `target` when inapplicable\n */\n function handleDependencies(childSchema: S, source: unknown, target: unknown): unknown {\n const { dependencies } = childSchema;\n if (dependencies === undefined || !isObjectValue(source)) {\n return target;\n }\n let result = target;\n for (const [key, deps] of Object.entries(dependencies)) {\n // Skip property dependencies (string arrays); only process schema dependencies.\n if (key in source && !Array.isArray(deps)) {\n result = omit(deps as S | boolean, source, result, false);\n }\n }\n return result;\n }\n\n /** Core recursive filter. Resolves `$ref`s, merges `allOf`, then delegates to the type-specific\n * handlers (`handleObject`, `handleArray`) and keyword handlers (`handleAnyOf`, `handleOneOf`,\n * `handleConditions`, `handleDependencies`). Returns `undefined` when `source` is undefined or\n * `schemaDef` is `false`; when `schemaDef` is `true` or empty returns `target ?? source` (when\n * `useSourceAsFallback` is true) or `target` (when false) to avoid aliasing `source` as the\n * accumulator across multiple compositional branches.\n *\n * @param schemaDef - The schema (or boolean shorthand) to filter `source` against\n * @param source - The raw form data value to filter\n * @param [target] - An optional accumulator carrying results from prior oneOf/anyOf processing\n * @param [useSourceAsFallback=true] - When false a permissive schema (`true`/`{}`) returns `target`\n * rather than `source`, preventing compositional branches from aliasing the accumulator to `source`\n * @returns - The filtered value, or `undefined` when the schema rejects the value\n */\n function omit(schemaDef: S | boolean, source: unknown, target?: unknown, useSourceAsFallback = true): unknown {\n if (source === undefined || schemaDef === false) {\n return undefined;\n }\n if (schemaDef === true || !schemaDef || Object.keys(schemaDef).length === 0) {\n return target ?? (useSourceAsFallback ? source : undefined);\n }\n\n let localSchema = schemaDef;\n const { $ref: ref, allOf } = localSchema;\n\n if (ref !== undefined) {\n return omit(findSchemaDefinition<S>(ref, rootSchema), source, target, useSourceAsFallback);\n }\n if (allOf) {\n localSchema = doMergeAllOf<S>(localSchema, experimental_customMergeAllOf);\n // Schemas whose allOf entries contain if/then/else keywords may not fully merge: the merger\n // can only hoist one if/then/else triple to the parent level, so additional entries stay in\n // allOf. Process any that remain so their conditional properties are not silently dropped.\n // See: https://github.com/rjsf-team/react-jsonschema-form/issues/5142\n const remainingAllOf = localSchema.allOf;\n if (remainingAllOf) {\n for (let i = 0; i < remainingAllOf.length; i++) {\n // oxlint-disable-next-line no-param-reassign\n target = omit(remainingAllOf[i] as S | boolean, source, target, false);\n }\n }\n }\n\n let filtered = handleAnyOf(localSchema, source, handleOneOf(localSchema.oneOf, localSchema, source, target));\n\n const type = getSchemaType<S>(localSchema);\n if (type === 'object') {\n if (!isObjectValue(source)) {\n return undefined;\n }\n filtered = handleObject(localSchema, source, isObjectValue(filtered) ? filtered : {});\n } else if (type === 'array') {\n if (!Array.isArray(source)) {\n return undefined;\n }\n if (localSchema.items !== undefined) {\n filtered = handleArray(localSchema, source, Array.isArray(filtered) ? filtered : []);\n }\n }\n\n // Post-prune after conditions (oneOf/anyOf/if-then) but BEFORE dependencies: keys added by\n // dependency sub-schemas are legitimate extensions of the allowed property set and must not be\n // pruned. Keys added only by winning conditional branches are still removed here so the result\n // honours additionalProperties:false.\n const afterConditions = handleConditions(localSchema, source, filtered);\n if (localSchema.additionalProperties === false && isObjectValue(afterConditions)) {\n const knownKeys = new Set(Object.keys(localSchema.properties ?? {}));\n const patterns = localSchema.patternProperties\n ? Object.keys(localSchema.patternProperties).map((p) => new RegExp(p))\n : [];\n for (const key of Object.keys(afterConditions)) {\n if (!knownKeys.has(key) && !patterns.some((re) => re.test(key))) {\n // oxlint-disable-next-line no-param-reassign\n delete afterConditions[key];\n }\n }\n }\n\n const result = handleDependencies(localSchema, source, afterConditions);\n\n return result ?? (useSourceAsFallback ? source : undefined);\n }\n\n return omit(schema, formData) as T | undefined;\n}\n","import { CONST_KEY, DEFAULT_KEY, PROPERTIES_KEY, REF_KEY } from '../constants.ts';\nimport deepEquals from '../deepEquals.ts';\nimport getPropertySchema from '../getPropertySchema.ts';\nimport { getByPath, hasByPath } from '../pathUtils.ts';\nimport type {\n Experimental_CustomMergeAllOf,\n FormContextType,\n GenericObjectType,\n RJSFSchema,\n StrictRJSFSchema,\n ValidatorType,\n} from '../types.ts';\nimport retrieveSchema from './retrieveSchema.ts';\n\nconst NO_VALUE = Symbol('no Value');\n\nfunction enumValuesForSchema<S extends StrictRJSFSchema = RJSFSchema>(schema: S): any[] | undefined {\n if (Array.isArray(schema.enum)) {\n return schema.enum;\n }\n\n const options = (schema.oneOf || schema.anyOf) as S[] | undefined;\n if (!Array.isArray(options)) {\n return undefined;\n }\n\n const values = options\n .map((option) => {\n if (CONST_KEY in option) {\n return option[CONST_KEY];\n }\n return Array.isArray(option.enum) && option.enum.length === 1 ? option.enum[0] : NO_VALUE;\n })\n .filter((value) => value !== NO_VALUE);\n\n return values.length > 0 ? values : undefined;\n}\n\nfunction replacementForInvalidEnumValue<S extends StrictRJSFSchema = RJSFSchema>(schema: S, formValue: any) {\n const enumValues = enumValuesForSchema(schema);\n if (!enumValues || enumValues.some((value) => deepEquals(value, formValue))) {\n return NO_VALUE;\n }\n\n const defaultValue = getByPath(schema, DEFAULT_KEY, NO_VALUE);\n if (defaultValue !== NO_VALUE && enumValues.some((value) => deepEquals(value, defaultValue))) {\n return defaultValue;\n }\n\n return enumValues.length === 1 ? enumValues[0] : undefined;\n}\n\n/** Sanitize the `data` associated with the `oldSchema` so it is considered appropriate for the `newSchema`. If the new\n * schema does not contain any properties, then `undefined` is returned to clear all the form data. Due to the nature\n * of schemas, this sanitization happens recursively for nested objects of data. Also, any properties in the old schema\n * that are non-existent in the new schema are set to `undefined`. The data sanitization process has the following flow:\n *\n * - If the new schema is an object that contains a `properties` object then:\n * - Create a `removeOldSchemaData` object, setting each key in the `oldSchema.properties` having `data` to undefined\n * - Create an empty `nestedData` object for use in the key filtering below:\n * - Iterate over each key in the `newSchema.properties` as follows:\n * - Get the `formValue` of the key from the `data`\n * - Get the `oldKeySchema` and `newKeyedSchema` for the key, defaulting to `{}` when it doesn't exist\n * - Retrieve the schema for any refs within each `oldKeySchema` and/or `newKeySchema`\n * - Get the types of the old and new keyed schemas and if the old doesn't exist or the old & new are the same then:\n * - If `removeOldSchemaData` has an entry for the key, delete it since the new schema has the same property\n * - If type of the key in the new schema is `object`:\n * - Store the value from the recursive `sanitizeDataForNewSchema` call in `nestedData[key]`\n * - Otherwise, check for default or const values:\n * - Get the old and new `default` values from the schema and check:\n * - If the new `default` value does not match the form value:\n * - If the key is new and its form value is undefined, or the old `default` matches the form value, then:\n * - Replace `removeOldSchemaData[key]` with the new `default`\n * - Otherwise, if the new schema is `readOnly` then replace `removeOldSchemaData[key]` with undefined\n * - Get the old and new `const` values from the schema and check:\n * - If the new `const` value does not match the form value:\n * - If the old `const` value DOES match the form value, then:\n * - Replace `removeOldSchemaData[key]` with the new `const`\n * - Otherwise, replace `removeOldSchemaData[key]` with undefined\n * - Once all keys have been processed, return an object built as follows:\n * - `{ ...data, ...removeOldSchemaData, ...nestedData }`\n * - If the new and old schema types are array and the `data` is an array then:\n * - If the type of the old and new schema `items` are a non-array objects:\n * - Retrieve the schema for any refs within each `oldKeySchema.items` and/or `newKeySchema.items`\n * - If the `type`s of both items are the same (or the old does not have a type):\n * - If the type is \"object\", then:\n * - For each element in the `data` recursively sanitize the data, stopping at `maxItems` if specified\n * - Otherwise, just return the `data` removing any values after `maxItems` if it is set\n * - If the type of the old and new schema `items` are booleans of the same value, return `data` as is\n * - Otherwise return `undefined`\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be used when necessary\n * @param rootSchema - The root JSON schema of the entire form\n * @param [newSchema] - The new schema for which the data is being sanitized\n * @param [oldSchema] - The old schema from which the data originated\n * @param [data={}] - The form data associated with the schema, defaulting to an empty object when undefined\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - The new form data, with all the fields uniquely associated with the old schema set\n * to `undefined`. Will return `undefined` if the new schema is not an object containing properties.\n */\nexport default function sanitizeDataForNewSchema<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n validator: ValidatorType<T, S, F>,\n rootSchema: S,\n newSchema?: S,\n oldSchema?: S,\n data: any = {},\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): T {\n // By default, we will clear the form data\n let newFormData;\n const newProperties = newSchema?.[PROPERTIES_KEY];\n // If the new schema is of type object and that object contains a list of properties\n if (newProperties) {\n // Create an object containing root-level keys in the old schema, setting each key to undefined to remove the data\n const removeOldSchemaData: GenericObjectType = {};\n const oldProperties = oldSchema?.[PROPERTIES_KEY];\n if (oldProperties) {\n Object.keys(oldProperties).forEach((key) => {\n if (hasByPath(data, key)) {\n removeOldSchemaData[key] = undefined;\n }\n });\n }\n const keys: string[] = Object.keys(newProperties);\n // Create a place to store nested data that will be a side-effect of the filter\n const nestedData: GenericObjectType = {};\n keys.forEach((key) => {\n const formValue = data?.[key];\n const isNewProperty = !hasByPath(oldSchema, [PROPERTIES_KEY, key]);\n let oldKeyedSchema = getPropertySchema<S>(oldSchema, key);\n let newKeyedSchema = getPropertySchema<S>(newSchema, key);\n // Resolve the refs if they exist\n if (hasByPath(oldKeyedSchema, REF_KEY)) {\n oldKeyedSchema = retrieveSchema<T, S, F>(\n validator,\n oldKeyedSchema,\n rootSchema,\n formValue,\n experimental_customMergeAllOf,\n );\n }\n if (hasByPath(newKeyedSchema, REF_KEY)) {\n newKeyedSchema = retrieveSchema<T, S, F>(\n validator,\n newKeyedSchema,\n rootSchema,\n formValue,\n experimental_customMergeAllOf,\n );\n }\n // Now get types and see if they are the same\n const oldSchemaTypeForKey = oldKeyedSchema.type;\n const newSchemaTypeForKey = newKeyedSchema.type;\n // Check if the old option has the same key with the same type\n if (!oldSchemaTypeForKey || oldSchemaTypeForKey === newSchemaTypeForKey) {\n if (key in removeOldSchemaData) {\n // SIDE-EFFECT: remove the undefined value for a key that has the same type between the old and new schemas\n delete removeOldSchemaData[key];\n }\n // If it is an object, we'll recurse and store the resulting sanitized data for the key\n if (newSchemaTypeForKey === 'object' || (newSchemaTypeForKey === 'array' && Array.isArray(formValue))) {\n // SIDE-EFFECT: process the new schema type of object recursively to save iterations\n const itemData = sanitizeDataForNewSchema<T, S, F>(\n validator,\n rootSchema,\n newKeyedSchema,\n isNewProperty && newSchemaTypeForKey === 'array' ? newKeyedSchema : oldKeyedSchema,\n formValue,\n experimental_customMergeAllOf,\n );\n if (itemData !== undefined || newSchemaTypeForKey === 'array') {\n // only put undefined values for the array type and not the object type\n nestedData[key] = itemData;\n }\n } else {\n // Ok, the non-object types match, let's make sure that a default or a const of a different value is replaced\n // with the new default or const. This allows the case where two schemas differ that only by the default/const\n // value to be properly selected\n const newOptionDefault = getByPath(newKeyedSchema, DEFAULT_KEY, NO_VALUE);\n const oldOptionDefault = getByPath(oldKeyedSchema, DEFAULT_KEY, NO_VALUE);\n if (newOptionDefault !== NO_VALUE && newOptionDefault !== formValue) {\n if ((isNewProperty && formValue === undefined) || oldOptionDefault === formValue) {\n // Initialize a newly entered property or replace an old default with the new default.\n removeOldSchemaData[key] = newOptionDefault;\n } else if (newKeyedSchema.readOnly === true) {\n // If the new schema has the default set to read-only, treat it like a const and remove the value\n removeOldSchemaData[key] = undefined;\n }\n }\n\n const newOptionConst = getByPath(newKeyedSchema, CONST_KEY, NO_VALUE);\n const oldOptionConst = getByPath(oldKeyedSchema, CONST_KEY, NO_VALUE);\n if (newOptionConst !== NO_VALUE && newOptionConst !== formValue) {\n // Since this is a const, if the old value matches, replace the value with the new const otherwise clear it\n removeOldSchemaData[key] = oldOptionConst === formValue ? newOptionConst : undefined;\n }\n\n if (hasByPath(data, key)) {\n const enumReplacement = replacementForInvalidEnumValue(newKeyedSchema, formValue);\n if (enumReplacement !== NO_VALUE) {\n removeOldSchemaData[key] = enumReplacement;\n }\n }\n }\n }\n });\n\n newFormData = {\n ...(typeof data === 'string' || Array.isArray(data) ? undefined : data),\n ...removeOldSchemaData,\n ...nestedData,\n };\n // First apply removing the old schema data, then apply the nested data, then apply the old data keys to keep\n } else if (oldSchema?.type === 'array' && newSchema?.type === 'array' && Array.isArray(data)) {\n let oldSchemaItems = oldSchema.items;\n let newSchemaItems = newSchema.items;\n // If any of the array types `items` are arrays (remember arrays are objects) then we'll just drop the data\n // Eventually, we may want to deal with when either of the `items` are arrays since those tuple validations\n if (\n typeof oldSchemaItems === 'object' &&\n typeof newSchemaItems === 'object' &&\n !Array.isArray(oldSchemaItems) &&\n !Array.isArray(newSchemaItems)\n ) {\n if (hasByPath(oldSchemaItems, REF_KEY)) {\n oldSchemaItems = retrieveSchema<T, S, F>(\n validator,\n oldSchemaItems as S,\n rootSchema,\n data as T,\n experimental_customMergeAllOf,\n );\n }\n if (hasByPath(newSchemaItems, REF_KEY)) {\n newSchemaItems = retrieveSchema<T, S, F>(\n validator,\n newSchemaItems as S,\n rootSchema,\n data as T,\n experimental_customMergeAllOf,\n );\n }\n // Now get types and see if they are the same\n const oldSchemaType = getByPath(oldSchemaItems, 'type');\n const newSchemaType = getByPath(newSchemaItems, 'type');\n // Check if the old option has the same key with the same type\n if (!oldSchemaType || oldSchemaType === newSchemaType) {\n const maxItems = newSchema.maxItems ?? -1;\n if (newSchemaType === 'object') {\n newFormData = data.reduce((newValue, aValue) => {\n const itemValue = sanitizeDataForNewSchema<T, S, F>(\n validator,\n rootSchema,\n newSchemaItems as S,\n oldSchemaItems as S,\n aValue,\n experimental_customMergeAllOf,\n );\n if (itemValue !== undefined && (maxItems < 0 || newValue.length < maxItems)) {\n newValue.push(itemValue);\n }\n return newValue;\n }, []);\n } else {\n // Filter out items that are no longer valid in the new items schema (e.g., enum values that changed)\n const newItemEnumValues = enumValuesForSchema(newSchemaItems as S);\n const filteredData = newItemEnumValues\n ? data.filter((item: any) => newItemEnumValues.some((v: any) => deepEquals(v, item)))\n : data;\n newFormData = maxItems > 0 && filteredData.length > maxItems ? filteredData.slice(0, maxItems) : filteredData;\n }\n }\n } else if (\n typeof oldSchemaItems === 'boolean' &&\n typeof newSchemaItems === 'boolean' &&\n oldSchemaItems === newSchemaItems\n ) {\n // If they are both booleans and have the same value just return the data as is otherwise fall-thru to undefined\n newFormData = data;\n }\n // Also probably want to deal with `prefixItems` as tuples with the latest 2020 draft\n }\n return newFormData as T;\n}\n","// oxlint-disable typescript/no-deprecated\n\nimport {\n ADDITIONAL_PROPERTIES_KEY,\n ALL_OF_KEY,\n ANY_OF_KEY,\n DEPENDENCIES_KEY,\n IF_KEY,\n ITEMS_KEY,\n NAME_KEY,\n ONE_OF_KEY,\n PROPERTIES_KEY,\n REF_KEY,\n RJSF_ADDITIONAL_PROPERTIES_FLAG,\n} from '../constants.ts';\nimport deepEquals from '../deepEquals.ts';\nimport getDiscriminatorFieldFromSchema from '../getDiscriminatorFieldFromSchema.ts';\nimport getPropertySchema from '../getPropertySchema.ts';\nimport isObject from '../isObject.ts';\nimport { getByPath, setByPath } from '../pathUtils.ts';\nimport type {\n Experimental_CustomMergeAllOf,\n FormContextType,\n GenericObjectType,\n PathSchema,\n RJSFSchema,\n StrictRJSFSchema,\n ValidatorType,\n} from '../types.ts';\nimport getClosestMatchingOption from './getClosestMatchingOption.ts';\nimport retrieveSchema from './retrieveSchema.ts';\n\n/** An internal helper that generates an `PathSchema` object for the `schema`, recursively with protection against\n * infinite recursion\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be used when necessary\n * @param schema - The schema for which the `PathSchema` is desired\n * @param [name=''] - The base name for the schema\n * @param [rootSchema] - The root schema, used to primarily to look up `$ref`s\n * @param [formData] - The current formData, if any, to assist retrieving a schema\n * @param [_recurseList=[]] - The list of retrieved schemas currently being recursed, used to prevent infinite recursion\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - The `PathSchema` object for the `schema`\n */\nfunction toPathSchemaInternal<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n validator: ValidatorType<T, S, F>,\n schema: S,\n name: string,\n rootSchema?: S,\n formData?: T,\n _recurseList: S[] = [],\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): PathSchema<T> {\n if (REF_KEY in schema || DEPENDENCIES_KEY in schema || ALL_OF_KEY in schema || IF_KEY in schema) {\n const innerSchema = retrieveSchema<T, S, F>(validator, schema, rootSchema, formData, experimental_customMergeAllOf);\n const sameSchemaIndex = _recurseList.findIndex((item) => deepEquals(item, innerSchema));\n if (sameSchemaIndex === -1) {\n return toPathSchemaInternal<T, S, F>(\n validator,\n innerSchema,\n name,\n rootSchema,\n formData,\n _recurseList.concat(innerSchema),\n experimental_customMergeAllOf,\n );\n }\n }\n\n let pathSchema: PathSchema<T> = {\n [NAME_KEY]: name.replace(/^\\./, ''),\n } as PathSchema<T>;\n\n if (ONE_OF_KEY in schema || ANY_OF_KEY in schema) {\n const xxxOf: S[] = ONE_OF_KEY in schema ? (schema.oneOf as S[]) : (schema.anyOf as S[]);\n const discriminator = getDiscriminatorFieldFromSchema<S>(schema);\n const index = getClosestMatchingOption<T, S, F>(\n validator,\n rootSchema!,\n formData,\n xxxOf,\n 0,\n discriminator,\n experimental_customMergeAllOf,\n );\n const innerSchema: S = xxxOf[index];\n pathSchema = {\n ...pathSchema,\n ...toPathSchemaInternal<T, S, F>(\n validator,\n innerSchema,\n name,\n rootSchema,\n formData,\n _recurseList,\n experimental_customMergeAllOf,\n ),\n };\n }\n\n if (ADDITIONAL_PROPERTIES_KEY in schema && schema[ADDITIONAL_PROPERTIES_KEY] !== false) {\n setByPath(pathSchema, RJSF_ADDITIONAL_PROPERTIES_FLAG, true);\n const additionalSchema = (\n isObject(schema[ADDITIONAL_PROPERTIES_KEY]) ? schema[ADDITIONAL_PROPERTIES_KEY] : {}\n ) as S;\n const definedProperties = schema[PROPERTIES_KEY] ?? {};\n for (const key of Object.keys((formData ?? {}) as GenericObjectType)) {\n if (!(key in definedProperties)) {\n (pathSchema as PathSchema<GenericObjectType>)[key] = toPathSchemaInternal<T, S, F>(\n validator,\n additionalSchema,\n `${name}.${key}`,\n rootSchema,\n getByPath<T>(formData, key),\n _recurseList,\n experimental_customMergeAllOf,\n );\n }\n }\n }\n\n if (ITEMS_KEY in schema && Array.isArray(formData)) {\n const { items: schemaItems, additionalItems: schemaAdditionalItems } = schema;\n\n if (Array.isArray(schemaItems)) {\n formData.forEach((element, i: number) => {\n if (schemaItems[i]) {\n (pathSchema as PathSchema<T[]>)[i] = toPathSchemaInternal<T, S, F>(\n validator,\n schemaItems[i] as S,\n `${name}.${i}`,\n rootSchema,\n element,\n _recurseList,\n experimental_customMergeAllOf,\n );\n } else if (schemaAdditionalItems) {\n (pathSchema as PathSchema<T[]>)[i] = toPathSchemaInternal<T, S, F>(\n validator,\n schemaAdditionalItems as S,\n `${name}.${i}`,\n rootSchema,\n element,\n _recurseList,\n experimental_customMergeAllOf,\n );\n } else {\n // oxlint-disable-next-line no-console\n console.warn(`Unable to generate path schema for \"${name}.${i}\". No schema defined for it`);\n }\n });\n } else {\n formData.forEach((element, i: number) => {\n (pathSchema as PathSchema<T[]>)[i] = toPathSchemaInternal<T, S, F>(\n validator,\n schemaItems as S,\n `${name}.${i}`,\n rootSchema,\n element,\n _recurseList,\n experimental_customMergeAllOf,\n );\n });\n }\n } else if (PROPERTIES_KEY in schema) {\n // This is a deprecated function that is no longer used by RJSF\n // oxlint-disable-next-line guard-for-in\n for (const property in schema.properties) {\n const field = getPropertySchema<S>(schema, property);\n (pathSchema as PathSchema<GenericObjectType>)[property] = toPathSchemaInternal<T, S, F>(\n validator,\n field,\n `${name}.${property}`,\n rootSchema,\n // It's possible that formData is not an object -- this can happen if an\n // array item has just been added, but not populated with data yet\n getByPath<T>(formData, property),\n _recurseList,\n experimental_customMergeAllOf,\n );\n }\n }\n return pathSchema;\n}\n\n/** Generates an `PathSchema` object for the `schema`, recursively\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be used when necessary\n * @param schema - The schema for which the `PathSchema` is desired\n * @param [name=''] - The base name for the schema\n * @param [rootSchema] - The root schema, used to primarily to look up `$ref`s\n * @param [formData] - The current formData, if any, to assist retrieving a schema\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - The `PathSchema` object for the `schema`\n * @deprecated - To be removed as an exported `@rjsf/utils` function in a future release\n */\nexport default function toPathSchema<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n validator: ValidatorType<T, S, F>,\n schema: S,\n name = '',\n rootSchema?: S,\n formData?: T,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): PathSchema<T> {\n return toPathSchemaInternal(validator, schema, name, rootSchema, formData, undefined, experimental_customMergeAllOf);\n}\n","import { ID_KEY, JSON_SCHEMA_DRAFT_2020_12, SCHEMA_KEY } from './constants.ts';\nimport deepEquals from './deepEquals.ts';\nimport { makeAllReferencesAbsolute } from './findSchemaDefinition.ts';\nimport {\n findFieldInSchema,\n findSelectedOptionInXxxOf,\n getDefaultFormState,\n getDisplayLabel,\n getClosestMatchingOption,\n getFirstMatchingOption,\n getFromSchema,\n isFilesArray,\n isMultiSelect,\n isSelect,\n omitExtraData,\n retrieveSchema,\n sanitizeDataForNewSchema,\n toPathSchema,\n} from './schema/index.ts';\nimport type {\n Experimental_CustomMergeAllOf,\n Experimental_DefaultFormStateBehavior,\n FormContextType,\n FoundFieldType,\n GlobalUISchemaOptions,\n PathSchema,\n RJSFSchema,\n SchemaFieldPath,\n SchemaUtilsType,\n StrictRJSFSchema,\n UiSchema,\n ValidatorType,\n} from './types.ts';\n\n/** The `SchemaUtils` class provides a wrapper around the publicly exported APIs in the `utils/schema` directory such\n * that one does not have to explicitly pass the `validator`, `rootSchema`, `experimental_defaultFormStateBehavior` or\n * `experimental_customMergeAllOf` to each method. Since these generally do not change across a `Form`, this allows for\n * providing a simplified set of APIs to the `@rjsf/core` components and the various themes as well. This class\n * implements the `SchemaUtilsType` interface.\n */\nclass SchemaUtils<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n> implements SchemaUtilsType<T, S, F> {\n rootSchema: S;\n validator: ValidatorType<T, S, F>;\n experimental_defaultFormStateBehavior: Experimental_DefaultFormStateBehavior;\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>;\n\n /** Constructs the `SchemaUtils` instance with the given `validator` and `rootSchema` stored as instance variables\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be forwarded to all the APIs\n * @param rootSchema - The root schema that will be forwarded to all the APIs\n * @param experimental_defaultFormStateBehavior - Configuration flags to allow users to override default form state behavior\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n */\n constructor(\n validator: ValidatorType<T, S, F>,\n rootSchema: S,\n experimental_defaultFormStateBehavior: Experimental_DefaultFormStateBehavior,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n ) {\n if (rootSchema?.[SCHEMA_KEY] === JSON_SCHEMA_DRAFT_2020_12) {\n this.rootSchema = makeAllReferencesAbsolute(rootSchema, rootSchema[ID_KEY] ?? '#');\n } else {\n this.rootSchema = rootSchema;\n }\n this.validator = validator;\n this.experimental_defaultFormStateBehavior = experimental_defaultFormStateBehavior;\n this.experimental_customMergeAllOf = experimental_customMergeAllOf;\n }\n\n /** Returns the `rootSchema` in the `SchemaUtilsType`\n *\n * @returns - The `rootSchema`\n */\n getRootSchema() {\n return this.rootSchema;\n }\n\n /** Returns the `ValidatorType` in the `SchemaUtilsType`\n *\n * @returns - The `ValidatorType`\n */\n getValidator() {\n return this.validator;\n }\n\n /** Determines whether either the `validator` and `rootSchema` differ from the ones associated with this instance of\n * the `SchemaUtilsType`. If either `validator` or `rootSchema` are falsy, then return false to prevent the creation\n * of a new `SchemaUtilsType` with incomplete properties.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be compared against the current one\n * @param rootSchema - The root schema that will be compared against the current one\n * @param [experimental_defaultFormStateBehavior] Optional configuration object, if provided, allows users to override default form state behavior\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - True if the `SchemaUtilsType` differs from the given `validator` or `rootSchema`\n */\n doesSchemaUtilsDiffer(\n validator: ValidatorType<T, S, F>,\n rootSchema: S,\n experimental_defaultFormStateBehavior = {},\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n ): boolean {\n // If either validator or rootSchema are falsy, return false to prevent the creation\n // of a new SchemaUtilsType with incomplete properties.\n if (!validator || !rootSchema) {\n return false;\n }\n\n return (\n this.validator !== validator ||\n !deepEquals(this.rootSchema, rootSchema) ||\n !deepEquals(this.experimental_defaultFormStateBehavior, experimental_defaultFormStateBehavior) ||\n this.experimental_customMergeAllOf !== experimental_customMergeAllOf\n );\n }\n\n /** Finds the field specified by the `path` within the root or recursed `schema`. If there is no field for the specified\n * `path`, then the default `{ field: undefined, isRequired: undefined }` is returned. It determines whether a leaf\n * field is in the `required` list for its parent and if so, it is marked as required on return.\n *\n * @param schema - The current node within the JSON schema\n * @param path - The remaining keys in the path to the desired field\n * @param [formData] - The form data that is used to determine which oneOf option\n * @returns - An object that contains the field and its required state. If no field can be found then\n * `{ field: undefined, isRequired: undefined }` is returned.\n */\n findFieldInSchema(schema: S, path: SchemaFieldPath, formData?: T): FoundFieldType<S> {\n return findFieldInSchema(\n this.validator,\n this.rootSchema,\n schema,\n path,\n formData,\n this.experimental_customMergeAllOf,\n );\n }\n\n /** Finds the oneOf option inside the `schema['any/oneOf']` list which has the `properties[selectorField].default` that\n * matches the `formData[selectorField]` value. For the purposes of this function, `selectorField` is either\n * `schema.discriminator.propertyName` or `fallbackField`.\n *\n * @param schema - The schema element in which to search for the selected oneOf option\n * @param fallbackField - The field to use as a backup selector field if the schema does not have a required field\n * @param xxx - Either `oneOf` or `anyOf`, defines which value is being sought\n * @param [formData={}] - The form data that is used to determine which oneOf option\n * @returns - The anyOf/oneOf option that matches the selector field in the schema or undefined if nothing is selected\n */\n findSelectedOptionInXxxOf(schema: S, fallbackField: string, xxx: 'anyOf' | `oneOf`, formData: T): S | undefined {\n return findSelectedOptionInXxxOf(\n this.validator,\n this.rootSchema,\n schema,\n fallbackField,\n xxx,\n formData,\n this.experimental_customMergeAllOf,\n );\n }\n\n /** Returns the superset of `formData` that includes the given set updated to include any missing fields that have\n * computed to have defaults provided in the `schema`.\n *\n * @param schema - The schema for which the default state is desired\n * @param [formData] - The current formData, if any, onto which to provide any missing defaults\n * @param [includeUndefinedValues=false] - Optional flag, if true, cause undefined values to be added as defaults.\n * If \"excludeObjectChildren\", pass `includeUndefinedValues` as false when computing defaults for any nested\n * object properties.\n * @param initialDefaultsGenerated - Indicates whether or not initial defaults have been generated\n * @returns - The resulting `formData` with all the defaults provided\n */\n getDefaultFormState(\n schema: S,\n formData?: T,\n includeUndefinedValues: boolean | 'excludeObjectChildren' = false,\n initialDefaultsGenerated?: boolean,\n ): T | T[] | undefined {\n return getDefaultFormState<T, S, F>(\n this.validator,\n schema,\n formData,\n this.rootSchema,\n includeUndefinedValues,\n this.experimental_defaultFormStateBehavior,\n this.experimental_customMergeAllOf,\n initialDefaultsGenerated,\n );\n }\n\n /** Determines whether the combination of `schema` and `uiSchema` properties indicates that the label for the `schema`\n * should be displayed in a UI.\n *\n * @param schema - The schema for which the display label flag is desired\n * @param [uiSchema] - The UI schema from which to derive potentially displayable information\n * @param [globalOptions={}] - The optional Global UI Schema from which to get any fallback `xxx` options\n * @returns - True if the label should be displayed or false if it should not\n */\n getDisplayLabel(schema: S, uiSchema?: UiSchema<T, S, F>, globalOptions?: GlobalUISchemaOptions) {\n return getDisplayLabel<T, S, F>(\n this.validator,\n schema,\n uiSchema,\n this.rootSchema,\n globalOptions,\n this.experimental_customMergeAllOf,\n );\n }\n\n /** Determines which of the given `options` provided most closely matches the `formData`.\n * Returns the index of the option that is valid and is the closest match, or 0 if there is no match.\n *\n * The closest match is determined using the number of matching properties, and more heavily favors options with\n * matching readOnly, default, or const values.\n *\n * @param formData - The form data associated with the schema\n * @param options - The list of options that can be selected from\n * @param [selectedOption] - The index of the currently selected option, defaulted to -1 if not specified\n * @param [discriminatorField] - The optional name of the field within the options object whose value is used to\n * determine which option is selected\n * @returns - The index of the option that is the closest match to the `formData` or the `selectedOption` if no match\n */\n getClosestMatchingOption(\n formData: T | undefined,\n options: S[],\n selectedOption?: number,\n discriminatorField?: string,\n ): number {\n return getClosestMatchingOption<T, S, F>(\n this.validator,\n this.rootSchema,\n formData,\n options,\n selectedOption,\n discriminatorField,\n this.experimental_customMergeAllOf,\n );\n }\n\n /** Given the `formData` and list of `options`, attempts to find the index of the first option that matches the data.\n * Always returns the first option if there is nothing that matches.\n *\n * @param formData - The current formData, if any, used to figure out a match\n * @param options - The list of options to find a matching options from\n * @param [discriminatorField] - The optional name of the field within the options object whose value is used to\n * determine which option is selected\n * @returns - The firstindex of the matched option or 0 if none is available\n */\n getFirstMatchingOption(formData: T | undefined, options: S[], discriminatorField?: string): number {\n return getFirstMatchingOption<T, S, F>(this.validator, formData, options, this.rootSchema, discriminatorField);\n }\n\n /** Reads the value at `path` within a schema, additionally retrieving `$ref`s as needed to resolve\n * schemas containing potentially nested `$ref`s.\n *\n * @param schema - The current node within the JSON schema recursion\n * @param path - The remaining keys in the path to the desired property\n * @param defaultValue - The value to return if a value is not found for the `pathList` path\n * @returns - The internal schema from the `schema` for the given `path` or the `defaultValue` if not found\n */\n getFromSchema(schema: S, path: SchemaFieldPath, defaultValue: T): T;\n getFromSchema(schema: S, path: SchemaFieldPath, defaultValue: S): S;\n getFromSchema(schema: S, path: SchemaFieldPath, defaultValue: T | S): T | S {\n return getFromSchema<T, S, F>(\n this.validator,\n this.rootSchema,\n schema,\n path,\n // @ts-expect-error TS2769: No overload matches this call\n defaultValue,\n this.experimental_customMergeAllOf,\n );\n }\n\n /** Checks to see if the `schema` and `uiSchema` combination represents an array of files\n *\n * @param schema - The schema for which check for array of files flag is desired\n * @param [uiSchema] - The UI schema from which to check the widget\n * @returns - True if schema/uiSchema contains an array of files, otherwise false\n */\n isFilesArray(schema: S, uiSchema?: UiSchema<T, S, F>) {\n return isFilesArray<T, S, F>(this.validator, schema, uiSchema, this.rootSchema, this.experimental_customMergeAllOf);\n }\n\n /** Checks to see if the `schema` combination represents a multi-select\n *\n * @param schema - The schema for which check for a multi-select flag is desired\n * @returns - True if schema contains a multi-select, otherwise false\n */\n isMultiSelect(schema: S) {\n return isMultiSelect<T, S, F>(this.validator, schema, this.rootSchema, this.experimental_customMergeAllOf);\n }\n\n /** Checks to see if the `schema` combination represents a select\n *\n * @param schema - The schema for which check for a select flag is desired\n * @returns - True if schema contains a select, otherwise false\n */\n isSelect(schema: S) {\n return isSelect<T, S, F>(this.validator, schema, this.rootSchema, this.experimental_customMergeAllOf);\n }\n /**\n * The function takes a `schema` and `formData` and returns a copy of the formData with any fields not defined in the schema removed.\n * This is useful for ensuring that only data that is relevant to the schema is preserved. Objects with `additionalProperties`\n * keyword set to `true` will not have their extra fields removed.\n *\n * @param schema - The schema to use for filtering the `formData`\n * @param [formData] - The formData to filter\n * @returns The new form data, with any fields not defined in the schema removed\n */\n omitExtraData(schema: S, formData?: T): T | undefined {\n return omitExtraData<T, S, F>(this.validator, schema, this.rootSchema, formData);\n }\n\n /** Retrieves an expanded schema that has had all of its conditions, additional properties, references and\n * dependencies resolved and merged into the `schema` given a `rawFormData` that is used to do the potentially\n * recursive resolution.\n *\n * @param schema - The schema for which retrieving a schema is desired\n * @param [rawFormData] - The current formData, if any, to assist retrieving a schema\n * @param [resolveAnyOfOrOneOfRefs] - Optional flag indicating whether to resolved refs in anyOf/oneOf lists\n * @returns - The schema having its conditions, additional properties, references and dependencies resolved\n */\n retrieveSchema(schema: S, rawFormData?: T, resolveAnyOfOrOneOfRefs?: boolean) {\n return retrieveSchema<T, S, F>(\n this.validator,\n schema,\n this.rootSchema,\n rawFormData,\n this.experimental_customMergeAllOf,\n resolveAnyOfOrOneOfRefs,\n );\n }\n\n /** Sanitize the `data` associated with the `oldSchema` so it is considered appropriate for the `newSchema`. If the\n * new schema does not contain any properties, then `undefined` is returned to clear all the form data. Due to the\n * nature of schemas, this sanitization happens recursively for nested objects of data. Also, any properties in the\n * old schemas that are non-existent in the new schema are set to `undefined`.\n *\n * @param [newSchema] - The new schema for which the data is being sanitized\n * @param [oldSchema] - The old schema from which the data originated\n * @param [data={}] - The form data associated with the schema, defaulting to an empty object when undefined\n * @returns - The new form data, with all the fields uniquely associated with the old schema set\n * to `undefined`. Will return `undefined` if the new schema is not an object containing properties.\n */\n sanitizeDataForNewSchema(newSchema?: S, oldSchema?: S, data?: any): T {\n return sanitizeDataForNewSchema(\n this.validator,\n this.rootSchema,\n newSchema,\n oldSchema,\n data,\n this.experimental_customMergeAllOf,\n );\n }\n\n /** Generates an `PathSchema` object for the `schema`, recursively\n *\n * @param schema - The schema for which the display label flag is desired\n * @param [name] - The base name for the schema\n * @param [formData] - The current formData, if any, onto which to provide any missing defaults\n * @returns - The `PathSchema` object for the `schema`\n */\n // oxlint-disable-next-line typescript/no-deprecated\n toPathSchema(schema: S, name?: string, formData?: T): PathSchema<T> {\n // oxlint-disable-next-line typescript/no-deprecated\n return toPathSchema<T, S, F>(\n this.validator,\n schema,\n name,\n this.rootSchema,\n formData,\n this.experimental_customMergeAllOf,\n );\n }\n}\n\n/** Creates a `SchemaUtilsType` interface that is based around the given `validator` and `rootSchema` parameters. The\n * resulting interface implementation will forward the `validator` and `rootSchema` to all the wrapped APIs.\n *\n * @param validator - an implementation of the `ValidatorType` interface that will be forwarded to all the APIs\n * @param rootSchema - The root schema that will be forwarded to all the APIs\n * @param [experimental_defaultFormStateBehavior] Optional configuration object, if provided, allows users to override default form state behavior\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - An implementation of a `SchemaUtilsType` interface\n */\nexport default function createSchemaUtils<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n validator: ValidatorType<T, S, F>,\n rootSchema: S,\n experimental_defaultFormStateBehavior = {},\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): SchemaUtilsType<T, S, F> {\n return new SchemaUtils<T, S, F>(\n validator,\n rootSchema,\n experimental_defaultFormStateBehavior,\n experimental_customMergeAllOf,\n );\n}\n","/** Given the `FileReader.readAsDataURL()` based `dataURI` extracts that data into an actual Blob along with the name\n * of that Blob if provided in the URL. If no name is provided, then the name falls back to `unknown`.\n *\n * @param dataURI - The `DataUrl` potentially containing name and raw data to be converted to a Blob\n * @returns - an object containing a Blob and its name, extracted from the URI\n */\nexport default function dataURItoBlob(dataURILike: string) {\n // check if is dataURI\n if (!dataURILike.includes('data:')) {\n throw new Error('File is invalid: URI must be a dataURI');\n }\n const dataURI = dataURILike.slice(5);\n // split the dataURI into media and base64, with the base64 signature\n const splitted = dataURI.split(';base64,');\n // if the base64 signature is not present, the latter part will become empty\n if (splitted.length !== 2) {\n throw new Error('File is invalid: dataURI must be base64');\n }\n // extract the mime type, media parameters including the name, and the base64 string\n const [media, base64] = splitted;\n const [mime, ...mediaparams] = media.split(';');\n const type = mime || '';\n\n // extract the name from the parameters\n const name = decodeURI(\n // parse the parameters into key-value pairs, find a key, and extract a value\n // if no key is found, then the name is unknown\n mediaparams.map((param) => param.split('=')).find(([key]) => key === 'name')?.[1] || 'unknown',\n );\n\n // Built the Uint8Array Blob parameter from the base64 string.\n try {\n const binary = atob(base64);\n const array = new Array(binary.length);\n for (let i = 0; i < binary.length; i += 1) {\n array[i] = binary.charCodeAt(i);\n }\n // Create the blob object\n const blob = new window.Blob([new Uint8Array(array)], { type });\n\n return { blob, name };\n } catch (error) {\n throw new Error(`File is invalid: ${(error as Error).message}`);\n }\n}\n","/** Returns a string representation of the `num` that is padded with leading \"0\"s if necessary\n *\n * @param num - The number to pad\n * @param width - The width of the string at which no lead padding is necessary\n * @returns - The number converted to a string with leading zero padding if the number of digits is less than `width`\n */\nexport default function pad(num: number, width: number) {\n let s = String(num);\n while (s.length < width) {\n s = `0${s}`;\n }\n return s;\n}\n","import pad from './pad.ts';\nimport type { EnumOptionsType, RJSFSchema, StrictRJSFSchema } from './types.ts';\n\n/** Returns a list of options for a date range between `start` and `stop`. If the start date is greater than the end\n * date, then the date range is reversed. If `start` and `stop` are negative numbers (or zero), then they will be\n * treated as relative to the current year.\n *\n * @param start - The starting point of the date range\n * @param stop - The ending point of the date range\n * @returns - The list of EnumOptionsType for the date range between `start` and `stop`\n * @throws - Error when `start` and `stop` aren't both <= 0 or > 0\n */\nexport default function dateRangeOptions<S extends StrictRJSFSchema = RJSFSchema>(\n start: number,\n stop: number,\n): EnumOptionsType<S>[] {\n const bothRelative = start <= 0 && stop <= 0;\n const eitherNegative = start < 0 || stop < 0;\n if (!bothRelative && eitherNegative) {\n throw new Error(`Both start (${start}) and stop (${stop}) must both be <= 0 or > 0, got one of each`);\n }\n const currentYear = new Date().getFullYear();\n const resolvedStart = bothRelative ? currentYear + start : start;\n const resolvedStop = bothRelative ? currentYear + stop : stop;\n if (resolvedStart > resolvedStop) {\n return dateRangeOptions<S>(stop, start).reverse();\n }\n const options: EnumOptionsType<S>[] = [];\n for (let i = resolvedStart; i <= resolvedStop; i += 1) {\n options.push({ value: i, label: pad(i, 2) });\n }\n return options;\n}\n","/** Potentially substitutes all replaceable parameters with the associated value(s) from the `params` if available. When\n * a `params` array is provided, each value in the array is used to replace any of the replaceable parameters in the\n * `inputString` using the `%1`, `%2`, etc. replacement specifiers.\n *\n * @param inputString - The string which will be potentially updated with replacement parameters\n * @param params - The optional list of replaceable parameter values to substitute into the english string\n * @returns - The updated string with any replacement specifiers replaced\n */\nexport default function replaceStringParameters(inputString: string, params?: string[]) {\n let output = inputString;\n if (Array.isArray(params)) {\n const parts = output.split(/(%\\d)/);\n params.forEach((param, index) => {\n const partIndex = parts.findIndex((part) => part === `%${index + 1}`);\n if (partIndex >= 0) {\n parts[partIndex] = param;\n }\n });\n output = parts.join('');\n }\n return output;\n}\n","import type { TranslatableString } from './enums.ts';\nimport replaceStringParameters from './replaceStringParameters.ts';\n\n/** Translates a `TranslatableString` value `stringToTranslate` into english. When a `params` array is provided, each\n * value in the array is used to replace any of the replaceable parameters in the `stringToTranslate` using the `%1`,\n * `%2`, etc. replacement specifiers.\n *\n * @param stringToTranslate - The `TranslatableString` value to convert to english\n * @param params - The optional list of replaceable parameter values to substitute into the english string\n * @returns - The `stringToTranslate` itself with any replaceable parameter values substituted\n */\nexport default function englishStringTranslator(stringToTranslate: TranslatableString, params?: string[]): string {\n return replaceStringParameters(stringToTranslate, params);\n}\n","import type { EnumOptionsType, RJSFSchema, StrictRJSFSchema } from './types.ts';\n\n/** Returns the value(s) from `allEnumOptions` at the index(es) provided by `valueIndex`. If `valueIndex` is not an\n * array AND the index is not valid for `allEnumOptions`, `emptyValue` is returned. If `valueIndex` is an array, AND it\n * contains an invalid index, the returned array will have the resulting undefined values filtered out, leaving only\n * valid values or in the worst case, an empty array.\n *\n * @param valueIndex - The index(es) of the value(s) that should be returned\n * @param [allEnumOptions=[]] - The list of all the known enumOptions\n * @param [emptyValue] - The value to return when the non-array `valueIndex` does not refer to a real option\n * @returns - The single or list of values specified by the single or list of indexes if they are valid. Otherwise,\n * `emptyValue` or an empty list.\n */\nexport default function enumOptionsValueForIndex<S extends StrictRJSFSchema = RJSFSchema>(\n valueIndex: string | number | (string | number)[],\n allEnumOptions: EnumOptionsType<S>[] = [],\n emptyValue?: EnumOptionsType<S>['value'],\n): EnumOptionsType<S>['value'] | EnumOptionsType<S>['value'][] | undefined {\n if (Array.isArray(valueIndex)) {\n return (\n valueIndex\n .map((index) => enumOptionsValueForIndex(index, allEnumOptions))\n // The recursive call returns undefined for a bad option, filter those out\n .filter((val) => val !== undefined)\n );\n }\n // So Number(null) and Number('') both return 0, so use emptyValue for those two values\n const index = valueIndex === '' || valueIndex === null ? -1 : Number(valueIndex);\n const option = allEnumOptions[index];\n return option ? option.value : emptyValue;\n}\n","import deepEquals from './deepEquals.ts';\nimport enumOptionsValueForIndex from './enumOptionsValueForIndex.ts';\nimport type { EnumOptionsType, RJSFSchema, StrictRJSFSchema } from './types.ts';\n\n/** Removes the enum option value at the `valueIndex` from the currently `selected` (list of) value(s). If `selected` is\n * a list, then that list is updated to remove the enum option value with the `valueIndex` in `allEnumOptions`. If it is\n * a single value, then if the enum option value with the `valueIndex` in `allEnumOptions` matches `selected`, undefined\n * is returned, otherwise the `selected` value is returned.\n *\n * @param valueIndex - The index of the value to be removed from the selected list or single value\n * @param selected - The current (list of) selected value(s)\n * @param [allEnumOptions=[]] - The list of all the known enumOptions\n * @returns - The updated `selected` with the enum option value at `valueIndex` in `allEnumOptions` removed from it,\n * unless `selected` is a single value. In that case, if the `valueIndex` value matches `selected`, returns\n * undefined, otherwise `selected`.\n */\nexport default function enumOptionsDeselectValue<S extends StrictRJSFSchema = RJSFSchema>(\n valueIndex: string | number,\n selected?: EnumOptionsType<S>['value'] | EnumOptionsType<S>['value'][],\n allEnumOptions: EnumOptionsType<S>[] = [],\n): EnumOptionsType<S>['value'] | EnumOptionsType<S>['value'][] | undefined {\n const value = enumOptionsValueForIndex<S>(valueIndex, allEnumOptions);\n if (Array.isArray(selected)) {\n return selected.filter((v) => !deepEquals(v, value));\n }\n return deepEquals(value, selected) ? undefined : selected;\n}\n","import deepEquals from './deepEquals.ts';\nimport type { EnumOptionsType, RJSFSchema, StrictRJSFSchema } from './types.ts';\n\n/** Determines whether the given `value` is (one of) the `selected` value(s).\n *\n * @param value - The value being checked to see if it is selected\n * @param selected - The current selected value or list of values\n * @returns - true if the `value` is one of the `selected` ones, false otherwise\n */\nexport default function enumOptionsIsSelected<S extends StrictRJSFSchema = RJSFSchema>(\n value: EnumOptionsType<S>['value'],\n selected: EnumOptionsType<S>['value'] | EnumOptionsType<S>['value'][],\n) {\n if (Array.isArray(selected)) {\n return selected.some((sel) => deepEquals(sel, value));\n }\n return deepEquals(selected, value);\n}\n","import enumOptionsIsSelected from './enumOptionsIsSelected.ts';\nimport type { EnumOptionsType, RJSFSchema, StrictRJSFSchema } from './types.ts';\n\n/** Returns the index(es) of the options in `allEnumOptions` whose value(s) match the ones in `value`. All the\n * `enumOptions` are filtered based on whether they are a \"selected\" `value` and the index of each selected one is then\n * stored in an array. If `multiple` is true, that array is returned, otherwise the first element in the array is\n * returned.\n *\n * @param value - The single value or list of values for which indexes are desired\n * @param [allEnumOptions=[]] - The list of all the known enumOptions\n * @param [multiple=false] - Optional flag, if true will return a list of index, otherwise a single one\n * @returns - A single string index for the first `value` in `allEnumOptions`, if not `multiple`. Otherwise, the list\n * of indexes for (each of) the value(s) in `value`.\n */\nexport default function enumOptionsIndexForValue<S extends StrictRJSFSchema = RJSFSchema>(\n value: EnumOptionsType<S>['value'] | EnumOptionsType<S>['value'][],\n allEnumOptions: EnumOptionsType<S>[] = [],\n multiple = false,\n): string | string[] | undefined {\n const selectedIndexes: string[] = allEnumOptions\n .map((opt, index) => (enumOptionsIsSelected(opt.value, value) ? String(index) : undefined))\n .filter((opt) => typeof opt !== 'undefined');\n if (!multiple) {\n return selectedIndexes[0];\n }\n return selectedIndexes;\n}\n","import enumOptionsIndexForValue from './enumOptionsIndexForValue.ts';\nimport type { EnumOptionsType, OptionValueFormat, StrictRJSFSchema, RJSFSchema } from './types.ts';\n\n/** Computes the value to pass to a select element's `value` attribute.\n *\n * When `format` is `'realValue'`, converts form data values to strings.\n * When `format` is `'indexed'` (the default), resolves to index-based values via\n * `enumOptionsIndexForValue`. Returns `emptyValue` when the current value is empty.\n *\n * @param value - The current form data value\n * @param enumOptions - The available enum options\n * @param multiple - Whether the select allows multiple selections\n * @param [format='indexed'] - How option values are encoded on the DOM\n * @param emptyValue - The value to return when the selection is empty\n * @returns The value to use for the select element's `value` attribute\n */\nexport default function enumOptionSelectedValue<S extends StrictRJSFSchema = RJSFSchema>(\n value: any,\n enumOptions: EnumOptionsType<S>[] | undefined,\n multiple: boolean,\n format: OptionValueFormat = 'indexed',\n emptyValue?: any,\n): any {\n const isEmpty =\n typeof value === 'undefined' ||\n (multiple && Array.isArray(value) && value.length < 1) ||\n (!multiple && value === emptyValue);\n\n if (isEmpty) {\n return emptyValue;\n }\n\n if (format === 'realValue') {\n return multiple ? value.map(String) : String(value);\n }\n\n const indexes = enumOptionsIndexForValue<S>(value, enumOptions, multiple);\n return typeof indexes === 'undefined' ? emptyValue : indexes;\n}\n","import enumOptionsValueForIndex from './enumOptionsValueForIndex.ts';\nimport type { EnumOptionsType, RJSFSchema, StrictRJSFSchema } from './types.ts';\n\n/** Add the enum option value at the `valueIndex` to the list of `selected` values in the proper order as defined by\n * `allEnumOptions`\n *\n * @param valueIndex - The index of the value that should be selected\n * @param selected - The current list of selected values\n * @param [allEnumOptions=[]] - The list of all the known enumOptions\n * @returns - The updated list of selected enum values with enum value at the `valueIndex` added to it\n */\nexport default function enumOptionsSelectValue<S extends StrictRJSFSchema = RJSFSchema>(\n valueIndex: string | number,\n selected: EnumOptionsType<S>['value'][],\n allEnumOptions: EnumOptionsType<S>[] = [],\n) {\n const value = enumOptionsValueForIndex<S>(valueIndex, allEnumOptions);\n if (value != null) {\n const index = allEnumOptions.findIndex((opt) => value === opt.value);\n const all = allEnumOptions.map(({ value: val }) => val);\n const updated = selected.slice(0, index).concat(value, selected.slice(index));\n // As inserting values at predefined index positions doesn't work with empty\n // arrays, we need to reorder the updated selection to match the initial order\n return updated.sort((a, b) => Number(all.indexOf(a) > all.indexOf(b)));\n }\n return selected;\n}\n","import enumOptionsValueForIndex from './enumOptionsValueForIndex.ts';\nimport type { EnumOptionsType, OptionValueFormat, StrictRJSFSchema, RJSFSchema } from './types.ts';\n\n/** Resolves a single DOM value string back to its typed enum value in `'realValue'` mode.\n *\n * First attempts a reverse lookup by matching `String(opt.value)` against the input.\n * If no option matches and the input parses as a valid index, falls back to the\n * option at that index — this is how object/array enum values round-trip, since\n * they are encoded as indices by the encoder.\n *\n * @param value - A single string value from a DOM attribute\n * @param enumOptions - The available enum options\n * @param emptyValue - The value to return when the input is empty, options are missing, or no match is found\n * @returns The original typed enum value, or `emptyValue`\n */\nfunction decodeSingle<S extends StrictRJSFSchema = RJSFSchema>(\n value: string,\n enumOptions: EnumOptionsType<S>[] | undefined,\n emptyValue?: unknown,\n): unknown {\n if (value === '' || !Array.isArray(enumOptions)) {\n return emptyValue;\n }\n const match = enumOptions.find((opt) => String(opt.value) === value);\n if (match) {\n return match.value;\n }\n // Fallback: value might be an index (for object/array enum values)\n const index = Number(value);\n if (!Number.isNaN(index) && index >= 0 && index < enumOptions.length) {\n return enumOptions[index].value;\n }\n return emptyValue;\n}\n\n/** Decodes a string from a DOM value attribute back to a typed enum value.\n *\n * When `format` is `'realValue'`, does a reverse lookup: finds the enum option\n * whose `String(value)` matches the input string and returns the original typed value.\n * For object/array values that were encoded as indices, falls back to index resolution.\n *\n * When `format` is `'indexed'` (the default), uses index-based resolution via\n * `enumOptionsValueForIndex`.\n *\n * @param value - The string value(s) from the DOM\n * @param enumOptions - The available enum options\n * @param [format='indexed'] - How the values were encoded on the DOM\n * @param emptyValue - The value to return for empty/missing selections\n * @returns The original typed enum value(s)\n */\nexport default function enumOptionValueDecoder<S extends StrictRJSFSchema = RJSFSchema>(\n value: string | string[],\n enumOptions: EnumOptionsType<S>[] | undefined,\n format: OptionValueFormat = 'indexed',\n emptyValue?: unknown,\n): unknown {\n if (format !== 'realValue') {\n return enumOptionsValueForIndex<S>(value, enumOptions, emptyValue);\n }\n if (Array.isArray(value)) {\n return value.map((v) => decodeSingle(v, enumOptions, emptyValue));\n }\n return decodeSingle(value, enumOptions, emptyValue);\n}\n","import type { OptionValueFormat } from './types.ts';\n\n/** Encodes an enum option value into a string for a DOM value attribute.\n *\n * When `format` is `'realValue'`, primitive values are converted via `String()`.\n * Non-primitive values (objects, arrays) fall back to the index since\n * `String()` would produce `\"[object Object]\"`.\n *\n * When `format` is `'indexed'` (the default), returns the index as a string.\n *\n * @param value - The typed enum value\n * @param index - The option's position in the enumOptions array\n * @param [format='indexed'] - How to encode the value for the DOM attribute\n * @returns The string to use as the DOM value attribute\n */\nexport default function enumOptionValueEncoder(\n value: unknown,\n index: number,\n format: OptionValueFormat = 'indexed',\n): string {\n if (format !== 'realValue') {\n return String(index);\n }\n if (value == null) {\n return '';\n }\n if (typeof value === 'object') {\n return String(index);\n }\n return String(value);\n}\n","import { ERRORS_KEY } from './constants.ts';\nimport { getByPath, setByPath, toPath } from './pathUtils.ts';\nimport type { ErrorSchema, FieldPathList } from './types.ts';\n\n/** Represents the type of the path which can be a string of dotted path values or a list of string or numbers where\n * numbers represent array indexes/\n */\nexport type PathType = string | FieldPathList;\n\n/** The `ErrorSchemaBuilder<T>` is used to build an `ErrorSchema<T>` since the definition of the `ErrorSchema` type is\n * designed for reading information rather than writing it. Use this class to add, replace or clear errors in an error\n * schema by using either dotted path or an array of path names. Once you are done building the `ErrorSchema`, you can\n * get the result and/or reset all the errors back to an initial set and start again.\n */\nexport default class ErrorSchemaBuilder<T = any> {\n /** The error schema being built\n *\n * @private\n */\n private errorSchema: ErrorSchema<T> = {};\n\n /** Construct an `ErrorSchemaBuilder` with an optional initial set of errors in an `ErrorSchema`.\n *\n * @param [initialSchema] - The optional set of initial errors, that will be cloned into the class\n */\n constructor(initialSchema?: ErrorSchema<T>) {\n this.resetAllErrors(initialSchema);\n }\n\n /** Returns the `ErrorSchema` that has been updated by the methods of the `ErrorSchemaBuilder`\n */\n get ErrorSchema() {\n return this.errorSchema;\n }\n\n /** Will get an existing `ErrorSchema` at the specified `pathOfError` or create and return one.\n *\n * @param [pathOfError] - The optional path into the `ErrorSchema` at which to add the error(s)\n * @returns - The error block for the given `pathOfError` or the root if not provided\n * @private\n */\n private getOrCreateErrorBlock(pathOfError?: PathType) {\n // A string path is dotted-path notation, so parse it into its segments\n const path = typeof pathOfError === 'string' ? toPath(pathOfError) : (pathOfError ?? []);\n if (path.length === 0) {\n return this.errorSchema;\n }\n // An `ErrorSchema` only ever nests `ErrorSchema` blocks, so create any missing block along the path,\n // always as a plain object since an `ErrorSchema` is never an array\n let errorBlock = getByPath<ErrorSchema | undefined>(this.errorSchema, path);\n if (!errorBlock) {\n errorBlock = {};\n setByPath(this.errorSchema, path, errorBlock, true);\n }\n return errorBlock;\n }\n\n /** Resets all errors in the `ErrorSchemaBuilder` back to the `initialSchema` if provided, otherwise an empty set.\n *\n * @param [initialSchema] - The optional set of initial errors, that will be cloned into the class\n * @returns - The `ErrorSchemaBuilder` object for chaining purposes\n */\n resetAllErrors(initialSchema?: ErrorSchema<T>) {\n this.errorSchema = initialSchema ? structuredClone(initialSchema) : {};\n return this;\n }\n\n /** Adds the `errorOrList` to the list of errors in the `ErrorSchema` at either the root level or the location within\n * the schema described by the `pathOfError`. The path is either a dotted string (with optional bracketed array\n * indexes, e.g. `'a.b[0]'`) or a list of path segments; keys containing dots require the list form.\n *\n * @param errorOrList - The error or list of errors to add into the `ErrorSchema`\n * @param [pathOfError] - The optional path into the `ErrorSchema` at which to add the error(s)\n * @returns - The `ErrorSchemaBuilder` object for chaining purposes\n */\n addErrors(errorOrList: string | string[], pathOfError?: PathType) {\n const errorBlock: ErrorSchema = this.getOrCreateErrorBlock(pathOfError);\n let errorsList = errorBlock[ERRORS_KEY];\n if (!Array.isArray(errorsList)) {\n errorsList = [];\n errorBlock[ERRORS_KEY] = errorsList;\n }\n\n if (Array.isArray(errorOrList)) {\n errorBlock[ERRORS_KEY] = [...new Set([...errorsList, ...errorOrList])];\n } else {\n errorBlock[ERRORS_KEY] = [...new Set([...errorsList, errorOrList])];\n }\n return this;\n }\n\n /** Sets/replaces the `errorOrList` as the error(s) in the `ErrorSchema` at either the root level or the location\n * within the schema described by the `pathOfError`. The path is either a dotted string (with optional bracketed array\n * indexes, e.g. `'a.b[0]'`) or a list of path segments; keys containing dots require the list form.\n *\n * @param errorOrList - The error or list of errors to set into the `ErrorSchema`\n * @param [pathOfError] - The optional path into the `ErrorSchema` at which to set the error(s)\n * @returns - The `ErrorSchemaBuilder` object for chaining purposes\n */\n setErrors(errorOrList: string | string[], pathOfError?: PathType) {\n const errorBlock: ErrorSchema = this.getOrCreateErrorBlock(pathOfError);\n // Effectively clone the array being given to prevent accidental outside manipulation of the given list\n const listToAdd = Array.isArray(errorOrList) ? [...new Set([...errorOrList])] : [errorOrList];\n errorBlock[ERRORS_KEY] = listToAdd;\n return this;\n }\n\n /** Clears the error(s) in the `ErrorSchema` at either the root level or the location within the schema described by\n * the `pathOfError`. The path is either a dotted string (with optional bracketed array\n * indexes, e.g. `'a.b[0]'`) or a list of path segments; keys containing dots require the list form.\n *\n * @param [pathOfError] - The optional path into the `ErrorSchema` at which to clear the error(s)\n * @returns - The `ErrorSchemaBuilder` object for chaining purposes\n */\n clearErrors(pathOfError?: PathType) {\n const errorBlock: ErrorSchema = this.getOrCreateErrorBlock(pathOfError);\n errorBlock[ERRORS_KEY] = [];\n return this;\n }\n}\n","import deepEquals from './deepEquals.ts';\nimport isPlainObject from './isPlainObject.ts';\nimport { getByPath } from './pathUtils.ts';\n\n/** Returns the paths of the changed descendants of `a` relative to `b`, relative to the node itself. An empty list\n * means the difference could not be narrowed any further, so the caller should report its own key instead.\n *\n * @param a - The first value, representing the original data to compare\n * @param b - The second value, representing the updated data to compare\n * @returns - An array of dotted paths, relative to `a`\n */\nfunction getChangedDescendants(a: unknown, b: unknown): string[] {\n if (isPlainObject(a) && isPlainObject(b)) {\n return getChangedFields(a, b, true);\n }\n // Arrays of a different length shift their items around, so nothing below them can be matched up by index.\n if (Array.isArray(a) && Array.isArray(b) && a.length === b.length) {\n return a.flatMap((value, index) => {\n if (deepEquals(value, b[index])) {\n return [];\n }\n const descendants = getChangedDescendants(value, b[index]);\n return descendants.length ? descendants.map((path) => `${index}.${path}`) : [String(index)];\n });\n }\n return [];\n}\n\n/**\n * Compares two objects and returns the names of the fields that have changed.\n * This function iterates over each field of object `a`, using `deepEquals` to compare the field value\n * with the corresponding field value in object `b`. If the values are different, the field name will\n * be included in the returned array.\n *\n * @param a - The first object, representing the original data to compare.\n * @param b - The second object, representing the updated data to compare.\n * @param [deep=false] - Optional flag that, when true, descends into nested objects and same-length arrays and returns\n * the dotted path of the deepest field that changed rather than the name of the top-level field holding it.\n * @returns - An array of field names that have changed.\n *\n * @example\n * const a = { name: 'John', age: 30 };\n * const b = { name: 'John', age: 31 };\n * const changedFields = getChangedFields(a, b);\n * console.log(changedFields); // Output: ['age']\n *\n * @example\n * const a = { items: [{ qux: '', corge: '' }] };\n * const b = { items: [{ qux: 'a', corge: '' }] };\n * console.log(getChangedFields(a, b)); // Output: ['items']\n * console.log(getChangedFields(a, b, true)); // Output: ['items.0.qux']\n */\nexport default function getChangedFields(a: unknown, b: unknown, deep = false): string[] {\n if (a === b) {\n return [];\n }\n // If only one of them is a plainObject all of its fields changed; if neither is, nothing did\n if (!isPlainObject(a)) {\n return isPlainObject(b) ? Object.keys(b) : [];\n }\n if (!isPlainObject(b)) {\n return Object.keys(a);\n }\n const aKeys = Object.keys(a);\n const aKeySet = new Set(aKeys);\n const unequalFields = aKeys\n .filter((key) => !deepEquals(a[key], getByPath(b, key)))\n .flatMap((key) => {\n if (!deep) {\n return [key];\n }\n // A key holding a `.` or a `[` is descended into like any other. The path it produces cannot be told apart from\n // a path through nested keys, but neither can the entry an `ErrorSchema` keeps for it, since `toErrorSchema()`\n // spells such a name out as a path in the same way, so the two agree on where the field lives.\n const descendants = getChangedDescendants(a[key], getByPath(b, key));\n return descendants.length ? descendants.map((path) => `${key}.${path}`) : [key];\n });\n const diffFields = Object.keys(b).filter((key) => !aKeySet.has(key));\n return [...unequalFields, ...diffFields];\n}\n","import type { DateObject } from './types.ts';\n\n/** Available options for re-ordering date input element */\nexport type DateElementFormat = 'DMY' | 'MDY' | 'YMD';\n\n/** Type describing format of DateElement prop */\nexport interface DateElementProp {\n type: string;\n range: [number, number];\n value: number | undefined;\n}\n\n/** Given date & time information with optional yearRange & format, returns props for DateElement\n *\n * @param date - Object containing date with optional time information\n * @param time - Determines whether to include time or not\n * @param [yearRange=[1900, new Date().getFullYear() + 2]] - Controls the list of years to be displayed\n * @param [format='YMD'] - Controls the order in which day, month and year input element will be displayed\n * @returns Array of props for DateElement\n */\n\nexport default function getDateElementProps(\n date: DateObject,\n time: boolean,\n yearRange: [number, number] = [1900, new Date().getFullYear() + 2],\n format: DateElementFormat = 'YMD',\n) {\n const { day, month, year, hour, minute, second } = date;\n\n const dayObj: DateElementProp = { type: 'day', range: [1, 31], value: day };\n const monthObj: DateElementProp = { type: 'month', range: [1, 12], value: month };\n const yearObj: DateElementProp = { type: 'year', range: yearRange, value: year };\n\n const dateElementProp: DateElementProp[] = [];\n switch (format) {\n case 'MDY':\n dateElementProp.push(monthObj, dayObj, yearObj);\n break;\n case 'DMY':\n dateElementProp.push(dayObj, monthObj, yearObj);\n break;\n case 'YMD':\n default:\n dateElementProp.push(yearObj, monthObj, dayObj);\n }\n\n if (time) {\n dateElementProp.push(\n { type: 'hour', range: [0, 23], value: hour },\n { type: 'minute', range: [0, 59], value: minute },\n { type: 'second', range: [0, 59], value: second },\n );\n }\n\n return dateElementProp;\n}\n","import type { RangeSpecType, RJSFSchema, StrictRJSFSchema } from './types.ts';\n\n/** Extracts the range spec information `{ step?: number, min?: number, max?: number }` that can be spread onto an HTML\n * input from the range analog in the schema `{ multipleOf?: number, minimum?: number, maximum?: number }`.\n *\n * @param schema - The schema from which to extract the range spec\n * @returns - A range specification from the schema\n */\nexport default function rangeSpec<S extends StrictRJSFSchema = RJSFSchema>(schema: S) {\n const spec: RangeSpecType = {};\n if (schema.multipleOf) {\n spec.step = schema.multipleOf;\n }\n if (schema.minimum || schema.minimum === 0) {\n spec.min = schema.minimum;\n }\n if (schema.maximum || schema.maximum === 0) {\n spec.max = schema.maximum;\n }\n return spec;\n}\n","import rangeSpec from './rangeSpec.ts';\nimport type { FormContextType, InputPropsType, RJSFSchema, StrictRJSFSchema, UIOptionsType } from './types.ts';\n\n/** Using the `schema`, `defaultType` and `options`, extract out the props for the <input> element that make sense.\n *\n * @param schema - The schema for the field provided by the widget\n * @param [defaultType] - The default type, if any, for the field provided by the widget\n * @param [options={}] - The UI Options for the field provided by the widget\n * @param [autoDefaultStepAny=true] - Determines whether to auto-default step=any when the type is number and no step\n * @returns - The extracted `InputPropsType` object\n */\nexport default function getInputProps<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n schema: RJSFSchema,\n defaultType?: string,\n options: UIOptionsType<T, S, F> = {},\n autoDefaultStepAny = true,\n): InputPropsType {\n const inputProps: InputPropsType = {\n type: defaultType || 'text',\n ...rangeSpec(schema),\n };\n\n // If options.inputType is set use that as the input type\n if (options.inputType) {\n inputProps.type = options.inputType;\n } else if (!defaultType) {\n // If the schema is of type number or integer, set the input type to number\n if (schema.type === 'number') {\n inputProps.type = 'number';\n // Only add step if one isn't already defined and we are auto-defaulting the \"any\" step\n if (autoDefaultStepAny && inputProps.step === undefined) {\n // Setting step to 'any' fixes a bug in Safari where decimals are not\n // allowed in number inputs\n inputProps.step = 'any';\n }\n } else if (schema.type === 'integer') {\n inputProps.type = 'number';\n // Only add step if one isn't already defined\n if (inputProps.step === undefined) {\n // Since this is integer, you always want to step up or down in multiples of 1\n inputProps.step = 1;\n }\n }\n }\n\n // For date/time input types, propagate formatMinimum/formatMaximum to min/max\n if (['date', 'datetime-local', 'time', 'week', 'month'].includes(inputProps.type)) {\n if (schema.formatMinimum !== undefined) {\n inputProps.min = schema.formatMinimum as string;\n }\n if (schema.formatMaximum !== undefined) {\n inputProps.max = schema.formatMaximum as string;\n }\n }\n\n if (options.autocomplete) {\n inputProps.autoComplete = options.autocomplete;\n }\n\n if (options.autocapitalize) {\n inputProps.autoCapitalize = options.autocapitalize;\n }\n\n if (options.accept) {\n inputProps.accept = options.accept as string;\n }\n\n return inputProps;\n}\n","import type { OptionValueFormat } from './types.ts';\n\n/** Resolves the effective `optionValueFormat` for enum-backed widgets.\n *\n * Provides a single source of truth for the default DOM encoding format\n * (`'indexed'`) used by `SelectWidget`, `RadioWidget`, and `CheckboxesWidget`.\n * Widgets should call this helper once and pass the result to\n * `enumOptionValueEncoder`, `enumOptionValueDecoder`, and `enumOptionSelectedValue`\n * rather than reading `options.optionValueFormat` directly.\n *\n * @param options - The widget options (typically from the `options` prop, already\n * resolved from `ui:options` and `ui:globalOptions`)\n * @returns The resolved `OptionValueFormat`, defaulting to `'indexed'` when not set\n */\nexport default function getOptionValueFormat(options?: { optionValueFormat?: OptionValueFormat }): OptionValueFormat {\n return options?.optionValueFormat ?? 'indexed';\n}\n","import { SUBMIT_BTN_OPTIONS_KEY } from './constants.ts';\nimport getUiOptions from './getUiOptions.ts';\nimport type { FormContextType, RJSFSchema, StrictRJSFSchema, UiSchema, UISchemaSubmitButtonOptions } from './types.ts';\n\n/** The default submit button options, exported for testing purposes\n */\nexport const DEFAULT_OPTIONS: UISchemaSubmitButtonOptions = {\n props: {\n disabled: false,\n },\n submitText: 'Submit',\n norender: false,\n};\n\n/** Extracts any `ui:submitButtonOptions` from the `uiSchema` and merges them onto the `DEFAULT_OPTIONS`\n *\n * @param [uiSchema={}] - the UI Schema from which to extract submit button props\n * @returns - The merging of the `DEFAULT_OPTIONS` with any custom ones\n */\nexport default function getSubmitButtonOptions<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(uiSchema: UiSchema<T, S, F> = {}): UISchemaSubmitButtonOptions {\n const uiOptions = getUiOptions<T, S, F>(uiSchema);\n if (uiOptions?.[SUBMIT_BTN_OPTIONS_KEY]) {\n const options = uiOptions[SUBMIT_BTN_OPTIONS_KEY];\n return { ...DEFAULT_OPTIONS, ...options };\n }\n\n return DEFAULT_OPTIONS;\n}\n","import type { FormContextType, TemplatesType, Registry, UIOptionsType, StrictRJSFSchema, RJSFSchema } from './types.ts';\n\n/** Returns the template with the given `name` from either the `uiSchema` if it is defined or from the `registry`\n * otherwise. NOTE, since `ButtonTemplates` are not overridden in `uiSchema` only those in the `registry` are returned.\n *\n * @param name - The name of the template to fetch, restricted to the keys of `TemplatesType`\n * @param registry - The `Registry` from which to read the template\n * @param [uiOptions={}] - The `UIOptionsType` from which to read an alternate template\n * @returns - The template from either the `uiSchema` or `registry` for the `name`\n */\nexport default function getTemplate<\n Name extends keyof TemplatesType<T, S, F>,\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(name: Name, registry: Registry<T, S, F>, uiOptions: UIOptionsType<T, S, F> = {}): TemplatesType<T, S, F>[Name] {\n const { templates } = registry;\n if (name === 'ButtonTemplates') {\n return templates[name];\n }\n // Allow templates to be customized per-field by using string keys from the registry\n if (\n Object.hasOwn(uiOptions, name) &&\n typeof uiOptions[name] === 'string' &&\n Object.hasOwn(templates, uiOptions[name] as string)\n ) {\n const key = uiOptions[name];\n // Evaluating templates[key] results in TS2590: Expression produces a union type that is too complex to represent\n // To avoid that, we cast templates to `any` before accessing the key field\n return (templates as any)[key];\n }\n return (\n // Evaluating uiOptions[name] results in TS2590: Expression produces a union type that is too complex to represent\n // To avoid that, we cast uiOptions to `any` before accessing the name field\n ((uiOptions as any)[name] as TemplatesType<T, S, F>[Name]) || templates[name]\n );\n}\n","import { getByPath } from './pathUtils.ts';\nimport type { TestIdShape } from './types.ts';\n\nlet testIdCounter = 0;\n\n/** Returns an object of test IDs that can only be used in test mode. If the function is called in a test environment\n * (`NODE_ENV === 'test'`, this is set by vitest) then a Proxy object will be returned. If a key within the returned\n * object is accessed, if the value already exists the object will return that value, otherwise it will create that key\n * with a generated `uuid` value and return the generated ID. If it is called outside of a test environment, the\n * function will return an empty object, therefore returning `undefined` for any property within the object and\n * excluding the prop from the rendered output of the component in which it is used.\n * This implementation was adapted from the following blog post: https://www.matthewsessions.com/blog/react-test-id/\n * To use this helper, you will want to generate a separate object for each component to avoid potential overlapping of\n * ID names. You will also want to export the object for use in tests, because the keys will be generated in the\n * component file, and used in the test file. Within the component file, add:\n * `export const TEST_IDS = getTestIds();`\n * Then pass `TEST_IDS.examplePropertyName` as the value of the test ID attribute of the intended component. This will\n * allow you to use `TEST_IDS.examplePropertyName` within your tests, while keeping the test IDs out of your rendered\n * output.\n */\nexport default function getTestIds(): TestIdShape {\n // For some reason, even though process.env contains the value of `test` for NODE_ENV, accessing it directly returns\n // 'development'. Using `getByPath()` does, in fact, return test so sticking with it.\n // Use globalThis to access process without requiring @types/node (TS6 compatibility).\n if (getByPath(globalThis, ['process', 'env', 'NODE_ENV']) !== 'test') {\n return {};\n }\n\n const ids = new Map();\n return new Proxy(\n {},\n {\n get(_obj, prop) {\n if (!ids.has(prop)) {\n testIdCounter += 1;\n ids.set(prop, `test-id-${testIdCounter}`);\n }\n return ids.get(prop);\n },\n },\n );\n}\n","import { createElement } from 'react';\nimport ReactIs from 'react-is';\n\nimport getSchemaType from './getSchemaType.ts';\nimport type { FormContextType, RJSFSchema, Widget, RegistryWidgetsType, StrictRJSFSchema } from './types.ts';\n\n/** The map of schema types to widget type to widget name\n */\nconst widgetMap: Record<string, Record<string, string>> = {\n boolean: {\n checkbox: 'CheckboxWidget',\n radio: 'RadioWidget',\n select: 'SelectWidget',\n hidden: 'HiddenWidget',\n },\n string: {\n text: 'TextWidget',\n password: 'PasswordWidget',\n email: 'EmailWidget',\n hostname: 'TextWidget',\n ipv4: 'TextWidget',\n ipv6: 'TextWidget',\n uri: 'URLWidget',\n 'data-url': 'FileWidget',\n radio: 'RadioWidget',\n select: 'SelectWidget',\n textarea: 'TextareaWidget',\n hidden: 'HiddenWidget',\n date: 'DateWidget',\n datetime: 'DateTimeWidget',\n 'date-time': 'DateTimeWidget',\n 'alt-date': 'AltDateWidget',\n 'alt-datetime': 'AltDateTimeWidget',\n time: 'TimeWidget',\n color: 'ColorWidget',\n file: 'FileWidget',\n },\n number: {\n text: 'TextWidget',\n select: 'SelectWidget',\n updown: 'UpDownWidget',\n range: 'RangeWidget',\n radio: 'RadioWidget',\n hidden: 'HiddenWidget',\n },\n integer: {\n text: 'TextWidget',\n select: 'SelectWidget',\n updown: 'UpDownWidget',\n range: 'RangeWidget',\n radio: 'RadioWidget',\n hidden: 'HiddenWidget',\n },\n array: {\n select: 'SelectWidget',\n checkboxes: 'CheckboxesWidget',\n files: 'FileWidget',\n hidden: 'HiddenWidget',\n },\n};\n\n/** Wraps the given widget with stateless functional component that will merge any `defaultProps.options` with the\n * `options` that are provided in the props. It will add the wrapper component as a `MergedWidget` property onto the\n * `Widget` so that future attempts to wrap `AWidget` will return the already existing wrapper.\n *\n * @param AWidget - A widget that will be wrapped or one that is already wrapped\n * @returns - The wrapper widget\n */\nfunction mergeWidgetOptions<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n AWidget: Widget<T, S, F>,\n) {\n let { MergedWidget } = AWidget;\n // cache return value as property of widget for proper react reconciliation\n if (!MergedWidget) {\n // oxlint-disable-next-line typescript/no-deprecated\n const defaultOptions = AWidget.defaultProps?.options || {};\n MergedWidget = ({ options, ...props }) => <AWidget options={{ ...defaultOptions, ...options }} {...props} />;\n // The mutation is deliberate: the wrapper is cached on the widget itself for React reconciliation\n // oxlint-disable-next-line no-param-reassign\n AWidget.MergedWidget = MergedWidget;\n }\n return MergedWidget;\n}\n\n/** Given a schema representing a field to render and either the name or actual `Widget` implementation, returns the\n * React component that is used to render the widget. If the `widget` is already a React component, then it is wrapped\n * with a `MergedWidget`. Otherwise an attempt is made to look up the widget inside of the `registeredWidgets` map based\n * on the schema type and `widget` name. If no widget component can be found an `Error` is thrown.\n *\n * @param schema - The schema for the field\n * @param [widget] - Either the name of the widget OR a `Widget` implementation to use\n * @param [registeredWidgets={}] - A registry of widget name to `Widget` implementation\n * @returns - The `Widget` component to use\n * @throws - An error if there is no `Widget` component that can be returned\n */\nexport default function getWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n schema: RJSFSchema,\n widget?: Widget<T, S, F> | string,\n registeredWidgets: RegistryWidgetsType<T, S, F> = {},\n): Widget<T, S, F> {\n const type = getSchemaType(schema);\n\n if (\n typeof widget === 'function' ||\n (widget && ReactIs.isForwardRef(createElement(widget))) ||\n ReactIs.isMemo(widget)\n ) {\n return mergeWidgetOptions<T, S, F>(widget as Widget<T, S, F>);\n }\n\n if (typeof widget !== 'string') {\n throw new Error(`Unsupported widget definition: ${typeof widget} in schema: ${JSON.stringify(schema)}`);\n }\n\n if (widget in registeredWidgets) {\n const registeredWidget = registeredWidgets[widget];\n return getWidget<T, S, F>(schema, registeredWidget, registeredWidgets);\n }\n\n if (typeof type === 'string') {\n if (!(type in widgetMap)) {\n throw new Error(`No widget for type '${type}' in schema: ${JSON.stringify(schema)}`);\n }\n\n if (widget in widgetMap[type]) {\n const registeredWidget = registeredWidgets[widgetMap[type][widget]];\n return getWidget<T, S, F>(schema, registeredWidget, registeredWidgets);\n }\n }\n\n throw new Error(`No widget '${widget}' for type '${type}' in schema: ${JSON.stringify(schema)}`);\n}\n","import type { RJSFSchema, StrictRJSFSchema } from './types.ts';\n\n/** Hashes a string using the algorithm based on Java's hashing function.\n * JS has no built-in hashing function, so rolling our own\n * based on Java's hashing fn:\n * http://www.java2s.com/example/nodejs-utility-method/string-hash/hashcode-4dc2b.html\n *\n * @param string - The string for which to get the hash\n * @returns - The resulting hash of the string in hex format\n */\nexport function hashString(string: string): string {\n let hash = 0;\n for (let i = 0; i < string.length; i++) {\n const chr = string.charCodeAt(i);\n // oxlint-disable-next-line no-bitwise\n hash = (hash << 5) - hash + chr;\n // oxlint-disable-next-line no-bitwise\n hash &= hash; // Convert to 32bit integer\n }\n return hash.toString(16);\n}\n\n/** Recursively serializes a value to JSON with object keys sorted alphabetically to produce\n * a stable string representation.\n *\n * @param object - The object for which the sorted stringify is desired\n * @returns - The stringified object with keys sorted in a consistent order\n */\nexport function sortedJSONStringify(object: unknown): string {\n function shouldIncludeValue(value: unknown) {\n return value !== undefined && typeof value !== 'function' && typeof value !== 'symbol';\n }\n\n if (Array.isArray(object)) {\n return `[${object.map((x) => (x === undefined ? 'undefined' : sortedJSONStringify(x))).join(',')}]`;\n }\n if (object === null || typeof object !== 'object') {\n return JSON.stringify(typeof object === 'function' ? null : object); // Normalise functions\n }\n\n const record = object as Record<string, unknown>;\n const sortedValues = Object.keys(record)\n .sort()\n .filter((key) => shouldIncludeValue(record[key]))\n .map((key) => `${JSON.stringify(key)}:${sortedJSONStringify(record[key])}`);\n return `{${sortedValues.join(',')}}`;\n}\n\n/** Stringifies an `object` and returns the hash of the resulting string. Sorts object fields\n * in consistent order before stringify to prevent different hash ids for the same object.\n *\n * @param object - The object for which the hash is desired\n * @returns - The string obtained from the hash of the stringified object\n */\nexport function hashObject(object: unknown): string {\n return hashString(sortedJSONStringify(object));\n}\n\n/** Stringifies the schema and returns the hash of the resulting string. Sorts schema fields\n * in consistent order before stringify to prevent different hash ids for the same schema.\n * Symbol-keyed properties (RJSF_REF_KEY, RJSF_REF_CYCLE_KEY, ADDITIONAL_PROPERTY_FLAG) are\n * automatically excluded by JSON.stringify, so no special filtering is needed.\n *\n * @param schema - The schema for which the hash is desired\n * @returns - The string obtained from the hash of the stringified schema\n */\nexport default function hashForSchema<S extends StrictRJSFSchema = RJSFSchema>(schema: S) {\n return hashString(sortedJSONStringify(schema));\n}\n","import getWidget from './getWidget.tsx';\nimport type { FormContextType, RegistryWidgetsType, RJSFSchema, StrictRJSFSchema, Widget } from './types.ts';\n\n/** Detects whether the `widget` exists for the `schema` with the associated `registryWidgets` and returns true if it\n * does, or false if it doesn't.\n *\n * @param schema - The schema for the field\n * @param widget - Either the name of the widget OR a `Widget` implementation to use\n * @param [registeredWidgets={}] - A registry of widget name to `Widget` implementation\n * @returns - True if the widget exists, false otherwise\n */\nexport default function hasWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n schema: RJSFSchema,\n widget: Widget<T, S, F> | string,\n registeredWidgets: RegistryWidgetsType<T, S, F> = {},\n) {\n try {\n getWidget(schema, widget, registeredWidgets);\n return true;\n } catch (e) {\n const err: Error = e as Error;\n if (err.message && (err.message.startsWith('No widget') || err.message.startsWith('Unsupported widget'))) {\n return false;\n }\n throw e;\n }\n}\n","import { ID_KEY } from './constants.ts';\nimport type { FieldPathId } from './types.ts';\n\n/** Generates a consistent `id` pattern for a given `id` and a `suffix`\n *\n * @param id - Either simple string id or an FieldPathId from which to extract it\n * @param suffix - The suffix to append to the id\n */\nfunction idGenerator(id: FieldPathId | string, suffix: string) {\n const theId = typeof id === 'string' ? id : id[ID_KEY];\n return `${theId}__${suffix}`;\n}\n/** Return a consistent `id` for the field description element\n *\n * @param id - Either simple string id or an FieldPathId from which to extract it\n * @returns - The consistent id for the field description element from the given `id`\n */\nexport function descriptionId(id: FieldPathId | string) {\n return idGenerator(id, 'description');\n}\n\n/** Return a consistent `id` for the field error element\n *\n * @param id - Either simple string id or an FieldPathId from which to extract it\n * @returns - The consistent id for the field error element from the given `id`\n */\nexport function errorId(id: FieldPathId | string) {\n return idGenerator(id, 'error');\n}\n\n/** Return a consistent `id` for the field examples element\n *\n * @param id - Either simple string id or an FieldPathId from which to extract it\n * @returns - The consistent id for the field examples element from the given `id`\n */\nexport function examplesId(id: FieldPathId | string) {\n return idGenerator(id, 'examples');\n}\n\n/** Return a consistent `id` for the field help element\n *\n * @param id - Either simple string id or an FieldPathId from which to extract it\n * @returns - The consistent id for the field help element from the given `id`\n */\nexport function helpId(id: FieldPathId | string) {\n return idGenerator(id, 'help');\n}\n\n/** Return a consistent `id` for the field title element\n *\n * @param id - Either simple string id or an FieldPathId from which to extract it\n * @returns - The consistent id for the field title element from the given `id`\n */\nexport function titleId(id: FieldPathId | string) {\n return idGenerator(id, 'title');\n}\n\n/** Return a list of element ids that contain additional information about the field that can be used to as the aria\n * description of the field. This is correctly omitting `titleId` which would be \"labeling\" rather than \"describing\" the\n * element.\n *\n * @param id - Either simple string id or an FieldPathId from which to extract it\n * @param [includeExamples=false] - Optional flag, if true, will add the `examplesId` into the list\n * @returns - The string containing the list of ids for use in an `aria-describedBy` attribute\n */\nexport function ariaDescribedByIds(id: FieldPathId | string, includeExamples = false) {\n const examples = includeExamples ? ` ${examplesId(id)}` : '';\n return `${errorId(id)} ${descriptionId(id)} ${helpId(id)}${examples}`;\n}\n\n/** Return a consistent `id` for the `optionIndex`s of a `Radio` or `Checkboxes` widget\n *\n * @param id - The id of the parent component for the option\n * @param optionIndex - The index of the option for which the id is desired\n * @returns - An id for the option index based on the parent `id`\n */\nexport function optionId(id: string, optionIndex: number) {\n return `${id}-${optionIndex}`;\n}\n\n/** Return a consistent `id` for the `btn` button element\n *\n * @param id - The id of the parent component for the option\n * @param btn - The button type for which to generate the id\n * @returns - The consistent id for the button from the given `id` and `btn` type\n */\nexport function buttonId(id: FieldPathId | string, btn: 'add' | 'copy' | 'moveDown' | 'moveUp' | 'remove') {\n return idGenerator(id, btn);\n}\n\n/** Return a consistent `id` for the optional data controls `element`\n *\n * @param id - The id of the parent component for the option\n * @param element - The element type for which to generate the id\n * @returns - The consistent id for the optional data controls element from the given `id` and `element` type\n */\nexport function optionalControlsId(id: FieldPathId | string, element: 'Add' | 'Msg' | 'Remove') {\n return idGenerator(id, `optional${element}`);\n}\n","/** Determines whether the given `formData` represents valid form data, such as a primitive type, an array, or a\n * non-empty object.\n *\n * @param formData - The data to check\n * @returns - True if `formData` is not undefined, null, a primitive type or an array or an empty object\n */\nexport default function isFormDataAvailable<T = any>(formData?: T): boolean {\n if (formData === undefined || formData === null) {\n return false;\n }\n if (typeof formData !== 'object' || Array.isArray(formData)) {\n return true;\n }\n return Object.keys(formData).length > 0;\n}\n","import { REF_KEY } from './constants.ts';\nimport deepEquals from './deepEquals.ts';\nimport type { FormContextType, Registry, RJSFSchema, StrictRJSFSchema } from './types.ts';\n\n/** Helper to check whether a JSON schema object is the root schema. The schema is a root schema with root `properties`\n * key or a root `$ref` key. If the `schemaToCompare` has a root `oneOf` property, the function will\n * return false. Else if `schemaToCompare` and `rootSchema` are the same object or equal, the function will return\n * `true`. Else if the `rootSchema` has a $ref, it will be resolved using `schemaUtils.resolveSchema` utility. If the\n * resolved schema matches the `schemaToCompare` the function will return `true`. Otherwise, it will return false.\n *\n * @param registry - The `Registry` used to get the `rootSchema` and `schemaUtils`\n * @param schemaToCompare - The JSON schema object to check. If `schemaToCompare` is an root schema, the\n * function will return true.\n * @returns - Flag indicating whether the `schemaToCompare` is the root schema\n */\nexport default function isRootSchema<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n registry: Registry<T, S, F>,\n schemaToCompare: S,\n): boolean {\n const { rootSchema, schemaUtils } = registry;\n if (deepEquals(schemaToCompare, rootSchema)) {\n return true;\n }\n if (REF_KEY in rootSchema) {\n const resolvedSchema = schemaUtils.retrieveSchema(rootSchema);\n return deepEquals(schemaToCompare, resolvedSchema);\n }\n return false;\n}\n","import type { ReactElement } from 'react';\n\n/** Helper function that will return the value to use for a widget `label` based on `hideLabel`. The `fallback` is used\n * as the return value from the function when `hideLabel` is true. Due to the implementation of theme components, it\n * may be necessary to return something other than `undefined` to cause the theme component to not render a label. Some\n * themes require may `false` and others may require an empty string.\n *\n * @param [label] - The label string or component to render when not hidden\n * @param [hideLabel] - Flag, if true, will cause the label to be hidden\n * @param [fallback] - One of 3 values, `undefined` (the default), `false` or an empty string\n * @returns - `fallback` if `hideLabel` is true, otherwise `label`\n */\n\nexport default function labelValue(label?: string, hideLabel?: boolean, fallback?: ''): undefined | string;\nexport default function labelValue(label?: string, hideLabel?: boolean, fallback?: false): undefined | false | string;\nexport default function labelValue(label?: ReactElement, hideLabel?: boolean, fallback?: ''): undefined | ReactElement;\nexport default function labelValue(\n label?: ReactElement,\n hideLabel?: boolean,\n fallback?: false,\n): undefined | false | ReactElement;\nexport default function labelValue(\n label?: string | ReactElement,\n hideLabel?: boolean,\n fallback?: false | '',\n): undefined | false | string | ReactElement {\n return hideLabel ? fallback : label;\n}\n","/** Converts a local Date string into a UTC date string\n *\n * @param dateString - The string representation of a date as accepted by the `Date()` constructor\n * @returns - A UTC date string if `dateString` is truthy, otherwise undefined\n */\nexport default function localToUTC(dateString: string) {\n return dateString ? new Date(dateString).toJSON() : undefined;\n}\n","import enumOptionsIndexForValue from './enumOptionsIndexForValue.ts';\nimport type { EnumOptionsType, RJSFSchema, StrictRJSFSchema } from './types.ts';\n\n/** Logs a warning when a single-select enum widget has a schema default that is not one of its enum options.\n *\n * @param id - The field id used in the warning message\n * @param schema - The schema whose default value is checked\n * @param enumOptions - The enum options available to the widget\n * @param multiple - Whether the widget allows multiple selections\n */\nexport default function logUnsupportedDefaultForEnum<S extends StrictRJSFSchema = RJSFSchema>(\n id: string,\n schema: S,\n enumOptions?: EnumOptionsType<S>[],\n multiple = false,\n) {\n if (\n !multiple &&\n Array.isArray(enumOptions) &&\n schema.default !== undefined &&\n enumOptionsIndexForValue<S>(schema.default, enumOptions, multiple) === undefined\n ) {\n // oxlint-disable-next-line no-console\n console.error(\n `The schema default value \"${schema.default}\" is not one of the values in the enum options for \"${id}\"`,\n );\n }\n}\n","import { FORM_CONTEXT_NAME, LOOKUP_MAP_NAME } from './constants.ts';\nimport { getByPath, hasByPath } from './pathUtils.ts';\nimport type { FormContextType, RJSFSchema, Registry, StrictRJSFSchema } from './types.ts';\n\n/** Given a React JSON Schema Form registry or formContext object, return the value associated with `toLookup`. This\n * might be contained within the lookup map in the formContext. If no such value exists, return the `fallback`\n * value.\n *\n * @param regOrFc - The @rjsf registry or form context in which the lookup will occur\n * @param toLookup - The name of the field in the lookup map in the form context to get the value for\n * @param [fallback] - The fallback value to use if the form context does not contain a value for `toLookup`\n * @returns - The value associated with `toLookup` in the form context or `fallback`\n */\nexport default function lookupFromFormContext<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n R = unknown,\n>(regOrFc: Registry<T, S, F> | Registry<T, S, F>['formContext'], toLookup: string, fallback?: R): R {\n const lookupPath = [LOOKUP_MAP_NAME];\n if (hasByPath(regOrFc, FORM_CONTEXT_NAME)) {\n lookupPath.unshift(FORM_CONTEXT_NAME);\n }\n return getByPath<R>(regOrFc, [...lookupPath, toLookup], fallback);\n}\n","/** A function that does nothing and returns `undefined`, useful as a placeholder for an optional callback or as the\n * implementation of a mocked function.\n */\nexport default function noop(): void {}\n","import type { GenericObjectType } from './types.ts';\n\n/** Given a list of `properties` and an `order` list, returns a list that contains the `properties` ordered correctly.\n * If `order` is not an array, then the untouched `properties` list is returned. Otherwise `properties` is ordered per\n * the `order` list. If `order` contains a '*' then any `properties` that are not mentioned explicity in `order` will be\n * places in the location of the `*`.\n *\n * @param properties - The list of property keys to be ordered\n * @param order - An array of property keys to be ordered first, with an optional '*' property\n * @returns - A list with the `properties` ordered\n * @throws - Error when the properties cannot be ordered correctly\n */\nexport default function orderProperties(properties: string[], order?: string[]): string[] {\n if (!Array.isArray(order)) {\n return properties;\n }\n\n const arrayToHash = (arr: string[]) =>\n arr.reduce((acc: GenericObjectType, curr) => {\n acc[curr] = true;\n return acc;\n }, {});\n const errorPropList = (arr: string[]) =>\n arr.length > 1 ? `properties '${arr.join(\"', '\")}'` : `property '${arr[0]}'`;\n const propertyHash = arrayToHash(properties);\n const orderFiltered = order.filter((prop) => prop === '*' || propertyHash[prop]);\n const orderHash = arrayToHash(orderFiltered);\n\n const rest = properties.filter((prop: string) => !orderHash[prop]);\n const restIndex = orderFiltered.indexOf('*');\n if (restIndex === -1) {\n if (rest.length) {\n throw new Error(`uiSchema order list does not contain ${errorPropList(rest)}`);\n }\n return orderFiltered;\n }\n if (restIndex !== orderFiltered.lastIndexOf('*')) {\n throw new Error('uiSchema order list contains more than one wildcard item');\n }\n\n const complete = [...orderFiltered];\n complete.splice(restIndex, 1, ...rest);\n return complete;\n}\n","import type { DateObject } from './types.ts';\n\n/** Parses the `dateString` into a `DateObject`, including the time information when `includeTime` is true\n *\n * @param dateString - The date string to parse into a DateObject\n * @param [includeTime=true] - Optional flag, if false, will not include the time data into the object\n * @returns - The date string converted to a `DateObject`\n * @throws - Error when the date cannot be parsed from the string\n */\nexport default function parseDateString(dateString?: string, includeTime = true): DateObject {\n if (!dateString) {\n return {\n year: -1,\n month: -1,\n day: -1,\n hour: includeTime ? -1 : 0,\n minute: includeTime ? -1 : 0,\n second: includeTime ? -1 : 0,\n };\n }\n const date = new Date(dateString);\n if (Number.isNaN(date.getTime())) {\n throw new Error(`Unable to parse date ${dateString}`);\n }\n return {\n year: date.getUTCFullYear(),\n month: date.getUTCMonth() + 1, // oh you, javascript.\n day: date.getUTCDate(),\n hour: includeTime ? date.getUTCHours() : 0,\n minute: includeTime ? date.getUTCMinutes() : 0,\n second: includeTime ? date.getUTCSeconds() : 0,\n };\n}\n","import { ANY_OF_KEY, ONE_OF_KEY, REF_KEY, RJSF_REF_KEY } from './constants.ts';\nimport findSchemaDefinition from './findSchemaDefinition.ts';\nimport mergeObjects from './mergeObjects.ts';\nimport type {\n FormContextType,\n GenericObjectType,\n Registry,\n RJSFMarkedSchema,\n RJSFSchema,\n StrictRJSFSchema,\n UiSchema,\n} from './types.ts';\n\n/** Resolves the uiSchema for a given schema, considering `ui:definitions` stored in the registry.\n *\n * Called at runtime for each field. When the schema contains a `$ref`, looks up the corresponding\n * uiSchema definition from `registry.uiSchemaDefinitions` and merges it with local overrides.\n * For schemas with `oneOf`/`anyOf` branches, also populates `uiSchema[keyword][i]` for branches\n * whose `$ref` matches a definition, so `MultiSchemaField` can read dropdown option titles.\n *\n * Resolution order (later sources override earlier):\n * 1. `ui:definitions[$ref]` - base definition from registry\n * 2. `localUiSchema` - local overrides at current path\n *\n * @param schema - The JSON schema (may contain `$ref` or `RJSF_REF_KEY`)\n * @param localUiSchema - The uiSchema at the current path (local overrides)\n * @param registry - The registry containing `uiSchemaDefinitions`\n * @returns - The resolved uiSchema with definitions merged in\n */\nexport default function resolveUiSchema<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(schema: S, localUiSchema: UiSchema<T, S, F> | undefined, registry: Registry<T, S, F>): UiSchema<T, S, F> {\n const ref = ((schema as RJSFMarkedSchema)[RJSF_REF_KEY] ?? schema[REF_KEY]) as string | undefined;\n const definitions = registry.uiSchemaDefinitions;\n const definitionUiSchema = ref && definitions ? definitions[ref] : undefined;\n\n let result: UiSchema<T, S, F>;\n if (!definitionUiSchema) {\n result = localUiSchema || {};\n } else if (!localUiSchema || Object.keys(localUiSchema).length === 0) {\n result = { ...definitionUiSchema };\n } else {\n result = mergeObjects(definitionUiSchema as GenericObjectType, localUiSchema as GenericObjectType) as UiSchema<\n T,\n S,\n F\n >;\n }\n\n // Walk oneOf/anyOf branches to populate uiSchema[keyword][i] so MultiSchemaField\n // can read dropdown option titles at the parent level.\n if (definitions) {\n let resolvedSchema: S = schema;\n if (ref && schema[REF_KEY] && !(schema as RJSFMarkedSchema)[RJSF_REF_KEY]) {\n try {\n resolvedSchema = findSchemaDefinition<S>(ref, registry.rootSchema);\n } catch (e) {\n // oxlint-disable-next-line no-console\n console.warn('could not resolve $ref in resolveUiSchema:\\n', e);\n return result;\n }\n }\n\n for (const keyword of [ONE_OF_KEY, ANY_OF_KEY] as const) {\n const schemaOptions = resolvedSchema[keyword];\n if (Array.isArray(schemaOptions) && schemaOptions.length > 0) {\n const currentUiSchemaArray = (result as GenericObjectType)[keyword];\n const uiSchemaArray: UiSchema<T, S, F>[] = Array.isArray(currentUiSchemaArray) ? [...currentUiSchemaArray] : [];\n\n let hasExpanded = false;\n for (let i = 0; i < schemaOptions.length; i++) {\n const option = schemaOptions[i] as GenericObjectType | undefined;\n const optionRef = ((option as RJSFMarkedSchema)?.[RJSF_REF_KEY] ?? option?.[REF_KEY]) as string | undefined;\n if (optionRef && optionRef in definitions) {\n const optionUiSchema = (uiSchemaArray[i] || {}) as GenericObjectType;\n uiSchemaArray[i] = mergeObjects(definitions[optionRef] as GenericObjectType, optionUiSchema) as UiSchema<\n T,\n S,\n F\n >;\n hasExpanded = true;\n }\n }\n\n if (hasExpanded) {\n (result as GenericObjectType)[keyword] = uiSchemaArray;\n }\n }\n }\n }\n\n return result;\n}\n","import type { RJSFSchema, StrictRJSFSchema } from './types.ts';\n\n/** Check to see if a `schema` specifies that a value must be true. This happens when:\n * - `schema.const` is truthy\n * - `schema.enum` == `[true]`\n * - `schema.anyOf` or `schema.oneOf` has a single value which recursively returns true\n * - `schema.allOf` has at least one value which recursively returns true\n *\n * @param schema - The schema to check\n * @returns - True if the schema specifies a value that must be true, false otherwise\n */\nexport default function schemaRequiresTrueValue<S extends StrictRJSFSchema = RJSFSchema>(schema: S): boolean {\n // Check if const is a truthy value\n if (schema.const) {\n return true;\n }\n\n // Check if an enum has a single value of true\n if (schema.enum?.length === 1 && schema.enum[0] === true) {\n return true;\n }\n\n // If anyOf has a single value, evaluate the subschema\n if (schema.anyOf?.length === 1) {\n return schemaRequiresTrueValue(schema.anyOf[0] as S);\n }\n\n // If oneOf has a single value, evaluate the subschema\n if (schema.oneOf?.length === 1) {\n return schemaRequiresTrueValue(schema.oneOf[0] as S);\n }\n\n // Evaluate each subschema in allOf, to see if one of them requires a true value\n if (schema.allOf) {\n const schemaSome = (subSchema: S['additionalProperties']) => schemaRequiresTrueValue(subSchema as S);\n return schema.allOf.some(schemaSome);\n }\n\n return false;\n}\n","import enumOptionsIsSelected from './enumOptionsIsSelected.ts';\nimport getTemplate from './getTemplate.ts';\nimport getUiOptions from './getUiOptions.ts';\nimport { descriptionId } from './idGenerators.ts';\nimport type { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from './types.ts';\n\nexport type SelectedOptionDescriptionProps<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n> = Pick<WidgetProps<T, S, F>, 'id' | 'multiple' | 'options' | 'registry' | 'uiSchema' | 'value' | 'hideLabel'>;\n\n/** Renders the description associated with the selected oneOf or anyOf option in a single-select widget. */\nexport default function SelectedOptionDescription<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>({ hideLabel, id, multiple, options, registry, uiSchema, value }: SelectedOptionDescriptionProps<T, S, F>) {\n if (multiple || hideLabel) {\n return null;\n }\n\n const { label = true } = getUiOptions<T, S, F>(uiSchema, registry.globalUiOptions);\n if (!label) {\n return null;\n }\n\n const option = options.enumOptions?.find(({ value: enumValue }) => enumOptionsIsSelected(enumValue, value));\n const description = option?.schema?.description;\n if (!description) {\n return null;\n }\n\n const DescriptionFieldTemplate = getTemplate<'DescriptionFieldTemplate', T, S, F>(\n 'DescriptionFieldTemplate',\n registry,\n options,\n );\n return (\n <DescriptionFieldTemplate\n id={descriptionId(id)}\n description={description}\n schema={option.schema!}\n uiSchema={uiSchema}\n registry={registry}\n />\n );\n}\n","/** Implements a shallow equals comparison that uses Object.is() for comparing values.\n * This function compares objects by checking if all keys and their values are equal using Object.is().\n *\n * @param a - The first element to compare\n * @param b - The second element to compare\n * @returns - True if the `a` and `b` are shallow equal, false otherwise\n */\nexport default function shallowEquals(a: any, b: any): boolean {\n // If they're the same reference, they're equal\n if (Object.is(a, b)) {\n return true;\n }\n\n // If either is null or undefined, they're not equal (since we know they're not the same reference)\n if (a == null || b == null) {\n return false;\n }\n\n // If they're not objects, they're not equal (since Object.is already checked)\n if (typeof a !== 'object' || typeof b !== 'object') {\n return false;\n }\n\n const keysA = Object.keys(a);\n const keysB = Object.keys(b);\n\n // Different number of keys means not equal\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n // Check if all keys and values are equal\n for (let i = 0; i < keysA.length; i += 1) {\n const key = keysA[i];\n if (!Object.hasOwn(b, key) || !Object.is(a[key], b[key])) {\n return false;\n }\n }\n\n return true;\n}\n","import type React from 'react';\n\nimport deepEquals from './deepEquals.ts';\nimport shallowEquals from './shallowEquals.ts';\n\n/** The supported component update strategies */\nexport type ComponentUpdateStrategy = 'customDeep' | 'shallow' | 'always';\n\n/** Determines whether the given `component` should be rerendered by comparing its current set of props and state\n * against the next set. The comparison strategy can be controlled via the `updateStrategy` parameter.\n *\n * @param component - A React component being checked\n * @param nextProps - The next set of props against which to check\n * @param nextState - The next set of state against which to check\n * @param updateStrategy - The strategy to use for comparison:\n * - 'customDeep': Uses RJSF's custom deep equality checks (default)\n * - 'shallow': Uses shallow comparison of props and state\n * - 'always': Always returns true (React's default behavior)\n * @returns - True if the component should be re-rendered, false otherwise\n */\nexport default function shouldRender(\n component: React.Component,\n nextProps: any,\n nextState: any,\n updateStrategy: ComponentUpdateStrategy = 'customDeep',\n) {\n if (updateStrategy === 'always') {\n // Use React's default behavior: always update if state or props change (no shouldComponentUpdate optimization)\n return true;\n }\n\n if (updateStrategy === 'shallow') {\n // Use shallow comparison for props and state\n const { props, state } = component;\n return !shallowEquals(props, nextProps) || !shallowEquals(state, nextState);\n }\n\n // Use custom deep equality checks (default 'customDeep' strategy)\n const { props, state } = component;\n return !deepEquals(props, nextProps) || !deepEquals(state, nextState);\n}\n","import { ANY_OF_KEY, ONE_OF_KEY } from './constants.ts';\nimport getSchemaType from './getSchemaType.ts';\nimport getUiOptions from './getUiOptions.ts';\nimport isObject from './isObject.ts';\nimport isRootSchema from './isRootSchema.ts';\nimport type { FormContextType, Registry, RJSFSchema, StrictRJSFSchema, UiSchema } from './types.ts';\n\n/** Returns the unique list of schema types for all of the options in a anyOf/oneOf\n *\n * @param schemas - The list of schemas representing the XxxOf options\n * @returns - All of the unique types contained within the oneOf list\n */\nexport function getSchemaTypesForXxxOf<S extends StrictRJSFSchema = RJSFSchema>(schemas: S[]): string | string[] {\n const allTypes: string[] = [\n ...new Set(\n schemas\n .map((s) => (isObject(s) ? getSchemaType(s) : undefined))\n .flat()\n .filter((t) => t !== undefined),\n ),\n ];\n return allTypes.length === 1 ? allTypes[0] : allTypes;\n}\n\n/** Determines whether the field information from the combination of `schema` and `required` along with the\n * `enableOptionalDataFieldForType` settings from the global UI options in the `registry` all indicate that this field\n * should be rendered with the Optional Data Controls UI.\n *\n * @param registry - The `registry` object\n * @param schema - The schema for the field\n * @param required - Flag indicating whether the field is required\n * @param [uiSchema] - The uiSchema for the field\n * @return - True if the field should be rendered with the optional field UI, otherwise false\n */\nexport default function shouldRenderOptionalField<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(registry: Registry<T, S, F>, schema: S, required: boolean, uiSchema?: UiSchema<T, S, F>): boolean {\n const { enableOptionalDataFieldForType = [] } = getUiOptions<T, S, F>(uiSchema, registry.globalUiOptions);\n let schemaType: ReturnType<typeof getSchemaType<S>>;\n if (ANY_OF_KEY in schema && Array.isArray(schema[ANY_OF_KEY])) {\n schemaType = getSchemaTypesForXxxOf<S>(schema[ANY_OF_KEY] as S[]);\n } else if (ONE_OF_KEY in schema && Array.isArray(schema[ONE_OF_KEY])) {\n schemaType = getSchemaTypesForXxxOf<S>(schema[ONE_OF_KEY] as S[]);\n } else {\n schemaType = getSchemaType<S>(schema);\n }\n return (\n !isRootSchema<T, S, F>(registry, schema) &&\n !required &&\n !!schemaType &&\n !Array.isArray(schemaType) &&\n !!enableOptionalDataFieldForType.find((val) => val === schemaType)\n );\n}\n","import type { DateObject } from './types.ts';\n\n/** Returns a UTC date string for the given `dateObject`. If `time` is false, then the time portion of the string is\n * removed.\n *\n * @param dateObject - The `DateObject` to convert to a date string\n * @param [time=true] - Optional flag used to remove the time portion of the date string if false\n * @returns - The UTC date string\n */\nexport default function toDateString(dateObject: DateObject, time = true) {\n const { year, month, day, hour = 0, minute = 0, second = 0 } = dateObject;\n const utcTime = Date.UTC(year, month - 1, day, hour, minute, second);\n const datetime = new Date(utcTime).toJSON();\n return time ? datetime : datetime.slice(0, 10);\n}\n","import { ERRORS_KEY } from './constants.ts';\nimport isPlainObject from './isPlainObject.ts';\nimport type { ErrorSchema, RJSFValidationError } from './types.ts';\n\n/** Converts an `errorSchema` into a list of `RJSFValidationErrors`\n *\n * @param errorSchema - The `ErrorSchema` instance to convert\n * @param [fieldPath=[]] - The current field path, defaults to [] if not specified\n * @returns - The list of `RJSFValidationErrors` extracted from the `errorSchema`\n */\nexport default function toErrorList<T = any>(\n errorSchema?: ErrorSchema<T>,\n fieldPath: string[] = [],\n): RJSFValidationError[] {\n return errorSchema ? errorsFrom(errorSchema, fieldPath) : [];\n}\n\n/** Does the actual conversion, working on the plain-object shape of an `ErrorSchema` so that the recursive call for a\n * nested error schema does not need an assertion back to `ErrorSchema`.\n *\n * @param errorSchema - The error schema, viewed as the plain object it is at runtime\n * @param fieldPath - The current field path\n * @returns - The list of `RJSFValidationErrors` extracted from the `errorSchema`\n */\nfunction errorsFrom(errorSchema: Record<string, unknown>, fieldPath: string[]): RJSFValidationError[] {\n const errors = errorSchema[ERRORS_KEY];\n const property = `.${fieldPath.join('.')}`;\n const errorList: RJSFValidationError[] = Array.isArray(errors)\n ? errors.map((message: string) => ({ property, message, stack: `${property} ${message}` }))\n : [];\n return Object.keys(errorSchema).reduce((currentList, key) => {\n const childSchema = errorSchema[key];\n if (key !== ERRORS_KEY && isPlainObject(childSchema)) {\n return currentList.concat(errorsFrom(childSchema, [...fieldPath, key]));\n }\n return currentList;\n }, errorList);\n}\n","import { ID_KEY } from './constants.ts';\nimport type { FieldPathId, FieldPathList, GlobalFormOptions } from './types.ts';\n\n/** Constructs the `FieldPathId` for `fieldPath`. If `parentPathId` is provided, the `fieldPath` is appended to the end\n * of the parent path. Then the `ID_KEY` of the resulting `FieldPathId` is constructed from the `idPrefix` and\n * `idSeparator` contained within the `globalFormOptions`. If `fieldPath` is passed as an empty string, it will simply\n * generate the path from the `parentPath` (if provided) and the `idPrefix` and `idSeparator`. If a `nameGenerator`\n * is provided in `globalFormOptions`, it will also generate the HTML `name` attribute.\n *\n * @param fieldPath - The property name or array index of the current field element\n * @param globalFormOptions - The `GlobalFormOptions` used to get the `idPrefix` and `idSeparator`\n * @param [parentPath] - The optional `FieldPathId` or `FieldPathList` of the parent element for this field element\n * @param [isMultiValue] - Optional flag indicating this field accepts multiple values\n * @returns - The `FieldPathId` for the given `fieldPath` and the optional `parentPathId`\n */\nexport default function toFieldPathId(\n fieldPath: string | number,\n globalFormOptions: GlobalFormOptions,\n parentPath?: FieldPathId | FieldPathList,\n isMultiValue?: boolean,\n): FieldPathId {\n const basePath = Array.isArray(parentPath) ? parentPath : parentPath?.path;\n const childPath = fieldPath === '' ? [] : [fieldPath];\n const path = basePath ? basePath.concat(...childPath) : childPath;\n const id = [globalFormOptions.idPrefix, ...path].join(globalFormOptions.idSeparator);\n\n // Generate name attribute if nameGenerator is provided\n let name: string | undefined;\n if (globalFormOptions.nameGenerator && path.length > 0) {\n name = globalFormOptions.nameGenerator(path, globalFormOptions.idPrefix, isMultiValue);\n }\n\n return { path, [ID_KEY]: id, ...(name !== undefined && { name }) };\n}\n","'use client';\n\nimport type { MouseEvent } from 'react';\nimport { useCallback, useEffect, useMemo, useState } from 'react';\n\nimport dateRangeOptions from './dateRangeOptions.ts';\nimport type { DateElementFormat, DateElementProp } from './getDateElementProps.ts';\nimport getDateElementProps from './getDateElementProps.ts';\nimport { ariaDescribedByIds } from './idGenerators.ts';\nimport parseDateString from './parseDateString.ts';\nimport toDateString from './toDateString.ts';\nimport type { DateObject, FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from './types.ts';\n\n/** Function that checks to see if a `DateObject` is ready for the onChange callback to be triggered\n *\n * @param state - The current `DateObject`\n * @returns - True if the `state` is ready to trigger an onChange\n */\nfunction readyForChange(state: DateObject) {\n return Object.values(state).every((value) => value !== -1);\n}\n\n/** The Props for the `DateElement` component */\nexport type DateElementProps<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any> = Pick<\n WidgetProps<T, S, F>,\n 'value' | 'name' | 'disabled' | 'readonly' | 'autofocus' | 'registry' | 'onBlur' | 'onFocus' | 'className'\n> & {\n /** The root id of the field */\n rootId: string;\n /** The selector function for a specific prop within the `DateObject`, for a value */\n select: (property: keyof DateObject, value: any) => void;\n /** The type of the date element */\n type: DateElementProp['type'];\n /** The range for the date element */\n range: DateElementProp['range'];\n};\n\n/** The `DateElement` component renders one of the 6 date element selectors for an `AltDateWidget`, using the `select`\n * widget from the registry.\n *\n * @param props - The `DateElementProps` for the date element\n */\nexport function DateElement<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n props: DateElementProps<T, S, F>,\n) {\n const {\n className = 'form-control',\n type,\n range,\n value,\n select,\n rootId,\n name,\n disabled,\n readonly,\n autofocus,\n registry,\n onBlur,\n onFocus,\n } = props;\n const id = `${rootId}_${type}`;\n const { SelectWidget } = registry.widgets;\n const onChange = useCallback((newValue: any) => select(type as keyof DateObject, newValue), [select, type]);\n return (\n <SelectWidget\n schema={{ type: 'integer' } as S}\n id={id}\n name={name}\n className={className}\n options={{ enumOptions: dateRangeOptions<S>(range[0], range[1]) }}\n placeholder={type}\n value={value}\n disabled={disabled}\n readonly={readonly}\n autofocus={autofocus}\n onChange={onChange}\n onBlur={onBlur}\n onFocus={onFocus}\n registry={registry}\n label=''\n aria-describedby={ariaDescribedByIds(rootId)}\n />\n );\n}\n\n/** The result of a call to the `useAltDateWidgetProps()` hook */\nexport interface UseAltDateWidgetResult {\n /** The list of `DateElementProp` data to render for the `AltDateWidget` */\n elements: DateElementProp[];\n /** The callback that handles the changing of DateElement components */\n handleChange: (property: keyof DateObject, value?: string) => void;\n /** The callback that will clear the `AltDateWidget` when a button is clicked */\n handleClear: (event: MouseEvent) => void;\n /** The callback that will set the `AltDateWidget` to NOW when a button is clicked */\n handleSetNow: (event: MouseEvent) => void;\n}\n\n/** Hook which encapsulates the logic needed to render an `AltDateWidget` with optional `time` elements. It contains\n * the `state` of the current date(/time) selections in the widget. It returns a `UseAltDateWidgetResult` object\n * that contains the `elements: DateElementProp[]` and three callbacks needed to change one of the rendered `elements`,\n * and to handle the clicking of the `clear` and `setNow` buttons.\n *\n * @param props - The `WidgetProps` for the `AltDateWidget`\n */\nexport default function useAltDateWidgetProps<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: WidgetProps<T, S, F>): UseAltDateWidgetResult {\n const { time = false, disabled = false, readonly = false, options, onChange, value } = props;\n const [state, setState] = useState(parseDateString(value, time));\n\n useEffect(() => {\n setState(parseDateString(value, time));\n }, [time, value]);\n\n const handleChange = useCallback(\n (property: keyof DateObject, newValue?: string) => {\n const nextState = {\n ...state,\n [property]: typeof newValue === 'undefined' ? -1 : newValue,\n };\n\n if (readyForChange(nextState)) {\n onChange(toDateString(nextState, time));\n } else {\n setState(nextState);\n }\n },\n [state, onChange, time],\n );\n\n const handleClear = useCallback(\n (event: MouseEvent) => {\n event.preventDefault();\n if (disabled || readonly) {\n return;\n }\n onChange(undefined);\n },\n [disabled, readonly, onChange],\n );\n\n const handleSetNow = useCallback(\n (event: MouseEvent) => {\n event.preventDefault();\n if (disabled || readonly) {\n return;\n }\n const nextState = parseDateString(new Date().toJSON(), time);\n onChange(toDateString(nextState, time));\n },\n [disabled, readonly, time, onChange],\n );\n\n const elements = useMemo(\n () =>\n getDateElementProps(\n state,\n time,\n options.yearsRange as [number, number] | undefined,\n options.format as DateElementFormat | undefined,\n ),\n [state, time, options.yearsRange, options.format],\n );\n return { elements, handleChange, handleClear, handleSetNow };\n}\n","'use client';\n\nimport { useRef } from 'react';\n\nimport deepEquals from './deepEquals.ts';\n\n/** Hook that stores and returns a `T` value. If `newValue` is the same as the stored one, then the stored one is\n * returned to avoid having a component rerender due it being a different object. Otherwise, the `newValue` is stored\n * and returned.\n *\n * @param newValue - The potential new `T` value\n * @returns - The latest stored `T` value\n */\nexport default function useDeepCompareMemo<T = unknown>(newValue: T): T {\n const valueRef = useRef<T>(newValue);\n if (!deepEquals(newValue, valueRef.current)) {\n valueRef.current = newValue;\n }\n return valueRef.current;\n}\n","'use client';\n\nimport { useCallback, useMemo } from 'react';\n\nimport dataURItoBlob from './dataURItoBlob.ts';\n\n/** The information about files used by a FileWidget */\nexport interface FileInfoType {\n /** The url of the data containing the file */\n dataURL?: string | null;\n /** The name of the file */\n name: string;\n /** The size of the file */\n size: number;\n /** The type of the file */\n type: string;\n}\n\nexport interface UseFileWidgetPropsResult {\n /** The list of FileInfoType contained within the FileWidget */\n filesInfo: FileInfoType[];\n /** The callback handler to pass to the onChange of the input */\n handleChange: (files: FileList) => void | Promise<void>;\n /** The callback handler to pass in order to delete a file */\n handleRemove: (index: number) => void;\n}\n\n/** Updated the given `dataUrl` to add the `name` to it\n *\n * @param dataURL - The url description string\n * @param name - The name of the file to add to the dataUrl\n * @returns - The `dataUrl` updated to include the name\n */\nfunction addNameToDataURL(dataURL: string, name: string) {\n return dataURL.replace(';base64', `;name=${encodeURIComponent(name)};base64`);\n}\n\n/** Returns a promise that will read the file from the browser and return it as the result of the promise.\n *\n * @param file - The `File` information to read\n * @returns - A promise that resolves to the read file.\n */\nasync function processFile(file: File): Promise<FileInfoType> {\n const { name, size, type } = file;\n return new Promise((resolve, reject) => {\n const reader = new window.FileReader();\n reader.onerror = reject;\n reader.onload = (event) => {\n if (typeof event.target?.result === 'string') {\n resolve({\n dataURL: addNameToDataURL(event.target.result, name),\n name,\n size,\n type,\n });\n } else {\n resolve({\n dataURL: null,\n name,\n size,\n type,\n });\n }\n };\n reader.readAsDataURL(file);\n });\n}\n\n/** Reads a list of files from the browser, returning the results of the promises of each individual file read.\n *\n * @param files - The list of files to read\n * @returns - The list of read files\n */\nasync function processFiles(files: FileList) {\n return Promise.all(Array.from(files).map(processFile));\n}\n\n/** Extracts the file information from the data URLs\n *\n * @param dataURLs - The information about the files\n * @returns - The list of `FileInfoType` objects extracted from the data urls\n */\nfunction extractFileInfo(dataURLs: string[]): FileInfoType[] {\n return dataURLs.reduce<FileInfoType[]>((acc, dataURL) => {\n if (!dataURL) {\n return acc;\n }\n try {\n const { blob, name } = dataURItoBlob(dataURL);\n return [\n ...acc,\n {\n dataURL,\n name,\n size: blob.size,\n type: blob.type,\n },\n ];\n } catch {\n // Invalid dataURI, so just ignore it.\n return acc;\n }\n }, []);\n}\n\n/** Hook which encapsulates the logic needed to read and convert a `value` of `File` or `File[]` into the\n * `filesInfo: FileInfoType[]` and the two callback implementations needed to change the list or to remove a\n * `File` from the list. To be used by theme specific `FileWidget` implementations.\n *\n * @param value - The current value of the `FileWidget`\n * @param onChange - The onChange handler for the `FileWidget`\n * @param [multiple=false] - Flag indicating whether the control supports multiple selections\n * @returns - The `UseFileWidgetPropsResult` to be used within a `FileWidget` implementation\n */\nexport default function useFileWidgetProps(\n value: string | string[] | undefined | null,\n onChange: (value?: string | null | (string | null)[]) => void,\n multiple = false,\n): UseFileWidgetPropsResult {\n const values: (string | null)[] = useMemo(() => {\n if (multiple && value) {\n return Array.isArray(value) ? value : [value];\n }\n return [];\n }, [value, multiple]);\n const filesInfo = useMemo(\n () => (Array.isArray(value) ? extractFileInfo(value) : extractFileInfo([value || ''])),\n [value],\n );\n\n const handleChange = useCallback(\n async (files: FileList) => {\n const filesInfoEvent = await processFiles(files);\n const newValue = filesInfoEvent.map((fileInfo) => fileInfo.dataURL || null);\n if (multiple) {\n onChange(values.concat(...newValue));\n } else {\n onChange(newValue[0]);\n }\n },\n [values, multiple, onChange],\n );\n const handleRemove = useCallback(\n (index: number) => {\n if (multiple) {\n const newValue = values.filter((_, i: number) => i !== index);\n onChange(newValue);\n } else {\n onChange(undefined);\n }\n },\n [values, multiple, onChange],\n );\n\n return { filesInfo, handleChange, handleRemove };\n}\n","import pad from './pad.ts';\n\n/** Converts a UTC date string into a local Date format\n *\n * @param jsonDate - A UTC date string\n * @returns - An empty string when `jsonDate` is falsey, otherwise a date string in local format\n */\nexport default function utcToLocal(jsonDate: string) {\n if (!jsonDate) {\n return '';\n }\n\n // required format of `'yyyy-MM-ddThh:mm' followed by optional ':ss' or ':ss.SSS'\n // https://html.spec.whatwg.org/multipage/input.html#local-date-and-time-state-(type%3Ddatetime-local)\n // > should be a _valid local date and time string_ (not GMT)\n\n // Note - date constructor passed local ISO-8601 does not correctly\n // change time to UTC in node pre-8\n const date = new Date(jsonDate);\n\n const yyyy = pad(date.getFullYear(), 4);\n const MM = pad(date.getMonth() + 1, 2);\n const dd = pad(date.getDate(), 2);\n const hh = pad(date.getHours(), 2);\n const mm = pad(date.getMinutes(), 2);\n const ss = pad(date.getSeconds(), 2);\n const SSS = pad(date.getMilliseconds(), 3);\n\n return `${yyyy}-${MM}-${dd}T${hh}:${mm}:${ss}.${SSS}`;\n}\n","import mergeObjects from './mergeObjects.ts';\nimport toErrorList from './toErrorList.ts';\nimport type { ErrorSchema, ValidationData } from './types.ts';\n\n/** Merges the errors in `additionalErrorSchema` into the existing `validationData` by combining the hierarchies in the\n * two `ErrorSchema`s and then appending the error list from the `additionalErrorSchema` obtained by calling\n * `toErrorList()` on the `errors` in the `validationData`. If no `additionalErrorSchema` is passed, then\n * `validationData` is returned.\n *\n * @param validationData - The current `ValidationData` into which to merge the additional errors\n * @param [additionalErrorSchema] - The optional additional set of errors in an `ErrorSchema`\n * @param [preventDuplicates=false] - Optional flag, if true, will call `mergeObjects()` with `preventDuplicates`\n * @returns - The `validationData` with the additional errors from `additionalErrorSchema` merged into it, if provided.\n */\nexport default function validationDataMerge<T = any>(\n validationData: ValidationData<T>,\n additionalErrorSchema?: ErrorSchema<T>,\n preventDuplicates = false,\n): ValidationData<T> {\n if (!additionalErrorSchema) {\n return validationData;\n }\n const { errors: oldErrors, errorSchema: oldErrorSchema } = validationData;\n let errors = toErrorList(additionalErrorSchema);\n let errorSchema = additionalErrorSchema;\n if (oldErrorSchema && Object.keys(oldErrorSchema).length > 0) {\n errorSchema = mergeObjects(\n oldErrorSchema,\n additionalErrorSchema,\n preventDuplicates ? 'preventDuplicates' : true,\n ) as ErrorSchema<T>;\n errors = [...oldErrors].concat(errors);\n }\n return { errorSchema, errors };\n}\n","import { REF_KEY, ROOT_SCHEMA_PREFIX } from './constants.ts';\nimport isObject from './isObject.ts';\nimport type { RJSFSchema, StrictRJSFSchema } from './types.ts';\n\n/** Takes a `node` object and transforms any contained `$ref` node variables with a prefix, recursively calling\n * `withIdRefPrefix` for any other elements.\n *\n * @param node - The object node to which a ROOT_SCHEMA_PREFIX is added when a REF_KEY is part of it\n */\nfunction withIdRefPrefixObject<S extends StrictRJSFSchema = RJSFSchema>(node: S): S {\n const realObj: Record<string, any> = node;\n for (const key in realObj) {\n /* v8 ignore next -- spread in caller guarantees only own properties reach this loop */\n if (Object.hasOwn(realObj, key)) {\n const value = realObj[key];\n if (key === REF_KEY && typeof value === 'string' && value.startsWith('#')) {\n realObj[key] = ROOT_SCHEMA_PREFIX + value;\n } else {\n realObj[key] = withIdRefPrefix<S>(value);\n }\n }\n }\n return node;\n}\n\n/** Takes a `node` object list and transforms any contained `$ref` node variables with a prefix, recursively calling\n * `withIdRefPrefix` for any other elements.\n *\n * @param node - The list of object nodes to which a ROOT_SCHEMA_PREFIX is added when a REF_KEY is part of it\n */\nfunction withIdRefPrefixArray<S extends StrictRJSFSchema = RJSFSchema>(node: S[]): S[] {\n return node.map((item) => withIdRefPrefix<S>(item) as S);\n}\n\n/** Recursively prefixes all `$ref`s in a schema with the value of the `ROOT_SCHEMA_PREFIX` constant.\n * This is used in isValid to make references to the rootSchema\n *\n * @param schemaNode - The object node to which a ROOT_SCHEMA_PREFIX is added when a REF_KEY is part of it\n * @returns - A copy of the `schemaNode` with updated `$ref`s\n */\nexport default function withIdRefPrefix<S extends StrictRJSFSchema = RJSFSchema>(\n schemaNode: S | S[] | S[keyof S],\n): S | S[] | S[keyof S] {\n if (Array.isArray(schemaNode)) {\n return withIdRefPrefixArray<S>([...schemaNode]);\n }\n if (isObject(schemaNode)) {\n return withIdRefPrefixObject<S>({ ...schemaNode });\n }\n return schemaNode;\n}\n","/** An enumeration of all the translatable strings used by `@rjsf/core` and its themes. The value of each of the\n * enumeration keys is expected to be the actual english string. Some strings contain replaceable parameter values\n * as indicated by `%1`, `%2`, etc. The number after the `%` indicates the order of the parameter. The ordering of\n * parameters is important because some languages may choose to put the second parameter before the first in its\n * translation. Also, some strings are rendered using `markdown-to-jsx` and thus support markdown and inline html.\n */\nexport enum TranslatableString {\n /** Fallback title of an array item, used by ArrayField */\n ArrayItemTitle = 'Item',\n /** Missing items reason, used by ArrayField */\n MissingItems = 'Missing items definition',\n /** Empty array message, used by ArrayField */\n EmptyArray = 'No items yet. Use the button below to add some.',\n /** Yes label, used by BooleanField */\n YesLabel = 'Yes',\n /** No label, used by BooleanField */\n NoLabel = 'No',\n /** Close label, used by ErrorList */\n CloseLabel = 'Close',\n /** Errors label, used by ErrorList */\n ErrorsLabel = 'Errors',\n /** New additionalProperties string default value, used by ObjectField */\n NewStringDefault = 'New Value',\n /** Add button title, used by AddButton */\n AddButton = 'Add',\n /** Add button title, used by AddButton */\n AddItemButton = 'Add Item',\n /** Copy button title, used by IconButton */\n CopyButton = 'Copy',\n /** Expand cycle button title */\n ExpandButton = 'Expand Cycle',\n /** Move down button title, used by IconButton */\n MoveDownButton = 'Move down',\n /** Move up button title, used by IconButton */\n MoveUpButton = 'Move up',\n /** Remove button title, used by IconButton */\n RemoveButton = 'Remove',\n /** Now label, used by AltDateWidget */\n NowLabel = 'Now',\n /** Clear label, used by AltDateWidget */\n ClearLabel = 'Clear',\n /** Aria date label, used by DateWidget */\n AriaDateLabel = 'Select a date',\n /** File preview label, used by FileWidget */\n PreviewLabel = 'Preview',\n /** Decrement button aria label, used by UpDownWidget */\n DecrementAriaLabel = 'Decrease value by 1',\n /** Increment button aria label, used by UpDownWidget */\n IncrementAriaLabel = 'Increase value by 1',\n /** The label for the Add button in for an optional object field */\n OptionalObjectAdd = 'Add data for optional field',\n /** The label for the Remove button in for an optional object field */\n OptionalObjectRemove = 'Remove data for optional field',\n /** The label for when displaying a non-editable form with missing optional field data */\n OptionalObjectEmptyMsg = 'No data for optional field',\n /** Label for the schema type selector, used by FallbackField */\n Type = 'Type',\n /** Label for the 'value' field, used by FallbackField */\n Value = 'Value',\n /** Clear button title, used by IconButton */\n ClearButton = 'clear input',\n // Strings with replaceable parameters\n /** Unknown field type reason, where %1 will be replaced with the type as provided by SchemaField */\n UnknownFieldType = 'Unknown field type %1',\n /** Option prefix, where %1 will be replaced with the option index as provided by MultiSchemaField */\n OptionPrefix = 'Option %1',\n /** Option prefix, where %1 and %2 will be replaced by the schema title and option index, respectively as provided by\n * MultiSchemaField\n */\n TitleOptionPrefix = '%1 option %2',\n /** Key label, where %1 will be replaced by the label as provided by WrapIfAdditionalTemplate */\n KeyLabel = '%1 Key',\n /** Deprecated label, where %1 will be replaced by the label as provided by SchemaField */\n DeprecatedLabel = '%1 (deprecated)',\n /** Cyclic schema message */\n CycleDetected = 'Circular reference ($ref cycle) detected for field \"%1\". You may choose to expand to the next cycle break',\n // Strings with replaceable parameters AND/OR that support markdown and html\n /** Invalid object field configuration as provided by the ObjectField.\n * NOTE: Use markdown notation rather than html tags.\n */\n InvalidObjectField = 'Invalid \"%1\" object field configuration: _%2_.',\n /** Unsupported field schema, used by UnsupportedField */\n UnsupportedField = 'Unsupported field schema.',\n /** Unsupported field schema, where %1 will be replaced by the FieldPathId.$id as provided by UnsupportedField.\n * NOTE: Use markdown notation rather than html tags.\n */\n UnsupportedFieldWithId = 'Unsupported field schema for field `%1`.',\n /** Unsupported field schema, where %1 will be replaced by the reason string as provided by UnsupportedField.\n * NOTE: Use markdown notation rather than html tags.\n */\n UnsupportedFieldWithReason = 'Unsupported field schema: _%1_.',\n /** Unsupported field schema, where %1 and %2 will be replaced by the FieldPathId.$id and reason strings,\n * respectively, as provided by UnsupportedField.\n * NOTE: Use markdown notation rather than html tags.\n */\n UnsupportedFieldWithIdAndReason = 'Unsupported field schema for field `%1`: _%2_.',\n /** File name, type and size info, where %1, %2 and %3 will be replaced by the file name, file type and file size as\n * provided by FileWidget\n */\n FilesInfo = '**%1** (%2, %3 bytes)',\n}\n","import type { MouseEvent } from 'react';\nimport { memo, useCallback, useMemo, useRef, useState } from 'react';\nimport type {\n ArrayFieldTemplateProps,\n ErrorSchema,\n FieldPathId,\n FieldPathList,\n FieldProps,\n FormContextType,\n Registry,\n RJSFSchema,\n StrictRJSFSchema,\n UiSchema,\n UIOptionsType,\n} from '@rjsf/utils';\nimport {\n setByPath,\n allowAdditionalItems,\n getTemplate,\n getUiOptions,\n getWidget,\n hashObject,\n isCustomWidget,\n isFixedItems,\n isFormDataAvailable,\n isObject,\n optionsList,\n shouldRenderOptionalField,\n toFieldPathId,\n useDeepCompareMemo,\n ITEMS_KEY,\n ID_KEY,\n TranslatableString,\n} from '@rjsf/utils';\n\n/** Type used to represent the keyed form data used in the state */\ninterface KeyedFormDataType<T> {\n key: string;\n item: T;\n}\n\n/** Used to generate a unique ID for an element in a row */\nlet rowIdCounter = 0;\n\nfunction generateRowId() {\n rowIdCounter += 1;\n return `rjsf-array-item-${rowIdCounter}`;\n}\n\n/** Converts the `formData` into `KeyedFormDataType` data, using the `generateRowId()` function to create the key\n *\n * @param formData - The data for the form\n * @returns - The `formData` converted into a `KeyedFormDataType` element\n */\nfunction generateKeyedFormData<T>(formData?: T[]): KeyedFormDataType<T>[] {\n return !Array.isArray(formData)\n ? []\n : formData.map((item) => ({\n key: generateRowId(),\n item,\n }));\n}\n\n/** Converts `KeyedFormDataType` data into the inner `formData`\n *\n * @param keyedFormData - The `KeyedFormDataType` to be converted\n * @returns - The inner `formData` item(s) in the `keyedFormData`\n */\nfunction keyedToPlainFormData<T>(keyedFormData: KeyedFormDataType<T> | KeyedFormDataType<T>[]): T[] {\n if (Array.isArray(keyedFormData)) {\n return keyedFormData.map((keyedItem) => keyedItem.item);\n }\n return [];\n}\n\n/** Determines whether the item described in the schema is always required, which is determined by whether any item\n * may be null.\n *\n * @param itemSchema - The schema for the item\n * @return - True if the item schema type does not contain the \"null\" type\n */\nfunction isItemRequired<S extends StrictRJSFSchema = RJSFSchema>(itemSchema: S) {\n if (Array.isArray(itemSchema.type)) {\n // While we don't yet support composite/nullable jsonschema types, it's\n // future-proof to check for requirement against these.\n return !itemSchema.type.includes('null');\n }\n // All non-null array item types are inherently required by design\n return itemSchema.type !== 'null';\n}\n\n/** Determines whether more items can be added to the array. If the uiSchema indicates the array doesn't allow adding\n * then false is returned. Otherwise, if the schema indicates that there are a maximum number of items and the\n * `formData` matches that value, then false is returned, otherwise true is returned.\n *\n * @param registry - The registry\n * @param schema - The schema for the field\n * @param formItems - The list of items in the form\n * @param [uiSchema] - The UiSchema for the field\n * @returns - True if the item is addable otherwise false\n */\nfunction canAddItem<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n registry: Registry<T[], S, F>,\n schema: S,\n formItems: T[],\n uiSchema?: UiSchema<T[], S, F>,\n) {\n let { addable } = getUiOptions<T[], S, F>(uiSchema, registry.globalUiOptions);\n if (addable !== false) {\n // if ui:options.addable was not explicitly set to false, we can add\n // another item if we have not exceeded maxItems yet\n if (schema.maxItems !== undefined) {\n addable = formItems.length < schema.maxItems;\n } else {\n addable = true;\n }\n }\n return addable;\n}\n\n/** Helper method to compute item UI schema for both normal and fixed arrays\n * Handles both static object and dynamic function cases\n *\n * @param uiSchema - The parent UI schema containing items definition\n * @param item - The item data\n * @param index - The index of the item\n * @param formContext - The form context\n * @returns The computed UI schema for the item\n */\nfunction computeItemUiSchema<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n uiSchema: UiSchema<T[], S, F>,\n item: T,\n index: number,\n formContext: F,\n): UiSchema<T[], S, F> | undefined {\n if (typeof uiSchema.items === 'function') {\n try {\n // Call the function with item data, index, and form context\n // TypeScript now correctly infers the types thanks to the ArrayElement type in UiSchema\n const result = uiSchema.items(item, index, formContext);\n // Only use the result if it's truthy\n return result as UiSchema<T[], S, F>;\n } catch (e) {\n // oxlint-disable-next-line no-console\n console.error(`Error executing dynamic uiSchema.items function for item at index ${index}:`, e);\n // Fall back to undefined to allow the field to still render\n return undefined;\n }\n } else {\n // Static object case - preserve undefined to maintain backward compatibility\n return uiSchema.items as UiSchema<T[], S, F> | undefined;\n }\n}\n\n/** Returns the default form information for an item based on the schema for that item. Deals with the possibility\n * that the schema is fixed and allows additional items.\n */\nfunction getNewFormDataRow<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n registry: Registry<T[], S, F>,\n schema: S,\n): T {\n const { schemaUtils, globalFormOptions } = registry;\n let itemSchema = schema.items as S;\n if (globalFormOptions.useFallbackUiForUnsupportedType && !itemSchema) {\n // If we don't have itemSchema and useFallbackUiForUnsupportedType is on, use an empty schema\n itemSchema = {} as S;\n } else if (isFixedItems(schema) && allowAdditionalItems(schema)) {\n itemSchema = schema.additionalItems as S;\n }\n // Cast this as a T to work around schema utils being for T[] caused by the FieldProps<T[], S, F> call on the class\n return schemaUtils.getDefaultFormState(itemSchema) as unknown as T;\n}\n\n/** Props used for ArrayAsXxxx type components*/\ninterface ArrayAsFieldProps<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n> extends FieldProps<T, S, F> {\n /** The callback used to update the array when the selector changes */\n onSelectChange: (value: T) => void;\n}\n\n/** Renders an array as a set of checkboxes using the 'select' widget\n */\nfunction ArrayAsMultiSelect<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n props: ArrayAsFieldProps<T[], S, F>,\n) {\n const {\n schema,\n fieldPathId,\n uiSchema,\n formData: items = [],\n disabled = false,\n readonly = false,\n autofocus = false,\n required = false,\n placeholder,\n onBlur,\n onFocus,\n registry,\n rawErrors,\n name,\n onSelectChange,\n } = props;\n const { widgets, schemaUtils, globalFormOptions, globalUiOptions } = registry;\n const itemsSchema = schemaUtils.retrieveSchema(schema.items as S, items);\n // For computing `enumOptions`, fallback to the array property's uiSchema if there is no `items` schema\n // Avoids a breaking change reported in https://github.com/rjsf-team/react-jsonschema-form/issues/4985\n const itemsUiSchema = (uiSchema?.items ?? uiSchema) as UiSchema<T[], S, F>;\n const enumOptions = optionsList<T[], S, F>(itemsSchema, itemsUiSchema);\n const { widget = 'select', title: uiTitle, ...options } = getUiOptions<T[], S, F>(uiSchema, globalUiOptions);\n const Widget = getWidget<T[], S, F>(schema, widget, widgets);\n const label = uiTitle ?? schema.title ?? name;\n const displayLabel = schemaUtils.getDisplayLabel(schema, uiSchema, globalUiOptions);\n // For custom widgets with multiple=true, generate a fieldPathId with isMultiValue flag\n const multiValueFieldPathId = useDeepCompareMemo(toFieldPathId('', globalFormOptions, fieldPathId, true));\n return (\n <Widget\n id={multiValueFieldPathId[ID_KEY]}\n name={name}\n multiple\n onChange={onSelectChange}\n onBlur={onBlur}\n onFocus={onFocus}\n options={{ ...options, enumOptions }}\n schema={schema}\n uiSchema={uiSchema}\n registry={registry}\n value={items}\n disabled={disabled}\n readonly={readonly}\n required={required}\n label={label}\n hideLabel={!displayLabel}\n placeholder={placeholder}\n autofocus={autofocus}\n rawErrors={rawErrors}\n htmlName={multiValueFieldPathId.name}\n />\n );\n}\n\n/** Renders an array using the custom widget provided by the user in the `uiSchema`\n */\nfunction ArrayAsCustomWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n props: ArrayAsFieldProps<T[], S, F>,\n) {\n const {\n schema,\n fieldPathId,\n uiSchema,\n disabled = false,\n readonly = false,\n autofocus = false,\n required = false,\n hideError,\n placeholder,\n onBlur,\n onFocus,\n formData: items = [],\n registry,\n rawErrors,\n name,\n onSelectChange,\n } = props;\n const { widgets, schemaUtils, globalFormOptions, globalUiOptions } = registry;\n const { widget, title: uiTitle, ...options } = getUiOptions<T[], S, F>(uiSchema, globalUiOptions);\n const Widget = getWidget<T[], S, F>(schema, widget, widgets);\n const label = uiTitle ?? schema.title ?? name;\n const displayLabel = schemaUtils.getDisplayLabel(schema, uiSchema, globalUiOptions);\n // For custom widgets with multiple=true, generate a fieldPathId with isMultiValue flag\n const multiValueFieldPathId = useDeepCompareMemo(toFieldPathId('', globalFormOptions, fieldPathId, true));\n return (\n <Widget\n id={multiValueFieldPathId[ID_KEY]}\n name={name}\n multiple\n onChange={onSelectChange}\n onBlur={onBlur}\n onFocus={onFocus}\n options={options}\n schema={schema}\n uiSchema={uiSchema}\n registry={registry}\n value={items}\n disabled={disabled}\n readonly={readonly}\n hideError={hideError}\n required={required}\n label={label}\n hideLabel={!displayLabel}\n placeholder={placeholder}\n autofocus={autofocus}\n rawErrors={rawErrors}\n htmlName={multiValueFieldPathId.name}\n />\n );\n}\n\n/** Renders an array of files using the `FileWidget`\n */\nfunction ArrayAsFiles<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n props: ArrayAsFieldProps<T[], S, F>,\n) {\n const {\n schema,\n uiSchema,\n fieldPathId,\n name,\n disabled = false,\n readonly = false,\n autofocus = false,\n required = false,\n onBlur,\n onFocus,\n registry,\n formData: items = [],\n rawErrors,\n onSelectChange,\n } = props;\n const { widgets, schemaUtils, globalFormOptions, globalUiOptions } = registry;\n const { widget = 'files', title: uiTitle, ...options } = getUiOptions<T[], S, F>(uiSchema, globalUiOptions);\n const Widget = getWidget<T[], S, F>(schema, widget, widgets);\n const label = uiTitle ?? schema.title ?? name;\n const displayLabel = schemaUtils.getDisplayLabel(schema, uiSchema, globalUiOptions);\n // For custom widgets with multiple=true, generate a fieldPathId with isMultiValue flag\n const multiValueFieldPathId = useDeepCompareMemo(toFieldPathId('', globalFormOptions, fieldPathId, true));\n return (\n <Widget\n options={options}\n id={multiValueFieldPathId[ID_KEY]}\n name={name}\n multiple\n onChange={onSelectChange}\n onBlur={onBlur}\n onFocus={onFocus}\n schema={schema}\n uiSchema={uiSchema}\n value={items}\n disabled={disabled}\n readonly={readonly}\n required={required}\n registry={registry}\n autofocus={autofocus}\n rawErrors={rawErrors}\n label={label}\n hideLabel={!displayLabel}\n htmlName={multiValueFieldPathId.name}\n />\n );\n}\n\n/** Renders the individual array item using a `SchemaField` along with the additional properties that are needed to\n * render the whole of the `ArrayFieldItemTemplate`.\n */\nfunction ArrayFieldItemInner<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: {\n itemKey: string;\n index: number;\n name: string;\n disabled: boolean;\n readonly: boolean;\n required: boolean;\n hideError: boolean;\n registry: Registry<T[], S, F>;\n uiOptions: UIOptionsType<T[], S, F>;\n parentUiSchema: UiSchema<T[], S, F>;\n title: string | undefined;\n canAdd: boolean;\n canRemove?: boolean;\n canMoveUp: boolean;\n canMoveDown: boolean;\n rawItemSchema: S;\n itemData: T[];\n itemUiSchema: UiSchema<T[], S, F> | undefined;\n parentFieldPathId: FieldPathId;\n itemErrorSchema?: ErrorSchema<T[]>;\n autofocus?: boolean;\n onBlur: FieldProps<T[], S, F>['onBlur'];\n onFocus: FieldProps<T[], S, F>['onFocus'];\n onChange: FieldProps<T[], S, F>['onChange'];\n rawErrors?: string[];\n totalItems: number;\n handleAddItem: (event: MouseEvent, index?: number) => void;\n handleCopyItem: (event: MouseEvent, index: number) => void;\n handleRemoveItem: (event: MouseEvent, index: number) => void;\n handleReorderItems: (event: MouseEvent<HTMLButtonElement>, index: number, newIndex: number) => void;\n}) {\n const {\n itemKey,\n index,\n name,\n disabled,\n hideError,\n readonly,\n registry,\n uiOptions,\n parentUiSchema,\n canAdd,\n canRemove = true,\n canMoveUp,\n canMoveDown,\n rawItemSchema,\n itemData,\n itemUiSchema,\n parentFieldPathId,\n itemErrorSchema,\n autofocus,\n onBlur,\n onFocus,\n onChange,\n rawErrors,\n totalItems,\n title,\n handleAddItem,\n handleCopyItem,\n handleRemoveItem,\n handleReorderItems,\n } = props;\n const {\n schemaUtils,\n fields: { ArraySchemaField, SchemaField },\n globalUiOptions,\n globalFormOptions,\n } = registry;\n const itemSchema = useMemo(\n () => schemaUtils.retrieveSchema(rawItemSchema, itemData),\n [schemaUtils, rawItemSchema, itemData],\n );\n // parentFieldPathId is the same stable reference for all items; index is a stable number.\n // useMemo avoids creating a new FieldPathId object on every render, letting React.memo bail out.\n const fieldPathId = useMemo(\n () => toFieldPathId(index, globalFormOptions, parentFieldPathId),\n [index, globalFormOptions, parentFieldPathId],\n );\n const ItemSchemaField = ArraySchemaField || SchemaField;\n const ArrayFieldItemTemplate = getTemplate<'ArrayFieldItemTemplate', T[], S, F>(\n 'ArrayFieldItemTemplate',\n registry,\n uiOptions,\n );\n const displayLabel = schemaUtils.getDisplayLabel(itemSchema, itemUiSchema, globalUiOptions);\n const { description } = getUiOptions(itemUiSchema);\n const hasDescription = !!description || !!itemSchema.description;\n const { orderable = true, removable = true, copyable = false } = uiOptions;\n const has: Record<string, boolean> = {\n moveUp: orderable && canMoveUp,\n moveDown: orderable && canMoveDown,\n copy: copyable && canAdd,\n remove: removable && canRemove,\n toolbar: false,\n };\n has.toolbar = Object.keys(has).some((key: keyof typeof has) => has[key]);\n\n const onAddItem = useCallback(\n (event: MouseEvent) => {\n handleAddItem(event, index + 1);\n },\n [handleAddItem, index],\n );\n const onCopyItem = useCallback(\n (event: MouseEvent) => {\n handleCopyItem(event, index);\n },\n [handleCopyItem, index],\n );\n const onRemoveItem = useCallback(\n (event: MouseEvent) => {\n handleRemoveItem(event, index);\n },\n [handleRemoveItem, index],\n );\n const onMoveUpItem = useCallback(\n (event: MouseEvent<HTMLButtonElement>) => {\n handleReorderItems(event, index, index - 1);\n },\n [handleReorderItems, index],\n );\n const onMoveDownItem = useCallback(\n (event: MouseEvent<HTMLButtonElement>) => {\n handleReorderItems(event, index, index + 1);\n },\n [handleReorderItems, index],\n );\n\n const templateProps = {\n children: (\n <ItemSchemaField\n name={name}\n title={title}\n index={index}\n schema={itemSchema}\n uiSchema={itemUiSchema}\n formData={itemData}\n errorSchema={itemErrorSchema}\n fieldPathId={fieldPathId}\n required={isItemRequired<S>(itemSchema)}\n onChange={onChange}\n onBlur={onBlur}\n onFocus={onFocus}\n registry={registry}\n disabled={disabled}\n readonly={readonly}\n hideError={hideError}\n autofocus={autofocus}\n rawErrors={rawErrors}\n />\n ),\n buttonsProps: {\n fieldPathId,\n disabled,\n readonly,\n canAdd,\n hasCopy: has.copy,\n hasMoveUp: has.moveUp,\n hasMoveDown: has.moveDown,\n hasRemove: has.remove,\n index,\n totalItems,\n onAddItem,\n onCopyItem,\n onRemoveItem,\n onMoveUpItem,\n onMoveDownItem,\n registry,\n schema: itemSchema,\n uiSchema: itemUiSchema,\n },\n itemKey,\n className: 'rjsf-array-item',\n disabled,\n hasToolbar: has.toolbar,\n index,\n totalItems,\n readonly,\n registry,\n schema: itemSchema,\n uiSchema: itemUiSchema,\n parentUiSchema,\n displayLabel,\n hasDescription,\n };\n return <ArrayFieldItemTemplate {...templateProps} />;\n}\nconst ArrayFieldItem = memo(ArrayFieldItemInner) as typeof ArrayFieldItemInner;\n\n/** The properties required by the stateless components that render the items using the `ArrayFieldItem` */\ninterface InternalArrayFieldProps<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n> extends FieldProps<T[], S, F> {\n /** The keyedFormData from the `ArrayField` state */\n keyedFormData: KeyedFormDataType<T>[];\n /** The callback used to handle the adding of an item at the given index (or the end, if missing) */\n handleAddItem: (event: MouseEvent, index?: number) => void;\n /** The callback used to handle the copying of the item at the given index, below itself */\n handleCopyItem: (event: MouseEvent, index: number) => void;\n /** The callback used to handle removing an item at the given index */\n handleRemoveItem: (event: MouseEvent, index: number) => void;\n /** The callback used to handle reordering an item at the given index to its newIndex */\n handleReorderItems: (event: MouseEvent<HTMLButtonElement>, index: number, newIndex: number) => void;\n}\n\n/** Renders a normal array without any limitations of length\n */\nfunction NormalArray<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n props: InternalArrayFieldProps<T, S, F>,\n) {\n const {\n schema,\n uiSchema = {},\n errorSchema,\n fieldPathId,\n formData: formDataFromProps,\n name,\n title,\n disabled = false,\n readonly = false,\n autofocus = false,\n required = false,\n hideError = false,\n registry,\n onBlur,\n onFocus,\n rawErrors,\n onChange,\n keyedFormData,\n handleAddItem,\n handleCopyItem,\n handleRemoveItem,\n handleReorderItems,\n } = props;\n const fieldTitle = schema.title || title || name;\n const { schemaUtils, fields, formContext, globalUiOptions } = registry;\n const { OptionalDataControlsField } = fields;\n const uiOptions = useMemo(() => getUiOptions<T[], S, F>(uiSchema, globalUiOptions), [uiSchema, globalUiOptions]);\n // Memoize schemaItems to avoid a new `{}` object identity on every render (which would bust retrieveSchema cache)\n const schemaItems: S = useMemo(() => (isObject(schema.items) ? (schema.items as S) : ({} as S)), [schema.items]);\n const itemsSchema: S = useMemo(() => schemaUtils.retrieveSchema(schemaItems), [schemaUtils, schemaItems]);\n const formData = useMemo(() => keyedToPlainFormData<T>(keyedFormData), [keyedFormData]);\n const renderOptionalField = shouldRenderOptionalField<T[], S, F>(registry, schema, required, uiSchema);\n const hasFormData = isFormDataAvailable<T[]>(formDataFromProps);\n const canAdd = useMemo(\n () => canAddItem<T, S, F>(registry, schema, formData, uiSchema) && (!renderOptionalField || hasFormData),\n [registry, schema, formData, uiSchema, renderOptionalField, hasFormData],\n );\n const actualFormData = hasFormData ? keyedFormData : [];\n const extraClass = renderOptionalField ? ' rjsf-optional-array-field' : '';\n // All the children will use childFieldPathId if present in the props, falling back to the fieldPathId\n const childFieldPathId = props.childFieldPathId ?? fieldPathId;\n const optionalDataControl = renderOptionalField ? (\n <OptionalDataControlsField {...props} fieldPathId={childFieldPathId} />\n ) : undefined;\n const arrayProps: ArrayFieldTemplateProps<T[], S, F> = {\n canAdd,\n items: actualFormData.map((keyedItem, index: number) => {\n const { key, item } = keyedItem;\n // While we are actually dealing with a single item of type T, the types require a T[], so cast\n const itemCast = item as unknown as T[];\n const itemErrorSchema = errorSchema ? (errorSchema[index] as ErrorSchema<T[]>) : undefined;\n\n // Compute the item UI schema using the helper method\n const itemUiSchema = computeItemUiSchema<T, S, F>(uiSchema, item, index, formContext);\n\n const itemProps = {\n itemKey: key,\n index,\n name: name && `${name}-${index}`,\n registry,\n uiOptions,\n parentUiSchema: uiSchema,\n hideError,\n readonly,\n disabled,\n required,\n title: fieldTitle ? `${fieldTitle}-${index + 1}` : undefined,\n canAdd,\n canMoveUp: index > 0,\n canMoveDown: index < formData.length - 1,\n rawItemSchema: schemaItems,\n parentFieldPathId: childFieldPathId,\n itemErrorSchema,\n itemData: itemCast,\n itemUiSchema,\n autofocus: autofocus && index === 0,\n onBlur,\n onFocus,\n rawErrors,\n totalItems: keyedFormData.length,\n handleAddItem,\n handleCopyItem,\n handleRemoveItem,\n handleReorderItems,\n onChange,\n };\n return <ArrayFieldItem key={key} {...itemProps} />;\n }),\n className: `rjsf-field rjsf-field-array rjsf-field-array-of-${itemsSchema.type}${extraClass}`,\n disabled,\n fieldPathId,\n uiSchema,\n onAddClick: handleAddItem,\n readonly,\n required,\n schema,\n title: fieldTitle,\n formData,\n rawErrors,\n registry,\n optionalDataControl,\n };\n\n const Template = getTemplate<'ArrayFieldTemplate', T[], S, F>('ArrayFieldTemplate', registry, uiOptions);\n return <Template {...arrayProps} />;\n}\n\n/** Renders an array that has a maximum limit of items\n */\nfunction FixedArray<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n props: InternalArrayFieldProps<T, S, F>,\n) {\n const {\n schema,\n uiSchema = {},\n formData,\n errorSchema,\n fieldPathId,\n name,\n title,\n disabled = false,\n readonly = false,\n autofocus = false,\n required = false,\n hideError = false,\n registry,\n onBlur,\n onFocus,\n rawErrors,\n keyedFormData,\n onChange,\n handleAddItem,\n handleCopyItem,\n handleRemoveItem,\n handleReorderItems,\n } = props;\n let { formData: items = [] } = props;\n const fieldTitle = schema.title || title || name;\n const { fields, formContext, globalUiOptions } = registry;\n const uiOptions = useMemo(() => getUiOptions<T[], S, F>(uiSchema, globalUiOptions), [uiSchema, globalUiOptions]);\n const { OptionalDataControlsField } = fields;\n const renderOptionalField = shouldRenderOptionalField<T[], S, F>(registry, schema, required, uiSchema);\n const hasFormData = isFormDataAvailable<T[]>(formData);\n const schemaItems = useMemo<S[]>(() => (Array.isArray(schema.items) ? (schema.items as S[]) : []), [schema.items]);\n const hasAdditionalItems = isObject(schema.additionalItems);\n // All the children will use childFieldPathId if present in the props, falling back to the fieldPathId\n const childFieldPathId = props.childFieldPathId ?? fieldPathId;\n\n if (items.length < schemaItems.length) {\n // to make sure at least all fixed items are generated\n items = items.concat(new Array(schemaItems.length - items.length));\n }\n const actualFormData = hasFormData ? keyedFormData : [];\n const extraClass = renderOptionalField ? ' rjsf-optional-array-field' : '';\n const optionalDataControl = renderOptionalField ? (\n <OptionalDataControlsField {...props} fieldPathId={childFieldPathId} />\n ) : undefined;\n\n // These are the props passed into the render function\n const canAdd =\n canAddItem<T, S, F>(registry, schema, items, uiSchema) &&\n hasAdditionalItems &&\n (!renderOptionalField || hasFormData);\n const arrayProps: ArrayFieldTemplateProps<T[], S, F> = {\n canAdd,\n className: `rjsf-field rjsf-field-array rjsf-field-array-fixed-items${extraClass}`,\n disabled,\n fieldPathId,\n formData,\n items: actualFormData.map((keyedItem, index) => {\n const { key, item } = keyedItem;\n // While we are actually dealing with a single item of type T, the types require a T[], so cast\n const itemCast = item as unknown as T[];\n const additional = index >= schemaItems.length;\n const rawItemSchema =\n (additional && isObject(schema.additionalItems) ? (schema.additionalItems as S) : schemaItems[index]) ||\n ({} as S);\n // Compute the item UI schema - handle both static and dynamic cases\n let itemUiSchema: UiSchema<T[], S, F> | undefined;\n if (additional) {\n // For additional items, use additionalItems uiSchema\n itemUiSchema = uiSchema.additionalItems as UiSchema<T[], S, F>;\n } else if (Array.isArray(uiSchema.items)) {\n // For fixed items, uiSchema.items can be an array, a function, or a single object\n itemUiSchema = uiSchema.items[index] as UiSchema<T[], S, F>;\n } else {\n // Use the helper method for function or static object cases\n itemUiSchema = computeItemUiSchema<T, S, F>(uiSchema, item, index, formContext);\n }\n const itemErrorSchema = errorSchema ? (errorSchema[index] as ErrorSchema<T[]>) : undefined;\n\n const itemProps = {\n index,\n itemKey: key,\n name: name && `${name}-${index}`,\n registry,\n uiOptions,\n parentUiSchema: uiSchema,\n hideError,\n readonly,\n disabled,\n required,\n title: fieldTitle ? `${fieldTitle}-${index + 1}` : undefined,\n canAdd,\n canRemove: additional,\n canMoveUp: index >= schemaItems.length + 1,\n canMoveDown: additional && index < items.length - 1,\n rawItemSchema,\n itemData: itemCast,\n itemUiSchema,\n parentFieldPathId: childFieldPathId,\n itemErrorSchema,\n autofocus: autofocus && index === 0,\n onBlur,\n onFocus,\n rawErrors,\n totalItems: keyedFormData.length,\n onChange,\n handleAddItem,\n handleCopyItem,\n handleRemoveItem,\n handleReorderItems,\n };\n return <ArrayFieldItem key={key} {...itemProps} />;\n }),\n onAddClick: handleAddItem,\n readonly,\n required,\n registry,\n schema,\n uiSchema,\n title: fieldTitle,\n errorSchema,\n rawErrors,\n optionalDataControl,\n };\n\n const Template = getTemplate<'ArrayFieldTemplate', T[], S, F>('ArrayFieldTemplate', registry, uiOptions);\n return <Template {...arrayProps} />;\n}\n\ninterface KeyedFormDataState<T = any> {\n /** The keyed form data elements */\n keyedFormData: KeyedFormDataType<T>[];\n /** Updates the keyed form data elements to the given value */\n updateKeyedFormData: (newData: KeyedFormDataType<T>[]) => T[];\n}\n\n/** Type used for the state of the `ArrayField` component */\ninterface ArrayFieldState<T> {\n /** The hash of the last formData passed in */\n formDataHash: string;\n /** The keyed form data elements */\n keyedFormData: KeyedFormDataType<T>[];\n}\n\n/** A custom hook that handles the updating of the keyedFormData from an external `formData` change as well as\n * internally by the `ArrayField`. If there was an external `formData` change, then the `keyedFormData` is recomputed\n * in order to preserve the unique keys from the old `keyedFormData` to the new `formData`. Along with the\n * `keyedFormData` this hook also returns an `updateKeyedFormData()` function for use by the `ArrayField`. The detection\n * of external `formData` are handled by storing the hash of that `formData` along with the `keyedFormData` associated\n * with it. The `updateKeyedFormData()` will update that hash whenever the `keyedFormData` is modified and as well as\n * returning the plain `formData` from the `keyedFormData`.\n */\nfunction useKeyedFormData<T = any>(formData: T[] = []): KeyedFormDataState<T> {\n const newHash = useMemo(() => hashObject(formData), [formData]);\n const [state, setState] = useState<ArrayFieldState<T>>(() => ({\n formDataHash: newHash,\n keyedFormData: generateKeyedFormData<T>(formData),\n }));\n\n let { keyedFormData, formDataHash } = state;\n if (newHash !== formDataHash) {\n const nextFormData = Array.isArray(formData) ? formData : [];\n const previousKeyedFormData = keyedFormData || [];\n keyedFormData =\n nextFormData.length === previousKeyedFormData.length\n ? previousKeyedFormData.map((previousKeyedFormDatum, index) => ({\n key: previousKeyedFormDatum.key,\n item: nextFormData[index],\n }))\n : generateKeyedFormData<T>(nextFormData);\n formDataHash = newHash;\n setState({ formDataHash, keyedFormData });\n }\n\n const updateKeyedFormData = useCallback((newData: KeyedFormDataType<T>[]) => {\n const plainFormData = keyedToPlainFormData(newData);\n const updatedHash = hashObject(plainFormData);\n setState({ formDataHash: updatedHash, keyedFormData: newData });\n return plainFormData;\n }, []);\n\n return { keyedFormData, updateKeyedFormData };\n}\n\n/** The `ArrayField` component is used to render a field in the schema that is of type `array`. It supports both normal\n * and fixed array, allowing user to add and remove elements from the array data.\n */\nexport default function ArrayField<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n props: FieldProps<T[], S, F>,\n) {\n const { schema, uiSchema, errorSchema, fieldPathId, registry, formData, onChange } = props;\n const { globalFormOptions, schemaUtils, translateString } = registry;\n const { keyedFormData, updateKeyedFormData } = useKeyedFormData<T>(formData);\n // Refs keep the latest values accessible inside stable useCallback closures without being in the dep array,\n // so the four mutation handlers don't get new references on every keyedFormData / errorSchema change.\n const keyedFormDataRef = useRef(keyedFormData);\n keyedFormDataRef.current = keyedFormData;\n const errorSchemaRef = useRef(errorSchema);\n errorSchemaRef.current = errorSchema;\n // All the children will use childFieldPathId if present in the props, falling back to the fieldPathId\n const childFieldPathId = props.childFieldPathId ?? fieldPathId;\n\n /** Callback handler for when the user clicks on the add or add at index buttons. Creates a new row of keyed form data\n * either at the end of the list (when index is not specified) or inserted at the `index` when it is, adding it into\n * the state, and then returning `onChange()` with the plain form data converted from the keyed data\n *\n * @param event - The event for the click\n * @param [index] - The optional index at which to add the new data\n */\n const handleAddItem = useCallback(\n (event: MouseEvent, index?: number) => {\n if (event) {\n event.preventDefault();\n }\n\n let newErrorSchema: ErrorSchema<T> | undefined;\n if (errorSchemaRef.current) {\n newErrorSchema = {};\n for (const idx of Object.keys(errorSchemaRef.current)) {\n const i = parseInt(idx, 10);\n if (index === undefined || i < index) {\n setByPath(newErrorSchema, i, errorSchemaRef.current[i]);\n } else if (i >= index) {\n setByPath(newErrorSchema, i + 1, errorSchemaRef.current[i]);\n }\n }\n }\n\n const newKeyedFormDataRow: KeyedFormDataType<T> = {\n key: generateRowId(),\n item: getNewFormDataRow<T, S, F>(registry, schema),\n };\n const newKeyedFormData = [...keyedFormDataRef.current];\n if (index !== undefined) {\n newKeyedFormData.splice(index, 0, newKeyedFormDataRow);\n } else {\n newKeyedFormData.push(newKeyedFormDataRow);\n }\n onChange(updateKeyedFormData(newKeyedFormData), childFieldPathId.path, newErrorSchema as ErrorSchema<T[]>);\n },\n [registry, schema, onChange, updateKeyedFormData, childFieldPathId],\n );\n\n /** Callback handler for when the user clicks on the copy button on an existing array element. Clones the row of\n * keyed form data at the `index` into the next position in the state, and then returning `onChange()` with the plain\n * form data converted from the keyed data\n *\n * @param index - The index at which the copy button is clicked\n */\n const handleCopyItem = useCallback(\n (event: MouseEvent, index: number) => {\n if (event) {\n event.preventDefault();\n }\n\n let newErrorSchema: ErrorSchema<T> | undefined;\n if (errorSchemaRef.current) {\n newErrorSchema = {};\n for (const idx of Object.keys(errorSchemaRef.current)) {\n const i = parseInt(idx, 10);\n if (i <= index) {\n setByPath(newErrorSchema, i, errorSchemaRef.current[i]);\n } else if (i > index) {\n setByPath(newErrorSchema, i + 1, errorSchemaRef.current[i]);\n }\n }\n }\n\n const newKeyedFormDataRow: KeyedFormDataType<T> = {\n key: generateRowId(),\n item: structuredClone(keyedFormDataRef.current[index].item),\n };\n const newKeyedFormData = [...keyedFormDataRef.current];\n if (index !== undefined) {\n newKeyedFormData.splice(index + 1, 0, newKeyedFormDataRow);\n } else {\n newKeyedFormData.push(newKeyedFormDataRow);\n }\n onChange(updateKeyedFormData(newKeyedFormData), childFieldPathId.path, newErrorSchema as ErrorSchema<T[]>);\n },\n [onChange, updateKeyedFormData, childFieldPathId],\n );\n\n /** Callback handler for when the user clicks on the remove button on an existing array element. Removes the row of\n * keyed form data at the `index` in the state, and then returning `onChange()` with the plain form data converted\n * from the keyed data\n *\n * @param index - The index at which the remove button is clicked\n */\n const handleRemoveItem = useCallback(\n (event: MouseEvent, index: number) => {\n if (event) {\n event.preventDefault();\n }\n // refs #195: revalidate to ensure properly reindexing errors\n let newErrorSchema: ErrorSchema<T> | undefined;\n if (errorSchemaRef.current) {\n newErrorSchema = {};\n for (const idx of Object.keys(errorSchemaRef.current)) {\n const i = parseInt(idx, 10);\n if (i < index) {\n setByPath(newErrorSchema, i, errorSchemaRef.current[i]);\n } else if (i > index) {\n setByPath(newErrorSchema, i - 1, errorSchemaRef.current[i]);\n }\n }\n }\n const newKeyedFormData = keyedFormDataRef.current.filter((_, i) => i !== index);\n onChange(updateKeyedFormData(newKeyedFormData), childFieldPathId.path, newErrorSchema as ErrorSchema<T[]>);\n },\n [onChange, updateKeyedFormData, childFieldPathId],\n );\n\n /** Callback handler for when the user clicks on one of the move item buttons on an existing array element. Moves the\n * row of keyed form data at the `index` to the `newIndex` in the state, and then returning `onChange()` with the\n * plain form data converted from the keyed data\n *\n * @param index - The index of the item to move\n * @param newIndex - The index to where the item is to be moved\n */\n const handleReorderItems = useCallback(\n (event: MouseEvent<HTMLButtonElement>, index: number, newIndex: number) => {\n if (event) {\n event.preventDefault();\n event.currentTarget.blur();\n }\n let newErrorSchema: ErrorSchema<T> | undefined;\n if (errorSchemaRef.current) {\n newErrorSchema = {};\n for (const idx of Object.keys(errorSchemaRef.current)) {\n const i = parseInt(idx, 10);\n if (i === index) {\n setByPath(newErrorSchema, newIndex, errorSchemaRef.current[index]);\n } else if (i === newIndex) {\n setByPath(newErrorSchema, index, errorSchemaRef.current[newIndex]);\n } else {\n setByPath(newErrorSchema, idx, errorSchemaRef.current[i]);\n }\n }\n }\n\n function reOrderArray() {\n const newKeyedFormData = keyedFormDataRef.current.slice();\n newKeyedFormData.splice(index, 1);\n newKeyedFormData.splice(newIndex, 0, keyedFormDataRef.current[index]);\n return newKeyedFormData;\n }\n const newKeyedFormData = reOrderArray();\n onChange(updateKeyedFormData(newKeyedFormData), childFieldPathId.path, newErrorSchema as ErrorSchema<T[]>);\n },\n [onChange, updateKeyedFormData, childFieldPathId],\n );\n\n /** Callback handler used to deal with changing the value of the data in the array at the `index`. Calls the\n * `onChange` callback with the updated form data\n *\n * @param index - The index of the item being changed\n */\n const handleChange = useCallback(\n (value: any, path: FieldPathList, newErrorSchema?: ErrorSchema<T>, id?: string) => {\n const lastPathIsItemIndex = typeof path.at(-1) === 'number';\n onChange(\n // We need to treat undefined items as nulls to have validation.\n // See https://github.com/tdegrunt/jsonschema/issues/206\n // Only set to null for array items, and not for object properties within array items\n lastPathIsItemIndex && value === undefined ? null : value,\n path,\n newErrorSchema as ErrorSchema<T[]>,\n id,\n );\n },\n [onChange],\n );\n\n /** Callback handler used to change the value for a checkbox */\n const onSelectChange = useCallback(\n (value: any) => {\n onChange(value, childFieldPathId.path, undefined, childFieldPathId?.[ID_KEY]);\n },\n [onChange, childFieldPathId],\n );\n\n const arrayAsMultiProps: ArrayAsFieldProps<T[], S, F> = {\n ...props,\n formData,\n fieldPathId: childFieldPathId,\n onSelectChange,\n };\n const arrayProps: InternalArrayFieldProps<T, S, F> = {\n ...props,\n handleAddItem,\n handleCopyItem,\n handleRemoveItem,\n handleReorderItems,\n keyedFormData,\n onChange: handleChange,\n };\n if (!(ITEMS_KEY in schema)) {\n if (!globalFormOptions.useFallbackUiForUnsupportedType) {\n const uiOptions = getUiOptions<T[], S, F>(uiSchema);\n const UnsupportedFieldTemplate = getTemplate<'UnsupportedFieldTemplate', T[], S, F>(\n 'UnsupportedFieldTemplate',\n registry,\n uiOptions,\n );\n\n return (\n <UnsupportedFieldTemplate\n schema={schema}\n fieldPathId={fieldPathId}\n reason={translateString(TranslatableString.MissingItems)}\n registry={registry}\n />\n );\n }\n // Add an items schema with type as undefined so it triggers FallbackField later on\n const fallbackSchema = { ...schema, [ITEMS_KEY]: { type: undefined } };\n arrayAsMultiProps.schema = fallbackSchema;\n arrayProps.schema = fallbackSchema;\n }\n if (schemaUtils.isMultiSelect(arrayAsMultiProps.schema)) {\n // If array has enum or uniqueItems set to true, call renderMultiSelect() to render the default multiselect widget or a custom widget, if specified.\n return <ArrayAsMultiSelect<T, S, F> {...arrayAsMultiProps} />;\n }\n if (isCustomWidget<T[], S, F>(uiSchema)) {\n return <ArrayAsCustomWidget<T, S, F> {...arrayAsMultiProps} />;\n }\n if (isFixedItems(arrayAsMultiProps.schema)) {\n return <FixedArray<T, S, F> {...arrayProps} />;\n }\n if (schemaUtils.isFilesArray(arrayAsMultiProps.schema, uiSchema)) {\n return <ArrayAsFiles<T, S, F> {...arrayAsMultiProps} />;\n }\n return <NormalArray<T, S, F> {...arrayProps} />;\n}\n","import { useCallback } from 'react';\nimport type {\n FieldProps,\n FormContextType,\n EnumOptionsType,\n ErrorSchema,\n RJSFSchema,\n StrictRJSFSchema,\n} from '@rjsf/utils';\nimport { getWidget, getUiOptions, isObject, optionsList, TranslatableString } from '@rjsf/utils';\n\n/** The `BooleanField` component is used to render a field in the schema is boolean. It constructs `enumOptions` for the\n * two boolean values based on the various alternatives in the schema.\n *\n * @param props - The `FieldProps` for this template\n */\nfunction BooleanField<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n props: FieldProps<T, S, F>,\n) {\n const {\n schema,\n name,\n uiSchema,\n fieldPathId,\n formData,\n registry,\n required,\n disabled,\n readonly,\n hideError,\n autofocus,\n title,\n onChange,\n onFocus,\n onBlur,\n rawErrors,\n } = props;\n const { title: schemaTitle } = schema;\n const { widgets, translateString, globalUiOptions } = registry;\n const {\n widget = 'checkbox',\n title: uiTitle,\n // Unlike the other fields, don't use `getDisplayLabel()` since it always returns false for the boolean type\n label: displayLabel = true,\n enumNames,\n ...options\n } = getUiOptions<T, S, F>(uiSchema, globalUiOptions);\n const Widget = getWidget(schema, widget, widgets);\n const yes = translateString(TranslatableString.YesLabel);\n const no = translateString(TranslatableString.NoLabel);\n let enumOptions: EnumOptionsType<S>[] | undefined;\n const label = uiTitle ?? schemaTitle ?? title ?? name;\n if (Array.isArray(schema.oneOf)) {\n enumOptions = optionsList<T, S, F>(\n {\n oneOf: schema.oneOf\n .map((option) => {\n if (isObject(option)) {\n return {\n ...option,\n title: option.title || (option.const === true ? yes : no),\n };\n }\n return undefined;\n })\n .filter((o: any) => o) as S[], // cast away the error that typescript can't grok is fixed\n } as unknown as S,\n uiSchema,\n );\n } else {\n const enums = schema.enum ?? [true, false];\n if (!enumNames && enums.length === 2 && enums.every((v: any) => typeof v === 'boolean')) {\n enumOptions = [\n {\n value: enums[0],\n label: enums[0] ? yes : no,\n },\n {\n value: enums[1],\n label: enums[1] ? yes : no,\n },\n ];\n } else {\n enumOptions = optionsList<T, S, F>({ enum: enums } as S, uiSchema);\n }\n }\n const onWidgetChange = useCallback(\n (value: T | undefined, errorSchema?: ErrorSchema, id?: string) =>\n onChange(value, fieldPathId.path, errorSchema, id),\n [onChange, fieldPathId],\n );\n\n return (\n <Widget\n options={{ ...options, enumOptions }}\n schema={schema}\n uiSchema={uiSchema}\n id={fieldPathId.$id}\n name={name}\n onChange={onWidgetChange}\n onFocus={onFocus}\n onBlur={onBlur}\n label={label}\n hideLabel={!displayLabel}\n value={formData}\n required={required}\n disabled={disabled}\n readonly={readonly}\n hideError={hideError}\n registry={registry}\n autofocus={autofocus}\n rawErrors={rawErrors}\n htmlName={fieldPathId.name}\n />\n );\n}\n\nexport default BooleanField;\n","import { useState } from 'react';\nimport type { FieldProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';\nimport { getTemplate, getUiOptions, RJSF_REF_CYCLE_KEY } from '@rjsf/utils';\n\n/** The `CyclicSchemaField` component is used to render a field in the schema that is marked with RJSF_REF_CYCLE_KEY ===\n * true\n *\n * @param props - The `FieldProps` for this template\n */\nexport default function CyclicSchemaField<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: FieldProps<T, S, F>) {\n const [expanded, setExpanded] = useState(false);\n const { name, registry, schema, uiSchema, fieldPathId } = props;\n const { globalUiOptions } = registry;\n\n const uiOptions = getUiOptions<T, S, F>(uiSchema, globalUiOptions);\n const CyclicSchemaExpandTemplate = getTemplate<'CyclicSchemaExpandTemplate', T, S, F>(\n 'CyclicSchemaExpandTemplate',\n registry,\n uiOptions,\n );\n if (!expanded) {\n return (\n <CyclicSchemaExpandTemplate\n registry={registry}\n schema={schema}\n uiSchema={uiSchema}\n name={name}\n fieldPathId={fieldPathId}\n onExpand={() => setExpanded(true)}\n />\n );\n }\n const { fields } = registry;\n const { SchemaField } = fields;\n return <SchemaField {...props} schema={{ ...schema, [RJSF_REF_CYCLE_KEY]: false }} />;\n}\n","import { useMemo, useState } from 'react';\nimport type { FallbackFieldProps, FieldPathId, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';\nimport {\n getTemplate,\n getUiOptions,\n hashObject,\n toFieldPathId,\n TranslatableString,\n useDeepCompareMemo,\n} from '@rjsf/utils';\nimport type { JSONSchema7TypeName } from 'json-schema';\n\n/**\n * Get the schema for the type selection component.\n * @param title - The translated title for the type selection schema.\n */\nfunction getFallbackTypeSelectionSchema(title: string): RJSFSchema {\n return {\n type: 'string',\n enum: ['string', 'number', 'boolean', 'object', 'array'],\n default: 'string',\n title,\n };\n}\n\n/**\n * Determines the JSON Schema type of the given formData.\n * @param formData - The form data whose type is to be determined.\n */\nfunction getTypeOfFormData(formData: any): JSONSchema7TypeName {\n const dataType = typeof formData;\n if (dataType === 'string' || dataType === 'number' || dataType === 'boolean') {\n return dataType;\n }\n if (dataType === 'object') {\n return Array.isArray(formData) ? 'array' : 'object';\n }\n // Treat everything else as a string\n return 'string';\n}\n\n/**\n * Casts the given formData to the specified type.\n * @param formData - The form data to be casted.\n * @param newType - The target type to which the form data should be casted.\n */\nfunction castToNewType<T = any>(formData: T, newType: JSONSchema7TypeName): T {\n switch (newType) {\n case 'string':\n return String(formData) as T;\n case 'number': {\n const castedNumber = Number(formData);\n return (Number.isNaN(castedNumber) ? 0 : castedNumber) as T;\n }\n case 'boolean':\n return Boolean(formData) as T;\n default:\n return formData;\n }\n}\n\n/**\n * The `FallbackField` component is used to render a field for unsupported or unknown schema types. If\n * `useFallbackUiForUnsupportedType` is enabled in the `globalUiOptions`, it provides a type selector\n */\nexport default function FallbackField<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: FallbackFieldProps<T, S, F>) {\n const {\n id,\n formData,\n displayLabel = true,\n schema,\n name,\n uiSchema,\n required,\n disabled = false,\n readonly = false,\n onBlur,\n onFocus,\n registry,\n fieldPathId,\n onChange,\n errorSchema,\n } = props;\n const { translateString, fields, globalFormOptions } = registry;\n const [type, setType] = useState<JSONSchema7TypeName>(getTypeOfFormData(formData));\n\n const uiOptions = getUiOptions<T, S, F>(uiSchema);\n\n const typeSelectorInnerFieldPathId = useDeepCompareMemo<FieldPathId>(\n toFieldPathId('__internal_type_selector', globalFormOptions, fieldPathId),\n );\n\n const schemaTitle = translateString(TranslatableString.Type);\n const typesOptionSchema = useMemo(() => getFallbackTypeSelectionSchema(schemaTitle), [schemaTitle]);\n\n const onTypeChange = (newType: T | undefined) => {\n if (newType != null) {\n setType(newType as JSONSchema7TypeName);\n onChange(castToNewType<T>(formData as T, newType as JSONSchema7TypeName), fieldPathId.path, errorSchema, id);\n }\n };\n\n if (!globalFormOptions.useFallbackUiForUnsupportedType) {\n const { reason = translateString(TranslatableString.UnknownFieldType, [String(schema.type)]) } = props;\n const UnsupportedFieldTemplate = getTemplate<'UnsupportedFieldTemplate', T, S, F>(\n 'UnsupportedFieldTemplate',\n registry,\n uiOptions,\n );\n\n return <UnsupportedFieldTemplate schema={schema} fieldPathId={fieldPathId} reason={reason} registry={registry} />;\n }\n\n const FallbackFieldTemplate = getTemplate<'FallbackFieldTemplate', T, S, F>(\n 'FallbackFieldTemplate',\n registry,\n uiOptions,\n );\n\n const { SchemaField } = fields;\n\n return (\n <FallbackFieldTemplate\n schema={schema}\n registry={registry}\n typeSelector={\n <SchemaField\n key={formData ? hashObject(formData) : '__empty__'}\n fieldPathId={typeSelectorInnerFieldPathId}\n name={`${name}__fallback_type`}\n schema={typesOptionSchema as S}\n formData={type as T}\n onChange={onTypeChange}\n onBlur={onBlur}\n onFocus={onFocus}\n registry={registry}\n hideLabel={!displayLabel}\n disabled={disabled}\n readonly={readonly}\n required={required}\n />\n }\n schemaField={\n <SchemaField\n {...props}\n schema={\n {\n type,\n title: translateString(TranslatableString.Value),\n ...(type === 'object' && { additionalProperties: true }),\n } as S\n }\n />\n }\n />\n );\n}\n","import type { ComponentType, ReactNode } from 'react';\nimport type {\n FieldProps,\n FieldPathId,\n FormContextType,\n GenericObjectType,\n RJSFSchema,\n Registry,\n StrictRJSFSchema,\n UiSchema,\n} from '@rjsf/utils';\nimport {\n getByPath,\n toPath,\n ANY_OF_KEY,\n deepEquals,\n getDiscriminatorFieldFromSchema,\n getTemplate,\n getTestIds,\n getPropertySchema,\n getUiOptions,\n hashObject,\n ID_KEY,\n isObject,\n isPlainObject,\n lookupFromFormContext,\n ONE_OF_KEY,\n PROPERTIES_KEY,\n READONLY_KEY,\n toFieldPathId,\n UI_OPTIONS_KEY,\n UI_GLOBAL_OPTIONS_KEY,\n ITEMS_KEY,\n useDeepCompareMemo,\n} from '@rjsf/utils';\n\n/** The enumeration of the three different Layout GridTemplate type values\n */\nexport enum GridType {\n ROW = 'ui:row',\n COLUMN = 'ui:col',\n COLUMNS = 'ui:columns',\n CONDITION = 'ui:condition',\n}\n\n/** The enumeration of the different operators within a condition\n */\nexport enum Operators {\n ALL = 'all',\n SOME = 'some',\n NONE = 'none',\n}\n\n/** Type used to represent an object that contains anything */\ntype ConfigObject = Record<string, any>;\n\nexport interface GridProps extends GenericObjectType {\n /** The optional operator to use when comparing a field's value with the expected value for `GridType.CONDITION`\n */\n operator?: Operators;\n /** The optional name of the field from which to get the value for `GridType.CONDITION`\n */\n field?: string;\n /** The optional expected value against which to compare the field's value using the `operator`\n */\n value?: unknown;\n}\n\nexport type GridSchemaType = Partial<Record<GridType, object>>;\n\n/** The types which comprise the possibilities for the `layoutGridSchema` prop\n */\nexport type LayoutGridSchemaType = GridSchemaType | ConfigObject | string;\n\nexport interface LayoutGridFieldProps<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n> extends FieldProps<T, S, F> {\n /** Optional string or object used to describe the current level of the `LayoutGridField`\n */\n layoutGridSchema?: LayoutGridSchemaType;\n}\n\n/** The regular expression that is used to detect whether a string contains a lookup key\n */\nexport const LOOKUP_REGEX = /^\\$lookup=(.+)/;\n\n/** The constant representing the main layout grid schema option name in the `uiSchema`\n */\nexport const LAYOUT_GRID_UI_OPTION = 'layoutGrid';\n\n/** The constant representing the main layout grid schema option name in the `uiSchema`\n */\nexport const LAYOUT_GRID_OPTION = `ui:${LAYOUT_GRID_UI_OPTION}`;\n\n/** Type used to return options list and whether it has a discriminator */\ninterface OneOfOptionsInfoType<S extends StrictRJSFSchema = RJSFSchema> {\n options: S[];\n hasDiscriminator: boolean;\n}\n\n/** Type used to represent a React-based rendering component */\ntype RenderComponent = ComponentType<any>;\n\n/** Type used to determine what are the UIComponent and props from the grid schema */\ninterface UIComponentPropsType {\n /** The name of the component */\n name: string;\n /** The render component if specified */\n UIComponent: RenderComponent | null;\n /** Any uiProps associated with the render component */\n uiProps: ConfigObject;\n /** The special case where the component is immediately rendered */\n rendered: ReactNode;\n}\n\n/** Returns either the `value` if it is non-nullish or the fallback\n *\n * @param [value] - The potential value to return if it is non-nullish\n * @param [fallback] - The fallback value to return if `value` is nullish\n * @returns - `value` if it is non-nullish otherwise `fallback`\n */\nfunction getNonNullishValue<T = unknown>(value?: T, fallback?: T): T | undefined {\n return value ?? fallback;\n}\n\n/** Detects if a `str` is made up entirely of numeric characters\n *\n * @param str - The string to check to see if it is a numeric index\n * @return - True if the string consists entirely of numeric characters\n */\nfunction isNumericIndex(str: string) {\n return /^\\d+?$/.test(str); // Matches positive integers\n}\n\nconst LAYOUT_GRID_FIELD_TEST_IDS = getTestIds();\n\n/** Computes the uiSchema for the field with `name` from the `uiProps` and `uiSchema` provided. The field UI Schema\n * will always contain a copy of the global options from the `uiSchema` (so they can be passed down) as well as\n * copying them into the local ui options. When the `forceReadonly` flag is true, then the field UI Schema is\n * updated to make \"readonly\" be true. When the `schemaReadonly` flag is true AND the field UI Schema does NOT have\n * the flag already provided, then we also make \"readonly\" true. We always make sure to return the final value of the\n * field UI Schema's \"readonly\" flag as `uiReadonly` along with the `fieldUiSchema` in the return value.\n *\n * @param field - The name of the field to pull the existing UI Schema for\n * @param uiProps - Any props that should be put into the field's uiSchema\n * @param [uiSchema] - The optional UI Schema from which to get the UI schema for the field\n * @param [schemaReadonly] - Optional flag indicating whether the schema indicates the field is readonly\n * @param [forceReadonly] - Optional flag indicating whether the Form itself is in readonly mode\n */\nexport function computeFieldUiSchema<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n field: string,\n uiProps: ConfigObject,\n uiSchema?: UiSchema<T, S, F>,\n schemaReadonly?: boolean,\n forceReadonly?: boolean,\n) {\n const globalUiOptions = uiSchema?.[UI_GLOBAL_OPTIONS_KEY] ?? {};\n const localUiSchema = getByPath<UiSchema<T, S, F> | undefined>(uiSchema, toPath(field));\n const localUiOptions = { ...(localUiSchema?.[UI_OPTIONS_KEY] ?? {}), ...uiProps, ...globalUiOptions };\n const fieldUiSchema = { ...localUiSchema };\n if (Object.keys(localUiOptions).length > 0) {\n fieldUiSchema[UI_OPTIONS_KEY] = localUiOptions;\n }\n if (Object.keys(globalUiOptions).length > 0) {\n // pass the global uiOptions down to the field uiSchema so that they can be applied to all nested fields\n fieldUiSchema[UI_GLOBAL_OPTIONS_KEY] = globalUiOptions;\n }\n let { readonly: uiReadonly } = getUiOptions<T, S, F>(fieldUiSchema);\n if (forceReadonly === true || (uiReadonly === undefined && schemaReadonly === true)) {\n // If we are forcing all widgets to be readonly, OR the schema indicates it is readonly AND the uiSchema does not\n // have an overriding value, then update the uiSchema to set readonly to true. Doing this will\n uiReadonly = true;\n const fieldUiOptions = fieldUiSchema[UI_OPTIONS_KEY];\n if (fieldUiOptions && READONLY_KEY in fieldUiOptions) {\n // If the local options has the key value provided in it, then set that one to true\n fieldUiOptions[READONLY_KEY] = true;\n } else {\n // otherwise set the `ui:` version\n fieldUiSchema[`ui:${READONLY_KEY}`] = true;\n }\n }\n return { fieldUiSchema, uiReadonly };\n}\n\n/** Given an `operator`, `datum` and `value` determines whether this condition is considered matching. Matching\n * depends on the `operator`. The `datum` and `value` are converted into arrays if they aren't already and then the\n * contents of the two arrays are compared using the `operator`. When `operator` is All, then the two arrays must be\n * equal to match. When `operator` is SOME then the intersection of the two arrays must have at least one value in\n * common to match. When `operator` is NONE then the intersection of the two arrays must not have any values in common\n * to match.\n *\n * @param [operator] - The optional operator for the condition\n * @param [datum] - The optional datum for the condition, this can be an item or a list of items of type unknown\n * @param [value='$0m3tH1nG Un3xP3cT3d'] The optional value for the condition, defaulting to a highly unlikely value\n * to avoid comparing two undefined elements when `value` was forgotten in the condition definition.\n * This can be an item or a list of items of type unknown\n * @returns - True if the condition matches, false otherwise\n */\nexport function conditionMatches(\n operator?: Operators,\n datum?: unknown,\n value: unknown = '$0m3tH1nG Un3xP3cT3d',\n): boolean {\n const data = [datum].flat().sort();\n const values = [value].flat().sort();\n switch (operator) {\n case Operators.ALL:\n return deepEquals(data, values);\n case Operators.SOME:\n return data.some((entry) => values.includes(entry));\n case Operators.NONE:\n return !data.some((entry) => values.includes(entry));\n default:\n return false;\n }\n}\n\n/** From within the `layoutGridSchema` finds the `children` and any extra `gridProps` from the object keyed by\n * `schemaKey`. If the `children` contains extra `gridProps` and those props contain a `className` string, try to\n * lookup whether that `className` has a replacement value in the `registry` using the `FORM_CONTEXT_LOOKUP_BASE`.\n * When the `className` value contains multiple classNames separated by a space, the lookup will look for a\n * replacement value for each `className` and combine them into one.\n *\n * @param layoutGridSchema - The GridSchemaType instance from which to obtain the `schemaKey` children and extra props\n * @param schemaKey - A `GridType` value, used to get the children and extra props from within the `layoutGridSchema`\n * @param registry - The `@rjsf` Registry from which to look up `classNames` if they are present in the extra props\n * @returns - An object containing the list of `LayoutGridSchemaType` `children` and any extra `gridProps`\n * @throws - A `TypeError` when the `children` is not an array\n */\nexport function findChildrenAndProps<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n layoutGridSchema: GridSchemaType,\n schemaKey: GridType,\n registry: Registry<T, S, F>,\n) {\n let gridProps: GridProps = {};\n let children = layoutGridSchema[schemaKey];\n if (isPlainObject(children)) {\n const { children: elements, className: toMapClassNames, ...otherProps } = children as ConfigObject;\n children = elements;\n if (toMapClassNames) {\n const classes = toMapClassNames.split(' ');\n const className = classes.map((ele: string) => lookupFromFormContext<T, S, F>(registry, ele, ele)).join(' ');\n gridProps = { ...otherProps, className };\n } else {\n gridProps = otherProps;\n }\n }\n if (!Array.isArray(children)) {\n throw new TypeError(`Expected array for \"${schemaKey}\" in ${JSON.stringify(layoutGridSchema)}`);\n }\n return { children: children as LayoutGridSchemaType[], gridProps };\n}\n\n/** Computes the `rawSchema` and `fieldPathId` for a `schema` and a `potentialIndex`. If the `schema` is of type array,\n * has an `ITEMS_KEY` element and `potentialIndex` represents a numeric value, the element at `ITEMS_KEY` is checked\n * to see if it is an array. If it is AND the `potentialIndex`th element is available, it is used as the `rawSchema`,\n * otherwise the last value of the element is used. If it is not, then the element is used as the `rawSchema`. In\n * either case, an `fieldPathId` is computed for the array index. If the `schema` does not represent an array or the\n * `potentialIndex` is not a numeric value, then `rawSchema` is returned as undefined and given `fieldPathId` is returned\n * as is.\n *\n * @param schema - The schema to generate the fieldPathId for\n * @param fieldPathId - The FieldPathId for the schema\n * @param potentialIndex - A string containing a potential index\n * @returns - An object containing the `rawSchema` and `fieldPathId` of an array item, otherwise an undefined `rawSchema`\n */\nexport function computeArraySchemasIfPresent<S extends StrictRJSFSchema = RJSFSchema>(\n schema: S | undefined,\n fieldPathId: FieldPathId,\n potentialIndex: string,\n): {\n rawSchema?: S;\n fieldPathId: FieldPathId;\n} {\n let rawSchema: S | undefined;\n let resultPathId = fieldPathId;\n if (isNumericIndex(potentialIndex) && schema && schema?.type === 'array' && ITEMS_KEY in schema) {\n const index = Number(potentialIndex);\n const items = schema[ITEMS_KEY];\n if (Array.isArray(items)) {\n if (index > items.length) {\n rawSchema = items.at(-1) as S;\n } else {\n rawSchema = items[index] as S;\n }\n } else {\n rawSchema = items as S;\n }\n resultPathId = {\n [ID_KEY]: fieldPathId[ID_KEY],\n path: [...fieldPathId.path.slice(0, fieldPathId.path.length - 1), index],\n };\n }\n return { rawSchema, fieldPathId: resultPathId };\n}\n\n/** Given a `dottedPath` to a field in the `initialSchema`, iterate through each individual path in the schema until\n * the leaf path is found and returned (along with whether that leaf path `isRequired`) OR no schema exists for an\n * element in the path. If the leaf schema element happens to be a oneOf/anyOf then also return the oneOf/anyOf as\n * `options`.\n *\n * @param registry - The registry\n * @param dottedPath - The dotted-path to the field for which to get the schema\n * @param initialSchema - The initial schema to start the search from\n * @param formData - The formData, useful for resolving a oneOf/anyOf selection in the path hierarchy\n * @param initialFieldIdPath - The initial fieldPathId to start the search from\n * @returns - An object containing the destination schema, isRequired and isReadonly flags for the field and options\n * info if a oneOf/anyOf\n */\nexport function getSchemaDetailsForField<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n registry: Registry<T, S, F>,\n dottedPath: string,\n initialSchema: S,\n formData: FieldProps<T, S, F>['formData'],\n initialFieldIdPath: FieldPathId,\n): {\n schema?: S;\n isRequired: boolean;\n isReadonly?: boolean;\n optionsInfo?: OneOfOptionsInfoType<S>;\n fieldPathId: FieldPathId;\n} {\n const { schemaUtils, globalFormOptions } = registry;\n let rawSchema: S = initialSchema;\n let fieldPathId = initialFieldIdPath;\n const parts: string[] = dottedPath.split('.');\n const leafPath: string | undefined = parts.pop(); // pop off the last element in the list as the leaf\n let schema: S | undefined = schemaUtils.retrieveSchema(rawSchema, formData); // always returns an object\n let innerData = formData;\n let isReadonly: boolean | undefined = schema.readOnly;\n\n // For all the remaining path parts\n parts.forEach((part) => {\n // dive into the properties of the current schema (when it exists) and get the schema for the next part\n fieldPathId = toFieldPathId(part, globalFormOptions, fieldPathId);\n const schemaProperties = schema?.[PROPERTIES_KEY];\n if (schemaProperties) {\n rawSchema = (schemaProperties[part] ?? {}) as S;\n } else if (schema && (ONE_OF_KEY in schema || ANY_OF_KEY in schema)) {\n const xxx = ONE_OF_KEY in schema ? ONE_OF_KEY : ANY_OF_KEY;\n // When the schema represents a oneOf/anyOf, find the selected schema for it and grab the inner part\n const selectedSchema = schemaUtils.findSelectedOptionInXxxOf(schema, part, xxx, innerData);\n rawSchema = getPropertySchema<S>(selectedSchema, part);\n } else {\n const result = computeArraySchemasIfPresent<S>(schema, fieldPathId, part);\n rawSchema = result.rawSchema ?? ({} as S);\n fieldPathId = result.fieldPathId;\n }\n // Now drill into the innerData for the part, returning an empty object by default if it doesn't exist\n innerData = getByPath<T>(innerData, part, {} as T);\n // Resolve any `$ref`s for the current rawSchema\n schema = schemaUtils.retrieveSchema(rawSchema, innerData);\n isReadonly = getNonNullishValue(schema.readOnly, isReadonly);\n });\n\n let optionsInfo: OneOfOptionsInfoType<S> | undefined;\n let isRequired = false;\n // retrieveSchema will return an empty schema in the worst case scenario, convert it to undefined\n if (!schema || Object.keys(schema).length === 0) {\n schema = undefined;\n }\n if (schema && leafPath) {\n // When we have both a schema and a leafPath...\n if (schema && (ONE_OF_KEY in schema || ANY_OF_KEY in schema)) {\n const xxx = ONE_OF_KEY in schema ? ONE_OF_KEY : ANY_OF_KEY;\n // Grab the selected schema for the oneOf/anyOf value for the leafPath using the innerData\n schema = schemaUtils.findSelectedOptionInXxxOf(schema, leafPath, xxx, innerData);\n }\n fieldPathId = toFieldPathId(leafPath, globalFormOptions, fieldPathId);\n isRequired = schema !== undefined && Array.isArray(schema.required) && schema.required.includes(leafPath);\n const result = computeArraySchemasIfPresent<S>(schema, fieldPathId, leafPath);\n if (result.rawSchema) {\n schema = result.rawSchema;\n fieldPathId = result.fieldPathId;\n } else {\n // Now grab the schema from the leafPath of the current schema properties\n schema = schema?.[PROPERTIES_KEY]?.[leafPath] as S | undefined;\n // Resolve any `$ref`s for the current schema\n schema = schema ? schemaUtils.retrieveSchema(schema) : schema;\n }\n isReadonly = getNonNullishValue(schema?.readOnly, isReadonly);\n if (schema && (ONE_OF_KEY in schema || ANY_OF_KEY in schema)) {\n const xxx = ONE_OF_KEY in schema ? ONE_OF_KEY : ANY_OF_KEY;\n // Set the options if we have a schema with a oneOf/anyOf\n const discriminator = getDiscriminatorFieldFromSchema(schema);\n optionsInfo = { options: schema[xxx] as S[], hasDiscriminator: !!discriminator };\n }\n }\n\n return { schema, isRequired, isReadonly, optionsInfo, fieldPathId };\n}\n\n/** Gets the custom render component from the `render`, by either determining that it is either already a function or\n * it is a non-function value that can be used to look up the function in the registry. If no function can be found,\n * null is returned.\n *\n * @param render - The potential render function or lookup name to one\n * @param registry - The `@rjsf` Registry from which to look up `classNames` if they are present in the extra props\n * @returns - Either a render function if available, or null if not\n */\nexport function getCustomRenderComponent<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(render: string | RenderComponent, registry: Registry<T, S, F>): RenderComponent | null {\n let customRenderer: string | RenderComponent | undefined = render;\n if (typeof customRenderer === 'string') {\n customRenderer = lookupFromFormContext<T, S, F, string | RenderComponent | undefined>(registry, customRenderer);\n }\n if (typeof customRenderer === 'function') {\n return customRenderer;\n }\n return null;\n}\n\n/** Extract the `name`, and optional `render` and all other props from the `gridSchema`. We look up the `render` to\n * see if can be resolved to a UIComponent. If `name` does not exist and there is an optional `render` UIComponent, we\n * set the `rendered` component with only specified props for that component in the object.\n *\n * @param registry - The `@rjsf` Registry from which to look up `classNames` if they are present in the extra props\n * @param gridSchema - The string or object that represents the configuration for the grid field\n * @returns - The UIComponentPropsType computed from the gridSchema\n */\nexport function computeUIComponentPropsFromGridSchema<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(registry: Registry<T, S, F>, gridSchema?: string | ConfigObject): UIComponentPropsType {\n let name: string;\n let UIComponent: RenderComponent | null = null;\n let uiProps: ConfigObject = {};\n let rendered: ReactNode | undefined;\n if (typeof gridSchema === 'string' || gridSchema === undefined) {\n name = gridSchema ?? '';\n } else {\n const { name: innerName = '', render, ...innerProps } = gridSchema;\n name = innerName;\n uiProps = innerProps;\n // Transform any `$lookup=` in the uiProps props with the appropriate value\n Object.entries(uiProps).forEach(([key, prop]) => {\n if (typeof prop === 'string') {\n const match: string[] | null = LOOKUP_REGEX.exec(prop);\n if (Array.isArray(match) && match.length > 1) {\n const lookupName = match[1];\n uiProps[key] = lookupFromFormContext(registry, lookupName, lookupName);\n }\n }\n });\n UIComponent = getCustomRenderComponent<T, S, F>(render, registry);\n if (!innerName && UIComponent) {\n rendered = <UIComponent {...innerProps} data-testid={LAYOUT_GRID_FIELD_TEST_IDS.uiComponent} />;\n }\n }\n return { name, UIComponent, uiProps, rendered };\n}\n\n/**\n * The props for the LayoutGridFieldChildren component.\n */\ntype LayoutGridFieldChildrenProps<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n> = LayoutGridFieldProps<T, S, F> & {\n /** The list of strings or objects that represents the configurations for the children fields */\n childrenLayoutGridSchemaId: LayoutGridSchemaType[];\n};\n\n/** Iterates through all the `childrenLayoutGridSchemaId`, rendering a nested `LayoutGridField` for each item in the\n * list, passing all the props for the current `LayoutGridField` along, updating the `schema` by calling\n * `retrieveSchema()` on it to resolve any `$ref`s. In addition to the updated `schema`, each item in\n * `childrenLayoutGridSchemaId` is passed as `layoutGridSchema`.\n *\n * @returns - The nested `LayoutGridField`s\n */\nfunction LayoutGridFieldChildren<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n props: LayoutGridFieldChildrenProps<T, S, F>,\n) {\n const { childrenLayoutGridSchemaId, ...layoutGridFieldProps } = props;\n const { registry, schema: rawSchema, formData } = layoutGridFieldProps;\n const { schemaUtils } = registry;\n const schema = schemaUtils.retrieveSchema(rawSchema, formData);\n return childrenLayoutGridSchemaId.map((layoutGridSchema) => (\n <LayoutGridField<T, S, F>\n {...layoutGridFieldProps}\n key={`layoutGrid-${hashObject(layoutGridSchema)}`}\n schema={schema}\n layoutGridSchema={layoutGridSchema}\n />\n ));\n}\n\n/**\n * Describes the props for LayoutGridCondition, LayoutGridCol, LayoutGridColumns, and LayoutGridRow. This is typically\n * the original props passed through from the nearest ancestor LayoutGridField, plus the layoutGridSchema for the\n * current node.\n */\ntype LayoutFieldProps<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n> = LayoutGridFieldProps<T, S, F> & {\n /** The string or object that represents the configuration for the grid field */\n layoutGridSchema: GridSchemaType;\n};\n\n/** Renders the `children` of the `GridType.CONDITION` if it passes. The `layoutGridSchema` for the\n * `GridType.CONDITION` is separated into the `children` and other `gridProps`. The `gridProps` are used to extract\n * the `operator`, `field` and `value` of the condition. If the condition matches, then all of the `children` are\n * rendered, otherwise null is returned.\n *\n * @returns - The rendered the children for the `GridType.CONDITION` or null\n */\nfunction LayoutGridCondition<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n props: LayoutFieldProps<T, S, F>,\n) {\n const { layoutGridSchema, ...layoutGridFieldProps } = props;\n const { formData, registry } = layoutGridFieldProps;\n const { children, gridProps } = findChildrenAndProps<T, S, F>(layoutGridSchema, GridType.CONDITION, registry);\n const { operator, field = '', value } = gridProps;\n const fieldData = getByPath(formData, toPath(field), null);\n if (conditionMatches(operator, fieldData, value)) {\n return <LayoutGridFieldChildren {...layoutGridFieldProps} childrenLayoutGridSchemaId={children} />;\n }\n return null;\n}\n\n/** Renders a `GridTemplate` as an item. The `layoutGridSchema` for the `GridType.COLUMN` is separated into the\n * `children` and other `gridProps`. The `gridProps` will be spread onto the outer `GridTemplate`. Inside the\n * `GridTemplate` all the `children` are rendered.\n *\n * @returns - The rendered `GridTemplate` containing the children for the `GridType.COLUMN`\n */\nfunction LayoutGridCol<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n props: LayoutFieldProps<T, S, F>,\n) {\n const { layoutGridSchema, ...layoutGridFieldProps } = props;\n const { registry, uiSchema } = layoutGridFieldProps;\n const { children, gridProps } = findChildrenAndProps<T, S, F>(layoutGridSchema, GridType.COLUMN, registry);\n const uiOptions = getUiOptions<T, S, F>(uiSchema);\n const GridTemplate = getTemplate<'GridTemplate', T, S, F>('GridTemplate', registry, uiOptions);\n\n return (\n <GridTemplate column data-testid={LAYOUT_GRID_FIELD_TEST_IDS.col} {...gridProps}>\n <LayoutGridFieldChildren {...layoutGridFieldProps} childrenLayoutGridSchemaId={children} />\n </GridTemplate>\n );\n}\n\n/** Renders a `GridTemplate` as an item. The `layoutGridSchema` for the `GridType.COLUMNS` is separated into the\n * `children` and other `gridProps`. The `children` is iterated on and `gridProps` will be spread onto the outer\n * `GridTemplate`. Each child will have their own rendered `GridTemplate`.\n *\n * @returns - The rendered `GridTemplate` containing the children for the `GridType.COLUMNS`\n */\nfunction LayoutGridColumns<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n props: LayoutFieldProps<T, S, F>,\n) {\n const { layoutGridSchema, ...layoutGridFieldProps } = props;\n\n const { registry, uiSchema } = layoutGridFieldProps;\n const { children, gridProps } = findChildrenAndProps<T, S, F>(layoutGridSchema, GridType.COLUMNS, registry);\n const uiOptions = getUiOptions<T, S, F>(uiSchema);\n const GridTemplate = getTemplate<'GridTemplate', T, S, F>('GridTemplate', registry, uiOptions);\n\n return children.map((child) => (\n <GridTemplate\n column\n key={`column-${hashObject(child)}`}\n data-testid={LAYOUT_GRID_FIELD_TEST_IDS.col}\n {...gridProps}\n >\n <LayoutGridFieldChildren {...layoutGridFieldProps} childrenLayoutGridSchemaId={[child]} />\n </GridTemplate>\n ));\n}\n\n/** Renders a `GridTemplate` as a container. The `layoutGridSchema` for the `GridType.ROW` is separated into the\n * `children` and other `gridProps`. The `gridProps` will be spread onto the outer `GridTemplate`. Inside of the\n * `GridTemplate` all of the `children` are rendered.\n *\n * @returns - The rendered `GridTemplate` containing the children for the `GridType.ROW`\n */\nfunction LayoutGridRow<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n props: LayoutFieldProps<T, S, F>,\n) {\n const { layoutGridSchema, ...layoutGridFieldProps } = props;\n\n const { registry, uiSchema } = layoutGridFieldProps;\n const { children, gridProps } = findChildrenAndProps<T, S, F>(layoutGridSchema, GridType.ROW, registry);\n const uiOptions = getUiOptions<T, S, F>(uiSchema);\n const GridTemplate = getTemplate<'GridTemplate', T, S, F>('GridTemplate', registry, uiOptions);\n\n return (\n <GridTemplate {...gridProps} data-testid={LAYOUT_GRID_FIELD_TEST_IDS.row}>\n <LayoutGridFieldChildren {...layoutGridFieldProps} childrenLayoutGridSchemaId={children} />\n </GridTemplate>\n );\n}\n\n/**\n * The props for the LayoutGridFieldComponent.\n */\ntype LayoutGridFieldComponentProps<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n> = LayoutGridFieldProps<T, S, F> & {\n /** The string or object that represents the configuration for the grid field */\n gridSchema?: ConfigObject | string;\n};\n\n/** Renders the field described by `gridSchema`. If `gridSchema` is not an object, then is will be assumed\n * to be the dotted-path to the field in the schema. Otherwise, we extract the `name`, and optional `render` and all\n * other props. If `name` does not exist and there is an optional `render`, we return the `render` component with only\n * specified props for that component. If `name` exists, we take the name, the initial & root schemas and the formData\n * and get the destination schema, is required state and optional oneOf/anyOf options for it. If the destination\n * schema was located along with oneOf/anyOf options then a `LayoutMultiSchemaField` will be rendered with the\n * `uiSchema`, `errorSchema`, `fieldPathId` and `formData` drilled down to the dotted-path field, spreading any other\n * props from `gridSchema` into the `ui:options`. If the destination schema located without any oneOf/anyOf options,\n * then a `SchemaField` will be rendered with the same props as mentioned in the previous sentence. If no destination\n * schema was located, but a custom render component was found, then it will be rendered with many of the non-event\n * handling props. If none of the previous render paths are valid, then a null is returned.\n *\n * @returns - One of `LayoutMultiSchemaField`, `SchemaField`, a custom render component or null, depending\n */\nfunction LayoutGridFieldComponent<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n props: LayoutGridFieldComponentProps<T, S, F>,\n) {\n const {\n gridSchema,\n schema: initialSchema,\n uiSchema,\n errorSchema,\n fieldPathId,\n onBlur,\n onFocus,\n formData,\n readonly,\n registry,\n layoutGridSchema, // Used to pull this out of otherProps since we don't want to pass it through\n ...otherProps\n } = props;\n const { onChange } = otherProps;\n const { fields } = registry;\n const { SchemaField, LayoutMultiSchemaField } = fields;\n\n const uiComponentProps = computeUIComponentPropsFromGridSchema(registry, gridSchema);\n const { name, UIComponent, uiProps } = uiComponentProps;\n const {\n schema,\n isRequired,\n isReadonly,\n optionsInfo,\n fieldPathId: fieldIdSchema,\n } = getSchemaDetailsForField<T, S, F>(registry, name, initialSchema, formData, fieldPathId);\n const memoFieldPathId = useDeepCompareMemo<FieldPathId>(fieldIdSchema);\n\n if (uiComponentProps.rendered) {\n return uiComponentProps.rendered;\n }\n\n if (schema) {\n const Field = optionsInfo?.hasDiscriminator ? LayoutMultiSchemaField : SchemaField;\n // Call this function to get the appropriate UISchema, which will always have its `readonly` state matching the\n // `uiReadonly` flag that it returns. This is done since the `SchemaField` will always defer to the `readonly`\n // state in the uiSchema over anything in the props or schema. Because we are implementing the \"readonly\" state of\n // the `Form` via the prop passed to `LayoutGridField` we need to make sure the uiSchema always has a true value\n // when it is needed\n const { fieldUiSchema, uiReadonly } = computeFieldUiSchema<T, S, F>(name, uiProps, uiSchema, isReadonly, readonly);\n const namePath = toPath(name);\n\n return (\n <Field\n data-testid={\n optionsInfo?.hasDiscriminator\n ? LAYOUT_GRID_FIELD_TEST_IDS.layoutMultiSchemaField\n : LAYOUT_GRID_FIELD_TEST_IDS.field\n }\n {...otherProps}\n name={name}\n required={isRequired}\n readonly={uiReadonly}\n schema={schema}\n uiSchema={fieldUiSchema}\n errorSchema={getByPath(errorSchema, namePath)}\n fieldPathId={memoFieldPathId}\n formData={getByPath(formData, namePath)}\n onChange={onChange}\n onBlur={onBlur}\n onFocus={onFocus}\n options={optionsInfo?.options}\n registry={registry}\n />\n );\n }\n\n if (UIComponent) {\n return (\n <UIComponent\n data-testid={LAYOUT_GRID_FIELD_TEST_IDS.uiComponent}\n {...otherProps}\n name={name}\n required={isRequired}\n formData={formData}\n readOnly={!!isReadonly || readonly}\n errorSchema={errorSchema}\n uiSchema={uiSchema}\n schema={initialSchema}\n fieldPathId={fieldPathId}\n onBlur={onBlur}\n onFocus={onFocus}\n registry={registry}\n {...uiProps}\n />\n );\n }\n return null;\n}\n\n/** The `LayoutGridField` will render a schema, uiSchema and formData combination out into a GridTemplate in the shape\n * described in the uiSchema. To define the grid to use to render the elements within a field in the schema, provide in\n * the uiSchema for that field the object contained under a `ui:layoutGrid` element. E.g. (as a JSON object):\n *\n * ```\n * {\n * \"field1\" : {\n * \"ui:field\": \"LayoutGridField\",\n * \"ui:layoutGrid\": {\n * \"ui:row\": { ... }\n * }\n * }\n * }\n * ```\n *\n * The outermost level of a `LayoutGridField` is the `ui:row` that defines the nested rows, columns, and/or condition\n * elements (i.e. \"grid elements\") in the grid. This definition is either a simple \"grid elements\" OR an object with\n * native `GridTemplate` implementation specific props and a `children` array of \"grid elements\". E.g. (as JSON objects):\n *\n * Simple `ui:row` definition, without additional `GridTemplate` props:\n * ```\n * \"ui:row\": [\n * { \"ui:row\"|\"ui:col\"|\"ui:columns\"|\"ui:condition\": ... },\n * ...\n * ]\n * ```\n *\n * Complex `ui:row` definition, with additional `GridTemplate` (this example uses @mui/material/Grid2 native props):\n * ```\n * \"ui:row\": {\n * \"spacing\": 2,\n * \"size\": { md\": 4 },\n * \"alignContent\": \"flex-start\",\n * \"className\": \"GridRow\",\n * \"children\": [\n * { \"ui:row\"|\"ui:col\"|\"ui:columns\"|\"ui:condition\": ... },\n * ...\n * ]\n * }\n * ```\n *\n * NOTE: Special note about the native `className` prop values. All className values will automatically be looked up in\n * the `formContext.lookupMap` in case they have been defined using a CSS-in-JS approach. In other words, from the\n * example above, if the `Form` was constructed with a `lookupMap` set to `{ GridRow: cssInJs.GridRowClass }`\n * then when rendered, the native `GridTemplate` will get the `className` with the value from\n * `cssInJs.GridRowClass`. This automatic lookup will happen for any of the \"grid elements\" when rendering with\n * `GridTemplate` props. If multiple className values are present, for example:\n * `{ className: 'GridRow GridColumn' }`, the classNames are split apart, looked up individually, and joined\n * together to form one className with the values from `cssInJs.GridRowClass` and `cssInJs.GridColumnClass`.\n *\n * The `ui:col` grid element is used to specify the list of columns within a grid row. A `ui:col` element can take on\n * several forms: 1) a simple list of dotted-path field names within the root field; 2) a list of objects containing the\n * dotted-path field `name` any other props that are gathered into `ui:options` for the field; 3) a list with a one-off\n * `render` functional component with or without a non-field `name` identifier and any other to-be-spread props; and\n * 4) an object with native `GridTemplate` implementation specific props and a `children` array with 1) or 2) or even a\n * nested `ui:row` or a `ui:condition` containing a `ui:row` (although this should be used carefully). E.g.\n * (as JSON objects):\n *\n * Simple `ui:col` definition, without additional `GridTemplate` props and form 1 only children:\n * ```\n * \"ui:col\": [\"innerField\", \"inner.grandChild\", ...]\n * ```\n *\n * Complicated `ui:col` definition, without additional `GridTemplate` props and form 2 only children:\n * ```\n * \"ui:col\": [\n * { \"name\": \"innerField\", \"fullWidth\": true },\n * { \"name\": \"inner.grandChild\", \"convertOther\": true },\n * ...\n * ]\n * ```\n *\n * More complicated `ui:col` definition, without additional `GridTemplate` props and form 2 children, one being a\n * one-off `render` functional component without a non-field `name` identifier\n * ```\n * \"ui:col\": [\n * \"innerField\",\n * {\n * \"render\": \"WizardNavButton\",\n * \"isNext\": true,\n * \"size\": \"large\"\n * }\n * ]\n * ```\n *\n * Most complicated `ui:col` definition, additional `GridTemplate` props and form 1, 2 and 3 children (this example\n * uses @mui/material/Grid2 native props):\n * ```\n * \"ui:col\": {\n * \"size\": { \"md\": 4 },\n * \"className\": \"GridColumn\",\n * \"children\": [\n * \"innerField\",\n * { \"name\": \"inner.grandChild\", \"convertOther\": true },\n * { \"name\": \"customRender\", \"render\": \"CustomRender\", toSpread: \"prop-value\" }\n * { \"ui:row|ui:condition\": ... }\n * ...\n * ]\n * }\n * ```\n *\n * NOTE: If a `name` prop does not exist or its value does not match any field in a schema, then it is assumed to be a\n * custom `render` component. If the `render` prop does not exist, a null render will occur. If `render` is a\n * string, its value will be looked up in the `formContext.lookupMap` first before defaulting to a null render.\n *\n * The `ui:columns` grid element is syntactic sugar to specify a set of `ui:col` columns that all share the same set of\n * native `GridTemplate` props. In other words rather than writing the following configuration that renders a\n * `<GridTemplate>` element with 3 `<GridTemplate column className=\"GridColumn col-md-4\">` nodes and 2\n * `<GridTemplate column className=\"col-md-6\">` nodes within it (one for each of the fields contained in the `children`\n * list):\n *\n * ```\n * \"ui:row\": {\n * \"children\": [\n * {\n * \"ui:col\": {\n * \"className\": \"GridColumn col-md-4\",\n * \"children\": [\"innerField\"],\n * }\n * },\n * {\n * \"ui:col\": {\n * \"className\": \"GridColumn col-md-4\",\n * \"children\": [\"inner.grandChild\"],\n * }\n * },\n * {\n * \"ui:col\": {\n * \"className\": \"GridColumn col-md-4\",\n * \"children\": [{ \"name\": \"inner.grandChild2\" }],\n * }\n * },\n * {\n * \"ui:col\": {\n * \"className\": \"col-md-6\",\n * \"children\": [\"innerField2\"],\n * }\n * },\n * {\n * \"ui:col\": {\n * \"className\": \"col-md-6\",\n * \"children\": [\"inner.grandChild3\"],\n * }\n * },\n\n * ]\n * }\n * ```\n *\n * One can write this instead:\n * ```\n * \"ui:row\": {\n * \"children\": [\n * {\n * \"ui:columns\": {\n * \"className\": \"GridColumn col-md-4\",\n * \"children\": [\"innerField\", \"inner.grandChild\", { \"name\": \"inner.grandChild2\", \"convertOther\": true }],\n * }\n * },\n * {\n * \"ui:columns\": {\n * \"className\": \"col-md-6\",\n * \"children\": [\"innerField2\", \"inner.grandChild3\"],\n * }\n * }\n * ]\n * }\n * ```\n *\n * NOTE: This syntax differs from\n * `\"ui:col\": { \"className\": \"col-md-6\", \"children\": [\"innerField2\", \"inner.grandChild3\"] }` in that\n * the `ui:col` will render the two children fields inside a single `<GridTemplate \"className\": \"col-md-6\",>`\n * element.\n *\n * The final grid element, `ui:condition`, allows for conditionally displaying \"grid elements\" within a row based on the\n * current value of a field as it relates to a (list of) hard-coded value(s). There are four elements that make up a\n * `ui:condition`: 1) the dotted-path `field` name within the root field that makes up the left-side of the condition;\n * 2) the hard-coded `value` (single or list) that makes up the right-side of the condition; 3) the `operator` that\n * controls how the left and right sides of the condition are compared; and 4) the `children` array that defines the\n * \"grid elements\" to display if the condition passes.\n *\n * A `ui:condition` uses one of three `operators` when deciding if a condition passes: 1) The `all` operator will pass\n * when the right-side and left-side contains all the same value(s); 2) the `some` operator will pass when the\n * right-side and left-side contain as least one value in common; 3) the `none` operator will pass when the right-side\n * and left-side do not contain any values in common. E.g. (as JSON objects):\n *\n * Here is how to render an if-then-else for `field2` which is an enum that has 3 known values and supports allowing\n * any other value:\n * ```\n * \"ui:row\": [\n * {\n * \"ui:condition\": {\n * \"field\": \"field2\",\n * \"operator\": \"all\",\n * \"value\": \"value1\",\n * \"children\": [\n * { \"ui:row\": [...] },\n * ],\n * }\n * },\n * {\n * \"ui:condition\": {\n * \"field\": \"field2\",\n * \"operator\": \"some\",\n * \"value\": [\"value2\", \"value3\"],\n * \"children\": [\n * { \"ui:row\": [...] },\n * ],\n * }\n * },\n * {\n * \"ui:condition\": {\n * \"field\": \"field2\",\n * \"operator\": \"none\",\n * \"value\": [\"value1\", \"value2\", \"value3\"],\n * \"children\": [\n * { \"ui:row\": [...] },\n * ],\n * }\n * }\n * ]\n * ```\n */\nexport default function LayoutGridField<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: LayoutGridFieldProps<T, S, F>) {\n /** Render the `LayoutGridField`. If there isn't a `layoutGridSchema` prop defined, then try pulling it out of the\n * `uiSchema` via `ui:LayoutGridField`. If `layoutGridSchema` is an object, then check to see if any of the properties\n * match one of the `GridType`s. If so, call the appropriate render function for the type. Otherwise, just call the\n * generic `renderField()` function with the `layoutGridSchema`.\n */\n const { uiSchema } = props;\n let { layoutGridSchema } = props;\n const uiOptions = getUiOptions<T, S, F>(uiSchema);\n if (!layoutGridSchema && LAYOUT_GRID_UI_OPTION in uiOptions && isObject(uiOptions[LAYOUT_GRID_UI_OPTION])) {\n layoutGridSchema = uiOptions[LAYOUT_GRID_UI_OPTION];\n }\n\n if (isObject(layoutGridSchema)) {\n if (GridType.ROW in layoutGridSchema) {\n return <LayoutGridRow {...props} layoutGridSchema={layoutGridSchema} />;\n }\n if (GridType.COLUMN in layoutGridSchema) {\n return <LayoutGridCol {...props} layoutGridSchema={layoutGridSchema} />;\n }\n if (GridType.COLUMNS in layoutGridSchema) {\n return <LayoutGridColumns {...props} layoutGridSchema={layoutGridSchema} />;\n }\n if (GridType.CONDITION in layoutGridSchema) {\n return <LayoutGridCondition {...props} layoutGridSchema={layoutGridSchema} />;\n }\n }\n return <LayoutGridFieldComponent {...props} gridSchema={layoutGridSchema} />;\n}\n\nLayoutGridField.TEST_IDS = LAYOUT_GRID_FIELD_TEST_IDS;\n","import type { FieldProps, FormContextType, RJSFSchema, StrictRJSFSchema, TemplatesType } from '@rjsf/utils';\nimport { getTemplate, getUiOptions, titleId } from '@rjsf/utils';\n\n/** The `LayoutHeaderField` component renders a `TitleFieldTemplate` with an `id` derived from the `fieldPathId`\n * and whether it is `required` from the props. The `title` is derived from the props as follows:\n * - If there is a title in the `uiSchema`, it is displayed\n * - Else, if there is an explicit `title` passed in the props, it is displayed\n * - Otherwise, if there is a title in the `schema`, it is displayed\n * - Finally, the `name` prop is displayed as the title\n *\n * @param props - The `LayoutHeaderField` for the component\n */\nexport default function LayoutHeaderField<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: FieldProps<T, S, F>) {\n const { fieldPathId, title, schema, uiSchema, required, registry, name } = props;\n const options = getUiOptions<T, S, F>(uiSchema, registry.globalUiOptions);\n const { title: uiTitle } = options;\n const { title: schemaTitle } = schema;\n const fieldTitle = uiTitle || title || schemaTitle || name;\n if (!fieldTitle) {\n return null;\n }\n const TitleFieldTemplate: TemplatesType<T, S, F>['TitleFieldTemplate'] = getTemplate<'TitleFieldTemplate', T, S, F>(\n 'TitleFieldTemplate',\n registry,\n options,\n );\n return (\n <TitleFieldTemplate\n id={titleId(fieldPathId)}\n title={fieldTitle}\n required={required}\n schema={schema}\n uiSchema={uiSchema}\n registry={registry}\n />\n );\n}\n","import { useState, useEffect } from 'react';\nimport type {\n EnumOptionsType,\n ErrorSchema,\n FieldProps,\n FormContextType,\n RJSFSchema,\n SchemaUtilsType,\n StrictRJSFSchema,\n UiSchema,\n} from '@rjsf/utils';\nimport {\n getByPath,\n setByPath,\n ANY_OF_KEY,\n CONST_KEY,\n DEFAULT_KEY,\n ERRORS_KEY,\n getDiscriminatorFieldFromSchema,\n hashObject,\n ID_KEY,\n ONE_OF_KEY,\n optionsList,\n PROPERTIES_KEY,\n getTemplate,\n getPropertySchema,\n getUiOptions,\n getWidget,\n noop,\n} from '@rjsf/utils';\n\n/** Gets the selected option from the list of `options`, using the `selectorField` to search inside each `option` for\n * the `properties[selectorField].default(or const)` that matches the given `value`.\n *\n * @param options - The list of schemas each representing a choice in the `oneOf`\n * @param selectorField - The name of the field that is common in all of the schemas that represents the selector field\n * @param value - The current value of the selector field from the data\n */\nexport function getSelectedOption<S extends StrictRJSFSchema = RJSFSchema>(\n options: EnumOptionsType<S>[],\n selectorField: string,\n value: unknown,\n): S | undefined {\n const defaultValue = '!@#!@$@#$!@$#';\n const schemaOptions: S[] = options.map(({ schema }) => schema!);\n return schemaOptions.find((option) => {\n const selector = option[PROPERTIES_KEY]?.[selectorField];\n const result = getByPath(selector, DEFAULT_KEY, getByPath(selector, CONST_KEY, defaultValue));\n return result === value;\n });\n}\n\n/** Computes the `enumOptions` array from the schema and options.\n *\n * @param schema - The schema that contains the `options`\n * @param options - The options from the `schema`\n * @param schemaUtils - The SchemaUtilsType object used to call retrieveSchema,\n * @param [uiSchema] - The optional uiSchema for the schema\n * @param [formData] - The optional formData associated with the schema\n * @returns - The list of enumOptions for the `schema` and `options`\n * @throws - Error when no enum options were computed\n */\nexport function computeEnumOptions<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n schema: S,\n options: S[],\n schemaUtils: SchemaUtilsType<T, S, F>,\n uiSchema?: UiSchema<T, S, F>,\n formData?: T,\n): EnumOptionsType<S>[] {\n const realOptions = options.map((opt: S) => schemaUtils.retrieveSchema(opt, formData));\n let tempSchema = schema;\n if (ONE_OF_KEY in schema) {\n tempSchema = { ...schema, [ONE_OF_KEY]: realOptions };\n } else if (ANY_OF_KEY in schema) {\n tempSchema = { ...schema, [ANY_OF_KEY]: realOptions };\n }\n const enumOptions = optionsList<T, S, F>(tempSchema, uiSchema);\n if (!enumOptions) {\n throw new Error(`No enumOptions were computed from the schema ${JSON.stringify(tempSchema)}`);\n }\n return enumOptions;\n}\n\n/** The `LayoutMultiSchemaField` is an adaptation of the `MultiSchemaField` but changed considerably to only\n * support `anyOf`/`oneOf` fields that are being displayed in a `LayoutGridField` where the field selection is shown as\n * a radio group by default. It expects that a `selectorField` is provided (either directly via the `discriminator`\n * field or indirectly via `ui:optionsSchemaSelector` in the `uiSchema`) to help determine which `anyOf`/`oneOf` schema\n * is active. If no `selectorField` is specified, then an error is thrown.\n */\nexport default function LayoutMultiSchemaField<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: FieldProps<T, S, F>) {\n const {\n name,\n baseType,\n disabled = false,\n formData,\n fieldPathId,\n onBlur,\n onChange,\n options,\n onFocus,\n registry,\n uiSchema,\n schema,\n autofocus,\n readonly,\n required,\n errorSchema,\n hideError = false,\n } = props;\n const { widgets, schemaUtils, globalUiOptions } = registry;\n const [enumOptions, setEnumOptions] = useState(computeEnumOptions(schema, options, schemaUtils, uiSchema, formData));\n const id = fieldPathId[ID_KEY];\n const discriminator = getDiscriminatorFieldFromSchema(schema);\n const FieldErrorTemplate = getTemplate<'FieldErrorTemplate', T, S, F>('FieldErrorTemplate', registry, options);\n const FieldTemplate = getTemplate<'FieldTemplate', T, S, F>('FieldTemplate', registry, options);\n const schemaHash = hashObject(schema);\n const optionsHash = hashObject(options);\n const uiSchemaHash = uiSchema ? hashObject(uiSchema) : '';\n const formDataHash = formData ? hashObject(formData) : '';\n\n useEffect(() => {\n setEnumOptions(computeEnumOptions(schema, options, schemaUtils, uiSchema, formData));\n // We are using hashes in place of the dependencies\n // oxlint-disable-next-line react-hooks/exhaustive-deps\n }, [schemaHash, optionsHash, schemaUtils, uiSchemaHash, formDataHash]);\n const {\n widget = discriminator ? 'radio' : 'select',\n title = '',\n placeholder = '',\n optionsSchemaSelector: selectorField = discriminator,\n hideError: uiSchemaHideError,\n ...uiOptions\n } = getUiOptions<T, S, F>(uiSchema);\n if (!selectorField) {\n throw new Error('No selector field provided for the LayoutMultiSchemaField');\n }\n const selectedOption = getByPath(formData, selectorField);\n let optionSchema = getPropertySchema<S>(enumOptions[0]?.schema, selectorField);\n const option = getSelectedOption<S>(enumOptions, selectorField, selectedOption);\n // If the subschema doesn't declare a type, infer the type from the parent schema\n optionSchema = optionSchema?.type ? optionSchema : ({ ...optionSchema, type: option?.type || baseType } as S);\n const Widget = getWidget<T, S, F>(optionSchema, widget, widgets);\n\n // The following code was copied from `@rjsf`'s `SchemaField`\n // Set hideError to the value provided in the uiSchema, otherwise stick with the prop to propagate to children\n const hideFieldError = uiSchemaHideError === undefined ? hideError : Boolean(uiSchemaHideError);\n\n const rawErrors = errorSchema?.[ERRORS_KEY] ?? [];\n const fieldErrorSchema = { ...errorSchema } as ErrorSchema<T>;\n delete fieldErrorSchema[ERRORS_KEY];\n const displayLabel = schemaUtils.getDisplayLabel(schema, uiSchema, globalUiOptions);\n\n /** Callback function that updates the selected option and adjusts the form data based on the structure of the new\n * option, calling the `onChange` callback with the adjusted formData.\n *\n * @param opt - If the option is undefined, we are going to clear the selection otherwise we\n * will use it as the index of the new option to select\n */\n const onOptionChange = (opt?: unknown) => {\n if (disabled || readonly) {\n return;\n }\n const newOption = getSelectedOption<S>(enumOptions, selectorField, opt);\n const oldOption = getSelectedOption<S>(enumOptions, selectorField, selectedOption);\n\n let newFormData = schemaUtils.sanitizeDataForNewSchema(newOption, oldOption, formData);\n if (newFormData && newOption) {\n // Call getDefaultFormState to make sure defaults are populated on change.\n newFormData = schemaUtils.getDefaultFormState(newOption, newFormData, 'excludeObjectChildren') as T;\n }\n if (newFormData) {\n setByPath(newFormData, selectorField, opt);\n }\n // Pass the component name in the path\n onChange(newFormData, fieldPathId.path, undefined, id);\n };\n\n // filtering the options based on the type of widget because `selectField` does not recognize the `convertOther` prop\n const widgetOptions = { enumOptions, ...uiOptions };\n const errors =\n !hideFieldError && rawErrors.length > 0 ? (\n <FieldErrorTemplate fieldPathId={fieldPathId} schema={schema} errors={rawErrors} registry={registry} />\n ) : undefined;\n\n return (\n <FieldTemplate\n fieldPathId={fieldPathId}\n id={id}\n schema={schema}\n label={(title || schema.title) ?? ''}\n disabled={disabled || (Array.isArray(enumOptions) && enumOptions.length === 0)}\n uiSchema={uiSchema}\n required={required}\n readonly={!!readonly}\n registry={registry}\n displayLabel={displayLabel}\n errors={errors}\n onChange={onChange}\n onKeyRename={noop}\n onKeyRenameBlur={noop}\n onRemoveProperty={noop}\n >\n <Widget\n id={id}\n name={name}\n schema={schema}\n label={(title || schema.title) ?? ''}\n disabled={disabled || (Array.isArray(enumOptions) && enumOptions.length === 0)}\n uiSchema={uiSchema}\n autofocus={autofocus}\n readonly={readonly}\n required={required}\n registry={registry}\n multiple={false}\n rawErrors={rawErrors}\n hideError={hideFieldError}\n hideLabel={!displayLabel}\n errorSchema={fieldErrorSchema}\n placeholder={placeholder}\n onChange={onOptionChange}\n onBlur={onBlur}\n onFocus={onFocus}\n value={selectedOption}\n options={widgetOptions}\n htmlName={fieldPathId.name}\n />\n </FieldTemplate>\n );\n}\n","import { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport type { ErrorSchema, FieldProps, FormContextType, RJSFSchema, StrictRJSFSchema, UiSchema } from '@rjsf/utils';\nimport {\n ANY_OF_KEY,\n deepEquals,\n ERRORS_KEY,\n getDiscriminatorFieldFromSchema,\n getTemplate,\n getUiOptions,\n getWidget,\n hashObject,\n isFormDataAvailable,\n mergeSchemas,\n ONE_OF_KEY,\n shouldRenderOptionalField,\n TranslatableString,\n} from '@rjsf/utils';\n\n/** The `AnyOfField` component is used to render a field in the schema that is an `anyOf`, `allOf` or `oneOf`. It tracks\n * the currently selected option and cleans up any irrelevant data in `formData`.\n *\n * @param props - The `FieldProps` for this template\n */\nfunction AnyOfField<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n props: FieldProps<T, S, F>,\n) {\n const {\n name,\n disabled = false,\n errorSchema,\n formData,\n fieldPathId,\n onBlur,\n onChange,\n onFocus,\n options,\n readonly,\n registry,\n required = false,\n schema,\n uiSchema,\n } = props;\n const { schemaUtils } = registry;\n\n // Hash formData by value so the memo only invalidates when data actually changes, not on every\n // new object reference. hashObject(undefined) throws, so null is used as the fallback.\n const formDataHash = hashObject(formData ?? null);\n\n // retrievedOptions is purely derived from options — useMemo handles re-derivation automatically\n // when options, schemaUtils, or formData's value changes, with no render-phase dispatch needed.\n const retrievedOptions = useMemo(\n () => options.map((opt: S) => schemaUtils.retrieveSchema(opt, formData)),\n // oxlint-disable-next-line react-hooks/exhaustive-deps -- formDataHash is the value-stable proxy for formData\n [options, schemaUtils, formDataHash],\n );\n\n const [selectedOption, setSelectedOption] = useState<number>(() => {\n const discriminator = getDiscriminatorFieldFromSchema<S>(schema);\n return schemaUtils.getClosestMatchingOption(formData, retrievedOptions, 0, discriminator);\n });\n\n /** Flag to skip the formData-change-driven option recalculation when the user just selected an option.\n * Set to true in onOptionChange (before onChange is called), consumed and reset in the update effect.\n * This prevents the matching-option recalculation from overriding a user's explicit choice when\n * getDefaultFormState populates undefined properties that make deepEquals see a false formData change.\n */\n const skipNextOptionRecalculation = useRef(false);\n const prevFormDataRef = useRef<T | undefined>(formData);\n const prevFieldIdRef = useRef(fieldPathId.$id);\n\n // Mirrors componentDidUpdate: re-match selectedOption when formData changes on the same field.\n // Runs after every render (no deps array) to compare against prev values stored in refs.\n // oxlint-disable-next-line react-hooks/exhaustive-deps\n useEffect(() => {\n const prevFormData = prevFormDataRef.current;\n const prevFieldId = prevFieldIdRef.current;\n prevFormDataRef.current = formData;\n prevFieldIdRef.current = fieldPathId.$id;\n\n if (!deepEquals(formData, prevFormData) && fieldPathId.$id === prevFieldId) {\n if (skipNextOptionRecalculation.current) {\n skipNextOptionRecalculation.current = false;\n return;\n }\n const discriminator = getDiscriminatorFieldFromSchema<S>(schema);\n const matchingOption = schemaUtils.getClosestMatchingOption(\n formData,\n retrievedOptions,\n selectedOption,\n discriminator,\n );\n if (matchingOption !== selectedOption) {\n setSelectedOption(matchingOption);\n }\n }\n });\n\n const fieldId = `${fieldPathId.$id}${schema.oneOf ? '__oneof_select' : '__anyof_select'}`;\n\n /** Callback handler to remember what the currently selected option is. In addition to that the `formData` is updated\n * to remove properties that are not part of the newly selected option schema, and then the updated data is passed to\n * the `onChange` handler.\n *\n * @param option - The new option value being selected\n */\n const onOptionChange = useCallback(\n (option?: string) => {\n if (disabled || readonly) {\n return;\n }\n const intOption = option !== undefined ? parseInt(option, 10) : -1;\n if (intOption === selectedOption) {\n return;\n }\n const newOption = intOption >= 0 ? retrievedOptions[intOption] : undefined;\n const oldOption = selectedOption >= 0 ? retrievedOptions[selectedOption] : undefined;\n\n let newFormData = schemaUtils.sanitizeDataForNewSchema(newOption, oldOption, formData);\n if (newOption) {\n // Call getDefaultFormState to make sure defaults are populated on change. Pass \"excludeObjectChildren\"\n // so that only the root objects themselves are created without adding undefined children properties\n newFormData = schemaUtils.getDefaultFormState(newOption, newFormData, 'excludeObjectChildren') as T;\n }\n\n setSelectedOption(intOption);\n skipNextOptionRecalculation.current = true;\n onChange(newFormData, fieldPathId.path, undefined, fieldId);\n },\n // setSelectedOption is stable (guaranteed by useState); skipNextOptionRecalculation is a ref\n [selectedOption, retrievedOptions, disabled, readonly, schemaUtils, formData, fieldPathId, onChange, fieldId],\n );\n\n const { widgets, fields, translateString, globalUiOptions } = registry;\n const { SchemaField: SchemaFieldComponent } = fields;\n const MultiSchemaFieldTemplate = getTemplate<'MultiSchemaFieldTemplate', T, S, F>(\n 'MultiSchemaFieldTemplate',\n registry,\n globalUiOptions,\n );\n const isOptionalRender = shouldRenderOptionalField<T, S, F>(registry, schema, required, uiSchema);\n const hasFormData = isFormDataAvailable<T>(formData);\n\n const {\n widget = 'select',\n placeholder,\n autofocus,\n autocomplete,\n title = schema.title,\n ...uiOptions\n } = getUiOptions<T, S, F>(uiSchema, globalUiOptions);\n const Widget = getWidget<T, S, F>({ type: 'number' }, widget, widgets);\n const rawErrors = errorSchema?.[ERRORS_KEY] ?? [];\n const fieldErrorSchema = { ...errorSchema } as ErrorSchema<T>;\n delete fieldErrorSchema[ERRORS_KEY];\n const displayLabel = schemaUtils.getDisplayLabel(schema, uiSchema, globalUiOptions);\n\n const option = selectedOption >= 0 ? retrievedOptions[selectedOption] || null : null;\n let optionSchema: S | undefined | null;\n\n if (option) {\n const { required: schemaRequired, type: schemaType } = schema;\n const parentProps: Partial<S> = {};\n if (schemaRequired) {\n parentProps.required = schemaRequired as S['required'];\n }\n // Propagate the parent schema type to options that don't define their own.\n // This is necessary when the parent constrains the type (e.g. { type: 'string',\n // oneOf: [{ pattern: '...' }, { pattern: '...' }] }) but the option sub-schemas\n // omit the type — without it, getSchemaType returns undefined and the option\n // renders as FallbackField instead of the correct widget (e.g. StringField).\n if (schemaType !== undefined && !('type' in option)) {\n parentProps.type = schemaType;\n }\n // Merge in all the non-oneOf/anyOf properties and also skip the special ADDITIONAL_PROPERTY_FLAG property\n optionSchema = Object.keys(parentProps).length > 0 ? (mergeSchemas(parentProps, option) as S) : option;\n }\n\n // First we will check to see if there is an anyOf/oneOf override for the UI schema\n let optionsUiSchema: UiSchema<T, S, F>[] = [];\n if (ONE_OF_KEY in schema && uiSchema && ONE_OF_KEY in uiSchema) {\n if (Array.isArray(uiSchema[ONE_OF_KEY])) {\n optionsUiSchema = uiSchema[ONE_OF_KEY];\n } else {\n // oxlint-disable-next-line no-console\n console.warn(`uiSchema.oneOf is not an array for \"${title || name}\"`);\n }\n } else if (ANY_OF_KEY in schema && uiSchema && ANY_OF_KEY in uiSchema) {\n if (Array.isArray(uiSchema[ANY_OF_KEY])) {\n optionsUiSchema = uiSchema[ANY_OF_KEY];\n } else {\n // oxlint-disable-next-line no-console\n console.warn(`uiSchema.anyOf is not an array for \"${title || name}\"`);\n }\n }\n // Then we pick the one that matches the selected option index, if one exists otherwise default to the main uiSchema\n let optionUiSchema = uiSchema;\n if (selectedOption >= 0 && optionsUiSchema.length > selectedOption) {\n optionUiSchema = optionsUiSchema[selectedOption];\n }\n\n const translateEnum: TranslatableString = title\n ? TranslatableString.TitleOptionPrefix\n : TranslatableString.OptionPrefix;\n const translateParams = title ? [title] : [];\n const enumOptions = retrievedOptions.map((opt: { title?: string }, index: number) => {\n const { title: uiTitle = opt.title } = getUiOptions<T, S, F>(optionsUiSchema[index]);\n return {\n label: uiTitle || translateString(translateEnum, translateParams.concat(String(index + 1))),\n value: index,\n };\n });\n\n const selector =\n !isOptionalRender || hasFormData ? (\n <Widget\n id={fieldId}\n name={`${name}${schema.oneOf ? '__oneof_select' : '__anyof_select'}`}\n schema={{ type: 'number', default: 0 } as S}\n onChange={onOptionChange}\n onBlur={onBlur}\n onFocus={onFocus}\n disabled={disabled || enumOptions.length === 0}\n multiple={false}\n rawErrors={rawErrors}\n errorSchema={fieldErrorSchema}\n value={selectedOption >= 0 ? selectedOption : undefined}\n options={{ enumOptions, ...uiOptions }}\n registry={registry}\n placeholder={placeholder}\n autocomplete={autocomplete}\n autofocus={autofocus}\n label={title ?? name}\n hideLabel={!displayLabel}\n readonly={readonly}\n />\n ) : undefined;\n\n const optionsSchemaField =\n (optionSchema && optionSchema.type !== 'null' && (\n <SchemaFieldComponent {...props} schema={optionSchema} uiSchema={optionUiSchema} />\n )) ||\n null;\n\n return (\n <MultiSchemaFieldTemplate\n schema={schema}\n registry={registry}\n uiSchema={uiSchema}\n selector={selector}\n optionSchemaField={optionsSchemaField}\n />\n );\n}\n\nexport default AnyOfField;\n","import { useEffect } from 'react';\nimport type { FieldProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';\n\n/** The `NullField` component is used to render a field in the schema is null. It also ensures that the `formData` is\n * also set to null if it has no value.\n *\n * @param props - The `FieldProps` for this template\n */\nfunction NullField<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n props: FieldProps<T, S, F>,\n) {\n const { formData, onChange, fieldPathId } = props;\n useEffect(() => {\n if (formData === undefined) {\n onChange(null as unknown as T, fieldPathId.path);\n }\n }, [fieldPathId, formData, onChange]);\n\n return null;\n}\n\nexport default NullField;\n","import { useState, useCallback } from 'react';\nimport type {\n ErrorSchema,\n FieldPathList,\n FieldProps,\n FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n} from '@rjsf/utils';\nimport { asNumber, getDecimalSeparator, getUiOptions, optionsList } from '@rjsf/utils';\n\n// Static matchers for standard '.' separator used during normalization inside handleChange\nconst trailingCharMatcherWithPrefix = /\\.([0-9]*0)*$/;\nconst trailingCharMatcher = /[0.]0*$/;\n\n/**\n * The NumberField class has some special handling for dealing with trailing\n * decimal points and/or zeroes. This logic is designed to allow trailing values\n * to be visible in the input element, but not be represented in the\n * corresponding form data.\n *\n * The algorithm is as follows:\n *\n * 1. When the input value changes the value is cached in the component state\n *\n * 2. The value is then normalized, removing trailing decimal points and zeros,\n * then passed to the \"onChange\" callback\n *\n * 3. When the component is rendered, the formData value is checked against the\n * value cached in the state. If it matches the cached value, the cached\n * value is passed to the input instead of the formData value\n */\nfunction NumberField<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n props: FieldProps<T, S, F>,\n) {\n const { registry, onChange, formData, value: initialValue } = props;\n const [lastValue, setLastValue] = useState(initialValue);\n const { StringField } = registry.fields;\n\n const separator = getDecimalSeparator();\n const escapedSeparator = separator === '.' ? '\\\\.' : separator;\n\n let value = formData;\n\n /** Handle the change from the `StringField` to properly convert to a number\n *\n * @param value - The current value for the change occurring\n */\n const handleChange = useCallback(\n (newValue: FieldProps<T, S, F>['value'], path: FieldPathList, errorSchema?: ErrorSchema<T>, id?: string) => {\n // Cache the original value in component state\n setLastValue(newValue);\n\n // Convert locale separator to standard '.' first\n const standardValue = typeof newValue === 'string' ? newValue.replace(separator, '.') : newValue;\n\n // Normalize decimals that don't start with a zero character in advance so\n // that the rest of the normalization logic is simpler\n const normalizedValue = `${standardValue}`.startsWith('.') ? `0${standardValue}` : standardValue;\n\n // Check that the value is a string (this can happen if the widget used is a\n // <select>, due to an enum declaration etc) then, if the value ends in a\n // trailing decimal point or multiple zeroes, strip the trailing values\n const processed =\n typeof normalizedValue === 'string' && trailingCharMatcherWithPrefix.exec(normalizedValue)\n ? asNumber(normalizedValue.replace(trailingCharMatcher, ''))\n : asNumber(normalizedValue);\n\n onChange(processed as unknown as T, path, errorSchema, id);\n },\n [onChange, separator],\n );\n\n if (typeof lastValue === 'string' && typeof value === 'number') {\n // Construct a regular expression that checks for a string that consists\n // of the formData value suffixed with zero or one locale separator characters and zero\n // or more '0' characters\n const re = new RegExp(`^(${String(value).replace('.', escapedSeparator)})?${escapedSeparator}?0*$`);\n\n // If the cached \"lastValue\" is a match, use that instead of the formData\n // value to prevent the input value from changing in the UI\n if (lastValue.match(re)) {\n value = lastValue as unknown as T;\n }\n }\n\n // Format value to use the locale separator for rendering if it is a number\n let displayValue: T | undefined = value;\n if (typeof value === 'number' && separator !== '.') {\n const { schema, uiSchema } = props;\n const { schemaUtils } = registry;\n const enumOptions = schemaUtils.isSelect(schema) ? optionsList(schema, uiSchema) : undefined;\n const defaultWidget = enumOptions ? 'select' : 'text';\n const { widget = defaultWidget } = getUiOptions(uiSchema);\n\n // Do not convert the value to a locale-specific string for radio, select,\n // or hidden widgets because option matching relies on the original numeric value.\n if (widget !== 'radio' && widget !== 'select' && widget !== 'hidden') {\n displayValue = String(value).replace('.', separator) as unknown as T;\n }\n }\n\n return <StringField {...props} formData={displayValue} onChange={handleChange} />;\n}\n\nexport default NumberField;\n","import type { FocusEvent } from 'react';\nimport { memo, useCallback, useMemo, useRef, useState } from 'react';\nimport type {\n ErrorSchema,\n FieldPathId,\n FieldPathList,\n FieldProps,\n FormContextType,\n GenericObjectType,\n Registry,\n RJSFMarkedSchema,\n RJSFSchema,\n StrictRJSFSchema,\n} from '@rjsf/utils';\nimport {\n getByPath,\n hasByPath,\n setByPath,\n ADDITIONAL_PROPERTY_FLAG,\n ANY_OF_KEY,\n deepEquals,\n getTemplate,\n getPropertySchema,\n getUiOptions,\n isFormDataAvailable,\n orderProperties,\n shouldRenderOptionalField,\n toFieldPathId,\n useDeepCompareMemo,\n ONE_OF_KEY,\n REF_KEY,\n isObject,\n TranslatableString,\n} from '@rjsf/utils';\nimport { Markdown } from 'markdown-to-jsx/react';\n\nimport { ADDITIONAL_PROPERTY_KEY_REMOVE } from '../constants.ts';\n\n/** Returns a flag indicating whether the `name` field is required in the object schema\n *\n * @param schema - The schema to check\n * @param name - The name of the field to check for required-ness\n * @returns - True if the field `name` is required, false otherwise\n */\nfunction isRequired<S extends StrictRJSFSchema = RJSFSchema>(schema: S, name: string) {\n return Array.isArray(schema.required) && schema.required.includes(name);\n}\n\n/** Returns a default value to be used for a new additional schema property of the given `type`\n *\n * @param translateString - The string translation function from the registry\n * @param type - The type of the new additional schema property\n */\nfunction getDefaultValue<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n translateString: Registry<T, S, F>['translateString'],\n type?: RJSFSchema['type'],\n) {\n switch (type) {\n case 'array':\n return [];\n case 'boolean':\n return false;\n case 'null':\n return null;\n case 'number':\n return 0;\n case 'object':\n return {};\n case 'string':\n default:\n // We don't have a datatype for some reason (perhaps additionalProperties was true)\n return translateString(TranslatableString.NewStringDefault);\n }\n}\n\nfunction isAdditionalPropertySchema(schema: unknown) {\n return Boolean((schema as RJSFMarkedSchema)?.[ADDITIONAL_PROPERTY_FLAG]);\n}\n\nfunction getAdditionalPropertyOrder<S extends StrictRJSFSchema = RJSFSchema>(\n schemaProperties: NonNullable<S['properties']>,\n) {\n return Object.keys(schemaProperties).filter((property) => isAdditionalPropertySchema(schemaProperties[property]));\n}\n\n/** Props for the `ObjectFieldProperty` component */\ninterface ObjectFieldPropertyProps<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n> extends Omit<FieldProps<T, S, F>, 'name'> {\n /** The name of the property within the parent object */\n propertyName: string;\n /** Flag indicating whether this property was added by the additionalProperties UI */\n addedByAdditionalProperties: boolean;\n /** Callback that handles the rename of an additionalProperties-based property key */\n handleKeyRename: (oldKey: string, newKey: string) => void;\n /** Callback that handles the removal of an additionalProperties-based property with key */\n handleRemoveProperty: (keyName: string) => void;\n}\n\n/** The `ObjectFieldProperty` component is used to render the `SchemaField` for a child property of an object\n */\nfunction ObjectFieldPropertyFn<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n props: ObjectFieldPropertyProps<T, S, F>,\n) {\n const {\n fieldPathId,\n schema,\n registry,\n uiSchema,\n errorSchema,\n formData,\n onChange,\n onBlur,\n onFocus,\n disabled,\n readonly,\n required,\n hideError,\n propertyName,\n handleKeyRename,\n handleRemoveProperty,\n addedByAdditionalProperties,\n } = props;\n const [wasPropertyKeyModified, setWasPropertyKeyModified] = useState(false);\n const { globalFormOptions, fields } = registry;\n const { SchemaField } = fields;\n const innerFieldIdPathId = useDeepCompareMemo<FieldPathId>(\n toFieldPathId(propertyName, globalFormOptions, fieldPathId.path),\n );\n\n /** The `onChange` handler installed on this property's `SchemaField`. Handles the special case where the user\n * clears a value at this property's own path when it was added as an additional property, coercing `undefined`\n * to the empty string so the property's key input survives. Every other change, including any change to a\n * descendant of this property, is forwarded to `onChange()` untouched.\n */\n const onPropertyChange = useCallback(\n (value: T | undefined, path: FieldPathList, newErrorSchema?: ErrorSchema<T>, id?: string) => {\n // An `additionalProperties` value lives at this property's own path, so clearing its widget to `undefined`\n // would drop the key from the formData and take the key input with it. Coerce that one case to the empty\n // string.\n // A descendant's path is this property's path plus at least one segment, so comparing to this\n // property's own path (rather than merely its length) tells apart \"this property changed\" from \"a\n // descendant changed\"; a cleared descendant must stay `undefined` so it is omitted from the formData\n // exactly like a cleared property declared in `properties` (#5222).\n let normalizedValue = value;\n if (value === undefined && addedByAdditionalProperties && deepEquals(path, innerFieldIdPathId.path)) {\n normalizedValue = '' as unknown as T;\n }\n onChange(normalizedValue, path, newErrorSchema, id);\n },\n [onChange, addedByAdditionalProperties, innerFieldIdPathId],\n );\n\n /** The key change event handler; Called when the key associated with a field is changed for an additionalProperty.\n * simply returns a function that call the `handleKeyChange()` event with the value\n */\n const onKeyRename = useCallback(\n (value: string) => {\n if (propertyName !== value) {\n setWasPropertyKeyModified(true);\n }\n handleKeyRename(propertyName, value);\n },\n [propertyName, handleKeyRename],\n );\n\n /** Returns a callback the handle the blur event, getting the value from the target and passing that along to the\n * `handleKeyChange` function\n */\n const onKeyRenameBlur = useCallback(\n (event: FocusEvent<HTMLInputElement>) => {\n const {\n target: { value },\n } = event;\n onKeyRename(value);\n },\n [onKeyRename],\n );\n\n /** The property drop/removal event handler; Called when a field is removed in an additionalProperty context\n */\n const onRemoveProperty = useCallback(() => {\n handleRemoveProperty(propertyName);\n }, [propertyName, handleRemoveProperty]);\n\n return (\n <SchemaField\n name={propertyName}\n required={required}\n schema={schema}\n uiSchema={uiSchema}\n errorSchema={errorSchema}\n fieldPathId={innerFieldIdPathId}\n formData={formData}\n wasPropertyKeyModified={wasPropertyKeyModified}\n onKeyRename={onKeyRename}\n onKeyRenameBlur={onKeyRenameBlur}\n onRemoveProperty={onRemoveProperty}\n onChange={onPropertyChange}\n onBlur={onBlur}\n onFocus={onFocus}\n registry={registry}\n disabled={disabled}\n readonly={readonly}\n hideError={hideError}\n />\n );\n}\n\nconst ObjectFieldProperty = memo(ObjectFieldPropertyFn) as typeof ObjectFieldPropertyFn;\n\n/** The `ObjectField` component is used to render a field in the schema that is of type `object`. It tracks whether an\n * additional property key was modified and what it was modified to\n *\n * @param props - The `FieldProps` for this template\n */\nexport default function ObjectField<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n props: FieldProps<T, S, F>,\n) {\n const {\n schema: rawSchema,\n uiSchema = {},\n formData,\n errorSchema,\n fieldPathId,\n name,\n required = false,\n disabled,\n readonly,\n hideError,\n onBlur,\n onFocus,\n onChange,\n registry,\n title,\n } = props;\n const { fields, schemaUtils, translateString, globalUiOptions } = registry;\n const { OptionalDataControlsField } = fields;\n const formDataRef = useRef(formData);\n formDataRef.current = formData;\n const schema: S = useMemo(\n () => schemaUtils.retrieveSchema(rawSchema, formData, true),\n [schemaUtils, rawSchema, formData],\n );\n const uiOptions = useMemo(() => getUiOptions<T, S, F>(uiSchema, globalUiOptions), [uiSchema, globalUiOptions]);\n const schemaProperties = useMemo(() => schema.properties ?? {}, [schema.properties]);\n // All the children will use childFieldPathId if present in the props, falling back to the fieldPathId\n const childFieldPathId = props.childFieldPathId ?? fieldPathId;\n const lastRenamedProperty = useRef({ previousKey: '', currentKey: undefined as string | undefined });\n const [additionalPropertyOrder, setAdditionalPropertyOrder] = useState(() =>\n getAdditionalPropertyOrder<S>(schemaProperties),\n );\n const definedPropertyOrder = useMemo(() => {\n const additionalPropertySet = new Set(getAdditionalPropertyOrder<S>(schemaProperties));\n return Object.keys(schemaProperties).filter((property) => !additionalPropertySet.has(property));\n }, [schemaProperties]);\n\n const templateTitle = uiOptions.title ?? schema.title ?? title ?? name;\n const description = uiOptions.description ?? schema.description;\n const renderOptionalField = shouldRenderOptionalField<T, S, F>(registry, schema, required, uiSchema);\n const hasFormData = isFormDataAvailable<T>(formData);\n let orderedProperties: string[] = [];\n\n /** Computes the next available key name from the `preferredKey`, indexing through the already existing keys until one\n * that is already not assigned is found.\n *\n * @param preferredKey - The preferred name of a new key\n * @param [formData] - The form data in which to check if the desired key already exists\n * @returns - The name of the next available key from `preferredKey`\n */\n const getAvailableKey = useCallback(\n (preferredKey: string, existingFormData?: T) => {\n const { duplicateKeySuffixSeparator = '-' } = getUiOptions<T, S, F>(uiSchema, globalUiOptions);\n\n let index = 0;\n let newKey = preferredKey;\n while (hasByPath(existingFormData, newKey)) {\n index += 1;\n newKey = `${preferredKey}${duplicateKeySuffixSeparator}${index}`;\n }\n return newKey;\n },\n [uiSchema, globalUiOptions],\n );\n\n /** Handles the adding of a new additional property on the given `schema`. Calls the `onChange` callback once the new\n * default data for that field has been added to the formData.\n */\n const onAddProperty = useCallback(() => {\n if (!(schema.additionalProperties || schema.patternProperties)) {\n return;\n }\n const newFormData = { ...formData } as T;\n const newKey = getAvailableKey('newKey', newFormData);\n if (schema.patternProperties) {\n setByPath(newFormData, newKey, null);\n } else {\n let type: RJSFSchema['type'] = undefined;\n let constValue: RJSFSchema['const'] = undefined;\n let defaultValue: RJSFSchema['default'] = undefined;\n if (isObject(schema.additionalProperties)) {\n type = schema.additionalProperties.type;\n constValue = schema.additionalProperties.const;\n defaultValue = schema.additionalProperties.default;\n let apSchema = schema.additionalProperties;\n if (REF_KEY in apSchema) {\n apSchema = schemaUtils.retrieveSchema({ [REF_KEY]: apSchema[REF_KEY] } as S, formData);\n type = apSchema.type;\n constValue = apSchema.const;\n defaultValue = schemaUtils.getDefaultFormState(apSchema as S, defaultValue as T) as RJSFSchema['default'];\n }\n if (!type && (ANY_OF_KEY in apSchema || ONE_OF_KEY in apSchema)) {\n type = 'object';\n }\n }\n\n const newValue = constValue ?? defaultValue ?? getDefaultValue<T, S, F>(translateString, type);\n setByPath(newFormData, newKey, newValue);\n }\n\n if (lastRenamedProperty.current.previousKey === newKey) {\n lastRenamedProperty.current.currentKey = newKey;\n lastRenamedProperty.current.previousKey = getAvailableKey(newKey, newFormData);\n }\n setAdditionalPropertyOrder((order) => [...order, newKey]);\n onChange(newFormData, childFieldPathId.path);\n }, [formData, onChange, translateString, schemaUtils, childFieldPathId, getAvailableKey, schema]);\n\n /** Returns a callback function that deals with the rename of a key for an additional property for a schema. That\n * callback will attempt to rename the key and move the existing data to that key, calling `onChange` when it does.\n *\n * @param oldKey - The old key for the field\n * @param newKey - The new key for the field\n * @returns - The key change callback function\n */\n const handleKeyRename = useCallback(\n (oldKey: string, newKey: string) => {\n if (oldKey !== newKey) {\n const currentFormData = formDataRef.current;\n const actualNewKey = getAvailableKey(newKey, currentFormData);\n const newFormData: GenericObjectType = {\n ...(currentFormData as GenericObjectType),\n };\n const newKeys: GenericObjectType = { [oldKey]: actualNewKey };\n const keyValues = Object.keys(newFormData).map((key) => {\n // `Object.hasOwn` so a falsy rename target (e.g. `\"\"`) isn't dropped.\n const mappedKey = Object.hasOwn(newKeys, key) ? newKeys[key] : key;\n return { [mappedKey]: newFormData[key] };\n });\n const renamedObj = Object.assign({}, ...keyValues);\n\n formDataRef.current = renamedObj as T;\n if (oldKey !== lastRenamedProperty.current.currentKey) {\n lastRenamedProperty.current.previousKey = oldKey;\n }\n lastRenamedProperty.current.currentKey = actualNewKey;\n setAdditionalPropertyOrder((order) => order.map((property) => (property === oldKey ? actualNewKey : property)));\n onChange(renamedObj, childFieldPathId.path);\n }\n },\n [onChange, childFieldPathId, getAvailableKey],\n );\n\n /** Handles the remove click which calls the `onChange` callback with the special ADDITIONAL_PROPERTY_FIELD_REMOVE\n * value for the path plus the key to be removed\n */\n const handleRemoveProperty = useCallback(\n (key: string) => {\n setAdditionalPropertyOrder((order) => order.filter((property) => property !== key));\n onChange(ADDITIONAL_PROPERTY_KEY_REMOVE as T, [...childFieldPathId.path, key]);\n },\n [onChange, childFieldPathId],\n );\n\n /** Returns the stable React key for a property. For the most recently renamed\n * additional property, returns the previous key so that React reuses the\n * existing component instance instead of unmounting/remounting it. This\n * preserves DOM focus naturally without manual focus management.\n */\n const getStableKey = useCallback((property: string) => {\n if (lastRenamedProperty.current.currentKey === property) {\n return lastRenamedProperty.current.previousKey;\n }\n return property;\n }, []);\n\n if (!renderOptionalField || hasFormData) {\n try {\n const definedPropertySet = new Set(definedPropertyOrder);\n const currentAdditionalProperties = additionalPropertyOrder.filter(\n (property) => Object.hasOwn(schemaProperties, property) && !definedPropertySet.has(property),\n );\n orderedProperties = orderProperties([...definedPropertyOrder, ...currentAdditionalProperties], uiOptions.order);\n } catch (err) {\n return (\n <div>\n <p className='rjsf-config-error' style={{ color: 'red' }}>\n <Markdown options={{ disableParsingRawHTML: true }}>\n {translateString(TranslatableString.InvalidObjectField, [name || 'root', (err as Error).message])}\n </Markdown>\n </p>\n <pre>{JSON.stringify(schema)}</pre>\n </div>\n );\n }\n }\n\n const Template = getTemplate<'ObjectFieldTemplate', T, S, F>('ObjectFieldTemplate', registry, uiOptions);\n const optionalDataControl = renderOptionalField ? (\n <OptionalDataControlsField {...props} fieldPathId={childFieldPathId} schema={schema} />\n ) : undefined;\n\n const templateProps = {\n // getDisplayLabel() always returns false for object types, so just check the `uiOptions.label`\n title: uiOptions.label === false ? '' : templateTitle,\n description: uiOptions.label === false ? undefined : description,\n properties: orderedProperties.map((propertyName) => {\n const addedByAdditionalProperties = isAdditionalPropertySchema(schema.properties?.[propertyName]);\n const fieldUiSchema = addedByAdditionalProperties ? uiSchema.additionalProperties : uiSchema[propertyName];\n const hidden = getUiOptions<T, S, F>(fieldUiSchema).widget === 'hidden';\n const content = (\n <ObjectFieldProperty<T, S, F>\n key={getStableKey(propertyName)}\n propertyName={propertyName}\n required={isRequired<S>(schema, propertyName)}\n schema={getPropertySchema<S>(schema, propertyName)}\n uiSchema={fieldUiSchema}\n errorSchema={getByPath(errorSchema, propertyName)}\n fieldPathId={childFieldPathId}\n formData={getByPath(formData, propertyName)}\n handleKeyRename={handleKeyRename}\n handleRemoveProperty={handleRemoveProperty}\n addedByAdditionalProperties={addedByAdditionalProperties}\n onChange={onChange}\n onBlur={onBlur}\n onFocus={onFocus}\n registry={registry}\n disabled={disabled}\n readonly={readonly}\n hideError={hideError}\n />\n );\n return {\n content,\n name: propertyName,\n readonly,\n disabled,\n required,\n hidden,\n };\n }),\n readonly,\n disabled,\n required,\n fieldPathId,\n uiSchema,\n errorSchema,\n schema,\n formData,\n registry,\n optionalDataControl,\n className: renderOptionalField ? 'rjsf-optional-object-field' : undefined,\n };\n return <Template {...templateProps} onAddProperty={onAddProperty} />;\n}\n","import*as i0 from\"react\";var I=32,w=9,v5=13,g=10,Z0=96,b0=126,A0=91,W5=94,l=62,V5=35,M9=37,p=45,K5=61,T0=92,P0=42,O0=95,Y0=60,k9=64,J5=93,c0=33,O9=38,m0=58,D9=70,L5=102,A9=104,C5=119,s5=116,x9=112,Y$=115,c$=160,l$=12,r$=44,j9=59,t5=63,Q5=46,j0=47,f5=39,T5=34,y5=43,E0=124,S5=123,E9=125,z5=40,F5=41,o$=78,i$=110,a$=79,n$=111,V$=120,K$=88,g9=30,r=48,o=57,h=65,u=90,V0=97,q0=122,U9=128,U5=32,I6={blockQuote:0,breakLine:1,breakThematic:2,codeBlock:3,codeInline:4,footnote:5,footnoteReference:6,frontmatter:7,gfmTask:8,heading:9,htmlBlock:10,htmlComment:11,htmlSelfClosing:12,image:13,link:14,orderedList:15,paragraph:16,ref:17,refCollection:18,table:19,text:20,textFormatted:21,unorderedList:22},B=I6;import{decodeEntity as N6}from\"markdown-to-jsx/entities\";function X4($){if(!t$($,\"---\"))return null;let Q=3;for(;Q<$.length&&($[Q]===\" \"||$[Q]===\"\t\");)Q++;if(Q<$.length&&$[Q]===\"\\r\"&&Q++,Q>=$.length||$[Q]!==`\n`)return null;Q++;let Z=!1;for(;Q<$.length;){let X=Q;for(;Q<$.length&&$[Q]!==`\n`&&$[Q]!==\"\\r\";)Q++;if(Q>=$.length)break;let Y=Q;if($[Q]===\"\\r\"&&Q++,Q<$.length&&$[Q]===`\n`&&Q++,t$($,\"---\",X))return{endPos:Q,hasValidYaml:Z};if(!Z){let V=L6($,X,Y);if(V<Y){let K=$.charCodeAt(V);if(K>=V0&&K<=q0||K>=h&&K<=u||K>=r&&K<=o||K===O0){for(V++;V<Y&&(K=$.charCodeAt(V),K>=V0&&K<=q0||K>=h&&K<=u||K>=r&&K<=o||K===O0||K===p||K===Q5);)V++;V<Y&&$.charCodeAt(V)===m0&&(V++,V>=Y?Z=!0:(K=$.charCodeAt(V),(K===I||K===w)&&(Z=!0)))}}}}return null}var P6=/&([a-zA-Z0-9]+|#[0-9]{1,7}|#x[0-9a-fA-F]{1,6});/gi,w6={class:\"className\",for:\"htmlFor\",allowfullscreen:\"allowFullScreen\",allowtransparency:\"allowTransparency\",autocomplete:\"autoComplete\",autofocus:\"autoFocus\",autoplay:\"autoPlay\",cellpadding:\"cellPadding\",cellspacing:\"cellSpacing\",charset:\"charSet\",classid:\"classId\",colspan:\"colSpan\",contenteditable:\"contentEditable\",contextmenu:\"contextMenu\",crossorigin:\"crossOrigin\",enctype:\"encType\",formaction:\"formAction\",formenctype:\"formEncType\",formmethod:\"formMethod\",formnovalidate:\"formNoValidate\",formtarget:\"formTarget\",frameborder:\"frameBorder\",hreflang:\"hrefLang\",inputmode:\"inputMode\",keyparams:\"keyParams\",keytype:\"keyType\",marginheight:\"marginHeight\",marginwidth:\"marginWidth\",maxlength:\"maxLength\",mediagroup:\"mediaGroup\",minlength:\"minLength\",novalidate:\"noValidate\",radiogroup:\"radioGroup\",readonly:\"readOnly\",rowspan:\"rowSpan\",spellcheck:\"spellCheck\",srcdoc:\"srcDoc\",srclang:\"srcLang\",srcset:\"srcSet\",tabindex:\"tabIndex\",usemap:\"useMap\",viewbox:\"viewBox\"},R6={};function U$($){if(!$)return R6;var Q={};for(var Z in $){var X=Z.toLowerCase(),Y=w6[X];if(Y)Q[Y]=$[Z];else{var V=Z.indexOf(\":\");V===-1?Q[Z]=$[Z]:Q[Z.slice(0,V)+Z[V+1].toUpperCase()+Z.slice(V+2)]=$[Z]}}return Q}var Y4=/(\\n|^[-*]\\s|^#|^ {2,}|^-{2,}|^>\\s|^<(div|p|h[1-6]|ul|ol|li|blockquote|pre|table|thead|tbody|tr|td|th|dl|dt|dd|hr|address|article|aside|details|dialog|figure|figcaption|footer|form|header|main|menu|nav|section|summary|textarea|fieldset|legend|center|dir|hgroup|marquee|search|output|template)\\b)/i;function I5($){return $.indexOf(\"&\")===-1?$:$.replace(P6,(Q,Z)=>{var X=N6(Z);if(X)return X;if(Z[0]===\"#\"){var Y=Z[1]===\"x\"||Z[1]===\"X\"?Number.parseInt(Z.slice(2),16):Number.parseInt(Z.slice(1),10);return Y===0||Y>=55296&&Y<=57343||Y>1114111?\"\\uFFFD\":Y<=65535?String.fromCharCode(Y):String.fromCharCode(55296+(Y-65536>>10),56320+(Y-65536&1023))}return Q})}var s$=/(javascript|vbscript|data(?!:image)):/i;function H5($){if(s$.test($))return null;if($.indexOf(\"%\")===-1)return $;try{let Q=decodeURIComponent($).replace(/[^A-Za-z0-9/:]/g,\"\");if(s$.test(Q))return null}catch{return null}return $}var o0={},t0,g0;for(t0=[192,193,194,195,196,197,224,225,226,227,228,229,230,198],g0=0;g0<t0.length;g0++)o0[t0[g0]]=\"a\";for(o0[231]=o0[199]=\"c\",o0[240]=o0[208]=\"d\",t0=[200,201,202,203,233,232,234,235],g0=0;g0<t0.length;g0++)o0[t0[g0]]=\"e\";for(t0=[207,239,206,238,205,237,204,236],g0=0;g0<t0.length;g0++)o0[t0[g0]]=\"i\";for(o0[209]=o0[241]=\"n\",t0=[248,216,339,338,213,245,212,244,211,243,210,242],g0=0;g0<t0.length;g0++)o0[t0[g0]]=\"o\";for(t0=[220,252,219,251,218,250,217,249],g0=0;g0<t0.length;g0++)o0[t0[g0]]=\"u\";o0[376]=o0[255]=o0[221]=o0[253]=\"y\";function N5($){for(var Q=\"\",Z=-1,X=$.length,Y=0;Y<X;Y++){var V=$.charCodeAt(Y);if(V>=V0&&V<=q0||V>=r&&V<=o){Z<0&&(Z=Y);continue}if(V>=h&&V<=u){Z>=0&&(Q+=$.slice(Z,Y),Z=-1),Q+=String.fromCharCode(V+U5);continue}if(V===I||V===p){Z>=0&&(Q+=$.slice(Z,Y),Z=-1),Q+=\"-\";continue}Z>=0&&(Q+=$.slice(Z,Y),Z=-1);var K=o0[V];K&&(Q+=K)}return Z>=0&&(Q+=$.slice(Z)),Q}function t$($,Q,Z){return $.startsWith(Q,Z)}var e$=new Set([\"area\",\"base\",\"br\",\"col\",\"embed\",\"hr\",\"img\",\"input\",\"link\",\"meta\",\"param\",\"source\",\"track\",\"wbr\",\"circle\",\"ellipse\",\"line\",\"path\",\"polygon\",\"polyline\",\"rect\",\"use\",\"stop\",\"animate\",\"set\"]);function Q9($){let Q=$.toLowerCase();if(e$.has(Q))return!0;let Z=Q.indexOf(\":\");return Z!==-1?(Q=Q.slice(Z+1),e$.has(Q)):!1}var h5=1,$4=2,$9=4,Z4=8,b6=16,M5=32,k5=64,V4=(()=>{var $=new Uint8Array(128),Q;for($[w]=h5,$[g]=h5|$4,$[l$]=h5,$[v5]=h5|$4,$[I]=h5,Q=c0;Q<=j0;Q++)$[Q]=$9;for(Q=m0;Q<=k9;Q++)$[Q]=$9;for(Q=A0;Q<=Z0;Q++)$[Q]=$9;for(Q=S5;Q<=b0;Q++)$[Q]=$9;for(Q=r;Q<=o;Q++)$[Q]=b6;for(Q=h;Q<=u;Q++)$[Q]=Z4;for(Q=V0;Q<=q0;Q++)$[Q]=Z4;return $})(),K4=/[\\p{P}\\p{S}]/u,J4=/\\p{Zs}/u,e5=[];function U4($){var Q=$.indexOf(\"\\r\"),Z=$.indexOf(\"\\0\");if(Q===-1&&Z===-1)return $;var X=$.length;e5.length=0;var Y=0,V=0;for(Q===-1?V=Z:Z===-1?V=Q:V=Q<Z?Q:Z;V<X;V++){var K=$.charCodeAt(V);K===v5?(Y<V&&e5.push($.slice(Y,V)),V+1<X&&$.charCodeAt(V+1)===g&&V++,e5.push(`\n`),Y=V+1):K===0&&(Y<V&&e5.push($.slice(Y,V)),e5.push(\"\\uFFFD\"),Y=V+1)}return Y<X&&e5.push($.slice(Y)),e5.join(\"\")}function G4($){return $.replace(/>\\s+</g,\"><\").replace(/\\n+/g,\" \").trim()}function L6($,Q,Z){let X=Z??$.length;for(;Q<X&&($[Q]===\" \"||$[Q]===\"\t\");)Q++;return Q}function f9($){if(!$)return!1;for(var Q in $)return!0;return!1}function q4($){return{attrs:{},children:[{type:B.text,text:$}],c:!0,type:B.htmlBlock,tag:\"header\"}}var T6=/^\\n+/;function W4($){for(var Q=$.length;Q>0&&($[Q-1]===`\n`||$[Q-1]===\"\\r\");)Q--;return`${$.slice(0,Q).replace(T6,\"\")}\n\n`}function Z9($){if(($.type===B.htmlSelfClosing||$.type===B.htmlBlock)&&$.a)return[];if($.type===B.paragraph){var Q=$.children;return Q?Q.flatMap(Z9):[]}return $.type===B.text?$.text?.trim()?[$]:[]:$.type===B.htmlBlock&&$.children?[{...$,children:$.children?.flatMap(Z9)}]:[$]}function G$($){for(var Q=0;Q<$.length;Q++){if($[Q].type===B.htmlBlock){var Z=$[Q],X=!1;if(Z.c&&Q===$.length-1){var Y=Z.j===void 0?Z.a?Z.e||\"\":(Z.e||\"\")+(Z.h||\"\"):Z.j,V=`</${String(Z.tag).toLowerCase()}>`,K=Y.toLowerCase().indexOf(V);if(K!==-1){var J=Y.slice(K+V.length).replace(/<\\/[a-z][a-z0-9-]*\\s*>/gi,\"\");J.trim()&&(X=!0)}}X||(Z.c=!1)}\"children\"in $[Q]&&$[Q].children&&G$($[Q].children)}}function z4($,Q){for(var Z=0;Z<$.length;Z++){var X=$[Z];if(X.type===B.paragraph&&X.children)for(var Y=X.children,V=0;V<Y.length;V++){var K=Y[V];if(K.type===B.htmlSelfClosing&&K.a&&K.tag.toLowerCase()===Q){var J=$.slice(0,Z);V>0&&J.push({type:B.paragraph,children:Y.slice(0,V)});var G=[];if(V+1<Y.length){var U=Y.slice(V+1).filter(W=>!(W.type===B.htmlSelfClosing&&W.a));U.length>0&&(G=U)}return G=G.concat($.slice(Z+1)),{found:!0,beforeClose:J,afterClose:G}}}if((X.type===B.htmlSelfClosing||X.type===B.htmlBlock)&&X.a&&X.tag.toLowerCase()===Q)return{found:!0,beforeClose:$.slice(0,Z),afterClose:$.slice(Z+1)}}return{found:!1,beforeClose:$,afterClose:[]}}function y6($){var Q=\"\";for(var Z in $){var X=$[Z];X===!0?Q+=` ${Z}`:X!==void 0&&X!=null&&X!==!1&&(Q+=` ${Z}=\"${String(X)}\"`)}return Q}function Q4($,Q,Z,X){var Y;return Q===void 0?Y=y6(Z):Y=Q.length>0&&Q.charCodeAt(0)>I?` ${Q}`:Q,`<${$}${Y}${X}`}function q$($){var Q=$.tag,Z=$.type===B.htmlSelfClosing,X=$,Y=X.b,V=`</${Q}>`;if(!Z&&X.a)return{kind:\"literal\",literal:(X.h||V)+(X.e||\"\")};if(Z){var K=$;return K.a?{kind:\"literal\",literal:K.h||V}:K.m?{kind:\"literal\",literal:K.m}:{kind:\"literal\",literal:Q4(Q,Y,$.attrs,\" />\")}}var J=Q4(Q,Y,$.attrs,\">\"),G=X.children,U=G!=null&&G.length>0;if(X.c&&X.j!==void 0)return U?{kind:\"sandwich\",open:J,close:V}:{kind:\"literal\",literal:X.j};if(X.c&&!U)return{kind:\"literal\",literal:J+(X.e||\"\")+(X.h||V)};if(G!=null&&G.length>0){for(var W=\"\",z=0;z<G.length;z++){var H=G[z];if(H.type!==B.text)return{kind:\"sandwich\",open:J,close:V};W+=H.text}return{kind:\"literal\",literal:J+W+V}}var F=X.e||\"\";return F&&F.indexOf(V)!==-1?{kind:\"literal\",literal:J+F}:{kind:\"literal\",literal:J+F+V}}function F4($,Q,Z){var X=[],Y=$,V=Z;if(Y&&X.push(Y),Array.isArray(Q))for(var K=0;K<Q.length;K++)X.push(Q[K]);else Q!=null&&X.push(Q);V&&X.push(V);for(var J=[],G=0;G<X.length;G++){var U=X[G];typeof U==\"string\"&&J.length>0&&typeof J.at(-1)==\"string\"?J[J.length-1]=J.at(-1)+U:J.push(U)}return J}function m5($){return $==null||$.tagfilter!==!1}function H4($,Q,Z,X){var Y=Q($,Z,X);return Y===null?null:S6(Y)}function M4($){var Q=[];if(!$)return Q;for(var Z in $)Z.charCodeAt(0)===94&&Q.push({identifier:Z,footnote:$[Z].target});return Q}function h9($,Q,Z){if(Q.indexOf(\".\")===-1)return $?.[Q]||Z;for(var X=$,Y=Q.split(\".\"),V=0;V<Y.length&&(X=X?.[Y[V]],X!==void 0);)V++;return X||Z}function S6($){for(var Q=!1,Z=0;Z<$.length;Z++){var X=$.charCodeAt(Z);if(X<=I||X===T5||X===M9||X===Y0||X===l||X===A0||X===T0||X===J5||X===W5||X===Z0||X>=123){Q=!0;break}}if(!Q)return $;for(var Y=\"\",Z=0;Z<$.length;Z++){var X=$.charCodeAt(Z);if(X===M9&&Z+2<$.length){var V=$.charCodeAt(Z+1),K=$.charCodeAt(Z+2);if((V>=r&&V<=o||V>=h&&V<=D9||V>=V0&&V<=L5)&&(K>=r&&K<=o||K>=h&&K<=D9||K>=V0&&K<=L5)){Y+=$[Z]+$[Z+1]+$[Z+2],Z+=2;continue}}if(X>=55296&&X<=57343){if(X<=56319&&Z+1<$.length){var J=$.charCodeAt(Z+1);if(J>=56320&&J<=57343){Y+=encodeURI($[Z]+$[Z+1]),Z++;continue}}Y+=$[Z];continue}Y+=encodeURI($[Z])}return Y}function O4(...$){return $.filter(Boolean).join(\" \")}var k6=new Set([\"title\",\"textarea\",\"style\",\"xmp\",\"iframe\",\"noembed\",\"noframes\",\"script\",\"plaintext\"]),C9=/<(\\/?)(title|textarea|style|xmp|iframe|noembed|noframes|script|plaintext)(\\s|>|\\/)/gi;function W$($){return k6.has($.toLowerCase())}function D4($){return C9.lastIndex=0,C9.test($)}function z$($){return C9.lastIndex=0,$.replace(C9,(Q,Z,X,Y)=>`&lt;${Z}${X}${Y}`)}function I9($,Q){var Z=$||{},X=Z.slugify,Y;if(X){var V=X;Y=K=>V(K,N5)}else Y=N5;return{disableAutoLink:Z.disableAutoLink,disableFrontmatter:Z.disableFrontmatter,disableParsingRawHTML:Z.disableParsingRawHTML,enforceAtxHeadings:Z.enforceAtxHeadings,evalUnserializableExpressions:Z.evalUnserializableExpressions,forceBlock:Z.forceBlock,forceInline:Q===void 0?Z.forceInline:Q,ignoreHTMLBlocks:Z.ignoreHTMLBlocks,optimizeForStreaming:Z.optimizeForStreaming,preserveFrontmatter:Z.preserveFrontmatter,sanitizer:Z.sanitizer||H5,slugify:Y,tagfilter:m5(Z)}}var h4=/^<([a-zA-Z][a-zA-Z0-9-]*)\\s[^>]*>/,m4=/^<[A-Z]/,D$=[\"script\",\"pre\",\"style\",\"textarea\"],N9=new Set(D$),x6=/<(?:pre|script|style|textarea)\\b/i,j4=/<(?:pre|script|style|textarea)\\b/iy,F$=/^(\\s{0,3}#[#\\s]|\\s{0,3}[-*+]\\s|\\s{0,3}\\d+\\.\\s|\\s{0,3}>\\s|\\s{0,3}```)/m,B4=/^<([a-z][^ >/\\n\\r]*) ?([^>]*?)>/im,u4=new Uint8Array(128);(()=>{for(var $=[Z0,P0,O0,b0,K5,A0,c0,Y0,T0,O9,g,A9,C5,L5],Q=0;Q<$.length;Q++)u4[$[Q]]=1})();var _4=/([a-zA-Z_][a-zA-Z0-9_-]*)=(?:\"([^\"]*)\"|'([^']*)')/g;function p4($){return N9.has($)}function d4($){return x6.test($)}function c4($,Q,Z){for(var X=Q,Y=Z;X<Y&&($.charCodeAt(X)===I||$.charCodeAt(X)===w);)X++;if(X>=Y)return!1;$.charCodeAt(X)===E0&&X++;for(var V=0;X<Y;){for(;X<Y&&($.charCodeAt(X)===I||$.charCodeAt(X)===w);)X++;if(X>=Y)break;if($.charCodeAt(X)===E0&&V>0){for(var K=X+1;K<Y&&($.charCodeAt(K)===I||$.charCodeAt(K)===w);)K++;if(K>=Y)return!0}if($.charCodeAt(X)===m0&&X++,X>=Y||$.charCodeAt(X)!==p)return!1;for(;X<Y&&$.charCodeAt(X)===p;)X++;for(X<Y&&$.charCodeAt(X)===m0&&X++,V++;X<Y&&($.charCodeAt(X)===I||$.charCodeAt(X)===w);)X++;if(X<Y)if($.charCodeAt(X)===E0)X++;else return!1}return V>0}var E6=/[\\u0000-\\u001F\\u007F]/g,g6={action:1,background:1,cite:1,data:1,formaction:1,href:1,longdesc:1,poster:1,src:1,\"xlink:href\":1},C6=/&#(x[0-9a-f]+|[0-9]+);?/gi;function f6($){return $.indexOf(\"&#\")===-1?$:$.replace(C6,(Q,Z)=>{var X=Z.charCodeAt(0)===V$||Z.charCodeAt(0)===K$?Number.parseInt(Z.slice(1),16):Number.parseInt(Z,10);return X>0&&X<=1114111?String.fromCodePoint(X):Q})}function h6($,Q,Z){if(Z&&Q.charCodeAt(0)===S5)return!1;var X=$.charCodeAt(0),Y=$.charCodeAt(1);if((X===n$||X===a$)&&(Y===i$||Y===o$))return!(Z&&Q===\"\");var V=$.toLowerCase();if(V===\"srcdoc\")return!0;if(V===\"style\")return/url\\s*\\(\\s*(javascript|vbscript|data:(?!image\\/))/i.test(Q);if(g6[V]===1){var K=f6(I5(Q));if(H5(K)===null)return!0;var J=K.replace(E6,\"\");return J!==K&&H5(J)===null}return!1}function A$($){return\"<\"+($.f?\"/\":\"\")+$.tag+$.g+$.b+($.n?$.r?\" />\":\"/>\":\">\")}function v4($,Q,Z,X){for(var Y=[],V=Q,K=0;K<X.length;K+=2){var J=X[K];if(J>V){var G=$.slice(V,J).trim();G&&Y.push(G)}V=X[K+1]}if(V<Z){var U=$.slice(V,Z).trim();U&&Y.push(U)}return Y.join(\" \")}function w5($,Q){if($.charCodeAt(Q)!==Y0)return null;let Z=Q+1,X=$.length,Y=!1;$.charCodeAt(Z)===j0&&(Z++,Y=!0);let V=Z,K=$.charCodeAt(Z);if(!(K>=V0&&K<=q0||K>=h&&K<=u))return null;for(;Z<X&&($.charCodeAt(Z)>=V0&&$.charCodeAt(Z)<=q0||$.charCodeAt(Z)>=h&&$.charCodeAt(Z)<=u||$.charCodeAt(Z)>=r&&$.charCodeAt(Z)<=o||$.charCodeAt(Z)===p);)Z++;let J=$.slice(V,Z);if(!J)return null;let G=J.charCodeAt(0),U=G>=h&&G<=u||J.indexOf(\"-\")!==-1,W=Z;for(;Z<X&&($.charCodeAt(Z)===I||$.charCodeAt(Z)===w||$.charCodeAt(Z)===g);)Z++;let z=$.slice(W,Z);if(Z===W&&Z<X){var H=$.charCodeAt(Z);if(H!==l&&H!==j0)return null}let F=Z,M={},j=!1;for(var _=null;Z<X;){let f=$.charCodeAt(Z);if(f===l){let y=_?v4($,F,Z,_):$.slice(F,Z);return{r:j,u:U,f:Y,b:y,q:_!=null,n:!1,g:z,attrs:M,end:Z+1,tag:J}}if(f===I||f===w||f===g){Z++;continue}if(f===j0&&Z+1<X&&$.charCodeAt(Z+1)===l){j=Z>F&&$.charCodeAt(Z-1)===I;let y=_?v4($,F,Z,_):$.slice(F,Z);return{r:j,u:U,f:Y,b:y,q:_!=null,n:!0,g:z,attrs:M,end:Z+2,tag:J}}var q=Z,D=$.charCodeAt(Z);if(!(D>=V0&&D<=q0||D>=h&&D<=u||D===O0||D===m0))return null;for(Z++;Z<X;){var A=$.charCodeAt(Z);if(A>=V0&&A<=q0||A>=h&&A<=u||A>=r&&A<=o||A===O0||A===Q5||A===m0||A===p)Z++;else break}for(var N=$.slice(q,Z),L=Z;Z<X&&($.charCodeAt(Z)===I||$.charCodeAt(Z)===w);)Z++;var O,P;if($.charCodeAt(Z)===K5){for(Z++;Z<X&&($.charCodeAt(Z)===I||$.charCodeAt(Z)===w);)Z++;var v=$.charCodeAt(Z);if(v===T5||v===f5){Z++;for(var b=Z;Z<X&&$.charCodeAt(Z)!==v;)Z++;if(Z>=X)return null;if(O=$.slice(b,Z),Z++,Z<X){var k=$.charCodeAt(Z);if(k!==I&&k!==w&&k!==g&&k!==l&&k!==j0)return null}P=Z}else if(v===S5){var x=1,b=Z;for(Z++;Z<X&&x>0;){var A=$.charCodeAt(Z);A===S5?x++:A===E9&&x--,Z++}O=$.slice(b,Z),P=Z}else{for(var b=Z;Z<X;){var T=$.charCodeAt(Z);if(T===I||T===w||T===l||T===g||T===T5||T===f5||T===K5||T===Y0||T===Z0)break;Z++}if(Z===b)return null;O=$.slice(b,Z),P=Z}}else O=\"\",P=L;h6(N,O,U)?(_===null&&(_=[]),_.push(q,P)):M[N]=O}return null}function G5($){var Q=$.indexOf(\"<\");if(Q===-1)return $;for(var Z=\"\",X=0,Y=!1;Q!==-1;){var V=w5($,Q);V?(V.q&&(Z+=$.slice(X,Q)+A$(V),X=V.end,Y=!0),Q=$.indexOf(\"<\",V.end)):Q=$.indexOf(\"<\",Q+1)}return Y?Z+$.slice(X):$}function m6($,Q,Z){if(!Z.optimizeForStreaming&&$.indexOf(\"[\")===-1)return!1;for(var X=0,Y=$.length,V=!1,K=!1;X<Y;){for(var J=$.indexOf(`\n`,X),G=J<0?Y:J,U=X,W=0;U<G&&W<4;)if($.charCodeAt(U)===I)W++,U++;else if($.charCodeAt(U)===w)W+=4,U++;else break;if(U>=G){V=!1,X=J<0?Y:J+1;continue}if(W<4){var z=$.charCodeAt(U);if(z===Z0||z===b0){for(var H=z,F=0,M=U;M<G&&$.charCodeAt(M)===H;)F++,M++;if(F>=3){var j=!0;if(H===Z0){for(var _=M;_<G;_++)if($.charCodeAt(_)===Z0){j=!1;break}}if(j){V=!1;for(var q=J<0?Y:J+1;q<Y;){for(var D=q,A=0;D<Y&&A<4;){var N=$.charCodeAt(D);if(N===I)A++,D++;else if(N===w)A+=4,D++;else break}if(A<4&&D<Y&&$.charCodeAt(D)===H){for(var L=0;D<Y&&$.charCodeAt(D)===H;)L++,D++;if(L>=F){for(;D<Y&&($.charCodeAt(D)===I||$.charCodeAt(D)===w);)D++;if(D>=Y||$.charCodeAt(D)===g){X=D>=Y?Y:D+1;break}}}for(;q<Y&&$.charCodeAt(q)!==g;)q++;q<Y&&q++}q>=Y&&(X=Y,K=!0);continue}}}}for(var O=U;O<G&&$.charCodeAt(O)===l;){O++,O<G&&$.charCodeAt(O)===I&&O++;for(var P=0;O<G&&P<4;)if($.charCodeAt(O)===I)P++,O++;else if($.charCodeAt(O)===w)P+=4,O++;else break;if(P>=4)break;V=!1}if(!V&&W<4&&O<G&&$.charCodeAt(O)===A0&&!(O+1<Y&&$.charCodeAt(O+1)===W5)){var v=l4($,O,Q);if(v){X=v,V=!1;continue}}var b=$.charCodeAt(U);if(b===V5&&W<4)V=!1;else if(W<4&&(b===p||b===P0||b===O0)){for(var k=U,x=0;k<G;){var T=$.charCodeAt(k);if(T===b)x++;else if(T!==I&&T!==w)break;k++}V=!(x>=3&&k>=G)}else V=!0;X=J<0?Y:J+1}return K}function l4($,Q,Z){let X=$.length;if($.charCodeAt(Q)!==A0)return null;let Y=Q+1<X&&$.charCodeAt(Q+1)===W5,V=Q+1;for(;V<X;){var K=$.charCodeAt(V);if(K===J5){V++;break}if(K===A0)return null;K===T0&&V+1<X&&V++,V++}if(V>X||$.charCodeAt(V-1)!==J5)return null;let J=$.slice(Q+1,V-1);if(J.length>999)return null;let G=p9(J);if(!G||V>=X||$.charCodeAt(V)!==m0)return null;V++;let U=!1;for(;V<X;){let f=$.charCodeAt(V);if(f===I||f===w)V++;else if(f===g&&!U)U=!0,V++;else break}if(Y){let f=$.indexOf(`\n`,V),y=f<0?X:f,C=$.slice(V,y).trim();return Z[G]={target:C,title:void 0},f<0?X:f+1}var W;if(V<X&&$.charCodeAt(V)===Y0){V++;for(var z=V;V<X&&$.charCodeAt(V)!==l&&$.charCodeAt(V)!==g;)$.charCodeAt(V)===T0&&V+1<X&&V++,V++;if(V>=X||$.charCodeAt(V)!==l)return null;W=$.slice(z,V),V++;for(var H=$.indexOf(`\n`,V),F=H<0?X:H,M=V;M<F&&($.charCodeAt(M)===I||$.charCodeAt(M)===w);)M++;if(M<F){if(M===V)return null;var j=$.charCodeAt(M);if(j!==T5&&j!==f5&&j!==z5)return null}}else{for(var z=V,_=0;V<X;){var K=$.charCodeAt(V);if(K===z5)_++;else if(K===F5){if(_===0)break;_--}else{if(K===I||K===w||K===g)break;K===T0&&V+1<X&&V++}V++}if(W=$.slice(z,V),!W)return null}for(;V<X&&($.charCodeAt(V)===I||$.charCodeAt(V)===w);)V++;var q=$.indexOf(`\n`,V),D=q<0?X:q,A,N=!1,L=V,O=V;if(V===D&&V<X)for(O=V+1;O<X&&($.charCodeAt(O)===I||$.charCodeAt(O)===w);)O++;if(O<X){var P=$.charCodeAt(O);if(P===T5||P===f5||P===z5){for(var v=P===z5?41:P,b=O+1,k=b;b<X;){var x=$.charCodeAt(b);if(x===v){for(var T=b+1;T<X&&($.charCodeAt(T)===I||$.charCodeAt(T)===w);)T++;(T>=X||$.charCodeAt(T)===g)&&(A=$.slice(k,b),N=!0,L=T<X?T+1:X);break}if(x===T0&&b+1<X){b+=2;continue}if(x===g&&b+1<X&&$.charCodeAt(b+1)===g)break;b++}if(!N&&O===V)return null}}if(N)return Z[G]||(Z[G]={target:I5(q9(W)),title:A===void 0?A:I5(q9(A))}),L;for(;V<D&&($.charCodeAt(V)===I||$.charCodeAt(V)===w);)V++;return V<D?null:(Z[G]||(Z[G]={target:I5(q9(W)),title:A}),q<0?X:q+1)}var X5=new Uint8Array(V4);for(X5[V5]|=M5,X5[l]|=M5,X5[p]|=M5|k5,X5[y5]|=M5,X5[P0]|=M5|k5,X5[O0]|=M5|k5,X5[Z0]|=M5|k5,X5[b0]|=M5|k5,X5[Y0]|=M5|k5,X5[A0]|=k5,X5[c0]|=k5,X5[E0]|=M5,B9=r;B9<=o;B9++)X5[B9]|=M5;var B9;function I4($){if($.indexOf(\"[\")<0&&$.indexOf(\"]\")<0)return!1;for(var Q=0;Q<$.length;Q++){if($.charCodeAt(Q)===T0){Q++;continue}if($.charCodeAt(Q)===A0||$.charCodeAt(Q)===J5)return!0}return!1}function p9($){for(var Q=$.length,Z=!0,X=Q>0,Y=0;Y<Q;Y++){var V=$.charCodeAt(Y);if(V===I){if(Z){X=!1;break}Z=!0}else if(V<33||V>126||V>=h&&V<=u){X=!1;break}else Z=!1}if(X&&!Z)return $;var K=$.replace(/\\s+/g,\" \").trim();return K.indexOf(\"\\u1E9E\")!==-1?K.replace(/\\u1E9E/g,\"ss\").toLowerCase():K.toLowerCase()}function R$($){return $<U9?X5[$]:$===c$?h5:0}function q9($){return $.indexOf(\"\\\\\")===-1?$:$.replace(/\\\\([!\"#$%&'()*+,\\-./:;<=>?@[\\\\\\]^_`{|}~])/g,\"$1\")}var j$=null,B$=-1,d9=-1;function G0($,Q){if(Q>=B$&&Q<=d9&&$===j$)return d9;var Z=$.indexOf(`\n`,Q),X=Z<0?$.length:Z;return j$=$,B$=Q,d9=X,X}function e($,Q){let Z=G0($,Q);return Z<$.length?Z+1:Z}function v9($,Q,Z){for(;Q<Z;){let X=$.charCodeAt(Q);if(X!==I&&X!==w)break;Q++}return Q}function N4($,Q){let Z=e($,Q);for(;Z<$.length;){let X=G0($,Z);if(e0($,Z,X))return Z;Z=e($,Z)}return $.length}function l5($,Q,Z,X){let Y=0;for(;Q+Y<Z&&$.charCodeAt(Q+Y)===X;)Y++;return Y}var U0=0,Q0=0;function L0($,Q,Z){for(U0=0,Q0=0;Q+Q0<Z;){let X=$.charCodeAt(Q+Q0);if(X===w)U0+=4-U0%4;else if(X===I)U0++;else break;Q0++}}function e0($,Q,Z){return v9($,Q,Z)>=Z}function u6($,Q){if(!$)return $;var Z=Q.v||(Q.v=Object.create(null)),X=Z[$];if(X===void 0)return Z[$]=0,$;for(var Y=X+1,V=`${$}-${Y}`;Z[V]!==void 0;)Y++,V=`${$}-${Y}`;return Z[$]=Y,Z[V]=0,V}function p6($,Q,Z,X){let Y=G0($,Q);if(L0($,Q,Y),U0>3)return null;let V=Q+Q0;if($.charCodeAt(V)!==V5)return null;let K=l5($,V,Y,35);if(K<1||K>6||(V+=K,V<Y&&$.charCodeAt(V)!==I&&$.charCodeAt(V)!==w))return null;V=v9($,V,Y);for(var J=Y;J>V&&$.charCodeAt(J-1)===I;)J--;for(var G=J;J>V&&$.charCodeAt(J-1)===V5;)J--;if(J<G)if(J===V||$.charCodeAt(J-1)===I)for(;J>V&&$.charCodeAt(J-1)===I;)J--;else J=G;let U=$.slice(V,J),W=W9(U,!1,Z,X);return{node:{type:B.heading,level:K,children:W,id:\"\"},end:e($,Y)}}function d6($,Q,Z){var X=$.charCodeAt(Q);if(X!==K5&&X!==p)return!1;for(var Y=Q;Y<Z&&$.charCodeAt(Y)===X;)Y++;for(;Y<Z&&($.charCodeAt(Y)===I||$.charCodeAt(Y)===w);)Y++;return Y>=Z}function d5($,Q){let Z=G0($,Q);if(L0($,Q,Z),U0>3)return null;let X=Q+Q0,Y=$.charCodeAt(X);if(Y!==p&&Y!==P0&&Y!==O0)return null;let V=0;for(;X<Z;){let K=$.charCodeAt(X);if(K===Y)V++;else if(K!==I&&K!==w)return null;X++}return V<3?null:{node:{type:B.breakThematic},end:e($,Z)}}var P4=0,w4=0,R4=\"\";function c6($,Q,Z){let X=G0($,Q);if(L0($,Q,X),U0>3)return null;let Y=U0,V=Q0,K=Q+Q0,J=$.charCodeAt(K);if(J!==Z0&&J!==b0)return null;let G=l5($,K,X,J);if(G<3)return null;K+=G;let U=v9($,K,X),W=X;if(J===Z0){for(let C=U;C<X;C++)if($.charCodeAt(C)===Z0)return null}for(;W>U&&($.charCodeAt(W-1)===I||$.charCodeAt(W-1)===w);)W--;let z=$.slice(U,W),H=\"\",F=\"\",M=z.indexOf(\" \");M===-1?H=z:(H=z.slice(0,M),F=z.slice(M+1).trim()),H=q9(H);var j;if(F){_4.lastIndex=0;for(var _;(_=_4.exec(F))!=null;)j||(j={}),j[_[1]]=_[2]===void 0?_[3]:_[2]}let q=e($,X),D=$.length,A=$.length;var N;J===P4&&G===w4?N=R4:(N=String.fromCharCode(J).repeat(G),P4=J,w4=G,R4=N);for(var L=q;L<$.length;){var O=$.indexOf(N,L);if(O===-1)break;for(var P=O,v=0;P>0&&v<4&&$.charCodeAt(P-1)===I;)P--,v++;if(v<=3&&(P===0||$.charCodeAt(P-1)===g)){for(var b=O+G;b<$.length&&$.charCodeAt(b)===J;)b++;var k=G0($,b);if(e0($,b,k)){D=P,A=e($,k);break}}L=O+1}var x;if(Y===0)x=D>q&&$.charCodeAt(D-1)===g?$.slice(q,D-1):$.slice(q,D);else{x=\"\";for(var T=q;T<D;){var f=G0($,T);L0($,T,f);var y=Math.min(Q0,Y);x+=`${$.slice(T+y,f)}\n`,T=e($,f)}x.length>0&&x.charCodeAt(x.length-1)===g&&(x=x.slice(0,-1))}return{node:{type:B.codeBlock,lang:H||void 0,text:x,infoString:F||void 0,attrs:j},end:A}}function b4($,Q,Z){for(var X=0,Y=Q;Y<Z&&X<4;)$.charCodeAt(Y)===w?X+=4-X%4:X++,Y++;if(X<4)return\"\";for(var V=\"\",K=4;K<X;K++)V+=\" \";return V+$.slice(Y,Z)}function l6($,Q){let Z=G0($,Q);if(L0($,Q,Z),U0<4)return null;let X=\"\",Y=Q;for(;Y<$.length;){let H=G0($,Y);if(L0($,Y,H),e0($,Y,H)){for(var V=`${b4($,Y,H)}\n`,K=e($,H);K<$.length;){var J=G0($,K);if(e0($,K,J)){V+=`${b4($,K,J)}\n`,K=e($,J);continue}L0($,K,J),U0>=4&&(X+=V,Y=K);break}if(Y!==K)break;continue}if(U0<4)break;let F=0,M=0;var G=0;for(let j=Y;j<H&&M<4;j++){if($.charCodeAt(j)===w){var U=4-M%4;M+U>4&&(G=M+U-4),M+=U}else M++;F++}var W=\"\";if(G>0)for(var z=0;z<G;z++)W+=\" \";W+=$.slice(Y+F,H),X+=`${W}\n`,Y=e($,H)}for(;X.length>0&&X.charCodeAt(X.length-1)===g;)X=X.slice(0,-1);return X?{node:{type:B.codeBlock,lang:void 0,text:X,infoString:void 0,attrs:void 0},end:Y}:null}function r6($,Q,Z,X){let Y=G0($,Q);if(L0($,Q,Y),U0>3)return null;let V=Q+Q0;if($.charCodeAt(V)!==l)return null;let K=\"\",J=Q,G,U=!1,W=!1,z=!1;for(;J<$.length;){let S=G0($,J);L0($,J,S);let s=J+Q0;if($.charCodeAt(s)===l){let X0=s+1;var H=U0+1,F=!1;if(X0<S){var M=$.charCodeAt(X0);M===I?(X0++,H++,F=!0):M===w&&(F=!0)}for(var j=\"\",_=!1,q=X0;q<S;q++)if($.charCodeAt(q)===w){_=!0;break}if(_){var D=H;if(F&&X0<S&&$.charCodeAt(X0)===w){for(var A=4-D%4,N=0;N<A-1;N++)j+=\" \";D+=A,X0++}for(var L=X0;L<S;L++)if($.charCodeAt(L)===w){for(var O=4-D%4,P=0;P<O;P++)j+=\" \";D+=O}else j+=$[L],D++}else j=$.slice(X0,S);if(!(K||G)){let I0=j.match(/^\\[!([A-Za-z]+)\\]\\s*$/);if(I0){G=I0[1].toUpperCase(),J=e($,S);continue}}K+=`${j}\n`;var v=j.trimStart();v.startsWith(\"```\")||v.startsWith(\"~~~\")?z=!z:(j.startsWith(\" \")||j.startsWith(\"\t\"))&&(z=!0),W=v.length>0,J=e($,S)}else if(K&&!e0($,J,S)&&W){if(U0<4){var b=J+Q0,k=b<S?$.charCodeAt(b):0;if(k===V5||k===l||k===Z0||k===b0||k===Y0||(k===p||k===P0||k===O0)&&d5($,J)||(k===p||k===P0||k===y5)&&b+1<S&&($.charCodeAt(b+1)===I||$.charCodeAt(b+1)===w))break;if(k>=r&&k<=o){for(var x=b;x<S&&$.charCodeAt(x)>=r&&$.charCodeAt(x)<=o;)x++;if(x<S&&($.charCodeAt(x)===Q5||$.charCodeAt(x)===F5))break}}if(z)break;K+=`${$.slice(J,S)}\n`,U=!0,J=e($,S)}else break}if(!(K||G))return null;var{inBlockQuote:T,l:f}=Z;Z.inBlockQuote=!0,U&&(Z.l=!0);var y=Z.i;Z.i=y||!e0($,J,$.length);let C=c5(K||\"\",Z,X);return Z.i=y,Z.inBlockQuote=T,Z.l=f,{node:{type:B.blockQuote,children:C,alert:G||void 0},end:J}}function r4($,Q,Z){for(var X=0,Y=Q;Y<Z;Y++)$.charCodeAt(Y)===w?X+=4-X%4:X++;return X}function u5($,Q,Z){if(L0($,Q,Z),U0>3)return null;var X=Q+Q0;if(X>=Z)return null;var Y=$.charCodeAt(X),V=U0,K=X,J=X;if(Y===p||Y===P0||Y===y5){if(K=X+1,K<Z&&$.charCodeAt(K)!==I&&$.charCodeAt(K)!==w&&$.charCodeAt(K)!==g)return null}else if(Y>=r&&Y<=o){for(;J<Z&&J-X<9;){var G=$.charCodeAt(J);if(G<r||G>o)break;J++}if(J>X&&J<Z){var U=$.charCodeAt(J);if(U===Q5||U===F5){if(K=J+1,K<Z&&$.charCodeAt(K)!==I&&$.charCodeAt(K)!==w&&$.charCodeAt(K)!==g)return null}else return null}else return null}else return null;var W=K,z=r4($,Q,K),H=0,F=W,M=z;if(W>=Z)return{ordered:Y>=r&&Y<=o,marker:Y>=r&&Y<=o?$[J]:$[X],start:Y>=r&&Y<=o?Number.parseInt($.slice(X,J),10):void 0,contentStart:W,contentCol:z+1,markerCol:V,isEmpty:!0};for(;F<Z&&($.charCodeAt(F)===I||$.charCodeAt(F)===w);){if($.charCodeAt(F)===w){var j=4-M%4;M+=j}else M++;F++,H++}var _=F>=Z,q=M-z;return _||q>4?(M=z+1,F=W+1,H=1):H===0&&(M=z+1,F=W,H=1),{ordered:Y>=r&&Y<=o,marker:Y>=r&&Y<=o?$[J]:$[X],start:Y>=r&&Y<=o?Number.parseInt($.slice(X,J),10):void 0,contentStart:F,contentCol:M,markerCol:V,isEmpty:_}}var G9=0;function L4($,Q,Z,X){var Y=0,V=Q;for(G9=0;V<Z&&Y<X;){var K=$.charCodeAt(V);if(K===w){var J=4-Y%4;if(Y+J>X){G9=Y+J-X,V++,Y=X;break}Y+=J}else if(K===I)Y++;else break;V++}return V}function T4($,Q,Z,X){var Y=G0($,Q),V=u5($,Q,Y);if(!V)return null;var K=[],J=Q,G=V.contentCol,U=\"\",W=V.isEmpty,z=!1,H=!1;if(!V.isEmpty){for(var F=!1,M=V.contentStart;M<Y;M++)if($.charCodeAt(M)===w){F=!0;break}if(F){var j=\"\",_=r4($,Q,V.contentStart),q=_-V.contentCol;if(q>0)for(var D=0;D<q;D++)j+=\" \";for(var A=V.contentStart;A<Y;A++)if($.charCodeAt(A)===w){for(var N=4-_%4,L=0;L<N;L++)j+=\" \";_+=N}else j+=$[A],_++;U=`${j}\n`}else U=`${$.slice(V.contentStart,Y)}\n`}for(J=e($,Y);J<$.length;){var O=G0($,J);L0($,J,O);var P=$.charCodeAt(J+Q0);if(U0<G&&(P===p||P===P0||P===O0)&&U0<=3&&d5($,J))break;var v=u5($,J,O);if(v&&v.ordered===V.ordered&&v.marker===V.marker&&v.markerCol<G){K.push({contentCol:G,raw:U,hasBlankAfter:z,isEmpty:W}),z&&(H=!0),G=v.contentCol,W=v.isEmpty,z=!1,U=v.isEmpty?\"\":`${$.slice(v.contentStart,O)}\n`,J=e($,O);continue}if(e0($,J,O)){var b=L4($,J,O,G);if(G9>0||b<O){for(var k=\"\",x=0;x<G9;x++)k+=\" \";U+=`${k+$.slice(b,O)}\n`}else U+=`\n`;J=e($,O);for(var T=!1,f=0;f<U.length;f++){var y=U.charCodeAt(f);if(y!==g&&y!==v5&&y!==I&&y!==w){T=!0;break}}if(W&&!T)if(J<$.length){var C=G0($,J),E=u5($,J,C);if(!E||E.ordered!==V.ordered||E.marker!==V.marker)break;z=!0}else break;if(J<$.length){var S=G0($,J);L0($,J,S);var s=$.charCodeAt(J+Q0);if((s===p||s===P0||s===O0)&&U0<=3&&d5($,J))break;var X0=u5($,J,S);if(X0&&X0.ordered===V.ordered&&X0.marker===V.marker&&X0.markerCol<G){z=!0;continue}if(!e0($,J,S)&&U0<G)break}continue}if(U0>=G){var I0=L4($,J,O,G);if(G9>0){for(var d=\"\",u0=G,B0=0;B0<G9;B0++)d+=\" \",u0++;for(var W0=I0;W0<O;W0++)if($.charCodeAt(W0)===w){for(var H0=4-u0%4,D0=0;D0<H0;D0++)d+=\" \";u0+=H0}else d+=$[W0],u0++;U+=`${d}\n`}else U+=`${$.slice(I0,O)}\n`;J=e($,O);continue}for(var m=!1,c=0;c<U.length;c++){var K0=U.charCodeAt(c);if(K0!==g&&K0!==v5&&K0!==I&&K0!==w){m=!0;break}}if(!z&&m&&!W){var y0=J+Q0,S0=$.charCodeAt(y0),_0=S0===V5||S0===l||S0===Y0||S0===Z0||S0===b0||(S0===p||S0===P0||S0===O0||S0===y5)&&(d5($,J)!=null||u5($,J,O)!=null)||S0>=r&&S0<=o&&u5($,J,O)!=null;if(!_0){U+=`\u001e${$.slice(y0,O)}\n`,J=e($,O);continue}}break}if(K.push({contentCol:G,raw:U,hasBlankAfter:z,isEmpty:W}),K.length===0)return null;var a=H;if(!a)for(var w0=0;w0<K.length;w0++){if(K[w0].hasBlankAfter&&w0<K.length-1){a=!0;break}if(!K[w0].isEmpty){for(var z0=K[w0].raw,F0=z0.length,M0=0,f0=!1,v0=!1,k0=!1,h0=!1,p0=0,n=0,N0=-1;M0<F0;){var i=z0.indexOf(`\n`,M0);if(i<0&&(i=F0),h0){L0(z0,M0,i);for(var x0=z0.slice(M0+Q0,i),R=0;R<x0.length&&x0.charCodeAt(R)===p0;)R++;R>=n&&x0.slice(R).trim()===\"\"&&(h0=!1),M0=i<F0?i+1:F0;continue}if(e0(z0,M0,i)){N0>=0?k0=!0:f0&&(v0=!0),M0=i<F0?i+1:F0;continue}if(L0(z0,M0,i),N0>=0){if(U0>=N0){M0=i<F0?i+1:F0;continue}var J0=u5(z0,M0,i);if(J0&&J0.markerCol<N0&&J0.contentCol<=N0){M0=i<F0?i+1:F0;continue}if(J0){M0=i<F0?i+1:F0;continue}N0=-1,k0&&(v0=!0,k0=!1)}var a0=z0.slice(M0+Q0,i),q5=a0.charCodeAt(0);if((q5===Z0||q5===b0)&&U0<=3){for(var $0=0;$0<a0.length&&a0.charCodeAt($0)===q5;)$0++;if($0>=3){if(v0&&f0){a=!0;break}h0=!0,p0=q5,n=$0,f0=!0,M0=i<F0?i+1:F0;continue}}var C0=U0<=3?u5(z0,M0,i):null;if(C0&&f0){if(v0){a=!0;break}N0=C0.contentCol,k0=!1,M0=i<F0?i+1:F0,f0=!0;continue}if(v0){a=!0;break}f0=!0,M0=i<F0?i+1:F0}if(a)break}}for(var t=[],d0=0;d0<K.length;d0++){for(var n0=K[d0],$5=n0.raw,l0=$5.length;l0>0&&$5.charCodeAt(l0-1)===g;)l0--;var s0=l0<$5.length?$5.slice(0,l0):$5,r5=null;if(s0.length>=3&&s0.charCodeAt(0)===A0){var x5=s0[1];(x5===\" \"||x5===\"x\"||x5===\"X\")&&s0.charCodeAt(2)===J5&&(r5={type:B.gfmTask,completed:x5===\"x\"||x5===\"X\"},s0=s0.slice(3))}var R0;if(n0.isEmpty&&s0.trim()===\"\")R0=[];else if(a){var o5=Z.inList;Z.inList=!0;var w9=Z.i;Z.i=w9||d0!==K.length-1,R0=c5(s0,Z,X),Z.i=w9,Z.inList=o5}else{var b5=Z.inList;Z.inList=!0;var i5=Z.i;if(Z.i=i5||d0!==K.length-1,R0=c5(s0,Z,X),Z.i=i5,Z.inList=b5,R0.length===1&&R0[0].type===B.paragraph)R0=R0[0].children;else if(Z.p){var E5=[];Z.p.push({src:R0,dest:E5,unwrap:!0}),R0=E5}else{for(var j5=[],Z5=0;Z5<R0.length;Z5++)if(R0[Z5].type===B.paragraph)for(var B5=R0[Z5].children,V9=0;V9<B5.length;V9++)j5.push(B5[V9]);else j5.push(R0[Z5]);R0=j5}}if(r5){var a5=[r5,{type:B.text,text:\" \"}];if(Z.p)Z.p.push({src:R0,dest:a5,unwrap:!1});else for(var A5=0;A5<R0.length;A5++)a5.push(R0[A5]);t.push(a5)}else t.push(R0)}return{node:{type:V.ordered?B.orderedList:B.unorderedList,start:V.ordered?V.start:void 0,items:t},end:J}}var l9=new Set([\"address\",\"article\",\"aside\",\"base\",\"basefont\",\"blockquote\",\"body\",\"caption\",\"center\",\"col\",\"colgroup\",\"dd\",\"details\",\"dialog\",\"dir\",\"div\",\"dl\",\"dt\",\"fieldset\",\"figcaption\",\"figure\",\"footer\",\"form\",\"frame\",\"frameset\",\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\",\"head\",\"header\",\"hr\",\"html\",\"iframe\",\"legend\",\"li\",\"link\",\"main\",\"menu\",\"menuitem\",\"nav\",\"noframes\",\"ol\",\"optgroup\",\"option\",\"p\",\"param\",\"search\",\"section\",\"summary\",\"table\",\"tbody\",\"td\",\"tfoot\",\"th\",\"thead\",\"title\",\"tr\",\"track\",\"ul\"]);function P5($,Q,Z){let X={};for(let[K,J]of Object.entries($)){let G=K.toLowerCase();if(G===\"style\"&&typeof J==\"string\"){let U={},W=[],z=0,H=0;for(let M=0;M<J.length;M++){let j=J.charCodeAt(M);j===z5?z++:j===F5?z--:j===j9&&z===0&&(W.push(J.slice(H,M)),H=M+1)}H<J.length&&W.push(J.slice(H));let F=!1;W.forEach(M=>{let j=M.indexOf(\":\");if(j===-1)return;let _=M.slice(0,j).trim(),q=M.slice(j+1).trim();if(_&&q){if(/url\\s*\\(\\s*(javascript|vbscript|data:(?!image\\/))/i.test(q)){F=!0;return}let D=_.indexOf(\"-\")===-1?_:_.replace(/-([a-z])/g,(A,N)=>N.toUpperCase());U[D]=q}}),!F&&Object.keys(U).length>0&&(X[K]=U)}else if((G===\"href\"||G===\"src\")&&Z?.sanitizer){let U=Z.sanitizer(J,Q,G);U!=null&&(X[K]=U)}else if(J===\"\")X[K]=!0;else if(J.length>=2&&J.charCodeAt(0)===S5&&J.charCodeAt(J.length-1)===E9){var Y=J.slice(1,-1);if(Y.length>0){var V=Y.charCodeAt(0);if(V===A0||V===S5)try{X[K]=JSON.parse(Y);continue}catch{}}if(Y===\"true\"){X[K]=!0;continue}if(Y===\"false\"){X[K]=!1;continue}if(Z?.evalUnserializableExpressions)try{X[K]=(0,eval)(`(${Y})`);continue}catch{}X[K]=Y}else X[K]=J}return X}function p5($,Q,Z){let X=Q.length;if(X===0)return Z;var Y=Q.charCodeAt(0),V=Y>=h&&Y<=u||Y>=V0&&Y<=q0;if(!V){for(var K=String.fromCharCode(Y),J=$.length-X,G=Z;G<=J;){var U=$.indexOf(K,G);if(U===-1||U>J)return-1;for(var W=!0,z=1;z<X;z++){var H=$.charCodeAt(U+z),F=Q.charCodeAt(z);if(H>=h&&H<=u&&(H+=U5),F>=h&&F<=u&&(F+=U5),H!==F){W=!1;break}}if(W)return U;G=U+1}return-1}Y>=h&&Y<=u&&(Y+=U5);for(let j=Z;j<=$.length-X;j++){var M=$.charCodeAt(j);if(M>=h&&M<=u&&(M+=U5),M!==Y)continue;let _=!0;for(let q=1;q<X;q++){let D=$.charCodeAt(j+q),A=Q.charCodeAt(q);if(D>=h&&D<=u&&(D+=U5),A>=h&&A<=u&&(A+=U5),D!==A){_=!1;break}}if(_)return j}return-1}function o6($,Q,Z){let X=Q.length;var Y=Q.charCodeAt(0);Y>=h&&Y<=u&&(Y+=U5);for(let K=Math.min(Z,$.length-X);K>=0;K--){var V=$.charCodeAt(K);if(V>=h&&V<=u&&(V+=U5),V!==Y)continue;let J=!0;for(let G=1;G<X;G++){let U=$.charCodeAt(K+G),W=Q.charCodeAt(G);if(U>=h&&U<=u&&(U+=U5),W>=h&&W<=u&&(W+=U5),U!==W){J=!1;break}}if(J)return K}return-1}var r9=-1;function _$($,Q,Z){let X=Z.toLowerCase(),Y=`<${X}`,V=`</${X}`,K=1,J=Q,G=$.length;for(r9=-1;J<G&&K>0;){let z=p5($,Y,J),H=p5($,V,J);if(H===-1)return-1;if(z!==-1&&z<H){let F=w5($,z);F?(F.tag.toLowerCase()===X&&!F.f&&!F.n&&!Q9(F.tag)&&K++,J=F.end):J=z+1}else{var U=H+V.length,W=U<G?$.charCodeAt(U):62;if((W===l||W===I||W===w||W===g)&&(K--,K===0)){r9=H;let F=H+V.length;for(;F<G&&$.charCodeAt(F)!==l;)F++;return F+1}J=H+1}}return-1}function o4($,Q,Z,X){if(X.ignoreHTMLBlocks||X.disableParsingRawHTML)return null;var Y=G0($,Q);if(L0($,Q,Y),U0>3&&!Z.inHTML)return null;var V=Q+Q0;if($.charCodeAt(V)!==Y0)return null;var K=$.indexOf(\">\",V+1);if(K!==-1&&K<Y){var J=$.slice(V+1,K);if(/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(J)||/^[^\\s@]+@[^\\s@]+$/.test(J))return null}var G=i6($,V);if(G>=1&&G<=5){var U=$.length;if(G===1){for(var W=$.length,z=0;z<D$.length;z++){var H=p5($,`</${D$[z]}>`,V);H>=0&&H<W&&(W=H)}if(W<$.length){var F=$.indexOf(\">\",W);U=F>=0?e($,F+1):$.length}}else{var M=G===2?\"-->\":G===3?\"?>\":G===4?\">\":\"]]>\",j=$.indexOf(M,V);j>=0&&(U=e($,j+M.length))}var _=$.slice(V,U);if(G>=2)return{node:{type:B.htmlComment,text:_,s:!1,raw:!0},end:U};var q=\"div\",D=_.match(/^<\\/?([a-zA-Z][a-zA-Z0-9-]*)/);D&&(q=D[1]);var A=w5($,V),N={},L;A&&!A.f&&(N=P5(A.attrs,q,X),L=A.g+A.b);var O=[],P=q.toLowerCase(),v=`</${P}`,b=p5(_,v,0),k=\"\",x,T,f;if(A?.f){f=_.slice(0,A.end-V);for(var y=_.slice(A.end-V);y.length>0&&y.charCodeAt(y.length-1)===g;)y=y.slice(0,-1);y&&(T=G5(y))}else if(A&&!A.f){var C=A.end-V;if(b===-1){for(var E=_;E.length>0&&E.charCodeAt(E.length-1)===g;)E=E.slice(0,-1);x=G5(E)}else{var S=C;_.charCodeAt(S)===g&&S++;for(var s=b;s>S;){var X0=_.charCodeAt(s-1);if(X0!==I&&X0!==w&&X0!==g&&X0!==v5)break;s--}var I0=_.slice(S,s);I0&&(T=G5(I0));for(var d=_.slice(b);d.length>0&&d.charCodeAt(d.length-1)===g;)d=d.slice(0,-1);f=G5(d),k=_.slice(C,b).trim()}}var u0=A?A.f:!1;return{node:{type:B.htmlBlock,tag:q,attrs:N,b:L,children:O,e:T,h:f,j:x,text:k,c:!0,a:u0},end:U}}if(G===6||G===7){var B0=N4($,Q),W0=B0<$.length?B0:$.length,H0=$.slice(V,W0),D0=B0<$.length?e($,B0):$.length,m=w5($,V);if(m){var c=m.tag,K0=c.toLowerCase(),y0=m.f;if(y0){var S0=$.slice(m.end,W0);return{node:{type:B.htmlBlock,tag:c,attrs:{},children:[],h:$.slice(V,m.end),e:S0?G5(S0):void 0,text:S0,c:!0,a:!0},end:D0}}if(m.n||Q9(c))return{node:{type:B.htmlBlock,tag:c,attrs:P5(m.attrs,c,X),b:m.g+m.b,children:[],text:\"\",c:!1,a:!1},end:m.end<$.length&&$.charCodeAt(m.end)===g?m.end+1:m.end};var _0=Z.d||0,a=$.slice(V,W0),w0=-1,z0=-1,F0=!1;if(_0<10){for(var M0=`</${K0}`,f0=m.end-V,v0=1,k0=f0;k0<a.length&&v0>0;){var h0=p5(a,`<${K0}`,k0),p0=p5(a,M0,k0);if(p0===-1)break;if(h0!==-1&&h0<p0){var n=h0+K0.length+1;if(n<a.length){var N0=a.charCodeAt(n);(N0===I||N0===w||N0===g||N0===l||N0===j0)&&v0++}k0=h0+1}else{var i=p0+M0.length;if(i<a.length){var x0=a.charCodeAt(i);if((x0===l||x0===I||x0===w||x0===g)&&(v0--,v0===0)){w0=p0;for(var R=i;R<a.length&&a.charCodeAt(R)!==l;)R++;z0=R+1;break}}else if(v0--,v0===0){w0=p0,z0=a.length;break}k0=p0+1}}if(w0===-1&&!m.f&&(G===6||m.u)){var J0=_$($,m.end,K0);if(J0!==-1){for(var a0=r9,q5=m.end,$0=!1,C0=!1,t=!1,d0=0,n0=!1,$5=!1,l0=q5;l0<a0;){var s0=$.charCodeAt(l0);if(s0===g)$5&&($0=!0),n0||d0++,$5=!0,l0++;else if(s0===I||s0===w)l0++;else{if(!n0&&(n0=!0,d0>=2&&s0===Y0)){t=!0;break}if($5=!1,s0===Y0){var r5=$.charCodeAt(l0+1)|32;if((r5===x9||r5===Y$||r5===s5)&&(j4.lastIndex=l0,j4.test($))){C0=!0;break}}l0++}}if($0&&!t&&!C0){var x5=G0($,J0);W0=x5,D0=e($,x5),a=$.slice(V,W0),H0=$.slice(V,W0),w0=a0-V,z0=J0-V,F0=!0}}}}var R0=m.b.indexOf(`\n`)!==-1||m.g.indexOf(`\n`)!==-1,o5=!1;if(w0!==-1){var w9=a.slice(z0).trim();o5=w9.length===0}var b5=!1,i5=W0,E5=D0;if(w0!==-1){var j5=V+z0,Z5=G0($,j5-1);if(j5<Z5){for(var B5=j5;B5<Z5&&($.charCodeAt(B5)===I||$.charCodeAt(B5)===w);)B5++;if(B5<Z5&&$.charCodeAt(B5)===Y0){var V9=w5($,B5);V9&&!V9.f&&(b5=!0,i5=j5,E5=j5,o5=!0)}}if(!b5){var a5=e($,Z5);if(a5<W0){for(var A5=a5;A5<W0&&($.charCodeAt(A5)===I||$.charCodeAt(A5)===w);)A5++;if(A5<W0&&$.charCodeAt(A5)===Y0){var s4=w5($,A5);s4&&(b5=!0,i5=Z5,E5=a5,o5=!0)}}}if(!b5&&Z.inHTML){b5=!0,i5=Z5,E5=e($,Z5);var t4=$.slice(j5,Z5).trim();o5=t4.length===0}}var K9=[],Y5=\"\";if(w0!==-1){Y5=a.slice(m.end-V,w0);var J9=Y5.trim();if(J9){var{inline:e4,inHTML:$6,d:Z6}=Z;Z.inHTML=!0,Z.d=_0+1;var Q6=K0===\"p\";if(Q6)Z.inline=!0,K9=W9(J9,!1,Z,X);else{var S$=Y5.indexOf(`\n\n`)!==-1,k$=F$.test(J9),a9=B4.test(J9),X6=S$||k$||Z.inHTML&&a9,Y6=Y5.length>=2&&Y5.charCodeAt(0)===g&&Y5.charCodeAt(Y5.length-1)===g&&!S$;Y6&&!k$&&!a9?K9=[{type:B.text,text:J9}]:X6||a9?(Z.inline=!1,K9=c5(Y5,Z,X)):(Z.inline=!0,K9=W9(J9,!1,Z,X))}Z.inline=e4,Z.inHTML=$6,Z.d=Z6}}var x$=!1;if(G===6&&w0!==-1&&!Z.inHTML&&!R0){var V6=/<[a-zA-Z][^>]*>/.test(Y5),K6=Y5.indexOf(`\n\n`)!==-1||F$.test(Y5);V6&&!K6&&(x$=!0)}var J6=!F0&&(Z.inHTML||G===7||R0||!o5||x$);if(J6){var z9,_5,E$=!1;if(w0!==-1&&b5){var g$=!1;if(Z.inHTML&&z0<a.length){for(var R9=z0;R9<a.length&&a.charCodeAt(R9)!==g;)R9++;var n9=a.slice(z0,R9).trim();g$=n9.length>1&&n9.charCodeAt(0)===Y0&&n9.charCodeAt(1)!==j0}_5=g$?a.slice(m.end-V):Y5,E$=!0}else(G===7||Z.inHTML)&&w0!==-1?(_5=a.slice(m.end-V),_5.charCodeAt(0)===g&&(_5=_5.slice(1))):b5?z9=$.slice(V,i5):R0?z9=H0:(_5=a.slice(m.end-V),_5.charCodeAt(0)===g&&(_5=_5.slice(1)));var C$=z9!==void 0,s9=G5(z9===void 0?_5||\"\":z9),f$={type:B.htmlBlock,tag:c,attrs:P5(m.attrs,c,X),b:m.g+m.b,children:K9,e:C$?void 0:s9,j:C$?s9:void 0,text:s9,c:!0,a:!1};return E$&&(f$.x=!0),{node:f$,end:E5}}var h$=G5(Y5);return{node:{type:B.htmlBlock,tag:c,attrs:P5(m.attrs,c,X),b:m.g+m.b,children:K9,e:F0?void 0:h$,text:h$,c:!1,a:!1},end:E5}}var b9=H0.match(/^<(\\/?)([a-zA-Z][a-zA-Z0-9-]*)/),U6=b9?b9[2]:\"div\",t9=b9?b9[1]===\"/\":!1,e9,m$,u$,L9=\"\";if(t9){var $$=H0.indexOf(\">\");$$===-1?e9=H0:(e9=H0.slice(0,$$+1),L9=H0.slice($$+1),L9&&(m$=G5(L9)))}else u$=G5(H0);return{node:{type:B.htmlBlock,tag:U6,attrs:{},children:[],e:m$,h:e9,j:u$,text:t9?L9:H0,c:!0,a:t9},end:D0}}var r0=w5($,V);if(!r0)return null;var g5=r0.tag,Z$=g5.toLowerCase(),p$=g5.charCodeAt(0),T9=p$>=h&&p$<=u;if(!(T9||l9.has(Z$)||N9.has(Z$)||Z$.includes(\"-\")))return null;if(r0.f)return{node:{type:B.htmlSelfClosing,tag:g5,attrs:{},h:$.slice(V,r0.end),a:!0},end:r0.end};var n5=_$($,r0.end,g5),F9=[];if(n5!==-1){var G6=r9,y9=$.slice(r0.end,G6),S9=y9.trim();if(S9){var q6=y9.indexOf(`\n\n`)!==-1,W6=F$.test(S9),z6=B4.test(S9),F6=Z.inline,H6=Z.inHTML,M6=Z.d;Z.inHTML=!0,Z.d=(Z.d||0)+1,q6||W6||z6?(Z.inline=!1,F9=c5(y9,Z,X)):(Z.inline=!0,F9=W9(S9,!1,Z,X)),Z.inline=F6,Z.inHTML=H6,Z.d=M6}var O6=G0($,n5),D6=$.slice(n5,O6).trim(),Q$=D6?n5:e($,n5),d$=T9?$.slice(V,n5):$.slice(V,Q$),jZ=T9?n5:Q$;return{node:{type:B.htmlBlock,tag:g5,attrs:P5(r0.attrs,g5,X),b:r0.g+r0.b,children:F9,j:G5(d$),text:T9?y9:d$,c:!0,a:!1},end:Q$}}var H9=N4($,r0.end),A6=H9<$.length?e($,H9):H9,X$=$.slice(r0.end,H9);if(X$.trim()){var{inline:j6,inHTML:B6,d:_6}=Z;Z.inline=!1,Z.inHTML=!0,Z.d=(Z.d||0)+1,F9=c5(X$,Z,X),Z.inline=j6,Z.inHTML=B6,Z.d=_6}var v6=$.slice(r0.end,H9);return{node:{type:B.htmlBlock,tag:g5,attrs:P5(r0.attrs,g5,X),b:r0.g+r0.b,children:F9,e:G5(v6),text:X$,c:!0,a:!1},end:A6}}function i6($,Q){if($.charCodeAt(Q)!==Y0)return 0;var Z=Q+1,X=$.length;if($.charCodeAt(Z)===c0&&$.charCodeAt(Z+1)===p&&$.charCodeAt(Z+2)===p)return 2;if($.charCodeAt(Z)===t5)return 3;if($.charCodeAt(Z)===c0){var Y=$.charCodeAt(Z+1);if(Y>=h&&Y<=u)return 4;if($.slice(Z+1,Z+8)===\"[CDATA[\")return 5}for(var V=$.charCodeAt(Z)===j0,K=V?Z+1:Z,J=K;J<X;){var G=$.charCodeAt(J);if(G>=h&&G<=u||G>=V0&&G<=q0||G>=r&&G<=o||G===p)J++;else break}if(J===K)return 0;var U=$.slice(K,J);if(N9.has(U.toLowerCase())){if(V)return 0;var W=$.charCodeAt(J);return W===I||W===w||W===l||W===g||J>=X?1:0}if(l9.has(U.toLowerCase())){if(V){for(var z=J;z<X&&($.charCodeAt(z)===I||$.charCodeAt(z)===w);)z++;return z<X&&$.charCodeAt(z)===l?6:0}var H=J<X?$.charCodeAt(J):-1;return H===I||H===w||H===l||H===g||H===j0||H===-1?6:0}if(V){for(var F=J;F<X&&($.charCodeAt(F)===I||$.charCodeAt(F)===w);)F++;if(F<X&&$.charCodeAt(F)===l){var M=G0($,Q),j=$.slice(F+1,M).trim();if(j===\"\")return 7}}else{var _=G0($,Q),q=w5($,Q);if(q&&q.end<=_){var D=$.slice(q.end,_).trim();if(D===\"\")return 7}}return 0}function y4($,Q,Z){for(var X=0,Y=$.length;X<Y&&($.charCodeAt(X)===I||$.charCodeAt(X)===w);)X++;for(;Y>X&&($.charCodeAt(Y-1)===I||$.charCodeAt(Y-1)===w);)Y--;X<Y&&$.charCodeAt(X)===E0&&X++,Y>X&&$.charCodeAt(Y-1)===E0&&(Y-2<X||$.charCodeAt(Y-2)!==T0)&&Y--;for(var V=[],K=X,J=!1,G=[],U=X;U<Y;){var W=$.charCodeAt(U);if(W===T0&&U+1<Y){$.charCodeAt(U+1)===E0?(J||(J=!0,G=[]),G.push($.slice(K,U)),G.push(\"|\"),U+=2,K=U):U+=2;continue}if(W===Z0){for(var z=0;U<Y&&$.charCodeAt(U)===Z0;)z++,U++;for(var H=!1;U<Y&&!H;){for(var F=0;U<Y&&$.charCodeAt(U)===Z0;)F++,U++;F===z?H=!0:F===0&&U++}continue}if(W===E0){var M=J?(G.push($.slice(K,U)),G.join(\"\")):$.slice(K,U);V.push(M.trim()),U++,K=U,J=!1,G=[];continue}U++}var j=J?(G.push($.slice(K,Y)),G.join(\"\")):$.slice(K,Y);return V.push(j.trim()),V.map(_=>{var q=_.indexOf(\"\\\\|\")===-1?_:_.replace(/\\\\\\|/g,\"|\");return q?W9(q,!1,Q,Z):[]})}function S4($,Q,Z,X){let Y=G0($,Q);var V=$.indexOf(\"|\",Q);if(V<0||V>=Y)return null;let K=e($,Y);if(K>=$.length)return null;let J=G0($,K);if(!c4($,K,J))return null;let G=$.slice(Q,Y),U=$.slice(K,J);for(var W=[],z=0,H=U.length;z<H&&(U.charCodeAt(z)===I||U.charCodeAt(z)===w);)z++;for(z<H&&U.charCodeAt(z)===E0&&z++;z<H;){for(;z<H&&(U.charCodeAt(z)===I||U.charCodeAt(z)===w);)z++;if(z>=H||U.charCodeAt(z)===E0)break;var F=U.charCodeAt(z)===m0;for(F&&z++;z<H&&U.charCodeAt(z)===p;)z++;var M=z<H&&U.charCodeAt(z)===m0;for(M&&z++,W.push(F&&M?\"center\":M?\"right\":F?\"left\":null);z<H&&(U.charCodeAt(z)===I||U.charCodeAt(z)===w);)z++;z<H&&U.charCodeAt(z)===E0&&z++}let j=y4(G,Z,X);if(W.length!==j.length)return null;let _=[],q=e($,J);for(;q<$.length;){let P=G0($,q),v=$.slice(q,P);if(e0($,q,P))break;if(L0($,q,P),U0<4){var D=$.charCodeAt(q+Q0);if(D===l||D===V5||(D===p||D===P0||D===O0)&&d5($,q))break;if(D===Z0||D===b0){for(var A=q+Q0,N=0;A<P&&$.charCodeAt(A)===D;)N++,A++;if(N>=3)break}}_.push(y4(v,Z,X)),q=e($,P)}if(X.optimizeForStreaming&&_.length===0)return null;for(var L=j.length,O=0;O<_.length;O++)if(_[O].length<L)for(;_[O].length<L;)_[O].push([]);else _[O].length>L&&(_[O].length=L);return{node:{type:B.table,header:j,cells:_,align:W},end:q}}function a6($,Q,Z){var X=G0($,Q);if(L0($,Q,X),U0>3)return null;var Y=Q+Q0;if($.charCodeAt(Y)!==A0)return null;if(Y+1<$.length&&$.charCodeAt(Y+1)===W5){var V=n6($,Y,Z);return V||null}Z.refs||(Z.refs={});var K=l4($,Y,Z.refs);return K===null?null:{node:{type:B.refCollection},end:K}}function n6($,Q,Z){var X=$.length;if($.charCodeAt(Q)!==A0||Q+1>=X||$.charCodeAt(Q+1)!==W5)return null;for(var Y=Q+2,V=Y;Y<X&&$.charCodeAt(Y)!==J5;){if($.charCodeAt(Y)===g)return null;Y++}if(Y>=X)return null;var K=`^${$.slice(V,Y)}`.toLowerCase();if(Y++,Y>=X||$.charCodeAt(Y)!==m0)return null;for(Y++;Y<X&&($.charCodeAt(Y)===I||$.charCodeAt(Y)===w);)Y++;if(Y<X&&$.charCodeAt(Y)===g)for(Y++;Y<X&&($.charCodeAt(Y)===I||$.charCodeAt(Y)===w);)Y++;var J=$.indexOf(`\n`,Y);J<0&&(J=X);for(var G=$.slice(Y,J).trim(),U=J<X?J+1:X;U<X;){var W=G0($,U);if(L0($,U,W),U0>=2&&!e0($,U,W))G+=`\n${$.slice(U,W)}`,U=e($,W);else if(e0($,U,W)){var z=e($,W);if(z<X){var H=G0($,z);if(L0($,z,H),U0>=2){G+=`\n`,U=e($,W);continue}}break}else break}var F=Z.refs;return F&&!F[K]&&(F[K]={target:G,title:void 0}),{node:{type:B.footnote},end:U}}function s6($,Q,Z,X){let Y=Q,V=0,K=0,J=-1;for(;Y<$.length;){let f=J>=0?J:G0($,Y);if(J=-1,e0($,Y,f))break;if(L0($,Y,f),U0<4&&K>0&&!Z.l){let C=$.charCodeAt(Y+Q0);if(C===K5||C===p){let E=Y+Q0;for(;E<f&&$.charCodeAt(E)===C;)E++;for(;E<f&&($.charCodeAt(E)===I||$.charCodeAt(E)===w);)E++;if(E>=f){V=C===K5?1:2,Y=e($,f);break}}}K=f;let y=e($,f);if(y<$.length){if($.charCodeAt(y)===g9){var G=G0($,y);Y=e($,G),K=G;continue}let C=G0($,y);if(J=C,L0($,y,C),U0<4){let E=$.charCodeAt(y+Q0);if(E===l){Y=y;break}if(E===V5){for(var U=y+Q0,W=0;U<C&&$.charCodeAt(U)===V5&&W<=6;)W++,U++;if(W>=1&&W<=6&&(U>=C||$.charCodeAt(U)===I||$.charCodeAt(U)===w)){Y=y;break}}if(E===Z0||E===b0){for(var z=y+Q0,H=0;z<C&&$.charCodeAt(z)===E;)H++,z++;if(H>=3){Y=y;break}}if(E===Y0){var F=y+Q0+1,M=F<C?$.charCodeAt(F):0,j=M===c0||M===t5;if(!j&&M===j0){for(var _=F+1,q=_;q<C&&($.charCodeAt(q)>=h&&$.charCodeAt(q)<=u||$.charCodeAt(q)>=V0&&$.charCodeAt(q)<=q0||$.charCodeAt(q)>=r&&$.charCodeAt(q)<=o||$.charCodeAt(q)===p);)q++;q>_&&(j=l9.has($.slice(_,q).toLowerCase()))}else if(!j){for(var D=F;D<C&&($.charCodeAt(D)>=h&&$.charCodeAt(D)<=u||$.charCodeAt(D)>=V0&&$.charCodeAt(D)<=q0||$.charCodeAt(D)>=r&&$.charCodeAt(D)<=o||$.charCodeAt(D)===p);)D++;if(D>F){var A=$.slice(F,D).toLowerCase();j=l9.has(A)||N9.has(A)}}if(j&&o4($,y,Z,X)){Y=y;break}}if(E===p||E===P0||E===y5){let S=y+Q0+1;if(S<C&&($.charCodeAt(S)===I||$.charCodeAt(S)===w)){var N=v9($,S,C);if(N<C&&!d5($,y)){Y=y;break}}}if(E>=r&&E<=o){let S=y+Q0;for(;S<C&&$.charCodeAt(S)>=r&&$.charCodeAt(S)<=o;)S++;if(S<C&&($.charCodeAt(S)===Q5||$.charCodeAt(S)===F5)&&S-(y+Q0)===1&&$.charCodeAt(y+Q0)===49){var L=S+1;if(L<C&&($.charCodeAt(L)===I||$.charCodeAt(L)===w)){var O=v9($,L,C);if(O<C){Y=y;break}}}}if(E===E0){let S=e($,C);if(S<$.length){let s=G0($,S);if(c4($,S,s)){Y=y;break}}}if((E===p||E===P0||E===O0)&&d5($,y)){if(E!==p){Y=y;break}let S=0,s=y+Q0;for(;s<C&&$.charCodeAt(s)===p;)S++,s++;for(;s<C&&($.charCodeAt(s)===I||$.charCodeAt(s)===w);)s++;if(s<C){Y=y;break}}}}Y=e($,f)}for(var P=V?K:Y;P>Q&&($.charCodeAt(P-1)===g||$.charCodeAt(P-1)===v5||$.charCodeAt(P-1)===I||$.charCodeAt(P-1)===w);)P--;for(var v=Q;v<P&&($.charCodeAt(v)===I||$.charCodeAt(v)===w);)v++;if(v>=P)return null;for(var b=!1,k=v;k<P;k++)if($.charCodeAt(k)===g9){b=!0;break}var x=b?$.slice(v,P).replace(/\\u001E/g,\"\"):$.slice(v,P);if(!x)return null;let T=W9(x,!0,Z,X);return V?{node:{type:B.heading,level:V,children:T,id:\"\"},end:Y}:{node:{type:B.paragraph,children:T},end:Y}}function W9($,Q,Z,X){var Y=Z.t;if(!Y){var V=Z.k;Z.k=Q;var K=R5($,0,$.length,Z,X);return Z.k=V,K}var J=[];return Y.push({dest:J,text:$,breaks:Q,inline:Z.inline,inAnchor:Z.inAnchor,inHTML:Z.inHTML,htmlDepth:Z.d,inList:Z.inList,inBlockQuote:Z.inBlockQuote,noSetext:Z.l,depth:Z.o}),J}function t6($,Q,Z){if($.charCodeAt(Q)!==Z0)return null;let X=l5($,Q,Z,96),Y=Q+X;for(;Y<Z;){let V=$.indexOf(\"`\",Y);if(V<0||V>=Z)return null;let K=l5($,V,Z,96);if(K===X){let J=$.slice(Q+X,V);return J.indexOf(`\n`)!==-1&&(J=J.replace(/\\n/g,\" \")),J.length>0&&J[0]===\" \"&&J.at(-1)===\" \"&&J.trim().length>0&&(J=J.slice(1,-1)),{node:{type:B.codeInline,text:J},end:V+K}}Y=V+K}return null}function b$($,Q,Z){if($.charCodeAt(Q)!==Z0)return Q;let X=l5($,Q,Z,96),Y=Q+X;for(;Y<Z;){let V=$.indexOf(\"`\",Y);if(V<0||V>=Z)return Q;let K=l5($,V,Z,96);if(K===X)return V+K;Y=V+K}return Q}function e6($,Q,Z){if($.charCodeAt(Q)!==Y0)return Q;if(Q+1<Z&&$.charCodeAt(Q+1)===j0){let U=Q+2;for(;U<Z&&$.charCodeAt(U)!==l;)U++;return U<Z?U+1:Q}if(Q+3<Z&&$.charCodeAt(Q+1)===c0&&$.charCodeAt(Q+2)===p&&$.charCodeAt(Q+3)===p){let U=$.indexOf(\"-->\",Q+4);return U>=0?U+3:Q}let X=Q+1,Y=X;for(;X<Z;){let U=$.charCodeAt(X);if(U>=h&&U<=u||U>=V0&&U<=q0||U>=r&&U<=o||U===p)X++;else break}if(X===Y)return Q;let V=$.slice(Y,X).toLowerCase(),K=!1;for(;X<Z;){let U=$.charCodeAt(X);if(U===l){X++;break}if(U===j0&&X+1<Z&&$.charCodeAt(X+1)===l){X+=2,K=!0;break}if(U===T5||U===f5){var J=U;for(X++;X<Z&&$.charCodeAt(X)!==J;)X++;X<Z&&X++;continue}if(U===g)return Q;X++}if(K||Q9(V))return X;let G=1;for(;X<Z&&G>0;)if($.charCodeAt(X)===Y0)if(X+1<Z&&$.charCodeAt(X+1)===j0){let U=X+2,W=U;for(;W<Z&&($.charCodeAt(W)>=h&&$.charCodeAt(W)<=u||$.charCodeAt(W)>=V0&&$.charCodeAt(W)<=q0);)W++;if($.slice(U,W).toLowerCase()===V){for(;W<Z&&$.charCodeAt(W)!==l;)W++;if(W<Z&&W++,G--,G===0)return W}X=W}else{let U=X+1,W=U;for(;W<Z&&($.charCodeAt(W)>=h&&$.charCodeAt(W)<=u||$.charCodeAt(W)>=V0&&$.charCodeAt(W)<=q0);)W++;$.slice(U,W).toLowerCase()===V&&G++,X++}else X++;return X}function $Z($,Q,Z,X,Y){if($.charCodeAt(Q)!==b0||Q+1>=Z||$.charCodeAt(Q+1)!==b0)return null;let V=Q+2;for(;V+1<Z;){let K=$.charCodeAt(V);if(K===Z0){let J=b$($,V,Z);if(J>V){V=J;continue}}if(K===b0&&$.charCodeAt(V+1)===b0){let J=$.slice(Q+2,V),G=R5(J,0,J.length,X,Y);return{node:{type:B.textFormatted,tag:\"del\",children:G},end:V+2}}K===T0&&V+1<Z&&V++,V++}return null}function ZZ($,Q,Z,X,Y){if($.charCodeAt(Q)!==K5||Q+1>=Z||$.charCodeAt(Q+1)!==K5)return null;let V=Q+2;for(;V+1<Z;){let K=$.charCodeAt(V);if(K===Z0){let J=b$($,V,Z);if(J>V){V=J;continue}}if(K===K5&&$.charCodeAt(V+1)===K5&&V>Q+2){let J=$.slice(Q+2,V),G=R5(J,0,J.length,X,Y);return{node:{type:B.textFormatted,tag:\"mark\",children:G},end:V+2}}K===T0&&V+1<Z&&V++,V++}return null}function k4($,Q,Z){return $<U9?!!(R$($)&$9):K4.test(Q[Z])}function x4($,Q,Z){return $<U9?!!(R$($)&h5):J4.test(Q[Z])}function QZ($,Q,Z){var X=$.charCodeAt(Q);if(X!==P0&&X!==O0)return null;var Y=l5($,Q,Z,X);if(Y===0)return null;var V=Q>0?$.charCodeAt(Q-1):32,K=Q+Y<Z?$.charCodeAt(Q+Y):32,J=x4(V,$,Q-1),G=x4(K,$,Q+Y),U=Q>0?k4(V,$,Q-1):!1,W=Q+Y<Z?k4(K,$,Q+Y):!1,z=!G&&(!W||J||U),H=!J&&(!U||G||W),F,M;return X===P0?(F=z,M=H):(F=z&&(!H||U),M=H&&(!z||W)),{len:Y,canOpen:F,canClose:M}}function XZ($,Q,Z,X){if(Q.length!==0){for(var Y=$.length,V=Array(Y),K=null,J=null,G=0;G<Y;G++){var U={node:$[G],prev:J,next:null};J?J.next=U:K=U,V[G]=U,J=U}for(var W=Array(Q.length),z=0;z<Q.length;z++)W[z]=V[Q[z].idx];for(var H=[],F=0;F<12;F++)H[F]=-1;for(var M=0;M<Q.length;){var j=Q[M];if(!(j.active&&j.canClose)){M++;continue}for(var _=j.ch===P0?0:1,q=_*6+j.len%3*2+(j.canOpen?1:0),D=H[q]===void 0?-1:H[q],A=-1,N=M-1;N>D;N--){var L=Q[N];if(!(!L.active||L.ch!==j.ch||!L.canOpen)&&!((j.canOpen||L.canClose)&&(L.len+j.len)%3===0&&L.len%3!==0)){A=N;break}}if(A<0){H[q]=M-1,!j.canOpen&&(j.active=!1),M++;continue}var O=Q[A],P=O.len>=2&&j.len>=2,v=P?2:1;O.len-=v,j.len-=v;var b=W[A],k=W[M],x=b.node,T=k.node;x.text=x.text.slice(0,x.text.length-v),T.text=T.text.slice(v);for(var f=[],y=b.next;y&&y!==k;)f.push(y.node),y=y.next;var C={type:B.textFormatted,tag:P?\"strong\":\"em\",children:f},E={node:C,prev:b,next:k};b.next=E,k.prev=E;for(var S=A+1;S<M;S++)Q[S].active=!1;if(O.len===0&&(O.active=!1,x.text===\"\")){var s=b.prev;E.prev=s,s?s.next=E:K=E}if(j.len===0){if(j.active=!1,T.text===\"\"){var X0=k.next;E.next=X0,X0&&(X0.prev=E)}}else continue;M++}for(var I0=0,d=K;d;){var u0=d.node;if(u0.type===B.text){var B0=u0;if(B0.text===\"\"){d=d.next;continue}if(I0>0&&$[I0-1].type===B.text){$[I0-1].text+=B0.text,d=d.next;continue}}$[I0++]=u0,d=d.next}$.length=I0}}function m9($,Q,Z,X){return Q($,Z,X)===null?null:$}var E4=0,v$=0,g4=0,I$=0,C4=0,N$=0,H$=0,O5=0;function YZ(){return H$===2147483647&&(v$=0,I$=0,N$=0,c9=0,H$=0),++H$}var M$=null,c9=0,u9=[],O$=256;function f4($,Q,Z,X,Y){let V=$.charCodeAt(Q)===c0,K=V?Q+1:Q;if($.charCodeAt(K)!==A0||I$===O5&&K>=g4)return null;var J=c9===O5?M$:null,G=J===null?0:J[K];if(G<0)return null;var U=G;if(G===0){var W=$.indexOf(\"]\",K+1);if(W<0||W>=Z)return g4=K,I$=O5,null;U=K+1;var z=0;u9[z++]=K;for(var H=Z-K>=O$;U<Z&&z>0;){var F=$.charCodeAt(U);if(F===T0&&U+1<Z){U+=2;continue}if(F===Z0){var M=b$($,U,Z);if(M>U){U=M;continue}}if(F===Y0){var j=i4($,U,Z);if(j){U=j.end;continue}var _=e6($,U,Z);if(_>U){U=_;continue}}if(F===A0)u9[z++]=U;else if(F===J5){var q=u9[--z];J===null&&H&&U-K>=O$&&(J=M$=new Int32Array(Z),c9=O5),J!==null&&(J[q]=U+1)}U++}if(z>0){if(J===null&&H&&U-K>=O$&&(J=M$=new Int32Array(Z),c9=O5),J!==null)for(;z>0;)J[u9[--z]]=-1;return null}}var D=U-1,A=$.slice(K+1,D),N=U<Z?$.charCodeAt(U):0,L=!1;if(N===z5){var O=!0;for(U++;U<Z&&($.charCodeAt(U)===I||$.charCodeAt(U)===g);)U++;var P=\"\",v=U;if(U<Z&&$.charCodeAt(U)===Y0){for(U++,v=U;v<Z&&$.charCodeAt(v)!==l;){if($.charCodeAt(v)===T0&&v+1<Z){v+=2;continue}if($.charCodeAt(v)===g){O=!1;break}v++}O&&(v>=Z||$.charCodeAt(v)!==l)&&(O=!1),O&&(P=$.slice(U,v),v++)}else if(O){var b=v$===O5?E4:-1;if(b>=0&&U>=b)O=!1;else{for(var k=0,x=!1;v<Z;){var T=$.charCodeAt(v);if(T===T0&&v+1<Z){v+=2;continue}if(T===z5)k++;else if(T===F5){if(x=!0,k===0)break;k--}else if(T===I||T===g)break;v++}v>=Z&&!x&&(b<0||U<b)&&(E4=U,v$=O5),P=$.slice(U,v)}}if(O){for(U=v;U<Z&&($.charCodeAt(U)===I||$.charCodeAt(U)===g);)U++;var f;if(U<Z){var y=$.charCodeAt(U);if(y===T5||y===f5||y===z5){var C=y===z5?41:y;U++;for(var E=U;U<Z&&$.charCodeAt(U)!==C;)$.charCodeAt(U)===T0&&U+1<Z&&U++,U++;U>=Z?O=!1:(f=$.slice(E,U),U++)}}if(O){for(;U<Z&&($.charCodeAt(U)===I||$.charCodeAt(U)===g);)U++;(U>=Z||$.charCodeAt(U)!==F5)&&(O=!1)}}if(O){if(U++,P=I5(q9(P)),f!==void 0&&(f=I5(q9(f))),V){var S=R5(A,0,A.length,X,Y),s=o9(S);return{node:{type:B.image,target:m9(P,Y?.sanitizer||H5,\"img\",\"src\"),alt:s,title:f},end:U}}var X0=X.inAnchor;X.inAnchor=!0;var m=X0?[{type:B.text,text:A}]:R5(A,0,A.length,X,Y);return X.inAnchor=X0,!X.inAnchor&&P$(m)?null:{node:{type:B.link,target:m9(P,Y?.sanitizer||H5,\"a\",\"href\"),title:f,children:m},end:U}}U=D+1,L=!0}var I0=\"\",d=U;if(!L&&N===A0){var u0=U+1;d=u0;for(var B0=!1;d<Z&&$.charCodeAt(d)!==J5;){if($.charCodeAt(d)===T0&&d+1<Z){d+=2;continue}if($.charCodeAt(d)===A0){B0=!0;break}d++}if(B0||d>=Z)return null;var W0=$.slice(u0,d);if(W0.trim())I0=p9(W0);else{if(I4(A))return null;I0=p9(A)}d+=1}else{if(I4(A))return null;I0=p9(A)}var H0=X.refs?.[I0];if(!H0)return null;if(V)return{node:{type:B.image,target:m9(H0.target,Y?.sanitizer||H5,\"img\",\"src\"),alt:o9(R5(A,0,A.length,X,Y)),title:H0.title},end:d};var D0=X.inAnchor;X.inAnchor=!0;var m=D0?[{type:B.text,text:A}]:R5(A,0,A.length,X,Y);return X.inAnchor=D0,!X.inAnchor&&P$(m)?null:{node:{type:B.link,target:m9(H0.target,Y?.sanitizer||H5,\"a\",\"href\"),title:H0.title,children:m},end:d}}function i4($,Q,Z){if($.charCodeAt(Q)!==Y0)return null;for(var X=Q+1;X<Z;){var Y=$.charCodeAt(X);if(Y===l)break;if(Y===I||Y===g||Y===v5||Y===Y0)return null;X++}if(X>=Z||$.charCodeAt(X)!==l)return null;var V=$.slice(Q+1,X),K=V.match(/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^\\x00-\\x20]*)$/);return K?{node:{type:B.link,target:V,title:void 0,children:[{type:B.text,text:V}]},end:X+1}:V.indexOf(\"@\")!==-1&&/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(V)?{node:{type:B.link,target:`mailto:${V}`,title:void 0,children:[{type:B.text,text:V}]},end:X+1}:null}function VZ($,Q,Z,X){if($.charCodeAt(Q)!==A0||Q+1>=Z||$.charCodeAt(Q+1)!==W5||N$===O5&&Q>=C4)return null;let Y=Q+2;for(;Y<Z&&$.charCodeAt(Y)!==J5&&$.charCodeAt(Y)!==g;)Y++;if(Y>=Z)return C4=Q,N$=O5,null;if($.charCodeAt(Y)!==J5)return null;let V=$.slice(Q+2,Y);return V?{node:{type:B.footnoteReference,target:`#${N5(V)}`,text:V},end:Y+1}:null}function KZ($,Q,Z,X){if(X.disableBareUrls)return null;var Y=\"\",V=!1,K=$.charCodeAt(Q);if(K===A9||K===72?Q+8<=Z&&$.charCodeAt(Q+1)===s5&&$.charCodeAt(Q+2)===s5&&$.charCodeAt(Q+3)===x9&&($.charCodeAt(Q+4)===Y$&&$.charCodeAt(Q+5)===m0&&$.charCodeAt(Q+6)===j0&&$.charCodeAt(Q+7)===j0?Y=\"https://\":$.charCodeAt(Q+4)===m0&&$.charCodeAt(Q+5)===j0&&$.charCodeAt(Q+6)===j0&&(Y=\"http://\")):K===L5||K===70?Q+6<=Z&&$.charCodeAt(Q+1)===s5&&$.charCodeAt(Q+2)===x9&&$.charCodeAt(Q+3)===m0&&$.charCodeAt(Q+4)===j0&&$.charCodeAt(Q+5)===j0&&(Y=\"ftp://\"):(K===C5||K===87)&&Q+4<=Z&&$.charCodeAt(Q+1)===C5&&$.charCodeAt(Q+2)===C5&&$.charCodeAt(Q+3)===Q5&&(Y=\"www.\",V=!0),!Y)return null;let J=Q+Y.length;for(;J<Z;){let O=$.charCodeAt(J);if(O===I||O===g||O===w||O===v5||O===Y0||O===l)break;J++}for(var G=0,U=0,W=Q;W<J;W++){var z=$.charCodeAt(W);z===z5?G++:z===F5&&U++}let H=J;for(;H>Q+Y.length;){let O=$.charCodeAt(H-1);if(O===Q5||O===r$||O===m0||O===c0||O===t5||O===F5||O===P0||O===O0||O===b0){if(O===F5){if(G>=U)break;U--}H--}else if(O===j9){for(var F=H-2;F>Q&&($.charCodeAt(F)>=h&&$.charCodeAt(F)<=u||$.charCodeAt(F)>=V0&&$.charCodeAt(F)<=q0||$.charCodeAt(F)>=r&&$.charCodeAt(F)<=o);)F--;F>=Q&&$.charCodeAt(F)===O9?H=F:H--}else break}if(H<=Q+Y.length)return null;var M=Q+(V?4:Y.length),j=$.indexOf(\"/\",M);if((j<0||j>H)&&(j=H),V&&$.indexOf(\".\",M)===-1)return null;for(var _=-1,q=-1,D=j-1;D>=M;D--)if($.charCodeAt(D)===Q5)if(_<0)_=D;else{q=D;break}for(var A=q>=0?q+1:M,D=A;D<j;D++)if($.charCodeAt(D)===O0)return null;var N=$.slice(Q,H),L=V?`http://${N}`:N;return{node:{type:B.link,target:L,title:void 0,children:[{type:B.text,text:N}]},end:H}}function JZ($,Q,Z,X){if(X.disableBareUrls)return null;for(var Y=Q,V=Y;Y<Z;){var K=$.charCodeAt(Y);if(K>=h&&K<=u||K>=V0&&K<=q0||K>=r&&K<=o||K===Q5||K===c0||K===V5||K===36||K===M9||K===O9||K===f5||K===P0||K===y5||K===j0||K===K5||K===t5||K===W5||K===O0||K===Z0||K===S5||K===E0||K===E9||K===b0||K===p)Y++;else break}if(Y===V||Y>=Z||$.charCodeAt(Y)!==k9)return null;Y++;for(var J=Y,G=-1,U=Y;Y<Z;){var K=$.charCodeAt(Y);if(K>=h&&K<=u||K>=V0&&K<=q0||K>=r&&K<=o)Y++;else if((K===p||K===O0)&&Y>J)Y++;else if(K===Q5){if(Y===J)break;var W=$.charCodeAt(Y-1);if(W===p||W===O0||Y-U>63)break;if(Y+1<Z){var z=$.charCodeAt(Y+1);if(z>=h&&z<=u||z>=V0&&z<=q0||z>=r&&z<=o)G=Y,U=Y+1,Y++;else break}else break}else break}if(Y-U>63||G<0)return null;var H=$.charCodeAt(Y-1);if(!(H>=h&&H<=u||H>=V0&&H<=q0||H>=r&&H<=o)||Y<=G+1)return null;for(var F=-1,M=G-1;M>=J;M--)if($.charCodeAt(M)===Q5){F=M;break}for(var j=F>=0?F+1:J,M=j;M<Y;M++)if($.charCodeAt(M)===O0)return null;var _=$.slice(Q,Y);return{node:{type:B.link,target:`mailto:${_}`,title:void 0,children:[{type:B.text,text:_}]},end:Y}}function P$($){for(var Q=0;Q<$.length;Q++)if($[Q].type===B.link||\"children\"in $[Q]&&Array.isArray($[Q].children)&&P$($[Q].children))return!0;return!1}function o9($,Q){for(var Z=\"\",X=0;X<$.length;X++){var Y=$[X];Y.type===B.text?Z+=Y.text:Y.type===B.breakLine?Z+=\" \":Y.type===B.codeInline||Y.type===B.footnoteReference?Z+=Y.text:\"children\"in Y&&Array.isArray(Y.children)?Z+=o9(Y.children,Q):!Q&&Y.type===B.image&&(Z+=Y.alt||\"\")}return Z}function w$($,Q,Z){for(var X=0;X<$.length;X++){var Y=$[X];if(Y.type===B.heading){var V=Y;V.id=u6(Z(o9(V.children,!0)),Q)}if(\"children\"in Y){var K=Y.children;Array.isArray(K)&&w$(K,Q,Z)}if((Y.type===B.orderedList||Y.type===B.unorderedList)&&Array.isArray(Y.items))for(var J=Y.items,G=0;G<J.length;G++)w$(J[G],Q,Z)}}function X9($){return{type:B.text,text:$}}function UZ($,Q,Z){var X=Q+1;if(X>=Z)return-1;if($.charCodeAt(X)===V5){X++;var Y=X<Z&&($.charCodeAt(X)===V$||$.charCodeAt(X)===K$);Y&&X++;for(var V=X,K=Y?6:7;X<Z&&X-V<=K;){var J=$.charCodeAt(X),G=J>=r&&J<=o||Y&&(J>=h&&J<=D9||J>=V0&&J<=L5);if(!G)break;X++}return X===V||X-V>K?-1:X<Z&&$.charCodeAt(X)===j9?X+1:-1}for(var U=X;X<Z&&X-U<48;){var W=$.charCodeAt(X);if(W>=h&&W<=u||W>=V0&&W<=q0||W>=r&&W<=o){X++;continue}break}return X===U?-1:X<Z&&$.charCodeAt(X)===j9?X+1:-1}function GZ($,Q,Z,X,Y){if($.charCodeAt(Q)!==Y0)return null;var V=Q+1;if(V>=Z)return null;var K=$.charCodeAt(V);if(K===c0&&V+1<Z&&$.charCodeAt(V+1)===p&&V+2<Z&&$.charCodeAt(V+2)===p){var J=V+3;if(J<Z&&$.charCodeAt(J)===l)return{node:{type:B.htmlComment,text:\"\",s:!0},end:J+1};if(J+1<Z&&$.charCodeAt(J)===p&&$.charCodeAt(J+1)===l)return{node:{type:B.htmlComment,text:\"-\",s:!0},end:J+2};var G=$.indexOf(\"-->\",J);return G!==-1&&G<=Z-3?{node:{type:B.htmlComment,text:$.slice(Q+4,G),s:!1},end:G+3}:null}if(K===t5){var U=$.indexOf(\"?>\",V+1);return U!==-1&&U<Z?{node:{type:B.htmlSelfClosing,tag:\"?\",attrs:{},m:$.slice(Q,U+2),a:!1},end:U+2}:null}if(K===c0&&V+1<Z){var W=$.charCodeAt(V+1);if(W===A0&&$.slice(V+1,V+8)===\"[CDATA[\"){var z=$.indexOf(\"]]>\",V+8);return z!==-1&&z<Z?{node:{type:B.htmlSelfClosing,tag:\"![CDATA[\",attrs:{},m:$.slice(Q,z+3),a:!1},end:z+3}:null}if(W>=h&&W<=u){var H=$.indexOf(\">\",V+2);return H!==-1&&H<Z?{node:{type:B.htmlSelfClosing,tag:`!${$.slice(V+1,H)}`,attrs:{},m:$.slice(Q,H+1),a:!1},end:H+1}:null}}if(K===j0){var F=V+1;if(F>=Z)return null;var M=$.charCodeAt(F);if(!(M>=h&&M<=u||M>=V0&&M<=q0))return null;for(F++;F<Z;){var j=$.charCodeAt(F);if(j>=h&&j<=u||j>=V0&&j<=q0||j>=r&&j<=o||j===p)F++;else break}for(;F<Z&&($.charCodeAt(F)===I||$.charCodeAt(F)===w||$.charCodeAt(F)===g);)F++;if(F<Z&&$.charCodeAt(F)===l){var _=$.slice(V+1,F).trim();return{node:{type:B.htmlSelfClosing,tag:_,attrs:{},h:$.slice(Q,F+1),a:!0},end:F+1}}return null}if(!(K>=h&&K<=u||K>=V0&&K<=q0))return null;var q=w5($,Q);if(!q)return null;var D=q.tag,A=D.toLowerCase(),N=q.n;if(N||Q9(D))return{node:{type:B.htmlSelfClosing,tag:D,attrs:P5(q.attrs,D,Y),m:q.q?A$(q):$.slice(Q,q.end),a:!1},end:q.end};var L=N9.has(A),O=_$($.slice(0,Z),q.end,D);if(O===-1)return{node:{type:B.htmlSelfClosing,tag:D,attrs:P5(q.attrs,D,Y),m:q.q?A$(q):$.slice(Q,q.end),a:!1},end:q.end};var P=o6($,`</${A}`,O),v=$.slice(q.end,P);if(L){var b=G5(v);return{node:{type:B.htmlBlock,tag:D,attrs:P5(q.attrs,D,Y),b:q.g+q.b,children:[],e:b||void 0,h:$.slice(P,O),text:b,c:!0,a:!1},end:O}}var k=[],x=v.trim();if(x){var{inAnchor:T,inline:f,k:y}=X;A===\"a\"&&(X.inAnchor=!0),X.k=!1;var C=x.indexOf(`\n\n`)!==-1||/^#{1,6}\\s/.test(x);C?(X.inline=!1,k=c5(x,X,Y)):k=R5(x,0,x.length,X,Y),X.inAnchor=T,X.inline=f,X.k=y}return{node:{type:B.htmlBlock,tag:D,attrs:P5(q.attrs,D,Y),b:q.b,children:k,text:G5(v),c:!1,a:!1},end:O}}var qZ=200,_9=0;function R5($,Q,Z,X,Y){if(_9++,_9>qZ)return _9--,[{type:B.text,text:$.slice(Q,Z)}];var V=O5;O5=YZ();let K=X;if(Y.optimizeForStreaming){let $0=function(t,d0){for(var n0=1,$5=d0+1;$5<t.length;$5++){var l0=t.charCodeAt($5);if(l0===A0)n0++;else if(l0===J5&&(n0--,n0===0))return $5}return-1},R=$.slice(Q,Z),J0=R;for(var J=0,G=0,U=0,W=0,z=0,H=-1,F=-1,M=-1,j=-1,_=-1,q=0;q<R.length;q++){var D=R.charCodeAt(q);D===P0?q+1<R.length&&R.charCodeAt(q+1)===P0?(J++,H=q,q++):(G++,F=q):D===O0?q+1<R.length&&R.charCodeAt(q+1)===O0?(U++,M=q,q++):(W++,j=q):D===b0&&q+1<R.length&&R.charCodeAt(q+1)===b0&&(z++,_=q,q++)}var A=[];z%2===1&&_>=0&&A.push([_,2]),U%2===1&&M>=0&&A.push([M,2]),W%2===1&&j>=0&&A.push([j,1]),J%2===1&&H>=0&&A.push([H,2]),G%2===1&&F>=0&&A.push([F,1]),A.sort((t,d0)=>d0[0]-t[0]);for(var N=0;N<A.length;N++){var L=A[N][0],O=A[N][1];R=R.slice(0,L)+R.slice(L+O)}let a0=0,q5=-1;for(let t=0;t<R.length;t++)R.charCodeAt(t)===Z0&&(a0++,q5=t);if(a0%2===1&&q5!==-1){let t=!1,d0=-1,n0=0;for(;n0<R.length;)R.charCodeAt(n0)===Z0&&(t?(t=!1,d0=-1):(d0=n0,t=!0)),n0++;t&&d0!==-1&&(R=R.slice(0,d0))}for(var P=!0;P;){P=!1;for(var v=-1,b=-1,k=-1,x=!1,T=0;T<R.length;T++){var f=R.charCodeAt(T);if(f===A0&&(T===0||R.charCodeAt(T-1)!==T0)){var y=T>0&&R.charCodeAt(T-1)===c0,C=y?T-1:T,E=$0(R,T);if(E===-1)v=C,x=y,b=T+1,k=R.length;else{var S=E+1;if(S>=R.length)v=C,x=y,b=T+1,k=E;else if(R.charCodeAt(S)===z5){var s=R.indexOf(\")\",S+1);s===-1?(v=C,x=y,b=T+1,k=E,T=R.length):T=s}else if(R.charCodeAt(S)===A0){var X0=R.indexOf(\"]\",S+1);X0===-1?(v=C,x=y,b=T+1,k=E,T=R.length):T=X0}else T=E}}}if(v>=0){var I0=x?\"\":R.slice(b,k);R=R.slice(0,v)+I0,P=!0}}let C0=R.match(/<([A-Z][A-Za-z0-9]*)(?:\\s[^>]*)?>([^<]*)$/);if(C0&&C0.index!==void 0){var d=C0[0].length-C0[2].length,u0=d>=2&&C0[0].charCodeAt(d-2)===j0;if(!u0){for(var B0=!1,W0=0,H0=0;H0<C0.index;H0++)R.charCodeAt(H0)===Z0&&W0++;if(B0=W0%2===1,!B0){let t=C0[1];p5(R,`</${t}`,0)===-1&&(R=R.slice(0,C0.index)+C0[2])}}}R!==J0&&($=$.slice(0,Q)+R,Z=Q+R.length)}let D0=[];var m=[];let c=Q;var K0=\"\",y0=Y.disableAutoLink||Y.disableBareUrls||K.inAnchor?-1:$.indexOf(\"@\",Q);for(y0>=Z&&(y0=-1);Q<Z;){let R=$.charCodeAt(Q),J0=null;if(R===Z0){if(J0=t6($,Q,Z),!J0){var S0=l5($,Q,Z,Z0);Q+=S0-1}}else if(R===P0||R===O0){var _0=QZ($,Q,Z);if(_0){if(_0.canOpen||_0.canClose){(K0||Q>c)&&(D0.push(X9(K0+$.slice(c,Q))),K0=\"\");var a=$.slice(Q,Q+_0.len),w0=X9(a);m.push({idx:D0.length,ch:R,len:_0.len,canOpen:_0.canOpen,canClose:_0.canClose,active:!0}),D0.push(w0),Q+=_0.len,c=Q;continue}Q+=_0.len-1}}else if(R===b0)J0=$Z($,Q,Z,K,Y);else if(R===K5)J0=ZZ($,Q,Z,K,Y);else if(R===A0)Q+1<Z&&$.charCodeAt(Q+1)===W5&&(J0=VZ($,Q,Z,K)),J0||(J0=f4($,Q,Z,K,Y));else if(R===c0&&Q+1<Z&&$.charCodeAt(Q+1)===A0)J0=f4($,Q,Z,K,Y);else if(R===Y0)J0=i4($,Q,Z),!(J0||Y.disableParsingRawHTML||Y.ignoreHTMLBlocks)&&(J0=GZ($,Q,Z,K,Y));else if(R===O9){var z0=UZ($,Q,Z);if(z0!==-1){var F0=$.slice(Q,z0),M0=I5(F0);if(M0!==F0){K0=K0+$.slice(c,Q)+M0,Q=z0,c=z0;continue}}}else if((R===A9||R===C5||R===L5)&&!K.inAnchor&&!Y.disableAutoLink&&(Q===0||$.charCodeAt(Q-1)!==Y0)){var f0=Q+1<Z?$.charCodeAt(Q+1):0;(R===A9&&f0===s5||R===L5&&f0===s5||R===C5&&f0===C5)&&(J0=KZ($,Q,Z,Y))}if(!J0&&y0>=0&&y0-Q<=64&&!K.inAnchor&&!Y.disableAutoLink&&!Y.disableBareUrls&&(R>=h&&R<=u||R>=V0&&R<=q0||R>=r&&R<=o)&&(J0=JZ($,Q,Z,Y),!J0&&Q>=y0&&(y0=$.indexOf(\"@\",Q+1),y0>=Z&&(y0=-1))),R===g&&K.k){var v0=!1,k0=0;if(Q>c&&$.charCodeAt(Q-1)===T0)v0=!0,k0=1;else{for(var h0=0,p0=Q-1;p0>=c&&$.charCodeAt(p0)===I;)h0++,p0--;h0>=2&&(v0=!0,k0=h0)}if(v0){for((K0||Q-k0>c)&&(D0.push(X9(K0+$.slice(c,Q-k0))),K0=\"\"),D0.push({type:B.breakLine}),Q++;Q<Z&&$.charCodeAt(Q)===I;)Q++;c=Q;continue}var n=Q>c&&$.charCodeAt(Q-1)===I,N0=Q+1<Z&&$.charCodeAt(Q+1)===I;if(n||N0){for(var i=Q;i>c&&$.charCodeAt(i-1)===I;)i--;for(K0+=`${$.slice(c,i)}\n`,Q++;Q<Z&&$.charCodeAt(Q)===I;)Q++;c=Q;continue}}if(J0)(K0||Q>c)&&(D0.push(X9(K0+$.slice(c,Q))),K0=\"\"),D0.push(J0.node),Q=J0.end,c=Q;else{if(R===T0&&Q+1<Z){let a0=$.charCodeAt(Q+1);if(R$(a0)&$9){(K0||Q>c)&&(D0.push(X9(K0+$.slice(c,Q))),K0=\"\"),D0.push(X9($[Q+1])),Q+=2,c=Q;continue}}if(Q++,y0<0||y0-Q>64)for(;Q<Z&&!(y0>=0&&y0-Q<=64);){var x0=$.charCodeAt(Q);if(x0<U9&&!u4[x0])Q++;else break}}}return(K0||Z>c)&&(D0.push(X9(K0+$.slice(c,Z))),K0=\"\"),m.length>0&&XZ(D0,m,X,Y),O5=V,_9--,D0}var WZ=500;function c5($,Q,Z){var X=Q.o||0;if(X>WZ)return[{type:B.text,text:$}];Q.o=X+1;let Y=Q;if(Z.optimizeForStreaming&&!(Q.i||Q.w)){for(var V=$.length;V>0&&$.charCodeAt(V-1)===g;)V--;for(var K=V;K>0&&$.charCodeAt(K-1)!==g;)K--;if(V>K&&$.charCodeAt(K)===E0){for(var J=!1,G=K+1;G<V;G++){var U=$.charCodeAt(G);if(U!==I&&U!==w&&U!==E0&&U!==m0&&U!==p){J=!0;break}}for(var W=!1,z=!1,H=0,F=K,M=K-1;M>0;){for(var j=M;j>0&&$.charCodeAt(j-1)!==g;)j--;if($.charCodeAt(j)!==E0)break;F=j;for(var _=!0,q=!1,D=j;D<M;D++){var A=$.charCodeAt(D);if(A===p)q=!0;else if(A!==I&&A!==w&&A!==m0&&A!==E0){_=!1;break}}_&&q?(W=!0,z=!0):z||H++,M=j-1}J?W||($=$.slice(0,K).trimEnd()):$=W&&H>0?$.slice(0,K).trimEnd():$.slice(0,F).trimEnd()}for(var N=-1,L=-1,O=-1,P=!1,v=$.length-1;v>=0;v--)if($.charCodeAt(v)===Y0){for(var b=v+1<$.length?$.charCodeAt(v+1):0,k=b>=h&&b<=u||b>=V0&&b<=q0,x=b===j0&&v+2<$.length&&($.charCodeAt(v+2)>=h&&$.charCodeAt(v+2)<=u||$.charCodeAt(v+2)>=V0&&$.charCodeAt(v+2)<=q0),T=b===c0||b===t5,f=$.length;f>v+1&&$.charCodeAt(f-1)===g;)f--;var y=v+1>=f;if(k||x||T||y){var C=v+1;if((x||k)&&(C=v+2),k||x)for(;C<$.length;){var E=$.charCodeAt(C);if(E>=h&&E<=u||E>=V0&&E<=q0||E>=r&&E<=o)C++;else break}for(var S=k||x?C:v+2;S<$.length&&$.charCodeAt(S)!==l;)S++;if(S>=$.length)N=v,P=!0;else if((k||x)&&$.charCodeAt(S-1)!==j0){for(var s=!1,X0=S+1;X0<$.length;X0++)if($.charCodeAt(X0)===Y0){s=!0;break}s||(N=v,L=C,O=S+1)}}break}if(N>=0){for(var I0=0,d=0;d<N;d++)$.charCodeAt(d)===Z0&&I0++;if(I0%2===0)if(P)$=$.slice(0,N);else{var u0=$.slice(N+1,L);p5($,`</${u0}`,0)===-1&&($=$.slice(0,N)+$.slice(O))}}for(var B0=$.length;B0>0&&$.charCodeAt(B0-1)===g;)B0--;if(B0>0){for(var W0=B0;W0>0&&$.charCodeAt(W0-1)!==g;)W0--;for(var H0=W0,D0=0;H0<B0&&$.charCodeAt(H0)===I&&D0<3;)H0++,D0++;if(W0>0&&H0<B0&&d6($,H0,B0)){for(var m=W0-1,c=m;c>0&&$.charCodeAt(c-1)!==g;)c--;e0($,c,m)||($=$.slice(0,W0).trimEnd())}}var K0=$.length;if(K0>0){for(var y0=$.lastIndexOf(`\n`),S0=y0===-1?0:y0+1,_0=K0,a=S0,w0=0;a<_0&&$.charCodeAt(a)===I&&w0<3;)a++,w0++;if(a<_0){var z0=$.charCodeAt(a),F0=!1;if(z0===P0||z0===p||z0===y5){var M0=a+1;if(M0>=_0||$.charCodeAt(M0)===I||$.charCodeAt(M0)===w){for(var f0=M0;f0<_0&&($.charCodeAt(f0)===I||$.charCodeAt(f0)===w);)f0++;f0>=_0&&(F0=!0)}}else if(z0>=r&&z0<=o){for(var v0=a;v0<_0&&$.charCodeAt(v0)>=r&&$.charCodeAt(v0)<=o;)v0++;if(v0<_0&&($.charCodeAt(v0)===Q5||$.charCodeAt(v0)===F5)){var k0=v0+1;if(k0>=_0||$.charCodeAt(k0)===I||$.charCodeAt(k0)===w){for(var h0=k0;h0<_0&&($.charCodeAt(h0)===I||$.charCodeAt(h0)===w);)h0++;h0>=_0&&(F0=!0)}}}F0&&($=$.slice(0,S0).trimEnd())}}}if(Q.inline)return R5($,0,$.length,Q,Z);let p0=[],n=0,N0=$.length;if(n===0&&!Z.disableFrontmatter&&$.startsWith(\"---\")){let $0=X4($);if($0?.hasValidYaml){if(Z.preserveFrontmatter!==!1){let C0=$.slice(0,$0.endPos).trimEnd();p0.push({type:B.frontmatter,text:C0})}n=$0.endPos}}for(;n<N0;){for(var i=$.indexOf(`\n`,n),x0=i<0?N0:i;n<N0&&e0($,n,x0);)n=x0<N0?x0+1:x0,n<N0&&(i=$.indexOf(`\n`,n),x0=i<0?N0:i);if(n>=N0)break;var R=$.charCodeAt(n)===g9;L0($,n,x0);let $0=null;if(j$=$,B$=n,d9=x0,!R&&U0>=4&&!Q.inHTML)$0=l6($,n);else if(!R){let C0=n+Q0,t=$.charCodeAt(C0);t===V5?$0=p6($,n,Q,Z):t===l?$0=r6($,n,Q,Z):t===Z0||t===b0?$0=c6($,n,Q):t===p||t===P0||t===O0?($0=d5($,n),!$0&&($0=T4($,n,Q,Z))):t===y5||t>=r&&t<=o?$0=T4($,n,Q,Z):t===Y0?$0=o4($,n,Q,Z):t===E0?$0=S4($,n,Q,Z):t===A0&&($0=a6($,n,Q))}if(!$0){for(var J0=!1,a0=n;a0<x0;a0++)if($.charCodeAt(a0)===E0){J0=!0;break}J0&&($0=S4($,n,Q,Z))}if($0||($0=s6($,n,Q,Z)),$0)$0.node.type!==B.refCollection&&p0.push($0.node),n=$0.end;else{var q5=$.indexOf(`\n`,n);n=q5<0?N0:q5+1}}return Q.o=X,p0}function zZ($,Q){return $.charCodeAt(0)===65279&&($=$.slice(1)),P9($,{inAnchor:!1,inBlockQuote:!1,inHTML:!1,inList:!1,inline:!1,refs:{}},I9(Q))}function a4($,Q,Z,X){var Y=w5($,Q);return Y?{tagName:Y.tag,tagLower:Y.tag.toLowerCase(),attrs:Y.b,whitespaceBeforeAttrs:Y.g,isSelfClosing:Y.n,hasSpaceBeforeSlash:Y.r,isClosing:Y.f,hasNewline:Y.g.includes(`\n`)||Y.b.includes(`\n`),endPos:Y.end}:null}function P9($,Q,Z){_9=0,$=U4($),!Q.refs&&(Q.refs={}),(Z.optimizeForStreaming||Q.inline)&&(Q.w=m6($,Q.refs,Z));var X,Y;Q.t||(Q.t=X=[],Q.p=Y=[]);let V=c5($,Q,Z);if(X&&Y){for(var K=X,J={inline:Q.inline,inAnchor:Q.inAnchor,inHTML:Q.inHTML,htmlDepth:Q.d,inList:Q.inList,inBlockQuote:Q.inBlockQuote,noSetext:Q.l,depth:Q.o},G=0;G<K.length;G++){var U=K[G];Q.inline=U.inline,Q.inAnchor=U.inAnchor,Q.inHTML=U.inHTML,Q.d=U.htmlDepth,Q.inList=U.inList,Q.inBlockQuote=U.inBlockQuote,Q.l=U.noSetext,Q.o=U.depth,Q.k=U.breaks;var W=R5(U.text,0,U.text.length,Q,Z);Q.k=!1;for(var z=0;z<W.length;z++)U.dest.push(W[z])}Q.inline=J.inline,Q.inAnchor=J.inAnchor,Q.inHTML=J.inHTML,Q.d=J.htmlDepth,Q.inList=J.inList,Q.inBlockQuote=J.inBlockQuote,Q.l=J.noSetext,Q.o=J.depth;for(var H=Y,F=0;F<H.length;F++)for(var M=H[F],j=0;j<M.src.length;j++){var _=M.src[j];if(M.unwrap&&_.type===B.paragraph)for(var q=_.children,D=0;D<q.length;D++)M.dest.push(q[D]);else M.dest.push(_)}Q.t=void 0,Q.p=void 0,w$(V,Q,Z.slugify)}return f9(Q.refs)?[{type:B.refCollection,refs:Q.refs},...V]:V}var L$;try{Y9=i0.createElement(\"div\"),L$=Y9!=null&&typeof Y9==\"object\"&&\"$$typeof\"in Y9&&typeof Y9.$$typeof==\"symbol\"?Y9.$$typeof:Symbol.for(\"react.transitional.element\")}catch{L$=Symbol.for(\"react.transitional.element\")}var Y9;function T$($,Q,Z){return{$$typeof:L$,type:$,key:Z==null?null:String(Z),ref:null,props:Q,_owner:null,_store:{},_debugStack:null,_debugTask:null}}function D5($,Q){var Z={key:$};if(Q){var X=U$(Q);for(var Y in X)Z[Y]=X[Y]}return Z}var i9=typeof i0.createContext>\"u\"?void 0:i0.createContext(void 0);function n4($,Q,Z,X,Y,V,K,J,G){switch($.type){case B.blockQuote:{let q={key:Z.key};return $.alert&&(q.className=`markdown-alert-${V($.alert.toLowerCase(),N5)}`,$.children.unshift(q4($.alert))),X(\"blockquote\",q,Q($.children,Z))}case B.breakLine:return X(\"br\",{key:Z.key});case B.breakThematic:return X(\"hr\",{key:Z.key});case B.frontmatter:return J.preserveFrontmatter?X(\"pre\",{key:Z.key},$.text):null;case B.codeBlock:{let q=$.lang?I5($.lang):\"\";var U=$.attrs?U$($.attrs):{};return U.className=q?`language-${q} lang-${q}`:\"\",X(\"pre\",{key:Z.key},X(\"code\",U,$.text))}case B.codeInline:return X(\"code\",{key:Z.key},$.text);case B.footnoteReference:return X(\"a\",{key:Z.key,href:Y($.target,\"a\",\"href\")||void 0},X(\"sup\",null,$.text));case B.gfmTask:return X(\"input\",{checked:$.completed,key:Z.key,readOnly:!0,type:\"checkbox\"});case B.heading:return X(`h${$.level}`,{id:$.id,key:Z.key},Q($.children,Z));case B.htmlBlock:{let q=$;if(m5(J)&&W$(q.tag)){var W=q$(q);return W.kind===\"literal\"?X(\"span\",{key:Z.key},W.literal):X(\"span\",{key:Z.key},...F4(W.open,q.children?Q(q.children,Z):null,W.close))}let D=q.j,A=D!==void 0,N=A?D:q.a?q.e||\"\":(q.e||\"\")+(q.h||\"\");if(N&&q.c){let L=q.tag.toLowerCase(),O=p4(L),P=q.children,v=P!=null&&P.length>0;if(O){let S=A?D:q.e||\"\",s=m5(J)?z$(S):S;if(/<[a-z][^>]{0,100}>/i.test(N)){var z=D5(Z.key,$.attrs);return z.dangerouslySetInnerHTML={__html:s},G($.tag,z)}return G($.tag,D5(Z.key,$.attrs),s)}let b=new RegExp(`^<${q.tag}(\\\\s|>)`,\"i\");if(v&&!b.test(N)&&m5(J)&&D4(N))return G($.tag,D5(Z.key,$.attrs),Q(P,Z));if(d4(N)){let S=m5(J)?z$(N):N;var H=D5(Z.key,$.attrs);return H.dangerouslySetInnerHTML={__html:S},G($.tag,H)}let x=I9({slugify:J.slugify,sanitizer:Y,tagfilter:!0}),T=G4(N);if(new RegExp(`^<${q.tag}(\\\\s[^>]*)?>(\\\\s*</${q.tag}>)?$`,\"i\").test(T))return q.children&&q.children.length>0?G($.tag,D5(Z.key,$.attrs),Q(q.children,Z)):G($.tag,D5(Z.key,$.attrs));let y=P9(T,{inline:!1,refs:K,inHTML:!1},x);G$(y);let C=q.tag.toLowerCase(),E=A;if(E&&v)return G($.tag,D5(Z.key,$.attrs),Q(P,Z));if(E)return Q(y.flatMap(Z9),Z);var F=z4(y,C);if(F.found&&F.afterClose.length>0){var M=F.beforeClose.flatMap(Z9),j=F.afterClose.flatMap(Z9);return T$(i0.Fragment,{children:[G($.tag,D5(Z.key,$.attrs),Q(M,Z)),Q(j,Z)]},Z.key)}return G($.tag,D5(Z.key,$.attrs),Q(y.flatMap(Z9),Z))}return Q9($.tag)?G($.tag,D5(Z.key,$.attrs)):G($.tag,D5(Z.key,$.attrs),$.children?Q($.children,Z):\"\")}case B.htmlSelfClosing:{let q=$;if(m5(J)&&W$(q.tag)){var _=q$(q);return X(\"span\",{key:Z.key},_.kind===\"literal\"?_.literal:_.open+(_.close||\"\"))}return G($.tag,D5(Z.key,$.attrs))}case B.image:{let q=$.target===null?null:Y($.target,\"img\",\"src\");return X(\"img\",{key:Z.key,alt:$.alt&&$.alt.length>0?$.alt:void 0,title:$.title||void 0,src:q||void 0})}case B.link:{let q={key:Z.key};if($.target!=null){let D=H4($.target,Y,\"a\",\"href\");D!=null&&(q.href=D)}return $.title&&(q.title=$.title),X(\"a\",q,Q($.children,Z))}case B.table:{let q=$;return X(\"table\",{key:Z.key},X(\"thead\",{key:\"thead\"},X(\"tr\",null,q.header.map(function(A,N){return X(\"th\",{key:N,style:q.align[N]===null?{}:{textAlign:q.align[N]}},Q(A,Z))}))),q.cells.length>0&&X(\"tbody\",{key:\"tbody\"},q.cells.map(function(A,N){return X(\"tr\",{key:N},A.map(function(O,P){return X(\"td\",{key:P,style:q.align[P]===null?{}:{textAlign:q.align[P]}},Q(O,Z))}))})))}case B.text:return $.text;case B.textFormatted:return X($.tag,{key:Z.key},Q($.children,Z));case B.orderedList:case B.unorderedList:{let q=$.type===B.orderedList?\"ol\":\"ul\";return X(q,{key:Z.key,start:$.type===B.orderedList?$.start:void 0},$.items.map(function(A,N){return X(\"li\",{key:N},Q(A,Z))}))}case B.paragraph:return X(\"p\",{key:Z.key},Q($.children,Z));case B.ref:return null;default:return null}}var HZ=($,Q,Z,X,Y,V,K)=>{var J=U=>U.map(W=>\"text\"in W?W.text:\"\"),G=(U,W={})=>{var z=Array.isArray(U)?U:[U],H=(W.renderDepth||0)+1;if(H>2500)return J(z);W.renderDepth=H;for(var F=W.key,M=[],j=!1,_=0;_<z.length;_++){W.key=_;var q;if($){var D=n4.bind(null,z[_],G,W,Q,Z,X,Y,V,K);q=$(D,z[_],G,W)}else q=n4(z[_],G,W,Q,Z,X,Y,V,K);var A=typeof q==\"string\";if(j&&typeof q==\"string\"){var N=M.at(-1);M[M.length-1]=(typeof N==\"string\"?N:\"\")+q}else if(q!=null)if(Array.isArray(q))for(var L=0;L<q.length;L++)M.push(q[L]);else M.push(q);j=A}return W.key=F,W.renderDepth=H-1,M};return G},MZ=($,Q)=>{let Z=h9(Q,$,void 0);return Z?typeof Z==\"function\"||typeof Z==\"object\"&&\"render\"in Z?Z:h9(Q,`${$}.component`,$):$};function OZ($,Q){let Z={...Q||{}};Z.overrides=Z.overrides||{};let X=Z.slugify||N5,Y=Z.sanitizer||H5,V=Z.createElement,K=f9(Z.overrides),J=A=>y$(A,{...Z,wrapper:null});function G(A){for(var N in A){var L=A[N];if(typeof L==\"string\"&&L.length>0&&L.charCodeAt(0)===Y0&&(h4.test(L)||m4.test(L)||a4(L,0))){var O=J(L.trim());A[N]=N===\"innerHTML\"&&Array.isArray(O)?O[0]:O}}}function U(A,N,...L){var O=N||{},P=A;if(K){var v=h9(Z.overrides,`${A}.props`,{});P=MZ(A,Z.overrides),O={...O,...v,className:O4(O.className,v.className)||void 0}}if(!V){var b=O.key;return b!=null&&delete O.key,L.length===1?O.children=L[0]:L.length>1&&(O.children=L),T$(P,O,b)}return V(P,O,...L)}function W(A,N,...L){return N&&G(N),U(A,N,...L)}let z=I9(Z,Z.forceInline),H=$[0]&&$[0].type===B.refCollection?$[0].refs:{},F=HZ(Z.renderRule,U,Y,X,H,Z,W),M=F($,{inline:Z.forceInline,refs:H}),j=M4(H);if(j.length>0&&M.push(U(\"footer\",{key:\"footer\"},j.map(function(N){let L=N.identifier.charCodeAt(0)===W5?N.identifier.slice(1):N.identifier,O=P9(N.footnote,{inline:!0,refs:H},z);return U(\"div\",{id:X(L,N5),key:N.identifier},`${L}: `,F(O,{inline:!0,refs:H}))}))),Z.wrapper===null)return M;let _=Z.wrapper||(Z.forceInline?\"span\":\"div\"),q;if(M.length>1||Z.forceWrapper)q=M;else return M.length===1?M[0]:null;var D=Z.wrapperProps?{...Z.wrapperProps}:{};return D.children=q,T$(_,D,\"outer\")}function y$($=\"\",Q={}){let Z={...Q||{}};Z.overrides=Z.overrides||{};let X=Z.slugify||N5,Y=Z.sanitizer||H5;function V(J){let G=Z.forceInline||!(Z.forceBlock||Y4.test(J)),U=I9(Z,G),W=G?J:W4(J),z=P9(W,{inline:G,refs:K},U);return OZ(z,{...Z,forceInline:G})}let K={};return V($)}var RZ=({options:$,children:Q})=>i9?i0.createElement(i9.Provider,{value:$},Q):Q;function DZ($){let Q=i0.useRef($),Z=Q.current;if(Z!==$){var X=!0,Y=0;for(var V in $)if(Y++,!Object.is(Z[V],$[V])){X=!1;break}if(X){var K=0;for(var J in Z)K++;X=K===Y}X||(Q.current=$)}return Q.current}var AZ=({children:$,options:Q,...Z})=>{if(!(typeof i0.useContext<\"u\")){let U={...Q,overrides:{...Q?.overrides},wrapperProps:{...Q?.wrapperProps,...Z}};return y$($??\"\",U)}let Y=i9?i0.useContext(i9):void 0,V=DZ(Z),K=i0.useMemo(()=>({...Y,...Q,overrides:{...Y?.overrides,...Q?.overrides},wrapperProps:{...Y?.wrapperProps,...Q?.wrapperProps,...V}}),[Y,Q,V]),J=$??\"\";return i0.useMemo(()=>y$(J,K),[J,K])},SZ=AZ;export{N5 as slugify,H5 as sanitizer,zZ as parser,SZ as default,y$ as compiler,OZ as astToJSX,B as RuleType,RZ as MarkdownProvider,i9 as MarkdownContext,AZ as Markdown};\n","var j;function B(z){if(!j){if(typeof document>\"u\")return;j=document.createElement(\"textarea\")}var q=`&${z};`;j.innerHTML=q;var v=j.value;return v===q?void 0:v}var C={};export{B as decodeEntity,C as NAMED_CODES_TO_UNICODE};\n","/** Internal only symbol used by `Form` & `ObjectField` to mark an additional property element to be removed */\nexport const ADDITIONAL_PROPERTY_KEY_REMOVE = Symbol('remove-this-key');\n\n/** Internal only symbol used by the `reset()` function to indicate that a reset operation is happening */\nexport const IS_RESET = Symbol('reset');\n","import type {\n FieldProps,\n FormContextType,\n OptionalDataControlsTemplateProps,\n RJSFSchema,\n StrictRJSFSchema,\n} from '@rjsf/utils';\nimport {\n getSchemaType,\n getTemplate,\n getUiOptions,\n isFormDataAvailable,\n optionalControlsId,\n TranslatableString,\n} from '@rjsf/utils';\n\n/** The `OptionalDataControlsField` component is used to render the optional data controls for the field associated\n * with the given props.\n *\n * @param props - The `FieldProps` for this template\n */\nexport default function OptionalDataControlsField<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: FieldProps<T, S, F>) {\n const {\n schema,\n uiSchema = {},\n formData,\n disabled = false,\n readonly = false,\n onChange,\n errorSchema,\n fieldPathId,\n registry,\n } = props;\n\n const { globalUiOptions = {}, schemaUtils, translateString } = registry;\n const uiOptions = getUiOptions<T, S, F>(uiSchema, globalUiOptions);\n const OptionalDataControlsTemplate = getTemplate<'OptionalDataControlsTemplate', T, S, F>(\n 'OptionalDataControlsTemplate',\n registry,\n uiOptions,\n );\n const hasFormData = isFormDataAvailable<T>(formData);\n let id: string;\n let label: string | undefined;\n let onAddClick: OptionalDataControlsTemplateProps['onAddClick'];\n let onRemoveClick: OptionalDataControlsTemplateProps['onRemoveClick'];\n if (disabled || readonly) {\n id = optionalControlsId(fieldPathId, 'Msg');\n label = hasFormData ? undefined : translateString(TranslatableString.OptionalObjectEmptyMsg);\n } else {\n const labelEnum = hasFormData ? TranslatableString.OptionalObjectRemove : TranslatableString.OptionalObjectAdd;\n label = translateString(labelEnum);\n if (hasFormData) {\n id = optionalControlsId(fieldPathId, 'Remove');\n onRemoveClick = () => onChange(undefined as T, fieldPathId.path, errorSchema);\n } else {\n id = optionalControlsId(fieldPathId, 'Add');\n onAddClick = () => {\n // If it has form data, store an empty object, otherwise get the default form state and use it\n let newFormData: unknown = schemaUtils.getDefaultFormState(schema, formData, 'excludeObjectChildren');\n if (newFormData === undefined) {\n // If new form data ended up being undefined, and we have pushed the add button we need to actually add data\n newFormData = getSchemaType<S>(schema) === 'array' ? [] : {};\n }\n onChange(newFormData as T, fieldPathId.path, errorSchema);\n };\n }\n }\n return (\n label && (\n <OptionalDataControlsTemplate\n id={id}\n registry={registry}\n schema={schema}\n uiSchema={uiSchema}\n label={label}\n onAddClick={onAddClick}\n onRemoveClick={onRemoveClick}\n />\n )\n );\n}\n","import type { ComponentType } from 'react';\nimport { useCallback, memo } from 'react';\nimport type {\n ErrorSchema,\n Field,\n FieldPathId,\n FieldPathList,\n FieldProps,\n FieldTemplateProps,\n FormContextType,\n Registry,\n RJSFMarkedSchema,\n RJSFSchema,\n StrictRJSFSchema,\n UIOptionsType,\n} from '@rjsf/utils';\nimport {\n ADDITIONAL_PROPERTY_FLAG,\n ANY_OF_KEY,\n deepEquals,\n descriptionId,\n getSchemaType,\n getTemplate,\n getUiOptions,\n ID_KEY,\n isFormDataAvailable,\n ONE_OF_KEY,\n resolveUiSchema,\n RJSF_REF_CYCLE_KEY,\n shallowEquals,\n shouldRenderOptionalField,\n toFieldPathId,\n isObject,\n TranslatableString,\n UI_OPTIONS_KEY,\n} from '@rjsf/utils';\n\n/** The map of component type to FieldName */\nconst COMPONENT_TYPES: Record<string, string> = {\n array: 'ArrayField',\n boolean: 'BooleanField',\n integer: 'NumberField',\n number: 'NumberField',\n object: 'ObjectField',\n string: 'StringField',\n null: 'NullField',\n};\n\n/** Computes and returns which `Field` implementation to return in order to render the field represented by the\n * `schema`. The `uiOptions` are used to alter what potential `Field` implementation is actually returned. If no\n * appropriate `Field` implementation can be found then a wrapper around `UnsupportedFieldTemplate` is used.\n *\n * @param schema - The schema from which to obtain the type\n * @param uiOptions - The UI Options that may affect the component decision\n * @param registry - The registry from which fields and templates are obtained\n * @returns - The `Field` component that is used to render the actual field data\n */\nfunction getFieldComponent<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n schema: S,\n uiOptions: UIOptionsType<T, S, F>,\n registry: Registry<T, S, F>,\n): ComponentType<FieldProps<T, S, F>> {\n const { field } = uiOptions;\n const { fields, schemaUtils } = registry;\n if (typeof field === 'function') {\n return field;\n }\n if (typeof field === 'string' && field in fields) {\n return fields[field] as ComponentType<FieldProps<T, S, F>>;\n }\n\n const schemaType = getSchemaType(schema);\n const type: string = Array.isArray(schemaType) ? schemaType[0] : schemaType || '';\n\n const schemaId = schema.$id;\n\n let componentName = COMPONENT_TYPES[type];\n if (schemaId && schemaId in fields) {\n componentName = schemaId;\n }\n\n // If the schema uses 'anyOf' or 'oneOf' and is not a pure select (all-constant options),\n // let the MultiSchemaField component handle the form display entirely.\n // ObjectField is excluded: it renders shared properties (defined at the parent schema\n // level) alongside the XxxOfField option selector.\n // All other field types — including primitives and arrays — have no shared renderable\n // properties, so the outer FieldComponent would only produce a spurious duplicate input.\n if ((schema.anyOf || schema.oneOf) && !schemaUtils.isSelect(schema) && componentName !== 'ObjectField') {\n return () => null;\n }\n\n return componentName in fields ? fields[componentName] : fields.FallbackField;\n}\n\n/** The `SchemaFieldRender` component is the work-horse of react-jsonschema-form, determining what kind of real field to\n * render based on the `schema`, `uiSchema` and all the other props. It also deals with rendering the `anyOf` and\n * `oneOf` fields.\n *\n * @param props - The `FieldProps` for this component\n */\nfunction SchemaFieldRender<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n props: FieldProps<T, S, F>,\n) {\n const {\n schema: _schema,\n fieldPathId,\n uiSchema: _uiSchema,\n formData,\n errorSchema,\n name,\n onChange,\n onKeyRename,\n onKeyRenameBlur,\n onRemoveProperty,\n required = false,\n registry,\n wasPropertyKeyModified = false,\n } = props;\n const { schemaUtils, globalFormOptions, globalUiOptions, fields } = registry;\n const { AnyOfField: _AnyOfField, OneOfField: _OneOfField, CyclicSchemaField } = fields;\n const fieldId = fieldPathId[ID_KEY];\n\n /** Intermediary `onChange` handler for field components that will inject the `id` of the current field into the\n * `onChange` chain if it is not already being provided from a deeper level in the hierarchy\n */\n const handleFieldComponentChange = useCallback(\n (newFormData: T | undefined, path: FieldPathList, newErrorSchema?: ErrorSchema<T>, id?: string) => {\n const theId = id || fieldId;\n return onChange(newFormData, path, newErrorSchema, theId);\n },\n [fieldId, onChange],\n );\n\n // Stop $ref cycles: when resolveAllReferences detects a repeated property $ref it tags the schema with this flag.\n // The check must come after all hook calls to satisfy React's rules of hooks.\n if ((_schema as RJSFMarkedSchema)[RJSF_REF_CYCLE_KEY]) {\n return <CyclicSchemaField {...props} />;\n }\n\n const uiSchema = resolveUiSchema<T, S, F>(_schema, _uiSchema, registry);\n const uiOptions = getUiOptions<T, S, F>(uiSchema, globalUiOptions);\n const FieldTemplate = getTemplate<'FieldTemplate', T, S, F>('FieldTemplate', registry, uiOptions);\n const DescriptionFieldTemplate = getTemplate<'DescriptionFieldTemplate', T, S, F>(\n 'DescriptionFieldTemplate',\n registry,\n uiOptions,\n );\n const FieldHelpTemplate = getTemplate<'FieldHelpTemplate', T, S, F>('FieldHelpTemplate', registry, uiOptions);\n const FieldErrorTemplate = getTemplate<'FieldErrorTemplate', T, S, F>('FieldErrorTemplate', registry, uiOptions);\n const schema = schemaUtils.retrieveSchema(_schema, formData);\n\n const FieldComponent = getFieldComponent<T, S, F>(schema, uiOptions, registry);\n\n const isDeprecated = Boolean(schema.deprecated);\n const deprecatedHandling = isDeprecated ? (uiOptions.deprecatedHandling ?? 'label') : undefined;\n\n const disabled = Boolean(uiOptions.disabled ?? props.disabled) || deprecatedHandling === 'disable';\n const readonly = Boolean(uiOptions.readonly ?? (props.readonly || props.schema.readOnly || schema.readOnly));\n const uiSchemaHideError = uiOptions.hideError;\n // Set hideError to the value provided in the uiSchema, otherwise stick with the prop to propagate to children\n const hideError = uiSchemaHideError === undefined ? props.hideError : Boolean(uiSchemaHideError);\n const autofocus = Boolean(uiOptions.autofocus ?? props.autofocus);\n if (Object.keys(schema).length === 0) {\n return null;\n }\n\n let displayLabel = schemaUtils.getDisplayLabel(schema, uiSchema, globalUiOptions);\n\n /** If the schema `anyOf` or 'oneOf' can be rendered as a select control, don't render the selection and let\n * `StringField` component handle rendering unless there is a field override and that field replaces the any or one of\n */\n const isReplacingAnyOrOneOf = uiOptions.field && uiOptions.fieldReplacesAnyOrOneOf === true;\n let XxxOfField: Field<T, S, F> | undefined;\n let XxxOfOptions: S[] | undefined;\n // When rendering the `XxxOfField` we'll need to change the fieldPathId of the main component, remembering the\n // fieldPathId of the children for the ObjectField and ArrayField\n let fieldPathIdProps: { fieldPathId: FieldPathId; childFieldPathId?: FieldPathId } = { fieldPathId };\n if ((ANY_OF_KEY in schema || ONE_OF_KEY in schema) && !isReplacingAnyOrOneOf && !schemaUtils.isSelect(schema)) {\n if (schema[ANY_OF_KEY]) {\n XxxOfField = _AnyOfField;\n XxxOfOptions = schema[ANY_OF_KEY].map((xxxOfSchema) =>\n schemaUtils.retrieveSchema(isObject(xxxOfSchema) ? (xxxOfSchema as S) : ({} as S), formData),\n );\n } else if (schema[ONE_OF_KEY]) {\n XxxOfField = _OneOfField;\n XxxOfOptions = schema[ONE_OF_KEY].map((xxxOfSchema) =>\n schemaUtils.retrieveSchema(isObject(xxxOfSchema) ? (xxxOfSchema as S) : ({} as S), formData),\n );\n }\n // When the anyOf/oneOf is an optional data control render AND it does not have form data, hide the label\n const isOptionalRender = shouldRenderOptionalField<T, S, F>(registry, schema, required, uiSchema);\n const hasFormData = isFormDataAvailable<T>(formData);\n displayLabel = displayLabel && (!isOptionalRender || hasFormData);\n fieldPathIdProps = {\n childFieldPathId: fieldPathId,\n // The main FieldComponent will add `XxxOf` onto the fieldPathId to avoid duplication with the rendering of the\n // same FieldComponent by the `XxxOfField`\n fieldPathId: toFieldPathId('XxxOf', globalFormOptions, fieldPathId),\n };\n }\n\n const { __errors, ...fieldErrorSchema } = errorSchema || {};\n // See #439: uiSchema: Don't pass consumed class names or style to child components\n const {\n 'ui:classNames': consumedUiClassNames,\n classNames: consumedClassNames,\n 'ui:style': consumedUiStyle,\n ...fieldUiSchema\n } = uiSchema;\n if (UI_OPTIONS_KEY in fieldUiSchema) {\n const {\n classNames: consumedOptionClassNames,\n style: consumedOptionStyle,\n ...fieldUiOptions\n } = fieldUiSchema[UI_OPTIONS_KEY]!;\n fieldUiSchema[UI_OPTIONS_KEY] = fieldUiOptions;\n }\n\n const field = (\n <FieldComponent\n {...props}\n onChange={handleFieldComponentChange}\n {...fieldPathIdProps}\n schema={schema}\n uiSchema={fieldUiSchema}\n disabled={disabled}\n readonly={readonly}\n hideError={hideError}\n autofocus={autofocus}\n errorSchema={fieldErrorSchema as ErrorSchema}\n rawErrors={__errors}\n />\n );\n\n const id = fieldPathId[ID_KEY];\n\n // If this schema has a title defined, but the user has set a new key/label, retain their input.\n let label;\n if (wasPropertyKeyModified) {\n label = name;\n } else {\n label =\n ADDITIONAL_PROPERTY_FLAG in schema\n ? name\n : uiOptions.title || props.schema.title || schema.title || props.title || name;\n }\n\n if (deprecatedHandling === 'label') {\n label = registry.translateString(TranslatableString.DeprecatedLabel, [label]);\n }\n\n const description = uiOptions.description || props.schema.description || schema.description || '';\n const { help } = uiOptions;\n const hidden = uiOptions.widget === 'hidden' || deprecatedHandling === 'hide';\n\n const classNames = ['rjsf-field', `rjsf-field-${getSchemaType(schema)}`];\n if (!hideError && __errors && __errors.length > 0) {\n classNames.push('rjsf-field-error');\n }\n if (uiOptions.classNames) {\n classNames.push(uiOptions.classNames);\n }\n\n const helpComponent = (\n <FieldHelpTemplate\n help={help}\n fieldPathId={fieldPathId}\n schema={schema}\n uiSchema={uiSchema}\n hasErrors={!hideError && __errors && __errors.length > 0}\n registry={registry}\n />\n );\n /*\n * AnyOf/OneOf errors handled by child schema\n * unless it can be rendered as select control\n */\n const errorsComponent =\n hideError || (XxxOfField && !schemaUtils.isSelect(schema)) ? undefined : (\n <FieldErrorTemplate\n errors={__errors}\n errorSchema={errorSchema}\n fieldPathId={fieldPathId}\n schema={schema}\n uiSchema={uiSchema}\n registry={registry}\n />\n );\n const fieldProps: Omit<FieldTemplateProps<T, S, F>, 'children'> = {\n description: (\n <DescriptionFieldTemplate\n id={descriptionId(id)}\n description={description}\n schema={schema}\n uiSchema={uiSchema}\n registry={registry}\n />\n ),\n rawDescription: description,\n help: helpComponent,\n rawHelp: typeof help === 'string' ? help : undefined,\n errors: errorsComponent,\n rawErrors: hideError ? undefined : __errors,\n fieldPathId,\n id,\n label,\n hidden,\n onChange,\n onKeyRename,\n onKeyRenameBlur,\n onRemoveProperty,\n required,\n disabled,\n readonly,\n hideError,\n displayLabel,\n classNames: classNames.join(' ').trim(),\n style: uiOptions.style,\n formData,\n schema,\n uiSchema,\n registry,\n };\n\n return (\n <FieldTemplate {...fieldProps}>\n <>\n {field}\n {XxxOfField && (\n <XxxOfField\n name={name}\n disabled={disabled}\n readonly={readonly}\n hideError={hideError}\n errorSchema={errorSchema}\n formData={formData}\n fieldPathId={fieldPathId}\n onBlur={props.onBlur}\n onChange={props.onChange}\n onFocus={props.onFocus}\n options={XxxOfOptions}\n registry={registry}\n required={required}\n schema={schema}\n uiSchema={uiSchema}\n />\n )}\n </>\n </FieldTemplate>\n );\n}\n\n/** The `SchemaField` component wraps `SchemaFieldRender` with a custom memoization comparator that determines whether it is necessary to rerender the component based on any props changes\n * using `experimental_componentUpdateStrategy`.\n *\n * The cast to `typeof SchemaFieldRender` preserves the generic type signature (<T, S, F>) for consumers,\n * since React.memo's return type erases generic parameters.\n */\nconst SchemaField = memo(SchemaFieldRender, (prevProps, nextProps) => {\n const { experimental_componentUpdateStrategy = 'customDeep' } = nextProps.registry.globalFormOptions;\n if (experimental_componentUpdateStrategy === 'always') {\n return false; // always re-render — never consider props equal\n }\n if (experimental_componentUpdateStrategy === 'shallow') {\n return shallowEquals(prevProps, nextProps);\n }\n // default: 'customDeep'\n return deepEquals(prevProps, nextProps);\n}) as unknown as typeof SchemaFieldRender;\n\nexport default SchemaField;\n","import { useCallback } from 'react';\nimport type { FieldProps, FormContextType, RJSFSchema, StrictRJSFSchema, ErrorSchema } from '@rjsf/utils';\nimport { getWidget, getUiOptions, optionsList, hasWidget } from '@rjsf/utils';\n\n/** The `StringField` component is used to render a schema field that represents a string type\n *\n * @param props - The `FieldProps` for this template\n */\nfunction StringField<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n props: FieldProps<T, S, F>,\n) {\n const {\n schema,\n name,\n uiSchema,\n fieldPathId,\n formData,\n required,\n disabled = false,\n readonly = false,\n autofocus = false,\n onChange,\n onBlur,\n onFocus,\n registry,\n rawErrors,\n hideError,\n title,\n } = props;\n const { title: schemaTitle, format } = schema;\n const { widgets, schemaUtils, globalUiOptions } = registry;\n const enumOptions = schemaUtils.isSelect(schema) ? optionsList<T, S, F>(schema, uiSchema) : undefined;\n let defaultWidget = enumOptions ? 'select' : 'text';\n if (format && hasWidget<T, S, F>(schema, format, widgets)) {\n defaultWidget = format;\n }\n const { widget = defaultWidget, placeholder = '', title: uiTitle, ...options } = getUiOptions<T, S, F>(uiSchema);\n const displayLabel = schemaUtils.getDisplayLabel(schema, uiSchema, globalUiOptions);\n const label = uiTitle ?? title ?? schemaTitle ?? name;\n const Widget = getWidget<T, S, F>(schema, widget, widgets);\n const onWidgetChange = useCallback(\n (value: T | undefined, errorSchema?: ErrorSchema, id?: string) =>\n onChange(value, fieldPathId.path, errorSchema, id),\n [onChange, fieldPathId],\n );\n return (\n <Widget\n options={{ ...options, enumOptions }}\n schema={schema}\n uiSchema={uiSchema}\n id={fieldPathId.$id}\n name={name}\n label={label}\n hideLabel={!displayLabel}\n hideError={hideError}\n value={formData}\n onChange={onWidgetChange}\n onBlur={onBlur}\n onFocus={onFocus}\n required={required}\n disabled={disabled}\n readonly={readonly}\n autofocus={autofocus}\n registry={registry}\n placeholder={placeholder}\n rawErrors={rawErrors}\n htmlName={fieldPathId.name}\n />\n );\n}\n\nexport default StringField;\n","import type { Field, FormContextType, RegistryFieldsType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';\n\nimport ArrayField from './ArrayField.tsx';\nimport BooleanField from './BooleanField.tsx';\nimport CyclicSchemaField from './CyclicSchemaField.tsx';\nimport FallbackField from './FallbackField.tsx';\nimport LayoutGridField from './LayoutGridField.tsx';\nimport LayoutHeaderField from './LayoutHeaderField.tsx';\nimport LayoutMultiSchemaField from './LayoutMultiSchemaField.tsx';\nimport MultiSchemaField from './MultiSchemaField.tsx';\nimport NullField from './NullField.tsx';\nimport NumberField from './NumberField.tsx';\nimport ObjectField from './ObjectField.tsx';\nimport OptionalDataControlsField from './OptionalDataControlsField.tsx';\nimport SchemaField from './SchemaField.tsx';\nimport StringField from './StringField.tsx';\n\nfunction fields<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(): RegistryFieldsType<T, S, F> {\n return {\n AnyOfField: MultiSchemaField,\n ArrayField: ArrayField as unknown as Field<T, S, F>,\n // ArrayField falls back to SchemaField if ArraySchemaField is not defined, which it isn't by default\n BooleanField,\n CyclicSchemaField,\n FallbackField,\n LayoutGridField,\n LayoutHeaderField,\n LayoutMultiSchemaField,\n NumberField,\n ObjectField,\n OneOfField: MultiSchemaField,\n OptionalDataControlsField,\n SchemaField,\n StringField,\n NullField,\n };\n}\n\nexport default fields;\n","import type { ArrayFieldDescriptionProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';\nimport { descriptionId, getTemplate, getUiOptions } from '@rjsf/utils';\n\n/** The `ArrayFieldDescriptionTemplate` component renders a `DescriptionFieldTemplate` with an `id` derived from\n * the `fieldPathId`.\n *\n * @param props - The `ArrayFieldDescriptionProps` for the component\n */\nexport default function ArrayFieldDescriptionTemplate<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: ArrayFieldDescriptionProps<T, S, F>) {\n const { fieldPathId, description, registry, schema, uiSchema } = props;\n const options = getUiOptions<T, S, F>(uiSchema, registry.globalUiOptions);\n const { label: displayLabel = true } = options;\n if (!description || !displayLabel) {\n return null;\n }\n const DescriptionFieldTemplate = getTemplate<'DescriptionFieldTemplate', T, S, F>(\n 'DescriptionFieldTemplate',\n registry,\n options,\n );\n return (\n <DescriptionFieldTemplate\n id={descriptionId(fieldPathId)}\n description={description}\n schema={schema}\n uiSchema={uiSchema}\n registry={registry}\n />\n );\n}\n","import type { ArrayFieldItemButtonsTemplateProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';\nimport { buttonId } from '@rjsf/utils';\n\n/** The `ArrayFieldTemplateItemButtons` component is the template used to render the buttons associate3d with items of\n * an array.\n *\n * @param props - The `ArrayFieldItemButtonsTemplateProps` props for the component\n */\nexport default function ArrayFieldItemButtonsTemplate<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: ArrayFieldItemButtonsTemplateProps<T, S, F>) {\n const {\n disabled,\n hasCopy,\n hasMoveDown,\n hasMoveUp,\n hasRemove,\n fieldPathId,\n onCopyItem,\n onRemoveItem,\n onMoveDownItem,\n onMoveUpItem,\n readonly,\n registry,\n uiSchema,\n } = props;\n const { CopyButton, MoveDownButton, MoveUpButton, RemoveButton } = registry.templates.ButtonTemplates;\n\n return (\n <>\n {(hasMoveUp || hasMoveDown) && (\n <MoveUpButton\n id={buttonId(fieldPathId, 'moveUp')}\n className='rjsf-array-item-move-up'\n disabled={disabled || readonly || !hasMoveUp}\n onClick={onMoveUpItem}\n uiSchema={uiSchema}\n registry={registry}\n />\n )}\n {(hasMoveUp || hasMoveDown) && (\n <MoveDownButton\n id={buttonId(fieldPathId, 'moveDown')}\n className='rjsf-array-item-move-down'\n disabled={disabled || readonly || !hasMoveDown}\n onClick={onMoveDownItem}\n uiSchema={uiSchema}\n registry={registry}\n />\n )}\n {hasCopy && (\n <CopyButton\n id={buttonId(fieldPathId, 'copy')}\n className='rjsf-array-item-copy'\n disabled={disabled || readonly}\n onClick={onCopyItem}\n uiSchema={uiSchema}\n registry={registry}\n />\n )}\n {hasRemove && (\n <RemoveButton\n id={buttonId(fieldPathId, 'remove')}\n className='rjsf-array-item-remove'\n disabled={disabled || readonly}\n onClick={onRemoveItem}\n uiSchema={uiSchema}\n registry={registry}\n />\n )}\n </>\n );\n}\n","import type { CSSProperties } from 'react';\nimport type { ArrayFieldItemTemplateProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';\nimport { getTemplate, getUiOptions } from '@rjsf/utils';\n\n/** The `ArrayFieldItemTemplate` component is the template used to render an items of an array.\n *\n * @param props - The `ArrayFieldItemTemplateProps` props for the component\n */\nexport default function ArrayFieldItemTemplate<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: ArrayFieldItemTemplateProps<T, S, F>) {\n const { children, className, buttonsProps, displayLabel, hasDescription, hasToolbar, registry, uiSchema } = props;\n const uiOptions = getUiOptions<T, S, F>(uiSchema);\n const ArrayFieldItemButtonsTemplate = getTemplate<'ArrayFieldItemButtonsTemplate', T, S, F>(\n 'ArrayFieldItemButtonsTemplate',\n registry,\n uiOptions,\n );\n const btnStyle: CSSProperties = {\n flex: 1,\n paddingLeft: 6,\n paddingRight: 6,\n fontWeight: 'bold',\n };\n const margin = hasDescription ? 31 : 9;\n const containerStyle = { display: 'flex', alignItems: displayLabel ? 'center' : 'baseline' };\n const toolbarStyle = { display: 'flex', justifyContent: 'flex-end', marginTop: displayLabel ? `${margin}px` : 0 };\n return (\n <div className={className} style={containerStyle}>\n <div className={hasToolbar ? 'col-xs-9 col-md-10 col-xl-11' : 'col-xs-12'}>{children}</div>\n {hasToolbar && (\n <div className='col-xs-3 col-md-2 col-xl-1 array-item-toolbox'>\n <div className='btn-group' style={toolbarStyle}>\n <ArrayFieldItemButtonsTemplate {...buttonsProps} style={btnStyle} />\n </div>\n </div>\n )}\n </div>\n );\n}\n","import type { ArrayFieldTemplateProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';\nimport { getTemplate, getUiOptions, buttonId } from '@rjsf/utils';\n\n/** The `ArrayFieldTemplate` component is the template used to render all items in an array.\n *\n * @param props - The `ArrayFieldTemplateProps` props for the component\n */\nexport default function ArrayFieldTemplate<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: ArrayFieldTemplateProps<T, S, F>) {\n const {\n canAdd,\n className,\n disabled,\n fieldPathId,\n uiSchema,\n items,\n optionalDataControl,\n onAddClick,\n readonly,\n registry,\n required,\n schema,\n title,\n } = props;\n const uiOptions = getUiOptions<T, S, F>(uiSchema);\n const ArrayFieldDescriptionTemplate = getTemplate<'ArrayFieldDescriptionTemplate', T, S, F>(\n 'ArrayFieldDescriptionTemplate',\n registry,\n uiOptions,\n );\n const ArrayFieldTitleTemplate = getTemplate<'ArrayFieldTitleTemplate', T, S, F>(\n 'ArrayFieldTitleTemplate',\n registry,\n uiOptions,\n );\n // Button templates are not overridden in the uiSchema\n const showOptionalDataControlInTitle = !readonly && !disabled;\n const {\n ButtonTemplates: { AddButton },\n } = registry.templates;\n return (\n <fieldset className={className} id={fieldPathId.$id}>\n <ArrayFieldTitleTemplate\n fieldPathId={fieldPathId}\n title={uiOptions.title || title}\n required={required}\n schema={schema}\n uiSchema={uiSchema}\n registry={registry}\n optionalDataControl={showOptionalDataControlInTitle ? optionalDataControl : undefined}\n />\n <ArrayFieldDescriptionTemplate\n fieldPathId={fieldPathId}\n description={uiOptions.description || schema.description}\n schema={schema}\n uiSchema={uiSchema}\n registry={registry}\n />\n {!showOptionalDataControlInTitle ? optionalDataControl : undefined}\n <div className='row array-item-list'>{items}</div>\n {canAdd && (\n <AddButton\n id={buttonId(fieldPathId, 'add')}\n className='rjsf-array-item-add'\n onClick={onAddClick}\n disabled={disabled || readonly}\n uiSchema={uiSchema}\n registry={registry}\n />\n )}\n </fieldset>\n );\n}\n","import type { ArrayFieldTitleProps, FormContextType, RJSFSchema, StrictRJSFSchema, TemplatesType } from '@rjsf/utils';\nimport { getTemplate, getUiOptions, titleId } from '@rjsf/utils';\n\n/** The `ArrayFieldTitleTemplate` component renders a `TitleFieldTemplate` with an `id` derived from\n * the `fieldPathId`.\n *\n * @param props - The `ArrayFieldTitleProps` for the component\n */\nexport default function ArrayFieldTitleTemplate<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: ArrayFieldTitleProps<T, S, F>) {\n const { fieldPathId, title, schema, uiSchema, required, registry, optionalDataControl } = props;\n const options = getUiOptions<T, S, F>(uiSchema, registry.globalUiOptions);\n const { label: displayLabel = true } = options;\n if (!title || !displayLabel) {\n return null;\n }\n const TitleFieldTemplate: TemplatesType<T, S, F>['TitleFieldTemplate'] = getTemplate<'TitleFieldTemplate', T, S, F>(\n 'TitleFieldTemplate',\n registry,\n options,\n );\n return (\n <TitleFieldTemplate\n id={titleId(fieldPathId)}\n title={title}\n required={required}\n schema={schema}\n uiSchema={uiSchema}\n registry={registry}\n optionalDataControl={optionalDataControl}\n />\n );\n}\n","import type { ChangeEvent, FocusEvent, MouseEvent } from 'react';\nimport { useCallback } from 'react';\nimport type { BaseInputTemplateProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';\nimport { ariaDescribedByIds, examplesId, getInputProps } from '@rjsf/utils';\n\nimport SchemaExamples from '../SchemaExamples.tsx';\n\n/** The `BaseInputTemplate` is the template to use to render the basic `<input>` component for the `core` theme.\n * It is used as the template for rendering many of the <input> based widgets that differ by `type` and callbacks only.\n * It can be customized/overridden for other themes or individual implementations as needed.\n *\n * @param props - The `WidgetProps` for this template\n */\nexport default function BaseInputTemplate<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: BaseInputTemplateProps<T, S, F>) {\n const {\n id,\n name, // remove this from ...rest\n htmlName,\n value,\n readonly,\n disabled,\n autofocus,\n onBlur,\n onFocus,\n onChange,\n onChangeOverride,\n options,\n schema,\n uiSchema,\n registry,\n rawErrors,\n type,\n hideLabel, // remove this from ...rest\n hideError, // remove this from ...rest\n ...rest\n } = props;\n const { ClearButton } = registry.templates.ButtonTemplates;\n\n // Note: since React 15.2.0 we can't forward unknown element attributes, so we\n // exclude the \"options\" and \"schema\" ones here.\n if (!id) {\n // oxlint-disable-next-line no-console\n console.log('No id for', props);\n throw new Error(`no id for props ${JSON.stringify(props)}`);\n }\n const inputProps = {\n ...rest,\n ...getInputProps<T, S, F>(schema, type, options),\n };\n\n let inputValue;\n if (inputProps.type === 'number' || inputProps.type === 'integer') {\n inputValue = value || value === 0 ? value : '';\n } else {\n inputValue = value == null ? '' : value;\n }\n\n const handleChange = useCallback(\n ({ target: { value: newValue } }: ChangeEvent<HTMLInputElement>) =>\n onChange(newValue === '' ? options.emptyValue : newValue),\n [onChange, options],\n );\n const handleBlur = useCallback(({ target }: FocusEvent<HTMLInputElement>) => onBlur(id, target?.value), [onBlur, id]);\n const handleFocus = useCallback(\n ({ target }: FocusEvent<HTMLInputElement>) => onFocus(id, target?.value),\n [onFocus, id],\n );\n const handleClear = useCallback(\n (e: MouseEvent) => {\n e.preventDefault();\n e.stopPropagation();\n onChange(options.emptyValue);\n },\n [onChange, options.emptyValue],\n );\n\n return (\n <>\n <input\n id={id}\n name={htmlName || id}\n className='form-control'\n readOnly={readonly}\n disabled={disabled}\n autoFocus={autofocus}\n value={inputValue}\n {...inputProps}\n list={schema.examples ? examplesId(id) : undefined}\n onChange={onChangeOverride || handleChange}\n onBlur={handleBlur}\n onFocus={handleFocus}\n aria-describedby={ariaDescribedByIds(id, !!schema.examples)}\n />\n {options.allowClearTextInputs && !readonly && !disabled && inputValue && (\n <ClearButton registry={registry} onClick={handleClear} />\n )}\n <SchemaExamples id={id} schema={schema} />\n </>\n );\n}\n","import type { RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';\nimport { examplesId } from '@rjsf/utils';\n\nexport interface SchemaExamplesProps<S extends StrictRJSFSchema = RJSFSchema> {\n /** The id of the input element this datalist is for */\n id: string;\n /** The JSON schema object containing examples and default value */\n schema: S;\n}\n\n/** Renders a `<datalist>` element containing options from schema examples and default value.\n * Normalizes types to prevent duplicate keys when examples and default have different types.\n * For example, if examples are strings [\"5432\"] and default is number 5432, the default\n * will not be added as a duplicate option.\n *\n * @param props - The `SchemaExamplesProps` for this component\n */\nexport default function SchemaExamples<S extends StrictRJSFSchema = RJSFSchema>(props: SchemaExamplesProps<S>) {\n const { id, schema } = props;\n const { examples, default: schemaDefault } = schema;\n if (!Array.isArray(examples)) {\n return null;\n }\n return (\n <datalist key={`datalist_${id}`} id={examplesId(id)}>\n {(examples as string[])\n .concat(\n schemaDefault !== undefined && !examples.map(String).includes(String(schemaDefault))\n ? ([schemaDefault] as string[])\n : [],\n )\n .map((example: any) => (\n // oxlint-disable-next-line jsx-a11y/control-has-associated-label\n <option key={String(example)} value={example} />\n ))}\n </datalist>\n );\n}\n","import { memo } from 'react';\nimport type { FormContextType, IconButtonProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';\nimport { TranslatableString } from '@rjsf/utils';\n\nfunction IconButtonFn<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n props: IconButtonProps<T, S, F>,\n) {\n const { iconType = 'default', icon, className, uiSchema, registry, ...otherProps } = props;\n return (\n <button type='button' className={`btn btn-${iconType} ${className}`} {...otherProps}>\n <i className={`glyphicon glyphicon-${icon}`} />\n </button>\n );\n}\nconst IconButton = memo(IconButtonFn) as typeof IconButtonFn;\nexport default IconButton;\n\nfunction CopyButtonFn<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n props: IconButtonProps<T, S, F>,\n) {\n const {\n registry: { translateString },\n } = props;\n return <IconButton title={translateString(TranslatableString.CopyButton)} {...props} icon='copy' />;\n}\nexport const CopyButton = memo(CopyButtonFn) as typeof CopyButtonFn;\n\nfunction MoveDownButtonFn<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n props: IconButtonProps<T, S, F>,\n) {\n const {\n registry: { translateString },\n } = props;\n return <IconButton title={translateString(TranslatableString.MoveDownButton)} {...props} icon='arrow-down' />;\n}\nexport const MoveDownButton = memo(MoveDownButtonFn) as typeof MoveDownButtonFn;\n\nfunction MoveUpButtonFn<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n props: IconButtonProps<T, S, F>,\n) {\n const {\n registry: { translateString },\n } = props;\n return <IconButton title={translateString(TranslatableString.MoveUpButton)} {...props} icon='arrow-up' />;\n}\nexport const MoveUpButton = memo(MoveUpButtonFn) as typeof MoveUpButtonFn;\n\nfunction RemoveButtonFn<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n props: IconButtonProps<T, S, F>,\n) {\n const {\n registry: { translateString },\n } = props;\n return (\n <IconButton title={translateString(TranslatableString.RemoveButton)} {...props} iconType='danger' icon='remove' />\n );\n}\nexport const RemoveButton = memo(RemoveButtonFn) as typeof RemoveButtonFn;\n\nfunction ClearButtonFn<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({\n id,\n className,\n onClick,\n disabled,\n registry,\n ...props\n}: IconButtonProps<T, S, F>) {\n const { translateString } = registry;\n return (\n <IconButton\n id={id}\n iconType='default'\n icon='remove'\n className='btn-clear col-xs-12'\n title={translateString(TranslatableString.ClearButton)}\n onClick={onClick}\n disabled={disabled}\n registry={registry}\n {...props}\n />\n );\n}\nexport const ClearButton = memo(ClearButtonFn) as typeof ClearButtonFn;\n","import type { FormContextType, IconButtonProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';\nimport { TranslatableString } from '@rjsf/utils';\n\nimport IconButton from './IconButton.tsx';\n\n/** The `AddButton` renders a button that represent the `Add` action on a form\n */\nexport default function AddButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({\n id,\n className,\n onClick,\n disabled,\n registry,\n}: IconButtonProps<T, S, F>) {\n const { translateString } = registry;\n return (\n <div className='row'>\n <p\n className={`col-xs-4 col-sm-2 col-lg-1 col-xs-offset-8 col-sm-offset-10 col-lg-offset-11 text-right ${className}`}\n >\n <IconButton\n id={id}\n iconType='info'\n icon='plus'\n className='btn-add col-xs-12'\n title={translateString(TranslatableString.AddButton)}\n onClick={onClick}\n disabled={disabled}\n registry={registry}\n />\n </p>\n </div>\n );\n}\n","import type { FormContextType, RJSFSchema, StrictRJSFSchema, SubmitButtonProps } from '@rjsf/utils';\nimport { getSubmitButtonOptions } from '@rjsf/utils';\n\n/** The `SubmitButton` renders a button that represent the `Submit` action on a form\n */\nexport default function SubmitButton<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>({ uiSchema }: SubmitButtonProps<T, S, F>) {\n const { submitText, norender, props: submitButtonProps = {} } = getSubmitButtonOptions<T, S, F>(uiSchema);\n if (norender) {\n return null;\n }\n return (\n <div>\n <button type='submit' {...submitButtonProps} className={`btn btn-info ${submitButtonProps.className || ''}`}>\n {submitText}\n </button>\n </div>\n );\n}\n","import type { FormContextType, RJSFSchema, StrictRJSFSchema, TemplatesType } from '@rjsf/utils';\n\nimport AddButton from './AddButton.tsx';\nimport { CopyButton, MoveDownButton, MoveUpButton, RemoveButton, ClearButton } from './IconButton.tsx';\nimport SubmitButton from './SubmitButton.tsx';\n\nfunction buttonTemplates<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(): TemplatesType<T, S, F>['ButtonTemplates'] {\n return {\n SubmitButton,\n AddButton,\n CopyButton,\n MoveDownButton,\n MoveUpButton,\n RemoveButton,\n ClearButton,\n };\n}\n\nexport default buttonTemplates;\n","import type { CyclicSchemaExpandProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';\nimport { ID_KEY, TranslatableString } from '@rjsf/utils';\n\n/** The `CyclicSchemaExpandTemplate` is the template to use to render the cyclic schema expand message and controls\n *\n * @param props - The `DescriptionFieldProps` for this component\n */\nexport default function CyclicSchemaExpandTemplate<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: CyclicSchemaExpandProps<T, S, F>) {\n const { name, fieldPathId, registry, onExpand } = props;\n const { translateString } = registry;\n const buttonId = `${fieldPathId[ID_KEY]}-button`;\n return (\n <div style={{ marginTop: '1rem' }}>\n <div className='text-danger'>{translateString(TranslatableString.CycleDetected, [name])}</div>\n <div>\n <button\n id={buttonId}\n type='button'\n className='btn btn-sm btn-warning'\n onClick={() => onExpand(fieldPathId[ID_KEY])}\n >\n {translateString(TranslatableString.ExpandButton)}\n </button>{' '}\n </div>\n </div>\n );\n}\n","import type { ReactElement } from 'react';\nimport type { FormContextType, Registry, RJSFSchema, StrictRJSFSchema, UiSchema } from '@rjsf/utils';\nimport { getTestIds, getUiOptions } from '@rjsf/utils';\nimport { Markdown } from 'markdown-to-jsx/react';\n\nconst TEST_IDS = getTestIds();\n\nexport interface RichDescriptionProps<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n> {\n /** The description text for a field, potentially containing markdown */\n description: string | ReactElement;\n /** The uiSchema object for this base component */\n uiSchema?: UiSchema<T, S, F>;\n /** The `registry` object */\n registry: Registry<T, S, F>;\n}\n\n/** Renders the given `description` in the props as\n *\n * @param props - The `RichDescriptionProps` for this component\n */\nexport default function RichDescription<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>({ description, registry, uiSchema = {} }: RichDescriptionProps<T, S, F>) {\n const { globalUiOptions } = registry;\n const uiOptions = getUiOptions<T, S, F>(uiSchema, globalUiOptions);\n\n if (uiOptions.enableMarkdownInDescription && typeof description === 'string') {\n return (\n <Markdown options={{ disableParsingRawHTML: true }} data-testid={TEST_IDS.markdown}>\n {description}\n </Markdown>\n );\n }\n return description;\n}\n\nRichDescription.TEST_IDS = TEST_IDS;\n","import type { DescriptionFieldProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';\n\nimport RichDescription from '../RichDescription.tsx';\n\n/** The `DescriptionField` is the template to use to render the description of a field\n *\n * @param props - The `DescriptionFieldProps` for this component\n */\nexport default function DescriptionField<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: DescriptionFieldProps<T, S, F>) {\n const { id, description, registry, uiSchema } = props;\n if (!description) {\n return null;\n }\n return (\n <div id={id} className='field-description'>\n <RichDescription description={description} registry={registry} uiSchema={uiSchema} />\n </div>\n );\n}\n","import type { ErrorListProps, FormContextType, RJSFValidationError, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';\nimport { TranslatableString } from '@rjsf/utils';\n\n/** The `ErrorList` component is the template that renders the all the errors associated with the fields in the `Form`\n *\n * @param props - The `ErrorListProps` for this component\n */\nexport default function ErrorList<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({\n errors,\n registry,\n}: ErrorListProps<T, S, F>) {\n const { translateString } = registry;\n return (\n <div className='panel panel-danger errors'>\n <div className='panel-heading'>\n <h3 className='panel-title'>{translateString(TranslatableString.ErrorsLabel)}</h3>\n </div>\n <ul className='list-group'>\n {errors.map((error: RJSFValidationError, i: number) => (\n // oxlint-disable-next-line react/no-array-index-key\n <li key={i} className='list-group-item text-danger'>\n {error.stack}\n </li>\n ))}\n </ul>\n </div>\n );\n}\n","import type { FallbackFieldTemplateProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';\nimport { getTemplate } from '@rjsf/utils';\n\n/**\n * The `FallbackFieldTemplate` is used to render a field when no field matches. The field renders a type selector and\n * the schema field for the form data.\n */\nexport default function FallbackFieldTemplate<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: FallbackFieldTemplateProps<T, S, F>) {\n const { schema, registry, typeSelector, schemaField } = props;\n\n // By default, use the MultiSchemaFieldTemplate, which handles the same basic requirements.\n const MultiSchemaFieldTemplate = getTemplate<'MultiSchemaFieldTemplate', T, S, F>(\n 'MultiSchemaFieldTemplate',\n registry,\n );\n\n return (\n <MultiSchemaFieldTemplate\n selector={typeSelector}\n optionSchemaField={schemaField}\n schema={schema}\n registry={registry}\n />\n );\n}\n","import type { FieldErrorProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';\nimport { errorId } from '@rjsf/utils';\n\n/** The `FieldErrorTemplate` component renders the errors local to the particular field\n *\n * @param props - The `FieldErrorProps` for the errors being rendered\n */\nexport default function FieldErrorTemplate<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: FieldErrorProps<T, S, F>) {\n const { errors = [], fieldPathId } = props;\n if (errors.length === 0) {\n return null;\n }\n const id = errorId(fieldPathId);\n\n return (\n <div>\n <ul id={id} className='error-detail bs-callout bs-callout-info'>\n {errors\n .filter((elem) => !!elem)\n .map((error, index: number) => (\n // oxlint-disable-next-line react/no-array-index-key\n <li className='text-danger' key={index}>\n {error}\n </li>\n ))}\n </ul>\n </div>\n );\n}\n","import type { ReactElement } from 'react';\nimport type { FormContextType, Registry, RJSFSchema, StrictRJSFSchema, UiSchema } from '@rjsf/utils';\nimport { getTestIds, getUiOptions } from '@rjsf/utils';\nimport { Markdown } from 'markdown-to-jsx/react';\n\nconst TEST_IDS = getTestIds();\n\nexport interface RichHelpProps<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any> {\n /** The description text for a field, potentially containing markdown */\n help: string | ReactElement;\n /** The uiSchema object for this base component */\n uiSchema?: UiSchema<T, S, F>;\n /** The `registry` object */\n registry: Registry<T, S, F>;\n}\n\n/** Renders the given `description` in the props as\n *\n * @param props - The `RichHelpProps` for this component\n */\nexport default function RichHelp<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({\n help,\n registry,\n uiSchema = {},\n}: RichHelpProps<T, S, F>) {\n const { globalUiOptions } = registry;\n const uiOptions = getUiOptions<T, S, F>(uiSchema, globalUiOptions);\n\n if (uiOptions.enableMarkdownInHelp && typeof help === 'string') {\n return (\n <Markdown options={{ disableParsingRawHTML: true }} data-testid={TEST_IDS.markdown}>\n {help}\n </Markdown>\n );\n }\n return help;\n}\n\nRichHelp.TEST_IDS = TEST_IDS;\n","import type { FieldHelpProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';\nimport { helpId } from '@rjsf/utils';\n\nimport RichHelp from '../RichHelp.tsx';\n\n/** The `FieldHelpTemplate` component renders any help desired for a field\n *\n * @param props - The `FieldHelpProps` to be rendered\n */\nexport default function FieldHelpTemplate<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: FieldHelpProps<T, S, F>) {\n const { fieldPathId, help, uiSchema, registry } = props;\n if (!help) {\n return null;\n }\n\n return (\n <div id={helpId(fieldPathId)} className='help-block'>\n <RichHelp help={help as string} registry={registry} uiSchema={uiSchema} />\n </div>\n );\n}\n","const REQUIRED_FIELD_SYMBOL = '*';\n\nexport interface LabelProps {\n /** The label for the field */\n label?: string;\n /** A boolean value stating if the field is required */\n required?: boolean;\n /** The id of the input field being labeled */\n id?: string;\n}\n\n/** Renders a label for a field\n *\n * @param props - The `LabelProps` for this component\n */\nexport default function Label(props: LabelProps) {\n const { label, required, id } = props;\n if (!label) {\n return null;\n }\n return (\n <label className='control-label' htmlFor={id}>\n {label}\n {required && <span className='required'>{REQUIRED_FIELD_SYMBOL}</span>}\n </label>\n );\n}\n","import type { FieldTemplateProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';\nimport { getTemplate, getUiOptions } from '@rjsf/utils';\n\nimport Label from './Label.tsx';\n\n/** The `FieldTemplate` component is the template used by `SchemaField` to render any field. It renders the field\n * content, (label, description, children, errors and help) inside of a `WrapIfAdditional` component.\n *\n * @param props - The `FieldTemplateProps` for this component\n */\nexport default function FieldTemplate<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: FieldTemplateProps<T, S, F>) {\n const { id, label, children, errors, help, description, hidden, required, displayLabel, registry, uiSchema } = props;\n const uiOptions = getUiOptions(uiSchema);\n const WrapIfAdditionalTemplate = getTemplate<'WrapIfAdditionalTemplate', T, S, F>(\n 'WrapIfAdditionalTemplate',\n registry,\n uiOptions,\n );\n if (hidden) {\n return <div className='hidden'>{children}</div>;\n }\n const isCheckbox = uiOptions.widget === 'checkbox';\n return (\n <WrapIfAdditionalTemplate {...props}>\n {displayLabel && !isCheckbox && <Label label={label} required={required} id={id} />}\n {displayLabel && description ? description : null}\n {children}\n {errors}\n {help}\n </WrapIfAdditionalTemplate>\n );\n}\n","import FieldTemplate from './FieldTemplate.tsx';\n\nexport default FieldTemplate;\n","import type { GridTemplateProps } from '@rjsf/utils';\n\n/** Renders a `GridTemplate` for bootstrap 3, which is expecting the column information coming in via the `className`\n * prop. Also spreads all the other props provided by the user directly on the div.\n *\n * @param props - The GridTemplateProps, including the expected className for the bootstrap 3 grid behavior\n */\nexport default function GridTemplate(props: GridTemplateProps) {\n const { children, column, className, ...rest } = props;\n return (\n <div className={className} {...rest}>\n {children}\n </div>\n );\n}\n","import type { FormContextType, MultiSchemaFieldTemplateProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';\n\n/** The `MultiSchemaFieldTemplate` component renders the layout for the MultiSchemaField, which supports choosing\n * a schema from a list of schemas defined using `anyOf` or `oneOf`.\n *\n * @param props - The `MultiSchemaFieldTemplate` to be rendered\n */\nexport default function MultiSchemaFieldTemplate<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: MultiSchemaFieldTemplateProps<T, S, F>) {\n const { selector, optionSchemaField } = props;\n return (\n <div className='panel panel-default panel-body'>\n <div className='form-group'>{selector}</div>\n {optionSchemaField}\n </div>\n );\n}\n","import type {\n FormContextType,\n ObjectFieldTemplatePropertyType,\n ObjectFieldTemplateProps,\n RJSFSchema,\n StrictRJSFSchema,\n} from '@rjsf/utils';\nimport { canExpand, descriptionId, getTemplate, getUiOptions, titleId, buttonId } from '@rjsf/utils';\n\n/** The `ObjectFieldTemplate` is the template to use to render all the inner properties of an object along with the\n * title and description if available. If the object is expandable, then an `AddButton` is also rendered after all\n * the properties.\n *\n * @param props - The `ObjectFieldTemplateProps` for this component\n */\nexport default function ObjectFieldTemplate<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: ObjectFieldTemplateProps<T, S, F>) {\n const {\n className,\n description,\n disabled,\n formData,\n fieldPathId,\n onAddProperty,\n optionalDataControl,\n properties,\n readonly,\n registry,\n required,\n schema,\n title,\n uiSchema,\n } = props;\n const options = getUiOptions<T, S, F>(uiSchema);\n const TitleFieldTemplate = getTemplate<'TitleFieldTemplate', T, S, F>('TitleFieldTemplate', registry, options);\n const DescriptionFieldTemplate = getTemplate<'DescriptionFieldTemplate', T, S, F>(\n 'DescriptionFieldTemplate',\n registry,\n options,\n );\n\n // For \"pure union\" schemas (oneOf/anyOf without properties), skip rendering the empty fieldset wrapper.\n // The AnyOfField/OneOfField will handle rendering the union selector and selected variant's content directly.\n const isPureUnionSchema = (schema.oneOf || schema.anyOf) && !schema.properties && properties.length === 0;\n\n if (isPureUnionSchema) {\n return null;\n }\n\n const showOptionalDataControlInTitle = !readonly && !disabled;\n // Button templates are not overridden in the uiSchema\n const {\n ButtonTemplates: { AddButton },\n } = registry.templates;\n return (\n <fieldset className={className} id={fieldPathId.$id}>\n {title && (\n <TitleFieldTemplate\n id={titleId(fieldPathId)}\n title={title}\n required={required}\n schema={schema}\n uiSchema={uiSchema}\n registry={registry}\n optionalDataControl={showOptionalDataControlInTitle ? optionalDataControl : undefined}\n />\n )}\n {description && (\n <DescriptionFieldTemplate\n id={descriptionId(fieldPathId)}\n description={description}\n schema={schema}\n uiSchema={uiSchema}\n registry={registry}\n />\n )}\n {!showOptionalDataControlInTitle ? optionalDataControl : undefined}\n {properties.map((prop: ObjectFieldTemplatePropertyType) => prop.content)}\n {canExpand<T, S, F>(schema, uiSchema, formData) && (\n <AddButton\n id={buttonId(fieldPathId, 'add')}\n className='rjsf-object-property-expand'\n onClick={onAddProperty}\n disabled={disabled || readonly}\n uiSchema={uiSchema}\n registry={registry}\n />\n )}\n </fieldset>\n );\n}\n","import type { FormContextType, OptionalDataControlsTemplateProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';\n\nimport IconButton from './ButtonTemplates/IconButton.tsx';\n\n/** The OptionalDataControlsTemplate renders one of three different states. If\n * there is an `onAddClick()` function, it renders the \"Add\" button. If there is\n * an `onRemoveClick()` function, it renders the \"Remove\" button. Otherwise it\n * renders the \"No data found\" section. All of them use the `label` as either\n * the `title` of buttons or simply outputting it.\n *\n * @param props - The `OptionalDataControlsTemplateProps` for the template\n */\nexport default function OptionalDataControlsTemplate<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: OptionalDataControlsTemplateProps<T, S, F>) {\n const { id, registry, label, onAddClick, onRemoveClick } = props;\n if (onAddClick) {\n return (\n <IconButton\n id={id}\n registry={registry}\n icon='plus'\n className='rjsf-add-optional-data btn-sm'\n onClick={onAddClick}\n title={label}\n />\n );\n }\n if (onRemoveClick) {\n return (\n <IconButton\n id={id}\n registry={registry}\n icon='remove'\n className='rjsf-remove-optional-data btn-sm'\n onClick={onRemoveClick}\n title={label}\n />\n );\n }\n return <em id={id}>{label}</em>;\n}\n","import type { FormContextType, TitleFieldProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';\n\nconst REQUIRED_FIELD_SYMBOL = '*';\n\n/** The `TitleField` is the template to use to render the title of a field\n *\n * @param props - The `TitleFieldProps` for this component\n */\nexport default function TitleField<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n props: TitleFieldProps<T, S, F>,\n) {\n const { id, title, required, optionalDataControl } = props;\n return (\n <legend id={id}>\n {title}\n {required && <span className='required'>{REQUIRED_FIELD_SYMBOL}</span>}\n {optionalDataControl && (\n <span className='pull-right' style={{ marginBottom: '2px' }}>\n {optionalDataControl}\n </span>\n )}\n </legend>\n );\n}\n","import type { FormContextType, RJSFSchema, StrictRJSFSchema, UnsupportedFieldProps } from '@rjsf/utils';\nimport { TranslatableString } from '@rjsf/utils';\nimport { Markdown } from 'markdown-to-jsx/react';\n\n/** The `UnsupportedField` component is used to render a field in the schema is one that is not supported by\n * react-jsonschema-form.\n *\n * @param props - The `FieldProps` for this template\n */\nfunction UnsupportedField<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n props: UnsupportedFieldProps<T, S, F>,\n) {\n const { schema, fieldPathId, reason, registry } = props;\n const { translateString } = registry;\n let translateEnum: TranslatableString = TranslatableString.UnsupportedField;\n const translateParams: string[] = [];\n if (fieldPathId?.$id) {\n translateEnum = TranslatableString.UnsupportedFieldWithId;\n translateParams.push(fieldPathId.$id);\n }\n if (reason) {\n translateEnum =\n translateEnum === TranslatableString.UnsupportedField\n ? TranslatableString.UnsupportedFieldWithReason\n : TranslatableString.UnsupportedFieldWithIdAndReason;\n translateParams.push(reason);\n }\n return (\n <div className='unsupported-field'>\n <p>\n <Markdown options={{ disableParsingRawHTML: true }}>{translateString(translateEnum, translateParams)}</Markdown>\n </p>\n {schema && <pre>{JSON.stringify(schema, null, 2)}</pre>}\n </div>\n );\n}\n\nexport default UnsupportedField;\n","import type { FormContextType, RJSFSchema, StrictRJSFSchema, WrapIfAdditionalTemplateProps } from '@rjsf/utils';\nimport { ADDITIONAL_PROPERTY_FLAG, buttonId, TranslatableString } from '@rjsf/utils';\n\nimport Label from './FieldTemplate/Label.tsx';\n\n/** The `WrapIfAdditional` component is used by the `FieldTemplate` to rename, or remove properties that are\n * part of an `additionalProperties` part of a schema.\n *\n * @param props - The `WrapIfAdditionalProps` for this component\n */\nexport default function WrapIfAdditionalTemplate<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: WrapIfAdditionalTemplateProps<T, S, F>) {\n const {\n id,\n classNames,\n style,\n disabled,\n displayLabel,\n label,\n onKeyRenameBlur,\n onRemoveProperty,\n rawDescription,\n readonly,\n required,\n schema,\n hideError,\n rawErrors,\n children,\n uiSchema,\n registry,\n } = props;\n const { templates, translateString } = registry;\n // Button templates are not overridden in the uiSchema\n const { RemoveButton } = templates.ButtonTemplates;\n const keyLabel = translateString(TranslatableString.KeyLabel, [label]);\n const additional = ADDITIONAL_PROPERTY_FLAG in schema;\n const hasDescription = !!rawDescription;\n\n const classNamesList = ['form-group', classNames];\n if (!hideError && rawErrors && rawErrors.length > 0) {\n classNamesList.push('has-error has-danger');\n }\n const uiClassNames = classNamesList.join(' ').trim();\n\n if (!additional) {\n return (\n <div className={uiClassNames} style={style}>\n {children}\n </div>\n );\n }\n const margin = hasDescription ? 46 : 26;\n return (\n <div className={uiClassNames} style={style}>\n <div className='row'>\n <div className='col-xs-5 form-additional'>\n <div className='form-group'>\n {displayLabel && <Label label={keyLabel} required={required} id={`${id}-key`} />}\n {displayLabel && rawDescription && <div>&nbsp;</div>}\n <input\n key={label}\n className='form-control'\n type='text'\n id={`${id}-key`}\n onBlur={onKeyRenameBlur}\n defaultValue={label}\n />\n </div>\n </div>\n <div className='form-additional form-group col-xs-5'>{children}</div>\n <div className='col-xs-2' style={{ marginTop: displayLabel ? `${margin}px` : undefined }}>\n <RemoveButton\n id={buttonId(id, 'remove')}\n className='rjsf-object-property-remove btn-block'\n style={{ border: '0' }}\n disabled={disabled || readonly}\n onClick={onRemoveProperty}\n uiSchema={uiSchema}\n registry={registry}\n />\n </div>\n </div>\n </div>\n );\n}\n","import type { FormContextType, RJSFSchema, StrictRJSFSchema, TemplatesType } from '@rjsf/utils';\n\nimport ArrayFieldDescriptionTemplate from './ArrayFieldDescriptionTemplate.tsx';\nimport ArrayFieldItemButtonsTemplate from './ArrayFieldItemButtonsTemplate.tsx';\nimport ArrayFieldItemTemplate from './ArrayFieldItemTemplate.tsx';\nimport ArrayFieldTemplate from './ArrayFieldTemplate.tsx';\nimport ArrayFieldTitleTemplate from './ArrayFieldTitleTemplate.tsx';\nimport BaseInputTemplate from './BaseInputTemplate.tsx';\nimport ButtonTemplates from './ButtonTemplates/index.ts';\nimport CyclicSchemaExpandTemplate from './CyclicSchemaExpandTemplate.tsx';\nimport DescriptionField from './DescriptionField.tsx';\nimport ErrorList from './ErrorList.tsx';\nimport FallbackFieldTemplate from './FallbackFieldTemplate.tsx';\nimport FieldErrorTemplate from './FieldErrorTemplate.tsx';\nimport FieldHelpTemplate from './FieldHelpTemplate.tsx';\nimport FieldTemplate from './FieldTemplate/index.ts';\nimport GridTemplate from './GridTemplate.tsx';\nimport MultiSchemaFieldTemplate from './MultiSchemaFieldTemplate.tsx';\nimport ObjectFieldTemplate from './ObjectFieldTemplate.tsx';\nimport OptionalDataControlsTemplate from './OptionalDataControlsTemplate.tsx';\nimport TitleField from './TitleField.tsx';\nimport UnsupportedField from './UnsupportedField.tsx';\nimport WrapIfAdditionalTemplate from './WrapIfAdditionalTemplate.tsx';\n\nfunction templates<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(): TemplatesType<\n T,\n S,\n F\n> {\n return {\n ArrayFieldDescriptionTemplate,\n ArrayFieldItemTemplate,\n ArrayFieldItemButtonsTemplate,\n ArrayFieldTemplate,\n ArrayFieldTitleTemplate,\n ButtonTemplates: ButtonTemplates<T, S, F>(),\n BaseInputTemplate,\n CyclicSchemaExpandTemplate,\n DescriptionFieldTemplate: DescriptionField,\n ErrorListTemplate: ErrorList,\n FallbackFieldTemplate,\n FieldTemplate,\n FieldErrorTemplate,\n FieldHelpTemplate,\n GridTemplate,\n MultiSchemaFieldTemplate,\n ObjectFieldTemplate,\n OptionalDataControlsTemplate,\n TitleFieldTemplate: TitleField,\n UnsupportedFieldTemplate: UnsupportedField,\n WrapIfAdditionalTemplate,\n };\n}\n\nexport default templates;\n","import type { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';\n\n/** The `AltDateTimeWidget` is an alternative widget for rendering datetime properties.\n * It uses the AltDateWidget for rendering, with the `time` prop set to true by default.\n *\n * @param props - The `WidgetProps` for this component\n */\nfunction AltDateTimeWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({\n time = true,\n ...props\n}: WidgetProps<T, S, F>) {\n const { AltDateWidget } = props.registry.widgets;\n return <AltDateWidget time={time} {...props} />;\n}\n\nexport default AltDateTimeWidget;\n","import type { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';\nimport { DateElement, TranslatableString, useAltDateWidgetProps } from '@rjsf/utils';\n\n/** The `AltDateWidget` is an alternative widget for rendering date properties.\n * @param props - The `WidgetProps` for this component\n */\nfunction AltDateWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n props: WidgetProps<T, S, F>,\n) {\n const { disabled = false, readonly = false, autofocus = false, options, id, name, registry, onBlur, onFocus } = props;\n const { translateString } = registry;\n const { elements, handleChange, handleClear, handleSetNow } = useAltDateWidgetProps(props);\n\n return (\n <ul className='list-inline'>\n {elements.map((elemProps, i) => (\n // oxlint-disable-next-line react/no-array-index-key\n <li className='list-inline-item' key={i}>\n <DateElement\n rootId={id}\n name={name}\n select={handleChange}\n {...elemProps}\n disabled={disabled}\n readonly={readonly}\n registry={registry}\n onBlur={onBlur}\n onFocus={onFocus}\n autofocus={autofocus && i === 0}\n />\n </li>\n ))}\n {(options.hideNowButton !== 'undefined' ? !options.hideNowButton : true) && (\n <li className='list-inline-item'>\n <button type='button' className='btn btn-info btn-now' onClick={handleSetNow}>\n {translateString(TranslatableString.NowLabel)}\n </button>\n </li>\n )}\n {(options.hideClearButton !== 'undefined' ? !options.hideClearButton : true) && (\n <li className='list-inline-item'>\n <button type='button' className='btn btn-warning btn-clear' onClick={handleClear}>\n {translateString(TranslatableString.ClearLabel)}\n </button>\n </li>\n )}\n </ul>\n );\n}\n\nexport default AltDateWidget;\n","import type { ChangeEvent, FocusEvent } from 'react';\nimport { useCallback } from 'react';\nimport type { FormContextType, WidgetProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';\nimport {\n ariaDescribedByIds,\n enumOptionValueDecoder,\n enumOptionValueEncoder,\n enumOptionsDeselectValue,\n enumOptionsIsSelected,\n enumOptionsSelectValue,\n getOptionValueFormat,\n optionId,\n} from '@rjsf/utils';\n\n/** The `CheckboxesWidget` is a widget for rendering checkbox groups.\n * It is typically used to represent an array of enums.\n *\n * @param props - The `WidgetProps` for this component\n */\nfunction CheckboxesWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({\n id,\n disabled,\n options,\n value,\n autofocus = false,\n readonly,\n onChange,\n onBlur,\n onFocus,\n htmlName,\n}: WidgetProps<T, S, F>) {\n const { inline = false, enumOptions, enumDisabled, emptyValue } = options;\n const optionValueFormat = getOptionValueFormat(options);\n const checkboxesValues = Array.isArray(value) ? value : [value];\n\n const handleBlur = useCallback(\n ({ target }: FocusEvent<HTMLInputElement>) =>\n onBlur(id, enumOptionValueDecoder<S>(target?.value, enumOptions, optionValueFormat, emptyValue)),\n [onBlur, id, enumOptions, emptyValue, optionValueFormat],\n );\n\n const handleFocus = useCallback(\n ({ target }: FocusEvent<HTMLInputElement>) =>\n onFocus(id, enumOptionValueDecoder<S>(target?.value, enumOptions, optionValueFormat, emptyValue)),\n [onFocus, id, enumOptions, emptyValue, optionValueFormat],\n );\n\n return (\n <div className='checkboxes' id={id}>\n {Array.isArray(enumOptions) &&\n enumOptions.map((option, index) => {\n const checked = enumOptionsIsSelected<S>(option.value, checkboxesValues);\n const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.includes(option.value);\n const disabledCls = disabled || itemDisabled || readonly ? 'disabled' : '';\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n if (event.target.checked) {\n onChange(enumOptionsSelectValue<S>(index, checkboxesValues, enumOptions));\n } else {\n onChange(enumOptionsDeselectValue<S>(index, checkboxesValues, enumOptions));\n }\n };\n\n const checkbox = (\n <span>\n <input\n type='checkbox'\n id={optionId(id, index)}\n name={htmlName || id}\n checked={checked}\n value={enumOptionValueEncoder(option.value, index, optionValueFormat)}\n disabled={disabled || itemDisabled || readonly}\n autoFocus={autofocus && index === 0}\n onChange={handleChange}\n onBlur={handleBlur}\n onFocus={handleFocus}\n aria-describedby={ariaDescribedByIds(id)}\n />\n <span>{option.label}</span>\n </span>\n );\n return inline ? (\n <label key={String(option.value)} className={`checkbox-inline ${disabledCls}`}>\n {checkbox}\n </label>\n ) : (\n <div key={String(option.value)} className={`checkbox ${disabledCls}`}>\n <label>{checkbox}</label>\n </div>\n );\n })}\n </div>\n );\n}\n\nexport default CheckboxesWidget;\n","import type { ChangeEvent, FocusEvent } from 'react';\nimport { useCallback } from 'react';\nimport type { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';\nimport {\n ariaDescribedByIds,\n descriptionId,\n getTemplate,\n labelValue,\n schemaRequiresTrueValue,\n getUiOptions,\n} from '@rjsf/utils';\n\n/** The `CheckBoxWidget` is a widget for rendering boolean properties.\n * It is typically used to represent a boolean.\n *\n * @param props - The `WidgetProps` for this component\n */\nfunction CheckboxWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({\n schema,\n uiSchema,\n options,\n id,\n value,\n disabled,\n readonly,\n label,\n hideLabel,\n autofocus = false,\n onBlur,\n onFocus,\n onChange,\n registry,\n htmlName,\n required,\n}: WidgetProps<T, S, F>) {\n const DescriptionFieldTemplate = getTemplate<'DescriptionFieldTemplate', T, S, F>(\n 'DescriptionFieldTemplate',\n registry,\n options,\n );\n // Because an unchecked checkbox will cause html5 validation to fail, only add\n // the \"required\" attribute if the field value must be \"true\", due to the\n // \"const\" or \"enum\" keywords\n const trueValueRequired = schemaRequiresTrueValue<S>(schema) && required;\n\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => onChange(event.target.checked),\n [onChange],\n );\n\n const handleBlur = useCallback(\n (event: FocusEvent<HTMLInputElement>) => onBlur(id, event.target.checked),\n [onBlur, id],\n );\n\n const handleFocus = useCallback(\n (event: FocusEvent<HTMLInputElement>) => onFocus(id, event.target.checked),\n [onFocus, id],\n );\n\n const uiOptions = getUiOptions(uiSchema);\n const isCheckboxWidget = uiOptions.widget === 'checkbox';\n const description = isCheckboxWidget ? undefined : (options.description ?? schema.description);\n return (\n <div className={`checkbox ${disabled || readonly ? 'disabled' : ''}`}>\n {!hideLabel && description && (\n <DescriptionFieldTemplate\n id={descriptionId(id)}\n description={description}\n schema={schema}\n uiSchema={uiSchema}\n registry={registry}\n />\n )}\n <label>\n <input\n type='checkbox'\n id={id}\n name={htmlName || id}\n checked={typeof value === 'undefined' ? false : value}\n required={required}\n disabled={disabled || readonly}\n autoFocus={autofocus}\n onChange={handleChange}\n onBlur={handleBlur}\n onFocus={handleFocus}\n aria-describedby={ariaDescribedByIds(id)}\n />\n {labelValue(\n <span>\n {label}\n {trueValueRequired && <span className='required'>*</span>}\n </span>,\n hideLabel,\n )}\n </label>\n </div>\n );\n}\n\nexport default CheckboxWidget;\n","import type { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';\nimport { getTemplate } from '@rjsf/utils';\n\n/** The `ColorWidget` component uses the `BaseInputTemplate` changing the type to `color` and disables it when it is\n * either disabled or readonly.\n *\n * @param props - The `WidgetProps` for this component\n */\nexport default function ColorWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n props: WidgetProps<T, S, F>,\n) {\n const { disabled, readonly, options, registry } = props;\n const BaseInputTemplate = getTemplate<'BaseInputTemplate', T, S, F>('BaseInputTemplate', registry, options);\n return <BaseInputTemplate type='color' {...props} disabled={disabled || readonly} />;\n}\n","import type { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';\nimport { getTemplate, localToUTC, utcToLocal } from '@rjsf/utils';\n\n/** The `DateTimeWidget` component uses the `BaseInputTemplate` changing the type to `datetime-local` and transforms\n * the value to/from utc using the appropriate utility functions.\n *\n * @param props - The `WidgetProps` for this component\n */\nexport default function DateTimeWidget<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: WidgetProps<T, S, F>) {\n const { onChange, value, options, registry } = props;\n const BaseInputTemplate = getTemplate<'BaseInputTemplate', T, S, F>('BaseInputTemplate', registry, options);\n return (\n <BaseInputTemplate\n type='datetime-local'\n {...props}\n value={utcToLocal(value)}\n onChange={(newValue) => onChange(localToUTC(newValue))}\n />\n );\n}\n","import { useCallback } from 'react';\nimport type { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';\nimport { getTemplate } from '@rjsf/utils';\n\n/** The `DateWidget` component uses the `BaseInputTemplate` changing the type to `date` and transforms\n * the value to undefined when it is falsy during the `onChange` handling.\n *\n * @param props - The `WidgetProps` for this component\n */\nexport default function DateWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n props: WidgetProps<T, S, F>,\n) {\n const { onChange, options, registry } = props;\n const BaseInputTemplate = getTemplate<'BaseInputTemplate', T, S, F>('BaseInputTemplate', registry, options);\n const handleChange = useCallback((value: any) => onChange(value || undefined), [onChange]);\n\n return <BaseInputTemplate type='date' {...props} onChange={handleChange} />;\n}\n","import type { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';\nimport { getTemplate } from '@rjsf/utils';\n\n/** The `EmailWidget` component uses the `BaseInputTemplate` changing the type to `email`.\n *\n * @param props - The `WidgetProps` for this component\n */\nexport default function EmailWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n props: WidgetProps<T, S, F>,\n) {\n const { options, registry } = props;\n const BaseInputTemplate = getTemplate<'BaseInputTemplate', T, S, F>('BaseInputTemplate', registry, options);\n return <BaseInputTemplate type='email' {...props} />;\n}\n","import type { ChangeEvent } from 'react';\nimport type {\n FileInfoType,\n FormContextType,\n Registry,\n RJSFSchema,\n StrictRJSFSchema,\n UIOptionsType,\n WidgetProps,\n} from '@rjsf/utils';\nimport { getTemplate, TranslatableString, useFileWidgetProps } from '@rjsf/utils';\nimport { Markdown } from 'markdown-to-jsx/react';\n\nfunction FileInfoPreview<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({\n fileInfo,\n registry,\n}: {\n fileInfo: FileInfoType;\n registry: Registry<T, S, F>;\n}) {\n const { translateString } = registry;\n const { dataURL, type, name } = fileInfo;\n if (!dataURL) {\n return null;\n }\n const previewLabel = translateString(TranslatableString.PreviewLabel);\n\n // If type is JPEG or PNG then show image preview.\n // Originally, any type of image was supported, but this was changed into a whitelist\n // since SVGs and animated GIFs are also images, which are generally considered a security risk.\n if (['image/jpeg', 'image/png'].includes(type)) {\n return <img src={dataURL} alt={previewLabel} style={{ maxWidth: '100%' }} className='file-preview' />;\n }\n\n // otherwise, let users download file\n\n return (\n <>\n {' '}\n <a download={`preview-${name}`} href={dataURL} className='file-download'>\n {previewLabel}\n </a>\n </>\n );\n}\n\nfunction FilesInfo<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({\n filesInfo,\n registry,\n preview,\n onRemove,\n options,\n}: {\n filesInfo: FileInfoType[];\n registry: Registry<T, S, F>;\n preview?: boolean;\n onRemove: (index: number) => void;\n options: UIOptionsType<T, S, F>;\n}) {\n if (filesInfo.length === 0) {\n return null;\n }\n const { translateString } = registry;\n\n const { RemoveButton } = getTemplate<'ButtonTemplates', T, S, F>('ButtonTemplates', registry, options);\n\n return (\n <ul className='file-info'>\n {filesInfo.map((fileInfo, key) => {\n const { name, size, type } = fileInfo;\n const handleRemove = () => onRemove(key);\n return (\n // oxlint-disable-next-line react/no-array-index-key\n <li key={key}>\n <Markdown>{translateString(TranslatableString.FilesInfo, [name, type, String(size)])}</Markdown>\n {preview && <FileInfoPreview<T, S, F> fileInfo={fileInfo} registry={registry} />}\n <RemoveButton onClick={handleRemove} registry={registry} />\n </li>\n );\n })}\n </ul>\n );\n}\n\n/**\n * The `FileWidget` is a widget for rendering file upload fields.\n * It is typically used with a string property with data-url format.\n */\nfunction FileWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n props: WidgetProps<T, S, F>,\n) {\n const { disabled, readonly, required, multiple, onChange, value, options, registry } = props;\n const { filesInfo, handleChange, handleRemove } = useFileWidgetProps(value, onChange, multiple);\n const BaseInputTemplate = getTemplate<'BaseInputTemplate', T, S, F>('BaseInputTemplate', registry, options);\n\n const handleOnChangeEvent = (event: ChangeEvent<HTMLInputElement>) => {\n if (event.target.files) {\n // handleChange is async; DOM event handlers are void-returning, so we intentionally don't await\n // oxlint-disable-next-line no-floating-promises, no-void\n void handleChange(event.target.files);\n }\n };\n\n return (\n <div>\n <BaseInputTemplate\n {...props}\n disabled={disabled || readonly}\n type='file'\n required={value ? false : required} // this turns off HTML required validation when a value exists\n onChangeOverride={handleOnChangeEvent}\n value=''\n accept={options.accept ? String(options.accept) : undefined}\n />\n <FilesInfo<T, S, F>\n filesInfo={filesInfo}\n onRemove={handleRemove}\n registry={registry}\n preview={options.filePreview}\n options={options}\n />\n </div>\n );\n}\n\nexport default FileWidget;\n","import type { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';\n\n/** The `HiddenWidget` is a widget for rendering a hidden input field.\n * It is typically used by setting type to \"hidden\".\n *\n * @param props - The `WidgetProps` for this component\n */\nfunction HiddenWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({\n id,\n value,\n htmlName,\n}: WidgetProps<T, S, F>) {\n return <input type='hidden' id={id} name={htmlName || id} value={typeof value === 'undefined' ? '' : value} />;\n}\n\nexport default HiddenWidget;\n","import type { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';\nimport { getTemplate } from '@rjsf/utils';\n\n/** The `PasswordWidget` component uses the `BaseInputTemplate` changing the type to `password`.\n *\n * @param props - The `WidgetProps` for this component\n */\nexport default function PasswordWidget<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: WidgetProps<T, S, F>) {\n const { options, registry } = props;\n const BaseInputTemplate = getTemplate<'BaseInputTemplate', T, S, F>('BaseInputTemplate', registry, options);\n return <BaseInputTemplate type='password' {...props} />;\n}\n","import type { FocusEvent } from 'react';\nimport { useCallback } from 'react';\nimport type { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';\nimport {\n ariaDescribedByIds,\n enumOptionValueDecoder,\n enumOptionValueEncoder,\n enumOptionsIsSelected,\n getOptionValueFormat,\n optionId,\n} from '@rjsf/utils';\n\n/** The `RadioWidget` is a widget for rendering a radio group.\n * It is typically used with a string property constrained with enum options.\n *\n * @param props - The `WidgetProps` for this component\n */\nfunction RadioWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({\n options,\n value,\n required,\n disabled,\n readonly,\n autofocus = false,\n onBlur,\n onFocus,\n onChange,\n id,\n htmlName,\n}: WidgetProps<T, S, F>) {\n const { enumOptions, enumDisabled, inline, emptyValue } = options;\n const optionValueFormat = getOptionValueFormat(options);\n\n const handleBlur = useCallback(\n ({ target }: FocusEvent<HTMLInputElement>) =>\n onBlur(id, enumOptionValueDecoder<S>(target?.value, enumOptions, optionValueFormat, emptyValue)),\n [onBlur, enumOptions, emptyValue, id, optionValueFormat],\n );\n\n const handleFocus = useCallback(\n ({ target }: FocusEvent<HTMLInputElement>) =>\n onFocus(id, enumOptionValueDecoder<S>(target?.value, enumOptions, optionValueFormat, emptyValue)),\n [onFocus, enumOptions, emptyValue, id, optionValueFormat],\n );\n\n return (\n <div className='field-radio-group' id={id} role='radiogroup'>\n {Array.isArray(enumOptions) &&\n enumOptions.map((option, i) => {\n const checked = enumOptionsIsSelected<S>(option.value, value);\n const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.includes(option.value);\n const disabledCls = disabled || itemDisabled || readonly ? 'disabled' : '';\n\n const handleChange = () => onChange(option.value);\n\n const radio = (\n <span>\n <input\n type='radio'\n id={optionId(id, i)}\n checked={checked}\n name={htmlName || id}\n required={required}\n value={enumOptionValueEncoder(option.value, i, optionValueFormat)}\n disabled={disabled || itemDisabled || readonly}\n autoFocus={autofocus && i === 0}\n onChange={handleChange}\n onBlur={handleBlur}\n onFocus={handleFocus}\n aria-describedby={ariaDescribedByIds(id)}\n />\n <span>{option.label}</span>\n </span>\n );\n\n return inline ? (\n <label key={String(option.value)} className={`radio-inline ${disabledCls}`}>\n {radio}\n </label>\n ) : (\n <div key={String(option.value)} className={`radio ${disabledCls}`}>\n <label>{radio}</label>\n </div>\n );\n })}\n </div>\n );\n}\n\nexport default RadioWidget;\n","import type { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';\n\n/** The `RangeWidget` component uses the `BaseInputTemplate` changing the type to `range` and wrapping the result\n * in a div, with the value along side it.\n *\n * @param props - The `WidgetProps` for this component\n */\nexport default function RangeWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n props: WidgetProps<T, S, F>,\n) {\n const {\n value,\n registry: {\n templates: { BaseInputTemplate },\n },\n } = props;\n return (\n <div className='field-range-wrapper'>\n <BaseInputTemplate type='range' {...props} />\n <span className='range-view'>{value}</span>\n </div>\n );\n}\n","import type { FocusEvent } from 'react';\nimport { useCallback } from 'react';\nimport type { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';\n\n/** The `RatingWidget` component renders a star or heart rating input\n *\n * Features:\n * - Configurable number of stars/hearts (1-5) with default of 5\n * - Supports different shapes (star, heart)\n * - Supports minimum and maximum values from schema\n * - Handles required, disabled, and readonly states\n * - Provides focus and blur event handling for accessibility\n * - Uses Unicode characters for better visual representation\n *\n * @param props - The `WidgetProps` for this component\n */\nexport default function RatingWidget<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>({\n id,\n value,\n required,\n disabled,\n readonly,\n onChange,\n onFocus,\n onBlur,\n schema,\n options,\n htmlName,\n}: WidgetProps<T, S, F>) {\n const { stars = 5, shape = 'star' } = options;\n\n // Use schema.maximum if provided, otherwise use stars option (limited to 1-5)\n const numStars = schema.maximum ? Math.min(schema.maximum, 5) : Math.min(Math.max(stars as number, 1), 5);\n const min = schema.minimum || 0;\n\n /** Handles clicking on a star to set the rating */\n const handleStarClick = useCallback(\n (starValue: number) => {\n if (!disabled && !readonly) {\n onChange(starValue);\n }\n },\n [onChange, disabled, readonly],\n );\n\n /** Handles focus events for accessibility */\n const handleFocus = useCallback(\n (event: FocusEvent<HTMLSpanElement>) => {\n if (onFocus) {\n // Get the star value from the data attribute\n const starValue = Number((event.target as HTMLElement).dataset.value);\n onFocus(id, starValue);\n }\n },\n [onFocus, id],\n );\n\n /** Handles blur events for accessibility */\n const handleBlur = useCallback(\n (event: FocusEvent<HTMLSpanElement>) => {\n if (onBlur) {\n // Get the star value from the data attribute\n const starValue = Number((event.target as HTMLElement).dataset.value);\n onBlur(id, starValue);\n }\n },\n [onBlur, id],\n );\n\n // Get the appropriate Unicode character based on shape option\n const getSymbol = (isFilled: boolean): string => {\n if (shape === 'heart') {\n return isFilled ? '♥' : '♡';\n }\n return isFilled ? '★' : '☆';\n };\n\n return (\n <div\n className='rating-widget'\n style={{\n display: 'inline-flex',\n fontSize: '1.5rem',\n cursor: disabled || readonly ? 'default' : 'pointer',\n }}\n >\n {[...Array(numStars)].map((_, index) => {\n const starValue = min + index;\n const isFilled = starValue <= value;\n\n return (\n <span\n // oxlint-disable-next-line react/no-array-index-key\n key={index}\n onClick={() => handleStarClick(starValue)}\n onKeyDown={(e) => (e.key === 'Enter' || e.key === ' ') && handleStarClick(starValue)}\n onFocus={handleFocus}\n onBlur={handleBlur}\n data-value={starValue}\n tabIndex={disabled || readonly ? -1 : 0}\n role='radio'\n aria-checked={starValue === value}\n aria-label={`${starValue} ${shape === 'heart' ? 'heart' : 'star'}${starValue === 1 ? '' : 's'}`}\n style={{\n color: isFilled ? '#FFD700' : '#ccc',\n padding: '0 0.2rem',\n transition: 'color 0.2s',\n userSelect: 'none',\n }}\n >\n {getSymbol(isFilled)}\n </span>\n );\n })}\n <input\n type='hidden'\n id={id}\n name={htmlName || id}\n value={value || ''}\n required={required}\n disabled={disabled || readonly}\n aria-hidden='true'\n />\n </div>\n );\n}\n","import type { ChangeEvent, FocusEvent, SyntheticEvent } from 'react';\nimport { useCallback } from 'react';\nimport type { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';\nimport {\n ariaDescribedByIds,\n enumOptionSelectedValue,\n enumOptionValueDecoder,\n enumOptionValueEncoder,\n getOptionValueFormat,\n logUnsupportedDefaultForEnum,\n SelectedOptionDescription,\n} from '@rjsf/utils';\n\nfunction getValue(event: SyntheticEvent<HTMLSelectElement>, multiple: boolean) {\n if (multiple) {\n return Array.from((event.target as HTMLSelectElement).options)\n .slice()\n .filter((o) => o.selected)\n .map((o) => o.value);\n }\n return (event.target as HTMLSelectElement).value;\n}\n\n/** The `SelectWidget` is a widget for rendering dropdowns.\n * It is typically used with string properties constrained with enum options.\n *\n * @param props - The `WidgetProps` for this component\n */\nfunction SelectWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({\n schema,\n id,\n options,\n value,\n required,\n disabled,\n readonly,\n multiple = false,\n autofocus = false,\n onChange,\n onBlur,\n onFocus,\n placeholder,\n htmlName,\n registry,\n uiSchema,\n}: WidgetProps<T, S, F>) {\n const { enumOptions, enumDisabled, emptyValue: optEmptyVal } = options;\n const emptyValue = multiple ? [] : '';\n const optionValueFormat = getOptionValueFormat(options);\n\n const handleFocus = useCallback(\n (event: FocusEvent<HTMLSelectElement>) => {\n const newValue = getValue(event, multiple);\n return onFocus(id, enumOptionValueDecoder<S>(newValue, enumOptions, optionValueFormat, optEmptyVal));\n },\n [onFocus, id, multiple, enumOptions, optEmptyVal, optionValueFormat],\n );\n\n const handleBlur = useCallback(\n (event: FocusEvent<HTMLSelectElement>) => {\n const newValue = getValue(event, multiple);\n return onBlur(id, enumOptionValueDecoder<S>(newValue, enumOptions, optionValueFormat, optEmptyVal));\n },\n [onBlur, id, multiple, enumOptions, optEmptyVal, optionValueFormat],\n );\n\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLSelectElement>) => {\n const newValue = getValue(event, multiple);\n return onChange(enumOptionValueDecoder<S>(newValue, enumOptions, optionValueFormat, optEmptyVal));\n },\n [onChange, multiple, enumOptions, optEmptyVal, optionValueFormat],\n );\n\n const selectValue = enumOptionSelectedValue<S>(value, enumOptions, multiple, optionValueFormat, emptyValue);\n const showPlaceholderOption = !multiple && schema.default === undefined;\n logUnsupportedDefaultForEnum<S>(id, schema, enumOptions, multiple);\n\n return (\n <>\n <SelectedOptionDescription\n id={id}\n multiple={multiple}\n options={options}\n registry={registry}\n uiSchema={uiSchema}\n value={value}\n />\n {/* oxlint-disable-next-line jsx-a11y/no-autofocus */}\n <select\n id={id}\n name={htmlName || id}\n multiple={multiple}\n className='form-control'\n value={selectValue}\n required={required}\n disabled={disabled || readonly}\n autoFocus={autofocus}\n onBlur={handleBlur}\n onFocus={handleFocus}\n onChange={handleChange}\n aria-describedby={ariaDescribedByIds(id)}\n >\n {showPlaceholderOption && <option value=''>{placeholder}</option>}\n {Array.isArray(enumOptions) &&\n enumOptions.map(({ value: enumValue, label: enumLabel }, i) => {\n const isDisabled = enumDisabled && enumDisabled.includes(enumValue);\n return (\n <option\n key={String(enumValue)}\n value={enumOptionValueEncoder(enumValue, i, optionValueFormat)}\n disabled={isDisabled}\n >\n {enumLabel}\n </option>\n );\n })}\n </select>\n </>\n );\n}\n\nexport default SelectWidget;\n","import type { ChangeEvent, FocusEvent } from 'react';\nimport { useCallback } from 'react';\nimport type { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';\nimport { ariaDescribedByIds } from '@rjsf/utils';\n\n/** The `TextareaWidget` is a widget for rendering input fields as textarea.\n *\n * @param props - The `WidgetProps` for this component\n */\nfunction TextareaWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({\n id,\n options,\n placeholder,\n value,\n required,\n disabled,\n readonly,\n autofocus = false,\n onChange,\n onBlur,\n onFocus,\n htmlName,\n}: WidgetProps<T, S, F>) {\n const handleChange = useCallback(\n ({ target: { value: newValue } }: ChangeEvent<HTMLTextAreaElement>) =>\n onChange(newValue === '' ? options.emptyValue : newValue),\n [onChange, options.emptyValue],\n );\n\n const handleBlur = useCallback(\n ({ target }: FocusEvent<HTMLTextAreaElement>) => onBlur(id, target?.value),\n [onBlur, id],\n );\n\n const handleFocus = useCallback(\n ({ target }: FocusEvent<HTMLTextAreaElement>) => onFocus(id, target?.value),\n [id, onFocus],\n );\n\n return (\n <textarea\n id={id}\n name={htmlName || id}\n className='form-control'\n value={value || ''}\n placeholder={placeholder}\n required={required}\n disabled={disabled}\n readOnly={readonly}\n autoFocus={autofocus}\n rows={options.rows}\n onBlur={handleBlur}\n onFocus={handleFocus}\n onChange={handleChange}\n aria-describedby={ariaDescribedByIds(id)}\n />\n );\n}\n\nexport default TextareaWidget;\n","import type { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';\nimport { getTemplate } from '@rjsf/utils';\n\n/** The `TextWidget` component uses the `BaseInputTemplate`.\n *\n * @param props - The `WidgetProps` for this component\n */\nexport default function TextWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n props: WidgetProps<T, S, F>,\n) {\n const { options, registry } = props;\n const BaseInputTemplate = getTemplate<'BaseInputTemplate', T, S, F>('BaseInputTemplate', registry, options);\n return <BaseInputTemplate {...props} />;\n}\n","import { useCallback } from 'react';\nimport type { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';\nimport { getTemplate } from '@rjsf/utils';\n\n/** The `TimeWidget` component uses the `BaseInputTemplate` changing the type to `time` and transforms\n * the value to undefined when it is falsy during the `onChange` handling.\n *\n * @param props - The `WidgetProps` for this component\n */\nexport default function TimeWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n props: WidgetProps<T, S, F>,\n) {\n const { onChange, options, registry, schema, value } = props;\n const BaseInputTemplate = getTemplate<'BaseInputTemplate', T, S, F>('BaseInputTemplate', registry, options);\n const hasSecondPrecision =\n typeof schema.multipleOf === 'number' && Number.isFinite(schema.multipleOf) && schema.multipleOf < 60;\n const handleChange = useCallback(\n (newValue: any) => {\n if (!newValue) {\n onChange(undefined);\n } else if (hasSecondPrecision) {\n onChange(newValue);\n } else {\n onChange(`${newValue}:00`);\n }\n },\n [hasSecondPrecision, onChange],\n );\n const displayValue =\n typeof value === 'string' && !hasSecondPrecision && /^\\d{2}:\\d{2}:00$/.test(value) ? value.slice(0, -3) : value;\n\n return <BaseInputTemplate type='time' {...props} value={displayValue} onChange={handleChange} />;\n}\n","import type { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';\nimport { getTemplate } from '@rjsf/utils';\n\n/** The `UpDownWidget` component uses the `BaseInputTemplate` changing the type to `number`.\n *\n * @param props - The `WidgetProps` for this component\n */\nexport default function UpDownWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n props: WidgetProps<T, S, F>,\n) {\n const { options, registry } = props;\n const BaseInputTemplate = getTemplate<'BaseInputTemplate', T, S, F>('BaseInputTemplate', registry, options);\n return <BaseInputTemplate type='number' {...props} />;\n}\n","import type { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';\nimport { getTemplate } from '@rjsf/utils';\n\n/** The `URLWidget` component uses the `BaseInputTemplate` changing the type to `url`.\n *\n * @param props - The `WidgetProps` for this component\n */\nexport default function URLWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n props: WidgetProps<T, S, F>,\n) {\n const { options, registry } = props;\n const BaseInputTemplate = getTemplate<'BaseInputTemplate', T, S, F>('BaseInputTemplate', registry, options);\n return <BaseInputTemplate type='url' {...props} />;\n}\n","import type { FormContextType, RegistryWidgetsType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';\n\nimport AltDateTimeWidget from './AltDateTimeWidget.tsx';\nimport AltDateWidget from './AltDateWidget.tsx';\nimport CheckboxesWidget from './CheckboxesWidget.tsx';\nimport CheckboxWidget from './CheckboxWidget.tsx';\nimport ColorWidget from './ColorWidget.tsx';\nimport DateTimeWidget from './DateTimeWidget.tsx';\nimport DateWidget from './DateWidget.tsx';\nimport EmailWidget from './EmailWidget.tsx';\nimport FileWidget from './FileWidget.tsx';\nimport HiddenWidget from './HiddenWidget.tsx';\nimport PasswordWidget from './PasswordWidget.tsx';\nimport RadioWidget from './RadioWidget.tsx';\nimport RangeWidget from './RangeWidget.tsx';\nimport RatingWidget from './RatingWidget.tsx';\nimport SelectWidget from './SelectWidget.tsx';\nimport TextareaWidget from './TextareaWidget.tsx';\nimport TextWidget from './TextWidget.tsx';\nimport TimeWidget from './TimeWidget.tsx';\nimport UpDownWidget from './UpDownWidget.tsx';\nimport URLWidget from './URLWidget.tsx';\n\nfunction widgets<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(): RegistryWidgetsType<T, S, F> {\n return {\n AltDateWidget,\n AltDateTimeWidget,\n CheckboxWidget,\n CheckboxesWidget,\n ColorWidget,\n DateWidget,\n DateTimeWidget,\n EmailWidget,\n FileWidget,\n HiddenWidget,\n PasswordWidget,\n RadioWidget,\n RangeWidget,\n RatingWidget,\n SelectWidget,\n TextWidget,\n TextareaWidget,\n TimeWidget,\n UpDownWidget,\n URLWidget,\n };\n}\n\nexport default widgets;\n","import type { FormContextType, Registry, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';\nimport { DEFAULT_ID_PREFIX, DEFAULT_ID_SEPARATOR, englishStringTranslator } from '@rjsf/utils';\n\nimport fields from './components/fields/index.ts';\nimport templates from './components/templates/index.ts';\nimport widgets from './components/widgets/index.ts';\n\n/** The default registry consists of all the fields, templates and widgets provided in the core implementation,\n * plus an empty `rootSchema` and `formContext. We omit schemaUtils here because it cannot be defaulted without a\n * rootSchema and validator. It will be added into the computed registry later in the Form.\n */\nexport default function getDefaultRegistry<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(): Omit<Registry<T, S, F>, 'schemaUtils'> {\n return {\n fields: fields<T, S, F>(),\n templates: templates<T, S, F>(),\n widgets: widgets<T, S, F>(),\n rootSchema: {} as S,\n formContext: {} as F,\n translateString: englishStringTranslator,\n globalFormOptions: {\n idPrefix: DEFAULT_ID_PREFIX,\n idSeparator: DEFAULT_ID_SEPARATOR,\n useFallbackUiForUnsupportedType: false,\n },\n };\n}\n","import type {\n SessionPluginConfigError,\n SessionPluginConfigSet,\n SessionPluginConfigState,\n} from \"@blade-hq/agent-client/internal\"\nimport { Validator as JsonSchemaValidator, type Schema } from \"@cfworker/json-schema\"\nimport Form from \"@rjsf/core/lib/components/Form.js\"\nimport getDefaultRegistry from \"@rjsf/core/lib/getDefaultRegistry.js\"\nimport type {\n ArrayFieldItemTemplateProps,\n FieldProps,\n FieldTemplateProps,\n MultiSchemaFieldTemplateProps,\n RJSFSchema,\n ValidatorType,\n} from \"@rjsf/utils\"\nimport {\n createSchemaUtils,\n ROOT_SCHEMA_PREFIX,\n TranslatableString,\n withIdRefPrefix,\n} from \"@rjsf/utils\"\nimport { Plus, Trash2 } from \"lucide-react\"\nimport { isValidElement, useMemo, useState } from \"react\"\nimport {\n type ConfigValues,\n configDraftOperations,\n createConfigDraft,\n originalConfigPath,\n} from \"./plugin-config-draft\"\nimport { formSupport, pointerOf } from \"./plugin-config-schema\"\n\nexport interface SessionPluginConfigDraft {\n set: SessionPluginConfigSet[]\n remove: string[]\n}\nexport interface SessionPluginConfigFormProps {\n collapseHelp?: boolean\n config: SessionPluginConfigState\n submitting: boolean\n errors: SessionPluginConfigError[]\n failure: string | null\n onSubmit: (draft: SessionPluginConfigDraft) => void\n onCancel: () => void\n submitLabel?: string\n submittingLabel?: string\n}\n\ninterface ConfigFormContext {\n collapseHelp?: boolean\n initial: ConfigValues\n values: ConfigValues\n changeRoot: (values: ConfigValues) => void\n retained: Map<string, string>\n removed: Set<string>\n errors: SessionPluginConfigError[]\n}\nconst defaults = getDefaultRegistry<unknown, RJSFSchema, ConfigFormContext>()\n// RJSF needs validation to select branches. Interpret schemas so extension CSP never needs eval.\n// Form submission deliberately uses server validation: required secrets are redacted in formData.\nconst validator: ValidatorType<unknown, RJSFSchema, ConfigFormContext> = {\n isValid(schema, data, rootSchema) {\n try {\n const candidate = new JsonSchemaValidator(withIdRefPrefix(schema) as Schema, \"2020-12\")\n candidate.addSchema(structuredClone(rootSchema) as Schema, ROOT_SCHEMA_PREFIX)\n return candidate.validate(data === undefined ? undefined : JSON.parse(JSON.stringify(data))).valid\n } catch {\n return false\n }\n },\n validateFormData() {\n throw new Error(\"插件配置必须由服务端校验\")\n },\n rawValidation() {\n throw new Error(\"插件配置必须由服务端校验\")\n },\n}\n\nfunction presentationSchema(schema: RJSFSchema): RJSFSchema {\n const { default: _default, ...withoutDefault } = schema\n let result = withoutDefault\n if (result.properties)\n result.properties = Object.fromEntries(\n Object.entries(result.properties).map(([key, child]) => [\n key,\n typeof child === \"boolean\" ? child : presentationSchema(child),\n ]),\n )\n if (result.items && !Array.isArray(result.items) && typeof result.items !== \"boolean\")\n result.items = presentationSchema(result.items)\n if (result.allOf) {\n result.allOf = result.allOf.map((branch) =>\n typeof branch === \"boolean\" ? branch : presentationSchema(branch),\n )\n result = createSchemaUtils(validator, result).retrieveSchema(result)\n }\n for (const keyword of [\"oneOf\", \"anyOf\"] as const) {\n const branches = result[keyword]\n if (!branches) continue\n result[keyword] = branches.map((branch) =>\n typeof branch === \"boolean\" ? branch : presentationSchema(branch),\n )\n if (result.properties) {\n const common = { type: \"object\" as const, properties: result.properties }\n const utils = createSchemaUtils(validator, result)\n result[keyword] = result[keyword]!.map((branch) =>\n typeof branch === \"boolean\"\n ? branch\n : utils.retrieveSchema({ title: branch.title, allOf: [common, branch] }),\n )\n const { properties: _properties, ...withoutProperties } = result\n result = withoutProperties\n }\n }\n return result\n}\n\nfunction ConfigMultiSchemaField(props: MultiSchemaFieldTemplateProps<unknown, RJSFSchema, ConfigFormContext>) {\n return (\n <div className=\"rjsf-field\">\n <label htmlFor={isValidElement<{ id?: string }>(props.selector) ? props.selector.props.id : undefined}>\n 配置方式\n </label>\n {props.selector}\n {props.optionSchemaField}\n </div>\n )\n}\n\nfunction ConfigSchemaField(inputProps: FieldProps<unknown, RJSFSchema, ConfigFormContext>) {\n const path =\n inputProps.name === \"\" && inputProps.onKeyRename\n ? [...inputProps.fieldPathId.path, \"\"]\n : inputProps.fieldPathId.path\n const props = {\n ...inputProps,\n fieldPathId: {\n ...inputProps.fieldPathId,\n path,\n $id: `plugin-config-${path.map((part) => `${String(part).length}:${part}`).join(\"-\")}`,\n },\n onChange: ((value, changedPath, ...rest) => {\n if (changedPath.length === 1 && changedPath[0] === \"\")\n inputProps.registry.formContext.changeRoot({\n ...inputProps.registry.formContext.values,\n \"\": value,\n })\n else inputProps.onChange(value, changedPath, ...rest)\n }) as typeof inputProps.onChange,\n }\n const { schema, registry, fieldPathId, formData, onChange, disabled, readonly } = props\n const context = registry.formContext\n const pointer = pointerOf(originalConfigPath(fieldPathId.path, context.removed))\n const originalMarker = [...context.retained].find(([, path]) => path === pointer)?.[0]\n if (schema.const !== undefined && schema.writeOnly !== true)\n return (\n <>\n {context.errors\n .filter((error) => error.path === pointer)\n .map((error) => (\n <p role=\"alert\" key={error.message}>\n {error.message}\n </p>\n ))}\n </>\n )\n if (schema.writeOnly === true) {\n const kept = typeof formData === \"string\" && context.retained.has(formData)\n return (\n <div className=\"rjsf-field\">\n {Array.isArray(schema.type) && schema.type.includes(\"null\") ? (\n <label>\n <input\n type=\"checkbox\"\n checked={formData === null}\n disabled={disabled || readonly}\n onChange={(event) =>\n onChange(event.target.checked ? null : undefined, fieldPathId.path)\n }\n />\n {schema.title ?? props.name}:置为空值\n </label>\n ) : null}\n <label htmlFor={fieldPathId.$id} data-required={props.required}>\n {schema.title ?? props.name}\n </label>\n <input\n id={fieldPathId.$id}\n type=\"password\"\n autoComplete=\"new-password\"\n aria-required={props.required ?? false}\n disabled={disabled || readonly || formData === null}\n value={kept ? \"\" : String(formData ?? \"\")}\n placeholder={kept ? \"已填写,留空保持不变\" : \"尚未填写\"}\n onChange={(event) => onChange(event.target.value || originalMarker, fieldPathId.path)}\n />\n {kept ? <p>已保存,留空保持不变</p> : null}\n {formData !== undefined ? (\n <button\n type=\"button\"\n disabled={disabled || readonly}\n onClick={() => onChange(undefined, fieldPathId.path)}\n >\n 清除已保存的值\n </button>\n ) : null}\n {schema.description ? context.collapseHelp ? <details><summary>如何获取</summary><p>{schema.description}</p></details> : <p>{schema.description}</p> : null}\n {context.errors\n .filter((error) => error.path === pointer)\n .map((error) => (\n <p role=\"alert\" key={error.message}>\n {error.message}\n </p>\n ))}\n </div>\n )\n }\n const types = Array.isArray(schema.type) ? schema.type : [schema.type]\n if (types.includes(\"null\")) {\n const nonNull = types.filter((type) => type !== \"null\")\n const inner = { ...schema, type: nonNull[0] } as RJSFSchema\n return (\n <div className=\"rjsf-field\">\n <label>\n <input\n type=\"checkbox\"\n checked={formData === null}\n disabled={disabled || readonly}\n onChange={(event) =>\n onChange(\n event.target.checked\n ? null\n : nonNull[0] === \"object\"\n ? {}\n : nonNull[0] === \"array\"\n ? []\n : undefined,\n fieldPathId.path,\n )\n }\n />\n {schema.title ?? props.name}:置为空值\n </label>\n {nonNull.length && formData !== null ? (\n <defaults.fields.SchemaField {...props} schema={inner} />\n ) : null}\n </div>\n )\n }\n return <defaults.fields.SchemaField {...props} />\n}\n\nfunction ConfigFieldTemplate(props: FieldTemplateProps<unknown, RJSFSchema, ConfigFormContext>) {\n const pointer = pointerOf(\n originalConfigPath(props.fieldPathId.path, props.registry.formContext.removed),\n )\n return (\n <div className={props.classNames} hidden={props.hidden}>\n {props.displayLabel ? (\n <label htmlFor={props.id} data-required={props.required}>\n {props.label}\n </label>\n ) : null}\n {props.displayLabel && props.description ? props.registry.formContext.collapseHelp ? <details><summary>如何获取</summary>{props.description}</details> : props.description : null}\n {props.children}\n {props.help}\n {props.registry.formContext.errors\n .filter((error) => error.path === pointer)\n .map((error) => (\n <p role=\"alert\" key={error.message}>\n {error.message}\n </p>\n ))}\n </div>\n )\n}\n\nfunction ConfigArrayItem(\n props: ArrayFieldItemTemplateProps<unknown, RJSFSchema, ConfigFormContext>,\n) {\n const { buttonsProps: buttons, registry } = props\n return (\n <div className=\"rjsf-array-item\">\n {props.children}\n {buttons.hasRemove ? (\n <button\n type=\"button\"\n title=\"删除\"\n aria-label=\"删除\"\n disabled={buttons.disabled || buttons.readonly}\n onClick={(event) => {\n const path = originalConfigPath(buttons.fieldPathId.path, registry.formContext.removed)\n let previous: unknown = registry.formContext.initial\n for (const part of path)\n previous =\n previous && typeof previous === \"object\"\n ? (previous as ConfigValues)[part]\n : undefined\n if (previous !== undefined) registry.formContext.removed.add(pointerOf(path))\n buttons.onRemoveItem(event)\n }}\n >\n <Trash2 size={14} />\n </button>\n ) : null}\n </div>\n )\n}\n\nexport function SessionPluginConfigForm({\n config,\n submitting,\n errors,\n failure,\n onSubmit,\n onCancel,\n submitLabel = \"保存\",\n submittingLabel = \"保存中…\",\n collapseHelp = false,\n}: SessionPluginConfigFormProps) {\n const [initial] = useState(() => createConfigDraft(config))\n const [values, setValues] = useState(initial.values)\n const [removed] = useState(() => new Set<string>())\n const [draftFailure, setDraftFailure] = useState<string | null>(null)\n const support = useMemo(() => formSupport(config.schema), [config.schema])\n const schema = useMemo(() => {\n try {\n return config.schema ? presentationSchema(config.schema as RJSFSchema) : null\n } catch {\n return null\n }\n }, [config.schema])\n const context = {\n collapseHelp,\n retained: initial.retained,\n removed,\n errors,\n initial: initial.values,\n values,\n changeRoot: setValues,\n }\n if (!schema || support)\n return (\n <div className=\"space-y-3 text-xs\">\n <p>{support ?? \"配置声明的组合无法呈现,请联系插件提供方\"}</p>\n <button type=\"button\" onClick={onCancel}>\n 关闭\n </button>\n </div>\n )\n return (\n <div className=\"blade-plugin-config text-xs\">\n <style>{`\n .blade-plugin-config .rjsf-field, .blade-plugin-config fieldset { min-width:0; margin:0 0 10px; padding:0; border:0 }\n .blade-plugin-config label, .blade-plugin-config legend { display:block; font-size:12px; font-weight:500; overflow-wrap:anywhere; margin-bottom:4px }\n .blade-plugin-config label[data-required=true]::after { content:' *'; color:hsl(var(--destructive)) }\n .blade-plugin-config input:not([type=checkbox]):not([type=radio]), .blade-plugin-config select { box-sizing:border-box; width:100%; min-width:0; padding:6px 8px; border:1px solid hsl(var(--border)); border-radius:6px; background:hsl(var(--background)); color:inherit }\n .blade-plugin-config input[type=checkbox] { margin-right:6px }\n .blade-plugin-config p { overflow-wrap:anywhere; margin:4px 0; color:hsl(var(--muted-foreground)) }\n .blade-plugin-config [role=alert] { color:hsl(var(--destructive)) }\n .blade-plugin-config .rjsf-array-item { border-left:2px solid hsl(var(--border)); padding-left:10px; margin-bottom:10px }\n .blade-plugin-config button { padding:5px 8px; border:1px solid hsl(var(--border)); border-radius:6px }\n .blade-plugin-config button:disabled { opacity:.5 }\n .blade-plugin-config .control-label { display:block }\n `}</style>\n {failure || draftFailure ? <p role=\"alert\">{failure ?? draftFailure}</p> : null}\n <Form<unknown, RJSFSchema, ConfigFormContext>\n schema={schema!}\n validator={validator}\n formData={values}\n formContext={context}\n fields={{ SchemaField: ConfigSchemaField }}\n templates={{\n FieldTemplate: ConfigFieldTemplate,\n ArrayFieldItemTemplate: ConfigArrayItem,\n MultiSchemaFieldTemplate: ConfigMultiSchemaField,\n ButtonTemplates: {\n ...defaults.templates.ButtonTemplates,\n AddButton: (props) => (\n <button\n type=\"button\"\n title=\"添加一项\"\n aria-label=\"添加一项\"\n disabled={props.disabled}\n onClick={props.onClick}\n >\n <Plus size={14} />\n </button>\n ),\n },\n }}\n uiSchema={{\n \"ui:globalOptions\": { orderable: false, copyable: false, addable: true },\n \"ui:submitButtonOptions\": { norender: true },\n }}\n experimental_defaultFormStateBehavior={{\n emptyObjectFields: \"populateAllDefaults\",\n arrayMinItems: { populate: \"never\" },\n constAsDefaults: \"always\",\n allOf: \"populateDefaults\",\n }}\n disabled={submitting}\n noHtml5Validate\n noValidate\n showErrorList={false}\n translateString={(key, params = []) => {\n if (\n key === TranslatableString.OptionPrefix ||\n key === TranslatableString.TitleOptionPrefix\n )\n return `方式 ${params.at(-1)}`\n if (key === TranslatableString.ArrayItemTitle) return \"项目\"\n if (key === TranslatableString.EmptyArray) return \"暂无项目\"\n return defaults.translateString(key, params)\n }}\n onChange={(event) => setValues((event.formData ?? {}) as ConfigValues)}\n onSubmit={(event) => {\n try {\n onSubmit(\n configDraftOperations(\n initial.values,\n (event.formData ?? {}) as ConfigValues,\n initial.retained,\n removed,\n ),\n )\n } catch (error) {\n setDraftFailure((error as Error).message)\n }\n }}\n >\n <div className=\"flex justify-end gap-2\">\n <button type=\"button\" onClick={onCancel}>\n 取消\n </button>\n <button type=\"submit\" disabled={submitting}>\n {submitting ? submittingLabel : submitLabel}\n </button>\n </div>\n </Form>\n </div>\n )\n}\n","import type { SessionPluginConfigState } from \"@blade-hq/agent-client/internal\"\n\nexport type JsonSchema = Record<string, unknown>\n\nfunction asSchema(value: unknown): JsonSchema | null {\n return value && typeof value === \"object\" && !Array.isArray(value) ? (value as JsonSchema) : null\n}\n\nexport function pointerOf(parts: (string | number)[]): string {\n if (!parts.length) return \"/\"\n return parts.map((part) => `/${String(part).replace(/~/g, \"~0\").replace(/\\//g, \"~1\")}`).join(\"\")\n}\n\nexport function pointerParts(pointer: string): string[] {\n return pointer === \"\"\n ? []\n : pointer\n .slice(1)\n .split(\"/\")\n .map((part) => part.replace(/~1/g, \"/\").replace(/~0/g, \"~\"))\n}\n\nfunction resolveNode(root: JsonSchema, node: JsonSchema): JsonSchema | null {\n let current = node\n for (let depth = 0; depth < 16; depth++) {\n if (typeof current.$ref !== \"string\") return current\n if (!current.$ref.startsWith(\"#/\")) return null\n let target: unknown = root\n for (const part of pointerParts(current.$ref.slice(1))) {\n if (!target || typeof target !== \"object\" || !Object.hasOwn(target, part)) return null\n target = (target as JsonSchema)[part]\n }\n const resolved = asSchema(target)\n if (!resolved) return null\n const { $ref: _, ...siblings } = current\n if (\n Object.entries(siblings).some(\n ([key, value]) =>\n key in resolved && JSON.stringify(resolved[key]) !== JSON.stringify(value),\n )\n )\n return null\n current = Object.keys(siblings).length ? { ...resolved, ...siblings } : resolved\n }\n return null\n}\n\nfunction nodeTypes(node: JsonSchema): string[] {\n if (typeof node.type === \"string\") return [node.type]\n if (Array.isArray(node.type))\n return node.type.filter((item): item is string => typeof item === \"string\")\n if (node.properties) return [\"object\"]\n if (node.items) return [\"array\"]\n return []\n}\n\nconst UNSUPPORTED_KEYWORDS = [\n \"not\",\n \"if\",\n \"then\",\n \"else\",\n \"patternProperties\",\n \"dependentSchemas\",\n \"propertyNames\",\n \"unevaluatedProperties\",\n \"unevaluatedItems\",\n \"$dynamicRef\",\n \"$dynamicAnchor\",\n \"contains\",\n \"minContains\",\n \"maxContains\",\n \"prefixItems\",\n] as const\n\nfunction unsupportedReason(\n root: JsonSchema,\n node: JsonSchema,\n path: string[] = [],\n ancestors = new Set<JsonSchema>(),\n): string | null {\n const pointer = pointerOf(path)\n const resolved = resolveNode(root, node)\n if (!resolved) return `${pointer} 使用了表单无法解析的引用`\n if (ancestors.has(resolved) || ancestors.size >= 64)\n return `${pointer} 使用了递归或过深声明,无法呈现有限表单`\n const visited = new Set(ancestors).add(resolved)\n for (const keyword of UNSUPPORTED_KEYWORDS) {\n if (keyword in resolved) return `${pointer} 使用了平台暂不支持在表单里呈现的写法:${keyword}`\n }\n if (asSchema(resolved.additionalProperties))\n return `${pointer} 使用了 additionalProperties 声明,表单无法确定字段集合`\n const types = nodeTypes(resolved).filter((type) => type !== \"null\")\n if (types.length > 1) return `${pointer} 使用了表单暂不支持的类型组合,请使用 oneOf 表达可选类型`\n if (resolved.writeOnly === true && types.length && !types.includes(\"string\"))\n return `${pointer} 的秘密字段暂只支持文本类型`\n for (const [name, child] of Object.entries(asSchema(resolved.properties) ?? {})) {\n const childSchema = asSchema(child)\n if (!childSchema) return `${pointerOf([...path, name])} 使用了表单暂不支持的布尔声明`\n const reason = unsupportedReason(root, childSchema, [...path, name], visited)\n if (reason) return reason\n }\n for (const keyword of [\"oneOf\", \"anyOf\", \"allOf\"] as const) {\n if (!Array.isArray(resolved[keyword])) continue\n for (const [index, branch] of resolved[keyword].entries()) {\n const branchSchema = asSchema(branch)\n if (!branchSchema) return `${pointer}/${keyword}/${index} 使用了表单暂不支持的布尔声明`\n const reason = unsupportedReason(root, branchSchema, path, visited)\n if (reason) return reason\n }\n }\n const items = asSchema(resolved.items)\n if (types.includes(\"array\") && !items) return `${pointer}/items 缺少可呈现的项目声明`\n return items ? unsupportedReason(root, items, [...path, \"[]\"], visited) : null\n}\n\nexport function formSupport(schema: JsonSchema | null): string | null {\n if (!schema) return \"插件没有返回配置声明\"\n if (!nodeTypes(schema).includes(\"object\")) return \"配置声明的根节点必须是对象\"\n return unsupportedReason(schema, schema)\n}\n\nexport function configIsEditable(state: SessionPluginConfigState): boolean {\n return state.state !== \"not_required\" && state.state !== \"error\" && !formSupport(state.schema)\n}\n","import type { SessionPluginConfigSet, SessionPluginConfigState } from \"@blade-hq/agent-client/internal\"\nimport { pointerOf, pointerParts } from \"./plugin-config-schema\"\n\nexport type ConfigPath = (string | number)[]\nexport type ConfigValues = Record<string, unknown>\n\nexport function createConfigDraft(config: SessionPluginConfigState) {\n const values = structuredClone(config.values) as ConfigValues\n const retained = new Map<string, string>()\n for (const pointer of config.write_only) {\n const marker = `blade-retained-${crypto.getRandomValues(new Uint32Array(4)).join(\"-\")}`\n retained.set(marker, pointer)\n const parts = pointerParts(pointer)\n let target = values\n for (const part of parts.slice(0, -1)) {\n if (!Object.hasOwn(target, part))\n Object.defineProperty(target, part, {\n value: {},\n enumerable: true,\n writable: true,\n configurable: true,\n })\n target = target[part] as ConfigValues\n }\n Object.defineProperty(target, parts.at(-1)!, {\n value: marker,\n enumerable: true,\n writable: true,\n configurable: true,\n })\n }\n return { values, retained }\n}\n\n/** Array edits address the original indices because the API applies sets before removals. */\nexport function originalConfigPath(path: ConfigPath, removed: Set<string>): ConfigPath {\n const original: ConfigPath = []\n for (const part of path) {\n if (typeof part !== \"number\") {\n original.push(part)\n continue\n }\n let index = 0\n let remaining = part\n while (remaining > 0 || removed.has(pointerOf([...original, index]))) {\n if (!removed.has(pointerOf([...original, index]))) remaining--\n index++\n }\n original.push(index)\n }\n return original\n}\n\nexport function configDraftOperations(\n initial: ConfigValues,\n values: ConfigValues,\n retained: Map<string, string>,\n removed: Set<string>,\n): { set: SessionPluginConfigSet[]; remove: string[] } {\n const set: SessionPluginConfigSet[] = []\n const remove = new Set(removed)\n const visit = (before: unknown, after: unknown, path: ConfigPath) => {\n const pointer = pointerOf(path)\n if (typeof after === \"string\" && retained.has(after)) {\n if (retained.get(after) !== pointer) throw new Error(\"保留字段的位置发生变化,请重新打开配置\")\n return\n }\n if (after === undefined) {\n if (before !== undefined) remove.add(pointer)\n return\n }\n if (Array.isArray(after)) {\n const previous = Array.isArray(before) ? before : []\n if (!after.length && !previous.length) {\n if (!Array.isArray(before)) set.push({ path: pointer, value: [] })\n return\n }\n let originalIndex = 0\n for (const item of after) {\n while (removed.has(pointerOf([...path, originalIndex]))) originalIndex++\n visit(previous[originalIndex], item, [...path, originalIndex++])\n }\n for (; originalIndex < previous.length; originalIndex++)\n remove.add(pointerOf([...path, originalIndex]))\n return\n }\n if (after !== null && typeof after === \"object\") {\n const previous =\n before !== null && typeof before === \"object\" && !Array.isArray(before)\n ? (before as ConfigValues)\n : {}\n const next = after as ConfigValues\n const keys = new Set([...Object.keys(previous), ...Object.keys(next)])\n if (\n Object.values(next).every((value) => value === undefined) &&\n path.length &&\n (before === null || typeof before !== \"object\" || Array.isArray(before))\n )\n set.push({ path: pointer, value: {} })\n for (const key of keys) visit(previous[key], next[key], [...path, key])\n return\n }\n if (!Object.is(before, after)) set.push({ path: pointer, value: after })\n }\n visit(initial, values, [])\n const removals = [...remove].sort((a, b) => {\n const left = pointerParts(a)\n const right = pointerParts(b)\n if (left.length !== right.length) return right.length - left.length\n return b.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,oBAAC,YAAO,MAAK,UAAS,UAAU,YAC7B,uBAAa,kBAAkB,aAClC;AAAA,WACF;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;","names":["j","uri","e","p","Fragment","p","r","e","OutputFormat","uri","keys","regex","keywordLocation","j","e","sameValueEqual","areArraysEqual","areDatesEqual","areMapsEqual","areObjectsEqual","areRegExpsEqual","areSetsEqual","areErrorsEqual","areArrayBuffersEqual","areDataViewsEqual","arePrimitiveWrappersEqual","areTypedArraysEqual","areUrlsEqual","UriResolver","jsonpointer","validator","d","j","l","compareSchemaDefinitions","compareSchemaValues","l","r","j","keys","p","check","mergeArrayOfSchemaDefinitions","assigners","checks","intersection","mergeArrayOfSchemaDefinitions","validator","e","validator","validator","validator","isRequired","validator","defaults","validator","validator","AdditionalItemsHandling","validator","defaults","keys","validator","validator","fields","validator","p","validator","keys","validator","validator","index","format","format","format","date","time","format","templates","ReactIs","e","date","e","_jsx","props","state","time","SelectWidget","_jsx","time","useCallback","useMemo","useMemo","useCallback","date","TranslatableString","useCallback","useMemo","useRef","useState","e","widgets","_jsx","SchemaField","useMemo","ArrayFieldItemTemplate","useCallback","fields","OptionalDataControlsField","useState","useRef","newKeyedFormData","useCallback","widgets","o","useCallback","_jsx","useState","useState","CyclicSchemaExpandTemplate","_jsx","fields","SchemaField","useMemo","useState","fields","useState","useMemo","_jsx","FallbackFieldTemplate","SchemaField","GridType","Operators","isRequired","_jsx","GridTemplate","fields","SchemaField","LayoutMultiSchemaField","_jsx","useState","useEffect","widgets","useState","FieldErrorTemplate","FieldTemplate","useEffect","_jsx","useCallback","useEffect","useMemo","useRef","useState","useMemo","useState","useRef","useEffect","useCallback","option","widgets","fields","MultiSchemaFieldTemplate","_jsx","useEffect","useState","useCallback","useState","StringField","useCallback","_jsx","memo","useCallback","useMemo","useRef","useState","B","j","j","B","useState","fields","SchemaField","useCallback","_jsx","memo","OptionalDataControlsField","useRef","useMemo","OptionalDataControlsTemplate","_jsx","useCallback","memo","fields","CyclicSchemaField","useCallback","id","_jsx","FieldTemplate","FieldHelpTemplate","FieldErrorTemplate","_jsxs","memo","useCallback","format","widgets","useCallback","_jsx","_jsx","CopyButton","MoveDownButton","MoveUpButton","RemoveButton","_jsxs","_Fragment","_jsx","ArrayFieldItemButtonsTemplate","_jsxs","_jsx","ArrayFieldDescriptionTemplate","ArrayFieldTitleTemplate","AddButton","_jsxs","_jsx","_jsx","useCallback","_jsx","ClearButton","useCallback","e","_jsxs","_Fragment","_jsx","memo","_jsx","memo","_jsx","_jsx","buttonId","_jsxs","_jsx","_jsx","_jsx","_jsxs","_jsx","MultiSchemaFieldTemplate","_jsx","_jsx","TEST_IDS","_jsx","_jsx","_jsxs","_jsx","WrapIfAdditionalTemplate","_jsx","_jsxs","_jsx","_jsxs","_jsx","AddButton","_jsxs","_jsx","_jsx","REQUIRED_FIELD_SYMBOL","_jsxs","_jsx","_jsxs","_jsx","templates","RemoveButton","_jsx","_jsxs","time","AltDateWidget","_jsx","_jsxs","_jsx","useCallback","useCallback","_jsx","_jsxs","useCallback","useCallback","_jsxs","_jsx","BaseInputTemplate","_jsx","BaseInputTemplate","_jsx","useCallback","BaseInputTemplate","useCallback","_jsx","BaseInputTemplate","_jsx","_jsx","_jsxs","_Fragment","RemoveButton","BaseInputTemplate","_jsx","BaseInputTemplate","_jsx","useCallback","useCallback","_jsx","_jsxs","BaseInputTemplate","_jsxs","_jsx","useCallback","_jsxs","_jsx","e","useCallback","o","useCallback","_jsxs","_Fragment","_jsx","useCallback","useCallback","_jsx","BaseInputTemplate","_jsx","useCallback","BaseInputTemplate","useCallback","_jsx","BaseInputTemplate","_jsx","BaseInputTemplate","_jsx","validator","_jsx","fields","omitExtraData","templates","widgets","SubmitButton","_jsxs","useMemo","useState","keys","Fragment","path","useState","useMemo"]}