@opra/common 0.5.0 → 0.7.0
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.
- package/cjs/constants.js +1 -0
- package/cjs/exception/enums/issue-severity.enum.js +23 -0
- package/cjs/{types.js → exception/error-issue.js} +0 -0
- package/cjs/exception/http-errors/bad-request.error.js +22 -0
- package/cjs/exception/http-errors/failed-dependency.error.js +21 -0
- package/cjs/exception/http-errors/forbidden.error.js +23 -0
- package/cjs/exception/http-errors/internal-server.error.js +21 -0
- package/cjs/exception/http-errors/method-not-allowed.error.js +22 -0
- package/cjs/exception/http-errors/not-acceptable.error.js +22 -0
- package/cjs/exception/http-errors/not-found.error.js +25 -0
- package/cjs/exception/http-errors/unauthorized.error.js +22 -0
- package/cjs/exception/http-errors/unprocessable-entity.error.js +21 -0
- package/cjs/exception/index.js +18 -0
- package/cjs/exception/opra-exception.js +56 -0
- package/cjs/exception/resource-errors/resource-conflict.error.js +20 -0
- package/cjs/exception/resource-errors/resource-not-found.error.js +20 -0
- package/cjs/exception/wrap-exception.js +42 -0
- package/cjs/filter/antlr/OpraFilterLexer.js +386 -0
- package/cjs/filter/antlr/OpraFilterParser.js +2070 -0
- package/cjs/filter/antlr/OpraFilterVisitor.js +3 -0
- package/cjs/filter/ast/abstract/ast.js +10 -0
- package/cjs/filter/ast/abstract/expression.js +7 -0
- package/cjs/filter/ast/abstract/literal.js +14 -0
- package/cjs/filter/ast/abstract/term.js +7 -0
- package/cjs/filter/ast/expressions/arithmetic-expression.js +29 -0
- package/cjs/filter/ast/expressions/array-expression.js +15 -0
- package/cjs/filter/ast/expressions/comparison-expression.js +18 -0
- package/cjs/filter/ast/expressions/logical-expression.js +18 -0
- package/cjs/filter/ast/expressions/parentheses-expression.js +15 -0
- package/cjs/filter/ast/index.js +19 -0
- package/cjs/filter/ast/terms/boolean-literal.js +10 -0
- package/cjs/filter/ast/terms/date-literal.js +28 -0
- package/cjs/filter/ast/terms/external-constant.js +13 -0
- package/cjs/filter/ast/terms/null-literal.js +11 -0
- package/cjs/filter/ast/terms/number-literal.js +40 -0
- package/cjs/filter/ast/terms/qualified-identifier.js +10 -0
- package/cjs/filter/ast/terms/string-literal.js +14 -0
- package/cjs/filter/ast/terms/time-literal.js +33 -0
- package/cjs/filter/build.js +129 -0
- package/cjs/filter/error-listener.js +14 -0
- package/cjs/filter/errors.js +21 -0
- package/cjs/filter/filter-tree-visitor.js +113 -0
- package/cjs/filter/index.js +8 -0
- package/cjs/filter/parse.js +37 -0
- package/cjs/filter/utils.js +26 -0
- package/cjs/helpers/index.js +4 -0
- package/cjs/{classes → helpers}/responsive-map.js +1 -1
- package/cjs/{enums → http/enums}/http-headers.enum.js +9 -0
- package/cjs/{enums → http/enums}/http-status.enum.js +0 -0
- package/cjs/http/http-request.js +118 -0
- package/cjs/http/index.js +9 -0
- package/cjs/http/interfaces/client-http-headers.interface.js +2 -0
- package/cjs/http/interfaces/server-http-headers.interface.js +2 -0
- package/cjs/http/multipart/batch-multipart.js +155 -0
- package/cjs/http/multipart/http-request-content.js +16 -0
- package/cjs/http/multipart/http-response-content.js +14 -0
- package/cjs/http/multipart/index.js +4 -0
- package/cjs/http/utils/normalize-headers.js +28 -0
- package/cjs/i18n/i18n.js +175 -0
- package/cjs/i18n/index.js +10 -0
- package/cjs/i18n/string-utils.js +13 -0
- package/cjs/i18n/translate.js +15 -0
- package/cjs/index.js +12 -5
- package/cjs/schema/constants.js +11 -0
- package/cjs/schema/decorators/opr-collection-resource.decorator.js +23 -0
- package/cjs/schema/decorators/opr-complex-type.decorator.js +27 -0
- package/cjs/schema/decorators/opr-field.decorator.js +28 -0
- package/cjs/schema/decorators/opr-resolver.decorator.js +81 -0
- package/cjs/schema/decorators/opr-simple-type.decorator.js +18 -0
- package/cjs/schema/decorators/opr-singleton-resource.decorator.js +23 -0
- package/cjs/schema/implementation/data-type/builtin/any.type.js +9 -0
- package/cjs/schema/implementation/data-type/builtin/base64-binary.type.js +15 -0
- package/cjs/schema/implementation/data-type/builtin/bigint.type.js +15 -0
- package/cjs/schema/implementation/data-type/builtin/boolean.type.js +15 -0
- package/cjs/schema/implementation/data-type/builtin/date-string.type.js +15 -0
- package/cjs/schema/implementation/data-type/builtin/date.type.js +15 -0
- package/cjs/schema/implementation/data-type/builtin/guid.type.js +15 -0
- package/cjs/schema/implementation/data-type/builtin/integer.type.js +15 -0
- package/cjs/schema/implementation/data-type/builtin/number.type.js +15 -0
- package/cjs/schema/implementation/data-type/builtin/object.type.js +15 -0
- package/cjs/schema/implementation/data-type/builtin/string.type.js +15 -0
- package/cjs/schema/implementation/data-type/builtin-data-types.js +37 -0
- package/cjs/schema/implementation/data-type/complex-type.js +111 -0
- package/cjs/schema/implementation/data-type/data-type.js +36 -0
- package/cjs/schema/implementation/data-type/simple-type.js +21 -0
- package/cjs/schema/implementation/data-type/union-type.js +25 -0
- package/cjs/schema/implementation/document-builder.js +140 -0
- package/cjs/schema/implementation/opra-document.js +181 -0
- package/cjs/schema/implementation/query/collection-count-query.js +19 -0
- package/cjs/schema/implementation/query/collection-create-query.js +28 -0
- package/cjs/schema/implementation/query/collection-delete-many-query.js +19 -0
- package/cjs/schema/implementation/query/collection-delete-query.js +27 -0
- package/cjs/schema/implementation/query/collection-get-query.js +38 -0
- package/cjs/schema/implementation/query/collection-search-query.js +55 -0
- package/cjs/schema/implementation/query/collection-update-many-query.js +21 -0
- package/cjs/schema/implementation/query/collection-update-query.js +39 -0
- package/cjs/schema/implementation/query/field-get-query.js +45 -0
- package/cjs/schema/implementation/query/index.js +22 -0
- package/cjs/schema/implementation/query/singleton-get-query.js +27 -0
- package/cjs/schema/implementation/resource/collection-resource-info.js +58 -0
- package/cjs/schema/implementation/resource/container-resource-info.js +30 -0
- package/cjs/schema/implementation/resource/resource-info.js +39 -0
- package/cjs/schema/implementation/resource/singleton-resource-info.js +37 -0
- package/cjs/schema/implementation/schema-builder/extract-resource-metadata.util.js +84 -0
- package/cjs/schema/implementation/schema-builder/extract-type-metadata.util.js +94 -0
- package/cjs/schema/index.js +28 -0
- package/cjs/schema/interfaces/child-field-query.interface.js +2 -0
- package/cjs/schema/interfaces/data-type.metadata.js +2 -0
- package/cjs/schema/interfaces/resource-container.interface.js +2 -0
- package/cjs/schema/interfaces/resource.metadata.js +2 -0
- package/cjs/schema/opra-schema.definition.js +49 -0
- package/cjs/schema/type-helpers/extend-type.helper.js +65 -0
- package/cjs/schema/type-helpers/mixin-type.helper.js +46 -0
- package/cjs/schema/type-helpers/mixin.utils.js +32 -0
- package/cjs/schema/types.js +2 -0
- package/cjs/schema/utils/class.utils.js +8 -0
- package/cjs/schema/utils/clone-object.util.js +19 -0
- package/cjs/schema/utils/inspect.util.js +7 -0
- package/cjs/schema/utils/normalize-field-array.util.js +44 -0
- package/cjs/schema/utils/path-to-tree.util.js +26 -0
- package/cjs/schema/utils/string-compare.util.js +11 -0
- package/cjs/url/formats/boolean-format.js +25 -0
- package/cjs/url/formats/date-format.js +48 -0
- package/cjs/url/formats/filter-format.js +18 -0
- package/cjs/url/formats/format.js +6 -0
- package/cjs/url/formats/integer-format.js +20 -0
- package/cjs/url/formats/number-format.js +28 -0
- package/cjs/url/formats/string-format.js +28 -0
- package/cjs/url/index.js +8 -0
- package/cjs/url/opra-url-path-component.js +33 -0
- package/cjs/url/opra-url-path.js +128 -0
- package/cjs/url/opra-url-search-params.js +247 -0
- package/cjs/url/opra-url.js +299 -0
- package/cjs/url/utils/path-utils.js +86 -0
- package/cjs/utils/index.js +6 -0
- package/cjs/utils/is-url.js +8 -0
- package/cjs/utils/path-to-tree.js +28 -0
- package/cjs/utils/type-guards.js +46 -0
- package/esm/constants.d.ts +0 -0
- package/esm/constants.js +1 -0
- package/esm/exception/enums/issue-severity.enum.d.ts +13 -0
- package/esm/exception/enums/issue-severity.enum.js +20 -0
- package/esm/exception/error-issue.d.ts +9 -0
- package/esm/{types.js → exception/error-issue.js} +0 -0
- package/esm/exception/http-errors/bad-request.error.d.ts +10 -0
- package/esm/exception/http-errors/bad-request.error.js +18 -0
- package/esm/exception/http-errors/failed-dependency.error.d.ts +9 -0
- package/esm/exception/http-errors/failed-dependency.error.js +17 -0
- package/esm/exception/http-errors/forbidden.error.d.ts +11 -0
- package/esm/exception/http-errors/forbidden.error.js +19 -0
- package/esm/exception/http-errors/internal-server.error.d.ts +9 -0
- package/esm/exception/http-errors/internal-server.error.js +17 -0
- package/esm/exception/http-errors/method-not-allowed.error.d.ts +10 -0
- package/esm/exception/http-errors/method-not-allowed.error.js +18 -0
- package/esm/exception/http-errors/not-acceptable.error.d.ts +10 -0
- package/esm/exception/http-errors/not-acceptable.error.js +18 -0
- package/esm/exception/http-errors/not-found.error.d.ts +13 -0
- package/esm/exception/http-errors/not-found.error.js +21 -0
- package/esm/exception/http-errors/unauthorized.error.d.ts +10 -0
- package/esm/exception/http-errors/unauthorized.error.js +18 -0
- package/esm/exception/http-errors/unprocessable-entity.error.d.ts +9 -0
- package/esm/exception/http-errors/unprocessable-entity.error.js +17 -0
- package/esm/exception/index.d.ts +15 -0
- package/esm/exception/index.js +15 -0
- package/esm/exception/opra-exception.d.ts +15 -0
- package/esm/exception/opra-exception.js +52 -0
- package/esm/exception/resource-errors/resource-conflict.error.d.ts +5 -0
- package/esm/exception/resource-errors/resource-conflict.error.js +16 -0
- package/esm/exception/resource-errors/resource-not-found.error.d.ts +4 -0
- package/esm/exception/resource-errors/resource-not-found.error.js +16 -0
- package/esm/exception/wrap-exception.d.ts +2 -0
- package/esm/exception/wrap-exception.js +38 -0
- package/esm/filter/antlr/OpraFilterLexer.d.ts +78 -0
- package/esm/filter/antlr/OpraFilterLexer.js +381 -0
- package/esm/filter/antlr/OpraFilterParser.d.ts +365 -0
- package/esm/filter/antlr/OpraFilterParser.js +2022 -0
- package/esm/filter/antlr/OpraFilterVisitor.d.ts +290 -0
- package/esm/filter/antlr/OpraFilterVisitor.js +2 -0
- package/esm/filter/ast/abstract/ast.d.ts +5 -0
- package/esm/filter/ast/abstract/ast.js +6 -0
- package/esm/filter/ast/abstract/expression.d.ts +3 -0
- package/esm/filter/ast/abstract/expression.js +3 -0
- package/esm/filter/ast/abstract/literal.d.ts +6 -0
- package/esm/filter/ast/abstract/literal.js +10 -0
- package/esm/filter/ast/abstract/term.d.ts +3 -0
- package/esm/filter/ast/abstract/term.js +3 -0
- package/esm/filter/ast/expressions/arithmetic-expression.d.ts +13 -0
- package/esm/filter/ast/expressions/arithmetic-expression.js +24 -0
- package/esm/filter/ast/expressions/array-expression.d.ts +7 -0
- package/esm/filter/ast/expressions/array-expression.js +11 -0
- package/esm/filter/ast/expressions/comparison-expression.d.ts +10 -0
- package/esm/filter/ast/expressions/comparison-expression.js +14 -0
- package/esm/filter/ast/expressions/logical-expression.d.ts +8 -0
- package/esm/filter/ast/expressions/logical-expression.js +14 -0
- package/esm/filter/ast/expressions/parentheses-expression.d.ts +6 -0
- package/esm/filter/ast/expressions/parentheses-expression.js +11 -0
- package/esm/filter/ast/index.d.ts +16 -0
- package/esm/filter/ast/index.js +16 -0
- package/esm/filter/ast/terms/boolean-literal.d.ts +5 -0
- package/esm/filter/ast/terms/boolean-literal.js +6 -0
- package/esm/filter/ast/terms/date-literal.d.ts +6 -0
- package/esm/filter/ast/terms/date-literal.js +24 -0
- package/esm/filter/ast/terms/external-constant.d.ts +5 -0
- package/esm/filter/ast/terms/external-constant.js +9 -0
- package/esm/filter/ast/terms/null-literal.d.ts +5 -0
- package/esm/filter/ast/terms/null-literal.js +7 -0
- package/esm/filter/ast/terms/number-literal.d.ts +6 -0
- package/esm/filter/ast/terms/number-literal.js +36 -0
- package/esm/filter/ast/terms/qualified-identifier.d.ts +4 -0
- package/esm/filter/ast/terms/qualified-identifier.js +6 -0
- package/esm/filter/ast/terms/string-literal.d.ts +5 -0
- package/esm/filter/ast/terms/string-literal.js +10 -0
- package/esm/filter/ast/terms/time-literal.d.ts +6 -0
- package/esm/filter/ast/terms/time-literal.js +29 -0
- package/esm/filter/build.d.ts +31 -0
- package/esm/filter/build.js +105 -0
- package/esm/filter/error-listener.d.ts +8 -0
- package/esm/filter/error-listener.js +10 -0
- package/esm/filter/errors.d.ts +20 -0
- package/esm/filter/errors.js +15 -0
- package/esm/filter/filter-tree-visitor.d.ts +30 -0
- package/esm/filter/filter-tree-visitor.js +109 -0
- package/esm/filter/index.d.ts +5 -0
- package/esm/filter/index.js +5 -0
- package/esm/filter/parse.d.ts +2 -0
- package/esm/filter/parse.js +33 -0
- package/esm/filter/utils.d.ts +2 -0
- package/esm/filter/utils.js +21 -0
- package/esm/helpers/index.d.ts +1 -0
- package/esm/helpers/index.js +1 -0
- package/esm/{classes → helpers}/responsive-map.d.ts +0 -0
- package/esm/{classes → helpers}/responsive-map.js +1 -1
- package/esm/{enums → http/enums}/http-headers.enum.d.ts +9 -0
- package/esm/{enums → http/enums}/http-headers.enum.js +9 -0
- package/esm/{enums → http/enums}/http-status.enum.d.ts +0 -0
- package/esm/{enums → http/enums}/http-status.enum.js +0 -0
- package/esm/http/http-request.d.ts +34 -0
- package/esm/http/http-request.js +114 -0
- package/esm/http/index.d.ts +6 -0
- package/esm/http/index.js +6 -0
- package/esm/http/interfaces/client-http-headers.interface.d.ts +65 -0
- package/esm/http/interfaces/client-http-headers.interface.js +1 -0
- package/esm/http/interfaces/server-http-headers.interface.d.ts +1 -0
- package/esm/http/interfaces/server-http-headers.interface.js +1 -0
- package/esm/http/multipart/batch-multipart.d.ts +30 -0
- package/esm/http/multipart/batch-multipart.js +150 -0
- package/esm/http/multipart/http-request-content.d.ts +8 -0
- package/esm/http/multipart/http-request-content.js +12 -0
- package/esm/http/multipart/http-response-content.d.ts +7 -0
- package/esm/http/multipart/http-response-content.js +10 -0
- package/esm/http/multipart/index.d.ts +1 -0
- package/esm/http/multipart/index.js +1 -0
- package/esm/http/utils/normalize-headers.d.ts +1 -0
- package/esm/http/utils/normalize-headers.js +24 -0
- package/esm/i18n/i18n.d.ts +28 -0
- package/esm/i18n/i18n.js +170 -0
- package/esm/i18n/index.d.ts +5 -0
- package/esm/i18n/index.js +6 -0
- package/esm/i18n/string-utils.d.ts +2 -0
- package/esm/i18n/string-utils.js +8 -0
- package/esm/i18n/translate.d.ts +4 -0
- package/esm/i18n/translate.js +11 -0
- package/esm/index.d.ts +10 -5
- package/esm/index.js +10 -5
- package/esm/schema/constants.d.ts +8 -0
- package/esm/schema/constants.js +8 -0
- package/esm/schema/decorators/opr-collection-resource.decorator.d.ts +8 -0
- package/esm/schema/decorators/opr-collection-resource.decorator.js +19 -0
- package/esm/schema/decorators/opr-complex-type.decorator.d.ts +6 -0
- package/esm/schema/decorators/opr-complex-type.decorator.js +23 -0
- package/esm/schema/decorators/opr-field.decorator.d.ts +3 -0
- package/esm/schema/decorators/opr-field.decorator.js +24 -0
- package/esm/schema/decorators/opr-resolver.decorator.d.ts +8 -0
- package/esm/schema/decorators/opr-resolver.decorator.js +71 -0
- package/esm/schema/decorators/opr-simple-type.decorator.d.ts +6 -0
- package/esm/schema/decorators/opr-simple-type.decorator.js +14 -0
- package/esm/schema/decorators/opr-singleton-resource.decorator.d.ts +8 -0
- package/esm/schema/decorators/opr-singleton-resource.decorator.js +19 -0
- package/esm/schema/implementation/data-type/builtin/any.type.d.ts +2 -0
- package/esm/schema/implementation/data-type/builtin/any.type.js +6 -0
- package/esm/schema/implementation/data-type/builtin/base64-binary.type.d.ts +2 -0
- package/esm/schema/implementation/data-type/builtin/base64-binary.type.js +12 -0
- package/esm/schema/implementation/data-type/builtin/bigint.type.d.ts +2 -0
- package/esm/schema/implementation/data-type/builtin/bigint.type.js +12 -0
- package/esm/schema/implementation/data-type/builtin/boolean.type.d.ts +2 -0
- package/esm/schema/implementation/data-type/builtin/boolean.type.js +12 -0
- package/esm/schema/implementation/data-type/builtin/date-string.type.d.ts +2 -0
- package/esm/schema/implementation/data-type/builtin/date-string.type.js +12 -0
- package/esm/schema/implementation/data-type/builtin/date.type.d.ts +2 -0
- package/esm/schema/implementation/data-type/builtin/date.type.js +12 -0
- package/esm/schema/implementation/data-type/builtin/guid.type.d.ts +2 -0
- package/esm/schema/implementation/data-type/builtin/guid.type.js +12 -0
- package/esm/schema/implementation/data-type/builtin/integer.type.d.ts +2 -0
- package/esm/schema/implementation/data-type/builtin/integer.type.js +12 -0
- package/esm/schema/implementation/data-type/builtin/number.type.d.ts +2 -0
- package/esm/schema/implementation/data-type/builtin/number.type.js +12 -0
- package/esm/schema/implementation/data-type/builtin/object.type.d.ts +2 -0
- package/esm/schema/implementation/data-type/builtin/object.type.js +12 -0
- package/esm/schema/implementation/data-type/builtin/string.type.d.ts +2 -0
- package/esm/schema/implementation/data-type/builtin/string.type.js +12 -0
- package/esm/schema/implementation/data-type/builtin-data-types.d.ts +4 -0
- package/esm/schema/implementation/data-type/builtin-data-types.js +34 -0
- package/esm/schema/implementation/data-type/complex-type.d.ts +29 -0
- package/esm/schema/implementation/data-type/complex-type.js +107 -0
- package/esm/schema/implementation/data-type/data-type.d.ts +16 -0
- package/esm/schema/implementation/data-type/data-type.js +32 -0
- package/esm/schema/implementation/data-type/simple-type.d.ts +12 -0
- package/esm/schema/implementation/data-type/simple-type.js +17 -0
- package/esm/schema/implementation/data-type/union-type.d.ts +16 -0
- package/esm/schema/implementation/data-type/union-type.js +21 -0
- package/esm/schema/implementation/document-builder.d.ts +16 -0
- package/esm/schema/implementation/document-builder.js +135 -0
- package/esm/schema/implementation/opra-document.d.ts +44 -0
- package/esm/schema/implementation/opra-document.js +177 -0
- package/esm/schema/implementation/query/collection-count-query.d.ts +14 -0
- package/esm/schema/implementation/query/collection-count-query.js +15 -0
- package/esm/schema/implementation/query/collection-create-query.d.ts +18 -0
- package/esm/schema/implementation/query/collection-create-query.js +24 -0
- package/esm/schema/implementation/query/collection-delete-many-query.d.ts +14 -0
- package/esm/schema/implementation/query/collection-delete-many-query.js +15 -0
- package/esm/schema/implementation/query/collection-delete-query.d.ts +10 -0
- package/esm/schema/implementation/query/collection-delete-query.js +23 -0
- package/esm/schema/implementation/query/collection-get-query.d.ts +21 -0
- package/esm/schema/implementation/query/collection-get-query.js +34 -0
- package/esm/schema/implementation/query/collection-search-query.d.ts +30 -0
- package/esm/schema/implementation/query/collection-search-query.js +51 -0
- package/esm/schema/implementation/query/collection-update-many-query.d.ts +15 -0
- package/esm/schema/implementation/query/collection-update-many-query.js +17 -0
- package/esm/schema/implementation/query/collection-update-query.d.ts +19 -0
- package/esm/schema/implementation/query/collection-update-query.js +35 -0
- package/esm/schema/implementation/query/field-get-query.d.ts +30 -0
- package/esm/schema/implementation/query/field-get-query.js +41 -0
- package/esm/schema/implementation/query/index.d.ts +27 -0
- package/esm/schema/implementation/query/index.js +17 -0
- package/esm/schema/implementation/query/singleton-get-query.d.ts +20 -0
- package/esm/schema/implementation/query/singleton-get-query.js +23 -0
- package/esm/schema/implementation/resource/collection-resource-info.d.ts +19 -0
- package/esm/schema/implementation/resource/collection-resource-info.js +54 -0
- package/esm/schema/implementation/resource/container-resource-info.d.ts +13 -0
- package/esm/schema/implementation/resource/container-resource-info.js +26 -0
- package/esm/schema/implementation/resource/resource-info.d.ts +17 -0
- package/esm/schema/implementation/resource/resource-info.js +35 -0
- package/esm/schema/implementation/resource/singleton-resource-info.d.ts +14 -0
- package/esm/schema/implementation/resource/singleton-resource-info.js +33 -0
- package/esm/schema/implementation/schema-builder/extract-resource-metadata.util.d.ts +3 -0
- package/esm/schema/implementation/schema-builder/extract-resource-metadata.util.js +80 -0
- package/esm/schema/implementation/schema-builder/extract-type-metadata.util.d.ts +4 -0
- package/esm/schema/implementation/schema-builder/extract-type-metadata.util.js +89 -0
- package/esm/schema/index.d.ts +25 -0
- package/esm/schema/index.js +25 -0
- package/esm/schema/interfaces/child-field-query.interface.d.ts +4 -0
- package/esm/schema/interfaces/child-field-query.interface.js +1 -0
- package/esm/schema/interfaces/data-type.metadata.d.ts +18 -0
- package/esm/schema/interfaces/data-type.metadata.js +1 -0
- package/esm/schema/interfaces/resource-container.interface.d.ts +8 -0
- package/esm/schema/interfaces/resource-container.interface.js +1 -0
- package/esm/schema/interfaces/resource.metadata.d.ts +18 -0
- package/esm/schema/interfaces/resource.metadata.js +1 -0
- package/esm/schema/opra-schema.definition.d.ts +178 -0
- package/esm/schema/opra-schema.definition.js +46 -0
- package/esm/schema/type-helpers/extend-type.helper.d.ts +3 -0
- package/esm/schema/type-helpers/extend-type.helper.js +59 -0
- package/esm/schema/type-helpers/mixin-type.helper.d.ts +2 -0
- package/esm/schema/type-helpers/mixin-type.helper.js +41 -0
- package/esm/schema/type-helpers/mixin.utils.d.ts +3 -0
- package/esm/schema/type-helpers/mixin.utils.js +27 -0
- package/esm/{types.d.ts → schema/types.d.ts} +8 -1
- package/esm/schema/types.js +1 -0
- package/esm/schema/utils/class.utils.d.ts +2 -0
- package/esm/schema/utils/class.utils.js +4 -0
- package/esm/schema/utils/clone-object.util.d.ts +1 -0
- package/esm/schema/utils/clone-object.util.js +14 -0
- package/esm/schema/utils/inspect.util.d.ts +4 -0
- package/esm/schema/utils/inspect.util.js +4 -0
- package/esm/schema/utils/normalize-field-array.util.d.ts +3 -0
- package/esm/schema/utils/normalize-field-array.util.js +40 -0
- package/esm/schema/utils/path-to-tree.util.d.ts +4 -0
- package/esm/schema/utils/path-to-tree.util.js +22 -0
- package/esm/schema/utils/string-compare.util.d.ts +1 -0
- package/esm/schema/utils/string-compare.util.js +7 -0
- package/esm/url/formats/boolean-format.d.ts +5 -0
- package/esm/url/formats/boolean-format.js +21 -0
- package/esm/url/formats/date-format.d.ts +16 -0
- package/esm/url/formats/date-format.js +44 -0
- package/esm/url/formats/filter-format.d.ts +6 -0
- package/esm/url/formats/filter-format.js +14 -0
- package/esm/url/formats/format.d.ts +4 -0
- package/esm/url/formats/format.js +2 -0
- package/esm/url/formats/integer-format.d.ts +9 -0
- package/esm/url/formats/integer-format.js +16 -0
- package/esm/url/formats/number-format.d.ts +12 -0
- package/esm/url/formats/number-format.js +24 -0
- package/esm/url/formats/string-format.d.ts +14 -0
- package/esm/url/formats/string-format.js +24 -0
- package/esm/url/index.d.ts +5 -0
- package/esm/url/index.js +5 -0
- package/esm/url/opra-url-path-component.d.ts +15 -0
- package/esm/url/opra-url-path-component.js +29 -0
- package/esm/url/opra-url-path.d.ts +30 -0
- package/esm/url/opra-url-path.js +124 -0
- package/esm/url/opra-url-search-params.d.ts +46 -0
- package/esm/url/opra-url-search-params.js +243 -0
- package/esm/url/opra-url.d.ts +79 -0
- package/esm/url/opra-url.js +295 -0
- package/esm/url/utils/path-utils.d.ts +8 -0
- package/esm/url/utils/path-utils.js +78 -0
- package/esm/utils/index.d.ts +3 -0
- package/esm/utils/index.js +3 -0
- package/esm/utils/is-url.d.ts +1 -0
- package/esm/utils/is-url.js +4 -0
- package/esm/utils/path-to-tree.d.ts +4 -0
- package/esm/utils/path-to-tree.js +24 -0
- package/esm/utils/type-guards.d.ts +9 -0
- package/esm/utils/type-guards.js +37 -0
- package/package.json +30 -10
- package/umd/opra-common.umd.min.js +1 -0
- package/cjs/classes/headers-map.js +0 -18
- package/esm/classes/headers-map.d.ts +0 -5
- package/esm/classes/headers-map.js +0 -14
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("fast-tokenizer"),require("luxon"),require("highland"),require("uid"),require("reflect-metadata"),require("lodash"),require("putil-promisify"),require("@opra/optionals"),require("putil-varhelpers"),require("putil-isplainobject"),require("putil-merge"),require("http-parser-js")):"function"==typeof define&&define.amd?define("OpraCommon",["fast-tokenizer","luxon","highland","uid","reflect-metadata","lodash","putil-promisify","@opra/optionals","putil-varhelpers","putil-isplainobject","putil-merge","http-parser-js"],e):"object"==typeof exports?exports.OpraCommon=e(require("fast-tokenizer"),require("luxon"),require("highland"),require("uid"),require("reflect-metadata"),require("lodash"),require("putil-promisify"),require("@opra/optionals"),require("putil-varhelpers"),require("putil-isplainobject"),require("putil-merge"),require("http-parser-js")):t.OpraCommon=e(t["fast-tokenizer"],t.luxon,t.highland,t.uid,t["reflect-metadata"],t.lodash,t["putil-promisify"],t["@opra/optionals"],t["putil-varhelpers"],t["putil-isplainobject"],t["putil-merge"],t["http-parser-js"])}(self,((t,e,r,i,n,s,o,a,c,u,l,h)=>(()=>{"use strict";var p,d,f={292:t=>{t.exports=require("fs/promises")},17:t=>{t.exports=require("path")},79:t=>{t.exports=a},685:e=>{e.exports=t},480:t=>{t.exports=r},135:t=>{t.exports=h},467:t=>{t.exports=s},985:t=>{t.exports=e},394:t=>{t.exports=u},490:t=>{t.exports=l},682:t=>{t.exports=o},374:t=>{t.exports=c},150:t=>{t.exports=n},228:t=>{t.exports=i}},g={};function y(t){var e=g[t];if(void 0!==e)return e.exports;var r=g[t]={exports:{}};return f[t](r,r.exports,y),r.exports}d=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,y.t=function(t,e){if(1&e&&(t=this(t)),8&e)return t;if("object"==typeof t&&t){if(4&e&&t.__esModule)return t;if(16&e&&"function"==typeof t.then)return t}var r=Object.create(null);y.r(r);var i={};p=p||[null,d({}),d([]),d(d)];for(var n=2&e&&t;"object"==typeof n&&!~p.indexOf(n);n=d(n))Object.getOwnPropertyNames(n).forEach((e=>i[e]=()=>t[e]));return i.default=()=>t,y.d(r,i),r},y.d=(t,e)=>{for(var r in e)y.o(e,r)&&!y.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},y.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),y.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var m={};return(()=>{y.r(m),y.d(m,{$and:()=>Lr,$arithmetic:()=>Xr,$array:()=>jr,$date:()=>Nr,$eq:()=>Ur,$field:()=>Fr,$gt:()=>Hr,$gte:()=>$r,$ilike:()=>Wr,$in:()=>Vr,$like:()=>Gr,$lt:()=>Br,$lte:()=>qr,$ne:()=>Mr,$notILike:()=>Qr,$notIn:()=>zr,$notLike:()=>Kr,$number:()=>Dr,$or:()=>Ir,$paren:()=>Yr,$time:()=>Pr,ArithmeticExpression:()=>Qt,ArithmeticExpressionItem:()=>Yt,ArrayExpression:()=>Xt,Ast:()=>zt,BadRequestError:()=>Lt,BaseI18n:()=>Ot,BatchMultipart:()=>_i,BooleanLiteral:()=>re,COMPLEXTYPE_FIELDS:()=>Ti,CollectionCountQuery:()=>jn,CollectionCreateQuery:()=>Dn,CollectionDeleteManyQuery:()=>Fn,CollectionDeleteQuery:()=>Un,CollectionGetQuery:()=>Mn,CollectionResourceInfo:()=>In,CollectionSearchQuery:()=>Bn,CollectionUpdateManyQuery:()=>qn,CollectionUpdateQuery:()=>Vn,ComparisonExpression:()=>Zt,ComplexType:()=>bn,ContainerResourceInfo:()=>Pn,DATATYPE_METADATA:()=>vi,DataType:()=>En,DateLiteral:()=>de,DocumentBuilder:()=>gn,ErrorListener:()=>wr,Expression:()=>Gt,FailedDependencyError:()=>Nt,FieldGetQuery:()=>Hn,FilterTreeVisitor:()=>Cr,ForbiddenError:()=>Pt,HttpHeaders:()=>ei,HttpRequest:()=>Ds,HttpStatus:()=>ri,I18n:()=>wt,IGNORE_RESOLVER_METHOD:()=>xi,InternalServerError:()=>Bt,IssueSeverity:()=>$t,Literal:()=>Wt,LogicalExpression:()=>te,MAPPED_TYPE_METADATA:()=>Oi,MethodNotAllowedError:()=>Dt,MixinType:()=>Wn,NotAcceptableError:()=>jt,NotFoundError:()=>Ft,NullLiteral:()=>fe,NumberLiteral:()=>ge,OmitType:()=>Yn,OprCollectionResource:()=>Ni,OprComplexType:()=>Ai,OprCreateResolver:()=>ji,OprDeleteManyResolver:()=>Ui,OprDeleteResolver:()=>Fi,OprField:()=>Ii,OprGetResolver:()=>$i,OprSearchResolver:()=>Bi,OprSingletonResource:()=>Di,OprUpdateManyResolver:()=>Hi,OprUpdateResolver:()=>Mi,OpraDocument:()=>Nn,OpraException:()=>It,OpraSchema:()=>ki,OpraURL:()=>ks,OpraURLPath:()=>as,OpraURLPathComponent:()=>ss,OpraURLSearchParams:()=>_s,ParenthesesExpression:()=>ee,PickType:()=>Qn,QualifiedIdentifier:()=>ye,RESOLVER_METADATA:()=>bi,RESOURCE_METADATA:()=>Ei,ResourceConflictError:()=>qt,ResourceInfo:()=>An,ResourceNotFoundError:()=>Vt,ResponsiveMap:()=>zi,SimpleType:()=>xn,SingletonGetQuery:()=>$n,SingletonResourceInfo:()=>Ln,StringLiteral:()=>me,Term:()=>Kt,TimeLiteral:()=>ve,UnauthorizedError:()=>Ut,UnionType:()=>On,UnprocessableEntityError:()=>Mt,collectionMethods:()=>wi,decodePathComponent:()=>rs,encodePathComponent:()=>is,extractDataTypeSchema:()=>fn,extractResourceSchema:()=>dn,i18n:()=>At,isBlob:()=>ci,isChildFieldQuery:()=>zn,isFormData:()=>ui,isReadable:()=>oi,isReadableStream:()=>ai,isURL:()=>li,isUrl:()=>Tt,joinPath:()=>ts,normalizeHeaders:()=>di,normalizePath:()=>Zn,parseFilter:()=>Ar,pathToTree:()=>Us,singletonMethods:()=>Ri,translate:()=>Ct,typeGuards:()=>si,uid:()=>ni.uid,wrapException:()=>Ht});var t=y(685);function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function n(t,e,r){return e&&i(t.prototype,e),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function s(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function o(t,e){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},o(t,e)}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)}function c(t,r){if(r&&("object"===e(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return s(t)}function u(t){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},u(t)}function l(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function p(t){return function(t){if(Array.isArray(t))return t}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return h(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?h(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function f(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?d(Object(r),!0).forEach((function(e){l(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var g={type:"logger",log:function(t){this.output("log",t)},warn:function(t){this.output("warn",t)},error:function(t){this.output("error",t)},output:function(t,e){console&&console[t]&&console[t].apply(console,e)}},_=new(function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r(this,t),this.init(e,i)}return n(t,[{key:"init",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=e.prefix||"i18next:",this.logger=t||g,this.options=e,this.debug=e.debug}},{key:"setDebug",value:function(t){this.debug=t}},{key:"log",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return this.forward(e,"log","",!0)}},{key:"warn",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return this.forward(e,"warn","",!0)}},{key:"error",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return this.forward(e,"error","")}},{key:"deprecate",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(t,e,r,i){return i&&!this.debug?null:("string"==typeof t[0]&&(t[0]="".concat(r).concat(this.prefix," ").concat(t[0])),this.logger[e](t))}},{key:"create",value:function(e){return new t(this.logger,f(f({},{prefix:"".concat(this.prefix,":").concat(e,":")}),this.options))}},{key:"clone",value:function(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new t(this.logger,e)}}]),t}()),v=function(){function t(){r(this,t),this.observers={}}return n(t,[{key:"on",value:function(t,e){var r=this;return t.split(" ").forEach((function(t){r.observers[t]=r.observers[t]||[],r.observers[t].push(e)})),this}},{key:"off",value:function(t,e){this.observers[t]&&(e?this.observers[t]=this.observers[t].filter((function(t){return t!==e})):delete this.observers[t])}},{key:"emit",value:function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];if(this.observers[t]){var n=[].concat(this.observers[t]);n.forEach((function(t){t.apply(void 0,r)}))}if(this.observers["*"]){var s=[].concat(this.observers["*"]);s.forEach((function(e){e.apply(e,[t].concat(r))}))}}}]),t}();function T(){var t,e,r=new Promise((function(r,i){t=r,e=i}));return r.resolve=t,r.reject=e,r}function E(t){return null==t?"":""+t}function b(t,e,r){t.forEach((function(t){e[t]&&(r[t]=e[t])}))}function x(t,e,r){function i(t){return t&&t.indexOf("###")>-1?t.replace(/###/g,"."):t}function n(){return!t||"string"==typeof t}for(var s="string"!=typeof e?[].concat(e):e.split(".");s.length>1;){if(n())return{};var o=i(s.shift());!t[o]&&r&&(t[o]=new r),t=Object.prototype.hasOwnProperty.call(t,o)?t[o]:{}}return n()?{}:{obj:t,k:i(s.shift())}}function O(t,e,r){var i=x(t,e,Object);i.obj[i.k]=r}function R(t,e){var r=x(t,e),i=r.obj,n=r.k;if(i)return i[n]}function w(t,e,r){var i=R(t,r);return void 0!==i?i:R(e,r)}function k(t,e,r){for(var i in e)"__proto__"!==i&&"constructor"!==i&&(i in t?"string"==typeof t[i]||t[i]instanceof String||"string"==typeof e[i]||e[i]instanceof String?r&&(t[i]=e[i]):k(t[i],e[i],r):t[i]=e[i]);return t}function S(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var C={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function A(t){return"string"==typeof t?t.replace(/[&<>"'\/]/g,(function(t){return C[t]})):t}var I="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,L=[" ",",","?","!",";"];function N(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function P(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?N(Object(r),!0).forEach((function(e){l(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):N(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function D(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,i=u(t);if(e){var n=u(this).constructor;r=Reflect.construct(i,arguments,n)}else r=i.apply(this,arguments);return c(this,r)}}function j(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(t){if(t[e])return t[e];for(var i=e.split(r),n=t,s=0;s<i.length;++s){if(!n)return;if("string"==typeof n[i[s]]&&s+1<i.length)return;if(void 0===n[i[s]]){for(var o=2,a=i.slice(s,s+o).join(r),c=n[a];void 0===c&&i.length>s+o;)o++,c=n[a=i.slice(s,s+o).join(r)];if(void 0===c)return;if(null===c)return null;if(e.endsWith(a)){if("string"==typeof c)return c;if(a&&"string"==typeof c[a])return c[a]}var u=i.slice(s+o).join(r);return u?j(c,u,r):void 0}n=n[i[s]]}return n}}var F=function(t){a(i,t);var e=D(i);function i(t){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return r(this,i),n=e.call(this),I&&v.call(s(n)),n.data=t||{},n.options=o,void 0===n.options.keySeparator&&(n.options.keySeparator="."),void 0===n.options.ignoreJSONStructure&&(n.options.ignoreJSONStructure=!0),n}return n(i,[{key:"addNamespaces",value:function(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}},{key:"removeNamespaces",value:function(t){var e=this.options.ns.indexOf(t);e>-1&&this.options.ns.splice(e,1)}},{key:"getResource",value:function(t,e,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,s=void 0!==i.ignoreJSONStructure?i.ignoreJSONStructure:this.options.ignoreJSONStructure,o=[t,e];r&&"string"!=typeof r&&(o=o.concat(r)),r&&"string"==typeof r&&(o=o.concat(n?r.split(n):r)),t.indexOf(".")>-1&&(o=t.split("."));var a=R(this.data,o);return a||!s||"string"!=typeof r?a:j(this.data&&this.data[t]&&this.data[t][e],r,n)}},{key:"addResource",value:function(t,e,r,i){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},s=this.options.keySeparator;void 0===s&&(s=".");var o=[t,e];r&&(o=o.concat(s?r.split(s):r)),t.indexOf(".")>-1&&(i=e,e=(o=t.split("."))[1]),this.addNamespaces(e),O(this.data,o,i),n.silent||this.emit("added",t,e,r,i)}},{key:"addResources",value:function(t,e,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var n in r)"string"!=typeof r[n]&&"[object Array]"!==Object.prototype.toString.apply(r[n])||this.addResource(t,e,n,r[n],{silent:!0});i.silent||this.emit("added",t,e,r)}},{key:"addResourceBundle",value:function(t,e,r,i,n){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},o=[t,e];t.indexOf(".")>-1&&(i=r,r=e,e=(o=t.split("."))[1]),this.addNamespaces(e);var a=R(this.data,o)||{};i?k(a,r,n):a=P(P({},a),r),O(this.data,o,a),s.silent||this.emit("added",t,e,r)}},{key:"removeResourceBundle",value:function(t,e){this.hasResourceBundle(t,e)&&delete this.data[t][e],this.removeNamespaces(e),this.emit("removed",t,e)}},{key:"hasResourceBundle",value:function(t,e){return void 0!==this.getResource(t,e)}},{key:"getResourceBundle",value:function(t,e){return e||(e=this.options.defaultNS),"v1"===this.options.compatibilityAPI?P(P({},{}),this.getResource(t,e)):this.getResource(t,e)}},{key:"getDataByLanguage",value:function(t){return this.data[t]}},{key:"hasLanguageSomeTranslations",value:function(t){var e=this.getDataByLanguage(t);return!!(e&&Object.keys(e)||[]).find((function(t){return e[t]&&Object.keys(e[t]).length>0}))}},{key:"toJSON",value:function(){return this.data}}]),i}(v),U={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,e,r,i,n){var s=this;return t.forEach((function(t){s.processors[t]&&(e=s.processors[t].process(e,r,i,n))})),e}};function M(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function H(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?M(Object(r),!0).forEach((function(e){l(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):M(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function $(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,i=u(t);if(e){var n=u(this).constructor;r=Reflect.construct(i,arguments,n)}else r=i.apply(this,arguments);return c(this,r)}}var B={},q=function(t){a(o,t);var i=$(o);function o(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r(this,o),e=i.call(this),I&&v.call(s(e)),b(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,s(e)),e.options=n,void 0===e.options.keySeparator&&(e.options.keySeparator="."),e.logger=_.create("translator"),e}return n(o,[{key:"changeLanguage",value:function(t){t&&(this.language=t)}},{key:"exists",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==t)return!1;var r=this.resolve(t,e);return r&&void 0!==r.res}},{key:"extractFromKey",value:function(t,e){var r=void 0!==e.nsSeparator?e.nsSeparator:this.options.nsSeparator;void 0===r&&(r=":");var i=void 0!==e.keySeparator?e.keySeparator:this.options.keySeparator,n=e.ns||this.options.defaultNS||[],s=r&&t.indexOf(r)>-1,o=!(this.options.userDefinedKeySeparator||e.keySeparator||this.options.userDefinedNsSeparator||e.nsSeparator||function(t,e,r){e=e||"",r=r||"";var i=L.filter((function(t){return e.indexOf(t)<0&&r.indexOf(t)<0}));if(0===i.length)return!0;var n=new RegExp("(".concat(i.map((function(t){return"?"===t?"\\?":t})).join("|"),")")),s=!n.test(t);if(!s){var o=t.indexOf(r);o>0&&!n.test(t.substring(0,o))&&(s=!0)}return s}(t,r,i));if(s&&!o){var a=t.match(this.interpolator.nestingRegexp);if(a&&a.length>0)return{key:t,namespaces:n};var c=t.split(r);(r!==i||r===i&&this.options.ns.indexOf(c[0])>-1)&&(n=c.shift()),t=c.join(i)}return"string"==typeof n&&(n=[n]),{key:t,namespaces:n}}},{key:"translate",value:function(t,r,i){var n=this;if("object"!==e(r)&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),r||(r={}),null==t)return"";Array.isArray(t)||(t=[String(t)]);var s=void 0!==r.returnDetails?r.returnDetails:this.options.returnDetails,a=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,c=this.extractFromKey(t[t.length-1],r),u=c.key,l=c.namespaces,h=l[l.length-1],p=r.lng||this.language,d=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(p&&"cimode"===p.toLowerCase()){if(d){var f=r.nsSeparator||this.options.nsSeparator;return s?(g.res="".concat(h).concat(f).concat(u),g):"".concat(h).concat(f).concat(u)}return s?(g.res=u,g):u}var g=this.resolve(t,r),y=g&&g.res,m=g&&g.usedKey||u,_=g&&g.exactUsedKey||u,v=Object.prototype.toString.apply(y),T=["[object Number]","[object Function]","[object RegExp]"],E=void 0!==r.joinArrays?r.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,x="string"!=typeof y&&"boolean"!=typeof y&&"number"!=typeof y;if(b&&y&&x&&T.indexOf(v)<0&&("string"!=typeof E||"[object Array]"!==v)){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var O=this.options.returnedObjectHandler?this.options.returnedObjectHandler(m,y,H(H({},r),{},{ns:l})):"key '".concat(u," (").concat(this.language,")' returned an object instead of string.");return s?(g.res=O,g):O}if(a){var R="[object Array]"===v,w=R?[]:{},k=R?_:m;for(var S in y)if(Object.prototype.hasOwnProperty.call(y,S)){var C="".concat(k).concat(a).concat(S);w[S]=this.translate(C,H(H({},r),{joinArrays:!1,ns:l})),w[S]===C&&(w[S]=y[S])}y=w}}else if(b&&"string"==typeof E&&"[object Array]"===v)(y=y.join(E))&&(y=this.extendTranslation(y,t,r,i));else{var A=!1,I=!1,L=void 0!==r.count&&"string"!=typeof r.count,N=o.hasDefaultValue(r),P=L?this.pluralResolver.getSuffix(p,r.count,r):"",D=r["defaultValue".concat(P)]||r.defaultValue;!this.isValidLookup(y)&&N&&(A=!0,y=D),this.isValidLookup(y)||(I=!0,y=u);var j=r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,F=j&&I?void 0:y,U=N&&D!==y&&this.options.updateMissing;if(I||A||U){if(this.logger.log(U?"updateKey":"missingKey",p,h,u,U?D:y),a){var M=this.resolve(u,H(H({},r),{},{keySeparator:!1}));M&&M.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var $=[],B=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if("fallback"===this.options.saveMissingTo&&B&&B[0])for(var q=0;q<B.length;q++)$.push(B[q]);else"all"===this.options.saveMissingTo?$=this.languageUtils.toResolveHierarchy(r.lng||this.language):$.push(r.lng||this.language);var V=function(t,e,i){var s=N&&i!==y?i:F;n.options.missingKeyHandler?n.options.missingKeyHandler(t,h,e,s,U,r):n.backendConnector&&n.backendConnector.saveMissing&&n.backendConnector.saveMissing(t,h,e,s,U,r),n.emit("missingKey",t,h,e,y)};this.options.saveMissing&&(this.options.saveMissingPlurals&&L?$.forEach((function(t){n.pluralResolver.getSuffixes(t,r).forEach((function(e){V([t],u+e,r["defaultValue".concat(e)]||D)}))})):V($,u,D))}y=this.extendTranslation(y,t,r,g,i),I&&y===u&&this.options.appendNamespaceToMissingKey&&(y="".concat(h,":").concat(u)),(I||A)&&this.options.parseMissingKeyHandler&&(y="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(h,":").concat(u):u,A?y:void 0):this.options.parseMissingKeyHandler(y))}return s?(g.res=y,g):y}},{key:"extendTranslation",value:function(t,e,r,i,n){var s=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,H(H({},this.options.interpolation.defaultVariables),r),i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init(H(H({},r),{interpolation:H(H({},this.options.interpolation),r.interpolation)}));var o,a="string"==typeof t&&(r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(a){var c=t.match(this.interpolator.nestingRegexp);o=c&&c.length}var u=r.replace&&"string"!=typeof r.replace?r.replace:r;if(this.options.interpolation.defaultVariables&&(u=H(H({},this.options.interpolation.defaultVariables),u)),t=this.interpolator.interpolate(t,u,r.lng||this.language,r),a){var l=t.match(this.interpolator.nestingRegexp);o<(l&&l.length)&&(r.nest=!1)}!1!==r.nest&&(t=this.interpolator.nest(t,(function(){for(var t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];return n&&n[0]===i[0]&&!r.context?(s.logger.warn("It seems you are nesting recursively key: ".concat(i[0]," in key: ").concat(e[0])),null):s.translate.apply(s,i.concat([e]))}),r)),r.interpolation&&this.interpolator.reset()}var h=r.postProcess||this.options.postProcess,p="string"==typeof h?[h]:h;return null!=t&&p&&p.length&&!1!==r.applyPostProcessor&&(t=U.handle(p,t,e,this.options&&this.options.postProcessPassResolved?H({i18nResolved:i},r):r,this)),t}},{key:"resolve",value:function(t){var e,r,i,n,s,o=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof t&&(t=[t]),t.forEach((function(t){if(!o.isValidLookup(e)){var c=o.extractFromKey(t,a),u=c.key;r=u;var l=c.namespaces;o.options.fallbackNS&&(l=l.concat(o.options.fallbackNS));var h=void 0!==a.count&&"string"!=typeof a.count,p=h&&!a.ordinal&&0===a.count&&o.pluralResolver.shouldUseIntlApi(),d=void 0!==a.context&&("string"==typeof a.context||"number"==typeof a.context)&&""!==a.context,f=a.lngs?a.lngs:o.languageUtils.toResolveHierarchy(a.lng||o.language,a.fallbackLng);l.forEach((function(t){o.isValidLookup(e)||(s=t,!B["".concat(f[0],"-").concat(t)]&&o.utils&&o.utils.hasLoadedNamespace&&!o.utils.hasLoadedNamespace(s)&&(B["".concat(f[0],"-").concat(t)]=!0,o.logger.warn('key "'.concat(r,'" for languages "').concat(f.join(", "),'" won\'t get resolved as namespace "').concat(s,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),f.forEach((function(r){if(!o.isValidLookup(e)){n=r;var s,c=[u];if(o.i18nFormat&&o.i18nFormat.addLookupKeys)o.i18nFormat.addLookupKeys(c,u,r,t,a);else{var l;h&&(l=o.pluralResolver.getSuffix(r,a.count,a));var f="".concat(o.options.pluralSeparator,"zero");if(h&&(c.push(u+l),p&&c.push(u+f)),d){var g="".concat(u).concat(o.options.contextSeparator).concat(a.context);c.push(g),h&&(c.push(g+l),p&&c.push(g+f))}}for(;s=c.pop();)o.isValidLookup(e)||(i=s,e=o.getResource(r,t,s,a))}})))}))}})),{res:e,usedKey:r,exactUsedKey:i,usedLng:n,usedNS:s}}},{key:"isValidLookup",value:function(t){return!(void 0===t||!this.options.returnNull&&null===t||!this.options.returnEmptyString&&""===t)}},{key:"getResource",value:function(t,e,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,e,r,i):this.resourceStore.getResource(t,e,r,i)}}],[{key:"hasDefaultValue",value:function(t){var e="defaultValue";for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&e===r.substring(0,e.length)&&void 0!==t[r])return!0;return!1}}]),o}(v);function V(t){return t.charAt(0).toUpperCase()+t.slice(1)}var z=function(){function t(e){r(this,t),this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=_.create("languageUtils")}return n(t,[{key:"getScriptPartFromCode",value:function(t){if(!t||t.indexOf("-")<0)return null;var e=t.split("-");return 2===e.length?null:(e.pop(),"x"===e[e.length-1].toLowerCase()?null:this.formatLanguageCode(e.join("-")))}},{key:"getLanguagePartFromCode",value:function(t){if(!t||t.indexOf("-")<0)return t;var e=t.split("-");return this.formatLanguageCode(e[0])}},{key:"formatLanguageCode",value:function(t){if("string"==typeof t&&t.indexOf("-")>-1){var e=["hans","hant","latn","cyrl","cans","mong","arab"],r=t.split("-");return this.options.lowerCaseLng?r=r.map((function(t){return t.toLowerCase()})):2===r.length?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),e.indexOf(r[1].toLowerCase())>-1&&(r[1]=V(r[1].toLowerCase()))):3===r.length&&(r[0]=r[0].toLowerCase(),2===r[1].length&&(r[1]=r[1].toUpperCase()),"sgn"!==r[0]&&2===r[2].length&&(r[2]=r[2].toUpperCase()),e.indexOf(r[1].toLowerCase())>-1&&(r[1]=V(r[1].toLowerCase())),e.indexOf(r[2].toLowerCase())>-1&&(r[2]=V(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}},{key:"isSupportedCode",value:function(t){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}},{key:"getBestMatchFromCodes",value:function(t){var e,r=this;return t?(t.forEach((function(t){if(!e){var i=r.formatLanguageCode(t);r.options.supportedLngs&&!r.isSupportedCode(i)||(e=i)}})),!e&&this.options.supportedLngs&&t.forEach((function(t){if(!e){var i=r.getLanguagePartFromCode(t);if(r.isSupportedCode(i))return e=i;e=r.options.supportedLngs.find((function(t){if(0===t.indexOf(i))return t}))}})),e||(e=this.getFallbackCodes(this.options.fallbackLng)[0]),e):null}},{key:"getFallbackCodes",value:function(t,e){if(!t)return[];if("function"==typeof t&&(t=t(e)),"string"==typeof t&&(t=[t]),"[object Array]"===Object.prototype.toString.apply(t))return t;if(!e)return t.default||[];var r=t[e];return r||(r=t[this.getScriptPartFromCode(e)]),r||(r=t[this.formatLanguageCode(e)]),r||(r=t[this.getLanguagePartFromCode(e)]),r||(r=t.default),r||[]}},{key:"toResolveHierarchy",value:function(t,e){var r=this,i=this.getFallbackCodes(e||this.options.fallbackLng||[],t),n=[],s=function(t){t&&(r.isSupportedCode(t)?n.push(t):r.logger.warn("rejecting language code not found in supportedLngs: ".concat(t)))};return"string"==typeof t&&t.indexOf("-")>-1?("languageOnly"!==this.options.load&&s(this.formatLanguageCode(t)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&s(this.getScriptPartFromCode(t)),"currentOnly"!==this.options.load&&s(this.getLanguagePartFromCode(t))):"string"==typeof t&&s(this.formatLanguageCode(t)),i.forEach((function(t){n.indexOf(t)<0&&s(r.formatLanguageCode(t))})),n}}]),t}(),G=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],K={1:function(t){return Number(t>1)},2:function(t){return Number(1!=t)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(0==t?0:1==t?1:2==t?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(1==t?0:t>=2&&t<=4?1:2)},7:function(t){return Number(1==t?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(1==t?0:2==t?1:8!=t&&11!=t?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(1==t?0:2==t?1:t<7?2:t<11?3:4)},11:function(t){return Number(1==t||11==t?0:2==t||12==t?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(0!==t)},14:function(t){return Number(1==t?0:2==t?1:3==t?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:0!==t?1:2)},17:function(t){return Number(1==t||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(0==t?0:1==t?1:2)},19:function(t){return Number(1==t?0:0==t||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(1==t?0:0==t||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(1==t?0:2==t?1:(t<0||t>10)&&t%10==0?2:3)}},W=["v1","v2","v3"],Q={zero:0,one:1,two:2,few:3,many:4,other:5};function Y(){var t={};return G.forEach((function(e){e.lngs.forEach((function(r){t[r]={numbers:e.nr,plurals:K[e.fc]}}))})),t}var X=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r(this,t),this.languageUtils=e,this.options=i,this.logger=_.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=Y()}return n(t,[{key:"addRule",value:function(t,e){this.rules[t]=e}},{key:"getRule",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(t,{type:e.ordinal?"ordinal":"cardinal"})}catch(t){return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}},{key:"needsPlural",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(t,e);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(t,r).map((function(t){return"".concat(e).concat(t)}))}},{key:"getSuffixes",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.getRule(t,r);return i?this.shouldUseIntlApi()?i.resolvedOptions().pluralCategories.sort((function(t,e){return Q[t]-Q[e]})).map((function(t){return"".concat(e.options.prepend).concat(t)})):i.numbers.map((function(i){return e.getSuffix(t,i,r)})):[]}},{key:"getSuffix",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.getRule(t,r);return i?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(i.select(e)):this.getSuffixRetroCompatible(i,e):(this.logger.warn("no plural rule found for: ".concat(t)),"")}},{key:"getSuffixRetroCompatible",value:function(t,e){var r=this,i=t.noAbs?t.plurals(e):t.plurals(Math.abs(e)),n=t.numbers[i];this.options.simplifyPluralSuffix&&2===t.numbers.length&&1===t.numbers[0]&&(2===n?n="plural":1===n&&(n=""));var s=function(){return r.options.prepend&&n.toString()?r.options.prepend+n.toString():n.toString()};return"v1"===this.options.compatibilityJSON?1===n?"":"number"==typeof n?"_plural_".concat(n.toString()):s():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===t.numbers.length&&1===t.numbers[0]?s():this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}},{key:"shouldUseIntlApi",value:function(){return!W.includes(this.options.compatibilityJSON)}}]),t}();function J(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function Z(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?J(Object(r),!0).forEach((function(e){l(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):J(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var tt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r(this,t),this.logger=_.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||function(t){return t},this.init(e)}return n(t,[{key:"init",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});var e=t.interpolation;this.escape=void 0!==e.escape?e.escape:A,this.escapeValue=void 0===e.escapeValue||e.escapeValue,this.useRawValueToEscape=void 0!==e.useRawValueToEscape&&e.useRawValueToEscape,this.prefix=e.prefix?S(e.prefix):e.prefixEscaped||"{{",this.suffix=e.suffix?S(e.suffix):e.suffixEscaped||"}}",this.formatSeparator=e.formatSeparator?e.formatSeparator:e.formatSeparator||",",this.unescapePrefix=e.unescapeSuffix?"":e.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":e.unescapeSuffix||"",this.nestingPrefix=e.nestingPrefix?S(e.nestingPrefix):e.nestingPrefixEscaped||S("$t("),this.nestingSuffix=e.nestingSuffix?S(e.nestingSuffix):e.nestingSuffixEscaped||S(")"),this.nestingOptionsSeparator=e.nestingOptionsSeparator?e.nestingOptionsSeparator:e.nestingOptionsSeparator||",",this.maxReplaces=e.maxReplaces?e.maxReplaces:1e3,this.alwaysFormat=void 0!==e.alwaysFormat&&e.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var t="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(t,"g");var e="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(e,"g");var r="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(r,"g")}},{key:"interpolate",value:function(t,e,r,i){var n,s,o,a=this,c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function u(t){return t.replace(/\$/g,"$$$$")}var l=function(t){if(t.indexOf(a.formatSeparator)<0){var n=w(e,c,t);return a.alwaysFormat?a.format(n,void 0,r,Z(Z(Z({},i),e),{},{interpolationkey:t})):n}var s=t.split(a.formatSeparator),o=s.shift().trim(),u=s.join(a.formatSeparator).trim();return a.format(w(e,c,o),u,r,Z(Z(Z({},i),e),{},{interpolationkey:o}))};this.resetRegExp();var h=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,p=i&&i.interpolation&&void 0!==i.interpolation.skipOnVariables?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(t){return u(t)}},{regex:this.regexp,safeValue:function(t){return a.escapeValue?u(a.escape(t)):u(t)}}].forEach((function(e){for(o=0;n=e.regex.exec(t);){var r=n[1].trim();if(void 0===(s=l(r)))if("function"==typeof h){var c=h(t,n,i);s="string"==typeof c?c:""}else if(i&&i.hasOwnProperty(r))s="";else{if(p){s=n[0];continue}a.logger.warn("missed to pass in variable ".concat(r," for interpolating ").concat(t)),s=""}else"string"==typeof s||a.useRawValueToEscape||(s=E(s));var u=e.safeValue(s);if(t=t.replace(n[0],u),p?(e.regex.lastIndex+=s.length,e.regex.lastIndex-=n[0].length):e.regex.lastIndex=0,++o>=a.maxReplaces)break}})),t}},{key:"nest",value:function(t,e){var r,i,n=this,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=Z({},s);function a(t,e){var r=this.nestingOptionsSeparator;if(t.indexOf(r)<0)return t;var i=t.split(new RegExp("".concat(r,"[ ]*{"))),n="{".concat(i[1]);t=i[0];var s=(n=this.interpolate(n,o)).match(/'/g),a=n.match(/"/g);(s&&s.length%2==0&&!a||a.length%2!=0)&&(n=n.replace(/'/g,'"'));try{o=JSON.parse(n),e&&(o=Z(Z({},e),o))}catch(e){return this.logger.warn("failed parsing options string in nesting for key ".concat(t),e),"".concat(t).concat(r).concat(n)}return delete o.defaultValue,t}for(o.applyPostProcessor=!1,delete o.defaultValue;r=this.nestingRegexp.exec(t);){var c=[],u=!1;if(-1!==r[0].indexOf(this.formatSeparator)&&!/{.*}/.test(r[1])){var l=r[1].split(this.formatSeparator).map((function(t){return t.trim()}));r[1]=l.shift(),c=l,u=!0}if((i=e(a.call(this,r[1].trim(),o),o))&&r[0]===t&&"string"!=typeof i)return i;"string"!=typeof i&&(i=E(i)),i||(this.logger.warn("missed to resolve ".concat(r[1]," for nesting ").concat(t)),i=""),u&&(i=c.reduce((function(t,e){return n.format(t,e,s.lng,Z(Z({},s),{},{interpolationkey:r[1].trim()}))}),i.trim())),t=t.replace(r[0],i),this.regexp.lastIndex=0}return t}}]),t}();function et(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function rt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?et(Object(r),!0).forEach((function(e){l(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):et(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function it(t){var e={};return function(r,i,n){var s=i+JSON.stringify(n),o=e[s];return o||(o=t(i,n),e[s]=o),o(r)}}var nt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r(this,t),this.logger=_.create("formatter"),this.options=e,this.formats={number:it((function(t,e){var r=new Intl.NumberFormat(t,e);return function(t){return r.format(t)}})),currency:it((function(t,e){var r=new Intl.NumberFormat(t,rt(rt({},e),{},{style:"currency"}));return function(t){return r.format(t)}})),datetime:it((function(t,e){var r=new Intl.DateTimeFormat(t,rt({},e));return function(t){return r.format(t)}})),relativetime:it((function(t,e){var r=new Intl.RelativeTimeFormat(t,rt({},e));return function(t){return r.format(t,e.range||"day")}})),list:it((function(t,e){var r=new Intl.ListFormat(t,rt({},e));return function(t){return r.format(t)}}))},this.init(e)}return n(t,[{key:"init",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},r=e.interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}},{key:"add",value:function(t,e){this.formats[t.toLowerCase().trim()]=e}},{key:"addCached",value:function(t,e){this.formats[t.toLowerCase().trim()]=it(e)}},{key:"format",value:function(t,e,r,i){var n=this;return e.split(this.formatSeparator).reduce((function(t,e){var s=function(t){var e=t.toLowerCase().trim(),r={};if(t.indexOf("(")>-1){var i=t.split("(");e=i[0].toLowerCase().trim();var n=i[1].substring(0,i[1].length-1);"currency"===e&&n.indexOf(":")<0?r.currency||(r.currency=n.trim()):"relativetime"===e&&n.indexOf(":")<0?r.range||(r.range=n.trim()):n.split(";").forEach((function(t){if(t){var e=p(t.split(":")),i=e[0],n=e.slice(1).join(":").trim().replace(/^'+|'+$/g,"");r[i.trim()]||(r[i.trim()]=n),"false"===n&&(r[i.trim()]=!1),"true"===n&&(r[i.trim()]=!0),isNaN(n)||(r[i.trim()]=parseInt(n,10))}}))}return{formatName:e,formatOptions:r}}(e),o=s.formatName,a=s.formatOptions;if(n.formats[o]){var c=t;try{var u=i&&i.formatParams&&i.formatParams[i.interpolationkey]||{},l=u.locale||u.lng||i.locale||i.lng||r;c=n.formats[o](t,l,rt(rt(rt({},a),i),u))}catch(t){n.logger.warn(t)}return c}return n.logger.warn("there was no format function for ".concat(o)),t}),t)}}]),t}();function st(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function ot(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?st(Object(r),!0).forEach((function(e){l(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):st(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function at(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,i=u(t);if(e){var n=u(this).constructor;r=Reflect.construct(i,arguments,n)}else r=i.apply(this,arguments);return c(this,r)}}var ct=function(t){a(i,t);var e=at(i);function i(t,n,o){var a,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return r(this,i),a=e.call(this),I&&v.call(s(a)),a.backend=t,a.store=n,a.services=o,a.languageUtils=o.languageUtils,a.options=c,a.logger=_.create("backendConnector"),a.waitingReads=[],a.maxParallelReads=c.maxParallelReads||10,a.readingCalls=0,a.maxRetries=c.maxRetries>=0?c.maxRetries:5,a.retryTimeout=c.retryTimeout>=1?c.retryTimeout:350,a.state={},a.queue=[],a.backend&&a.backend.init&&a.backend.init(o,c.backend,c),a}return n(i,[{key:"queueLoad",value:function(t,e,r,i){var n=this,s={},o={},a={},c={};return t.forEach((function(t){var i=!0;e.forEach((function(e){var a="".concat(t,"|").concat(e);!r.reload&&n.store.hasResourceBundle(t,e)?n.state[a]=2:n.state[a]<0||(1===n.state[a]?void 0===o[a]&&(o[a]=!0):(n.state[a]=1,i=!1,void 0===o[a]&&(o[a]=!0),void 0===s[a]&&(s[a]=!0),void 0===c[e]&&(c[e]=!0)))})),i||(a[t]=!0)})),(Object.keys(s).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(s),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(c)}}},{key:"loaded",value:function(t,e,r){var i=t.split("|"),n=i[0],s=i[1];e&&this.emit("failedLoading",n,s,e),r&&this.store.addResourceBundle(n,s,r),this.state[t]=e?-1:2;var o={};this.queue.forEach((function(r){var i,a,c,u,l,h;i=r.loaded,a=s,u=x(i,[n],Object),l=u.obj,h=u.k,l[h]=l[h]||[],c&&(l[h]=l[h].concat(a)),c||l[h].push(a),function(t,e){void 0!==t.pending[e]&&(delete t.pending[e],t.pendingCount--)}(r,t),e&&r.errors.push(e),0!==r.pendingCount||r.done||(Object.keys(r.loaded).forEach((function(t){o[t]||(o[t]={});var e=r.loaded[t];e.length&&e.forEach((function(e){void 0===o[t][e]&&(o[t][e]=!0)}))})),r.done=!0,r.errors.length?r.callback(r.errors):r.callback())})),this.emit("loaded",o),this.queue=this.queue.filter((function(t){return!t.done}))}},{key:"read",value:function(t,e,r){var i=this,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;return t.length?this.readingCalls>=this.maxParallelReads?void this.waitingReads.push({lng:t,ns:e,fcName:r,tried:n,wait:s,callback:o}):(this.readingCalls++,this.backend[r](t,e,(function(a,c){if(i.readingCalls--,i.waitingReads.length>0){var u=i.waitingReads.shift();i.read(u.lng,u.ns,u.fcName,u.tried,u.wait,u.callback)}a&&c&&n<i.maxRetries?setTimeout((function(){i.read.call(i,t,e,r,n+1,2*s,o)}),s):o(a,c)}))):o(null,{})}},{key:"prepareLoading",value:function(t,e){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();"string"==typeof t&&(t=this.languageUtils.toResolveHierarchy(t)),"string"==typeof e&&(e=[e]);var s=this.queueLoad(t,e,i,n);if(!s.toLoad.length)return s.pending.length||n(),null;s.toLoad.forEach((function(t){r.loadOne(t)}))}},{key:"load",value:function(t,e,r){this.prepareLoading(t,e,{},r)}},{key:"reload",value:function(t,e,r){this.prepareLoading(t,e,{reload:!0},r)}},{key:"loadOne",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=t.split("|"),n=i[0],s=i[1];this.read(n,s,"read",void 0,void 0,(function(i,o){i&&e.logger.warn("".concat(r,"loading namespace ").concat(s," for language ").concat(n," failed"),i),!i&&o&&e.logger.log("".concat(r,"loaded namespace ").concat(s," for language ").concat(n),o),e.loaded(t,i,o)}))}},{key:"saveMissing",value:function(t,e,r,i,n){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(e)?this.logger.warn('did not save key "'.concat(r,'" as the namespace "').concat(e,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null!=r&&""!==r&&(this.backend&&this.backend.create&&this.backend.create(t,e,r,i,null,ot(ot({},s),{},{isUpdate:n})),t&&t[0]&&this.store.addResource(t[0],e,r,i))}}]),i}(v);function ut(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var r={};if("object"===e(t[1])&&(r=t[1]),"string"==typeof t[1]&&(r.defaultValue=t[1]),"string"==typeof t[2]&&(r.tDescription=t[2]),"object"===e(t[2])||"object"===e(t[3])){var i=t[3]||t[2];Object.keys(i).forEach((function(t){r[t]=i[t]}))}return r},interpolation:{escapeValue:!0,format:function(t,e,r,i){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function lt(t){return"string"==typeof t.ns&&(t.ns=[t.ns]),"string"==typeof t.fallbackLng&&(t.fallbackLng=[t.fallbackLng]),"string"==typeof t.fallbackNS&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t}function ht(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function pt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ht(Object(r),!0).forEach((function(e){l(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ht(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function dt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,i=u(t);if(e){var n=u(this).constructor;r=Reflect.construct(i,arguments,n)}else r=i.apply(this,arguments);return c(this,r)}}function ft(){}function gt(t){Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach((function(e){"function"==typeof t[e]&&(t[e]=t[e].bind(t))}))}var yt=function(t){a(o,t);var i=dt(o);function o(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(r(this,o),t=i.call(this),I&&v.call(s(t)),t.options=lt(e),t.services={},t.logger=_,t.modules={external:[]},gt(s(t)),n&&!t.isInitialized&&!e.isClone){if(!t.options.initImmediate)return t.init(e,n),c(t,s(t));setTimeout((function(){t.init(e,n)}),0)}return t}return n(o,[{key:"init",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;"function"==typeof e&&(r=e,e={}),!e.defaultNS&&!1!==e.defaultNS&&e.ns&&("string"==typeof e.ns?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));var i=ut();function n(t){return t?"function"==typeof t?new t:t:null}if(this.options=pt(pt(pt({},i),this.options),lt(e)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=pt(pt({},i.interpolation),this.options.interpolation)),void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator),!this.options.isClone){var s;this.modules.logger?_.init(n(this.modules.logger),this.options):_.init(null,this.options),this.modules.formatter?s=this.modules.formatter:"undefined"!=typeof Intl&&(s=nt);var o=new z(this.options);this.store=new F(this.options.resources,this.options);var a=this.services;a.logger=_,a.resourceStore=this.store,a.languageUtils=o,a.pluralResolver=new X(o,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!s||this.options.interpolation.format&&this.options.interpolation.format!==i.interpolation.format||(a.formatter=n(s),a.formatter.init(a,this.options),this.options.interpolation.format=a.formatter.format.bind(a.formatter)),a.interpolator=new tt(this.options),a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},a.backendConnector=new ct(n(this.modules.backend),a.resourceStore,a,this.options),a.backendConnector.on("*",(function(e){for(var r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];t.emit.apply(t,[e].concat(i))})),this.modules.languageDetector&&(a.languageDetector=n(this.modules.languageDetector),a.languageDetector.init(a,this.options.detection,this.options)),this.modules.i18nFormat&&(a.i18nFormat=n(this.modules.i18nFormat),a.i18nFormat.init&&a.i18nFormat.init(this)),this.translator=new q(this.services,this.options),this.translator.on("*",(function(e){for(var r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];t.emit.apply(t,[e].concat(i))})),this.modules.external.forEach((function(e){e.init&&e.init(t)}))}if(this.format=this.options.interpolation.format,r||(r=ft),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&"dev"!==c[0]&&(this.options.lng=c[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var u=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];u.forEach((function(e){t[e]=function(){var r;return(r=t.store)[e].apply(r,arguments)}}));var l=["addResource","addResources","addResourceBundle","removeResourceBundle"];l.forEach((function(e){t[e]=function(){var r;return(r=t.store)[e].apply(r,arguments),t}}));var h=T(),p=function(){var e=function(e,i){t.isInitialized&&!t.initializedStoreOnce&&t.logger.warn("init: i18next is already initialized. You should call init just once!"),t.isInitialized=!0,t.options.isClone||t.logger.log("initialized",t.options),t.emit("initialized",t.options),h.resolve(i),r(e,i)};if(t.languages&&"v1"!==t.options.compatibilityAPI&&!t.isInitialized)return e(null,t.t.bind(t));t.changeLanguage(t.options.lng,e)};return this.options.resources||!this.options.initImmediate?p():setTimeout(p,0),h}},{key:"loadResources",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ft,i=r,n="string"==typeof t?t:this.language;if("function"==typeof t&&(i=t),!this.options.resources||this.options.partialBundledLanguages){if(n&&"cimode"===n.toLowerCase())return i();var s=[],o=function(t){t&&e.services.languageUtils.toResolveHierarchy(t).forEach((function(t){s.indexOf(t)<0&&s.push(t)}))};if(n)o(n);else{var a=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);a.forEach((function(t){return o(t)}))}this.options.preload&&this.options.preload.forEach((function(t){return o(t)})),this.services.backendConnector.load(s,this.options.ns,(function(t){t||e.resolvedLanguage||!e.language||e.setResolvedLanguage(e.language),i(t)}))}else i(null)}},{key:"reloadResources",value:function(t,e,r){var i=T();return t||(t=this.languages),e||(e=this.options.ns),r||(r=ft),this.services.backendConnector.reload(t,e,(function(t){i.resolve(),r(t)})),i}},{key:"use",value:function(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===t.type&&(this.modules.backend=t),("logger"===t.type||t.log&&t.warn&&t.error)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"i18nFormat"===t.type&&(this.modules.i18nFormat=t),"postProcessor"===t.type&&U.addPostProcessor(t),"formatter"===t.type&&(this.modules.formatter=t),"3rdParty"===t.type&&this.modules.external.push(t),this}},{key:"setResolvedLanguage",value:function(t){if(t&&this.languages&&!(["cimode","dev"].indexOf(t)>-1))for(var e=0;e<this.languages.length;e++){var r=this.languages[e];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}},{key:"changeLanguage",value:function(t,e){var r=this;this.isLanguageChangingTo=t;var i=T();this.emit("languageChanging",t);var n=function(t){r.language=t,r.languages=r.services.languageUtils.toResolveHierarchy(t),r.resolvedLanguage=void 0,r.setResolvedLanguage(t)},s=function(s){t||s||!r.services.languageDetector||(s=[]);var o="string"==typeof s?s:r.services.languageUtils.getBestMatchFromCodes(s);o&&(r.language||n(o),r.translator.language||r.translator.changeLanguage(o),r.services.languageDetector&&r.services.languageDetector.cacheUserLanguage(o)),r.loadResources(o,(function(t){!function(t,s){s?(n(s),r.translator.changeLanguage(s),r.isLanguageChangingTo=void 0,r.emit("languageChanged",s),r.logger.log("languageChanged",s)):r.isLanguageChangingTo=void 0,i.resolve((function(){return r.t.apply(r,arguments)})),e&&e(t,(function(){return r.t.apply(r,arguments)}))}(t,o)}))};return t||!this.services.languageDetector||this.services.languageDetector.async?!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(s):s(t):s(this.services.languageDetector.detect()),i}},{key:"getFixedT",value:function(t,r,i){var n=this,s=function t(r,s){var o;if("object"!==e(s)){for(var a=arguments.length,c=new Array(a>2?a-2:0),u=2;u<a;u++)c[u-2]=arguments[u];o=n.options.overloadTranslationOptionHandler([r,s].concat(c))}else o=pt({},s);o.lng=o.lng||t.lng,o.lngs=o.lngs||t.lngs,o.ns=o.ns||t.ns,o.keyPrefix=o.keyPrefix||i||t.keyPrefix;var l=n.options.keySeparator||".",h=o.keyPrefix?"".concat(o.keyPrefix).concat(l).concat(r):r;return n.t(h,o)};return"string"==typeof t?s.lng=t:s.lngs=t,s.ns=r,s.keyPrefix=i,s}},{key:"t",value:function(){var t;return this.translator&&(t=this.translator).translate.apply(t,arguments)}},{key:"exists",value:function(){var t;return this.translator&&(t=this.translator).exists.apply(t,arguments)}},{key:"setDefaultNamespace",value:function(t){this.options.defaultNS=t}},{key:"hasLoadedNamespace",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var i=this.resolvedLanguage||this.languages[0],n=!!this.options&&this.options.fallbackLng,s=this.languages[this.languages.length-1];if("cimode"===i.toLowerCase())return!0;var o=function(t,r){var i=e.services.backendConnector.state["".concat(t,"|").concat(r)];return-1===i||2===i};if(r.precheck){var a=r.precheck(this,o);if(void 0!==a)return a}return!!this.hasResourceBundle(i,t)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!o(i,t)||n&&!o(s,t)))}},{key:"loadNamespaces",value:function(t,e){var r=this,i=T();return this.options.ns?("string"==typeof t&&(t=[t]),t.forEach((function(t){r.options.ns.indexOf(t)<0&&r.options.ns.push(t)})),this.loadResources((function(t){i.resolve(),e&&e(t)})),i):(e&&e(),Promise.resolve())}},{key:"loadLanguages",value:function(t,e){var r=T();"string"==typeof t&&(t=[t]);var i=this.options.preload||[],n=t.filter((function(t){return i.indexOf(t)<0}));return n.length?(this.options.preload=i.concat(n),this.loadResources((function(t){r.resolve(),e&&e(t)})),r):(e&&e(),Promise.resolve())}},{key:"dir",value:function(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(this.services.languageUtils.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ft,i=pt(pt(pt({},this.options),e),{isClone:!0}),n=new o(i);void 0===e.debug&&void 0===e.prefix||(n.logger=n.logger.clone(e));var s=["store","services","language"];return s.forEach((function(e){n[e]=t[e]})),n.services=pt({},this.services),n.services.utils={hasLoadedNamespace:n.hasLoadedNamespace.bind(n)},n.translator=new q(n.services,n.options),n.translator.on("*",(function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];n.emit.apply(n,[t].concat(r))})),n.init(i,r),n.translator.options=n.options,n.translator.backendConnector.services.utils={hasLoadedNamespace:n.hasLoadedNamespace.bind(n)},n}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),o}(v);l(yt,"createInstance",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return new yt(t,e)}));var mt=yt.createInstance();mt.createInstance=yt.createInstance;mt.createInstance,mt.init,mt.loadResources,mt.reloadResources,mt.use,mt.changeLanguage,mt.getFixedT,mt.t,mt.exists,mt.setDefaultNamespace,mt.hasLoadedNamespace,mt.loadNamespaces,mt.loadLanguages;const _t=mt,vt=/^(https?:\/\/.)[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/i;function Tt(t){return vt.test(t)}const Et=/\\(.)/g,bt=/(\\)/g;function xt(t){return t.replace(Et,"$1")}const Ot=Object.getPrototypeOf(_t).constructor,Rt=[];class wt extends Ot{async init(t,e){const r="object"==typeof t?t:{},i="function"==typeof t?t:e;try{const t=await super.init(r),e=this.services.formatter;if(e.add("lowercase",((t,e)=>t.toLocaleLowerCase(e))),e.add("uppercase",((t,e)=>t.toLocaleUpperCase(e))),e.add("upperFirst",((t,e)=>t.charAt(0).toLocaleUpperCase(e)+t.substring(1))),Rt.length&&await this.loadResourceDir(Rt,!1,!0),r?.resourceDirs?.length&&await this.loadResourceDir(r.resourceDirs,!1,!0),r?.resources)for(const t of Object.keys(r.resources)){const e=r.resources[t];for(const r of Object.keys(e))this.addResourceBundle(t,r,e[r],!1,!0)}return i&&i(null,t),t}catch(t){throw i&&i(t,this.t),t}}deep(t,e){if(null==t)return t;const r=new WeakMap;return this._deepTranslate(t,r,e)}registerLocaleDir(...t){Rt.push(...t)}async loadResourceBundle(t,e,r,i,n){let s;if(Tt(r))s=(await fetch(r,{headers:{accept:"application/json"}})).json();else{const t=await Promise.resolve().then(y.t.bind(y,292,19)),e=await t.readFile(r,"utf8");s=JSON.parse(e)}this.addResourceBundle(t,e,s,i,n)}async loadResourceDir(t,e,r){const i=await Promise.resolve().then(y.t.bind(y,292,19)),n=await Promise.resolve().then(y.t.bind(y,17,19));for(const s of Array.isArray(t)?t:[t]){if(!(await i.stat(s)).isDirectory()){console.warn(`Locale directory does not exists. (${s})`);continue}const t=await i.readdir(s);for(const o of t){const t=n.join(s,o);if((await i.stat(t)).isDirectory()){const s=await i.readdir(t);for(const a of s){const s=n.join(t,a),c=n.extname(a);if(".json"===c&&(await i.stat(s)).isFile()){const t=n.basename(a,c);await this.loadResourceBundle(o,t,s,e,r)}}}}}}createInstance(t={},e){return new wt(t,e)}static createInstance(t,e){return new wt(t,e)}_deepTranslate(e,r,i){if(null==e)return e;if(i?.ignore&&i.ignore(e,this))return e;if("object"==typeof e&&r.has(e))return r.get(e);if("string"==typeof e){let r="";for(let n of(0,t.tokenize)(e,{brackets:{"$t(":")"},quotes:!0,keepQuotes:!0,keepBrackets:!0,keepDelimiters:!0}))if(n.startsWith("$t(")&&n.endsWith(")")){n=n.substring(3,n.length-1);const e=(0,t.splitString)(n,{delimiters:"?",quotes:!0,brackets:{"{":"}"}}),s=xt(n.substring((e[0]||"").length+1));n=e[0]||"";const o=[];let a=null;for(const e of(0,t.tokenize)(n,{delimiters:",",quotes:!0,brackets:{"{":"}"}}))e.startsWith("{")?a=JSON.parse(e):o.push(e);const c=o.length>1?"$t("+o.join(",")+")":o[0];r+=s?this.t(c,s,{...i,...a}):this.t(c,{...i,...a})}else r+=n;return r}if(Array.isArray(e)){const t=Array(e.length);r.set(e,t);for(let n=0,s=e.length;n<s;n++)t[n]=this._deepTranslate(e[n],r,i);return r.delete(e),t}if("object"==typeof e){if(Buffer.isBuffer(e))return e;if(Buffer.isBuffer(e)||e instanceof Symbol||e instanceof RegExp||e instanceof Map||e instanceof Set||e instanceof WeakMap||e instanceof WeakSet)return e;const t={};r.set(e,t);const n=Object.keys(e);for(let s=0,o=n.length;s<o;s++){const o=n[s];t[o]=this._deepTranslate(e[o],r,i)}return r.delete(e),t}return e}static get defaultInstance(){return kt}}const kt=wt.createInstance(),St=/(\))/g;function Ct(t,e,r){const i=e&&"object"==typeof e?e:void 0,n="string"==typeof e?e:r;return"$t("+t+(i?","+JSON.stringify(i):"")+(n?"?"+(s=n,s.replace(bt,"\\\\")).replace(St,"\\$1"):"")+")";var s}const At=wt.createInstance();At.init().catch((()=>{}));class It extends Error{_issue;status=500;cause;constructor(t,e){super(""),this._initName(),e&&(this.cause=e,e.stack&&(this.stack=e.stack)),this._init(t||e||"Unknown error"),this.message=At.deep(this.issue.message)}get issue(){return this._issue}setIssue(t){this._issue={message:"Unknown error",severity:"error",...t}}setStatus(t){return this.status=t,this}_initName(){this.name=this.constructor.name}_init(t){t instanceof Error?("number"==typeof t.status?this.status=t.status:"function"==typeof t.getStatus&&(this.status=t.getStatus()),this.setIssue({message:t.message})):"object"==typeof t?this.setIssue(t):this.setIssue({message:String(t)})}}class Lt extends It{status=400;setIssue(t){super.setIssue({message:Ct("error:BAD_REQUEST","Bad request"),severity:"error",code:"BAD_REQUEST",...t})}}class Nt extends It{status=424;setIssue(t){super.setIssue({message:Ct("error:FAILED_DEPENDENCY","The request failed due to failure of a previous request"),severity:"error",code:"FAILED_DEPENDENCY",...t})}}class Pt extends It{status=403;setIssue(t){super.setIssue({message:Ct("error:FORBIDDEN","You are not authorized to perform this action"),severity:"error",code:"FORBIDDEN",...t})}}class Dt extends It{status=405;setIssue(t){super.setIssue({message:Ct("error:METHOD_NOT_ALLOWED","Method not allowed"),severity:"error",code:"METHOD_NOT_ALLOWED",...t})}}class jt extends It{status=406;setIssue(t){super.setIssue({message:Ct("error:NOT_ACCEPTABLE","Not Acceptable"),severity:"error",code:"NOT_ACCEPTABLE",...t})}}class Ft extends It{status=404;setIssue(t){super.setIssue({message:Ct("error:NOT_FOUND","Not found"),severity:"error",code:"NOT_FOUND",...t})}}class Ut extends It{status=401;setIssue(t){super.setIssue({message:Ct("error:UNAUTHORIZED","You have not been authenticated to perform this action"),severity:"error",code:"UNAUTHORIZED",...t})}}class Mt extends It{status=422;setIssue(t){super.setIssue({message:Ct("error:UNPROCESSABLE_ENTITY","Unprocessable entity"),severity:"error",code:"UNPROCESSABLE_ENTITY",...t})}}function Ht(t){if(t instanceof It)return t;let e=500;switch("number"==typeof t.status?e=t.status:"function"==typeof t.getStatus&&(e=t.getStatus()),e){case 400:return new Lt(t);case 401:return new Ut(t);case 403:return new Pt(t);case 404:return new Ft(t);case 405:return new Dt(t);case 406:return new jt(t);case 422:return new Mt(t);default:return new Nt(t)}}var $t;!function(t){let e;!function(t){t.fatal="fatal",t.error="error",t.warning="warning",t.info="info"}(e=t.Enum||(t.Enum={})),t.name="IssueSeverity",t.description="Severity of the issue",t.Keys=Object.keys(t),t.descriptions={fatal:"The issue caused the action to fail and no further checking could be performed",error:"The issue is sufficiently important to cause the action to fail",warning:"The issue is not important enough to cause the action to fail but may cause it to be performed suboptimally or in a way that is not as desired",info:"The issue has no relation to the degree of success of the action"}}($t||($t={}));class Bt extends It{status=500;setIssue(t){super.setIssue({message:Ct("error:INTERNAL_SERVER_ERROR","Internal server error"),severity:"error",code:"INTERNAL_SERVER_ERROR",...t})}}class qt extends It{status=409;constructor(t,e,r){super({message:Ct("error:RESOURCE_CONFLICT",{resource:t,fields:e},"There is already an other {{resource}} resource with same field values ({{fields}})"),severity:"error",code:"RESOURCE_CONFLICT",details:{resource:t,location:e}},r)}}class Vt extends It{constructor(t,e,r){super({message:Ct("error:RESOURCE_NOT_FOUND",{resource:t+(e?"@"+e:"")},"The resource '{{resource}}' could not be found"),severity:"error",code:"RESOURCE_NOT_FOUND",details:{resource:t,key:e}},r),this.status=404}}class zt{kind;constructor(){this.kind=Object.getPrototypeOf(this).constructor.name}}class Gt extends zt{}class Kt extends Gt{}class Wt extends Kt{constructor(t){super(),this.value=t}toString(){return""+this.value}}class Qt extends Gt{items=[];constructor(){super()}append(t,e){return this.items.push(new Yt({op:t,expression:e})),this}toString(){return this.items.map(((t,e)=>(e>0?t.op:"")+t.expression)).join("")}}class Yt{op;expression;constructor(t){Object.assign(this,t)}}class Xt extends Kt{items;constructor(t){super(),this.items=t}toString(){return"["+this.items.map((t=>""+t)).join(",")+"]"}}const Jt=/\w/;class Zt extends Gt{op;left;right;constructor(t){super(),Object.assign(this,t)}toString(){return`${this.left}${Jt.test(this.op)?" "+this.op+" ":this.op}${this.right}`}}class te extends Gt{op;items;constructor(t){super(),Object.assign(this,t)}toString(){return this.items.map((t=>""+t)).join(" "+this.op+" ")}}class ee extends Gt{expression;constructor(t){super(),this.expression=t}toString(){return`(${this.expression})`}}class re extends Wt{constructor(t){super(t)}}var ie=y(985);class ne extends TypeError{}class se extends TypeError{}class oe extends Error{recognizer;offendingSymbol;line;charPositionInLine;e;constructor(t,e){super(t),Object.assign(this,e)}}const ae=/'/g,ce=/(\\)/g,ue=/\\(.)/g;function le(t){return"'"+function(t){return t.replace(ce,"\\\\")}(t).replace(ae,"\\'")+"'"}function he(t){return t&&(t.startsWith("'")||t.startsWith('"'))&&t.endsWith(t.charAt(0))?function(t){return t.replace(ue,"$1")}(t.substring(1,t.length-1)):t}const pe=/^(\d{4})-(0[1-9]|1[012])-([123]0|[012][1-9]|31)/;class de extends Wt{value;constructor(t){if(super(""),t instanceof Date)this.value=t.toISOString();else{if("string"!=typeof t||!pe.test(t)||!ie.DateTime.fromISO(t).isValid)throw new se(`Invalid date value "${t}"`);this.value=t}}toString(){return le(this.value)}}class fe extends Wt{value=null;constructor(){super(null)}}class ge extends Wt{value;constructor(t){if(super(0),"number"!=typeof t&&"bigint"!=typeof t){try{if("string"==typeof t){if(t.includes("."))return void(this.value=parseFloat(t));const e=Number(t);return void(this.value=""+e===t?e:BigInt(t))}}catch{}throw new se(`Invalid number literal ${t}`)}this.value=t}toString(){return"bigint"==typeof this.value?(""+this.value).replace(/n$/,""):""+this.value}}class ye extends Wt{constructor(t){super(""+t)}}class me extends Wt{constructor(t){super(""+t)}toString(){return le(this.value)}}const _e=/^([01]\d|2[0-3]):([0-5]\d)(:[0-5]\d)?(\.(\d+))?$/;class ve extends Wt{value;constructor(t){if(super(""),t instanceof Date)this.value=Te(t.getHours())+":"+Te(t.getMinutes())+(t.getSeconds()?":"+Te(t.getSeconds()):"")+(t.getMilliseconds()?"."+Te(t.getMilliseconds()):"");else{if("string"!=typeof t||!_e.test(t))throw new se(`Invalid time value "${t}"`);this.value=t}}toString(){return le(this.value)}}function Te(t){return t<=9?"0"+t:""+t}const Ee=require("http://unpkg.com/antlr4ts@0.5.0-alpha.4"),be=require("http://unpkg.com/antlr4ts@0.5.0-alpha.4/atn/ATNDeserializer"),xe=require("http://unpkg.com/antlr4ts@0.5.0-alpha.4/Lexer"),Oe=require("http://unpkg.com/antlr4ts@0.5.0-alpha.4/atn/LexerATNSimulator"),Re=require("http://unpkg.com/antlr4ts@0.5.0-alpha.4/VocabularyImpl"),we=require("http://unpkg.com/antlr4ts@0.5.0-alpha.4/misc/Utils");class ke extends xe.Lexer{static T__0=1;static T__1=2;static T__2=3;static T__3=4;static T__4=5;static T__5=6;static T__6=7;static T__7=8;static T__8=9;static T__9=10;static T__10=11;static T__11=12;static T__12=13;static T__13=14;static T__14=15;static T__15=16;static T__16=17;static T__17=18;static T__18=19;static T__19=20;static T__20=21;static T__21=22;static T__22=23;static T__23=24;static T__24=25;static T__25=26;static T__26=27;static T__27=28;static T__28=29;static T__29=30;static T__30=31;static T__31=32;static T__32=33;static T__33=34;static T__34=35;static T__35=36;static T__36=37;static T__37=38;static T__38=39;static T__39=40;static T__40=41;static T__41=42;static T__42=43;static T__43=44;static T__44=45;static T__45=46;static DATE=47;static DATETIME=48;static TIME=49;static IDENTIFIER=50;static STRING=51;static NUMBER=52;static INTEGER=53;static WHITESPACE=54;static COMMENT=55;static LINE_COMMENT=56;static channelNames=["DEFAULT_TOKEN_CHANNEL","HIDDEN"];static modeNames=["DEFAULT_MODE"];static ruleNames=["T__0","T__1","T__2","T__3","T__4","T__5","T__6","T__7","T__8","T__9","T__10","T__11","T__12","T__13","T__14","T__15","T__16","T__17","T__18","T__19","T__20","T__21","T__22","T__23","T__24","T__25","T__26","T__27","T__28","T__29","T__30","T__31","T__32","T__33","T__34","T__35","T__36","T__37","T__38","T__39","T__40","T__41","T__42","T__43","T__44","T__45","DATE","DATETIME","TIME","IDENTIFIER","STRING","NUMBER","INTEGER","WHITESPACE","COMMENT","LINE_COMMENT","NUMBERFORMAT","INTEGERFORMAT","DATEFORMAT","TIMEFORMAT","TIMEZONEOFFSETFORMAT","ESC","UNICODE","HEX"];static _LITERAL_NAMES=[void 0,"'('","')'","'['","','","']'","'year'","'month'","'week'","'day'","'hour'","'minute'","'second'","'millisecond'","'years'","'months'","'weeks'","'days'","'hours'","'minutes'","'seconds'","'milliseconds'","'.'","'@'","'<='","'<'","'>'","'>='","'='","'!='","'in'","'!in'","'like'","'!like'","'ilike'","'!ilike'","'+'","'-'","'*'","'/'","'and'","'or'","'true'","'false'","'null'","'Infinity'","'infinity'"];static _SYMBOLIC_NAMES=[void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,"DATE","DATETIME","TIME","IDENTIFIER","STRING","NUMBER","INTEGER","WHITESPACE","COMMENT","LINE_COMMENT"];static VOCABULARY=new Re.VocabularyImpl(ke._LITERAL_NAMES,ke._SYMBOLIC_NAMES,[]);get vocabulary(){return ke.VOCABULARY}constructor(t){super(t),this._interp=new Oe.LexerATNSimulator(ke._ATN,this)}get grammarFileName(){return"OpraFilter.g4"}get ruleNames(){return ke.ruleNames}get serializedATN(){return ke._serializedATN}get channelNames(){return ke.channelNames}get modeNames(){return ke.modeNames}static _serializedATN='줝쪺֍꾺体؇쉁:Ț\b\t\t\t\t\t\t\b\t\b\t\t\t\n\t\n\v\t\v\f\t\f\r\t\r\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t !\t!"\t"#\t#$\t$%\t%&\t&\'\t\'(\t()\t)*\t*+\t+,\t,-\t-.\t./\t/0\t01\t12\t23\t34\t45\t56\t67\t78\t89\t9:\t:;\t;<\t<=\t=>\t>?\t?@\t@A\tA\b\b\b\b\b\b\t\t\t\t\t\n\n\n\n\v\v\v\v\v\f\f\f\f\f\f\f\r\r\r\r\r\r\r !!!!!""""""######$$$$$$$%%&&\'\'(())))***+++++,,,,,,-----........./////////000000000ŧ\n0111111111111111ŷ\n1222222222Ɓ\n2333ƅ\n3\f33ƈ\v34444ƍ\n4\f44Ɛ\v444444Ɩ\n4\f44ƙ\v444Ɯ\n4556677ƣ\n7\r77Ƥ7788888ƭ\n8\f88ư\v88888899999ƻ\n9\f99ƾ\v999::ǃ\n:\r::DŽ:::lj\n:\r::NJ:Ǎ\n:;;<<<<<<<<<<ǚ\n<<<<<<<<<ǣ\n<=====ǩ\n============ǵ\n=\r==Ƕ=ǹ\n==ǻ\n=>>>>Ȁ\n>>>>>ȅ\n>>>>>Ȋ\n>>Ȍ\n>????ȑ\n?@@@@@@AAƮB\t\v\r\b\t\n\v\f\r!#%\')+-/13579;= ?!A"C#E$G%I&K\'M(O)Q*S+U,W-Y.[/]0_1a2c3e4g5i6k7m8o9q:suwy{}&&C\\aac|&&2;C\\aac|))$$\v\f""\f\f2;223;332435232527--//2;CHchȬ\t\v\r!#%\')+-/13579;=?ACEGIKMOQSUWY[]_acegikmoq
\t\v\r¡¦´ÀÆ!Í#Ó%Ø\'Þ)æ+î-û/ý1ÿ3Ă5Ą7Ć9ĉ;ċ=Ď?đAĕCĚEĠGĦIĭKįMıOijQĵSĹUļWŁYŇ[Ō]ŕ_ŦaŶcƀeƂgƛiƝkƟmƢoƨqƶsǂuǎwǐyǨ{ȋ}ȍȒȘ*
+]\b.\n_\f{gctoqpvjyggmfc { ¡¢j¢£q£¤w¤¥t¥¦§o§¨k¨©p©ªwª«v«¬g¬®u®¯g¯°e°±q±²p²³f³´µoµ¶k¶·n·¸n¸¹k¹ºuº»g»¼e¼½q½¾p¾¿f¿ÀÁ{ÁÂgÂÃcÃÄtÄÅuÅÆÇoÇÈqÈÉpÉÊvÊËjËÌuÌ ÍÎyÎÏgÏÐgÐÑmÑÒuÒ"ÓÔfÔÕcÕÖ{Ö×u×$ØÙjÙÚqÚÛwÛÜtÜÝuÝ&Þßoßàkàápáâwâãvãägäåuå(æçuçègèéeéêqêëpëìfìíuí*îïoïðkðñnñònòókóôuôõgõöeö÷q÷øpøùfùúuú,ûü0ü.ýþBþ0ÿĀ>Āā?ā2Ăă>ă4Ąą@ą6Ćć@ćĈ?Ĉ8ĉĊ?Ċ:ċČ#Čč?č<ĎďkďĐpĐ>đĒ#ĒēkēĔpĔ@ĕĖnĖėkėĘmĘęgęBĚě#ěĜnĜĝkĝĞmĞğgğDĠġkġĢnĢģkģĤmĤĥgĥFĦħ#ħĨkĨĩnĩĪkĪīmīĬgĬHĭĮ-ĮJįİ/İLıIJ,IJNijĴ1ĴPĵĶcĶķpķĸfĸRĹĺqĺĻtĻTļĽvĽľtľĿwĿŀgŀVŁłhłŃcŃńnńŅuŅņgņXŇňpňʼnwʼnŊnŊŋnŋZŌōKōŎpŎŏhŏŐkŐőpőŒkŒœvœŔ{Ŕ\\ŕŖkŖŗpŗŘhŘřkřŚpŚśkśŜvŜŝ{ŝ^Şş)şŠw<Šš)šŧŢţ$ţŤw<Ťť$ťŧŦŞŦŢŧ`Ũũ)ũŪw<ŪūVūŬy=Ŭŭ{>ŭŮ)ŮŷůŰ$Űűw<űŲVŲųy=ųŴ{>Ŵŵ$ŵŷŶŨŶůŷbŸŹ)Źźy=źŻ)ŻƁżŽ$Žžy=žſ$ſƁƀŸƀżƁdƂƆ\tƃƅ\tƄƃƅƈƆƄƆƇƇfƈƆƉƎ)Ɗƍ}?Ƌƍ\nƌƊƌƋƍƐƎƌƎƏƏƑƐƎƑƜ)ƒƗ$ƓƖ}?ƔƖ\nƕƓƕƔƖƙƗƕƗƘƘƚƙƗƚƜ$ƛƉƛƒƜhƝƞs:ƞjƟƠu;Ơlơƣ\tƢơƣƤƤƢƤƥƥƦƦƧ\b7ƧnƨƩ1Ʃƪ,ƪƮƫƭ\vƬƫƭưƮƯƮƬƯƱưƮƱƲ,ƲƳ1ƳƴƴƵ\b8ƵpƶƷ1ƷƸ1ƸƼƹƻ\nƺƹƻƾƼƺƼƽƽƿƾƼƿǀ\b9ǀrǁǃ\t\bǂǁǃDŽDŽǂDŽDžDžnjdžLj0LJlj\t\bLjLJljNJNJLjNJNjNjǍnjdžnjǍǍtǎǏ\t\bǏvǐǑ\t\bǑǒ\t\bǒǓ\t\bǓǔ\t\bǔǙ/Ǖǖ\t\tǖǚ\t\nǗǘ\t\vǘǚ\t\fǙǕǙǗǚǛǛǢ/ǜǝ\t\rǝǣ\t\tǞǟ\t\fǟǣ\t\nǠǡ5ǡǣ3ǢǜǢǞǢǠǣxǤǥ\tǥǩ\t\bǦǧ4ǧǩ\tǨǤǨǦǩǪǪǫ<ǫǬ\tǬǭ\t\bǭǺǮǯ<ǯǰ\tǰDZ\t\bDZǸDzǴ0dzǵ\t\bǴdzǵǶǶǴǶǷǷǹǸDzǸǹǹǻǺǮǺǻǻzǼȌ\\ǽȄ\tǾȀ\tǿǾǿȀȀȁȁȅ\t\bȂȃ4ȃȅ\tȄǿȄȂȅȉȆȇ<ȇȈ\tȈȊ\t\bȉȆȉȊȊȌȋǼȋǽȌ|ȍȐ^Ȏȑ@ȏȑ\vȐȎȐȏȑ~ȒȓwȓȔAȔȕAȕȖAȖȗAȗȘș\tșŦŶƀƆƌƎƕƗƛƤƮƼDŽNJnjǙǢǨǶǸǺǿȄȉȋȐ';static __ATN;static get _ATN(){return ke.__ATN||(ke.__ATN=(new be.ATNDeserializer).deserialize(we.toCharArray(ke._serializedATN))),ke.__ATN}}const Se=require("http://unpkg.com/antlr4ts@0.5.0-alpha.4/atn/ATN"),Ce=require("http://unpkg.com/antlr4ts@0.5.0-alpha.4/FailedPredicateException"),Ae=require("http://unpkg.com/antlr4ts@0.5.0-alpha.4/NoViableAltException"),Ie=require("http://unpkg.com/antlr4ts@0.5.0-alpha.4/Parser"),Le=require("http://unpkg.com/antlr4ts@0.5.0-alpha.4/ParserRuleContext"),Ne=require("http://unpkg.com/antlr4ts@0.5.0-alpha.4/atn/ParserATNSimulator"),Pe=require("http://unpkg.com/antlr4ts@0.5.0-alpha.4/RecognitionException"),De=require("http://unpkg.com/antlr4ts@0.5.0-alpha.4/Token");class je extends Ie.Parser{static T__0=1;static T__1=2;static T__2=3;static T__3=4;static T__4=5;static T__5=6;static T__6=7;static T__7=8;static T__8=9;static T__9=10;static T__10=11;static T__11=12;static T__12=13;static T__13=14;static T__14=15;static T__15=16;static T__16=17;static T__17=18;static T__18=19;static T__19=20;static T__20=21;static T__21=22;static T__22=23;static T__23=24;static T__24=25;static T__25=26;static T__26=27;static T__27=28;static T__28=29;static T__29=30;static T__30=31;static T__31=32;static T__32=33;static T__33=34;static T__34=35;static T__35=36;static T__36=37;static T__37=38;static T__38=39;static T__39=40;static T__40=41;static T__41=42;static T__42=43;static T__43=44;static T__44=45;static T__45=46;static DATE=47;static DATETIME=48;static TIME=49;static IDENTIFIER=50;static STRING=51;static NUMBER=52;static INTEGER=53;static WHITESPACE=54;static COMMENT=55;static LINE_COMMENT=56;static RULE_root=0;static RULE_expression=1;static RULE_term=2;static RULE_invocable=3;static RULE_invocation=4;static RULE_indexer=5;static RULE_function=6;static RULE_paramList=7;static RULE_unit=8;static RULE_dateTimePrecision=9;static RULE_pluralDateTimePrecision=10;static RULE_qualifiedIdentifier=11;static RULE_externalConstant=12;static RULE_identifier=13;static RULE_literal=14;static RULE_compOp=15;static RULE_arthOp=16;static RULE_polarOp=17;static RULE_logOp=18;static RULE_boolean=19;static RULE_null=20;static RULE_infinity=21;static ruleNames=["root","expression","term","invocable","invocation","indexer","function","paramList","unit","dateTimePrecision","pluralDateTimePrecision","qualifiedIdentifier","externalConstant","identifier","literal","compOp","arthOp","polarOp","logOp","boolean","null","infinity"];static _LITERAL_NAMES=[void 0,"'('","')'","'['","','","']'","'year'","'month'","'week'","'day'","'hour'","'minute'","'second'","'millisecond'","'years'","'months'","'weeks'","'days'","'hours'","'minutes'","'seconds'","'milliseconds'","'.'","'@'","'<='","'<'","'>'","'>='","'='","'!='","'in'","'!in'","'like'","'!like'","'ilike'","'!ilike'","'+'","'-'","'*'","'/'","'and'","'or'","'true'","'false'","'null'","'Infinity'","'infinity'"];static _SYMBOLIC_NAMES=[void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,"DATE","DATETIME","TIME","IDENTIFIER","STRING","NUMBER","INTEGER","WHITESPACE","COMMENT","LINE_COMMENT"];static VOCABULARY=new Re.VocabularyImpl(je._LITERAL_NAMES,je._SYMBOLIC_NAMES,[]);get vocabulary(){return je.VOCABULARY}get grammarFileName(){return"OpraFilter.g4"}get ruleNames(){return je.ruleNames}get serializedATN(){return je._serializedATN}createFailedPredicateException(t,e){return new Ce.FailedPredicateException(this,t,e)}constructor(t){super(t),this._interp=new Ne.ParserATNSimulator(je._ATN,this)}root(){let t=new Fe(this._ctx,this.state);this.enterRule(t,0,je.RULE_root);try{this.enterOuterAlt(t,1),this.state=44,this.expression(0),this.state=45,this.match(je.EOF)}catch(e){if(!(e instanceof Pe.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}expression(t){void 0===t&&(t=0);let e,r=this._ctx,i=this.state,n=new Ue(this._ctx,i),s=n;this.enterRecursionRule(n,2,je.RULE_expression,t);try{let t;switch(this.enterOuterAlt(n,1),this.state=67,this._errHandler.sync(this),this._input.LA(1)){case je.T__22:case je.T__41:case je.T__42:case je.T__43:case je.T__44:case je.T__45:case je.DATE:case je.DATETIME:case je.TIME:case je.IDENTIFIER:case je.STRING:case je.NUMBER:n=new Me(n),this._ctx=n,s=n,this.state=48,this.term();break;case je.T__35:case je.T__36:n=new He(n),this._ctx=n,s=n,this.state=49,this.polarOp(),this.state=50,this.expression(6);break;case je.T__0:n=new Ve(n),this._ctx=n,s=n,this.state=52,this.match(je.T__0),this.state=53,this.expression(0),this.state=54,this.match(je.T__1);break;case je.T__2:for(n=new ze(n),this._ctx=n,s=n,this.state=56,this.match(je.T__2),this.state=57,this.expression(0),this.state=62,this._errHandler.sync(this),e=this._input.LA(1);e===je.T__3;)this.state=58,this.match(je.T__3),this.state=59,this.expression(0),this.state=64,this._errHandler.sync(this),e=this._input.LA(1);this.state=65,this.match(je.T__4);break;default:throw new Ae.NoViableAltException(this)}for(this._ctx._stop=this._input.tryLT(-1),this.state=83,this._errHandler.sync(this),t=this.interpreter.adaptivePredict(this._input,3,this._ctx);2!==t&&t!==Se.ATN.INVALID_ALT_NUMBER;){if(1===t)switch(null!=this._parseListeners&&this.triggerExitRuleEvent(),s=n,this.state=81,this._errHandler.sync(this),this.interpreter.adaptivePredict(this._input,2,this._ctx)){case 1:if(n=new $e(new Ue(r,i)),this.pushNewRecursionContext(n,2,je.RULE_expression),this.state=69,!this.precpred(this._ctx,5))throw this.createFailedPredicateException("this.precpred(this._ctx, 5)");this.state=70,this.arthOp(),this.state=71,this.expression(6);break;case 2:if(n=new Be(new Ue(r,i)),this.pushNewRecursionContext(n,2,je.RULE_expression),this.state=73,!this.precpred(this._ctx,4))throw this.createFailedPredicateException("this.precpred(this._ctx, 4)");this.state=74,this.compOp(),this.state=75,this.expression(5);break;case 3:if(n=new qe(new Ue(r,i)),this.pushNewRecursionContext(n,2,je.RULE_expression),this.state=77,!this.precpred(this._ctx,3))throw this.createFailedPredicateException("this.precpred(this._ctx, 3)");this.state=78,this.logOp(),this.state=79,this.expression(4)}this.state=85,this._errHandler.sync(this),t=this.interpreter.adaptivePredict(this._input,3,this._ctx)}}catch(t){if(!(t instanceof Pe.RecognitionException))throw t;n.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.unrollRecursionContexts(r)}return n}term(){let t=new Ge(this._ctx,this.state);this.enterRule(t,4,je.RULE_term);try{switch(this.state=89,this._errHandler.sync(this),this._input.LA(1)){case je.T__41:case je.T__42:case je.T__43:case je.T__44:case je.T__45:case je.DATE:case je.DATETIME:case je.TIME:case je.STRING:case je.NUMBER:t=new Ke(t),this.enterOuterAlt(t,1),this.state=86,this.literal();break;case je.IDENTIFIER:t=new We(t),this.enterOuterAlt(t,2),this.state=87,this.qualifiedIdentifier();break;case je.T__22:t=new Qe(t),this.enterOuterAlt(t,3),this.state=88,this.externalConstant();break;default:throw new Ae.NoViableAltException(this)}}catch(e){if(!(e instanceof Pe.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}invocable(){let t=new Ye(this._ctx,this.state);this.enterRule(t,6,je.RULE_invocable);try{this.enterOuterAlt(t,1),this.state=91,this.function()}catch(e){if(!(e instanceof Pe.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}invocation(){let t=new Xe(this._ctx,this.state);this.enterRule(t,8,je.RULE_invocation);try{t=new Je(t),this.enterOuterAlt(t,1),this.state=93,this.identifier()}catch(e){if(!(e instanceof Pe.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}indexer(){let t=new Ze(this._ctx,this.state);this.enterRule(t,10,je.RULE_indexer);try{switch(this.state=97,this._errHandler.sync(this),this._input.LA(1)){case je.IDENTIFIER:t=new tr(t),this.enterOuterAlt(t,1),this.state=95,this.identifier();break;case je.INTEGER:t=new er(t),this.enterOuterAlt(t,2),this.state=96,this.match(je.INTEGER);break;default:throw new Ae.NoViableAltException(this)}}catch(e){if(!(e instanceof Pe.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}function(){let t,e=new rr(this._ctx,this.state);this.enterRule(e,12,je.RULE_function);try{this.enterOuterAlt(e,1),this.state=99,this.identifier(),this.state=100,this.match(je.T__0),this.state=102,this._errHandler.sync(this),t=this._input.LA(1),(0==(-32&t)&&0!=(1<<t&(1<<je.T__0|1<<je.T__2|1<<je.T__22))||0==(t-36&-32)&&0!=(1<<t-36&(1<<je.T__35-36|1<<je.T__36-36|1<<je.T__41-36|1<<je.T__42-36|1<<je.T__43-36|1<<je.T__44-36|1<<je.T__45-36|1<<je.DATE-36|1<<je.DATETIME-36|1<<je.TIME-36|1<<je.IDENTIFIER-36|1<<je.STRING-36|1<<je.NUMBER-36)))&&(this.state=101,this.paramList()),this.state=104,this.match(je.T__1)}catch(t){if(!(t instanceof Pe.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}paramList(){let t,e=new ir(this._ctx,this.state);this.enterRule(e,14,je.RULE_paramList);try{for(this.enterOuterAlt(e,1),this.state=106,this.expression(0),this.state=111,this._errHandler.sync(this),t=this._input.LA(1);t===je.T__3;)this.state=107,this.match(je.T__3),this.state=108,this.expression(0),this.state=113,this._errHandler.sync(this),t=this._input.LA(1)}catch(t){if(!(t instanceof Pe.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}unit(){let t=new nr(this._ctx,this.state);this.enterRule(t,16,je.RULE_unit);try{switch(this.state=117,this._errHandler.sync(this),this._input.LA(1)){case je.T__5:case je.T__6:case je.T__7:case je.T__8:case je.T__9:case je.T__10:case je.T__11:case je.T__12:this.enterOuterAlt(t,1),this.state=114,this.dateTimePrecision();break;case je.T__13:case je.T__14:case je.T__15:case je.T__16:case je.T__17:case je.T__18:case je.T__19:case je.T__20:this.enterOuterAlt(t,2),this.state=115,this.pluralDateTimePrecision();break;case je.STRING:this.enterOuterAlt(t,3),this.state=116,this.match(je.STRING);break;default:throw new Ae.NoViableAltException(this)}}catch(e){if(!(e instanceof Pe.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}dateTimePrecision(){let t,e=new sr(this._ctx,this.state);this.enterRule(e,18,je.RULE_dateTimePrecision);try{this.enterOuterAlt(e,1),this.state=119,t=this._input.LA(1),0!=(-32&t)||0==(1<<t&(1<<je.T__5|1<<je.T__6|1<<je.T__7|1<<je.T__8|1<<je.T__9|1<<je.T__10|1<<je.T__11|1<<je.T__12))?this._errHandler.recoverInline(this):(this._input.LA(1)===De.Token.EOF&&(this.matchedEOF=!0),this._errHandler.reportMatch(this),this.consume())}catch(t){if(!(t instanceof Pe.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}pluralDateTimePrecision(){let t,e=new or(this._ctx,this.state);this.enterRule(e,20,je.RULE_pluralDateTimePrecision);try{this.enterOuterAlt(e,1),this.state=121,t=this._input.LA(1),0!=(-32&t)||0==(1<<t&(1<<je.T__13|1<<je.T__14|1<<je.T__15|1<<je.T__16|1<<je.T__17|1<<je.T__18|1<<je.T__19|1<<je.T__20))?this._errHandler.recoverInline(this):(this._input.LA(1)===De.Token.EOF&&(this.matchedEOF=!0),this._errHandler.reportMatch(this),this.consume())}catch(t){if(!(t instanceof Pe.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}qualifiedIdentifier(){let t=new ar(this._ctx,this.state);this.enterRule(t,22,je.RULE_qualifiedIdentifier);try{let e;for(this.enterOuterAlt(t,1),this.state=128,this._errHandler.sync(this),e=this.interpreter.adaptivePredict(this._input,9,this._ctx);2!==e&&e!==Se.ATN.INVALID_ALT_NUMBER;)1===e&&(this.state=123,this.identifier(),this.state=124,this.match(je.T__21)),this.state=130,this._errHandler.sync(this),e=this.interpreter.adaptivePredict(this._input,9,this._ctx);this.state=131,this.identifier()}catch(e){if(!(e instanceof Pe.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}externalConstant(){let t,e=new cr(this._ctx,this.state);this.enterRule(e,24,je.RULE_externalConstant);try{this.enterOuterAlt(e,1),this.state=133,this.match(je.T__22),this.state=134,t=this._input.LA(1),t!==je.IDENTIFIER&&t!==je.STRING?this._errHandler.recoverInline(this):(this._input.LA(1)===De.Token.EOF&&(this.matchedEOF=!0),this._errHandler.reportMatch(this),this.consume())}catch(t){if(!(t instanceof Pe.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}identifier(){let t=new ur(this._ctx,this.state);this.enterRule(t,26,je.RULE_identifier);try{this.enterOuterAlt(t,1),this.state=136,this.match(je.IDENTIFIER)}catch(e){if(!(e instanceof Pe.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}literal(){let t=new lr(this._ctx,this.state);this.enterRule(t,28,je.RULE_literal);try{switch(this.state=146,this._errHandler.sync(this),this._input.LA(1)){case je.NUMBER:t=new hr(t),this.enterOuterAlt(t,1),this.state=138,this.match(je.NUMBER);break;case je.T__44:case je.T__45:t=new pr(t),this.enterOuterAlt(t,2),this.state=139,this.infinity();break;case je.T__41:case je.T__42:t=new dr(t),this.enterOuterAlt(t,3),this.state=140,this.boolean();break;case je.T__43:t=new fr(t),this.enterOuterAlt(t,4),this.state=141,this.null();break;case je.DATE:t=new gr(t),this.enterOuterAlt(t,5),this.state=142,this.match(je.DATE);break;case je.DATETIME:t=new yr(t),this.enterOuterAlt(t,6),this.state=143,this.match(je.DATETIME);break;case je.TIME:t=new mr(t),this.enterOuterAlt(t,7),this.state=144,this.match(je.TIME);break;case je.STRING:t=new _r(t),this.enterOuterAlt(t,8),this.state=145,this.match(je.STRING);break;default:throw new Ae.NoViableAltException(this)}}catch(e){if(!(e instanceof Pe.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}compOp(){let t,e=new vr(this._ctx,this.state);this.enterRule(e,30,je.RULE_compOp);try{this.enterOuterAlt(e,1),this.state=148,t=this._input.LA(1),0!=(t-24&-32)||0==(1<<t-24&(1<<je.T__23-24|1<<je.T__24-24|1<<je.T__25-24|1<<je.T__26-24|1<<je.T__27-24|1<<je.T__28-24|1<<je.T__29-24|1<<je.T__30-24|1<<je.T__31-24|1<<je.T__32-24|1<<je.T__33-24|1<<je.T__34-24))?this._errHandler.recoverInline(this):(this._input.LA(1)===De.Token.EOF&&(this.matchedEOF=!0),this._errHandler.reportMatch(this),this.consume())}catch(t){if(!(t instanceof Pe.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}arthOp(){let t,e=new Tr(this._ctx,this.state);this.enterRule(e,32,je.RULE_arthOp);try{this.enterOuterAlt(e,1),this.state=150,t=this._input.LA(1),0!=(t-36&-32)||0==(1<<t-36&(1<<je.T__35-36|1<<je.T__36-36|1<<je.T__37-36|1<<je.T__38-36))?this._errHandler.recoverInline(this):(this._input.LA(1)===De.Token.EOF&&(this.matchedEOF=!0),this._errHandler.reportMatch(this),this.consume())}catch(t){if(!(t instanceof Pe.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}polarOp(){let t,e=new Er(this._ctx,this.state);this.enterRule(e,34,je.RULE_polarOp);try{this.enterOuterAlt(e,1),this.state=152,t=this._input.LA(1),t!==je.T__35&&t!==je.T__36?this._errHandler.recoverInline(this):(this._input.LA(1)===De.Token.EOF&&(this.matchedEOF=!0),this._errHandler.reportMatch(this),this.consume())}catch(t){if(!(t instanceof Pe.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}logOp(){let t,e=new br(this._ctx,this.state);this.enterRule(e,36,je.RULE_logOp);try{this.enterOuterAlt(e,1),this.state=154,t=this._input.LA(1),t!==je.T__39&&t!==je.T__40?this._errHandler.recoverInline(this):(this._input.LA(1)===De.Token.EOF&&(this.matchedEOF=!0),this._errHandler.reportMatch(this),this.consume())}catch(t){if(!(t instanceof Pe.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}boolean(){let t,e=new xr(this._ctx,this.state);this.enterRule(e,38,je.RULE_boolean);try{this.enterOuterAlt(e,1),this.state=156,t=this._input.LA(1),t!==je.T__41&&t!==je.T__42?this._errHandler.recoverInline(this):(this._input.LA(1)===De.Token.EOF&&(this.matchedEOF=!0),this._errHandler.reportMatch(this),this.consume())}catch(t){if(!(t instanceof Pe.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}null(){let t=new Or(this._ctx,this.state);this.enterRule(t,40,je.RULE_null);try{this.enterOuterAlt(t,1),this.state=158,this.match(je.T__43)}catch(e){if(!(e instanceof Pe.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}infinity(){let t,e=new Rr(this._ctx,this.state);this.enterRule(e,42,je.RULE_infinity);try{this.enterOuterAlt(e,1),this.state=160,t=this._input.LA(1),t!==je.T__44&&t!==je.T__45?this._errHandler.recoverInline(this):(this._input.LA(1)===De.Token.EOF&&(this.matchedEOF=!0),this._errHandler.reportMatch(this),this.consume())}catch(t){if(!(t instanceof Pe.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}sempred(t,e,r){return 1!==e||this.expression_sempred(t,r)}expression_sempred(t,e){switch(e){case 0:return this.precpred(this._ctx,5);case 1:return this.precpred(this._ctx,4);case 2:return this.precpred(this._ctx,3)}return!0}static _serializedATN='줝쪺֍꾺体؇쉁:¥\t\t\t\t\t\t\b\t\b\t\t\t\n\t\n\v\t\v\f\t\f\r\t\r\t\t\t\t\t\t\t\t\t\t?\n\fB\vF\nT\n\fW\v\\\nd\n\b\b\b\bi\n\b\b\b\t\t\t\tp\n\t\f\t\ts\v\t\n\n\n\nx\n\n\v\v\f\f\r\r\r\r\n\r\f\r\r\v\r\r\r\n\b\n\f "$&(*,\v\b45%&)&\'*+,-/0¤.E[\b]\n_\fcelwy{ "$&(* ,¢.//0012\b2F34$45\b5F6778899F:;;@<==?><?B@>@AACB@CDDFE1E3E6E:FUGH\fHI"IJ\bJTKL\fLM MNNTOP\fPQ&QRRTSGSKSOTWUSUVVWUX\\Y\\\rZ\\[X[Y[Z\\]^\b^\t_``\vadbd7cacbd\reffhgi\thghiijjkklqmnnpompsqoqrrsqtx\vux\fvx5wtwuwvxyz\tz{|\t|}~~}
\t46,(*1235\t!\t#\t%\t\b\'\t\t) ¡.¡+¢£\t\n£-\r@ESU[chqw';static __ATN;static get _ATN(){return je.__ATN||(je.__ATN=(new be.ATNDeserializer).deserialize(we.toCharArray(je._serializedATN))),je.__ATN}}class Fe extends Le.ParserRuleContext{expression(){return this.getRuleContext(0,Ue)}EOF(){return this.getToken(je.EOF,0)}constructor(t,e){super(t,e)}get ruleIndex(){return je.RULE_root}accept(t){return t.visitRoot?t.visitRoot(this):t.visitChildren(this)}}class Ue extends Le.ParserRuleContext{constructor(t,e){super(t,e)}get ruleIndex(){return je.RULE_expression}copyFrom(t){super.copyFrom(t)}}class Me extends Ue{term(){return this.getRuleContext(0,Ge)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitTermExpression?t.visitTermExpression(this):t.visitChildren(this)}}class He extends Ue{polarOp(){return this.getRuleContext(0,Er)}expression(){return this.getRuleContext(0,Ue)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitPolarityExpression?t.visitPolarityExpression(this):t.visitChildren(this)}}class $e extends Ue{expression(t){return void 0===t?this.getRuleContexts(Ue):this.getRuleContext(t,Ue)}arthOp(){return this.getRuleContext(0,Tr)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitArithmeticExpression?t.visitArithmeticExpression(this):t.visitChildren(this)}}class Be extends Ue{expression(t){return void 0===t?this.getRuleContexts(Ue):this.getRuleContext(t,Ue)}compOp(){return this.getRuleContext(0,vr)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitComparisonExpression?t.visitComparisonExpression(this):t.visitChildren(this)}}class qe extends Ue{expression(t){return void 0===t?this.getRuleContexts(Ue):this.getRuleContext(t,Ue)}logOp(){return this.getRuleContext(0,br)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitLogicalExpression?t.visitLogicalExpression(this):t.visitChildren(this)}}class Ve extends Ue{expression(){return this.getRuleContext(0,Ue)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitParenthesizedExpression?t.visitParenthesizedExpression(this):t.visitChildren(this)}}class ze extends Ue{expression(t){return void 0===t?this.getRuleContexts(Ue):this.getRuleContext(t,Ue)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitArrayExpression?t.visitArrayExpression(this):t.visitChildren(this)}}class Ge extends Le.ParserRuleContext{constructor(t,e){super(t,e)}get ruleIndex(){return je.RULE_term}copyFrom(t){super.copyFrom(t)}}class Ke extends Ge{literal(){return this.getRuleContext(0,lr)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitLiteralTerm?t.visitLiteralTerm(this):t.visitChildren(this)}}class We extends Ge{qualifiedIdentifier(){return this.getRuleContext(0,ar)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitQualifiedIdentifierTerm?t.visitQualifiedIdentifierTerm(this):t.visitChildren(this)}}class Qe extends Ge{externalConstant(){return this.getRuleContext(0,cr)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitExternalConstantTerm?t.visitExternalConstantTerm(this):t.visitChildren(this)}}class Ye extends Le.ParserRuleContext{function(){return this.getRuleContext(0,rr)}constructor(t,e){super(t,e)}get ruleIndex(){return je.RULE_invocable}accept(t){return t.visitInvocable?t.visitInvocable(this):t.visitChildren(this)}}class Xe extends Le.ParserRuleContext{constructor(t,e){super(t,e)}get ruleIndex(){return je.RULE_invocation}copyFrom(t){super.copyFrom(t)}}class Je extends Xe{identifier(){return this.getRuleContext(0,ur)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitMemberInvocation?t.visitMemberInvocation(this):t.visitChildren(this)}}class Ze extends Le.ParserRuleContext{constructor(t,e){super(t,e)}get ruleIndex(){return je.RULE_indexer}copyFrom(t){super.copyFrom(t)}}class tr extends Ze{identifier(){return this.getRuleContext(0,ur)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitMemberIndex?t.visitMemberIndex(this):t.visitChildren(this)}}class er extends Ze{INTEGER(){return this.getToken(je.INTEGER,0)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitNumberIndex?t.visitNumberIndex(this):t.visitChildren(this)}}class rr extends Le.ParserRuleContext{identifier(){return this.getRuleContext(0,ur)}paramList(){return this.tryGetRuleContext(0,ir)}constructor(t,e){super(t,e)}get ruleIndex(){return je.RULE_function}accept(t){return t.visitFunction?t.visitFunction(this):t.visitChildren(this)}}class ir extends Le.ParserRuleContext{expression(t){return void 0===t?this.getRuleContexts(Ue):this.getRuleContext(t,Ue)}constructor(t,e){super(t,e)}get ruleIndex(){return je.RULE_paramList}accept(t){return t.visitParamList?t.visitParamList(this):t.visitChildren(this)}}class nr extends Le.ParserRuleContext{dateTimePrecision(){return this.tryGetRuleContext(0,sr)}pluralDateTimePrecision(){return this.tryGetRuleContext(0,or)}STRING(){return this.tryGetToken(je.STRING,0)}constructor(t,e){super(t,e)}get ruleIndex(){return je.RULE_unit}accept(t){return t.visitUnit?t.visitUnit(this):t.visitChildren(this)}}class sr extends Le.ParserRuleContext{constructor(t,e){super(t,e)}get ruleIndex(){return je.RULE_dateTimePrecision}accept(t){return t.visitDateTimePrecision?t.visitDateTimePrecision(this):t.visitChildren(this)}}class or extends Le.ParserRuleContext{constructor(t,e){super(t,e)}get ruleIndex(){return je.RULE_pluralDateTimePrecision}accept(t){return t.visitPluralDateTimePrecision?t.visitPluralDateTimePrecision(this):t.visitChildren(this)}}class ar extends Le.ParserRuleContext{identifier(t){return void 0===t?this.getRuleContexts(ur):this.getRuleContext(t,ur)}constructor(t,e){super(t,e)}get ruleIndex(){return je.RULE_qualifiedIdentifier}accept(t){return t.visitQualifiedIdentifier?t.visitQualifiedIdentifier(this):t.visitChildren(this)}}class cr extends Le.ParserRuleContext{IDENTIFIER(){return this.tryGetToken(je.IDENTIFIER,0)}STRING(){return this.tryGetToken(je.STRING,0)}constructor(t,e){super(t,e)}get ruleIndex(){return je.RULE_externalConstant}accept(t){return t.visitExternalConstant?t.visitExternalConstant(this):t.visitChildren(this)}}class ur extends Le.ParserRuleContext{IDENTIFIER(){return this.getToken(je.IDENTIFIER,0)}constructor(t,e){super(t,e)}get ruleIndex(){return je.RULE_identifier}accept(t){return t.visitIdentifier?t.visitIdentifier(this):t.visitChildren(this)}}class lr extends Le.ParserRuleContext{constructor(t,e){super(t,e)}get ruleIndex(){return je.RULE_literal}copyFrom(t){super.copyFrom(t)}}class hr extends lr{NUMBER(){return this.getToken(je.NUMBER,0)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitNumberLiteral?t.visitNumberLiteral(this):t.visitChildren(this)}}class pr extends lr{infinity(){return this.getRuleContext(0,Rr)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitInfinityLiteral?t.visitInfinityLiteral(this):t.visitChildren(this)}}class dr extends lr{boolean(){return this.getRuleContext(0,xr)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitBooleanLiteral?t.visitBooleanLiteral(this):t.visitChildren(this)}}class fr extends lr{null(){return this.getRuleContext(0,Or)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitNullLiteral?t.visitNullLiteral(this):t.visitChildren(this)}}class gr extends lr{DATE(){return this.getToken(je.DATE,0)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitDateLiteral?t.visitDateLiteral(this):t.visitChildren(this)}}class yr extends lr{DATETIME(){return this.getToken(je.DATETIME,0)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitDateTimeLiteral?t.visitDateTimeLiteral(this):t.visitChildren(this)}}class mr extends lr{TIME(){return this.getToken(je.TIME,0)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitTimeLiteral?t.visitTimeLiteral(this):t.visitChildren(this)}}class _r extends lr{STRING(){return this.getToken(je.STRING,0)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitStringLiteral?t.visitStringLiteral(this):t.visitChildren(this)}}class vr extends Le.ParserRuleContext{constructor(t,e){super(t,e)}get ruleIndex(){return je.RULE_compOp}accept(t){return t.visitCompOp?t.visitCompOp(this):t.visitChildren(this)}}class Tr extends Le.ParserRuleContext{constructor(t,e){super(t,e)}get ruleIndex(){return je.RULE_arthOp}accept(t){return t.visitArthOp?t.visitArthOp(this):t.visitChildren(this)}}class Er extends Le.ParserRuleContext{constructor(t,e){super(t,e)}get ruleIndex(){return je.RULE_polarOp}accept(t){return t.visitPolarOp?t.visitPolarOp(this):t.visitChildren(this)}}class br extends Le.ParserRuleContext{constructor(t,e){super(t,e)}get ruleIndex(){return je.RULE_logOp}accept(t){return t.visitLogOp?t.visitLogOp(this):t.visitChildren(this)}}class xr extends Le.ParserRuleContext{constructor(t,e){super(t,e)}get ruleIndex(){return je.RULE_boolean}accept(t){return t.visitBoolean?t.visitBoolean(this):t.visitChildren(this)}}class Or extends Le.ParserRuleContext{constructor(t,e){super(t,e)}get ruleIndex(){return je.RULE_null}accept(t){return t.visitNull?t.visitNull(this):t.visitChildren(this)}}class Rr extends Le.ParserRuleContext{constructor(t,e){super(t,e)}get ruleIndex(){return je.RULE_infinity}accept(t){return t.visitInfinity?t.visitInfinity(this):t.visitChildren(this)}}class wr{errors;constructor(t){this.errors=t}syntaxError(t,e,r,i,n,s){this.errors.push(new oe(n,{recognizer:t,offendingSymbol:e,line:r,charPositionInLine:i,e:s}))}}const kr=require("http://unpkg.com/antlr4ts@0.5.0-alpha.4/tree/index.js");class Sr extends Wt{constructor(t){super(""+t)}toString(){return"@"+super.toString()}}class Cr extends kr.AbstractParseTreeVisitor{_timeZone;constructor(t){super(),this._timeZone=t?.timeZone}defaultResult(){}visitRoot(t){return this.visit(t.expression())}visitIdentifier(t){return t.text}visitNullLiteral(){return new fe}visitBooleanLiteral(t){return new re("true"===t.text)}visitNumberLiteral(t){return new ge(t.text)}visitStringLiteral(t){return new me(he(t.text))}visitInfinityLiteral(){return new ge(1/0)}visitDateLiteral(t){return new de(he(t.text))}visitDateTimeLiteral(t){return new de(he(t.text))}visitTimeLiteral(t){return new ve(he(t.text))}visitQualifiedIdentifierTerm(t){return new ye(t.text)}visitPolarityExpression(t){const e=this.visit(t.expression());if("NumberLiteral"===e.kind)return"-"===t.polarOp().text&&(e.value*=-1),e;throw new ne('Unexpected token "'+t.text+'"')}visitExternalConstantTerm(t){return new Sr(t.externalConstant().text.substring(1))}visitParenthesizedExpression(t){const e=this.visit(t.expression());return new ee(e)}visitArrayExpression(t){return new Xt(t.expression().map((t=>this.visit(t))))}visitComparisonExpression(t){return new Zt({op:t.compOp().text,left:this.visit(t.expression(0)),right:this.visit(t.expression(1))})}visitLogicalExpression(t){const e=[],r=(t,i)=>{for(const n of t){if(n instanceof qe&&n.logOp().text===i){r(n.expression(),n.logOp().text);continue}const t=this.visit(n);e.push(t)}};return r(t.expression(),t.logOp().text),new te({op:t.logOp().text,items:e})}visitArithmeticExpression(t){const e=new Qt,r=(t,i)=>{for(let n=0,s=t.length;n<s;n++){const s=t[n];if(s instanceof $e){r(s.expression(),s.arthOp().text);continue}const o=this.visit(s);e.append(i||"+",o)}};return r(t.expression(),t.arthOp().text),e}}function Ar(t,e){const r=Ee.CharStreams.fromString(t),i=new ke(r),n=new Ee.CommonTokenStream(i),s=new je(n);s.buildParseTree=!0;const o=[],a=new wr(o);i.removeErrorListeners(),i.addErrorListener(a),s.removeErrorListeners(),s.addErrorListener(a);const c=s.root(),u=(e=e||new Cr).visit(c);if(o.length){const t=[];for(const e of o)t.push(e.message+" at (line: "+e.line+" column: "+e.charPositionInLine+")");const e=new ne(t.join("\n"));throw e.errors=o,e}return u}function Ir(...t){return new te({op:"or",items:t})}function Lr(...t){return new te({op:"and",items:t})}function Nr(t){return new de(t)}function Pr(t){return new ve(t)}function Dr(t){return new ge(t)}function jr(...t){return new Xt(t.map(Zr))}function Fr(t){return new ye(t)}function Ur(t,e){return Jr("=",t,e)}function Mr(t,e){return Jr("!=",t,e)}function Hr(t,e){return Jr(">",t,e)}function $r(t,e){return Jr(">=",t,e)}function Br(t,e){return Jr("<",t,e)}function qr(t,e){return Jr("<=",t,e)}function Vr(t,e){return Jr("in",t,e)}function zr(t,e){return Jr("!in",t,e)}function Gr(t,e){return Jr("like",t,e)}function Kr(t,e){return Jr("!like",t,e)}function Wr(t,e){return Jr("ilike",t,e)}function Qr(t,e){return Jr("!ilike",t,e)}function Yr(t){return new ee(t)}function Xr(t){const e=new Qt;return e.add=t=>(e.append("+",ti(t)),e),e.sub=t=>(e.append("-",ti(t)),e),e.mul=t=>(e.append("*",ti(t)),e),e.div=t=>(e.append("/",ti(t)),e),e.append("+",Zr(t)),e}function Jr(t,e,r){const i=Zr(e),n=Zr(r);return new Zt({op:t,left:i,right:n})}const Zr=t=>Array.isArray(t)?jr(...t.map(ti)):ti(t),ti=t=>t instanceof Gt?t:"boolean"==typeof t?new re(t):"number"==typeof t||"bigint"==typeof t?new ge(t):null==t?new fe:t instanceof Date?new de(t):new me(""+t);var ei,ri,ii=y(480),ni=y(228);function si(t){return null!==t&&"object"==typeof t&&"function"==typeof t.pipe}function oi(t){return si(t)&&!1!==t.readable&&"function"==typeof t._read&&"object"==typeof t._readableState}function ai(t){return si(t)&&!1!==t.readable&&"function"==typeof t.getReader&&"function"==typeof t.pipeThrough&&"function"==typeof t.pipeTo}function ci(t){return null!==t&&"object"==typeof t&&"number"==typeof t.size&&"function"==typeof t.arrayBuffer&&"function"==typeof t.stream}function ui(t){return null!==t&&"function"==typeof t.constructor&&"FormData"===t.constructor.name&&"function"==typeof t.append&&"function"==typeof t.getAll}function li(t){return null!==t&&"string"==typeof t.host&&"string"==typeof t.href}!function(t){t.X_Opra_Version="X-Opra-Version",t.X_Opra_DataType="X-Opra-DataType",t.X_Opra_Count="X-Opra-Count",t.WWW_Authenticate="WWW-Authenticate",t.Authorization="Authorization",t.Proxy_Authenticate="Proxy-Authenticate",t.Proxy_Authorization="Proxy-Authorization",t.Age="Age",t.Cache_Control="Cache-Control",t.Clear_Site_Data="Clear-Site-Data",t.Expires="Expires",t.Pragma="Pragma",t.Last_Modified="Last-Modified",t.ETag="ETag",t.If_Match="If-Match",t.If_None_Match="If-None-Match",t.If_Modified_Since="If-Modified-Since",t.If_Unmodified_Since="If-Unmodified-Since",t.Vary="Vary",t.Connection="Connection",t.Keep_Alive="Keep-Alive",t.Accept="Accept",t.Accept_Encoding="Accept-Encoding",t.Accept_Language="Accept-Language",t.Expect="Expect",t.Cookie="Cookie",t.Set_Cookie="Set-Cookie",t.Access_Control_Allow_Origin="Access-Control-Allow-Origin",t.Access_Control_Allow_Credentials="Access-Control-Allow-Credentials",t.Access_Control_Allow_Headers="Access-Control-Allow-Headers",t.Access_Control_Allow_Methods="Access-Control-Allow-Methods",t.Access_Control_Expose_Headers="Access-Control-Expose-Headers",t.Access_Control_Max_Age="Access-Control-Max-Age",t.Access_Control_Request_Headers="Access-Control-Request-Headers",t.Access_Control_Request_Method="Access-Control-Request-Method",t.Origin="Origin",t.Timing_Allow_Origin="Timing-Allow-Origin",t.Content_Disposition="Content-Disposition",t.Content_ID="Content-ID",t.Content_Length="Content-Length",t.Content_Type="Content-Type",t.Content_Transfer_Encoding="Content-Transfer-Encoding",t.Content_Encoding="Content-Encoding",t.Content_Language="Content-Language",t.Content_Location="Content-Location",t.Forwarded="Forwarded",t.X_Forwarded_For="X-Forwarded-For",t.X_Forwarded_Host="X-Forwarded-Host",t.X_Forwarded_Proto="X-Forwarded-Proto",t.Via="Via",t.Location="Location",t.From="From",t.Host="Host",t.Referer="Referer",t.Referrer_Policy="Referrer-Policy",t.User_Agent="User-Agent",t.Allow="Allow",t.Server="Server",t.Accept_Ranges="Accept-Ranges",t.Range="Range",t.If_Range="If-Range",t.Content_Range="Content-Range",t.Cross_Origin_Embedder_Policy="Cross-Origin-Embedder-Policy",t.Cross_Origin_Opener_Policy="Cross-Origin-Opener-Policy",t.Cross_Origin_Resource_Policy="Cross-Origin-Resource-Policy",t.Content_Security_Policy="Content-Security-Policy",t.Content_Security_Policy_Report_Only="Content-Security-Policy-Report-Only",t.Expect_CT="Expect-CT",t.Feature_Policy="Feature-Policy",t.Strict_Transport_Security="Strict-Transport-Security",t.Upgrade_Insecure_Requests="Upgrade-Insecure-Requests",t.X_Content_Type_Options="X-Content-Type-Options",t.X_Download_Options="X-Download-Options",t.X_Frame_Options="X-Frame-Options",t.X_Permitted_Cross_Domain_Policies="X-Permitted-Cross-Domain-Policies",t.X_Powered_By="X-Powered-By",t.X_XSS_Protection="X-XSS-Protection",t.Transfer_Encoding="Transfer-Encoding",t.TE="TE",t.Trailer="Trailer",t.Sec_WebSocket_Key="Sec-WebSocket-Key",t.Sec_WebSocket_Extensions="Sec-WebSocket-Extensions",t.Sec_WebSocket_Accept="Sec-WebSocket-Accept",t.Sec_WebSocket_Protocol="Sec-WebSocket-Protocol",t.Sec_WebSocket_Version="Sec-WebSocket-Version",t.Date="Date",t.Retry_After="Retry-After",t.Server_Timing="Server-Timing",t.X_DNS_Prefetch_Control="X-DNS-Prefetch-Control"}(ei||(ei={})),function(t){t[t.CONTINUE=100]="CONTINUE",t[t.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",t[t.PROCESSING=102]="PROCESSING",t[t.EARLYHINTS=103]="EARLYHINTS",t[t.OK=200]="OK",t[t.CREATED=201]="CREATED",t[t.ACCEPTED=202]="ACCEPTED",t[t.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",t[t.NO_CONTENT=204]="NO_CONTENT",t[t.RESET_CONTENT=205]="RESET_CONTENT",t[t.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",t[t.AMBIGUOUS=300]="AMBIGUOUS",t[t.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",t[t.FOUND=302]="FOUND",t[t.SEE_OTHER=303]="SEE_OTHER",t[t.NOT_MODIFIED=304]="NOT_MODIFIED",t[t.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",t[t.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",t[t.BAD_REQUEST=400]="BAD_REQUEST",t[t.UNAUTHORIZED=401]="UNAUTHORIZED",t[t.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",t[t.FORBIDDEN=403]="FORBIDDEN",t[t.NOT_FOUND=404]="NOT_FOUND",t[t.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",t[t.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",t[t.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",t[t.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",t[t.CONFLICT=409]="CONFLICT",t[t.GONE=410]="GONE",t[t.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",t[t.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",t[t.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",t[t.URI_TOO_LONG=414]="URI_TOO_LONG",t[t.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",t[t.REQUESTED_RANGE_NOT_SATISFIABLE=416]="REQUESTED_RANGE_NOT_SATISFIABLE",t[t.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",t[t.I_AM_A_TEAPOT=418]="I_AM_A_TEAPOT",t[t.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",t[t.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",t[t.LOCKED=423]="LOCKED",t[t.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",t[t.TOO_EARLY=425]="TOO_EARLY",t[t.UPGRADE_REQUIRED=428]="UPGRADE_REQUIRED",t[t.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",t[t.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",t[t.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",t[t.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",t[t.BAD_GATEWAY=502]="BAD_GATEWAY",t[t.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",t[t.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",t[t.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",t[t.VARIANT_ALSO_NEGOTIATES=506]="VARIANT_ALSO_NEGOTIATES",t[t.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",t[t.LOOP_DETECTED=508]="LOOP_DETECTED",t[t.NOT_EXTENDED=510]="NOT_EXTENDED",t[t.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"}(ri||(ri={}));const hi=Object.keys(ei),pi=hi.map((t=>t.toLowerCase()));function di(t,e){return t&&Object.keys(t).reduce(((r,i)=>{const n=t[i],s=e?hi[pi.indexOf(i.toLowerCase())]||i.replace(/(^\w|[A-Z]|\b\w)/g,(function(t){return t.toUpperCase()})):i.toLowerCase();return"set-cookie"===i.toLowerCase()?r[s]=Array.isArray(n)?n:[n]:r[s]=Array.isArray(n)?n.join(";"):n,r}),{})||{}}class fi{method;url;headers;data;constructor(t){this.method=t.method,this.url=encodeURI(decodeURI(t.url)),this.headers=t.headers,this.data=t.data}}class gi{status;headers;data;constructor(t){this.status=t.status,this.headers=t.headers,this.data=t.data}}const yi="\r\n",mi=/ *charset=./i;class _i{_parts=[];boundary;constructor(){this.boundary="batch_"+(0,ni.uid)(12)}addRequestPart(t,e){const r={...di(e?.headers||{},!0),[ei.Content_Type]:"application/http",[ei.Content_Transfer_Encoding]:"binary"};return e?.contentId&&(r[ei.Content_ID]=e.contentId),this._parts.push({headers:r,contentId:e?.contentId,content:new fi(t)}),this}addHttpResponse(t,e){const r={...di(e?.headers||{},!0),[ei.Content_Type]:"application/http",[ei.Content_Transfer_Encoding]:"binary"};return e?.contentId&&(r[ei.Content_ID]=e.contentId),this._parts.push({headers:r,contentId:e?.contentId,content:new gi(t)}),this}addBatch(t,e){const r={...di(e?.headers||{},!0),[ei.Content_Type]:"application/http",[ei.Content_Transfer_Encoding]:"binary"};return e?.contentId&&(r[ei.Content_ID]=e.contentId),this._parts.push({headers:r,contentId:e?.contentId,content:t}),this}stream(){const t=[];return this._build(t),ii(t).flatten()}_build(t){for(const e of this._parts){if(!(e.content instanceof fi||e.content instanceof gi))throw new Error("Not implemented yet");{let r=e.content.data,i=0;const n=di(e.content.headers);if(r){const t=String(n["content-type"]||"").split(/\s*;\s*/);let e="";if(oi(r)?i=parseInt(String(n["content-length"]),10)||0:"object"==typeof r?"function"==typeof r.stream?(t[0]=r.type||"binary",i=r.size,r=r.stream()):Buffer.isBuffer(r)?n["content-length"]=String(r.length):(t[0]=t[0]||"application/json",e="utf-8",r=Buffer.from(JSON.stringify(r),"utf-8"),i=r.length):(t[0]=t[0]||"text/plain",e="utf-8",r=Buffer.from(String(r),"utf-8"),i=r.length),t[0]){if(e){const r=t.findIndex((t=>mi.test(String(t))));r>0?t[r]="charset="+e:t.join("charset="+e)}n["content-type"]=t.join(";")}i&&(n["content-length"]=String(i))}let s="--"+this.boundary+yi;for(const[t,r]of Object.entries(e.headers))""!==r&&null!=r&&(s+=t+": "+(Array.isArray(r)?r.join(";"):r)+yi);if(s+=yi,e.content instanceof fi?s+=(e.content.method||"GET").toUpperCase()+" "+e.content.url+" HTTP/1.1"+yi:s+="HTTP/1.1 "+e.content.status+(ri[e.content.status]||"Unknown")+yi,e.content.headers)for(const[t,r]of Object.entries(e.content.headers))""!==r&&null!=r&&("set-cookie"===t&&Array.isArray(r)?r.forEach((e=>s+=t+": "+e)):s+=t+": "+(Array.isArray(r)?r.join(";"):r)+yi);s+=yi,t.push(Buffer.from(s,"utf-8")),r&&(t.push(r),t.push(Buffer.from(yi+yi)))}}t.push(Buffer.from("--"+this.boundary+"--"+yi,"utf-8"))}}y(150);const vi="opra:data_type.metadata",Ti="opra:complex_type.fields",Ei="opra:resource.metadata",bi="opra:resolver.metadata",xi="opra:ignore_resolver-method",Oi="opra:mapped_type.metadata",Ri=["create","delete","get","update"],wi=[...Ri,"count","deleteMany","updateMany","search"];var ki;!function(t){t.Version="1.0",t.isDataType=function(t){return t&&"object"==typeof t&&("ComplexType"===t.kind||"SimpleType"===t.kind||"UnionType"===t.kind)},t.isComplexType=function(t){return t&&"object"==typeof t&&"ComplexType"===t.kind},t.isSimpleType=function(t){return t&&"object"==typeof t&&"SimpleType"===t.kind},t.isUnionTypee=function(t){return t&&"object"==typeof t&&"UnionType"===t.kind},t.isResource=function(t){return t&&"object"==typeof t&&"ContainerResource"===t.kind||"CollectionResource"===t.kind||"SingletonResource"===t.kind},t.isCollectionResource=function(t){return t&&"object"==typeof t&&"CollectionResource"===t.kind},t.isSingletonResource=function(t){return t&&"object"==typeof t&&"SingletonResource"===t.kind},t.isContainerResource=function(t){return t&&"object"==typeof t&&"ContainerResource"===t.kind}}(ki||(ki={}));var Si=y(467);const Ci=/^(.*)Type$/;function Ai(t){return e=>{const r={kind:"ComplexType",name:t?.name||e.name.match(Ci)?.[1]||e.name};Object.assign(r,(0,Si.omit)(t,Object.keys(r)));const i=Object.getPrototypeOf(e),n=Reflect.getMetadata(vi,i);n&&(n.additionalFields&&null==r.additionalFields&&(r.additionalFields=!0),r.extends=[{type:i}]),Reflect.defineMetadata(vi,r,e)}}function Ii(t){return(e,r)=>{if("string"!=typeof r)throw new TypeError("Symbol properties can't be used as field");const i=Reflect.getMetadata("design:type",e,r),n={type:t?.type};Object.assign(n,(0,Si.omit)(t,Object.keys(n))),i===Array?(n.isArray=!0,n.type=n.type||"any"):(delete n.isArray,n.type=n.type||i);const s=Reflect.getOwnMetadata(Ti,e.constructor)||{};s[r]=n,Reflect.defineMetadata(Ti,s,e.constructor)}}const Li=/^(.*)Resource$/;function Ni(t,e){return function(r){const i=e?.name||r.name.match(Li)?.[1]||r.name,n={kind:"CollectionResource",type:t,name:i};Object.assign(n,(0,Si.omit)(e,Object.keys(n))),Reflect.defineMetadata(Ei,n,r),Reflect.defineMetadata("__injectable__",!0,r)}}const Pi=/^(.*)Resource$/;function Di(t,e){return function(r){const i=e?.name||r.name.match(Pi)?.[1]||r.name,n={kind:"SingletonResource",type:t,name:i};Object.assign(n,(0,Si.omit)(e,Object.keys(n))),Reflect.defineMetadata(Ei,n,r),Reflect.defineMetadata("__injectable__",!0,r)}}function ji(t){return(e,r)=>{if("create"!==r)throw new TypeError('This decorator can only be applied for the "create" property');const i={...t};Reflect.defineMetadata(bi,i,e,r)}}function Fi(t){return(e,r)=>{if("delete"!==r)throw new TypeError('This decorator can only be applied for the "delete" property');const i={...t};Reflect.defineMetadata(bi,i,e,r)}}function Ui(t){return(e,r)=>{if("deleteMany"!==r)throw new TypeError('This decorator can only be applied for the "deleteMany" property');const i={...t};Reflect.defineMetadata(bi,i,e,r)}}function Mi(t){return(e,r)=>{if("update"!==r)throw new TypeError('This decorator can only be applied for the "update" property');const i={...t};Reflect.defineMetadata(bi,i,e,r)}}function Hi(t){return(e,r)=>{if("updateMany"!==r)throw new TypeError('This decorator can only be applied for the "updateMany" property');const i={...t};Reflect.defineMetadata(bi,i,e,r)}}function $i(t){return(e,r)=>{if("get"!==r)throw new TypeError('This decorator can only be applied for the "get" property');const i={...t};Reflect.defineMetadata(bi,i,e,r)}}function Bi(t){return(e,r)=>{if("search"!==r)throw new TypeError('This decorator can only be applied for the "search" property');const i={...t};Reflect.defineMetadata(bi,i,e,r)}}var qi=y(682),Vi=y(79);class zi extends Map{_keyMap=new Map;_keyOrder=[];_wellKnownKeyMap=new Map;constructor(t,e){super(),e&&e.forEach((t=>this._wellKnownKeyMap.set(t.toLowerCase(),t))),"function"==typeof t?.forEach?t.forEach(((t,e)=>this.set(e,t))):t&&"object"==typeof t&&Object.keys(t).forEach((e=>this.set(e,t[e])))}clear(){super.clear(),this._keyMap.clear(),this._keyOrder=[]}get(t){const e=this._getOriginalKey(t);return super.get(e)}has(t){return this._keyMap.has(this._getLowerKey(t))}set(t,e){return t=this._getOriginalKey(t),this._keyMap.set(this._getLowerKey(t),t),this._keyOrder.includes(t)||this._keyOrder.push(t),super.set(t,e)}keys(){return this._keyOrder.values()}values(){let t=-1;const e=this._keyOrder,r=this;return{[Symbol.iterator](){return this},next:()=>(t++,{done:t>=e.length,value:r.get(e[t])})}}entries(){let t=-1;const e=this._keyOrder,r=this;return{[Symbol.iterator](){return this},next:()=>(t++,{done:t>=e.length,value:[e[t],r.get(e[t])]})}}delete(t){const e=this._getOriginalKey(t),r=this._getLowerKey(t);this._keyMap.delete(r);const i=this._keyOrder.indexOf(e);return i>=0&&this._keyOrder.splice(i,1),super.delete(e)}sort(t){return this._keyOrder.sort(t),this}[Symbol.iterator](){return this.entries()}_getOriginalKey(t){return"string"==typeof t?this._keyMap.get(t.toLowerCase())??this._wellKnownKeyMap.get(t.toLowerCase())??t:t}_getLowerKey(t){return"string"==typeof t?t.toLowerCase():t}}function Gi(t){return"function"==typeof t&&!(!t.prototype||!t.prototype.constructor)}const Ki={kind:"UnionType",description:"Any value",ctor:Object,types:[]},Wi={kind:"SimpleType",description:"A stream of bytes, base64 encoded",ctor:Object.getPrototypeOf(Buffer.from("")).constructor,parse:t=>Buffer.from(t),serialize:t=>Buffer.isBuffer(t)?t.toString("base64"):void 0},Qi={kind:"SimpleType",description:"BigInt number",ctor:Object.getPrototypeOf(BigInt(0)).constructor,parse:t=>BigInt(t),serialize:t=>String(t)};var Yi=y(374);const Xi={kind:"SimpleType",description:"Simple true/false value",ctor:Boolean,parse:t=>(0,Yi.toBoolean)(t),serialize:t=>(0,Yi.toBoolean)(t)},Ji={kind:"SimpleType",description:"A date, date-time or partial date",ctor:String,parse:t=>(0,Yi.toDate)(t),serialize:t=>String(t)},Zi={kind:"SimpleType",description:"A date, date-time or partial date in string format",ctor:String,parse:t=>(0,Yi.toString)(t),serialize:t=>(0,Yi.toString)(t)},tn={kind:"SimpleType",description:"A guid value",ctor:String,parse:t=>(0,Yi.toString)(t),serialize:t=>(0,Yi.toString)(t)},en={kind:"SimpleType",description:"An integer number",ctor:Number,parse:t=>(0,Yi.toInt)(t),serialize:t=>(0,Yi.toInt)(t)},rn={kind:"SimpleType",description:"Both Integer as well as Floating-Point numbers",ctor:Number,parse:t=>(0,Yi.toNumber)(t),serialize:t=>(0,Yi.toNumber)(t)},nn={kind:"ComplexType",description:"A non modelled object",ctor:Object,additionalFields:!0,parse:t=>t,serialize:t=>t},sn={kind:"SimpleType",description:"A sequence of characters",ctor:String,parse:t=>(0,Yi.toString)(t),serialize:t=>(0,Yi.toString)(t)},on=Object.getPrototypeOf(BigInt(0)).constructor,an=Object.getPrototypeOf(Buffer.from("")).constructor,cn=new zi;cn.set("any",Ki),cn.set("base64Binary",Wi),cn.set("bigint",Qi),cn.set("boolean",Xi),cn.set("date",Ji),cn.set("dateString",Zi),cn.set("guid",tn),cn.set("integer",en),cn.set("number",rn),cn.set("object",nn),cn.set("string",sn);const un=new Map;un.set(Boolean,"boolean"),un.set(String,"string"),un.set(Number,"number"),un.set(Date,"date"),un.set(on,"bigint"),un.set(an,"base64Binary"),un.set(Object,"object");var ln=y(394),hn=y(490);function pn(t,e){return hn({},t,{deep:!0,clone:!0,filter:(t,r)=>{const i=t[r];return null!=i&&!e||"function"!=typeof i&&("object"!=typeof i||ln(i)||Array.isArray(i))}})}async function dn(t){const e=Object.getPrototypeOf(t).constructor,r=Reflect.getMetadata(Ei,e);if(!r)throw new TypeError(`Class "${e.name}" doesn't have "Resource" metadata information`);const i=pn(r);if(i.instance=t,i.name=r.name||e.name.replace(/(Resource|Controller)$/,""),ki.isCollectionResource(r))return await async function(t){const e=t.instance,r=Object.getPrototypeOf(t.instance);let i,n;const s=(t,e)=>{n=t[e],i=Reflect.getMetadata(bi,t,e),null==n&&i&&(t=Object.getPrototypeOf(t),n=t[e])};for(const o of wi){if(s(e,o),"function"!=typeof n)continue;const a=t[o]={...i};Reflect.hasMetadata(xi,r.constructor,o)||(a.handler=n.bind(e),n=e["pre_"+o],"function"==typeof n&&(t["pre_"+o]=n.bind(e)))}return t}(i);if(ki.isSingletonResource(r))return await async function(t){const e=t.instance,r=Object.getPrototypeOf(t.instance);let i,n;const s=(t,e)=>{n=t[e],i=Reflect.getMetadata(bi,t,e),null==n&&i&&(t=Object.getPrototypeOf(t),n=t[e])};for(const o of Ri){if(s(e,o),"function"!=typeof n)continue;const a=t[o]={...i};Reflect.hasMetadata(xi,r.constructor,o)||(a.handler=n.bind(e),n=e["pre_"+o],"function"==typeof n&&(t["pre_"+o]=n.bind(e)))}return t}(i);throw new TypeError("Invalid Resource metadata")}async function fn(t){const e=Reflect.getMetadata(vi,t);if(!e)throw new TypeError(`Class "${t}" doesn't have "DataType" metadata information`);if(ki.isComplexType(e))return await async function(t,e){const r=pn(e);r.ctor=t;const i=Reflect.getMetadata(Oi,t);i&&(r.extends=[...i.map((t=>pn(t)))]);const n=Reflect.getMetadata(Ti,t);if(n){r.fields=pn(n);for(const[e,i]of Object.entries(r.fields)){if("function"==typeof i.type){const t=un.get(i.type);t&&(i.type=t)}let r;if(Vi.SqbConnect){const{EntityMetadata:n,isAssociationField:s}=Vi.SqbConnect,o=n.get(t);if(r=o&&n.getField(o,e),r){if((i.type===Function||"object"===i.type||i.type===Object||"any"===i.type)&&(i.type="any",s(r))){r.association.returnsMany()||delete i.isArray;const t=await r.association.resolveTarget();t&&(i.type=t.ctor)}r.exclusive&&void 0===i.exclusive&&(i.exclusive=r.exclusive)}}if(r&&"column"===r.kind){const t=Vi.SqbConnect.DataType;if("number"===i.type||i.type===Number)switch(r.dataType){case t.INTEGER:case t.SMALLINT:i.type="integer";break;case t.BIGINT:i.type="bigint"}else if(("string"===i.type||i.type===String)&&r.dataType===t.GUID)i.type="guid";r.notNull&&void 0===i.required&&(i.required=r.notNull),r.exclusive&&void 0===i.exclusive&&(i.exclusive=r.exclusive),void 0!==r.default&&void 0===i.default&&(i.default=r.default)}}}return r}(t,e);if(ki.isSimpleType(e))return await async function(t,e){const r=pn(e);return r.ctor=t,r}(t,e);throw new TypeError("Invalid DataType metadata")}class gn{_args;_dataTypes=new zi;_resources=new zi;constructor(t){this._args=t}buildSchema(){const t={...this._args,version:ki.Version};return this._dataTypes.size&&(t.types=Array.from(this._dataTypes.keys()).sort().reduce(((t,e)=>(t[e]=this._dataTypes.get(e),t)),{})),this._resources.size&&(t.resources=Array.from(this._resources.keys()).sort().reduce(((t,e)=>(t[e]=this._resources.get(e),t)),{})),t}async addDataTypeSchema(t,e){if(!ki.isDataType(e))throw new TypeError("Invalid DataType schema");const r=this._dataTypes.get(t);if(r){if(r.kind!==e.kind||!r.ctor||r.ctor!==e.ctor)throw new Error(`An other instance of "${t}" data type previously defined`)}else if(this._dataTypes.set(t,e),ki.isComplexType(e)){if(e.extends)for(const t of e.extends)"string"!=typeof t.type&&(t.type=await this.addDataTypeClass(t.type));if(e.fields)for(const t of Object.values(e.fields))t.type=t.type||"string","string"!=typeof t.type&&(t.type=await this.addDataTypeClass(t.type))}}async addDataTypeClass(t){if(!Gi(t=(0,qi.isPromise)(t)?await t:t))return this.addDataTypeClass(t());const e=un.get(t);if(e)return e;const r=await fn(t),i=r.name,n=r;return delete n.name,await this.addDataTypeSchema(i,n),i}async addResourceSchema(t,e){if(!ki.isResource(e))throw new TypeError("Invalid Resource schema");if(this._resources.has(t))throw new Error(`An other instance of "${t}" resource previously defined`);if(ki.isCollectionResource(e)||ki.isSingletonResource(e)){const t="function"==typeof e.type?await this.addDataTypeClass(e.type):e.type;if(e.type=t,!this._dataTypes.has(e.type)&&!cn.has(e.type))throw new Error(`Resource registration error. Type "${e.type}" not found.`)}if(ki.isCollectionResource(e)&&!e.keyFields){const r=this._dataTypes.get(e.type);if(Vi.SqbConnect&&r?.ctor){const t=Vi.SqbConnect.EntityMetadata.get(r?.ctor);if(t?.indexes){const r=t.indexes.find((t=>t.primary));r&&(e.keyFields=r.columns)}}if(e.keyFields=Array.isArray(e.keyFields)?e.keyFields.length?e.keyFields:"":e.keyFields,!e.keyFields)throw new TypeError(`You must provide keyFields for "${t}" entity resource`)}this._resources.set(t,e)}async addResourceInstance(t){let e;"function"==typeof(t=(0,qi.isPromise)(t)?await t:t)?Gi(t)?(e={},Object.setPrototypeOf(e,t.prototype)):e=await t():e=t;const r=await dn(e),i=r.name,n=r;return delete n.name,await this.addResourceSchema(i,n),i}}function yn(t,e){return t<e?-1:t>e?1:0}const mn=Symbol.for("nodejs.util.inspect.custom"),_n="[0m",vn="[33m",Tn="[35m";class En{_document;_metadata;_name;constructor(t,e,r){this._document=t,this._name=e,this._metadata=r}get document(){return this._document}get kind(){return this._metadata.kind}get name(){return this._name}get description(){return this._metadata.description}get ctor(){return this._metadata.ctor}parse(t){return this._metadata.parse?this._metadata.parse(t):t}getSchema(t){return pn(this._metadata,t)}}class bn extends En{_initialized=!1;_mixinAdditionalFields;ownFields=new zi;fields=new zi;constructor(t,e,r){super(t,e,{kind:"ComplexType",...r})}get abstract(){return!!this._metadata.abstract}get additionalFields(){return this._metadata.additionalFields||this._mixinAdditionalFields}get extends(){return this._metadata.extends}getField(t){if(t.includes(".")){let e=this;const r=t.split(".");let i;for(const t of r)i=e.getField(t),e=e.document.getDataType(i.type||"string");return i}const e=this.fields.get(t);if(!e)throw new Error(`"${this.name}" type doesn't have a field named "${t}"`);return e}getFieldType(t){const e=this.getField(t);return this.document.getDataType(e.type||"string")}getOwnField(t){const e=this.ownFields.get(t);if(!e)throw new Error(`"${this.name}" type doesn't have an own field named "${t}"`);return e}getSchema(){const t=super.getSchema();if(this.additionalFields&&(t.additionalFields=this.additionalFields),this.ownFields.size){t.fields={};for(const[e,r]of this.ownFields)t.fields[e]=pn(r),delete t.fields[e].name}return t}toString(){return`[${Object.getPrototypeOf(this).constructor.name} ${this.name}]`}[mn](){return`[${vn+Object.getPrototypeOf(this).constructor.name+_n} ${Tn+this.name+_n}]`}init(){if(this._initialized)return;this._initialized=!0;const t=this._metadata;if(t.extends)for(const e of t.extends){const t=this.document.types.get(e.type);if(!t)throw new TypeError(`Extending schema (${e.type}) of data type "${this.name}" does not exists`);if(!(t instanceof bn))throw new TypeError(`Cannot extend ${this.name} from a "${t.kind}"`);t.init(),t.additionalFields&&(this._mixinAdditionalFields=!0);for(const[e,r]of t.fields){const t=pn(r);t.name=e,t.parent=this,this.fields.set(e,t)}}if(t.fields)for(const[e,r]of Object.entries(t.fields)){if(!this.document.types.get(r.type))throw new TypeError(`Type "${r.type}" defined for "${this.name}.${e}" does not exists`);const t=pn(r);t.name=e,this.fields.set(e,t),this.ownFields.set(e,t)}}}class xn extends En{constructor(t,e,r){super(t,e,{kind:"SimpleType",...r})}toString(){return`[${Object.getPrototypeOf(this).constructor.name} ${this.name}]`}[mn](){return`[${vn+Object.getPrototypeOf(this).constructor.name+_n} ${Tn+this.name+_n}]`}}class On extends En{types;hasAdditionalFields;constructor(t,e,r){super(t,e,(0,Si.omit)({kind:"UnionType",...r},["types"])),this.types=r.types,this.hasAdditionalFields="any"===e||!!this.types.find((t=>t instanceof bn&&t.additionalFields))}toString(){return`[${Object.getPrototypeOf(this).constructor.name} ${this.name}]`}[mn](){return`[${vn+Object.getPrototypeOf(this).constructor.name+_n} ${Tn+this.name+_n}]`}}const Rn=/^([^.]+)\.(.*)$/;function wn(t){if(t.length)return kn(t,{})}function kn(t,e){for(const r of t){const t=Rn.exec(r);if(t){const r=t[1];if(!0===e[r])continue;const i=e[r]="object"==typeof e[r]?e[r]:{};kn([t[2]],i)}else e[r]=!0}return e}function Sn(t,e,r,i=""){return Cn([],t,e,wn(r)||{},"",i,{additionalFields:!0})}function Cn(t,e,r,i,n="",s="",o){let a="";for(const c of Object.keys(i)){const u=i[c],l=r?.fields.get(c);if(!l){if(a=n?n+"."+c:c,!o?.additionalFields||r&&!r.additionalFields)throw new TypeError(`Unknown field "${a}"`);"object"==typeof u?Cn(t,e,void 0,u,a,s,o):t.push(a);continue}a=n?n+"."+l.name:l.name;const h=e.getDataType(l.type||"string");if("object"!=typeof u)t.findIndex((t=>t.startsWith(a+".")))>=0&&(t=t.filter((t=>!t.startsWith(a+".")))),t.push(a);else{if(!(h&&h instanceof bn))throw new TypeError(`"${s?s+"."+a:a}" is not a complex type and has no sub fields`);if(t.findIndex((t=>t===n))>=0)continue;t=Cn(t,e,h,u,a,s,o)}}return t}class An{metadata;document;name;path;constructor(t,e,r){this.document=t,this.name=e,this.metadata=r}get instance(){return this.metadata.instance}get kind(){return this.metadata.kind}get description(){return this.metadata.description}toString(){return`[${Object.getPrototypeOf(this).constructor.name} ${this.name}]`}validateQueryOptions(){}getSchema(t){return pn(this.metadata,t)}[mn](){return`[${vn+Object.getPrototypeOf(this).constructor.name+_n} ${Tn+this.name+_n}]`}}class In extends An{dataType;constructor(t,e,r,i){if(!i.keyFields)throw new TypeError(`You should provide key fields for ${e}`);super(t,e,i),i.keyFields=Array.isArray(i.keyFields)?i.keyFields:[i.keyFields],i.keyFields.forEach((t=>r.getField(t))),this.dataType=r,i.search&&i.search.sortFields&&(i.search.sortFields=Sn(t,r,i.search.sortFields))}get keyFields(){return this.metadata.keyFields}get create(){return this.metadata.create}get count(){return this.metadata.count}get delete(){return this.metadata.delete}get deleteMany(){return this.metadata.deleteMany}get get(){return this.metadata.get}get update(){return this.metadata.update}get updateMany(){return this.metadata.updateMany}get search(){return this.metadata.search}getSchema(t){const e=super.getSchema(t);e.keyFields.length<2&&(e.keyFields=e.keyFields[0]);for(const t of wi)"object"!=typeof e[t]||Object.keys(e[t]).length||(e[t]=!0);return e}}class Ln extends An{dataType;constructor(t,e,r,i){if(!(r instanceof bn))throw new TypeError('You should provide a ComplexType as "dataType" argument');super(t,e,i),this.dataType=r}get create(){return this.metadata.create}get delete(){return this.metadata.delete}get get(){return this.metadata.get}get update(){return this.metadata.update}getSchema(t){const e=super.getSchema(t);for(const t of Ri)"object"!=typeof e[t]||Object.keys(e[t]).length||(e[t]=!0);return e}}class Nn{_ownTypes=new zi;_types=new zi;_resources=new zi;constructor(t){this._meta=(0,Si.omit)(t,["types","resources"]);for(const[t,e]of cn.entries())this._addDataType(t,e,!1);if(t.types)for(const[e,r]of Object.entries(t.types))this._addDataType(e,r,!0);if(this._initTypes(),t.resources)for(const[e,r]of Object.entries(t.resources))this._addResource(e,r)}get info(){return this._meta.info}get types(){return this._types}getDataType(t){const e=this.types.get(t);if(e)return e;throw new Error(`Data type "${t}" does not exists`)}getComplexDataType(t){const e=this.getDataType(t);if(e&&e instanceof bn)return e;throw new Error(`Data type "${t}" is not a ComplexType`)}getSimpleDataType(t){const e=this.getDataType(t);if(e&&e instanceof xn)return e;throw new Error(`Data type "${t}" is not a SimpleType`)}getUnionDataType(t){const e=this.getDataType(t);if(e&&e instanceof On)return e;throw new Error(`Data type "${t}" is not a UnionType`)}get resources(){return this._resources}get servers(){return this._meta.servers}getResource(t){const e=this.resources.get(t);if(!e)throw new Error(`Resource "${t}" does not exists`);return e}getCollectionResource(t){const e=this.getResource(t);if(!(e instanceof In))throw new Error(`"${t}" is not a CollectionResource`);return e}getSingletonResource(t){const e=this.getResource(t);if(!(e instanceof Ln))throw new Error(`"${t}" is not a SingletonResource`);return e}getMetadata(t){const e={version:ki.Version,info:pn(this.info)};return this._ownTypes.size&&(e.types=Array.from(this._ownTypes.values()).sort(((t,e)=>yn(t.name,e.name))).reduce(((e,r)=>(e[r.name]=r.getSchema(t),e)),{})),this.resources.size&&(e.resources=Array.from(this._resources.values()).sort(((t,e)=>yn(t.name,e.name))).reduce(((e,r)=>(e[r.name]=r.getSchema(t),e)),{})),e}_addDataType(t,e,r){let i=this._types.get(t);if(i)return i;if(ki.isComplexType(e))i=new bn(this,t,e);else if(ki.isSimpleType(e))i=new xn(this,t,e);else{if(!ki.isUnionTypee(e))throw new TypeError("Invalid data type schema");i=new On(this,t,{...e,types:[]})}return this._types.set(t,i),r&&this._ownTypes.set(t,i),i}_addResource(t,e){if(!ki.isCollectionResource(e)&&!ki.isSingletonResource(e))throw new TypeError(`Unknown resource kind (${e.kind})`);{const r=this.getDataType(e.type);if(!r)throw new TypeError(`Datatype "${e.type}" declared in CollectionResource (${t}) does not exists`);if(!(r instanceof bn))throw new TypeError(`${e.type} is not an ComplexType`);ki.isCollectionResource(e)?this.resources.set(t,new In(this,t,r,e)):this.resources.set(t,new Ln(this,t,r,e))}}_initTypes(){for(const t of this._types.values())t instanceof bn&&t.init()}static async create(t){const e=new gn(t);if(t.types)if(Array.isArray(t.types))for(const r of t.types)await e.addDataTypeClass(r);else for(const[r,i]of Object.entries(t.types))await e.addDataTypeSchema(r,i);if(t.resources)if(Array.isArray(t.resources))for(const r of t.resources)await e.addResourceInstance(r);else for(const[r,i]of Object.entries(t.resources))await e.addResourceSchema(r,i);const r=e.buildSchema();return new Nn(r)}}class Pn extends An{constructor(t,e,r){super(t,e,r)}getResource(t){const e=this.metadata.resources[t];if(!e)throw new Error(`Resource "${t}" does not exists`);return e}getCollectionResource(t){const e=this.getResource(t);if(!(e instanceof In))throw new Error(`"${t}" is not a Collection Resource`);return e}getSingletonResource(t){const e=this.getResource(t);if(!(e instanceof Ln))throw new Error(`"${t}" is not a SingletonResource`);return e}}class Dn{resource;data;kind="CollectionCreateQuery";method="create";operation="create";pick;omit;include;constructor(t,e,r){this.resource=t,this.data=e,r?.pick&&(this.pick=Sn(t.document,t.dataType,r.pick)),r?.omit&&(this.omit=Sn(t.document,t.dataType,r.omit)),r?.include&&(this.include=Sn(t.document,t.dataType,r.include))}get dataType(){return this.resource.dataType}}class jn{resource;kind="CollectionCountQuery";method="count";operation="read";filter;constructor(t,e){this.resource=t,this.filter="string"==typeof e?.filter?Ar(e.filter):e?.filter}get dataType(){return this.resource.dataType}}class Fn{resource;kind="CollectionDeleteManyQuery";method="deleteMany";operation="delete";filter;constructor(t,e){this.resource=t,this.filter="string"==typeof e?.filter?Ar(e.filter):e?.filter}get dataType(){return this.resource.dataType}}class Un{resource;kind="CollectionDeleteQuery";method="delete";operation="delete";keyValue;constructor(t,e){if(this.resource=t,t.keyFields.length>1){if("object"!=typeof e)throw new Error(`You must provide an key/value object for all key fields (${t.keyFields})`);t.keyFields.reduce(((t,r)=>(t[r]=e[r],t)),{})}else this.keyValue=t.dataType.getFieldType(t.keyFields[0]).parse(e)}get dataType(){return this.resource.dataType}}class Mn{resource;kind="CollectionGetQuery";method="get";operation="read";keyValue;pick;omit;include;child;constructor(t,e,r){if(this.resource=t,t.keyFields.length>1){if("object"!=typeof e)throw new Error(`You must provide an key/value object for all key fields (${t.keyFields})`);t.keyFields.reduce(((t,r)=>(t[r]=e[r],t)),{})}else this.keyValue=t.dataType.getFieldType(t.keyFields[0]).parse(e);r?.pick&&(this.pick=Sn(t.document,t.dataType,r.pick)),r?.omit&&(this.omit=Sn(t.document,t.dataType,r.omit)),r?.include&&(this.include=Sn(t.document,t.dataType,r.include))}get dataType(){return this.resource.dataType}}class Hn{parent;resource;kind="FieldGetQuery";method="get";operation="read";fieldName;field;path;dataType;parentType;pick;omit;include;child;constructor(t,e,r){this.parent=t,this.resource=t.resource;const i=r?.castingType||t.dataType;if(!(i&&i instanceof bn))throw new TypeError("Data type of parent query is not a ComplexType");this.parentType=i,this.field=i.additionalFields?i.fields.get(e):i.getField(e),this.fieldName=this.field?this.field.name:e,this.dataType=this.resource.document.getDataType(this.field?this.field.type||"string":"object"),this.path=(t instanceof Hn?t.path+".":"")+this.fieldName,this.dataType instanceof bn&&(r?.pick&&(this.pick=Sn(this.resource.document,this.dataType,r.pick,this.path)),r?.omit&&(this.omit=Sn(this.resource.document,this.dataType,r.omit,this.path)),r?.include&&(this.include=Sn(this.resource.document,this.dataType,r.include,this.path)))}}class $n{resource;kind="SingletonGetQuery";method="get";operation="read";pick;omit;include;child;constructor(t,e){this.resource=t,e?.pick&&(this.pick=Sn(t.document,t.dataType,e.pick)),e?.omit&&(this.omit=Sn(t.document,t.dataType,e.omit)),e?.include&&(this.include=Sn(t.document,t.dataType,e.include))}get dataType(){return this.resource.dataType}}class Bn{resource;kind="CollectionSearchQuery";method="search";operation="read";pick;omit;include;filter;limit;skip;distinct;count;sort;constructor(t,e){if(this.resource=t,e?.pick&&(this.pick=Sn(t.document,t.dataType,e.pick)),e?.omit&&(this.omit=Sn(t.document,t.dataType,e.omit)),e?.include&&(this.include=Sn(t.document,t.dataType,e.include)),this.filter="string"==typeof e?.filter?Ar(e.filter):e?.filter,this.limit=e?.limit,this.skip=e?.skip,this.distinct=e?.distinct,this.count=e?.count,e?.sort){this.sort=Sn(t.document,t.dataType,e.sort);const r=t.search;if(r&&"object"==typeof r){const t=r.sortFields;t&&this.sort.forEach((e=>{if(!t.find((t=>t===e)))throw new Lt({message:Ct("error:UNACCEPTED_SORT_FIELD",{field:e},`Field '${e}' is not available for sort operation`)})}))}}}get dataType(){return this.resource.dataType}}class qn{resource;data;kind="CollectionUpdateManyQuery";method="updateMany";operation="update";filter;constructor(t,e,r){this.resource=t,this.data=e,this.filter="string"==typeof r?.filter?Ar(r.filter):r?.filter}get dataType(){return this.resource.dataType}}class Vn{resource;data;kind="CollectionUpdateQuery";method="update";operation="update";keyValue;pick;omit;include;constructor(t,e,r,i){if(this.resource=t,this.data=r,t.keyFields.length>1){if("object"!=typeof e)throw new Error(`You must provide an key/value object for all key fields (${t.keyFields})`);t.keyFields.reduce(((t,r)=>(t[r]=e[r],t)),{})}else this.keyValue=t.dataType.getFieldType(t.keyFields[0]).parse(e);i?.pick&&(this.pick=Sn(t.document,t.dataType,i.pick)),i?.omit&&(this.omit=Sn(t.document,t.dataType,i.omit)),i?.include&&(this.include=Sn(t.document,t.dataType,i.include))}get dataType(){return this.resource.dataType}}function zn(t){return t&&("SingletonGetQuery"===t.kind||"CollectionGetQuery"===t.kind||"FieldGetQuery"===t.kind)}function Gn(t,e,r){for(const i of Object.getOwnPropertyNames(e.prototype))"constructor"===i||"__proto__"===i||"toJSON"===i||"toString"===i||r&&!r(i)||Object.defineProperty(t.prototype,i,Object.getOwnPropertyDescriptor(e.prototype,i)||Object.create(null))}function Kn(t,e,r=(t=>!0)){try{const i=new e;Object.getOwnPropertyNames(i).filter((e=>void 0!==i[e]&&void 0===t[e])).filter((t=>r(t))).forEach((e=>{t[e]=i[e]}))}catch{}}function Wn(t,e,r,i){const n=[...arguments].filter((t=>!!t));if(!n.length)throw new TypeError("You must provide base classeses");if(1===n.length)return n[0];class s{constructor(){for(const t of n)Kn(this,t)}}const o=[];for(const t of n){const e=Reflect.getOwnMetadata(vi,t);if(e){if("ComplexType"!==e.kind)throw new TypeError(`Class "${t}" is not a ComplexType`);o.push({type:t})}else{if(!Reflect.hasMetadata(Oi,t))throw new TypeError(`Class "${t}" doesn't have datatype metadata information`);{const e=Reflect.getMetadata(Oi,t);e&&o.push(...e)}}Gn(s,t)}if(Vi.SqbConnect){const{Entity:t}=Vi.SqbConnect;t.mixin(s,...n)}return Reflect.defineMetadata(Oi,o,s),s}function Qn(t,e){return Xn(t,t,{pickKeys:e})}function Yn(t,e){return Xn(t,t,{omitKeys:e})}function Xn(t,e,r){const i=r.pickKeys&&r.pickKeys.map((t=>String(t).toLowerCase())),n=r.omitKeys&&r.omitKeys.map((t=>String(t).toLowerCase())),s=t=>(!n||!n.includes(t.toLowerCase()))&&(!i||i.includes(t.toLowerCase()));class o{constructor(){Kn(this,t,s)}}Gn(o,t);const a=[],c=Reflect.getOwnMetadata(vi,t);if(!c)throw new TypeError(`Class "${t}" doesn't have datatype metadata information`);{if("ComplexType"!==c.kind)throw new TypeError(`Class "${t}" is not a ComplexType`);const e={type:t};r.pickKeys&&(e.pick=r.pickKeys),r.omitKeys&&(e.omit=r.omitKeys),a.push(e)}if(Vi.SqbConnect){const{Entity:e,EntityMetadata:r}=Vi.SqbConnect,i=e.getMetadata(t);if(i){const t=r.define(o);r.mixin(t,i,(t=>s(t)))}}return Reflect.defineMetadata(Oi,a,o),o}const Jn=require("events");function Zn(t,e){if(!t)return"";for(;e&&t.startsWith("/");)t=t.substring(1);for(;t.endsWith("/");)t=t.substring(0,t.length-1);return t}function ts(...t){const e=[];let r;for(let i=0,n=t.length;i<n;i++)r=Zn(t[i],i>0),r&&e.push(r);return e.join("/")}const es=/^([^/?#:@]+)(?:@([^/?#:]*))?(?:::(.*))?$/;function rs(e){const r=es.exec(e);if(!r)throw Object.assign(new TypeError("Invalid URL path"),{code:"ERR_INVALID_URL_PATH",input:e});const i=decodeURIComponent(r[1]);let n;if(r[2]){const i=decodeURIComponent(r[2]||""),s=(0,t.splitString)(i,{delimiters:";",quotes:!0,escape:!1});for(const r of s){const i=(0,t.splitString)(r,{delimiters:"=",quotes:!0,escape:!1});if(s.length>1&&i.length<2||n&&i.length>=2&&"object"!=typeof n||i.length<2&&"object"==typeof n)throw Object.assign(new TypeError("Invalid URL path. name:value pair required for multiple key format"),{pathComponent:e,code:"ERR_INVALID_URL_PATH"});i.length>=2?(n=n||{},n[i.shift()||""]=i.join("=")):n=i[0]}}return r[3]?{resource:i,key:n,typeCast:r[3]}:{resource:i,key:n}}function is(t,e,r){if(null==t)return"";let i="";if(""!==e&&null!=e)if(ln(e)){const t=[];for(const r of Object.keys(e))t.push(encodeURIComponent(r)+"="+encodeURIComponent(e[r]));i=t.join(";")}else i=encodeURIComponent(""+e);return r&&(r=encodeURIComponent(r)),encodeURIComponent(t).replace(/%24/,"$")+(i?"@"+i:"")+(r?"::"+r:"")}const ns=Symbol.for("nodejs.util.inspect.custom");class ss{resource;key;typeCast;constructor(t){this.resource=t.resource,this.key=t.key,this.typeCast=t.typeCast}toString(){const t=is(this.resource,this.key,this.typeCast);return t&&Object.setPrototypeOf(t,ss.prototype),t}[ns](){const t={resource:this.resource};return null!=this.key&&(t.key=this.key),null!=this.typeCast&&(t.typeCast=this.typeCast),t}}const os=Symbol.for("nodejs.util.inspect.custom");class as extends Jn.EventEmitter{_entries=[];constructor(...t){super();for(const e of t)li(e)?this._parse(e.pathname):e instanceof as?this._entries.push(...e._entries):this.add(e)}get size(){return this._entries.length}add(t,e,r){this._add(t,e,r),this.emit("change")}clear(){this._entries=[],this.emit("change")}get(t){return this._entries[t]}join(e){const r=(0,t.tokenize)(Zn(e,!0),{delimiters:"/",quotes:!0,brackets:!0});for(const t of r){const e=rs(t);this._add(e)}return this.emit("change"),this}entries(){let t=-1;const e=[...this._entries];return{[Symbol.iterator](){return this},next:()=>(t++,{done:t>=e.length,value:[e[t],t]})}}values(){let t=-1;const e=[...this._entries];return{[Symbol.iterator](){return this},next:()=>(t++,{done:t>=e.length,value:e[t]})}}forEach(t){for(const e of this._entries)t.call(this,e.resource,e.key,this)}getResource(t){const e=this._entries[t];return null==e?void 0:e.resource}getKey(t){const e=this._entries[t];return null==e?void 0:e.key}toString(){return this._entries.map((t=>is(t.resource,t.key,t.typeCast))).join("/")}[Symbol.iterator](){return this.entries()}[os](){return this._entries}_add(t,e,r){t instanceof ss?this._entries.push(t):"object"==typeof t?this._entries.push(new ss(t)):this._entries.push(new ss({resource:t,key:e,typeCast:r}))}_parse(e){if(!e)return;const r=(0,t.tokenize)(e,{delimiters:"/",quotes:!0,brackets:!0});for(const t of r){if(!t)continue;const e=rs(t);this._add(e)}this.emit("change")}}const cs=require("url");class us{}const ls=["true","t","yes","y","1"],hs=["false","f","no","n","0"];const ps=/^(\d{4})(?:-?(0[1-9]|1[012])(?:-?([123]0|[012][1-9]|31))?)?(?:[T ]?([01][0-9]|2[0-3]):?([0-5][0-9]):?([0-5][0-9])?(?:\.(\d+))?(?:(Z)|(?:([+-])([01]?[0-9]|2[0-3]):?([0-5][0-9])?))?)?$/;function ds(t,e,r){if(""===t||null==t)return"";const i=t.match(ps);if(!i)throw new TypeError(`"${t}" is not a valid date.`);let n=i[1]+"-"+(i[2]||"01")+"-"+(i[3]||"01");return e&&(n+="T"+(i[4]||"00")+":"+(i[5]||"00")+":"+(i[6]||"00")+(i[7]?"."+i[7]:""),r&&(n+=i[8]?"Z":i[9]?i[9]+(i[10]||"00")+":"+(i[11]||"00"):"")),n}class fs extends us{max;min;constructor(t){super(),this.max=t?.max,this.min=t?.min}parse(t){const e="number"==typeof t?t:parseFloat(t);if(isNaN(e))throw new TypeError(`"${t}" is not a valid number`);if(null!=this.min&&e<this.min)throw new TypeError(`Value must be ${this.min} or greater.`);if(null!=this.max&&e>this.max)throw new TypeError(`Value must be ${this.max} or less.`);return e}stringify(t){return"number"==typeof t?""+t:""}}class gs extends fs{enum;constructor(t){super(t),this.enum=t?.enum}parse(t){const e=super.parse(t);if(!Number.isInteger(e))throw new TypeError(`"${t}" is not a valid integer`);if(this.enum&&!this.enum.includes(e))throw new TypeError(`"${t}" is not one of allowed enum values (${this.enum}).`);return e}}const ys={integer:new gs,number:new fs,string:new class extends us{maxLength;minLength;enum;constructor(t){super(),this.maxLength=t?.maxLength,this.minLength=t?.minLength,this.enum=t?.enum}parse(t){if(null!=this.minLength&&t.length<this.minLength)throw new TypeError(`Value must be at least ${this.minLength} character${this.minLength>1?"s":""} long.`);if(null!=this.maxLength&&t.length>this.maxLength)throw new TypeError(`Value can be up to ${this.maxLength} character${this.maxLength>1?"s":""} long.`);if(this.enum&&!this.enum.includes(t))throw new TypeError(`"${t}" is not one of allowed enum values (${this.enum}).`);return t}stringify(t){return null==t?"":""+t}},boolean:new class extends us{parse(t){if(""===t)return!0;if("boolean"==typeof t)return t;if(ls.includes(t.toLowerCase()))return!0;if(hs.includes(t.toLowerCase()))return!1;throw new TypeError(`"${t}" is not a valid boolean`)}stringify(t){return"boolean"==typeof t?t?"true":"false":""}},date:new class extends us{time;timeZone;min;max;constructor(t){super(),this.max=t?.max?ds(t.max):void 0,this.min=t?.min?ds(t.min):void 0,this.time=t?.time??!0,this.timeZone=t?.timeZone??!0}parse(t){const e=ds(t,this.time,this.timeZone);if(null!=this.min&&e<this.min)throw new TypeError(`Value must be ${this.min} or greater.`);if(null!=this.max&&e>this.max)throw new TypeError(`Value must be ${this.max} or less.`);return e}stringify(t){return ds(t,this.time,this.timeZone)}},filter:new class extends us{parse(t){return t instanceof Gt?t:Ar(t)}stringify(t){return t?""+t:""}}},ms=Symbol.for("nodejs.util.inspect.custom");class _s extends Jn.EventEmitter{_params=new zi;_entries=new zi;_size=0;constructor(t){super(),this.defineParam("$filter",{format:"filter"}),this.defineParam("$limit",{format:new gs({min:0})}),this.defineParam("$skip",{format:new gs({min:0})}),this.defineParam("$pick",{format:"string",array:"strict"}),this.defineParam("$omit",{format:"string",array:"strict"}),this.defineParam("$include",{format:"string",array:"strict"}),this.defineParam("$sort",{format:"string",array:"strict"}),this.defineParam("$distinct",{format:"boolean"}),this.defineParam("$count",{format:"boolean"}),t&&("string"==typeof t?this.parse(t):this.addAll(t))}get size(){return this._size}addAll(t){let e=!1;if("function"==typeof t.forEach)t.forEach(((t,r)=>{e=this._add(r,t)||e}));else{if("object"!=typeof t)throw new TypeError("Invalid argument");Object.entries(((t,r)=>{e=this._add(t,r)||e}))}e&&this.emit("change")}append(t,e){this._add(t,e)&&this.emit("change")}clear(){this._entries.clear(),this._size=0,this.emit("change")}defineParam(t,e){if(!t)throw new Error("Parameter name required");const r={...e,name:t,format:e?.format||"string"};if("string"==typeof r.format&&!ys[r.format])throw new Error(`Unknown data format "${r.format}"`);return r.format=r.format||"string",this._params.set(t,r),this}delete(t){this._delete(t)&&this.emit("change")}entries(){const t=[];return this.forEach(((e,r)=>{t.push([r,e])})),t.values()}forEach(t){for(const[e,r]of this._entries.entries())for(let i=0;i<r.length;i++)t(r[i],e,this)}get(t,e){const r=this._entries.get(t),i=r&&r[e||0];return null==i?null:i}getAll(t){const e=this._entries.get(t);return e?e.slice(0):[]}has(t){return this._entries.has(t)}keys(){return this._entries.keys()}set(t,e){this._delete(t),this._add(t,e),this.emit("change")}sort(t){this._entries.sort(t),this.emit("change")}values(){const t=[];return this.forEach((e=>t.push(e))),t.values()}toString(){let t="";return this.forEach(((e,r)=>{const i=this._params.get(r),n=i?"string"==typeof i.format?ys[i.format]:i.format:void 0,s=t=>encodeURIComponent(n?n.stringify(t,r):null==t?"":""+t),o=Array.isArray(e)?e.map(s).join(i?.arrayDelimiter||","):s(e);o&&(t.length>0&&(t+="&"),t+=r+"="+o)})),t}parse(e){if(this._entries.clear(),this._size=0,e&&e.startsWith("?")&&(e=e.substring(1)),!e)return;const r=(0,t.tokenize)(e,{delimiters:"&",quotes:!0,brackets:!0});for(const e of r){if(!e)continue;const r=(0,t.tokenize)(e,{delimiters:"=",quotes:!0,brackets:!0}),i=decodeURIComponent(r.next()||""),n=r.join("="),s=this._params.get(i);if(s?.array){const e=(0,t.splitString)(n,{delimiters:s?.arrayDelimiter||",",brackets:!0,quotes:!0}).map((t=>decodeURIComponent(t)));this._add(i,e)}else this._add(i,decodeURIComponent(n))}this.emit("change")}toURLSearchParams(){const t=new cs.URLSearchParams;return this.forEach(((e,r)=>{const i=this._params.get(r),n=i?"string"==typeof i.format?ys[i.format]:i.format:void 0,s=t=>n?n.stringify(t,r):null==t?"":""+t,o=Array.isArray(e)?e.map(s).join(i?.arrayDelimiter||","):s(e);t.append(r,o)})),t}[Symbol.iterator](){return this.entries()}get[Symbol.toStringTag](){return"URLSearchParams"}[ms](){return this._entries}_delete(t){const e=this._entries.get(t);return!!e&&(this._size-=e.length,this._entries.delete(t),!0)}_add(t,e){const r=this._params.get(t),i=r?"string"==typeof r.format?ys[r.format]:r.format:void 0,n=e=>i?i.parse(e,t):e;let s=Array.isArray(e)?e.map(n):n(e);if(r&&("strict"===r.array?s=Array.isArray(s)?s:[s]:r.array&&(s=Array.isArray(s)&&1===s.length?s[0]:s),Array.isArray(s))){if(r.minArrayItems&&s.length<r.minArrayItems)throw new Error(`"${t}" parameter requires at least ${r.minArrayItems} values`);if(r.maxArrayItems&&s.length>r.maxArrayItems)throw new Error(`"${t}" parameter accepts up to ${r.maxArrayItems} values`)}let o=this._entries.get(t);return o||(o=[],this._entries.set(t,o)),o.push(s),this._size++,!0}}const vs=Symbol.for("nodejs.util.inspect.custom"),Ts=/^(?:((?:[A-Z][A-Z+-.]+:)+)\/\/([^/?]+))?(.*)?$/i,Es=/^([A-Z][A-Z+-.]+:?)+$/i,bs=/^([^/:]+)(?::(\d+))?$/,xs=/^([^/:]+)$/,Os=Symbol.for("opra.url.context"),Rs=Symbol.for("opra.url.path"),ws=Symbol.for("opra.url.searchparams");class ks{[Os];[Rs];[ws];constructor(t,e){Object.defineProperty(this,Os,{writable:!0,configurable:!0,enumerable:!1,value:{}}),Object.defineProperty(this,Rs,{writable:!0,configurable:!0,enumerable:!1,value:new as}),Object.defineProperty(this,ws,{writable:!0,configurable:!0,enumerable:!1,value:new _s}),this.searchParams.on("change",(()=>this._invalidate())),this.path.on("change",(()=>this._invalidate())),e&&this.setPrefix(e),t&&this.parse(t)}get address(){this._update();let t="";return this.hostname&&(t+=this.protocol+"//"+(this.username||this.password?(this.username?encodeURIComponent(this.username):"")+(this.password?":"+encodeURIComponent(this.password):"")+"@":"")+this.host),t+this.pathPrefix+this.pathname}get href(){return this.address+this.search+this.hash}get protocol(){return this[Os].protocol||"http:"}set protocol(t){if(!Es.test(t))throw Object.assign(new TypeError("Invalid protocol"),{protocol:t,code:"ERR_INVALID_URL"});this[Os].protocol=t+(t.endsWith(":")?"":":")}get username(){return this[Os].username||""}set username(t){this[Os].username=t}get password(){return this[Os].password||""}set password(t){this[Os].password=t}get host(){return this.hostname?this.hostname+(this.port?":"+this.port:""):""}set host(t){const e=bs.exec(t);if(!e)throw Object.assign(new TypeError("Invalid host"),{host:t,code:"ERR_INVALID_URL"});this[Os].hostname=e[1],this[Os].port=e[2]?parseInt(e[2],10):null}get hostname(){return this[Os].hostname||""}set hostname(t){if(!xs.test(t))throw Object.assign(new TypeError("Invalid hostname"),{hostname:t,code:"ERR_INVALID_URL"});this[Os].hostname=t}get port(){const t=this[Os].port;return null==t?null:t}set port(t){if(null!=t){if("number"!=typeof t||isNaN(t)||t<1||t>35535||t%1>0)throw Object.assign(new TypeError("Invalid port"),{hostname:t,code:"ERR_INVALID_URL"});this[Os].port=t}else this[Os].port=null}get origin(){return this.hostname?this.protocol+"//"+this.hostname:""}get pathPrefix(){return this[Os].pathPrefix||""}set pathPrefix(e){e?(e=Zn((0,t.tokenize)(e,{delimiters:"#?",quotes:!0,brackets:!0}).next()||"",!0)).includes("://")?this[Os].pathPrefix=e:this[Os].pathPrefix=e?"/"+e:"":this[Os].pathPrefix=""}get path(){return this[Rs]}get pathname(){return this._update(),this[Os].pathname||""}set pathname(t){this._setPathname(t,!1)}get searchParams(){return this[ws]}get hash(){return this[Os].hash||""}set hash(t){this[Os].hash=t?t.startsWith("#")?t:"#"+t:""}get search(){return this._update(),this[Os].search||""}set search(t){this.searchParams.parse(t)}addPath(t,e){return this.path.add(t,e),this}addSearchParam(t,e){return this.searchParams.append(t,e),this}setHost(t){return this.host=t,this}setHostname(t){return this.hostname=t,this}setProtocol(t){return this.protocol=t,this}setPort(t){return this.port=t,this}setPrefix(t){return this.pathPrefix=t,this}setPathname(t){return this.pathname=t,this}setHash(t){return this.hash=t,this}setSearch(t){return this.search=t,this}setSearchParam(t,e){return this.searchParams.set(t,e),this}parse(e){const r=Ts.exec(e);if(!r)throw Object.assign(new TypeError("Invalid URL"),{input:e,code:"ERR_INVALID_URL"});if(r[1]&&(this.protocol=r[1]),r[2]){let e=(0,t.splitString)(r[2],{delimiters:"@"});e.length>1?(this.host=e[1],e=(0,t.splitString)(e[0],{delimiters:":"}),this.username=e[0]?decodeURIComponent(e[0]):"",this.password=e[1]?decodeURIComponent(e[1]):""):this.host=e[0]}e=r[3]||"";let i=(0,t.tokenize)(e,{delimiters:"#",quotes:!0,brackets:!0});return e=i.next()||"",this.hash=i.join("#"),i=(0,t.tokenize)(e,{delimiters:"?",quotes:!0,brackets:!0}),this._setPathname(i.next()||"",!0),this.searchParams.clear(),this.searchParams.parse(i.join("&")),this}toString(){return this.href}[vs](){return this._update(),{protocol:this.protocol,username:this.username,password:this.password,host:this.host,hostname:this.hostname,origin:this.origin,pathPrefix:this.pathPrefix,path:this.path,pathname:this.pathname,search:this.search,searchParams:this.searchParams,hash:this.hash}}_invalidate(){this[Os].needUpdate=!0}_update(){if(!this[Os].needUpdate)return;this[Os].needUpdate=!1;let t=this.path.toString();this[Os].pathname=t?"/"+t:"",t=this.searchParams.toString(),this[Os].search=t?"?"+t:""}_setPathname(e,r){if(this.path.clear(),!e)return;const i=(0,t.tokenize)(Zn(e,!0),{delimiters:"/",quotes:!0,brackets:!0});if(r&&this.pathPrefix){const r=(0,t.tokenize)(Zn(this.pathPrefix,!0),{delimiters:"/",quotes:!0,brackets:!0});for(const t of r){if(t!==i.next())throw Object.assign(new Error("Invalid URL path. pathPrefix does not match"),{path:e,code:"ERR_INVALID_URL_PATH"})}}for(const t of i){const e=rs(t);this.path.add(e)}}}var Ss=y(135);const Cs=require("stream"),As=Buffer.from("\r\n"),Is=Symbol("kHeaders"),Ls=Symbol("kHeadersCount"),Ns=Symbol("kTrailers"),Ps=Symbol("kTrailersCount");class Ds extends Cs.Readable{httpVersionMajor;httpVersionMinor;httpVersion;complete;rawHeaders;rawTrailers;aborted=!1;upgrade;url;originalUrl;method;shouldKeepAlive;data;body;[Is];[Ls];[Ns];[Ps];get headers(){return this[Is]||(this[Is]=js(this.rawHeaders)),this[Is]}get headersCount(){return this[Ls]}get trailers(){return this[Ns]||(this[Ns]=js(this.rawTrailers)),this[Ns]}get trailersCount(){return this[Ps]}_read(){this.data&&this.push(this.data),this.push(null)}static parse(t){const e=new Ss.HTTPParser(Ss.HTTPParser.REQUEST),r=new Ds,i=[];if(e[Ss.HTTPParser.kOnHeadersComplete]=function(t){r.shouldKeepAlive=t.shouldKeepAlive,r.upgrade=t.upgrade,r.method=Ss.HTTPParser.methods[t.method],r.url=t.url,r.originalUrl=t.url,r.httpVersionMajor=t.versionMajor,r.httpVersionMinor=t.versionMinor,r.httpVersion=t.versionMajor+"."+t.versionMinor,r.rawHeaders=t.headers,r[Ls]=Math.ceil(t.headers.length/2),r[Ps]=0},e[Ss.HTTPParser.kOnBody]=function(t,e,r){i.push(t.subarray(e,e+r))},e[Ss.HTTPParser.kOnHeaders]=function(t){r.rawTrailers=t,r[Ps]=Math.ceil(t.length/2)},e[Ss.HTTPParser.kOnMessageComplete]=function(){r.complete=!0},e.execute(t),r.complete||e.execute(As),e.finish(),!r.complete)throw new Error("Could not parse request");return r.rawTrailers=r.rawTrailers||[],i.length&&(r.data=Buffer.concat(i)),r.resume(),r}}function js(t){const e={};for(let r=0;r<t.length;r++){const i=t[r].toLowerCase(),n=t[++r],s=e[i];if(s&&"set-cookie"===i){const t=Array.isArray(s)?s:[s];t.push(n),e[i]=t}else"string"==typeof s?e[i]+=("cookie"===i?"; ":", ")+n:e[i]=n}return e}const Fs=/^([^.]+)\.(.*)$/;function Us(t,e){if(t.length)return Ms(t,{},e)}function Ms(t,e,r){for(let i of t){r&&(i=i.toLowerCase());const t=Fs.exec(i);if(t){const r=t[1];if(!0===e[r])continue;const i=e[r]="object"==typeof e[r]?e[r]:{};Ms([t[2]],i)}else e[i]=!0}return e}})(),m})()));
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HeadersMap = void 0;
|
|
4
|
-
const http_headers_enum_js_1 = require("../enums/http-headers.enum.js");
|
|
5
|
-
const responsive_map_js_1 = require("./responsive-map.js");
|
|
6
|
-
class HeadersMap extends responsive_map_js_1.ResponsiveMap {
|
|
7
|
-
constructor(data) {
|
|
8
|
-
super(data, Array.from(Object.values(http_headers_enum_js_1.HttpHeaders)));
|
|
9
|
-
}
|
|
10
|
-
toObject() {
|
|
11
|
-
return Array.from(this.keys()).sort()
|
|
12
|
-
.reduce((a, k) => {
|
|
13
|
-
a[k] = this.get(k);
|
|
14
|
-
return a;
|
|
15
|
-
}, {});
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
exports.HeadersMap = HeadersMap;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { HttpHeaders } from '../enums/http-headers.enum.js';
|
|
2
|
-
import { ResponsiveMap } from './responsive-map.js';
|
|
3
|
-
export class HeadersMap extends ResponsiveMap {
|
|
4
|
-
constructor(data) {
|
|
5
|
-
super(data, Array.from(Object.values(HttpHeaders)));
|
|
6
|
-
}
|
|
7
|
-
toObject() {
|
|
8
|
-
return Array.from(this.keys()).sort()
|
|
9
|
-
.reduce((a, k) => {
|
|
10
|
-
a[k] = this.get(k);
|
|
11
|
-
return a;
|
|
12
|
-
}, {});
|
|
13
|
-
}
|
|
14
|
-
}
|