gina 0.1.1-alpha.171 → 0.1.1-alpha.173
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/README.md +9 -3
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/AUTHORS +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/LICENSE +0 -0
- package/framework/v0.1.1-alpha.173/VERSION +1 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/asset/html/nolayout.html +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/asset/html/static.html +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/asset/img/android-chrome-192x192.png +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/asset/img/android-chrome-512x512.png +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/asset/img/apple-touch-icon.png +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/asset/img/favicon-16x16.png +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/asset/img/favicon-32x32.png +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/asset/img/favicon.ico +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/asset/plugin/README.md +0 -0
- package/framework/v0.1.1-alpha.173/core/asset/plugin/dist/vendor/gina/css/gina.min.css +1 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/asset/plugin/dist/vendor/gina/css/gina.min.css.map +1 -1
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/asset/plugin/dist/vendor/gina/html/toolbar.html +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/asset/plugin/dist/vendor/gina/js/gina.js +35 -25
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/asset/plugin/dist/vendor/gina/js/gina.min.js +219 -218
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/asset/plugin/dist/vendor/gina/js/gina.min.js.map +5 -5
- package/framework/v0.1.1-alpha.173/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js +5 -0
- package/framework/v0.1.1-alpha.173/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js.map +8 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/asset/plugin/uuid.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/config.js +26 -14
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/connectors/couchbase/index.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/connectors/couchbase/lib/connector.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/connectors/couchbase/lib/connector.v2.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/connectors/couchbase/lib/connector.v3.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/connectors/couchbase/lib/connector.v4.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/connectors/couchbase/lib/n1ql.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/connectors/couchbase/lib/session-store.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/connectors/couchbase/lib/session-store.v2.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/connectors/couchbase/lib/session-store.v3.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/connectors/couchbase/lib/session-store.v4.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/controller/controller.framework.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/controller/controller.js +35 -22
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/controller/index.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/deps/busboy/.travis.yml +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/deps/busboy/LICENSE +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/deps/busboy/README.md +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/deps/busboy/deps/encoding/encoding-indexes.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/deps/busboy/deps/encoding/encoding.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/deps/busboy/lib/main.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/deps/busboy/lib/types/multipart.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/deps/busboy/lib/types/urlencoded.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/deps/busboy/lib/utils.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/deps/busboy/package.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/deps/swig-client/swig-2.0.0.min.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/dev/index.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/dev/lib/class.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/dev/lib/factory.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/dev/lib/tools.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/gna.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/locales/README.md +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/locales/currency.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/locales/dist/language/en.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/locales/dist/language/fr.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/locales/dist/region/en.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/locales/dist/region/fr.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/locales/index.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/locales/src/make.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/locales/src/resources/currency.csv +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/locales/src/resources/region.csv +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/locales/src/resources/region.mapping.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/mime.types +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/model/entity.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/model/index.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/model/template/entityFactory.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/model/template/index.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/plugins/README.md +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/plugins/index.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/plugins/lib/file/README.md +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/plugins/lib/file/build.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/plugins/lib/file/package.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/plugins/lib/intl/README.md +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/plugins/lib/intl/build.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/plugins/lib/intl/package.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/plugins/lib/intl/src/main.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/plugins/lib/storage/README.md +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/plugins/lib/storage/build.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/plugins/lib/storage/package.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/plugins/lib/storage/src/main.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/plugins/lib/validator/README.md +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/plugins/lib/validator/build.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/plugins/lib/validator/package.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/plugins/lib/validator/src/form-validator.js +2 -2
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/plugins/lib/validator/src/main.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/router.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/server.express.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/server.isaac.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/server.js +2 -2
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/status.codes +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/template/boilerplate/bundle/config/app.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/template/boilerplate/bundle/config/routing.json +0 -0
- package/framework/v0.1.1-alpha.173/core/template/boilerplate/bundle/config/settings.json +12 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/template/boilerplate/bundle/config/settings.server.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/template/boilerplate/bundle/config/templates.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/template/boilerplate/bundle/controllers/controller.content.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/template/boilerplate/bundle/controllers/controller.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/template/boilerplate/bundle/controllers/setup.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/template/boilerplate/bundle/index.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/template/boilerplate/bundle_namespace/controllers/controller.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/template/boilerplate/bundle_public/css/default.css +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/template/boilerplate/bundle_public/css/vendor/readme.md +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/template/boilerplate/bundle_public/favicon.ico +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/template/boilerplate/bundle_public/js/vendor/readme.md +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/template/boilerplate/bundle_public/readme.md +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/template/boilerplate/bundle_templates/handlers/main.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/template/boilerplate/bundle_templates/html/content/homepage.html +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/template/boilerplate/bundle_templates/html/includes/error-msg-noscript.html +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/template/boilerplate/bundle_templates/html/includes/error-msg-outdated-browser.html +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/template/boilerplate/bundle_templates/html/layouts/main.html +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/template/command/gina.bat.tpl +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/template/command/gina.tpl +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/template/conf/env.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/template/conf/manifest.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/template/conf/package.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/template/conf/settings.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/template/conf/statics.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/template/conf/templates.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/template/error/client/json/401.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/template/error/client/json/403.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/template/error/client/json/404.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/template/error/server/html/50x.html +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/template/error/server/json/500.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/template/error/server/json/503.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/core/template/extensions/logger/config.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/helpers/console.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/helpers/context.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/helpers/dateFormat.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/helpers/index.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/helpers/json/LICENSE +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/helpers/json/README.md +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/helpers/json/package.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/helpers/json/src/main.js +26 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/helpers/path.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/helpers/plugins/README.md +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/helpers/plugins/package.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/helpers/plugins/src/api-error.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/helpers/plugins/src/main.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/helpers/prototypes.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/helpers/task.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/helpers/text.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/archiver/README.md +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/archiver/build.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/archiver/package.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/archiver/src/dep/jszip.min.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/archiver/src/main.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/aliases.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/bundle/add.js +36 -5
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/bundle/arguments.json +2 -1
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/bundle/copy.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/bundle/cp.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/bundle/help.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/bundle/help.txt +2 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/bundle/list.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/bundle/remove.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/bundle/rename.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/bundle/restart.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/bundle/rm.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/bundle/start.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/bundle/status.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/bundle/stop.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/env/add.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/env/get.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/env/help.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/env/help.txt +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/env/link-dev.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/env/list.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/env/remove.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/env/rm.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/env/set.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/env/unset.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/env/use.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/framework/build.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/framework/dot.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/framework/get.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/framework/help.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/framework/help.txt +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/framework/init.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/framework/link-node-modules.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/framework/link.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/framework/msg.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/framework/open.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/framework/restart.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/framework/set.js +9 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/framework/start.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/framework/status.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/framework/stop.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/framework/tail.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/framework/update.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/framework/version.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/gina-dev.1.md +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/gina-framework.1.md +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/gina.1.md +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/helper.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/index.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/msg.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/port/help.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/port/help.txt +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/port/inc/scan.js +2 -1
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/port/list.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/port/reset.js +2 -2
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/port/set.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/project/add.js +1 -1
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/project/arguments.json +2 -1
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/project/build.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/project/help.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/project/help.txt +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/project/import.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/project/list.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/project/move.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/project/remove.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/project/rename.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/project/restart.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/project/rm.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/project/start.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/project/status.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/project/stop.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/protocol/help.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/protocol/help.txt +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/protocol/list.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/protocol/set.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/scope/help.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/scope/help.txt +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/scope/link-local.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/scope/list.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/scope/remove.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/scope/rm.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/scope/set.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/scope/unset.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/scope/use.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cmd/view/add.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/collection/README.md +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/collection/build.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/collection/package.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/collection/src/main.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/config.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cron/README.md +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cron/package.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/cron/src/main.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/domain/LICENSE +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/domain/README.md +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/domain/dist/public_suffix_list.dat +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/domain/exemples/backend.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/domain/exemples/frontend.html +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/domain/package.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/domain/src/main.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/generator/index.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/index.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/inherits/LICENSE +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/inherits/README.md +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/inherits/example/inheriting_eventemitter.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/inherits/example/protected_inheritance.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/inherits/example/simple_inheritance.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/inherits/example/super_attribute_overridden_by_child_on_init.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/inherits/package.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/inherits/src/main.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/logger/README.md +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/logger/package.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/logger/src/containers/default/index.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/logger/src/containers/file/index.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/logger/src/containers/file/lib/logrotator/README.md +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/logger/src/containers/file/lib/logrotator/index.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/logger/src/containers/mq/index.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/logger/src/containers/mq/listener.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/logger/src/containers/mq/speaker.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/logger/src/helper.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/logger/src/main.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/math/index.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/merge/README.md +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/merge/example/merge.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/merge/example/merge_2_literal objects.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/merge/example/merge_and_preserve_first.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/merge/package.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/merge/src/main.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/model.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/proc.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/routing/README.md +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/routing/build.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/routing/package.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/routing/src/main.js +4 -4
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/session-store.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/shell.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/swig-filters/README.md +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/swig-filters/package.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/swig-filters/src/main.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/url/README.md +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/url/index.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/url/mocks.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/url/routing.json +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/url/test.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/lib/validator.js +0 -0
- package/framework/{v0.1.1-alpha.171 → v0.1.1-alpha.173}/package.json +0 -0
- package/package.json +2 -2
- package/resources/home/main.json +9 -3
- package/resources/home/settings.json +2 -0
- package/services/env.json +8 -0
- package/services/manifest.json +12 -0
- package/services/src/proxy/config/settings.json +2 -2
- package/services/src/toolbar/config/app.json +6 -0
- package/services/src/toolbar/config/routing.json +11 -0
- package/{framework/v0.1.1-alpha.171/core/template/boilerplate/bundle → services/src/toolbar}/config/settings.json +0 -0
- package/services/src/toolbar/config/settings.server.json +30 -0
- package/services/src/toolbar/controllers/controller.content.js +39 -0
- package/services/src/toolbar/controllers/controller.js +30 -0
- package/services/src/toolbar/controllers/setup.js +111 -0
- package/services/src/toolbar/index.js +43 -0
- package/framework/v0.1.1-alpha.171/VERSION +0 -1
- package/framework/v0.1.1-alpha.171/core/asset/plugin/dist/vendor/gina/css/gina.min.css +0 -1
- package/framework/v0.1.1-alpha.171/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js +0 -5
- package/framework/v0.1.1-alpha.171/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js.map +0 -8
|
@@ -6,19 +6,19 @@
|
|
|
6
6
|
Released under the MIT License.
|
|
7
7
|
*/
|
|
8
8
|
var requirejs,require,define;
|
|
9
|
-
(function(D,O){function ca(Ia,Ka){return Ka||''}function Ea(Ia){return'[object Function]'===Ga.call(Ia)}function K(Ia){return'[object Array]'===Ga.call(Ia)}function T(Ia,Ka){if(Ia){var Ya;for(Ya=0;Ya<Ia.length&&(!Ia[Ya]||!Ka(Ia[Ya],Ya,Ia));Ya+=1);}}function oa(Ia,Ka){if(Ia){var Ya;for(Ya=Ia.length-1;-1<Ya&&(!Ia[Ya]||!Ka(Ia[Ya],Ya,Ia));--Ya);}}function Y(Ia,Ka){return
|
|
9
|
+
(function(D,O){function ca(Ia,Ka){return Ka||''}function Ea(Ia){return'[object Function]'===Ga.call(Ia)}function K(Ia){return'[object Array]'===Ga.call(Ia)}function T(Ia,Ka){if(Ia){var Ya;for(Ya=0;Ya<Ia.length&&(!Ia[Ya]||!Ka(Ia[Ya],Ya,Ia));Ya+=1);}}function oa(Ia,Ka){if(Ia){var Ya;for(Ya=Ia.length-1;-1<Ya&&(!Ia[Ya]||!Ka(Ia[Ya],Ya,Ia));--Ya);}}function Y(Ia,Ka){return W.call(Ia,Ka)}function U(Ia,Ka){return Y(Ia,Ka)&&Ia[Ka]}function n(Ia,Ka){for(var Ya in Ia)if(Y(Ia,Ya)&&Ka(Ia[Ya],Ya))break}function S(Ia,
|
|
10
10
|
Ka,Ya,pb){Ka&&n(Ka,function($a,ib){if(Ya||!Y(Ia,ib))!pb||'object'!==typeof $a||!$a||K($a)||Ea($a)||$a instanceof RegExp?Ia[ib]=$a:(Ia[ib]||(Ia[ib]={}),S(Ia[ib],$a,Ya,pb))});return Ia}function q(Ia,Ka){return function(){return Ka.apply(Ia,arguments)}}function da(Ia){throw Ia;}function za(Ia){if(!Ia)return Ia;var Ka=D;T(Ia.split('.'),function(Ya){Ka=Ka[Ya]});return Ka}function N(Ia,Ka,Ya,pb){Ka=Error(Ka+'\nhttps://requirejs.org/docs/errors.html#'+Ia);Ka.requireType=Ia;Ka.requireModules=pb;Ya&&(Ka.originalError=
|
|
11
|
-
Ya);return Ka}function L(){if(z&&'interactive'===z.readyState)return z;oa(document.getElementsByTagName('script'),function(Ia){if('interactive'===Ia.readyState)return z=Ia});return z}var B,H,m,z,y,F,r,v=/\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/mg,E=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,I=/\.js$/,R=/^\.\//;var sa=Object.prototype;var Ga=sa.toString,
|
|
12
|
-
wa=ha&&'PLAYSTATION 3'===navigator.platform?/^complete$/:/^(complete|loaded)$/,
|
|
11
|
+
Ya);return Ka}function L(){if(z&&'interactive'===z.readyState)return z;oa(document.getElementsByTagName('script'),function(Ia){if('interactive'===Ia.readyState)return z=Ia});return z}var B,H,m,z,y,F,r,v=/\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/mg,E=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,I=/\.js$/,R=/^\.\//;var sa=Object.prototype;var Ga=sa.toString,W=sa.hasOwnProperty,ha=!('undefined'===typeof window||'undefined'===typeof navigator||!window.document),ea=!ha&&'undefined'!==typeof importScripts,
|
|
12
|
+
wa=ha&&'PLAYSTATION 3'===navigator.platform?/^complete$/:/^(complete|loaded)$/,ja='undefined'!==typeof opera&&'[object Opera]'===opera.toString(),ta={},Da={},Pa=[],La=!1;if('undefined'===typeof define){if('undefined'!==typeof requirejs){if(Ea(requirejs))return;Da=requirejs;requirejs=void 0}'undefined'===typeof require||Ea(require)||(Da=require,require=void 0);var Fa=requirejs=function(Ia,Ka,Ya,pb){var $a='_';if(!K(Ia)&&'string'!==typeof Ia){var ib=Ia;K(Ka)?(Ia=Ka,Ka=Ya,Ya=pb):Ia=[]}ib&&ib.context&&
|
|
13
13
|
($a=ib.context);(pb=U(ta,$a))||(pb=ta[$a]=Fa.s.newContext($a));ib&&pb.configure(ib);return pb.require(Ia,Ka,Ya)};Fa.config=function(Ia){return Fa(Ia)};Fa.nextTick='undefined'!==typeof O?function(Ia){O(Ia,4)}:function(Ia){Ia()};require||=Fa;Fa.version='2.3.6';Fa.jsExtRegExp=/^\/|:|\?|\.js$/;Fa.isBrowser=ha;sa=Fa.s={contexts:ta,newContext:function(Ia){function Ka(w,ia,ua){var na;ia=ia&&ia.split('/');var la=Ja.map,Ca=la&&la['*'];if(w){w=w.split('/');var Aa=w.length-1;Ja.nodeIdCompat&&I.test(w[Aa])&&
|
|
14
14
|
(w[Aa]=w[Aa].replace(I,''));'.'===w[0].charAt(0)&&ia&&(Aa=ia.slice(0,ia.length-1),w=Aa.concat(w));Aa=w;for(na=0;na<Aa.length;na++){var Sa=Aa[na];'.'===Sa?(Aa.splice(na,1),--na):'..'===Sa&&0!==na&&(1!==na||'..'!==Aa[2])&&'..'!==Aa[na-1]&&0<na&&(Aa.splice(na-1,2),na-=2)}w=w.join('/')}if(ua&&la&&(ia||Ca)){Aa=w.split('/');na=Aa.length;a:for(;0<na;--na){var Va=Aa.slice(0,na).join('/');if(ia)for(Sa=ia.length;0<Sa;--Sa)if(ua=U(la,ia.slice(0,Sa).join('/')))if(ua=U(ua,Va)){var qb=ua;var sb=na;break a}if(!Hb&&
|
|
15
15
|
Ca&&U(Ca,Va)){var Hb=U(Ca,Va);var Ob=na}}!qb&&Hb&&(qb=Hb,sb=Ob);qb&&(Aa.splice(0,sb,qb),w=Aa.join('/'))}return(qb=U(Ja.pkgs,w))?qb:w}function Ya(w){ha&&T(document.getElementsByTagName('script'),function(ia){if(ia.getAttribute('data-requiremodule')===w&&ia.getAttribute('data-requirecontext')===Q.contextName)return ia.parentNode.removeChild(ia),!0})}function pb(w){var ia=U(Ja.paths,w);if(ia&&K(ia)&&1<ia.length)return ia.shift(),Q.require.undef(w),Q.makeRequire(null,{skipMap:!0})([w]),!0}function $a(w){var ia=
|
|
16
|
-
w?w.indexOf('!'):-1;if(-1<ia){var ua=w.substring(0,ia);w=w.substring(ia+1,w.length)}return[ua,w]}function ib(w,ia,ua,na){var la=null,Ca=ia?ia.name:null,Aa=w,Sa=!0,Va='';w||(Sa=!1,w='_@r'+(A+=1));w=$a(w);la=w[0];w=w[1];if(la){la=Ka(la,Ca,na);var qb=U(p,la)}if(w)if(la)Va=ua?w:qb&&qb.normalize?qb.normalize(w,function(Hb){return Ka(Hb,Ca,na)}):-1===w.indexOf('!')?Ka(w,Ca,na):w;else{Va=Ka(w,Ca,na);w=$a(Va);la=w[0];Va=w[1];ua=!0;var sb=Q.nameToUrl(Va)}ua=!la||qb||ua?'':'_unnormalized'+(
|
|
16
|
+
w?w.indexOf('!'):-1;if(-1<ia){var ua=w.substring(0,ia);w=w.substring(ia+1,w.length)}return[ua,w]}function ib(w,ia,ua,na){var la=null,Ca=ia?ia.name:null,Aa=w,Sa=!0,Va='';w||(Sa=!1,w='_@r'+(A+=1));w=$a(w);la=w[0];w=w[1];if(la){la=Ka(la,Ca,na);var qb=U(p,la)}if(w)if(la)Va=ua?w:qb&&qb.normalize?qb.normalize(w,function(Hb){return Ka(Hb,Ca,na)}):-1===w.indexOf('!')?Ka(w,Ca,na):w;else{Va=Ka(w,Ca,na);w=$a(Va);la=w[0];Va=w[1];ua=!0;var sb=Q.nameToUrl(Va)}ua=!la||qb||ua?'':'_unnormalized'+(V+=1);return{prefix:la,
|
|
17
17
|
name:Va,parentMap:ia,unnormalized:!!ua,url:sb,originalName:Aa,isDefine:Sa,id:(la?la+'!'+Va:Va)+ua}}function bc(w){var ia=w.id,ua=U(M,ia);ua||=M[ia]=new Q.Module(w);return ua}function $b(w,ia,ua){var na=w.id,la=U(M,na);if(!Y(p,na)||la&&!la.defineEmitComplete)if(la=bc(w),la.error&&'error'===ia)ua(la.error);else la.on(ia,ua);else'defined'===ia&&ua(p[na])}function fb(w,ia){var ua=w.requireModules,na=!1;if(ia)ia(w);else if(T(ua,function(la){if(la=U(M,la))la.error=w,la.events.error&&(na=!0,la.emit('error',
|
|
18
18
|
w))}),!na)Fa.onError(w)}function Cb(){Pa.length&&(T(Pa,function(w){var ia=w[0];'string'===typeof ia&&(Q.defQueueMap[ia]=!0);h.push(w)}),Pa=[])}function yb(w){delete M[w];delete e[w]}function Gb(w,ia,ua){var na=w.map.id;w.error?w.emit('error',w.error):(ia[na]=!0,T(w.depMaps,function(la,Ca){la=la.id;var Aa=U(M,la);!Aa||w.depMatched[Ca]||ua[la]||(U(ia,la)?(w.defineDep(Ca,p[la]),w.check()):Gb(Aa,ia,ua))}),ua[na]=!0)}function Na(){var w,ia,ua=(w=1E3*Ja.waitSeconds)&&Q.startTime+w<(new Date).getTime(),
|
|
19
19
|
na=[],la=[],Ca=!1,Aa=!0;if(!xa){xa=!0;n(e,function(Sa){var Va=Sa.map,qb=Va.id;if(Sa.enabled&&(Va.isDefine||la.push(Sa),!Sa.error))if(!Sa.inited&&ua)pb(qb)?Ca=ia=!0:(na.push(qb),Ya(qb));else if(!Sa.inited&&Sa.fetched&&Va.isDefine&&(Ca=!0,!Va.prefix))return Aa=!1});if(ua&&na.length)return w=N('timeout','Load timeout for modules: '+na,null,na),w.contextName=Q.contextName,fb(w);Aa&&T(la,function(Sa){Gb(Sa,{},{})});ua&&!ia||!Ca||!ha&&!ea||ya||(ya=O(function(){ya=0;Na()},50));xa=!1}}function db(w){Y(p,
|
|
20
|
-
w[0])||bc(ib(w[0],null,!0)).init(w[1],w[2])}function Eb(w){w=w.currentTarget||w.srcElement;var ia=Q.onScriptLoad;w.detachEvent&&!
|
|
21
|
-
{}}var xa,ya,Ja={waitSeconds:7,baseUrl:'./',paths:{},bundles:{},pkgs:{},shim:{},config:{}},M={},e={},b={},h=[],p={},x={},u={},A=1,
|
|
20
|
+
w[0])||bc(ib(w[0],null,!0)).init(w[1],w[2])}function Eb(w){w=w.currentTarget||w.srcElement;var ia=Q.onScriptLoad;w.detachEvent&&!ja?w.detachEvent('onreadystatechange',ia):w.removeEventListener('load',ia,!1);ia=Q.onScriptError;w.detachEvent&&!ja||w.removeEventListener('error',ia,!1);return{node:w,id:w&&w.getAttribute('data-requiremodule')}}function Pb(){for(Cb();h.length;){var w=h.shift();if(null===w[0])return fb(N('mismatch','Mismatched anonymous define() module: '+w[w.length-1]));db(w)}Q.defQueueMap=
|
|
21
|
+
{}}var xa,ya,Ja={waitSeconds:7,baseUrl:'./',paths:{},bundles:{},pkgs:{},shim:{},config:{}},M={},e={},b={},h=[],p={},x={},u={},A=1,V=1;var P={require:function(w){return w.require?w.require:w.require=Q.makeRequire(w.map)},exports:function(w){w.usingExports=!0;if(w.map.isDefine)return w.exports?p[w.map.id]=w.exports:w.exports=p[w.map.id]={}},module:function(w){return w.module?w.module:w.module={id:w.map.id,uri:w.map.url,config:function(){return U(Ja.config,w.map.id)||{}},exports:w.exports||(w.exports=
|
|
22
22
|
{})}}};var aa=function(w){this.events=U(b,w.id)||{};this.map=w;this.shim=U(Ja.shim,w.id);this.depExports=[];this.depMaps=[];this.depMatched=[];this.pluginMaps={};this.depCount=0};aa.prototype={init:function(w,ia,ua,na){na=na||{};if(!this.inited){this.factory=ia;if(ua)this.on('error',ua);else this.events.error&&(ua=q(this,function(la){this.emit('error',la)}));this.depMaps=w&&w.slice(0);this.errback=ua;this.inited=!0;this.ignore=na.ignore;na.enabled||this.enabled?this.enable():this.check()}},defineDep:function(w,
|
|
23
23
|
ia){this.depMatched[w]||(this.depMatched[w]=!0,--this.depCount,this.depExports[w]=ia)},fetch:function(){if(!this.fetched){this.fetched=!0;Q.startTime=(new Date).getTime();var w=this.map;if(this.shim)Q.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],q(this,function(){return w.prefix?this.callPlugin():this.load()}));else return w.prefix?this.callPlugin():this.load()}},load:function(){var w=this.map.url;x[w]||(x[w]=!0,Q.load(this.map.id,w))},check:function(){if(this.enabled&&!this.enabling){var w=
|
|
24
24
|
this.map.id;var ia=this.depExports;var ua=this.exports,na=this.factory;if(!this.inited)Y(Q.defQueueMap,w)||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(Ea(na)){if(this.events.error&&this.map.isDefine||Fa.onError!==da)try{ua=Q.execCb(w,na,ia,ua)}catch(Aa){var la=Aa}else ua=Q.execCb(w,na,ia,ua);this.map.isDefine&&void 0===ua&&((ia=this.module)?ua=ia.exports:this.usingExports&&(ua=this.exports));if(la)return la.requireMap=
|
|
@@ -36,7 +36,7 @@ Ca=na.split('/')[0];if(-1!==la&&('.'!==Ca&&'..'!==Ca||1<la)){var Aa=na.substring
|
|
|
36
36
|
la;(na=U(Ja.pkgs,w))&&(w=na);if(na=U(u,w))return Q.nameToUrl(na,ia,ua);if(Fa.jsExtRegExp.test(w))na=w+(ia||'');else{na=Ja.paths;var Ca=w.split('/');for(la=Ca.length;0<la;--la){var Aa=Ca.slice(0,la).join('/');if(Aa=U(na,Aa)){K(Aa)&&(Aa=Aa[0]);Ca.splice(0,la,Aa);break}}na=Ca.join('/');na+=ia||(/^data:|^blob:|\?/.test(na)||ua?'':'.js');na=('/'===na.charAt(0)||na.match(/^[\w\+\.\-]+:/)?'':Ja.baseUrl)+na}return Ja.urlArgs&&!/^blob:/.test(na)?na+Ja.urlArgs(w,na):na},load:function(w,ia){Fa.load(Q,w,ia)},
|
|
37
37
|
execCb:function(w,ia,ua,na){return ia.apply(na,ua)},onScriptLoad:function(w){if('load'===w.type||wa.test((w.currentTarget||w.srcElement).readyState))z=null,w=Eb(w),Q.completeLoad(w.id)},onScriptError:function(w){var ia=Eb(w);if(!pb(ia.id)){var ua=[];n(M,function(na,la){0!==la.indexOf('_@r')&&T(na.depMaps,function(Ca){if(Ca.id===ia.id)return ua.push(la),!0})});return fb(N('scripterror','Script error for "'+ia.id+(ua.length?'", needed by: '+ua.join(', '):'"'),w,[ia.id]))}}};Q.require=Q.makeRequire();
|
|
38
38
|
return Q}};Fa({});T(['toUrl','undef','defined','specified'],function(Ia){Fa[Ia]=function(){var Ka=ta._;return Ka.require[Ia].apply(Ka,arguments)}});if(ha){var Oa=sa.head=document.getElementsByTagName('head')[0];if(B=document.getElementsByTagName('base')[0])Oa=sa.head=B.parentNode}Fa.onError=da;Fa.createNode=function(Ia,Ka,Ya){Ka=Ia.xhtml?document.createElementNS('http://www.w3.org/1999/xhtml','html:script'):document.createElement('script');Ka.type=Ia.scriptType||'text/javascript';Ka.charset='utf-8';
|
|
39
|
-
Ka.async=!0;return Ka};Fa.load=function(Ia,Ka,Ya){var pb=Ia&&Ia.config||{};if(ha){var $a=Fa.createNode(pb,Ka,Ya);$a.setAttribute('data-requirecontext',Ia.contextName);$a.setAttribute('data-requiremodule',Ka);!$a.attachEvent||$a.attachEvent.toString&&0>$a.attachEvent.toString().indexOf('[native code')||
|
|
39
|
+
Ka.async=!0;return Ka};Fa.load=function(Ia,Ka,Ya){var pb=Ia&&Ia.config||{};if(ha){var $a=Fa.createNode(pb,Ka,Ya);$a.setAttribute('data-requirecontext',Ia.contextName);$a.setAttribute('data-requiremodule',Ka);!$a.attachEvent||$a.attachEvent.toString&&0>$a.attachEvent.toString().indexOf('[native code')||ja?($a.addEventListener('load',Ia.onScriptLoad,!1),$a.addEventListener('error',Ia.onScriptError,!1)):(La=!0,$a.attachEvent('onreadystatechange',Ia.onScriptLoad));$a.src=Ya;if(pb.onNodeCreated)pb.onNodeCreated($a,
|
|
40
40
|
pb,Ka,Ya);y=$a;B?Oa.insertBefore($a,B):Oa.appendChild($a);y=null;return $a}if(ea)try{O(function(){},0),importScripts(Ya),Ia.completeLoad(Ka)}catch(ib){Ia.onError(N('importscripts','importScripts failed for '+Ka+' at '+Ya,ib,[Ka]))}};ha&&!Da.skipDataMain&&oa(document.getElementsByTagName('script'),function(Ia){Oa||(Oa=Ia.parentNode);if(H=Ia.getAttribute('data-main'))return F=H,Da.baseUrl||-1!==F.indexOf('!')||(m=F.split('/'),F=m.pop(),r=m.length?m.join('/')+'/':'./',Da.baseUrl=r),F=F.replace(I,''),
|
|
41
41
|
Fa.jsExtRegExp.test(F)&&(F=H),Da.deps=Da.deps?Da.deps.concat(F):[F],!0});define=function(Ia,Ka,Ya){var pb;'string'!==typeof Ia&&(Ya=Ka,Ka=Ia,Ia=null);K(Ka)||(Ya=Ka,Ka=null);!Ka&&Ea(Ya)&&(Ka=[],Ya.length&&(Ya.toString().replace(v,ca).replace(E,function(ib,bc){Ka.push(bc)}),Ka=(1===Ya.length?['require']:['require','exports','module']).concat(Ka)));if(La&&(pb=y||L())){Ia||=pb.getAttribute('data-requiremodule');var $a=ta[pb.getAttribute('data-requirecontext')]}$a?($a.defQueue.push([Ia,Ka,Ya]),$a.defQueueMap[Ia]=
|
|
42
42
|
!0):Pa.push([Ia,Ka,Ya])};define.amd={jQuery:!0};Fa.exec=function(Ia){return eval(Ia)};Fa(Da)}})(this,'undefined'===typeof setTimeout?void 0:setTimeout);define('requireLib',function(){});
|
|
@@ -44,14 +44,14 @@ Fa.jsExtRegExp.test(F)&&(F=H),Da.deps=Da.deps?Da.deps.concat(F):[F],!0});define=
|
|
|
44
44
|
y[m[z++]],y[m[z++]],y[m[z++]],y[m[z++]],y[m[z++]],y[m[z++]]].join('')}function Ea(m,z,y){var F=function(r,v,E,I){I=E&&I||0;if('string'==typeof r&&(r=function(R){R=unescape(encodeURIComponent(R));for(var sa=Array(R.length),Ga=0;Ga<R.length;Ga++)sa[Ga]=R.charCodeAt(Ga);return sa}(r)),'string'==typeof v&&(v=function(R){var sa=[];return R.replace(/[a-fA-F0-9]{2}/g,function(Ga){sa.push(parseInt(Ga,16))}),sa}(v)),!Array.isArray(r))throw TypeError('value must be an array of bytes');if(!Array.isArray(v)||
|
|
45
45
|
16!==v.length)throw TypeError('namespace must be uuid string or an Array of 16 byte values');r=y(v.concat(r));if(r[6]=15&r[6]|z,r[8]=63&r[8]|128,E)for(v=0;16>v;++v)E[I+v]=r[v];return E||ca(r)};try{F.name=m}catch(r){}return F.DNS='6ba7b810-9dad-11d1-80b4-00c04fd430c8',F.URL='6ba7b811-9dad-11d1-80b4-00c04fd430c8',F}function K(m,z){var y=(65535&m)+(65535&z);return(m>>16)+(z>>16)+(y>>16)<<16|65535&y}function T(m,z,y,F,r,v){return K((E=K(K(z,m),K(F,v)))<<(I=r)|E>>>32-I,y);var E,I}function oa(m,z,y,F,r,
|
|
46
46
|
v,E){return T(z&y|~z&F,m,z,r,v,E)}function Y(m,z,y,F,r,v,E){return T(z&F|y&~F,m,z,r,v,E)}function U(m,z,y,F,r,v,E){return T(y^(z|~F),m,z,r,v,E)}for(var n='undefined'!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||'undefined'!=typeof msCrypto&&'function'==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),S=new Uint8Array(16),q,da,za=[],N=0;256>N;++N)za[N]=(N+256).toString(16).substr(1);var L=0,B=0;N=Ea('v3',48,function(m){if('string'==typeof m){var z=
|
|
47
|
-
unescape(encodeURIComponent(m));m=Array(z.length);for(var y=0;y<z.length;y++)m[y]=z.charCodeAt(y)}return function(F){var r,v=[],E=32*F.length;for(r=0;r<E;r+=8){var I=F[r>>5]>>>r%32&255;I=parseInt('0123456789abcdef'.charAt(I>>>4&15)+'0123456789abcdef'.charAt(15&I),16);v.push(I)}return v}(function(F,r){F[r>>5]|=128<<r%32;F[14+(r+64>>>9<<4)]=r;var v=1732584193,E=-271733879,I=-1732584194,R=271733878;for(r=0;r<F.length;r+=16){var sa=v;var Ga=E;var
|
|
47
|
+
unescape(encodeURIComponent(m));m=Array(z.length);for(var y=0;y<z.length;y++)m[y]=z.charCodeAt(y)}return function(F){var r,v=[],E=32*F.length;for(r=0;r<E;r+=8){var I=F[r>>5]>>>r%32&255;I=parseInt('0123456789abcdef'.charAt(I>>>4&15)+'0123456789abcdef'.charAt(15&I),16);v.push(I)}return v}(function(F,r){F[r>>5]|=128<<r%32;F[14+(r+64>>>9<<4)]=r;var v=1732584193,E=-271733879,I=-1732584194,R=271733878;for(r=0;r<F.length;r+=16){var sa=v;var Ga=E;var W=I;var ha=R;v=oa(v,E,I,R,F[r],7,-680876936);R=oa(R,v,
|
|
48
48
|
E,I,F[r+1],12,-389564586);I=oa(I,R,v,E,F[r+2],17,606105819);E=oa(E,I,R,v,F[r+3],22,-1044525330);v=oa(v,E,I,R,F[r+4],7,-176418897);R=oa(R,v,E,I,F[r+5],12,1200080426);I=oa(I,R,v,E,F[r+6],17,-1473231341);E=oa(E,I,R,v,F[r+7],22,-45705983);v=oa(v,E,I,R,F[r+8],7,1770035416);R=oa(R,v,E,I,F[r+9],12,-1958414417);I=oa(I,R,v,E,F[r+10],17,-42063);E=oa(E,I,R,v,F[r+11],22,-1990404162);v=oa(v,E,I,R,F[r+12],7,1804603682);R=oa(R,v,E,I,F[r+13],12,-40341101);I=oa(I,R,v,E,F[r+14],17,-1502002290);E=oa(E,I,R,v,F[r+15],
|
|
49
49
|
22,1236535329);v=Y(v,E,I,R,F[r+1],5,-165796510);R=Y(R,v,E,I,F[r+6],9,-1069501632);I=Y(I,R,v,E,F[r+11],14,643717713);E=Y(E,I,R,v,F[r],20,-373897302);v=Y(v,E,I,R,F[r+5],5,-701558691);R=Y(R,v,E,I,F[r+10],9,38016083);I=Y(I,R,v,E,F[r+15],14,-660478335);E=Y(E,I,R,v,F[r+4],20,-405537848);v=Y(v,E,I,R,F[r+9],5,568446438);R=Y(R,v,E,I,F[r+14],9,-1019803690);I=Y(I,R,v,E,F[r+3],14,-187363961);E=Y(E,I,R,v,F[r+8],20,1163531501);v=Y(v,E,I,R,F[r+13],5,-1444681467);R=Y(R,v,E,I,F[r+2],9,-51403784);I=Y(I,R,v,E,F[r+7],
|
|
50
50
|
14,1735328473);E=Y(E,I,R,v,F[r+12],20,-1926607734);v=T(E^I^R,v,E,F[r+5],4,-378558);R=T(v^E^I,R,v,F[r+8],11,-2022574463);I=T(R^v^E,I,R,F[r+11],16,1839030562);E=T(I^R^v,E,I,F[r+14],23,-35309556);v=T(E^I^R,v,E,F[r+1],4,-1530992060);R=T(v^E^I,R,v,F[r+4],11,1272893353);I=T(R^v^E,I,R,F[r+7],16,-155497632);E=T(I^R^v,E,I,F[r+10],23,-1094730640);v=T(E^I^R,v,E,F[r+13],4,681279174);R=T(v^E^I,R,v,F[r],11,-358537222);I=T(R^v^E,I,R,F[r+3],16,-722521979);E=T(I^R^v,E,I,F[r+6],23,76029189);v=T(E^I^R,v,E,F[r+9],4,
|
|
51
51
|
-640364487);R=T(v^E^I,R,v,F[r+12],11,-421815835);I=T(R^v^E,I,R,F[r+15],16,530742520);E=T(I^R^v,E,I,F[r+2],23,-995338651);v=U(v,E,I,R,F[r],6,-198630844);R=U(R,v,E,I,F[r+7],10,1126891415);I=U(I,R,v,E,F[r+14],15,-1416354905);E=U(E,I,R,v,F[r+5],21,-57434055);v=U(v,E,I,R,F[r+12],6,1700485571);R=U(R,v,E,I,F[r+3],10,-1894986606);I=U(I,R,v,E,F[r+10],15,-1051523);E=U(E,I,R,v,F[r+1],21,-2054922799);v=U(v,E,I,R,F[r+8],6,1873313359);R=U(R,v,E,I,F[r+15],10,-30611744);I=U(I,R,v,E,F[r+6],15,-1560198380);E=U(E,I,
|
|
52
|
-
R,v,F[r+13],21,1309151649);v=U(v,E,I,R,F[r+4],6,-145523070);R=U(R,v,E,I,F[r+11],10,-1120210379);I=U(I,R,v,E,F[r+2],15,718787259);E=U(E,I,R,v,F[r+9],21,-343485551);v=K(v,sa);E=K(E,Ga);I=K(I,
|
|
52
|
+
R,v,F[r+13],21,1309151649);v=U(v,E,I,R,F[r+4],6,-145523070);R=U(R,v,E,I,F[r+11],10,-1120210379);I=U(I,R,v,E,F[r+2],15,718787259);E=U(E,I,R,v,F[r+9],21,-343485551);v=K(v,sa);E=K(E,Ga);I=K(I,W);R=K(R,ha)}return[v,E,I,R]}(function(F){var r,v=[];v[(F.length>>2)-1]=void 0;for(r=0;r<v.length;r+=1)v[r]=0;var E=8*F.length;for(r=0;r<E;r+=8)v[r>>5]|=(255&F[r/8])<<r%32;return v}(m),8*m.length))});var H=Ea('v5',80,function(m){var z=[1518500249,1859775393,2400959708,3395469782],y=[1732584193,4023233417,2562383102,
|
|
53
53
|
271733878,3285377520];if('string'==typeof m){var F=unescape(encodeURIComponent(m));m=Array(F.length);for(var r=0;r<F.length;r++)m[r]=F.charCodeAt(r)}m.push(128);F=Math.ceil((m.length/4+2)/16);var v=Array(F);for(r=0;r<F;r++){v[r]=Array(16);for(var E=0;16>E;E++)v[r][E]=m[64*r+4*E]<<24|m[64*r+4*E+1]<<16|m[64*r+4*E+2]<<8|m[64*r+4*E+3]}v[F-1][14]=8*(m.length-1)/Math.pow(2,32);v[F-1][14]=Math.floor(v[F-1][14]);v[F-1][15]=8*(m.length-1)&4294967295;for(r=0;r<F;r++){m=Array(80);for(E=0;16>E;E++)m[E]=v[r][E];
|
|
54
|
-
for(E=16;80>E;E++){var I=m[E-3]^m[E-8]^m[E-14]^m[E-16];m[E]=I<<1|I>>>31}I=y[0];var R=y[1],sa=y[2],Ga=y[3],
|
|
54
|
+
for(E=16;80>E;E++){var I=m[E-3]^m[E-8]^m[E-14]^m[E-16];m[E]=I<<1|I>>>31}I=y[0];var R=y[1],sa=y[2],Ga=y[3],W=y[4];for(E=0;80>E;E++){var ha=Math.floor(E/20),ea=I<<5|I>>>27;a:{switch(ha){case 0:var wa=R&sa^~R&Ga;break a;case 1:wa=R^sa^Ga;break a;case 2:wa=R&sa^R&Ga^sa&Ga;break a;case 3:wa=R^sa^Ga;break a}wa=void 0}ha=ea+wa+W+z[ha]+m[E]>>>0;W=Ga;Ga=sa;sa=(R<<30|R>>>2)>>>0;R=I;I=ha}y[0]=y[0]+I>>>0;y[1]=y[1]+R>>>0;y[2]=y[2]+sa>>>0;y[3]=y[3]+Ga>>>0;y[4]=y[4]+W>>>0}return[y[0]>>24&255,y[0]>>16&255,y[0]>>
|
|
55
55
|
8&255,255&y[0],y[1]>>24&255,y[1]>>16&255,y[1]>>8&255,255&y[1],y[2]>>24&255,y[2]>>16&255,y[2]>>8&255,255&y[2],y[3]>>24&255,y[3]>>16&255,y[3]>>8&255,255&y[3],y[4]>>24&255,y[4]>>16&255,y[4]>>8&255,255&y[4]]});D.v1=function(m,z,y){y=z&&y||0;var F=z||[],r=(m=m||{}).node||q,v=void 0!==m.clockseq?m.clockseq:da;if(null==r||null==v){var E=m.random||(m.rng||O)();null==r&&(r=q=[1|E[0],E[1],E[2],E[3],E[4],E[5]]);null==v&&(v=da=16383&(E[6]<<8|E[7]))}E=void 0!==m.msecs?m.msecs:(new Date).getTime();var I=void 0!==
|
|
56
56
|
m.nsecs?m.nsecs:B+1,R=E-L+(I-B)/1E4;if(0>R&&void 0===m.clockseq&&(v=v+1&16383),(0>R||E>L)&&void 0===m.nsecs&&(I=0),1E4<=I)throw Error("uuid.v1(): Can't create more than 10M uuids/sec");L=E;B=I;da=v;m=(1E4*(268435455&(E+=122192928E5))+I)%4294967296;F[y++]=m>>>24&255;F[y++]=m>>>16&255;F[y++]=m>>>8&255;F[y++]=255&m;m=E/4294967296*1E4&268435455;F[y++]=m>>>8&255;F[y++]=255&m;F[y++]=m>>>24&15|16;F[y++]=m>>>16&255;F[y++]=v>>>8|128;F[y++]=255&v;for(v=0;6>v;++v)F[y+v]=r[v];return z||ca(F)};D.v3=N;D.v4=function(m,
|
|
57
57
|
z,y){y=z&&y||0;'string'==typeof m&&(z='binary'===m?Array(16):null,m=null);var F=(m=m||{}).random||(m.rng||O)();if(F[6]=15&F[6]|64,F[8]=63&F[8]|128,z)for(m=0;16>m;++m)z[y+m]=F[m];return z||ca(F)};D.v5=H;Object.defineProperty(D,'__esModule',{value:!0})});
|
|
@@ -115,15 +115,15 @@ c,g,k){if(Va(a)){var l,C,G=b.expando,Z=a.nodeType,pa=Z?b.cache:a,Ba=Z?a[G]:a[G]&
|
|
|
115
115
|
l,C=a.nodeType,G=C?b.cache:a,Z=C?a[b.expando]:b.expando;if(G[Z]){if(c&&(k=g?G[Z]:G[Z].data)){b.isArray(c)?c=c.concat(b.map(c,b.camelCase)):c in k?c=[c]:(c=b.camelCase(c),c=c in k?[c]:c.split(' '));for(l=c.length;l--;)delete k[c[l]];if(g?!n(k):!b.isEmptyObject(k))return}(g||(delete G[Z].data,n(G[Z])))&&(C?b.cleanData([a],!0):e.deleteExpando||G!=G.window?delete G[Z]:G[Z]=void 0)}}}function da(a,c,g,k){var l,C=1,G=20,Z=k?function(){return k.cur()}:function(){return b.css(a,c,'')},pa=Z(),Ba=g&&g[3]||
|
|
116
116
|
(b.cssNumber[c]?'':'px'),ra=(b.cssNumber[c]||'px'!==Ba&&+pa)&&Ob.exec(b.css(a,c));if(ra&&ra[3]!==Ba){Ba=Ba||ra[3];g=g||[];ra=+pa||1;do C=C||'.5',ra/=C,b.style(a,c,ra+Ba);while(C!==(C=Z()/pa)&&1!==C&&--G)}return g&&(ra=+ra||+pa||0,l=g[1]?ra+(g[1]+1)*g[2]:+g[2],k&&(k.unit=Ba,k.start=ra,k.end=l)),l}function za(a){var c='abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video'.split(' ');
|
|
117
117
|
a=a.createDocumentFragment();if(a.createElement)for(;c.length;)a.createElement(c.pop());return a}function N(a,c){var g,k,l=0,C='undefined'!=typeof a.getElementsByTagName?a.getElementsByTagName(c||'*'):'undefined'!=typeof a.querySelectorAll?a.querySelectorAll(c||'*'):void 0;if(!C)for(C=[],g=a.childNodes||a;null!=(k=g[l]);l++)!c||b.nodeName(k,c)?C.push(k):b.merge(C,N(k,c));return void 0===c||c&&b.nodeName(a,c)?b.merge([a],C):C}function L(a,c){for(var g,k=0;null!=(g=a[k]);k++)b._data(g,'globalEval',
|
|
118
|
-
!c||b._data(c[k],'globalEval'))}function B(a){gb.test(a.type)&&(a.defaultChecked=a.checked)}function H(a,c,g,k,l){for(var C,G,Z,pa,Ba,ra,Ta,Wa=a.length,xb=za(c),cb=[],Jb=0;Wa>Jb;Jb++)if(G=a[Jb],G||0===G)if('object'===b.type(G))b.merge(cb,G.nodeType?[G]:G);else if(Ra.test(G)){pa=pa||xb.appendChild(c.createElement('div'));Ba=(fa.exec(G)||['',''])[1].toLowerCase();Ta=qa[Ba]||qa._default;pa.innerHTML=Ta[1]+b.htmlPrefilter(G)+Ta[2];for(C=Ta[0];C--;)pa=pa.lastChild;if(!e.leadingWhitespace&&
|
|
119
|
-
cb.push(c.createTextNode(
|
|
118
|
+
!c||b._data(c[k],'globalEval'))}function B(a){gb.test(a.type)&&(a.defaultChecked=a.checked)}function H(a,c,g,k,l){for(var C,G,Z,pa,Ba,ra,Ta,Wa=a.length,xb=za(c),cb=[],Jb=0;Wa>Jb;Jb++)if(G=a[Jb],G||0===G)if('object'===b.type(G))b.merge(cb,G.nodeType?[G]:G);else if(Ra.test(G)){pa=pa||xb.appendChild(c.createElement('div'));Ba=(fa.exec(G)||['',''])[1].toLowerCase();Ta=qa[Ba]||qa._default;pa.innerHTML=Ta[1]+b.htmlPrefilter(G)+Ta[2];for(C=Ta[0];C--;)pa=pa.lastChild;if(!e.leadingWhitespace&&ka.test(G)&&
|
|
119
|
+
cb.push(c.createTextNode(ka.exec(G)[0])),!e.tbody)for(C=(G='table'!==Ba||ab.test(G)?'<table>'!==Ta[1]||ab.test(G)?0:pa:pa.firstChild)&&G.childNodes.length;C--;)b.nodeName(ra=G.childNodes[C],'tbody')&&!ra.childNodes.length&&G.removeChild(ra);b.merge(cb,pa.childNodes);for(pa.textContent='';pa.firstChild;)pa.removeChild(pa.firstChild);pa=xb.lastChild}else cb.push(c.createTextNode(G));pa&&xb.removeChild(pa);e.appendChecked||b.grep(N(cb,'input'),B);for(Jb=0;G=cb[Jb++];)if(k&&-1<b.inArray(G,k))l&&l.push(G);
|
|
120
120
|
else if(Z=b.contains(G.ownerDocument,G),pa=N(xb.appendChild(G),'script'),Z&&L(pa),g)for(C=0;G=pa[C++];)X.test(G.type||'')&&g.push(G);return xb}function m(){return!0}function z(){return!1}function y(){try{return Na.activeElement}catch(a){}}function F(a,c,g,k,l,C){var G,Z;if('object'==typeof c){'string'!=typeof g&&(k=k||g,g=void 0);for(Z in c)F(a,Z,g,k,c[Z],C);return a}if(null==k&&null==l?(l=g,k=g=void 0):null==l&&('string'==typeof g?(l=k,k=void 0):(l=k,k=g,g=void 0)),!1===l)l=z;else if(!l)return a;
|
|
121
121
|
return 1===C&&(G=l,l=function(pa){return b().off(pa),G.apply(this,arguments)},l.guid=G.guid||(G.guid=b.guid++)),a.each(function(){b.event.add(this,c,l,k,g)})}function r(a,c){return b.nodeName(a,'table')&&b.nodeName(11!==c.nodeType?c:c.firstChild,'tr')?a.getElementsByTagName('tbody')[0]||a.appendChild(a.ownerDocument.createElement('tbody')):a}function v(a){return a.type=(null!==b.find.attr(a,'type'))+'/'+a.type,a}function E(a){var c=Ib.exec(a.type);return c?a.type=c[1]:a.removeAttribute('type'),a}
|
|
122
122
|
function I(a,c){if(1===c.nodeType&&b.hasData(a)){var g,k;var l=b._data(a);a=b._data(c,l);var C=l.events;if(C)for(g in delete a.handle,a.events={},C)for(l=0,k=C[g].length;k>l;l++)b.event.add(c,g,C[g][l]);a.data&&(a.data=b.extend({},a.data))}}function R(a,c,g,k){c=Eb.apply([],c);var l,C,G,Z=0,pa=a.length,Ba=pa-1,ra=c[0],Ta=b.isFunction(ra);if(Ta||1<pa&&'string'==typeof ra&&!e.checkClone&&Db.test(ra))return a.each(function(xb){var cb=a.eq(xb);Ta&&(c[0]=ra.call(this,xb,cb.html()));R(cb,c,g,k)});if(pa&&
|
|
123
123
|
(G=H(c,a[0].ownerDocument,!1,a,k),l=G.firstChild,1===G.childNodes.length&&(G=l),l||k)){var Wa=b.map(N(G,'script'),v);for(C=Wa.length;pa>Z;Z++)l=G,Z!==Ba&&(l=b.clone(l,!0,!0),C&&b.merge(Wa,N(l,'script'))),g.call(a[Z],l,Z);if(C)for(G=Wa[Wa.length-1].ownerDocument,b.map(Wa,E),Z=0;C>Z;Z++)l=Wa[Z],X.test(l.type||'')&&!b._data(l,'globalEval')&&b.contains(G,l)&&(l.src?b._evalUrl&&b._evalUrl(l.src):b.globalEval((l.text||l.textContent||l.innerHTML||'').replace(Kb,'')));G=l=null}return a}function sa(a,c,g){for(var k=
|
|
124
|
-
c?b.filter(c,a):a,l=0;null!=(c=k[l]);l++)g||1!==c.nodeType||b.cleanData(N(c)),c.parentNode&&(g&&b.contains(c.ownerDocument,c)&&L(N(c,'script')),c.parentNode.removeChild(c));return a}function Ga(a,c){a=b(c.createElement(a)).appendTo(c.body);c=b.css(a[0],'display');return a.detach(),c}function
|
|
124
|
+
c?b.filter(c,a):a,l=0;null!=(c=k[l]);l++)g||1!==c.nodeType||b.cleanData(N(c)),c.parentNode&&(g&&b.contains(c.ownerDocument,c)&&L(N(c,'script')),c.parentNode.removeChild(c));return a}function Ga(a,c){a=b(c.createElement(a)).appendTo(c.body);c=b.css(a[0],'display');return a.detach(),c}function W(a){var c=Na,g=Gc[a];return g||(g=Ga(a,c),'none'!==g&&g||(Wb=(Wb||b("<iframe frameborder='0' width='0' height='0'/>")).appendTo(c.documentElement),c=(Wb[0].contentWindow||Wb[0].contentDocument).document,c.write(),
|
|
125
125
|
c.close(),g=Ga(a,c),Wb.detach()),Gc[a]=g),g}function ha(a,c){return{get:function(){return a()?void delete this.get:(this.get=c).apply(this,arguments)}}}function ea(a){if(a in jd)return a;for(var c=a.charAt(0).toUpperCase()+a.slice(1),g=kd.length;g--;)if(a=kd[g]+c,a in jd)return a}function wa(a,c){for(var g,k,l,C=[],G=0,Z=a.length;Z>G;G++)k=a[G],k.style&&(C[G]=b._data(k,'olddisplay'),g=k.style.display,c?(C[G]||'none'!==g||(k.style.display=''),''===k.style.display&&Vb(k)&&(C[G]=b._data(k,'olddisplay',
|
|
126
|
-
|
|
126
|
+
W(k.nodeName)))):(l=Vb(k),(g&&'none'!==g||!l)&&b._data(k,'olddisplay',l?g:b.css(k,'display'))));for(G=0;Z>G;G++)k=a[G],k.style&&(c&&'none'!==k.style.display&&''!==k.style.display||(k.style.display=c?C[G]||'':'none'));return a}function ja(a,c,g){return(a=wd.exec(c))?Math.max(0,a[1]-(g||0))+(a[2]||'px'):c}function ta(a,c,g,k,l){c=g===(k?'border':'content')?4:'width'===c?1:0;for(var C=0;4>c;c+=2)'margin'===g&&(C+=b.css(a,g+zb[c],!0,l)),k?('content'===g&&(C-=b.css(a,'padding'+zb[c],!0,l)),'margin'!==
|
|
127
127
|
g&&(C-=b.css(a,'border'+zb[c]+'Width',!0,l))):(C+=b.css(a,'padding'+zb[c],!0,l),'padding'!==g&&(C+=b.css(a,'border'+zb[c]+'Width',!0,l)));return C}function Da(a,c,g){var k=!0,l='width'===c?a.offsetWidth:a.offsetHeight,C=xc(a),G=e.boxSizing&&'border-box'===b.css(a,'boxSizing',!1,C);if(0>=l||null==l){if(l=sc(a,c,C),(0>l||null==l)&&(l=a.style[c]),Mb.test(l))return l;k=G&&(e.boxSizingReliable()||l===a.style[c]);l=parseFloat(l)||0}return l+ta(a,c,g||(G?'border':'content'),k,C)+'px'}function Pa(a,c,g,k,
|
|
128
128
|
l){return new Pa.prototype.init(a,c,g,k,l)}function La(){return D.setTimeout(function(){Hc=void 0}),Hc=b.now()}function Fa(a,c){var g={height:a},k=0;for(c=c?1:0;4>k;k+=2-c){var l=zb[k];g['margin'+l]=g['padding'+l]=a}return c&&(g.opacity=g.width=a),g}function Oa(a,c,g){for(var k,l=(Ka.tweeners[c]||[]).concat(Ka.tweeners['*']),C=0,G=l.length;G>C;C++)if(k=l[C].call(g,c,a))return k}function Ia(a,c){var g,k,l,C,G;for(g in a)if(k=b.camelCase(g),l=c[k],C=a[g],b.isArray(C)&&(l=C[1],C=a[g]=C[0]),g!==k&&(a[k]=
|
|
129
129
|
C,delete a[g]),G=b.cssHooks[k],G&&'expand'in G)for(g in C=G.expand(C),delete a[k],C)g in a||(a[g]=C[g],c[g]=l);else c[k]=l}function Ka(a,c,g){var k,l=0,C=Ka.prefilters.length,G=b.Deferred().always(function(){delete Z.elem}),Z=function(){if(k)return!1;var Ba=Hc||La();Ba=Math.max(0,pa.startTime+pa.duration-Ba);for(var ra=1-(Ba/pa.duration||0),Ta=0,Wa=pa.tweens.length;Wa>Ta;Ta++)pa.tweens[Ta].run(ra);return G.notifyWith(a,[pa,ra,Ba]),1>ra&&Wa?Ba:(G.resolveWith(a,[pa]),!1)},pa=G.promise({elem:a,props:b.extend({},
|
|
@@ -180,13 +180,13 @@ lt:Ba(function(J,ba,ma){for(ba=0>ma?ma+ba:ma;0<=--ba;)J.push(ba);return J}),gt:B
|
|
|
180
180
|
Ic(ba[ma]),Ma[Ab]?va.push(Ma):Ha.push(Ma);Ma=dc(J,mc(Ha,va));Ma.selector=J}return Ma},ic=c.select=function(J,ba,ma,va){var Ha,Ma,Ua,bb,Xa,kb='function'==typeof J&&J,mb=!va&&Pc(J=kb.selector||J);if(ma=ma||[],1===mb.length){if(Ma=mb[0]=mb[0].slice(0),2<Ma.length&&'ID'===(Ua=Ma[0]).type&&Rb.getById&&9===ba.nodeType&&hc&&Fb.relative[Ma[1].type]){if(ba=(Fb.find.ID(Ua.matches[0].replace(zc,Ac),ba)||[])[0],!ba)return ma;kb&&(ba=ba.parentNode);J=J.slice(Ma.shift().value.length)}for(Ha=Rc.needsContext.test(J)?
|
|
181
181
|
0:Ma.length;Ha--&&(Ua=Ma[Ha],!Fb.relative[bb=Ua.type]);)if((Xa=Fb.find[bb])&&(va=Xa(Ua.matches[0].replace(zc,Ac),Yc.test(Ma[0].type)&&ra(ba.parentNode)||ba))){if(Ma.splice(Ha,1),J=va.length&&Wa(Ma),!J)return Cc.apply(ma,va),ma;break}}return(kb||vb(J,mb))(va,ba,!hc,ma,!ba||Yc.test(J)&&ra(ba.parentNode)||ba),ma},Rb.sortStable=Ab.split('').sort(uc).join('')===Ab,Rb.detectDuplicates=!!Tb,Dc(),Rb.sortDetached=l(function(J){return 1&J.compareDocumentPosition(tb.createElement('div'))}),l(function(J){return J.innerHTML=
|
|
182
182
|
"<a href='#'></a>",'#'===J.firstChild.getAttribute('href')})||C('type|href|height|width',function(J,ba,ma){return ma?void 0:J.getAttribute(ba,'type'===ba.toLowerCase()?1:2)}),Rb.attributes&&l(function(J){return J.innerHTML='<input/>',J.firstChild.setAttribute('value',''),''===J.firstChild.getAttribute('value')})||C('value',function(J,ba,ma){return ma||'input'!==J.nodeName.toLowerCase()?void 0:J.defaultValue}),l(function(J){return null==J.getAttribute('disabled')})||C('checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped',
|
|
183
|
-
function(J,ba,ma){var va;return ma?void 0:!0===J[ba]?ba.toLowerCase():(va=J.getAttributeNode(ba))&&va.specified?va.value:null}),c}(D);b.find=A;b.expr=A.selectors;b.expr[':']=b.expr.pseudos;b.uniqueSort=b.unique=A.uniqueSort;b.text=A.getText;b.isXMLDoc=A.isXML;b.contains=A.contains;var
|
|
183
|
+
function(J,ba,ma){var va;return ma?void 0:!0===J[ba]?ba.toLowerCase():(va=J.getAttributeNode(ba))&&va.specified?va.value:null}),c}(D);b.find=A;b.expr=A.selectors;b.expr[':']=b.expr.pseudos;b.uniqueSort=b.unique=A.uniqueSort;b.text=A.getText;b.isXMLDoc=A.isXML;b.contains=A.contains;var V=function(a,c,g){for(var k=[],l=void 0!==g;(a=a[c])&&9!==a.nodeType;)if(1===a.nodeType){if(l&&b(a).is(g))break;k.push(a)}return k},P=function(a,c){for(var g=[];a;a=a.nextSibling)1===a.nodeType&&a!==c&&g.push(a);return g},
|
|
184
184
|
aa=b.expr.match.needsContext,Q=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;b.filter=function(a,c,g){var k=c[0];return g&&(a=':not('+a+')'),1===c.length&&1===k.nodeType?b.find.matchesSelector(k,a)?[k]:[]:b.find.matches(a,b.grep(c,function(l){return 1===l.nodeType}))};b.fn.extend({find:function(a){var c,g=[],k=this,l=k.length;if('string'!=typeof a)return this.pushStack(b(a).filter(function(){for(c=0;l>c;c++)if(b.contains(k[c],this))return!0}));for(c=0;l>c;c++)b.find(a,k[c],g);return g=this.pushStack(1<
|
|
185
185
|
l?b.unique(g):g),g.selector=this.selector?this.selector+' '+a:a,g},filter:function(a){return this.pushStack(Ea(this,a||[],!1))},not:function(a){return this.pushStack(Ea(this,a||[],!0))},is:function(a){return!!Ea(this,'string'==typeof a&&aa.test(a)?b(a):a||[],!1).length}});var ia=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/;(b.fn.init=function(a,c,g){var k,l;if(!a)return this;if(g=g||ua,'string'==typeof a){if(k='<'===a.charAt(0)&&'>'===a.charAt(a.length-1)&&3<=a.length?[null,a,null]:ia.exec(a),!k||!k[1]&&
|
|
186
186
|
c)return!c||c.jquery?(c||g).find(a):this.constructor(c).find(a);if(k[1]){if(c=c instanceof b?c[0]:c,b.merge(this,b.parseHTML(k[1],c&&c.nodeType?c.ownerDocument||c:Na,!0)),Q.test(k[1])&&b.isPlainObject(c))for(k in c)b.isFunction(this[k])?this[k](c[k]):this.attr(k,c[k]);return this}if(l=Na.getElementById(k[2]),l&&l.parentNode){if(l.id!==k[2])return ua.find(a);this.length=1;this[0]=l}return this.context=Na,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):b.isFunction(a)?
|
|
187
187
|
'undefined'!=typeof g.ready?g.ready(a):a(b):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),b.makeArray(a,this))}).prototype=b.fn;var ua=b(Na);var na=/^(?:parents|prev(?:Until|All))/,la={children:!0,contents:!0,next:!0,prev:!0};b.fn.extend({has:function(a){var c,g=b(a,this),k=g.length;return this.filter(function(){for(c=0;k>c;c++)if(b.contains(this,g[c]))return!0})},closest:function(a,c){for(var g,k=0,l=this.length,C=[],G=aa.test(a)||'string'!=typeof a?b(a,c||this.context):
|
|
188
188
|
0;l>k;k++)for(g=this[k];g&&g!==c;g=g.parentNode)if(11>g.nodeType&&(G?-1<G.index(g):1===g.nodeType&&b.find.matchesSelector(g,a))){C.push(g);break}return this.pushStack(1<C.length?b.uniqueSort(C):C)},index:function(a){return a?'string'==typeof a?b.inArray(this[0],b(a)):b.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,c){return this.pushStack(b.uniqueSort(b.merge(this.get(),b(a,c))))},addBack:function(a){return this.add(null==a?this.prevObject:
|
|
189
|
-
this.prevObject.filter(a))}});b.each({parent:function(a){return(a=a.parentNode)&&11!==a.nodeType?a:null},parents:function(a){return
|
|
189
|
+
this.prevObject.filter(a))}});b.each({parent:function(a){return(a=a.parentNode)&&11!==a.nodeType?a:null},parents:function(a){return V(a,'parentNode')},parentsUntil:function(a,c,g){return V(a,'parentNode',g)},next:function(a){return K(a,'nextSibling')},prev:function(a){return K(a,'previousSibling')},nextAll:function(a){return V(a,'nextSibling')},prevAll:function(a){return V(a,'previousSibling')},nextUntil:function(a,c,g){return V(a,'nextSibling',g)},prevUntil:function(a,c,g){return V(a,'previousSibling',
|
|
190
190
|
g)},siblings:function(a){return P((a.parentNode||{}).firstChild,a)},children:function(a){return P(a.firstChild)},contents:function(a){return b.nodeName(a,'iframe')?a.contentDocument||a.contentWindow.document:b.merge([],a.childNodes)}},function(a,c){b.fn[a]=function(g,k){var l=b.map(this,c,g);return'Until'!==a.slice(-5)&&(k=g),k&&'string'==typeof k&&(l=b.filter(k,l)),1<this.length&&(la[a]||(l=b.uniqueSort(l)),na.test(a)&&(l=l.reverse())),this.pushStack(l)}});var Ca=/\S+/g;b.Callbacks=function(a){a=
|
|
191
191
|
'string'==typeof a?T(a):b.extend({},a);var c,g,k,l,C=[],G=[],Z=-1,pa=function(){l=a.once;for(k=c=!0;G.length;Z=-1)for(g=G.shift();++Z<C.length;)!1===C[Z].apply(g[0],g[1])&&a.stopOnFalse&&(Z=C.length,g=!1);a.memory||(g=!1);c=!1;l&&(C=g?[]:'')},Ba={add:function(){return C&&(g&&!c&&(Z=C.length-1,G.push(g)),function Wa(Ta){b.each(Ta,function(xb,cb){b.isFunction(cb)?a.unique&&Ba.has(cb)||C.push(cb):cb&&cb.length&&'string'!==b.type(cb)&&Wa(cb)})}(arguments),g&&!c&&pa()),this},remove:function(){return b.each(arguments,
|
|
192
192
|
function(ra,Ta){for(var Wa;-1<(Wa=b.inArray(Ta,C,Wa));)C.splice(Wa,1),Z>=Wa&&Z--}),this},has:function(ra){return ra?-1<b.inArray(ra,C):0<C.length},empty:function(){return C&&=[],this},disable:function(){return l=G=[],C=g='',this},disabled:function(){return!C},lock:function(){return l=!0,g||Ba.disable(),this},locked:function(){return!!l},fireWith:function(ra,Ta){return l||(Ta=Ta||[],Ta=[ra,Ta.slice?Ta.slice():Ta],G.push(Ta),c||pa()),this},fire:function(){return Ba.fireWith(this,arguments),this},fired:function(){return!!k}};
|
|
@@ -202,7 +202,7 @@ c,g){var k;return a?(c=(c||'fx')+'queue',k=b._data(a,c),g&&(!k||b.isArray(g)?k=b
|
|
|
202
202
|
c+'queue');b._removeData(a,g)})})}});b.fn.extend({queue:function(a,c){var g=2;return'string'!=typeof a&&(c=a,a='fx',g--),arguments.length<g?b.queue(this[0],a):void 0===c?this:this.each(function(){var k=b.queue(this,a,c);b._queueHooks(this,a);'fx'===a&&'inprogress'!==k[0]&&b.dequeue(this,a)})},dequeue:function(a){return this.each(function(){b.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||'fx',[])},promise:function(a,c){var g,k=1,l=b.Deferred(),C=this,G=this.length,Z=function(){--k||
|
|
203
203
|
l.resolveWith(C,[C])};'string'!=typeof a&&(c=a,a=void 0);for(a=a||'fx';G--;)(g=b._data(C[G],a+'queueHooks'))&&g.empty&&(k++,g.empty.add(Z));return Z(),l.promise(c)}});(function(){var a;e.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var c,g,k;return g=Na.getElementsByTagName('body')[0],g&&g.style?(c=Na.createElement('div'),k=Na.createElement('div'),k.style.cssText='position:absolute;border:0;width:0;height:0;top:0;left:-9999px',g.appendChild(k).appendChild(c),'undefined'!=typeof c.style.zoom&&
|
|
204
204
|
(c.style.cssText='-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1',c.appendChild(Na.createElement('div')).style.width='5px',a=3!==c.offsetWidth),g.removeChild(k),a):void 0}})();var Hb=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,Ob=new RegExp('^(?:([+-])=|)('+Hb+')([a-z%]*)$','i'),zb=['Top','Right','Bottom','Left'],Vb=function(a,c){return a=c||a,'none'===b.css(a,'display')||!b.contains(a.ownerDocument,a)},
|
|
205
|
-
Za=function(a,c,g,k,l,C,G){var Z=0,pa=a.length,Ba=null==g;if('object'===b.type(g))for(Z in l=!0,g)Za(a,c,Z,g[Z],!0,C,G);else if(void 0!==k&&(l=!0,b.isFunction(k)||(G=!0),Ba&&(G?(c.call(a,k),c=null):(Ba=c,c=function(ra,Ta,Wa){return Ba.call(b(ra),Wa)})),c))for(;pa>Z;Z++)c(a[Z],g,G?k:k.call(a[Z],Z,c(a[Z],g)));return l?a:Ba?c.call(a):pa?c(a[0],g):C},gb=/^(?:checkbox|radio)$/i,fa=/<([\w:-]+)/,X=/^$|\/(?:java|ecma)script/i,
|
|
205
|
+
Za=function(a,c,g,k,l,C,G){var Z=0,pa=a.length,Ba=null==g;if('object'===b.type(g))for(Z in l=!0,g)Za(a,c,Z,g[Z],!0,C,G);else if(void 0!==k&&(l=!0,b.isFunction(k)||(G=!0),Ba&&(G?(c.call(a,k),c=null):(Ba=c,c=function(ra,Ta,Wa){return Ba.call(b(ra),Wa)})),c))for(;pa>Z;Z++)c(a[Z],g,G?k:k.call(a[Z],Z,c(a[Z],g)));return l?a:Ba?c.call(a):pa?c(a[0],g):C},gb=/^(?:checkbox|radio)$/i,fa=/<([\w:-]+)/,X=/^$|\/(?:java|ecma)script/i,ka=/^\s+/;!function(){var a=Na.createElement('div'),c=Na.createDocumentFragment(),
|
|
206
206
|
g=Na.createElement('input');a.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";e.leadingWhitespace=3===a.firstChild.nodeType;e.tbody=!a.getElementsByTagName('tbody').length;e.htmlSerialize=!!a.getElementsByTagName('link').length;e.html5Clone='<:nav></:nav>'!==Na.createElement('nav').cloneNode(!0).outerHTML;g.type='checkbox';g.checked=!0;c.appendChild(g);e.appendChecked=g.checked;a.innerHTML='<textarea>x</textarea>';e.noCloneChecked=!!a.cloneNode(!0).lastChild.defaultValue;
|
|
207
207
|
c.appendChild(a);g=Na.createElement('input');g.setAttribute('type','radio');g.setAttribute('checked','checked');g.setAttribute('name','t');a.appendChild(g);e.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked;e.noCloneEvent=!!a.addEventListener;a[b.expando]=1;e.attributes=!a.getAttribute(b.expando)}();var qa={option:[1,"<select multiple='multiple'>",'</select>'],legend:[1,'<fieldset>','</fieldset>'],area:[1,'<map>','</map>'],param:[1,'<object>','</object>'],thead:[1,'<table>','</table>'],
|
|
208
208
|
tr:[2,'<table><tbody>','</tbody></table>'],col:[2,'<table><tbody></tbody><colgroup>','</colgroup></table>'],td:[3,'<table><tbody><tr>','</tr></tbody></table>'],_default:e.htmlSerialize?[0,'','']:[1,'X<div>','</div>']};qa.optgroup=qa.option;qa.tbody=qa.tfoot=qa.colgroup=qa.caption=qa.thead;qa.th=qa.td;var Ra=/<|&#?\w+;/,ab=/<tbody/i;!function(){var a,c=Na.createElement('div');for(a in{submit:!0,change:!0,focusin:!0}){var g='on'+a;(e[a]=g in D)||(c.setAttribute(g,'t'),e[a]=!1===c.attributes[g].expando)}}();
|
|
@@ -233,7 +233,7 @@ Zb.firstChild)),!(e.noCloneEvent&&e.noCloneChecked||1!==a.nodeType&&11!==a.nodeT
|
|
|
233
233
|
Ba=e.attributes,ra=b.event.special;null!=(g=a[G]);G++)if((c||Va(g))&&(l=g[Z],C=l&&pa[l])){if(C.events)for(k in C.events)ra[k]?b.event.remove(g,k):b.removeEvent(g,k,C.handle);pa[l]&&(delete pa[l],Ba||'undefined'==typeof g.removeAttribute?g[Z]=void 0:g.removeAttribute(Z),Gb.push(l))}}});b.fn.extend({domManip:R,detach:function(a){return sa(this,a,!0)},remove:function(a){return sa(this,a)},text:function(a){return Za(this,function(c){return void 0===c?b.text(this):this.empty().append((this[0]&&this[0].ownerDocument||
|
|
234
234
|
Na).createTextNode(c))},null,a,arguments.length)},append:function(){return R(this,arguments,function(a){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||r(this,a).appendChild(a)})},prepend:function(){return R(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var c=r(this,a);c.insertBefore(a,c.firstChild)}})},before:function(){return R(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return R(this,arguments,
|
|
235
235
|
function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,c=0;null!=(a=this[c]);c++){for(1===a.nodeType&&b.cleanData(N(a,!1));a.firstChild;)a.removeChild(a.firstChild);a.options&&b.nodeName(a,'select')&&(a.options.length=0)}return this},clone:function(a,c){return a=null==a?!1:a,c=null==c?a:c,this.map(function(){return b.clone(this,a,c)})},html:function(a){return Za(this,function(c){var g=this[0]||{},k=0,l=this.length;if(void 0===c)return 1===g.nodeType?
|
|
236
|
-
g.innerHTML.replace(ob,''):void 0;if(!('string'!=typeof c||Nb.test(c)||!e.htmlSerialize&&rb.test(c)||!e.leadingWhitespace&&
|
|
236
|
+
g.innerHTML.replace(ob,''):void 0;if(!('string'!=typeof c||Nb.test(c)||!e.htmlSerialize&&rb.test(c)||!e.leadingWhitespace&&ka.test(c)||qa[(fa.exec(c)||['',''])[1].toLowerCase()])){c=b.htmlPrefilter(c);try{for(;l>k;k++)g=this[k]||{},1===g.nodeType&&(b.cleanData(N(g,!1)),g.innerHTML=c);g=0}catch(C){}}g&&this.empty().append(c)},null,a,arguments.length)},replaceWith:function(){var a=[];return R(this,arguments,function(c){var g=this.parentNode;0>b.inArray(this,a)&&(b.cleanData(N(this)),g&&g.replaceChild(c,
|
|
237
237
|
this))},a)}});b.each({appendTo:'append',prependTo:'prepend',insertBefore:'before',insertAfter:'after',replaceAll:'replaceWith'},function(a,c){b.fn[a]=function(g){for(var k=0,l=[],C=b(g),G=C.length-1;G>=k;k++)g=k===G?this:this.clone(!0),b(C[k])[c](g),Pb.apply(l,g.get());return this.pushStack(l)}});var Wb,Gc={HTML:'block',BODY:'block'},qc=/^margin/,Mb=new RegExp('^('+Hb+')(?!px)[a-z%]+$','i'),Nc=function(a,c,g,k){var l,C={};for(l in c)C[l]=a.style[l],a.style[l]=c[l];g=g.apply(a,k||[]);for(l in c)a.style[l]=
|
|
238
238
|
C[l];return g},wc=Na.documentElement;!function(){var a,c,g,k,l,C,G=Na.createElement('div'),Z=Na.createElement('div');if(Z.style){Z.style.cssText='float:left;opacity:.5';e.opacity='0.5'===Z.style.opacity;e.cssFloat=!!Z.style.cssFloat;Z.style.backgroundClip='content-box';Z.cloneNode(!0).style.backgroundClip='';e.clearCloneStyle='content-box'===Z.style.backgroundClip;G=Na.createElement('div');G.style.cssText='border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute';
|
|
239
239
|
Z.innerHTML='';G.appendChild(Z);e.boxSizing=''===Z.style.boxSizing||''===Z.style.MozBoxSizing||''===Z.style.WebkitBoxSizing;b.extend(e,{reliableHiddenOffsets:function(){return null==a&&pa(),k},boxSizingReliable:function(){return null==a&&pa(),g},pixelMarginRight:function(){return null==a&&pa(),c},pixelPosition:function(){return null==a&&pa(),a},reliableMarginRight:function(){return null==a&&pa(),l},reliableMarginLeft:function(){return null==a&&pa(),C}});function pa(){var Ba,ra,Ta=Na.documentElement;
|
|
@@ -244,15 +244,15 @@ C),void 0===G?G:G+''}):wc.currentStyle&&(xc=function(a){return a.currentStyle},s
|
|
|
244
244
|
{position:'absolute',visibility:'hidden',display:'block'},od={letterSpacing:'0',fontWeight:'400'},kd=['Webkit','O','Moz','ms'],jd=Na.createElement('div').style;b.extend({cssHooks:{opacity:{get:function(a,c){if(c)return a=sc(a,'opacity'),''===a?'1':a}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{'float':e.cssFloat?'cssFloat':'styleFloat'},style:function(a,
|
|
245
245
|
c,g,k){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var l,C,G,Z=b.camelCase(c),pa=a.style;if(c=b.cssProps[Z]||(b.cssProps[Z]=ea(Z)||Z),G=b.cssHooks[c]||b.cssHooks[Z],void 0===g)return G&&'get'in G&&void 0!==(l=G.get(a,!1,k))?l:pa[c];if(C=typeof g,'string'===C&&(l=Ob.exec(g))&&l[1]&&(g=da(a,c,l),C='number'),null!=g&&g===g&&('number'===C&&(g+=l&&l[3]||(b.cssNumber[Z]?'':'px')),e.clearCloneStyle||''!==g||0!==c.indexOf('background')||(pa[c]='inherit'),!(G&&'set'in G&&void 0===(g=G.set(a,g,k)))))try{pa[c]=
|
|
246
246
|
g}catch(Ba){}}},css:function(a,c,g,k){var l,C,G,Z=b.camelCase(c);return c=b.cssProps[Z]||(b.cssProps[Z]=ea(Z)||Z),G=b.cssHooks[c]||b.cssHooks[Z],G&&'get'in G&&(C=G.get(a,!0,g)),void 0===C&&(C=sc(a,c,k)),'normal'===C&&c in od&&(C=od[c]),''===g||g?(l=parseFloat(C),!0===g||isFinite(l)?l||0:C):C}});b.each(['height','width'],function(a,c){b.cssHooks[c]={get:function(g,k,l){return k?Jd.test(b.css(g,'display'))&&0===g.offsetWidth?Nc(g,Kd,function(){return Da(g,c,l)}):Da(g,c,l):void 0},set:function(g,k,l){var C=
|
|
247
|
-
l&&xc(g);return
|
|
247
|
+
l&&xc(g);return ja(g,k,l?ta(g,c,l,e.boxSizing&&'border-box'===b.css(g,'boxSizing',!1,C),C):0)}}});e.opacity||(b.cssHooks.opacity={get:function(a,c){return Tc.test((c&&a.currentStyle?a.currentStyle.filter:a.style.filter)||'')?.01*parseFloat(RegExp.$1)+'':c?'1':''},set:function(a,c){var g=a.style;a=a.currentStyle;var k=b.isNumeric(c)?'alpha(opacity='+100*c+')':'',l=a&&a.filter||g.filter||'';g.zoom=1;(1<=c||''===c)&&''===b.trim(l.replace(Oc,''))&&g.removeAttribute&&(g.removeAttribute('filter'),''===
|
|
248
248
|
c||a&&!a.filter)||(g.filter=Oc.test(l)?l.replace(Oc,k):l+' '+k)}});b.cssHooks.marginRight=ha(e.reliableMarginRight,function(a,c){return c?Nc(a,{display:'inline-block'},sc,[a,'marginRight']):void 0});b.cssHooks.marginLeft=ha(e.reliableMarginLeft,function(a,c){return c?(parseFloat(sc(a,'marginLeft'))||(b.contains(a.ownerDocument,a)?a.getBoundingClientRect().left-Nc(a,{marginLeft:0},function(){return a.getBoundingClientRect().left}):0))+'px':void 0});b.each({margin:'',padding:'',border:'Width'},function(a,
|
|
249
|
-
c){b.cssHooks[a+c]={expand:function(g){var k=0,l={};for(g='string'==typeof g?g.split(' '):[g];4>k;k++)l[a+zb[k]+c]=g[k]||g[k-2]||g[0];return l}};qc.test(a)||(b.cssHooks[a+c].set=
|
|
249
|
+
c){b.cssHooks[a+c]={expand:function(g){var k=0,l={};for(g='string'==typeof g?g.split(' '):[g];4>k;k++)l[a+zb[k]+c]=g[k]||g[k-2]||g[0];return l}};qc.test(a)||(b.cssHooks[a+c].set=ja)});b.fn.extend({css:function(a,c){return Za(this,function(g,k,l){var C,G={},Z=0;if(b.isArray(k)){l=xc(g);for(C=k.length;C>Z;Z++)G[k[Z]]=b.css(g,k[Z],!1,l);return G}return void 0!==l?b.style(g,k,l):b.css(g,k)},a,c,1<arguments.length)},show:function(){return wa(this,!0)},hide:function(){return wa(this)},toggle:function(a){return'boolean'==
|
|
250
250
|
typeof a?a?this.show():this.hide():this.each(function(){Vb(this)?b(this).show():b(this).hide()})}});b.Tween=Pa;Pa.prototype={constructor:Pa,init:function(a,c,g,k,l,C){this.elem=a;this.prop=g;this.easing=l||b.easing._default;this.options=c;this.start=this.now=this.cur();this.end=k;this.unit=C||(b.cssNumber[g]?'':'px')},cur:function(){var a=Pa.propHooks[this.prop];return a&&a.get?a.get(this):Pa.propHooks._default.get(this)},run:function(a){var c,g=Pa.propHooks[this.prop];return this.options.duration?
|
|
251
251
|
this.pos=c=b.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=c=a,this.now=(this.end-this.start)*c+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),g&&g.set?g.set(this):Pa.propHooks._default.set(this),this}};Pa.prototype.init.prototype=Pa.prototype;Pa.propHooks={_default:{get:function(a){var c;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(c=b.css(a.elem,a.prop,''),c&&'auto'!==c?c:0)},set:function(a){b.fx.step[a.prop]?
|
|
252
252
|
b.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[b.cssProps[a.prop]]&&!b.cssHooks[a.prop]?a.elem[a.prop]=a.now:b.style(a.elem,a.prop,a.now+a.unit)}}};Pa.propHooks.scrollTop=Pa.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}};b.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:'swing'};b.fx=Pa.prototype.init;b.fx.step={};var Hc,bd,Ld=/^(?:toggle|show|hide)$/,Md=/queueHooks$/;b.Animation=b.extend(Ka,
|
|
253
253
|
{tweeners:{'*':[function(a,c){var g=this.createTween(a,c);return da(g.elem,a,Ob.exec(c),g),g}]},tweener:function(a,c){b.isFunction(a)?(c=a,a=['*']):a=a.match(Ca);for(var g,k=0,l=a.length;l>k;k++)g=a[k],Ka.tweeners[g]=Ka.tweeners[g]||[],Ka.tweeners[g].unshift(c)},prefilters:[function(a,c,g){var k,l,C,G,Z,pa,Ba,ra=this,Ta={},Wa=a.style,xb=a.nodeType&&Vb(a),cb=b._data(a,'fxshow');g.queue||(G=b._queueHooks(a,'fx'),null==G.unqueued&&(G.unqueued=0,Z=G.empty.fire,G.empty.fire=function(){G.unqueued||Z()}),
|
|
254
|
-
G.unqueued++,ra.always(function(){ra.always(function(){G.unqueued--;b.queue(a,'fx').length||G.empty.fire()})}));1===a.nodeType&&('height'in c||'width'in c)&&(g.overflow=[Wa.overflow,Wa.overflowX,Wa.overflowY],pa=b.css(a,'display'),Ba='none'===pa?b._data(a,'olddisplay')||
|
|
255
|
-
g.overflow[0];Wa.overflowX=g.overflow[1];Wa.overflowY=g.overflow[2]}));for(k in c)if(l=c[k],Ld.exec(l)){if(delete c[k],C=C||'toggle'===l,l===(xb?'hide':'show')){if('show'!==l||!cb||void 0===cb[k])continue;xb=!0}Ta[k]=cb&&cb[k]||b.style(a,k)}else pa=void 0;if(b.isEmptyObject(Ta))'inline'===('none'===pa?
|
|
254
|
+
G.unqueued++,ra.always(function(){ra.always(function(){G.unqueued--;b.queue(a,'fx').length||G.empty.fire()})}));1===a.nodeType&&('height'in c||'width'in c)&&(g.overflow=[Wa.overflow,Wa.overflowX,Wa.overflowY],pa=b.css(a,'display'),Ba='none'===pa?b._data(a,'olddisplay')||W(a.nodeName):pa,'inline'===Ba&&'none'===b.css(a,'float')&&(e.inlineBlockNeedsLayout&&'inline'!==W(a.nodeName)?Wa.zoom=1:Wa.display='inline-block'));g.overflow&&(Wa.overflow='hidden',e.shrinkWrapBlocks()||ra.always(function(){Wa.overflow=
|
|
255
|
+
g.overflow[0];Wa.overflowX=g.overflow[1];Wa.overflowY=g.overflow[2]}));for(k in c)if(l=c[k],Ld.exec(l)){if(delete c[k],C=C||'toggle'===l,l===(xb?'hide':'show')){if('show'!==l||!cb||void 0===cb[k])continue;xb=!0}Ta[k]=cb&&cb[k]||b.style(a,k)}else pa=void 0;if(b.isEmptyObject(Ta))'inline'===('none'===pa?W(a.nodeName):pa)&&(Wa.display=pa);else for(k in cb?'hidden'in cb&&(xb=cb.hidden):cb=b._data(a,'fxshow',{}),C&&(cb.hidden=!xb),xb?b(a).show():ra.done(function(){b(a).hide()}),ra.done(function(){var Jb;
|
|
256
256
|
b._removeData(a,'fxshow');for(Jb in Ta)b.style(a,Jb,Ta[Jb])}),Ta)c=Oa(xb?cb[k]:0,k,ra),k in cb||(cb[k]=c.start,xb&&(c.end=c.start,c.start='width'===k||'height'===k?1:0))}],prefilter:function(a,c){c?Ka.prefilters.unshift(a):Ka.prefilters.push(a)}});b.speed=function(a,c,g){var k=a&&'object'==typeof a?b.extend({},a):{complete:g||!g&&c||b.isFunction(a)&&a,duration:a,easing:g&&c||c&&!b.isFunction(c)&&c};return k.duration=b.fx.off?0:'number'==typeof k.duration?k.duration:k.duration in b.fx.speeds?b.fx.speeds[k.duration]:
|
|
257
257
|
b.fx.speeds._default,null!=k.queue&&!0!==k.queue||(k.queue='fx'),k.old=k.complete,k.complete=function(){b.isFunction(k.old)&&k.old.call(this);k.queue&&b.dequeue(this,k.queue)},k};b.fn.extend({fadeTo:function(a,c,g,k){return this.filter(Vb).css('opacity',0).show().end().animate({opacity:c},a,g,k)},animate:function(a,c,g,k){var l=b.isEmptyObject(a),C=b.speed(c,g,k);c=function(){var G=Ka(this,b.extend({},a),C);(l||b._data(this,'finish'))&&G.stop(!0)};return c.finish=c,l||!1===C.queue?this.each(c):this.queue(C.queue,
|
|
258
258
|
c)},stop:function(a,c,g){var k=function(l){var C=l.stop;delete l.stop;C(g)};return'string'!=typeof a&&(g=c,c=a,a=void 0),c&&!1!==a&&this.queue(a||'fx',[]),this.each(function(){var l=!0,C=null!=a&&a+'queueHooks',G=b.timers,Z=b._data(this);if(C)Z[C]&&Z[C].stop&&k(Z[C]);else for(C in Z)Z[C]&&Z[C].stop&&Md.test(C)&&k(Z[C]);for(C=G.length;C--;)G[C].elem!==this||null!=a&&G[C].queue!==a||(G[C].anim.stop(g),l=!1,G.splice(C,1));!l&&g||b.dequeue(this,a)})},finish:function(a){return!1!==a&&(a=a||'fx'),this.each(function(){var c=
|
|
@@ -308,13 +308,13 @@ null,c)},delegate:function(a,c,g,k){return this.on(c,a,g,k)},undelegate:function
|
|
|
308
308
|
function Collection(D,O){var ca='undefined'!==typeof module&&module.exports?!1:!0,Ea=ca?require('vendor/uuid'):require('uuid'),K=ca?require('lib/merge'):require('../../../lib/merge'),T={isCaseSensitive:{false:{re:'^%s$',modifiers:'i'},true:{re:'^%s$'}}},oa=!1,Y=!1,U=null;ca={useLocalStorage:!1,locale:'en',searchOptionRules:T};O='object'==typeof O?K(O,ca):ca;var n=['not null'],S=function(B){try{return eval(B)}catch(H){throw Error('Could not evaluate condition `'+B+'`.\n'+H.stack);}};if('undefined'==
|
|
309
309
|
typeof D||''==D||null==D)D=[];if(!Array.isArray(D))throw Error('`new Collection([content] [, options] )`: `content` argument must be an Array !');D=D?JSON.clone(D):[];for(var q=[],da=ca=0,za=D.length;da<za;++da)D[da]||(D[da]={}),D[da]._uuid=Ea.v4(),q[ca]=D[da]._uuid,++ca;var N=D;N.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');var B=0,H=arguments.length;
|
|
310
310
|
if(1==arguments.length){if('object'!=typeof arguments[0])throw Error('searchOption must be an object');for(var m in arguments[0])if('undefined'==typeof T[m])throw Error(arguments[1]+' is not an allowed searchOption !');U=arguments[0]}else for(U||={};B<H;++B){if('undefined'==typeof T[arguments[1]])throw Error(arguments[1]+' is not an allowed searchOption !');'undefined'==typeof U[arguments[0]]&&(U[arguments[0]]={});/true|false/i.test(arguments[2])?U[arguments[0]][arguments[1]]=/true/i.test(arguments[2])?
|
|
311
|
-
!0:!1:U[arguments[0]][arguments[1]]=arguments[2]}return N};N.find=function(){oa=!1;'boolean'==typeof arguments[arguments.length-1]&&(oa=arguments[arguments.length-1],delete arguments[arguments.length-1],--arguments.length);var B=null,H=null,m=null;try{B=JSON.stringify(arguments),H=JSON.parse(B),m=H.count()}catch(
|
|
312
|
-
R=null,sa=[],Ga=function(
|
|
313
|
-
'"'+Da+'"'+
|
|
314
|
-
else if('undefined'!=typeof Da&&'object'!==typeof Da&&E&&'undefined'!=typeof E[ta]){var Fa=0;var Oa=E[ta].count();for(var Ia in E[ta])La[Ia][E[ta][Ia]].re=La[Ia][E[ta][Ia]].re.replace(/%s/,
|
|
315
|
-
ta))}catch(Fa){}La&&(Array.isArray(La)?La=La[1].split(/:/)[1]:'string'==typeof La&&/:/.test(La)&&(La=La.split(/:/)[1]),/(<|>|=)/.test(
|
|
316
|
-
ha=function(
|
|
317
|
-
r=null===B[wa]||/(boolean|number)/.test(typeof B[wa])?B[wa]:B[wa].toLocaleLowerCase();sa=/\./.test(wa)?/\[\*\]/.test(wa)?ha(B[wa],wa,y[ea],R,0):
|
|
311
|
+
!0:!1:U[arguments[0]][arguments[1]]=arguments[2]}return N};N.find=function(){oa=!1;'boolean'==typeof arguments[arguments.length-1]&&(oa=arguments[arguments.length-1],delete arguments[arguments.length-1],--arguments.length);var B=null,H=null,m=null;try{B=JSON.stringify(arguments),H=JSON.parse(B),m=H.count()}catch(ja){throw Error('filter must be an object\n'+ja.stack);}if('undefined'!=typeof H&&0<m){1<m&&(oa=!0);m=B=null;var z=0,y=Array.isArray(this)?this:JSON.clone(D),F=[],r='',v=null,E=U,I=O.searchOptionRules,
|
|
312
|
+
R=null,sa=[],Ga=function(ja,ta,Da,Pa,La){if(null===ja&&null===Da)++Pa;else if(ja&&-1<n.indexOf(r)&&'not null'==r&&'undefined'!=typeof Da&&'object'!==typeof Da&&'null'!=Da&&'undefined'!=Da)0>F.indexOf(Da)&&++Pa;else if('undefined'!=typeof Da&&'object'!==typeof Da&&/(<|>|=)/.test(ja)&&!/undefined|function/.test(typeof Da))ta=ja,La=Da+ja,'string'==typeof ja&&'string'==typeof Da&&(La=ja.replace(/^(<=|>=|!==|!=|===|!==)/g,''),'string'!=typeof Da||/^"(.*)"$/.test(La)||(ja=ja.replace(La,'"'+La+'"')),La=
|
|
313
|
+
'"'+Da+'"'+ja,ja=ta),/(\d{4})\-(\d{2})\-(\d{2})(\s+|T)(\d{2}):(\d{2}):(\d{2})/.test(Da)&&/(\d{4})\-(\d{2})\-(\d{2})(\s+|T)(\d{2}):(\d{2}):(\d{2})/.test(ja)?S(Da.replace(/(\d{4})\-(\d{2})\-(\d{2})(\s+|T)(\d{2}):(\d{2}):(\d{2})/,'new Date("$&")')+ja.replace(/(\d{4})\-(\d{2})\-(\d{2})(\s+|T)(\d{2}):(\d{2}):(\d{2})/,'new Date("$&")'))&&++Pa:S(La)&&++Pa;else if('undefined'!=typeof Da&&'object'!==typeof Da&&Da===ja&&!E||'undefined'!=typeof Da&&'object'!==typeof Da&&Da===ja&&'undefined'==typeof E[ta])++Pa;
|
|
314
|
+
else if('undefined'!=typeof Da&&'object'!==typeof Da&&E&&'undefined'!=typeof E[ta]){var Fa=0;var Oa=E[ta].count();for(var Ia in E[ta])La[Ia][E[ta][Ia]].re=La[Ia][E[ta][Ia]].re.replace(/%s/,ja),v=La[Ia][E[ta][Ia]].modifiers?new RegExp(La[Ia][E[ta][Ia]].re,La[Ia][E[ta][Ia]].modifiers):new RegExp(La[Ia][E[ta][Ia]].re),v.test(Da)&&++Fa;Fa==Oa&&++Pa}return{matched:Pa}},W=function(ja,ta,Da,Pa){var La=ta.split(/\./g);La=La[La.length-1];v=new RegExp('("'+La+'":\\w+)');La=null;try{Da&&(La=eval('_content.'+
|
|
315
|
+
ta))}catch(Fa){}La&&(Array.isArray(La)?La=La[1].split(/:/)[1]:'string'==typeof La&&/:/.test(La)&&(La=La.split(/:/)[1]),/(<|>|=)/.test(ja)?/(\d{4})\-(\d{2})\-(\d{2})(\s+|T)(\d{2}):(\d{2}):(\d{2})/.test(La)&&/(\d{4})\-(\d{2})\-(\d{2})(\s+|T)(\d{2}):(\d{2}):(\d{2})/.test(ja)?S(La.replace(/(\d{4})\-(\d{2})\-(\d{2})(\s+|T)(\d{2}):(\d{2}):(\d{2})/,'new Date("$&")')+ja.replace(/(\d{4})\-(\d{2})\-(\d{2})(\s+|T)(\d{2}):(\d{2}):(\d{2})/,'new Date("$&")'))&&++Pa:S(La+ja)&&++Pa:La==ja&&++Pa);return{matched:Pa}},
|
|
316
|
+
ha=function(ja,ta,Da,Pa,La){ta=ta.split(/\[\*\]/g);La=ta[0].replace(/\[\*\]/,'');Da=Da[La];ta=ta[1];/^\./.test(ta)&&(ta=ta.substr(1));La=0;if(Da)for(var Fa=0,Oa=Da.length;Fa<Oa&&!(sa=/\./.test(ta)?W(ja,ta,Da[Fa],La):Ga(ja,ta,Da[Fa],La,I),La=sa.matched,0<La);++Fa);return{matched:Pa+La}},ea;for(ea in y)if(y[ea]||(y[ea]={}),!/undefined|function/.test(typeof y[ea]))for(let ja=0,ta=H.count();ja<ta;++ja){B=H[ja];m=B.count();R=0;for(var wa in B){if('undefined'==typeof B[wa])throw Error('filter `'+wa+'` cannot be left undefined');
|
|
317
|
+
r=null===B[wa]||/(boolean|number)/.test(typeof B[wa])?B[wa]:B[wa].toLocaleLowerCase();sa=/\./.test(wa)?/\[\*\]/.test(wa)?ha(B[wa],wa,y[ea],R,0):W(B[wa],wa,y[ea],R):Ga(B[wa],wa,y[ea][wa],R,I);R=sa.matched}if(R==m)if(oa&&Y&&0>q.indexOf(y[ea]._uuid)||Y||!oa){if(!oa||oa&&0>F.indexOf(y[ea]._uuid)||Y)F[z]=y[ea],++z}else oa&&!Y&&0>F.indexOf(y[ea]._uuid)&&(F[z]=y[ea],++z)}}else F=D;U=null;F.insert=N.insert;F.notIn=N.notIn;F.find=this.find;F.update=N.update;F.replace=N.replace;F.or=N.or;F.findOne=N.findOne;
|
|
318
318
|
F.limit=N.limit;F.orderBy=N.orderBy;F.delete=N.delete;F.toRaw=N.toRaw;F.filter=N.filter;return F};N.findOne=function(){var B=null;'string'==typeof arguments[arguments.length-1]&&(delete arguments[arguments.length-1],--arguments.length);0<arguments.length&&(B=arguments);if('undefined'==typeof B||!B||'object'!=typeof B)throw Error('[ Collection ][ findOne ] `filters` argument must be defined: Array or Filter Object(s) expected');B=null;var H=Array.isArray(arguments[0])?arguments[0]:N.find.apply(this,
|
|
319
319
|
arguments)||[];0<H.length&&(B=H.limit(1).toRaw()[0]);return B};N.or=function(){arguments[arguments.length]=!0;++arguments.length;return N.find.apply(this,arguments)};N.limit=function(B){if('undefined'==typeof B||'number'!=typeof B)throw Error('[Collection::result->limit(resultLimit)] : `resultLimit` parametter must by a `number`');var H=Array.isArray(this)?this:JSON.clone(D);H=H.splice(0,B);H.insert=N.insert;H.update=N.update;H.replace=N.replace;H.notIn=N.notIn;H.findOne=N.findOne;H.orderBy=N.orderBy;
|
|
320
320
|
H.max=N.max;H.delete=N.delete;H.toRaw=N.toRaw;H.filter=N.filter;return H};N.notIn=function(){var B=null,H=null,m=!0;'string'==typeof arguments[arguments.length-1]&&(B=arguments[arguments.length-1],delete arguments[arguments.length-1],--arguments.length);'boolean'==typeof arguments[arguments.length-1]&&(m=arguments[arguments.length-1],delete arguments[arguments.length-1],--arguments.length);0<arguments.length&&(H=arguments);if('undefined'==typeof H||!H||'object'!=typeof H)throw Error('[ Collection ][ notIn ] `filters` argument must be defined: Array or Filter Object(s) expected');
|
|
@@ -328,10 +328,10 @@ N.limit;H.find=N.find;H.findOne=N.findOne;H.insert=N.insert;H.update=N.update;H.
|
|
|
328
328
|
for(var y=0,F=z.length;y<F;++y){z[y]=JSON.clone(m);for(var r=0,v=H.length;r<v;++r){if('undefined'==typeof H[r][B]&&'_uuid'==B&&'undefined'!=typeof H[r].id)B='id';else if('undefined'==typeof H[r][B]&&'_uuid'==B)throw Error('No comparison key defined !');if(H[r][B]==z[y][B]){H[r]=z[y];break}}}}H.limit=N.limit;H.find=N.find;H.findOne=N.findOne;H.insert=N.insert;H.update=N.update;H.replace=N.replace;H.orderBy=N.orderBy;H.max=N.max;H.notIn=N.notIn;H.delete=N.delete;H.toRaw=N.toRaw;H.filter=N.filter;return H};
|
|
329
329
|
N['delete']=function(){var B=N.notIn.apply(this,arguments);B.limit=N.limit;B.find=N.find;B.findOne=N.findOne;B.insert=N.insert;B.update=N.update;B.replace=N.replace;B.orderBy=N.orderBy;B.max=N.max;B.notIn=N.notIn;B.toRaw=N.toRaw;B.filter=N.filter;B.delete=this.delete;return B};N.orderBy=function(){if('undefined'==typeof arguments||1>arguments.length)throw Error('[ Collection->orderBy(filter) ] where `filter` must not be empty or null');if(1==arguments.length)var B=arguments[0];else{B=Array(arguments.length);
|
|
330
330
|
for(var H=0,m=B.length;H<m;++H)B[H]=arguments[H]}H=Array.isArray(this)?this:JSON.clone(D);return L(B,H.toRaw())};N.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');var B=arguments[0];
|
|
331
|
-
try{var H=Object.keys(B)[0],m={};m[H]='desc';return N.find(B).orderBy(m).limit(1)[0][H]}catch(z){throw z;}};var L=function(B,H){if('object'!=typeof B)throw Error('`filter` parametter must be an object or an array');var m={},z=null,y=null,F=z=null;z=[];if(0==B.count())return null;m.asc=function(r,v){var E=v.map(function(I,R){var sa={};sa.index=R;sa[r]=I[r];return sa});E.sort(function(I,R){var sa=function(Ga,
|
|
332
|
-
1:0);return'string'==typeof Ga&&''!=Ga||'string'==typeof
|
|
333
|
-
sa,I[R]=v[sa],++R;y=function(Ga,
|
|
334
|
-
('boolean'==typeof Ga[ha[wa]]&&(ta=Ga[ha[wa]]?1:0),'boolean'==typeof
|
|
331
|
+
try{var H=Object.keys(B)[0],m={};m[H]='desc';return N.find(B).orderBy(m).limit(1)[0][H]}catch(z){throw z;}};var L=function(B,H){if('object'!=typeof B)throw Error('`filter` parametter must be an object or an array');var m={},z=null,y=null,F=z=null;z=[];if(0==B.count())return null;m.asc=function(r,v){var E=v.map(function(I,R){var sa={};sa.index=R;sa[r]=I[r];return sa});E.sort(function(I,R){var sa=function(Ga,W){/^(true|false)$/i.test(Ga)&&(Ga=/true/i.test(Ga)?1:0);/^(true|false)$/i.test(W)&&(W=/true/i.test(W)?
|
|
332
|
+
1:0);return'string'==typeof Ga&&''!=Ga||'string'==typeof W?('number'==typeof Ga&&(Ga=''+Ga),'number'==typeof W&&(W=''+W),Ga.localeCompare(W,void 0,{sensitivity:'case',caseFirst:'upper'})):Ga>W?1:Ga<W?-1:0};return'object'==typeof I?sa(I[r],R[r]):sa(I,R)});return E.map(function(I,R,sa){return v[I.index]})};m.desc=function(r,v){return m.asc(r,v).reverse()};z=function(r,v){var E=[],I=[];if(Array.isArray(v))for(var R=0,sa=v.length;R<sa;++R)E[R]=Object.keys(v[R])[0],I[R]=v[R][E[R]];else for(sa in R=0,v)E[R]=
|
|
333
|
+
sa,I[R]=v[sa],++R;y=function(Ga,W,ha,ea,wa){var ja='desc'==ea[wa]?1:0,ta,Da=ta=null;return'string'==typeof Ga[ha[wa]]&&''!=Ga[ha[wa]]?(ta=Ga[ha[wa]].localeCompare(W[ha[wa]]),0==ja&&0!=ta?0>ta?-1:1:0!=ta?0>ta?1:-1:ha.length-1>wa?y(Ga,W,ha,ea,wa+1):0):'number'==typeof Ga[ha[wa]]||'number'==typeof W[ha[wa]]?(ta=(''+Ga[ha[wa]]).localeCompare(''+W[ha[wa]],void 0,{numeric:!0}),0==ja&&0!=ta?0>ta?-1:1:0!=ta?0>ta?1:-1:ha.length-1>wa?y(Ga,W,ha,ea,wa+1):0):'boolean'==typeof Ga[ha[wa]]||'boolean'==typeof W[ha[wa]]?
|
|
334
|
+
('boolean'==typeof Ga[ha[wa]]&&(ta=Ga[ha[wa]]?1:0),'boolean'==typeof W[ha[wa]]&&(Da=W[ha[wa]]?1:0),ta>Da?0==ja?1:-1:ta<Da?0==ja?-1:1:ha.length-1>wa?y(Ga,W,ha,ea,wa+1):0):Ga[ha[wa]]>W[ha[wa]]?0==ja?1:-1:Ga[ha[wa]]<W[ha[wa]]?0==ja?-1:1:ha.length-1>wa?y(Ga,W,ha,ea,wa+1):0};return r.sort(function(Ga,W){return y(Ga,W,E,I,0)})};Array.isArray(B)||1<B.count()?z=z(H,B):(F=Object.keys(B)[0],z=B[F],z=m[z](F,H));z.find=N.find;z.findOne=N.findOne;z.limit=N.limit;z.notIn=N.notIn;z.insert=N.insert;z.update=N.update;
|
|
335
335
|
z.replace=N.replace;z.delete=N.delete;z.orderBy=N.orderBy;z.max=N.max;z.toRaw=N.toRaw;z.filter=N.filter;return z};N.toRaw=function(){for(var B=Array.isArray(this)?this:D,H=0,m=B.length;H<m;++H)B[H]._uuid&&delete B[H]._uuid;return JSON.clone(B)};N.filter=function(B){if('undefined'==typeof B)throw Error('`filter` parametter must be a string or an array.');var H=Array.isArray(this)?this:D;if(!H.length)return[];var m=0,z=H.length,y=[],F=0;if(Array.isArray(B))for(var r,v=B.length,E;m<z;++m){E=!1;for(r=
|
|
336
336
|
0;r<v;++r)'undefined'!=typeof H[m][B[r]]&&('undefined'==typeof y[F]&&(y[F]={}),y[F][B[r]]=H[m][B[r]],E=!0);E&&++F}else for(;m<z;++m)'undefined'!=typeof H[m][B]&&('undefined'==typeof y[F]&&(y[F]={}),y[F][B]=H[m][B],++F);return JSON.clone(y)};return N}'undefined'!==typeof module&&module.exports?module.exports=Collection:'function'===typeof define&&define.amd&&define('lib/collection',[],function(){return Collection});
|
|
337
337
|
function FormValidatorUtil(D,O,ca,Ea){var K='undefined'!==typeof module&&module.exports?!1:!0,T=K?require('lib/merge'):require('../../../../../lib/merge');K||require('../../../../../helpers');K&&require('helpers/dateFormat');var oa=K?require('lib/routing'):require('../../../../../lib/routing'),Y=function(){var m=!1,z=null;K?K&&'undefined'!=typeof gina.forms&&(z=gina.forms):z=getContext('gina').forms||null;z&&'undefined'!=typeof z.validators&&(m=!0);return m},U={errors:{},keys:{'%l':'label','%n':'name',
|
|
@@ -341,28 +341,28 @@ query:'Must be a valid response',isApiError:'Condition not satisfied'}},n=null;i
|
|
|
341
341
|
String.fromCharCode(r);break;case 12:case 13:var v=m[z++];y+=String.fromCharCode((r&31)<<6|v&63);break;case 14:v=m[z++];var E=m[z++];y+=String.fromCharCode((r&15)<<12|(v&63)<<6|(E&63)<<0)}}return y},da=function(m,z){z=m.match(/\{\{([^{{}}]+)\}\}/g);for(let y=0,F=z.length;y<F;y++){let r=z[y].replace(/\[/g,'["').replace(/\]/g,'"]').replace(/\{|\}/g,'').trim();try{r=eval('data.'+r).replace(/^"|"$/g,''),m=m.replace(new RegExp(z[y].replace(/\{|\[|\]|\}/g,'\\$&'),'g'),r)}catch(v){}}return m},za=function(m,
|
|
342
342
|
z){var y=n[this.name].errors||{},F=this.target.id||this.target.getAttribute('id');if(n.isValid()){var r=this.target.dataset.ginaFormValidatorTestedValue;console.debug('[ '+this.name+' ]','TESTED VALUE -> '+this.value+' vs '+r);F='asyncCompleted.'+F;var v=this.target.form.getAttribute('id'),E='undefined'!=typeof gina.validator&&'undefined'!=typeof gina.validator.$forms[v]&&'undefined'!=typeof gina.validator.$forms[v].cachedErrors?gina.validator.$forms[v].cachedErrors:null;if(!r||'undefined'==typeof r||
|
|
343
343
|
r!==this.value)this.target.dataset.ginaFormValidatorTestedValue=this.value,E&&'undefined'!=typeof E[this.name]&&'undefined'!=typeof E[this.name].query&&(delete E[this.name].query,'undefined'!=typeof gina.validator.$forms[v]&&'undefined'!=typeof gina.validator.$forms[v].errors&&delete gina.validator.$forms[v].errors.query);else if(r===this.value){var I=!1;E&&'undefined'!=typeof E[this.name]&&'undefined'!=typeof E[this.name].query&&'undefined'!=typeof E[this.name].query[this.value]&&(this.error=z=E[this.name].query[this.value].slice(0),
|
|
344
|
-
I=!0);y.query=H(this.error||z||U.errorLabels.query,this);console.debug('[2] potential cached error detected !! ',I,E,' vs ',y.query);I&&(this.errors=y,this.valid=!1);'undefined'!=typeof gina.events[F]&&triggerEvent(gina,this.target,F,n[this.name]);return n[this.name]}var R=null,sa=this;if(window.XMLHttpRequest)R=new XMLHttpRequest;else if(window.ActiveXObject)try{R=new ActiveXObject('Msxml2.XMLHTTP')}catch(wa){try{R=new ActiveXObject('Microsoft.XMLHTTP')}catch(
|
|
345
|
-
r=m.data||null;y=null;F=/^true$/i.test(this.target.form.dataset.ginaFormLiveCheckEnabled)?!0:!1;y=JSON.stringify(r);if(/\$/.test(y)){r=y.match(/\$[-_\[\]a-z 0-9]+/g)||[];v=E=null;for(let wa=0,
|
|
346
|
-
var
|
|
347
|
-
typeof z.responseType?z.responseType:'';R.withCredentials=!0}else z.isSynchrone?R.open(z.method,z.url,z.isSynchrone):R.open(z.method,z.url);for(var ha in z.headers)'Content-Type'==ha&&'undefined'!=typeof y&&null!=y&&''!=y||R.setRequestHeader(ha,z.headers[ha]);'undefined'!=typeof y&&null!=y&&''!=y&&R.setRequestHeader('Content-Type',y);var ea=function(wa){sa.value=U.data[sa.name]=sa.value?sa.value.toLowerCase():sa.value;var
|
|
348
|
-
{},Da='undefined'!=typeof wa.error&&'undefined'!=typeof wa.fields?wa.fields:{};if(0<Da.count()&&!
|
|
344
|
+
I=!0);y.query=H(this.error||z||U.errorLabels.query,this);console.debug('[2] potential cached error detected !! ',I,E,' vs ',y.query);I&&(this.errors=y,this.valid=!1);'undefined'!=typeof gina.events[F]&&triggerEvent(gina,this.target,F,n[this.name]);return n[this.name]}var R=null,sa=this;if(window.XMLHttpRequest)R=new XMLHttpRequest;else if(window.ActiveXObject)try{R=new ActiveXObject('Msxml2.XMLHTTP')}catch(wa){try{R=new ActiveXObject('Microsoft.XMLHTTP')}catch(ja){}}z={isSynchrone:!1,headers:{}};
|
|
345
|
+
r=m.data||null;y=null;F=/^true$/i.test(this.target.form.dataset.ginaFormLiveCheckEnabled)?!0:!1;y=JSON.stringify(r);if(/\$/.test(y)){r=y.match(/\$[-_\[\]a-z 0-9]+/g)||[];v=E=null;for(let wa=0,ja=r.length;wa<ja;wa++)v=r[wa].replace(/\$/g,''),re=new RegExp('\\'+r[wa].replace(/\[|\]/g,'\\$&'),'g'),E=U.data[v]||null,!E&&F&&(E=S(this.target.form,v).value),y=y.replace(re,E)}r=y.replace(/\\"/g,'');var Ga='undefined'==typeof m.validIf?!0:m.validIf;z=T(z,m,ca);delete z.data;delete z.validIf;y=z.headers['Content-Type'];
|
|
346
|
+
var W=null;F=this.target.getAttribute('id');if(!/^http/.test(z.url)&&/@/.test(z.url))try{I=oa.getRoute(z.url),z.url=I.toUrl()}catch(wa){throw wa;}if(z.withCredentials){if('withCredentials'in R)z.isSynchrone?R.open(z.method,z.url,z.isSynchrone):R.open(z.method,z.url);else if('undefined'!=typeof XDomainRequest)R=new XDomainRequest,R.open(z.method,z.url);else throw R=null,W='CORS not supported: the server is missing the header `"Access-Control-Allow-Credentials": true` ',Error(W);R.responseType='undefined'!=
|
|
347
|
+
typeof z.responseType?z.responseType:'';R.withCredentials=!0}else z.isSynchrone?R.open(z.method,z.url,z.isSynchrone):R.open(z.method,z.url);for(var ha in z.headers)'Content-Type'==ha&&'undefined'!=typeof y&&null!=y&&''!=y||R.setRequestHeader(ha,z.headers[ha]);'undefined'!=typeof y&&null!=y&&''!=y&&R.setRequestHeader('Content-Type',y);var ea=function(wa){sa.value=U.data[sa.name]=sa.value?sa.value.toLowerCase():sa.value;var ja=wa.isValid||!1;ja=Ga!=ja?!1:!0;n[sa.name].valid=ja;var ta=n[sa.name].errors||
|
|
348
|
+
{},Da='undefined'!=typeof wa.error&&'undefined'!=typeof wa.fields?wa.fields:{};if(0<Da.count()&&!ja||!ja){if(!ja){var Pa=null;'undefined'!=typeof Da[sa.name]?U.errorLabels.query=da(Da[sa.name],m.data):'undefined'!=typeof wa.error&&/^5/.test(wa.status)&&(Pa=wa.error);ta.query=H(Pa||sa.error||U.errorLabels.query||m.error,sa);console.debug('[1] query error detected !! ',wa)}ta.query||''!=sa.value||(ja=!0)}ja&&'undefined'!=typeof ta.query&&delete ta.query;sa.valid=ja;wa=gina.validator.$forms[sa.target.form.getAttribute('id')].cachedErrors||
|
|
349
349
|
{};0<ta.count()?(sa.errors=ta,'undefined'==typeof n[sa.name].errors&&(n[sa.name].errors={}),n[sa.name].errors=T(n[sa.name].errors,ta),'undefined'!=typeof ta.query&&ta.query&&('undefined'==typeof wa[sa.name]&&(wa[sa.name]={}),'undefined'==typeof wa[sa.name].query&&(wa[sa.name].query={}),wa[sa.name].query[sa.value]=ta.query.slice(0)),ta=sa.target.getAttribute('data-gina-form-errors'),/query/.test(ta)||sa.target.setAttribute('data-gina-form-errors',ta&&''!=ta?ta+' query':'query')):'undefined'!=typeof wa[sa.name]&&
|
|
350
|
-
'undefined'!=typeof wa[sa.name].query&&'undefined'!=typeof wa[sa.name].query[sa.value]&&delete wa[sa.name].query[sa.value];ta=sa.target.id||sa.target.getAttribute('id');console.debug('prematurely completed event `asyncCompleted.'+ta+'`');return triggerEvent(gina,sa.target,'asyncCompleted.'+ta,n[sa.name])};R&&(R.onerror=function(wa,
|
|
351
|
-
!0;wa=this.getResponseHeader('Content-Type');if(/\/json/.test(wa))wa=JSON.parse(this.responseText),'undefined'==typeof wa.status&&(wa.status=this.status);else if(wa={status:R.status,message:''},/^(\{|\[)/.test(R.responseText))try{wa=T(wa,JSON.parse(R.responseText))}catch(ta){wa=T(wa,ta)}return ea(wa)},R.onload=function(){try{
|
|
352
|
-
{status:R.status,message:''},/^(\{|\[)/.test(R.responseText))try{
|
|
350
|
+
'undefined'!=typeof wa[sa.name].query&&'undefined'!=typeof wa[sa.name].query[sa.value]&&delete wa[sa.name].query[sa.value];ta=sa.target.id||sa.target.getAttribute('id');console.debug('prematurely completed event `asyncCompleted.'+ta+'`');return triggerEvent(gina,sa.target,'asyncCompleted.'+ta,n[sa.name])};R&&(R.onerror=function(wa,ja){console.debug('query error [2] detected !! ',ja,'Transaction error: might be due to the server CORS settings.\nPlease, check the console for more details.');isOnException=
|
|
351
|
+
!0;wa=this.getResponseHeader('Content-Type');if(/\/json/.test(wa))wa=JSON.parse(this.responseText),'undefined'==typeof wa.status&&(wa.status=this.status);else if(wa={status:R.status,message:''},/^(\{|\[)/.test(R.responseText))try{wa=T(wa,JSON.parse(R.responseText))}catch(ta){wa=T(wa,ta)}return ea(wa)},R.onload=function(){try{W=this.responseText;var wa=this.getResponseHeader('Content-Type');if(/\/json/.test(wa))W=JSON.parse(this.responseText),'undefined'==typeof W.status&&(W.status=this.status);else if(W=
|
|
352
|
+
{status:R.status,message:''},/^(\{|\[)/.test(R.responseText))try{W=T(W,JSON.parse(R.responseText))}catch(ja){W=T(W,ja)}return ea(W)}catch(ja){throw ja;}},D?R.send(r):R.send())}else console.debug('stopping on errors ...'),triggerEvent(gina,this.target,'asyncCompleted.'+F,n[this.name])},N=async function(m,z,y,F){var r=(new (require(_(GINA_FRAMEWORK_DIR+'/core/config.js',!0)))).getInstance(),v=null,E=null,I=null,R=getContext('bundle');if(/@/.test(m.url)){var sa=m.url.split(/@/);E=sa[0];I=sa[1];getConfig(R,
|
|
353
353
|
'app');try{r.bundle!==I&&(v=getConfig(R,'app').proxy[I])}catch(ea){throw Error('Could not retrieve `proxy` configuration for bundle `'+I+'`. Please check your `/config/app.json`.\n'+ea.stack);}sa=null}else throw Error('external url/domain not handled at this moment, please contact us if you need support for it.');sa=JSON.clone(oa.getRoute(m.url,m.data));var Ga=r[I][r.env];v||(r.bundle==I&&(v=getConfig(R,'settings').server.credentials,m.ca=v.ca||null,m.hostname=Ga.server.scheme+'://'+Ga.host,m.port=
|
|
354
|
-
Ga.port[Ga.server.protocol][Ga.server.scheme],m.protocol=Ga.server.protocol,m.rejectUnauthorized=!1),v={ca:m.ca,hostname:m.hostname,port:m.port,path:m.path},'undefined'!=typeof m.protocol&&(v.protocol=m.protocol),'undefined'!=typeof m.rejectUnauthorized&&(v.rejectUnauthorized=m.rejectUnauthorized));E={method:sa.method,requirements:sa.requirements,namespace:sa.namespace||void 0,url:
|
|
354
|
+
Ga.port[Ga.server.protocol][Ga.server.scheme],m.protocol=Ga.server.protocol,m.rejectUnauthorized=!1),v={ca:m.ca,hostname:m.hostname,port:m.port,path:m.path},'undefined'!=typeof m.protocol&&(v.protocol=m.protocol),'undefined'!=typeof m.rejectUnauthorized&&(v.rejectUnauthorized=m.rejectUnauthorized));E={method:sa.method,requirements:sa.requirements,namespace:sa.namespace||void 0,url:decodeURI(sa.url),rule:E+'@'+I,param:JSON.clone(sa.param),middleware:JSON.clone(sa.middleware),bundle:sa.bundle,isXMLRequest:z.isXMLRequest,
|
|
355
355
|
isWithCredentials:z.isWithCredentials};I=E.rule.replace('@'+I,'')||'_common';I={template:'undefined'!=typeof Ga.content.templates?Ga.content.templates[I]||Ga.content.templates._common:void 0,cacheless:Ga.cacheless};I=T(I,E);Ga=JSON.clone(Ga);I.conf=Ga;I.conf.content.routing[I.rule].param=E.param;I.template&&'undefined'==typeof I.template.ginaLoader&&(I.template.ginaLoader=I.conf.content.templates._common.ginaLoader);I.conf.content.routing[I.rule].param=E.param;delete I.middleware;delete I.param;delete I.requirements;
|
|
356
|
-
Ga=new (require(_(GINA_FRAMEWORK_DIR+'/core/controller/controller.js'),!0))(I);Ga.name=sa.param.control;Ga.setOptions(z,y,F,I);z='object'==typeof m.data&&0<m.data.count()?m.data:{};if(/^get|delete|put$/i.test(m.method)){y=0;for(let ea in z)'object'==typeof z[ea]&&
|
|
357
|
-
ha);return
|
|
356
|
+
Ga=new (require(_(GINA_FRAMEWORK_DIR+'/core/controller/controller.js'),!0))(I);Ga.name=sa.param.control;Ga.setOptions(z,y,F,I);z='object'==typeof m.data&&0<m.data.count()?m.data:{};if(/^get|delete|put$/i.test(m.method)){y=0;for(let ea in z)'object'==typeof z[ea]&&encodeRFC5987ValueChars(JSON.stringify(z[ea])),y++}v.method=m.method;v.path=sa.url;m=require('util').promisify;var W={isValid:!1},ha=!1;await m(Ga.query)(v,z).then(function(ea){W=ea}).catch(function(ea){ha=ea});ha&&(console.error(ha),W.error=
|
|
357
|
+
ha);return W},L=null;L=K?za:N;var B=function(m,z){var y=null,F=null;'undefined'==typeof n[m]&&'undefined'!=typeof z&&(n[m]=y=z);if('object'==typeof n[m])try{y=JSON.parse(JSON.stringify(n[m]))}catch(r){y=n[m]}else y=n[m];F='';K&&'undefined'!=typeof O&&(F=O[m].getAttribute('data-gina-form-field-label')||'');n[m]={target:K&&'undefined'!=typeof O?O[m]:null,name:m,value:y,valid:!1,label:F,exclude:!1};n[m].is=function(r,v,E){var I=!1,R='undefined'!=typeof window&&'undefined'!=typeof window._currentValidatorAlias?
|
|
358
358
|
window._currentValidatorAlias:'is';'undefined'!=typeof window&&window._currentValidatorAlias&&delete window._currentValidatorAlias;var sa=n[this.name].errors||{};U.data[this.name]=n[this.name].value;'undefined'==typeof sa.isRequired&&''==this.value&&!/^false$/i.test(this.value)&&0!=this.value||!sa.isRequired&&''==this.value&&!/^false$/i.test(this.value)&&0!=this.value?I=!0:sa.isRequired||'string'!=typeof this.value||''!=this.value||(I=!0);if(!I&&/^(true|false)$/i.test(r))I=r;else if(!I){var Ga=null,
|
|
359
|
-
|
|
360
|
-
RegExp)I=r.test(this.value)?!0:!1;else if('boolean'==typeof r)I=r?!0:!1;else try{/\/(.*)\//.test(r)?(Ga=r.match(/\/(.*)\//).pop(),
|
|
359
|
+
W=null;if(/[!=>><a-z 0-9]+/i.test(r)){if((W=r.match(/\${0}[-_,.\[\]a-z0-9]+/ig))&&0<W.length){for(var ha=0,ea=W.length;ha<ea;++ha)'undefined'!=typeof n[W[ha]]&&W[ha]&&(Ga=new RegExp('\\$'+W[ha]+'(?!\\S+)','g'),r=''==n[W[ha]].value?r.replace(Ga,'""'):'string'==typeof n[W[ha]].value?r.replace(Ga,'"'+n[W[ha]].value+'"'):r.replace(Ga,n[W[ha]].value));try{r=r.replace(/(\(|\)|return)/g,''),I=/^\//.test(r)?eval(r+'.test("'+this.value+'")'):eval(r)}catch(wa){throw Error(wa.stack||wa.message);}}}else if(r instanceof
|
|
360
|
+
RegExp)I=r.test(this.value)?!0:!1;else if('boolean'==typeof r)I=r?!0:!1;else try{/\/(.*)\//.test(r)?(Ga=r.match(/\/(.*)\//).pop(),W=r.replace('/'+Ga+'/',''),I=(new RegExp(Ga,W)).test(this.value)):I=eval(r)}catch(wa){throw Error(wa.stack||wa.message);}}I?I&&'undefined'!=typeof sa[R]&&delete sa[R]:(sa[R]=H(this.error||v||U.errorLabels[R],this),'undefined'!=typeof E&&(sa.stack=E));this.valid=I;0<sa.count()&&(this.errors=sa);return n[this.name]};n[m].set=function(r){this.value=U.data[this.name]=r;this.target.setAttribute('value',
|
|
361
361
|
r);return n[this.name]};n[m].isEmail=function(){this.value=U.data[this.name]=this.value?this.value.toLowerCase():this.value;K&&this.target&&''!=this.target.value&&/[A-Z]+/.test(this.target.value)&&(this.target.value=this.value);var r=/^(([^<>()[\]\\.,;:\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)?!0:!1,v=n[this.name].errors||{};v.isRequired||''!=this.value||(r=!0);r?r&&'undefined'!=typeof v.isEmail&&
|
|
362
362
|
delete v.isEmail:v.isEmail=H(this.error||U.errorLabels.isEmail,this);this.valid=r;0<v.count()&&(this.errors=v);return n[this.name]};n[m].isJsonWebToken=function(){this.value=U.data[this.name]=this.value?this.value.toLowerCase():this.value;K&&this.target&&''!=this.target.value&&/[A-Z]+/.test(this.target.value)&&(this.target.value=this.value);var r=/^[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.?[A-Za-z0-9-_.+/=]*$/.test(this.value)?!0:!1,v=n[this.name].errors||{};v.isRequired||''!=this.value||(r=!0);r?r&&'undefined'!=
|
|
363
363
|
typeof v.isJsonWebToken&&delete v.isJsonWebToken:v.isJsonWebToken=H(this.error||U.errorLabels.isJsonWebToken,this);this.valid=r;0<v.count()&&(this.errors=v);return n[this.name]};n[m].isBoolean=function(){var r=null,v=n[this.name].errors||{};v.isRequired&&0==this.value&&(delete v.isRequired,this.errors=v);switch(this.value){case 'true':case !0:case 1:r=this.value=U.data[this.name]=!0;break;case 'false':case !1:case 0:r=this.value=U.data[this.name]=!1}(r=null!==r?!0:!1)?r&&'undefined'!=typeof v.isBoolean&&
|
|
364
364
|
delete v.isBoolean:v.isBoolean=H(this.error||U.errorLabels.isBoolean,this);this.valid=r;0<v.count()&&(this.errors=v);return n[this.name]};n[m].isNumber=function(r,v){var E=this.value,I=!1,R=!0,sa=!0,Ga=n[this.name].errors||{};try{'string'==typeof E&&/,|\./g.test(E)?E=U.data[this.name]=this.value=parseFloat(E.replace(/,/g,'.').replace(/\s+/g,'')):'string'==typeof E&&''!=E&&(E=U.data[this.name]=this.value=parseInt(E.replace(/\s+/g,'')))}catch(ha){Ga.isNumber=H(this.error||U.errorLabels.isNumber,this),
|
|
365
|
-
this.valid=!1,0<Ga.count()&&(this.errors=Ga)}if(+E===+E&&(I=!0,!Ga.isRequired&&''!=E)){var
|
|
365
|
+
this.valid=!1,0<Ga.count()&&(this.errors=Ga)}if(+E===+E&&(I=!0,!Ga.isRequired&&''!=E)){var W=E.toString().length;r&&'number'==typeof r&&W<r&&(R=!1,this.size=r);v&&'number'==typeof v&&W>v&&(sa=!1,this.size=v)}I&&R&&sa||(I||(Ga.isNumber=H(this.error||U.errorLabels.isNumber,this)),R&&sa||(R||(Ga.isNumberLength=H(this.error||U.errorLabels.isNumberMinLength,this)),sa||(Ga.isNumberLength=H(this.error||U.errorLabels.isNumberMaxLength,this)),r===v&&(Ga.isNumberLength=H(this.error||U.errorLabels.isNumberLength,
|
|
366
366
|
this))),I=!1);I&&'undefined'!=typeof Ga.isNumberLength&&delete Ga.isNumberLength;this.valid=I;this.value=U.data[this.name]=''!=E?Number(E):E;0<Ga.count()&&(this.errors=Ga);return n[this.name]};n[m].toInteger=function(){var r=this.value,v=n[this.name].errors||{};if(r)try{this.value=U.data[this.name]=Math.round(r)}catch(E){v.toInteger=H(this.error||U.errorLabels.toInteger,this),this.valid=!1,0<v.count()&&(this.errors=v)}return n[this.name]};n[m].isInteger=function(r,v){var E=this.value,I=!1,R=!0,sa=
|
|
367
367
|
!0,Ga=n[this.name].errors||{};+E===+E&&0===E%1&&(I=!0,Ga.isRequired||''==E||(r&&'number'==typeof r&&E.length<r&&(R=!1,this.size=r),v&&'number'==typeof v&&E.length>v&&(sa=!1,this.size=v)));I&&R&&sa||(I||(Ga.isInteger=H(this.error||U.errorLabels.isInteger,this)),R&&sa||(R||(Ga.isIntegerLength=H(this.error||U.errorLabels.isIntegerMinLength,this),I=!1),sa||(Ga.isIntegerLength=H(this.error||U.errorLabels.isIntegerMaxLength,this),I=!1),r===v&&(Ga.isIntegerLength=H(this.error||U.errorLabels.isIntegerLength,
|
|
368
368
|
this),I=!1)));this.valid=I;this.value=U.data[this.name]=Number(E);0<Ga.count()&&(this.errors=Ga);return n[this.name]};n[m].toFloat=function(r){'string'==typeof this.value&&(this.value=this.value.replace(/\s+/g,''),/,/.test(this.value)&&!/\./.test(this.value)?this.value=this.value.replace(/,/g,'.'):this.value=this.value.replace(/,/g,''));var v=U.data[this.name]=this.value,E=n[this.name].errors||{},I=!0;r?this.decimals=parseInt(r):'undefined'==typeof this.decimals&&(this.decimals=2);if(v)if(this.isNumber().valid)try{Number.isFinite(v)||
|
|
@@ -372,7 +372,7 @@ n[m].isFloat=function(r){'string'==typeof this.value&&(this.value=this.value.rep
|
|
|
372
372
|
r[v].value;this.valid=!0;break}}r='undefined'==typeof this.value||null==this.value||''==this.value||/^\s+/.test(this.value)?!1:!0;v=n[this.name].errors||{};r?r&&'undefined'!=typeof v.isRequired&&delete v.isRequired:v.isRequired=H(this.error||U.errorLabels.isRequired,this);this.valid=r;0<v.count()&&(this.errors=v);return n[this.name]};n[m].isString=function(r,v){var E=U.data[this.name]=this.value,I=!1,R=!0,sa=!0,Ga=n[this.name].errors||{};'string'!=typeof E||Ga.isRequired||''==E||(I=!0,r&&'number'==
|
|
373
373
|
typeof r&&E.length<r&&(R=!1,this.size=r),v&&'number'==typeof v&&E.length>v&&(sa=!1,this.size=v));I&&R&&sa||(!I&&Ga.isRequired&&''==E?(I=!1,Ga.isString=H(this.error||U.errorLabels.isString,this)):I||Ga.isRequired||(I=!0),R&&sa||(I=!1,R||(Ga.isStringLength=H(this.error||U.errorLabels.isStringMinLength,this)),sa||(Ga.isStringLength=H(this.error||U.errorLabels.isStringMaxLength,this)),r===v&&(Ga.isStringLength=H(this.error||U.errorLabels.isStringLength,this))));this.valid=I;0<Ga.count()&&(this.errors=
|
|
374
374
|
Ga);return n[this.name]};n[m].isDate=function(r){var v=this.value,E=!1,I=n[this.name].errors||{},R=null;if(!v||''==v||/NaN|Invalid Date/i.test(v))return/NaN|Invalid Date/i.test(v)&&(console.warn('[FormValidator::isDate] Provided value for field `'+this.name+'` is not allowed: `'+v+'`'),I.isDate=H(this.error||U.errorLabels.isDate,this)),this.valid=E,0<I.count()&&(this.errors=I),n[this.name];if('undefined'==typeof r||'undefined'!=typeof r&&/true/i.test(r))r='yyyy-mm-dd';if(v instanceof Date)v=v.format(r);
|
|
375
|
-
else{try{R=r.match(/[^\/\- ]+/g)}catch(ea){throw Error('[FormValidator::isDate] Provided mask not allowed: `'+r+'`');}try{v=v.match(/[^\/\- ]+/g);var sa={},Ga;var
|
|
375
|
+
else{try{R=r.match(/[^\/\- ]+/g)}catch(ea){throw Error('[FormValidator::isDate] Provided mask not allowed: `'+r+'`');}try{v=v.match(/[^\/\- ]+/g);var sa={},Ga;var W=0;for(Ga=R.length;W<Ga;++W)sa[R[W]]=v[W];for(var ha in sa)r=r.replace(new RegExp(ha,'g'),sa[ha])}catch(ea){throw Error('[FormValidator::isDate] Provided value not allowed: `'+v+'`'+ea);}v=this.value=U.data[this.name]=new Date(r);if(/Invalid Date/i.test(v)||!1===v instanceof Date)return I.isRequired||''!=this.value?I.isDate=H(this.error||
|
|
376
376
|
U.errorLabels.isDate,this):E=!0,this.valid=E,0<I.count()&&(this.errors=I),n[this.name];E=!0}this.valid=E;return v};n[m].format=function(r,v){var E=this.value;return E?E.format(r,v):n[this.name]};n[m].setFlash=function(r,v){'undefined'!=typeof v&&''!=v&&(this.error=v);return n[this.name]};n[m].setLabel=function(r){'undefined'!=typeof r&&''!=r&&(this.label=r);return n[this.name]};n[m].trim=function(r){if('boolean'==typeof r&&r)return this.value=this.value.replace(/^\s+|\s+$/,''),U.data[this.name]=U.data[this.name]=
|
|
377
377
|
this.value,n[this.name]};n[m].exclude=function(r){if('boolean'==typeof r&&!r)return/^true|false$/i.test(this.value)&&(this.value=/^true$/i.test(this.value)?!0:!1,U.data[this.name]=this.value),n[this.name];this.isExcluded=!1;0>U.excluded.indexOf(this.name)&&(U.excluded.push(this.name),this.isExcluded=!0);return n[this.name]};n[m].query=L;n[m].getValidationContext=function(){return{isGFFCtx:K,self:n,local:U,replace:H}};if(Y()){y=z=null;try{for(let r in gina.forms.validators)y='/validators/'+r+'/main.js',
|
|
378
378
|
U.errorLabels[r]='Condition not satisfied',K?(z=q(gina.forms.validators[r].data),z=z.replace(/(\)\s+\{|\)\{){1}/,'$&\n\tvar validationContext = this.getValidationContext(),isGFFCtx = validationContext.isGFFCtx,self = validationContext.self,local = validationContext.local,replace = validationContext.replace;')):z=gina.forms.validators[r].toString(),n[m][r]=eval('('+z+')\n//# sourceURL='+r+'.js')}catch(r){throw Error('[UserFormValidator] Could not evaluate: `'+y+'`\n'+r.stack);}}};for(let m in n)B(m,
|
|
@@ -396,15 +396,15 @@ H)r[B[0].substr(1)]=S;else return!1}else++I;if(r.count()==B.length){z=null;for(z
|
|
|
396
396
|
(n.param.path=n.param.path.replace(B,S[L]));'undefined'!=typeof n.param.title&&/:/.test(n.param.title)&&(n.param.title=n.param.title.replace(B,S[L]));'undefined'!=typeof n.param.namespace&&/:/.test(n.param.namespace)&&(n.param.namespace=n.param.namespace.replace(B,S[L]));'undefined'!=typeof n.param.file&&/:/.test(n.param.file)&&(Y.variable=S[L],n.param.file=n.param.file.replace(B,Y));if(/,/.test(n.url)){q=n.url.split(/,/g);var H=0;for(da=q.length;H<da;++H)Y.variable=S[L],q[H]=q[H].replace(B,Y);n.url=
|
|
397
397
|
q.join(',')}else Y.variable=S[L],n.url=n.url.replace(B,Y)}}if(q){H=0;da=q.length;za=za.split(/,/g);var m=0;for(n.urlIndex=0;H<da;++H)if(q=0,B=za[0].match(/:[-_a-z0-9]+/ig)){N=0;for(L=B.length;N<L;N++){var z=B[N].substr(1);'undefined'!=typeof S[z]&&S[z]&&q++}q>m&&(m=q,n.urlIndex=H)}}return n};O.getRoute=function(n,S,q){var da=null;D?da=window.gina.config:(da=getContext('gina').config,'undefined'!=typeof getContext('argvFilename')&&(da.getRouting=getContext('gina').Config.instance.getRouting));var za=
|
|
398
398
|
da.env||GINA_ENV,N=null,L=da.bundle;/@/.test(n)||'undefined'==typeof L||null==L||(n=n.toLowerCase(),n+='@'+L);if(/@/.test(n)){var B=n.replace(/(.*):\/\//,'').split(/@/);L=B[1];/\/(.*)$/.test(n)&&(N=n.replace(/(.*):\/\//,'').split(/\/(.*)$/)[1],L=L.replace(/\/(.*)$/,''),za=N||za);n=B[0].toLowerCase()+'@'+L}N=da.getRouting(L,za);if('undefined'==typeof N[n])throw Error('[ RoutingHelper::getRouting(rule, params) ] : `'+n+'` not found !');da=JSON.clone(N[n]);L=null;da=U(da,S);/,/.test(da.url)&&('undefined'!=
|
|
399
|
-
typeof da.urlIndex&&(q=da.urlIndex,delete da.urlIndex),q='undefined'!=typeof q?q:0,da.url=da.url.split(/,/g)[q]);/\/$/.test(da.url)&&'/'!=da.url&&(da.url=da.url.substr(0,da.url.length-1));if(/GET/i.test(da.method)&&'undefined'!=typeof S){q='?';N=N[n].url;for(let H in da.param)-1<O.reservedParams.indexOf(H)||(new RegExp(da.param[H])).test(N)||'undefined'!=typeof S[H]&&(q+=H+'='+
|
|
399
|
+
typeof da.urlIndex&&(q=da.urlIndex,delete da.urlIndex),q='undefined'!=typeof q?q:0,da.url=da.url.split(/,/g)[q]);/\/$/.test(da.url)&&'/'!=da.url&&(da.url=da.url.substr(0,da.url.length-1));if(/GET/i.test(da.method)&&'undefined'!=typeof S){q='?';N=N[n].url;for(let H in da.param)-1<O.reservedParams.indexOf(H)||(new RegExp(da.param[H])).test(N)||'undefined'!=typeof S[H]&&(q+=H+'='+encodeRFC5987ValueChars(S[H])+'&');1<q.length&&(q=q.substring(0,q.length-1),da.url+=q)}da.toUrl=function(H){var m=null;/^redirect$/i.test(this.param.control)&&
|
|
400
400
|
(m=O.getUrlProps(this.bundle,za||GINA_ENV));var z=this.webroot||m.webroot;m=this.hostname||m.hostname;var y=this.url;this.url='undefined'!=typeof H&&1==H?y.replace(z,'/'):y;return m+this.url};da.request=function(H,m){var z=null,y=null;'function'==typeof arguments[arguments.length-1]&&(z=arguments[arguments.length-1]);'object'==typeof arguments[2]&&(y=arguments[2]);var F=this.webroot||y.webroot,r=this.hostname||y.hostname;y='undefined'!=typeof H&&1==H?path.replace(F,'/'):this.url||y.url;r=/^https/.test(r)?
|
|
401
401
|
'https':'http';D?window.open(y,'undefined'!=typeof m&&'undefined'!=typeof m.target?m.target:'_self'):('undefined'==typeof m.agent&&(m.agent=!1),r=require(''+r),F=function(v){var E='',I=!1;v.on('data',function(R){E+=R});v.on('error',function(R){I='Failed to get mail content';R&&'undefined'!=typeof R.stack?I+=R.stack:'string'==typeof R&&(I+='\n'+R)});v.on('end',function(){if(/^\{/.test(E))try{E=JSON.parse(E),'undefined'!=typeof E.error&&(I=JSON.clone(E),E=null)}catch(R){I=R}I?z(I):z(!1,E)})},z?r.get(y,
|
|
402
402
|
m,F):r.get(y,m))};/:/.test(da.url)&&(S=da.url.match(/(:(.*)\/|:(.*)$)/g).map(function(H){return H.replace(/\//g,'')}).join(', '),L='[ RoutingHelper::getRoute(rule[, bundle, method]) ] : route [ %r ] param placeholder not defined: `'+da.url+'` !\n Check your route description to compare requirements against param variables [ '+S+']',L=L.replace(/%r/,n),console.warn(Error(L)));return da};O.getRouteByUrl=function(n,S,q,da,za){2==arguments.length&&'undefined'!=typeof arguments[1]&&-1<O.allowedMethods.indexOf(arguments[1].toLowerCase())&&
|
|
403
403
|
(q=arguments[1],S=void 0);var N=null,L=null,B=null,H=null,m=null,z=null;if(/#/.test(n)&&1<n.length){var y=n.split(/#/);n=y[0];m='#'+y[1];y=null}1==arguments.length&&'undefined'!=typeof arguments[0]&&(/^(https|http)/i.test(n)||/^\//.test(n)||(n='/'+n),N='/'+n.split(/\//g)[1],D&&(H=gina.config.reverseRouting,B=gina.config.routing),'undefined'!=typeof H[N]&&(y=B[H[N]],S=y.bundle,N=y.webroot,z=y.hostname,y=null));za='boolean'!=typeof arguments[arguments.length-1]?!1:arguments[arguments.length-1];var F=
|
|
404
404
|
!1,r=null,v=null,E=r=v=null;y='undefined'!=typeof q?!0:!1;D?(r=window.gina.config,S='undefined'!=typeof S?S:r.bundle,v=r.env,B=B||r.getRouting(S),H=H||r.reverseRouting,isXMLRequest='undefined'!=typeof isXMLRequest?isXMLRequest:!1,z=z||r.hostname,N=N||r.webroot,da={routing:{},method:q,params:{},url:n}):(r=getContext('gina').config,S='undefined'!=typeof S?S:r.bundle,v=r.env,B=r.getRouting(S),z=r.envConf[S][v].hostname,N=r.envConf[S][v].server.webroot,da||={routing:{},isXMLRequest:!1,method:'undefined'!=
|
|
405
|
-
typeof q?q.toLowerCase():'get',params:{},url:n},za&&(da.method=q),isXMLRequest=da.isXMLRequest||!1);v=n.replace(new RegExp('^('+z+'|'+z.replace(/:\d+/,'')+')'),'');'undefined'==typeof da.routing.path&&(da.routing.path=
|
|
406
|
-
N.test(H)&&(H=da.method),'undefined'==typeof B[I].method||N.test(H))){r={method:H,requirements:B[I].requirements,namespace:B[I].namespace||void 0,url:
|
|
407
|
-
m&&(n+=m),L.url=n,L.toUrl=function(R){var sa=this.webroot,Ga=this.hostname,
|
|
405
|
+
typeof q?q.toLowerCase():'get',params:{},url:n},za&&(da.method=q),isXMLRequest=da.isXMLRequest||!1);v=n.replace(new RegExp('^('+z+'|'+z.replace(/:\d+/,'')+')'),'');'undefined'==typeof da.routing.path&&(da.routing.path=decodeURI(v));q='undefined'!=typeof q?q.toLowerCase():'get';y&&(da.originalMethod=da.method,da.method=q,da.routing.path=decodeURI(v));da.method||(da.method=q);r={};N=new RegExp(q,'i');H=null;var I;for(I in B){if('undefined'==typeof B[I].param)break;if(B[I].bundle==S&&(H=B[I].method,
|
|
406
|
+
/,/.test(H)&&N.test(H)&&(H=da.method),'undefined'==typeof B[I].method||N.test(H))){r={method:H,requirements:B[I].requirements,namespace:B[I].namespace||void 0,url:decodeURI(v),rule:B[I].originalRule||I,param:B[I].param,middleware:JSON.clone(B[I].middleware),bundle:B[I].bundle,isXMLRequest};try{if(E=O.compareUrls(r,B[I].url,da),E.past){L=JSON.clone(B[I]);L.name=I;F=!0;E={};break}}catch(R){throw Error('Route [ '+I+' ] needs your attention.\n'+R.stack);}}}if(F)return/\/$/.test(n)&&'/'!=n&&(n=n.substr(0,
|
|
407
|
+
n.length-1)),m&&(n+=m),L.url=n,L.toUrl=function(R){var sa=this.webroot,Ga=this.hostname,W=this.url;this.url='undefined'!=typeof R&&1==R?W.replace(sa,'/'):W;return Ga+this.url},L;if(D){m=!1;if('#'==n&&/GET/i.test(q)&&y||/^404:/.test(n))n=location.pathname,m=!0;'undefined'==typeof O.notFound&&(O.notFound={});B=null;L='[ RoutingHelper::getRouteByUrl(rule[, bundle, method]) ] : route [ %r ] is called but not found inside your view: `'+n+'` !';if((B=(B=gina.hasPopinHandler&&gina.popinIsBinded?gina.popin.getActivePopin().target.innerHTML.match(/404:\[\w+\][a-z 0-9-_@]+/):
|
|
408
408
|
document.body.innerHTML.match(/404:\[\w+\][a-z 0-9-_@]+/))&&0<B.length?B[0]:null)&&y&&m)return m=B.match(/\[\w+\]/)[0],B=B.replace('404:'+m,m.replace(/\[|\]/g,'')+'::'),L=L.replace(/%r/,B.replace(/404:\s+/,'')),'undefined'==typeof O.notFound[B]?O.notFound[B]={count:1,message:L}:y&&'undefined'!=typeof O.notFound[B]&&++O.notFound[B].count,!1;if((m=gina.config.reverseRouting[n]||null)&&'undefined'!=typeof m&&m.split(/@(.+)$/)[1]==S)return B=m,'undefined'==typeof O.notFound[B]?(L=L.replace(/%r/,q.toUpperCase()+
|
|
409
409
|
'::'+m),O.notFound[B]={count:1,message:L}):y&&'undefined'!=typeof O.notFound[B]&&++O.notFound[B].count,!1;B=O.compareUrls(r,n,da)||null;B.past&&y&&(B=q.toUpperCase()+'::'+B.request.routing.rule,'undefined'==typeof O.notFound[B]?L=L.replace(/%r/,B):++O.notFound[B].count);return!1}console.warn(Error('[ RoutingHelper::getRouteByUrl(rule[, bundle, method, request]) ] : route not found for url: `'+n+'` !').stack);return!1};return O}
|
|
410
410
|
'undefined'!==typeof module&&module.exports?module.exports=Routing():'function'===typeof define&&define.amd&&define('lib/routing',['require','lib/form-validator','lib/merge'],function(){return Routing()});
|
|
@@ -428,205 +428,205 @@ document.getElementById(e),p,x=typeof(0<za.count())?za:q.rules;h.getAttribute?(i
|
|
|
428
428
|
'undefined'!=typeof x[h.id.replace(/\-/g,'.')]?$target=q.$forms[h.id].target:'object'==typeof h.id?(delete q.$forms[h.id],x=h.attributes.getNamedItem('id').nodeValue||'form.'+oa.v4(),h.setAttribute('id',x),h.id=x,da.target=h,q.$forms[x]=Y({},da),$target=q.$forms[x].target):$target=q.$forms[h.id].target;p?db($target,p):db($target)}}'undefined'!=typeof q.$forms[e]&&(q.$forms[e].withUserBindings=!0,b='undefined'!=typeof this.$forms&&'undefined'==typeof this.$forms[e]?this.$forms[e]=q.$forms[e]:q.$forms[e]);
|
|
429
429
|
if(!b)throw Error('Validator::getFormById(...) exception: could not retrieve form `'+e+'`');b.binded||(db(b.target),b=q.$forms[e]);T&&K&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&(gina.forms.errors||(gina.forms.errors={}),h={id:e,rules:q.$forms[e].rules},'undefined'!=typeof q.$forms[e].errors&&(h.errors=q.$forms[e].errors),window.ginaToolbar.update('forms',h));return b},y=function(){var e=!1,b=null;gina.hasPopinHandler&&gina.popinIsBinded&&(b=gina.popin.getActivePopin());b&&b.isOpen&&
|
|
430
430
|
(e=!0);return e},F=function(e,b){var h=typeof(0<za.count())?za:q.rules;if(!q.$forms)throw Error('`$forms` collection not found');if('undefined'!=typeof e&&'undefined'!=typeof q.$forms[e])return q.$forms[e];if('undefined'==typeof e)if('undefined'!=typeof this.id&&''!=this.id&&null!=this.id)e=this.id;else throw Error('[ FormValidator::validateFormById(formId, customRule) ] `formId` is missing');if('string'==typeof e)e=e.replace(/#/,'');else{if('object'!=typeof e||Array.isArray(e))throw Error('[ FormValidator::validateFormById(formId[, customRule]) ] `formId` should be a `string`');
|
|
431
|
-
var p=e.form;e=p.getAttribute('id')||'form.'+oa.v4();p.setAttribute('id',e)}var x=document.getElementsByTagName('form');for(var u={},A=0,
|
|
431
|
+
var p=e.form;e=p.getAttribute('id')||'form.'+oa.v4();p.setAttribute('id',e)}var x=document.getElementsByTagName('form');for(var u={},A=0,V=x.length;A<V;++A)p=x[A].getAttribute('id')||null,'undefined'==typeof u[p]?u[p]=!0:'undefined'==typeof q.$forms[p]||q.$forms[p].warned||(gina.popinIsBinded?console.warn('Popin/Validator::bindForm($target, customRule): `'+p+'` 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): `'+
|
|
432
432
|
p+'` is a duplicate form ID. If not fixed, this could lead to an undesirable behaviour.'),q.$forms[p].warned=!0);if('undefined'!=typeof this.$forms&&'undefined'!=typeof q.$forms[e])x=this.$forms[e]=q.$forms[e];else{p=document.getElementById(e);da.id=e;da.target=p;x=this.$forms[e]=q.$forms[e]=Y({},da);if('undefined'==typeof b)if(u=e.replace(/\-/g,'.'),'undefined'!=typeof h)x.rule=Fa(u);else{if('undefined'!=typeof x.target&&null!==x.target&&x.target.getAttribute('data-gina-form-rule'))if(u=x.target.getAttribute('data-gina-form-rule').replace(/\-|\//g,
|
|
433
433
|
'.'),'undefined'!=typeof h)x.rule=Fa(u);else throw Error('[ FormValidator::validateFormById(formId) ] using `data-gina-form-rule` on form `'+x.target+'`: no matching rule found');}else if(u=b.replace(/\-|\//g,'.'),'undefined'!=typeof h)x.rule=Fa(u);else throw Error('[ FormValidator::validateFormById(formId, customRule) ] `'+b+'` is not a valid rule');p&&'undefined'!=typeof this.isPopinContext&&/true/i.test(this.isPopinContext)&&(p.isPopinContext=this.isPopinContext);p&&!x.binded&&db(p,u)}if(!x)throw Error('[ FormValidator::validateFormById(formId, customRule) ] `'+
|
|
434
434
|
e+'` not found');return x||null},r=function(e){var b=e.form.getAttribute('id');if(!/^true$/i.test(q.$forms[b].isValidating)){var h=e.parentNode;e=!1;b=h.getElementsByTagName('div');/form\-item\-warning/.test(h.className)?h.className=h.className.replace(/form\-item\-warning/,'form-item-error'):/form\-item\-error/.test(h.className)&&(h.className=h.className.replace(/form\-item\-error/,'form-item-warning'),e=!0);h=0;for(var p=b.length;h<p;++h)if(/form\-item\-error\-message/.test(b[h].className)){b[h].className=
|
|
435
435
|
e?b[h].className+' hidden':b[h].className.replace(/(\s+hidden|hidden)/,'');break}}},v={},E=function(e,b,h,p){if(T)var x=null;var u=!1;if('undefined'!=typeof e.dataset.ginaFormIsResetting&&/^(true)$/i.test(e.dataset.ginaFormIsResetting))b={},v={},e.dataset.ginaFormIsResetting=!1;else if(/^(true)$/i.test(e.dataset.ginaFormLiveCheckEnabled)&&'undefined'!=typeof p){var A='string'!=typeof e.id?e.getAttribute('id'):e.id;'undefined'==typeof v[A]&&(v[A]={});if(0<b.count()){if(v[A][p]={},v[A][p]=Y(b[p],v[A][p]),
|
|
436
436
|
0==v[A][p].count()&&delete v[A][p],b=v[A],!q.$forms[A].sent||q.$forms[A].isValidating)u=!0}else'undefined'!=typeof v[A][p]&&(delete v[A][p],'undefined'!=typeof window.gina.validator.$forms[A].errors&&'undefined'!=typeof window.gina.validator.$forms[A].errors[p]&&delete window.gina.validator.$forms[A].errors[p]),'undefined'!=typeof q.$forms&&'undefined'!=typeof q.$forms[A]&&'undefined'!=typeof q.$forms[A].errors&&0==q.$forms[A].errors.count()&&Eb(e,!0),'undefined'!=typeof v[A]&&0==v[A].count()?delete v[A]:
|
|
437
|
-
b=v[A]}var
|
|
438
|
-
'form-item-warning':' form-item-warning'):w.className+(''==w.className?'form-item-error':' form-item-error');
|
|
437
|
+
b=v[A]}var V=null;A=e.getAttribute('id');h='undefined'!=typeof h?h:{};for(var P=0,aa=e.length;P<aa;++P){var Q=e[P];if('undefined'==typeof p||p==Q.name){if(/form\-item\-wrapper$/.test(Q.parentNode.className)){var w=Q.parentNode.parentNode;var ia=Q.parentNode}else w=Q.parentNode,ia=Q;var ua=Q.getAttribute('name');var na=Q.getAttribute('data-gina-form-errors');if(ua){if('undefined'!=typeof b[ua]&&!/(form\-item\-error|form\-item\-warning)/.test(w.className)){w.className=u?w.className+(''==w.className?
|
|
438
|
+
'form-item-warning':' form-item-warning'):w.className+(''==w.className?'form-item-error':' form-item-error');V=document.createElement('div');V.className=u?'form-item-error-message hidden':'form-item-error-message';for(var la in b[ua])'stack'!=la&&(w=document.createElement('p'),w.appendChild(document.createTextNode(b[ua][la])),V.appendChild(w)),T&&(x||={},x[ua]||(x[ua]={}),x[ua][la]=b[ua][la]);'hidden'!=ia.type&&insertAfter(ia,V)}else if('undefined'==typeof b[ua]&&/(form\-item\-error|form\-item\-warning)/.test(w.className)||
|
|
439
439
|
'undefined'!=typeof b[ua]&&0==b[ua].count()&&/(form\-item\-error|form\-item\-warning)/.test(w.className)){ua=w.getElementsByTagName('div');ia=0;for(na=ua.length;ia<na;++ia)if(/form\-item\-error\-message/.test(ua[ia].className)){ua[ia].parentElement.removeChild(ua[ia]);break}w.className=w.className.replace(/(\s+form\-item\-error|form\-item\-error|\s+form\-item\-warning|form\-item\-warning)/,'')}else if('undefined'!=typeof b[ua]&&na){w=w.getElementsByTagName('div');na=0;for(var Ca=w.length;na<Ca;++na)if('form-item-error-message'==
|
|
440
|
-
w[na].className){w[na].parentElement.removeChild(w[na]);
|
|
440
|
+
w[na].className){w[na].parentElement.removeChild(w[na]);V=document.createElement('div');V.setAttribute('class','form-item-error-message');for(la in b[ua])w=document.createElement('p'),w.appendChild(document.createTextNode(b[ua][la])),V.appendChild(w),T&&(x||={},x[ua]||(x[ua]={}),x[ua][la]=b[ua][la]);break}V&&'hidden'!=ia.type&&insertAfter(ia,V)}if('undefined'!=typeof p&&p===Q.name)break}}}x?(triggerEvent(gina,e,'error.'+A,b),T&&K&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&(gina.forms.errors||
|
|
441
441
|
(gina.forms.errors={}),e={id:A,errors:x},window.ginaToolbar.update('forms',e))):T&&K&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&(gina.forms.errors||(gina.forms.errors={}),e={id:A,errors:{}},K&&window.ginaToolbar.update('forms',e));if(gina&&K&&T&&q.$forms[A].isSubmitting&&/^true$/i.test(q.$forms[A].isSubmitting)&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&h)try{window.ginaToolbar.update('data-xhr',h)}catch(Aa){throw Aa;}},I=function(e){var b=null;'undefined'==typeof e&&
|
|
442
442
|
'undefined'!=typeof this.id&&(e=this.id);/^string$/i.test(typeof e)?(b=e.replace(/#/,''),b=document.getElementById(b)):e instanceof HTMLFormElement?b=e:/^object$/i.test(typeof e)&&(b=e.target);if(!b)throw Error('[ FormValidator::resetErrorsDisplay([ formId | <form> ]) ] `'+e+'` not found');b.dataset.ginaFormIsResetting=!0;E(b,{});return b},R=function(e){if('undefined'==typeof e){var b='undefined'!=typeof this.target?this.target.getAttribute('id'):this.getAttribute('id');e=q.$forms[b]}else if('string'==
|
|
443
443
|
typeof e){b=e.replace(/#/,'');if('undefined'==typeof q.$forms[b])throw Error('[ FormValidator::resetErrorsDisplay([formId]) ] `'+e+'` not found');e=q.$forms[b]}if(e.fieldsSet){var h;for(h in e.fieldsSet){b=document.getElementById(h);var p=b.tagName.toLowerCase();var x=b.tagName;/textarea/i.test(x)?(x=e.fieldsSet[h].defaultValue,b.value=x,triggerEvent(gina,b,'change')):'input'==p?(x=e.fieldsSet[h].defaultValue,/$(on|true|false)$/i.test(x)&&(x=/$(on|true)$/i.test(x)?!0:!1),/^(checkbox|radio)$/i.test(b.type)?
|
|
444
444
|
b.checked=e.fieldsSet[h].defaultChecked:/^(checkbox|radio)$/i.test(b.type)||(b.value=x),triggerEvent(gina,b,'change')):'select'==p&&(x=e.fieldsSet[h].selectedIndex||0,b.selectedIndex=x,b.dataset.value=b.options[b.selectedIndex].value,triggerEvent(gina,b,'change'))}}return e},sa=function(){var e=null,b=null;'undefined'!=typeof this.getAttribute?(e=this.getAttribute('id'),b=this):'undefined'!=typeof this.target&&null!=this.target&&'undefined'!=typeof this.target.getAttribute&&(e=this.target.getAttribute('id'),
|
|
445
|
-
b=this.target);if('undefined'==typeof q.$forms[e])throw Error('[ FormValidator::submit() ] not `$form` binded. Use `FormValidator::getFormById(id)` or `FormValidator::validateFormById(id)` first ');triggerEvent(gina,b,'submit');return this},Ga=function(e,b){var h=this.target,p=h.getAttribute('id'),x=q.$forms[p]||this,u=null,A=null,
|
|
445
|
+
b=this.target);if('undefined'==typeof q.$forms[e])throw Error('[ FormValidator::submit() ] not `$form` binded. Use `FormValidator::getFormById(id)` or `FormValidator::validateFormById(id)` first ');triggerEvent(gina,b,'submit');return this},Ga=function(e,b){var h=this.target,p=h.getAttribute('id'),x=q.$forms[p]||this,u=null,A=null,V=null,P=null;if(!('undefined'!=typeof x.isSending&&/^true$/i.test(x.isSending)||'undefined'!=typeof x.sent&&/^true$/i.test(x.sent))){q.$forms[p].isSending=!0;b='undefined'!=
|
|
446
446
|
typeof b?Y(b,B):B;'undefined'!=typeof x.id&&(b.headers['X-Gina-Form-Id']=x.id,'undefined'!=typeof gina.forms.rules&&0<x.rules.count()&&'undefined'!=typeof x.rules[x.id]&&(b.headers['X-Gina-Form-Rule']=x.id+'@'+gina.config.bundle));'undefined'!=typeof x.target.dataset.ginaFormRule&&(b.headers['X-Gina-Form-Rule']=x.target.dataset.ginaFormRule+'@'+gina.config.bundle);(P=h.getAttribute('data-gina-form-event-on-submit-success')||h.getAttribute('data-gina-form-event-on-submit-error')?!0:!1)&&wa(x);var aa=
|
|
447
447
|
h.getAttribute('action')||b.url,Q=h.getAttribute('method')||b.method;Q=Q.toUpperCase();b.method=Q;b.url=aa;L||=setupXhr(b);aa=h.getAttribute('enctype')||b.headers['Content-Type'];if(b.withCredentials){if('withCredentials'in L)b.isSynchrone?L.open(b.method,b.url,b.isSynchrone):L.open(b.method,b.url);else if('undefined'!=typeof XDomainRequest)L=new XDomainRequest,L.open(b.method,b.url);else{L=null;u='CORS not supported: the server is missing the header `"Access-Control-Allow-Credentials": true` ';triggerEvent(gina,
|
|
448
|
-
h,'error.'+p,u);return}L.responseType='undefined'!=typeof b.responseType?b.responseType:'';L.withCredentials=!0}else b.isSynchrone?L.open(b.method,b.url,b.isSynchrone):L.open(b.method,b.url);for(var w in b.headers)'Content-Type'==w&&'undefined'!=typeof aa&&null!=aa&&''!=aa||L.setRequestHeader(w,b.headers[w]);if(L){L.onreadystatechange=function(Aa){x.isSubmitting=!1;x.isSending=!1;setTimeout(function(){x.sent=!1},1E3);Aa=/Google Inc/i.test(navigator.vendor)?50:0;2==L.readyState&&(
|
|
449
|
-
!0:!1,!L.responseType&&
|
|
448
|
+
h,'error.'+p,u);return}L.responseType='undefined'!=typeof b.responseType?b.responseType:'';L.withCredentials=!0}else b.isSynchrone?L.open(b.method,b.url,b.isSynchrone):L.open(b.method,b.url);for(var w in b.headers)'Content-Type'==w&&'undefined'!=typeof aa&&null!=aa&&''!=aa||L.setRequestHeader(w,b.headers[w]);if(L){L.onreadystatechange=function(Aa){x.isSubmitting=!1;x.isSending=!1;setTimeout(function(){x.sent=!1},1E3);Aa=/Google Inc/i.test(navigator.vendor)?50:0;2==L.readyState&&(V=/^attachment;/.test(L.getResponseHeader('Content-Disposition'))?
|
|
449
|
+
!0:!1,!L.responseType&&V&&(L.responseType='blob'));if(4==L.readyState){var Sa=null,Va=null,qb=L.getResponseHeader('Content-Type');if(/^2/.test(L.status)){try{if(/blob/.test(L.responseType)||V){if('undefined'==typeof qb||null==qb)qb='application/octet-stream';Va=new Blob([this.response],{type:qb});var sb=document.createElement('a');sb.style='display: none';document.body.appendChild(sb);var Hb=window.URL.createObjectURL(Va);sb.href=Hb;var Ob=L.getResponseHeader('Content-Disposition');sb.download=Ob.match('=(.*)')[0].substr(1);
|
|
450
450
|
sb.click();window.URL.revokeObjectURL(Hb);u={status:L.status,statusText:L.statusText,responseType:Va.type,type:Va.type,size:Va.size}}else u=L.responseText;/\/json/.test(qb)&&(u=JSON.parse(L.responseText),'undefined'==typeof u.status&&(u.status=L.status));if(/\/html/.test(qb)&&(u={contentType:qb,content:L.responseText},'undefined'==typeof u.status&&(u.status=L.status),'undefined'!=typeof gina.popin&&gina.hasPopinHandler&&(Sa=gina.popin.getActivePopin()))){A={};try{A=(new DOMParser).parseFromString(u.content,
|
|
451
451
|
'text/html').getElementById('gina-without-layout-xhr-data'),A=JSON.parse(decodeURIComponent(A.value)),XHRView=(new DOMParser).parseFromString(u.content,'text/html').getElementById('gina-without-layout-xhr-view'),XHRView=JSON.parse(decodeURIComponent(XHRView.value)),gina&&T&&typeof window.ginaToolbar&&'undefined'!=typeof A&&window.ginaToolbar.update('data-xhr',A),gina&&T&&typeof window.ginaToolbar&&'undefined'!=typeof XHRView&&window.ginaToolbar.update('view-xhr',XHRView)}catch(X){throw X;}Sa.loadContent(u.content);
|
|
452
|
-
u=A;triggerEvent(gina,h,'success.'+p,u);return}A=x.eventData.success=u;if(gina&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&A)try{T&&'undefined'!=typeof A&&!/\/html|\/json/.test(qb)&&window.ginaToolbar.update('data-xhr',A)}catch(X){throw X;}/^gina\-upload/i.test(p)&&
|
|
452
|
+
u=A;triggerEvent(gina,h,'success.'+p,u);return}A=x.eventData.success=u;if(gina&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&A)try{T&&'undefined'!=typeof A&&!/\/html|\/json/.test(qb)&&window.ginaToolbar.update('data-xhr',A)}catch(X){throw X;}/^gina\-upload/i.test(p)&&W(gina,h,'success',p,u);var zb=!1;'undefined'!=typeof u.isXhrRedirect&&/^true$/i.test(u.isXhrRedirect)&&(zb=!0);if('undefined'!=typeof gina.popin&&gina.hasPopinHandler&&'undefined'!=typeof u.popin||'undefined'!=typeof gina.popin&&
|
|
453
453
|
gina.hasPopinHandler&&'undefined'!=typeof u.location&&zb){Sa=gina.popin.getActivePopin();if(!Sa&&'undefined'!=typeof u.popin){if('undefined'!=typeof u.popin&&'undefined'==typeof u.popin.name)throw Error('To get a `$popin` instance, you need at list a `popin.name`.');Sa=gina.popin.getPopinByName(u.popin.name);if(!Sa)throw Error('Popin with name: `'+u.popin.name+'` not found.');}if('undefined'!=typeof u.popin&&'undefined'!=typeof u.popin.close){Sa.isRedirecting=!1;Sa.close();var Vb=u.popin.reload?u.popin.reload:
|
|
454
454
|
!1;u.popin.location||u.popin.url||(delete u.popin,Vb&&(u.popin={reload:Vb}))}if('undefined'!=typeof u.popin&&'undefined'!=typeof u.popin.location||'undefined'!=typeof u.popin&&'undefined'!=typeof u.popin.url||'undefined'!=typeof u.location&&zb){zb=null;Sa&&(zb=Sa.name,Sa.isRedirecting=!0);'undefined'!=typeof u.popin&&'undefined'!=typeof u.popin.target&&(u.popin.target='_'+u.popin.target);var Za=u.location||u.popin.location||u.popin.url;if('undefined'!=typeof u.popin&&'undefined'!=typeof u.popin.name&&
|
|
455
455
|
zb!=u.popin.name){Sa&&Sa.close();zb=u.popin.name;Sa=gina.popin.getPopinByName(zb);if(!Sa)throw Error('Popin with name `'+zb+'` not found !');console.debug('Validator::Popin now redirecting [1-c]');Sa.load(Sa.name,Za,Sa.options)}else Sa&&(console.debug('Validator::Popin now redirecting [1-d]'),Sa.load(Sa.name,Za,Sa.options));if(Sa&&!Sa.isOpen)return setTimeout(function(X){X.isOpen||X.open()},50,Sa)}}triggerEvent(gina,h,'success.'+p,u);P&&triggerEvent(gina,h,'success.'+p+'.hform',u)}catch(X){u={status:422,
|
|
456
|
-
error:X.message,stack:X.stack};A=x.eventData.error=u;if(gina&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&A)try{T&&'undefined'!=typeof A&&window.ginaToolbar.update('data-xhr',A)}catch(
|
|
457
|
-
location.protocol+'//'+u.location,setTimeout(()=>{window.location.href=u.location},Aa)}else if(0!=L.status)if(u={status:L.status},/blob/.test(L.responseType)){Va=new Blob([this.response],{type:'text/plain'});var gb=new FileReader,fa='';gb.addEventListener('loadend',X=>{/string/i.test(typeof X.srcElement.result)?fa+=X.srcElement.result:'object'==typeof X.srcElement.result?u=Y(u,X.srcElement.result):u.message+=X.srcElement.result;if(/2/.test(gb.readyState)){if(/^(\{|\[)/.test(fa))try{u=Y(u,JSON.parse(fa))}catch(
|
|
458
|
-
Y(u,
|
|
456
|
+
error:X.message,stack:X.stack};A=x.eventData.error=u;if(gina&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&A)try{T&&'undefined'!=typeof A&&window.ginaToolbar.update('data-xhr',A)}catch(ka){throw ka;}/^gina\-upload/i.test(p)&&W(gina,h,'error',p,u);triggerEvent(gina,h,'error.'+p,u);P&&triggerEvent(gina,h,'error.'+p+'.hform',u)}if('undefined'!=typeof u&&'undefined'!=typeof u.location)return window.location.hash='',u.location=/^http/.test(u.location)||/^\//.test(u.location)?u.location:
|
|
457
|
+
location.protocol+'//'+u.location,setTimeout(()=>{window.location.href=u.location},Aa)}else if(0!=L.status)if(u={status:L.status},/blob/.test(L.responseType)){Va=new Blob([this.response],{type:'text/plain'});var gb=new FileReader,fa='';gb.addEventListener('loadend',X=>{/string/i.test(typeof X.srcElement.result)?fa+=X.srcElement.result:'object'==typeof X.srcElement.result?u=Y(u,X.srcElement.result):u.message+=X.srcElement.result;if(/2/.test(gb.readyState)){if(/^(\{|\[)/.test(fa))try{u=Y(u,JSON.parse(fa))}catch(ka){u=
|
|
458
|
+
Y(u,ka)}u.message||delete u.message;A=x.eventData.error=u;if(gina&&T&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&A)try{window.ginaToolbar.update('data-xhr',A)}catch(ka){throw ka;}/^gina\-upload/i.test(p)&&W(gina,h,'error',p,u);triggerEvent(gina,h,'error.'+p,u);P&&triggerEvent(gina,h,'error.'+p+'.hform',u)}});gb.readAsText(Va)}else{if(/^(\{|\[)/.test(L.responseText))try{u=Y(JSON.parse(L.responseText),u)}catch(X){u=Y(X,u)}else'object'==typeof L.responseText?u=Y(L.responseText,u):u.message=
|
|
459
459
|
L.responseText;if('undefined'!=typeof u&&'undefined'!=typeof u.error&&u.fields&&'object'==typeof u.fields){Za='undefined'!=typeof u.message?u.message:null;Aa={};for(zb in u.fields)Sa={},Sa[zb]={},Sa[zb].isApiError=u.fields[zb],Za&&!Sa[zb].isApiError&&(Sa[zb].isApiError=u.error),Aa[zb]=Sa[zb],E(x.target,Sa,e,zb);u.fields=Aa}A=x.eventData.error=u;if(gina&&T&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&A)try{window.ginaToolbar.update('data-xhr',A)}catch(X){throw X;}/^gina\-upload/i.test(p)&&
|
|
460
|
-
|
|
461
|
-
p+'.hform',u)};e||(e=event.detail.data);if(e){b=!1;if('object'==typeof e){w=[];Q=0;var ia={};try{if(e instanceof FormData){var ua=event.currentTarget.getAttribute('data-gina-form-upload-group')||'untagged',na,la;for([na,la]of e.entries())la instanceof File?(b||=!0,w[Q]={key:na,group:ua,file:la,bin:''},++Q):ia[na]=la}else e=JSON.stringify(e);if(b&&0<w.length){var Ca='--ginaWKBoundary'+oa.v4().replace(/\-/g,'');return ea(w,Ca,'',0,function(Aa,Sa,Va){if(Aa)/^gina\-upload/i.test(p)&&
|
|
462
|
-
p,Aa),triggerEvent(gina,h,'error.'+p,Aa),P&&triggerEvent(gina,h,'error.'+p+'.hform',Aa);else return Va&&(L.setRequestHeader('Content-Type','multipart/form-data; boundary='+Ca),L.send(Sa),x.sent=!0,T&&K&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&(gina.forms.sent||(gina.forms.sent={}),window.ginaToolbar.update('forms',{id:p,sent:Sa}))),!1})}'undefined'!=typeof ia&&0<ia.count()&&(e=JSON.stringify(ia))}catch(Aa){/^gina\-upload/i.test(p)&&
|
|
463
|
-
p,Aa),P&&triggerEvent(gina,h,'error.'+p+'.hform',Aa)}}b||('undefined'!=typeof aa&&null!=aa&&''!=aa&&L.setRequestHeader('Content-Type',aa),L.send(e))}else'undefined'!=typeof aa&&null!=aa&&''!=aa&&L.setRequestHeader('Content-Type',aa),L.send();x.sent=!0;T&&K&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&(gina.forms.sent||(gina.forms.sent={}),ua={id:p,sent:'string'==typeof e?JSON.parse(e):e},window.ginaToolbar.update('forms',ua))}}},
|
|
464
|
-
b=document.getElementById(e.uploadTriggerId);p=null;var u=x.files||[],A=null;e.hasPreviewContainer&&(p=document.getElementById(e.previewContainer.id))&&(p.innerHTML='');e.errorField&&(A=document.getElementById(e.errorField));A&&(A.style.display='none');if(A&&'success'!=h){var
|
|
465
|
-
A?(/a/i.test(A.tagName)&&(A.href='#'),A.innerHTML&&''!=A.innerHTML||(A.innerHTML=b.getAttribute('data-gina-form-upload-reset-label')||'Reset'),'undefined'==typeof A.className&&(A.className=''),P=Y(A.className.split(/\s+/g),aa),A.className=P.join(' ')):(
|
|
460
|
+
W(gina,h,'error',p,u);triggerEvent(gina,h,'error.'+p,u);P&&triggerEvent(gina,h,'error.'+p+'.hform',u)}}};L.onprogress=function(Aa){var Sa='0';Aa.lengthComputable&&(Sa=Aa.loaded/Aa.total,Sa=parseInt(100*Sa));Aa={status:100,progress:Sa};x.eventData.onprogress=Aa;triggerEvent(gina,h,'progress.'+p,Aa)};L.ontimeout=function(Aa){u={status:408,error:'Request Timeout'};x.eventData.ontimeout=u;/^gina\-upload/i.test(p)&&W(gina,h,'error',p,u);triggerEvent(gina,h,'error.'+p,u);P&&triggerEvent(gina,h,'error.'+
|
|
461
|
+
p+'.hform',u)};e||(e=event.detail.data);if(e){b=!1;if('object'==typeof e){w=[];Q=0;var ia={};try{if(e instanceof FormData){var ua=event.currentTarget.getAttribute('data-gina-form-upload-group')||'untagged',na,la;for([na,la]of e.entries())la instanceof File?(b||=!0,w[Q]={key:na,group:ua,file:la,bin:''},++Q):ia[na]=la}else e=JSON.stringify(e);if(b&&0<w.length){var Ca='--ginaWKBoundary'+oa.v4().replace(/\-/g,'');return ea(w,Ca,'',0,function(Aa,Sa,Va){if(Aa)/^gina\-upload/i.test(p)&&W(gina,h,'error',
|
|
462
|
+
p,Aa),triggerEvent(gina,h,'error.'+p,Aa),P&&triggerEvent(gina,h,'error.'+p+'.hform',Aa);else return Va&&(L.setRequestHeader('Content-Type','multipart/form-data; boundary='+Ca),L.send(Sa),x.sent=!0,T&&K&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&(gina.forms.sent||(gina.forms.sent={}),window.ginaToolbar.update('forms',{id:p,sent:Sa}))),!1})}'undefined'!=typeof ia&&0<ia.count()&&(e=JSON.stringify(ia))}catch(Aa){/^gina\-upload/i.test(p)&&W(gina,h,'error',p,Aa),triggerEvent(gina,h,'error.'+
|
|
463
|
+
p,Aa),P&&triggerEvent(gina,h,'error.'+p+'.hform',Aa)}}b||('undefined'!=typeof aa&&null!=aa&&''!=aa&&L.setRequestHeader('Content-Type',aa),L.send(e))}else'undefined'!=typeof aa&&null!=aa&&''!=aa&&L.setRequestHeader('Content-Type',aa),L.send();x.sent=!0;T&&K&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&(gina.forms.sent||(gina.forms.sent={}),ua={id:p,sent:'string'==typeof e?JSON.parse(e):e},window.ginaToolbar.update('forms',ua))}}},W=function(e,b,h,p,x){e=b.uploadProperties||null;if(!e)throw Error('No uploadProperties found !!');
|
|
464
|
+
b=document.getElementById(e.uploadTriggerId);p=null;var u=x.files||[],A=null;e.hasPreviewContainer&&(p=document.getElementById(e.previewContainer.id))&&(p.innerHTML='');e.errorField&&(A=document.getElementById(e.errorField));A&&(A.style.display='none');if(A&&'success'!=h){var V=x.message||x.error;A.innerHTML='<p>'+V+'</p>';fadeIn(A)}else if(A||'success'==h)for(h=0,x=u.length;h<x;++h){var P=p.id.replace(/\-preview/,'-'+h+'-reset-trigger');V=!1;A=document.getElementById(P);var aa=['reset','js-upload-reset'];
|
|
465
|
+
A?(/a/i.test(A.tagName)&&(A.href='#'),A.innerHTML&&''!=A.innerHTML||(A.innerHTML=b.getAttribute('data-gina-form-upload-reset-label')||'Reset'),'undefined'==typeof A.className&&(A.className=''),P=Y(A.className.split(/\s+/g),aa),A.className=P.join(' ')):(V=!0,A=document.createElement('A'),A.href='#',A.innerHTML=b.getAttribute('data-gina-form-upload-reset-label')||'Reset',A.className=aa.join(' '),A.id=P);A.style.display='none';if('undefined'==typeof u[h].preview&&e.hasPreviewContainer&&/^image/.test(u[h].mime)&&
|
|
466
466
|
''!=u[h].location){P=document.createElement('IMG');P.src=u[h].tmpUri;P.style.display='none';P.setAttribute('data-upload-original-filename',u[h].originalFilename);P.setAttribute('data-upload-reset-link-id',A.id);aa=p.getAttribute('data-preview-max-width')||null;if(P.width&&aa&&P.width>aa){var Q=P.width/aa;P.width=aa;P.height/=Q}else!P.width&&aa&&(P.width=aa);/ul/i.test(e.previewContainer.tagName)?(aa=document.createElement('LI'),aa.className='item',aa.appendChild(P),p.appendChild(aa)):p.appendChild(P);
|
|
467
467
|
fadeIn(P)}P=e.uploadFields[h];for(var w in P)if('name'==w&&''!=P[w].value||!u[h][w]||'preview'==w&&'undefined'==typeof u[h][w]||/(height|width)/i.test(w)&&!/^image/.test(u[h].mime))/(preview|height|width)/i.test(w)&&(aa=document.getElementById(P[w].id))&&aa.parentNode.removeChild(aa);else if(P[w].value=u[h][w],'preview'==w)for(var ia in u[h][w])if('undefined'!=typeof u[h][w][ia]&&'undefined'!=typeof P[w][ia]&&(P[w][ia].value=u[h][w][ia]),'tmpUri'==ia&&e.hasPreviewContainer){Q=document.createElement('IMG');
|
|
468
468
|
Q.src=u[h][w].tmpUri;Q.style.display='none';Q.setAttribute('data-upload-original-filename',u[h].originalFilename);Q.setAttribute('data-upload-preview-original-filename',u[h][w].originalFilename);Q.setAttribute('data-upload-reset-link-id',A.id);if(aa=p.getAttribute('data-preview-max-width')||null)Q.width=aa;/ul/i.test(e.previewContainer.tagName)?(aa=document.createElement('LI'),aa.className='item',aa.appendChild(Q),p.appendChild(aa)):p.appendChild(Q);fadeIn(Q)}e.hasPreviewContainer&&(/ul/i.test(e.previewContainer.tagName)?
|
|
469
|
-
(aa=document.createElement('LI'),aa.className='item',
|
|
470
|
-
P.push(x)):(p=u[aa].src.substr(u[aa].src.lastIndexOf('/')+1),P.push(p));for(let w=0,ia=
|
|
471
|
-
!1,p.test(e.form[na].name)&&!/true/i.test(x)&&(e.form[na].remove(),la--,na--,gina&&T&&K&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar))try{window.ginaToolbar.update('data-xhr',{files:
|
|
469
|
+
(aa=document.createElement('LI'),aa.className='item',V&&aa.appendChild(A),p.appendChild(aa)):V&&p.appendChild(A));fb('reset',b,h);fadeIn(A)}else throw Error(V);},ha=function(e,b){console.debug(b+' input files');var h=/reset/i.test(b)?!0:!1,p=null,x=null,u=document.getElementById(e.id+'-preview').childNodes,A=null,V=e.customFiles,P=[];for(let aa=0,Q=u.length;aa<Q;aa++)if(/img/i.test(u[aa].tagName)){h?(p=u[aa].getAttribute('data-upload-original-filename'),P.push(p),(x=u[aa].getAttribute('data-upload-preview-original-filename'))&&
|
|
470
|
+
P.push(x)):(p=u[aa].src.substr(u[aa].src.lastIndexOf('/')+1),P.push(p));for(let w=0,ia=V.length;w<ia;w++)if(V[w].name==p){A=h?document.getElementById(u[aa].getAttribute('data-upload-'+b+'-link-id')):document.getElementById(V[w].deleteLinkId);A.style.display='none';u[aa].style.display='none';V.splice(w,1);e.customFiles=V;h&&(e.value=V.join(', C:\\fakepath\\'));p=new RegExp('^'+(e.name+'['+w+']').replace(/\-|\[|\]|\./g,'\\$&'));for(let na=0,la=e.form.length;na<la;na++)if(x=e.form[na].dataset.ginaFormUploadIsLocked||
|
|
471
|
+
!1,p.test(e.form[na].name)&&!/true/i.test(x)&&(e.form[na].remove(),la--,na--,gina&&T&&K&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar))try{window.ginaToolbar.update('data-xhr',{files:V})}catch(Ca){throw Ca;}x=e.getAttribute('data-gina-form-upload-'+b+'-action');if(!x||'undefined'==typeof x||''==x||/404/.test(x))throw Error('input file `'+e.id+'` error: `data-gina-form-upload-'+b+'-action` is required. You need to provide a valide url.');(p=e.getAttribute('data-gina-form-upload-'+b+'-method'))&&
|
|
472
472
|
'undefined'!=typeof p&&''!=p?p=p.toUpperCase():h?p='POST':(p=1<P.length?'POST':'DELETE',console.warn('`data-gina-form-upload-'+b+'-method` was not defined. Switching to `'+p+'` by default.'));let ua=e.getAttribute('data-gina-form-upload-'+b+'-is-synchrone');if(/null/i.test(ua)||'undefined'==typeof p||''==p)ua=!0;x=setupXhr({url:x,method:p,isSynchrone:ua,headers:{'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8','X-Requested-With':'XMLHttpRequest'}});/GET|DELETE/i.test(p)?x.send():
|
|
473
|
-
x.send(JSON.stringify({files:P}));if(/none/i.test(window.getComputedStyle(e).display)){if(/none/i.test(e.parentElement.style.display)){e.parentElement.style.display='block';return}e.style.display='block'}removeListener(gina,$uploadResetTrigger,'click',function(){A.remove();u[aa].remove()});Q--;aa--;break}}},ea=function(e,b,h,p,x){var u=new FileReader;u.addEventListener('load',function(A){A.preventDefault();try{var
|
|
474
|
-
new Uint8Array(
|
|
473
|
+
x.send(JSON.stringify({files:P}));if(/none/i.test(window.getComputedStyle(e).display)){if(/none/i.test(e.parentElement.style.display)){e.parentElement.style.display='block';return}e.style.display='block'}removeListener(gina,$uploadResetTrigger,'click',function(){A.remove();u[aa].remove()});Q--;aa--;break}}},ea=function(e,b,h,p,x){var u=new FileReader;u.addEventListener('load',function(A){A.preventDefault();try{var V=this.result,P=void 0;A='';var aa=null;'undefined'==typeof P&&(P=8);var Q=P/8;switch(P){case 8:aa=
|
|
474
|
+
new Uint8Array(V);break;case 16:aa=new Uint16Array(V);break;case 32:aa=new Uint32Array(V);break;default:aa=new Uint8Array(V)}var w=aa.length,ia=Math.pow(2,8)+Q;V=0;for(Q=P=null;V<w;V+=ia)P=Math.min(ia,w-V),Q=aa.subarray(V,V+P),A+=String.fromCharCode.apply(null,Q);e[this.index].bin+=A;e[this.index].file.type||(e[this.index].file.type='application/octet-stream')}catch(ua){return x(ua,null,!0)}h+='--'+b+'\r\n';h+='Content-Disposition: form-data; name="'+e[this.index].key+'"; group="'+e[this.index].group+
|
|
475
475
|
'"; filename="'+e[this.index].file.name+'"\r\nContent-Type: '+e[this.index].file.type+'\r\nContent-Length: '+e[this.index].bin.length+'\r\n\r\n';h+=e[this.index].bin+'\r\n';++this.index;this.index==e.length?(h+='--'+b+'--',x(!1,h,!0)):ea(e,b,h,this.index,x)},!1);u.index=p;e[p].bin='';u.readAsArrayBuffer(e[p].file)},wa=function(e){var b=e.target.getAttribute('data-gina-form-event-on-submit-success')||null;if(null!=b)if(/\((.*)\)/.test(b))eval(b);else e.on('success.hform',window[b]);b=e.target.getAttribute('data-gina-form-event-on-submit-error')||
|
|
476
|
-
null;if(null!=b)if(/\((.*)\)/.test(b))eval(b);else e.on('error.hform',window[b])},
|
|
476
|
+
null;if(null!=b)if(/\((.*)\)/.test(b))eval(b);else e.on('error.hform',window[b])},ja=function(e){var b=null,h=e;if(!q.$forms)throw Error('`$forms` collection not found');if('undefined'==typeof h)if('undefined'!=typeof this.id&&''!=this.id&&null!=this.id)h=this.id;else throw Error('[ FormValidator::destroy(formId) ] `formId` is missing');if('string'==typeof h)h=h.replace(/#/,'');else{if('object'!=typeof h||Array.isArray(h))throw Error('[ FormValidator::destroy(formId) ] `formId` should be a `string`');
|
|
477
477
|
e=h.form;h=e.getAttribute('id')||'form.'+oa.v4();e.setAttribute('id',h)}'undefined'!=typeof q.$forms[h]?b=q.$forms[h]:'undefined'!=typeof this.binded&&(b=this);if(b)addListener(gina,b.target,'destroy.'+h,function(p){cancelEvent(p);delete q.$forms[h];removeListener(gina,p.currentTarget,p.type);removeListener(gina,p.currentTarget,'destroy')}),b=Gb(b),triggerEvent(gina,b.target,'destroy.'+h);else throw Error('[ FormValidator::destroy(formId) ] `'+h+'` not found');},ta=function(e){e='undefined'!=typeof e?
|
|
478
478
|
e:q.rules;for(let p in e){var b=Object.getOwnPropertyNames(e[p]),h=0;let x=b.length,u=!1,A=null;for(;h<x;){if(/^_case_/.test(b[h])){u=!0;A=b[h];break}h++}u||'object'!=typeof e[p]||ta(e[p]);if(A&&Array.isArray(e[p][A].conditions)&&0<e[p][A].conditions.length)for(b=0,h=e[p][A].conditions.length;b<h;)'undefined'!=typeof e[p][A].conditions[b].rules&&0==e[p][A].conditions[b].rules.count()&&(e[p][A].conditions.splice(b,1),h--,b--),b++}},Da=function(e){var b=JSON.stringify(e),h=b.match(/("@import\s+[-_a-z A-Z 0-9/.]+")/g)||
|
|
479
|
-
[],p=[];for(let
|
|
480
|
-
'\n':'',A._comment+='Imported from `'+x+'`',A=JSON.stringify(A),b=b.replace(new RegExp(h[
|
|
481
|
-
'g'),'{}'))}catch(w){throw w;}}e={}}e=JSON.parse(b);La(e,'');try{ta()}catch(
|
|
482
|
-
typeof gina.forms.rules&&gina.forms.rules?Y(gina.forms.rules,e,!0):e,q.rules=Y(q.rules,JSON.clone(gina.forms.rules),!0)}catch(
|
|
479
|
+
[],p=[];for(let V=0,P=h.length;V<P;V++)0>p.indexOf(h[V])&&p.push(h[V]);h=p;p=b.match(/("_merging(.*))(\s+:|:)(.*)(",|")/g);q.rules||(q.rules={});if(h&&0<h.length){e={};for(let V=0,P=h.length;V<P;++V){var x=h[V].replace(/(@import\s+|"|')/g,'');var u=x.replace(/(@import\s+|"|')/g,'').split(/\s/g);for(let aa=0,Q=u.length;aa<Q;++aa){var A=u[aa].replace(/\//g,'.').replace(/\-/g,'.');'undefined'!=typeof q.rules[A]?(A=JSON.stringify(q.rules[A]),A=JSON.parse(A),A._comment='undefined'!=typeof A._comment?A._comment+
|
|
480
|
+
'\n':'',A._comment+='Imported from `'+x+'`',A=JSON.stringify(A),b=b.replace(new RegExp(h[V],'g'),A),q.rules=JSON.parse(JSON.stringify(q.rules).replace(new RegExp(h[V],'g'),'{}'))):console.warn('[formValidator:rules] <@import error> on `'+h[V]+'`: rule `'+u[aa]+'` not found. Ignoring.')}u=new RegExp(h[V]);if(x=p&&u.test(p.join())?!0:!1)for(let aa=0,Q=p.length;aa<Q;aa++)if(u.test(p[aa])){x=JSON.stringify(e);x=x.substr(1,x.length-1);aa<Q-1&&(x+=',');try{b=b.replace(new RegExp(p[aa],'g'),x),q.rules=JSON.parse(JSON.stringify(q.rules).replace(new RegExp(p[aa],
|
|
481
|
+
'g'),'{}'))}catch(w){throw w;}}e={}}e=JSON.parse(b);La(e,'');try{ta()}catch(V){console.error(V.stack)}}return e},Pa=function(e){gina.hasValidator?(q=Y(q,gina.validator),q.on('init',function(b){q.isReady=!0;triggerEvent(gina,q.target,'ready.'+q.id,q)})):(q.target=document,q.setOptions=m,q.getFormById=z,q.validateFormById=F,q.resetErrorsDisplay=I,q.resetFields=R,q.handleErrorsDisplay=E,q.send=Ga,q.on('init',function(b){if('undefined'!=typeof e&&e.count())try{La(e,''),e=Da(e),gina.forms.rules='undefined'!=
|
|
482
|
+
typeof gina.forms.rules&&gina.forms.rules?Y(gina.forms.rules,e,!0):e,q.rules=Y(q.rules,JSON.clone(gina.forms.rules),!0)}catch(V){throw V;}za.count()||(za=JSON.clone(q.rules));da.setOptions=m;da.getFormById=z;da.validateFormById=F;da.resetErrorsDisplay=I;da.resetFields=R;da.handleErrorsDisplay=E;da.submit=sa;da.send=Ga;da.unbind=Gb;da.bind=db;da.reBind=yb;da.destroy=ja;b=0;for(var h=document.getElementsByTagName('form'),p=0,x=h.length;p<x;++p){if(h[p].getAttribute){var u=h[p].getAttribute('id')||'form.'+
|
|
483
483
|
oa.v4();u!==h[p].getAttribute('id')&&h[p].setAttribute('id',u)}else u='form.'+oa.v4(),h[p].setAttribute('id',u);da.id=u;da.target=h[p];q.$forms[u]=Y({},da);var A=h[p].getAttribute('data-gina-form-rule');if(A){A=A.replace(/\-|\//g,'.');'undefined'!=typeof e&&(q.$forms[u].rules[A]=q.rules[A]=za[A]=Y(JSON.clone(eval('gina.forms.rules.'+A)),q.rules[A]));if('undefined'==typeof za[A])throw Error('['+u+'] no rule found with key: `'+A+'`. Please check if json is not malformed @ /forms/rules/'+A.replace(/\./g,
|
|
484
|
-
'/')+'.json');A=q.rules[A]}'string'==typeof u&&'undefined'!=typeof za[u.replace(/\-/g,'.')]||'object'==typeof A?(u=q.$forms[u].target,A?db(u,A):db(u),++b):('object'==typeof h[p].id?(delete q.$forms[h[p].id],u=h[p].attributes.getNamedItem('id').nodeValue||'form.'+oa.v4(),h[p].setAttribute('id',u),h[p].id=u,da.target=h[p],q.$forms[u]=Y({},da),u=q.$forms[u].target):u=q.$forms[h[p].id].target,A?db(u,A):db(u))}if(window.XMLHttpRequest)L=new XMLHttpRequest;else if(window.ActiveXObject)try{L=new ActiveXObject('Msxml2.XMLHTTP')}catch(
|
|
484
|
+
'/')+'.json');A=q.rules[A]}'string'==typeof u&&'undefined'!=typeof za[u.replace(/\-/g,'.')]||'object'==typeof A?(u=q.$forms[u].target,A?db(u,A):db(u),++b):('object'==typeof h[p].id?(delete q.$forms[h[p].id],u=h[p].attributes.getNamedItem('id').nodeValue||'form.'+oa.v4(),h[p].setAttribute('id',u),h[p].id=u,da.target=h[p],q.$forms[u]=Y({},da),u=q.$forms[u].target):u=q.$forms[h[p].id].target,A?db(u,A):db(u))}if(window.XMLHttpRequest)L=new XMLHttpRequest;else if(window.ActiveXObject)try{L=new ActiveXObject('Msxml2.XMLHTTP')}catch(V){try{L=
|
|
485
485
|
new ActiveXObject('Microsoft.XMLHTTP')}catch(P){}}q.isReady=!0;gina.hasValidator=!0;gina.validator=q;triggerEvent(gina,q.target,'ready.'+q.id,q)}));q.initialized=!0;return q},La=function(e,b){var h;for(h in e)if('object'==typeof e[h]&&'undefined'==typeof q.rules[b+h]){var p=h;/\[|\]/.test(h)&&(p=h.replace(/\[/g,'.').replace(/\]/g,''));q.rules[b+p]=e[h];La(e[h],b+p+'.')}},Fa=function(e){if('undefined'!=typeof za[e])return za[e];var b=null;if('undefined'==typeof q.rules[e]){if(La(za,''),za=Da(za),b=
|
|
486
|
-
za[e],!b)return{}}else b=q.rules[e];b=JSON.clone(b);var h=new RegExp('^'+e),p=new RegExp('^'+e+'.'),x=null,u=function(
|
|
487
|
-
1)));return za[e]=b},Oa=function(e,b,h,p,x,u,A){var
|
|
488
|
-
''):null)&&parseInt(h)==h?[]:{};
|
|
489
|
-
h.length,1,b,null),e[u]=Y(e[u],A)):x==p-1&&(e[u]=b);Ia(e[u],b,h,p,x+1)},Ka=function(e){var b=null,h={},p=null,x=function(
|
|
486
|
+
za[e],!b)return{}}else b=q.rules[e];b=JSON.clone(b);var h=new RegExp('^'+e),p=new RegExp('^'+e+'.'),x=null,u=function(V,P,aa,Q,w,ia,ua){if(P.length){var na=Object.getOwnPropertyNames(V)[0],la=P[0];la=''==w?w+=la:w+'['+la+']';1==P.length&&(V[na]=Y(V[na],aa,!0));P.splice(0,1);la==na?u(V[na],P,aa,Q,la,ia,ua):'undefined'!=typeof V[na]?u(V[na],P,aa,Q,la,ia,ua):u(V,P,aa,Q,w,ia,ua)}},A;for(A in q.rules)A!=e&&h.test(A)&&(x=A.replace(p,''),/\./.test(x)&&(x=x.split(/\./g),u(b,x,q.rules[A],b,'',0,b.count()-
|
|
487
|
+
1)));return za[e]=b},Oa=function(e,b,h,p,x,u,A){var V=window.gina._global;V.register({root:e||null,obj:h||null,value:u||null,rootObj:A||null});if(x==p)return eval(root+'=value'),b=JSON.clone(rootObj),V.unregister(['root','obj','rootObj','value','valueType']),b;e=b[x].replace(/^\[|\]$/g,'');'undefined'!=typeof rootObj&&rootObj?root+=/^\d+$/.test(e)?'['+e+']':'["'+e+'"]':(rootObj={},root='rootObj',root+=/^\d+$/.test(e)?'['+e+']':'["'+e+'"]',eval(root+'=obj'));u=(h='undefined'!=typeof b[x+1]?b[x+1].replace(/^\[|\]$/g,
|
|
488
|
+
''):null)&&parseInt(h)==h?[]:{};V.register({valueType:u});h&&eval(root+' = valueType');if('undefined'==typeof obj[e])return/^\d+$/.test(h)?obj[e]=[]:obj[e]={},++x,Oa(root,b,obj[e],p,x,value,rootObj);++x;return Oa(root,b,obj[e],p,x,value,rootObj)},Ia=function(e,b,h,p,x){if(x>=p)return!1;var u=h[x].replace(/^\[|\]$/g,''),A=x<p-1&&'undefined'!=typeof h[x+1]?h[x+1].replace(/^\[|\]$/g,''):null;'undefined'==typeof e[u]&&(A&&/^\d+$/.test(A)?(parseInt(A),e[u]=[]):e[u]={});Array.isArray(e[u])?(A=Oa(u,h,e[u],
|
|
489
|
+
h.length,1,b,null),e[u]=Y(e[u],A)):x==p-1&&(e[u]=b);Ia(e[u],b,h,p,x+1)},Ka=function(e){var b=null,h={},p=null,x=function(V,P,aa,Q,w){if(w==Q)return V;var ia=P?Object.keys(aa)[w]:w;/\[(.*)\]/.test(ia)?(p=ia,b=ia.match(/(\[[-_\[a-z 0-9]*\]\]|\[[-_\[a-z 0-9]*\])/ig),ia=ia.match(/^[-_a-z 0-9]+\[{0}/ig),'undefined'==typeof V[ia]&&(V[ia]=Array.isArray(aa[p])?[]:{}),Ia(h,aa[p],b,b.length,0),V[ia]=Y(V[ia],h),h={}):V[ia]=aa[ia];++w;return x(V,P,aa,Q,w)},u='undefined'==typeof e?0:1,A=!1;Array.isArray(e)?u=
|
|
490
490
|
e.length:'object'==typeof e&&(u=e.count(),A=!0);return x({},A,e,u,0)},Ya=function(e){var b=q.$forms[e.form.getAttribute('id')],h=/^true$/i.test(e.disabled)?!0:!1;h&&'undefined'!=typeof b.rule&&'undefined'!=typeof b.rule[e.name]&&'undefined'!=typeof b.rule[e.name].exclude&&/^false$/i.test(b.rule[e.name].exclude)&&(h=!1);if(/^(radio|text|hidden|password|number|date|email)$/i.test(e.type)&&!h){var p=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,'value'),x=p.set;p.set=function(u){Object.defineProperty(this,
|
|
491
491
|
'value',{set:x});var A='change.'+this.id;u===this.value&&u===this.defaultValue||u===this.value||(this.value=u,console.debug('Value set: '+u),'undefined'!=typeof gina.events[A]&&(console.debug('trigger event on: ',this.name,A),triggerEvent(gina,this,A,u)));Object.defineProperty(this,'value',p)};Object.defineProperty(e,'value',p)}},pb=function(e,b,h,p){'undefined'==typeof p&&(p=!1);var x=e.rules,u=q.$forms[b.form.getAttribute('id')],A=/^true$/i.test(b.disabled)?!0:!1;A&&'undefined'!=typeof u.rule&&
|
|
492
492
|
'undefined'!=typeof u.rule[b.name]&&'undefined'!=typeof u.rule[b.name].exclude&&/^false$/i.test(u.rule[b.name].exclude)&&(A=!1);if(/^(radio|checkbox|text|hidden|password|number|date|email)$/i.test(b.type)&&!A||p&&!A){p=b.name;u=x[p]||null;if(!u&&(Na(x,b),'undefined'==typeof x[p]))return;if(e.target.dataset.ginaFormLiveCheckEnabled&&u&&(p=[],u=null,A=0,/^(radio|checkbox)$/i.test(b.type)?u=/^(radio|checkbox)$/i.test(b.type)?'changed.'+b.id:'change.'+b.id:(addEventListener(gina,b,'focusout.'+b.id,function(P){P.preventDefault();
|
|
493
|
-
clearTimeout(h)}),u='change.'+b.id,'undefined'==typeof gina.events[u]&&(p[A]=u,++A),u='keyup.'+b.id,'undefined'==typeof gina.events[u]&&(p[A]=u,++A),u='focusin.'+b.id,'undefined'==typeof gina.events[u]&&(p[A]=u,++A),u='focusout.'+b.id),'undefined'==typeof gina.events[u]&&(p[A]=u,++A),0<p.length)){var
|
|
493
|
+
clearTimeout(h)}),u='change.'+b.id,'undefined'==typeof gina.events[u]&&(p[A]=u,++A),u='keyup.'+b.id,'undefined'==typeof gina.events[u]&&(p[A]=u,++A),u='focusin.'+b.id,'undefined'==typeof gina.events[u]&&(p[A]=u,++A),u='focusout.'+b.id),'undefined'==typeof gina.events[u]&&(p[A]=u,++A),0<p.length)){var V=!1;addListener(gina,b,p,function(P){P.preventDefault();clearTimeout(h);if(!V&&/^changed\./i.test(P.type)||!V&&/^(radio|checkbox)$/i.test(P.target.type))V=!0;else if(V&&/^changed\./i.test(P.type)||V&&
|
|
494
494
|
/^(radio|checkbox)$/i.test(P.target.type))return!1;if('undefined'!=typeof q.$forms[P.target.form.getAttribute('id')].isSubmitting&&/true/i.test(q.$forms[P.target.form.getAttribute('id')].isSubmitting))return!1;var aa=function(){console.debug('processing: '+P.target.name+'/'+P.target.id);if(!/^(radio|checkbox)$/i.test(P.target.type)&&P.target.value===P.target.defaultValue&&''!=P.target.value){var Q=q.$forms[P.target.form.getAttribute('id')].errors;if(Q&&0!=Q.count())E(P.target.form,Q,null,P.target.name);
|
|
495
495
|
else return E(P.target.form,{},null,P.target.name),cancelEvent(P)}Q={};var w={};Q[P.target.name]=P.target.value;w[P.target.name]=P.target;q.$forms[P.target.form.getAttribute('id')].isValidating=!0;M(P.target,Q,w,e.rules,function(ia){q.$forms[P.target.form.getAttribute('id')].isValidating=!1;ia.isValid()?E(P.target.form,{},ia.data,P.target.name):E(P.target.form,ia.error,ia.data,P.target.name);var ua=P.target.form,na=ia=null,la=null;na=Pb(ua,x);ia=na.fields;na=na.$fields;var Ca=ua.getAttribute('id');
|
|
496
|
-
la=q.$forms[Ca].rules;q.$forms[Ca].isValidating=!0;M(ua,ia,na,la,function(Aa){q.$forms[Ca].isValidating=!1;console.debug('['+Ca+'] onSilentGlobalLiveValidation: '+Aa.isValid(),Aa);var Sa=Aa.isValid();T&&K&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&(gina.forms.errors||(gina.forms.errors={}),window.ginaToolbar.update('forms',{id:Ca,errors:Aa.error||{}}));Eb(ua,Sa);
|
|
497
|
-
w))return++w,setTimeout(()=>{console.debug(' changed .... '+b.id);aa()},0)}(
|
|
496
|
+
la=q.$forms[Ca].rules;q.$forms[Ca].isValidating=!0;M(ua,ia,na,la,function(Aa){q.$forms[Ca].isValidating=!1;console.debug('['+Ca+'] onSilentGlobalLiveValidation: '+Aa.isValid(),Aa);var Sa=Aa.isValid();T&&K&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&(gina.forms.errors||(gina.forms.errors={}),window.ginaToolbar.update('forms',{id:Ca,errors:Aa.error||{}}));Eb(ua,Sa);V=!1})})};if(/^changed\./i.test(P.type)||/^change\./i.test(P.type)&&'radio'==P.target.type)return function(Q,w){if(!(0<
|
|
497
|
+
w))return++w,setTimeout(()=>{console.debug(' changed .... '+b.id);aa()},0)}(V,0);/^focusin\./i.test(P.type)?/\-error/.test(b.parentNode.className)&&(console.debug('#1 you just focusin ....'+b.id,b.value),r(b)):/^focusout\./i.test(P.type)?/\-warning/.test(b.parentNode.className)&&(console.debug('#1 you just focusout ....'+b.id,b.value),r(b),E(b.form,q.$forms[b.form.getAttribute('id')].errors,null,b.name)):/^keyup\./i.test(P.type)?(b.ginaFormValidatorTestedValue=b.value,h=setTimeout(function(){-1<['91',
|
|
498
498
|
'17'].indexOf(''+P.keyCode)&&0==N.count()||(console.debug(' keyup ('+P.keyCode+') .... '+b.id,b.value,' VS ',b.ginaFormValidatorTestedValue+'(old)'),aa())},1E3)):/^change\./i.test(P.type)&&!/^(checkbox)$/i.test(P.target.type)&&(console.debug(' change .... '+b.id),aa())})}}},$a=function(e,b){e.setSelectionRange?(e.focus(),e.setSelectionRange(b,b)):e.createTextRange&&(e=e.createTextRange(),e.collapse(!0),e.moveEnd('character',b),e.moveStart('character',b),e.select())},ib=function(e,b){if(document.activeElement&&
|
|
499
499
|
document.activeElement.form){e=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(x){return 0<x.offsetWidth||0<x.offsetHeight||x===document.activeElement});var h=e.indexOf(document.activeElement);if(-1<h){var p=e[h+1];b&&(p=e[h-1]);(p||e[0]).focus()}}},bc=function(e,b){e.setAttribute('readonly','readonly');addListener(gina,
|
|
500
|
-
e,'focusout.'+e.id,function(h){h.preventDefault();clearTimeout(b);h=h.currentTarget;triggerEvent(gina,h,'change.'+h.id);h.setAttribute('readonly','readonly')});addListener(gina,e,'focusin.'+e.id,function(h){h.preventDefault();h.currentTarget.removeAttribute('readonly');var p='keydown.'+h.currentTarget.id;'undefined'==typeof gina.events[p]&&addListener(gina,h.currentTarget,p,function(x){x.preventDefault();clearTimeout(b);var u=x.currentTarget,A=x.currentTarget.value,
|
|
501
|
-
u.removeAttribute('readonly');switch(x.keyCode){case 46:case 8:
|
|
502
|
-
|
|
503
|
-
|
|
500
|
+
e,'focusout.'+e.id,function(h){h.preventDefault();clearTimeout(b);h=h.currentTarget;triggerEvent(gina,h,'change.'+h.id);h.setAttribute('readonly','readonly')});addListener(gina,e,'focusin.'+e.id,function(h){h.preventDefault();h.currentTarget.removeAttribute('readonly');var p='keydown.'+h.currentTarget.id;'undefined'==typeof gina.events[p]&&addListener(gina,h.currentTarget,p,function(x){x.preventDefault();clearTimeout(b);var u=x.currentTarget,A=x.currentTarget.value,V=u.selectionStart,P=u.selectionEnd;
|
|
501
|
+
u.removeAttribute('readonly');switch(x.keyCode){case 46:case 8:V!=P?(u.value=A.substr(0,V)+A.substr(P),0==V&&(u.value=A.substr(P))):u.value=0==V?A.substring(V+1):A.substr(0,V-1)+A.substr(P);x.currentTarget.setAttribute('readonly','readonly');setTimeout(()=>{u.removeAttribute('readonly');setTimeout(()=>{V!=P?$a(u,V):0==V?$a(u,V):$a(u,V-1)},0)},0);break;case 9:N[16]&&N[9]?ib(u,!0):ib(u);break;case 13:case 16:break;case 37:console.debug('moving left ',V-1);$a(u,V-1);break;case 39:V+1<A.length+1&&$a(u,
|
|
502
|
+
V+1);break;case 17:case 91:console.debug('CMD hit');x.preventDefault();break;case 67:if(N[67]&&N[91]||N[67]&&N[17]){u.setSelectionRange(V,P);document.execCommand('copy');break}case 86:if(N[86]&&N[91]||N[86]&&N[17]){V!=P&&(u.value=u.value.replace(A.substring(V,P),''));$a(u,V);document.execCommand('paste');break}case 88:if(N[88]&&N[91]||N[88]&&N[17]){u.setSelectionRange(V,P);document.execCommand('cut');break}case 90:if(N[90]&&N[91]||N[90]&&N[17]){u.value=u.defaultValue;break}default:V!=P?(u.value=A.substr(0,
|
|
503
|
+
V)+x.key,P-1<A.length&&(u.value+=A.substring(P))):u.value=0==V?x.key+A.substring(V):A.substr(0,V)+x.key+A.substr(P),x.currentTarget.setAttribute('readonly','readonly'),setTimeout(()=>{u.removeAttribute('readonly');setTimeout(()=>{$a(u,V+1)},0)},0)}})})},$b=function(e,b){if(/^(input|textarea)$/i.test(b.tagName)&&'undefined'==typeof gina.events['registered.'+b.id]){/^file$/i.test(b.type)||Ya(b);switch(b.tagName.toLowerCase()){case 'textarea':pb(e,b,null,!0);break;default:pb(e,b,null),e=b.getAttribute('autocomplete'),
|
|
504
504
|
/safari/i.test(navigator.userAgent)&&e&&/^(off|false)/i.test(e)&&bc(b,null)}gina.events['registered.'+b.id]=b.id}},fb=function(e,b,h){var p=b.id+'-'+h+'-'+e+'-trigger',x=document.getElementById(p);x||(p=b.getAttribute('data-gina-form-upload--'+h+ +e+'-trigger'),x=document.getElementById(p));x&&'undefined'==typeof x.isBinded||x&&'undefined'!=typeof x.isBinded&&!/true/i.test(x.isBinded)?(addListener(gina,x,'click',function(u){u.preventDefault();ha(b,e)}),x.isBinded=!0):console.warn('[FormValidator::bindForm][upload]['+
|
|
505
|
-
b.id+'] : did not find `upload '+e+' trigger`.\nPlease, make sure that your delete element ID is `'+p+'-'+e+'-trigger`, or add to your file input ('+b.id+') -> `data-gina-form-upload-'+e+'-trigger="your-custom-id"` definition.')},Cb=function(e,b){var h=function(p,x,u){var A=null;switch(x){case 'data-gina-form-upload-action':A='upload-to-tmp-xml';break;case 'data-gina-form-upload-reset-action':A='upload-delete-from-tmp-xml'}var
|
|
506
|
-
p.id+'`. Trying to get default route.');var P=null;try{A&&(
|
|
505
|
+
b.id+'] : did not find `upload '+e+' trigger`.\nPlease, make sure that your delete element ID is `'+p+'-'+e+'-trigger`, or add to your file input ('+b.id+') -> `data-gina-form-upload-'+e+'-trigger="your-custom-id"` definition.')},Cb=function(e,b){var h=function(p,x,u){var A=null;switch(x){case 'data-gina-form-upload-action':A='upload-to-tmp-xml';break;case 'data-gina-form-upload-reset-action':A='upload-delete-from-tmp-xml'}var V=p.getAttribute(x);if(!V||''==V){A||console.warn('`'+x+'` definition not found for `'+
|
|
506
|
+
p.id+'`. Trying to get default route.');var P=null;try{A&&(V=S.getRoute(A))}catch(aa){P=aa}V?(console.info('Ignore previous warnings regarding upload. I have found a default `'+x+'` route: `'+A+'@'+V.bundle+'`'),p.setAttribute('data-gina-form-upload-action',V.toUrl())):(p='`'+x+'` needs to be defined to proceed for your `input[type=file]` with ID `'+p.id+'`\n'+P+'\n',u&&(u.innerHTML+=p.replace(/(\n|\r)/g,'<br>')),console.error(p))}};h(e,'data-gina-form-upload-action',b);h(e,'data-gina-form-upload-reset-action',
|
|
507
507
|
b);h(e,'data-gina-form-upload-delete-action',b)},yb=function(e,b,h){e=Gb(e);db(e.target,b);return h?h(e):e},Gb=function(e){var b=null,h=null;try{if(e.getAttribute&&e.getAttribute('id'))if(h=e.getAttribute('id'),'undefined'!=typeof q.$forms[h])b=q.$forms[h];else throw Error('form instance `'+h+'` not found');else if('undefined'!=typeof e.target)b=e,h=b.id;else throw Error('Validator::unbindForm($target): `$target` must be a DOM element\n'+err.stack);}catch(A){throw Error('Validator::unbindForm($target) could not unbind form `'+
|
|
508
508
|
e+'`\n'+A.stack);}if('undefined'!=typeof b&&!b.binded)return b;removeListener(gina,b,'success.'+h);removeListener(gina,b,'error.'+h);b.target.getAttribute('data-gina-form-event-on-submit-success')&&removeListener(gina,b,'success.'+h+'.hform');b.target.getAttribute('data-gina-form-event-on-submit-error')&&removeListener(gina,b,'error.'+h+'.hform');removeListener(gina,b,'validate.'+h);removeListener(gina,b,'validated.'+h);removeListener(gina,b,'submit.'+h);removeListener(gina,b,'reset.'+h);e=[];h=b.target.getElementsByTagName('button');
|
|
509
|
-
if(0<h.length)for(let A=0,
|
|
510
|
-
gina.events[u+'.'+p+'.hform']==p&&removeListener(gina,x,u+'.'+p+'.hform')}}}}else for(let P=0,aa=Ea.length;P<aa;P++)p=Ea[P]+'.'+h[A].id,'undefined'!=typeof gina.events[p]&&gina.events[p]==h[A].id&&removeListener(gina,h[A],p),p=Ea[P],'undefined'!=typeof gina.events[p]&&gina.events[p]==h[A].id&&removeListener(gina,h[A],p),p=h[A].id,'undefined'!=typeof gina.events[p]&&gina.events[p]==h[A].id&&removeListener(gina,h[A],p);h=b.target.getElementsByTagName('textarea');if(0<h.length)for(let A=0,
|
|
511
|
-
|
|
509
|
+
if(0<h.length)for(let A=0,V=h.length;A<V;++A)e.push(h[A]);h=b.target.getElementsByTagName('a');if(0<h.length)for(let A=0,V=h.length;A<V;++A)e.push(h[A]);h=b.target.getElementsByTagName('input');if(0<h.length)for(let A=0,V=h.length;A<V;++A)if(/^(hidden)$/i.test(h[A].type)||e.push(h[A]),/^(file)$/i.test(h[A].type)){var p=h[A].getAttribute('data-gina-form-virtual');if(p){var x=z(p).target;if(x){e.push(x);for(let P=0,aa=Ea.length;P<aa;P++){var u=Ea[P];'undefined'!=typeof gina.events[u+'.'+p+'.hform']&&
|
|
510
|
+
gina.events[u+'.'+p+'.hform']==p&&removeListener(gina,x,u+'.'+p+'.hform')}}}}else for(let P=0,aa=Ea.length;P<aa;P++)p=Ea[P]+'.'+h[A].id,'undefined'!=typeof gina.events[p]&&gina.events[p]==h[A].id&&removeListener(gina,h[A],p),p=Ea[P],'undefined'!=typeof gina.events[p]&&gina.events[p]==h[A].id&&removeListener(gina,h[A],p),p=h[A].id,'undefined'!=typeof gina.events[p]&&gina.events[p]==h[A].id&&removeListener(gina,h[A],p);h=b.target.getElementsByTagName('textarea');if(0<h.length)for(let A=0,V=h.length;A<
|
|
511
|
+
V;++A)e.push(h[A]);h=b.target.getElementsByTagName('form');if(0<h.length)for(let A=0,V=h.length;A<V;++A)e.push(h[A]);e.push(b.target);for(let A=0,V=e.length;A<V;++A){h=e[A];p=h.getAttribute('id');for(let P=0,aa=Ea.length;P<aa;P++)u=x=Ea[P],'undefined'!=typeof gina.events[u]&&gina.events[u]==p&&removeListener(gina,h,u),u=p,'undefined'!=typeof gina.events[u]&&gina.events[u]==p&&removeListener(gina,h,u),u=x+'.'+p,'undefined'!=typeof gina.events[u]&&gina.events[u]==p&&removeListener(gina,h,u),u=x+'.'+
|
|
512
512
|
p,'undefined'!=typeof gina.events[u]&&gina.events[u]==u&&removeListener(gina,h,u),u=x+'.'+p+'.hform','undefined'!=typeof gina.events[u]&&gina.events[u]==p&&removeListener(gina,h,u)}evt=null;b.binded=!1;return b},Na=function(e,b){b=b.name;if(!e[b])for(let h in e)if(/^\//.test(h)&&(re=h.match(/\/(.*)\//).pop(),flags=h.replace('/'+re+'/',''),re=re.replace(/\[/g,'\\[').replace(/\]/g,'\\]'),re=new RegExp(re,flags),re.test(b))){e[b]=e[h];break}},db=function(e,b){var h=null,p=null,x=typeof(0<za.count())?
|
|
513
|
-
za:q.rules;try{if(e.getAttribute&&e.getAttribute('id'))if(p=e.getAttribute('id'),'undefined'!=typeof q.$forms[p])h=q.$forms[p];else throw Error('form instance `'+p+'` not found');else throw Error('Validator::bindForm($target, customRule): `$target` must be a DOM element\n'+err.stack);}catch(fa){throw Error('Validator::bindForm($target, customRule) could not bind form `'+e+'`\n'+fa.stack);}if('undefined'!=typeof h&&h.binded)return!1;console.debug('binding for: '+p);var u=!1,A=null,
|
|
513
|
+
za:q.rules;try{if(e.getAttribute&&e.getAttribute('id'))if(p=e.getAttribute('id'),'undefined'!=typeof q.$forms[p])h=q.$forms[p];else throw Error('form instance `'+p+'` not found');else throw Error('Validator::bindForm($target, customRule): `$target` must be a DOM element\n'+err.stack);}catch(fa){throw Error('Validator::bindForm($target, customRule) could not bind form `'+e+'`\n'+fa.stack);}if('undefined'!=typeof h&&h.binded)return!1;console.debug('binding for: '+p);var u=!1,A=null,V='',P=null;'undefined'!=
|
|
514
514
|
typeof b||'string'==typeof p&&'undefined'!=typeof x[p.replace(/\-|\//g,'.')]?(u=!0,A=b&&'object'==typeof b?b:b&&'string'==typeof b&&'undefined'!=typeof x[b.replace(/\-|\//g,'.')]?Fa(b.replace(/\-|\//g,'.')):Fa(p.replace(/\-|\//g,'.')),h.rules=A,T&&K&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&(gina.forms.rules||(gina.forms.rules={}),objCallback={id:p,rules:h.rules},window.ginaToolbar.update('forms',objCallback))):h.rules={};'undefined'==typeof h.target.dataset.ginaFormLiveCheckEnabled&&
|
|
515
515
|
0<h.rules.count()?h.target.dataset.ginaFormLiveCheckEnabled=!0:h.target.dataset.ginaFormLiveCheckEnabled='undefined'!=typeof h.target.dataset.ginaFormLiveCheckEnabled?/^true$/i.test(h.target.dataset.ginaFormLiveCheckEnabled)?!0:!1:!1;h.fieldsSet||(h.fieldsSet={});P=null;e.getElementsByTagName('a');b=e.getElementsByTagName('input');var aa=e.getElementsByTagName('textarea');P=e.getElementsByTagName('select');var Q={},w=[],ia={},ua=null,na={},la=null,Ca=null;for(let fa=0,X=aa.length;fa<X;++fa)Na(h.rules,
|
|
516
516
|
aa[fa]),Ca=aa[fa].getAttribute('id'),Ca&&''!=Ca||(Ca='textareas.'+oa.v4(),aa[fa].setAttribute('id',Ca)),h.fieldsSet[Ca]||(h.fieldsSet[Ca]={id:Ca,name:aa[fa].name||null,value:aa[fa].value||'',defaultValue:aa[fa].value||''}),/^true$/i.test(h.target.dataset.ginaFormLiveCheckEnabled)&&$b(h,aa[fa]);for(let fa=0,X=b.length;fa<X;++fa){Na(h.rules,b[fa]);Ca=b[fa].getAttribute('id');Ca&&''!=Ca||(Ca='input.'+oa.v4(),b[fa].setAttribute('id',Ca));h.fieldsSet[Ca]||(ua=b[fa].value,/$(on|true|false)$/i.test(ua)&&
|
|
517
517
|
(ua=/$(on|true)$/i.test(ua)?!0:!1),h.fieldsSet[Ca]={id:Ca,name:b[fa].name||null,value:ua||!/^(checkbox|radio)$/i.test(b[fa].type)?'':b[fa].checked,defaultValue:/^(checkbox|radio)$/i.test(b[fa].type)?b[fa].checked:ua},/^(checkbox|radio)$/i.test(b[fa].type)&&'undefined'==typeof h.fieldsSet[Ca].defaultChecked&&(h.fieldsSet[Ca].defaultChecked=/^(true|on)$/i.test(b[fa].checked)||/^(true|on)$/.test(ua)&&/^(checkbox)$/i.test(b[fa].type)?!0:!1,/^radio$/i.test(b[fa].type)&&(h.fieldsSet[Ca].value=b[fa].value,
|
|
518
518
|
h.fieldsSet[Ca].defaultValue=b[fa].value)));/^true$/i.test(h.target.dataset.ginaFormLiveCheckEnabled)&&$b(h,b[fa]);if(ua=b[fa].getAttribute('data-gina-form-element-group'))0>w.indexOf(ua)&&w.push(ua),la=b[fa].getAttribute('name')||Ca,la===Ca&&b[fa].setAttribute('name',Ca),Q[Ca]={id:Ca,name:la,group:ua,target:b[fa]},ia[b[fa].name]=new RegExp('^'+ua.replace(/[.*+?^${}()|[\]\\]/g,'\\$&')),u&&('undefined'==typeof h.rules[b[fa].name]&&(h.rules[b[fa].name]={}),'undefined'!=typeof h.rules[b[fa].name].isRequired&&
|
|
519
519
|
h.rules[b[fa].name].isRequired||(h.rules[b[fa].name].exclude=!0));if(0<ia.count())for(var Aa in ia)b[fa].name!=Aa&&(b[fa].getAttribute('data-gina-form-element-group'),ia[Aa].test(b[fa].name)&&(b[fa].disabled=!0,'undefined'==typeof na[Aa]&&(na[Aa]={}),na[Aa][b[fa].name]=b[fa]));if(/^file$/i.test(b[fa].type)){Ca=b[fa].getAttribute('data-gina-form-upload-trigger');Ca||(Ca=b[fa].id);ua=null;la=(new DOMParser).parseFromString(e.innerHTML,'text/html');Ca&&(ua=document.getElementById(Ca));aa=document.getElementById(b[fa].id+
|
|
520
|
-
'-error');Cb(b[fa],aa);if((aa=la.getElementById(Ca+'-preview'))&&ua&&!/none/i.test(window.getComputedStyle(aa).display)&&!/none/i.test(aa.parentElement.style.display)){la=0;console.debug('preview is visible ...');ua.customFiles=[];ua.form=e;aa=aa.childNodes;for(let
|
|
521
|
-
(Sa=aa[
|
|
522
|
-
eb);var Qa=qa.getAttribute('data-gina-form-upload-on-success'),wb=qa.getAttribute('data-gina-form-upload-on-error'),jb=null;if(0<
|
|
520
|
+
'-error');Cb(b[fa],aa);if((aa=la.getElementById(Ca+'-preview'))&&ua&&!/none/i.test(window.getComputedStyle(aa).display)&&!/none/i.test(aa.parentElement.style.display)){la=0;console.debug('preview is visible ...');ua.customFiles=[];ua.form=e;aa=aa.childNodes;for(let ka=0,qa=aa.length;ka<qa;ka++){var Sa=null;if(/ul/i.test(aa[ka].tagName))for(let Ra=0,ab=aa[ka].length;Ra<ab;Ra++){let eb=$$els[ka];for(let Qa=0,wb=eb.length;Qa<wb;Qa++)/img/i.test(eb[Qa])&&(Sa=eb[Qa],Sa.setAttribute(''),la++)}else/img/i.test(aa[ka].tagName)&&
|
|
521
|
+
(Sa=aa[ka],deleteLinkId=Ca+'-'+la+'-delete-trigger',Sa=Sa.src.substr(Sa.src.lastIndexOf('/')+1),ua.customFiles.push({name:Sa,deleteLinkId}),fb('delete',ua,la),la++)}}addListener(gina,b[fa],'change',function(ka){ka.preventDefault();var qa=ka.currentTarget;ka=qa.files;qa.customFiles=Array.from(ka);if(!ka.length)return!1;var Ra=qa.getAttribute('data-gina-form-upload-action'),ab=qa.getAttribute('name'),eb='gina-upload-'+ab.replace(/\[/g,'-').replace(/\]/g,'-'+h.id);qa.setAttribute('data-gina-form-virtual',
|
|
522
|
+
eb);var Qa=qa.getAttribute('data-gina-form-upload-on-success'),wb=qa.getAttribute('data-gina-form-upload-on-error'),jb=null;if(0<ka.length){var nb=null;if(y()){nb=gina.popin.getActivePopin();nb.$target=(new DOMParser).parseFromString(nb.target.outerHTML,'text/html');nb.$target.getElementById(nb.id).innerHTML=document.getElementById(nb.id).innerHTML;var ob=nb.$target.getElementById(eb)}else ob=document.getElementById(eb);if(!ob){try{ob=z(eb)||null}catch(Tc){}ob||=y()?nb.$target.createElement('form'):
|
|
523
523
|
document.createElement('form');ob.id=eb;ob.action=Ra;ob.enctype='multipart/form-data';ob.method='POST';if('undefined'!=typeof qa.form){Ra='files';var rb=qa.getAttribute('data-gina-form-upload-prefix')||qa.name||qa.getAttribute('name'),lb=qa.id||qa.getAttribute('id'),Nb=!1,Db=qa.getAttribute('data-gina-form-upload-preview')||lb+'-preview';Db=y()?nb.$target.getElementById(Db):document.getElementById(Db);'undefined'!=typeof Db&&(Nb=!0);rb&&(Ra=rb);rb=[];for(var Ib='name group originalFilename ext encoding size height width location mime preview'.split(' '),
|
|
524
|
-
Kb=qa.form.getElementsByTagName('INPUT'),Zb,Wb,Gc,qc,Mb=0,Nc=
|
|
524
|
+
Kb=qa.form.getElementsByTagName('INPUT'),Zb,Wb,Gc,qc,Mb=0,Nc=ka.length;Mb<Nc;++Mb){fb('reset',qa,Mb);rb[Mb]=null;Zb=Ra+'['+Mb+']';qc=new RegExp('^'+Zb.replace(/\[/g,'\\[').replace(/\]/g,'\\]'));for(var wc=0,xc=Kb.length;wc<xc;++wc)Zb=Kb[wc].getAttribute('type'),jb=Kb[wc].getAttribute('data-gina-form-upload-error')||lb+'-error'||null,Zb&&/hidden/i.test(Zb)&&(Wb=Kb[wc],Zb=/\[\w+\]$/i.test(Wb.name)?Wb.name.match(/\[\w+\]$/)[0].replace(/\[|\]/g,''):Wb.name,Gc=/\[\w+\]$/i.test(Wb.name)?Wb.name.match(/\[\w+\]$/)[0].replace(/\[|\]/g,
|
|
525
525
|
''):Wb.name,Wb&&'undefiend'!=typeof Zb&&-1<Ib.indexOf(Zb)&&qc.test(Wb.name)?(rb[Mb]||(rb[Mb]={}),/\[preview\]/i.test(Wb.name)?('undefined'==typeof rb[Mb].preview&&(rb[Mb].preview={}),rb[Mb].preview[Zb]=Wb):rb[Mb][Zb]=Wb):Wb&&'undefiend'!=typeof Zb&&0>Ib.indexOf(Zb)&&qc.test(Wb.name)&&(rb[Mb]||(rb[Mb]={}),/\[preview\]/i.test(Wb.name)?('undefined'==typeof rb[Mb].preview&&(rb[Mb].preview={}),rb[Mb].preview[Gc]=Wb):rb[Mb][Gc]=Wb));qc=0;for(wc=Ib.length;qc<wc;++qc)rb[Mb]||(rb[Mb]={}),'undefined'==typeof rb[Mb][Ib[qc]]&&
|
|
526
526
|
(Zb=Ra+'['+Mb+']['+Ib[qc]+']',$newVirtualField=document.createElement('input'),$newVirtualField.type='hidden',$newVirtualField.id='input.'+oa.v4(),$newVirtualField.name=Zb,$newVirtualField.value='',qa.form.appendChild($newVirtualField),rb[Mb][Ib[qc]]=qa.form[qa.form.length-1])}ob.uploadProperties={id:qa.form.id||qa.getAttribute('id'),uploadTriggerId:qa.id,$form:qa.form,errorField:jb,mandatoryFields:Ib,uploadFields:rb,hasPreviewContainer:Nb,isPopinContext:y()};Nb&&(ob.uploadProperties.previewContainer=
|
|
527
|
-
Db)}Qa?ob.setAttribute('data-gina-form-event-on-submit-success',Qa):ob.setAttribute('data-gina-form-event-on-submit-success','onGenericXhrResponse');wb?ob.setAttribute('data-gina-form-event-on-submit-error',wb):ob.setAttribute('data-gina-form-event-on-submit-error','onGenericXhrResponse');y()?document.getElementById(nb.id).appendChild(ob):document.body.appendChild(ob)}try{var sc=z(eb),Sc=new FormData;qa=null;eb=0;for(var Oc=
|
|
528
|
-
}}})}}var Va=function(fa,X){fa.setAttribute('data-value',fa.value);if(/^(true)$/i.test(X.target.dataset.ginaFormLiveCheckEnabled&&0<X.rules.count())){var
|
|
527
|
+
Db)}Qa?ob.setAttribute('data-gina-form-event-on-submit-success',Qa):ob.setAttribute('data-gina-form-event-on-submit-success','onGenericXhrResponse');wb?ob.setAttribute('data-gina-form-event-on-submit-error',wb):ob.setAttribute('data-gina-form-event-on-submit-error','onGenericXhrResponse');y()?document.getElementById(nb.id).appendChild(ob):document.body.appendChild(ob)}try{var sc=z(eb),Sc=new FormData;qa=null;eb=0;for(var Oc=ka.length;eb<Oc;++eb)qa=ka[eb],Sc.append(ab,qa,qa.name);sc.send(Sc,{withCredentials:!0})}catch(Tc){throw Tc;
|
|
528
|
+
}}})}}var Va=function(fa,X){fa.setAttribute('data-value',fa.value);if(/^(true)$/i.test(X.target.dataset.ginaFormLiveCheckEnabled&&0<X.rules.count())){var ka={},qa={},Ra=null;Ra=fa.form;ka[event.target.name]=event.target.value;qa[event.target.name]=event.target;q.$forms[Ra.getAttribute('id')].isValidating=!0;M(event.target,ka,qa,X.rules,function(ab){q.$forms[Ra.getAttribute('id')].isValidating=!1;ab.isValid()?E(Ra,{},ab.data,event.target.name):E(Ra,ab.error,ab.data,event.target.name);var eb=Ra,Qa=
|
|
529
529
|
ab=null,wb=null;Qa=Pb(eb,x);ab=Qa.fields;Qa=Qa.$fields;var jb=eb.getAttribute('id');wb=q.$forms[jb].rules;q.$forms[jb].isValidating=!0;M(eb,ab,Qa,wb,function(nb){q.$forms[jb].isValidating=!1;console.debug('[updateSelect]: onSilentGlobalLiveValidation: '+nb.isValid(),nb);nb=nb.isValid();Eb(eb,nb);once=!1})})}};ua=na=null;Aa=0;for(ia=P.length;Aa<ia;++Aa)if(Na(h.rules,P[Aa]),Ca=P[Aa].getAttribute('id'),!Ca||!/^gina\-toolbar/.test(Ca)){Ca&&''!=Ca||(Ca='select.'+oa.v4(),P[Aa].setAttribute('id',Ca));if(ua=
|
|
530
530
|
P[Aa].getAttribute('data-gina-form-element-group'))na=P[Aa].getAttribute('name')||Ca,na===Ca&&P[Aa].setAttribute('name',Ca),Q[Ca]={id:Ca,name:na,group:ua,target:P[Aa]};addListener(gina,P[Aa],'change',function(fa){fa=fa.target;/select/i.test(fa.type)&&Va(fa,h)});if(P[Aa].options&&!h.fieldsSet[Ca]){na=0;if(ua=P[Aa].getAttribute('data-value')||null)for(la=0,aa=P[Aa].options.length;la<aa;++la)if(P[Aa].options[la].value==ua){na=la;P[Aa].selectedIndex=na;break}'undefined'!=typeof P[Aa].options[P[Aa].selectedIndex]&&
|
|
531
|
-
P[Aa].options[P[Aa].selectedIndex].index&&(na=P[Aa].options[P[Aa].selectedIndex].index);h.fieldsSet[Ca]={id:Ca,name:P[Aa].name||null,value:P[Aa].options[na].value||ua||null,selectedIndex:na||0};'undefined'!=typeof P[Aa].selectedIndex&&(P[Aa].options[na].selected=!0,P[Aa].setAttribute('data-value',P[Aa].options[na].value))}}var qb=function(fa,X,
|
|
532
|
-
var Ra=fa.replace(/\-|_|@|#|\.|\[|\]/g,'\\$&');fa=Q[fa].target.checked;for(let Qa in Q)if(!/radio|checkbox/i.test(Q[Qa].target.type)){var ab=new RegExp(Ra);var eb=new RegExp(X);if(ab.test(Q[Qa].group)&&eb.test(Q[Qa].group)||ab.test(Q[Qa].group))Q[Qa].target.disabled=!0,'undefined'==typeof h.rules[Q[Qa].name]&&(h.rules[Q[Qa].name]={}),h.rules[Q[Qa].name].exclude=!0,qa?(Q[Qa].target.disabled=fa?!1:!0,h.rules[Q[Qa].name].exclude=fa?!1:!0):(Q[Qa].target.disabled=
|
|
533
|
-
function(fa,X,
|
|
531
|
+
P[Aa].options[P[Aa].selectedIndex].index&&(na=P[Aa].options[P[Aa].selectedIndex].index);h.fieldsSet[Ca]={id:Ca,name:P[Aa].name||null,value:P[Aa].options[na].value||ua||null,selectedIndex:na||0};'undefined'!=typeof P[Aa].selectedIndex&&(P[Aa].options[na].selected=!0,P[Aa].setAttribute('data-value',P[Aa].options[na].value))}}var qb=function(fa,X,ka,qa){'undefined'==typeof qa&&(qa=!1);if('undefined'==typeof Q[fa])throw Error('Radio & Checkbox dependencies not met: you must use the ID attribue of the `master element` as the `data-gina-form-element-group`');
|
|
532
|
+
var Ra=fa.replace(/\-|_|@|#|\.|\[|\]/g,'\\$&');fa=Q[fa].target.checked;for(let Qa in Q)if(!/radio|checkbox/i.test(Q[Qa].target.type)){var ab=new RegExp(Ra);var eb=new RegExp(X);if(ab.test(Q[Qa].group)&&eb.test(Q[Qa].group)||ab.test(Q[Qa].group))Q[Qa].target.disabled=!0,'undefined'==typeof h.rules[Q[Qa].name]&&(h.rules[Q[Qa].name]={}),h.rules[Q[Qa].name].exclude=!0,qa?(Q[Qa].target.disabled=fa?!1:!0,h.rules[Q[Qa].name].exclude=fa?!1:!0):(Q[Qa].target.disabled=ka,h.rules[Q[Qa].name].exclude=ka)}},sb=
|
|
533
|
+
function(fa,X,ka,qa){'undefined'==typeof qa&&(qa=!1);if(qa&&'undefined'!=typeof Q[X.id])return fa=/true/i.test(X.checked)?!1:!0,qb(X.id,Q[X.id].group,fa,qa);ka=X.name;u&&'undefined'==typeof fa.rules[ka]&&(fa.rules[ka]={});/^true$/i.test(X.checked)?u&&(fa.rules[ka].exclude=!1,'undefined'!=typeof Q[X.id]&&qb(X.id,Q[X.id].group,!1,qa)):u&&(fa.rules[ka].exclude=!0,'undefined'!=typeof Q[X.id]&&qb(X.id,Q[X.id].group,!0,qa))},Hb=function(fa,X){'undefined'==typeof X&&(X=!1);var ka=function(Qa,wb,jb){if(wb)sb(h,
|
|
534
534
|
Qa,wb);else for(let nb in Q)if(eb.test(Q[nb].group)||eb.test(Q[nb].target.getAttribute('data-gina-form-element-group')))Q[nb].target.disabled=jb};X&&/^(on)$/i.test(fa.value)&&!fa.checked&&(fa.value=!1);var qa=fa.getAttribute('data-value')||fa.getAttribute('value')||fa.value;qa=/^(true|on)$/.test(qa)?!0:qa;''===qa&&(qa=!1);var Ra=/^(true|on|false)$/i.test(qa)?!0:!1;X&&Ra&&(/^true$/i.test(qa)&&!fa.checked?fa.checked=!0:/^false$/i.test(qa)&&fa.checked&&(fa.checked=!1));qa=fa.checked;var ab=fa.getAttribute('data-gina-form-element-group')||
|
|
535
|
-
null,eb=new RegExp(fa.id.replace(/\-|_|@|#|\.|\[|\]/g,'\\$&'));qa&&'null'!=qa&&'false'!=qa&&''!=qa?(X?Ob(fa):(setTimeout(function(){fa.checked=!0;
|
|
536
|
-
fa.getAttribute('data-value'))&&fa.setAttribute('data-value','false')))},Ob=function(fa){fa=new RegExp(fa.id.replace(/\-|_|@|#|\.|\[|\]/g,'\\$&'));for(let X in Q)(/checkbox/i.test(Q[X].target.type)&&fa.test(Q[X].group)||/checkbox/i.test(Q[X].target.type)&&fa.test(Q[X].target.getAttribute('data-gina-form-element-group')))&&sb(h,Q[X].target,Q[X].group,!0)},zb=function(fa,X){X=fa.id.replace(/\-|_|@|#|\.|\[|\]/g,'\\$&');X=new RegExp(X);for(let
|
|
537
|
-
!0,'undefined'==typeof h.rules[Q[
|
|
538
|
-
'undefined'!=typeof X&&X?!0:!1;
|
|
539
|
-
0),Ra&&(fa.value=/^true$/.test(fa.value)?!0:!1))};Aa=0;for(ia=b.length;Aa<ia;++Aa){P=b[Aa].getAttribute('type');if('undefined'==typeof b[Aa].id||''==b[Aa].id)b[Aa].id=P+'-'+oa.v4(),b[Aa].setAttribute('id',b[Aa].id);if('undefined'!=typeof P&&/^checkbox$/i.test(P)){if(b[Aa].disabled&&-1<w.indexOf(b[Aa].id)||!b[Aa].checked&&-1<w.indexOf(b[Aa].id)){P=new RegExp(b[Aa].id.replace(/\-|_|@|#|\.|\[|\]/g,'\\$&'));for(var gb in Q)P.test(Q[gb].group)&&(Q[gb].target.disabled=!0)}
|
|
540
|
-
X){addListener(gina,fa,X,function(
|
|
541
|
-
P(b[Aa],
|
|
542
|
-
e,'reset',function(X){var
|
|
543
|
-
(cancelEvent(X),triggerEvent(gina,
|
|
544
|
-
/^focusin\./.test(qa)||(qa='focusin.'+
|
|
545
|
-
var qa=
|
|
546
|
-
X.target.getAttribute('for')||X.target.parentNode.getAttribute('for')?!0:!1,
|
|
547
|
-
|
|
548
|
-
ab):X.currentTarget.setAttribute('method',ab)));'undefined'!=typeof
|
|
549
|
-
qa&&!/^submit\./i.test(Ra))Ra='submit.'+Ra;'reset'!=
|
|
550
|
-
X.data);fa=fa.target.getAttribute('id');if('undefined'!=typeof X.isValid&&X.isValid()){var
|
|
551
|
-
|
|
535
|
+
null,eb=new RegExp(fa.id.replace(/\-|_|@|#|\.|\[|\]/g,'\\$&'));qa&&'null'!=qa&&'false'!=qa&&''!=qa?(X?Ob(fa):(setTimeout(function(){fa.checked=!0;ka(fa,ab,!1);Ob(fa)},0),fa.setAttribute('checked','checked')),Ra&&(fa.value=!0,fa.setAttribute('value',!0),typeof('undefined'!=fa.getAttribute('data-value'))&&fa.setAttribute('data-value',!0))):(X?Ob(fa):setTimeout(function(){fa.checked=!1;ka(fa,ab,!0);Ob(fa)},0),fa.removeAttribute('checked'),Ra&&(fa.value=!1,fa.setAttribute('value','false'),typeof('undefined'!=
|
|
536
|
+
fa.getAttribute('data-value'))&&fa.setAttribute('data-value','false')))},Ob=function(fa){fa=new RegExp(fa.id.replace(/\-|_|@|#|\.|\[|\]/g,'\\$&'));for(let X in Q)(/checkbox/i.test(Q[X].target.type)&&fa.test(Q[X].group)||/checkbox/i.test(Q[X].target.type)&&fa.test(Q[X].target.getAttribute('data-gina-form-element-group')))&&sb(h,Q[X].target,Q[X].group,!0)},zb=function(fa,X){X=fa.id.replace(/\-|_|@|#|\.|\[|\]/g,'\\$&');X=new RegExp(X);for(let ka in Q)if(/checkbox|radio/i.test(Q[ka].target.type)||(Q[ka].target.disabled=
|
|
537
|
+
!0,'undefined'==typeof h.rules[Q[ka].name]&&(h.rules[Q[ka].name]={}),h.rules[Q[ka].name].exclude=!0),X.test(Q[ka].group)||X.test(Q[ka].target.getAttribute('data-gina-form-element-group').replace(/\-|_|@|#|\.|\[|\]/g,'\\$&')))Q[ka].target.disabled=!0,'undefined'==typeof h.rules[Q[ka].name]&&(h.rules[Q[ka].name]={}),/^(true|on)$/i.test(fa.checked)?(Q[ka].target.disabled=!1,h.rules[Q[ka].name].exclude=!1):(Q[ka].target.disabled=!0,h.rules[Q[ka].name].exclude=!0);Ob(fa)},Vb=null,Za=function(fa,X,ka){X=
|
|
538
|
+
'undefined'!=typeof X&&X?!0:!1;ka='undefined'!=typeof ka&&ka?!0:!1;var qa=fa.checked,Ra=/^(true|false)$/i.test(fa.value);Vb=document.getElementsByName(fa.name);for(let ab=0,eb=Vb.length;ab<eb;++ab)Vb[ab].id!==fa.id&&qa&&(Vb[ab].checked=!1,Vb[ab].removeAttribute('checked'),zb(Vb[ab],!0));X?zb(fa):(qa&&'null'!=qa&&'false'!=qa&&''!=qa?setTimeout(function(){ka?zb(fa):(fa.checked=!1,fa.removeAttribute('checked'))},0):setTimeout(function(){ka?zb(fa):(fa.checked=!0,fa.setAttribute('checked','checked'))},
|
|
539
|
+
0),Ra&&(fa.value=/^true$/.test(fa.value)?!0:!1))};Aa=0;for(ia=b.length;Aa<ia;++Aa){P=b[Aa].getAttribute('type');if('undefined'==typeof b[Aa].id||''==b[Aa].id)b[Aa].id=P+'-'+oa.v4(),b[Aa].setAttribute('id',b[Aa].id);if('undefined'!=typeof P&&/^checkbox$/i.test(P)){if(b[Aa].disabled&&-1<w.indexOf(b[Aa].id)||!b[Aa].checked&&-1<w.indexOf(b[Aa].id)){P=new RegExp(b[Aa].id.replace(/\-|_|@|#|\.|\[|\]/g,'\\$&'));for(var gb in Q)P.test(Q[gb].group)&&(Q[gb].target.disabled=!0)}V='change.'+b[Aa].id;P=function(fa,
|
|
540
|
+
X){addListener(gina,fa,X,function(ka){Hb(ka.target);triggerEvent(gina,ka.target,'changed.'+ka.target.id)});Hb(fa,!0)};'undefined'!=typeof gina.events[V]&&gina.events[V]==b[Aa].id&&removeListener(gina,b[Aa],V);P(b[Aa],V)}else'undefined'!=typeof P&&/^radio$/i.test(P)&&(V=b[Aa].id,P=function(fa,X){addListener(gina,fa,X,function(ka){Za(ka.target);triggerEvent(gina,ka.target,'changed.'+ka.target.id)});Za(fa,!0)},'undefined'!=typeof gina.events[V]&&gina.events[V]==b[Aa].id&&removeListener(gina,b[Aa],V),
|
|
541
|
+
P(b[Aa],V))}V='click';P=function(){var fa=null;fa='reset.'+e.id;'undefined'==typeof gina.events[fa]&&addListener(gina,e,fa,function(X){X.preventDefault();var ka=q.$forms[X.currentTarget.id||X.target.id];ka.target.dataset.ginaFormIsResetting=!0;R(ka);X=Pb(ka.target,ka.rules,!0);M(ka.target,X.fields,X.$fields,ka.rules,function(qa){var Ra=qa.isValid();console.debug('silent reset validation result[isValid:'+Ra+']: ',qa);E(ka.target,{});Eb(ka.target,Ra);ka.target.dataset.ginaFormIsResetting=!1})});addListener(gina,
|
|
542
|
+
e,'reset',function(X){var ka=X.target;if('undefined'!=typeof X.defaultPrevented&&X.defaultPrevented)return!1;X.preventDefault();var qa=ka.id;if(!qa)return!1;/^reset\./.test(qa)||(qa='reset.'+ka.id);gina.events[qa]&&triggerEvent(gina,ka,qa,X.detail)});addListener(gina,e,'keydown',function(X){var ka=X.target;if('undefined'!=typeof X.defaultPrevented&&X.defaultPrevented)return!1;N[X.keyCode]='keydown'==X.type;var qa=ka.id;if(!qa)return!1;/^keydown\./.test(qa)||(qa='keydown.'+ka.id);gina.events[qa]&&
|
|
543
|
+
(cancelEvent(X),triggerEvent(gina,ka,qa,X.detail,X))});addListener(gina,e,'keyup',function(X){var ka=X.target;if('undefined'!=typeof X.defaultPrevented&&X.defaultPrevented)return!1;N[X.keyCode]&&delete N[X.keyCode];var qa=ka.id;if(!qa)return!1;/^keyup\./.test(qa)||(qa='keyup.'+ka.id);gina.events[qa]&&(cancelEvent(X),triggerEvent(gina,ka,qa,X.detail,X))});addListener(gina,e,'focusin',function(X){var ka=X.target;if('undefined'!=typeof X.defaultPrevented&&X.defaultPrevented)return!1;var qa=ka.id;if(!qa)return!1;
|
|
544
|
+
/^focusin\./.test(qa)||(qa='focusin.'+ka.id);gina.events[qa]&&(cancelEvent(X),triggerEvent(gina,ka,qa,X.detail))});addListener(gina,e,'focusout',function(X){var ka=X.target;if('undefined'!=typeof X.defaultPrevented&&X.defaultPrevented)return!1;var qa=ka.id;if(!qa)return!1;/^focusout\./.test(qa)||(qa='focusout.'+ka.id);gina.events[qa]&&(cancelEvent(X),triggerEvent(gina,ka,qa,X.detail))});addListener(gina,e,'change',function(X){var ka=X.target;if('undefined'!=typeof X.defaultPrevented&&X.defaultPrevented)return!1;
|
|
545
|
+
var qa=ka.id;if(!qa)return!1;/^change\./.test(qa)||(qa='change.'+ka.id);gina.events[qa]&&(cancelEvent(X),triggerEvent(gina,ka,qa,X.detail))});addListener(gina,e,'click',function(X){var ka=X.target,qa=!1,Ra=!1;if(/(label)/i.test(X.target.tagName)&&'undefined'!=typeof X.target.control&&null!=X.target.control&&/(checkbox|radio)/i.test(X.target.control.type)||/(label)/i.test(X.target.parentNode.tagName)&&'undefined'!=typeof X.target.parentNode.control&&null!=X.target.parentNode.control&&/(checkbox|radio)/i.test(X.target.parentNode.control.type))Ra=
|
|
546
|
+
X.target.getAttribute('for')||X.target.parentNode.getAttribute('for')?!0:!1,ka=X.target.control||X.target.parentNode.control;if(!ka.disabled&&/(checkbox|radio)/i.test(ka.type)&&!Ra){if(/checkbox/i.test(ka.type))return Hb(ka);if(/radio/i.test(ka.type))return Za(ka,!1,!0)}if(/(button|input)/i.test(ka.tagName)&&/(submit|checkbox|radio)/i.test(ka.type)||/a/i.test(ka.tagName)&&ka.attributes.getNamedItem('data-gina-form-submit')||/a/i.test(ka.parentNode.tagName)&&ka.parentNode.attributes.getNamedItem('data-gina-form-submit')){Ra=
|
|
547
|
+
ka.attributes.getNamedItem('data-gina-form-submit');var ab=ka.parentNode.attributes.getNamedItem('data-gina-form-submit');if(Ra||ab)qa=!0,(ab=Ra?ka.getAttribute('data-gina-form-submit-method')||X.currentTarget.getAttribute('method'):ka.parentNode.getAttribute('data-gina-form-submit-method')||X.currentTarget.getAttribute('method'))&&(Ra&&ka.form?ka.form.setAttribute?ka.form.setAttribute('method',ab):X.currentTarget.setAttribute('method',ab):ka.parentNode.form&&(ka.form.setAttribute?ka.parentNode.form.setAttribute('method',
|
|
548
|
+
ab):X.currentTarget.setAttribute('method',ab)));'undefined'!=typeof ka.id&&ka.getAttribute('id')||ka.setAttribute('id','click.'+oa.v4());ka.id=ka.getAttribute('id');if(/^click\./.test(ka.id)||u){Ra=ka.id;if(!Ra)return!1;/^click\./.test(Ra)||(Ra=ka.id);if(!ka.disabled&&/(checkbox|radio)/i.test(ka.type)){if(/checkbox/i.test(ka.type))return Hb(ka);if(/radio/i.test(ka.type))return Za(ka,!1,!0)}if('undefined'!=typeof X.defaultPrevented&&X.defaultPrevented)return!1;if('submit'==ka.type&&!/^submit\./i.test(Ra)||
|
|
549
|
+
qa&&!/^submit\./i.test(Ra))Ra='submit.'+Ra;'reset'!=ka.type||/^reset\./i.test(Ra)||(Ra='reset.'+Ra);gina.events[Ra]?(cancelEvent(X),triggerEvent(gina,ka,Ra,X.detail)):qa&&'undefined'!=typeof this.id&&''!=this.id&&'undefined'!=typeof gina.validator.$forms[this.id]&&(gina.validator.getFormById(this.id).submit(),cancelEvent(X))}}})};P();V='validate.'+p;P=function(){addListener(gina,e,V,function(fa){cancelEvent(fa);var X=h.eventData.error||h.eventData.validation||fa.detail;E(fa.target,X.fields||X.error,
|
|
550
|
+
X.data);fa=fa.target.getAttribute('id');if('undefined'!=typeof X.isValid&&X.isValid()){var ka=q.$forms[fa].target.getAttribute('data-gina-form-inherits-data')||null;ka&&(X.data=Y(X.data,JSON.parse(decodeURIComponent(ka))));q.$forms[fa]?q.$forms[fa].send(X.data):h&&h.send(X.data)}})};'undefined'!=typeof gina.events[V]&&gina.events[V]=='validate.'+p&&removeListener(gina,h,V,P);P();gb=function(fa,X){/^submit\./i.test(fa)||(fa='submit.'+fa);addListener(gina,X,fa,function(ka){cancelEvent(ka);var qa={};
|
|
551
|
+
ka={_length:0};var Ra=e.getAttribute('id'),ab='undefined'!=typeof q.$forms[Ra]?q.$forms[Ra].rules:null;q.$forms[Ra].sent||(qa=Pb(e,ab),ka=qa.fields,qa=qa.$fields,ab=q.$forms[Ra].rules,0==ka._length?(delete ka._length,ka={error:[],isValid:function(){return!0},data:Ka(ka)},triggerEvent(gina,e,'validate.'+p,ka)):(p=e.getAttribute('id'),A=(ab=e.getAttribute('data-gina-form-rule'))?Fa(ab.replace(/\-|\//g,'.')):Fa(p.replace(/\-/g,'.')),q.$forms[Ra].isSubmitting=!0,q.$forms[Ra].isSending=!1,M(e,ka,qa,A,
|
|
552
552
|
function(eb){triggerEvent(gina,e,'validate.'+p,eb)})))})};w=null;b=[];w=[];P=null;w=e.getElementsByTagName('button');if(0<w.length)for(let fa=0,X=w.length;fa<X;++fa)'submit'==w[fa].type&&b.push(w[fa]);w=e.getElementsByTagName('a');if(0<w.length)for(let fa=0,X=w.length;fa<X;++fa)w[fa].attributes.getNamedItem('data-gina-form-submit')?b.push(w[fa]):w[fa].getAttribute('id')||/gina\-popin/.test(w[fa].className)||gina.popinIsBinded||/gina\-link/.test(w[fa].className)||(P='link.'+oa.v4(),w[fa].id=P);P=null;
|
|
553
553
|
Aa=!1;for(let fa=0,X=b.length;fa<X;++fa){w=b[fa];if(/button/i.test(w.tagName)&&'undefined'!=typeof w.type&&/submit/i.test(w.type)||/a/i.test(w.tagName)&&'undefined'!=typeof w.dataset.ginaFormSubmit&&/^true$/i.test(w.dataset.ginaFormSubmit)||/a/i.test(w.parentNode.tagName)&&'undefined'!=typeof w.parentNode.dataset.ginaFormSubmit&&/^true$/i.test(w.parentNode.dataset.ginaFormSubmit)){/a/i.test(w.parentNode.tagName)&&(w=w.parentNode);if('undefined'==typeof w.id||'undefined'!=typeof w.id&&''==w.id)w.id=
|
|
554
554
|
'click.'+oa.v4(),w.setAttribute('id',w.id);/a/i.test(w.tagName)&&'undefined'==typeof w.form&&(w.form={id:h.id});'undefined'==typeof w.dataset.ginaFormSubmitTriggerFor&&'undefined'!=typeof q.$forms[h.id]&&'undefined'==typeof q.$forms[h.id].submitTrigger&&'undefined'!=typeof w.form.id&&h.id==w.form.id&&(console.debug('attching submitTrigger: '+w.id,' form id: '+h.id),q.$forms[h.id].submitTrigger=h.submitTrigger=w.id||w.getAttribute('id'),w.dataset.ginaFormSubmitTriggerFor=h.id)}'A'==w.tagName&&(P=
|
|
555
|
-
w.getAttribute('onclick'),Aa=w.getAttribute('data-gina-form-submit'),P||Aa?/return false/i.test(P)||Aa||(P=/;$/.test(P)?P+'return false;':P+'; return false;'):w.setAttribute('onclick','return false;'));w.id?
|
|
556
|
-
qa.disabled&&cancelEvent(fa);if('undefined'!=typeof fa.defaultPrevented&&fa.defaultPrevented)return!1;(u||Ra)&&cancelEvent(fa);fa={};Ra={_length:0};qa='undefined'!=typeof gina.validator.$forms[
|
|
555
|
+
w.getAttribute('onclick'),Aa=w.getAttribute('data-gina-form-submit'),P||Aa?/return false/i.test(P)||Aa||(P=/;$/.test(P)?P+'return false;':P+'; return false;'):w.setAttribute('onclick','return false;'));w.id?V=w.id:(V='click.'+oa.v4(),w.id=V,w.setAttribute('id',V));'undefined'!=typeof gina.events[V]&&gina.events[V]==w.id||gb(V,w)}V='submit';addListener(gina,e,V,function(fa){var X=fa.target,ka=X.getAttribute('id'),qa=q.$forms[ka],Ra=h.binded;(qa=(new DOMParser).parseFromString(X.innerHTML,'text/html').getElementById(qa.submitTrigger))&&
|
|
556
|
+
qa.disabled&&cancelEvent(fa);if('undefined'!=typeof fa.defaultPrevented&&fa.defaultPrevented)return!1;(u||Ra)&&cancelEvent(fa);fa={};Ra={_length:0};qa='undefined'!=typeof gina.validator.$forms[ka]?gina.validator.$forms[ka].rules:null;for(var ab=null,eb=null,Qa=0,wb=X.length;Qa<wb;++Qa)ab=X[Qa].getAttribute('name'),eb=X[Qa].disabled||X[Qa].getAttribute('disabled'),eb=/disabled|true/i.test(eb)?!0:!1,ab&&!eb&&('undefined'!=typeof X[Qa].type&&'radio'==X[Qa].type||'undefined'!=typeof X[Qa].type&&'checkbox'==
|
|
557
557
|
X[Qa].type?X[Qa].checked?/^(true|false)$/.test(X[Qa].value)?Ra[ab]=X[Qa].value=/^true$/.test(X[Qa].value)?!0:!1:Ra[ab]=X[Qa].value:qa&&'undefined'!=typeof qa[ab]&&'undefined'!=typeof qa[ab].isBoolean&&'checkbox'==X[Qa].type&&!/^(true|false)$/.test(X[Qa].value)&&(Ra[ab]=!1):Ra[ab]=X[Qa].value,fa[ab]=X[Qa],fa[ab].setAttribute('data-gina-form-errors',''));Ra._length=Ra.count();0==Ra._length?(delete Ra._length,fa={error:[],isValid:function(){return!0},data:Ka(Ra)},'undefined'!=typeof gina.events['submit.'+
|
|
558
|
-
|
|
558
|
+
ka]?triggerEvent(gina,X,'submit.'+ka,fa):triggerEvent(gina,X,'validate.'+ka,fa)):(A=(qa=X.getAttribute('data-gina-form-rule'))?Fa(qa.replace(/\-|\//g,'.')):Fa(ka.replace(/\-/g,'.')),q.$forms[ka].isValidating=!0,M(X,Ra,fa,A,function(jb){q.$forms[ka].isValidating=!1;'undefined'!=typeof gina.events['submit.'+ka]?triggerEvent(gina,X,'submit.'+ka,jb):triggerEvent(gina,X,'validate.'+ka,jb)}))});q.$forms[p].binded=!0;/^(true)$/i.test(h.target.dataset.ginaFormLiveCheckEnabled&&0<h.rules.count())?(console.debug('silent validation mode on'),
|
|
559
559
|
gb=Pb(h.target,h.rules),M(h.target,gb.fields,gb.$fields,h.rules,function(fa){console.debug('silent validation result[isValid:'+fa.isValid()+']: ',fa);T&&K&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&(gina.forms.errors||(gina.forms.errors={}),window.ginaToolbar.update('forms',{id:p,errors:fa.error}));Eb(h,fa.isValid())})):/^(true)$/i.test(h.target.dataset.ginaFormLiveCheckEnabled)||Eb(h,!0)},Eb=function(e,b){$formInstance=null;e instanceof HTMLFormElement?(e=e.getAttribute('id'),$formInstance=
|
|
560
560
|
q.$forms[e]):$formInstance=e;'undefined'==typeof $formInstance.submitTrigger?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``'):document.getElementById($formInstance.submitTrigger)&&
|
|
561
|
-
(/true/i.test(b)?document.getElementById($formInstance.submitTrigger).disabled=!1:document.getElementById($formInstance.submitTrigger).disabled=!0)},Pb=function(e,b,h){'undefined'==typeof h&&(h=!1);var p={},x={},u=e.id||e.getAttribute('id');'undefined'==typeof b&&(b='undefined'!=typeof q.$forms[u].rules&&0<q.$forms[u].rules.count()?q.$forms[u].rules:null,b||'undefined'==typeof gina.validator.$forms[u]||(b=gina.validator.$forms[u].rules));for(var A=0,
|
|
561
|
+
(/true/i.test(b)?document.getElementById($formInstance.submitTrigger).disabled=!1:document.getElementById($formInstance.submitTrigger).disabled=!0)},Pb=function(e,b,h){'undefined'==typeof h&&(h=!1);var p={},x={},u=e.id||e.getAttribute('id');'undefined'==typeof b&&(b='undefined'!=typeof q.$forms[u].rules&&0<q.$forms[u].rules.count()?q.$forms[u].rules:null,b||'undefined'==typeof gina.validator.$forms[u]||(b=gina.validator.$forms[u].rules));for(var A=0,V=e.length;A<V;++A){if(h)switch(e[A].tagName.toLowerCase()){case 'input':/^(hidden|text)$/i.test(e[A].type)&&
|
|
562
562
|
(e[A].value=e[A].defaultValue)}if(/button/i.test(e[A].tagName)&&'undefined'!=typeof e[A].type&&/submit/i.test(e[A].type)||/a/i.test(e[A].tagName)&&'undefined'!=typeof e[A].dataset.ginaFormSubmit&&/^true$/i.test(e[A].dataset.ginaFormSubmit))/a/i.test(e[A].tagName)&&'undefined'==typeof e[A].form&&(e[A].form={id:u}),'undefined'==typeof e[A].dataset.ginaFormSubmitTriggerFor&&'undefined'!=typeof q.$forms[u]&&'undefined'==typeof q.$forms[u].submitTrigger&&'undefined'!=typeof e[A].form.id&&u==e[A].form.id&&
|
|
563
563
|
(q.$forms[u].submitTrigger=e[A].id||e[A].getAttribute('id'),e[A].dataset.ginaFormSubmitTriggerFor=u);var P=e[A].getAttribute('name');var aa=e[A].disabled||e[A].getAttribute('disabled');aa=/disabled|true/i.test(aa)?!0:!1;if(P&&!aa){if('undefined'!=typeof e[A].type&&'radio'==e[A].type||'undefined'!=typeof e[A].type&&'checkbox'==e[A].type)if(e[A].checked||'undefined'==typeof b[P]&&'undefined'!=e[A].value&&/^(true|false)$/.test(e[A].value)||!e[A].checked&&'undefined'!=typeof b[P]&&'undefined'!=typeof b[P].isBoolean&&
|
|
564
564
|
/^(true|false)$/.test(e[A].value))if(/^(true|false)$/.test(e[A].value))if('undefined'==typeof b[P]?b[P]={isBoolean:!0}:'undefined'!=typeof b[P]&&'undefined'==typeof b[P].isBoolean&&(b[P].isBoolean=!0,b[P].isRequired=!0),'radio'==e[A].type){if('undefined'==typeof b[P])throw Error('rule '+P+' is not defined');/^true$/.test(b[P].isBoolean)&&e[A].checked&&(x[P]=/^true$/.test(e[A].value)?!0:!1)}else x[P]=e[A].value=/^true$/.test(e[A].value)?!0:!1;else x[P]=e[A].value;else b&&'undefined'!=typeof b[P]&&
|
|
565
565
|
'undefined'!=typeof b[P].isBoolean&&'undefined'!=typeof b[P].isRequired&&!/^(true|false)$/.test(e[A].value)&&(x[P]=!1);else x[P]=e[A].value;'undefined'==typeof p[P]&&(p[P]=e[A],p[P].setAttribute('data-gina-form-errors',''))}}x._length=x.count()||0;return{$fields:p,fields:x,rules:b}},xa=function(e,b,h,p){return'undefined'==typeof e[h]||/^(null|NaN|undefined|\s*)$/i.test(b[h])?b[h]:'undefined'!=typeof e[h].isNumber||'undefined'!=typeof e[h].isInteger||'undefined'!=typeof e[h].isFloat||'undefined'!=
|
|
566
566
|
typeof e[h].toFloat||'undefined'!=typeof e[h].toInteger?(/,/.test(b[h])&&(b[h]=b[h].replace(/,/g,'.').replace(/\s+/g,'')),b[h]):'boolean'==typeof b[h]?b[h]:e[h].isBoolean?/^true$/i.test(b[h])?!0:!1:'undefined'!=typeof p&&/^true$/i.test(p)?'\\"'+b[h]+'\\"':b[h]},ya=function(e,b){'string'!=typeof e&&(e=JSON.stringify(JSON.clone(e)));e=JSON.parse(e.replace(/"(true|false)"/gi,'$1'));for(let h in b)b[h]=xa(e,b,h);return b},Ja=function(e,b,h,p){var x=JSON.parse(e.replace(/"(true|false)"/gi,'$1')),u=JSON.stringify(x);
|
|
567
|
-
p&&(b=h[Object.getOwnPropertyNames(h)[0]].form,h=Pb(b,x),delete h.fields._length,b=h.fields,h=h.$fields);p=[];var A=0;for(
|
|
568
|
-
e=e.replace(
|
|
569
|
-
var u=JSON.stringify(p);b=ya(u,b);/\$(.*)/.test(u)&&(p=!/^form$/i.test(e.tagName)&&1==h.count()&&/true/i.test(e.form.dataset.ginaFormLiveCheckEnabled)?!0:!1,p=Ja(u,b,h,p));var A=null,
|
|
570
|
-
la=new RegExp(la,Ca),la.test(Za))){skipTest=!0;gb[Za]=gb[X];break}if('undefined'==typeof gb[Za])return}var
|
|
567
|
+
p&&(b=h[Object.getOwnPropertyNames(h)[0]].form,h=Pb(b,x),delete h.fields._length,b=h.fields,h=h.$fields);p=[];var A=0;for(V in b)p[A]=V,A++;p.sort().reverse();for(let aa=0,Q=p.length;aa<Q;aa++){var V=p[aa].replace(/\-|_|@|#|\.|\[|\]/g,'\\$&');V=new RegExp('\\$'+V,'g');A='\\"'+b[p[aa]]+'\\"';var P=V.test(u);P&&'undefined'!=typeof x[p[aa]]?A=xa(x,b,p[aa],!0):P&&console.warn('`'+p[aa]+'` is used in a dynamic rule without definition. This could lead to an evaluation error. Casting `'+p[aa]+'` to `string`.');
|
|
568
|
+
e=e.replace(V,A)}if(/\$(.*)/.test(e))for(let aa=0,Q=p.length;aa<Q;aa++)V=p[aa].replace(/\-|_|@|#|\.|\[|\]/g,'\\$&'),V=new RegExp('\\$'+V,'g'),A=''!=h[p[aa]].value?'\\"'+h[p[aa]].value+'\\"':'\\"\\"',(P=V.test(u))&&'undefined'!=typeof x[p[aa]]?A=xa(x,b,p[aa],!0):P&&console.warn('`'+p[aa]+'` is used in a dynamic rule without definition. This could lead to an evaluation error. Casting `'+p[aa]+'` to `string`.'),e=e.replace(V,A||h[p[aa]].checked);return JSON.parse(e)},M=function(e,b,h,p,x){delete b._length;
|
|
569
|
+
var u=JSON.stringify(p);b=ya(u,b);/\$(.*)/.test(u)&&(p=!/^form$/i.test(e.tagName)&&1==h.count()&&/true/i.test(e.form.dataset.ginaFormLiveCheckEnabled)?!0:!1,p=Ja(u,b,h,p));var A=null,V=u=null,P=!1,aa=0;b.count();var Q=!1,w=null,ia=null,ua=null,na=0,la=null,Ca=null,Aa=null,Sa=function(Za,gb,fa){if('undefined'==typeof gb[Za]){skipTest=!1;for(var X in gb)if(!/^_comment$/i.test(X)&&/^\//.test(X)&&(la=X.match(/\/(.*)\//).pop(),Ca=X.replace('/'+la+'/',''),la=la.replace(/\[/g,'\\[').replace(/\]/g,'\\]'),
|
|
570
|
+
la=new RegExp(la,Ca),la.test(Za))){skipTest=!0;gb[Za]=gb[X];break}if('undefined'==typeof gb[Za])return}var ka=Object.getOwnPropertyNames(gb)||[];X=0;var qa=ka.length;if(0<qa)for(;X<qa;)'undefined'!=typeof gb[ka[X]].exclude&&/^true$/i.test(gb[ka[X]].exclude)&&(ka.splice(X,1),qa--,X--),X++;for(var Ra in gb[Za])if('function'==typeof Va[Za][Ra]){/^((is)\d+|is$)/.test(Ra)&&'undefined'==typeof Va[Za][Ra]&&(Va[Za][Ra]=function(){},Va[Za][Ra]=U(Va[Za][Ra],Va[Za][Ra.replace(/\d+/,'')]),Va[Za][Ra].setAlias=
|
|
571
571
|
function(jb){this._currentValidatorAlias=jb}(Ra));try{if(Array.isArray(gb[Za][Ra])){Aa=JSON.clone(gb[Za][Ra]);if(/\$[\-\w\[\]]*/.test(Aa[0])){var ab=Aa[0].match(/\$[\-\w\[\]]*/g);X=0;for(var eb=ab.length;X<eb;++X)Aa[0]=Aa[0].replace(ab[X],Va[ab[X].replace('$','')].value)}Va[Za][Ra].apply(Va[Za],Aa)}else if(/^query$/.test(Ra)){w=h[Za];ia=w.getAttribute('id');ua='asyncCompleted.'+ia;var Qa=0,wb=!1;if('undefined'!=typeof gina.events[ua]){console.debug('event `'+ua+'` already added');na=0;break}++na;
|
|
572
572
|
addListener(gina,w,ua,function(jb){jb.preventDefault();Qa++;--na;var nb=Object.getOwnPropertyNames(gb[Za]);nb[nb.length-1]==Ra&&(Q=!0);nb='asyncCompleted.'+jb.target.getAttribute('id');if(!/true/.test(wb)){Va[Za]=jb.detail;var ob=e;/^form$/i.test(e.tagName)||(ob=e.form);var rb=ob.getAttribute('id');if(Q&&0>=na&&!wb&&(wb=!0,removeListener(gina,jb.target,nb),x._data=Va.toData(),x._errors=Va.getErrors(Za),x._errors&&0<x._errors.count())){'undefined'==typeof q.$forms[rb].errors&&(q.$forms[rb].errors=
|
|
573
|
-
{});q.$forms[rb].errors[Za]=x._errors[Za];if(!lb&&/^true|false$/i.test(q.$forms[rb].isValidating)||''!=Va[Za].target.value)r(Ob[Za]),E(ob,x._errors,x._data,Za),Eb(ob,lb);T&&K&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&(gina.forms.errors||(gina.forms.errors={}),window.ginaToolbar.update('forms',{id:rb,errors:q.$forms[rb].errors||{}}));triggerEvent(gina,ob,'validated.'+rb,x);return}jb=!1;var lb=null;1==
|
|
574
|
-
(q.$forms[rb].errors=Y(x._errors,q.$forms[rb].errors),r(Ob[Za]),E(ob,x._errors,x._data,Za),Eb(ob,lb)),triggerEvent(gina,ob,'validated.'+rb,x)):/^true$/i.test(q.$forms[rb].isValidating)&&1<
|
|
573
|
+
{});q.$forms[rb].errors[Za]=x._errors[Za];if(!lb&&/^true|false$/i.test(q.$forms[rb].isValidating)||''!=Va[Za].target.value)r(Ob[Za]),E(ob,x._errors,x._data,Za),Eb(ob,lb);T&&K&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&(gina.forms.errors||(gina.forms.errors={}),window.ginaToolbar.update('forms',{id:rb,errors:q.$forms[rb].errors||{}}));triggerEvent(gina,ob,'validated.'+rb,x);return}jb=!1;var lb=null;1==ka.length||ka[ka.length-1]==Za?(lb=0<x._errors.count()?!1:!0,!lb&&/^true|false$/i.test(q.$forms[rb].isValidating)&&
|
|
574
|
+
(q.$forms[rb].errors=Y(x._errors,q.$forms[rb].errors),r(Ob[Za]),E(ob,x._errors,x._data,Za),Eb(ob,lb)),triggerEvent(gina,ob,'validated.'+rb,x)):/^true$/i.test(q.$forms[rb].isValidating)&&1<ka.length&&ka[ka.length-1]!=Za&&(jb=!0);jb&&M(ob,Hb,Ob,gb,function(Nb){q.$forms[rb].isValidating=!1;lb=Nb.isValid();T&&K&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&(gina.forms.errors||(gina.forms.errors={}),window.ginaToolbar.update('forms',{id:rb,errors:Nb.error||{}}));E(ob,Nb.error,Nb.data,Za);
|
|
575
575
|
Eb(ob,lb)})}});Va[Za][Ra](gb[Za][Ra]);continue}else Va[Za][Ra](gb[Za][Ra]);delete fa[Za]}catch(jb){if('conditions'==Ra)throw Error('[ ginaFormValidator ] could not evaluate `'+Za+'->'+Ra+'()` where `conditions` must be a `collection` (Array)\nStack:\n'+jb);throw Error('[ ginaFormValidator ] could not evaluate `'+Za+'->'+Ra+'()`\nStack:\n'+jb);}}},Va=null,qb={},sb=!1;K?/^form$/i.test(e.tagName)?(A=e.getAttribute('id'),u='validated.'+A,q.$forms[A].fields=b,'undefined'!=typeof e.eventData&&'undefined'!=
|
|
576
576
|
typeof e.eventData.error&&delete e.eventData.error,Va=new n(b,h,B)):(sb=!0,A=e.form.getAttribute('id')||e.form.target.getAttribute('id'),u='validated.'+A,q.$forms[A].fields=b,Va=new n(b,h,B,q.$forms[A].fieldsSet)):Va=new n(b,null,B);var Hb=null,Ob=null;if(sb){sb=e.form.getAttribute('id');var zb=Pb(q.$forms[sb].target,q.$forms[sb].rules,!1);Hb=ya(JSON.stringify(q.$forms[sb].rules),JSON.clone(zb.fields));Ob=zb.$fields}else Hb=JSON.clone(b),Ob=h;sb='undefined'!=typeof p?JSON.clone(p):{};var Vb=function(Za,
|
|
577
|
-
gb,fa,X,
|
|
578
|
-
typeof qa['_case_'+Qa]?!0:!1;if(K&&'input'==
|
|
577
|
+
gb,fa,X,ka,qa,Ra,ab){var eb=null;if('undefined'!=typeof qa)for(var Qa in X)if(K&&'undefined'==typeof ka[Qa])console.warn('field `'+Qa+'` found for your form rule ('+Za.id+'), but not found in $field collection.\nPlease, check your HTML or remove `'+Qa+'` declaration from your rule if this is a mistake.');else{K&&ka[Qa].getAttribute('data-gina-form-element-group')&&'undefined'!=typeof qa[Qa]&&'undefined'!=typeof qa[Qa].exclude&&qa[Qa].exclude&&!ka[Qa].disabled&&(qa[Qa].exclude=!1);var wb='undefined'!=
|
|
578
|
+
typeof qa['_case_'+Qa]?!0:!1;if(K&&'input'==ka[Qa].tagName.toLowerCase()&&/(checkbox)/i.test(ka[Qa].getAttribute('type')))if(!ka[Qa].checked&&'undefined'!=typeof qa[Qa]&&'undefined'!=typeof qa[Qa].isRequired&&/^(false)$/i.test(qa[Qa].isRequired)||ka[Qa].disabled)qa[Qa]={exclude:!0};else if(!ka[Qa].checked&&'undefined'==typeof qa[Qa])continue;for(var jb in qa)if(/^_case_/.test(jb)&&'undefined'!=typeof qa[jb].conditions&&(!Array.isArray(qa[jb].conditions)||qa[jb].conditions.length)&&'undefined'!=typeof qa[jb].conditions[0].rules&&
|
|
579
579
|
'undefined'!=typeof qa[jb].conditions&&Array.isArray(qa[jb].conditions))if(eb=jb.replace('_case_',''),'undefined'==typeof Ob[eb])console.warn('Found case `'+jb+'` but field `'+eb+'` is misssing in the dom.\n You should add `'+eb+'` element to your form in order to allow Validator to process this case.');else{'undefined'==typeof gb[eb]&&(gb[eb]=Ob[eb].value);var nb=gb[eb];K&&('true'==X[Qa]?nb=!0:'false'==X[Qa]&&(nb=!1));for(var ob=0,rb=qa[jb].conditions.length;ob<rb;++ob)if(qa[jb].conditions[ob].case==
|
|
580
|
-
nb)for(var lb in qa[jb].conditions[ob].rules)if(!/^_comment$/i.test(lb)&&lb!=eb&&
|
|
581
|
-
Y(qa[jb].conditions[ob].rules[lb],Nb);eb!=lb&&'undefined'!=typeof qa[lb]&&Sa(lb,qa,X)}}else'undefined'!=typeof qa[jb].conditions[ob].rules[lb]&&(caseField=lb,nb=X[caseField],'undefined'==typeof
|
|
580
|
+
nb)for(var lb in qa[jb].conditions[ob].rules)if(!/^_comment$/i.test(lb)&&lb!=eb&&ka[lb])if(Qa==lb||/^\//.test(lb)||'undefined'!=typeof X[lb]||'undefined'==typeof gb[lb])if(/^\//.test(lb)){if(la=lb.match(/\/(.*)\//).pop(),Ca=lb.replace('/'+la+'/',''),la=la.replace(/\[/g,'\\[').replace(/\]/g,'\\]'),la=new RegExp(la,Ca),la.test(Qa)){if(qa[jb].conditions[ob].case==nb||/^\//.test(qa[jb].conditions[ob].case)&&(new RegExp(qa[jb].conditions[ob].case)).test(nb))Nb='undefined'!=typeof qa[lb]?qa[lb]:{},qa[lb]=
|
|
581
|
+
Y(qa[jb].conditions[ob].rules[lb],Nb);eb!=lb&&'undefined'!=typeof qa[lb]&&Sa(lb,qa,X)}}else'undefined'!=typeof qa[jb].conditions[ob].rules[lb]&&(caseField=lb,nb=X[caseField],'undefined'==typeof ka[caseField]?console.warn('ignoring case `'+caseField+'`: field `NaN'):(K&&/^(true|false)$/i.test(nb)&&'undefined'!=typeof qa[caseField]&&'undefined'!=typeof qa[caseField].isBoolean&&/^(true)$/i.test(qa[caseField].isBoolean)&&(nb=/^(true)$/i.test(nb)?!0:!1),'undefined'!=typeof qa[jb].conditions[ob].rules[lb]&&
|
|
582
582
|
(Nb='undefined'!=typeof qa[jb].conditions[ob].rules[lb]?qa[jb].conditions[ob].rules[lb]:{},qa[lb]=Nb),eb!=lb&&'undefined'!=typeof qa[lb]&&'undefined'!=typeof X[lb]&&Sa(lb,qa,X)));else{X[lb]=gb[lb];var Nb='undefined'!=typeof qa[lb]?qa[lb]:{};qa[lb]=Y(qa[jb].conditions[ob].rules[lb],Nb);Sa(lb,qa,X)}}if(eb!=Qa&&('undefined'!=typeof qa[Qa]&&Sa(Qa,qa,gb),wb)){++ab;wb=qa['_case_'+Qa].conditions;if(!wb)throw Error('[ ginaFormValidator ] case `_case_'+Qa+'` found without `condition(s)` !\nPlease, check your delcaration for `_case_'+
|
|
583
|
-
Qa+'`');for(let Kb=0,Zb=wb.length;Kb<Zb;++Kb)if(nb=gb[Qa],K&&('true'==X[Qa]?nb=!0:'false'==X[Qa]&&(nb=!1)),wb[Kb]['case']===nb||Array.isArray(wb[Kb]['case'])&&-1<wb[Kb]['case'].indexOf(nb)||/^\//.test(wb[Kb]['case'])){Nb={};if('undefined'==typeof wb[Kb].rules[Qa]&&'undefined'==typeof gb[Qa]||
|
|
584
|
-
'\\]');la=new RegExp(la,Ca);for(var Ib in
|
|
585
|
-
Y(Nb[Ib],fa[Ib]))))}else/^\//.test(wb[Kb]['case'])?(la=wb[Kb]['case'].match(/\/(.*)\//).pop(),Ca=wb[Kb]['case'].replace('/'+la+'/',''),la=la.replace(/\[/g,'\\[').replace(/\]/g,'\\]'),la=new RegExp(la,Ca),la.test(nb)&&(Nb[Db]=wb[Kb].rules[Db])):Nb[Db]=wb[Kb].rules[Db],'undefined'==typeof X[Db]&&'undefined'!=typeof
|
|
586
|
-
(Nb[Db]=Y(Nb[Db],fa[Db])));++aa;if(K)Vb(Za,gb,fa,X,
|
|
587
|
-
{}),window.ginaToolbar.update('forms',{id:A,validated:
|
|
583
|
+
Qa+'`');for(let Kb=0,Zb=wb.length;Kb<Zb;++Kb)if(nb=gb[Qa],K&&('true'==X[Qa]?nb=!0:'false'==X[Qa]&&(nb=!1)),wb[Kb]['case']===nb||Array.isArray(wb[Kb]['case'])&&-1<wb[Kb]['case'].indexOf(nb)||/^\//.test(wb[Kb]['case'])){Nb={};if('undefined'==typeof wb[Kb].rules[Qa]&&'undefined'==typeof gb[Qa]||ka[Qa].disabled)wb[Kb].rules[Qa]={exclude:!0};for(var Db in wb[Kb].rules)if(!/^_comment$/i.test(Db))if(/^\//.test(Db)){la=Db.match(/\/(.*)\//).pop();Ca=Db.replace('/'+la+'/','');la=la.replace(/\[/g,'\\[').replace(/\]/g,
|
|
584
|
+
'\\]');la=new RegExp(la,Ca);for(var Ib in ka)la.test(Ib)&&(/^\//.test(wb[Kb]['case'])?(la=wb[Kb]['case'].match(/\/(.*)\//).pop(),Ca=wb[Kb]['case'].replace('/'+la+'/',''),la=new RegExp(la,Ca),la.test(nb)&&(Nb[Ib]=wb[Kb].rules[Db])):Nb[Ib]=wb[Kb].rules[Db],'undefined'==typeof X[Ib]&&'undefined'!=typeof ka[Ib]&&'undefined'!=typeof ka[Ib].value&&(X[Ib]=ka[Ib].value,K&&/(true|false)/i.test(X[Ib])&&('true'==X[Ib]?X[Ib]=!0:'false'==X[Ib]&&(X[Ib]=!1)),Va.addField(Ib,X[Ib]),'undefined'!=typeof fa[Ib]&&(Nb[Ib]=
|
|
585
|
+
Y(Nb[Ib],fa[Ib]))))}else/^\//.test(wb[Kb]['case'])?(la=wb[Kb]['case'].match(/\/(.*)\//).pop(),Ca=wb[Kb]['case'].replace('/'+la+'/',''),la=la.replace(/\[/g,'\\[').replace(/\]/g,'\\]'),la=new RegExp(la,Ca),la.test(nb)&&(Nb[Db]=wb[Kb].rules[Db])):Nb[Db]=wb[Kb].rules[Db],'undefined'==typeof X[Db]&&'undefined'!=typeof ka[Db]&&'undefined'!=typeof ka[Db].value&&(X[Db]=ka[Db].value,K&&/(true|false)/i.test(X[Db])&&('true'==X[Db]?X[Db]=!0:'false'==X[Db]&&(X[Db]=!1)),Va.addField(Db,X[Db]),'undefined'!=typeof fa[Db]&&
|
|
586
|
+
(Nb[Db]=Y(Nb[Db],fa[Db])));++aa;if(K)Vb(Za,gb,fa,X,ka,Nb,Ra,ab);else return Vb(Za,gb,fa,X,ka,Nb,Ra,ab)}--ab}}--aa;if(0>=ab&&0>aa){gb=Va.getErrors();for(Qa in gb){for(rule in gb[Qa])qb[Qa]||(qb[Qa]=''),0>qb[Qa].indexOf(rule)&&(qb[Qa]+=rule+' ');K&&ka[Qa].setAttribute('data-gina-form-errors',qb[Qa].substr(0,qb[Qa].length-1))}try{V=Ka(Va.toData()),T&&K&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&(gina.forms.validated||(gina.forms.validated={}),gina.forms.validated[A]||(gina.forms.validated[A]=
|
|
587
|
+
{}),window.ginaToolbar.update('forms',{id:A,validated:V}))}catch(Kb){throw Kb;}Q=!0;if(!P&&0>=na)if('undefined'!=typeof Ra&&'function'===typeof Ra)Ra._errors=Va.getErrors(),Ra._data=Va.toData(),triggerEvent(gina,Za,'validated.'+A,Ra);else return P=!0,{isValid:Va.isValid,error:gb,data:V}}};K&&addListener(gina,e,u,function(Za){Za.preventDefault();if(!P){P=!0;Q=!1;na=0;var gb=Za.detail,fa=gb._data||Va.toData(),X=gb._errors||Va.getErrors()||null;console.debug('instance errors: ',q.$forms[A].errors,' VS cbErrors: ',
|
|
588
588
|
X,Va.isValid(),' VS d.getErrors(): ',Va.getErrors());0<X.count()&&Va.isValid()&&(Va.isValid=function(){return!1});gb({isValid:Va.isValid,error:X,data:Ka(fa)});removeListener(gina,Za.target,'validated.'+Za.target.id)}});if(K)Vb(e,Hb,sb,b,h,p,x,0);else return Vb(e,Hb,sb,b,h,p,x,0)};return K?Pa(D):H(D,O,ca)}'undefined'!==typeof module&&module.exports?module.exports=ValidatorPlugin:'function'===typeof define&&define.amd&&define('gina/validator',['utils/events','utils/dom','lib/form-validator'],function(){return ValidatorPlugin});
|
|
589
|
-
define('gina/toolbar','require jquery vendor/uuid lib/collection lib/routing gina/storage gina/validator'.split(' '),function(D){var O=D('jquery');O.noConflict();var ca=D('lib/routing');D('lib/collection');var Ea=D('gina/storage');return function(){var K=null,T=!1,oa=!1,Y=!1,U,n=(new Ea({bucket:'gina'})).Collection('plugin'),S=null,q=null,da=!1,za=null,N=null,L=null,B=null,H=null,m='',z=null,y=null,F=null,r='',v=null,E=0,I=0,R=0,sa='',Ga={},
|
|
590
|
-
null,La=null,Fa=null,Oa=null,Ia=null,Ka=null,Ya=null,pb=function(){S=O('#gina-toolbar');if(!S.length)return!1;za=S.find('.gina-toolbar-tab > a');N=O('#gina-toolbar-toggle');L=O('#gina-toolbar-panels');B=L.find('.gina-toolbar-panel');z=O('#gina-toolbar-vposition');y=O('#gina-toolbar-hposition');F=z.add(y);v=O('#gina-toolbar-width');S.find('.gina-toolbar-main');
|
|
589
|
+
define('gina/toolbar','require jquery vendor/uuid lib/collection lib/routing gina/storage gina/validator'.split(' '),function(D){var O=D('jquery');O.noConflict();var ca=D('lib/routing');D('lib/collection');var Ea=D('gina/storage');return function(){var K=null,T=!1,oa=!1,Y=!1,U,n=(new Ea({bucket:'gina'})).Collection('plugin'),S=null,q=null,da=!1,za=null,N=null,L=null,B=null,H=null,m='',z=null,y=null,F=null,r='',v=null,E=0,I=0,R=0,sa='',Ga={},W=null,ha=null,ea=null,wa=null,ja=null,ta=null,Da=null,Pa=
|
|
590
|
+
null,La=null,Fa=null,Oa=null,Ia=null,Ka=null,Ya=null,pb=function(){S=O('#gina-toolbar');if(!S.length)return!1;za=S.find('.gina-toolbar-tab > a');N=O('#gina-toolbar-toggle');L=O('#gina-toolbar-panels');B=L.find('.gina-toolbar-panel');z=O('#gina-toolbar-vposition');y=O('#gina-toolbar-hposition');F=z.add(y);v=O('#gina-toolbar-width');S.find('.gina-toolbar-main');W=O('#gina-toolbar-json');ha=O('#gina-toolbar-gina-json');ea=O('#gina-toolbar-toggle-code-raw');$forms=O('form:not(.gina-toolbar-options, .gina-toolbar-content)');
|
|
591
591
|
La=O('#gina-toolbar-data-html');Fa=O('#gina-toolbar-view-html');Oa=O('#gina-toolbar-forms-html');Pa=O('#gina-toolbar-configuration-environment-html');Ia=O('#gina-toolbar-code-toggle');S.prepend('<textarea class="gina-toolbar-copy"></textarea>');Ka=S.find('.gina-toolbar-copy');q=n.findOne({_name:'toolbar'});q||(q={_name:'toolbar',_version:'1.0.3',_description:'Toolbar settings',_licence:'MIT',_author:[{name:'Fabrice Delaneau',company:'Freelancer'},{name:'Martin-Luther Etouman',company:'Rhinostone'}],
|
|
592
592
|
position:'top-right',width:'30',panelId:'#gina-toolbar-data',isCollapsed:!0,isUnfolded:[],debug:{forms:{active:!1,strategy:'frontend'}}},n.insert(q),q=n.findOne({_name:'toolbar'}));'1.0.3'!=q._version&&('1.0.1'>q._version&&(q.isUnfolded||(q.isUnfolded=[]),void 0!=q.codeFolding&&delete q.codeFolding),'undefined'==typeof q.isUnfolded||Array.isArray(q.isUnfolded)||(q.isUnfolded=[]),q._version='1.0.3',q.save(!0));r=q.position;E=q.width;m=q.panelId;da=q.isCollapsed;S.removeClass('gina-toolbar-hidden');
|
|
593
|
-
bc()},$a=function(h,p,x){var u=null,A=null;try{A=
|
|
594
|
-
delete
|
|
595
|
-
Fa.html(Pb(
|
|
596
|
-
/^(data-xhr)$/.test(h)?La.html('<ul class="gina-toolbar-code">'+db(
|
|
593
|
+
bc()},$a=function(h,p,x){var u=null,A=null;try{A=W?W.text():'',''==A||'null'==A?W.text('{}'):(ja=JSON.parse(A),Da=JSON.parse(ha.text()),W.text(''),wa||(wa={jsonObject:JSON.clone(ja),ginaJsonObject:JSON.clone(Da)},ta={}))}catch(ia){console.error('Could not load'+(h?' [ '+h+' ] ':' ')+'json\n'+ia.message+'\n'+ia.stack)}if(ja){p&&!x?(ja[h]||(ja[h]={}),ja[h]=Da[h]=p):'data-xhr'==h&&!p&&ja['data-xhr']?delete ja['data-xhr']:x&&(ja=p,Da=x);b(ja,'');Da.environment&&(delete Da.environment.routing,delete Da.environment.reverseRouting,
|
|
594
|
+
delete Da.environment.forms);ja.environment&&(delete ja.environment.routing,delete ja.environment.reverseRouting,delete ja.environment.forms);Pa.html(db(ja.environment,Da.environment));u=ja.data;var V=ja.view;x=ja.forms;var P=Da.data,aa=Da.view;A=Da.forms;oa=U=!1;var Q=null,w=!1;/^(view-xhr)$/.test(h)&&(Q=!0,V=ja[h],aa=Da[h],u=ja['data-xhr'],P=Da['data-xhr']);if(!h||/^(data)$/.test(h))La.html('<ul class="gina-toolbar-code">'+db(u,P,null,Q)+'</ul>'),Fa.html('<div id="gina-toolbar-view-html-properties" class="gina-toolbar-section">\n <h2 class="gina-toolbar-section-title">properties</h2>\n <ul class="gina-toolbar-properties"></ul>\n</div>'),
|
|
595
|
+
Fa.html(Pb(V,aa,null,Q,Fa)),u=$forms,Oa.html(''),Oa.html(ya(x,A,Oa,0,u,u.length,Q)),Oa.find('div.gina-toolbar-section > h2').off('click').on('click',function(ia){ia.preventDefault();O(this).parent().find('ul').first().slideToggle()});if(/^(data-xhr|view-xhr)$/.test(h)){if('undefined'==typeof ja[h]||!ja[h]||'null'==ja[h])return!1;Q=!0;w='undefined'!=typeof ja[h].isXHRViewData?!0:w;w||/^(view-xhr)$/.test(h)||'undefined'==typeof ja['el-xhr']||(ta.data=JSON.clone(ja[h]));w&&delete ja[h].isXHRViewData;
|
|
596
|
+
/^(data-xhr)$/.test(h)?La.html('<ul class="gina-toolbar-code">'+db(ja[h],Da[h],null,Q)+'</ul>'):/^(view-xhr)$/.test(h)&&(Fa.html('<div id="gina-toolbar-view-html-properties" class="gina-toolbar-section">\n <h2 class="gina-toolbar-section-title">properties</h2>\n <ul class="gina-toolbar-properties"></ul>\n</div>'),Fa.html(Pb(ja[h],Da[h],null,Q,Fa)))}/^(el-xhr)$/.test(h)&&(Q=!0,u=O('#'+p).find('form:not(.gina-toolbar-options, .gina-toolbar-content)'),Oa.html(''),Oa.html(ya(x,A,Oa,0,u,u.length,
|
|
597
597
|
Q)),Oa.find('div.gina-toolbar-section > h2').off('click').on('click',function(ia){ia.preventDefault();O(this).parent().find('ul').first().slideToggle()}));/^(forms)$/.test(h)&&(oa=Q=!0,O('#gina-toolbar-form-'+p.id).length||(u=$forms,Oa.html(''),Oa.html(ya(x,A,Oa,0,u,u.length,Q)),Oa.find('div.gina-toolbar-section > h2').off('click').on('click',function(ia){ia.preventDefault();O(this).parent().find('ul').first().slideToggle()})),'undefined'!=typeof p.rules&&Ja(p.id,'rules',p.rules,Q),'undefined'!=typeof p.errors&&
|
|
598
|
-
0<p.errors.count()&&Ja(p.id,'errors',p.errors,Q),'undefined'!=typeof p.sent&&Ja(p.id,'sent',p.sent,Q));q.currentFile=
|
|
598
|
+
0<p.errors.count()&&Ja(p.id,'errors',p.errors,Q),'undefined'!=typeof p.sent&&Ja(p.id,'sent',p.sent,Q));q.currentFile=ja.file;q.currentFile||(q.currentFile=ja.file);ja.file==q.currentFile&&O(document).ready(function(){oa?(T=!0,0<q.isUnfolded.length&&!U&&(U=!0,setTimeout(function(){0<q.isUnfolded.length&&ib(q.isUnfolded,q.isUnfolded.length,0)},200))):Q?(T=!0,0<q.isUnfolded.length&&!U&&(U=!0,ib(q.isUnfolded,q.isUnfolded.length,0))):(T=!1,setTimeout(function(){0<q.isUnfolded.length&&ib(q.isUnfolded,q.isUnfolded.length,
|
|
599
599
|
0)},200))})}if(!h||'el-xhr'==h&&!Y)Y=h&&'el-xhr'==h?!0:!1,xa(h)},ib=function(h,p,x){if(x==p)return!1;var u=h[x],A=null;T&&/^xhr-/.test(u)?(u=u.replace(/^xhr-/,''),A=O('.gina-toolbar-xhr-folding-state-'+u)):A=O('.gina-toolbar-folding-state-'+u);yb(A,function(){x+=1;ib(h,p,x)})},bc=function(){La.add(Fa).off('click','a').on('click','a',function(p){p.preventDefault();yb(O(this),null,!0)}).add(Oa).off('click','a').on('click','a',function(p){p.preventDefault();yb(O(this),null,!0)});Ia.off('click').on('click',
|
|
600
|
-
function(p){p.preventDefault();yb('all',null,!0)});La.add(Fa,Oa).off('click','.gina-toolbar-value').on('click','.gina-toolbar-value',function(p){p.preventDefault();try{Ya=O(this).text(),Ka.text(Ya),Ka.select(),document.execCommand('copy',!1,null),Ka.blur()}catch(x){alert('Please press Ctrl/Cmd+C to copy the value')}});ea.off('click').on('click',function(p){
|
|
600
|
+
function(p){p.preventDefault();yb('all',null,!0)});La.add(Fa,Oa).off('click','.gina-toolbar-value').on('click','.gina-toolbar-value',function(p){p.preventDefault();try{Ya=O(this).text(),Ka.text(Ya),Ka.select(),document.execCommand('copy',!1,null),Ka.blur()}catch(x){alert('Please press Ctrl/Cmd+C to copy the value')}});ea.off('click').on('click',function(p){ja&&window.open('','JSON RAW','width=400,height=100').document.write(JSON.stringify(ja.data))});za.off('click').on('click',function(p){p.preventDefault();
|
|
601
601
|
za.removeClass('gina-toolbar-active');B.removeClass('gina-toolbar-active');O(this).addClass('gina-toolbar-active');m=O(this).attr('href');H=O(m).addClass('gina-toolbar-active');q.panelId=m;q.save()});N.off('click').on('click',function(p){p.preventDefault();S.toggleClass('gina-toolbar-collapsed');da=S.hasClass('gina-toolbar-collapsed');q.isCollapsed=da;q.save()});F.off('change').on('change',function(p){p.preventDefault();p=z.val();var x=y.val();r=p+'-'+x;$b(r);q.position=r;q.save()});v.off('change').on('change',
|
|
602
602
|
function(p){p.preventDefault();E=v.val();fb(E);q.width=E;q.save()});O(window).off('resize').on('resize',function(){Cb()});O('body').off('keypress').on('keypress',function(p){if(!/INPUT|TEXTAREA/.test(p.target.tagName)){sa=p.keyCode?p.keyCode:p.which?p.which:p.charCode;p=new Date;if('undefined'!=typeof Ga.keynum&&Ga.keynum==sa&&'undefined'!=typeof Ga.pressTime&&500>p.getTime()-Ga.pressTime)switch(sa){case 103:S.toggle()}Ga.pressTime=p.getTime();Ga.keynum=sa}});za.filter('[href="'+m+'"]').trigger('click');
|
|
603
|
-
da||O('#gina-toolbar-toggle').trigger('click');$b(r);var h=r.split('-');z.val(h[0]);y.val(h[1]);fb(E);v.val(E);Cb();h=
|
|
603
|
+
da||O('#gina-toolbar-toggle').trigger('click');$b(r);var h=r.split('-');z.val(h[0]);y.val(h[1]);fb(E);v.val(E);Cb();h=W?W.text():'';/^\{\{ (.*) \}\}/.test(h)?e(h,$a):$a()},$b=function(h){S.removeClass('gina-toolbar-top-left gina-toolbar-top-right gina-toolbar-bottom-left gina-toolbar-bottom-right').addClass('gina-toolbar-'+h)},fb=function(h){S.removeClass('gina-toolbar-auto gina-toolbar-100 gina-toolbar-80 gina-toolbar-60 gina-toolbar-50 gina-toolbar-40 gina-toolbar-30').addClass('gina-toolbar-'+
|
|
604
604
|
h)},Cb=function(){I=window.innerHeight-32;S.find('.gina-toolbar-main').css('max-height',I+'px');var h=H.find('.gina-toolbar-main'),p=h.find('.gina-toolbar-content');R=h.height();R==I?p.addClass('gina-toolbar-content-end'):p.removeClass('gina-toolbar-content-end')},yb=function(h,p,x){'undefined'==typeof x&&(x=!1);if(void 0!=h&&h.length&&'all'!=h){K=h.attr('class');var u=!1;if(/(gina-toolbar-folding-state-[a-z 0-9_-]+|gina-toolbar-xhr-folding-state-[a-z 0-9_-]+)/i.test(K))if(/gina-toolbar-folding-state-[a-z0-9_-]+/i.test(K)?
|
|
605
605
|
K=K.match(/gina-toolbar-folding-state-[a-z0-9_-]+/i)[0].replace(/gina-toolbar-folding-state-/,''):(u=!0,'undefined'!=typeof K&&(K=K.match(/gina-toolbar-xhr-folding-state-[a-z0-9_-]+/i)[0].replace(/gina-toolbar-xhr-folding-state-/,'xhr-'))),0>q.isUnfolded.indexOf(K))q.isUnfolded.push(K),q.save(),h.hasClass('gina-toolbar-unfolded')||(h.addClass('gina-toolbar-unfolded'),h.next('ul').slideToggle('fast'));else if(-1<q.isUnfolded.indexOf(K)&&h.hasClass('gina-toolbar-unfolded')){for(var A=new RegExp('^('+
|
|
606
|
-
K+')'),
|
|
607
|
-
p){var x='';if('undefined'!=typeof h&&''!=h){var u=h;'string'==typeof h&&(u=h.replace(/(\]\[|\[)/g,'-').replace(/\]/,'').replace(/[^A-Za-z0-9_-]/g,'_'));x+=u+'-'}'undefined'!=typeof p&&''!=p?(h=p,'string'==typeof p&&(h=p.replace(/(\]\[|\[)/g,'-').replace(/\]/,'')),x+=h):x=x.substr(0,x.length-1);return x.trim()},db=function(h,p,x,u,A){var
|
|
608
|
-
Gb(h);p=Gb(p);for(var Q in h)if('object'!=typeof h[Q]||Array.isArray(h[Q])||null===h[Q])if(Array.isArray(h[Q])){x+='-'+Q.replace(/[^A-Za-z0-9_-]/g,'_');var w=0<h[Q].length||'undefined'!=typeof p[Q]&&0<p[Q].length?'':' is-empty';
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
u,A)+'</ul>',
|
|
612
|
-
|
|
613
|
-
p[Q],x,u,A)+'</ul>',
|
|
606
|
+
K+')'),V=0,P=q.isUnfolded.length;V<P;++V)A.test(q.isUnfolded[V])&&(!oa&&x||oa&&u||x)&&(q.isUnfolded.splice(V,1),--V);q.save(!0);0>q.isUnfolded.indexOf(K)&&(h.removeClass('gina-toolbar-unfolded'),h.next('ul').slideToggle('fast'))}else h.addClass('gina-toolbar-unfolded'),h.next('ul').slideToggle('fast')}'undefined'!=typeof p&&null!=p&&p()},Gb=function(h){var p={},x=null,u=[],A=0;for(x in h)h.hasOwnProperty(x)&&(u[A]=x,++A);var V=u.length;u.sort();for(A=0;A<V;++A)x=u[A],p[x]=h[x];return p},Na=function(h,
|
|
607
|
+
p){var x='';if('undefined'!=typeof h&&''!=h){var u=h;'string'==typeof h&&(u=h.replace(/(\]\[|\[)/g,'-').replace(/\]/,'').replace(/[^A-Za-z0-9_-]/g,'_'));x+=u+'-'}'undefined'!=typeof p&&''!=p?(h=p,'string'==typeof p&&(h=p.replace(/(\]\[|\[)/g,'-').replace(/\]/,'')),x+=h):x=x.substr(0,x.length-1);return x.trim()},db=function(h,p,x,u,A){var V='';x='undefined'!=typeof x&&null!=x?x.replace(/[^A-Za-z0-9_-]/g,'_'):'';var P='undefined'!=typeof A&&null!=A?A:'',aa='undefined'!=typeof u&&null!=u?'-xhr':'';h=
|
|
608
|
+
Gb(h);p=Gb(p);for(var Q in h)if('object'!=typeof h[Q]||Array.isArray(h[Q])||null===h[Q])if(Array.isArray(h[Q])){x+='-'+Q.replace(/[^A-Za-z0-9_-]/g,'_');var w=0<h[Q].length||'undefined'!=typeof p[Q]&&0<p[Q].length?'':' is-empty';V+='<li class="gina-toolbar-collection">';V+='<a href="#" class="gina-toolbar-key gina-toolbar'+aa+'-folding-state-'+Na(P,Q.replace(/[^A-Za-z0-9_-]/g,'_'))+w+'">'+Q+' <span>['+h[Q].length+']</span></a>';V+='<ul class="gina-toolbar-collection">'+Eb(h[Q],p[Q],x,u,A)+'</ul>';
|
|
609
|
+
V+='</li>';x=x.substr(0,x.length-Q.length)}else w=null===p[Q]?'null':typeof p[Q],'undefined'==w?(V+='<li class="gina-toolbar-key-value">',V+='<span class="gina-toolbar-key gina-toolbar-key-added">'+Q+':</span> <span class="gina-toolbar-value gina-toolbar-value-type-is-'+w+'">'+h[Q]+'</span>'):(h[Q]!==p[Q]&&(V+='<li class="gina-toolbar-key-value gina-toolbar-is-overridden">',V+='<span class="gina-toolbar-key">'+Q+':</span> <span class="gina-toolbar-value">'+p[Q]+'</span>',V+='</li>'),V+='<li class="gina-toolbar-key-value">',
|
|
610
|
+
V+='<span class="gina-toolbar-key">'+Q+':</span> <span class="gina-toolbar-value gina-toolbar-value-type-is-'+w+'">'+h[Q]+'</span>'),V+='</li>';else x+='-'+Q.replace(/[^A-Za-z0-9_-]/g,'_'),w=0<h[Q].count()||'undefined'!=typeof p[Q]&&0<p[Q].count()?'':' is-empty',V+='<li class="gina-toolbar-object">',V+='<a href="#" class="gina-toolbar-key gina-toolbar'+aa+'-folding-state-'+Na(P,Q.replace(/[^A-Za-z0-9_-]/g,'_'))+w+'">'+Q+' <span>{ }</span></a>',V+='<ul class="gina-toolbar-object">'+db(h[Q],p[Q],x,
|
|
611
|
+
u,A)+'</ul>',V+='</li>',x=x.substr(0,x.length-Q.length);return V},Eb=function(h,p,x,u,A){var V='';x='undefined'!=typeof x&&null!=x?x:'';var P='undefined'!=typeof A&&null!=A?A:'',aa='undefined'!=typeof u&&null!=u?'-xhr':'';p||=[];for(var Q=0,w=h.length;Q<w;++Q)'object'!=typeof h[Q]||Array.isArray(h[Q])?Array.isArray(h[Q])?(x+='-'+Q,''==P&&(P=x),V+='<li class="gina-toolbar-collection">',V+='<a href="#" class="gina-toolbar-key gina-toolbar'+aa+'-folding-state-'+Na(P,Q)+'">'+Q+'<span>[ ]</span></a>',
|
|
612
|
+
V+='<ul class="gina-toolbar-collection">'+Eb(h[Q],p[Q],x,u,A)+'</ul>',V+='</li>',x=x.substr(0,x.length-Q.toString().length)):V+='<li class="gina-toolbar-key-value"><span class="gina-toolbar-key">'+Q+':</span> <span class="gina-toolbar-value">'+h[Q]+'</span></li>':(p[Q]||(p[Q]=h[Q]),x+='-'+Q,''==P&&(P=x),V+='<li class="gina-toolbar-object">',V+='<a href="#" class="gina-toolbar-key gina-toolbar'+aa+'-folding-state-'+Na(P,Q)+'">'+Q+' <span>{ }</span></a>',V+='<ul class="gina-toolbar-object">'+db(h[Q],
|
|
613
|
+
p[Q],x,u,A)+'</ul>',V+='</li>',x=x.substr(0,x.length-Q.toString().length-1));return V},Pb=function(h,p,x,u,A,V){x=null!=x?x.replace(/[^A-Za-z0-9_-]/g,'_'):'';var P='undefined'!=typeof u&&null!=u?'-xhr':'';h=Gb(h);p=Gb(p);V||=A;for(var aa in h){var Q=aa;if('object'!=typeof h[aa]||Array.isArray(h[aa])||null===h[aa])if(Array.isArray(h[aa])){var w=O('#gina-toolbar-view-'+x.substr(0,x.length-1));var ia=w.length?!0:!1;!ia||/^html/.test(x)?(w=O('.'+x),ia=x+aa.replace(/[^A-Za-z0-9_-]/g,'_')+'-',w.append('<li class="gina-toolbar-collection"><a href="#" class="gina-toolbar-key gina-toolbar'+
|
|
614
614
|
P+'-folding-state-'+Na(aa.replace(/[^A-Za-z0-9_-]/g,'_'),ia.substr(0,ia.length-1))+'">'+aa+' <span>['+h[aa].length+']</span></a><ul> '+Eb(h[aa],p[aa],ia,w.find('li ul.'+x.substr(0,x.length-1)),Q)+'</ul></li>')):(ia=x+aa.replace(/[^A-Za-z0-9_-]/g,'_')+'-',w.find('li.'+x.substr(0,x.length-1)+' ul').append('<li class="gina-toolbar-collection"><a class="gina-toolbar-key gina-toolbar'+P+'-folding-state-'+Na(aa.replace(/[^A-Za-z0-9_-]/g,'_'),ia.substr(0,ia.length-1))+'">'+aa+' <span>['+h[aa].length+']</span></a><ul>'+
|
|
615
615
|
Eb(h[aa],p[aa],ia,w.find('li ul.'+x.substr(0,x.length-1)),Q)+'</ul></li>'));x+=aa.replace(/[^A-Za-z0-9_-]/g,'_')+'-';x=x.substr(0,x.length-aa.length-1)}else if(Q=null===p[aa]?'null':typeof p[aa],'undefined'==Q)/\-$/.test(x)&&(x=x.substr(0,x.length-1)),x&&A.find('ul.'+x).append('<li class="gina-toolbar-key-value"><span class="gina-toolbar-key gina-toolbar-key-added">'+aa+':</span> <span class="gina-toolbar-value gina-toolbar-value-type-is-'+Q+'">'+h[aa]+'</span></li>');else if(h[aa]!==p[aa]){x||(x+=
|
|
616
616
|
aa.replace(/[^A-Za-z0-9_-]/g,'_')+'-');try{A.find('ul.'+x).append('<li class="gina-toolbar-key-value gina-toolbar-is-overridden"><span class="gina-toolbar-key">'+aa+':</span> <span class="gina-toolbar-value">'+p[aa]+'</span></li>'),A.find('ul.'+x).append('<li class="gina-toolbar-key-value"><span class="gina-toolbar-key">'+aa+':</span> <span class="gina-toolbar-value gina-toolbar-value-type-is-'+Q+'">'+h[aa]+'</span></li>')}catch(ua){throw Error('GinaToolbarError: `ul.'+x+'` not found');}}else!x||
|
|
617
|
-
/^html\-properties/.test(x)?
|
|
618
|
-
1)),(ia=w.length?!0:!1)?(ia=x+aa.replace(/[^A-Za-z0-9_-]/g,'_')+'-',w.find('ul.'+x.substr(0,x.length-1)).append('<li class="gina-toolbar-object"><a href="#" class="gina-toolbar-key gina-toolbar'+P+'-folding-state-'+Na(aa.replace(/[^A-Za-z0-9_-]/g,'_'),ia.substr(0,ia.length-1))+'">'+aa+' <span>{ }</span></a><ul class="gina-toolbar-object '+ia.substr(0,ia.length-1)+'"></ul></li>'),Pb(h[aa],p[aa],ia,u,w.find('ul.'+x.substr(0,x.length-1)),
|
|
617
|
+
/^html\-properties/.test(x)?V.find('.gina-toolbar-properties').append('<li class="gina-toolbar-key-value"><span class="gina-toolbar-key">'+aa+':</span> <span class="gina-toolbar-value gina-toolbar-value-type-is-'+Q+'">'+h[aa]+'</span></li>'):V.find('ul.'+x.substr(0,x.length-1)).append('<li class="gina-toolbar-key-value"><span class="gina-toolbar-key">'+aa+':</span> <span class="gina-toolbar-value gina-toolbar-value-type-is-'+Q+'">'+h[aa]+'</span></li>');else w=O('#gina-toolbar-view-'+x.substr(0,x.length-
|
|
618
|
+
1)),(ia=w.length?!0:!1)?(ia=x+aa.replace(/[^A-Za-z0-9_-]/g,'_')+'-',w.find('ul.'+x.substr(0,x.length-1)).append('<li class="gina-toolbar-object"><a href="#" class="gina-toolbar-key gina-toolbar'+P+'-folding-state-'+Na(aa.replace(/[^A-Za-z0-9_-]/g,'_'),ia.substr(0,ia.length-1))+'">'+aa+' <span>{ }</span></a><ul class="gina-toolbar-object '+ia.substr(0,ia.length-1)+'"></ul></li>'),Pb(h[aa],p[aa],ia,u,w.find('ul.'+x.substr(0,x.length-1)),V),x+=aa.replace(/[^A-Za-z0-9_-]/g,'_')+'-'):(x+=aa.replace(/[^A-Za-z0-9_-]/g,
|
|
619
619
|
'_')+'-','params'==aa?(Q='<div id="gina-toolbar-view-'+x.substr(0,x.length-1)+'" class="gina-toolbar-section"><h2 class="gina-toolbar-section-title">'+x.substr(0,x.length-1)+'</h2><ul class="'+x.substr(0,x.length-1)+'"></ul></div>',O('#gina-toolbar-view-html-properties').before(Q)):/^html/.test(x)||(Q='<div id="gina-toolbar-view-'+x.substr(0,x.length-1)+'" class="gina-toolbar-section"><h2 class="gina-toolbar-section-title">'+x.substr(0,x.length-1)+'</h2><ul class="'+x.substr(0,x.length-1)+'"></ul></div>',
|
|
620
|
-
A.append(Q)),Pb(h[aa],p[aa],x,u,A.find('ul.'+x.substr(0,x.length-1)),
|
|
621
|
-
ca.notFound[f].count+') '+f+' => '+ca.notFound[f].message)},ya=function(h,p,x,u,A,
|
|
620
|
+
A.append(Q)),Pb(h[aa],p[aa],x,u,A.find('ul.'+x.substr(0,x.length-1)),V)),x=x.substr(0,x.length-aa.length-1)}return V.html()},xa=function(h){h=gina.hasPopinHandler?gina.popin.getActivePopin():null;var p,x=(gina.hasPopinHandler?O('#'+h.id):O('body')).html().match(/404:\[(.+)\](.+)@(.+)"/gm);if(x){var u=0;for(p=x.length;u<p;++u){h=x[u].replace(/"(.*)|"/g,'');var A=h.match(/\[(.*)\]/g,'')[0].replace(/\[|\]/g,'');ca.getRouteByUrl(h,A)}}fLen=ca.notFound.count();if(0<fLen)for(f in ca.notFound)console.warn('(x'+
|
|
621
|
+
ca.notFound[f].count+') '+f+' => '+ca.notFound[f].message)},ya=function(h,p,x,u,A,V,P){if(!V)return!1;for(var aa=A[u].attributes,Q,w=A[u].getAttribute('id')||A[u].id,ia=O('<div id="gina-toolbar-form-'+w+'" class="gina-toolbar-section"><h2 class="gina-toolbar-section-title">'+w+'</h2><ul class="gina-toolbar-section-content gina-toolbar-code" style="display: none;"><li class="gina-toolbar-form-attributes"><h3 class="gina-toolbar-sub-section-title">'+'gina-toolbar-form-attributes'.replace(/gina-toolbar-form-/,
|
|
622
622
|
'')+'</h3><ul class="gina-toolbar-code"></ul></li></ul></div>'),ua,na,la=null,Ca=0,Aa=aa.length;Ca<Aa;++Ca)ua=aa[Ca].name,na=aa[Ca].nodeValue,/^method$/.test(ua)&&(na=na.toUpperCase()),/^class$/.test(ua)&&/\s+/.test(na)&&(na='<ul><li>'+na.replace(/\s+/g,'</li><li>')+'</li></ul>'),/^action$/.test(ua)&&((Q='undefined'!=typeof aa.method?aa.method.nodeValue:void 0)||console.warn('[ ToolbarFormHelper::UndefinedMethod : form `'+aa.id.nodeValue+'` method attribute cannot be left undefined !'),Q=ca.getRouteByUrl(na,
|
|
623
623
|
Q),'undefined'!=typeof Q&&Q||(Q={name:'not found',namespace:'not found',param:{control:'not found',file:'not found'}}),na='<ul><li><span class="gina-toolbar-key">url</span><span class="gina-toolbar-value">'+(na||'#')+'</span></li><li><span class="gina-toolbar-key">route</span><span class="gina-toolbar-value">'+Q.name+'</span></li><li><span class="gina-toolbar-key">namespace</span><span class="gina-toolbar-value">'+(Q.namespace||'root controller')+'</span></li><li><span class="gina-toolbar-key">control</span><span class="gina-toolbar-value">'+
|
|
624
624
|
Q.param.control+'</span></li><li><span class="gina-toolbar-key">file</span><span class="gina-toolbar-value">'+Q.param.file+'</span></li><ul>',la='<li><span class="gina-toolbar-key">'+ua+':</span><span class="gina-toolbar-value">'+na+'</span></li>'),/^data-gina-form-event/.test(ua)?(Q='events',la=ia.find('.gina-toolbar-form-attributes').find('.gina-toolbar-key-events').length?!0:!1,ua=ua.replace(/^data-gina-form-event-/,''),la||ia.find('ul.gina-toolbar-section-content').append('<li class="gina-toolbar-form-'+
|
|
625
625
|
Q+'"><h3 class="gina-toolbar-sub-section-title">'+Q+'</h3><ul class="gina-toolbar-code"></ul></li>'),la='<li><span class="gina-toolbar-key">'+ua+':</span><span class="gina-toolbar-value">'+na+'</span></li>',ia.find('ul.gina-toolbar-section-content').find('li.gina-toolbar-form-'+Q+' > ul').append(la)):(/^action$/.test(ua)||(la='<li><span class="gina-toolbar-key">'+ua+':</span><span class="gina-toolbar-value">'+na+'</span></li>'),ia.find('ul.gina-toolbar-section-content').find('li.gina-toolbar-form-attributes > ul').append(la));
|
|
626
|
-
aa=null;try{var Sa=A[u].getAttribute('data-gina-form-rule');aa='undefined'!=typeof Sa&&null!=Sa?eval('gina.forms.rules.'+Sa.replace(/-/g,'.')):eval('gina.forms.rules.'+w.replace(/-/g,'.'))}catch(Va){}aa&&(Q='rules',ia.find('ul.gina-toolbar-section-content').append('<li class="gina-toolbar-form-'+Q+'"><h3 class="gina-toolbar-sub-section-title">'+Q+'</h3><ul class="gina-toolbar-properties">'+db(aa,aa,w,P,Q)+'</ul></li>'));x.append(ia);++u;u<
|
|
626
|
+
aa=null;try{var Sa=A[u].getAttribute('data-gina-form-rule');aa='undefined'!=typeof Sa&&null!=Sa?eval('gina.forms.rules.'+Sa.replace(/-/g,'.')):eval('gina.forms.rules.'+w.replace(/-/g,'.'))}catch(Va){}aa&&(Q='rules',ia.find('ul.gina-toolbar-section-content').append('<li class="gina-toolbar-form-'+Q+'"><h3 class="gina-toolbar-sub-section-title">'+Q+'</h3><ul class="gina-toolbar-properties">'+db(aa,aa,w,P,Q)+'</ul></li>'));x.append(ia);++u;u<V&&ya(h,p,x,u,A,V,P)},Ja=function(h,p,x,u){var A=O('#gina-toolbar-form-'+
|
|
627
627
|
h);$section=A.find('ul.gina-toolbar-section-content').find('li.gina-toolbar-form-'+p+'> ul');if(0<$section.length){if(0==x.count())return A.find('ul.gina-toolbar-section-content').find('li.gina-toolbar-form-'+p).remove(),!1;$section.html(db(x,x,h,u,p))}else A.find('ul.gina-toolbar-section-content').append('<li class="gina-toolbar-form-'+p+'"><h3 class="gina-toolbar-sub-section-title">'+p+'</h3><ul class="gina-toolbar-properties">'+db(x,x,h,u,p)+'</ul></li>');h=A.find('ul.gina-toolbar-section-content');
|
|
628
|
-
h.is(':visible')||h.slideToggle()},M=function(h,p){return h='<label class="gina-toolbar-input-file"><input type="file" multiple id="'+(h+'">')+p+'</label>'},e=function(h,p){h=M('mock','Select your JSON file');La.html(h);
|
|
629
|
-
0,aa=u.length;P<aa;++P)switch(x=u[P],!0){case /user/.test(x.name):A[P]=new FileReader;A[P].addEventListener('load',function(Q){
|
|
628
|
+
h.is(':visible')||h.slideToggle()},M=function(h,p){return h='<label class="gina-toolbar-input-file"><input type="file" multiple id="'+(h+'">')+p+'</label>'},e=function(h,p){h=M('mock','Select your JSON file');La.html(h);W.text('');La.find('input').off('change').on('change',function(x){var u=O(this)[0].files,A=x=null;if(1==u.length)x=O(this)[0].files[0],A=new FileReader,A.addEventListener('load',function(){W.text(A.result);ha.text(A.result);p()},!1),A.readAsBinaryString(x);else{var V=0;A=[];for(var P=
|
|
629
|
+
0,aa=u.length;P<aa;++P)switch(x=u[P],!0){case /user/.test(x.name):A[P]=new FileReader;A[P].addEventListener('load',function(Q){W.text(Q.currentTarget.result);++V;V==u.length&&p()},!1);A[P].readAsBinaryString(x);break;case /gina/.test(x.name):A[P]=new FileReader,A[P].addEventListener('load',function(Q){ha.text(Q.currentTarget.result);++V;V==u.length&&p()},!1),A[P].readAsBinaryString(x)}}});return!1},b=function(h,p){for(var x in h)'object'==typeof h[x]&&b(h[x],p+x+'-')};this.update=function(h,p){$a(h,
|
|
630
630
|
p)};this.restore=function(){ta&&'undefined'!=typeof ta.data&&(wa.jsonObject.data=ta.data);$a('data',wa.jsonObject,wa.ginaJsonObject);Y=!1;ca.notFound={}};if('undefined'!=typeof gina.validator)gina.validator.on('initialized',function(){console.log('toolbar validator ready');pb()});else pb()}});
|
|
631
631
|
define('gina','require vendor/uuid lib/merge utils/events helpers/prototypes helpers/dateFormat gina/toolbar'.split(' '),function(D){D('utils/events');var O=D('lib/merge'),ca=D('helpers/dateFormat')();D('helpers/prototypes')({dateFormat:ca});var Ea=D('vendor/uuid');window.process||function(K,T,oa,Y,U,n,S){for(n=K[oa]||(K[oa]={});!S&&U<Y.length;)S=K[Y[U++]+'requestAnimationFrame'];n[T]=n[T]||S&&S.bind(K)||K.setImmediate||K.setTimeout}(window,'nextTick','process',['r','webkitR','mozR','msR','oR'],0);
|
|
632
632
|
window.getComputedStyle||(window.getComputedStyle=function(K,T){this.el=K;this.getPropertyValue=function(oa){var Y=/(\-([a-z]){1})/g;'float'==oa&&(oa='styleFloat');Y.test(oa)&&(oa=oa.replace(Y,function(U,n,S){return S.toUpperCase()}));return K.currentStyle[oa]?K.currentStyle[oa]:null};return this});return function(K){this.plugin='gina';var T='gina-'+Ea.v1(),oa=document,Y;document.id=T;T={id:T,isFrameworkLoaded:!1,hasValidator:!1,hasPopinHandler:!1,config:{},registeredEvents:{},events:{},setOptions:function(U){Y=
|
|
@@ -641,21 +641,21 @@ xa)}function N(xa){if(xa){for(var ya in N.prototype)xa[ya]=N.prototype[ya];retur
|
|
|
641
641
|
64);while(0<xa);return ya}function m(){var xa=H(+new Date);return xa!==Ka?($a=0,Ka=xa):xa+'.'+H($a++)}function z(xa){var ya='',Ja;for(Ja in xa)xa.hasOwnProperty(Ja)&&(ya.length&&(ya+='&'),ya+=encodeURIComponent(Ja)+'='+encodeURIComponent(xa[Ja]));return ya}function y(xa){var ya={};xa=xa.split('&');for(var Ja=0,M=xa.length;Ja<M;Ja++){var e=xa[Ja].split('=');ya[decodeURIComponent(e[0])]=decodeURIComponent(e[1])}return ya}function F(xa){xa=xa.xdomain;try{if('undefined'!=typeof XMLHttpRequest&&(!xa||
|
|
642
642
|
bc))return new XMLHttpRequest}catch(ya){}if(!xa)try{return new (Fa[['Active'].concat('Object').join('X')])('Microsoft.XMLHTTP')}catch(ya){}}function r(){}function v(){for(var xa in fb.requests)fb.requests.hasOwnProperty(xa)&&fb.requests[xa].abort()}function E(xa){var ya=xa,Ja=xa.indexOf('['),M=xa.indexOf(']');-1!=Ja&&-1!=M&&(xa=xa.substring(0,Ja)+xa.substring(Ja,M).replace(/:/g,';')+xa.substring(M,xa.length));var e,b;xa=db.exec(xa||'');for(var h={},p=14;p--;)h[Eb[p]]=xa[p]||'';return-1!=Ja&&-1!=M&&
|
|
643
643
|
(h.source=ya,h.host=h.host.substring(1,h.host.length-1).replace(/;/g,':'),h.authority=h.authority.replace('[','').replace(']','').replace(/;/g,':'),h.ipv6uri=!0),h.pathNames=function(x,u){x=u.replace(/\/{2,9}/g,'/').split('/');'/'!=u.substr(0,1)&&0!==u.length||x.splice(0,1);'/'==u.substr(u.length-1,1)&&x.splice(x.length-1,1);return x}(0,h.path),h.queryKey=(e=h.query,b={},e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(x,u,A){u&&(b[u]=A)}),b),h}var I=Object.create(null);I.open='0';I.close='1';I.ping=
|
|
644
|
-
'2';I.pong='3';I.message='4';I.upgrade='5';I.noop='6';var R=Object.create(null);Object.keys(I).forEach(function(xa){R[I[xa]]=xa});for(var sa={type:'error',data:'parser error'},Ga='function'==typeof Blob||'undefined'!=typeof Blob&&'[object BlobConstructor]'===Object.prototype.toString.call(Blob),
|
|
645
|
-
xa&&xa.buffer instanceof ArrayBuffer))?ya?Ja(xa):ea(new Blob([xa]),Ja):Ja(I[M]+(xa||''))},ea=function(xa,ya){var Ja=new FileReader;return Ja.onload=function(){var M=Ja.result.split(',')[1];ya('b'+M)},Ja.readAsDataURL(xa)},wa='undefined'==typeof Uint8Array?[]:new Uint8Array(256),
|
|
644
|
+
'2';I.pong='3';I.message='4';I.upgrade='5';I.noop='6';var R=Object.create(null);Object.keys(I).forEach(function(xa){R[I[xa]]=xa});for(var sa={type:'error',data:'parser error'},Ga='function'==typeof Blob||'undefined'!=typeof Blob&&'[object BlobConstructor]'===Object.prototype.toString.call(Blob),W='function'==typeof ArrayBuffer,ha=function(xa,ya,Ja){var M=xa.type;xa=xa.data;return Ga&&xa instanceof Blob?ya?Ja(xa):ea(xa,Ja):W&&(xa instanceof ArrayBuffer||('function'==typeof ArrayBuffer.isView?ArrayBuffer.isView(xa):
|
|
645
|
+
xa&&xa.buffer instanceof ArrayBuffer))?ya?Ja(xa):ea(new Blob([xa]),Ja):Ja(I[M]+(xa||''))},ea=function(xa,ya){var Ja=new FileReader;return Ja.onload=function(){var M=Ja.result.split(',')[1];ya('b'+M)},Ja.readAsDataURL(xa)},wa='undefined'==typeof Uint8Array?[]:new Uint8Array(256),ja=0;64>ja;ja++)wa['ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.charCodeAt(ja)]=ja;var ta='function'==typeof ArrayBuffer,Da=function(xa,ya){if('string'!=typeof xa)return{type:'message',data:Pa(xa,ya)};
|
|
646
646
|
var Ja=xa.charAt(0);if('b'===Ja){xa=xa.substring(1);if(ta){var M=.75*xa.length;Ja=xa.length;var e=0;'='===xa[xa.length-1]&&(M--,'='===xa[xa.length-2]&&M--);var b=new ArrayBuffer(M),h=new Uint8Array(b);for(M=0;M<Ja;M+=4){var p=wa[xa.charCodeAt(M)];var x=wa[xa.charCodeAt(M+1)];var u=wa[xa.charCodeAt(M+2)];var A=wa[xa.charCodeAt(M+3)];h[e++]=p<<2|x>>4;h[e++]=(15&x)<<4|u>>2;h[e++]=(3&u)<<6|63&A}ya=Pa(b,ya)}else ya={base64:!0,data:xa};ya={type:'message',data:ya}}else ya=R[Ja]?1<xa.length?{type:R[Ja],data:xa.substring(1)}:
|
|
647
647
|
{type:R[Ja]}:sa;return ya},Pa=function(xa,ya){return'blob'===ya&&xa instanceof ArrayBuffer?new Blob([xa]):xa},La=String.fromCharCode(30);N.prototype.on=N.prototype.addEventListener=function(xa,ya){return this._callbacks=this._callbacks||{},(this._callbacks['$'+xa]=this._callbacks['$'+xa]||[]).push(ya),this};N.prototype.once=function(xa,ya){function Ja(){this.off(xa,Ja);ya.apply(this,arguments)}return Ja.fn=ya,this.on(xa,Ja),this};N.prototype.off=N.prototype.removeListener=N.prototype.removeAllListeners=
|
|
648
648
|
N.prototype.removeEventListener=function(xa,ya){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var Ja,M=this._callbacks['$'+xa];if(!M)return this;if(1==arguments.length)return delete this._callbacks['$'+xa],this;for(var e=0;e<M.length;e++)if((Ja=M[e])===ya||Ja.fn===ya){M.splice(e,1);break}return 0===M.length&&delete this._callbacks['$'+xa],this};N.prototype.emit=function(xa){this._callbacks=this._callbacks||{};for(var ya=Array(arguments.length-1),Ja=this._callbacks['$'+
|
|
649
649
|
xa],M=1;M<arguments.length;M++)ya[M-1]=arguments[M];if(Ja){M=0;for(var e=(Ja=Ja.slice(0)).length;M<e;++M)Ja[M].apply(this,ya)}return this};N.prototype.emitReserved=N.prototype.emit;N.prototype.listeners=function(xa){return this._callbacks=this._callbacks||{},this._callbacks['$'+xa]||[]};N.prototype.hasListeners=function(xa){return!!this.listeners(xa).length};var Fa='undefined'!=typeof self?self:'undefined'!=typeof window?window:Function('return this')(),Oa=setTimeout,Ia=clearTimeout,Ka,Ya=function(xa){function ya(M,
|
|
650
|
-
e,b){var h;return O(this,ya),(h=Ja.call(this,M)).description=e,h.context=b,h.type='TransportError',h}T(ya,xa);var Ja=da(ya);return ya}(S(Error));
|
|
650
|
+
e,b){var h;return O(this,ya),(h=Ja.call(this,M)).description=e,h.context=b,h.type='TransportError',h}T(ya,xa);var Ja=da(ya);return ya}(S(Error));ja=function(xa){function ya(M){var e;return O(this,ya),(e=Ja.call(this)).writable=!1,B(q(e),M),e.opts=M,e.query=M.query,e.readyState='',e.socket=M.socket,e}T(ya,xa);var Ja=da(ya);return Ea(ya,[{key:'onError',value:function(M,e,b){return za(oa(ya.prototype),'emitReserved',this).call(this,'error',new Ya(M,e,b)),this}},{key:'open',value:function(){return'closed'!==
|
|
651
651
|
this.readyState&&''!==this.readyState||(this.readyState='opening',this.doOpen()),this}},{key:'close',value:function(){return'opening'!==this.readyState&&'open'!==this.readyState||(this.doClose(),this.onClose()),this}},{key:'send',value:function(M){'open'===this.readyState&&this.write(M)}},{key:'onOpen',value:function(){this.readyState='open';this.writable=!0;za(oa(ya.prototype),'emitReserved',this).call(this,'open')}},{key:'onData',value:function(M){M=Da(M,this.socket.binaryType);this.onPacket(M)}},
|
|
652
652
|
{key:'onPacket',value:function(M){za(oa(ya.prototype),'emitReserved',this).call(this,'packet',M)}},{key:'onClose',value:function(M){this.readyState='closed';za(oa(ya.prototype),'emitReserved',this).call(this,'close',M)}}]),ya}(N);for(var pb='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'.split(''),$a=0,ib=0;64>ib;ib++);ib=!1;try{ib='undefined'!=typeof XMLHttpRequest&&'withCredentials'in new XMLHttpRequest}catch(xa){}var bc=ib,$b=null!=(new F({xdomain:!1})).responseType;ib=function(xa){function ya(M){var e;
|
|
653
653
|
if(O(this,ya),(e=Ja.call(this,M)).polling=!1,'undefined'!=typeof location){var b='https:'===location.protocol,h=location.port;h||=b?'443':'80';e.xd='undefined'!=typeof location&&M.hostname!==location.hostname||h!==M.port;e.xs=M.secure!==b}M=M&&M.forceBase64;return e.supportsBinary=$b&&!M,e}T(ya,xa);var Ja=da(ya);return Ea(ya,[{key:'doOpen',value:function(){this.poll()}},{key:'pause',value:function(M){var e=this;this.readyState='pausing';var b=function(){e.readyState='paused';M()};if(this.polling||
|
|
654
654
|
!this.writable){var h=0;this.polling&&(h++,this.once('pollComplete',function(){--h||b()}));this.writable||(h++,this.once('drain',function(){--h||b()}))}else b()}},{key:'poll',value:function(){this.polling=!0;this.doPoll();this.emitReserved('poll')}},{key:'onData',value:function(M){var e=this;(function(b,h){b=b.split(La);for(var p=[],x=0;x<b.length;x++){var u=Da(b[x],h);if(p.push(u),'error'===u.type)break}return p})(M,this.socket.binaryType).forEach(function(b){if('opening'===e.readyState&&'open'===
|
|
655
|
-
b.type&&e.onOpen(),'close'===b.type)return e.onClose({description:'transport closed by the server'}),!1;e.onPacket(b)});'closed'!==this.readyState&&(this.polling=!1,this.emitReserved('pollComplete'),'open'===this.readyState&&this.poll())}},{key:'doClose',value:function(){var M=this,e=function(){M.write([{type:'close'}])};'open'===this.readyState?e():this.once('open',e)}},{key:'write',value:function(M){var e=this;this.writable=!1;(function(b,h){var p=b.length,x=Array(p),u=0;b.forEach(function(A,
|
|
656
|
-
!1,function(P){x[
|
|
655
|
+
b.type&&e.onOpen(),'close'===b.type)return e.onClose({description:'transport closed by the server'}),!1;e.onPacket(b)});'closed'!==this.readyState&&(this.polling=!1,this.emitReserved('pollComplete'),'open'===this.readyState&&this.poll())}},{key:'doClose',value:function(){var M=this,e=function(){M.write([{type:'close'}])};'open'===this.readyState?e():this.once('open',e)}},{key:'write',value:function(M){var e=this;this.writable=!1;(function(b,h){var p=b.length,x=Array(p),u=0;b.forEach(function(A,V){ha(A,
|
|
656
|
+
!1,function(P){x[V]=P;++u===p&&h(x.join(La))})})})(M,function(b){e.doWrite(b,function(){e.writable=!0;e.emitReserved('drain')})})}},{key:'uri',value:function(){var M=this.query||{},e=this.opts.secure?'https':'http',b='';!1!==this.opts.timestampRequests&&(M[this.opts.timestampParam]=m());this.supportsBinary||M.sid||(M.b64=1);this.opts.port&&('https'===e&&443!==Number(this.opts.port)||'http'===e&&80!==Number(this.opts.port))&&(b=':'+this.opts.port);M=z(M);return e+'://'+(-1!==this.opts.hostname.indexOf(':')?
|
|
657
657
|
'['+this.opts.hostname+']':this.opts.hostname)+b+this.opts.path+(M.length?'?'+M:'')}},{key:'request',value:function(){var M=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return K(M,{xd:this.xd,xs:this.xs},this.opts),new fb(this.uri(),M)}},{key:'doWrite',value:function(M,e){var b=this;M=this.request({method:'POST',data:M});M.on('success',e);M.on('error',function(h,p){b.onError('xhr post error',h,p)})}},{key:'doPoll',value:function(){var M=this,e=this.request();e.on('data',this.onData.bind(this));
|
|
658
|
-
e.on('error',function(b,h){M.onError('xhr poll error',b,h)});this.pollXhr=e}},{key:'name',get:function(){return'polling'}}]),ya}(
|
|
658
|
+
e.on('error',function(b,h){M.onError('xhr poll error',b,h)});this.pollXhr=e}},{key:'name',get:function(){return'polling'}}]),ya}(ja);var fb=function(xa){function ya(M,e){var b;return O(this,ya),B(q(b=Ja.call(this)),e),b.opts=e,b.method=e.method||'GET',b.uri=M,b.async=!1!==e.async,b.data=void 0!==e.data?e.data:null,b.create(),b}T(ya,xa);var Ja=da(ya);return Ea(ya,[{key:'create',value:function(){var M=this,e=L(this.opts,'agent','pfx','key','passphrase','cert','ca','ciphers','rejectUnauthorized','autoUnref');
|
|
659
659
|
e.xdomain=!!this.opts.xd;e.xscheme=!!this.opts.xs;var b=this.xhr=new F(e);try{b.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders)for(var h in b.setDisableHeaderCheck&&b.setDisableHeaderCheck(!0),this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(h)&&b.setRequestHeader(h,this.opts.extraHeaders[h])}catch(p){}if('POST'===this.method)try{b.setRequestHeader('Content-type','text/plain;charset=UTF-8')}catch(p){}try{b.setRequestHeader('Accept','*/*')}catch(p){}'withCredentials'in
|
|
660
660
|
b&&(b.withCredentials=this.opts.withCredentials);this.opts.requestTimeout&&(b.timeout=this.opts.requestTimeout);b.onreadystatechange=function(){4===b.readyState&&(200===b.status||1223===b.status?M.onLoad():M.setTimeoutFn(function(){M.onError('number'==typeof b.status?b.status:0)},0))};b.send(this.data)}catch(p){return void this.setTimeoutFn(function(){M.onError(p)},0)}'undefined'!=typeof document&&(this.index=ya.requestsCount++,ya.requests[this.index]=this)}},{key:'onError',value:function(M){this.emitReserved('error',
|
|
661
661
|
M,this.xhr);this.cleanup(!0)}},{key:'cleanup',value:function(M){if(void 0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=r,M)try{this.xhr.abort()}catch(e){}'undefined'!=typeof document&&delete ya.requests[this.index];this.xhr=null}}},{key:'onLoad',value:function(){var M=this.xhr.responseText;null!==M&&(this.emitReserved('data',M),this.emitReserved('success'),this.cleanup())}},{key:'abort',value:function(){this.cleanup()}}]),ya}(N);if(fb.requestsCount=0,fb.requests={},'undefined'!=typeof document)'function'==
|
|
@@ -663,15 +663,15 @@ typeof attachEvent?attachEvent('onunload',v):'function'==typeof addEventListener
|
|
|
663
663
|
ya),(e=Ja.call(this,M)).supportsBinary=!M.forceBase64,e}T(ya,xa);var Ja=da(ya);return Ea(ya,[{key:'doOpen',value:function(){if(this.check()){var M=this.uri(),e=this.opts.protocols,b=Gb?{}:L(this.opts,'agent','perMessageDeflate','pfx','key','passphrase','cert','ca','ciphers','rejectUnauthorized','localAddress','protocolVersion','origin','maxPayload','family','checkServerIdentity');this.opts.extraHeaders&&(b.headers=this.opts.extraHeaders);try{this.ws=Gb?new yb(M,e,b):e?new yb(M,e):new yb(M)}catch(h){return this.emitReserved('error',
|
|
664
664
|
h)}this.ws.binaryType=this.socket.binaryType||'arraybuffer';this.addEventListeners()}}},{key:'addEventListeners',value:function(){var M=this;this.ws.onopen=function(){M.opts.autoUnref&&M.ws._socket.unref();M.onOpen()};this.ws.onclose=function(e){return M.onClose({description:'websocket connection closed',context:e})};this.ws.onmessage=function(e){return M.onData(e.data)};this.ws.onerror=function(e){return M.onError('websocket error',e)}}},{key:'write',value:function(M){var e=this;this.writable=!1;
|
|
665
665
|
for(var b=function(p){var x=p===M.length-1;ha(M[p],e.supportsBinary,function(u){try{e.ws.send(u)}catch(A){}x&&Cb(function(){e.writable=!0;e.emitReserved('drain')},e.setTimeoutFn)})},h=0;h<M.length;h++)b(h)}},{key:'doClose',value:function(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}},{key:'uri',value:function(){var M=this.query||{},e=this.opts.secure?'wss':'ws',b='';this.opts.port&&('wss'===e&&443!==Number(this.opts.port)||'ws'===e&&80!==Number(this.opts.port))&&(b=':'+this.opts.port);this.opts.timestampRequests&&
|
|
666
|
-
(M[this.opts.timestampParam]=m());this.supportsBinary||(M.b64=1);M=z(M);return e+'://'+(-1!==this.opts.hostname.indexOf(':')?'['+this.opts.hostname+']':this.opts.hostname)+b+this.opts.path+(M.length?'?'+M:'')}},{key:'check',value:function(){return!!yb}},{key:'name',get:function(){return'websocket'}}]),ya}(
|
|
666
|
+
(M[this.opts.timestampParam]=m());this.supportsBinary||(M.b64=1);M=z(M);return e+'://'+(-1!==this.opts.hostname.indexOf(':')?'['+this.opts.hostname+']':this.opts.hostname)+b+this.opts.path+(M.length?'?'+M:'')}},{key:'check',value:function(){return!!yb}},{key:'name',get:function(){return'websocket'}}]),ya}(ja),polling:ib},db=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,
|
|
667
667
|
Eb='source protocol authority userInfo user password host port relative path directory file query anchor'.split(' '),Pb=function(xa){function ya(M){var e,b=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return O(this,ya),e=Ja.call(this),M&&'object'===D(M)&&(b=M,M=null),M?(M=E(M),b.hostname=M.host,b.secure='https'===M.protocol||'wss'===M.protocol,b.port=M.port,M.query&&(b.query=M.query)):b.host&&(b.hostname=E(b.host).host),B(q(e),b),e.secure=null!=b.secure?b.secure:'undefined'!=typeof location&&
|
|
668
668
|
'https:'===location.protocol,b.hostname&&!b.port&&(b.port=e.secure?'443':'80'),e.hostname=b.hostname||('undefined'!=typeof location?location.hostname:'localhost'),e.port=b.port||('undefined'!=typeof location&&location.port?location.port:e.secure?'443':'80'),e.transports=b.transports||['polling','websocket'],e.readyState='',e.writeBuffer=[],e.prevBufferLen=0,e.opts=K({path:'/engine.io',agent:!1,withCredentials:!1,upgrade:!0,timestampParam:'t',rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},
|
|
669
669
|
transportOptions:{},closeOnBeforeunload:!0},b),e.opts.path=e.opts.path.replace(/\/$/,'')+'/','string'==typeof e.opts.query&&(e.opts.query=y(e.opts.query)),e.id=null,e.upgrades=null,e.pingInterval=null,e.pingTimeout=null,e.pingTimeoutTimer=null,'function'==typeof addEventListener&&(e.opts.closeOnBeforeunload&&addEventListener('beforeunload',function(){e.transport&&(e.transport.removeAllListeners(),e.transport.close())},!1),'localhost'!==e.hostname&&(e.offlineEventListener=function(){e.onClose('transport close',
|
|
670
670
|
{description:'network connection lost'})},addEventListener('offline',e.offlineEventListener,!1))),e.open(),e}T(ya,xa);var Ja=da(ya);return Ea(ya,[{key:'createTransport',value:function(M){var e=K({},this.opts.query);e.EIO=4;e.transport=M;this.id&&(e.sid=this.id);e=K({},this.opts.transportOptions[M],this.opts,{query:e,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new Na[M](e)}},{key:'open',value:function(){var M=this;if(this.opts.rememberUpgrade&&ya.priorWebsocketSuccess&&
|
|
671
671
|
-1!==this.transports.indexOf('websocket'))var e='websocket';else{if(0===this.transports.length)return void this.setTimeoutFn(function(){M.emitReserved('error','No transports available')},0);e=this.transports[0]}this.readyState='opening';try{e=this.createTransport(e)}catch(b){return this.transports.shift(),void this.open()}e.open();this.setTransport(e)}},{key:'setTransport',value:function(M){var e=this;this.transport&&this.transport.removeAllListeners();this.transport=M;M.on('drain',this.onDrain.bind(this)).on('packet',
|
|
672
|
-
this.onPacket.bind(this)).on('error',this.onError.bind(this)).on('close',function(b){return e.onClose('transport close',b)})}},{key:'probe',value:function(M){function e(){A||(A=!0,aa(),u.close(),u=null)}function b(){P('transport closed')}function h(){P('socket closed')}function p(Q){u&&Q.name!==u.name&&e()}var x=this,u=this.createTransport(M),A=!1;ya.priorWebsocketSuccess=!1;var
|
|
673
|
-
!0,x.emitReserved('upgrading',u),u)ya.priorWebsocketSuccess='websocket'===u.name,x.transport.pause(function(){A||'closed'!==x.readyState&&(aa(),x.setTransport(u),u.send([{type:'upgrade'}]),x.emitReserved('upgrade',u),u=null,x.upgrading=!1,x.flush())})}else Q=Error('probe error'),Q.transport=u.name,x.emitReserved('upgradeError',Q)}))},P=function(Q){Q=Error('probe error: '+Q);Q.transport=u.name;e();x.emitReserved('upgradeError',Q)},aa=function(){u.removeListener('open',
|
|
674
|
-
u.removeListener('close',b);x.off('close',h);x.off('upgrading',p)};u.once('open',
|
|
672
|
+
this.onPacket.bind(this)).on('error',this.onError.bind(this)).on('close',function(b){return e.onClose('transport close',b)})}},{key:'probe',value:function(M){function e(){A||(A=!0,aa(),u.close(),u=null)}function b(){P('transport closed')}function h(){P('socket closed')}function p(Q){u&&Q.name!==u.name&&e()}var x=this,u=this.createTransport(M),A=!1;ya.priorWebsocketSuccess=!1;var V=function(){A||(u.send([{type:'ping',data:'probe'}]),u.once('packet',function(Q){if(!A)if('pong'===Q.type&&'probe'===Q.data){if(x.upgrading=
|
|
673
|
+
!0,x.emitReserved('upgrading',u),u)ya.priorWebsocketSuccess='websocket'===u.name,x.transport.pause(function(){A||'closed'!==x.readyState&&(aa(),x.setTransport(u),u.send([{type:'upgrade'}]),x.emitReserved('upgrade',u),u=null,x.upgrading=!1,x.flush())})}else Q=Error('probe error'),Q.transport=u.name,x.emitReserved('upgradeError',Q)}))},P=function(Q){Q=Error('probe error: '+Q);Q.transport=u.name;e();x.emitReserved('upgradeError',Q)},aa=function(){u.removeListener('open',V);u.removeListener('error',P);
|
|
674
|
+
u.removeListener('close',b);x.off('close',h);x.off('upgrading',p)};u.once('open',V);u.once('error',P);u.once('close',b);this.once('close',h);this.once('upgrading',p);u.open()}},{key:'onOpen',value:function(){if(this.readyState='open',ya.priorWebsocketSuccess='websocket'===this.transport.name,this.emitReserved('open'),this.flush(),'open'===this.readyState&&this.opts.upgrade&&this.transport.pause)for(var M=0,e=this.upgrades.length;M<e;M++)this.probe(this.upgrades[M])}},{key:'onPacket',value:function(M){if('opening'===
|
|
675
675
|
this.readyState||'open'===this.readyState||'closing'===this.readyState)switch(this.emitReserved('packet',M),this.emitReserved('heartbeat'),M.type){case 'open':this.onHandshake(JSON.parse(M.data));break;case 'ping':this.resetPingTimeout();this.sendPacket('pong');this.emitReserved('ping');this.emitReserved('pong');break;case 'error':var e=Error('server error');e.code=M.data;this.onError(e);break;case 'message':this.emitReserved('data',M.data),this.emitReserved('message',M.data)}}},{key:'onHandshake',
|
|
676
676
|
value:function(M){this.emitReserved('handshake',M);this.id=M.sid;this.transport.query.sid=M.sid;this.upgrades=this.filterUpgrades(M.upgrades);this.pingInterval=M.pingInterval;this.pingTimeout=M.pingTimeout;this.maxPayload=M.maxPayload;this.onOpen();'closed'!==this.readyState&&this.resetPingTimeout()}},{key:'resetPingTimeout',value:function(){var M=this;this.clearTimeoutFn(this.pingTimeoutTimer);this.pingTimeoutTimer=this.setTimeoutFn(function(){M.onClose('ping timeout')},this.pingInterval+this.pingTimeout);
|
|
677
677
|
this.opts.autoUnref&&this.pingTimeoutTimer.unref()}},{key:'onDrain',value:function(){this.writeBuffer.splice(0,this.prevBufferLen);this.prevBufferLen=0;0===this.writeBuffer.length?this.emitReserved('drain'):this.flush()}},{key:'flush',value:function(){if('closed'!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){var M=this.getWritablePackets();this.transport.send(M);this.prevBufferLen=M.length;this.emitReserved('flush')}}},{key:'getWritablePackets',value:function(){if(!(this.maxPayload&&
|
|
@@ -701,49 +701,50 @@ typeof m&&(m=n.target);var y,F=null;m=m.getElementsByTagName('a');for(var r=0,v=
|
|
|
701
701
|
(F=y.getAttribute('onclick'));F?'undefined'==typeof F||/return false/.test(F)||(F=/;$/.test(F)?F+'return false;':F+'; return false;',y.setAttribute('onclick',F)):y.setAttribute('onclick','return false;');'undefined'==typeof n.$links[E.id]&&(E.target=y,y=K(E,S),Y(y,z))}};new ca(function(m,z){if(m)throw m;Ea=z});return function(m){n.bindLinks=H;n.request=oa;n.getLinkById=L;n.getLinkByUrl=B;n.on('init',function(z){if(window.XMLHttpRequest)q=new XMLHttpRequest;else if(window.ActiveXObject)try{q=new ActiveXObject('Msxml2.XMLHTTP')}catch(y){try{q=
|
|
702
702
|
new ActiveXObject('Microsoft.XMLHTTP')}catch(F){}}evt='click';addListener(gina,n.target,evt,function(y){'undefined'==typeof y.target.id&&(y.target.setAttribute('id',evt+'.'+O.v4()),y.target.id=y.target.getAttribute('id'));if(/^link\.click\./.test(y.target.id)){cancelEvent(y);var F=y.target.id;(new RegExp('^link.click.gina-link-'+n.id)).test(F)&&triggerEvent(gina,y.target,F,y.detail)}});'undefined'==typeof m&&(m={});n.options=m;H(n.target,m);gina.linkIsBinded=!0;n.isReady=!0;gina.hasLinkHandler=!0;
|
|
703
703
|
gina.link=K(gina.link,n);triggerEvent(gina,n.target,'ready.'+n.id,n)});n.initialized=!0;return n}(T)}});
|
|
704
|
-
define('gina/popin','require vendor/uuid jquery lib/domain lib/merge utils/events'.split(' '),function(D){D('jquery').noConflict();var O=D('vendor/uuid'),ca=D('lib/domain'),Ea=null,K=D('lib/merge');D('utils/events');return function(T){function oa(){var
|
|
705
|
-
ha){var ea=
|
|
704
|
+
define('gina/popin','require vendor/uuid jquery lib/domain lib/merge utils/events'.split(' '),function(D){D('jquery').noConflict();var O=D('vendor/uuid'),ca=D('lib/domain'),Ea=null,K=D('lib/merge');D('utils/events');return function(T){function oa(){var W=null,ha;for(ha in gina.popin.$popins)if('undefined'!=typeof gina.popin.$popins[ha].isOpen&&gina.popin.$popins[ha].isOpen){W=gina.popin.$popins[ha];break}!W&&gina.popin.activePopinId&&(W=gina.popin.$popins[gina.popin.activePopinId]);return W}function Y(W,
|
|
705
|
+
ha){var ea=W.target,wa=W.type;'undefined'!=typeof W.detail&&'function'==typeof W.detail.trim&&(ea.innerHTML=W.detail.trim());W=function(fb,Cb,yb){var Gb=yb.getAttribute('data-gina-popin-is-link');Gb=/^true$/i.test(Gb)?!0:!1;'link'!=fb||Gb||(fb='action');addListener(gina,yb,Cb,function(Na){cancelEvent(Na);if('close'!=fb){var db=!1,Eb='loaded.'+ha.id;'undefined'==typeof gina.events[Eb]&&addListener(gina,ea,Eb,function(Pb){Pb.preventDefault();db||(db=!0,S(Pb.detail))});Eb={isSynchrone:!1,withCredentials:!1};
|
|
706
706
|
Eb=K(ha.options,Eb);n(ha.name,yb.href,Eb)}removeListener(gina,Na.target,Na.type)});addListener(gina,yb,'click',function(Na){cancelEvent(Na);if(null!=Na.target.getAttribute('disabled')&&'false'!=Na.target.getAttribute('disabled'))return!1;if('link'==fb){var db=Na.target.getAttribute('href')||null,Eb=Na.target.getAttribute('target');null!=Eb&&''!=Eb?window.open(db,Eb):triggerEvent(gina,Na.target,Na.currentTarget.id,ha)}else'undefined'==typeof Na.target.id&&(Na.target.setAttribute('id',Cb+'.'+O.v4()),
|
|
707
|
-
Na.target.id=Na.target.getAttribute('id')),/^popin\.close\./.test(Na.target.id)&&(cancelEvent(Na),ha.isRedirecting=!1,L(ha.name)),/^popin\.click\./.test(Na.target.id)&&(cancelEvent(Na),db=Na.target.id,(new RegExp('^popin.click.gina-popin-'+m.id)).test(db)&&triggerEvent(gina,Na.target,db,Na.detail))})};gina.popinIsBinded=!0;var
|
|
708
|
-
Pa,'mousedown',function(fb){if(/gina-popin-is-active/.test(fb.target.className)){removeListener(gina,fb.target,'mousedown');fb=[];
|
|
709
|
-
(fb[
|
|
710
|
-
Cb,db+'.'+yb)}}ha.isRedirecting=!1;L(ha.name)}})}/<form/i.test(ea.innerHTML)&&'undefined'!=typeof y&&y&&(ha.hasForm=!0);var La=[],Fa=[];Pa=[];Fa=ea.getElementsByTagName('button');ta=
|
|
711
|
-
Da;++ta)/gina-popin-close/.test(Fa[ta].className)?(La[
|
|
712
|
-
'return false;'),La[ta].id?Fa=La[ta].id:(Fa='popin.close.'+O.v4(),La[ta].id=Fa,La[ta].setAttribute('id',Fa)),'undefined'!=typeof gina.events[Fa]&&gina.events[Fa]==La[ta].id||
|
|
713
|
-
Fa=Pa[
|
|
714
|
-
Pa[
|
|
715
|
-
'?inheritedData='+
|
|
716
|
-
ha.target,wa)}function U(
|
|
717
|
-
typeof ea.error&&(ea=
|
|
718
|
-
if(gina&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&ea)try{'undefined'!=typeof ea.value&&ea.value&&(ea=JSON.parse(decodeURIComponent(ea.value)),ea.isXHRViewData=!0,ginaToolbar.update('data-xhr',ea))}catch(
|
|
719
|
-
typeof
|
|
720
|
-
wa.options.class+' '+
|
|
721
|
-
'//'+window.location.host)).test(ha)&&(
|
|
722
|
-
ea.isSynchrone):F.open(ea.method,ea.url):'undefined'!=typeof XDomainRequest?(F=new XDomainRequest,F.open(ea.method,ea.url)):(F=null,Pa='CORS not supported: the server is missing the header `"Access-Control-Allow-Credentials": true` ',triggerEvent(gina,ta,'error.'+
|
|
723
|
-
La=!0;m.eventData.error=Pa+'\n'+Ia;U(Pa,La);triggerEvent(gina,ta,'error.'+
|
|
724
|
-
'undefined'!=typeof Oa.location||Ka&&'undefined'!=typeof Oa.reload){Ia=!1;'undefined'!=typeof Oa.isXhrRedirect&&/^true$/i.test(Oa.isXhrRedirect)&&(Ia=!0);if('undefined'!=typeof Oa.location&&Ia){if('undefined'!=typeof Oa.popin&&'undefined'!=typeof Oa.popin.close){wa.isRedirecting=!1;
|
|
725
|
-
null,Ka='undefined'!=typeof Oa.popin?Oa.popin.location||Oa.popin.url:Oa.location,wa.load(wa.name,Ka,wa.options),setTimeout(function($a){$a.isOpen||$a.open()},50,wa);window.open(Oa.location,Ka);return}if('undefined'!=typeof Oa.location){document.location=Oa.location;
|
|
726
|
-
|
|
727
|
-
La=!0),m.eventData.error=Oa,GINA_ENV_IS_DEV&&U(Oa,La),triggerEvent(gina,ta,'error.'+
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
wa=
|
|
731
|
-
'').replace(La,''),-1<
|
|
732
|
-
typeof
|
|
733
|
-
typeof ha?ha:!1,null!=
|
|
734
|
-
|
|
735
|
-
ha.isOpen=!1;gina.popinIsBinded=!1;GINA_ENV_IS_DEV&&gina&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&ginaToolbar.restore();m.activePopinId=null;if(0<ha.$headers.length){
|
|
736
|
-
registerEvents(this.plugin,B);var H={options:{name:void 0,'class':'gina-popin-default',useDialogMode:!0,cancelOnOverlayClick:!1},authorizedEvents:['ready','error'],events:{}},m={plugin:this.plugin,id:'gina-popins-'+O.v4(),on,eventData:{},$popins:{},activePopinId:null,getActivePopin:null,target:document,
|
|
737
|
-
y=null,F=null,r=[],v=function(){var
|
|
738
|
-
ha,ea)})},I=function(
|
|
739
|
-
typeof ea.getAttribute('data-gina-popin-url')||(
|
|
740
|
-
|
|
741
|
-
'false'!=Fa.target.getAttribute('disabled'))return!1;'undefined'==typeof Fa.target.id&&(Fa.target.setAttribute('id',ta+'.'+O.v4()),Fa.target.id=Fa.target.getAttribute('id'));if(/^popin\.close\./.test(Fa.target.id)){cancelEvent(Fa);var Oa=Fa.target.id;triggerEvent(gina,Fa.target,Oa,Fa.detail)}/^popin\.click\./.test(Fa.target.id)&&
|
|
742
|
-
isSynchrone:!1,withCredentials:!0,headers:{'X-Requested-With':'XMLHttpRequest'}};gina.hasPopinHandler?(m.target=document.getElementById(gina.popinContainer),m.on=on):v();new ca(function(
|
|
743
|
-
ea.options=K(
|
|
744
|
-
ea.name=ea.options.name;ea.target=m.target;ea.load=n;ea.loadContent=S;ea.open=za;ea.close=L;GINA_ENV_IS_DEV&&(ea.updateToolbar=U);ea.parentScripts=[];ea.parentStyles=[];var wa=gina.config.hostname.replace(/(https|http|):\/\//,'').replace(/:\d+$/,'');wa=new RegExp(wa+':\\d+|'+wa);var
|
|
745
|
-
for(let Da=0,Pa=
|
|
746
|
-
m.id,ha)});m.initialized=!0;return m}(T)}});function fadeIn(D){var O=.1;D.style.display='block';var ca=setInterval(function(){1<=O&&clearInterval(ca);D.style.opacity=O;D.style.filter='alpha(opacity='+100*O+')';O+=.1*O},10)}
|
|
707
|
+
Na.target.id=Na.target.getAttribute('id')),/^popin\.close\./.test(Na.target.id)&&(cancelEvent(Na),ha.isRedirecting=!1,L(ha.name)),/^popin\.click\./.test(Na.target.id)&&(cancelEvent(Na),db=Na.target.id,(new RegExp('^popin.click.gina-popin-'+m.id)).test(db)&&triggerEvent(gina,Na.target,db,Na.detail))})};gina.popinIsBinded=!0;var ja=null,ta=null,Da=null;if(!ha.isOpen&&H.options.cancelOnOverlayClick){var Pa=ha.target;if(!H.options.useDialogMode||gina.config.envIsDev)Pa=m.target.childNodes[0];addListener(gina,
|
|
708
|
+
Pa,'mousedown',function(fb){if(/gina-popin-is-active/.test(fb.target.className)){removeListener(gina,fb.target,'mousedown');fb=[];ja=0;var Cb=ea.getElementsByTagName('button');ta=0;Da=Cb.length;if(0<Da)for(;ta<Da;++ta)/gina-popin-close/.test(Cb[ta].className)&&(fb[ja]=Cb[ta],++ja);Cb=ea.getElementsByTagName('div');ta=0;Da=Cb.length;if(0<Da)for(;ta<Da;++ta)/gina-popin-close/.test(Cb[ta].className)&&(fb[ja]=Cb[ta],++ja);Cb=ea.getElementsByTagName('a');ta=0;Da=Cb.length;if(0<Da)for(;ta<Da;++ta)/gina-popin-close/.test(Cb[ta].className)&&
|
|
709
|
+
(fb[ja]=Cb[ta],++ja);ta=0;for(Da=fb.length;ta<Da;++ta){Cb=fb[ta];let yb=Cb.getAttribute('id');for(let Gb=0,Na=B.length;Gb<Na;Gb++){let db=B[Gb];'undefined'!=typeof gina.events[db]&&gina.events[db]==yb&&removeListener(gina,Cb,db);'undefined'!=typeof gina.events[yb]&&gina.events[yb]==yb&&removeListener(gina,Cb,yb);'undefined'!=typeof gina.events[db+'.'+yb]&&gina.events[db+'.'+yb]==yb&&removeListener(gina,Cb,db+'.'+yb);'undefined'!=typeof gina.events[db+'.'+yb]&&gina.events[db+'.'+yb]==db+'.'+yb&&removeListener(gina,
|
|
710
|
+
Cb,db+'.'+yb)}}ha.isRedirecting=!1;L(ha.name)}})}/<form/i.test(ea.innerHTML)&&'undefined'!=typeof y&&y&&(ha.hasForm=!0);var La=[],Fa=[];Pa=[];Fa=ea.getElementsByTagName('button');ta=ja=0;Da=Fa.length;if(0<Fa.length)for(;ta<Da;++ta)/gina-popin-close/.test(Fa[ta].className)&&(La[ja]=Fa[ta],++ja);Fa=ea.getElementsByTagName('div');ta=0;Da=Fa.length;if(0<Da)for(;ta<Da;++ta)/gina-popin-close/.test(Fa[ta].className)&&(La[ja]=Fa[ta],++ja);Fa=ea.getElementsByTagName('a');ta=0;Da=Fa.length;if(0<Da)for(;ta<
|
|
711
|
+
Da;++ta)/gina-popin-close/.test(Fa[ta].className)?(La[ja]=Fa[ta],++ja):('undefined'==typeof Fa[ta]||/(#|#.*)$/.test(Fa[ta].href)||Fa[ta].id)&&('undefined'==typeof Fa[ta]||/(#|#.*)$/.test(Fa[ta].href)||/^(click\.|popin\.link)/.test(Fa[ta].id))||Pa.push(Fa[ta]);var Oa=null;Fa=null;ta=0;for(Da=La.length;ta<Da;++ta)'A'==La[ta].tagName&&(Oa=La[ta].getAttribute('onclick')),Oa?'undefined'==typeof Oa||/return false/.test(Oa)||(Oa=/;$/.test(Oa)?Oa+'return false;':Oa+'; return false;'):La[ta].setAttribute('onclick',
|
|
712
|
+
'return false;'),La[ta].id?Fa=La[ta].id:(Fa='popin.close.'+O.v4(),La[ta].id=Fa,La[ta].setAttribute('id',Fa)),'undefined'!=typeof gina.events[Fa]&&gina.events[Fa]==La[ta].id||W('close',Fa,La[ta]);ja=0;Da=Pa.length;var Ia=null,Ka=null,Ya=null,pb={},$a=null,ib=new DOMParser,bc=null,$b=null;for(Fa=La=La=null;ja<Da;++ja)null==Pa[ja].getAttribute('disabled')&&(Pa[ja].id=/^null$/i.test(Pa[ja].getAttribute('id'))?null:Pa[ja].getAttribute('id'),Pa[ja].id&&/^popin\.link/.test(Pa[ja].id)&&/^popin\.click/.test(Pa[ja].id)?
|
|
713
|
+
Fa=Pa[ja].id:(Fa=!0,La=Pa[ja].getAttribute('href'),La&&''!=La&&'#'!=La||('#'!=La&&Pa[ja].setAttribute('href','#'),Fa=!1),/^null$/i.test(Pa[ja].id)?Fa?(Fa='popin.link.'+O.v4(),Pa[ja].setAttribute('data-gina-popin-is-link',!0)):(Fa='popin.click.'+O.v4(),Pa[ja].setAttribute('data-gina-popin-is-link',!1)):Fa=Pa[ja].id,Pa[ja].id=Fa,Pa[ja].setAttribute('id',Fa)),La=(La=Pa[ja].getAttribute('data-gina-form-submit'))&&/^true$/i.test(La)?!0:!1,La||(/^(null|\s*)$/.test(Pa[ja].getAttribute('href'))||addListener(gina,
|
|
714
|
+
Pa[ja],'click',function(fb){fb.preventDefault();ha.isRedirecting=!0;if(ha.hasForm){Ia=ha.target.getElementsByTagName('FORM');Ka=0;for(Ya=Ia.length;Ka<Ya;++Ka)if(bc=fb.currentTarget.id,$b=ib.parseFromString(Ia.item(Ka).innerHTML,'text/html').getElementById(bc)||!1)$a=Ia[Ka].getAttribute('data-gina-form-inherits-data')||null,pb=K(pb,JSON.parse(decodeURIComponent($a)));0<pb.count()&&(/\?/.test(fb.currentTarget.href)?fb.currentTarget.href+='&inheritedData='+encodeRFC5987ValueChars(JSON.stringify(pb)):
|
|
715
|
+
fb.currentTarget.href+='?inheritedData='+encodeRFC5987ValueChars(JSON.stringify(pb)))}}),'undefined'!=typeof gina.events[Fa]&&gina.events[Fa]==Pa[ja].id||W('link',Fa,Pa[ja])));if(ha.hasForm)for(W=null,Pa=ea.getElementsByTagName('form'),ja=0,Da=Pa.length;ja<Da;++ja)Pa[ja].id&&'string'==typeof Pa[ja]?W=Pa[ja].id:(W=Pa[ja].getAttribute('id')||'form.'+O.v4(),Pa[ja].setAttribute('id',W),Pa[ja].id=W),0>ha.$forms.indexOf(W)&&ha.$forms.push(W),Pa[ja].close=L,y.isPopinContext=!0,y.validateFormById(Pa[ja].getAttribute('id')),
|
|
716
|
+
removeListener(gina,ha.target,wa)}function U(W,ha){var ea=oa();if(gina&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&'undefined'!=typeof W&&'undefined'!=typeof ha&&W){ea=W;try{var wa=null;!ha&&ea.error&&/^(\{|\[)/.test(ea.error)&&(ea.error=JSON.parse(ea.error));if('undefined'!=typeof ea.error&&'object'==typeof ea.error&&'object'==typeof ea.error){wa={status:ea.status};for(xErr in ea.error)/^error$/.test(xErr)||(wa[xErr]=ea.error[xErr]);wa.error=ea.error.error;ea=wa}else'undefined'!=
|
|
717
|
+
typeof ea.error&&'string'==typeof ea.error&&(ea=W);ea.isXHRViewData=!0;ginaToolbar.update('data-xhr',ea);return}catch(ja){throw ja;}}try{ea=I(m.activePopinId)}catch(ja){ea&&ginaToolbar.update('data-xhr',ja)}ea||(new DOMParser).parseFromString(W,'text/html').getElementsByClassName('popin')[0]||(new DOMParser).parseFromString(W,'text/html').getElementsByTagName('div');ea='string'==typeof W&&/<(.*)>/.test(W)?(new DOMParser).parseFromString(W,'text/html').getElementById('gina-without-layout-xhr-data'):
|
|
718
|
+
document.getElementById('gina-without-layout-xhr-data');if(gina&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&ea)try{'undefined'!=typeof ea.value&&ea.value&&(ea=JSON.parse(decodeURIComponent(ea.value)),ea.isXHRViewData=!0,ginaToolbar.update('data-xhr',ea))}catch(ja){throw ja;}W='string'==typeof W&&/<(.*)>/.test(W)?(new DOMParser).parseFromString(W,'text/html').getElementById('gina-without-layout-xhr-view'):document.getElementById('gina-without-layout-xhr-view');if(gina&&'undefined'!=
|
|
719
|
+
typeof window.ginaToolbar&&window.ginaToolbar&&W)try{'undefined'!=typeof W.value&&W.value&&(W=JSON.parse(decodeURIComponent(W.value)),ginaToolbar.update('view-xhr',W))}catch(ja){throw ja;}}function n(W,ha,ea){if('undefined'==typeof W){if('undefined'==typeof this.name)throw Error('`$popin.name` needs to be defined !');W=this.name}else'undefined'==typeof this.name&&'undefined'!=W&&(this.name=W);var wa=R(W),ja=wa.id;gina.popin.activePopinId||(gina.popin.activePopinId=ja);var ta=document.getElementById(ja)||
|
|
720
|
+
null;if(null==ta){var Da=null;H.options.useDialogMode?(Da=wa.options.class+' '+ja,ta=document.createElement('dialog'),ta.setAttribute('id',ja),ta.setAttribute('class',Da),ta.setAttribute('data-type','modal'),ta.setAttribute('aria-labelledby',W),($overlay=document.getElementById('gina-popins-overlay'))?$overlay.appendChild(ta):m.target.appendChild(ta)):(Da=wa.options.class+' '+ja,ta=document.createElement('div'),ta.setAttribute('id',ja),ta.setAttribute('class',Da),m.target.firstChild.appendChild(ta))}'undefined'==
|
|
721
|
+
typeof ea?ea=Ga:(W=Ga.withCredentials,ea=K(ea,Ga),ea.withCredentials=W);/^(http|https):/.test(ha)&&!(new RegExp('^'+window.location.protocol+'//'+window.location.host)).test(ha)&&(W=Ea.getRootDomain(window.location.hostname).value,Da=Ea.getRootDomain(ha).value,W=W===Da?!0:!1,gina.config.envIsDev&&(console.debug('Checking CORS from Popin plugin...TODO - local CORS Proxy'),console.debug('Is request from same domain ? ',W)),W||(ha=ha.match(/^(https|http):/)[0]+'//corsacme.herokuapp.com/?'+ha,ea.withCredentials=
|
|
722
|
+
!1));ea.url=ha;wa.options=K(ea,wa.options);var Pa=null;ea.withCredentials?'withCredentials'in F?ea.isSynchrone?F.open(ea.method,ea.url,ea.isSynchrone):F.open(ea.method,ea.url):'undefined'!=typeof XDomainRequest?(F=new XDomainRequest,F.open(ea.method,ea.url)):(F=null,Pa='CORS not supported: the server is missing the header `"Access-Control-Allow-Credentials": true` ',triggerEvent(gina,ta,'error.'+ja,Pa)):ea.isSynchrone?F.open(ea.method,ea.url,ea.isSynchrone):F.open(ea.method,ea.url);var La=!1;if(F){F.withCredentials=
|
|
723
|
+
'undefined'!=typeof ea.withCredentials?ea.withCredentials:!1;F.onerror=function(Oa,Ia){Pa={status:F.status,error:'Transaction error: might be due to the server CORS settings.\nPlease, check the console for more details.'};La=!0;m.eventData.error=Pa+'\n'+Ia;U(Pa,La);triggerEvent(gina,ta,'error.'+ja,Pa)};for(var Fa in ea.headers)F.setRequestHeader(Fa,ea.headers[Fa]);F.onreadystatechange=function(Oa){if(4==F.readyState)if(Oa=null,/^2/.test(F.status))try{Oa=F.responseText;var Ia=F.getResponseHeader('Content-Type'),
|
|
724
|
+
Ka=/application\/json/.test(Ia)?!0:!1,Ya=!0;Ka&&(Oa=JSON.parse(F.responseText),Oa.status=F.status,Oa.contentType=Ia,Ya=!1);m.eventData.success=Oa;if(!Ka&&wa.isOpen&&!wa.hasForm||!Ka&&wa.isOpen&&Ya)S(Oa,Ya);else{if(Ka&&'undefined'!=typeof Oa.location||Ka&&'undefined'!=typeof Oa.reload){Ia=!1;'undefined'!=typeof Oa.isXhrRedirect&&/^true$/i.test(Oa.isXhrRedirect)&&(Ia=!0);if('undefined'!=typeof Oa.location&&Ia){if('undefined'!=typeof Oa.popin&&'undefined'!=typeof Oa.popin.close){wa.isRedirecting=!1;
|
|
725
|
+
wa.close();var pb=Oa.popin.reload?Oa.popin.reload:!1;Oa.popin.location||Oa.popin.url||(delete Oa.popin,pb&&(Oa.popin={reload:pb}))}Ka='_self';'undefined'!=typeof Oa.target&&(Oa.target='_'+Oa.target,Ka=Oa.target);if(/^_self$/.test(Ka))return Ka=null,Ka='undefined'!=typeof Oa.popin?Oa.popin.location||Oa.popin.url:Oa.location,wa.load(wa.name,Ka,wa.options),setTimeout(function($a){$a.isOpen||$a.open()},50,wa);window.open(Oa.location,Ka);return}if('undefined'!=typeof Oa.location){document.location=Oa.location;
|
|
726
|
+
return}if('undefined'!=typeof Oa.reload){document.location.reload();return}'undefined'!=typeof Oa.popin&&'undefined'!=typeof Oa.popin.close&&(wa.isRedirecting=!1,L(wa.name))}if(!Ka){GINA_ENV_IS_DEV&&U(Oa);triggerEvent(gina,ta,'loaded.'+ja,Oa);return}GINA_ENV_IS_DEV&&U(Oa);triggerEvent(gina,$forms[0],'success.'+ja,Oa)}GINA_ENV_IS_DEV&&U(Oa)}catch($a){La=!1,Oa={status:422,error:$a.description||$a.stack},/application\/json/.test(F.getResponseHeader('Content-Type'))&&(Oa.error=JSON.parse(F.responseText),
|
|
727
|
+
La=!0),m.eventData.error=Oa,GINA_ENV_IS_DEV&&U(Oa,La),triggerEvent(gina,ta,'error.'+ja,Oa)}else La=!1,Oa={status:F.status,error:F.responseText},/application\/json/.test(F.getResponseHeader('Content-Type'))&&(Oa.error=JSON.parse(F.responseText),La=!0),m.eventData.error=Oa,GINA_ENV_IS_DEV&&U(Oa,La),triggerEvent(gina,ta,'error.'+ja,Oa)};F.send();return{open:function(){var Oa=!1;addListener(gina,ta,'loaded.'+ja,function(Ia){Ia.preventDefault();Oa||(Oa=!0,m.activePopinId=wa.id,Y(Ia,wa),za(wa.name))})}}}}
|
|
728
|
+
function S(W,ha){var ea=oa();if(ea){if(!ea.isOpen)throw Error('Popin `'+ea.name+'` is not open !');ea.isRedirecting='undefined'!=typeof ha?ha:!1;ha=ea.target;ha.innerHTML=W.trim();N(ea.name,!0);Y({target:ha,type:'loaded.'+ea.id},ea);if(!H.options.useDialogMode&&/safari/i.test(window.navigator.userAgent))for(W=document.getElementsByTagName('link'),ha=0;ha<W.length;ha++)if('stylesheet'==W[ha].getAttribute('rel')){var wa=W[ha].getAttribute('href').split('?')[0];/gina\.min\.css|gina\.css/.test(wa)&&(wa=
|
|
729
|
+
wa+'?version='+(new Date).getMilliseconds(),W[ha].setAttribute('href',wa))}ea.isRedirecting?triggerEvent(gina,m.target,'loaded.'+ea.id,ea):triggerEvent(gina,m.target,'open.'+ea.id,ea);if(gina&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar)try{ginaToolbar.update('el-xhr',ea.id)}catch(ja){throw ja;}}}function q(W){var ha=setupXhr();ha.open('GET',W,!0);ha.setRequestHeader('Content-Type','text/javascript');ha.onload=function(){eval(ha.response)};ha.send()}function da(W){var ha=setupXhr();
|
|
730
|
+
ha.open('GET',W,!0);ha.setRequestHeader('Content-Type','text/css');ha.onload=function(){eval(ha.response)};ha.send()}function za(W){var ha='undefined'!=typeof W?R(W):I(this.id);if(!ha)throw Error('Popin name `'+W+'` not found !');W=document.getElementById(ha.id);var ea=ha.parentScripts,wa=W.getElementsByTagName('script'),ja=ha.parentStyles,ta=W.getElementsByTagName('link'),Da=0,Pa=wa.length,La=gina.config.hostname.replace(/(https|http|):\/\//,'').replace(/:\d+$/,'');for(La=new RegExp(La+':\\d+|'+
|
|
731
|
+
La);Da<Pa;++Da){if('undefined'==typeof wa[Da].src||''==wa[Da].src)continue;let Fa=wa[Da].src.replace(/(https|http|):\/\//,'').replace(La,'');-1<ea.indexOf(Fa)||q(wa[Da].src)}Da=0;for(Pa=ta.length;Da<Pa;++Da)'undefined'!=typeof ta[Da].href&&''!=ta[Da].href&&(ea=ta[Da].href.replace(/(https|http|):\/\//,'').replace(La,''),-1<ja.indexOf(ea)||da(ta[Da].href));Y({target:W,type:'loaded.'+ha.id},ha);/gina-popin-is-active/.test(W.className)||(W.className+=' gina-popin-is-active');if(!H.options.useDialogMode||
|
|
732
|
+
gina.config.envIsDev)/gina-popin-is-active/.test(m.target.firstChild.className)||(m.target.firstChild.className+=' gina-popin-is-active'),/gina-popin-is-active/.test(m.target.firstChild.className)&&removeListener(gina,m.target,'open.'+ha.id);H.options.useDialogMode&&!W.getAttribute('open')&&('function'===typeof W.showModal?gina.config.envIsDev?W.show():W.showModal():W.setAttribute('open',!0));ha.isOpen=!0;ha.target=W;m.activePopinId=ha.id;if(gina&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar)try{ginaToolbar.update('el-xhr',
|
|
733
|
+
ha.id)}catch(Fa){throw Fa;}triggerEvent(gina,m.target,'open.'+ha.id,ha)}function N(W,ha){var ea='undefined'!=typeof W?R(W):oa();if(!ea&&'undefined'!=typeof W)throw Error('Popin `'+W+'` not found !');if('undefined'!=typeof ea&&null!=ea&&(W=ea.target,ha='undefined'!=typeof ha?ha:!1,null!=W&&/gina-popin-is-active/.test(W.className))){ha||(m.target.firstChild.className=m.target.firstChild.className.replace(/\sgina-popin-is-active|gina-popin-is-active|gina-popin-is-active\s/,''),W.className=W.className.replace(/\sgina-popin-is-active|gina-popin-is-active|gina-popin-is-active\s/,
|
|
734
|
+
''),W.innerHTML='');if(y&&(ha=0,W=ea.$forms.length,y.$forms&&0<W))for(;ha<W;++ha)'undefined'!=typeof y.$forms[ea.$forms[ha]]&&y.$forms[ea.$forms[ha]].destroy(),ea.$forms.splice(ha,1);gina.popinIsBinded=!1;removeListener(gina,ea.target,'loaded.'+ea.id)}}function L(W){if('undefined'==typeof W&&/^true$/.test(this.isOpen)){W=this.name;var ha=this}else{ha=R(W)||oa();if(!ha)return;W=ha.name}if(!ha&&'undefined'!=typeof W)throw Error('Popin `'+W+'` not found !');if(ha.isOpen&&'undefined'!=typeof ha&&null!=
|
|
735
|
+
ha&&!ha.isRedirecting){var ea=ha.target;'function'===typeof ea.close?ea.close():ea.removeAttribute('open');removeListener(gina,ha.target,'ready.'+m.id);ha.hasForm&&(ha.hasForm=!1);if(null!=ea&&/gina-popin-is-active/.test(ea.className)){N(W);ha.isOpen=!1;gina.popinIsBinded=!1;GINA_ENV_IS_DEV&&gina&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&ginaToolbar.restore();m.activePopinId=null;if(0<ha.$headers.length){W=0;ea=ha.$headers.length;try{for(;W<ea;++W)document.getElementById(ha.$headers[W].id).remove()}catch(wa){console.warn('Could not remove script `'+
|
|
736
|
+
ha.$headers[W].id+'`\n'+wa.stack)}ha.$headers=[]}triggerEvent(gina,ha.target,'close.'+ha.id,ha)}}}this.plugin='popin';var B='init loaded ready open close click destroy success error progress'.split(' ');registerEvents(this.plugin,B);var H={options:{name:void 0,'class':'gina-popin-default',useDialogMode:!0,cancelOnOverlayClick:!1},authorizedEvents:['ready','error'],events:{}},m={plugin:this.plugin,id:'gina-popins-'+O.v4(),on,eventData:{},$popins:{},activePopinId:null,getActivePopin:null,target:document,
|
|
737
|
+
isReady:!1,initialized:!1},z={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:[]},y=null,F=null,r=[],v=function(){var W=document.createElement('div');W.id=m.id;W.setAttribute('id',m.id);W.setAttribute('class','gina-popins');if(!H.options.useDialogMode||gina.config.envIsDev){var ha=document.createElement('div');ha.setAttribute('id','gina-popins-overlay');ha.setAttribute('class','gina-popins-overlay');
|
|
738
|
+
W.appendChild(ha)}document.body.appendChild(W);m.target=W;m.on=on;gina.popinContainer=m.id},E=function(W,ha,ea){addListener(gina,W,'click',function(wa){cancelEvent(wa);triggerEvent(gina,ha,ea)})},I=function(W){return'undefined'!=typeof m.$popins[W]?m.$popins[W]:null},R=function(W){var ha=null,ea;for(ea in m.$popins)if(m.$popins[ea].name===W){ha=m.$popins[ea];break}return ha},sa=function(W,ha){ha=getElementsByAttribute('data-gina-popin-name');var ea=null,wa=null,ja=null,ta=null,Da=null,Pa=null;Da=
|
|
739
|
+
0;for(Pa=ha.length;Da<Pa;++Da){ea=ha[Da];wa=ea.getAttribute('data-gina-popin-name');'A'==ea.tagName&&(ja=ea.getAttribute('href'),''==ja||'#'==ja||/#/.test(ja))&&(ja=null);ja||'undefined'==typeof ea.getAttribute('data-gina-popin-url')||(ja=ea.getAttribute('data-gina-popin-url'));if(!ja)throw Error('Found `data-gina-popin-name` without `url` !');ea.url||(ea.url=ja);ea.popinName||(ea.popinName=wa);if(wa==W.name&&(ta='popin.click.gina-popin-'+m.id+'-'+O.v4()+'-'+wa,ea.id=ta,ea.setAttribute('id',ta),!gina.events[ta])){addListener(gina,
|
|
740
|
+
ea,ta,function(Fa){cancelEvent(Fa);var Oa=!1;addListener(gina,W.target,'loaded.'+W.id,function(Ka){Ka.preventDefault();Oa||(Oa=!0,console.debug('active popin should be ',W.id),gina.popin.activePopinId=W.id,Y(Ka,W),W.isOpen||za(W.name))});Fa={isSynchrone:!1,withCredentials:!1};Fa=K(W.options,Fa);var Ia=this.getAttribute('data-gina-popin-url')||this.getAttribute('href');if(!Ia)throw Error('Popin `url` not defined, please check value for `data-gina-popin-url`');n(W.name,Ia,Fa)});wa=ea.childNodes;var La=
|
|
741
|
+
0;lLen=wa.length;if(0<lLen)for(;La<lLen;++La)'undefined'!=typeof wa[La].tagName&&E(wa[La],ea,ta)}}ta='click';addListener(gina,document,ta,function(Fa){if(null!=Fa.target.getAttribute('disabled')&&'false'!=Fa.target.getAttribute('disabled'))return!1;'undefined'==typeof Fa.target.id&&(Fa.target.setAttribute('id',ta+'.'+O.v4()),Fa.target.id=Fa.target.getAttribute('id'));if(/^popin\.close\./.test(Fa.target.id)){cancelEvent(Fa);var Oa=Fa.target.id;triggerEvent(gina,Fa.target,Oa,Fa.detail)}/^popin\.click\./.test(Fa.target.id)&&
|
|
742
|
+
(cancelEvent(Fa),Oa=Fa.target.id,(new RegExp('^popin.click.gina-popin-'+m.id)).test(Oa)&&triggerEvent(gina,Fa.target,Oa,Fa.detail))});gina.popinIsBinded=!1},Ga={url:'',method:'GET',isSynchrone:!1,withCredentials:!0,headers:{'X-Requested-With':'XMLHttpRequest'}};gina.hasPopinHandler?(m.target=document.getElementById(gina.popinContainer),m.on=on):v();new ca(function(W,ha){if(W)throw W;Ea=ha});return function(W){m.getPopinById=I;m.getPopinByName=R;m.load=n;m.loadContent=S;m.getActivePopin=oa;m.open=
|
|
743
|
+
za;m.close=L;addListener(gina,m.target,'init.'+m.id,function(ha){ha=null;if('undefined'==typeof m.$popins['gina-popin-'+m.id+'-'+W.name]){var ea=ha=K({},z);if('object'!=typeof W)throw Error('`options` must be an object');ea.options=K(W,H.options);ea.id='gina-popin-'+m.id+'-'+ea.options.name;if('undefined'==typeof m.$popins[ea.id]){if('string'!=typeof ea.options.name||''==ea.options.name)throw Error('`options.name` can not be left `empty` or `undefined`');if(-1<r.indexOf(ea.options.name))throw Error('`popin '+
|
|
744
|
+
ea.options.name+'` already exists !');'undefined'!=typeof ea.options.validator&&(y=ea.options.validator,ea.validateFormById=y.validateFormById);ea.options['class']='gina-popin-container '+ea.options['class'];ea.name=ea.options.name;ea.target=m.target;ea.load=n;ea.loadContent=S;ea.open=za;ea.close=L;GINA_ENV_IS_DEV&&(ea.updateToolbar=U);ea.parentScripts=[];ea.parentStyles=[];var wa=gina.config.hostname.replace(/(https|http|):\/\//,'').replace(/:\d+$/,'');wa=new RegExp(wa+':\\d+|'+wa);var ja=document.getElementsByTagName('script');
|
|
745
|
+
for(let Da=0,Pa=ja.length;Da<Pa;Da++)if(ja[Da].src&&''!=ja[Da].src){var ta=ja[Da].src.replace(/(https|http|):\/\//,'').replace(wa,'');ea.parentScripts[Da]=ta}ja=document.getElementsByTagName('link');for(let Da=0,Pa=ja.length;Da<Pa;Da++)'undefined'!=typeof ja[Da].rel&&/stylesheet/i.test(ja[Da].rel)&&(ta=ja[Da].href.replace(/(https|http|):\/\//,'').replace(wa,''),ea.parentStyles[Da]=ta);m.$popins[ea.id]=ea;if(window.XMLHttpRequest)F=new XMLHttpRequest;else if(window.ActiveXObject)try{F=new ActiveXObject('Msxml2.XMLHTTP')}catch(Da){try{F=
|
|
746
|
+
new ActiveXObject('Microsoft.XMLHTTP')}catch(Pa){}}sa(ea)}}m.isReady=!0;gina.hasPopinHandler=!0;gina.popin=K(gina.popin,m);triggerEvent(gina,m.target,'ready.'+m.id,ha)});m.initialized=!0;return m}(T)}});function fadeIn(D){var O=.1;D.style.display='block';var ca=setInterval(function(){1<=O&&clearInterval(ca);D.style.opacity=O;D.style.filter='alpha(opacity='+100*O+')';O+=.1*O},10)}
|
|
747
|
+
function fadeOut(D){var O=1,ca=setInterval(function(){.1>=O&&(clearInterval(ca),D.style.display='none');D.style.opacity=O;D.style.filter='alpha(opacity='+100*O+')';O-=.1*O},50)}define('utils/effects',function(){});
|
|
747
748
|
'function'!==typeof Object.assign&&Object.defineProperty(Object,'assign',{value:function(D,O){if(null===D||void 0===D)throw new TypeError('Cannot convert undefined or null to object');for(var ca=Object(D),Ea=1;Ea<arguments.length;Ea++){var K=arguments[Ea];if(null!==K&&void 0!==K)for(var T in K)Object.prototype.hasOwnProperty.call(K,T)&&(ca[T]=K[T])}return ca},writable:!0,configurable:!0});
|
|
748
749
|
if('undefined'==typeof JSON.clone){var clone=function(D,O){if(null==D||'object'!=typeof D||D.constructor!=Object&&D.constructor!=Array)return D;if(D.constructor==Date||D.constructor==RegExp||D.constructor==Function||D.constructor==String||D.constructor==Number||D.constructor==Boolean)return new D.constructor(D);O=O||new D.constructor;for(var ca=0,Ea=Object.getOwnPropertyNames(D).length||0,K=Object.keys(D);ca<Ea;)O[K[ca]]='undefined'==typeof O[K[ca]]?clone(D[K[ca]],null):O[K[ca]],ca++;return O};JSON.clone=
|
|
749
750
|
clone}if('undefined'==typeof JSON.escape){var escape=function(D){try{return D.replace(/\n/g,'\\n').replace(/\r/g,'\\r').replace(/\t/g,'\\t')}catch(O){throw O;}};JSON.escape=escape}define('utils/polyfill',function(){});
|