gina 0.3.2 → 0.3.3
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/CHANGELOG.md +29 -0
- package/README.md +18 -8
- package/ROADMAP.md +10 -9
- package/framework/v0.3.3/VERSION +1 -0
- package/framework/{v0.3.2 → v0.3.3}/core/asset/plugin/README.md +7 -8
- package/framework/{v0.3.2 → v0.3.3}/core/asset/plugin/dist/vendor/gina/html/toolbar.html +1 -1
- package/framework/v0.3.3/core/asset/plugin/dist/vendor/gina/html/toolbar.html.br +0 -0
- package/framework/v0.3.3/core/asset/plugin/dist/vendor/gina/html/toolbar.html.gz +0 -0
- package/framework/{v0.3.2 → v0.3.3}/core/asset/plugin/dist/vendor/gina/inspector/inspector.css +2 -0
- package/framework/{v0.3.2 → v0.3.3}/core/asset/plugin/dist/vendor/gina/inspector/inspector.js +103 -0
- package/framework/{v0.3.2 → v0.3.3}/core/asset/plugin/dist/vendor/gina/js/gina.js +293 -201
- package/framework/v0.3.3/core/asset/plugin/dist/vendor/gina/js/gina.min.js +21636 -0
- package/framework/v0.3.3/core/asset/plugin/dist/vendor/gina/js/gina.min.js.br +0 -0
- package/framework/v0.3.3/core/asset/plugin/dist/vendor/gina/js/gina.min.js.gz +0 -0
- package/framework/v0.3.3/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js +286 -0
- package/framework/v0.3.3/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js.br +0 -0
- package/framework/v0.3.3/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js.gz +0 -0
- package/framework/{v0.3.2 → v0.3.3}/core/config.js +6 -1
- package/framework/{v0.3.2 → v0.3.3}/core/connectors/mysql/index.js +52 -0
- package/framework/{v0.3.2 → v0.3.3}/core/connectors/postgresql/index.js +45 -0
- package/framework/{v0.3.2 → v0.3.3}/core/connectors/sqlite/index.js +46 -0
- package/framework/{v0.3.2 → v0.3.3}/core/controller/controller.js +1 -1
- package/framework/{v0.3.2 → v0.3.3}/core/deps/busboy-1.6.0/lib/types/multipart.js +2 -1
- package/framework/v0.3.3/core/deps/streamsearch-1.1.0/LICENSE +19 -0
- package/framework/v0.3.3/core/deps/streamsearch-1.1.0/lib/sbmh.js +267 -0
- package/framework/v0.3.3/core/deps/streamsearch-1.1.0/package.json +34 -0
- package/framework/{v0.3.2 → v0.3.3}/core/gna.js +30 -30
- package/framework/{v0.3.2 → v0.3.3}/core/plugins/lib/storage/src/main.js +3 -3
- package/framework/{v0.3.2 → v0.3.3}/core/plugins/lib/validator/src/main.js +34 -29
- package/framework/{v0.3.2 → v0.3.3}/core/server.isaac.js +77 -13
- package/framework/{v0.3.2 → v0.3.3}/core/server.js +66 -18
- package/framework/{v0.3.2 → v0.3.3}/helpers/json/src/main.js +14 -1
- package/framework/{v0.3.2 → v0.3.3}/lib/cache/src/main.js +2 -2
- package/framework/{v0.3.2 → v0.3.3}/lib/cmd/aliases.json +3 -0
- package/framework/{v0.3.2 → v0.3.3}/lib/cmd/bundle/arguments.json +2 -1
- package/framework/{v0.3.2 → v0.3.3}/lib/cmd/bundle/help.txt +21 -1
- package/framework/v0.3.3/lib/cmd/bundle/oas.js +6 -0
- package/framework/v0.3.3/lib/cmd/bundle/openapi.js +519 -0
- package/framework/{v0.3.2 → v0.3.3}/lib/cmd/bundle/start.js +4 -1
- package/framework/v0.3.3/lib/cmd/framework/get.js +98 -0
- package/framework/{v0.3.2 → v0.3.3}/lib/cmd/framework/help.txt +8 -3
- package/framework/{v0.3.2 → v0.3.3}/lib/cmd/port/help.txt +7 -2
- package/framework/v0.3.3/lib/cmd/port/set.js +348 -0
- package/framework/{v0.3.2 → v0.3.3}/lib/collection/src/main.js +4 -4
- package/framework/{v0.3.2 → v0.3.3}/lib/index.js +1 -0
- package/framework/{v0.3.2 → v0.3.3}/lib/logger/src/containers/mq/listener.js +2 -2
- package/framework/v0.3.3/lib/uuid/package.json +7 -0
- package/framework/v0.3.3/lib/uuid/src/main.js +99 -0
- package/framework/v0.3.3/package.json +8 -0
- package/gna.js +86 -0
- package/llms.txt +94 -4
- package/package.json +107 -101
- package/types/globals.d.ts +205 -0
- package/types/gna.d.ts +67 -0
- package/types/index.d.ts +566 -0
- package/framework/v0.3.2/VERSION +0 -1
- package/framework/v0.3.2/core/asset/plugin/dist/vendor/gina/html/toolbar.html.br +0 -0
- package/framework/v0.3.2/core/asset/plugin/dist/vendor/gina/html/toolbar.html.gz +0 -0
- package/framework/v0.3.2/core/asset/plugin/dist/vendor/gina/js/gina.min.js +0 -532
- package/framework/v0.3.2/core/asset/plugin/dist/vendor/gina/js/gina.min.js.br +0 -0
- package/framework/v0.3.2/core/asset/plugin/dist/vendor/gina/js/gina.min.js.gz +0 -0
- package/framework/v0.3.2/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js +0 -8
- package/framework/v0.3.2/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js.br +0 -0
- package/framework/v0.3.2/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js.gz +0 -0
- package/framework/v0.3.2/core/deps/swig-1.4.2/CONTRIBUTING.md +0 -107
- package/framework/v0.3.2/core/deps/swig-1.4.2/HISTORY.md +0 -498
- package/framework/v0.3.2/core/deps/swig-1.4.2/LICENSE +0 -7
- package/framework/v0.3.2/core/deps/swig-1.4.2/Makefile +0 -192
- package/framework/v0.3.2/core/deps/swig-1.4.2/README.md +0 -88
- package/framework/v0.3.2/core/deps/swig-1.4.2/bin/swig.js +0 -161
- package/framework/v0.3.2/core/deps/swig-1.4.2/browser/comments.js +0 -2
- package/framework/v0.3.2/core/deps/swig-1.4.2/browser/index.js +0 -9
- package/framework/v0.3.2/core/deps/swig-1.4.2/dist/swig.min.js +0 -7
- package/framework/v0.3.2/core/deps/swig-1.4.2/docs/docs/api.html +0 -136
- package/framework/v0.3.2/core/deps/swig-1.4.2/docs/docs/browser.html +0 -36
- package/framework/v0.3.2/core/deps/swig-1.4.2/docs/docs/cli.html +0 -64
- package/framework/v0.3.2/core/deps/swig-1.4.2/docs/docs/extending.html +0 -183
- package/framework/v0.3.2/core/deps/swig-1.4.2/docs/docs/filters.html +0 -97
- package/framework/v0.3.2/core/deps/swig-1.4.2/docs/docs/includes/TYPES.html +0 -0
- package/framework/v0.3.2/core/deps/swig-1.4.2/docs/docs/includes/macros.html +0 -9
- package/framework/v0.3.2/core/deps/swig-1.4.2/docs/docs/index.html +0 -212
- package/framework/v0.3.2/core/deps/swig-1.4.2/docs/docs/layout.html +0 -43
- package/framework/v0.3.2/core/deps/swig-1.4.2/docs/docs/loaders.html +0 -106
- package/framework/v0.3.2/core/deps/swig-1.4.2/docs/docs/previous.html +0 -25
- package/framework/v0.3.2/core/deps/swig-1.4.2/docs/docs/tags.html +0 -72
- package/framework/v0.3.2/core/deps/swig-1.4.2/docs/docs.json +0 -3
- package/framework/v0.3.2/core/deps/swig-1.4.2/docs/index.html +0 -98
- package/framework/v0.3.2/core/deps/swig-1.4.2/docs/index.json +0 -3
- package/framework/v0.3.2/core/deps/swig-1.4.2/docs/js/lib/rainbow.min.js +0 -11
- package/framework/v0.3.2/core/deps/swig-1.4.2/docs/js/master.js +0 -106
- package/framework/v0.3.2/core/deps/swig-1.4.2/docs/layouts/html5.html +0 -25
- package/framework/v0.3.2/core/deps/swig-1.4.2/docs/layouts/master.html +0 -59
- package/framework/v0.3.2/core/deps/swig-1.4.2/docs/less/button.less +0 -22
- package/framework/v0.3.2/core/deps/swig-1.4.2/docs/less/fork.less +0 -23
- package/framework/v0.3.2/core/deps/swig-1.4.2/docs/less/header.less +0 -61
- package/framework/v0.3.2/core/deps/swig-1.4.2/docs/less/layout.less +0 -96
- package/framework/v0.3.2/core/deps/swig-1.4.2/docs/less/mixins.less +0 -268
- package/framework/v0.3.2/core/deps/swig-1.4.2/docs/less/rainbow.less +0 -58
- package/framework/v0.3.2/core/deps/swig-1.4.2/docs/less/reset.less +0 -250
- package/framework/v0.3.2/core/deps/swig-1.4.2/docs/less/sidenav.less +0 -16
- package/framework/v0.3.2/core/deps/swig-1.4.2/docs/less/swig.less +0 -124
- package/framework/v0.3.2/core/deps/swig-1.4.2/docs/less/variables.less +0 -42
- package/framework/v0.3.2/core/deps/swig-1.4.2/index.js +0 -1
- package/framework/v0.3.2/core/deps/swig-1.4.2/lib/dateformatter.js +0 -198
- package/framework/v0.3.2/core/deps/swig-1.4.2/lib/filters.js +0 -630
- package/framework/v0.3.2/core/deps/swig-1.4.2/lib/lexer.js +0 -306
- package/framework/v0.3.2/core/deps/swig-1.4.2/lib/loaders/filesystem.js +0 -59
- package/framework/v0.3.2/core/deps/swig-1.4.2/lib/loaders/index.js +0 -53
- package/framework/v0.3.2/core/deps/swig-1.4.2/lib/loaders/memory.js +0 -63
- package/framework/v0.3.2/core/deps/swig-1.4.2/lib/parser.js +0 -744
- package/framework/v0.3.2/core/deps/swig-1.4.2/lib/swig.js +0 -740
- package/framework/v0.3.2/core/deps/swig-1.4.2/lib/tags/autoescape.js +0 -37
- package/framework/v0.3.2/core/deps/swig-1.4.2/lib/tags/block.js +0 -25
- package/framework/v0.3.2/core/deps/swig-1.4.2/lib/tags/else.js +0 -25
- package/framework/v0.3.2/core/deps/swig-1.4.2/lib/tags/elseif.js +0 -28
- package/framework/v0.3.2/core/deps/swig-1.4.2/lib/tags/extends.js +0 -19
- package/framework/v0.3.2/core/deps/swig-1.4.2/lib/tags/filter.js +0 -68
- package/framework/v0.3.2/core/deps/swig-1.4.2/lib/tags/for.js +0 -130
- package/framework/v0.3.2/core/deps/swig-1.4.2/lib/tags/if.js +0 -86
- package/framework/v0.3.2/core/deps/swig-1.4.2/lib/tags/import.js +0 -91
- package/framework/v0.3.2/core/deps/swig-1.4.2/lib/tags/include.js +0 -100
- package/framework/v0.3.2/core/deps/swig-1.4.2/lib/tags/index.js +0 -16
- package/framework/v0.3.2/core/deps/swig-1.4.2/lib/tags/macro.js +0 -79
- package/framework/v0.3.2/core/deps/swig-1.4.2/lib/tags/parent.js +0 -51
- package/framework/v0.3.2/core/deps/swig-1.4.2/lib/tags/raw.js +0 -23
- package/framework/v0.3.2/core/deps/swig-1.4.2/lib/tags/set.js +0 -109
- package/framework/v0.3.2/core/deps/swig-1.4.2/lib/tags/spaceless.js +0 -42
- package/framework/v0.3.2/core/deps/swig-1.4.2/lib/utils.js +0 -184
- package/framework/v0.3.2/core/deps/swig-1.4.2/package.json +0 -41
- package/framework/v0.3.2/core/deps/swig-1.4.2/scripts/config-lint.js +0 -41
- package/framework/v0.3.2/core/deps/swig-1.4.2/scripts/githooks/post-merge +0 -3
- package/framework/v0.3.2/core/deps/swig-1.4.2/scripts/githooks/pre-commit +0 -59
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/basic.test.js +0 -296
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/bin/bin.filters.js +0 -3
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/bin/bin.locals.js +0 -5
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/bin/bin.locals.json +0 -7
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/bin/bin.tags.js +0 -15
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/bin/bin.test.js +0 -159
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/bin/custom_filter.bin.html +0 -1
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/bin/custom_tag.bin.html +0 -1
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/bin/custom_tagControls.bin.html +0 -1
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/bin/custom_varControls.bin.html +0 -1
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/bin/options.js +0 -3
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases/extends_1.expectation.html +0 -6
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases/extends_1.test.html +0 -3
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases/extends_2.expectation.html +0 -6
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases/extends_2.test.html +0 -5
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases/extends_base.html +0 -6
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases/extends_layouts/extends_4.base.html +0 -1
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases/extends_layouts/extends_4.middle.html +0 -2
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases/extends_layouts/extends_bare.html +0 -2
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases/extends_layouts/extends_base.html +0 -3
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases/extends_layouts/extends_include.html +0 -3
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases/extends_layouts/extends_real_base.html +0 -1
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases/extends_set.expectation.html +0 -6
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases/extends_set.test.html +0 -4
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases/extends_tests/extends_3.expectation.html +0 -1
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases/extends_tests/extends_3.test.html +0 -3
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases/extends_tests/extends_4.expectation.html +0 -1
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases/extends_tests/extends_4.test.html +0 -2
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases/import.expectation.html +0 -24
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases/import.test.html +0 -10
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases/include.expectation.html +0 -24
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases/include.test.html +0 -13
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases/include_bar.html +0 -1
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases/include_extends.expectation.html +0 -4
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases/include_extends.test.html +0 -1
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases/includes.html +0 -1
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases/macros.expectation.html +0 -8
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases/macros.html +0 -23
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases/macros.test.html +0 -11
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases/nested_blocks.expectation.html +0 -3
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases/nested_blocks.test.html +0 -3
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases/nested_blocks_parent.html +0 -3
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases/parent-parent.expectation.html +0 -8
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases/parent-parent.test.html +0 -1
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases/parent.expectation.html +0 -8
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases/parent.test.html +0 -9
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases/set.expectation.html +0 -3
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases/set.test.html +0 -8
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases-error/circular.test.html +0 -1
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases-error/circular_parent.html +0 -1
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases-error/extends-non-existent.test.html +0 -1
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases-error/report-filename-partial.html +0 -1
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/cases-error/report-filename.test.html +0 -1
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/comments.test.js +0 -12
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/filters.test.js +0 -316
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/loaders.test.js +0 -119
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/regressions.test.js +0 -41
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/tags/autoescape.test.js +0 -45
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/tags/else.test.js +0 -61
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/tags/extend.test.js +0 -11
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/tags/filter.test.js +0 -29
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/tags/for.test.js +0 -63
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/tags/if.test.js +0 -75
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/tags/import.test.js +0 -15
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/tags/include.test.js +0 -26
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/tags/macro.test.js +0 -38
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/tags/parent.test.js +0 -14
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/tags/raw.test.js +0 -33
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/tags/set.test.js +0 -56
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/tags/spaceless.test.js +0 -26
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/tags.test.js +0 -56
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/templates.test.js +0 -62
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/variables.test.js +0 -183
- package/framework/v0.3.2/core/deps/swig-1.4.2/tests/whitespace.test.js +0 -43
- package/framework/v0.3.2/lib/cmd/framework/get.js +0 -0
- package/framework/v0.3.2/lib/cmd/port/set.js +0 -0
- package/framework/v0.3.2/package.json +0 -5
- /package/framework/{v0.3.2 → v0.3.3}/AUTHORS +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/LICENSE +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/asset/html/nolayout.html +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/asset/html/static.html +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/asset/img/android-chrome-192x192.png +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/asset/img/android-chrome-512x512.png +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/asset/img/apple-touch-icon.png +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/asset/img/favicon-16x16.png +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/asset/img/favicon-32x32.png +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/asset/img/favicon.ico +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/asset/plugin/dist/vendor/gina/beemaster/beemaster.css +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/asset/plugin/dist/vendor/gina/beemaster/beemaster.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/asset/plugin/dist/vendor/gina/beemaster/index.html +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/asset/plugin/dist/vendor/gina/css/gina.min.css +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/asset/plugin/dist/vendor/gina/css/gina.min.css.br +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/asset/plugin/dist/vendor/gina/css/gina.min.css.gz +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/asset/plugin/dist/vendor/gina/html/statusbar.html +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/asset/plugin/dist/vendor/gina/html/statusbar.html.br +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/asset/plugin/dist/vendor/gina/html/statusbar.html.gz +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/asset/plugin/dist/vendor/gina/inspector/have_heart_one-webfont.woff2 +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/asset/plugin/dist/vendor/gina/inspector/index.html +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/asset/plugin/dist/vendor/gina/inspector/logo.svg +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/connectors/ai/index.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/connectors/ai/lib/connector.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/connectors/couchbase/index.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/connectors/couchbase/lib/connector.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/connectors/couchbase/lib/connector.v2.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/connectors/couchbase/lib/connector.v3.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/connectors/couchbase/lib/connector.v4.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/connectors/couchbase/lib/n1ql.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/connectors/couchbase/lib/session-store.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/connectors/couchbase/lib/session-store.v2.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/connectors/couchbase/lib/session-store.v3.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/connectors/couchbase/lib/session-store.v4.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/connectors/mysql/lib/connector.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/connectors/postgresql/lib/connector.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/connectors/redis/index.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/connectors/redis/lib/session-store.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/connectors/sql-parser.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/connectors/sqlite/lib/connector.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/connectors/sqlite/lib/session-store.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/content.encoding +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/controller/controller.framework.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/controller/controller.render-json.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/controller/controller.render-stream.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/controller/controller.render-swig.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/controller/controller.render-v1.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/controller/index.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/deps/busboy-1.6.0/LICENSE +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/deps/busboy-1.6.0/README.md +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/deps/busboy-1.6.0/lib/index.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/deps/busboy-1.6.0/lib/types/urlencoded.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/deps/busboy-1.6.0/lib/utils.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/deps/busboy-1.6.0/package.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/deps/optimist-0.6.1/LICENSE +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/deps/optimist-0.6.1/index.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/deps/optimist-0.6.1/package.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/deps/optimist-0.6.1/readme.markdown +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/deps/swig-client/swig-2.0.0.min.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/deps/swig-client/swig.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/dev/index.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/dev/lib/class.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/dev/lib/factory.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/dev/lib/tools.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/locales/README.md +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/locales/currency.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/locales/dist/language/en.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/locales/dist/language/fr.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/locales/dist/region/en.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/locales/dist/region/fr.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/locales/index.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/mime.types +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/model/entity.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/model/index.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/model/template/entityFactory.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/model/template/index.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/plugins/README.md +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/plugins/index.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/plugins/lib/file/README.md +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/plugins/lib/file/build.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/plugins/lib/file/package.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/plugins/lib/intl/README.md +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/plugins/lib/intl/build.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/plugins/lib/intl/package.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/plugins/lib/intl/src/main.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/plugins/lib/storage/README.md +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/plugins/lib/storage/build.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/plugins/lib/storage/package.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/plugins/lib/validator/README.md +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/plugins/lib/validator/build.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/plugins/lib/validator/package.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/plugins/lib/validator/src/form-validator.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/router.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/server.express.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/status.codes +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/template/_gitignore +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/template/boilerplate/bundle/config/app.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/template/boilerplate/bundle/config/connectors.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/template/boilerplate/bundle/config/routing.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/template/boilerplate/bundle/config/settings.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/template/boilerplate/bundle/config/settings.server.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/template/boilerplate/bundle/config/templates.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/template/boilerplate/bundle/config/watchers.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/template/boilerplate/bundle/controllers/controller.content.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/template/boilerplate/bundle/controllers/controller.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/template/boilerplate/bundle/controllers/setup.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/template/boilerplate/bundle/index.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/template/boilerplate/bundle_namespace/controllers/controller.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/template/boilerplate/bundle_public/css/default.css +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/template/boilerplate/bundle_public/css/home.css +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/template/boilerplate/bundle_public/css/vendor/readme.md +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/template/boilerplate/bundle_public/favicon.ico +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/template/boilerplate/bundle_public/js/vendor/readme.md +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/template/boilerplate/bundle_public/readme.md +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/template/boilerplate/bundle_templates/handlers/main.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/template/boilerplate/bundle_templates/html/content/homepage.html +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/template/boilerplate/bundle_templates/html/includes/error-msg-noscript.html +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/template/boilerplate/bundle_templates/html/includes/error-msg-outdated-browser.html +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/template/boilerplate/bundle_templates/html/layouts/main.html +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/template/command/gina.bat.tpl +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/template/command/gina.tpl +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/template/conf/env.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/template/conf/manifest.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/template/conf/package.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/template/conf/settings.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/template/conf/statics.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/template/conf/templates.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/template/error/client/json/401.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/template/error/client/json/403.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/template/error/client/json/404.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/template/error/server/html/50x.html +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/template/error/server/json/500.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/template/error/server/json/503.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/core/template/extensions/logger/config.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/helpers/console.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/helpers/context.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/helpers/data/LICENSE +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/helpers/data/README.md +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/helpers/data/package.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/helpers/data/src/main.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/helpers/dateFormat.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/helpers/index.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/helpers/json/LICENSE +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/helpers/json/README.md +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/helpers/json/package.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/helpers/path.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/helpers/plugins/README.md +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/helpers/plugins/package.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/helpers/plugins/src/api-error.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/helpers/plugins/src/main.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/helpers/prototypes.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/helpers/task.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/helpers/text.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/archiver/README.md +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/archiver/build.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/archiver/package.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/archiver/src/dep/jszip.min.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/archiver/src/main.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/async/package.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/async/src/main.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cache/README.md +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cache/build.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cache/package.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/bundle/add.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/bundle/build.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/bundle/copy.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/bundle/cp.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/bundle/help.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/bundle/list.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/bundle/remove.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/bundle/rename.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/bundle/restart.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/bundle/rm.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/bundle/status.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/bundle/stop.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/cache/stats.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/env/add.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/env/get.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/env/help.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/env/help.txt +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/env/link-dev.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/env/list.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/env/remove.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/env/rm.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/env/set.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/env/unset.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/env/use.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/framework/arguments.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/framework/build.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/framework/dot.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/framework/help.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/framework/init.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/framework/link-node-modules.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/framework/link.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/framework/msg.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/framework/open.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/framework/restart.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/framework/set.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/framework/start.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/framework/status.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/framework/stop.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/framework/tail.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/framework/update.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/framework/version.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/gina-dev.1.md +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/gina-framework.1.md +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/gina.1.md +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/helper.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/index.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/inspector/help.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/inspector/help.txt +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/inspector/open.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/minion/help.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/minion/help.txt +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/msg.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/port/help.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/port/inc/scan.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/port/list.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/port/reset.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/project/add.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/project/arguments.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/project/build.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/project/help.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/project/help.txt +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/project/import.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/project/list.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/project/move.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/project/remove.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/project/rename.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/project/restart.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/project/rm.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/project/start.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/project/status.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/project/stop.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/protocol/help.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/protocol/help.txt +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/protocol/list.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/protocol/set.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/scope/add.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/scope/help.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/scope/help.txt +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/scope/link-local.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/scope/link-production.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/scope/list.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/scope/remove.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/scope/rm.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/scope/use.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cmd/view/add.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/collection/README.md +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/collection/build.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/collection/package.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/config.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cron/README.md +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cron/package.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/cron/src/main.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/domain/LICENSE +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/domain/README.md +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/domain/dist/2025-03-14_13-41-20_UTC.dat +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/domain/dist/public_suffix_list.dat +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/domain/dist/public_suffix_list.dat.br +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/domain/dist/public_suffix_list.dat.gz +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/domain/package.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/domain/src/main.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/generator/index.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/inherits/LICENSE +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/inherits/README.md +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/inherits/package.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/inherits/src/main.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/logger/README.md +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/logger/package.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/logger/src/containers/default/index.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/logger/src/containers/file/index.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/logger/src/containers/file/lib/logrotator/README.md +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/logger/src/containers/file/lib/logrotator/index.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/logger/src/containers/mq/index.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/logger/src/containers/mq/speaker.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/logger/src/helper.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/logger/src/main.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/math/index.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/merge/README.md +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/merge/package.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/merge/src/main.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/model.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/proc.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/routing/README.md +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/routing/build.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/routing/package.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/routing/src/main.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/routing/src/radix.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/session-store.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/shell.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/state.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/swig-filters/README.md +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/swig-filters/package.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/swig-filters/src/main.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/url/README.md +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/url/index.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/url/routing.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/validator.js +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/watcher/package.json +0 -0
- /package/framework/{v0.3.2 → v0.3.3}/lib/watcher/src/main.js +0 -0
|
@@ -1,532 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
RequireJS 2.3.7 Copyright jQuery Foundation and other contributors.
|
|
3
|
-
Released under MIT license, https://github.com/requirejs/requirejs/blob/master/LICENSE
|
|
4
|
-
Engine.IO v6.6.3
|
|
5
|
-
(c) 2014-2025 Guillermo Rauch
|
|
6
|
-
Released under the MIT License.
|
|
7
|
-
@source https://gist.github.com/1129031 */
|
|
8
|
-
var requirejs,require,define;
|
|
9
|
-
(function(v,L){function I(pa,ua){return ua||''}function O(pa){return'[object Function]'===E.call(pa)}function H(pa){return'[object Array]'===E.call(pa)}function B(pa,ua){if(pa){var za;for(za=0;za<pa.length&&(!pa[za]||!ua(pa[za],za,pa));za+=1);}}function X(pa,ua){if(pa){var za;for(za=pa.length-1;-1<za&&(!pa[za]||!ua(pa[za],za,pa));--za);}}function D(pa,ua){return P.call(pa,ua)}function C(pa,ua){return D(pa,ua)&&pa[ua]}function h(pa,ua){for(var za in pa)if(D(pa,za)&&-1==Ba.indexOf(za)&&ua(pa[za],za))break}
|
|
10
|
-
function r(pa,ua,za,Ta){ua&&h(ua,function(Ha,Pa){if(za||!D(pa,Pa))!Ta||'object'!==typeof Ha||!Ha||H(Ha)||O(Ha)||Ha instanceof RegExp?pa[Pa]=Ha:(pa[Pa]||(pa[Pa]={}),r(pa[Pa],Ha,za,Ta))});return pa}function l(pa,ua){return function(){return ua.apply(pa,arguments)}}function Z(pa){throw pa;}function na(pa){if(!pa)return pa;var ua=v;B(pa.split('.'),function(za){ua=ua[za]});return ua}function F(pa,ua,za,Ta){ua=Error(ua+'\nhttps://requirejs.org/docs/errors.html#'+pa);ua.requireType=pa;ua.requireModules=
|
|
11
|
-
Ta;za&&(ua.originalError=za);return ua}function u(){if(m&&'interactive'===m.readyState)return m;X(document.getElementsByTagName('script'),function(pa){if('interactive'===pa.readyState)return m=pa});return m}var p,f,k,m,w,Q,z,y=/\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/mg,N=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,Y=/\.js$/,ia=/^\.\//;var ba=Object.prototype;var E=ba.toString,P=ba.hasOwnProperty,K=!('undefined'===typeof window||'undefined'===typeof navigator||!window.document),qa=!K&&'undefined'!==
|
|
12
|
-
typeof importScripts,U=K&&'PLAYSTATION 3'===navigator.platform?/^complete$/:/^(complete|loaded)$/,fa='undefined'!==typeof opera&&'[object Opera]'===opera.toString(),aa={},oa={},xa=[],ja=!1,Ba=['__proto__','constructor'];if('undefined'===typeof define){if('undefined'!==typeof requirejs){if(O(requirejs))return;oa=requirejs;requirejs=void 0}'undefined'===typeof require||O(require)||(oa=require,require=void 0);var ra=requirejs=function(pa,ua,za,Ta){var Ha='_';if(!H(pa)&&'string'!==typeof pa){var Pa=pa;
|
|
13
|
-
H(ua)?(pa=ua,ua=za,za=Ta):pa=[]}Pa&&Pa.context&&(Ha=Pa.context);(Ta=C(aa,Ha))||(Ta=aa[Ha]=ra.s.newContext(Ha));Pa&&Ta.configure(Pa);return Ta.require(pa,ua,za)};ra.config=function(pa){return ra(pa)};ra.nextTick='undefined'!==typeof L?function(pa){L(pa,4)}:function(pa){pa()};require||=ra;ra.version='2.3.7';ra.jsExtRegExp=/^\/|:|\?|\.js$/;ra.isBrowser=K;ba=ra.s={contexts:aa,newContext:function(pa){function ua(x,V,da){var S;V=V&&V.split('/');var ea=b.map,ka=ea&&ea['*'];if(x){x=x.split('/');var wa=x.length-
|
|
14
|
-
1;b.nodeIdCompat&&Y.test(x[wa])&&(x[wa]=x[wa].replace(Y,''));'.'===x[0].charAt(0)&&V&&(wa=V.slice(0,V.length-1),x=wa.concat(x));wa=x;for(S=0;S<wa.length;S++){var Ca=wa[S];'.'===Ca?(wa.splice(S,1),--S):'..'===Ca&&0!==S&&(1!==S||'..'!==wa[2])&&'..'!==wa[S-1]&&0<S&&(wa.splice(S-1,2),S-=2)}x=x.join('/')}if(da&&ea&&(V||ka)){wa=x.split('/');S=wa.length;a:for(;0<S;--S){var Oa=wa.slice(0,S).join('/');if(V)for(Ca=V.length;0<Ca;--Ca)if(da=C(ea,V.slice(0,Ca).join('/')))if(da=C(da,Oa)){var Qa=da;var Ya=S;break a}if(!La&&
|
|
15
|
-
ka&&C(ka,Oa)){var La=C(ka,Oa);var ya=S}}!Qa&&La&&(Qa=La,Ya=ya);Qa&&(wa.splice(0,Ya,Qa),x=wa.join('/'))}return(Qa=C(b.pkgs,x))?Qa:x}function za(x){K&&B(document.getElementsByTagName('script'),function(V){if(V.getAttribute('data-requiremodule')===x&&V.getAttribute('data-requirecontext')===ma.contextName)return V.parentNode.removeChild(V),!0})}function Ta(x){var V=C(b.paths,x);if(V&&H(V)&&1<V.length)return V.shift(),ma.require.undef(x),ma.makeRequire(null,{skipMap:!0})([x]),!0}function Ha(x){var V=x?
|
|
16
|
-
x.indexOf('!'):-1;if(-1<V){var da=x.substring(0,V);x=x.substring(V+1,x.length)}return[da,x]}function Pa(x,V,da,S){var ea=null,ka=V?V.name:null,wa=x,Ca=!0,Oa='';x||(Ca=!1,x='_@r'+(ca+=1));x=Ha(x);ea=x[0];x=x[1];if(ea){ea=ua(ea,ka,S);var Qa=C(g,ea)}if(x)if(ea)Oa=da?x:Qa&&Qa.normalize?Qa.normalize(x,function(La){return ua(La,ka,S)}):-1===x.indexOf('!')?ua(x,ka,S):x;else{Oa=ua(x,ka,S);x=Ha(Oa);ea=x[0];Oa=x[1];da=!0;var Ya=ma.nameToUrl(Oa)}da=!ea||Qa||da?'':'_unnormalized'+(la+=1);return{prefix:ea,name:Oa,
|
|
17
|
-
parentMap:V,unnormalized:!!da,url:Ya,originalName:wa,isDefine:Ca,id:(ea?ea+'!'+Oa:Oa)+da}}function Ua(x){var V=x.id,da=C(a,V);da||=a[V]=new ma.Module(x);return da}function Xa(x,V,da){var S=x.id,ea=C(a,S);if(!D(g,S)||ea&&!ea.defineEmitComplete)if(ea=Ua(x),ea.error&&'error'===V)da(ea.error);else ea.on(V,da);else'defined'===V&&da(g[S])}function Ra(x,V){var da=x.requireModules,S=!1;if(V)V(x);else if(B(da,function(ea){if(ea=C(a,ea))ea.error=x,ea.events.error&&(S=!0,ea.emit('error',x))}),!S)ra.onError(x)}
|
|
18
|
-
function db(){xa.length&&(B(xa,function(x){var V=x[0];'string'===typeof V&&(ma.defQueueMap[V]=!0);q.push(x)}),xa=[])}function Ma(x){delete a[x];delete e[x]}function Va(x,V,da){var S=x.map.id;x.error?x.emit('error',x.error):(V[S]=!0,B(x.depMaps,function(ea,ka){ea=ea.id;var wa=C(a,ea);!wa||x.depMatched[ka]||da[ea]||(C(V,ea)?(x.defineDep(ka,g[ea]),x.check()):Va(wa,V,da))}),da[S]=!0)}function $a(){var x,V,da=(x=1E3*b.waitSeconds)&&ma.startTime+x<(new Date).getTime(),S=[],ea=[],ka=!1,wa=!0;if(!R){R=!0;
|
|
19
|
-
h(e,function(Ca){var Oa=Ca.map,Qa=Oa.id;if(Ca.enabled&&(Oa.isDefine||ea.push(Ca),!Ca.error))if(!Ca.inited&&da)Ta(Qa)?ka=V=!0:(S.push(Qa),za(Qa));else if(!Ca.inited&&Ca.fetched&&Oa.isDefine&&(ka=!0,!Oa.prefix))return wa=!1});if(da&&S.length)return x=F('timeout','Load timeout for modules: '+S,null,S),x.contextName=ma.contextName,Ra(x);wa&&B(ea,function(Ca){Va(Ca,{},{})});da&&!V||!ka||!K&&!qa||c||(c=L(function(){c=0;$a()},50));R=!1}}function gb(x){D(g,x[0])||Ua(Pa(x[0],null,!0)).init(x[1],x[2])}function hb(x){x=
|
|
20
|
-
x.currentTarget||x.srcElement;var V=ma.onScriptLoad;x.detachEvent&&!fa?x.detachEvent('onreadystatechange',V):x.removeEventListener('load',V,!1);V=ma.onScriptError;x.detachEvent&&!fa||x.removeEventListener('error',V,!1);return{node:x,id:x&&x.getAttribute('data-requiremodule')}}function kb(){for(db();q.length;){var x=q.shift();if(null===x[0])return Ra(F('mismatch','Mismatched anonymous define() module: '+x[x.length-1]));gb(x)}ma.defQueueMap={}}var R,c,b={waitSeconds:7,baseUrl:'./',paths:{},bundles:{},
|
|
21
|
-
pkgs:{},shim:{},config:{}},a={},e={},n={},q=[],g={},G={},A={},ca=1,la=1;var ha={require:function(x){return x.require?x.require:x.require=ma.makeRequire(x.map)},exports:function(x){x.usingExports=!0;if(x.map.isDefine)return x.exports?g[x.map.id]=x.exports:x.exports=g[x.map.id]={}},module:function(x){return x.module?x.module:x.module={id:x.map.id,uri:x.map.url,config:function(){return C(b.config,x.map.id)||{}},exports:x.exports||(x.exports={})}}};var va=function(x){this.events=C(n,x.id)||{};this.map=
|
|
22
|
-
x;this.shim=C(b.shim,x.id);this.depExports=[];this.depMaps=[];this.depMatched=[];this.pluginMaps={};this.depCount=0};va.prototype={init:function(x,V,da,S){S=S||{};if(!this.inited){this.factory=V;if(da)this.on('error',da);else this.events.error&&(da=l(this,function(ea){this.emit('error',ea)}));this.depMaps=x&&x.slice(0);this.errback=da;this.inited=!0;this.ignore=S.ignore;S.enabled||this.enabled?this.enable():this.check()}},defineDep:function(x,V){this.depMatched[x]||(this.depMatched[x]=!0,--this.depCount,
|
|
23
|
-
this.depExports[x]=V)},fetch:function(){if(!this.fetched){this.fetched=!0;ma.startTime=(new Date).getTime();var x=this.map;if(this.shim)ma.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],l(this,function(){return x.prefix?this.callPlugin():this.load()}));else return x.prefix?this.callPlugin():this.load()}},load:function(){var x=this.map.url;G[x]||(G[x]=!0,ma.load(this.map.id,x))},check:function(){if(this.enabled&&!this.enabling){var x=this.map.id;var V=this.depExports;var da=this.exports,
|
|
24
|
-
S=this.factory;if(!this.inited)D(ma.defQueueMap,x)||this.fetch();else if(this.error)this.emit('error',this.error);else if(!this.defining){this.defining=!0;if(1>this.depCount&&!this.defined){if(O(S)){if(this.events.error&&this.map.isDefine||ra.onError!==Z)try{da=ma.execCb(x,S,V,da)}catch(wa){var ea=wa}else da=ma.execCb(x,S,V,da);this.map.isDefine&&void 0===da&&((V=this.module)?da=V.exports:this.usingExports&&(da=this.exports));if(ea)return ea.requireMap=this.map,ea.requireModules=this.map.isDefine?
|
|
25
|
-
[this.map.id]:null,ea.requireType=this.map.isDefine?'define':'require',Ra(this.error=ea)}else da=S;this.exports=da;if(this.map.isDefine&&!this.ignore&&(g[x]=da,ra.onResourceLoad)){var ka=[];B(this.depMaps,function(wa){ka.push(wa.normalizedMap||wa)});ra.onResourceLoad(ma,this.map,ka)}Ma(x);this.defined=!0}this.defining=!1;this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit('defined',this.exports),this.defineEmitComplete=!0)}}},callPlugin:function(){var x=this.map,V=x.id,da=Pa(x.prefix);
|
|
26
|
-
this.depMaps.push(da);Xa(da,'defined',l(this,function(S){var ea=C(A,this.map.id),ka=this.map.name,wa=this.map.parentMap?this.map.parentMap.name:null,Ca=ma.makeRequire(x.parentMap,{enableBuildCallback:!0});if(this.map.unnormalized){S.normalize&&(ka=S.normalize(ka,function(Ya){return ua(Ya,wa,!0)})||'');var Oa=Pa(x.prefix+'!'+ka,this.map.parentMap,!0);Xa(Oa,'defined',l(this,function(Ya){this.map.normalizedMap=Oa;this.init([],function(){return Ya},null,{enabled:!0,ignore:!0})}));if(S=C(a,Oa.id)){this.depMaps.push(Oa);
|
|
27
|
-
if(this.events.error)S.on('error',l(this,function(Ya){this.emit('error',Ya)}));S.enable()}}else if(ea)this.map.url=ma.nameToUrl(ea),this.load();else{var Qa=l(this,function(Ya){this.init([],function(){return Ya},null,{enabled:!0})});Qa.error=l(this,function(Ya){this.inited=!0;this.error=Ya;Ya.requireModules=[V];h(a,function(La){0===La.map.id.indexOf(V+'_unnormalized')&&Ma(La.map.id)});Ra(Ya)});Qa.fromText=l(this,function(Ya,La){var ya=x.name,Ea=Pa(ya),T=ja;La&&(Ya=La);T&&(ja=!1);Ua(Ea);D(b.config,
|
|
28
|
-
V)&&(b.config[ya]=b.config[V]);try{ra.exec(Ya)}catch(J){return Ra(F('fromtexteval','fromText eval for '+V+' failed: '+J,J,[V]))}T&&(ja=!0);this.depMaps.push(Ea);ma.completeLoad(ya);Ca([ya],Qa)});S.load(x.name,Ca,Qa,b)}}));ma.enable(da,this);this.pluginMaps[da.id]=da},enable:function(){e[this.map.id]=this;this.enabling=this.enabled=!0;B(this.depMaps,l(this,function(x,V){var da;if('string'===typeof x){x=Pa(x,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap);this.depMaps[V]=x;if(da=C(ha,
|
|
29
|
-
x.id)){this.depExports[V]=da(this);return}this.depCount+=1;Xa(x,'defined',l(this,function(ea){this.undefed||(this.defineDep(V,ea),this.check())}));this.errback?Xa(x,'error',l(this,this.errback)):this.events.error&&Xa(x,'error',l(this,function(ea){this.emit('error',ea)}))}da=x.id;var S=a[da];D(ha,da)||!S||S.enabled||ma.enable(x,this)}));h(this.pluginMaps,l(this,function(x){var V=C(a,x.id);V&&!V.enabled&&ma.enable(x,this)}));this.enabling=!1;this.check()},on:function(x,V){var da=this.events[x];da||=
|
|
30
|
-
this.events[x]=[];da.push(V)},emit:function(x,V){B(this.events[x],function(da){da(V)});'error'===x&&delete this.events[x]}};var ma={config:b,contextName:pa,registry:a,defined:g,urlFetched:G,defQueue:q,defQueueMap:{},Module:va,makeModuleMap:Pa,nextTick:ra.nextTick,onError:Ra,configure:function(x){x.baseUrl&&'/'!==x.baseUrl.charAt(x.baseUrl.length-1)&&(x.baseUrl+='/');if('string'===typeof x.urlArgs){var V=x.urlArgs;x.urlArgs=function(ea,ka){return(-1===ka.indexOf('?')?'?':'&')+V}}var da=b.shim,S={paths:!0,
|
|
31
|
-
bundles:!0,config:!0,map:!0};h(x,function(ea,ka){S[ka]?(b[ka]||(b[ka]={}),r(b[ka],ea,!0,!0)):b[ka]=ea});x.bundles&&h(x.bundles,function(ea,ka){B(ea,function(wa){wa!==ka&&(A[wa]=ka)})});x.shim&&(h(x.shim,function(ea,ka){H(ea)&&(ea={deps:ea});!ea.exports&&!ea.init||ea.exportsFn||(ea.exportsFn=ma.makeShimExports(ea));da[ka]=ea}),b.shim=da);x.packages&&B(x.packages,function(ea){ea='string'===typeof ea?{name:ea}:ea;var ka=ea.name;ea.location&&(b.paths[ka]=ea.location);b.pkgs[ka]=ea.name+'/'+(ea.main||
|
|
32
|
-
'main').replace(ia,'').replace(Y,'')});h(a,function(ea,ka){ea.inited||ea.map.unnormalized||(ea.map=Pa(ka,null,!0))});(x.deps||x.callback)&&ma.require(x.deps||[],x.callback)},makeShimExports:function(x){return function(){var V;x.init&&(V=x.init.apply(v,arguments));return V||x.exports&&na(x.exports)}},makeRequire:function(x,V){function da(S,ea,ka){var wa;V.enableBuildCallback&&ea&&O(ea)&&(ea.__requireJsBuild=!0);if('string'===typeof S){if(O(ea))return Ra(F('requireargs','Invalid require call'),ka);
|
|
33
|
-
if(x&&D(ha,S))return ha[S](a[x.id]);if(ra.get)return ra.get(ma,S,x,da);var Ca=Pa(S,x,!1,!0);Ca=Ca.id;return D(g,Ca)?g[Ca]:Ra(F('notloaded','Module name "'+Ca+'" has not been loaded yet for context: '+pa+(x?'':'. Use require([])')))}kb();ma.nextTick(function(){kb();wa=Ua(Pa(null,x));wa.skipMap=V.skipMap;wa.init(S,ea,ka,{enabled:!0});$a()});return da}V=V||{};r(da,{isBrowser:K,toUrl:function(S){var ea=S.lastIndexOf('.'),ka=S.split('/')[0];if(-1!==ea&&('.'!==ka&&'..'!==ka||1<ea)){var wa=S.substring(ea,
|
|
34
|
-
S.length);S=S.substring(0,ea)}return ma.nameToUrl(ua(S,x&&x.id,!0),wa,!0)},defined:function(S){return D(g,Pa(S,x,!1,!0).id)},specified:function(S){S=Pa(S,x,!1,!0).id;return D(g,S)||D(a,S)}});x||(da.undef=function(S){db();var ea=Pa(S,x,!0),ka=C(a,S);ka.undefed=!0;za(S);delete g[S];delete G[ea.url];delete n[S];X(q,function(wa,Ca){wa[0]===S&&q.splice(Ca,1)});delete ma.defQueueMap[S];ka&&(ka.events.defined&&(n[S]=ka.events),Ma(S))});return da},enable:function(x){C(a,x.id)&&Ua(x).enable()},completeLoad:function(x){var V=
|
|
35
|
-
C(b.shim,x)||{},da=V.exports;for(db();q.length;){var S=q.shift();if(null===S[0]){S[0]=x;if(ea)break;var ea=!0}else S[0]===x&&(ea=!0);gb(S)}ma.defQueueMap={};S=C(a,x);if(!ea&&!D(g,x)&&S&&!S.inited)if(!b.enforceDefine||da&&na(da))gb([x,V.deps||[],V.exportsFn]);else return Ta(x)?void 0:Ra(F('nodefine','No define call for '+x,null,[x]));$a()},nameToUrl:function(x,V,da){var S,ea;(S=C(b.pkgs,x))&&(x=S);if(S=C(A,x))return ma.nameToUrl(S,V,da);if(ra.jsExtRegExp.test(x))S=x+(V||'');else{S=b.paths;var ka=x.split('/');
|
|
36
|
-
for(ea=ka.length;0<ea;--ea){var wa=ka.slice(0,ea).join('/');if(wa=C(S,wa)){H(wa)&&(wa=wa[0]);ka.splice(0,ea,wa);break}}S=ka.join('/');S+=V||(/^data:|^blob:|\?/.test(S)||da?'':'.js');S=('/'===S.charAt(0)||S.match(/^[\w\+\.\-]+:/)?'':b.baseUrl)+S}return b.urlArgs&&!/^blob:/.test(S)?S+b.urlArgs(x,S):S},load:function(x,V){ra.load(ma,x,V)},execCb:function(x,V,da,S){return V.apply(S,da)},onScriptLoad:function(x){if('load'===x.type||U.test((x.currentTarget||x.srcElement).readyState))m=null,x=hb(x),ma.completeLoad(x.id)},
|
|
37
|
-
onScriptError:function(x){var V=hb(x);if(!Ta(V.id)){var da=[];h(a,function(S,ea){0!==ea.indexOf('_@r')&&B(S.depMaps,function(ka){if(ka.id===V.id)return da.push(ea),!0})});return Ra(F('scripterror','Script error for "'+V.id+(da.length?'", needed by: '+da.join(', '):'"'),x,[V.id]))}}};ma.require=ma.makeRequire();return ma}};ra({});B(['toUrl','undef','defined','specified'],function(pa){ra[pa]=function(){var ua=aa._;return ua.require[pa].apply(ua,arguments)}});if(K){var Ka=ba.head=document.getElementsByTagName('head')[0];
|
|
38
|
-
if(p=document.getElementsByTagName('base')[0])Ka=ba.head=p.parentNode}ra.onError=Z;ra.createNode=function(pa,ua,za){ua=pa.xhtml?document.createElementNS('http://www.w3.org/1999/xhtml','html:script'):document.createElement('script');ua.type=pa.scriptType||'text/javascript';ua.charset='utf-8';ua.async=!0;return ua};ra.load=function(pa,ua,za){var Ta=pa&&pa.config||{};if(K){var Ha=ra.createNode(Ta,ua,za);Ha.setAttribute('data-requirecontext',pa.contextName);Ha.setAttribute('data-requiremodule',ua);!Ha.attachEvent||
|
|
39
|
-
Ha.attachEvent.toString&&0>Ha.attachEvent.toString().indexOf('[native code')||fa?(Ha.addEventListener('load',pa.onScriptLoad,!1),Ha.addEventListener('error',pa.onScriptError,!1)):(ja=!0,Ha.attachEvent('onreadystatechange',pa.onScriptLoad));Ha.src=za;if(Ta.onNodeCreated)Ta.onNodeCreated(Ha,Ta,ua,za);w=Ha;p?Ka.insertBefore(Ha,p):Ka.appendChild(Ha);w=null;return Ha}if(qa)try{L(function(){},0),importScripts(za),pa.completeLoad(ua)}catch(Pa){pa.onError(F('importscripts','importScripts failed for '+ua+
|
|
40
|
-
' at '+za,Pa,[ua]))}};K&&!oa.skipDataMain&&X(document.getElementsByTagName('script'),function(pa){Ka||(Ka=pa.parentNode);if(f=pa.getAttribute('data-main'))return Q=f,oa.baseUrl||-1!==Q.indexOf('!')||(k=Q.split('/'),Q=k.pop(),z=k.length?k.join('/')+'/':'./',oa.baseUrl=z),Q=Q.replace(Y,''),ra.jsExtRegExp.test(Q)&&(Q=f),oa.deps=oa.deps?oa.deps.concat(Q):[Q],!0});define=function(pa,ua,za){var Ta;'string'!==typeof pa&&(za=ua,ua=pa,pa=null);H(ua)||(za=ua,ua=null);!ua&&O(za)&&(ua=[],za.length&&(za.toString().replace(y,
|
|
41
|
-
I).replace(N,function(Pa,Ua){ua.push(Ua)}),ua=(1===za.length?['require']:['require','exports','module']).concat(ua)));if(ja&&(Ta=w||u())){pa||=Ta.getAttribute('data-requiremodule');var Ha=aa[Ta.getAttribute('data-requirecontext')]}Ha?(Ha.defQueue.push([pa,ua,za]),Ha.defQueueMap[pa]=!0):xa.push([pa,ua,za])};define.amd={jQuery:!0};ra.exec=function(pa){return eval(pa)};ra(oa)}})(this,'undefined'===typeof setTimeout?void 0:setTimeout);define('requireLib',function(){});
|
|
42
|
-
function Merge(){var v=[],L=!1,I=function(B,X){var D=B;L||('object'==typeof B&&Array.isArray(B),L=!0);'undefined'==typeof D&&(D='undefined'!=typeof X&&Array.isArray(X)?[]:{});var C=!1;'boolean'==typeof arguments[arguments.length-1]&&(C=arguments[arguments.length-1]);var h=1,r=arguments.length,l,Z;if('object'!==typeof D&&'function'!==typeof D)D=C?'undefined'==typeof arguments[2]?arguments[1]:arguments[2]:'undefined'==typeof arguments[0]?arguments[1]:arguments[0];else for(;h<r;++h)if('boolean'!=typeof arguments[h]&&
|
|
43
|
-
null!=(l=arguments[h])){if('object'!=typeof l){D=l;break}if(Array.isArray(l)&&Array.isArray(D))D=O(l,D,C);else for(var na in l){D||={name:null};var F=D[na];var u=l[na];if(D!==u)if(u&&(H(u)||(Z=Array.isArray(u)))){var p=!1;if(Z){Z=!1;if(F&&Array.isArray(F))var f=F||[];else if(H(F)){f=F||{};D[na]=f;continue}else f=[];v=f;f=O(u,f,C);D[na]=f}else{f=F&&H(F)?F:null;if(!f){p=!0;f={};for(var k in u)f[k]=u[k]}if(C){for(k in u)'undefined'!=typeof u[k]?Array.isArray(u[k])&&Array.isArray(f[k])?f[k]=O(u[k],f[k],
|
|
44
|
-
C):f[k]=u[k]:Array.isArray(u[k])&&Array.isArray(f[k])&&(f[k]=O(u[k],f[k],C));D[na]=f}else{for(k in u)'undefined'==typeof f[k]?Array.isArray(u[k])&&Array.isArray(f[k])?f[k]=O(u[k],f[k],C):f[k]=u[k]:Array.isArray(u[k])&&Array.isArray(f[k])&&(f[k]=O(u[k],f[k],C));'boolean'==typeof F||p?p&&(D[na]=f):D[na]=I(f,u,C)}}}else void 0!==u&&(D[na]='undefined'==typeof F||null==F||F===u||C?u:F)}}v=[];L=!1;return D},O=function(B,X,D){v=[];var C=[],h=I.getKeyComparison();if(/^true$/i.test(D)){if('object'==typeof B[0]&&
|
|
45
|
-
null!=B[0]&&'undefined'!=typeof B[0][h]&&'object'==typeof X[0]&&'undefined'!=typeof X[0][h]){v=Array.isArray(X)?Array.from(X):JSON.clone(X);var r=0;for(D=v.length;r<D;++r)C.push(v[r][h]);D=JSON.clone(B);var l=0;r=0;B=D.length;for(var Z=F||0,na=X.length;Z<na;++Z)a:for(r=r||0;r<B;++r)if(D[r][h]===X[Z][h]){-1<C.indexOf(D[r][h])?(v[l]=D[r],++l):-1==C.indexOf(D[r][h])&&(C.push(D[r][h]),v[l]=D[r],++l);break a}else-1==C.indexOf(D[r][h])&&(C.push(D[r][h]),v.push(D[r]));return v}return Array.isArray(B)&&0==
|
|
46
|
-
B.length||'undefined'==typeof B?/^true$/i.test(D)?B:X:B}if(0==B.length&&0<X.length)return v=X;if(0==X.length&&0<B.length)for(r=0;r<B.length;++r)X.push(B[r]);if(0==v.length&&0<X.length)for(r=0;r<X.length;++r)'object'!=typeof X[r]&&-1==v.indexOf(X[r])&&v.push(X[r]);if(0<X.length){if('undefined'!=typeof B[0]&&'object'==typeof B[0]&&null!=B[0]&&'undefined'!=typeof B[0][h]&&'object'==typeof X[0]&&'undefined'!=typeof X[0][h]){v=Array.isArray(X)?Array.from(X):JSON.clone(X);D=JSON.clone(B);var F=null;r=0;
|
|
47
|
-
for(B=v.length;r<B;++r)C.push(v[r][h]);for(r=0;r<B;++r)a:for(Z=F||0,na=D.length;Z<na;++Z)if(null!=D[Z]&&'undefined'!=typeof D[Z][h]&&D[Z][h]!==v[r][h]){if(-1==C.indexOf(D[Z][h])){v.push(D[Z]);C.push(D[Z][h]);F=Z+1;B<na&&++B;break a}}else if(null!=D[Z]&&'undefined'!=typeof D[Z][h]&&D[Z][h]===v[r][h])F=Z+1;else break a;return v}for(r=0;r<B.length;++r)if(C=null,'undefined'==typeof B||'object'!=typeof B[r]||Array.isArray(B[r])||null==B[r]||(C=Object.getOwnPropertyNames(B[r])),'undefined'!=typeof C&&null!=
|
|
48
|
-
C&&(C=C[0]||null),-1<X.indexOf(B[r])&&D)X.splice(X.indexOf(B[r]),1,B[r]);else if('undefined'==typeof v[r]&&'object'==typeof B[r])for(l in v=X,'undefined'==typeof v[r]&&(v[r]={}),B[r])v[r].hasOwnProperty(l)||(v[r][l]=B[r][l]);else!D&&-1<v.indexOf(B[r])&&/number/i.test(typeof B[r])&&B[r]!==v[r]?v.push(B[r]):'undefined'==typeof X[r]||/null/i.test(X[r])||'undefined'==typeof X[r][h]||'undefined'==typeof B[r]||'undefined'==typeof B[r][h]||X[r][h]!=B[r][h]?-1==v.indexOf(B[r])&&'object'!=typeof B[r]?v.push(B[r]):
|
|
49
|
-
'undefined'==typeof X[r]||/null/i.test(X[r])||'undefined'==typeof X[r][C]||'undefined'==typeof B[r]||'undefined'==typeof B[r][C]||X[r][C]!=B[r][C]||(v[r]=D?B[r]:X[r]):v[r]=D?B[r]:X[r]}if(0<v.length&&0<X.length||0==v.length&&0==X.length)return v};O.prototype.setKeyComparison=function(B){this.keyComparison=B};var H=function(B){if(!B||'[object Object]'!=={}.toString.call(B)||B.nodeType||B.setInterval)return!1;var X={}.hasOwnProperty,D=X.call(B,'constructor');X='undefined'!=typeof B.constructor?X.call(B.constructor.prototype,
|
|
50
|
-
'isPrototypeOf'):!1;return!B.constructor||D||X?!0:!1};I.setKeyComparison=function(B){O.keyComparison=B;return I};I.getKeyComparison=function(){var B=O.keyComparison||'id';O.keyComparison='id';return B};return I}'undefined'!==typeof module&&module.exports?('undefined'==typeof JSON.clone&&require('../../../helpers'),module.exports=Merge()):'function'===typeof define&&define.amd&&define('lib/merge',[],function(){return Merge()});
|
|
51
|
-
function FormValidatorUtil(v,L,I,O){var H='undefined'!==typeof module&&module.exports?!1:!0,B=H?require('lib/merge'):require('../../../../../lib/merge');H||require('../../../../../helpers');H&&require('helpers/dateFormat');var X=H?require('lib/routing'):require('../../../../../lib/routing'),D=function(){var k=!1,m=null;H?H&&'undefined'!=typeof gina.forms&&(m=gina.forms):m=getContext('gina').forms||null;m&&'undefined'!=typeof m.validators&&(k=!0);return k},C={errors:{},keys:{'%l':'label','%n':'name',
|
|
52
|
-
'%s':'size'},data:{},excluded:[],errorLabels:{is:'Condition not satisfied',isEmail:'A valid email is required',isRequired:'Cannot be left empty',isBoolean:'Must be a valid boolean',isNumber:'Must be a number: allowed values are integers or floats',isNumberLength:'Must contain %s characters',isNumberMinLength:'Should be at least %s characters',isNumberMaxLength:'Should not be more than %s characters',isInteger:'Must be an integer',isIntegerLength:'Must have %s characters',isIntegerMinLength:'Should be at least %s characters',
|
|
53
|
-
isIntegerMaxLength:'Should not be more than %s characters',toInteger:'Could not be converted to integer',isFloat:'Must be a proper float',isFloatException:'Float exception found: %n',toFloat:'Could not be converted to float',toFloatNAN:'Value must be a valid number',isDate:'Must be a valid Date',isString:'Must be a string',isStringLength:'Must have %s characters',isStringMinLength:'Should be at least %s characters',isStringMaxLength:'Should not be more than %s characters',isJsonWebToken:'Must be a valid JSON Web Token',
|
|
54
|
-
query:'Must be a valid response',isApiError:'Condition not satisfied'}},h=null;if(v)h=B(JSON.clone(v),h),C.data=B(JSON.clone(v),C.data);else throw Error('missing data param');var r=function(k,m){var w=null;for(let Q in O)if(O[Q].name===m){w=(new DOMParser).parseFromString(k.innerHTML,'text/html').getElementById(O[Q].id);break}if(w)return w;throw Error('Field `'+m+'` not found in fieldsSet');},l=function(k){var m;var w='';var Q=k.length;for(m=0;m<Q;){var z=k[m++];switch(z>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:w+=
|
|
55
|
-
String.fromCharCode(z);break;case 12:case 13:var y=k[m++];w+=String.fromCharCode((z&31)<<6|y&63);break;case 14:y=k[m++];var N=k[m++];w+=String.fromCharCode((z&15)<<12|(y&63)<<6|(N&63)<<0)}}return w},Z=function(k,m){m=k.match(/\{\{([^{{}}]+)\}\}/g);for(let w=0,Q=m.length;w<Q;w++){let z=m[w].replace(/\[/g,'["').replace(/\]/g,'"]').replace(/\{|\}/g,'').trim();try{z=eval('data.'+z).replace(/^"|"$/g,''),k=k.replace(new RegExp(m[w].replace(/\{|\[|\]|\}/g,'\\$&'),'g'),z)}catch(y){}}return k},na=function(k,
|
|
56
|
-
m){var w=h[this.name].errors||{},Q=this.target.id||this.target.getAttribute('id');if(h.isValid()){var z=this.target.dataset.ginaFormValidatorTestedValue;console.debug('[ '+this.name+' ]','TESTED VALUE -> '+this.value+' vs '+z);Q='asyncCompleted.'+Q;var y=this.target.form.getAttribute('id'),N='undefined'!=typeof gina.validator&&'undefined'!=typeof gina.validator.$forms[y]&&'undefined'!=typeof gina.validator.$forms[y].cachedErrors?gina.validator.$forms[y].cachedErrors:null;if(!z||'undefined'==typeof z||
|
|
57
|
-
z!==this.value)this.target.dataset.ginaFormValidatorTestedValue=this.value,N&&'undefined'!=typeof N[this.name]&&'undefined'!=typeof N[this.name].query&&(delete N[this.name].query,'undefined'!=typeof gina.validator.$forms[y]&&'undefined'!=typeof gina.validator.$forms[y].errors&&delete gina.validator.$forms[y].errors.query);else if(z===this.value){var Y=!1;N&&'undefined'!=typeof N[this.name]&&'undefined'!=typeof N[this.name].query&&'undefined'!=typeof N[this.name].query[this.value]&&(this.error=m=N[this.name].query[this.value].slice(0),
|
|
58
|
-
Y=!0);w.query=f(this.error||m||C.errorLabels.query,this);console.debug('[2] potential cached error detected !! ',Y,N,' vs ',w.query);Y&&(this.errors=w,this.valid=!1);'undefined'!=typeof gina.events[Q]&&triggerEvent(gina,this.target,Q,h[this.name]);return h[this.name]}var ia=null,ba=this;if(window.XMLHttpRequest)ia=new XMLHttpRequest;else if(window.ActiveXObject)try{ia=new ActiveXObject('Msxml2.XMLHTTP')}catch(U){try{ia=new ActiveXObject('Microsoft.XMLHTTP')}catch(fa){}}m={isSynchrone:!1,headers:{}};
|
|
59
|
-
z=k.data||null;w=null;Q=/^true$/i.test(this.target.form.dataset.ginaFormLiveCheckEnabled)?!0:!1;w=JSON.stringify(z);if(/\$/.test(w)){z=w.match(/\$[-_\[\]a-z 0-9]+/g)||[];y=N=null;for(let U=0,fa=z.length;U<fa;U++)y=z[U].replace(/\$/g,''),re=new RegExp('\\'+z[U].replace(/\[|\]/g,'\\$&'),'g'),N=C.data[y]||null,!N&&Q&&(N=r(this.target.form,y).value),w=w.replace(re,N)}z=w.replace(/\\"/g,'');var E='undefined'==typeof k.validIf?!0:k.validIf;m=B(m,k,I);delete m.data;delete m.validIf;w=m.headers['Content-Type'];
|
|
60
|
-
var P=null;Q=this.target.getAttribute('id');if(!/^http/.test(m.url)&&/@/.test(m.url))try{Y=X.getRoute(m.url),m.url=Y.toUrl()}catch(U){throw U;}if(m.withCredentials){if('withCredentials'in ia)m.isSynchrone?ia.open(m.method,m.url,m.isSynchrone):ia.open(m.method,m.url);else if('undefined'!=typeof XDomainRequest)ia=new XDomainRequest,ia.open(m.method,m.url);else throw ia=null,P='CORS not supported: the server is missing the header `"Access-Control-Allow-Credentials": true` ',Error(P);ia.responseType=
|
|
61
|
-
'undefined'!=typeof m.responseType?m.responseType:'';ia.withCredentials=!0}else m.isSynchrone?ia.open(m.method,m.url,m.isSynchrone):ia.open(m.method,m.url);for(var K in m.headers)'Content-Type'==K&&'undefined'!=typeof w&&null!=w&&''!=w||ia.setRequestHeader(K,m.headers[K]);'undefined'!=typeof w&&null!=w&&''!=w&&ia.setRequestHeader('Content-Type',w);var qa=function(U){ba.value=C.data[ba.name]=ba.value?ba.value.toLowerCase():ba.value;var fa=U.isValid||!1;fa=E!=fa?!1:!0;h[ba.name].valid=fa;var aa=h[ba.name].errors||
|
|
62
|
-
{},oa='undefined'!=typeof U.error&&'undefined'!=typeof U.fields?U.fields:{};if(0<oa.count()&&!fa||!fa){if(!fa){var xa=null;'undefined'!=typeof oa[ba.name]?C.errorLabels.query=Z(oa[ba.name],k.data):'undefined'!=typeof U.error&&/^5/.test(U.status)&&(xa=U.error);var ja='undefined'!=typeof k.error?k.error:null;aa.query=f(xa||ba.error||ja||C.errorLabels.query,ba);console.debug('[1] query error detected !! ',U,oa,aa.query)}aa.query||''!=ba.value||(fa=!0)}fa&&'undefined'!=typeof aa.query&&delete aa.query;
|
|
63
|
-
ba.valid=fa;U=gina.validator.$forms[ba.target.form.getAttribute('id')].cachedErrors||{};0<aa.count()?(ba.errors=aa,'undefined'==typeof h[ba.name].errors&&(h[ba.name].errors={}),h[ba.name].errors=B(h[ba.name].errors,aa),'undefined'!=typeof aa.query&&aa.query&&('undefined'==typeof U[ba.name]&&(U[ba.name]={}),'undefined'==typeof U[ba.name].query&&(U[ba.name].query={}),U[ba.name].query[ba.value]=aa.query.slice(0)),aa=ba.target.getAttribute('data-gina-form-errors'),/query/.test(aa)||ba.target.setAttribute('data-gina-form-errors',
|
|
64
|
-
aa&&''!=aa?aa+' query':'query')):'undefined'!=typeof U[ba.name]&&'undefined'!=typeof U[ba.name].query&&'undefined'!=typeof U[ba.name].query[ba.value]&&delete U[ba.name].query[ba.value];aa=ba.target.id||ba.target.getAttribute('id');console.debug('prematurely completed event `asyncCompleted.'+aa+'`');return triggerEvent(gina,ba.target,'asyncCompleted.'+aa,h[ba.name])};ia&&(ia.onerror=function(U,fa){console.debug('query error [2] detected !! ',fa,'Transaction error: might be due to the server CORS settings.\nPlease, check the console for more details.');
|
|
65
|
-
isOnException=!0;U=this.getResponseHeader('Content-Type');if(/\/json/.test(U))U=JSON.parse(this.responseText),'undefined'==typeof U.status&&(U.status=this.status);else if(U={status:ia.status,message:''},/^(\{|\[)/.test(ia.responseText))try{U=B(U,JSON.parse(ia.responseText))}catch(aa){U=B(U,aa)}return qa(U)},ia.onload=function(){try{P=this.responseText;var U=this.getResponseHeader('Content-Type');if(/\/json/.test(U))P=JSON.parse(this.responseText),'undefined'==typeof P.status&&(P.status=this.status);
|
|
66
|
-
else if(P={status:ia.status,message:''},/^(\{|\[)/.test(ia.responseText))try{P=B(P,JSON.parse(ia.responseText))}catch(fa){P=B(P,fa)}return qa(P)}catch(fa){throw fa;}},v?ia.send(z):ia.send())}else console.debug('stopping on errors ...'),triggerEvent(gina,this.target,'asyncCompleted.'+Q,h[this.name])},F=async function(k,m,w,Q){var z=(new (require(_(GINA_FRAMEWORK_DIR+'/core/config.js',!0)))).getInstance(),y=null,N=null,Y=null,ia=getContext('bundle');if(/@/.test(k.url)){var ba=k.url.split(/@/);N=ba[0];
|
|
67
|
-
Y=ba[1];getConfig(ia,'app');try{z.bundle!==Y&&(y=getConfig(ia,'app').proxy[Y])}catch(U){throw Error('Could not retrieve `proxy` configuration for bundle `'+Y+'`. Please check your `/config/app.json`.\n'+U.stack);}ba=null}else throw Error('external url/domain not handled at this moment, please contact us if you need support for it.');ba=JSON.clone(X.getRoute(k.url,k.data));var E=z[Y][z.env],P=E.content.server;'undefined'==typeof P._cached&&(P._cached=new Map);'undefined'==typeof P._cachedPath&&(P._cachePath=
|
|
68
|
-
P.cache.path);'undefined'==typeof P._cacheIsEnabled&&(P._cacheIsEnabled=P.cache.enable);y||(z.bundle==Y&&(y=getConfig(ia,'settings').server.credentials,k.ca=y.ca||null,k.hostname=E.server.scheme+'://'+E.host,k.port=E.port[E.server.protocol][E.server.scheme],k.protocol=E.server.protocol,k.rejectUnauthorized=!1),y={ca:k.ca,hostname:k.hostname,port:k.port,path:k.path},'undefined'!=typeof k.protocol&&(y.protocol=k.protocol),'undefined'!=typeof k.rejectUnauthorized&&(y.rejectUnauthorized=k.rejectUnauthorized));
|
|
69
|
-
N={method:ba.method,requirements:ba.requirements,namespace:ba.namespace||void 0,url:decodeURI(ba.url),rule:N+'@'+Y,param:JSON.clone(ba.param),middleware:JSON.clone(ba.middleware),bundle:ba.bundle,isXMLRequest:m.isXMLRequest,isWithCredentials:m.isWithCredentials};Y=N.rule.replace('@'+Y,'')||'_common';Y={template:'undefined'!=typeof E.content.templates?E.content.templates[Y]||E.content.templates._common:void 0,isCacheless:E.isCacheless};Y=B(Y,N);E=JSON.clone(E);Y.conf=E;Y.conf.content.routing[Y.rule].param=
|
|
70
|
-
N.param;Y.template&&'undefined'==typeof Y.template.ginaLoader&&(Y.template.ginaLoader=Y.conf.content.templates._common.ginaLoader);Y.conf.content.routing[Y.rule].param=N.param;delete Y.middleware;delete Y.param;delete Y.requirements;E=new (require(_(GINA_FRAMEWORK_DIR+'/core/controller/controller.js'),!0))(Y);E.name=ba.param.control;E.serverInstance=P;E.setOptions(m,w,Q,Y);m='object'==typeof k.data&&0<k.data.count()?k.data:{};if(/^get|delete|put$/i.test(k.method)){w=0;for(let U in m)'object'==typeof m[U]&&
|
|
71
|
-
encodeRFC5987ValueChars(JSON.stringify(m[U])),w++}y.method=k.method;y.path=ba.url;k=require('util').promisify;var K={isValid:!1},qa=!1;await k(E.query)(y,m).then(function(U){K=U}).catch(function(U){qa=U});qa&&(console.error(qa),K.error=qa);return K},u=null;u=H?na:F;var p=function(k,m){var w=null,Q=null;'undefined'==typeof h[k]&&'undefined'!=typeof m&&(h[k]=w=m);if('object'==typeof h[k])try{w=JSON.parse(JSON.stringify(h[k]))}catch(z){w=h[k]}else w=h[k];Q='';H&&'undefined'!=typeof L&&(Q=L[k].getAttribute('data-gina-form-field-label')||
|
|
72
|
-
'');h[k]={target:H&&'undefined'!=typeof L?L[k]:null,name:k,value:w,valid:!1,label:Q,exclude:!1};h[k].is=function(z,y,N){var Y=!1,ia='undefined'!=typeof window&&'undefined'!=typeof window._currentValidatorAlias?window._currentValidatorAlias:'is';'undefined'!=typeof window&&window._currentValidatorAlias&&delete window._currentValidatorAlias;var ba=h[this.name].errors||{};C.data[this.name]=h[this.name].value;'undefined'==typeof ba.isRequired&&''==this.value&&!/^false$/i.test(this.value)&&0!=this.value||
|
|
73
|
-
!ba.isRequired&&''==this.value&&!/^false$/i.test(this.value)&&0!=this.value?Y=!0:ba.isRequired||'string'!=typeof this.value||''!=this.value||(Y=!0);if(!Y&&/^(true|false)$/i.test(z))Y=z;else if(!Y){var E=null,P=null;if(/[!=>><a-z 0-9]+/i.test(z)){if((P=z.match(/\${0}[-_,.\[\]a-z0-9]+/ig))&&0<P.length){for(var K=0,qa=P.length;K<qa;++K)'undefined'!=typeof h[P[K]]&&P[K]&&(E=new RegExp('\\$'+P[K]+'(?!\\S+)','g'),z=''==h[P[K]].value?z.replace(E,'""'):'string'==typeof h[P[K]].value?z.replace(E,'"'+h[P[K]].value+
|
|
74
|
-
'"'):z.replace(E,h[P[K]].value));try{z=z.replace(/(\(|\)|return)/g,''),Y=/^\//.test(z)?eval(z+'.test("'+this.value+'")'):eval(z)}catch(U){throw Error(U.stack||U.message);}}}else if(z instanceof RegExp)Y=z.test(this.value)?!0:!1;else if('boolean'==typeof z)Y=z?!0:!1;else try{/\/(.*)\//.test(z)?(E=z.match(/\/(.*)\//).pop(),P=z.replace('/'+E+'/',''),Y=(new RegExp(E,P)).test(this.value)):Y=eval(z)}catch(U){throw Error(U.stack||U.message);}}Y?Y&&'undefined'!=typeof ba[ia]&&delete ba[ia]:(ba[ia]=f(this.error||
|
|
75
|
-
y||C.errorLabels[ia],this),'undefined'!=typeof N&&(ba.stack=N));this.valid=Y;0<ba.count()&&(this.errors=ba);return h[this.name]};h[k].set=function(z){this.value=C.data[this.name]=z;this.target.setAttribute('value',z);return h[this.name]};h[k].isEmail=function(){this.value=C.data[this.name]=this.value?this.value.toLowerCase():this.value;H&&this.target&&''!=this.target.value&&/[A-Z]+/.test(this.target.value)&&(this.target.value=this.value);var z=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(this.value)?
|
|
76
|
-
!0:!1,y=h[this.name].errors||{};y.isRequired||''!=this.value||(z=!0);z?z&&'undefined'!=typeof y.isEmail&&delete y.isEmail:y.isEmail=f(this.error||C.errorLabels.isEmail,this);this.valid=z;0<y.count()&&(this.errors=y);return h[this.name]};h[k].isJsonWebToken=function(){this.value=C.data[this.name]=this.value?this.value.toLowerCase():this.value;H&&this.target&&''!=this.target.value&&/[A-Z]+/.test(this.target.value)&&(this.target.value=this.value);var z=/^[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.?[A-Za-z0-9-_.+/=]*$/.test(this.value)?
|
|
77
|
-
!0:!1,y=h[this.name].errors||{};y.isRequired||''!=this.value||(z=!0);z?z&&'undefined'!=typeof y.isJsonWebToken&&delete y.isJsonWebToken:y.isJsonWebToken=f(this.error||C.errorLabels.isJsonWebToken,this);this.valid=z;0<y.count()&&(this.errors=y);return h[this.name]};h[k].isBoolean=function(){var z=null,y=h[this.name].errors||{};y.isRequired&&0==this.value&&(delete y.isRequired,this.errors=y);switch(this.value){case 'true':case !0:case 1:z=this.value=C.data[this.name]=!0;break;case 'false':case !1:case 0:z=
|
|
78
|
-
this.value=C.data[this.name]=!1}(z=null!==z?!0:!1)?z&&'undefined'!=typeof y.isBoolean&&delete y.isBoolean:y.isBoolean=f(this.error||C.errorLabels.isBoolean,this);this.valid=z;0<y.count()&&(this.errors=y);return h[this.name]};h[k].isNumber=function(z,y){var N=this.value,Y=!1,ia=!0,ba=!0,E=h[this.name].errors||{};try{'string'==typeof N&&/,|\./g.test(N)?N=C.data[this.name]=this.value=parseFloat(N.replace(/,/g,'.').replace(/\s+/g,'')):'string'==typeof N&&''!=N&&(N=C.data[this.name]=this.value=parseInt(N.replace(/\s+/g,
|
|
79
|
-
'')))}catch(K){E.isNumber=f(this.error||C.errorLabels.isNumber,this),this.valid=!1,0<E.count()&&(this.errors=E)}if(+N===+N&&(Y=!0,!E.isRequired&&''!=N)){var P=N.toString().length;z&&'number'==typeof z&&P<z&&(ia=!1,this.size=z);y&&'number'==typeof y&&P>y&&(ba=!1,this.size=y)}Y&&ia&&ba||(Y||(E.isNumber=f(this.error||C.errorLabels.isNumber,this)),ia&&ba||(ia||(E.isNumberLength=f(this.error||C.errorLabels.isNumberMinLength,this)),ba||(E.isNumberLength=f(this.error||C.errorLabels.isNumberMaxLength,this)),
|
|
80
|
-
z===y&&(E.isNumberLength=f(this.error||C.errorLabels.isNumberLength,this))),Y=!1);Y&&'undefined'!=typeof E.isNumberLength&&delete E.isNumberLength;this.valid=Y;this.value=C.data[this.name]=''!=N?Number(N):N;0<E.count()&&(this.errors=E);return h[this.name]};h[k].toInteger=function(){var z=this.value,y=h[this.name].errors||{};if(z)try{this.value=C.data[this.name]=Math.round(z)}catch(N){y.toInteger=f(this.error||C.errorLabels.toInteger,this),this.valid=!1,0<y.count()&&(this.errors=y)}return h[this.name]};
|
|
81
|
-
h[k].isInteger=function(z,y){var N=this.value,Y=!1,ia=!0,ba=!0,E=h[this.name].errors||{};+N===+N&&0===N%1&&(Y=!0,E.isRequired||''==N||(z&&'number'==typeof z&&N.length<z&&(ia=!1,this.size=z),y&&'number'==typeof y&&N.length>y&&(ba=!1,this.size=y)));Y&&ia&&ba||(Y||(E.isInteger=f(this.error||C.errorLabels.isInteger,this)),ia&&ba||(ia||(E.isIntegerLength=f(this.error||C.errorLabels.isIntegerMinLength,this),Y=!1),ba||(E.isIntegerLength=f(this.error||C.errorLabels.isIntegerMaxLength,this),Y=!1),z===y&&(E.isIntegerLength=
|
|
82
|
-
f(this.error||C.errorLabels.isIntegerLength,this),Y=!1)));this.valid=Y;this.value=C.data[this.name]=Number(N);0<E.count()&&(this.errors=E);return h[this.name]};h[k].toFloat=function(z){var y=document.getElementById(this.target.getAttribute('id')).value||this.value;isFloatingWithCommas=!1;'string'==typeof y&&(y=y.replace(/\s+/g,''),/,/.test(y)&&/\./.test(y)?y=y.replace(/,/g,''):/,/.test(y)&&(y=y.replace(/,/g,'.'),isFloatingWithCommas=!0));C.data[this.name]=y;var N=h[this.name].errors||{},Y=!0;z?this.decimals=
|
|
83
|
-
parseInt(z):'undefined'==typeof this.decimals&&(this.decimals=2);if(y)if(this.isNumber().valid)try{Number.isFinite(y)||(y=new Number(parseFloat(y.match(/[0-9.,]+/g).join('').replace(/,/,'.'))))}catch(ia){Y=!1,N.toFloat=f(this.error||C.errorLabels.toFloat,this),this.valid=!1,0<N.count()&&(this.errors=N)}else Y=!1,N.toFloat=f(this.error||C.errorLabels.toFloatNAN,this);else return h[this.name];this.decimals&&y&&!N.toFloat&&(y=parseFloat(y.toFixed(this.decimals)));this.value=C.data[this.name]=y;H&&(isFloatingWithCommas&&
|
|
84
|
-
(y=(''+y).replace(/\./g,',')),this.target.setAttribute('value',y));this.valid=Y;0<N.count()&&(this.errors=N);return h[this.name]};h[k].isFloat=function(z){'string'==typeof this.value&&(this.value=this.value.replace(/\s+/g,''));var y=C.data[this.name]=this.value;z=h[this.name].errors||{};'string'==typeof y&&/\./.test(y)&&Number.isFinite(Number(y));'string'==typeof y&&/,/g.test(y)&&(y=this.value=C.data[this.name]=Number(y.replace(/,/g,'.')));Number(y)===y&&0!==y%1?(this.value=C.data[this.name]=Number(y),
|
|
85
|
-
y=!0):y=!1;z.isRequired||''!=this.value||(y=!0);y||(z.isFloat=f(this.error||C.errorLabels.isFloat,this));this.valid=y;0<z.count()&&(this.errors=z);return h[this.name]};h[k].isRequired=function(z){if('boolean'==typeof z&&!z)return this.valid=!0,z=C.excluded.indexOf(this.name),-1<z&&C.excluded.splice(z,1),h[this.name];if(H&&this.target&&'INPUT'==this.target.tagName&&'undefined'!=typeof this.target.type&&'radio'==this.target.type){z=document.getElementsByName(this.name);for(var y=0,N=z.length;y<N;++y)if(z[y].checked){/true|false/.test(z[y].value)?
|
|
86
|
-
this.value=C.data[this.name]=/true/.test(z[y].value)?!0:!1:this.value=C.data[this.name]=z[y].value;this.valid=!0;break}}z='undefined'==typeof this.value||null==this.value||''==this.value||/^\s+/.test(this.value)?!1:!0;y=h[this.name].errors||{};z?z&&'undefined'!=typeof y.isRequired&&delete y.isRequired:y.isRequired=f(this.error||C.errorLabels.isRequired,this);this.valid=z;0<y.count()&&(this.errors=y);return h[this.name]};h[k].isString=function(z,y){var N=C.data[this.name]=this.value,Y=!1,ia=!0,ba=
|
|
87
|
-
!0,E=h[this.name].errors||{};'string'!=typeof N||E.isRequired||''==N||(Y=!0,z&&'number'==typeof z&&N.length<z&&(ia=!1,this.size=z),y&&'number'==typeof y&&N.length>y&&(ba=!1,this.size=y));Y&&ia&&ba||(!Y&&E.isRequired&&''==N?(Y=!1,E.isString=f(this.error||C.errorLabels.isString,this)):Y||E.isRequired||(Y=!0),ia&&ba||(Y=!1,ia||(E.isStringLength=f(this.error||C.errorLabels.isStringMinLength,this)),ba||(E.isStringLength=f(this.error||C.errorLabels.isStringMaxLength,this)),z===y&&(E.isStringLength=f(this.error||
|
|
88
|
-
C.errorLabels.isStringLength,this))));this.valid=Y;0<E.count()&&(this.errors=E);return h[this.name]};h[k].isDate=function(z){var y=this.value,N=!1,Y=h[this.name].errors||{},ia=null;if(!y||''==y||/NaN|Invalid Date/i.test(y))return/NaN|Invalid Date/i.test(y)&&(console.warn('[FormValidator::isDate] Provided value for field `'+this.name+'` is not allowed: `'+y+'`'),Y.isDate=f(this.error||C.errorLabels.isDate,this)),this.valid=N,0<Y.count()&&(this.errors=Y),h[this.name];if('undefined'==typeof z||'undefined'!=
|
|
89
|
-
typeof z&&/true/i.test(z))z='yyyy-mm-dd';if(y instanceof Date)y=y.format(z);else{try{ia=z.match(/[^\/\- ]+/g)}catch(qa){throw Error('[FormValidator::isDate] Provided mask not allowed: `'+z+'`');}try{y=y.match(/[^\/\- ]+/g);var ba={},E;var P=0;for(E=ia.length;P<E;++P)ba[ia[P]]=y[P];for(var K in ba)z=z.replace(new RegExp(K,'g'),ba[K])}catch(qa){throw Error('[FormValidator::isDate] Provided value not allowed: `'+y+'`'+qa);}y=this.value=C.data[this.name]=new Date(z);if(/Invalid Date/i.test(y)||!1===y instanceof
|
|
90
|
-
Date)return Y.isRequired||''!=this.value?Y.isDate=f(this.error||C.errorLabels.isDate,this):N=!0,this.valid=N,0<Y.count()&&(this.errors=Y),h[this.name];N=!0}this.valid=N;return y};h[k].format=function(z,y){var N=this.value;return N?N.format(z,y):h[this.name]};h[k].setFlash=function(z,y){'undefined'!=typeof y&&''!=y&&(this.error=y);return h[this.name]};h[k].setLabel=function(z){'undefined'!=typeof z&&''!=z&&(this.label=z);return h[this.name]};h[k].trim=function(z){if('boolean'==typeof z&&z)return this.value=
|
|
91
|
-
this.value.replace(/^\s+|\s+$/,''),C.data[this.name]=C.data[this.name]=this.value,h[this.name]};h[k].exclude=function(z){if('boolean'==typeof z&&!z)return/^true|false$/i.test(this.value)&&(this.value=/^true$/i.test(this.value)?!0:!1,C.data[this.name]=this.value),h[this.name];this.isExcluded=!1;0>C.excluded.indexOf(this.name)&&(C.excluded.push(this.name),this.isExcluded=!0);return h[this.name]};h[k].query=u;h[k].getValidationContext=function(){return{isGFFCtx:H,self:h,local:C,replace:f}};if(D()){w=
|
|
92
|
-
m=null;try{for(let z in gina.forms.validators)w='/validators/'+z+'/main.js',C.errorLabels[z]='Condition not satisfied',H?(m=l(gina.forms.validators[z].data),m=m.replace(/(\)\s+\{|\)\{){1}/,'$&\n\tvar validationContext = this.getValidationContext(),isGFFCtx = validationContext.isGFFCtx,self = validationContext.self,local = validationContext.local,replace = validationContext.replace;')):m=gina.forms.validators[z].toString(),h[k][z]=eval('('+m+')\n//# sourceURL='+z+'.js')}catch(z){throw Error('[UserFormValidator] Could not evaluate: `'+
|
|
93
|
-
w+'`\n'+z.stack);}}};for(let k in h)p(k,h[k]);h.addField=function(k,m){'undefined'==typeof h[k]&&p(k,m)};h.isValid=function(){return 0<h.getErrors().count()?!1:!0};h.setErrors=function(k){if(!k)return{};for(var m in h)if('object'==typeof h[m]){for(var w in h[m])'object'==typeof k[m]&&'undefined'!=typeof k[m][w]&&('undefined'!=typeof h[m].valid&&/^true$/i.test(h[m].valid)?delete k[m][w]:('undefined'==typeof h[m].errors&&(h[m].errors={}),h[m].errors[w]=k[m][w]));('undefined'==typeof h[m].errors&&'undefined'!=
|
|
94
|
-
typeof k[m]||'undefined'!=typeof h[m].errors&&0==h[m].errors.count()&&'undefined'!=typeof k[m])&&delete k[m]}return k};h.getErrors=function(k){var m={};if('undefined'!=typeof k)return'undefined'!=typeof h[k]&&h[k]&&'undefined'!=typeof h[k].errors&&0<h[k].errors.count()&&(m[k]=h[k].errors),m;for(var w in h)'object'==typeof h[w]&&'undefined'!=typeof h[w].errors&&0<h[w].errors.count()&&(m[w]=h[w].errors);return m};h.toData=function(){if(0<C.excluded.length)for(var k=0,m=C.excluded.length;k<m;++k)'undefined'!=
|
|
95
|
-
typeof C.data[C.excluded[k]]&&delete C.data[C.excluded[k]];return C.data};var f=function(k,m){var w=k.match(/%[a-z]+/gi);if(w)for(var Q=0,z=w.length;Q<z;++Q)k=k.replace(new RegExp(w[Q],'g'),m[C.keys[w[Q]]]);return k};h.setErrorLabels=function(k){'undefined'!=typeof k&&(C.errorLabels=B(k,C.errorLabels))};return h}'undefined'!==typeof module&&module.exports?module.exports=FormValidatorUtil:'function'===typeof define&&define.amd&&define('lib/form-validator',[],function(){return FormValidatorUtil});
|
|
96
|
-
function Routing(){var v='undefined'!==typeof module&&module.exports?!1:!0,L={allowedMethods:['get','post','put','delete'],reservedParams:['controle','file','title','namespace','path'],notFound:{},getInstance:function(h){return Routing.instance}};if('undefined'==typeof Routing.initialized)Routing.initialized=!0,Routing.instance=L,Routing._cached=[],Routing._cachedRoutes={},Routing._tries={};else return L=L.getInstance();L.allowedMethodsString=L.allowedMethods.join(',');var I=null,O=null,H=null;v?
|
|
97
|
-
(O&&'function'==typeof O||(O=require('lib/merge')),H&&'function'==typeof H||(H=require('lib/form-validator'))):(require('fs'),require('util'),require('../../inherits'),O=require('../../merge'),I=require(__dirname+'/../../../core/plugins')||getContext('gina').plugins,H=I.Validator);L.getUrlProps=function(h,r){var l={};if(v){var Z=window.gina.config;l.hostname=Z.hostname;'undefined'!=typeof h&&(h=this.getRoute('webroot@'+h),l.hostname=h.hostname,l.host=h.host,l.webroot=h.webroot)}else Z=getContext('gina').config,
|
|
98
|
-
'undefined'!=typeof getContext('argvFilename')&&(Z.getRouting=getContext('gina').Config.instance.getRouting),'undefined'==typeof h&&(h=Z.bundle),'undefined'==typeof r&&(r=Z.env),l.hostname=Z.envConf[h][r].hostname,l.host=Z.envConf[h][r].host,l.webroot=Z.envConf[h][r].server.webroot,console.debug('[self.getUrlProps][isProxyHost = '+getContext('isProxyHost')+'] hostname ',Z.envConf[h][r].hostname,vs,process.gina.PROXY_HOSTNAME);return l};L.cache=function(h,r,l,Z,na){-1==Routing._cached.indexOf(h)&&
|
|
99
|
-
(5E3<=Routing._cached.length&&L.invalidateCached(Routing._cached[0]),Routing._cached.push(h),Routing._cachedRoutes[h]={name:r,routing:l,params:Z,methodParams:na})};L.getCached=function(h,r){if(-1<Routing._cached.indexOf(h)){var l=Routing._cachedRoutes[h],Z=r.method.toLowerCase();h=JSON.clone(l.routing);l={method:Z,requirements:h.requirements,namespace:h.namespace||void 0,url:decodeURI(r.url),rule:h.originalRule||l.name,param:h.param,middleware:h.middleware,bundle:h.bundle,isXMLRequest:r.isXMLRequest,
|
|
100
|
-
isWithCredentials:r.isWithCredentials};'undefined'==typeof h.rule&&'undefined'!=typeof l.rule&&(h.rule=l.rule);'undefined'!=typeof h.cache&&(l.cache=h.cache);'undefined'!=typeof h.queryTimeout&&(l.queryTimeout=parseTimeout(h.queryTimeout));return L.compareUrls(l,h.url,r)}return null};L.invalidateCached=function(h){-1<Routing._cached.indexOf(h)&&(Routing._cached.splice(Routing._cached.indexOf(h),1),delete Routing._cachedRoutes[h])};L.compareUrls=async function(h,r,l,Z,na){'undefined'==typeof l&&(l=
|
|
101
|
-
{routing:{}});if(/,/.test(r)){var F=0;r=r.split(/,/g);for(var u=r.length,p={past:!1,request:l};F<u&&!p.past;)p=await B(h,r[F],l,Z,na),++F;return p}return await B(h,r,l,Z,na)};var B=async function(h,r,l,Z,na){var F=null;try{F=h.url.split(/\//)}catch(ia){console.warn(ia),F=['']}r=r.split(/\//);var u=0,p=0,f=r.length,k=0,m={},w=0,Q=l.method.toLowerCase(),z='get';try{z=h.method.toLowerCase()}catch(ia){}var y=!1;if('undefined'!=typeof h.requirements&&/get|delete/i.test(Q)&&'undefined'!=typeof l[Q]||'undefined'!=
|
|
102
|
-
typeof h.requirements&&/get/i.test(Q)&&/delete/i.test(z)){/get/i.test(Q)&&/delete/i.test(z)&&(Q=z);if(/^(delete)$/i.test(Q)&&F.length===r.length){'undefined'==typeof l[Q]&&(l[Q]={});for(let ia=0,ba=r.length;ia<ba;ia++)if(F[ia]===r[ia])++k;else if(z=r[ia].substring(1),'undefined'!=typeof h.requirements[z]){z=h.requirements[z];if(/^\//.test(z))z=z.substring(1,z.lastIndexOf('/')-1);else if(/^validator::/.test(z)&&await X(r[ia],F[ia],h,l,Z,na)){++k;continue}/^:/.test(r[ia])&&'undefined'!=typeof z&&(new RegExp(z)).test(F[ia])&&
|
|
103
|
-
(++k,l[Q][r[ia].substring(1)]=F[ia])}y=!0}for(var N in l[Q])'undefined'!=typeof h.requirements[N]&&0>r.indexOf(':'+N)&&(r[p]=':'+N,++p,F[u]=l[Q][N],++u,y||F.length!==r.length||++f)}if(!y&&F.length===r.length)for(;w<f;++w)F[w]===r[w]?++k:k==w&&/:/.test(r[w])&&await X(r[w],F[w],h,l,Z,na)&&++k;if('undefined'!=typeof h.requirements&&Q==h.method.toLowerCase()&&!y&&k>=f)for(N=Object.getOwnPropertyNames(h.requirements),u=0,r.join(',').match(/:[-_a-z0-9]+/g);u<N.length;){p=N[u];if('undefined'==typeof h.param[p]&&
|
|
104
|
-
/^validator::/i.test(h.requirements[p])){if(r.length!=F.length)break;var Y=r.join(',').match(/:[-_a-z0-9]+/g);let ia=h.requirements[p];w={};z={};y={};try{z=JSON.parse(ia.split(/::/).splice(1)[0].replace(/([^:"\s+](\w+)):/g,'"$1":').replace(/([^:"\s+](\w+))\s+:/g,'"$1":'))}catch(ba){throw ba;}if('undefined'!=typeof z.query&&'undefined'!=typeof z.query.data){w=z.query.data;for(let ba in w)0>Y.indexOf(w[ba])&&delete w[ba];for(let ba=0,E=r.length;ba<E;ba++)/^:/.test(r[ba])&&(Y=r[ba].replace(/^:/,''),
|
|
105
|
-
''!=Y&&'undefined'!=typeof F[ba]&&(w[Y]=F[ba],'undefined'==typeof l.params[Y]&&(l.params[Y]=F[ba])))}w=O(w,JSON.clone(l[Q])||{});'undefined'==typeof w[p]&&(w[p]=null);y[p]=z;_validator=v?new H(w):new H('routing',w,null,y);if(0==z.count()){console.error('Route validation failed '+h.rule);--k;u++;continue}for(let ba in z)if('undefined'!=typeof z[ba].data&&(z[ba].data=w),y=Array.isArray(z[ba])?await _validator[p][ba].apply(_validator[p],z[ba]):await _validator[p][ba](z[ba],l,Z,na),!y.isValid&&(--k,'undefined'!=
|
|
106
|
-
typeof y.error))throw y.error;}u++}m.past=k===f?!0:!1;m.past&&(l.routing=C(h,l[Q]),m.request=l);return m},X=async function(h,r,l,Z,na,F){var u=-1,p=h.match(/:\w+/g);u=new RegExp(h,'g');var f=null,k=null,m=null;f=!1;var w=f=k=k=null,Q=null,z=Z.method.toLowerCase();if(!p.length)return!1;l.param.path&&u.test(l.param.path)&&(l.param.path=l.param.path.replace(u,r));l.param.namespace&&u.test(l.param.namespace)&&(l.param.namespace=l.param.namespace.replace(u,r));'undefined'!=typeof l.param.file&&/:/.test(l.param.file)&&
|
|
107
|
-
(f=new RegExp('(:'+h+'/|:'+h+'$)','g'),D.variable=r,l.param.file=l.param.file.replace(f,D),f=null);l.param.title&&u.test(l.param.title)&&(l.param.title=l.param.title.replace(u,r));if(1==p.length){f=new RegExp(p[0]);u=-1<p.indexOf(h)?p.indexOf(h):!1;!1===u&&h.match(f)&&(u=0);if(!1===u)return u;if(l.method.toLowerCase()!==z)return!1;'undefined'==typeof Z[z]&&(Z[z]={});m=p[u].substring(1);if('undefined'==typeof l.requirements||'undefined'==typeof l.requirements[m])return'undefined'!=typeof l.param[m]&&
|
|
108
|
-
'undefined'!=typeof Z.params&&r?(Z.params[m]=r,'undefined'==typeof Z[z][m]&&(Z[z][m]=r),!0):!1;u=l.requirements[m];if(/^\//.test(u))f=u.match(/\/(.*)\//).pop(),k=u.replace('/'+f+'/',''),f=(new RegExp(f,k)).test(r);else if(/^validator::/.test(u)&&r){k={};f={};w={};Q='';h.replace(new RegExp('[^'+m+']','g'),function(ba){Q+=ba});k[m]=r.replace(new RegExp(Q,'g'),'');try{f=JSON.parse(u.split(/::/).splice(1)[0].replace(/([^:"\s+](\w+)):/g,'"$1":').replace(/([^:"\s+](\w+))\s+:/g,'"$1":'))}catch(ba){throw ba;
|
|
109
|
-
}'undefined'!=typeof f.query&&'undefined'!=typeof f.query.data&&h==f.query.data[Object.keys(f.query.data)[0]]&&(f.query.data[Object.keys(f.query.data)[0]]=k[m],Z.params[m]=k[m]);w[m]=f;k=new H('routing',k,null,w);if(0==f.count())return console.error('Route validation failed '+l.rule),!1;for(var y in f)Array.isArray(f[y])?await k[m][y].apply(k[m],f[y]):await k[m][y](f[y],Z,na,F);f=k.isValid()}else f=(new RegExp(l.requirements[m])).test(r);if('undefined'!=typeof l.param[m]&&'undefined'!=typeof l.requirements&&
|
|
110
|
-
'undefined'!=typeof l.requirements[m]&&'undefined'!=typeof Z.params&&f){Z.params[m]=r;if('undefined'==typeof Z[z][m]){switch(r){case 'null':r=null;break;case 'false':r=!1;break;case 'true':r=!0}Z[z][m]=r}return!0}}else{if('undefined'==typeof l.requirements)return!1;na=l.url;F=Z.url;z={};w='';var N=!1,Y=0;y=0;for(var ia=F.length;y<ia;++y)if(F.charAt(y)!=na.charAt(Y)||N){if(''==w)N=!0,w+=F.charAt(y);else if(y>na.indexOf(p[0])+p[0].length){u=l.requirements[p[0]];r=w.substring(0,w.length);if(/^\//.test(u))f=
|
|
111
|
-
u.match(/\/(.*)\//).pop(),k=u.replace('/'+f+'/',''),f=(new RegExp(f,k)).test(r);else if(/^validator::/.test(u)){k={};f={};w={};Q='';h.replace(new RegExp('[^'+m[0]+']','g'),function(ba){Q+=ba});k[m[0]]=r.replace(new RegExp(Q,'g'),'');f=JSON.parse(u.split(/::/).splice(1)[0].replace(/([^\W+ true false])+(\w+)/g,'"$&"'));w[m[0]]=f;k=new H('routing',k,null,w);for(let ba in f)if(Array.isArray(f[ba]))k[m[0]][ba].apply(k[m[0]],f[ba]);else k[m[0]][ba](f[ba]);f=k.isValid()}else f=(new RegExp(l.requirements[m[0]])).test(r);
|
|
112
|
-
if(f)z[p[0].substring(1)]=r;else return!1;w='';N=!1;Y=na.indexOf(p[0])+p[0].length;--y;p.splice(0,1)}else w+=F.charAt(y),++Y;if(y==ia-1)if(u=l.requirements[p[0]],r=w.substring(0,w.length),/^\//.test(u)?(f=u.match(/\/(.*)\//).pop(),k=u.replace('/'+f+'/',''),f=(new RegExp(f,k)).test(r)):f=(new RegExp(l.requirements[m])).test(r),f)z[p[0].substring(1)]=r;else return!1}else++Y;if(z.count()==p.length){m=null;for(m in z){switch(z[m]){case 'null':z[m]=null;break;case 'false':z[m]=!1;break;case 'true':z[m]=
|
|
113
|
-
!0}Z.params[m]=z[m]}return!0}}return!1},D=function(h){return/\/$/.test(h)?D.variable+'/':D.variable},C=function(h,r){var l=null,Z,na=h.url,F=null;for(F in h.param)if(('undefined'==typeof r||'undefined'!=typeof r[F])&&/^:/.test(h.param[F])){var u=h.param[F].substring(1);if('undefined'!=typeof r&&'undefined'!=typeof r[u]){var p=new RegExp('(:'+u+'/|:'+u+'$)','g');'undefined'!=typeof h.param.path&&/:/.test(h.param.path)&&(h.param.path=h.param.path.replace(p,r[u]));'undefined'!=typeof h.param.title&&
|
|
114
|
-
/:/.test(h.param.title)&&(h.param.title=h.param.title.replace(p,r[u]));'undefined'!=typeof h.param.namespace&&/:/.test(h.param.namespace)&&(h.param.namespace=h.param.namespace.replace(p,r[u]));'undefined'!=typeof h.param.file&&/:/.test(h.param.file)&&(D.variable=r[u],h.param.file=h.param.file.replace(p,D));if(/,/.test(h.url)){l=h.url.split(/,/g);var f=0;for(Z=l.length;f<Z;++f)D.variable=r[u],l[f]=l[f].replace(p,D);h.url=l.join(',')}else D.variable=r[u],h.url=h.url.replace(p,D)}}if(l){f=0;Z=l.length;
|
|
115
|
-
na=na.split(/,/g);var k=0;for(h.urlIndex=0;f<Z;++f)if(l=0,p=na[0].match(/:[-_a-z0-9]+/ig)){F=0;for(u=p.length;F<u;F++){var m=p[F].substring(1);'undefined'!=typeof r[m]&&r[m]&&l++}l>k&&(k=l,h.urlIndex=f)}}return h};L.getRoute=function(h,r,l){var Z=null,na=!1;v?(window.location.port||window.location.hostname!=window.gina.config.hostname.replace(/^(https|http|wss|ws):\/\//,'').replace(/:\d+$/,'')||(na=!0,window.gina.config.hostname=window.gina.config.hostname.replace(/^(https|http|wss|ws):\/\//,'').replace(/:\d+$/,
|
|
116
|
-
'')),Z=window.gina.config):(Z=getContext('gina').config,'undefined'!=typeof getContext('argvFilename')&&(Z.getRouting=getContext('gina').Config.instance.getRouting),na=getContext('isProxyHost'));var F=Z.env||GINA_ENV,u=null,p=Z.bundle;/@/.test(h)||'undefined'==typeof p||null==p||(h=h.toLowerCase(),h+='@'+p);if(/@/.test(h)){var f=h.replace(/(.*):\/\//,'').split(/@/);p=f[1];/\/(.*)$/.test(h)&&(u=h.replace(/(.*):\/\//,'').split(/\/(.*)$/)[1],p=p.replace(/\/(.*)$/,''),F=u||F);h=f[0].toLowerCase()+'@'+
|
|
117
|
-
p}p=Z.getRouting(p,F);if('undefined'==typeof p[h])throw Error('[ RoutingHelper::getRouting(rule, params) ] : `'+h+'` not found !');u=JSON.clone(p[h]);f=null;u=C(u,r);(u.isProxyHost=na)?(u.proxy_hostname=v?window.location.protocol+'//'+document.location.hostname:process.gina.PROXY_HOSTNAME||Z.envConf._proxyHostname,u.proxy_host=u.proxy_hostname.replace(/^(https|http):\/\//,'')):v||'undefined'==typeof process.gina.PROXY_HOSTNAME||(u.proxy_hostname=process.gina.PROXY_HOSTNAME,u.proxy_host=u.proxy_hostname.replace(/^(https|http):\/\//,
|
|
118
|
-
''),console.debug('[getRoute#2]['+na+'] process.gina.PROXY_HOSTNAME ('+process.gina.PROXY_HOSTNAME+') VS config.envConf._proxyHostname ('+Z.envConf._proxyHostname+')'));/,/.test(u.url)&&('undefined'!=typeof u.urlIndex&&(l=u.urlIndex,delete u.urlIndex),l='undefined'!=typeof l?l:0,u.url=u.url.split(/,/g)[l]);/\/$/.test(u.url)&&'/'!=u.url&&(u.url=u.url.substring(0,u.url.length-1));if(/GET/i.test(u.method)&&'undefined'!=typeof r){l='?';Z=p[h].url;na=[];p=0;for(let k in u.param)-1<L.reservedParams.indexOf(k)||
|
|
119
|
-
(new RegExp(u.param[k])).test(Z)||'undefined'==typeof r[k]||(l+=k+'='+encodeRFC5987ValueChars(r[k])+'&',na[p]=r[k],++p);for(let k in r)-1<L.reservedParams.indexOf(k)||'undefined'!=typeof u.requirements[k]||-1<na.indexOf(k)||(l='object'==typeof r[k]?l+(k+'='+encodeRFC5987ValueChars(JSON.stringify(r[k]))+'&'):l+(k+'='+r[k]+'&'));p=na=Z=null;1<l.length&&(l=l.substring(0,l.length-1),u.url+=l);l=null}u.toUrl=function(k){var m=null;/^redirect$/i.test(this.param.control)&&(m=L.getUrlProps(this.bundle,F||
|
|
120
|
-
GINA_ENV));var w=this.webroot||m.webroot;m=''+this.hostname||''+m.hostname;var Q=''+this.url;this.isProxyHost&&(m=''+this.proxy_hostname);this.url='undefined'!=typeof k&&/^true$/i.test(k)?Q.replace(new RegExp('^'+w),'/'):Q.replace(new RegExp('^('+w+'|/$)'),w);return m+this.url};u.request=function(k,m){var w=null,Q=null;'function'==typeof arguments[arguments.length-1]&&(w=arguments[arguments.length-1]);'object'==typeof arguments[2]&&(Q=arguments[2]);var z=this.webroot||Q.webroot,y=this.hostname||Q.hostname;
|
|
121
|
-
Q='undefined'!=typeof k&&1==k?path.replace(z,'/'):this.url||Q.url;/^\//.test(Q)&&(Q=y+Q);y=/^https/.test(y)?'https':'http';v?window.open(Q,'undefined'!=typeof m&&'undefined'!=typeof m.target?m.target:'_self'):('undefined'==typeof m.agent&&(m.agent=!1),y=require(''+y),z=function(N){var Y='',ia=!1;N.on('data',function(ba){Y+=ba});N.on('error',function(ba){ia='Failed to get mail content';ba&&'undefined'!=typeof ba.stack?ia+=ba.stack:'string'==typeof ba&&(ia+='\n'+ba)});N.on('end',function(){if(/^\{/.test(Y))try{Y=
|
|
122
|
-
JSON.parse(Y),'undefined'!=typeof Y.error&&(ia=JSON.clone(Y),Y=null)}catch(ba){ia=ba}ia?w(ia):w(!1,Y)})},w?y.get(Q,m,z):y.get(Q,m))};!/:/.test(u.url)||/:d+\//.test(u.url)||/:\/\//.test(u.url)||(r=u.url.match(/(:(.*)\/|:(.*)$)/g).map(function(k){return k.replace(/\//g,'')}).join(', '),f='[ RoutingHelper::getRoute(rule[, bundle, method]) ] : route [ %r ] param placeholder not defined: `'+u.url+'` !\n Check your route description to compare requirements against param variables [ '+r+']',f=f.replace(/%r/,
|
|
123
|
-
h),h=Error(f),console.warn(h),f=h=r=null);return u};L.getRouteByUrl=function(h,r,l,Z,na){2==arguments.length&&'undefined'!=typeof arguments[1]&&arguments[1]&&-1<L.allowedMethods.indexOf(arguments[1].toLowerCase())&&(l=arguments[1],r=void 0);var F=null,u=null,p=null,f=null,k=null,m=null;if(/#/.test(h)&&1<h.length){var w=h.split(/#/);h=w[0];k='#'+w[1];w=null}1==arguments.length&&'undefined'!=typeof arguments[0]&&(/^(https|http)/i.test(h)||/^\//.test(h)||(h='/'+h),F='/'+h.split(/\//g)[1],v&&(f=gina.config.reverseRouting,
|
|
124
|
-
p=gina.config.routing),'undefined'!=typeof f[F]&&(w=p[f[F]],r=w.bundle,F=w.webroot,m=w.hostname,w=null));na='boolean'!=typeof arguments[arguments.length-1]?!1:arguments[arguments.length-1];var Q=!1,z=null,y=f=z=f=null;w='undefined'!=typeof l?!0:!1;v?(z=window.gina.config,r='undefined'!=typeof r?r:z.bundle,f=z.env,p=z.routing||z.getRouting(r),f=z.reverseRouting,isXMLRequest='undefined'!=typeof isXMLRequest?isXMLRequest:!1,m=m||z.hostname,F=F||z.webroot,Z={routing:{},method:l,params:{},url:h},r&&(Z.bundle=
|
|
125
|
-
r)):(z=getContext('gina').config,r='undefined'!=typeof r?r:z.bundle,f=z.env,p=z.getRouting(r),m=z.envConf[r][f].hostname,F=z.envConf[r][f].server.webroot,Z||={routing:{},isXMLRequest:!1,method:'undefined'!=typeof l?l.toLowerCase():'get',params:{},url:h},na&&(Z.method=l),isXMLRequest=Z.isXMLRequest||!1);z=h.replace(new RegExp('^('+m+'|'+m.replace(/:\d+/,'')+')'),'');'undefined'==typeof Z.routing.path&&(Z.routing.path=decodeURI(z));l='undefined'!=typeof l?l.toLowerCase():'get';w&&(Z.originalMethod=
|
|
126
|
-
Z.method,Z.method=l,Z.routing.path=decodeURI(z));Z.method||(Z.method=l);f={};F=new RegExp(l,'i');m=null;for(N in p){if('undefined'==typeof p[N].param)break;if(p[N].bundle==r&&(m=p[N].method,/,/.test(m)&&F.test(m)&&(m=Z.method),'undefined'==typeof p[N].method||F.test(m))){f={method:m,requirements:p[N].requirements,namespace:p[N].namespace||void 0,url:decodeURI(z),rule:p[N].originalRule||N,param:p[N].param,middleware:JSON.clone(p[N].middleware),bundle:p[N].bundle,isXMLRequest};try{if(y=L.compareUrls(f,
|
|
127
|
-
p[N].url,Z),y.past){u=JSON.clone(p[N]);u.name=N;Q=!0;y={};break}}catch(Y){throw Error('Route [ '+N+' ] needs your attention.\n'+Y.stack);}}}if(Q)return/\/$/.test(h)&&'/'!=h&&(h=h.substring(0,h.length-1)),k&&(h+=k),u.url=h,u.toUrl=function(Y){var ia=this.webroot,ba=this.hostname,E=this.url;this.url='undefined'!=typeof Y&&1==Y?E.replace(ia,'/'):E;return ba+this.url},u;if(v){var N=!1;if('#'==h&&/GET/i.test(l)&&w||/^404:/.test(h))h=location.pathname,N=!0;'undefined'==typeof L.notFound&&(L.notFound={});
|
|
128
|
-
k=null;u='[ RoutingHelper::getRouteByUrl(rule[, bundle, method]) ] : route [ %r ] is called but not found inside your view: `'+h+'` !';if((k=(k=gina.hasPopinHandler&&gina.popinIsBinded?gina.popin.getActivePopin().target.innerHTML.match(/404:\[\w+\][a-z 0-9-_@]+/):document.body.innerHTML.match(/404:\[\w+\][a-z 0-9-_@]+/))&&0<k.length?k[0]:null)&&w&&N)return N=k.match(/\[\w+\]/)[0],k=k.replace('404:'+N,N.replace(/\[|\]/g,'')+'::'),u=u.replace(/%r/,k.replace(/404:\s+/,'')),'undefined'==typeof L.notFound[k]?
|
|
129
|
-
L.notFound[k]={count:1,message:u}:w&&'undefined'!=typeof L.notFound[k]&&++L.notFound[k].count,!1;if((N=gina.config.reverseRouting[h]||null)&&'undefined'!=typeof N&&N.split(/@(.+)$/)[1]==r)return k=N,'undefined'==typeof L.notFound[k]?(u=u.replace(/%r/,l.toUpperCase()+'::'+N),L.notFound[k]={count:1,message:u}):w&&'undefined'!=typeof L.notFound[k]&&++L.notFound[k].count,!1;k=L.compareUrls(f,h,Z)||null;k.past&&w&&(k=l.toUpperCase()+'::'+k.request.routing.rule,'undefined'==typeof L.notFound[k]?u=u.replace(/%r/,
|
|
130
|
-
k):++L.notFound[k].count);return!1}console.warn(Error('[ RoutingHelper::getRouteByUrl(rule[, bundle, method, request]) ] : route not found for url: `'+h+'` !').stack);return!1};L.buildTrie=function(h,r){if(!v){var l=require('./radix'),Z=l.createNode(),na;for(na in h){var F=h[na];if(F&&'object'===typeof F&&F.bundle===r){F=Array.isArray(F.url)?F.url:String(F.url).split(',');for(var u=0;u<F.length;u++){var p=F[u].trim();p&&l.insert(Z,p,na)}}}Routing._tries[r]=Z}};L.lookupTrie=function(h,r){return Routing._tries&&
|
|
131
|
-
Routing._tries[r]?require('./radix').lookup(Routing._tries[r],h):null};return L}'undefined'!==typeof module&&module.exports?('undefined'==typeof console.err&&(console=require('../../logger')),module.exports=Routing()):'function'===typeof define&&define.amd&&define('lib/routing',['require','lib/form-validator','lib/merge'],function(){return Routing()});function registerEvents(v,L){'undefined'==typeof gina&&'undefined'!=typeof window.gina&&(gina=window.gina);gina.registeredEvents[v]=L}
|
|
132
|
-
function mergeEventProps(v,L){for(let I in L)'undefined'==typeof v[I]&&(v[I]=L[I]);return v}
|
|
133
|
-
function addListener(v,L,I,O){var H=function(D,C,h,r){'undefined'!=typeof D.event&&D.event.isTouchSupported&&/^(click|mouseout|mouseover)/.test(h)&&-1==D.event[h].indexOf(C)&&(D.event[h][D.event[h].length]=C);'undefined'!=typeof C&&null!=C?C.addEventListener?C.addEventListener(h,r,!1):C.attachEvent&&C.attachEvent('on'+h,r):D.customEvent.addListener(h,r);gina.events[h]='undefined'!=typeof C.id&&'object'!=typeof C.id?C.id:C.getAttribute('id')},B=0,X=null;if(Array.isArray(I))for(X=I.length;B<X;B++)H(v,
|
|
134
|
-
L,I[B],O);else if(Array.isArray(L))for(B=0,X=L.length;B<X;B++){let D=/\.$/.test(I)?I+L[B].id:I;H(v,L[B],D,O)}else I=/\.$/.test(I)?I+L.id:I,H(v,L,I,O)}
|
|
135
|
-
function triggerEvent(v,L,I,O,H){if('undefined'!=typeof L&&null!=L){var B=!1;window.CustomEvent||document.createEvent?(window.CustomEvent?v=new CustomEvent(I,{detail:O,bubbles:!0,cancelable:!0,target:L}):(v=document.createEvent('HTMLEvents'),v.detail=O,v.target=L,v.initEvent(I,!0,!0),v.eventName=I),H&&(v=mergeEventProps(v,H)),'undefined'!=typeof v.defaultPrevented&&v.defaultPrevented&&(B=v.defaultPrevented),B||L.dispatchEvent(v)):document.createEventObject&&(v=document.createEventObject(),v.srcElement.id=
|
|
136
|
-
L.id,v.detail=O,v.target=L,H&&(v=mergeEventProps(v,H)),L.fireEvent('on'+I,v))}else v.customEvent.fire(I,O)}function cancelEvent(v){'undefined'!=typeof v&&null!=v&&(v.cancelBubble=!0,v.preventDefault&&v.preventDefault(),v.stopPropagation&&v.stopPropagation(),v.returnValue=!1)}
|
|
137
|
-
function setupXhr(v){var L=null;if(window.XMLHttpRequest)L=new XMLHttpRequest;else if(window.ActiveXObject)try{L=new ActiveXObject('Msxml2.XMLHTTP')}catch(O){try{L=new ActiveXObject('Microsoft.XMLHTTP')}catch(H){}}if('undefined'!=typeof v){if(!v.url||'undefined'==typeof v.url)throw Error('Missing `options.url`');'undefined'==typeof v.method&&(v.method='GET');v.method=v.method.toUpperCase();if(v.withCredentials){if('withCredentials'in L)v.isSynchrone?L.open(v.method,v.url,v.isSynchrone):L.open(v.method,
|
|
138
|
-
v.url);else if('undefined'!=typeof XDomainRequest)L=new XDomainRequest,L.open(v.method,v.url);else{result='CORS not supported: the server is missing the header `"Access-Control-Allow-Credentials": true` ';triggerEvent(gina,$target,'error.'+id,result);return}L.responseType='undefined'!=typeof v.responseType?v.responseType:'';L.withCredentials=!0}else v.isSynchrone?L.open(v.method,v.url,v.isSynchrone):L.open(v.method,v.url);for(var I in v.headers)'Content-Type'==I&&'undefined'!=typeof enctype&&null!=
|
|
139
|
-
enctype&&''!=enctype||L.setRequestHeader(I,v.headers[I])}return L}
|
|
140
|
-
function handleXhr(v,L,I,O){if(!v)throw Error('No `xhr` object initiated');var H=null,B=null,X=null,D=null,C=null,h=I.$link||null,r=I.$form||null,l=null;delete I.$link;delete I.$form;r||h?h?(h.target=document.getElementById(h.id),l=gina.link.target,C=gina.link.id):(l=r.target,C=l.getAttribute('id')):(l=L,C=l.getAttribute('id'));var Z=h&&L.getAttribute('data-gina-link-event-on-success')||h&&L.getAttribute('data-gina-link-event-on-error')?!0:!1,na=r&&l.getAttribute('data-gina-form-event-on-submit-success')||
|
|
141
|
-
r&&l.getAttribute('data-gina-form-event-on-submit-error')?!0:!1;na&&r&&listenToXhrEvents(r,'form');L=L.getAttribute('enctype')||I.headers['Content-Type'];for(var F in I.headers)'Content-Type'==F&&'undefined'!=typeof L&&null!=L&&''!=L||v.setRequestHeader(F,I.headers[F]);v.withCredentials='undefined'!=typeof I.withCredentials?I.withCredentials:!1;v.onerror=function(u,p){u={status:v.status||500,error:'Transaction error: might be due to the server CORS settings.\nPlease, check the console for more details.'};
|
|
142
|
-
r&&(r.eventData.error=u);h&&(h.eventData.error=u);'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&window.ginaToolbar.update('data-xhr',u,!0);triggerEvent(gina,l,'error.'+C,u);na&&triggerEvent(gina,l,'error.'+C+'.hform',u);Z&&triggerEvent(gina,l,'error.'+C+'.hlink',u)};v.onreadystatechange=function(u){'undefined'==typeof merge&&(merge=O('lib/merge'));u=/Google Inc/i.test(navigator.vendor)?50:0;2==v.readyState&&(B=/^attachment;/.test(v.getResponseHeader('Content-Disposition'))?!0:!1,!v.responseType&&
|
|
143
|
-
B&&(v.responseType='blob'));if(4==v.readyState)if(H=null,X=v.getResponseHeader('Content-Type'),/^2/.test(v.status)){try{if(/blob/.test(v.responseType)||B){if('undefined'==typeof X||null==X)X='application/octet-stream';H=new Blob([this.response],{type:X});var p=document.createElement('a');p.style='display: none';document.body.appendChild(p);var f=window.URL.createObjectURL(H);p.href=f;var k=v.getResponseHeader('Content-Disposition');p.download=k.match('=(.*)')[0].substring(1);p.click();window.URL.revokeObjectURL(f);
|
|
144
|
-
D={status:v.status,statusText:v.statusText,responseType:H.type,type:H.type,size:H.size}}!D&&/\/json/.test(X)&&(D=JSON.parse(v.responseText),'undefined'==typeof D.status&&(D.status=v.status||200));if(!D&&/\/html/.test(X)&&(D={contentType:X,content:v.responseText},'undefined'==typeof D.status&&(D.status=v.status),'undefined'!=typeof gina.popin&&gina.hasPopinHandler)){var m=gina.popin.getActivePopin();if(m){XHRData={};try{XHRData=(new DOMParser).parseFromString(D.content,'text/html').getElementById('gina-without-layout-xhr-data'),
|
|
145
|
-
XHRData=JSON.parse(decodeURIComponent(XHRData.value)),XHRView=(new DOMParser).parseFromString(D.content,'text/html').getElementById('gina-without-layout-xhr-view'),XHRView=JSON.parse(decodeURIComponent(XHRView.value)),gina&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&'undefined'!=typeof XHRData&&window.ginaToolbar.update('data-xhr',XHRData),gina&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&'undefined'!=typeof XHRView&&window.ginaToolbar.update('view-xhr',XHRView)}catch(y){throw y;
|
|
146
|
-
}m.loadContent(D.content);D=XHRData;triggerEvent(gina,l,'success.'+C,D);return}}D||(D=v.responseText);r&&(r.eventData.success=D);XHRData=D;if(gina&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&XHRData)try{'undefined'!=typeof XHRData&&/\/html/.test(X)&&window.ginaToolbar.update('data-xhr',XHRData)}catch(y){throw y;}triggerEvent(gina,l,'success.'+C,D);na&&triggerEvent(gina,l,'success.'+C+'.hform',D);Z&&triggerEvent(gina,l,'success.'+C+'.hlink',D)}catch(y){D={status:422,error:y.message,
|
|
147
|
-
stack:y.stack};r&&(r.eventData.error=D);XHRData=D;if(gina&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&XHRData)try{'undefined'!=typeof XHRData&&window.ginaToolbar.update('data-xhr',XHRData)}catch(N){throw N;}triggerEvent(gina,l,'error.'+C,D);na&&triggerEvent(gina,l,'error.'+C+'.hform',D);Z&&triggerEvent(gina,l,'error.'+C+'.hlink',D)}if('undefined'!=typeof D&&'undefined'!=typeof D.location)return window.location.hash='',D.location=/^http/.test(D.location)||/^\//.test(D.location)?D.location:
|
|
148
|
-
location.protocol+'//'+D.location,setTimeout(()=>{window.location.href=D.location},u)}else if(0!=v.status)if(D={status:v.status,message:''},/blob/.test(v.responseType)){H=new Blob([this.response],{type:'text/plain'});var w=new FileReader,Q='';w.addEventListener('loadend',y=>{'undefined'==typeof merge&&(merge=O('lib/merge'));/string/i.test(typeof y.srcElement.result)?Q+=y.srcElement.result:'object'==typeof y.srcElement.result?D=merge(D,y.srcElement.result):D.message+=y.srcElement.result;if(/^2/.test(w.readyState)){if(/^(\{|\[)/.test(Q))try{D=
|
|
149
|
-
merge(D,JSON.parse(Q))}catch(ia){D=merge(D,ia)}D.message||delete D.message;r&&(r.eventData.error=D);if('undefined'!=typeof D&&'undefined'!=typeof D.error&&D.error.fields&&'object'==typeof D.error.fields){y={};var N=0,Y;for(Y in D.error.fields)++N,y[Y]={isApplicationValidationError:D.error.fields[Y]};0<N&&handleErrorsDisplay(r.target,y)}XHRData=D;if(gina&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&XHRData)try{window.ginaToolbar.update('data-xhr',XHRData)}catch(ia){throw ia;}triggerEvent(gina,
|
|
150
|
-
l,'error.'+C,D);na&&triggerEvent(gina,l,'error.'+C+'.hform',D);Z&&triggerEvent(gina,l,'error.'+C+'.hlink',D)}});w.readAsText(H)}else{try{D=merge(D,JSON.parse(v.responseText))}catch(y){D=merge(D,y)}r&&(r.eventData.error=D);if('undefined'!=typeof D&&'undefined'!=typeof D.error&&D.error.fields&&'object'==typeof D.error.fields){p={};f=0;for(var z in D.error.fields)++f,p[z]={isApplicationValidationError:D.error.fields[z]};0<f&&handleErrorsDisplay(r.target,p)}XHRData=D;if(gina&&'undefined'!=typeof window.ginaToolbar&&
|
|
151
|
-
window.ginaToolbar&&XHRData)try{window.ginaToolbar.update('data-xhr',XHRData)}catch(y){throw y;}triggerEvent(gina,l,'error.'+C,D);na&&triggerEvent(gina,l,'error.'+C+'.hform',D);Z&&triggerEvent(gina,l,'error.'+C+'.hlink',D)}};v.onprogress=function(u){var p='0';u.lengthComputable&&(p=u.loaded/u.total,p=parseInt(100*p));u={status:100,progress:p};r&&(r.eventData.onprogress=u);triggerEvent(gina,l,'progress.'+C,u)};v.ontimeout=function(u){D={status:408,error:'Request Timeout'};r&&(r.eventData.ontimeout=
|
|
152
|
-
D);triggerEvent(gina,l,'error.'+C,D);na&&triggerEvent(gina,l,'error.'+C+'.hform',D);Z&&triggerEvent(gina,l,'error.'+C+'.hlink',D)}}
|
|
153
|
-
function removeListener(v,L,I,O){'undefined'!=typeof v.event&&v.event.isTouchSupported&&/^(click|mouseout|mouseover)/.test(I)&&-1!=v.event[I].indexOf(L)&&v.event[I].splice(v.event[I].indexOf(L),1);if('undefined'!=typeof L&&null!=L)if(L.removeEventListener)if(Array.isArray(L))for(i=0,len=L.length;i<len;i++)v=/\.$/.test(I)?I+L[i].id:I,L.removeEventListener(v,O,!1),'undefined'!=typeof gina.events[v]&&delete gina.events[v];else I=/\.$/.test(I)?I+L.id:I,L.removeEventListener(I,O,!1);else{if(L.attachEvent)if(Array.isArray(L))for(i=
|
|
154
|
-
0,len=L.length;i<len;i++)v=/\.$/.test(I)?I+L[i].id:I,L.detachEvent('on'+v,O),'undefined'!=typeof gina.events[v]&&delete gina.events[v];else I=/\.$/.test(I)?I+L.id:I,L.detachEvent('on'+I,O)}else if(Array.isArray(L))for(i=0,len=L.length;i<len;i++){let H=/\.$/.test(I)?I+L[i].id:I;v.customEvent.removeListener(H,O);'undefined'!=typeof gina.events[H]&&delete gina.events[H]}else I=/\.$/.test(I)?I+L.id:I,v.customEvent.removeListener(I,O);'undefined'!=typeof gina.events[I]&&delete gina.events[I];'undefined'!=
|
|
155
|
-
typeof O&&O()}
|
|
156
|
-
function on(v,L){if(!this.plugin)throw Error('No `plugin` reference found for this event: `'+v);if(0>gina.registeredEvents[this.plugin].indexOf(v)&&!/^init$/.test(v)&&!/\.hform$/.test(v)&&!/\.hlink$/.test(v))L(Error('Event `'+v+'` not handled by ginaEventHandler'));else{var I=null,O=null;'undefined'!=typeof this.id&&'object'!=typeof this.id?(I=this.target||this,O=this.id):'undefined'!=typeof this.target?((I=this.target)||(I=this),O='undefined'!=typeof I.getAttribute?I.getAttribute('id'):this.id):
|
|
157
|
-
(I=this.target,O=instance.id);this.eventData&&!I.eventData&&(I.eventData=this.eventData);v=/\.(hform|hlink)$/.test(v)?/\.hform$/.test(v)?v.replace(/\.hform$/,'.'+O+'.hform'):v.replace(/\.hlink$/,'.'+O+'.hlink'):v+('.'+O);gina.events[v]||(addListener(gina,I,v,function(H){cancelEvent(H);var B=null;H.detail?B=H.detail:'undefined'!=typeof this.eventData.submit?B=this.eventData.submit:'undefined'!=typeof this.eventData.error?B=this.eventData.error:'undefined'!=typeof this.eventData.success&&(B=this.eventData.success);
|
|
158
|
-
L&&L(H,B)}),this.initialized&&!this.isReady&&triggerEvent(gina,I,'init.'+O));return this}}define('utils/events',function(){});
|
|
159
|
-
function PrototypesHelper(v){var L='undefined'!==typeof module&&module.exports?!1:!0,I=v||null;v=null;if('undefined'==typeof GINA_DIR&&!L&&'undefined'!=typeof process&&3<process.argv.length)if(/^\{/.test(process.argv[2]))v=JSON.parse(process.argv[2]).envVars;else if(/\.ctx$/.test(process.argv[2])){v=require('fs');var O=process.argv[2].split(/\-\-argv\-filename=/)[1];v=JSON.parse(v.readFileSync(O).toString()).envVars}if(I&&'undefined'!=typeof I&&'undefined'!=typeof I.dateFormat)for(let H in I.dateFormat)'undefined'==
|
|
160
|
-
typeof Date[H]&&Object.defineProperty(Date.prototype,H,{writable:!1,enumerable:!1,configurable:!0,value:function(){var B={0:this},X=1,D;for(D in arguments)B[X]=arguments[D],++X;B.length=X;return I.dateFormat[H].apply(this,B)}});'undefined'==typeof Array.clone&&Object.defineProperty(Array.prototype,'clone',{writable:!1,enumerable:!1,configurable:!0,value:function(){return this.slice(0)}});'undefined'!=typeof JSON.clone||L||('undefined'!=typeof v&&null!=v?JSON.clone=require(v.GINA_DIR+'/utils/prototypes.json_clone'):
|
|
161
|
-
(v||(L=__dirname+'/../../../',require(L+'/utils/helper'),setEnvVar('GINA_DIR',L,!0),v=getEnvVars()),JSON.clone=require(getEnvVar('GINA_DIR')+'/utils/prototypes.json_clone')));'undefined'==typeof JSON.escape&&(JSON.escape=function(H){try{return H.replace(/\n/g,'\\n').replace(/\r/g,'\\r').replace(/\t/g,'\\t')}catch(B){throw B;}});'undefined'==typeof Array.toString&&(Array.prototype.toString=function(){return this.join()});'undefined'==typeof Array.inArray&&Object.defineProperty(Array.prototype,'inArray',
|
|
162
|
-
{writable:!1,enumerable:!1,configurable:!0,value:function(H){return-1!=this.indexOf(H)}});'undefined'==typeof Array.from&&Object.defineProperty(Array.prototype,'from',{writable:!1,enumerable:!1,configurable:!0,value:function(H){for(var B={},X=[],D=H.length,C=0,h=0;h<D;h++){var r=H[h];1!==B[r]&&(B[r]=1,X[C++]=r)}return X}});'undefined'==typeof Object.count&&Object.defineProperty(Object.prototype,'count',{writable:!0,enumerable:!1,configurable:!0,value:function(){var H=0;try{this instanceof String&&
|
|
163
|
-
JSON.parse(this);for(var B in this)this.hasOwnProperty(B)&&++H;return H}catch(X){return H}}});'undefined'!=typeof global&&'undefined'==typeof global.__stack&&Object.defineProperty(global,'__stack',{configurable:!0,get:function(){var H=Error.prepareStackTrace;Error.prepareStackTrace=function(X,D){return D};var B=Error();Error.captureStackTrace(B,arguments.callee);B=B.stack;Error.prepareStackTrace=H;return B}})}
|
|
164
|
-
'undefined'!==typeof module&&module.exports?module.exports=PrototypesHelper:'function'===typeof define&&define.amd&&define('helpers/prototypes',[],function(){return PrototypesHelper});
|
|
165
|
-
function DateFormatHelper(){var v='undefined'!==typeof module&&module.exports?!1:!0,L=v?require('lib/merge'):require('./../lib/merge');var I='en-US';var O='en';var H={'default':'ddd mmm dd yyyy HH:MM:ss',shortDate:'m/d/yy',shortDate2:'mm/dd/yyyy',mediumDate:'mmm d, yyyy',longDate:'mmmm d, yyyy',fullDate:'dddd, mmmm d, yyyy',cookieDate:'GMT:ddd, dd mmm yyyy HH:MM:ss',logger:'yyyy mmm dd HH:MM:ss',shortTime:'h:MM TT',shortTime2:'h:MM',mediumTime:'h:MM:ss TT',mediumTime2:'h:MM:ss',longTime:'h:MM:ss TT Z',
|
|
166
|
-
longTime2:'h:MM:ss TT',concatenatedDate:'yyyymmdd',isoDate:'yyyy-mm-dd',isoTime:'HH:MM:ss',shortIsoTime:'HH:MM',longIsoTime:'HH:MM:ss TT',isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",longIsoDateTime:"yyyy-mm-dd'T'HH:MM:ss.L",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"};var B={en:{dayNames:'Sun Mon Tue Wed Thu Fri Sat Sunday Monday Tuesday Wednesday Thursday Friday Saturday'.split(' '),monthNames:'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec January February March April May June July August September October November December'.split(' '),
|
|
167
|
-
masks:{'default':'ddd mmm dd yyyy HH:MM:ss',shortDate:'m/d/yy',shortDate2:'mm/dd/yyyy',mediumDate:'mmm d, yyyy',longDate:'mmmm d, yyyy',fullDate:'dddd, mmmm d, yyyy'}},fr:{dayNames:'dim lun mar mer jeu ven sam dimanche lundi mardi mercredi jeudi vendredi samedi'.split(' '),monthNames:'Jan F\u00e9v Mar Avr Mai Jui Juil Ao\u00fb Sep Oct Nov D\u00e9c Janvier F\u00e9vrier Mars Avril Mai Juin Juillet Ao\u00fbt Septembre Octobre Novembre D\u00e9cembre'.split(' '),masks:{'default':'ddd mmm dd yyyy HH:MM:ss',
|
|
168
|
-
shortDate:'d/m/yy',shortDate2:'dd/mm/yyyy',mediumDate:'d mmm, yyyy',longDate:'d mmmm, yyyy',fullDate:'dddd, d mmmm, yyyy'}}};var X=function(h,r){if(r instanceof Date)return h=h.getTime(),r=r.getTime(),Math.round(Math.abs(h-r)/864E5);throw Error('dateTo is not instance of Date() !');},D=['us','eu','corporate'],C=function(h){d=new Date(h.getFullYear(),h.getMonth(),h.getDate());h=d.getDay()||7;d.setDate(d.getDate()+4-h);h=new Date(Date.parse(d.getFullYear(),0,1));return Math.ceil(((d-h)/864E5+1)/7)};
|
|
169
|
-
return{setCulture:function(h,r){/\-/.test(r)?(I=r,O=r.split(/\-/)[0]):O=r;return this},format:function(h,r,l){var Z=B[O]||B.en,na=null;try{na=L(Z.masks,H)}catch(ia){L=(v='undefined'!==typeof module&&module.exports?!1:!0)?require('lib/merge'):require('./../lib/merge'),na=L(Z.masks,H)}'undefined'!=typeof B[I]&&(Z=B[I],'undefined'!=typeof B[I].mask&&(na=L(Z.masks,H)));var F=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,
|
|
170
|
-
u=/[^-+\dA-Z]/g,p=function(ia,ba){ia=String(ia);for(ba=ba||2;ia.length<ba;)ia='0'+ia;return ia};1!=arguments.length||'[object String]'!=Object.prototype.toString.call(h)||/\d/.test(h)||(r=h,h=void 0);h=h?new Date(h):new Date;if(isNaN(h))throw SyntaxError('invalid date');r=String(na[r]||r||na['default']);'UTC:'==r.slice(0,4)&&(r=r.slice(4),l=!0);var f=l?'getUTC':'get';na=h[f+'Date']();var k=h[f+'Day'](),m=h[f+'Month'](),w=h[f+'FullYear'](),Q=h[f+'Hours'](),z=h[f+'Minutes'](),y=h[f+'Seconds']();f=h[f+
|
|
171
|
-
'Milliseconds']();var N=l?0:h.getTimezoneOffset(),Y={d:na,dd:p(na),ddd:Z.dayNames[k],dddd:Z.dayNames[k+7],m:m+1,mm:p(m+1),mmm:Z.monthNames[m],mmmm:Z.monthNames[m+12],yy:String(w).slice(2),yyyy:w,h:Q%12||12,hh:p(Q%12||12),H:Q,HH:p(Q),M:z,MM:p(z),s:y,ss:p(y),l:p(f,3),L:p(f),t:12>Q?'a':'p',tt:12>Q?'am':'pm',T:12>Q?'A':'P',TT:12>Q?'AM':'PM',Z:l?'UTC':(String(h).match(F)||['']).pop().replace(u,''),o:(0<N?'-':'+')+p(100*Math.floor(Math.abs(N)/60)+Math.abs(N)%60,4),S:['th','st','nd','rd'][3<na%10?0:(10!=
|
|
172
|
-
na%100-na%10)*na%10]};return r.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(ia){return ia in Y?Y[ia]:ia.slice(1,ia.length-1)})},countDaysTo:X,getDaysTo:function(h,r,l){if(r instanceof Date){r=X(h,r);var Z=h.getMonth(),na=h.getFullYear();h=h.getDate()+1;h=new Date(na,Z,h);Z=[];for(na=0;na<r;++na)'undefined'!=typeof l?Z.push((new Date(h)).format(l)):Z.push(new Date(h)),h.setDate(h.getDate()+1);return Z||[]}throw Error('dateTo is not instance of Date() !');},getDaysInMonth:function(h){var r=
|
|
173
|
-
h.getMonth();h=h.getFullYear();h=new Date(h,r,1);for(var l=[];h.getMonth()===r;)l.push(new Date(h)),h.setDate(h.getDate()+1);return l},getQuarter:function(h,r){if(1==arguments.length&&'string'==typeof arguments[0]){if(0>D.indexOf(arguments[0].toLowerCase()))throw Error('Quarter '+arguments[0]+' code not supported !');h=new Date;r=arguments[0]}'undefined'==typeof h&&(h=new Date);'undefined'==typeof r&&(r='corporate');r=r.toLowerCase();switch(r){case 'us':var l=[4,1,2,3];break;case 'corportate':case 'eu':l=
|
|
174
|
-
[1,2,3,4];break;default:l=[1,2,3,4]}return l[Math.floor(h.getMonth()/3)]},getHalfYear:function(h,r){if(1==arguments.length&&'string'==typeof arguments[0]){if(0>D.indexOf(arguments[0].toLowerCase()))throw Error('Quarter '+arguments[0]+' code not supported !');h=new Date;r=arguments[0]}'undefined'==typeof h&&(h=new Date);'undefined'==typeof r&&(r='corporate');r=r.toLowerCase();return 2>=h.getQuarter(r)?1:2},getWeek:function(h,r){'undefined'==typeof h&&(h=new Date);'undefined'==typeof r&&(r='ISO 8601');
|
|
175
|
-
r=r.replace(/\s+/g,'').toLowerCase();switch(r){case 'corporate':case 'eu':case 'iso8601':return C(h);default:return C(h)}},addHours:function(h,r){h=new Date(h.getTime());h.setHours(h.getHours()+r);return h},addDays:function(h,r){h=new Date(h.getTime());h.setHours(h.getHours()+24*r);return h},addYears:function(h,r){h=new Date(h.getTime());h.setFullYear(h.getFullYear()+r);return h}}}
|
|
176
|
-
'undefined'!==typeof module&&module.exports?module.exports=DateFormatHelper:'function'===typeof define&&define.amd&&define('helpers/dateFormat',[],function(){return DateFormatHelper});
|
|
177
|
-
define('gina','require lib/merge lib/routing utils/events helpers/prototypes helpers/dateFormat'.split(' '),function(v){v('utils/events');var L=v('lib/merge');v('lib/routing');var I=v('helpers/dateFormat')();v('helpers/prototypes')({dateFormat:I});window.process||function(O,H,B,X,D,C,h){for(C=O[B]||(O[B]={});!h&&D<X.length;)h=O[X[D++]+'requestAnimationFrame'];C[H]=C[H]||h&&h.bind(O)||O.setImmediate||O.setTimeout}(window,'nextTick','process',['r','webkitR','mozR','msR','oR'],0);window.getComputedStyle||
|
|
178
|
-
(window.getComputedStyle=function(O,H){this.el=O;this.getPropertyValue=function(B){var X=/(\-([a-z]){1})/g;'float'==B&&(B='styleFloat');X.test(B)&&(B=B.replace(X,function(D,C,h){return h.toUpperCase()}));return O.currentStyle[B]?O.currentStyle[B]:null};return this});return async function(O){this.plugin='gina';var H='gina-'+crypto.randomUUID(),B=document,X;document.id=H;H={id:H,isFrameworkLoaded:!1,hasValidator:!1,hasPopinHandler:!1,config:{},session:null,registeredEvents:{},events:{},setOptions:function(D){X=
|
|
179
|
-
L(X,D,!0)}};'undefined'!=typeof parent.window.gina&&(window.gina=L(window.gina||{},parent.window.gina));H=L(window.gina||{},H);registerEvents(this.plugin,['ginaloaded','ready']);triggerEvent(O,B,'ginaloaded',H)}});
|
|
180
|
-
!function(v,L){'object'==typeof exports&&'undefined'!=typeof module?module.exports=L():'function'==typeof define&&define.amd?define('vendor/engine.io',L):(v='undefined'!=typeof globalThis?globalThis:v||self).eio=L()}(this,function(){function v(R,c){for(var b=0;b<c.length;b++){var a=c[b];a.enumerable=a.enumerable||!1;a.configurable=!0;'value'in a&&(a.writable=!0);var e=Object,n=e.defineProperty;var q=a.key;a:if('object'==typeof q&&q){var g=q[Symbol.toPrimitive];if(void 0!==g){q=g.call(q,'string');
|
|
181
|
-
if('object'!=typeof q)break a;throw new TypeError('@@toPrimitive must return a primitive value.');}q=String(q)}n.call(e,R,'symbol'==typeof q?q:q+'',a)}}function L(R,c,b){return c&&v(R.prototype,c),b&&v(R,b),Object.defineProperty(R,'prototype',{writable:!1}),R}function I(){return I=Object.assign?Object.assign.bind():function(R){for(var c=1;c<arguments.length;c++){var b=arguments[c],a;for(a in b)({}).hasOwnProperty.call(b,a)&&(R[a]=b[a])}return R},I.apply(null,arguments)}function O(R){return O=Object.setPrototypeOf?
|
|
182
|
-
Object.getPrototypeOf.bind():function(c){return c.__proto__||Object.getPrototypeOf(c)},O(R)}function H(R,c){R.prototype=Object.create(c.prototype);R.prototype.constructor=R;X(R,c)}function B(){try{var R=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(c){}return(B=function(){return!!R})()}function X(R,c){return X=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(b,a){return b.__proto__=a,b},X(R,c)}function D(R){return D='function'==typeof Symbol&&'symbol'==
|
|
183
|
-
typeof Symbol.iterator?function(c){return typeof c}:function(c){return c&&'function'==typeof Symbol&&c.constructor===Symbol&&c!==Symbol.prototype?'symbol':typeof c},D(R)}function C(R){var c='function'==typeof Map?new Map:void 0;return C=function(b){function a(){return function(e,n,q){if(B())return Reflect.construct.apply(null,arguments);var g=[null];g.push.apply(g,n);g=new (e.bind.apply(e,g));return q&&X(g,q.prototype),g}(b,arguments,O(this).constructor)}if(null===b||!function(e){try{return-1!==Function.toString.call(e).indexOf('[native code]')}catch(n){return'function'==
|
|
184
|
-
typeof e}}(b))return b;if('function'!=typeof b)throw new TypeError('Super expression must either be null or a function');if(void 0!==c){if(c.has(b))return c.get(b);c.set(b,a)}return a.prototype=Object.create(b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),X(a,b)},C(R)}function h(R){return R instanceof Uint8Array?R:R instanceof ArrayBuffer?new Uint8Array(R):new Uint8Array(R.buffer,R.byteOffset,R.byteLength)}function r(){return new TransformStream({transform:function(R,
|
|
185
|
-
c){!function(b,a){Y&&b.data instanceof Blob?b.data.arrayBuffer().then(h).then(a):ia&&(b.data instanceof ArrayBuffer||ba(b.data))?a(h(b.data)):E(b,!1,function(e){y||=new TextEncoder;a(y.encode(e))})}(R,function(b){var a=b.length;if(126>a){var e=new Uint8Array(1);(new DataView(e.buffer)).setUint8(0,a)}else if(65536>a){e=new Uint8Array(3);var n=new DataView(e.buffer);n.setUint8(0,126);n.setUint16(1,a)}else e=new Uint8Array(9),n=new DataView(e.buffer),n.setUint8(0,127),n.setBigUint64(1,BigInt(a));R.data&&
|
|
186
|
-
'string'!=typeof R.data&&(e[0]|=128);c.enqueue(e);c.enqueue(b)})}})}function l(R){return R.reduce(function(c,b){return c+b.length},0)}function Z(R,c){if(R[0].length===c)return R.shift();for(var b=new Uint8Array(c),a=0,e=0;e<c;e++)b[e]=R[0][a++],a===R[0].length&&(R.shift(),a=0);return R.length&&a<R[0].length&&(R[0]=R[0].slice(a)),b}function na(R){if(R){for(var c in na.prototype)R[c]=na.prototype[c];return R}}function F(R){for(var c=arguments.length,b=Array(1<c?c-1:0),a=1;a<c;a++)b[a-1]=arguments[a];
|
|
187
|
-
return b.reduce(function(e,n){return R.hasOwnProperty(n)&&(e[n]=R[n]),e},{})}function u(R,c){c.useNativeTimers?(R.setTimeoutFn=ra.bind(Ba),R.clearTimeoutFn=Ka.bind(Ba)):(R.setTimeoutFn=Ba.setTimeout.bind(Ba),R.clearTimeoutFn=Ba.clearTimeout.bind(Ba))}function p(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function f(){}function k(){for(var R in Ha.requests)Ha.requests.hasOwnProperty(R)&&Ha.requests[R].abort()}function m(R){R=R.xdomain;try{if('undefined'!=
|
|
188
|
-
typeof XMLHttpRequest&&(!R||Ta))return new XMLHttpRequest}catch(c){}if(!R)try{return new (Ba[['Active'].concat('Object').join('X')])('Microsoft.XMLHTTP')}catch(c){}}function w(R){if(8E3<R.length)throw'URI too long';var c=R,b=R.indexOf('['),a=R.indexOf(']');-1!=b&&-1!=a&&(R=R.substring(0,b)+R.substring(b,a).replace(/:/g,';')+R.substring(a,R.length));var e,n;R=Ma.exec(R||'');for(var q={},g=14;g--;)q[Va[g]]=R[g]||'';return-1!=b&&-1!=a&&(q.source=c,q.host=q.host.substring(1,q.host.length-1).replace(/;/g,
|
|
189
|
-
':'),q.authority=q.authority.replace('[','').replace(']','').replace(/;/g,':'),q.ipv6uri=!0),q.pathNames=function(G,A){G=A.replace(/\/{2,9}/g,'/').split('/');'/'!=A.slice(0,1)&&0!==A.length||G.splice(0,1);'/'==A.slice(-1)&&G.splice(G.length-1,1);return G}(0,q.path),q.queryKey=(e=q.query,n={},e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(G,A,ca){A&&(n[A]=ca)}),n),q}var Q=Object.create(null);Q.open='0';Q.close='1';Q.ping='2';Q.pong='3';Q.message='4';Q.upgrade='5';Q.noop='6';var z=Object.create(null);
|
|
190
|
-
Object.keys(Q).forEach(function(R){z[Q[R]]=R});for(var y,N={type:'error',data:'parser error'},Y='function'==typeof Blob||'undefined'!=typeof Blob&&'[object BlobConstructor]'===Object.prototype.toString.call(Blob),ia='function'==typeof ArrayBuffer,ba=function(R){return'function'==typeof ArrayBuffer.isView?ArrayBuffer.isView(R):R&&R.buffer instanceof ArrayBuffer},E=function(R,c,b){var a=R.type;R=R.data;return Y&&R instanceof Blob?c?b(R):P(R,b):ia&&(R instanceof ArrayBuffer||ba(R))?c?b(R):P(new Blob([R]),
|
|
191
|
-
b):b(Q[a]+(R||''))},P=function(R,c){var b=new FileReader;return b.onload=function(){var a=b.result.split(',')[1];c('b'+(a||''))},b.readAsDataURL(R)},K='undefined'==typeof Uint8Array?[]:new Uint8Array(256),qa=0;64>qa;qa++)K['ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.charCodeAt(qa)]=qa;var U,fa='function'==typeof ArrayBuffer,aa=function(R,c){if('string'!=typeof R)return{type:'message',data:oa(R,c)};var b=R.charAt(0);if('b'===b){R=R.substring(1);if(fa){var a=.75*R.length;b=R.length;
|
|
192
|
-
var e=0;'='===R[R.length-1]&&(a--,'='===R[R.length-2]&&a--);var n=new ArrayBuffer(a),q=new Uint8Array(n);for(a=0;a<b;a+=4){var g=K[R.charCodeAt(a)];var G=K[R.charCodeAt(a+1)];var A=K[R.charCodeAt(a+2)];var ca=K[R.charCodeAt(a+3)];q[e++]=g<<2|G>>4;q[e++]=(15&G)<<4|A>>2;q[e++]=(3&A)<<6|63&ca}c=oa(n,c)}else c={base64:!0,data:R};c={type:'message',data:c}}else c=z[b]?1<R.length?{type:z[b],data:R.substring(1)}:{type:z[b]}:N;return c},oa=function(R,c){return'blob'===c?R instanceof Blob?R:new Blob([R]):R instanceof
|
|
193
|
-
ArrayBuffer?R:R.buffer},xa=String.fromCharCode(30);na.prototype.on=na.prototype.addEventListener=function(R,c){return this.t=this.t||{},(this.t['$'+R]=this.t['$'+R]||[]).push(c),this};na.prototype.once=function(R,c){function b(){this.off(R,b);c.apply(this,arguments)}return b.fn=c,this.on(R,b),this};na.prototype.off=na.prototype.removeListener=na.prototype.removeAllListeners=na.prototype.removeEventListener=function(R,c){if(this.t=this.t||{},0==arguments.length)return this.t={},this;var b,a=this.t['$'+
|
|
194
|
-
R];if(!a)return this;if(1==arguments.length)return delete this.t['$'+R],this;for(var e=0;e<a.length;e++)if((b=a[e])===c||b.fn===c){a.splice(e,1);break}return 0===a.length&&delete this.t['$'+R],this};na.prototype.emit=function(R){this.t=this.t||{};for(var c=Array(arguments.length-1),b=this.t['$'+R],a=1;a<arguments.length;a++)c[a-1]=arguments[a];if(b){a=0;for(var e=(b=b.slice(0)).length;a<e;++a)b[a].apply(this,c)}return this};na.prototype.emitReserved=na.prototype.emit;na.prototype.listeners=function(R){return this.t=
|
|
195
|
-
this.t||{},this.t['$'+R]||[]};na.prototype.hasListeners=function(R){return!!this.listeners(R).length};var ja='function'==typeof Promise&&'function'==typeof Promise.resolve?function(R){return Promise.resolve().then(R)}:function(R,c){return c(R,0)},Ba='undefined'!=typeof self?self:'undefined'!=typeof window?window:Function('return this')(),ra=Ba.setTimeout,Ka=Ba.clearTimeout,pa=function(R){function c(b,a,e){var n;return(n=R.call(this,b)||this).description=a,n.context=e,n.type='TransportError',n}return H(c,
|
|
196
|
-
R),c}(C(Error));qa=function(R){function c(a){var e;return(e=R.call(this)||this).writable=!1,u(e,a),e.opts=a,e.query=a.query,e.socket=a.socket,e.supportsBinary=!a.forceBase64,e}H(c,R);var b=c.prototype;return b.onError=function(a,e,n){return R.prototype.emitReserved.call(this,'error',new pa(a,e,n)),this},b.open=function(){return this.readyState='opening',this.doOpen(),this},b.close=function(){return'opening'!==this.readyState&&'open'!==this.readyState||(this.doClose(),this.onClose()),this},b.send=
|
|
197
|
-
function(a){'open'===this.readyState&&this.write(a)},b.onOpen=function(){this.readyState='open';this.writable=!0;R.prototype.emitReserved.call(this,'open')},b.onData=function(a){a=aa(a,this.socket.binaryType);this.onPacket(a)},b.onPacket=function(a){R.prototype.emitReserved.call(this,'packet',a)},b.onClose=function(a){this.readyState='closed';R.prototype.emitReserved.call(this,'close',a)},b.pause=function(a){},b.createUri=function(a){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};
|
|
198
|
-
return a+'://'+this.i()+this.o()+this.opts.path+this.u(e)},b.i=function(){var a=this.opts.hostname;return-1===a.indexOf(':')?a:'['+a+']'},b.o=function(){return this.opts.port&&(this.opts.secure&&Number(443!==this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?':'+this.opts.port:''},b.u=function(a){var e='',n;for(n in a)a.hasOwnProperty(n)&&(e.length&&(e+='&'),e+=encodeURIComponent(n)+'='+encodeURIComponent(a[n]));a=e;return a.length?'?'+a:''},c}(na);var ua=function(R){function c(){var a;
|
|
199
|
-
return(a=R.apply(this,arguments)||this).h=!1,a}H(c,R);var b=c.prototype;return b.doOpen=function(){this.p()},b.pause=function(a){var e=this;this.readyState='pausing';var n=function(){e.readyState='paused';a()};if(this.h||!this.writable){var q=0;this.h&&(q++,this.once('pollComplete',function(){--q||n()}));this.writable||(q++,this.once('drain',function(){--q||n()}))}else n()},b.p=function(){this.h=!0;this.doPoll();this.emitReserved('poll')},b.onData=function(a){var e=this;(function(n,q){n=n.split(xa);
|
|
200
|
-
for(var g=[],G=0;G<n.length;G++){var A=aa(n[G],q);if(g.push(A),'error'===A.type)break}return g})(a,this.socket.binaryType).forEach(function(n){if('opening'===e.readyState&&'open'===n.type&&e.onOpen(),'close'===n.type)return e.onClose({description:'transport closed by the server'}),!1;e.onPacket(n)});'closed'!==this.readyState&&(this.h=!1,this.emitReserved('pollComplete'),'open'===this.readyState&&this.p())},b.doClose=function(){var a=this,e=function(){a.write([{type:'close'}])};'open'===this.readyState?
|
|
201
|
-
e():this.once('open',e)},b.write=function(a){var e=this;this.writable=!1;(function(n,q){var g=n.length,G=Array(g),A=0;n.forEach(function(ca,la){E(ca,!1,function(ha){G[la]=ha;++A===g&&q(G.join(xa))})})})(a,function(n){e.doWrite(n,function(){e.writable=!0;e.emitReserved('drain')})})},b.uri=function(){var a=this.opts.secure?'https':'http',e=this.query||{};return!1!==this.opts.timestampRequests&&(e[this.opts.timestampParam]=p()),this.supportsBinary||e.sid||(e.b64=1),this.createUri(a,e)},L(c,[{key:'name',
|
|
202
|
-
get:function(){return'polling'}}])}(qa),za=!1;try{za='undefined'!=typeof XMLHttpRequest&&'withCredentials'in new XMLHttpRequest}catch(R){}var Ta=za;ua=function(R){function c(a){var e;if(e=R.call(this,a)||this,'undefined'!=typeof location){var n='https:'===location.protocol,q=location.port;q||=n?'443':'80';e.xd='undefined'!=typeof location&&a.hostname!==location.hostname||q!==a.port}return e}H(c,R);var b=c.prototype;return b.doWrite=function(a,e){var n=this;a=this.request({method:'POST',data:a});a.on('success',
|
|
203
|
-
e);a.on('error',function(q,g){n.onError('xhr post error',q,g)})},b.doPoll=function(){var a=this,e=this.request();e.on('data',this.onData.bind(this));e.on('error',function(n,q){a.onError('xhr poll error',n,q)});this.pollXhr=e},c}(ua);var Ha=function(R){function c(a,e,n){var q;return(q=R.call(this)||this).createRequest=a,u(q,n),q.l=n,q.v=n.method||'GET',q.m=e,q.k=void 0!==n.data?n.data:null,q.A(),q}H(c,R);var b=c.prototype;return b.A=function(){var a,e=this,n=F(this.l,'agent','pfx','key','passphrase',
|
|
204
|
-
'cert','ca','ciphers','rejectUnauthorized','autoUnref');n.xdomain=!!this.l.xd;var q=this.j=this.createRequest(n);try{q.open(this.v,this.m,!0);try{if(this.l.extraHeaders)for(var g in q.setDisableHeaderCheck&&q.setDisableHeaderCheck(!0),this.l.extraHeaders)this.l.extraHeaders.hasOwnProperty(g)&&q.setRequestHeader(g,this.l.extraHeaders[g])}catch(G){}if('POST'===this.v)try{q.setRequestHeader('Content-type','text/plain;charset=UTF-8')}catch(G){}try{q.setRequestHeader('Accept','*/*')}catch(G){}null===(a=
|
|
205
|
-
this.l.cookieJar)||void 0===a||a.addCookies(q);'withCredentials'in q&&(q.withCredentials=this.l.withCredentials);this.l.requestTimeout&&(q.timeout=this.l.requestTimeout);q.onreadystatechange=function(){var G;3!==q.readyState||null!==(G=e.l.cookieJar)&&void 0!==G&&G.parseCookies(q.getResponseHeader('set-cookie'));4===q.readyState&&(200===q.status||1223===q.status?e.B():e.setTimeoutFn(function(){e.O('number'==typeof q.status?q.status:0)},0))};q.send(this.k)}catch(G){return void this.setTimeoutFn(function(){e.O(G)},
|
|
206
|
-
0)}'undefined'!=typeof document&&(this.U=c.requestsCount++,c.requests[this.U]=this)},b.O=function(a){this.emitReserved('error',a,this.j);this.T(!0)},b.T=function(a){if(void 0!==this.j&&null!==this.j){if(this.j.onreadystatechange=f,a)try{this.j.abort()}catch(e){}'undefined'!=typeof document&&delete c.requests[this.U];this.j=null}},b.B=function(){var a=this.j.responseText;null!==a&&(this.emitReserved('data',a),this.emitReserved('success'),this.T())},b.abort=function(){this.T()},c}(na);if(Ha.requestsCount=
|
|
207
|
-
0,Ha.requests={},'undefined'!=typeof document)'function'==typeof attachEvent?attachEvent('onunload',k):'function'==typeof addEventListener&&addEventListener('onpagehide'in Ba?'pagehide':'unload',k,!1);var Pa,Ua=(Pa=m({xdomain:!1}))&&null!==Pa.responseType;Pa=function(R){function c(b){var a=R.call(this,b)||this;b=b&&b.forceBase64;return a.supportsBinary=Ua&&!b,a}return H(c,R),c.prototype.request=function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return I(b,{xd:this.xd},this.opts),
|
|
208
|
-
new Ha(m,this.uri(),b)},c}(ua);var Xa='undefined'!=typeof navigator&&'string'==typeof navigator.product&&'reactnative'===navigator.product.toLowerCase();ua=function(R){function c(){return R.apply(this,arguments)||this}H(c,R);var b=c.prototype;return b.doOpen=function(){var a=this.uri(),e=this.opts.protocols,n=Xa?{}:F(this.opts,'agent','perMessageDeflate','pfx','key','passphrase','cert','ca','ciphers','rejectUnauthorized','localAddress','protocolVersion','origin','maxPayload','family','checkServerIdentity');
|
|
209
|
-
this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(a,e,n)}catch(q){return this.emitReserved('error',q)}this.ws.binaryType=this.socket.binaryType;this.addEventListeners()},b.addEventListeners=function(){var a=this;this.ws.onopen=function(){a.opts.autoUnref&&a.ws.S.unref();a.onOpen()};this.ws.onclose=function(e){return a.onClose({description:'websocket connection closed',context:e})};this.ws.onmessage=function(e){return a.onData(e.data)};this.ws.onerror=function(e){return a.onError('websocket error',
|
|
210
|
-
e)}},b.write=function(a){var e=this;this.writable=!1;for(var n=function(){var g=a[q],G=q===a.length-1;E(g,e.supportsBinary,function(A){try{e.doWrite(g,A)}catch(ca){}G&&ja(function(){e.writable=!0;e.emitReserved('drain')},e.setTimeoutFn)})},q=0;q<a.length;q++)n()},b.doClose=function(){void 0!==this.ws&&(this.ws.onerror=function(){},this.ws.close(),this.ws=null)},b.uri=function(){var a=this.opts.secure?'wss':'ws',e=this.query||{};return this.opts.timestampRequests&&(e[this.opts.timestampParam]=p()),
|
|
211
|
-
this.supportsBinary||(e.b64=1),this.createUri(a,e)},L(c,[{key:'name',get:function(){return'websocket'}}])}(qa);var Ra=Ba.WebSocket||Ba.MozWebSocket;ua=function(R){function c(){return R.apply(this,arguments)||this}H(c,R);var b=c.prototype;return b.createSocket=function(a,e,n){return Xa?new Ra(a,e,n):e?new Ra(a,e):new Ra(a)},b.doWrite=function(a,e){this.ws.send(e)},c}(ua);qa=function(R){function c(){return R.apply(this,arguments)||this}H(c,R);var b=c.prototype;return b.doOpen=function(){var a=this;
|
|
212
|
-
try{this.M=new WebTransport(this.createUri('https'),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved('error',e)}this.M.closed.then(function(){a.onClose()}).catch(function(e){a.onError('webtransport error',e)});this.M.ready.then(function(){a.M.createBidirectionalStream().then(function(e){var n=function(g,G){U||=new TextDecoder;var A=[],ca=0,la=-1,ha=!1;return new TransformStream({transform:function(va,ma){for(A.push(va);;){if(0===ca){if(1>l(A))break;va=Z(A,1);ha=!(128&~va[0]);
|
|
213
|
-
la=127&va[0];ca=126>la?3:126===la?1:2}else if(1===ca){if(2>l(A))break;va=Z(A,2);la=(new DataView(va.buffer,va.byteOffset,va.length)).getUint16(0);ca=3}else if(2===ca){if(8>l(A))break;va=Z(A,8);va=new DataView(va.buffer,va.byteOffset,va.length);var x=va.getUint32(0);if(x>Math.pow(2,21)-1){ma.enqueue(N);break}la=x*Math.pow(2,32)+va.getUint32(4);ca=3}else{if(l(A)<la)break;va=Z(A,la);ma.enqueue(aa(ha?va:U.decode(va),G));ca=0}if(0===la||la>g){ma.enqueue(N);break}}}})}(Number.MAX_SAFE_INTEGER,a.socket.binaryType),
|
|
214
|
-
q=e.readable.pipeThrough(n).getReader();n=r();n.readable.pipeTo(e.writable);a.C=n.writable.getWriter();!function G(){q.read().then(function(A){var ca=A.value;A.done||(a.onPacket(ca),G())}).catch(function(A){})}();e={type:'open'};a.query.sid&&(e.data='{"sid":"'.concat(a.query.sid,'"}'));a.C.write(e).then(function(){return a.onOpen()})})})},b.write=function(a){var e=this;this.writable=!1;for(var n=function(){var g=q===a.length-1;e.C.write(a[q]).then(function(){g&&ja(function(){e.writable=!0;e.emitReserved('drain')},
|
|
215
|
-
e.setTimeoutFn)})},q=0;q<a.length;q++)n()},b.doClose=function(){var a;null===(a=this.M)||void 0===a||a.close()},L(c,[{key:'name',get:function(){return'webtransport'}}])}(qa);var db={websocket:ua,webtransport:qa,polling:Pa},Ma=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Va='source protocol authority userInfo user password host port relative path directory file query anchor'.split(' '),
|
|
216
|
-
$a='function'==typeof addEventListener&&'function'==typeof removeEventListener,gb=[];$a&&addEventListener('offline',function(){gb.forEach(function(R){return R()})},!1);var hb=function(R){function c(a,e){var n;((n=R.call(this)||this).binaryType='arraybuffer',n.writeBuffer=[],n.L=0,n.R=-1,n.D=-1,n.P=-1,n.I=1/0,a&&'object'===D(a)&&(e=a,a=null),a)?(a=w(a),e.hostname=a.host,e.secure='https'===a.protocol||'wss'===a.protocol,e.port=a.port,a.query&&(e.query=a.query)):e.host&&(e.hostname=w(e.host).host);return u(n,
|
|
217
|
-
e),n.secure=null!=e.secure?e.secure:'undefined'!=typeof location&&'https:'===location.protocol,e.hostname&&!e.port&&(e.port=n.secure?'443':'80'),n.hostname=e.hostname||('undefined'!=typeof location?location.hostname:'localhost'),n.port=e.port||('undefined'!=typeof location&&location.port?location.port:n.secure?'443':'80'),n.transports=[],n.$={},e.transports.forEach(function(q){var g=q.prototype.name;n.transports.push(g);n.$[g]=q}),n.opts=I({path:'/engine.io',agent:!1,withCredentials:!1,upgrade:!0,
|
|
218
|
-
timestampParam:'t',rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},e),n.opts.path=n.opts.path.replace(/\/$/,'')+(n.opts.addTrailingSlash?'/':''),'string'==typeof n.opts.query&&(n.opts.query=function(q){var g={};q=q.split('&');for(var G=0,A=q.length;G<A;G++){var ca=q[G].split('=');g[decodeURIComponent(ca[0])]=decodeURIComponent(ca[1])}return g}(n.opts.query)),$a&&(n.opts.closeOnBeforeunload&&(n.q=function(){n.transport&&
|
|
219
|
-
(n.transport.removeAllListeners(),n.transport.close())},addEventListener('beforeunload',n.q,!1)),'localhost'!==n.hostname&&(n.N=function(){n.V('transport close',{description:'network connection lost'})},gb.push(n.N))),n.opts.withCredentials&&(n.X=void 0),n.H(),n}H(c,R);var b=c.prototype;return b.createTransport=function(a){var e=I({},this.opts.query);e.EIO=4;e.transport=a;this.id&&(e.sid=this.id);e=I({},this.opts,{query:e,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[a]);
|
|
220
|
-
return new this.$[a](e)},b.H=function(){var a=this;if(0!==this.transports.length){var e=this.opts.rememberUpgrade&&c.priorWebsocketSuccess&&-1!==this.transports.indexOf('websocket')?'websocket':this.transports[0];this.readyState='opening';e=this.createTransport(e);e.open();this.setTransport(e)}else this.setTimeoutFn(function(){a.emitReserved('error','No transports available')},0)},b.setTransport=function(a){var e=this;this.transport&&this.transport.removeAllListeners();this.transport=a;a.on('drain',
|
|
221
|
-
this.F.bind(this)).on('packet',this.G.bind(this)).on('error',this.O.bind(this)).on('close',function(n){return e.V('transport close',n)})},b.onOpen=function(){this.readyState='open';c.priorWebsocketSuccess='websocket'===this.transport.name;this.emitReserved('open');this.flush()},b.G=function(a){if('opening'===this.readyState||'open'===this.readyState||'closing'===this.readyState)switch(this.emitReserved('packet',a),this.emitReserved('heartbeat'),a.type){case 'open':this.onHandshake(JSON.parse(a.data));
|
|
222
|
-
break;case 'ping':this.J('pong');this.emitReserved('ping');this.emitReserved('pong');this.W();break;case 'error':var e=Error('server error');e.code=a.data;this.O(e);break;case 'message':this.emitReserved('data',a.data),this.emitReserved('message',a.data)}},b.onHandshake=function(a){this.emitReserved('handshake',a);this.id=a.sid;this.transport.query.sid=a.sid;this.R=a.pingInterval;this.D=a.pingTimeout;this.P=a.maxPayload;this.onOpen();'closed'!==this.readyState&&this.W()},b.W=function(){var a=this;
|
|
223
|
-
this.clearTimeoutFn(this.K);var e=this.R+this.D;this.I=Date.now()+e;this.K=this.setTimeoutFn(function(){a.V('ping timeout')},e);this.opts.autoUnref&&this.K.unref()},b.F=function(){this.writeBuffer.splice(0,this.L);this.L=0;0===this.writeBuffer.length?this.emitReserved('drain'):this.flush()},b.flush=function(){if('closed'!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){var a=this.Y();this.transport.send(a);this.L=a.length;this.emitReserved('flush')}},b.Y=function(){if(!(this.P&&
|
|
224
|
-
'polling'===this.transport.name&&1<this.writeBuffer.length))return this.writeBuffer;for(var a,e=1,n=0;n<this.writeBuffer.length;n++){if(a=this.writeBuffer[n].data){if('string'==typeof a){for(var q=0,g=0,G=0,A=a.length;G<A;G++)128>(q=a.charCodeAt(G))?g+=1:2048>q?g+=2:55296>q||57344<=q?g+=3:(G++,g+=4);a=g}else a=Math.ceil(1.33*(a.byteLength||a.size));e+=a}if(0<n&&e>this.P)return this.writeBuffer.slice(0,n);e+=2}return this.writeBuffer},b.Z=function(){var a=this;if(!this.I)return!0;var e=Date.now()>
|
|
225
|
-
this.I;return e&&(this.I=0,ja(function(){a.V('ping timeout')},this.setTimeoutFn)),e},b.write=function(a,e,n){return this.J('message',a,e,n),this},b.send=function(a,e,n){return this.J('message',a,e,n),this},b.J=function(a,e,n,q){if('function'==typeof e&&(q=e,e=void 0),'function'==typeof n&&(q=n,n=null),'closing'!==this.readyState&&'closed'!==this.readyState)(n=n||{}).compress=!1!==n.compress,a={type:a,data:e,options:n},this.emitReserved('packetCreate',a),this.writeBuffer.push(a),q&&this.once('flush',
|
|
226
|
-
q),this.flush()},b.close=function(){var a=this,e=function(){a.V('forced close');a.transport.close()},n=function G(){a.off('upgrade',G);a.off('upgradeError',G);e()},q=function(){a.once('upgrade',n);a.once('upgradeError',n)};return'opening'!==this.readyState&&'open'!==this.readyState||(this.readyState='closing',this.writeBuffer.length?this.once('drain',function(){a.upgrading?q():e()}):this.upgrading?q():e()),this},b.O=function(a){if(c.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&1<this.transports.length&&
|
|
227
|
-
'opening'===this.readyState)return this.transports.shift(),this.H();this.emitReserved('error',a);this.V('transport error',a)},b.V=function(a,e){if('opening'===this.readyState||'open'===this.readyState||'closing'===this.readyState){if(this.clearTimeoutFn(this.K),this.transport.removeAllListeners('close'),this.transport.close(),this.transport.removeAllListeners(),$a&&(this.q&&removeEventListener('beforeunload',this.q,!1),this.N)){var n=gb.indexOf(this.N);-1!==n&&gb.splice(n,1)}this.readyState='closed';
|
|
228
|
-
this.id=null;this.emitReserved('close',a,e);this.writeBuffer=[];this.L=0}},c}(na);hb.protocol=4;var kb=function(R){function c(b){var a=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};a='object'===D(b)?b:a;return(!a.transports||a.transports&&'string'==typeof a.transports[0])&&(a.transports=(a.transports||['polling','websocket','webtransport']).map(function(e){return db[e]}).filter(function(e){return!!e})),R.call(this,b,a)||this}return H(c,R),c}(function(R){function c(){var a;return(a=R.apply(this,
|
|
229
|
-
arguments)||this)._=[],a}H(c,R);var b=c.prototype;return b.onOpen=function(){if(R.prototype.onOpen.call(this),'open'===this.readyState&&this.opts.upgrade)for(var a=0;a<this._.length;a++)this.tt(this._[a])},b.tt=function(a){function e(){ca||(ca=!0,va(),A.close(),A=null)}function n(){ha('transport closed')}function q(){ha('socket closed')}function g(ma){A&&ma.name!==A.name&&e()}var G=this,A=this.createTransport(a),ca=!1;hb.priorWebsocketSuccess=!1;var la=function(){ca||(A.send([{type:'ping',data:'probe'}]),
|
|
230
|
-
A.once('packet',function(ma){if(!ca)if('pong'===ma.type&&'probe'===ma.data){if(G.upgrading=!0,G.emitReserved('upgrading',A),A)hb.priorWebsocketSuccess='websocket'===A.name,G.transport.pause(function(){ca||'closed'!==G.readyState&&(va(),G.setTransport(A),A.send([{type:'upgrade'}]),G.emitReserved('upgrade',A),A=null,G.upgrading=!1,G.flush())})}else ma=Error('probe error'),ma.transport=A.name,G.emitReserved('upgradeError',ma)}))},ha=function(ma){ma=Error('probe error: '+ma);ma.transport=A.name;e();G.emitReserved('upgradeError',
|
|
231
|
-
ma)},va=function(){A.removeListener('open',la);A.removeListener('error',ha);A.removeListener('close',n);G.off('close',q);G.off('upgrading',g)};A.once('open',la);A.once('error',ha);A.once('close',n);this.once('close',q);this.once('upgrading',g);-1!==this._.indexOf('webtransport')&&'webtransport'!==a?this.setTimeoutFn(function(){ca||A.open()},200):A.open()},b.onHandshake=function(a){this._=this.nt(a.upgrades);R.prototype.onHandshake.call(this,a)},b.nt=function(a){for(var e=[],n=0;n<a.length;n++)~this.transports.indexOf(a[n])&&
|
|
232
|
-
e.push(a[n]);return e},c}(hb));return function(R,c){return new kb(R,c)}});
|
|
233
|
-
function BindingHelper(v){var L={};'undefined'!=typeof v&&(L=v);L.process=function(I,O,H){if('undefined'==typeof I||!Array.isArray(I))throw Error('`bindings` must be a defined array');'undefined'==typeof O&&(O=I.length,H=0);if(I[H]){var B=I[H];if('undefined'==typeof B.call)throw Error('`bindings.['+H+'].call` is required !');if('function'!=typeof L[B.call])throw Error('`bindingContext.'+B.call+'` is not a function');var X=B.call;delete B.call;try{if('undefined'!=typeof B.handler){if(!window[B.handler])throw Error('`'+
|
|
234
|
-
B.handler+'` could not be reached. You must expose it to the `window` do object before any call.');var D=B.handler;delete B.handler;window[D].apply(this,Object.values(B));B.handler=D}else L[X].apply(this,Object.values(B));B.call=X}catch(C){console.error('BindingHelper encountered error while trying to execute `'+X+'`'+C.stack||C)}L.process(I,O,H+1)}};return L}define('helpers/binding',[],function(){return BindingHelper});
|
|
235
|
-
if('undefined'!==typeof module&&module.exports){var fs=require('fs'),os=require('os'),dns=require('dns'),execSync=require('child_process').execSync,util=require('util'),promisify=util.promisify;try{var console=require('../../logger')}catch(v){}}
|
|
236
|
-
function Domain(v,L){this.name=arguments.callee.name;var I='undefined'!==typeof module&&module.exports?!1:!0,O=!1,H='/_gina/assets/public_suffix_list.dat',B=null;I&&(O=!!window.MSInputMethodContext&&!!document.documentMode,H=gina.config.webroot+H.substring(1),B=new EventTarget);'function'==typeof arguments[0]&&(L=arguments[0],v=void 0);var X={filename:'../dist/public_suffix_list.dat',url:H,alternativeUrl:'https://raw.githubusercontent.com/publicsuffix/list/master/public_suffix_list.dat',isCachingRequired:!1,
|
|
237
|
-
isUpdating:!1};I||'undefined'==typeof v||'undefined'==typeof v.webroot||(X.url=v.webroot+H.substring(1));var D=this.name,C=null,h=I&&'undefined'!=typeof window&&'undefined'!=typeof window.rawPSL?window.rawPSL:null,r=function(u,p,f){if('undefined'==typeof p)p=X;else for(let k in X)'undefined'==typeof p[k]&&(p[k]=X[k]);I||(p.filename=__dirname+'/'+p.filename);I&&p.isCachingRequired&&(console.warn('[DOMAIN] `options.isCachingRequired` is only available for backend'),p.isCachingRequired=!1);C=p;if(f)return l(p,
|
|
238
|
-
function(k){k?f(k):(console.debug('[DOMAIN][CB] PSL Loaded'),f(k,u))});l(p);console.debug('[DOMAIN] PSL Loaded');return u};H=function(){};var l=async function(u,p){var f=I||u.isCachingRequired?u.url:u.filename,k='undefined'!=typeof u.isUpdating?u.isUpdating:!1,m=null;if(I)if(h&&!k)p(!1);else if(window.fetch){if(B.addEventListener('domain_psl.loaded',Q=>{p(Q.detail.error)}),!(-1<window.gina._global.initialized.indexOf(D))){-1==window.gina._global.initialized.indexOf(D)&&window.gina._global.initialized.push(D);
|
|
239
|
-
m=k=null;try{k=await fetch(f),m=await k.text(),h=window.rawPSL=m}catch(Q){m=Error('[DOMAIN] Could not load PSL\n'+(Q.stack||Q.message||Q));B.dispatchEvent(new CustomEvent('domain_psl.loaded',{detail:{data:null,error:m,timestamp:new Date}}));return}u.isUpdating=!1;B.dispatchEvent(new CustomEvent('domain_psl.loaded',{detail:{data:m,error:!1,timestamp:new Date}}))}}else m=Error('[DOMAIN] Fetch API not supported'),p(m);else{f=!1;if('undefined'!=typeof fs.accessSync)try{fs.accessSync(u.filename,fs.constants.F_OK),
|
|
240
|
-
f=!0}catch(Q){f=!1;try{fs.lstatSync(u.filename).isSymbolicLink()&&(f=!0)}catch(z){}}else f=fs.existsSync(u.filename);f||(u.isCachingRequired=!0);if(u.isCachingRequired){f='curl -o '+u.filename+' '+u.url+' >/dev/null 2>&1';console.debug('[DOMAIN] Running: '+f);try{console.debug(execSync(f).toString())}catch(Q){console.warn('[DOMAIN] could not fetch from `'+u.url+'`. Trying with `'+u.alternativeUrl+'`');f='curl -o '+u.filename+' '+u.alternativeUrl+' >/dev/null 2>&1';try{console.debug(execSync(f).toString())}catch(z){p(z);
|
|
241
|
-
return}}var w=!1;nIntervId=setInterval(()=>{if('undefined'!=typeof fs.accessSync)try{fs.accessSync(u.filename,fs.constants.F_OK),w=!0}catch(Q){w=!1;try{fs.lstatSync(u.filename).isSymbolicLink()&&(w=!0)}catch(z){}}else w=fs.existsSync(u.filename);w&&(clearInterval(nIntervId),h=fs.readFileSync(u.filename).toString(),p(!1))},200)}try{h=fs.readFileSync(u.filename).toString(),p&&p(!1)}catch(Q){console.warn('[DOMAIN] could not read from `'+u.filename+'`'),l(v,p)}}},Z=function(u){C.isUpdating=!0;l(C,u)},
|
|
242
|
-
na=async function(u){u='undefined'!=typeof u&&''!=u?u:os.hostname();if(/\./.test(u))return u;console.debug('[DOMAIN][getFQDN] FQDN: '+u);var p=null,f=null;p=await promisify(dns.lookup)(u,{hints:dns.ADDRCONFIG||dns.V4MAPPED}).then(function(k){console.debug('[DOMAIN][getFQDN] IP: '+k.address);console.debug('[DOMAIN][getFQDN] FAMILY: '+k.family);return k}).catch(function(k){f=k});if(f)throw f;u=await promisify(dns.lookupService)(p.address,0).then(function(k){console.debug('[DOMAIN][getFQDN] FQDN: '+
|
|
243
|
-
k.hostname);console.debug('[DOMAIN][getFQDN] Service: '+k.service);return k.hostname}).catch(function(k){});if(f)throw f;if(!/\./.test(u))throw Error('[DOMAIN][getFQDN] `'+u+'` is not a FQDN !');return u},F={getRootDomain:function(u,p){'undefined'==typeof p&&(p=!1);u=u.trim();var f=!1,k=!1,m=u.replace(/^(.*):\/\/|\/(.*)/g,''),w=m.split(/\./g).reverse(),Q=w.length?w.length-1:0,z=h.replace(/\/\/\s*(.*)\n|^\s*\n/gm,'').split(/\n/).filter(function(y,N,Y){/[^a-z 0-9.]+/.test(y)&&(y=y.replace(/[^a-z 0-9.]+/g,
|
|
244
|
-
'').replace(/^\./g,''));return/\./.test(y)&&!f&&(new RegExp('.'+y+'$')).test(m)?(f=!0,Q=y.split(/\./g).length,Y.splice(0,Y.length),!1):y});m=w[Q];0<Q&&(w=w.splice(0,Q),k=w[0],/:(.*)$/.test(k)&&(k=k.replace(/:(.*)$/,'')),(k=f||!f&&-1<z.indexOf(k)?!0:!1)?1<Q&&!f?(w.splice(2),m=w.reverse().join('.')):m+='.'+w.reverse().join('.'):1<Q?(w.splice(2),m=w.reverse().join('.')):m+='.'+w.reverse().join('.'));/:(.*)$/.test(m)&&(m=m.replace(/:(.*)$/,''));console.debug('[DOMAIN] isSLD: '+f,u,' -> ',m);/^true$/i.test(p);
|
|
245
|
-
return{value:m,isSLD:f,isRegisteredTldOrSld:k}}};I?F.onReady=H:(F.updatePSL=Z,F.getFQDN=na);return I&&O&&!window.fetch?(O=document.createElement('script'),O.type='text/javascript',O.src='https://cdn.jsdelivr.net/npm/promise-polyfill@8.1.3/dist/polyfill.min.js',H=document.createElement('script'),H.type='text/javascript',H.src='https://cdn.jsdelivr.net/npm/whatwg-fetch@3.4.0/dist/fetch.umd.min.js',document.head.appendChild(O),document.head.appendChild(H),setTimeout(()=>r(F,v,L),500)):r(F,v,L)}
|
|
246
|
-
'undefined'!==typeof module&&module.exports?module.exports=Domain:'function'===typeof define&&define.amd&&define('lib/domain',[],function(){return Domain});
|
|
247
|
-
define('gina/link',['require','lib/domain','lib/merge','utils/events'],function(v){var L=v('lib/domain'),I=null,O=v('lib/merge');v('utils/events');return function(H){function B(f,k){var m=u(f),w=m.id,Q=document.getElementById(w)||null;(Q.getAttribute('data-gina-link-event-on-success')||Q.getAttribute('data-gina-link-event-on-error'))&&listenToXhrEvents(m);k='undefined'==typeof k?l:O(k,l);if(/^(http|https):/.test(f)&&!(new RegExp('^'+window.location.protocol+'//'+window.location.host)).test(f)){var z=
|
|
248
|
-
I.getRootDomain(window.location.hostname).value,y=I.getRootDomain(f).value;z=z===y?!0:!1;gina.config.envIsDev&&(console.debug('Checking CORS from Popin plugin...TODO - local CORS Proxy'),console.debug('Is request from same domain ? ',z));z||(f=f.match(/^(https|http):/)[0]+'//corsacme.herokuapp.com/?'+f)}k.url=f;m&&'undefined'!=typeof m.options&&(k=O(m.options,k));k.withCredentials?'withCredentials'in r?k.isSynchrone?r.open(k.method,k.url,k.isSynchrone):r.open(k.method,k.url):'undefined'!=typeof XDomainRequest?
|
|
249
|
-
(r=new XDomainRequest,r.open(k.method,k.url)):(r=null,triggerEvent(gina,Q,'error.'+w,'CORS not supported: the server is missing the header `"Access-Control-Allow-Credentials": true` ')):k.isSynchrone?r.open(k.method,k.url,k.isSynchrone):r.open(k.method,k.url);if(!r)throw Error('No `xhr` object initiated');k.$link=m;handleXhr(r,Q,k,v);r.send()}function X(f,k){if('object'!=typeof k)throw Error('`options` must be an object');f.options=O(k,D.options);k=document.getElementById(f.id)||null;if('undefined'==
|
|
250
|
-
typeof C.$links[f.id]){if(-1<Z.indexOf(f.id))throw Error('`link '+f.id+'` already exists !');if(!gina.events[evt]){addListener(gina,k,evt,function(Q){cancelEvent(Q);Q=F(Q.target.id);var z=Q.url;'undefined'==typeof Q.options.isSynchrone&&(Q.options.isSynchrone=!1);'undefined'==typeof Q.options.withCredentials&&(Q.options.withCredentials=!1);B(z,Q.options)});var m=k.childNodes,w=0;lLen=m.length;if(0<lLen)for(;w<lLen;++w)'undefined'!=typeof m[w].tagName&&na(m[w],k,evt)}f.request=B;f.getLinkById=F;f.getLinkByUrl=
|
|
251
|
-
u;C.$links[f.id]=f}}this.plugin='link';registerEvents(this.plugin,'loaded ready open close destroy success error progress'.split(' '));var D={options:{url:void 0,'class':'gina-link-default'},authorizedEvents:['ready','success','error'],events:{}},C={plugin:this.plugin,id:'gina-links-'+crypto.randomUUID(),on,eventData:{},$links:{},target:document,isReady:!1,initialized:!1},h={plugin:this.plugin,on,eventData:{},target:document,url:null,request:null,$forms:[]},r=null,l={url:'',method:'GET',isSynchrone:!1,
|
|
252
|
-
withCredentials:!0,headers:{'X-Requested-With':'XMLHttpRequest'}},Z=[],na=function(f,k,m){addListener(gina,f,'click',function(w){cancelEvent(w);triggerEvent(gina,k,m)})},F=function(f){return'undefined'!=typeof C.$links[f]?C.$links[f]:null},u=function(f){var k=null,m;for(m in gina.link.$links)if('undefined'!=typeof gina.link.$links[m].url&&gina.link.$links[m].url==f){k=gina.link.$links[m];break}return k},p=function(f,k){'undefined'==typeof f&&(f=C.target);var m,w=null;f=f.getElementsByTagName('a');
|
|
253
|
-
for(var Q=0,z=f.length;Q<z;++Q)if(((m=f[Q].getAttribute('data-gina-link'))||''==m)&&!/^false$/i.test(m)){m=f[Q];var y={type:'a',method:'GET'};var N=m.getAttribute('data-gina-link-url');y.url='undefined'!=typeof N&&null!=N?N:m.getAttribute('href');N=m.getAttribute('id');if('undefined'==typeof N||null==N||''==N||/popin\.link/.test(N))N='link.click.gina-link-'+C.id+'-'+crypto.randomUUID();m.id=N;evt=y.id=N;m.setAttribute('id',evt);'A'==m.tagName&&(w=m.getAttribute('onclick'));w?'undefined'==typeof w||
|
|
254
|
-
/return false/.test(w)||(w=/;$/.test(w)?w+'return false;':w+'; return false;',m.setAttribute('onclick',w)):m.setAttribute('onclick','return false;');'undefined'==typeof C.$links[y.id]&&(y.target=m,m=O(y,h),X(m,k))}};I||new L(function(f,k){if(f)throw f;I=k});return function(f){C.bindLinks=p;C.request=B;C.getLinkById=F;C.getLinkByUrl=u;C.on('init',function(k){if(window.XMLHttpRequest)r=new XMLHttpRequest;else if(window.ActiveXObject)try{r=new ActiveXObject('Msxml2.XMLHTTP')}catch(m){try{r=new ActiveXObject('Microsoft.XMLHTTP')}catch(w){}}evt=
|
|
255
|
-
'click';addListener(gina,C.target,evt,function(m){'undefined'==typeof m.target.id&&(m.target.setAttribute('id',evt+'.'+crypto.randomUUID()),m.target.id=m.target.getAttribute('id'));if(/^link\.click\./.test(m.target.id)){cancelEvent(m);var w=m.target.id;(new RegExp('^link.click.gina-link-'+C.id)).test(w)&&triggerEvent(gina,m.target,w,m.detail)}});'undefined'==typeof f&&(f={});C.options=f;p(C.target,f);gina.linkIsBinded=!0;C.isReady=!0;gina.hasLinkHandler=!0;gina.link=O(gina.link,C);triggerEvent(gina,
|
|
256
|
-
C.target,'ready.'+C.id,C)});C.initialized=!0;return C}(H)}});function insertAfter(v,L){v.parentNode.insertBefore(L,v.nextSibling)}function getElementsByAttribute(v){for(var L=[],I=0,O=document.getElementsByTagName('*'),H=0,B=O.length;H<B;++H)null!==O[H].getAttribute(v)&&(L[I]=O[H],++I);return L}
|
|
257
|
-
(function(v){var L=v.prototype,I=L.parseFromString;try{if((new v).parseFromString('','text/html'))return}catch(O){}L.parseFromString=function(O,H){if(/^\s*text\/html\s*(?:;|$)/i.test(H)){var B=document.implementation.createHTMLDocument('');-1<O.toLowerCase().indexOf('<!doctype')?B.documentElement.innerHTML=O:B.body.innerHTML=O;return B}return I.apply(this,arguments)}})(DOMParser);define('utils/dom',function(){});
|
|
258
|
-
function fadeIn(v){var L=.1;v.style.display='block';var I=setInterval(function(){1<=L&&clearInterval(I);v.style.opacity=L;v.style.filter='alpha(opacity='+100*L+')';L+=.1*L},10)}function fadeOut(v){var L=1,I=setInterval(function(){.1>=L&&(clearInterval(I),v.style.display='none');v.style.opacity=L;v.style.filter='alpha(opacity='+100*L+')';L-=.1*L},50)}define('utils/effects',function(){});
|
|
259
|
-
function DataHelper(){encodeRFC5987ValueChars=function(I){return encodeURIComponent(I).replace(/['()]/g,escape).replace(/\*/g,'%2A').replace(/%(?:7C|60|5E)/g,unescape)};formatDataFromString=function(I){'object'==typeof I&&(I=JSON.stringify(I));try{I=decodeURIComponent(I)}catch(h){}/("false"|"true"|"on")/.test(I)&&(I=I.replace(/"false"/g,!1).replace(/"true"/g,!0).replace(/"on"/g,!0));/("null")/i.test(I)&&(I=I.replace(/"null"/ig,null));a:{var O=I,H=I=null,B=null;if(/^(\{|\[|%7B|%5B)/.test(O)){try{I=
|
|
260
|
-
(B=/^(\{|%7B)/.test(O)?!1:!0)?[]:{};H=/^(%7B|%5B)/.test(O)?JSON.parse(decodeURIComponent(O)):JSON.parse(O);if(Array.isArray(H)){B=0;for(var X=H.length;B<X;++B)I[B]=v(H[B],I);var D=I}else D=v(H,I);var C=D;break a}catch(h){console.error('[365] could not parse body:\n'+O)}C=void 0}else{I={};C=O.split(/&/g);/("false"|"true"|"on")/.test(O)&&O.replace(/"false"/g,!1).replace(/"true"/g,!0).replace(/"on"/g,!0);O={};X=0;for(H=C.length;X<H;++X)if(C[X])if(C[X]=decodeURIComponent(C[X]),/^\{/.test(C[X])||/=\{/.test(C[X])||
|
|
261
|
-
/=\[/.test(C[X]))try{if(/^\{/.test(C[X])){I=JSON.parse(C[X]);break}else O=C[X].match(/=(.*)/),O[0]=C[X].split(/=/)[0],I[O[0]]=JSON.parse(O[1])}catch(h){console.error('[parseBody#1] could not parse body:\n'+C[X])}else{O=C[X].split(/=/);if(/\{\}":/.test(O[1]))try{O[1]=JSON.parse(O[1])}catch(h){console.error('[parseBody#2] could not parse body:\n'+O[1])}'string'!=typeof O[1]||/\[object /.test(O[1])||(O[0]=decodeURIComponent(O[0]),O[1]=decodeURIComponent(O[1]),/^(.*)\[(.*)\]/.test(O[0])?(D=O[0].replace(/\]/g,
|
|
262
|
-
'').split(/\[/g),I=L(I,D,0,O[1])):I[O[0]]=O[1])}C=I}}return C};var v=function(I,O){var H=[];O||={};for(let X in I)if(H[0]=X,H[1]=I[X],/^(.*)\[(.*)\]/.test(H[0])){var B=H[0].replace(/\]/g,'').split(/\[/g);O=L(O,B,0,H[1])}else O[H[0]]=H[1];return O},L=function(I,O,H,B){for(let X=0,D=O.length;X<D;X++){let C=O[H];if(X==H){if('undefined'==typeof I[O[H]]||'string'==typeof I[O[H]])Array.isArray(I)?(C=~~O[H],I[C]=/^\d+$/.test(O[H+1])?[]:{}):I[O[H]]=/^\d+$/.test(O[H+1])?[]:{};if(H==O.length-1){B='undefined'!=
|
|
263
|
-
typeof B?B:'';Array.isArray(I[O[H]])?I[O[H]].push(B):I[O[H]]=B;break}else/^\d+$/.test(O[H])&&!Array.isArray(I)&&(I=[]),'undefined'==typeof I[C]&&(I[C]=null),L(I[C],O,H+1,B)}}return I}}'undefined'!==typeof module&&module.exports?module.exports=DataHelper:'function'===typeof define&&define.amd&&define('utils/data',[],function(){return DataHelper()});
|
|
264
|
-
function ValidatorPlugin(v,L,I){this.plugin='validator';var O='init ready registered success error progress submit reset change changed keydown keyup focusout focusin validate validated destroy asyncCompleted'.split(' '),H='undefined'!==typeof module&&module.exports?!1:!0,B=null;if(H)require('utils/events'),registerEvents(this.plugin,O),require('utils/dom'),require('utils/effects'),require('utils/data'),B=gina.config.envIsDev;else{if(B=/^true$/i.test(process.env.NODE_ENV_IS_DEV)?!0:!1)delete require.cache[require.resolve('./form-validator')],
|
|
265
|
-
delete require.cache[require.resolve('../../../../../helpers/data')];require('../../../../../helpers/data')}var X={v1:function(){return Date.now().toString(36)+'-'+crypto.randomUUID()},v4:function(){return crypto.randomUUID()}},D=H?require('lib/merge'):require('../../../../../lib/merge'),C=H?require('lib/inherits'):require('../../../../../lib/inherits'),h=H?require('lib/form-validator'):require('./form-validator'),r=H?require('lib/routing'):require('../../../../../lib/routing'),l={id:'validator-'+
|
|
266
|
-
X.v4(),plugin:this.plugin,on:H?on:null,eventData:{},target:H?document:null,errors:{},initialized:!1,isReady:!1,rules:{},$forms:{},getFormById:null,validateFormById:null,setOptions:null,resetErrorsDisplay:null,resetFields:null},Z={id:null,plugin:this.plugin,on:H?on:null,eventData:{},target:H?document:null,cachedErrors:{},lastFocused:H?[]:null,binded:!1,unbinded:!1,withUserBindings:!1,rules:{},setOptions:null,send:null,isValidating:null,isSubmitting:null,submit:null,destroy:null,resetErrorsDisplay:null,
|
|
267
|
-
resetFields:null},na={},F={},u=null,p={url:'',method:'GET',isSynchrone:!1,withCredentials:!1,withRateLimit:!0,headers:{'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8','X-Requested-With':'XMLHttpRequest'}},f=function(c,b,a){a='undefined'!=typeof a?{id:a}:null;var e={},n;for(n in b)e[n]=b[n];if('undefined'!=typeof c&&0<c.count()){try{ja(c,''),oa(c)}catch(q){throw q;}return R(a,e,null,l.rules)}return new h(e)},k=function(c){p=c=D(c,p);return this},m=function(c){var b=null;if(!l.$forms)throw Error('`$forms` collection not found');
|
|
268
|
-
if('undefined'==typeof c)throw Error('[ FormValidator::getFormById(formId) ] `formId` is missing');c=c.replace(/#/,'');if(null!=document.getElementById(c)&&'undefined'==typeof l.$forms[c]){var a=document.getElementById(c),e,n=typeof(0<na.count())?na:l.rules;a.getAttribute?(id=a.getAttribute('id')||'form.'+X.v4(),id!==a.getAttribute('id')&&a.setAttribute('id',id)):(id='form.'+X.v4(),a.setAttribute('id',id));a.id=Z.id=id;if('undefined'!=typeof a.id&&'null'!=a.id&&''!=a.id){Z.target=a;l.$forms[a.id]=
|
|
269
|
-
D({},Z);if(e=a.getAttribute('data-gina-form-rule')){e=e.replace(/\-|\//g,'.');if('undefined'==typeof n[e])throw Error('['+a.id+'] no rule found with key: `null`');e=n[e]}'string'==typeof a.id&&'undefined'!=typeof n[a.id.replace(/\-/g,'.')]?$target=l.$forms[a.id].target:'object'==typeof a.id?(delete l.$forms[a.id],n=a.attributes.getNamedItem('id').nodeValue||'form.'+X.v4(),a.setAttribute('id',n),a.id=n,Z.target=a,l.$forms[n]=D({},Z),$target=l.$forms[n].target):$target=l.$forms[a.id].target;e?Ma($target,
|
|
270
|
-
e):Ma($target)}}'undefined'!=typeof l.$forms[c]&&(l.$forms[c].withUserBindings=!0,b='undefined'!=typeof this.$forms&&'undefined'==typeof this.$forms[c]?this.$forms[c]=l.$forms[c]:l.$forms[c]);if(!b)throw Error('Validator::getFormById(...) exception: could not retrieve form `'+c+'`');b.binded||(Ma(b.target),b=l.$forms[c]);B&&H&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&(gina.forms.errors||(gina.forms.errors={}),a={id:c,rules:l.$forms[c].rules},'undefined'!=typeof l.$forms[c].errors&&
|
|
271
|
-
(a.errors=l.$forms[c].errors),window.ginaToolbar.update('forms',a));return b},w=function(){var c=!1,b=null;gina.hasPopinHandler&&gina.popinIsBinded&&(b=gina.popin.getActivePopin());b&&b.isOpen&&(c=!0);return c},Q=function(c,b){var a=typeof(0<na.count())?na:l.rules;if(!l.$forms)throw Error('`$forms` collection not found');if('undefined'!=typeof c&&'undefined'!=typeof l.$forms[c])return l.$forms[c];if('undefined'==typeof c)if('undefined'!=typeof this.id&&''!=this.id&&null!=this.id)c=this.id;else throw Error('[ FormValidator::validateFormById(formId, customRule) ] `formId` is missing');
|
|
272
|
-
if('string'==typeof c)c=c.replace(/#/,'');else{if('object'!=typeof c||Array.isArray(c))throw Error('[ FormValidator::validateFormById(formId[, customRule]) ] `formId` should be a `string`');var e=c.form;c=e.getAttribute('id')||'form.'+X.v4();e.setAttribute('id',c)}var n=document.getElementsByTagName('form');for(var q={},g=0,G=n.length;g<G;++g)e=n[g].getAttribute('id')||null,'undefined'==typeof q[e]?q[e]=!0:'undefined'==typeof l.$forms[e]||l.$forms[e].warned||(gina.popinIsBinded?console.warn('Popin/Validator::bindForm($target, customRule): `'+
|
|
273
|
-
e+'` is a duplicate form ID. If not fixed, this could lead to an undesirable behaviour.\n Check inside your popin content'):console.warn('Validator::bindForm($target, customRule): `'+e+'` is a duplicate form ID. If not fixed, this could lead to an undesirable behaviour.'),l.$forms[e].warned=!0);if('undefined'!=typeof this.$forms&&'undefined'!=typeof l.$forms[c])n=this.$forms[c]=l.$forms[c];else{e=document.getElementById(c);Z.id=c;Z.target=e;n=this.$forms[c]=l.$forms[c]=D({},Z);if('undefined'==typeof b)if(q=
|
|
274
|
-
c.replace(/\-/g,'.'),'undefined'!=typeof a)n.rule=Ba(q);else{if('undefined'!=typeof n.target&&null!==n.target&&n.target.getAttribute('data-gina-form-rule'))if(q=n.target.getAttribute('data-gina-form-rule').replace(/\-|\//g,'.'),'undefined'!=typeof a)n.rule=Ba(q);else throw Error('[ FormValidator::validateFormById(formId) ] using `data-gina-form-rule` on form `'+n.target+'`: no matching rule found');}else if(q=b.replace(/\-|\//g,'.'),'undefined'!=typeof a)n.rule=Ba(q);else throw Error('[ FormValidator::validateFormById(formId, customRule) ] `'+
|
|
275
|
-
b+'` is not a valid rule');e&&'undefined'!=typeof this.isPopinContext&&/true/i.test(this.isPopinContext)&&(e.isPopinContext=this.isPopinContext);e&&!n.binded&&Ma(e,q)}if(!n)throw Error('[ FormValidator::validateFormById(formId, customRule) ] `'+c+'` not found');return n||null},z=function(c){var b=c.form.id||c.form.getAttribute('id'),a=c.name||c.form.getAttribute('name'),e=document.activeElement.name;if(!/^true$/i.test(l.$forms[b].isValidating)){var n=c.parentNode;c=!1;var q=n.getElementsByTagName('div');
|
|
276
|
-
/form\-item\-warning/.test(n.className)&&e!=a?n.className=n.className.replace(/form\-item\-warning/,'form-item-error'):/form\-item\-error/.test(n.className)&&e==a&&(n.className=n.className.replace(/form\-item\-error/,'form-item-warning'),c=!0);if(!/^true$/i.test(l.$forms[b].isValidating)||c)for(b=0,a=q.length;b<a;++b)if(/form\-item\-error\-message/.test(q[b].className)){q[b].className=c?q[b].className+' hidden':q[b].className.replace(/(\s+hidden|hidden)/,'');break}}},y={},N=function(c,b,a,e){if(B)var n=
|
|
277
|
-
null;var q=!1;if('undefined'!=typeof c.dataset.ginaFormIsResetting&&/^(true)$/i.test(c.dataset.ginaFormIsResetting))b={},y={},c.dataset.ginaFormIsResetting=!1;else if(/^(true)$/i.test(c.dataset.ginaFormLiveCheckEnabled)&&'undefined'!=typeof e){var g='string'!=typeof c.id?c.getAttribute('id'):c.id;'undefined'==typeof y[g]&&(y[g]={});if(b&&0<b.count()){if(y[g][e]={},y[g][e]=D(b[e],y[g][e]),0==y[g][e].count()&&delete y[g][e],b=y[g],!l.$forms[g].sent||l.$forms[g].isValidating)if(q=!0,g=l.$forms[g].lastFocused,
|
|
278
|
-
0<g.length&&'undefined'!=typeof g[1]&&g[1].name==e||0<g.length&&!g[1]&&document.activeElement.getAttribute('name')!=g[0].name||document.activeElement.getAttribute('name')!=e)q=!1}else'undefined'!=typeof y[g][e]&&(delete y[g][e],'undefined'!=typeof window.gina.validator.$forms[g].errors&&'undefined'!=typeof window.gina.validator.$forms[g].errors[e]&&delete window.gina.validator.$forms[g].errors[e]),('undefined'!=typeof l.$forms&&'undefined'!=typeof l.$forms[g]&&'undefined'!=typeof l.$forms[g].errors&&
|
|
279
|
-
0==l.$forms[g].errors.count()||'undefined'!=typeof l.$forms&&'undefined'!=typeof l.$forms[g]&&!l.$forms[g].errors)&&Va(c,!0),'undefined'!=typeof y[g]&&0==y[g].count()?delete y[g]:b=y[g]}var G=null;g=c.getAttribute('id');a='undefined'!=typeof a?a:{};for(var A=0,ca=c.length;A<ca;++A){var la=c[A];if('undefined'==typeof e||e==la.name){if(/form\-item\-wrapper$/.test(la.parentNode.className)){var ha=la.parentNode.parentNode;var va=la.parentNode}else ha=la.parentNode,va=la;var ma=la.getAttribute('name');
|
|
280
|
-
var x=la.getAttribute('data-gina-form-errors');if(ma){if(b&&'undefined'!=typeof b[ma]&&!/(form\-item\-error|form\-item\-warning)/.test(ha.className)){ha.className=q?ha.className+(''==ha.className?'form-item-warning':' form-item-warning'):ha.className+(''==ha.className?'form-item-error':' form-item-error');G=document.createElement('div');G.className=q?'form-item-error-message hidden':'form-item-error-message';for(var V in b[ma])'stack'!=V&&(ha=document.createElement('p'),ha.appendChild(document.createTextNode(b[ma][V])),
|
|
281
|
-
G.appendChild(ha)),B&&(n||={},n[ma]||(n[ma]={}),n[ma][V]=b[ma][V]);'hidden'!=va.type&&insertAfter(va,G)}else if(b&&'undefined'==typeof b[ma]&&/(form\-item\-error|form\-item\-warning)/.test(ha.className)||b&&'undefined'!=typeof b[ma]&&0==b[ma].count()&&/(form\-item\-error|form\-item\-warning)/.test(ha.className)){console.debug('[handleErrorsDisplay] Resetting when not in error');ma=ha.getElementsByTagName('div');va=0;for(x=ma.length;va<x;++va)if(/form\-item\-error\-message/.test(ma[va].className)){ma[va].parentElement.removeChild(ma[va]);
|
|
282
|
-
break}ha.className=ha.className.replace(/(\s+form\-item\-error|form\-item\-error|\s+form\-item\-warning|form\-item\-warning)/,'')}else if(0<b.count()&&'undefined'!=typeof b[ma]&&x){x=ha.getElementsByTagName('div');for(var da=0,S=x.length;da<S;++da){let ea=x[da].className.match('form-item-error-message');if(ea&&'undefined'!=typeof ea.length&&0<ea.length){x[da].parentElement.removeChild(x[da]);G=document.createElement('div');G.setAttribute('class','form-item-error-message');!q&&/(\s+form\-item\-warning|form\-item\-warning)/.test(ha.className)&&
|
|
283
|
-
(ha.className=ha.className.replace(/(\s+form\-item\-warning|form\-item\-warning)/,' form-item-error'));for(V in b[ma])ha=document.createElement('p'),ha.appendChild(document.createTextNode(b[ma][V])),G.appendChild(ha),B&&(n||={},n[ma]||(n[ma]={}),n[ma][V]=b[ma][V]);break}}G&&'hidden'!=va.type&&insertAfter(va,G)}if('undefined'!=typeof e&&e===la.name)break}}}n?(triggerEvent(gina,c,'error.'+g,b),B&&H&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&(gina.forms.errors||(gina.forms.errors={}),
|
|
284
|
-
c={id:g,errors:n},window.ginaToolbar.update('forms',c))):B&&H&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&(gina.forms.errors||(gina.forms.errors={}),c={id:g,errors:{}},H&&window.ginaToolbar.update('forms',c));if(gina&&H&&B&&l.$forms[g].isSubmitting&&/^true$/i.test(l.$forms[g].isSubmitting)&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&a)try{window.ginaToolbar.update('data-xhr',a)}catch(ea){throw ea;}},Y=function(c){var b=null;'undefined'==typeof c&&'undefined'!=typeof this.id&&
|
|
285
|
-
(c=this.id);/^string$/i.test(typeof c)?(b=c.replace(/#/,''),b=document.getElementById(b)):c instanceof HTMLFormElement?b=c:/^object$/i.test(typeof c)&&(b=c.target);if(!b)throw Error('[ FormValidator::resetErrorsDisplay([ formId | <form> ]) ] `'+c+'` not found');b.dataset.ginaFormIsResetting=!0;N(b,{});return b},ia=function(c){if('undefined'==typeof c){var b='undefined'!=typeof this.target?this.target.getAttribute('id'):this.getAttribute('id');c=l.$forms[b]}else if('string'==typeof c){b=c.replace(/#/,
|
|
286
|
-
'');if('undefined'==typeof l.$forms[b])throw Error('[ FormValidator::resetErrorsDisplay([formId]) ] `'+c+'` not found');c=l.$forms[b]}if(c.fieldsSet){c.isBeingReseted=!0;for(var a in c.fieldsSet){b=document.getElementById(a);var e=b.tagName.toLowerCase();var n=b.tagName;/textarea/i.test(n)?(n=c.fieldsSet[a].defaultValue,b.value=n,triggerEvent(gina,b,'change')):'input'==e?(n=c.fieldsSet[a].defaultValue,/$(on|true|false)$/i.test(n)&&(n=/$(on|true)$/i.test(n)?!0:!1),/^(checkbox|radio)$/i.test(b.type)?
|
|
287
|
-
b.checked=c.fieldsSet[a].defaultChecked:/^(checkbox|radio)$/i.test(b.type)||(b.value=n),triggerEvent(gina,b,'change')):'select'==e&&(n=c.fieldsSet[a].selectedIndex||0,b.selectedIndex=n,b.dataset.value=b.options[b.selectedIndex].value,triggerEvent(gina,b,'change'))}delete c.isBeingReseted}return c},ba=function(){var c=null,b=null;'undefined'!=typeof this.getAttribute?(c=this.getAttribute('id'),b=this):'undefined'!=typeof this.target&&null!=this.target&&'undefined'!=typeof this.target.getAttribute&&
|
|
288
|
-
(c=this.target.getAttribute('id'),b=this.target);if('undefined'==typeof l.$forms[c])throw Error('[ FormValidator::submit() ] not `$form` binded. Use `FormValidator::getFormById(id)` or `FormValidator::validateFormById(id)` first ');triggerEvent(gina,b,'submit');return this},E=function(c,b){var a=this.target,e=a.getAttribute('id'),n=l.$forms[e]||this,q=document.getElementById(n.submitTrigger)||null,g=null,G=null,A=null,ca=null;b='undefined'!=typeof b?D(b,p):p;if(!(/^true$/i.test(b.withRateLimit)&&
|
|
289
|
-
'undefined'!=typeof n.isSending&&/^true$/i.test(n.isSending)||/^true$/i.test(b.withRateLimit)&&'undefined'!=typeof n.sent&&/^true$/i.test(n.sent))){l.$forms[e].isSending=!0;'undefined'!=typeof n.id&&(b.headers['X-Gina-Form-Id']=n.id,'undefined'!=typeof gina.forms.rules&&0<n.rules.count()&&'undefined'!=typeof n.rules[n.id]&&(b.headers['X-Gina-Form-Rule']=n.id+'@'+gina.config.bundle));'undefined'!=typeof n.target.dataset.ginaFormRule&&(b.headers['X-Gina-Form-Rule']=n.target.dataset.ginaFormRule+'@'+
|
|
290
|
-
gina.config.bundle);w()&&($activePopin=gina.popin.getActivePopin(),$activePopin.isOpen&&('undefined'!=typeof $activePopin.id&&(b.headers['X-Gina-Popin-Id']=$activePopin.id),'undefined'!=typeof $activePopin.name&&(b.headers['X-Gina-Popin-Name']=$activePopin.name)));(ca=a.getAttribute('data-gina-form-event-on-submit-success')||a.getAttribute('data-gina-form-event-on-submit-error')?!0:!1)&&U(n);var la=a.getAttribute('action')||b.url,ha=a.getAttribute('method')||b.method;ha=ha.toUpperCase();b.method=
|
|
291
|
-
ha;b.url=la;u||=setupXhr(b);la=a.getAttribute('enctype')||b.headers['Content-Type'];if(b.withCredentials){if('withCredentials'in u)b.isSynchrone?u.open(b.method,b.url,b.isSynchrone):u.open(b.method,b.url);else if('undefined'!=typeof XDomainRequest)u=new XDomainRequest,u.open(b.method,b.url);else{u=null;g='CORS not supported: the server is missing the header `"Access-Control-Allow-Credentials": true` ';triggerEvent(gina,a,'error.'+e,g);return}u.responseType='undefined'!=typeof b.responseType?b.responseType:
|
|
292
|
-
'';u.withCredentials=!0}else b.isSynchrone?u.open(b.method,b.url,b.isSynchrone):u.open(b.method,b.url);for(var va in b.headers)'Content-Type'==va&&'undefined'!=typeof la&&null!=la&&''!=la||u.setRequestHeader(va,b.headers[va]);if(u){/^(1|3)$/.test(u.readyState)&&(n.target.setAttribute('data-gina-form-loading',!0),q&&(/^A$/i.test(q.tagName)?q.setAttribute('aria-disabled',!0):q.setAttribute('disabled',!0)));u.onreadystatechange=function(ea){n.isSubmitting=!1;n.isSending=!1;/^(1|3)$/.test(u.readyState)&&
|
|
293
|
-
(n.target.setAttribute('data-gina-form-loading',!0),q&&(/^A$/i.test(q.tagName)?q.setAttribute('aria-disabled',!0):q.setAttribute('disabled',!0)));ea=/Google Inc/i.test(navigator.vendor)?50:0;2==u.readyState&&(A=/^attachment;/.test(u.getResponseHeader('Content-Disposition'))?!0:!1,!u.responseType&&A&&(u.responseType='blob'));if(4==u.readyState){n.sent=!1;q&&(/^A$/i.test(q.tagName)?q.removeAttribute('aria-disabled',!0):q.removeAttribute('disabled',!0));n.target.removeAttribute('data-gina-form-loading');
|
|
294
|
-
var ka=null,wa=null,Ca=u.getResponseHeader('Content-Type');if(/^2/.test(u.status)){try{if(/blob/.test(u.responseType)||A){if('undefined'==typeof Ca||null==Ca)Ca='application/octet-stream';wa=new Blob([this.response],{type:Ca});var Oa=document.createElement('a');Oa.style='display: none';document.body.appendChild(Oa);var Qa=window.URL.createObjectURL(wa);Oa.href=Qa;var Ya=u.getResponseHeader('Content-Disposition');Oa.download=Ya.match('=(.*)')[0].substring(1);Oa.click();window.URL.revokeObjectURL(Qa);
|
|
295
|
-
g={status:u.status,statusText:u.statusText,responseType:wa.type,type:wa.type,size:wa.size}}else g=u.responseText;/\/json/.test(Ca)&&(g=JSON.parse(u.responseText),'undefined'==typeof g.status&&(g.status=u.status),gina&&B&&typeof window.ginaToolbar&&'undefined'!=typeof g&&window.ginaToolbar.update('data-xhr',g));if(/\/html/.test(Ca)&&(g={contentType:Ca,content:u.responseText},'undefined'==typeof g.status&&(g.status=u.status),'undefined'!=typeof gina.popin&&gina.hasPopinHandler&&(ka=gina.popin.getActivePopin()))){G=
|
|
296
|
-
{};try{G=(new DOMParser).parseFromString(g.content,'text/html').getElementById('gina-without-layout-xhr-data'),G=JSON.parse(decodeURIComponent(G.value)),XHRView=(new DOMParser).parseFromString(g.content,'text/html').getElementById('gina-without-layout-xhr-view'),XHRView=JSON.parse(decodeURIComponent(XHRView.value)),gina&&B&&typeof window.ginaToolbar&&'undefined'!=typeof G&&window.ginaToolbar.update('data-xhr',G),gina&&B&&typeof window.ginaToolbar&&'undefined'!=typeof XHRView&&window.ginaToolbar.update('view-xhr',
|
|
297
|
-
XHRView)}catch(M){throw M;}ka.loadContent(g.content);g=G;triggerEvent(gina,a,'success.'+e,g);return}G=n.eventData.success=g;if(gina&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&G)try{B&&'undefined'!=typeof G&&!/\/html|\/json/.test(Ca)&&window.ginaToolbar.update('data-xhr',G)}catch(M){throw M;}/^gina\-upload/i.test(e)&&P(gina,a,'success',e,g);var La=!1;'undefined'!=typeof g.isXhrRedirect&&/^true$/i.test(g.isXhrRedirect)&&(La=!0);if('undefined'!=typeof gina.popin&&gina.hasPopinHandler&&
|
|
298
|
-
'undefined'!=typeof g.popin||'undefined'!=typeof gina.popin&&gina.hasPopinHandler&&'undefined'!=typeof g.location&&La){ka=gina.popin.getActivePopin();if(!ka&&'undefined'!=typeof g.popin){if('undefined'!=typeof g.popin&&'undefined'==typeof g.popin.name)throw Error('To get a `$popin` instance, you need at list a `popin.name`.');ka=gina.popin.getPopinByName(g.popin.name);if(!ka)throw Error('Popin with name: `'+g.popin.name+'` not found.');}if('undefined'!=typeof g.popin&&'undefined'!=typeof g.popin.close){ka.isRedirecting=
|
|
299
|
-
!1;ka.close();var ya=g.popin.reload?g.popin.reload:!1;g.popin.location||g.popin.url||(delete g.popin,ya&&(g.popin={reload:ya}))}if('undefined'!=typeof g.popin&&'undefined'!=typeof g.popin.location||'undefined'!=typeof g.popin&&'undefined'!=typeof g.popin.url||'undefined'!=typeof g.location&&La){La=null;ka&&(La=ka.name,ka.isRedirecting=!0);'undefined'!=typeof g.popin&&'undefined'!=typeof g.popin.target&&(g.popin.target='_'+g.popin.target);var Ea=g.location||g.popin.location||g.popin.url;if('undefined'!=
|
|
300
|
-
typeof g.popin&&'undefined'!=typeof g.popin.name&&La!=g.popin.name){ka&&ka.isOpen&&ka.close();La=g.popin.name;ka=gina.popin.getPopinByName(La);if(!ka)throw Error('Popin with name `'+La+'` not found !');console.debug('Validator::Popin now redirecting [1-c]');ka.load(ka.name,Ea,ka.options)}else ka&&(console.debug('Validator::Popin now redirecting [1-d]'),ka&&ka.isOpen&&ka.close(),ka.load(ka.name,Ea,ka.options));if(ka&&!ka.isOpen)return setTimeout(function(M){M.isOpen||M.open()},50,ka)}}triggerEvent(gina,
|
|
301
|
-
a,'success.'+e,g);ca&&triggerEvent(gina,a,'success.'+e+'.hform',g)}catch(M){g={status:422,error:M.message,stack:M.stack};G=n.eventData.error=g;if(gina&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&G)try{B&&'undefined'!=typeof G&&window.ginaToolbar.update('data-xhr',G)}catch(W){throw W;}/^gina\-upload/i.test(e)&&P(gina,a,'error',e,g);triggerEvent(gina,a,'error.'+e,g);ca&&triggerEvent(gina,a,'error.'+e+'.hform',g)}if('undefined'!=typeof g&&'undefined'!=typeof g.location)return window.location.hash=
|
|
302
|
-
'',g.location=/^http/.test(g.location)||/^\//.test(g.location)?g.location:location.protocol+'//'+g.location,g.location.replace(/^http(.*):\d+/,'$1').replace(/^:\/\//,'').split(/\//g)[0]==gina.config.hostname&&gina.config.hostname==window.location.host&&(g.location=location.protocol+g.location.replace(/^http(.*):\d+/,'$1').replace(/^:/,'')),setTimeout(()=>{window.location.href=g.location},ea)}else if(0!=u.status)if(g={status:u.status},/blob/.test(u.responseType)){wa=new Blob([this.response],{type:'text/plain'});
|
|
303
|
-
var T=new FileReader,J='';T.addEventListener('loadend',M=>{/string/i.test(typeof M.srcElement.result)?J+=M.srcElement.result:'object'==typeof M.srcElement.result?g=D(g,M.srcElement.result):g.message+=M.srcElement.result;if(/2/.test(T.readyState)){if(/^(\{|\[)/.test(J))try{g=D(g,JSON.parse(J))}catch(W){g=D(g,W)}g.message||delete g.message;G=n.eventData.error=g;if(gina&&B&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&G)try{window.ginaToolbar.update('data-xhr',G)}catch(W){throw W;}/^gina\-upload/i.test(e)&&
|
|
304
|
-
P(gina,a,'error',e,g);triggerEvent(gina,a,'error.'+e,g);ca&&triggerEvent(gina,a,'error.'+e+'.hform',g)}});T.readAsText(wa)}else{if(/^(\{|\[)/.test(u.responseText))try{g=D(JSON.parse(u.responseText),g)}catch(M){g=D(M,g)}else'object'==typeof u.responseText?g=D(u.responseText,g):g.message=u.responseText;if('undefined'!=typeof g&&'undefined'!=typeof g.error&&g.fields&&'object'==typeof g.fields){Ea='undefined'!=typeof g.message?g.message:null;ea={};for(La in g.fields)ka={},ka[La]={},ka[La].isApiError=
|
|
305
|
-
g.fields[La],Ea&&!ka[La].isApiError&&(ka[La].isApiError=g.error),ea[La]=ka[La],N(n.target,ka,c,La);g.fields=ea}G=n.eventData.error=g;if(gina&&B&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&G)try{window.ginaToolbar.update('data-xhr',G)}catch(M){throw M;}/^gina\-upload/i.test(e)&&P(gina,a,'error',e,g);triggerEvent(gina,a,'error.'+e,g);ca&&triggerEvent(gina,a,'error.'+e+'.hform',g)}}};u.onprogress=function(ea){var ka='0';ea.lengthComputable&&(ka=ea.loaded/ea.total,ka=parseInt(100*ka));
|
|
306
|
-
ea={status:100,progress:ka};n.eventData.onprogress=ea;triggerEvent(gina,a,'progress.'+e,ea)};u.ontimeout=function(ea){g={status:408,error:'Request Timeout'};n.eventData.ontimeout=g;n.target.setAttribute('data-gina-form-loading',!1);/^gina\-upload/i.test(e)&&P(gina,a,'error',e,g);triggerEvent(gina,a,'error.'+e,g);ca&&triggerEvent(gina,a,'error.'+e+'.hform',g)};c||(c=event.detail.data);if(c){b=!1;if('object'==typeof c){va=[];ha=0;var ma={};try{if(c instanceof FormData){var x=event.currentTarget.getAttribute('data-gina-form-upload-group')||
|
|
307
|
-
'untagged',V,da;for([V,da]of c.entries())da instanceof File?(b||=!0,va[ha]={key:V,group:x,file:da,bin:''},++ha):ma[V]=da}else c=JSON.stringify(c);if(b&&0<va.length){var S='--ginaWKBoundary'+X.v4().replace(/\-/g,'');return qa(va,S,'',0,function(ea,ka,wa){if(ea)/^gina\-upload/i.test(e)&&P(gina,a,'error',e,ea),triggerEvent(gina,a,'error.'+e,ea),ca&&triggerEvent(gina,a,'error.'+e+'.hform',ea);else return wa&&(u.setRequestHeader('Content-Type','multipart/form-data; boundary='+S),u.send(ka),n.sent=!0,B&&
|
|
308
|
-
H&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&(gina.forms.sent||(gina.forms.sent={}),window.ginaToolbar.update('forms',{id:e,sent:ka}))),!1})}'undefined'!=typeof ma&&0<ma.count()&&(c=JSON.stringify(ma))}catch(ea){/^gina\-upload/i.test(e)&&P(gina,a,'error',e,ea),triggerEvent(gina,a,'error.'+e,ea),ca&&triggerEvent(gina,a,'error.'+e+'.hform',ea)}}b||('undefined'!=typeof la&&null!=la&&''!=la&&u.setRequestHeader('Content-Type',la),u.send(c))}else'undefined'!=typeof la&&null!=la&&''!=la&&
|
|
309
|
-
u.setRequestHeader('Content-Type',la),u.send();n.sent=!0;B&&H&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&(gina.forms.sent||(gina.forms.sent={}),x={id:e,sent:'string'==typeof c?JSON.parse(c):c},window.ginaToolbar.update('forms',x))}}},P=function(c,b,a,e,n){c=b.uploadProperties||null;if(!c)throw Error('No uploadProperties found !!');b=document.getElementById(c.uploadTriggerId);e=null;var q=n.files||[],g=null;c.hasPreviewContainer&&(e=document.getElementById(c.previewContainer.id))&&
|
|
310
|
-
(e.innerHTML='');c.errorField&&(g=document.getElementById(c.errorField));g&&(g.style.display='none');if(g&&'success'!=a){var G=n.message||n.error;g.innerHTML='<p>'+G+'</p>';fadeIn(g)}else if(g||'success'==a)for(a=0,n=q.length;a<n;++a){var A=e.id.replace(/\-preview/,'-'+a+'-reset-trigger');G=!1;g=document.getElementById(A);var ca=['reset','js-upload-reset'];g?(/a/i.test(g.tagName)&&(g.href='#'),g.innerHTML&&''!=g.innerHTML||(g.innerHTML=b.getAttribute('data-gina-form-upload-reset-label')||'Reset'),
|
|
311
|
-
'undefined'==typeof g.className&&(g.className=''),A=D(g.className.split(/\s+/g),ca),g.className=A.join(' ')):(G=!0,g=document.createElement('A'),g.href='#',g.innerHTML=b.getAttribute('data-gina-form-upload-reset-label')||'Reset',g.className=ca.join(' '),g.id=A);g.style.display='none';if('undefined'==typeof q[a].preview&&c.hasPreviewContainer&&/^image/.test(q[a].mime)&&''!=q[a].location){A=document.createElement('IMG');A.src=q[a].tmpUri;A.style.display='none';A.setAttribute('data-upload-original-filename',
|
|
312
|
-
q[a].originalFilename);A.setAttribute('data-upload-reset-link-id',g.id);ca=e.getAttribute('data-preview-max-width')||null;if(A.width&&ca&&A.width>ca){var la=A.width/ca;A.width=ca;A.height/=la}else!A.width&&ca&&(A.width=ca);/ul/i.test(c.previewContainer.tagName)?(ca=document.createElement('LI'),ca.className='item',ca.appendChild(A),e.appendChild(ca)):e.appendChild(A);fadeIn(A)}A=c.uploadFields[a];for(var ha in A)if('name'==ha&&''!=A[ha].value||!q[a][ha]||'preview'==ha&&'undefined'==typeof q[a][ha]||
|
|
313
|
-
/(height|width)/i.test(ha)&&!/^image/.test(q[a].mime))/(preview|height|width)/i.test(ha)&&(ca=document.getElementById(A[ha].id))&&ca.parentNode.removeChild(ca);else if(A[ha].value=q[a][ha],'preview'==ha)for(var va in q[a][ha])if('undefined'!=typeof q[a][ha][va]&&'undefined'!=typeof A[ha][va]&&(A[ha][va].value=q[a][ha][va]),'tmpUri'==va&&c.hasPreviewContainer){la=document.createElement('IMG');la.src=q[a][ha].tmpUri;la.style.display='none';la.setAttribute('data-upload-original-filename',q[a].originalFilename);
|
|
314
|
-
la.setAttribute('data-upload-preview-original-filename',q[a][ha].originalFilename);la.setAttribute('data-upload-reset-link-id',g.id);if(ca=e.getAttribute('data-preview-max-width')||null)la.width=ca;/ul/i.test(c.previewContainer.tagName)?(ca=document.createElement('LI'),ca.className='item',ca.appendChild(la),e.appendChild(ca)):e.appendChild(la);fadeIn(la)}c.hasPreviewContainer&&(/ul/i.test(c.previewContainer.tagName)?(ca=document.createElement('LI'),ca.className='item',G&&ca.appendChild(g),e.appendChild(ca)):
|
|
315
|
-
G&&e.appendChild(g));Pa('reset',b,a);fadeIn(g)}else throw Error(G);},K=function(c,b){console.debug(b+' input files');var a=/reset/i.test(b)?!0:!1,e=null,n=null,q=document.getElementById(c.id+'-preview').childNodes,g=null,G=c.customFiles,A=[];for(let ca=0,la=q.length;ca<la;ca++)if(/img/i.test(q[ca].tagName)){a?(e=q[ca].getAttribute('data-upload-original-filename'),A.push(e),(n=q[ca].getAttribute('data-upload-preview-original-filename'))&&A.push(n)):(e=q[ca].src.substring(q[ca].src.lastIndexOf('/')+
|
|
316
|
-
1),A.push(e));for(let ha=0,va=G.length;ha<va;ha++)if(G[ha].name==e){g=a?document.getElementById(q[ca].getAttribute('data-upload-'+b+'-link-id')):document.getElementById(G[ha].deleteLinkId);g.style.display='none';q[ca].style.display='none';G.splice(ha,1);c.customFiles=G;a&&(c.value=G.join(', C:\\fakepath\\'));e=new RegExp('^'+(c.name+'['+ha+']').replace(/\-|\[|\]|\./g,'\\$&'));for(let x=0,V=c.form.length;x<V;x++)if(n=c.form[x].dataset.ginaFormUploadIsLocked||!1,e.test(c.form[x].name)&&!/true/i.test(n)&&
|
|
317
|
-
(c.form[x].remove(),V--,x--,gina&&B&&H&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar))try{window.ginaToolbar.update('data-xhr',{files:G})}catch(da){throw da;}n=c.getAttribute('data-gina-form-upload-'+b+'-action');if(!n||'undefined'==typeof n||''==n||/404/.test(n))throw Error('input file `'+c.id+'` error: `data-gina-form-upload-'+b+'-action` is required. You need to provide a valide url.');(e=c.getAttribute('data-gina-form-upload-'+b+'-method'))&&'undefined'!=typeof e&&''!=e?e=e.toUpperCase():
|
|
318
|
-
a?e='POST':(e=1<A.length?'POST':'DELETE',console.warn('`data-gina-form-upload-'+b+'-method` was not defined. Switching to `'+e+'` by default.'));let ma=c.getAttribute('data-gina-form-upload-'+b+'-is-synchrone');if(/null/i.test(ma)||'undefined'==typeof e||''==e)ma=!0;n=setupXhr({url:n,method:e,isSynchrone:ma,headers:{'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8','X-Requested-With':'XMLHttpRequest'}});/GET|DELETE/i.test(e)?n.send():n.send(JSON.stringify({files:A}));if(/none/i.test(window.getComputedStyle(c).display)){if(/none/i.test(c.parentElement.style.display)){c.parentElement.style.display=
|
|
319
|
-
'block';return}c.style.display='block'}removeListener(gina,$uploadResetTrigger,'click',function(){g.remove();q[ca].remove()});la--;ca--;break}}},qa=function(c,b,a,e,n){var q=new FileReader;q.addEventListener('load',function(g){g.preventDefault();try{var G=this.result,A=void 0;g='';var ca=null;'undefined'==typeof A&&(A=8);var la=A/8;switch(A){case 8:ca=new Uint8Array(G);break;case 16:ca=new Uint16Array(G);break;case 32:ca=new Uint32Array(G);break;default:ca=new Uint8Array(G)}var ha=ca.length,va=Math.pow(2,
|
|
320
|
-
8)+la;G=0;for(la=A=null;G<ha;G+=va)A=Math.min(va,ha-G),la=ca.subarray(G,G+A),g+=String.fromCharCode.apply(null,la);c[this.index].bin+=g;c[this.index].file.type||(c[this.index].file.type='application/octet-stream')}catch(ma){return n(ma,null,!0)}a+='--'+b+'\r\n';a+='Content-Disposition: form-data; name="'+c[this.index].key+'"; group="'+c[this.index].group+'"; filename="'+c[this.index].file.name+'"\r\nContent-Type: '+c[this.index].file.type+'\r\nContent-Length: '+c[this.index].bin.length+'\r\n\r\n';
|
|
321
|
-
a+=c[this.index].bin+'\r\n';++this.index;this.index==c.length?(a+='--'+b+'--',n(!1,a,!0)):qa(c,b,a,this.index,n)},!1);q.index=e;c[e].bin='';q.readAsArrayBuffer(c[e].file)},U=function(c){var b=c.target.getAttribute('data-gina-form-event-on-submit-success')||null;if(null!=b)if(/\((.*)\)/.test(b))eval(b);else c.on('success.hform',window[b]);b=c.target.getAttribute('data-gina-form-event-on-submit-error')||null;if(null!=b)if(/\((.*)\)/.test(b))eval(b);else c.on('error.hform',window[b])},fa=function(c){var b=
|
|
322
|
-
null,a=c;if(!l.$forms)throw Error('`$forms` collection not found');if('undefined'==typeof a)if('undefined'!=typeof this.id&&''!=this.id&&null!=this.id)a=this.id;else throw Error('[ FormValidator::destroy(formId) ] `formId` is missing');if('string'==typeof a)a=a.replace(/#/,'');else{if('object'!=typeof a||Array.isArray(a))throw Error('[ FormValidator::destroy(formId) ] `formId` should be a `string`');c=a.form;a=c.getAttribute('id')||'form.'+X.v4();c.setAttribute('id',a)}'undefined'!=typeof l.$forms[a]?
|
|
323
|
-
b=l.$forms[a]:'undefined'!=typeof this.binded&&(b=this);if(b)addListener(gina,b.target,'destroy.'+a,function(e){cancelEvent(e);delete l.$forms[a];removeListener(gina,e.currentTarget,e.type);removeListener(gina,e.currentTarget,'destroy')}),b=Ra(b),triggerEvent(gina,b.target,'destroy.'+a);else throw Error('[ FormValidator::destroy(formId) ] `'+a+'` not found');},aa=function(c){c='undefined'!=typeof c?c:l.rules;for(let e in c){var b=Object.getOwnPropertyNames(c[e]),a=0;let n=b.length,q=!1,g=null;for(;a<
|
|
324
|
-
n;){if(/^_case_/.test(b[a])){q=!0;g=b[a];break}a++}q||'object'!=typeof c[e]||aa(c[e]);if(g&&Array.isArray(c[e][g].conditions)&&0<c[e][g].conditions.length)for(b=0,a=c[e][g].conditions.length;b<a;)'undefined'!=typeof c[e][g].conditions[b].rules&&0==c[e][g].conditions[b].rules.count()&&(c[e][g].conditions.splice(b,1),a--,b--),b++}},oa=function(c){var b=JSON.stringify(c),a=b.match(/("@import\s+[-_a-z A-Z 0-9/.]+")/g)||[],e=[];for(let G=0,A=a.length;G<A;G++)0>e.indexOf(a[G])&&e.push(a[G]);a=e;e=b.match(/("_merging(.*))(\s+:|:)(.*)(",|")/g);
|
|
325
|
-
l.rules||(l.rules={});if(a&&0<a.length){c={};for(let G=0,A=a.length;G<A;++G){var n=a[G].replace(/(@import\s+|"|')/g,'');var q=n.replace(/(@import\s+|"|')/g,'').split(/\s/g);for(let ca=0,la=q.length;ca<la;++ca){var g=q[ca].replace(/\//g,'.').replace(/\-/g,'.');'undefined'!=typeof l.rules[g]?(g=JSON.stringify(l.rules[g]),g=JSON.parse(g),g._comment='undefined'!=typeof g._comment?g._comment+'\n':'',g._comment+='Imported from `'+n+'`',g=JSON.stringify(g),b=b.replace(new RegExp(a[G],'g'),g),l.rules=JSON.parse(JSON.stringify(l.rules).replace(new RegExp(a[G],
|
|
326
|
-
'g'),'{}'))):console.warn('[formValidator:rules] <@import error> on `'+a[G]+'`: rule `'+q[ca]+'` not found. Ignoring.')}q=new RegExp(a[G]);if(n=e&&q.test(e.join())?!0:!1)for(let ca=0,la=e.length;ca<la;ca++)if(q.test(e[ca])){n=JSON.stringify(c);n=n.substring(1,n.length-1);ca<la-1&&(n+=',');try{b=b.replace(new RegExp(e[ca],'g'),n),l.rules=JSON.parse(JSON.stringify(l.rules).replace(new RegExp(e[ca],'g'),'{}'))}catch(ha){throw ha;}}c={}}c=JSON.parse(b);ja(c,'');try{aa()}catch(G){console.error(G.stack)}}return c},
|
|
327
|
-
xa=function(c){gina.hasValidator?(l=D(l,gina.validator),l.on('init',function(b){l.isReady=!0;triggerEvent(gina,l.target,'ready.'+l.id,l)})):(l.target=document,l.setOptions=k,l.getFormById=m,l.validateFormById=Q,l.resetErrorsDisplay=Y,l.resetFields=ia,l.handleErrorsDisplay=N,l.send=E,l.on('init',function(b){if('undefined'!=typeof c&&c.count())try{ja(c,''),c=oa(c),gina.forms.rules='undefined'!=typeof gina.forms.rules&&gina.forms.rules?D(gina.forms.rules,c,!0):c,l.rules=D(l.rules,JSON.clone(gina.forms.rules),
|
|
328
|
-
!0)}catch(G){throw G;}na.count()||(na=JSON.clone(l.rules));Z.setOptions=k;Z.getFormById=m;Z.validateFormById=Q;Z.resetErrorsDisplay=Y;Z.resetFields=ia;Z.handleErrorsDisplay=N;Z.submit=ba;Z.send=E;Z.unbind=Ra;Z.bind=Ma;Z.reBind=Xa;Z.destroy=fa;b=0;for(var a=document.getElementsByTagName('form'),e=0,n=a.length;e<n;++e){if(a[e].getAttribute){var q=a[e].getAttribute('id')||'form.'+X.v4();q!==a[e].getAttribute('id')&&a[e].setAttribute('id',q)}else q='form.'+X.v4(),a[e].setAttribute('id',q);Z.id=q;Z.target=
|
|
329
|
-
a[e];l.$forms[q]=D({},Z);var g=a[e].getAttribute('data-gina-form-rule');if(g){g=g.replace(/\-|\//g,'.');'undefined'!=typeof c&&(l.$forms[q].rules[g]=l.rules[g]=na[g]=D(JSON.clone(eval('gina.forms.rules.'+g)),l.rules[g]));if('undefined'==typeof na[g])throw Error('['+q+'] no rule found with key: `'+g+'`. Please check if json is not malformed @ /forms/rules/'+g.replace(/\./g,'/')+'.json');g=l.rules[g]}'string'==typeof q&&'undefined'!=typeof na[q.replace(/\-/g,'.')]||'object'==typeof g?(q=l.$forms[q].target,
|
|
330
|
-
g?Ma(q,g):Ma(q),++b):('object'==typeof a[e].id?(delete l.$forms[a[e].id],q=a[e].attributes.getNamedItem('id').nodeValue||'form.'+X.v4(),a[e].setAttribute('id',q),a[e].id=q,Z.target=a[e],l.$forms[q]=D({},Z),q=l.$forms[q].target):q=l.$forms[a[e].id].target,g?Ma(q,g):Ma(q))}if(window.XMLHttpRequest)u=new XMLHttpRequest;else if(window.ActiveXObject)try{u=new ActiveXObject('Msxml2.XMLHTTP')}catch(G){try{u=new ActiveXObject('Microsoft.XMLHTTP')}catch(A){}}l.isReady=!0;gina.hasValidator=!0;gina.validator=
|
|
331
|
-
l;triggerEvent(gina,l.target,'ready.'+l.id,l)}));l.initialized=!0;return l},ja=function(c,b){var a;for(a in c)if('object'==typeof c[a]&&'undefined'==typeof l.rules[b+a]){var e=a;/\[|\]/.test(a)&&(e=a.replace(/\[/g,'.').replace(/\]/g,''));l.rules[b+e]=c[a];ja(c[a],b+e+'.')}},Ba=function(c){if('undefined'!=typeof na[c])return na[c];var b=null;if('undefined'==typeof l.rules[c]){if(ja(na,''),na=oa(na),b=na[c],!b)return{}}else b=l.rules[c];b=JSON.clone(b);var a=new RegExp('^'+c),e=new RegExp('^'+c+'.'),
|
|
332
|
-
n=null,q=function(G,A,ca,la,ha,va,ma){if(A.length){var x=Object.getOwnPropertyNames(G)[0],V=A[0];V=''==ha?ha+=V:ha+'['+V+']';1==A.length&&(G[x]=D(G[x],ca,!0));A.splice(0,1);V==x?q(G[x],A,ca,la,V,va,ma):'undefined'!=typeof G[x]?q(G[x],A,ca,la,V,va,ma):q(G,A,ca,la,ha,va,ma)}},g;for(g in l.rules)g!=c&&a.test(g)&&(n=g.replace(e,''),/\./.test(n)&&(n=n.split(/\./g),q(b,n,l.rules[g],b,'',0,b.count()-1)));return na[c]=b},ra=formatDataFromString,Ka=function(c){var b=l.$forms[c.form.getAttribute('id')],a=/^true$/i.test(c.disabled)?
|
|
333
|
-
!0:!1;a&&'undefined'!=typeof b.rule&&'undefined'!=typeof b.rule[c.name]&&'undefined'!=typeof b.rule[c.name].exclude&&/^false$/i.test(b.rule[c.name].exclude)&&(a=!1);if(/^(radio|text|hidden|password|number|date|email)$/i.test(c.type)&&!a){var e=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,'value'),n=e.set;e.set=function(q){Object.defineProperty(this,'value',{set:n});var g='change.'+this.id;q===this.value&&q===this.defaultValue||q===this.value||(this.value=q,console.debug('Value set: '+
|
|
334
|
-
q),'undefined'!=typeof gina.events[g]&&(console.debug('trigger event on: ',this.name,g),triggerEvent(gina,this,g,q)));Object.defineProperty(this,'value',e)};Object.defineProperty(c,'value',e)}},pa=function(c,b,a,e){'undefined'==typeof e&&(e=!1);var n=c.rules,q=l.$forms[b.form.getAttribute('id')],g=/^true$/i.test(b.disabled)?!0:!1;g&&'undefined'!=typeof q.rule&&'undefined'!=typeof q.rule[b.name]&&'undefined'!=typeof q.rule[b.name].exclude&&/^false$/i.test(q.rule[b.name].exclude)&&(g=!1);if(/^(radio|checkbox|text|hidden|password|number|date|email)$/i.test(b.type)&&
|
|
335
|
-
!g||e&&!g){e=b.name;q=n[e]||null;if(!q&&(db(n,b),'undefined'==typeof n[e]))return;if(c.target.dataset.ginaFormLiveCheckEnabled&&q&&(e=[],q=null,g=0,/^(radio|checkbox)$/i.test(b.type)?q=/^(radio|checkbox)$/i.test(b.type)?'changed.'+b.id:'change.'+b.id:(addEventListener(gina,b,'focusout.'+b.id,function(A){A.preventDefault();clearTimeout(a)}),q='change.'+b.id,'undefined'==typeof gina.events[q]&&(e[g]=q,++g),q='keyup.'+b.id,'undefined'==typeof gina.events[q]&&(e[g]=q,++g),q='focusin.'+b.id,'undefined'==
|
|
336
|
-
typeof gina.events[q]&&(e[g]=q,++g),q='focusout.'+b.id),'undefined'==typeof gina.events[q]&&(e[g]=q,++g),0<e.length)){var G=!1;addListener(gina,b,e,function(A){A.preventDefault();clearTimeout(a);if(!G&&/^changed\./i.test(A.type)||!G&&/^(radio|checkbox)$/i.test(A.target.type))G=!0;else if(G&&/^changed\./i.test(A.type)||G&&/^(radio|checkbox)$/i.test(A.target.type))return!1;if('undefined'!=typeof l.$forms[A.target.form.getAttribute('id')].isSubmitting&&/true/i.test(l.$forms[A.target.form.getAttribute('id')].isSubmitting))return!1;
|
|
337
|
-
var ca=function(){/^(password)$/i.test(A.target.type)||console.debug('processing: '+A.target.name+'/'+A.target.id);if(!/^(radio|checkbox)$/i.test(A.target.type)&&A.target.value===A.target.defaultValue&&''!=A.target.value){var la=l.$forms[A.target.form.getAttribute('id')].errors;if(la&&0!=la.count())N(A.target.form,la,null,A.target.name);else return N(A.target.form,{},null,A.target.name),cancelEvent(A)}la={};var ha={};la[A.target.name]=A.target.value;ha[A.target.name]=A.target;l.$forms[A.target.form.getAttribute('id')].isValidating=
|
|
338
|
-
!0;R(A.target,la,ha,c.rules,function(va){va.isValid()?N(A.target.form,{},va.data,A.target.name):N(A.target.form,va.error,va.data,A.target.name);var ma=A.target.form,x=null,V=null,da=null;da=$a(ma,n);x=da.fields;V=da.$fields;var S=ma.getAttribute('id');da=l.$forms[S].rules;l.$forms[S].isValidating=!0;R(ma,x,V,da,function(ea){l.$forms[S].isValidating=!1;console.debug('['+S+'] onSilentGlobalLiveValidation: '+ea.isValid(),ea,x);var ka=ea.isValid();B&&H&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&
|
|
339
|
-
(gina.forms.errors||(gina.forms.errors={}),window.ginaToolbar.update('forms',{id:S,errors:ea.error||{}}));if(!ka&&ea.error){l.$forms[b.form.getAttribute('id')].errors=D(va.error,ea.error);for(let wa in ea.error)z(V[wa]),N(ma,ea.error,ea.data,wa)}else l.$forms[S].errors&&!l.$forms[S].errors.count()&&(l.$forms[S].errors={},console.debug('resetting field: '+b.name),y[S]={},N(ma,{},null,b.name));Va(ma,ka);G=!1})})};if(/^changed\./i.test(A.type)||/^change\./i.test(A.type)&&'radio'==A.target.type)return function(la,
|
|
340
|
-
ha){if(!(0<ha))return++ha,setTimeout(()=>{console.debug(' changed .... '+b.id);ca()},0)}(G,0);/^focusin\./i.test(A.type)?/\-error/.test(b.parentNode.className)&&(console.debug('#1 you just focusin ....'+b.id,b.value,l.$forms[b.form.getAttribute('id')].isValidating),z(b)):/^focusout\./i.test(A.type)?/\-warning/.test(b.parentNode.className)&&(console.debug('#1 you just focusout ....'+b.id,b.value),l.$forms[b.form.getAttribute('id')].isValidating=!1,z(b),N(b.form,l.$forms[b.form.getAttribute('id')].errors,
|
|
341
|
-
null,b.name)):/^keyup\./i.test(A.type)?(b.ginaFormValidatorTestedValue=b.value,a=setTimeout(function(){-1<['91','17','16'].indexOf(''+A.keyCode)&&0==F.count()||(console.debug('[A]['+F.count()+'] keyup ('+A.keyCode+') .... '+b.id,b.value,' VS ',b.ginaFormValidatorTestedValue+'(old)'),ca())},1E3)):/^change\./i.test(A.type)&&!/^(checkbox)$/i.test(A.target.type)&&(console.debug(' change .... '+b.id),ca())})}}},ua=function(c,b){c.setSelectionRange?(c.focus(),c.setSelectionRange(b,b)):c.createTextRange&&
|
|
342
|
-
(c=c.createTextRange(),c.collapse(!0),c.moveEnd('character',b),c.moveStart('character',b),c.select())},za=function(c,b){if(document.activeElement&&document.activeElement.form){c=Array.prototype.filter.call(document.activeElement.form.querySelectorAll('a:not([disabled]), button:not([disabled]), input[type=text]:not([disabled]), select:not([disabled]), [tabindex]:not([disabled]):not([tabindex="-1"])'),function(n){return 0<n.offsetWidth||0<n.offsetHeight||n===document.activeElement});var a=c.indexOf(document.activeElement);
|
|
343
|
-
if(-1<a){var e=c[a+1];b&&(e=c[a-1]);(e||c[0]).focus()}}},Ta=function(c,b){c.setAttribute('readonly','readonly');addListener(gina,c,'focusout.'+c.id,function(a){a.preventDefault();clearTimeout(b);a=a.currentTarget;triggerEvent(gina,a,'change.'+a.id);a.setAttribute('readonly','readonly')});addListener(gina,c,'focusin.'+c.id,function(a){a.preventDefault();a.currentTarget.removeAttribute('readonly');var e='keydown.'+a.currentTarget.id;'undefined'==typeof gina.events[e]&&addListener(gina,a.currentTarget,
|
|
344
|
-
e,function(n){n.preventDefault();clearTimeout(b);var q=n.currentTarget,g=n.currentTarget.value,G=q.selectionStart,A=q.selectionEnd;q.removeAttribute('readonly');switch(n.keyCode){case 46:G!=A?(q.value=g.substring(0,G)+g.substring(A),0==G&&(q.value=g.substring(A+1))):q.value=0==G?g.substring(G+1):g.substring(0,G)+g.substring(A+1);n.currentTarget.setAttribute('readonly','readonly');setTimeout(()=>{q.removeAttribute('readonly');setTimeout(()=>{ua(q,G)},0)},0);break;case 8:G!=A?(q.value=g.substring(0,
|
|
345
|
-
G)+g.substring(A),0==G&&(q.value=g.substring(A))):q.value=0==G?g.substring(G+1):g.substring(0,G-1)+g.substring(A);n.currentTarget.setAttribute('readonly','readonly');setTimeout(()=>{q.removeAttribute('readonly');setTimeout(()=>{G!=A?ua(q,G):0==G?ua(q,G):ua(q,G-1)},0)},0);break;case 9:F[16]&&F[9]?za(q,!0):za(q);break;case 13:case 16:break;case 37:console.debug('moving left ',G-1);ua(q,G-1);break;case 39:G+1<g.length+1&&ua(q,G+1);break;case 17:case 91:console.debug('CMD, CTRL hit');n.preventDefault();
|
|
346
|
-
break;case 67:if(F[67]&&F[91]||F[67]&&F[17]){q.setSelectionRange(G,A);document.execCommand('copy');break}case 86:if(F[86]&&F[91]||F[86]&&F[17]){G!=A&&(q.value=q.value.replace(g.substring(G,A),''));ua(q,G);document.execCommand('paste');break}case 88:if(F[88]&&F[91]||F[88]&&F[17]){q.setSelectionRange(G,A);document.execCommand('cut');break}case 90:if(F[90]&&F[91]||F[90]&&F[17]){q.value=q.defaultValue;break}default:1<n.key.length||(G!=A?(q.value=g.substring(0,G)+n.key,A-1<g.length&&(q.value+=g.substring(A))):
|
|
347
|
-
q.value=0==G?n.key+g.substring(G):g.substring(0,G)+n.key+g.substring(A),n.currentTarget.setAttribute('readonly','readonly'),setTimeout(()=>{q.removeAttribute('readonly');setTimeout(()=>{ua(q,G+1)},0)},0))}})})},Ha=function(c,b){if(/^(input|textarea)$/i.test(b.tagName)&&'undefined'==typeof gina.events['registered.'+b.id]){/^file$/i.test(b.type)||Ka(b);switch(b.tagName.toLowerCase()){case 'textarea':pa(c,b,null,!0);break;default:pa(c,b,null),c=b.getAttribute('autocomplete'),/safari/i.test(navigator.userAgent)&&
|
|
348
|
-
c&&/^(off|false)/i.test(c)&&Ta(b,null)}gina.events['registered.'+b.id]=b.id}},Pa=function(c,b,a){var e=b.id+'-'+a+'-'+c+'-trigger',n=document.getElementById(e);n||(e=b.getAttribute('data-gina-form-upload--'+a+ +c+'-trigger'),n=document.getElementById(e));n&&'undefined'==typeof n.isBinded||n&&'undefined'!=typeof n.isBinded&&!/true/i.test(n.isBinded)?(addListener(gina,n,'click',function(q){q.preventDefault();K(b,c)}),n.isBinded=!0):console.warn('[FormValidator::bindForm][upload]['+b.id+'] : did not find `upload '+
|
|
349
|
-
c+' trigger`.\nPlease, make sure that your delete element ID is `'+e+'-'+c+'-trigger`, or add to your file input ('+b.id+') -> `data-gina-form-upload-'+c+'-trigger="your-custom-id"` definition.')},Ua=function(c,b){var a=function(e,n,q){var g=null;switch(n){case 'data-gina-form-upload-action':g='upload-to-tmp-xml';break;case 'data-gina-form-upload-reset-action':g='upload-delete-from-tmp-xml'}var G=e.getAttribute(n);if(!G||''==G){g||console.warn('`'+n+'` definition not found for `'+e.id+'`. Trying to get default route.');
|
|
350
|
-
var A=null;try{g&&(G=r.getRoute(g))}catch(ca){A=ca}G?(console.info('Ignore previous warnings regarding upload. I have found a default `'+n+'` route: `'+g+'@'+G.bundle+'`'),e.setAttribute('data-gina-form-upload-action',G.toUrl())):(e='`'+n+'` needs to be defined to proceed for your `input[type=file]` with ID `'+e.id+'`\n'+A+'\n',q&&(q.innerHTML+=e.replace(/(\n|\r)/g,'<br>')),console.error(e))}};a(c,'data-gina-form-upload-action',b);a(c,'data-gina-form-upload-reset-action',b);a(c,'data-gina-form-upload-delete-action',
|
|
351
|
-
b)},Xa=function(c,b,a){var e=null;'undefined'!=typeof this.target&&/FORM/i.test(this.target.tagName)?e=this.target.getAttribute('id'):/string/i.test(typeof c)&&(e=c);if('undefined'!=typeof l.$forms[e])c=l.$forms[e];else throw Error('form instance `'+e+'` not found');Y(e);Ra(c.target);'undefined'!=typeof rule?Ma(c.target,b):Ma(c.target);return a?a(c):c},Ra=function(c){var b=null,a=null;try{if(c.getAttribute&&c.getAttribute('id'))if(a=c.getAttribute('id'),'undefined'!=typeof l.$forms[a])b=l.$forms[a];
|
|
352
|
-
else throw Error('form instance `'+a+'` not found');else if('undefined'!=typeof c.target)b=c,a=c.getAttribute&&c.getAttribute('id')?b.getAttribute('id'):b.id;else throw Error('Validator::unbindForm($target): `$target` must be a DOM element\n'+err.stack);}catch(g){throw Error('Validator::unbindForm($target) could not unbind form `'+c+'`\n'+g.stack);}if('undefined'!=typeof b&&!b.binded)return b;removeListener(gina,b,'success.'+a);removeListener(gina,b,'error.'+a);b.target.getAttribute('data-gina-form-event-on-submit-success')&&
|
|
353
|
-
removeListener(gina,b,'success.'+a+'.hform');b.target.getAttribute('data-gina-form-event-on-submit-error')&&removeListener(gina,b,'error.'+a+'.hform');removeListener(gina,b,'validate.'+a);removeListener(gina,b,'validated.'+a);removeListener(gina,b,'submit.'+a);removeListener(gina,b,'reset.'+a);c=[];a=b.target.getElementsByTagName('button');if(0<a.length)for(let g=0,G=a.length;g<G;++g)c.push(a[g]);a=b.target.getElementsByTagName('a');if(0<a.length)for(let g=0,G=a.length;g<G;++g)c.push(a[g]);a=b.target.getElementsByTagName('input');
|
|
354
|
-
if(0<a.length)for(let g=0,G=a.length;g<G;++g)if(/^(hidden)$/i.test(a[g].type)||c.push(a[g]),/^(file)$/i.test(a[g].type)){var e=a[g].getAttribute('data-gina-form-virtual');if(e){var n=m(e).target;if(n){c.push(n);for(let A=0,ca=O.length;A<ca;A++){var q=O[A];'undefined'!=typeof gina.events[q+'.'+e+'.hform']&&gina.events[q+'.'+e+'.hform']==e&&removeListener(gina,n,q+'.'+e+'.hform')}}}}else for(let A=0,ca=O.length;A<ca;A++)e=O[A]+'.'+a[g].id,'undefined'!=typeof gina.events[e]&&gina.events[e]==a[g].id&&
|
|
355
|
-
removeListener(gina,a[g],e),e=O[A],'undefined'!=typeof gina.events[e]&&gina.events[e]==a[g].id&&removeListener(gina,a[g],e),e=a[g].id,'undefined'!=typeof gina.events[e]&&gina.events[e]==a[g].id&&removeListener(gina,a[g],e);a=b.target.getElementsByTagName('textarea');if(0<a.length)for(let g=0,G=a.length;g<G;++g)c.push(a[g]);a=b.target.getElementsByTagName('form');if(0<a.length)for(let g=0,G=a.length;g<G;++g)c.push(a[g]);c.push(b.target);for(let g=0,G=c.length;g<G;++g){a=c[g];e=a.getAttribute('id');
|
|
356
|
-
for(let A=0,ca=O.length;A<ca;A++)q=n=O[A],'undefined'!=typeof gina.events[q]&&gina.events[q]==e&&removeListener(gina,a,q),q=e,'undefined'!=typeof gina.events[q]&&gina.events[q]==e&&removeListener(gina,a,q),q=n+'.'+e,'undefined'!=typeof gina.events[q]&&gina.events[q]==e&&removeListener(gina,a,q),q=n+'.'+e,'undefined'!=typeof gina.events[q]&&gina.events[q]==q&&removeListener(gina,a,q),q=n+'.'+e+'.hform','undefined'!=typeof gina.events[q]&&gina.events[q]==e&&removeListener(gina,a,q)}evt=null;b.binded=
|
|
357
|
-
!1;return b},db=function(c,b){b=b.name;if(!c[b])for(let a in c)if(/^\//.test(a)&&(re=a.match(/\/(.*)\//).pop(),flags=a.replace('/'+re+'/',''),re=re.replace(/\[/g,'\\[').replace(/\]/g,'\\]'),re=new RegExp(re,flags),re.test(b))){c[b]=c[a];break}},Ma=function(c,b){var a=null,e=null,n=typeof(0<na.count())?na:l.rules;e='undefined'==typeof c&&'undefined'!=typeof this.target&&/FORM/i.test(this.target.tagName)||!/object/i.test(typeof c)?this.target.id||this.target.getAttribute('id'):/string/i.test(typeof c)?
|
|
358
|
-
c:c.getAttribute('id');try{if('undefined'!=typeof l.$forms[e]){a=l.$forms[e];if('undefined'==typeof a.target)throw Error('Validator::bindForm($target, customRule): `$target` must be a DOM element\n');c=a.target}else throw Error('form instance `'+e+'` not found');}catch(T){throw Error('Validator::bindForm($target, customRule) could not bind form `'+c+'`\n'+T.stack);}var q=!1,g=null,G='',A=null;'undefined'!=typeof b||'string'==typeof e&&'undefined'!=typeof n[e.replace(/\-|\//g,'.')]?(q=!0,g=b&&'object'==
|
|
359
|
-
typeof b?b:b&&'string'==typeof b&&'undefined'!=typeof n[b.replace(/\-|\//g,'.')]?Ba(b.replace(/\-|\//g,'.')):Ba(e.replace(/\-|\//g,'.')),a.rules=g,B&&H&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&(gina.forms.rules||(gina.forms.rules={}),objCallback={id:e,rules:a.rules},window.ginaToolbar.update('forms',objCallback))):a.rules={};'undefined'==typeof a.target.dataset.ginaFormLiveCheckEnabled&&0<a.rules.count()?a.target.dataset.ginaFormLiveCheckEnabled=!0:a.target.dataset.ginaFormLiveCheckEnabled=
|
|
360
|
-
'undefined'!=typeof a.target.dataset.ginaFormLiveCheckEnabled?/^true$/i.test(a.target.dataset.ginaFormLiveCheckEnabled)?!0:!1:!1;a.fieldsSet||(a.fieldsSet={});A=null;c.getElementsByTagName('a');b=c.getElementsByTagName('input');var ca=c.getElementsByTagName('textarea');A=c.getElementsByTagName('select');var la={},ha=[],va={},ma=null,x={},V=null,da=null;for(let T=0,J=ca.length;T<J;++T)db(a.rules,ca[T]),da=ca[T].getAttribute('id'),da&&''!=da||(da='textareas.'+X.v4(),ca[T].setAttribute('id',da)),a.fieldsSet[da]||
|
|
361
|
-
(a.fieldsSet[da]={id:da,name:ca[T].name||null,value:ca[T].value||'',defaultValue:ca[T].value||''}),/^true$/i.test(a.target.dataset.ginaFormLiveCheckEnabled)&&Ha(a,ca[T]);for(let T=0,J=b.length;T<J;++T){db(a.rules,b[T]);da=b[T].getAttribute('id');da&&''!=da||(da='input.'+X.v4(),b[T].setAttribute('id',da));a.fieldsSet[da]||(ma=b[T].value,/$(on|true|false)$/i.test(ma)&&(ma=/$(on|true)$/i.test(ma)?!0:!1),a.fieldsSet[da]={id:da,name:b[T].name||null,value:ma||!/^(checkbox|radio)$/i.test(b[T].type)?'':b[T].checked,
|
|
362
|
-
defaultValue:/^(checkbox|radio)$/i.test(b[T].type)?b[T].checked:ma},/^(checkbox|radio)$/i.test(b[T].type)&&'undefined'==typeof a.fieldsSet[da].defaultChecked&&(a.fieldsSet[da].defaultChecked=/^(true|on)$/i.test(b[T].checked)||/^(true|on)$/.test(ma)&&/^(checkbox)$/i.test(b[T].type)?!0:!1,/^radio$/i.test(b[T].type)&&(a.fieldsSet[da].value=b[T].value,a.fieldsSet[da].defaultValue=b[T].value)));/^true$/i.test(a.target.dataset.ginaFormLiveCheckEnabled)&&Ha(a,b[T]);if(ma=b[T].getAttribute('data-gina-form-element-group'))0>
|
|
363
|
-
ha.indexOf(ma)&&ha.push(ma),V=b[T].getAttribute('name')||da,V===da&&b[T].setAttribute('name',da),la[da]={id:da,name:V,group:ma,target:b[T]},va[b[T].name]=new RegExp('^'+ma.replace(/[.*+?^${}()|[\]\\]/g,'\\$&')),q&&('undefined'==typeof a.rules[b[T].name]&&(a.rules[b[T].name]={}),'undefined'!=typeof a.rules[b[T].name].isRequired&&a.rules[b[T].name].isRequired||(a.rules[b[T].name].exclude=!0));if(0<va.count())for(var S in va)b[T].name!=S&&(b[T].getAttribute('data-gina-form-element-group'),va[S].test(b[T].name)&&
|
|
364
|
-
(b[T].disabled=!0,'undefined'==typeof x[S]&&(x[S]={}),x[S][b[T].name]=b[T]));if(/^file$/i.test(b[T].type)){da=b[T].getAttribute('data-gina-form-upload-trigger');da||(da=b[T].id);ma=null;V=(new DOMParser).parseFromString(c.innerHTML,'text/html');da&&(ma=document.getElementById(da));ca=document.getElementById(b[T].id+'-error');Ua(b[T],ca);if((ca=V.getElementById(da+'-preview'))&&ma&&!/none/i.test(window.getComputedStyle(ca).display)&&!/none/i.test(ca.parentElement.style.display)){V=0;console.debug('preview is visible ...');
|
|
365
|
-
ma.customFiles=[];ma.form=c;ca=ca.childNodes;for(let M=0,W=ca.length;M<W;M++){var ea=null;if(/ul/i.test(ca[M].tagName))for(let ta=0,Aa=ca[M].length;ta<Aa;ta++){let Fa=$$els[M];for(let sa=0,Sa=Fa.length;sa<Sa;sa++)/img/i.test(Fa[sa])&&(ea=Fa[sa],ea.setAttribute(''),V++)}else/img/i.test(ca[M].tagName)&&(ea=ca[M],deleteLinkId=da+'-'+V+'-delete-trigger',ea=ea.src.substring(ea.src.lastIndexOf('/')+1),ma.customFiles.push({name:ea,deleteLinkId}),Pa('delete',ma,V),V++)}}addListener(gina,b[T],'change',function(M){M.preventDefault();
|
|
366
|
-
var W=M.currentTarget;M=W.files;W.customFiles=Array.from(M);if(!M.length)return!1;var ta=W.getAttribute('data-gina-form-upload-action'),Aa=W.getAttribute('name'),Fa='gina-upload-'+Aa.replace(/\[/g,'-').replace(/\]/g,'-'+a.id);W.setAttribute('data-gina-form-virtual',Fa);var sa=W.getAttribute('data-gina-form-upload-on-success'),Sa=W.getAttribute('data-gina-form-upload-on-error'),Ia=null;if(0<M.length){var Da=null;if(w()){Da=gina.popin.getActivePopin();Da.$target=(new DOMParser).parseFromString(Da.target.outerHTML,
|
|
367
|
-
'text/html');Da.$target.getElementById(Da.id).innerHTML=document.getElementById(Da.id).innerHTML;var Ga=Da.$target.getElementById(Fa)}else Ga=document.getElementById(Fa);if(!Ga){try{Ga=m(Fa)||null}catch(mb){}Ga||=w()?Da.$target.createElement('form'):document.createElement('form');Ga.id=Fa;Ga.action=ta;Ga.enctype='multipart/form-data';Ga.method='POST';if('undefined'!=typeof W.form){ta='files';var Na=W.getAttribute('data-gina-form-upload-prefix')||W.name||W.getAttribute('name'),Ja=W.id||W.getAttribute('id'),
|
|
368
|
-
bb=!1,Wa=W.getAttribute('data-gina-form-upload-preview')||Ja+'-preview';Wa=w()?Da.$target.getElementById(Wa):document.getElementById(Wa);'undefined'!=typeof Wa&&(bb=!0);Na&&(ta=Na);Na=[];for(var Za='name group originalFilename ext encoding size height width location mime preview'.split(' '),ab=W.form.getElementsByTagName('INPUT'),fb,eb,lb,ib,cb=0,ob=M.length;cb<ob;++cb){Pa('reset',W,cb);Na[cb]=null;fb=ta+'['+cb+']';ib=new RegExp('^'+fb.replace(/\[/g,'\\[').replace(/\]/g,'\\]'));for(var jb=0,pb=ab.length;jb<
|
|
369
|
-
pb;++jb)fb=ab[jb].getAttribute('type'),Ia=ab[jb].getAttribute('data-gina-form-upload-error')||Ja+'-error'||null,fb&&/hidden/i.test(fb)&&(eb=ab[jb],fb=/\[\w+\]$/i.test(eb.name)?eb.name.match(/\[\w+\]$/)[0].replace(/\[|\]/g,''):eb.name,lb=/\[\w+\]$/i.test(eb.name)?eb.name.match(/\[\w+\]$/)[0].replace(/\[|\]/g,''):eb.name,eb&&'undefiend'!=typeof fb&&-1<Za.indexOf(fb)&&ib.test(eb.name)?(Na[cb]||(Na[cb]={}),/\[preview\]/i.test(eb.name)?('undefined'==typeof Na[cb].preview&&(Na[cb].preview={}),Na[cb].preview[fb]=
|
|
370
|
-
eb):Na[cb][fb]=eb):eb&&'undefiend'!=typeof fb&&0>Za.indexOf(fb)&&ib.test(eb.name)&&(Na[cb]||(Na[cb]={}),/\[preview\]/i.test(eb.name)?('undefined'==typeof Na[cb].preview&&(Na[cb].preview={}),Na[cb].preview[lb]=eb):Na[cb][lb]=eb));ib=0;for(jb=Za.length;ib<jb;++ib)Na[cb]||(Na[cb]={}),'undefined'==typeof Na[cb][Za[ib]]&&(fb=ta+'['+cb+']['+Za[ib]+']',$newVirtualField=document.createElement('input'),$newVirtualField.type='hidden',$newVirtualField.id='input.'+X.v4(),$newVirtualField.name=fb,$newVirtualField.value=
|
|
371
|
-
'',W.form.appendChild($newVirtualField),Na[cb][Za[ib]]=W.form[W.form.length-1])}Ga.uploadProperties={id:W.form.id||W.getAttribute('id'),uploadTriggerId:W.id,$form:W.form,errorField:Ia,mandatoryFields:Za,uploadFields:Na,hasPreviewContainer:bb,isPopinContext:w()};bb&&(Ga.uploadProperties.previewContainer=Wa)}sa?Ga.setAttribute('data-gina-form-event-on-submit-success',sa):Ga.setAttribute('data-gina-form-event-on-submit-success','onGenericXhrResponse');Sa?Ga.setAttribute('data-gina-form-event-on-submit-error',
|
|
372
|
-
Sa):Ga.setAttribute('data-gina-form-event-on-submit-error','onGenericXhrResponse');w()?document.getElementById(Da.id).appendChild(Ga):document.body.appendChild(Ga)}try{var qb=m(Fa),nb=new FormData;W=null;Fa=0;for(var rb=M.length;Fa<rb;++Fa)W=M[Fa],nb.append(Aa,W,W.name);qb.send(nb,{withCredentials:!0})}catch(mb){throw mb;}}})}}var ka=function(T,J){T.setAttribute('data-value',T.value);if(/^(true)$/i.test(J.target.dataset.ginaFormLiveCheckEnabled&&0<J.rules.count())){var M={},W={},ta=null;ta=T.form;
|
|
373
|
-
M[event.target.name]=event.target.value;W[event.target.name]=event.target;l.$forms[ta.getAttribute('id')].isValidating=!0;R(event.target,M,W,J.rules,function(Aa){l.$forms[ta.getAttribute('id')].isValidating=!1;Aa.isValid()?N(ta,{},Aa.data,event.target.name):N(ta,Aa.error,Aa.data,event.target.name);var Fa=ta,sa=Aa=null,Sa=null;sa=$a(Fa,n);Aa=sa.fields;sa=sa.$fields;var Ia=Fa.getAttribute('id');Sa=l.$forms[Ia].rules;l.$forms[Ia].isValidating=!0;R(Fa,Aa,sa,Sa,function(Da){l.$forms[Ia].isValidating=!1;
|
|
374
|
-
console.debug('[updateSelect]: onSilentGlobalLiveValidation: '+Da.isValid(),Da);var Ga=Da.isValid();if(!Ga){l.$forms[Ia].errors=Da.error;for(let Na in Da.error)N(Fa,Da.error,Da.data,Na)}Va(Fa,Ga);once=!1})})}};ma=x=null;S=0;for(va=A.length;S<va;++S)if(db(a.rules,A[S]),da=A[S].getAttribute('id'),!da||!/^gina\-toolbar/.test(da)){da&&''!=da||(da='select.'+X.v4(),A[S].setAttribute('id',da));if(ma=A[S].getAttribute('data-gina-form-element-group'))x=A[S].getAttribute('name')||da,x===da&&A[S].setAttribute('name',
|
|
375
|
-
da),la[da]={id:da,name:x,group:ma,target:A[S]};addListener(gina,A[S],'change',function(T){T=T.target;/select/i.test(T.type)&&ka(T,a)});if(A[S].options&&!a.fieldsSet[da]){x=0;if(ma=A[S].getAttribute('data-value')||null)for(V=0,ca=A[S].options.length;V<ca;++V)if(A[S].options[V].value==ma){x=V;A[S].selectedIndex=x;break}'undefined'!=typeof A[S].options[A[S].selectedIndex]&&A[S].options[A[S].selectedIndex].index&&(x=A[S].options[A[S].selectedIndex].index);0<A[S].options.length&&'undefined'!=typeof A[S].options[x]&&
|
|
376
|
-
(ma=A[S].options[x].value);a.fieldsSet[da]={id:da,name:A[S].name||null,value:ma||null,selectedIndex:x||0};'undefined'!=typeof A[S].selectedIndex&&-1<A[S].selectedIndex&&(A[S].options[x].selected=!0,A[S].setAttribute('data-value',A[S].options[x].value))}}var wa=function(T,J,M,W){'undefined'==typeof W&&(W=!1);if('undefined'==typeof la[T])throw Error('Radio & Checkbox dependencies not met: you must use the ID attribue of the `master element` as the `data-gina-form-element-group`');var ta=T.replace(/\-|_|@|#|\.|\[|\]/g,
|
|
377
|
-
'\\$&');T=la[T].target.checked;for(let sa in la)if(!/radio|checkbox/i.test(la[sa].target.type)){var Aa=new RegExp(ta);var Fa=new RegExp(J);if(Aa.test(la[sa].group)&&Fa.test(la[sa].group)||Aa.test(la[sa].group))la[sa].target.disabled=!0,'undefined'==typeof a.rules[la[sa].name]&&(a.rules[la[sa].name]={}),a.rules[la[sa].name].exclude=!0,W?(la[sa].target.disabled=T?!1:!0,a.rules[la[sa].name].exclude=T?!1:!0):(la[sa].target.disabled=M,a.rules[la[sa].name].exclude=M)}},Ca=function(T,J,M,W){'undefined'==
|
|
378
|
-
typeof W&&(W=!1);if(W&&'undefined'!=typeof la[J.id])return T=/true/i.test(J.checked)?!1:!0,wa(J.id,la[J.id].group,T,W);M=J.name;q&&'undefined'==typeof T.rules[M]&&(T.rules[M]={});/^true$/i.test(J.checked)?q&&(T.rules[M].exclude=!1,'undefined'!=typeof la[J.id]&&wa(J.id,la[J.id].group,!1,W)):q&&(T.rules[M].exclude=!0,'undefined'!=typeof la[J.id]&&wa(J.id,la[J.id].group,!0,W))},Oa=function(T,J){'undefined'==typeof J&&(J=!1);var M=function(sa,Sa,Ia){if(Sa)Ca(a,sa,Sa);else for(let Da in la)if(Fa.test(la[Da].group)||
|
|
379
|
-
Fa.test(la[Da].target.getAttribute('data-gina-form-element-group')))la[Da].target.disabled=Ia};J&&/^(on)$/i.test(T.value)&&!T.checked&&(T.value=!1);var W=T.getAttribute('data-value')||T.getAttribute('value')||T.value;W=/^(true|on)$/.test(W)?!0:W;''===W&&(W=!1);var ta=/^(true|on|false)$/i.test(W)?!0:!1;J&&ta&&(/^true$/i.test(W)&&!T.checked?T.checked=!0:/^false$/i.test(W)&&T.checked&&(T.checked=!1));W=T.checked;var Aa=T.getAttribute('data-gina-form-element-group')||null,Fa=new RegExp(T.id.replace(/\-|_|@|#|\.|\[|\]/g,
|
|
380
|
-
'\\$&'));W&&'null'!=W&&'false'!=W&&''!=W?(J?Qa(T):(setTimeout(function(){T.checked=!0;M(T,Aa,!1);Qa(T)},0),T.setAttribute('checked','checked')),ta&&(T.value=!0,T.setAttribute('value',!0),typeof('undefined'!=T.getAttribute('data-value'))&&T.setAttribute('data-value',!0))):(J?Qa(T):setTimeout(function(){T.checked=!1;M(T,Aa,!0);Qa(T)},0),T.removeAttribute('checked'),ta&&(T.value=!1,T.setAttribute('value','false'),typeof('undefined'!=T.getAttribute('data-value'))&&T.setAttribute('data-value','false')))},
|
|
381
|
-
Qa=function(T){T=new RegExp(T.id.replace(/\-|_|@|#|\.|\[|\]/g,'\\$&'));for(let J in la)(/checkbox/i.test(la[J].target.type)&&T.test(la[J].group)||/checkbox/i.test(la[J].target.type)&&T.test(la[J].target.getAttribute('data-gina-form-element-group')))&&Ca(a,la[J].target,la[J].group,!0)},Ya=function(T,J){J=T.id.replace(/\-|_|@|#|\.|\[|\]/g,'\\$&');J=new RegExp(J);for(let M in la)if(/checkbox|radio/i.test(la[M].target.type)||(la[M].target.disabled=!0,'undefined'==typeof a.rules[la[M].name]&&(a.rules[la[M].name]=
|
|
382
|
-
{}),a.rules[la[M].name].exclude=!0),J.test(la[M].group)||J.test(la[M].target.getAttribute('data-gina-form-element-group').replace(/\-|_|@|#|\.|\[|\]/g,'\\$&')))la[M].target.disabled=!0,'undefined'==typeof a.rules[la[M].name]&&(a.rules[la[M].name]={}),/^(true|on)$/i.test(T.checked)?(la[M].target.disabled=!1,a.rules[la[M].name].exclude=!1):(la[M].target.disabled=!0,a.rules[la[M].name].exclude=!0);Qa(T)},La=null,ya=function(T,J,M){J='undefined'!=typeof J&&J?!0:!1;M='undefined'!=typeof M&&M?!0:!1;var W=
|
|
383
|
-
T.checked,ta=/^(true|false)$/i.test(T.value);La=document.getElementsByName(T.name);for(let Aa=0,Fa=La.length;Aa<Fa;++Aa)La[Aa].id!==T.id&&W&&(La[Aa].checked=!1,La[Aa].removeAttribute('checked'),Ya(La[Aa],!0));J?Ya(T):(W&&'null'!=W&&'false'!=W&&''!=W?setTimeout(function(){M?Ya(T):(T.checked=!1,T.removeAttribute('checked'))},0):setTimeout(function(){M?Ya(T):(T.checked=!0,T.setAttribute('checked','checked'))},0),ta&&(T.value=/^true$/.test(T.value)?!0:!1))};S=0;for(va=b.length;S<va;++S){A=b[S].getAttribute('type');
|
|
384
|
-
if('undefined'==typeof b[S].id||''==b[S].id)b[S].id=A+'-'+X.v4(),b[S].setAttribute('id',b[S].id);if('undefined'!=typeof A&&/^checkbox$/i.test(A)){if(b[S].disabled&&-1<ha.indexOf(b[S].id)||!b[S].checked&&-1<ha.indexOf(b[S].id)){A=new RegExp(b[S].id.replace(/\-|_|@|#|\.|\[|\]/g,'\\$&'));for(var Ea in la)A.test(la[Ea].group)&&(la[Ea].target.disabled=!0)}G='change.'+b[S].id;A=function(T,J){addListener(gina,T,J,function(M){Oa(M.target);triggerEvent(gina,M.target,'changed.'+M.target.id)});Oa(T,!0)};'undefined'!=
|
|
385
|
-
typeof gina.events[G]&&gina.events[G]==b[S].id&&removeListener(gina,b[S],G);A(b[S],G)}else'undefined'!=typeof A&&/^radio$/i.test(A)&&(G=b[S].id,A=function(T,J){addListener(gina,T,J,function(M){ya(M.target);triggerEvent(gina,M.target,'changed.'+M.target.id)});ya(T,!0)},'undefined'!=typeof gina.events[G]&&gina.events[G]==b[S].id&&removeListener(gina,b[S],G),A(b[S],G))}G='click';A=function(){var T=null;T='reset.'+c.id;'undefined'==typeof gina.events[T]&&addListener(gina,c,T,function(J){J.preventDefault();
|
|
386
|
-
var M=l.$forms[J.currentTarget.id||J.target.id];M.target.dataset.ginaFormIsResetting=!0;ia(M);J=$a(M.target,M.rules,!0);R(M.target,J.fields,J.$fields,M.rules,function(W){var ta=W.isValid();console.debug('silent reset validation result[isValid:'+ta+']: ',W);N(M.target,{});Va(M.target,ta);M.target.dataset.ginaFormIsResetting=!1})});addListener(gina,c,'reset',function(J){var M=J.target;if('undefined'!=typeof J.defaultPrevented&&J.defaultPrevented)return!1;J.preventDefault();var W=M.id;if(!W)return!1;
|
|
387
|
-
/^reset\./.test(W)||(W='reset.'+M.id);gina.events[W]&&triggerEvent(gina,M,W,J.detail)});addListener(gina,c,'keydown',function(J){var M=J.target;if('undefined'!=typeof J.defaultPrevented&&J.defaultPrevented)return!1;F[J.keyCode]='keydown'==J.type;var W=M.id;if(!W)return!1;/^keydown\./.test(W)||(W='keydown.'+M.id);gina.events[W]&&(cancelEvent(J),triggerEvent(gina,M,W,J.detail,J))});addListener(gina,c,'keyup',function(J){var M=J.target;if('undefined'!=typeof J.defaultPrevented&&J.defaultPrevented)return!1;
|
|
388
|
-
F[J.keyCode]&&delete F[J.keyCode];var W=M.id;if(!W)return!1;/^keyup\./.test(W)||(W='keyup.'+M.id);gina.events[W]&&(cancelEvent(J),triggerEvent(gina,M,W,J.detail,J))});addListener(gina,c,'focusin',function(J){var M=J.target;if('undefined'!=typeof J.defaultPrevented&&J.defaultPrevented)return!1;var W=M.id;if(!W)return!1;/^focusin\./.test(W)||(W='focusin.'+M.id);if(gina.events[W]){cancelEvent(J);var ta=J.target.form.getAttribute('id')||J.currentTarget.getAttribute('id'),Aa={id:M.id,name:M.name};l.$forms[ta].lastFocused.length?
|
|
389
|
-
l.$forms[ta].lastFocused.splice(0,0,Aa):l.$forms[ta].lastFocused[0]=Aa;l.$forms[ta].lastFocused.splice(2);triggerEvent(gina,M,W,J.detail)}});addListener(gina,c,'focusout',function(J){var M=J.target;if('undefined'!=typeof J.defaultPrevented&&J.defaultPrevented)return!1;var W=M.id;if(!W)return!1;/^focusout\./.test(W)||(W='focusout.'+M.id);gina.events[W]&&(cancelEvent(J),triggerEvent(gina,M,W,J.detail))});addListener(gina,c,'change',function(J){var M=J.target;if('undefined'!=typeof J.defaultPrevented&&
|
|
390
|
-
J.defaultPrevented)return!1;var W=M.id;if(!W)return!1;/^change\./.test(W)||(W='change.'+M.id);gina.events[W]&&(cancelEvent(J),triggerEvent(gina,M,W,J.detail))});addListener(gina,c,'click',function(J){var M=J.target,W=!1,ta=!1;if(/(label)/i.test(J.target.tagName)&&'undefined'!=typeof J.target.control&&null!=J.target.control&&/(checkbox|radio)/i.test(J.target.control.type)||/(label)/i.test(J.target.parentNode.tagName)&&'undefined'!=typeof J.target.parentNode.control&&null!=J.target.parentNode.control&&
|
|
391
|
-
/(checkbox|radio)/i.test(J.target.parentNode.control.type))ta=J.target.getAttribute('for')||J.target.parentNode.getAttribute('for')?!0:!1,M=J.target.control||J.target.parentNode.control;if(!M.disabled&&/(checkbox|radio)/i.test(M.type)&&!ta){if(/checkbox/i.test(M.type))return Oa(M);if(/radio/i.test(M.type))return ya(M,!1,!0)}if(/(button|input)/i.test(M.tagName)&&/(submit|checkbox|radio)/i.test(M.type)||/a/i.test(M.tagName)&&M.attributes.getNamedItem('data-gina-form-submit')||/a/i.test(M.parentNode.tagName)&&
|
|
392
|
-
M.parentNode.attributes.getNamedItem('data-gina-form-submit')){ta=M.attributes.getNamedItem('data-gina-form-submit');var Aa=M.parentNode.attributes.getNamedItem('data-gina-form-submit');if(ta||Aa)W=!0,(Aa=ta?M.getAttribute('data-gina-form-submit-method')||J.currentTarget.getAttribute('method'):M.parentNode.getAttribute('data-gina-form-submit-method')||J.currentTarget.getAttribute('method'))&&(ta&&M.form?M.form.setAttribute?M.form.setAttribute('method',Aa):J.currentTarget.setAttribute('method',Aa):
|
|
393
|
-
M.parentNode.form&&(M.parentNode.form.setAttribute?M.parentNode.form.setAttribute('method',Aa):J.currentTarget.setAttribute('method',Aa)));'undefined'!=typeof M.id&&M.getAttribute('id')||M.setAttribute('id','click.'+X.v4());M.id=M.getAttribute('id');if(/^click\./.test(M.id)||q){ta=M.id;if(!ta)return!1;/^click\./.test(ta)||(ta=M.id);if(!M.disabled&&/(checkbox|radio)/i.test(M.type)){if(/checkbox/i.test(M.type))return Oa(M);if(/radio/i.test(M.type))return ya(M,!1,!0)}if('undefined'!=typeof J.defaultPrevented&&
|
|
394
|
-
J.defaultPrevented)return!1;if('submit'==M.type&&!/^submit\./i.test(ta)||W&&!/^submit\./i.test(ta))ta='submit.'+ta,l.$forms[a.id].submitTrigger=a.submitTrigger=M.id;'reset'!=M.type||/^reset\./i.test(ta)||(ta='reset.'+ta);gina.events[ta]?(cancelEvent(J),triggerEvent(gina,M,ta,J.detail)):W&&'undefined'!=typeof this.id&&''!=this.id&&'undefined'!=typeof gina.validator.$forms[this.id]&&(gina.validator.getFormById(this.id).submit(),cancelEvent(J))}}})};A();G='validate.'+e;A=function(){addListener(gina,
|
|
395
|
-
c,G,function(T){cancelEvent(T);var J=a.eventData.error||a.eventData.validation||T.detail;N(T.target,J.fields||J.error,J.data);T=T.target.getAttribute('id');if('undefined'!=typeof J.isValid&&J.isValid()){var M=l.$forms[T].target.getAttribute('data-gina-form-inherits-data')||null;M&&(J.data=D(J.data,JSON.parse(decodeURIComponent(M))));l.$forms[T]?l.$forms[T].send(J.data):a&&a.send(J.data)}})};'undefined'!=typeof gina.events[G]&&gina.events[G]=='validate.'+e&&removeListener(gina,a,G,A);A();Ea=function(T,
|
|
396
|
-
J){/^submit\./i.test(T)||(T='submit.'+T);addListener(gina,J,T,function(M){cancelEvent(M);var W={};M={_length:0};var ta=c.getAttribute('id'),Aa='undefined'!=typeof l.$forms[ta]?l.$forms[ta].rules:null;W=$a(c,Aa);M=W.fields;W=W.$fields;Aa=l.$forms[ta].rules;0==M._length?(delete M._length,M={error:[],isValid:function(){return!0},data:ra(M)},triggerEvent(gina,c,'validate.'+e,M)):(e=c.getAttribute('id'),g=(Aa=c.getAttribute('data-gina-form-rule'))?Ba(Aa.replace(/\-|\//g,'.')):Ba(e.replace(/\-/g,'.')),
|
|
397
|
-
l.$forms[ta].isSubmitting=!0,l.$forms[ta].isSending=!1,R(c,M,W,g,function(Fa){triggerEvent(gina,c,'validate.'+e,Fa)}))})};ha=null;b=[];ha=[];A=null;ha=c.getElementsByTagName('button');if(0<ha.length)for(let T=0,J=ha.length;T<J;++T)'submit'==ha[T].type&&b.push(ha[T]);ha=c.getElementsByTagName('a');if(0<ha.length)for(let T=0,J=ha.length;T<J;++T)ha[T].attributes.getNamedItem('data-gina-form-submit')?b.push(ha[T]):ha[T].getAttribute('id')||/gina\-popin/.test(ha[T].className)||gina.popinIsBinded||/gina\-link/.test(ha[T].className)||
|
|
398
|
-
(A='link.'+X.v4(),ha[T].id=A);A=null;S=!1;for(let T=0,J=b.length;T<J;++T){ha=b[T];if(/button/i.test(ha.tagName)&&'undefined'!=typeof ha.type&&/submit/i.test(ha.type)||/a/i.test(ha.tagName)&&'undefined'!=typeof ha.dataset.ginaFormSubmit&&/^true$/i.test(ha.dataset.ginaFormSubmit)||/a/i.test(ha.parentNode.tagName)&&'undefined'!=typeof ha.parentNode.dataset.ginaFormSubmit&&/^true$/i.test(ha.parentNode.dataset.ginaFormSubmit)){/a/i.test(ha.parentNode.tagName)&&(ha=ha.parentNode);if('undefined'==typeof ha.id||
|
|
399
|
-
'undefined'!=typeof ha.id&&''==ha.id)ha.id='click.'+X.v4(),ha.setAttribute('id',ha.id);/a/i.test(ha.tagName)&&'undefined'==typeof ha.form&&(ha.form={id:a.id});'undefined'==typeof ha.dataset.ginaFormSubmitTriggerFor&&'undefined'!=typeof l.$forms[a.id]&&'undefined'==typeof l.$forms[a.id].submitTrigger&&'undefined'!=typeof ha.form.id&&a.id==ha.form.id&&(l.$forms[a.id].submitTrigger=a.submitTrigger=ha.id||ha.getAttribute('id'),ha.dataset.ginaFormSubmitTriggerFor=a.id)}'A'==ha.tagName&&(A=ha.getAttribute('onclick'),
|
|
400
|
-
S=ha.getAttribute('data-gina-form-submit'),A||S?/return false/i.test(A)||S||(A=/;$/.test(A)?A+'return false;':A+'; return false;'):ha.setAttribute('onclick','return false;'));ha.id?G=ha.id:(G='click.'+X.v4(),ha.id=G,ha.setAttribute('id',G));'undefined'!=typeof gina.events[G]&&gina.events[G]==ha.id||Ea(G,ha)}G='submit';addListener(gina,c,G,function(T){var J=T.target,M=J.getAttribute('id'),W=l.$forms[M],ta=a.binded;(W=(new DOMParser).parseFromString(J.innerHTML,'text/html').getElementById(W.submitTrigger))&&
|
|
401
|
-
W.disabled&&cancelEvent(T);if('undefined'!=typeof T.defaultPrevented&&T.defaultPrevented)return!1;(q||ta)&&cancelEvent(T);T={};ta={_length:0};W='undefined'!=typeof gina.validator.$forms[M]?gina.validator.$forms[M].rules:null;for(var Aa=null,Fa=null,sa=0,Sa=J.length;sa<Sa;++sa)Aa=J[sa].getAttribute('name'),Fa=J[sa].disabled||J[sa].getAttribute('disabled'),Fa=/disabled|true/i.test(Fa)?!0:!1,Aa&&!Fa&&('undefined'!=typeof J[sa].type&&'radio'==J[sa].type||'undefined'!=typeof J[sa].type&&'checkbox'==J[sa].type?
|
|
402
|
-
J[sa].checked?/^(true|false)$/.test(J[sa].value)?ta[Aa]=J[sa].value=/^true$/.test(J[sa].value)?!0:!1:ta[Aa]=J[sa].value:W&&'undefined'!=typeof W[Aa]&&'undefined'!=typeof W[Aa].isBoolean&&'checkbox'==J[sa].type&&!/^(true|false)$/.test(J[sa].value)&&(ta[Aa]=!1):ta[Aa]=J[sa].value,T[Aa]=J[sa],T[Aa].setAttribute('data-gina-form-errors',''));ta._length=ta.count();0==ta._length?(delete ta._length,T={error:[],isValid:function(){return!0},data:ra(ta)},'undefined'!=typeof gina.events['submit.'+M]?triggerEvent(gina,
|
|
403
|
-
J,'submit.'+M,T):triggerEvent(gina,J,'validate.'+M,T)):(g=(W=J.getAttribute('data-gina-form-rule'))?Ba(W.replace(/\-|\//g,'.')):Ba(M.replace(/\-/g,'.')),l.$forms[M].isValidating=!0,R(J,ta,T,g,function(Ia){l.$forms[M].isValidating=!1;'undefined'!=typeof gina.events['submit.'+M]?triggerEvent(gina,J,'submit.'+M,Ia):triggerEvent(gina,J,'validate.'+M,Ia)}))});l.$forms[e].binded=!0;/^(true)$/i.test(a.target.dataset.ginaFormLiveCheckEnabled&&0<a.rules.count())?(console.debug('silent validation mode on'),
|
|
404
|
-
Ea=$a(a.target,a.rules),R(a.target,Ea.fields,Ea.$fields,a.rules,function(T){console.debug('silent validation result[isValid:'+T.isValid()+']: ',T);B&&H&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&(gina.forms.errors||(gina.forms.errors={}),window.ginaToolbar.update('forms',{id:e,errors:T.error}));Va(a,T.isValid())})):/^(true)$/i.test(a.target.dataset.ginaFormLiveCheckEnabled)||Va(a,!0)},Va=function(c,b){$formInstance=null;c instanceof HTMLFormElement?(c=c.getAttribute('id'),$formInstance=
|
|
405
|
-
l.$forms[c]):$formInstance=c;'undefined'==typeof $formInstance.submitTrigger&&/^(true)$/i.test($formInstance.target.dataset.ginaFormLiveCheckEnabled)?console.warn('This might be normal, so do not worry if this form is handled by your javascript: `'+$formInstance.id+'`\nGina could not complete `updateSubmitTriggerState()`: `submitTrigger` might not be attached to form instance `'+$formInstance.id+'`\nTo disable this warning, You just need to disable `Form Live Checking on your form by adding to your <form>: `data-gina-form-live-check-enabled=false``'):
|
|
406
|
-
document.getElementById($formInstance.submitTrigger)&&(/^true$/i.test(b)||!/^(true)$/i.test($formInstance.target.dataset.ginaFormLiveCheckEnabled)?document.getElementById($formInstance.submitTrigger).disabled=!1:document.getElementById($formInstance.submitTrigger).disabled=!0)},$a=function(c,b,a){'undefined'==typeof a&&(a=!1);var e={},n={},q=c.id||c.getAttribute('id');'undefined'==typeof b&&(b='undefined'!=typeof l.$forms[q].rules&&0<l.$forms[q].rules.count()?l.$forms[q].rules:null,b||'undefined'==
|
|
407
|
-
typeof gina.validator.$forms[q]||(b=gina.validator.$forms[q].rules));for(var g=0,G=c.length;g<G;++g){if(a)switch(c[g].tagName.toLowerCase()){case 'input':/^(hidden|text)$/i.test(c[g].type)&&(c[g].value=c[g].defaultValue)}if(/button/i.test(c[g].tagName)&&'undefined'!=typeof c[g].type&&/submit/i.test(c[g].type)||/a/i.test(c[g].tagName)&&'undefined'!=typeof c[g].dataset.ginaFormSubmit&&/^true$/i.test(c[g].dataset.ginaFormSubmit))/a/i.test(c[g].tagName)&&'undefined'==typeof c[g].form&&(c[g].form={id:q}),
|
|
408
|
-
'undefined'==typeof c[g].dataset.ginaFormSubmitTriggerFor&&'undefined'!=typeof l.$forms[q]&&'undefined'==typeof l.$forms[q].submitTrigger&&'undefined'!=typeof c[g].form.id&&q==c[g].form.id&&(l.$forms[q].submitTrigger=c[g].id||c[g].getAttribute('id'),c[g].dataset.ginaFormSubmitTriggerFor=q);var A=c[g].getAttribute('name');var ca=c[g].disabled||c[g].getAttribute('disabled');ca=/disabled|true/i.test(ca)?!0:!1;if(A&&!ca){if('undefined'!=typeof c[g].type&&'radio'==c[g].type||'undefined'!=typeof c[g].type&&
|
|
409
|
-
'checkbox'==c[g].type)if(c[g].checked||'undefined'==typeof b[A]&&'undefined'!=c[g].value&&/^(true|false)$/.test(c[g].value)||!c[g].checked&&'undefined'!=typeof b[A]&&'undefined'!=typeof b[A].isBoolean&&/^(true|false)$/.test(c[g].value))if(/^(true|false)$/.test(c[g].value))if('undefined'==typeof b[A]?b[A]={isBoolean:!0}:'undefined'!=typeof b[A]&&'undefined'==typeof b[A].isBoolean&&(b[A].isBoolean=!0,b[A].isRequired=!0),'radio'==c[g].type){if('undefined'==typeof b[A])throw Error('rule '+A+' is not defined');
|
|
410
|
-
/^true$/.test(b[A].isBoolean)&&c[g].checked&&(n[A]=/^true$/.test(c[g].value)?!0:!1)}else n[A]=c[g].value=/^true$/.test(c[g].value)?!0:!1;else n[A]=c[g].value;else b&&'undefined'!=typeof b[A]&&'undefined'!=typeof b[A].isBoolean&&'undefined'!=typeof b[A].isRequired&&!/^(true|false)$/.test(c[g].value)&&(n[A]=!1);else n[A]=c[g].value;'undefined'==typeof e[A]&&(e[A]=c[g],e[A].setAttribute('data-gina-form-errors',''))}}n._length=n.count()||0;return{$fields:e,fields:n,rules:b}},gb=function(c,b,a,e){return'undefined'==
|
|
411
|
-
typeof c[a]||/^(null|NaN|undefined|\s*)$/i.test(b[a])?b[a]:'undefined'!=typeof c[a].isNumber||'undefined'!=typeof c[a].isInteger||'undefined'!=typeof c[a].isFloat||'undefined'!=typeof c[a].toFloat||'undefined'!=typeof c[a].toInteger?(/,/.test(b[a])&&(b[a]=b[a].replace(/,/g,'.').replace(/\s+/g,'')),b[a]):'boolean'==typeof b[a]?b[a]:c[a].isBoolean?/^true$/i.test(b[a])?!0:!1:'undefined'!=typeof e&&/^true$/i.test(e)?'\\"'+b[a]+'\\"':b[a]},hb=function(c,b){'string'!=typeof c&&(c=JSON.stringify(JSON.clone(c)));
|
|
412
|
-
c=JSON.parse(c.replace(/"(true|false)"/gi,'$1'));for(let a in b)b[a]=gb(c,b,a);return b},kb=function(c,b,a,e){var n=JSON.parse(c.replace(/"(true|false)"/gi,'$1')),q=JSON.stringify(n);e&&(b=a[Object.getOwnPropertyNames(a)[0]].form,a=$a(b,n),delete a.fields._length,b=a.fields,a=a.$fields);e=[];var g=0;for(G in b)e[g]=G,g++;e.sort().reverse();for(let ca=0,la=e.length;ca<la;ca++){var G=e[ca].replace(/\-|_|@|#|\.|\[|\]/g,'\\$&');G=new RegExp('\\$'+G,'g');g='\\"'+b[e[ca]]+'\\"';var A=G.test(q);A&&'undefined'!=
|
|
413
|
-
typeof n[e[ca]]?g=gb(n,b,e[ca],!0):A&&console.warn('`'+e[ca]+'` is used in a dynamic rule without definition. This could lead to an evaluation error. Casting `'+e[ca]+'` to `string`.');c=c.replace(G,g)}if(/\$(.*)/.test(c))for(let ca=0,la=e.length;ca<la;ca++)G=e[ca].replace(/\-|_|@|#|\.|\[|\]/g,'\\$&'),G=new RegExp('\\$'+G,'g'),g=''!=a[e[ca]].value?'\\"'+a[e[ca]].value+'\\"':'\\"\\"',(A=G.test(q))&&'undefined'!=typeof n[e[ca]]?g=gb(n,b,e[ca],!0):A&&console.warn('`'+e[ca]+'` is used in a dynamic rule without definition. This could lead to an evaluation error. Casting `'+
|
|
414
|
-
e[ca]+'` to `string`.'),c=c.replace(G,g||a[e[ca]].checked);return JSON.parse(c)},R=function(c,b,a,e,n){delete b._length;var q=JSON.stringify(e);b=hb(q,b);/\$(.*)/.test(q)&&(e=!/^form$/i.test(c.tagName)&&1==a.count()&&/true/i.test(c.form.dataset.ginaFormLiveCheckEnabled)?!0:!1,e=kb(q,b,a,e));var g=null,G=q=null,A=!1,ca=0;b.count();var la=!1,ha=null,va=null,ma=null,x=0,V=null,da=null,S=null,ea=function(ya,Ea,T){if('undefined'==typeof Ea[ya]){skipTest=!1;for(var J in Ea)if(!/^_comment$/i.test(J)&&/^\//.test(J)&&
|
|
415
|
-
(V=J.match(/\/(.*)\//).pop(),da=J.replace('/'+V+'/',''),V=V.replace(/\[/g,'\\[').replace(/\]/g,'\\]'),V=new RegExp(V,da),V.test(ya))){skipTest=!0;Ea[ya]=Ea[J];break}if('undefined'==typeof Ea[ya])return}var M=Object.getOwnPropertyNames(Ea)||[];J=0;var W=M.length;if(0<W)for(;J<W;)'undefined'!=typeof Ea[M[J]].exclude&&/^true$/i.test(Ea[M[J]].exclude)&&(M.splice(J,1),W--,J--),J++;for(var ta in Ea[ya])if('function'==typeof ka[ya][ta]){/^((is)\d+|is$)/.test(ta)&&'undefined'==typeof ka[ya][ta]&&(ka[ya][ta]=
|
|
416
|
-
function(){},ka[ya][ta]=C(ka[ya][ta],ka[ya][ta.replace(/\d+/,'')]),ka[ya][ta].setAlias=function(Ia){this._currentValidatorAlias=Ia}(ta));try{if(Array.isArray(Ea[ya][ta])){S=JSON.clone(Ea[ya][ta]);if(/\$[\-\w\[\]]*/.test(S[0])){var Aa=S[0].match(/\$[\-\w\[\]]*/g);J=0;for(var Fa=Aa.length;J<Fa;++J)S[0]=S[0].replace(Aa[J],ka[Aa[J].replace('$','')].value)}ka[ya][ta].apply(ka[ya],S)}else if(/^query$/.test(ta)){ha=a[ya];va=ha.getAttribute('id');ma='asyncCompleted.'+va;var sa=0,Sa=!1;if('undefined'!=typeof gina.events[ma]){console.debug('event `'+
|
|
417
|
-
ma+'` already added');x=0;break}++x;addListener(gina,ha,ma,function(Ia){Ia.preventDefault();sa++;--x;var Da=Object.getOwnPropertyNames(Ea[ya]);Da[Da.length-1]==ta&&(la=!0);Da='asyncCompleted.'+Ia.target.getAttribute('id');if(!/true/.test(Sa)){ka[ya]=Ia.detail;var Ga=c;/^form$/i.test(c.tagName)||(Ga=c.form);var Na=Ga.getAttribute('id'),Ja=null;if(la&&0>=x&&!Sa&&(Sa=!0,removeListener(gina,Ia.target,Da),n._data=ka.toData(),n._errors=ka.getErrors(ya),n._errors&&0<n._errors.count())){'undefined'==typeof l.$forms[Na].errors&&
|
|
418
|
-
(l.$forms[Na].errors={});'undefined'!=typeof n._errors[ya]&&(l.$forms[Na].errors[ya]=n._errors[ya]);console.debug('[A] Refreshing warning/error on field '+ya);if(!Ja&&/^true|false$/i.test(l.$forms[Na].isValidating)||''!=ka[ya].target.value)z(Qa[ya]),N(Ga,n._errors,n._data,ya),Va(Ga,Ja);B&&H&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&(gina.forms.errors||(gina.forms.errors={}),window.ginaToolbar.update('forms',{id:Na,errors:l.$forms[Na].errors||{}}));triggerEvent(gina,Ga,'validated.'+
|
|
419
|
-
Na,n);return}Ia=!1;1==M.length||M[M.length-1]==ya?(Ja=0<n._errors.count()?!1:!0,!Ja&&/^true|false$/i.test(l.$forms[Na].isValidating)&&(console.debug('[1] Should update error display now ',n._errors),l.$forms[Na].errors=D(n._errors,l.$forms[Na].errors),z(Qa[ya]),N(Ga,n._errors,n._data,ya),Va(Ga,Ja)),triggerEvent(gina,Ga,'validated.'+Na,n)):/^true$/i.test(l.$forms[Na].isValidating)&&1<M.length&&M[M.length-1]!=ya&&(Ia=!0);Ia&&R(Ga,Oa,Qa,Ea,function(bb){l.$forms[Na].isValidating=!1;Ja=bb.isValid();B&&
|
|
420
|
-
H&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&(gina.forms.errors||(gina.forms.errors={}),window.ginaToolbar.update('forms',{id:Na,errors:bb.error||{}}));N(Ga,bb.error,bb.data,ya);Va(Ga,Ja)})}});ka[ya][ta](Ea[ya][ta]);continue}else ka[ya][ta](Ea[ya][ta]);delete T[ya]}catch(Ia){if('conditions'==ta)throw Error('[ ginaFormValidator ] could not evaluate `'+ya+'->'+ta+'()` where `conditions` must be a `collection` (Array)\nStack:\n'+Ia);throw Error('[ ginaFormValidator ] could not evaluate `'+
|
|
421
|
-
ya+'->'+ta+'()`\nStack:\n'+Ia);}}},ka=null,wa={},Ca=!1;H?/^form$/i.test(c.tagName)?(g=c.getAttribute('id'),q='validated.'+g,l.$forms[g].fields=b,'undefined'!=typeof c.eventData&&'undefined'!=typeof c.eventData.error&&delete c.eventData.error,ka=new h(b,a,p)):(Ca=!0,g=c.form.getAttribute('id')||c.form.target.getAttribute('id'),q='validated.'+g,l.$forms[g].fields=b,ka=new h(b,a,p,l.$forms[g].fieldsSet)):ka=new h(b,null,p);var Oa=null,Qa=null;if(Ca){Ca=c.form.getAttribute('id');var Ya=$a(l.$forms[Ca].target,
|
|
422
|
-
l.$forms[Ca].rules,!1);Oa=hb(JSON.stringify(l.$forms[Ca].rules),JSON.clone(Ya.fields));Qa=Ya.$fields}else Oa=JSON.clone(b),Qa=a;Ca='undefined'!=typeof e?JSON.clone(e):{};var La=function(ya,Ea,T,J,M,W,ta,Aa){var Fa=null;if('undefined'!=typeof W)for(var sa in J){var Sa=M[sa].getAttribute('type');if(H&&'undefined'==typeof M[sa])console.warn('field `'+sa+'` found for your form rule ('+ya.id+'), but not found in $field collection.\nPlease, check your HTML or remove `'+sa+'` declaration from your rule if this is a mistake.');
|
|
423
|
-
else{H&&M[sa].getAttribute('data-gina-form-element-group')&&'undefined'!=typeof W[sa]&&'undefined'!=typeof W[sa].exclude&&W[sa].exclude&&!M[sa].disabled&&(W[sa].exclude=!1);var Ia='undefined'!=typeof W['_case_'+sa]?!0:!1;if(H&&'input'==M[sa].tagName.toLowerCase()&&/^(checkbox)$/i.test(Sa))if(!M[sa].checked&&'undefined'!=typeof W[sa]&&'undefined'!=typeof W[sa].isRequired&&/^(false)$/i.test(W[sa].isRequired)||M[sa].disabled)W[sa]={exclude:!0};else{if(!M[sa].checked&&'undefined'==typeof W[sa])continue}else H&&
|
|
424
|
-
'input'==M[sa].tagName.toLowerCase()&&/^(radio)$/i.test(Sa)&&console.debug('Radio: ',M[sa].id,M[sa].checked,M[sa].value);for(var Da in W)if(/^_case_/.test(Da)&&'undefined'!=typeof W[Da].conditions&&(!Array.isArray(W[Da].conditions)||W[Da].conditions.length)&&'undefined'!=typeof W[Da].conditions[0].rules&&'undefined'!=typeof W[Da].conditions&&Array.isArray(W[Da].conditions))if(Fa=Da.replace('_case_',''),'undefined'==typeof Qa[Fa])console.warn('Found case `'+Da+'` but field `'+Fa+'` is misssing in the dom.\n You should add `'+
|
|
425
|
-
Fa+'` element to your form in order to allow Validator to process this case.');else{'undefined'==typeof Ea[Fa]&&(Ea[Fa]=Qa[Fa].value);Sa=Ea[Fa];H&&('true'==J[sa]?Sa=!0:'false'==J[sa]&&(Sa=!1));for(var Ga=0,Na=W[Da].conditions.length;Ga<Na;++Ga)if(!(Array.isArray(W[Da].conditions[Ga].case)&&-1==W[Da].conditions[Ga].case.indexOf(Sa)||!Array.isArray(W[Da].conditions[Ga].case)&&W[Da].conditions[Ga].case!=Sa))for(var Ja in W[Da].conditions[Ga].rules)if(!/^_comment$/i.test(Ja)&&Ja!=Fa&&M[Ja])if(sa==Ja||
|
|
426
|
-
/^\//.test(Ja)||'undefined'!=typeof J[Ja]||'undefined'==typeof Ea[Ja])if(/^\//.test(Ja)){if(V=Ja.match(/\/(.*)\//).pop(),da=Ja.replace('/'+V+'/',''),V=V.replace(/\[/g,'\\[').replace(/\]/g,'\\]'),V=new RegExp(V,da),V.test(sa)){if(W[Da].conditions[Ga].case==Sa||/^\//.test(W[Da].conditions[Ga].case)&&(new RegExp(W[Da].conditions[Ga].case)).test(Sa))bb='undefined'!=typeof W[Ja]?W[Ja]:{},W[Ja]=D(W[Da].conditions[Ga].rules[Ja],bb);Fa!=Ja&&'undefined'!=typeof W[Ja]&&ea(Ja,W,J)}}else'undefined'!=typeof W[Da].conditions[Ga].rules[Ja]&&
|
|
427
|
-
(caseField=Ja,Sa=J[caseField],'undefined'==typeof M[caseField]?console.warn('ignoring case `'+caseField+'`: field `NaN'):(H&&/^(true|false)$/i.test(Sa)&&'undefined'!=typeof W[caseField]&&'undefined'!=typeof W[caseField].isBoolean&&/^(true)$/i.test(W[caseField].isBoolean)&&(Sa=/^(true)$/i.test(Sa)?!0:!1),'undefined'!=typeof W[Da].conditions[Ga].rules[Ja]&&(bb='undefined'!=typeof W[Da].conditions[Ga].rules[Ja]?W[Da].conditions[Ga].rules[Ja]:{},W[Ja]=bb),Fa!=Ja&&'undefined'!=typeof W[Ja]&&'undefined'!=
|
|
428
|
-
typeof J[Ja]&&ea(Ja,W,J)));else{J[Ja]=Ea[Ja];var bb='undefined'!=typeof W[Ja]?W[Ja]:{};W[Ja]=D(W[Da].conditions[Ga].rules[Ja],bb);ea(Ja,W,J)}}if(Fa!=sa&&('undefined'!=typeof W[sa]&&ea(sa,W,Ea),Ia)){++Aa;Ia=W['_case_'+sa].conditions;if(!Ia)throw Error('[ ginaFormValidator ] case `_case_'+sa+'` found without `condition(s)` !\nPlease, check your delcaration for `_case_'+sa+'`');for(let ab=0,fb=Ia.length;ab<fb;++ab)if(Sa=Ea[sa],H&&('true'==J[sa]?Sa=!0:'false'==J[sa]&&(Sa=!1)),Ia[ab]['case']===Sa||Array.isArray(Ia[ab]['case'])&&
|
|
429
|
-
-1<Ia[ab]['case'].indexOf(Sa)||/^\//.test(Ia[ab]['case'])){bb={};if('undefined'==typeof Ia[ab].rules[sa]&&'undefined'==typeof Ea[sa]||M[sa].disabled)Ia[ab].rules[sa]={exclude:!0};for(var Wa in Ia[ab].rules)if(!/^_comment$/i.test(Wa))if(/^\//.test(Wa)){V=Wa.match(/\/(.*)\//).pop();da=Wa.replace('/'+V+'/','');V=V.replace(/\[/g,'\\[').replace(/\]/g,'\\]');V=new RegExp(V,da);for(var Za in M)V.test(Za)&&(/^\//.test(Ia[ab]['case'])?(V=Ia[ab]['case'].match(/\/(.*)\//).pop(),da=Ia[ab]['case'].replace('/'+
|
|
430
|
-
V+'/',''),V=new RegExp(V,da),V.test(Sa)&&(bb[Za]=Ia[ab].rules[Wa])):bb[Za]=Ia[ab].rules[Wa],'undefined'==typeof J[Za]&&'undefined'!=typeof M[Za]&&'undefined'!=typeof M[Za].value&&(J[Za]=M[Za].value,H&&/(true|false)/i.test(J[Za])&&('true'==J[Za]?J[Za]=!0:'false'==J[Za]&&(J[Za]=!1)),ka.addField(Za,J[Za]),'undefined'!=typeof T[Za]&&(bb[Za]=D(bb[Za],T[Za]))))}else/^\//.test(Ia[ab]['case'])?(V=Ia[ab]['case'].match(/\/(.*)\//).pop(),da=Ia[ab]['case'].replace('/'+V+'/',''),V=V.replace(/\[/g,'\\[').replace(/\]/g,
|
|
431
|
-
'\\]'),V=new RegExp(V,da),V.test(Sa)&&(bb[Wa]=Ia[ab].rules[Wa])):bb[Wa]=Ia[ab].rules[Wa],'undefined'==typeof J[Wa]&&'undefined'!=typeof M[Wa]&&'undefined'!=typeof M[Wa].value&&(J[Wa]=M[Wa].value,H&&/(true|false)/i.test(J[Wa])&&('true'==J[Wa]?J[Wa]=!0:'false'==J[Wa]&&(J[Wa]=!1)),ka.addField(Wa,J[Wa]),'undefined'!=typeof T[Wa]&&(bb[Wa]=D(bb[Wa],T[Wa])));++ca;if(H)La(ya,Ea,T,J,M,bb,ta,Aa);else return La(ya,Ea,T,J,M,bb,ta,Aa)}--Aa}}}--ca;if(0>=Aa&&0>ca){Ea=ka.getErrors();for(sa in Ea){for(rule in Ea[sa])wa[sa]||
|
|
432
|
-
(wa[sa]=''),0>wa[sa].indexOf(rule)&&(wa[sa]+=rule+' ');H&&M[sa].setAttribute('data-gina-form-errors',wa[sa].substring(0,wa[sa].length-1))}try{G=ra(ka.toData()),B&&H&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&(gina.forms.validated||(gina.forms.validated={}),gina.forms.validated[g]||(gina.forms.validated[g]={}),window.ginaToolbar.update('forms',{id:g,validated:G}))}catch(ab){throw ab;}la=!0;if(!A&&0>=x)if('undefined'!=typeof ta&&'function'===typeof ta)ta._errors=ka.getErrors(),ta._data=
|
|
433
|
-
ka.toData(),triggerEvent(gina,ya,'validated.'+g,ta);else return A=!0,{isValid:ka.isValid,error:Ea,data:G}}};H&&addListener(gina,c,q,function(ya){ya.preventDefault();if(!A){A=!0;la=!1;x=0;var Ea=ya.detail,T=Ea._data||ka.toData(),J=Ea._errors||ka.getErrors()||null;console.debug('instance errors: ',l.$forms[g].errors,' VS cbErrors: ',J,ka.isValid(),' VS d.getErrors(): ',ka.getErrors());0<J.count()&&ka.isValid()&&(ka.isValid=function(){return!1});Ea({isValid:ka.isValid,error:J,data:ra(T)});removeListener(gina,
|
|
434
|
-
ya.target,'validated.'+ya.target.id)}});if(H)La(c,Oa,Ca,b,a,e,n,0);else return La(c,Oa,Ca,b,a,e,n,0)};return H?xa(v):f(v,L,I)}'undefined'!==typeof module&&module.exports?module.exports=ValidatorPlugin:'function'===typeof define&&define.amd&&define('gina/validator','utils/events utils/dom utils/effects utils/data lib/form-validator lib/routing'.split(' '),function(){return ValidatorPlugin});
|
|
435
|
-
define('gina/popin',['require','lib/domain','lib/merge','utils/events'],function(v){var L=v('lib/domain'),I=null,O=v('lib/merge');v('utils/events');return function(H){function B(){var E=null,P;for(P in gina.popin.$popins)if('undefined'!=typeof gina.popin.$popins[P].isOpen&&gina.popin.$popins[P].isOpen){E=gina.popin.$popins[P];break}!E&&gina.popin.activePopinId&&(E=gina.popin.$popins[gina.popin.activePopinId]);return E}function X(E,P){var K=E.target,qa=E.type;'undefined'!=typeof E.detail&&'function'==
|
|
436
|
-
typeof E.detail.trim&&(K.innerHTML=E.detail.trim());E=function(Ua,Xa,Ra){var db=Ra.getAttribute('data-gina-popin-is-link');db=/^true$/i.test(db)?!0:!1;'link'!=Ua||db||(Ua='action');addListener(gina,Ra,Xa,function(Ma){cancelEvent(Ma);if('close'!=Ua){var Va=!1,$a='loaded.'+P.id;'undefined'==typeof gina.events[$a]&&addListener(gina,K,$a,function(gb){gb.preventDefault();Va||(Va=!0,h(gb.detail))});$a={isSynchrone:!1,withCredentials:!1};$a=O(P.options,$a);C(P.name,Ra.href,$a)}removeListener(gina,Ma.target,
|
|
437
|
-
Ma.type)});addListener(gina,Ra,'click',function(Ma){cancelEvent(Ma);if(null!=Ma.target.getAttribute('disabled')&&'false'!=Ma.target.getAttribute('disabled'))return!1;if('link'==Ua){var Va=Ma.target.getAttribute('href')||null,$a=Ma.target.getAttribute('target');null!=$a&&''!=$a?window.open(Va,$a):triggerEvent(gina,Ma.target,Ma.currentTarget.id,P)}else'undefined'==typeof Ma.target.id&&(Ma.target.setAttribute('id',Xa+'.'+crypto.randomUUID()),Ma.target.id=Ma.target.getAttribute('id')),/^popin\.close\./.test(Ma.target.id)&&
|
|
438
|
-
(cancelEvent(Ma),P.isRedirecting=!1,F(P.name)),/^popin\.click\./.test(Ma.target.id)&&(cancelEvent(Ma),Va=Ma.target.id,(new RegExp('^popin.click.gina-popin-'+f.id)).test(Va)&&triggerEvent(gina,Ma.target,Va,Ma.detail))})};gina.popinIsBinded=!0;var U=null,fa=null,aa=null;if(!P.isOpen&&p.options.cancelOnOverlayClick){var oa=P.target;if(!p.options.useDialogMode||gina.config.envIsDev)oa=f.target.childNodes[0];addListener(gina,oa,'mousedown',function(Ua){if(/gina-popin-is-active/.test(Ua.target.className)){removeListener(gina,
|
|
439
|
-
Ua.target,'mousedown');Ua=[];U=0;var Xa=K.getElementsByTagName('button');fa=0;aa=Xa.length;if(0<aa)for(;fa<aa;++fa)/gina-popin-close/.test(Xa[fa].className)&&(Ua[U]=Xa[fa],++U);Xa=K.getElementsByTagName('div');fa=0;aa=Xa.length;if(0<aa)for(;fa<aa;++fa)/gina-popin-close/.test(Xa[fa].className)&&(Ua[U]=Xa[fa],++U);Xa=K.getElementsByTagName('a');fa=0;aa=Xa.length;if(0<aa)for(;fa<aa;++fa)/gina-popin-close/.test(Xa[fa].className)&&(Ua[U]=Xa[fa],++U);fa=0;for(aa=Ua.length;fa<aa;++fa){Xa=Ua[fa];let Ra=Xa.getAttribute('id');
|
|
440
|
-
for(let db=0,Ma=u.length;db<Ma;db++){let Va=u[db];'undefined'!=typeof gina.events[Va]&&gina.events[Va]==Ra&&removeListener(gina,Xa,Va);'undefined'!=typeof gina.events[Ra]&&gina.events[Ra]==Ra&&removeListener(gina,Xa,Ra);'undefined'!=typeof gina.events[Va+'.'+Ra]&&gina.events[Va+'.'+Ra]==Ra&&removeListener(gina,Xa,Va+'.'+Ra);'undefined'!=typeof gina.events[Va+'.'+Ra]&&gina.events[Va+'.'+Ra]==Va+'.'+Ra&&removeListener(gina,Xa,Va+'.'+Ra)}}P.isRedirecting=!1;F(P.name)}})}/<form/i.test(K.innerHTML)&&'undefined'!=
|
|
441
|
-
typeof m&&m&&(P.hasForm=!0);var xa=[],ja=[];oa=[];ja=K.getElementsByTagName('button');fa=U=0;aa=ja.length;if(0<ja.length)for(;fa<aa;++fa)/gina-popin-close/.test(ja[fa].className)&&(xa[U]=ja[fa],++U);ja=K.getElementsByTagName('div');fa=0;aa=ja.length;if(0<aa)for(;fa<aa;++fa)/gina-popin-close/.test(ja[fa].className)&&(xa[U]=ja[fa],++U);ja=K.getElementsByTagName('a');fa=0;aa=ja.length;if(0<aa)for(;fa<aa;++fa)/gina-popin-close/.test(ja[fa].className)?(xa[U]=ja[fa],++U):('undefined'==typeof ja[fa]||/(#|#.*)$/.test(ja[fa].href)||
|
|
442
|
-
ja[fa].id)&&('undefined'==typeof ja[fa]||/(#|#.*)$/.test(ja[fa].href)||/^(click\.|popin\.link)/.test(ja[fa].id))||oa.push(ja[fa]);var Ba=null;ja=null;fa=0;for(aa=xa.length;fa<aa;++fa)'A'==xa[fa].tagName&&(Ba=xa[fa].getAttribute('onclick')),Ba?'undefined'==typeof Ba||/return false/.test(Ba)||(Ba=/;$/.test(Ba)?Ba+'return false;':Ba+'; return false;'):xa[fa].setAttribute('onclick','return false;'),xa[fa].id?ja=xa[fa].id:(ja='popin.close.'+crypto.randomUUID(),xa[fa].id=ja,xa[fa].setAttribute('id',ja)),
|
|
443
|
-
'undefined'!=typeof gina.events[ja]&&gina.events[ja]==xa[fa].id||E('close',ja,xa[fa]);U=0;aa=oa.length;var ra=null,Ka=null,pa=null,ua={},za=null,Ta=new DOMParser,Ha=null,Pa=null;for(ja=xa=xa=null;U<aa;++U)null==oa[U].getAttribute('disabled')&&(oa[U].id=/^null$/i.test(oa[U].getAttribute('id'))?null:oa[U].getAttribute('id'),oa[U].id&&/^popin\.link/.test(oa[U].id)&&/^popin\.click/.test(oa[U].id)?ja=oa[U].id:(ja=!0,xa=oa[U].getAttribute('href'),xa&&''!=xa&&'#'!=xa||('#'!=xa&&oa[U].setAttribute('href',
|
|
444
|
-
'#'),ja=!1),/^null$/i.test(oa[U].id)?ja?(ja='popin.link.'+crypto.randomUUID(),oa[U].setAttribute('data-gina-popin-is-link',!0)):(ja='popin.click.'+crypto.randomUUID(),oa[U].setAttribute('data-gina-popin-is-link',!1)):ja=oa[U].id,oa[U].id=ja,oa[U].setAttribute('id',ja)),xa=(xa=oa[U].getAttribute('data-gina-form-submit'))&&/^true$/i.test(xa)?!0:!1,xa||(/^(null|\s*)$/.test(oa[U].getAttribute('href'))||addListener(gina,oa[U],'click',function(Ua){Ua.preventDefault();P.isRedirecting=!0;if(P.hasForm){ra=
|
|
445
|
-
P.target.getElementsByTagName('FORM');Ka=0;for(pa=ra.length;Ka<pa;++Ka)if(Ha=Ua.currentTarget.id,Pa=Ta.parseFromString(ra.item(Ka).innerHTML,'text/html').getElementById(Ha)||!1)za=ra[Ka].getAttribute('data-gina-form-inherits-data')||null,ua=O(ua,JSON.parse(decodeURIComponent(za)));0<ua.count()&&(/\?/.test(Ua.currentTarget.href)?Ua.currentTarget.href+='&inheritedData='+encodeRFC5987ValueChars(JSON.stringify(ua)):Ua.currentTarget.href+='?inheritedData='+encodeRFC5987ValueChars(JSON.stringify(ua)))}}),
|
|
446
|
-
'undefined'!=typeof gina.events[ja]&&gina.events[ja]==oa[U].id||E('link',ja,oa[U])));if(P.hasForm)for(E=null,oa=K.getElementsByTagName('form'),U=0,aa=oa.length;U<aa;++U)oa[U].id&&'string'==typeof oa[U]?E=oa[U].id:(E=oa[U].getAttribute('id')||'form.'+crypto.randomUUID(),oa[U].setAttribute('id',E),oa[U].id=E),0>P.$forms.indexOf(E)&&P.$forms.push(E),oa[U].close=F,m.isPopinContext=!0,m.validateFormById(oa[U].getAttribute('id')),removeListener(gina,P.target,qa)}function D(E,P){var K=B();if(gina&&'undefined'!=
|
|
447
|
-
typeof window.ginaToolbar&&window.ginaToolbar&&'undefined'!=typeof E&&'undefined'!=typeof P&&E){K=E;try{var qa=null;!P&&K.error&&/^(\{|\[)/.test(K.error)&&(K.error=JSON.parse(K.error));if('undefined'!=typeof K.error&&'object'==typeof K.error&&'object'==typeof K.error){qa={status:K.status};for(xErr in K.error)/^error$/.test(xErr)||(qa[xErr]=K.error[xErr]);qa.error=K.error.error;K=qa}else'undefined'!=typeof K.error&&'string'==typeof K.error&&(K=E);K.isXHRViewData=!0;ginaToolbar.update('data-xhr',K);
|
|
448
|
-
return}catch(U){throw U;}}try{K=N(f.activePopinId)}catch(U){K&&ginaToolbar.update('data-xhr',U)}K||(new DOMParser).parseFromString(E,'text/html').getElementsByClassName('popin')[0]||(new DOMParser).parseFromString(E,'text/html').getElementsByTagName('div');K='string'==typeof E&&/<(.*)>/.test(E)?(new DOMParser).parseFromString(E,'text/html').getElementById('gina-without-layout-xhr-data'):document.getElementById('gina-without-layout-xhr-data');if(gina&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&
|
|
449
|
-
K)try{'undefined'!=typeof K.value&&K.value&&(K=JSON.parse(decodeURIComponent(K.value)),K.isXHRViewData=!0,ginaToolbar.update('data-xhr',K))}catch(U){throw U;}E='string'==typeof E&&/<(.*)>/.test(E)?(new DOMParser).parseFromString(E,'text/html').getElementById('gina-without-layout-xhr-view'):document.getElementById('gina-without-layout-xhr-view');if(gina&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&E)try{'undefined'!=typeof E.value&&E.value&&(E=JSON.parse(decodeURIComponent(E.value)),
|
|
450
|
-
ginaToolbar.update('view-xhr',E))}catch(U){throw U;}}function C(E,P,K){if('undefined'==typeof E){if('undefined'==typeof this.name)throw Error('`$popin.name` needs to be defined !');E=this.name}else'undefined'==typeof this.name&&'undefined'!=E&&(this.name=E);var qa=Y(E),U=qa.id,fa=document.getElementById(qa.openTrigger)||null;gina.popin.activePopinId||(gina.popin.activePopinId=U);var aa=document.getElementById(U)||null;if(null==aa){var oa=null;p.options.useDialogMode?(oa=qa.options.class+' '+U,aa=
|
|
451
|
-
document.createElement('dialog'),aa.setAttribute('id',U),aa.setAttribute('class',oa),aa.setAttribute('data-type','modal'),aa.setAttribute('aria-labelledby',E),($overlay=document.getElementById('gina-popins-overlay'))?$overlay.appendChild(aa):f.target.appendChild(aa)):(oa=qa.options.class+' '+U,aa=document.createElement('div'),aa.setAttribute('id',U),aa.setAttribute('class',oa),f.target.firstChild.appendChild(aa))}'undefined'==typeof K?K=ba:(E=ba.withCredentials,K=O(K,ba),K.withCredentials=E);/^(http|https):/.test(P)&&
|
|
452
|
-
!(new RegExp('^'+window.location.protocol+'//'+window.location.host)).test(P)&&(E=I.getRootDomain(window.location.hostname).value,oa=I.getRootDomain(P).value,E=E===oa?!0:!1,gina.config.envIsDev&&(console.debug('Checking CORS from Popin plugin...TODO - local CORS Proxy'),console.debug('Is request from same domain ? ',E)),E||(P=P.match(/^(https|http):/)[0]+'//corsacme.herokuapp.com/?'+P,K.withCredentials=!1));K.url=P;qa.options=O(K,qa.options);var xa=null;K.withCredentials?'withCredentials'in w?K.isSynchrone?
|
|
453
|
-
w.open(K.method,K.url,K.isSynchrone):w.open(K.method,K.url):'undefined'!=typeof XDomainRequest?(w=new XDomainRequest,w.open(K.method,K.url)):(w=null,xa='CORS not supported: the server is missing the header `"Access-Control-Allow-Credentials": true` ',triggerEvent(gina,aa,'error.'+U,xa)):K.isSynchrone?w.open(K.method,K.url,K.isSynchrone):w.open(K.method,K.url);var ja=!1;if(w){w.withCredentials='undefined'!=typeof K.withCredentials?K.withCredentials:!1;w.onerror=function(ra,Ka){xa={status:w.status,
|
|
454
|
-
error:'Transaction error: might be due to the server CORS settings.\nPlease, check the console for more details.'};ja=!0;f.eventData.error=xa+'\n'+Ka;D(xa,ja);triggerEvent(gina,aa,'error.'+U,xa)};for(var Ba in K.headers)w.setRequestHeader(Ba,K.headers[Ba]);/^(1|3)$/.test(w.readyState)&&(qa.target.setAttribute('data-gina-popin-loading',!0),fa&&(/^A$/i.test(fa.tagName)?fa.setAttribute('aria-disabled',!0):fa.setAttribute('disabled',!0)));w.onreadystatechange=function(ra){/^(1|3)$/.test(w.readyState)&&
|
|
455
|
-
(qa.target.setAttribute('data-gina-popin-loading',!0),fa&&(/^A$/i.test(fa.tagName)?fa.setAttribute('aria-disabled',!0):fa.setAttribute('disabled',!0)));if(4==w.readyState)if(qa.target.removeAttribute('data-gina-popin-loading'),fa&&(/^A$/i.test(fa.tagName)?fa.removeAttribute('aria-disabled'):fa.removeAttribute('disabled')),ra=null,/^2/.test(w.status))try{ra=w.responseText;var Ka=w.getResponseHeader('Content-Type'),pa=/application\/json/.test(Ka)?!0:!1,ua=!0;pa&&(ra=JSON.parse(w.responseText),ra.status=
|
|
456
|
-
w.status,ra.contentType=Ka,ua=!1);f.eventData.success=ra;if(!pa&&qa.isOpen&&!qa.hasForm||!pa&&qa.isOpen&&ua)h(ra,ua);else{if(pa&&'undefined'!=typeof ra.location||pa&&'undefined'!=typeof ra.reload){Ka=!1;'undefined'!=typeof ra.isXhrRedirect&&/^true$/i.test(ra.isXhrRedirect)&&(Ka=!0);if('undefined'!=typeof ra.location&&Ka){if('undefined'!=typeof ra.popin&&'undefined'!=typeof ra.popin.close){qa.isRedirecting=!1;qa.close();var za=ra.popin.reload?ra.popin.reload:!1;ra.popin.location||ra.popin.url||(delete ra.popin,
|
|
457
|
-
za&&(ra.popin={reload:za}))}pa='_self';'undefined'!=typeof ra.target&&(ra.target='_'+ra.target,pa=ra.target);if(/^_self$/.test(pa))return pa=null,pa='undefined'!=typeof ra.popin?ra.popin.location||ra.popin.url:ra.location,qa.load(qa.name,pa,qa.options),setTimeout(function(Ta){Ta.isOpen||Ta.open()},50,qa);window.open(ra.location,pa);return}if('undefined'!=typeof ra.location){document.location=ra.location;return}if('undefined'!=typeof ra.reload){document.location.reload();return}'undefined'!=typeof ra.popin&&
|
|
458
|
-
'undefined'!=typeof ra.popin.close&&(qa.isRedirecting=!1,F(qa.name))}if(!pa){GINA_ENV_IS_DEV&&D(ra);triggerEvent(gina,aa,'loaded.'+U,ra);return}GINA_ENV_IS_DEV&&D(ra);triggerEvent(gina,$forms[0],'success.'+U,ra)}GINA_ENV_IS_DEV&&D(ra)}catch(Ta){ja=!1,ra={status:422,error:Ta.description||Ta.stack},/application\/json/.test(w.getResponseHeader('Content-Type'))&&(ra.error=JSON.parse(w.responseText),ja=!0),f.eventData.error=ra,GINA_ENV_IS_DEV&&D(ra,ja),triggerEvent(gina,aa,'error.'+U,ra)}else ja=!1,ra=
|
|
459
|
-
{status:w.status,error:w.responseText},/application\/json/.test(w.getResponseHeader('Content-Type'))&&(ra.error=JSON.parse(w.responseText),ja=!0),f.eventData.error=ra,GINA_ENV_IS_DEV&&D(ra,ja),triggerEvent(gina,aa,'error.'+U,ra)};w.send();return{open:function(){var ra=!1;addListener(gina,aa,'loaded.'+U,function(Ka){Ka.preventDefault();ra||(ra=!0,f.activePopinId=qa.id,X(Ka,qa),Z(qa.name))})}}}}function h(E,P){var K=B();if(K){if(!K.isOpen)throw Error('Popin `'+K.name+'` is not open !');K.isRedirecting=
|
|
460
|
-
'undefined'!=typeof P?P:!1;P=K.target;P.innerHTML=E.trim();na(K.name,!0);X({target:P,type:'loaded.'+K.id},K);if(!p.options.useDialogMode&&/safari/i.test(window.navigator.userAgent))for(E=document.getElementsByTagName('link'),P=0;P<E.length;P++)if('stylesheet'==E[P].getAttribute('rel')){var qa=E[P].getAttribute('href').split('?')[0];/gina\.min\.css|gina\.css/.test(qa)&&(qa=qa+'?version='+(new Date).getMilliseconds(),E[P].setAttribute('href',qa))}K.isRedirecting?triggerEvent(gina,f.target,'loaded.'+
|
|
461
|
-
K.id,K):triggerEvent(gina,f.target,'open.'+K.id,K);if(gina&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar)try{ginaToolbar.update('el-xhr',K.id)}catch(U){throw U;}}}function r(E){var P=setupXhr();P.open('GET',E,!0);P.setRequestHeader('Content-Type','text/javascript');P.onload=function(){eval(P.response)};P.send()}function l(E){var P=setupXhr();P.open('GET',E,!0);P.setRequestHeader('Content-Type','text/css');P.onload=function(){eval(P.response)};P.send()}function Z(E){var P='undefined'!=
|
|
462
|
-
typeof E?Y(E):N(this.id);if(!P)throw Error('Popin name `'+E+'` not found !');E=document.getElementById(P.id);var K=P.parentScripts,qa=E.getElementsByTagName('script'),U=P.parentStyles,fa=E.getElementsByTagName('link'),aa=0,oa=qa.length,xa=gina.config.hostname.replace(/(https|http|):\/\//,'').replace(/:\d+$/,'');for(xa=new RegExp(xa+':\\d+|'+xa);aa<oa;++aa){if('undefined'==typeof qa[aa].src||''==qa[aa].src)continue;let ja=qa[aa].src.replace(/(https|http|):\/\//,'').replace(xa,'');-1<K.indexOf(ja)||
|
|
463
|
-
r(qa[aa].src)}aa=0;for(oa=fa.length;aa<oa;++aa)'undefined'!=typeof fa[aa].href&&''!=fa[aa].href&&(K=fa[aa].href.replace(/(https|http|):\/\//,'').replace(xa,''),-1<U.indexOf(K)||l(fa[aa].href));X({target:E,type:'loaded.'+P.id},P);/gina-popin-is-active/.test(E.className)||(E.className+=' gina-popin-is-active');if(!p.options.useDialogMode||gina.config.envIsDev)/gina-popin-is-active/.test(f.target.firstChild.className)||(f.target.firstChild.className+=' gina-popin-is-active'),/gina-popin-is-active/.test(f.target.firstChild.className)&&
|
|
464
|
-
removeListener(gina,f.target,'open.'+P.id);p.options.useDialogMode&&!E.getAttribute('open')&&('function'===typeof E.showModal?gina.config.envIsDev?E.show():E.showModal():E.setAttribute('open',!0));P.isOpen=!0;P.target=E;f.activePopinId=P.id;if(gina&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar)try{ginaToolbar.update('el-xhr',P.id)}catch(ja){throw ja;}triggerEvent(gina,f.target,'open.'+P.id,P)}function na(E,P){var K='undefined'!=typeof E?Y(E):B();if(!K&&'undefined'!=typeof E)throw Error('Popin `'+
|
|
465
|
-
E+'` not found !');if('undefined'!=typeof K&&null!=K&&(E=K.target,P='undefined'!=typeof P?P:!1,null!=E&&/gina-popin-is-active/.test(E.className))){P||(f.target.firstChild.className=f.target.firstChild.className.replace(/\sgina-popin-is-active|gina-popin-is-active|gina-popin-is-active\s/,''),E.className=E.className.replace(/\sgina-popin-is-active|gina-popin-is-active|gina-popin-is-active\s/,''),E.innerHTML='');E.removeAttribute('data-gina-popin-loading');if(m&&(P=0,E=K.$forms.length,m.$forms&&0<E))for(;P<
|
|
466
|
-
E;++P)'undefined'!=typeof m.$forms[K.$forms[P]]&&m.$forms[K.$forms[P]].destroy(),K.$forms.splice(P,1);gina.popinIsBinded=!1;removeListener(gina,K.target,'loaded.'+K.id)}}function F(E){if('undefined'==typeof E&&/^true$/.test(this.isOpen)){E=this.name;var P=this}else{P=Y(E)||B();if(!P)return;E=P.name}if(!P&&'undefined'!=typeof E)throw Error('Popin `'+E+'` not found !');if(P.isOpen&&'undefined'!=typeof P&&null!=P&&!P.isRedirecting){var K=P.target;var qa=document.getElementById(P.openTrigger)||null;'function'===
|
|
467
|
-
typeof K.close?K.close():K.removeAttribute('open');removeListener(gina,P.target,'ready.'+f.id);P.hasForm&&(P.hasForm=!1);if(null!=K&&/gina-popin-is-active/.test(K.className)){na(E);P.isOpen=!1;gina.popinIsBinded=!1;GINA_ENV_IS_DEV&&gina&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&ginaToolbar.restore();f.activePopinId=null;if(0<P.$headers.length){E=0;var U=P.$headers.length;try{for(;E<U;++E)document.getElementById(P.$headers[E].id).remove()}catch(fa){console.warn('Could not remove script `'+
|
|
468
|
-
P.$headers[E].id+'`\n'+fa.stack)}P.$headers=[]}qa&&(/^A$/i.test(qa.tagName)?qa.removeAttribute('aria-disabled',!0):qa.removeAttribute('disabled',!0));K.removeAttribute('data-gina-popin-loading');triggerEvent(gina,P.target,'close.'+P.id,P)}}}this.plugin='popin';var u='init loaded ready open close click destroy success error progress'.split(' ');registerEvents(this.plugin,u);var p={options:{name:void 0,'class':'gina-popin-default',useDialogMode:!0,cancelOnOverlayClick:!1},authorizedEvents:['ready',
|
|
469
|
-
'error'],events:{}},f={plugin:this.plugin,id:'gina-popins-'+crypto.randomUUID(),on,eventData:{},$popins:{},activePopinId:null,getActivePopin:null,target:document,isReady:!1,initialized:!1},k={plugin:this.plugin,on,eventData:{},target:document,name:null,load:null,loadContent:null,open:null,isOpen:!1,isRedirecting:!1,close:null,$forms:[],hasForm:!1,$headers:[]},m=null,w=null,Q=[],z=function(){var E=document.createElement('div');E.id=f.id;E.setAttribute('id',f.id);E.setAttribute('class','gina-popins');
|
|
470
|
-
if(!p.options.useDialogMode||gina.config.envIsDev){var P=document.createElement('div');P.setAttribute('id','gina-popins-overlay');P.setAttribute('class','gina-popins-overlay');E.appendChild(P)}document.body.appendChild(E);f.target=E;f.on=on;gina.popinContainer=f.id},y=function(E,P,K){addListener(gina,E,'click',function(qa){cancelEvent(qa);triggerEvent(gina,P,K)})},N=function(E){return'undefined'!=typeof f.$popins[E]?f.$popins[E]:null},Y=function(E){var P=null,K;for(K in f.$popins)if(f.$popins[K].name===
|
|
471
|
-
E){P=f.$popins[K];break}return P},ia=function(E,P){P=getElementsByAttribute('data-gina-popin-name');var K=null,qa=null,U=null,fa=null,aa=null,oa=null,xa=null;oa=0;for(xa=P.length;oa<xa;++oa){K=P[oa];qa=K.getAttribute('data-gina-popin-name');'A'==K.tagName&&(fa=K.getAttribute('href'),''==fa||'#'==fa||/#/.test(fa))&&(fa=null);fa||'undefined'==typeof K.getAttribute('data-gina-popin-url')||(fa=K.getAttribute('data-gina-popin-url'));if(!fa)throw Error('Found `data-gina-popin-name` without `url` !');K.url||
|
|
472
|
-
(K.url=fa);K.popinName||(K.popinName=qa);if(qa==E.name&&(U=K.id||K.getAttribute('id')||null,aa='popin.click.gina-popin-'+f.id+'-'+crypto.randomUUID()+'-'+qa,U&&RegExp('^popin.click.gina-popin-').test(U)&&(aa=U),!gina.events[aa]&&(K.id=aa,K.setAttribute('id',aa),addListener(gina,K,aa,function(ja){cancelEvent(ja);E.openTrigger=ja.currentTarget.id||ja.currentTarget.getAttribute('id');var Ba=!1;addListener(gina,E.target,'loaded.'+E.id,function(Ka){Ka.preventDefault();Ba||(Ba=!0,console.debug('active popin should be ',
|
|
473
|
-
E.id),gina.popin.activePopinId=E.id,X(Ka,E),E.isOpen||Z(E.name))});ja={isSynchrone:!1,withCredentials:!1};ja=O(E.options,ja);var ra=this.getAttribute('data-gina-popin-url')||this.getAttribute('href');if(!ra)throw Error('Popin `url` not defined, please check value for `data-gina-popin-url`');C(E.name,ra,ja)}),qa=K.childNodes,U=0,lLen=qa.length,0<lLen)))for(;U<lLen;++U)'undefined'!=typeof qa[U].tagName&&y(qa[U],K,aa)}aa='click';addListener(gina,document,aa,function(ja){if(null!=ja.target.getAttribute('disabled')&&
|
|
474
|
-
'false'!=ja.target.getAttribute('disabled'))return!1;'undefined'==typeof ja.target.id&&(ja.target.setAttribute('id',aa+'.'+crypto.randomUUID()),ja.target.id=ja.target.getAttribute('id'));if(/^popin\.close\./.test(ja.target.id)){cancelEvent(ja);var Ba=ja.target.id;triggerEvent(gina,ja.target,Ba,ja.detail)}/^popin\.click\./.test(ja.target.id)&&(cancelEvent(ja),Ba=ja.target.id,(new RegExp('^popin.click.gina-popin-'+f.id)).test(Ba)&&triggerEvent(gina,ja.target,Ba,ja.detail))});gina.popinIsBinded=!1},
|
|
475
|
-
ba={url:'',method:'GET',isSynchrone:!1,withCredentials:!0,headers:{'X-Requested-With':'XMLHttpRequest'}};gina.hasPopinHandler?(f.target=document.getElementById(gina.popinContainer),f.on=on):z();I||new L(function(E,P){if(E)throw E;I=P});return function(E){f.getPopinById=N;f.getPopinByName=Y;f.load=C;f.loadContent=h;f.getActivePopin=B;f.open=Z;f.close=F;addListener(gina,f.target,'init.'+f.id,function(P){P=null;if('undefined'==typeof f.$popins['gina-popin-'+f.id+'-'+E.name]){var K=P=O({},k);if('object'!=
|
|
476
|
-
typeof E)throw Error('`options` must be an object');K.options=O(E,p.options);K.id='gina-popin-'+f.id+'-'+K.options.name;if('undefined'==typeof f.$popins[K.id]){if('string'!=typeof K.options.name||''==K.options.name)throw Error('`options.name` can not be left `empty` or `undefined`');if(-1<Q.indexOf(K.options.name))throw Error('`popin '+K.options.name+'` already exists !');'undefined'!=typeof K.options.validator&&(m=K.options.validator,K.validateFormById=m.validateFormById);K.options['class']='gina-popin-container '+
|
|
477
|
-
K.options['class'];K.name=K.options.name;K.target=f.target;K.load=C;K.loadContent=h;K.open=Z;K.close=F;GINA_ENV_IS_DEV&&(K.updateToolbar=D);K.parentScripts=[];K.parentStyles=[];var qa=gina.config.hostname.replace(/(https|http|):\/\//,'').replace(/:\d+$/,'');qa=new RegExp(qa+':\\d+|'+qa);var U=document.getElementsByTagName('script');for(let aa=0,oa=U.length;aa<oa;aa++)if(U[aa].src&&''!=U[aa].src){var fa=U[aa].src.replace(/(https|http|):\/\//,'').replace(qa,'');K.parentScripts[aa]=fa}U=document.getElementsByTagName('link');
|
|
478
|
-
for(let aa=0,oa=U.length;aa<oa;aa++)'undefined'!=typeof U[aa].rel&&/stylesheet/i.test(U[aa].rel)&&(fa=U[aa].href.replace(/(https|http|):\/\//,'').replace(qa,''),K.parentStyles[aa]=fa);f.$popins[K.id]=K;if(window.XMLHttpRequest)w=new XMLHttpRequest;else if(window.ActiveXObject)try{w=new ActiveXObject('Msxml2.XMLHTTP')}catch(aa){try{w=new ActiveXObject('Microsoft.XMLHTTP')}catch(oa){}}ia(K)}}f.isReady=!0;gina.hasPopinHandler=!0;gina.popin=O(gina.popin,f);triggerEvent(gina,f.target,'ready.'+f.id,P)});
|
|
479
|
-
f.initialized=!0;return f}(H)}});
|
|
480
|
-
function StoragePlugin(v){function L(u){r=JSON.parse(C.getItem(this.bucket));'undefined'==typeof r[u]&&(r[u]=[],C.setItem(this.bucket,JSON.stringify(r)),r=JSON.parse(C.getItem(this.bucket)));h[u]={_collection:u,_bucket:this.bucket};h[u]=O(h[u],na);return h[u]}function I(u){if('object'!==typeof u)throw Error('filter must be an object');var p=r[this._collection],f=u.count(),k=0,m=null;if(0==f)return null;for(var w in p)for(var Q in u){var z='boolean'!=typeof u[Q]?u[Q].toLocaleLowerCase():u[Q];u[Q]&&
|
|
481
|
-
-1<l.indexOf(z)&&'not null'==z&&'undefined'!=typeof p[w][Q]&&'object'!==typeof p[w][Q]&&p[w][Q]===u[Q]&&'null'!=p[w][Q]&&'undefined'!=p[w][Q]?0>m.indexOf(p[w][Q])&&(++k,k===f&&(m=p[w],m._index=w,m._collection=this._collection,m._bucket=this._bucket)):'undefined'!=typeof p[w][Q]&&'object'!==typeof p[w][Q]&&p[w][Q]===u[Q]&&(++k,k===f&&(m=p[w],m._index=w,m._collection=this._collection,m._bucket=this._bucket,m._filter=u))}m&&(m.save=F);return m}var O=O||require('lib/merge');L=L||require('lib/collection');
|
|
482
|
-
var H={v1:function(){return Date.now().toString(36)+'-'+crypto.randomUUID()},v4:function(){return crypto.randomUUID()}},B=B||require('helpers/dateFormat'),X={bucket:'default'},D={},C=null,h={},r={},l=['not null'],Z={bucket:void 0,drop:function(){C.removeItem(X.bucket);D=null;for(var u in this)delete this[u];return D},Collection:L},na={insert:function(u){u._id=H.v1();u._createdAt=(new Date).format('isoDateTime');u._updatedAt=(new Date).format('isoDateTime');r[this._collection][r[this._collection].length]=
|
|
483
|
-
u;C.setItem(this._bucket,JSON.stringify(r))},find:function(u,p){if(!u)return r[this._collection];if('object'!==typeof u)throw Error('filter must be an object');p=r[this._collection];u.count();var f=0,k=[],m;for(m in p)for(var w in u){var Q='boolean'!=typeof u[w]?u[w].toLocaleLowerCase():u[w];u[w]&&-1<l.indexOf(Q)&&'not null'==Q&&'undefined'!=typeof p[m][w]&&'object'!==typeof p[m][w]&&'null'!=p[m][w]&&'undefined'!=p[m][w]?0>k.indexOf(p[m][w])&&(k[f]=p[m][w],++f):'undefined'!=typeof p[m][w]&&'object'!==
|
|
484
|
-
typeof p[m][w]&&p[m][w]===u[w]&&(k[f]=p[m],++f)}return k},findOne:I,update:null,'delete':function(u){if('object'!==typeof u)throw Error('filter must be an object');var p=JSON.clone(r[this._collection]),f=0,k=[],m;for(m in p)for(var w in u)u[w]&&-1<l.indexOf(u[w].toLocaleLowerCase())&&'not null'==u[w].toLowerCase()&&'undefined'!=typeof p[m][w]&&'object'!==typeof p[m][w]&&'null'!=p[m][w]&&'undefined'!=p[m][w]?0>k.indexOf(p[m][w])&&(k[f]=p[m][w],delete r[this._collection][m][w],++f):'undefined'!=typeof p[m][w]&&
|
|
485
|
-
'object'!==typeof p[m][w]&&p[m][w]===u[w]&&(k[f]=p[m],r[this._collection].splice(m,1),++f);return 0<k.length?(C.setItem(this._bucket,JSON.stringify(r)),!0):!1},drop:function(u){if('undefined'==typeof r[this._collection])throw Error('Collection `'+u+'` not found');delete h[this._collection];delete r[this._collection];C.setItem(this._bucket,JSON.stringify(r))}},F=function(u){u=u||!1;try{var p=JSON.clone(r),f=this._index,k=this._collection,m=this._bucket,w=this._filter;this._updatedAt=(new Date).format('isoDateTime');
|
|
486
|
-
p[k][f]=O(p[k][f],this,!0);delete p[k][f]._index;delete p[k][f]._collection;delete p[k][f]._bucket;delete p[k][f].save;delete p[k][f]._filter;if(u&&'object'==typeof p[k][f]){var Q=function(y,N){for(var Y=0,ia=y.length;Y<ia;++Y)'object'!=typeof N[Y]||'undefined'==typeof y[Y]||Array.isArray(y[Y])?Array.isArray(y[Y])?Q(y[Y],N[Y]):'undefined'==typeof y[Y]&&delete N[Y]:z(y[Y],N[Y]);return N},z=function(y,N){for(var Y in N)'object'!=typeof N[Y]||'undefined'==typeof y[Y]||Array.isArray(y[Y])?Array.isArray(y[Y])?
|
|
487
|
-
Q(y[Y],N[Y]):'undefined'==typeof y[Y]&&delete N[Y]:z(y[Y],N[Y]);return N};Array.isArray(p[k][f])?p[k][f]=Q(this,p[k][f]):'object'==typeof p[k][f]?p[k][f]=z(this,p[k][f]):'undefined'==typeof this[prop]&&delete p[k][f]}r[k][f]=p[k][f];C.setItem(m,JSON.stringify(r));return I(w)}catch(y){throw y;}};(function(u){if(!window.localStorage||window.localStorage&&'undefined'==!typeof window.localStorage.setItem)throw Error('Make sure your browser supports `window.localStorage` to use Gina Storage. See: `https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API#Browser_compatibility`');
|
|
488
|
-
if('object'!=typeof u&&'undefined'!=typeof u)throw Error('`options` must be an object');'undefined'==typeof u&&(u={});X=O(u,X);C=window.localStorage;u=X.bucket;if(!C.getItem(u)&&void 0!=u)C.setItem(u,JSON.stringify(r));else if(void 0==u)throw Error('`bucket` name cannot be undefined');D.bucket=u;D=O(D,Z)})(v);return D}
|
|
489
|
-
if('undefined'!==typeof module&&module.exports){var merge=require('lib/merge');Collection=require('lib/collection');var uuid={v1:function(){return Date.now().toString(36)+'-'+crypto.randomUUID()},v4:function(){return crypto.randomUUID()}};module.exports=StoragePlugin}else'function'===typeof define&&define.amd&&define('gina/storage',['helpers/dateFormat','helpers/prototypes'],function(){return StoragePlugin});
|
|
490
|
-
'function'!==typeof Object.assign&&Object.defineProperty(Object,'assign',{value:function(v,L){if(null===v||void 0===v)throw new TypeError('Cannot convert undefined or null to object');for(var I=Object(v),O=1;O<arguments.length;O++){var H=arguments[O];if(null!==H&&void 0!==H)for(var B in H)Object.prototype.hasOwnProperty.call(H,B)&&(I[B]=H[B])}return I},writable:!0,configurable:!0});
|
|
491
|
-
if('undefined'==typeof JSON.clone){var clone=function(v,L){if(null==v||'object'!=typeof v||v.constructor!=Object&&v.constructor!=Array)return v;if(v.constructor==Date||v.constructor==RegExp||v.constructor==Function||v.constructor==String||v.constructor==Number||v.constructor==Boolean)return new v.constructor(v);L=L||new v.constructor;for(var I=0,O=Object.getOwnPropertyNames(v).length||0,H=Object.keys(v);I<O;)L[H[I]]='undefined'==typeof L[H[I]]?clone(v[H[I]],null):L[H[I]],I++;return L};JSON.clone=
|
|
492
|
-
clone}if('undefined'==typeof JSON.escape){var escape=function(v){try{return v.replace(/\n/g,'\\n').replace(/\r/g,'\\r').replace(/\t/g,'\\t')}catch(L){throw L;}};JSON.escape=escape}define('utils/polyfill',function(){});
|
|
493
|
-
function Inherits(v,L){return function(I,O){var H='undefined'==typeof I||'undefined'==typeof O?"inherits(a, b): neither [ a ] nor [ b ] can't be undefined or null":!1;if(H)throw Error(H);H=function(){return function(){if(this){this.prototype=I.prototype;this.name||(this.name=I.name);this.prototype.name=this.name;for(var B in O.prototype)this[B]||(this[B]=O.prototype[B]);O.apply(this,arguments);I.apply(this,arguments)}}}(I,O);void 0==I.prototype&&(I.prototype={});void 0==O.prototype&&(O.prototype=
|
|
494
|
-
{});I.prototype=Object.create(O.prototype,{});H.prototype=Object.create(I.prototype,{});return H}}'undefined'!==typeof module&&module.exports?module.exports=Inherits():'function'===typeof define&&define.amd&&define('lib/inherits',[],function(){return Inherits()});if('undefined'!==typeof module&&module.exports)var lib=require('../../index');
|
|
495
|
-
function Collection(v,L){var I={v4:function(){return crypto.randomUUID()}},O='undefined'!==typeof module&&module.exports?require('../../../lib/merge'):require('lib/merge'),H={isCaseSensitive:{false:{re:'^%s$',modifiers:'i'},true:{re:'^%s$'}},skipEval:!1},B=!1,X=!1,D=null,C={useLocalStorage:!1,locale:'en',searchOptionRules:H};L='object'==typeof L?O(L,C):C;var h=['not null'],r=function(p){try{return eval(p)}catch(f){throw Error('Could not evaluate condition `'+p+'`.\n'+f.stack);}};if('undefined'==typeof v||
|
|
496
|
-
''==v||null==v)v=[];if(!Array.isArray(v))throw Error('`new Collection([content] [, options] )`: `content` argument must be an Array !');v=v?JSON.clone(v):[];for(var l=[],Z=C=0,na=v.length;Z<na;++Z)v[Z]||(v[Z]={}),'undefined'!=typeof v[Z]._uuid?v[Z]._hasItsOwnUuid=!0:v[Z]._uuid=I.v4(),l[C]=v[Z]._uuid,++C;var F=v;F.setSearchOption=function(){if(!arguments.length)throw Error('searchOption cannot be left blank');if(3<arguments.length||3>arguments.length&&1<arguments.length)throw Error('argument length mismatch');
|
|
497
|
-
var p=0,f=arguments.length;if(1==f){if('object'!=typeof arguments[0])throw Error('searchOption must be an object');for(var k in arguments[0])if('undefined'==typeof H[k])throw Error(arguments[1]+' is not an allowed searchOption !');D=arguments[0]}else for(D||={};p<f;++p){if('undefined'==typeof H[arguments[1]])throw Error(arguments[1]+' is not an allowed searchOption !');'undefined'==typeof D[arguments[0]]&&(D[arguments[0]]={});/true|false/i.test(arguments[2])?D[arguments[0]][arguments[1]]=/true/i.test(arguments[2])?
|
|
498
|
-
!0:!1:D[arguments[0]][arguments[1]]=arguments[2]}return F};F.find=function(){B=!1;'boolean'==typeof arguments[arguments.length-1]&&(B=arguments[arguments.length-1],delete arguments[arguments.length-1],--arguments.length);var p=null,f=null,k=null;try{p=JSON.stringify(arguments),f=JSON.parse(p),k=f.count()}catch(fa){throw Error('filter must be an object\n'+fa.stack);}if('undefined'!=typeof f&&0<k){1<k&&(B=!0);k=p=null;var m=0,w=Array.isArray(this)?this:JSON.clone(v),Q=[],z='',y=null,N=D,Y=L.searchOptionRules,
|
|
499
|
-
ia=null,ba=[],E=function(fa,aa,oa,xa,ja){D&&'undefined'!=typeof D[aa]&&(ja=O(D,ja));if(null===fa&&null===oa)++xa;else if(fa&&-1<h.indexOf(z)&&'not null'==z&&'undefined'!=typeof oa&&'object'!==typeof oa&&'null'!=oa&&'undefined'!=oa)0>Q.indexOf(oa)&&++xa;else if('undefined'!=typeof oa&&'object'!==typeof oa&&/(<|>|=)/.test(fa)&&!/undefined|function/.test(typeof oa)&&!ja.skipEval)aa=fa,ja=oa+fa,'string'==typeof fa&&'string'==typeof oa&&(ja=fa.replace(/^(<=|>=|!==|!=|===|!==)/g,''),'string'!=typeof oa||
|
|
500
|
-
/^"(.*)"$/.test(ja)||(fa=fa.replace(ja,'"'+ja+'"')),ja='"'+oa+'"'+fa,fa=aa),/(\d{4})\-(\d{2})\-(\d{2})(\s+|T)(\d{2}):(\d{2}):(\d{2})/.test(oa)&&/(\d{4})\-(\d{2})\-(\d{2})(\s+|T)(\d{2}):(\d{2}):(\d{2})/.test(fa)?r(oa.replace(/(\d{4})\-(\d{2})\-(\d{2})(\s+|T)(\d{2}):(\d{2}):(\d{2})/,'new Date("$&")')+fa.replace(/(\d{4})\-(\d{2})\-(\d{2})(\s+|T)(\d{2}):(\d{2}):(\d{2})/,'new Date("$&")'))&&++xa:r(ja)&&++xa;else if('undefined'!=typeof oa&&'object'!==typeof oa&&oa===fa&&!N||'undefined'!=typeof oa&&'object'!==
|
|
501
|
-
typeof oa&&oa===fa&&'undefined'==typeof N[aa]||'undefined'!=typeof oa&&'object'!==typeof oa&&oa===fa&&'undefined'!=typeof N[aa]&&ja.skipEval)++xa;else if('undefined'!=typeof oa&&'object'!==typeof oa&&N&&'undefined'!=typeof N[aa]){var Ba=0;var ra=N[aa].count();for(let Ka in N[aa])'undefined'!=typeof ja[Ka][N[aa][Ka]]&&(ja[Ka][N[aa][Ka]].re=ja[Ka][N[aa][Ka]].re.replace(/%s/,fa),y=ja[Ka][N[aa][Ka]].modifiers?new RegExp(ja[Ka][N[aa][Ka]].re,ja[Ka][N[aa][Ka]].modifiers):new RegExp(ja[Ka][N[aa][Ka]].re),
|
|
502
|
-
y.test(oa)&&++Ba);Ba==ra&&++xa}return{matched:xa}},P=function(fa,aa,oa,xa){var ja=aa.split(/\./g);ja=ja[ja.length-1];y=new RegExp('("'+ja+'":\\w+)');ja=null;try{oa&&(ja=eval('_content.'+aa))}catch(Ba){}ja&&(Array.isArray(ja)?ja=ja[1].split(/:/)[1]:'string'==typeof ja&&/:/.test(ja)&&(ja=ja.split(/:/)[1]),/(<|>|=)/.test(fa)?/(\d{4})\-(\d{2})\-(\d{2})(\s+|T)(\d{2}):(\d{2}):(\d{2})/.test(ja)&&/(\d{4})\-(\d{2})\-(\d{2})(\s+|T)(\d{2}):(\d{2}):(\d{2})/.test(fa)?r(ja.replace(/(\d{4})\-(\d{2})\-(\d{2})(\s+|T)(\d{2}):(\d{2}):(\d{2})/,
|
|
503
|
-
'new Date("$&")')+fa.replace(/(\d{4})\-(\d{2})\-(\d{2})(\s+|T)(\d{2}):(\d{2}):(\d{2})/,'new Date("$&")'))&&++xa:r(ja+fa)&&++xa:ja==fa&&++xa);return{matched:xa}},K=function(fa,aa,oa,xa,ja){aa=aa.split(/\[\*\]/g);ja=aa[0].replace(/\[\*\]/,'');oa=oa[ja];aa=aa[1];/^\./.test(aa)&&(aa=aa.substring(1));ja=0;if(oa)for(var Ba=0,ra=oa.length;Ba<ra&&!(ba=/\./.test(aa)?P(fa,aa,oa[Ba],ja):E(fa,aa,oa[Ba],ja,Y),ja=ba.matched,0<ja);++Ba);return{matched:xa+ja}},qa;for(qa in w)if(w[qa]||(w[qa]={}),!/undefined|function/.test(typeof w[qa]))for(let fa=
|
|
504
|
-
0,aa=f.count();fa<aa;++fa){p=f[fa];k=p.count();ia=0;for(var U in p){if('undefined'==typeof p[U])throw Error('filter `'+U+'` cannot be left undefined');z=null===p[U]||/(boolean|number)/.test(typeof p[U])?p[U]:p[U].toLocaleLowerCase();ba=/\./.test(U)?/\[\*\]/.test(U)?K(p[U],U,w[qa],ia,0):P(p[U],U,w[qa],ia):E(p[U],U,w[qa][U],ia,Y);ia=ba.matched}if(ia==k)if(B&&X&&0>l.indexOf(w[qa]._uuid)||X||!B){if(!B||B&&0>Q.indexOf(w[qa]._uuid)||X)Q[m]=w[qa],++m}else B&&!X&&0>Q.indexOf(w[qa]._uuid)&&(Q[m]=w[qa],++m)}}else Q=
|
|
505
|
-
v;D=null;Q.insert=F.insert;Q.notIn=F.notIn;Q.find=this.find;Q.update=F.update;Q.replace=F.replace;Q.or=F.or;Q.findOne=F.findOne;Q.limit=F.limit;Q.orderBy=F.orderBy;Q.delete=F.delete;Q.toRaw=F.toRaw;Q.filter=F.filter;return Q};F.findOne=function(){var p=null;'string'==typeof arguments[arguments.length-1]&&(delete arguments[arguments.length-1],--arguments.length);0<arguments.length&&(p=arguments);if('undefined'==typeof p||!p||'object'!=typeof p)throw Error('[ Collection ][ findOne ] `filters` argument must be defined: Array or Filter Object(s) expected');
|
|
506
|
-
p=null;var f=Array.isArray(arguments[0])?arguments[0]:F.find.apply(this,arguments)||[];0<f.length&&(p=f.limit(1).toRaw()[0]);return p};F.or=function(){arguments[arguments.length]=!0;++arguments.length;return F.find.apply(this,arguments)};F.limit=function(p){if('undefined'==typeof p||'number'!=typeof p)throw Error('[Collection::result->limit(resultLimit)] : `resultLimit` parametter must by a `number`');var f=Array.isArray(this)?this:JSON.clone(v);f=f.splice(0,p);f.insert=F.insert;f.update=F.update;
|
|
507
|
-
f.replace=F.replace;f.notIn=F.notIn;f.findOne=F.findOne;f.orderBy=F.orderBy;f.max=F.max;f.delete=F.delete;f.toRaw=F.toRaw;f.filter=F.filter;return f};F.notIn=function(){var p=null,f=null,k=!0;'string'==typeof arguments[arguments.length-1]&&(p=arguments[arguments.length-1],delete arguments[arguments.length-1],--arguments.length);'boolean'==typeof arguments[arguments.length-1]&&(k=arguments[arguments.length-1],delete arguments[arguments.length-1],--arguments.length);0<arguments.length&&(f=arguments);
|
|
508
|
-
if('undefined'==typeof f||!f||'object'!=typeof f)throw Error('[ Collection ][ notIn ] `filters` argument must be defined: Array or Filter Object(s) expected');var m=JSON.clone(Array.isArray(this)?this:v);if(Array.isArray(arguments[0]))var w=arguments[0];else X=!0,w=F.find.apply(this,arguments)||[],X=!1;if(0<w.length){if(k&&p&&'undefined'==typeof w[0]&&'undefined'==typeof w[0][p])throw Error('[ Collection ][ notIn ] `key` not valid');k&&!p&&'undefined'!=typeof w[0]._uuid?p='_uuid':'undefined'!=typeof w[0].id&&
|
|
509
|
-
(p='id');if(!p||'undefined'==typeof w[0][p])throw Error('No comparison key defined !');var Q=0,z=w.length,y=0,N,Y=f.count(),ia;if(k&&'undefined'!=typeof m[y]&&m[y].hasOwnProperty(p))for(;Q<z&&m.length;++Q)for(y=0,k=m.length;y<k;++y){if('undefined'!=typeof m[y]&&'undefined'!=typeof w[Q]&&m[y][p]===w[Q][p]){m.splice(y,1);break}}else if('undefined'==typeof m[y])m=JSON.clone(w);else for(;Q<z&&m.length;++Q)for(y=0,k=m.length;y<k;++y)if('undefined'!=typeof m[y]){for(N=ia=0;N<Y;++N){if('undefined'==typeof f[N])throw Error('filter `'+
|
|
510
|
-
N+'` cannot be left undefined');var ba=f[N].count();var E=0;for(p in f[N])m[y].hasOwnProperty(p)&&m[y][p]===w[Q][p]&&++E;E==ba&&++ia}if(ia){m.splice(y,1);break}}}p=m;p.notIn=F.notIn;p.limit=F.limit;p.find=F.find;p.findOne=F.findOne;p.insert=F.insert;p.replace=F.replace;p.update=F.update;p.orderBy=F.orderBy;p.max=F.max;p.delete=F.delete;p.toRaw=F.toRaw;p.filter=F.filter;return p};F.insert=function(p){if('object'!==typeof p)throw Error('filter must be an object');var f=Array.isArray(this)?this:v;p._uuid=
|
|
511
|
-
I.v4();f.push(p);f.limit=F.limit;f.find=F.find;f.findOne=F.findOne;f.update=F.update;f.replace=F.replace;f.orderBy=F.orderBy;f.max=F.max;f.notIn=F.notIn;f.delete=F.delete;f.toRaw=F.toRaw;f.filter=F.filter;return f};F.update=function(){var p='_uuid',f,k=f=null;'string'==typeof arguments[arguments.length-1]&&(p=arguments[arguments.length-1],delete arguments[arguments.length-1],--arguments.length);'object'==typeof arguments[arguments.length-1]&&(k=arguments[arguments.length-1],delete arguments[arguments.length-
|
|
512
|
-
1],--arguments.length);0<arguments.length&&(f=arguments);if('undefined'==typeof f||!f||'object'!=typeof f)throw Error('[ Collection ][ update ] `filters` argument must be defined: Array or Filter Object(s) expected');if('undefined'==typeof k||!k||'object'!=typeof k)throw Error('[ Collection ][ update ] `set` argument must be defined: Object expected');var m=Array.isArray(arguments[0])?arguments[0]:F.find.apply(this,arguments)||[];f=Array.isArray(this)?this:JSON.clone(v);if(0<m.length){m=m.toRaw();
|
|
513
|
-
for(var w=0,Q=m.length;w<Q;++w){m[w]=O(JSON.clone(k),m[w]);for(var z=0,y=f.length;z<y;++z)if('undefined'==typeof f[z][p]&&'_uuid'==p&&'undefined'!=typeof f[z].id&&(p='id'),f[z][p]==m[w][p]){f[z]=m[w];break}}}f.limit=F.limit;f.find=F.find;f.findOne=F.findOne;f.insert=F.insert;f.update=F.update;f.replace=F.replace;f.orderBy=F.orderBy;f.max=F.max;f.notIn=F.notIn;f.delete=F.delete;f.toRaw=F.toRaw;f.filter=F.filter;return f};F.replace=function(){var p='_uuid',f,k=f=null;'string'==typeof arguments[arguments.length-
|
|
514
|
-
1]&&(p=arguments[arguments.length-1],delete arguments[arguments.length-1],--arguments.length);'object'==typeof arguments[arguments.length-1]&&(k=arguments[arguments.length-1],delete arguments[arguments.length-1],--arguments.length);0<arguments.length&&(f=arguments);if('undefined'==typeof f||!f||'object'!=typeof f)throw Error('[ Collection ][ update ] `filters` argument must be defined: Array or Filter Object(s) expected');if('undefined'==typeof k||!k||'object'!=typeof k)throw Error('[ Collection ][ update ] `set` argument must be defined: Object expected');
|
|
515
|
-
var m=Array.isArray(arguments[0])?arguments[0]:F.find.apply(this,arguments)||[];f=Array.isArray(this)?this:JSON.clone(v);if(0<m.length){m=m.toRaw();for(var w=0,Q=m.length;w<Q;++w){m[w]=JSON.clone(k);for(var z=0,y=f.length;z<y;++z){if('undefined'==typeof f[z][p]&&'_uuid'==p&&'undefined'!=typeof f[z].id)p='id';else if('undefined'==typeof f[z][p]&&'_uuid'==p)throw Error('No comparison key defined !');if(f[z][p]==m[w][p]){f[z]=m[w];break}}}}f.limit=F.limit;f.find=F.find;f.findOne=F.findOne;f.insert=F.insert;
|
|
516
|
-
f.update=F.update;f.replace=F.replace;f.orderBy=F.orderBy;f.max=F.max;f.notIn=F.notIn;f.delete=F.delete;f.toRaw=F.toRaw;f.filter=F.filter;return f};F['delete']=function(){var p=F.notIn.apply(this,arguments);p.limit=F.limit;p.find=F.find;p.findOne=F.findOne;p.insert=F.insert;p.update=F.update;p.replace=F.replace;p.orderBy=F.orderBy;p.max=F.max;p.notIn=F.notIn;p.toRaw=F.toRaw;p.filter=F.filter;p.delete=this.delete;return p};F.orderBy=function(){if('undefined'==typeof arguments||1>arguments.length)throw Error('[ Collection->orderBy(filter) ] where `filter` must not be empty or null');
|
|
517
|
-
if(1==arguments.length)var p=arguments[0];else{p=Array(arguments.length);for(var f=0,k=p.length;f<k;++f)p[f]=arguments[f]}f=Array.isArray(this)?this:JSON.clone(v);return u(p,f.toRaw())};F.max=function(){if('undefined'==typeof arguments||1>arguments.length)throw Error('[ Collection->max(filter) ] where `filter` must not be empty or null');if(1<arguments.length||Array.isArray(arguments[0])||'object'==typeof arguments[0]&&1<arguments[0].count())throw Error('[ Collection->max(filter) ] only accept one filter length, and fileter count must be equal to 1');
|
|
518
|
-
var p=arguments[0];try{var f=Object.keys(p)[0],k={};k[f]='desc';return F.find(p).orderBy(k).limit(1)[0][f]}catch(m){throw m;}};var u=function(p,f){if('object'!=typeof p)throw Error('`filter` parametter must be an object or an array');var k={},m=null,w=null,Q=m=null;m=[];if(0==p.count())return null;k.asc=function(z,y){var N=y.map(function(Y,ia){var ba={};ba.index=ia;ba[z]=Y[z];return ba});N.sort(function(Y,ia){var ba=function(E,P){/^(true|false)$/i.test(E)&&(E=/true/i.test(E)?1:0);/^(true|false)$/i.test(P)&&
|
|
519
|
-
(P=/true/i.test(P)?1:0);if('string'==typeof E&&''!=E||'string'==typeof P){if('undefined'==typeof E||null==E)E='';if('undefined'==typeof P||null==P)P='';'number'==typeof E&&(E=''+E);'number'==typeof P&&(P=''+P);return E.localeCompare(P,void 0,{sensitivity:'case',caseFirst:'upper'})}return E>P?1:E<P?-1:0};return'object'==typeof Y?ba(Y[z],ia[z]):ba(Y,ia)});return N.map(function(Y,ia,ba){return y[Y.index]})};k.desc=function(z,y){return k.asc(z,y).reverse()};m=function(z,y){var N=[],Y=[];if(Array.isArray(y))for(var ia=
|
|
520
|
-
0,ba=y.length;ia<ba;++ia)N[ia]=Object.keys(y[ia])[0],Y[ia]=y[ia][N[ia]];else for(ba in ia=0,y)N[ia]=ba,Y[ia]=y[ba],++ia;w=function(E,P,K,qa,U){var fa='desc'==qa[U]?1:0,aa,oa=aa=null;return'string'==typeof E[K[U]]&&''!=E[K[U]]?(aa=E[K[U]].localeCompare(P[K[U]]),0==fa&&0!=aa?0>aa?-1:1:0!=aa?0>aa?1:-1:K.length-1>U?w(E,P,K,qa,U+1):0):'number'==typeof E[K[U]]||'number'==typeof P[K[U]]?(aa=(''+E[K[U]]).localeCompare(''+P[K[U]],void 0,{numeric:!0}),0==fa&&0!=aa?0>aa?-1:1:0!=aa?0>aa?1:-1:K.length-1>U?w(E,
|
|
521
|
-
P,K,qa,U+1):0):'boolean'==typeof E[K[U]]||'boolean'==typeof P[K[U]]?('boolean'==typeof E[K[U]]&&(aa=E[K[U]]?1:0),'boolean'==typeof P[K[U]]&&(oa=P[K[U]]?1:0),aa>oa?0==fa?1:-1:aa<oa?0==fa?-1:1:K.length-1>U?w(E,P,K,qa,U+1):0):E[K[U]]>P[K[U]]?0==fa?1:-1:E[K[U]]<P[K[U]]?0==fa?-1:1:K.length-1>U?w(E,P,K,qa,U+1):0};return z.sort(function(E,P){return w(E,P,N,Y,0)})};Array.isArray(p)||1<p.count()?m=m(f,p):(Q=Object.keys(p)[0],m=p[Q],m=k[m](Q,f));m.find=F.find;m.findOne=F.findOne;m.limit=F.limit;m.notIn=F.notIn;
|
|
522
|
-
m.insert=F.insert;m.update=F.update;m.replace=F.replace;m.delete=F.delete;m.orderBy=F.orderBy;m.max=F.max;m.toRaw=F.toRaw;m.filter=F.filter;return m};F.toRaw=function(){for(var p=Array.isArray(this)?this.slice():v.slice(),f=0,k=p.length;f<k;++f){if(p[f]._hasItsOwnUuid){let m=/^true$/i.test(p[f]._hasItsOwnUuid)?!0:!1;delete p[f]._hasItsOwnUuid;if(m)continue}p[f]._uuid&&delete p[f]._uuid}return p};F.filter=function(p){if('undefined'==typeof p)throw Error('`filter` parametter must be a string or an array.');
|
|
523
|
-
var f=Array.isArray(this)?this:v;if(!f.length)return[];var k=0,m=f.length,w=[],Q=0;if(Array.isArray(p))for(var z,y=p.length,N;k<m;++k){N=!1;for(z=0;z<y;++z)'undefined'!=typeof f[k][p[z]]&&('undefined'==typeof w[Q]&&(w[Q]={}),w[Q][p[z]]=f[k][p[z]],N=!0);N&&++Q}else for(;k<m;++k)'undefined'!=typeof f[k][p]&&('undefined'==typeof w[Q]&&(w[Q]={}),w[Q][p]=f[k][p],++Q);return JSON.clone(w)};return F}
|
|
524
|
-
'undefined'!==typeof module&&module.exports?module.exports=Collection:'function'===typeof define&&define.amd&&define('lib/collection',[],function(){return Collection});var readyList=[{name:'gina',ctx:window.gina,fn:window.onGinaLoaded}],readyFired=!1,readyEventHandlersInstalled=!1;
|
|
525
|
-
function ready(){if(!readyFired){readyFired=!0;var v=null,L=function(I,O){if(O[I])if('gina'==O[I].name)var H=window.setInterval(function(B,X){try{if('undefined'==typeof X&&(X=window.readyList),X[B].ctx=window.gina,v=X[B].fn.call(window,X[B].ctx,window.require))window.clearInterval(H),++B,L(B,X)}catch(D){throw window.clearInterval(H),D;}},50,I,O);else O[I].ctx=window.originalContext||null,O[I].fn.call(window,O[I].ctx,window.require),++I,L(I,O);else O=[]};L(0,readyList)}}
|
|
526
|
-
function readyStateChange(){'complete'===document.readyState&&gina.ready()}
|
|
527
|
-
if('undefined'==typeof window.gina){var gina={_global:{register:function(v){if('undefined'!=typeof v)for(let L in v)window[L]=v[L]},unregister:function(v){if('undefined'==typeof v||!Array.isArray(v))throw Error('`variables` needs to ba an array');for(let L=0,I=v.length;L<I;L++)delete window[v[L]]},initialized:[]},ready:function(v,L){readyFired?setTimeout(function(){v(L)},1):(readyList.push({name:'anonymous',fn:v,ctx:L}),'complete'===document.readyState||!document.attachEvent&&'interactive'===document.readyState?
|
|
528
|
-
setTimeout(ready,1):readyEventHandlersInstalled||(document.addEventListener?(document.addEventListener('DOMContentLoaded',ready,!1),window.addEventListener('load',ready,!1)):(document.attachEvent('onreadystatechange',readyStateChange),window.attachEvent('onload',ready)),readyEventHandlersInstalled=!0))}};window.gina=gina}define('core',['require','gina'],function(v){v('gina')(window.gina)});require.config({packages:['gina']});require('vendor/engine.io core helpers/prototypes helpers/binding helpers/dateFormat gina/link gina/validator gina/popin gina/storage utils/dom utils/events utils/data utils/effects utils/polyfill lib/inherits lib/form-validator lib/collection lib/domain lib/routing'.split(' '));
|
|
529
|
-
function getDependencies(v,L){var I=new EventTarget,O=[{func:async function(H,B){B=B.url;var X=null,D=null,C=null;try{X=await fetch(B),D=await X.text(),'undefined'==typeof v&&(v={}),'undefined'==typeof window.gina.config&&(v.config={}),v.config[H]=JSON.parse(D),I.dispatchEvent(new CustomEvent('deps.loaded',{detail:{data:D,error:C,timestamp:new Date}}))}catch(h){C=Error('[ROUTING] Could not load routing\n'+(h.stack||h.message||h)),I.dispatchEvent(new CustomEvent('deps.loaded',{detail:{data:null,error:C,
|
|
530
|
-
timestamp:new Date}}))}},args:['routing',{url:'{{ page.environment.webroot }}_gina/assets/routing.json'}]}];I.addEventListener('deps.loaded',H=>{O.splice(0,1);O.length||L()});try{for(let H=0,B=O.length;H<B;H++)O[H].func.apply(null,O[H].args)}catch(H){console.error(H.stack|H.message|H)}}
|
|
531
|
-
for(var tags=document.getElementsByTagName('script'),t=0,len=tags.length;t<len;++t)if(/(gina\.min\.js|gina\.js)/.test(tags[t].getAttribute('src'))){tags[t].onload=function(v){console.debug('Core Gina loaded !');getDependencies(gina,function(){if(window.onGinaLoaded)var L=window.onGinaLoaded;document.addEventListener?document.addEventListener('ginaloaded',function(I){window.gina=I.detail;L(I.detail)}):document.attachEvent&&document.attachEvent('ginaloaded',function(I){window.gina=I.detail;L(I.detail)})})}();
|
|
532
|
-
break};
|