jsf.js_next_gen 4.0.0-beta-23 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.nyc_output/09ca9ebc-2305-4357-8db9-48ddfc7dfde2.json +1 -0
- package/.nyc_output/7c496a14-166e-4aa5-85b9-47b22b055ad8.json +1 -0
- package/.nyc_output/processinfo/09ca9ebc-2305-4357-8db9-48ddfc7dfde2.json +1 -0
- package/.nyc_output/processinfo/7c496a14-166e-4aa5-85b9-47b22b055ad8.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -1
- package/README.md +7 -22
- package/dist/docs/assets/main.js +56 -52
- package/dist/docs/assets/search.js +1 -1
- package/dist/docs/assets/style.css +23 -0
- package/dist/docs/functions/faces.ajax.addOnError.html +6 -4
- package/dist/docs/functions/faces.ajax.addOnEvent.html +2 -0
- package/dist/docs/functions/faces.ajax.request.html +7 -7
- package/dist/docs/functions/faces.ajax.response.html +0 -1
- package/dist/docs/functions/faces.push.close.html +4 -2
- package/dist/docs/functions/faces.push.init.html +19 -7
- package/dist/docs/functions/faces.push.open.html +4 -2
- package/dist/docs/functions/faces.util.chain.html +3 -3
- package/dist/docs/functions/myfaces.ab.html +9 -4
- package/dist/docs/functions/myfaces.onOnDomReady.html +72 -0
- package/dist/docs/index.html +7 -18
- package/dist/docs/modules/myfaces.html +3 -1
- package/dist/docs/variables/myfaces.oam.html +2 -1
- package/dist/window/faces-development.js +2147 -1779
- package/dist/window/faces-development.js.br +0 -0
- package/dist/window/faces-development.js.gz +0 -0
- package/dist/window/faces-development.js.map +1 -1
- package/dist/window/faces.js +1 -1
- package/dist/window/faces.js.LICENSE.txt +17 -2
- package/dist/window/faces.js.br +0 -0
- package/dist/window/faces.js.gz +0 -0
- package/dist/window/faces.js.map +1 -1
- package/dist/window/jsf-development.js +2156 -1777
- package/dist/window/jsf-development.js.br +0 -0
- package/dist/window/jsf-development.js.gz +0 -0
- package/dist/window/jsf-development.js.map +1 -1
- package/dist/window/jsf.js +1 -1
- package/dist/window/jsf.js.LICENSE.txt +17 -2
- package/dist/window/jsf.js.br +0 -0
- package/dist/window/jsf.js.gz +0 -0
- package/dist/window/jsf.js.map +1 -1
- package/package.json +19 -18
- package/pom.xml +1 -1
- package/src/main/test.xml +23 -0
- package/src/main/typescript/@types/definitions/index.d.ts +24 -7
- package/src/main/typescript/api/_api.ts +79 -37
- package/src/main/typescript/api/jsf.ts +18 -0
- package/src/main/typescript/impl/AjaxImpl.ts +168 -78
- package/src/main/typescript/impl/PushImpl.ts +63 -38
- package/src/main/typescript/impl/core/Const.ts +52 -39
- package/src/main/typescript/impl/util/Assertions.ts +16 -8
- package/src/main/typescript/impl/util/AsyncQueue.ts +1 -1
- package/src/main/typescript/impl/util/AsyncRunnable.ts +4 -4
- package/src/main/typescript/impl/util/ExtDomQuery.ts +58 -45
- package/src/main/typescript/impl/util/FileUtils.ts +104 -0
- package/src/main/typescript/impl/util/HiddenInputBuilder.ts +89 -0
- package/src/main/typescript/impl/util/Lang.ts +30 -31
- package/src/main/typescript/impl/xhrCore/ErrorData.ts +15 -10
- package/src/main/typescript/impl/xhrCore/EventData.ts +2 -2
- package/src/main/typescript/impl/xhrCore/IResponseProcessor.ts +25 -11
- package/src/main/typescript/impl/xhrCore/RequestDataResolver.ts +78 -32
- package/src/main/typescript/impl/xhrCore/ResonseDataResolver.ts +10 -10
- package/src/main/typescript/impl/xhrCore/Response.ts +66 -49
- package/src/main/typescript/impl/xhrCore/ResponseProcessor.ts +202 -131
- package/src/main/typescript/impl/xhrCore/XhrFormData.ts +79 -166
- package/src/main/typescript/impl/xhrCore/XhrRequest.ts +80 -68
- package/src/main/typescript/myfaces/OamSubmit.ts +29 -13
- package/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.ts +19 -22
- package/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.ts +108 -1
- package/src/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.ts +40 -1
- package/src/main/typescript/test/impl/ImplTest.spec.ts +3 -3
- package/src/main/typescript/test/impl/ImplTest_23.spec.ts +3 -7
- package/src/main/typescript/test/xhrCore/EventTests.spec.ts +1 -1
- package/src/main/typescript/test/xhrCore/FileUploadTest.spec.ts +5 -2
- package/src/main/typescript/test/xhrCore/NamespacesRequestTest.spec.ts +203 -0
- package/src/main/typescript/test/xhrCore/OamSubmitTest.spec.ts +177 -0
- package/src/main/typescript/test/xhrCore/RequestParamsTest.spec.ts +158 -17
- package/src/main/typescript/test/xhrCore/RequestTest.spec.ts +242 -11
- package/src/main/typescript/test/xhrCore/RequestTest_23.spec.ts +39 -3
- package/src/main/typescript/test/xhrCore/ResponseTest.spec.ts +373 -35
- package/src/main/typescript/test/xhrCore/ResponseTest23.spec.ts +43 -9
- package/src/main/typescript/test/xhrCore/TobagoFileUploadTest.spec.ts +109 -0
- package/src/main/typescript/test/xhrCore/XhrFormDataTest.spec.ts +67 -49
- package/src/main/typescript/test.xml +6 -0
- package/src/main/typescript/tsconfig.json +1 -1
- package/src/test/resources/jsf-development.js +1 -1
- package/src/tmp/test.html +12 -88
- package/target/api/_api.js +72 -31
- package/target/api/_api.js.map +1 -1
- package/target/api/jsf.js +11 -0
- package/target/api/jsf.js.map +1 -1
- package/target/classes/com/example/jsfs_js_ts/DecoratedFacesJS.class +0 -0
- package/target/classes/com/example/jsfs_js_ts/DecoratingResourceHandlerWrapper.class +0 -0
- package/target/classes/com/example/jsfs_js_ts/FacesJSMapFileResourceWrapper.class +0 -0
- package/target/classes/com/example/jsfs_js_ts/FacesJSMappingDecorator.class +0 -0
- package/target/impl/AjaxImpl.js +144 -59
- package/target/impl/AjaxImpl.js.map +1 -1
- package/target/impl/PushImpl.js +66 -35
- package/target/impl/PushImpl.js.map +1 -1
- package/target/impl/core/Const.js +51 -38
- package/target/impl/core/Const.js.map +1 -1
- package/target/impl/core/Context.js +10 -0
- package/target/impl/core/Context.js.map +1 -0
- package/target/impl/util/Assertions.js +12 -7
- package/target/impl/util/Assertions.js.map +1 -1
- package/target/impl/util/AsyncQueue.js.map +1 -1
- package/target/impl/util/ExtDomQuery.js +58 -40
- package/target/impl/util/ExtDomQuery.js.map +1 -1
- package/target/impl/util/FileUtils.js +96 -0
- package/target/impl/util/FileUtils.js.map +1 -0
- package/target/impl/util/HiddenElementBuilder.js +7 -0
- package/target/impl/util/HiddenElementBuilder.js.map +1 -0
- package/target/impl/util/HiddenInputBuilder.js +79 -0
- package/target/impl/util/HiddenInputBuilder.js.map +1 -0
- package/target/impl/util/Lang.js +29 -30
- package/target/impl/util/Lang.js.map +1 -1
- package/target/impl/util/URLCodec.js +77 -0
- package/target/impl/util/URLCodec.js.map +1 -0
- package/target/impl/util/XhrQueueController.js +82 -0
- package/target/impl/util/XhrQueueController.js.map +1 -0
- package/target/impl/xhrCore/ErrorData.js +10 -8
- package/target/impl/xhrCore/ErrorData.js.map +1 -1
- package/target/impl/xhrCore/EventData.js +1 -1
- package/target/impl/xhrCore/EventData.js.map +1 -1
- package/target/impl/xhrCore/RequestContext.js +11 -0
- package/target/impl/xhrCore/RequestContext.js.map +1 -0
- package/target/impl/xhrCore/RequestDataResolver.js +70 -23
- package/target/impl/xhrCore/RequestDataResolver.js.map +1 -1
- package/target/impl/xhrCore/ResonseDataResolver.js +9 -9
- package/target/impl/xhrCore/ResonseDataResolver.js.map +1 -1
- package/target/impl/xhrCore/Response.js +44 -29
- package/target/impl/xhrCore/Response.js.map +1 -1
- package/target/impl/xhrCore/ResponseProcessor.js +182 -116
- package/target/impl/xhrCore/ResponseProcessor.js.map +1 -1
- package/target/impl/xhrCore/XhrFormData.js +68 -156
- package/target/impl/xhrCore/XhrFormData.js.map +1 -1
- package/target/impl/xhrCore/XhrQueHandler.js +11 -0
- package/target/impl/xhrCore/XhrQueHandler.js.map +1 -0
- package/target/impl/xhrCore/XhrQueueController.js +62 -0
- package/target/impl/xhrCore/XhrQueueController.js.map +1 -0
- package/target/impl/xhrCore/XhrRequest.js +68 -59
- package/target/impl/xhrCore/XhrRequest.js.map +1 -1
- package/target/myfaces/OamSubmit.js +23 -14
- package/target/myfaces/OamSubmit.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js +16 -16
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/ExtendedArrayTest.spec.js +76 -0
- package/target/test/frameworkBase/_ext/monadish/ExtendedArrayTest.spec.js.map +1 -0
- package/target/test/frameworkBase/_ext/monadish/markups/tobago-with-header.js +925 -0
- package/target/test/frameworkBase/_ext/monadish/markups/tobago-with-header.js.map +1 -0
- package/target/test/frameworkBase/_ext/monadish/markups/tobago-without-header.js +112 -0
- package/target/test/frameworkBase/_ext/monadish/markups/tobago-without-header.js.map +1 -0
- package/target/test/frameworkBase/_ext/shared/StandardInits.js +100 -1
- package/target/test/frameworkBase/_ext/shared/StandardInits.js.map +1 -1
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js +37 -1
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js.map +1 -1
- package/target/test/impl/ImplTest.spec.js +2 -2
- package/target/test/impl/ImplTest.spec.js.map +1 -1
- package/target/test/impl/ImplTest_23.spec.js +2 -2
- package/target/test/impl/ImplTest_23.spec.js.map +1 -1
- package/target/test/myfaces/OnLoadSpec.js +57 -0
- package/target/test/myfaces/OnLoadSpec.js.map +1 -0
- package/target/test/xhrCore/EventTests.spec.js +1 -1
- package/target/test/xhrCore/EventTests.spec.js.map +1 -1
- package/target/test/xhrCore/FileUploadTest.spec.js +2 -1
- package/target/test/xhrCore/FileUploadTest.spec.js.map +1 -1
- package/target/test/xhrCore/NamespacesRequestTest.spec.js +204 -0
- package/target/test/xhrCore/NamespacesRequestTest.spec.js.map +1 -0
- package/target/test/xhrCore/OamSubmitTest.spec.js +180 -0
- package/target/test/xhrCore/OamSubmitTest.spec.js.map +1 -0
- package/target/test/xhrCore/RequestParamsTest.spec.js +142 -10
- package/target/test/xhrCore/RequestParamsTest.spec.js.map +1 -1
- package/target/test/xhrCore/RequestTest.spec.js +217 -9
- package/target/test/xhrCore/RequestTest.spec.js.map +1 -1
- package/target/test/xhrCore/RequestTest_23.spec.js +34 -2
- package/target/test/xhrCore/RequestTest_23.spec.js.map +1 -1
- package/target/test/xhrCore/ResponseTest.spec.js +308 -24
- package/target/test/xhrCore/ResponseTest.spec.js.map +1 -1
- package/target/test/xhrCore/ResponseTest23.spec.js +38 -8
- package/target/test/xhrCore/ResponseTest23.spec.js.map +1 -1
- package/target/test/xhrCore/TobagoFileUploadTest.spec.js +128 -0
- package/target/test/xhrCore/TobagoFileUploadTest.spec.js.map +1 -0
- package/target/test/xhrCore/XhrFormDataTest.spec.js +57 -34
- package/target/test/xhrCore/XhrFormDataTest.spec.js.map +1 -1
- package/target/test-classes/.gz +0 -0
- package/target/test-classes/com/example/jsfs_js_ts/JsfsJsTsApplicationTests.class +0 -0
- package/target/test-classes/fileuploadtest.html +24 -0
- package/target/test-classes/jsf-development.js +3559 -0
- package/target/test-classes/jsf-development.js.br +0 -0
- package/target/test-classes/jsf-development.js.gz +0 -0
- package/target/test-classes/jsf-development.js.map +1 -0
- package/target/test-classes/jsf.js +3 -0
- package/target/test-classes/jsf.js.br +0 -0
- package/target/test-classes/jsf.js.gz +0 -0
- package/tmp.xml +36 -0
- package/.nyc_output/2303b649-59d9-485c-9228-73b0ec8787a7.json +0 -1
- package/.nyc_output/756f2f03-c85b-4cdb-9b92-5799eb45ef1e.json +0 -1
- package/.nyc_output/processinfo/2303b649-59d9-485c-9228-73b0ec8787a7.json +0 -1
- package/.nyc_output/processinfo/756f2f03-c85b-4cdb-9b92-5799eb45ef1e.json +0 -1
- package/target/types/index.js +0 -18
- package/target/types/index.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"faces-development.js","mappings":";;;;;;;;;;;AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;AAEH,4GAAwD;AAExD,+GAAqD;AACrD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AAG,YAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,mCAAI,EAAE,CAAC;IACnD,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,eAAC,aAAM,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,kBAAM,CAAC,OAAO,0CAAG,GAAG,CAAC,mCAAI,OAAO,CAAC,GAAG,CAAC,IAAC,CAAC;CACpG;AACU,aAAK,GAAG,MAAM,CAAC,KAAK,CAAC;AACrB,eAAO,GAAG,MAAM,CAAC,OAAO,CAAC","sources":["webpack://jsf.js_next_gen/./node_modules/mona-dish/src/main/typescript/DomQuery.ts","webpack://jsf.js_next_gen/./node_modules/mona-dish/src/main/typescript/Global.ts","webpack://jsf.js_next_gen/./node_modules/mona-dish/src/main/typescript/Lang.ts","webpack://jsf.js_next_gen/./node_modules/mona-dish/src/main/typescript/Monad.ts","webpack://jsf.js_next_gen/./node_modules/mona-dish/src/main/typescript/SourcesCollectors.ts","webpack://jsf.js_next_gen/./node_modules/mona-dish/src/main/typescript/Stream.ts","webpack://jsf.js_next_gen/./node_modules/mona-dish/src/main/typescript/XmlQuery.ts","webpack://jsf.js_next_gen/./node_modules/mona-dish/src/main/typescript/index_core.ts","webpack://jsf.js_next_gen/./src/main/typescript/api/_api.ts","webpack://jsf.js_next_gen/./src/main/typescript/impl/AjaxImpl.ts","webpack://jsf.js_next_gen/./src/main/typescript/impl/PushImpl.ts","webpack://jsf.js_next_gen/./src/main/typescript/impl/core/Const.ts","webpack://jsf.js_next_gen/./src/main/typescript/impl/core/ImplTypes.ts","webpack://jsf.js_next_gen/./src/main/typescript/impl/i18n/Messages.ts","webpack://jsf.js_next_gen/./src/main/typescript/impl/util/Assertions.ts","webpack://jsf.js_next_gen/./src/main/typescript/impl/util/AsyncQueue.ts","webpack://jsf.js_next_gen/./src/main/typescript/impl/util/ExtDomQuery.ts","webpack://jsf.js_next_gen/./src/main/typescript/impl/util/Lang.ts","webpack://jsf.js_next_gen/./src/main/typescript/impl/xhrCore/ErrorData.ts","webpack://jsf.js_next_gen/./src/main/typescript/impl/xhrCore/EventData.ts","webpack://jsf.js_next_gen/./src/main/typescript/impl/xhrCore/RequestDataResolver.ts","webpack://jsf.js_next_gen/./src/main/typescript/impl/xhrCore/ResonseDataResolver.ts","webpack://jsf.js_next_gen/./src/main/typescript/impl/xhrCore/Response.ts","webpack://jsf.js_next_gen/./src/main/typescript/impl/xhrCore/ResponseProcessor.ts","webpack://jsf.js_next_gen/./src/main/typescript/impl/xhrCore/XhrFormData.ts","webpack://jsf.js_next_gen/./src/main/typescript/impl/xhrCore/XhrRequest.ts","webpack://jsf.js_next_gen/./src/main/typescript/myfaces/OamSubmit.ts","webpack://jsf.js_next_gen/webpack/bootstrap","webpack://jsf.js_next_gen/webpack/runtime/global","webpack://jsf.js_next_gen/./src/main/typescript/api/faces.ts"],"sourcesContent":["/*!\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Config, Optional, ValueEmbedder} from \"./Monad\";\nimport {XMLQuery} from \"./XmlQuery\";\nimport {IStream, LazyStream, Stream} from \"./Stream\";\nimport {ArrayCollector, ICollector, IStreamDataSource, ITERATION_STATUS} from \"./SourcesCollectors\";\nimport {Lang} from \"./Lang\";\nimport trim = Lang.trim;\nimport objToArray = Lang.objToArray;\nimport isString = Lang.isString;\nimport equalsIgnoreCase = Lang.equalsIgnoreCase;\nimport {_global$} from \"./Global\";\n\ndeclare var ownerDocument: any;\n\n/**\n * in order to poss custom parameters we need to extend the mutation observer init\n */\nexport interface WAIT_OPTS extends MutationObserverInit {\n timeout?: number;\n /**\n * interval on non legacy browsers\n */\n interval?: number;\n}\n\n\n/**\n *\n * // - submit checkboxes and radio inputs only if checked\n if ((tagName != \"select\" && elemType != \"button\"\n && elemType != \"reset\" && elemType != \"submit\" && elemType != \"image\")\n && ((elemType != \"checkbox\" && elemType != \"radio\"\n */\n\nenum Submittables {\n SELECT = \"select\",\n BUTTON = \"button\",\n SUBMIT = \"submit\",\n RESET = \"reset\",\n IMAGE = \"image\",\n RADIO = \"radio\",\n CHECKBOX = \"checkbox\"\n\n}\n\n/**\n * helper to fix a common problem that a system has to wait, until a certain condition is reached.\n * Depending on the browser this uses either the Mutation Observer or a semi compatible interval as fallback.\n * @param root the root DomQuery element to start from\n * @param condition the condition lambda to be fulfilled\n * @param options options for the search\n */\nfunction waitUntilDom(root: DomQuery, condition: (element: DomQuery) => boolean, options: WAIT_OPTS = {\n attributes: true,\n childList: true,\n subtree: true,\n timeout: 500,\n interval: 100\n}): Promise<DomQuery> {\n return new Promise<DomQuery>((success, error) => {\n let observer: MutationObserver = null;\n const MUT_ERROR = new Error(\"Mutation observer timeout\");\n\n //we do the same but for now ignore the options on the dom query\n //we cannot use absent here, because the condition might search for an absent element\n function findElement(root: DomQuery, condition: (element: DomQuery) => boolean): DomQuery | null {\n let found = null;\n if (!!condition(root)) {\n return root;\n }\n if (options.childList) {\n found = (condition(root)) ? root : root.childNodes.filter(item => condition(item)).first().value.value;\n } else if (options.subtree) {\n found = (condition(root)) ? root : root.querySelectorAll(\" * \").filter(item => condition(item)).first().value.value;\n } else {\n found = (condition(root)) ? root : null;\n }\n return found;\n }\n\n let foundElement = root;\n if (!!(foundElement = findElement(foundElement, condition))) {\n success(new DomQuery(foundElement));\n return;\n }\n\n if ('undefined' != typeof MutationObserver) {\n const mutTimeout = setTimeout(() => {\n observer.disconnect();\n return error(MUT_ERROR);\n }, options.timeout);\n\n const callback: MutationCallback = (mutationList: MutationRecord[]) => {\n const found = new DomQuery(mutationList.map((mut) => mut.target)).filter(item => condition(item)).first();\n if (found.isPresent()) {\n clearTimeout(mutTimeout);\n observer.disconnect();\n success(new DomQuery(found || root));\n }\n }\n observer = new MutationObserver(callback);\n\n // browsers might ignore it, but we cannot break the api in the case\n // hence no timeout is passed\n let observableOpts = {...options};\n delete observableOpts.timeout;\n root.eachElem(item => {\n observer.observe(item, observableOpts)\n })\n } else { //fallback for legacy browsers without mutation observer\n\n let interval = setInterval(() => {\n let found = findElement(root, condition);\n if (!!found) {\n if (timeout) {\n clearTimeout(timeout);\n clearInterval(interval);\n interval = null;\n }\n success(new DomQuery(found || root));\n }\n }, options.interval);\n let timeout = setTimeout(() => {\n if (interval) {\n clearInterval(interval);\n error(MUT_ERROR);\n }\n }, options.timeout)\n\n }\n });\n}\n\nexport class ElementAttribute extends ValueEmbedder<string> {\n\n constructor(private element: DomQuery, private name: string, private defaultVal: string = null) {\n super(element, name);\n }\n\n get value(): string {\n let val: Element[] = this.element.get(0).orElse(...[]).values;\n if (!val.length) {\n return this.defaultVal;\n }\n return val[0].getAttribute(this.name);\n }\n\n set value(value: string) {\n let val: Element[] = this.element.get(0).orElse(...[]).values;\n for (let cnt = 0; cnt < val.length; cnt++) {\n val[cnt].setAttribute(this.name, value);\n }\n val[0].setAttribute(this.name, value);\n }\n\n protected getClass(): any {\n return ElementAttribute;\n }\n\n static fromNullable<ElementAttribute, T>(value?: any, valueKey: string = \"value\"): ElementAttribute {\n return <any>new ElementAttribute(value, valueKey);\n }\n\n}\n\nexport class Style extends ValueEmbedder<string> {\n\n constructor(private element: DomQuery, private name: string, private defaultVal: string = null) {\n super(element, name);\n }\n\n get value(): string {\n let val: Element[] = this.element.values;\n if (!val.length) {\n return this.defaultVal;\n }\n return (val[0] as HTMLElement).style[this.name];\n }\n\n set value(value: string) {\n let val: HTMLElement[] = this.element.values as HTMLElement[];\n for (let cnt = 0; cnt < val.length; cnt++) {\n val[cnt].style[this.name] = value;\n }\n }\n\n protected getClass(): any {\n return ElementAttribute;\n }\n\n static fromNullable<ElementAttribute, T>(value?: any, valueKey: string = \"value\"): ElementAttribute {\n return <any>new ElementAttribute(value, valueKey);\n }\n\n}\n\n/**\n * small helper for the specialized jsf case\n * @constructor\n */\nconst DEFAULT_WHITELIST = () => {\n return true;\n};\n\ninterface IDomQuery {\n /**\n * reference to the systems global object\n * (globalThis, window, global, depending on the environment)\n */\n readonly global: any;\n /**\n * reads the first element if it exists and returns an optional\n */\n readonly value: Optional<Element>;\n /**\n * All elements as array\n */\n readonly values: Element[];\n /**\n * returns the id as settable value (See also ValueEmbedder)\n */\n readonly id: ValueEmbedder<string>;\n /**\n * returns the length of embedded nodes (top level)\n */\n readonly length: number;\n /**\n * the tag name of the first element\n */\n readonly tagName: Optional<string>;\n /**\n * the node name of the first element\n */\n readonly nodeName: Optional<string>;\n /**\n * the type of the first element\n */\n readonly type: Optional<string>;\n /**\n * The name as changeable value\n */\n readonly name: ValueEmbedder<string>;\n /**\n * The the value in case of inputs as changeable value\n */\n readonly inputValue: ValueEmbedder<string | boolean>;\n\n /**\n * accumulated top element offsetWidth\n */\n readonly offsetWidth: number;\n /**\n * accumulated top element offsetHeight\n */\n readonly offsetHeight: number;\n /**\n * accumulated top element offsetLeft\n */\n readonly offsetLeft: number;\n /**\n * accumulated top element offsetTop\n */\n readonly offsetTop: number;\n\n\n /**\n * abbreviation for inputValue.value to make\n * the code terser\n */\n val: string | boolean;\n\n /**\n * the underlying form elements as domquery object\n */\n readonly elements: DomQuery;\n /**\n * settable flag for disabled\n */\n disabled: boolean;\n /**\n * The child nodes of this node collection as readonly attribute\n */\n readonly childNodes: DomQuery;\n /**\n * an early stream representation for this DomQuery\n */\n readonly stream: Stream<DomQuery>;\n /**\n * lazy stream representation for this DomQuery\n */\n readonly lazyStream: LazyStream<DomQuery>;\n /**\n * transform this node collection to an array\n */\n readonly asArray: Array<DomQuery>;\n\n /**\n * inner html property\n * setter and getter which works directly on strings\n */\n innerHTML: string;\n\n /**\n * same as innerHTML\n * will be removed once\n * my code is transitioned\n * @deprecated do not use anymore, user innerHTML instead\n */\n innerHtml: string;\n\n /**\n * returns true if the elements have the tag *tagName* as tag embedded (highest level)\n * @param tagName\n */\n isTag(tagName: string): boolean;\n\n /**\n * returns the nth element as domquery\n * from the internal elements\n * note if you try to reach a non existing element position\n * you will get back an absent entry\n *\n * @param index the nth index\n */\n get(index: number): DomQuery;\n\n /**\n * returns the nth element as optional of an Element object\n * @param index the number from the index\n * @param defaults the default value if the index is overrun default Optional.absent\n */\n getAsElem(index: number, defaults: Optional<any>): Optional<Element>;\n\n /**\n * returns the value array< of all elements\n */\n allElems(): Array<Element>;\n\n /**\n * absent no values reached?\n */\n isAbsent(): boolean;\n\n /**\n * should make the code clearer\n * note if you pass a function\n * this refers to the active dopmquery object\n */\n isPresent(presentRunnable ?: (elem ?: DomQuery) => void): boolean;\n\n /**\n * should make the code clearer\n * note if you pass a function\n * this refers to the active dopmquery object\n *\n *\n * @param presentRunnable\n */\n ifPresentLazy(presentRunnable: (elem ?: DomQuery) => void): DomQuery;\n\n /**\n * remove all affected nodes from this query object from the dom tree\n */\n delete(): void;\n\n /**\n * query selector all on the existing dom query object\n *\n * @param selector the standard selector\n * @return a DomQuery with the results\n */\n querySelectorAll(selector): DomQuery;\n\n /**\n * core byId method\n * @param id the id to search for\n * @param includeRoot also match the root element?\n */\n byId(id: string, includeRoot?: boolean): DomQuery;\n\n /**\n * same as byId just for the tag name\n * @param tagName\n * @param includeRoot\n */\n byTagName(tagName: string, includeRoot ?: boolean): DomQuery;\n\n /**\n * attr accessor, usage myQuery.attr(\"class\").value = \"bla\"\n * or let value myQuery.attr(\"class\").value\n * @param attr the attribute to set\n * @param defaultValue the default value in case nothing is presented (defaults to null)\n */\n attr(attr: string, defaultValue: string): ElementAttribute;\n\n /**\n * style accessor\n * @param defaultValue the default value in case nothing is presented (defaults to null)\n * @param cssProperty\n */\n style(cssProperty: string, defaultValue: string): Style;\n\n /**\n * hasclass, checks for an existing class in the class attributes\n *\n * @param clazz the class to search for\n */\n hasClass(clazz: string): boolean;\n\n /**\n * appends a class string if not already in the element(s)\n *\n * @param clazz the style class to append\n */\n addClass(clazz: string): DomQuery;\n\n /**\n * remove the style class if in the class definitions\n *\n * @param clazz\n */\n removeClass(clazz: string): DomQuery;\n\n /**\n * checks whether we have a multipart element in our children\n */\n isMultipartCandidate(): boolean;\n\n /**\n * innerHtml equivalent\n * equivalent to jQueries html\n * as setter the html is set and the\n * DomQuery is given back\n * as getter the html string is returned\n *\n * @param inval\n */\n html(inval?: string): DomQuery | Optional<string>;\n\n /**\n * dispatch event on all children\n * just a delegated dispatchevent from the standard\n * dom working on all queried elements in the monad level\n *\n * @param evt the event to be dispatched\n */\n dispatchEvent(evt: Event): DomQuery;\n\n /**\n * easy node traversal, you can pass\n * a set of node selectors which are joined as direct childs\n *\n * not the rootnodes are not in the getIf, those are always the child nodes\n *\n * @param nodeSelector\n */\n getIf(...nodeSelector: Array<string>): DomQuery;\n\n /**\n * iterate over each element and perform something on the element\n * (Dom element is passed instead of DomQuery)\n * @param func\n */\n eachElem(func: (item: Element, cnt?: number) => any): DomQuery;\n\n /**\n * perform an operation on the first element\n * returns a DomQuery on the first element only\n * @param func\n */\n firstElem(func: (item: Element, cnt?: number) => any): DomQuery;\n\n /**\n * perform an operation on the first element\n * returns a DomQuery on the first element only\n * @param func\n */\n lastElem(func: (item: Element, cnt?: number) => any): DomQuery;\n\n /**\n * same as eachElem, but a DomQuery object is passed down\n *\n * @param func\n */\n each(func: (item: DomQuery, cnt?: number) => any): DomQuery;\n\n /**\n * returns a new dom query containing only the first element max\n *\n * @param func a an optional callback function to perform an operation on the first element\n */\n first(func: (item: DomQuery, cnt?: number) => any): DomQuery;\n\n\n /**\n * returns a new dom query containing only the first element max\n *\n * @param func a an optional callback function to perform an operation on the first element\n */\n last(func: (item: DomQuery, cnt?: number) => any): DomQuery;\n\n /**\n * filter function which filters a subset\n *\n * @param func\n */\n filter(func: (item: DomQuery) => boolean): DomQuery;\n\n /**\n * global eval head appendix method\n * no other methods are supported anymore\n * @param code the code to be evaled\n * @param nonce optional nonce key for higher security\n */\n globalEval(code: string, nonce ?: string): DomQuery;\n\n /**\n * Runs an eval and keeps the evaled code in the head\n * This is a corner condition, where we want to update the head with custom\n * code and leave the code in (instead of deleting ig)\n *\n * @param code the code to be evaled\n * @param nonce optional nonce key for higher security\n */\n globalEvalSticky(code: string, nonce ?: string): DomQuery;\n\n /**\n * detaches a set of nodes from their parent elements\n * in a browser independend manner\n * @return {DomQuery} DomQuery of nodes with the detached dom nodes\n */\n detach(): DomQuery;\n\n /**\n * appends the current set of elements\n * to the element or first element passed via elem\n * @param elem\n */\n appendTo(elem: DomQuery | string): DomQuery;\n\n /**\n * appends the passed elements to our existing queries\n * note, double appends can happen if you are not careful\n *\n * @param elem to append\n */\n append(elem: DomQuery): DomQuery;\n\n /**\n * appends the passed elements to our existing queries\n * note, double appends can happen if you are not careful\n *\n * @param elem to append\n */\n prepend(elem: DomQuery): DomQuery;\n\n /**\n * prepend eqivalent to appendTo\n *\n * @param elem the element to prepend to\n */\n prependTo(elem: DomQuery): DomQuery;\n\n /**\n * loads and evals a script from a source uri\n *\n * @param src the source to be loaded and evaled\n * @param defer in miliseconds execution default (0 == no defer)\n * @param charSet\n */\n loadScriptEval(src: string, defer: number, charSet: string): void;\n\n /**\n * insert toInsert after the current element\n *\n * @param toInsert an array of DomQuery objects\n */\n insertAfter(...toInsert: Array<DomQuery>): DomQuery;\n\n /**\n * inserts the elements before the current element\n *\n * @param toInsert\n */\n insertBefore(...toInsert: Array<DomQuery>): DomQuery;\n\n /**\n * in case the domquery is pointing to nothing the else value is taken into consideration\n * als alternative\n *\n * @param elseValue the else value\n */\n orElse(...elseValue: any): DomQuery;\n\n /**\n * the same with lazy evaluation for cases where getting the else value\n * is a heavy operation\n *\n * @param func the else provider function\n */\n orElseLazy(func: () => any): DomQuery;\n\n /**\n * all parents with TagName\n * @param tagName\n */\n parents(tagName: string): DomQuery;\n\n /**\n * copy all attributes of sourceItem to this DomQuery items\n *\n * @param sourceItem the source item to copy over (can be another domquery or a parsed XML Query item)\n */\n copyAttrs(sourceItem: DomQuery | XMLQuery): DomQuery;\n\n /**\n * outerhtml convenience method\n * browsers only support innerHTML but\n * for instance for your jsf.js we have a full\n * replace pattern which needs outerHTML processing\n *\n * @param markup\n * @param runEmbeddedScripts\n * @param runEmbeddedCss\n */\n outerHTML(markup: string, runEmbeddedScripts ?: boolean, runEmbeddedCss ?: boolean): DomQuery;\n\n /**\n * Run through the given nodes in the DomQuery execute the inline scripts\n * @param sticky if set to true the element must be left in the head after eval default === false\n * @param whilteListed: optional whitelist function which can filter out script tags which are not processed\n * defaults to the standard jsf.js exclusion (we use this code for myfaces)\n */\n runScripts(sticky?: boolean, whilteListed?: (val: string) => boolean): DomQuery;\n\n /**\n * runs the embedded css\n */\n runCss(): DomQuery;\n\n /**\n * fires a click event on the underlying dom elements\n */\n click(): DomQuery;\n\n /**\n * adds an event listener\n *\n * @param type\n * @param listener\n * @param options\n */\n addEventListener(type: string, listener: (evt: Event) => void, options?: boolean | EventListenerOptions): DomQuery;\n\n /**\n * removes an event listener\n *\n * @param type\n * @param listener\n * @param options\n */\n removeEventListener(type: string, listener: (evt: Event) => void, options?: boolean | EventListenerOptions): DomQuery;\n\n /**\n * fires an event\n */\n fireEvent(eventName: string): void;\n\n /*\n * pushes in optionally a new textContent, and/or returns the current text content\n */\n textContent(joinstr?: string): string;\n\n /*\n * pushes in optionally a new innerText, and/or returns the current innerText\n */\n innerText(joinstr?: string): string;\n\n /**\n * encodes all input elements properly into respective\n * config entries, this can be used\n * for legacy systems, for newer usecases, use the\n * HTML5 Form class which all newer browsers provide\n *\n * @param toMerge optional config which can be merged in\n * @return a copy pf\n */\n encodeFormElement(toMerge): Config;\n\n /**\n * fetches the subnodes from ... to..\n * @param from\n * @param to\n */\n subNodes(from: number, to?: number): DomQuery;\n\n\n /**\n * attach shadow elements\n * 1:1 mapping from attach shadow\n *\n * @param modeParams\n */\n attachShadow(modeParams: { [key: string]: string }): DomQuery\n\n\n /**\n * wait until a condition on the dom is reached\n *\n * @return a promise on the affected elements where the condition\n * @throws an error in case of a timeout\n */\n waitUntilDom(condition: (element: DomQuery) => boolean, options: WAIT_OPTS): Promise<DomQuery>;\n\n //observable: Observable<DomQuery>;\n\n //observableElem: Observable<Element>;\n}\n\n/**\n * Monadic DomNode representation, ala jquery\n * This is a thin wrapper over querySelectorAll\n * to get slim monadic support\n * to reduce implementation code on the users side.\n * This is vital for frameworks which want to rely on\n * plain dom but still do not want to lose\n * the reduced code footprint of querying dom trees and traversing\n * by using functional patterns.\n *\n * Also a few convenience methods are added to reduce\n * the code footprint of standard dom processing\n * operations like eval\n *\n * TODO add jquery fallback support, since it is supported\n * in most older systems\n * Note parts of this code still stem from the Dom.js I have written 10 years\n * ago, those parts look a little bit ancient and will be replaced over time.\n *\n */\nexport class DomQuery implements IDomQuery, IStreamDataSource<DomQuery>, Iterable<DomQuery> {\n\n static absent = new DomQuery();\n\n /**\n * reference to the environmental global object\n */\n static global = _global$;\n\n private rootNode: Array<Element> = [];\n\n pos = -1;\n\n constructor(...rootNode: Array<Element | ShadowRoot | DomQuery | Document | Array<any> | string>) {\n\n if (Optional.fromNullable(rootNode).isAbsent() || !rootNode.length) {\n return;\n } else {\n //we need to flatten out the arrays\n\n for (let cnt = 0; cnt < rootNode.length; cnt++) {\n if (!rootNode[cnt]) {\n //we skip possible null entries which can happen in\n //certain corner conditions due to the constructor re-wrapping single elements into arrays.\n } else if (isString(rootNode[cnt])) {\n let foundElement = DomQuery.querySelectorAll(<string>rootNode[cnt]);\n if (!foundElement.isAbsent()) {\n rootNode.push(...foundElement.values)\n }\n } else if (rootNode[cnt] instanceof DomQuery) {\n this.rootNode.push(...(<any>rootNode[cnt]).values);\n } else {\n this.rootNode.push(<any>rootNode[cnt]);\n }\n }\n }\n }\n\n\n /**\n * returns the first element\n */\n get value(): Optional<Element> {\n return this.getAsElem(0);\n }\n\n get values(): Element[] {\n return this.allElems();\n }\n\n get global(): any {\n return _global$;\n }\n\n /**\n * returns the id of the first element\n */\n get id(): ValueEmbedder<string> {\n return new ElementAttribute(this.get(0), \"id\");\n }\n\n /**\n * length of the entire query set\n */\n get length(): number {\n return this.rootNode.length\n }\n\n /**\n * convenience method for tagName\n */\n get tagName(): Optional<string> {\n return <Optional<string>>this.getAsElem(0).getIf(\"tagName\");\n }\n\n /**\n * convenience method for nodeName\n */\n get nodeName(): Optional<string> {\n return <Optional<string>>this.getAsElem(0).getIf(\"nodeName\");\n }\n\n isTag(tagName: string): boolean {\n return !this.isAbsent()\n && (this.nodeName.orElse(\"__none___\")\n .value.toLowerCase() == tagName.toLowerCase()\n || this.tagName.orElse(\"__none___\")\n .value.toLowerCase() == tagName.toLowerCase()\n )\n }\n\n /**\n * convenience property for type\n *\n * returns null in case of no type existing otherwise\n * the type of the first element\n */\n get type(): Optional<string> {\n return this.getAsElem(0).getIf(\"type\");\n }\n\n /**\n * convenience property for name\n *\n * returns null in case of no type existing otherwise\n * the name of the first element\n */\n get name(): ValueEmbedder<string> {\n return new ValueEmbedder(this.getAsElem(0).value, \"name\");\n }\n\n /**\n * convenience property for value\n *\n * returns null in case of no type existing otherwise\n * the value of the first element\n */\n get inputValue(): ValueEmbedder<string | boolean> {\n if (this.getAsElem(0).getIf(\"value\").isPresent()) {\n return new ValueEmbedder<string>(this.getAsElem(0).value);\n } else {\n return <any>ValueEmbedder.absent;\n }\n }\n\n get val(): string | boolean {\n return this.inputValue.value;\n }\n\n set val(value: string | boolean) {\n this.inputValue.value = value;\n }\n\n get checked(): boolean {\n return Stream.of(...this.values).allMatch(el => !!(<any>el).checked);\n }\n\n set checked(newChecked: boolean) {\n this.eachElem(el => (<any>el).checked = newChecked);\n }\n\n get elements(): DomQuery {\n //a simple querySelectorAll should suffice\n return this.querySelectorAll(\"input, checkbox, select, textarea, fieldset\");\n }\n\n get deepElements(): DomQuery {\n let elemStr = \"input, select, textarea, checkbox, fieldset\";\n return this.querySelectorAllDeep(elemStr);\n }\n\n /**\n * a deep search which treats the single isolated shadow doms\n * separately and runs the query on earch shadow dom\n * @param queryStr\n */\n querySelectorAllDeep(queryStr: string): DomQuery {\n let found: Array<DomQuery> = [];\n let queryRes = this.querySelectorAll(queryStr);\n if (queryRes.length) {\n found.push(queryRes);\n }\n let shadowRoots = this.querySelectorAll(\"*\").shadowRoot;\n if (shadowRoots.length) {\n let shadowRes = shadowRoots.querySelectorAllDeep(queryStr);\n if (shadowRes.length) {\n found.push(shadowRes);\n }\n }\n return new DomQuery(...found);\n }\n\n\n /**\n * todo align this api with the rest of the apis\n */\n get disabled(): boolean {\n return this.attr(\"disabled\").isPresent();\n }\n\n set disabled(disabled: boolean) {\n // this.attr(\"disabled\").value = disabled + \"\";\n if (!disabled) {\n this.removeAttribute(\"disabled\");\n } else {\n this.attr(\"disabled\").value = \"disabled\";\n }\n\n }\n\n removeAttribute(name: string) {\n this.eachElem(item => item.removeAttribute(name));\n }\n\n get childNodes(): DomQuery {\n let childNodeArr: Array<Element> = [];\n this.eachElem((item: Element) => {\n childNodeArr = childNodeArr.concat(objToArray(item.childNodes));\n });\n return new DomQuery(...childNodeArr);\n }\n\n /**\n * binding into stream\n */\n get stream(): Stream<DomQuery> {\n return new Stream<DomQuery>(...this.asArray);\n }\n\n /**\n * fetches a lazy stream representation\n * lazy should be applied if you have some filters etc\n * in between, this can reduce the number of post filter operations\n * and ram usage\n * significantly because the operations are done lazily and stop\n * once they hit a dead end.\n */\n get lazyStream(): LazyStream<DomQuery> {\n return LazyStream.of(...this.asArray);\n }\n\n get asArray(): Array<DomQuery> {\n //filter not supported by IE11\n return [].concat(LazyStream.of(...this.rootNode).filter(item => {\n return item != null\n })\n .map(item => {\n return DomQuery.byId(item)\n }).collect(new ArrayCollector()));\n }\n\n get offsetWidth(): number {\n return LazyStream.of(...this.rootNode)\n .filter(item => item != null)\n .map(elem => (elem as HTMLElement).offsetWidth)\n .reduce((accumulate, incoming) => accumulate + incoming, 0).value;\n }\n\n get offsetHeight(): number {\n return LazyStream.of(...this.rootNode)\n .filter(item => item != null)\n .map(elem => (elem as HTMLElement).offsetHeight)\n .reduce((accumulate, incoming) => accumulate + incoming, 0).value;\n }\n\n get offsetLeft(): number {\n return LazyStream.of(...this.rootNode)\n .filter(item => item != null)\n .map(elem => (elem as HTMLElement).offsetLeft)\n .reduce((accumulate, incoming) => accumulate + incoming, 0).value;\n }\n\n get offsetTop(): number {\n return LazyStream.of(...this.rootNode)\n .filter(item => item != null)\n .map(elem => (elem as HTMLElement).offsetTop)\n .reduce((accumulate, incoming) => accumulate + incoming, 0).value;\n }\n\n get asNodeArray(): Array<DomQuery> {\n return [].concat(Stream.of(this.rootNode).filter(item => item != null).collect(new ArrayCollector()));\n }\n\n\n static querySelectorAllDeep(selector: string) {\n return new DomQuery(document).querySelectorAllDeep(selector);\n }\n\n /**\n * easy query selector all producer\n *\n * @param selector the selector\n * @returns a results dom query object\n */\n static querySelectorAll(selector: string): DomQuery {\n if (selector.indexOf(\"/shadow/\") != -1) {\n return new DomQuery(document)._querySelectorAllDeep(selector);\n } else {\n return new DomQuery(document)._querySelectorAll(selector);\n }\n }\n\n /**\n * byId producer\n *\n * @param selector id\n * @param deep true if you want to go into shadow areas\n * @return a DomQuery containing the found elements\n */\n static byId(selector: string | DomQuery | Element, deep = false): DomQuery {\n if (isString(selector)) {\n return (!deep) ? new DomQuery(document).byId(<string>selector) : new DomQuery(document).byIdDeep(<string>selector);\n } else {\n return new DomQuery(<any>selector);\n }\n }\n\n /**\n * byTagName producer\n *\n * @param selector name\n * @return a DomQuery containing the found elements\n */\n static byTagName(selector: string | DomQuery | Element): DomQuery {\n if (isString(selector)) {\n return new DomQuery(document).byTagName(<string>selector);\n } else {\n return new DomQuery(<any>selector);\n }\n }\n\n static globalEval(code: string, nonce?: string): DomQuery {\n return new DomQuery(document).globalEval(code, nonce);\n }\n\n static globalEvalSticky(code: string, nonce?: string): DomQuery {\n return new DomQuery(document).globalEvalSticky(code, nonce);\n }\n\n /**\n * builds the ie nodes properly in a placeholder\n * and bypasses a non script insert bug that way\n * @param markup the marku code\n */\n static fromMarkup(markup: string): DomQuery {\n\n //https://developer.mozilla.org/de/docs/Web/API/DOMParser license creative commons\n const doc = document.implementation.createHTMLDocument(\"\");\n markup = trim(markup);\n let lowerMarkup = markup.toLowerCase();\n if (lowerMarkup.indexOf('<!doctype') != -1 ||\n lowerMarkup.indexOf('<html') != -1 ||\n lowerMarkup.indexOf('<head') != -1 || //TODO proper regexps here to avoid embedded tags with same element names to be triggered\n lowerMarkup.indexOf('<body') != -1) {\n doc.documentElement.innerHTML = markup;\n return new DomQuery(doc.documentElement);\n } else {\n let startsWithTag = function (str: string, tagName: string) {\n let tag1 = [\"<\", tagName, \">\"].join(\"\");\n let tag2 = [\"<\", tagName, \" \"].join(\"\");\n return (str.indexOf(tag1) == 0) || (str.indexOf(tag2) == 0);\n };\n\n let dummyPlaceHolder = new DomQuery(document.createElement(\"div\"));\n\n //table needs special treatment due to the browsers auto creation\n if (startsWithTag(lowerMarkup, \"thead\") || startsWithTag(lowerMarkup, \"tbody\")) {\n dummyPlaceHolder.html(`<table>${markup}</table>`);\n return dummyPlaceHolder.querySelectorAll(\"table\").get(0).childNodes.detach();\n } else if (startsWithTag(lowerMarkup, \"tfoot\")) {\n dummyPlaceHolder.html(`<table><thead></thead><tbody><tbody${markup}</table>`);\n return dummyPlaceHolder.querySelectorAll(\"table\").get(2).childNodes.detach();\n } else if (startsWithTag(lowerMarkup, \"tr\")) {\n dummyPlaceHolder.html(`<table><tbody>${markup}</tbody></table>`);\n return dummyPlaceHolder.querySelectorAll(\"tbody\").get(0).childNodes.detach();\n } else if (startsWithTag(lowerMarkup, \"td\")) {\n dummyPlaceHolder.html(`<table><tbody><tr>${markup}</tr></tbody></table>`);\n return dummyPlaceHolder.querySelectorAll(\"tr\").get(0).childNodes.detach();\n }\n\n dummyPlaceHolder.html(markup);\n return dummyPlaceHolder.childNodes.detach();\n }\n\n }\n\n /**\n * returns the nth element as domquery\n * from the internal elements\n * note if you try to reach a non existing element position\n * you will get back an absent entry\n *\n * @param index the nth index\n */\n get(index: number): DomQuery {\n return (index < this.rootNode.length) ? new DomQuery(this.rootNode[index]) : DomQuery.absent;\n }\n\n\n /**\n * returns the nth element as optional of an Element object\n * @param index the number from the index\n * @param defaults the default value if the index is overrun default Optional.absent\n */\n getAsElem(index: number, defaults: Optional<any> = Optional.absent): Optional<Element> {\n return (index < this.rootNode.length) ? Optional.fromNullable(this.rootNode[index]) : defaults;\n }\n\n /**\n * returns the files from a given elmement\n * @param index\n */\n filesFromElem(index: number): Array<any> {\n return (index < this.rootNode.length) ? (<any>this.rootNode[index])?.files ? (<any>this.rootNode[index]).files : [] : [];\n }\n\n /**\n * returns the value array< of all elements\n */\n allElems(): Array<Element> {\n return this.rootNode;\n }\n\n /**\n * absent no values reached?\n */\n isAbsent(): boolean {\n return this.length == 0;\n }\n\n /**\n * should make the code clearer\n * note if you pass a function\n * this refers to the active dopmquery object\n */\n isPresent(presentRunnable ?: (elem ?: DomQuery) => void): boolean {\n let absent = this.isAbsent();\n if (!absent && presentRunnable) {\n presentRunnable.call(this, this)\n }\n return !absent;\n }\n\n /**\n * should make the code clearer\n * note if you pass a function\n * this refers to the active dopmquery object\n *\n *\n * @param presentRunnable\n */\n ifPresentLazy(presentRunnable: (elem ?: DomQuery) => void = function () {\n }): DomQuery {\n this.isPresent.call(this, presentRunnable);\n return this;\n }\n\n /**\n * remove all affected nodes from this query object from the dom tree\n */\n delete() {\n this.eachElem((node: Element) => {\n if (node.parentNode) {\n node.parentNode.removeChild(node);\n }\n });\n }\n\n querySelectorAll(selector): DomQuery {\n //We could merge both methods, but for now this is more readable\n if (selector.indexOf(\"/shadow/\") != -1) {\n return this._querySelectorAllDeep(selector);\n } else {\n return this._querySelectorAll(selector);\n }\n }\n\n /**\n * query selector all on the existing dom queryX object\n *\n * @param selector the standard selector\n * @return a DomQuery with the results\n */\n private _querySelectorAll(selector): DomQuery {\n if (!this?.rootNode?.length) {\n return this;\n }\n let nodes = [];\n for (let cnt = 0; cnt < this.rootNode.length; cnt++) {\n if (!this.rootNode[cnt]?.querySelectorAll) {\n continue;\n }\n let res = this.rootNode[cnt].querySelectorAll(selector);\n nodes = nodes.concat(objToArray(res));\n }\n\n return new DomQuery(...nodes);\n }\n\n\n /*deep with a selector and a peudo /shadow/ marker to break into the next level*/\n private _querySelectorAllDeep(selector): DomQuery {\n if (!this?.rootNode?.length) {\n return this;\n }\n\n let foundNodes: DomQuery = new DomQuery(...this.rootNode);\n let selectors = selector.split(/\\/shadow\\//);\n\n for (let cnt2 = 0; cnt2 < selectors.length; cnt2++) {\n if (selectors[cnt2] == \"\") {\n continue;\n }\n let levelSelector = selectors[cnt2];\n foundNodes = foundNodes.querySelectorAll(levelSelector);\n if (cnt2 < selectors.length - 1) {\n foundNodes = foundNodes.shadowRoot;\n }\n }\n\n return foundNodes;\n }\n\n /**\n * core byId method\n * @param id the id to search for\n * @param includeRoot also match the root element?\n */\n byId(id: string, includeRoot?: boolean): DomQuery {\n let res: Array<DomQuery> = [];\n if (includeRoot) {\n res = res.concat(\n LazyStream.of(...(this?.rootNode || []))\n .filter(item => id == item.id)\n .map(item => new DomQuery(item))\n .collect(new ArrayCollector())\n );\n }\n\n //for some strange kind of reason the # selector fails\n //on hidden elements we use the attributes match selector\n //that works\n res = res.concat(this.querySelectorAll(`[id=\"${id}\"]`));\n return new DomQuery(...res);\n }\n\n\n byIdDeep(id: string, includeRoot?: boolean): DomQuery {\n let res: Array<DomQuery> = [];\n if (includeRoot) {\n res = res.concat(\n LazyStream.of(...(this?.rootNode || []))\n .filter(item => id == item.id)\n .map(item => new DomQuery(item))\n .collect(new ArrayCollector())\n );\n }\n\n let subItems = this.querySelectorAllDeep(`[id=\"${id}\"]`);\n if (subItems.length) {\n res.push(subItems);\n }\n\n return new DomQuery(...res);\n }\n\n /**\n * same as byId just for the tag name\n * @param tagName the tagname to search for\n * @param includeRoot shall the root element be part of this search\n * @param deep do we also want to go into shadow dom areas\n */\n byTagName(tagName: string, includeRoot ?: boolean, deep ?: boolean): DomQuery {\n let res: Array<Element | DomQuery> = [];\n if (includeRoot) {\n res = <any>LazyStream.of(...(this?.rootNode ?? []))\n .filter(element => element?.tagName == tagName)\n .reduce<Array<Element | DomQuery>>((reduction: any, item: Element) => reduction.concat([item]), res)\n .orElse(res).value;\n }\n\n (deep) ? res.push(this.querySelectorAllDeep(tagName)) : res.push(this.querySelectorAll(tagName));\n return new DomQuery(...res);\n }\n\n /**\n * attr accessor, usage myQuery.attr(\"class\").value = \"bla\"\n * or let value myQuery.attr(\"class\").value\n * @param attr the attribute to set\n * @param defaultValue the default value in case nothing is presented (defaults to null)\n */\n attr(attr: string, defaultValue: string = null): ElementAttribute {\n return new ElementAttribute(this, attr, defaultValue);\n }\n\n style(cssProperty: string, defaultValue: string = null): Style {\n return new Style(this, cssProperty, defaultValue);\n }\n\n\n /**\n * hasclass, checks for an existing class in the class attributes\n *\n * @param clazz the class to search for\n */\n hasClass(clazz: string) {\n let hasIt = false;\n this.eachElem(node => {\n hasIt = node.classList.contains(clazz);\n if (hasIt) {\n return false;\n }\n });\n return hasIt;\n }\n\n /**\n * appends a class string if not already in the element(s)\n *\n * @param clazz the style class to append\n */\n addClass(clazz: string): DomQuery {\n this.eachElem(item => item.classList.add(clazz))\n return this;\n }\n\n /**\n * remove the style class if in the class definitions\n *\n * @param clazz\n */\n removeClass(clazz: string): DomQuery {\n this.eachElem(item => item.classList.remove(clazz));\n return this;\n }\n\n /**\n * checks whether we have a multipart element in our children\n * or are one\n */\n isMultipartCandidate(deep = false): boolean {\n const FILE_INPUT = \"input[type='file']\";\n return this.matchesSelector(FILE_INPUT) ||\n ((!deep) ? this.querySelectorAll(FILE_INPUT) :\n this.querySelectorAllDeep(FILE_INPUT)).first().isPresent();\n }\n\n /**\n * innerHtml equivalkent\n * equivalent to jqueries html\n * as setter the html is set and the\n * DomQuery is given back\n * as getter the html string is returned\n *\n * @param inval\n */\n html(inval?: string): DomQuery | Optional<string> {\n if (Optional.fromNullable(inval).isAbsent()) {\n return this.isPresent() ? Optional.fromNullable(this.innerHTML) : Optional.absent;\n }\n this.innerHTML = inval;\n\n return this;\n }\n\n /**\n * Standard dispatch event method, delegated from node\n */\n dispatchEvent(evt: Event): DomQuery {\n this.eachElem(elem => elem.dispatchEvent(evt));\n return this;\n }\n\n set innerHTML(inVal: string) {\n this.eachElem(elem => elem.innerHTML = inVal);\n }\n\n get innerHTML(): string {\n let retArr = [];\n this.eachElem(elem => retArr.push(elem.innerHTML));\n return retArr.join(\"\");\n }\n\n set innerHtml(inval: string) {\n this.innerHTML = inval;\n }\n\n get innerHtml(): string {\n return this.innerHTML;\n }\n\n //source: https://developer.mozilla.org/en-US/docs/Web/API/Element/matches\n //code snippet license: https://creativecommons.org/licenses/by-sa/2.5/\n private _mozMatchesSelector(toMatch: Element, selector: string): boolean {\n let prot: { [key: string]: Function } = (<any>toMatch);\n let matchesSelector: Function = prot.matches ||\n prot.matchesSelector ||\n prot.mozMatchesSelector ||\n prot.msMatchesSelector ||\n prot.oMatchesSelector ||\n prot.webkitMatchesSelector ||\n function (s: string) {\n let matches: NodeListOf<HTMLElement> = (document || ownerDocument).querySelectorAll(s),\n i = matches.length;\n while (--i >= 0 && matches.item(i) !== toMatch) {\n }\n return i > -1;\n };\n return matchesSelector.call(toMatch, selector);\n }\n\n /**\n * filters the current dom query elements\n * upon a given selector\n *\n * @param selector\n */\n filterSelector(selector: string): DomQuery {\n let matched = [];\n\n this.eachElem(item => {\n if (this._mozMatchesSelector(item, selector)) {\n matched.push(item)\n }\n });\n return new DomQuery(...matched);\n }\n\n /**\n * checks whether any item in this domQuery level matches the selector\n * if there is one element only attached, as root the match is only\n * performed on this element.\n * @param selector\n */\n matchesSelector(selector: string): boolean {\n const ret = this.lazyStream\n .map(item => this._mozMatchesSelector(item.getAsElem(0).value, selector))\n .filter(match => match)\n .first();\n return ret.isPresent();\n }\n\n /**\n * easy node traversal, you can pass\n * a set of node selectors which are joined as direct childs\n *\n * not the rootnodes are not in the getIf, those are always the child nodes\n *\n * @param nodeSelector\n */\n getIf(...nodeSelector: Array<string>): DomQuery {\n\n let selectorStage: DomQuery = this.childNodes;\n for (let cnt = 0; cnt < nodeSelector.length; cnt++) {\n selectorStage = selectorStage.filterSelector(nodeSelector[cnt]);\n if (selectorStage.isAbsent()) {\n return selectorStage;\n }\n }\n return selectorStage;\n }\n\n eachElem(func: (item: Element, cnt?: number) => any): DomQuery {\n\n for (let cnt = 0, len = this.rootNode.length; cnt < len; cnt++) {\n if (func(this.rootNode[cnt], cnt) === false) {\n break;\n }\n }\n return this;\n }\n\n firstElem(func: (item: Element, cnt?: number) => any = item => item): DomQuery {\n if (this.rootNode.length > 1) {\n func(this.rootNode[0], 0);\n }\n return this;\n }\n\n lastElem(func: (item: Element, cnt?: number) => any = item => item): DomQuery {\n if (this.rootNode.length > 1) {\n func(this.rootNode[this.rootNode.length - 1], 0);\n }\n return this;\n }\n\n each(func: (item: DomQuery, cnt?: number) => any): DomQuery {\n Stream.of(...this.rootNode)\n .each((item, cnt) => {\n //we could use a filter, but for the best performance we dont\n if (item == null) {\n return;\n }\n return func(DomQuery.byId(item), cnt);\n });\n\n return this;\n }\n\n /**\n * returns a new dom query containing only the first element max\n *\n * @param func a an optional callback function to perform an operation on the first element\n */\n first(func: (item: DomQuery, cnt?: number) => any = (item) => item): DomQuery {\n if (this.rootNode.length >= 1) {\n func(this.get(0), 0);\n return this.get(0);\n }\n return this;\n }\n\n /**\n * returns a new dom query containing only the first element max\n *\n * @param func a an optional callback function to perform an operation on the first element\n */\n last(func: (item: DomQuery, cnt?: number) => any = (item) => item): DomQuery {\n if (this.rootNode.length >= 1) {\n let lastNode = this.get(this.rootNode.length - 1);\n func(lastNode, 0);\n return lastNode;\n }\n return this;\n }\n\n /**\n * filter function which filters a subset\n *\n * @param func\n */\n filter(func: (item: DomQuery) => boolean): DomQuery {\n let reArr: Array<DomQuery> = [];\n this.each((item: DomQuery) => {\n func(item) ? reArr.push(item) : null;\n });\n return new DomQuery(...<any>reArr);\n }\n\n //TODO append prepend\n\n /**\n * global eval head appendix method\n * no other methods are supported anymore\n * @param code the code to be evaled\n * @param nonce optional nonce key for higher security\n */\n globalEval(code: string, nonce ?: string): DomQuery {\n let head = document.getElementsByTagName(\"head\")[0] || document.documentElement;\n let script = document.createElement(\"script\");\n if (nonce) {\n if ('undefined' != typeof script?.nonce) {\n script.nonce = nonce;\n } else {\n script.setAttribute(\"nonce\", nonce);\n }\n }\n script.type = \"text/javascript\";\n script.innerHTML = code;\n let newScriptElement = head.appendChild(script);\n head.removeChild(newScriptElement);\n return this;\n }\n\n /**\n * global eval head appendix method\n * no other methods are supported anymore\n * @param code the code to be evaled\n * @param nonce optional nonce key for higher security\n */\n globalEvalSticky(code: string, nonce ?: string): DomQuery {\n let head = document.getElementsByTagName(\"head\")[0] || document.documentElement;\n let script = document.createElement(\"script\");\n if (nonce) {\n if ('undefined' != typeof script?.nonce) {\n script.nonce = nonce;\n } else {\n script.setAttribute(\"nonce\", nonce);\n }\n }\n script.type = \"text/javascript\";\n script.innerHTML = code;\n head.appendChild(script);\n return this;\n }\n\n /**\n * detaches a set of nodes from their parent elements\n * in a browser independend manner\n * @return {Array} an array of nodes with the detached dom nodes\n */\n detach(): DomQuery {\n this.eachElem((item: Element) => {\n item.parentNode.removeChild(item);\n });\n return this;\n }\n\n /**\n * appends the current set of elements\n * to the element or first element passed via elem\n * @param elem\n */\n appendTo(elem: DomQuery | string): DomQuery {\n if (Lang.isString(elem)) {\n this.appendTo(DomQuery.querySelectorAll(elem as string));\n return this;\n }\n this.eachElem((item) => {\n let value1: Element = <Element>(elem as DomQuery).getAsElem(0).orElseLazy(() => {\n return {\n appendChild: () => {\n }\n }\n }).value;\n value1.appendChild(item);\n });\n return this;\n }\n\n /**\n * loads and evals a script from a source uri\n *\n * @param src the source to be loaded and evaled\n * @param defer in miliseconds execution default (0 == no defer)\n * @param charSet\n */\n loadScriptEval(src: string, defer: number = 0, nonce?: string) {\n this._loadScriptEval(false, src, defer, nonce);\n\n return this;\n }\n\n\n /**\n * loads and evals a script from a source uri\n *\n * @param src the source to be loaded and evaled\n * @param defer in miliseconds execution default (0 == no defer)\n * @param charSet\n */\n loadScriptEvalSticky(src: string, defer: number = 0, nonce?: string) {\n this._loadScriptEval(true, src, defer, nonce);\n\n return this;\n }\n\n\n private _loadScriptEval(sticky: boolean, src: string, defer: number = 0, nonce ?: string) {\n let srcNode = this.createSourceNode(src, nonce);\n let nonceCheck = this.createSourceNode(null, nonce);\n let marker = `nonce_${Date.now()}_${Math.random()}`;\n nonceCheck.innerHTML = `document.head[\"${marker}\"] = true` //noop\n\n let head = document.head;\n // upfront nonce check, needed mostly for testing\n // but cannot hurt to block src calls which have invalid nonce on localhost\n // the reason for doing this up until now we have a similar construct automatically\n // by loading the scripts via xhr and then embedding them.\n // this is not needed anymore but the nonce is more relaxed with script src\n // we now enforce it the old way\n\n head.appendChild(nonceCheck);\n head.removeChild(nonceCheck);\n if(!head[marker]) {\n return;\n }\n try {\n if (!defer) {\n head.appendChild(srcNode);\n if(!sticky) {\n head.removeChild(srcNode);\n }\n } else {\n setTimeout(() => {\n head.appendChild(srcNode);\n if(!sticky) {\n head.removeChild(srcNode);\n }\n }, defer);\n }\n } finally {\n delete head[marker];\n }\n\n return this;\n }\n\n insertAfter(...toInsertParams: Array<DomQuery>): DomQuery {\n\n this.each(existingItem => {\n let existingElement = existingItem.getAsElem(0).value;\n let rootNode = existingElement.parentNode;\n for (let cnt = 0; cnt < toInsertParams.length; cnt++) {\n let nextSibling: Element = <any>existingElement.nextSibling;\n toInsertParams[cnt].eachElem(insertElem => {\n if (nextSibling) {\n rootNode.insertBefore(insertElem, nextSibling);\n existingElement = nextSibling;\n } else {\n rootNode.appendChild(insertElem);\n }\n });\n\n }\n });\n\n let res = [];\n res.push(this);\n res = res.concat(toInsertParams);\n return new DomQuery(...res);\n }\n\n insertBefore(...toInsertParams: Array<DomQuery>): DomQuery {\n this.each(existingItem => {\n let existingElement = existingItem.getAsElem(0).value;\n let rootNode = existingElement.parentNode;\n for (let cnt = 0; cnt < toInsertParams.length; cnt++) {\n toInsertParams[cnt].eachElem(insertElem => {\n rootNode.insertBefore(insertElem, existingElement);\n });\n }\n });\n let res = [];\n res.push(this);\n res = res.concat(toInsertParams);\n return new DomQuery(...res);\n }\n\n orElse(...elseValue: any): DomQuery {\n if (this.isPresent()) {\n return this;\n } else {\n return new DomQuery(...elseValue);\n }\n }\n\n orElseLazy(func: () => any): DomQuery {\n if (this.isPresent()) {\n return this;\n } else {\n return new DomQuery(func());\n }\n }\n\n parents(tagName: string): DomQuery {\n const retSet: Set<Element> = new Set();\n const retArr: Array<Element> = [];\n const lowerTagName = tagName.toLowerCase();\n\n let resolveItem = (item: Element) => {\n if ((item.tagName || \"\").toLowerCase() == lowerTagName && !retSet.has(item)) {\n retSet.add(item);\n retArr.push(item);\n }\n };\n\n this.eachElem((item: Element) => {\n while (item.parentNode || (<any>item).host) {\n item = <Element>item?.parentNode ?? (<any>item)?.host;\n\n resolveItem(item);\n //nested forms not possible, performance shortcut\n if (tagName == \"form\" && retArr.length) {\n return false;\n }\n }\n });\n\n return new DomQuery(...retArr);\n }\n\n copyAttrs(sourceItem: DomQuery | XMLQuery): DomQuery {\n sourceItem.eachElem((sourceNode: Element) => {\n let attrs: Array<Attr> = objToArray(sourceNode.attributes);\n for (let item of attrs) {\n let value: string = item.value;\n let name: string = item.name;\n\n switch (name) {\n case \"id\":\n this.id.value = value;\n break;\n case \"disabled\":\n this.resolveAttributeHolder(\"disabled\").disabled = value;\n break;\n case \"checked\":\n this.resolveAttributeHolder(\"checked\").checked = value;\n break;\n default:\n this.attr(name).value = value;\n }\n }\n });\n return this;\n }\n\n /**\n * resolves an attribute holder compared\n * @param attrName the attribute name\n */\n private resolveAttributeHolder(attrName: string = \"value\"): HTMLFormElement | any {\n let ret = [];\n ret[attrName] = null;\n return (attrName in this.getAsElem(0).value) ?\n this.getAsElem(0).value :\n ret;\n }\n\n /**\n * outerhtml convenience method\n * browsers only support innerHTML but\n * for instance for your jsf.js we have a full\n * replace pattern which needs outerHTML processing\n *\n * @param markup the markup which should replace the root element\n * @param runEmbeddedScripts if true the embedded scripts are executed\n * @param runEmbeddedCss if true the embeddec css are executed\n * @param deep should this also work for shadow dom (run scripts etc...)\n */\n outerHTML(markup: string, runEmbeddedScripts ?: boolean, runEmbeddedCss ?: boolean, deep = false): DomQuery {\n if (this.isAbsent()) {\n return;\n }\n\n let focusElementId = document?.activeElement?.id;\n let caretPosition = (focusElementId) ? DomQuery.getCaretPosition(document.activeElement) : null;\n let nodes = DomQuery.fromMarkup(markup);\n let res = [];\n let toReplace = this.getAsElem(0).value;\n let firstInsert = nodes.get(0);\n let parentNode = toReplace.parentNode;\n let replaced = firstInsert.getAsElem(0).value;\n parentNode.replaceChild(replaced, toReplace);\n res.push(new DomQuery(replaced));\n //no replacement possible\n if (this.isAbsent()) {\n return this;\n }\n\n let insertAdditionalItems = [];\n\n if (nodes.length > 1) {\n insertAdditionalItems = insertAdditionalItems.concat(...nodes.values.slice(1));\n res.push(DomQuery.byId(replaced).insertAfter(new DomQuery(...insertAdditionalItems)));\n }\n\n if (runEmbeddedScripts) {\n this.runScripts();\n }\n if (runEmbeddedCss) {\n this.runCss();\n }\n\n let focusElement = DomQuery.byId(focusElementId);\n if (focusElementId && focusElement.isPresent() &&\n caretPosition != null && \"undefined\" != typeof caretPosition) {\n focusElement.eachElem(item => DomQuery.setCaretPosition(item, caretPosition));\n }\n\n return nodes;\n }\n\n /**\n * Run through the given nodes in the DomQuery execute the inline scripts\n * @param sticky if set to true the evaled elements will stick to the head, default false\n * @param whilteListed: optional whitelist function which can filter out script tags which are not processed\n * defaults to the standard jsf.js exclusion (we use this code for myfaces)\n */\n runScripts(sticky = false, whilteListed: (val: string) => boolean = DEFAULT_WHITELIST): DomQuery {\n const evalCollectedScripts = (scriptsToProcess: { evalText: string, nonce: string }[]) => {\n if (scriptsToProcess.length) {\n //script source means we have to eval the existing\n //scripts before running the include\n //this.globalEval(finalScripts.join(\"\\n\"));\n let joinedScripts = [];\n Stream.of(...scriptsToProcess).each(item => {\n if (!item.nonce) {\n joinedScripts.push(item.evalText)\n } else {\n if (joinedScripts.length) {\n this.globalEval(joinedScripts.join(\"\\n\"));\n joinedScripts.length = 0;\n }\n\n (!sticky) ?\n this.globalEval(item.evalText, item.nonce) :\n this.globalEvalSticky(item.evalText, item.nonce);\n }\n });\n if (joinedScripts.length) {\n (!sticky) ? this.globalEval(joinedScripts.join(\"\\n\")) :\n this.globalEvalSticky(joinedScripts.join(\"\\n\"));\n joinedScripts.length = 0;\n }\n\n scriptsToProcess = [];\n }\n return scriptsToProcess;\n }\n\n let finalScripts = [],\n equi = equalsIgnoreCase,\n execScrpt = (item) => {\n let tagName = item.tagName;\n let itemType = item.type || \"\";\n if (tagName && equi(tagName, \"script\") &&\n (itemType === \"\" || equi(itemType, \"text/javascript\") ||\n equi(itemType, \"javascript\") ||\n equi(itemType, \"text/ecmascript\") ||\n equi(itemType, \"ecmascript\"))) {\n let src = item.getAttribute('src');\n if ('undefined' != typeof src\n && null != src\n && src.length > 0\n ) {\n let nonce = item?.nonce ?? item.getAttribute('nonce').value;\n //we have to move this into an inner if because chrome otherwise chokes\n //due to changing the and order instead of relying on left to right\n //if jsf.js is already registered we do not replace it anymore\n if (whilteListed(src)) {\n //we run the collected scripts before running, the include\n finalScripts = evalCollectedScripts(finalScripts);\n if (!sticky) {\n (!!nonce) ? this.loadScriptEval(src, 0, nonce) :\n //if no nonce is set we do not pass any once\n this.loadScriptEval(src, 0);\n } else {\n (!!nonce) ? this.loadScriptEvalSticky(src, 0, nonce) :\n //if no nonce is set we do not pass any once\n this.loadScriptEvalSticky(src, 0);\n }\n }\n\n } else {\n // embedded script auto eval\n //TODO this probably needs to be changed due to our new parsing structures\n //probably not needed anymore\n let evalText = trim(item.text || item.innerText || item.innerHTML);\n let go = true;\n\n while (go) {\n go = false;\n if (evalText.substring(0, 4) == \"<!--\") {\n evalText = evalText.substring(4);\n go = true;\n }\n if (evalText.substring(0, 4) == \"//<!--\") {\n evalText = evalText.substring(6);\n go = true;\n }\n if (evalText.substring(0, 11) == \"//<![CDATA[\") {\n evalText = evalText.substring(11);\n go = true;\n }\n }\n let nonce = item?.nonce ?? item.getAttribute('nonce').value ?? '';\n // we have to run the script under a global context\n //we store the script for less calls to eval\n finalScripts.push({\n nonce,\n evalText\n });\n }\n }\n };\n try {\n let scriptElements = new DomQuery(this.filterSelector(\"script\"), this.querySelectorAll(\"script\"));\n //script execution order by relative pos in their dom tree\n scriptElements.stream\n .flatMap(item => Stream.of(item.values))\n .sort((node1, node2) => node1.compareDocumentPosition(node2) - 3) //preceding 2, following == 4)\n .each(item => execScrpt(item));\n\n evalCollectedScripts(finalScripts);\n } catch (e) {\n if (console && console.error) {\n //not sure if we\n //should use our standard\n //error mechanisms here\n //because in the head appendix\n //method only a console\n //error would be raised as well\n console.error(e.message || e.description);\n }\n } finally {\n //the usual ie6 fix code\n //the IE6 garbage collector is broken\n //nulling closures helps somewhat to reduce\n //mem leaks, which are impossible to avoid\n //at this browser\n execScrpt = null;\n }\n return this;\n }\n\n runCss(): DomQuery {\n\n const applyStyle = (item: Element, style: string) => {\n let newSS: HTMLStyleElement = document.createElement(\"style\");\n document.getElementsByTagName(\"head\")[0].appendChild(newSS);\n\n let styleSheet = newSS.sheet ?? (<any>newSS).styleSheet;\n\n newSS.setAttribute(\"rel\", item.getAttribute(\"rel\") ?? \"stylesheet\");\n newSS.setAttribute(\"type\", item.getAttribute(\"type\") ?? \"text/css\");\n\n if (styleSheet?.cssText ?? false) {\n styleSheet.cssText = style;\n } else {\n newSS.appendChild(document.createTextNode(style));\n }\n },\n\n execCss = (item: Element) => {\n const tagName = item.tagName;\n if (tagName && equalsIgnoreCase(tagName, \"link\") && equalsIgnoreCase(item.getAttribute(\"type\"), \"text/css\")) {\n applyStyle(item, \"@import url('\" + item.getAttribute(\"href\") + \"');\");\n } else if (tagName && equalsIgnoreCase(tagName, \"style\") && equalsIgnoreCase(item.getAttribute(\"type\"), \"text/css\")) {\n let innerText = [];\n //compliant browsers know child nodes\n let childNodes: Array<Node> = Array.prototype.slice.call(item.childNodes);\n if (childNodes) {\n childNodes.forEach(child => innerText.push((<Element>child).innerHTML || (<CharacterData>child).data));\n //non compliant ones innerHTML\n } else if (item.innerHTML) {\n innerText.push(item.innerHTML);\n }\n\n applyStyle(item, innerText.join(\"\"));\n }\n };\n\n const scriptElements: DomQuery = new DomQuery(this.filterSelector(\"link, style\"), this.querySelectorAll(\"link, style\"));\n\n scriptElements.stream\n .flatMap(item => Stream.of(item.values))\n .sort((node1, node2) => node1.compareDocumentPosition(node2) - 3)\n .each(item => execCss(item));\n\n return this;\n }\n\n /**\n * fires a click event on the underlying dom elements\n */\n click(): DomQuery {\n this.fireEvent(\"click\");\n return this;\n }\n\n addEventListener(type: string, listener: (evt: Event) => void, options?: boolean | EventListenerOptions): DomQuery {\n this.eachElem((node: Element) => node.addEventListener(type, listener, options));\n return this;\n }\n\n removeEventListener(type: string, listener: (evt: Event) => void, options?: boolean | EventListenerOptions): DomQuery {\n this.eachElem((node: Element) => node.removeEventListener(type, listener, options));\n return this;\n }\n\n /**\n * fires an event\n */\n fireEvent(eventName: string) {\n this.eachElem((node: Element) => {\n let doc;\n if (node.ownerDocument) {\n doc = node.ownerDocument;\n } else if (node.nodeType == 9) {\n // the node may be the document itself, nodeType 9 = DOCUMENT_NODE\n doc = node;\n } else {\n throw new Error(\"Invalid node passed to fireEvent: \" + node.id);\n }\n\n if (node.dispatchEvent) {\n // Gecko-style approach (now the standard) takes more work\n let eventClass = \"\";\n\n // Different events have different event classes.\n // If this switch statement can't map an eventName to an eventClass,\n // the event firing is going to fail.\n switch (eventName) {\n case \"click\": // Dispatching of 'click' appears to not work correctly in Safari. Use 'mousedown' or 'mouseup' instead.\n case \"mousedown\":\n case \"mouseup\":\n eventClass = \"MouseEvents\";\n break;\n\n case \"focus\":\n case \"change\":\n case \"blur\":\n case \"select\":\n eventClass = \"HTMLEvents\";\n break;\n\n default:\n throw \"fireEvent: Couldn't find an event class for event '\" + eventName + \"'.\";\n }\n let event = doc.createEvent(eventClass);\n event.initEvent(eventName, true, true); // All events created as bubbling and cancelable.\n\n event.synthetic = true; // allow detection of synthetic events\n // The second parameter says go ahead with the default action\n node.dispatchEvent(event);\n } else if ((<any>node).fireEvent) {\n // IE-old school style, you can drop this if you don't need to support IE8 and lower\n let event = doc.createEventObject();\n event.synthetic = true; // allow detection of synthetic events\n (<any>node).fireEvent(\"on\" + eventName, event);\n }\n })\n }\n\n textContent(joinstr: string = \"\"): string {\n return this.stream\n .map((value: DomQuery) => {\n let item = value.getAsElem(0).orElseLazy(() => {\n return <any>{\n textContent: \"\"\n };\n }).value;\n return (<any>item).textContent || \"\";\n })\n .reduce((text1, text2) => text1 + joinstr + text2, \"\").value;\n }\n\n innerText(joinstr: string = \"\"): string {\n return this.stream\n .map((value: DomQuery) => {\n let item = value.getAsElem(0).orElseLazy(() => {\n return <any>{\n innerText: \"\"\n };\n }).value;\n return (<any>item).innerText || \"\";\n })\n .reduce((text1, text2) => [text1, text2].join(joinstr), \"\").value;\n\n }\n\n /**\n * encodes all input elements properly into respective\n * config entries, this can be used\n * for legacy systems, for newer usecases, use the\n * HTML5 Form class which all newer browsers provide\n *\n * @param toMerge optional config which can be merged in\n * @return a copy pf\n */\n encodeFormElement(toMerge = new Config({})): Config {\n\n //browser behavior no element name no encoding (normal submit fails in that case)\n //https://issues.apache.org/jira/browse/MYFACES-2847\n if (this.name.isAbsent()) {\n return;\n }\n\n //lets keep it sideffects free\n let target = toMerge.shallowCopy;\n\n this.each((element: DomQuery) => {\n if (element.name.isAbsent()) {//no name, no encoding\n return;\n }\n let name = element.name.value;\n let tagName = element.tagName.orElse(\"__none__\").value.toLowerCase();\n let elemType = element.type.orElse(\"__none__\").value.toLowerCase();\n\n elemType = elemType.toLowerCase();\n\n // routine for all elements\n // rules:\n // - process only inputs, textareas and selects\n // - elements muest have attribute \"name\"\n // - elements must not be disabled\n if (((tagName == \"input\" || tagName == \"textarea\" || tagName == \"select\") &&\n (name != null && name != \"\")) && !element.disabled) {\n\n // routine for select elements\n // rules:\n // - if select-one and value-Attribute exist => \"name=value\"\n // (also if value empty => \"name=\")\n // - if select-one and value-Attribute don't exist =>\n // \"name=DisplayValue\"\n // - if select multi and multple selected => \"name=value1&name=value2\"\n // - if select and selectedIndex=-1 don't submit\n if (tagName == \"select\") {\n // selectedIndex must be >= 0 sein to be submittet\n let selectElem: HTMLSelectElement = <HTMLSelectElement>element.getAsElem(0).value;\n if (selectElem.selectedIndex >= 0) {\n let uLen = selectElem.options.length;\n for (let u = 0; u < uLen; u++) {\n // find all selected options\n //let subBuf = [];\n if (selectElem.options[u].selected) {\n let elementOption = selectElem.options[u];\n target.append(name).value = (elementOption.getAttribute(\"value\") != null) ?\n elementOption.value : elementOption.text;\n }\n }\n }\n }\n\n // routine for remaining elements\n // rules:\n // - don't submit no selects (processed above), buttons, reset buttons, submit buttons,\n // - submit checkboxes and radio inputs only if checked\n if (\n (\n tagName != Submittables.SELECT &&\n elemType != Submittables.BUTTON &&\n elemType != Submittables.RESET &&\n elemType != Submittables.SUBMIT &&\n elemType != Submittables.IMAGE\n ) && (\n (\n elemType != Submittables.CHECKBOX && elemType != Submittables.RADIO) ||\n element.checked\n )\n ) {\n let files: any = (<any>element.value).value?.files ?? [];\n if (files?.length) {\n //xhr level2\n target.append(name).value = files[0];\n } else {\n target.append(name).value = element.inputValue.value;\n }\n }\n\n }\n });\n\n return target;\n }\n\n get cDATAAsString(): string {\n let TYPE_CDATA_BLOCK = 4;\n\n let res: any = this.lazyStream.flatMap(item => {\n return item.childNodes.stream\n }).filter(item => {\n return item?.value?.value?.nodeType == TYPE_CDATA_BLOCK;\n }).reduce((reduced: Array<any>, item: DomQuery) => {\n reduced.push((<any>item?.value?.value)?.data ?? \"\");\n return reduced;\n }, []).value;\n\n // response may contain several blocks\n return res.join(\"\");\n }\n\n subNodes(from: number, to?: number): DomQuery {\n if (Optional.fromNullable(to).isAbsent()) {\n to = this.length;\n }\n return new DomQuery(...this.rootNode.slice(from, Math.min(to, this.length)));\n }\n\n //TODO this part probably will be removed\n //because we can stream from an array stream directly into the dom query\n _limits = -1;\n\n limits(end: number): IStream<DomQuery> {\n this._limits = end;\n return <any>this;\n }\n\n //-- internally exposed methods needed for the interconnectivity\n hasNext() {\n let isLimitsReached = this._limits != -1 && this.pos >= this._limits - 1;\n let isEndOfArray = this.pos >= this.values.length - 1;\n return !(isLimitsReached ||\n isEndOfArray);\n }\n\n next(): DomQuery {\n if (!this.hasNext()) {\n return null;\n }\n this.pos++;\n return new DomQuery(this.values[this.pos]);\n }\n\n\n lookAhead(cnt = 1): ITERATION_STATUS | DomQuery {\n if ((this.values.length - 1) < (this.pos + cnt)) {\n return ITERATION_STATUS.EO_STRM;\n }\n return new DomQuery(this.values[this.pos + cnt]);\n }\n\n\n current(): DomQuery | ITERATION_STATUS {\n if (this.pos == -1) {\n return ITERATION_STATUS.BEF_STRM;\n }\n return new DomQuery(this.values[this.pos]);\n }\n\n\n reset() {\n this.pos = -1;\n }\n\n attachShadow(params: { [key: string]: string } = {mode: \"open\"}): DomQuery {\n let shadowRoots: DomQuery[] = [];\n this.eachElem((item: Element) => {\n let shadowElement: DomQuery;\n if ((<any>item)?.attachShadow) {\n shadowElement = DomQuery.byId((<any>item).attachShadow(params));\n shadowRoots.push(shadowElement);\n } else {\n throw new Error(\"Shadow dom creation not supported by the browser, please use a shim, to gain this functionality\");\n }\n });\n return new DomQuery(...shadowRoots);\n }\n\n /**\n * helper to fix a common dom problem\n * we have to wait until a certain condition is met, in most of the cases we just want to know whether an element is present in the subdome before being able to proceed\n * @param condition\n * @param options\n */\n async waitUntilDom(condition: (element: DomQuery) => boolean, options: WAIT_OPTS = {\n attributes: true,\n childList: true,\n subtree: true,\n timeout: 500,\n interval: 100\n }): Promise<DomQuery> {\n return waitUntilDom(this, condition, options);\n }\n\n /**\n * returns the embedded shadow elements\n */\n get shadowElements(): DomQuery {\n let shadowElements = this.querySelectorAll(\"*\")\n .filter(item => item.hasShadow);\n\n\n let mapped: Array<ShadowRoot> = (shadowElements.allElems() || []).map(element => element.shadowRoot);\n return new DomQuery(...mapped);\n }\n\n get shadowRoot(): DomQuery {\n let shadowRoots = [];\n for (let cnt = 0; cnt < this.rootNode.length; cnt++) {\n if (this.rootNode[cnt].shadowRoot) {\n shadowRoots.push(this.rootNode[cnt].shadowRoot);\n }\n }\n return new DomQuery(...shadowRoots);\n }\n\n get hasShadow(): boolean {\n for (let cnt = 0; cnt < this.rootNode.length; cnt++) {\n if (this.rootNode[cnt].shadowRoot) {\n return true;\n }\n }\n return false;\n }\n\n //from\n // http://blog.vishalon.net/index.php/javascript-getting-and-setting-caret-position-in-textarea/\n static getCaretPosition(ctrl: any) {\n let caretPos = 0;\n\n try {\n if ((<any>document)?.selection) {\n ctrl.focus();\n let selection = (<any>document).selection.createRange();\n //the selection now is start zero\n selection.moveStart('character', -ctrl.value.length);\n //the caretposition is the selection start\n caretPos = selection.text.length;\n }\n } catch (e) {\n //now this is ugly, but not supported input types throw errors for selectionStart\n //just in case someone dumps this code onto unsupported browsers\n }\n return caretPos;\n }\n\n /**\n * sets the caret position\n *\n * @param ctrl the control to set the caret position to\n * @param pos the position to set\n *\n * note if the control does not have any selectable and focusable behavior\n * calling this method does nothing (silent fail)\n *\n */\n static setCaretPosition(ctrl: any, pos: number) {\n ctrl?.focus ? ctrl?.focus() : null;\n //the selection range is our caret position\n\n ctrl?.setSelectiongRange ? ctrl?.setSelectiongRange(pos, pos) : null;\n }\n\n /**\n * Implementation of an iterator\n * to allow loops over dom query collections\n */\n [Symbol.iterator](): Iterator<DomQuery, any, undefined> {\n return {\n next: () => {\n let done = !this.hasNext();\n let val = this.next();\n return {\n done: done,\n value: <DomQuery>val\n }\n }\n }\n }\n\n /**\n * concats the elements of two Dom Queries into a single one\n * @param toAttach the elements to attach\n * @param filterDoubles filter out possible double elements (aka same markup)\n */\n concat(toAttach: DomQuery, filterDoubles = true): any {\n const ret = this.lazyStream.concat(toAttach.lazyStream).collect(new DomQueryCollector());\n //we now filter the doubles out\n if (!filterDoubles) {\n return ret;\n }\n let idx = {}; //ie11 does not support sets, we have to fake it\n return ret.lazyStream.filter(node => {\n const notFound = !(idx?.[node.value.value.outerHTML as any]);\n idx[node.value.value.outerHTML as any] = true;\n return notFound;\n }).collect(new DomQueryCollector());\n }\n\n append(elem: DomQuery): DomQuery {\n this.each(item => elem.appendTo(item));\n return this;\n }\n\n prependTo(elem: DomQuery): DomQuery {\n elem.eachElem(item => {\n item.prepend(...this.allElems());\n });\n return this;\n }\n\n prepend(elem: DomQuery): DomQuery {\n this.eachElem(item => {\n item.prepend(...elem.allElems());\n })\n return this;\n }\n\n\n /*[observable](): Observable<DomQuery> {\n return this.observable;\n }\n\n get observable(): Observable<DomQuery> {\n let observerFunc = (observer:Subscriber<DomQuery>) => {\n try {\n this.each(dqNode => {\n observer.next(dqNode);\n });\n } catch (e) {\n observer.error(e);\n }\n };\n return new Observable(observerFunc);\n }\n\n get observableElem(): Observable<Element> {\n let observerFunc = (observer:Subscriber<Element>) => {\n try {\n this.eachElem(node => {\n observer.next(node);\n });\n } catch (e) {\n observer.error(e);\n }\n };\n return new Observable(observerFunc);\n }*/\n\n private createSourceNode(src: string | null, nonce?: string) {\n let srcNode: HTMLScriptElement = document.createElement(\"script\");\n srcNode.type = \"text/javascript\";\n if (!!nonce) {\n if ('undefined' != typeof srcNode?.nonce) {\n srcNode.nonce = nonce;\n } else {\n srcNode.setAttribute(\"nonce\", nonce);\n }\n }\n if(!!src) {\n srcNode.src = src;\n }\n\n return srcNode;\n }\n\n}\n\n\n/**\n * Various collectors\n * which can be used in conjunction with Streams\n */\n\n/**\n * A collector which bundles a full dom query stream into a single dom query element\n *\n * This connects basically our stream back into DomQuery\n */\nexport class DomQueryCollector implements ICollector<DomQuery, DomQuery> {\n\n data: DomQuery[] = [];\n\n collect(element: DomQuery) {\n this.data.push(element);\n }\n\n get finalValue(): DomQuery {\n return new DomQuery(...this.data);\n }\n}\n\n/**\n * abbreviation for DomQuery\n */\nexport const DQ = DomQuery;\nexport type DQ = DomQuery;\n// noinspection JSUnusedGlobalSymbols\n/**\n * replacement for the jquery $\n */\nexport const DQ$ = DomQuery.querySelectorAll;\n","/*!\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n/**\n * various environments handle the global variable different\n * we have to deal with this.\n */\nexport function _global$(): any | null {\n let _global$: any = ('undefined' != typeof globalThis && globalThis.window) ? globalThis.window:\n ('undefined' != typeof window) ? window :\n ('undefined' != typeof globalThis) ? globalThis :\n ('undefined' != typeof global && global?.window) ? global.window :\n ('undefined' != typeof global) ? global : null;\n //under test systems we often have a lazy init of the window object under global.window, but we\n //want the window object\n return _global$?.window ?? _global$;\n}\n\n","/*!\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Optional} from \"./Monad\";\n\n/**\n * Lang helpers crossported from the apache myfaces project\n */\nexport module Lang {\n \n\n //should be in lang, but for now here to avoid recursive imports, not sure if typescript still has a problem with those\n /**\n * helper function to savely resolve anything\n * this is not an elvis operator, it resolves\n * a value without exception in a tree and if\n * it is not resolvable then an optional of\n * a default value is restored or Optional.empty\n * if none is given\n *\n * usage\n * <code>\n * let var: Optiona<string> = saveResolve(() => a.b.c.d.e, \"foobaz\")\n * </code>\n *\n * @param resolverProducer a lambda which can produce the value\n * @param defaultValue an optional default value if the producer failes to produce anything\n * @returns an Optional of the produced value\n */\n export function saveResolve<T>(resolverProducer: () => T, defaultValue: T = null): Optional<T> {\n try {\n let result = resolverProducer();\n return Optional.fromNullable(result ?? defaultValue);\n } catch (e) {\n return Optional.absent;\n }\n }\n\n export function saveResolveLazy<T>(resolverProducer: () => T, defaultValue: () => T = null): Optional<T> {\n try {\n let result = resolverProducer();\n return Optional.fromNullable(result ?? defaultValue());\n } catch (e) {\n return Optional.absent;\n }\n }\n\n /**\n * String to array function performs a string to array transformation\n * @param {String} it the string which has to be changed into an array\n * @param {RegExp} splitter our splitter reglar expression\n * @return a trimmed array of the splitted string\n */\n export function strToArray(it: string, splitter: string | RegExp = /\\./gi): Array<string> {\n\n let ret = [];\n it.split(splitter).forEach((element => {\n ret.push(trim(element));\n }));\n return ret;\n }\n\n /**\n * hyperfast trim\n * http://blog.stevenlevithan.com/archives/faster-trim-javascript\n * crossported from dojo\n */\n export function trim(str: string): string {\n str = str.replace(/^\\s\\s*/, '');\n let ws = /\\s/, i = str.length;\n\n while (ws.test(str.charAt(--i))) {\n //do nothing\n }\n return str.slice(0, i + 1);\n }\n\n /**\n * generic object arrays like dom definitions to array conversion method which\n * transforms any object to something array like\n * @param obj\n * @param offset\n * @param pack\n * @returns an array converted from the object\n */\n export function objToArray<T>(obj: any, offset: number = 0, pack: Array<T> = []): Array<T> {\n if ((obj ?? \"__undefined__\") == \"__undefined__\") {\n return pack ?? null;\n }\n //since offset is numeric we cannot use the shortcut due to 0 being false\n //special condition array delivered no offset no pack\n if ((<any>obj) instanceof Array && !offset && !pack) return obj;\n\n return pack.concat(Array.prototype.slice.call(obj, offset));\n }\n\n /**\n * equalsIgnoreCase, case insensitive comparison of two strings\n *\n * @param source\n * @param destination\n */\n export function equalsIgnoreCase(source?: string, destination?: string): boolean {\n let finalSource = source ?? \"___no_value__\";\n let finalDest = destination ?? \"___no_value__\";\n\n //in any other case we do a strong string comparison\n return finalSource.toLowerCase() === finalDest.toLowerCase();\n }\n\n\n /**\n * runtime type assertion\n *\n * @param probe the probe to be tested for a type\n * @param theType the type to be tested for\n */\n export function assertType(probe: any, theType: any): boolean {\n return isString(theType) ? typeof probe == theType : probe instanceof theType;\n }\n\n /**\n * Backported from dojo\n * a failsafe string determination method\n * (since in javascript String != \"\" typeof alone fails!)\n * @param it {|Object|} the object to be checked for being a string\n * @return true in case of being a string false otherwise\n */\n export function isString(it?: any): boolean {\n //\tsummary:\n //\t\tReturn true if it is a String\n return !!arguments.length && it != null && (typeof it == \"string\" || it instanceof String); // Boolean\n }\n\n export function isFunc(it: any): boolean {\n return it instanceof Function || typeof it === \"function\";\n }\n\n // code from https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n // license https://creativecommons.org/licenses/by-sa/2.5/\n export function objAssign(target: any, ...theArgs: any) { // .length of function is 2\n if (target == null) { // TypeError if undefined or null\n throw new TypeError('Cannot convert undefined or null to object');\n }\n\n let to = Object(target);\n if((<any>Object).assign) {\n theArgs.forEach(item => (<any>Object).assign(to, item));\n return to;\n }\n\n theArgs.filter(item => item != null).forEach(item => {\n let nextSource = item;\n Object.keys(nextSource)\n .filter(nextKey => Object.prototype.hasOwnProperty.call(nextSource, nextKey))\n .forEach(nextKey => to[nextKey] = nextSource[nextKey]);\n });\n return to;\n }\n\n\n}\n\n","/*!\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * A module which keeps basic monadish like definitions in place without any sidedependencies to other modules.\n * Useful if you need the functions in another library to keep its dependencies down\n */\n\n/*IMonad definitions*/\n\nimport {Lang} from \"./Lang\";\nimport {AssocArrayCollector} from \"./SourcesCollectors\";\nimport {Stream} from \"./Stream\";\nimport objAssign = Lang.objAssign;\n\n/**\n * IFunctor interface,\n * defines an interface which allows to map a functor\n * via a first order function to another functor\n */\nexport interface IFunctor<T> {\n map<R>(fn: (data: T) => R): IFunctor<R>;\n}\n\n/**\n * IMonad definition, basically a functor with a flaptmap implementation (flatmap reduces all nested monads after a\n * function call f into a monad with the nesting level of 1\n *\n * flatmap flats nested Monads into a IMonad of the deepest nested implementation\n */\nexport interface IMonad<T, M extends IMonad<any, any>> extends IFunctor<T> {\n flatMap<T, M>(f: (T) => M): IMonad<any, any>;\n}\n\n/**\n * a stateful functor which holds a value upn which a\n * function can be applied\n *\n * as value holder of type T\n */\nexport interface IIdentity<T> extends IFunctor<T> {\n readonly value: T;\n}\n\n/**\n * custom value holder definition, since we are not pure functional\n * but iterative we have structures which allow the assignment of a value\n * also not all structures are sideffect free\n */\nexport interface IValueHolder<T> {\n value: T | Array<T>;\n}\n\n/**\n * Implementation of a monad\n * (Sideffect free), no write allowed directly on the monads\n * value state\n */\nexport class Monad<T> implements IMonad<T, Monad<any>>, IValueHolder<T> {\n constructor(value: T) {\n this._value = value;\n }\n\n protected _value: T;\n\n get value(): T {\n return this._value;\n }\n\n map<R>(fn?: (data: T) => R): Monad<R> {\n if (!fn) {\n fn = (inval: any) => <R>inval;\n }\n let result: R = fn(this.value);\n return new Monad(result);\n }\n\n flatMap<R>(fn?: (data: T) => R): Monad<any> {\n let mapped: Monad<any> = this.map(fn);\n while (mapped?.value instanceof Monad) {\n mapped = mapped.value\n }\n return mapped;\n }\n\n}\n\n/**\n * optional implementation, an optional is basically an implementation of a Monad with additional syntactic\n * sugar on top\n * (Sideeffect free, since value assignment is not allowed)\n * */\nexport class Optional<T> extends Monad<T> {\n\n /*default value for absent*/\n static absent = Optional.fromNullable(null);\n\n constructor(value: T) {\n super(value);\n }\n\n get value(): T {\n if (this._value instanceof Monad) {\n return this._value.flatMap().value\n }\n return this._value;\n }\n\n static fromNullable<V extends Optional<T>, T>(value?: T): Optional<T> {\n return <V> new Optional(value);\n }\n\n /*syntactic sugar for absent and present checks*/\n isAbsent(): boolean {\n return \"undefined\" == typeof this.value || null == this.value;\n }\n\n /**\n * any value present\n */\n isPresent(presentRunnable ?: (val ?: Monad<T>) => void): boolean {\n let absent = this.isAbsent();\n if (!absent && presentRunnable) {\n presentRunnable.call(this, this)\n }\n return !absent;\n }\n\n ifPresentLazy(presentRunnable: (val ?: Monad<T>) => void = () => {\n }): Monad<T> {\n this.isPresent.call(this, presentRunnable);\n return this;\n }\n\n orElse(elseValue: any): Optional<any> {\n if (this.isPresent()) {\n return this;\n } else {\n //shortcut\n if (elseValue == null) {\n return Optional.absent;\n }\n return this.flatMap(() => elseValue);\n }\n }\n\n /**\n * lazy, passes a function which then is lazily evaluated\n * instead of a direct value\n * @param func\n */\n orElseLazy(func: () => any): Optional<any> {\n if (this.isPresent()) {\n return this;\n } else {\n return this.flatMap(func);\n }\n }\n\n /*\n * we need to implement it to fullfill the contract, although it is used only internally\n * all values are flattened when accessed anyway, so there is no need to call this methiod\n */\n flatMap<R>(fn?: (data: T) => R): Optional<any> {\n let val = super.flatMap(fn);\n if (!(val instanceof Optional)) {\n return Optional.fromNullable(val.value);\n }\n\n return <Optional<any>>val.flatMap();\n }\n\n /*\n * elvis operation, take care, if you use this you lose typesafety and refactoring\n * capabilites, unfortunately typesceript does not allow to have its own elvis operator\n * this is some syntactic sugar however which is quite useful*/\n getIf<R>(...key: string[]): Optional<R> {\n\n let currentPos: Optional<any> = this;\n for (let cnt = 0; cnt < key.length; cnt++) {\n let currKey = this.keyVal(key[cnt]);\n let arrPos = this.arrayIndex(key[cnt]);\n\n if (currKey === \"\" && arrPos >= 0) {\n currentPos = this.getClass().fromNullable(!(currentPos.value instanceof Array) ? null : (currentPos.value.length < arrPos ? null : currentPos.value[arrPos]));\n if (currentPos.isAbsent()) {\n return currentPos;\n }\n continue;\n } else if (currKey && arrPos >= 0) {\n if (currentPos.getIfPresent(currKey).isAbsent()) {\n return currentPos;\n }\n currentPos = (currentPos.getIfPresent(currKey).value instanceof Array) ? this.getClass().fromNullable(currentPos.getIfPresent(currKey).value[arrPos]) : this.getClass().absent;\n if (currentPos.isAbsent()) {\n return currentPos;\n }\n continue;\n\n } else {\n currentPos = currentPos.getIfPresent(currKey);\n }\n if (currentPos.isAbsent()) {\n return currentPos;\n } else if (arrPos > -1) {\n currentPos = this.getClass().fromNullable(currentPos.value[arrPos]);\n }\n }\n let retVal = currentPos;\n\n return retVal;\n }\n\n /**\n * simple match, if the first order function call returns\n * true then there is a match, if the value is not present\n * it never matches\n *\n * @param fn the first order function performing the match\n */\n match(fn: (item: T) => boolean): boolean {\n if (this.isAbsent()) {\n return false\n }\n return fn(this.value);\n }\n\n /**\n * convenience function to flatmap the internal value\n * and replace it with a default in case of being absent\n *\n * @param defaultVal\n * @returns {Optional<any>}\n */\n get<R>(defaultVal: any = Optional.absent): Optional<R> {\n if (this.isAbsent()) {\n return this.getClass().fromNullable(defaultVal).flatMap();\n }\n\n return this.getClass().fromNullable(this.value).flatMap();\n }\n\n toJson(): string {\n return JSON.stringify(this.value);\n }\n\n /**\n * helper to override several implementations in a more fluent way\n * by having a getClass operation we can avoid direct calls into the constructor or\n * static methods and do not have to implement several methods which rely on the type\n * of \"this\"\n * @returns {Monadish.Optional}\n */\n protected getClass(): any {\n return Optional;\n }\n\n /*helper method for getIf with array access aka <name>[<indexPos>]*/\n protected arrayIndex(key: string): number {\n let start = key.indexOf(\"[\");\n let end = key.indexOf(\"]\");\n if (start >= 0 && end > 0 && start < end) {\n return parseInt(key.substring(start + 1, end));\n } else {\n return -1;\n }\n }\n\n /*helper method for getIf with array access aka <name>[<indexPos>]*/\n protected keyVal(key: string): string {\n let start = key.indexOf(\"[\");\n\n if (start >= 0) {\n return key.substring(0, start);\n } else {\n return key;\n }\n }\n\n /**\n * additional syntactic sugar which is not part of the usual optional implementation\n * but makes life easier, if you want to sacrifice typesafety and refactoring\n * capabilities in typescript\n */\n getIfPresent<R>(key: string): Optional<R> {\n if (this.isAbsent()) {\n return this.getClass().absent;\n }\n return this.getClass().fromNullable(this.value[key]).flatMap();\n }\n\n /**\n * elvis like typesafe functional save resolver\n * a typesafe option for getIfPresent\n *\n * usage myOptional.resolve(value => value.subAttr.subAttr2).orElseLazy(....)\n * if this is resolvable without any errors an Optional with the value is returned\n * if not, then an Optional absent is returned, also if you return Optional absent\n * it is flatmapped into absent\n *\n * @param resolver the resolver function, can throw any arbitrary errors, int the error case\n * the resolution goes towards absent\n */\n resolve<V>(resolver: (item: T) => V): Optional<V> {\n if (this.isAbsent()) {\n return Optional.absent;\n }\n try {\n return Optional.fromNullable(resolver(this.value))\n } catch (e) {\n return Optional.absent;\n }\n }\n\n}\n\n// --------------------- From here onwards we break out the sideffects free limits ------------\n\n/**\n * ValueEmbedder is the writeable version\n * of optional, it basically is a wrappber\n * around a construct which has a state\n * and can be written to.\n *\n * For the readonly version see Optional\n */\nexport class ValueEmbedder<T> extends Optional<T> implements IValueHolder<T> {\n\n /*default value for absent*/\n static absent = ValueEmbedder.fromNullable(null);\n\n protected key: string;\n\n constructor(rootElem: any, valueKey: string = \"value\") {\n super(rootElem);\n\n this.key = valueKey;\n }\n\n get value(): T {\n return this._value ? <T>this._value[this.key] : null;\n }\n\n set value(newVal: T) {\n if (!this._value) {\n return;\n }\n this._value[this.key] = newVal\n }\n\n orElse(elseValue: any): Optional<any> {\n let alternative = {};\n alternative[this.key] = elseValue;\n return this.isPresent() ? this : new ValueEmbedder(alternative, this.key);\n }\n\n orElseLazy(func: () => any): Optional<any> {\n if (this.isPresent()) {\n return this;\n } else {\n let alternative = {};\n alternative[this.key] = func();\n return new ValueEmbedder(alternative, this.key);\n }\n }\n\n /**\n * helper to override several implementations in a more fluent way\n * by having a getClass operation we can avoid direct calls into the constructor or\n * static methods and do not have to implement several methods which rely on the type\n * of \"this\"\n * @returns {Monadish.Optional}\n */\n protected getClass(): any {\n return ValueEmbedder;\n }\n\n static fromNullable<V extends Optional<T>,T>(value?: any, valueKey: string = \"value\"): V {\n return <any> new ValueEmbedder<T>(value, valueKey);\n }\n\n}\n\n/**\n * specialized value embedder\n * for our Configuration\n */\nclass ConfigEntry<T> extends ValueEmbedder<T> {\n\n /*default value for absent*/\n static absent = ConfigEntry.fromNullable(null);\n\n /**\n * arrayed value positions\n */\n arrPos: number;\n\n constructor(rootElem: any, key: any, arrPos?: number) {\n super(rootElem, key);\n\n this.arrPos = arrPos ?? -1;\n }\n\n get value() {\n if (this.key == \"\" && this.arrPos >= 0) {\n return this._value[this.arrPos];\n } else if (this.key && this.arrPos >= 0) {\n return this._value[this.key][this.arrPos];\n }\n return this._value[this.key];\n }\n\n set value(val: T) {\n if (this.key == \"\" && this.arrPos >= 0) {\n this._value[this.arrPos] = val;\n return;\n } else if (this.key && this.arrPos >= 0) {\n this._value[this.key][this.arrPos] = val;\n return;\n }\n this._value[this.key] = val;\n }\n}\n\n/**\n * Config, basically an optional wrapper for a json structure\n * (not sideeffect free, since we can alter the internal config state\n * without generating a new config), not sure if we should make it sideffect free\n * since this would swallow a lot of performane and ram\n */\nexport class Config extends Optional<any> {\n constructor(root: any) {\n super(root);\n }\n\n /**\n * shallow copy getter, copies only the first level, references the deeper nodes\n * in a shared manner\n */\n get shallowCopy(): Config {\n return this.shallowCopy$();\n }\n\n protected shallowCopy$(): Config {\n return new Config(Stream.ofAssoc(this.value).collect(new AssocArrayCollector()));\n }\n\n /**\n * deep copy, copies all config nodes\n */\n get deepCopy(): Config {\n return this.deepCopy$();\n }\n\n protected deepCopy$(): Config {\n return new Config(objAssign({}, this.value));\n }\n\n /**\n * creates a config from an initial value or null\n * @param value\n */\n static fromNullable<T>(value?: T | null): Config {\n return new Config(value);\n }\n\n /**\n * simple merge for the root configs\n */\n shallowMerge(other: Config, overwrite = true, withAppend = false) {\n for (let key in other.value) {\n if (overwrite || !(key in this.value)) {\n if (!withAppend) {\n this.assign(key).value = other.getIf(key).value;\n } else {\n if (Array.isArray(other.getIf(key).value)) {\n Stream.of(...other.getIf(key).value).each(item => this.append(key).value = item);\n } else {\n this.append(key).value = other.getIf(key).value;\n }\n }\n }\n }\n }\n\n /**\n * assigns a single value as array, or appends it\n * to an existing value mapping a single value to array\n *\n *\n * usage myConfig.append(\"foobaz\").value = \"newValue\"\n * myConfig.append(\"foobaz\").value = \"newValue2\"\n *\n * resulting in myConfig.foobaz == [\"newValue, newValue2\"]\n *\n * @param {string[]} accessPath\n */\n append(...accessPath: string[]): IValueHolder<any> {\n let noKeys = accessPath.length < 1;\n if (noKeys) {\n return;\n }\n\n let lastKey = accessPath[accessPath.length - 1];\n let currKey, finalKey = this.keyVal(lastKey);\n\n let pathExists = this.getIf(...accessPath).isPresent();\n this.buildPath(accessPath);\n\n let finalKeyArrPos = this.arrayIndex(lastKey);\n if (finalKeyArrPos > -1) {\n throw Error(\"Append only possible on non array properties, use assign on indexed data\");\n }\n let value = <any>this.getIf(...accessPath).value;\n if (!Array.isArray(value)) {\n value = this.assign(...accessPath).value = [value];\n }\n if (pathExists) {\n value.push({});\n }\n finalKeyArrPos = value.length - 1;\n\n let retVal = new ConfigEntry(accessPath.length == 1 ? this.value : this.getIf.apply(this, accessPath.slice(0, accessPath.length - 1)).value,\n lastKey, finalKeyArrPos\n );\n\n return retVal;\n }\n\n /**\n * appends to an existing entry (or extends into an array and appends)\n * if the condition is met\n * @param {boolean} condition\n * @param {string[]} accessPath\n */\n appendIf(condition: boolean, ...accessPath: string[]): IValueHolder<any> {\n if (!condition) {\n return {value: null};\n }\n return this.append(...accessPath);\n }\n\n /**\n * assings an new value on the given access path\n * @param accessPath\n */\n assign(...accessPath): IValueHolder<any> {\n if (accessPath.length < 1) {\n return;\n }\n\n this.buildPath(accessPath);\n\n let currKey = this.keyVal(accessPath[accessPath.length - 1]);\n let arrPos = this.arrayIndex(accessPath[accessPath.length - 1]);\n let retVal = new ConfigEntry(accessPath.length == 1 ? this.value : this.getIf.apply(this, accessPath.slice(0, accessPath.length - 1)).value,\n currKey, arrPos\n );\n\n return retVal;\n }\n\n /**\n * assign a value if the condition is set to true, otherwise skip it\n *\n * @param condition the condition, the access accessPath into the config\n * @param accessPath\n */\n assignIf(condition: boolean, ...accessPath: Array<any>): IValueHolder<any> {\n return condition ? this.assign(...accessPath) : {value: null};\n }\n\n /**\n * get if the access path is present (get is reserved as getter with a default, on the current path)\n * TODO will be renamed to something more meaningful and deprecated, the name is ambigous\n * @param accessPath the access path\n */\n getIf(...accessPath: Array<string>): Config {\n return this.getClass().fromNullable(super.getIf.apply(this, accessPath).value);\n }\n\n\n\n /**\n * gets the current node and if none is present returns a config with a default value\n * @param defaultVal\n */\n get(defaultVal: any): Config {\n return this.getClass().fromNullable(super.get(defaultVal).value);\n }\n\n //empties the current config entry\n delete(key: string): Config {\n if (key in this.value) {\n delete this.value[key];\n }\n return this;\n }\n\n /**\n * converts the entire config into a json object\n */\n toJson(): any {\n return JSON.stringify(this.value);\n }\n\n protected getClass(): any {\n return Config;\n }\n\n private setVal(val: any) {\n this._value = val;\n }\n\n /**\n * builds the config path\n *\n * @param accessPath a sequential array of accessPath containing either a key name or an array reference name[<index>]\n */\n private buildPath(accessPath: Array<any>): Config {\n let val = this;\n let parentVal = this.getClass().fromNullable(null);\n let parentPos = -1;\n let alloc = function (arr: Array<any>, length: number) {\n let length1 = arr.length;\n let length2 = length1 + length;\n for (let cnt = length1; cnt < length2; cnt++) {\n arr.push({});\n }\n };\n\n for (let cnt = 0; cnt < accessPath.length; cnt++) {\n let currKey = this.keyVal(accessPath[cnt]);\n let arrPos = this.arrayIndex(accessPath[cnt]);\n\n if (currKey === \"\" && arrPos >= 0) {\n\n val.setVal((val.value instanceof Array) ? val.value : []);\n alloc(val.value, arrPos + 1);\n if (parentPos >= 0) {\n parentVal.value[parentPos] = val.value;\n }\n parentVal = val;\n parentPos = arrPos;\n val = this.getClass().fromNullable(val.value[arrPos]);\n continue;\n }\n\n let tempVal = <Config>val.getIf(currKey);\n if (arrPos == -1) {\n if (tempVal.isAbsent()) {\n tempVal = <Config>this.getClass().fromNullable(val.value[currKey] = {});\n } else {\n val = <any>tempVal;\n }\n } else {\n let arr = (tempVal.value instanceof Array) ? tempVal.value : [];\n alloc(arr, arrPos + 1);\n val.value[currKey] = arr;\n tempVal = this.getClass().fromNullable(arr[arrPos]);\n }\n parentVal = val;\n parentPos = arrPos;\n val = <any>tempVal;\n }\n\n return this;\n }\n}\n\n\n","/*!\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Stream, StreamMapper} from \"./Stream\";\nimport {DomQuery} from \"./DomQuery\";\nimport type = Mocha.utils.type;\n\n/**\n * special status of the datasource location pointer\n * if an access, outside of the possible data boundaries is happening\n * (example for instance current without a first next call, or next\n * which goes over the last possible dataset), an iteration status return\n * value is returned marking this boundary instead of a classical element\n *\n * Note this is only internally used but must be implemented to fullfill\n * internal contracts, the end user will never see those values if he uses\n * streams!\n */\nexport enum ITERATION_STATUS {\n EO_STRM = '__EO_STRM__',\n BEF_STRM = '___BEF_STRM__',\n}\n\n/**\n * Every data source wich feeds data into the lazy stream\n * or stream generally must implement this interface\n *\n * It is basically an iteratable to the core\n */\nexport interface IStreamDataSource<T> {\n\n /**\n * @returns true if additional data is present false if not\n */\n hasNext(): boolean;\n\n /**\n * returns the next element in the stream\n */\n next(): T | ITERATION_STATUS;\n\n /**\n * returns the next element in the stream\n * difference to next is, that the internal data position\n * is not changed, so next still will deliver the next item from the current\n * data position. Look ahead is mostly needed internally\n * by possible endless data constructs which have no fixed data boundary, or index\n * positions. (aka infinite sets, or flatmapped constructs)\n */\n lookAhead(cnt ?: number): T | ITERATION_STATUS;\n\n /**\n * returns the current element, returns the same element as the previous next call\n * if there is no next before current called then we will call next as initial element\n */\n current(): T | ITERATION_STATUS;\n\n /**\n * resets the position to the beginning\n */\n reset(): void;\n}\n\n/**\n * A collector, needs to be implemented\n */\nexport interface ICollector<T, S> {\n /**\n * this method basically takes a single stream element\n * and does something with it (collecting it one way or the other\n * in most cases)\n *\n * @param element\n */\n collect(element: T);\n\n /**\n * the final result after all the collecting is done\n */\n finalValue: S;\n}\n\n\n/**\n * defines a sequence of numbers for our stream input\n */\nexport class SequenceDataSource implements IStreamDataSource<number> {\n\n start: number;\n total: number;\n value: number;\n\n constructor(start: number, total: number) {\n this.total = total;\n this.start = start;\n this.value = start - 1;\n }\n\n\n hasNext(): boolean {\n return this.value < (this.total - 1);\n }\n\n next(): number | ITERATION_STATUS {\n this.value++;\n return this.value <= (this.total - 1) ? this.value : ITERATION_STATUS.EO_STRM;\n }\n\n lookAhead(cnt = 1): number | ITERATION_STATUS {\n if((this.value + cnt) > this.total - 1) {\n return ITERATION_STATUS.EO_STRM;\n } else {\n return this.value + cnt;\n }\n }\n\n reset(): void {\n this.value = this.start - 1;\n }\n\n current(): number | ITERATION_STATUS {\n //first condition current without initial call for next\n return (this.start - 1) ? ITERATION_STATUS.BEF_STRM : this.value;\n }\n}\n\n\n/**\n * implementation of iteratable on top of array\n */\nexport class ArrayStreamDataSource<T> implements IStreamDataSource<T> {\n value: Array<T>;\n dataPos = -1;\n\n constructor(...value: Array<T>) {\n this.value = value;\n }\n\n lookAhead(cnt = 1): T |ITERATION_STATUS {\n if((this.dataPos+cnt) > this.value.length - 1) {\n return ITERATION_STATUS.EO_STRM;\n }\n return this.value[this.dataPos + cnt];\n }\n\n hasNext(): boolean {\n return this.value.length - 1 > this.dataPos;\n }\n\n next(): T | ITERATION_STATUS {\n this.dataPos++;\n return this?.value[this.dataPos] ?? ITERATION_STATUS.EO_STRM;\n }\n\n reset() {\n this.dataPos = -1;\n }\n\n current(): T {\n return this.value[Math.max(0, this.dataPos)];\n }\n}\n\n/**\n * an intermediate data source which prefilters\n * incoming stream data\n * and lets only the data out which\n * passes the filter function check\n */\nexport class FilteredStreamDatasource<T> implements IStreamDataSource<T> {\n\n filterFunc: (T) => boolean;\n inputDataSource: IStreamDataSource<T>;\n\n _current: T | ITERATION_STATUS = ITERATION_STATUS.BEF_STRM;\n // we have to add a filter idx because the external filter values might change over time, so\n // we cannot reset the state properly unless we do it from a snapshot\n _filterIdx = {};\n _unfilteredPos = 0;\n\n constructor(filterFunc: (T) => boolean, parent: IStreamDataSource<T>) {\n this.filterFunc = filterFunc;\n this.inputDataSource = parent;\n }\n\n /**\n * in order to filter we have to make a look ahead until the\n * first next allowed element\n * hence we prefetch the element and then\n * serve it via next\n */\n hasNext(): boolean {\n let steps = 1;\n let found = false;\n let next;\n\n while(!found && (next = this.inputDataSource.lookAhead(steps)) != ITERATION_STATUS.EO_STRM) {\n if (this.filterFunc(next)) {\n this._filterIdx[this._unfilteredPos + steps] = true;\n found = true;\n } else {\n steps++;\n }\n }\n return found;\n }\n\n /**\n * serve the next element\n */\n next(): T | ITERATION_STATUS {\n let found: T | ITERATION_STATUS = ITERATION_STATUS.EO_STRM;\n while (this.inputDataSource.hasNext()) {\n this._unfilteredPos ++;\n let next: T = <T>this.inputDataSource.next();\n //again here we cannot call the filter function twice, because its state might change, so if indexed, we have a decent snapshot, either has next or next can trigger\n //the snapshot\n if (next != ITERATION_STATUS.EO_STRM &&\n ((this._filterIdx?.[this._unfilteredPos] ?? false) || this.filterFunc(next))) {\n this._filterIdx[this._unfilteredPos] = true;\n found = next;\n break;\n }\n }\n this._current = found as T;\n return found;\n }\n\n lookAhead(cnt = 1): ITERATION_STATUS | T {\n let lookupVal: T |ITERATION_STATUS;\n\n for(let loop = 1; cnt > 0 && (lookupVal = this.inputDataSource.lookAhead(loop)) != ITERATION_STATUS.EO_STRM; loop++) {\n let inCache = this._filterIdx?.[this._unfilteredPos + loop];\n if(inCache || this.filterFunc(lookupVal)) {\n cnt --;\n this._filterIdx[this._unfilteredPos + loop] = true;\n }\n }\n return lookupVal;\n }\n\n current(): T | ITERATION_STATUS {\n return this._current;\n }\n\n reset(): void {\n this._current = ITERATION_STATUS.BEF_STRM;\n this._filterIdx = {};\n this._unfilteredPos = 0;\n this.inputDataSource.reset();\n }\n}\n\n/**\n * an intermediate datasource which maps the items from\n * one into another\n */\nexport class MappedStreamDataSource<T, S> implements IStreamDataSource<S> {\n\n mapFunc: (T) => S;\n inputDataSource: IStreamDataSource<T>;\n\n constructor(mapFunc: (T) => S, parent: IStreamDataSource<T>) {\n this.mapFunc = mapFunc;\n this.inputDataSource = parent;\n }\n\n hasNext(): boolean {\n return this.inputDataSource.hasNext();\n }\n\n next(): S {\n return this.mapFunc(this.inputDataSource.next());\n }\n\n reset(): void {\n this.inputDataSource.reset();\n }\n\n current(): S {\n return this.mapFunc(this.inputDataSource.current());\n }\n\n lookAhead(cnt= 1): ITERATION_STATUS | S {\n const lookAheadVal = this.inputDataSource.lookAhead(cnt);\n return (lookAheadVal == ITERATION_STATUS.EO_STRM) ? lookAheadVal as ITERATION_STATUS : this.mapFunc(lookAheadVal) as S;\n }\n}\n\n/**\n * Same for flatmap to deal with element -> stream mappings\n */\nexport class FlatMapStreamDataSource<T, S> implements IStreamDataSource<S> {\n\n mapFunc: StreamMapper<T>;\n\n inputDataSource: IStreamDataSource<T>;\n\n /**\n * the currently active stream\n * coming from an incoming element\n * once the end of this one is reached\n * it is swapped out by another one\n * from the next element\n */\n activeDataSource: IStreamDataSource<S>;\n walkedDataSources= [];\n _currPos = 0;\n\n constructor(func: StreamMapper<T>, parent: IStreamDataSource<T>) {\n this.mapFunc = func;\n this.inputDataSource = parent;\n }\n\n hasNext(): boolean {\n return this.resolveActiveHasNext() || this.resolveNextHasNext();\n }\n\n private resolveActiveHasNext() {\n let next = false;\n if (this.activeDataSource) {\n next = this.activeDataSource.hasNext();\n }\n return next;\n }\n\n\n lookAhead(cnt = 1): ITERATION_STATUS | S {\n //easy access trial\n if(this?.activeDataSource && this?.activeDataSource?.lookAhead(cnt) != ITERATION_STATUS.EO_STRM) {\n //this should coverr 95% of all accesses\n return this?.activeDataSource.lookAhead(cnt);\n }\n\n /**\n * we only can determine how many elems datasource has by going up\n * (for now this suffices, however not ideal, we might have to introduce a numElements or so)\n * @param datasource\n */\n function howManyElems(datasource: IStreamDataSource<any>): number {\n let cnt = 1;\n while(datasource.lookAhead(cnt) !== ITERATION_STATUS.EO_STRM) {\n cnt++;\n }\n return cnt - 1;\n }\n function readjustSkip(dataSource) {\n let skippedElems = (dataSource) ? howManyElems(dataSource) : 0;\n cnt = cnt - skippedElems;\n }\n\n if(this.activeDataSource) {\n readjustSkip(this.activeDataSource)\n }\n\n //the idea is basically to look into the streams subsequentially for a match\n //after each stream we have to take into consideration that the skipCnt is\n //reduced by the number of datasets we already have looked into in the previous stream/datasource\n //unfortunately for now we have to loop into them so we introduce a small o2 here\n for(let dsLoop = 1; true ; dsLoop++) {\n let currDatasource = this.inputDataSource.lookAhead(dsLoop);\n //we have looped out\n if(currDatasource === ITERATION_STATUS.EO_STRM) {\n return ITERATION_STATUS.EO_STRM;\n }\n let mapped = this.mapFunc(currDatasource as T);\n //it either comes in as datasource or as array\n let currentDataSource = this.toDatasource(mapped);\n let ret = currentDataSource.lookAhead(cnt);\n if(ret != ITERATION_STATUS.EO_STRM) {\n return ret;\n }\n readjustSkip(currDatasource);\n\n }\n }\n\n private toDatasource(mapped: Array<S> | IStreamDataSource<S>) {\n let ds = Array.isArray(mapped) ? new ArrayStreamDataSource(...mapped) : mapped;\n this.walkedDataSources.push(ds)\n return ds;\n }\n\n private resolveNextHasNext() {\n let next = false;\n while (!next && this.inputDataSource.hasNext()) {\n let mapped = this.mapFunc(this.inputDataSource.next() as T);\n this.activeDataSource = this.toDatasource(mapped);;\n next = this.activeDataSource.hasNext();\n }\n return next;\n }\n\n next(): S | ITERATION_STATUS {\n if(this.hasNext()) {\n this._currPos++;\n return this.activeDataSource.next();\n }\n }\n\n reset(): void {\n this.inputDataSource.reset();\n this.walkedDataSources.forEach(ds => ds.reset());\n this.walkedDataSources = [];\n this._currPos = 0;\n this.activeDataSource = null;\n }\n\n current(): S | ITERATION_STATUS{\n if(!this.activeDataSource) {\n this.hasNext();\n }\n return this.activeDataSource.current();\n }\n}\n\n/**\n * For the time being we only need one collector\n * a collector which collects a stream back into arrays\n */\nexport class ArrayCollector<S> implements ICollector<S, Array<S>> {\n private data: Array<S> = [];\n\n collect(element: S) {\n this.data.push(element);\n }\n\n get finalValue(): Array<S> {\n return this.data;\n }\n}\n\n/**\n * collects an tuple array stream into an assoc array with elements being collected into arrays\n *\n */\nexport class ArrayAssocArrayCollector<S> implements ICollector<[string, S] | string, {[key: string]: S} > {\n finalValue: {[key:string]: any} = {};\n\n collect(element: [string, S] | string) {\n let key = element?.[0] ?? <string> element;\n this.finalValue[key] = this.finalValue?.[key] ?? [];\n this.finalValue[key].push(element?.[1] ?? true);\n }\n}\n\n/**\n * dummy collector which just triggers a run\n * on lazy streams without collecting anything\n */\nexport class Run<S> implements ICollector<S, any> {\n collect(element: S) {\n\n }\n\n get finalValue(): any {\n return null;\n }\n}\n\n/**\n * collects an assoc stream back to an assoc array\n */\nexport class AssocArrayCollector<S> implements ICollector<[string, S] | string, { [key: string]: S }> {\n\n finalValue: { [key: string]: any } = {};\n\n collect(element: [string, S] | string) {\n this.finalValue[element[0] ?? <string>element] = element[1] ?? true;\n }\n}\n\n/**\n * Form data collector for key value pair streams\n */\nexport class FormDataCollector implements ICollector<{ key: string, value: any }, FormData> {\n finalValue: FormData = new FormData();\n\n collect(element: { key: string; value: any }) {\n this.finalValue.append(element.key, element.value);\n }\n}\n\n/**\n * Form data collector for DomQuery streams\n */\nexport class QueryFormDataCollector implements ICollector<DomQuery, FormData> {\n finalValue: FormData = new FormData();\n\n collect(element: DomQuery) {\n let toMerge = element.encodeFormElement();\n if (toMerge.isPresent()) {\n this.finalValue.append(element.name.value, toMerge.get(element.name).value);\n }\n }\n}\n\n/**\n * Encoded String collector from dom query streams\n */\nexport class QueryFormStringCollector implements ICollector<DomQuery, string> {\n\n formData: [[string, string]] = <any>[];\n\n collect(element: DomQuery) {\n let toMerge = element.encodeFormElement();\n if (toMerge.isPresent()) {\n this.formData.push([element.name.value, toMerge.get(element.name).value]);\n }\n }\n\n get finalValue(): string {\n return Stream.of(...this.formData)\n .map<string>(keyVal => keyVal.join(\"=\"))\n .reduce((item1, item2) => [item1, item2].join(\"&\"))\n .orElse(\"\").value;\n }\n}","/*!\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*\n * A small stream implementation\n */\nimport {IMonad, IValueHolder, Optional} from \"./Monad\";\nimport {\n ArrayCollector,\n ArrayStreamDataSource,\n FilteredStreamDatasource,\n FlatMapStreamDataSource,\n ICollector,\n IStreamDataSource,\n ITERATION_STATUS,\n MappedStreamDataSource\n} from \"./SourcesCollectors\";\n//import {from, Observable} from \"rxjs\";\n\n\n/*\n * some typedefs to make the code more reabable\n */\nexport type StreamMapper<T> = (data: T) => IStreamDataSource<any>;\nexport type ArrayMapper<T> = (data: T) => Array<any>;\nexport type IteratableConsumer<T> = (data: T, pos ?: number) => void | boolean;\nexport type Reducable<T, V> = (val1: T | V, val2: T) => V;\nexport type Matchable<T> = (data: T) => boolean;\nexport type Mappable<T, R> = (data: T) => R;\nexport type Comparator<T> = (el1: T, el2: T) => number;\n\n/**\n * Generic interface defining a stream\n */\nexport interface IStream<T> {\n /**\n * Perform the operation fn on a single element in the stream at a time\n * then pass the stream over for further processing\n * This is basically an intermediate point in the stream\n * with further processing happening later, do not use\n * this method to gather data or iterate over all date for processing\n * (for the second case each has to be used)\n *\n * @param fn the processing function, if it returns false, further processing is stopped\n */\n onElem(fn: IteratableConsumer<T>): IStream<T>;\n\n /**\n * Iterate over all elements in the stream and do some processing via fn\n *\n * @param fn takes a single element and if it returns false\n * then further processing is stopped\n */\n each(fn: IteratableConsumer<T>): void;\n\n\n /**\n * maps a single element into another via fn\n * @param fn function which takes one element in and returns another\n */\n map<R>(fn?: Mappable<T, R>): IStream<R>;\n\n /**\n * Takes an element in and returns a set of something\n * the set then is flatted into a single stream to be further processed\n *\n * @param fn\n */\n flatMap<R>(fn?: StreamMapper<T> | ArrayMapper<T>): IStream<R>;\n\n /**\n * filtering, takes an element in and is processed by fn.\n * If it returns false then further processing on this element is skipped\n * if it returns true it is passed down the chain.\n *\n * @param fn\n */\n filter(fn?: Matchable<T>): IStream<T>;\n\n /**\n * functional reduce... takes two elements in the stream and reduces to\n * one from left to right\n *\n * @param fn the reduction function for instance (val1,val2) => val1l+val2\n * @param startVal an optional starting value, if provided the the processing starts with this element\n * and further goes down into the stream, if not, then the first two elements are taken as reduction starting point\n */\n reduce<V>(fn: Reducable<T, V>, startVal: T | V): Optional<T | V>;\n\n /**\n * returns the first element in the stream is given as Optional\n */\n first(): Optional<T>;\n\n /**\n * Returns the last stream element (note in endless streams without filtering and limiting you will never reach that\n * point hence producing an endless loop)\n */\n last(): Optional<T>;\n\n /**\n * returns true if there is at least one element where a call fn(element) produces true\n *\n * @param fn\n */\n anyMatch(fn: Matchable<T>): boolean;\n\n /**\n * returns true if all elmements produce true on a call to fn(element)\n *\n * @param fn\n */\n allMatch(fn: Matchable<T>): boolean;\n\n /**\n * returns true if no elmements produce true on a call to fn(element)\n *\n * @param fn\n */\n noneMatch(fn: Matchable<T>): boolean;\n\n /**\n * Collect the elements with a collector given\n * There are a number of collectors provided\n *\n * @param collector\n */\n collect(collector: ICollector<T, any>): any;\n\n /**\n * sort on the stream, this is a special case\n * of an endpoint, so your data which is fed in needs\n * to be limited otherwise it will fail\n * it still returns a stream for further processing\n *\n * @param comparator\n */\n sort(comparator: Comparator<T>): IStream<T>;\n\n /**\n * Limits the stream to a certain number of elements\n *\n * @param end the limit of the stream\n */\n limits(end: number): IStream<T>;\n\n\n concat(...toAppend: Array<IStream<T>>): IStream<T>\n\n /**\n * returns the stream collected into an array (90% use-case abbreviation\n */\n value: Array<T>;\n\n /**\n * returns an observable of the given stream\n */\n [Symbol.iterator](): Iterator<T>;\n\n //observable: Observable<T>;\n}\n\n/**\n * A simple typescript based reimplementation of streams\n *\n * This is the early eval version\n * for a lazy eval version check, LazyStream, which is api compatible\n * to this implementation, however with the benefit of being able\n * to provide infinite data sources and generic data providers, the downside\n * is, it might be a tad slower in some situations\n */\nexport class Stream<T> implements IMonad<T, Stream<any>>, IValueHolder<Array<T>>, IStream<T> {\n\n value: Array<T>;\n _limits = -1;\n\n private pos = -1;\n\n constructor(...value: T[]) {\n this.value = value;\n }\n\n static of<T>(...data: Array<T>): Stream<T> {\n return new Stream<T>(...data);\n }\n\n static ofAssoc<T>(data: { [key: string]: T }): Stream<[string, T]> {\n return this.of(...Object.keys(data)).map(key => [key, data[key]]);\n }\n\n static ofDataSource<T>(dataSource: IStreamDataSource<T>) {\n let value: T[] = [];\n while (dataSource.hasNext()) {\n value.push(dataSource.next() as T);\n }\n\n return new Stream(...value);\n }\n\n limits(end: number): Stream<T> {\n this._limits = end;\n return this;\n }\n\n /**\n * concat for streams, so that you can concat two streams together\n * @param toAppend\n */\n concat(...toAppend: Array<IStream<T>>): Stream<T> {\n //let dataSource = new MultiStreamDatasource<T>(this, ...toAppend);\n //return Stream.ofDataSource<T>(dataSource);\n\n return Stream.of(<IStream<T>>this, ...toAppend).flatMap(item => item);\n }\n\n\n onElem(fn: (data: T, pos ?: number) => void | boolean): Stream<T> {\n for (let cnt = 0; cnt < this.value.length && (this._limits == -1 || cnt < this._limits); cnt++) {\n if (fn(this.value[cnt], cnt) === false) {\n break;\n }\n }\n return this;\n }\n\n\n each(fn: (data: T, pos ?: number) => void | boolean) {\n this.onElem(fn);\n this.reset();\n }\n\n map<R>(fn?: (data: T) => R): Stream<R> {\n if (!fn) {\n fn = (inval: any) => <R>inval;\n }\n let res: R[] = [];\n this.each((item) => {\n res.push(fn(item))\n });\n\n return new Stream<R>(...res);\n }\n\n /*\n * we need to implement it to fullfill the contract, although it is used only internally\n * all values are flattened when accessed anyway, so there is no need to call this methiod\n */\n\n flatMap<IStreamDataSource>(fn: (data: T) => IStreamDataSource | Array<any>): Stream<any> {\n let ret = [];\n this.each(item => {\n let strmR: any = fn(item);\n ret = Array.isArray(strmR) ? ret.concat(strmR) : ret.concat(...strmR.value);\n });\n return <Stream<any>>Stream.of(...ret);\n }\n\n filter(fn?: (data: T) => boolean): Stream<T> {\n let res: Array<T> = [];\n this.each((data) => {\n if (fn(data)) {\n res.push(data);\n }\n });\n return new Stream<T>(...res);\n }\n\n reduce<V>(fn: Reducable<T, V | T>, startVal: V = null): Optional<V | T> {\n let offset = startVal != null ? 0 : 1;\n let val1: V | T = startVal != null ? startVal : this.value.length ? this.value[0] : null;\n\n for (let cnt = offset; cnt < this.value.length && (this._limits == -1 || cnt < this._limits); cnt++) {\n val1 = fn(val1, this.value[cnt]);\n }\n this.reset();\n return Optional.fromNullable<Optional<any>, V | T>(val1);\n }\n\n first(): Optional<T> {\n this.reset();\n return this.value && this.value.length ? Optional.fromNullable(this.value[0]) : Optional.absent;\n }\n\n last(): Optional<T> {\n //could be done via reduce, but is faster this way\n let length = this._limits > 0 ? Math.min(this._limits, this.value.length) : this.value.length;\n this.reset();\n return Optional.fromNullable(length ? this.value[length - 1] : null);\n }\n\n anyMatch(fn: Matchable<T>): boolean {\n for (let cnt = 0; cnt < this.value.length && (this._limits == -1 || cnt < this._limits); cnt++) {\n if (fn(this.value[cnt])) {\n return true;\n }\n }\n this.reset();\n return false;\n }\n\n allMatch(fn: Matchable<T>): boolean {\n if (!this.value.length) {\n return false;\n }\n let matches = 0;\n for (let cnt = 0; cnt < this.value.length; cnt++) {\n if (fn(this.value[cnt])) {\n matches++;\n }\n }\n this.reset();\n return matches == this.value.length;\n }\n\n noneMatch(fn: Matchable<T>): boolean {\n let matches = 0;\n for (let cnt = 0; cnt < this.value.length; cnt++) {\n if (!fn(this.value[cnt])) {\n matches++;\n }\n }\n this.reset();\n return matches == this.value.length;\n }\n\n sort(comparator: Comparator<T>): IStream<T> {\n let newArr = this.value.slice().sort(comparator);\n return Stream.of(...newArr);\n }\n\n\n collect(collector: ICollector<T, any>): any {\n this.each(data => collector.collect(data));\n this.reset();\n return collector.finalValue;\n }\n\n //-- internally exposed methods needed for the interconnectivity\n hasNext(): boolean {\n let isLimitsReached = this._limits != -1 && this.pos >= this._limits - 1;\n let isEndOfArray = this.pos >= this.value.length - 1;\n return !(isLimitsReached || isEndOfArray);\n }\n\n next(): T {\n if (!this.hasNext()) {\n return null;\n }\n this.pos++;\n return this.value[this.pos];\n }\n\n lookAhead(cnt = 1): T | ITERATION_STATUS {\n if((this.pos + cnt) >= this.value.length) {\n return ITERATION_STATUS.EO_STRM;\n }\n return this.value[this.pos + cnt];\n }\n\n\n [Symbol.iterator]() : Iterator<T> {\n return {\n next: () => {\n let done = !this.hasNext();\n let val = this.next();\n return {\n done: done,\n value: <T>val\n }\n }\n }\n }\n\n /*get observable(): Observable<T> {\n return from(this);\n }*/\n\n reset() {\n this.pos = -1;\n }\n}\n\n/**\n * Lazy implementation of a Stream\n * The idea is to connect the intermediate\n * streams as datasources like a linked list\n * with reverse referencing and for special\n * operations like filtering flatmapping\n * have intermediate datasources in the list\n * with specialized functions.\n *\n * Sort of a modified pipe valve pattern\n * the streams are the pipes the intermediate\n * data sources are the valves\n *\n * We then can use passed in functions to control\n * the flow in the valves\n *\n * That way we can have a lazy evaluating stream\n *\n * So if an endpoint requests data\n * a callback trace goes back the stream list\n * which triggers an operation upwards\n * which sends data down the drain which then is processed\n * and filtered until one element hits the endpoint.\n *\n * That is repeated, until all elements are processed\n * or an internal limit is hit.\n *\n */\nexport class LazyStream<T> implements IStreamDataSource<T>, IStream<T>, IMonad<T, LazyStream<any>> {\n\n protected dataSource: IStreamDataSource<T>;\n _limits = -1;\n\n /*\n * needed to have the limits check working\n * we need to keep track of the current position\n * in the stream\n */\n pos = -1;\n\n static of<T>(...values: Array<T>): LazyStream<T> {\n return new LazyStream<T>(new ArrayStreamDataSource(...values));\n }\n\n static ofAssoc<T>(data: { [key: string]: T }): LazyStream<[string, T]> {\n return this.of(...Object.keys(data)).map(key => [key, data[key]]);\n }\n\n static ofStreamDataSource<T>(value: IStreamDataSource<T>): LazyStream<T> {\n return new LazyStream(value);\n }\n\n constructor(parent: IStreamDataSource<T>) {\n this.dataSource = parent;\n\n }\n\n hasNext(): boolean {\n if (this.isOverLimits()) {\n return false;\n }\n\n return this.dataSource.hasNext();\n }\n\n next(): T | ITERATION_STATUS {\n let next = this.dataSource.next();\n // @ts-ignore\n this.pos++;\n return next;\n }\n\n lookAhead(cnt= 1): ITERATION_STATUS | T {\n return this.dataSource.lookAhead(cnt);\n }\n\n\n\n current(): T | ITERATION_STATUS {\n return this.dataSource.current();\n }\n\n reset(): void {\n this.dataSource.reset();\n this.pos = -1;\n this._limits = -1;\n }\n\n /**\n * concat for streams, so that you can concat two streams together\n * @param toAppend\n */\n concat(...toAppend: Array<IStream<T>>): LazyStream<T> {\n //this.dataSource = new MultiStreamDatasource<T>(this, ... toAppend);\n //return this;\n return LazyStream.of(<IStream<T>>this, ...toAppend).flatMap(item => item);\n }\n\n nextFilter(fn: Matchable<T>): T {\n if (this.hasNext()) {\n let newVal: T = this.next() as T;\n if (!fn(newVal)) {\n return this.nextFilter(fn);\n }\n return <T>newVal;\n }\n return null;\n }\n\n limits(max: number): LazyStream<T> {\n this._limits = max;\n return this;\n }\n\n //main stream methods\n collect(collector: ICollector<T, any>): any {\n while (this.hasNext()) {\n let t = this.next();\n collector.collect(<T>t);\n }\n this.reset();\n return collector.finalValue;\n }\n\n onElem(fn: IteratableConsumer<T>): LazyStream<T> {\n return new LazyStream(new MappedStreamDataSource((el) => {\n if (fn(el, this.pos) === false) {\n this.stop();\n }\n return el;\n }, this));\n }\n\n filter(fn: Matchable<T>): LazyStream<T> {\n return <LazyStream<T>>new LazyStream<T>(new FilteredStreamDatasource<any>(fn, this));\n }\n\n map<R>(fn: Mappable<T, R>): LazyStream<any> {\n return new LazyStream(new MappedStreamDataSource(fn, this));\n }\n\n flatMap<StreamMapper>(fn: StreamMapper | ArrayMapper<any>): LazyStream<any> {\n return new LazyStream<any>(new FlatMapStreamDataSource(<any>fn, this));\n }\n\n //endpoint\n each(fn: IteratableConsumer<T>) {\n while (this.hasNext()) {\n if (fn(this.next() as T) === false) {\n this.stop();\n }\n }\n this.reset();\n }\n\n reduce<V>(fn: Reducable<T, V>, startVal: T | V = null): Optional<T | V> {\n if (!this.hasNext()) {\n return Optional.absent;\n }\n let value1;\n let value2 = null;\n if (startVal != null) {\n value1 = startVal;\n value2 = this.next();\n } else {\n value1 = this.next();\n if (!this.hasNext()) {\n return Optional.fromNullable(value1);\n }\n value2 = this.next();\n }\n value1 = fn(value1, value2);\n while (this.hasNext()) {\n value2 = this.next();\n value1 = fn(value1, value2);\n }\n this.reset();\n return Optional.fromNullable(value1);\n }\n\n last(): Optional<T> {\n if (!this.hasNext()) {\n return Optional.absent;\n }\n return this.reduce((el1, el2) => el2);\n }\n\n first(): Optional<T> {\n this.reset();\n if (!this.hasNext()) {\n return Optional.absent;\n }\n return Optional.fromNullable(this.next() as T);\n }\n\n anyMatch(fn: Matchable<T>): boolean {\n while (this.hasNext()) {\n if (fn(this.next() as T)) {\n return true;\n }\n }\n return false;\n }\n\n allMatch(fn: Matchable<T>): boolean {\n while (this.hasNext()) {\n if (!fn(this.next() as T)) {\n return false;\n }\n }\n return true;\n }\n\n noneMatch(fn: Matchable<T>): boolean {\n while (this.hasNext()) {\n if (fn(this.next() as T)) {\n return false;\n }\n }\n return true;\n }\n\n sort(comparator: Comparator<T>): IStream<T> {\n let arr = this.collect(new ArrayCollector());\n arr = arr.sort(comparator);\n return LazyStream.of(...arr);\n }\n\n get value(): Array<T> {\n return this.collect(new ArrayCollector<T>());\n }\n\n [Symbol.iterator]() : Iterator<T> {\n return {\n next: () => {\n let done = !this.hasNext();\n let val = this.next();\n return {\n done: done,\n value: <T>val\n }\n }\n }\n }\n\n /*get observable(): Observable<T> {\n return from(this);\n }*/\n\n private stop() {\n this.pos = this._limits + 1000000000;\n this._limits = 0;\n }\n\n private isOverLimits() {\n return this._limits != -1 && this.pos >= this._limits - 1;\n }\n\n}\n\n\n","/*!\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Lang} from \"./Lang\";\nimport {DomQuery} from \"./DomQuery\";\nimport isString = Lang.isString;\nimport {_global$} from \"./Global\";\n\ndeclare let ActiveXObject: any;\n\n/**\n * xml query as specialized case for DomQuery\n */\nexport class XMLQuery extends DomQuery {\n\n constructor(rootNode: Document | string | DomQuery, docType: string = \"text/xml\") {\n\n let createIe11DomQueryShim = (): DOMParser => {\n //at the time if wroting ie11 is the only relevant browser\n //left withut any DomQuery support\n let parser = new ActiveXObject(\"Microsoft.XMLDOM\");\n parser.async = false;\n //we shim th dom parser from ie in\n return <any>{\n parseFromString: (text: string, contentType: string): Document => {\n return parser.loadXML(text);\n }\n }\n };\n\n let parseXML = (xml: string): Document => {\n if (xml == null) {\n return null;\n }\n let domParser: DOMParser = Lang.saveResolveLazy<DOMParser>(\n () => new (_global$()).DOMParser(),\n (): DOMParser => createIe11DomQueryShim()\n ).value;\n return domParser.parseFromString(xml, <any> docType);\n };\n\n if (isString(rootNode)) {\n super(parseXML(<string>rootNode))\n } else {\n super(rootNode);\n }\n }\n\n isXMLParserError(): boolean {\n return this.querySelectorAll(\"parsererror\").isPresent();\n }\n\n toString(): string {\n let ret = [];\n this.eachElem((node: any) => {\n let serialized = (_global$())?.XMLSerializer?.constructor()?.serializeToString(node) ?? node?.xml;\n if (!!serialized) {\n ret.push(serialized);\n }\n });\n return ret.join(\"\");\n }\n\n parserErrorText(joinstr: string): string {\n return this.querySelectorAll(\"parsererror\").textContent(joinstr);\n }\n\n static parseXML(txt: string): XMLQuery {\n return new XMLQuery(txt);\n }\n\n static parseHTML(txt: string): XMLQuery {\n return new XMLQuery(txt, \"text/html\");\n }\n\n static fromString(txt: string, parseType: string = \"text/xml\"): XMLQuery {\n return new XMLQuery(txt, parseType);\n }\n}\n\nexport const XQ = XMLQuery;\nexport type XQ = XMLQuery;","/*!\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\nexport {DomQuery, ElementAttribute, DomQueryCollector, DQ, DQ$} from \"./DomQuery\";\nexport {Lang} from \"./Lang\";\nexport {Config, Monad, IValueHolder, IFunctor, IMonad, IIdentity, Optional, ValueEmbedder} from \"./Monad\";\nexport {XMLQuery, XQ} from \"./XmlQuery\";\nexport {Stream, LazyStream, IteratableConsumer, IStream} from \"./Stream\";\nexport {\n ArrayStreamDataSource,\n MappedStreamDataSource,\n FilteredStreamDatasource,\n FlatMapStreamDataSource,\n SequenceDataSource,\n QueryFormStringCollector,\n IStreamDataSource,\n ICollector,\n ArrayCollector,\n AssocArrayCollector,\n FormDataCollector,\n QueryFormDataCollector\n} from \"./SourcesCollectors\";\n\n\n\n\n\n\n","/*! Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {Implementation} from \"../impl/AjaxImpl\";\nimport {PushImpl} from \"../impl/PushImpl\";\nimport {oam as _oam} from \"../myfaces/OamSubmit\";\nimport {$nsp, CTX_PARAM_EXECUTE, CTX_PARAM_RENDER, P_BEHAVIOR_EVENT} from \"../impl/core/Const\";\nimport {ErrorData} from \"../impl/xhrCore/ErrorData\";\nimport {EventData} from \"../impl/xhrCore/EventData\";\n\n//we use modules to get a proper jsdoc and static/map structure in the calls\n//as per spec requirement\nexport module faces {\n\n\n /**\n * Version of the implementation for the faces.ts.\n * <p />\n * as specified within the jsf specifications faces.html:\n * <ul>\n * <li>left two digits major release number</li>\n * <li>middle two digits minor spec release number</li>\n * <li>right two digits bug release number</li>\n * </ul>\n * @constant\n */\n export var specversion = 400000;\n /**\n * Implementation version as specified within the jsf specification.\n * <p />\n * A number increased with every implementation version\n * and reset by moving to a new spec release number\n *\n * @constant\n */\n export var implversion = 0;\n\n /**\n * SeparatorChar as defined by facesContext.getNamingContainerSeparatorChar()\n * @type {Char}\n */\n export var separatorchar = getSeparatorChar();\n\n /**\n * Context Path as defined externalContext.requestContextPath\n */\n export var contextpath = '#{facesContext.externalContext.requestContextPath}';\n // we do not have a fallback here, for now\n\n /**\n * This method is responsible for the return of a given project stage as defined\n * by the jsf specification.\n * <p/>\n * Valid return values are:\n * <ul>\n * <li>"Production"</li>\n * <li>"Development"</li>\n * <li>"SystemTest"</li>\n * <li>"UnitTest"</li>\n * </li>\n *\n * @return {String} the current project state emitted by the server side method:\n * <i>jakarta.faces.application.Application.getProjectStage()</i>\n */\n export function getProjectStage(): string {\n return Implementation.getProjectStage();\n }\n\n /**\n * collect and encode data for a given form element (must be of type form)\n * find the jakarta.faces.ViewState element and encode its value as well!\n * return a concatenated string of the encoded values!\n *\n * @throws an exception in case of the given element not being of type form!\n * https://issues.apache.org/jira/browse/MYFACES-2110\n */\n export function getViewState(formElement: Element | string): string {\n return Implementation.getViewState(formElement);\n }\n\n /**\n * returns the window identifier for the given node / window\n * @return the window identifier or null if none is found\n * @param rootNode\n */\n export function getClientWindow(rootNode?: Element | string): string {\n return Implementation.getClientWindow(rootNode);\n }\n\n //private helper functions\n function getSeparatorChar(): string {\n const sep = '#{facesContext.namingContainerSeparatorChar}';\n //We now enable standalone mode, the separator char was not mapped we make a fallback to 2.3 behavior\n //the idea is that the separator char is provided from the underlying container, but if not then we\n //will perform a fallback (aka 2.3 has the url fallback behavior)\n return (sep.match(/\\#\\{facesContext.namingContainerSeparatorChar\\}/gi)) ? Implementation.getSeparatorChar() : sep;\n }\n\n\n\n\n export module ajax {\n \"use strict\";\n\n /**\n * this function has to send the ajax requests\n *\n * following requestInternal conditions must be met:\n * <ul>\n * <li> the requestInternal must be sent asynchronously! </li>\n * <li> the requestInternal must be a POST!!! requestInternal </li>\n * <li> the requestInternal url must be the form action attribute </li>\n * <li> all requests must be queued with a client side requestInternal queue to ensure the requestInternal ordering!</li>\n * </ul>\n *\n * @param {String|Node} element: any dom element no matter being it html or jsf, from which the event is emitted\n * @param {EVENT} event: any javascript event supported by that object\n * @param {Map} options : map of options being pushed into the ajax cycle\n */\n export function request(element: Element, event?: Event, options?: Context): void {\n Implementation.request(element, event, options)\n }\n\n /**\n * response handler\n * @param request the request object having triggered this response\n * @param context the request context\n *\n * TODO add info on what can be in the context\n */\n export function response(request: XMLHttpRequest, context?: Context): void {\n Implementation.response(request, context);\n }\n\n /**\n * Adds an error handler to our global error queue.\n * the error handler must be of the format <i>function errorListener(<errorData>)</i>\n * with errorData being of following format:\n * <ul>\n * <li> errorData.type : "error"</li>\n * <li> errorData.status : the error status message</li>\n * <li> errorData.serverErrorName : the server error name in case of a server error</li>\n * <li> errorData.serverErrorMessage : the server error message in case of a server error</li>\n * <li> errorData.source : the issuing source element which triggered the requestInternal </li>\n * <li> eventData.responseCode: the response code (aka http requestInternal response code, 401 etc...) </li>\n * <li> eventData.responseText: the requestInternal response text </li>\n * <li> eventData.responseXML: the requestInternal response xml </li>\n * </ul>\n *\n * @param {function} errorListener error handler must be of the format <i>function errorListener(<errorData>)</i>\n */\n export function addOnError(errorFunc: (data: ErrorData) => void): void {\n Implementation.addOnError(<any>errorFunc);\n }\n\n /**\n * Adds a global event listener to the ajax event queue. The event listener must be a function\n * of following format: <i>function eventListener(<eventData>)</i>\n *\n * @param {function} eventListener event must be of the format <i>function eventListener(<eventData>)</i>\n */\n export function addOnEvent(eventFunc: (data: EventData) => void): void {\n Implementation.addOnEvent(<any>eventFunc);\n }\n }\n\n export module util {\n\n /**\n * varargs function which executes a chain of code (functions or any other code)\n *\n * if any of the code returns false, the execution\n * is terminated prematurely skipping the rest of the code!\n *\n * @param {DomNode} source, the callee object\n * @param {Event} event, the event object of the callee event triggering this function\n * @param funcs ... arbitrary array of functions or strings\n * @returns true if the chain has succeeded false otherwise\n */\n export function chain(source, event, ...funcs: Array<Function | string>): boolean {\n return Implementation.chain(source, event, ...(funcs as EvalFuncs));\n }\n }\n\n export module push {\n /**\n * @param {function} onopen The function to be invoked when the web socket is opened.\n * @param {function} onmessage The function to be invoked when a message is received.\n * @param {function} onclose The function to be invoked when the web socket is closed.\n * @param {boolean} autoconnect Whether or not to immediately open the socket. Defaults to <code>false</code>.\n */\n export function init(socketClientId: string,\n uri: string,\n channel: string,\n onopen: Function,\n onmessage: Function,\n onclose: Function,\n behaviorScripts: any,\n autoconnect: boolean): void {\n PushImpl.init(socketClientId, uri, channel, onopen, onmessage, onclose, behaviorScripts, autoconnect);\n }\n\n /**\n * Open the web socket on the given channel.\n * @param {string} channel The name of the web socket channel.\n * @throws {Error} When channel is unknown.\n */\n export function open(socketClientId: string): void {\n PushImpl.open(socketClientId);\n }\n\n /**\n * Close the web socket on the given channel.\n * @param {string} channel The name of the web socket channel.\n * @throws {Error} When channel is unknown.\n */\n export function close(socketClientId: string): void {\n PushImpl.close(socketClientId);\n }\n\n }\n}\n\nexport module myfaces {\n /**\n * AB function similar to mojarra and Primefaces\n * not part of the spec but a convenience accessor method\n * Code provided by Thomas Andraschko\n *\n * @param source the event source\n * @param event the event\n * @param eventName event name for java.jakarta.faces.behavior.evemnt\n * @param execute execute list as passed down in faces.ajax.request\n * @param render\n * @param options\n */\n export function ab(source: Element, event: Event, eventName: string, execute: string, render: string, options: Context = {}): void {\n if (eventName) {\n options[$nsp(P_BEHAVIOR_EVENT)] = eventName;\n }\n if (execute) {\n options[CTX_PARAM_EXECUTE] = execute;\n }\n if (render) {\n options[CTX_PARAM_RENDER] = render;\n }\n\n (window?.faces ?? window.jsf).ajax.request(source, event, options);\n }\n\n /**\n * legacy oam functions\n */\n export const oam = _oam;\n}\n\n\n","/*! Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {IListener} from \"./util/IListener\";\nimport {Response} from \"./xhrCore/Response\";\nimport {XhrRequest} from \"./xhrCore/XhrRequest\";\nimport {AsynchronousQueue} from \"./util/AsyncQueue\";\nimport {AssocArrayCollector, Config, DQ, Lang, LazyStream, Optional, Stream} from \"mona-dish\";\nimport {Assertions} from \"./util/Assertions\";\nimport {XhrFormData} from \"./xhrCore/XhrFormData\";\nimport {ExtDomquery} from \"./util/ExtDomQuery\";\nimport {ErrorData} from \"./xhrCore/ErrorData\";\nimport {EventData} from \"./xhrCore/EventData\";\nimport {ExtLang} from \"./util/Lang\";\n\nimport {\n $nsp,\n CTX_PARAM_EXECUTE,\n CTX_PARAM_PASS_THR,\n CTX_PARAM_SRC_CTL_ID,\n CTX_PARAM_SRC_FRM_ID,\n CTX_PARAM_TR_TYPE,\n IDENT_ALL,\n IDENT_FORM,\n IDENT_NONE,\n IDENT_THIS,\n MYFACES,\n ON_ERROR,\n ON_EVENT,\n P_AJAX,\n P_CLIENT_WINDOW,\n P_EVT,\n P_EXECUTE,\n P_PARTIAL_SOURCE,\n P_RENDER,\n P_RESET_VALUES,\n P_WINDOW_ID,\n CTX_PARAM_RENDER,\n REQ_TYPE_POST,\n SOURCE,\n TAG_FORM\n} from \"./core/Const\";\nimport {\n resolveDefaults,\n resolveDelay,\n resolveForm,\n resolveTimeout\n} from \"./xhrCore/RequestDataResolver\";\n\n\ndeclare var faces: any;\n\n/*\n * allowed project stages\n */\nenum ProjectStages {\n Production = \"Production\",\n Development = \"Development\",\n SystemTest = \"SystemTest\",\n UnitTest = \"UnitTest\"\n}\n\n/*\n * blockfilter for the passthrough filtering; the attributes given here\n * will not be transmitted from the options into the passthrough\n */\nenum BlockFilter {\n onerror = \"onerror\",\n onevent = \"onevent\",\n render = \"render\",\n execute = \"execute\",\n myfaces = \"myfaces\",\n delay = \"delay\",\n timeout = \"timeout\",\n windowId = \"windowId\"\n}\n\n/**\n * Core Implementation\n * to distinct between api and impl\n *\n * The original idea was to make the implementation pluggable\n * but this is pointless, you always can overwrite the thin api layer\n * however a dedicated api makes sense for readability reasons\n */\nexport module Implementation {\n/*\n Small internal explanation, this code is optimized for readability\n and cuts off a ton of old legacy code.\n Aka older browsers are not supported anymore.\n We use a self written helper library to keep the number of exernal\n code dependencies down.\n The library is called mona-dish and started as a small sideproject of mine\n it provides following\n\n a) Monad like structures for querying because this keeps the code denser and adds abstractions\n that always was the strong point of jquery and it still is better in this regard than what ecmascript provides\n\n b) Streams and lazystreams like java has, a pull like construct, ecmascript does not have anything like Lazystreams.\n Another option would have been rxjs but that would have introduced a code dependency and probably more code. We might\n move to RXJS if the need arises however. But for now I would rather stick with my small self grown library which works\n quite well and where I can patch quickly (I have used it in several industrial projects, so it works well\n and is heavily fortified by unit tests (140 testcases as time of writing this))\n\n c) A neutral json like configuration which allows assignments of arbitrary values with reduce code which then can be\n transformed into different data representations\n\n examples:\n internalCtx.assign(MYPARAM, CTX_PARAM_SRC_FRM_ID).value = form.id.value;\n passes a value into context.MYPARAM.CTX_PARAM_SRC_FRM_ID\n\n basically an abbreviation for\n\n internalCtxt[MYPARAM] = internalCtxt?.[MYPARAM] ? internalCtxt[MYPARAM] : {};\n internalCtxt[MYPARAM][CTX_PARAM_SRC_FRM_ID] = internalCtxt?.[MYPARAM][CTX_PARAM_SRC_FRM_ID] ? internalCtxt[MYPARAM][CTX_PARAM_SRC_FRM_ID] : {};\n internalCtxt[MYPARAM][CTX_PARAM_SRC_FRM_ID] = form.id.value;\n\n\n internalCtx.assign(condition, MYPARAM, CTX_PARAM_SRC_FRM_ID).value = form.id.value;\n passes a value into context.MYPARAM.CTX_PARAM_SRC_FRM_ID if condition === true otherwise it is ignored\n\n abbreviates:\n if(condition) {\n internalCtxt[MYPARAM] = internalCtxt?.[MYPARAM] ? internalCtxt[MYPARAM] : {};\n internalCtxt[MYPARAM][CTX_PARAM_SRC_FRM_ID] = internalCtxt?.[MYPARAM][CTX_PARAM_SRC_FRM_ID] ? internalCtxt[MYPARAM][CTX_PARAM_SRC_FRM_ID] : {};\n internalCtxt[MYPARAM][CTX_PARAM_SRC_FRM_ID] = form.id.value;\n }\n\n\n d) Optional constructs, while under heavy debate we only use them lightly where the api requires it from mona-dish\n\n Note the inclusion of this library uses a reduced build which only includes the part of it, which we really use\n\n */\n\n import trim = Lang.trim;\n import getMessage = ExtLang.getMessage;\n import getGlobalConfig = ExtLang.getGlobalConfig;\n import assert = Assertions.assert;\n\n let projectStage: string = null;\n let separator: string = null;\n let eventQueue = [];\n let errorQueue = [];\n export let requestQueue: AsynchronousQueue<XhrRequest> = null;\n /*error reporting threshold*/\n let threshold = \"ERROR\";\n\n /**\n * fetches the separator char from the given script tags\n *\n * @return {string} the separator char for the given script tags\n */\n export function getSeparatorChar(): string {\n return resolveGlobalConfig()?.separator ??\n this?.separator ??\n (separator = ExtDomquery.searchJsfJsFor(/separator=([^&;]*)/).orElse(\":\").value);\n }\n\n /**\n * fetches the separator char from the given script tags\n *\n * @return {string} the separator char for the given script tags\n */\n export function getContextPath(): string {\n return resolveGlobalConfig()?.separator ??\n this?.separator ??\n (separator = ExtDomquery.searchJsfJsFor(/separator=([^&;]*)/).orElse(\":\").value);\n }\n\n\n /**\n * this is for testing purposes only, since AjaxImpl is a module\n * we need to reset for every unit test its internal states\n */\n export function reset() {\n projectStage = null;\n separator = null;\n eventQueue = [];\n errorQueue = [];\n requestQueue = null;\n }\n\n /**\n * @return the project stage also emitted by the server:\n * it cannot be cached and must be delivered over the server\n * The value for it comes from the requestInternal parameter of the faces.js script called \"stage\".\n */\n export function getProjectStage(): string | null {\n return resolveGlobalConfig()?.projectStage ??\n this?.projectStage ??\n (projectStage = resolveProjectStateFromURL());\n }\n\n /**\n * resolves the project stage as url parameter\n * @return the project stage or null\n */\n export function resolveProjectStateFromURL(): string | null {\n\n /* run through all script tags and try to find the one that includes faces.js */\n const foundStage = ExtDomquery.searchJsfJsFor(/stage=([^&;]*)/).value as string;\n return (foundStage in ProjectStages) ? foundStage : null;\n }\n\n /**\n * implementation of the faces.util.chain functionality\n *\n * @param source\n * @param event\n * @param funcs\n */\n export function chain(source: any, event: Event, ...funcs: EvalFuncs): boolean {\n // we can use our lazy stream each functionality to run our chain here..\n // by passing a boolean as return value into the onElem call\n // we can stop early at the first false, just like the spec requests\n\n return LazyStream.of(...funcs)\n .map(func => resolveAndExecute(source, event, func))\n // we use the return false == stop as an early stop, onElem stops at the first false\n .onElem((opResult: boolean) => opResult)\n //last ensures we run until the first false is returned\n .last().value;\n }\n\n /**\n * this function has to send the ajax requests\n *\n * following request conditions must be met:\n * <ul>\n * <li> the request must be sent asynchronously! </li>\n * <li> the request must be a POST!!! request </li>\n * <li> the request url must be the form action attribute </li>\n * <li> all requests must be queued with a client side request queue to ensure the request ordering!</li>\n * </ul>\n *\n * @param el any dom element no matter being it html or jsf, from which the event is emitted\n * @param event any javascript event supported by that object\n * @param opts map of options being pushed into the ajax cycle\n *\n * a) transformArguments out of the function\n * b) passThrough handling with a map copy with a filter map block map\n */\n export function request(el: ElemDef, event?: Event, opts ?: Options) {\n\n const {\n resolvedEvent,\n options,\n elem,\n elementId,\n requestCtx,\n internalCtx,\n windowId,\n isResetValues\n } = resolveDefaults(event, opts, el);\n\n Assertions.assertRequestIntegrity(options, elem);\n\n /**\n * fetch the parent form\n *\n * note we also add an override possibility here\n * so that people can use dummy forms and work\n * with detached objects\n */\n const form: DQ = resolveForm(requestCtx, elem, resolvedEvent);\n const formId = form.id.value;\n const delay: number = resolveDelay(options);\n const timeout: number = resolveTimeout(options);\n\n requestCtx.assignIf(!!windowId, P_WINDOW_ID).value = windowId;\n\n requestCtx.assign(CTX_PARAM_PASS_THR).value = filterPassthroughValues(options.value);\n requestCtx.assignIf(!!resolvedEvent, CTX_PARAM_PASS_THR, P_EVT).value = resolvedEvent?.type;\n\n /**\n * ajax pass through context with the source\n * onresolved Event and onerror Event\n */\n requestCtx.assign(SOURCE).value = elementId;\n\n /**\n * on resolvedEvent and onError...\n * those values will be traversed later on\n * also into the response context\n */\n requestCtx.assign(ON_EVENT).value = options.value?.onevent;\n requestCtx.assign(ON_ERROR).value = options.value?.onerror;\n\n /**\n * lets drag the myfaces config params also in\n */\n requestCtx.assign(MYFACES).value = options.value?.myfaces;\n\n /**\n * binding contract the jakarta.faces.source must be set\n */\n requestCtx.assign(CTX_PARAM_PASS_THR, P_PARTIAL_SOURCE).value = elementId;\n\n /**\n * jakarta.faces.partial.ajax must be set to true\n */\n requestCtx.assign(CTX_PARAM_PASS_THR, P_AJAX).value = true;\n\n /**\n * if resetValues is set to true\n * then we have to set jakarta.faces.resetValues as well\n * as pass through parameter\n * the value has to be explicitly true, according to\n * the specs jsdoc\n */\n requestCtx.assignIf(isResetValues, CTX_PARAM_PASS_THR, P_RESET_VALUES).value = true;\n\n // additional meta information to speed things up, note internal non jsf\n // pass through options are stored under _mfInternal in the context\n internalCtx.assign(CTX_PARAM_SRC_FRM_ID).value = formId;\n\n // mojarra compatibility, mojarra is sending the form id as well\n // this is not documented behavior but can be determined by running\n // mojarra under blackbox conditions.\n // I assume it does the same as our formId_submit=1 so leaving it out\n // won't hurt but for the sake of compatibility we are going to add it\n requestCtx.assign(CTX_PARAM_PASS_THR, formId).value = formId;\n internalCtx.assign(CTX_PARAM_SRC_CTL_ID).value = elementId;\n internalCtx.assign(CTX_PARAM_TR_TYPE).value = REQ_TYPE_POST;\n\n assignClientWindowId(form, requestCtx);\n assignExecute(options, requestCtx, form, elementId);\n assignRender(options, requestCtx, form, elementId);\n\n //now we enqueue the request as asynchronous runnable into our request\n //queue and let the queue take over the rest\n queueHandler.addRequestToQueue(elem, form, requestCtx, internalCtx, delay, timeout);\n }\n\n /**\n * Spec. 13.3.3\n * Examining the response markup and updating the DOM tree\n * @param {XMLHttpRequest} request - the ajax request\n * @param {Object} context - the ajax context\n */\n export function response(request: XMLHttpRequest, context: Context) {\n Response.processResponse(request, context);\n }\n\n /**\n * adds an error handler to the error queue\n *\n * @param errorListener the error listener handler\n */\n export function addOnError(errorListener: IListener<ErrorData>) {\n errorQueue.push(errorListener);\n }\n\n /**\n * adds an event handler to the event queue\n *\n * @param eventListener the event listener handler\n */\n export function addOnEvent(eventListener: IListener<EventData>) {\n eventQueue.push(eventListener);\n }\n\n // noinspection JSUnusedLocalSymbols\n /**\n * sends an event to the event handlers\n *\n * @param data the event data object hosting the event data according to the spec @see EventData for what is reachable\n * @param localHandler an optional event handler, which is processed before the event handler chain\n */\n export function sendEvent(data: EventData, localHandler = function (data: EventData) {\n }) {\n /*now we serve the queue as well*/\n localHandler(data);\n eventQueue.forEach(fn => fn(data));\n }\n\n /**\n * error handler behavior called internally\n * and only into the impl it takes care of the\n * internal message transformation to a myfaces internal error\n * and then uses the standard send error mechanisms\n * also a double error logging prevention is done as well\n *\n * @param request the request currently being processed\n * @param context the context affected by this error\n * @param exception the exception being thrown\n * @param clearRequestQueue if set to true, clears the request queue of all pending requests\n */\n export function stdErrorHandler(request: XMLHttpRequest,\n context: Config,\n exception: Error,\n clearRequestQueue = false) {\n //newer browsers do not allow to hold additional values on native objects like exceptions\n //we hence capsule it into the request, which is gced automatically\n //on ie as well, since the stdErrorHandler usually is called between requests\n //this is a valid approach\n try {\n if (threshold == \"ERROR\") {\n let errorData = ErrorData.fromClient(exception);\n sendError(errorData);\n }\n } finally {\n if (clearRequestQueue) {\n requestQueue.cleanup();\n }\n }\n }\n\n // noinspection JSUnusedLocalSymbols\n /**\n * implementation triggering the error chain\n *\n *\n *\n * handles the errors, in case of an onError exists within the context the onError is called as local error handler\n * the registered error handlers in the queue received an error message to be dealt with\n * and if the projectStage is at development an alert box is displayed\n *\n * note: we have additional functionality here, via the global config myfaces.config.defaultErrorOutput a function can be provided\n * which changes the default output behavior from alert to something else\n *\n * @param errorData the error data to be displayed\n * @param localHandler an optional local error handler which has to be processed before the error handler queue\n */\n export function sendError(errorData: ErrorData, localHandler = function (data: ErrorData) {\n }) {\n\n localHandler(errorData);\n errorQueue.forEach((errorCallback: Function) => {\n errorCallback(errorData);\n });\n let displayError: (string) => void = getGlobalConfig(\"defaultErrorOutput\", (console ? console.error : alert));\n displayError(errorData);\n }\n\n /**\n * @node optional element or id defining a rootnode where an element with the id \"jakarta.faces.windowId\" is hosted\n * @return the client window id of the current window, if one is given if none is found, null is returned\n */\n export function getClientWindow(node ?: Element | string): string | null {\n const ALTERED = \"___mf_id_altered__\";\n const INIT = \"___init____\";\n\n /**\n * the search root for the dom element search\n */\n let searchRoot = new DQ(node || document.body).querySelectorAll(`form input [name='${P_CLIENT_WINDOW}']`);\n\n /**\n * lazy helper to fetch the window id from the window url\n */\n let fetchWindowIdFromUrl = () => ExtDomquery.searchJsfJsFor(/jfwid=([^&;]*)/).orElse(null).value;\n\n /**\n * functional double check based on stream reduction\n * the values should be identical or on INIT value which is a premise to\n * skip the first check\n *\n * @param value1\n * @param value2\n */\n let differenceCheck = (value1: string, value2: string) => {\n if(value1 == INIT) {\n return value2;\n } else if (value1 == ALTERED || value1 != value2) {\n return ALTERED;\n }\n return value2;\n };\n\n /**\n * helper for cleaner code, maps the value from an item\n *\n * @param item\n */\n let getValue = (item: DQ) => item.attr(\"value\").value;\n /**\n * fetch the window id from the forms\n * window ids must be present in all forms\n * or non existent. If they exist all of them must be the same\n */\n\n let formWindowId: Optional<string> = searchRoot.stream.map<string>(getValue).reduce(differenceCheck, INIT);\n\n\n //if the resulting window id is set on altered then we have an unresolvable problem\n assert(ALTERED != formWindowId.value, \"Multiple different windowIds found in document\");\n\n /**\n * return the window id or null\n * prio, forms under node/document and if not given then from the url\n */\n return formWindowId.value != INIT ? formWindowId.value : fetchWindowIdFromUrl();\n }\n\n /**\n * collect and encode data for a given form element (must be of type form)\n * find the jakarta.faces.ViewState element and encode its value as well!\n * @return a concatenated string of the encoded values!\n *\n * @throws Error in case of the given element not being of type form!\n * https://issues.apache.org/jira/browse/MYFACES-2110\n */\n export function getViewState(form: Element | string): string {\n /**\n * typecheck assert!, we opt for strong typing here\n * because it makes it easier to detect bugs\n */\n\n let element: DQ = DQ.byId(form, true);\n if (!element.isTag(TAG_FORM)) {\n throw new Error(getMessage(\"ERR_VIEWSTATE\"));\n }\n\n let formData = new XhrFormData(element);\n return formData.toString();\n }\n\n /**\n * this at the first sight looks like a weird construct, but we need to do it this way\n * for testing, we cannot proxy addRequestToQueue from the testing frameworks directly,\n * but we need to keep it under unit tests.\n */\n export let queueHandler = {\n /**\n * public to make it shimmable for tests\n *\n * adds a new request to our queue for further processing\n */\n addRequestToQueue: function (elem: DQ, form: DQ, reqCtx: Config, respPassThr: Config, delay = 0, timeout = 0) {\n requestQueue = requestQueue ?? new AsynchronousQueue<XhrRequest>();\n requestQueue.enqueue(new XhrRequest(elem, form, reqCtx, respPassThr, [], timeout), delay);\n }\n };\n\n //----------------------------------------------- Methods ---------------------------------------------------------------------\n\n /**\n * the idea is to replace some placeholder parameters with their respective values\n * placeholder params like @all, @none, @form, @this need to be replaced by\n * the values defined by the specification\n *\n * This function does it for the render parameters\n *\n * @param requestOptions the source options coming in as options object from faces.ajax.request (options parameter)\n * @param targetContext the receiving target context\n * @param issuingForm the issuing form\n * @param sourceElementId the executing element triggering the faces.ajax.request (id of it)\n */\n function assignRender(requestOptions: Config, targetContext: Config, issuingForm: DQ, sourceElementId: string) {\n if (requestOptions.getIf(CTX_PARAM_RENDER).isPresent()) {\n remapDefaultConstants(targetContext.getIf(CTX_PARAM_PASS_THR).get({}), P_RENDER, <string>requestOptions.getIf(CTX_PARAM_RENDER).value, issuingForm, <any>sourceElementId);\n }\n }\n\n /**\n * the idea is to replace some placeholder parameters with their respective values\n * placeholder params like @all, @none, @form, @this need to be replaced by\n * the values defined by the specification\n *\n * This function does it for the execute parameters\n *\n * @param requestOptions the source options coming in as options object from faces.ajax.request (options parameter)\n * @param targetContext the receiving target context\n * @param issuingForm the issuing form\n * @param sourceElementId the executing element triggering the faces.ajax.request (id of it)\n */\n function assignExecute(requestOptions: Config, targetContext: Config, issuingForm: DQ, sourceElementId: string) {\n\n if (requestOptions.getIf(CTX_PARAM_EXECUTE).isPresent()) {\n /*the options must be a blank delimited list of strings*/\n /*compliance with Mojarra which automatically adds @this to an execute\n * the spec rev 2.0a however states, if none is issued nothing at all should be sent down\n */\n requestOptions.assign(CTX_PARAM_EXECUTE).value = [requestOptions.getIf(CTX_PARAM_EXECUTE).value, IDENT_THIS].join(\" \");\n remapDefaultConstants(targetContext.getIf(CTX_PARAM_PASS_THR).get({}), P_EXECUTE, <string>requestOptions.getIf(CTX_PARAM_EXECUTE).value, issuingForm, <any>sourceElementId);\n } else {\n targetContext.assign(CTX_PARAM_PASS_THR, P_EXECUTE).value = sourceElementId;\n }\n }\n\n /**\n * apply the browser tab where the request was originating from\n *\n * @param form the form hosting the client window id\n * @param targetContext the target context receiving the value\n */\n function assignClientWindowId(form: DQ, targetContext: Config) {\n\n let clientWindow = (window?.faces ?? window?.jsf).getClientWindow(form.getAsElem(0).value);\n if (clientWindow) {\n targetContext.assign(CTX_PARAM_PASS_THR, P_CLIENT_WINDOW).value = clientWindow;\n }\n }\n\n /**\n * transforms the user values to the expected one\n * with the proper none all form and this handling\n * (note we also could use a simple string replace but then\n * we would have had double entries under some circumstances)\n *\n * there are several standardized constants which need a special treatment\n * like @all, @none, @form, @this\n *\n * @param targetConfig the target configuration receiving the final values\n * @param targetKey the target key\n * @param userValues the passed user values (aka input string which needs to be transformed)\n * @param issuingForm the form where the issuing element originates\n * @param issuingElementId the issuing element\n */\n function remapDefaultConstants(targetConfig: Config, targetKey: string, userValues: string, issuingForm: DQ, issuingElementId: string): Config {\n //a cleaner implementation of the transform list method\n\n let iterValues: string[] = (userValues) ? trim(userValues).split(/\\s+/gi) : [];\n let ret = [];\n let processed: {[key: string]: boolean} = {};\n\n // in this case we do not use lazy stream because it wont bring any code reduction\n // or speedup\n for (let cnt = 0; cnt < iterValues.length; cnt++) {\n //avoid doubles\n if (iterValues[cnt] in processed) {\n continue;\n }\n switch (iterValues[cnt]) {\n //@none no values should be sent\n case IDENT_NONE:\n return targetConfig.delete(targetKey);\n //@all is a pass through case according to the spec\n case IDENT_ALL:\n targetConfig.assign(targetKey).value = IDENT_ALL;\n return targetConfig;\n //@form pushes the issuing form id into our list\n case IDENT_FORM:\n ret.push(issuingForm.id.value);\n processed[issuingForm.id.value] = true;\n break;\n //@this is replaced with the current issuing element id\n case IDENT_THIS:\n if (!(issuingElementId in processed)) {\n ret.push(issuingElementId);\n processed[issuingElementId] = true;\n }\n break;\n default:\n ret.push(iterValues[cnt]);\n processed[iterValues[cnt]] = true;\n }\n }\n //We now add the target as joined list\n targetConfig.assign(targetKey).value = ret.join(\" \");\n return targetConfig;\n }\n\n /**\n * filter the options given with a blacklist so that only\n * the values required for passthough land in the ajax request\n *\n * @param {Context} mappedOpts the options to be filtered\n */\n function filterPassthroughValues(mappedOpts: Context): Context {\n //we now can use the full code reduction given by our stream api\n //to filter\n return Stream.ofAssoc(mappedOpts)\n .filter(item => !(item[0] in BlockFilter))\n .collect(new AssocArrayCollector());\n }\n\n function resolveGlobalConfig(): any {\n return window?.[MYFACES]?.config ?? {};\n }\n\n /**\n * Private helper to execute a function or code fragment\n * @param source the source of the caller passed into the function as this\n * @param event an event which needs to be passed down into the function\n * @param func either a function or code fragment\n * @return a boolean value, if the passed function returns false, then the\n * caller is basically notified that the execution can now stop (JSF requirement for chain)\n * @private\n */\n function resolveAndExecute(source: any, event: Event, func: Function | string): boolean {\n if (\"string\" != typeof func) {\n //function is passed down as chain parameter, can be executed as is\n return (<Function>func).call(source, event) !== false;\n } else {\n //either a function or a string can be passed in case of a string we have to wrap it into another function\n //it is not a plain executable code but a definition\n let sourceCode = trim(<string>func);\n if (sourceCode.indexOf(\"function \") == 0) {\n sourceCode = `return ${sourceCode} (event)`;\n }\n return new Function(\"event\", sourceCode).call(source, event) !== false;\n }\n }\n}\n","/*! Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Typescript port of the faces.push part in the myfaces implementation\n */\n\n//TODO still work in progress\n//this is a 1:1 port for the time being\nimport {MAX_RECONNECT_ATTEMPTS, REASON_EXPIRED, RECONNECT_INTERVAL} from \"./core/Const\";\n;\n\n\n/**\n * Implementation class for the push functionality\n */\nexport module PushImpl {\n\n const URL_PROTOCOL = window.location.protocol.replace(\"http\", \"ws\") + \"//\";\n\n\n //we expose the member variables for testing purposes\n //they are not directly touched outside of tests\n\n /* socket map by token */\n export let sockets = {};\n /* component attributes by clientId */\n export let components = {};\n /* client ids by token (share websocket connection) */\n export let clientIdsByTokens = {};\n\n\n //needed for testing\n export function reset() {\n sockets = {};\n components = {}\n clientIdsByTokens = {}\n }\n\n /*\n * Api implementations, exposed functions\n */\n\n /**\n *\n * @param {function} onopen The function to be invoked when the web socket is opened.\n * @param {function} onmessage The function to be invoked when a message is received.\n * @param {function} onclose The function to be invoked when the web socket is closed.\n * @param {boolean} autoconnect Whether or not to immediately open the socket. Defaults to <code>false</code>.\n */\n export function init(socketClientId: string,\n uri: string,\n channel: string,\n onopen: Function,\n onmessage: Function,\n onclose: Function,\n behaviorScripts: any,\n autoconnect: boolean) {\n onclose = resolveFunction(onclose);\n\n if (!window.WebSocket) { // IE6-9.\n onclose(-1, channel);\n return;\n }\n\n let channelToken = uri.substr(uri.indexOf('?') + 1);\n\n if (!components[socketClientId]) {\n components[socketClientId] = {\n 'channelToken': channelToken,\n 'onopen': resolveFunction(onopen),\n 'onmessage' : resolveFunction(onmessage),\n 'onclose': onclose,\n 'behaviors': behaviorScripts,\n 'autoconnect': autoconnect};\n if (!clientIdsByTokens[channelToken]) {\n clientIdsByTokens[channelToken] = [];\n }\n clientIdsByTokens[channelToken].push(socketClientId);\n if (!sockets[channelToken]){\n sockets[channelToken] = new Socket(channelToken,\n getBaseURL(uri), channel);\n }\n }\n\n if (autoconnect) {\n (window?.faces ?? window?.jsf).push.open(socketClientId);\n }\n }\n\n export function open(socketClientId: string) {\n getSocket(components?.[socketClientId]?.channelToken).open();\n }\n\n export function close(socketClientId: string) {\n getSocket(components?.[socketClientId].channelToken).close();\n }\n\n // Private helper classes\n // Private classes functions ----------------------------------------------------------------------------------\n /**\n * Creates a reconnecting web socket. When the web socket successfully connects on first attempt, then it will\n * automatically reconnect on timeout with cumulative intervals of 500ms with a maximum of 25 attempts (~3 minutes).\n * The <code>onclose</code> function will be called with the error code of the last attempt.\n * @constructor\n * @param {string} channelToken the channel token associated with this websocket connection\n * @param {string} url The URL of the web socket\n * @param {string} channel The name of the web socket channel.\n */\n\n class Socket {\n\n socket: WebSocket;\n reconnectAttempts = 0;\n\n constructor(private channelToken: string, private url: string, private channel: string) {\n }\n\n open() {\n if (this.socket && this.socket.readyState == 1) {\n return;\n }\n this.socket = new WebSocket(this.url);\n\n this.bindCallbacks();\n }\n\n onopen(event: any) {\n if (!this.reconnectAttempts) {\n let clientIds = clientIdsByTokens[this.channelToken];\n for (let i = clientIds.length - 1; i >= 0; i--) {\n let socketClientId = clientIds[i];\n components[socketClientId]['onopen'](this.channel);\n }\n }\n this.reconnectAttempts = 0;\n }\n\n onmmessage(event: any) {\n let message = JSON.parse(event.data);\n for (let i = clientIdsByTokens[this.channelToken].length - 1; i >= 0; i--) {\n let socketClientId = clientIdsByTokens[this.channelToken][i];\n if (document.getElementById(socketClientId)) {\n try {\n components[socketClientId]['onmessage'](message, this.channel, event);\n } catch (e) {\n //Ignore\n }\n let behaviors = components[socketClientId]['behaviors'];\n let functions = behaviors[message];\n if (functions && functions.length) {\n for (let j = 0; j < functions.length; j++) {\n try {\n functions[j](null);\n } catch (e) {\n //Ignore\n }\n }\n }\n } else {\n clientIdsByTokens[this.channelToken].splice(i, 1);\n }\n }\n if (clientIdsByTokens[this.channelToken].length == 0) {\n //tag dissapeared\n this.close();\n }\n }\n\n onclose(event: any) {\n if (!this.socket\n || (event.code == 1000 && event.reason == REASON_EXPIRED)\n || (event.code == 1008)\n || (!this.reconnectAttempts)\n || (this.reconnectAttempts >= MAX_RECONNECT_ATTEMPTS)) {\n let clientIds = clientIdsByTokens[this.channelToken];\n for (let i = clientIds.length - 1; i >= 0; i--) {\n let socketClientId = clientIds[i];\n components[socketClientId]['onclose'](event?.code, this?.channel, event);\n }\n } else {\n setTimeout(this.open, RECONNECT_INTERVAL * this.reconnectAttempts++);\n }\n };\n\n close() {\n if (this.socket) {\n let s = this.socket;\n this.socket = null;\n s.close();\n }\n }\n\n /**\n * bind the callbacks to the socket callbacks\n */\n private bindCallbacks() {\n this.socket.onopen = (event: Event) => this.onopen(event);\n this.socket.onmessage = (event: Event) => this.onmmessage(event);\n this.socket.onclose = (event: Event) => this.onclose(event);\n }\n }\n\n // Private static functions ---------------------------------------------------------------------------------------\n\n function getBaseURL(url: string) {\n if (url.indexOf(\"://\") < 0) {\n let base = window.location.hostname + \":\" + window.location.port;\n return URL_PROTOCOL + base + url;\n } else {\n return url;\n }\n }\n\n /**\n * Get socket associated with given channelToken.\n * @param {string} channelToken The name of the web socket channelToken.\n * @return {Socket} Socket associated with given channelToken.\n * @throws {Error} When channelToken is unknown, you may need to initialize\n * it first via <code>init()</code> function.\n */\n function getSocket(channelToken: string): Socket {\n let socket = sockets[channelToken];\n if (socket) {\n return socket;\n } else {\n throw new Error(\"Unknown channelToken: \" + channelToken);\n }\n }\n\n function resolveFunction(fn: Function | string = () => {\n }): Function {\n return <Function>((typeof fn !== \"function\") && (fn = window[fn]), fn);\n }\n\n}","/*! Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*\n * [export const] constants\n */\nexport const P_PARTIAL_SOURCE = \"jakarta.faces.source\";\nexport const PARTIAL_ID = \"partialId\";\nexport const P_VIEWSTATE = \"jakarta.faces.ViewState\";\nexport const P_VIEWROOT = \"jakarta.faces.ViewRoot\";\nexport const P_VIEWHEAD = \"jakarta.faces.ViewHead\";\nexport const P_VIEWBODY = \"jakarta.faces.ViewBody\";\n\nexport const P_RESOURCE = \"jakarta.faces.Resource\";\n\n/*some useful definitions*/\n\nexport const EMPTY_FUNC = Object.freeze(() => {\n});\nexport const EMPTY_STR = \"\";\nexport const EMPTY_MAP = Object.freeze({});\n\nexport const HTML_VIEWSTATE = [\"<input type='hidden'\", \"id='\", P_VIEWSTATE, \"' name='\", P_VIEWSTATE, \"' value='' />\"].join(EMPTY_STR);\n\n\n/*internal identifiers for options*/\nexport const IDENT_ALL = \"@all\";\nexport const IDENT_NONE = \"@none\";\nexport const IDENT_THIS = \"@this\";\nexport const IDENT_FORM = \"@form\";\n\n\nexport const P_AJAX = \"jakarta.faces.partial.ajax\";\nexport const P_EXECUTE = \"jakarta.faces.partial.execute\";\nexport const P_RENDER = \"jakarta.faces.partial.render\";\nexport const P_EVT = \"jakarta.faces.partial.event\";\nexport const P_CLIENT_WINDOW = \"jakarta.faces.ClientWindow\";\nexport const P_RESET_VALUES = \"jakarta.faces.partial.resetValues\";\nexport const P_WINDOW_ID = \"jakarta.faces.windowId\";\n\nexport const P_BEHAVIOR_EVENT = \"jakarta.faces.behavior.event\";\n\nexport const CTX_PARAM_RENDER = \"render\";\nexport const WINDOW_ID = \"windowId\";\n\n/* message types */\nexport const ERROR = \"error\";\nexport const EVENT = \"event\";\n\nexport const ON_ERROR = \"onerror\";\nexport const ON_EVENT = \"onevent\";\n\n/* event emitting stages */\nexport const BEGIN = \"begin\";\nexport const COMPLETE = \"complete\";\nexport const SUCCESS = \"success\";\n\nexport const SOURCE = \"source\";\nexport const STATUS = \"status\";\n\n\nexport const ERROR_NAME = \"error-name\";\nexport const ERROR_MESSAGE = \"error-message\";\n\n\nexport const RESPONSE_TEXT = \"responseText\";\nexport const RESPONSE_XML = \"responseXML\";\n\n/*ajax errors spec 14.4.2*/\nexport const HTTPERROR = \"httpError\";\nexport const EMPTY_RESPONSE = \"emptyResponse\";\nexport const MALFORMEDXML = \"malformedXML\";\nexport const SERVER_ERROR = \"serverError\";\nexport const CLIENT_ERROR = \"clientError\";\nexport const TIMEOUT_EVENT = \"timeout\";\n\nexport const CTX_PARAM_MF_INTERNAL = \"_mfInternal\";\n\nexport const CTX_PARAM_SRC_FRM_ID = \"_mfSourceFormId\";\nexport const CTX_PARAM_SRC_CTL_ID = \"_mfSourceControlId\";\nexport const CTX_PARAM_TR_TYPE = \"_mfTransportType\";\nexport const CTX_PARAM_PASS_THR = \"passThrgh\";\nexport const CTX_PARAM_DELAY = \"delay\";\nexport const CTX_PARAM_TIMEOUT = \"timeout\";\nexport const CTX_PARAM_RST = \"resetValues\";\nexport const CTX_PARAM_EXECUTE = \"execute\";\n\nexport const STAGE_DEVELOPMENT = \"Development\";\n\n\nexport const CONTENT_TYPE = \"Content-Type\";\nexport const HEAD_FACES_REQ = \"Faces-Request\";\nexport const REQ_ACCEPT = \"Accept\";\nexport const VAL_AJAX = \"partial/ajax\";\nexport const ENCODED_URL = \"jakarta.faces.encodedURL\";\nexport const REQ_TYPE_GET = \"GET\";\nexport const REQ_TYPE_POST = \"POST\";\nexport const STATE_EVT_BEGIN = \"begin\"; //TODO remove this\nexport const STATE_EVT_TIMEOUT = \"TIMEOUT_EVENT\";\nexport const STATE_EVT_COMPLETE = \"complete\"; //TODO remove this\nexport const URL_ENCODED = \"application/x-www-form-urlencoded\";\nexport const MULTIPART = \"multipart/form-data\";\nexport const NO_TIMEOUT = 0;\nexport const STD_ACCEPT = \"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\";\n\nexport const TAG_HEAD = \"head\";\nexport const TAG_FORM = \"form\";\nexport const TAG_BODY = \"body\";\nexport const TAG_BEFORE = \"before\";\nexport const TAG_AFTER = \"after\";\n\nexport const TAG_ATTR = \"attribute\";\n\n\nexport const SEL_VIEWSTATE_ELEM = \"[name='\" + P_VIEWSTATE + \"']\";\nexport const SEL_CLIENT_WINDOW_ELEM = \"[name='\" + P_CLIENT_WINDOW + \"']\";\nexport const SEL_RESPONSE_XML = \"responseXML\";\n\nexport const PHASE_PROCESS_RESPONSE = \"processResponse\";\n\n\nexport const ERR_NO_PARTIAL_RESPONSE = \"Partial response not set\";\n\nexport const ATTR_URL = \"url\";\nexport const ATTR_NAME = \"name\";\nexport const ATTR_VALUE = \"value\";\nexport const ATTR_ID = \"id\";\n\n/*partial response types*/\nexport const RESP_PARTIAL = \"partial-response\";\n\n/*partial commands*/\nexport const CMD_CHANGES = \"changes\";\nexport const CMD_UPDATE = \"update\";\nexport const CMD_DELETE = \"delete\";\nexport const CMD_INSERT = \"insert\";\nexport const CMD_EVAL = \"eval\";\nexport const CMD_ERROR = \"error\";\nexport const CMD_ATTRIBUTES = \"attributes\";\nexport const CMD_EXTENSION = \"extension\";\nexport const CMD_REDIRECT = \"redirect\";\n\n/*other constants*/\n\nexport const UPDATE_FORMS = \"_updateForms\";\nexport const UPDATE_ELEMS = \"_updateElems\";\n\n//we want the head elements to be processed before we process the body\n//but after the inner html is done\nexport const DEFERRED_HEAD_INSERTS = \"_headElems\";\n\nexport const MYFACES = \"myfaces\";\n\nexport const SEL_SCRIPTS_STYLES = \"script, style, link\";\n\nexport const MF_NONE = \"__mf_none__\";\n\nexport const REASON_EXPIRED = \"Expired\";\n\nexport const APPLIED_VST = \"appliedViewState\";\nexport const APPLIED_CLIENT_WINDOW = \"appliedClientWindow\";\n\nexport const RECONNECT_INTERVAL = 500;\nexport const MAX_RECONNECT_ATTEMPTS = 25;\n\nexport const UNKNOWN = \"UNKNOWN\";\n\n/**\n * helper to remap the namespaces variables for 2.3\n * from 2.3 to 4.0 every javax namespace has been changed\n * to faces\n * To take the compatibility layer out this method just has to be\n * changed to a simple value passthrough\n */\n\nexport function $nsp(inputNamespace?: any): any {\n if((!inputNamespace) || !inputNamespace?.replace) {\n return inputNamespace;\n }\n return (!!window?.faces) ? inputNamespace.replace(/javax\\.faces/gi,\"jakarta.faces\"): inputNamespace.replace(/jakarta\\.faces/gi, \"javax.faces\");\n}\n\n","/*! Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {EMPTY_STR, P_VIEWSTATE} from \"./Const\";\n\nexport interface IdValueHolder {\n\n readonly id: string;\n readonly value: string;\n\n}\n\n/**\n * a helper class to isolate the\n * view state and client window and other\n * future states which follow a similar pattern\n */\nexport class StateHolder implements IdValueHolder {\n\n nameSpace: string;\n\n constructor(public id: string, public value: string) {\n let viewStatePos = id.indexOf(P_VIEWSTATE);\n this.nameSpace = viewStatePos > 0 ? id.substr(0, viewStatePos - 1) : EMPTY_STR;\n }\n\n get hasNameSpace(): boolean {\n return !!(this?.nameSpace ?? EMPTY_STR).length;\n }\n}\n","/*! Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport class Messages {\n MSG_TEST = \"Testmessage\";\n\n /*Messages*/\n /** @constant */\n MSG_DEV_MODE = \"Note, this message is only sent, because project stage is development and no \" +\n \"other error listeners are registered.\";\n /** @constant */\n MSG_AFFECTED_CLASS = \"Affected Class=\";\n /** @constant */\n MSG_AFFECTED_METHOD = \"Affected Method=\";\n /** @constant */\n MSG_ERROR_NAME = \"Error Name=\";\n /** @constant */\n MSG_ERROR_MESSAGE = \"Error Message=\";\n /** @constant */\n MSG_SERVER_ERROR_NAME = \"Server Error Name=\";\n\n /** @constant */\n MSG_ERROR_DESC = \"Error Description=\";\n /** @constant */\n MSG_ERROR_NO = \"Error Number=\";\n /** @constant */\n MSG_ERROR_LINENO = \"Error Line Number=\";\n\n /*Errors and messages*/\n /** @constant */\n ERR_FORM = \"Sourceform could not be determined, either because element is not attached to a form or we have multiple forms with named elements of the same identifier or name, stopping the ajax processing\";\n /** @constant */\n ERR_VIEWSTATE = \"faces.viewState= param value not of type form!\";\n /** @constant */\n ERR_TRANSPORT = \"Transport type {0} does not exist\";\n /** @constant */\n ERR_EVT_PASS = \"an event must be passed down (either a an event object null or undefined) \";\n /** @constant */\n ERR_CONSTRUCT = \"Parts of the response couldn't be retrieved when constructing the event data= {0} \";\n /** @constant */\n ERR_MALFORMEDXML = \"The server response could not be parsed, the server has returned with a response which is not xml !\";\n /** @constant */\n ERR_SOURCE_FUNC = \"source cannot be a function (probably source and event were not defined or set to null\";\n /** @constant */\n ERR_EV_OR_UNKNOWN = \"An event object or unknown must be passed as second parameter\";\n /** @constant */\n ERR_SOURCE_NOSTR = \"source cannot be a string\";\n /** @constant */\n ERR_SOURCE_DEF_NULL = \"source must be defined or null\";\n\n //_Lang.js\n /** @constant */\n ERR_MUST_STRING = \"{0}: {1} namespace must be of type String\";\n /** @constant */\n ERR_REF_OR_ID = \"{0}: {1} a reference node or identifier must be provided\";\n /** @constant */\n ERR_PARAM_GENERIC = \"{0}: parameter {1} must be of type {2}\";\n /** @constant */\n ERR_PARAM_STR = \"{0}: {1} param must be of type string\";\n /** @constant */\n ERR_PARAM_STR_RE = \"{0}: {1} param must be of type string or a regular expression\";\n /** @constant */\n ERR_PARAM_MIXMAPS = \"{0}: both a source as well as a destination map must be provided\";\n /** @constant */\n ERR_MUST_BE_PROVIDED = \"{0}: an {1} and a {2} must be provided\";\n /** @constant */\n ERR_MUST_BE_PROVIDED1 = \"{0}: {1} must be set\";\n\n /** @constant */\n ERR_REPLACE_EL = \"replaceElements called while evalNodes is not an array\";\n\n /** @constant */\n ERR_EMPTY_RESPONSE = \"{0}: The response cannot be null or empty!\";\n /** @constant */\n ERR_ITEM_ID_NOTFOUND = \"{0}: item with identifier {1} could not be found\";\n /** @constant */\n ERR_PPR_IDREQ = \"{0}: Error in PPR Insert, id must be present\";\n /** @constant */\n ERR_PPR_INSERTBEFID = \"{0}: Error in PPR Insert, before id or after id must be present\";\n /** @constant */\n ERR_PPR_INSERTBEFID_1 = \"{0}: Error in PPR Insert, before node of id {1} does not exist in document\";\n /** @constant */\n ERR_PPR_INSERTBEFID_2 = \"{0}: Error in PPR Insert, after node of id {1} does not exist in document\";\n\n /** @constant */\n ERR_PPR_DELID = \"{0}: Error in delete, id not in xml markup\";\n /** @constant */\n ERR_PPR_UNKNOWNCID = \"{0}: Unknown Html-Component-ID= {1}\";\n\n /** @constant */\n ERR_NO_VIEWROOTATTR = \"{0}: Changing of ViewRoot attributes is not supported\";\n /** @constant */\n ERR_NO_HEADATTR = \"{0}: Changing of Head attributes is not supported\";\n /** @constant */\n ERR_RED_URL = \"{0}: Redirect without url\";\n\n /** @constant */\n ERR_REQ_FAILED_UNKNOWN = \"Request failed with unknown status\";\n\n /** @constant */\n ERR_REQU_FAILED = \"Request failed with status {0} and reason {1}\";\n\n /** @constant */\n UNKNOWN = \"UNKNOWN\";\n}","/*! Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {Config, Lang, XMLQuery} from \"mona-dish\";\n\nimport {DQ} from \"mona-dish\";\nimport {ExtLang} from \"./Lang\";\nimport getMessage = ExtLang.getMessage;\nimport makeException = ExtLang.makeException;\nimport {\n ATTR_URL,\n EMPTY_RESPONSE,\n EMPTY_STR, ERR_NO_PARTIAL_RESPONSE, MALFORMEDXML,\n ON_ERROR,\n ON_EVENT,\n PHASE_PROCESS_RESPONSE,\n RESP_PARTIAL\n} from \"../core/Const\";\n\n/**\n * a set of internal code assertions\n * which raise an error\n *\n */\nexport module Assertions {\n\n export function assertRequestIntegrity(options: Config, elem: DQ): void | never {\n /*assert if the onerror is set and once if it is set it must be of type function*/\n assertFunction(options.getIf(ON_ERROR).value);\n /*assert if the onevent is set and once if it is set it must be of type function*/\n assertFunction(options.getIf(ON_EVENT).value);\n //improve the error messages if an empty elem is passed\n //Assertions.assertElementExists(elem);\n assert(elem.isPresent(), getMessage(\"ERR_MUST_BE_PROVIDED1\", \"{0}: source must be provided or exist\", \"source element id\"), \"faces.ajax.request\", \"ArgNotSet\", )\n }\n\n export function assertUrlExists(node: XMLQuery): void | never {\n if (node.attr(ATTR_URL).isAbsent()) {\n throw Assertions.raiseError(new Error(), getMessage(\"ERR_RED_URL\", null, \"_Ajaxthis.processRedirect\"), \"processRedirect\");\n }\n }\n\n /**\n * checks the xml for various issues which can occur\n * and prevent a proper processing\n */\n export function assertValidXMLResponse(responseXML: XMLQuery) : void | never {\n assert(!responseXML.isAbsent(), EMPTY_RESPONSE, PHASE_PROCESS_RESPONSE);\n assert(!responseXML.isXMLParserError(), responseXML.parserErrorText(EMPTY_STR), PHASE_PROCESS_RESPONSE);\n assert(responseXML.querySelectorAll(RESP_PARTIAL).isPresent(), ERR_NO_PARTIAL_RESPONSE, PHASE_PROCESS_RESPONSE);\n }\n\n /**\n * internal helper which raises an error in the\n * format we need for further processing\n *\n * @param error\n * @param message the message\n * @param caller\n * @param title the title of the error (optional)\n * @param name the name of the error (optional)\n */\n export function raiseError(error: any, message: string, caller ?: string, title ?: string, name ?: string): Error {\n\n let finalTitle = title ?? MALFORMEDXML;\n let finalName = name ?? MALFORMEDXML;\n let finalMessage = message ?? EMPTY_STR;\n\n //TODO clean up the messy makeException, this is a perfect case for encapsulation and sane defaults\n return makeException(error, finalTitle, finalName, \"Response\", caller || (((<any>arguments).caller) ? (<any>arguments).caller.toString() : \"_raiseError\"), finalMessage);\n }\n\n /*\n * using the new typescript 3.7 compiler assertion functionality to improve compiler hinting\n * we are not fully there yet, but soon\n */\n\n export function assert(value: any, msg = EMPTY_STR, caller=EMPTY_STR, title=\"Assertion Error\"): asserts value {\n if(!value) {\n throw Assertions.raiseError(new Error(), msg ,caller, title);\n }\n }\n\n\n export function assertType(value: any, theType: any, msg = EMPTY_STR, caller=EMPTY_STR, title=\"Type Assertion Error\"): asserts value {\n if((!!value) && !Lang.assertType(value,theType)) {\n throw Assertions.raiseError(new Error(), msg ,caller, title);\n }\n }\n\n export function assertFunction(value: any, msg = EMPTY_STR, caller=EMPTY_STR, title=\"Assertion Error\"): asserts value is Function {\n assertType(value, \"function\", msg, caller, title);\n }\n}\n\n\n","/*! Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {AsyncRunnable} from \"./AsyncRunnable\";\n\n/**\n * Asynchronous queue which starts to work\n * through the callbacks until the queue is empty\n *\n * Every callback must be of async runnable\n * which is sort of an extended promise which has\n * added a dedicated cancel and start point\n *\n * This interface can be used as wrapper contract\n * for normal promises if needed.\n */\nexport class AsynchronousQueue<T extends AsyncRunnable<any>> {\n\n private runnableQueue = [];\n private delayTimeout: null | ReturnType<typeof setTimeout>;\n\n currentlyRunning: AsyncRunnable<any>;\n\n constructor() {\n }\n\n /**\n * simple is empty accessor, returns true if queue is empty atm\n */\n get isEmpty(): boolean {\n return !this.runnableQueue.length;\n }\n\n /**\n * enqueues an element and starts the\n * asynchronous work loop if not already running\n *\n * @param element the element to be queued and processed\n * @param delay possible delay after our usual process or drop if something newer is incoming algorithm\n */\n enqueue(element: T, delay = 0) {\n if (this.delayTimeout) {\n clearTimeout(this.delayTimeout);\n this.delayTimeout = null;\n }\n if (delay) {\n this.delayTimeout = setTimeout(() => {\n this.appendElement(element);\n });\n } else {\n this.appendElement(element);\n }\n }\n\n /**\n * fetches the next element from the queue (first in first out order)\n */\n dequeue(): T | undefined{\n return this.runnableQueue.shift();\n }\n\n /**\n * clears up all elements from the queue\n */\n cleanup() {\n this.currentlyRunning = null;\n this.runnableQueue.length = 0;\n }\n\n /**\n * cancels the currently running element and then cleans up the queue\n * aka cancel the queue entirely\n */\n cancel() {\n try {\n if (this.currentlyRunning) {\n this.currentlyRunning.cancel();\n }\n } finally {\n this.cleanup();\n }\n }\n\n private callForNextElementToProcess() {\n this.runEntry();\n }\n\n private appendElement(element: T) {\n //only if the first element is added we start with a trigger\n //otherwise a process already is running and not finished yet at that\n //time\n this.runnableQueue.push(element);\n if (!this.currentlyRunning) {\n this.runEntry();\n }\n }\n\n private runEntry() {\n if (this.isEmpty) {\n this.currentlyRunning = null;\n return;\n }\n this.currentlyRunning = this.dequeue();\n this.currentlyRunning\n .catch((e) => {\n //in case of an error we always clean up the remaining calls\n //to allow a clean recovery of the application\n this.cleanup();\n throw e;\n })\n .then(\n //the idea is to trigger the next over an event to reduce\n //the number of recursive calls (stacks might be limited\n //compared to ram)\n //naturally give we have a DOM, the DOM is the natural event dispatch system\n //which we can use, to decouple the calls from a recursive stack call\n //(the browser engine will take care of that)\n () => this.callForNextElementToProcess()\n ).start();\n }\n}","/*! Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {Config, IValueHolder, Optional, DomQuery, DQ, Stream, ArrayCollector} from \"mona-dish\";\nimport {$nsp, P_WINDOW_ID} from \"../core/Const\";\n\n\n/**\n * detects whether a source is a faces.js request\n *\n * @param source the source string for the faces.js request\n * @return true if a faces.js loading pattern is detected\n * @constructor\n */\nconst IS_FACES_SOURCE = (source?: string): boolean => {\n //spec version smaller 4 we have to deal with the jsf namespace\n\n return source && !!(source?.search(/\\/jakarta\\.faces\\.resource.*\\/faces\\.js.*/) != -1 ||\n source?.search(/\\/faces-development\\.js.*/) != -1 ||\n source?.search(/\\/faces-uncompressed\\.js.*/) != -1 ||\n source?.search(/\\/faces[^.]*\\.js.*ln=jakarta.faces.*/gi) != -1 ||\n //fallback without check for jsf, that way we allow both bookmarks\n source?.search(/\\/javax\\.faces\\.resource.*\\/jsf\\.js.*/) != -1 ||\n source?.search(/\\/jsf-development\\.js.*/) != -1 ||\n source?.search(/\\/jsf-uncompressed\\.js.*/) != -1 ||\n source?.search(/\\/jsf[^.]*\\.js.*ln=javax.faces.*/gi) != -1);\n}\n\n/**\n * namespace myfaces.testscripts can be used as extension point for internal\n * tests, those will be handled similarly to faces.js - regarding\n * reload blocking on ajax requests\n *\n * @param source the source to check\n * @constructor\n */\nconst IS_INTERNAL_SOURCE = (source: string): boolean => {\n return source.search(/\\/faces[^.]*\\.js.*ln=myfaces.testscripts.*/gi) != -1 || source.search(/\\/jsf[^.]*\\.js.*ln=myfaces.testscripts.*/gi) != -1;\n}\n\n\nconst ATTR_SRC = 'src';\n\n/**\n * Extension which adds implementation specific\n * meta data to our dom query\n *\n * Usage\n * el = new ExtDQ(oldReference)\n * nonce = el.nonce\n * windowId = el.getWindowId\n */\nexport class ExtDomquery extends DQ {\n\n static get windowId() {\n return new ExtDomquery(document.body).windowId;\n }\n\n static get nonce(): string {\n return new ExtDomquery(document.body).nonce;\n }\n\n get windowId(): string | null {\n\n const fetchWindowIdFromURL = function (): string | null {\n let href = window.location.href;\n let windowId = \"windowId\";\n let regex = new RegExp(\"[\\\\?&]\" + windowId + \"=([^&#\\\\;]*)\");\n let results = regex.exec(href);\n //initial trial over the url and a regexp\n if (results != null) return results[1];\n return null;\n };\n\n //byId ($)\n if (this.value.isPresent()) {\n let result = this.querySelectorAll(\"form input[name='\" + P_WINDOW_ID + \"']\");\n if (result.length > 1) {\n throw Error(\"Multiple different windowIds found in document\");\n }\n\n return (result.isPresent()) ? (<HTMLInputElement>result.getAsElem(0).value).value : fetchWindowIdFromURL();\n } else {\n return fetchWindowIdFromURL();\n }\n }\n\n /*\n * determines the faces.js nonce and adds them to the namespace\n * this is done once and only lazily\n */\n get nonce(): string | null {\n //already processed\n let myfacesConfig = new ExtConfig(window.myfaces);\n let nonce: IValueHolder<string> = myfacesConfig.getIf(\"config\", \"cspMeta\", \"nonce\");\n if (nonce.value) {\n return <string>nonce.value;\n }\n\n let curScript = new DQ(document.currentScript);\n //since our baseline atm is ie11 we cannot use document.currentScript globally\n if (!!this.extractNonce(curScript)) {\n // fastpath for modern browsers\n return this.extractNonce(curScript);\n }\n // fallback if the currentScript method fails, we just search the jsf tags for nonce, this is\n // the last possibility\n let nonceScript = DQ\n .querySelectorAll(\"script[src], link[src]\")\n .lazyStream\n .filter((item) => this.extractNonce(item) && item.attr(ATTR_SRC) != null)\n .filter(item => IS_FACES_SOURCE(item.attr(ATTR_SRC).value))\n .first();\n\n if (nonceScript.isPresent()) {\n return this.extractNonce(nonceScript.value);\n }\n return null;\n }\n\n\n\n private extractNonce(curScript: DomQuery) {\n return (curScript.getAsElem(0).value as HTMLElement)?.nonce ?? curScript.attr(\"nonce\").value;\n }\n\n static searchJsfJsFor(item: RegExp): Optional<String> {\n return new ExtDomquery(document).searchJsfJsFor(item);\n }\n\n /**\n * searches the embedded faces.js for items like separator char etc..\n * expects a match as variable under position 1 in the result match\n * @param rexp\n */\n searchJsfJsFor(rexp: RegExp): Optional<string> {\n //perfect application for lazy stream\n return DQ.querySelectorAll(\"script[src], link[src]\").lazyStream\n .filter(item => IS_FACES_SOURCE(item.attr(ATTR_SRC).value))\n .map(item => item.attr(ATTR_SRC).value.match(rexp))\n .filter(item => item != null && item.length > 1)\n .map((result: string[]) => {\n return decodeURIComponent(result[1]);\n }).first();\n }\n\n globalEval(code: string, nonce ?: string): DQ {\n return new ExtDomquery(super.globalEval(code, nonce ?? this.nonce));\n }\n\n globalEvalSticky(code: string, nonce ?: string): DQ {\n return new ExtDomquery(super.globalEvalSticky(code, nonce ?? this.nonce));\n }\n\n /**\n * decorated run scripts which takes our jsf extensions into consideration\n * (standard DomQuery will let you pass anything)\n * @param sticky if set to true the internally generated element for the script is left in the dom\n * @param whilteListed\n */\n runScripts(sticky = false, whilteListed?: (src: string) => boolean): DomQuery {\n const whitelistFunc = (src: string): boolean => {\n return (whilteListed?.(src) ?? true) && !IS_FACES_SOURCE(src) && !IS_INTERNAL_SOURCE(src);\n };\n return super.runScripts(sticky, whitelistFunc);\n }\n\n /**\n * adds the elements in this ExtDomQuery to the head\n *\n * @param suppressDoubleIncludes checks for existing elements in the head before running the insert\n */\n runHeadInserts(suppressDoubleIncludes = true): void {\n let head = ExtDomquery.byId(document.head);\n //automated nonce handling\n let processedScripts = [];\n\n // the idea is only to run head inserts on resources\n // which do not exist already, that way\n // we can avoid double includes on subsequent resource\n // requests.\n function resourceIsNew(element: DomQuery) {\n if(!suppressDoubleIncludes) {\n return true;\n }\n const tagName = element.tagName.value;\n if(!tagName) {\n // textnode\n return true;\n }\n let reference = element.attr(\"href\")\n .orElse(element.attr(\"src\").value)\n .orElse(element.attr(\"rel\").value);\n\n if (!reference.isPresent()) {\n return true;\n }\n return !head.querySelectorAll(`${tagName}[href='${reference.value}']`).length &&\n !head.querySelectorAll(`${tagName}[src='${reference.value}']`).length &&\n !head.querySelectorAll(`${tagName}[rel='${reference.value}']`).length;\n }\n\n this\n .filter(resourceIsNew)\n .each(element => {\n if(element.tagName.value != \"SCRIPT\") {\n //we need to run runScripts properly to deal with the rest\n new ExtDomquery(...processedScripts).runScripts(true);\n processedScripts = [];\n head.append(element);\n } else {\n processedScripts.push(element);\n }\n });\n new ExtDomquery(...processedScripts).runScripts(true);\n }\n\n\n /**\n * byId producer\n *\n * @param selector id\n * @param deep whether the search should go into embedded shadow dom elements\n * @return a DomQuery containing the found elements\n */\n static byId(selector: string | DomQuery | Element, deep = false): DomQuery {\n const ret = DomQuery.byId(selector, deep);\n return new ExtDomquery(ret);\n }\n\n\n}\n\nexport const ExtDQ = ExtDomquery;\n\n/**\n * in order to reduce the number of interception points for the fallbacks we add\n * the namespace remapping straight to our config accessors\n */\nexport class ExtConfig extends Config {\n\n constructor(root: any) {\n super(root);\n }\n\n assignIf(condition: boolean, ...accessPath): IValueHolder<any> {\n const acessPathMapped = this.remap(accessPath);\n return super.assignIf(condition, ...acessPathMapped);\n }\n\n assign(...accessPath): IValueHolder<any> {\n const acessPathMapped = this.remap(accessPath);\n return super.assign(...acessPathMapped);\n }\n\n append(...accessPath): IValueHolder<any> {\n return super.append(...accessPath);\n }\n\n appendIf(condition: boolean, ...accessPath): IValueHolder<any> {\n const acessPathMapped = this.remap(accessPath);\n return super.appendIf(condition, ...acessPathMapped);\n }\n\n getIf(...accessPath): Config {\n const acessPathMapped = this.remap(accessPath);\n return super.getIf(...acessPathMapped);\n }\n\n get(defaultVal: any): Config {\n return super.get($nsp(defaultVal));\n }\n\n delete(key: string): Config {\n return super.delete($nsp(key));\n }\n\n /**\n * creates a config from an initial value or null\n * @param value\n */\n static fromNullable<T>(value?: T | null): Config {\n return new ExtConfig(value);\n }\n\n protected getClass(): any {\n return ExtConfig;\n }\n\n /**\n * shallow copy getter, copies only the first level, references the deeper nodes\n * in a shared manner\n */\n protected shallowCopy$(): Config {\n const ret = super.shallowCopy$();\n return new ExtConfig(ret);\n }\n\n /**\n * deep copy, copies all config nodes\n */\n get deepCopy(): Config {\n return new ExtConfig(super.deepCopy$());\n }\n\n\n private remap(accessPath: any[]) {\n return Stream.of(...accessPath).map(key => $nsp(key)).collect(new ArrayCollector());\n }\n\n\n}","/*! Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * todo replace singleton with module definition\n *\n */\n\nimport {Lang as LangBase, Config, Optional, DomQuery, DQ, Stream} from \"mona-dish\";\nimport {Messages} from \"../i18n/Messages\";\nimport {EMPTY_STR, TAG_FORM} from \"../core/Const\";\nimport {getEventTarget} from \"../xhrCore/RequestDataResolver\";\n\n\nexport module ExtLang {\n\n let installedLocale: Messages;\n let nameSpace = \"impl/util/Lang/\";\n\n export function getLanguage(): string {\n //TODO global config override\n\n let language: string = (<any>navigator).languages?.[0] ?? navigator?.language;\n language = language.split(\"-\")[0];\n return language;\n }\n\n //should be in lang, but for now here to avoid recursive imports, not sure if typescript still has a problem with those\n /**\n * helper function to savely resolve anything\n * this is not an elvis operator, it resolves\n * a value without exception in a tree and if\n * it is not resolvable then an optional of\n * a default value is restored or Optional.empty\n * if none is given\n *\n * usage\n * <code>\n * let var: Optional<string> = saveResolve(() => a.b.c.d.e, \"foobaz\")\n * </code>\n *\n * @param resolverProducer a lambda which can produce the value\n * @param defaultValue an optional default value if the producer failes to produce anything\n * @returns an Optional of the produced value\n */\n export function failSaveResolve<T>(resolverProducer: () => T, defaultValue: T = null): Optional<T> {\n return LangBase.saveResolve(resolverProducer, defaultValue);\n }\n\n /**\n * under some conditions it makes sense to swallow errors and return a default value in the error case\n * classical example the optional resolution of values in a chain (thankfully now covered by Typescript itself)\n * another example which we have in our system is that some operations fail only under test due to test framework\n * limitations while they cannot fail in the real world.\n *\n * @param resolverProducer a producer function which produces a value in the non error case\n * @param defaultValue the default value in case of a fail of the function\n */\n export function failSaveExecute<T>(resolverProducer: () => any, defaultValue: T = null): void {\n LangBase.saveResolve(resolverProducer, defaultValue);\n }\n\n /**\n * returns a given localized message upon a given key\n * basic java log like templating functionality is included\n *\n * @param {String} key the key for the message\n * @param {String} defaultMessage optional default message if none was found\n *\n * Additionally you can pass additional arguments, which are used\n * in the same way java log templates use the params\n *\n * @param templateParams the param list to be filled in\n */\n export function getMessage(key: string, defaultMessage?: string, ...templateParams: Array<string>): string {\n installedLocale = installedLocale ?? new Messages();\n\n let msg = installedLocale[key] ?? defaultMessage ?? key;\n\n Stream.of(...templateParams).each((param, cnt) => {\n msg = msg.replace(new RegExp([\"\\\\{\", cnt, \"\\\\}\"].join(EMPTY_STR), \"g\"), param);\n });\n\n return msg;\n }\n\n /**\n * transforms a key value pair into a string\n * @param key the key\n * @param val the value\n * @param delimiter the delimiter\n */\n export function keyValToStr(key: string, val: string, delimiter: string = \"\\n\") {\n return [key, val].join(delimiter);\n }\n\n /**\n * creates an exeption with additional internal parameters\n * for extra information\n *\n * @param error\n * @param {String} title the exception title\n * @param {String} name the exception name\n * @param {String} callerCls the caller class\n * @param {String} callFunc the caller function\n * @param {String} message the message for the exception\n */\n export function makeException(error: Error, title: string, name: string, callerCls: string, callFunc: string, message: string): Error {\n\n return new Error(message + (callerCls ?? nameSpace) + callFunc ?? (EMPTY_STR + (<any>arguments).caller.toString()));\n\n }\n\n /**\n * fetches a global config entry\n * @param {String} configName the name of the configuration entry\n * @param {Object} defaultValue\n *\n * @return either the config entry or if none is given the default value\n */\n export function getGlobalConfig(configName: string, defaultValue: any): any {\n /**\n * note we could use exists but this is an heavy operation, since the config name usually\n * given this function here is called very often\n * is a single entry without . in between we can do the lighter shortcut\n */\n return window?.myfaces?.config?.[configName] ?? defaultValue;\n }\n\n /**\n * fetches the form in an fuzzy manner depending\n * on an element or event target.\n *\n * The idea is that according to the jsf spec\n * the enclosing form of the issuing element needs to be fetched.\n *\n * This is fine, but since then html5 came into the picture with the form attribute the element\n * can be anywhere referencing its parent form.\n *\n * Also theoretically you can have the case of an issuing element enclosing a set of forms\n * (not really often used, but theoretically it could be input button allows to embed html for instance)\n *\n * So the idea is not to limit the issuing form determination to the spec case\n * but also cover the theoretical and html5 corner case.\n *\n * @param elem\n * @param event\n */\n export function getForm(elem: Element, event ?: Event): DQ | never {\n\n let queryElem = new DQ(elem);\n let eventTarget = new DQ(getEventTarget(event));\n\n if (queryElem.isTag(TAG_FORM)) {\n return queryElem;\n }\n\n //html 5 for handling\n if (queryElem.attr(TAG_FORM).isPresent()) {\n let formId = queryElem.attr(TAG_FORM).value;\n let foundForm = DQ.byId(formId, true);\n if (foundForm.isPresent()) {\n return foundForm;\n }\n }\n\n let form = queryElem.parents(TAG_FORM)\n .orElseLazy(() => queryElem.byTagName(TAG_FORM, true))\n .orElseLazy(() => eventTarget.parents(TAG_FORM))\n .orElseLazy(() => eventTarget.byTagName(TAG_FORM))\n .first();\n\n assertFormExists(form);\n\n return form;\n }\n\n /**\n * gets the local or global options with local ones having higher priority\n * if no local or global one was found then the default value is given back\n *\n * @param {String} configName the name of the configuration entry\n * @param {String} localOptions the local options root for the configuration myfaces as default marker is added implicitely\n *\n * @param {Object} defaultValue\n *\n * @return either the config entry or if none is given the default value\n */\n export function getLocalOrGlobalConfig(localOptions: Config, configName: string, defaultValue: any): any {\n return localOptions.value?.myfaces?.config?.[configName] ??\n window?.myfaces?.config?.[configName] ??\n defaultValue;\n }\n\n /**\n * assert that the form exists and throw an exception in the case it does not\n *\n * @param form the form to check for\n */\n function assertFormExists(form: DomQuery): void | never {\n if (form.isAbsent()) {\n throw makeException(new Error(), null, null, \"Impl\", \"getForm\", getMessage(\"ERR_FORM\"));\n }\n }\n}","/*! Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n EMPTY_STR,\n ERROR_MESSAGE,\n ERROR_NAME,\n RESPONSE_TEXT,\n RESPONSE_XML,\n SOURCE,\n STATUS,\n UNKNOWN\n} from \"../core/Const\";\nimport {Config} from \"mona-dish\";\n\nimport {EventData} from \"./EventData\";\nimport {ExtLang} from \"../util/Lang\";\nimport getMessage = ExtLang.getMessage;\n\n\nexport enum ErrorType {\n SERVER_ERROR = \"serverError\",\n HTTP_ERROR = \"httpError\",\n CLIENT_ERROR = \"clientErrror\",\n TIMEOUT = \"timeout\"\n}\n\n/**\n * the spec has a problem of having the error\n * object somewhat underspecified, there is no clear\n * description of the required contents.\n * I want to streamline it with mojarra here\n * hence we are going to move\n * everything into the same attributes,\n * I will add deprecated myfaces backwards compatibility attributes as well\n */\nexport class ErrorData extends EventData implements IErrorData {\n\n type: string = \"error\";\n source: string;\n errorName: string;\n errorMessage: string;\n\n responseText: string;\n responseXML: any;\n\n status: string;\n typeDetails: ErrorType;\n\n serverErrorName: string;\n serverErrorMessage: string;\n message: string;\n\n constructor(source: string, errorName: string, errorMessage: string, responseText: string = null, responseXML: any = null, responseCode: string = \"200\", status: string = \"UNKNOWN\", type = ErrorType.CLIENT_ERROR) {\n super();\n this.source = source;\n this.type = \"error\";\n this.errorName = errorName;\n this.message = this.errorMessage = errorMessage;\n this.responseCode = responseCode;\n this.responseText = responseText;\n this.status = status;\n this.typeDetails = type;\n\n if (type == ErrorType.SERVER_ERROR) {\n this.serverErrorName = this.errorName;\n this.serverErrorMessage = this.errorMessage;\n }\n }\n\n static fromClient(e: Error): ErrorData {\n return new ErrorData(\"client\", e?.name ?? '', e?.message ?? '', e?.stack ?? '');\n }\n\n static fromHttpConnection(source: any, name: string, message: string, responseText, responseCode: number, status: string = 'UNKNOWN'): ErrorData {\n return new ErrorData(source, name, message, responseText, responseCode, `${responseCode}`, status, ErrorType.HTTP_ERROR);\n }\n\n static fromGeneric(context: Config, errorCode: number, errorType: ErrorType = ErrorType.SERVER_ERROR): ErrorData {\n\n let getMsg = this.getMsg;\n\n let source = getMsg(context, SOURCE);\n let errorName = getMsg(context, ERROR_NAME);\n let errorMessage = getMsg(context, ERROR_MESSAGE);\n let status = getMsg(context, STATUS);\n let responseText = getMsg(context, RESPONSE_TEXT);\n let responseXML = getMsg(context, RESPONSE_XML);\n return new ErrorData(source, errorName, errorMessage, responseText, responseXML, errorCode + EMPTY_STR, status, errorType);\n }\n\n private static getMsg(context, param) {\n return getMessage(context.getIf(param).orElse(UNKNOWN).value);\n }\n\n static fromServerError(context: Config): ErrorData {\n return this.fromGeneric(context, -1);\n }\n\n}","/*! Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {Config, DQ} from \"mona-dish\";\nimport {BEGIN, CTX_PARAM_PASS_THR, EVENT, P_PARTIAL_SOURCE, SOURCE} from \"../core/Const\";\n\nexport class EventData implements IEventData{\n type: string;\n status: string;\n source: any;\n responseCode: string;\n responseText: string;\n responseXML: Document;\n\n static createFromRequest(request: XMLHttpRequest, context: Config, /*event name*/ name: string): EventData {\n\n let eventData = new EventData();\n\n eventData.type = EVENT;\n eventData.status = name;\n\n let sourceId: string = context.getIf(SOURCE)\n .orElseLazy(() => context.getIf(P_PARTIAL_SOURCE).value)\n .orElseLazy(() => context.getIf(CTX_PARAM_PASS_THR, P_PARTIAL_SOURCE).value)\n .value;\n if (sourceId) {\n eventData.source = DQ.byId(sourceId, true).first().value.value;\n }\n\n if (name !== BEGIN) {\n eventData.responseCode = request?.status?.toString();\n eventData.responseText = request?.responseText;\n eventData.responseXML = request?.responseXML;\n }\n return eventData;\n }\n}\n","/*! Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Config, DomQuery, DQ} from \"mona-dish\";\nimport {\n CTX_PARAM_DELAY,\n CTX_PARAM_TIMEOUT,\n EMPTY_FUNC,\n EMPTY_STR,\n ENCODED_URL,\n MF_NONE,\n REQ_TYPE_GET,\n REQ_TYPE_POST\n} from \"../core/Const\";\nimport {XhrFormData} from \"./XhrFormData\";\nimport {ExtLang} from \"../util/Lang\";\nimport {ExtConfig, ExtDomquery} from \"../util/ExtDomQuery\";\n\n/**\n * Resolver functions for various aspects of the request data\n *\n * stateless because it might be called from various\n * parts of the response classes\n */\n\n/**\n * resolves the event handlers lazly\n * so that if some decoration happens in between we can deal with it\n *\n * @param requestContext\n * @param responseContext\n * @param funcName\n */\nexport function resolveHandlerFunc(requestContext: Config, responseContext: Config, funcName: string) {\n return responseContext.getIf(funcName)\n .orElseLazy(() =>requestContext.getIf(funcName).value)\n .orElse(EMPTY_FUNC).value;\n}\n\nexport function resolveTargetUrl(srcFormElement: HTMLFormElement) {\n return (typeof srcFormElement.elements[ENCODED_URL] == 'undefined') ?\n srcFormElement.action :\n srcFormElement.elements[ENCODED_URL].value;\n}\n\nexport function resolveFinalUrl(sourceForm: DomQuery, formData: XhrFormData, ajaxType = REQ_TYPE_POST) {\n let targetUrl = resolveTargetUrl(<HTMLFormElement>sourceForm.getAsElem(0).value);\n\n return targetUrl + (ajaxType == REQ_TYPE_GET ? \"?\" + formData.toString() : EMPTY_STR);\n}\n\n/**\n * form resolution the same way our old implementation did\n * it is either the id or the parent form of the element or an embedded form\n * of the element\n *\n * @param requestCtx\n * @param elem\n * @param event\n */\nexport function resolveForm(requestCtx: Config, elem: DQ, event: Event): DQ {\n const configId = requestCtx.value?.myfaces?.form ?? MF_NONE;\n return DQ\n .byId(configId, true)\n .orElseLazy(() => ExtLang.getForm(elem.getAsElem(0).value, event));\n}\n\nexport function resolveTimeout(options: Config): number {\n let getCfg = ExtLang.getLocalOrGlobalConfig;\n return options.getIf(CTX_PARAM_TIMEOUT).value ?? getCfg(options.value, CTX_PARAM_TIMEOUT, 0);\n}\n\n/**\n * resolve the delay from the options and/or the request context and or the configuration\n *\n * @param options ... the options object, in most cases it will host the delay value\n */\nexport function resolveDelay(options: Config): number {\n let getCfg = ExtLang.getLocalOrGlobalConfig;\n\n return options.getIf(CTX_PARAM_DELAY).value ?? getCfg(options.value, CTX_PARAM_DELAY, 0);\n}\n\n/**\n * resolves the window Id from various sources\n *\n * @param options\n */\nexport function resolveWindowId(options: Config) {\n return options?.value?.windowId ?? ExtDomquery.windowId;\n}\n\n/**\n * cross port from the dojo lib\n * browser save event resolution\n * @param evt the event object\n * (with a fallback for ie events if none is present)\n */\nexport function getEventTarget(evt: Event): Element {\n //ie6 and 7 fallback\n let finalEvent = evt;\n /**\n * evt source is defined in the jsf events\n * seems like some component authors use our code\n * so we add it here see also\n * https://issues.apache.org/jira/browse/MYFACES-2458\n * not entirely a bug but makes sense to add this\n * behavior. I dont use it that way but nevertheless it\n * does not break anything so why not\n * */\n let t = finalEvent?.srcElement ?? finalEvent?.target ?? (<any>finalEvent)?.source;\n while ((t) && (t.nodeType != 1)) {\n t = t.parentNode;\n }\n return t;\n}\n\n/**\n * resolves a bunch of default values\n * which can be further processed from the given\n * call parameters of faces.ajax.request\n *\n * @param event\n * @param opts\n * @param el\n */\nexport function resolveDefaults(event: Event, opts: any = {}, el: Element | string = null) {\n //deep copy the options, so that further transformations to not backfire into the callers\n const resolvedEvent = event,\n options = new ExtConfig(opts).deepCopy,\n elem = DQ.byId(el || <Element>resolvedEvent.target, true),\n elementId = elem.id.value, requestCtx = new ExtConfig({}),\n internalCtx = new ExtConfig({}), windowId = resolveWindowId(options),\n isResetValues = true === options.value?.resetValues;\n\n return {resolvedEvent, options, elem, elementId, requestCtx, internalCtx, windowId, isResetValues};\n}","/*! Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Config, Optional, XMLQuery} from \"mona-dish\";\n\nimport {Assertions} from \"../util/Assertions\";\nimport {DQ} from \"mona-dish\";\nimport {\n $nsp,\n CTX_PARAM_MF_INTERNAL,\n CTX_PARAM_SRC_CTL_ID,\n CTX_PARAM_SRC_FRM_ID,\n SEL_RESPONSE_XML,\n SOURCE,\n TAG_FORM,\n UPDATE_ELEMS,\n UPDATE_FORMS,\n DEFERRED_HEAD_INSERTS\n} from \"../core/Const\";\nimport {ExtConfig} from \"../util/ExtDomQuery\";\n\n/**\n * Resolver functions for various aspects of the response data\n *\n * stateless because it might be called from various\n * parts of the response classes\n */\n\n/**\n * fetches the response XML\n * as XML Query object\n *\n * @param request the request hosting the responseXML\n *\n * Throws an error in case of non existent or wrong xml data\n *\n */\nexport function resolveResponseXML(request: Config): XMLQuery {\n let ret = new XMLQuery($nsp(request.getIf(SEL_RESPONSE_XML).value));\n Assertions.assertValidXMLResponse(ret);\n\n return ret;\n}\n\n/**\n * Splits the incoming passthrough context apart\n * in an internal and an external nomalized context\n * the internal one is just for our internal processing\n *\n * @param context the root context as associative array\n */\nexport function resolveContexts(context: { [p: string]: any }): any {\n /**\n * we split the context apart into the external one and\n * some internal values\n */\n let externalContext = ExtConfig.fromNullable(context);\n let internalContext = externalContext.getIf(CTX_PARAM_MF_INTERNAL);\n if (!internalContext.isPresent()) {\n internalContext = ExtConfig.fromNullable({});\n }\n\n /**\n * prepare storage for some deferred operations\n */\n internalContext.assign(DEFERRED_HEAD_INSERTS).value = [];\n internalContext.assign(UPDATE_FORMS).value = [];\n internalContext.assign(UPDATE_ELEMS).value = [];\n return {externalContext, internalContext};\n}\n\n/**\n * fetches the source element out of our conexts\n *\n * @param context the external context which shpuld host the source id\n * @param internalContext internal passthrough fall back\n *\n */\nexport function resolveSourceElement(context: Config, internalContext: Config): DQ {\n let elemId = resolveSourceElementId(context, internalContext);\n return DQ.byId(elemId.value, true);\n}\n\n/**\n * fetches the source form if it still exists\n * also embedded forms and parent forms are taken into consideration\n * as fallbacks\n *\n * @param internalContext\n * @param elem\n */\nexport function resolveSourceForm(internalContext: Config, elem: DQ): DQ {\n let sourceFormId = internalContext.getIf(CTX_PARAM_SRC_FRM_ID);\n let sourceForm = new DQ(sourceFormId.isPresent() ? document.forms[sourceFormId.value] : null);\n\n sourceForm = sourceForm.orElseLazy(() => elem.parents(TAG_FORM))\n .orElseLazy(() => elem.querySelectorAll(TAG_FORM))\n .orElseLazy(() => DQ.querySelectorAll(TAG_FORM));\n\n return sourceForm;\n}\n\nfunction resolveSourceElementId(context: Config, internalContext: Config): Optional<string> {\n //?internal context?? used to be external one\n return internalContext.getIf(CTX_PARAM_SRC_CTL_ID)\n .orElseLazy(() => context.getIf(SOURCE, \"id\").value);\n}\n\n","/*! Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {DQ, XMLQuery} from \"mona-dish\";\nimport {ResponseProcessor} from \"./ResponseProcessor\";\n\nimport {IResponseProcessor} from \"./IResponseProcessor\";\nimport {\n $nsp,\n CMD_ATTRIBUTES,\n CMD_CHANGES,\n CMD_DELETE,\n CMD_ERROR,\n CMD_EVAL,\n CMD_EXTENSION,\n CMD_INSERT,\n CMD_REDIRECT,\n CMD_UPDATE, P_RESOURCE,\n P_VIEWBODY,\n P_VIEWHEAD,\n P_VIEWROOT,\n PARTIAL_ID,\n RESP_PARTIAL,\n RESPONSE_XML,\n TAG_AFTER,\n TAG_BEFORE\n} from \"../core/Const\";\nimport {resolveContexts, resolveResponseXML} from \"./ResonseDataResolver\";\nimport {ExtConfig} from \"../util/ExtDomQuery\";\n\n\n\nexport module Response {\n\n\n /**\n * Standardized faces.ts response\n * this one is called straight from faces.ts.response\n *\n * The processing follows the spec by going for the responseXML\n * and processing its tags\n *\n * @param {XMLHttpRequest} request (xhrRequest) - xhr request object\n * @param context {Context} context (Map) - AJAX context\n *\n */\n export function processResponse(request: XMLHttpRequest, context: Context) {\n\n let req = ExtConfig.fromNullable(request);\n let {externalContext, internalContext} = resolveContexts(context);\n let responseXML: XMLQuery = resolveResponseXML(req);\n let responseProcessor = new ResponseProcessor(req, externalContext, internalContext);\n\n internalContext.assign(RESPONSE_XML).value = responseXML;\n\n //we now process the partial tags, or in none given raise an error\n responseXML.querySelectorAll(RESP_PARTIAL)\n .each(item => processPartialTag(<XMLQuery>item, responseProcessor, internalContext));\n\n //we now process the viewstates, client windows and the evals deferred\n //the reason for this is that often it is better\n //to wait until the document has caught up before\n //doing any evals even on embedded scripts\n //usually this does not matter, the client window comes in almost last always anyway\n //we maybe drop this deferred assignment in the future, but myfaces did it until now\n responseProcessor.fixViewStates();\n responseProcessor.fixClientWindow();\n responseProcessor.globalEval();\n\n responseProcessor.done();\n }\n\n /**\n * highest node partial-response from there the main operations are triggered\n */\n function processPartialTag(node: XMLQuery, responseProcessor: IResponseProcessor, internalContext) {\n\n internalContext.assign(PARTIAL_ID).value = node.id;\n const SEL_SUB_TAGS = [CMD_ERROR, CMD_REDIRECT, CMD_CHANGES].join(\",\");\n\n //now we can process the main operations\n node.querySelectorAll(SEL_SUB_TAGS).each((node: XMLQuery) => {\n switch (node.tagName.value) {\n case CMD_ERROR:\n responseProcessor.error(node);\n break;\n case CMD_REDIRECT:\n responseProcessor.redirect(node);\n break;\n case CMD_CHANGES:\n processChangesTag(node, responseProcessor);\n break;\n }\n });\n\n }\n\n let processInsert = function (responseProcessor: IResponseProcessor, node: XMLQuery) {\n //path1 insert after as child tags\n if(node.querySelectorAll([TAG_BEFORE, TAG_AFTER].join(\",\")).length) {\n responseProcessor.insertWithSubtags(node);\n } else { //insert before after with id\n responseProcessor.insert(node);\n }\n\n };\n\n /**\n * next level changes tag\n *\n * @param node\n * @param responseProcessor\n */\n function processChangesTag(node: XMLQuery, responseProcessor: IResponseProcessor): boolean {\n const ALLOWED_TAGS = [CMD_UPDATE, CMD_EVAL, CMD_INSERT, CMD_DELETE, CMD_ATTRIBUTES, CMD_EXTENSION].join(\", \");\n node.querySelectorAll(ALLOWED_TAGS).each(\n (node: XMLQuery) => {\n switch (node.tagName.value) {\n case CMD_UPDATE:\n processUpdateTag(node, responseProcessor);\n break;\n\n case CMD_EVAL:\n responseProcessor.eval(node);\n break;\n\n case CMD_INSERT:\n processInsert(responseProcessor, node);\n break;\n\n case CMD_DELETE:\n responseProcessor.delete(node);\n break;\n\n case CMD_ATTRIBUTES:\n responseProcessor.attributes(node);\n break;\n\n case CMD_EXTENSION:\n break;\n }\n }\n );\n return true;\n }\n\n /**\n * checks and stores a state update for delayed processing\n *\n * @param responseProcessor the response processor to perform the store operation\n * @param node the xml node to check for the state\n *\n * @private\n */\n function storeState(responseProcessor: IResponseProcessor, node: XMLQuery) {\n return responseProcessor.processViewState(node) || responseProcessor.processClientWindow(node);\n }\n\n /**\n * branch tag update. drill further down into the updates\n * special case viewstate in that case it is a leaf\n * and the viewstate must be processed\n *\n * @param node\n * @param responseProcessor\n */\n function processUpdateTag(node: XMLQuery, responseProcessor: IResponseProcessor) {\n //early state storing, if no state we perform a normal update cycle\n if (!storeState(responseProcessor, node)) {\n handleElementUpdate(node, responseProcessor);\n }\n }\n\n /**\n * element update\n *\n * @param node\n * @param responseProcessor\n */\n function handleElementUpdate(node: XMLQuery, responseProcessor: IResponseProcessor) {\n let cdataBlock = node.cDATAAsString;\n switch (node.id.value) {\n case $nsp(P_VIEWROOT) :\n responseProcessor.replaceViewRoot(DQ.fromMarkup(cdataBlock.substring(cdataBlock.indexOf(\"<html\"))));\n break;\n\n case $nsp(P_VIEWHEAD):\n responseProcessor.replaceHead(DQ.fromMarkup(cdataBlock));\n break;\n\n case $nsp(P_VIEWBODY):\n responseProcessor.replaceBody(DQ.fromMarkup(cdataBlock));\n break;\n\n case $nsp(P_RESOURCE):\n responseProcessor.addToHead(DQ.fromMarkup(cdataBlock))\n break;\n\n default://htmlItem replacement\n responseProcessor.update(node, cdataBlock);\n break;\n }\n }\n}","/*! Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Config, DomQuery, DQ, Lang, Stream, XMLQuery} from \"mona-dish\";\nimport {Implementation} from \"../AjaxImpl\";\nimport {Assertions} from \"../util/Assertions\";\nimport {IResponseProcessor} from \"./IResponseProcessor\";\nimport {ErrorData} from \"./ErrorData\";\nimport {StateHolder} from \"../core/ImplTypes\";\nimport {EventData} from \"./EventData\";\n\nimport {\n $nsp,\n APPLIED_CLIENT_WINDOW,\n APPLIED_VST,\n ATTR_ID,\n ATTR_NAME,\n ATTR_URL,\n ATTR_VALUE,\n EMPTY_FUNC,\n EMPTY_STR,\n ERROR_MESSAGE,\n ERROR_NAME,\n HTML_VIEWSTATE,\n ON_ERROR,\n ON_EVENT, P_CLIENT_WINDOW,\n P_PARTIAL_SOURCE,\n P_VIEWSTATE,\n RESPONSE_XML, SEL_CLIENT_WINDOW_ELEM,\n SEL_SCRIPTS_STYLES,\n SEL_VIEWSTATE_ELEM,\n SOURCE,\n SUCCESS,\n TAG_AFTER,\n TAG_ATTR,\n TAG_BEFORE,\n TAG_BODY,\n TAG_FORM,\n TAG_HEAD,\n UPDATE_ELEMS,\n UPDATE_FORMS,\n DEFERRED_HEAD_INSERTS\n} from \"../core/Const\";\nimport trim = Lang.trim;\nimport {ExtConfig, ExtDomquery} from \"../util/ExtDomQuery\";\n\n\n/**\n * Response processor\n *\n * Each XML tag is either a node or a leaf\n * or both\n *\n * the processor provides a set of operations\n * which are executed on a single leaf node per operation\n * and present the core functionality of our response\n *\n * Note the response processor is stateful hence we bundle it in a class\n * to reduce code we keep references tot contexts in place\n */\nexport class ResponseProcessor implements IResponseProcessor {\n\n constructor(private request: Config, private externalContext: Config, private internalContext: Config) {\n }\n\n /**\n * head replacement\n * @param shadowDocument incoming shadow head data (aka cdata as xml reference or dom element)\n * the data incoming must represent the html representation of the head itself one way or the other\n */\n replaceHead(shadowDocument: XMLQuery | DQ) {\n let shadowHead = shadowDocument.querySelectorAll(TAG_HEAD);\n if (!shadowHead.isPresent()) {\n return;\n }\n\n let oldHead = ExtDomquery.querySelectorAll(TAG_HEAD);\n\n //delete all to avoid script and style overlays\n oldHead.querySelectorAll(SEL_SCRIPTS_STYLES).delete();\n\n // we cannot replace new elements in the head, but we can eval the elements\n // eval means the scripts will get attached (eval script attach method)\n // but this is done by DomQuery not in this code\n this.storeForEval(shadowHead);\n //incoming either the outer head tag or its childs\n //shadowHead = (shadowHead.tagName.value === \"HEAD\") ? shadowHead.childNodes : shadowHead;\n //this.addToHead(shadowHead);\n }\n\n addToHead(newElements: XMLQuery | DQ) {\n this.internalContext.assign(DEFERRED_HEAD_INSERTS).value.push(newElements);\n }\n\n\n\n /**\n * replaces the body in the expected manner\n * which means the entire body content is refreshed\n * however also the body attributes must be transferred\n * keeping event handlers etc... in place\n *\n * @param shadowDocument .. an incoming shadow document hosting the new nodes\n */\n replaceBody(shadowDocument: XMLQuery | DQ) {\n\n let shadowBody = shadowDocument.querySelectorAll(TAG_BODY);\n if (!shadowBody.isPresent()) {\n return;\n }\n\n let shadowInnerHTML: string = <string>shadowBody.html().value;\n\n let resultingBody = <DQ>ExtDomquery.querySelectorAll(TAG_BODY).html(shadowInnerHTML);\n let updateForms = resultingBody.querySelectorAll(TAG_FORM);\n\n // main difference, we cannot replace the body itself, but only its content\n // we need a separate step for post processing the incoming attributes, like classes, styles etc...\n resultingBody.copyAttrs(shadowBody);\n\n this.storeForPostProcessing(updateForms, resultingBody);\n }\n\n /**\n * Leaf Tag eval... process whatever is in the evals cdata block\n *\n * @param node the node to eval\n */\n eval(node: XMLQuery) {\n ExtDomquery.globalEval(node.cDATAAsString);\n }\n\n /**\n * processes an incoming error from the response\n * which is hosted under the <error> tag\n * @param node the node hosting the error in our response xml\n * @param node the node in the xml hosting the error message\n */\n error(node: XMLQuery) {\n /**\n * <error>\n * <error-name>String</error-name>\n * <error-message><![CDATA[message]]></error-message>\n * <error>\n */\n\n let mergedErrorData = new ExtConfig({});\n mergedErrorData.assign(SOURCE).value = this.externalContext.getIf(P_PARTIAL_SOURCE).get(0).value;\n mergedErrorData.assign(ERROR_NAME).value = node.querySelectorAll(ERROR_NAME).textContent(EMPTY_STR);\n mergedErrorData.assign(ERROR_MESSAGE).value = node.querySelectorAll(ERROR_MESSAGE).cDATAAsString;\n\n let hasResponseXML = this.internalContext.get(RESPONSE_XML).isPresent();\n\n //we now store the response xml also in the error data for further details\n mergedErrorData.assignIf(hasResponseXML, RESPONSE_XML).value = this.internalContext.getIf(RESPONSE_XML).value.get(0).value;\n\n // error post processing and enrichment (standard messages from keys)\n let errorData = ErrorData.fromServerError(mergedErrorData);\n\n // we now trigger an internally stored onError function which might be a attached to the context\n // either we haven an internal on error, or an on error has been bassed via params from the outside\n // in both cases they are attached to our contexts\n\n this.triggerOnError(errorData);\n Implementation.sendError(errorData);\n }\n\n /**\n * process the redirect operation\n *\n * @param node\n */\n redirect(node: XMLQuery) {\n Assertions.assertUrlExists(node);\n\n let redirectUrl = trim(node.attr(ATTR_URL).value);\n if (redirectUrl != EMPTY_STR) {\n window.location.href = redirectUrl;\n }\n }\n\n /**\n * processes the update operation and updates the node with the cdata block\n * @param node the xml response node hosting the update info\n * @param cdataBlock the cdata block with the new html code\n */\n update(node: XMLQuery, cdataBlock: string) {\n let result = ExtDomquery.byId(node.id.value, true).outerHTML(cdataBlock, false, false);\n let sourceForm = result?.parents(TAG_FORM).orElseLazy(() => result.byTagName(TAG_FORM, true));\n if (sourceForm) {\n this.storeForPostProcessing(sourceForm, result);\n }\n }\n\n /**\n * Delete handler, simply deleetes the node referenced by the xml data\n * @param node\n */\n delete(node: XMLQuery) {\n DQ.byId(node.id.value, true).delete();\n }\n\n /**\n * attributes leaf tag... process the attributes\n *\n * @param node\n */\n attributes(node: XMLQuery) {\n let elem = DQ.byId(node.id.value, true);\n\n node.byTagName(TAG_ATTR).each((item: XMLQuery) => {\n elem.attr(item.attr(ATTR_NAME).value).value = item.attr(ATTR_VALUE).value;\n });\n }\n\n /**\n * @param shadowDocument a shadow document which is needed for further processing\n */\n replaceViewRoot(shadowDocument: XMLQuery) {\n this.replaceHead(shadowDocument);\n this.replaceBody(shadowDocument);\n }\n\n /**\n * Insert handling, either before or after\n *\n * @param node\n */\n insert(node: XMLQuery) {\n //let insertId = node.id; //not used atm\n\n let before = node.attr(TAG_BEFORE);\n let after = node.attr(TAG_AFTER);\n\n let insertNodes = DQ.fromMarkup(<any>node.cDATAAsString);\n\n if (before.isPresent()) {\n DQ.byId(before.value, true).insertBefore(insertNodes);\n this.internalContext.assign(UPDATE_ELEMS).value.push(insertNodes);\n }\n if (after.isPresent()) {\n let domQuery = DQ.byId(after.value, true);\n domQuery.insertAfter(insertNodes);\n\n this.internalContext.assign(UPDATE_ELEMS).value.push(insertNodes);\n }\n }\n\n /**\n * Handler for the case <insert << before id=\"...\n *\n * @param node the node hosting the insert data\n */\n insertWithSubtags(node: XMLQuery) {\n let before = node.querySelectorAll(TAG_BEFORE);\n let after = node.querySelectorAll(TAG_AFTER);\n\n before.each(item => {\n let insertId = item.attr(ATTR_ID);\n let insertNodes = DQ.fromMarkup(<any>item.cDATAAsString);\n if (insertId.isPresent()) {\n DQ.byId(insertId.value, true).insertBefore(insertNodes);\n this.internalContext.assign(UPDATE_ELEMS).value.push(insertNodes);\n }\n });\n\n after.each(item => {\n let insertId = item.attr(ATTR_ID);\n let insertNodes = DQ.fromMarkup(<any>item.cDATAAsString);\n if (insertId.isPresent()) {\n DQ.byId(insertId.value, true).insertAfter(insertNodes);\n this.internalContext.assign(UPDATE_ELEMS).value.push(insertNodes);\n }\n });\n }\n\n /**\n * Process the viewState update, update the affected\n * forms with their respective new viewstate values\n *\n */\n processViewState(node: XMLQuery): boolean {\n if (ResponseProcessor.isViewStateNode(node)) {\n let state = node.cDATAAsString;\n this.internalContext.assign(APPLIED_VST, node.id.value).value = new StateHolder($nsp(node.id.value), state);\n return true;\n }\n return false;\n }\n\n processClientWindow(node: XMLQuery): boolean {\n if (ResponseProcessor.isClientWindowNode(node)) {\n let state = node.cDATAAsString;\n this.internalContext.assign(APPLIED_CLIENT_WINDOW, node.id.value).value = new StateHolder($nsp(node.id.value), state);\n return true;\n }\n }\n\n /**\n * generic global eval which runs the embedded css and scripts\n */\n globalEval() {\n // phase one, if we have head inserts, we build up those before going into the script eval phase\n let insertHeadElems = new ExtDomquery(...this.internalContext.getIf(DEFERRED_HEAD_INSERTS).value);\n insertHeadElems.runHeadInserts(true);\n\n // phase 2 we run a script eval on all updated elements in the body\n let updateElems = new ExtDomquery(...this.internalContext.getIf(UPDATE_ELEMS).value);\n updateElems.runCss();\n // phase 3, we do the same for the css\n updateElems.runScripts();\n }\n\n /**\n * Postprocessing view state fixing\n * this appends basically the incoming view states to the forms.\n * It is called from outside after all forms have been processed basically\n * as last lifecycle step, before going into the next request.\n */\n fixViewStates() {\n Stream.ofAssoc<StateHolder>(this.internalContext.getIf(APPLIED_VST).orElse({}).value)\n .each((item: Array<any>) => {\n let value: StateHolder = item[1];\n let nameSpace = DQ.byId(value.nameSpace, true).orElse(document.body);\n let affectedForms = nameSpace.byTagName(TAG_FORM);\n let affectedForms2 = nameSpace.filter(item => item.tagName.orElse(EMPTY_STR).value.toLowerCase() == TAG_FORM);\n\n this.appendViewStateToForms(new DomQuery(affectedForms, affectedForms2), value.value);\n });\n }\n\n /**\n * same as with view states before applies the incoming client windows as last step after the rest of the processing\n * is done.\n */\n fixClientWindow() {\n Stream.ofAssoc<StateHolder>(this.internalContext.getIf(APPLIED_CLIENT_WINDOW).orElse({}).value)\n .each((item: Array<any>) => {\n let value: StateHolder = item[1];\n let nameSpace = DQ.byId(value.nameSpace, true).orElse(document.body);\n let affectedForms = nameSpace.byTagName(TAG_FORM);\n let affectedForms2 = nameSpace.filter(item => item.tagName.orElse(EMPTY_STR).value.toLowerCase() == TAG_FORM);\n\n this.appendClientWindowToForms(new DomQuery(affectedForms, affectedForms2), value.value);\n });\n }\n\n /**\n * all processing done we can close the request and send the appropriate events\n */\n done() {\n let eventData = EventData.createFromRequest(this.request.value, this.externalContext, SUCCESS);\n\n //because some frameworks might decorate them over the context in the response\n let eventHandler = this.externalContext.getIf(ON_EVENT).orElseLazy(() => this.internalContext.getIf(ON_EVENT).value).orElse(EMPTY_FUNC).value;\n Implementation.sendEvent(eventData, eventHandler);\n }\n\n /**\n * proper viewstate -> form assignment\n *\n * @param forms the forms to append the viewstate to\n * @param viewState the final viewstate\n */\n private appendViewStateToForms(forms: DQ, viewState: string) {\n this.assignState(forms, $nsp(SEL_VIEWSTATE_ELEM), viewState);\n }\n\n\n /**\n * proper clientwindow -> form assignment\n *\n * @param forms the forms to append the viewstate to\n * @param clientWindow the final viewstate\n */\n private appendClientWindowToForms(forms: DQ, clientWindow: string) {\n this.assignState(forms, $nsp(SEL_CLIENT_WINDOW_ELEM), clientWindow);\n }\n\n /**\n * generic append state which appends a certain state as hidden element to an existing set of forms\n *\n * @param forms the forms to append or change to\n * @param selector the selector for the state\n * @param state the state itself which needs to be assigned\n *\n * @private\n */\n private assignState(forms: DQ, selector: string, state: string) {\n forms.each((form: DQ) => {\n let stateHolders = form.querySelectorAll(selector)\n .orElseLazy(() => ResponseProcessor.newViewStateElement(form));\n\n stateHolders.attr(\"value\").value = state;\n });\n }\n\n /**\n * Helper to Create a new JSF ViewState Element\n *\n * @param parent, the parent node to attach the viewstate element to\n * (usually a form node)\n */\n private static newViewStateElement(parent: DQ): DQ {\n let newViewState = DQ.fromMarkup($nsp(HTML_VIEWSTATE));\n newViewState.appendTo(parent);\n return newViewState;\n }\n\n /**\n * Stores certain aspects of the dom for later post processing\n *\n * @param updateForms the update forms which should receive standardized internal jsf data\n * @param toBeEvaled the resulting elements which should be evaled\n */\n private storeForPostProcessing(updateForms: DQ, toBeEvaled: DQ) {\n this.storeForUpdate(updateForms);\n this.storeForEval(toBeEvaled);\n }\n\n /**\n * helper to store a given form for the update post processing (viewstate)\n *\n * @param updateForms the dom query object pointing to the forms which need to be updated\n */\n private storeForUpdate(updateForms: DQ) {\n this.internalContext.assign(UPDATE_FORMS).value.push(updateForms);\n }\n\n /**\n * same for eval (js and css)\n *\n * @param toBeEvaled\n */\n private storeForEval(toBeEvaled: DQ) {\n this.internalContext.assign(UPDATE_ELEMS).value.push(toBeEvaled);\n }\n\n // head eval is always sticky\n private storeForHeadEval(toBeEvaled: DQ, sticky) {\n this.internalContext.assign(DEFERRED_HEAD_INSERTS).value.push(toBeEvaled);\n }\n\n /**\n * check whether a given XMLQuery node is an explicit viewstate node\n *\n * @param node the node to check\n * @returns true of it ii\n */\n private static isViewStateNode(node: XMLQuery): boolean {\n let separatorChar = (window?.faces ?? window?.jsf).separatorchar;\n return \"undefined\" != typeof node?.id?.value && (node?.id?.value == $nsp(P_VIEWSTATE) ||\n node?.id?.value?.indexOf([separatorChar, $nsp(P_VIEWSTATE)].join(EMPTY_STR)) != -1 ||\n node?.id?.value?.indexOf([$nsp(P_VIEWSTATE), separatorChar].join(EMPTY_STR)) != -1);\n }\n\n /**\n * incoming client window node also needs special processing\n *\n * @param node the node to check\n * @returns true of it ii\n */\n private static isClientWindowNode(node: XMLQuery): boolean {\n let separatorChar = (window?.faces ?? window?.jsf).separatorchar;\n return \"undefined\" != typeof node?.id?.value && (node?.id?.value == $nsp(P_CLIENT_WINDOW) ||\n node?.id?.value?.indexOf([separatorChar, $nsp(P_CLIENT_WINDOW)].join(EMPTY_STR)) != -1 ||\n node?.id?.value?.indexOf([$nsp(P_CLIENT_WINDOW), separatorChar].join(EMPTY_STR)) != -1);\n }\n\n private triggerOnError(errorData: ErrorData) {\n this.externalContext.getIf(ON_ERROR).orElse(this.internalContext.getIf(ON_ERROR).value).orElse(EMPTY_FUNC).value(errorData);\n }\n\n\n}","/*! Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {ArrayCollector, Config, DQ, Lang, LazyStream, Stream} from \"mona-dish\";\nimport {EMPTY_STR, IDENT_ALL, IDENT_FORM, P_VIEWSTATE} from \"../core/Const\";\nimport isString = Lang.isString;\nimport {ExtConfig} from \"../util/ExtDomQuery\";\n\n\n/**\n * A unified form data class\n * which builds upon our configuration.\n *\n * We cannot use standard html5 forms everywhere\n * due to api constraints on the HTML Form object in IE11\n * and due to the url encoding constraint given by the faces.js spec\n *\n * probably only one needed and one overlay!\n * the entire file input storing probably is redundant now\n * that dom query has been fixed //TODO check this\n */\nexport class XhrFormData extends Config {\n /**\n * Checks if the given datasource is a multipart request source\n * multipart is only needed if one of the executes is a file input\n * since file inputs are stateless, they fall out of the view state\n * and need special handling. With file submits we have to send a formData object\n * instead of an encoded string files cannot be sent that way\n */\n isMultipartRequest: boolean = false;\n\n /**\n * data collector from a given form\n *\n * @param dataSource either a form as DomQuery object or an encoded url string\n * @param viewState the form view state or an external viewstate coming in as string\n * @param executes the executes id list for the elements to being processed\n * @param partialIds partial ids to collect, to reduce the data sent down\n */\n constructor(private dataSource: DQ | string, viewState?: string, executes?: string[], private partialIds?: string[]) {\n super({});\n //a call to getViewState before must pass the encoded line\n //a call from getViewState passes the form element as datasource,\n //so we have two call points\n if (isString(dataSource)) {\n this.assignEncodedString(<string>this.dataSource);\n } else {\n this.applyFormDataToConfig();\n }\n if('undefined' != typeof viewState) {\n this.assignEncodedString(viewState)\n }\n if(executes) {\n this.postInit(...executes);\n }\n }\n\n /**\n * generic post init code, for now, this peforms some post assign data post processing\n * @param executes\n */\n postInit(...executes: Array<string>) {\n let fetchInput = (id: string): DQ => {\n if (id == IDENT_ALL) {\n return DQ.querySelectorAllDeep(\"input[type='file']\");\n } else if (id == IDENT_FORM) {\n return (<DQ>this.dataSource).querySelectorAllDeep(\"input[type='file']\");\n } else {\n let element = DQ.byId(id, true);\n return this.getFileInputs(element);\n }\n };\n\n let inputExists = (item: DQ) => {\n return item.isPresent();\n };\n\n\n this.isMultipartRequest = LazyStream.of(...executes)\n .map(fetchInput)\n .filter(inputExists)\n .first().isPresent();\n }\n\n /**\n * special case view state handling\n *\n * @param form the form holding the view state value\n */\n private applyViewState(form: DQ) {\n let viewState = form.byId(P_VIEWSTATE, true).inputValue;\n this.appendIf(viewState.isPresent(), P_VIEWSTATE).value = viewState.value;\n }\n\n /**\n * assigns an url encoded string to this xhrFormData object\n * as key value entry\n * @param encoded\n */\n assignEncodedString(encoded: string) {\n // this code filters out empty strings as key value pairs\n let keyValueEntries = decodeURIComponent(encoded).split(/&/gi)\n .filter(item => !!(item || '')\n .replace(/\\s+/g,''));\n this.assignString(keyValueEntries);\n }\n\n /**\n * assign a set of key value pairs passed as array ['key=val1', 'key2=val2']\n * @param keyValueEntries\n */\n assignString(keyValueEntries: string[]) {\n let toMerge = new ExtConfig({});\n\n function splitToKeyVal(line: string) {\n return line.split(/=(.*)/gi);\n }\n\n function fixKeyWithoutVal(keyVal: string[]) {\n return keyVal.length < 3 ? [keyVal?.[0] ?? [], keyVal?.[1] ?? []] : keyVal;\n }\n\n Stream.of(...keyValueEntries)\n //split only the first =\n .map(line => splitToKeyVal(line))\n //special case of having keys without values\n .map(keyVal => fixKeyWithoutVal(keyVal))\n .each(keyVal => {\n toMerge.append(keyVal[0] as string).value = keyVal?.splice(1)?.join(\"\") ?? \"\";\n });\n //merge with overwrite but no append! (aka no double entries are allowed)\n this.shallowMerge(toMerge);\n }\n\n /**\n * @returns a Form data representation, this is needed for file submits\n */\n toFormData(): FormData {\n let ret: any = new FormData();\n this.appendInputs(ret);\n return ret;\n }\n\n resolveSubmitIdentifier(elem: HTMLInputElement) {\n let identifier = elem.name;\n identifier = ((elem?.name ?? \"\").replace(/s+/gi, \"\") == \"\") ? elem.id : identifier;\n return identifier;\n }\n\n /**\n * returns an encoded string representation of our xhr form data\n *\n * @param defaultStr optional default value if nothing is there to encode\n */\n toString(defaultStr = EMPTY_STR): string {\n if (this.isAbsent()) {\n return defaultStr;\n }\n let entries = LazyStream.of(...Object.keys(this.value))\n .filter(key => this.value.hasOwnProperty(key))\n .flatMap(key => Stream.of(...this.value[key]).map(val => [key, val]).collect(new ArrayCollector()))\n .map(keyVal => {\n return `${encodeURIComponent(keyVal[0])}=${encodeURIComponent(keyVal[1])}`;\n })\n .collect(new ArrayCollector());\n\n return entries.join(\"&\")\n }\n\n /**\n * helper to fetch all file inputs from as given root element\n * @param rootElement\n * @private\n */\n private getFileInputs(rootElement: DQ): DQ {\n const rootFileInputs = rootElement\n .filter(elem => elem.matchesSelector(\"input[type='file']\"))\n const childFileInputs = rootElement\n .querySelectorAll(\"input[type='file']\");\n\n return rootFileInputs.concat(childFileInputs);\n }\n\n /**\n * encode the given fields and apply the view state\n * @private\n */\n private applyFormDataToConfig() {\n //encode and append the issuing item if not a partial ids array of ids is passed\n /*\n * Spec. 13.3.1\n * Collect and encode input elements.\n * Additionally the hidden element jakarta.faces.ViewState\n * Enhancement partial page submit\n *\n */\n this.encodeSubmittableFields(this, <DQ>this.dataSource, this.partialIds);\n\n if (this.getIf(P_VIEWSTATE).isPresent()) {\n return;\n }\n\n this.applyViewState(<DQ>this.dataSource);\n }\n\n /**\n * determines fields to submit\n * @param {Object} targetBuf - the target form buffer receiving the data\n * @param {Node} parentItem - form element item is nested in\n * @param {Array} partialIds - ids fo PPS\n */\n private encodeSubmittableFields(targetBuf: Config,\n parentItem: DQ, partialIds ?: string[]) {\n let toEncode = null;\n if (this.partialIds && this.partialIds.length) {\n // in case of our myfaces reduced ppr we\n // only submit the partials\n this._value = {};\n toEncode = new DQ(...this.partialIds);\n\n } else {\n if (parentItem.isAbsent()) throw 'NO_PAR_ITEM';\n toEncode = parentItem;\n }\n\n //lets encode the form elements\n this.shallowMerge(toEncode.deepElements.encodeFormElement());\n }\n\n private appendInputs(ret: any) {\n Stream.of(...Object.keys(this.value))\n .each(key => {\n Stream.of(...this.value[key]).each(item => ret.append(key, item));\n });\n }\n}","/*! Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {AsyncRunnable} from \"../util/AsyncRunnable\";\nimport {Config, DQ, Stream} from \"mona-dish\";\nimport {Implementation} from \"../AjaxImpl\";\n\nimport {XhrFormData} from \"./XhrFormData\";\nimport {ErrorData} from \"./ErrorData\";\nimport {EventData} from \"./EventData\";\nimport {ExtLang} from \"../util/Lang\";\nimport {\n BEGIN,\n COMPLETE,\n CONTENT_TYPE,\n CTX_PARAM_MF_INTERNAL,\n CTX_PARAM_PASS_THR,\n ERROR,\n HEAD_FACES_REQ,\n MALFORMEDXML,\n NO_TIMEOUT,\n ON_ERROR,\n ON_EVENT, P_EXECUTE,\n REQ_ACCEPT,\n REQ_TYPE_GET,\n REQ_TYPE_POST,\n STATE_EVT_TIMEOUT,\n STD_ACCEPT,\n URL_ENCODED,\n VAL_AJAX\n} from \"../core/Const\";\nimport {resolveFinalUrl, resolveHandlerFunc} from \"./RequestDataResolver\";\nimport failSaveExecute = ExtLang.failSaveExecute;\n\n/**\n * Faces XHR Request Wrapper\n * as Asyncrunnable for our Asynchronous queue\n *\n * The idea is that we basically just enqueue\n * a single ajax request into our queue\n * and let the queue do the processing.\n *\n */\n\nexport class XhrRequest implements AsyncRunnable<XMLHttpRequest> {\n\n private responseContext: Config;\n\n private stopProgress = false;\n\n /**\n * helper support so that we do not have to drag in Promise shims\n */\n private catchFuncs: Array<Function> = [];\n private thenFunc: Array<Function> = [];\n\n /**\n * Reqired Parameters\n *\n * @param source the issuing element\n * @param sourceForm the form which is related to the issuing element\n * @param requestContext the request context with allö pass through values\n *\n * Optional Parameters\n *\n * @param internalContext internal context with internal info which is passed through, not used by the user\n * @param partialIdsArray an optional restricting partial ids array for encoding\n * @param timeout optional xhr timeout\n * @param ajaxType optional request type, default \"POST\"\n * @param contentType optional content type, default \"application/x-www-form-urlencoded\"\n * @param xhrObject optional xhr object which must fullfill the XMLHTTPRequest api, default XMLHttpRequest\n */\n constructor(\n private source: DQ,\n private sourceForm: DQ,\n private requestContext: Config,\n private internalContext: Config,\n private partialIdsArray = [],\n private timeout = NO_TIMEOUT,\n private ajaxType = REQ_TYPE_POST,\n private contentType = URL_ENCODED,\n private xhrObject = new XMLHttpRequest()\n ) {\n /*\n * we omit promises here\n * some browsers do not support it and we do not need shim code\n */\n this.registerXhrCallbacks((data: any) => {\n this.resolve(data)\n }, (data: any) => {\n this.reject(data)\n });\n }\n\n start(): AsyncRunnable<XMLHttpRequest> {\n\n let ignoreErr = failSaveExecute;\n let xhrObject = this.xhrObject;\n\n let executesArr = () => {\n return this.requestContext.getIf(CTX_PARAM_PASS_THR, P_EXECUTE).get(\"none\").value.split(/\\s+/gi);\n };\n try {\n\n let formElement = this.sourceForm.getAsElem(0).value;\n let viewState = (window?.faces ?? window?.jsf).getViewState(formElement);\n //encoded we need to decode\n //We generated a base representation of the current form\n //in case someone has overloaded the viewstate with addtional decorators we merge\n //that in, there is no way around it, the spec allows it and getViewState\n //must be called, so whatever getViewState delivers has higher priority then\n //whatever the formData object delivers\n //the partialIdsArray arr is almost deprecated legacy code where we allowed to send a separate list of partial\n //ids for reduced load and server processing, this will be removed soon, we can handle the same via execute\n //anyway TODO remove the partial ids array\n let formData: XhrFormData = new XhrFormData(this.sourceForm, viewState, executesArr(), this.partialIdsArray);\n\n this.contentType = formData.isMultipartRequest ? \"undefined\" : this.contentType;\n\n //next step the pass through parameters are merged in for post params\n let requestContext = this.requestContext;\n let passThroughParams = requestContext.getIf(CTX_PARAM_PASS_THR);\n\n // this is an extension where we allow pass through parameters to be sent down additionally\n // this can be used and is used in the impl to enrich the post request parameters with additional\n // information\n formData.shallowMerge(passThroughParams, true, true);\n\n this.responseContext = passThroughParams.deepCopy;\n\n //we have to shift the internal passthroughs around to build up our response context\n let responseContext = this.responseContext;\n\n responseContext.assign(CTX_PARAM_MF_INTERNAL).value = this.internalContext.value;\n\n //per spec the onevent and onerrors must be passed through to the response\n responseContext.assign(ON_EVENT).value = requestContext.getIf(ON_EVENT).value;\n responseContext.assign(ON_ERROR).value = requestContext.getIf(ON_ERROR).value;\n\n xhrObject.open(this.ajaxType, resolveFinalUrl(this.sourceForm, formData, this.ajaxType), true);\n\n //adding timeout\n this.timeout ? xhrObject.timeout = this.timeout : null;\n\n //a bug in the xhr stub library prevents the setRequestHeader to be properly executed on fake xhr objects\n //normal browsers should resolve this\n //tests can quietly fail on this one\n if(this.contentType != \"undefined\") {\n ignoreErr(() => xhrObject.setRequestHeader(CONTENT_TYPE, `${this.contentType}; charset=utf-8`));\n }\n\n ignoreErr(() => xhrObject.setRequestHeader(HEAD_FACES_REQ, VAL_AJAX));\n\n //probably not needed anymore, will test this\n //some webkit based mobile browsers do not follow the w3c spec of\n // setting, they accept headers automatically\n ignoreErr(() => xhrObject.setRequestHeader(REQ_ACCEPT, STD_ACCEPT));\n\n this.sendEvent(BEGIN);\n\n this.sendRequest(formData);\n\n } catch (e) {\n //_onError//_onError\n this.handleError(e);\n }\n return this;\n }\n\n cancel() {\n try {\n this.xhrObject.abort();\n } catch (e) {\n this.handleError(e);\n }\n }\n\n resolve(data: any) {\n Stream.of(...this.thenFunc).reduce((inputVal: any, thenFunc: any) => {\n return thenFunc(inputVal);\n }, data);\n }\n\n reject(data: any) {\n Stream.of(...this.catchFuncs).reduce((inputVal: any, catchFunc: any) => {\n return catchFunc(inputVal);\n }, data);\n }\n\n catch(func: (data: any) => any): AsyncRunnable<XMLHttpRequest> {\n this.catchFuncs.push(func);\n return this;\n }\n\n finally(func: () => void): AsyncRunnable<XMLHttpRequest> {\n //no ie11 support we probably are going to revert to shims for that one\n this.catchFuncs.push(func);\n this.thenFunc.push(func);\n return this;\n }\n\n then(func: (data: any) => any): AsyncRunnable<XMLHttpRequest> {\n //this.$promise.then(func);\n this.thenFunc.push(func);\n return this;\n }\n\n /**\n * attaches the internal event and processing\n * callback within the promise to our xhr object\n *\n * @param resolve\n * @param reject\n */\n private registerXhrCallbacks(resolve: Consumer<any>, reject: Consumer<any>) {\n let xhrObject = this.xhrObject;\n\n xhrObject.onabort = () => {\n this.onAbort(reject);\n };\n xhrObject.ontimeout = () => {\n this.onTimeout(reject);\n };\n xhrObject.onload = () => {\n this.onSuccess(resolve)\n };\n xhrObject.onloadend = () => {\n this.onDone(this.xhrObject, resolve);\n };\n xhrObject.onerror = (errorData: any) => {\n // some browsers trigger an error when cancelling a request internally\n // in this case we simply ignore the request and clear up the queue, because\n // it is not safe anymore to proceed with the current queue\n\n // This bypasses a Safari issue where it keeps requests hanging after page unload\n // and then triggers a cancel error on then instead of just stopping\n // and clearing the code\n if(this.isCancelledResponse(this.xhrObject)) {\n reject();\n this.stopProgress = true;\n return;\n }\n this.onError(errorData, reject);\n };\n }\n\n private isCancelledResponse(currentTarget: XMLHttpRequest): boolean {\n return currentTarget?.status === 0 && //cancelled by browser\n currentTarget?.readyState === 4 &&\n currentTarget?.responseText === '' &&\n currentTarget?.responseXML === null;\n }\n\n /*\n * xhr processing callbacks\n *\n * Those methods are the callbacks called by\n * the xhr object depending on its own state\n */\n\n private onAbort(reject: Consumer<any>) {\n reject();\n }\n\n private onTimeout(reject: Consumer<any>) {\n this.sendEvent(STATE_EVT_TIMEOUT);\n reject();\n }\n\n private onSuccess(resolve: Consumer<any>) {\n\n this.sendEvent(COMPLETE);\n\n //malforms always result in empty response xml\n if (!this?.xhrObject?.responseXML) {\n this.handleMalFormedXML(resolve);\n return;\n }\n\n (window?.faces ?? window.jsf).ajax.response(this.xhrObject, this.responseContext.value ?? {});\n }\n\n private handleMalFormedXML(resolve: Function) {\n this.stopProgress = true;\n let errorData = {\n type: ERROR,\n status: MALFORMEDXML,\n responseCode: 200,\n responseText: this.xhrObject?.responseText,\n source: {\n id: this.source.id.value\n }\n };\n try {\n this.handleError(errorData, true);\n } finally {\n // we issue a resolve in this case to allow the system to recover\n // reject would clean up the queue\n resolve(errorData);\n }\n //non blocking non clearing\n }\n\n private onDone(data: any, resolve: Consumer<any>) {\n // if stop progress a special handling including resolve is already performed\n if (this.stopProgress) {\n return;\n }\n resolve(data);\n }\n\n private onError(errorData: any, reject: Consumer<any>) {\n this.handleError(errorData);\n reject();\n }\n\n private sendRequest(formData: XhrFormData) {\n let isPost = this.ajaxType != REQ_TYPE_GET;\n if (formData.isMultipartRequest) {\n //in case of a multipart request we send in a formData object as body\n this.xhrObject.send((isPost) ? formData.toFormData() : null);\n } else {\n //in case of a normal request we send it normally\n this.xhrObject.send((isPost) ? formData.toString() : null);\n }\n }\n\n /*\n * other helpers\n */\n private sendEvent(evtType: string) {\n let eventData = EventData.createFromRequest(this.xhrObject, this.requestContext, evtType);\n try {\n //user code error, we might cover\n //this in onError but also we cannot swallow it\n //we need to resolve the local handlers lazily,\n //because some frameworks might decorate them over the context in the response\n let eventHandler = resolveHandlerFunc(this.requestContext, this.responseContext, ON_EVENT);\n\n Implementation.sendEvent(eventData, eventHandler);\n } catch (e) {\n this.handleError(e);\n throw e;\n }\n }\n\n private handleError(exception, responseFormatError: boolean = false) {\n let errorData = (responseFormatError) ? ErrorData.fromHttpConnection(exception.source, exception.type, exception.status, exception.responseText, exception.responseCode, exception.status) : ErrorData.fromClient(exception);\n\n let eventHandler = resolveHandlerFunc(this.requestContext, this.responseContext, ON_ERROR);\n Implementation.sendError(errorData, eventHandler);\n }\n\n}","/*! Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {DQ, Stream} from \"mona-dish\";\n\n/**\n * legacy code to enable various aspects\n * of myfaces, used to be rendered inline\n * for jsf 2.0 we can externalize it into its own custom resource\n *\n * note this is a straight 1:1 port from the existing codebase\n * (not too much work has been spent here, the important thing is, that\n * the namespace and functions need to be kept intact for legacy code)\n *\n * we might move the code over in the future, but for now a straight 1:1 port suffices\n */\nexport module oam {\n /**\n * sets a hidden input field\n * @param formName the formName\n * @param name the hidden field\n * @param value the value to be rendered\n */\n export const setHiddenInput = function (formName: string, name: string, value: string): void {\n DQ.byId(document.forms[formName])\n .each(form => {\n const input = form.querySelectorAll(`input[type='hidden'][name='${name}']`);\n if (input.isPresent()) {\n input.inputValue.value = value;\n } else {\n const newInput = DQ.fromMarkup(`<input type='hidden' id='${name}' name='${name}'>`);\n newInput.inputValue.value = value;\n newInput.appendTo(form);\n }\n });\n };\n\n /**\n * clears a hidden input field\n *\n * @param formName formName for the input\n * @param name the name of the input field\n */\n export const clearHiddenInput = function (formName: string, name: string): void {\n let element = document.forms?.[formName]?.elements?.[name];\n if(!element) {\n return;\n }\n DQ.byId(element).delete();\n };\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * does special form submit remapping\n * re-maps the issuing command link into something,\n * a decode of the command link on the server can understand\n *\n * @param formName\n * @param linkId\n * @param target\n * @param params\n */\n export const submitForm = function (formName: string, linkId: string, target: string, params: { [key: string]: any }): boolean {\n let clearFn = 'clearFormHiddenParams_' + formName.replace(/-/g, '\\$:').replace(/:/g, '_');\n window?.[clearFn]?.(formName);\n\n //autoscroll code\n if (window?.myfaces?.core?.config?.autoScroll && (window as any)?.getScrolling) {\n myfaces.oam.setHiddenInput(formName, 'autoScroll', (window as any)?.getScrolling());\n }\n Stream.ofAssoc(params).each((param: [string, any]) => {\n myfaces.oam.setHiddenInput(formName, param[0], param[1]);\n });\n\n //we call the namespaced function, to allow decoration, via a direct call we would\n myfaces.oam.setHiddenInput(formName, `${formName}:_idcl`, linkId);\n\n DQ.byId(document.forms[formName]).each(form => {\n const ATTR_TARGET = \"target\";\n const formElement = form.getAsElem(0).value as HTMLFormElement;\n const oldTarget = form.attr(ATTR_TARGET).value;\n form.attr(ATTR_TARGET).value = target;\n\n const result = formElement?.onsubmit?.(null);\n\n try {\n if ((!!result) || 'undefined' == typeof result) {\n formElement.submit();\n }\n } catch (e) {\n window?.console.error(e);\n } finally {\n form.attr(ATTR_TARGET).value = oldTarget;\n Stream.ofAssoc(params).each((param: [string, any]) => {\n myfaces.oam.clearHiddenInput(formName, param[0]);\n });\n myfaces.oam.clearHiddenInput(formName, `${formName}:_idcl`);\n }\n\n });\n return false;\n };\n}","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","/*! Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\"use strict\";\n\n/**\n * faces.js init layer which provides as per spec the proper\n * window namespace if it does not exist already\n *\n * The idea is that we use a small shim on top of\n * the implementation to provide the window namespace.\n * The implementation itself is in a protected namespace\n * which will be bound by the build system\n *\n * The documentation nevertheless targets the _api file, which\n * hosts the full api\n */\nif(!window.faces) {\n //we lazily load the code to prevent ram bloat\n const faces = require(\"./_api\").faces;\n window['faces'] = window?.faces ?? faces;\n}\nif(!window?.myfaces?.ab) {\n const myfaces = require(\"./_api\").myfaces;\n\n //namespace might be extended is not exclusively reserved so we merge\n (window as any)[\"myfaces\"] = window?.myfaces ?? {};\n Object.keys(myfaces).forEach(key => window.myfaces[key] = window.myfaces?.[key] ?? myfaces[key]);\n}\nexport var faces = window.faces;\nexport var myfaces =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I,KAAK,CAAC;CAC5C;AACD,IAAG,CAAC,aAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,0CAAE,EAAE,GAAE;IACrB,MAAM,OAAO,GAAG,gFAAyB,CAAC;IAE1C,qEAAqE;IACpE,MAAc,CAAC,SAAS,CAAC,GAAG,YAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,mCAAI,EAAE,CAAC;IACnD,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,eAAC,aAAM,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,kBAAM,CAAC,OAAO,0CAAG,GAAG,CAAC,mCAAI,OAAO,CAAC,GAAG,CAAC,IAAC,CAAC;CACpG;AACU,aAAK,GAAG,MAAM,CAAC,KAAK,CAAC;AACrB,eAAO,GAAG,MAAM,CAAC,OAAO,CAAC","sources":["webpack://jsf.js_next_gen/./node_modules/mona-dish/src/main/typescript/DomQuery.ts","webpack://jsf.js_next_gen/./node_modules/mona-dish/src/main/typescript/Es2019Array.ts","webpack://jsf.js_next_gen/./node_modules/mona-dish/src/main/typescript/Global.ts","webpack://jsf.js_next_gen/./node_modules/mona-dish/src/main/typescript/Lang.ts","webpack://jsf.js_next_gen/./node_modules/mona-dish/src/main/typescript/Monad.ts","webpack://jsf.js_next_gen/./node_modules/mona-dish/src/main/typescript/SourcesCollectors.ts","webpack://jsf.js_next_gen/./node_modules/mona-dish/src/main/typescript/XmlQuery.ts","webpack://jsf.js_next_gen/./node_modules/mona-dish/src/main/typescript/index_core.ts","webpack://jsf.js_next_gen/./src/main/typescript/api/_api.ts","webpack://jsf.js_next_gen/./src/main/typescript/impl/AjaxImpl.ts","webpack://jsf.js_next_gen/./src/main/typescript/impl/PushImpl.ts","webpack://jsf.js_next_gen/./src/main/typescript/impl/core/Const.ts","webpack://jsf.js_next_gen/./src/main/typescript/impl/core/ImplTypes.ts","webpack://jsf.js_next_gen/./src/main/typescript/impl/i18n/Messages.ts","webpack://jsf.js_next_gen/./src/main/typescript/impl/util/Assertions.ts","webpack://jsf.js_next_gen/./src/main/typescript/impl/util/AsyncQueue.ts","webpack://jsf.js_next_gen/./src/main/typescript/impl/util/ExtDomQuery.ts","webpack://jsf.js_next_gen/./src/main/typescript/impl/util/FileUtils.ts","webpack://jsf.js_next_gen/./src/main/typescript/impl/util/HiddenInputBuilder.ts","webpack://jsf.js_next_gen/./src/main/typescript/impl/util/Lang.ts","webpack://jsf.js_next_gen/./src/main/typescript/impl/xhrCore/ErrorData.ts","webpack://jsf.js_next_gen/./src/main/typescript/impl/xhrCore/EventData.ts","webpack://jsf.js_next_gen/./src/main/typescript/impl/xhrCore/RequestDataResolver.ts","webpack://jsf.js_next_gen/./src/main/typescript/impl/xhrCore/ResonseDataResolver.ts","webpack://jsf.js_next_gen/./src/main/typescript/impl/xhrCore/Response.ts","webpack://jsf.js_next_gen/./src/main/typescript/impl/xhrCore/ResponseProcessor.ts","webpack://jsf.js_next_gen/./src/main/typescript/impl/xhrCore/XhrFormData.ts","webpack://jsf.js_next_gen/./src/main/typescript/impl/xhrCore/XhrRequest.ts","webpack://jsf.js_next_gen/./src/main/typescript/myfaces/OamSubmit.ts","webpack://jsf.js_next_gen/webpack/bootstrap","webpack://jsf.js_next_gen/webpack/runtime/global","webpack://jsf.js_next_gen/./src/main/typescript/api/faces.ts"],"sourcesContent":["/*!\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http:// www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Config, Optional, ValueEmbedder} from \"./Monad\";\nimport {XMLQuery} from \"./XmlQuery\";\n\nimport {ICollector, IStreamDataSource, ITERATION_STATUS} from \"./SourcesCollectors\";\nimport {Lang} from \"./Lang\";\nimport {_global$} from \"./Global\";\nimport {Es2019Array} from \"./Es2019Array\";\nimport trim = Lang.trim;\n\nimport isString = Lang.isString;\nimport eqi = Lang.equalsIgnoreCase;\nimport objToArray = Lang.objToArray;\n\ndeclare var ownerDocument: any;\n\n/**\n * in order to poss custom parameters we need to extend the mutation observer init\n */\nexport interface WAIT_OPTS extends MutationObserverInit {\n timeout?: number;\n /**\n * interval on non legacy browsers\n */\n interval?: number;\n}\n\n\n/**\n *\n * // - submit checkboxes and radio inputs only if checked\n if ((tagName != \"select\" && elemType != \"button\"\n && elemType != \"reset\" && elemType != \"submit\" && elemType != \"image\")\n && ((elemType != \"checkbox\" && elemType != \"radio\"\n */\n\nenum ALLOWED_SUBMITTABLE_ELEMENTS {\n SELECT = \"select\",\n BUTTON = \"button\",\n SUBMIT = \"submit\",\n RESET = \"reset\",\n IMAGE = \"image\",\n RADIO = \"radio\",\n CHECKBOX = \"checkbox\"\n\n}\n\n/**\n * helper to fix a common problem that a system has to wait, until a certain condition is reached.\n * Depending on the browser this uses either the Mutation Observer or a semi compatible interval as fallback.\n * @param root the root DomQuery element to start from\n * @param condition the condition lambda to be fulfilled\n * @param options options for the search\n */\nfunction waitUntilDom(root: DomQuery, condition: (element: DomQuery) => boolean, options: WAIT_OPTS = {\n attributes: true,\n childList: true,\n subtree: true,\n timeout: 500,\n interval: 100\n}): Promise<DomQuery> {\n return new Promise<DomQuery>((success, error) => {\n let observer: MutationObserver = null;\n const MUT_ERROR = new Error(\"Mutation observer timeout\");\n\n // we do the same but for now ignore the options on the dom query\n // we cannot use absent here, because the condition might search for an absent element\n function findElement(root: DomQuery, condition: (element: DomQuery) => boolean): DomQuery | null {\n let found = null;\n if (!!condition(root)) {\n return root;\n }\n if (options.childList) {\n found = (condition(root)) ? root : root.childNodes.filter(item => condition(item)).first().value.value;\n } else if (options.subtree) {\n found = (condition(root)) ? root : root.querySelectorAll(\" * \").filter(item => condition(item)).first().value.value;\n } else {\n found = (condition(root)) ? root : null;\n }\n return found;\n }\n\n let foundElement = root;\n if (!!(foundElement = findElement(foundElement, condition))) {\n success(new DomQuery(foundElement));\n return;\n }\n\n if ('undefined' != typeof MutationObserver) {\n const mutTimeout = setTimeout(() => {\n observer.disconnect();\n return error(MUT_ERROR);\n }, options.timeout);\n\n const callback: MutationCallback = (mutationList: MutationRecord[]) => {\n const found = new DomQuery(mutationList.map((mut) => mut.target)).filter(item => condition(item)).first();\n if (found.isPresent()) {\n clearTimeout(mutTimeout);\n observer.disconnect();\n success(new DomQuery(found || root));\n }\n }\n observer = new MutationObserver(callback);\n\n // browsers might ignore it, but we cannot break the api in the case\n // hence no timeout is passed\n let observableOpts = {...options};\n delete observableOpts.timeout;\n root.eachElem(item => {\n observer.observe(item, observableOpts)\n })\n } else { // fallback for legacy browsers without mutation observer\n\n let interval = setInterval(() => {\n let found = findElement(root, condition);\n if (!!found) {\n if (timeout) {\n clearTimeout(timeout);\n clearInterval(interval);\n interval = null;\n }\n success(new DomQuery(found || root));\n }\n }, options.interval);\n let timeout = setTimeout(() => {\n if (interval) {\n clearInterval(interval);\n error(MUT_ERROR);\n }\n }, options.timeout)\n\n }\n });\n}\n\nexport class ElementAttribute extends ValueEmbedder<string> {\n\n constructor(private element: DomQuery, private name: string, private defaultVal: string = null) {\n super(element, name);\n }\n\n get value(): string {\n let val: Element[] = this.element.get(0).orElse(...[]).values;\n if (!val.length) {\n return this.defaultVal;\n }\n return val[0].getAttribute(this.name);\n }\n\n set value(value: string) {\n let val: Element[] = this.element.get(0).orElse(...[]).values;\n for (let cnt = 0; cnt < val.length; cnt++) {\n val[cnt].setAttribute(this.name, value);\n }\n val[0].setAttribute(this.name, value);\n }\n\n protected getClass(): any {\n return ElementAttribute;\n }\n\n static fromNullable<ElementAttribute, T>(value?: any, valueKey: string = \"value\"): ElementAttribute {\n return <any>new ElementAttribute(value, valueKey);\n }\n\n}\n\nexport class Style extends ValueEmbedder<string> {\n\n constructor(private element: DomQuery, private name: string, private defaultVal: string = null) {\n super(element, name);\n }\n\n get value(): string {\n let val: Element[] = this.element.values;\n if (!val.length) {\n return this.defaultVal;\n }\n return (val[0] as HTMLElement).style[this.name];\n }\n\n set value(value: string) {\n let val: HTMLElement[] = this.element.values as HTMLElement[];\n for (let cnt = 0; cnt < val.length; cnt++) {\n val[cnt].style[this.name] = value;\n }\n }\n\n protected getClass(): any {\n return ElementAttribute;\n }\n\n static fromNullable<ElementAttribute, T>(value?: any, valueKey: string = \"value\"): ElementAttribute {\n return <any>new ElementAttribute(value, valueKey);\n }\n\n}\n\n/**\n * small helper for the specialized jsf case\n * @constructor\n */\nconst DEFAULT_WHITELIST = () => {\n return true;\n};\n\ninterface IDomQuery {\n /**\n * reference to the systems global object\n * (globalThis, window, global, depending on the environment)\n */\n readonly global: any;\n /**\n * reads the first element if it exists and returns an optional\n */\n readonly value: Optional<Element>;\n /**\n * All elements as array\n */\n readonly values: Element[];\n /**\n * returns the id as settable value (See also ValueEmbedder)\n */\n readonly id: ValueEmbedder<string>;\n /**\n * returns the length of embedded nodes (top level)\n */\n readonly length: number;\n /**\n * the tag name of the first element\n */\n readonly tagName: Optional<string>;\n /**\n * the node name of the first element\n */\n readonly nodeName: Optional<string>;\n /**\n * the type of the first element\n */\n readonly type: Optional<string>;\n /**\n * The name as changeable value\n */\n readonly name: ValueEmbedder<string>;\n /**\n * The value in case of inputs as changeable value\n */\n readonly inputValue: ValueEmbedder<string | boolean>;\n\n /**\n * accumulated top element offsetWidth\n */\n readonly offsetWidth: number;\n /**\n * accumulated top element offsetHeight\n */\n readonly offsetHeight: number;\n /**\n * accumulated top element offsetLeft\n */\n readonly offsetLeft: number;\n /**\n * accumulated top element offsetTop\n */\n readonly offsetTop: number;\n\n\n /**\n * abbreviation for inputValue\\.value to make\n * the code terser\n */\n val: string | boolean;\n\n /**\n * the underlying form elements as DomQuery object\n */\n readonly elements: DomQuery;\n /**\n * settable flag for disabled\n */\n disabled: boolean;\n /**\n * The child nodes of this node collection as readonly attribute\n */\n readonly childNodes: DomQuery;\n /**\n * an early stream representation for this DomQuery\n */\n readonly stream: any;\n /**\n * lazy stream representation for this DomQuery\n */\n readonly lazyStream: any;\n /**\n * transform this node collection to an array\n */\n readonly asArray: Array<DomQuery>;\n\n /**\n * inner html property\n * setter and getter which works directly on strings\n */\n innerHTML: string;\n\n /**\n * same as innerHTML\n * will be removed once\n * my code is transitioned\n * @deprecated do not use anymore, user innerHTML instead\n */\n innerHtml: string;\n\n /**\n * convenience for dq.id.value to make the code a little bit tighter\n */\n nodeId: string;\n\n /**\n * returns true if the elements have the tag *tagName* as tag embedded ( highest level )\n * @param tagName\n */\n isTag(tagName: string): boolean;\n\n /**\n * returns the nth element as DomQuery\n * from the internal elements\n * note if you try to reach a non-existing element position\n * you will get back an absent entry\n *\n * @param index the nth index\n */\n get(index: number): DomQuery;\n\n /**\n * returns the nth element as optional of an Element object\n * @param index the number from the index\n * @param defaults the default value if the index is overrun default Optional\\.absent\n */\n getAsElem(index: number, defaults: Optional<any>): Optional<Element>;\n\n /**\n * returns the value array< of all elements\n */\n allElems(): Array<Element>;\n\n /**\n * absent no values reached?\n */\n isAbsent(): boolean;\n\n /**\n * should make the code clearer\n * note if you pass a function\n * this refers to the active DomQuery object\n */\n isPresent(presentRunnable ?: (elem ?: DomQuery) => void): boolean;\n\n /**\n * should make the code clearer\n * note if you pass a function\n * this refers to the active DomQuery object\n *\n *\n * @param presentRunnable\n */\n ifPresentLazy(presentRunnable: (elem ?: DomQuery) => void): DomQuery;\n\n /**\n * remove all affected nodes from this query object from the dom tree\n */\n delete(): void;\n\n /**\n * query selector all on the existing dom query object\n *\n * @param selector the standard selector\n * @return a DomQuery with the results\n */\n querySelectorAll(selector): DomQuery;\n\n\n /**\n * closest, walks up the dom tree to fid the closest element to match\n *\n * @param selector the standard selector\n * @return a DomQuery with the results\n */\n querySelectorAll(selector): DomQuery;\n\n /**\n * core byId method\n * @param id the id to search for\n * @param includeRoot also match the root element?\n */\n byId(id: string, includeRoot?: boolean): DomQuery;\n\n /**\n * same as byId just for the tag name\n * @param tagName\n * @param includeRoot\n */\n byTagName(tagName: string, includeRoot ?: boolean): DomQuery;\n\n /**\n * attr accessor, usage myQuery.attr(\"class\").value = \"bla\"\n * or let value myQuery.attr(\"class\").value\n * @param attr the attribute to set\n * @param defaultValue the default value in case nothing is presented (defaults to null)\n */\n attr(attr: string, defaultValue: string): ElementAttribute;\n\n /**\n * style accessor\n * @param defaultValue the default value in case nothing is presented (defaults to null)\n * @param cssProperty\n */\n style(cssProperty: string, defaultValue: string): Style;\n\n /**\n * Checks for an existing class in the class attributes\n *\n * @param clazz the class to search for\n */\n hasClass(clazz: string): boolean;\n\n /**\n * appends a class string if not already in the element(s)\n *\n * @param clazz the style class to append\n */\n addClass(clazz: string): DomQuery;\n\n /**\n * remove the style class if in the class definitions\n *\n * @param clazz\n */\n removeClass(clazz: string): DomQuery;\n\n /**\n * checks whether we have a multipart element in our children\n */\n isMultipartCandidate(): boolean;\n\n /**\n * innerHtml\n * equivalent to jQueries html\n * as setter the html is set and the\n * DomQuery is given back\n * as getter the html string is returned\n *\n * @param newInnerHTML\n */\n html(newInnerHTML?: string): DomQuery | Optional<string>;\n\n /**\n * dispatch event on all children\n * just a delegated dispatchEvent from the standard\n * dom working on all queried elements in the monad level\n *\n * @param evt the event to be dispatched\n */\n dispatchEvent(evt: Event): DomQuery;\n\n /**\n * easy node traversal, you can pass\n * a set of node selectors which are joined as direct children\n *\n * Note! The root nodes are not in the getIf, those are always the child nodes\n *\n * @param nodeSelector\n */\n getIf(...nodeSelector: Array<string>): DomQuery;\n\n /**\n * iterate over each element and perform something on the element\n * (Dom element is passed instead of DomQuery)\n * @param func\n */\n eachElem(func: (item: Element, cnt?: number) => any): DomQuery;\n\n /**\n * perform an operation on the first element\n * returns a DomQuery on the first element only\n * @param func\n */\n firstElem(func: (item: Element, cnt?: number) => any): DomQuery;\n\n /**\n * perform an operation on the first element\n * returns a DomQuery on the first element only\n * @param func\n */\n lastElem(func: (item: Element, cnt?: number) => any): DomQuery;\n\n /**\n * same as eachElem, but a DomQuery object is passed down\n *\n * @param func\n */\n each(func: (item: DomQuery, cnt?: number) => any): DomQuery;\n\n /**\n * returns a new dom query containing only the first element max\n *\n * @param func a an optional callback function to perform an operation on the first element\n */\n first(func: (item: DomQuery, cnt?: number) => any): DomQuery;\n\n\n /**\n * returns a new dom query containing only the first element max\n *\n * @param func a an optional callback function to perform an operation on the first element\n */\n last(func: (item: DomQuery, cnt?: number) => any): DomQuery;\n\n /**\n * filter function which filters a subset\n *\n * @param func\n */\n filter(func: (item: DomQuery) => boolean): DomQuery;\n\n /**\n * global eval head appendix method\n * no other methods are supported anymore\n * @param code the code to be evaluated\n * @param nonce optional nonce key for higher security\n */\n globalEval(code: string, nonce ?: string): DomQuery;\n\n /**\n * Runs an eval and keeps the evaluated code in the head\n * This is a corner condition, where we want to update the head with custom\n * code and leave the code in (instead of deleting ig)\n *\n * @param code the code to be evaluated\n * @param nonce optional nonce key for higher security\n */\n globalEvalSticky(code: string, nonce ?: string): DomQuery;\n\n /**\n * detaches a set of nodes from their parent elements\n * in a browser independent manner\n * @return {DomQuery} DomQuery of nodes with the detached dom nodes\n */\n detach(): DomQuery;\n\n /**\n * appends the current set of elements\n * to the element or first element passed via elem\n * @param elem\n */\n appendTo(elem: DomQuery | string): DomQuery;\n\n /**\n * appends the passed elements to our existing queries\n * note, double appends can happen if you are not careful\n *\n * @param elem to append\n */\n append(elem: DomQuery): DomQuery;\n\n /**\n * replace convenience function replaces the domquery elements with the\n * elements passed as parameter\n * @param toReplace the replacement elements\n * @return a reference on the replacement elements\n */\n replace(toReplace: DomQuery): DomQuery;\n\n /**\n * appends the passed elements to our existing queries\n * note, double appends can happen if you are not careful\n *\n * @param elem to append\n */\n prepend(elem: DomQuery): DomQuery;\n\n /**\n * prepend equivalent to appendTo\n *\n * @param elem the element to prepend to\n */\n prependTo(elem: DomQuery): DomQuery;\n\n /**\n * loads and evaluates a script from a source uri\n *\n * @param src the source to be loaded and evaluated\n * @param delay in milliseconds execution default (0 == no delay)\n * @param charSet\n */\n loadScriptEval(src: string, delay: number, charSet: string): void;\n\n /**\n * insert toInsert after the current element\n *\n * @param toInsert an array of DomQuery objects\n */\n insertAfter(...toInsert: Array<DomQuery>): DomQuery;\n\n /**\n * inserts the elements before the current element\n *\n * @param toInsert\n */\n insertBefore(...toInsert: Array<DomQuery>): DomQuery;\n\n /**\n * in case the DomQuery is pointing to nothing the else value is taken into consideration\n * als alternative\n *\n * @param elseValue the else value\n */\n orElse(...elseValue: any): DomQuery;\n\n /**\n * the same with lazy evaluation for cases where getting the else value\n * is a heavy operation\n *\n * @param func the else provider function\n */\n orElseLazy(func: () => any): DomQuery;\n\n\n /**\n * find all parents in the hierarchy for which the selector matches\n * @param selector\n */\n allParents(selector: string): DomQuery;\n\n /**\n * first parents with a matching selector\n * @param selector\n */\n firstParent(selector: string): DomQuery;\n\n /**\n * all parents until the selector match stops\n * @param selector\n */\n parentsWhileMatch(selector: string): DomQuery;\n\n\n /**\n * the parent of the elements\n */\n parent(): DomQuery;\n\n /**\n * copy all attributes of sourceItem to this DomQuery items\n *\n * @param sourceItem the source item to copy over (can be another DomQuery or a parsed XML Query item)\n */\n copyAttrs(sourceItem: DomQuery | XMLQuery): DomQuery;\n\n /**\n * outerHTML convenience method\n * browsers only support innerHTML but\n * for instance for your jsf.js we have a full\n * replace pattern which needs outerHTML processing\n *\n * @param markup\n * @param runEmbeddedScripts\n * @param runEmbeddedCss\n */\n outerHTML(markup: string, runEmbeddedScripts ?: boolean, runEmbeddedCss ?: boolean): DomQuery;\n\n /**\n * Run through the given nodes in the DomQuery execute the inline scripts\n * @param sticky if set to true the element must be left in the head after eval default === false\n * @param whiteListed: optional whitelist function which can filter out script tags which are not processed\n * defaults to the standard jsf.js exclusion (we use this code for myfaces)\n */\n runScripts(sticky?: boolean, whiteListed?: (val: string) => boolean): DomQuery;\n\n /**\n * runs the embedded css\n */\n runCss(): DomQuery;\n\n /**\n * fires a click event on the underlying dom elements\n */\n click(): DomQuery;\n\n /**\n * adds an event listener\n *\n * @param type\n * @param listener\n * @param options\n */\n addEventListener(type: string, listener: (evt: Event) => void, options?: boolean | EventListenerOptions): DomQuery;\n\n /**\n * removes an event listener\n *\n * @param type\n * @param listener\n * @param options\n */\n removeEventListener(type: string, listener: (evt: Event) => void, options?: boolean | EventListenerOptions): DomQuery;\n\n /**\n * fires an event\n */\n fireEvent(eventName: string): void;\n\n /*\n * pushes in optionally a new textContent, and/or returns the current text content\n */\n textContent(joinString?: string): string;\n\n /*\n * pushes in optionally a new innerText, and/or returns the current innerText\n */\n innerText(joinString?: string): string;\n\n /**\n * encodes all input elements properly into respective\n * config entries, this can be used\n * for legacy systems, for newer use-cases, use the\n * HTML5 Form class which all newer browsers provide\n *\n * @param toMerge optional config which can be merged in\n * @return a copy pf\n */\n encodeFormElement(toMerge): Config;\n\n /**\n * fetches the sub-nodes from ... to..\n * @param from\n * @param to\n */\n subNodes(from: number, to?: number): DomQuery;\n\n\n /**\n * attach shadow elements\n * 1:1 mapping from attach shadow\n *\n * @param modeParams\n */\n attachShadow(modeParams: { [key: string]: string }): DomQuery\n\n\n /**\n * wait until a condition on the dom is reached\n *\n * @return a promise on the affected elements where the condition\n * @throws an error in case of a timeout\n */\n waitUntilDom(condition: (element: DomQuery) => boolean, options: WAIT_OPTS): Promise<DomQuery>;\n\n // observable: Observable<DomQuery>;\n\n // observableElem: Observable<Element>;\n}\n\n/**\n * Monadic DomNode representation, ala jquery\n * This is a thin wrapper over querySelectorAll\n * to get slim monadic support\n * to reduce implementation code on the users side.\n * This is vital for frameworks which want to rely on\n * plain dom but still do not want to lose\n * the reduced code footprint of querying dom trees and traversing\n * by using functional patterns.\n *\n * Also, a few convenience methods are added to reduce\n * the code footprint of standard dom processing\n * operations like eval\n *\n * in most older systems\n * Note parts of this code still stem from the Dom.js I have written 10 years\n * ago, those parts look a bit ancient and will be replaced over time.\n *\n */\nexport class DomQuery implements IDomQuery, IStreamDataSource<DomQuery>, Iterable<DomQuery> {\n\n static absent = new DomQuery();\n\n /**\n * reference to the environmental global object\n */\n static global = _global$;\n\n private rootNode: Array<Element> = [];\n\n pos = -1;\n\n constructor(...rootNode: Array<Element | ShadowRoot | DomQuery | Document | Array<any> | string>) {\n\n if (Optional.fromNullable(rootNode).isAbsent() || !rootNode.length) {\n return;\n } else {\n // we need to flatten out the arrays\n\n for (let cnt = 0; cnt < rootNode.length; cnt++) {\n if (!rootNode[cnt]) {\n // we skip possible null entries which can happen in\n // certain corner conditions due to the constructor re-wrapping single elements into arrays.\n } else if (isString(rootNode[cnt])) {\n let foundElement = DomQuery.querySelectorAll(<string>rootNode[cnt]);\n if (!foundElement.isAbsent()) {\n rootNode.push(...foundElement.values)\n }\n } else if (rootNode[cnt] instanceof DomQuery) {\n this.rootNode.push(...(<any>rootNode[cnt]).values);\n } else {\n this.rootNode.push(<any>rootNode[cnt]);\n }\n }\n }\n }\n\n\n /**\n * returns the first element\n */\n get value(): Optional<Element> {\n return this.getAsElem(0);\n }\n\n get values(): Element[] {\n return this.allElems();\n }\n\n get global(): any {\n return _global$;\n }\n\n get stream(): any {\n throw Error(\"Not implemented, include Stream.ts for this to work\")\n }\n\n get lazyStream(): any {\n throw Error(\"Not implemented, include Stream.ts for this to work\")\n }\n\n /**\n * returns the id of the first element\n */\n get id(): ValueEmbedder<string> {\n return new ElementAttribute(this.get(0), \"id\");\n }\n\n /**\n * length of the entire query set\n */\n get length(): number {\n return this.rootNode.length\n }\n\n /**\n * convenience method for tagName\n */\n get tagName(): Optional<string> {\n return <Optional<string>>this.getAsElem(0).getIf(\"tagName\");\n }\n\n /**\n * convenience method for nodeName\n */\n get nodeName(): Optional<string> {\n return <Optional<string>>this.getAsElem(0).getIf(\"nodeName\");\n }\n\n isTag(tagName: string): boolean {\n return !this.isAbsent()\n && (this.nodeName.orElse(\"__none___\")\n .value.toLowerCase() == tagName.toLowerCase()\n || this.tagName.orElse(\"__none___\")\n .value.toLowerCase() == tagName.toLowerCase()\n )\n }\n\n /**\n * convenience property for type\n *\n * returns null in case of no type existing otherwise\n * the type of the first element\n */\n get type(): Optional<string> {\n return this.getAsElem(0).getIf(\"type\");\n }\n\n /**\n * convenience property for name\n *\n * returns null in case of no type existing otherwise\n * the name of the first element\n */\n get name(): ValueEmbedder<string> {\n return new ValueEmbedder(this.getAsElem(0).value, \"name\");\n }\n\n /**\n * convenience property for value\n *\n * returns null in case of no type existing otherwise\n * the value of the first element\n */\n get inputValue(): ValueEmbedder<string | boolean> {\n if (this.getAsElem(0).getIf(\"value\").isPresent()) {\n return new ValueEmbedder<string>(this.getAsElem(0).value);\n } else {\n return <any>ValueEmbedder.absent;\n }\n }\n\n get val(): string | boolean {\n return this.inputValue.value;\n }\n\n set val(value: string | boolean) {\n this.inputValue.value = value;\n }\n\n get nodeId(): string {\n return this.id.value;\n }\n\n set nodeId(value: string) {\n this.id.value = value;\n }\n\n get checked(): boolean {\n return new Es2019Array(...this.values).every(el => !!(<any>el).checked);\n }\n\n set checked(newChecked: boolean) {\n this.eachElem(el => (<any>el).checked = newChecked);\n }\n\n get elements(): DomQuery {\n // a simple querySelectorAll should suffice\n return this.querySelectorAll(\"input, checkbox, select, textarea, fieldset\");\n }\n\n get deepElements(): DomQuery {\n let elemStr = \"input, select, textarea, checkbox, fieldset\";\n return this.querySelectorAllDeep(elemStr);\n }\n\n /**\n * a deep search which treats the single isolated shadow dom areas\n * separately and runs the query on each shadow dom\n * @param queryStr\n */\n querySelectorAllDeep(queryStr: string): DomQuery {\n let found: Array<DomQuery> = [];\n let queryRes = this.querySelectorAll(queryStr);\n if (queryRes.length) {\n found.push(queryRes);\n }\n let shadowRoots = this.querySelectorAll(\"*\").shadowRoot;\n if (shadowRoots.length) {\n let shadowRes = shadowRoots.querySelectorAllDeep(queryStr);\n if (shadowRes.length) {\n found.push(shadowRes);\n }\n }\n return new DomQuery(...found);\n }\n\n\n /**\n * disabled flag\n */\n get disabled(): boolean {\n return this.attr(\"disabled\").isPresent();\n }\n\n set disabled(disabled: boolean) {\n // this.attr(\"disabled\").value = disabled + \"\";\n if (!disabled) {\n this.removeAttribute(\"disabled\");\n } else {\n this.attr(\"disabled\").value = \"disabled\";\n }\n\n }\n\n removeAttribute(name: string) {\n this.eachElem(item => item.removeAttribute(name));\n }\n\n get childNodes(): DomQuery {\n let childNodeArr: Array<Element> = [];\n this.eachElem((item: Element) => {\n childNodeArr = childNodeArr.concat(objToArray(item.childNodes));\n });\n return new DomQuery(...childNodeArr);\n }\n\n\n get asArray(): DomQuery[] {\n // filter not supported by IE11\n let items = new Es2019Array(...this.rootNode).filter(item => {\n return item != null\n }).map(item => {\n return DomQuery.byId(item)\n });\n return items as DomQuery[];\n }\n\n get offsetWidth(): number {\n return new Es2019Array(...this.rootNode)\n .filter(item => item != null)\n .map(elem => (elem as HTMLElement).offsetWidth)\n .reduce((accumulate, incoming) => accumulate + incoming, 0);\n }\n\n get offsetHeight(): number {\n return new Es2019Array(...this.rootNode)\n .filter(item => item != null)\n .map(elem => (elem as HTMLElement).offsetHeight)\n .reduce((accumulate, incoming) => accumulate + incoming, 0);\n }\n\n get offsetLeft(): number {\n return new Es2019Array(...this.rootNode)\n .filter(item => item != null)\n .map(elem => (elem as HTMLElement).offsetLeft)\n .reduce((accumulate, incoming) => accumulate + incoming, 0);\n }\n\n get offsetTop(): number {\n return new Es2019Array(this.rootNode)\n .filter(item => item != null)\n .map(elem => (elem as any).offsetTop)\n .reduce((accumulate, incoming) => accumulate + incoming, 0);\n }\n\n get asNodeArray(): Array<Element> {\n return new Es2019Array(...this.rootNode.filter(item => item != null));\n }\n\n\n static querySelectorAllDeep(selector: string) {\n return new DomQuery(document).querySelectorAllDeep(selector);\n }\n\n /**\n * easy query selector all producer\n *\n * @param selector the selector\n * @returns a results dom query object\n */\n static querySelectorAll(selector: string): DomQuery {\n if (selector.indexOf(\"/shadow/\") != -1) {\n return new DomQuery(document)._querySelectorAllDeep(selector);\n } else {\n return new DomQuery(document)._querySelectorAll(selector);\n }\n }\n\n /**\n * byId producer\n *\n * @param selector id\n * @param deep true if you want to go into shadow areas\n * @return a DomQuery containing the found elements\n */\n static byId(selector: string | DomQuery | Element, deep = false): DomQuery {\n if (isString(selector)) {\n return (!deep) ? new DomQuery(document).byId(<string>selector) : new DomQuery(document).byIdDeep(<string>selector);\n } else {\n return new DomQuery(<any>selector);\n }\n }\n\n /**\n * byTagName producer\n *\n * @param selector name\n * @return a DomQuery containing the found elements\n */\n static byTagName(selector: string | DomQuery | Element): DomQuery {\n if (isString(selector)) {\n return new DomQuery(document).byTagName(<string>selector);\n } else {\n return new DomQuery(<any>selector);\n }\n }\n\n static globalEval(code: string, nonce?: string): DomQuery {\n return new DomQuery(document).globalEval(code, nonce);\n }\n\n static globalEvalSticky(code: string, nonce?: string): DomQuery {\n return new DomQuery(document).globalEvalSticky(code, nonce);\n }\n\n /**\n * builds the ie nodes properly in a placeholder\n * and bypasses a non script insert bug that way\n * @param markup the markup code to be executed from\n */\n static fromMarkup(markup: string): DomQuery {\n\n // https:// developer.mozilla.org/de/docs/Web/API/DOMParser license creative commons\n const doc = document.implementation.createHTMLDocument(\"\");\n markup = trim(markup);\n let lowerMarkup = markup.toLowerCase();\n if (lowerMarkup.search(/<!doctype[^\\w\\-]+/gi) != -1 ||\n lowerMarkup.search(/<html[^\\w\\-]+/gi) != -1 ||\n lowerMarkup.search(/<head[^\\w\\-]+/gi) != -1 ||\n lowerMarkup.search(/<body[^\\w\\-]+/gi) != -1) {\n doc.documentElement.innerHTML = markup;\n return new DomQuery(doc.documentElement);\n } else {\n let startsWithTag = function (str: string, tagName: string) {\n let tag1 = [\"<\", tagName, \">\"].join(\"\");\n let tag2 = [\"<\", tagName, \" \"].join(\"\");\n return (str.indexOf(tag1) == 0) || (str.indexOf(tag2) == 0);\n };\n\n let dummyPlaceHolder = new DomQuery(document.createElement(\"div\"));\n\n // table needs special treatment due to the browsers auto creation\n if (startsWithTag(lowerMarkup, \"thead\") || startsWithTag(lowerMarkup, \"tbody\")) {\n dummyPlaceHolder.html(`<table>${markup}</table>`);\n return dummyPlaceHolder.querySelectorAll(\"table\").get(0).childNodes.detach();\n } else if (startsWithTag(lowerMarkup, \"tfoot\")) {\n dummyPlaceHolder.html(`<table><thead></thead><tbody><tbody${markup}</table>`);\n return dummyPlaceHolder.querySelectorAll(\"table\").get(2).childNodes.detach();\n } else if (startsWithTag(lowerMarkup, \"tr\")) {\n dummyPlaceHolder.html(`<table><tbody>${markup}</tbody></table>`);\n return dummyPlaceHolder.querySelectorAll(\"tbody\").get(0).childNodes.detach();\n } else if (startsWithTag(lowerMarkup, \"td\")) {\n dummyPlaceHolder.html(`<table><tbody><tr>${markup}</tr></tbody></table>`);\n return dummyPlaceHolder.querySelectorAll(\"tr\").get(0).childNodes.detach();\n }\n\n dummyPlaceHolder.html(markup);\n return dummyPlaceHolder.childNodes.detach();\n }\n\n }\n\n /**\n * returns the nth element as DomQuery\n * from the internal elements\n * note if you try to reach a non-existing element position\n * you will get back an absent entry\n *\n * @param index the nth index\n */\n get(index: number): DomQuery {\n return (index < this.rootNode.length) ? new DomQuery(this.rootNode[index]) : DomQuery.absent;\n }\n\n\n /**\n * returns the nth element as optional of an Element object\n * @param index the number from the index\n * @param defaults the default value if the index is overrun default Optional\\.absent\n */\n getAsElem(index: number, defaults: Optional<any> = Optional.absent): Optional<Element> {\n return (index < this.rootNode.length) ? Optional.fromNullable(this.rootNode[index]) : defaults;\n }\n\n /**\n * returns the files from a given element\n * @param index\n */\n filesFromElem(index: number): Array<any> {\n return (index < this.rootNode.length) ? (<any>this.rootNode[index])?.files ? (<any>this.rootNode[index]).files : [] : [];\n }\n\n /**\n * returns the value array< of all elements\n */\n allElems(): Array<Element> {\n return this.rootNode;\n }\n\n /**\n * absent no values reached?\n */\n isAbsent(): boolean {\n return this.length == 0;\n }\n\n /**\n * should make the code clearer\n * note if you pass a function\n * this refers to the active DomQuery object\n */\n isPresent(presentRunnable ?: (elem ?: DomQuery) => void): boolean {\n let absent = this.isAbsent();\n if (!absent && presentRunnable) {\n presentRunnable.call(this, this)\n }\n return !absent;\n }\n\n /**\n * should make the code clearer\n * note if you pass a function\n * this refers to the active DomQuery object\n *\n *\n * @param presentRunnable\n */\n ifPresentLazy(presentRunnable: (elem ?: DomQuery) => void = function () {\n }): DomQuery {\n this.isPresent.call(this, presentRunnable);\n return this;\n }\n\n /**\n * remove all affected nodes from this query object from the dom tree\n */\n delete() {\n this.eachElem((node: Element) => {\n if (node.parentNode) {\n node.parentNode.removeChild(node);\n }\n });\n }\n\n querySelectorAll(selector): DomQuery {\n // We could merge both methods, but for now this is more readable\n if (selector.indexOf(\"/shadow/\") != -1) {\n return this._querySelectorAllDeep(selector);\n } else {\n return this._querySelectorAll(selector);\n }\n }\n\n closest(selector): DomQuery {\n // We could merge both methods, but for now this is more readable\n if (selector.indexOf(\"/shadow/\") != -1) {\n return this._closestDeep(selector);\n } else {\n return this._closest(selector);\n }\n }\n\n\n /**\n * core byId method\n * @param id the id to search for\n * @param includeRoot also match the root element?\n */\n byId(id: string, includeRoot?: boolean): DomQuery {\n let res: Array<DomQuery> = [];\n if (includeRoot) {\n res = res.concat(...\n new Es2019Array(...(this?.rootNode || []))\n .filter(((item) => id == item.id) as any)\n .map(item => new DomQuery(item))\n );\n }\n\n // for some strange kind of reason the # selector fails\n // on hidden elements we use the attributes match selector\n // that works\n res = res.concat(this.querySelectorAll(`[id=\"${id}\"]`));\n return new DomQuery(...res);\n }\n\n\n byIdDeep(id: string, includeRoot?: boolean): DomQuery {\n let res: Array<DomQuery> = [];\n if (includeRoot) {\n res = res.concat(\n new Es2019Array(...(this?.rootNode || []))\n .filter(item => id == item.id)\n .map(item => new DomQuery(item))\n );\n }\n\n let subItems = this.querySelectorAllDeep(`[id=\"${id}\"]`);\n if (subItems.length) {\n res.push(subItems);\n }\n\n return new DomQuery(...res);\n }\n\n /**\n * same as byId just for the tag name\n * @param tagName the tag-name to search for\n * @param includeRoot shall the root element be part of this search\n * @param deep do we also want to go into shadow dom areas\n */\n byTagName(tagName: string, includeRoot ?: boolean, deep ?: boolean): DomQuery {\n let res: Array<Element | DomQuery> = [];\n if (includeRoot) {\n res = new Es2019Array(...(this?.rootNode ?? []))\n .filter(element => element?.tagName == tagName)\n .reduce((reduction: any, item: Element) => reduction.concat([item]), res);\n }\n\n (deep) ? res.push(this.querySelectorAllDeep(tagName)) : res.push(this.querySelectorAll(tagName));\n return new DomQuery(...res);\n }\n\n /**\n * attr accessor, usage myQuery.attr(\"class\").value = \"bla\"\n * or let value myQuery.attr(\"class\").value\n * @param attr the attribute to set\n * @param defaultValue the default value in case nothing is presented (defaults to null)\n */\n attr(attr: string, defaultValue: string = null): ElementAttribute {\n return new ElementAttribute(this, attr, defaultValue);\n }\n\n style(cssProperty: string, defaultValue: string = null): Style {\n return new Style(this, cssProperty, defaultValue);\n }\n\n\n /**\n * Checks for an existing class in the class attributes\n *\n * @param clazz the class to search for\n */\n hasClass(clazz: string) {\n let hasIt = false;\n this.eachElem(node => {\n hasIt = node.classList.contains(clazz);\n if (hasIt) {\n return false;\n }\n });\n return hasIt;\n }\n\n /**\n * appends a class string if not already in the element(s)\n *\n * @param clazz the style class to append\n */\n addClass(clazz: string): DomQuery {\n this.eachElem(item => item.classList.add(clazz))\n return this;\n }\n\n /**\n * remove the style class if in the class definitions\n *\n * @param clazz\n */\n removeClass(clazz: string): DomQuery {\n this.eachElem(item => item.classList.remove(clazz));\n return this;\n }\n\n /**\n * checks whether we have a multipart element in our children\n * or are one\n */\n isMultipartCandidate(deep = false): boolean {\n const FILE_INPUT = \"input[type='file']\";\n return this.matchesSelector(FILE_INPUT) ||\n ((!deep) ? this.querySelectorAll(FILE_INPUT) :\n this.querySelectorAllDeep(FILE_INPUT)).first().isPresent();\n }\n\n /**\n * innerHtml\n * equivalent to jQueries html\n * as setter the html is set and the\n * DomQuery is given back\n * as getter the html string is returned\n *\n * @param newInnerHTML the inner html to be inserted\n */\n html(newInnerHTML?: string): DomQuery | Optional<string> {\n if (Optional.fromNullable(newInnerHTML).isAbsent()) {\n return this.isPresent() ? Optional.fromNullable(this.innerHTML) : Optional.absent;\n }\n this.innerHTML = newInnerHTML;\n\n return this;\n }\n\n /**\n * Standard dispatch event method, delegated from node\n */\n dispatchEvent(evt: Event): DomQuery {\n this.eachElem(elem => elem.dispatchEvent(evt));\n return this;\n }\n\n /**\n * abbreviation property to use innerHTML directly like on the dom tree\n * @param newInnerHTML the new inner html which should be attached to \"this\" domQuery\n */\n set innerHTML(newInnerHTML: string) {\n this.eachElem(elem => elem.innerHTML = newInnerHTML);\n }\n\n /**\n * getter abbreviation to use innerHTML directly\n */\n get innerHTML(): string {\n let retArr = [];\n this.eachElem(elem => retArr.push(elem.innerHTML));\n return retArr.join(\"\");\n }\n\n /**\n * since the dom allows both innerHTML and innerHtml we also have to implement both\n * @param newInnerHtml see above\n */\n set innerHtml(newInnerHtml: string) {\n this.innerHTML = newInnerHtml;\n }\n\n /**\n * same here, getter for allowing innerHtml directly\n */\n get innerHtml(): string {\n return this.innerHTML;\n }\n\n /**\n * filters the current dom query elements\n * upon a given selector\n *\n * @param selector\n */\n filterSelector(selector: string): DomQuery {\n let matched = [];\n\n this.eachElem(item => {\n if (this._mozMatchesSelector(item, selector)) {\n matched.push(item)\n }\n });\n return new DomQuery(...matched);\n }\n\n /**\n * checks whether any item in this domQuery level matches the selector\n * if there is one element only attached, as root the match is only\n * performed on this element.\n * @param selector\n */\n matchesSelector(selector: string): boolean {\n return this.asArray\n .some(item => this._mozMatchesSelector(item.getAsElem(0).value, selector));\n }\n\n /**\n * easy node traversal, you can pass\n * a set of node selectors which are joined as direct children\n *\n * Note!!! The root nodes are not in the getIf, those are always the child nodes\n *\n * @param nodeSelector\n */\n getIf(...nodeSelector: Array<string>): DomQuery {\n\n let selectorStage: DomQuery = this.childNodes;\n for (let cnt = 0; cnt < nodeSelector.length; cnt++) {\n selectorStage = selectorStage.filterSelector(nodeSelector[cnt]);\n if (selectorStage.isAbsent()) {\n return selectorStage;\n }\n }\n return selectorStage;\n }\n\n eachElem(func: (item: Element, cnt?: number) => any): DomQuery {\n\n for (let cnt = 0, len = this.rootNode.length; cnt < len; cnt++) {\n if (func(this.rootNode[cnt], cnt) === false) {\n break;\n }\n }\n return this;\n }\n\n firstElem(func: (item: Element, cnt?: number) => any = item => item): DomQuery {\n if (this.rootNode.length > 1) {\n func(this.rootNode[0], 0);\n }\n return this;\n }\n\n lastElem(func: (item: Element, cnt?: number) => any = item => item): DomQuery {\n if (this.rootNode.length > 1) {\n func(this.rootNode[this.rootNode.length - 1], 0);\n }\n return this;\n }\n\n each(func: (item: DomQuery, cnt?: number) => any): DomQuery {\n new Es2019Array(...this.rootNode)\n .forEach((item, cnt) => {\n // we could use a filter, but for the best performance we don´t\n if (item == null) {\n return;\n }\n return func(DomQuery.byId(item), cnt);\n });\n\n return this;\n }\n\n /**\n * replace convenience function, replaces one or more elements with\n * a set of elements passed as DomQuery\n * @param toReplace the replaced nodes as reference (original node has been replaced)\n */\n replace(toReplace: DomQuery): DomQuery {\n this.each(item => {\n let asElem = item.getAsElem(0).value;\n let parent = asElem.parentElement;\n let nextElement = asElem.nextElementSibling;\n let previousElement = asElem.previousElementSibling;\n if(nextElement != null) {\n new DomQuery(nextElement).insertBefore(toReplace);\n } else if(previousElement) {\n new DomQuery(previousElement).insertAfter(toReplace)\n } else {\n new DomQuery(parent).append(toReplace);\n }\n item.delete();\n });\n return toReplace;\n }\n\n /**\n * returns a new dom query containing only the first element max\n *\n * @param func a an optional callback function to perform an operation on the first element\n */\n first(func: (item: DomQuery, cnt?: number) => any = (item) => item): DomQuery {\n if (this.rootNode.length >= 1) {\n func(this.get(0), 0);\n return this.get(0);\n }\n return this;\n }\n\n /**\n * returns a new dom query containing only the first element max\n *\n * @param func a an optional callback function to perform an operation on the first element\n */\n last(func: (item: DomQuery, cnt?: number) => any = (item) => item): DomQuery {\n if (this.rootNode.length >= 1) {\n let lastNode = this.get(this.rootNode.length - 1);\n func(lastNode, 0);\n return lastNode;\n }\n return this;\n }\n\n /**\n * filter function which filters a subset\n *\n * @param func\n */\n filter(func: (item: DomQuery) => boolean): DomQuery {\n let reArr: Array<DomQuery> = [];\n this.each((item: DomQuery) => {\n func(item) ? reArr.push(item) : null;\n });\n return new DomQuery(...<any>reArr);\n }\n\n /**\n * global eval head appendix method\n * no other methods are supported anymore\n * @param code the code to be evaluated\n * @param nonce optional nonce key for higher security\n */\n globalEval(code: string, nonce ?: string): DomQuery {\n const head = document.getElementsByTagName(\"head\")?.[0]\n ?? document.documentElement.getElementsByTagName(\"head\")?.[0];\n const script = document.createElement(\"script\");\n if (nonce) {\n if ('undefined' != typeof script?.nonce) {\n script.nonce = nonce;\n } else {\n script.setAttribute(\"nonce\", nonce);\n }\n }\n script.type = \"text/javascript\";\n script.innerHTML = code;\n let newScriptElement = head.appendChild(script);\n head.removeChild(newScriptElement);\n return this;\n }\n\n /**\n * global eval head appendix method\n * no other methods are supported anymore\n * @param code the code to be evaluated\n * @param nonce optional nonce key for higher security\n */\n globalEvalSticky(code: string, nonce ?: string): DomQuery {\n let head = document.getElementsByTagName(\"head\")[0] || document.documentElement;\n let script = document.createElement(\"script\");\n this.applyNonce(nonce, script);\n script.type = \"text/javascript\";\n script.innerHTML = code;\n head.appendChild(script);\n return this;\n }\n\n /**\n * detaches a set of nodes from their parent elements\n * in a browser independent manner\n * @return {Array} an array of nodes with the detached dom nodes\n */\n detach(): DomQuery {\n this.eachElem((item: Element) => {\n item.parentNode.removeChild(item);\n });\n return this;\n }\n\n /**\n * appends the current set of elements\n * to the element or first element passed via elem\n * @param elem\n */\n appendTo(elem: DomQuery | string): DomQuery {\n if (Lang.isString(elem)) {\n this.appendTo(DomQuery.querySelectorAll(elem as string));\n return this;\n }\n this.eachElem((item) => {\n let value1: Element = <Element>(elem as DomQuery).getAsElem(0).orElseLazy(() => {\n return {\n appendChild: () => {\n }\n }\n }).value;\n value1.appendChild(item);\n });\n return this;\n }\n\n /**\n * loads and evaluates a script from a source uri\n *\n * @param src the source to be loaded and evaluated\n * @param delay in milliseconds execution default (0 == no delay)\n * @param nonce optional nonce value to allow increased security via nonce crypto token\n */\n loadScriptEval(src: string, delay: number = 0, nonce?: string) {\n this._loadScriptEval(false, src, delay, nonce);\n\n return this;\n }\n\n\n /**\n * loads and evaluates a script from a source uri\n *\n * @param src the source to be loaded and evaluated\n * @param delay in milliseconds execution default (0 == no delay)\n * @param nonce optional nonce parameter for increased security via nonce crypto token\n */\n loadScriptEvalSticky(src: string, delay: number = 0, nonce?: string) {\n this._loadScriptEval(true, src, delay, nonce);\n\n return this;\n }\n\n insertAfter(...toInsertParams: Array<DomQuery>): DomQuery {\n\n this.each(existingItem => {\n let existingElement = existingItem.getAsElem(0).value;\n let rootNode = existingElement.parentNode;\n for (let cnt = 0; cnt < toInsertParams.length; cnt++) {\n let nextSibling: Element = <any>existingElement.nextSibling;\n toInsertParams[cnt].eachElem(insertElem => {\n if (nextSibling) {\n rootNode.insertBefore(insertElem, nextSibling);\n existingElement = nextSibling;\n } else {\n rootNode.appendChild(insertElem);\n }\n });\n\n }\n });\n\n let res = [];\n res.push(this);\n res = res.concat(toInsertParams);\n return new DomQuery(...res);\n }\n\n insertBefore(...toInsertParams: Array<DomQuery>): DomQuery {\n this.each(existingItem => {\n let existingElement = existingItem.getAsElem(0).value;\n let rootNode = existingElement.parentNode;\n for (let cnt = 0; cnt < toInsertParams.length; cnt++) {\n toInsertParams[cnt].eachElem(insertElem => {\n rootNode.insertBefore(insertElem, existingElement);\n });\n }\n });\n let res = [];\n res.push(this);\n res = res.concat(toInsertParams);\n return new DomQuery(...res);\n }\n\n orElse(...elseValue: any): DomQuery {\n if (this.isPresent()) {\n return this;\n } else {\n return new DomQuery(...elseValue);\n }\n }\n\n orElseLazy(func: () => any): DomQuery {\n if (this.isPresent()) {\n return this;\n } else {\n return new DomQuery(func());\n }\n }\n\n /**\n * find all parents in the hierarchy for which the selector matches\n * @param selector\n */\n allParents(selector: string): DomQuery {\n let parent = this.parent();\n let ret = [];\n while(parent.isPresent()) {\n if(parent.matchesSelector(selector)) {\n ret.push(parent);\n }\n parent = parent.parent();\n }\n return new DomQuery(...ret);\n }\n\n /**\n * finds the first parent in the hierarchy for which the selector matches\n * @param selector\n */\n firstParent(selector: string): DomQuery {\n let parent = this.parent();\n while(parent.isPresent()) {\n if(parent.matchesSelector(selector)) {\n return parent;\n }\n parent = parent.parent();\n }\n return DomQuery.absent;\n }\n\n /**\n * fetches all parents as long as the filter criterium matches\n * @param selector\n */\n parentsWhileMatch(selector: string): DomQuery {\n const retArr: Array<DomQuery> = [];\n let parent = this.parent().filter(item => item.matchesSelector(selector));\n while(parent.isPresent()) {\n retArr.push(parent);\n parent = parent.parent().filter(item => item.matchesSelector(selector));\n }\n\n return new DomQuery(...retArr);\n }\n\n parent(): DomQuery {\n let ret = [];\n this.eachElem((item: Element) => {\n let parent = item.parentNode || (<any>item).host || item.shadowRoot;\n if (parent && ret.indexOf(parent) == -1) {\n ret.push(parent);\n }\n });\n\n return new DomQuery(...ret);\n }\n\n copyAttrs(sourceItem: DomQuery | XMLQuery): DomQuery {\n sourceItem.eachElem((sourceNode: Element) => {\n let attrs: Array<Attr> = objToArray(sourceNode.attributes);\n for (let item of attrs) {\n let value: string = item.value;\n let name: string = item.name;\n\n switch (name) {\n case \"id\":\n this.id.value = value;\n break;\n case \"disabled\":\n this.resolveAttributeHolder(\"disabled\").disabled = value;\n break;\n case \"checked\":\n this.resolveAttributeHolder(\"checked\").checked = value;\n break;\n default:\n this.attr(name).value = value;\n }\n }\n });\n return this;\n }\n\n /**\n * outerHTML convenience method\n * browsers only support innerHTML but\n * for instance for your jsf.js we have a full\n * replace pattern which needs outerHTML processing\n *\n * @param markup the markup which should replace the root element\n * @param runEmbeddedScripts if true the embedded scripts are executed\n * @param runEmbeddedCss if true the embedded css are executed\n * @param deep should this also work for shadow dom (run scripts etc...)\n */\n outerHTML(markup: string, runEmbeddedScripts ?: boolean, runEmbeddedCss ?: boolean, deep = false): DomQuery {\n if (this.isAbsent()) {\n return;\n }\n\n let focusElementId = document?.activeElement?.id;\n let caretPosition = (focusElementId) ? DomQuery.getCaretPosition(document.activeElement) : null;\n let nodes = DomQuery.fromMarkup(markup);\n let res = [];\n let toReplace = this.getAsElem(0).value;\n let firstInsert = nodes.get(0);\n let parentNode = toReplace.parentNode;\n let replaced = firstInsert.getAsElem(0).value;\n parentNode.replaceChild(replaced, toReplace);\n res.push(new DomQuery(replaced));\n // no replacement possible\n if (this.isAbsent()) {\n return this;\n }\n\n let insertAdditionalItems = [];\n\n if (nodes.length > 1) {\n insertAdditionalItems = insertAdditionalItems.concat(...nodes.values.slice(1));\n res.push(DomQuery.byId(replaced).insertAfter(new DomQuery(...insertAdditionalItems)));\n }\n\n if (runEmbeddedScripts) {\n this.runScripts();\n }\n if (runEmbeddedCss) {\n this.runCss();\n }\n\n let focusElement = DomQuery.byId(focusElementId);\n if (focusElementId && focusElement.isPresent() &&\n caretPosition != null && \"undefined\" != typeof caretPosition) {\n focusElement.eachElem(item => DomQuery.setCaretPosition(item, caretPosition));\n }\n\n return nodes;\n }\n\n /**\n * Run through the given nodes in the DomQuery execute the inline scripts\n * @param sticky if set to true the evaluated elements will stick to the head, default false\n * @param whitelisted: optional whitelist function which can filter out script tags which are not processed\n * defaults to the standard jsf.js exclusion (we use this code for myfaces)\n */\n runScripts(sticky = false, whitelisted: (val: string) => boolean = DEFAULT_WHITELIST): DomQuery {\n const evalCollectedScripts = (scriptsToProcess: { evalText: string, nonce: string }[]) => {\n if (scriptsToProcess.length) {\n // script source means we have to eval the existing\n // scripts before we run the 'include' command\n // this.globalEval(finalScripts.join(\"\\n\"));\n let joinedScripts = [];\n new Es2019Array(...scriptsToProcess).forEach(item => {\n if (!item.nonce) {\n joinedScripts.push(item.evalText)\n } else {\n if (joinedScripts.length) {\n this.globalEval(joinedScripts.join(\"\\n\"));\n joinedScripts.length = 0;\n }\n\n (!sticky) ?\n this.globalEval(item.evalText, item.nonce) :\n this.globalEvalSticky(item.evalText, item.nonce);\n }\n });\n if (joinedScripts.length) {\n (!sticky) ? this.globalEval(joinedScripts.join(\"\\n\")) :\n this.globalEvalSticky(joinedScripts.join(\"\\n\"));\n joinedScripts.length = 0;\n }\n\n scriptsToProcess = [];\n }\n return scriptsToProcess;\n }\n\n let finalScripts = [],\n allowedItemTypes = [\"\", \"script\", \"text/javascript\", \"text/ecmascript\", \"ecmascript\"],\n execScript = (item) => {\n let tagName = item.tagName;\n let itemType = (item?.type ?? '').toLowerCase();\n if (tagName &&\n eqi(tagName, \"script\") &&\n allowedItemTypes.indexOf(itemType) != -1) {\n let src = item.getAttribute('src');\n if ('undefined' != typeof src\n && null != src\n && src.length > 0\n ) {\n let nonce = item?.nonce ?? item.getAttribute('nonce').value;\n // we have to move this into an inner if because chrome otherwise chokes\n // due to changing the and order instead of relying on left to right\n // if jsf.js is already registered we do not replace it anymore\n if (whitelisted(src)) {\n // we run the collected scripts, before we run the 'include' command\n finalScripts = evalCollectedScripts(finalScripts);\n if (!sticky) {\n (!!nonce) ? this.loadScriptEval(src, 0, nonce) :\n // if no nonce is set we do not pass any once\n this.loadScriptEval(src, 0);\n } else {\n (!!nonce) ? this.loadScriptEvalSticky(src, 0, nonce) :\n // if no nonce is set we do not pass any once\n this.loadScriptEvalSticky(src, 0);\n }\n }\n\n } else {\n // embedded script auto eval\n // probably not needed anymore\n let evalText = trim(item.text || item.innerText || item.innerHTML);\n let go = true;\n\n while (go) {\n go = false;\n if (evalText.substring(0, 4) == \"<!--\") {\n evalText = evalText.substring(4);\n go = true;\n }\n if (evalText.substring(0, 4) == \"//<!--\") {\n evalText = evalText.substring(6);\n go = true;\n }\n if (evalText.substring(0, 11) == \"//<![CDATA[\") {\n evalText = evalText.substring(11);\n go = true;\n }\n }\n let nonce = item?.nonce ?? item.getAttribute('nonce').value ?? '';\n // we have to run the script under a global context\n // we store the script for fewer calls to eval\n finalScripts.push({\n nonce,\n evalText\n });\n }\n }\n };\n try {\n let scriptElements = new DomQuery(this.filterSelector(\"script\"), this.querySelectorAll(\"script\"));\n // script execution order by relative pos in their dom tree\n scriptElements.asArray\n .flatMap(item => [...item.values])\n .sort((node1, node2) => node1.compareDocumentPosition(node2) - 3) // preceding 2, following == 4)\n .forEach(item => execScript(item));\n\n evalCollectedScripts(finalScripts);\n } catch (e) {\n if (console && console.error) {\n // not sure if we\n // should use our standard\n // error mechanisms here\n // because in the head appendix\n // method only a console\n // error would be raised as well\n console.error(e.message || e.description);\n }\n } finally {\n // the usual ie6 fix code\n // the IE6 garbage collector is broken\n // nulling closures helps somewhat to reduce\n // mem leaks, which are impossible to avoid\n // at this browser\n execScript = null;\n }\n return this;\n }\n\n runCss(): DomQuery {\n\n const execCss = (toReplace: HTMLElement) => {\n const _toReplace = DomQuery.byId(toReplace);\n const tagName = _toReplace.tagName.orElse(\"\").value;\n const head = DomQuery.byTagName(\"head\");\n\n if (tagName && eqi(tagName, \"link\") && eqi(toReplace.getAttribute(\"rel\"), \"stylesheet\")) {\n const rel = toReplace.getAttribute(\"rel\");\n //if possible we are now replacing the existing elements where we reference this stylesheet\n const matches = head.querySelectorAll(`link[rel='stylesheet'][href='${rel}']`);\n\n if(matches.length) {\n matches.replace(_toReplace);\n } else {\n head.append(_toReplace);\n }\n } else if (tagName && eqi(tagName, \"style\")) {\n let innerText = _toReplace.innerHTML.replace(/\\s+/gi, \"\");\n let styles = head.querySelectorAll(\"style\");\n let filteredStyles = styles.asArray.filter(style => {\n return style.innerHTML.replace(/\\s+/gi, \"\") == innerText;\n });\n styles = new DomQuery(...filteredStyles);\n if(!styles.length) { //already present\n head.append(_toReplace);\n }\n }\n };\n\n const scriptElements: DomQuery = new DomQuery(this.filterSelector(\"link, style\"), this.querySelectorAll(\"link, style\"));\n\n scriptElements.asArray\n .flatMap(item => [...item.values])\n .sort((node1, node2) => node1.compareDocumentPosition(node2) - 3)\n .forEach(item => execCss(item as HTMLElement));\n\n return this;\n }\n\n /**\n * fires a click event on the underlying dom elements\n */\n click(): DomQuery {\n this.fireEvent(\"click\");\n return this;\n }\n\n addEventListener(type: string, listener: (evt: Event) => void, options?: boolean | EventListenerOptions): DomQuery {\n this.eachElem((node: Element) => node.addEventListener(type, listener, options));\n return this;\n }\n\n removeEventListener(type: string, listener: (evt: Event) => void, options?: boolean | EventListenerOptions): DomQuery {\n this.eachElem((node: Element) => node.removeEventListener(type, listener, options));\n return this;\n }\n\n /**\n * fires an event\n */\n fireEvent(eventName: string, options: {[key: string]: any} = {}) {\n // merge with last one having the highest priority\n\n\n let finalOptions: any = new Config({\n bubbles: true, cancelable: true\n });\n finalOptions.shallowMerge(new Config(options));\n finalOptions = JSON.parse(finalOptions.toJson());\n\n this.eachElem((node: Element) => {\n let doc;\n if (node.ownerDocument) {\n doc = node.ownerDocument;\n } else if (node.nodeType == 9) {\n // the node may be the document itself, nodeType 9 = DOCUMENT_NODE\n doc = node;\n } else {\n throw new Error(\"Invalid node passed to fireEvent: \" + node.id);\n }\n\n if (node.dispatchEvent) {\n // Gecko-style approach (now the standard) takes more work\n let EventClass = Event;\n\n // Different events have different event classes.\n // If this switch statement can't map an eventName to an EventClass,\n // the event firing is going to fail.\n // extend this list on demand\n switch (eventName) {\n case \"click\": // Dispatching of 'click' appears to not work correctly in Safari. Use 'mousedown' or 'mouseup' instead.\n case \"mousedown\":\n case \"mouseup\":\n case \"mousemove\":\n EventClass = this.global().MouseEvent;\n break;\n case \"keyup\":\n case \"keydown\":\n case \"keypress\":\n EventClass = this.global().KeyboardEvent;\n break;\n case \"focus\":\n case \"change\":\n case \"blur\":\n case \"select\":\n break;\n default:\n throw \"fireEvent: Couldn't find an event class for event '\" + eventName + \"'.\";\n }\n\n let event = new EventClass(eventName, finalOptions);\n // this is added as an extra to allow internally the detection of synthetic events\n // not used atm, but it does not hurt to have the extra info\n (event as any).synthetic = true; // allow detection of synthetic events\n // The second parameter says go ahead with the default action\n node.dispatchEvent(event);\n } else if ((<any>node).fireEvent) {\n // IE-old school style, you can drop this if you don't need to support IE8 and lower\n let event = doc.createEventObject();\n event.synthetic = true; // allow detection of synthetic events\n Object.keys(finalOptions).forEach(key => event[key] = finalOptions[key]);\n (<any>node).fireEvent(\"on\" + eventName, event);\n }\n })\n }\n\n textContent(joinString: string = \"\"): string {\n return this.asArray\n .map((value: DomQuery) => {\n let item = value.getAsElem(0).orElseLazy(() => {\n return <any>{\n textContent: \"\"\n };\n }).value;\n return (<any>item).textContent || \"\";\n })\n .reduce((text1, text2) => [text1,joinString,text2].join(\"\"), \"\");\n }\n\n innerText(joinString: string = \"\"): string {\n return this.asArray\n .map((value: DomQuery) => {\n let item = value.getAsElem(0).orElseLazy(() => {\n return <any>{\n innerText: \"\"\n };\n }).value;\n return (<any>item).innerText || \"\";\n })\n .reduce((text1, text2) => {\n return [text1, text2].join(joinString)\n }, \"\");\n }\n\n /**\n * encodes all input elements properly into respective\n * config entries, this can be used\n * for legacy systems, for newer use-cases, use the\n * HTML5 Form class which all newer browsers provide\n *\n * @param toMerge optional config which can be merged in\n * @return a copy pf\n */\n encodeFormElement(toMerge = new Config({})): Config {\n\n // browser behavior no element name no encoding (normal submit fails in that case)\n // https:// issues.apache.org/jira/browse/MYFACES-2847\n if (this.name.isAbsent()) {\n return;\n }\n\n // let´s keep it side-effects free\n let target = toMerge.shallowCopy;\n\n this.each((element: DomQuery) => {\n if (element.name.isAbsent()) {// no name, no encoding\n return;\n }\n let name = element.name.value;\n let tagName = element.tagName.orElse(\"__none__\").value.toLowerCase();\n let elemType = element.type.orElse(\"__none__\").value.toLowerCase();\n\n elemType = elemType.toLowerCase();\n\n // routine for all elements\n // rules:\n // - process only input, textarea and select elements\n // - elements must have attribute \"name\"\n // - elements must not be disabled\n if (((tagName == \"input\" || tagName == \"textarea\" || tagName == \"select\") &&\n (name != null && name != \"\")) && !element.disabled) {\n\n // routine for select elements\n // rules:\n // - if select-one and value-Attribute exist => \"name=value\"\n // (also if value empty => \"name=\")\n // - if select-one and value-Attribute don't exist =>\n // \"name=DisplayValue\"\n // - if select multi and multiple selected => \"name=value1&name=value2\"\n // - if select and selectedIndex=-1 don't submit\n if (tagName == \"select\") {\n // selectedIndex must be >= 0 to be submitted\n let selectElem: HTMLSelectElement = <HTMLSelectElement>element.getAsElem(0).value;\n if (selectElem.selectedIndex >= 0) {\n let uLen = selectElem.options.length;\n for (let u = 0; u < uLen; u++) {\n // find all selected options\n // let subBuf = [];\n if (selectElem.options[u].selected) {\n let elementOption = selectElem.options[u];\n target.append(name).value = (elementOption.getAttribute(\"value\") != null) ?\n elementOption.value : elementOption.text;\n }\n }\n }\n }\n\n // routine for remaining elements\n // rules:\n // - don't submit no selects (processed above), buttons, reset buttons, submit buttons,\n // - submit checkboxes and radio inputs only if checked\n if (\n (\n tagName != ALLOWED_SUBMITTABLE_ELEMENTS.SELECT &&\n elemType != ALLOWED_SUBMITTABLE_ELEMENTS.BUTTON &&\n elemType != ALLOWED_SUBMITTABLE_ELEMENTS.RESET &&\n elemType != ALLOWED_SUBMITTABLE_ELEMENTS.SUBMIT &&\n elemType != ALLOWED_SUBMITTABLE_ELEMENTS.IMAGE\n ) && (\n (\n elemType != ALLOWED_SUBMITTABLE_ELEMENTS.CHECKBOX && elemType != ALLOWED_SUBMITTABLE_ELEMENTS.RADIO) ||\n element.checked\n )\n ) {\n let uploadedFiles = (<any>element.value)?.value?.files;\n let filesArr: any = uploadedFiles ?? [];\n if (filesArr?.length) { //files can be empty but set\n // xhr level2, single multiple must be passes as they are\n target.assign(name).value = Array.from(filesArr);\n } else {\n if(!!uploadedFiles) { //we skip empty file elements i\n return;\n }\n //checkboxes etc.. need to be appended\n target.append(name).value = element.inputValue.value;\n }\n }\n\n }\n });\n\n return target;\n }\n\n get cDATAAsString(): string {\n let TYPE_CDATA_BLOCK = 4;\n\n let res = this.asArray\n .flatMap( item => {\n return item.childNodes.asArray;\n })\n .filter(item => {\n return item?.value?.value?.nodeType == TYPE_CDATA_BLOCK;\n })\n .reduce((reduced: Array<any>, item: DomQuery) => {\n reduced.push((<any>item?.value?.value)?.data ?? \"\");\n return reduced;\n }, []);\n /*let res: any = this.lazyStream.flatMap(item => {\n return item.childNodes.stream\n }).filter(item => {\n return item?.value?.value?.nodeType == TYPE_CDATA_BLOCK;\n }).reduce((reduced: Array<any>, item: DomQuery) => {\n reduced.push((<any>item?.value?.value)?.data ?? \"\");\n return reduced;\n }, []).value;*/\n\n // response may contain several blocks\n return res.join(\"\");\n }\n\n subNodes(from: number, to?: number): DomQuery {\n if (Optional.fromNullable(to).isAbsent()) {\n to = this.length;\n }\n return new DomQuery(...this.rootNode.slice(from, Math.min(to, this.length)));\n }\n\n\n // because we can stream from an array stream directly into the dom query\n _limits = -1;\n\n limits(end: number): DomQuery {\n this._limits = end;\n return <any>this;\n }\n\n //-- internally exposed methods needed for the interconnectivity\n hasNext() {\n let isLimitsReached = this._limits != -1 && this.pos >= this._limits - 1;\n let isEndOfArray = this.pos >= this.values.length - 1;\n return !(isLimitsReached ||\n isEndOfArray);\n }\n\n next(): DomQuery {\n if (!this.hasNext()) {\n return null;\n }\n this.pos++;\n return new DomQuery(this.values[this.pos]);\n }\n\n\n lookAhead(cnt = 1): ITERATION_STATUS | DomQuery {\n if ((this.values.length - 1) < (this.pos + cnt)) {\n return ITERATION_STATUS.EO_STRM;\n }\n return new DomQuery(this.values[this.pos + cnt]);\n }\n\n\n current(): DomQuery | ITERATION_STATUS {\n if (this.pos == -1) {\n return ITERATION_STATUS.BEF_STRM;\n }\n return new DomQuery(this.values[this.pos]);\n }\n\n\n reset() {\n this.pos = -1;\n }\n\n attachShadow(params: { [key: string]: string } = {mode: \"open\"}): DomQuery {\n let shadowRoots: DomQuery[] = [];\n this.eachElem((item: Element) => {\n let shadowElement: DomQuery;\n if ((<any>item)?.attachShadow) {\n shadowElement = DomQuery.byId((<any>item).attachShadow(params));\n shadowRoots.push(shadowElement);\n } else {\n throw new Error(\"Shadow dom creation not supported by the browser, please use a shim, to gain this functionality\");\n }\n });\n return new DomQuery(...shadowRoots);\n }\n\n /**\n * helper to fix a common dom problem\n * we have to wait until a certain condition is met, in most of the cases we just want to know whether an element is present in the sub dom-tree before being able to proceed\n * @param condition\n * @param options\n */\n async waitUntilDom(condition: (element: DomQuery) => boolean, options: WAIT_OPTS = {\n attributes: true,\n childList: true,\n subtree: true,\n timeout: 500,\n interval: 100\n }): Promise<DomQuery> {\n return waitUntilDom(this, condition, options);\n }\n\n /**\n * returns the embedded shadow elements\n */\n get shadowElements(): DomQuery {\n let shadowElements = this.querySelectorAll(\"*\")\n .filter(item => item.hasShadow);\n\n\n let mapped: Array<ShadowRoot> = (shadowElements.allElems() || []).map(element => element.shadowRoot);\n return new DomQuery(...mapped);\n }\n\n get shadowRoot(): DomQuery {\n let shadowRoots = [];\n for (let cnt = 0; cnt < this.rootNode.length; cnt++) {\n if (this.rootNode[cnt].shadowRoot) {\n shadowRoots.push(this.rootNode[cnt].shadowRoot);\n }\n }\n return new DomQuery(...shadowRoots);\n }\n\n get hasShadow(): boolean {\n for (let cnt = 0; cnt < this.rootNode.length; cnt++) {\n if (this.rootNode[cnt].shadowRoot) {\n return true;\n }\n }\n return false;\n }\n\n // from\n // http:// blog.vishalon.net/index.php/javascript-getting-and-setting-caret-position-in-textarea/\n static getCaretPosition(ctrl: any) {\n let caretPos = 0;\n\n try {\n if ((<any>document)?.selection) {\n ctrl.focus();\n let selection = (<any>document).selection.createRange();\n // the selection now is start zero\n selection.moveStart('character', -ctrl.value.length);\n // the caret-position is the selection start\n caretPos = selection.text.length;\n }\n } catch (e) {\n // now this is ugly, but not supported input types throw errors for selectionStart\n // just in case someone dumps this code onto unsupported browsers\n }\n return caretPos;\n }\n\n /**\n * sets the caret position\n *\n * @param ctrl the control to set the caret position to\n * @param pos the position to set\n *\n * note if the control does not have any selectable and focusable behavior\n * calling this method does nothing (silent fail)\n *\n */\n static setCaretPosition(ctrl: any, pos: number) {\n ctrl?.focus ? ctrl?.focus() : null;\n // the selection range is our caret position\n\n ctrl?.setSelectiongRange ? ctrl?.setSelectiongRange(pos, pos) : null;\n }\n\n /**\n * Implementation of an iterator\n * to allow loops over dom query collections\n */\n [Symbol.iterator](): Iterator<DomQuery, any, undefined> {\n return {\n next: () => {\n let done = !this.hasNext();\n let val = this.next();\n return {\n done: done,\n value: <DomQuery>val\n }\n }\n }\n }\n\n /**\n * Concatenates the elements of two Dom Queries into a single one\n * @param toAttach the elements to attach\n * @param filterDoubles filter out possible double elements (aka same markup)\n */\n concat(toAttach: DomQuery, filterDoubles = true): DomQuery {\n let domQueries = this.asArray;\n const ret = new DomQuery(...domQueries.concat(toAttach.asArray));\n // we now filter the doubles out\n if (!filterDoubles) {\n return ret;\n }\n let idx = {}; // ie11 does not support sets, we have to fake it\n return new DomQuery(...ret.asArray.filter(node => {\n const notFound = !(idx?.[node.value.value.outerHTML as any]);\n idx[node.value.value.outerHTML as any] = true;\n return notFound;\n }));\n }\n\n append(elem: DomQuery): DomQuery {\n this.each(item => elem.appendTo(item));\n return this;\n }\n\n prependTo(elem: DomQuery): DomQuery {\n elem.eachElem(item => {\n item.prepend(...this.allElems());\n });\n return this;\n }\n\n prepend(elem: DomQuery): DomQuery {\n this.eachElem(item => {\n item.prepend(...elem.allElems());\n })\n return this;\n }\n\n /**\n * query selector all on the existing dom queryX object\n *\n * @param selector the standard selector\n * @return a DomQuery with the results\n */\n private _querySelectorAll(selector): DomQuery {\n if (!this?.rootNode?.length) {\n return this;\n }\n let nodes = [];\n for (let cnt = 0; cnt < this.rootNode.length; cnt++) {\n if (!this.rootNode[cnt]?.querySelectorAll) {\n continue;\n }\n let res = this.rootNode[cnt].querySelectorAll(selector);\n nodes = nodes.concat(...objToArray(res));\n }\n\n return new DomQuery(...nodes);\n }\n\n /*deep with a selector and a pseudo /shadow/ marker to break into the next level*/\n private _querySelectorAllDeep(selector): DomQuery {\n if (!this?.rootNode?.length) {\n return this;\n }\n\n let foundNodes: DomQuery = new DomQuery(...this.rootNode);\n let selectors = selector.split(/\\/shadow\\//);\n\n for (let cnt2 = 0; cnt2 < selectors.length; cnt2++) {\n if (selectors[cnt2] == \"\") {\n continue;\n }\n let levelSelector = selectors[cnt2];\n foundNodes = foundNodes.querySelectorAll(levelSelector);\n if (cnt2 < selectors.length - 1) {\n foundNodes = foundNodes.shadowRoot;\n }\n }\n\n return foundNodes;\n }\n\n\n /**\n * query selector all on the existing dom queryX object\n *\n * @param selector the standard selector\n * @return a DomQuery with the results\n */\n private _closest(selector): DomQuery {\n if (!this?.rootNode?.length) {\n return this;\n }\n let nodes = [];\n for (let cnt = 0; cnt < this.rootNode.length; cnt++) {\n if (!this.rootNode[cnt]?.closest) {\n continue;\n }\n let res = [this.rootNode[cnt].closest(selector)];\n nodes = nodes.concat(...res);\n }\n\n return new DomQuery(...nodes);\n }\n\n /*deep with a selector and a pseudo /shadow/ marker to break into the next level*/\n private _closestDeep(selector): DomQuery {\n if (!this?.rootNode?.length) {\n return this;\n }\n\n let foundNodes: DomQuery = new DomQuery(...this.rootNode);\n let selectors = selector.split(/\\/shadow\\//);\n\n for (let cnt2 = 0; cnt2 < selectors.length; cnt2++) {\n if (selectors[cnt2] == \"\") {\n continue;\n }\n let levelSelector = selectors[cnt2];\n foundNodes = foundNodes.closest(levelSelector);\n if (cnt2 < selectors.length - 1) {\n foundNodes = foundNodes.shadowRoot;\n }\n }\n\n return foundNodes;\n }\n\n // source: https:// developer.mozilla.org/en-US/docs/Web/API/Element/matches\n // code snippet license: https:// creativecommons.org/licenses/by-sa/2.5/\n /**\n * matches selector call in a browser independent manner\n *\n * @param toMatch\n * @param selector\n * @private\n */\n private _mozMatchesSelector(toMatch: Element, selector: string): boolean {\n let prototypeOwner: { [key: string]: Function } = (<any>toMatch);\n let matchesSelector: Function = prototypeOwner.matches ||\n prototypeOwner.matchesSelector ||\n prototypeOwner.mozMatchesSelector ||\n prototypeOwner.msMatchesSelector ||\n prototypeOwner.oMatchesSelector ||\n prototypeOwner.webkitMatchesSelector ||\n function (s: string) {\n let matches: NodeListOf<HTMLElement> = (document || ownerDocument).querySelectorAll(s),\n i = matches.length;\n while (--i >= 0 && matches.item(i) !== toMatch) {\n }\n return i > -1;\n };\n return matchesSelector.call(toMatch, selector);\n }\n\n /**\n * sticky non-sticky unified code of the load script eval\n * implementation if programmatic >script src=\"... loading\n *\n * @param sticky if set to true a head element is left in the dom tree after the script has loaded\n *\n * @param src the sec to load\n * @param delay delay the script loading x ms (default immediately === 0)\n * @param nonce optional nonce token to be passed into the script tag\n * @private\n */\n private _loadScriptEval(sticky: boolean, src: string, delay: number = 0, nonce ?: string) {\n let srcNode = this.createSourceNode(src, nonce);\n let nonceCheck = this.createSourceNode(null, nonce);\n let marker = `nonce_${Date.now()}_${Math.random()}`;\n nonceCheck.innerHTML = `document.head[\"${marker}\"] = true` // noop\n\n let head = document.head;\n // upfront nonce check, needed mostly for testing\n // but cannot hurt to block src calls which have invalid nonce on localhost\n // the reason for doing this up until now we have a similar construct automatically\n // by loading the scripts via xhr and then embedding them.\n // this is not needed anymore but the nonce is more relaxed with script src\n // we now enforce it the old way\n\n head.appendChild(nonceCheck);\n head.removeChild(nonceCheck);\n if(!head[marker]) {\n return;\n }\n try {\n if (!delay) {\n head.appendChild(srcNode);\n if(!sticky) {\n head.removeChild(srcNode);\n }\n } else {\n setTimeout(() => {\n head.appendChild(srcNode);\n if(!sticky) {\n head.removeChild(srcNode);\n }\n }, delay);\n }\n } finally {\n delete head[marker];\n }\n\n return this;\n }\n\n /**\n * resolves an attribute holder compared\n * @param attrName the attribute name\n */\n private resolveAttributeHolder(attrName: string = \"value\"): HTMLFormElement | any {\n let ret = [];\n ret[attrName] = null;\n return (attrName in this.getAsElem(0).value) ?\n this.getAsElem(0).value :\n ret;\n }\n\n private createSourceNode(src: string | null, nonce?: string) {\n let srcNode: HTMLScriptElement = document.createElement(\"script\");\n srcNode.type = \"text/javascript\";\n if (!!nonce) {\n if ('undefined' != typeof srcNode?.nonce) {\n srcNode.nonce = nonce;\n } else {\n srcNode.setAttribute(\"nonce\", nonce);\n }\n }\n if(!!src) {\n srcNode.src = src;\n }\n\n return srcNode;\n }\n\n private applyNonce(nonce: string, script: HTMLScriptElement) {\n if (nonce) {\n if ('undefined' != typeof script?.nonce) {\n script.nonce = nonce;\n } else {\n script.setAttribute(\"nonce\", nonce);\n }\n }\n }\n\n}\n\n\n/**\n * Various collectors\n * which can be used in conjunction with Streams\n */\n\n/**\n * A collector which bundles a full dom query stream into a single dom query element\n *\n * This connects basically our stream back into DomQuery\n */\nexport class DomQueryCollector implements ICollector<DomQuery, DomQuery> {\n\n data: DomQuery[] = [];\n\n collect(element: DomQuery) {\n this.data.push(element);\n }\n\n get finalValue(): DomQuery {\n return new DomQuery(...this.data);\n }\n}\n\n/**\n * abbreviation for DomQuery\n */\nexport const DQ = DomQuery;\nexport type DQ = DomQuery;\n// noinspection JSUnusedGlobalSymbols\n/**\n * replacement for the jquery $\n */\nexport const DQ$ = DomQuery.querySelectorAll;\n","/**\n * Extended array\n */\n\n/**\n * Extended array which adds various es 2019 shim functions to the normal array\n * We must remap all array producing functions in order to keep\n * the delegation active, once we are in!\n */\n\n\n\n\n\nclass Es2019Array_<T> extends Array<T>{\n\n _another: T[];\n\n constructor(...another: T[]) {\n super(...another);\n if((another as any)._another) {\n this._another = (another as any)._another;\n } else {\n this._another = another;\n }\n\n //for testing it definitely runs into this branch because we are on es5 level\n //if (!(<any>Array.prototype).flatMap) {\n this.flatMap = (flatMapFun) => this._flatMap(flatMapFun) as any;\n //}\n //if (!(<any>Array.prototype).flat) {\n this.flat = (flatLevel: number = 1) => this._flat(flatLevel);\n //}\n }\n\n map<U>(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[] {\n const ret = Array.prototype.map.call(this._another, callbackfn, thisArg);\n return new (_Es2019Array as any) (... ret);\n }\n\n concat(...items): T[] {\n const ret = Array.prototype.concat.call(this._another, ...items);\n return new (_Es2019Array as any)(... ret);\n }\n\n reverse(): T[] {\n const ret = Array.prototype.reverse.call(this._another);\n return new (_Es2019Array as any)(... ret);\n }\n\n slice(start?: number, end?: number): T[] {\n const ret = Array.prototype.slice.call(this._another, start, end);\n return new (_Es2019Array as any)(...ret);\n }\n\n splice(start: number, deleteCount?: number): T[] {\n const ret = Array.prototype.splice.call(this._another, start, deleteCount);\n return new (_Es2019Array as any)(...ret);\n }\n\n filter<S extends T>(predicate: (value: T, index: number, array: T[]) => any, thisArg?: any): S[] {\n const ret = Array.prototype.filter.call(this._another, predicate, thisArg);\n return new (_Es2019Array as any)(...ret);\n }\n\n\n reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T {\n const ret = Array.prototype.reduce.call(this._another, callbackfn, initialValue);\n return ret;\n }\n\n /*reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T {\n const ret = Array.prototype.reduceRight.call(callbackfn, initialValue);\n return ret;\n }*/\n\n private _flat(flatDepth = 1) {\n return this._flatResolve(this._another, flatDepth);\n }\n\n private _flatResolve(arr, flatDepth = 1) {\n //recursion break\n if (flatDepth == 0) {\n return arr;\n }\n let res = [];\n\n let reFlat = item => {\n item = Array.isArray(item) ? item : [item];\n let mapped = this._flatResolve(item, flatDepth - 1);\n res = res.concat(mapped);\n };\n arr.forEach(reFlat)\n\n return new Es2019Array(...res);\n }\n\n private _flatMap(mapperFunction: Function): any {\n let res = this.map(item => mapperFunction(item));\n return this._flatResolve(res);\n }\n}\n\n//let _Es2019Array = function<T>(...data: T[]) {};\n\n//let oldProto = Es2019Array.prototype;\n\nexport function _Es2019Array<T>(...data: T[]): Es2019Array_<T> {\n let ret = new Es2019Array_<T>(...data);\n let proxied = new Proxy<Es2019Array_<T>>(ret, {\n get(target: Es2019Array_<unknown>, p: string | symbol, receiver: any): any {\n if(\"symbol\" == typeof p) {\n\n return target._another[p];\n }\n if(!isNaN(parseInt(p as string))) {\n return target._another[p];\n } else {\n return target[p];\n }\n },\n\n set(target, property, value): boolean {\n target[property] = value;\n target._another[property] = value;\n return true;\n }\n\n });\n return proxied;\n};\n\n/**\n * this is the switch between normal array and our shim\n * the shim is only provided in case the native browser\n * does not yet have flatMap support on arrays\n */\nexport var Es2019Array: any = (Array.prototype.flatMap) ? function<T>(...data: T[]): T[] {\n return data;\n} : _Es2019Array;","/*!\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n/**\n * various environments handle the global variable different\n * we have to deal with this.\n */\nexport function _global$(): any | null {\n let _global$: any = ('undefined' != typeof globalThis && globalThis.window) ? globalThis.window:\n ('undefined' != typeof window) ? window :\n ('undefined' != typeof globalThis) ? globalThis :\n ('undefined' != typeof global && global?.window) ? global.window :\n ('undefined' != typeof global) ? global : null;\n //under test systems we often have a lazy init of the window object under global.window, but we\n //want the window object\n return _global$?.window ?? _global$;\n}\n\n","/*!\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Optional} from \"./Monad\";\nimport {Es2019Array} from \"./Es2019Array\";\n\n/**\n * Lang helpers crossported from the apache myfaces project\n */\nexport module Lang {\n \n\n //should be in lang, but for now here to avoid recursive imports, not sure if typescript still has a problem with those\n /**\n * helper function to safely resolve anything\n * this is not an elvis operator, it resolves\n * a value without exception in a tree and if\n * it is not resolvable then an optional of\n * a default value is restored or Optional.empty\n * if none is given\n *\n * usage\n * <code>\n * let var: Optiona<string> = saveResolve(() => a.b.c.d.e, \"foobaz\")\n * </code>\n *\n * @param resolverProducer a lambda which can produce the value\n * @param defaultValue an optional default value if the producer failes to produce anything\n * @returns an Optional of the produced value\n */\n export function saveResolve<T>(resolverProducer: () => T, defaultValue: T = null): Optional<T> {\n try {\n let result = resolverProducer();\n return Optional.fromNullable(result ?? defaultValue);\n } catch (e) {\n return Optional.absent;\n }\n }\n\n /**\n * lazy resolve... aka the function is called on resolve and a default value also\n * is a producing function (called only if the original producer does not produce any result)\n * @param resolverProducer the producer for the resolve\n * @param defaultValue the default value producer function\n */\n export function saveResolveLazy<T>(resolverProducer: () => T, defaultValue: () => T = null): Optional<T> {\n try {\n let result = resolverProducer();\n return Optional.fromNullable(result ?? defaultValue());\n } catch (e) {\n return Optional.absent;\n }\n }\n\n /**\n * String to array function performs a string to array transformation\n * @param {String} it the string which has to be changed into an array\n * @param {RegExp} splitter our splitter reglar expression\n * @return a trimmed array of the splitted string\n */\n export function strToArray(it: string, splitter: string | RegExp = /\\./gi): Array<string> {\n\n let ret = [];\n it.split(splitter).forEach((element => {\n ret.push(trim(element));\n }));\n return ret;\n }\n\n /**\n * hyperfast trim\n * http://blog.stevenlevithan.com/archives/faster-trim-javascript\n * crossported from dojo\n */\n export function trim(str: string): string {\n str = str.replace(/^\\s\\s*/, '');\n let ws = /\\s/, i = str.length;\n\n while (ws.test(str.charAt(--i))) {\n //do nothing\n }\n return str.slice(0, i + 1);\n }\n\n /**\n * generic object arrays like dom definitions to array conversion method which\n * transforms any object to something array like\n * @param obj\n * @param offset\n * @param pack\n * @returns an array converted from the object\n */\n export function objToArray<T>(obj: any, offset: number = 0, pack: Array<T> = []): Array<T> {\n if ((obj ?? \"__undefined__\") == \"__undefined__\") {\n return pack ?? null;\n }\n //since offset is numeric we cannot use the shortcut due to 0 being false\n //special condition array delivered no offset no pack\n if ((<any>obj) instanceof Array && !offset && !pack) return obj;\n\n return new Es2019Array(...pack.concat(Array.prototype.slice.call(obj, offset)));\n }\n\n /**\n * equalsIgnoreCase, case-insensitive comparison of two strings\n *\n * @param source\n * @param destination\n */\n export function equalsIgnoreCase(source?: string, destination?: string): boolean {\n let finalSource = source ?? \"___no_value__\";\n let finalDest = destination ?? \"___no_value__\";\n\n //in any other case we do a strong string comparison\n return finalSource.toLowerCase() === finalDest.toLowerCase();\n }\n\n\n /**\n * runtime type assertion\n *\n * @param probe the probe to be tested for a type\n * @param theType the type to be tested for\n */\n export function assertType(probe: any, theType: any): boolean {\n return isString(theType) ? typeof probe == theType : probe instanceof theType;\n }\n\n /**\n * Back ported from Dojo\n * a failsafe string determination method\n * (since in javascript String != \"\" typeof alone fails!)\n * @param it {|Object|} the object to be checked for being a string\n * @return true in case of being a string false otherwise\n */\n export function isString(it?: any): boolean {\n //\tsummary:\n //\t\tReturn true if it is a String\n return !!arguments.length && it != null && (typeof it == \"string\" || it instanceof String); // Boolean\n }\n\n /**\n * Back-ported, a failsafe determination code for checking whether an object is a function\n * @param it the object to check for being a function\n */\n export function isFunc(it: any): boolean {\n return it instanceof Function || typeof it === \"function\";\n }\n\n // code from https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n // license https://creativecommons.org/licenses/by-sa/2.5/\n export function objAssign(target: any, ...theArgs: any) { // .length of function is 2\n if (target == null) { // TypeError if undefined or null\n throw new TypeError('Cannot convert undefined or null to object');\n }\n\n let to = Object(target);\n if((<any>Object).assign) {\n theArgs.forEach(item => (<any>Object).assign(to, item));\n return to;\n }\n\n theArgs.filter(item => item != null).forEach(item => {\n let nextSource = item;\n Object.keys(nextSource)\n .filter(nextKey => Object.prototype.hasOwnProperty.call(nextSource, nextKey))\n .forEach(nextKey => to[nextKey] = nextSource[nextKey]);\n });\n return to;\n }\n\n\n}\n\n","/*!\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * A module which keeps basic monad like definitions in place\n * Useful if you need the functions in another library to keep its dependencies down\n */\n\n/*IMonad definitions*/\n\nimport {Lang} from \"./Lang\";\nimport {Es2019Array} from \"./Es2019Array\";\nimport objAssign = Lang.objAssign;\n\n\n/**\n * IFunctor interface,\n * defines an interface which allows to map a functor\n * via a first order function to another functor\n */\nexport interface IFunctor<T> {\n map<R>(fn: (data: T) => R): IFunctor<R>;\n}\n\n/**\n * IMonad definition, basically a functor with a flatMap implementation, flatMap reduces all nested monads after a\n * function call f into a monad with the nesting level of 1\n *\n * flatmap flats nested Monads into a IMonad of the deepest nested implementation\n */\nexport interface IMonad<T, M extends IMonad<any, any>> extends IFunctor<T> {\n flatMap<T, M>(f: (T) => M): IMonad<any, any>;\n}\n\n/**\n * a stateful functor which holds a value upn which a\n * function can be applied\n *\n * as value holder of type T\n */\nexport interface IIdentity<T> extends IFunctor<T> {\n readonly value: T;\n}\n\n\n/**\n * custom value holder definition, since we are not pure functional\n * but iterative we have structures which allow the assignment of a value\n * also not all structures are side - effect free\n */\nexport interface IValueHolder<T> {\n value: T | Array<T>;\n}\n\n/**\n * Implementation of a monad\n * (Side - effect free), no write allowed directly on the monads\n * value state\n */\nexport class Monad<T> implements IMonad<T, Monad<any>>, IValueHolder<T> {\n constructor(value: T) {\n this._value = value;\n }\n\n protected _value: T;\n\n get value(): T {\n return this._value;\n }\n\n map<R>(fn?: (data: T) => R): Monad<R> {\n if (!fn) {\n fn = (inVal: any) => <R>inVal;\n }\n let result: R = fn(this.value);\n return new Monad(result);\n }\n\n flatMap<R>(fn?: (data: T) => R): Monad<any> {\n let mapped: Monad<any> = this.map(fn);\n while (mapped?.value instanceof Monad) {\n mapped = mapped.value\n }\n return mapped;\n }\n\n}\n\n/**\n * optional implementation, an optional is basically an implementation of a Monad with additional syntactic\n * sugar on top\n * (Side - effect free, since value assignment is not allowed)\n * */\nexport class Optional<T> extends Monad<T> {\n\n /*default value for absent*/\n static absent = Optional.fromNullable(null);\n\n constructor(value: T) {\n super(value);\n }\n\n get value(): T {\n if (this._value instanceof Monad) {\n return this._value.flatMap().value\n }\n return this._value;\n }\n\n static fromNullable<V extends Optional<T>, T>(value?: T): Optional<T> {\n return <V> new Optional(value);\n }\n\n /*syntactic sugar for absent and present checks*/\n isAbsent(): boolean {\n return \"undefined\" == typeof this.value || null == this.value;\n }\n\n /**\n * any value present\n */\n isPresent(presentRunnable ?: (val ?: Monad<T>) => void): boolean {\n let absent = this.isAbsent();\n if (!absent && presentRunnable) {\n presentRunnable.call(this, this)\n }\n return !absent;\n }\n\n ifPresentLazy(presentRunnable: (val ?: Monad<T>) => void = () => {\n }): Monad<T> {\n this.isPresent.call(this, presentRunnable);\n return this;\n }\n\n orElse(elseValue: any): Optional<any> {\n if (this.isPresent()) {\n return this;\n } else {\n //shortcut\n if (elseValue == null) {\n return Optional.absent;\n }\n return this.flatMap(() => elseValue);\n }\n }\n\n /**\n * lazy, passes a function which then is lazily evaluated\n * instead of a direct value\n * @param func\n */\n orElseLazy(func: () => any): Optional<any> {\n if (this.isPresent()) {\n return this;\n } else {\n return this.flatMap(func);\n }\n }\n\n /*\n * we need to implement it to fulfill the contract, although it is used only internally\n * all values are flattened when accessed anyway, so there is no need to call this method\n */\n flatMap<R>(fn?: (data: T) => R): Optional<any> {\n let val = super.flatMap(fn);\n if (!(val instanceof Optional)) {\n return Optional.fromNullable(val.value);\n }\n\n return <Optional<any>>val.flatMap();\n }\n\n /*\n * elvis operation, take care, if you use this you lose typesafety and refactoring\n * capabilities, unfortunately typescript does not allow to have its own elvis operator\n * this is some syntactic sugar however which is quite useful*/\n getIf<R>(...key: string[]): Optional<R> {\n\n key = this.preprocessKeys(...key);\n\n let currentPos: Optional<any> = this;\n for (let cnt = 0; cnt < key.length; cnt++) {\n let currKey = this.keyVal(key[cnt]);\n let arrPos = this.arrayIndex(key[cnt]);\n\n if (currKey === \"\" && arrPos >= 0) {\n currentPos = this.getClass().fromNullable(!(currentPos.value instanceof Array) ? null : (currentPos.value.length < arrPos ? null : currentPos.value[arrPos]));\n if (currentPos.isAbsent()) {\n return currentPos;\n }\n continue;\n } else if (currKey && arrPos >= 0) {\n if (currentPos.getIfPresent(currKey).isAbsent()) {\n return currentPos;\n }\n currentPos = (currentPos.getIfPresent(currKey).value instanceof Array) ? this.getClass().fromNullable(currentPos.getIfPresent(currKey).value[arrPos]) : this.getClass().absent;\n if (currentPos.isAbsent()) {\n return currentPos;\n }\n continue;\n\n } else {\n currentPos = currentPos.getIfPresent(currKey);\n }\n if (currentPos.isAbsent()) {\n return currentPos;\n } else if (arrPos > -1) {\n currentPos = this.getClass().fromNullable(currentPos.value[arrPos]);\n }\n }\n return currentPos;\n }\n\n /**\n * simple match, if the first order function call returns\n * true then there is a match, if the value is not present\n * it never matches\n *\n * @param fn the first order function performing the match\n */\n match(fn: (item: T) => boolean): boolean {\n if (this.isAbsent()) {\n return false\n }\n return fn(this.value);\n }\n\n /**\n * convenience function to flatmap the internal value\n * and replace it with a default in case of being absent\n *\n * @param defaultVal\n * @returns {Optional<any>}\n */\n get<R>(defaultVal: any = Optional.absent): Optional<R> {\n if (this.isAbsent()) {\n return this.getClass().fromNullable(defaultVal).flatMap();\n }\n\n return this.getClass().fromNullable(this.value).flatMap();\n }\n\n toJson(): string {\n return JSON.stringify(this.value);\n }\n\n /**\n * helper to override several implementations in a more fluent way\n * by having a getClass operation we can avoid direct calls into the constructor or\n * static methods and do not have to implement several methods which rely on the type\n * of \"this\"\n * @returns the type of Optional\n */\n protected getClass(): any {\n return Optional;\n }\n\n /*helper method for getIf with array access aka <name>[<indexPos>]*/\n protected arrayIndex(key: string): number {\n let start = key.indexOf(\"[\");\n let end = key.indexOf(\"]\");\n if (start >= 0 && end > 0 && start < end) {\n return parseInt(key.substring(start + 1, end));\n } else {\n return -1;\n }\n }\n\n /*helper method for getIf with array access aka <name>[<indexPos>]*/\n protected keyVal(key: string): string {\n let start = key.indexOf(\"[\");\n\n if (start >= 0) {\n return key.substring(0, start);\n } else {\n return key;\n }\n }\n\n /**\n * additional syntactic sugar which is not part of the usual optional implementation\n * but makes life easier, if you want to sacrifice typesafety and refactoring\n * capabilities in typescript\n */\n getIfPresent<R>(key: string): Optional<R> {\n if (this.isAbsent()) {\n return this.getClass().absent;\n }\n return this.getClass().fromNullable(this.value[key]).flatMap();\n }\n\n /**\n * elvis like typesafe functional save resolver\n * a typesafe option for getIfPresent\n *\n * usage myOptional.resolve(value => value.subAttr.subAttr2).orElseLazy(....)\n * if this is resolvable without any errors an Optional with the value is returned\n * if not, then an Optional absent is returned, also if you return Optional absent\n * it is flatmapped into absent\n *\n * @param resolver the resolver function, can throw any arbitrary errors, int the error case\n * the resolution goes towards absent\n */\n resolve<V>(resolver: (item: T) => V): Optional<V> {\n if (this.isAbsent()) {\n return Optional.absent;\n }\n try {\n return Optional.fromNullable(resolver(this.value))\n } catch (e) {\n return Optional.absent;\n }\n }\n\n\n protected preprocessKeys(...keys): string[] {\n return new Es2019Array(...keys)\n .flatMap(item => {\n return new Es2019Array(...item.split(/]\\s*\\[/gi))\n .map(item => {\n item = item.replace(/^\\s+|\\s+$/g, \"\");\n if(item.indexOf(\"[\") == -1 && item.indexOf(\"]\") != -1) {\n item = \"[\" + item;\n }\n if(item.indexOf(\"]\") == -1 && item.indexOf(\"[\") != -1) {\n item = item + \"]\";\n }\n return item;\n })\n });\n }\n}\n\n\n// --------------------- From here onwards we break out the side effect free limits ------------\n\n/**\n * ValueEmbedder is the writeable version\n * of optional, it basically is a wrapper\n * around a construct which has a state\n * and can be written to.\n *\n * For the readonly version see Optional\n */\nexport class ValueEmbedder<T> extends Optional<T> implements IValueHolder<T> {\n\n /*default value for absent*/\n static absent = ValueEmbedder.fromNullable(null);\n\n protected key: string;\n\n constructor(rootElem: any, valueKey: string = \"value\") {\n super(rootElem);\n\n this.key = valueKey;\n }\n\n get value(): T {\n return this._value ? <T>this._value[this.key] : null;\n }\n\n set value(newVal: T) {\n if (!this._value) {\n return;\n }\n this._value[this.key] = newVal\n }\n\n orElse(elseValue: any): Optional<any> {\n let alternative = {};\n alternative[this.key] = elseValue;\n return this.isPresent() ? this : new ValueEmbedder(alternative, this.key);\n }\n\n orElseLazy(func: () => any): Optional<any> {\n if (this.isPresent()) {\n return this;\n } else {\n let alternative = {};\n alternative[this.key] = func();\n return new ValueEmbedder(alternative, this.key);\n }\n }\n\n /**\n * helper to override several implementations in a more fluent way\n * by having a getClass operation we can avoid direct calls into the constructor or\n * static methods and do not have to implement several methods which rely on the type\n * of \"this\"\n * @returns ValueEmbedder\n */\n protected getClass(): any {\n return ValueEmbedder;\n }\n\n static fromNullable<V extends Optional<T>,T>(value?: any, valueKey: string = \"value\"): V {\n return <any> new ValueEmbedder<T>(value, valueKey);\n }\n\n}\n\n/**\n * specialized value embedder\n * for our Configuration\n */\nclass ConfigEntry<T> extends ValueEmbedder<T> {\n\n /*default value for absent*/\n static absent = ConfigEntry.fromNullable(null);\n\n /**\n * arrayed value positions\n */\n arrPos: number;\n\n constructor(rootElem: any, key: any, arrPos?: number) {\n super(rootElem, key);\n\n this.arrPos = arrPos ?? -1;\n }\n\n get value() {\n if (this.key == \"\" && this.arrPos >= 0) {\n return this._value[this.arrPos];\n } else if (this.key && this.arrPos >= 0) {\n return this._value[this.key][this.arrPos];\n }\n return this._value[this.key];\n }\n\n set value(val: T) {\n if (this.key == \"\" && this.arrPos >= 0) {\n this._value[this.arrPos] = val;\n return;\n } else if (this.key && this.arrPos >= 0) {\n this._value[this.key][this.arrPos] = val;\n return;\n }\n this._value[this.key] = val;\n }\n}\n\n\nexport const CONFIG_VALUE = \"__END_POINT__\";\nexport const CONFIG_ANY = \"__ANY_POINT__\";\n\nexport type ConfigDef = {[key: string]: any};\n\n\n/**\n * Config, basically an optional wrapper for a json structure\n * (not Side - effect free, since we can alter the internal config state\n * without generating a new config), not sure if we should make it side - effect free\n * since this would swallow a lot of performance and ram\n */\nexport class Config extends Optional<any> {\n constructor(root: any, private configDef ?: ConfigDef) {\n super(root);\n }\n\n /**\n * shallow copy getter, copies only the first level, references the deeper nodes\n * in a shared manner\n */\n get shallowCopy(): Config {\n return this.shallowCopy$();\n }\n\n protected shallowCopy$(): Config {\n let ret = new Config({});\n ret.shallowMerge(this.value);\n return ret;\n }\n\n /**\n * deep copy, copies all config nodes\n */\n get deepCopy(): Config {\n return this.deepCopy$();\n }\n\n protected deepCopy$(): Config {\n return new Config(objAssign({}, this.value));\n }\n\n /**\n * creates a config from an initial value or null\n * @param value\n */\n static fromNullable<T>(value?: T | null): Config {\n return new Config(value);\n }\n\n /**\n * simple merge for the root configs\n */\n shallowMerge(other: Config, overwrite = true, withAppend = false) {\n for (let key in other.value) {\n if('undefined' == typeof key || null == key) {\n continue;\n }\n if (overwrite || !(key in this.value)) {\n if (!withAppend) {\n this.assign(key).value = other.getIf(key).value;\n } else {\n if (Array.isArray(other.getIf(key).value)) {\n new Es2019Array(...other.getIf(key).value).forEach(item => this.append(key).value = item);\n } else {\n this.append(key).value = other.getIf(key).value;\n }\n }\n }\n }\n }\n\n /**\n * assigns a single value as array, or appends it\n * to an existing value mapping a single value to array\n *\n *\n * usage myConfig.append(\"foobaz\").value = \"newValue\"\n * myConfig.append(\"foobaz\").value = \"newValue2\"\n *\n * resulting in myConfig.foobaz == [\"newValue, newValue2\"]\n *\n * @param {string[]} accessPath\n */\n append(...accessPath: string[]): IValueHolder<any> {\n let noKeys = accessPath.length < 1;\n if (noKeys) {\n return;\n }\n this.assertAccessPath(...accessPath);\n\n let lastKey = accessPath[accessPath.length - 1];\n let pathExists = this.getIf(...accessPath).isPresent();\n this.buildPath(...accessPath);\n\n let finalKeyArrPos = this.arrayIndex(lastKey);\n if (finalKeyArrPos > -1) {\n throw Error(\"Append only possible on non array properties, use assign on indexed data\");\n }\n let value = <any>this.getIf(...accessPath).value;\n if (!Array.isArray(value)) {\n value = this.assign(...accessPath).value = [value];\n }\n if (pathExists) {\n value.push({});\n }\n finalKeyArrPos = value.length - 1;\n\n return new ConfigEntry(accessPath.length == 1 ? this.value : this.getIf.apply(this, accessPath.slice(0, accessPath.length - 1)).value,\n lastKey, finalKeyArrPos\n );\n }\n\n /**\n * appends to an existing entry (or extends into an array and appends)\n * if the condition is met\n * @param {boolean} condition\n * @param {string[]} accessPath\n */\n appendIf(condition: boolean, ...accessPath: string[]): IValueHolder<any> {\n if (!condition) {\n return {value: null};\n }\n return this.append(...accessPath);\n }\n\n /**\n * assigns a new value on the given access path\n * @param accessPath\n */\n assign(...accessPath): IValueHolder<any> {\n if (accessPath.length < 1) {\n return;\n }\n this.assertAccessPath(...accessPath);\n\n this.buildPath(...accessPath);\n\n let currKey = this.keyVal(accessPath[accessPath.length - 1]);\n let arrPos = this.arrayIndex(accessPath[accessPath.length - 1]);\n return new ConfigEntry(accessPath.length == 1 ? this.value : this.getIf.apply(this, accessPath.slice(0, accessPath.length - 1)).value,\n currKey, arrPos\n );\n }\n\n\n /**\n * assign a value if the condition is set to true, otherwise skip it\n *\n * @param condition the condition, the access accessPath into the config\n * @param accessPath\n */\n assignIf(condition: boolean, ...accessPath: Array<any>): IValueHolder<any> {\n return condition ? this.assign(...accessPath) : {value: null};\n }\n\n /**\n * get if the access path is present (get is reserved as getter with a default, on the current path)\n * TODO will be renamed to something more meaningful and deprecated, the name is ambiguous\n * @param accessPath the access path\n */\n getIf(...accessPath: Array<string>): Config {\n this.assertAccessPath(...accessPath);\n return this.getClass().fromNullable(super.getIf.apply(this, accessPath).value);\n }\n\n\n\n /**\n * gets the current node and if none is present returns a config with a default value\n * @param defaultVal\n */\n get(defaultVal: any): Config {\n return this.getClass().fromNullable(super.get(defaultVal).value);\n }\n\n //empties the current config entry\n delete(key: string): Config {\n if (key in this.value) {\n delete this.value[key];\n }\n return this;\n }\n\n /**\n * converts the entire config into a json object\n */\n toJson(): any {\n return JSON.stringify(this.value);\n }\n\n\n protected getClass(): any {\n return Config;\n }\n\n private setVal(val: any) {\n this._value = val;\n }\n\n\n /**\n * asserts the access path for a semi typed access\n * @param accessPath\n * @private\n */\n private assertAccessPath(...accessPath: Array<string>) {\n accessPath = this.preprocessKeys(...accessPath);\n if(!this.configDef) {\n //untyped\n return;\n }\n\n const ERR_ACCESS_PATH = \"Access Path to config invalid\";\n let currAccessPos: any = Optional.fromNullable(Object.keys(this.configDef).map(key => {\n let ret = {};\n ret[key] = this.configDef[key];\n return ret;\n }));\n\n for (let cnt = 0; cnt < accessPath.length; cnt++) {\n let currKey = this.keyVal(accessPath[cnt]);\n let arrPos: any = this.arrayIndex(accessPath[cnt]);\n\n //key index\n if(this.isArray(arrPos)) {\n if(currKey != \"\") {\n currAccessPos = Array.isArray(currAccessPos.value) ?\n Optional.fromNullable(new Es2019Array(...currAccessPos.value)\n .find(item => {\n return !!(item?.[currKey] ?? false)\n })?.[currKey]?.[arrPos]) :\n Optional.fromNullable(currAccessPos.value?.[currKey]?.[arrPos] ?? null);\n\n } else {\n currAccessPos = (Array.isArray(currAccessPos.value)) ?\n Optional.fromNullable(currAccessPos.value?.[arrPos]) : Optional.absent;\n }\n //we noe store either the current array or the filtered look ahead to go further\n } else {\n //we now have an array and go further with a singular key\n currAccessPos = (Array.isArray(currAccessPos.value)) ? Optional.fromNullable(new Es2019Array(...currAccessPos.value)\n .find(item => {\n return !! (item?.[currKey] ?? false);\n })?.[currKey]) :\n Optional.fromNullable(currAccessPos.value?.[currKey] ?? null);\n }\n if(!currAccessPos.isPresent()) {\n throw Error(ERR_ACCESS_PATH)\n }\n if(currAccessPos.value == CONFIG_ANY) {\n return;\n }\n }\n }\n\n /**\n * builds the config path\n *\n * @param accessPath a sequential array of accessPath containing either a key name or an array reference name[<index>]\n */\n private buildPath(...accessPath: string[]): Config {\n accessPath = this.preprocessKeys(...accessPath);\n let val = this;\n let parentVal = this.getClass().fromNullable(null);\n let parentPos = -1;\n let alloc = function (arr: Array<any>, length: number) {\n let length1 = arr.length;\n let length2 = length1 + length;\n for (let cnt = length1; cnt < length2; cnt++) {\n arr.push({});\n }\n };\n\n for (let cnt = 0; cnt < accessPath.length; cnt++) {\n let currKey = this.keyVal(accessPath[cnt]);\n let arrPos = this.arrayIndex(accessPath[cnt]);\n\n if (this.isArrayPos(currKey, arrPos)) {\n\n val.setVal((val.value instanceof Array) ? val.value : []);\n alloc(val.value, arrPos + 1);\n if (parentPos >= 0) {\n parentVal.value[parentPos] = val.value;\n }\n parentVal = val;\n parentPos = arrPos;\n val = this.getClass().fromNullable(val.value[arrPos]);\n continue;\n }\n\n let tempVal = <Config>val.getIf(currKey);\n if (this.isNoArray(arrPos)) {\n if (tempVal.isAbsent()) {\n tempVal = <Config>this.getClass().fromNullable(val.value[currKey] = {});\n } else {\n val = <any>tempVal;\n }\n } else {\n let arr = (tempVal.value instanceof Array) ? tempVal.value : [];\n alloc(arr, arrPos + 1);\n val.value[currKey] = arr;\n tempVal = this.getClass().fromNullable(arr[arrPos]);\n }\n parentVal = val;\n parentPos = arrPos;\n val = <any>tempVal;\n }\n\n return this;\n }\n\n private isNoArray(arrPos: number) {\n return arrPos == -1;\n }\n\n private isArray(arrPos: number) {\n return !this.isNoArray(arrPos);\n }\n\n private isArrayPos(currKey: string, arrPos: number) {\n return currKey === \"\" && arrPos >= 0;\n }\n\n}\n\n\n\n","/*!\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {DomQuery} from \"./DomQuery\";\nimport {Config} from \"./Monad\";\nimport {Es2019Array} from \"./Es2019Array\";\n\n/**\n * special status of the datasource location pointer\n * if an access, outside - of the possible data boundaries is happening\n * (example for instance current without a first next call, or next\n * which goes over the last possible dataset), an iteration status return\n * value is returned marking this boundary instead of a classical element\n *\n * Note this is only internally used but must be implemented to fulfill\n * internal contracts, the end user will never see those values if he uses\n * streams!\n */\nexport enum ITERATION_STATUS {\n EO_STRM = '__EO_STRM__',\n BEF_STRM = '___BEF_STRM__',\n}\n\nexport function calculateSkips(next_strm: IStreamDataSource<any>) {\n let pos = 1;\n while (next_strm.lookAhead(pos) != ITERATION_STATUS.EO_STRM) {\n pos++;\n }\n return --pos;\n}\n\n/**\n * Every data source wich feeds data into the lazy stream\n * or stream generally must implement this interface\n *\n * It is basically an iteratable to the core\n */\nexport interface IStreamDataSource<T> {\n\n /**\n * @returns true if additional data is present false if not\n */\n hasNext(): boolean;\n\n /**\n * returns the next element in the stream\n */\n next(): T | ITERATION_STATUS;\n\n /**\n * looks ahead cnt without changing the internal data \"pointers\" of the data source\n * (this is mostly needed by possibly infinite constructs like lazy streams,\n * because they do not know by definition their\n * boundaries)\n *\n * @param cnt the elements to look ahead\n * @return either the element or ITERATION_STATUS.EO_STRM if we hit the end of the stream before\n * finding the \"cnt\" element\n */\n lookAhead(cnt ?: number): T | ITERATION_STATUS;\n\n /**\n * returns the current element, returns the same element as the previous next call\n * if there is no next before current called then we will call next as initial element\n */\n current(): T | ITERATION_STATUS;\n\n /**\n * resets the position to the beginning\n */\n reset(): void;\n}\n\n/**\n * A collector, needs to be implemented\n */\nexport interface ICollector<T, S> {\n /**\n * this method basically takes a single stream element\n * and does something with it (collecting it one way or the other\n * in most cases)\n *\n * @param element\n */\n collect(element: T);\n\n /**\n * the final result after all the collecting is done\n */\n finalValue: S;\n}\n\n\n/**\n * A data source which combines multiple streams sequentially into one\n * (this is used internally by flatmap, but also can be used externally)\n */\nexport class MultiStreamDatasource<T> implements IStreamDataSource<T> {\n\n private activeStrm;\n private selectedPos = 0;\n private strms;\n\n constructor(private first, ...strms: Array<IStreamDataSource<T>>) {\n this.strms = [first].concat(...strms);\n this.activeStrm = this.strms[this.selectedPos];\n }\n\n current(): any {\n return this.activeStrm.current();\n }\n\n hasNext(): boolean {\n if(this.activeStrm.hasNext()) {\n return true;\n }\n if(this.selectedPos >= this.strms.length) {\n return false;\n }\n return this.findNextStrm() != -1;\n }\n\n private findNextStrm(): number {\n let hasNext = false;\n let cnt = this.selectedPos;\n while(!hasNext && cnt < this.strms.length) {\n hasNext = this.strms[cnt].hasNext();\n if(!hasNext) {\n cnt++;\n }\n }\n return hasNext ? cnt : -1;\n }\n\n lookAhead(cnt: number = 1): T | ITERATION_STATUS {\n //lets clone\n const strms = this.strms.slice(this.selectedPos);\n\n if(!strms.length) {\n return ITERATION_STATUS.EO_STRM;\n }\n\n const all_strms = [...strms];\n while(all_strms.length) {\n let next_strm = all_strms.shift();\n let lookAhead = next_strm.lookAhead(cnt);\n\n if (lookAhead != ITERATION_STATUS.EO_STRM) {\n return lookAhead;\n }\n cnt = cnt - calculateSkips(next_strm);\n }\n return ITERATION_STATUS.EO_STRM;\n }\n\n\n next(): any {\n if(this.activeStrm.hasNext()) {\n return this.activeStrm.next();\n }\n this.selectedPos = this.findNextStrm();\n if(this.selectedPos == -1) {\n return ITERATION_STATUS.EO_STRM;\n }\n this.activeStrm = this.strms[this.selectedPos];\n return this.activeStrm.next();\n }\n\n reset(): void {\n this.activeStrm = this.strms[0];\n this.selectedPos = 0;\n for(let cnt = 0; cnt < this.strms.length; cnt++) {\n this.strms[cnt].reset();\n }\n }\n\n}\n\n/**\n * defines a sequence of numbers for our stream input\n */\nexport class SequenceDataSource implements IStreamDataSource<number> {\n\n start: number;\n total: number;\n value: number;\n\n constructor(start: number, total: number) {\n this.total = total;\n this.start = start;\n this.value = start - 1;\n }\n\n\n hasNext(): boolean {\n return this.value < (this.total - 1);\n }\n\n next(): number | ITERATION_STATUS {\n this.value++;\n return this.value <= (this.total - 1) ? this.value : ITERATION_STATUS.EO_STRM;\n }\n\n lookAhead(cnt = 1): number | ITERATION_STATUS {\n if ((this.value + cnt) > this.total - 1) {\n return ITERATION_STATUS.EO_STRM;\n } else {\n return this.value + cnt;\n }\n }\n\n reset(): void {\n this.value = this.start - 1;\n }\n\n current(): number | ITERATION_STATUS {\n //first condition current without initial call for next\n return (this.start - 1) ? ITERATION_STATUS.BEF_STRM : this.value;\n }\n}\n\n\n/**\n * implementation of a datasource on top of a standard array\n */\nexport class ArrayStreamDataSource<T> implements IStreamDataSource<T> {\n value: Array<T>;\n dataPos = -1;\n\n constructor(...value: Array<T>) {\n this.value = value;\n }\n\n lookAhead(cnt = 1): T | ITERATION_STATUS {\n if ((this.dataPos + cnt) > this.value.length - 1) {\n return ITERATION_STATUS.EO_STRM;\n }\n return this.value[this.dataPos + cnt];\n }\n\n hasNext(): boolean {\n return this.value.length - 1 > this.dataPos;\n }\n\n next(): T | ITERATION_STATUS {\n this.dataPos++;\n return this?.value[this.dataPos] ?? ITERATION_STATUS.EO_STRM;\n }\n\n reset() {\n this.dataPos = -1;\n }\n\n current(): T {\n return this.value[Math.max(0, this.dataPos)];\n }\n}\n\n/**\n * an intermediate data source which prefilters\n * incoming stream data\n * and lets only the data out which\n * passes the filter function check\n */\nexport class FilteredStreamDatasource<T> implements IStreamDataSource<T> {\n\n filterFunc: (T) => boolean;\n inputDataSource: IStreamDataSource<T>;\n\n _current: T | ITERATION_STATUS = ITERATION_STATUS.BEF_STRM;\n // we have to add a filter idx because the external filter values might change over time, so\n // we cannot reset the state properly unless we do it from a snapshot\n _filterIdx = {};\n _unfilteredPos = 0;\n\n constructor(filterFunc: (T) => boolean, parent: IStreamDataSource<T>) {\n this.filterFunc = filterFunc;\n this.inputDataSource = parent;\n }\n\n /**\n * in order to filter we have to make a look ahead until the\n * first next allowed element\n * hence we prefetch the element and then\n * serve it via next\n */\n hasNext(): boolean {\n let steps = 1;\n let found = false;\n let next;\n\n while (!found && (next = this.inputDataSource.lookAhead(steps)) != ITERATION_STATUS.EO_STRM) {\n if (this.filterFunc(next)) {\n this._filterIdx[this._unfilteredPos + steps] = true;\n found = true;\n } else {\n steps++;\n }\n }\n return found;\n }\n\n /**\n * serve the next element\n */\n next(): T | ITERATION_STATUS {\n let found: T | ITERATION_STATUS = ITERATION_STATUS.EO_STRM;\n while (this.inputDataSource.hasNext()) {\n this._unfilteredPos++;\n let next: T = <T>this.inputDataSource.next();\n //again here we cannot call the filter function twice, because its state might change, so if indexed, we have a decent snapshot, either has next or next can trigger\n //the snapshot\n if (next != ITERATION_STATUS.EO_STRM &&\n ((this._filterIdx?.[this._unfilteredPos] ?? false) || this.filterFunc(next))) {\n this._filterIdx[this._unfilteredPos] = true;\n found = next;\n break;\n }\n }\n this._current = found as T;\n return found;\n }\n\n /**\n * looks ahead cnt without changing the internal data \"pointers\" of the data source\n * (this is mostly needed by LazyStreams, because they do not know by definition their\n * boundaries)\n *\n * @param cnt the elements to look ahead\n * @return either the element or ITERATION_STATUS.EO_STRM if we hit the end of the stream before\n * finding the \"cnt\" element\n */\n lookAhead(cnt = 1): ITERATION_STATUS | T {\n let lookupVal: T | ITERATION_STATUS;\n\n for (let loop = 1; cnt > 0 && (lookupVal = this.inputDataSource.lookAhead(loop)) != ITERATION_STATUS.EO_STRM; loop++) {\n let inCache = this._filterIdx?.[this._unfilteredPos + loop];\n if (inCache || this.filterFunc(lookupVal)) {\n cnt--;\n this._filterIdx[this._unfilteredPos + loop] = true;\n }\n }\n return lookupVal;\n }\n\n current(): T | ITERATION_STATUS {\n return this._current;\n }\n\n reset(): void {\n this._current = ITERATION_STATUS.BEF_STRM;\n this._filterIdx = {};\n this._unfilteredPos = 0;\n this.inputDataSource.reset();\n }\n}\n\n/**\n * an intermediate datasource which maps the items from\n * one into another\n */\nexport class MappedStreamDataSource<T, S> implements IStreamDataSource<S> {\n\n mapFunc: (T) => S;\n inputDataSource: IStreamDataSource<T>;\n\n constructor(mapFunc: (T) => S, parent: IStreamDataSource<T>) {\n this.mapFunc = mapFunc;\n this.inputDataSource = parent;\n }\n\n hasNext(): boolean {\n return this.inputDataSource.hasNext();\n }\n\n next(): S {\n return this.mapFunc(this.inputDataSource.next());\n }\n\n reset(): void {\n this.inputDataSource.reset();\n }\n\n current(): S {\n return this.mapFunc(this.inputDataSource.current());\n }\n\n lookAhead(cnt = 1): ITERATION_STATUS | S {\n const lookAheadVal = this.inputDataSource.lookAhead(cnt);\n return (lookAheadVal == ITERATION_STATUS.EO_STRM) ? lookAheadVal as ITERATION_STATUS : this.mapFunc(lookAheadVal) as S;\n }\n}\n\n\n/**\n * For the time being we only need one collector\n * a collector which collects a stream back into arrays\n */\nexport class ShimArrayCollector<S> implements ICollector<S, Array<S>> {\n private data: Array<S> = new Es2019Array(...[]);\n\n collect(element: S) {\n this.data.push(element);\n }\n\n get finalValue(): Array<S> {\n return this.data;\n }\n}\n\n/**\n * collects the values as inverse array\n */\nexport class InverseArrayCollector<S> implements ICollector<S, Array<S>> {\n private data: Array<S> = [];\n\n collect(element: S) {\n this.data.unshift(element);\n }\n\n get finalValue(): Array<S> {\n return this.data;\n }\n}\n\n\n/**\n * collects an tuple array stream into an assoc array with elements being collected into arrays\n *\n */\nexport class ArrayAssocArrayCollector<S> implements ICollector<[string, S] | string, { [key: string]: S }> {\n finalValue: { [key: string]: any } = {};\n\n collect(element: [string, S] | string) {\n let key = element?.[0] ?? <string>element;\n this.finalValue[key] = this.finalValue?.[key] ?? [];\n this.finalValue[key].push(element?.[1] ?? true);\n }\n}\n\n/**\n * dummy collector which just triggers a run\n * on lazy streams without collecting anything\n */\nexport class Run<S> implements ICollector<S, any> {\n collect(element: S) {\n\n }\n\n get finalValue(): any {\n return null;\n }\n}\n\n/**\n * collects an assoc stream back to an assoc array\n */\nexport class AssocArrayCollector<S> implements ICollector<[string, S] | string, { [key: string]: S }> {\n\n finalValue: { [key: string]: any } = {};\n\n collect(element: [string, S] | string) {\n this.finalValue[element[0] ?? <string>element] = element[1] ?? true;\n }\n}\n\n\n/**\n * A Config collector similar to the FormDFata Collector\n */\nexport class ConfigCollector implements ICollector<{ key: string, value: any }, Config> {\n finalValue: Config = new Config({});\n\n collect(element: { key: string; value: any }) {\n this.finalValue.append(element.key).value = element.value;\n }\n}\n\n\n/**\n * Form data collector for key value pair streams\n */\nexport class FormDataCollector implements ICollector<{ key: string, value: any }, FormData> {\n finalValue: FormData = new FormData();\n\n collect(element: { key: string; value: any }) {\n this.finalValue.append(element.key, element.value);\n }\n}\n\n/**\n * Form data collector for DomQuery streams\n */\nexport class QueryFormDataCollector implements ICollector<DomQuery, FormData> {\n finalValue: FormData = new FormData();\n\n collect(element: DomQuery) {\n let toMerge = element.encodeFormElement();\n if (toMerge.isPresent()) {\n this.finalValue.append(element.name.value, toMerge.get(element.name).value);\n }\n }\n}\n\n/**\n * Encoded String collector from dom query streams\n */\nexport class QueryFormStringCollector implements ICollector<DomQuery, string> {\n\n formData: [[string, string]] = <any>[];\n\n collect(element: DomQuery) {\n let toMerge = element.encodeFormElement();\n if (toMerge.isPresent()) {\n this.formData.push([element.name.value, toMerge.get(element.name).value]);\n }\n }\n\n get finalValue(): string {\n return new Es2019Array(...this.formData)\n .map(keyVal => keyVal.join(\"=\"))\n .reduce((item1, item2) => [item1, item2].join(\"&\"));\n }\n}\n\n/**\n * For the time being we only need one collector\n * a collector which collects a stream back into arrays\n */\nexport class ArrayCollector<S> implements ICollector<S, Array<S>> {\n private data: Array<S> = [];\n\n collect(element: S) {\n this.data.push(element);\n }\n\n get finalValue(): Array<S> {\n return this.data;\n }\n}\n","/*!\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Lang} from \"./Lang\";\nimport {DomQuery} from \"./DomQuery\";\nimport isString = Lang.isString;\nimport {_global$} from \"./Global\";\n\ndeclare let ActiveXObject: any;\n\n/**\n * xml query as specialized case for DomQuery\n */\nexport class XMLQuery extends DomQuery {\n\n constructor(rootNode: Document | string | DomQuery, docType: string = \"text/xml\") {\n\n let createIe11DomQueryShim = (): DOMParser => {\n //at the time if wroting ie11 is the only relevant browser\n //left withut any DomQuery support\n let parser = new ActiveXObject(\"Microsoft.XMLDOM\");\n parser.async = false;\n //we shim th dom parser from ie in\n return <any>{\n parseFromString: (text: string, contentType: string): Document => {\n return parser.loadXML(text);\n }\n }\n };\n\n let parseXML = (xml: string): Document => {\n if (xml == null) {\n return null;\n }\n let domParser: DOMParser = Lang.saveResolveLazy<DOMParser>(\n () => new (_global$()).DOMParser(),\n (): DOMParser => createIe11DomQueryShim()\n ).value;\n return domParser.parseFromString(xml, <any> docType);\n };\n\n if (isString(rootNode)) {\n super(parseXML(<string>rootNode))\n } else {\n super(rootNode);\n }\n }\n\n isXMLParserError(): boolean {\n return this.querySelectorAll(\"parsererror\").isPresent();\n }\n\n toString(): string {\n let ret = [];\n this.eachElem((node: any) => {\n let serialized = (_global$())?.XMLSerializer?.constructor()?.serializeToString(node) ?? node?.xml;\n if (!!serialized) {\n ret.push(serialized);\n }\n });\n return ret.join(\"\");\n }\n\n parserErrorText(joinstr: string): string {\n return this.querySelectorAll(\"parsererror\").textContent(joinstr);\n }\n\n static parseXML(txt: string): XMLQuery {\n return new XMLQuery(txt);\n }\n\n static parseHTML(txt: string): XMLQuery {\n return new XMLQuery(txt, \"text/html\");\n }\n\n static fromString(txt: string, parseType: string = \"text/xml\"): XMLQuery {\n return new XMLQuery(txt, parseType);\n }\n}\n\nexport const XQ = XMLQuery;\nexport type XQ = XMLQuery;","/*!\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\nexport {DomQuery, ElementAttribute, DomQueryCollector, DQ, DQ$} from \"./DomQuery\";\nexport {Lang} from \"./Lang\";\nexport {Config, CONFIG_VALUE, CONFIG_ANY, ConfigDef, Monad, IValueHolder, IFunctor, IMonad, IIdentity, Optional, ValueEmbedder} from \"./Monad\";\nexport {XMLQuery, XQ} from \"./XmlQuery\";\n\n\n\n\n\n\n\n","/*! Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {Implementation} from \"../impl/AjaxImpl\";\nimport {PushImpl} from \"../impl/PushImpl\";\nimport {oam as _oam} from \"../myfaces/OamSubmit\";\nimport {$nsp, CTX_OPTIONS_EXECUTE, CTX_OPTIONS_PARAMS, CTX_PARAM_RENDER, P_BEHAVIOR_EVENT} from \"../impl/core/Const\";\nimport {ErrorData} from \"../impl/xhrCore/ErrorData\";\nimport {EventData} from \"../impl/xhrCore/EventData\";\n\n//we use modules to get a proper jsdoc and static/map structure in the calls\n//as per spec requirement\nexport module faces {\n\n\n /**\n * Version of the implementation for the faces.ts.\n * <p />\n * as specified within the jsf specifications faces.html:\n * <ul>\n * <li>left two digits major release number</li>\n * <li>middle two digits minor spec release number</li>\n * <li>right two digits bug release number</li>\n * </ul>\n * @constant\n */\n export var specversion = 400000;\n /**\n * Implementation version as specified within the jsf specification.\n * <p />\n * A number increased with every implementation version\n * and reset by moving to a new spec release number\n *\n * @constant\n */\n export var implversion = 0;\n\n /**\n * SeparatorChar as defined by facesContext.getNamingContainerSeparatorChar()\n */\n export var separatorchar: string = getSeparatorChar();\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Context Path as defined externalContext.requestContextPath\n */\n export var contextpath: string = '#{facesContext.externalContext.requestContextPath}';\n // we do not have a fallback here, for now\n\n /**\n * This method is responsible for the return of a given project stage as defined\n * by the jsf specification.\n * <p/>\n * Valid return values are:\n * <ul>\n * <li>"Production"</li>\n * <li>"Development"</li>\n * <li>"SystemTest"</li>\n * <li>"UnitTest"</li>\n * </li>\n *\n * @return {String} the current project state emitted by the server side method:\n * <i>jakarta.faces.application.Application.getProjectStage()</i>\n */\n export function getProjectStage(): string {\n return Implementation.getProjectStage();\n }\n\n /**\n * collect and encode data for a given form element (must be of type form)\n * find the jakarta.faces.ViewState element and encode its value as well!\n * return a concatenated string of the encoded values!\n *\n * @throws an exception in case of the given element not being of type form!\n * https://issues.apache.org/jira/browse/MYFACES-2110\n */\n export function getViewState(formElement: Element | string): string {\n return Implementation.getViewState(formElement);\n }\n\n /**\n * returns the window identifier for the given node / window\n * @return the window identifier or null if none is found\n * @param rootNode\n */\n export function getClientWindow(rootNode?: Element | string): string {\n return Implementation.getClientWindow(rootNode);\n }\n\n // private helper functions\n function getSeparatorChar(): string {\n const sep = '#{facesContext.namingContainerSeparatorChar}';\n //We now enable standalone mode, the separator char was not mapped we make a fallback to 2.3 behavior\n //the idea is that the separator char is provided from the underlying container, but if not then we\n //will perform a fallback (aka 2.3 has the url fallback behavior)\n return (sep.match(/\\#\\{facesContext.namingContainerSeparatorChar\\}/gi)) ? Implementation.getSeparatorChar() : sep;\n }\n\n\n\n\n export module ajax {\n \"use strict\";\n\n /**\n * this function has to send the ajax requests\n *\n * following request conditions must be met:\n * <ul>\n * <li> the request must be sent asynchronously! </li>\n * <li> the request must be a POST!!! request </li>\n * <li> the request url must be the form action attribute </li>\n * <li> all requests must be queued with a client side request queue to ensure the request ordering!</li>\n * </ul>\n *\n * @param {String|Node} element: any dom element no matter being it html or jsf, from which the event is emitted\n * @param {EVENT} event: any javascript event supported by that object\n * @param {Map} options : map of options being pushed into the ajax cycle\n */\n export function request(element: Element, event?: Event, options?: Options): void {\n Implementation.request(element, event, options)\n }\n\n /**\n * response handler\n * @param request the request object having triggered this response\n * @param context the request context\n *\n */\n export function response(request: XMLHttpRequest, context?: Context): void {\n Implementation.response(request, context);\n }\n\n /**\n * Adds an error handler to our global error queue.\n * the error handler must be of the format <i>function errorListener(<errorData>)</i>\n * with errorData being of following format:\n * <ul>\n * <li> errorData.type : "error"</li>\n * <li> errorData.status : the error status message</li>\n * <li> errorData.serverErrorName : the server error name in case of a server error</li>\n * <li> errorData.serverErrorMessage : the server error message in case of a server error</li>\n * <li> errorData.source : the issuing source element which triggered the request </li>\n * <li> eventData.responseCode: the response code (aka http request response code, 401 etc...) </li>\n * <li> eventData.responseText: the request response text </li>\n * <li> eventData.responseXML: the request response xml </li>\n * </ul>\n *\n * @param errorFunc error handler must be of the format <i>function errorListener(<errorData>)</i>\n */\n export function addOnError(errorFunc: (data: ErrorData) => void): void {\n Implementation.addOnError(<any>errorFunc);\n }\n\n /**\n * Adds a global event listener to the ajax event queue. The event listener must be a function\n * of following format: <i>function eventListener(<eventData>)</i>\n *\n * @param eventFunc event must be of the format <i>function eventListener(<eventData>)</i>\n */\n export function addOnEvent(eventFunc: (data: EventData) => void): void {\n Implementation.addOnEvent(<any>eventFunc);\n }\n }\n\n export module util {\n\n /**\n * varargs function which executes a chain of code (functions or any other code)\n *\n * if any of the code returns false, the execution\n * is terminated prematurely skipping the rest of the code!\n *\n * @param {HTMLElement | String} source, the callee object\n * @param {Event} event, the event object of the callee event triggering this function\n * @param funcs ... arbitrary array of functions or strings\n * @returns true if the chain has succeeded false otherwise\n */\n export function chain(source: HTMLElement | string, event: Event | null, ...funcs: Array<Function | string>): boolean {\n return Implementation.chain(source, event, ...(funcs as EvalFuncs));\n }\n }\n\n export module push {\n /**\n * @param socketClientId the sockets client identifier\n * @param url the uri to reach the socket\n * @param channel the channel name/id\n * @param onopen The function to be invoked when the web socket is opened.\n * @param onmessage The function to be invoked when a message is received.\n * @param onerror The function to be invoked when an error occurs.\n * @param onclose The function to be invoked when the web socket is closed.\n * @param behaviors functions which are invoked whenever a message is received\n * @param autoConnect Whether or not to automatically open the socket. Defaults to <code>false</code>.\n */\n export function init(socketClientId: string,\n url: string,\n channel: string,\n onopen: Function,\n onmessage: Function,\n onerror: Function,\n onclose: Function,\n behaviors: any,\n autoConnect: boolean): void {\n PushImpl.init(socketClientId, url, channel, onopen, onmessage, onerror, onclose, behaviors, autoConnect);\n }\n\n /**\n * Open the web socket on the given channel.\n * @param socketClientId The name of the web socket channel.\n * @throws Error is thrown, if the channel is unknown.\n */\n export function open(socketClientId: string): void {\n PushImpl.open(socketClientId);\n }\n\n /**\n * Close the web socket on the given channel.\n * @param socketClientId The id of the web socket client.\n * @throws Error is thrown, if the channel is unknown.\n */\n export function close(socketClientId: string): void {\n PushImpl.close(socketClientId);\n }\n\n }\n}\n\nexport module myfaces {\n /**\n * AB function similar to mojarra and Primefaces\n * not part of the spec but a convenience accessor method\n * Code provided by Thomas Andraschko\n *\n * @param source the event source\n * @param event the event\n * @param eventName event name for java.jakarta.faces.behavior.evemnt\n * @param execute execute list as passed down in faces.ajax.request\n * @param render the render list as string\n * @param options the options which need to be mered in\n */\n export function ab(source: Element, event: Event, eventName: string, execute: string, render: string, options: Options = {}): void {\n if (eventName) {\n options[CTX_OPTIONS_PARAMS] = options?.[CTX_OPTIONS_PARAMS] ?? {};\n options[CTX_OPTIONS_PARAMS][$nsp(P_BEHAVIOR_EVENT)] = eventName;\n }\n if (execute) {\n options[CTX_OPTIONS_EXECUTE] = execute;\n }\n if (render) {\n options[CTX_PARAM_RENDER] = render;\n }\n\n (window?.faces ?? window.jsf).ajax.request(source, event, options);\n }\n\n\n const onReadyChain: Array<() => void> = [];\n let readyStateListener = null;\n // noinspection JSUnusedGlobalSymbols\n /**\n * Helper function in the myfaces namespace to handle document ready properly for the load case\n * the ajax case, does not need proper treatment, since it is deferred anyway.\n * Used by command script as helper function!\n *\n * @param executionFunc the function to be executed upon ready\n */\n export function onOnDomReady(executionFunc: () => void) {\n if(document.readyState !== \"complete\") {\n onReadyChain.push(executionFunc);\n if(!readyStateListener) {\n readyStateListener = () => {\n window.removeEventListener(\"DOMContentLoaded\", readyStateListener);\n readyStateListener = null;\n try {\n onReadyChain.forEach(func => func());\n } finally {\n //done we clear now the ready chain\n onReadyChain.length = 0;\n }\n };\n window.addEventListener(\"DOMContentLoaded\", readyStateListener);\n }\n } else {\n if(readyStateListener) {\n readyStateListener();\n }\n executionFunc();\n }\n\n }\n\n /**\n * legacy oam functions\n */\n export const oam = _oam;\n}\n\n\n","/*! Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {IListener} from \"./util/IListener\";\nimport {Response} from \"./xhrCore/Response\";\nimport {XhrRequest} from \"./xhrCore/XhrRequest\";\nimport {AsynchronousQueue} from \"./util/AsyncQueue\";\nimport {AssocArrayCollector, Config, DQ, Lang, LazyStream, Optional, Stream} from \"mona-dish\";\nimport {Assertions} from \"./util/Assertions\";\nimport {ExtConfig, ExtDomQuery} from \"./util/ExtDomQuery\";\nimport {ErrorData} from \"./xhrCore/ErrorData\";\nimport {EventData} from \"./xhrCore/EventData\";\nimport {ExtLang} from \"./util/Lang\";\n\nimport {\n CTX_OPTIONS_EXECUTE,\n CTX_PARAM_REQ_PASS_THR,\n CTX_PARAM_SRC_CTL_ID,\n CTX_PARAM_SRC_FRM_ID,\n IDENT_ALL,\n IDENT_FORM,\n IDENT_NONE,\n IDENT_THIS,\n MYFACES,\n ON_ERROR,\n ON_EVENT,\n P_AJAX,\n P_CLIENT_WINDOW,\n P_EVT,\n P_EXECUTE,\n P_PARTIAL_SOURCE,\n P_RENDER,\n P_RESET_VALUES,\n P_WINDOW_ID,\n CTX_PARAM_RENDER,\n SOURCE,\n HTML_TAG_FORM,\n CTX_OPTIONS_PARAMS,\n VIEW_ID,\n $faces,\n EMPTY_STR,\n CTX_PARAM_MF_INTERNAL,\n NAMED_VIEWROOT,\n NAMING_CONTAINER_ID\n} from \"./core/Const\";\nimport {\n resolveDefaults,\n resolveDelay,\n resolveForm,\n resolveTimeout, resolveViewId, resolveViewRootId, resoveNamingContainerMapper\n} from \"./xhrCore/RequestDataResolver\";\nimport {encodeFormData} from \"./util/FileUtils\";\n\n/*\n * allowed project stages\n */\nenum ProjectStages {\n Production = \"Production\",\n Development = \"Development\",\n SystemTest = \"SystemTest\",\n UnitTest = \"UnitTest\"\n}\n\n/*\n * Block-filter for the pass-through filtering; the attributes given here\n * will not be transmitted from the options into the pass-through\n */\nenum BlockFilter {\n onerror = \"onerror\",\n onevent = \"onevent\",\n render = \"render\",\n execute = \"execute\",\n myfaces = \"myfaces\",\n delay = \"delay\",\n timeout = \"timeout\",\n resetValues = \"resetValues\",\n windowId = \"windowId\",\n params = \"params\"\n}\n\n/**\n * Core Implementation\n * to distinct between api and impl\n *\n * The original idea was to make the implementation pluggable\n * but this is pointless, you always can overwrite the thin api layer\n * however a dedicated api makes sense for readability reasons\n */\nexport module Implementation {\n/*\n Small internal explanation, this code is optimized for readability\n and cuts off a ton of old legacy code.\n Aka older browsers are not supported anymore.\n We use a self written helper library to keep the number of exernal\n code dependencies down.\n The library is called mona-dish and started as a small sideproject of mine\n it provides following\n\n a) Monad like structures for querying because this keeps the code denser and adds abstractions\n that always was the strong point of jquery and it still is better in this regard than what ecmascript provides\n\n b) Streams and lazy streams like java has, a pull stream construct, ecmascript does not have anything like it.\n (it has array filters and maps, but ES2015 does not support flatMap)\n Another option would have been rxjs but that would have introduced a code dependency and probably more code. We might\n move to RXJS if the need arises, however. But for now I would rather stick with my small self grown library which works\n quite well and where I can patch quickly (I have used it in several industrial projects, so it works well\n and is heavily fortified by unit tests (140 testcases as time of writing this))\n The long term plan is to eliminate the Stream usage as soon as we can move up to ES2019 (adding the missing\n functions as shims, is a no go, because we are a library, and absolutey do not Shim anything which can leak\n into the global namespace!)\n\n c) A neutral json like configuration which allows assignments of arbitrary values with reduce code which then can be\n transformed into different data representations\n\n examples:\n internalCtx.assign(MYPARAM, CTX_PARAM_SRC_FRM_ID).value = form.id.value;\n passes a value into context.MYPARAM.CTX_PARAM_SRC_FRM_ID\n\n basically an abbreviation for\n\n internalCtxt[MYPARAM] = internalCtxt?.[MYPARAM] ? internalCtxt[MYPARAM] : {};\n internalCtxt[MYPARAM][CTX_PARAM_SRC_FRM_ID] = internalCtxt?.[MYPARAM][CTX_PARAM_SRC_FRM_ID] ? internalCtxt[MYPARAM][CTX_PARAM_SRC_FRM_ID] : {};\n internalCtxt[MYPARAM][CTX_PARAM_SRC_FRM_ID] = form.id.value;\n\n\n internalCtx.assign(condition, MYPARAM, CTX_PARAM_SRC_FRM_ID).value = form.id.value;\n passes a value into context.MYPARAM.CTX_PARAM_SRC_FRM_ID if condition === true otherwise it is ignored\n\n abbreviates:\n if(condition) {\n internalCtxt[MYPARAM] = internalCtxt?.[MYPARAM] ? internalCtxt[MYPARAM] : {};\n internalCtxt[MYPARAM][CTX_PARAM_SRC_FRM_ID] = internalCtxt?.[MYPARAM][CTX_PARAM_SRC_FRM_ID] ? internalCtxt[MYPARAM][CTX_PARAM_SRC_FRM_ID] : {};\n internalCtxt[MYPARAM][CTX_PARAM_SRC_FRM_ID] = form.id.value;\n }\n\n\n d) Optional constructs, while under heavy debate we only use them lightly where the api requires it from mona-dish\n\n Note the inclusion of this library uses a reduced build which only includes the part of it, which we really use\n\n */\n\n import trim = Lang.trim;\n import getMessage = ExtLang.getMessage;\n import getGlobalConfig = ExtLang.getGlobalConfig;\n import assert = Assertions.assert;\n\n let projectStage: string = null;\n let separator: string = null;\n let eventQueue = [];\n let errorQueue = [];\n export let requestQueue: AsynchronousQueue<XhrRequest> = null;\n /*error reporting threshold*/\n let threshold = \"ERROR\";\n\n /**\n * fetches the separator char from the given script tags\n *\n * @return {string} the separator char for the given script tags\n */\n export function getSeparatorChar(): string {\n return resolveGlobalConfig()?.separator ??\n this?.separator ??\n (separator = ExtDomQuery.searchJsfJsFor(/separator=([^&;]*)/).orElse(\":\").value);\n }\n\n /**\n * this is for testing purposes only, since AjaxImpl is a module\n * we need to reset for every unit test its internal states\n */\n export function reset() {\n projectStage = null;\n separator = null;\n eventQueue = [];\n errorQueue = [];\n requestQueue = null;\n }\n\n /**\n * @return the project stage also emitted by the server:\n * it cannot be cached and must be delivered over the server\n * The value for it comes from the request parameter of the faces.js script called \"stage\".\n */\n export function getProjectStage(): string | null {\n return resolveGlobalConfig()?.projectStage ??\n this?.projectStage ??\n (projectStage = resolveProjectStateFromURL());\n }\n\n /**\n * resolves the project stage as url parameter\n * @return the project stage or null\n */\n export function resolveProjectStateFromURL(): string | null {\n\n /* run through all script tags and try to find the one that includes faces.js */\n const foundStage = ExtDomQuery.searchJsfJsFor(/stage=([^&;]*)/).value as string;\n return (foundStage in ProjectStages) ? foundStage : ProjectStages.Production; // MYFACES-4572: default is production\n }\n\n /**\n * implementation of the faces.util.chain functionality\n *\n * @param source\n * @param event\n * @param funcs\n */\n export function chain(source: HTMLElement | string, event: Event | null, ...funcs: EvalFuncs): boolean {\n // we can use our lazy stream each functionality to run our chain here..\n // by passing a boolean as return value into the onElem call\n // we can stop early at the first false, just like the spec requests\n\n return LazyStream.of(...funcs)\n .map(func => resolveAndExecute(source, event, func))\n // we use the return false == stop as an early stop, onElem stops at the first false\n .onElem((opResult: boolean) => opResult)\n //last ensures we run until the first false is returned\n .last().value;\n }\n\n /**\n * this function has to send the ajax requests\n *\n * following request conditions must be met:\n * <ul>\n * <li> the request must be sent asynchronously! </li>\n * <li> the request must be a POST!!! request </li>\n * <li> the request url must be the form action attribute </li>\n * <li> all requests must be queued with a client side request queue to ensure the request ordering!</li>\n * </ul>\n *\n * @param el any dom element no matter being it html or jsf, from which the event is emitted\n * @param event any javascript event supported by that object\n * @param opts map of options being pushed into the ajax cycle\n *\n * a) transformArguments out of the function\n * b) passThrough handling with a map copy with a filter map block map\n */\n export function request(el: ElemDef, event?: Event, opts ?: Options) {\n\n const {\n options,\n elem,\n elementId,\n windowId,\n isResetValues\n } = resolveDefaults(event, opts, el);\n const requestCtx = new ExtConfig({});\n const internalCtx = new ExtConfig({});\n\n Assertions.assertRequestIntegrity(options, elem);\n\n /**\n * fetch the parent form\n *\n * note we also add an override possibility here\n * so that people can use dummy forms and work\n * with detached objects\n */\n const form: DQ = resolveForm(elem, event);\n const viewId: string = resolveViewId(form);\n const formId = form.id.value;\n const delay: number = resolveDelay(options);\n const timeout: number = resolveTimeout(options);\n\n requestCtx.assignIf(!!windowId, P_WINDOW_ID).value = windowId;\n\n // old non spec behavior will be removed after it is clear whether the removal breaks any code\n requestCtx.assign(CTX_PARAM_REQ_PASS_THR).value = extractLegacyParams(options.value);\n\n // spec conform behavior, all passthrough params must be under \"passthrough\n const params = remapArrayToAssocArr(options.getIf(CTX_OPTIONS_PARAMS).orElse({}).value);\n //we turn off the remapping for the param merge, because we do not want to have\n //any namespacing to be remapped\n\n let ctxPassthrough = requestCtx.getIf(CTX_PARAM_REQ_PASS_THR) as ExtConfig;\n ctxPassthrough.$nspEnabled = false;\n ctxPassthrough.shallowMerge(new Config(params), true);\n //now we turn it on again\n ctxPassthrough.$nspEnabled = true;\n requestCtx.assignIf(!!event, CTX_PARAM_REQ_PASS_THR, P_EVT).value = event?.type;\n\n /**\n * ajax pass through context with the source\n * onresolved Event and onerror Event\n */\n requestCtx.assign(SOURCE).value = elementId;\n\n requestCtx.assign(VIEW_ID).value = viewId;\n\n /**\n * on resolvedEvent and onError...\n * those values will be traversed later on\n * also into the response context\n */\n requestCtx.assign(ON_EVENT).value = options.value?.onevent;\n requestCtx.assign(ON_ERROR).value = options.value?.onerror;\n\n /**\n * lets drag the myfaces config params also in\n */\n requestCtx.assign(MYFACES).value = options.value?.myfaces;\n\n /**\n * binding contract the jakarta.faces.source must be set\n */\n requestCtx.assign(CTX_PARAM_REQ_PASS_THR, P_PARTIAL_SOURCE).value = elementId;\n\n /**\n * jakarta.faces.partial.ajax must be set to true\n */\n requestCtx.assign(CTX_PARAM_REQ_PASS_THR, P_AJAX).value = true;\n\n /**\n * if resetValues is set to true\n * then we have to set jakarta.faces.resetValues as well\n * as pass through parameter\n * the value has to be explicitly true, according to\n * the specs jsdoc\n */\n requestCtx.assignIf(isResetValues, CTX_PARAM_REQ_PASS_THR, P_RESET_VALUES).value = true;\n\n // additional meta information to speed things up, note internal non jsf\n // pass through options are stored under _mfInternal in the context\n internalCtx.assign(CTX_PARAM_SRC_FRM_ID).value = formId;\n\n // mojarra compatibility, mojarra is sending the form id as well\n // this is not documented behavior but can be determined by running\n // mojarra under blackbox conditions.\n // I assume it does the same as our formId_submit=1 so leaving it out\n // won't hurt but for the sake of compatibility we are going to add it\n requestCtx.assign(CTX_PARAM_REQ_PASS_THR, formId).value = formId;\n internalCtx.assign(CTX_PARAM_SRC_CTL_ID).value = elementId;\n\n assignClientWindowId(form, requestCtx);\n assignExecute(options, requestCtx, form, elementId);\n assignRender(options, requestCtx, form, elementId);\n assignNamingContainerData(internalCtx, form);\n\n //now we enqueue the request as asynchronous runnable into our request\n //queue and let the queue take over the rest\n queueHandler.addRequestToQueue(elem, form, requestCtx, internalCtx, delay, timeout);\n }\n\n /**\n * Spec. 13.3.3\n * Examining the response markup and updating the DOM tree\n * @param {XMLHttpRequest} request - the ajax request\n * @param {Object} context - the ajax context\n */\n export function response(request: XMLHttpRequest, context: Context) {\n Response.processResponse(request, context);\n }\n\n /**\n * adds an error handler to the error queue\n *\n * @param errorListener the error listener handler\n */\n export function addOnError(errorListener: IListener<ErrorData>) {\n errorQueue.push(errorListener);\n }\n\n /**\n * adds an event handler to the event queue\n *\n * @param eventListener the event listener handler\n */\n export function addOnEvent(eventListener: IListener<EventData>) {\n eventQueue.push(eventListener);\n }\n\n // noinspection JSUnusedLocalSymbols\n /**\n * sends an event to the event handlers\n *\n * @param data the event data object hosting the event data according to the spec @see EventData for what is reachable\n * @param localHandler an optional event handler, which is processed before the event handler chain\n */\n export function sendEvent(data: EventData, localHandler = function (data: EventData) {\n }) {\n /*now we serve the queue as well*/\n localHandler(data);\n eventQueue.forEach(fn => fn(data));\n }\n\n /**\n * error handler behavior called internally\n * and only into the impl it takes care of the\n * internal message transformation to a myfaces internal error\n * and then uses the standard send error mechanisms\n * also a double error logging prevention is done as well\n *\n * @param request the request currently being processed\n * @param context the context affected by this error\n * @param exception the exception being thrown\n * @param clearRequestQueue if set to true, clears the request queue of all pending requests\n */\n export function stdErrorHandler(request: XMLHttpRequest,\n context: Config,\n exception: Error,\n clearRequestQueue = false) {\n //newer browsers do not allow to hold additional values on native objects like exceptions\n //we hence capsule it into the request, which is gced automatically\n //on ie as well, since the stdErrorHandler usually is called between requests\n //this is a valid approach\n try {\n if (threshold == \"ERROR\") {\n let errorData = ErrorData.fromClient(exception);\n sendError(errorData);\n }\n } finally {\n if (clearRequestQueue) {\n requestQueue.cleanup();\n }\n }\n }\n\n // noinspection JSUnusedLocalSymbols\n /**\n * implementation triggering the error chain\n *\n *\n *\n * handles the errors, in case of an onError exists within the context the onError is called as local error handler\n * the registered error handlers in the queue received an error message to be dealt with\n * and if the projectStage is at development an alert box is displayed\n *\n * note: we have additional functionality here, via the global config myfaces.config.defaultErrorOutput a function can be provided\n * which changes the default output behavior from alert to something else\n *\n * @param errorData the error data to be displayed\n * @param localHandler an optional local error handler which has to be processed before the error handler queue\n */\n export function sendError(errorData: ErrorData, localHandler = function (data: ErrorData) {\n }) {\n\n localHandler(errorData);\n errorQueue.forEach((errorCallback: Function) => {\n errorCallback(errorData);\n });\n let displayError: (string) => void = getGlobalConfig(\"defaultErrorOutput\", (console ? console.error : alert));\n displayError(errorData);\n }\n\n /**\n * @node optional element or id defining a rootnode where an element with the id \"jakarta.faces.windowId\" is hosted\n * @return the client window id of the current window, if one is given if none is found, null is returned\n */\n export function getClientWindow(node ?: Element | string): string | null {\n const ALTERED = \"___mf_id_altered__\";\n const INIT = \"___init____\";\n\n /*\n * the search root for the dom element search\n */\n let searchRoot = new DQ(node || document.body).querySelectorAll(`form input [name='${P_CLIENT_WINDOW}']`);\n\n /*\n * lazy helper to fetch the window id from the window url\n */\n let fetchWindowIdFromUrl = () => ExtDomQuery.searchJsfJsFor(/jfwid=([^&;]*)/).orElse(null).value;\n\n /*\n * functional double check based on stream reduction\n * the values should be identical or on INIT value which is a premise to\n * skip the first check\n *\n * @param value1\n * @param value2\n */\n let differenceCheck = (value1: string, value2: string) => {\n if(value1 == INIT) {\n return value2;\n } else if (value1 == ALTERED || value1 != value2) {\n return ALTERED;\n }\n return value2;\n };\n\n /*\n * helper for cleaner code, maps the value from an item\n *\n * @param item\n */\n let getValue = (item: DQ) => item.attr(\"value\").value;\n /*\n * fetch the window id from the forms\n * window ids must be present in all forms\n * or non-existent. If they exist all of them must be the same\n */\n\n let formWindowId: Optional<string> = searchRoot.stream.map(getValue).reduce(differenceCheck, INIT);\n\n\n //if the resulting window id is set on altered then we have an unresolvable problem\n assert(ALTERED != formWindowId.value, \"Multiple different windowIds found in document\");\n\n /*\n * return the window id or null\n */\n return formWindowId.value != INIT ? formWindowId.value : fetchWindowIdFromUrl();\n }\n\n /**\n * collect and encode data for a given form element (must be of type form)\n * find the jakarta.faces.ViewState element and encode its value as well!\n * @return a concatenated string of the encoded values!\n *\n * @throws Error in case of the given element not being of type form!\n * https://issues.apache.org/jira/browse/MYFACES-2110\n */\n export function getViewState(form: Element | string): string {\n /**\n * type-check assert!, we opt for strong typing here\n * because it makes it easier to detect bugs\n */\n\n let element: DQ = DQ.byId(form, true);\n if (!element.isTag(HTML_TAG_FORM)) {\n throw new Error(getMessage(\"ERR_VIEWSTATE\"));\n }\n\n // determine the naming container scenario\n const dummyContext = new Config({});\n assignNamingContainerData(dummyContext, DQ.byId(form))\n // fetch all non file input form elements\n let formElements = element.deepElements.encodeFormElement()\n\n // encode them! (file inputs are handled differently and are not part of the viewstate)\n return encodeFormData(formElements, resoveNamingContainerMapper(dummyContext));\n }\n\n /**\n * this at the first sight looks like a weird construct, but we need to do it this way\n * for testing, we cannot proxy addRequestToQueue from the testing frameworks directly,\n * but we need to keep it under unit tests.\n */\n export let queueHandler = {\n /**\n * public to make it accessible for tests\n *\n * adds a new request to our queue for further processing\n */\n addRequestToQueue: function (elem: DQ, form: DQ, reqCtx: ExtConfig, respPassThr: Config, delay = 0, timeout = 0) {\n requestQueue = requestQueue ?? new AsynchronousQueue<XhrRequest>();\n requestQueue.enqueue(new XhrRequest(elem, form, reqCtx, respPassThr, [], timeout), delay);\n }\n };\n\n //----------------------------------------------- Methods ---------------------------------------------------------------------\n\n /**\n * the idea is to replace some placeholder parameters with their respective values\n * placeholder params like @all, @none, @form, @this need to be replaced by\n * the values defined by the specification\n *\n * This function does it for the render parameters\n *\n * @param requestOptions the source options coming in as options object from faces.ajax.request (options parameter)\n * @param targetContext the receiving target context\n * @param issuingForm the issuing form\n * @param sourceElementId the executing element triggering the faces.ajax.request (id of it)\n */\n function assignRender(requestOptions: Config, targetContext: Config, issuingForm: DQ, sourceElementId: string) {\n if (requestOptions.getIf(CTX_PARAM_RENDER).isPresent()) {\n remapDefaultConstants(targetContext.getIf(CTX_PARAM_REQ_PASS_THR).get({}), P_RENDER, <string>requestOptions.getIf(CTX_PARAM_RENDER).value, issuingForm, <any>sourceElementId, targetContext.getIf(VIEW_ID).value);\n }\n }\n\n /**\n * the idea is to replace some placeholder parameters with their respective values\n * placeholder params like @all, @none, @form, @this need to be replaced by\n * the values defined by the specification\n *\n * This function does it for the execute parameters\n *\n * @param requestOptions the source options coming in as options object from faces.ajax.request (options parameter)\n * @param targetContext the receiving target context\n * @param issuingForm the issuing form\n * @param sourceElementId the executing element triggering the faces.ajax.request (id of it)\n */\n function assignExecute(requestOptions: Config, targetContext: Config, issuingForm: DQ, sourceElementId: string) {\n\n if (requestOptions.getIf(CTX_OPTIONS_EXECUTE).isPresent()) {\n /*the options must be a blank delimited list of strings*/\n /*compliance with Mojarra which automatically adds @this to an execute\n * the spec rev 2.0a however states, if none is issued nothing at all should be sent down\n */\n requestOptions.assign(CTX_OPTIONS_EXECUTE).value = [requestOptions.getIf(CTX_OPTIONS_EXECUTE).value, IDENT_THIS].join(\" \");\n remapDefaultConstants(targetContext.getIf(CTX_PARAM_REQ_PASS_THR).get({}), P_EXECUTE, <string>requestOptions.getIf(CTX_OPTIONS_EXECUTE).value, issuingForm, <any>sourceElementId, targetContext.getIf(VIEW_ID).value);\n } else {\n targetContext.assign(CTX_PARAM_REQ_PASS_THR, P_EXECUTE).value = sourceElementId;\n }\n }\n\n /**\n * apply the browser tab where the request was originating from\n *\n * @param form the form hosting the client window id\n * @param targetContext the target context receiving the value\n */\n function assignClientWindowId(form: DQ, targetContext: Config) {\n\n let clientWindow = $faces().getClientWindow(form.getAsElem(0).value);\n if (clientWindow) {\n targetContext.assign(CTX_PARAM_REQ_PASS_THR, P_CLIENT_WINDOW).value = clientWindow;\n }\n }\n\n /**\n * determines the current naming container\n * and assigns it internally\n *\n * @param internalContext\n * @param formElement\n * @private\n */\n function assignNamingContainerData(internalContext: Config, formElement: DQ) {\n const viewRootId = resolveViewRootId(formElement);\n\n if(!!viewRootId) {\n internalContext.assign(NAMED_VIEWROOT).value = true;\n internalContext.assign(NAMING_CONTAINER_ID).value = viewRootId;\n }\n }\n\n /**\n * transforms the user values to the expected one\n * with the proper none all form and this handling\n * (note we also could use a simple string replace, but then\n * we would have had double entries under some circumstances)\n *\n * there are several standardized constants which need a special treatment\n * like @all, @none, @form, @this\n *\n * @param targetConfig the target configuration receiving the final values\n * @param targetKey the target key\n * @param userValues the passed user values (aka input string which needs to be transformed)\n * @param issuingForm the form where the issuing element originates\n * @param issuingElementId the issuing element\n * @param rootNamingContainerId the naming container id (\"\" default if none is given)\n */\n function remapDefaultConstants(targetConfig: Config, targetKey: string, userValues: string, issuingForm: DQ, issuingElementId: string, rootNamingContainerId: string = \"\"): Config {\n //a cleaner implementation of the transform list method\n const SEP = $faces().separatorchar;\n let iterValues: string[] = (userValues) ? trim(userValues).split(/\\s+/gi) : [];\n let ret = [];\n let processed: {[key: string]: boolean} = {};\n\n /**\n * remaps the client ids for the portlet case so that the server\n * can deal with them either prefixed ir not\n * also resolves the absolute id case (it was assumed the server does this, but\n * apparently the RI does not, so we have to follow the RI behavior here)\n * @param componentIdToTransform the componentId which needs post processing\n */\n const remapNamingContainer = componentIdToTransform => {\n // pattern :<anything> must be prepended by viewRoot if there is one,\n // otherwise we are in a not namespaced then only the id has to match\n const rootNamingContainerPrefix = (rootNamingContainerId.length) ? rootNamingContainerId+SEP : EMPTY_STR;\n let formClientId = issuingForm.id.value;\n // nearest parent naming container relative to the form\n const nearestNamingContainer = formClientId.substring(0, formClientId.lastIndexOf(SEP));\n const nearestNamingContainerPrefix = (nearestNamingContainer.length) ? nearestNamingContainer + SEP : EMPTY_STR;\n // Absolute search expressions, always start with SEP or the name of the root naming container\n const hasLeadingSep = componentIdToTransform.indexOf(SEP) === 0;\n const isAbsolutSearchExpr = hasLeadingSep || (rootNamingContainerId.length\n && componentIdToTransform.indexOf(rootNamingContainerPrefix) == 0);\n let finalIdentifier = \"\";\n if (isAbsolutSearchExpr) {\n //we cut off the leading sep if there is one\n componentIdToTransform = hasLeadingSep ? componentIdToTransform.substring(1) : componentIdToTransform;\n componentIdToTransform = componentIdToTransform.indexOf(rootNamingContainerPrefix) == 0 ? componentIdToTransform.substring(rootNamingContainerPrefix.length) : componentIdToTransform;\n //now we prepend either the prefix or \"\" from the cut-off string to get the final result\n finalIdentifier = [rootNamingContainerPrefix, componentIdToTransform].join(EMPTY_STR);\n } else { //relative search according to the javadoc\n //we cut off the root naming container id from the form\n if (formClientId.indexOf(rootNamingContainerPrefix) == 0) {\n formClientId = formClientId.substring(rootNamingContainerPrefix.length);\n }\n\n //If prependId = true, the outer form id must be present in the id if same form\n let hasPrependId = componentIdToTransform.indexOf(formClientId) == 0;\n finalIdentifier = hasPrependId ?\n [rootNamingContainerPrefix, componentIdToTransform].join(EMPTY_STR) :\n [nearestNamingContainerPrefix, componentIdToTransform].join(EMPTY_STR);\n }\n // We need to double check because we have scenarios where we have a naming container\n // and no prepend (aka tobago testcase \"must handle ':' in IDs properly\", scenario 3,\n // in this case we return the component id, and be happy\n // we can roll a dom check here\n return (!!document.getElementById(finalIdentifier)) ? finalIdentifier : componentIdToTransform;\n };\n\n // in this case we do not use lazy stream because it wont bring any code reduction\n // or speedup\n for (let cnt = 0; cnt < iterValues.length; cnt++) {\n //avoid doubles\n if (iterValues[cnt] in processed) {\n continue;\n }\n switch (iterValues[cnt]) {\n //@none no values should be sent\n case IDENT_NONE:\n return targetConfig.delete(targetKey);\n //@all is a pass through case according to the spec\n case IDENT_ALL:\n targetConfig.assign(targetKey).value = IDENT_ALL;\n return targetConfig;\n //@form pushes the issuing form id into our list\n case IDENT_FORM:\n ret.push(remapNamingContainer(issuingForm.id.value));\n processed[issuingForm.id.value] = true;\n break;\n //@this is replaced with the current issuing element id\n case IDENT_THIS:\n if (!(issuingElementId in processed)) {\n ret.push(remapNamingContainer(issuingElementId));\n processed[issuingElementId] = true;\n }\n break;\n default:\n ret.push(remapNamingContainer(iterValues[cnt]));\n processed[iterValues[cnt]] = true;\n }\n }\n\n targetConfig.assign(targetKey).value = ret.join(\" \");\n return targetConfig;\n }\n\n /**\n * Filter the options given with a blacklist, so that only\n * the values required for params-through are processed in the ajax request\n *\n * Note this is a bug carried over from the old implementation\n * the spec conform behavior is to use params for passthrough values\n * this will be removed soon, after it is cleared up whether removing\n * it breaks any legacy code\n *\n * @param {Context} mappedOpts the options to be filtered\n * @deprecated\n */\n function extractLegacyParams(mappedOpts: Options): Context {\n //we now can use the full code reduction given by our stream api\n //to filter\n return Stream.ofAssoc(mappedOpts)\n .filter(item => !(item[0] in BlockFilter))\n .collect(new AssocArrayCollector());\n }\n\n function remapArrayToAssocArr(arrayedParams: [[string, any]] | {[key: string]: any}): {[key: string]: any} {\n if(Array.isArray(arrayedParams)) {\n return Stream.of(... arrayedParams).collect(new AssocArrayCollector());\n }\n return arrayedParams;\n }\n\n function resolveGlobalConfig(): any {\n return window?.[MYFACES]?.config ?? {};\n }\n\n /**\n * Private helper to execute a function or code fragment\n * @param source the source of the caller passed into the function as this\n * @param event an event which needs to be passed down into the function\n * @param func either a function or code fragment\n * @return a boolean value, if the passed function returns false, then the\n * caller is basically notified that the execution can now stop (JSF requirement for chain)\n * @private\n */\n function resolveAndExecute(source: any, event: Event, func: Function | string): boolean {\n if (\"string\" != typeof func) {\n //function is passed down as chain parameter, can be executed as is\n return (<Function>func).call(source, event) !== false;\n } else {\n //either a function or a string can be passed in case of a string we have to wrap it into another function\n //it is not a plain executable code but a definition\n let sourceCode = trim(<string>func);\n if (sourceCode.indexOf(\"function \") == 0) {\n sourceCode = `return ${sourceCode} (event)`;\n }\n return new Function(\"event\", sourceCode).call(source, event) !== false;\n }\n }\n}\n","/*! Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Typescript port of the faces\\.push part in the myfaces implementation\n */\nimport {MAX_RECONNECT_ATTEMPTS, REASON_EXPIRED, RECONNECT_INTERVAL} from \"./core/Const\";\nimport {DQ} from \"mona-dish\";\n\n/**\n * Implementation class for the push functionality\n */\nexport module PushImpl {\n\n const URL_PROTOCOL = DQ.global().location.protocol.replace(\"http\", \"ws\") + \"//\";\n\n\n // we expose the member variables for testing purposes\n // they are not directly touched outside of tests\n\n /* socket map by token */\n export let sockets = {};\n /* component attributes by clientId */\n export let components = {};\n /* client ids by token (share websocket connection) */\n export let clientIdsByTokens = {};\n\n\n // needed for testing\n export function reset() {\n sockets = {};\n components = {}\n clientIdsByTokens = {}\n }\n\n /*\n * Api implementations, exposed functions\n */\n\n /**\n * @param socketClientId the sockets client identifier\n * @param url the uri to reach the socket\n * @param channel the channel name/id\n * @param onopen The function to be invoked when the web socket is opened.\n * @param onmessage The function to be invoked when a message is received.\n * @param onerror The function to be invoked when an error occurs.\n * @param onclose The function to be invoked when the web socket is closed.\n * @param behaviors functions which are invoked whenever a message is received\n * @param autoConnect Whether or not to automatically open the socket. Defaults to <code>false</code>.\n */\n export function init(socketClientId: string,\n url: string,\n channel: string,\n onopen: Function,\n onmessage: Function,\n onerror: Function,\n onclose: Function,\n behaviors: any,\n autoConnect: boolean) {\n onclose = resolveFunction(onclose);\n\n if (!DQ.global().WebSocket) { // IE6-9.\n onclose(-1, channel);\n return;\n }\n\n let channelToken = url.substr(url.indexOf('?') + 1);\n\n if (!components[socketClientId]) {\n components[socketClientId] = {\n 'channelToken': channelToken,\n 'onopen': resolveFunction(onopen),\n 'onmessage' : resolveFunction(onmessage),\n 'onerror' : resolveFunction(onerror),\n 'onclose': onclose,\n 'behaviors': behaviors,\n 'autoconnect': autoConnect};\n if (!clientIdsByTokens[channelToken]) {\n clientIdsByTokens[channelToken] = [];\n }\n clientIdsByTokens[channelToken].push(socketClientId);\n if (!sockets[channelToken]){\n sockets[channelToken] = new Socket(channelToken,\n getBaseURL(url), channel);\n }\n }\n\n if (autoConnect) {\n (DQ.global()?.faces ?? DQ.global()?.jsf).push.open(socketClientId);\n }\n }\n\n export function open(socketClientId: string) {\n getSocket(components[socketClientId]?.channelToken).open();\n }\n\n export function close(socketClientId: string) {\n getSocket(components[socketClientId].channelToken).close();\n }\n\n // Private helper classes\n // Private classes functions ----------------------------------------------------------------------------------\n /**\n * Creates a reconnecting web socket. When the web socket successfully connects on first attempt, then it will\n * automatically reconnect on timeout with cumulative intervals of 500ms with a maximum of 25 attempts (~3 minutes).\n * The <code>onclose</code> function will be called with the error code of the last attempt.\n * @constructor\n * @param {string} channelToken the channel token associated with this websocket connection\n * @param {string} url The URL of the web socket\n * @param {string} channel The name of the web socket channel.\n */\n\n class Socket {\n\n socket: WebSocket;\n reconnectAttempts = 0;\n\n constructor(private channelToken: string, private url: string, private channel: string) {\n }\n\n open() {\n if (this.socket && this.socket.readyState == 1) {\n return;\n }\n this.socket = new WebSocket(this.url);\n\n this.bindCallbacks();\n }\n\n // noinspection JSUnusedLocalSymbols\n onopen(event: any) {\n if (!this.reconnectAttempts) {\n let clientIds = clientIdsByTokens[this.channelToken];\n for (let i = clientIds.length - 1; i >= 0; i--) {\n let socketClientId = clientIds[i];\n components[socketClientId]?.['onopen']?.(this.channel);\n }\n }\n this.reconnectAttempts = 0;\n }\n\n onerror(event: any) {\n let message = JSON.parse(event.data);\n //TODO replace this with a more readable Stream code\n for (let i = clientIdsByTokens[this.channelToken].length - 1; i >= 0; i--) {\n let socketClientId = clientIdsByTokens[this.channelToken][i];\n if (document.getElementById(socketClientId)) {\n try {\n components[socketClientId]?.['onerror']?.(message, this.channel, event);\n } catch (e) {\n //Ignore\n }\n } else {\n clientIdsByTokens[this.channelToken].splice(i, 1);\n }\n }\n if (clientIdsByTokens[this.channelToken].length == 0) {\n // tag disappeared\n this.close();\n }\n }\n\n onmmessage(event: any) {\n let message = JSON.parse(event.data);\n for (let i = clientIdsByTokens[this.channelToken].length - 1; i >= 0; i--) {\n let socketClientId = clientIdsByTokens[this.channelToken][i];\n if (document.getElementById(socketClientId)) {\n try {\n components[socketClientId]?.['onmessage']?.(message, this.channel, event);\n } catch (e) {\n //Ignore\n }\n let behaviors = components?.[socketClientId]?.['behaviors'];\n let functions = behaviors?.[message];\n if (functions && functions.length) {\n for (let j = 0; j < functions.length; j++) {\n try {\n functions[j](null);\n } catch (e) {\n //Ignore\n }\n }\n }\n } else {\n clientIdsByTokens[this.channelToken].splice(i, 1);\n }\n }\n if (clientIdsByTokens[this.channelToken].length == 0) {\n // tag disappeared\n this.close();\n }\n }\n\n onclose(event: any) {\n if (!this.socket\n || (event.code == 1000 && event.reason == REASON_EXPIRED)\n || (event.code == 1008)\n || (!this.reconnectAttempts)\n || (this.reconnectAttempts >= MAX_RECONNECT_ATTEMPTS)) {\n let clientIds = clientIdsByTokens[this.channelToken];\n for (let i = clientIds.length - 1; i >= 0; i--) {\n let socketClientId = clientIds[i];\n components?.[socketClientId]?.['onclose']?.(event?.code, this?.channel, event);\n }\n } else {\n setTimeout(this.open, RECONNECT_INTERVAL * this.reconnectAttempts++);\n }\n };\n\n close() {\n if (this.socket) {\n let s = this.socket;\n this.socket = null;\n s.close();\n }\n }\n\n /**\n * bind the callbacks to the socket callbacks\n */\n private bindCallbacks() {\n this.socket.onopen = (event: Event) => this.onopen(event);\n this.socket.onmessage = (event: Event) => this.onmmessage(event);\n this.socket.onclose = (event: Event) => this.onclose(event);\n this.socket.onerror = (event: Event) => this.onerror(event);\n }\n }\n\n // Private static functions ---------------------------------------------------------------------------------------\n\n function getBaseURL(url: string) {\n if (url.indexOf(\"://\") < 0) {\n let base = DQ.global().location.hostname + \":\" + DQ.global().location.port;\n return URL_PROTOCOL + base + url;\n } else {\n return url;\n }\n }\n\n /**\n * Get socket associated with given channelToken.\n * @param channelToken The name of the web socket channelToken.\n * @return Socket associated with given channelToken.\n * @throws Error, when the channelToken is unknown, you may need to initialize\n * it first via <code>init()</code> function.\n */\n function getSocket(channelToken: string): Socket {\n let socket = sockets[channelToken];\n if (socket) {\n return socket;\n } else {\n throw new Error(\"Unknown channelToken: \" + channelToken);\n }\n }\n\n function resolveFunction(fn: Function | string = () => {\n }): Function {\n return <Function>((typeof fn !== \"function\") && (fn = DQ.global()[fn]), fn);\n }\n\n}","/*! Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*\n * [export const] constants\n */\n\nexport const XML_ATTR_NAMED_VIEWROOT = \"namedViewRoot\";\nexport const NAMED_VIEWROOT = \"namedViewRoot\";\n\nexport const P_PARTIAL_SOURCE = \"jakarta.faces.source\";\nexport const NAMING_CONTAINER_ID = \"myfaces.partialId\";\n\nexport const VIEW_ID = \"myfaces.viewId\";\nexport const P_VIEWSTATE = \"jakarta.faces.ViewState\";\nexport const P_CLIENT_WINDOW = \"jakarta.faces.ClientWindow\";\nexport const P_VIEWROOT = \"jakarta.faces.ViewRoot\";\nexport const P_VIEWHEAD = \"jakarta.faces.ViewHead\";\nexport const P_VIEWBODY = \"jakarta.faces.ViewBody\";\n\nexport const P_RESOURCE = \"jakarta.faces.Resource\";\n\n/*some useful definitions*/\n\nexport const EMPTY_FUNC = Object.freeze(() => {\n});\nexport const EMPTY_STR = \"\";\nexport const EMPTY_MAP = Object.freeze({});\n\nexport const HTML_VIEWSTATE = [\"<input type='hidden'\", \"name='\", P_VIEWSTATE, \"' value='' />\"].join(EMPTY_STR);\nexport const HTML_CLIENT_WINDOW = [\"<input type='hidden'\", \"' name='\", P_CLIENT_WINDOW, \"' value='' />\"].join(EMPTY_STR);\n\n\n/*internal identifiers for options*/\nexport const IDENT_ALL = \"@all\";\nexport const IDENT_NONE = \"@none\";\nexport const IDENT_THIS = \"@this\";\nexport const IDENT_FORM = \"@form\";\n\n\nexport const P_AJAX = \"jakarta.faces.partial.ajax\";\nexport const P_EXECUTE = \"jakarta.faces.partial.execute\";\nexport const P_RENDER = \"jakarta.faces.partial.render\";\n/*render override for viewbody or viewroot, in both cases an all is performed*/\nexport const P_RENDER_OVERRIDE = \"_myfaces.rendeOverride\";\nexport const P_EVT = \"jakarta.faces.partial.event\";\n\nexport const P_RESET_VALUES = \"jakarta.faces.partial.resetValues\";\nexport const P_WINDOW_ID = \"jakarta.faces.windowId\";\n\nexport const P_BEHAVIOR_EVENT = \"jakarta.faces.behavior.event\";\n\nexport const CTX_PARAM_RENDER = \"render\";\nexport const WINDOW_ID = \"windowId\";\n\n/* message types */\nexport const ERROR = \"error\";\nexport const EVENT = \"event\";\n\nexport const ON_ERROR = \"onerror\";\nexport const ON_EVENT = \"onevent\";\n\n/* event emitting stages */\nexport const BEGIN = \"begin\";\nexport const COMPLETE = \"complete\";\nexport const SUCCESS = \"success\";\n\nexport const SOURCE = \"source\";\nexport const STATUS = \"status\";\n\n\nexport const ERROR_NAME = \"error-name\";\nexport const ERROR_MESSAGE = \"error-message\";\n\n\nexport const RESPONSE_TEXT = \"responseText\";\nexport const RESPONSE_XML = \"responseXML\";\n\n/*ajax errors spec 14.4.2*/\nexport const HTTPERROR = \"httpError\";\nexport const EMPTY_RESPONSE = \"emptyResponse\";\nexport const MALFORMEDXML = \"malformedXML\";\nexport const SERVER_ERROR = \"serverError\";\nexport const CLIENT_ERROR = \"clientError\";\nexport const TIMEOUT_EVENT = \"timeout\";\n\nexport const CTX_OPTIONS_PARAMS = \"params\";\nexport const CTX_OPTIONS_DELAY = \"delay\";\nexport const DELAY_NONE = 'none';\nexport const CTX_OPTIONS_TIMEOUT = \"timeout\";\nexport const CTX_OPTIONS_RESET = \"resetValues\";\nexport const CTX_OPTIONS_EXECUTE = \"execute\";\n\nexport const CTX_PARAM_MF_INTERNAL = \"myfaces.internal\";\nexport const CTX_PARAM_SRC_FRM_ID = \"myfaces.source.formId\";\nexport const CTX_PARAM_SRC_CTL_ID = \"myfaces.source.controlId\";\nexport const CTX_PARAM_REQ_PASS_THR = \"myfaces.request.passThrough\";\n\nexport const CONTENT_TYPE = \"Content-Type\";\nexport const HEAD_FACES_REQ = \"Faces-Request\";\nexport const REQ_ACCEPT = \"Accept\";\nexport const VAL_AJAX = \"partial/ajax\";\nexport const ENCODED_URL = \"jakarta.faces.encodedURL\";\nexport const REQ_TYPE_GET = \"GET\";\nexport const REQ_TYPE_POST = \"POST\";\nexport const STATE_EVT_BEGIN = \"begin\"; //TODO remove this\nexport const STATE_EVT_TIMEOUT = \"TIMEOUT_EVENT\";\nexport const STATE_EVT_COMPLETE = \"complete\"; //TODO remove this\nexport const URL_ENCODED = \"application/x-www-form-urlencoded\";\nexport const MULTIPART = \"multipart/form-data\";\nexport const NO_TIMEOUT = 0;\nexport const STD_ACCEPT = \"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\";\n\nexport const HTML_TAG_HEAD = \"HEAD\";\nexport const HTML_TAG_FORM = \"FORM\";\nexport const HTML_TAG_BODY = \"BODY\";\nexport const HTML_TAG_LINK = \"LINK\";\nexport const HTML_TAG_SCRIPT = \"SCRIPT\";\nexport const HTML_TAG_STYLE = \"STYLE\";\n\n\nexport const SEL_VIEWSTATE_ELEM = \"[name='\" + P_VIEWSTATE + \"']\";\nexport const SEL_CLIENT_WINDOW_ELEM = \"[name='\" + P_CLIENT_WINDOW + \"']\";\nexport const SEL_RESPONSE_XML = \"responseXML\";\n\nexport const PHASE_PROCESS_RESPONSE = \"processResponse\";\n\n\nexport const ERR_NO_PARTIAL_RESPONSE = \"Partial response not set\";\n\nexport const ATTR_URL = \"url\";\nexport const ATTR_NAME = \"name\";\nexport const ATTR_VALUE = \"value\";\nexport const ATTR_ID = \"id\";\n\n/*partial response types*/\nexport const XML_TAG_PARTIAL_RESP = \"partial-response\";\n\n/*partial commands*/\nexport const XML_TAG_CHANGES = \"changes\";\nexport const XML_TAG_UPDATE = \"update\";\nexport const XML_TAG_DELETE = \"delete\";\nexport const XML_TAG_INSERT = \"insert\";\nexport const XML_TAG_EVAL = \"eval\";\nexport const XML_TAG_ERROR = \"error\";\nexport const XML_TAG_ATTRIBUTES = \"attributes\";\nexport const XML_TAG_EXTENSION = \"extension\";\nexport const XML_TAG_REDIRECT = \"redirect\";\nexport const XML_TAG_BEFORE = \"before\";\nexport const XML_TAG_AFTER = \"after\";\nexport const XML_TAG_ATTR = \"attribute\";\n\n\n/*other constants*/\n\nexport const UPDATE_FORMS = \"myfaces.updateForms\";\nexport const UPDATE_ELEMS = \"myfaces.updateElems\";\n\n//we want the head elements to be processed before we process the body\n//but after the inner html is done\nexport const DEFERRED_HEAD_INSERTS = \"myfaces.headElems\";\n\nexport const MYFACES = \"myfaces\";\n\nexport const MF_NONE = \"__mf_none__\";\n\nexport const REASON_EXPIRED = \"Expired\";\n\nexport const APPLIED_VST = \"myfaces.appliedViewState\";\nexport const APPLIED_CLIENT_WINDOW = \"myfaces.appliedClientWindow\";\n\nexport const RECONNECT_INTERVAL = 500;\nexport const MAX_RECONNECT_ATTEMPTS = 25;\n\nexport const UNKNOWN = \"UNKNOWN\";\n\n/**\n * helper to remap the namespaces variables for 2.3\n * from 2.3 to 4.0 every javax namespace has been changed\n * to faces\n * To take the compatibility layer out this method just has to be\n * changed to a simple value passthrough\n */\n\nexport function $faces(): FacesAPI {\n return (window?.faces ?? window?.jsf) as FacesAPI;\n}\n\nexport function $nsp(inputNamespace?: any): any {\n if((!inputNamespace) || !inputNamespace?.replace) {\n return inputNamespace;\n }\n return (!!window?.faces) ? inputNamespace.replace(/javax\\.faces/gi,\"jakarta.faces\"): inputNamespace.replace(/jakarta\\.faces/gi, \"javax.faces\");\n}\n\n","/*! Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {EMPTY_STR, P_VIEWSTATE} from \"./Const\";\n\nexport interface IdValueHolder {\n\n readonly id: string;\n readonly value: string;\n\n}\n\n/**\n * a helper class to isolate the\n * view state and client window and other\n * future states which follow a similar pattern\n */\nexport class StateHolder implements IdValueHolder {\n\n nameSpace: string;\n\n constructor(public id: string, public value: string) {\n let viewStatePos = id.indexOf(P_VIEWSTATE);\n this.nameSpace = viewStatePos > 0 ? id.substr(0, viewStatePos - 1) : EMPTY_STR;\n }\n\n get hasNameSpace(): boolean {\n return !!(this?.nameSpace ?? EMPTY_STR).length;\n }\n}\n","/*! Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport class Messages {\n MSG_TEST = \"Testmessage\";\n\n /*Messages*/\n /** @constant */\n MSG_DEV_MODE = \"Note, this message is only sent, because project stage is development and no \" +\n \"other error listeners are registered.\";\n /** @constant */\n MSG_AFFECTED_CLASS = \"Affected Class=\";\n /** @constant */\n MSG_AFFECTED_METHOD = \"Affected Method=\";\n /** @constant */\n MSG_ERROR_NAME = \"Error Name=\";\n /** @constant */\n MSG_ERROR_MESSAGE = \"Error Message=\";\n /** @constant */\n MSG_SERVER_ERROR_NAME = \"Server Error Name=\";\n\n /** @constant */\n MSG_ERROR_DESC = \"Error Description=\";\n /** @constant */\n MSG_ERROR_NO = \"Error Number=\";\n /** @constant */\n MSG_ERROR_LINENO = \"Error Line Number=\";\n\n /*Errors and messages*/\n /** @constant */\n ERR_FORM = \"Sourceform could not be determined, either because element is not attached to a form or we have multiple forms with named elements of the same identifier or name, stopping the ajax processing\";\n /** @constant */\n ERR_VIEWSTATE = \"faces.viewState= param value not of type form!\";\n /** @constant */\n ERR_TRANSPORT = \"Transport type {0} does not exist\";\n /** @constant */\n ERR_EVT_PASS = \"an event must be passed down (either a an event object null or undefined) \";\n /** @constant */\n ERR_CONSTRUCT = \"Parts of the response couldn't be retrieved when constructing the event data= {0} \";\n /** @constant */\n ERR_MALFORMEDXML = \"The server response could not be parsed, the server has returned with a response which is not xml !\";\n /** @constant */\n ERR_SOURCE_FUNC = \"source cannot be a function (probably source and event were not defined or set to null\";\n /** @constant */\n ERR_EV_OR_UNKNOWN = \"An event object or unknown must be passed as second parameter\";\n /** @constant */\n ERR_SOURCE_NOSTR = \"source cannot be a string\";\n /** @constant */\n ERR_SOURCE_DEF_NULL = \"source must be defined or null\";\n\n //_Lang.js\n /** @constant */\n ERR_MUST_STRING = \"{0}: {1} namespace must be of type String\";\n /** @constant */\n ERR_REF_OR_ID = \"{0}: {1} a reference node or identifier must be provided\";\n /** @constant */\n ERR_PARAM_GENERIC = \"{0}: parameter {1} must be of type {2}\";\n /** @constant */\n ERR_PARAM_STR = \"{0}: {1} param must be of type string\";\n /** @constant */\n ERR_PARAM_STR_RE = \"{0}: {1} param must be of type string or a regular expression\";\n /** @constant */\n ERR_PARAM_MIXMAPS = \"{0}: both a source as well as a destination map must be provided\";\n /** @constant */\n ERR_MUST_BE_PROVIDED = \"{0}: an {1} and a {2} must be provided\";\n /** @constant */\n ERR_MUST_BE_PROVIDED1 = \"{0}: {1} must be set\";\n\n /** @constant */\n ERR_REPLACE_EL = \"replaceElements called while evalNodes is not an array\";\n\n /** @constant */\n ERR_EMPTY_RESPONSE = \"{0}: The response cannot be null or empty!\";\n /** @constant */\n ERR_ITEM_ID_NOTFOUND = \"{0}: item with identifier {1} could not be found\";\n /** @constant */\n ERR_PPR_IDREQ = \"{0}: Error in PPR Insert, id must be present\";\n /** @constant */\n ERR_PPR_INSERTBEFID = \"{0}: Error in PPR Insert, before id or after id must be present\";\n /** @constant */\n ERR_PPR_INSERTBEFID_1 = \"{0}: Error in PPR Insert, before node of id {1} does not exist in document\";\n /** @constant */\n ERR_PPR_INSERTBEFID_2 = \"{0}: Error in PPR Insert, after node of id {1} does not exist in document\";\n\n /** @constant */\n ERR_PPR_DELID = \"{0}: Error in delete, id not in xml markup\";\n /** @constant */\n ERR_PPR_UNKNOWNCID = \"{0}: Unknown Html-Component-ID= {1}\";\n\n /** @constant */\n ERR_NO_VIEWROOTATTR = \"{0}: Changing of ViewRoot attributes is not supported\";\n /** @constant */\n ERR_NO_HEADATTR = \"{0}: Changing of Head attributes is not supported\";\n /** @constant */\n ERR_RED_URL = \"{0}: Redirect without url\";\n\n /** @constant */\n ERR_REQ_FAILED_UNKNOWN = \"Request failed with unknown status\";\n\n /** @constant */\n ERR_REQU_FAILED = \"Request failed with status {0} and reason {1}\";\n\n /** @constant */\n UNKNOWN = \"UNKNOWN\";\n}","/*! Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {Config, Lang, XMLQuery} from \"mona-dish\";\n\nimport {DQ} from \"mona-dish\";\nimport {\n ATTR_URL,\n EMPTY_RESPONSE,\n EMPTY_STR, ERR_NO_PARTIAL_RESPONSE, MALFORMEDXML,\n ON_ERROR,\n ON_EVENT,\n PHASE_PROCESS_RESPONSE,\n XML_TAG_PARTIAL_RESP\n} from \"../core/Const\";\nimport {ExtLang} from \"./Lang\";\n\n\n/**\n * a set of internal code assertions\n * which raise an error\n *\n */\nexport module Assertions {\n\n\n\n export function assertRequestIntegrity(options: Config, elem: DQ): void | never {\n /*assert if the onerror is set and once if it is set it must be of type function*/\n assertFunction(options.getIf(ON_ERROR).value);\n /*assert if the onevent is set and once if it is set it must be of type function*/\n assertFunction(options.getIf(ON_EVENT).value);\n //improve the error messages if an empty elem is passed\n //Assertions.assertElementExists(elem);\n assert(elem.isPresent(), ExtLang.getMessage(\"ERR_MUST_BE_PROVIDED1\", \"{0}: source must be provided or exist\", \"source element id\"), \"faces.ajax.request\", \"ArgNotSet\", )\n }\n\n export function assertUrlExists(node: XMLQuery): void | never {\n if (node.attr(ATTR_URL).isAbsent()) {\n throw Assertions.raiseError(new Error(), ExtLang.getMessage(\"ERR_RED_URL\", null, \"processRedirect\"), \"processRedirect\");\n }\n }\n\n /**\n * checks the xml for various issues which can occur\n * and prevent a proper processing\n */\n export function assertValidXMLResponse(responseXML: XMLQuery) : void | never {\n assert(!responseXML.isAbsent(), EMPTY_RESPONSE, PHASE_PROCESS_RESPONSE);\n assert(!responseXML.isXMLParserError(), responseXML.parserErrorText(EMPTY_STR), PHASE_PROCESS_RESPONSE);\n assert(responseXML.querySelectorAll(XML_TAG_PARTIAL_RESP).isPresent(), ERR_NO_PARTIAL_RESPONSE, PHASE_PROCESS_RESPONSE);\n }\n\n /**\n * internal helper which raises an error in the\n * format we need for further processing\n *\n * @param error\n * @param message the message\n * @param caller\n * @param title the title of the error (optional)\n * @param name the name of the error (optional)\n */\n export function raiseError(error: any, message: string, caller ?: string, title ?: string, name ?: string): Error {\n\n let finalTitle = title ?? MALFORMEDXML;\n let finalName = name ?? MALFORMEDXML;\n let finalMessage = message ?? EMPTY_STR;\n\n //TODO clean up the messy makeException, this is a perfect case for encapsulation and sane defaults\n return ExtLang.makeException(error, finalTitle, finalName, \"Response\", caller || (((<any>arguments).caller) ? (<any>arguments).caller.toString() : \"_raiseError\"), finalMessage);\n }\n\n /*\n * using the new typescript 3.7 compiler assertion functionality to improve compiler hinting\n * we are not fully there yet, but soon\n */\n\n export function assert(value: any, msg = EMPTY_STR, caller=EMPTY_STR, title=\"Assertion Error\"): asserts value {\n if(!value) {\n throw Assertions.raiseError(new Error(), msg ,caller, title);\n }\n }\n\n\n export function assertType(value: any, theType: any, msg = EMPTY_STR, caller=EMPTY_STR, title=\"Type Assertion Error\"): asserts value {\n if((!!value) && !Lang.assertType(value,theType)) {\n throw Assertions.raiseError(new Error(), msg ,caller, title);\n }\n }\n\n export function assertFunction(value: any, msg = EMPTY_STR, caller=EMPTY_STR, title=\"Assertion Error\"): asserts value is Function {\n assertType(value, \"function\", msg, caller, title);\n }\n\n export function assertDelay(value: any) {\n if(!(value >= 0)) { // >= 0 abbreviation which covers all cases of non positive values,\n // including NaN and non numeric strings, no type equality is deliberate here,\n throw new Error(\"Invalid delay value: \" + value);\n }\n }\n}\n\n\n","/*! Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {AsyncRunnable} from \"./AsyncRunnable\";\n\n/**\n * Asynchronous queue which starts to work\n * through the callbacks until the queue is empty\n *\n * Every callback must be of async runnable\n * which is sort of an extended promise which has\n * added a dedicated cancel and start point\n *\n * This interface can be used as wrapper contract\n * for normal promises if needed.\n */\nexport class AsynchronousQueue<T extends AsyncRunnable<any>> {\n\n private runnableQueue = [];\n private delayTimeout: null | ReturnType<typeof setTimeout>;\n\n currentlyRunning: AsyncRunnable<any>;\n\n constructor() {\n }\n\n /**\n * simple is empty accessor, returns true if queue is empty atm\n */\n get isEmpty(): boolean {\n return !this.runnableQueue.length;\n }\n\n /**\n * enqueues an element and starts the\n * asynchronous work loop if not already running\n *\n * @param element the element to be queued and processed\n * @param delay possible delay after our usual process or drop if something newer is incoming algorithm\n */\n enqueue(element: T, delay = 0) {\n if (this.delayTimeout) {\n clearTimeout(this.delayTimeout);\n this.delayTimeout = null;\n }\n if (delay) {\n this.delayTimeout = setTimeout(() => {\n this.appendElement(element);\n }) as any;\n } else {\n this.appendElement(element);\n }\n }\n\n /**\n * fetches the next element from the queue (first in first out order)\n */\n dequeue(): T | undefined{\n return this.runnableQueue.shift();\n }\n\n /**\n * clears up all elements from the queue\n */\n cleanup() {\n this.currentlyRunning = null;\n this.runnableQueue.length = 0;\n }\n\n /**\n * cancels the currently running element and then cleans up the queue\n * aka cancel the queue entirely\n */\n cancel() {\n try {\n if (this.currentlyRunning) {\n this.currentlyRunning.cancel();\n }\n } finally {\n this.cleanup();\n }\n }\n\n private callForNextElementToProcess() {\n this.runEntry();\n }\n\n private appendElement(element: T) {\n //only if the first element is added we start with a trigger\n //otherwise a process already is running and not finished yet at that\n //time\n this.runnableQueue.push(element);\n if (!this.currentlyRunning) {\n this.runEntry();\n }\n }\n\n private runEntry() {\n if (this.isEmpty) {\n this.currentlyRunning = null;\n return;\n }\n this.currentlyRunning = this.dequeue();\n this.currentlyRunning\n .catch((e) => {\n //in case of an error we always clean up the remaining calls\n //to allow a clean recovery of the application\n this.cleanup();\n throw e;\n })\n .then(\n //the idea is to trigger the next over an event to reduce\n //the number of recursive calls (stacks might be limited\n //compared to ram)\n //naturally give we have a DOM, the DOM is the natural event dispatch system\n //which we can use, to decouple the calls from a recursive stack call\n //(the browser engine will take care of that)\n () => this.callForNextElementToProcess()\n ).start();\n }\n}","/*! Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {Config, IValueHolder, Optional, DomQuery, DQ, Stream, ArrayCollector} from \"mona-dish\";\nimport {$nsp, P_WINDOW_ID} from \"../core/Const\";\n\n\n/**\n * detects whether a source is a faces.js request\n *\n * @param source the source string for the faces.js request\n * @return true if a faces.js loading pattern is detected\n * @constructor\n */\nconst IS_FACES_SOURCE = (source?: string): boolean => {\n //spec version smaller 4 we have to deal with the jsf namespace\n\n return source && !!(source?.search(/\\/jakarta\\.faces\\.resource.*\\/faces\\.js.*/) != -1 ||\n source?.search(/\\/faces-development\\.js.*/) != -1 ||\n source?.search(/\\/faces-uncompressed\\.js.*/) != -1 ||\n source?.search(/\\/faces[^.]*\\.js.*ln=jakarta.faces.*/gi) != -1 ||\n //fallback without check for jsf, that way we allow both bookmarks\n source?.search(/\\/javax\\.faces\\.resource.*\\/jsf\\.js.*/) != -1 ||\n source?.search(/\\/jsf-development\\.js.*/) != -1 ||\n source?.search(/\\/jsf-uncompressed\\.js.*/) != -1 ||\n source?.search(/\\/jsf[^.]*\\.js.*ln=javax.faces.*/gi) != -1);\n}\n\n/**\n * namespace myfaces\\.testscripts can be used as extension point for internal\n * tests, those will be handled similarly to faces.js, in regard\n * to reload blocking on ajax requests\n *\n * Note: atm not used, used to be used in the old implementation\n * but still is reserved for now\n *\n * @param source the source to check\n * @constructor\n */\nconst IS_INTERNAL_SOURCE = (source: string): boolean => {\n return source.search(/\\/faces[^.]*\\.js.*ln=myfaces.testscripts.*/gi) != -1 || source.search(/\\/jsf[^.]*\\.js.*ln=myfaces.testscripts.*/gi) != -1;\n}\n\n\nconst ATTR_SRC = 'src';\n\n/**\n * Extension which adds implementation specific\n * meta-data to our dom query\n *\n * Usage\n * el = new ExtDQ(oldReference)\n * nonce = el.nonce\n * windowId = el.getWindowId\n */\nexport class ExtDomQuery extends DQ {\n\n static get windowId() {\n return new ExtDomQuery(document.body).windowId;\n }\n\n static get nonce(): string {\n return new ExtDomQuery(document.body).nonce;\n }\n\n get windowId(): string | null {\n\n const fetchWindowIdFromURL = function (): string | null {\n let href = window.location.href;\n let windowId = \"windowId\";\n let regex = new RegExp(\"[\\\\?&]\" + windowId + \"=([^&#\\\\;]*)\");\n let results = regex.exec(href);\n //initial trial over the url and a regexp\n if (results != null) return results[1];\n return null;\n };\n\n //byId ($)\n if (this.value.isPresent()) {\n let result = this.querySelectorAll(\"form input[name='\" + P_WINDOW_ID + \"']\");\n if (result.length > 1) {\n throw Error(\"Multiple different windowIds found in document\");\n }\n\n return (result.isPresent()) ? (<HTMLInputElement>result.getAsElem(0).value).value : fetchWindowIdFromURL();\n } else {\n return fetchWindowIdFromURL();\n }\n }\n\n /*\n * determines the faces.js nonce and adds them to the namespace\n * this is done once and only lazily\n */\n get nonce(): string | null {\n //already processed\n let myfacesConfig = new ExtConfig(window.myfaces);\n let nonce: IValueHolder<string> = myfacesConfig.getIf(\"config\", \"cspMeta\", \"nonce\");\n if (nonce.value) {\n return <string>nonce.value;\n }\n\n let curScript = new DQ(document.currentScript);\n //since our baseline atm is ie11 we cannot use document.currentScript globally\n if (!!this.extractNonce(curScript)) {\n // fast-path for modern browsers\n return this.extractNonce(curScript);\n }\n // fallback if the currentScript method fails, we just search the jsf tags for nonce, this is\n // the last possibility\n let nonceScript = DQ\n .querySelectorAll(\"script[src], link[src]\")\n .lazyStream\n .filter((item) => this.extractNonce(item) && item.attr(ATTR_SRC) != null)\n .filter(item => IS_FACES_SOURCE(item.attr(ATTR_SRC).value))\n .first();\n\n if (nonceScript.isPresent()) {\n return this.extractNonce(nonceScript.value);\n }\n return null;\n }\n\n static searchJsfJsFor(item: RegExp): Optional<String> {\n return new ExtDomQuery(document).searchJsfJsFor(item);\n }\n\n /**\n * searches the embedded faces.js for items like separator char etc.\n * expects a match as variable under position 1 in the result match\n * @param regExp\n */\n searchJsfJsFor(regExp: RegExp): Optional<string> {\n //perfect application for lazy stream\n return DQ.querySelectorAll(\"script[src], link[src]\").lazyStream\n .filter(item => IS_FACES_SOURCE(item.attr(ATTR_SRC).value))\n .map(item => item.attr(ATTR_SRC).value.match(regExp))\n .filter(item => item != null && item.length > 1)\n .map((result: string[]) => {\n return decodeURIComponent(result[1]);\n }).first();\n }\n\n globalEval(code: string, nonce ?: string): DQ {\n return new ExtDomQuery(super.globalEval(code, nonce ?? this.nonce));\n }\n\n // called from base class runScripts, do not delete\n // noinspection JSUnusedGlobalSymbols\n globalEvalSticky(code: string, nonce ?: string): DQ {\n return new ExtDomQuery(super.globalEvalSticky(code, nonce ?? this.nonce));\n }\n\n /**\n * decorated run scripts which takes our jsf extensions into consideration\n * (standard DomQuery will let you pass anything)\n * @param sticky if set to true the internally generated element for the script is left in the dom\n * @param whiteListed\n */\n runScripts(sticky = false, whiteListed?: (src: string) => boolean): DomQuery {\n const whitelistFunc = (src: string): boolean => {\n return (whiteListed?.(src) ?? true) && !IS_FACES_SOURCE(src) && !IS_INTERNAL_SOURCE(src);\n };\n return super.runScripts(sticky, whitelistFunc);\n }\n\n /**\n * adds the elements in this ExtDomQuery to the head\n *\n * @param suppressDoubleIncludes checks for existing elements in the head before running the insert\n */\n runHeadInserts(suppressDoubleIncludes = true): void {\n let head = ExtDomQuery.byId(document.head);\n //automated nonce handling\n let processedScripts = [];\n\n // the idea is only to run head inserts on resources\n // which do not exist already, that way\n // we can avoid double includes on subsequent resource\n // requests.\n function resourceIsNew(element: DomQuery) {\n if(!suppressDoubleIncludes) {\n return true;\n }\n const tagName = element.tagName.value;\n if(!tagName) {\n // text node they do not have tag names, so we can process them as they are without\n // any further ado\n return true;\n }\n let reference = element.attr(\"href\")\n .orElseLazy(() => element.attr(\"src\").value)\n .orElseLazy(() => element.attr(\"rel\").value);\n\n if (!reference.isPresent()) {\n return true;\n }\n return !head.querySelectorAll(`${tagName}[href='${reference.value}']`).length &&\n !head.querySelectorAll(`${tagName}[src='${reference.value}']`).length &&\n !head.querySelectorAll(`${tagName}[rel='${reference.value}']`).length;\n }\n\n this\n .filter(resourceIsNew)\n .each(element => {\n if(element.tagName.value != \"SCRIPT\") {\n //we need to run runScripts properly to deal with the rest\n new ExtDomQuery(...processedScripts).runScripts(true);\n processedScripts = [];\n head.append(element);\n } else {\n processedScripts.push(element);\n }\n });\n new ExtDomQuery(...processedScripts).runScripts(true);\n }\n\n\n /**\n * byId producer\n *\n * @param selector id\n * @param deep whether the search should go into embedded shadow dom elements\n * @return a DomQuery containing the found elements\n */\n static byId(selector: string | DomQuery | Element, deep = false): ExtDomQuery {\n const ret = DomQuery.byId(selector, deep);\n return new ExtDomQuery(ret);\n }\n\n private extractNonce(curScript: DomQuery) {\n return (curScript.getAsElem(0).value as HTMLElement)?.nonce ?? curScript.attr(\"nonce\").value;\n }\n\n filter(func: (item: DomQuery) => boolean): ExtDomQuery {\n return new ExtDomQuery(super.filter(func));\n }\n}\n\nexport const ExtDQ = ExtDomQuery;\n\n/**\n * in order to reduce the number of interception points for the fallbacks we add\n * the namespace remapping straight to our config accessors\n */\nexport class ExtConfig extends Config {\n\n $nspEnabled = true;\n\n constructor(root: any) {\n super(root);\n }\n\n assignIf(condition: boolean, ...accessPath): IValueHolder<any> {\n const accessPathMapped = this.remap(accessPath);\n return super.assignIf(condition, ...accessPathMapped);\n }\n\n assign(...accessPath): IValueHolder<any> {\n const accessPathMapped = this.remap(accessPath);\n return super.assign(...accessPathMapped);\n }\n\n append(...accessPath): IValueHolder<any> {\n return super.append(...accessPath);\n }\n\n appendIf(condition: boolean, ...accessPath): IValueHolder<any> {\n const accessPathMapped = this.remap(accessPath);\n return super.appendIf(condition, ...accessPathMapped);\n }\n\n getIf(...accessPath): Config {\n const accessPathMapped = this.remap(accessPath);\n return super.getIf(...accessPathMapped);\n }\n\n get(defaultVal: any): Config {\n return super.get($nsp(defaultVal));\n }\n\n delete(key: string): Config {\n return super.delete($nsp(key));\n }\n\n /**\n * creates a config from an initial value or null\n * @param value\n */\n static fromNullable<T>(value?: T | null): Config {\n return new ExtConfig(value);\n }\n\n protected getClass(): any {\n return ExtConfig;\n }\n\n /**\n * shallow copy getter, copies only the first level, references the deeper nodes\n * in a shared manner\n */\n protected shallowCopy$(): Config {\n const ret = super.shallowCopy$();\n return new ExtConfig(ret);\n }\n\n /**\n * deep copy, copies all config nodes\n */\n get deepCopy(): Config {\n return new ExtConfig(super.deepCopy$());\n }\n\n /**\n * helper to remap the namespaces of an array of access paths\n * @param accessPath the access paths to be remapped\n * @private returns an array of access paths with version remapped namespaces\n */\n private remap(accessPath: string[]): string[] {\n if(!this.$nspEnabled) {\n return accessPath;\n }\n return Stream.of(...accessPath).map(key => $nsp(key)).collect(new ArrayCollector());\n }\n}","import {ArrayCollector, Config, DomQuery, DQ, LazyStream, Stream} from \"mona-dish\";\nimport {ExtDomQuery} from \"./ExtDomQuery\";\nimport {$faces, EMPTY_STR} from \"../core/Const\";\n\n/*\n * various routines for encoding and decoding url parameters\n * into configs and vice versa\n */\n\n\n/**\n * encodes a given form data into a url encoded string\n * @param formData the form data config object\n * @param paramsMapper the params mapper\n * @param defaultStr a default string if nothing comes out of it\n */\nexport function encodeFormData(formData: Config,\n paramsMapper = (inStr, inVal) => [inStr, inVal],\n defaultStr = EMPTY_STR): string {\n if (formData.isAbsent()) {\n return defaultStr;\n }\n const assocValues = formData.value;\n\n const expandValueArrAndRename = key => Stream.of(...assocValues[key]).map(val => paramsMapper(key, val));\n const isPropertyKey = key => assocValues.hasOwnProperty(key);\n const isNotFile = ([, value]) => !(value instanceof ExtDomQuery.global().File);\n const mapIntoUrlParam = keyVal => `${encodeURIComponent(keyVal[0])}=${encodeURIComponent(keyVal[1])}`;\n\n const entries = LazyStream.of(...Object.keys(assocValues))\n .filter(isPropertyKey)\n .flatMap(expandValueArrAndRename)\n //we cannot encode file elements that is handled by multipart requests anyway\n .filter(isNotFile)\n .map(mapIntoUrlParam)\n .collect(new ArrayCollector());\n\n return entries.join(\"&\")\n}\n\n/**\n * splits and decodes encoded values into strings containing of key=value\n * @param encoded encoded string\n */\nexport function decodeEncodedValues(encoded: string): Stream<string[]> {\n const filterBlanks = item => !!(item || '').replace(/\\s+/g, '');\n const splitKeyValuePair = line => {\n let index = line.indexOf(\"=\");\n if (index == -1) {\n return [line];\n }\n return [line.substring(0, index), line.substring(index + 1)];\n };\n\n let requestParamEntries = decodeURIComponent(encoded).split(/&/gi);\n return Stream.of(...requestParamEntries)\n .filter(filterBlanks)\n .map(splitKeyValuePair)\n}\n\n\n/**\n * gets all the input files and their corresponding file objects\n * @param dataSource\n */\nexport function resolveFiles(dataSource: DQ): Stream<[string, File]> {\n\n const expandFilesArr = ([key, files]) => Stream.of(...files).map(file => [key, file]);\n const remapFileInput = fileInput => [fileInput.name.value || fileInput.id.value, fileInput.filesFromElem(0)];\n return dataSource\n .querySelectorAllDeep(\"input[type='file']\")\n .stream\n .map(remapFileInput)\n .flatMap(expandFilesArr);\n}\n\n\nexport function fixEmmptyParameters(keyVal: any[]): [string, any] {\n return (keyVal.length < 3 ? [keyVal?.[0] ?? [], keyVal?.[1] ?? []] : keyVal) as [string, any];\n}\n\n/**\n * returns the decoded viewState from parentItem\n * @param parentItem\n */\nfunction resolveViewState(parentItem: DomQuery): Stream<string[] | [string, File]> {\n const viewStateStr = $faces().getViewState(parentItem.getAsElem(0).value);\n\n // we now need to decode it and then merge it into the target buf\n // which hosts already our overrides (aka do not override what is already there(\n // after that we need to deal with form elements on a separate level\n return decodeEncodedValues(viewStateStr);\n}\n\n/**\n * gets all the inputs under the form parentItem\n * as stream\n * @param parentItem\n */\nexport function getFormInputsAsStream(parentItem: DomQuery): Stream<string[] | [string, File]> {\n const standardInputs = resolveViewState(parentItem);\n const fileInputs = resolveFiles(parentItem);\n return standardInputs.concat(fileInputs as any)\n}","/*! Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\n\nimport {DomQuery, DQ, DQ$} from \"mona-dish\";\nimport {$faces, $nsp, HTML_CLIENT_WINDOW, HTML_VIEWSTATE, P_CLIENT_WINDOW, P_VIEWSTATE} from \"../core/Const\";\n\n/**\n * Builder for hidden inputs.\n * ATM only ViewState and Client window\n * are supported (per spec)\n *\n * Improves readability in the response processor!\n */\nexport class HiddenInputBuilder {\n private namingContainerId?: string;\n private parent?: DomQuery;\n private namedViewRoot: boolean = false;\n private readonly name: string;\n private readonly template: string;\n\n constructor(private selector: string) {\n const isViewState = selector.indexOf($nsp(P_VIEWSTATE)) != -1;\n this.name = isViewState ? P_VIEWSTATE : P_CLIENT_WINDOW\n this.template = isViewState ? HTML_VIEWSTATE : HTML_CLIENT_WINDOW\n }\n\n withNamingContainerId(namingContainer: string): HiddenInputBuilder {\n this.namingContainerId = namingContainer;\n return this;\n }\n\n withParent(parent: DomQuery): HiddenInputBuilder {\n this.parent = parent;\n return this;\n }\n\n withNamedViewRoot(namedViewRoot: boolean): HiddenInputBuilder {\n this.namedViewRoot = namedViewRoot;\n return this;\n }\n\n\n build(): DomQuery {\n const SEP = $faces().separatorchar;\n\n let existingStates = DQ$(`[name*='${$nsp(this.name)}']`);\n let cnt = existingStates.stream.map(state => {\n let ident: string = state.id.orElse(\"-1\").value;\n ident = ident.substring(ident.lastIndexOf(SEP)+1);\n return parseInt(ident);\n })\n .filter(item => !isNaN(item))\n .reduce((item1, item2) => Math.max(item1, item2), -1).value;\n //the maximum new ident is the current max + 1\n cnt++;\n\n\n const newElement = DQ.fromMarkup($nsp(this.template));\n newElement.id.value = ((this.namingContainerId?.length) ?\n [this.namingContainerId, $nsp(this.name), cnt]:\n [$nsp(this.name), cnt]).join(SEP);\n\n //name must be prefixed with the naming container id as well according to the jsdocs\n if(this.namedViewRoot) {\n newElement.name.value = (this.namingContainerId?.length) ?\n [this.namingContainerId, $nsp(this.name)].join(SEP): $nsp(this.name);\n } else {\n newElement.name.value = $nsp(this.name);\n }\n\n\n this?.parent?.append(newElement);\n return newElement;\n }\n}","/*! Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\n\nimport {Lang as LangBase, Config, Optional, DomQuery, DQ, Stream} from \"mona-dish\";\nimport {Messages} from \"../i18n/Messages\";\nimport {EMPTY_STR, HTML_TAG_FORM} from \"../core/Const\";\nimport {getEventTarget} from \"../xhrCore/RequestDataResolver\";\n\n\nexport module ExtLang {\n\n let installedLocale: Messages;\n let nameSpace = \"impl/util/Lang/\";\n\n export function getLanguage(): string {\n //TODO global config override\n\n let language: string = (<any>navigator).languages?.[0] ?? navigator?.language;\n language = language.split(\"-\")[0];\n return language;\n }\n\n //should be in lang, but for now here to avoid recursive imports, not sure if typescript still has a problem with those\n /**\n * helper function to safely resolve anything\n * this is not an elvis operator, it resolves\n * a value without exception in a tree and if\n * it is not resolvable then an optional of\n * a default value is restored or Optional\\.empty\n * if none is given\n *\n * usage\n * <code>\n * let var: Optional<string> = saveResolve(() => a.b.c.d.e, \"foobaz\")\n * </code>\n *\n * @param resolverProducer a lambda which can produce the value\n * @param defaultValue an optional default value if the producer fails to produce anything\n * @returns an Optional of the produced value\n */\n export function failSaveResolve<T>(resolverProducer: () => T, defaultValue: T = null): Optional<T> {\n return LangBase.saveResolve(resolverProducer, defaultValue);\n }\n\n /**\n * under some conditions it makes sense to swallow errors and return a default value in the error case\n * classical example the optional resolution of values in a chain (thankfully now covered by Typescript itself)\n * another example which we have in our system is that some operations fail only under test due to test framework\n * limitations while they cannot fail in the real world.\n *\n * @param resolverProducer a producer function which produces a value in the non error case\n * @param defaultValue the default value in case of a fail of the function\n */\n export function failSaveExecute<T>(resolverProducer: () => any, defaultValue: T = null): void {\n LangBase.saveResolve(resolverProducer, defaultValue);\n }\n\n /**\n * returns a given localized message upon a given key\n * basic java log like templating functionality is included\n *\n * @param key the key for the message\n * @param defaultMessage optional default message if none was found\n *\n * Additionally, you can pass additional arguments, which are used\n * in the same way java log templates use the params\n *\n * @param templateParams the param list to be filled in\n */\n export function getMessage(key: string, defaultMessage?: string, ...templateParams: Array<string>): string {\n installedLocale = installedLocale ?? new Messages();\n\n let msg = installedLocale[key] ?? defaultMessage ?? key;\n\n Stream.of(...templateParams).each((param, cnt) => {\n msg = msg.replace(new RegExp([\"\\\\{\", cnt, \"\\\\}\"].join(EMPTY_STR), \"g\"), param);\n });\n\n return msg;\n }\n\n /**\n * transforms a key value pair into a string\n * @param key the key\n * @param val the value\n * @param delimiter the delimiter\n */\n export function keyValToStr(key: string, val: string, delimiter: string = \"\\n\") {\n return [key, val].join(delimiter);\n }\n\n /**\n * creates an exception with additional internal parameters\n * for extra information\n *\n * @param error\n * @param title the exception title\n * @param name the exception name\n * @param callerCls the caller class\n * @param callFunc the caller function\n * @param message the message for the exception\n */\n export function makeException(error: Error, title: string, name: string, callerCls: string, callFunc: string, message: string): Error {\n\n return new Error(message + (callerCls ?? nameSpace) + callFunc ?? (EMPTY_STR + (<any>arguments).caller.toString()));\n\n }\n\n /**\n * fetches a global config entry\n * @param configName the name of the configuration entry\n * @param defaultValue\n *\n * @return either the config entry or if none is given the default value\n */\n export function getGlobalConfig(configName: string, defaultValue: any): any {\n /**\n * note we could use exists but this is a heavy operation, since the config name usually\n * given this function here is called very often\n * is a single entry without . in between we can do the lighter shortcut\n */\n return window?.myfaces?.config?.[configName] ?? defaultValue;\n }\n\n /**\n * fetches the form in a fuzzy manner depending\n * on an element or event target.\n *\n * The idea is that according to the jsf spec\n * the enclosing form of the issuing element needs to be fetched.\n *\n * This is fine, but since then html5 came into the picture with the form attribute the element\n * can be anywhere referencing its parent form.\n *\n * Also, theoretically you can have the case of an issuing element enclosing a set of forms\n * (not really often used, but theoretically it could be input button allows to embed html for instance)\n *\n * So the idea is not to limit the issuing form determination to the spec case\n * but also cover the theoretical and html5 corner case.\n *\n * @param elem\n * @param event\n */\n export function getForm(elem: Element, event ?: Event): DQ | never {\n\n let queryElem = new DQ(elem);\n let eventTarget = (event) ? new DQ(getEventTarget(event)) : DomQuery.absent;\n\n if (queryElem.isTag(HTML_TAG_FORM)) {\n return queryElem;\n }\n\n //html 5 for handling\n if (queryElem.attr(HTML_TAG_FORM).isPresent()) {\n let formId = queryElem.attr(HTML_TAG_FORM).value;\n let foundForm = DQ.byId(formId, true);\n if (foundForm.isPresent()) {\n return foundForm;\n }\n }\n\n let form = queryElem.firstParent(HTML_TAG_FORM)\n .orElseLazy(() => queryElem.byTagName(HTML_TAG_FORM, true))\n .orElseLazy(() => eventTarget.firstParent(HTML_TAG_FORM))\n .orElseLazy(() => eventTarget.byTagName(HTML_TAG_FORM))\n .first();\n\n assertFormExists(form);\n\n return form;\n }\n\n /**\n * gets the local or global options with local ones having higher priority\n * if no local or global one was found then the default value is given back\n *\n * @param configName the name of the configuration entry\n * @param localOptions the local options root for the configuration myfaces as default marker is added\n * implicitly\n *\n * @param defaultValue\n *\n * @return either the config entry or if none is given the default value\n */\n export function getLocalOrGlobalConfig(localOptions: Config, configName: string, defaultValue: any): any {\n return localOptions.value?.myfaces?.config?.[configName] ??\n window?.myfaces?.config?.[configName] ??\n defaultValue;\n }\n\n /**\n * assert that the form exists and throw an exception in the case it does not\n *\n * @param form the form to check for\n */\n function assertFormExists(form: DomQuery): void | never {\n if (form.isAbsent()) {\n throw makeException(new Error(), null, null, \"Impl\", \"getForm\", getMessage(\"ERR_FORM\"));\n }\n }\n}","/*! Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n EMPTY_STR, ERROR,\n ERROR_MESSAGE,\n ERROR_NAME,\n RESPONSE_TEXT,\n RESPONSE_XML, SERVER_ERROR,\n SOURCE,\n STATUS,\n UNKNOWN\n} from \"../core/Const\";\nimport {Config} from \"mona-dish\";\n\nimport {EventData} from \"./EventData\";\nimport {ExtLang} from \"../util/Lang\";\nimport getMessage = ExtLang.getMessage;\n\n\nexport enum ErrorType {\n SERVER_ERROR = \"serverError\",\n HTTP_ERROR = \"httpError\",\n CLIENT_ERROR = \"clientErrror\",\n TIMEOUT = \"timeout\"\n}\n\n/**\n * the spec has a problem of having the error\n * object somewhat underspecified, there is no clear\n * description of the required contents.\n * I want to streamline it with mojarra here\n * hence we are going to move\n * everything into the same attributes,\n * I will add deprecated myfaces backwards compatibility attributes as well\n */\nexport class ErrorData extends EventData implements IErrorData {\n\n type: string = \"error\";\n source: HTMLElement;\n sourceId: string;\n errorName: string;\n errorMessage: string;\n\n responseText: string;\n responseXML: any;\n\n status: string;\n typeDetails: ErrorType;\n\n serverErrorName: string;\n serverErrorMessage: string;\n message: string;\n\n constructor(source: string, errorName: string, errorMessage: string, responseText: string = null, responseXML: any = null, responseCode: string = \"200\", status: string = \"\", type = ErrorType.CLIENT_ERROR) {\n super();\n this.source = document.getElementById(source);\n this.sourceId = source;\n this.type = ERROR;\n this.errorName = errorName;\n //tck requires that the type is prefixed to the message itself (jsdoc also) in case of a server error\n this.message = this.errorMessage = (type == SERVER_ERROR) ? type + \": \" + errorMessage : errorMessage;\n this.responseCode = responseCode;\n this.responseText = responseText;\n this.status = status;\n this.typeDetails = type;\n\n if (type == ErrorType.SERVER_ERROR) {\n this.serverErrorName = this.errorName;\n this.serverErrorMessage = this.errorMessage;\n }\n }\n\n static fromClient(e: Error): ErrorData {\n return new ErrorData((e as any)?.source ?? \"client\", e?.name ?? EMPTY_STR, e?.message ?? EMPTY_STR, e?.stack ?? EMPTY_STR);\n }\n\n static fromHttpConnection(source: any, name: string, message: string, responseText, responseCode: number, status: string = EMPTY_STR): ErrorData {\n return new ErrorData(source, name, message, responseText, responseCode, `${responseCode}`, status, ErrorType.HTTP_ERROR);\n }\n\n static fromGeneric(context: Config, errorCode: number, errorType: ErrorType = ErrorType.SERVER_ERROR): ErrorData {\n\n let getMsg = this.getMsg;\n\n let source = getMsg(context, SOURCE);\n let errorName = getMsg(context, ERROR_NAME);\n let errorMessage = getMsg(context, ERROR_MESSAGE);\n let status = getMsg(context, STATUS);\n let responseText = getMsg(context, RESPONSE_TEXT);\n let responseXML = getMsg(context, RESPONSE_XML);\n\n\n return new ErrorData(source, errorName, errorMessage, responseText, responseXML, errorCode + EMPTY_STR, status, errorType);\n }\n\n private static getMsg(context, param) {\n return getMessage(context.getIf(param).orElse(EMPTY_STR).value);\n }\n\n static fromServerError(context: Config): ErrorData {\n return this.fromGeneric(context, -1);\n }\n\n}","/*! Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {Config, DQ} from \"mona-dish\";\nimport {BEGIN, CTX_PARAM_REQ_PASS_THR, EVENT, P_PARTIAL_SOURCE, SOURCE} from \"../core/Const\";\n\nexport class EventData implements IEventData{\n type: string;\n status: string;\n source: any;\n responseCode: string;\n responseText: string;\n responseXML: Document;\n\n static createFromRequest(request: XMLHttpRequest, context: Config, /*event name*/ name: string): EventData {\n\n let eventData = new EventData();\n\n eventData.type = EVENT;\n eventData.status = name;\n\n let sourceId: string = context.getIf(SOURCE)\n .orElseLazy(() => context.getIf(P_PARTIAL_SOURCE).value)\n .orElseLazy(() => context.getIf(CTX_PARAM_REQ_PASS_THR, P_PARTIAL_SOURCE).value)\n .value;\n if (sourceId) {\n eventData.source = DQ.byId(sourceId, true).first().value.value;\n }\n\n if (name !== BEGIN) {\n eventData.responseCode = request?.status?.toString();\n eventData.responseText = request?.responseText;\n eventData.responseXML = request?.responseXML;\n }\n return eventData;\n }\n}\n","/*! Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Config, DomQuery, DQ} from \"mona-dish\";\nimport {\n $faces,\n $nsp,\n CTX_OPTIONS_DELAY,\n CTX_OPTIONS_TIMEOUT,\n DELAY_NONE,\n EMPTY_FUNC,\n EMPTY_STR,\n ENCODED_URL, NAMED_VIEWROOT, NAMING_CONTAINER_ID,\n P_VIEWSTATE,\n REQ_TYPE_GET,\n REQ_TYPE_POST\n} from \"../core/Const\";\nimport {XhrFormData} from \"./XhrFormData\";\nimport {ExtLang} from \"../util/Lang\";\nimport {ExtConfig, ExtDomQuery} from \"../util/ExtDomQuery\";\nimport {Assertions} from \"../util/Assertions\";\n\n\n/**\n * Resolver functions for various aspects of the request data\n *\n * stateless because it might be called from various\n * parts of the response classes\n */\n\n/**\n * resolves the event handlers lazily\n * so that if some decoration happens in between we can deal with it\n *\n * @param requestContext\n * @param responseContext\n * @param funcName\n */\nexport function resolveHandlerFunc(requestContext: Config, responseContext: Config, funcName: string) {\n responseContext = responseContext || new Config({});\n return responseContext.getIf(funcName)\n .orElseLazy(() =>requestContext.getIf(funcName).value)\n .orElse(EMPTY_FUNC).value;\n}\n\nexport function resolveTargetUrl(srcFormElement: HTMLFormElement) {\n return (typeof srcFormElement.elements[ENCODED_URL] == 'undefined') ?\n srcFormElement.action :\n srcFormElement.elements[ENCODED_URL].value;\n}\n\nexport function resolveFinalUrl(sourceForm: DomQuery, formData: XhrFormData, ajaxType = REQ_TYPE_POST) {\n let targetUrl = resolveTargetUrl(<HTMLFormElement>sourceForm.getAsElem(0).value);\n\n return targetUrl + (ajaxType == REQ_TYPE_GET ? \"?\" + formData.toString() : EMPTY_STR);\n}\n\n/**\n * form resolution the same way our old implementation did\n * it is either the id or the parent form of the element or an embedded form\n * of the element\n *\n * @param elem\n * @param event\n */\nexport function resolveForm(elem: DQ, event: Event): DQ {\n return ExtLang.getForm(elem.getAsElem(0).value, event);\n}\n\nexport function resolveViewId(form: DQ): string {\n const viewState = form.querySelectorAll(`input[type='hidden'][name*='${$nsp(P_VIEWSTATE)}']`).id.orElse(\"\").value;\n const divider = $faces().separatorchar;\n const viewId = viewState.split(divider, 2)[0];\n const viewStateViewId = viewId.indexOf($nsp(P_VIEWSTATE)) === -1 ? viewId : \"\";\n // myfaces specific, we in non portlet environments prepend the viewId\n // even without being in a naming container, the other components ignore that\n return form.id.value.indexOf(viewStateViewId) === 0 ? viewStateViewId : \"\";\n}\n\nexport function resolveViewRootId(form: DQ): string {\n const viewState = form.querySelectorAll(`input[type='hidden'][name*='${$nsp(P_VIEWSTATE)}']`).attr(\"name\").orElse(\"\").value;\n const divider = $faces().separatorchar;\n const viewId = viewState.split(divider, 2)[0];\n //different to the identifier the form id is never prepended to the viewstate\n return viewId.indexOf($nsp(P_VIEWSTATE)) === -1 ? viewId : \"\";\n}\n\n/**\n * as per jsdoc before the request it must be ensured that every post argument\n * is prefixed with the naming container id (there is an exception in mojarra with\n * the element=element param, which we have to follow here as well.\n * (inputs are prefixed by name anyway normally this only affects our standard parameters)\n * @private\n */\nexport function resoveNamingContainerMapper(internalContext: Config): (key: string, value: any) => [string, any] {\n const isNamedViewRoot = internalContext.getIf(NAMED_VIEWROOT).isPresent();\n if(!isNamedViewRoot) {\n return (key, value) => [key, value];\n }\n const partialId = internalContext.getIf(NAMING_CONTAINER_ID).value;\n const SEP = $faces().separatorchar;\n const prefix = partialId + SEP;\n return (key: string, value: any) => (key.indexOf(prefix) == 0) ? [key, value] : [prefix + key, value];\n}\n\nexport function resolveTimeout(options: Config): number {\n let getCfg = ExtLang.getLocalOrGlobalConfig;\n return options.getIf(CTX_OPTIONS_TIMEOUT).value ?? getCfg(options.value, CTX_OPTIONS_TIMEOUT, 0);\n}\n\n/**\n * resolve the delay from the options and/or the request context and or the configuration\n *\n * @param options ... the options object, in most cases it will host the delay value\n */\nexport function resolveDelay(options: Config): number {\n // null, 'none', or undefined will automatically be mapped to 0 aka no delay\n // the config delay will be dropped not needed anymore, it does not really\n // make sense anymore now that it is part of a local spec\n let ret = options.getIf(CTX_OPTIONS_DELAY).orElse(0).value;\n // if delay === none, no delay must be used, aka delay 0\n ret = (DELAY_NONE === ret) ? 0 : ret;\n // negative, or invalid values will automatically get a js exception\n Assertions.assertDelay(ret);\n return ret;\n}\n\n/**\n * resolves the window-id from various sources\n *\n * @param options\n */\nexport function resolveWindowId(options: Config) {\n return options?.value?.windowId ?? ExtDomQuery.windowId;\n}\n\n/**\n * cross port from the dojo lib\n * browser save event resolution\n * @param evt the event object\n * (with a fallback for ie events if none is present)\n * @deprecated soon will be removed\n */\nexport function getEventTarget(evt: Event): Element {\n // ie6 and 7 fallback\n let finalEvent = evt;\n /*\n * evt source is defined in the jsf events\n * seems like some component authors use our code,\n * so we add it here see also\n * https://issues.apache.org/jira/browse/MYFACES-2458\n * not entirely a bug but makes sense to add this\n * behavior. I don´t use it that way but nevertheless it\n * does not break anything so why not\n */\n let t = finalEvent?.srcElement ?? finalEvent?.target ?? (<any>finalEvent)?.source;\n while ((t) && (t.nodeType != 1)) {\n t = t.parentNode;\n }\n return t;\n}\n\n/**\n * resolves a bunch of default values\n * which can be further processed from the given\n * call parameters of faces.ajax.request\n *\n * @param event\n * @param opts\n * @param el\n */\nexport function resolveDefaults(event: Event, opts: Options | [[string, any]] , el: Element | string = null): any {\n //deep copy the options, so that further transformations to not backfire into the callers\n const elem = DQ.byId(el || <Element>event.target, true);\n const options = new ExtConfig(opts).deepCopy as ExtConfig;\n return {\n options: options,\n elem: elem,\n elementId: elem.id.value,\n windowId: resolveWindowId(options),\n isResetValues: true === options.value?.resetValues\n };\n}","/*! Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Config, Optional, XMLQuery} from \"mona-dish\";\n\nimport {Assertions} from \"../util/Assertions\";\nimport {DQ} from \"mona-dish\";\nimport {\n $nsp,\n CTX_PARAM_MF_INTERNAL,\n CTX_PARAM_SRC_CTL_ID,\n CTX_PARAM_SRC_FRM_ID,\n SEL_RESPONSE_XML,\n SOURCE,\n HTML_TAG_FORM,\n UPDATE_ELEMS,\n UPDATE_FORMS,\n DEFERRED_HEAD_INSERTS\n} from \"../core/Const\";\nimport {ExtConfig} from \"../util/ExtDomQuery\";\n\n/**\n * Resolver functions for various aspects of the response data\n *\n * stateless because it might be called from various\n * parts of the response classes\n */\n\n/**\n * fetches the response XML\n * as XML Query object\n *\n * @param request the request hosting the responseXML\n *\n * Throws an error in case of non-existent or wrong xml data\n *\n */\nexport function resolveResponseXML(request: Config): XMLQuery {\n let ret = new XMLQuery($nsp(request.getIf(SEL_RESPONSE_XML).value));\n Assertions.assertValidXMLResponse(ret);\n\n return ret;\n}\n\n/**\n * Splits the incoming pass-through context apart\n * in an internal and an external normalized context\n * the internal one is just for our internal processing\n *\n * @param context the root context as associative array\n */\nexport function resolveContexts(context: { [p: string]: any }): any {\n /**\n * we split the context apart into the external one and\n * some internal values\n */\n let externalContext = ExtConfig.fromNullable(context);\n let internalContext = externalContext.getIf(CTX_PARAM_MF_INTERNAL);\n if (!internalContext.isPresent()) {\n internalContext = ExtConfig.fromNullable({});\n }\n\n /**\n * prepare storage for some deferred operations\n */\n internalContext.assign(DEFERRED_HEAD_INSERTS).value = [];\n internalContext.assign(UPDATE_FORMS).value = [];\n internalContext.assign(UPDATE_ELEMS).value = [];\n return {externalContext, internalContext};\n}\n\n/**\n * fetches the source element out of our contexts\n *\n * @param context the external context which should host the source id\n * @param internalContext internal pass-through fall back\n *\n */\nexport function resolveSourceElement(context: Config, internalContext: Config): DQ {\n let elemId = resolveSourceElementId(context, internalContext);\n return DQ.byId(elemId.value, true);\n}\n\n/**\n * fetches the source form if it still exists\n * also embedded forms and parent forms are taken into consideration\n * as fallbacks\n *\n * @param internalContext\n * @param elem\n */\nexport function resolveSourceForm(internalContext: Config, elem: DQ): DQ {\n let sourceFormId = internalContext.getIf(CTX_PARAM_SRC_FRM_ID);\n let sourceForm = new DQ(sourceFormId.isPresent() ? document.forms[sourceFormId.value] : null);\n\n sourceForm = sourceForm.orElseLazy(() => elem.firstParent(HTML_TAG_FORM))\n .orElseLazy(() => elem.querySelectorAll(HTML_TAG_FORM))\n .orElseLazy(() => DQ.querySelectorAll(HTML_TAG_FORM));\n\n return sourceForm;\n}\n\nfunction resolveSourceElementId(context: Config, internalContext: Config): Optional<string> {\n //?internal context?? used to be external one\n return internalContext.getIf(CTX_PARAM_SRC_CTL_ID)\n .orElseLazy(() => context.getIf(SOURCE, \"id\").value);\n}\n\n","/*! Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {DQ, XMLQuery} from \"mona-dish\";\nimport {ResponseProcessor} from \"./ResponseProcessor\";\n\nimport {IResponseProcessor} from \"./IResponseProcessor\";\nimport {\n $nsp,\n XML_TAG_ATTRIBUTES,\n XML_TAG_CHANGES,\n XML_TAG_DELETE,\n XML_TAG_ERROR,\n XML_TAG_EVAL,\n XML_TAG_EXTENSION,\n XML_TAG_INSERT,\n XML_TAG_REDIRECT,\n XML_TAG_UPDATE, P_RESOURCE,\n P_VIEWBODY,\n P_VIEWHEAD,\n P_VIEWROOT,\n NAMING_CONTAINER_ID,\n XML_TAG_PARTIAL_RESP,\n RESPONSE_XML,\n XML_TAG_AFTER,\n XML_TAG_BEFORE, NAMED_VIEWROOT, XML_ATTR_NAMED_VIEWROOT, P_VIEWSTATE, $faces\n} from \"../core/Const\";\nimport {resolveContexts, resolveResponseXML} from \"./ResonseDataResolver\";\nimport {ExtConfig} from \"../util/ExtDomQuery\";\n\n\n\nexport module Response {\n\n\n /**\n * Standardized faces.ts response\n * this one is called straight from faces.ts.response\n *\n * The processing follows the spec by going for the responseXML\n * and processing its tags\n *\n * @param {XMLHttpRequest} request (xhrRequest) - xhr request object\n * @param context {Context} context (Map) - AJAX context\n *\n */\n export function processResponse(request: XMLHttpRequest, context: Context) {\n\n let req = ExtConfig.fromNullable(request);\n let {externalContext, internalContext} = resolveContexts(context);\n let responseXML: XMLQuery = resolveResponseXML(req);\n let responseProcessor = new ResponseProcessor(req, externalContext, internalContext);\n\n internalContext.assign(RESPONSE_XML).value = responseXML;\n\n // we now process the partial tags, or in none given raise an error\n responseXML.querySelectorAll(XML_TAG_PARTIAL_RESP)\n .each(item => processPartialTag(<XMLQuery>item, responseProcessor, internalContext));\n\n // We now process the viewStates, client windows and the elements to be evaluated are delayed.\n // The reason for this is that often it is better\n // to wait until the document has caught up before\n // doing any evaluations even on embedded scripts.\n // Usually this does not matter, the client window comes in almost last always anyway\n // we maybe drop this deferred assignment in the future, but myfaces did it until now.\n responseProcessor.updateNamedViewRootState();\n responseProcessor.fixViewStates();\n responseProcessor.fixClientWindow();\n responseProcessor.globalEval();\n\n responseProcessor.done();\n }\n\n /**\n * highest node partial-response from there the main operations are triggered\n */\n function processPartialTag(node: XMLQuery, responseProcessor: IResponseProcessor, internalContext) {\n\n\n /*\n https://javaee.github.io/javaserverfaces/docs/2.2/javadocs/web-partialresponse.html#ns_xsd\n The \"partial-response\" element is the root of the partial response information hierarchy,\n and contains nested elements for all possible elements that can exist in the response.\n This element must have an \"id\" attribute whose value is the return from calling getContainerClientId()\n on the UIViewRoot to which this response pertains.\n */\n // we can determine whether we are in a naming container scenario by checking whether the passed view id is present in the page\n // under or in body as identifier\n\n let partialId:string = node?.id?.value;\n internalContext.assignIf(!!partialId, NAMING_CONTAINER_ID).value = partialId; // second case mojarra\n\n // there must be at least one container viewstate element resembling the viewroot that we know\n // this is named\n responseProcessor.updateNamedViewRootState();\n\n const SEL_SUB_TAGS = [XML_TAG_ERROR, XML_TAG_REDIRECT, XML_TAG_CHANGES].join(\",\");\n\n // now we can process the main operations\n node.querySelectorAll(SEL_SUB_TAGS).each((node: XMLQuery) => {\n switch (node.tagName.value) {\n case XML_TAG_ERROR:\n responseProcessor.error(node);\n break;\n case XML_TAG_REDIRECT:\n responseProcessor.redirect(node);\n break;\n case XML_TAG_CHANGES:\n processChangesTag(node, responseProcessor);\n break;\n }\n });\n }\n\n let processInsert = function (responseProcessor: IResponseProcessor, node: XMLQuery) {\n // path1 insert after as child tags\n if(node.querySelectorAll([XML_TAG_BEFORE, XML_TAG_AFTER].join(\",\")).length) {\n responseProcessor.insertWithSubTags(node);\n } else { // insert before after with id\n responseProcessor.insert(node);\n }\n\n };\n\n /**\n * next level changes tag\n *\n * @param node\n * @param responseProcessor\n */\n function processChangesTag(node: XMLQuery, responseProcessor: IResponseProcessor): boolean {\n const ALLOWED_TAGS = [XML_TAG_UPDATE, XML_TAG_EVAL, XML_TAG_INSERT, XML_TAG_DELETE, XML_TAG_ATTRIBUTES, XML_TAG_EXTENSION].join(\", \");\n node.querySelectorAll(ALLOWED_TAGS).each(\n (node: XMLQuery) => {\n switch (node.tagName.value) {\n case XML_TAG_UPDATE:\n processUpdateTag(node, responseProcessor);\n break;\n\n case XML_TAG_EVAL:\n responseProcessor.eval(node);\n break;\n\n case XML_TAG_INSERT:\n processInsert(responseProcessor, node);\n break;\n\n case XML_TAG_DELETE:\n responseProcessor.delete(node);\n break;\n\n case XML_TAG_ATTRIBUTES:\n responseProcessor.attributes(node);\n break;\n\n case XML_TAG_EXTENSION:\n break;\n }\n }\n );\n return true;\n }\n\n /**\n * checks and stores a state update for delayed processing\n *\n * @param responseProcessor the response processor to perform the store operation\n * @param node the xml node to check for the state\n *\n * @private\n */\n function storeState(responseProcessor: IResponseProcessor, node: XMLQuery) {\n return responseProcessor.processViewState(node) || responseProcessor.processClientWindow(node);\n }\n\n /**\n * branch tag update. drill further down into the updates\n * special case viewState in that case it is a leaf\n * and the viewState must be processed\n *\n * @param node\n * @param responseProcessor\n */\n function processUpdateTag(node: XMLQuery, responseProcessor: IResponseProcessor) {\n // early state storing, if no state we perform a normal update cycle\n if (!storeState(responseProcessor, node)) {\n handleElementUpdate(node, responseProcessor);\n }\n }\n\n /**\n * element update\n *\n * @param node\n * @param responseProcessor\n */\n function handleElementUpdate(node: XMLQuery, responseProcessor: IResponseProcessor) {\n let cdataBlock = node.cDATAAsString;\n switch (node.id.value) {\n case $nsp(P_VIEWROOT) :\n responseProcessor.replaceViewRoot(DQ.fromMarkup(cdataBlock.substring(cdataBlock.indexOf(\"<html\"))));\n break;\n\n case $nsp(P_VIEWHEAD):\n responseProcessor.replaceHead(DQ.fromMarkup(cdataBlock));\n break;\n\n case $nsp(P_VIEWBODY):\n responseProcessor.replaceBody(DQ.fromMarkup(cdataBlock));\n break;\n\n case $nsp(P_RESOURCE):\n responseProcessor.addToHead(DQ.fromMarkup(cdataBlock))\n break;\n\n default:// htmlItem replacement\n responseProcessor.update(node, cdataBlock);\n break;\n }\n }\n}","/*! Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Config, DomQuery, DomQueryCollector, DQ, DQ$, Lang, LazyStream, Stream, XMLQuery} from \"mona-dish\";\nimport {Implementation} from \"../AjaxImpl\";\nimport {Assertions} from \"../util/Assertions\";\nimport {IResponseProcessor} from \"./IResponseProcessor\";\nimport {ErrorData} from \"./ErrorData\";\nimport {StateHolder} from \"../core/ImplTypes\";\nimport {EventData} from \"./EventData\";\n\nimport {\n $faces,\n $nsp,\n APPLIED_CLIENT_WINDOW,\n APPLIED_VST,\n ATTR_ID,\n ATTR_NAME,\n ATTR_URL,\n ATTR_VALUE,\n DEFERRED_HEAD_INSERTS,\n EMPTY_FUNC,\n EMPTY_STR,\n ERROR_MESSAGE,\n ERROR_NAME,\n HTML_TAG_BODY,\n HTML_TAG_FORM,\n HTML_TAG_HEAD,\n HTML_TAG_LINK,\n HTML_TAG_SCRIPT,\n HTML_TAG_STYLE, IDENT_ALL, IDENT_NONE, NAMED_VIEWROOT,\n ON_ERROR,\n ON_EVENT,\n P_CLIENT_WINDOW,\n P_EXECUTE,\n P_PARTIAL_SOURCE,\n P_RENDER,\n P_RENDER_OVERRIDE,\n P_VIEWSTATE,\n NAMING_CONTAINER_ID,\n RESPONSE_XML,\n SEL_CLIENT_WINDOW_ELEM,\n SEL_VIEWSTATE_ELEM,\n SOURCE,\n SUCCESS,\n UPDATE_ELEMS,\n UPDATE_FORMS,\n XML_TAG_AFTER,\n XML_TAG_ATTR,\n XML_TAG_BEFORE\n} from \"../core/Const\";\nimport {ExtConfig, ExtDomQuery} from \"../util/ExtDomQuery\";\nimport {HiddenInputBuilder} from \"../util/HiddenInputBuilder\";\nimport trim = Lang.trim;\n\n\n/**\n * Response processor\n *\n * Each XML tag is either a node or a leaf\n * or both\n *\n * the processor provides a set of operations\n * which are executed on a single leaf node per operation\n * and present the core functionality of our response\n *\n * Note the response processor is stateful hence we bundle it in a class\n * to reduce code we keep references tot contexts in place\n */\nexport class ResponseProcessor implements IResponseProcessor {\n\n constructor(private request: Config, private externalContext: Config, private internalContext: Config) {\n }\n\n /**\n * head replacement\n * @param shadowDocument incoming shadow head data (aka cdata as xml reference or dom element)\n * the data incoming must represent the html representation of the head itself one way or the other\n */\n replaceHead(shadowDocument: XMLQuery | DQ) {\n const shadowHead = shadowDocument.querySelectorAll(HTML_TAG_HEAD);\n if (!shadowHead.isPresent()) {\n return;\n }\n const head = ExtDomQuery.querySelectorAll(HTML_TAG_HEAD);\n // full replace we delete everything\n head.childNodes.delete();\n this.addToHead(shadowHead);\n //we copy the attributes as well (just in case myfaces introduces the id in head)\n head.copyAttrs(shadowHead);\n }\n\n addToHead(shadowHead: XMLQuery | DQ) {\n const mappedHeadData = new ExtDomQuery(shadowHead);\n const scriptTags = [HTML_TAG_SCRIPT];\n const nonExecutables = mappedHeadData.filter(item => scriptTags.indexOf(item.tagName.orElse(\"\").value) == -1);\n nonExecutables.runHeadInserts(true);\n\n //incoming either the outer head tag or its children\n const nodesToAdd = (shadowHead.tagName.value === \"HEAD\") ? shadowHead.childNodes : shadowHead;\n // this is stored for \"post\" processing\n // after the rest of the \"physical build up\", head before body\n const scriptElements = nodesToAdd.stream\n .filter(item => scriptTags.indexOf(item.tagName.orElse(\"\").value) != -1).collect(new DomQueryCollector());\n\n this.addToHeadDeferred(scriptElements);\n }\n\n addToHeadDeferred(newElements: XMLQuery | DQ) {\n this.internalContext.assign(DEFERRED_HEAD_INSERTS).value.push(newElements);\n }\n\n /**\n * replaces the body in the expected manner\n * which means the entire body content is refreshed\n * however also the body attributes must be transferred\n * keeping event handlers etc... in place\n *\n * @param shadowDocument .. an incoming shadow document hosting the new nodes\n */\n replaceBody(shadowDocument: XMLQuery | DQ) {\n\n const shadowBody = shadowDocument.querySelectorAll(HTML_TAG_BODY);\n if (!shadowBody.isPresent()) {\n return;\n }\n\n const shadowInnerHTML: string = <string>shadowBody.innerHTML;\n const resultingBody = <DQ>ExtDomQuery.querySelectorAll(HTML_TAG_BODY);\n const updateForms = resultingBody.querySelectorAll(HTML_TAG_FORM);\n\n // main difference, we cannot replace the body itself, but only its content\n // we need a separate step for post-processing the incoming\n // attributes, like classes, styles etc...\n (resultingBody.html(shadowInnerHTML) as DQ).copyAttrs(shadowBody);\n this.externalContext.assign($nsp(P_RENDER_OVERRIDE)).value = \"@all\";\n this.storeForPostProcessing(updateForms, resultingBody);\n }\n\n /**\n * Leaf Tag eval... process whatever is in the eval cdata block\n *\n * @param node the node to eval\n */\n eval(node: XMLQuery) {\n ExtDomQuery.globalEval(node.cDATAAsString);\n }\n\n /**\n * processes an incoming error from the response\n * which is hosted under the <error> tag\n * @param node the node hosting the error in our response xml\n * @param node the node in the xml hosting the error message\n */\n error(node: XMLQuery) {\n /**\n * <error>\n * <error-name>String</error-name>\n * <error-message><![CDATA[message]]></error-message>\n * <error>\n */\n\n const mergedErrorData = new ExtConfig({});\n mergedErrorData.assign(SOURCE).value = this.externalContext.getIf(P_PARTIAL_SOURCE).get(0).value;\n mergedErrorData.assign(ERROR_NAME).value = node.querySelectorAll(ERROR_NAME).textContent(EMPTY_STR);\n mergedErrorData.assign(ERROR_MESSAGE).value = node.querySelectorAll(ERROR_MESSAGE).cDATAAsString;\n\n const hasResponseXML = this.internalContext.get(RESPONSE_XML).isPresent();\n\n //we now store the response xml also in the error data for further details\n mergedErrorData.assignIf(hasResponseXML, RESPONSE_XML).value = this.internalContext.getIf(RESPONSE_XML).value.get(0).value;\n\n // error post-processing and enrichment (standard messages from keys)\n const errorData = ErrorData.fromServerError(mergedErrorData);\n\n // we now trigger an internally stored onError function which might be an attached to the context\n // either we do not have an internal on error, or an on error has been based via params from the outside.\n // In both cases they are attached to our contexts\n\n this.triggerOnError(errorData);\n Implementation.sendError(errorData);\n }\n\n /**\n * process the redirect operation\n *\n * @param node\n */\n redirect(node: XMLQuery) {\n Assertions.assertUrlExists(node);\n\n const redirectUrl = trim(node.attr(ATTR_URL).value);\n if (redirectUrl != EMPTY_STR) {\n window.location.href = redirectUrl;\n }\n }\n\n /**\n * processes the update operation and updates the node with the cdata block\n * @param node the xml response node hosting the update info\n * @param cdataBlock the cdata block with the new html code\n */\n update(node: XMLQuery, cdataBlock: string) {\n const result = ExtDomQuery.byId(node.id.value, true).outerHTML(cdataBlock, false, false);\n const sourceForm = result?.firstParent(HTML_TAG_FORM).orElseLazy(() => result.byTagName(HTML_TAG_FORM, true));\n if (sourceForm) {\n this.storeForPostProcessing(sourceForm, result);\n }\n }\n\n /**\n * Delete handler, simply deletes the node referenced by the xml data\n * @param node\n */\n delete(node: XMLQuery) {\n DQ.byId(node.id.value, true).delete();\n }\n\n /**\n * attributes leaf tag... process the attributes\n *\n * @param node\n */\n attributes(node: XMLQuery) {\n const elem = DQ.byId(node.id.value, true);\n\n node.byTagName(XML_TAG_ATTR).each((item: XMLQuery) => {\n elem.attr(item.attr(ATTR_NAME).value).value = item.attr(ATTR_VALUE).value;\n });\n }\n\n /**\n * @param shadowDocument a shadow document which is needed for further processing\n */\n replaceViewRoot(shadowDocument: XMLQuery) {\n this.replaceHead(shadowDocument);\n this.replaceBody(shadowDocument);\n }\n\n /**\n * Insert handling, either before or after\n *\n * @param node\n */\n insert(node: XMLQuery) {\n //let insertId = node.id; //not used atm\n\n const before = node.attr(XML_TAG_BEFORE);\n const after = node.attr(XML_TAG_AFTER);\n const insertNodes = DQ.fromMarkup(<any>node.cDATAAsString);\n\n if (before.isPresent()) {\n DQ.byId(before.value, true).insertBefore(insertNodes);\n this.internalContext.assign(UPDATE_ELEMS).value.push(insertNodes);\n }\n if (after.isPresent()) {\n const domQuery = DQ.byId(after.value, true);\n domQuery.insertAfter(insertNodes);\n\n this.internalContext.assign(UPDATE_ELEMS).value.push(insertNodes);\n }\n }\n\n /**\n * Handler for the case <insert << before id=\"...\n *\n * @param node the node hosting the insert data\n */\n insertWithSubTags(node: XMLQuery) {\n const before = node.querySelectorAll(XML_TAG_BEFORE);\n const after = node.querySelectorAll(XML_TAG_AFTER);\n\n before.each(item => {\n const insertId = item.attr(ATTR_ID);\n const insertNodes = DQ.fromMarkup(<any>item.cDATAAsString);\n if (insertId.isPresent()) {\n DQ.byId(insertId.value, true).insertBefore(insertNodes);\n this.internalContext.assign(UPDATE_ELEMS).value.push(insertNodes);\n }\n });\n\n after.each(item => {\n const insertId = item.attr(ATTR_ID);\n const insertNodes = DQ.fromMarkup(<any>item.cDATAAsString);\n if (insertId.isPresent()) {\n DQ.byId(insertId.value, true).insertAfter(insertNodes);\n this.internalContext.assign(UPDATE_ELEMS).value.push(insertNodes);\n }\n });\n }\n\n /**\n * Process the viewState update, update the affected\n * forms with their respective new viewState values\n *\n */\n processViewState(node: XMLQuery): boolean {\n if (ResponseProcessor.isViewStateNode(node)) {\n const state = node.cDATAAsString;\n this.internalContext.assign(APPLIED_VST, node.id.value).value = new StateHolder($nsp(node.id.value), state);\n return true;\n }\n return false;\n }\n\n processClientWindow(node: XMLQuery): boolean {\n if (ResponseProcessor.isClientWindowNode(node)) {\n const state = node.cDATAAsString;\n this.internalContext.assign(APPLIED_CLIENT_WINDOW, node.id.value).value = new StateHolder($nsp(node.id.value), state);\n return true;\n }\n }\n\n /**\n * generic global eval which runs the embedded css and scripts\n */\n globalEval() {\n // phase one, if we have head inserts, we build up those before going into the script eval phase\n let insertHeadElems = new ExtDomQuery(...this.internalContext.getIf(DEFERRED_HEAD_INSERTS).value);\n insertHeadElems.runHeadInserts(true);\n\n // phase 2 we run a script eval on all updated elements in the body\n let updateElems = new ExtDomQuery(...this.internalContext.getIf(UPDATE_ELEMS).value);\n updateElems.runCss();\n // phase 3, we do the same for the css\n updateElems.runScripts();\n }\n\n /**\n * Postprocessing view state fixing\n * this appends basically the incoming view states to the forms.\n * It is called from outside after all forms have been processed basically\n * as last lifecycle step, before going into the next request.\n */\n fixViewStates() {\n Stream.ofAssoc<StateHolder>(this.internalContext.getIf(APPLIED_VST).orElse({}).value)\n .each(([, value]) => {\n const namingContainerId = this.internalContext.getIf(NAMING_CONTAINER_ID);\n const namedViewRoot = !!this.internalContext.getIf(NAMED_VIEWROOT).value\n const affectedForms = this.getContainerForms(namingContainerId)\n .filter(affectedForm => this.isInExecuteOrRender(affectedForm));\n\n this.appendViewStateToForms(affectedForms, namedViewRoot, value.value, namingContainerId.orElse(\"\").value);\n });\n }\n\n\n\n /**\n * same as with view states before applies the incoming client windows as last step after the rest of the processing\n * is done.\n */\n fixClientWindow() {\n Stream.ofAssoc<StateHolder>(this.internalContext.getIf(APPLIED_CLIENT_WINDOW).orElse({}).value)\n .each(([, value]) => {\n const namingContainerId = this.internalContext.getIf(NAMING_CONTAINER_ID);\n const namedViewRoot = !!this.internalContext.getIf(NAMED_VIEWROOT).value;\n const affectedForms = this.getContainerForms(namingContainerId)\n .filter(affectedForm => this.isInExecuteOrRender(affectedForm));\n\n this.appendClientWindowToForms(affectedForms, namedViewRoot, value.value, namingContainerId.orElse(\"\").value);\n });\n }\n\n updateNamedViewRootState() {\n let partialId = this.internalContext.getIf(NAMING_CONTAINER_ID);\n let namedViewRoot = this.internalContext.getIf(NAMED_VIEWROOT);\n if(partialId.isPresent() &&\n (namedViewRoot.isAbsent() ||\n !namedViewRoot.value)) {\n const SEP = $faces().separatorchar;\n this.internalContext.assign(NAMED_VIEWROOT).value = (!!document.getElementById(partialId.value)) || DQ$(`input[name*='${$nsp(P_VIEWSTATE)}']`)\n .filter(node => node.attr(\"name\").value.indexOf(partialId.value + SEP) == 0).length > 0;\n }\n }\n\n /**\n * all processing done we can close the request and send the appropriate events\n */\n done() {\n const eventData = EventData.createFromRequest(this.request.value, this.externalContext, SUCCESS);\n\n //because some frameworks might decorate them over the context in the response\n const eventHandler = this.externalContext.getIf(ON_EVENT).orElseLazy(() => this.internalContext.getIf(ON_EVENT).value).orElse(EMPTY_FUNC).value;\n Implementation.sendEvent(eventData, eventHandler);\n }\n\n /**\n * proper viewState -> form assignment\n *\n * @param forms the forms to append the viewState to\n * @param viewState the final viewState\n * @param namingContainerId\n */\n private appendViewStateToForms(forms: DQ, namedViewRoot: boolean, viewState: string, namingContainerId = \"\") {\n this.assignState(forms, $nsp(SEL_VIEWSTATE_ELEM), namedViewRoot, viewState, namingContainerId);\n }\n\n\n /**\n * proper clientWindow -> form assignment\n *\n * @param forms the forms to append the viewState to\n * @param clientWindow the final viewState\n * @param namingContainerId\n */\n private appendClientWindowToForms(forms: DQ, namedViewRoot: boolean, clientWindow: string, namingContainerId = \"\") {\n this.assignState(forms, $nsp(SEL_CLIENT_WINDOW_ELEM), namedViewRoot, clientWindow, namingContainerId);\n }\n\n /**\n * generic append state which appends a certain state as hidden element to an existing set of forms\n *\n * @param forms the forms to append or change to\n * @param selector the selector for the state\n * @param namedViewRoot if set to true, the name is also prefixed\n * @param state the state itself which needs to be assigned\n *\n * @param namingContainerId\n * @private\n */\n private assignState(forms: DQ, selector: string, namedViewRoot: boolean, state: string, namingContainerId: string) {\n /**\n * creates the viewState or client window id element\n * @param form\n */\n const createAndAppendHiddenInput = (form: DomQuery) => {\n return new HiddenInputBuilder(selector)\n .withNamingContainerId(namingContainerId)\n .withParent(form)\n .withNamedViewRoot(namedViewRoot)\n .build();\n };\n\n forms.each(form => {\n const hiddenInput = form.querySelectorAll(selector)\n .orElseLazy(() => createAndAppendHiddenInput(form));\n hiddenInput.val = state;\n });\n }\n\n /**\n * Stores certain aspects of the dom for later post-processing\n *\n * @param updateForms the update forms which should receive standardized internal jsf data\n * @param toBeEvaluated the resulting elements which should be evaluated\n */\n private storeForPostProcessing(updateForms: DQ, toBeEvaluated: DQ) {\n this.storeForUpdate(updateForms);\n this.storeForEval(toBeEvaluated);\n }\n\n /**\n * helper to store a given form for the update post-processing (viewState)\n *\n * @param updateForms the dom query object pointing to the forms which need to be updated\n */\n private storeForUpdate(updateForms: DQ) {\n this.internalContext.assign(UPDATE_FORMS).value.push(updateForms);\n }\n\n /**\n * same for eval (js and css)\n *\n * @param toBeEvaluated\n */\n private storeForEval(toBeEvaluated: DQ) {\n this.internalContext.assign(UPDATE_ELEMS).value.push(toBeEvaluated);\n }\n\n /**\n * check whether a given XMLQuery node is an explicit viewState node\n *\n * @param node the node to check\n * @returns if it is a viewState node\n */\n private static isViewStateNode(node: XMLQuery): boolean {\n const SEP = $faces().separatorchar;\n return \"undefined\" != typeof node?.id?.value && (node?.id?.value == $nsp(P_VIEWSTATE) ||\n node?.id?.value?.indexOf([SEP, $nsp(P_VIEWSTATE)].join(EMPTY_STR)) != -1 ||\n node?.id?.value?.indexOf([$nsp(P_VIEWSTATE), SEP].join(EMPTY_STR)) != -1);\n }\n\n /**\n * incoming client window node also needs special processing\n *\n * @param node the node to check\n * @returns true of it ii\n */\n private static isClientWindowNode(node: XMLQuery): boolean {\n const SEP = $faces().separatorchar;\n return \"undefined\" != typeof node?.id?.value && (node?.id?.value == $nsp(P_CLIENT_WINDOW) ||\n node?.id?.value?.indexOf([SEP, $nsp(P_CLIENT_WINDOW)].join(EMPTY_STR)) != -1 ||\n node?.id?.value?.indexOf([$nsp(P_CLIENT_WINDOW), SEP].join(EMPTY_STR)) != -1);\n }\n\n private triggerOnError(errorData: ErrorData) {\n this.externalContext.getIf(ON_ERROR).orElseLazy(() => this.internalContext.getIf(ON_ERROR).value).orElse(EMPTY_FUNC).value(errorData);\n }\n\n /**\n * filters the forms according to being member of the \"execute\" or \"render\" cycle\n * @param affectedForm\n * @private\n */\n private isInExecuteOrRender(affectedForm) {\n const executes = this.externalContext.getIf($nsp(P_EXECUTE)).orElse(\"@none\").value.split(/\\s+/gi);\n const renders = this.externalContext.getIf(P_RENDER_OVERRIDE)\n .orElseLazy(() => this.externalContext.getIf($nsp(P_RENDER)).value)\n .orElse(IDENT_NONE).value.split(/\\s+/gi);\n const executeAndRenders = executes.concat(...renders);\n return LazyStream.of(...executeAndRenders).filter(nameOrId => {\n if ([IDENT_ALL, IDENT_NONE].indexOf(nameOrId) != -1) {\n return true;\n }\n\n const NAME_OR_ID = this.getNameOrIdSelector(nameOrId);\n //either the form directly is in execute or render or one of its children or one of its parents\n return affectedForm.matchesSelector(NAME_OR_ID) ||\n affectedForm.querySelectorAll(NAME_OR_ID).isPresent() ||\n affectedForm.firstParent(NAME_OR_ID).isPresent();\n }).first().isPresent();\n }\n\n /**\n * gets all forms under a single naming container id\n * @param namingContainerId\n * @private\n */\n private getContainerForms(namingContainerId: Config) {\n if (namingContainerId.isPresent()) {\n //naming container mode, all forms under naming container id must be processed\n return DQ$(this.getNameOrIdSelector(namingContainerId.value))\n // missing condition if the naming container is not present we have to\n // use the body as fallback\n .orElseLazy(() => DQ.byTagName(HTML_TAG_BODY))\n .byTagName(HTML_TAG_FORM, true);\n } else {\n return DQ.byTagName(HTML_TAG_FORM);\n }\n }\n\n private getNameOrIdSelector(nameOrId) {\n return `[id='${nameOrId}'], [name='${nameOrId}']`;\n }\n}","/*! Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {Config, DQ, FormDataCollector, Stream} from \"mona-dish\";\nimport {$nsp, EMPTY_STR, IDENT_NONE, P_VIEWSTATE} from \"../core/Const\";\n\nimport {\n encodeFormData,\n fixEmmptyParameters, getFormInputsAsStream\n} from \"../util/FileUtils\";\n\n\ntype ParamsMapper<V, K> = (key: V, item: K) => [V, K];\nconst defaultParamsMapper: ParamsMapper<string, any> = (key, item) => [key, item];\n\n\n/**\n * A unified form data class\n * which builds upon our configuration.\n *\n * We cannot use standard html5 forms everywhere\n * due to api constraints on the HTML Form object in IE11\n * and due to the url encoding constraint given by the faces.js spec\n *\n *\n * internal storage format\n * every value is stored as an array\n * even scalar ones!\n */\nexport class XhrFormData extends Config {\n /**\n * Checks if the given datasource is a multipart request source\n * multipart is only needed if one of the executes is a file input\n * since file inputs are stateless, they fall out of the view state\n * and need special handling. With file submits we have to send a formData object\n * instead of an encoded string files cannot be sent that way\n */\n isMultipartRequest: boolean = false;\n\n /**\n * data collector from a given form\n *\n * @param dataSource either a form as DomQuery object or an encoded url string\n * @param paramsMapper a remapper for the params keys and values\n * @param executes the executes id list for the elements to being processed\n * @param partialIds partial ids to collect, to reduce the data sent down\n */\n constructor(private dataSource: DQ, private paramsMapper: ParamsMapper<string, any> = defaultParamsMapper, executes?: string[], private partialIds?: string[]) {\n super({});\n //encode and append the issuing item if not a partial ids array of ids is passed\n /*\n * Spec. 13.3.1\n * Collect and encode input elements.\n * Additionally the hidden element jakarta.faces.ViewState\n * Enhancement partial page submit\n */\n this.resolveRequestType(this.dataSource, executes);\n this.encodeSubmittableFields(this.dataSource, this.partialIds);\n this.applyViewState(this.dataSource);\n }\n\n /**\n * @returns a Form data representation, this is needed for file submits\n */\n toFormData(): FormData {\n /*\n * expands key: [item1, item2]\n * to: [{key: key, value: item1}, {key: key, value: item2}]\n */\n let expandAssocArray = ([key, item]) =>\n Stream.of(...(item as Array<any>)).map(value => {\n return {key, value};\n });\n\n /*\n * remaps the incoming {key, value} tuples\n * to naming container prefixed keys and values\n */\n let remapForNamingContainer = ({key, value}) => {\n key = this.remapKeyForNamingContainer(key);\n return {key, value}\n };\n\n /*\n * collects everything into a FormData object\n */\n return Stream.ofAssoc(this.value)\n .flatMap(expandAssocArray)\n .map(remapForNamingContainer)\n .collect(new FormDataCollector() as any);\n }\n\n /**\n * returns an encoded string representation of our xhr form data\n *\n * @param defaultStr optional default value if nothing is there to encode\n */\n toString(defaultStr = EMPTY_STR): string {\n return encodeFormData(this, this.paramsMapper, defaultStr);\n }\n\n /**\n * generic post init code, for now, this performs some post assign data post-processing\n * @param executes the executable dom nodes which need to be processed into the form data, which we can send\n * in our ajax request\n */\n private resolveRequestType(rootElement: DQ, executes?: Array<string>) {\n if (!executes || executes.indexOf(IDENT_NONE) != -1) {\n return;\n }\n this.isMultipartRequest = rootElement.isMultipartCandidate(true);\n }\n\n /**\n * special case view state handling\n *\n * @param form the form holding the view state value\n */\n private applyViewState(form: DQ) {\n if (this.getIf($nsp(P_VIEWSTATE)).isPresent()) {\n return;\n }\n let viewStateElement = form.querySelectorAllDeep(`[name*='${$nsp(P_VIEWSTATE)}'`);\n let viewState = viewStateElement.inputValue;\n this.appendIf(viewState.isPresent(), this.remapKeyForNamingContainer(viewStateElement.name.value)).value = viewState.value;\n }\n\n /**\n * determines fields to submit\n * @param {Object} targetBuf - the target form buffer receiving the data\n * @param {Node} parentItem - form element item is nested in\n * @param {Array} partialIds - ids fo PPS\n */\n private encodeSubmittableFields(parentItem: DQ, partialIds ?: string[]) {\n\n const formInputs = getFormInputsAsStream(parentItem);\n const mergeIntoThis = ([key, value]) => this.append(key).value = value;\n const namingContainerRemap = ([key, value]) => this.paramsMapper(key as string, value);\n\n formInputs\n .map(fixEmmptyParameters)\n .map(namingContainerRemap)\n .each(mergeIntoThis);\n }\n\n private remapKeyForNamingContainer(key: string): string {\n return this.paramsMapper(key, \"\")[0];\n }\n}","/*! Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {AsyncRunnable} from \"../util/AsyncRunnable\";\nimport {Config, DQ, DQ$, Stream} from \"mona-dish\";\nimport {Implementation} from \"../AjaxImpl\";\n\nimport {XhrFormData} from \"./XhrFormData\";\nimport {ErrorData} from \"./ErrorData\";\nimport {EventData} from \"./EventData\";\nimport {ExtLang} from \"../util/Lang\";\nimport {\n $faces,\n BEGIN,\n COMPLETE,\n CONTENT_TYPE,\n CTX_PARAM_MF_INTERNAL,\n CTX_PARAM_REQ_PASS_THR,\n ERROR,\n HEAD_FACES_REQ,\n MALFORMEDXML,\n NO_TIMEOUT,\n ON_ERROR,\n ON_EVENT, P_EXECUTE,\n REQ_ACCEPT,\n REQ_TYPE_GET,\n REQ_TYPE_POST, SOURCE,\n STATE_EVT_TIMEOUT,\n STD_ACCEPT,\n URL_ENCODED,\n VAL_AJAX, IDENT_NONE\n} from \"../core/Const\";\nimport {\n resolveFinalUrl,\n resolveHandlerFunc,\n resoveNamingContainerMapper\n} from \"./RequestDataResolver\";\nimport failSaveExecute = ExtLang.failSaveExecute;\nimport {ExtConfig} from \"../util/ExtDomQuery\";\n\n/**\n * Faces XHR Request Wrapper\n * as AsyncRunnable for our Asynchronous queue\n *\n * The idea is that we basically just enqueue\n * a single ajax request into our queue\n * and let the queue do the processing.\n *\n *\n */\n\nexport class XhrRequest implements AsyncRunnable<XMLHttpRequest> {\n\n private responseContext: Config;\n\n private stopProgress = false;\n\n /**\n * helper support so that we do not have to drag in Promise shims\n */\n private catchFunctions: Array<Function> = [];\n private thenFunctions: Array<Function> = [];\n\n /**\n * Required Parameters\n *\n * @param source the issuing element\n * @param sourceForm the form which is related to the issuing element\n * @param requestContext the request context with all pass through values\n *\n * Optional Parameters\n *\n * @param internalContext internal context with internal info which is passed through, not used by the user\n * @param partialIdsArray an optional restricting partial ids array for encoding\n * @param timeout optional xhr timeout\n * @param ajaxType optional request type, default \"POST\"\n * @param contentType optional content type, default \"application/x-www-form-urlencoded\"\n * @param xhrObject optional xhr object which must fulfill the XMLHTTPRequest api, default XMLHttpRequest\n */\n constructor(\n private source: DQ,\n private sourceForm: DQ,\n private requestContext: ExtConfig,\n private internalContext: Config,\n private partialIdsArray = [],\n private timeout = NO_TIMEOUT,\n private ajaxType = REQ_TYPE_POST,\n private contentType = URL_ENCODED,\n private xhrObject = new XMLHttpRequest()\n ) {\n\n // we omit promises here because we have to deal with cancel functionality,\n // and promises to not provide that (yet) instead we have our async queue\n // which uses an api internally, which is very close to promises\n this.registerXhrCallbacks((data: any) => {\n this.resolve(data)\n }, (data: any) => {\n this.reject(data)\n });\n }\n\n start(): AsyncRunnable<XMLHttpRequest> {\n\n let ignoreErr = failSaveExecute;\n let xhrObject = this.xhrObject;\n\n let executesArr = () => {\n return this.requestContext.getIf(CTX_PARAM_REQ_PASS_THR, P_EXECUTE).get(IDENT_NONE).value.split(/\\s+/gi);\n };\n\n try {\n // encoded we need to decode\n // We generated a base representation of the current form\n // in case someone has overloaded the viewState with additional decorators we merge\n // that in, there is no way around it, the spec allows it and getViewState\n // must be called, so whatever getViewState delivers has higher priority then\n // whatever the formData object delivers\n // the partialIdsArray arr is almost deprecated legacy code where we allowed to send a separate list of partial\n // ids for reduced load and server processing, this will be removed soon, we can handle the same via execute\n // anyway TODO reimplement the partial ids array, we still do not have it in jsf the way we need it\n let formData: XhrFormData = new XhrFormData(this.sourceForm, resoveNamingContainerMapper(this.internalContext), executesArr(), this.partialIdsArray);\n\n this.contentType = formData.isMultipartRequest ? \"undefined\" : this.contentType;\n\n // next step the pass through parameters are merged in for post params\n this.requestContext.$nspEnabled = false;\n let requestContext = this.requestContext;\n let requestPassThroughParams = requestContext.getIf(CTX_PARAM_REQ_PASS_THR) as ExtConfig;\n\n // we are turning off here the jsf, faces remapping because we are now dealing with\n // pass-through parameters\n requestPassThroughParams.$nspEnabled = false;\n // this is an extension where we allow pass through parameters to be sent down additionally\n // this can be used and is used in the impl to enrich the post request parameters with additional\n // information\n try {\n formData.shallowMerge(requestPassThroughParams, true, true);\n } finally {\n this.requestContext.$nspEnabled = true;\n requestPassThroughParams.$nspEnabled = true;\n }\n\n this.responseContext = requestPassThroughParams.deepCopy;\n\n // we have to shift the internal passthroughs around to build up our response context\n let responseContext = this.responseContext;\n\n responseContext.assign(CTX_PARAM_MF_INTERNAL).value = this.internalContext.value;\n\n // per spec the onevent and onerror handlers must be passed through to the response\n responseContext.assign(ON_EVENT).value = requestContext.getIf(ON_EVENT).value;\n responseContext.assign(ON_ERROR).value = requestContext.getIf(ON_ERROR).value;\n\n xhrObject.open(this.ajaxType, resolveFinalUrl(this.sourceForm, formData, this.ajaxType), true);\n\n // adding timeout\n this.timeout ? xhrObject.timeout = this.timeout : null;\n\n // a bug in the xhr stub library prevents the setRequestHeader to be properly executed on fake xhr objects\n // normal browsers should resolve this\n // tests can quietly fail on this one\n if(this.contentType != \"undefined\") {\n ignoreErr(() => xhrObject.setRequestHeader(CONTENT_TYPE, `${this.contentType}; charset=utf-8`));\n }\n\n ignoreErr(() => xhrObject.setRequestHeader(HEAD_FACES_REQ, VAL_AJAX));\n\n // probably not needed anymore, will test this\n // some webkit based mobile browsers do not follow the w3c spec of\n // setting, they accept headers automatically\n ignoreErr(() => xhrObject.setRequestHeader(REQ_ACCEPT, STD_ACCEPT));\n\n this.sendEvent(BEGIN);\n this.sendRequest(formData);\n } catch (e) {\n // _onError\n this.handleError(e);\n }\n return this;\n }\n\n cancel() {\n try {\n this.xhrObject.abort();\n } catch (e) {\n this.handleError(e);\n }\n }\n\n resolve(data: any) {\n Stream.of(...this.thenFunctions).reduce((inputVal: any, thenFunc: any) => {\n return thenFunc(inputVal);\n }, data);\n }\n\n reject(data: any) {\n Stream.of(...this.catchFunctions).reduce((inputVal: any, catchFunc: any) => {\n return catchFunc(inputVal);\n }, data);\n }\n\n catch(func: (data: any) => any): AsyncRunnable<XMLHttpRequest> {\n this.catchFunctions.push(func);\n return this;\n }\n\n finally(func: () => void): AsyncRunnable<XMLHttpRequest> {\n // no ie11 support we probably are going to revert to shims for that one\n this.catchFunctions.push(func);\n this.thenFunctions.push(func);\n return this;\n }\n\n then(func: (data: any) => any): AsyncRunnable<XMLHttpRequest> {\n this.thenFunctions.push(func);\n return this;\n }\n\n /**\n * attaches the internal event and processing\n * callback within the promise to our xhr object\n *\n * @param resolve\n * @param reject\n */\n private registerXhrCallbacks(resolve: Consumer<any>, reject: Consumer<any>) {\n let xhrObject = this.xhrObject;\n\n xhrObject.onabort = () => {\n this.onAbort(reject);\n };\n xhrObject.ontimeout = () => {\n this.onTimeout(reject);\n };\n xhrObject.onload = () => {\n this.onSuccess(resolve)\n };\n xhrObject.onloadend = () => {\n this.onDone(this.xhrObject, resolve);\n };\n xhrObject.onerror = (errorData: any) => {\n\n // some browsers trigger an error when cancelling a request internally\n // in this case we simply ignore the request and clear up the queue, because\n // it is not safe anymore to proceed with the current queue\n // This bypasses a Safari issue where it keeps requests hanging after page unload\n // and then triggers a cancel error on then instead of just stopping\n // and clearing the code\n if(this.isCancelledResponse(this.xhrObject)) {\n reject();\n this.stopProgress = true;\n return;\n }\n this.onError(errorData, reject);\n };\n }\n\n private isCancelledResponse(currentTarget: XMLHttpRequest): boolean {\n return currentTarget?.status === 0 && // cancelled by browser\n currentTarget?.readyState === 4 &&\n currentTarget?.responseText === '' &&\n currentTarget?.responseXML === null;\n }\n\n /*\n * xhr processing callbacks\n *\n * Those methods are the callbacks called by\n * the xhr object depending on its own state\n */\n\n private onAbort(reject: Consumer<any>) {\n reject();\n }\n\n private onTimeout(reject: Consumer<any>) {\n this.sendEvent(STATE_EVT_TIMEOUT);\n reject();\n }\n\n private onSuccess(resolve: Consumer<any>) {\n\n this.sendEvent(COMPLETE);\n\n // malformed responses always result in empty response xml\n // per spec a valid response cannot be empty\n if (!this?.xhrObject?.responseXML) {\n this.handleMalFormedXML(resolve);\n return;\n }\n\n $faces().ajax.response(this.xhrObject, this.responseContext.value ?? {});\n }\n\n private handleMalFormedXML(resolve: Function) {\n this.stopProgress = true;\n let errorData = {\n type: ERROR,\n status: MALFORMEDXML,\n responseCode: 200,\n responseText: this.xhrObject?.responseText,\n // we remap the element just in case it gets replaced\n // it will be unremapped\n source: this.source.id.value\n };\n try {\n this.handleError(errorData, true);\n } finally {\n // we issue a resolve in this case to allow the system to recover\n // reject would clean up the queue\n resolve(errorData);\n }\n // non blocking non clearing\n }\n\n private onDone(data: any, resolve: Consumer<any>) {\n // if stop progress a special handling including resolve is already performed\n if (this.stopProgress) {\n return;\n }\n resolve(data);\n }\n\n private onError(errorData: any, reject: Consumer<any>) {\n this.handleError(errorData);\n reject();\n }\n\n private sendRequest(formData: XhrFormData) {\n let isPost = this.ajaxType != REQ_TYPE_GET;\n if (formData.isMultipartRequest) {\n // in case of a multipart request we send in a formData object as body\n this.xhrObject.send((isPost) ? formData.toFormData() : null);\n } else {\n // in case of a normal request we send it normally\n this.xhrObject.send((isPost) ? formData.toString() : null);\n }\n }\n\n /*\n * other helpers\n */\n private sendEvent(evtType: string) {\n let eventData = EventData.createFromRequest(this.xhrObject, this.requestContext, evtType);\n try {\n // User code error, we might cover\n // this in onError, but also we cannot swallow it.\n // We need to resolve the local handlers lazily,\n // because some frameworks might decorate them over the context in the response\n let eventHandler = resolveHandlerFunc(this.requestContext, this.responseContext, ON_EVENT);\n\n Implementation.sendEvent(eventData, eventHandler);\n } catch (e) {\n e.source = e?.source ?? this.requestContext.getIf(SOURCE).value;\n this.handleError(e);\n throw e;\n }\n }\n\n private handleError(exception, responseFormatError: boolean = false) {\n let errorData = (responseFormatError) ? ErrorData.fromHttpConnection(exception.source, exception.type, exception.status, exception.responseText, exception.responseCode, exception.status) : ErrorData.fromClient(exception);\n\n let eventHandler = resolveHandlerFunc(this.requestContext, this.responseContext, ON_ERROR);\n Implementation.sendError(errorData, eventHandler);\n }\n}","/*! Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {DQ, Stream} from \"mona-dish\";\n\n/**\n * legacy code to enable various aspects\n * of myfaces, used to be rendered inline\n * for jsf 2.0 we can externalize it into its own custom resource\n *\n * note this is a straight 1:1 port from the existing codebase\n * (not too much work has been spent here, the important thing is, that\n * the namespace and functions need to be kept intact for legacy code)\n *\n * we might move the code over in the future, but for now a straight 1:1 port suffices\n */\nexport module oam {\n /**\n * sets a hidden input field\n * @param formName the formName\n * @param name the hidden field\n * @param value the value to be rendered\n */\n export const setHiddenInput = function (formName: string, name: string, value: string): void {\n DQ.byId(document.forms[formName])\n .each(form => {\n const input = form.querySelectorAll(`input[type='hidden'][name='${name}']`);\n if (input.isPresent()) {\n input.inputValue.value = value;\n } else {\n const newInput = DQ.fromMarkup(`<input type='hidden' id='${name}' name='${name}'>`);\n newInput.inputValue.value = value;\n newInput.appendTo(form);\n }\n });\n };\n\n /**\n * clears a hidden input field\n *\n * @param formName formName for the input\n * @param name the name of the input field\n */\n export const clearHiddenInput = function (formName: string, name: string): void {\n let element = document.forms?.[formName]?.elements?.[name];\n if(!element) {\n return;\n }\n DQ.byId(element).delete();\n };\n\n // noinspection JSUnusedGlobalSymbols,JSUnusedLocalSymbols\n /**\n * does special form submit remapping\n * re-maps the issuing command link into something,\n * the \"decode\" of the command link on the server can understand\n *\n * @param formName\n * @param linkId\n * @param target\n * @param params\n */\n export const submitForm = function (formName: string, linkId: string | null = null, target: string |null = null, params: AssocArr<any> | Tuples<string, any> | null = {} ): boolean {\n\n\n //handle a possible incoming null, not sure if this is used that way anywhere, but we allow it\n params = (!params) ? {} : params;\n\n let clearFn = 'clearFormHiddenParams_' + formName.replace(/-/g, '\\$:').replace(/:/g, '_');\n window?.[clearFn]?.(formName);\n\n //autoscroll code\n if (window?.myfaces?.core?.config?.autoScroll && (window as any)?.getScrolling) {\n myfaces.oam.setHiddenInput(formName, 'autoScroll', (window as any)?.getScrolling());\n }\n let paramsStream: Stream<[string, any]> = Array.isArray(params) ? Stream.of(...params) : Stream.ofAssoc(params);\n paramsStream.each(([key, data]) => myfaces.oam.setHiddenInput(formName, key, data));\n\n //we call the namespaced function, to allow decoration, via a direct call we would\n myfaces.oam.setHiddenInput(formName, `${formName}:_idcl`, linkId ?? '');\n\n\n DQ.byId(document.forms?.[formName] ?? document.getElementById(formName)).each(form => {\n const ATTR_TARGET = \"target\";\n const formElement = form.getAsElem(0).value as HTMLFormElement;\n const oldTarget = (form.getAsElem(0).value as HTMLFormElement).getAttribute(\"target\");\n\n if(target != \"null\" && target) {\n (form.getAsElem(0).value as HTMLFormElement).setAttribute(\"target\", target);\n }\n\n\n\n const result = formElement?.onsubmit?.(null);\n\n try {\n if ((!!result) || 'undefined' == typeof result) {\n formElement.submit();\n }\n } catch (e) {\n window?.console.error(e);\n } finally {\n if(oldTarget == null || oldTarget == \"null\") {\n (form.getAsElem(0).value as HTMLFormElement).removeAttribute(\"target\");\n } else {\n (form.getAsElem(0).value as HTMLFormElement).setAttribute(\"target\", oldTarget);\n }\n\n // noinspection JSUnusedLocalSymbols\n paramsStream.each(([key, data]) => {\n myfaces.oam.clearHiddenInput(formName, key);\n });\n myfaces.oam.clearHiddenInput(formName, `${formName}:_idcl`);\n }\n\n });\n return false;\n };\n}","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","/*! Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\"use strict\";\n\n/**\n * faces.js init layer which provides as per spec the proper\n * window namespace if it does not exist already\n *\n * The idea is that we use a small shim on top of\n * the implementation to provide the window namespace.\n * The implementation itself is in a protected namespace\n * which will be bound by the build system\n *\n * The documentation nevertheless targets the _api file, which\n * hosts the full api\n */\nif(!window.faces) {\n //we lazily load the code to prevent ram bloat\n const faces = require(\"./_api\").faces;\n window['faces'] = window?.faces ?? faces;\n}\nif(!window?.myfaces?.ab) {\n const myfaces = require(\"./_api\").myfaces;\n\n //namespace might be extended is not exclusively reserved so we merge\n (window as any)[\"myfaces\"] = window?.myfaces ?? {};\n Object.keys(myfaces).forEach(key => window.myfaces[key] = window.myfaces?.[key] ?? myfaces[key]);\n}\nexport var faces = window.faces;\nexport var myfaces = window.myfaces;\n"],"names":[],"sourceRoot":""}
|