@pega/constellationjs 24.2.2 → 25.1.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.
Files changed (39) hide show
  1. package/README.md +2 -1
  2. package/dist/bootstrap-shell.js +1 -1
  3. package/dist/bootstrap-shell.js.br +0 -0
  4. package/dist/bootstrap-shell.js.gz +0 -0
  5. package/dist/constellation-core-react-native.js +1 -1
  6. package/dist/constellation-core-react-native.js.br +0 -0
  7. package/dist/constellation-core-react-native.js.gz +0 -0
  8. package/dist/constellation-core-react-native.js.map +1 -1
  9. package/dist/constellation-core-web.js +1 -1
  10. package/dist/constellation-core-web.js.br +0 -0
  11. package/dist/constellation-core-web.js.gz +0 -0
  12. package/dist/constellation-core-web.js.map +1 -1
  13. package/dist/constellation-core.63d87cdb.js +2 -0
  14. package/dist/constellation-core.63d87cdb.js.br +0 -0
  15. package/dist/constellation-core.63d87cdb.js.gz +0 -0
  16. package/dist/constellation-core.63d87cdb.js.map +1 -0
  17. package/dist/constellation-core.json +1 -1
  18. package/dist/js/libphonenumber-web.js +2 -0
  19. package/dist/js/libphonenumber-web.js.br +0 -0
  20. package/dist/js/libphonenumber-web.js.gz +0 -0
  21. package/dist/js/libphonenumber-web.js.map +1 -0
  22. package/dist/js/libphonenumber.fd9c5e16.js +2 -0
  23. package/dist/js/libphonenumber.fd9c5e16.js.br +0 -0
  24. package/dist/js/libphonenumber.fd9c5e16.js.gz +0 -0
  25. package/dist/js/libphonenumber.fd9c5e16.js.map +1 -0
  26. package/dist/lib_asset.json +1 -1
  27. package/package.json +1 -1
  28. package/dist/constellation-core.b630c3e1.js +0 -2
  29. package/dist/constellation-core.b630c3e1.js.br +0 -0
  30. package/dist/constellation-core.b630c3e1.js.gz +0 -0
  31. package/dist/constellation-core.b630c3e1.js.map +0 -1
  32. package/dist/js/531-web.js +0 -2
  33. package/dist/js/531-web.js.br +0 -0
  34. package/dist/js/531-web.js.gz +0 -0
  35. package/dist/js/531-web.js.map +0 -1
  36. package/dist/js/531.393debc0.js +0 -2
  37. package/dist/js/531.393debc0.js.br +0 -0
  38. package/dist/js/531.393debc0.js.gz +0 -0
  39. package/dist/js/531.393debc0.js.map +0 -1
@@ -1,2 +1,2 @@
1
- (()=>{var e,t,n={851:(e,t,n)=>{"use strict";var r=n(681);Object.defineProperty(t,"reduxBatch",{enumerable:!0,get:function(){return r.reduxBatch}})},681:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reduxBatch=function(e){var t=[],n=void 0;function r(){t===n&&(t=t.slice())}function s(e){if("function"!=typeof e)throw new Error("Invalid listener, expected a function");var n=!0;return r(),t.push(e),function(){n&&(r(),t.splice(t.indexOf(e),1),n=!1)}}function a(){for(var e=t,r=0;r<e.length;++r)n=e,e[r]()}return function(){var t=e.apply(void 0,arguments),n=!1,r=!1;function o(e){return Array.isArray(e)?e.map((function(e){return o(e)})):t.dispatch(e)}return t.subscribe((function(){r?n=!0:a()})),Object.assign({},t,{dispatch:function(e){var t=r;t||(n=!1,r=!0);var s=o(e),i=n&&!t;return t||(n=!1,r=!1),i&&a(),s},subscribe:s})}}},52:(e,t,n)=>{e.exports=n(851)},631:(e,t,n)=>{var r="__lodash_hash_undefined__",s=9007199254740991,a="[object Arguments]",o="[object Function]",i="[object GeneratorFunction]",c=/^\[object .+?Constructor\]$/,l="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,u="object"==typeof self&&self&&self.Object===Object&&self,d=l||u||Function("return this")();function p(e,t){return!!(e?e.length:0)&&function(e,t,n){if(t!=t)return function(e,t,n,r){var s=e.length,a=n+(r?1:-1);for(;r?a--:++a<s;)if(t(e[a],a,e))return a;return-1}(e,f,n);var r=n-1,s=e.length;for(;++r<s;)if(e[r]===t)return r;return-1}(e,t,0)>-1}function h(e,t,n){for(var r=-1,s=e?e.length:0;++r<s;)if(n(t,e[r]))return!0;return!1}function g(e,t){for(var n=-1,r=t.length,s=e.length;++n<r;)e[s+n]=t[n];return e}function f(e){return e!=e}function m(e,t){return e.has(t)}var y,I=Array.prototype,E=Function.prototype,A=Object.prototype,_=d["__core-js_shared__"],C=(y=/[^.]+$/.exec(_&&_.keys&&_.keys.IE_PROTO||""))?"Symbol(src)_1."+y:"",S=E.toString,T=A.hasOwnProperty,N=A.toString,P=RegExp("^"+S.call(T).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),R=d.Symbol,D=A.propertyIsEnumerable,b=I.splice,O=R?R.isConcatSpreadable:void 0,v=Math.max,x=G(d,"Map"),w=G(Object,"create");function M(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function L(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function U(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function F(e){var t=-1,n=e?e.length:0;for(this.__data__=new U;++t<n;)this.add(e[t])}function j(e,t){for(var n,r,s=e.length;s--;)if((n=e[s][0])===(r=t)||n!=n&&r!=r)return s;return-1}function V(e,t,n,r){var s,a=-1,o=p,i=!0,c=e.length,l=[],u=t.length;if(!c)return l;n&&(t=function(e,t){for(var n=-1,r=e?e.length:0,s=Array(r);++n<r;)s[n]=t(e[n],n,e);return s}(t,(s=n,function(e){return s(e)}))),r?(o=h,i=!1):t.length>=200&&(o=m,i=!1,t=new F(t));e:for(;++a<c;){var d=e[a],g=n?n(d):d;if(d=r||0!==d?d:0,i&&g==g){for(var f=u;f--;)if(t[f]===g)continue e;l.push(d)}else o(t,g,r)||l.push(d)}return l}function k(e,t,n,r,s){var a=-1,o=e.length;for(n||(n=W),s||(s=[]);++a<o;){var i=e[a];t>0&&n(i)?t>1?k(i,t-1,n,r,s):g(s,i):r||(s[s.length]=i)}return s}function $(e){if(!Q(e)||(t=e,C&&C in t))return!1;var t,n=J(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?P:c;return n.test(function(e){if(null!=e){try{return S.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function B(e,t){var n,r,s=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?s["string"==typeof t?"string":"hash"]:s.map}function G(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return $(n)?n:void 0}function W(e){return Y(e)||function(e){return X(e)&&T.call(e,"callee")&&(!D.call(e,"callee")||N.call(e)==a)}(e)||!!(O&&e&&e[O])}M.prototype.clear=function(){this.__data__=w?w(null):{}},M.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},M.prototype.get=function(e){var t=this.__data__;if(w){var n=t[e];return n===r?void 0:n}return T.call(t,e)?t[e]:void 0},M.prototype.has=function(e){var t=this.__data__;return w?void 0!==t[e]:T.call(t,e)},M.prototype.set=function(e,t){return this.__data__[e]=w&&void 0===t?r:t,this},L.prototype.clear=function(){this.__data__=[]},L.prototype.delete=function(e){var t=this.__data__,n=j(t,e);return!(n<0)&&(n==t.length-1?t.pop():b.call(t,n,1),!0)},L.prototype.get=function(e){var t=this.__data__,n=j(t,e);return n<0?void 0:t[n][1]},L.prototype.has=function(e){return j(this.__data__,e)>-1},L.prototype.set=function(e,t){var n=this.__data__,r=j(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},U.prototype.clear=function(){this.__data__={hash:new M,map:new(x||L),string:new M}},U.prototype.delete=function(e){return B(this,e).delete(e)},U.prototype.get=function(e){return B(this,e).get(e)},U.prototype.has=function(e){return B(this,e).has(e)},U.prototype.set=function(e,t){return B(this,e).set(e,t),this},F.prototype.add=F.prototype.push=function(e){return this.__data__.set(e,r),this},F.prototype.has=function(e){return this.__data__.has(e)};var H,q,z=(H=function(e,t){return X(e)?V(e,k(t,1,X,!0)):[]},q=v(void 0===q?H.length-1:q,0),function(){for(var e=arguments,t=-1,n=v(e.length-q,0),r=Array(n);++t<n;)r[t]=e[q+t];t=-1;for(var s=Array(q+1);++t<q;)s[t]=e[t];return s[q]=r,function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}(H,this,s)});var Y=Array.isArray;function K(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=s}(e.length)&&!J(e)}function X(e){return function(e){return!!e&&"object"==typeof e}(e)&&K(e)}function J(e){var t=Q(e)?N.call(e):"";return t==o||t==i}function Q(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=z},188:(e,t,n)=>{var r="__lodash_hash_undefined__",s=1/0,a="[object Function]",o="[object GeneratorFunction]",i="[object Symbol]",c=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,l=/^\w*$/,u=/^\./,d=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,p=/\\(\\)?/g,h=/^\[object .+?Constructor\]$/,g="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,f="object"==typeof self&&self&&self.Object===Object&&self,m=g||f||Function("return this")();var y,I=Array.prototype,E=Function.prototype,A=Object.prototype,_=m["__core-js_shared__"],C=(y=/[^.]+$/.exec(_&&_.keys&&_.keys.IE_PROTO||""))?"Symbol(src)_1."+y:"",S=E.toString,T=A.hasOwnProperty,N=A.toString,P=RegExp("^"+S.call(T).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),R=m.Symbol,D=I.splice,b=k(m,"Map"),O=k(Object,"create"),v=R?R.prototype:void 0,x=v?v.toString:void 0;function w(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function M(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function L(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function U(e,t){for(var n,r,s=e.length;s--;)if((n=e[s][0])===(r=t)||n!=n&&r!=r)return s;return-1}function F(e,t){var n;t=function(e,t){if(W(e))return!1;var n=typeof e;if("number"==n||"symbol"==n||"boolean"==n||null==e||q(e))return!0;return l.test(e)||!c.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:W(n=t)?n:$(n);for(var r=0,s=t.length;null!=e&&r<s;)e=e[B(t[r++])];return r&&r==s?e:void 0}function j(e){if(!H(e)||(t=e,C&&C in t))return!1;var t,n=function(e){var t=H(e)?N.call(e):"";return t==a||t==o}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?P:h;return n.test(function(e){if(null!=e){try{return S.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function V(e,t){var n,r,s=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?s["string"==typeof t?"string":"hash"]:s.map}function k(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return j(n)?n:void 0}w.prototype.clear=function(){this.__data__=O?O(null):{}},w.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},w.prototype.get=function(e){var t=this.__data__;if(O){var n=t[e];return n===r?void 0:n}return T.call(t,e)?t[e]:void 0},w.prototype.has=function(e){var t=this.__data__;return O?void 0!==t[e]:T.call(t,e)},w.prototype.set=function(e,t){return this.__data__[e]=O&&void 0===t?r:t,this},M.prototype.clear=function(){this.__data__=[]},M.prototype.delete=function(e){var t=this.__data__,n=U(t,e);return!(n<0)&&(n==t.length-1?t.pop():D.call(t,n,1),!0)},M.prototype.get=function(e){var t=this.__data__,n=U(t,e);return n<0?void 0:t[n][1]},M.prototype.has=function(e){return U(this.__data__,e)>-1},M.prototype.set=function(e,t){var n=this.__data__,r=U(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},L.prototype.clear=function(){this.__data__={hash:new w,map:new(b||M),string:new w}},L.prototype.delete=function(e){return V(this,e).delete(e)},L.prototype.get=function(e){return V(this,e).get(e)},L.prototype.has=function(e){return V(this,e).has(e)},L.prototype.set=function(e,t){return V(this,e).set(e,t),this};var $=G((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(q(e))return x?x.call(e):"";var t=e+"";return"0"==t&&1/e==-s?"-0":t}(t);var n=[];return u.test(e)&&n.push(""),e.replace(d,(function(e,t,r,s){n.push(r?s.replace(p,"$1"):t||e)})),n}));function B(e){if("string"==typeof e||q(e))return e;var t=e+"";return"0"==t&&1/e==-s?"-0":t}function G(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,s=t?t.apply(this,r):r[0],a=n.cache;if(a.has(s))return a.get(s);var o=e.apply(this,r);return n.cache=a.set(s,o),o};return n.cache=new(G.Cache||L),n}G.Cache=L;var W=Array.isArray;function H(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function q(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&N.call(e)==i}e.exports=function(e,t,n){var r=null==e?void 0:F(e,t);return void 0===r?n:r}},928:(e,t,n)=>{var r="__lodash_hash_undefined__",s=1/0,a=9007199254740991,o="[object Arguments]",i="[object Function]",c="[object GeneratorFunction]",l="[object Symbol]",u=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,d=/^\w*$/,p=/^\./,h=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,g=/\\(\\)?/g,f=/^\[object .+?Constructor\]$/,m=/^(?:0|[1-9]\d*)$/,y="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,I="object"==typeof self&&self&&self.Object===Object&&self,E=y||I||Function("return this")();var A,_=Array.prototype,C=Function.prototype,S=Object.prototype,T=E["__core-js_shared__"],N=(A=/[^.]+$/.exec(T&&T.keys&&T.keys.IE_PROTO||""))?"Symbol(src)_1."+A:"",P=C.toString,R=S.hasOwnProperty,D=S.toString,b=RegExp("^"+P.call(R).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),O=E.Symbol,v=S.propertyIsEnumerable,x=_.splice,w=W(E,"Map"),M=W(Object,"create"),L=O?O.prototype:void 0,U=L?L.toString:void 0;function F(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function j(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function V(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function k(e,t){for(var n,r,s=e.length;s--;)if((n=e[s][0])===(r=t)||n!=n&&r!=r)return s;return-1}function $(e,t){return null!=e&&R.call(e,t)}function B(e){if(!Q(e)||(t=e,N&&N in t))return!1;var t,n=X(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?b:f;return n.test(function(e){if(null!=e){try{return P.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function G(e,t){var n,r,s=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?s["string"==typeof t?"string":"hash"]:s.map}function W(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return B(n)?n:void 0}function H(e,t,n){var r;t=function(e,t){if(K(e))return!1;var n=typeof e;if("number"==n||"symbol"==n||"boolean"==n||null==e||ee(e))return!0;return d.test(e)||!u.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:K(r=t)?r:q(r);for(var s,i=-1,c=t.length;++i<c;){var l=z(t[i]);if(!(s=null!=e&&n(e,l)))break;e=e[l]}return s||!!(c=e?e.length:0)&&J(c)&&function(e,t){return t=null==t?a:t,!!t&&("number"==typeof e||m.test(e))&&e>-1&&e%1==0&&e<t}(l,c)&&(K(e)||function(e){return function(e){return Z(e)&&function(e){return null!=e&&J(e.length)&&!X(e)}(e)}(e)&&R.call(e,"callee")&&(!v.call(e,"callee")||D.call(e)==o)}(e))}F.prototype.clear=function(){this.__data__=M?M(null):{}},F.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},F.prototype.get=function(e){var t=this.__data__;if(M){var n=t[e];return n===r?void 0:n}return R.call(t,e)?t[e]:void 0},F.prototype.has=function(e){var t=this.__data__;return M?void 0!==t[e]:R.call(t,e)},F.prototype.set=function(e,t){return this.__data__[e]=M&&void 0===t?r:t,this},j.prototype.clear=function(){this.__data__=[]},j.prototype.delete=function(e){var t=this.__data__,n=k(t,e);return!(n<0)&&(n==t.length-1?t.pop():x.call(t,n,1),!0)},j.prototype.get=function(e){var t=this.__data__,n=k(t,e);return n<0?void 0:t[n][1]},j.prototype.has=function(e){return k(this.__data__,e)>-1},j.prototype.set=function(e,t){var n=this.__data__,r=k(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},V.prototype.clear=function(){this.__data__={hash:new F,map:new(w||j),string:new F}},V.prototype.delete=function(e){return G(this,e).delete(e)},V.prototype.get=function(e){return G(this,e).get(e)},V.prototype.has=function(e){return G(this,e).has(e)},V.prototype.set=function(e,t){return G(this,e).set(e,t),this};var q=Y((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(ee(e))return U?U.call(e):"";var t=e+"";return"0"==t&&1/e==-s?"-0":t}(t);var n=[];return p.test(e)&&n.push(""),e.replace(h,(function(e,t,r,s){n.push(r?s.replace(g,"$1"):t||e)})),n}));function z(e){if("string"==typeof e||ee(e))return e;var t=e+"";return"0"==t&&1/e==-s?"-0":t}function Y(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,s=t?t.apply(this,r):r[0],a=n.cache;if(a.has(s))return a.get(s);var o=e.apply(this,r);return n.cache=a.set(s,o),o};return n.cache=new(Y.Cache||V),n}Y.Cache=V;var K=Array.isArray;function X(e){var t=Q(e)?D.call(e):"";return t==i||t==c}function J(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=a}function Q(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Z(e){return!!e&&"object"==typeof e}function ee(e){return"symbol"==typeof e||Z(e)&&D.call(e)==l}e.exports=function(e,t){return null!=e&&H(e,t,$)}},529:(e,t,n)=>{e=n.nmd(e);var r=9007199254740991,s="[object Arguments]",a="[object Function]",o="[object GeneratorFunction]",i="[object Map]",c="[object Promise]",l="[object Set]",u="[object WeakMap]",d="[object DataView]",p=/^\[object .+?Constructor\]$/,h="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,g="object"==typeof self&&self&&self.Object===Object&&self,f=h||g||Function("return this")(),m=t&&!t.nodeType&&t,y=m&&e&&!e.nodeType&&e,I=y&&y.exports===m;var E,A,_,C=Function.prototype,S=Object.prototype,T=f["__core-js_shared__"],N=(E=/[^.]+$/.exec(T&&T.keys&&T.keys.IE_PROTO||""))?"Symbol(src)_1."+E:"",P=C.toString,R=S.hasOwnProperty,D=S.toString,b=RegExp("^"+P.call(R).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),O=I?f.Buffer:void 0,v=S.propertyIsEnumerable,x=O?O.isBuffer:void 0,w=(A=Object.keys,_=Object,function(e){return A(_(e))}),M=q(f,"DataView"),L=q(f,"Map"),U=q(f,"Promise"),F=q(f,"Set"),j=q(f,"WeakMap"),V=!v.call({valueOf:1},"valueOf"),k=Y(M),$=Y(L),B=Y(U),G=Y(F),W=Y(j);function H(e){if(!ee(e)||function(e){return!!N&&N in e}(e))return!1;var t=Z(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?b:p;return t.test(Y(e))}function q(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return H(n)?n:void 0}var z=function(e){return D.call(e)};function Y(e){if(null!=e){try{return P.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function K(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&J(e)}(e)&&R.call(e,"callee")&&(!v.call(e,"callee")||D.call(e)==s)}(M&&z(new M(new ArrayBuffer(1)))!=d||L&&z(new L)!=i||U&&z(U.resolve())!=c||F&&z(new F)!=l||j&&z(new j)!=u)&&(z=function(e){var t=D.call(e),n="[object Object]"==t?e.constructor:void 0,r=n?Y(n):void 0;if(r)switch(r){case k:return d;case $:return i;case B:return c;case G:return l;case W:return u}return t});var X=Array.isArray;function J(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}(e.length)&&!Z(e)}var Q=x||function(){return!1};function Z(e){var t=ee(e)?D.call(e):"";return t==a||t==o}function ee(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=function(e){if(J(e)&&(X(e)||"string"==typeof e||"function"==typeof e.splice||Q(e)||K(e)))return!e.length;var t=z(e);if(t==i||t==l)return!e.size;if(V||function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||S)}(e))return!w(e).length;for(var n in e)if(R.call(e,n))return!1;return!0}},216:(e,t,n)=>{e=n.nmd(e);var r="__lodash_hash_undefined__",s=1,a=2,o=9007199254740991,i="[object Arguments]",c="[object Array]",l="[object AsyncFunction]",u="[object Boolean]",d="[object Date]",p="[object Error]",h="[object Function]",g="[object GeneratorFunction]",f="[object Map]",m="[object Number]",y="[object Null]",I="[object Object]",E="[object Promise]",A="[object Proxy]",_="[object RegExp]",C="[object Set]",S="[object String]",T="[object Symbol]",N="[object Undefined]",P="[object WeakMap]",R="[object ArrayBuffer]",D="[object DataView]",b=/^\[object .+?Constructor\]$/,O=/^(?:0|[1-9]\d*)$/,v={};v["[object Float32Array]"]=v["[object Float64Array]"]=v["[object Int8Array]"]=v["[object Int16Array]"]=v["[object Int32Array]"]=v["[object Uint8Array]"]=v["[object Uint8ClampedArray]"]=v["[object Uint16Array]"]=v["[object Uint32Array]"]=!0,v[i]=v[c]=v[R]=v[u]=v[D]=v[d]=v[p]=v[h]=v[f]=v[m]=v[I]=v[_]=v[C]=v[S]=v[P]=!1;var x="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,w="object"==typeof self&&self&&self.Object===Object&&self,M=x||w||Function("return this")(),L=t&&!t.nodeType&&t,U=L&&e&&!e.nodeType&&e,F=U&&U.exports===L,j=F&&x.process,V=function(){try{return j&&j.binding&&j.binding("util")}catch(e){}}(),k=V&&V.isTypedArray;function $(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function B(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function G(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var W,H,q,z=Array.prototype,Y=Function.prototype,K=Object.prototype,X=M["__core-js_shared__"],J=Y.toString,Q=K.hasOwnProperty,Z=(W=/[^.]+$/.exec(X&&X.keys&&X.keys.IE_PROTO||""))?"Symbol(src)_1."+W:"",ee=K.toString,te=RegExp("^"+J.call(Q).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ne=F?M.Buffer:void 0,re=M.Symbol,se=M.Uint8Array,ae=K.propertyIsEnumerable,oe=z.splice,ie=re?re.toStringTag:void 0,ce=Object.getOwnPropertySymbols,le=ne?ne.isBuffer:void 0,ue=(H=Object.keys,q=Object,function(e){return H(q(e))}),de=Ve(M,"DataView"),pe=Ve(M,"Map"),he=Ve(M,"Promise"),ge=Ve(M,"Set"),fe=Ve(M,"WeakMap"),me=Ve(Object,"create"),ye=Ge(de),Ie=Ge(pe),Ee=Ge(he),Ae=Ge(ge),_e=Ge(fe),Ce=re?re.prototype:void 0,Se=Ce?Ce.valueOf:void 0;function Te(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ne(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Pe(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Re(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Pe;++t<n;)this.add(e[t])}function De(e){var t=this.__data__=new Ne(e);this.size=t.size}function be(e,t){var n=qe(e),r=!n&&He(e),s=!n&&!r&&ze(e),a=!n&&!r&&!s&&Qe(e),o=n||r||s||a,i=o?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],c=i.length;for(var l in e)!t&&!Q.call(e,l)||o&&("length"==l||s&&("offset"==l||"parent"==l)||a&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Be(l,c))||i.push(l);return i}function Oe(e,t){for(var n=e.length;n--;)if(We(e[n][0],t))return n;return-1}function ve(e){return null==e?void 0===e?N:y:ie&&ie in Object(e)?function(e){var t=Q.call(e,ie),n=e[ie];try{e[ie]=void 0;var r=!0}catch(e){}var s=ee.call(e);r&&(t?e[ie]=n:delete e[ie]);return s}(e):function(e){return ee.call(e)}(e)}function xe(e){return Je(e)&&ve(e)==i}function we(e,t,n,r,o){return e===t||(null==e||null==t||!Je(e)&&!Je(t)?e!=e&&t!=t:function(e,t,n,r,o,l){var h=qe(e),g=qe(t),y=h?c:$e(e),E=g?c:$e(t),A=(y=y==i?I:y)==I,N=(E=E==i?I:E)==I,P=y==E;if(P&&ze(e)){if(!ze(t))return!1;h=!0,A=!1}if(P&&!A)return l||(l=new De),h||Qe(e)?Ue(e,t,n,r,o,l):function(e,t,n,r,o,i,c){switch(n){case D:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case R:return!(e.byteLength!=t.byteLength||!i(new se(e),new se(t)));case u:case d:case m:return We(+e,+t);case p:return e.name==t.name&&e.message==t.message;case _:case S:return e==t+"";case f:var l=B;case C:var h=r&s;if(l||(l=G),e.size!=t.size&&!h)return!1;var g=c.get(e);if(g)return g==t;r|=a,c.set(e,t);var y=Ue(l(e),l(t),r,o,i,c);return c.delete(e),y;case T:if(Se)return Se.call(e)==Se.call(t)}return!1}(e,t,y,n,r,o,l);if(!(n&s)){var b=A&&Q.call(e,"__wrapped__"),O=N&&Q.call(t,"__wrapped__");if(b||O){var v=b?e.value():e,x=O?t.value():t;return l||(l=new De),o(v,x,n,r,l)}}if(!P)return!1;return l||(l=new De),function(e,t,n,r,a,o){var i=n&s,c=Fe(e),l=c.length,u=Fe(t),d=u.length;if(l!=d&&!i)return!1;var p=l;for(;p--;){var h=c[p];if(!(i?h in t:Q.call(t,h)))return!1}var g=o.get(e);if(g&&o.get(t))return g==t;var f=!0;o.set(e,t),o.set(t,e);var m=i;for(;++p<l;){var y=e[h=c[p]],I=t[h];if(r)var E=i?r(I,y,h,t,e,o):r(y,I,h,e,t,o);if(!(void 0===E?y===I||a(y,I,n,r,o):E)){f=!1;break}m||(m="constructor"==h)}if(f&&!m){var A=e.constructor,_=t.constructor;A==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof A&&A instanceof A&&"function"==typeof _&&_ instanceof _||(f=!1)}return o.delete(e),o.delete(t),f}(e,t,n,r,o,l)}(e,t,n,r,we,o))}function Me(e){return!(!Xe(e)||function(e){return!!Z&&Z in e}(e))&&(Ye(e)?te:b).test(Ge(e))}function Le(e){if(n=(t=e)&&t.constructor,r="function"==typeof n&&n.prototype||K,t!==r)return ue(e);var t,n,r,s=[];for(var a in Object(e))Q.call(e,a)&&"constructor"!=a&&s.push(a);return s}function Ue(e,t,n,r,o,i){var c=n&s,l=e.length,u=t.length;if(l!=u&&!(c&&u>l))return!1;var d=i.get(e);if(d&&i.get(t))return d==t;var p=-1,h=!0,g=n&a?new Re:void 0;for(i.set(e,t),i.set(t,e);++p<l;){var f=e[p],m=t[p];if(r)var y=c?r(m,f,p,t,e,i):r(f,m,p,e,t,i);if(void 0!==y){if(y)continue;h=!1;break}if(g){if(!$(t,(function(e,t){if(s=t,!g.has(s)&&(f===e||o(f,e,n,r,i)))return g.push(t);var s}))){h=!1;break}}else if(f!==m&&!o(f,m,n,r,i)){h=!1;break}}return i.delete(e),i.delete(t),h}function Fe(e){return function(e,t,n){var r=t(e);return qe(e)?r:function(e,t){for(var n=-1,r=t.length,s=e.length;++n<r;)e[s+n]=t[n];return e}(r,n(e))}(e,Ze,ke)}function je(e,t){var n,r,s=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?s["string"==typeof t?"string":"hash"]:s.map}function Ve(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Me(n)?n:void 0}Te.prototype.clear=function(){this.__data__=me?me(null):{},this.size=0},Te.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Te.prototype.get=function(e){var t=this.__data__;if(me){var n=t[e];return n===r?void 0:n}return Q.call(t,e)?t[e]:void 0},Te.prototype.has=function(e){var t=this.__data__;return me?void 0!==t[e]:Q.call(t,e)},Te.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=me&&void 0===t?r:t,this},Ne.prototype.clear=function(){this.__data__=[],this.size=0},Ne.prototype.delete=function(e){var t=this.__data__,n=Oe(t,e);return!(n<0)&&(n==t.length-1?t.pop():oe.call(t,n,1),--this.size,!0)},Ne.prototype.get=function(e){var t=this.__data__,n=Oe(t,e);return n<0?void 0:t[n][1]},Ne.prototype.has=function(e){return Oe(this.__data__,e)>-1},Ne.prototype.set=function(e,t){var n=this.__data__,r=Oe(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Pe.prototype.clear=function(){this.size=0,this.__data__={hash:new Te,map:new(pe||Ne),string:new Te}},Pe.prototype.delete=function(e){var t=je(this,e).delete(e);return this.size-=t?1:0,t},Pe.prototype.get=function(e){return je(this,e).get(e)},Pe.prototype.has=function(e){return je(this,e).has(e)},Pe.prototype.set=function(e,t){var n=je(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Re.prototype.add=Re.prototype.push=function(e){return this.__data__.set(e,r),this},Re.prototype.has=function(e){return this.__data__.has(e)},De.prototype.clear=function(){this.__data__=new Ne,this.size=0},De.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},De.prototype.get=function(e){return this.__data__.get(e)},De.prototype.has=function(e){return this.__data__.has(e)},De.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Ne){var r=n.__data__;if(!pe||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Pe(r)}return n.set(e,t),this.size=n.size,this};var ke=ce?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,s=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[s++]=o)}return a}(ce(e),(function(t){return ae.call(e,t)})))}:function(){return[]},$e=ve;function Be(e,t){return!!(t=null==t?o:t)&&("number"==typeof e||O.test(e))&&e>-1&&e%1==0&&e<t}function Ge(e){if(null!=e){try{return J.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function We(e,t){return e===t||e!=e&&t!=t}(de&&$e(new de(new ArrayBuffer(1)))!=D||pe&&$e(new pe)!=f||he&&$e(he.resolve())!=E||ge&&$e(new ge)!=C||fe&&$e(new fe)!=P)&&($e=function(e){var t=ve(e),n=t==I?e.constructor:void 0,r=n?Ge(n):"";if(r)switch(r){case ye:return D;case Ie:return f;case Ee:return E;case Ae:return C;case _e:return P}return t});var He=xe(function(){return arguments}())?xe:function(e){return Je(e)&&Q.call(e,"callee")&&!ae.call(e,"callee")},qe=Array.isArray;var ze=le||function(){return!1};function Ye(e){if(!Xe(e))return!1;var t=ve(e);return t==h||t==g||t==l||t==A}function Ke(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}function Xe(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Je(e){return null!=e&&"object"==typeof e}var Qe=k?function(e){return function(t){return e(t)}}(k):function(e){return Je(e)&&Ke(e.length)&&!!v[ve(e)]};function Ze(e){return null!=(t=e)&&Ke(t.length)&&!Ye(t)?be(e):Le(e);var t}e.exports=function(e,t){return we(e,t)}},692:(e,t,n)=>{e=n.nmd(e);var r="__lodash_hash_undefined__",s=9007199254740991,a="[object Arguments]",o="[object AsyncFunction]",i="[object Function]",c="[object GeneratorFunction]",l="[object Null]",u="[object Object]",d="[object Proxy]",p="[object Undefined]",h=/^\[object .+?Constructor\]$/,g=/^(?:0|[1-9]\d*)$/,f={};f["[object Float32Array]"]=f["[object Float64Array]"]=f["[object Int8Array]"]=f["[object Int16Array]"]=f["[object Int32Array]"]=f["[object Uint8Array]"]=f["[object Uint8ClampedArray]"]=f["[object Uint16Array]"]=f["[object Uint32Array]"]=!0,f[a]=f["[object Array]"]=f["[object ArrayBuffer]"]=f["[object Boolean]"]=f["[object DataView]"]=f["[object Date]"]=f["[object Error]"]=f[i]=f["[object Map]"]=f["[object Number]"]=f[u]=f["[object RegExp]"]=f["[object Set]"]=f["[object String]"]=f["[object WeakMap]"]=!1;var m="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,y="object"==typeof self&&self&&self.Object===Object&&self,I=m||y||Function("return this")(),E=t&&!t.nodeType&&t,A=E&&e&&!e.nodeType&&e,_=A&&A.exports===E,C=_&&m.process,S=function(){try{var e=A&&A.require&&A.require("util").types;return e||C&&C.binding&&C.binding("util")}catch(e){}}(),T=S&&S.isTypedArray;var N,P,R,D=Array.prototype,b=Function.prototype,O=Object.prototype,v=I["__core-js_shared__"],x=b.toString,w=O.hasOwnProperty,M=(N=/[^.]+$/.exec(v&&v.keys&&v.keys.IE_PROTO||""))?"Symbol(src)_1."+N:"",L=O.toString,U=x.call(Object),F=RegExp("^"+x.call(w).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),j=_?I.Buffer:void 0,V=I.Symbol,k=I.Uint8Array,$=j?j.allocUnsafe:void 0,B=(P=Object.getPrototypeOf,R=Object,function(e){return P(R(e))}),G=Object.create,W=O.propertyIsEnumerable,H=D.splice,q=V?V.toStringTag:void 0,z=function(){try{var e=Ee(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),Y=j?j.isBuffer:void 0,K=Math.max,X=Date.now,J=Ee(I,"Map"),Q=Ee(Object,"create"),Z=function(){function e(){}return function(t){if(!ve(t))return{};if(G)return G(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function ee(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function te(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ne(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function re(e){var t=this.__data__=new te(e);this.size=t.size}function se(e,t){var n=Pe(e),r=!n&&Ne(e),s=!n&&!r&&De(e),a=!n&&!r&&!s&&we(e),o=n||r||s||a,i=o?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],c=i.length;for(var l in e)!t&&!w.call(e,l)||o&&("length"==l||s&&("offset"==l||"parent"==l)||a&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Ae(l,c))||i.push(l);return i}function ae(e,t,n){(void 0!==n&&!Te(e[t],n)||void 0===n&&!(t in e))&&ce(e,t,n)}function oe(e,t,n){var r=e[t];w.call(e,t)&&Te(r,n)&&(void 0!==n||t in e)||ce(e,t,n)}function ie(e,t){for(var n=e.length;n--;)if(Te(e[n][0],t))return n;return-1}function ce(e,t,n){"__proto__"==t&&z?z(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}ee.prototype.clear=function(){this.__data__=Q?Q(null):{},this.size=0},ee.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ee.prototype.get=function(e){var t=this.__data__;if(Q){var n=t[e];return n===r?void 0:n}return w.call(t,e)?t[e]:void 0},ee.prototype.has=function(e){var t=this.__data__;return Q?void 0!==t[e]:w.call(t,e)},ee.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Q&&void 0===t?r:t,this},te.prototype.clear=function(){this.__data__=[],this.size=0},te.prototype.delete=function(e){var t=this.__data__,n=ie(t,e);return!(n<0)&&(n==t.length-1?t.pop():H.call(t,n,1),--this.size,!0)},te.prototype.get=function(e){var t=this.__data__,n=ie(t,e);return n<0?void 0:t[n][1]},te.prototype.has=function(e){return ie(this.__data__,e)>-1},te.prototype.set=function(e,t){var n=this.__data__,r=ie(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},ne.prototype.clear=function(){this.size=0,this.__data__={hash:new ee,map:new(J||te),string:new ee}},ne.prototype.delete=function(e){var t=Ie(this,e).delete(e);return this.size-=t?1:0,t},ne.prototype.get=function(e){return Ie(this,e).get(e)},ne.prototype.has=function(e){return Ie(this,e).has(e)},ne.prototype.set=function(e,t){var n=Ie(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},re.prototype.clear=function(){this.__data__=new te,this.size=0},re.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},re.prototype.get=function(e){return this.__data__.get(e)},re.prototype.has=function(e){return this.__data__.has(e)},re.prototype.set=function(e,t){var n=this.__data__;if(n instanceof te){var r=n.__data__;if(!J||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ne(r)}return n.set(e,t),this.size=n.size,this};var le,ue=function(e,t,n){for(var r=-1,s=Object(e),a=n(e),o=a.length;o--;){var i=a[le?o:++r];if(!1===t(s[i],i,s))break}return e};function de(e){return null==e?void 0===e?p:l:q&&q in Object(e)?function(e){var t=w.call(e,q),n=e[q];try{e[q]=void 0;var r=!0}catch(e){}var s=L.call(e);r&&(t?e[q]=n:delete e[q]);return s}(e):function(e){return L.call(e)}(e)}function pe(e){return xe(e)&&de(e)==a}function he(e){return!(!ve(e)||function(e){return!!M&&M in e}(e))&&(be(e)?F:h).test(function(e){if(null!=e){try{return x.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function ge(e){if(!ve(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=_e(e),n=[];for(var r in e)("constructor"!=r||!t&&w.call(e,r))&&n.push(r);return n}function fe(e,t,n,r,s){e!==t&&ue(t,(function(a,o){if(s||(s=new re),ve(a))!function(e,t,n,r,s,a,o){var i=Ce(e,n),c=Ce(t,n),l=o.get(c);if(l)return void ae(e,n,l);var d=a?a(i,c,n+"",e,t,o):void 0,p=void 0===d;if(p){var h=Pe(c),g=!h&&De(c),f=!h&&!g&&we(c);d=c,h||g||f?Pe(i)?d=i:xe(A=i)&&Re(A)?d=function(e,t){var n=-1,r=e.length;t||(t=Array(r));for(;++n<r;)t[n]=e[n];return t}(i):g?(p=!1,d=function(e,t){if(t)return e.slice();var n=e.length,r=$?$(n):new e.constructor(n);return e.copy(r),r}(c,!0)):f?(p=!1,m=c,y=!0?(I=m.buffer,E=new I.constructor(I.byteLength),new k(E).set(new k(I)),E):m.buffer,d=new m.constructor(y,m.byteOffset,m.length)):d=[]:function(e){if(!xe(e)||de(e)!=u)return!1;var t=B(e);if(null===t)return!0;var n=w.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&x.call(n)==U}(c)||Ne(c)?(d=i,Ne(i)?d=function(e){return function(e,t,n,r){var s=!n;n||(n={});var a=-1,o=t.length;for(;++a<o;){var i=t[a],c=r?r(n[i],e[i],i,n,e):void 0;void 0===c&&(c=e[i]),s?ce(n,i,c):oe(n,i,c)}return n}(e,Me(e))}(i):ve(i)&&!be(i)||(d=function(e){return"function"!=typeof e.constructor||_e(e)?{}:Z(B(e))}(c))):p=!1}var m,y,I,E;var A;p&&(o.set(c,d),s(d,c,r,a,o),o.delete(c));ae(e,n,d)}(e,t,o,n,fe,r,s);else{var i=r?r(Ce(e,o),a,o+"",e,t,s):void 0;void 0===i&&(i=a),ae(e,o,i)}}),Me)}function me(e,t){return Se(function(e,t,n){return t=K(void 0===t?e.length-1:t,0),function(){for(var r=arguments,s=-1,a=K(r.length-t,0),o=Array(a);++s<a;)o[s]=r[t+s];s=-1;for(var i=Array(t+1);++s<t;)i[s]=r[s];return i[t]=n(o),function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}(e,this,i)}}(e,t,Fe),e+"")}var ye=z?function(e,t){return z(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:Fe;function Ie(e,t){var n,r,s=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?s["string"==typeof t?"string":"hash"]:s.map}function Ee(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return he(n)?n:void 0}function Ae(e,t){var n=typeof e;return!!(t=null==t?s:t)&&("number"==n||"symbol"!=n&&g.test(e))&&e>-1&&e%1==0&&e<t}function _e(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||O)}function Ce(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Se=function(e){var t=0,n=0;return function(){var r=X(),s=16-(r-n);if(n=r,s>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(ye);function Te(e,t){return e===t||e!=e&&t!=t}var Ne=pe(function(){return arguments}())?pe:function(e){return xe(e)&&w.call(e,"callee")&&!W.call(e,"callee")},Pe=Array.isArray;function Re(e){return null!=e&&Oe(e.length)&&!be(e)}var De=Y||function(){return!1};function be(e){if(!ve(e))return!1;var t=de(e);return t==i||t==c||t==o||t==d}function Oe(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=s}function ve(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function xe(e){return null!=e&&"object"==typeof e}var we=T?function(e){return function(t){return e(t)}}(T):function(e){return xe(e)&&Oe(e.length)&&!!f[de(e)]};function Me(e){return Re(e)?se(e,!0):ge(e)}var Le,Ue=(Le=function(e,t,n,r){fe(e,t,n,r)},me((function(e,t){var n=-1,r=t.length,s=r>1?t[r-1]:void 0,a=r>2?t[2]:void 0;for(s=Le.length>3&&"function"==typeof s?(r--,s):void 0,a&&function(e,t,n){if(!ve(n))return!1;var r=typeof t;return!!("number"==r?Re(n)&&Ae(t,n.length):"string"==r&&t in n)&&Te(n[t],e)}(t[0],t[1],a)&&(s=r<3?void 0:s,r=1),e=Object(e);++n<r;){var o=t[n];o&&Le(e,o,n,s)}return e})));function Fe(e){return e}e.exports=Ue},835:(e,t,n)=>{var r="__lodash_hash_undefined__",s=1/0,a=9007199254740991,o="[object Function]",i="[object GeneratorFunction]",c="[object Symbol]",l=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u=/^\w*$/,d=/^\./,p=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,h=/\\(\\)?/g,g=/^\[object .+?Constructor\]$/,f=/^(?:0|[1-9]\d*)$/,m="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,y="object"==typeof self&&self&&self.Object===Object&&self,I=m||y||Function("return this")();var E,A=Array.prototype,_=Function.prototype,C=Object.prototype,S=I["__core-js_shared__"],T=(E=/[^.]+$/.exec(S&&S.keys&&S.keys.IE_PROTO||""))?"Symbol(src)_1."+E:"",N=_.toString,P=C.hasOwnProperty,R=C.toString,D=RegExp("^"+N.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),b=I.Symbol,O=A.splice,v=G(I,"Map"),x=G(Object,"create"),w=b?b.prototype:void 0,M=w?w.toString:void 0;function L(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function U(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function F(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function j(e,t,n){var r=e[t];P.call(e,t)&&Y(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function V(e,t){for(var n=e.length;n--;)if(Y(e[n][0],t))return n;return-1}function k(e){if(!X(e)||(t=e,T&&T in t))return!1;var t,n=function(e){var t=X(e)?R.call(e):"";return t==o||t==i}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?D:g;return n.test(function(e){if(null!=e){try{return N.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function $(e,t,n,r){if(!X(e))return e;t=function(e,t){if(K(e))return!1;var n=typeof e;if("number"==n||"symbol"==n||"boolean"==n||null==e||J(e))return!0;return u.test(e)||!l.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:function(e){return K(e)?e:H(e)}(t);for(var s=-1,a=t.length,o=a-1,i=e;null!=i&&++s<a;){var c=q(t[s]),d=n;if(s!=o){var p=i[c];void 0===(d=r?r(p,c,i):void 0)&&(d=X(p)?p:W(t[s+1])?[]:{})}j(i,c,d),i=i[c]}return e}function B(e,t){var n,r,s=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?s["string"==typeof t?"string":"hash"]:s.map}function G(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return k(n)?n:void 0}function W(e,t){return!!(t=null==t?a:t)&&("number"==typeof e||f.test(e))&&e>-1&&e%1==0&&e<t}L.prototype.clear=function(){this.__data__=x?x(null):{}},L.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},L.prototype.get=function(e){var t=this.__data__;if(x){var n=t[e];return n===r?void 0:n}return P.call(t,e)?t[e]:void 0},L.prototype.has=function(e){var t=this.__data__;return x?void 0!==t[e]:P.call(t,e)},L.prototype.set=function(e,t){return this.__data__[e]=x&&void 0===t?r:t,this},U.prototype.clear=function(){this.__data__=[]},U.prototype.delete=function(e){var t=this.__data__,n=V(t,e);return!(n<0)&&(n==t.length-1?t.pop():O.call(t,n,1),!0)},U.prototype.get=function(e){var t=this.__data__,n=V(t,e);return n<0?void 0:t[n][1]},U.prototype.has=function(e){return V(this.__data__,e)>-1},U.prototype.set=function(e,t){var n=this.__data__,r=V(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},F.prototype.clear=function(){this.__data__={hash:new L,map:new(v||U),string:new L}},F.prototype.delete=function(e){return B(this,e).delete(e)},F.prototype.get=function(e){return B(this,e).get(e)},F.prototype.has=function(e){return B(this,e).has(e)},F.prototype.set=function(e,t){return B(this,e).set(e,t),this};var H=z((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(J(e))return M?M.call(e):"";var t=e+"";return"0"==t&&1/e==-s?"-0":t}(t);var n=[];return d.test(e)&&n.push(""),e.replace(p,(function(e,t,r,s){n.push(r?s.replace(h,"$1"):t||e)})),n}));function q(e){if("string"==typeof e||J(e))return e;var t=e+"";return"0"==t&&1/e==-s?"-0":t}function z(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,s=t?t.apply(this,r):r[0],a=n.cache;if(a.has(s))return a.get(s);var o=e.apply(this,r);return n.cache=a.set(s,o),o};return n.cache=new(z.Cache||F),n}function Y(e,t){return e===t||e!=e&&t!=t}z.Cache=F;var K=Array.isArray;function X(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function J(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&R.call(e)==c}e.exports=function(e,t,n){return null==e?e:$(e,t,n)}},521:(e,t,n)=>{var r="__lodash_hash_undefined__",s=1/0,a="[object Function]",o="[object GeneratorFunction]",i="[object Symbol]",c=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,l=/^\w*$/,u=/^\./,d=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,p=/\\(\\)?/g,h=/^\[object .+?Constructor\]$/,g="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,f="object"==typeof self&&self&&self.Object===Object&&self,m=g||f||Function("return this")();var y,I=Array.prototype,E=Function.prototype,A=Object.prototype,_=m["__core-js_shared__"],C=(y=/[^.]+$/.exec(_&&_.keys&&_.keys.IE_PROTO||""))?"Symbol(src)_1."+y:"",S=E.toString,T=A.hasOwnProperty,N=A.toString,P=RegExp("^"+S.call(T).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),R=m.Symbol,D=I.splice,b=$(m,"Map"),O=$(Object,"create"),v=R?R.prototype:void 0,x=v?v.toString:void 0;function w(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function M(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function L(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function U(e,t){for(var n,r,s=e.length;s--;)if((n=e[s][0])===(r=t)||n!=n&&r!=r)return s;return-1}function F(e){if(!z(e)||(t=e,C&&C in t))return!1;var t,n=function(e){var t=z(e)?N.call(e):"";return t==a||t==o}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?P:h;return n.test(function(e){if(null!=e){try{return S.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function j(e,t){e=function(e,t){return 1==t.length?e:function(e,t){for(var n=0,r=(t=B(t,e)?[t]:V(t)).length;null!=e&&n<r;)e=e[W(t[n++])];return n&&n==r?e:void 0}(e,function(e,t,n){var r=-1,s=e.length;t<0&&(t=-t>s?0:s+t),(n=n>s?s:n)<0&&(n+=s),s=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(s);++r<s;)a[r]=e[r+t];return a}(t,0,-1))}(e,t=B(t,e)?[t]:V(t));var n,r,s=W((r=(n=t)?n.length:0)?n[r-1]:void 0);return!(null!=e&&T.call(e,s))||delete e[s]}function V(e){return q(e)?e:G(e)}function k(e,t){var n,r,s=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?s["string"==typeof t?"string":"hash"]:s.map}function $(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return F(n)?n:void 0}function B(e,t){if(q(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Y(e))||(l.test(e)||!c.test(e)||null!=t&&e in Object(t))}w.prototype.clear=function(){this.__data__=O?O(null):{}},w.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},w.prototype.get=function(e){var t=this.__data__;if(O){var n=t[e];return n===r?void 0:n}return T.call(t,e)?t[e]:void 0},w.prototype.has=function(e){var t=this.__data__;return O?void 0!==t[e]:T.call(t,e)},w.prototype.set=function(e,t){return this.__data__[e]=O&&void 0===t?r:t,this},M.prototype.clear=function(){this.__data__=[]},M.prototype.delete=function(e){var t=this.__data__,n=U(t,e);return!(n<0)&&(n==t.length-1?t.pop():D.call(t,n,1),!0)},M.prototype.get=function(e){var t=this.__data__,n=U(t,e);return n<0?void 0:t[n][1]},M.prototype.has=function(e){return U(this.__data__,e)>-1},M.prototype.set=function(e,t){var n=this.__data__,r=U(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},L.prototype.clear=function(){this.__data__={hash:new w,map:new(b||M),string:new w}},L.prototype.delete=function(e){return k(this,e).delete(e)},L.prototype.get=function(e){return k(this,e).get(e)},L.prototype.has=function(e){return k(this,e).has(e)},L.prototype.set=function(e,t){return k(this,e).set(e,t),this};var G=H((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(Y(e))return x?x.call(e):"";var t=e+"";return"0"==t&&1/e==-s?"-0":t}(t);var n=[];return u.test(e)&&n.push(""),e.replace(d,(function(e,t,r,s){n.push(r?s.replace(p,"$1"):t||e)})),n}));function W(e){if("string"==typeof e||Y(e))return e;var t=e+"";return"0"==t&&1/e==-s?"-0":t}function H(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,s=t?t.apply(this,r):r[0],a=n.cache;if(a.has(s))return a.get(s);var o=e.apply(this,r);return n.cache=a.set(s,o),o};return n.cache=new(H.Cache||L),n}H.Cache=L;var q=Array.isArray;function z(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Y(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&N.call(e)==i}e.exports=function(e,t){return null==e||j(e,t)}},953:e=>{class t{constructor(e,t,n,r,s){this.converter=c(),this.width=e,this.poly=t,this.xor_in=n,this.reflected_xor_in=l(n,e),this.xor_out=r,this.reflect=s,this.msb_mask=1<<this.width-1,this.mask=this.msb_mask-1<<1|1,this.crc_shift=this.width<8?8-this.width:0,this.shifted_xor_in=this.xor_in<<this.crc_shift;let a=this.gen_table();this.table=a,8!==this.width||this.xor_in||this.xor_out||this.reflect||(this.calculate=function(e){e=this.converter.validate_buffer(e);let t=0;for(let n=0;n<e.length;n++)t=a[t^e[n]];return t})}calculate(e){let t;e=this.converter.validate_buffer(e);let{table:n,width:r,crc_shift:s,mask:a}=this;if(this.reflect){t=this.reflected_xor_in;for(let r=0;r<e.length;r++){t=(n[255&(t^e[r])]^t>>>8)&a}}else{t=this.shifted_xor_in;for(let o=0;o<e.length;o++)t=n[255&(t>>r-8+s^e[o])]<<s^t<<8-s&a<<s;t>>=s}return t^=this.xor_out,t>>>0}calculate_no_table(e){e=this.converter.validate_buffer(e);let t=this.xor_in;for(let n=0;n<e.length;n++){let r=e[n];this.reflect&&(r=l(r,8));for(let e=0;e<8;e++){let n=t&this.msb_mask;r&128>>e&&(n^=this.msb_mask),t<<=1,n&&(t^=this.poly)}t&=this.mask}return this.reflect&&(t=l(t,this.width)),t^=this.xor_out,t>>>0}gen_table(){let e=[];for(let t=0;t<256;t++){let n=t;this.reflect&&(n=l(n,8)),n<<=this.width-8+this.crc_shift;for(let e=0;e<8;e++)0!=(n&this.msb_mask<<this.crc_shift)?(n<<=1,n^=this.poly<<this.crc_shift):n<<=1;this.reflect&&(n=l(n>>this.crc_shift,this.width)<<this.crc_shift),n=n>>this.crc_shift&this.mask,e[t]=n>>>0}return new Int32Array(e)}print_table(){let e=this.table,t=Math.ceil(this.width/4),n=t<4?4:3,r=e.length>>n,s=1<<n,a="";for(let o=0;o<r;o++){let r="";for(let a=0;a<s;a++){let s=e[o<<n|a];s="000000000"+s.toString(16),s=s.substr(s.length-t),r+="0x"+s+", "}a+=" "+r+"\n"}return a="[\n"+a.slice(0,-3)+"\n]",a}}const n="undefined"!=typeof Buffer,r="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,s=void 0!==typeof BigInt&&BigInt(256);class a{validate_buffer(e){switch(typeof e){case"number":{if(!Number.isSafeInteger(e)||e<0)throw Error(`number data must be a nonnegative safe integer, not ${e}`);if(this.fromUInt32&&e<=4294967295)return this.fromUInt32(e);const t=[];for(;e>0||t.length<4;)t.unshift(e%256),e=Math.floor(e/256);return this.fromByteArray(t)}case"string":return this.fromString(e);case"bigint":{if(e<0)throw Error(`bigint data must be nonnegative, not ${e}`);const t=[];for(;e>0||t.length<4;)t.unshift(Number(e%s)),e/=s;return this.fromByteArray(t)}default:if(n&&Buffer.isBuffer(e))return e;if(r){if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(e instanceof ArrayBuffer)return new Uint8Array(e)}throw new Error(`Unrecognized data type ${typeof e}: ${e}`)}}}class o extends a{fromUInt32(e){const t=Buffer.alloc(4);return t.writeUInt32BE(e),t}fromByteArray=Buffer.from.bind(Buffer);fromString=Buffer.from.bind(Buffer)}class i extends a{fromByteArray=Uint8Array.from.bind(Uint8Array);fromString(e){return new TextEncoder("utf-8").encode(e)}}function c(e=!1){if(r&&(e||!n))return new i;if(n)return new o;throw Error("either need TypedArrays or Buffer")}function l(e,t){let n=0;for(let r=0;r<t;r++)n=n<<1|1&e,e>>=1;return n}const u={crc1:new t(1,1,0,0,!1),crc6:new t(6,47,0,0,!1),crc8:new t(8,7,0,0,!1),crc10:new t(10,563,0,0,!1),crc16:new t(16,32773,0,0,!0),crc24:new t(24,8801531,11994318,0,!1),crc32:new t(32,79764919,4294967295,4294967295,!0),crc32c:new t(32,517762881,4294967295,4294967295,!0)};function d(e){}e.exports={CRC:t,crc:function(e,n,r,s,a){let o=new t(e,n,r,s,a);return o.calculate.bind(o)},makeBufferConverter:c,models:u,crc1:d,crc6:d,crc8:d,crc10:d,crc16:d,crc24:d,crc32:d,crc32c:d};for(let t in u){let n=u[t];e.exports[t]=n.calculate.bind(n)}},754:e=>{function t(e){return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}))}t.keys=()=>[],t.resolve=t,t.id=754,e.exports=t}},r={};function s(e){var t=r[e];if(void 0!==t)return t.exports;var a=r[e]={id:e,loaded:!1,exports:{}};return n[e](a,a.exports,s),a.loaded=!0,a.exports}s.m=n,s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce(((t,n)=>(s.f[n](e,t),t)),[])),s.u=e=>"js/531-web.js",s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="constellation-corejs-library:",s.l=(n,r,a,o)=>{if(e[n])e[n].push(r);else{var i,c;if(void 0!==a)for(var l=document.getElementsByTagName("script"),u=0;u<l.length;u++){var d=l[u];if(d.getAttribute("src")==n||d.getAttribute("data-webpack")==t+a){i=d;break}}i||(c=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,s.nc&&i.setAttribute("nonce",s.nc),i.setAttribute("data-webpack",t+a),i.src=n),e[n]=[r];var p=(t,r)=>{i.onerror=i.onload=null,clearTimeout(h);var s=e[n];if(delete e[n],i.parentNode&&i.parentNode.removeChild(i),s&&s.forEach((e=>e(r))),t)return t(r)},h=setTimeout(p.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=p.bind(null,i.onerror),i.onload=p.bind(null,i.onload),c&&document.head.appendChild(i)}},s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;s.g.importScripts&&(e=s.g.location+"");var t=s.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.p=e})(),(()=>{var e={388:0};s.f.j=(t,n)=>{var r=s.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var a=new Promise(((n,s)=>r=e[t]=[n,s]));n.push(r[2]=a);var o=s.p+s.u(t),i=new Error;s.l(o,(n=>{if(s.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var a=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;i.message="Loading chunk "+t+" failed.\n("+a+": "+o+")",i.name="ChunkLoadError",i.type=a,i.request=o,r[1](i)}}),"chunk-"+t,t)}};var t=(t,n)=>{var r,a,[o,i,c]=n,l=0;if(o.some((t=>0!==e[t]))){for(r in i)s.o(i,r)&&(s.m[r]=i[r]);if(c)c(s)}for(t&&t(n);l<o.length;l++)a=o[l],s.o(e,a)&&e[a]&&e[a][0](),e[a]=0},n=self.webpackChunkconstellation_corejs_library=self.webpackChunkconstellation_corejs_library||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),(()=>{"use strict";var e={};s.r(e),s.d(e,{buildContextName:()=>H,buildModalContext:()=>K,buildTransientContextName:()=>q,getContainerIdFromContext:()=>J,getParentContext:()=>X,getParentContextName:()=>W,getTargetFromContext:()=>Y,getTransientContext:()=>z});var t={};s.r(t),s.d(t,{getResolvedTargetName:()=>mt,getRoutingInfo:()=>yt,getSemanticURLFromRoutingInfo:()=>It});var n={};s.r(n),s.d(n,{evaluate:()=>Yt,handleChange:()=>qt,hasDeclareExpression:()=>Ht,updateDeclareExpressions:()=>zt});var r={};s.r(r),s.d(r,{publishExpressions:()=>xr,publishResponse:()=>wr});var a={};s.r(a),s.d(a,{hasBrowserEnv:()=>_a,hasStandardBrowserEnv:()=>Sa,hasStandardBrowserWebWorkerEnv:()=>Ta,navigator:()=>Ca,origin:()=>Na});var o={};s.r(o),s.d(o,{CONTAINER_NAMES:()=>td,CONTAINER_TYPES:()=>ed,addRootContainerItem:()=>Md,areContainerItemsPresent:()=>id,clearTransientData:()=>kd,closeContainerItem:()=>wd,getActiveContainerItemContext:()=>Id,getActiveContainerItemIDFromRoutingInfo:()=>Qd,getActiveContainerItemName:()=>gd,getActiveContext:()=>Yd,getChildContainerItems:()=>Ed,getChildContainers:()=>Ad,getChildContainersContexts:()=>_d,getContainerAPI:()=>Gd,getContainerAccessOrder:()=>od,getContainerData:()=>rd,getContainerItemByKey:()=>dd,getContainerItemData:()=>sd,getContainerItemName:()=>ld,getContainerItems:()=>ad,getContainerLimit:()=>Pd,getContainerParentContext:()=>Jd,getContainerType:()=>hd,getContextByTargetAndKey:()=>Xd,getDataContextName:()=>yd,getFlowContainer:()=>ep,getLeastRecentlyUsedNonDirtyContainerItemID:()=>vd,getParentContainerItem:()=>Zd,getRootContainerName:()=>zd,getSuggestionContexts:()=>Cd,getTargetFromContainerItemID:()=>xd,getTransientItems:()=>Fd,hasContainerItems:()=>Nd,isContainerDirty:()=>Od,isContainerInitialized:()=>pd,isContainerItemActive:()=>fd,isContainerItemContextBeingUsedInOtherContainers:()=>Ud,isContainerItemExists:()=>cd,isContainerLimitReached:()=>Dd,isContainerMultipleMode:()=>Td,isContainerSingleMode:()=>Sd,purgeTransientData:()=>$d,removeContainer:()=>Wd,replaceTransientData:()=>Vd,resetContainersPayload:()=>bd,setContainerLimit:()=>Rd,updateCaseContextEtag:()=>qd,updateParentLastUpdateTime:()=>Kd,updateRelatedContextEtag:()=>Hd,updateTransientData:()=>jd});var i={};s.r(i),s.d(i,{getAdditionalInfo:()=>Zp,getDataPageKeys:()=>Xp,getDataPageMetadata:()=>Bp,getEmbeddedPropertyMetadata:()=>Lp,getFieldParameters:()=>qp,getFieldsByClassName:()=>Hp,getGenAICoach:()=>Yp,getInsight:()=>Wp,getLookUpDataPage:()=>Jp,getLookUpDataPageInfo:()=>Qp,getParagraph:()=>zp,getPersonalizationMetadata:()=>Gp,getPropertyMetadata:()=>Mp,getResolvedFieldMetadata:()=>eh,getSavableDataPage:()=>Kp,isViewExists:()=>kp,mergeStore:()=>wp,resolveNavigation:()=>$p,resolveView:()=>Vp,updateNavigationStore:()=>Fp,updateStores:()=>jp,updateViewStore:()=>Up});var c={};s.r(c),s.d(c,{dispatch:()=>ih,doesContextExist:()=>_h,getActionType:()=>gh,getContextValue:()=>ph,getDataObject:()=>ch,getReferenceTokens:()=>sh,getSharedDataObject:()=>lh,getStore:()=>oh,getValue:()=>dh,isMergeable:()=>mh,lookupContextValue:()=>hh,mergeDeep:()=>yh,removeItem:()=>fh,replaceValue:()=>Eh,resetStore:()=>Ah,setStore:()=>ah,updateValue:()=>Ih});var l={};s.r(l),s.d(l,{activateContainerItem:()=>Jh,addContainerItem:()=>$h,addMessages:()=>Qh,addSharedData:()=>cg,addTransientItem:()=>Bh,addWork:()=>Fh,clearTransientData:()=>Wh,createWork:()=>vh,error:()=>ig,finishAssignment:()=>rg,initContainers:()=>Vh,listAction:()=>ug,loadView:()=>Lh,mergeData:()=>wh,openAssignment:()=>sg,openWorkByHandle:()=>jh,postProcess:()=>og,purgeTransientData:()=>qh,removeAllTransientItems:()=>eg,removeContainerItem:()=>Zh,removeSharedData:()=>lg,removeTransientItem:()=>tg,replaceContainerItem:()=>ng,replaceTransientData:()=>Hh,resetContainers:()=>kh,resetLoading:()=>Kh,setLoading:()=>Yh,setSharedProperty:()=>pg,setStateProperty:()=>hg,showCasePreview:()=>dg,showHarness:()=>Mh,showHistory:()=>ag,showPage:()=>Uh,upMergeAndRemoveContainerItem:()=>Xh,updateContainerItem:()=>zh,updateTransientData:()=>Gh});var u={};s.r(u),s.d(u,{doesRestApiExist:()=>Wm,getCancelTokenSource:()=>Hm,getCaseApi:()=>Ym,getHeaderProcessor:()=>$m,invokeCustomRestApi:()=>Gm,invokeRestApi:()=>Bm,isRequestCanceled:()=>qm,registerInterceptor:()=>zm});var d={};s.r(d),s.d(d,{fetchViewResources:()=>bE,updateViewResources:()=>DE});var p=s(216),h=s.n(p);let g,f,m;const y=e=>{e&&(g=e=e||{"base-server":"http://localhost:1080/prweb/","data-end-point":"api/v1/stream/data","action-end-point":"api/v1/stream/action"},g.BASEURL=e.server,g.ACTIONURL=e["action-end-point"],g.DATAURL=e["data-end-point"],m=e.reAuthUrl)},I=()=>m,E=()=>g.BASEURL,A=e=>fetch(`${g.BASEURL}${g.ACTIONURL}`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),_=e=>{f=e},C=()=>f;var S=s(953),T=s(521),N=s.n(T),P=s(928),R=s.n(P),D=s(188),b=s.n(D),O=s(835),v=s.n(O),x=s(692),w=s.n(x),M=s(529),L=s.n(M);const U=new class{constructor(){this.needsMapping=!1}getNeedsMapping(){return this.needsMapping}setNeedsMapping(e){this.needsMapping=e}map(e){return this.needsMapping?this.replacer(e):e}analyseResponse(e){e?.data?.objectInfo&&window?.PCore?.getEnvironmentInfo()?.isUnifiedObject()?this.setNeedsMapping(!0):this.setNeedsMapping(!1)}replacer(e){return this.needsMapping&&(e=e.replace("caseInfo","objectInfo").replace("caseTypeName","objectTypeName").replace("caseTypeID","objectTypeID")),e}},F={APP:{APP:"app",ROOT:"root",PXREQUESTOR:"pxRequestor",PXUSERNAME:".pxUserName",OPERATORID:"OperatorID",USERNAME:"pxRequestor.pxUserName",PXUSERIDENTIFIER:".pxUserIdentifier",USERIDENTIFIER:"pxRequestor.pxUserIdentifier",PYIMAGEINSKEY:".pyImageInsKey",OPERATORID_IMG_INSKEY:"OperatorID.pyImageInsKey",OPERATORID_LOCALE:"OperatorID.pyUseLocale",APPLICATION_LABEL:"Application.pyLabel",APPLICATION_RULE_NAME:"Application.pyRuleName"},RESOURCE_TYPES:{ASSIGNMENT:"ASSIGNMENT",CASE:"CASE",DATA:"DATA",PAGE:"PAGE"},RESOURCE_STATUS:{CREATE:"CREATE",UPDATE:"UPDATE",OPEN_FLOW_ACTION:"OPEN_FLOW_ACTION"},VIEW_NAMES:{PY_CASE_TAB:"pyCaseTab",DATA_OBJECT_CREATE_VIEW:"Create",DATA_OBJECT_EDIT_VIEW:"pyEdit",PY_DATA_PREVIEW:"pyDataPreview",PY_DETAILS:"pyDetails"},CONTAINERS:{ROOT_CONTAINER:"RootContainer",VIEW_CONTAINER:"ViewContainer",FLOW_CONTAINER:"FlowContainer",MODAL_VIEW_CONTAINER:"ModalViewContainer",PREVIEW_VIEW_CONTAINER:"PreviewViewContainer",HYBRID_VIEW_CONTAINER:"HybridViewContainer"},WORK_BASKET:{MY_WORK_LIST:"myWorkList",REPORTEE:"reportee",WORK_QUEUE:"workQueue",DATA_PAGES:{D__PY_GET_USER_WORK_LIST_BY_USER_ID:"D_pyGetUserWorkListByUserId",D__WORK_BASKET:"D_WorkBasket",D__PY_MY_WORK_LIST:"D_pyMyWorkList"}},CONTEXT_TREE_NODE_TYPES:{VIEW:"VIEW",FIELD:"FIELD",DECLARATIVE_TARGET:"DECLARATIVE_TARGET",WHEN:"WHEN",CONTEXT:"CONTEXT",PAGELIST:"PAGELIST"},WORKLIST:"worklist",WAIT:"wait",TODO:"todo",STANDARD_FLOW:"Standard",CASE:"CASE",ASSIGNMENT:"ASSIGNMENT",FIX_BROKEN_ASSIGNMENTS:"FixBrokenAssignments",PAGE:"PAGE",PZINSKEY:".pzInsKey",CREATE_DETAILS_VIEW_NAME:"pzCreateDetails",PREVIEW_VIEW_NAME:"pyCasePreview",CASESUMMARY_VIEW_NAME:"pyCaseSummary",APPSHELL_ACTIVE_CASES:"appshell-activecases",TRACE_ID:"x-b3-traceid",LOAD_VIEW_STRING:"View",PRIMARY:"primary",DEFER_UPDATE_CASESUMMARY_VIEW:"deferUpdateCaseSummaryView",NEXT_ASSIGNMENT_INFO_ID:"nextAssignmentInfo.ID",WORKCLASS:"Work-",DATA_INFO:{DATA_INFO_CONTENT:"dataInfo.content"},CASE_INFO:{CASE_INFO:"caseInfo",CASE_INFO_CONTENT:"caseInfo.content",CASE_INFO_NAME:"caseInfo.name",CASE_INFO_ID:"caseInfo.ID",CASE_INFO_CLASSID:"caseInfo.content.classID",CASE_TYPE_ID:"caseInfo.caseTypeID",CASE_TYPE_NAME:"caseInfo.caseTypeName",CASE_INFO_PZINSKEY:"caseInfo.content.pzInsKey",CASE_INFO_ACTIONS:"caseInfo.availableActions",VIEW_NAME:"caseInfo.content.pyViewName",ACTION_BUTTONS:"caseInfo.actionButtons",ACTIVE_ACTION_ID:"caseInfo.activeActionID",ASSIGNMENT_LABEL:"caseInfo.assignments[0].name",ASSIGNMENT_ID:"caseInfo.assignments[0].ID",ASSIGNMENTS:"caseInfo.assignments",INSTRUCTIONS:"caseInfo.assignments[0].instructions",NAVIGATION:"caseInfo.navigation",STAGES:"caseInfo.stages",STAGEID:"caseInfo.stageID",CASECLASS:"caseInfo.caseClass",AVAILABLEACTIONS:"caseInfo.availableActions",AVAILABLEPROCESSES:"caseInfo.availableProcesses",D_CASE_ASSIGNMENTS_RESULTS:"caseInfo.assignments",CHILD_ASSIGNMENTS:"caseInfo.childCases",ASSIGNMENTACTION_ID:"caseInfo.assignments[0].actions[0].ID",ISINCREATESTAGE:"caseInfo.isInCreateStage",APPROVALFLAG:"caseInfo.content.pyApprovalResult",DUPLICATECASEFLAG:"caseInfo.content.pyDuplicateCaseActions",DUPLICATECASEID:"caseInfo.content.pyDuplicateID",DUPLICATECASEINSKEY:"caseInfo.content.pyDuplicateCaseReference.pzInsKey",HEADERS:"caseInfo.headers",PARENTCASEINFO:"caseInfo.parentCaseInfo",REMOTESYSTEMID:"caseInfo.headers.RemoteSystemID",CASE_RELATED_CASE_TYPES:"caseInfo.relatedCaseTypes",CASES:"caseInfo.cases",GETNEXTWORK:"caseInfo.confirmationLinks.getNextWork",ACTION_REFRESH_CONDITIONS:"caseInfo.assignments[0].actions[0].refreshConditions",IS_LOCAL_ACTION:"caseInfo.isLocalAction",BUSINESS_ID:"caseInfo.businessID",IS_FIRST_ASSIGNMENT:"caseInfo.isFirstAssignment"},ACTIONS:{ACTION_ID:"actionID",ACTIONS:"availableActions",DELETEAVIALACTIONS:"deleteAvailActions",FLOWACTION:"FlowAction",DATA_PAGES:{D_PY_ADDITIONAL_CASE_ACTIONS:"D_pyAdditionalCaseActions"}},PROCESS:{FLOWPROBLEMS:"FlowProblems"},PAGE_TYPES:{PAGE:"page",LANDINGPAGE:"landingpage",LISTPAGE:"listpage"},LOCAL_ACTION_TYPE:{CASE_WIDE:"case",EXPRESS:"express",ASSIGNMENT:"Assignment",LOCAL_ACTION:"LocalAction"},LOCAL_ACTIONS:{TRANSFER_ASSIGNMENT:"pyTransferAssignment"},CONTENT:"content",MODAL:"modal",STOPMERGEACTIONS:"stopMergeActions",IS_CREATE_DATA_OBJECT:"isCreateDataObject",SUMMARY_OF_ASSIGNMENT_LAST_SUBMIT_TIME:"context_data.caseInfo.content.summary_of_assignment__.lastSubmitTime",SUMMARY_OF_ATTACHMENTS_LAST_REFRESH_TIME:"context_data.caseInfo.content.summary_of_attachments__.lastRefreshTime",CONTEXT_DATA_ASSIGNMENTID:"context_data.assignmentID",BANNER_VARIANT_SUCCESS:"success",BANNER_VARIANT_WARNING:"warning",BANNER_VARIANT_URGENT:"urgent",BANNER_VARIANT_INFO:"info",MESSAGES:{MESSAGES_TYPE_SUCCESS:"success",MESSAGES_TYPE_INFO:"info",MESSAGES_TYPE_ERROR:"error"},PUB_SUB_EVENTS:{EVENT_RENDER_APP:"renderApp",EVENT_UNMOUNT_APP:"unmountApp",EVENT_REAUTH:"reAuth",EVENT_FULL_REAUTH:"fullReAuth",EVENT_CUSTOM_REAUTH:"customReAuth",EVENT_CANCEL:"cancel",EVENT_MINIMIZE:"minimize",EVENT_EXPRESS_LOCALACTION:"expressLocalActionSubmit",EVENT_LOCALACTION_SUBMISSION:"localActionSubmit",EVENT_BULKACTION:"bulkActionSubmit",EVENT_SHOW_CANCEL_ALERT:"showCancelAlert",EVENT_SHOW_DELETE_ALERT:"showDeleteAlert",EVENT_DASHBOARD_FILTER_CHANGE:"dashboardFilterChange",EVENT_DASHBOARD_FILTER_CLEAR_ALL:"dashboardFilterClearAll",EVENT_PROMOTED_FILTERS_CHANGE:"promotedFiltersChange",EVENT_LOGOFF:"Logoff",EVENT_TRANSIENT_ITEMS:{UPDATE_PROMOTED_FILTERS:"updatePromotedFilters"},UI_EVENTS:{SHOW_PAGE_INIT:"showPageInit",SHOW_PAGE_DONE:"showPageDone",SHOW_PAGE_STARTED:"showPageStarted"},CASE_EVENTS:{CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW:"caseAttachmentsUpdateFromCaseview",CASE_FOLLOWER_UPDATED_BY_OPERATOR_FROM_CASEVIEW:"caseFollowerUpdateByOperatorFromCaseview",CASE_FOLLOWER_UPDATE_BY_OPERATOR_FROM_WIDGET:"caseFollowerUpdateByOperatorFromWidget",CASE_CREATED:"caseCreated",CREATE_STAGE_DONE:"caseCreatedDone",CREATE_STAGE_CANCELLED:"caseCancelled",CREATE_STAGE_SAVED:"caseSaved",CREATE_STAGE_DELETED:"caseDeleted",ASSIGNMENT_SUBMISSION:"assignmentSubmission",END_OF_ASSIGNMENT_PROCESSING:"endOfAssignmentProcessing",CLOSE_CONFIRM_VIEW:"closeConfirmView",CASE_OPENED:"caseOpened",CASE_CLOSED:"caseClosed",ASSIGNMENT_OPENED:"assignmentOpened",CASE_PREVIEW:"casePreview",CURRENT_ASSIGNMENT_UPDATED:"currentAssignmentUpdated",CASE_LOCK_EVENT:"caseLockEvent",NOTIFICATION_UPDATED:"notificationUpdated"},BOOTSTRAP_SHELL_EVENTS:{CONSTELLATION_LOADED:"CONSTELLATION_LOADED"},CONTAINER_EVENTS:{CLOSE_CONTAINER_ITEM:"CLOSE_CONTAINER_ITEM",CLOSE_MULTI_TYPE_PRIMARY_CONTAINER_ITEM:"CLOSE_MULTI_TYPE_PRIMARY_CONTAINER_ITEM"},DISPLAY_CASE_CREATED_TOASTER:"displayCaseCreatedToaster",DATA_EVENTS:{DATA_OBJECT_CREATED:"dataObjectCreated",DATA_OBJECT_DELETED:"dataObjectDeleted",DATA_OBJECT_UPDATED:"dataObjectUpdated"},FETCH_SUCCESS:"fetchSuccess",REVERSE_COEXISTENCE_EVENTS:{HANDLE_DISCARD:"handleDiscard",CHECK_IS_FORM_DIRTY:"checkIsFormDirty"},TIMEOUT_REMINDER:"sessionAboutToTimeout",RESET_TIMER:"resetInactivityTimer"},CONTAINER_TYPE:{MULTIPLE:"multiple",SINGLE:"single",HYBRID:"HybridViewContainer"},REMOTE_SYSTEM_ID:"RemoteSystemID",LIST_SELECTION_MODE:{MULTI:"multi",SINGLE:"single",MULTI_ON_HOVER:"multi_on_hover"},SUBMISSION_FAILURE_TYPE:{FORM_VALIDATION_ERROR:"formValidationError"},USER_SETTINGS:{UTILITY_PANEL_USER_STATE_PATH:"presentation.templates.CaseView.utilityPanelExpanded",SUMMARY_PANEL_USER_STATE_PATH:"presentation.templates.CaseView.summaryPanelExpanded",ASSIGNMENT_COLLAPSED_STATE_PATH:"presentation.templates.CaseView.assignmentWidgetCollapsed",CASE_VIEW_PATH:"presentation.templates.CaseView"},PROMISE_VALUE:{RESOLVE:"resolve",REJECT:"reject"},APP_TYPE:{UIKIT:"uikit",THEME_COSMOS:"themecosmos"},VIEW_TYPE:{PY_EMBEDASSIGNMENT:"pyEmbedAssignment",PY_DETAILS:"pyDetails"}},j={CONTEXT:"context",AJAXCONTAINER:"primary",VIEW_CONTAINER:"ViewContainer",APP_SHELL:"AppShell",ROOT_CONTAINER:"RootContainer",HYBRID_VIEW_CONTAINER:"HybridViewContainer",MODAL_VIEW_CONTAINER:"ModalViewContainer",FLOW_CONTAINER:"FlowContainer",PREVIEW_VIEW_CONTAINER:"PreviewViewContainer",OBJECT_PAGE:"ObjectPage",CASE_CREATE_STAGE:"CaseCreateStage",CASE_VIEW:"CaseView",VIEW:"view",CASE_PREVIEW:"CasePreview",CASE_STAGES:"Stages",CASEMESSAGES:"caseMessages",SUGGESTION:"suggestion",PREVIEW:"preview",TERTIARY:"tertiary",DEFAULT:"default",ACPRIMARY:"primary",ACTERTIARY:"tertiary",PERFORM_MODE:"perform",CASE_VIEW_MODE_PROP:".caseViewMode",REVIEW_MODE:"review",WORKAREA:"workarea",ACPRIMARY_NAME:"ACPRIMARY",ACTERTIARY_NAME:"ACTERTIARY",THREADNAMESEPARATOR:"/",JOINCHARACTER:"_",FORWARD_SLASH_STRING:"/",UNDERSCORE_STRING:"_",WORK_ID:"WORK_ID",EMPTY_STRING:"",PROPERTY_MESSAGES:"propertyMessages__",CONTEXT_MESSAGES:"contextMessages__",HTTP_MESSAGES:"httpMessages__",PAGE_MESSAGES:"pageMessages__",SUMMARY_OF_LISTS:"summary_of_lists__",SUMMARY_OF_GROUPS:"summary_of_groups__",SUMMARY_OF_MESSAGES:"summary_of_messages__",SUMMARY_OF_FIELD_VALUES:"summary_of_field_values__",SUMMARY_OF_WHEN_CONDITIONS:"summary_of_when_conditions__",SUMMARY_OF_EXPRESSIONS:"summary_of_expressions__",SUMMARY_OF_ASSOCIATED_LISTS:"summary_of_associated_lists__",CONTEXT_DATA:"context_data",TABLE:e=>`Table[${e}]`,HTTP:"HTTP",PROPERTY:"PROPERTY",PAGE_ERRORS:"page_level_errors",NO_MESSAGES:"No messages existing",PULSE_REFERENCE:"pulse.messages",IS_LOADING:"isLoading",APPROVED:"Approved",REJECTED:"Rejected",DUPLICATE:"Duplicate",IGNORE:"Ignore",PARAGRAPH:"PARAGRAPH",X_ORIGIN_CHANNEL:"x-origin-channel",AUTHORING_PREVIEW_CONTAINER:"root/authoring-preview",ERROR_FIELD_IN_PAGE:"erroneousInputOutputFieldInPage",ERROR_IN_PAGE_IDENTIFIER:"erroneousInputOutputIdentifier",UI_RESOURCES:"uiResources",UI_RESOURCES_CONTEXT_DATA:"uiResources.context_data",ACTION_BUTTONS:"uiResources.actionButtons",RESOURCES:"uiResources.resources",ROOT:"uiResources.root",CASE_INFO_IS_LOCAL_ACTION:"caseInfo.isLocalAction",DATA:"data",OPTIONS:"options",VIEWS:"uiResources.resources.views",NAVIGATIONS:"uiResources.resources.navigations",COMPONENTS:"uiResources.components",LOCALE_REFERENCES:"uiResources.localeReferences",STATIC_SERVER_URL:"staticServer",APPLICATION_DATA:"data.Application",REFERENCED_USERS:"referencedUsers",CASE_INFO_REFRESH_CONDITIONS:"caseInfo.refreshConditions",FIELD_LEVEL_SUCCESS:"success",FIELD_LEVEL_WARNING:"warning",FIELD_LEVEL_ERROR:"error",HASH_DELIMITER:"~^|^~",NULL_STRING:"null",DATA_PAGE:"DataPage",DECISION:"Decision",RULE_REFERENCE:"RuleReference",GET_PAGE_DATA:"getPageData",PROPERTY_ANNOTATION:"@P",FIELD_LABEL_ANNOTATION:"@FL",ATTACHMENT_ANNOTATION:"@ATTACHMENT",ASSOCIATED_PROPERTY_ANNOTATION:"@ASSOCIATED",CLASS_ANNOTATION:"@CLASS",ASSOCIATED:"associated",CLASS_ID:".classID",CLASSID:"classID",READONLY:"readonly",SHARED:"shared",RELOAD_IF_OLDER_THAN:"reloadIfOlderThan",RELOAD_ONCE_PER_INTERACTION:"reloadOncePerInteraction",PY_DETAILS:"pyDetails",PY_CONFIRM:"pyConfirm",LIST_ACTIONS:{INSERT:"INSERT",UPDATE:"UPDATE",DELETE:"DELETE",DELETE_ALL:"DELETE ALL",MOVE:"MOVE",SELECT:"SELECT",DESELECT:"DESELECT"},LIST_ACTIONS_TYPE:{SELECT_DESELECT:"SELECT_DESELECT",DESELECT_ALL:"DESELECT_ALL"},ENV_INFO_KEYS:{APPLICATION_NAME:"APPLICATION_NAME",APPLICATION_DESC:"APPLICATION_DESC",ACCESS_GROUP:"ACCESS_GROUP",USER_NAME:"USER_NAME",USER_ID:"USER_ID",USER_IMAGE:"USER_IMAGE",LOCALE:"LOCALE",TIMEZONE:"TIMEZONE",WORK_GROUP:"WORK_GROUP"},ID:"ID",SCALARLIST:"ScalarList",COREHEADERS:"coreHeaders",SKIPCOREHEADERS:"skipCoreHeaders",COREHEADER_APP_DEBUG_ID:"X-Pega-App-Debug-ID",COREHEADER_APP_DEBUG_LEVELS:"X-Pega-App-Debug-Levels",CONTEXT_DATA_MODAL_VIEW:{IS_MULTI_RECORD_DATA:"context_data.modalView.isMultiRecordData",VIEW_NAME:"context_data.modalView.viewName",PARENT_CONTEXT:"context_data.modalView.parentContext",INTERESTPAGE:"context_data.modalView.interestPage"},DATA_CLASS_NOT_FOUND:"Data object class not found",PRIORITY:{CRITICAL:100,HIGH:500,MEDIUM:1e3,LOW:2e3,TRIVIAL:3e3},...F,EMBED:"EMBED",getProperty:e=>U.map(e)},V="pyRemoteCaseDetails";class k{static remoteCaseMapping={};static setRemoteCaseMapping=e=>{this.remoteCaseMapping=e,this.setAdditionalParameters()};static getRemoteCaseMapping=()=>this.remoteCaseMapping;static getRemoteCase=e=>this.remoteCaseMapping?.[e];static isRemoteCase=e=>!!(e&&this.remoteCaseMapping&&this.remoteCaseMapping[e]);static getRemoteHeaderByContext=e=>Rh.getProperty(".RemoteSystemID",j.CASE_INFO.HEADERS,e);static getRemoteHeader=e=>this.remoteCaseMapping[e]?.RemoteSystemID;static injectRemoteCaseHeader=(e,t,n)=>{if(e&&e.RemoteSystemID)return;const r=this.getRemoteHeaderByContext(n);r?e.RemoteSystemID=r:t&&this.isRemoteCase(t.caseTypeID)&&(e.RemoteSystemID=this.getRemoteHeader(t.caseTypeID))};static isTraditionalRemoteCase=(e="")=>"Traditional"===k.getRemoteCase(e)?.RemoteApplicationType;static setAdditionalParameters=()=>{const e=up.environmentInfoObject?.pyRemoteCaseTypeList;e?.forEach((e=>{const t=this.getRemoteCase(e.pyWorkTypeImplementationClassName);t&&(t.name=e.pyWorkTypeName)}))};static getRemoteHeaderFromSourceClass=e=>{const t=Object.values(this.remoteCaseMapping).find((t=>t.RemoteClassName===e));return t?.RemoteSystemID}}const $=k,B={},G=new Map,W=e=>{let t=j.EMPTY_STRING;return t=e&&e.includes(j.FORWARD_SLASH_STRING)?e.substring(0,e.lastIndexOf("/")):e,t},H=(e,t,n=!1)=>{let r=j.EMPTY_STRING;if(t&&e){let s=`${t}${j.FORWARD_SLASH_STRING}${e}`;const a=rd(s);if(a||t!==j.APP.APP&&t!==j.APP.ROOT)if(a){if(n&&B[s])return r=`${s}${j.UNDERSCORE_STRING}${B[s]}`,r;B[s]?B[s]+=1:B[s]=1,r=`${s}${j.UNDERSCORE_STRING}${B[s]}`}else r=H(e,W(t));else s=`${t}${j.FORWARD_SLASH_STRING}${j.PRIMARY}`,B[s]?B[s]+=1:B[s]=1,r=`${s}${j.UNDERSCORE_STRING}${B[s]}`}return r},q=(e,t)=>{if(e&&t){const n=(G[t]?.[e]??0)+1;return G[t]||(G[t]={}),G[t][e]=n,`${t}${j.FORWARD_SLASH_STRING}${e}_${n}`}return""},z=(e,t)=>{if(e&&t){const n=G[t]?.[e];return n?`${t}${j.FORWARD_SLASH_STRING}${e}_${n}`:q(e,t)}return""},Y=e=>{let t=j.EMPTY_STRING;return e&&(t=e.substring(e.lastIndexOf("/")+1,e.lastIndexOf("_")).toLowerCase()),t},K=(e,t)=>{if(null===e)return t;const[,n]=t.split(j.FORWARD_SLASH_STRING);return e+j.FORWARD_SLASH_STRING+n},X=e=>{const t=e.indexOf(j.FORWARD_SLASH_STRING),n=e.lastIndexOf(j.FORWARD_SLASH_STRING);return t===n?e:e.substring(0,n)},J=e=>{const t=e.split(j.FORWARD_SLASH_STRING);return 2===t.length?e:t[0]+j.FORWARD_SLASH_STRING+t[2]},Q="SET_PROPERTY",Z="REPLACE_PROPERTY",ee="FIELD_CHANGE",te="LOAD_VIEW",ne="SHOW_PAGE",re="SHOW_DATA",se="SHOW_INSIGHT",ae="SHOW_DASHBOARD",oe="SET_LOADING",ie="RESET_LOADING",ce="SET_SHARED_PROPERTY",le="CREATE_WORK",ue="OPEN_WORK_BY_HANDLE",de="UPDATE_DOCUMENT",pe="FINISH_ASSIGNMENT",he="CANCEL_ASSIGNMENT",ge="OPEN_ASSIGNMENT",fe="MERGE_DATA",me="REMOVE_ITEM",ye="GET_DATAOBJECT_ACTIONS",Ie="SHOW_HISTORY",Ee="ERROR",Ae="INIT_CONTAINERS",_e="RESET_CONTAINERS",Ce="ADD_CONTAINER_ITEM",Se="REMOVE_CONTAINER_ITEM",Te="ADD_TRANSIENT_ITEM",Ne="UPDATE_TRANSIENT_DATA",Pe="REMOVE_TRANSIENT_ITEM",Re="REMOVE_ALL_TRANSIENT_ITEMS",De="CLEAR_TRANSIENT_DATA",be="PURGE_TRANSIENT_DATA",Oe="REPLACE_TRANSIENT_DATA",ve="ACTIVATE_CONTAINER_ITEM",xe="UPDATE_CONTAINER_ITEM",we="UPMERGE_AND_REMOVE_CONTAINER_ITEM",Me="REPLACE_CONTAINER_ITEM",Le="ACTIVATE_MODAL_CONTAINER_ITEM",Ue="REMOVE_CONTAINER",Fe="ADD_SUGGESTION_CONTEXT",je="showView",Ve="showData",ke="showInsight",$e="showDashboard",Be="openWorkByHandle",Ge="openAssignment",We="createNewWork",He="SHOW_CANCEL_ALERT",qe="openLocalAction",ze="openProcessAction",Ye="caseWideActions",Ke="openBulkAction",Xe="performBulkAction",Je="ADD_MESSAGES",Qe="CLEAR_MESSAGES",Ze="RESET_STORE",et="FETCH_DATAPAGE",tt="ADD_SHARED_DATA",nt="REMOVE_SHARED_DATA",rt="LIST_ACTION",st="DELETE_CASE_SUMMARY",at="ALTER_BLOCKING_ACTION_COUNT",ot="CREATE_DATA_OBJECT",it="DELETE_DATA_OBJECT",ct="VIEW_DATA_OBJECT",lt="UPDATE_DATA_OBJECT",ut="OPEN_DATA_OBJECT_ACTION",dt="SUBMIT_DATA_OBJECT_ACTION",pt="OPEN_EMBEDDED_DATA_MODAL",ht="SUBMIT_EMBEDDED_DATA_MODAL",gt="FILL_FORM_WITH_AI",ft="openCase",mt=(e,t)=>{if(!e||!t)return null;let n,r=j.EMPTY_STRING;return t&&(r=`${t}${j.FORWARD_SLASH_STRING}${e}`,n=rd(r),n||t.includes("/")?n||(r=mt(e,W(t))):r=`${t}${j.FORWARD_SLASH_STRING}${e}`),r},yt=(e,t)=>{const n=mt(e,t);return n&&rd(n)?rd(n):{}},It=(e,t)=>lp.getSemanticURL(je,{page:e},t);const Et=new class{error=e=>{console.error(e)}};class At{constructor(e,t,n){this._grammar=e,this._state="expectOperand",this._tree=null,this._exprStr=t||"",this._endState=n||{}}static _setParent(e,t){Object.defineProperty(e,"_parent",{value:t,writable:!0})}_addToken(e){const t=Dt[this._state],n=this._exprStr;if(this._exprStr+=e.element,t.subHandler){this._subParser||this._startSubExpression(n);const t=this._subParser._addToken(e);t&&(this._endSubExpression(),this._state=t)}else{if(!t.operatorTypes[e.tokenType]){if(this._endState[e.tokenType])return this._endState[e.tokenType];throw new Error(`Token ${e.element} (${e.tokenType}) unexpected in expression: ${this._exprStr}`)}{const n=t.operatorTypes[e.tokenType],r=Rt[e.tokenType];r&&r.call(this,e),n.toState&&(this._state=n.toState)}}return!1}addTokens(e){e.forEach(this._addToken,this)}buildAst(){return this._subParser&&this._endSubExpression(),this._state="complete",this._position?this._tree:null}_startSubExpression(e){const{endStates:t}=Dt[this._state];this._subParser=new At(this._grammar,e,t)}_endSubExpression(){Dt[this._state].subHandler.call(this,this._subParser.buildAst()),this._subParser=null}setPositionInAST(e){this._position?(this._position.right=e,At._setParent(e,this._position)):this._tree=e,this._position=e}}const _t=At,Ct="identifier",St={operatorType:"binaryOperator",precedence:1,evaluate:(e,t)=>e&&t},Tt={operatorType:"binaryOperator",precedence:1,evaluate:(e,t)=>e||t},Nt={">":{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>e>t},">=":{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>e>=t},"<":{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>e<t},"<=":{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>e<=t},"==":{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>e===t},"!=":{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>e!==t},"!":{operatorType:"unaryOperator",precedence:999,evaluate:e=>{let{value:t}=e;return"true"!==t&&"false"!==t||(t="true"===t),!t}},"(":{operatorType:"openParenthesis"},")":{operatorType:"closeParenthesis"},"&&":St,AND:St,and:St,"||":Tt,OR:Tt,or:Tt,CONTAINS:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>e.includes(t)},NOT_CONTAINS:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>!e.includes(t)},STARTS_WITH:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>e.startsWith(t)},NOT_STARTS_WITH:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>!e.startsWith(t)},ENDS_WITH:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>e.endsWith(t)},NOT_ENDS_WITH:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>!e.endsWith(t)},IS_NULL:{operatorType:"binaryOperator",precedence:2,evaluate:e=>!e},IS_NOT_NULL:{operatorType:"binaryOperator",precedence:2,evaluate:e=>!!e},IS_IN_LIST:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>t.split(",").includes(e)},IS_NOT_IN_LIST:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>!t.split(",").includes(e)}},Pt={BinaryExpression:function(e){const t=[];let n="";return t[0]=this.evaluateAST(e.left),e.left.operationType===Ct&&this._context&&(n=this._context.getFieldMetadata(e.left.value.substring(1))?.type??""),t[1]=e.right?this.evaluateAST(e.right,n):"",this._grammar[e.operator].evaluate(t[0],t[1])},identifier:function(e){return this._localDataObject?this._localDataObject[e.value.substring(1)]??"":this._contextTreeNodeContext?Rh.getLitePropertyValue(this._contextTreeNodeContext,e.value):this._context.getValue(e.value)??""},literal:function(e,t){return!(void 0===t||""===t||"True-False"===t)||"true"!==e.value&&"false"!==e.value?e.value:"true"===e.value},UnaryExpression:function(e){return this._grammar[e.operator].evaluate(e.right)}},Rt={unaryOperator:function(e){this.setPositionInAST({operationType:"UnaryExpression",operator:e.value})},binaryOperator:function(e){const{precedence:t}=this._grammar[e.value];let n=this._position._parent;for(;n&&n.operator&&this._grammar[n.operator].precedence>=t;)this._position=n,n=n._parent;const r={operationType:"BinaryExpression",operator:e.value,left:this._position};_t._setParent(this._position,r),this._position=n,this.setPositionInAST(r)},identifier:function(e){const t={operationType:Ct,value:e.value};this.setPositionInAST(t)},literal:function(e){this.setPositionInAST({operationType:"literal",value:e.value})},subExpression:function(e){this.setPositionInAST(e)}},Dt={expectOperand:{operatorTypes:{literal:{toState:"expectBinOp"},identifier:{toState:Ct},unaryOperator:{},openParenthesis:{toState:"subExpression"}}},expectBinOp:{operatorTypes:{binaryOperator:{toState:"expectOperand"}}},identifier:{operatorTypes:{binaryOperator:{toState:"expectOperand"}}},subExpression:{subHandler:Rt.subExpression,endStates:{closeParenthesis:"expectBinOp"}}},bt=["binaryOperator","unaryOperator","openParenthesis"],Ot=/^\s*$/,vt=/^[a-zA-Z_.$][(0-9)a-zA-Z0-9_.$]*$/,xt=/\\\\/,wt=["'(?:(?:\\\\')|[^'])*'",'"(?:(?:\\\\")|[^"])*"',"\\s+","\\btrue\\b","\\bfalse\\b"],Mt=["[a-zA-Z_.\\$][(0-9)a-zA-Z0-9_.\\$]*","[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}|[0-9]{4}-[0-9]{2}-[0-9]{2}","(?:(?:[0-9]*\\.[0-9]+)|[0-9]+)"],Lt=/^-?(?:(?:[0-9]*\.[0-9]+)|[0-9]+)$/;class Ut{constructor(e){this._grammar=e}static _isNegative(e){return bt.some((t=>t===e[e.length-1].tokenType))}static _isWhitespace(e){return!!e.match(Ot)}static _createWordboundary(e){return(e=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).match(vt)&&(e=`\\b${e}\\b`),e}static _unquote(e){const[t]=e,n=new RegExp(`\\\\${t}`,"g");return e.substr(1,e.length-2).replace(n,t).replace(xt,"\\")}_getSplitRegex(){if(!this._splitRegex){const e=Object.keys(this._grammar).sort(((e,t)=>t.length-e.length)).map((e=>Ut._createWordboundary(e)),this);this._splitRegex=new RegExp(`(${[wt.join("|"),e.join("|"),Mt.join("|")].join("|")})`)}return this._splitRegex}_splitExpression(e){const t=this._getSplitRegex();return e.split(t).filter((e=>e))}_createToken(e){const t={tokenType:"literal",value:e,element:e};return'"'===e[0]||"'"===e[0]?t.value=Ut._unquote(e):e.match(Lt)?t.value=parseFloat(e):"true"===e||"false"===e?t.value="true"===e:this._grammar[e]?t.tokenType=this._grammar[e].operatorType:e.match(vt)&&(t.tokenType="identifier"),t}_getTokens(e){const t=[];let n=!1;for(let r=0;r<e.length;r+=1)Ut._isWhitespace(e[r])?t.length&&(t[t.length-1].element+=e[r]):"-"===e[r]&&Ut._isNegative(t)?n=!0:(n&&(e[r]=`-${e[r]}`,n=!1),t.push(this._createToken(e[r])));return t}tokenize(e){const t=this._splitExpression(e);return this._getTokens(t)}}const Ft=Ut;const jt=class{constructor(e,t){this._grammar={...Nt},this._expression=e,this._ast=null,this._context={},this._contextTreeNodeContext=null,this._localDataObject=t}buildAST(){const e=new Ft(this._grammar).tokenize(this._expression),t=new _t(this._grammar);return t.addTokens(e),this._ast=t.buildAst(),this}evaluate(e,t){return this._context=e,this._contextTreeNodeContext=t,this.evaluateAST(this._ast)}evaluateAST(e,t){return Pt[e.operationType].call(this,e,t)}},Vt=(e,t)=>{const n=e.replace(/[a-zA-Z0-9_)"'\s]=[a-zA-Z0-9_("'\s]/,(e=>e.replace("=","==")));return new jt(n,t)},kt=e=>!e||e.buildAST(),$t=(e,t,n)=>!e||e.evaluate(t,n),Bt=(e,t,n)=>{const r=Vt(e,t),s=kt(r);return $t(s,n)};const Gt=class{static handleExpression(e,t,n,r){const s=this.getContext(e,r);A({actionObject:{action:"decexp",params:{source:e,value:t,targets:n},context:s}}).then((e=>e.json())).then((e=>{this.updateState(e,r)})).catch((e=>window.console.log(e)))}static getContext(e,t){const n=e.substring(0,e.indexOf("."));return{name:n,class:Rh.getPropertyValue(`${n}.pxObjClass`,null,t)||Rh.getPropertyValue(`${n}.pyClassName`,null,t)}}static updateState(e,t){Object.keys(e).forEach((n=>ih({type:Q,payload:{context:t,reference:n,value:e[n]}})))}},Wt={},Ht=(e,t)=>Wt[t]&&Object.prototype.hasOwnProperty.call(Wt[t],e),qt=e=>{const{context:t}=e;Ht(e.reference,t)&&Gt.handleExpression(e.reference,e.value,Wt[t][e.reference],t)},zt=(e={})=>{Sh.copy(e,Wt)},Yt=(e,t,n)=>Bt(e,t,n?.pConnect.getPConnect());const Kt=new class{constructor(){this._dataSourceMap={}}hasContextName(e){return e in this._dataSourceMap}addContextName(e,t){t&&Object.keys(t).length>0?this._dataSourceMap[e]=t:this._dataSourceMap[e]={}}getContextObjectByName(e){return e in this._dataSourceMap?this._dataSourceMap[e]:null}deleteContextName(e){this.hasContextName(e)&&delete this._dataSourceMap[e]}addOrUpdatePropertyInContext(e,t,n){if(this.hasContextName(e)){const r=this.getContextObjectByName(e);if(r)if(Array.isArray(n))r[t]=n;else{const e=r[t];r[t]=[...new Set([...e,n])]}}else{const r={};Array.isArray(n)?r[t]=n:r[t]=[n],this.addContextName(e,r)}}deletePropertyInContext(e,t){if(this.hasContextName(e)){const n=this.getContextObjectByName(e);n&&t in n&&delete n[t]}}getPropertyFromContext(e,t){if(this.hasContextName(e)){const n=this.getContextObjectByName(e);if(n&&t in n)return n[t]}return[]}getDependencies(e,t){const n=this.getPropertyFromContext(e,t),r=new Set(n);return n.forEach((e=>{r.add(e)})),[...r]}};const Xt=new class{constructor(){this.componentMap={},this.overrideMap={},this.lazyMap={},this.customComponentLazyMap={}}register(e,t){this.componentMap[e]=t}registerLazyMap(e,t){this.lazyMap[e]=t}registerCustomComponentLazyMap(e,t){this.customComponentLazyMap[e]=t}getComponent(e){return this.componentMap[e]}getLazyComponent(e){return this.lazyMap[e]}getCustomComponent(e){return this.customComponentLazyMap[e]}mergeComponentsMap(e={}){Sh.copy(e,this.componentMap)}mergeOverrideMap(e={}){Sh.copy(e,this.overrideMap)}getOverrideMap(){return this.overrideMap}getLazyMap(){return this.lazyMap}};const Jt=new class{constructor(){this.handlers={}}registerHandler(e,t){this.handlers[e]=t}getHandler(e){return this.handlers[e]}};const Qt=class{static handleAnnotation(e,t,n){const r=e.indexOf(" "),s=-1===r?e:e.substring(0,r),a=Jt.getHandler(s);return a?a(e.substring(r+1),t,n):e}static trimAnnotation(e){if("string"!=typeof e)return e;const t=e.indexOf(" "),n=e.substring(0,t),r=e.substring(t+1);return Jt.getHandler(n)?r:e}static handleComponentMapping(e,t,n){const r=Xt.getComponent(t.type);if(!r||!r.mapping)return;const s=r.mapping(t.config);if(s&&s["@map"]){const t=s["@map"],{source:r}=t;if(!r)return;const a=n.getValue(r);if("function"==typeof t.advanced)t.advanced(e,a);else{const n=t.inputs_map;e[t.output_property]=[];const r=e[t.output_property];a.forEach((e=>{const t={};Object.keys(n).forEach((r=>{let s=n[r];s&&0===s.indexOf(".")?(s=s.substring(1),t[r]=e[s]):t[r]=s})),r.push(t)}))}}}static getPropertyName(e=""){if(e&&Sh.isString(e)){const t=e.startsWith(j.PROPERTY_ANNOTATION)||e.startsWith(j.ATTACHMENT_ANNOTATION)||e.startsWith(j.ASSOCIATED_PROPERTY_ANNOTATION),n=t?e.indexOf(" "):-1;return t?e.substring(n+2):e}return e}static getLeafPropertyName(e){if(Sh.isString(e)&&!!e?.startsWith(j.PROPERTY_ANNOTATION)){const t=this.getPropertyName(e),n=t.split(".");return n.length<2?t:n.pop()}return e}static isProperty(e){return Sh.isString(e)&&!!e?.startsWith(j.PROPERTY_ANNOTATION)}},Zt=e=>{if(e){const{stageID:t,stages:n=[]}=e,r=n.length;for(let e=0;e<r;e+=1){if(n[e].ID===t)return"create"===n[e].transitionType&&"active"===n[e].visited_status}}return!1},en=(e,t)=>{if(e&&t){const n=Sh.getIn(t,["assignments","0","assigneeInfo"],{}),{ID:r,type:s}=n;return"worklist"===s?.toLowerCase()&&r===e}return!1},tn=e=>{const{activeActionID:t,availableActions:n}=e||{};if(t&&n){const e=n.find((e=>e.ID===t));return Boolean(e)}return!1},nn=(e,t)=>{const n=Rh.getPropertyValue(F.CASE_INFO.ACTIVE_ACTION_ID,t,e),r=Rh.getPropertyValue(F.CASE_INFO.AVAILABLEACTIONS,t,e);let s=!1;if(r&&n){const e=r.find((e=>e.ID===n));e&&(s=e.type.toLowerCase()===F.LOCAL_ACTION_TYPE.CASE_WIDE.toLowerCase())}if(e&&!r){const t=ch(e);s=t?.context_data?.actionType===j.CASE}return s},rn=e=>ph(null,j.CASE_VIEW_MODE_PROP,e)===j.PERFORM_MODE&&(e.includes(j.WORKAREA)||e.includes(j.MODAL)),sn=e=>{const t=e?.parentCaseInfo?.ID;return Boolean(e&&t)},an=(e,t,n)=>{let r;const s=e?.find((e=>e.ID===t))?.actions,a=s?.filter((e=>e.ID===j.FIX_BROKEN_ASSIGNMENTS))||[];return r=n&&a?.length>0?a[0].ID:n||((e,t)=>{if(!Array.isArray(e)||!t)throw new Error("Invalid parameters passed to getAssignmentActionID API");return e.find((e=>e.ID===t))?.actions?.[0]?.ID})(e,t),r},on=(e,t,n)=>{let r,s,a,o,i,c,l,u,d;const p=ch(e);return n?.isTriggeredFromDifferentContext?(r=p.caseInfo.assignments[0].ID,s=p.caseInfo.ID,a=p.caseInfo.assignments,o=p.caseInfo.activeActionID,i=p.caseInfo.availableActions,c=p.caseInfo,l=p.caseInfo.businessID,u=p.caseInfo.caseTypeID,d=p.caseInfo.caseTypeName):(r=t.getValue(F.CASE_INFO.ASSIGNMENT_ID),s=t.getValue(F.CASE_INFO.CASE_INFO_ID),a=t.getValue(F.CASE_INFO.ASSIGNMENTS),o=t.getValue(F.CASE_INFO.ACTIVE_ACTION_ID),i=t.getValue(F.CASE_INFO.AVAILABLEACTIONS),c=t.getValue(F.CASE_INFO.CASE_INFO),l=t.getValue(F.CASE_INFO.BUSINESS_ID),u=t.getValue(F.CASE_INFO.CASE_TYPE_ID),d=t.getValue(F.CASE_INFO.CASE_TYPE_NAME)),{assignmentID:r,caseID:s,assignments:a,localActionID:o,caseActions:i,caseInfo:c,businessID:l,caseTypeID:u,caseTypeName:d}};const cn=new class{constructor(){this.contextArray={},this.pauseDuration=2e3,this.waitingToPutUpIndicator=!1}getLoadingContext(e){let t=null;return e&&(({context:t}=e),t||(t=e.containerItemID),t||(t=e.contextName)),t}enableLoadingIndicator(e,t=!0){const n=this.getLoadingContext(e);n&&(this.addToContextArray(n),this.waitingToPutUpIndicator||(this.waitingToPutUpIndicator=!0,this.pauseBeforeShowing(n).then((e=>{t&&void 0!==this.contextArray[e]&&this.contextArray[e]>0&&ih({type:oe,payload:{context:e}})}))))}pauseBeforeShowing=e=>new Promise((t=>setTimeout((()=>t(e)),this.pauseDuration)));disableLoadingIndicator(e,t=!0){const n=this.getLoadingContext(e);n&&(this.waitingToPutUpIndicator=!1,this.removeFromContextArray(n),t&&void 0!==this.contextArray[n]&&0===this.contextArray[n]&&ih({type:ie,payload:{context:n}}))}addToContextArray=e=>{void 0===this.contextArray[e]&&(this.contextArray[e]=0),this.contextArray[e]+=1};removeFromContextArray=e=>{void 0!==this.contextArray[e]&&this.contextArray[e]>0&&(this.contextArray[e]-=1)}};const ln=new class{constructor(){this.counterActionMgrId=0,this.actionMgrActions={}}getNextActionMgrId(){return this.counterActionMgrId+=1,this.counterActionMgrId.toString()}register(e,t,n,r,s="unknown",a,o=!0){if(void 0!==this.actionMgrActions[e])return null;const i={actionType:s,promise:t,resolve:n,reject:r,actionPayload:a};return this.actionMgrActions[e]=i,o&&cn.enableLoadingIndicator(i.actionPayload),e}actionManagerPromise=(e,t="")=>{let n,r;""===t&&(t=this.getNextActionMgrId());const s=new Promise(((e,t)=>{n=e,r=t}));if(!n||!r)throw new Error("resolveFn or rejectFn is not defined.");return this.register(t,s,n,r,e),{actionMgrID:t,promise:s}};resolveActionByID(e,t,n=!0){const r=this.actionMgrActions[e];let s=e;return r?(setTimeout((()=>{r.resolve(t)}),0),cn.disableLoadingIndicator(r.actionPayload,n)):s=null,s}rejectActionByID(e,t=!0,n){const r=this.actionMgrActions[e];let s=e;return r?(r.reject(n),cn.disableLoadingIndicator(r.actionPayload,t)):s=null,s}};class un{constructor(e,t,n={}){this.type=e,this.name=t,this.parent=null,this.children=[],this.eventSubscribers=[],this.value="",this.previousValue="|~#-old-#~|",this.props=n,this.references=new Map}addReference(e,t){this.references.set(e,t)}getReference(e){return e?this.references.get(e):void 0}getNode(e,t,n){return this.children.find((r=>r.type===e&&r.name===t&&r.props.index===n))}addNode(e,t,n={}){let r=this.getNode(e,t,n.index);return r?r.props=n:(r=new un(e,t,n),r.parent=this,this.children.push(r)),r}addEventListener(e){this.eventSubscribers.push(e)}triggerEvent(e,t=!1){this.eventSubscribers.forEach((t=>{t(e)})),!t&&this.parent&&this.parent.triggerEvent(e)}setPreviousDefaultValue(){"|~#-old-#~|"===this.previousValue&&(this.previousValue=this.value)}removeReference(e,t){const n=this.references.get(e);n?.props?.index===t&&this.references.delete(e)}removeChildNode(e){const t=this.children.findIndex((t=>t.name.startsWith(e)));-1!==t&&this.children.splice(t,1)}removeChildren(){this.children.splice(0,this.children.length)}removeNode(e,t){for(let n=this.children.length-1;n>=0;n-=1){const r=this.children[n];if(r.props.index===t&&r.name===e){this.children.splice(n,1);break}}}}const dn=un;const pn=class{constructor(e,t,n,r={}){this.type=F.CONTEXT_TREE_NODE_TYPES.WHEN,this.subType=e,this.referenceName=t,this.name=n,this.props=r}},hn=/(([^.]+)\[\d+\])/g,gn=e=>{if((e?.split(".")??[]).length<3)return[e];const t=e?.match(hn);if(!t)return[e];let n,r=t[t.length-1];return e=e?.split(r)[0],e=e?.substring(0,e.length-1),[r,n]=r.split("["),n=n?.split("]")[0],[e,r,n]},fn=(e,t)=>{if(!e.startsWith(t))return-1;const n=e.slice(t.length).match(/\[([0-9]+)\]/);return n?parseInt(n[1],10):-1},{FIELD:mn,WHEN:yn,DECLARATIVE_TARGET:In,PAGELIST:En}=j.CONTEXT_TREE_NODE_TYPES;const An=class{constructor(e,t,n={}){this.type=e,this.name=t,this.children=[],this.eventSubscribers=[],this.props=n,this.references=new Map([[mn,new Map],[yn,new Map],[In,new Map]])}addReference(e,t){if(this.references.has(t.type)){const n=this.references.get(t.type);n.set(e,t),this.references.set(t.type,n)}else{if(t.type===En){const n=this.references.get(mn);n.set(e,t),this.references.set(mn,n)}}}removePageListNodes(e,t){const n=this.children.filter((t=>t.name.startsWith(e))).filter((n=>{const r=fn(n.name,e);return-1!==r&&+r>=t}));n.length>0&&n.forEach((e=>{this.removeChildNode(e.name,t)}))}removeChildNode(e,t){const n=this.children.findIndex((t=>t.name.startsWith(e)));if(-1!==n){const[t]=this.children.splice(n,1),r=t?.parent;r?.removeChildNode(e)}const r=this.references.get(mn),s=this.references.get(In);[...r.keys(),...s.keys()].filter((t=>t.startsWith(e))).filter((e=>{const[,,n]=gn(e);return+n>=t})).forEach((e=>{const t=r.get(e).parent;t?.removeChildren(),r.delete(e)}))}getReference(e,t){if(this.references.has(t))return this.references.get(t)?.get(e)}getNode(e,t,n){return this.children.find((r=>r.type===e&&r.name===t&&r.props.index===n))}addNode(e,t,n={}){let r=this.getNode(e,t,n.index);return r?r.props=n:(r=new dn(e,t,n),r.parent=this,this.children.push(r)),r}addEventListener(e){this.eventSubscribers.push(e)}triggerEvent(e){this.eventSubscribers.forEach((t=>{t(e)}))}removeReference(e,t,n){const r=this.references.get(t),s=r?.get(e);s?.props?.index===n&&r.delete(e)}removeNode(e,t){for(let n=this.children.length-1;n>=0;n-=1){const r=this.children[n];if(r.props.index===t&&r.name===e){this.children.splice(n,1);break}}}addWhen(e,t,n,r,s){if(!(n&&r&&e&&t))return;n.startsWith(".")&&(n=n.substring(1));const a=`${e}.${n}.${r}`,o=new pn(t,n,r,s),i=this.references.get("WHEN");i?.set(a,o)}},{VIEW:_n,FIELD:Cn,CONTEXT:Sn,DECLARATIVE_TARGET:Tn,WHEN:Nn}=F.CONTEXT_TREE_NODE_TYPES;const Pn=new class{constructor(){this.rootNodes={}}_isContextNodeExist(e){return Object.keys(this.rootNodes).includes(e)}addContextNode(e){if(!this._isContextNodeExist(e)){const t=new An(Sn,e);this.rootNodes[e]=t}return this.rootNodes[e]}getContextNode(e){return e?this.rootNodes[e]:void 0}addPageNode(e,t){return this.addContextNode(e).addNode("PAGE",t)}_addParentViewNode(e,t,n){const r=this.addContextNode(e).addNode("PAGE",t);let s=r.getReference(n);return s||(s=r.addNode("VIEW",n),r.addReference(n,s)),s}pushChildPageNodeToParentView(e,t,n){const r=e.children;let s=!1;if(r)for(let e=0;e<r.length;e+=1)if(r[e].name===n){s=!0;break}s||r.push(t),t.parent=e}addViewNode(e,t,n,r){const s=this.addContextNode(e).addNode("PAGE",t);let a=null;if(r&&n!==r){a=this._addParentViewNode(e,t,r).addNode("VIEW",n)}else a=s.addNode("VIEW",n);s.addReference(n,a);const o=t.split(".");for(;o.length>0;){o.pop();const n=o.join("."),a=this.getContextNode(e)?.getNode("PAGE",n),i=a?.getReference(r);if(i){this.pushChildPageNodeToParentView(i,s,t);break}}return a}getViewNode(e,t,n){return this.getContextNode(e)?.getNode("PAGE",t)?.getReference(n)}addPageListNode(e,t,n,r,s){if(!r)return;r.startsWith(".")&&(r=r.substring(1));const a=this.addContextNode(e),o=a.addNode("PAGE",t)?.getReference(n)?.addNode("PAGELIST",`${t}.${r}`,s);return o&&a.addReference(`${t}.${r}`,o),o}updatePageListNode(e,t,n,r){if(!n)return;n.startsWith(".")&&(n=n.substring(1));this.addContextNode(e).removePageListNodes(`${t}.${n}`,r)}removeFieldNode(e,t,n,r,s){const a=this.getContextNode(e);a?.getNode("PAGE",t)?.getReference(n)?.removeNode(`${t}${r}`,s),a?.removeReference(`${t}${r}`,Cn,s),a?.removeReference(`${t}${r}`,Tn,s)}removeViewNode(e,t,n,r){const s=this.getContextNode(e),a=s?.getNode("PAGE",t),o=a?.getReference(n);this.removeChildViewNodes(e,t,n,r);const i=o?.parent?.children?.findIndex((e=>e.name===n))??-1;i>-1&&o?.parent?.children.splice(i,1)}removeChildViewNodes(e,t,n,r){const s=this.getContextNode(e),a=s?.getNode("PAGE",t),o=a?.getReference(n);o?.children.forEach((a=>{"PAGE"===a.type?this.removeViewNode(e,a.name,n,r):a.type===_n?this.removeChildViewNodes(e,t,a.name,r):(s.removeReference(a.name,Cn,a.props.index),s.removeReference(a.name,Tn,a.props.index),"PAGELIST"!==a.type&&"Address"!==a.props?.componentName||this.deleteAllListNodes(e,a.name))})),a?.references.delete(n)}deleteAllListNodes(e,t){const n=n=>{const r=this.getContextNode(e),s=r?.references?.get(n);if(s)for(const[e]of s)(e===t||e.startsWith(`${t}.`)||e.startsWith(`${t}[`))&&r?.references?.get(n)?.delete(e)};n(Cn),n(Tn)}deleteListNode(e,t,n){const r=r=>{const s=this.getContextNode(e),a=s?.references?.get(r);if(a)for(const[e]of a)e.includes(`${t.join(".")}[${n}]`)&&s?.references?.get(r)?.delete(e)};r(Cn),r(Tn)}getPageListNode(e,t,n,r){const s=this.getContextNode(e)?.getNode("PAGE",t)?.getReference(n);return s?.children.find((e=>"PAGELIST"===e.type&&e.name===`${t}.${r}`))}getFieldNode(e,t,n,r){return this.getViewNode(e,t,n)?.getNode(Cn,r)}_findViewNode(e,t,n,r){let s=r.addNode("PAGE",t)?.getReference(n);if(s)return s;const a=t.split(".");for(;a.length>0;){a.pop();const e=a.join(".");if(s=r.addNode("PAGE",e)?.getReference(n),s)return s}return this.addViewNode(e,t,n)}addFieldNode(e,t,n,r,s,a={}){const o=this.addContextNode(e),i=this._findViewNode(e,t,n,o),{isDeclarativeTarget:c}=a;let l;if(l=c?i.addNode(Tn,`${t}${r}`,a):i.addNode(Cn,`${t}${r}`,a),l){const n=`${t}${r}`;if("Address"===l.props?.componentName&&this.deleteAllListNodes(e,l.name),o.addReference(n,l),l.value=s,l.setPreviousDefaultValue(),l.props.isInsideList){const e=t.substring(0,t.lastIndexOf("["));let n=o.getReference(e,Cn);n||(n=i.addNode(Cn,e,{}),o.addReference(e,n))}}return l}removeContextTreeNode(e){delete this.rootNodes[e]}onViewMutate(e,t,n,r){this.getViewNode(e,t,n)?.addEventListener(r)}mutateField(e,t,n,r){const s=this.getContextNode(e),[a,o,i]=gn(t);n.startsWith(".")&&(n=n.substring(1)),o&&this.mutatePageList(e,a,o,{...r,rowIndex:i},!0);const c=s?.getReference(`${t}.${n}`,Cn);c&&c instanceof dn&&c.triggerEvent(r)}onPageListMutate(e,t,n,r,s){this.getPageListNode(e,t,n,r)?.addEventListener(s)}mutatePageList(e,t,n,r,s=!1){const a=this.getContextNode(e),o=a?.getReference(`${t}.${n}`,Cn);o&&o instanceof dn&&o.triggerEvent(r,s)}getFieldsList(e){const t=this.getContextNode(e);return t?.references.get(Cn)}getFieldReferenceForProperty(e,t){return this.getContextNode(e)?.references?.get(Cn)?.get(t)}getFieldReferencePreviousValue(e,t){let n=this.getContextNode(e)?.references?.get(Cn)?.get(t);return n||(n=this.getContextNode(e)?.references?.get(Tn)?.get(t)),n?.value}updateFieldNodeValue(e,t,n){const r=this.getContextNode(e)?.references?.get(Cn)?.get(t);r instanceof dn&&r&&(r.previousValue=r.value,void 0===r.value&&(r.previousValue=n),r.value=n)}getContextReferences(e){if(!this.getContextNode(e))return;const t=this.getContextReferencesByType(e,Cn),n=this.getContextReferencesByType(e,Tn);return new Map([...t.entries(),...n.entries()])}getContextReferencesByType(e,t){return this.getContextNode(e)?.references.get(t)||new Map}isFieldExists(e,t){return!!this.getContextReferencesByType(e,Cn)?.get(t)||!!this.getContextReferencesByType(e,Tn)?.get(t)}addWhenNode(e,t,n,r,s,a){const o=this.getContextNode(e);o?.addWhen(t,n,r,s,a)}getDeclarativeTargets(e){const t=this.getContextNode(e),n=t?.references?.get(Tn)||new Map,r=[];return n.forEach((e=>{const t=e?.props||{},{propertyName:n=""}=t,s=t.pageReference??F.CASE_INFO.CASE_INFO_CONTENT;r.push({pageReference:s,name:n})})),r}getWhens(e){const t=this.getContextNode(e),n=t?.references?.get(Nn)||new Map,r=[];return n.forEach((e=>{const t=e.subType,n=e.referenceName,s=e.name,a=e?.props?.pageReference??F.CASE_INFO.CASE_INFO_CONTENT;r.push({name:s,pageReference:a,referenceName:n,type:t})})),r}},Rn={REFRESH_DATA:"REFRESH_DATA",WHENS:"WHENS",DECLARE_EXPRESSIONS:"DECLARE_EXPRESSIONS",REFRESH:"refresh",REFRESH_CASE_DATA:"refreshCaseData",REFRESH_ASSIGNMENT_DATA:"refreshAssignmentData",REFRESH_CASE_VIEW:"refreshCaseView",RECALCULATE:"recalculate",RECALCULATE_CASE_DATA:"recalculateCaseData",RECALCULATE_ASSIGNMENT_DATA:"recalculateAssignmentData"},Dn=e=>({type:Rn.REFRESH_DATA,payload:e}),bn={},On=(e,t,n,r,s)=>{if(!(e&&n&&t))return;const a=s.actionMgrID||ln.getNextActionMgrId(),o={ID:e,actionID:t,context:n,caseWideAction:r,options:{...s,actionMgrID:a}};s.isFillFormWithAI?ih((e=>({type:gt,payload:e}))(o)):ih(Dn(o))},vn=(e,t,n,r,s)=>{if(!(e&&n&&t))return;r&&(r=Sh.convertPageRefToClipboardPageNotation(r));ih(Dn({ID:e,viewID:t,context:n,options:s,caseViewAction:!0,interestPage:r}))},xn=(e,t,n)=>{bn[t]||(bn[t]={}),e&&!bn[t][e]&&(bn[t][e]={pageReference:n})},wn=(e,t)=>{const n={pageName:(r=t.substring(t.lastIndexOf(" ")+1)).substring(0,r.lastIndexOf(".")),propertyName:r.substring(r.lastIndexOf(".")+1)};var r;const s=Mp(n.propertyName,e.getValue(j.CLASS_ID,n.pageName));return!!s?.isDeclarativeTarget},Mn=e=>{let t=!1;if(e.isWhenExist())t=!0;else{const n=e.getRawMetadata()?.config?.value;if(n){const r=Mp(Qt.getLeafPropertyName(n),Rh.resolveClassID(n,e.getPageReference(),e.getContextName()));t=!!r?.isDeclarativeTarget,!t&&r?.datasource?.parameters&&(t=((e,t)=>{let n=!1;if(Array.isArray(t)){const r=t=>{const r=t.value;return r.startsWith("@P")&&(n=wn(e,r)),n};t.some(r)}else if("object"==typeof t)for(const r in t)if(t[r].startsWith("@P")&&(n=wn(e,t[r]),n))break;return n})(e,r?.datasource?.parameters)),t||(t=r?.datasource?.tableType===j.DECISION)}}t&&xn(e.getCurrentView(),e.getContextName(),e.getPageReference())},Ln=(e,t,n)=>{const r=nn(e,t),s=Rh.getPropertyValue(F.CASE_INFO.ACTIVE_ACTION_ID,t,e)?Rh.getPropertyValue(F.CASE_INFO.ACTIVE_ACTION_ID,t,e):Rh.getPropertyValue(F.CASE_INFO.ASSIGNMENTACTION_ID,t,e);let a;a=r?Rh.getPropertyValue(F.CASE_INFO.CASE_INFO_ID,t,e):Rh.getPropertyValue(F.CASE_INFO.ASSIGNMENT_ID,t,e)?Rh.getPropertyValue(F.CASE_INFO.ASSIGNMENT_ID,t,e):Rh.getPropertyValue(F.CONTEXT_DATA_ASSIGNMENTID,t,e),On(a,s,e,r,n)},Un=e=>{const{context:t,pageReference:n}=e,r=(e=>bn[e]&&Object.keys(bn[e]).length>0&&rn(e))(t);if(!r)return;if(Rh.getPropertyValue(j.CONTEXT_DATA_MODAL_VIEW.IS_MULTI_RECORD_DATA,n,t)){const e=Rh.getPropertyValue(F.CASE_INFO.CASE_INFO_ID,n,t),r=Rh.getPropertyValue(j.CONTEXT_DATA_MODAL_VIEW.VIEW_NAME,n,t),s=Rh.getPropertyValue(j.CONTEXT_DATA_MODAL_VIEW.INTERESTPAGE,n,t);vn(e,r,t,s,{})}else Ln(t,n,{})},Fn=(e,t)=>{const{requestType:n}=e;return e?.options?.refreshFor&&"refresh"===n&&(t+=`?refreshFor=${e?.options?.refreshFor}`),e?.options?.isFillFormWithAI&&"refresh"===n&&(t+="?fillFormWithAI=true"),t},jn=e=>{const t=(e=>{const t=[];return Pn.getDeclarativeTargets(e).forEach((({name:e,pageReference:n})=>{const r=n.split(".");r.shift();let s=r.join(".");e&&s&&(s=Sh.convertPageRefToClipboardPageNotation(s),t.push({name:e,context:s}))})),t})(e),n=(e=>{const t=[];return Pn.getWhens(e).forEach((({name:e,type:n,pageReference:r})=>{const s=r.split(".");s.shift();let a=s.join(".");e&&a&&(a=Sh.convertPageRefToClipboardPageNotation(a),t.push({name:e,context:a,type:n}))})),t})(e);return{fieldsWithDeclarativeTargets:t,whens:n}},Vn=(e,t)=>{const n=e.url?.includes("/refresh?refreshFor="),r=t.url?.includes("/refresh?refreshFor="),s=e.url?.endsWith("/refresh")&&!n,a=t.url?.endsWith("/refresh")&&!r;if(s&&a)return e.url===t.url;if(s&&r)return!0;if(n){if(a)return"CANCEL_REFRESH";if(r)return!1}return!1};const kn=class{static formatPageReference(e){const t=e?.split(".").map((e=>{if(e.includes("[")){const t=e.indexOf("["),n=e.indexOf("]"),r=e.substring(t+1,n),s=Number(r)+1;return`${e.substring(0,t)}(${s})${e.substring(n+1)}`}return e}));return t.join(".")}static getFieldLabel(e){let t=e?.label;if(!t&&e?.inheritedProps){const n=e?.inheritedProps;(n.showLabel??1)&&(t=n.label)}return t}},$n={CONTENT_FIELDS_PATH:[j.CONTEXT_DATA,j.CASE_INFO.CASE_INFO,j.CONTENT],FIELD_MESSAGES_PATH:[j.CONTEXT_DATA,j.CASE_INFO.CASE_INFO,j.CONTENT,j.SUMMARY_OF_MESSAGES,j.PROPERTY_MESSAGES],PAGE_MESSAGES_PATH:[j.CONTEXT_DATA,j.SUMMARY_OF_MESSAGES,j.PAGE_MESSAGES],HTTP_MESSAGES_PATH:[j.CONTEXT_DATA,j.SUMMARY_OF_MESSAGES,j.HTTP_MESSAGES],CASE_MESSAGE_PATH:[j.CASEMESSAGES]},Bn=(e="",t="",n,r)=>{let s,a=[];null!==e&&(s=(e=>e?.startsWith(".")?e.substring(1).split("."):e.split("."))(e));const o=t&&t.startsWith(".")?t.substr(1):t;if(n===j.PROPERTY&&e||e){a=[j.CONTEXT_DATA,...o.split(".")];for(let e=0;e<s.length-1;e+=1)a.push(s[e]);a.push(j.SUMMARY_OF_MESSAGES,j.PROPERTY_MESSAGES,s[s.length-1])}else n===F.PAGE?a=[...$n.PAGE_MESSAGES_PATH]:n===j.HTTP?a=[...$n.HTTP_MESSAGES_PATH]:n===j.CASEMESSAGES?a=[...$n.CASE_MESSAGE_PATH]:r&&(a=[j.CONTEXT_DATA,...o.split(".")]);return a.filter(Boolean)},Gn=(e,t,n)=>{const r={content:{}},s=`${t}[${n}]`,a=Sh.getIn(e?.content,s.split("."));return a&&Sh.setIn(r.content,s.split("."),{...a}),r},Wn=(e,t,n,r,s,a,o={})=>{const i=((e,t,n)=>t<n?e.filter((e=>parseInt(e.match(/\d+/)?.[0],10)>t&&parseInt(e.match(/\d+/)?.[0],10)<=n)):e.filter((e=>parseInt(e.match(/\d+/)?.[0],10)<t&&parseInt(e.match(/\d+/)?.[0],10)>=n)))(n,r,s),c=r>s?"up":"down";i&&i?.length>0&&i?.forEach((n=>{const r=parseInt(n.match(/\d+/)?.[0],10),s=`${a}[${r}]`;o[`${a}[${r+("up"===c?1:-1)}]`]=Sh.getIn(e[t],[j.CONTEXT_DATA,...s.split(".")]),Sh.deleteIn(e[t],[j.CONTEXT_DATA,...s.split(".")])}));const l=Object.keys(o);l.length>0&&l.forEach((n=>{Sh.setIn(e[t],[j.CONTEXT_DATA,...n.split(".")],o[n])}))},Hn=(e,t,n,r,s)=>{const a=Sh.deepClone(Sh.getIn(e,[`${t}`])),o=Sh.getIn(a,[j.CONTEXT_DATA,j.CASE_INFO.CASE_INFO]);if(!o)return;const i=n.substring(0,n.lastIndexOf(".")),c=n.substring(n.lastIndexOf(".")+1),l=((e,t,n)=>{const r=Sh.getIn(e,[j.CONTEXT_DATA,...n.split(".")],{});return Object.keys(r).filter((e=>e.includes(`${t}[`)))})(a,c,i);if(0===l.length)return;if(Gn(o,c,r).content[`${c}[${r}]`]){const o={},i=`${n}[${r}]`,c=Sh.getIn(a,[j.CONTEXT_DATA,...i.split(".")]);o[`${n}[${s}]`]=c,Sh.deleteIn(e[t],[j.CONTEXT_DATA,...i.split(".")]),Wn(e,t,l,r,s,n,o)}else Wn(e,t,l,r,s,n)},qn=e=>{const{type:t,property:n,category:r,context:s,pageReference:a}=e;let o;n&&(o=n.slice(1));const i=ch(s);let c=[];const l=Sh.getIn(i,Bn(o,a,r));return t&&"all"!==t?(l&&Array.isArray(l)&&l.length>0&&(c=l.filter((e=>e.type===t))),t===F.MESSAGES.MESSAGES_TYPE_ERROR&&c.length>0&&n&&Pn.mutateField(s,a,n,{messages:[...c],type:F.MESSAGES.MESSAGES_TYPE_ERROR,fieldName:n}),c):l},zn=e=>{const{property:t,pageReference:n,category:r,context:s,type:a,isListEntry:o,clearContextMessages:i,deletingIndex:c}=e,l={context:s,type:a};t&&!o?(Pn.mutateField(s,n,t,{type:Qe,fieldName:t}),l.property=t,l.pageReference=n):o?(l.pageReference=n,l.isListEntry=o,l.deletingIndex=c):l.category=r,ih(i?{type:Qe,payload:{stateObj:e.stateObj,context:s}}:{type:Qe,payload:l})},Yn=e=>{const{messages:t,property:n,pageReference:r,category:s,context:a}=e,o={messages:t,context:a};n?(o.property=n,o.pageReference=r):o.category=s,ih({type:Je,payload:o})},Kn=(e,t,n)=>{for(const r of Object.keys(e)){if(t.push(r),r===j.SUMMARY_OF_MESSAGES)n.push([...t]);else{"object"===typeof e[r]&&Kn(e[r],t,n)}t.pop()}return n},Xn=(e,t)=>{let n=qn({context:j.APP.ROOT,category:"HTTP"});if(up.getRenderingMode()===j.EMBED){const e=qn({context:j.APP.APP,category:"HTTP"});e&&(n=n?n.concat(e):e)}if(e){const e=qn({context:t,category:"HTTP"});n?e&&(n=n.concat(qn({context:t,category:"HTTP"}))):n=qn({context:t,category:"HTTP"})}return n},Jn=e=>{let t=null;t=Ad(e)[0]?gd(Ad(e)[0]):e,t&&zn({context:t,stateObj:ch(t),clearContextMessages:!0})},Qn={addMessages:Yn,getValidationErrorMessages:e=>{const t=ch(e),n=[],r=Sh.getIn(t,[...$n.CONTENT_FIELDS_PATH])||{};return Kn(r,[],[]).forEach((e=>{const t=Sh.getIn(r,[...e,j.PROPERTY_MESSAGES]);t&&Object.keys(t).forEach((e=>{t[e].forEach((e=>{e.type===j.MESSAGES.MESSAGES_TYPE_ERROR&&(e.fieldLabel?n.push({label:`${e.fieldLabel}:`,description:e.message}):n.push(hp.getLocaleValue(e.message,"Messages")))}))}))})),n},getMessages:qn,clearMessages:zn,getRootContainerHttpMessages:Xn,clearContextMessagesInActiveWorkArea:Jn},Zn=Qn;const er=class{static execute(e,t,n,r){const s={};Object.prototype.hasOwnProperty.call(n,"nonFormProperties")&&(n.nonFormProperties.forEach((e=>{s[e]=n[e],delete n[e]})),delete n.nonFormProperties);const a={instruction:"INSERT",content:{...Sh.unflatten(n)}},o=JSON.parse(JSON.stringify(a));delete o.content.classID;return{instruction:{target:Sh.buildInstructionPageReference(r,e),content:{...o.content},listIndex:t,instruction:"INSERT"},actionPayload:a,displayPropertPayload:s}}};const tr=class{static execute(e,t,n,r,s,a,o){const i={instruction:"UPDATE",content:{...Sh.unflatten(r)},isDefault:o},c={content:{...i.content},target:Sh.buildInstructionPageReference(s,t),listIndex:n,instruction:"UPDATE"};return a||ih(ug({...i,listIndex:n-1,context:e,referenceList:`${s}${t}`})),c}};const nr=class{static execute(e,t,n){return{target:Sh.buildInstructionPageReference(n,e),listIndex:t,instruction:"DELETE"}}};const rr=class{static getDeleteAllInstruction(e,t){return{instruction:"DELETE ALL",target:Sh.buildInstructionPageReference(e,t)}}static execute(e,t,n,r){r||ih(ug({instruction:"DESELECT_ALL",context:e,referenceList:`${n}${t}`}))}};const sr=class{static execute(e,t,n,r){return{target:Sh.buildInstructionPageReference(r,e),listMoveToIndex:n,listIndex:t,instruction:"MOVE"}}};const ar=class{static execute(e,t,n,r){return{content:{...{...Sh.unflatten(n)}},target:Sh.buildInstructionPageReference(r,t),instruction:"REPLACE"}}};const or=class{static execute(e,t){return{target:Sh.buildInstructionPageReference(t,e),instruction:"DELETE"}}};const ir=class{constructor(e){this.next=null,this.automatic=!1,this.instruction=e,this.previous=null,this.childrenStateMachines=[]}};const cr=class{constructor(e,t,n){this.target=e,this.pageReference=t,this.contextName=n,this.root=null,this.current=null,this.changeList={},this.targetPageReference=t+e,this.children=[],this.visibility=!0}addChild(e){null===this.current&&this.insertNode({}),this.current.childrenStateMachines.push(e)}insertNode(e){const t=new ir(e);null===this.root&&(this.root=t),null!==this.current&&(t.previous=this.current,this.current.next=t),this.current=t}buildChildSumbitPageInstructions(e,t){let n=[];return e.childrenStateMachines.forEach((e=>{e.visibility&&(n=n.concat(e.buildSubmitPageInstructions(t)))})),n}buildSubmitPageInstructions(e=!1){let t=this.root,n=[];for(;t;)!t.instruction.instruction||e&&t.automatic||n.push(t.instruction),n=[...n,...this.buildChildSumbitPageInstructions(t,e)],t=t.next;return n}initPageInstructions(e,t,n){const r=e.getValue(this.target)||[];t?r.forEach(((e,r)=>{t.forEach((t=>{const s=Jc(t),a={};let o=!0;n&&(a[Jc(n)]=crypto.randomUUID(),o=!1);const i={[s]:Sh.getIn(e,s),...a};this.update(i,r+1,o,{isDefault:!0})}))})):r.forEach(((e,t)=>{if(n&&!e[Jc(n)]){const e={};e[Jc(n)]=crypto.randomUUID(),this.update(e,t+1,!1,{isDefault:!0})}}))}getChangeList(){return this.changeList}initChangeList(e){this.changeList[this.targetPageReference]=this.changeList[this.targetPageReference]||[],this.changeList[this.targetPageReference][e]=this.changeList[this.targetPageReference][e]||{}}update(e,t,n,r){const{isDefault:s=!1,skipPageinstruction:a}=r,o=tr.execute(this.contextName,this.target,t,e,this.pageReference,n,s);if(!a){if(this.initChangeList(t-1),!s){const n=this.changeList?.[this.targetPageReference]?.[t-1].content;this.changeList[this.targetPageReference][t-1]=yh(Sh.deepClone(n),e,r)}if(this.current?.automatic!==s||this.current?.instruction?.listIndex!==t||"UPDATE"!==this.current?.instruction.instruction)this.insertNode(o),s&&(this.current.automatic=!0);else{const t=this.current.instruction.content;this.current.instruction.content=yh(Sh.deepClone(t),Sh.unflatten(e),r)}}}delete(e,t){const n=nr.execute(this.target,e,this.pageReference);this.changeList[this.targetPageReference]?.splice(e-1,1),this.insertNode(n),t||ih(ug({instruction:"DELETE",listIndex:e-1,context:this.contextName,referenceList:`${this.pageReference}${this.target}`}))}insert(e,t,n,r){const{instruction:s,actionPayload:a={content:{}},displayPropertPayload:o={}}=er.execute(this.target,t,e,this.pageReference),{isDefault:i=!1}=r;if(this.initChangeList(t-1),!i){const n=this.changeList?.[this.targetPageReference]?.[t-1].content;this.changeList[this.targetPageReference][t-1]=yh(Sh.deepClone(n),e,r)}this.root&&!this.root.instruction?.instruction&&this.current&&!this.current.instruction?.instruction?this.root.instruction=s:this.insertNode(s),n||(a.content={...a.content,...o},ih(ug({...a,listIndex:t-1,context:this.contextName,referenceList:`${this.pageReference}${this.target}`}))),i&&(this.current.automatic=!0)}replacePage(e){const t=ar.execute(this.contextName,this.target,e,this.pageReference);this.insertNode(t)}deletePage(){const e=or.execute(this.target,this.pageReference);this.insertNode(e)}move(e,t){const n=this.changeList[this.targetPageReference]?.splice(e-1,1);this.changeList[this.targetPageReference]?.splice(t-1,0,n[0]);const r=sr.execute(this.target,e,t,this.pageReference);this.insertNode(r),ih(ug({listIndex:e-1,listMoveToIndex:t-1,context:this.contextName,referenceList:`${this.pageReference}${this.target}`,instruction:"MOVE"}))}deleteAll(e){const t=rr.getDeleteAllInstruction(this.pageReference,this.target);this.changeList[this.targetPageReference]=[],this.insertNode(t),rr.execute(this.contextName,this.target,this.pageReference,e)}updatePage(e){const t=this.current.instruction.content;this.current.instruction.content=yh(Sh.deepClone(t),e)}},lr={},ur={},dr={},pr=(e,t,n)=>{const r=e.getContextName();lr[r]||(lr[r]={}),lr[r][t]||(lr[r][t]={content:[]}),ur[r]||(ur[r]=[],dr[r]=[]),Kc.isStateMachineExist(r,n,t)||Kc.setStateMachine(r,t,n,new cr(t,n,r))},hr=e=>kn.formatPageReference(e),gr=(e,t)=>{const n=ur[e],r=dr[e],s=Jc(t),a=s?.substring(0,s.indexOf("["));r?.indexOf(a)<0&&dr[e].push(a),n?.indexOf(s)<0&&ur[e].push(s)},fr=e=>{delete ur[e]},mr=e=>Kc.buildPageInstructionsByContext(e),yr=e=>Kc.buildPageInstructionsByContext(e,!0),Ir=e=>{Kc.clearStateMachines(e),delete lr[e]},Er=(e,t,n,r)=>{let[,s]=t.split(`${e}[${r}]`);""!==s&&void 0!==s&&(s=s.startsWith(".")?s.substring(1):s,Object.keys(n).forEach((e=>{n[`${s}.${e}`]=n[e],delete n[e]})))},Ar=(e,t,n,r,s)=>{const{skipStateUpdate:a=!1}=s||{},o=n.getContextName(),i=n.getReferenceList(),c=r||n.getPageReference(),l=hr(i);pr(n,l,c),gr(o,`${i}[${t}]`),Er(i,c,e,t);const u={instruction:j.LIST_ACTIONS.INSERT,content:{...Sh.unflatten(e)}};delete JSON.parse(JSON.stringify(u)).content.classID;Kc.getStateMachine(o,c,l).insert(e,t+1,a,{})},_r=(e,t,n=0,r={})=>{const{skipStateUpdate:s=!0,pageRef:a}=r,o=t.getContextName();let i=t.getReferenceList();const c=a||t.getPageReference();i||(i=((e,t)=>{const n=e.indexOf(F.CONTENT)+F.CONTENT.length,r=e.lastIndexOf(`[${t}]`);return e.substring(n,r)})(c,n));const l=hr(i);pr(t,l,c),gr(o,`${i}[${n}]`),Er(i,c,e,n);Kc.getStateMachine(o,c,l).update(e,n+1,s,r)},Cr=(e,t)=>{const[,n]=e.split("."),r=t?.split(".").pop();return n===r},Sr=(e,t,n)=>{const r={};return Object.values(e).forEach((e=>{if(Cr(e,n)){const n=Sh.getPropertyName(e),s=n.substr(n.indexOf(".")+1).split(".");if(s.length>1){let e=Sh.getIn(t,s)??"";if(!e){const n=`!P!${s.join(":")}`;e=Sh.getIn(t,n)??""}Sh.setIn(r,s,e)}else{const e=Sh.getIn(t,s)??"";r[s[s.length-1]]=e}}})),r},Tr=(e,t,n,r,s)=>{const a=e.getValue(t)||{};n&&Object.keys(a).length>0&&e.clearErrorMessages({property:r?s:e.getStateProps().value})},Nr=(e,t,n)=>new Promise((r=>{const{skipPageInstructions:s=!1}=n,{selectionMode:a,selectionList:o,required:i}=t.getConfigProps(),c=a===j.LIST_SELECTION_MODE.MULTI,l=t.getContextName();let u=t.getPageReference(),d=((e,t,n)=>e?n.substring(1):t.substring(t.lastIndexOf(".")+1))(c,u,o);const p=t.getRawMetadata();let h=null;const g=(e=>e?.config?.dataRelationshipContext&&"SimpleTableSelect"===e.type&&"single"===e.config?.selectionMode)(p);g&&(d=p?.config?.dataRelationshipContext,h=u.concat(".").concat(d),u=h);const f=((e,t,n)=>e?`${t}${n}`:t)(c,u,o),m=((e,t,n,r)=>t?e.getFieldMetadata(`${n}`):e.getCurrentPageFieldMetadata(r))(t,c,d,h),{datasource:{parameters:y={}}}=m,I={...y};if(((e,t,n)=>{t?.descriptors?.length&&!n&&t.descriptors.forEach((t=>{const n=Sh.getPropertyName(t),r=n.substr(n.indexOf(".")+1).split(".");e[r.join(".")]=t}))})(I,m,c),c){let n=o;n=hr(n);const r=t.getValue(f)||[];pr(t,n,u);const a=[];let i=r.length;e.forEach((e=>{const t=Sr(y,e,d),o={};if(Object.prototype.hasOwnProperty.call(e,"displayProperty")){const t=e.displayProperty;o[t]=e[t]}const c=Object.entries(t);let p=r.findIndex((e=>c.every((([t,n])=>e[t]===n))));if(-1===p?(p=i,e.$selected&&(i+=1)):i=i?i-1:0,!s){const r=Kc.getStateMachine(l,u,n);e.$selected?r.insert(t,p+1,!0,{}):r.delete(p+1,!0)}a.push({instruction:e.$selected?j.LIST_ACTIONS.SELECT:j.LIST_ACTIONS.DESELECT,listIndex:p,content:{...t,...o}})})),ih(ug({instruction:j.LIST_ACTIONS_TYPE.SELECT_DESELECT,context:l,referenceList:`${u}.${d}`,actions:a}))}else{const n=Sr(I,e[0],d);Object.keys(n).forEach((e=>{t.getActionsApi().updateFieldValue(`.${e}`,n[e],g?{contextPageReference:u}:{}),t.getActionsApi().triggerFieldChange(`.${d}.${e}`,n[e])}))}Tr(t,f,i,c,d),r()})),Pr=e=>{if(!e)return!1;const t=yr(e);return Array.isArray(t)&&t.length>0};const Rr=(e,t,n={})=>{const{skipStateUpdate:r=!1}=n,s=e.getPageReference(),a=hr(t);pr(e,t,s);Kc.getStateMachine(e.getContextName(),s,a).deleteAll(r)},Dr=e=>({insert:(t,n,r,s)=>Ar(t,n,e,r,s),update:(t,n,r)=>_r(t,e,n,r),updateProperty:(t,n,r)=>((e,t,n,r={})=>{const s=n.getPageReference(),{stateMachineTarget:a}=Kc.getStateMachineObjByPath(`${s}${e}`,n.getContextName(),`${s}${e}`.endsWith("]"));if(!a){let e=s.substring(0,s.lastIndexOf("["));const t=e.substring(e.lastIndexOf("."));e=e.substring(0,e.lastIndexOf(".")),e&&t&&pr(n,t,e)}Kc.executeStateMachine(n.getContextName(),`${s}${e}`,t,!0,r)})(t,n,e,r),deleteEntry:(t,n)=>((e,t,n)=>{const r=t.getContextName(),s=t.getReferenceList(),a=n||t.getPageReference(),o=`${a+s}[${e}]`,i=hr(s);zn({type:F.MESSAGES.MESSAGES_TYPE_ERROR,pageReference:o,context:r,isListEntry:!0,deletingIndex:e}),pr(t,i,a),gr(r,`${s}[${e}]`),Kc.getStateMachine(r,a,i).delete(e+1);const c=Kc.getUnConnectedStateMachines(r)||{};Object.keys(c).forEach((e=>{e.includes(`${a}${i}`)&&e!==`${a}${i}`&&(c[e]=null)}))})(t,e,n),reorder:(t,n)=>((e,t,n)=>{const r=n.getContextName(),s=n.getReferenceList(),a=n.getPageReference(),o=hr(s);pr(n,o,a),gr(r,`${s}[${t}]`),Kc.getStateMachine(r,a,o).move(e+1,t+1)})(t,n,e),setSelectedRows:(t,n={skipPageInstructions:!1})=>Nr(t,e,n),getSelectedRows:(t=!1)=>((e,t)=>{const{selectionMode:n,selectionList:r}=t.getConfigProps(),s=[];let a=t.getPageReference();const o=n===j.LIST_SELECTION_MODE.MULTI;let i=o?r.substring(1):a.substring(a.lastIndexOf(".")+1);const c=t.getRawMetadata();let l=null;c?.config?.dataRelationshipContext&&"SimpleTableSelect"===c.type&&"single"===c.config?.selectionMode&&(i=c.config.dataRelationshipContext,l=a.concat(".").concat(i),a=l);const u=o?`${a}${r}`:a;let d=t.getValue(u)||[];if(Array.isArray(d)||(d=[d]),e)return Promise.resolve(d);const{datasource:{parameters:p={}}={}}=o?t.getFieldMetadata(`${i}`):t.getCurrentPageFieldMetadata(l);return d.forEach((e=>{const t=Object.values(p).reduce(((t,n)=>{const r=n.substring(n.lastIndexOf(".")+1);return Cr(n,i)&&e[r]?`${t}${e[r]}`:t}),"");t.trim()&&s.push(t.trim())})),Promise.resolve(s)})(t,e),clearSelectedRows:()=>function(e){const{selectionList:t,required:n}=e.getConfigProps(),r=e.getContextName(),s=e.getPageReference(),a=t,o=`${s}${t}`;return new Promise((t=>{let i=a;i=hr(i),pr(e,i,s),Kc.getStateMachine(r,s,i).deleteAll(),Tr(e,o,n,!0,a),t()}))}(e),setVisibility:t=>((e,t=!0)=>{const n=e.getContextName(),{selectionMode:r,selectionList:s,renderMode:a,referenceList:o}=e.getComponentConfig();let i;if(r===j.LIST_SELECTION_MODE.MULTI&&s?i=s:"Editable"===a&&o&&(i=e.getStateProps().referenceList),i){i=hr(i);const r=Kc.getStateMachine(n,"",`${e.getPageReference()}${i}`);r&&(r.visibility=t)}})(e,t),initDefaultPageInstructions:(t,n,r)=>((e,t,n,r)=>{const s=e.getContextName(),a=e.getPageReference(),o=hr(t);pr(e,o,a),Kc.getStateMachine(s,a,o).initPageInstructions(e,n,r)})(e,t,n,r),deleteAll:(t,n)=>Rr(e,t,n),replacePage:(t,n)=>((e,t,n)=>{const r=e.getPageReference(),s=e.getContextName();pr(e,t,r),gr(s,Sh.buildInstructionPageReference(r,t)),Kc.getStateMachine(s,r,t).replacePage(n)})(e,t,n),deletePage:t=>((e,t)=>{const n=e.getPageReference(),r=e.getContextName();pr(e,t,n),gr(r,Sh.buildInstructionPageReference(n,t)),Kc.getStateMachine(r,n,t).deletePage()})(e,t)});const br=new class{constructor(){this.fieldDefaults={}}updateFieldDefaults(e){e&&(Object.keys(this.fieldDefaults).length?Sh.mergeDeep(e,this.fieldDefaults):Sh.copy(e,this.fieldDefaults))}setFieldDefault(e,t,n){e&&t&&(this.fieldDefaults[e]=this.fieldDefaults[e]||{},this.fieldDefaults[e][t]=n)}getDefaultsforType(e){return this.fieldDefaults[e]}};class Or{constructor(){this.validators={}}register(e,t){this.validators[e]=t}getValidator(e){return this.validators[e]}validateRequired(e,t,n,r,s,a){const{required:o,value:i}=a;let c=null;if(!("true"!==o&&!0!==o)){let o=r;switch(e){case"radiobuttons":o=i;break;case"attachment":{const e=n?.replace(F.CASE_INFO.CASE_INFO_CONTENT,"").replace(F.DATA_INFO.DATA_INFO_CONTENT,"");o=(dh(`.attachmentsList${e}.${t?.replace(".","")}`,"context_data",s)||[]).filter((e=>!e.delete)),0===o?.length&&(o="");break}case"checkbox":o&&"false"!==o||(o="");break;default:"string"==typeof o&&(o=o.trim())}c=this.getValidator("required")(o),Or.messageDispatcher(t,n,s,c,kn.getFieldLabel(a))}return c}validateType(e,t,n,r,s,a){let o=null;const i={pageReference:n,context:s,property:t,target:a?.target,required:a?.required};let c=br.getDefaultsforType(a?.componentName||"")?.["client-validations"];!1!==c&&e&&this.getValidator(e)&&(o=this.getValidator(e)(r,i),""!==r&&Or.messageDispatcher(t,n,s,o,a?.label));const l=a?.validationType;return c=l&&br.getDefaultsforType(l)?.["client-validations"],!1!==c&&l&&this.getValidator(l)&&(o=this.getValidator(l)(r,i),Or.messageDispatcher(t,n,s,o,a?.label)),o}validate(e,t,n,r={}){const{context:s,disabled:a,readOnly:o,pageReference:i,skipRequiredValidation:c}=r;let l=null;return a||o||(c||(l=this.validateRequired(e,t,i,n,s,r)),l||(l=this.validateType(e,t,i,n,s,r))),{message:l}}static messageDispatcher(e,t,n,r,s){if(r){const a=[];a.push({type:F.MESSAGES.MESSAGES_TYPE_ERROR,fieldLabel:s,message:r}),Yn({messages:a,property:e,pageReference:t,context:n})}}isValidatorExist(e){return!!e.validatetype}}const vr=new Or,xr=(e,t)=>{e.DeclareExpressions&&zt({[t.context]:e.DeclareExpressions})},wr=(e,t,n=!1)=>{const r=Sh.getIn(e,j.RESOURCES);r&&((e=>{e&&jp(e)})(r),xr(r,t)),n||xg({...e,options:t})},Mr="text/javascript";const Lr=new class{constructor(){this.loaderObj={},this.staticServerURL="",this.appStaticUrl=null,this.pegaOnlyUrl=!1,this.loadedAssets={},this.componentsConfig=null,this.appAlias="",this.b2sJWT=null,this.ccV2LibId="",this.imageBlobUrlCache={},this.svcLocaleErrorCache=new Map}getTypes={SCRIPT:"script",STYLE:"link"};getStaticServerUrl(){return this.staticServerURL}setCCV2LibId(e){this.ccV2LibId=e}getCCV2LibId(){return this.ccV2LibId}async getThemeSchemaJSON(){const e=`${this.staticServerURL}themeOverrides.schema.json`;return fetch(e).then((e=>e.json()))}getConstellationServiceUrl(){return this.staticServerURL?.endsWith("/")?this.staticServerURL.substring(0,this.staticServerURL.length-1):this.staticServerURL}setAppAlias(e){this.appAlias=e}getAppAlias(){return this.appAlias}async getSvcComponentsConfig(e,t={}){let n="",r=0;return e.forEach((e=>{n+=`${0===r?"?":"&"}field${r}=${e.field}&value${r}=${e.value}`,r+=1})),this.pegaOnlyUrl?this.getSvcComponentsConfigSeparatedUrls(e,n,t):this.getSvcComponentsConfigCombinedUrl(e,n,t)}async getSvcComponentsConfigSeparatedUrls(e,t,n){const r=up.getBuiltOnAppNames(),s=this.loadAndFilterPegaComponentsConfig(e,r);let a=Promise.resolve([]);!0!==n.skipLoadCustomerComponents&&(a=this.loadAndCustomerComponentsConfig(t));const o=this.fetchSDKComponent(t),i=[];if(await Promise.all([s,a,o]).then((e=>{const t=this.mergeComponentList(e);i.push(...t)})),n.alternateDesignSystemURL&&1===i.length){const r=await this.getSvcComponentsConfigADS(e,t,n);i[0].alternateDesignSystemConfig=r}return{data:{components:i}}}mergeComponentList=e=>{const[t=[],n=[],r=[]]=e,s=[...t,...n];return this.appStaticUrl?s.map((e=>{const{name:t,type:n,subtype:s}=e,a=r.reduce(((e,r)=>(t===r.name&&n===r.type&&s===r.subtype&&(e=r),e)),{});return Object.keys(a).length>0?{...e,alternateDesignSystemConfig:{...a}}:e})):s};async fetchSDKComponent(e){if(this.appStaticUrl&&this.appStaticUrl.length>8&&this.appStaticUrl!==this.staticServerURL){const t=`${this.appStaticUrl}v102/${this.appAlias}/componentslist-ext${e}`;return fetch(t,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.json())).then((e=>e.components)).catch((()=>[]))}return Promise.resolve([])}async loadAndFilterPegaComponentsConfig(e,t){return this.loadPegaComponentsConfig().then((()=>{const n=[];return this.componentsConfig&&this.componentsConfig.forEach((r=>{let s=!0;e.forEach((e=>{Array.isArray(r[e.field])?r[e.field].includes(e.value)||(s=!1):r[e.field]!==e.value&&(s=!1)})),s&&this.checkForBuiltOnSupport(t,r.allowedApplications)&&n.push(r)})),n}))}async loadPegaComponentsConfig(){let e=null;if(null===this.componentsConfig){const t=`${this.staticServerURL}components/componentsconfig.json?v=${(new Date).getTime()}`;e=fetch(t,{method:"GET"}).then((e=>e.json())).then((async e=>{this.componentsConfig=e,this.ccV2LibId&&await this.loadLibraryComponentsConfig(this.ccV2LibId).then((e=>{e&&e.length>0&&(this.componentsConfig=(this.componentsConfig||[]).concat(e))})).catch((e=>{console.error(`Exception while appending custom component config from library ${this.ccV2LibId} : ${e}`)}))})).catch()}else e=Promise.resolve();return e}async loadLibraryComponentsConfig(e){let t=null;return t=fetch(`${this.appStaticUrl}v100/componentlib/componentsconfig/${e}?v=${Date.now()}`,{headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>{if(!e.ok)throw console.error("Error while fetching custom component config/library component config"),new Error(e.statusText);return e})).then((e=>e.json())).then((e=>Promise.resolve(e))).catch((t=>(console.error(`Exception while fetching custom component config from library ${e} : ${t}`),{error:t.message}))),t}async loadAndCustomerComponentsConfig(e){let t=null;if(this.appStaticUrl&&this.appStaticUrl.length>8&&this.appStaticUrl!==this.staticServerURL){const n=`${this.appStaticUrl}v103/${this.appAlias}/componentslist${e}`;t=fetch(n,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.json())).then((e=>e.components)).catch((()=>[]))}else t=Promise.resolve([]);return t}checkForBuiltOnSupport(e,t){if(!e||!t||0===e.length||0===t.length)return!0;const n=e.split(",");return 0===n.length||n.some((function(e){return-1!==t.indexOf(e)}))}async getSvcComponentsConfigCombinedUrl(e,t,n){const r=`${this.staticServerURL}v102/${this.appAlias}/componentslist${t}`,s=await fetch(r,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.json())).then((e=>({data:e})));if(!0===n.skipLoadCustomerComponents&&s?.data?.components?.length>0&&(s.data.components=s.data.components.filter((e=>void 0===e.componentKey))),n.alternateDesignSystemURL&&1===s?.data?.components?.length){const r=await this.getSvcComponentsConfigADS(e,t,n);s.data.components[0].alternateDesignSystemConfig=r}return s}getSvcComponentsConfigADS(e,t,n){const r=`${n.alternateDesignSystemURL}${n.alternateDesignSystemURL?.endsWith("/")?"":"/"}components/${e[0].value}/config-ext.json`;return fetch(r,{method:"GET"}).then((e=>{if(e.ok)return e.json();throw new Error(e.statusText)})).catch((e=>({error:e.message})))}getSvcImage(e){const t=`${this.appStaticUrl}v102/${this.appAlias}/image/${e}`;return fetch(t,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.blob())).catch()}getSvcImageUrl(e){const t=`${this.appStaticUrl}v102/${this.appAlias}/image/${e}`;return void 0===this.imageBlobUrlCache[t]&&(this.imageBlobUrlCache[t]=fetch(t,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.blob())).then((e=>window.URL.createObjectURL(e))).catch()),this.imageBlobUrlCache[t]}getSvcLocale(e,t){const n=`${this.appStaticUrl}v102/${this.appAlias}/locales/${e}/${t}`,r=`${this.appStaticUrl}::${this.appAlias}::${e}::${t}`;return!0===this.svcLocaleErrorCache.get(r)?Promise.resolve(null):fetch(n,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>400===e.status||404===e.status?(this.svcLocaleErrorCache.set(r,!0),null):e)).catch((()=>null))}getSvcAvailableLocales(){const e=`${this.appStaticUrl}v102/app/${this.appAlias}/locales/getLocaleCodes`;return fetch(e,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.json())).catch((()=>[]))}getSvcComponent(e){const t=`${this.appStaticUrl}v102/${this.appAlias}/component/${e}`;return fetch(t,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>{if(!e.ok)throw Error(e.statusText);return e})).then((e=>e.text())).then((e=>e)).catch()}async importCustomComponentMap(e){fetch(`${this.appStaticUrl}v100/componentlib/componentsmap/${e}`,{headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>(e.ok||console.error("Error while fetching custom component map"),e))).then((e=>e.text())).then((t=>{this.setCCV2LibId(e);const n=document.createElement("script");n.src=window.URL.createObjectURL(new Blob([t],{type:Mr})),n.onload=()=>console.log("Custom component lib map loaded"),n.onerror=()=>console.error("Error while appending custom component map"),document.head.appendChild(n)})).catch((e=>{console.error("Exception while appending custom component map : "),console.error(e)}))}loadSvcComponent(e){return new Promise(((t,n)=>{this.getSvcComponent(e).then((r=>{const s=document.createElement("script");s.src=window.URL.createObjectURL(new Blob([r],{type:Mr})),s.onload=()=>t(e),s.onerror=()=>n(e),document.head.appendChild(s)})).catch((()=>{n(e)}))}))}initServer(e,t,n){console.log(`asset-loader.initServer(${e}, ${t})`),this.appStaticUrl=null,this.staticServerURL=null,this.pegaOnlyUrl=!1,this.componentsConfig=null,e&&t&&"no-appstatic"!==t&&"no-cdn"!==t?(this.appStaticUrl=t.endsWith("/")?t:`${t}/`,this.staticServerURL=e.endsWith("/")?e:`${e}/`,this.pegaOnlyUrl=!0):e&&t&&"no-appstatic"===t?(this.staticServerURL=e.endsWith("/")?e:`${e}/`,this.appStaticUrl=this.staticServerURL,this.pegaOnlyUrl=!0):e&&t&&"no-cdn"===t&&(this.staticServerURL=e.endsWith("/")?e:`${e}/`,this.appStaticUrl=this.staticServerURL),console.log(`asset-loader.initServer() staticServerURL=${this.staticServerURL}, appStaticUrl=${this.appStaticUrl}, pegaOnlyUrl=${this.pegaOnlyUrl})`),this.b2sJWT=n}register(e,t){this.loaderObj[e]=t}getLoader(e){let t;const n=(e,t)=>new Promise(((n,r)=>{const s=document.createElement(t);"script"===t?(s.onload=()=>{n(e)},s.onerror=()=>{r(e)},s.type=Mr,s.charset="UTF-8",s.async=!1,s.src=e):(s.type="text/css",s.rel="stylesheet",s.href=e),document.head.appendChild(s)})).catch((e=>{console.log(e)}));return t=e?this.loaderObj[e]:n,t}loadAssets(e,t){const{isDevServerMode:n}=t;if(!e)return Promise.resolve();const r=[];return e.forEach((e=>{const t=Object.keys(e)[0];let s=n?Object.values(e)[0]:this.getStaticServerUrl();s=s.endsWith("/")?s:`${s}/`,this.loadedAssets[t]||(t.includes(".js")?r.push(this.getLoader()(s+t,this.getTypes.SCRIPT)):t.includes(".css")&&this.getLoader()(s+t,this.getTypes.STYLE),this.loadedAssets[t]=!0)})),Promise.all(r)}getAssetsFromIsolations(e){const t=this.b2sJWT?.split(".")[1].replace(/-/g,"+").replace(/_/g,"/")||"",n=decodeURIComponent(s.g.atob(t).split("").map((e=>`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`)).join("")),r=JSON.parse(n),a=r?.tenant_id,{restApi:o,reqType:i}=Tg("getAssetsFromIsolations",{isolationID:a,assetPath:e})||{},c=`${this.appStaticUrl}${o}`;return fetch(c,{method:i,credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.blob()))}},Ur="component-loader",Fr={},jr=async(e,t)=>{const n=Lr.getLoader(),r=t||Lr.staticServerURL;if(!e||window.PCore&&!1===window.PCore.getBehaviorOverride("dynamicLoadComponents"))return Promise.resolve();if(Lr.getLoader(Ur))return Lr.getLoader(Ur)(e,r);const s=[];return e.forEach((e=>{if(Fr[e])return;const t=Xt.getComponent(e);if(!t){const t=`${Lr.getConstellationServiceUrl()}/v860/${Lr.getAppAlias()}/component/${e}.js`;return void s.push(n(t,Lr.getTypes.SCRIPT))}(t.scripts||[]).forEach((e=>{const t=e.startsWith("http")?e:r+e;s.push(n(t,Lr.getTypes.SCRIPT))}));(t.styles||[]).forEach((e=>{s.push(n(r+e,Lr.getTypes.STYLE))})),Fr[e]=!0})),Promise.all(s)};class Vr{static actionsTargetMap=new Map;static getTargetViewContainerName=e=>{if(e){const t=e.toLowerCase();let n="primary";return this.actionsTargetMap.has(t)&&(n=this.actionsTargetMap.get(t)),n}return""};static buildActionTargetMap=e=>{e&&Object.keys(e).forEach((t=>{const n=e[t];n&&n.actions&&n.actions.forEach((e=>{this.actionsTargetMap.set(e.toLowerCase(),t)}))}))}}const kr=Vr;const $r=class{constructor(e,t,n,r){this.eventType=e,this.callback=n,this.contextName=r,this.id=t}};const Br=new class{constructor(){this.subscribers={}}publish(e,t){this.subscribers[e]?.forEach((e=>{e.callback(t)}))}unsubscribe(e,t,n){const r=this.subscribers[e]||[];let s=0,a=-1;r.forEach((e=>{e.id===t&&e.contextName===n&&(a=s),s+=1})),-1!==a&&r.splice(a,1)}unsubscribeAllWithEventType(e){this.subscribers[e]=[]}subscribe(e,t,n,r,s){this.subscribers[e]=this.subscribers[e]||[];let a=!1;if(s&&this.subscribers[e].forEach((e=>{a=e.id===t&&e.contextName===r})),!a){const s=new $r(e,t,n,r);this.subscribers[e].push(s)}}clearContext(e){const t=this.subscribers;Object.keys(t).forEach((t=>{const n=this.subscribers[t],r=[];n.forEach((t=>{t.contextName!==e&&r.push(t)})),this.subscribers[t]=r}))}};const Gr=class{static subscribe(e,t,n,r=!1,s="app"){Br.subscribe(e,n,t,s,r)}static subscribeOnce(e,t,n){this.subscribe(e,t,n,!0)}static publish(e,t){Br.publish(e,t)}static unsubscribe(e,t,n="app"){Br.unsubscribe(e,t,n)}static unsubscribeAllWithEventType(e){Br.unsubscribeAllWithEventType(e)}static cleanContextSubscribers(e){Br.clearContext(e)}},Wr=e=>{Gr.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_SUBMISSION,e)},Hr={CASE_INFO:`${j.DATA}.${j.CASE_INFO.CASE_INFO}`,CASE_CLASS_NAME:`${j.DATA}.${j.CASE_INFO.CASE_TYPE_ID}`,NEXT_ASSIGNMENT_INFO_ID:`${j.DATA}.${j.NEXT_ASSIGNMENT_INFO_ID}`,ASSIGNMENTS:`${j.DATA}.${j.CASE_INFO.ASSIGNMENTS}`,CASE_INFO_ID:`${j.DATA}.${j.CASE_INFO.CASE_INFO_ID}`,CASE_FIRST_FLOW_ACTION_NAME:`${j.DATA}.${j.CASE_INFO.ASSIGNMENTACTION_ID}`,CASE_FIRST_ASSIGNMENT_ID:`${j.DATA}.${j.CASE_INFO.ASSIGNMENT_ID}`},qr=(e,t)=>{const{vcName:n,containerName:r}=t;return r||n||kr.getTargetViewContainerName(e)},zr=e=>{const t=e.lastIndexOf(j.FORWARD_SLASH_STRING)+1,n=e.lastIndexOf(j.UNDERSCORE_STRING);return e.substring(t,n)},Yr=e=>e===td.WORKAREA,Kr=e=>e===td.MODAL,Xr=e=>e===Ee,Jr=e=>e&&e.find((e=>e.type===Ee)),Qr=e=>Sh.getIn(e,Hr.CASE_INFO,{}),Zr=e=>e?e.split(" ").pop():void 0,es=e=>Sh.getIn(e,Hr.CASE_CLASS_NAME,j.EMPTY_STRING),ts=e=>{const t=Qr(e);return Zt(t)&&en(up.getOperatorIdentifier(),t)},ns=e=>Sh.getIn(e,Hr.CASE_INFO_ID,j.EMPTY_STRING),rs=e=>Sh.getIn(e,Hr.CASE_FIRST_ASSIGNMENT_ID,j.EMPTY_STRING),ss=(e,t)=>{const{removeActionPayload:n,target:r}=t;if(n&&n.containerItemID){const{containerItemID:t,context:s}=n;e.push(og(Zh,{containerItemID:t,context:s||yd(t),target:r}))}},as=e=>{const t=oh();if(!e)return!1;const n=W(e),r=xd(n),s=xd(e);if(!r||!s)return!1;const a=sd(r,n),o=sd(s,e);if(!a||!o)return!1;const{key:i}=a||{};let{key:c}=o||{};return c||(c=t?.getState().data?.[e]?.caseInfo?.ID),i&&c&&i===c},os=(e,t,n={})=>{const{skipFlowNameUpdate:r}=n,s=ns(t);Sh.setIn(e,"key",s);const a=Zt(Qr(t));if(!r&&(e=>{const t=Sh.getIn(e,Hr.ASSIGNMENTS,[]);return t&&t.length>0})(t)){const n=rs(t),[,r]=n.split("!");(e=>{Gr.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.CURRENT_ASSIGNMENT_UPDATED,e)})({assignmentID:n,isInCreateStage:a}),Sh.setIn(e,"flowName",r)}},is=(e,t)=>{const{attachmentsExist:n}=t;n&&Sh.setIn(e,F.SUMMARY_OF_ATTACHMENTS_LAST_REFRESH_TIME,(new Date).toLocaleString()),Sh.setIn(e,F.SUMMARY_OF_ASSIGNMENT_LAST_SUBMIT_TIME,(new Date).toLocaleString())},cs=(e,t,n)=>{let r=j.PROMISE_VALUE.RESOLVE;return Jr(e)?(r=j.PROMISE_VALUE.REJECT,n?ln.rejectActionByID(t,!0,n):ln.rejectActionByID(t)):ln.resolveActionByID(t),r},ls=e=>{const t=up.getCaseTypeList();return"true"===t.filter((t=>t.pyWorkTypeImplementationClassName===e))?.[0]?.pyIsTraditionalUICase},us=()=>"true"===up?.environmentInfoObject?.pxMashupDetails?.pyLaunchCaseInModal,ds=(e,t)=>{const n=es(e?.response),r=Qr(e?.response),{caseTypeID:s}=r,a=up.getFeatureMap();(a?.deferUpdateCaseSummaryView??!Object.hasOwn(a,j.DEFER_UPDATE_CASESUMMARY_VIEW))&&s&&kp(j.CASESUMMARY_VIEW_NAME,s)&&((e,t,n)=>{const{containerItemID:r,caseID:s}=t;if(r){const{caseClassName:a,skipAssignmentsUpdate:o}=n,i=W(r),c=xd(i),l=c&&rd(c),u=c&&gd(c),d=Y(i);u&&l?.items?.[u]?.key===t?.caseID&&e.push(og(Lh,{containerItemID:i,context:i,container:d,containerName:d,caseId:s,viewName:F.CASESUMMARY_VIEW_NAME,updateData:!0,viewLoadingContainer:{context:i},caseClassName:a,...void 0!==o&&{skipAssignmentsUpdate:o}}))}})(t,e?.actionInPayload,{caseClassName:n,skipAssignmentsUpdate:!0})},ps=e=>ch(e)?.context_data?.caseViewMode;function hs(e,t){return function(){return e.apply(t,arguments)}}const{toString:gs}=Object.prototype,{getPrototypeOf:fs}=Object,{iterator:ms,toStringTag:ys}=Symbol,Is=(Es=Object.create(null),e=>{const t=gs.call(e);return Es[t]||(Es[t]=t.slice(8,-1).toLowerCase())});var Es;const As=e=>(e=e.toLowerCase(),t=>Is(t)===e),_s=e=>t=>typeof t===e,{isArray:Cs}=Array,Ss=_s("undefined");const Ts=As("ArrayBuffer");const Ns=_s("string"),Ps=_s("function"),Rs=_s("number"),Ds=e=>null!==e&&"object"==typeof e,bs=e=>{if("object"!==Is(e))return!1;const t=fs(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||ys in e||ms in e)},Os=As("Date"),vs=As("File"),xs=As("Blob"),ws=As("FileList"),Ms=As("URLSearchParams"),[Ls,Us,Fs,js]=["ReadableStream","Request","Response","Headers"].map(As);function Vs(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,s;if("object"!=typeof e&&(e=[e]),Cs(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{const s=n?Object.getOwnPropertyNames(e):Object.keys(e),a=s.length;let o;for(r=0;r<a;r++)o=s[r],t.call(null,e[o],o,e)}}function ks(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,s=n.length;for(;s-- >0;)if(r=n[s],t===r.toLowerCase())return r;return null}const $s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Bs=e=>!Ss(e)&&e!==$s;const Gs=(Ws="undefined"!=typeof Uint8Array&&fs(Uint8Array),e=>Ws&&e instanceof Ws);var Ws;const Hs=As("HTMLFormElement"),qs=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),zs=As("RegExp"),Ys=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Vs(n,((n,s)=>{let a;!1!==(a=t(n,s,e))&&(r[s]=a||n)})),Object.defineProperties(e,r)};const Ks=As("AsyncFunction"),Xs=(Js="function"==typeof setImmediate,Qs=Ps($s.postMessage),Js?setImmediate:Qs?(Zs=`axios@${Math.random()}`,ea=[],$s.addEventListener("message",(({source:e,data:t})=>{e===$s&&t===Zs&&ea.length&&ea.shift()()}),!1),e=>{ea.push(e),$s.postMessage(Zs,"*")}):e=>setTimeout(e));var Js,Qs,Zs,ea;const ta="undefined"!=typeof queueMicrotask?queueMicrotask.bind($s):"undefined"!=typeof process&&process.nextTick||Xs,na={isArray:Cs,isArrayBuffer:Ts,isBuffer:function(e){return null!==e&&!Ss(e)&&null!==e.constructor&&!Ss(e.constructor)&&Ps(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||Ps(e.append)&&("formdata"===(t=Is(e))||"object"===t&&Ps(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Ts(e.buffer),t},isString:Ns,isNumber:Rs,isBoolean:e=>!0===e||!1===e,isObject:Ds,isPlainObject:bs,isReadableStream:Ls,isRequest:Us,isResponse:Fs,isHeaders:js,isUndefined:Ss,isDate:Os,isFile:vs,isBlob:xs,isRegExp:zs,isFunction:Ps,isStream:e=>Ds(e)&&Ps(e.pipe),isURLSearchParams:Ms,isTypedArray:Gs,isFileList:ws,forEach:Vs,merge:function e(){const{caseless:t}=Bs(this)&&this||{},n={},r=(r,s)=>{const a=t&&ks(n,s)||s;bs(n[a])&&bs(r)?n[a]=e(n[a],r):bs(r)?n[a]=e({},r):Cs(r)?n[a]=r.slice():n[a]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&Vs(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(Vs(t,((t,r)=>{n&&Ps(t)?e[r]=hs(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let s,a,o;const i={};if(t=t||{},null==e)return t;do{for(s=Object.getOwnPropertyNames(e),a=s.length;a-- >0;)o=s[a],r&&!r(o,e,t)||i[o]||(t[o]=e[o],i[o]=!0);e=!1!==n&&fs(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:Is,kindOfTest:As,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(Cs(e))return e;let t=e.length;if(!Rs(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[ms]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:Hs,hasOwnProperty:qs,hasOwnProp:qs,reduceDescriptors:Ys,freezeMethods:e=>{Ys(e,((t,n)=>{if(Ps(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];Ps(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return Cs(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:ks,global:$s,isContextDefined:Bs,isSpecCompliantForm:function(e){return!!(e&&Ps(e.append)&&"FormData"===e[ys]&&e[ms])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(Ds(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const s=Cs(e)?[]:{};return Vs(e,((e,t)=>{const a=n(e,r+1);!Ss(a)&&(s[t]=a)})),t[r]=void 0,s}}return e};return n(e,0)},isAsyncFn:Ks,isThenable:e=>e&&(Ds(e)||Ps(e))&&Ps(e.then)&&Ps(e.catch),setImmediate:Xs,asap:ta,isIterable:e=>null!=e&&Ps(e[ms])};function ra(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}na.inherits(ra,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:na.toJSONObject(this.config),code:this.code,status:this.status}}});const sa=ra.prototype,aa={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{aa[e]={value:e}})),Object.defineProperties(ra,aa),Object.defineProperty(sa,"isAxiosError",{value:!0}),ra.from=(e,t,n,r,s,a)=>{const o=Object.create(sa);return na.toFlatObject(e,o,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),ra.call(o,e.message,t,n,r,s),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};const oa=ra;function ia(e){return na.isPlainObject(e)||na.isArray(e)}function ca(e){return na.endsWith(e,"[]")?e.slice(0,-2):e}function la(e,t,n){return e?e.concat(t).map((function(e,t){return e=ca(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const ua=na.toFlatObject(na,{},null,(function(e){return/^is[A-Z]/.test(e)}));const da=function(e,t,n){if(!na.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=na.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!na.isUndefined(t[e])}))).metaTokens,s=n.visitor||l,a=n.dots,o=n.indexes,i=(n.Blob||"undefined"!=typeof Blob&&Blob)&&na.isSpecCompliantForm(t);if(!na.isFunction(s))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(na.isDate(e))return e.toISOString();if(na.isBoolean(e))return e.toString();if(!i&&na.isBlob(e))throw new oa("Blob is not supported. Use a Buffer instead.");return na.isArrayBuffer(e)||na.isTypedArray(e)?i&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,s){let i=e;if(e&&!s&&"object"==typeof e)if(na.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(na.isArray(e)&&function(e){return na.isArray(e)&&!e.some(ia)}(e)||(na.isFileList(e)||na.endsWith(n,"[]"))&&(i=na.toArray(e)))return n=ca(n),i.forEach((function(e,r){!na.isUndefined(e)&&null!==e&&t.append(!0===o?la([n],r,a):null===o?n:n+"[]",c(e))})),!1;return!!ia(e)||(t.append(la(s,n,a),c(e)),!1)}const u=[],d=Object.assign(ua,{defaultVisitor:l,convertValue:c,isVisitable:ia});if(!na.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!na.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),na.forEach(n,(function(n,a){!0===(!(na.isUndefined(n)||null===n)&&s.call(t,n,na.isString(a)?a.trim():a,r,d))&&e(n,r?r.concat(a):[a])})),u.pop()}}(e),t};function pa(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function ha(e,t){this._pairs=[],e&&da(e,this,t)}const ga=ha.prototype;ga.append=function(e,t){this._pairs.push([e,t])},ga.toString=function(e){const t=e?function(t){return e.call(this,t,pa)}:pa;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const fa=ha;function ma(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ya(e,t,n){if(!t)return e;const r=n&&n.encode||ma;na.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let a;if(a=s?s(t,n):na.isURLSearchParams(t)?t.toString():new fa(t,n).toString(r),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}const Ia=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){na.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Ea={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Aa={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:fa,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},_a="undefined"!=typeof window&&"undefined"!=typeof document,Ca="object"==typeof navigator&&navigator||void 0,Sa=_a&&(!Ca||["ReactNative","NativeScript","NS"].indexOf(Ca.product)<0),Ta="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Na=_a&&window.location.href||"http://localhost",Pa={...a,...Aa};const Ra=function(e){function t(e,n,r,s){let a=e[s++];if("__proto__"===a)return!0;const o=Number.isFinite(+a),i=s>=e.length;if(a=!a&&na.isArray(r)?r.length:a,i)return na.hasOwnProp(r,a)?r[a]=[r[a],n]:r[a]=n,!o;r[a]&&na.isObject(r[a])||(r[a]=[]);return t(e,n,r[a],s)&&na.isArray(r[a])&&(r[a]=function(e){const t={},n=Object.keys(e);let r;const s=n.length;let a;for(r=0;r<s;r++)a=n[r],t[a]=e[a];return t}(r[a])),!o}if(na.isFormData(e)&&na.isFunction(e.entries)){const n={};return na.forEachEntry(e,((e,r)=>{t(function(e){return na.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null};const Da={transitional:Ea,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,s=na.isObject(e);s&&na.isHTMLForm(e)&&(e=new FormData(e));if(na.isFormData(e))return r?JSON.stringify(Ra(e)):e;if(na.isArrayBuffer(e)||na.isBuffer(e)||na.isStream(e)||na.isFile(e)||na.isBlob(e)||na.isReadableStream(e))return e;if(na.isArrayBufferView(e))return e.buffer;if(na.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return da(e,new Pa.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return Pa.isNode&&na.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((a=na.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return da(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return s||r?(t.setContentType("application/json",!1),function(e,t,n){if(na.isString(e))try{return(t||JSON.parse)(e),na.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Da.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(na.isResponse(e)||na.isReadableStream(e))return e;if(e&&na.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw oa.from(e,oa.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Pa.classes.FormData,Blob:Pa.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};na.forEach(["delete","get","head","post","put","patch"],(e=>{Da.headers[e]={}}));const ba=Da,Oa=na.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),va=Symbol("internals");function xa(e){return e&&String(e).trim().toLowerCase()}function wa(e){return!1===e||null==e?e:na.isArray(e)?e.map(wa):String(e)}function Ma(e,t,n,r,s){return na.isFunction(r)?r.call(this,t,n):(s&&(t=n),na.isString(t)?na.isString(r)?-1!==t.indexOf(r):na.isRegExp(r)?r.test(t):void 0:void 0)}class La{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function s(e,t,n){const s=xa(t);if(!s)throw new Error("header name must be a non-empty string");const a=na.findKey(r,s);(!a||void 0===r[a]||!0===n||void 0===n&&!1!==r[a])&&(r[a||t]=wa(e))}const a=(e,t)=>na.forEach(e,((e,n)=>s(e,n,t)));if(na.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(na.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))a((e=>{const t={};let n,r,s;return e&&e.split("\n").forEach((function(e){s=e.indexOf(":"),n=e.substring(0,s).trim().toLowerCase(),r=e.substring(s+1).trim(),!n||t[n]&&Oa[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t);else if(na.isObject(e)&&na.isIterable(e)){let n,r,s={};for(const t of e){if(!na.isArray(t))throw TypeError("Object iterator must return a key-value pair");s[r=t[0]]=(n=s[r])?na.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}a(s,t)}else null!=e&&s(t,e,n);return this}get(e,t){if(e=xa(e)){const n=na.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(na.isFunction(t))return t.call(this,e,n);if(na.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=xa(e)){const n=na.findKey(this,e);return!(!n||void 0===this[n]||t&&!Ma(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function s(e){if(e=xa(e)){const s=na.findKey(n,e);!s||t&&!Ma(0,n[s],s,t)||(delete n[s],r=!0)}}return na.isArray(e)?e.forEach(s):s(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const s=t[n];e&&!Ma(0,this[s],s,e,!0)||(delete this[s],r=!0)}return r}normalize(e){const t=this,n={};return na.forEach(this,((r,s)=>{const a=na.findKey(n,s);if(a)return t[a]=wa(r),void delete t[s];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(s):String(s).trim();o!==s&&delete t[s],t[o]=wa(r),n[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return na.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&na.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[va]=this[va]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=xa(e);t[r]||(!function(e,t){const n=na.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,s){return this[r].call(this,t,e,n,s)},configurable:!0})}))}(n,e),t[r]=!0)}return na.isArray(e)?e.forEach(r):r(e),this}}La.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),na.reduceDescriptors(La.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),na.freezeMethods(La);const Ua=La;function Fa(e,t){const n=this||ba,r=t||n,s=Ua.from(r.headers);let a=r.data;return na.forEach(e,(function(e){a=e.call(n,a,s.normalize(),t?t.status:void 0)})),s.normalize(),a}function ja(e){return!(!e||!e.__CANCEL__)}function Va(e,t,n){oa.call(this,null==e?"canceled":e,oa.ERR_CANCELED,t,n),this.name="CanceledError"}na.inherits(Va,oa,{__CANCEL__:!0});const ka=Va;function $a(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new oa("Request failed with status code "+n.status,[oa.ERR_BAD_REQUEST,oa.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const Ba=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s,a=0,o=0;return t=void 0!==t?t:1e3,function(i){const c=Date.now(),l=r[o];s||(s=c),n[a]=i,r[a]=c;let u=o,d=0;for(;u!==a;)d+=n[u++],u%=e;if(a=(a+1)%e,a===o&&(o=(o+1)%e),c-s<t)return;const p=l&&c-l;return p?Math.round(1e3*d/p):void 0}};const Ga=function(e,t){let n,r,s=0,a=1e3/t;const o=(t,a=Date.now())=>{s=a,n=null,r&&(clearTimeout(r),r=null),e.apply(null,t)};return[(...e)=>{const t=Date.now(),i=t-s;i>=a?o(e,t):(n=e,r||(r=setTimeout((()=>{r=null,o(n)}),a-i)))},()=>n&&o(n)]},Wa=(e,t,n=3)=>{let r=0;const s=Ba(50,250);return Ga((n=>{const a=n.loaded,o=n.lengthComputable?n.total:void 0,i=a-r,c=s(i);r=a;e({loaded:a,total:o,progress:o?a/o:void 0,bytes:i,rate:c||void 0,estimated:c&&o&&a<=o?(o-a)/c:void 0,event:n,lengthComputable:null!=o,[t?"download":"upload"]:!0})}),n)},Ha=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},qa=e=>(...t)=>na.asap((()=>e(...t))),za=Pa.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Pa.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Pa.origin),Pa.navigator&&/(msie|trident)/i.test(Pa.navigator.userAgent)):()=>!0,Ya=Pa.hasStandardBrowserEnv?{write(e,t,n,r,s,a){const o=[e+"="+encodeURIComponent(t)];na.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),na.isString(r)&&o.push("path="+r),na.isString(s)&&o.push("domain="+s),!0===a&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Ka(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Xa=e=>e instanceof Ua?{...e}:e;function Ja(e,t){t=t||{};const n={};function r(e,t,n,r){return na.isPlainObject(e)&&na.isPlainObject(t)?na.merge.call({caseless:r},e,t):na.isPlainObject(t)?na.merge({},t):na.isArray(t)?t.slice():t}function s(e,t,n,s){return na.isUndefined(t)?na.isUndefined(e)?void 0:r(void 0,e,0,s):r(e,t,0,s)}function a(e,t){if(!na.isUndefined(t))return r(void 0,t)}function o(e,t){return na.isUndefined(t)?na.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function i(n,s,a){return a in t?r(n,s):a in e?r(void 0,n):void 0}const c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:i,headers:(e,t,n)=>s(Xa(e),Xa(t),0,!0)};return na.forEach(Object.keys(Object.assign({},e,t)),(function(r){const a=c[r]||s,o=a(e[r],t[r],r);na.isUndefined(o)&&a!==i||(n[r]=o)})),n}const Qa=e=>{const t=Ja({},e);let n,{data:r,withXSRFToken:s,xsrfHeaderName:a,xsrfCookieName:o,headers:i,auth:c}=t;if(t.headers=i=Ua.from(i),t.url=ya(Ka(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),na.isFormData(r))if(Pa.hasStandardBrowserEnv||Pa.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(!1!==(n=i.getContentType())){const[e,...t]=n?n.split(";").map((e=>e.trim())).filter(Boolean):[];i.setContentType([e||"multipart/form-data",...t].join("; "))}if(Pa.hasStandardBrowserEnv&&(s&&na.isFunction(s)&&(s=s(t)),s||!1!==s&&za(t.url))){const e=a&&o&&Ya.read(o);e&&i.set(a,e)}return t},Za="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=Qa(e);let s=r.data;const a=Ua.from(r.headers).normalize();let o,i,c,l,u,{responseType:d,onUploadProgress:p,onDownloadProgress:h}=r;function g(){l&&l(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(o),r.signal&&r.signal.removeEventListener("abort",o)}let f=new XMLHttpRequest;function m(){if(!f)return;const r=Ua.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders());$a((function(e){t(e),g()}),(function(e){n(e),g()}),{data:d&&"text"!==d&&"json"!==d?f.response:f.responseText,status:f.status,statusText:f.statusText,headers:r,config:e,request:f}),f=null}f.open(r.method.toUpperCase(),r.url,!0),f.timeout=r.timeout,"onloadend"in f?f.onloadend=m:f.onreadystatechange=function(){f&&4===f.readyState&&(0!==f.status||f.responseURL&&0===f.responseURL.indexOf("file:"))&&setTimeout(m)},f.onabort=function(){f&&(n(new oa("Request aborted",oa.ECONNABORTED,e,f)),f=null)},f.onerror=function(){n(new oa("Network Error",oa.ERR_NETWORK,e,f)),f=null},f.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const s=r.transitional||Ea;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new oa(t,s.clarifyTimeoutError?oa.ETIMEDOUT:oa.ECONNABORTED,e,f)),f=null},void 0===s&&a.setContentType(null),"setRequestHeader"in f&&na.forEach(a.toJSON(),(function(e,t){f.setRequestHeader(t,e)})),na.isUndefined(r.withCredentials)||(f.withCredentials=!!r.withCredentials),d&&"json"!==d&&(f.responseType=r.responseType),h&&([c,u]=Wa(h,!0),f.addEventListener("progress",c)),p&&f.upload&&([i,l]=Wa(p),f.upload.addEventListener("progress",i),f.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(o=t=>{f&&(n(!t||t.type?new ka(null,e,f):t),f.abort(),f=null)},r.cancelToken&&r.cancelToken.subscribe(o),r.signal&&(r.signal.aborted?o():r.signal.addEventListener("abort",o)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);y&&-1===Pa.protocols.indexOf(y)?n(new oa("Unsupported protocol "+y+":",oa.ERR_BAD_REQUEST,e)):f.send(s||null)}))},eo=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const s=function(e){if(!n){n=!0,o();const t=e instanceof Error?e:this.reason;r.abort(t instanceof oa?t:new ka(t instanceof Error?t.message:t))}};let a=t&&setTimeout((()=>{a=null,s(new oa(`timeout ${t} of ms exceeded`,oa.ETIMEDOUT))}),t);const o=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(s):e.removeEventListener("abort",s)})),e=null)};e.forEach((e=>e.addEventListener("abort",s)));const{signal:i}=r;return i.unsubscribe=()=>na.asap(o),i}},to=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,s=0;for(;s<n;)r=s+t,yield e.slice(s,r),s=r},no=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},ro=(e,t,n,r)=>{const s=async function*(e,t){for await(const n of no(e))yield*to(n,t)}(e,t);let a,o=0,i=e=>{a||(a=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await s.next();if(t)return i(),void e.close();let a=r.byteLength;if(n){let e=o+=a;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw i(e),e}},cancel:e=>(i(e),s.return())},{highWaterMark:2})},so="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,ao=so&&"function"==typeof ReadableStream,oo=so&&("function"==typeof TextEncoder?(io=new TextEncoder,e=>io.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var io;const co=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},lo=ao&&co((()=>{let e=!1;const t=new Request(Pa.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),uo=ao&&co((()=>na.isReadableStream(new Response("").body))),po={stream:uo&&(e=>e.body)};var ho;so&&(ho=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!po[e]&&(po[e]=na.isFunction(ho[e])?t=>t[e]():(t,n)=>{throw new oa(`Response type '${e}' is not supported`,oa.ERR_NOT_SUPPORT,n)})})));const go=async(e,t)=>{const n=na.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(na.isBlob(e))return e.size;if(na.isSpecCompliantForm(e)){const t=new Request(Pa.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return na.isArrayBufferView(e)||na.isArrayBuffer(e)?e.byteLength:(na.isURLSearchParams(e)&&(e+=""),na.isString(e)?(await oo(e)).byteLength:void 0)})(t):n},fo=so&&(async e=>{let{url:t,method:n,data:r,signal:s,cancelToken:a,timeout:o,onDownloadProgress:i,onUploadProgress:c,responseType:l,headers:u,withCredentials:d="same-origin",fetchOptions:p}=Qa(e);l=l?(l+"").toLowerCase():"text";let h,g=eo([s,a&&a.toAbortSignal()],o);const f=g&&g.unsubscribe&&(()=>{g.unsubscribe()});let m;try{if(c&&lo&&"get"!==n&&"head"!==n&&0!==(m=await go(u,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(na.isFormData(r)&&(e=n.headers.get("content-type"))&&u.setContentType(e),n.body){const[e,t]=Ha(m,Wa(qa(c)));r=ro(n.body,65536,e,t)}}na.isString(d)||(d=d?"include":"omit");const s="credentials"in Request.prototype;h=new Request(t,{...p,signal:g,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:s?d:void 0});let a=await fetch(h,p);const o=uo&&("stream"===l||"response"===l);if(uo&&(i||o&&f)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=a[t]}));const t=na.toFiniteNumber(a.headers.get("content-length")),[n,r]=i&&Ha(t,Wa(qa(i),!0))||[];a=new Response(ro(a.body,65536,n,(()=>{r&&r(),f&&f()})),e)}l=l||"text";let y=await po[na.findKey(po,l)||"text"](a,e);return!o&&f&&f(),await new Promise(((t,n)=>{$a(t,n,{data:y,headers:Ua.from(a.headers),status:a.status,statusText:a.statusText,config:e,request:h})}))}catch(t){if(f&&f(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new oa("Network Error",oa.ERR_NETWORK,e,h),{cause:t.cause||t});throw oa.from(t,t&&t.code,e,h)}}),mo={http:null,xhr:Za,fetch:fo};na.forEach(mo,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const yo=e=>`- ${e}`,Io=e=>na.isFunction(e)||null===e||!1===e,Eo=e=>{e=na.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let a=0;a<t;a++){let t;if(n=e[a],r=n,!Io(n)&&(r=mo[(t=String(n)).toLowerCase()],void 0===r))throw new oa(`Unknown adapter '${t}'`);if(r)break;s[t||"#"+a]=r}if(!r){const e=Object.entries(s).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));let n=t?e.length>1?"since :\n"+e.map(yo).join("\n"):" "+yo(e[0]):"as no adapter specified";throw new oa("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return r};function Ao(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ka(null,e)}function _o(e){Ao(e),e.headers=Ua.from(e.headers),e.data=Fa.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Eo(e.adapter||ba.adapter)(e).then((function(t){return Ao(e),t.data=Fa.call(e,e.transformResponse,t),t.headers=Ua.from(t.headers),t}),(function(t){return ja(t)||(Ao(e),t&&t.response&&(t.response.data=Fa.call(e,e.transformResponse,t.response),t.response.headers=Ua.from(t.response.headers))),Promise.reject(t)}))}const Co="1.10.0",So={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{So[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const To={};So.transitional=function(e,t,n){function r(e,t){return"[Axios v"+Co+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,s,a)=>{if(!1===e)throw new oa(r(s," has been removed"+(t?" in "+t:"")),oa.ERR_DEPRECATED);return t&&!To[s]&&(To[s]=!0,console.warn(r(s," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,s,a)}},So.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const No={assertOptions:function(e,t,n){if("object"!=typeof e)throw new oa("options must be an object",oa.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const a=r[s],o=t[a];if(o){const t=e[a],n=void 0===t||o(t,a,e);if(!0!==n)throw new oa("option "+a+" must be "+n,oa.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new oa("Unknown option "+a,oa.ERR_BAD_OPTION)}},validators:So},Po=No.validators;class Ro{constructor(e){this.defaults=e||{},this.interceptors={request:new Ia,response:new Ia}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Ja(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:s}=t;void 0!==n&&No.assertOptions(n,{silentJSONParsing:Po.transitional(Po.boolean),forcedJSONParsing:Po.transitional(Po.boolean),clarifyTimeoutError:Po.transitional(Po.boolean)},!1),null!=r&&(na.isFunction(r)?t.paramsSerializer={serialize:r}:No.assertOptions(r,{encode:Po.function,serialize:Po.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),No.assertOptions(t,{baseUrl:Po.spelling("baseURL"),withXsrfToken:Po.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=s&&na.merge(s.common,s[t.method]);s&&na.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete s[e]})),t.headers=Ua.concat(a,s);const o=[];let i=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(i=i&&e.synchronous,o.unshift(e.fulfilled,e.rejected))}));const c=[];let l;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let u,d=0;if(!i){const e=[_o.bind(this),void 0];for(e.unshift.apply(e,o),e.push.apply(e,c),u=e.length,l=Promise.resolve(t);d<u;)l=l.then(e[d++],e[d++]);return l}u=o.length;let p=t;for(d=0;d<u;){const e=o[d++],t=o[d++];try{p=e(p)}catch(e){t.call(this,e);break}}try{l=_o.call(this,p)}catch(e){return Promise.reject(e)}for(d=0,u=c.length;d<u;)l=l.then(c[d++],c[d++]);return l}getUri(e){return ya(Ka((e=Ja(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}na.forEach(["delete","get","head","options"],(function(e){Ro.prototype[e]=function(t,n){return this.request(Ja(n||{},{method:e,url:t,data:(n||{}).data}))}})),na.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,s){return this.request(Ja(s||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Ro.prototype[e]=t(),Ro.prototype[e+"Form"]=t(!0)}));const Do=Ro;class bo{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,s){n.reason||(n.reason=new ka(e,r,s),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new bo((function(t){e=t})),cancel:e}}}const Oo=bo;const vo={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(vo).forEach((([e,t])=>{vo[t]=e}));const xo=vo;const wo=function e(t){const n=new Do(t),r=hs(Do.prototype.request,n);return na.extend(r,Do.prototype,n,{allOwnKeys:!0}),na.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Ja(t,n))},r}(ba);wo.Axios=Do,wo.CanceledError=ka,wo.CancelToken=Oo,wo.isCancel=ja,wo.VERSION=Co,wo.toFormData=da,wo.AxiosError=oa,wo.Cancel=wo.CanceledError,wo.all=function(e){return Promise.all(e)},wo.spread=function(e){return function(t){return e.apply(null,t)}},wo.isAxiosError=function(e){return na.isObject(e)&&!0===e.isAxiosError},wo.mergeConfig=Ja,wo.AxiosHeaders=Ua,wo.formToJSON=e=>Ra(na.isHTMLForm(e)?new FormData(e):e),wo.getAdapter=Eo,wo.HttpStatusCode=xo,wo.default=wo;const Mo=wo;function Lo(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var Uo=Lo((function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}}));var Fo=function(e,t){return Fo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Fo(e,t)};function jo(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Fo(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function Vo(e,t,n,r){return new(n||(n=Promise))((function(s,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function i(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,i)}c((r=r.apply(e,t||[])).next())}))}function ko(e,t){var n,r,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=i(0),o.throw=i(1),o.return=i(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function i(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,i[0]&&(a=0)),a;)try{if(n=1,r&&(s=2&i[0]?r.return:i[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,i[1])).done)return s;switch(r=0,s&&(i=[2&i[0],s.value]),i[0]){case 0:case 1:s=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(s=a.trys,(s=s.length>0&&s[s.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!s||i[1]>s[0]&&i[1]<s[3])){a.label=i[1];break}if(6===i[0]&&a.label<s[1]){a.label=s[1],s=i;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(i);break}s[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=s=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}Object.create;function $o(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Bo(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,s,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(e){s={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(s)throw s.error}}return o}function Go(e,t,n){if(n||2===arguments.length)for(var r,s=0,a=t.length;s<a;s++)!r&&s in t||(r||(r=Array.prototype.slice.call(t,0,s)),r[s]=t[s]);return e.concat(r||Array.prototype.slice.call(t))}function Wo(e){return this instanceof Wo?(this.v=e,this):new Wo(e)}function Ho(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,s=n.apply(e,t||[]),a=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",(function(e){return function(t){return Promise.resolve(t).then(e,l)}})),r[Symbol.asyncIterator]=function(){return this},r;function o(e,t){s[e]&&(r[e]=function(t){return new Promise((function(n,r){a.push([e,t,n,r])>1||i(e,t)}))},t&&(r[e]=t(r[e])))}function i(e,t){try{(n=s[e](t)).value instanceof Wo?Promise.resolve(n.value.v).then(c,l):u(a[0][2],n)}catch(e){u(a[0][3],e)}var n}function c(e){i("next",e)}function l(e){i("throw",e)}function u(e,t){e(t),a.shift(),a.length&&i(a[0][0],a[0][1])}}function qo(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=$o(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,s){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,s,(t=e[n](t)).done,t.value)}))}}}Object.create;"function"==typeof SuppressedError&&SuppressedError;var zo=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function Yo(e){return"function"==typeof e}function Ko(e){return Yo(null==e?void 0:e.then)}var Xo=Lo((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}}));function Jo(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var Qo=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,t,n,r,s;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var o=$o(a),i=o.next();!i.done;i=o.next()){i.value.remove(this)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}else a.remove(this);var c=this.initialTeardown;if(Yo(c))try{c()}catch(e){s=e instanceof Xo?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var u=$o(l),d=u.next();!d.done;d=u.next()){var p=d.value;try{ti(p)}catch(e){s=null!=s?s:[],e instanceof Xo?s=Go(Go([],Bo(s)),Bo(e.errors)):s.push(e)}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}if(s)throw new Xo(s)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)ti(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Jo(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&Jo(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}(),Zo=Qo.EMPTY;function ei(e){return e instanceof Qo||e&&"closed"in e&&Yo(e.remove)&&Yo(e.add)&&Yo(e.unsubscribe)}function ti(e){Yo(e)?e():e.unsubscribe()}var ni={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},ri={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var s=ri.delegate;return(null==s?void 0:s.setTimeout)?s.setTimeout.apply(s,Go([e,t],Bo(n))):setTimeout.apply(void 0,Go([e,t],Bo(n)))},clearTimeout:function(e){var t=ri.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function si(e){ri.setTimeout((function(){var t=ni.onUnhandledError;if(!t)throw e;t(e)}))}function ai(){}var oi=ii("C",void 0,void 0);function ii(e,t,n){return{kind:e,value:t,error:n}}var ci=null;function li(e){if(ni.useDeprecatedSynchronousErrorHandling){var t=!ci;if(t&&(ci={errorThrown:!1,error:null}),e(),t){var n=ci,r=n.errorThrown,s=n.error;if(ci=null,r)throw s}}else e()}var ui=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,ei(t)&&t.add(n)):n.destination=yi,n}return jo(t,e),t.create=function(e,t,n){return new gi(e,t,n)},t.prototype.next=function(e){this.isStopped?mi(function(e){return ii("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?mi(ii("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?mi(oi,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(Qo),di=Function.prototype.bind;function pi(e,t){return di.call(e,t)}var hi=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){fi(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){fi(e)}else fi(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){fi(e)}},e}(),gi=function(e){function t(t,n,r){var s,a,o=e.call(this)||this;Yo(t)||!t?s={next:null!=t?t:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:o&&ni.useDeprecatedNextContext?((a=Object.create(t)).unsubscribe=function(){return o.unsubscribe()},s={next:t.next&&pi(t.next,a),error:t.error&&pi(t.error,a),complete:t.complete&&pi(t.complete,a)}):s=t;return o.destination=new hi(s),o}return jo(t,e),t}(ui);function fi(e){var t;ni.useDeprecatedSynchronousErrorHandling?(t=e,ni.useDeprecatedSynchronousErrorHandling&&ci&&(ci.errorThrown=!0,ci.error=t)):si(e)}function mi(e,t){var n=ni.onStoppedNotification;n&&ri.setTimeout((function(){return n(e,t)}))}var yi={closed:!0,next:ai,error:function(e){throw e},complete:ai},Ii="function"==typeof Symbol&&Symbol.observable||"@@observable";function Ei(e){return e}function Ai(e){return 0===e.length?Ei:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var _i=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r,s=this,a=(r=e)&&r instanceof ui||function(e){return e&&Yo(e.next)&&Yo(e.error)&&Yo(e.complete)}(r)&&ei(r)?e:new gi(e,t,n);return li((function(){var e=s,t=e.operator,n=e.source;a.add(t?t.call(a,n):n?s._subscribe(a):s._trySubscribe(a))})),a},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=Ci(t))((function(t,r){var s=new gi({next:function(t){try{e(t)}catch(e){r(e),s.unsubscribe()}},error:r,complete:t});n.subscribe(s)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[Ii]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ai(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=Ci(e))((function(e,n){var r;t.subscribe((function(e){return r=e}),(function(e){return n(e)}),(function(){return e(r)}))}))},e.create=function(t){return new e(t)},e}();function Ci(e){var t;return null!==(t=null!=e?e:ni.Promise)&&void 0!==t?t:Promise}function Si(e){return Yo(e[Ii])}function Ti(e){return Symbol.asyncIterator&&Yo(null==e?void 0:e[Symbol.asyncIterator])}function Ni(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}var Pi="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function Ri(e){return Yo(null==e?void 0:e[Pi])}function Di(e){return Ho(this,arguments,(function(){var t,n,r;return ko(this,(function(s){switch(s.label){case 0:t=e.getReader(),s.label=1;case 1:s.trys.push([1,,9,10]),s.label=2;case 2:return[4,Wo(t.read())];case 3:return n=s.sent(),r=n.value,n.done?[4,Wo(void 0)]:[3,5];case 4:return[2,s.sent()];case 5:return[4,Wo(r)];case 6:return[4,s.sent()];case 7:return s.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}function bi(e){return Yo(null==e?void 0:e.getReader)}function Oi(e){if(e instanceof _i)return e;if(null!=e){if(Si(e))return s=e,new _i((function(e){var t=s[Ii]();if(Yo(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(zo(e))return r=e,new _i((function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()}));if(Ko(e))return n=e,new _i((function(e){n.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,si)}));if(Ti(e))return vi(e);if(Ri(e))return t=e,new _i((function(e){var n,r;try{for(var s=$o(t),a=s.next();!a.done;a=s.next()){var o=a.value;if(e.next(o),e.closed)return}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}e.complete()}));if(bi(e))return vi(Di(e))}var t,n,r,s;throw Ni(e)}function vi(e){return new _i((function(t){(function(e,t){var n,r,s,a;return Vo(this,void 0,void 0,(function(){var o,i;return ko(this,(function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=qo(e),c.label=1;case 1:return[4,n.next()];case 2:if((r=c.sent()).done)return[3,4];if(o=r.value,t.next(o),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return i=c.sent(),s={error:i},[3,11];case 6:return c.trys.push([6,,9,10]),r&&!r.done&&(a=n.return)?[4,a.call(n)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(s)throw s.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}function xi(e,t,n,r,s){void 0===r&&(r=0),void 0===s&&(s=!1);var a=t.schedule((function(){n(),s?e.add(this.schedule(null,r)):this.unsubscribe()}),r);if(e.add(a),!s)return a}function wi(e){return function(t){if(function(e){return Yo(null==e?void 0:e.lift)}(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}function Mi(e,t,n,r,s){return new Li(e,t,n,r,s)}var Li=function(e){function t(t,n,r,s,a,o){var i=e.call(this,t)||this;return i.onFinalize=a,i.shouldUnsubscribe=o,i._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,i._error=s?function(e){try{s(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,i._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,i}return jo(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},t}(ui);function Ui(e,t){return void 0===t&&(t=0),wi((function(n,r){n.subscribe(Mi(r,(function(n){return xi(r,e,(function(){return r.next(n)}),t)}),(function(){return xi(r,e,(function(){return r.complete()}),t)}),(function(n){return xi(r,e,(function(){return r.error(n)}),t)})))}))}function Fi(e,t){return void 0===t&&(t=0),wi((function(n,r){r.add(e.schedule((function(){return n.subscribe(r)}),t))}))}function ji(e,t){if(!e)throw new Error("Iterable cannot be null");return new _i((function(n){xi(n,t,(function(){var r=e[Symbol.asyncIterator]();xi(n,t,(function(){r.next().then((function(e){e.done?n.complete():n.next(e.value)}))}),0,!0)}))}))}function Vi(e,t){if(null!=e){if(Si(e))return function(e,t){return Oi(e).pipe(Fi(t),Ui(t))}(e,t);if(zo(e))return function(e,t){return new _i((function(n){var r=0;return t.schedule((function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())}))}))}(e,t);if(Ko(e))return function(e,t){return Oi(e).pipe(Fi(t),Ui(t))}(e,t);if(Ti(e))return ji(e,t);if(Ri(e))return function(e,t){return new _i((function(n){var r;return xi(n,t,(function(){r=e[Pi](),xi(n,t,(function(){var e,t,s;try{t=(e=r.next()).value,s=e.done}catch(e){return void n.error(e)}s?n.complete():n.next(t)}),0,!0)})),function(){return Yo(null==r?void 0:r.return)&&r.return()}}))}(e,t);if(bi(e))return function(e,t){return ji(Di(e),t)}(e,t)}throw Ni(e)}function ki(e,t){return t?Vi(e,t):Oi(e)}function $i(e,t,n){var r=Yo(e)||t||n?{next:e,error:t,complete:n}:e;return r?wi((function(e,t){var n;null===(n=r.subscribe)||void 0===n||n.call(r);var s=!0;e.subscribe(Mi(t,(function(e){var n;null===(n=r.next)||void 0===n||n.call(r,e),t.next(e)}),(function(){var e;s=!1,null===(e=r.complete)||void 0===e||e.call(r),t.complete()}),(function(e){var n;s=!1,null===(n=r.error)||void 0===n||n.call(r,e),t.error(e)}),(function(){var e,t;s&&(null===(e=r.unsubscribe)||void 0===e||e.call(r)),null===(t=r.finalize)||void 0===t||t.call(r)})))})):Ei}class Bi{constructor(e,t=!0){this.config=e,t?(this.ssKeyConfig=e,this.reloadConfig()):this.updateConfig(e,!1)}static init(e,t=!0){return new Bi(e,t)}updateConfig(e,t=!0){t?window.sessionStorage.setItem(this.ssKeyConfig,JSON.stringify(this.config)):Ec(e)}reloadConfig(e=!0){if(e){const e=window.sessionStorage.getItem(this.ssKeyConfig);this.config=e?JSON.parse(e):null}else this.config=Ac()}async buildAuthorizeUrl(e){e=e||window.btoa(location.origin);let{sessionIndex:t}=this.config;const{password:n}=this.config,r=this.config.clientId?this.config.clientId:this.config.client_id,s=this.config.redirectUri?this.config.redirectUri:this.config.redirect_uri,a=this.config.authorizeUri?this.config.authorizeUri:this.config.endPoints.authorize,o=this.config.authService?this.config.authService:this.config.authentication_service||"pega",i=this.config.appAlias?this.config.appAlias:lp.getApplicationAlias(),c=this.config.userIdentifier?this.config.userIdentifier:this.config.user_identifier;t=t||this.config.tokenInfo.session_index;const l=t?`&session_index=${t}`:`${c}`?`&UserIdentifier=${c}`:`${n}`?`&Password=${window.atob(n)}`:"",u=new Uint8Array(64);window.crypto?.getRandomValues(u),this.config.codeVerifier=this.base64UrlSafeEncode(u),this.updateConfig(this.config,!1);const d=i?`+app.alias.${i.replace(/^app\//,"")}`:"";return this.getCodeChallenge(this.config.codeVerifier)?.then((t=>`${a}?client_id=${r}&response_type=code&redirect_uri=${s}&scope=openid${d}&state=${e}&code_challenge=${t}&code_challenge_method=S256&authentication_service=${o}&enable_psyncId=true${l}`))?.catch((()=>null))}getTokenAndFinish=e=>{window.removeEventListener("message",this.authMessageHandler,!1),this.getToken(e,!1).then((()=>{})).catch((e=>{console.log(e)}))};authMessageHandler=e=>{if(e.origin!==this.getRedirectUriOrigin())return;if(!e.data||!e.data.type||"PegaAuth"!==e.data.type)return;const t=e.data.code.toString();this.getTokenAndFinish(t)};getRedirectUriOrigin=()=>{let{redirectUri:e}=this.config;e=e||this.config.redirect_uri;const t=e.indexOf("//"),n=-1!==t?e.indexOf("/",t+2):-1;return-1!==n?e.substring(0,n):e};getToken(e,t){this.reloadConfig(t);const n=this.config.clientId?this.config.clientId:this.config.client_id,r=this.config.clientSecret?this.config.clientSecret:this.config.client_secret,s=this.config.redirectUri?this.config.redirectUri:this.config.redirect_uri,a=this.config.tokenUri?this.config.tokenUri:this.config.endPoints.token,{codeVerifier:o}=this.config,i=window.location.search,c=new URLSearchParams(i),l=e||c.get("code"),u=new URLSearchParams;return u.append("client_id",n),r&&u.append("client_secret",r),u.append("grant_type","authorization_code"),u.append("code",l),u.append("redirect_uri",s),u.append("code_verifier",o),this.config?.secureCookie&&u.append("send_token_as_cookie","true"),pc(a,{method:"POST",headers:new Headers({"content-type":"application/x-www-form-urlencoded"}),body:u.toString()}).then((e=>e.data)).then((e=>{e.eA=Date.now()+1e3*e.expires_in;let n=!1;if(this.config.codeVerifier&&(delete this.config.codeVerifier,n=!0),e.session_index&&(this.config.session_index=e.session_index,n=!0),n){this.updateConfig(this.config,t),this.config?.secureCookie?yc({pzCTkn:e?.csrf}):(Ic({tokenInfo:e}),yc({Authorization:`${e?.token_type} ${e?.access_token}`}));const{onTokenRetrieval:n}=this.config;n&&"function"==typeof n&&n(e),window.postMessage("oAuthSuccess")}return e})).catch((()=>null))}sha256Hash(e){return window.crypto?.subtle?.digest("SHA-256",(new TextEncoder).encode(e))}encode64(e){return window.btoa(new Uint8Array(e).reduce(((e,t)=>e+String.fromCharCode(t)),""))}base64UrlSafeEncode(e){return this.encode64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}getCodeChallenge(e){return this.sha256Hash(e)?.then((e=>this.base64UrlSafeEncode(e))).catch((e=>{console.log(e)})).finally((()=>null))}}const Gi=Bi,Wi=async()=>new Promise((async(e,t)=>{const n=_c();if(!n?.tokenInfo)return void t(new Error("Missing token information."));const{access_token:r,refresh_token:s=null}=n.tokenInfo,{revoke:a}=n.endPoints,{client_id:o,client_secret:i,secureCookie:c}=n,l={"content-type":"application/x-www-form-urlencoded"};i&&(l.authorization=`Basic ${window.btoa(`${o}:${i}`)}`);const u=new URLSearchParams;i||u.append("client_id",o),c&&u.append("send_token_as_cookie","true");const d=s?"refresh_token":"access_token",p="access_token"===d?r:s;!c&&p&&u.append("token",p),u.append("token_type_hint",d),await pc(a,{method:"POST",headers:new Headers(l),credentials:c?"include":"omit",body:u.toString(),withoutDefaultHeaders:!0}),yc({Authorization:null}),Ic({tokenInfo:null}),e()})),Hi=async e=>{const t={};if("OAuth2.0"===e?.authType){const n=new Gi(e,!1);t.reauthUrl=await n.buildAuthorizeUrl(),t.redirectOrigin=n.getRedirectUriOrigin(),window.addEventListener("message",n.authMessageHandler,!1)}else t.reauthUrl=E()+(I()?`${I()}`:"/?reAuth=true");return t},qi=(e,t)=>{Hi(t).then((t=>{const n={openReauthMessageModal:!0,reAuthenticationURL:t.reauthUrl,url:e,redirectOrigin:t.redirectOrigin};Gr.publish(F.PUB_SUB_EVENTS.EVENT_REAUTH,n)}))},zi=e=>{let t="",n={},r={},s=!0;if("OAuth2.0"===e?.authType){t=e.endPoints.token;const a=new URLSearchParams;(!e.tokenInfo.refresh_token||e.tokenInfo.refresh_token&&e.tokenInfo.refresh_token.length<=0)&&(s=!1),a.append("client_id",e.client_id),a.append("grant_type","refresh_token"),e.clientSecret&&a.append("client_secret",e.clientSecret),e.secureCookie&&a.append("send_token_as_cookie","true"),e.tokenInfo?.refresh_token&&a.append("refresh_token",e.tokenInfo.refresh_token),n={method:"POST",body:a.toString(),headers:{"content-type":"application/x-www-form-urlencoded"}},r={success:t=>{const{data:n}=t,r={access_token:n?.access_token,refresh_token:n?.refresh_token};Ic({tokenInfo:{...e.tokenInfo,...r}}),e.secureCookie?yc({pzCTkn:n?.csrf}):yc({Authorization:`${n?.token_type} ${n?.access_token}`});const{onTokenRetrieval:s}=e;s&&"function"==typeof s&&s(n)},failure:t=>{if(e.popupReauth)return qi(t,e);Gr.publish(F.PUB_SUB_EVENTS.EVENT_FULL_REAUTH,e)}}}else t=`${E()}/updateSession`,n={method:"GET",headers:{}},r={failure:qi};return{url:t,config:n,callback:r,isRefreshTokenPresent:s}},Yi=(e,t)=>"OAuth2.0"===t?.authType?e?.includes(t.endPoints.token):e?.includes("updateSession"),Ki=e=>{const{config:t}=e,n=t.headers&&t.headers.context;return t.data&&(t.body=t.data),{url:t.url,config:t,context:n}},Xi=(e,t,n)=>{const{config:r}=e,{url:s,config:a,callback:o,isRefreshTokenPresent:i}=zi(n),c=r.headers&&r.headers.context;r.data&&(r.body=r.data);const l=hc(r.url,r,c,t);return i?pc(s,a).then((e=>(t.setUpdateSessionStatus(!1),o?.success?.(e,r),Gr.publish("updateSession",{updateStatus:"success"}),l.then((e=>Promise.resolve(e))).catch((e=>Promise.reject(e)))))).catch((e=>e&&e.config&&Yi(e.config.url,n)?(o?.failure?.(r.url,n),l):Promise.reject(e))):(o?.failure?.(r.url,n),l)},Ji=(e,t,n,r)=>{if(e.config&&Yi(e.config.url,n))return Promise.reject(e);if(e.response&&e.response.status&&401===e.response.status&&!t.getUpdateSessionStatus()){if(Gr.unsubscribeAllWithEventType(rc),t.setUpdateSessionStatus(!0),"custom"===n?.authType){Gr.publish(F.PUB_SUB_EVENTS.EVENT_CUSTOM_REAUTH);const{url:n,config:r,context:s}=Ki(e);return hc(n,r,s,t)}return Xi(e,t,n)}if(e.response&&e.response.status&&401===e.response.status&&t.getUpdateSessionStatus()){const{url:t,config:n,context:r}=Ki(e);return pc(t,n,r)}if(e.response&&e.response.status&&422!==e.response.status&&424!==e.response.status&&e.config.headers.context&&e.response.data&&!r){const t=e.response.data.errorDetails&&e.response.data.errorDetails.map((t=>((e,t)=>t[F.TRACE_ID]?{type:"error",message:e.localizedValue||e.message,correlationID:t[F.TRACE_ID]}:{type:"error",message:e.localizedValue||e.message})(t,e.response.headers))),n=e.config.headers.context;return Yn({messages:t,category:"HTTP",context:n}),Promise.reject(e)}return Promise.reject(e)};const Qi=class{constructor(){this.updateSessionInProgress=!1}getUpdateSessionStatus=()=>this.updateSessionInProgress;setUpdateSessionStatus=e=>{this.updateSessionInProgress=e}};const Zi=class{constructor(e){this.xrayInfo={},this.xRayDebugger=e}startXRay(){if(!this.xRayDebugger.xray)return null;const e=`${Date.now()+Math.random()}`;return this.xrayInfo[e]={startTime:Date.now()/1e3},e}startXRayRestApi(e,t){this.xRayDebugger.xray&&(this.xrayInfo[e]={...this.xrayInfo[e],restApisTime:{...this.xrayInfo[e]?this.xrayInfo[e].restApisTime:{},[t]:Date.now()}})}stopXRayRestApi(e,t){this.xRayDebugger.xray&&(this.xrayInfo[e]={...this.xrayInfo[e],restApisTime:{...this.xrayInfo[e]?.restApisTime,[t]:(Date.now()-this.xrayInfo[e]?.restApisTime[t])/1e3}})}updateXRay(e,t){this.xRayDebugger.xray&&(this.xrayInfo[e]={...this.xrayInfo[e],...t})}stopXRay(e,t){this.xRayDebugger.xray&&(this.xrayInfo[e]={...this.xrayInfo[e],totalTime:Date.now()/1e3-this.xrayInfo[e].startTime},t().setXRayInfo(this.xrayInfo[e]),delete this.xrayInfo[e])}};const ec=new class{constructor(){this.xray=!1,this.onXRayCallback=null,this.xrayRuntime=new Zi(this),this.isPreview=!1,this.debugLevels="vcv=1;tracer=0;log=0"}onXRay(e){this.onXRayCallback=e}toggleXRay(e){this.xray=e,this.xrayRuntime.xrayInfo={},null!==this.onXRayCallback&&this.onXRayCallback(e)}enableXRay(){this.toggleXRay(!0)}disableXRay(){this.toggleXRay(!1)}toggle(){this.xray?this.toggleXRay(!1):this.toggleXRay(!0)}isXRayOn(){return this.xray}getXRayRuntime(){return this.xrayRuntime}setPreviewMode(){this.isPreview=!0}getPreviewMode(){return this.isPreview}enableTracer=()=>{this.debugLevels="vcv=1;tracer=1;log=0"};disableTracer=()=>{this.debugLevels="vcv=1;tracer=0;log=0"};getDebugLevels=()=>this.debugLevels};const tc=new class{constructor(){this.externalHeaders={},this.defaultHeaders={},this.SPECIAL_CHARS={SLASH:"/"}}registerHeader(e,t){return!this.defaultHeaders[e]&&(this.externalHeaders[e]=t,!0)}unRegisterHeader(e){this.externalHeaders[e]&&delete this.externalHeaders[e]}getRegisteredHeaders(){return this.externalHeaders}setDefaultHeaders(e){this.defaultHeaders={...this.defaultHeaders,...e}}getDefaultHeaders(){return this.defaultHeaders}addDebugHeaders(e={}){return{[j.COREHEADER_APP_DEBUG_ID]:e.debugId,[j.COREHEADER_APP_DEBUG_LEVELS]:ec.getDebugLevels()}}getCoreHeadersFromContext(e){if(["root","app"].includes(e)||!e)return;const t=Rh.getProperty(j.COREHEADERS,"",e);return t?{...t,debugInfo:ec.getPreviewMode()&&{...t.debugInfo,[j.COREHEADER_APP_DEBUG_LEVELS]:ec.getDebugLevels()}}:(e=e.substr(0,e.lastIndexOf(this.SPECIAL_CHARS.SLASH)),this.getCoreHeadersFromContext(e))}processCoreHeaders(e,t,n){const r=this.getCoreHeadersFromContext(n);if(r){const t=Object.keys(e);if(t.includes(j.SKIPCOREHEADERS))return void delete e[j.SKIPCOREHEADERS];const n=Object.assign({},...Object.values(r));Object.keys({...n}).forEach((r=>{t.includes(r)||(e[r]=n[r])}))}}injectCoreAdditionalHeaders(e,t,n,r){r?.includeRemoteSystemIdIfPresent&&$.injectRemoteCaseHeader(e,t,n),this.processCoreHeaders(e,t,n)}},nc=tc;const rc="updateSession",sc={},ac=new Qi,oc=new class{constructor(){this.timerID=void 0,this.expiryBuffer=45,this.timeoutWarned=!1}setTimerID=e=>{this.timerID=e};getTimerID=()=>this.timerID;resetInactiveTimeout=e=>{const t=window.PCore?.getEnvironmentInfo().getInactivityTimeout();if(this.timeoutWarned&&(Gr.unsubscribe(F.PUB_SUB_EVENTS.RESET_TIMER,"resetCallback"),this.timeoutWarned=!1),t)return e&&clearTimeout(e),this.startInactivityTimeout(t>60?t:60)};startInactivityTimeout=e=>{const t=setTimeout((()=>{Gr.publish(F.PUB_SUB_EVENTS.TIMEOUT_REMINDER,{timeRemaining:this.expiryBuffer}),clearTimeout(t),Gr.subscribe(F.PUB_SUB_EVENTS.RESET_TIMER,this.resetInactiveTimeout,"resetCallback"),this.timeoutWarned=!0}),1e3*(e-this.expiryBuffer));return this.setTimerID(t),t}};let ic={},cc={},lc={},uc="";const dc=e=>{ic=e},pc=(e,t,n="root",r={})=>{const{doNotMergeHttpMessagesForStatusCode:s=null,cancelContext:a=n,includeRemoteSystemIdIfPresent:o=!0}=r;uc=s,null===e&&window.console.error("Error: url passed to Service Broker fetch is null (or) undefined");const{body:i,signal:c,withoutDefaultHeaders:l=!1,...u}=t,{Authorization:d,pzCTkn:p,...h}=t.headers||{};l||nc.injectCoreAdditionalHeaders(h,t.body,n,{includeRemoteSystemIdIfPresent:o}),a&&sc[a]>=0?sc[a]+=1:a&&void 0===sc[a]&&(sc[a]=1);let g=l?{...h}:{...nc.getDefaultHeaders(),...nc.getRegisteredHeaders(),...h,context:n};if(e&&Yi(e,cc)&&ac.getUpdateSessionStatus()||!ac.getUpdateSessionStatus()){Yi(e,cc)&&"OAuth2.0"===cc?.authType&&(g={...h});const{restApi:t}=lp.doesRestApiExist("Logout")&&lp.getRestEndPoint("Logout")||{restApi:null};return(!t||e&&!e.endsWith(t))&&oc.setTimerID(oc.resetInactiveTimeout(oc.getTimerID())),function(e,t){var n="object"==typeof t;return new Promise((function(r,s){var a,o=!1;e.subscribe({next:function(e){a=e,o=!0},error:s,complete:function(){o?r(a):n?r(t.defaultValue):s(new Uo)}})}))}(ki(Mo({context:n,...u,url:e,data:i,...c&&void 0===c.aborted&&{cancelToken:c},...c&&void 0!==c.aborted&&{signal:c},headers:g,withCredentials:(f=cc,!("OAuth2.0"!==f?.authType||!f.secureCookie)||!("custom"!==f?.authType||!f.customCookies)||void 0)})).pipe($i((()=>{const e=nc.getCoreHeadersFromContext(g.context);e&&(e=>{Gr.publish(j.PUB_SUB_EVENTS.FETCH_SUCCESS,e)})({...e})}))))}var f;return hc(e,t,n,ac)},hc=(e,t,n,r)=>new Promise(((s,a)=>{Gr.subscribe(rc,(o=>{r.setUpdateSessionStatus(!o.updateStatus),"success"===o.updateStatus?pc(e,t,n).then((e=>s(e))).catch((e=>a(e))):a(o.updateStatus.error)}),rc)})),gc=e=>{sc[e]>0&&(sc[e]-=1,0===sc[e]&&delete sc[e])};Mo.interceptors.request.use((e=>(ic.request&&(e=ic.request(e)),e)),(e=>Promise.reject(e))),Mo.interceptors.response.use((e=>{if(202===e.status&&e.config.headers.context&&e.data?.caseInfo?.errorMessage){const t=[{type:"error",message:e.data.caseInfo.errorMessage}];let n=e.config.headers.context;return n&&n.includes("/workarea")&&(n=n.substring(0,n.lastIndexOf("/workarea"))),Yn({messages:t,category:"HTTP",context:n}),Promise.reject(e)}return e.config.headers&&e.config.headers.context&&(e.config.skipClearErrorMessages||(qn({type:"error",category:"HTTP",context:e.config.headers.context}).length>0&&zn({type:"error",category:"HTTP",context:e.config.headers.context}),qn({type:"error",category:e.config.headers.context===j.APP.APP?"PAGE":"",context:e.config.headers.context}).length>0&&zn({type:"error",category:"PAGE",context:e.config.headers.context})),gc(e.config.headers.context)),ic.response&&(e=ic.response(e)),e}),(e=>(e.config&&e.config.headers&&e.config.headers.context&&gc(e.config.headers.context),!e.response||!e.response.status||401!==e.response.status||e.config&&Yi(e.config.url,cc)||Gr.subscribe(rc,(e=>{ac.setUpdateSessionStatus(!e.updateStatus)}),rc),Ji(e,ac,cc,e.response&&e.response.status&&e.response.status===Number(uc)?uc:null))));const fc=()=>Mo.CancelToken.source(),mc=e=>Mo.isCancel(e),yc=e=>{nc.setDefaultHeaders(e)},Ic=e=>{cc={...cc,...e}},Ec=e=>{lc={...lc,...e}},Ac=()=>({...lc}),_c=()=>({...cc});const Cc=class{static isCaseActive(e,t){if(!e||!t)return!1;const n=rd(t);if(n){const r=gd(t),{items:s={}}=n;return!(!r||!s[r]||s[r].key!==e)}return!1}static getCaseEditMetadata=(e,t)=>{const n={caseID:e,viewID:"pyEdit"},{restApi:r,reqType:s}=Ng("loadView",n);return pc(r,{method:s},t)};static getCaseEditLock=(e,t)=>{const n={caseID:e,actionID:"pyUpdateCaseDetails"},{restApi:r,reqType:s}=Ng(Ye,n);return pc(`${r}?viewType=page`,{method:s},t)};static updateCaseEditFieldsData=(e,t,n,r)=>{const s={caseID:e,actionID:"pyUpdateCaseDetails"},{restApi:a}=Ng(Ye,s),o=t[e];return pc(`${a}?viewType=form`,{method:"PATCH",body:{content:{...o}},headers:{"if-match":n}},r)};static getCaseMessages=e=>ch(e)?.caseMessages;static getPropertiesToReplace=e=>(al(e)||[]).filter((e=>!e.allowMultiple)).map((e=>e.fullPath));static getUniqueGadgetId=()=>Sh.generateUniqueID().substring(0,5);static getRemoteCaseMapping=()=>$.getRemoteCaseMapping();static isTraditionalRemoteCase=e=>$.isTraditionalRemoteCase(e);static getRemoteCaseKey=(e,t)=>{let n=t;try{e&&(n=e.slice(e.indexOf(" ")+1,e.indexOf("!")))}catch{}return n}},{RESOURCE_TYPES:Sc}=F,Tc={PAGE:"page",FORM:"form"},Nc={[Sc.CASE]:[We,Be,Ge],[Sc.PAGE]:[je,ke],[Sc.DATA]:[Ve]},Pc=(e,t,n={})=>{if(!e)return{};const r={etag:e.etag},{RemoteSystemID:s}=n;return e[F.REMOTE_SYSTEM_ID]||e[F.REMOTE_SYSTEM_ID.toLowerCase()]||s?r.RemoteSystemID=e[F.REMOTE_SYSTEM_ID]||e[F.REMOTE_SYSTEM_ID.toLowerCase()]||s:t&&$.isRemoteCase(t)&&(r.RemoteSystemID=$.getRemoteHeader(t)),r},Rc=(e,t={})=>{const{onlyChangedData:n=!1,nonEmptyAndChangedData:r=!1,skipUUID:s=!0,isTransientContext:a=!1,includeDisabledFields:o=!1}=t;let i={};i=ol(e,{isTransientContext:a,includeDisabledFields:o}),n&&(delete i?.caseInfo?.content,a&&(i={}));const c=Al(e,!1);!a&&r&&((e,t)=>{Object.entries(e?.caseInfo?.content).forEach((([n,r])=>{const s=ch(t),a=b()(s,F.CASE_INFO.CASE_INFO_CLASSID),o=Mp(n,a);("True-False"===o?.type&&!r||""===r)&&delete e.caseInfo.content[n]}))})(i,e);const l=w()(c,i);let u={},d=!1;({content:u,attachmentsExist:d}=((e,t)=>{let n={},r=!1;return(e||t?.caseInfo)&&(n=e?{...t}:{...t?.caseInfo},t?.caseInfo?.attachments&&(r=!0)),{content:n,attachmentsExist:r}})(a,l));const p=[...mr(e)];s&&p.forEach((e=>{delete e.content?.EmbedListUUID__})),u.pageInstructions=p;return(ur[e]||[]).forEach((e=>{if(u?.content){const t=e?.replace(j.CASE_INFO.CASE_INFO_CONTENT,"");Sh.deleteIn(u.content,(e=>{if(!e)return"";const t=e.split(".");let n,r="";for(n of t)if(n){if(n.includes("[")&&n.includes("]"))return r+=`['${n.substring(0,n.lastIndexOf("["))}']`,r;r+=`['${n}']`}return r})(t))}})),!a&&l?.dataInfo?(u={...l.dataInfo,pageInstructions:u.pageInstructions},{content:u}):{content:u,attachmentsExist:d}},Dc=(e,t)=>{let n,r,s={};const a=Sh.getIn(e,j.UI_RESOURCES),o=Sh.getIn(e,"confirmationNote");a?(n=Sh.getIn(e,j.UI_RESOURCES_CONTEXT_DATA),r=Sh.getIn(e,j.ROOT),s=Sh.getIn(e,j.ACTION_BUTTONS)):o&&(r={});const{data:i={},Errors:c,semanticURL:l,key:u,flowName:d}=e,p=Sh.getIn(e,"nextAssignmentInfo",null),h=Sh.getIn(e,"nextAssignmentInfo.context",""),g=Sh.getIn(e,"confirmationLinks",null),{isInCreateStage:f,openCaseViewAfterCreate:m,debugInfo:y}=t;return{data:{...i,key:u,flowName:d,coreHeaders:y&&{debugInfo:{[j.COREHEADER_APP_DEBUG_ID]:y.debugId}},caseInfo:{...i.caseInfo,actionButtons:s,headers:t.headers},[j.CONTEXT_DATA]:f?{...i[j.CONTEXT_DATA],...n,openCaseViewAfterCreate:m,errors:c}:{...i[j.CONTEXT_DATA],...n,errors:c}},semanticURL:l,nextAssignmentInfo:p,assignmentContext:h,confirmationLinks:g,key:u,root:r,...t}},bc=async(e,t,n,r=!1,s=!1)=>{const a=Sh.getIn(e,j.LOCALE_REFERENCES);await hp.loadLocaleResources(a);const o=Sh.getIn(e,j.COMPONENTS);if(o)try{await jr(o)}catch(e){console.error(e)}const i={actionConfig:t,...n};r?xg({...e,options:i,directUrlUpdation:!0}):wr(e,i,s)},Oc=(e="")=>{const t=e.indexOf(" "),n=e.indexOf("!");return e.substring(t+1,n)},vc=e=>{if(e){const[,t]=e.split("!");return{key:Oc(e),flowName:t}}return{}},xc=(e,t)=>{const n=[],r=[];return e.forEach((e=>{((e,t,n,r)=>{switch(!0){case Boolean(e[j.ERROR_IN_PAGE_IDENTIFIER]&&e[j.ERROR_FIELD_IN_PAGE]):{const s=`${e[j.ERROR_FIELD_IN_PAGE]}`.replace(/(\(\d+\))/g,(e=>`[${parseInt(e.substring(1,e.length-1),10)-1}]`)),a=`${s}${e[j.ERROR_IN_PAGE_IDENTIFIER]}`,o=Sh.deepClone(e);o[j.ERROR_FIELD_IN_PAGE]=s,t.includes(a.slice(1))||t.includes(a.substring(a.indexOf(".")+1,a.indexOf("[")))?r.push(o):n.push(e);break}case Boolean(e[j.ERROR_IN_PAGE_IDENTIFIER]&&!e[j.ERROR_FIELD_IN_PAGE]):{const s=e[j.ERROR_IN_PAGE_IDENTIFIER].slice(1);t.includes(s)?r.push(e):n.push(e);break}default:n.push(e)}})(e,t,n,r)})),{fieldErrors:r,pageErrors:n}},wc=e=>{const{payload:t}=e,{err:n,context:r,actionMgrID:s}=t,a=n&&n.response?n.response.data:"",o=cl(r);return s&&ln.rejectActionByID(s,!0,n),og(ig,"Error action triggered",a,r,o)},Mc=(e,t)=>Sd(e)&&Nd(e)?og(ng,t):og($h,t),Lc=(e,t,n=j.APP.APP,r={})=>{let s=null;const{buildNew:a=!0}=r;return Sd(e)?s=Nd(e)?gd(e):H(t,n):Td(e)&&(Nd(e)&&!a?s=Id(e):Nd(e)&&!a||(s=H(t,n))),s},Uc=e=>e&&e.type===Ce,Fc=e=>{let t=!1;const n=_d(e);for(let e=0;e<n.length;e+=1){const r=n[e];if(r&&Nl(r)){t=!0;break}}return t},jc=(e,t={})=>{let n=!1,r=!1,s={},a=!0,o=!1,i=!1;const{showConfirmDialogForMaxDocumentLimitReached:c=!1,dirtyMessage:l,skipChildDirtyState:u=!1}=t;if(Sd(e)){const t=gd(e);if(!t)return{continueExecution:a,removeActionPayload:s};const r=yd(t);Nl(r)&&(n=!0),u||n||(n=Fc(t))}else if(Td(e)&&Dd(e)){let t=vd(e);t||(t=gd(e),r=!0),s.containerItemID=t,s.context=yd(t)}if(n){const e=l||Il;o=window.confirm(hp.getLocaleValue(e,"Messages"))}if(!o&&n&&(s={},a=!1),r){const e=hp.getLocaleValue(El,"Messages");c?i=window.confirm(e):(window.alert(e),a=!1)}return!i&&r&&(s={},a=!1),{continueExecution:a,removeActionPayload:s}},Vc=(e,t)=>{let n=!1;const r=up.isCoexistenceAppOfType(j.APP_TYPE.UIKIT),{insKey:s,isParallelCall:a,skipFlowNameCheck:o}=t;if(!s)return{};const[,i]=s.split("!")||"",c=o?s:Oc(s),l=ld(e,c);let u={},d=!1;if(l&&!r&&((e,t)=>{const n=sd(e,t);return n?.resourceType})(e,l)===t?.type&&(n=!0,u=sd(e,l),!o)){let e=u?.flowName;const t=zr(l),r=Ed(l);if(r.length){const n=mt(t,r[0]);e=sd(n,r[0])?.flowName}else n=e===i;(e!==i||a)&&(d=!0)}return{activate:n,activateContainerActionPayload:{target:e,isParallelAssignment:d,containerItemID:l,semanticURL:u.semanticURL,insKey:s}}},kc=(e,t,n)=>e===Sc.PAGE?((e,t={})=>{let n=!1;const{semanticURL:r}=t,s=ld(e,r);return s&&(n=!0),{activate:n,activateContainerActionPayload:{target:e,containerItemID:s,semanticURL:r}}})(t,n):e===Sc.ASSIGNMENT?Vc(t,{...n,type:e}):e===Sc.CASE?Vc(t,{...n,skipFlowNameCheck:!0,type:e}):{},$c=(e=[])=>{Nd(`${j.APP.APP}/${j.PREVIEW}`)&&e.push(og(kh,bd({context:F.APP.APP,name:j.PREVIEW})))},Bc=e=>{let t;for(const n of Object.keys(Nc))if(Nc[n].includes(e)){t=n;break}return t},Gc=(e,t)=>{const{data:n={},context:r,caseViewMode:s}=e,a={data:{...n},caseViewMode:s,context:W(r)};Sh.deleteIn(a.data,"shared"),Sh.setIn(a.data,["context_data","caseViewMode"],s),t.push({type:st,payload:{context:a.context}}),t.push(og(wh,a))},Wc=e=>{if(Array.isArray(e)&&e.length>0){const t=(e=>{const t=e[0];for(const t of e)if("other"===t?.payload?.nextAssignmentInfo?.context||"remote"===t?.payload?.nextAssignmentInfo?.context)return t;return t})(e),n=Sh.getIn(t,["payload","assignmentContext"]);if("other"===n||"remote"===n){const r=Sh.getIn(t,["payload","nextAssignmentInfo","ID"]);if(t?.payload?.isProcessAction){const n={acName:Sh.getIn(t,["payload","target"]),caseID:t.payload.data.caseInfo.ID,containerItemID:Sh.getIn(t,["payload","context"]),context:Sh.getIn(t,["payload","context"])},r={type:he,payload:{...n}};e.push(r),e=e.filter((e=>delete e?.payload?.data?.caseMessages)),ih(e),e=e.filter((e=>e.type!==he))}const s=((e,t,n)=>({assignmentID:e,vcName:j.PRIMARY,targetContainerName:Sh.getIn(t,["payload","target"]),context:Sh.getIn(t,["payload","context"]),..."other"===n&&{isChild:!0},isProcessAction:t?.payload?.isProcessAction,..."remote"===n&&{isRemote:!0},..."remote"===n&&{remoteClassName:t.payload.nextAssignmentInfo.className}}))(r,t,n);Sd(s.targetContainerName)||t?.payload?.containerName!==j.WORKAREA||(s.isMultiDoc=!0,e=[]);const a={type:ge,payload:{...s}};e.push(a),ih(e)}else ih(e)}},Hc=(e,t)=>w()(e,t,(function(e,t){if(Array.isArray(e))return e.concat(t)})),qc=e=>{let t={},n=Jd(e);for(;n;){const e=Rc(n);t=Hc(e.content,t),n=Jd(n)}return t};class zc{static getChanges(e){return{...Al(e)}}static getSubmitData(e,t){const{isTransientContext:n=!1,includeDisabledFields:r=!1}=t||{},{content:s}=Rc(e,{isTransientContext:n,includeDisabledFields:r});return s}static isStateModified(e){return Nl(e)||Pr(e)||!(!e||!Cl(e))}static isFormValid(e,t){return il(e,t)}static clearChangedProperties(e){return Ir(e),fr(e),Rl(e)}static getEditableFields(e){return ll(e)}static setCustomValidator(e,t){vr.register(e,t)}static isPropertyEditable(e,t){return zc.getEditableFields(e).some((e=>e.name===t))}}const Yc=zc;const Kc=new class{constructor(){this.states={},this.unConnectedStates={}}getStateMachine(e,t,n){return this.states?.[e]?.[`${t}${n}`]||this.unConnectedStates?.[e]?.[`${t}${n}`]}isStateMachineExist(e,t,n){return!!this.states?.[e]?.[`${t}${n}`]||!!this.unConnectedStates?.[e]?.[`${t}${n}`]}getUnConnectedStateMachines(e){return this.unConnectedStates?.[e]}getAllStateMachines(e,t,n){return{states:this.states?.[e]?.[`${t}${n}`],unConnectedStates:this.unConnectedStates?.[e]?.[`${t}${n}`]}}getAllStateMachinesByContext(e){return{states:this.states?.[e],unConnectedStates:this.unConnectedStates?.[e]}}setStateMachine(e,t,n,r){const s=`${n}${t}`,{stateMachine:a}=this.getStateMachineObjByPath(s,e,!0),o=(t,n,r=!1)=>{const s=r?this.states:this.unConnectedStates;s[e]||(s[e]={}),s[e][t]||(s[e][t]={}),s[e][t]=n};if(a&&a.targetPageReference!==r.targetPageReference)return a.addChild(r),void o(s,r);const i=Object.entries(this.states[e]||{}).filter((([e])=>{if(e.includes(s)){const t=e.substring(0,s.length).length;return e.substring(t).startsWith("[")||e.substring(t).startsWith(".")}return!1})).reduce(((e,[t,n])=>({...e,[t]:n})),{});Object.keys(i)?.length?(Object.entries(i).forEach((([t,n])=>{delete this.states[e][t],r.addChild(n),o(t,n)})),this.states[e][s]=r):o(s,r,!0)}buildPageInstructionsByContext(e,t){const n=this.getStateMachinesByContext(e)||{},r=[];return Object.keys(n).sort().forEach((s=>{const a=Pn.getContextReferences(e)?.get(s),o=n[s];if(a){const e=o.buildSubmitPageInstructions(t);r.push(...e)}})),r}buildClientChangeList(e){const t=this.getStateMachinesByContext(e)||{};let n={};const r={};return Object.keys(t).forEach((e=>{const r=t[e].getChangeList();n={...n,...r}})),Sh.flatten(n,"",r),r}getStateMachinesByContext(e){return e?this.states?.[e]:void 0}clearStateMachines(e){this.states[e]={},this.unConnectedStates[e]={}}setStateMachineEmpty(e,t){const n=this.getStateMachine(e,t,"");n.root=null,n.current=null;const r=this.getUnConnectedStateMachines(e)||{};Object.keys(r).forEach((e=>{e.includes(t)&&delete r[e]}))}removeStateMachine(e,t){delete this.states[e]?.[t]}getStateMachineObjByPath(e,t,n){const r=/\[\d+\]$/gm;let s=null;for(;e&&!this.isStateMachineExist(t,"",e);)s=null,n&&e.endsWith("]")?(s=e.match(r),s=s?.[s.length-1]?.substring(1,s[s.length-1].length-1),[e]=e.split(r)):e=e.substring(0,e.lastIndexOf("."));return e?{stateMachineTarget:e,stateMachine:this.getStateMachine(t,"",e),index:s}:{}}executeStateMachine(e,t,n,r=!0,s={}){const{stateMachineTarget:a,index:o}=this.getStateMachineObjByPath(t,e,r);if(!a)return!1;let[,i]=t.split(a);if(!i)return!1;null!==o&&([,i]=i.split(/^\[\d+\]/gm));const c={[Jc(i)]:n},l=this.getStateMachine(e,"",a);return null!==o?l.update(c,Number(o)+1,s.skipStateUpdate??!0,s):l.updatePage(Sh.unflatten(c)),!0}registerForServerChanges(){nh.registerForListChanges(((e,t,n)=>{setTimeout((()=>{const r="].";if(!t.includes(".classID")&&Yc.isPropertyEditable(e,t)&&this.executeStateMachine(e,t,n),!t.includes(".classID")&&t.includes(r)){const s=t.substring(0,t.lastIndexOf("[")),a=Yc.getEditableFields(e);if(["multiselect","checkbox"].includes(a.find((e=>e.name===s))?.type)){const a=Pn.getContextReferences(e),o=a?.get(s),i=t.substring(t.lastIndexOf(r)+2);o?.props.selfReferencingDatapageKeys?.includes(i)&&this.executeStateMachine(e,t,n)}}}),0)}))}unRegisterForServerChanges(){nh.unRegisterForListChanges()}},Xc={},Jc=e=>e.startsWith(".")?e.substring(1):e,Qc=e=>{delete Xc[e]},Zc=(e,t={})=>{const{includeDisabledFields:n=!1}=t,r=Rh.resolveContextTreeNodeProps(e),s=!0!==r.readOnly&&!1!==r.visibility&&(n||!0!==r.disabled),a="string"==typeof e?.value&&e?.value.includes("@FILTERED_LIST"),o=(e=>e.selectionList||e.selectionKey||"Editable"===e.renderMode&&e.referenceList)(e);return(e?.value||o)&&!a&&s},el=(e,t,n,r,s)=>{let a=(dh(`.attachmentsList.${t?.replace(".","")}`,"context_data",n)||[]).filter((e=>`${r.pageReference}.${e.label}`===s));return a=Sh.buildAttachmentsFormData(a),a.length>0&&(e=[...e,...a]),e},tl=(e,t,n,r,s)=>(Kc.executeStateMachine(e,r,Rh.getLitePropertyValue(n,t))||s.push(r),s),nl=e=>{const t=e.pageReference?.replace(F.CASE_INFO.CASE_INFO_CONTENT,"")?.replace(F.DATA_INFO.DATA_INFO_CONTENT,"");return"Attachment"===e.componentName&&""!==t},rl=(e,t,n)=>{const r=t.isInsideList,{ignoreFieldsInsideList:s=!0}=n;return(!r||r&&!s)&&!Array.isArray(Rh.getLitePropertyValue(t,e))&&"Address"!==t.componentName},sl=(e,t={})=>{let n=[],r=[];const s=[],a=Pn.getContextReferences(e);if(!a)return{formInputs:n,attachments:r,formPageFields:s};if(({attachmentList:r,editableFormFieldsReferenceList:n}=((e,t,n)=>{const{includeDisabledFields:r=!1}=n;let s=[],a=[];for(const[o,i]of e){const e=Rh.resolveContextTreeNodeProps(i.props),c=e.propertyName;if(Zc(i.props,{includeDisabledFields:r})){const r=nl(e);"Attachment"!==e.componentName||r?!r&&rl(o,e,n)&&(s=tl(t,c,e,o,s)):a=el(a,c,t,e,o)}}return{attachmentList:a,editableFormFieldsReferenceList:s}})(a,e,t)),Xc[e])for(const t in Xc[e].fieldOrder)Object.hasOwn(Xc[e].fieldOrder,t)&&s.push(t);return{formInputs:n,attachments:r,formPageFields:s}},al=e=>{let t=[];const n=Pn.getContextReferences(e);if(n)for(const[e,r]of n){const n=r?.props;if(Zc(n)&&"Attachment"===n?.componentName){const r="true"===n?.allowMultiple;t=[...t,{type:"File",allowMultiple:r,fullPath:e}]}}return t},ol=(e,t={})=>{const n={},r=ch(e),{ignoreFieldsInsideList:s=!0,isTransientContext:a=!1,includeDisabledFields:o=!1}=t;if(a||r?.caseInfo?.content){const{formInputs:t,attachments:i,formPageFields:c}=sl(e,{ignoreFieldsInsideList:s,includeDisabledFields:o});i&&i.length>0&&Sh.buildObject("caseInfo.attachments",n,i),((e,t,n)=>{e.forEach((e=>{let r=Sh.getIn(t,e);"object"==typeof r&&(r=Sh.deepClone(r),delete r?.classID),Sh.buildObject(e,n,r)}))})(c,r,n),t&&t.length>0?t.forEach((e=>{Sh.buildObject(e,n,Sh.getIn(r,e))})):a||Sh.buildObject(F.CASE_INFO.CASE_INFO_CONTENT,n,{})}if(!a&&r?.dataInfo?.content){const{formInputs:t}=sl(e,{ignoreFieldsInsideList:s});t.forEach((e=>{Sh.buildObject(e,n,Sh.getIn(r,e))}))}return n},il=(e,t)=>{const n=Pn.getContextReferences(e);let r=!0;if(!n)return r;for(const[e,s]of n){const n=Rh.resolveContextTreeNodeProps(s.props);if(Zc(s.props)&&(!t||e.includes(t))){const e=vr.validate(n.componentName?.toLowerCase(),n.propertyName,Rh.getLitePropertyValue(n,n.propertyName),n);r&&(r=!e.message)}}return r},cl=(e,t=!1)=>{const n=Pn.getContextReferences(e),r=[];if(n)for(const[e,s]of n){if(!1!==Rh.resolveContextTreeNodeProps(s.props).visibility){const n=8,s=t?e:e.substring(e.indexOf("content")+n);r.push(s)}}return r},ll=e=>{const t=[],n=Pn.getContextReferences(e);if(n)for(const[e,r]of n){const n=Rh.resolveContextTreeNodeProps(r.props);Zc(r.props)&&"Attachment"!==n.componentName&&"multirecordlist"!==n.type&&t.push({name:e,label:n.label,type:n.componentName?.toLowerCase()})}return t};const ul=class{static getPropertyName(e){return Qt.getPropertyName(e)}static isProperty(e){return Qt.isProperty(e)}static getLeafPropertyName(e){return Qt.getLeafPropertyName(e)}static isPropertyInternal(e){return e.startsWith("px")||e.startsWith("pz")}};const dl=class{static isPageInstruction(e){return e&&e.includes("[")&&e.includes("]")}};class pl{constructor(){this.refreshMap={},this.propChangeRefreshMap={}}static initializeRefreshCache(e,t,n,r,s){void 0===e[t]&&(e[t]={}),e[t][n]=[{uniqueHash:r,callback:s}]}registerForRefresh(e,t,n,r,s){const a=r.split("/").join(j.HASH_DELIMITER),o=Sh.getHashedString(a);if("PROP_CHANGE"===e)if(this.propChangeRefreshMap?.[s]?.[n]){this.propChangeRefreshMap[s][n].some((e=>e.uniqueHash===o))||this.propChangeRefreshMap[s][n].push({uniqueHash:o,callback:t})}else pl.initializeRefreshCache(this.propChangeRefreshMap,s,n,o,t);else if(this.refreshMap?.[s]?.[`${e}-${n}`]){this.refreshMap[s][`${e}-${n}`].some((e=>e.uniqueHash===o))||this.refreshMap[s][`${e}-${n}`].push({uniqueHash:o,callback:t})}else pl.initializeRefreshCache(this.refreshMap,s,`${e}-${n}`,o,t)}triggerRefreshForType(e,t,n){"PROP_CHANGE"===e?this.propChangeRefreshMap?.[n]?.[t]&&this.propChangeRefreshMap[n][t].forEach((e=>e.callback())):this.refreshMap?.[n]?.[`${e}-${t}`]&&this.refreshMap[n][`${e}-${t}`].forEach((e=>e.callback()))}deRegisterForRefresh(e){delete this.propChangeRefreshMap[e],delete this.refreshMap[e]}}const hl=new pl,{APP:gl}=j;let fl={},ml={},yl={};const Il="You will lose unsaved changes. Do you want to continue?",El="You have reached maximum limit of pending changes. Please commit/cancel one or more changes to continue.",Al=(e=gl.APP,t,n)=>{let r=[],s=[];t||(r=cl(e,!0)),n||(s=(e=>{const t=Pn.getContextReferences(e),n=[];if(t)for(const[e,r]of t)!0===Rh.resolveContextTreeNodeProps(r.props).readOnly&&n.push(e);return n})(e));const a={};((e,t)=>{const n=ml[t]||{};Object.keys(n).forEach((t=>{Object.hasOwn(n,t)&&Sh.buildObject(t,e,n[t].value)}))})(a,e);const o=fl[e]||{};return Object.keys(o).forEach((e=>{const n=!t&&r.includes(e)||t;Object.prototype.hasOwnProperty.call(o,e)&&n&&!s.includes(e)&&Sh.buildObject(e,a,o[e].value)})),a},_l=e=>{const{context:t}=e,n=e.reference.startsWith(".")?e.reference.substr(1):e.reference;delete fl[t]?.[n],delete ml[t]?.[n]},Cl=e=>yl[e],Sl=(e,t)=>{const{context:n,initialValue:r="",isStrictTracking:s}=t,a=t.reference.startsWith(".")?t.reference.substr(1):t.reference;e[a]?e[a].previousValue=dh(t.reference,null,n):(e[a]={initialValue:r||dh(t.reference,null,n)},e[a].previousValue=e[a].initialValue),e[a].value=t.value,s&&e[a].value===e[a].initialValue&&_l(t)},Tl=e=>{const{payload:t}=e,{context:n}=t,r=t.reference.startsWith(".")?t.reference.substr(1):t.reference;Pn.isFieldExists(n,r)||(ml[n]=ml[n]||{},Sl(ml[n],t)),fl[n]=fl[n]||{},Sl(fl[n],t)},Nl=e=>{const t=yr(e)||{};return e&&fl[e]&&Object.keys(fl[e]).some((t=>fl[e][t].initialValue!==fl[e][t].value))||Object.keys(t).length>0},Pl=(e,t)=>{if(!e||!t)return!1;const n=fl[e]&&fl[e][t];return!!n&&n.previousValue!==n.value},Rl=e=>{e&&fl[e]?(fl[e]={},ml[e]={}):"all"===e&&(fl={},ml={},yl={}),yl[e]&&(yl[e]=!1)},Dl=()=>e=>t=>{const{type:n,payload:r={}}=t||{};if(n===ee&&(qt(r),(e=>{const{context:t,pageReference:n,value:r,reference:s}=e;nh.triggerCascade(t,s,r);const a=Kt.getDependencies(t,s),o=nh.getResetDependencies(t,s),i={context:t,datapages:{}};[...a,...o].forEach((e=>{const n=Sh.getPropertyNameFromDependency(e);if("multiRecord"===e.mode){const e=n.split("."),r=`.${e.pop()}`,s=e.join(".");Kc.getStateMachine(t,s,r).deleteAll()}else dl.isPageInstruction(n)&&Kc.executeStateMachine(t,n,""),ih({type:Q,payload:{reference:n,value:"",context:t,isArrayDeepMerge:!0,isImplicit:!0}})})),a.forEach((r=>{let s=n;r.startsWith(n)||(s="");const a=r.replace(`${s}`,"").split(".").filter((e=>!!e));a.pop();const o=a.join("."),c=dh(`.${o}`,s,t)?.classID||e.classID,l=Mp(r.split(".").pop(),c),{datasource:u}=l,d={};let p=[];u.parameters.forEach((e=>{e?.value?(d[e.name]=ul.isProperty(e.value)?dh(`.${Sh.getFullPropertyReference([o,Sh.getPropertyName(e.value)])}`,s,t):e.value,void 0===d[e.name]||null===d[e.name]||""===d[e.name]?(d[e.name]="",p.push(j.NULL_STRING)):p.push(d[e.name])):(d[e.name]="",p.push(j.NULL_STRING))})),p=u.name.concat(j.UNDERSCORE_STRING,Sh.getHashedString(p.join(j.HASH_DELIMITER)));const{name:h}=u,g=Bp(h);i.datapages[p]={mode:u.mode,propertyName:r,name:u.name,dataViewParameters:d,refreshStrategy:g?.refreshStrategy}})),a.length&&ih({type:et,payload:i})})(r),(Pl(r.context,r.reference)||Pr(r.context))&&Un(r),hl.triggerRefreshForType("PROP_CHANGE",r.reference,r.context)),n===rt&&!r?.isDefault){const{context:e,referenceList:t}=r;Un({context:e,pageReference:t})}if(n===Q||n===Z){const{reference:e,isImplicit:n,context:s,skipDirtyValidation:a=!1}=r;Pn.updateFieldNodeValue(s,e,r.value),dl.isPageInstruction(e)||a?a||(yl[`${s}`]=!0):Tl(t),(r.removePropertyFromChangedList||n)&&_l(r)}if(n===De||n===be){const{transientItemID:e,data:t}=r;Sh.iterateLeafNodes(t,(t=>{_l({context:e,value:"",reference:t.join(".")})}))}if(n&&[xe,Se,Me,Re].includes(n)){Rl(r.context),nh.purgeResetDependencies(r.context),(e=>{e&&bn[e]&&delete bn[e]})(r.context);(r.childContainersContexts||[]).forEach((e=>{Rl(e)}));(r.transientItems||[]).forEach((e=>{Rl(e)}))}e(t)};const bl=new class{getCoreheaders(e){const t=`${F.APP.APP}${j.FORWARD_SLASH_STRING}${j.PRIMARY}`,n=gd(t),r=yd(n),s=Rh.getProperty(j.COREHEADERS,"",r);if(s&&e in s)return s[e]}};const Ol=class{constructor(e){this.c11nEnv=e}validate(e,t){const{value:n}=this.c11nEnv.getStateProps();if(!t&&!(t=n)){const e=this.c11nEnv.getComponentConfig(),n=this.c11nEnv.getStateProps();t="multi"===e.selectionMode?n.selectionList:"Editable"===e.renderMode?n.referenceList:"single"===e.selectionMode?n.selectionKey:n.value}const r=((e,t,n)=>{const r=""===t&&n?.startsWith(".")?n.substring(1,n.length):n,s=Pn.getContextReferences(e)?.get(`${t}${r}`)?.props;return s?Rh.resolveContextTreeNodeProps(s):s})(this.c11nEnv.getContextName(),this.c11nEnv.getPageReference(),t),{message:s}=vr.validate(this.c11nEnv.getComponentName()?.toLowerCase(),t,e,r);return s?{status:!1,message:s}:{status:!0}}},vl="OPEN_PROCESS_ACTION",xl="OPEN_ASSIGNMENT",wl="DELETE_CASE_IN_CREATE_STAGE",Ml="SAVE_AND_CLOSE",Ll=e=>({type:Ml,payload:e});const Ul=class{static getSavableDataPage(e){return Kp(e)}static getLookUpDataPage(e){return Jp(e)}static getLookUpDataPageInfo(e){return Qp(e)}static getDataPageKeys(e){return Xp(e)}};const Fl=class{constructor(e){this.c11nEnv=e}containerManagerPromise=e=>{const t=ln.getNextActionMgrId();let n,r;const s=new Promise(((e,t)=>{n=e,r=t}));if(!n||!r)throw new Error("resolveFn or rejectFn is not defined.");return ln.register(t,s,n,r,e),{actionMgrID:t,promise:s}};initializeContainers(e){const t=Ae,n=this.c11nEnv,r={context:n.getContextName(),name:n.getContainerName(),type:j.CONTAINER_TYPE.SINGLE},{actionMgrID:s,promise:a}=this.containerManagerPromise(t),o={...r,...e,actionMgrID:s};return ih(Vh(o)),a}addContainerItem(e){const t=Ce,n=this.c11nEnv,r=n.getMetadata(),{children:s}=r||{};let a;s&&([a]=s);const o=n.getContextName(),i=n.getContainerName(),c=H(i,o,e?.containerType===j.CONTAINER_TYPE.SINGLE),l=mt(i,o),u={root:{...a,config:{...a?.config,context:a?.config?.context||n.getPageReference?.()}},containerItemID:c,context:c,target:l,containerName:i};e=JSON.parse(JSON.stringify(e)),[j.WORKAREA].includes(i)&&delete e.data?.coreHeaders;const{actionMgrID:d,promise:p}=this.containerManagerPromise(t),h={...u,...e,actionMgrID:d};return ih($h(h)),p}updateContainerItem(e){if(!e?.containerItemID)return Promise.reject(new Error("updateContainerItem : containerItemID is required in containerInfo object"));const t=xe,n={context:yd(e.containerItemID),target:xd(e.containerItemID)},{actionMgrID:r,promise:s}=this.containerManagerPromise(t),a={...n,...e,actionMgrID:r};return ih(zh(a)),s}activateContainerItem(e){if(!e?.containerItemID)return Promise.reject(new Error("activateContainerItem : containerItemID is required in containerInfo object"));const t=ve,n={target:xd(e.containerItemID)},{actionMgrID:r,promise:s}=this.containerManagerPromise(t),a={...n,...e,actionMgrID:r};return ih(Jh(a)),s}removeContainerItem(e){if(!e?.containerItemID)return Promise.reject(new Error("removeContainerItem : containerItemID is required in containerInfo object"));const t=Se,n={context:yd(e.containerItemID),target:xd(e.containerItemID)},{actionMgrID:r,promise:s}=this.containerManagerPromise(t),a={...n,...e,actionMgrID:r};return ih(Zh(a)),s}resetContainers(e){if(!e?.context||!e?.name)return Promise.reject(new Error("resetContainers : context and name are required in containerInfo object"));const t=_e,n=bd(e),{actionMgrID:r,promise:s}=this.containerManagerPromise(t),a={...n,...e,actionMgrID:r};return ih(kh(a)),s}addTransientItem(e){const{id:t,data:n}=e,r=this.c11nEnv.getContextName(),s=z(t,r),a=Fd(r);return s&&a.includes(s)||ih(Bh({transientItemID:s,contextName:r,target:xd(r),data:n})),s}updateTransientData(e){const{transientItemID:t,data:n}=e,r=this.c11nEnv.getContextName();if(t){if(!Fd(r).includes(t))return;ih(Gh({transientItemID:t,data:n}))}}removeTransientItem(e){const t=this.c11nEnv.getContextName(),{target:n=this.c11nEnv.getTarget(),containerItemID:r,transientItemID:s}=e;if(s&&r){if(!Fd(t).includes(s))return;ih(tg({target:n,containerItemID:r,transientItemID:s}))}}createContainerPConnect(e,t,n,r=!1){Qu.createContainerPConnect(e,t,n,r)}hasContainerItems(){const e=this.c11nEnv.getContextName(),t=this.c11nEnv.getContainerName();return Nd(`${e}/${t}`)}isContainerInitialized(){const e=this.c11nEnv.getContextName(),t=this.c11nEnv.getContainerName();return pd(e,t)}};var jl=function(e,t){return e===t||"function"==typeof t&&e===t.toString()};function Vl(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n,r,s=e.length;return n=1===s?function(t){return jl(t.type,e[0])}:function(t){for(var n=0;n<s;n++)if(jl(t.type,e[n]))return!0;return!1},wi((function(e,t){var s=0;e.subscribe(Mi(t,(function(e){return n.call(r,e,s++)&&t.next(e)})))}))}function kl(e,t){return wi((function(n,r){var s=null,a=0,o=!1,i=function(){return o&&!s&&r.complete()};n.subscribe(Mi(r,(function(n){null==s||s.unsubscribe();var o=0,c=a++;Oi(e(n,c)).subscribe(s=Mi(r,(function(e){return r.next(t?t(n,e,c,o++):e)}),(function(){s=null,i()})))}),(function(){o=!0,i()})))}))}function $l(e,t){return wi((function(n,r){var s=0;n.subscribe(Mi(r,(function(n){r.next(e.call(t,n,s++))})))}))}function Bl(e,t,n){return void 0===n&&(n=1/0),Yo(t)?Bl((function(n,r){return $l((function(e,s){return t(n,e,r,s)}))(Oi(e(n,r)))}),n):("number"==typeof t&&(n=t),wi((function(t,r){return function(e,t,n,r,s,a,o,i){var c=[],l=0,u=0,d=!1,p=function(){!d||c.length||l||t.complete()},h=function(e){return l<r?g(e):c.push(e)},g=function(e){a&&t.next(e),l++;var i=!1;Oi(n(e,u++)).subscribe(Mi(t,(function(e){null==s||s(e),a?h(e):t.next(e)}),(function(){i=!0}),void 0,(function(){if(i)try{l--;for(var e=function(){var e=c.shift();o?xi(t,o,(function(){return g(e)})):g(e)};c.length&&l<r;)e();p()}catch(e){t.error(e)}})))};return e.subscribe(Mi(t,h,(function(){d=!0,p()}))),function(){null==i||i()}}(t,r,e,n)})))}function Gl(e){return e&&Yo(e.schedule)}function Wl(e){return e[e.length-1]}function Hl(e){return Gl(Wl(e))?e.pop():void 0}function ql(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return ki(e,Hl(e))}function zl(e){return wi((function(t,n){var r,s=null,a=!1;s=t.subscribe(Mi(n,void 0,void 0,(function(o){r=Oi(e(o,zl(e)(t))),s?(s.unsubscribe(),s=null,r.subscribe(n)):a=!0}))),a&&(s.unsubscribe(),s=null,r.subscribe(n))}))}var Yl=new _i((function(e){return e.complete()}));function Kl(e){return e?function(e){return new _i((function(t){return e.schedule((function(){return t.complete()}))}))}(e):Yl}const Xl=(e,t,n)=>zl((r=>("ERR_CANCELED"!==r?.code&&console.error(e,r),ql(ig(e,r,t,null,n))))),Jl=(e,t)=>n=>new _i((r=>{let s={},a=0;return n.pipe(Bl((n=>{const r=Date.now();let o;return o=t||h(),o&&o(n,s)&&r-a<e?Kl():(s=n,a=r,ql(n))}))).subscribe(r)})),Ql=e=>{const{dataPageID:t,context:n,headers:r,containerItemID:s}=e,a={data_view_ID:t},{restApi:o,reqType:i}=Ng("createDataObject",a),{content:c}=Rc(s);return ki(pc(o,{method:i,headers:r,body:{data:c.content}},s)).pipe($l((t=>({response:t.data,actionInPayload:e}))),Xl("Error occurred during ajax call at createDataObject Epic",n))},Zl=e=>{const{dataLookUp:t,context:n,headers:r,viewName:s,requestPayload:a}=e,o={data_view_ID:t,view_ID:s},{restApi:i,reqType:c}=Ng("readDataObject",o);return ki(pc(i,{method:c,headers:r,body:{dataViewParameters:a}},n)).pipe($l((t=>({response:t.data,actionInPayload:e}))),Xl("Error occurred during ajax call at getDataObjectView Epic",n))},eu=e=>{const{dataPageID:t,context:n,headers:r,containerItemID:s,key:a}=e,o={data_view_ID:t},{restApi:i,reqType:c}=Ng("updateDataObject",o),{content:l}=Rc(s);return ki(pc(i,{method:c,headers:r,body:{data:{...l.content,...a},pageInstructions:l.pageInstructions||[]}},s)).pipe($l((t=>({response:t.data,actionInPayload:e}))),Xl("Error occurred during ajax call at updateDataObject Epic",n))},tu=e=>{const{lookupDatapage:t,context:n,headers:r,actionID:s,dataViewParameters:a}=e,o={data_view_ID:t,action_ID:s},{restApi:i,reqType:c}=Ng("openDataObjectAction",o);return ki(pc(i,{method:c,headers:r,body:{dataViewParameters:a}},n)).pipe($l((t=>({response:t.data,actionInPayload:e}))),Xl("Error occurred during ajax call at getDataObjectView Epic",n))},nu=e=>{const{savableDatapage:t,context:n,headers:r,actionID:s,keys:a,containerItemID:o}=e,i={data_view_ID:t,action_ID:s},{restApi:c,reqType:l}=Ng("submitDataObjectAction",i),{content:u}=Rc(o);return ki(pc(c,{method:l,headers:r,body:{data:{...u?.content,...a},pageInstructions:u?.pageInstructions||[]}},n)).pipe($l((t=>({response:t.data,actionInPayload:e}))),Xl("Error occurred during ajax call at getDataObjectView Epic",n))};const ru=new class{constructor(){this.components={}}_checkComponent(e,t){return!!this.components[t]?.[e]}start(e,t,n,r,s){const a={viewName:e,pageReference:n,contextName:r,isInProgress:!0,active:!0,caseKey:t};this.components[r]=this.components[r]||{},this.components[r][s]=a}stop(e,t){this._checkComponent(e,t)&&(this.components[t][e].isInProgress=!1)}remove(e,t){this._checkComponent(e,t)&&delete this.components[t][e]}removeContext(e){delete this.components[e]}enableCascade(e){this.components[e]&&Object.values(this.components[e]).forEach((e=>{e.isInProgress&&(e.cascade=!0)}))}activate(e,t){this._checkComponent(e,t)&&(this.components[t][e].active=!0)}deactivate(e,t){this._checkComponent(e,t)&&(this.components[t][e].active=!1)}refreshActiveComponents(e){e&&this.components[e]&&Object.keys(this.components[e]).forEach((t=>{this.refreshComponent(t,e)}))}refreshComponent(e,t){if(!this._checkComponent(e,t))return;const n=this.components[t][e];if(n.active&&n.cascade){const{caseKey:e,viewName:r,pageReference:s}=n;vn(e,r,t,s,{})}}},su="postDataViewMetadata",au={getData:(e,t,n,r)=>((e,t,n,r={})=>{const s={dataViewName:e},{skipClearErrorMessages:a,signal:o,doNotMergeMessagesForStatusCode:i}=r,{restApi:c,reqType:l}=Ng("getListData",s);return pc(c,{method:l,body:t,...o&&{signal:o},...a&&{skipClearErrorMessages:a}},n,i)})(e,t,n,r),getListCount:(e,t,n)=>{const r={dataViewName:e},{restApi:s,reqType:a}=Ng("getListDataCount",r);return pc(s,{method:a,body:t},n)},getDataViewMetadata:(e,t,n,r)=>{const s=!!n,a=!!r,o=lp.doesRestApiExist(su),i=(s||a)&&o?su:"getDataViewMetadata",c={dataViewName:e},{restApi:l,reqType:u}=Ng(i,c);if(o){if(s)return pc(l,{method:u,body:{associationFilter:n}},t);if(a)return pc(l,{method:u,body:{propertyFilter:r}},t)}return pc(l,{method:u},t)},getDataObjectView:(e,t,n,r,s={})=>{const{skipClearErrorMessages:a,signal:o,doNotMergeMessagesForStatusCode:i}=s,c={data_view_ID:e,view_ID:t},l={dataViewParameters:n},{restApi:u,reqType:d}=Ng("readDataObject",c);return pc(u,{method:d,body:l,...o&&{signal:o},...a&&{skipClearErrorMessages:a}},r,i)},getCaseEditMetadata:(e,t)=>Cc.getCaseEditMetadata(e,t),getCaseEditLock:(e,t)=>Cc.getCaseEditLock(e,t),updateCaseEditFieldsData:(e,t,n,r)=>Cc.updateCaseEditFieldsData(e,t,n,r),moveListRecords:(e,t)=>{const{sourceID:n,destinationID:r,context:s,listClass:a,viewName:o,viewClassName:i}=e,c={viewName:o,viewClassName:i},{restApi:l,reqType:u}=Ng("moveListRecords",c);return pc(l,{method:u,body:{content:{sourceID:n,destinationID:r,context:s,listClass:a}}},t)},isTimeElapsed:(e,t,n="")=>{if(t){if(e&&n===j.RELOAD_IF_OLDER_THAN)return new Date(e).setSeconds(t)<Date.now();if(e&&n===j.RELOAD_ONCE_PER_INTERACTION)return!0}return!0},getAppCacheKey:e=>void 0!==Ad("root").find((e=>e.includes("authoring-preview")))?`${j.AUTHORING_PREVIEW_CONTAINER}-${e}`:`${Lr.getAppAlias()}-${e}`,isDistinctResultsOnly:e=>{const t=up.getKeyMapping("pyGUID");return!e.some((e=>e.field===t))}};const ou=class{constructor(e,t,n){this.filter=e,this.messageHandler=t,this.contextName=n}};const iu=class{constructor(){this.users={},this.connected=!1,this.connectionsCount=1}_handleUserPresence({message:e}){const{state:t,updateById:n}=e,r=this.users[n];r&&(r.state=t,Object.keys(r.subscribers).forEach((e=>{r.subscribers[e]?.callback({state:r.state})})))}_getAutoGenId(){return this.connectionsCount+=1,`${Date.now()}_${this.connectionsCount}`}subscribe(e,t,n){const r=this._getAutoGenId(),s=this.users[e];if(s)return s.subscribers[r]={callback:t,contextName:n},r;this.users[e]={subscribers:{[r]:{callback:t,contextName:n}}};const a={matcher:"PRESENCE",criteria:{userId:e}};return hu.subscribe(a,this._handleUserPresence.bind(this)),r}unsubscribe(e,t){const n={matcher:"PRESENCE",unsubscribeUsers:{users:[e]}};this.users[e]&&this.users[e].subscribers&&(delete this.users[e].subscribers[t],0===Object.keys(this.users[e].subscribers).length&&(delete this.users[e],hu.publishMessage(n)))}getUserState(e){return this.users[e]&&this.users[e].state}clearContext(e){Object.keys(this.users).forEach((t=>{Object.keys(this.users[t].subscribers).forEach((n=>{this.users[t].subscribers[n].contextName===e&&this.unsubscribe(t,n)}))}))}};var cu=s(631),lu=s.n(cu);const uu=class{constructor(e,t){this.atomicSubscribers={},this.connectionsCount=1,this.connected=!1,this.matcher=e,this.criteria=t}_handleAtomicMessage({message:e}){Object.keys(this.atomicSubscribers).forEach((t=>{const n=this.atomicSubscribers[t],r=Object.keys(n.criteria),s=Object.keys(e);0===lu()(r,s).length&&n.callback(e)}))}_getAutoGenId(){return this.connectionsCount+=1,`${Date.now()}_${this.connectionsCount}`}subscribe(e,t){if(!this.connected){const e={matcher:this.matcher,criteria:this.criteria};hu.subscribe(e,this._handleAtomicMessage.bind(this)),this.connected=!0}const n=this._getAutoGenId();return this.atomicSubscribers[n]={criteria:e,callback:t},n}unsubscribe(e){delete this.atomicSubscribers[e]}};const du=new class{constructor(){this.subscriptions={}}getOrCreateSubscription(e){if(!this.subscriptions[e]){const t={caseId:e};this.subscriptions[e]=new uu("CASE",t)}return this.subscriptions[e]}};class pu{static subscribers={};static connectionsCount=0;static webSocket=null;static connectionConfig=null;static inProgressSubscriptions=[];static inProgressMessages=[];static isServiceAlive=null;static serviceAliveHandler=null;static userPresence=new iu;static refreshB2SOffset=10;static initConnection(e){if(!e)return;const{messagingService:t}=e;if(!t||t&&t.length<=6)return;const n=Lr.b2sJWT;if(!n||n.length<4)return;this.webSocket&&(this.cleanSocketListeners(),this.webSocket.close());const r=t.endsWith("/")?t+"ws":t+"/ws";try{const e=new WebSocket(`${r}`);this.webSocket=e,e.addEventListener("open",this.handleOnOpen.bind(this)),e.addEventListener("message",this.handleOnMessage.bind(this)),e.addEventListener("error",this.handleOnError.bind(this)),e.addEventListener("close",this.handleOnClose.bind(this))}catch(e){console.log(e)}}static handleOnError(e){this.getTokenExpiryTime()<=0&&(clearInterval(this.reInitInterval),this.reInitInterval=void 0),console.log("web socket connection error event: ",e)}static handleOnClose(e){null!==this.serviceAliveHandler&&(clearTimeout(this.serviceAliveHandler),this.serviceAliveHandler=null),e&&4001===e.code||this.connectionConfig?.disableReInit||this.reInitInterval||this.getTokenExpiryTime()<=0||this.reInitialization()}static handleOnOpen(){if(clearInterval(this.reInitInterval),this.reInitInterval=void 0,null!==this.webSocket&&1===this.webSocket.readyState){const e=Lr.b2sJWT;if(!e||e.length<4)return;this.publishMessage({token:e})}}static handleOnMessage(e){if(null!==e&&"ALIVE"===e.data)null===this.isServiceAlive&&this.checkLiveliness(8e3),this.isServiceAlive=!0;else{let t=null;try{t=JSON.parse(e.data)}catch(t){console.error("Invalid data received from messaging service",e.data)}if(t&&t.msgId&&this.webSocket.send(`{"ack":"${t.msgId}"}`),t&&t.filter){const{matcher:e,criteria:n}=t.filter;delete n.environmentID,Object.keys(this.subscribers).forEach((r=>{const s=this.subscribers[r];s.filter.matcher===e&&Sh.isEqual(s.filter.criteria,n)&&s.messageHandler(t)}))}else if(t&&t.tokenExpiryTime){this.setTokenExpiryTime(t);const e=1e3*(this.getTokenExpiryTime()-this.refreshB2SOffset);setTimeout((()=>this.refreshB2STokenReInit()),e);let n=[];this.inProgressSubscriptions.forEach((({messageSubscriber:e,id:t})=>{n?.includes(t)||(n?.push(t),this.subscribeToSocket(e,t))})),this.inProgressSubscriptions=[],this.inProgressMessages.forEach((e=>{this.publishMessage(e)})),this.inProgressMessages=[],n=null}else console.error("filter missing from received data from messaging service",e.data)}}static reInitialization(e){this.reInitInterval||(Object.keys(this.subscribers).forEach((e=>{this.inProgressSubscriptions.push({messageSubscriber:this.subscribers[e],id:e})})),e?this.initConnection(this.connectionConfig):this.reInitInterval=setInterval((()=>{this.initConnection(this.connectionConfig)}),5e3))}static checkLiveliness(e){!1===this.isServiceAlive?this.reInitialization(!0):this.isServiceAlive=!1,null!==this.serviceAliveHandler&&clearTimeout(this.serviceAliveHandler),this.serviceAliveHandler=setTimeout((()=>{this.checkLiveliness(e)}),e)}static setConnectionConfig(e){this.connectionConfig=e}static cleanSocketListeners(){null!==this.webSocket&&(this.webSocket.removeEventListener("open",this.handleOnOpen.bind(this)),this.webSocket.removeEventListener("message",this.handleOnMessage.bind(this)),this.webSocket.removeEventListener("error",this.handleOnError.bind(this)),this.webSocket.removeEventListener("close",this.handleOnClose.bind(this)))}static disconnect(){null!==this.webSocket&&(this.cleanSocketListeners(),this.webSocket.close(),this.webSocket=null)}static subscribe(e,t,n,r){this.connectionsCount+=1;const s=r||`${Date.now()}_${this.connectionsCount}`,a=new ou(e,t,n);return null!==this.webSocket&&1===this.webSocket.readyState?(this.subscribeToSocket(a,s),s):(this.inProgressSubscriptions.push({messageSubscriber:a,id:s}),null===this.webSocket&&this.initConnection(this.connectionConfig),s)}static subscribeToSocket(e,t){this.subscribers[t]=e;const n={filter:e.filter,subscribe:{id:t}};this.webSocket.send(JSON.stringify(n))}static unsubscribe(e){if(this.subscribers[e]){delete this.subscribers[e];const t={unsubscribe:{id:e}};null!==this.webSocket&&1===this.webSocket.readyState&&this.webSocket.send(JSON.stringify(t))}}static publishMessage(e){null!==this.webSocket?null===this.webSocket||1!==this.webSocket.readyState?this.inProgressMessages.push(e):this.webSocket.send(JSON.stringify(e)):console.error("Web socket not initialized.")}static getUserPresence=()=>this.userPresence;static getCaseSubscription=e=>du.getOrCreateSubscription(e);static refreshB2STokenReInit=async()=>{const e={body:{B2SToken:Lr.b2sJWT}};PCore.getRestClient().invokeRestApi("refreshB2S",e).then((e=>{const{newB2SToken:t}=e.data;t&&t.length>30?(Lr.b2sJWT=t,this.setTokenExpiryTime({tokenExpiryTime:Math.round(Date.now()/1e3)+60}),this.webSocket.close()):console.log("refreshB2S: invalid b2s length")})).catch((e=>{console.log(`refreshB2S: error occurred while fetching: ${e}`)}))};static getTokenExpiryTime=()=>{const e=Math.round(Date.now()/1e3);return this.tokenExpiryTime-e};static setTokenExpiryTime=e=>{this.tokenExpiryTime=e.tokenExpiryTime};static clearContext(e){Object.keys(this.subscribers).forEach((t=>{this.subscribers[t].contextName===e&&this.unsubscribe(t)})),this.userPresence.clearContext(e)}}const hu=pu;const gu=class{constructor(){this.records=[],this.maxRecords=0,this.isDirty=!1}getRecords(e){if(e){const t=[],{pageNumber:n,pageSize:r}=e,s=n*r;let a=s-r;for(;a<s;a+=1){if(!this.records[a])return this.maxRecords===a?t:[];t.push(this.records[a])}return t}return this.records}mergeRecords(e,t){if(t){const{pageNumber:n,pageSize:r}=t,s=n*r;let a=0;for(let t=s-r+1-1;t<s;t+=1)this.records[t]=e[a],a+=1;if(e.length<r){const t=(n-1)*r+e.length;this.setMaxRecordsCount(t)}}else e||(e=[]),Array.isArray(this.records)&&Array.isArray(e)&&(this.records=yh(this.records,e,{isArrayDeepMerge:!1})),this.setMaxRecordsCount(this.records.length)}setMaxRecordsCount(e){this.maxRecords=e}getMaxRecordsCount(){return this.maxRecords}};const fu=new class{constructor(){this.dataStore={},this.dataStoreMeta={},this.subscribers={},this.dataPageSubscribers={},this.isCacheEnabled=!0,this.subscribedDataPageNames=new Set}SUBSCRIPTION_STATUS_FAILED="FAILED";SUBSCRIPTION_STATUS_SUCCESS="SUCCESS";DATAPAGE_NOT_CACHED="Data Page Not Cached";DUPLICATE_SUBSCRIPTION_ID="Duplicate Subscription Id";MISSING_MANDATORY_FIELD="Missing Mandatory Field(s)";getData(e,t,n,r){const s=this.generateHash(e,t,r);if(this.dataStore[e]&&this.dataStore[e][s]){const t=this.dataStore[e][s];return t.isDirty?[]:t.getRecords(n)}return[]}generateHash(e,t,n){const r=Bp(e);let s=[];r||(s=Object.keys(t||{}).map((e=>({name:e}))));let a="",o=e;const i=[];return(r?.parameters||s).forEach((e=>{t?.[e.name]?i.push(t[e.name]):i.push(e.defaultValue??j.NULL_STRING)})),n&&i.push(JSON.stringify(n)),i.join(j.HASH_DELIMITER)&&(a=Sh.getHashedString(i.join(j.HASH_DELIMITER)),o=e+j.UNDERSCORE_STRING+a),o}async getDataAsync(e,t,n={},r,s,a={}){if(this.subscribeToMessageService(e),a.purgeDataPageCache&&(this.dataStore[e]={},this._removeDataStoreMetaEntry(e)),!this.isCacheable(e,s)||a.invalidateCache){const o=await this.fetchData(e,n,r,s,t,a),i=o?.data?.data??[];return{...o.data,data:i,pageNumber:o?.data?.pageNumber,pageSize:o?.data?.pageSize,queryStats:o?.data?.queryStats,status:o?.status}}const o=this.getData(e,n,r,s);if(o.length>0)return Promise.resolve({data:o});const i=await this.fetchData(e,n,r,s,t,a);return{...i.data,data:this.mergeDataStore(e,n,r,s,i),pageNumber:i?.data?.pageNumber,pageSize:i?.data?.pageSize,queryStats:i?.data?.queryStats,status:i?.status}}async getPageDataAsync(e,t,n={},r={}){this.subscribeToMessageService(e);const s=this.generateHash(e,n,null);if(r.purgeDataPageCache&&(this.dataStore[e]={},this._removeDataStoreMetaEntry(e)),this.isCacheable(e)&&this.dataStore[e]&&this.dataStore[e][s]){if(!r?.invalidateCache)return Promise.resolve(this.dataStore[e][s]);delete this.dataStore[e][s],this._removeDataStoreMetaEntry(e,n,s)}const{restApi:a,reqType:o}=Ng(j.GET_PAGE_DATA,{dataViewName:e,dataViewParameters:encodeURIComponent(JSON.stringify(n))}),i={method:o},c=a&&n&&0===Object.keys(n).length?a.split("?")[0]:a;return pc(c,i,t).then((t=>(this.isCacheable(e)&&(this.dataStore[e]={...this.dataStore[e],[s]:t.data},this._addDataStoreMetaEntry(e,n,s)),t.data)))}subscribeToDataPageUpdates(e,t,n,r={}){if(!e||!t||!n)return!1;const s=this.generateHash(n,r,null);this.dataPageSubscribers[n]??={};const a=this.dataPageSubscribers[n];a[s]??={};const o=a[s];return!o[e]&&(o[e]??=t,!0)}unsubscribeToDataPageUpdates(e,t,n={}){if(!e||!t)return!1;const r=this.generateHash(t,n,null);return delete this.dataPageSubscribers[t]?.[r]?.[e],!0}_isDataPageCached(e,t){if(t&&Sh.isObjectEmpty(t))return!!this.dataStore[e];const n=this.generateHash(e,t,null);return!!this.dataStoreMeta[e]?.[n]?.length}updateDataPageStore(e={}){Object.keys(e).forEach((t=>{this.dataStore[t]||(this.dataStore[t]={});const n=e[t];Object.keys(n).forEach((n=>{if(this.dataStore[t][n]){this.dataStore[t][n].mergeRecords(e[t][n].pxResults)}else{const r=new gu;this.dataStore[t][n]=r,r.mergeRecords(e[t][n].pxResults||[])}}))}))}_addDataStoreMetaEntry(e,t,n){const r=this.generateHash(e,t,null);this.dataStoreMeta[e]??={};const s=this.dataStoreMeta[e];s[r]??=[];const a=s[r];a.includes(n)||a.push(n)}_removeDataStoreMetaEntry(e,t,n){if(!e||t||n||(this.dataStoreMeta[e]={}),e&&t&&n){const r=this.generateHash(e,t,null);this.dataStoreMeta[e][r]=this.dataStoreMeta[e][r].filter((e=>e!==n))}}mergeDataStore(e,t,n,r,s){const a=this.generateHash(e,t,r),o=s?.data?.data;if(!o||0===o.length)return[];this.dataStore[e]||(this.dataStore[e]={}),this.dataStore[e][a]||(this.dataStore[e][a]=new gu);const i=this.dataStore[e][a];return i.mergeRecords(o,n),i.isDirty=!1,this._addDataStoreMetaEntry(e,t,a),i.getRecords(n)}async fetchData(e,t,n,r,s,a){const{additionalApiParams:{useExtendedTimeout:o=!1,includeTotalCount:i=!1}={},...c}=a,l={dataViewParameters:t};return i&&(l.includeTotalCount=!0),o&&(l.useExtendedTimeout=!0),n&&(l.paging=n),r&&(l.query=r),au.getData(e,l,s,c)}isDataPage(e=""){return e.startsWith("D_")||e.startsWith("Declare_")}handleCascadeUpdate(){const{dataPageName:e,scope:t}=this;t.handleMessage({message:{datapage:e,parameters:""}})}subscribeToUpdate(e,t,n,r,s,a){this.subscribers[e]=this.subscribers[e]||{},this.subscribers[e].callback=this.subscribers[e].callback||{},a&&!this.subscribers[e].callback?.[a]&&(this.subscribers[e].callback[a]=s),this.subscribeToCascadeUpdates(e,t,n,r,a)}unsubscribe(e,t,n,r,s){delete this.subscribers[e]?.callback?.[s],t&&t.length>0&&nh.unRegisterFields(n,r,t,s)}subscribeToCascadeUpdates(e,t,n,r,s){t&&t.length>0&&nh.registerFields(n,r,t,this.handleCascadeUpdate.bind({dataPageName:e,scope:this}),s)}subscribeToMessageService(e){if(e&&this.subscribedDataPageNames.has(e))return;const t={matcher:"DATAPAGE_UPDATED",criteria:{datapage:e}};hu.subscribe(t,this.handleMessage.bind(this)),this.subscribedDataPageNames.add(e)}handleMessage(e){const{msgId:t,message:n}=e,{datapage:r,parameters:s=""}=n,a=this.subscribers[r];this.markDataInstanceDirty(r,""===s?null:JSON.parse(s)),t&&this._executeDataPageSubscriptions(e),!t&&a?.callback&&Object.keys(a.callback).forEach((t=>{a.callback?.[t](e.message)}))}markDataInstanceDirty(e,t){let n,r;if((!t||(n=this.generateHash(e,t,null),r=this.dataStoreMeta[e]?.[n],r))&&this.dataStore[e]){Object.keys(this.dataStore[e]).filter((e=>!t||!r||r.includes(e))).forEach((t=>{this.dataStore[e][t].isDirty=!0}))}}_executeDataPageSubscriptions(e){const{message:t}=e,{datapage:n,parameters:r}=t,s=r?JSON.parse(r):null;if(this.dataPageSubscribers[n])if(s){const t=[];t.push(this.generateHash(n,s,null)),t.push(this.generateHash(n,null,null)),t.forEach((t=>{const r=this.dataPageSubscribers[n]?.[t]??{};Object.keys(r).forEach((t=>{r[t](e.message)}))}))}else{const t=this.dataPageSubscribers[n];Object.keys(t).forEach((n=>{const r=t[n];Object.keys(r).forEach((r=>{t[n][r](e.message)}))}))}}isPerInteraction(e){const t=Bp(e);return"reloadOncePerInteraction"===t?.refreshStrategy?.type}isCacheable(e,t){return!(this.isPerInteraction(e)||!this.isCacheEnabled)&&!(t&&Object.keys(t).length>1)}disableCache(e){this.isCacheEnabled=!e}};const mu=class{constructor(e,t,n,r,s=100,a=500){this.finalDataViewCall=e,this.combiner=t,this.comparator=n,this.separator=r,this.maxtime=s,this.maxsize=a,this.groupedDataViewArray=[]}findCombinableDataViewCall(e){return this.groupedDataViewArray.find((t=>this.comparator(t,e)))}dequeueAllDataViewCalls(){for(this.groupedDataViewArray.reverse();this.groupedDataViewArray.length>0;){const e=this.groupedDataViewArray.pop();this.finalDataViewCall(e).then((t=>{this.separator(e,t)}))}clearTimeout(this.timeoutId)}dequeueDataViewCallOnSizeExceed(e){const t=this.groupedDataViewArray.findIndex((t=>this.comparator(t,e)));this.groupedDataViewArray[t]&&(this.groupedDataViewArray.splice(t,1),this.finalDataViewCall(e).then((t=>{this.separator(e,t)})))}queueDataViewCall(e,t){let n,r,s=this.findCombinableDataViewCall(e);return n=new Promise((e=>{r=e})),s&&!s.dataViewCallMap[t]?(this.combiner(s,e),s.dataViewCallMap[t]={promise:n,resolve:r}):s?n=s.dataViewCallMap[t].promise:(s={...e,dataViewCallMap:{[t]:{promise:n,resolve:r}}},this.groupedDataViewArray.push({...e,dataViewCallMap:{[t]:{promise:n,resolve:r}}})),Object.keys(s.dataViewCallMap).length===this.maxsize?this.dequeueDataViewCallOnSizeExceed(s):(clearTimeout(this.timeoutId),this.timeoutId=setTimeout((()=>this.dequeueAllDataViewCalls()),this.maxtime)),n}};const yu=class{constructor(){this.bufferedDataQueues={}}getBufferedDataQueueForDataPage(e){return this.bufferedDataQueues[e]}addBufferedDataQueueForDataPage(e,t,n,r,s,a,o){return this.getBufferedDataQueueForDataPage(e)||(this.bufferedDataQueues[e]=new mu(t,n,s,r,a,o)),this.bufferedDataQueues[e]}},Iu=(e,t)=>((e,t)=>1===Object.keys(e).length&&Object.keys(e).length===Object.keys(t).length)(e,t)&&((e,t)=>"EQ"===t.F0.comparator&&(e.F0.comparator===t.F0.comparator||"IN"===e.F0.comparator))(e,t)&&e.F0.ignoreCase===t.F0.ignoreCase,Eu=e=>e.map((e=>e.field)),Au=(e,t)=>{const n=(e.query?.filter).filterConditions,r=(t.query?.filter).filterConditions;let s=(t.query?.filter).logic;const a=Object.keys(n).length;Iu(n,r)?("EQ"===n.F0.comparator&&(e=>{const t=e?.F0.rhs.value;e.F0.rhs={values:[t]},e.F0.comparator="IN"})(n),n.F0.rhs.values.push(r.F0.rhs.value)):(Object.keys(r).forEach(((e,t)=>{const o=`F${a+t}`;n[o]=r[e],s=s.replace(e,o)})),(e.query?.filter).logic+=` OR ${s}`);const o=Eu(e.query?.select);Eu(t.query?.select).forEach((t=>{o.includes(t)||(e.query?.select).push({field:t})}))},_u=(e,t)=>((e,t)=>Object.keys(e.filterConditions).length%Object.keys(t.filterConditions).length==0&&!Object.keys(t.filterConditions).some((n=>e.filterConditions[n].lhs.field!==t.filterConditions[n]?.lhs.field)))(e.query?.filter,t.query?.filter)&&(((e,t)=>e.dataViewParameters&&t.dataViewParameters&&Object.keys(t.dataViewParameters).length===Object.keys(e.dataViewParameters).length&&!Object.keys(e.dataViewParameters).some((n=>"string"==typeof t.dataViewParameters?.[n]?e.dataViewParameters?.[n]!==t.dataViewParameters?.[n]:!Sh.isEqual(e.dataViewParameters?.[n],t.dataViewParameters?.[n]))))(e,t)||((e,t)=>!e.dataViewParameters&&!t.dataViewParameters)(e,t)),Cu=(e,t)=>{const{data:n}=t,{dataViewCallMap:r,filterDataOnClient:s}=e;Object.keys(r).forEach((e=>{r[e].resolve({data:s(e,n)})}))},Su=e=>({combiner:Au,comparator:_u,separator:Cu,...e}),Tu=(e,t)=>{try{window.sessionStorage.setItem(e,t)}catch(e){}};class Nu{constructor(e,t){this.isInitialised=!1,this.isQueryable=!0,this.dataSourceMetaData={},this.nonQueryableData=[],this.fetchedNQData=!1,this.previousSearchText=null,this.totalRecordCount=0,this.fetchedRecordCount=0,this.cache={},this.pageNumber=0,this.isNQDataFetchInProgress=!1,this.fetchNQDataPromise=null,this.dataSource="",this.bufferInitialized=!1,e&&(this.listType=e.listType,this.dataSource=e.dataSource,e.enablePagination?(this.enablePagination=e.enablePagination,this.pageSize=e.pageSize):this.maxResultsDisplay=e.maxResultsDisplay,this.parameters=e.parameters,this.columns=e.columns,this.matchPosition=e.matchPosition,this.ignoreCase=!1!==e.ignoreCase,this.dataSourceMetaData=e.dataSourceMetaData,this.context=t)}static searchResultsCache={};static init(e,t){return new Promise(((n,r)=>{const s=[...e.columns.map((e=>e.value)),...Object.entries(e.parameters).map((([e,t])=>`${e}+${t}`)),e.matchPosition,e.maxResultsDisplay].join(j.HASH_DELIMITER),a=Sh.getHashedString(s),o=`${e.dataSource}_${a}`,i=au.getAppCacheKey(e.dataSource);if(window.sessionStorage.getItem(i)){const s=JSON.parse(window.sessionStorage.getItem(i));if(t&&Nu.searchResultsCache?.[t]?.[o])n(Nu.searchResultsCache[t][o]);else if("form"!==e.cacheLifeSpan&&Nu.searchResultsCache?.persisted?.[o])n(Nu.searchResultsCache.persisted[o]);else{const a=new Nu(e,t);JSON.stringify(s.associationFilter)===JSON.stringify(e.associationFilter)?(a.dataSourceMetaData=s.dataSourceMetaData,a.isQueryable=s.isQueryable,a.isInitialised=s.isInitialised,a.associationFilter=s.associationFilter,Nu.initializeCache(t,e,o,a),n(a)):(a.associationFilter=e.associationFilter,a.propertyFilter=e.propertyFilter,a.fetchMetaData(t).then((r=>{Tu(i,JSON.stringify({isQueryable:r.data.isQueryable,dataSourceMetaData:r.data,isInitialised:!0,associationFilter:e.associationFilter})),a.isQueryable=r.data.isQueryable,a.dataSourceMetaData=r.data,a.isInitialised=!0,Nu.initializeCache(t,e,o,a),n(a)})).catch((e=>{a.isInitialised=!1,r(e)})))}}else if(e.deferDatasource&&Bp(e.dataSource)){const r=new Nu(e,t),s=Bp(e.dataSource);r.isQueryable=!!s?.isQueryable,r.isInitialised=!0,r.dataSourceMetaData=s,Tu(i,JSON.stringify({isQueryable:s?.isQueryable,dataSourceMetaData:s,isInitialised:!0})),r.context=t,Nu.initializeCache(t,e,o,r),n(r)}else{const s=new Nu(e,t);s.associationFilter=e.associationFilter,s.propertyFilter=e.propertyFilter,s.fetchMetaData(t).then((r=>{Tu(i,JSON.stringify({isQueryable:r.data.isQueryable,dataSourceMetaData:r.data,isInitialised:!0,associationFilter:e.associationFilter})),s.isQueryable=r.data.isQueryable,s.dataSourceMetaData=r.data,s.isInitialised=!0,Nu.initializeCache(t,e,o,s),n(s)})).catch((e=>{s.isInitialised=!1,r(e)}))}}))}static bufferedDataView=new yu;registerForBufferedCall(e){return this.isQueryable&&(this.initializeBufferCallsForDataPage(Su(e)),this.bufferInitialized=!0),this}static clearContextedCache(e){delete Nu.searchResultsCache[e]}static initializeCache(e,t,n,r){e&&"form"===t.cacheLifeSpan?.toLowerCase()?(void 0===Nu.searchResultsCache[e]&&(Nu.searchResultsCache[e]={}),Nu.searchResultsCache[e][n]=r):(void 0===Nu.searchResultsCache.persisted&&(Nu.searchResultsCache.persisted={}),Nu.searchResultsCache.persisted[n]=r)}fetchMetaData(e){return au.getDataViewMetadata(this.dataSource,e,this.associationFilter,this.propertyFilter)}initializeBufferCallsForDataPage(e){Nu.bufferedDataView.addBufferedDataQueueForDataPage(this.dataSource,(e=>fu.getDataAsync(this.dataSource,this.context,e.dataViewParameters,e.paging,e.query)),e.combiner,e.separator,e.comparator,e.waitTime,e.maxSize)}buildSchemaForQueryableBufferDP(e){return{...this.buildSchemaForQueryableDP(e),paging:void 0,filterDataOnClient:this.filterDataOnClient.bind(this)}}getData(e,t){if(this.isQueryable){if(this.bufferInitialized)try{const t=this.buildSchemaForQueryableBufferDP(e);return Nu.bufferedDataView.getBufferedDataQueueForDataPage(this.dataSource).queueDataViewCall(t,e)}catch{const n=this.buildSchemaForQueryableDP(e,t);return fu.getDataAsync(this.dataSource,this.context,n.dataViewParameters,n.paging,n.query)}const n=this.buildSchemaForQueryableDP(e,t);return fu.getDataAsync(this.dataSource,this.context,n.dataViewParameters,n.paging,n.query)}return this.fetchNonQueryableResults(e,t)}memoizedGetData(e,t){const n=e?.toLowerCase();if(this.enablePagination?n in this.cache&&this.pageNumber in this.cache[n]:n in this.cache)return this.enablePagination?this.cache[n][this.pageNumber]:this.cache[n];const r=this.getData(e,t);return this.enablePagination?(this.cache[n]=this.cache[n]||{},this.cache[n][this.pageNumber]=r):this.cache[n]=r,r}fetchData(e,t=!1,n){return this.isValidDatasource()&&this.isInitialised?(this.pageNumber=t?this.pageNumber:1,this.memoizedGetData(e,n)):Promise.reject(new Error)}fetchPaginatedData(e){return this.pageNumber+=1,this.fetchData(e,!0)}fetchNonQueryableResults(e,t){if(void 0===e)return Promise.resolve({data:[]});if(this.fetchedNQData)return Promise.resolve({data:this.filterDataOnClient(e,this.nonQueryableData,t)});if(this.isNQDataFetchInProgress)return this.fetchNQDataPromise?.then((()=>({data:this.filterDataOnClient(e,this.nonQueryableData,t)}))).catch((e=>Promise.reject(e)));if(this.dataSourceMetaData?.structure&&"list"===this.dataSourceMetaData.structure.toLowerCase()){const n=this.buildSchemaForNonQueryableDP();return this.fetchNQDataPromise=fu.getDataAsync(this.dataSource,this.context,n.dataViewParameters),this.isNQDataFetchInProgress=!0,new Promise(((n,r)=>{this.fetchNQDataPromise?.then((r=>(this.nonQueryableData=[...r.data],this.fetchedNQData=!0,n({data:this.filterDataOnClient(e,this.nonQueryableData,t)})))).catch((e=>r(e))).finally((()=>{this.isNQDataFetchInProgress=!1,this.fetchNQDataPromise=null}))}))}return Promise.resolve(null)}filterDataOnClient(e,t,n){const r=(n?.columns??this.columns)?.filter((e=>e.useForSearch)).map((e=>e.value));return t.reduce(((t,s)=>(Object.keys(s).every((a=>!(r?.includes(a)&&s[a]&&this.positionMatches(`${s[a]}`,e,n))||(t.push({...s}),!1))),t)),[])}positionMatches(e,t,n){const r=n?.ignoreCase??this.ignoreCase,s=r?e.toLowerCase():e,a=r?t.toLowerCase():t;switch(n?.matchPosition??this.matchPosition){case"start":return s.startsWith(a);case"contains":return s.includes(a);case"equals":return s===a;default:return!1}}buildSelect(e){const t=[],n=[];return(e?.columns??this.columns)?.forEach((e=>{if(!n.includes(e.value)){n.push(e.value);const r={field:e.value};t.push(r)}})),t}buildFilters(e,t){const n=t?.matchPosition??this.matchPosition,r=t?.ignoreCase??this.ignoreCase,s={};let a=0;(t?.columns??this.columns)?.forEach((t=>{if(t.useForSearch){const o=`F${a}`;a+=1;const i={field:t.value},c={value:e};let l="CONTAINS";"start"===n?l="STARTS_WITH":"equals"===n&&(l="EQ");const u={...`${parseFloat(e)}`!==e==!0&&{ignoreCase:r?"true":"false"},lhs:i,rhs:c,comparator:l};s[o]=u}}));const o=Object.keys(s).join(" OR ");return{filterConditions:s,logic:o}}buildQuery(e,t){const n=this.buildSelect(t);return e?{select:n,filter:this.buildFilters(e,t),...au.isDistinctResultsOnly(n)&&{distinctResultsOnly:"true"}}:{select:n,...au.isDistinctResultsOnly(n)&&{distinctResultsOnly:"true"}}}buildPageOptions(){return this.enablePagination?{pageNumber:this.pageNumber,pageSize:this.pageSize}:{maxResultsToFetch:this.maxResultsDisplay}}buildSchemaForQueryableDP(e,t){return{dataViewParameters:this.parameters,query:this.buildQuery(e,t),paging:this.buildPageOptions()}}buildSchemaForNonQueryableDP(){return{dataViewParameters:this.parameters}}isValidDatasource(){return!!this.dataSource}}const Pu=Nu;const Ru=class{static cleanCaches(e){nh.purgeCascadeFields(e),ru.removeContext(e),Pu.clearContextedCache(e),Gr.cleanContextSubscribers(e),Qc(e),Pn.removeContextTreeNode(e),hu.clearContext(e),hl.deRegisterForRefresh(e)}},Du="GET_DESCENDANTS";const bu=new class{MISSING_CONTEXT_PARAM="context is required parameter";INVALID_CONTEXT_DETAILS="Invalid Context";INVALID_CONTEXT_OPERATION="Invalid Operation on Given Context";schedulePendingActionOnCompletion(e,t){const n=[],r=t.context_data?.blocking_action_counter??0,s=t.context_data?.deferred_action_queue?[...t.context_data.deferred_action_queue]:[];let a=t.context_data?.is_deferred_action_in_progress??!1;if(r<=0){if(a)n.push({type:fe,payload:{context:e,data:{context_data:{is_deferred_action_in_progress:!1}}}});else{if(!(s.length>0))return;{const t=s.shift();a=!a,n.push({type:fe,payload:{context:e,data:{context_data:{deferred_action_queue:s,blocking_action_counter:r,is_deferred_action_in_progress:a}}}}),n.push(t)}}ih(n)}}executeOrQueueDeferredAction(e){if(!e?.payload?.context)return Promise.reject(new Error("Action Context is Mandatory Field."));const t=ch(e?.payload?.context);if(t){const n=[],r=t.context_data?.blocking_action_counter??0,s=t.context_data?.deferred_action_queue?[...t.context_data.deferred_action_queue]:[];let a=t.context_data?.is_deferred_action_in_progress??!1;return s.length<=0&&!a&&(r<=0?(n.push(e),a=!a):s.push(e),n.unshift({type:fe,payload:{context:e.payload.context,data:{context_data:{deferred_action_queue:s,blocking_action_counter:r,is_deferred_action_in_progress:a}}}}),ih(n)),Promise.resolve()}return Promise.reject(new Error(this.INVALID_CONTEXT_DETAILS))}handleDeferredActionCompletion(e){if(!e)return Promise.reject(new Error(this.MISSING_CONTEXT_PARAM));const t=ch(e);return t&&!0===t.context_data?.is_deferred_action_in_progress?(ih({type:fe,payload:{context:e,data:{context_data:{is_deferred_action_in_progress:!1}}}}),this.schedulePendingActionOnCompletion(e,t),Promise.resolve()):Promise.reject(new Error(this.INVALID_CONTEXT_DETAILS))}registerBlockingAction(e){if(!e)return Promise.reject(new Error(this.MISSING_CONTEXT_PARAM));return ch(e)?(ih({type:at,payload:{context:e,isInitiateBlockingAction:!0}}),Promise.resolve()):Promise.reject(new Error(this.INVALID_CONTEXT_DETAILS))}deRegisterBlockingAction(e){if(!e)return Promise.reject(new Error(this.MISSING_CONTEXT_PARAM));const t={...ch(e)};return t.context_data={...t.context_data},t&&t.context_data?.blocking_action_counter>0?(ih({type:at,payload:{context:e,isInitiateBlockingAction:!1}}),t.context_data.blocking_action_counter-=t.context_data.blocking_action_counter,this.schedulePendingActionOnCompletion(e,t),Promise.resolve()):Promise.reject(new Error(this.INVALID_CONTEXT_OPERATION))}cancelDeferredActionsOnError(e){if(!e)return;const t=ch(e);if(t){const n={...t};n.context_data={...n.context_data},n.context_data?.deferred_action_queue&&Sh.rejectPendingActions(n.context_data.deferred_action_queue)&&(n.context_data.deferred_action_queue=[]),n.context_data?.blocking_action_counter&&(n.context_data.blocking_action_counter=0),n.context_data?.is_deferred_action_in_progress&&(n.context_data.is_deferred_action_in_progress=!1),ih({type:fe,payload:{context:e,data:{...n}}}),cn.disableLoadingIndicator({context:e})}}},Ou=(e,t)=>{const n={},r=Ul.getLookUpDataPage(e),s=Ul.getDataPageKeys(r);if(s)for(const e of s)n[e.keyName]=e.isAlternateKeyStorage?t[e.linkedField]:t[e.keyName];return{dataViewParameters:n,dataPageID:r,dataPageKeys:s}},vu=(e,t)=>{const n=Ul.getSavableDataPage(e),r=Ul.getDataPageKeys(n);return r?.forEach((e=>{e.isAlternateKeyStorage&&(e.keyName===e.linkedField||Object.keys(t).includes(e.linkedField))?e.keyName=t[e.linkedField]:e.isAlternateKeyStorage&&Object.keys(t).includes(e.keyName)&&e.keyName!==e.linkedField?(t[e.linkedField]=t[e.keyName],delete t[e.keyName]):e.keyName=t[e.keyName]})),{keys:t,dataPageID:n,dataPageKeys:r}},xu=e=>{Gr.publish(F.PUB_SUB_EVENTS.EVENT_CANCEL,e)},wu=(e,t,n)=>{const{callbacks:r}=n;return n.callbacks=null,e(t,n).then((e=>{"cancel"===e?r?.cancel?.():r?.submit?.()}))};const Mu=class{constructor(e){this.c11nEnv=e}MSG_CLASSNAME_REQUIRED="className is required parameter";MSG_CLASSNAME_STRING="className must be a string";MSG_ACTION_ID_REQUIRED="actionID is required parameter";MSG_ACTION_ID_STRING="actionID must be a string";MSG_ACTION_NAME_REQUIRED="actionName is required parameter";MSG_ACTION_NAME_STRING="actionName must be a string";MSG_KEY_PROPERTIES_REQUIRED="keyProperties is required parameter";MSG_DATAVIEWID_REQUIRED="dataViewID is required parameter";MSG_DATAVIEWID_STRING="dataViewID must be a string";MSG_CONTAINERITEMID_REQUIRED="containerItemID is required parameter";MSG_CONTAINERITEMID_STRING="containerItemID must be a string";MSG_PAGENAME_REQUIRED="pageName is required parameter";MSG_PAGENAME_STRING="pageName must be string";MSG_INSIGHTID_REQUIRED="insightID is required parameter";MSG_DASHBOARDID_REQUIRED="DashboardID is required parameter";MSG_ACTIVE_SUGGESTION_UNATTENDED="You must accept or decline autofilled fields.";MSG_CASE_ID_REQUIRED="caseID is required parameter";MSG_CONTEXT_STRING="context must be string";shouldDeleteCaseInCreateStage=(e,t,n)=>!e&&t||n;getSaveActionPayload=(e,t=!1)=>{const n=e,r=n&&n.includes(j.MODAL),s=this.c11nEnv.getValue(F.CASE_INFO.CASE_INFO_ID),a=this.c11nEnv.getValue(F.CASE_INFO.ASSIGNMENT_ID),o=this.c11nEnv.getValue(F.CASE_INFO.ACTIVE_ACTION_ID)?this.c11nEnv.getValue(F.CASE_INFO.ACTIVE_ACTION_ID):this.c11nEnv.getValue(F.CASE_INFO.ASSIGNMENTACTION_ID),i=this.c11nEnv.getContainerName(),c=this.c11nEnv.getValue(F.CASE_INFO.CASE_TYPE_ID),l=t?void 0:il(this.c11nEnv.getContextName()),u=this.c11nEnv.getValue("isProcessAction","isProcessAction");return bh.buildActionObject({context:n,containerItemID:e,assignmentID:a,actionID:o,caseID:s,containerName:i,caseType:c,isModalAction:r,isFormValid:l,isProcessAction:u,saveOnly:t},this.c11nEnv)};actionsApiPromise=(e,t,n=!0)=>{let r,s,a="";a=t&&null!==t.actionMgrID?t.actionMgrID||"":ln.getNextActionMgrId();const o=new Promise(((e,t)=>{r=e,s=t}));if(!r||!s)throw new Error("resolveFn or rejectFn is not defined.");return ln.register(a,o,r,s,e,t,n),{actionMgrID:a,promise:o}};showDataObjectCreateView(e,t=F.VIEW_NAMES.DATA_OBJECT_CREATE_VIEW){const n=bh.buildActionObject({viewName:t,className:e},this.c11nEnv),r=ne,{promise:s}=this.actionsApiPromise(r,n);return ih({type:r,payload:{...n,containerName:F.MODAL,skipSemanticUrl:!0,isCreateDataObject:!0}}),s}cancelDataObject(e){if(!e)return Promise.reject(new Error("containerItemId is required parameter"));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const t=e;if(!Nl(t)){return new Fl(this.c11nEnv).removeContainerItem({containerItemID:e,skipReleaseLockRequest:!0})}const n=He,r=bh.buildActionObject({containerItemID:e,context:t},this.c11nEnv),s=t&&t.includes(j.MODAL);ih({type:n,payload:{...r,isModalAction:s,isDataObject:!0,skipReleaseLockRequest:!0}});const{promise:a}=this.actionsApiPromise(n,r);return a.then((()=>{xu({})}))}createDataObject(e){if(!e)return Promise.reject(new Error("containerItemID is required parameter"));const{data:t}=oh()?.getState()||{},n=t[e]?.dataInfo?.content?.classID;if(!n)return Promise.reject(new Error(j.DATA_CLASS_NOT_FOUND));const r=Ul.getSavableDataPage(n),s=ot,a=!!e&&e.includes(j.MODAL),o=bh.buildActionObject({containerItemID:e,dataPageID:r},this.c11nEnv),{promise:i}=this.actionsApiPromise(s,o);return ih({type:"CREATE_DATA_OBJECT",payload:{...o,isModalAction:a,isFormValid:il(e)}}),i}deleteDataObject(e,t){if(!e)return Promise.reject(new Error("className is required parameter"));if(!t)return Promise.reject(new Error("keys is required parameter"));const n=it,r=Ul.getSavableDataPage(e),s=Ul.getDataPageKeys(r),a={};if(s)for(const e of s)a[e.keyName]=e.isAlternateKeyStorage?t[e.linkedField]:t[e.keyName];const o=bh.buildActionObject({dataViewName:r,dataViewParameters:a},this.c11nEnv),{promise:i}=this.actionsApiPromise(n,o);return ih({type:"DELETE_DATA_OBJECT",payload:{...o}}),i}getDataObjectView(e,t,n={viewName:""}){if(!e)return Promise.reject(new Error(this.MSG_CLASSNAME_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CLASSNAME_STRING));if(!t)return Promise.reject(new TypeError(this.MSG_KEY_PROPERTIES_REQUIRED));if("object"!=typeof t)return Promise.reject(new TypeError("keyProperties must be a object"));const r=ct,{dataPageID:s,dataViewParameters:a}=Ou(e,t),o=bh.buildActionObject({dataLookUp:s,keyProperties:t,requestPayload:a,viewName:n.viewName||F.VIEW_NAMES.DATA_OBJECT_EDIT_VIEW,containerName:j.MODAL},this.c11nEnv),{promise:i}=this.actionsApiPromise(r,o);return ih({type:"VIEW_DATA_OBJECT",payload:{...o}}),i}updateDataObject(e,t){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if(!t)return Promise.reject(new Error("keys is required parameter"));const{data:n}=oh()?.getState()||{},r=n[e]?.dataInfo?.content?.classID;if(!r)return Promise.reject(new Error(j.DATA_CLASS_NOT_FOUND));const{dataPageID:s,keys:a}=vu(r,t),o=lt,i=e&&e.includes(j.MODAL),c=bh.buildActionObject({containerItemID:e,dataPageID:s,key:a},this.c11nEnv),{promise:l}=this.actionsApiPromise(o,c);return ih({type:"UPDATE_DATA_OBJECT",payload:{...c,isModalAction:i,isFormValid:il(e)}}),l}openDataObjectAction(e,t,n,r){if(!e)return Promise.reject(new Error(this.MSG_CLASSNAME_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CLASSNAME_STRING));if(!t)return Promise.reject(new TypeError(this.MSG_KEY_PROPERTIES_REQUIRED));if("object"!=typeof t)return Promise.reject(new TypeError("keyProperties must be a object"));if(!n)return Promise.reject(new Error(this.MSG_ACTION_ID_REQUIRED));if(!r)return Promise.reject(new Error(this.MSG_ACTION_NAME_REQUIRED));const s=ut,{dataViewParameters:a,dataPageID:o,dataPageKeys:i}=Ou(e,t),c=bh.buildActionObject({actionID:n,actionName:r,dataViewParameters:a,lookupDatapage:o,containerName:j.MODAL,dataViewPayload:i,context:this.c11nEnv.getContextName()},this.c11nEnv),{promise:l}=this.actionsApiPromise(s,c);return ih({type:s,payload:{...c}}),l}submitDataObjectAction(e,t,n){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));if(!t)return Promise.reject(new Error(this.MSG_KEY_PROPERTIES_REQUIRED));if(!n)return Promise.reject(new Error(this.MSG_ACTION_ID_REQUIRED));const{data:r}=oh()?.getState()||{},s=r[e]?.dataInfo?.content?.classID;if(!s)return Promise.reject(new Error(j.DATA_CLASS_NOT_FOUND));const a=Zd(e),o=xd(a),i=sd(o,a)||{},{resourceType:c="",key:l=""}=i,u=dt,{dataPageID:d,keys:p}=vu(s,t),h=bh.buildActionObject({containerItemID:e,actionID:n,resourceType:c,key:l,keys:p,savableDatapage:d,containerName:j.MODAL,context:e},this.c11nEnv);h.context=e;const{promise:g}=this.actionsApiPromise(u,h);return ih({type:u,payload:{...h,isFormValid:il(e)}}),g}createWork(e,t={flowType:"",containerName:"",openCaseViewAfterCreate:!1,modalOptions:{dockable:!1},startingFields:Object,remoteCaseMeta:{},channelName:""}){if(!e)return Promise.reject(new Error(this.MSG_CLASSNAME_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CLASSNAME_STRING));if(window.pms?.plugins?.c11n?.createWork)return window.pms.plugins.c11n.createWork(e,"pyStartCase");const{dockable:n=!1}=t?.modalOptions||{};let r=le;const s=bh.buildActionObject({class:e,flowType:"pyStartCase",containerName:j.PRIMARY,openCaseViewAfterCreate:!0,...t,modalOptions:{isDockable:n}},this.c11nEnv),{promise:a}=this.actionsApiPromise(r,s);if(t.channelName&&(s.headers=s.headers||{},s.headers[j.X_ORIGIN_CHANNEL]=t.channelName),$.isRemoteCase(e)){const{RemoteClassName:t,RemoteSystemID:n,name:a}=$.getRemoteCase(e);if(s.className=e,s.class=t,s.headers=s.headers||{},s.headers.RemoteSystemID=n,$.isTraditionalRemoteCase(e)){const n={className:e,name:a,action:"createWork",remoteClassName:t};r=this.setTraditionalRemoteCaseParams(s,n)}}return ec.getPreviewMode()&&(s.debugInfo={debugId:Sh.generateUniqueID()}),ih({type:r,payload:{...s}}),a}setTraditionalRemoteCaseParams(e,t){return e.className=t.className,e.isTraditionalRemoteCase=$.isTraditionalRemoteCase(t.className),e.remoteClassName=t.remoteClassName,e.action=t.action,e.viewName=V,e.gadgetId=t.gadgetId??Cc.getUniqueGadgetId(),e.name=t.name,e.skipSemanticUrl=!0,ne}getDataObjectActions(e,t){if(!e)return Promise.reject(new Error(this.MSG_DATAVIEWID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_DATAVIEWID_STRING));const n=ye,r=bh.buildActionObject({dataViewID:e,dataViewParameters:t},this.c11nEnv),{promise:s}=this.actionsApiPromise(n,r);return ih({type:n,payload:{...r}}),s}getDescendants(e,t){if(!e)return Promise.reject(new Error(this.MSG_CASE_ID_REQUIRED));if("string"!=typeof t)return Promise.reject(new TypeError(this.MSG_CONTEXT_STRING));const n=t||this.c11nEnv.getContextName(),r=bh.buildActionObject({caseID:e,currentContext:n},this.c11nEnv),{promise:s}=this.actionsApiPromise("GET_DESCENDANTS",r),a=(o={...r,context:n},{type:Du,payload:o});var o;return ih(a),s}openWorkByHandle(e,t,n={}){if(!e)return Promise.reject(new Error("workID is required parameter"));if("string"!=typeof e)return Promise.reject(new TypeError("workID must be a string"));if(!t)return Promise.reject(new Error(this.MSG_CLASSNAME_REQUIRED));if("string"!=typeof t)return Promise.reject(new TypeError(this.MSG_CLASSNAME_STRING));if(window.pms?.plugins?.c11n?.openWorkByHandle)return window.pms.plugins.c11n.openWorkByHandle(e,t);const r={insKey:e,acTargetName:n.targetContainer||j.PRIMARY,containerName:n.targetContainer||j.PRIMARY};let s=ue;const a=bh.buildActionObject(r,this.c11nEnv),{promise:o}=this.actionsApiPromise(s,a);return n.channelName&&(a.headers=a.headers||{},a.headers[j.X_ORIGIN_CHANNEL]=n.channelName),a.className=t,$.isRemoteCase(t)&&(s=this.setRemoteCaseParamsForOpenCase(a,t,n.remoteCaseMeta)??s),ec.getPreviewMode()&&![j.WORKAREA].includes(n.targetContainer)&&(a.debugInfo={debugId:Sh.generateUniqueID()}),ih({type:s,payload:{...n,...a}}),o}setRemoteCaseParamsForOpenCase(e,t,n={}){const{RemoteSystemID:r,RemoteClassName:s,name:a}=$.getRemoteCase(t);if(e.headers=e.headers||{},e.headers.RemoteSystemID=r,e.isRemoteCase=!0,e.remoteCaseClass=t,$.isTraditionalRemoteCase(t)){e.remoteCaseMeta=n;const r={className:t,name:a,action:ft,remoteClassName:s};return this.setTraditionalRemoteCaseParams(e,r)}}openAssignment(e,t,n={isActionFromToDoList:!1,isChild:!1,context:"",viewType:"",skipBrowserSemanticUrlUpdate:!1,containerName:"",channelName:"",remoteCaseMeta:{}}){if(!e)return Promise.reject(new Error("assignmentID is required parameter"));if("string"!=typeof e)return Promise.reject(new TypeError("assignmentID must be a string"));if(!t)return Promise.reject(new Error(this.MSG_CLASSNAME_REQUIRED));if("string"!=typeof t)return Promise.reject(new TypeError(this.MSG_CLASSNAME_STRING));if(window.pms?.plugins?.c11n?.openAssignment)return window.pms.plugins.c11n.openAssignment(e,t);const r={assignmentID:e,doDeleteCaseSummary:!0,containerName:n.containerName,isActionFromToDoList:n.isActionFromToDoList,isChild:!1};n.isChild&&(r.containerName=j.PRIMARY,r.isChild=n.isChild);let s=xl;const a=bh.buildActionObject(r,this.c11nEnv),{promise:o}=this.actionsApiPromise(s,a);if(n.channelName&&(a.headers=a.headers||{},a.headers[j.X_ORIGIN_CHANNEL]=n.channelName),$.isRemoteCase(t)){const{RemoteClassName:e,RemoteSystemID:r,name:o}=$.getRemoteCase(t);if(a.headers=a.headers||{},a.headers.RemoteSystemID=r,$.isTraditionalRemoteCase(t)){a.remoteCaseMeta=n.remoteCaseMeta;const r={className:t,name:o,action:"openAssignment",remoteClassName:e};s=this.setTraditionalRemoteCaseParams(a,r)}}a.className=t,a.activeItemCaseViewMode=this.c11nEnv.getValue("context_data.caseViewMode"),ec.getPreviewMode()&&![j.WORKAREA].includes(n.containerName)&&(a.debugInfo={debugId:Sh.generateUniqueID()});const i={context:a.context||n.context,containerName:a.containerName||n.containerName,targetContainerName:a.containerName||n.containerName,viewType:a.viewType||n.viewType,skipBrowserSemanticUrlUpdate:n.skipBrowserSemanticUrlUpdate};return ih({type:s,payload:{...a,...i}}),o}finishAssignment(e,t={outcomeID:"",jsActionQueryParams:{}}){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const n=yd(e);let r=n;if(n?.includes("/workarea")&&(r=n.substring(0,r?.lastIndexOf("/workarea"))),(e=>{const t=Pn.getContextReferences(e);if(t)for(const[,e]of t)if(Rh.resolveContextTreeNodeProps(e.props).hasSuggestions)return!0;return!1})(n)){const e=[{type:"error",message:hp.getLocaleValue(this.MSG_ACTIVE_SUGGESTION_UNATTENDED,"Messages")}];return Yn({messages:e,context:r,category:F.PAGE}),Promise.reject({type:F.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR})}const s=pe,a=t?.isTriggeredFromDifferentContext,{caseID:o,assignments:i,localActionID:c,caseActions:l,caseInfo:u,businessID:d,caseTypeID:p,caseTypeName:h}=on(e,this.c11nEnv,{isTriggeredFromDifferentContext:a}),g=Zt(u);let f,m=!1;if(l){const e=l.find((e=>e.ID===c));m="Case"===e?.type}else f=ch(n);let{assignmentID:y}=on(e,this.c11nEnv,{isTriggeredFromDifferentContext:a});f?.context_data?.actionType&&(m=f.context_data.actionType===j.CASE,y=y||f.context_data.assignmentID);const I=an(i,y,c),[E,A]=o.split(" "),_={class:E,actionID:I,assignmentID:y,caseID:o,workID:A,containerName:this.c11nEnv.getContainerName(),containerItemID:e,isCaseWideAction:m,doDeleteCaseSummary:!0,isInCreateStage:g,businessID:d,caseTypeID:p,caseTypeName:h};e?.includes(j.MODAL)&&(_.containerName=j.MODAL,_.isModalAction=!0),_.outcome=t.outcomeID,_.jsActionQueryParams=t.jsActionQueryParams,u?.isLocalAction&&(_.viewType=Tc.FORM);const C=bh.buildActionObject(_,this.c11nEnv),{promise:S}=this.actionsApiPromise(s,C);return C.isProcessAction=this.c11nEnv.getValue("isProcessAction","isProcessAction")||ch(n).context_data.isProcessAction,bu.executeOrQueueDeferredAction({type:s,payload:{...C,context:n}}),S}getNextWork(){const e=xl,t=bh.buildActionObject({containerName:j.PRIMARY,isGetNextWork:!0},this.c11nEnv),{promise:n}=this.actionsApiPromise(e,t);return ih({type:e,payload:{...t}}),n}openStage(e){if(!e)return Promise.reject(new Error("stageID is required parameter for openStage"));const t=xl,n=this.c11nEnv.getValue(F.CASE_INFO.CASE_INFO_ID),r=this.c11nEnv.getCaseSummary().headers,s=bh.buildActionObject({containerName:this.c11nEnv.getContainerName(),isOpenStage:!0,stageID:e},this.c11nEnv),{promise:a}=this.actionsApiPromise(t,s),o={type:t,payload:{...s,caseID:n,headers:r}};return ih(o),a}submitBulkAction(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const t="SUBMIT_BULK_ACTION",n=this.c11nEnv.getValue(F.CASE_INFO.CASES),r=this.c11nEnv.getValue(F.CASE_INFO.ACTIVE_ACTION_ID),s={containerName:this.c11nEnv.getContainerName(),containerItemID:e,isCaseWideAction:!0,doDeleteCaseSummary:!0,isInCreateStage:!1};e&&e.includes(j.MODAL)&&(s.containerName=j.MODAL,s.isModalAction=!0);const a=bh.buildActionObject(s,this.c11nEnv),{promise:o}=this.actionsApiPromise(t,a),i=yd(e);return ih({type:t,payload:{...a,context:i,cases:n,actionID:r,isFormValid:il(i),classID:this.c11nEnv.getCurrentClassID()}}),o}submitBulkActionAsync(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const t="SUBMIT_BULK_ACTION_ASYNC",n=this.c11nEnv.getValue(F.CASE_INFO.CASES),r=this.c11nEnv.getValue(F.CASE_INFO.ACTIVE_ACTION_ID),s={containerName:e.includes(j.MODAL)?j.MODAL:this.c11nEnv.getContainerName(),containerItemID:e,isCaseWideAction:!0,doDeleteCaseSummary:!0,isInCreateStage:!1,isModalAction:e.includes(j.MODAL)},a=bh.buildActionObject(s,this.c11nEnv),{promise:o}=this.actionsApiPromise(t,a),i=yd(e);return ih({type:t,payload:{...a,context:i,cases:n,actionID:r,isFormValid:il(i),classID:this.c11nEnv.getCurrentClassID()}}),o}openBulkAction(e,t){if(!e)return Promise.reject(new Error("actionID is required parameter for openBulkAction"));if("string"!=typeof e)return Promise.reject(new TypeError("actionID must be a string openBulkAction"));const{selectedList:n,runningMode:r}=t,s=t.type,a={selectedList:n,vcName:t.target,actionName:t?.name,actionID:e,doDeleteCaseSummary:!0,localActionType:s,runningMode:r,...t},o="OPEN_BULK_ACTION",i=bh.buildActionObject(a,this.c11nEnv),{promise:c}=this.actionsApiPromise(o,i);return ih({type:o,payload:{...i}}),c}cancelBulkAction(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const t=Se,n={containerItemID:e,context:e,skipReleaseLockRequest:!0,target:`${j.APP.APP}/${j.MODAL}`,caseViewMode:j.PERFORM_MODE,deleteContext:!0};ih({type:t,payload:n});const{promise:r}=this.actionsApiPromise(t,n);return r}approveCase(e){return e?"string"!=typeof e?Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING)):(ih({type:Q,payload:{reference:F.CASE_INFO.APPROVALFLAG,value:j.APPROVED,context:e}}),this.finishAssignment(e)):Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED))}rejectCase(e){return e?"string"!=typeof e?Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING)):(ih({type:Q,payload:{reference:F.CASE_INFO.APPROVALFLAG,value:j.REJECTED,context:e}}),this.finishAssignment(e)):Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED))}resolveDuplicateCase(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const[,t]=this.c11nEnv.getValue(F.CASE_INFO.DUPLICATECASEINSKEY).split(" "),n={type:Q,payload:{reference:F.CASE_INFO.DUPLICATECASEFLAG,value:j.DUPLICATE,context:e}},r={type:Q,payload:{reference:F.CASE_INFO.DUPLICATECASEID,value:t,context:e}};return ih([n,r]),this.finishAssignment(e)}ignoreDuplicateCase(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const t={type:Q,payload:{reference:F.CASE_INFO.DUPLICATECASEFLAG,value:j.IGNORE,context:e}},n={type:Q,payload:{reference:F.CASE_INFO.DUPLICATECASEID,value:"",context:e}},r={type:Q,payload:{reference:F.CASE_INFO.DUPLICATECASEINSKEY,value:"",context:e}};return ih([t,n,r]),this.finishAssignment(e)}openLocalAction(e,t){if(!e)return Promise.reject(new Error(this.MSG_ACTION_ID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_ACTION_ID_STRING));const n=t.caseID||this.c11nEnv.getValue(F.CASE_INFO.CASE_INFO_ID);if(window.pms?.plugins?.c11n?.openLocalAction)return t.caseID=n,wu(window.pms.plugins.c11n.openLocalAction,e,t);const r=t.assignKey||this.c11nEnv.getValue(F.CASE_INFO.ASSIGNMENT_ID),s=t.type,a={caseID:n,assignmentID:r,vcName:t.target,actionName:t?.name,assignKey:r,actionID:e,doDeleteCaseSummary:!0,localActionType:s,...t},o="OPEN_LOCAL_ACTION",i=bh.buildActionObject(a,this.c11nEnv),c=this.c11nEnv.getContextName(),{promise:l}=this.actionsApiPromise(o,i),u=Ad(c)[0];let d=!1;const p=$.getRemoteHeaderByContext(c);let h;if(p&&(i.headers={},i.headers.RemoteSystemID=p),!u)return h=c,ih({type:o,payload:{...i,contextName:c,continueExecution:d}}),l;h=gd(u);const g=rd(u);if(g?.accessedOrder.forEach((e=>{n===g.items[e].key&&(d=!0,h=g.items[e].context)})),!d||h&&"review"===oh()?.getState()?.data[h]?.context_data?.caseViewMode)return ih({type:o,payload:{...i,contextName:c,continueExecution:d}}),l;const f=h,m=f&&f.includes(j.MODAL),y=t.assignKey||this.c11nEnv.getValue(F.CASE_INFO.ASSIGNMENT_ID),I=ch(h),E=I?.caseInfo?.assignments?I.caseInfo.assignments[0]?.actions[0]?.ID:void 0,A=this.c11nEnv.getContainerName(),_=this.c11nEnv.getValue(F.CASE_INFO.CASE_TYPE_ID),C=this.c11nEnv.getValue("isProcessAction","isProcessAction"),S=bh.buildActionObject({context:f,containerItemID:h,assignmentID:y,actionID:E,caseID:n,containerName:A,caseType:_,isModalAction:m,isFormValid:!0,isProcessAction:C},this.c11nEnv);S.context=h;const T=yd(h),N=this.c11nEnv.getCaseSummary(),P=Zt(N),R=bh.buildActionObject({caseID:n,containerItemID:h,cancelContext:T},this.c11nEnv);let D={};return m?(R.acTargetName=j.MODAL,R.isInCreateStage=P,R.isModalAction=m,D={...R}):D={...R,acName:mt(this.c11nEnv.getContainerName(),R.context)},ih({type:o,payload:{...i,contextName:c,saveActionPayload:S,cancelActionPayload:D,continueExecution:d}}),l}openProcessAction(e,t){if(!e)return Promise.reject(new Error(this.MSG_ACTION_ID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_ACTION_ID_STRING));const n=this.c11nEnv.getValue(F.CASE_INFO.CASE_INFO_ID)||t.caseID;if(window.pms?.plugins?.c11n?.openProcessAction)return t.caseID=n,wu(window.pms.plugins.c11n.openProcessAction,e,t);const r=this.c11nEnv.getValue(F.CASE_INFO.ASSIGNMENT_ID)||t.assignKey,s=t.type,a={caseID:n,assignmentID:r,vcName:t.target,actionName:t?.name,assignKey:r,actionID:e,doDeleteCaseSummary:!0,processActionType:s,isProcessAction:!0,...t},o=vl,i=bh.buildActionObject(a,this.c11nEnv),{promise:c}=this.actionsApiPromise(o,i);return ih({type:o,payload:{...i}}),c}navigateToStep(e,t){if(!e)return Promise.reject(new Error("stepID is required parameter"));if("string"!=typeof e)return Promise.reject(new TypeError("stepID must be a string"));if(!t)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof t)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const n="NAVIGATE_TO_STEP",r=this.c11nEnv.getValue(F.NEXT_ASSIGNMENT_INFO_ID)?this.c11nEnv.getValue(F.NEXT_ASSIGNMENT_INFO_ID):this.c11nEnv.getValue(F.CASE_INFO.ASSIGNMENT_ID),s=Zt(this.c11nEnv.getCaseSummary()),a={ID:r,stepID:e,acTargetName:this.c11nEnv.getContainerName(),targetContainerName:this.c11nEnv.getContainerName(),containerItemID:t,doDeleteCaseSummary:!0,isInCreateStage:s};t&&t.includes(j.MODAL)&&(a.acTargetName=j.MODAL);const o=bh.buildActionObject(a,this.c11nEnv),{promise:i}=this.actionsApiPromise(n,o),c=yd(t);return ih({type:n,payload:{...o,containerItemID:t,context:c}}),i}cancelAssignment(e,t){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const{CASE_INFO:n}=F,r=he,s=yd(e),a=e&&e.includes(j.MODAL),o=this.c11nEnv.getCaseSummary(),i=Zt(o),c=this.c11nEnv.getValue(n.CASE_INFO_ID),l=this.c11nEnv.getValue(n.ASSIGNMENT_ID),u=bh.buildActionObject({caseID:c,containerItemID:e,context:s},this.c11nEnv);let d={};a?(u.acTargetName=j.MODAL,u.isInCreateStage=i,u.isModalAction=a,d={...u}):d={...u,acName:mt(this.c11nEnv.getContainerName(),u.context)};const{promise:p}=this.actionsApiPromise(r,u);return ih({type:r,payload:d}),p.then((()=>{t||xu({caseID:c,assignmentID:l,context:this.c11nEnv.getContextName()})}))}cancelLocalAction(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const{CASE_INFO:t}=F,n=e,r=He,s=e&&e.includes(j.MODAL),a=this.c11nEnv.getValue(t.CASE_INFO_ID),o=bh.buildActionObject({caseID:a,containerItemID:e,context:n},this.c11nEnv);if(!Nl(n)){return new Fl(this.c11nEnv).removeContainerItem({containerItemID:e}).then((()=>{xu({caseID:a,context:this.c11nEnv.getContextName()})}))}ih({type:r,payload:{...o,isModalAction:s}});const{promise:i}=this.actionsApiPromise(r,o);return i}cancelCreateStageAssignment(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const{CASE_INFO:t}=F,n=He,r=e,s=r&&r.includes(j.MODAL),a=this.c11nEnv.getCaseSummary(),o=Zt(a),i=this.c11nEnv.getValue(t.CASE_INFO_ID),c=bh.buildActionObject({caseID:i,containerItemID:e,context:r},this.c11nEnv),l=this.c11nEnv.getValue("isProcessAction","isProcessAction"),u=up.isCoexistenceAppOfType(j.APP_TYPE.UIKIT);if(c.isProcessAction=l,o&&(s||u)&&!tn(a)){const t=this.c11nEnv.getValue(j.CASE_INFO.IS_FIRST_ASSIGNMENT),i=Nl(r);if(this.shouldDeleteCaseInCreateStage(i,t,u))return this.deleteCaseInCreateStage(e);ih({type:n,payload:{...c,isModalAction:s,isChildCase:sn(a),isInCreateStage:o}})}const{promise:d}=this.actionsApiPromise(n,c);return d.then((()=>{}))}saveAssignment(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const t=Ml,n=this.getSaveActionPayload(e,!0),{promise:r}=this.actionsApiPromise(t,n);return ih(Ll(n)),r}saveAndClose(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const t=Ml,n=this.getSaveActionPayload(e),{promise:r}=this.actionsApiPromise(t,n);return ih(Ll(n)),r}deleteCaseInCreateStage(e,t=!1){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const n=wl,r=e,s=r&&r.includes(j.MODAL),a=this.c11nEnv.getValue(F.CASE_INFO.CASE_INFO_ID),o=this.c11nEnv.getValue(F.CASE_INFO.CASE_TYPE_ID),i=bh.buildActionObject({caseID:a,caseType:o,containerItemID:e,context:r,ignoreCaseDeletion:t},this.c11nEnv),c=this.c11nEnv.getValue("isProcessAction","isProcessAction"),l=this.c11nEnv.getValue(F.CASE_INFO.PARENTCASEINFO);i.isProcessAction=c,i.parentCaseInfo=l;const u=`${j.APP.APP}/${td.PRIMARY}`,d=Lc(u,td.PRIMARY);i.parentContext=d,s&&(i.targetName=j.MODAL,i.containerName=td.MODAL,i.isModalAction=s),ih((e=>({type:wl,payload:e}))(i));const{promise:p}=this.actionsApiPromise(n,i);return p.then((()=>{xu({caseID:a,context:this.c11nEnv.getContextName()})}))}getRecents(e){if(!e)return Promise.reject(new Error("maxResultsToFetch is required parameter"));if("number"!=typeof e)return Promise.reject(new TypeError("maxResultsToFetch must be number"));let{restApi:t}=lp.getRestEndPoint("getRecents")||{};t=`${t}?maxResultsToFetch=${e}`;const n=E()+t;return pc(n,{method:"GET",headers:{}})}updateRecents(e,t,n,r){const{restApi:s}=lp.getRestEndPoint("updateRecents")||{},a=`${E()}${s}`;return pc(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:{pyLabel:n,pyID:t,classID:e,ID:r}})}logout(){const{restApi:e}=lp.getRestEndPoint("Logout")||{},t=`${E()}${e}`;return pc(t,{method:"GET",headers:{}}).then((e=>(Object.keys(Pn.rootNodes).forEach((e=>{Ru.cleanCaches(e)})),Pn.rootNodes={},sessionStorage.clear(),Ah(),Promise.resolve(e))))}invoke(e,t={}){const n={method:t.method||"GET",body:t.body};return pc(e,n,this.c11nEnv.getContextName())}showCasePreview(e,t={}){this.loadView(e,"pyCasePreview",{container:td.PREVIEW,containerName:td.PREVIEW,context:F.APP.APP,...t})}showDataPreview(e,t,n){return e?"string"!=typeof e?Promise.reject(new TypeError("dataContext must be string")):t?"object"!=typeof t?Promise.reject(new TypeError("dataContextParameters must be an object")):this.showData("pyDataPreview",e,t,{container:td.PREVIEW,containerName:td.PREVIEW,context:F.APP.APP,...n||{},skipSemanticUrl:!0}):Promise.reject(new Error("dataContextParameters is required parameter")):Promise.reject(new Error("dataContext is required parameter"))}loadView(e,t,n){let r=bh.buildActionObject({caseId:e,viewName:t,caseClassName:this.c11nEnv.getValue(F.CASE_INFO.CASE_TYPE_ID),RemoteSystemID:$.getRemoteHeaderByContext(this.c11nEnv.getContextName())},this.c11nEnv);n||(n={containerName:this.c11nEnv.getContainerName(),updateData:!1}),n&&"object"==typeof n?(Object.hasOwn(n,"container")&&!Object.hasOwn(n,"containerName")&&(n.containerName=n.container),r={...r,...n}):r={...r,containerName:this.c11nEnv.getContainerName()};const s=te,{promise:a}=this.actionsApiPromise(s,r,!1);return ih({type:s,payload:{...r}}),a}showPage(e,t,n={containerName:"",skipSemanticUrl:""}){if(!e)return Promise.reject(new Error(this.MSG_PAGENAME_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_PAGENAME_STRING));if(!t)return Promise.reject(new Error(this.MSG_CLASSNAME_REQUIRED));if("string"!=typeof t)return Promise.reject(new TypeError(this.MSG_CLASSNAME_STRING));if(window.pms?.plugins?.c11n?.showPage)return window.pms.plugins.c11n.showPage(e,t,n);const r=bh.buildActionObject({viewName:e,className:t},this.c11nEnv),s=ne,{promise:a}=this.actionsApiPromise(s,r);return ec.getPreviewMode()&&(r.debugInfo={debugId:Sh.generateUniqueID()}),ih({type:s,payload:{...r,containerName:n.containerName||this.c11nEnv.getContainerName(),skipSemanticUrl:n.skipSemanticUrl}}),a}showInsight(e,t={}){if(!e)return Promise.reject(new Error(this.MSG_INSIGHTID_REQUIRED));const n=bh.buildActionObject({},this.c11nEnv),r=se,{promise:s}=this.actionsApiPromise(r,n);return ih({type:r,payload:{...n,containerName:this.c11nEnv.getContainerName(),skipSemanticUrl:t.skipSemanticUrl||!1,insightID:e}}),s}showDashboard(e,t={}){if(!e)return Promise.reject(new Error(this.MSG_DASHBOARDID_REQUIRED));const n=bh.buildActionObject({},this.c11nEnv),r=ae,{promise:s}=this.actionsApiPromise(r,n);return ih({type:r,payload:{...n,containerName:this.c11nEnv.getContainerName(),skipSemanticUrl:t.skipSemanticUrl||!1,dashboardID:e}}),s}showData(e,t,n,r={containerName:"",skipSemanticUrl:!1}){if(!e)return Promise.reject(new Error(this.MSG_PAGENAME_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_PAGENAME_STRING));if(!t)return Promise.reject(new Error("dataContext is required parameter"));if("string"!=typeof t)return Promise.reject(new TypeError("dataContext must be string"));const s=bh.buildActionObject({pageName:e,dataContext:t,dataContextParameters:n,RemoteSystemID:$.getRemoteHeaderByContext(this.c11nEnv.getContextName())},this.c11nEnv),a=re;r?.containerName||(r.containerName=kr.getTargetViewContainerName(a));const{promise:o}=this.actionsApiPromise(a,s);return ih({type:a,payload:{...s,...r,skipSemanticUrl:Boolean(r.skipSemanticUrl)}}),o}changeHandler(e,t){bh.changeHandler(e,t)}eventHandler(e,t){bh.eventHandler(e,t)}triggerFieldChange(e,t,n=!1){const r=this.c11nEnv.getContextName(),s=this.c11nEnv.getPageReference(),a=Rh.getContextPath(s,e);n||this.c11nEnv.getValidationApi().validate(t),this.c11nEnv.isInsideList()&&this.c11nEnv.getListActions().updateProperty(e,t);let o=this.c11nEnv.getValue(j.CLASS_ID);const i=e?e.split(".").filter((e=>!!e)):[];i.length>1&&(i.pop(),o=dh(`.${i.join(".")}.classID`,s,r)),e=Sh.trimDotForProperty(e),ih({type:ee,payload:{reference:a,value:t,context:r,pageReference:this.c11nEnv.getPageReference(),propertyName:e||this.c11nEnv.getComponentConfig().value,classID:o}})}updateFieldValue(e,t,n={}){const{removePropertyFromChangedList:r=!1,isArrayDeepMerge:s=!0,contextPageReference:a="",isListEntry:o=!1,skipDirtyValidation:i=!1}=n,c=this.c11nEnv.getContextName();let l=this.c11nEnv.getPageReference();const u=a?.startsWith(l)?a.replace(l,""):a;l=a||l;const d=Rh.getContextPath(l,e);let p=!1;this.c11nEnv.isInsideList()&&this.c11nEnv.getListActions().updateProperty(u?`${u}${e}`:e,t,{isArrayDeepMerge:s}),this.c11nEnv.isBulkAction()&&(p=!0),e||(e=this.c11nEnv.getStateProps().value),zn({type:F.MESSAGES.MESSAGES_TYPE_ERROR,property:e,pageReference:l,context:c,isListEntry:o}),ih({type:Q,payload:{reference:d,value:t,context:c,isArrayDeepMerge:s,skipDirtyValidation:i,...p&&{isStrictTracking:p},...r&&{removePropertyFromChangedList:r}}})}activateModalContainerItem(e){const t=Le,{context:n}=e,r=n&&n.includes(j.MODAL),s=bh.buildActionObject({...e,containerName:this.c11nEnv.getContainerName(),containerItemID:n},this.c11nEnv);r&&(s.containerName=j.MODAL,s.isModalAction=r),ih({type:t,payload:s});const{promise:a}=this.actionsApiPromise(t,s);return a}refreshCaseView(e,t,n,r={}){const{promise:s,actionMgrID:a}=this.actionsApiPromise("REFRESH_DATA"),{autoDetectRefresh:o,propertyName:i,preserveClientChanges:c,classID:l,context:u,optionalPayload:d}=r,p={actionMgrID:a,caseViewAction:!0,preserveClientChanges:c,propertyName:i,classID:l,optionalPayload:d};r.refreshFor&&(p.refreshFor=r?.refreshFor),r.skipDataMerge&&(p.skipDataMerge=r?.skipDataMerge);const h=u||this.c11nEnv.getContextName(),g=this.c11nEnv.getPageReference();return!this.c11nEnv.getValue(j.CONTEXT_DATA_MODAL_VIEW.IS_MULTI_RECORD_DATA)&&o&&(((e,t)=>rn(e)&&!nn(e,t))(h,g)||nn(h,g))?Ln(h,n,p):vn(e,t,h,n,p),s}openEmbeddedDataModal(e,t,n,r,s,a){const o=pt,i=t.getCaseInfo().getKey(),c=`${t.getPageReference().replace(F.CASE_INFO.CASE_INFO_CONTENT,"")}${n}[${r}]`,l={targetProperty:n,index:r,viewID:e,ID:i,actionType:s,interestPage:Sh.convertPageRefToClipboardPageNotation(c),heading:a},u=bh.buildActionObject(l,this.c11nEnv),{promise:d}=this.actionsApiPromise(o,u);if(up.getFeatureMap().granularUIRefresh){(t.getMetadata().config.children[0].children||[]).forEach((e=>{const n=Qt.trimAnnotation(e.config.value),r=Mp(n.startsWith(".")?n.replace(".",""):n,e.config.classID);if(r?.isDeclarativeTarget){const e=t.getPageReference();Pn.addFieldNode(t.getContextName(),e+c,t.viewName,n,"",{isDeclarativeTarget:!0,propertyName:n,pageReference:e+c})}}))}return ih({type:o,payload:{...u,containerName:F.MODAL,skipSemanticUrl:!0}}),d}submitEmbeddedDataModal(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const t=ht,n=this.c11nEnv.getPageReference().replace(F.CASE_INFO.CASE_INFO_CONTENT,""),r=yd(e),s={containerItemID:e,containerName:this.c11nEnv.getContainerName(),doDeleteCaseSummary:!0,isInCreateStage:!1,ID:this.c11nEnv.getValue(F.CASE_INFO.CASE_INFO_ID),viewID:this.c11nEnv.getValue(j.CONTEXT_DATA_MODAL_VIEW.VIEW_NAME),isFormValid:il(r),interestPage:Sh.convertPageRefToClipboardPageNotation(n),parentContext:this.c11nEnv.getValue(j.CONTEXT_DATA_MODAL_VIEW.PARENT_CONTEXT),isModalAction:!1,target:this.c11nEnv.getTarget()};e&&e.includes(j.MODAL)&&(s.containerName=j.MODAL,s.isModalAction=!0);const a=bh.buildActionObject(s,this.c11nEnv),{promise:o}=this.actionsApiPromise(t,a);if(Nl(r)){const[e,t,n]=gn(this.c11nEnv.getPageReference());Pn.mutatePageList(this.c11nEnv.getValue(j.CONTEXT_DATA_MODAL_VIEW.PARENT_CONTEXT),e,t,{type:Qe,rowIndex:n}),ih({type:Qe,payload:{pageReference:this.c11nEnv.getPageReference(),context:this.c11nEnv.getValue(j.CONTEXT_DATA_MODAL_VIEW.PARENT_CONTEXT),isListEntry:!0}})}return bu.executeOrQueueDeferredAction({type:t,payload:{...a,context:r}}),o}fillFormWithAI(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const t=yd(e),n=this.c11nEnv.getPageReference(),{promise:r,actionMgrID:s}=this.actionsApiPromise(gt);return Ln(t,n,{actionMgrID:s,isFillFormWithAI:!0,preserveClientChanges:!1}),r}};const Lu=class{constructor(e){this.c11nEnv=e}async getCaseStages(e,t){const n={caseID:e},{restApi:r,reqType:s}=Ng("getCaseStages",n);return(await pc(r,{method:s},t)).data.stages}getCaseTypeName(){return this.c11nEnv.getValue(j.CASE_INFO.CASE_TYPE_NAME)}getName(){return this.c11nEnv.getValue(j.CASE_INFO.CASE_INFO_NAME)}getClassName(){return this.c11nEnv.getValue(j.CASE_INFO.CASE_TYPE_ID)}getAvailableProcesses(){return this.c11nEnv.getValue(j.CASE_INFO.AVAILABLEPROCESSES)}getKey(){return this.c11nEnv.getValue(j.CASE_INFO.CASE_INFO_ID)}getID(){const e=this.getKey();if(e){const[,t]=e.split(" ");return t||e}}getAssignmentID(){return this.c11nEnv.getValue(j.CASE_INFO.ASSIGNMENT_ID)}getActions(){return this.c11nEnv.getValue(j.CASE_INFO.ACTION_BUTTONS)}getActiveFlowActionID(){return this.c11nEnv.getValue(j.CASE_INFO.ACTIVE_ACTION_ID)||this.c11nEnv.getValue(j.CASE_INFO.ASSIGNMENTACTION_ID)}getParentCaseInfo(){return this.c11nEnv.getValue(j.CASE_INFO.PARENTCASEINFO)}isPerform(){return this.c11nEnv.getValue(`${j.CONTEXT_DATA}${j.CASE_VIEW_MODE_PROP}`)===j.PERFORM_MODE}isReview(){return this.c11nEnv.getValue(`${j.CONTEXT_DATA}${j.CASE_VIEW_MODE_PROP}`)===j.REVIEW_MODE}isAssignmentInCreateStage(){const e=this.c11nEnv.getValue(j.CASE_INFO.CASE_INFO);return Zt(e)}isLocalAction(){const e=this.c11nEnv.getValue(j.CASE_INFO.CASE_INFO);return tn(e)}getCurrentAssignmentViewName(){let e=null,t=!1;if(this.c11nEnv.getValue("context_data.caseViewMode")===j.PERFORM_MODE){if(this.isLocalAction())return e;if(this.isAssignmentInCreateStage())t=!0;else{const t=this.c11nEnv.getTarget(),n=this.c11nEnv.getContextName(),r=sd(t,n),{config:s}=t&&n?r&&r.view:this.c11nEnv.getMetadata();e=s?.type===j.VIEW?s?.name:null}(e&&e.startsWith(j.PROPERTY_ANNOTATION)||t)&&(e=this.c11nEnv.getValue(j.CASE_INFO.VIEW_NAME))}return e}getActionRefreshConditions(){const e=this.c11nEnv.getValue(j.CASE_INFO.ACTIVE_ACTION_ID),t=W(this.c11nEnv.getContextName());let n;t&&(n=ch(t));const r=n?.caseInfo?.availableActions,s=ch(this.c11nEnv.getContextName()),a=s?.caseInfo?.refreshConditions;if(e){if(r){const t=r.find((t=>t.ID===e));return t?t.refreshConditions:a}return a}return this.c11nEnv.getValue(j.CASE_INFO.ACTION_REFRESH_CONDITIONS)}getBusinessID(){return this.c11nEnv.getValue(j.CASE_INFO.BUSINESS_ID)}getAssignments(){return this.c11nEnv.getValue(j.CASE_INFO.CASE_INFO)?.assignments}getChildAssignments(){return this.c11nEnv.getValue(j.CASE_INFO.CASE_INFO)?.childCases?.[0]?.assignments}isCaseWideLocalAction=()=>{const e=this.c11nEnv.getValue(j.CASE_INFO.ACTIVE_ACTION_ID),t=this.c11nEnv.getValue(j.CASE_INFO.CASE_INFO_ACTIONS);if(t&&e){const n=t.find((t=>t.ID===e));return"Case"===n?.type}return!1};getAllAssignments(){const e=this.c11nEnv.getValue(j.CASE_INFO.CASE_INFO_ACTIONS),t=this.c11nEnv.getValue(j.CASE_INFO.ASSIGNMENT_LABEL),n=this.c11nEnv.getValue(j.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS)||[],r=this.getChildAssignments()||[];let s=JSON.parse(JSON.stringify(r));s=s.map((e=>(e.isChild=!0,e)));const a=[...n,...s];let o=JSON.parse(JSON.stringify(a));return e&&!this.isPerform()&&(o=o.map((e=>(e.name=this.getActiveCaseActionName()||e?.name||t,e)))),o}getActiveCaseActionName(){const e=this.c11nEnv.getValue(j.CASE_INFO.CASE_INFO_ACTIONS),t=this.c11nEnv.getValue(j.CASE_INFO.ACTIVE_ACTION_ID),n=e.find((e=>e.ID===t));return n?.name||""}getFirstCaseActionName(){const e=this.c11nEnv.getValue(j.CASE_INFO.CASE_INFO_ACTIONS);return e[0]?.name||""}hasAssignments(){const e=this.c11nEnv.getValue(j.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS),t=this.getChildAssignments();return!!(e||t||this.isCaseWideLocalAction())}hasMessages=()=>!!this.c11nEnv.getValue("caseMessages");hasGetNextWorkLinks(){return!!this.c11nEnv.getValue(j.CASE_INFO.GETNEXTWORK)}},{RESOURCE_TYPES:Uu}=F;const Fu=class{static openCase(e,t,n,r={}){const s={insKey:e,acTargetName:n,actionMgrID:ln.getNextActionMgrId(),context:t,...r},a=ue;r&&r.channelName&&(s.headers={},s.headers[j.X_ORIGIN_CHANNEL]=r.channelName);const{promise:o}=ln.actionManagerPromise(a,s.actionMgrID);return ih({type:a,payload:s}),o}static openAssignment(e,t,n,r={}){const s={assignmentID:e,vcName:n,doDeleteCaseSummary:!0,actionMgrID:ln.getNextActionMgrId(),context:t,...r},a=ge;r&&r.channelName&&(s.headers={},s.headers[j.X_ORIGIN_CHANNEL]=r.channelName);const{promise:o}=ln.actionManagerPromise(a,s.actionMgrID);return ih({type:a,payload:{...s}}),o}static createCase(e,t,n,r={}){const s=le,a={class:e,acTargetName:n,actionMgrID:ln.getNextActionMgrId(),context:t,...r};r&&r.channelName&&(a.headers={},a.headers[j.X_ORIGIN_CHANNEL]=r.channelName);const{promise:o}=ln.actionManagerPromise(s,a.actionMgrID);return ih({type:s,payload:{...a}}),o}static getNextWork(e,t,n={}){const r=ge,s={isGetNextWork:!0,vcName:t,doDeleteCaseSummary:!0,actionMgrID:ln.getNextActionMgrId(),context:e,...n},{promise:a}=ln.actionManagerPromise(r,s.actionMgrID);return ih({type:r,payload:{...s}}),a}static getOpenedCaseItems(e){const t=[],n=rd(e);if(n){const{items:r={}}=n,s=Object.keys(r),a=gd(e);s.forEach((n=>{if(r[n]&&(r[n].resourceType===Uu.CASE||r[n].resourceType===Uu.ASSIGNMENT)){const{key:s="",context:o}=r[n],i=r[n],c=s.substring(s.indexOf(" ")+1),l=dh(".caseTypeID",j.CASE_INFO.CASE_INFO,o),u=a===n;t.push({...i,key:s,workID:s,caseID:c,className:l,context:o,containerItemID:n,target:e,active:u})}}))}return t}static getCaseDetails=(e,t)=>{if(!e)return Promise.reject(new Error("Case ID is required"));const n={caseID:e},{restApi:r,reqType:s}=Ng(Be,n),a={},o=$.getRemoteHeaderFromSourceClass(t??"");return o&&(a.RemoteSystemID=o),pc(r,{method:s,headers:a})};static getCaseBulkActions=async e=>{const{restApi:t,reqType:n}=Ng("getBulkActions"),r=e.map((e=>({ID:e}))),s=r.length,a=s/5,o={},i=[];for(let e=0;e<s;e+=a)o.cases=r.slice(e,e+a),o.cases.length&&i.push(pc(t,{method:n,body:o}));const c=await Promise.all(i);let l=[];for(let e=0;e<c.length;e+=1)0!==e?l.length&&(l=l.filter((t=>c[e].data.availableActions.some((e=>t.ID===e.ID))))):l=c[e].data.availableActions;return l};static getCaseBulkActionsByCaseTypeID=async e=>{const t={casetypeID:e},{restApi:n,reqType:r}=Ng("getCaseBulkActions",t),s=await pc(n,{method:r});let a=[];return s.data?.availableActions?.length&&(a=s.data.availableActions),a}};class ju{constructor(e){ju._instance=this,this.context=`${e}/${j.SUGGESTION}`,oh()?.getState().data?.[this.context]||ih({type:Fe,payload:{context:this.context,data:{}}})}getField(e){return dh(e,"",this.context)}setField(e,t){ih({type:Q,payload:{reference:e,value:t,context:this.context}})}removeField(e){ih({type:me,payload:{reference:e,context:this.context}})}setState(e){ih(wh({context:this.context,data:e,isArrayDeepMerge:!0}))}}const Vu=ju;const ku=class{static getSharedState(e){const t=e.startsWith(".")?e.substring(1):e,n=lh();return n?Sh.getIn(n,t):null}static setSharedState(e,t){e&&ih(pg({key:e,value:t}))}static updateState(e,t,n,r={}){const{isArrayDeepMerge:s=!0,pageReference:a}=r;if(!e||!t)return;ih(hg({context:e,reference:a?`${a}.${t}`:t,value:n,isArrayDeepMerge:s}))}static getSuggestionsContext(e){return new Vu(e)}};const $u=class{constructor(e,t,n){this.meta=e,this.datasource=t,this.index=0,this.options=n,this.datasourceObj=Rh.getPropertyValue(t,n.pageReference,n.context)}hasNext(){return this.index<this.datasourceObj.length}next(){if(!this.hasNext())throw new Error("No Children");const e=Rh.getContextPath(this.datasource,this.index);return this.index+=1,Xu({meta:this.meta,options:{...this.options,pageReference:e}})}resetIndex(){this.index=0}};class Bu{constructor(e,t){this.children=e,this.index=0,this.options=t}hasNext(){return this.index<this.children.length}next(){if(!this.hasNext())throw new Error("No Children");const e=this.children[this.index];return this.index+=1,Xu({meta:e,index:this.index,options:this.options})}resetIndex(){this.index=0}}const Gu=(e,t)=>{const n=!!e?.repeat;if(!!e?.["repeat-self"])return new $u(e,e.context||"",t);if(n){const n=hh(`${t.context}.${j.SUMMARY_OF_LISTS}`,e.pageReference,t.context);return new $u(e.children[0],n||e.context,t)}return e?.children?new Bu(e.children,t):void 0};class Wu{static allowedComponetsForBulkProcessing={Currency:!0,TextInput:!0,Phone:!0,Percentage:!0,Email:!0,Integer:!0,Decimal:!0,URL:!0,SemanticLink:!0,Checkbox:!0,RadioButtons:!0,DateTime:!0,Date:!0,Time:!0,Text:!0,TextArea:!0,RichText:!0,Dropdown:!0,Search:!0,Location:!0,Attachment:!0,AutoComplete:!0,MultiSelect:!0,UserReference:!0,Region:!0,TextContent:!0,View:{Forms:!0,DefaultForm:!0,OneColumn:!0,TwoColumn:!0,ThreeColumn:!0}};static getItemView(e,t){const n=[];if(e&&["portal","view"].includes(t)){const{accessedOrder:t,items:r}=e;if(t&&r){const e=t[t.length-1];r[e]&&r[e].view&&Object.keys(r[e].view).length>0&&n.push(r[e])}}return n}static getDependentProperties=e=>{let t=[];return e._rawConfig?.config?.parameters?t=Object.values(e._rawConfig?.config?.parameters||{}):e.getFieldMetadata(e.getStateProps()?.value)?.datasource?.parameters&&(t=(e.getFieldMetadata(e.getStateProps()?.value)?.datasource?.parameters||[]).map((e=>e?.value))),t.filter((e=>ul.isProperty(e))).map((e=>ul.getPropertyName(e)))}}const Hu=new Wu;let qu;Object.freeze(Hu);const zu=(e,t,n)=>{e&&(Object.keys(e).forEach((r=>{if("children"!==r){const s=e[r],a=Qt.trimAnnotation(s);if("string"!=typeof a&&"string"!=typeof s||!(Sh.isValidAnnotation(s)&&Sh.isPropertyRef(a)||s.startsWith("@W ")||s.startsWith("@E ")||s.startsWith("@ATTACHMENT "))){if(Array.isArray(a))a.forEach(((e,n)=>{const s={parentStateObj:t,parentKey:r,isObjHasValue:!!t[r]};t[r]=t[r]||[],t[r][n]=Object.create({}),zu(e,t[r][n],s)}));else if(a&&"object"==typeof a&&"exp"!==a.type){const e={parentStateObj:t,parentKey:r,isObjHasValue:!!t[r]};t[r]=t[r]||{},zu(a,t[r],e)}}else n&&n.parentKey&&(n.isObjHasValue=!0),t[r]=a}})),n&&!n.isObjHasValue&&delete n.parentStateObj[n.parentKey])},Yu=(e,t)=>{e._inheritedProps=e._inheritedProps||[],e.inheritedProps=[...e._inheritedProps,...Sh.deepClone(t.inheritedProps)]};class Ku{constructor(e){const{meta:t,isRoot:n,options:r={},useCustomContext:s}=e;this.meta=t,this._isRoot=n,this.options=r,this.useCustomContext=s,this._rawConfig=t?.config,this._isExpressionExist=!1,this._isWhenExist=!1,this._isValidatorExist=!1,this._pageReference="",this._referenceContext="",this._contextName="",this._stateProps={},this._actions={},this._children="",this._additionalRegisteredProps={},this._caseInfo=null,this.viewName=r.viewName,this.parentViewName=r.viewName??"",this._referenceList=r.referenceList||"",this._isInsideList=r.isInsideList||!1,this._inheritedConfig={},this._localeRuleName=r.localeReference,this._containerTarget=r.target,this.xrayInfo={},this._readOnly=t?.config?.readOnly||r.readOnly,this._hasSuggestions=!1,this._actionsApi=null,this._classID=null,this.index=e.index,this.categoryName=r.categoryName||"",r.inheritedConfig&&(this._inheritedConfig=Sh.deepClone(r.inheritedConfig)),t?.config?.inheritedProps&&Yu(this._inheritedConfig,t?.config),zu(this._rawConfig,this._stateProps),this._isState=!Sh.isObjectEmpty(this._stateProps),this._rawConfig&&this._rawConfig.config&&(this._isExpressionExist=Sh.isExpressionExist(this._rawConfig.config),this._isWhenExist=Sh.isWhenExist(this._rawConfig.config),this._isValidatorExist=vr.isValidatorExist(this._rawConfig.config)),this._isRoot?this._contextName=F.APP.APP:this._contextName=this.meta?.config?.contextName||this.options.context,this._type=this.meta?.type;let a=this.options.pageReference;if(this.options.pageReference&&(a=Qt.handleAnnotation(this.options.pageReference,this)),this._pageReference=Rh.getContextPath(a||this.options.parentPageReference,this._pageReference),this._pageReference||(this._pageReference=""),"reference"===this._type&&(this._rawConfig=t),"reference"===this._type&&Sh.isWhenExist({visibility:this.meta?.config?.visibility})&&xn(this.viewName,this._contextName,this._pageReference),"reference"!==this._type&&t&&(this._rawConfig=Rh.resolveReference(t,this)),this._rawConfig){const e=this.getRawConfigProps();e&&(this._localeRuleName=Qt.trimAnnotation(e.localeReference)||r.localeReference,this._isExpressionExist=Sh.isExpressionExist(e),this._isWhenExist=Sh.isWhenExist(e),this._isValidatorExist=vr.isValidatorExist(e)),this._children=this._rawConfig.children,this._rawConfig?.type?.toLowerCase()===j.VIEW&&this._rawConfig.name&&(this.viewName=Qt.handleAnnotation(this._rawConfig.name,this)),this.options.hasForm&&Mn(this)}}isDeclarativeTarget(){let e=!1;if(this.getValue(this._pageReference)||""===this._pageReference){const t=Qt.trimAnnotation(this.getPropertyName()),n=this.getFieldMetadata(t);e=n?.isDeclarativeTarget||!1}return e}_getPropertyName(){const e=Qt.trimAnnotation(this.getPropertyName());return""===this._pageReference&&e.startsWith(".")?e.substring(1,e.length):e}addFieldNode(){const e=this._getPropertyName(),{value:t,label:n,required:r,readOnly:s,disabled:a,visibility:o,validationType:i,caption:c,allowMultiple:l}=this.getRawConfigProps();if(this.getValue(this._pageReference)||""===this._pageReference){const u="Address"===this._type&&this._rawConfig?.config?.associatedView?Qt.trimAnnotation(this._rawConfig.config.associatedView):"",d=n||c,p={target:this._containerTarget,context:this._contextName,pageReference:this._pageReference,propertyName:Qt.trimAnnotation(t),label:d?.startsWith("@")?Qt.handleAnnotation(d,this,void 0):d,required:r,readOnly:s,disabled:a,visibility:o||this.options?.visibility,skipRequiredValidation:this.options?.isBulkAction,inheritedProps:this.getInheritedProps(),useCustomContext:this.useCustomContext,value:t,validationType:i,componentName:this._rawConfig?.type,hasSuggestions:this._hasSuggestions,isInsideList:this.isInsideList(),index:this.index,allowMultiple:l,isDeclarativeTarget:this.isDeclarativeTarget()};Pn.addFieldNode(this._contextName,this._pageReference,(u||this.categoryName||this.viewName)??"",e,this.getValue(e),p)}}removeNode(){if(!this.isVisible())if(Object.hasOwn(this._rawConfig?.config??{},"value"))Pn.removeFieldNode(this._contextName,this._pageReference,this.viewName||"",Qt.trimAnnotation(this.getPropertyName()),this.index);else{const e=this._rawConfig?.config?.context?`${this._pageReference}${this._rawConfig?.config.context}`:this._pageReference;Pn.removeViewNode(this._contextName,e,this._rawConfig?.config?.name||this._rawConfig?.config?.id||"",this.index)}}addViewNode(){this._rawConfig?.type?.toLowerCase()===j.VIEW&&this._rawConfig.name&&this.viewName&&Pn.addViewNode(this._contextName,this._pageReference,this.viewName,this.parentViewName),"Group"===this._rawConfig?.type&&this._rawConfig?.config?.id&&Pn.addViewNode(this._contextName,this._pageReference,this._rawConfig.config.id,this.parentViewName),"Address"===this._rawConfig?.type&&this._rawConfig?.config?.associatedView&&Pn.addViewNode(this._contextName,this._pageReference,Qt.trimAnnotation(this._rawConfig.config.associatedView),this.parentViewName),"deferload"===this._rawConfig?.type?.toLowerCase()&&this._rawConfig.config?.name&&Pn.addViewNode(this._contextName,this._pageReference,this._rawConfig.config.name,this.parentViewName)}addWhenNode(){let e="",t="";const n=Sh.getWhenNames(this._rawConfig?.config),r=this.getRawConfigProps();if(r?.type&&r?.type?.toLowerCase()===j.VIEW)t=j.CONTEXT_TREE_NODE_TYPES.VIEW,e=this.getCurrentView();else{t=j.CONTEXT_TREE_NODE_TYPES.FIELD;const n=this.getPropertyName();e=Qt.isProperty(n)?Qt.trimAnnotation(n):""}e&&n.forEach((n=>{Pn.addWhenNode(this.getContextName(),this.getPageReference(),t,e,n,{pageReference:this.getPageReference(),context:this.getContextName()})}))}updateContextTree(){if(this.isVisible()&&(this.addViewNode(),this._rawConfig?.config&&Object.hasOwn(this._rawConfig.config,"value")&&"DISPLAY_ONLY"!==this._inheritedConfig.displayMode&&"DISPLAY_ONLY"!==this._rawConfig.config?.displayMode&&this.addFieldNode(),(this._rawConfig?.type?.toLowerCase()!==j.VIEW||"Editable"===this._rawConfig.config?.renderMode)&&this._rawConfig?.config?.referenceList&&"DISPLAY_ONLY"!==this._rawConfig.config?.displayMode)){const{value:e,label:t,required:n,readOnly:r,disabled:s,visibility:a,validationType:o,selectionMode:i,selectionList:c,selectionKey:l,referenceList:u,renderMode:d,caption:p}=this.getRawConfigProps(),h=t||p;let g=[];["Multiselect","Checkbox"].includes(this._rawConfig.type)&&(g=this.getSelfReferencingDatapageKeys()),Pn.addPageListNode(this._contextName,this._pageReference,this.viewName??"",Qt.trimAnnotation(this.getPropertyName()),{target:this._containerTarget,context:this._contextName,pageReference:this._pageReference,propertyName:Qt.trimAnnotation(this.getPropertyName()),label:h?.startsWith("@")?Qt.handleAnnotation(h,this,void 0):h,required:n,readOnly:r,disabled:s,visibility:a||this.options.visibility,skipRequiredValidation:this.options.isBulkAction,inheritedProps:this.getInheritedProps(),useCustomContext:this.useCustomContext,value:e,validationType:o,componentName:this._rawConfig.type,type:this._rawConfig.config?.type,hasSuggestions:this._hasSuggestions,isInsideList:this.isInsideList(),selectionMode:i,selectionList:c,renderMode:d,referenceList:u,selectionKey:l,index:this.index,selfReferencingDatapageKeys:["Multiselect","Checkbox"].includes(this._rawConfig.type)?g:void 0});const f=this.getValue(Qt.trimAnnotation(this.getPropertyName()),this._pageReference)||[];Pn.updatePageListNode(this._contextName,this._pageReference,Qt.trimAnnotation(this.getPropertyName()),f.length)}this.isWhenExist()&&this.addWhenNode(),this.removeNode()}setXRayInfo(e){Sh.mergeDeep(e,this.xrayInfo)}getXRayInfo(){return this.xrayInfo}getStateProps(){return this._stateProps}setStateProps(e){Sh.mergeDeep(e,this._stateProps)}getMetadata(){return this._rawConfig}getCaseInfo(){return this._caseInfo||(this._caseInfo=new Lu(this)),this._caseInfo}getCaseLocaleReference(){const e=this.getCaseInfo().getClassName();return e?`CASE!${e}`.toUpperCase():null}getListActions(){return Dr(this)}getReferenceList(){return this._referenceList}isInsideList(){return this._isInsideList||/\[\d+\]/g.test(this.getPageReference())}getRawMetadata(){return this.getMetadata()}setReferenceList(e){this._referenceList=e}getComponentConfig(){return this.getMetadata()?.config||{}}isExpressionExist(){return this._isExpressionExist}isWhenExist(){return this._isWhenExist}isConditionExist(){return this.isExpressionExist()||this.isWhenExist()}isBoundToState(){return this._isState}getPageReference(){return this._pageReference}getPropertyName(){const e=this.getComponentConfig();let t;return t="multi"===e.selectionMode?"selectionList":"single"===e.selectionMode&&e.selectionKey?"selectionKey":"Editable"===e.renderMode?"referenceList":"Address"===this._type?"addressProp":"value",this.getComponentConfig()[t]}getFullReference(){const e=this.getPageReference(),t=this.getPropertyName();return Rh.getContextPath(e,t)}getContextName(){return this._contextName}getContainerName(){const{type:e}=this.getMetadata()||{},t=[j.CONTAINERS.ROOT_CONTAINER,j.CONTAINERS.VIEW_CONTAINER,j.CONTAINERS.FLOW_CONTAINER,j.CONTAINERS.MODAL_VIEW_CONTAINER,j.CONTAINERS.PREVIEW_VIEW_CONTAINER,j.CONTAINERS.HYBRID_VIEW_CONTAINER],{acTargetName:n=td.PRIMARY,name:r,routingInfo:s}=this.getComponentConfig();return(e&&t.includes(e)||"@ROUTING_INFO"===s)&&r?r:this.options.containerName||n}getTarget(){return this._containerTarget}getCurrentView(){return this.viewName}populateSuggestionProps(e){if(this._rawConfig?.config&&Object.hasOwn(this._rawConfig.config,"value")&&this.getStateProps()?.value&&this.options.hasForm){const t=c?.getStore()?.getState()?.data[`${this.getContextName()}/${j.SUGGESTION}`],n=this.getStateProps()?.value,r=Rh.getContextPath(this.getPageReference(),n),s=t?ku.getSuggestionsContext(this.getContextName()).getField(r):void 0;this._hasSuggestions=!!s,e.hasSuggestions=this._hasSuggestions,this._stateProps.hasSuggestions=this._hasSuggestions}}getConfigProps(e={}){const t={...br.getDefaultsforType(this._type),readOnly:this._readOnly,...this._rawConfig&&this._rawConfig.config,...this._additionalRegisteredProps,...this._inheritedConfig};return this.populateSuggestionProps(t),this.resolveConfigProps(t,e),Sh.resolveStringBooleans(e)}getRawConfigProps(){const e={...br.getDefaultsforType(this._type),...this._rawConfig?.config,...this._additionalRegisteredProps,...this._inheritedConfig};return this.populateSuggestionProps(e),e}resolveConfigProps(e,t={}){return e&&(Rh.resolveProps(e,t,this),Qt.handleComponentMapping(t,{type:this.getComponentName(),config:e},this)),t}registerAdditionalProps(e={}){return Object.assign(this._additionalRegisteredProps,e),zu(e,this._stateProps),this.resolveConfigProps(this._additionalRegisteredProps)}deRegisterAdditionalProps(e=[]){return e.forEach((e=>{delete this._additionalRegisteredProps[e]})),!0}populateAdditionalProps(e){const t=this.getComponentName(),n=this.getComponentConfig(),r=t===j.ROOT_CONTAINER&&"portal"!==e.renderingMode;if(t===j.MODAL_VIEW_CONTAINER||t===j.CASE_CREATE_STAGE){const t=gd(`${j.APP.APP}/${this.getContainerName()}`),n=qn({context:t,category:F.PAGE});e.pageMessages=n,this._stateProps.pageMessages=e.pageMessages}if(this.isEditable()){let{value:t}=this.getStateProps();void 0===t&&"multi"===this.getComponentConfig()?.selectionMode?t=this.getStateProps().selectionList||Qt.trimAnnotation(this.getRawConfigProps().selectionList):!t&&"Editable"===this.getComponentConfig()?.renderMode&&this.getStateProps().referenceList&&(t=this.getStateProps().referenceList);const n=qn({property:t,pageReference:this.getPageReference(),context:this.getContextName(),type:F.MESSAGES.MESSAGES_TYPE_ERROR}),r=qn({property:t,pageReference:this.getPageReference(),context:this.getContextName(),type:F.MESSAGES.MESSAGES_TYPE_INFO});n&&n[0]&&(e.validatemessage=n.map((e=>hp.getLocaleValue(e.message.replace(/\.$/,""),"Messages"))).join(". ")+(n[n.length-1].message.endsWith(".")?".":""),e.status=j.FIELD_LEVEL_ERROR,this._stateProps.validatemessage=e.validatemessage,this._stateProps.status=e.status),r&&r[0]&&(e.infoMessage=r[0].message,e.status=j.FIELD_LEVEL_WARNING,this._stateProps.infoMessage=e.infoMessage,this._stateProps.status=e.status)}if(t===j.ROOT_CONTAINER){const t=Xn(r,gd(`${j.APP.APP}/${this.getContainerName()}`));e.httpMessages=t,this._stateProps.httpMessages=e.httpMessages;const n=ku.getSharedState("isLoggedOut");e.isLoggedOut=n,this._stateProps.isLoggedOut=n;const s=qn({context:j.APP.ROOT,category:"PAGE"});e.pageMessages=s,this._stateProps.pageMessages=e.pageMessages}if(t===j.HYBRID_VIEW_CONTAINER){const t=qn({context:j.APP.APP,category:j.HTTP});e.httpMessages=t,this._stateProps.httpMessages=t}if(t===j.APP_SHELL&&e.portalDocMode===j.CONTAINER_TYPE.MULTIPLE&&(e.activeCases=Fu.getOpenedCaseItems(`${F.APP.APP}/${j.PRIMARY}`),this._stateProps.activeCases=e.activeCases),t===j.APP_SHELL){const t=j.APP.APP,n=gd(`${t}/${this.getContainerName()}`),r=[...qn({context:t,category:"PAGE"})||[],...qn({context:n,category:"PAGE"})||[]],s=r.length>0?r:void 0;e.pageMessages=s,this._stateProps.pageMessages=e.pageMessages}if(e.value&&t===j.SCALARLIST&&(this._stateProps.value=e.value),t===j.APP_SHELL||t===j.MODAL_VIEW_CONTAINER||t===j.CASE_CREATE_STAGE||n.template===j.CASE_PREVIEW){let t=qn({context:j.APP.APP,category:"HTTP"});const n=qn({context:gd(`${j.APP.APP}/${this.getContainerName()}`),category:"HTTP"});t?n&&(t=t.concat(qn({context:gd(`${j.APP.APP}/${this.getContainerName()}`),category:"HTTP"}))):t=qn({context:gd(`${j.APP.APP}/${this.getContainerName()}`),category:"HTTP"}),e.httpMessages=t?t.map((e=>e.message)):t,this._stateProps.httpMessages=e.httpMessages,t?.forEach((t=>{t.errorDetails&&(e.errorDetails=e.errorDetails?e.errorDetails.push(...t.errorDetails):t.errorDetails,this._stateProps.errorDetails=e.errorDetails),t.correlationID&&(e.correlationID=t.correlationID)}))}if(t===j.VIEW_CONTAINER||t===j.FLOW_CONTAINER||t===j.MODAL_VIEW_CONTAINER||t===j.PREVIEW_VIEW_CONTAINER||t===j.ROOT_CONTAINER){if(e.routingInfo=yt(this.getContainerName(),this._contextName),t===j.ROOT_CONTAINER&&(e.rootConfig=Wu.getItemView(e.routingInfo,e.renderingMode),this._stateProps.rootConfig=e.rootConfig),this._stateProps.routingInfo=e.routingInfo,t===j.FLOW_CONTAINER){const t=qn({context:this.getContextName(),category:j.CASEMESSAGES}),n=this.getContextName();e.caseMessages=t,this._stateProps.caseMessages=e.caseMessages,e.caseViewMode=this.getValue("context_data.caseViewMode"),this._stateProps.caseViewMode=e.caseViewMode;const r=Ad(n)[0];if(r){const t=gd(r),n=c?.getStore()?.getState()?.data;n&&t&&(e.lastUpdateTime=n[t]?.caseInfo?.lastUpdateTime,this._stateProps.lastUpdateTime=n[t]?.caseInfo?.lastUpdateTime);const s=qn({context:t,category:F.PAGE}),a=qn({context:t,category:"HTTP"});e.httpMessages=a,e.pageMessages=s,this._stateProps.pageMessages=e.pageMessages,this._stateProps.httpMessages=e.httpMessages,a?.forEach((t=>{t.errorDetails&&(e.errorDetails=e.errorDetails?e.errorDetails.push(...t.errorDetails):t.errorDetails,this._stateProps.errorDetails=e.errorDetails),t.correlationID&&(e.correlationID=t.correlationID)}))}}if(e.loadingInfo=this.getLoadingStatus(this.getContextName()),e.assignmentNames=this.getCaseInfo().getAssignments()?.map((e=>e.name)),e.childAssignmentNames=this.getCaseInfo().getChildAssignments()?.map((e=>e.name)),t===j.MODAL_VIEW_CONTAINER){const t=e.routingInfo?.accessedOrder||[],n=t[t.length-1];n&&(e.loadingInfo=this.getLoadingStatus(n))}this._stateProps.loadingInfo=e.loadingInfo,this._stateProps.assignmentNames=e.assignmentNames,this._stateProps.childAssignmentNames=e.childAssignmentNames}else n.template===j.CASE_VIEW||n.template===j.CASE_PREVIEW||n.template===j.OBJECT_PAGE?(e.caseInfo=this.getCaseSummary(),this._stateProps.caseInfo=e.caseInfo):t===j.CASE_STAGES&&(e.stages=this.getCaseStages(),e.stageID=this.getStageID(),this._stateProps.stages=e.stages,this._stateProps.stageID=e.stageID);this.populateFieldMetadata(e),this.updateContextTree()}isReadOnlyField(e,t){const n=ul.isPropertyInternal(t),r=e.datasource,s=this.getComponentConfig().isSearchField,{isClassKey:a,isSpecial:o,isDeclarativeTarget:i}=e.fieldMetadata,c=e.listType!==j.ASSOCIATED;return!s&&(i||n||!r&&(a||o)&&c)}getPropertyDetails(e,t,n){return e===j.ASSOCIATED?{propertyValue:t,propertyAnnotation:j.ASSOCIATED_PROPERTY_ANNOTATION}:{propertyValue:n,propertyAnnotation:j.PROPERTY_ANNOTATION}}updateConfigData(e,t,n){e.fieldMetadata=t,this.isReadOnlyField(e,n)&&(e.readOnly=!0,this._stateProps.readOnly=e.readOnly,e.fieldMetadata.isDeclarativeTarget&&this.registerAdditionalProps({readOnly:!0})),e.fieldMetadata?.isReadOnly&&(e.readOnly=!0,this.registerAdditionalProps({readOnly:!0}))}populateFieldMetadata(e){const{value:t,datasource:n,listType:r}=this.getComponentConfig(),{propertyValue:s,propertyAnnotation:a}=this.getPropertyDetails(r,n,t);if(s&&"string"==typeof s&&(s.includes(a)||s.includes(j.ATTACHMENT_ANNOTATION))){const t=Qt.getPropertyName(s),n=this.getFieldMetadata(t);n&&this.updateConfigData(e,n,t)}}resolvePropertyMetadata(e,t){if(!e)return e;const n=Zp(`${this._pageReference}.${t}`,this._contextName);return(n||null===n)&&(e.additionalInformation=n),e}getFieldMetadata(e){if(!e)return null;const t=e.split(".");if(t.length<2){let t=this.getValue(j.CLASS_ID);return!t&&this._rawConfig&&this._rawConfig.config&&this._rawConfig.config.ruleClass&&(t=this._rawConfig.config.ruleClass),this.resolvePropertyMetadata(Mp(e,t),e)}return this.resolvePropertyMetadata(Mp(t.pop(),this.getValue(`.${t.join(".")}${j.CLASS_ID}`)),e)}getCurrentPageFieldMetadata(e=null){let t=this.getPageReference().split(".");null!==e&&(t=e.split("."));const n=t.pop();return this.resolvePropertyMetadata(Mp(n,this.getValue(`${t.join(".")}${j.CLASS_ID}`)))}getCurrentClassID(){return this._classID??this.getValue(j.CLASS_ID)}getCaseSummary(){const e={...this.getDataObject()[F.CASE_INFO.CASE_INFO]};return e.CaseID=e.CaseID||this.getValue(F.CASE_INFO.CASE_INFO_PZINSKEY),{...e,isCaseWideAction:()=>nn(this.getContextName(),this.getPageReference())}}getReferencedUser(e){const t=this.getValue("referencedUsers");if(Array.isArray(t)){const n=t.find((t=>t.UserID===e));if(n)return{userId:n.UserID,UserName:n.UserName}}return t&&t[e]?t[e]:null}getCaseStages(){return this.getDataObject()[F.CASE_INFO.CASE_INFO].stages}getStageID(){return this.getDataObject()[F.CASE_INFO.CASE_INFO].stageID}getActions(){return this._actions}isRoot(){return this._isRoot}resolveContextProps(e){const{value:t}=this.getStateProps();t&&(e.error=this.getContextDataValue(`${this.getPageReference()+t}.error`),e.validatemessage=this.getContextDataValue(`${this.getPageReference()+t}.validatemessage`))}isValidatorExist(){return!!this._isValidatorExist}getValidationApi(){return new Ol(this)}isEditable(){return this._rawConfig&&this._rawConfig.config&&!(this._inheritedConfig&&this._inheritedConfig.readOnly)&&(Object.hasOwn(this._rawConfig.config,"value")||this._rawConfig.config.selectionList||"Editable"===this._rawConfig.config.renderMode&&this._rawConfig.config.referenceList)&&!("string"==typeof this._rawConfig.config?.value&&this._rawConfig.config.value.includes("@FILTERED_LIST"))&&!(Object.hasOwn(this._rawConfig.config,"readOnly")&&("true"===this._rawConfig.config.readOnly||!0===this._rawConfig.config.readOnly))&&!(Object.hasOwn(this._rawConfig.config,"disabled")&&!0===this._rawConfig.config.disabled)}isVisible(){return this._rawConfig?.config&&Object.hasOwn(this._rawConfig?.config,"visibility")&&"string"==typeof this._rawConfig?.config?.visibility?Qt.handleAnnotation(this._rawConfig?.config?.visibility,this):"string"!=typeof this.options?.visibility||Qt.handleAnnotation(this.options?.visibility,this)}isReadOnly(){return void 0!==this._readOnly&&("true"===this._readOnly||!0===this._readOnly||"string"==typeof this._readOnly&&Qt.handleAnnotation(this._readOnly,this))}hasChildren(){return!!this._children}getComputedVisibility(){const e="reference"===this._type&&!!this.getReferencedView()?this.getReferencedViewPConnect().getPConnect():this;if(!1===this.getConfigProps().visibility)return!1;if(!1===this.getConfigProps().requiresVisibleChildren)return!0;const t=e.getConfigProps(),n={includeTypes:["Group","Region","View"],excludeTemplates:["ListView","SimpleTable","StudioTable"]};let r=e._type&&n.includeTypes.includes(e._type)&&!n.excludeTemplates.includes(t.template);if(!!t.highlightedData&&t.highlightedData.length&&t.showHighlightedData&&(r=!1),!r)return!0;const s=e.getChildren();return!!s&&s.some((e=>e.getPConnect().getComputedVisibility()))}getChildrenIterator(){return this._children.setContext(this.getPageReference()),this._children}setAction(e,t){this._actions[e]=t}getComponentName(){return this._rawConfig&&this._rawConfig.type}isComponentRefreshable(){return!(!this._rawConfig||!this._rawConfig.isRefreshable)}getDataObject(e){return ch(e||this.getContextName())}getImagePath(e){return`${Lr.getConstellationServiceUrl()}/v860/${Lr.getAppAlias()}/image/${e}?org=${lp.getOrganizationName()}`}skipRequiredValidation(){return this.options.isBulkAction}isBulkAction(){return this.options.isBulkAction}getChildren(){if(this._children&&this._children.length){const e=Gu(this._rawConfig,{pageReference:this._pageReference,context:this._contextName,localeReference:this._localeRuleName,hasForm:this.options.hasForm,isBulkAction:this.options.isBulkAction,containerName:this.getContainerName(),containerItemName:this.options.containerItemName,viewName:this.viewName,inheritedConfig:this._inheritedConfig,target:this._containerTarget,readOnly:this._readOnly,categoryName:"Group"===this._type?this._rawConfig?.config?.id:null}),t=[];for(;e?.hasNext();){const n=e.next();if(this.isBulkAction()){const e=n.getPConnect().getComponentName(),{template:t}=n.getPConnect().getConfigProps();if(!e||!0!==Wu.allowedComponetsForBulkProcessing[e]&&!0!==Wu.allowedComponetsForBulkProcessing[e]?.[t])continue}t.push(n)}return e?.resetIndex(),t}return[]}setInheritedProp(e,t){this._inheritedConfig[e]=t}getLocaleRuleName(){return this._localeRuleName}getLocalizedValue(e,t,n){const r=n||this.getLocaleRuleName(),s=this?.getMetadata();let a=null;if(s){const e=s?.type;e&&!["View","Region"].includes(e)&&(a=e)}return hp.getLocaleValue(e,t,r,a)}getLocalizedValueForFieldLabel(e,t,n){const r=n||this.getLocaleRuleName(),s=this?.getMetadata();let a=null;const o=up.getLocale();if(s){const t=s?.type,n=["View","Region"],r=s?.config?.label??s?.config?.caption;if("en-US"!==o&&r?.startsWith(j.FIELD_LABEL_ANNOTATION)){const t=r.split(`${j.FIELD_LABEL_ANNOTATION} `).pop(),n=t?.split("."),s=n?.pop();let o=`${s}`;const i=this.getFieldMetadata(o),c=i?.classID||this.getValue(`.${n?.join(".")}${j.CLASS_ID}`),l=i?.definedOnClassID;return o=`${l||c}.${o}`,hp.getLocaleValue(e,o,hp.FIELD_LABELS_BUNDLE_KEY,a)}t&&!n.includes(t)&&(a=t)}return hp.getLocaleValue(e,t,r,a)}getLocalizedParagraphValue(e){const t=zp(e,this.getCurrentClassID()),n=t?.definedOnClassID;return hp.getParagraphLocaleValue(n||this.getCurrentClassID(),e)||t?.content}getLocaleRuleNameFromKeys(e,t,n){return`${e}!${t}!${n}`}getValue(e,t){return this.useCustomContext?(e=e.startsWith?.(".")?e.substring(1):e,e.split?.(".").reduce(((e,t)=>e?.[t]??void 0),this.useCustomContext)):this._hasSuggestions&&this.getStateProps()?.value===e?Rh.getPropertyValue(e,this.getPageReference(),`${this._contextName}/${j.SUGGESTION}`):Rh.getPropertyValue(e,t||this.getPageReference(),this._contextName)}setInheritedConfig(e){if(!e)return;const{readOnly:t,displayMode:n,referenceType:r,hideLabel:s}=e;s&&(this._inheritedConfig.hideLabel=s),r&&(this._inheritedConfig.referenceType=r),n&&(this._inheritedConfig.displayMode=n),(this._inheritedConfig.readOnly||t)&&(this._inheritedConfig.readOnly=t),e.inheritedProps&&(e.inheritedProps?.forEach((e=>{"required"===e.prop&&(this._inheritedConfig[e.prop]=e.value)})),Yu(this._inheritedConfig,e))}getInheritedProps(){const e={},t={};return this._inheritedConfig.inheritedProps?.forEach((e=>{t[e.prop]=e.value})),Rh.resolveProps(t,e,this),e}setValue(e,t,n,r=!1,s={}){let a,o;const{isArrayDeepMerge:i}=s;this.isInsideList()&&this.getListActions().updateProperty(e,t),this.isBulkAction()&&(a=!0,t||(o=!0)),ih({type:"SET_PROPERTY",payload:{reference:`${this.getPageReference()}${e}`,value:t,initialValue:n,isImplicit:r,context:this.getContextName(),...void 0!==i&&{isArrayDeepMerge:i},...a&&{isStrictTracking:a},...o&&{removePropertyFromChangedList:o}}})}updateDirtyCheckChangeList(e,t){(({value:e,context:t,reference:n})=>{if(dl.isPageInstruction(n))return;const r=n?.startsWith(".")?n?.substr(1):n;fl[t]=fl[t]||{},fl[t][r]||(fl[t][r]={initialValue:dh(r,null,t)}),fl[t][r].value=e})({reference:`${this.getPageReference()}${e}`,value:t,context:this.getContextName()})}getContextDataValue(e,t){return ph(t||this.getPageReference(),e,this._contextName)}updateState(e){const t=this._pageReference.indexOf(j.CASE_INFO.CASE_INFO_CONTENT),n=this._pageReference.indexOf(".");let r=j.CASE_INFO.CASE_INFO_CONTENT;0!==t&&(r=n>0?this._pageReference.substring(n):this._pageReference),ih(wh({context:this._contextName,data:e,rootPageReference:r}))}replaceState(e,t,n={}){const{skipDirtyValidation:r=!1}=n;ih({type:"REPLACE_PROPERTY",payload:{reference:`${this.getPageReference()}${e}`,value:t,context:this.getContextName(),skipDirtyValidation:r}})}reportError(e,t,n){ih(ig(e,t||{},n))}getComponent(){return qu({getPConnect:()=>this})}createComponent(e,t,n,r){let s=this._pageReference;if(t){const e=hh(`${this.getPageReference()}.${j.SUMMARY_OF_LISTS}`,t,this._contextName);s=Rh.getContextPath(e||t,n)||t}else if(r&&r.pageReference){let e=r.pageReference;e=Qt.handleAnnotation(e,this),s=Rh.getContextPath(this._pageReference,e)||""}return qu(Xu({meta:e,index:this.index,options:{containerName:this.getContainerName(),hasForm:this.options.hasForm,...e.options,pageReference:s,context:this._contextName,target:this._containerTarget,readOnly:this._readOnly||this._inheritedConfig?.readOnly,viewName:this.viewName}}),r)}getReferencedView(){if(this.meta)return Rh.resolveReference(this.resolveConfigProps(this.meta),this)}_resolvePageRef(e){return this.getPageReference().includes(e)||e.startsWith(j.CLASS_ANNOTATION)?this.getPageReference():`${this.getPageReference()}${e}`}getReferencedViewPConnect(e=!1){const t={...this.getComponentConfig()};return delete t?.name,delete t?.type,Xu({meta:this.getReferencedView(),options:{...e?this.options:void 0,...t,context:this.getContextName(),pageReference:t.context?this._resolvePageRef(t.context):this.getPageReference(),viewName:this.viewName}})}getContainerManager(){return new Fl(this)}getActionsApi(){return this._actionsApi||(this._actionsApi=new Mu(this)),this._actionsApi}getActionManager(){return ln}doesContextExist(e){return _h(e??this.getContextName())}getGoogleMapsAPIKey(){return C()}getServerURL(){return E()}getLoadingStatus(e){let t=null;return e?(t=ch(e),t=t?t.context_data:null):t=this.getDataObject().context_data,!!t&&(!!t.isLoading&&t.isLoading)}clearErrorMessages(e){e?.property?zn({type:"error",property:e.property,pageReference:this.getPageReference(),context:this.getContextName()}):e?.context?zn({type:"error",...e}):(zn({type:"error",...e,context:j.APP.APP}),zn({type:"error",...e,context:gd(`${j.APP.APP}/${this.getContainerName()}`)}))}resolveDatasourceReference(e){return hh(`${this.getPageReference()}.${j.SUMMARY_OF_LISTS}`,e,this.getContextName())||e}removeFormField(){}addFormField(){}setPageValue(e,t,n){delete e?.classID,this.setValue(t,e,void 0,void 0,{isArrayDeepMerge:!1}),((e,t,n)=>{const r=Jc(t);Xc[e]?Xc[e].fieldOrder[r]=n:Xc[e]={fieldOrder:{[r]:n}}})(this.getContextName(),`${this.getPageReference()}${t}`,this),n&&((e,t,n)=>{const r=(e,t)=>{Object.entries(e).forEach((([e,s])=>{if(Array.isArray(s)){const r=PCore.createPConnect({options:{pageReference:n.getPageReference(),context:n.getContextName(),referenceList:`${t}.${e}`}}).getPConnect();Rr(r,`${t}.${e}`,{skipStateUpdate:!0});for(let e=0;e<s.length;e+=1)Ar(s[e],e,r,void 0,{})}else"object"==typeof s&&r(s,`${t}.${e}`)}))};r(e,t)})(e,t,this)}acceptSuggestion(e){if(this.getStateProps()?.value&&this.options.hasForm&&this._hasSuggestions){const t=ku.getSuggestionsContext(this.getContextName()),n=this.getStateProps()?.value||e,r=Rh.getContextPath(this.getPageReference(),n),s=t.getField(r);this._hasSuggestions=!1,this.getActionsApi().updateFieldValue(n,s),this.getActionsApi().triggerFieldChange(n,s),t.removeField(r)}}ignoreSuggestion(e){if(this.getStateProps()?.value&&this.options.hasForm&&this._hasSuggestions){const t=this.getStateProps()?.value||e,n=Rh.getContextPath(this.getPageReference(),t);this._hasSuggestions=!1,ku.getSuggestionsContext(this.getContextName()).removeField(n)}}getSelfReferencingDatapageKeys(){const e=[],t=this.getPropertyName(),n=this.getFieldMetadata(t),{datasource:{parameters:r={}}={}}=n||{};return Object.values(r).forEach((n=>{const[,r]=n.split("."),s=t?.split(".").pop();r===s&&e.push(n.substring(n.lastIndexOf(".")+1))})),e}}function Xu(e){const t=new Ku(e);return{getPConnect:()=>t}}function Ju(e){qu=e}const Qu=class{static createContainerPConnect(e,t,n,r=!1){const{accessedOrder:s,items:a}=e;if(s&&a){const e=s[s.length-1];if(a[e]?.view&&Object.keys(a[e].view).length>0){const s=a[e],o=e.substring(0,e.lastIndexOf("_")),{view:i,context:c}=s,{viewName:l,viewContext:u}=this.processRootViewDetails(i,s,t);if(!l)return null;return Xu({meta:i,options:{context:c,pageReference:u||t,containerName:n,containerItemID:e,parentPageReference:t,hasForm:r||n===td.WORKAREA||n===td.MODAL||l===j.CREATE_DETAILS_VIEW_NAME,target:o}}).getPConnect}}return null}static processRootViewDetails(e,t,n){const{config:{context:r,name:s}={}}=e,{context:a}=t;let o=s,i=r;const c=ul.isProperty(s),l=ul.isProperty(r);if(l){const e=ul.getPropertyName(r);i=dh(`.${e}`,e.startsWith(".")?n:"",a)}if(i||(i=n),c){const e=ul.getPropertyName(s);o=dh(`.${e}`,i,a)}return c&&l&&""!==o&&(o=s,i=r),{viewName:o,viewContext:i}}static addFlowContainerItem(e){const t=e.getContainerManager(),n=e.getContextName();let r,s;if("review"!==e.getValue("context_data.caseViewMode")){const e=n.substring(0,n.lastIndexOf("_")),t=gd(e),a=sd(e,t);a&&({key:r,flowName:s}=a)}t.addContainerItem({semanticURL:"",key:r,flowName:s,caseViewMode:"perform",resourceType:"ASSIGNMENT",data:e.getDataObject(n)})}},Zu={defaultLimit:16},ed={SINGLE:"single",MULTIPLE:"multiple"},td={PRIMARY:"primary",WORKAREA:"workarea",MODAL:"modal",PREVIEW:"preview"},nd=()=>oh()?.getState()?.containers,rd=e=>e?oh()?.getState().containers[e]:(Et.error("getContainerData: target is the required parameter"),null),sd=(e,t)=>{if(!e||!t)return null;const n=nd(),r=n?.[e];return r&&r.items&&r.items[t]||null},ad=e=>e?oh()?.getState().containers[e]?.items:(Et.error("getContainerItems: target is the required parameter"),null),od=e=>e?oh()?.getState().containers[e]?.accessedOrder||[]:(Et.error("getContainerAccessOrder: target is the required parameter"),[]),id=e=>e?od(e)?.length>0||!1:(Et.error("areContainerItemsPresent: target is the required parameter"),!1),cd=(e,t,n)=>{if(!e||!t)return Et.error("isContainerItemExists: target and key are required parameters"),!1;const r=nd(),s=r?.[e],a=s&&s.items||null,o=n||((e,t)=>e===t);if(t&&a)for(const e in a)if(o(t,a[e].key))return!0;return!1},ld=(e,t,n)=>{if(!e||!t)return Et.error("getContainerItemName: target and key are required parameters"),null;const r=nd(),s=r?.[e],a=s&&s.items||null,o=n||((e,t)=>e?.toLowerCase()===t?.toLowerCase());if(t&&a)for(const e in a)if(o(t,a[e].key))return e;return null},ud=(e,t)=>{if(e&&t)for(const s of Object.keys(t))if(n=e,r=t[s].key,n?.toLowerCase()===r?.toLowerCase())return t[s];var n,r;return null},dd=e=>{if(!e)return Et.error("getContainerItemByKey: key is required parameter"),null;const t=nd()??{};for(const n of Object.keys(t))if(t[n]){const r=t[n].items??null,s=ud(e,r);if(s)return s}return null},pd=(e,t)=>{if(!e||!t)return Et.error("isContainerInitialized: context and name are required parameters"),!1;const n=nd();return n&&Object.prototype.hasOwnProperty.call(n,`${e}/${t}`)},hd=(e,t)=>{if(!e||!t)return Et.error("getContainerType: context and name are required parameters"),null;const n=nd(),r=n?.[`${e}/${t}`];return r&&r.type},gd=e=>{if(!e)return Et.error("getActiveContainerItemName: target is the required parameter"),null;let t=null;const n=nd();if(n&&n[e]){const r=n[e],{accessedOrder:s}=r;t=s&&s.length>0?s[s.length-1]:null}return t},fd=(e,t,n)=>{if(!e||!t)return Et.error("isContainerItemActive: target and key are required parameters"),!1;const r=ld(e,t,n);return!!r&&r===gd(e)},md=(e,t)=>{let n=null;const r=nd();for(const s in r)if(Object.prototype.hasOwnProperty.call(r,s)&&r[s].items){const a=r[s].items[e];if(n=a?a[t]:null,n)break}return n},yd=e=>e?md(e,"context"):(Et.error("getDataContextName: containerItemName is required parameters"),null),Id=e=>{if(!e)return Et.error("getActiveContainerItemContext: target is required parameters"),null;let t=null;const n=nd();if(n&&n[e]){const r=n[e],{accessedOrder:s}=r,a=s&&s.length>0?s[s.length-1]:null;t=yd(a)}return t},Ed=e=>{if(!e)return Et.error("getChildContainerItems: containerItemName is required parameters"),[];const t=e.endsWith("/")?e:`${e}/`;let n=[],r=!1;const s=nd(),a=n=>{const s=[];return Object.keys(n).forEach((n=>{n.startsWith(t)&&n!==t&&s.push(n),n===e&&(r=!0)})),s};for(const e in s)if(Object.prototype.hasOwnProperty.call(s,e)&&s[e].items){const t=a(s[e].items);t&&t.length>0&&(n=n.concat(t)),n=n.sort()}return r?n:[]},Ad=e=>{if(!e)return Et.error("getChildContainers: containerItemName is required parameters"),[];const t=[],n=nd();for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&r.startsWith(e)&&r!==e&&t.push(r);return t},_d=e=>{if(!e)return Et.error("getChildContainersContexts: parentContainerItemID is required parameters"),[];const t=[],n=nd();for(const r in n)if(Object.prototype.hasOwnProperty.call(n,r)&&r.startsWith(e)&&r!==e){(od(r)||[]).forEach((n=>{yd(n)!==e&&t.push(yd(n))}))}return t},Cd=e=>{const t=[..._d(e),e],n=[],r=oh()?.getState().data||{};return t.forEach((e=>{Object.prototype.hasOwnProperty.call(r,`${e}/${j.SUGGESTION}`)&&n.push(`${e}/${j.SUGGESTION}`)})),n},Sd=e=>e?e&&rd(e)&&rd(e).type===ed.SINGLE:(Et.error("isContainerSingleMode: target is required parameters"),null),Td=e=>e?e&&rd(e)&&rd(e).type===ed.MULTIPLE:(Et.error("isContainerMultipleMode: target is required parameters"),null),Nd=e=>e?rd(e)&&rd(e).items&&Object.keys(rd(e)?.items).length>0||!1:(Et.error("hasContainerItems: target is required parameters"),!1),Pd=e=>e&&Zu[e]?Zu[e]:Zu.defaultLimit,Rd=(e,t=Zu.defaultLimit)=>{e?Zu[e]=t:Et.error("setContainerLimit: target is required parameter")},Dd=e=>{if(!e)return Et.error("isContainerLimitReached: target is required parameter"),!1;let t=!1;const n=rd(e),{items:r={}}=n,s=Object.keys(r),a=Pd(e);return s&&s.length>0&&s.length>=a&&(t=!0),t},bd=e=>{if(!e||!e.name||!e.context)return Et.error("resetContainersPayload: containerInfo object should contain name and context"),null;const t=e?.name,n=rd(`${e?.context}/${t}`),r=Array.isArray(n?.accessedOrder)&&n?.accessedOrder.map((e=>n?.items[`${e}`]?.context))||[],s=Ad(`${j.APP.APP}/${j.PREVIEW}`),a=_d(`${j.APP.APP}/${j.PREVIEW}`);return{context:e?.context,name:t,containerItems:[...r,...a],childContainers:s}},Od=e=>{if(!e)return Et.error("isContainerDirty: containerItemID is the required parameter"),!1;const t=yd(e);return Nl(t)||Fc(e)},vd=e=>{if(!e)return Et.error("getLeastRecentlyUsedNonDirtyContainerItemID: target is required parameter"),null;let t;const n=rd(e),{accessedOrder:r=[]}=n;for(let e=0;e<r.length;e+=1){const n=r[e];if(!Od(n)){t=n;break}}return t},xd=e=>{if(!e)return Et.error("getTargetFromContainerItemID: containerItemID is the required parameter"),null;const{containers:t}=oh()?.getState()||{};for(const n in t)if(t[n]?.accessedOrder?.includes(e))return n;const n=e.lastIndexOf(j.UNDERSCORE_STRING);return e.substring(0,n)},wd=(e,t={})=>{if(!e)return Et.error("closeContainerItem: containerItemID is the required parameter"),Promise.reject(new Error("closeContainerItem: containerItemID is the required parameter"));const n=xd(e),r=yd(e),{skipDirtyCheck:s}=t;let a=!0,o=[];if(Od(e)&&!s&&(a=window.confirm(hp.getLocaleValue(Il,"Messages"))),a){const{accessedOrder:t=[],items:s={},type:a}=rd(n);o=t.filter((t=>t!==e));const i=o[o.length-1],c=s[i]||{},{semanticURL:l=j.FORWARD_SLASH_STRING,context:u}=c;o.length>0&&l&&l!==j.FORWARD_SLASH_STRING?xg({directUrlUpdation:!0,semanticURL:l,options:{containerItemID:i,context:u}}):xg({directUrlUpdation:!0,semanticURL:j.FORWARD_SLASH_STRING,options:{}});ih(Zh({containerItemID:e,context:r,target:n,containerInfo:{newAccessedOrder:o,containerType:a}}))}return Promise.resolve({newAccessedOrder:o,removeItem:a})},Md=(e,t,n,r)=>{const s="root",a=H(t,s,!0),o=mt(t,s),i={data:n,context:r?"app":a},c=[$h({root:e,containerItemID:a,context:r?"app":a,target:o,containerName:t})];c.push(wh(i)),ih(c)},Ld=(e,t,n)=>{let r=od(e);r=r.filter((e=>e!==t));let s=!1;for(let e=0;e<r.length;e+=1){if(yd(r[e])===n){s=!0;break}}return s},Ud=e=>{if(!e)return Et.error("isContainerItemContextBeingUsedInOtherContainers: containerItemID is the required parameter"),!1;const t=nd(),n=yd(e),r=t?Object.keys(t):[];let s=!1;for(let t=0;t<r.length&&(s=Ld(r[t],e,n),!s);t+=1);return s},Fd=e=>{Array.isArray(e)||(e=[e]);const t=nd()||{};return e.map((e=>{const n=xd(e);return Sh.getIn(t,[n,"items",e,"transientItems"])||[]})).flat()},jd=e=>{const{transientItemID:t,data:n,options:r}=e,s=Sh.deepClone(oh()?.getState().data[t]);r?.reset&&Sh.iterateLeafNodes(s,(e=>{"classID"!==e[e.length-1]&&Sh.setIn(s,e,"")})),ih(Gh({transientItemID:t,data:Sh.mergeDeep(n,s)}))},Vd=e=>{const{transientItemID:t,data:n}=e;ih(Hh({transientItemID:t,data:n}))},kd=e=>{const t=Sh.deepClone(oh()?.getState().data[e]);Sh.iterateLeafNodes(t,(e=>{"classID"!==e[e.length-1]&&Sh.setIn(t,e,"")})),ih(Wh({transientItemID:e,data:t}))},$d=e=>{const t=Sh.deepClone(oh()?.getState().data[e]);Sh.iterateLeafNodes(t,(e=>Sh.setIn(t,e,""))),ih(qh({transientItemID:e,data:t}))};class Bd{static addContainerItems(e){this.items=e}static getContainerItems(){return this.items}static deleteContainerItem(e){const t=this?.items?.indexOf(e);void 0!==t&&-1!==t&&this.items.splice(t,1)}}const Gd=()=>Bd,Wd=e=>{const t={containerName:e};t.childContainers=Ad(e),ih({type:Ue,payload:t})},Hd=(e,t)=>{const n=Ed(e),{key:r}=sd(xd(e),e),s=[];n.forEach((e=>{const{key:n}=sd(xd(e),e);if(n===r){const n={data:{caseInfo:{headers:{etag:t}}},target:xd(e),context:e};s.push({type:fe,payload:n})}})),s.length&&ih(s)},qd=(e,t)=>{const n=[],r={data:{caseInfo:{headers:{etag:t}}},target:xd(e),context:e};n.push({type:fe,payload:r}),n.length&&ih(n)},zd=()=>up.isPortalLoaded?"app":"root",Yd=()=>bl,Kd=(e,t)=>{const n={data:{caseInfo:{lastUpdateTime:t}},target:xd(e),context:e};ih({type:fe,payload:n})},Xd=(e,t)=>{const n=ld(e,t),r=ld(`${n}/workarea`,t);return yd(r)},Jd=e=>e?md(e,"parentContext"):(Et.error("getContainerParentContext: containerItemName is required parameters"),null),Qd=e=>{const{accessedOrder:t}=e;return t&&t.length>0?t[t.length-1]:""},Zd=e=>{if(e&&"string"==typeof e){const t=e.split("/");return t.pop(),t.join("/")}return null},ep=()=>Qu,tp=/{(.*?)}/i,np=/{(.*?)}/g,rp=e=>null!==e.match(tp),sp=e=>(e&&(e.startsWith("/")&&(e=e.substring(1,e.length)),e.endsWith("/")&&(e=e.substring(0,e.length-1))),e),ap=e=>{const t=e[e.length-1],n=e[e.length-2];if("y"!==t.toLowerCase())return`${e}s`;switch(n.toLowerCase()){case"a":case"e":case"i":case"o":case"u":return`${e}s`;default:return`${e=e.substring(0,e.length-1)}ies`}},op=()=>sp(window.location.pathname),ip=(e,t,n)=>{switch(n){case"warning":t?console.warn(e,t):console.warn(e);break;case"error":t?console.error(e,t):console.error(e);break;default:t?console.log(e,t):console.error(e)}};const cp=new class{constructor(){this.staticRoutesList=[],this.dynamicRoutesList=[],this.reqContextName="",this.defaultViewUrlPath="",this.portalName=""}init=(e,t)=>{e&&e.routes&&e.routesMeta?(this.routingInfo=e,this.appRoutes=e.routes,this.appRoutesMeta=e.routesMeta,this.reqContextName=e.reqContextName,this.reqServletPath=e.reqServletPath,this.appName=e.appName,this.appAlias=e.appAlias,this.orgName=e.orgName,this.defaultViewUrlPath=t,this._createStaticDynamicRoutesList(this.appRoutes),this.appDelimeter=e.appDelimeter,this.reqServletNameReal=e.pxReqServletNameReal,this.bDefaultPortal=e.isDefaultPortal,this.portalName=e.portalName,this.ignoreFromEndPoint=["reactMode=dev","reactMode=prod"]):console.error("Routing info is not appropriate. Missing routes and routesMeta objects in routingInfo",JSON.stringify(e))};addRoutes=e=>{e?.routes&&e.routesMeta&&(this.appRoutes={...this.appRoutes,...e.routes},this.appRoutesMeta={...this.appRoutesMeta,...e.routesMeta},this.routingInfo&&(this.routingInfo.routes={...this.routingInfo.routes,...e.routes},this.routingInfo.routesMeta={...this.routingInfo.routesMeta,...e.routesMeta}),this._createStaticDynamicRoutesList(e.routes))};setDefaultRoute=e=>{this.defaultViewUrlPath=e};_createStaticDynamicRoutesList=e=>{Object.keys(e).forEach((e=>{rp(e)?this.dynamicRoutesList?.push(e):this.staticRoutesList?.push(e)}))};_getDynamicKeyName=e=>{const t=e.indexOf("{")+1,n=e.lastIndexOf("}");return e.slice(t,n)};isDefaultPortal=()=>"false"!=`${this.bDefaultPortal}`;getPortalName=()=>this.portalName;getApplicationPath=()=>sp(`${this.getReqContextName()}/${this.getReqServletNameReal()}`);getReqServletNameReal=()=>`${this.reqServletNameReal}`;getAppDelimeter=()=>`${this.appDelimeter}`;getApplicationName=()=>`${this.appName}`;getApplicationAlias=()=>`${this.appAlias}`;getServletPath=()=>`${this.reqServletPath}`;getOrganizationName=()=>`${this.orgName}`;getReqContextName=()=>sp(this.reqContextName);getRoutingInfo=()=>this.routingInfo;processUrl=(e,t)=>{t&&(e=e.toLowerCase()),e&&(e=decodeURIComponent(e));const n=new RegExp(this.getApplicationPath(),"i");return e=e.replace(n,""),sp(e)};getEndPointInfo=e=>{this.ignoreFromEndPoint?.forEach((t=>{e.includes(t)&&(e=e.substring(0,e.indexOf(t)))}));let t=this.processUrl(e,!0),n=this._getMatchedRouteInRoutingTable(t);void 0===n&&(t=this.processUrl(this.defaultViewUrlPath,!0),n=this._getMatchedRouteInRoutingTable(t)||"");const{routeKey:r,payload:s}=this.appRoutes[n],{reqType:a,endPoint:o,params:i}=this.appRoutesMeta?.[r].restApi||{},c={...s},{caseClassName:l,caseID:u}=c;if($.isRemoteCase(l)){const{RemoteClassGroup:e,RemoteSystemID:t}=$.getRemoteCase(l);c.caseID=u?.replace(l,e?.toUpperCase()),c.RemoteSystemID=t}const d={routeKey:r,requestType:a,routeEndpoint:o,payload:{...i,...c}};return this._resolveRoute(d,this.processUrl(e,!1),n)};getSemanticURL(e,t,n){return this.buildSemanticURL(e,t,n)}getResolvedSemanticURL(e,t,n={}){const r=this.getSemanticURL(e,t,n);let s=r;if(rp(r)){const e=r.match(np);e?.forEach((e=>{const t=this._getDynamicKeyName(e);n[t]&&(s=s.replace(e,n[t]))}))}const a=vg(s),o=new URL(a);return this.isDefaultPortal()||this.getPortalName()&&!o.searchParams.toString().includes("portal=")&&o.searchParams.append("portal",this.getPortalName()),o.toString()}updateSemanticURLAndDocumentTitle(e){const{key:t,actionName:n,caseClassName:r,isRemoteCase:s}=e;if(s&&!r)return;const a=this.getSemanticURL(n,{caseClassName:r}).replace(/{.+?}/,String(Zr(t))),o=`${F.APP.APP}${j.FORWARD_SLASH_STRING}${F.PRIMARY}`,i={semanticURL:a,directUrlUpdation:!0,options:{acName:o,context:Id(o)}};Og(i);const c=r.substring(r.lastIndexOf("-")+1),l=t.substring(t.lastIndexOf(" ")+1),u=up.environmentInfoObject?.pxApplication?.pyLabel;Vg(`${c} (${l}) - ${u}`)}buildSemanticURL(e,t,n){const{urlPattern:r}=this.appRoutesMeta?.[e]||{},s=r?.split("/").length,a=r?.split("/"),o=Object.keys(this.appRoutes).filter((e=>s===e.split("/").length)).filter((e=>{const t=e.split("?")[0].split("/");return a?.every(((e,n)=>e.startsWith("{")||e===t[n]))}));if(1===o.length)return this._getQueryParamsResolvedURL(o[0],n);if(0===Object.keys(t).length)return"";const i=o.find((e=>{const r=this.appRoutes[e].payload,s={...n};delete s.dataViewName,delete s.dataContext;const a=r.dataViewKeys||r.dataContextParameters||{},o=Object.keys(t).every((e=>t[e]===r[e]));return!!o&&(Sh.isEmpty(a)||Sh.isEmpty(s)?o:Object.keys(s).every((e=>Object.prototype.hasOwnProperty.call(a,e))))}));return i?this._getQueryParamsResolvedURL(i,n):o.includes("cases/{id}")&&n?.id?"cases/{id}":""}_getQueryParamsResolvedURL(e,t,n=!1){const[r,s]=e.includes("?")?e.split("?"):[e];if(s){const e={};for(const[n,r]of Object.entries(t))e[n.toLowerCase()]=r;const a=new URLSearchParams(s),o={};for(const[r,s]of a.entries())if("string"==typeof s&&rp(s)){const a=this._getDynamicKeyName(s);o[r]=n?t[a]||e[a.toLowerCase()]:t[a]}else"string"==typeof s&&(o[r]=s);return`${r}?${new URLSearchParams(o).toString()}`}return r}_getQueryParamsObject(e){const t={},n=new URLSearchParams(e);for(const[e,r]of n.entries())t[e]=r;return t}getRestEndPoint(e,t){try{return this._buildRestApi(e,t)}catch(e){return console.error(e),null}}_buildRestApi(e,t){if(e&&this.appRoutesMeta?.[e]){const{reqType:n,body:r}=this.appRoutesMeta[e].restApi;let{endPoint:s}=this.appRoutesMeta[e].restApi;t?.params&&t.params.pageName&&(s=`${s}&pageName=${t.params.pageName}`);const a=s.match(np);if(a)for(let e=0;e<a.length;e+=1){const n=a[e].replace("{","").replace("}",""),r=new RegExp(a[e],"g");s=s.replace(r,t?.[n])}if(r){let e={};return Object.keys(r).forEach((n=>{this._isSpecialInstruction(n)&&(e={...e,...this._processInstruction(n,r[n],t)})})),{restApi:s,reqType:n,body:e}}return{restApi:s,reqType:n}}throw new Error(`Cannot find route metadata for the routeKey: ${e}.`)}_isSpecialInstruction(e){return e&&e.startsWith("@")}_processInstruction(e,t,n){const r={};return"@COPY"===e&&t.forEach((e=>{r[e]=n[e]})),r}doesRestApiExist(e){return!(!this.appRoutesMeta||!this.appRoutesMeta[e])}_resolveRoute=(e,t,n)=>{const r=[],[s,a]=t.includes("?")?t.split("?"):[t],[o,i]=n.includes("?")?n.split("?"):[n],c=s.split("/"),l=o.split("/"),u={};for(let e=0;e<l.length;e+=1)if(r[e]=l[e],rp(l[e])){u[this._getDynamicKeyName(l[e])]=c[e],r[e]=c[e]}const d=this._getQueryParamsObject(i),p=this._getQueryParamsObject(a),h={};for(const[e,t]of Object.entries(p))h[e.toLowerCase()]=t;for(const e in d)rp(d[e])?u[e]=p[e]||h[e.toLowerCase()]:u[e]=d[e];let g;a&&(g=this._getQueryParamsResolvedURL(n,p,!0));const f=this._resolvePayload(e,u,n);return{...this._resolveRouteEndPoint(f,n),urlPath:g||r.join("/")}};_resolveRouteEndPoint=(e,t)=>{let{routeEndpoint:n}=e;if(!rp(n))return e;const r={};if(r[t]=e,void 0!==e.payload){const t=n.match(np);for(let s=0;s<t.length;s+=1){const a=t[s],o=this._getDynamicKeyName(a);if(void 0!==e.payload[o]){const t=e.payload[o];n=n.replace(a,t)}else this._sendWarningAndErrorMessages(`Unable to resolve dynamic token {${o}} in routeEndpoint- ${o} is missing in payload`,r)}}else this._sendWarningAndErrorMessages("Unable to resolve dynamic token(s) in routeEndpoint- payload is missing in routing table for-",r);return{...e,routeEndpoint:n}};_resolvePayload=(e,t,n)=>{if(void 0===e.payload)return e;const r={...e.payload,...this._resolvePayloadRecursive(e.payload,t)};return{...e,payload:r}};_resolvePayloadRecursive(e,t){const n={};for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){let s=e[r];if("string"==typeof s&&rp(s)){const e=s.match(np);for(let n=0;n<e.length;n+=1){const r=e[n],a=this._getDynamicKeyName(r);if(void 0!==t[a]){const e=t[a];s=s.replace(r,e)}else this._sendWarningAndErrorMessages(`Unable to resolve dynamic token {${a}} in payload- {${a}} is missing in semantic url construct`)}n[r]=s}else"object"==typeof s&&(n[r]=this._resolvePayloadRecursive(s,t))}return n}_getMatchedRouteInRoutingTable=e=>{let t=this._findMatchedRouteInStaticList(e);return void 0!==t?t:(t=this._findMatchedRouteInDynamicList(e),void 0!==t?t:void 0)};_findMatchedRouteInStaticList=e=>this.staticRoutesList?.find((t=>t.toLowerCase()===e.toLowerCase()));_findMatchedRouteInDynamicList=e=>{const[t,n]=e.includes("?")?e.split("?"):[e],r=t.split("/");return this.dynamicRoutesList?.find((e=>{const[t,s]=e.includes("?")?e.split("?"):[e],a=t.split("/");if(a.length!==r.length)return!1;let o=0;for(o=0;o<a.length;o+=1){const e=a[o].toLowerCase();if(!rp(e)&&e!==r[o]&&ap(e)!==r[o])return!1}if(s){const e=new URLSearchParams(n.toLowerCase()),t=new URLSearchParams(s.toLowerCase()),r=new Set,a=new Set,o=/\{[a-zA-Z]+\}/;for(const t of e.keys())r.add(t);for(const e of t.keys())a.add(e);if(a.size!==r.size)return!1;for(const n of r){if(!a.has(n))return!1;const r=t.get(n);if(e.get(n)!==r&&!o.test(r))return!1}}return!0}))};_sendWarningAndErrorMessages=(e,t)=>{ip(e,t,"warning"),ip("Error in Generated Routing Table",null,"error"),ip("Back | Forward for this page may NOT work as intended",null,"warning"),ip("Bookmark | Refresh for this page may NOT work as intended",null,"warning")}},lp=cp;const up=new class{constructor(){this.environmentInfoObject=null,this.isPortalLoaded=!1,this.pageName=null,this.KeyMapping={},this.isAssignmentHeaderHidden=!1,this.coexistenceMeta={appType:"",isCoexistence:!1},this.brandingInfo=null,this.cookieComplianceMethod="none",this.isExtraCallRequiredForDefaultHome="false"}setEnvironmentInfo(e){this.environmentInfoObject=e;const t=this.environmentInfoObject?.features||Sh.convertObjectWithStringToBoolean(this.environmentInfoObject?.pyFeatures)||{granularUIRefresh:!1};this.environmentInfoObject.features={...t,granularUIRefresh:t.granularUIRefresh||t.pyEnableGranularUIRefresh||!1}}getOperatorName(){return this.environmentInfoObject?.pxOperator?.pyUserName}getOperatorWorkGroup(){return this.environmentInfoObject?.pxOperator?.pyWorkGroup}getOperatorIdentifier(){return this.environmentInfoObject?.pxOperator?.pyUserIdentifier}getOperatorImageInsKey(){return this.environmentInfoObject?.pxOperator?.pyImageInsKey}getApplicationLabel(){return this.environmentInfoObject?.pxApplication?.pyLabel}getPortalName(){return lp.getPortalName()}getApplicationName(){return this.environmentInfoObject?.pxApplication?.pyRuleName}getUseLocale(){return this.environmentInfoObject?.pxLocale?.pyUseLocale}getAccessGroup(){return this.environmentInfoObject?.pxOperator?.pyAccessGroup}getTimeZone(){return this.environmentInfoObject?.pxLocale?.pyTimeZone}getTheme(){return this.themeOverrides}setTheme(e){return this.themeOverrides=e,this.themeOverrides}getBrandingInfo(){return this.brandingInfo}setBrandingInfo(e){return this.brandingInfo=e,this.brandingInfo}getCookieComplianceMethod(){return this.cookieComplianceMethod}setCookieComplianceMethod(e){this.cookieComplianceMethod=e}setLocale(e){const t=e.replaceAll("-","_").split("_").slice(0,2);this.locale=t.join("-"),this.environmentInfoObject?.pxLocale&&(this.environmentInfoObject.pxLocale.pyUseLocale=this.locale)}getLocale=()=>this.locale;getEnvironmentKeys(){return Object.keys(j.ENV_INFO_KEYS)}getMaxAttachmentSize(){return this.environmentInfoObject?.pxApplication?.pyMaxAttachmentSize}getDefaultOperatorDP(){return this.environmentInfoObject?.pxApplication?.pyDefaultOperatorDP}getDocumentUrlDP(){return this.environmentInfoObject?.pxApplication?.pyDocumentUrlDP}getCaseInstanceListDP(){return this.environmentInfoObject?.pxApplication?.pyCaseInstanceListDP}getBaseLocale(){return this.environmentInfoObject?.pxApplication?.pyBaseLocale||"en-US"}getRenderingMode(){return this.environmentInfoObject?.renderingMode}getBuiltOnAppNames(){return this.environmentInfoObject?.pxApplication?.pyBuiltOnApplications}setPreviewMode(){ec.setPreviewMode()}setDefaultCasePage(e){this.pageName=e}getDefaultCasePage(){return this.pageName}disableAssignmentHeader(e){this.isAssignmentHeaderHidden=e}isAssignmentHeaderDisabled(){return this.isAssignmentHeaderHidden}getDefaultPortal(){return this.environmentInfoObject?.pxOperator?.pyDefaultPortal}updateFeatureMap(e){const t=this.environmentInfoObject?.features;return this.environmentInfoObject&&e&&(this.environmentInfoObject?.features?this.environmentInfoObject.features={...t,...e}:this.environmentInfoObject.features={...e}),this.getFeatureMap()}getFeatureMap(){return this.environmentInfoObject?.features||{}}setKeyMapping(e){return this.KeyMapping=e,this.KeyMapping}getKeyMapping(e){const t=this.KeyMapping[e];return void 0!==t?t:null}setCoexistenceMeta(e){return e&&(this.coexistenceMeta=e),this.getCoexistenceMeta()}getCoexistenceMeta(){return this.coexistenceMeta}isCoexistenceAppOfType(e){return!(!this.coexistenceMeta.isCoexistence||this.coexistenceMeta.appType!==e)}getCaseTypeList(){return this.environmentInfoObject&&this.environmentInfoObject?.pyCaseTypeList||[]}getUserSettings(){return this.environmentInfoObject?.pyUserSettings||null}getAvailableLocalePacks(){return this.environmentInfoObject?.pyAvailableLocalePacks?.map((e=>e.pyLabel))||[]}getIsExtraCallRequiredForDefaultHome(){return this.isExtraCallRequiredForDefaultHome}setIsExtraCallRequiredForDefaultHome(e){this.isExtraCallRequiredForDefaultHome=e}getInactivityTimeout(){const e=this.environmentInfoObject?.pxOperator?.pyAuthenticationTimeout;return e?Number(e):e}isUnifiedObject(){return this.environmentInfoObject?.features?.isUnifiedObject||!1}getRuntime(){return"undefined"!=typeof window&&window.document?"Browser":"Native"}};const dp=class{static regex=/\{@P[^}]*\s*:\s*[^}]*\}/g;static subRegex=/:'[a-zA-Z0-9!@#$&()\\-`.+,/\s"]*'/;static keyMap={};static formatLocaleKey(e){let t=0,n="";for(;t<=e.length;){const r=e.indexOf("{@P ",t);if(-1===r){n+=e.substring(t,e.length);break}n+=e.substring(t,r);const s=e.indexOf("}",t),a=e.substring(r,s+1),[o,i]=this.getKeyAndValue(a);this.addKeyToMap(o,i),n+=`${a.split(":")[0]}}`,t=s+1}return n}static getKeyAndValue(e){const t=e.indexOf(":"),n=e.indexOf("}");return[`${e.substring(0,t)}}`,e.substring(t+1,n)]}static addKeyToMap(e,t){this.keyMap[e]=t}static replaceWithValue(e){let t=0,n="";for(;t<=e.length;){const r=e.indexOf("{@P ",t);if(-1===r){n+=e.substring(t,e.length);break}n+=e.substring(t,r);const s=e.indexOf("}",t),a=e.substring(r,s+1);n+=this.keyMap[a],t=s+1}return n}};class pp{GENERIC_BUNDLE_KEY="@BASECLASS!GENERIC!PYGENERICFIELDS";FIELD_LABELS_BUNDLE_KEY="@BASECLASS!LABEL!PYFIELDLABELS";GENERIC_BUNDLE_KEY_LP="GENERIC!GENERICFIELDS";MESSAGE_BUNDLE_KEY="@BASECLASS!MESSAGE!PYMESSAGES";BASE_CLASS="@BASECLASS";DATA_PAGE_LOCALECONTEXT="datapage";constructor(){this.localeStore={},this.getLocaleValue=this.getLocaleValue.bind(this)}setLocaleForRule=(e,t)=>{const n=e.LocaleContent||e;this.localeStore[pp.#e(t)]=n};getLocaleForRule(e=this.#t()){return this.localeStore[pp.#e(e)]}resetLocaleStore=()=>{this.localeStore={}};#n(e){return e?pp.#e(e):this.#t()}#r(e){let t=!1;return e&&"string"==typeof e&&(t=e.includes("@P ")),t}#s(e,t){return t!==this.FIELD_LABELS_BUNDLE_KEY?e?`${e}.fields`:"fields":e}getLocaleValue(e,t,n,r){n=this.#n(n);const s=this.#r(e);s&&(e=dp.formatLocaleKey(e));const a=this.#a(e,n,t,r);return"Messages.fields"===(t=this.#s(t,n))&&"string"==typeof e?this.getLocalizedErrorMessage(a,e)||e:s?dp.replaceWithValue(a[e]||e):a[e]||e}#a(e,t,n,r){t!==this.FIELD_LABELS_BUNDLE_KEY&&(n=n?`${n}.fields`:"fields");let s=this.localeStore[t.toUpperCase()],a=s?Sh.getIn(s,n,{}):{};return!a[e]&&r&&(s=this.localeStore[this.#t().toUpperCase()],a=s?Sh.getIn(s,`${r}.${n}`,{}):{}),a}#t(){return void 0===up.getFeatureMap()?.localizationVersion?this.GENERIC_BUNDLE_KEY:this.GENERIC_BUNDLE_KEY_LP}getParagraphLocaleValue(e,t){const n=`${e}!${j.PARAGRAPH}!${t}`,r=this.localeStore[n.toUpperCase()];return r?decodeURIComponent(atob(r.content).split("").map((e=>`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`)).join("")):null}getPortalLocaleReference(e){return e?`PORTAL!${e}`.toUpperCase():`PORTAL!${up.getPortalName()}`.toUpperCase()}getCaseLocaleReference(e){return e?`CASE!${e}`.toUpperCase():null}getLocalizationVersion(){return up.getFeatureMap().localizationVersion||1}async getLocaleJsons(e){if(!await this.isCurrentLocalePackAvailable())return[];const t=up.getUseLocale(),n=[],r=PCore.getLocaleUtils().localeStore;if((e=(e=e.filter((e=>!r[pp.#e(e)]))).map((e=>e.toUpperCase()))).length>0){const r=e.map((e=>({localeRuleKey:e,promise:Lr.getSvcLocale(t,`${e}.json`)}))),s=await Promise.allSettled(r.map((e=>e.promise)));await Promise.all(s.map((async(e,t)=>{if("fulfilled"===e.status&&null!==e.value){const s=r[t];let a;try{a=await e.value.json()}catch{a=null}a&&n.push({localeRuleKey:s.localeRuleKey,jsonData:a})}})))}return n}async loadLocaleResources(e){const t=up.getUseLocale(),n=up.getBaseLocale();if(up&&t&&(t!==n||"en-US"!==n)&&e?.length>0)try{(await this.getLocaleJsons(e)).forEach((e=>{this.setLocaleForRule(e.jsonData,e.localeRuleKey)}))}catch(e){console.warn(e)}}setTimezone(e){this.timezone=e}getTimeZoneInUse(){const e=Intl.DateTimeFormat().resolvedOptions().timeZone;return this.timezone||e}matchPatternWithText(e,t){let n=t;const r=[];for(let t=0;t<e.length;){const s=e[t];if(0!==s.length){const e=n.indexOf(s);if(-1===e)return null;if(t>0){const t=n.slice(0,e);r.push(t)}n=n.slice(e+s.length)}t+=1}return n&&r.push(n),r}getLocalizedErrorMessage(e,t){let n="";if(e[t])return e[t];for(const r of Object.keys(e)){const s=r.split(/\{\d+\}/),a=this.matchPatternWithText(s,t);if(a){const t=e[r];if(n=this.replacePlaceHolders(a,t),n)return n}}return n}replacePlaceHolders(e,t){for(let n=0;n<e.length;){if(!t.includes(`{${n+1}}`))return"";t=t.replace(`{${n+1}}`,e[n]),n+=1}return t}async isCurrentLocalePackAvailable(){const e=up.getLocale();return this.availableLangPacks?.length||(this.availableLangPacks=up.getAvailableLocalePacks()),e&&this.availableLangPacks.includes(e)}static#e(e){if(!e)return e;const t=e.indexOf("!CASE!");return-1===t?e:`CASE!${e.substring(0,t)}`}getCaseTypeLocaleReferences(){return up.getCaseTypeList().map((e=>`${e.pyWorkTypeImplementationClassName}!CASE!${e.pyWorkTypeName}`.toUpperCase()))}}const hp=new pp;let gp;const fp=e=>{if(e){const t=(new DOMParser).parseFromString(e,"text/html").getElementsByTagName("pega-reference")[0].getAttribute("data-rule-id")??"";if(t){const e=gp.getValue(t);return gp.registerAdditionalProps({[t]:`@P ${t}`}),e}}};const mp=class{static getParagraphStream(e,t){return((e,t)=>{gp=t;const n=e.replace(/<pega-reference(.*?)<\/pega-reference>/g,fp);return/^(<p>)\s*(<\/p>)$/.test(n)?null:n})(e,t)}};Jt.registerHandler("@L",((e,t)=>t.getLocalizedValue(e))),Jt.registerHandler("@P",((e,t,n)=>t?t.getValue(e):Rh.getLitePropertyValue(n))),Jt.registerHandler("@E",((e,t,n)=>{try{const r=Vt(e),s=kt(r);return $t(s,t,n)}catch(e){}return!0})),Jt.registerHandler("@W",((e,t,n)=>{let r;if(t)r=t.getContextDataValue(`.${j.SUMMARY_OF_WHEN_CONDITIONS}.${e}`);else{const{pageReference:t,context:s}=n??{};r=ph(t,`.${j.SUMMARY_OF_WHEN_CONDITIONS}.${e}`,s)}return!0===r||"true"===r})),Jt.registerHandler("@ASSOCIATED",((e,t)=>{let n={};const r=[];let s="",a="";const o=t.getPageReference();if(e.startsWith(".")){s=`${o}.${e.substring(1)}`;const r=e.split(".").filter((e=>!!e));r.length>1&&(r.pop(),a=r.join(".")),n=t.getFieldMetadata(e.substring(1))}else n=t.getFieldMetadata(e),s=e;const i=n?.datasource?.tableType,c=n?.datasource?.mode===j.READONLY,l=n?.datasource?.name||"",u=t.getComponentConfig();if(u&&u.deferDatasource&&(u.datasourceMetadata=`@FIELD_META ${e}`,t.setStateProps({datasourceMetadata:u.datasourceMetadata}),i===j.DATA_PAGE))return null;if(i===j.DECISION||i===j.RULE_REFERENCE)return function(e,t){const n=Qt.getPropertyName(e?.propertyForDisplayText??""),r=Qt.getPropertyName(e?.propertyForValue??""),s=t.getContextDataValue(`.${j.SUMMARY_OF_EXPRESSIONS}.${e?.name}`)||[];return s?.map((e=>({key:e[r]||e[`.${r}`],value:e[n]||e[`.${n}`]})))}(n?.datasource,t);if(i!==j.DATA_PAGE)return n?.datasource?.records;const d=Qt.getPropertyName(n?.datasource?.propertyForDisplayText),p=Qt.getPropertyName(n?.datasource?.propertyForValue),h=Array.isArray(n?.datasource?.parameters)?n?.datasource?.parameters:[],g=t.getContextName(),f=[];if(h.forEach((e=>{if(Qt.isProperty(e?.value)){let t=dh(`.${Sh.getFullPropertyReference([a,Qt.getPropertyName(e.value)])}`,o,g);f.push(Sh.getFullPropertyReference([o,a,Qt.getPropertyName(e?.value)])),null!=t&&""!==t||(t=j.NULL_STRING),r.push(t)}else r.push(e?.value||j.NULL_STRING)})),g){const e=Kt.getContextObjectByName(g)||{};f.forEach((t=>{if(t in e){const n=e[t];e[t]=[...new Set([...n,s])]}else e[t]=[s]})),Kt.addContextName(g,e)}const m=function(e,t,n,r){let s="",a=n;if(t.join(j.HASH_DELIMITER)&&(s=Sh.getHashedString(t.join(j.HASH_DELIMITER)),a=n+j.UNDERSCORE_STRING+s),r){const e=lh(),t=e?e[n]?.[a]:{};return Array.isArray(t?.pxResults)?t.pxResults:[]}const o=(e.getDataObject()[n]||{})[a]||{};return Array.isArray(o?.pxResults)?o.pxResults:[]}(t,r,l,c);return m.map((e=>({key:e[p]||e[`.${p}`],value:e[d]||e[`.${d}`]})))})),Jt.registerHandler("@ROUTING_INFO",((e,t)=>yt(t.getContainerName(),t.getContextName()))),Jt.registerHandler("@ENV",((e,t)=>{switch(e){case j.ENV_INFO_KEYS.APPLICATION_NAME:return up.getApplicationName();case j.ENV_INFO_KEYS.ACCESS_GROUP:return up.getAccessGroup();case j.ENV_INFO_KEYS.USER_NAME:return up.getOperatorName();case j.ENV_INFO_KEYS.USER_ID:return up.getOperatorIdentifier();case j.ENV_INFO_KEYS.APPLICATION_DESC:return t.getLocalizedValue(up.getApplicationLabel()||"");case j.ENV_INFO_KEYS.USER_IMAGE:return up.getOperatorImageInsKey();case j.ENV_INFO_KEYS.LOCALE:return up.getUseLocale();case j.ENV_INFO_KEYS.TIMEZONE:return up.getTimeZone();case j.ENV_INFO_KEYS.WORK_GROUP:return up.getOperatorWorkGroup();default:return e}})),Jt.registerHandler("@DATASOURCE",((e,t)=>{const n=t.getValue(e)||[],r=t.getComponentConfig(),s=Object.keys(r).find((t=>r[t]?.source?.includes(e)));if(s){const{fields:e,copyAll:t}=r[s],a=[];return n.forEach((n=>{const r={};t?Object.keys(n).forEach((e=>{const t=Qt.getPropertyName(e);r[t]=n[t]})):Object.keys(e).forEach((t=>{const s=Qt.getPropertyName(e[t]);r[t]=n[s]})),a.push(r)})),a}return[]})),Jt.registerHandler("@FIELD_META",((e,t)=>{let n,r={};if(r=e.startsWith(".")?t.getFieldMetadata(e.substring(1)):t.getFieldMetadata(e),r&&r.datasource&&r.datasource.parameters){let s="";const a=e.split(".").filter((e=>!!e));if(a.length>1&&(a.pop(),s=`.${a.join(".")}`),Array.isArray(r.datasource.parameters)){const e=[];r.datasource.parameters.forEach((n=>{const r={},{name:a,value:o}=n;r.name=a,"string"==typeof o&&o.startsWith("@P")?r.value=`@P ${s}${o.substring(3)}`:r.value=o,e.push(t.resolveConfigProps(r))})),n=e}else n=t.resolveConfigProps(r.datasource.parameters);r={...r,datasource:{...r.datasource,parameters:n}}}return r})),Jt.registerHandler("@USER",((e,t,n={})=>{const r=t?.getValue(e)||Rh.getLitePropertyValue(n,e),s=t?.getReferencedUser(r)||Rh.getReferencedUser(r,n);return{userId:r,userName:s?s.UserName:null}})),Jt.registerHandler("@ACTIVE_CASES",((e,t)=>Fu.getOpenedCaseItems(`${t.getContextName()}/${t.getContainerName()}`))),Jt.registerHandler("@LR",(e=>e)),Jt.registerHandler("@CASE",((e,t)=>e===j.ID?t.getCaseInfo().getKey():e)),Jt.registerHandler("@SHARED",(e=>ku.getSharedState(e))),Jt.registerHandler("@PARAGRAPH",((e,t)=>{const n=t.getLocalizedParagraphValue(e);return n?mp.getParagraphStream(n,t):null})),Jt.registerHandler("@FILTERED_LIST",((e,t)=>{const n=e.substring(1,e.indexOf("[")),r=e.substring(e.indexOf("]")+2),s=e.substring(e.indexOf("[")+1,e.indexOf("]"));if(!t)return null;const{useCustomContext:a}=t;let o;return Sh.isEmpty(a)?o=t.getValue(`.${n}`):(o=a,o=Sh.getIn(o,n)),o&&r.length>0?(s&&(o=o.filter((e=>Bt(s,e)))),o.map((e=>Sh.getIn(e,r)))):null})),Jt.registerHandler("@ADDRESS",((e,t)=>{const n=t.getValue(e)?.pyCountry;return n?`pyAddressForm_${n}`:"pyAddressForm"})),Jt.registerHandler("@DATATYPE",((e,t)=>t.getValue(e)));const yp="downloadAttachment",Ip={},Ep=e=>{const t=fc();return Ip[e]=t,t},Ap=e=>{let t="document-doc";if(!e)return t;if(e.startsWith("audio"))t="audio";else if(e.startsWith("video"))t="video";else if(e.startsWith("image"))t="picture";else if(e.includes("pdf"))t="document-pdf";else{const[,n]=e.split("/"),r=e=>e.some((e=>n.includes(e)));r(["excel","spreadsheet"])?t="document-xls":r(["zip","compressed","gzip","rar","tar"])&&(t="document-compress")}return t},_p=e=>{let t,n,r,s;return t=e.pyCategoryLabel?`${e.pyCategoryLabel},`:e.pyCategoryName?`${e.pyCategoryName},`:e.Category,n=e.pxCreateOpName?e.pxCreateOpName:e.pxCreateOperator?e.pxCreateOperator:e.CreateUser?.Name||"",r=e.pyFileName?e.pyFileName:e.FileExtension&&""!==e.FileExtension&&e.FileName.endsWith(e.FileExtension)?e.FileName.substring(0,e.FileName.lastIndexOf(e.FileExtension)-1):e.FileName,s=e.pyAttachName&&e.pyFileName?e.pyAttachName.startsWith(e.pyFileName)&&e.pyAttachName.split(".").length-1===e.pyFileName.split(".").length?e.pyAttachName.split(".").pop():"":e.FileExtension,{props:{meta:`${t} ${n}`,name:e.pyAttachName?e.pyAttachName:e.FileName,icon:Ap(e.pyMimeFileExtension||e.MimeType)},responseProps:{fileName:e.pyAttachName?e.pyAttachName:e.FileName,name:r,category:e.pyCategoryName?e.pyCategoryName:e.Category,extension:s,ID:e.pzInsKey?e.pzInsKey:e.ID,mimeType:e.pyMimeFileExtension?e.pyMimeFileExtension:e.MimeType,attachmentURL:e.pyAttachmentLink?e.pyAttachmentLink:e.AttachmentURL,createUser:n,createDateTime:e.pxCreateDateTime?e.pxCreateDateTime:e.CreateDateTime,responseType:e.responseType??(e.ID?"binary":null)}}},Cp={uploadAttachment:(e,t,n,r)=>{const s=new FormData;s.append("appendUniqueIdToFileName",!0),s.append("file",e);const{restApi:a,reqType:o}=Ng("uploadAttachment",{});return pc(a,{method:o,headers:{"Content-Type":"multipart/form-data"},body:s,onUploadProgress:t,signal:Ep(e.ID).token},r).then((t=>({type:"File",category:e.category||"File",ID:t.data.ID,clientFileID:e.ID,filename:e.name}))).catch(n?n(mc,e):e=>{throw e.isHandled=!1,e}).finally((()=>delete Ip[e.ID]))},linkAttachmentsToCase:(e,t,n,r)=>{const s={};if("File"===n){const[e]=t,{clientFileID:n}=e;delete e.clientFileID,s.signal=Ep(n).token}const{restApi:a,reqType:o}=Ng("linkCaseAttachment",{caseID:e});return pc(a,{...s,body:{attachments:t},method:o},r)},getCaseAttachments:(e,t,n=!1)=>{const{restApi:r,reqType:s}=Ng("getCaseAttachments",{caseID:e,includeThumbnail:n});return pc(r,{method:s},t).then((e=>e.data.attachments))},getAttachmentCategories:(e,t,n)=>{const{restApi:r,reqType:s}=Ng("getAttachmentCategories",{caseID:e,type:t});return pc(r,{method:s},n).then((e=>e.data))},downloadAttachment:(e,t,n)=>{const{restApi:r,reqType:s}=Ng(yp,{attachmentID:e});return pc(r,{method:s,..."binary"===n&&{responseType:"arraybuffer"}},t)},editAttachment:(e,t,n)=>{const{restApi:r,reqType:s}=Ng("editAttachment",{attachmentID:e});return pc(r,{method:s,body:{...t}},n)},deleteAttachment:(e,t)=>{const{restApi:n,reqType:r}=Ng("deleteAttachment",{attachmentID:e});return pc(n,{method:r},t)},downloadDocument:(e,t)=>{const{restApi:n,reqType:r}=Ng("downloadDocument",{documentID:e});return pc(n,{method:r},t)},deleteDocument:(e,t,n)=>{const{restApi:r,reqType:s}=Ng("deleteDocument",{caseID:e,documentID:t});return pc(r,{method:s},n)},getDocumentURL:e=>{const t=PCore.getEnvironmentInfo().getDocumentUrlDP()||"D_pxGetDocumentURL";return PCore.getDataPageUtils().getPageDataAsync(t,e.getContextName(),{},{invalidateCache:!0}).catch((t=>{e.reportError(": Error occurred during ajax call getDocumentURL API : ",t.response)}))},cancelRequest:e=>{Ip[e]&&(Ip[e].cancel(),delete Ip[e])},buildFilePropsFromResponse:_p,getAttachmentURL:e=>{const{restApi:t}=Ng(yp,{attachmentID:e});return t},prepareAttachmentData:e=>{let t=[];if(e&&Object.hasOwn(e,"pyCount")&&e.pyCount>0)t=e?.pxResults?.filter((e=>!!e.pzInsKey)).map((e=>_p(e)))||[];else if(e&&"object"==typeof e){let n;n=Array.isArray(e)?e:[e],t=n?.filter((e=>e.ID&&e.FileName||e.pzInsKey)).map(_p)}else t=[];return{hasUploadedFiles:t.length>0,categoryName:e?.pyCategoryName||t?.[0]?.responseProps?.category||"",attachments:t}}};Jt.registerHandler("@ATTACHMENT",((e,t,n)=>{let r;return r=t?t.getValue(e):Rh.getLitePropertyValue(n),Cp.prepareAttachmentData(r)})),Jt.registerHandler("@FL",((e,t)=>t.getLocalizedValueForFieldLabel(t.getFieldMetadata(e)?.label))),Jt.registerHandler("@GENAICOACH",((e,t)=>Yp(e,t.getCurrentClassID()))),Jt.registerHandler("@REFRESH",((e,t)=>{const n=t.getCaseInfo().getKey(),r=t.getContextName(),s=t.getPageReference();hl.registerForRefresh("PROP_CHANGE",t.getActionsApi().refreshCaseView.bind(t.getActionsApi(),n,"",s,{autoDetectRefresh:!0,preserveClientChanges:!1,refreshFor:!0}),`${s}${e}`,`${r}/${s}`,r)}));const Sp={},Tp={},Np={},Pp={},Rp={},Dp={},bp={},Op={},vp={},xp={},wp=(e={},t={})=>{0!==Object.keys(t).length?Object.keys(e).forEach((n=>{const r=e[n],s=t[n];if(s){const e=Array.isArray(s)?s:[s];(Array.isArray(r)?r:[r]).forEach((t=>{const n=e.findIndex((e=>e.classID===t.classID));if(-1===n)e.push(t);else{const r={isDeclarativeTarget:!1},s={...e[n],...r,...t};e[n]=s}})),t[n]=1===e.length?e[0]:e}else t[n]=r})):Sh.copy(e,t)},Mp=(e,t="")=>{if(!e)return null;const n=Pp[e];if(!n)return null;if(!t)return Array.isArray(n)?[...n]:n;let r;return r=Array.isArray(n)?n.find((e=>e.classID.toLowerCase()===t.toLowerCase()))||null:n.classID.toLowerCase()===t.toLowerCase()||("Page"===n.type||"Page List"===n.type)&&n?.pageClass?.toLowerCase()===t.toLowerCase()?n:null,r},Lp=(e,t,n,r=[])=>{if(!t||!e)return null;if(!e.includes(".")){let s;const a=Mp(e,t);return r.length&&(s=r.join(".")),{...a,embeddedType:n,category:s}}const[s,...a]=e.split("."),o=Mp(s,t);return o&&r.push(o.label),Lp(a.join("."),o?.pageClass,o?.type,r)},Up=e=>{wp(e,Tp)},Fp=e=>{wp(e,Np)},jp=e=>{if(e.views&&wp(e.views,Tp),e.navigations&&wp(e.navigations,Np),e.personalizations&&wp(e.personalizations,Dp),e.insights&&wp(e.insights,bp),e.paragraphs&&wp(e.paragraphs,Sp),e.dataTypes&&wp(e.dataTypes,Op),e.datapages&&wp(e.datapages,vp),e.genAICoaches&&wp(e.genAICoaches,xp),e.fields){Object.keys(e.fields).forEach((t=>{const n=e.fields[t];if(Array.isArray(n)){if(e.datapages&&n.forEach((t=>{t.datasource&&"DataPage"===t.datasource.tableType&&(t.datasource.mode=e.datapages[t.datasource.name].mode)})),1===n.length){const[r]=n;e.fields[t]=r}}else e.datapages&&n.datasource&&"DataPage"===n.datasource.tableType&&(n.datasource.mode=e.datapages[n.datasource.name].mode)}));const{datapages:t={}}=e;Object.keys(t).forEach((e=>{Rp[e]=t[e]}))}wp(e.fields,Pp)},Vp=e=>Tp[e],kp=(e,t)=>{const n=Tp[e];return Array.isArray(n)?n.some((e=>e.classID===t)):n?.classID===t},$p=e=>Np[e],Bp=e=>e in Rp?Rp[e]:null,Gp=e=>e in Dp?Dp[e]:null,Wp=e=>e in bp?bp[e]:null,Hp=e=>{const t={};return Object.keys(Pp).forEach((n=>{const r=Pp[n];let s;Array.isArray(r)?s=r.find((t=>e===t.classID)):e===r.classID&&(s=r),s&&(t[n]=Sh.deepClone(s))})),t},qp=(e,t)=>{const n=Mp(e,t)?.datasource?.parameters;return n?Sh.deepClone(n):null},zp=(e,t)=>{let n=null;const r=Sp[e];return r&&(Array.isArray(r)?n=r.find((e=>e.classID===t)):r.classID===t&&(n=r)),n?Sh.deepClone(n):null},Yp=(e,t)=>{let n=null;const r=xp[e];return r&&(Array.isArray(r)?n=r.find((e=>e.classID===t)):r.classID===t&&(n=r)),n?Sh.deepClone(n):null},Kp=e=>{if(e in Op){const{savableDataPage:t}=Op[e];return t}return null},Xp=e=>{const t=vp[e];if(!t)return null;const{classID:n,isAlternateKeyStorage:r,parameters:s}=t;if(r)return s.map((e=>({keyName:e.name,isAlternateKeyStorage:r,linkedField:e.linkedField})));const a=Op[n];return a?a.classKeys.map((e=>({keyName:e,isAlternateKeyStorage:r}))):[]},Jp=e=>{if(e in Op){const{lookupDataPage:t}=Op[e];return t}return null},Qp=e=>{if(Object.prototype.hasOwnProperty.call(Op,e)){const{lookupDataPageInfo:t}=Op[e];return t}return null},Zp=(e,t)=>{const n=e.split("."),r=n.pop(),s=new Ku({options:{pageReference:`${n.join(".")}`,context:t}}),a=Mp(r,s.getCurrentClassID())?.additionalInformation;if(!a?.includes("@PARAGRAPH"))return a;const o=Qt.trimAnnotation(a),i=s.getCurrentClassID(),c=zp(o,i),l=c?.definedOnClassID,u=hp.getParagraphLocaleValue(l||i,o);return u?mp.getParagraphStream(u,s):c?.content?mp.getParagraphStream(c.content,s):null},eh=(e,t)=>{const n=e.split("."),r=n.pop(),s=new Ku({options:{pageReference:`${n.join(".")}`,context:t}}),a=Mp(r,s.getCurrentClassID()),o={};return s._classID=s.getCurrentClassID(),s.resolveConfigProps(a,o),o};class th{constructor(){this.name="CascadeManager",this.cascadeSubscribers={},this.cascadeResetSubscribers={},this.listChangeSubscribers=[]}registerResetDependencies(e,t,n,r,s,a="singleRecord"){if(!e||!n||!r?.length)return;const o=n.startsWith(".")?`${t}.${n.substring(1)}`:n,i=this.cascadeResetSubscribers[e]||{},c=this._handlePageReference(t,n,s);r.forEach((e=>{if(!e)return;let t=e.startsWith(".")?e.substring(1):e;if(t=Sh.getFullPropertyReference([c,t]),t in i){const e=i[t];e.find((e=>e.propertyName===o))||e.push({propertyName:o,mode:a})}else i[t]=[{propertyName:o,mode:a}]})),Object.keys(i).length>0&&(this.cascadeResetSubscribers[e]=i)}deregisterResetDependencies(e,t,n,r,s){if(!e||!n||!r?.length)return;const a=n.startsWith(".")?`${t}.${n.substring(1)}`:n,o=this.cascadeResetSubscribers[e]||{},i=this._handlePageReference(t,n,s);r.forEach((e=>{if(e){let t=e.startsWith(".")?e.substring(1):e;if(t=Sh.getFullPropertyReference([i,t]),t in o){const e=o[t];Sh.removeExistingDependentProperty(e,a)}}})),Object.keys(o).length>0&&(this.cascadeResetSubscribers[e]=o)}getResetDependencies(e,t){return this.cascadeResetSubscribers[e]?.[t]||[]}purgeResetDependencies(e){e&&this.cascadeResetSubscribers[e]&&delete this.cascadeResetSubscribers[e]}registerFields(e,t,n,r,s){this.cascadeSubscribers[e]=this.cascadeSubscribers[e]||{},n?.forEach((n=>{this.cascadeSubscribers[e][`${t}${n}`]=this.cascadeSubscribers[e][`${t}${n}`]||{};const a=this.cascadeSubscribers[e][`${t}${n}`];if(!a[s]){a[s]=r;const o=dh(n,t,e);a.previousValue="object"==typeof o?null:o}}))}registerListField(e,t,n,r,s){const a=th._getFieldsForList(e,t,n);a.length>0&&(this.registerFields(e,t,a,r,s),ru.enableCascade(e))}unRegisterListField(e,t,n,r){const s=th._getFieldsForList(e,t,n);s.length>0&&this.unRegisterFields(e,t,s,r)}static _getFieldsForList(e,t,n){const r=[],s=Mp(n,dh("classID",t,e));return s&&!Array.isArray(s)&&s.datasource&&s.datasource.parameters&&Object.values(s.datasource.parameters).forEach((e=>{if(Qt.isProperty(e)){const t=Qt.trimAnnotation(e);r.push(t)}})),r}unRegisterFields(e,t,n,r){this.cascadeSubscribers[e]&&n?.forEach((n=>{if(!this.cascadeSubscribers[e][`${t}${n}`])return;const s=this.cascadeSubscribers[e][`${t}${n}`];s[r]&&delete s[r]}))}triggerCascade(e,t,n,r){let s=!1;this.cascadeSubscribers[e]&&this.cascadeSubscribers[e][t]&&(Object.keys(this.cascadeSubscribers[e][t]).forEach((a=>{const o=this.cascadeSubscribers[e][t];"previousValue"!==a&&o.previousValue!==n&&(s=!0,r?r.add(o[a]):o[a](t,n))})),s&&(this.cascadeSubscribers[e][t].previousValue=n))}purgeCascadeFields(e){delete this.cascadeSubscribers[e]}handleServerChanges(e,t=[],n=[]){if(!e)return;const r=new Set;n.forEach((t=>{const n=dh(t,"",e);this.triggerCascade(e,t,n,r)})),r.forEach((e=>{e()})),0!==this.listChangeSubscribers.length&&0!==t.length&&t.forEach((t=>{this.listChangeSubscribers.forEach((n=>{const r=dh(t,"",e);n(e,t,r)}))}))}_updateChangedProperties(e,t,n,r,s,a,o){if(e!==t){const e=r.lastIndexOf("."),t=r.substring(0,e),i=r.substring(e),c=Zn.getMessages({type:"error",property:i,context:s,pageReference:t});if(c?.length>0&&o.push(r),!n)return;a.push(r)}}_getServerProperties(e,t,n,r,s,a){if("object"!=typeof e){s.push(n.replace(/\.(\d+)/g,"[$1]"));let o=!0;0!==this.listChangeSubscribers.length&&Sh.isValidPageListProperty(n)||(o=!1),n=n.replace(/\.(\d+)/g,"[$1]");const i=dh(n,"",t);if(void 0===i&&!e&&0!==e)return;return void this._updateChangedProperties(i,e,o,n,t,r,a)}const o=Object.keys(e??{});for(let i=0,c=o.length;i<c;i+=1){const c=o[i],l=`${n}.${c}`;this._getServerProperties(e[c],t,l,r,s,a)}}getServerProperties(e,t,n=j.CASE_INFO.CASE_INFO_CONTENT){const r=[],s=[],a=[],o=Sh.getIn(e,n);return o&&t?(this._getServerProperties(o,t,n,r,a,s),{changedListProperty:r,leafProperty:a,changedPropertyWithError:s}):{changedListProperty:r,leafProperty:a,changedPropertyWithError:s}}_handlePageReference(e,t,n){let r=e;if("Page"===n&&t.startsWith(".")&&t.slice(1).includes(".")){r=`${e}${t.substring(0,t.lastIndexOf("."))}`}return r}registerForListChanges(e=(()=>{})){this.listChangeSubscribers.push(e)}unRegisterForListChanges(){this.listChangeSubscribers=[]}}const nh=new th;let rh=null;const sh=e=>e?.split(/\.(?![^[]+\])|\[|\]/g).filter(Boolean),ah=e=>{rh=e},oh=()=>rh,ih=e=>{if(!e)return;let t=[],n=[],r=[];Array.isArray(e)||"MERGE_DATA"!==e.type||({changedListProperty:t,leafProperty:n,changedPropertyWithError:r}=nh.getServerProperties(e.payload.data,e.payload.context,e.payload.rootPageReference)),oh()?.dispatch(e),Array.isArray(e)||"MERGE_DATA"!==e.type||(r.forEach((t=>{const n=t.lastIndexOf("."),r=t.substring(0,n),s=t.substring(n);Zn.clearMessages({type:"error",property:s,pageReference:r,context:e.payload.context});const a=Pn.getFieldReferenceForProperty(e.payload.context,t),o=Rh.resolveContextTreeNodeProps(a.props);vr.validate(o.componentName?.toLowerCase(),o.propertyName,Rh.getLitePropertyValue(o,o.propertyName),o)})),nh.handleServerChanges(e.payload.context,t,n))},ch=e=>oh()?.getState().data?.[e],lh=()=>oh()?.getState().data[j.SHARED],uh=(e,t,n)=>{if(!(r=e)||r.startsWith('"')||r.startsWith("'"))return(e=>e&&e.trim().substring(1,e.length-1))(e);var r;const s=e?.startsWith(".")?t+e:e,a=sh(s);return Sh.getIn(n,a)},dh=(e,t,n)=>uh(e,t,ch(n)),ph=(e,t,n)=>uh(t,e?`${j.CONTEXT_DATA}.${e}`:`${j.CONTEXT_DATA}`,ch(n)),hh=(e,t,n)=>((e,t,n)=>{const r=sh(`${t}.${n}`);return Sh.getIn(e,r)})(ch(n),`${j.CONTEXT_DATA}.${e}`,t),gh=e=>{const{context:t}=e,n=oh()?.getState().data[t];if(n)return de;const{action:r}=e;return["createWork","showHarness","openAssignment","openWorkByHandle","initRouting"].includes(r)?Ce:de},fh=(e,t)=>{const n=sh(t);return Sh.deleteIn(e,n)},mh=e=>!Array.isArray(e)&&"object"==typeof e,yh=(e,t,n={})=>{const{isArrayDeepMerge:r,propertiesToReplace:s=[]}=n;Array.isArray(e)&&!t&&(t=[]),Array.isArray(s)&&s.length>0&&s.forEach((t=>{Sh.setIn(e,t,{})}));const a=(e,t)=>{if(mh(e)&&null!==t&&"string"!=typeof t&&"number"!=typeof t&&"boolean"!=typeof t)return w()(e,t,a);if(Array.isArray(e)&&null!==t&&Array.isArray(t)){if(r)return w()(e,t,a);{const n=t.length;if(void 0===r&&n===e.length)return w()(e,t,a)}}return""===t&&e&&"object"==typeof e?e:t};return a(e,t)},Ih=(e,t,n,r={isArrayDeepMerge:!0})=>{const{isArrayDeepMerge:s}=r,a=sh(t);if("object"==typeof n){const t=yh(Sh.getIn(e,a),n,{isArrayDeepMerge:s});return Sh.setIn(e,a,t)}return Sh.setIn(e,a,n)},Eh=(e,t,n)=>{const r=sh(t);return Sh.setIn(e,r,n)},Ah=()=>{const e=Ze,{promise:t,actionMgrID:n}=ln.actionManagerPromise(e);return ih({type:e,payload:{actionMgrID:n}}),t},_h=e=>{const t=oh()?.getState();return!!t?.data?.[e]};class Ch{static mergeDeep(e,t){return w()(t,e)}static hasIn(e,t){return R()(e,t)}static getIn(e,t,n){return b()(e,t,n)}static setIn(e,t,n){return v()(e,t,n)}static deleteIn(e,t){return N()(e,t)}static isObjectEmpty(e){return!e||0===Object.entries(e).length}static isEmpty(e){return L()(e)}static deepClone(e={}){return JSON.parse(JSON.stringify(e))}static copy(e,t){Object.keys(e).forEach((n=>{t[n]=e[n]}))}static isPropertyRef(e){if(!e||-1===e.indexOf("."))return!1;let t=0;const n=e.length;for(;t<n;t+=1)if(" @#$%=!<>/\\".includes(e[t]))return!1;return!0}static isWhenExist(e){const t=["visibility","disabled","readOnly","required"];let n=!1;for(const r in e)t.includes(r)&&"string"==typeof e[r]&&e[r]?.startsWith("@W ")&&(n=!0);return n||"multirecordlist"!==e?.type||"Editable"!==e?.renderMode||(n=Object.keys(e?.allowActions??{}).some((t=>"string"==typeof e?.allowActions?.[t]&&e.allowActions[t]?.startsWith("@W ")))),n}static getWhenNames(e){const t=["visibility","disabled","readOnly","required"];let n="";const r=new Set;for(const s in e)t.includes(s)&&"string"==typeof e[s]&&e[s]?.startsWith("@W ")&&(n=Qt.trimAnnotation(e[s]),r.add(n));return"multirecordlist"===e?.type&&"Editable"===e?.renderMode&&Object.keys(e?.allowActions??{}).forEach((t=>{"string"==typeof e?.allowActions[t]&&e.allowActions[t]?.startsWith("@W ")&&(n=Qt.trimAnnotation(e.allowActions[t]),r.add(n))})),[...r]}static isExpressionExist(e){const t=["disabled","visibility","readOnly","required"];let n=!1;for(const r in e)t.includes(r)&&"string"==typeof e[r]&&e[r]?.startsWith("@E ")&&(n=!0);return n}static buildDataObject(e,t){let n={};const r=n;if(t.indexOf(".")>0){t.split(".").forEach((e=>{if(e.includes("[")){const[t]=e.split("[");n[t]=[],n=n[t],e=e.substring(e.indexOf("[")+1,e.lastIndexOf("]"))}n[e]={},n=n[e]}))}else n[t]={},n=n[t];return Object.keys(e).forEach((t=>{let r=t;t.startsWith(".")&&(r=t.substring(1)),n[r]=e[t]})),r}static buildObject=(e,t,n)=>{if(void 0===n)return;const r=e.split(".");let s=0;for(;s<r.length-1;s+=1){const e=r[s];e?.toString().length&&!t[e]&&(t[e]={}),t[e]&&(t=t[e])}"object"==typeof n?(t[r[s]]||(t[r[s]]=Array.isArray(n)?[]:{}),yh(t[r[s]],n,{isArrayDeepMerge:!0})):t[r[s]]=n};static getHashedString(e){return(0,S.crc32)(e).toString(16)}static getPropertyName(e){if(e){const t=e.startsWith("@P"),n=t?e.indexOf(" "):-1;return t?e.substring(n+2):e}return e}static getPropertyNameFromDependency(e){return"string"==typeof e?e:e.propertyName}static isValidJson(e){try{return JSON.parse(e)}catch(e){return console.error("not a Valid JSON",e),!1}}static isEqual(e,t){return h()(e,t)}static isContains(e,t){const n=Object.keys(e);for(let r=0;r<n.length;r+=1)if(e[n[r]]&&Ch.isEqual(e[n[r]],t))return!0;return!1}static removeExistingDependentProperty(e,t){const n=e.findIndex((e=>e.propertyName===t));n>=0&&e.splice(n,1)}static getFullPropertyReference(e){return Array.isArray(e)?e.filter((e=>!!e)).join("."):""}static iterateLeafNodes(e,t){const n=(e,r=[])=>{Object.entries(e).forEach((([s,a])=>{r.push(Array.isArray(e)?Number(s):s),Array.isArray(a)?a.forEach(((e,t)=>{r.push(t),n(e,r),r.pop()})):"object"==typeof a?n(a,r):t(r.slice(),a),r.pop()}))};n(e)}static resolveStringBooleans(e){const t=["required","readOnly","visibility"];return Object.keys(e).forEach((n=>{t.includes(n)&&"string"==typeof e[n]&&(e[n]="true"===e[n])})),e}static generateUniqueID(){return crypto.randomUUID()}static unflatten(e){const t={};return Object.entries(e).forEach((([e,n])=>{const r=e.split(".");let s;r.reduce(((e,t,a)=>(s=e[t]?e[t]:Number.isNaN(Number(r[a+1]))?r.length-1===a?n:{}:[],e[t]=s,e[t])),t)})),t}static flatten(e,t,n){t||(t=""),Array.isArray(e)?e.forEach(((e,r)=>{Ch.flatten(e,`${t}[${r}]`,n)})):"object"==typeof e&&null!==e?Object.keys(e).forEach((r=>{const s=t?`${t}.${r}`:r;Ch.flatten(e[r],s,n)})):n[t]=e}static buildInstructionPageReference(e,t){const n=`${e}${t}`.replace(j.CASE_INFO.CASE_INFO_CONTENT,"").replace(j.DATA_INFO.DATA_INFO_CONTENT,"");return kn.formatPageReference(n)}static buildAttachmentsFormData(e){return e.map((e=>{if(e.delete){let t="";return t=e.responseProps.ID?e.responseProps.ID:e.responseProps.pzInsKey,{type:"File",attachmentFieldName:e.label,delete:!0,pzInsKey:t}}return{type:"File",attachmentFieldName:e.label,category:e.category,ID:e.handle,clientFileID:e.ID}}))}static convertPageRefToClipboardPageNotation(e){return e.replace(/\[\d+\]/g,(e=>e.replace(/\d+/g,(e=>`${parseInt(e,10)+1}`)).replace("[","(").replace("]",")")))}static convertClipboardPageToPageRefNotation(e){return e.replace(/\(\d+\)/g,(e=>e.replace(/\d+/g,(e=>""+(parseInt(e,10)-1))).replace("(","[").replace(")","]")))}static isString(e){return"string"==typeof e}static rejectPendingActions(e){return e.forEach((e=>e.payload.actionMgrID&&ln.rejectActionByID(e.payload.actionMgrID))),!0}static isValidAnnotation(e){const t=new Set(["@DATASOURCE","@ACTIVE_CASES","@ADDRESS","@ASSOCIATED","@ATTACHMENT","@CASE","@FILTERED_LIST","@PARAGRAPH","@P","@ROUTING_INFO","@USER","@W","@E","@SHARED"]),n=e.indexOf(" "),r=e.substring(0,n);return t.has(r)}static trimDotForProperty(e){return"string"==typeof e&&e.startsWith(".")?e.substring(1):e}static convertObjectWithStringToBoolean(e){if(e&&!Array.isArray(e)&&"object"==typeof e)return Object.keys(e).forEach((t=>{let n;const r=e[t];n="string"==typeof r?"true"===r||"false"!==r&&r:r,e[t]=n})),e}static isValidPageListProperty(e){return!!e&&/^(?!.*\.\.)(?!\d)\w+(\.\w+)*\.\d+(\.\w+)+$/.test(e)}}const Sh=Ch,Th=j.SUMMARY_OF_LISTS,Nh=j.SUMMARY_OF_WHEN_CONDITIONS;class Ph{static updateData(e){Object.keys(e).forEach((t=>{ih(wh({context:t,data:e[t]}))}))}static updateContextData(e){Object.keys(e).forEach((t=>{ih(wh({context:t,data:e[t]}))}))}static resolveWhen(e,t){return!!t.getContextDataValue(`.${Nh}.${e}`)}static resolveFieldValue(e,t){return t.getLocalizedValue(e)}static resolveNavigation(e,t){return $p([this.resolveName(e,t)])}static resolveView(e,t,n=""){const r=Vp([this.resolveName(e,t)]);let s=[];if(Array.isArray(r)&&r.length>0){if(t&&r.length>1){if(n||(n=t.getValue(j.CLASS_ID)),!n)return;s=r.filter((e=>e[j.CLASSID]===n))}return 0===s.length?r[0]:s[0]}return r}static resolveName(e,t){return e&&"string"==typeof e&&e.startsWith("param.")?(e=e.substring(6),t.getContextDataValue(`.$parameters.${e}`)):(e&&"string"==typeof e&&e.startsWith("@")&&(e=Qt.handleAnnotation(e,t)),e)}static getContextPath(e,t){return("number"==typeof t||t)&&("number"==typeof(t=Qt.trimAnnotation(t))||"string"==typeof t)?"number"==typeof t&&parseInt(t,10)===t?`${e}[${t}]`:t.startsWith(".")?e+t:`${t}`:e}static getRuleClass(e,t,n){let r;return t?r=t.startsWith(j.CLASS_ANNOTATION)?t.split(j.CLASS_ANNOTATION)[1].trim():this.resolveClassID(t,e.getPageReference(),e.getContextName()):n?.authorContext&&(r=n.ruleClass),r}static resolveReference(e,t){const{type:n}=e;let r;if("reference"===n){const{config:n}=e,s=n?.type,{ref:a,name:o,context:i}=n||{},c=this.getRuleClass(t,i,n);return"navigation"===s?r=this.resolveNavigation(a||o,t):"view"===s?r=this.resolveView(a||o,t,c||""):"widget"===s&&(r={type:"Widget",config:{name:o,ruleClass:c}}),r}return e}static resolvePropertyReference(e,t,n){return dh(t,e,n)}static getProperty(e,t,n){let r=this.resolvePropertyReference(t,e,n);if(null==r||0===r.length){const s=hh(`${t}.${Th}`,e,n);s&&(r=this.resolvePropertyReference(t,s,n))}return r}static getPropertyValue(e,t,n){return e=Qt.trimAnnotation(e),this.getProperty(e,t,n)}static getReferencedUser(e,t){const n=Ph.getLitePropertyValue(t,"referencedUsers");if(Array.isArray(n)){const t=n.find((t=>t.UserID===e));if(t)return{userId:t.UserID,UserName:t.UserName}}return n?.[e]}static getLitePropertyValue(e,t){if(!e)return;const{useCustomContext:n,propertyName:r,hasSuggestions:s,pageReference:a,context:o}=e;let i=t||r;return n?(i=i?.startsWith?.(".")?i.substring(1):i,i?.split?.(".").reduce(((e,t)=>e?.[t]??void 0),n)):s?Ph.getPropertyValue(i,a,`${o}/${j.SUGGESTION}`):Ph.getPropertyValue(i,a,o)}static _handlePropString(e,t,n,r,s){n.startsWith("@")?e[t]=Qt.handleAnnotation(n,r,s):e[t]=n}static _resolveProps(e,t,n){e&&Object.keys(e).forEach((r=>{const s=e[r];"string"==typeof s?this._handlePropString(e,r,s,t,n):Array.isArray(s)?s.forEach((r=>{this._resolveProps("object"==typeof r?r:e[r],t,n)})):"object"==typeof s&&this._resolveProps(e[r],t,n)}))}static resolveProps(e,t,n){return e&&t?(Sh.mergeDeep(e,t),this._resolveProps(t,n,void 0),t):t}static resolveContextTreeNodeProps(e){const t={};return e?(Sh.mergeDeep(e,t),this._resolveProps(t,void 0,e),Sh.resolveStringBooleans(t)):t}static resolveClassID(e,t,n){const r=Qt.trimAnnotation(e);let s;for(s=r.startsWith(".")?`${t}${r}`:`${r}`;s;){const e=dh(j.CLASS_ID,s,n);if(e)return e;s=s.substring(0,s.lastIndexOf("."))}return null}}const Rh=Ph;const Dh=new class{constructor(){this.actionHandlers={}}getHandler(e){return this.actionHandlers[e]}registerHandler(e,t){this.actionHandlers[e]=t}};const bh=class{static#o=[];static#i=!1;static getActionHandlers=(e,t,n)=>{const r=[];return{mouseenter:"hover",change:"onChange",blur:"onBlur"}[n]!==t||e.forEach((e=>{const t=Dh.getHandler(e.action),{config:n}=e;r.push({handler:t,config:n})})),r};static isEditable=e=>{const{tagName:t}=e;return"INPUT"===t||"TEXTAREA"===t||"SELECT"===t||"DATETIME"===t};static isNonKeyInput=e=>{const{tagName:t,type:n}=e;return"SELECT"===t||"checkbox"===n||"radio"===n};static#c=(e,t,n)=>{for(let r=0;r<e.length;r+=1){const s=e[r],a={actionHandler:s.handler,component:t,eventType:n,config:s.config};this.#o.push(a)}};static buildActionObject=(e,t)=>{const n={...e};return n.context="Browser"===up.getRuntime()?t.getContextName():n.context,n.pageReference=t.getPageReference(),n.actionMgrID=ln.getNextActionMgrId(),n};static#l=e=>{const t=e.actionHandler,n=e.component,{config:r}=e,s={};Rh.resolveProps(r,s,n),t&&(t(e.eventType,s,n),this.#u())};static#u=()=>{if(!this.#i){if(0===this.#o.length)return;const e=this.#o.shift();this.#l(e),e.config&&"true"===e.config.parallel&&this.#o.length>0&&this.#u()}};static#d=()=>{this.#u()};static#p=(e,t,n)=>{this.#c(e,t,n),this.#d()};static getFullRef=e=>{const t=e.getPageReference(),n=e.getComponentConfig().value;return Rh.getContextPath(t,n)};static#h(e,t){const n=e.getComponentConfig().behaviours||[];for(let r=0;r<n.length;r+=1){const{behaviour:s,actions:a}=n[r];if(a){const n=this.getActionHandlers(a,s,t);n&&n.length>0&&this.#p(n,e,t)}}}static changeHandler=(e,t)=>{const n=e.getStateProps().value,r=e.getContextName();zn({type:F.MESSAGES.MESSAGES_TYPE_ERROR,property:n,pageReference:e.getPageReference(),context:r});if(("Browser"===up.getRuntime()?t?.nativeEvent instanceof Event||t instanceof Event:!!t?.nativeEvent)||null!==t.value&&void 0===t.prop){let{target:n}=t;null===n&&t&&t.auxiliaryTarget&&(n=t.auxiliaryTarget);const s=void 0===n?t.value:"value"in n?n.value:n.innerText,a=this.getFullRef(e);ih({type:Q,payload:{reference:a,value:s,context:r}}),void 0!==n&&this.isEditable(n)&&!this.isNonKeyInput(n)||ih({type:ee,payload:{reference:a,pageReference:e.getPageReference(),value:s,context:r,propertyName:e.getComponentConfig().value,classID:e.getValue(j.CLASS_ID)}})}else{const n=e.getPageReference(),s=e.getStateProps();for(const e of Object.keys(t)){const a=s[e],o=t[e];ih({type:Q,payload:{reference:Rh.getContextPath(n,a),value:o,context:r}}),ih({type:ee,payload:{reference:Rh.getContextPath(n,a),value:o,context:r}})}}};static blurHandler=(e,t)=>{let{target:n}=t;null===n&&t&&"auxiliaryTarget"in t&&(n=t.auxiliaryTarget);const{value:r,validationValue:s}=n,a=this.getFullRef(e),o=e.getContextName();n.clearMessages&&zn({type:F.MESSAGES.MESSAGES_TYPE_ERROR,property:e.getStateProps().value,pageReference:e.getPageReference(),context:o}),this.isEditable(n)&&(e.getValidationApi().validate("validationValue"in n?s:r),e.isInsideList()&&e.getListActions().updateProperty(e.getStateProps().value,r),!this.isNonKeyInput(n)&&ih({type:ee,payload:{reference:a,pageReference:e.getPageReference(),value:r,context:o,propertyName:e.getComponentConfig().value,classID:e.getValue(j.CLASS_ID)}}))};static eventHandler=(e,t)=>{const{type:n}=t;switch(n){case"change":this.changeHandler(e,t);break;case"blur":this.blurHandler(e,t)}n&&this.#h(e,n)};static pause=()=>{this.#i=!0};static resume=()=>{this.#i=!1,this.#u()};static isQueueEmpty=()=>0===this.#o.length;static clearQueue=()=>{this.#o=[]};static getActionsQueue=()=>this.#o;static EVENTS_MAP={click:"onClick",change:"onChange",hover:"onMouseEnter",blur:"onBlur"}},Oh="CREATE_WORK",vh=e=>({type:Oh,payload:e});const xh=(e,t,n,r="")=>{const s=[];Object.keys(e).forEach((a=>{"object"==typeof e[a]&&a.includes("[")?function(e,t,n,r,s,a){const o=r.substring(0,r.indexOf("[")),i=r.substring(r.indexOf("[")+1,r.indexOf("]"));Array.isArray(t[o])&&(t[o]?.splice(+i,1,e[r]),a.push(o),n.add(`${s}.${r}`))}(e,t,n,a,r,s):e[a]&&"object"==typeof e[a]?(t[a]||(t[a]=Array.isArray(e[a])?[]:{}),xh(e[a],t[a],n,`${r}.${a}`)):t[a]=e[a]})),function(e,t,n){Object.keys(e).forEach((r=>{(Array.isArray(e[r])&&!n.includes(r)||!Array.isArray(e[r])&&!Object.hasOwn(t,r))&&delete e[r]}))}(t,e,s)},wh=(e,t={})=>{const{serverPrecedenceFields:n=[],propertiesToReplace:r=[]}=t,{context:s,data:a,isArrayDeepMerge:o,preserveClientChanges:i=!1}=e,c=Al(s,!0);((e,t={})=>{const n=Kc.buildClientChangeList(e)||{};Object.keys(n).forEach((e=>{Sh.buildObject(e,t,n[e])}))})(s,c);const l=ch(s);let u={};if(l&&a){u=JSON.parse(JSON.stringify(l));const e=JSON.parse(JSON.stringify(a)),t=new Set;xh(c,u,t),((e,t,n)=>{const r=new Set;e.forEach((e=>{e=Sh.trimDotForProperty(e);const[s,a,o]=gn(e);s&&a&&o&&!r.has(`${s}.${a}`)&&((Sh.getIn(n,`${s}.${a}`)||[]).forEach(((e,n)=>{n!==+o&&Sh.setIn(t,`${s}.${a}[${n}]`,e)})),r.add(`${s}.${a}`))}))})(t,u,e)}!function(e,t){const n=Sh.getIn(e,j.REFERENCED_USERS);let r;if(void 0!==n){if(!Array.isArray(n)&&"object"==typeof n)return r=Sh.getIn(t,j.REFERENCED_USERS,{}),void Sh.setIn(e,j.REFERENCED_USERS,{...r,...n});r=Sh.getIn(t,j.REFERENCED_USERS,[]);const s=new Map;for(const e of[...r,...n])if(s.has(e.UserID)){const t=s.get(e.UserID);s.set(e.UserID,{...t,...e})}else s.set(e.UserID,e);n.length=0;for(const e of s.values())n.push(e)}}(a,l);const d={caseInfo:{content:{...u?.caseInfo?.content}}};let p=a;return i?(n.forEach((e=>{Sh.deleteIn(d,`caseInfo.content.${e}`)})),p=yh(a,d,{isArrayDeepMerge:!o})):((e,t)=>{const n=fl[e]||{};Object.keys(n).forEach((e=>{Sh.hasIn(t,e)&&(n[e].value=Sh.getIn(t,e))}));let r=Kc.getStateMachinesByContext(e)||{};r={...r,...Kc.getUnConnectedStateMachines(e)||{}},Object.keys(r).forEach((n=>{if(Sh.hasIn(t,n)){const r=Sh.getIn(t,n);r&&Array.isArray(r)&&0===r.length&&Kc.setStateMachineEmpty(e,n)}}))})(s,a),{type:fe,payload:{...e,data:p,...r.length>0?{propertiesToReplace:r}:null}}},Mh=e=>({type:"SHOW_HARNESS",payload:e}),Lh=e=>({type:te,payload:e}),Uh=e=>({type:ne,payload:e}),Fh=e=>({type:"ADD_WORK",payload:e}),jh=e=>({type:ue,payload:e}),Vh=e=>({type:Ae,payload:e}),kh=e=>({type:_e,payload:e}),$h=e=>({type:Ce,payload:e}),Bh=e=>({type:Te,payload:e}),Gh=e=>({type:Ne,payload:e}),Wh=e=>({type:De,payload:e}),Hh=e=>({type:Oe,payload:e}),qh=e=>({type:be,payload:e}),zh=e=>{const{containerItemID:t}=e;return e.suggestionContexts=Cd(t),{type:xe,payload:e}},Yh=e=>{const{context:t}=e;return{type:oe,payload:{context:t}}},Kh=e=>{const{context:t}=e;return{type:ie,payload:{context:t}}},Xh=e=>({type:we,payload:e}),Jh=e=>({type:ve,payload:e}),Qh=e=>({type:Je,payload:e}),Zh=e=>{const{context:t,containerItemID:n}=e;let r=t;return r||(r=yd(n)),e.context=r,e.deleteContext=!Ud(n),e.childContainers=Ad(n),e.childContainersContexts=_d(n),e.transientItems=Fd([...e.childContainersContexts,n]),e.suggestionContexts=Cd(n),n===t&&(e.caseID=dh(j.CASE_INFO.CASE_INFO_ID,"",t),e.RemoteSystemID=dh(j.CASE_INFO.REMOTESYSTEMID,"",t)),{type:Se,payload:e}},eg=e=>{const{containerItemID:t}=e;return e.transientItems=Fd([..._d(t),t]),{type:Re,payload:e}},tg=e=>{const{transientItemID:t}=e;return e.transientItems=[t],{type:Pe,payload:e}},ng=e=>{const{context:t,containerItemID:n}=e;let r=t;return r||(r=yd(n)),e.context=r,e.childContainers=Ad(n),e.childContainersContexts=_d(n),e.transientItems=Fd([...e.childContainersContexts,n]),e.suggestionContexts=Cd(n),n===t&&(e.caseID=dh(j.CASE_INFO.CASE_INFO_ID,"",t),e.RemoteSystemID=dh(j.CASE_INFO.REMOTESYSTEMID,"",t)),{type:Me,payload:e}},rg=e=>({type:pe,payload:e}),sg=e=>({type:ge,payload:e}),ag=e=>({type:Ie,payload:e}),og=(e,...t)=>(bh.resume(),e(...t)),ig=(e,t,n,r,s)=>({type:Ee,payload:{msg:e,err:t,context:n,formFields:r,actionMgrID:s}}),cg=e=>({type:tt,payload:e}),lg=e=>({type:nt,payload:e}),ug=e=>({type:rt,payload:e}),dg=e=>({type:"SHOW_CASE_PREVIEW",payload:e}),pg=e=>({type:ce,payload:e}),hg=e=>({type:Q,payload:e}),gg="add",fg="replace",mg=["portal","noPortal","preview","debug","devtool"];let yg="",Ig="Home",Eg="",Ag=!0;const _g=e=>(Ag=e,Ag),Cg=()=>Ag,Sg=(e,t,n)=>lp.getSemanticURL(e,t,n),Tg=(e,t)=>lp.getRestEndPoint(e,t),Ng=(e,t)=>{let n=E();const r=Tg(e,t);return r?(r.restApi?.startsWith("/")||(r.restApi=`/${r.restApi}`),n?.endsWith("/")&&(n=n.substring(0,n.length-1)),r.restApi=n+r.restApi,r):{}},Pg=(e,t,n)=>{const{root:r,resources:s}=e,{views:a}=s,{config:o}=r,i=gg;let c="";if(n)c=n;else{const e=a[o.name];let t=e;Array.isArray(e)&&e.length>0&&([t]=e);c=t.config.urlPath}const l=c.match(np);if(l){const e=Sh.getIn(t,o.context);c=c.replace(l[0],e.pyID)}return c.startsWith("/")&&(c=c.substring(1,c.length)),{pxURLPath:c,historyAction:i}},Rg=(e,t,n)=>{let r,s;r=sp(t)?`${e}/${t}`:e;const a=sp(n.pxURLPath);a&&(r=`${r}/${a}`);try{s=new URL(r).searchParams,r=r.includes("?")?r.split("?")[0]:r}catch(e){return console.log("Invalid url",e),""}const o=r.split("/"),i=o[o.length-1],c=new URLSearchParams(window.location.search);if(i.toLowerCase()!==Ig.toLowerCase()||c.has("noPortal")||(r=`${e}/${t}`),!lp.isDefaultPortal()){const e=lp.getPortalName();c.has("portal")?c.set("portal",e):c.append("portal",e)}return s=((e,t)=>{for(const[n,r]of t.entries())!e.has(n)&&mg.includes(n)&&e.append(n,r);return e})(s,c),s.toString()&&(r+=`?${s.toString()}`),r},Dg=(e,{urlPathObjParam:t,infoParam:n,optionsParam:r},s=!1)=>{let a,o,i;if(!1===window.PCore.getBehaviorOverride("dynamicSemanticUrl"))return;if(s)a=t,o=n,i=r;else{const{uiResources:n,data:r}=e;({options:i}=e),a=t&&t.pxURLPath&&rp(t.pxURLPath)?Pg(n,r,t.pxURLPath):t||Pg(n,r),o=lp.getEndPointInfo(a.pxURLPath),a.pxURLPath=o.urlPath}const c=Rg(yg,lp.getApplicationPath(),a),{title:l}=((e,t,n)=>{if(e=(e=>{let t=e.split(" ");return t=t.map((e=>e.charAt(0).toUpperCase()+e.slice(1))),t.join(" ")})(e=e&&""!==e?e:lp.getApplicationName()),n===`${yg}/${t}/`)return{title:e};const r=new URL(n).pathname.replace(`${t}/`,""),s=r.split("/");return/\d/.test(r)?{title:`${e} - ${s[s.length-1]}`}:{title:`${e} - ${s[0]}`}})(Eg,lp.getApplicationPath(),c),u=((e,t)=>(void 0!==e&&(e.options=t),{stateObj:e}))(o,{...i,title:l});a.historyAction===gg?((e,t,n)=>{try{window.history.pushState(e,t,n),window.scrollTo(0,0)}catch(e){throw new Error("Error- Unable to Add to Browser History")}})(u,l,c):a.historyAction===fg&&((e,t,n)=>{try{window.history.replaceState(e,t,n)}catch(e){throw new Error("Error- Unable to Replace Browser History")}})(u,l,c)},bg=e=>{let t=null;e.directUrlUpdation&&(t={historyAction:gg,pxURLPath:""},t.pxURLPath=e.semanticURL),Dg(e,{urlPathObjParam:t,infoParam:null,optionsParam:null},!1)},Og=e=>{bg(e)},vg=e=>{const t={pxURLPath:e};return Rg(yg,lp.getApplicationPath(),t)},xg=e=>{const{uiResources:t}=e;Cg()&&(e.directUrlUpdation||(e=>{if(e&&e.root){const{root:t}=e,{resources:n}=e,{views:r}=n,s=t.config,a=s.type,o=s.name;if("VIEW"===a.toUpperCase()){const e=r[o];let t=e;Array.isArray(e)&&e.length>0&&([t]=e);const n=t.config;if(n.type){const e=n.type;return!(!n.urlPath||"PAGE"!==e.toUpperCase())}}return!1}return!1})(t))&&bg(e)},wg=e=>{const t={routeEndpoint:e.routeEndpoint,requestType:e.requestType,payload:e.payload,routeKey:e.routeKey,options:null};return e.options&&(t.options=e.options),t},Mg=(e,t,n)=>{const{caseClassName:r,workID:s}=e.payload,{containerName:a,context:o}=t,{RemoteClassGroup:i,RemoteSystemID:c,name:u}=$.getRemoteCase(r),d={...e,headers:{RemoteSystemID:c},className:r,isTraditionalRemoteCase:!0,action:ft,viewName:V,gadgetId:Cc.getUniqueGadgetId(),context:n??o,skipSemanticUrl:!0,insKey:`${i?.toUpperCase()} ${s}`,containerName:a,name:u};ih(l.showPage(d))},Lg=e=>{const t=(e=>e.state?e.state.stateObj:null)(e);t&&($.isTraditionalRemoteCase(t.payload?.caseClassName)?Mg({...t},t.options):ih(l.showHistory(wg(t))))},Ug=()=>lp.getApplicationPath()!==op(),Fg=e=>{const{acName:t,context:n,defaultViewLabel:r}=e,s=(e=>{const t=lp.getRoutingInfo(),n=e.split(" ").join(""),r=e.split(" ").join("-").toLowerCase(),s=(e=>{const t=e.replace(/(?=[A-Z][a-z])/g,"-").toLowerCase();return t.startsWith("-")?t.substring(1):t})(e);return t?.routes[n]?n:t?.routes[r]?r:t?.routes[s]?s:e})(r);(e=>{Ig=e})(s),lp.setDefaultRoute(s);const a=H(t,n),o=mt(t,n),i="true"===up.getIsExtraCallRequiredForDefaultHome(),c={historyAction:fg,pxURLPath:""};let u;const d={acName:o,context:a,actionConfig:{context:a}};if(i||!i&&Ug()){const t=(e=>{if(e.indexOf("?")>0){const[t,n]=e.split("?"),r=new URLSearchParams(n),s=new Map;for(const[e,t]of r)"portal"!==e&&"noPortal"!==e&&"debug"!==e&&s.set(e,t);const a=new URLSearchParams(s).toString();return a?`${t}?${a}`:t}return e})(sp(window.location.pathname+window.location.search));u=lp.getEndPointInfo(t),c.pxURLPath=u.urlPath,void 0!==u.payload?.pageClass&&(u.payload.pageClass=oh()?.getState()?.data?.app?.pyPortal?.classID);const n="showHistory",r={routeEndpoint:u.routeEndpoint,requestType:u.requestType,payload:u.payload,options:d,routeKey:u.routeKey};$.isTraditionalRemoteCase(u?.payload?.caseClassName)?Mg(r,e,d.context):ih(l[n](wg(r)))}else u=lp.getEndPointInfo(Ig),c.pxURLPath="";Dg(null,{urlPathObjParam:c,infoParam:u,optionsParam:d},!0)},jg=(e,t=!1)=>{var n;yg=e.domain,!1===t&&Cg()&&(n=Lg,window.addEventListener("popstate",(e=>n(e))),window.onbeforeunload=()=>null),lp.init(e,Ig)},Vg=e=>{(e=>{window.document.title=e})(e)};function kg(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var $g=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),Bg=()=>Math.random().toString(36).substring(7).split("").join("."),Gg={INIT:`@@redux/INIT${Bg()}`,REPLACE:`@@redux/REPLACE${Bg()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Bg()}`};function Wg(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function Hg(e,t,n){if("function"!=typeof e)throw new Error(kg(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(kg(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(kg(1));return n(Hg)(e,t)}let r=e,s=t,a=new Map,o=a,i=0,c=!1;function l(){o===a&&(o=new Map,a.forEach(((e,t)=>{o.set(t,e)})))}function u(){if(c)throw new Error(kg(3));return s}function d(e){if("function"!=typeof e)throw new Error(kg(4));if(c)throw new Error(kg(5));let t=!0;l();const n=i++;return o.set(n,e),function(){if(t){if(c)throw new Error(kg(6));t=!1,l(),o.delete(n),a=null}}}function p(e){if(!Wg(e))throw new Error(kg(7));if(void 0===e.type)throw new Error(kg(8));if("string"!=typeof e.type)throw new Error(kg(17));if(c)throw new Error(kg(9));try{c=!0,s=r(s,e)}finally{c=!1}return(a=o).forEach((e=>{e()})),e}p({type:Gg.INIT});return{dispatch:p,subscribe:d,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error(kg(10));r=e,p({type:Gg.REPLACE})},[$g]:function(){const e=d;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(kg(11));function n(){const e=t;e.next&&e.next(u())}n();return{unsubscribe:e(n)}},[$g](){return this}}}}}function qg(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const s=t[r];0,"function"==typeof e[s]&&(n[s]=e[s])}const r=Object.keys(n);let s;try{!function(e){Object.keys(e).forEach((t=>{const n=e[t];if(void 0===n(void 0,{type:Gg.INIT}))throw new Error(kg(12));if(void 0===n(void 0,{type:Gg.PROBE_UNKNOWN_ACTION()}))throw new Error(kg(13))}))}(n)}catch(e){s=e}return function(e={},t){if(s)throw s;let a=!1;const o={};for(let s=0;s<r.length;s++){const i=r[s],c=n[i],l=e[i],u=c(l,t);if(void 0===u){t&&t.type;throw new Error(kg(14))}o[i]=u,a=a||u!==l}return a=a||r.length!==Object.keys(e).length,a?o:e}}function zg(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce(((e,t)=>(...n)=>e(t(...n))))}var Yg=function(e){function t(t,n){return e.call(this)||this}return jo(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(Qo),Kg={setInterval:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var s=Kg.delegate;return(null==s?void 0:s.setInterval)?s.setInterval.apply(s,Go([e,t],Bo(n))):setInterval.apply(void 0,Go([e,t],Bo(n)))},clearInterval:function(e){var t=Kg.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},Xg=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return jo(t,e),t.prototype.schedule=function(e,t){var n;if(void 0===t&&(t=0),this.closed)return this;this.state=e;var r=this.id,s=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(s,r,t)),this.pending=!0,this.delay=t,this.id=null!==(n=this.id)&&void 0!==n?n:this.requestAsyncId(s,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),Kg.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return t;null!=t&&Kg.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n,r=!1;try{this.work(e)}catch(e){r=!0,n=e||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Jo(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(Yg),Jg=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return jo(t,e),t.prototype.schedule=function(t,n){return void 0===n&&(n=0),n>0?e.prototype.schedule.call(this,t,n):(this.delay=n,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,n){return n>0||this.closed?e.prototype.execute.call(this,t,n):this._execute(t,n)},t.prototype.requestAsyncId=function(t,n,r){return void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.flush(this),0)},t}(Xg),Qg={now:function(){return(Qg.delegate||Date).now()},delegate:void 0},Zg=function(){function e(t,n){void 0===n&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=Qg.now,e}(),ef=function(e){function t(t,n){void 0===n&&(n=Zg.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r}return jo(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var n;this._active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}},t}(Zg),tf=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(t,e),t}(ef))(Jg),nf=Lo((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),rf=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return jo(t,e),t.prototype.lift=function(e){var t=new sf(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new nf},t.prototype.next=function(e){var t=this;li((function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var s=$o(t.currentObservers),a=s.next();!a.done;a=s.next()){a.value.next(e)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}}}))},t.prototype.error=function(e){var t=this;li((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}}))},t.prototype.complete=function(){var e=this;li((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,s=n.isStopped,a=n.observers;return r||s?Zo:(this.currentObservers=null,a.push(e),new Qo((function(){t.currentObservers=null,Jo(a,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,s=t.isStopped;n?e.error(r):s&&e.complete()},t.prototype.asObservable=function(){var e=new _i;return e.source=this,e},t.create=function(e,t){return new sf(e,t)},t}(_i),sf=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return jo(t,e),t.prototype.next=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===n||n.call(t,e)},t.prototype.error=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===n||n.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,n;return null!==(n=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==n?n:Zo},t}(rf),af=function(e,t){return af=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},af(e,t)};Object.create;Object.create;var of=function(e){function t(t,n){var r=e.call(this,(function(e){var t=r.__notifier.subscribe(e);return t&&!t.closed&&e.next(r.value),t}))||this;return r.__notifier=new rf,r.value=n,t.subscribe((function(e){e!==r.value&&(r.value=e,r.__notifier.next(e))})),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}af(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t}(_i);var cf=s(52),lf=Symbol.for("immer-nothing"),uf=Symbol.for("immer-draftable"),df=Symbol.for("immer-state");function pf(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var hf=Object.getPrototypeOf;function gf(e){return!!e&&!!e[df]}function ff(e){return!!e&&(yf(e)||Array.isArray(e)||!!e[uf]||!!e.constructor?.[uf]||Cf(e)||Sf(e))}var mf=Object.prototype.constructor.toString();function yf(e){if(!e||"object"!=typeof e)return!1;const t=hf(e);if(null===t)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===mf}function If(e,t){0===Ef(e)?Reflect.ownKeys(e).forEach((n=>{t(n,e[n],e)})):e.forEach(((n,r)=>t(r,n,e)))}function Ef(e){const t=e[df];return t?t.type_:Array.isArray(e)?1:Cf(e)?2:Sf(e)?3:0}function Af(e,t){return 2===Ef(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function _f(e,t,n){const r=Ef(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function Cf(e){return e instanceof Map}function Sf(e){return e instanceof Set}function Tf(e){return e.copy_||e.base_}function Nf(e,t){if(Cf(e))return new Map(e);if(Sf(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=yf(e);if(!0===t||"class_only"===t&&!n){const t=Object.getOwnPropertyDescriptors(e);delete t[df];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){const s=n[r],a=t[s];!1===a.writable&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(t[s]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[s]})}return Object.create(hf(e),t)}{const t=hf(e);if(null!==t&&n)return{...e};const r=Object.create(t);return Object.assign(r,e)}}function Pf(e,t=!1){return Df(e)||gf(e)||!ff(e)||(Ef(e)>1&&(e.set=e.add=e.clear=e.delete=Rf),Object.freeze(e),t&&Object.entries(e).forEach((([e,t])=>Pf(t,!0)))),e}function Rf(){pf(2)}function Df(e){return Object.isFrozen(e)}var bf,Of={};function vf(e){const t=Of[e];return t||pf(0),t}function xf(){return bf}function wf(e,t){t&&(vf("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Mf(e){Lf(e),e.drafts_.forEach(Ff),e.drafts_=null}function Lf(e){e===bf&&(bf=e.parent_)}function Uf(e){return bf={drafts_:[],parent_:bf,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Ff(e){const t=e[df];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function jf(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[df].modified_&&(Mf(t),pf(4)),ff(e)&&(e=Vf(t,e),t.parent_||$f(t,e)),t.patches_&&vf("Patches").generateReplacementPatches_(n[df].base_,e,t.patches_,t.inversePatches_)):e=Vf(t,n,[]),Mf(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==lf?e:void 0}function Vf(e,t,n){if(Df(t))return t;const r=t[df];if(!r)return If(t,((s,a)=>kf(e,r,t,s,a,n))),t;if(r.scope_!==e)return t;if(!r.modified_)return $f(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const t=r.copy_;let s=t,a=!1;3===r.type_&&(s=new Set(t),t.clear(),a=!0),If(s,((s,o)=>kf(e,r,t,s,o,n,a))),$f(e,t,!1),n&&e.patches_&&vf("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function kf(e,t,n,r,s,a,o){if(gf(s)){const o=Vf(e,s,a&&t&&3!==t.type_&&!Af(t.assigned_,r)?a.concat(r):void 0);if(_f(n,r,o),!gf(o))return;e.canAutoFreeze_=!1}else o&&n.add(s);if(ff(s)&&!Df(s)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Vf(e,s),t&&t.scope_.parent_||"symbol"==typeof r||!Object.prototype.propertyIsEnumerable.call(n,r)||$f(e,s)}}function $f(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Pf(t,n)}var Bf={get(e,t){if(t===df)return e;const n=Tf(e);if(!Af(n,t))return function(e,t,n){const r=Hf(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}(e,n,t);const r=n[t];return e.finalized_||!ff(r)?r:r===Wf(e.base_,t)?(zf(e),e.copy_[t]=Yf(r,e)):r},has:(e,t)=>t in Tf(e),ownKeys:e=>Reflect.ownKeys(Tf(e)),set(e,t,n){const r=Hf(Tf(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=Wf(Tf(e),t),o=r?.[df];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(((s=n)===(a=r)?0!==s||1/s==1/a:s!=s&&a!=a)&&(void 0!==n||Af(e.base_,t)))return!0;zf(e),qf(e)}var s,a;return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==Wf(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,zf(e),qf(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=Tf(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty(){pf(11)},getPrototypeOf:e=>hf(e.base_),setPrototypeOf(){pf(12)}},Gf={};function Wf(e,t){const n=e[df];return(n?Tf(n):e)[t]}function Hf(e,t){if(!(t in e))return;let n=hf(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=hf(n)}}function qf(e){e.modified_||(e.modified_=!0,e.parent_&&qf(e.parent_))}function zf(e){e.copy_||(e.copy_=Nf(e.base_,e.scope_.immer_.useStrictShallowCopy_))}If(Bf,((e,t)=>{Gf[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Gf.deleteProperty=function(e,t){return Gf.set.call(this,e,t,void 0)},Gf.set=function(e,t,n){return Bf.set.call(this,e[0],t,n,e[0])};function Yf(e,t){const n=Cf(e)?vf("MapSet").proxyMap_(e,t):Sf(e)?vf("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:xf(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let s=r,a=Bf;n&&(s=[r],a=Gf);const{revoke:o,proxy:i}=Proxy.revocable(s,a);return r.draft_=i,r.revoke_=o,i}(e,t);return(t?t.scope_:xf()).drafts_.push(n),n}function Kf(e){if(!ff(e)||Df(e))return e;const t=e[df];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Nf(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Nf(e,!0);return If(n,((e,t)=>{_f(n,e,Kf(t))})),t&&(t.finalized_=!1),n}var Xf=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,n)=>{if("function"==typeof e&&"function"!=typeof t){const n=t;t=e;const r=this;return function(e=n,...s){return r.produce(e,(e=>t.call(this,e,...s)))}}let r;if("function"!=typeof t&&pf(6),void 0!==n&&"function"!=typeof n&&pf(7),ff(e)){const s=Uf(this),a=Yf(e,void 0);let o=!0;try{r=t(a),o=!1}finally{o?Mf(s):Lf(s)}return wf(s,n),jf(r,s)}if(!e||"object"!=typeof e){if(r=t(e),void 0===r&&(r=e),r===lf&&(r=void 0),this.autoFreeze_&&Pf(r,!0),n){const t=[],s=[];vf("Patches").generateReplacementPatches_(e,r,t,s),n(t,s)}return r}pf(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...n)=>this.produceWithPatches(t,(t=>e(t,...n)));let n,r;return[this.produce(e,t,((e,t)=>{n=e,r=t})),n,r]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){ff(e)||pf(8),gf(e)&&(e=function(e){gf(e)||pf(10);return Kf(e)}(e));const t=Uf(this),n=Yf(e,void 0);return n[df].isManual_=!0,Lf(t),n}finishDraft(e,t){const n=e&&e[df];n&&n.isManual_||pf(9);const{scope_:r}=n;return wf(r,t),jf(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));const r=vf("Patches").applyPatches_;return gf(e)?r(e,t):this.produce(e,(e=>r(e,t)))}},Jf=Xf.produce;Xf.produceWithPatches.bind(Xf),Xf.setAutoFreeze.bind(Xf),Xf.setUseStrictShallowCopy.bind(Xf),Xf.applyPatches.bind(Xf),Xf.createDraft.bind(Xf),Xf.finishDraft.bind(Xf);const Qf=(e,t)=>{const{data:{shared:n={}}={},context:r}=t;((e,t)=>{fu.updateDataPageStore(t),Object.keys(t).forEach((n=>{Sh.getIn(e,[j.SHARED,n])?Object.keys(t[n]).forEach((r=>{Sh.setIn(e,[j.SHARED,n,r],t[n][r])})):Sh.setIn(e,[j.SHARED,n],t[n])}))})(e,n),r&&Sh.deleteIn(e,[r,"shared"])},Zf=(e,t,n=!1)=>{const{context:r,caseViewMode:s=(n?void 0:j.PERFORM_MODE),containerName:a}=t;a!==td.WORKAREA&&s&&Sh.setIn(e,[r,"context_data","caseViewMode"],s)},em=(e,t)=>{const{context:n}=t;Sh.setIn(e,[n,"context_data","actionType"],t.actionType),Sh.setIn(e,[n,"context_data","assignmentID"],t.assignmentID)},tm=(e,t=[])=>{t.forEach((t=>Sh.deleteIn(e,t)))},nm=(e,t=[])=>{t.forEach((t=>Sh.deleteIn(e,t)))},rm=(e,t=[])=>{t.forEach((t=>{Sh.deleteIn(e,t)}))},sm=(e,t,n={})=>{const{deleteAssignmentSpecificResources:r=!0,doDeleteConfirmationDetails:s=!0}=n;Sh.deleteIn(e,[t,"nextAssignmentInfo"]),Sh.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"availableActions"]),Sh.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"availableProcesses"]),Sh.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"activeActionID"]),Sh.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"assignments"]),Sh.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"childCases"]),s&&(Sh.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"confirmationLinks"]),Sh.deleteIn(e,[t,"caseMessages"])),r&&(Sh.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"actionButtons"]),Sh.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"navigation"]))},am=(e,t)=>Jf(e||{},(e=>{switch(t.type){case Ce:{if(!t.payload.data||e[t.payload.context])return e;t.payload.doDeleteCaseSummary&&sm(e,t.payload.context);const{target:n}=t.payload;return!n||-1===n.indexOf(j.WORKAREA)&&-1===n.indexOf(j.MODAL)?e[t.payload.containerItemID]=t.payload.data:e[t.payload.context]=t.payload.data,Zf(e,t.payload),em(e,t.payload),Qf(e,t.payload),((e,t)=>{const{context:n}=t;Sh.deleteIn(e,[n,"context_data","blocking_action_counter"]),Sh.deleteIn(e,[n,"context_data","deferred_action_queue"])})(e,t.payload),e}case xe:{t.payload.doDeleteCaseSummary&&sm(e,t.payload.context,{deleteAssignmentSpecificResources:t.payload.deleteAssignmentSpecificResources});const{target:n,propertiesToReplace:r=[]}=t.payload;return!n||-1===n.indexOf(j.WORKAREA)&&-1===n.indexOf(j.MODAL)?e[t.payload.containerItemID]=yh(e[t.payload.containerItemID],t.payload.data,{propertiesToReplace:[...r]}):e[t.payload.context]=yh(e[t.payload.context],t.payload.data,{propertiesToReplace:[...r]}),(t.payload.actionType||t.payload.assignmentID)&&em(e,t.payload),Zf(e,t.payload),Qf(e,t.payload),nm(e,t.payload.suggestionContexts),e}case Se:{const{childContainersContexts:n=[]}=t.payload;return((e,t)=>{const{containerItemID:n,context:r,deleteContext:s}=t;s&&Sh.deleteIn(e,[r]),Sh.deleteIn(e,[n])})(e,t.payload),rm(e,n),tm(e,t.payload.transientItems),nm(e,t.payload.suggestionContexts),e}case _e:{const{containerItems:n}=t.payload;return Array.isArray(n)?n.forEach((t=>{Sh.deleteIn(e,[t])})):Sh.deleteIn(e,[n]),e}case we:{const{context:n,contextToBeRemoved:r,data:s,childContainersContextsToBeRemoved:a}=t.payload;return sm(e,t.payload.context),Zf(e,t.payload),e[n]=yh(e[n],e[r]),e[n]=yh(e[n],s),Sh.deleteIn(e,[r]),rm(e,a),Qf(e,t.payload),e}case Me:{const{payload:{context:n,pulseReplace:r=!0,childContainersContexts:s=[]}}=t;let{payload:{data:a}}=t;const o=Sh.getIn(e[n],"pulse");let i=Sh.getIn(e[n],"OperatorID"),c=Sh.getIn(e[n],"pxRequestor");return c&&a.pxRequestor&&(c=Sh.mergeDeep(c,a.pxRequestor)),i&&a.OperatorID&&(i=Sh.mergeDeep(i,a.OperatorID)),!r&&o&&(a=Ih(a,"pulse",o),a=Ih(a,"OperatorID",i),a=Ih(a,"pxRequestor",c)),Sh.setIn(e,n,a),Zf(e,t.payload),Qf(e,t.payload),rm(e,s),tm(e,t.payload.transientItems),nm(e,t.payload.suggestionContexts),e}case st:{const{context:n,doDeleteConfirmationDetails:r=!0}=t.payload;return sm(e,n,{doDeleteConfirmationDetails:r}),e}case Te:{const{transientItemID:n,data:r}=t.payload;return Sh.setIn(e,n,r)}case Pe:case Re:{const{transientItems:n}=t.payload;return n.forEach((t=>Sh.deleteIn(e,t))),e}case Ne:case De:{const{transientItemID:n,data:r}=t.payload;return yh(Sh.getIn(e,n),r),e}case be:{const{transientItemID:n,data:r}=t.payload;for(const t in r)Object.prototype.hasOwnProperty.call(r,t)&&Sh.deleteIn(e,[n,t]);return e}case Oe:{const{transientItemID:n,data:r}=t.payload;return Sh.deleteIn(e,n),Sh.setIn(e,n,r)}case ce:{const{key:n,value:r}=t.payload;return Sh.setIn(e,`${j.SHARED}.${n}`,r),e}case Fe:{const{context:n,data:r}=t.payload;return Sh.setIn(e,n,r)}default:return e}})),om=(e,t)=>Jf(e,(e=>{switch(t.type){case fe:{const{propertiesToReplace:n=[]}=t.payload;return e[t.payload.context]=yh(e[t.payload.context],t.payload.data,{isArrayDeepMerge:t.payload.isArrayDeepMerge,propertiesToReplace:[...n]}),Zf(e,t.payload,!0),Qf(e,t.payload),e}case Q:{const{context:n,reference:r,value:s,isArrayDeepMerge:a}=t.payload;return Ih(e[n],r,s,{isArrayDeepMerge:a}),e}case Z:{const{context:n,reference:r,value:s}=t.payload;return Eh(e[n],r,s),e}case me:return fh(e[t.payload.context],t.payload.reference),e;case oe:return Sh.setIn(e[t.payload.context],"context_data.isLoading",!0),e;case ie:return Sh.setIn(e[t.payload.context],"context_data.isLoading",!1),e;case tt:{const{data:n}=t.payload;return Qf(e,{data:{shared:n}}),e}case nt:{const{dataPagesToBeRemoved:n=[]}=t.payload;return n.forEach((t=>{const{dataPageName:n,dataPageNameWithHash:r}=t;Sh.deleteIn(e.shared,[n,r]);const s=Sh.getIn(e.shared,[n]);s&&0===Object.keys(s).length&&Sh.deleteIn(e.shared,[n])})),e}case at:{const n=Sh.getIn(e[t.payload.context].context_data,"blocking_action_counter",0);return t.payload.isInitiateBlockingAction?Sh.setIn(e[t.payload.context].context_data,"blocking_action_counter",n+1):Sh.setIn(e[t.payload.context].context_data,"blocking_action_counter",n-1),e}default:return e}})),im=/\[(\d+)\]$/gi,cm=/(\d+)/gi,lm=/\[.\]$/gi,um=(e,t,n,r=[j.CONTEXT_DATA,j.CASE_INFO.CASE_INFO,j.CONTENT])=>{const s=Sh.getIn(t,r);if(s){const t=Kn(s,[],[]);for(const s of t)Sh.setIn(e[n],[...r,...s],{})}},dm=(e,t,n,r)=>{const{property:s,pageReference:a,category:o,type:i}=r.payload,c=Sh.getIn(e[t],n);if(c&&o===j.CASEMESSAGES)Sh.setIn(e[t],Bn(s,a,o),"");else if(c&&c.length>0&&Array.isArray(c)){const r=c.filter((e=>e.type!==i));n&&n.length>0&&Sh.setIn(e[t],Bn(s,a,o),r)}};const pm=(e,t,n)=>{n.forEach((n=>{((e,t,n)=>{const r=n[j.ERROR_FIELD_IN_PAGE].slice(1),s=n[j.ERROR_IN_PAGE_IDENTIFIER].slice(1);if(s){let a=r?`caseInfo.content.${r}`:"caseInfo.content";a=a.replace(/\(/g,"[").replace(/\)/g,"]");const o=Bn(s,a,j.PROPERTY),i=Sh.getIn(e[t],`${a}.classID`),c=Mp(s,i),l={type:F.MESSAGES.MESSAGES_TYPE_ERROR,message:n.localizedValue,...c?.label&&{fieldLabel:c.label}},u=Sh.getIn(e[t],o,[]);if(Sh.isContains(u,l))return;Sh.setIn(e[t],o,[...u,l])}})(e,t,n)}))};function hm(e,t){const{err:n,formFields:r}=t.payload;let{context:s}=t.payload;const{fieldErrors:a,pageErrors:o}=xc(n.errorDetails,r);if(Sh.setIn(e,[s,...$n.FIELD_MESSAGES_PATH],{}),Sh.setIn(e,[s,...$n.PAGE_MESSAGES_PATH],[]),a.forEach((t=>{if(t[j.ERROR_FIELD_IN_PAGE]){const n=t[j.ERROR_FIELD_IN_PAGE].slice(1);if(n){const t=function(e){let t=null;const n=e.lastIndexOf(".");return n<0?null:(t=e.substring(0,n),t?`caseInfo.content.${t}`.replace(/\(/g,"[").replace(/\)/g,"]"):t)}(n);if(!t)return!1;const r=n.substring(n.lastIndexOf(".")+1),a=Bn(r,t,j.PROPERTY);Sh.setIn(e,[s,...a],[])}}})),a.length>0&&pm(e,s,a),o.length>0){const t=(e=>{const t=[];return e.forEach((e=>{t.push({type:F.MESSAGES.MESSAGES_TYPE_ERROR,message:e.localizedValue})})),t})(o);e[s]||(s=j.APP.APP),Sh.setIn(e,[s,...$n.PAGE_MESSAGES_PATH],t)}else s.includes&&s.includes(td.WORKAREA)&&(s=W(s)),Sh.deleteIn(e,[s,...$n.PAGE_MESSAGES_PATH]);return e}const gm=(e,t)=>Jf(e||Cm().data,(e=>{switch(t.type){case Ee:return t.payload.err.errorDetails&&("Validation fail"===t.payload.err.errorClassification||(t.payload.err?.displayButtonsOnErrors?.length??0)>0)?hm(e,t):e;case xe:{const{context:n}=t.payload,r=[n,...$n.FIELD_MESSAGES_PATH],s=[n,...$n.PAGE_MESSAGES_PATH];if(Sh.setIn(e,r,{}),Sh.setIn(e,s,[]),n&&n.includes(td.WORKAREA)){const t=[X(n),...$n.PAGE_MESSAGES_PATH];Sh.setIn(e,t,[])}return e}case Qe:{const{isListEntry:n}=t.payload;return n?((e,t)=>{const{property:n,pageReference:r,category:s,isListEntry:a,deletingIndex:o,stateObj:i}=t.payload,{context:c}=t.payload;if(i)return um(e,i,c),e;const l=Bn(n,r,s,a);if(Number.isInteger(o)){Sh.deleteIn(e[c],l);const t=l.slice(0,l.length-1);let n=Sh.getIn(e[c],t)||{};const r=Object.keys(n);n=r.map((e=>n[e])),n.forEach(((n,s)=>{const a=r[s].match(im);if(a?.length){const i=parseInt(a[0].match(cm)[0],10);i>o&&(Sh.deleteIn(e[c],t.concat(r[s])),Sh.setIn(e[c],t.concat(r[s].replace(lm,`[${i-1}]`)),n))}}))}else Sh.setIn(e[c],l,{});return e})(e,t):((e,t)=>{const{property:n,pageReference:r,category:s,isListEntry:a,stateObj:o}=t.payload,{context:i}=t.payload;let c=i;if(o)return um(e,o,i),e;const l=Bn(n,r,s,a);return s===j.PAGE&&i?.includes(td.WORKAREA)&&(c=W(i)),dm(e,c,l,t),dm(e,i,l,t),e})(e,t)}case Je:{const{messages:n,property:r,pageReference:s,context:a,category:o}=t.payload,i=Bn(r,s,o);return n&&n.length>0&&Array.isArray(n)&&i&&i.length>0&&Sh.setIn(e[a],Bn(r,s,o),n),e}default:return e}})),fm=(e,t)=>Jf(e,(e=>{if(t.type===rt){const{instruction:n,actions:r,context:s,referenceList:a,listIndex:o,listMoveToIndex:i,content:c={}}=t.payload,l=sh(a);switch(n){case j.LIST_ACTIONS.INSERT:((e,t,n,r,s)=>{Sh.setIn(e[t],[...n,r],s)})(e,s,l,o,c);break;case j.LIST_ACTIONS.UPDATE:((e,t,n,r,s)=>{const a=yh(Sh.getIn(e[t],[...n,r],{}),s);Sh.setIn(e[t],[...n,r],a)})(e,s,l,o,c);break;case j.LIST_ACTIONS.DELETE:((e,t,n,r)=>{const s=Sh.getIn(e[t],n,[]);s.splice(r,1),Sh.setIn(e[t],n,s),Pn.deleteListNode(t,n,s.length)})(e,s,l,o);break;case j.LIST_ACTIONS.MOVE:((e,t,n,r,s)=>{const a=Sh.getIn(e[t],[...n,r],{}),o=Sh.getIn(e[t],n,[]);o.splice(r,1),o.splice(s,0,a),Sh.setIn(e[t],n,o),Hn(e,t,n?.join("."),r,s)})(e,s,l,o,i);break;case j.LIST_ACTIONS_TYPE.SELECT_DESELECT:((e,t,n,r)=>{const s=Sh.getIn(e[t],n)||[];r.forEach((e=>{const{instruction:r,content:a,listIndex:o}=e;if(r===j.LIST_ACTIONS.SELECT){s[o]=a;const e=n?.join(".");gr(t,e)}else delete s[o]})),Sh.setIn(e[t],n,s.filter(Boolean))})(e,s,l,r);break;case j.LIST_ACTIONS_TYPE.DESELECT_ALL:((e,t,n)=>{Sh.setIn(e[t],n,[])})(e,s,l)}}return e})),mm=[om,am,gm,fm],ym=(e,t)=>(e||(e=Cm().data),t.type===Ze?Cm().data:(mm.forEach((n=>{e=n(e,t)})),e)),Im=(e,t=[])=>{t.forEach((t=>{Sh.deleteIn(e,[t])}))},Em=(e,t)=>{const{type:n,payload:r}=t,s=n===xe,{target:a,context:o,semanticURL:i="",root:c,containerItemID:l,childContainers:u,flowName:d,resourceType:p="",key:h="",clearView:g=!1}=r;return c?Sh.setIn(e,[a,"items",l,"view"],c):g&&Sh.deleteIn(e,[a,"items",l,"view"]),o&&Sh.setIn(e,[a,"items",l,"context"],o),d&&Sh.setIn(e,[a,"items",l,"flowName"],d),(!s||s&&h)&&Sh.setIn(e,[a,"items",l,"key"],h.trim()),((e,t,n,r)=>{""===e&&Sh.deleteIn(t,[n,"items",r,"key"])})(h,e,a,l),(!s||s&&i)&&Sh.setIn(e,[a,"items",l,"semanticURL"],i),(!s||s&&p)&&Sh.setIn(e,[a,"items",l,"resourceType"],p),Im(e,u),e},Am=(e,t)=>(e||(e=Cm().containers),t.type===Ze?Cm().containers:Jf(e,(e=>{switch(t.type){case Ae:{const{context:n,name:r,type:s,actionMgrID:a}=t.payload,o=`${n}/${r}`;let i=null;return ln.resolveActionByID(a,null,!1),e[o]?e:(i={type:s,accessedOrder:[],items:{}},Sh.setIn(e,[o],i),e)}case Ue:{const{containerName:n,childContainers:r=[]}=t.payload;return Sh.deleteIn(e,[n]),r.forEach((t=>{Sh.deleteIn(e,[t])})),e}case _e:{const{context:n,name:r,actionMgrID:s,childContainers:a}=t.payload,o=`${n}/${r}`;return ln.resolveActionByID(s,null,!1),Sh.setIn(e,[o,"accessedOrder"],[]),Sh.setIn(e,[o,"items"],{}),Array.isArray(a)&&a.forEach((t=>{Sh.deleteIn(e,[t])})),e}case Ce:{const{target:n,context:r,isInCreateStage:s,isBulkAction:a,semanticURL:o,root:i,containerItemID:c,actionMgrID:l,key:u,flowName:d,resourceType:p,actionName:h,isMinimizable:g,showProgress:f,progressMessage:m,modalOptions:y,resourceStatus:I,actionID:E,isMultiRecordData:A,acTertiary:_,parentContext:C,heading:S,isTraditionalRemoteCase:T}=t.payload,N=e[n],P=N&&N.type,R=N&&N.accessedOrder||[],D=N&&N.items||{};let b=null;return e[n]&&"single"===P&&R.length>0?Em(e,t):(b={accessedOrder:[...R,c],items:{...D,[c]:{view:i,semanticURL:o,key:u,flowName:d,context:r,isInCreateStage:s,resourceType:p,actionName:h,isMinimizable:g,...a&&{isBulkAction:a},showProgress:f,progressMessage:m,modalOptions:y,isTraditionalRemoteCase:T,resourceStatus:I,...E&&{actionID:E},..._&&{acTertiary:_},...A&&{isMultiRecordData:A},...C&&{parentContext:C},heading:S}}},ln.resolveActionByID(l,null,!1),e[n]=w()(e[n],b),e)}case xe:{const{actionMgrID:n,data:r}=t.payload;let s=e;try{s=Em(e,t),ln.resolveActionByID(n,r,!1)}catch{ln.rejectActionByID(n,!1)}return s}case Me:return((e,t)=>{const{actionMgrID:n,data:r,target:s,containerItemID:a}=t.payload;let o=e;try{const i=e&&e[s]?.type;let c=e&&e[s]?.accessedOrder||[];c="single"===i?c.length>0?c:[...c,a]:c.includes(a)?c:[...c,a],Sh.setIn(e,[s,"items",a,"transientItems"],[]),Sh.setIn(e,[s,"accessedOrder"],c),o=Em(e,t),ln.resolveActionByID(n,r,!1)}catch{ln.rejectActionByID(n,!1)}return o})(e,t);case ve:{const{target:n,containerItemID:r,actionMgrID:s}=t.payload;try{const t=Sh.getIn(e,[n,"accessedOrder"]).filter((e=>e!==r));t.push(r),Sh.setIn(e,[n,"accessedOrder"],t),ln.resolveActionByID(s,null,!1)}catch{ln.rejectActionByID(s,!1)}return e}case we:case Se:{const{target:n,containerItemID:r,actionMgrID:s,childContainers:a}=t.payload;try{const t=Sh.getIn(e,[n,"accessedOrder"]).filter((e=>e!==r));Sh.setIn(e,[n,"accessedOrder"],t),Sh.deleteIn(e,[n,"items",r]),Im(e,a),ln.resolveActionByID(s,null,!1)}catch{ln.rejectActionByID(s,!1)}return e}case Te:{const{transientItemID:n,target:r,contextName:s}=t.payload,a=Sh.getIn(e,[r,"items",s,"transientItems"])??[];return Sh.setIn(e,[r,"items",s,"transientItems"],[...a,n])}case Re:{const{target:n,containerItemID:r}=t.payload;return Sh.deleteIn(e,[n,"items",r,"transientItems"]),e}case Pe:{const{target:n,transientItemID:r,containerItemID:s}=t.payload,a=(Sh.getIn(e,[n,"items",s,"transientItems"])??[]).filter((e=>e!==r));return Sh.setIn(e,[n,"items",s,"transientItems"],a)}default:return e}})));let _m={};const Cm=()=>_m,Sm=e=>((e=>{const t=e.Data||e.data,{uiResources:n={}}=e,r=n[j.CONTEXT_DATA]||e[j.CONTEXT_DATA];_m={data:{[j.APP.APP]:{...t,[j.CONTEXT_DATA]:r}},containers:{}}})(e),qg({data:ym,containers:Am}));function Tm(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Hl(e),r=function(e,t){return"number"==typeof Wl(e)?e.pop():t}(e,1/0),s=e;return s.length?1===s.length?Oi(s[0]):function(e){return void 0===e&&(e=1/0),Bl(Ei,e)}(r)(ki(s,n)):Yl}const Nm=(e,t)=>{e.data=e.data??{};const{assignments:n,availableActions:r=[]}=e.data.caseInfo??{};if(n&&Array.isArray(n)&&n.length>0&&n[0].actions&&Array.isArray(n[0].actions)&&!t?.stopMergeActions){n[0].actions.forEach((e=>{"Assignment"!==e.type&&"LocalAction"!==e.type||r.push(e)})),e.data.caseInfo=e.data.caseInfo??{},e.data.caseInfo.availableActions=r}},Pm=(e,t)=>{if(e.confirmationLinks&&(e.data=e.data??{},e.data.caseInfo=e.data.caseInfo??{},e.data.caseInfo.confirmationLinks=e.confirmationLinks),!e.uiResources&&e.confirmationNote){let t=e;const{confirmationNote:n}=t;return t=((e,t)=>{const n=[e];return t.data=t.data??{},t.data.caseMessages=n,t})(n,t),t}if(!e.uiResources||!e.data||!e?.uiResources?.root)return e;const n=e,{uiResources:{actionButtons:r,navigation:s},nextAssignmentInfo:a}=n;if(n.data&&n.data.caseInfo&&(r&&(n.data.caseInfo.actionButtons=r),s&&(n.data.caseInfo.navigation=s),t&&t[F.ACTIONS.DELETEAVIALACTIONS]&&delete n.data.caseInfo.availableActions,Nm(n,t),e.confirmationNote)){const{confirmationNote:e}=n,t=[e];n.data.caseMessages=t}return t&&t.isCreateDataObject&&(n.data=n.data??{},n.data.dataInfo={},n.data.dataInfo.content=n.data.pyPortal,n.uiResources.root.config.context="dataInfo.content",n.uiResources.context_data.dataInfo=n.uiResources.context_data.dataInfo??{},n.uiResources.context_data.dataInfo.content=n.uiResources.context_data.dataInfo.content??{},n.uiResources.context_data.dataInfo.content=n.uiResources.context_data?.pyPortal,delete n.data.pyPortal,delete n.key),a&&(n.data=n.data??{},n.data.nextAssignmentInfo=a),n},Rm={},{VIEW:Dm,FIELD:bm}=j.CONTEXT_TREE_NODE_TYPES,Om=e=>(e=>sc[e])(e)>0&&Rm[e],vm=[(e,t)=>e.pipe(Vl(Rn.REFRESH_DATA,gt),$l((e=>e.payload)),Bl((e=>{const{context:n,contextData:r,options:s}=e,{propertyName:a="",classID:o=""}=s,i=Rc(n,{skipUUID:!1});let c=[],l=[],u=!1;up.getFeatureMap().granularUIRefresh?(({fieldsWithDeclarativeTargets:c=[],whens:l=[]}=jn(n)),u=l.some((e=>e.type===Dm))):u=!0;const d=l.filter((e=>e.type===bm)),p=Sh.getPropertyName(a),h=p?p.split("."):[],g=h.pop(),f=h.join("."),m=[];if(f){const e=Mp(f,o);if(e&&"copy"===e.dataRetrievalType){const e=Sh.getIn(i,`content.content.${f}`)||{};if(Object.keys(e).length>0){Object.keys(e).filter((e=>e!==g)).forEach((t=>{delete e[t],m.push(`${f}`)}))}}}e.serverPrecedenceFields=m;let y={...i.content,contextData:r};const I=qc(n);Sh.isEmpty(I)||(y=Hc(I,y));const E=((e,t)=>{const{caseWideAction:n,caseViewAction:r,fieldsWithDeclarativeTargets:s,fieldsWithWhen:a,isViewsWithWhen:o,interestPage:i,options:c}=e;let l={};const{optionalPayload:u}=c;u&&(t.content={...u});let d={...t},p=Rn.REFRESH;return r?(l=Ng(Rn.REFRESH_CASE_VIEW,e),d={...d,interestPage:i}):o&&n?l=Ng(Rn.REFRESH_CASE_DATA,e):o&&!n?l=Ng(Rn.REFRESH_ASSIGNMENT_DATA,e):(s.length>0||a.length>0)&&(d={...d,calculations:{fields:s,whens:a}},l=Ng(n?Rn.RECALCULATE_CASE_DATA:Rn.RECALCULATE_ASSIGNMENT_DATA,e),p=Rn.RECALCULATE),{restAPI:l,requestBody:d,requestType:p}})({...e,fieldsWithDeclarativeTargets:c,fieldsWithWhen:d,isViewsWithWhen:u},y);bu.registerBlockingAction(n).catch((()=>{}));const{restAPI:A,requestBody:_,requestType:C}=E;(e={...e,requestType:C}).requestType=C;const{reqType:S,restApi:T}=A,N=t.value.data[n]?.caseInfo?.headers;return ki(((e,t)=>{const{context:n}=e;(e=>{e.reqHeaders&&e.reqHeaders.etag&&(e.headers={"if-match":e.reqHeaders.etag})})(e);const r=(e=>{const{ID:t,actionID:n,context:r}=e;return`${t}.${r}.${n}`})(t);if(Om(r)){const t=[];for(let n=0;n<Rm[r].length;){const s=Rm[r][n],a=Vn(s,e);if("CANCEL_REFRESH"===a){const e=new Error;return e.code="ERR_CANCELED",Promise.reject(e)}!0===a&&(t.push(n),s.cancelConfig?.cancel()),n+=1}t.forEach((e=>{Rm[r].splice(e,1)}))}const s=fc();return e.signal=s.token,e.cancelConfig=s,Rm[r]?Rm[r].push(e):Rm[r]=[e],pc(e.url,e,n,{cancelContext:r}).then((e=>(delete Rm[r],e))).catch((e=>{throw e&&"ERR_CANCELED"!==e.code&&delete Rm[r],e}))})({reqHeaders:N,context:n,method:S,body:_,url:Fn(e,T)},e)).pipe($l((t=>({response:{...t.data||{}},actionConfig:e,actionMgrID:e.options.actionMgrID,headers:Pc(t.headers)}))),Xl(": Error occurred during fetch call at refreshData Epic : ",e.context,e?.options?.actionMgrID))})),Bl((async e=>{if(e&&e.type===Ee)return bu.deRegisterBlockingAction(e.payload?.context).catch((()=>{})),wc(e);const{actionConfig:t,response:n,actionMgrID:r}=e,{context:s,serverPrecedenceFields:a,requestType:o}=t,i=kr.getTargetViewContainerName(je),c=mt(i,s),l={acName:c,context:s},u=Pm(n,{[F.STOPMERGEACTIONS]:!0,[F.ACTIONS.DELETEAVIALACTIONS]:!0});u.directUrlUpdation=!1,o===Rn.REFRESH&&await bc(u,t,l);const d=Dc(u,{target:c,context:s});t.options?.skipDataMerge&&d.data?.caseInfo?.content&&(d.data.caseInfo.content={}),d.preserveClientChanges=void 0===t.options.preserveClientChanges||t.options.preserveClientChanges;const p=Cc.getPropertiesToReplace(s),h=og(wh,d,{serverPrecedenceFields:a,propertiesToReplace:p});return Kc.registerForServerChanges(),ih(h),ln.resolveActionByID(r,d),Kc.unRegisterForServerChanges(),bu.deRegisterBlockingAction(s).catch((()=>{})),[]})))],xm=vm,wm=[e=>e.pipe(Vl(et),Bl((async e=>{const{context:t}=e.payload,n={},r={},s=Object.keys(e.payload.datapages).map((s=>{const a=e.payload.datapages[s];if(a.mode===j.READONLY&&a?.refreshStrategy){const{timeoutSecs:e="",type:t=""}=a?.refreshStrategy||{},n=lh()[a.name];if(n&&s in n){const r=n[s],{loadTime:a}=r;if(!au.isTimeElapsed(a,e,t))return}}return au.getData(a.name,{dataViewParameters:a.dataViewParameters},t).then((e=>{const t=a.mode===j.READONLY?r:n;t[a.name]?t[a.name][s]={pxResults:e.data.data,parameters:a.dataViewParameters,loadTime:e.data?.fetchDateTime}:t[a.name]={[s]:{pxResults:e.data.data,parameters:a.dataViewParameters,loadTime:e.data?.fetchDateTime}}})).catch((()=>{}))}));await Promise.allSettled(s);const a=[];return Object.keys(n).length&&a.push(wh({context:t,data:n})),Object.keys(r).length&&a.push(cg({data:r,context:t})),ih(a),[]})))],Mm=wm;class Lm{static OPEN_ASSIGNMENT_ACTION="openAssignment";static DIRTY_POPUP_C11N="displayDirtyPopupFromConstellation";static HANDLE_INFINITY_DISCARD="handleDiscardInInfinity";static OPEN_ASSIGNMENT_MODAL="openAssignmentInModal";static DISPLAY_DIRTY_POPUP="displayDirtyPopup";static LOAD_PREVIEW="loadPreview";static UPDATE_COEXISTENCE_DRILLDOWN_CASE="updateCoexistenceDrilldownCase";static OPEN_WORK_ITEM="openWorkItem";static OPEN_WORK_BY_HANDLE="openWorkByHandle";static GET_NEXT_WORK_ACTION="getNextWork";static CLOSE_CONTAINER_ACTION="closeContainer";constructor(){this.broadcastChannel=null,this.callback=null,this.isReverseCoexistenceCase=!1,this.broadcastEventToIframe=!1,this.isDirtyDialogActive=!1,this.onCreateCallback=null,this.openAssignmentParams=null}getGlobalObject=()=>s.g;getUniqueId=()=>this.getGlobalObject().uniqueId;setUniqueId=()=>{this.getGlobalObject().uniqueId=(new Date).getTime()};initBroadcastChannel=()=>{this.setUniqueId(),this.broadcastChannel=new BroadcastChannel("coexistence"),this.broadcastChannel.onmessage=e=>{switch(e.data.action){case Lm.DISPLAY_DIRTY_POPUP:this.broadcastEventToIframe=e.data.fromInfinity,this.isDirtyDialogActive||(e.data.isFormDirty?(Gr.publish(j.PUB_SUB_EVENTS.EVENT_SHOW_CANCEL_ALERT,{isModalAction:!0,hideDelete:!0}),this.isDirtyDialogActive=!0):this.callback?.call(this));break;case Lm.LOAD_PREVIEW:this.loadPreview(e);break;case Lm.UPDATE_COEXISTENCE_DRILLDOWN_CASE:this.updateCoexistenceDrilldownCase(e);break;case Lm.OPEN_ASSIGNMENT_ACTION:this.openAssignment(e);break;case Lm.GET_NEXT_WORK_ACTION:this.getNextWork(e);break;case Lm.OPEN_WORK_BY_HANDLE:this.openWorkByHandle(e);break;case Lm.CLOSE_CONTAINER_ACTION:this.closeContainer(e)}}};loadPreview=e=>{const{pyID:t,caseClassName:n,uniqueId:r}=e.data;if(r===this.getUniqueId()){Xu({}).getPConnect().getActionsApi().showCasePreview(t,{caseClassName:n})}};navigateToDefaultPage=()=>{const e=Xu({isRoot:!0}),t=PCore.getStore()?.getState().data.app?.pyPortal?.pyPrimaryNavPages;let n;Array.isArray(t)&&t[0]&&(n=t[0]);const r=n?.pyClassName||"Data-Portal",s=n?.pyRuleName||"pyHome";e.getPConnect().getActionsApi().showPage(s,r)};closeContainer=e=>{const{uniqueId:t}=e.data;t===this.getUniqueId()&&this.navigateToDefaultPage()};updateCoexistenceDrilldownCase=e=>{const{key:t,caseClassName:n,actionApi:r,caseLabel:s}=e.data;let a=r;r===Lm.OPEN_WORK_ITEM&&(a=Lm.OPEN_WORK_BY_HANDLE),lp.updateSemanticURLAndDocumentTitle({key:t,caseClassName:n,actionName:a});Xu({}).getPConnect().getActionsApi().updateRecents(n,t.substring(t.lastIndexOf(" ")+1),s,t)};openAssignment=e=>{const{pzInsKey:t,uniqueId:n}=e.data;n===this.getUniqueId()&&(this.onCreateCallback&&this.openAssignmentParams&&(t&&this.openAssignmentParams[0]&&this.openAssignmentParams[0].payload&&this.openAssignmentParams[0].payload.data?this.openAssignmentParams[0].payload.data.caseInfo.assignments[0].ID=t:this.openAssignmentParams[0]&&this.openAssignmentParams[0].payload&&this.openAssignmentParams[0].payload.data&&(this.openAssignmentParams[0].payload.data.caseInfo.content.coexistenceAction="openWorkByHandle"),this.onCreateCallback.call(this,this.openAssignmentParams)),this.onCreateCallback=null,this.openAssignmentParams=null)};getNextWork=e=>{const{uniqueId:t}=e.data;if(t===this.getUniqueId()){const e=`${F.APP.APP}${j.FORWARD_SLASH_STRING}${F.PRIMARY}`;Xu({meta:{},options:{context:Id(e)}}).getPConnect().getActionsApi().getNextWork()}};openWorkByHandle=e=>{const{key:t,caseClassName:n,uniqueId:r}=e.data;if(r===this.getUniqueId()){const e=`${F.APP.APP}${j.FORWARD_SLASH_STRING}${F.PRIMARY}`;Xu({meta:{},options:{context:Id(e)}}).getPConnect().getActionsApi().openWorkByHandle(t,n)}};destroyBroadcastChannel=()=>{this.getBroadCastChannel()?.close(),this.broadcastChannel=null};subscribeEvents=()=>{this.setReverseCoexistenceCaseLoaded(!0),Gr.subscribe(F.PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.HANDLE_DISCARD,this.handleDiscard),Gr.subscribe(F.PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.CHECK_IS_FORM_DIRTY,this.postDirtyPopupMessage)};unsubscribeEvents=()=>{Gr.unsubscribeAllWithEventType(F.PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.CHECK_IS_FORM_DIRTY),Gr.unsubscribeAllWithEventType(F.PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.HANDLE_DISCARD),this.setReverseCoexistenceCaseLoaded(!1),this.isDirtyDialogActive=!1};init=(e=!0)=>{null===this.broadcastChannel&&this.initBroadcastChannel(),e&&this.subscribeEvents()};destroy=()=>{this.destroyBroadcastChannel(),this.unsubscribeEvents()};setCallBackFunction=e=>{this.callback=e};setReverseCoexistenceCaseLoaded=e=>{this.isReverseCoexistenceCase=e};setIsDirtyDialogActive=e=>{this.isDirtyDialogActive=e};getBroadCastChannel=()=>this.broadcastChannel;getCallBackFunction=()=>this.callback;isReverseCoexistenceCaseLoaded=()=>this.isReverseCoexistenceCase;postDirtyPopupMessage=({callBackFunction:e})=>{this.broadcastChannel?.postMessage({action:Lm.DIRTY_POPUP_C11N,uniqueId:this.getUniqueId()}),this.setCallBackFunction(e)};handleDiscard=()=>{this.broadcastEventToIframe?(this.broadcastChannel?.postMessage({action:Lm.HANDLE_INFINITY_DISCARD,uniqueId:this.getUniqueId()}),this.broadcastEventToIframe=!1):(this.callback?.call(this),this.callback=null),this.isDirtyDialogActive=!1};postCreateCaseMessage=(e,t,n)=>{null===this.broadcastChannel&&this.init(!1),this.broadcastChannel?.postMessage({action:Lm.OPEN_ASSIGNMENT_MODAL,uniqueId:this.getUniqueId(),key:e}),this.broadcastEventToIframe=!1,this.onCreateCallback=t,this.openAssignmentParams=n}}const Um=new Lm,Fm="nextAssignmentInfo",jm="nextAssignmentInfo.context",Vm=e=>{const{containerName:t,isInCreateStage:n}=e;return n?j.MODAL:t||kr.getTargetViewContainerName(We)},km=e=>{const t=Sh.getIn(e,[j.DATA,j.CASE_INFO.CASE_INFO]);return Zt(t)&&en(up.getOperatorIdentifier(),t)},$m=()=>({registerHeader:(...e)=>nc.registerHeader(...e),unRegisterHeader:(...e)=>nc.unRegisterHeader(...e),getRegisteredHeaders:()=>nc.getRegisteredHeaders()}),Bm=(e,{body:t={},queryPayload:n={},cancelTokenSource:r,headers:s={},responseType:a},o,i)=>{const{restApi:c,reqType:l}=Ng(e,n),u={method:l,headers:s,body:t,...a&&{responseType:a}};return r&&(u.signal=r.token),pc(c,u,o,i??{})},Gm=(e,{method:t="GET",body:n={},headers:r={},withoutDefaultHeaders:s=!1},a)=>{e.startsWith("http:")||e.startsWith("https:")||(e=E()+e);return pc(e,{method:t,headers:r,body:n,withoutDefaultHeaders:s},a)},Wm=e=>lp.doesRestApiExist(e),Hm=()=>fc(),qm=e=>mc(e),zm=e=>{dc(e)},Ym=()=>Km;const Km=class{static createCase(e,t){const{caseInfo:n,startingFields:r,flowType:s,viewType:a=Tc.PAGE,pageName:o,context:i=j.APP.APP,debugInfo:c,headers:l}=t;let u={};n&&n.content&&(u=n.content);const d={caseTypeID:e,content:{...u,...r},processID:s};return Bm("createWork",{body:d,queryPayload:{caseClassName:e,viewType:a,params:{pageName:o}},headers:{...l,...c&&{...nc.addDebugHeaders(c)}}},i).then((t=>({response:t.data,requestPayload:d,headers:Pc(t.headers,e,l)})))}},Xm=(e,t)=>{const{class:n,context:r,viewType:s=Tc.PAGE}=e,{removeActionPayload:a}=t;let o=e?.pageName?e?.pageName:up.getDefaultCasePage();return e.isTraditionalUICase&&(o="pyDetails"),ki(Km.createCase(n,{...e,pageName:o,viewType:s,context:r})).pipe($l((({response:t,headers:n})=>({response:t,actionInPayload:e,headers:n,removeActionPayload:a}))),Xl("Error occurred during ajax call at createWork Epic : ",r))},Jm=e=>{Gr.publish(j.PUB_SUB_EVENTS.DISPLAY_CASE_CREATED_TOASTER,e)},Qm=e=>{Gr.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_DONE,e)},Zm=e=>{let t=0,n=[],r="",s=!1;return e.pipe(Vl(Oh),Jl(100),$l((e=>(({actionMgrID:t}=e.payload),e.payload))),Bl((e=>{const{context:n}=e,r=Vm(e),a=mt(r,n),{continueExecution:o,removeActionPayload:i}=(e=>Sd(e)?{continueExecution:!0,removeActionPayload:{}}:jc(e))(a);return s=ls(e.class),o?(e.isTraditionalUICase=s,Xm(e,{removeActionPayload:i})):(ln.rejectActionByID(t),Kl())})),Bl((async e=>{if(e&&e.type===Ee)return e.payload.context=zd(),n.push(wc(e)),n;const{actionInPayload:a,response:o,headers:i,removeActionPayload:c}=e;let l;l=!(a.renderInline||up.getDefaultCasePage()||s)&&km(o),Sh.setIn(o.data,F.CASE_INFO.IS_FIRST_ASSIGNMENT,!0);const u=Vm({...a,isInCreateStage:l}),d=mt(u,a.context),p=Lc(d,u,a.context);if(!Kr(u)&&Sd(d)){const{continueExecution:e}=jc(d);if(!e)return ln.rejectActionByID(t),Kl()}if(!(a?.openCaseViewAfterCreate??!0)&&!l){const e=Sh.getIn(o.data,F.CASE_INFO.CASE_INFO_CONTENT);r=`${e.pyID} ${hp.getLocaleValue("has been created.","Assignment")}`;const t=rs(o),s=es(o);return Jm({toastMessage:r}),Qm({caseId:`${e.pyID}`,assignmentId:t,caseType:s}),n}const h=Pm(o);let g=Sg("createWork",{caseClassName:es(h)});g=g.replace(/{.+?}/,String(Zr(ns(h)))),h.semanticURL=g,((e,t)=>{const n=km(e),{skipBrowserSemanticUrlUpdate:r=!1,isTraditionalUICase:s}=t;Sh.setIn(e,["directUrlUpdation"],(!n||s)&&!r)})(h,a);const f={acName:d,context:p},m=ps(p);await bc(h,a,f);const y={target:d,context:p,containerItemID:p,headers:i,semanticURL:g,isInCreateStage:l,isMinimizable:l,caseViewMode:h.confirmationNote?j.REVIEW_MODE:j.PERFORM_MODE,currentCaseViewMode:m,assignmentContext:Sh.getIn(h,jm),nextAssignmentInfo:Sh.getIn(h,Fm),resourceType:F.CASE,openCaseViewAfterCreate:a.openCaseViewAfterCreate,modalOptions:a.modalOptions,debugInfo:a.debugInfo};os(y,h);const I=Dc(h,y);s&&(I.data.caseInfo.content.coexistenceAction="openAssignment");const E=Mc(d,I);return Uc(E)&&ss(n,{removeActionPayload:c,target:d}),n.push(E),$c(n),n})),$l((()=>{const e=us(),a=Zt(Sh.getIn(n[0]?.payload,"data.caseInfo"));return s&&e&&a?Um.postCreateCaseMessage(n[0]?.payload?.nextAssignmentInfo?.ID,Wc,n):Wc(n),cs(n,t),r="",n=[],n})))},{RESOURCE_TYPES:ey}=F,ty=(e,t=[])=>{const{viewType:n,containerName:r,targetContainerName:s,isChild:a}=e,o=Qr(t);return(e=>{if(e){const{stageID:t,stages:n=[]}=e,r=n.length;for(let e=0;e<r;e+=1)if(n[e].ID===t)return"manual"===n[e].transitionType}return!1})(o)&&e?.stageID===o.stageID?Tc.PAGE:n||(!Yr(r)&&!Yr(s)||a?Tc.PAGE:Tc.FORM)},ny=(e,t,n,r,s)=>{if(ss(e,{removeActionPayload:t,target:n}),((e,t)=>{const n=gd(t);let r=null;return n&&(r=sd(t,n)),r?.key===e&&Td(t)})(r.key,n))r.context=Id(n),r.containerItemID=r.context,e.push(og(ng,r));else if((s?.isChild||s?.isRemote)&&s?.isMultiDoc){const t=xd(s.context);r.target=t,r.context=s.context,r.containerItemID=s.context,e.push(og(ng,r))}else{const t=xd(r.context),n=ld(t,r.key);n?(r.target=t,r.context=n,r.containerItemID=n,e.push(og(ng,r))):e.push(og($h,r))}},ry=(e,t,n,r,s,a,o)=>{Sd(t)&&Nd(t)?((e,t,n,r,s)=>{ty(e,t)===Tc.FORM?(n.caseViewMode=r||j.PERFORM_MODE,s.push(og(zh,n))):s.push(og(ng,n))})(r,s,e,a,n):ny(n,o,t,e,r)},sy=({restUrl:e,reqType:t,requestHeaders:n,debugInfo:r,context:s,isGetNextWork:a,doNotMergeMessagesForStatusCode:o})=>pc(e,{method:t,headers:{"if-match":n&&n.etag,...n,...r&&{...nc.addDebugHeaders(r)}}},s,{doNotMergeHttpMessagesForStatusCode:a?o:""}),ay=(e,t)=>{const n=ty(e),{headers:r,context:s,assignmentID:a,isGetNextWork:o,debugInfo:i,isOpenStage:c,stageID:l,caseID:u,jsActionQueryParams:d,isLastStepInCreateStage:p}=e,{restApi:h,reqType:g}=o?Ng("getNextWork",{viewType:n}):c?Ng("openStage",{caseID:u,stageID:l}):Ng(Ge,{assignmentID:a,viewType:n}),{removeActionPayload:f}=t,m=up.getDefaultCasePage();let y="",I=e.pageName;e.isTraditionalUICase&&(I="pyDetails"),y=m?`${h}?viewType=${n}&pageName=${m}`:I?`${h}?viewType=${n}&pageName=${I}`:`${h}?viewType=${n}`,d&&Object.keys(d).forEach((e=>{y+=`&${e}=${d[e]}`}));const E=(e=>{let t=e?.headers??{};return e?.isRemote&&(t=Pc(t,e.remoteClassName)),t})(e);return ki(sy({restUrl:y,reqType:g,requestHeaders:E,debugInfo:i,context:s,isGetNextWork:o,doNotMergeMessagesForStatusCode:"404"})).pipe($l((e=>{if(up.isCoexistenceAppOfType(j.APP_TYPE.UIKIT)&&!p){return Zt(e.data.data.caseInfo)?e:(y=y.replaceAll(I,"pyDetails"),up.setDefaultCasePage("pyDetails"),{isReloadWithDifferentViewTypeRequired:!0,restUrl:y})}return e})),Bl((e=>e?.isReloadWithDifferentViewTypeRequired?sy({restUrl:y,reqType:g,requestHeaders:E,debugInfo:i,context:s,isGetNextWork:o,doNotMergeMessagesForStatusCode:"404"}):ql(e))),$l((t=>{const{key:s,flowName:o}=vc(a);return{response:{...t.data,key:s,flowName:o},actionInPayload:e,viewType:n,removeActionPayload:f,headers:Pc({...r,...t.headers})}})),Xl("Error occurred during ajax call at openAssignment Epic : ",s))},{RESOURCE_TYPES:oy}=F,iy=e=>{const t="Browser"===up.getRuntime();let n=0,r=[];const s=[];let a=!1,o=!1;return e.pipe(Vl(xl),$l((e=>(({actionMgrID:n}=e.payload),{...e.payload,...t?{insKey:e.payload.assignmentID}:{assignmentID:e.payload.assignmentID}}))),Bl((e=>{a=e.isGetNextWork;const{context:t}=e;let r;r=(e?.isChild||e?.isRemote)&&e?.isMultiDoc?Tc.FORM:ty(e),e.viewType=r;const s=qr(Ge,e),i=mt(s,t),{activate:c,activateContainerActionPayload:l}=kc(oy.ASSIGNMENT,i,e);if(c&&!e.isParallelCall)return ql({type:ve,activateContainerActionPayload:l,actionInPayload:e});const u=gd(i);let d;d=l?.isParallelAssignment?{continueExecution:!0,removeActionPayload:{}}:u?jc(i):{continueExecution:!0,removeActionPayload:{}};const{continueExecution:p,removeActionPayload:h}=d;return p?(o=ls(e.className),e.isTraditionalUICase=o,ay(e,{removeActionPayload:h})):(ln.rejectActionByID(n),Kl())})),Bl((async e=>{if(e?.type===Ee){if(a){const{payload:t}=e,{err:n}=t,r=n.response.status;s.push({status:Number(r)})}return r.push(wc(e)),r}const{type:t,actionInPayload:n,response:i,viewType:c,headers:l,removeActionPayload:u,activateContainerActionPayload:d}=e;if("openStage"===i?.redirectInfo?.jsAction){const e=i?.redirectInfo?.stageID,t=xl,s=i?.data?.caseInfo?.ID;n.isOpenStage=!0,n.stageID=e,n.jsActionQueryParams=i?.redirectInfo?.jsActionQueryParams;const a={type:t,payload:{...n,caseID:s,headers:l}};return r.push(a),r}const{context:p,caseViewMode:h,debugInfo:g}=n;let f=((e,t)=>{const n=Qr(e);let r;r=!up.getDefaultCasePage()&&Zt(n);const{isChild:s,containerName:a}=t,o=s&&r,i=r&&!t.isActionFromToDoList;return o||i?j.MODAL:a||qr(Ge,t)})(i,n);o=ls(i?.data?.caseInfo?.caseTypeID),n.isTraditionalUICase=o,o&&(f=n.containerName);const m=mt(f,p);if(t===ve)return await(async(e,t,n)=>{const{semanticURL:r,containerItemID:s,isParallelAssignment:a,insKey:o}=t,{target:i,actionInPayload:c}=n,{skipBrowserSemanticUrlUpdate:l=!1}=c,u=yd(s);await bc({directUrlUpdation:!l,semanticURL:r},c,{acName:i,target:i,context:u}),e.push(og(Jh,{containerItemID:s,target:i,isParallelAssignment:a,insKey:o,resourceType:ey.CASE,context:u,doDeleteCaseSummary:c.doDeleteCaseSummary}))})(r,d,{actionInPayload:n,target:m}),$c(r),r;const y=i?.data?.caseInfo?.content,I=i?.uiResources?.root?.config?.name,E=i?.uiResources?.root?.config?.context;y&&!y.pyViewName&&I&&"page"!==n.viewType&&(Sh.setIn(y,"pyViewName",I),Sh.setIn(y,"pyViewContext",E));const A=Pm(i);((e,t)=>{const n=Qr(e),r=ns(e),s=Zt(n),{skipBrowserSemanticUrlUpdate:a=!1,viewType:o,isTraditionalUICase:i}=t,c=o===Tc.PAGE&&(!s||i)&&!a,{caseTypeID:l}=n;if(c){const t=Sg(Be,{caseClassName:l}).replace(/{.+?}/,String(Zr(r)));e.semanticURL=t,e.directUrlUpdation=!0}})(A,n);const _=Lc(m,f,p),C={acName:m,target:m,context:_};await bc(A,n,C);const S={target:m,context:_,containerItemID:_,headers:l,parentContext:W(n?.context),isMinimizable:Zt(Sh.getIn(A,"data.caseInfo")),doDeleteCaseSummary:n.doDeleteCaseSummary,acTertiary:n.acTertiary,resourceType:F.CASE,debugInfo:g};os(S,A,{skipFlowNameUpdate:n?.caseViewMode===j.REVIEW_MODE});const T=Dc(A,S);return n.isProcessAction&&(T.data.isProcessAction=n.isProcessAction),o&&(T.data.caseInfo.content.coexistenceAction="openAssignment"),((e,t)=>{e.acTertiary&&(t.data.caseInfo.isFirstAssignment=e.acTertiary)})(n,T),ry(T,m,r,n,i,h,u),c===Tc.FORM&&as(T.containerItemID)&&Gc(T,r),$c(r),(e=>{Gr.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_OPENED,e)})({actionInContext:p,assignmentID:n.assignmentID,caseKey:T.key}),r})),$l((()=>{const e=n,t=us(),a=Zt(Sh.getIn(r[0]?.payload,"data.caseInfo"));return o&&t&&a?Um.postCreateCaseMessage(r[0]?.payload?.data?.caseInfo?.assignments?.[0]?.ID,ih,r):ih(r),cs(r,e,s),r[0]?.payload?.isParallelAssignment&&ih({type:xl,payload:{...r[0].payload,isParallelCall:!0}}),r=[],r})))},cy=(e,t)=>{const{insKey:n,headers:r,context:s,debugInfo:a,viewType:o}=e,{removeActionPayload:i}=t,c=e?.pageName?e?.pageName:up.getDefaultCasePage(),l=Ng(Be,{caseID:n,params:{pageName:c}});let{restApi:u}=l;const{reqType:d}=l;return"none"===o&&(u=`${u?.split("viewType")[0]}viewType=none`),ki(pc(u,{method:d,headers:{...r,...a&&{...nc.addDebugHeaders(a)}}},s)).pipe($l((t=>({response:t.data,actionInPayload:e,headers:Pc({...r,...t.headers}),removeActionPayload:i}))),Xl("Error occurred during ajax call at openWorkByHandle Epic : ",s))},ly="OPEN_WORK_BY_HANDLE",{RESOURCE_TYPES:uy}=F,dy=async(e,t,n)=>{const{actionInPayload:r,activateContainerActionPayload:s,type:a,response:o,removeActionPayload:i,headers:c}=e,{context:l,skipBrowserSemanticUrlUpdate:u,debugInfo:d}=r,p=qr(Be,r),h=mt(p,l);if(a===ve)await(async(e,t)=>{const{activateContainerActionPayload:{semanticURL:n,containerItemID:r},actionInPayload:s,actionInPayload:{context:a,skipBrowserSemanticUrlUpdate:o,doDeleteCaseSummary:i}}=t,c=qr(Be,s),l=mt(c,a),u=yd(r);await bc({directUrlUpdation:!o,semanticURL:n},s,{acName:l,containerName:c,target:l,context:u}),e.push(og(Jh,{containerItemID:r,target:l,context:u,doDeleteCaseSummary:i}))})(t,{activateContainerActionPayload:s,actionInPayload:r});else{const s=Lc(h,p,l,{buildNew:!0}),a=Pm(o),g=((e,t)=>{const{isRemoteCase:n,remoteCaseClass:r}=t,s=ns(e),a=n?r:es(e);let o=Sg(Be,{caseClassName:a},{id:t?.insKey});return o=o?.replace("{workID}",String(Zr(s)))?.replace("{id}",t?.insKey),o})(a,r);a.semanticURL=g,a.directUrlUpdation=!u;const f={acName:h,context:s};await bc(a,r,f);const m=Dc(a,{target:h,context:s,containerItemID:s,semanticURL:g,headers:c,debugInfo:d});m.caseViewMode=j.REVIEW_MODE,m.resourceType=uy.CASE,n&&(m.data.caseInfo.content.coexistenceAction="openWorkByHandle"),os(m,a,{skipFlowNameUpdate:!0}),m.currentCaseViewMode=ps(e?.actionInPayload?.context);const y=Mc(h,m);i.containerItemID&&Uc(y)&&t.push(og(Zh,{containerItemID:i.containerItemID,target:h})),t.push(y)}$c(t);(e=>{Gr.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.CASE_OPENED,e)})({caseKey:r.insKey,actionInContext:l})},py=e=>{let t=0,n=[];return e.pipe(Vl(ly),$l((e=>(({actionMgrID:t}=e.payload),e.payload))),Bl((e=>{const{context:n,isChild:r,viewType:s}=e,a=qr(Be,e),o=mt(a,n);let i,c=!0;if("none"!==s){const e=jc(o);c=e.continueExecution,i=e.removeActionPayload}if(!c)return ln.rejectActionByID(t),Kl();const{activate:l,activateContainerActionPayload:u}=kc(uy.CASE,o,e);return l&&!r&&"none"!==s?ql({type:ve,activateContainerActionPayload:u,actionInPayload:e}):cy(e,{removeActionPayload:i})})),Bl((async e=>{if(e&&Xr(e.type))return n.push(wc(e)),n;const t=ch(e?.actionInPayload?.context),r=ls(e?.actionInPayload.className);if("none"===e?.actionInPayload?.viewType){if("perform"!==t?.context_data?.caseViewMode){const t=Pm(e?.response),s={data:{...t?.data},context:e?.actionInPayload?.context,isArrayDeepMerge:!0};n.push({type:st,payload:{context:s.context,doDeleteConfirmationDetails:!1}}),r&&s.data.caseInfo?.content&&(s.data.caseInfo.content.coexistenceAction="openWorkByHandle"),n.push(og(wh,s));const a=xd(e?.actionInPayload?.context),o=zr(e?.actionInPayload?.context),i=Object.freeze({target:a,containerItemID:e?.actionInPayload?.context,context:e?.actionInPayload?.context,containerName:o});if(as(e?.actionInPayload?.context)){const t=Dc(e?.response,{...i});Gc({...t,isArrayDeepMerge:!0},n)}}}else await dy(e,n,r);return n})),$l((()=>(ih(n),cs(n,t),n=[],n))))},hy="FINISH_ASSIGNMENT",{RESOURCE_TYPES:gy}=F,fy=(e,t)=>{const{containerItemID:n,skipReleaseLockRequest:r,isInCreateStage:s,isProcessAction:a}=t,o=yd(n),i=`${o?.includes("root")?j.APP.ROOT:j.APP.APP}/${td.MODAL}`;e.push(og(Zh,{containerItemID:n,context:o,target:i,skipReleaseLockRequest:r,isInCreateStage:s,isProcessAction:a}))},my=e=>dh(".openCaseViewAfterCreate",j.CONTEXT_DATA,e)??!0,yy=async(e,{translatedDXAPIResponse:t,actionInPayload:n},r,s)=>{const{caseID:a}=n,o=(i=t,Sh.getIn(i,Hr.NEXT_ASSIGNMENT_INFO_ID,j.EMPTY_STRING));var i;const c=es(t),{caseViewMode:l,headers:u,semanticURL:d,actionMgrID:p,directUrlUpdation:h,key:g,flowName:f,resourceType:m}=r;s&&Object.assign(s,{caseId:a,assignmentId:o,caseType:c}),fy(e,{...n,skipReleaseLockRequest:!0});const y=`${n?.containerItemID.includes("root")?j.APP.ROOT:j.APP.APP}/${td.PRIMARY}`,I=Lc(y,td.PRIMARY),E=nc.getCoreHeadersFromContext(n.context)||!1,A=Dc(t,{target:y,context:I,containerItemID:I,caseViewMode:l,headers:u,semanticURL:d,key:g,flowName:f,resourceType:m,directUrlUpdation:h,debugInfo:E&&E.debugInfo&&{debugId:E.debugInfo[j.COREHEADER_APP_DEBUG_ID]}});if(Sd(y)){const t=ch(I),s=ns({data:t}),[,a]=s?s.split(" "):[],o=`You will lose unsaved changes for ${a}. Do you want to continue?`;if(!my(n.context))return e;{const{continueExecution:t}=jc(y,{dirtyMessage:o});if(!t)return r.directUrlUpdation=!1,ln.rejectActionByID(p),Kl();A.currentCaseViewMode=ps(A?.context),e.push(og(ng,A))}}else e.push(og($h,A));return t.directUrlUpdation=h,t.semanticURL=d,await bc(t,{...A,acName:y},{acName:y,context:I}),e},Iy=e=>/^app\/preview_[0-9]*/g.test(e),Ey=(e,t)=>{const n=W(e);return!Iy(e)&&(n===t||/^app\/primary_[0-9]*/g.test(n))},Ay=async(e,t,n,r,s,a,o,i,c)=>{const{headers:l}=c;if(e){if("object"!=typeof c?.response?.uiResources?.root){const t=(e,t)=>{const n=e.findIndex((e=>e.ID===t));if(-1!==n){const[t]=e.splice(n,1);e.unshift(t)}return e},n=ch(e),r=c?.response?.data?.caseInfo?.assignments??[],s=n?.caseInfo?.assignments??[],a=ps(e)===j.PERFORM_MODE,o=r[0]?.ID!==s[0]?.ID,i=r.length>0&&s.length>0;a&&o&&i&&c?.response?.data?.caseInfo?.assignments&&(c.response.data.caseInfo.assignments=t(r,s[0]?.ID))}const u=Sd(xd(e));let d=!1;const p=xd(n),h=rd(p),g=gd(p);g&&h?.items?.[g]?.key===c?.actionInPayload?.caseID&&(d=!0),fy(s,{...r,skipReleaseLockRequest:!0});const f=zr(e),m={target:xd(e),containerItemID:e,context:e,containerName:f};t.doDeleteCaseSummary=r.doDeleteCaseSummary;const y=X(n),I=ch(y),E=ch(r.context),A=I?.caseInfo?.ID,_=E?.caseInfo?.ID,C=ch(e)?.caseInfo?.ID;if(u&&A===_||!u&&(""===o||"review"===t.caseViewMode||!a&&t.root&&0===Object.keys(t.root).length&&C===t.data?.caseInfo?.ID))(void 0===t?.data?.caseInfo?.content||void 0!==t.data.caseInfo.content&&"object"==typeof t.data.caseInfo.content&&0===Object.keys(t.data.caseInfo.content).length)&&(t.root=void 0,delete t.data?.caseMessages),s.push(og(zh,{...t,key:o,resourceType:"",...m}));else if(a){const a=xd(e),i=ld(a,o);if(i)m.target=a,m.context=i,m.containerItemID=i,s.push(og(zh,{...t,key:o,resourceType:"",...m}));else{const e=Ad(n)[0];if(r.target=e,r.context=Lc(e,j.WORKAREA,n),r?.context){r.containerItemID=r.context,s.push(og($h,{...r,...t}));const n=r.containerItemID;s.push(og(Jh,{parentContainerTarget:e,containerItemID:n}))}}}if(r.target=xd(e),r.containerName=zr(e),r.context=e,r.containerItemID=e,Sh.setIn(t,"acName",m.target),await bc(i,t),d){const{data:e,caseViewMode:r}=t;n.includes(j.WORKAREA)&&as(n)&&(n=X(n));const a={data:e,caseViewMode:r,context:n};Sh.setIn(a.data,["context_data","caseViewMode"],r),s.push({type:st,payload:{context:n}}),s.push(og(wh,a))}if(!a&&t.caseViewMode===j.PERFORM_MODE){const t=((e,t)=>{const n=xd(e);return ld(n,t)})(e,o),n={data:{caseInfo:{headers:l}},context:t};s.push(og(wh,n)),s.push(Dn(((e,t=!1,n=!1)=>{const r=ln.getNextActionMgrId();return{ID:Rh.getPropertyValue(F.CASE_INFO.ASSIGNMENT_ID,"",e),actionID:Rh.getPropertyValue(F.CASE_INFO.ASSIGNMENTACTION_ID,"",e),context:e,caseWideAction:t,contextData:n,options:{actionMgrID:r}}})(t)))}}else{fy(s,r);let e=!1;const o=xd(n),i=rd(o),l=gd(o);if(l&&i?.items?.[l]?.key===c?.actionInPayload?.caseID&&(e=!0),a){const e=Ad(n)[0];r.target=e,r.context=Lc(e,j.WORKAREA,n),r.containerItemID=r.context,s.push(og($h,{...r,...t}));const a=r.containerItemID;s.push(og(Jh,{parentContainerTarget:e,containerItemID:a}))}if(e){const{data:e,caseViewMode:r}=t,a={data:e,caseViewMode:r,context:n};Sh.setIn(a.data,["context_data","caseViewMode"],r),s.push({type:st,payload:{context:n}}),s.push(og(wh,a))}}},_y=async(e,t,n,r,s,a)=>{((e,t,n)=>{if(t.isProcessAction&&(fy(n,{...t,skipReleaseLockRequest:!0}),e)){const r=`${t?.containerItemID.includes("root")?j.APP.ROOT:j.APP.APP}/${td.PRIMARY}`,s=Lc(r,td.PRIMARY),a={insKey:e.ID,className:e.content.classID,context:s,acTargetName:j.PRIMARY,isChild:!0},o={type:ue,payload:{...a}};n.push(o)}})(e.data.caseInfo.parentCaseInfo,t,s);const o=e?.data?.caseInfo?.parentCaseInfo?.ID;if(o){const n=xd(t?.context),r=sd(n,t?.context)?.parentContext,s=xd(r);t?.isProcessAction&&cd(s,o)&&Kd(r,e?.data?.caseInfo?.lastUpdateTime)}n.resourceType=gy.CASE,n.directUrlUpdation=!0,t.isProcessAction||await yy(s,{translatedDXAPIResponse:r,actionInPayload:t},n,a)},Cy=async(e,t,n,r,s)=>{e.doDeleteCaseSummary=t.doDeleteCaseSummary,e.caseViewMode===j.REVIEW_MODE&&(e.flowName=" ",e.clearView=!0);const{containerItemID:a}=t,o=Cc.getPropertiesToReplace(a);s.push(og(zh,{...e,...r,propertiesToReplace:o})),Sh.setIn(e,"acName",r.target),await bc(n,e),((e,t,{data:n,caseViewMode:r})=>{const{containerItemID:s}=t,a=yd(s);if(a&&as(s)){const t=X(a),o={data:n,caseViewMode:r,context:t};Sh.setIn(o.data,["context_data","caseViewMode"],r),e.push({type:st,payload:{context:t}});const i=Cc.getPropertiesToReplace(s);e.push(og(wh,o,{propertiesToReplace:i}))}})(s,t,e)},Sy=async(e,t,n,r,s,a,o,i,c)=>{const{isCaseWideAction:l,isInCreateStage:u,containerItemID:d}=e,p=W(e.context),h=ts(s),g=es(s),f=u&&!h&&!l,m=Ad(p)[0],y=m?gd(m):p,I=zr(d),E=yd(d),A=Object.freeze({target:e.target,containerItemID:d,context:E,containerName:I});f&&!Iy(e.context)?await _y(i,e,t,s,a,c):Ey(e.context,y)?await Ay(y,t,p,e,a,n,r,s,o):l&&!Ey(e.context,y)?(fy(a,e),((e,t,n)=>{const{containerItemID:r,caseID:s}=t;if(r&&/^app\/preview_[0-9]*/g.test(r)){const{caseClassName:t}=n,a=W(r),o=yd(a);e.push(og(Lh,{containerItemID:a,context:o,container:td.PREVIEW,containerName:td.PREVIEW,caseId:s,viewName:F.PREVIEW_VIEW_NAME,caseClassName:t,updateData:!0}))}})(a,e,{caseClassName:g})):await Cy(t,e,s,A,a)},Ty=(e,t)=>{const{assignmentID:n,actionID:r,caseID:s,context:a,additionalHeaders:o={},isCaseWideAction:i,outcome:c,jsActionQueryParams:l}=e,{state$:u}=t,d=(e=>{const{isModalAction:t,viewType:n,isInCreateStage:r,isCaseWideAction:s}=e;return t&&r&&!s?Tc.PAGE:n||Tc.FORM})(e),p=(e=>{const{isCaseWideAction:t}=e;return t?Ye:"finishAssignment"})(e),h={assignmentID:n,actionID:r,caseID:s,viewType:d};let{restApi:g}=Ng(p,h),{reqType:f}=Ng(p,h);d&&!g?.includes("viewType=")&&(g=g?.includes("?")?`${g}&viewType=${d}`:`${g}?viewType=${d}`),c&&!g?.includes("outcome")&&(g=g?.includes("?")?`${g}&outcome=${c}`:`${g}?outcome=${c}`),g=((e,t)=>(e&&Object.keys(e).forEach((n=>{t+=`&${n}=${e[n]}`})),t))(l,g),i&&(f="PATCH"),e.viewType=d;const{content:m,attachmentsExist:y}=Rc(a);e.attachmentsExist=y;const I=u.value.data[a]?.caseInfo?.headers||{},{etag:E}=I,A={"if-match":E,...o};return ki(pc(g,{method:f,body:m,headers:A},a)).pipe($l((t=>{const{data:n,headers:r}=t;return{response:n,actionInPayload:e,headers:Pc({...A,...r})}})),Xl("Error occurred during ajax call at finishAssignment Epic : ",a))},{RESOURCE_TYPES:Ny}=F,Py=(e,t)=>{let n=0,r=[],s={},a="",o={},i=!1,c=!1;return e.pipe(Vl(hy),kl((e=>{const l=up.isCoexistenceAppOfType(j.APP_TYPE.UIKIT);if(({actionMgrID:n}=e.payload),a=e.payload.context,zn({context:a,stateObj:ch(a),clearContextMessages:!0}),!il(a)){const t={type:F.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return ln.rejectActionByID(n,!0,t),bu.handleDeferredActionCompletion(e.payload.context),ql([])}return ql(e.payload).pipe(Bl((e=>{((e,t)=>{const{containerItemID:n,context:r,actionMgrID:s,isInCreateStage:a,isModalAction:o}=t;if(a&&o){const t=zr(n),a=mt(t,r);e.push(og(Jh,{containerItemID:n,target:a,actionMgrID:s}))}})(r,e);const n={...e};return Ty(n,{state$:t})})),Bl((async e=>{if(e&&e.type===Ee){(e=>{const t=e?.payload?.err?.response?.data?.displayButtonsOnErrors||[],n=e?.payload?.err?.response?.status;if(Array.isArray(t)&&t.length>0&&424===n){t.forEach((e=>{e.isErrorButton=!0}));const n=e.payload.context,r=ch(n),s=((e,t)=>(e.forEach((e=>{!0!==e.isErrorButton||t.some((t=>t.actionID===e.actionID))||(t=[...t,e])})),t))(t,r?.caseInfo?.actionButtons?.secondary||[]),a={data:{caseInfo:{actionButtons:{secondary:s}}},target:xd(n),context:n};ih({type:fe,payload:a})}})(e);const t=wc(e);return r.push(t),r}Pu.clearContextedCache(a);const{headers:t,actionInPayload:u,response:d}=e,{containerItemID:p,context:h=yd(p),isModalAction:g,isInCreateStage:f}=u;i=u.isCaseWideAction,c=u.isProcessAction;const m=xd(p);u.target=m;const y=zr(p),I=Object.freeze({target:u.target,containerItemID:p,context:h,containerName:y});Sh.setIn(d.data,j.CASE_INFO.IS_FIRST_ASSIGNMENT,!1),Sh.setIn(d.data,j.CASE_INFO_IS_LOCAL_ACTION,!1),d?.uiResources?.root?.config?.name&&"page"!==u.viewType&&Sh.setIn(d.data,j.CASE_INFO.VIEW_NAME,d?.uiResources?.root?.config?.name),(e=>{Gr.publish(j.PUB_SUB_EVENTS.EVENT_EXPRESS_LOCALACTION,e)})({submitResponse:d});let E=Pm(d,{[F.STOPMERGEACTIONS]:!d.nextAssignmentInfo});const A=es(E),_=W(u.context),C=Ad(_)[0]?gd(Ad(_)[0]):_,S=ts(E),T=f&&!S;!g||f||Ey(u.context,C)||(E=((e,t)=>(e?.data?.caseInfo&&t?.caseInfo?.content&&(e.data.caseInfo.content=t?.caseInfo?.content),e))(E,ch(p)));const N=Dc(E,{headers:t,actionMgrID:n,directUrlUpdation:!1});let P,R;is(N.data,u),N.caseClassName=A,N.resourceType=Ny.ASSIGNMENT,N.headers=t;const D=E?.data?.caseInfo?.assignments?.some((e=>e.ID===u.assignmentID)),b=((e,t)=>{const{assignmentID:n}=t;return e?.data?.caseInfo?.assignments?.some((e=>e.ID===n&&"true"===e?.canPerform))})(E,u),O=((e,t,n,r,s)=>{let a;const o=xd(t);return a=Td(o)?ld(o,n.data?.caseInfo?.ID):gd(o),r&&e&&ph(null,j.CASE_VIEW_MODE_PROP,a)===j.PERFORM_MODE&&s})(D,C,E,g,b),v=u?.actionID===F.LOCAL_ACTIONS.TRANSFER_ASSIGNMENT;if(E?.data?.nextAssignmentInfo&&!v)N.caseViewMode=j.PERFORM_MODE,P=ns(E),R=!0;else if(O&&!v)N.caseViewMode=j.PERFORM_MODE,P=ns(E),N.flowName=" ",N.deleteAssignmentSpecificResources=!1,R=!1;else{N.caseViewMode=j.REVIEW_MODE;const e=Sd(xd(C));P=E?.confirmationNote&&E?.uiResources?.root?.config?.name===j.PY_CONFIRM&&!e?ns(E):"",R=!1}const x=ns(E);os(N,E,{skipFlowNameUpdate:N?.caseViewMode===j.REVIEW_MODE||O});const w=Sg("createWork",{caseClassName:A}).replace(/{.+?}/,String(Zr(x)));if(E.semanticURL=w,N.semanticURL=w,g?(await Sy(u,N,R,P,E,r,e,d,o),T&&(s=(e=>{if(!my(e.context)){let t;const n=e?.caseTypeID,r=e?.caseTypeName;return t=e.businessID?e.businessID:e.workID,{caseID:t,caseTypeID:n,caseTypeName:r}}return{}})(u))):f&&l&&!S?(up.setDefaultCasePage("pyDetails"),await(async(e,t,n)=>{const r={assignmentID:e?.data?.caseInfo?.assignments[0]?.ID,className:e?.data?.caseInfo?.content?.classID,containerName:td.PRIMARY,targetContainerName:td.PRIMARY,viewType:Tc.PAGE,isLastStepInCreateStage:!0,context:n},s={type:ge,payload:{...r}};t.push(s)})(d,r,W(h))):await Cy(N,u,E,I,r),ds(e,r),bu.handleDeferredActionCompletion(a),((e,t,n)=>{const{isModalAction:r,isCaseWideAction:s,caseID:a}=t,o=Ey(t.context,n),i=e?.data?.caseInfo?.stages||[],c=e?.data?.caseInfo?.stageID;Wr({caseID:a,isModalAction:r,isModalLaunchedFromPrimaryValue:o,isCaseWideAction:s,stages:i,stageID:c})})(N,u,C),!E?.data?.nextAssignmentInfo){const e=((e,t)=>{const{isCaseWideAction:n,assignmentID:r,actionID:s}=t;return{isCaseWideAction:n,caseID:ns(e),assignmentID:n?null:r,actionID:n?s:null}})(E,u);(e=>{Gr.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.END_OF_ASSIGNMENT_PROCESSING,e)})({...e,containerItemID:p})}return((e,{isModalAction:t,target:n,transientItemID:r})=>{if(t){const t=e.find((({type:e})=>e===Me));t?.payload&&(n=t.payload.target,r=t.payload.containerItemID)}const s=eg({target:n,containerItemID:r});s.payload.transientItems.length&&e.push(s)})(r,{transientItemID:p,target:m,isModalAction:g}),r})),$l((()=>{const e=r.find((e=>e.type===Ee));return e?(bu.handleDeferredActionCompletion(a),(e=>{const t=e?.payload?.err?.errorDetails,n=e?.payload?.context;t?.forEach((e=>{e[j.ERROR_FIELD_IN_PAGE]=e[j.ERROR_FIELD_IN_PAGE].replace(/(\(\d+\))/g,(e=>`[${parseInt(e.substring(1,e.length-1),10)-1}]`));const t=e[j.ERROR_FIELD_IN_PAGE].slice(1),r=e[j.ERROR_IN_PAGE_IDENTIFIER],s=r.startsWith(".")?r.slice(1):r;if(s){let a=t?`caseInfo.content.${t}`:"caseInfo.content";a=a.replace(/\(/g,"[").replace(/\)/g,"]");const o=Bn(s,a,j.PROPERTY),i={type:F.MESSAGES.MESSAGES_TYPE_ERROR,message:e.localizedValue};Pn.mutateField(n,a,o[o.length-1],{messages:[i],type:F.MESSAGES.MESSAGES_TYPE_ERROR,fieldName:r})}}))})(e),ln.rejectActionByID(n)):ln.resolveActionByID(n,s),o?.caseId&&(e=>{Gr.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_DONE,e)})(o),Wc(r),(i||c)&&(e=>{Gr.publish(j.PUB_SUB_EVENTS.EVENT_LOCALACTION_SUBMISSION,e)})({updateState:!0}),r=[],s={},o={},r})))})))},Ry="CANCEL_ASSIGNMENT",Dy=e=>{const t={},{routeKey:n,isModalAction:r,caseID:s,context:a,RemoteSystemID:o}=e;o&&(t.RemoteSystemID=o);const i=n||"releaseAssignmentLock",{restApi:c,reqType:l}=Ng(i,{ID:s,caseID:s,viewType:Tc.PAGE});return ec.getPreviewMode()&&(t[j.SKIPCOREHEADERS]=!0),ki(pc(c,{method:l,headers:t},a,{includeRemoteSystemIdIfPresent:!!o})).pipe($l((t=>r?{actionInPayload:e}:{response:t.data,actionInPayload:e,headers:Pc(t.headers)})),Xl(": Error occurred during ajax call at release lock request : ",a))},by=(e,t)=>{const{isModalAction:n}=t;return Dy({routeKey:"cancelAssignment",isModalAction:n,...e})},Oy=e=>{let t=0,n=[];return e.pipe(Vl(Ry),$l((e=>(({actionMgrID:t}=e.payload),e.payload))),Bl((e=>{const{isModalAction:n}=e;e.context||(e.context=yd(e.containerItemID));const{context:r}=e,s=(e=>{const{isModalAction:t,containerItemID:n}=e;return t?td.MODAL:zr(n)})(e),a=mt(s,r),{continueExecution:o}=jc(a);return o?(e.RemoteSystemID=$.getRemoteHeaderByContext(e.context)??void 0,by(e,{isModalAction:n})):(ln.rejectActionByID(t),Kl())})),Bl((async e=>{if(e&&e.type===Ee)return n.push(wc(e)),n;const{actionInPayload:r,response:s}=e,{containerItemID:a,isModalAction:o,isInCreateStage:i}=r,c=xd(a),l=yd(a),u={target:o?`${j.APP.APP}/${j.MODAL}`:c,containerItemID:a,caseViewMode:o?j.PERFORM_MODE:j.REVIEW_MODE,context:l,actionMgrID:t,key:ns(s),skipReleaseLockRequest:!1};return i&&n.push(og(zh,u)),!o&&as(a)&&(async(e,t)=>{const{childContainerItemID:n,caseViewMode:r,referencedUsers:s}=t,a=W(n),o={context:yd(a),data:{referencedUsers:s,context_data:{caseViewMode:r}}};o.data={...t.response.data,...o.data},e.push(og(wh,o))})(n,{childContainerItemID:a,caseViewMode:j.REVIEW_MODE,referencedUsers:s?.data.referencedUsers,response:s}),u.skipReleaseLockRequest=!0,n.push(og(Zh,u)),n})),$l((()=>(ih(n),cs(n,t),n=[],n))))},vy="NAVIGATE_TO_STEP",xy=(e,t)=>{const{ID:n,stepID:r,containerItemID:s,context:a=yd(s),isInCreateStage:o}=e,{state$:i}=t,c={ID:n,stepID:r,viewType:o?Tc.PAGE:Tc.FORM},{restApi:l,reqType:u}=Ng("navigateToStep",c),{content:d}=Rc(a),p=i.value.data[a].caseInfo.headers;return ki(pc(`${l}`,{method:u,body:d,headers:{"if-match":p&&p.etag}},a)).pipe($l((t=>({response:t.data,actionInPayload:e,headers:Pc({...p,...t.headers})}))),Xl("Error occurred during ajax call at navigateToStep Epic : ",a))},{RESOURCE_TYPES:wy}=F,My=(e,t)=>{let n=0,r=[];return e.pipe(Vl(vy),kl((e=>(({actionMgrID:n}=e.payload),ql(e.payload).pipe(Bl((e=>(Jn(e.context),xy(e,{state$:t})))),Bl((async e=>{if(e&&Xr(e.type))return r.push(wc(e)),r;const{actionInPayload:t,response:n,headers:s}=e,{containerItemID:a,context:o=yd(a),isModalAction:i}=t;Pu.clearContextedCache(t.context);const c=xd(a),l=zr(a),u=Object.freeze({target:c,containerItemID:a,context:o,containerName:l}),d=n?.data?.caseInfo?.content,p=n?.uiResources?.root?.config?.name,h=n?.uiResources?.root?.config?.context;d&&!d.pyViewName&&p&&"page"!==t.viewType&&(Sh.setIn(d,"pyViewName",p),Sh.setIn(d,"pyViewContext",h));const g=Pm(n),f={acName:c,...u};await bc(g,t,f);const m=Dc(g,{...u,headers:s});n?.nextAssignmentInfo||(m.caseViewMode=j.REVIEW_MODE),m.doDeleteCaseSummary=t.doDeleteCaseSummary,m.resourceType=wy.ASSIGNMENT,os(m,g),is(m.data,t);const y=g.data?.caseInfo?.stages,I=g.data?.caseInfo?.stageID;return Wr({caseID:ns(g),isModalAction:i,stages:y,stageID:I}),as(a)&&Gc(m,r),r.push(og(zh,m)),$c(r),r})),$l((()=>(ih(r),cs(r,n),r=[],r))))))))},Ly=e=>{const{caseID:t,context:n}=e,{restApi:r,reqType:s}=Ng("deleteCaseInCreateStage",{ID:t});return ki(pc(r,{method:s},n)).pipe($l((t=>({response:t.data,actionInPayload:e,headers:Pc(t.headers)}))),Xl(": Error occurred during ajax call at deleteCaseInCreateStage Epic : ",n))},Uy=e=>{Gr.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_DELETED,e)},Fy=(e,t)=>{let n,r=0,s=[];return e.pipe(Vl(wl),$l((e=>(({actionMgrID:r,caseType:n}=e.payload),e.payload))),Bl((e=>e.ignoreCaseDeletion?ql({actionInPayload:e}):Ly(e))),Bl((async e=>{if(e&&Xr(e.type)){const{payload:t}=e,n=wc({...e,...t,actionMgrID:r});return s.push(n),s}const{actionInPayload:n}=e,{context:a,isModalAction:o}=n,i=o?td.MODAL:td.PRIMARY,c=mt(i,a);if(!o&&c){const e={acName:c,target:c,context:a},r=t.value.containers[c],{semanticURL:s}=(e=>{const{accessedOrder:t,items:n}=e;if(t&&t.length>1){const e=n[t[t.length-2]],{semanticURL:r}=e;if(r)return e}return{semanticURL:""}})(r);await bc({directUrlUpdation:!0,semanticURL:s},n,e)}if(n.isProcessAction&&n.parentCaseInfo){const e={insKey:n.parentCaseInfo.ID,className:n.parentCaseInfo.content.classID,context:n.parentContext,acTargetName:j.PRIMARY,isChild:!0},t={type:ue,payload:{...e}};s.push(t)}const l={target:c,containerItemID:a,context:a,caseDeleted:!0};return s.push(og(Zh,l)),s})),$l((()=>(ih(s),cs(s,r)===j.PROMISE_VALUE.RESOLVE&&Uy({caseType:n}),s=[],s))))},jy=(e,t)=>{const{assignmentID:n,actionID:r,context:s}=e,{restApi:a,reqType:o}=Ng("save",{assignmentID:n,actionID:r}),{content:i}=Rc(s),c=t.value.data[s]?.caseInfo?.headers;return ki(pc(a,{method:o,body:i,headers:{"if-match":c&&c.etag}},s)).pipe($l((t=>({response:t.data,actionInPayload:e,headers:Pc(t.headers)}))),Xl(": Error occurred during ajax call at saveAndCloseAssignment Epic at save action : ",s))},Vy=(e,t=!1)=>{const{action:n,state$:r,actionMgrID:s}=e;let a=[];return ql(n.payload).pipe(Bl((e=>jy(e,r))),Bl((e=>{if(e&&Xr(e.type))return ql(e);if(e.actionInPayload.isProcessAction&&e.response.data.caseInfo.parentCaseInfo){const t=`${e.actionInPayload?.containerItemID.includes("root")?j.APP.ROOT:j.APP.APP}/${td.PRIMARY}`,n=Lc(t,td.PRIMARY),r={insKey:e.response.data.caseInfo.parentCaseInfo.ID,className:e.response.data.caseInfo.parentCaseInfo.content.classID,context:n,acTargetName:j.PRIMARY,isChild:!0},s={type:ue,payload:{...r}};a.push(s)}const{containerItemID:t}=e&&e.actionInPayload,r=W(t),s=xd(r),o=rd(s),i=Ad(r)[0]?gd(Ad(r)[0]):r,c=gd(s);n.payload.canUpdateAvailableActions&&Nm(e.response);if(i&&a.push((t=>og(wh,{context:t,data:{caseInfo:{headers:e.headers}}}))(i)),o?.items?.[c]?.key===e?.actionInPayload?.caseID){const n={context:r,data:{...e.response.data,caseInfo:{...e.response.data?.caseInfo||{},headers:e.headers}}},s=Cc.getPropertiesToReplace(t);a.push(og(wh,n,{propertiesToReplace:s})),a.push(og(zh,{context:t}))}return ds(e,a),e.actionInPayload.RemoteSystemID=$.getRemoteHeaderByContext(e.actionInPayload.context)??void 0,Dy(e.actionInPayload)})),Bl((async n=>{if(n&&Xr(n.type)){const{payload:t}=n,r=wc({...n,...t,actionMgrID:s});a.push(r);const o=e.action.payload.modalLoadingContainer;if(o){const e=o.context,{context_data:t}=ch(e)||{};t?.isLoading&&wd(e)}return a}const{actionInPayload:r}=n,{context:o,containerName:i}=r,c={target:mt(i,o),containerItemID:o,context:o};return t||a.push(og(Zh,c)),a})),$l((()=>(ih(a),cs(a,s),t||(a=[]),a))))},ky=(e,t)=>{let n,r=0;return e.pipe(Vl(Ml),kl((e=>{const{saveOnly:s}=e.payload;({actionMgrID:r,caseType:n}=e.payload);return Vy({action:e,state$:t,actionMgrID:r,caseType:n},s)})))},$y=e=>{const{callbacks:t}=e;if(t?.submit){const e=e=>{var n;t.submit(e),n="expressLocalActionSubmit",Gr.unsubscribe(j.PUB_SUB_EVENTS.EVENT_EXPRESS_LOCALACTION,n)};n=e,r="expressLocalActionSubmit",Gr.subscribe(j.PUB_SUB_EVENTS.EVENT_EXPRESS_LOCALACTION,n,r)}var n,r},{LOCAL_ACTION_TYPE:By}=j,{RESOURCE_TYPES:Gy}=F,Wy=(e,t)=>{const{actionID:n,assignmentID:r,caseID:s,context:a,openActionType:o,modalLoadingContainer:i,headers:c}=e,{isProcessAction:l}=t,u=l?ze:(e=>{const t=e.localActionType.toLowerCase();return t===By.CASE_WIDE||t===By.EXPRESS?Ye:qe})(e),d=Tc.FORM,{reqType:p}=Ng(u,{caseID:s,ID:r,actionID:n,viewType:d});let{restApi:h}=Ng(u,{caseID:s,ID:r,actionID:n,viewType:d});e.actionType=u===Ye?j.CASE:j.ASSIGNMENT,h&&!h.includes("viewType=")&&(h=h.includes("?")?`${h}&viewType=${d}`:`${h}?viewType=${d}`);const g=i?.context??a;return ki(pc(h,{method:p,headers:c},g)).pipe($l((t=>({response:t.data,actionInPayload:e,headers:Pc(t.headers)}))),Xl(`: Error occurred during ajax call at ${o} Epic : `,g))},Hy=(e,t)=>{const{isProcessAction:n}=t,r=n?ze:qe;e.openActionType=r;let s;if("modal"===qr(r,e)){s=Ad(e.contextName)[0]?Ad(e.contextName):xd(e.contextName);const n=s?gd(s):e.contextName,r=yd(n),a=qr(e.openActionType,e),o=mt(a,e.context),i=K(e.context,H(a,e.context));if(ih($h({target:o,context:i,containerItemID:i,key:e.caseID,caseViewMode:j.PERFORM_MODE,actionName:e.name,showProgress:!0,root:{type:"reference",config:{context:j.CASE_INFO.CASE_INFO_CONTENT,type:"view"}},data:{key:e.caseID,caseInfo:{ID:e.caseID}}})),ih(Yh({context:i})),e.modalLoadingContainer={target:o,context:i},!Ad(e.contextName)[0])return Wy(e,t);if(!e.continueExecution)return Wy(e,t);if(!Nl(r))return Wy(e,t);e.saveActionPayload.modalLoadingContainer=e.modalLoadingContainer,e.saveActionPayload.canUpdateAvailableActions=!e.saveActionPayload.isModalAction;return ki([Ll(e.saveActionPayload)]).pipe(Bl((e=>(e=>{let t,n=0;const r=[],s={value:oh()?.getState()};return ql(e).pipe(Vl(Ml),kl((e=>{const{isFormValid:a}=e.payload;if(({actionMgrID:n,caseType:t}=e.payload),!a){const e={type:F.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return ln.rejectActionByID(n,!0,e),ql([])}return Vy({action:e,state$:s,actionMgrID:n,caseType:t,actionsOut:r},!0)})))})(e))),Bl((n=>{if(1===n.length&&Xr(n[0].type)){const{continueExecution:n}=jc(s);if(!n)return ln.rejectActionByID(e.actionMgrID),Yl.pipe($i((()=>Kl()))).toPromise();if(n)return Wy(e,t)}return Wy(e,t)})),$l((e=>e)))}return Wy(e,t)},qy=async(e,t,{headers:n,actionInPayload:r})=>{const{context:s,actionName:a,openActionType:o,doDeleteCaseSummary:i,modalLoadingContainer:c}=r,l=Pm(e),u=qr(o,r),d=c?.target??mt(u,s);let p,h,g=!1;!Nd(d)||Td(d)&&!cd(d,e.data.caseInfo.ID)?(h=H(u,s),Kr(u)&&(h=K(s,h)),p=h,g=!0):(p=Td(d)?ld(d,e.data.caseInfo.ID):gd(d),h=yd(p));const f={acName:d,target:d,containerName:u,context:h};await bc(l,r,f),(void 0===l?.data?.caseInfo?.content||void 0!==l.data.caseInfo.content&&"object"==typeof l.data.caseInfo.content&&0===Object.keys(l.data.caseInfo.content).length)&&delete l.data?.caseMessages;const m=l.uiResources?.root;let y;y=m?j.PERFORM_MODE:j.REVIEW_MODE;const I=Dc(l,{target:d,context:h,containerItemID:p,caseViewMode:y,doDeleteCaseSummary:i,headers:n,actionName:a,isMinimizable:!1,isInCreateStage:Kr(u),resourceType:Gy.ASSIGNMENT,isProcessAction:r.isProcessAction,showProgress:r.showProgress,progressMessage:r.progressMessage,assignmentID:r.assignmentID,actionType:r.actionType});m&&os(I,l),Kr(u)&&delete I.doDeleteCaseSummary,r.openActionType===Ke&&(I.isBulkAction=!0,I.data.caseInfo.actionButtons.main[0].jsAction="async"===r.runningMode?"submitBulkActionAsync":"submitBulkAction",I.data.caseInfo.actionButtons.secondary[0].jsAction="cancelBulkAction",I.data.caseInfo.cases=r.selectedList);const E=g?$h:zh;if(I.data.context_data.isProcessAction=r.isProcessAction,t.push(og(E,I)),g||t.push(og(Kh,I)),g){const s=Ad(r.contextName),a=ld(s,e.data.caseInfo.ID);if(a){const e={data:{caseInfo:{headers:n}},context:a};t.push(og(wh,e))}}return p!==gd(d)&&t.push(og(Jh,{target:d,containerItemID:p})),as(p)&&!c?.context&&Gc(I,t),I.caseViewMode===j.REVIEW_MODE&&t.push(og(Zh,I)),t},zy="OPEN_LOCAL_ACTION",Yy=(e,t)=>Hy(e,t),Ky=e=>{let t=0,n=[];return e.pipe(Vl(zy),$l((e=>(({actionMgrID:t}=e.payload),e.payload))),Bl((e=>Yy(e,{actionMgrID:t}))),Bl((async e=>{if(!e)return Yl;if(Xr(e.type)){const t=wc(e);n.push(t);const{context_data:r}=ch(e.payload.context)||{};return r?.isLoading&&n.push(og(Kh,e.payload)),n}const{actionInPayload:t,headers:r,response:s}=e,{actionID:a}=t;return Sh.setIn(s,"data.caseInfo.activeActionID",a),Sh.setIn(s.data,j.CASE_INFO_IS_LOCAL_ACTION,!0),t.refreshConditions&&Sh.setIn(s.data,j.CASE_INFO_REFRESH_CONDITIONS,t.refreshConditions),await qy(s,n,{headers:r,actionInPayload:t}),$y(t),n})),$l((()=>(ih(n),cs(n,t),n=[],n))))},Xy=e=>{const{actionID:t,context:n,openActionType:r,caseTypeID:s,bulkContextID:a="",bulkContextType:o=""}=e,i=Ke,{reqType:c,restApi:l}=Ng(i,{caseTypeID:s,actionID:t,bulkContextID:a,bulkContextType:o});return ki(pc(l,{method:c},n)).pipe($l((t=>({response:t.data,actionInPayload:e,headers:Pc(t.headers)}))),Xl(`: Error occurred during ajax call at ${r} Epic : `,n))},Jy=e=>{const{callbacks:t}=e;if(t?.submit){const e=e=>{var n;t.submit(e),n="bulkActionSubmit",Gr.unsubscribe(j.PUB_SUB_EVENTS.EVENT_BULKACTION,n)};n=e,r="bulkActionSubmit",Gr.subscribe(j.PUB_SUB_EVENTS.EVENT_BULKACTION,n,r)}var n,r},Qy="OPEN_BULK_ACTION",Zy=e=>{let t=0,n=[];return e.pipe(Vl(Qy),$l((e=>(({actionMgrID:t}=e.payload),e.payload))),Bl((e=>((e,t)=>{const{context:n}=e,{actionMgrID:r}=t;e.openActionType=Ke;const s=qr(Ke,e),a=mt(s,n),{continueExecution:o}=jc(a);return o?Xy(e):(ln.rejectActionByID(r),Kl())})(e,{actionMgrID:t}))),Bl((async e=>{if(e&&Xr(e.type)){const t=wc(e);return n.push(t),n}const{actionInPayload:t,headers:r,response:s}=e,{actionID:a}=t;return Sh.setIn(s,"data.caseInfo.activeActionID",a),await qy(s,n,{headers:r,actionInPayload:t}),Jy(t),n})),$l((()=>(1===n.length&&Xr(n[0].type)?ln.rejectActionByID(t):ln.resolveActionByID(t),ih(n),n=[],n))))};var eI=Array.isArray,tI=Object.getPrototypeOf,nI=Object.prototype,rI=Object.keys;function sI(e){if(1===e.length){var t=e[0];if(eI(t))return{args:t,keys:null};if((r=t)&&"object"==typeof r&&tI(r)===nI){var n=rI(t);return{args:n.map((function(e){return t[e]})),keys:n}}}var r;return{args:e,keys:null}}var aI=Array.isArray;function oI(e){return $l((function(t){return function(e,t){return aI(t)?e.apply(void 0,Go([],Bo(t))):e(t)}(e,t)}))}function iI(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=function(e){return Yo(Wl(e))?e.pop():void 0}(e),r=sI(e),s=r.args,a=r.keys,o=new _i((function(e){var t=s.length;if(t)for(var n=new Array(t),r=t,o=t,i=function(t){var i=!1;Oi(s[t]).subscribe(Mi(e,(function(e){i||(i=!0,o--),n[t]=e}),(function(){return r--}),void 0,(function(){r&&i||(o||e.next(a?function(e,t){return e.reduce((function(e,n,r){return e[n]=t[r],e}),{})}(a,n):n),e.complete())})))},c=0;c<t;c++)i(c);else e.complete()}));return n?o.pipe(oI(n)):o}const cI=e=>{const{actionID:t,context:n,cases:r,classID:s}=e,{content:a}=Rc(n,{nonEmptyAndChangedData:!0});let o=5;try{const e=ku.getSharedState("D_pySingleExecutionBulkActionsMeta.D_pySingleExecutionBulkActionsMeta.pxResults");e?.find((e=>e.pyClassName===s))?.pyList.split(",").includes(t)&&(o=1)}catch(e){console.error('Failed to fetch to "D_pySingleExecutionBulkActionsMeta" DP response',e)}const i=r.map((e=>({ID:e}))),c=i.length/o,l=Xe,{reqType:u,restApi:d}=Ng(l,{actionID:t}),p=[],h=i.length;for(let t=0;t<h;t+=c)a.cases=i.slice(t,t+c),a.cases.length&&p.push(ki(pc(d,{method:u,body:a},n)).pipe($l((t=>{const{data:n,headers:r}=t;return{response:n,actionInPayload:e,headers:Pc({...r})}})),Xl("Error occurred during ajax call at submitbulkaction Epic : ",n)));return iI(p)},lI=e=>{Gr.publish(j.PUB_SUB_EVENTS.EVENT_BULKACTION,e)},uI="SUBMIT_BULK_ACTION",dI=e=>{let t,n=0,r=[],s="";return e.pipe(Vl(uI),kl((e=>{const{isFormValid:a}=e.payload;if(({actionMgrID:n}=e.payload),!a){const e={type:F.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return ln.rejectActionByID(n,!0,e),ql([])}return ql(e.payload).pipe(Bl((e=>(t=e,cI(t)))),Bl((e=>{let n=0,a=0;const o=[],{containerItemID:i,context:c}=t;return e.map((e=>{const{response:t}=e;n+=Number(t.successCount),a+=Number(t.failureCount),a&&t.results.map((e=>{"200"!==e.status&&e.error&&e.error.errorDetails&&e.error.errorDetails.forEach((t=>{o.push({ID:e.BusinessID,message:t.localizedValue})}))}))})),s=`${n} record(s) updated`,lI({submitResponse:e}),t.target=`${j.APP.APP}/${td.MODAL}`,r.push(og(Zh,{containerItemID:i,context:c,target:t.target,skipReleaseLockRequest:!0})),a&&r.push(og(Qh,{messages:[{type:"error",message:1===a?"1 record failed to update":`${a} records failed to update`,errorDetails:o,showHeader:!1}],context:W(c)||c,category:"HTTP",showHeader:!1})),r})),$l((()=>(ln.resolveActionByID(n,s),ih(r),r=[],r))))})))},pI=e=>{const{actionID:t,context:n,cases:r}=e,{content:s}=Rc(n,{nonEmptyAndChangedData:!0});s.cases=r.map((e=>({ID:e})));const a=Xe,{reqType:o,restApi:i}=Ng(a,{actionID:t,runningMode:"async"});return ki(pc(i,{method:o,body:s},n)).pipe($l((t=>{const{data:n,headers:r}=t;return{response:n,actionInPayload:e,headers:Pc({...r})}})),Xl("Error occurred during ajax call at submitbulkaction Epic : ",n))},hI=e=>{Gr.publish(j.PUB_SUB_EVENTS.EVENT_BULKACTION,e)},gI="SUBMIT_BULK_ACTION_ASYNC",fI=e=>{let t,n=0,r=[],s="";return e.pipe(Vl(gI),kl((e=>{const{isFormValid:a}=e.payload;if(({actionMgrID:n}=e.payload),!a){const e={type:F.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return ln.rejectActionByID(n,!0,e),ql([])}return ql(e.payload).pipe(kl((e=>(t=e,pI(t)))),$l((e=>{const n=[],{containerItemID:a,context:o}=t,{response:i}=e,c=Number(i.failureCount)||0;return c>0&&i.results.forEach((({status:e,error:t,BusinessID:r})=>{"200"!==e&&t&&t.errorDetails&&t.errorDetails.forEach((({localizedValue:e})=>{n.push({ID:r,message:e})}))})),s="Processing bulk actions",hI({submitResponse:i}),t.target=`${j.APP.APP}/${td.MODAL}`,r.push(og(Zh,{containerItemID:a,context:o,target:t.target,skipReleaseLockRequest:!0})),c&&r.push(og(Qh,{messages:[{type:"error",message:1===c?"1 record failed to update":`${c} records failed to update`,errorDetails:n,showHeader:!1}],context:W(o)||o,category:"HTTP",showHeader:!1})),r})),$l((()=>(ln.resolveActionByID(n,s),ih(r),r=[],r))))})))},mI=(e,t)=>Hy(e,t),yI=e=>{let t=0,n=[];return e.pipe(Vl(vl),$l((e=>(({actionMgrID:t}=e.payload),e.payload))),Bl((e=>(Jn(e.context),mI(e,{actionMgrID:t,isProcessAction:!0})))),Bl((async e=>{if(e&&Xr(e.type)){const t=wc(e);return n.push(t),n}const{actionInPayload:t,headers:r,response:s}=e;return await qy(s,n,{headers:r,actionInPayload:t}),n})),$l((()=>(Wc(n),cs(n,t),n=[],n))))},II=e=>{let t=0,n=[];return e.pipe(Vl(Se,Me),$l((e=>(({actionMgrID:t}=e.payload),e.payload))),Bl((e=>{const{containerItemID:t,caseID:n,context:r,caseDeleted:s,skipReleaseLockRequest:a,currentCaseViewMode:o,isProcessAction:i,isInCreateStage:c}=e,l=o===j.PERFORM_MODE,u=n&&l;return i&&c?Dy(e):t!==r||s||a||!u?t?.includes(j.MODAL)&&ps(Zd(t))===j.REVIEW_MODE?Dy(e):ql([]):Dy(e)})),Bl((e=>(e&&Xr(e.type)&&n.push(wc(e)),n))),$l((()=>(ih(n),cs(n,t),n=[],n))))};var EI=new ef(Xg),AI=EI;function _I(e,t,n){void 0===e&&(e=0),void 0===n&&(n=AI);var r=-1;return null!=t&&(Gl(t)?n=t:r=t),new _i((function(t){var s,a=(s=e)instanceof Date&&!isNaN(s)?+e-n.now():e;a<0&&(a=0);var o=0;return n.schedule((function(){t.closed||(t.next(o++),0<=r?this.schedule(void 0,r):t.complete())}),a)}))}function CI(e,t){return void 0===e&&(e=0),void 0===t&&(t=EI),e<0&&(e=0),_I(e,e,t)}function SI(e){return wi((function(t,n){var r=!1,s=null,a=null,o=function(){if(null==a||a.unsubscribe(),a=null,r){r=!1;var e=s;s=null,n.next(e)}};t.subscribe(Mi(n,(function(t){null==a||a.unsubscribe(),r=!0,s=t,a=Mi(n,o,ai),Oi(e(t)).subscribe(a)}),(function(){o(),n.complete()}),void 0,(function(){s=a=null})))}))}const TI=(e,t,n,r,s)=>{if(s!==j.RESOURCE_STATUS.CREATE)return;Kc.isStateMachineExist(e,t,n)||Kc.setStateMachine(e,n,t,new cr(n,t,e));Kc.getStateMachine(e,t,n).insert({},r+1,!0,{isDefault:!0})},NI=e=>{const{context:t}=e;let n={...Rc(t).content,contextData:!1};const r=qc(t);Sh.isEmpty(r)||(n=Hc(r,n));const{restApi:s,reqType:a}=Ng("refreshCaseView",e);return n.interestPage=e.interestPage,ki(pc(s,{method:a,body:n},t)).pipe($l((t=>({actionInPayload:e,response:t.data,headers:Pc(t.headers)}))),Xl(": Error occurred during ajax call : ",t))},PI=e=>{let t=0,n=[],r="";return e.pipe(Vl(pt),$l((e=>(({actionMgrID:t}=e.payload),e.payload))),Bl((e=>NI(e))),Bl((async e=>{if(e&&e.type===Ee)return n.push(wc(e)),{actionsOut:n,actionInPayload:{skipPageInstructions:!0}};const{actionInPayload:t,response:s}=e,a=t.containerName,o=mt(a,t.context);let i=Lc(o,a,t.context);i=K(t.context,i);const c=Pm(s);c.key=t.ID,c.data?.caseInfo&&(c.data.caseInfo.ID=t.ID);const l={isMultiRecordData:!0,viewName:t.viewID,parentContext:t.context,interestPage:t.interestPage};c.uiResources.context_data.modalView=l;const u=ch(t.context)?.context_data?.caseInfo,d=`${t.pageReference}${t.targetProperty}`,p=Gn(u,d.replace(j.CASE_INFO.CASE_INFO_CONTENT,"").slice(1),t.index);c.uiResources.context_data.caseInfo={...c.uiResources.context_data.caseInfo,content:Sh.mergeDeep(c.uiResources.context_data.caseInfo?.content,p?.content)};const h=Rh.getProperty(".RemoteSystemID",j.CASE_INFO.HEADERS,t.context),g={acName:o,context:i};await bc(c,t,g);const f={target:o,context:i,containerItemID:i};h&&(f.headers={RemoteSystemID:h});const m=Dc(c,f);m.resourceStatus=t.actionType,m.isMultiRecordData=!0,m.parentContext=t.context,m.heading=t.heading;const y=Mc(o,m);return r=i,n.push(y),$c(n),{actionsOut:n,actionInPayload:t}})),$l((({actionInPayload:e})=>(Jr(n)?ln.rejectActionByID(t):ln.resolveActionByID(t),ih(n),n=[],e.skipPageInstructions||TI(r,e.pageReference,e.targetProperty,e.index,e.actionType),n))))},RI=e=>{let t,n="",r=[];return e.pipe(Vl(ht),kl((e=>{t=e.payload;const{isFormValid:s}=e.payload;if(({actionMgrID:n}=e.payload),!s){const t={type:F.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return ln.rejectActionByID(n,!0,t),bu.handleDeferredActionCompletion(e.payload.context),ql([])}return ql(e.payload).pipe(Bl((e=>(t=e,NI(t)))),Bl((async e=>{if(e&&e.type===Ee){const t=wc(e);return r.push(t),r}const{containerItemID:n,context:s}=t;var a,o,i,c;return a=s,o=t.parentContext,i=F.CASE_INFO.CASE_INFO_CONTENT,c=!1,mr(a).forEach((e=>{const t=Sh.convertClipboardPageToPageRefNotation(e.target);Kc.isStateMachineExist(o,i,t)||Kc.setStateMachine(o,t,i,new cr(t,i,o));const n=Kc.getStateMachine(o,i,t);switch(e.instruction.toLowerCase()){case"insert":n.insert(e.content,e.listIndex,c,{});break;case"update":n.update(e.content,e.listIndex,c,{});break;case"delete":e.listIndex?n.delete(e.listIndex,c):n.deletePage();break;case"replace":n.replacePage(e.content);break;case"move":n.move(e.listIndex,e.listMoveToIndex);break;case"delete all":n.deleteAll()}})),r.push(og(Zh,{containerItemID:n,context:s,target:t.target,skipReleaseLockRequest:!0})),r})),$l((()=>{if(Jr(r))ln.rejectActionByID(n),bu.handleDeferredActionCompletion(t.context);else{ln.resolveActionByID(n),bu.handleDeferredActionCompletion(t.context);const{pageReference:r}=e.payload;if(Rh.getPropertyValue(j.CONTEXT_DATA_MODAL_VIEW.IS_MULTI_RECORD_DATA,r,t.parentContext)){const e=Rh.getPropertyValue(F.CASE_INFO.CASE_INFO_ID,r,t.parentContext),n=Rh.getPropertyValue(j.CONTEXT_DATA_MODAL_VIEW.VIEW_NAME,r,t.parentContext),s=t.pageReference?.substring(0,t.pageReference?.lastIndexOf(".")),a=s.replace(j.CASE_INFO.CASE_INFO_CONTENT,"");vn(e,n,t.parentContext,a,{})}else Ln(t.parentContext,j.CASE_INFO.CASE_INFO_CONTENT,{})}return ih(r),r=[],r})))})))},DI=e=>{const{caseID:t,headers:n,debugInfo:r,context:s}=e,a=Ng("getDescendants",{caseID:t}),{restApi:o}=a,{reqType:i}=a;return ki(pc(o,{method:i,headers:{...n,...r&&{...nc.addDebugHeaders(r)}}},s)).pipe($l((t=>({actionInPayload:e,response:t.data,headers:Pc({...n,...t.headers})}))),Xl("Error ocurred during ajax call at getDescendants Epic : ",s))},bI=e=>{let t=0,n=[];return e.pipe(Vl(Du),$l((e=>(({actionMgrID:t}=e.payload),e.payload))),Bl((e=>DI(e))),Bl((async e=>{if(e&&Xr(e.type))return n.push(wc(e)),n;const{actionInPayload:t,response:r}=e,s={};Sh.setIn(s,"caseInfo.childCases",r?.childCases);const a={data:s,context:t?.context};return n.push(og(wh,a)),n})),$l((()=>(ih(n),cs(n,t),n=[],n))))},OI=[Zm,iy,py,Ky,Zy,dI,fI,yI,Py,My,Oy,II,ky,Fy,e=>e.pipe(Vl(He),SI((()=>CI(100))),$l((e=>{const{actionMgrID:t,isChildCase:n,isModalAction:r,isProcessAction:s,isDataObject:a,skipReleaseLockRequest:o,isInCreateStage:i}=e.payload;return ln.resolveActionByID(t),Gr.publish(j.PUB_SUB_EVENTS.EVENT_SHOW_CANCEL_ALERT,{isModalAction:r,hideDelete:!s&&n,isDataObject:a,skipReleaseLockRequest:o,isInCreateStage:i}),[]}))),e=>e.pipe(Vl(Le),SI((()=>CI(100))),$l((e=>{const{actionMgrID:t,context:n,containerName:r,containerItemID:s}=e.payload,a=mt(r,n);return ln.resolveActionByID(t),ih(og(Jh,{containerItemID:s,target:a,doDeleteCaseSummary:!1})),[]}))),PI,RI,bI],vI=OI;function xI(){return wi((function(e,t){e.subscribe(Mi(t,ai))}))}const{RESOURCE_TYPES:wI}=F,MI=[e=>e.pipe(Vl(te),$l((e=>e.payload)),Bl((e=>{const t={caseID:e.caseId,viewID:e.viewName,caseClassName:e.caseClassName,RemoteSystemID:e.RemoteSystemID};if(e.containerName===td.PREVIEW&&e.context&&e.caseId&&!e.updateData){const t=mt(td.PREVIEW,e.context),n=Lc(t,td.PREVIEW,e.context,{buildNew:!0}),r=decodeURI(e.caseId);ih($h({...e,context:n,target:t,containerItemID:n,key:r,caseViewMode:j.REVIEW_MODE,root:{type:"reference",config:{context:j.CASE_INFO.CASE_INFO_CONTENT,name:e.viewName,type:"view"}},data:{key:r,caseInfo:{ID:r,progress:!0,error:!1,caseTypeID:e.caseClassName,content:{classID:e.caseClassName}}}})),e.viewLoadingContainer={target:t,context:n}}const n={};if(t.RemoteSystemID)n.RemoteSystemID=t.RemoteSystemID;else if($.isRemoteCase(t.caseClassName)){const{RemoteSystemID:e}=$.getRemoteCase(t.caseClassName);n.RemoteSystemID=e}let{restApi:r,reqType:s}=Ng("loadView",t);return e.viewContext===wI.PAGE&&({restApi:r,reqType:s}=Ng(je,{page:e.viewName,pageClass:e.pageClass})),ki(pc(r,{method:s,headers:n},e.context)).pipe($l((t=>{const n=decodeURI(e.caseId);let r="";return"string"==typeof t.data?t.data?r=JSON.parse(t.data):(console.error("response data is empty!!"),r={}):r=t.data,{response:{...r,key:n},actionConfig:e,headers:Pc(t.headers),rootView:Sh.getIn(r,j.ROOT)}})),Xl(": Error ocurred during ajax call at loadView Epic : ",e.viewLoadingContainer?.context??e.context))})),Bl((async e=>{const t={};if(e?.type===Ee){if(t.actionsOut=wc(e),e?.payload?.context?.includes(td.PREVIEW)){const n={...ch(e.payload.context),caseInfo:{progress:!1,error:!0}},r=mt(td.PREVIEW,e.payload.context);t.actionsOut=og(zh,{key:n.key,target:r,containerName:td.PREVIEW,context:e.payload.context,containerItemID:e.payload.context,data:n})}return t}try{t.actionMgrID=e?.actionConfig?.actionMgrID,t.rootView=e?.rootView;const{actionConfig:n,response:r,headers:s}=e;e?.actionConfig?.skipAssignmentsUpdate&&(delete r?.data?.caseInfo?.assignments,delete r?.data?.caseInfo?.availableActions,delete r?.data?.caseInfo?.availableProcesses);const{containerItemID:a,containerName:o}=n,{target:i,context:c}=(e=>{const{containerName:t,updateData:n,viewLoadingContainer:r}=e,s=t||kr.getTargetViewContainerName(je),a=r?.target??mt(s,e.context);return{target:a,context:r?.context??(t===td.PREVIEW&&n?e.context:Lc(a,s,e.context,{buildNew:!!t}))}})(n);n.context=c;const l={acName:i,context:c};let u={};u=Pm(r),u.directUrlUpdation=!1,await bc(u,n,l);const d={...n,target:i,context:c,containerItemID:a||c,headers:s},p=Dc(u,d);if(p.resourceType=wI.CASE,o&&!p.updateData){p.caseViewMode=j.REVIEW_MODE;const e=xd(p?.context);((e,t,n,r,s)=>{e&&s===td.PREVIEW?(n.data.caseInfo.progress=!1,delete n.root,r.actionsOut=og(zh,{...n,containerName:s})):e?(r.actionsOut=[],r.actionsOut.push(og(Jh,{target:t,containerItemID:e}))):r.actionsOut=og($h,{...n,containerName:s})})(ld(e,p.key),e,p,t,o)}else p.preserveClientChanges=!0,t.actionsOut=[],o===td.PREVIEW&&t.actionsOut.push({type:st,payload:{context:c}}),t.actionsOut.push(og(wh,p))}catch(e){console.error(e),t.rootView={type:"error",payload:e}}const{caseId:n,context:r,viewName:s}=e.actionConfig;return"pyCasePreview"===s&&(e=>{Gr.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.CASE_PREVIEW,e)})({caseId:n,context:r}),t})),$l((({rootView:e,actionsOut:t,actionMgrID:n=0})=>(ln.resolveActionByID(n,e),t)))),e=>{let t=0,n=[];return e.pipe(Vl(ne),$l((e=>(({actionMgrID:t}=e.payload),e.payload))),Bl((e=>{Gr.publish(F.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_STARTED);const{debugInfo:n,context:r,viewName:s,className:a,skipSemanticUrl:o=!1,containerName:i=kr.getTargetViewContainerName(je)}=e,c=n&&{...nc.addDebugHeaders(n)},l=mt(i,r);let u="",d={},p=!0;if(!o){if(u=Sg(je,{page:s}),l&&u){const{activate:t,activateContainerActionPayload:n}=kc(wI.PAGE,l,{semanticURL:u});if(t)return ql({type:ve,activateContainerActionPayload:n,actionConfig:e})}if(gd(l)&&({continueExecution:p,removeActionPayload:d}=jc(l)),!p)return ln.rejectActionByID(t),Kl()}const{restApi:h,reqType:g}=Ng(je,{page:s,pageClass:a});return ki(pc(h,{method:g,headers:c},r)).pipe($l((t=>{let n={};return n="string"==typeof t.data?JSON.parse(t.data):t.data,{response:{...n,key:u,semanticURL:u},actionConfig:e,headers:Pc(t.headers),removeActionPayload:d,skipSemanticUrl:o}})),Xl(": Error ocurred during ajax call at showPage Epic : ",e.context))})),Bl((async e=>{if(e&&e.type===Ee)return n.push(wc(e)),n;let{type:t}=e;const{actionConfig:r,skipSemanticUrl:s}=e,a=r.containerName||kr.getTargetViewContainerName(ne),o=mt(a,r.context);Gr.publish(F.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_INIT,{pageName:e.actionConfig.viewName,pageClass:e.actionConfig.className});const{remoteCasePayload:i,updatedType:c}=((e,t,n,r)=>{let s={},a=e;if(n.isTraditionalRemoteCase){s={...n};const e=ld(r,s.insKey);e&&(t.activateContainerActionPayload={containerItemID:e},a=ve)}return{remoteCasePayload:s,updatedType:a}})(t,e,r,o);if(t=c??t,t===ve){const{activateContainerActionPayload:{semanticURL:t,containerItemID:s}}=e,a={acName:o,context:yd(s)};r.isTraditionalRemoteCase||await bc({directUrlUpdation:!0,semanticURL:t},r,a,!0),n.push(og(Jh,{target:o,containerItemID:s}))}else{const t=Lc(o,a,r.context),{response:c,headers:l={},removeActionPayload:u}=e,d=Pm(c,{isCreateDataObject:r.isCreateDataObject});d.directUrlUpdation=!s;const p={acName:o,context:t},h=ps(t);await bc(d,r,p);const g={target:o,context:t,containerItemID:t,headers:l,debugInfo:r.debugInfo,currentCaseViewMode:h},f=Dc(d,g);f.resourceType=F.PAGE,r.isCreateDataObject&&(f.resourceType=F.RESOURCE_TYPES.DATA,f.resourceStatus=F.RESOURCE_STATUS.CREATE,delete f.data.caseInfo),((e,t,n)=>{e.isTraditionalRemoteCase&&(n.resourceType=F.CASE,n.key=Cc.getRemoteCaseKey(t.assignmentID,t.insKey),n.data.caseInfo={...n.data.caseInfo,...t,classID:t.className,target:n.target,containerItemID:n.containerItemID,caseTypeID:t.className,content:{pyLabel:t.name,pyID:Zr(Cc.getRemoteCaseKey(t.assignmentID,t.insKey))}},n.isTraditionalRemoteCase=!0,n.className=t.className)})(r,i,f),f.data??={},f.data.traditionalGadgetId=Cc.getUniqueGadgetId();const m=Mc(o,f);u.containerItemID&&Uc(m)&&n.push(og(Zh,{containerItemID:u.containerItemID,target:o})),n.push(m),$c(n)}return Gr.publish(F.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_DONE,{target:o,pageName:e.actionConfig.viewName,pageClass:e.actionConfig.className}),n})),$l((()=>{ln.resolveActionByID(t),ih(n),n=[]})),xI())}],LI=MI;const UI=(e,t)=>{const{context:n,pageName:r,dataContext:s,dataContextParameters:a,semanticURL:o,skipSemanticUrl:i,RemoteSystemID:c}=e,{removeActionPayload:l}=t,{restApi:u,reqType:d,body:p}=Ng(Ve,{pageName:r,dataContext:s,dataContextParameters:a}),h={};return h.RemoteSystemID=c,ki(pc(u,{method:d,headers:h,body:p},n)).pipe($l((t=>({response:{...t.data,key:o,semanticURL:o},actionConfig:e,headers:Pc(t.headers),removeActionPayload:l,skipSemanticUrl:i}))),Xl("Error occurred during ajax call at showData Epic : ",e.context))},{RESOURCE_TYPES:FI}=F,jI=e=>{let t,n=0,r=[];return e.pipe(Vl(re),(s=e=>(({actionMgrID:n}=e.payload),ql(e.payload).pipe(Bl((e=>((e,t)=>{const{context:n,pageName:r,dataContext:s,dataContextParameters:a,skipSemanticUrl:o=!1,isDeferLoaded:i=!1,parentAction:c="",resourceType:l,containerName:u,RemoteSystemID:d}=e,p=mt(u,n);let h="",g={},f=!1;if(!o){h=Sg(Ve,{pageName:r,dataViewName:s},a);const{activate:n,activateContainerActionPayload:o}=kc(FI.PAGE,p,{semanticURL:h});if(n)return ql({type:ve,activateContainerActionPayload:o,actionConfig:e});if(({continueExecution:f,removeActionPayload:g}=jc(p)),!f)return ln.rejectActionByID(t),Kl()}return UI({context:n,pageName:r,dataContext:s,dataContextParameters:a,semanticURL:h,skipSemanticUrl:o,containerName:u,isDeferLoaded:i,parentAction:c,resourceType:l,RemoteSystemID:d},{removeActionPayload:g})})(e,n))),Bl((async e=>{if(e&&e.type===Ee)return r.push(wc(e)),r;const{type:n,actionConfig:s,headers:a,response:o,skipSemanticUrl:i}=e;t=Sh.getIn(o,j.ROOT);const{containerName:c,parentAction:l,resourceType:u}=s,d=mt(c,s.context);let p;const h=ps(s?.context);if(s.isDeferLoaded){p=Pm(o),p.directUrlUpdation=!i;const t={acName:d,context:s.context};await bc(p,s,t);const n={target:d,headers:a,context:s.context,containerItemID:e.containerItemID},c=Dc(p,n);return r=og(wh,c),r}if(n===ve){const{activateContainerActionPayload:{semanticURL:t,containerItemID:n}}=e,a={acName:d,context:yd(n)};await bc({directUrlUpdation:!0,semanticURL:t},s,a,!0),r.push(og(Jh,{target:d,containerItemID:n,resourceType:FI.DATA}))}else if("DATA"===u&&l===dt){const{context:e}=s,t=o?.data,n={context:e,data:t};r.push(og(wh,n))}else{const t=Lc(d,c,s.context),{removeActionPayload:n}=e;p=Pm(o),p.directUrlUpdation=!i;const l={acName:d,context:t};await bc(p,s,l);const u=Dc(p,{target:d,context:t,containerItemID:t,headers:a,currentCaseViewMode:h});u.resourceType=FI.DATA;const g=Mc(d,u);n.containerItemID&&Uc(g)&&r.push(og(Zh,{containerItemID:n.containerItemID,target:d})),$c(r),r.push(g)}return r})),$l((()=>(ln.resolveActionByID(n,t),ih(r),r=[],r))))),Yo(a)?Bl(s,a,1):Bl(s,1)));var s,a},VI=e=>{const{dataViewName:t,context:n,dataViewParameters:r}=e,s={data_view_ID:t,dataViewParameters:encodeURIComponent(JSON.stringify(r))},{restApi:a,reqType:o}=Ng("deleteDataObject",s);return ki(pc(a,{method:o},n)).pipe($l((t=>({response:t.data,actionInPayload:e}))),Xl("Error occurred during ajax call at deleteDataObject Epic",n))},kI=e=>{let t=0,n=[];return e.pipe(Vl(it),Jl(100),$l((e=>(({actionMgrID:t}=e.payload),e.payload))),Bl((e=>VI(e))),Bl((async e=>{if(e&&e.type===Ee){const{payload:r}=e,s=wc({...e,...r,actionMgrID:t});return n.push(s),n}return[]})),$l((()=>(1===n.length&&Xr(n[0].type)?ln.rejectActionByID(t):ln.resolveActionByID(t),ih(n),n=[],n))))},$I=e=>{const{dataViewID:t,dataViewParameters:n,context:r}=e,s={data_view_ID:t},{restApi:a,reqType:o}=Ng("getDataObjectActions",s);return ki(pc(a,{method:o,body:{dataViewParameters:n}},r)).pipe($l((e=>({...e.data}))),Xl("Error occurred during ajax call at GET data object actions : ",e.context))},BI=e=>{let t=0,n=[];let r={};return e.pipe(Vl(ye),Jl(100),$l((e=>(({actionMgrID:t}=e.payload),e.payload))),Bl((e=>$I(e))),Bl((async e=>e&&e.type===Ee?(n.push(wc(e)),n):(r=e,[]))),$l((()=>(1===n.length&&Xr(n[0].type)?ln.rejectActionByID(t):ln.resolveActionByID(t,r),ih(n),n=[],n))))},GI=[jI,e=>{let t=0,n=[];return e.pipe(Vl(ot),Jl(100),kl((e=>{const{isFormValid:r}=e.payload;if(({actionMgrID:t}=e.payload),!r){const e={type:F.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return ln.rejectActionByID(t,!0,e),ql([])}return ql(e.payload).pipe(Bl((e=>Ql(e))),Bl((async e=>{if(e&&e.type===Ee){const{payload:r}=e,s=wc({...e,...r,actionMgrID:t});return n.push(s),n}const{actionInPayload:r}=e,{containerItemID:s,isModalAction:a}=r,o=a?td.MODAL:td.PRIMARY,i={target:mt(o,s),containerItemID:s,context:s};return n.push(og(Zh,i)),n})),$l((()=>(1===n.length&&Xr(n[0].type)?ln.rejectActionByID(t):ln.resolveActionByID(t),ih(n),n=[],n))))})))},e=>{let t=0,n=[];return e.pipe(Vl(ct),Jl(100),$l((e=>(({actionMgrID:t}=e.payload),e.payload))),Bl((e=>Zl(e))),Bl((async e=>{if(e&&e.type===Ee){const{payload:r}=e,s=wc({...e,...r,actionMgrID:t});return n.push(s),n}const{actionInPayload:r,response:s,headers:a={}}=e,{containerName:o}=r,i=mt(o,r.context),c=Lc(i,o,r.context),l={acName:i,context:c};await bc(s,r,l);const u=Dc(s,{target:i,context:c,containerItemID:c,headers:a});return u.resourceType=F.RESOURCE_TYPES.DATA,u.resourceStatus=F.RESOURCE_STATUS.UPDATE,u.key=JSON.stringify(r.requestPayload),n.push(og($h,u)),n})),$l((()=>(1===n.length&&Xr(n[0].type)?ln.rejectActionByID(t):ln.resolveActionByID(t),ih(n),n=[],n))))},e=>{let t=0,n=[];return e.pipe(Vl(lt),Jl(100),kl((e=>{const{isFormValid:r}=e.payload;if(({actionMgrID:t}=e.payload),!r){const e={type:F.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return ln.rejectActionByID(t,!0,e),ql([])}return ql(e.payload).pipe(Bl((e=>eu(e))),Bl((async e=>{if(e&&e.type===Ee){const{payload:r}=e,s=wc({...e,...r,actionMgrID:t});return n.push(s),n}const{actionInPayload:r}=e,{containerItemID:s,isModalAction:a}=r,o=a?td.MODAL:td.PRIMARY,i={target:mt(o,s),containerItemID:s,context:s};return n.push(og(Zh,i)),n})),$l((()=>(1===n.length&&Xr(n[0].type)?ln.rejectActionByID(t):ln.resolveActionByID(t),ih(n),n=[],n))))})))},kI,BI,e=>{let t=0,n=[];return e.pipe(Vl(ut),Jl(100),$l((e=>(({actionMgrID:t}=e.payload),e.payload))),Bl((e=>tu(e))),Bl((async e=>{if(e&&e.type===Ee){const{payload:r}=e,s=wc({...e,...r,actionMgrID:t});return n.push(s),n}const{actionInPayload:r,response:s,headers:a={}}=e,{containerName:o,actionID:i,context:c,actionName:l}=r,u=mt(o,r.context);let d=H(o,c);d=K(c,d);const p={target:u,context:d,containerItemID:d,headers:a,resourceType:F.RESOURCE_TYPES.DATA,resourceStatus:F.RESOURCE_STATUS.OPEN_FLOW_ACTION,key:JSON.stringify(r.dataViewParameters),actionID:i,actionName:l},h={acName:u,context:c};await bc(s,r,h);const g=Dc(s,p);return n.push(og($h,g)),n})),$l((()=>(1===n.length&&Xr(n[0].type)?ln.rejectActionByID(t):ln.resolveActionByID(t),ih(n),n=[],n))))},e=>{let t=0,n=[];return e.pipe(Vl(dt),Jl(100),kl((e=>{const{isFormValid:r}=e.payload;({actionMgrID:t}=e.payload);const s=e.payload.context;if(!r){const e={type:F.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return ln.rejectActionByID(t,!0,e),ql([])}return zn({context:s,stateObj:ch(s),clearContextMessages:!0}),ql(e.payload).pipe(Bl((e=>nu(e))),Bl((async e=>{if(e&&e.type===Ee){const{payload:r}=e,s=wc({...e,...r,actionMgrID:t});return n.push(s),n}const{actionInPayload:r,response:s,headers:a={}}=e,{containerName:o,containerItemID:i,resourceType:c,key:l}=r,u=mt(o,r.context),d={acName:u,context:r.context};await bc(s,r,d);const p={key:l,target:u,resourceType:c,containerItemID:i,headers:a,context:r.context};return n=((e,t,n,r)=>{const{resourceType:s,key:a,containerItemID:o}=r,i=Dc(n,t);i.resourceType=s||F.RESOURCE_TYPES.DATA;const c=X(o);e.push(og(Zh,i));const l=dh(".dataContext","dataInfo",c),u=dh(".dataContextParameters","dataInfo",c),d={context:c,skipSemanticUrl:!0,resourceType:s,parentAction:dt,dataContext:l,dataContextParameters:u},p=l&&u&&Sg(Ve,{pageName:j.PY_DETAILS,dataViewName:l},u)||"";if(o?.includes(j.PREVIEW)){const t={type:re,payload:{pageName:j.VIEW_NAMES.PY_DATA_PREVIEW,container:j.PREVIEW,containerName:j.PREVIEW,...d}};e.push(t)}else if(s!==j.PAGE&&a===p&&o?.includes(j.PRIMARY)){const t={type:re,payload:{pageName:j.VIEW_NAMES.PY_DETAILS,containerName:"",...d}};e.push(t)}return e})(n,p,s,{key:l,resourceType:c,containerItemID:i}),n})),$l((()=>(1===n.length&&Xr(n[0].type)?ln.rejectActionByID(t):ln.resolveActionByID(t),ih(n),n=[],n))))})))}],WI=GI;function HI(e,t){return void 0===t&&(t=EI),wi((function(n,r){var s=null,a=null,o=null,i=function(){if(s){s.unsubscribe(),s=null;var e=a;a=null,r.next(e)}};function c(){var n=o+e,a=t.now();if(a<n)return s=this.schedule(void 0,n-a),void r.add(s);i()}n.subscribe(Mi(r,(function(n){a=n,o=t.now(),s||(s=t.schedule(c,e),r.add(s))}),(function(){i(),r.complete()}),void 0,(function(){a=s=null})))}))}const{RESOURCE_TYPES:{CASE:qI,DATA:zI}}=F;let YI=[],KI=!1;const XI={},JI=[e=>e.pipe(Vl(Ie),HI(200),$l((e=>e.payload)),Bl((e=>{KI=!1,Gr.subscribe(F.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_STARTED,(()=>{KI=!0}));const t=ec.getPreviewMode()&&nc.addDebugHeaders({debugId:Sh.generateUniqueID()});XI.dataContext=e.payload.dataViewName,XI.dataContextParameters=e.payload.dataViewKeys;const{context:n,requestType:r,routeKey:s}=e;let{routeEndpoint:a}=e;a=a&&a.indexOf("viewType={viewType}")>0?a.replace("{viewType}","page"):a&&a.indexOf('viewType=""')>0?a.replace('viewType=""','viewType="page"'):a;const o=E()+a,i=e.options.context;let c;const l={},u=e?.payload?.caseClassName;if($.isRemoteCase(u)){const{RemoteSystemID:e}=$.getRemoteCase(u);l.RemoteSystemID=e}if("POST"===r){c=e.payload,a.indexOf("viewType=")<0&&(a=`${a}?viewType=page`);let i;switch(Bc(s)){case qI:i={caseTypeID:c.caseTypeID,processID:c.processID,content:{}};break;case zI:i=XI;break;default:i=c}return ki(pc(o,{method:r,body:i,headers:{...l,...t}},n)).pipe($l((t=>({response:{...t.data},payload:e,headers:Pc(t.headers)}))),Xl(": Error occurred during ajax call at historyEpic : ",e))}return ki(pc(o,{method:"GET",headers:{...l,...t}},i.substring(0,i.lastIndexOf("/")))).pipe($l((n=>({response:n.data,payload:e,headers:{...Pc(n.headers),...t}}))))})),Bl((async e=>{if(KI)return YI;if(Gr.subscribe(F.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_STARTED,(()=>{KI=!0})),e&&e.type===Ee)return wc(e);const{headers:t={},response:n,payload:r}=e,s=Pm(n,{[F.STOPMERGEACTIONS]:!n.nextAssignmentInfo}),a=r.options.acName,o=Sd(a)&&Nd(a)?gd(a):e.payload.options.context,i=o;t.RemoteSystemID=r?.payload?.RemoteSystemID;const c={target:a,context:o,containerItemID:i,headers:t,debugInfo:{debugId:t[j.COREHEADER_APP_DEBUG_ID]}};let l="";const u=r?.payload?.page;let d=r?.payload?.pageClass;r.payload&&r.payload.caseName&&r.payload.workID&&(l=Sg(Be,{caseName:e.payload.payload.caseName}),l=l&&l.replace("{workID}",e.payload.payload.workID)||"",d=r?.payload?.caseClassName),Gr.publish(F.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_INIT,{pageName:u,pageClass:d});const p=Sh.getIn(s,j.LOCALE_REFERENCES);await hp.loadLocaleResources(p);const h=Sh.getIn(s,j.COMPONENTS);h&&await jr(h),wr(s,r.options.actionConfig,!0),Gr.publish(F.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_DONE,{target:a,pageName:u,pageClass:d});let g=Dc(s,c);return g=((e,t,n)=>{if(e===Sc.CASE){if(t?.caseInfo?.assignments&&t?.caseInfo?.assignments.length>0){const{key:e,flowName:r}=vc(t.caseInfo.assignments[0].ID);n.key=e||t.caseInfo.ID,n.flowName=r}else n.flowName="",n.key=t?.caseInfo?.ID||t.semanticURL;n.resourceType=e,n.semanticURL=t.semanticURL,n.caseViewMode=j.REVIEW_MODE}else n.resourceType=e,n.semanticURL=t.semanticURL;return n})(Bc(e.payload.routeKey),{...n.data,semanticURL:l,caseViewMode:j.REVIEW_MODE},g),YI.push(Mc(a,g)),$c(YI),YI})),$l((()=>(KI||ih(YI),YI=[],KI=!1,YI))),Xl("Error occurred"))],QI=[e=>{let t=0,n=[];return e.pipe(Vl(se),$l((e=>(({actionMgrID:t}=e.payload),e.payload))),Bl((e=>{const{context:t,skipSemanticUrl:n=!1,insightID:r}=e;let s,a="";n||(a=Sg(ke,{insightID:"{insightID}"}),a=a.replace("{insightID}",r),s=lp.getEndPointInfo(a));const{restApi:o,reqType:i}=Ng(ke,{...s?.payload||[],insightID:r});return ki(pc(o,{method:i},t)).pipe($l((t=>{let r={};return r="string"==typeof t.data?JSON.parse(t.data):t.data,{response:{...r,key:a,semanticURL:a},actionConfig:e,skipSemanticUrl:n}})),Xl(": Error occurred during ajax call at showPage Epic : ",e.context))})),Bl((async e=>{if(e&&e.type===Ee)return n.push(wc(e)),n;const{actionConfig:t,skipSemanticUrl:r}=e,s=kr.getTargetViewContainerName(ne),a=mt(s,t.context),o=Lc(a,s,t.context),{response:i}=e,c=Pm(i);c.directUrlUpdation=!r;const l={acName:a,context:o},u=!r,d=r;await bc(c,t,l,u,d);const p=Dc(c,{target:a,context:o,containerItemID:o});p.resourceType=F.PAGE;const h=Mc(a,p);return n.push(h),$c(n),n})),$l((()=>{ln.resolveActionByID(t),ih(n),n=[]})),xI())}],ZI=[e=>{let t=0,n=[];return e.pipe(Vl(ae),$l((e=>(({actionMgrID:t}=e.payload),e.payload))),Bl((e=>{const{context:t,skipSemanticUrl:n=!1,dashboardID:r}=e;let s="";n||(s=Sg($e,{dashboardID:r}),s=s.replace("{dashboardID}",r));const{restApi:a,reqType:o}=Ng($e,{dashboardID:r});return ki(pc(a,{method:o},t)).pipe($l((t=>{let r={};return r="string"==typeof t.data?JSON.parse(t.data):t.data,{response:{...r,key:s,semanticURL:s},actionConfig:e,skipSemanticUrl:n}})),Xl(": Error occurred during ajax call at showPage Epic : ",e.context))})),Bl((async e=>{if(e&&e.type===Ee)return n.push(wc(e)),n;const{actionConfig:t,skipSemanticUrl:r}=e,s=kr.getTargetViewContainerName(ne),a=mt(s,t.context),o=Lc(a,s,t.context),{response:i}=e,c=Pm(i);c.directUrlUpdation=!r;const l={acName:a,context:o},u=!r,d=r;await bc(c,t,l,u,d);const p=Dc(c,{target:a,context:o,containerItemID:o});p.resourceType=F.PAGE;const h=Mc(a,p);return n.push(h)})),$l((()=>{ln.resolveActionByID(t),ih(n),n=[]})),xI())}],eE=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Tm.apply(void 0,e.map((function(e){var n=e.apply(void 0,t);if(!n)throw new TypeError('combineEpics: one of the provided Epics "'+(e.name||"<anonymous>")+"\" does not return a stream. Double check you're not missing a return statement!");return n})))};try{Object.defineProperty(n,"name",{value:"combineEpics("+e.map((function(e){return e.name||"<anonymous>"})).join(", ")+")"})}catch(e){}return n}(...xm,...vI,...LI,...JI,...WI,...Mm,...[e=>{let t=0;return e.pipe(Vl(Ze),$l((e=>(({actionMgrID:t}=e.payload),e.payload))),$l((()=>{const e=oh()?.getState(),n=Cm();return h()(e,n)&&t>0?ln.resolveActionByID(t,{}):ln.rejectActionByID(t),[]})),xI())}],...QI,...ZI),tE=()=>e=>t=>{const{type:n="",payload:r={}}=t||{},{category:s,context:a,transientItemID:o}=r;"HTTP"!==s&&[Ce,xe,Se,Me,Ne,Oe].includes(n)&&(Qc(a||o),Pn.removeContextTreeNode(a||o)),e(t)},nE={},rE=e=>{const t=Sh.getIn(nE,[j.CONTEXT,e],[]),n=[];t.forEach((t=>{const r=t.substr(0,t.lastIndexOf("_")),s=Sh.getIn(nE,[r,t],[]),a=s&&s.length>0&&s.indexOf(e);if(a>-1&&s.splice(a,1),!s||s&&0===s.length){Sh.deleteIn(nE,[r,t]);const e=Sh.getIn(nE,[r]);e&&0===Object.keys(e).length&&Sh.deleteIn(nE,[r]),n.push({dataPageName:r,dataPageNameWithHash:t})}})),Sh.deleteIn(nE,[j.CONTEXT,e]);const r=Sh.getIn(nE,[j.CONTEXT]);(!r||r&&0===Object.keys(r).length)&&Sh.deleteIn(nE,[j.CONTEXT]),n.length>0&&ih(lg({dataPagesToBeRemoved:n}))},sE=(e={},t)=>{Object.keys(e).forEach((n=>{const r=Sh.getIn(e,[n],{});Object.keys(r).forEach((e=>{((e,t,n)=>{const r=Sh.getIn(nE,[j.CONTEXT,n]);if(Sh.getIn(nE,[e])){const r=Sh.getIn(nE,[e,t],[]);Sh.setIn(nE,[e,t],[...new Set([...r,n])])}else Sh.setIn(nE,[e,t],[n]);r?Sh.setIn(nE,[j.CONTEXT,n],[...new Set([...r,t])]):Sh.setIn(nE,[j.CONTEXT,n],[t])})(n,e,t)}))}))},aE=()=>e=>t=>{const{payload:{data:n={},context:r=null,childContainersContexts:s=[]}={},type:a}=t;if(s&&s.length>0&&(a===Me||a===Se)&&s.forEach((e=>{rE(e)})),a===Ce||a===fe||a===tt){const e=a===tt?n:n.shared;sE(e,r)}else a===Me?(rE(r),sE(n.shared,r)):a===Se&&rE(r);e(t)},oE=e=>t=>n=>{const{type:r,payload:{target:s,containerItemID:a,context:o,childContainersContexts:i=[],containerInfo:{newAccessedOrder:c,containerType:l}={}}={}}=n,{PUB_SUB_EVENTS:u}=F;if(r===Se){const{resourceType:t,key:n,context:r}=Sh.getIn(e.getState(),["containers",s,"items",a])||{},o={resourceType:t,key:n,context:r,containerItemID:a};Gr.publish(u.CONTAINER_EVENTS.CLOSE_CONTAINER_ITEM,o),s===`${F.APP.APP}/${j.PRIMARY}`&&l===j.CONTAINER_TYPE.MULTIPLE&&Gr.publish(u.CONTAINER_EVENTS.CLOSE_MULTI_TYPE_PRIMARY_CONTAINER_ITEM,{key:n,newAccessedOrder:c})}i&&i.length>0&&(r===Me||r===Se)&&i.forEach((e=>{Ru.cleanCaches(e)})),r!==Me&&r!==Se||Ru.cleanCaches(o),t(n)},iE=()=>e=>t=>{const{payload:{context:n=null,transientItemID:r=null}={},type:s}=t;!n||s!==Ce&&s!==xe&&s!==Me&&s!==Se||(Ir(n),fr(n)),r&&s===De&&(Ir(r),fr(r)),e(t)},cE=function(e){void 0===e&&(e={});var t,n=new(0,tf.constructor)(tf.schedulerActionCtor),r=new rf,s=function(s){t=s;var a=new rf,o=new rf,i=a.asObservable().pipe(Ui(n)),c=new of(o.pipe(Ui(n)),t.getState());return r.pipe($l((function(t){var n=t(i,c,e.dependencies);if(!n)throw new TypeError('Your root Epic "'+(t.name||"<anonymous>")+"\" does not return a stream. Double check you're not missing a return statement!");return n})),Bl((function(e){return ki(e).pipe(Fi(n),Ui(n))}))).subscribe(t.dispatch),function(e){return function(n){var r=e(n);return o.next(t.getState()),a.next(n),r}}};return s.run=function(e){r.next(e)},s}(),lE=e=>{const t=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||zg;if(null!==oh())Ah();else{const n=Hg(Sm(e),t(cf.reduxBatch,function(...e){return t=>(n,r)=>{const s=t(n,r);let a=()=>{throw new Error(kg(15))};const o={getState:s.getState,dispatch:(e,...t)=>a(e,...t)},i=e.map((e=>e(o)));return a=zg(...i)(s.dispatch),{...s,dispatch:a}}}(Dl,tE,aE,iE,cE,oE),cf.reduxBatch));cE.run(eE),ah(n)}};const uE=new class{#g;constructor(){this.userSettings={},this.componentCache={},this.contextMapToClearOnCancel={},this.#g=!1}getNormalizedKey(e){return e?.toString().trim().replace(/\s/g,"-").toLowerCase()}setComponentState=(e,t)=>{sessionStorage?sessionStorage.setItem(this.getNormalizedKey(e),JSON.stringify(t)):console.error("Session Storage not found")};getComponentState=e=>{const t=sessionStorage.getItem(this.getNormalizedKey(e)),n=t?Sh.isValidJson(t):void 0;return n||t};removeComponentState=e=>{sessionStorage.removeItem(this.getNormalizedKey(e))};fetchUserSettings=async()=>{if(Wm("getUserSettings")){const{restApi:e,reqType:t}=Ng("getUserSettings");pc(e,{method:t,headers:{}}).then((e=>{if(200!==e.status||!e.data)throw new Error("something went wrong while fetching getUserSettings");this.userSettings=e.data})).catch((e=>console.error(e)))}};init=()=>{up.getUserSettings()?this.userSettings=up.getUserSettings():this.fetchUserSettings()};getUserSettings=e=>{if(!e)throw new Error("path is required parameter");if("string"!=typeof e)throw new TypeError("path must be string");return Sh.getIn(this.userSettings,e,{})};setUserSettings=async(e,t)=>{if(!e)return Promise.reject(new Error("path is required parameter"));if("string"!=typeof e)return Promise.reject(new TypeError("path must be string"));if(null==t||""===t)return Promise.reject(new Error("value is required parameter"));let n;if(!Wm("updateUserSettings"))return Promise.resolve("updateUserSettings route is not available");n=Ng("updateUserSettings");const{restApi:r,reqType:s}=n;return pc(r,{method:s,body:Sh.setIn({},e,t)}).then((e=>{if(200!==e.status||!e.data)throw new Error("something went wrong");this.userSettings=e.data})).catch((e=>{console.error(e)}))};setComponentCache(e,t,n={}){if("string"!=typeof e||!e?.trim())return;const r=n.clearOnCancelForContext;if(r&&(Object.hasOwn(this.contextMapToClearOnCancel,r)?this.contextMapToClearOnCancel[r].add(this.getNormalizedKey(e)):this.contextMapToClearOnCancel[r]=new Set([this.getNormalizedKey(e)])),this.componentCache[this.getNormalizedKey(e)]=t,!this.#g){this.#g=!0;const e=e=>{const{context:t}=e||{};(this.contextMapToClearOnCancel[t]||new Set).forEach((e=>{this.resetComponentCache(e)})),delete this.contextMapToClearOnCancel[t]};Gr.subscribe(j.PUB_SUB_EVENTS.EVENT_CANCEL,e,"RESET_COMPONENT_CACHE")}}getComponentCache(e){return"string"==typeof e&&e?.trim()?Object.hasOwn(this.componentCache,this.getNormalizedKey(e))?this.componentCache[this.getNormalizedKey(e)]:void 0:null}resetComponentCache(e){return!("string"!=typeof e||!e?.trim())&&(!!Object.hasOwn(this.componentCache,this.getNormalizedKey(e))&&(delete this.componentCache[this.getNormalizedKey(e)],!0))}},dE={publishConstellationLoadedEvent:()=>{Gr.publish(j.PUB_SUB_EVENTS.BOOTSTRAP_SHELL_EVENTS.CONSTELLATION_LOADED,{})}};const pE=new class{activateContainerItemOnSwitch(e){const t=`${j.APP.APP}/${j.PRIMARY}`,n={target:t,containerItemID:ld(t,e)};Xu({}).getPConnect().getContainerManager().activateContainerItem(n)}removeContainerItemOnClose(e){const t=`${j.APP.APP}/${j.PRIMARY}`,n={target:t,containerItemID:ld(t,e)};Xu({}).getPConnect().getContainerManager().removeContainerItem(n)}showCasePreview(e,t){const n=Xu({meta:{type:"PreviewViewContainer",config:{name:j.PREVIEW}},options:{context:j.APP.APP,target:"root/hybrid_preview"}}),r=n.getPConnect().getContainerManager();r.resetContainers({name:j.PRIMARY,context:j.APP.APP}),pd(j.APP.APP,j.PREVIEW)||r.initializeContainers({type:"multiple",name:j.PREVIEW}),n.getPConnect().getActionsApi().showCasePreview(e,{caseClassName:t})}closeCasePreview(){Xu({}).getPConnect().getContainerManager().resetContainers({name:j.PREVIEW,context:j.APP.APP})}isFormDirty(e){const t=`${j.APP.APP}/${j.PRIMARY}`,n=Xd(t,e);return Yc.isStateModified(n)}getEventUtils(){return dE}getBroadcastUtils(){return Um}isTraditionalUICase(e){return ls(e)}};const hE=class{static openCase(e,t=F.APP.APP,n={}){return n.renderInline=!0,n.pageName?up.setDefaultCasePage(n.pageName):(up.setDefaultCasePage(j.PY_DETAILS),n.pageName=j.PY_DETAILS),n?.disableAssignmentHeader?up.disableAssignmentHeader(n.disableAssignmentHeader):up.disableAssignmentHeader(!1),Fu.openCase(e,t,j.PRIMARY,n)}static createCase(e,t=F.APP.APP,n={}){return n.renderInline=!0,n.pageName?up.setDefaultCasePage(n.pageName):(up.setDefaultCasePage(j.PY_DETAILS),n.pageName=j.PY_DETAILS),n?.disableAssignmentHeader?up.disableAssignmentHeader(n.disableAssignmentHeader):up.disableAssignmentHeader(!1),Fu.createCase(e,t,j.PRIMARY,n)}static getNextWork(e=F.APP.APP,t={}){return t.renderInline=!0,t.pageName?up.setDefaultCasePage(t.pageName):(up.setDefaultCasePage(j.PY_DETAILS),t.pageName=j.PY_DETAILS),t?.disableAssignmentHeader?up.disableAssignmentHeader(t.disableAssignmentHeader):up.disableAssignmentHeader(!1),Fu.getNextWork(e,j.PRIMARY,t)}static openAssignment(e,t=F.APP.APP,n={}){return n.renderInline=!0,n.pageName?up.setDefaultCasePage(n.pageName):(up.setDefaultCasePage(j.PY_DETAILS),n.pageName=j.PY_DETAILS),n?.disableAssignmentHeader?up.disableAssignmentHeader(n.disableAssignmentHeader):up.disableAssignmentHeader(!1),Fu.openAssignment(e,t,j.PRIMARY,n)}static openPage(e,t,n=F.APP.APP,r={}){const s=ne;r?.defaultCasePage?up.setDefaultCasePage(r.defaultCasePage):up.setDefaultCasePage(j.PY_DETAILS),r?.disableAssignmentHeader?up.disableAssignmentHeader(r.disableAssignmentHeader):up.disableAssignmentHeader(!1);const a={viewName:e,className:t,acTargetName:j.PRIMARY,actionMgrID:ln.getNextActionMgrId(),context:n},{promise:o}=ln.actionManagerPromise(s,a.actionMgrID);return ih({type:s,payload:{...a}}),o}static getCurrentContextAPI(e,t=F.APP.APP){return Xu({meta:{config:{}},options:{context:t,pageReference:e,containerName:j.PRIMARY}}).getPConnect()}};const gE=new class{createC11nEnv=e=>Xu(e);getContextUtils=()=>e;getRoutingManager=()=>t;getComponentsRegistry=()=>Xt;getStateManager=()=>c;getActionCreators=()=>l;getStreamObservable=()=>r;getActionProcessor=()=>bh;getActionHandler=()=>Dh;renderApp=(e,t)=>{const n={context:j.APP.APP},r={...Sh.getIn(e,j.ROOT),options:n};lE(e),wr(e,n,!0);const s=this.createC11nEnv({meta:r,isRoot:!0});Gr.publish(F.PUB_SUB_EVENTS.EVENT_RENDER_APP,{props:s,domContainerID:t})};updateStoreWithUiRoot=async(e,t,n)=>{const r=Pm(e),{data:s,uiResources:a={}}=e,o=Sh.getIn(a,j.CONTEXT_DATA);await bc(r,{},{},!1,!0);const i={...s,[j.CONTEXT_DATA]:o},{root:c}=a;Md(c,t,i,n)};fetchEndPointResource=(e,t,n)=>{pc(e,{method:"GET"},j.APP.ROOT).then((async e=>{const{data:r,status:s}=e;200===s&&this.updateStoreWithUiRoot(r,t,n)}))};loadComponent=async(e,t,n)=>jr(n).then((()=>{const n=this.createC11nEnv({meta:e,isRoot:!0});oh()||lE({}),Gr.publish(F.PUB_SUB_EVENTS.EVENT_RENDER_APP,{props:n,domContainerID:t})}));setStaticServerUrl=(e,t,n)=>{Lr.initServer(e,t,n)};loadView=async(e,t,n=[])=>{y();const r=Pm(e),s=Sh.getIn(r,j.VIEWS),a=Sh.getIn(r,j.NAVIGATIONS),o=Sh.getIn(r,j.COMPONENTS)||[];o.push(...n);const i=Sh.getIn(r,j.STATIC_SERVER_URL),c=Sh.getIn(r,j.APPLICATION_DATA);s&&Up(s),a&&Fp(a),(e=>{e&&(Eg=e.pyLabel)})(c),i&&Lr.initServer(i),await jr(o,i).then((()=>this.renderApp(r,t)))};initAppShell=(e,t,n)=>{jg(e),kr.buildActionTargetMap(t),y(n)};initRoutingTable=(e,t)=>{jg(e,!0),y(t)};setAppAlias=e=>{Lr.setAppAlias(e)};getHomeRestApi=e=>{const{restApi:t}=Tg("home",{portalName:e});return E()+t};getViewRestApi=(e,t)=>{const{restApi:n}=((e,t)=>{let n={restApi:""};try{if(Ug()&&!t){const t=op(),r=lp.processUrl(t,!0),s=lp._getMatchedRouteInRoutingTable(r)||"",a=lp.getRoutingInfo(),o=lp.processUrl(t,!1).split("/"),i=o[o.length-1];let{caseID:c}=a&&a.routes[s].payload;c=c.replace("{workID}",i),n=lp.getRestEndPoint("loadView",{caseID:c,viewID:e})||{}}else n=lp.getRestEndPoint("showView",{page:e,pageClass:t})||{}}catch(e){}return n})(e,t);return E()+n};loadRootComponent=async(e,t,n=[],r,s,a)=>{const{config:{name:o}={}}=t;oh()||lE({}),a&&(Wd(`${j.APP.ROOT}/${o}`),Gd().deleteContainerItem(`${j.APP.ROOT}/${o}`)),Gd().getContainerItems()?.length>1&&!o?.startsWith("hybrid_")&&"authoring-preview"!==o&&Ah(),ih(wh({data:{},context:j.APP.ROOT}));const i=this.createC11nEnv({meta:t,options:{context:j.APP.ROOT,pageReference:"",target:`${j.APP.ROOT}/${o}`}}),c=i.getPConnect(),l=c.getContextName(),u=c.getContainerName(),d=c.getContainerManager();gd(`${l}/${u}`)||"noPortal"===t.config?.renderingMode||d.initializeContainers({type:"single"});const p=["RootContainer","Region","ModalViewContainer","PreviewViewContainer","reference",...n];return jr(p).then((()=>{Gr.publish(F.PUB_SUB_EVENTS.EVENT_RENDER_APP,{props:i,domContainerID:e,componentName:"RootContainer",portalTarget:r,styleSheetTarget:s})}))};loadViewByName=(e,t,n,r)=>{let s=this.getViewRestApi(e,n);s===E()&&(s=this.getHomeRestApi(t)),this.fetchEndPointResource(s,r)};loadPortalView=(e,t)=>{const n=this.getHomeRestApi(e);this.fetchEndPointResource(n,t,!0)};configureForBrowserBookmark=e=>{Fg(e)};checkIfSemanticURL=()=>Ug();onPCoreReady=e=>{Gr.subscribe(F.PUB_SUB_EVENTS.EVENT_RENDER_APP,e,"renderAppCallback")};onPCoreCleanup=e=>{Gr.subscribe(F.PUB_SUB_EVENTS.EVENT_UNMOUNT_APP,e,"unmountAppCallback")};setFieldsDefaultConfigs=e=>{br.updateFieldDefaults(e)};setGoogleMapsAPIKey=e=>{_(e)};setFetchDefaultHeaders=e=>{yc(e)};setFetchAuthInfo=e=>{Ic(e)};getCaseApi=()=>Fu;getMashupApi=()=>hE;enableAppRouting=e=>{_g(e)};initStore=()=>lE({});getBootstrapConfig=async(e,t)=>{const n=`${t.token_type} ${t.access_token}`;return fetch(`${e}/api/application/v2/data_views/D_pxBootstrapConfig`,{method:"GET",headers:new Headers({Authorization:n})}).then((e=>e.json()))};initCoreContainers=(e={})=>{const{containerType:t="single"}=e,n=Xu({meta:{type:"RootContainer",config:{renderingMode:"noPortal"},children:[{type:"ViewContainer",config:{routingInfo:"@ROUTING_INFO",name:"primary"}}]},options:{context:"root",pageReference:"",target:"root"}});return n.getPConnect().getContainerManager().initializeContainers({type:t,name:"primary",context:"app"}),{props:{getPConnect:n.getPConnect}}}};const fE=new class{constructor(){this.runtimeParams={},this.runtimeParamsMap={}}setRuntimeParams(e){this.runtimeParams=e}getRuntimeParams(){return this.runtimeParams}setRuntimeParam(e,t){this.runtimeParamsMap[e]=t}getRuntimeParam(e){return this.runtimeParamsMap[e]}};const mE=class{constructor(e){this.appAlias=e.appAlias,this.appAliasWithoutServlet=e.appAliasWithoutServlet,this.googleMapKey=e.googleMapKey,this.staticContentServer=e.staticContentServer,this.appStaticContentServer=e.appStaticContentServer||null,this.contextPath=e.contextPath,this.messagingService=e.messagingService||null,this.reAuthUrl=e.reAuthUrl||null}};const yE=class{constructor(e){this.routingInfo=e.routingInfo,this.actionModel=e.actionModel,this.additionalHeaders=e.additionalHeaders,this.tokens=e.tokens,this.semanticUrl=e.semanticUrl,this.queryParams=e.queryParams,this.noPortal=e.noPortal,this.timezone=e.timezone,this.noHistory=e.noHistory,this.viewName=e.viewName,this.theme=e.theme,this.fieldDefaults=e.fieldDefaults,this.restServerConfig=e.restServerConfig,this.dynamicLoadComponents=void 0===e.dynamicLoadComponents||e.dynamicLoadComponents,this.dynamicSemanticUrl=void 0===e.dynamicSemanticUrl||e.dynamicSemanticUrl,this.enableRouting=void 0===e.enableRouting||e.enableRouting,this.locale=e.locale,this.environmentInfo=e.environmentInfo,this.renderingMode=e.renderingMode||"FULL_PORTAL",this.remoteCaseMapping=e.remoteCaseMapping||{},this.envType=e.envType,this.serviceConfig=new mE(e.serviceConfig),this.behaviorOverrides=e.behaviorOverrides,this.initBroadcast=!!e.initBroadcast,this.cookieComplianceMethod=e.cookieComplianceMethod??"none",this.isExtraCallRequiredForDefaultHome=e.isExtraCallRequiredForDefaultHome??"false"}},IE=async()=>{const e=up.getLocale(),t=up.getFeatureMap().localizationVersion||1;let n;if("en-US"!==e)try{let r;2===t?r=[e]:(r=[hp.GENERIC_BUNDLE_KEY,hp.MESSAGE_BUNDLE_KEY,hp.FIELD_LABELS_BUNDLE_KEY,...hp.getCaseTypeLocaleReferences()],n=await hp.isCurrentLocalePackAvailable());const s=r.map((async r=>{2===t?await(async e=>{const t=up.getFeatureMap().availableLanguagePacks||[];if(!e||!t.includes(e))return void console.warn(`current locale ${e} is not supported by application.`);const n={locale:e},r=await Bm("getLocalizationPack",{queryPayload:n});if((201===r.status||200===r.status)&&r.data){const e=r.data;Object.keys(e).forEach((t=>{hp.setLocaleForRule(e[t],t)}))}})(r):n&&await(async(e,t)=>{const n=await Lr.getSvcLocale(t,`${e}.json`);if(n?.ok&&e){const t=await n.json();hp.setLocaleForRule(t,e)}})(r,e)}));await Promise.allSettled(s)}catch(e){console.warn(e)}},EE="@P .viewConfig";let AE=0;const _E=new class{#f(e,t,n){jg(e),kr.buildActionTargetMap(t),y(n)}init(e){const t=new yE(e),n={...t.environmentInfo,renderingMode:t.renderingMode};_g(t.enableRouting),lE({}),up.setTheme(t.theme),up.setCookieComplianceMethod(t.cookieComplianceMethod),up.setIsExtraCallRequiredForDefaultHome(t.isExtraCallRequiredForDefaultHome),br.updateFieldDefaults(t.fieldDefaults),nc.setDefaultHeaders(t.additionalHeaders),this.#f(t.routingInfo,t.actionModel,{server:t.restServerConfig,reAuthUrl:t.serviceConfig.reAuthUrl}),Lr.setAppAlias(t.serviceConfig.appAliasWithoutServlet||t.serviceConfig.appAlias),_(t.serviceConfig.googleMapKey),Lr.initServer(t.serviceConfig.staticContentServer,t.serviceConfig.appStaticContentServer,t.tokens.C11NB2S),hp.setTimezone(t.timezone),up.setEnvironmentInfo(n),up.setLocale(t.locale),$.setRemoteCaseMapping(t.remoteCaseMapping),hu.setConnectionConfig({messagingService:t.serviceConfig.messagingService}),uE.init(),t.initBroadcast&&pE.getBroadcastUtils().init()}getBootstrapConfig=async(e,t)=>{const n=`${t.token_type} ${t.access_token}`;return fetch(`${e}/api/application/v2/data_views/D_pxBootstrapConfig`,{method:"GET",headers:new Headers({Authorization:n})}).then((e=>e.json()))};initCoreContainers=(e={})=>{const{containerType:t="single"}=e,n=Xu({meta:{type:"RootContainer",config:{renderingMode:"noPortal"},children:[{type:"ViewContainer",config:{routingInfo:"@ROUTING_INFO",name:"primary"}}]},options:{context:"root",pageReference:"",target:"root"}});return n.getPConnect().getContainerManager().initializeContainers({type:t,name:"primary",context:"app"}),{props:{getPConnect:n.getPConnect}}};importReactRoot=async()=>{const e=[];return gE.getComponentsRegistry().getComponent("ReactRoot").modules.forEach((t=>{e.push(t())})),Promise.allSettled(e)};importDesignSystemComponentMap=async(e,t,n)=>{try{await function(e,t="true"){return new Promise(((n,r)=>{const s=document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("src",e),s.setAttribute("async",t),s.onload=n(),s.onerror=()=>r(new Error("Failed to load resource from Design System")),document.body.appendChild(s)}))}(`${e}component/project/${t}/designsystems/${n}/componentsmap.js?v=${Date.now()}`)}catch(e){console.log(e)}};buildSemanticUrl=(e,t,n,r,s)=>{const a=new URLSearchParams(t);let o=!1;"true"===n&&(o=!0);let i=null,c=null;if(e){e.startsWith("/")&&(e=e.substring(1));const t=e.split("/");i=t[0],t.length>1&&t[1]&&(c=t[1])}else o=!1;let l=r;i&&(l=`${l}/${i}`),c&&(l=`${l}/${c}`),o&&(a.has("noPortal")||a.append("noPortal","true"),c&&s&&a.append("view",s));const u=a.toString();return l+=u?`?${u}`:"",l};initCoreConfig=e=>{const{routingInfo:t,serviceConfig:n,semanticUrl:r,queryParams:s,noPortal:a,noHistory:o,viewName:i,theme:c,restServerConfig:l,dynamicLoadComponents:u=!0,dynamicSemanticUrl:d=!0,renderingMode:p="FULL_PORTAL",envType:h,extras:g}=e,{appAlias:f,contextPath:m}=n;let y=window.location.origin;const I={};if(void 0!==l&&(y=l),m&&(y=`${y}${m}`),f&&"LAUNCHPAD"!==h&&(y=`${y}/${f}`),e.restServerConfig=y,!0===d){const e=this.buildSemanticUrl(r,s,a,y,i);!o&&e&&window.history.pushState({},"home",e)}else if("HYBRID"!==p){let e=window.location.href;e.indexOf("?")>0&&(e=e.substring(0,e.indexOf("?")),window.history.pushState({},"home",e)),I.dynamicSemanticUrl=!1}else console.log(`renderingMode :${p}`);!0!==u&&(I.dynamicLoadComponents=!1);let E=null;if(f){const e=f.indexOf("/app/");E=e>=0?f.substring(e+1):f}if(Object.keys(I).length>0&&window.PCore.setBehaviorOverrides(I),e.appAlias=E,c){let t="object"==typeof c?c:null;if(null===t)try{t=JSON.parse(c)}catch{t={}}e.theme=t}const A={...t,domain:`${window.location.protocol}//${window.location.host}`,searchParams:window.location.search};e.routingInfo=A,e.initBroadcast="true"===up.environmentInfoObject?.pxMashupDetails?.pyIsTraditionalCoexistence,!e.noPortal||"true"!==e.noPortal&&!0!==e.noPortal||(e.renderingMode="EMBED"),g?.cspNonce&&(window.__webpack_nonce__=g.cspNonce),this.init(e)};launchViewByName=(e,t,n,r,s,a,o,i)=>{AE+=1;const c=i||`mashup${AE}`,l={type:"RootContainer",config:{viewConfig:EE,renderingMode:"view",name:c}};gE.loadRootComponent(e,l,s,a,o).then((()=>gE.loadViewByName(t,n,r,c)))};launchView=(e,t,n=[],r,s,a,o)=>{AE+=1;const i="hybrid"===o?`hybrid_${AE}`:o;AE+=1;const c=i||`mashup${AE}`,l={type:"RootContainer",config:{viewConfig:EE,renderingMode:"portal",name:c}};fE.setRuntimeParams(r),gE.loadRootComponent(e,l,n,s,a).then((()=>gE.updateStoreWithUiRoot(t,c)))};launchPortal=(e,t,n,r=[])=>{AE+=1;const s=n||`portal${AE}`,a={type:"RootContainer",config:{viewConfig:EE,renderingMode:"portal",skeleton:"LoadingComponent",name:s}};r.push(a.config.skeleton),up.isPortalLoaded=!0,gE.loadRootComponent(e,a,r).then((()=>gE.loadPortalView(t,s)))};launchMashup=(e,t=!0)=>{const n={type:"RootContainer",config:{renderingMode:"noPortal"},children:[{type:"ViewContainer",config:{routingInfoAnnotation:"@ROUTING_INFO",name:"primary"}}]};if(t){const t=document.getElementsByTagName(e)[0]?.parentNode;if(t){const e=document.createElement("style");e.setAttribute("id","portal-less-styles"),e.innerHTML="app-root.mashup > .case-view, app-root.mashup > .page-view { min-height: 0px !important; }",t.appendChild(e)}}gE.loadRootComponent(e,n,[PCore.getConstants().LOAD_VIEW_STRING,"ViewContainer"]),window.parent!==window&&s(754)(`${window.PCore.getAssetLoader().getStaticServerUrl()}constellation-mashup-bridge.js`).then((e=>{e.mashup.init({resizing:"stretch"})}))};start=async(e,t)=>{const{appStaticContentServer:n}=e.serviceConfig,{ccV2LibId:r,environmentId:s,isAlternateDesignSystemEnabled:a,alternateDesignSystemName:o}=e;this.initCoreConfig(e);const i=async()=>(await this.importReactRoot(),r&&await Lr.importCustomComponentMap(r),"true"===a&&"other"!==o&&await this.importDesignSystemComponentMap(n,s,o),t&&t(),!0);return new Promise(((e,t)=>{IE().then((async()=>{const t=gE.getComponentsRegistry();"ReactRoot"in t.getLazyMap()?e(!0):t.getComponent("ReactRoot")?e(await i()):Gr.subscribe("component-map-loaded",(async()=>{e(await i())}))})).catch((e=>{t(e)}))}))};registerForDebugInfo=e=>{PCore.getEnvironmentInfo().setPreviewMode(),e&&PCore.getPubSubUtils().subscribe("fetchSuccess",(({debugInfo:t})=>{const n=t?.["X-Pega-App-Debug-ID"];e.postMessage({appDebugID:n})}),"fetchSuccess")};toggleTracerHeaders=e=>{e.addEventListener("message",(async e=>{const t=e?.data?.enableTracer;t?PCore.getDebugger().enableTracer():PCore.getDebugger().disableTracer()}))};loadEnvironmentInfo=async e=>{if(e.theme&&(!window.pms||"Android"!==window.pms.device.systemName))try{const t=JSON.parse(e.theme.definition);PCore.getEnvironmentInfo().setBrandingInfo(t.Branding),PCore.getEnvironmentInfo().setTheme(t.Theme)}catch{PCore.getEnvironmentInfo().setBrandingInfo({}),PCore.getEnvironmentInfo().setTheme({})}e.keyMapping&&PCore.getEnvironmentInfo().setKeyMapping(e.keyMapping),PCore.getEnvironmentInfo().setCookieComplianceMethod(e.cookieComplianceMethod??"none")}},CE={createViewRule:(e,t)=>{const{restApi:n,reqType:r}=Ng("createViewRuleByID");return pc(n,{method:r,body:e},t).then((e=>e.data))},getViewRule:(e,t)=>{const{restApi:n,reqType:r}=Ng("getViewRuleByID",{ID:e});return pc(n,{method:r},t).then((e=>e.data))},updateViewRule:(e,t,n)=>{const{restApi:r,reqType:s}=Ng("updateViewRuleByID",{ID:e});return pc(r,{method:s,body:t},n).then((e=>e.data))},deleteViewRule:(e,t)=>{const{restApi:n,reqType:r}=Ng("deleteViewRuleByID",{ID:e});return pc(n,{method:r},t).then((e=>e.data))}},SE={"Content-Type":"application/json"},TE={addCaseFollower:(e,t,n)=>{const r={caseID:e},s=JSON.stringify({users:t.map((e=>({ID:e})))});return Bm("addCaseFollower",{body:s,queryPayload:r,headers:SE},n)},deleteCaseFollower:(e,t,n)=>Bm("deleteCaseFollower",{queryPayload:{caseID:e,followerID:t}},n),getCaseFollowers:(e,t)=>Bm("getCaseFollowers",{queryPayload:{caseID:e}},t).then((e=>e.data.followers))},NE={addRelatedCases:(e,t,n)=>{const r={caseID:e},s=JSON.stringify({cases:t});return Bm("addRelatedCases",{body:s,queryPayload:r},n)},removeRelatedCase:(e,t,n)=>Bm("removeRelatedCase",{queryPayload:{caseID:e,relatedCaseID:t}},n),getRelatedCases:(e,t)=>Bm("getRelatedCases",{queryPayload:{caseID:e}},t).then((e=>e.data.relatedCases))},PE="operatorDetails",RE={getOperatorDetails:(e,t=!1)=>{const{reqType:n}=Ng(PE,{});if("GET"===n){const t={encodedOperatorId:encodeURIComponent(`{"opname":"${e}"}`)};return Bm(PE,{queryPayload:t})}return t?Bm("operatorDetailsByBusinessID",{body:{dataViewParameters:{BusinessID:e}}}):Bm(PE,{body:{dataViewParameters:{ID:e}}})}},DE=async e=>{const t=Pm(e),n=Sh.getIn(t,j.COMPONENTS);wr(t,{},!0);const r=Sh.getIn(t,j.LOCALE_REFERENCES);await hp.loadLocaleResources(r||[]),await jr(n)},bE=(e,t,n)=>Rh.resolveView(e,t,n),OE={"Content-Type":"application/json"};const vE=new class{constructor(){this.mentionsTagsCancelTokenSource=[],this.mentions=[]}getFeeds=(e,t,n,r,s,a,o)=>{const{getLocaleValue:i}=hp;o||(this.mentions=[]);let c="";r&&Array.isArray(r)&&r?.length>0&&(r.forEach((e=>{e.on&&(c=`${c}${e.id},`)})),""===c&&(c="ClearFilters"));let l="";o&&(l=a.getValue("pulse.pageLastEntry"));const u={filterForContext:e,feedID:t,feedClass:n,filterBy:c,pageSize:10,olderThan:l};for(let e=0;e<s.length;e+=1)s[e].cancel();const d=Hm();return s.push(d),Bm("getFeedMessages",{queryPayload:u,cancelTokenSource:d},a.getContextName()).then((async e=>{if(200===e.status&&e.data){s.pop();const t=[],n={};let c=!1;if(e?.data){if(e?.data?.data?.FeedList){const r=e.data.data.FeedList?.pxResults;Array.isArray(r)&&r?.length>0&&r.forEach(((e,r)=>{e.ID=""!==e.pzInsKey?e.pzInsKey:`message${r}`,t.push(e.ID),n[e.ID]=e,e?.mentions&&Array.isArray(e?.mentions)&&e.mentions?.length>0&&this.mentions.push(e.mentions),e?.pxResults&&Array.isArray(e?.pxResults)&&e.pxResults?.length>0&&e.pxResults.forEach((e=>{e?.mentions&&Array.isArray(e?.mentions)&&e.mentions?.length>0&&this.mentions.push(e.mentions)})),c||"pzPostDetails"===e.pyMessageViewReference||"pzPrivatePostDetails"===e.pyMessageViewReference||(c=!0)}))}if(c&&await DE({uiResources:e.data.uiResources}),!r&&(r=[{id:"All",label:i("All","Pulse"),on:!0,disabled:!1}],e?.data?.data?.FeedFilters)){const t=e.data.data.FeedFilters?.pxResults;let n=!0;t&&Array.isArray(t)&&t?.length>0&&(t.forEach((e=>{const t={id:e.pyFeedSourceReference,label:i(e.pyLabel,"Pulse"),disabled:!1,on:"true"===e.pySelected};t.on||(n=!1),r.push(t)})),r.find((e=>"All"===e.id)).on=n)}}if(o&&a.getValue("pulse.messageIDs")){let r=a.getValue("pulse.messageIDs"),s=a.getValue("pulse.messages");r=[...r,...t],s={...s,...n},Object.values(s).forEach((e=>{e?.mentions&&Array.isArray(e?.mentions)&&e.mentions?.length>0&&this.mentions.push(e.mentions),e?.pxResults&&Array.isArray(e?.pxResults)&&e.pxResults?.length>0&&e.pxResults.forEach((e=>{e?.mentions&&Array.isArray(e?.mentions)&&e.mentions?.length>0&&this.mentions.push(e.mentions)}))})),a.updateState({pulse:{messages:s,messageIDs:r,nextPageFirstEntry:e?.data?.nextPageFirstEntry||"",pageLastEntry:e?.data?.pageLastEntry||"",hideAttachment:e?.data?.hideAttachment||!1}})}else a.updateState({pulse:{messages:n,messageIDs:t,nextPageFirstEntry:e?.data?.nextPageFirstEntry||"",pageLastEntry:e?.data?.pageLastEntry||"",hideAttachment:e?.data?.hideAttachment||!1}});const l=[...new Map(this.mentions.flat()?.map((e=>[e.mentionsID,e]))).values()]?.filter((e=>Object.prototype.hasOwnProperty.call(e,"mentionsType")))?.filter((e=>!e?.mentionsType?.toLowerCase().includes("user")))||[];return{feedFilters:r,caseMentions:l}}return a.reportError(`getFeeds call failed ${e.status}`,e.data),""})).catch((e=>{qm(e)||a.reportError(": Error occurred during ajax call at getFeeds API : ",e.response)}))};postMessage=(e,t,n=[],r=!1,s)=>{const a=JSON.stringify({context:e,parentMessageId:r?e:"",message:t,attachments:n});return Bm("postFeedMessages",{body:a,headers:OE},s.getContextName()).then((t=>{if((201===t.status||200===t.status)&&t.data){const a=t?.data;if(r){a.parentMessageID=e;const{pxResults:t,caseMentions:o}=this.buildMessageObject(a,r,s,n.length>0);return s.updateState({pulse:{messages:{[e]:{pxResults:t}}}}),o}const{messages:o,messageIDs:i,caseMentions:c}=this.buildMessageObject(a,r,s,n.length>0);return s.updateState({pulse:{messages:o,messageIDs:i}}),c}return s.reportError(`postMessage call failed with status ${t.status}`,t),""})).catch((e=>{s.reportError(": Error occurred during ajax call at postMessage API : ",e.response)}))};editMessage=({messageID:e,parentMessageID:t,message:n,c11nEnv:r,isReply:s=!1})=>{const a=JSON.stringify({message:n});return Bm("editFeedMessage",{queryPayload:{messageID:e},body:a,headers:OE},r.getContextName()).then((e=>{if(200===e?.status&&e?.data){const n=e?.data;if(s){n.parentMessageID=t;const{pxResults:e,caseMentions:a}=this.buildMessageObject(n,s,r,!1);return r.updateState({pulse:{messages:{[t]:{pxResults:e}}}}),a}const{messages:a,caseMentions:o}=this.buildMessageObject(n,s,r,!1);return r.updateState({pulse:{messages:a}}),o}return r.reportError(`editMessage call failed with status ${e.status}`,e),""})).catch((e=>{r.reportError(": Error occurred during ajax call at editMessage API : ",e.response)}))};buildMessageObject=(e,t,n,r=!1)=>{const s={ID:e?.ID||"",tags:e?.tags||[],pyHasAttachment:r,pzInsKey:e?.ID||"",pyMessage:e?.message||"",mentions:e?.mentions||[],postedByUser:e?.postedByUser,pxCreateDateTime:e?.postedTime||"",pxUpdateDateTime:e?.updatedTime||"",parentMessageID:e?.parentMessageID||"",pyIsEdited:"string"==typeof e?.isEdited?"true"===e?.isEdited:e?.isEdited||!1,pyFeed:{pyPostedOn:e?.postedTime||"",pyFeedTitle:e?.postedByUser?.name||"",pyIconType:"user",pyCommentContext:"pzInsKey",pyIconReference:"pi pi-case"},pyContext:"",pxIcon:"globe",pyMessageViewReference:"pzPostDetails"},a=n.getValue("pulse.messages");if(t){let{pxResults:e=[]}=Object.values(a)?.find((e=>e?.ID===s?.parentMessageID))||{};const t=e?.findIndex((e=>e?.pzInsKey===s?.ID));if(-1!==t){const n=[...e];n[t]={...n[t],...s},e=n}else e=[...e,s];return{pxResults:e,messages:{},messageIDs:[],caseMentions:this.getCaseMentions(e)}}const o=n.getValue("pulse.messageIDs");if(o){const e=o.includes(s.ID)?{...a[s.ID],...s}:s,t={...a,[s.ID]:e};return{messages:t,messageIDs:o.includes(s.ID)?o:[s.ID,...o],caseMentions:this.getCaseMentions(Object.values(t))}}};getCaseMentions=e=>{const t=e?.filter((e=>e?.mentions&&Array.isArray(e?.mentions)&&e.mentions?.length>0))?.map((e=>e.mentions))?.concat(this.mentions);return[...new Map(t.flat()?.map((e=>[e.mentionsID,e]))).values()]?.filter((e=>Object.prototype.hasOwnProperty.call(e,"mentionsType")))?.filter((e=>!e?.mentionsType?.toLowerCase().includes("user")))||[]};likeMessage=({pulseContext:e,likedBy:t,messageID:n,isReply:r,c11nEnv:s})=>{const a=t?"unlikeFeedMessages":"likeFeedMessages",o=JSON.stringify({ContextClass:e});Bm(a,{body:o,queryPayload:{pulseContext:e},headers:OE},s.getContextName()).then((a=>{if(200===a.status)if(r){const r=s.getValue(`pulse.messages.${n}`),a=r?.pxResults&&Array.isArray(r?.pxResults)&&r.pxResults?.length>0&&r.pxResults?.map((n=>{if((n={...n}).pzInsKey===e){let e=0,r=!1;const s=n.pyLikes?n?.pyLikes?.pxLikeCount:0;t?(e=s-1,r=!1):(e=s+1,r=!0),n.pyLikes={pxLikeCount:e,pxIsLiked:r}}return n}));s.updateState({pulse:{messages:{[n]:{pxResults:a}}}})}else{const r={...s.getValue(`pulse.messages.${n}`)},a=r.pyLikes?r.pyLikes.pxLikeCount:0;let o=0,i=!1;t?(o=a-1,i=!1):(o=a+1,i=!0),r.pyLikes={pxLikeCount:o,pxIsLiked:i},s.updateState({pulse:{messages:{[e]:r}}})}else s.reportError(`likeMessage call failed with status ${a.status}`,a)})).catch((e=>{s.reportError(": Error occurred during ajax call at likeMessage API : ",e.response.data)}))};deleteMessage=(e,t,n,r)=>{let s=e;t&&(s=n);Bm("deleteFeedMessage",{queryPayload:{messageID:s}},r.getContextName()).then((s=>{if(200===s.status)if(t){const t=r.getValue(`pulse.messages.${e}`),s=t?.pxResults&&Array.isArray(t?.pxResults)&&t.pxResults?.length>0&&t.pxResults?.filter((e=>e.pzInsKey!==n));r.updateState({pulse:{messages:{[e]:{pxResults:s}}}})}else{const t=r.getValue("pulse.messageIDs"),n=t&&Array.isArray(t)&&t?.length>0&&t?.filter((t=>t!==e)),s={...r.getValue("pulse.messages")};delete s[e],r.updateState({pulse:{messageIDs:n,messages:s}})}else r.reportError(`deleteMessage call failed with status ${s.status}`,s)})).catch((e=>{r.reportError(": Error occurred during ajax call at deleteMessage API : ",e.response)}))};getLikedUsers=(e,t)=>Bm("getFeedMessageLikes",{queryPayload:{messageID:e}},t.getContextName()).then((e=>e?.data?.users)).catch((e=>{t.reportError(": Error occurred during ajax call at getLikedUsers API : ",e.response)}));getMentionSuggestions=(e,t)=>{const{pulseContext:n,searchFor:r,mentionsType:s,listSize:a=5}=e,o={pulseContext:n,searchFor:r,mentionsType:s,listSize:a};for(let e=0;e<this.mentionsTagsCancelTokenSource.length;e+=1)this.mentionsTagsCancelTokenSource[e].cancel();const i=Hm();return this.mentionsTagsCancelTokenSource.push(i),Bm("getMentionSuggestions",{queryPayload:o,cancelTokenSource:i},t.getContextName()).then((e=>(this.mentionsTagsCancelTokenSource=[],200===e.status&&e.data?e?.data:(t.reportError(`Get mention suggestions call failed ${e.status}`,e.data),[])))).catch((e=>{qm(e)||t.reportError(": Error occurred during ajax call at getMentionSuggestions API : ",e.response.data)}))};getMentionTypes=e=>Bm("getMentionTypes",{},e.getContextName()).then((e=>e?.data)).catch((t=>{e.reportError(": Error occurred during ajax call at getMentionTypes API : ",t.response.data)}));getTagSuggestions=(e,t)=>{const{searchFor:n,listSize:r=5}=e,s={searchFor:n,listSize:r};for(let e=0;e<this.mentionsTagsCancelTokenSource.length;e+=1)this.mentionsTagsCancelTokenSource[e].cancel();const a=Hm();return this.mentionsTagsCancelTokenSource.push(a),Bm("getTagSuggestions",{queryPayload:s,cancelTokenSource:a},t.getContextName()).then((e=>{this.mentionsTagsCancelTokenSource=[];let n=[];return 200===e.status&&e?.data?n=e?.data?.tags&&Array.isArray(e?.data?.tags)&&e.data.tags.length>0&&e.data.tags?.map((e=>`#${e}`)):t.reportError(`Get tag suggestions call failed ${e.status}`,e.data),n})).catch((e=>{qm(e)||t.reportError(": Error occurred during ajax call at getTagSuggestions API : ",e.response.data)}))}},xE={getTaggedCases:(e,t)=>Bm("loadView",{queryPayload:{caseID:e,viewID:"pyTaggedCases"}},t.getContextName()).then((e=>e?.data)).catch((e=>{t.reportError(": Error occurred during ajax call at fetchTaggedcases API : ",e.response)})),getTags:(e,t)=>Bm("getCaseTags",{queryPayload:{caseID:e}},t.getContextName()).then((e=>e?.data?.tagsList)).catch((e=>{t.reportError(": Error occurred during ajax call at fetchTags API : ",e.response)})),postTags:(e,t,n)=>{const r={caseID:e},s=JSON.stringify({tags:t});return Bm("addTagsToCase",{body:s,queryPayload:r},n.getContextName()).then((e=>e?.data?.results)).catch((e=>{n.reportError(": Error occurred during ajax call at postTags API : ",e.response)}))},removeTag:(e,t,n)=>Bm("deleteCaseTag",{queryPayload:{caseID:e,tagID:t}},n.getContextName()).catch((e=>{n.reportError(": Error occurred during ajax call at removeTag API : ",e.response)})),getTagsLandingPageURL:e=>fu.getPageDataAsync("D_pxGetTagsLandingPageURL",e.getContextName(),{},{invalidateCache:!0}).catch((t=>{e.reportError(": Error occurred during ajax call getTagsLandingPageURL API : ",t.response)}))},wE=(e,t)=>{Hd(t.getContextName(),e.etag),qd(t.getContextName(),e.etag)},ME={getParticipants:(e,t)=>Bm("getAllParticipants",{queryPayload:{caseID:e}},t.getContextName()).then((e=>e?.data?.data.content.pyParticipants)).catch((e=>{t.reportError(": Error occurred during ajax call at getParticipants API : ",e.response)})),getRoleView:(e,t,n)=>Bm("getParticipantRoleView",{queryPayload:{caseID:e,participant_roleID:t}},n.getContextName()).then((e=>e?.data)).catch((e=>{n.reportError(": Error occurred during ajax call at fetchTaggedcases API : ",e.response)})),getParticipantRoles:(e,t)=>Bm("getParticipantRoles",{queryPayload:{caseID:e}},t.getContextName()).then((e=>e?.data?.participant_roles)).catch((e=>{t.reportError(": Error occurred during ajax call at getParticipantRoles API : ",e.response)})),getParticipant:(e,t,n)=>Bm("getParticipant",{queryPayload:{caseID:e,participantID:t}},n.getContextName()).then((e=>e?.data)).catch((e=>{n.reportError(": Error occurred during ajax call at getParticipant API : ",e.response)})),createParticipant:async(e,t,n,r)=>{const s={caseID:e},a={...n,participantRoleID:t},o={"if-match":r.getCaseSummary().headers.etag};return new Promise(((e,t)=>{Bm("createParticipant",{body:a,queryPayload:s,headers:o},r.getContextName()).then((t=>{wE(t.headers,r),e()})).catch((e=>{r.reportError(": Error occurred during ajax call at createParticipant API : ",e.response),t(e.response)}))}))},updateParticipant:async(e,t,n,r)=>{const s={caseID:e,participantID:t},a={"if-match":r.getCaseSummary().headers.etag};return new Promise(((e,t)=>{Bm("updateParticipant",{body:n,queryPayload:s,headers:a},r.getContextName()).then((t=>{wE(t.headers,r),e()})).catch((e=>{r.reportError(": Error occurred during ajax call at updateParticipant API : ",e.response),t(e.response)}))}))},deleteParticipant:(e,t,n)=>{const r={caseID:e,participantID:t},s={"if-match":n.getCaseSummary().headers.etag};return new Promise(((e,t)=>{Bm("deleteParticipant",{queryPayload:r,headers:s},n.getContextName()).then((t=>{wE(t.headers,n),e()})).catch((e=>{n.reportError(": Error occurred during ajax call at deleteParticipant API : ",e.response),t(e.response)}))}))}};function LE(e=[]){return e.reduce(((e,t)=>(e[t.personalizationID]={name:t.name,personalizationState:JSON.parse(t.personalizationState||"{}")},e)),{})}const UE="create",FE="update",jE="delete";function VE(e,t,n,r){const s=Gp(t);if(s){switch(e){case UE:case FE:{const{markAsDefault:e,...t}=r;Object.entries(t).length>0&&(s.allPersonalizations[n]=t),e&&(s.defaultPersonalization=n);break}case jE:delete s.allPersonalizations[n],s.defaultPersonalization===n&&(s.defaultPersonalization="");break;default:return null}return s}return null}const kE={},$E=e=>{const t=Gp(e);if(t)return Array.isArray(t.allPersonalizations)&&(t.allPersonalizations=LE(t.allPersonalizations)),Promise.resolve(t);const{restApi:n,reqType:r}=Ng("getUIListPersonalizations",{listID:e});return pc(n,{method:r,body:{}}).then((e=>{const{data:t}=e;return{allPersonalizations:LE(t.allPersonalizations),defaultPersonalization:t.defaultPersonalization}}))},BE=(e,t,n)=>{const{restApi:r,reqType:s}=Ng("createListPersonalization",{listID:e});return VE(UE,e,t,n),pc(r,{method:s,body:{...n,personalizationState:JSON.stringify(n.personalizationState)}}).then((e=>{const n=e.data;return kE[t]=n,e}))},GE=(e,t,n)=>{const r=kE[t]||t;VE(FE,e,t,n);const{restApi:s,reqType:a}=Ng("updateListPersonalization",{listID:e,personalizationID:r})||{};return pc(s,{method:a,body:{...n,personalizationState:JSON.stringify(n.personalizationState)}})},WE=(e,t)=>{const n=kE[t]||t;VE(jE,e,t);const{restApi:r,reqType:s}=Ng("deleteListPersonalization",{listID:e,personalizationID:n});return pc(r,{method:s,body:{}}).then((e=>(kE[t]&&delete kE[t],e)))};const HE=function(e){return e?{createPersonalization:BE.bind(null,e),updatePersonalization:GE.bind(null,e),deletePersonalization:WE.bind(null,e),fetchPersonalizations:$E.bind(null,e)}:{createPersonalization:()=>Promise.resolve(""),updatePersonalization:()=>Promise.resolve(),deletePersonalization:()=>Promise.resolve(),fetchPersonalizations:()=>Promise.resolve({})}},qE="getDataObjects",zE="getInsightByID",YE=["LocalList","RemoteList","PromptList","DataPage"];let KE=null;const XE={},JE=e=>au.getAppCacheKey(`PrimaryFields-${e}`);function QE(e){let t;return e[1].category?t=e[1].category:e[0].indexOf(":")>0&&(t=e[0].substring(0,e[0].indexOf(":"))),t}const ZE={getDataObjects:function(){const e=au.getAppCacheKey(qE);if(window.sessionStorage.getItem(e))return Promise.resolve(JSON.parse(window.sessionStorage.getItem(e)));const{restApi:t,reqType:n}=Ng(qE,{}),r=pc(t,{method:n});return r.then((t=>{window.sessionStorage.setItem(e,JSON.stringify(t))})),r},getDataPageObjects:function(e=!0){if(KE)return KE;const t=au.getAppCacheKey("getDataPageObjects");if(e&&window.sessionStorage.getItem(t))return Promise.resolve(JSON.parse(window.sessionStorage.getItem(t)));const{restApi:n,reqType:r}=Ng("getDataPages",{datapageRequestType:"explorable"});return KE=pc(n,{method:r,datapageRequestType:"explorable"}),KE.then((e=>{KE=null,window.sessionStorage.setItem(t,JSON.stringify(e))})),KE},getDataViewMetadata:function(e,t,n){if(!t){const{sourceMetadata:t,sourceFields:n}=function(e){const t=Bp(e);if(t&&t.classID){let e=Hp(t.classID);const n=new Set(t.primaryFields),r=t.rdFields?.fields?.filter((e=>e.indexOf(".")>0));if(r&&!Sh.isEmpty(r)){const n=r.reduce(((e,n)=>{const r=Lp(n,t.classID);return e[n]=r,e}),{});e={...e,...n}}if(e&&Object.keys(e).length>0){const r=new Set(Array.isArray(t?.rdFields)?t?.rdFields:t?.rdFields?.fields),s=r.size>0||n.size>0;for(const t in e)e[t].type.startsWith("Page")||s&&!(r.size>0&&r.has(t)||n.size>0&&n.has(t))?delete e[t]:e[t]?.datasource&&YE.includes(e[t].datasource.tableType)&&(e[t].fieldType="Picklist");return{sourceFields:e,sourceMetadata:t}}}return{}}(e);if(t&&n&&Object.keys(n).length>0){const e={data:{...t,fields:Object.entries(n).map((e=>({...e[1],fieldID:e[0],fieldType:e[1].fieldType?e[1].fieldType:e[1].isUserReference?"User reference":void 0,category:QE(e),classID:e[1].associationClassID?e[1].associationClassID:e[1].classID})))}};return Promise.resolve(e)}}const r={dataSource:e,columns:[],parameters:{},associationFilter:n,matchPosition:"",ignoreCase:!1};return Pu.init(r).then((({dataSourceMetaData:e})=>Promise.resolve({data:e})))},getDefaultColumns:function(e){const t=au.getAppCacheKey(`DefaultColumns_${Object.values(e).join("_")}`);if(window.sessionStorage.getItem(t))return Promise.resolve(JSON.parse(window.sessionStorage.getItem(t)));const{restApi:n,reqType:r}=Ng("getListData",{dataViewName:"D_pzGetDefaultColumns"}),s=pc(n,{method:r,body:{dataViewParameters:e}});return s.then((e=>{window.sessionStorage.setItem(t,JSON.stringify(e))})),s},getFieldsForDataSource:function(e,t,n){if(!t){const t=Bp(e),n=Array.isArray(t?.rdFields)?t?.rdFields:t?.rdFields?.fields;return n?Promise.resolve({data:{data:n.map((e=>({pyFieldName:e})))}}):Promise.resolve({data:{data:[]}})}const r=au.getAppCacheKey(`RDColumns-${e}`);if(window.sessionStorage.getItem(r))return Promise.resolve(JSON.parse(window.sessionStorage.getItem(r)));const s=au.getData("D_pxFieldsForDataSource",{dataViewParameters:{DataPageName:e}},n);return s.then((e=>{window.sessionStorage.setItem(r,JSON.stringify(e))})),s},getPrimaryFieldsForDataSource:function(e="",t=""){const n=au.getAppCacheKey(`PFColumns-${e}${t}`);if(window.sessionStorage.getItem(n))return Promise.resolve(JSON.parse(window.sessionStorage.getItem(n)));const r=au.getData("D_pxGetInitialFieldsForDataSource",{dataViewParameters:{DataPageName:e,ClassName:t}});return r.then((e=>{window.sessionStorage.setItem(n,JSON.stringify(e))})),r},getPrimaryFieldsForInsights:async function(e,t,n){const{allClasses:r,promisesToAwait:s,classesToFetch:a,isTopLevelClassPresent:o,joinedClassesToFetch:i}=function(e,t){const n=[],r=[];let s=!1;const a=[],o=[];return e&&o.push(e),t&&t.length>0&&o.push(...t),o.forEach((t=>{const o=JE(t);window.sessionStorage.getItem(o)||(XE[t]?r.push(XE[t]):(n.push(t),t===e?s=!0:a.push(t)))})),{allClasses:o,promisesToAwait:r,classesToFetch:n,isTopLevelClassPresent:s,joinedClassesToFetch:a}}(e,n);return a.length&&s.push((async(e,t,n,r)=>{const s=au.getData("D_pxGetPrimaryFieldsForInsights",{dataViewParameters:{...t&&{topLevelClassID:t},...r&&{joinedClassIDs:r.join(",")},...n&&{topLevelDataPageID:n}}}).then((t=>{const n=t.data?.data||[],r={};e.forEach((e=>{r[e]=[]})),n.forEach((({classID:e,pyFieldName:t})=>{r[e].push(t)})),Object.entries(r).forEach((([e,t])=>{const n=JE(e);window.sessionStorage.setItem(n,JSON.stringify(t))}))})).finally((()=>{e.forEach((e=>{delete XE[e]}))}));return e.forEach((e=>{XE[e]=s})),s})(a,o?e:void 0,o?t:void 0,i.length>0?i:void 0)),Promise.allSettled(s).then((()=>{const e={};return r.forEach((t=>{const n=JE(t);if(window.sessionStorage.getItem(n))try{e[t]=JSON.parse(window.sessionStorage.getItem(n))}catch{}})),{data:e}}))},getInsightIDs:function(){const{restApi:e,reqType:t}=Ng("getInsightIDs");return pc(e,{method:t})},getInsightByID:function(e){const t=Wp(e);if(t)return Promise.resolve({data:{pyInsights:[t]}});const n={insightID:e},{restApi:r,reqType:s}=Ng(zE,n);return pc(r,{method:s})},getInsightsByID:function(e){const t={insightID:e.join(",")},{restApi:n,reqType:r}=Ng(zE,t);return pc(n,{method:r})},createInsight:function(e){const{restApi:t,reqType:n}=Ng("createInsight");return pc(t,{method:n,body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})},updateInsight:function(e,t){const n={insightID:e},{restApi:r,reqType:s}=Ng("updateInsight",n),a=t.UpdateDateTime;return pc(r,{method:s,body:JSON.stringify(t),headers:{"if-match":a,"Content-Type":"application/json"}})},deleteInsight:function(e){const t={insightID:e},{restApi:n,reqType:r}=Ng("deleteInsight",t);return pc(n,{method:r})},exportToExcel:function(e){const{restApi:t,reqType:n}=Ng("exportToExcel");return pc(t,{method:n,body:JSON.stringify(e)})},exportToCSV:function(e){const{restApi:t,reqType:n}=Ng("exportToCSV");return pc(t,{method:n,body:JSON.stringify(e)})},scheduleInsight:(e,t)=>{const n={insightID:e},{restApi:r,reqType:s}=Ng("scheduleInsight",n);return pc(r,{method:s,body:JSON.stringify(t)})},updateScheduledInsight:(e,t,n)=>{const r={insightID:e,scheduleID:t},{restApi:s,reqType:a}=Ng("updateScheduledInsight",r);return pc(s,{method:a,body:JSON.stringify(n)})},deleteScheduledInsight:(e,t)=>{const n={insightID:e,scheduleID:t},{restApi:r,reqType:s}=Ng("deleteScheduledInsight",n);return pc(r,{method:s})},translateStrings:function(e){const{restApi:t,reqType:n}=Ng("translateStrings");return pc(t,{method:n,body:JSON.stringify(e)})}};const eA=new class{addRoutes=e=>{return t=e,void lp.addRoutes(t);var t}};const tA=class{static registerModule(e,t,n){n[e]=()=>t}};const nA=class{static getCaseEvent=()=>Object.freeze(F.PUB_SUB_EVENTS.CASE_EVENTS);static getDataEvent=()=>Object.freeze(F.PUB_SUB_EVENTS.DATA_EVENTS);static getTransientEvent=()=>Object.freeze(F.PUB_SUB_EVENTS.EVENT_TRANSIENT_ITEMS);static getBootstrapShellEvent=()=>Object.freeze(F.PUB_SUB_EVENTS.BOOTSTRAP_SHELL_EVENTS)},rA={getResolvedSemanticURL:(e,t,n)=>lp.getResolvedSemanticURL(e,t,n),getActions:()=>({ACTION_OPENWORKBYHANDLE:Be,ACTION_SHOWDATA:Ve,ACTION_SHOWVIEW:je}),updateSemanticURLAndDocumentTitle:e=>lp.updateSemanticURLAndDocumentTitle(e)};const sA=new class{constructor(){this.genericFailedMessage="Failed to display content. Contact the application administrator."}getGenericFailedMessage(){return this.genericFailedMessage}setGenericFailedMessage(e){this.genericFailedMessage=e}},aA={setTokens:e=>{Ic({tokenInfo:e}),yc(e?.csrf&&!e?.access_token?{pzCTkn:e?.csrf}:{Authorization:`${e?.token_type} ${e?.access_token}`}),setTimeout((()=>Gr.publish("updateSession",{updateStatus:"success"})),0)},revokeTokens:async()=>Wi(),getAuthInstance:e=>Gi.init(e),setAuthorizationHeader:e=>{yc({Authorization:e}),setTimeout((()=>Gr.publish("updateSession",{updateStatus:"success"})),0)}};const oA=new class{getDebouncedSubject(e){return(new rf).pipe(HI(e))}};vr.register("email",(e=>{let t=null;return e&&!function(e){const t="[^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+",n="\\x5c[\\x00-\\x7f]",r=`(${t}|\\x5b([^\\x0d\\x5b-\\x5d\\x80-\\xff]|${n})*\\x5d)`,s=`(${t}|\\x22([^\\x0d\\x22\\x5c\\x80-\\xff]|${n})*\\x22)`;return new RegExp(`^${s}(\\x2e${s})*\\x40${r}(\\x2e${r})*$`).test(e)}(e)&&(t=hp.getLocaleValue("Enter a valid email address","Messages")),t})),vr.register("integer",(e=>{let t=null;return e&&!/^(-)?\d+$/.test(e)&&(t=hp.getLocaleValue("Invalid number","Messages")),t})),vr.register("required",(e=>Array.isArray(e)&&0===e.length||null==e||""===e?hp.getLocaleValue("Cannot be blank","Messages"):null)),vr.register("url",(e=>{let t=null;return e&&!function(e){let t;try{t=new URL(e)}catch{return!1}return"http:"===t.protocol||"https:"===t.protocol||"ftp:"===t.protocol}(e)&&(t=hp.getLocaleValue("Enter a valid url","Messages")),t})),setTimeout((()=>{const e=hp.getLocaleValue("Enter a valid phone number","Messages");s.e(664).then(s.bind(s,654)).then((({parsePhoneNumberFromString:t})=>{vr.register("phone",(n=>{let r=null;n&&!/^\+?\d+$/.test(n)&&(r=e);const s=n?.startsWith("+");if(n&&s){const s=t(n);s?.isPossible()&&n===s?.number||(r=e)}return r}))}))}),j.PRIORITY.TRIVIAL);const iA=(e,t)=>{switch(t){case"invalid":return hp.getLocaleValue(`Incorrect ${e}`,"Messages");case"incomplete":return hp.getLocaleValue(`Incomplete ${e}`,"Messages");default:return null}};vr.register("datetime",(e=>iA("DateTime",e))),vr.register("date",(e=>iA("Date",e))),vr.register("time",(e=>iA("Time",e))),vr.register("attachment",((e,t)=>(dh(`.attachmentsList${t.pageReference?.replace("caseInfo.content","")}${t.property}`,"context_data",t.context)||[]).some((e=>e.props?.error))?hp.getLocaleValue("Error with one or more files"):null));const cA={createConversation:(e,t,n,r=[])=>{for(const e of r)e?.cancel&&"function"==typeof e.cancel&&e.cancel();const s=Hm();r.push(s);const a={assistantID:t},o=JSON.stringify({contextID:e});return Bm("createConversation",{body:o,cancelTokenSource:s,queryPayload:a},n).then((e=>(r.pop(),e)))},sendMessage:(e,t,n,r)=>{const s={assistantID:e,conversationID:t},a=JSON.stringify({request:n});return Bm("sendMessage",{body:a,queryPayload:s},r)}};const lA=class{caseTypeAccessMap=new Map;constructor(){this.caseTypeAccessMap=up.getCaseTypeList().reduce(((e,t)=>(e.set(t.pyWorkTypeImplementationClassName,t.hasCreateAccess??!0),e)),new Map)}hasCreateAccess(e){return this.caseTypeAccessMap.get(e)}static getInstance(){return this.instance||(this.instance=new this),this.instance}};class uA{constructor(){uA.behaviorOverrides={}}static behaviorOverrides={};getPCoreVersion=()=>"24.2.2";onPCoreReady=e=>gE.onPCoreReady(e);onPCoreCleanup=e=>gE.onPCoreCleanup(e);getComponentsRegistry=()=>gE.getComponentsRegistry();checkIfSemanticURL=()=>gE.checkIfSemanticURL();isValidSemanticURL=()=>(()=>{if(Ug()){const e=lp.processUrl(op(),!0);return!!lp._getMatchedRouteInRoutingTable(e)}return!1})();getRoutingUtils=()=>eA;getViewResources=()=>d;configureForBrowserBookmark=e=>gE.configureForBrowserBookmark(e);getStore=()=>oh();resetStore=()=>Ah();getMessageManager=()=>Zn;getCoexistenceManager=()=>pE;getStoreValue=(e,t,n)=>dh(e,t,n);getContainerUtils=()=>o;getAnnotationUtils=()=>ul;getFieldUtils=()=>kn;getFieldDefaultUtils=()=>br;getAssetLoader=()=>Lr;getAttachmentUtils=()=>Cp;getViewRuleApi=()=>CE;getFeedUtils=()=>vE;getTagUtils=()=>xE;getGenAIAssistantUtils=()=>cA;getStakeholderUtils=()=>ME;getUserApi=()=>RE;getCaseFollowerApi=()=>TE;getCaseUtils=()=>Cc;getStateUtils=()=>ku;getRelatedCasesApi=()=>NE;getPersonalizationUtils=HE;getDataApi=()=>Pu;getDataApiUtils=()=>au;getAnalyticsUtils=()=>ZE;getLocaleUtils=()=>hp;registerLocaleManager=e=>{const t=this.getLocaleUtils();Object.keys(e).forEach((n=>{t[n]=e[n]}))};setBehaviorOverrides=e=>{uA.behaviorOverrides=e};setBehaviorOverride=(e,t)=>{uA.behaviorOverrides[e]=t};getBehaviorOverrides=()=>uA.behaviorOverrides;getBehaviorOverride=e=>uA.behaviorOverrides[e];getAsynchronousUtils=()=>oA;createPConnect=e=>Xu(e);getPubSubUtils=()=>Gr;registerComponentCreator=e=>{Ju(e)};getConstants=()=>Object.freeze(F);getEvents=()=>nA;getRestClient=()=>u;getMashupApi=()=>hE;getEnvironmentInfo=()=>up;getRuntimeParamsAPI=()=>fE;getSemanticUrlUtils=()=>rA;getRemoteCaseUtils=()=>$;getNavigationUtils=()=>uE;registerModule=(e,t)=>tA.registerModule(e,t,this);getErrorHandler=()=>sA;getFormUtils=()=>Yc;getMessagingServiceManager=()=>hu;getMetadataUtils=()=>i;getDataPageUtils=()=>fu;getDataTypeUtils=()=>Ul;getCascadeManager=()=>nh;isDeepEqual=(e,t)=>h()(e,t);getAuthUtils=()=>aA;getDebugger=()=>ec;getDeferLoadManager=()=>ru;getExpressionEngine=()=>n;getActionsSequencer=()=>bu;getRefreshManager=()=>hl;getInitialiser=()=>_E;getAllStateMachines=(e,t,n)=>t&&n?Kc.getAllStateMachines(e,t,n):Kc.getAllStateMachinesByContext(e);getBootstrapUtils=()=>gE;getContextTreeManager=()=>Pn;getAccessPrivilege=()=>lA.getInstance()}const dA=new uA;s.g.PCore=dA})()})();
1
+ (()=>{var e,t,n={188:(e,t,n)=>{var r="__lodash_hash_undefined__",s=1/0,a="[object Function]",o="[object GeneratorFunction]",i="[object Symbol]",c=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,l=/^\w*$/,u=/^\./,d=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,p=/\\(\\)?/g,h=/^\[object .+?Constructor\]$/,g="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,f="object"==typeof self&&self&&self.Object===Object&&self,m=g||f||Function("return this")();var I,y=Array.prototype,E=Function.prototype,A=Object.prototype,_=m["__core-js_shared__"],C=(I=/[^.]+$/.exec(_&&_.keys&&_.keys.IE_PROTO||""))?"Symbol(src)_1."+I:"",S=E.toString,T=A.hasOwnProperty,N=A.toString,O=RegExp("^"+S.call(T).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),P=m.Symbol,D=y.splice,R=k(m,"Map"),b=k(Object,"create"),v=P?P.prototype:void 0,x=v?v.toString:void 0;function w(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function M(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function L(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function F(e,t){for(var n,r,s=e.length;s--;)if((n=e[s][0])===(r=t)||n!=n&&r!=r)return s;return-1}function U(e,t){var n;t=function(e,t){if(W(e))return!1;var n=typeof e;if("number"==n||"symbol"==n||"boolean"==n||null==e||q(e))return!0;return l.test(e)||!c.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:W(n=t)?n:$(n);for(var r=0,s=t.length;null!=e&&r<s;)e=e[B(t[r++])];return r&&r==s?e:void 0}function j(e){if(!H(e)||(t=e,C&&C in t))return!1;var t,n=function(e){var t=H(e)?N.call(e):"";return t==a||t==o}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?O:h;return n.test(function(e){if(null!=e){try{return S.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function V(e,t){var n,r,s=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?s["string"==typeof t?"string":"hash"]:s.map}function k(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return j(n)?n:void 0}w.prototype.clear=function(){this.__data__=b?b(null):{}},w.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},w.prototype.get=function(e){var t=this.__data__;if(b){var n=t[e];return n===r?void 0:n}return T.call(t,e)?t[e]:void 0},w.prototype.has=function(e){var t=this.__data__;return b?void 0!==t[e]:T.call(t,e)},w.prototype.set=function(e,t){return this.__data__[e]=b&&void 0===t?r:t,this},M.prototype.clear=function(){this.__data__=[]},M.prototype.delete=function(e){var t=this.__data__,n=F(t,e);return!(n<0)&&(n==t.length-1?t.pop():D.call(t,n,1),!0)},M.prototype.get=function(e){var t=this.__data__,n=F(t,e);return n<0?void 0:t[n][1]},M.prototype.has=function(e){return F(this.__data__,e)>-1},M.prototype.set=function(e,t){var n=this.__data__,r=F(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},L.prototype.clear=function(){this.__data__={hash:new w,map:new(R||M),string:new w}},L.prototype.delete=function(e){return V(this,e).delete(e)},L.prototype.get=function(e){return V(this,e).get(e)},L.prototype.has=function(e){return V(this,e).has(e)},L.prototype.set=function(e,t){return V(this,e).set(e,t),this};var $=G((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(q(e))return x?x.call(e):"";var t=e+"";return"0"==t&&1/e==-s?"-0":t}(t);var n=[];return u.test(e)&&n.push(""),e.replace(d,(function(e,t,r,s){n.push(r?s.replace(p,"$1"):t||e)})),n}));function B(e){if("string"==typeof e||q(e))return e;var t=e+"";return"0"==t&&1/e==-s?"-0":t}function G(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,s=t?t.apply(this,r):r[0],a=n.cache;if(a.has(s))return a.get(s);var o=e.apply(this,r);return n.cache=a.set(s,o),o};return n.cache=new(G.Cache||L),n}G.Cache=L;var W=Array.isArray;function H(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function q(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&N.call(e)==i}e.exports=function(e,t,n){var r=null==e?void 0:U(e,t);return void 0===r?n:r}},216:(e,t,n)=>{e=n.nmd(e);var r="__lodash_hash_undefined__",s=1,a=2,o=9007199254740991,i="[object Arguments]",c="[object Array]",l="[object AsyncFunction]",u="[object Boolean]",d="[object Date]",p="[object Error]",h="[object Function]",g="[object GeneratorFunction]",f="[object Map]",m="[object Number]",I="[object Null]",y="[object Object]",E="[object Promise]",A="[object Proxy]",_="[object RegExp]",C="[object Set]",S="[object String]",T="[object Symbol]",N="[object Undefined]",O="[object WeakMap]",P="[object ArrayBuffer]",D="[object DataView]",R=/^\[object .+?Constructor\]$/,b=/^(?:0|[1-9]\d*)$/,v={};v["[object Float32Array]"]=v["[object Float64Array]"]=v["[object Int8Array]"]=v["[object Int16Array]"]=v["[object Int32Array]"]=v["[object Uint8Array]"]=v["[object Uint8ClampedArray]"]=v["[object Uint16Array]"]=v["[object Uint32Array]"]=!0,v[i]=v[c]=v[P]=v[u]=v[D]=v[d]=v[p]=v[h]=v[f]=v[m]=v[y]=v[_]=v[C]=v[S]=v[O]=!1;var x="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,w="object"==typeof self&&self&&self.Object===Object&&self,M=x||w||Function("return this")(),L=t&&!t.nodeType&&t,F=L&&e&&!e.nodeType&&e,U=F&&F.exports===L,j=U&&x.process,V=function(){try{return j&&j.binding&&j.binding("util")}catch(e){}}(),k=V&&V.isTypedArray;function $(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function B(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function G(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var W,H,q,z=Array.prototype,Y=Function.prototype,K=Object.prototype,J=M["__core-js_shared__"],X=Y.toString,Q=K.hasOwnProperty,Z=(W=/[^.]+$/.exec(J&&J.keys&&J.keys.IE_PROTO||""))?"Symbol(src)_1."+W:"",ee=K.toString,te=RegExp("^"+X.call(Q).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ne=U?M.Buffer:void 0,re=M.Symbol,se=M.Uint8Array,ae=K.propertyIsEnumerable,oe=z.splice,ie=re?re.toStringTag:void 0,ce=Object.getOwnPropertySymbols,le=ne?ne.isBuffer:void 0,ue=(H=Object.keys,q=Object,function(e){return H(q(e))}),de=Ve(M,"DataView"),pe=Ve(M,"Map"),he=Ve(M,"Promise"),ge=Ve(M,"Set"),fe=Ve(M,"WeakMap"),me=Ve(Object,"create"),Ie=Ge(de),ye=Ge(pe),Ee=Ge(he),Ae=Ge(ge),_e=Ge(fe),Ce=re?re.prototype:void 0,Se=Ce?Ce.valueOf:void 0;function Te(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ne(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Oe(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Pe(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Oe;++t<n;)this.add(e[t])}function De(e){var t=this.__data__=new Ne(e);this.size=t.size}function Re(e,t){var n=qe(e),r=!n&&He(e),s=!n&&!r&&ze(e),a=!n&&!r&&!s&&Qe(e),o=n||r||s||a,i=o?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],c=i.length;for(var l in e)!t&&!Q.call(e,l)||o&&("length"==l||s&&("offset"==l||"parent"==l)||a&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Be(l,c))||i.push(l);return i}function be(e,t){for(var n=e.length;n--;)if(We(e[n][0],t))return n;return-1}function ve(e){return null==e?void 0===e?N:I:ie&&ie in Object(e)?function(e){var t=Q.call(e,ie),n=e[ie];try{e[ie]=void 0;var r=!0}catch(e){}var s=ee.call(e);r&&(t?e[ie]=n:delete e[ie]);return s}(e):function(e){return ee.call(e)}(e)}function xe(e){return Xe(e)&&ve(e)==i}function we(e,t,n,r,o){return e===t||(null==e||null==t||!Xe(e)&&!Xe(t)?e!=e&&t!=t:function(e,t,n,r,o,l){var h=qe(e),g=qe(t),I=h?c:$e(e),E=g?c:$e(t),A=(I=I==i?y:I)==y,N=(E=E==i?y:E)==y,O=I==E;if(O&&ze(e)){if(!ze(t))return!1;h=!0,A=!1}if(O&&!A)return l||(l=new De),h||Qe(e)?Fe(e,t,n,r,o,l):function(e,t,n,r,o,i,c){switch(n){case D:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case P:return!(e.byteLength!=t.byteLength||!i(new se(e),new se(t)));case u:case d:case m:return We(+e,+t);case p:return e.name==t.name&&e.message==t.message;case _:case S:return e==t+"";case f:var l=B;case C:var h=r&s;if(l||(l=G),e.size!=t.size&&!h)return!1;var g=c.get(e);if(g)return g==t;r|=a,c.set(e,t);var I=Fe(l(e),l(t),r,o,i,c);return c.delete(e),I;case T:if(Se)return Se.call(e)==Se.call(t)}return!1}(e,t,I,n,r,o,l);if(!(n&s)){var R=A&&Q.call(e,"__wrapped__"),b=N&&Q.call(t,"__wrapped__");if(R||b){var v=R?e.value():e,x=b?t.value():t;return l||(l=new De),o(v,x,n,r,l)}}if(!O)return!1;return l||(l=new De),function(e,t,n,r,a,o){var i=n&s,c=Ue(e),l=c.length,u=Ue(t),d=u.length;if(l!=d&&!i)return!1;var p=l;for(;p--;){var h=c[p];if(!(i?h in t:Q.call(t,h)))return!1}var g=o.get(e);if(g&&o.get(t))return g==t;var f=!0;o.set(e,t),o.set(t,e);var m=i;for(;++p<l;){var I=e[h=c[p]],y=t[h];if(r)var E=i?r(y,I,h,t,e,o):r(I,y,h,e,t,o);if(!(void 0===E?I===y||a(I,y,n,r,o):E)){f=!1;break}m||(m="constructor"==h)}if(f&&!m){var A=e.constructor,_=t.constructor;A==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof A&&A instanceof A&&"function"==typeof _&&_ instanceof _||(f=!1)}return o.delete(e),o.delete(t),f}(e,t,n,r,o,l)}(e,t,n,r,we,o))}function Me(e){return!(!Je(e)||function(e){return!!Z&&Z in e}(e))&&(Ye(e)?te:R).test(Ge(e))}function Le(e){if(n=(t=e)&&t.constructor,r="function"==typeof n&&n.prototype||K,t!==r)return ue(e);var t,n,r,s=[];for(var a in Object(e))Q.call(e,a)&&"constructor"!=a&&s.push(a);return s}function Fe(e,t,n,r,o,i){var c=n&s,l=e.length,u=t.length;if(l!=u&&!(c&&u>l))return!1;var d=i.get(e);if(d&&i.get(t))return d==t;var p=-1,h=!0,g=n&a?new Pe:void 0;for(i.set(e,t),i.set(t,e);++p<l;){var f=e[p],m=t[p];if(r)var I=c?r(m,f,p,t,e,i):r(f,m,p,e,t,i);if(void 0!==I){if(I)continue;h=!1;break}if(g){if(!$(t,(function(e,t){if(s=t,!g.has(s)&&(f===e||o(f,e,n,r,i)))return g.push(t);var s}))){h=!1;break}}else if(f!==m&&!o(f,m,n,r,i)){h=!1;break}}return i.delete(e),i.delete(t),h}function Ue(e){return function(e,t,n){var r=t(e);return qe(e)?r:function(e,t){for(var n=-1,r=t.length,s=e.length;++n<r;)e[s+n]=t[n];return e}(r,n(e))}(e,Ze,ke)}function je(e,t){var n,r,s=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?s["string"==typeof t?"string":"hash"]:s.map}function Ve(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Me(n)?n:void 0}Te.prototype.clear=function(){this.__data__=me?me(null):{},this.size=0},Te.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Te.prototype.get=function(e){var t=this.__data__;if(me){var n=t[e];return n===r?void 0:n}return Q.call(t,e)?t[e]:void 0},Te.prototype.has=function(e){var t=this.__data__;return me?void 0!==t[e]:Q.call(t,e)},Te.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=me&&void 0===t?r:t,this},Ne.prototype.clear=function(){this.__data__=[],this.size=0},Ne.prototype.delete=function(e){var t=this.__data__,n=be(t,e);return!(n<0)&&(n==t.length-1?t.pop():oe.call(t,n,1),--this.size,!0)},Ne.prototype.get=function(e){var t=this.__data__,n=be(t,e);return n<0?void 0:t[n][1]},Ne.prototype.has=function(e){return be(this.__data__,e)>-1},Ne.prototype.set=function(e,t){var n=this.__data__,r=be(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Oe.prototype.clear=function(){this.size=0,this.__data__={hash:new Te,map:new(pe||Ne),string:new Te}},Oe.prototype.delete=function(e){var t=je(this,e).delete(e);return this.size-=t?1:0,t},Oe.prototype.get=function(e){return je(this,e).get(e)},Oe.prototype.has=function(e){return je(this,e).has(e)},Oe.prototype.set=function(e,t){var n=je(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Pe.prototype.add=Pe.prototype.push=function(e){return this.__data__.set(e,r),this},Pe.prototype.has=function(e){return this.__data__.has(e)},De.prototype.clear=function(){this.__data__=new Ne,this.size=0},De.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},De.prototype.get=function(e){return this.__data__.get(e)},De.prototype.has=function(e){return this.__data__.has(e)},De.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Ne){var r=n.__data__;if(!pe||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Oe(r)}return n.set(e,t),this.size=n.size,this};var ke=ce?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,s=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[s++]=o)}return a}(ce(e),(function(t){return ae.call(e,t)})))}:function(){return[]},$e=ve;function Be(e,t){return!!(t=null==t?o:t)&&("number"==typeof e||b.test(e))&&e>-1&&e%1==0&&e<t}function Ge(e){if(null!=e){try{return X.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function We(e,t){return e===t||e!=e&&t!=t}(de&&$e(new de(new ArrayBuffer(1)))!=D||pe&&$e(new pe)!=f||he&&$e(he.resolve())!=E||ge&&$e(new ge)!=C||fe&&$e(new fe)!=O)&&($e=function(e){var t=ve(e),n=t==y?e.constructor:void 0,r=n?Ge(n):"";if(r)switch(r){case Ie:return D;case ye:return f;case Ee:return E;case Ae:return C;case _e:return O}return t});var He=xe(function(){return arguments}())?xe:function(e){return Xe(e)&&Q.call(e,"callee")&&!ae.call(e,"callee")},qe=Array.isArray;var ze=le||function(){return!1};function Ye(e){if(!Je(e))return!1;var t=ve(e);return t==h||t==g||t==l||t==A}function Ke(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}function Je(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Xe(e){return null!=e&&"object"==typeof e}var Qe=k?function(e){return function(t){return e(t)}}(k):function(e){return Xe(e)&&Ke(e.length)&&!!v[ve(e)]};function Ze(e){return null!=(t=e)&&Ke(t.length)&&!Ye(t)?Re(e):Le(e);var t}e.exports=function(e,t){return we(e,t)}},458:e=>{function t(e){return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}))}t.keys=()=>[],t.resolve=t,t.id=458,e.exports=t},521:(e,t,n)=>{var r="__lodash_hash_undefined__",s=1/0,a="[object Function]",o="[object GeneratorFunction]",i="[object Symbol]",c=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,l=/^\w*$/,u=/^\./,d=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,p=/\\(\\)?/g,h=/^\[object .+?Constructor\]$/,g="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,f="object"==typeof self&&self&&self.Object===Object&&self,m=g||f||Function("return this")();var I,y=Array.prototype,E=Function.prototype,A=Object.prototype,_=m["__core-js_shared__"],C=(I=/[^.]+$/.exec(_&&_.keys&&_.keys.IE_PROTO||""))?"Symbol(src)_1."+I:"",S=E.toString,T=A.hasOwnProperty,N=A.toString,O=RegExp("^"+S.call(T).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),P=m.Symbol,D=y.splice,R=$(m,"Map"),b=$(Object,"create"),v=P?P.prototype:void 0,x=v?v.toString:void 0;function w(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function M(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function L(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function F(e,t){for(var n,r,s=e.length;s--;)if((n=e[s][0])===(r=t)||n!=n&&r!=r)return s;return-1}function U(e){if(!z(e)||(t=e,C&&C in t))return!1;var t,n=function(e){var t=z(e)?N.call(e):"";return t==a||t==o}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?O:h;return n.test(function(e){if(null!=e){try{return S.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function j(e,t){e=function(e,t){return 1==t.length?e:function(e,t){for(var n=0,r=(t=B(t,e)?[t]:V(t)).length;null!=e&&n<r;)e=e[W(t[n++])];return n&&n==r?e:void 0}(e,function(e,t,n){var r=-1,s=e.length;t<0&&(t=-t>s?0:s+t),(n=n>s?s:n)<0&&(n+=s),s=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(s);++r<s;)a[r]=e[r+t];return a}(t,0,-1))}(e,t=B(t,e)?[t]:V(t));var n,r,s=W((r=(n=t)?n.length:0)?n[r-1]:void 0);return!(null!=e&&T.call(e,s))||delete e[s]}function V(e){return q(e)?e:G(e)}function k(e,t){var n,r,s=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?s["string"==typeof t?"string":"hash"]:s.map}function $(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return U(n)?n:void 0}function B(e,t){if(q(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Y(e))||(l.test(e)||!c.test(e)||null!=t&&e in Object(t))}w.prototype.clear=function(){this.__data__=b?b(null):{}},w.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},w.prototype.get=function(e){var t=this.__data__;if(b){var n=t[e];return n===r?void 0:n}return T.call(t,e)?t[e]:void 0},w.prototype.has=function(e){var t=this.__data__;return b?void 0!==t[e]:T.call(t,e)},w.prototype.set=function(e,t){return this.__data__[e]=b&&void 0===t?r:t,this},M.prototype.clear=function(){this.__data__=[]},M.prototype.delete=function(e){var t=this.__data__,n=F(t,e);return!(n<0)&&(n==t.length-1?t.pop():D.call(t,n,1),!0)},M.prototype.get=function(e){var t=this.__data__,n=F(t,e);return n<0?void 0:t[n][1]},M.prototype.has=function(e){return F(this.__data__,e)>-1},M.prototype.set=function(e,t){var n=this.__data__,r=F(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},L.prototype.clear=function(){this.__data__={hash:new w,map:new(R||M),string:new w}},L.prototype.delete=function(e){return k(this,e).delete(e)},L.prototype.get=function(e){return k(this,e).get(e)},L.prototype.has=function(e){return k(this,e).has(e)},L.prototype.set=function(e,t){return k(this,e).set(e,t),this};var G=H((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(Y(e))return x?x.call(e):"";var t=e+"";return"0"==t&&1/e==-s?"-0":t}(t);var n=[];return u.test(e)&&n.push(""),e.replace(d,(function(e,t,r,s){n.push(r?s.replace(p,"$1"):t||e)})),n}));function W(e){if("string"==typeof e||Y(e))return e;var t=e+"";return"0"==t&&1/e==-s?"-0":t}function H(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,s=t?t.apply(this,r):r[0],a=n.cache;if(a.has(s))return a.get(s);var o=e.apply(this,r);return n.cache=a.set(s,o),o};return n.cache=new(H.Cache||L),n}H.Cache=L;var q=Array.isArray;function z(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Y(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&N.call(e)==i}e.exports=function(e,t){return null==e||j(e,t)}},529:(e,t,n)=>{e=n.nmd(e);var r=9007199254740991,s="[object Arguments]",a="[object Function]",o="[object GeneratorFunction]",i="[object Map]",c="[object Promise]",l="[object Set]",u="[object WeakMap]",d="[object DataView]",p=/^\[object .+?Constructor\]$/,h="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,g="object"==typeof self&&self&&self.Object===Object&&self,f=h||g||Function("return this")(),m=t&&!t.nodeType&&t,I=m&&e&&!e.nodeType&&e,y=I&&I.exports===m;var E,A,_,C=Function.prototype,S=Object.prototype,T=f["__core-js_shared__"],N=(E=/[^.]+$/.exec(T&&T.keys&&T.keys.IE_PROTO||""))?"Symbol(src)_1."+E:"",O=C.toString,P=S.hasOwnProperty,D=S.toString,R=RegExp("^"+O.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),b=y?f.Buffer:void 0,v=S.propertyIsEnumerable,x=b?b.isBuffer:void 0,w=(A=Object.keys,_=Object,function(e){return A(_(e))}),M=q(f,"DataView"),L=q(f,"Map"),F=q(f,"Promise"),U=q(f,"Set"),j=q(f,"WeakMap"),V=!v.call({valueOf:1},"valueOf"),k=Y(M),$=Y(L),B=Y(F),G=Y(U),W=Y(j);function H(e){if(!ee(e)||function(e){return!!N&&N in e}(e))return!1;var t=Z(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?R:p;return t.test(Y(e))}function q(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return H(n)?n:void 0}var z=function(e){return D.call(e)};function Y(e){if(null!=e){try{return O.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function K(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&X(e)}(e)&&P.call(e,"callee")&&(!v.call(e,"callee")||D.call(e)==s)}(M&&z(new M(new ArrayBuffer(1)))!=d||L&&z(new L)!=i||F&&z(F.resolve())!=c||U&&z(new U)!=l||j&&z(new j)!=u)&&(z=function(e){var t=D.call(e),n="[object Object]"==t?e.constructor:void 0,r=n?Y(n):void 0;if(r)switch(r){case k:return d;case $:return i;case B:return c;case G:return l;case W:return u}return t});var J=Array.isArray;function X(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}(e.length)&&!Z(e)}var Q=x||function(){return!1};function Z(e){var t=ee(e)?D.call(e):"";return t==a||t==o}function ee(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=function(e){if(X(e)&&(J(e)||"string"==typeof e||"function"==typeof e.splice||Q(e)||K(e)))return!e.length;var t=z(e);if(t==i||t==l)return!e.size;if(V||function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||S)}(e))return!w(e).length;for(var n in e)if(P.call(e,n))return!1;return!0}},631:(e,t,n)=>{var r="__lodash_hash_undefined__",s=9007199254740991,a="[object Arguments]",o="[object Function]",i="[object GeneratorFunction]",c=/^\[object .+?Constructor\]$/,l="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,u="object"==typeof self&&self&&self.Object===Object&&self,d=l||u||Function("return this")();function p(e,t){return!!(e?e.length:0)&&function(e,t,n){if(t!=t)return function(e,t,n,r){var s=e.length,a=n+(r?1:-1);for(;r?a--:++a<s;)if(t(e[a],a,e))return a;return-1}(e,f,n);var r=n-1,s=e.length;for(;++r<s;)if(e[r]===t)return r;return-1}(e,t,0)>-1}function h(e,t,n){for(var r=-1,s=e?e.length:0;++r<s;)if(n(t,e[r]))return!0;return!1}function g(e,t){for(var n=-1,r=t.length,s=e.length;++n<r;)e[s+n]=t[n];return e}function f(e){return e!=e}function m(e,t){return e.has(t)}var I,y=Array.prototype,E=Function.prototype,A=Object.prototype,_=d["__core-js_shared__"],C=(I=/[^.]+$/.exec(_&&_.keys&&_.keys.IE_PROTO||""))?"Symbol(src)_1."+I:"",S=E.toString,T=A.hasOwnProperty,N=A.toString,O=RegExp("^"+S.call(T).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),P=d.Symbol,D=A.propertyIsEnumerable,R=y.splice,b=P?P.isConcatSpreadable:void 0,v=Math.max,x=G(d,"Map"),w=G(Object,"create");function M(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function L(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function F(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function U(e){var t=-1,n=e?e.length:0;for(this.__data__=new F;++t<n;)this.add(e[t])}function j(e,t){for(var n,r,s=e.length;s--;)if((n=e[s][0])===(r=t)||n!=n&&r!=r)return s;return-1}function V(e,t,n,r){var s,a=-1,o=p,i=!0,c=e.length,l=[],u=t.length;if(!c)return l;n&&(t=function(e,t){for(var n=-1,r=e?e.length:0,s=Array(r);++n<r;)s[n]=t(e[n],n,e);return s}(t,(s=n,function(e){return s(e)}))),r?(o=h,i=!1):t.length>=200&&(o=m,i=!1,t=new U(t));e:for(;++a<c;){var d=e[a],g=n?n(d):d;if(d=r||0!==d?d:0,i&&g==g){for(var f=u;f--;)if(t[f]===g)continue e;l.push(d)}else o(t,g,r)||l.push(d)}return l}function k(e,t,n,r,s){var a=-1,o=e.length;for(n||(n=W),s||(s=[]);++a<o;){var i=e[a];t>0&&n(i)?t>1?k(i,t-1,n,r,s):g(s,i):r||(s[s.length]=i)}return s}function $(e){if(!Q(e)||(t=e,C&&C in t))return!1;var t,n=X(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?O:c;return n.test(function(e){if(null!=e){try{return S.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function B(e,t){var n,r,s=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?s["string"==typeof t?"string":"hash"]:s.map}function G(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return $(n)?n:void 0}function W(e){return Y(e)||function(e){return J(e)&&T.call(e,"callee")&&(!D.call(e,"callee")||N.call(e)==a)}(e)||!!(b&&e&&e[b])}M.prototype.clear=function(){this.__data__=w?w(null):{}},M.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},M.prototype.get=function(e){var t=this.__data__;if(w){var n=t[e];return n===r?void 0:n}return T.call(t,e)?t[e]:void 0},M.prototype.has=function(e){var t=this.__data__;return w?void 0!==t[e]:T.call(t,e)},M.prototype.set=function(e,t){return this.__data__[e]=w&&void 0===t?r:t,this},L.prototype.clear=function(){this.__data__=[]},L.prototype.delete=function(e){var t=this.__data__,n=j(t,e);return!(n<0)&&(n==t.length-1?t.pop():R.call(t,n,1),!0)},L.prototype.get=function(e){var t=this.__data__,n=j(t,e);return n<0?void 0:t[n][1]},L.prototype.has=function(e){return j(this.__data__,e)>-1},L.prototype.set=function(e,t){var n=this.__data__,r=j(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},F.prototype.clear=function(){this.__data__={hash:new M,map:new(x||L),string:new M}},F.prototype.delete=function(e){return B(this,e).delete(e)},F.prototype.get=function(e){return B(this,e).get(e)},F.prototype.has=function(e){return B(this,e).has(e)},F.prototype.set=function(e,t){return B(this,e).set(e,t),this},U.prototype.add=U.prototype.push=function(e){return this.__data__.set(e,r),this},U.prototype.has=function(e){return this.__data__.has(e)};var H,q,z=(H=function(e,t){return J(e)?V(e,k(t,1,J,!0)):[]},q=v(void 0===q?H.length-1:q,0),function(){for(var e=arguments,t=-1,n=v(e.length-q,0),r=Array(n);++t<n;)r[t]=e[q+t];t=-1;for(var s=Array(q+1);++t<q;)s[t]=e[t];return s[q]=r,function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}(H,this,s)});var Y=Array.isArray;function K(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=s}(e.length)&&!X(e)}function J(e){return function(e){return!!e&&"object"==typeof e}(e)&&K(e)}function X(e){var t=Q(e)?N.call(e):"";return t==o||t==i}function Q(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=z},692:(e,t,n)=>{e=n.nmd(e);var r="__lodash_hash_undefined__",s=9007199254740991,a="[object Arguments]",o="[object AsyncFunction]",i="[object Function]",c="[object GeneratorFunction]",l="[object Null]",u="[object Object]",d="[object Proxy]",p="[object Undefined]",h=/^\[object .+?Constructor\]$/,g=/^(?:0|[1-9]\d*)$/,f={};f["[object Float32Array]"]=f["[object Float64Array]"]=f["[object Int8Array]"]=f["[object Int16Array]"]=f["[object Int32Array]"]=f["[object Uint8Array]"]=f["[object Uint8ClampedArray]"]=f["[object Uint16Array]"]=f["[object Uint32Array]"]=!0,f[a]=f["[object Array]"]=f["[object ArrayBuffer]"]=f["[object Boolean]"]=f["[object DataView]"]=f["[object Date]"]=f["[object Error]"]=f[i]=f["[object Map]"]=f["[object Number]"]=f[u]=f["[object RegExp]"]=f["[object Set]"]=f["[object String]"]=f["[object WeakMap]"]=!1;var m="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,I="object"==typeof self&&self&&self.Object===Object&&self,y=m||I||Function("return this")(),E=t&&!t.nodeType&&t,A=E&&e&&!e.nodeType&&e,_=A&&A.exports===E,C=_&&m.process,S=function(){try{var e=A&&A.require&&A.require("util").types;return e||C&&C.binding&&C.binding("util")}catch(e){}}(),T=S&&S.isTypedArray;var N,O,P,D=Array.prototype,R=Function.prototype,b=Object.prototype,v=y["__core-js_shared__"],x=R.toString,w=b.hasOwnProperty,M=(N=/[^.]+$/.exec(v&&v.keys&&v.keys.IE_PROTO||""))?"Symbol(src)_1."+N:"",L=b.toString,F=x.call(Object),U=RegExp("^"+x.call(w).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),j=_?y.Buffer:void 0,V=y.Symbol,k=y.Uint8Array,$=j?j.allocUnsafe:void 0,B=(O=Object.getPrototypeOf,P=Object,function(e){return O(P(e))}),G=Object.create,W=b.propertyIsEnumerable,H=D.splice,q=V?V.toStringTag:void 0,z=function(){try{var e=Ee(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),Y=j?j.isBuffer:void 0,K=Math.max,J=Date.now,X=Ee(y,"Map"),Q=Ee(Object,"create"),Z=function(){function e(){}return function(t){if(!ve(t))return{};if(G)return G(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function ee(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function te(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ne(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function re(e){var t=this.__data__=new te(e);this.size=t.size}function se(e,t){var n=Oe(e),r=!n&&Ne(e),s=!n&&!r&&De(e),a=!n&&!r&&!s&&we(e),o=n||r||s||a,i=o?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],c=i.length;for(var l in e)!t&&!w.call(e,l)||o&&("length"==l||s&&("offset"==l||"parent"==l)||a&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Ae(l,c))||i.push(l);return i}function ae(e,t,n){(void 0!==n&&!Te(e[t],n)||void 0===n&&!(t in e))&&ce(e,t,n)}function oe(e,t,n){var r=e[t];w.call(e,t)&&Te(r,n)&&(void 0!==n||t in e)||ce(e,t,n)}function ie(e,t){for(var n=e.length;n--;)if(Te(e[n][0],t))return n;return-1}function ce(e,t,n){"__proto__"==t&&z?z(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}ee.prototype.clear=function(){this.__data__=Q?Q(null):{},this.size=0},ee.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ee.prototype.get=function(e){var t=this.__data__;if(Q){var n=t[e];return n===r?void 0:n}return w.call(t,e)?t[e]:void 0},ee.prototype.has=function(e){var t=this.__data__;return Q?void 0!==t[e]:w.call(t,e)},ee.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Q&&void 0===t?r:t,this},te.prototype.clear=function(){this.__data__=[],this.size=0},te.prototype.delete=function(e){var t=this.__data__,n=ie(t,e);return!(n<0)&&(n==t.length-1?t.pop():H.call(t,n,1),--this.size,!0)},te.prototype.get=function(e){var t=this.__data__,n=ie(t,e);return n<0?void 0:t[n][1]},te.prototype.has=function(e){return ie(this.__data__,e)>-1},te.prototype.set=function(e,t){var n=this.__data__,r=ie(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},ne.prototype.clear=function(){this.size=0,this.__data__={hash:new ee,map:new(X||te),string:new ee}},ne.prototype.delete=function(e){var t=ye(this,e).delete(e);return this.size-=t?1:0,t},ne.prototype.get=function(e){return ye(this,e).get(e)},ne.prototype.has=function(e){return ye(this,e).has(e)},ne.prototype.set=function(e,t){var n=ye(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},re.prototype.clear=function(){this.__data__=new te,this.size=0},re.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},re.prototype.get=function(e){return this.__data__.get(e)},re.prototype.has=function(e){return this.__data__.has(e)},re.prototype.set=function(e,t){var n=this.__data__;if(n instanceof te){var r=n.__data__;if(!X||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ne(r)}return n.set(e,t),this.size=n.size,this};var le,ue=function(e,t,n){for(var r=-1,s=Object(e),a=n(e),o=a.length;o--;){var i=a[le?o:++r];if(!1===t(s[i],i,s))break}return e};function de(e){return null==e?void 0===e?p:l:q&&q in Object(e)?function(e){var t=w.call(e,q),n=e[q];try{e[q]=void 0;var r=!0}catch(e){}var s=L.call(e);r&&(t?e[q]=n:delete e[q]);return s}(e):function(e){return L.call(e)}(e)}function pe(e){return xe(e)&&de(e)==a}function he(e){return!(!ve(e)||function(e){return!!M&&M in e}(e))&&(Re(e)?U:h).test(function(e){if(null!=e){try{return x.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function ge(e){if(!ve(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=_e(e),n=[];for(var r in e)("constructor"!=r||!t&&w.call(e,r))&&n.push(r);return n}function fe(e,t,n,r,s){e!==t&&ue(t,(function(a,o){if(s||(s=new re),ve(a))!function(e,t,n,r,s,a,o){var i=Ce(e,n),c=Ce(t,n),l=o.get(c);if(l)return void ae(e,n,l);var d=a?a(i,c,n+"",e,t,o):void 0,p=void 0===d;if(p){var h=Oe(c),g=!h&&De(c),f=!h&&!g&&we(c);d=c,h||g||f?Oe(i)?d=i:xe(A=i)&&Pe(A)?d=function(e,t){var n=-1,r=e.length;t||(t=Array(r));for(;++n<r;)t[n]=e[n];return t}(i):g?(p=!1,d=function(e,t){if(t)return e.slice();var n=e.length,r=$?$(n):new e.constructor(n);return e.copy(r),r}(c,!0)):f?(p=!1,m=c,I=!0?(y=m.buffer,E=new y.constructor(y.byteLength),new k(E).set(new k(y)),E):m.buffer,d=new m.constructor(I,m.byteOffset,m.length)):d=[]:function(e){if(!xe(e)||de(e)!=u)return!1;var t=B(e);if(null===t)return!0;var n=w.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&x.call(n)==F}(c)||Ne(c)?(d=i,Ne(i)?d=function(e){return function(e,t,n,r){var s=!n;n||(n={});var a=-1,o=t.length;for(;++a<o;){var i=t[a],c=r?r(n[i],e[i],i,n,e):void 0;void 0===c&&(c=e[i]),s?ce(n,i,c):oe(n,i,c)}return n}(e,Me(e))}(i):ve(i)&&!Re(i)||(d=function(e){return"function"!=typeof e.constructor||_e(e)?{}:Z(B(e))}(c))):p=!1}var m,I,y,E;var A;p&&(o.set(c,d),s(d,c,r,a,o),o.delete(c));ae(e,n,d)}(e,t,o,n,fe,r,s);else{var i=r?r(Ce(e,o),a,o+"",e,t,s):void 0;void 0===i&&(i=a),ae(e,o,i)}}),Me)}function me(e,t){return Se(function(e,t,n){return t=K(void 0===t?e.length-1:t,0),function(){for(var r=arguments,s=-1,a=K(r.length-t,0),o=Array(a);++s<a;)o[s]=r[t+s];s=-1;for(var i=Array(t+1);++s<t;)i[s]=r[s];return i[t]=n(o),function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}(e,this,i)}}(e,t,Ue),e+"")}var Ie=z?function(e,t){return z(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:Ue;function ye(e,t){var n,r,s=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?s["string"==typeof t?"string":"hash"]:s.map}function Ee(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return he(n)?n:void 0}function Ae(e,t){var n=typeof e;return!!(t=null==t?s:t)&&("number"==n||"symbol"!=n&&g.test(e))&&e>-1&&e%1==0&&e<t}function _e(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||b)}function Ce(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Se=function(e){var t=0,n=0;return function(){var r=J(),s=16-(r-n);if(n=r,s>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(Ie);function Te(e,t){return e===t||e!=e&&t!=t}var Ne=pe(function(){return arguments}())?pe:function(e){return xe(e)&&w.call(e,"callee")&&!W.call(e,"callee")},Oe=Array.isArray;function Pe(e){return null!=e&&be(e.length)&&!Re(e)}var De=Y||function(){return!1};function Re(e){if(!ve(e))return!1;var t=de(e);return t==i||t==c||t==o||t==d}function be(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=s}function ve(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function xe(e){return null!=e&&"object"==typeof e}var we=T?function(e){return function(t){return e(t)}}(T):function(e){return xe(e)&&be(e.length)&&!!f[de(e)]};function Me(e){return Pe(e)?se(e,!0):ge(e)}var Le,Fe=(Le=function(e,t,n,r){fe(e,t,n,r)},me((function(e,t){var n=-1,r=t.length,s=r>1?t[r-1]:void 0,a=r>2?t[2]:void 0;for(s=Le.length>3&&"function"==typeof s?(r--,s):void 0,a&&function(e,t,n){if(!ve(n))return!1;var r=typeof t;return!!("number"==r?Pe(n)&&Ae(t,n.length):"string"==r&&t in n)&&Te(n[t],e)}(t[0],t[1],a)&&(s=r<3?void 0:s,r=1),e=Object(e);++n<r;){var o=t[n];o&&Le(e,o,n,s)}return e})));function Ue(e){return e}e.exports=Fe},835:(e,t,n)=>{var r="__lodash_hash_undefined__",s=1/0,a=9007199254740991,o="[object Function]",i="[object GeneratorFunction]",c="[object Symbol]",l=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u=/^\w*$/,d=/^\./,p=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,h=/\\(\\)?/g,g=/^\[object .+?Constructor\]$/,f=/^(?:0|[1-9]\d*)$/,m="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,I="object"==typeof self&&self&&self.Object===Object&&self,y=m||I||Function("return this")();var E,A=Array.prototype,_=Function.prototype,C=Object.prototype,S=y["__core-js_shared__"],T=(E=/[^.]+$/.exec(S&&S.keys&&S.keys.IE_PROTO||""))?"Symbol(src)_1."+E:"",N=_.toString,O=C.hasOwnProperty,P=C.toString,D=RegExp("^"+N.call(O).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),R=y.Symbol,b=A.splice,v=G(y,"Map"),x=G(Object,"create"),w=R?R.prototype:void 0,M=w?w.toString:void 0;function L(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function F(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function U(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function j(e,t,n){var r=e[t];O.call(e,t)&&Y(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function V(e,t){for(var n=e.length;n--;)if(Y(e[n][0],t))return n;return-1}function k(e){if(!J(e)||(t=e,T&&T in t))return!1;var t,n=function(e){var t=J(e)?P.call(e):"";return t==o||t==i}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?D:g;return n.test(function(e){if(null!=e){try{return N.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function $(e,t,n,r){if(!J(e))return e;t=function(e,t){if(K(e))return!1;var n=typeof e;if("number"==n||"symbol"==n||"boolean"==n||null==e||X(e))return!0;return u.test(e)||!l.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:function(e){return K(e)?e:H(e)}(t);for(var s=-1,a=t.length,o=a-1,i=e;null!=i&&++s<a;){var c=q(t[s]),d=n;if(s!=o){var p=i[c];void 0===(d=r?r(p,c,i):void 0)&&(d=J(p)?p:W(t[s+1])?[]:{})}j(i,c,d),i=i[c]}return e}function B(e,t){var n,r,s=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?s["string"==typeof t?"string":"hash"]:s.map}function G(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return k(n)?n:void 0}function W(e,t){return!!(t=null==t?a:t)&&("number"==typeof e||f.test(e))&&e>-1&&e%1==0&&e<t}L.prototype.clear=function(){this.__data__=x?x(null):{}},L.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},L.prototype.get=function(e){var t=this.__data__;if(x){var n=t[e];return n===r?void 0:n}return O.call(t,e)?t[e]:void 0},L.prototype.has=function(e){var t=this.__data__;return x?void 0!==t[e]:O.call(t,e)},L.prototype.set=function(e,t){return this.__data__[e]=x&&void 0===t?r:t,this},F.prototype.clear=function(){this.__data__=[]},F.prototype.delete=function(e){var t=this.__data__,n=V(t,e);return!(n<0)&&(n==t.length-1?t.pop():b.call(t,n,1),!0)},F.prototype.get=function(e){var t=this.__data__,n=V(t,e);return n<0?void 0:t[n][1]},F.prototype.has=function(e){return V(this.__data__,e)>-1},F.prototype.set=function(e,t){var n=this.__data__,r=V(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},U.prototype.clear=function(){this.__data__={hash:new L,map:new(v||F),string:new L}},U.prototype.delete=function(e){return B(this,e).delete(e)},U.prototype.get=function(e){return B(this,e).get(e)},U.prototype.has=function(e){return B(this,e).has(e)},U.prototype.set=function(e,t){return B(this,e).set(e,t),this};var H=z((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(X(e))return M?M.call(e):"";var t=e+"";return"0"==t&&1/e==-s?"-0":t}(t);var n=[];return d.test(e)&&n.push(""),e.replace(p,(function(e,t,r,s){n.push(r?s.replace(h,"$1"):t||e)})),n}));function q(e){if("string"==typeof e||X(e))return e;var t=e+"";return"0"==t&&1/e==-s?"-0":t}function z(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,s=t?t.apply(this,r):r[0],a=n.cache;if(a.has(s))return a.get(s);var o=e.apply(this,r);return n.cache=a.set(s,o),o};return n.cache=new(z.Cache||U),n}function Y(e,t){return e===t||e!=e&&t!=t}z.Cache=U;var K=Array.isArray;function J(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function X(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&P.call(e)==c}e.exports=function(e,t,n){return null==e?e:$(e,t,n)}},928:(e,t,n)=>{var r="__lodash_hash_undefined__",s=1/0,a=9007199254740991,o="[object Arguments]",i="[object Function]",c="[object GeneratorFunction]",l="[object Symbol]",u=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,d=/^\w*$/,p=/^\./,h=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,g=/\\(\\)?/g,f=/^\[object .+?Constructor\]$/,m=/^(?:0|[1-9]\d*)$/,I="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,y="object"==typeof self&&self&&self.Object===Object&&self,E=I||y||Function("return this")();var A,_=Array.prototype,C=Function.prototype,S=Object.prototype,T=E["__core-js_shared__"],N=(A=/[^.]+$/.exec(T&&T.keys&&T.keys.IE_PROTO||""))?"Symbol(src)_1."+A:"",O=C.toString,P=S.hasOwnProperty,D=S.toString,R=RegExp("^"+O.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),b=E.Symbol,v=S.propertyIsEnumerable,x=_.splice,w=W(E,"Map"),M=W(Object,"create"),L=b?b.prototype:void 0,F=L?L.toString:void 0;function U(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function j(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function V(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function k(e,t){for(var n,r,s=e.length;s--;)if((n=e[s][0])===(r=t)||n!=n&&r!=r)return s;return-1}function $(e,t){return null!=e&&P.call(e,t)}function B(e){if(!Q(e)||(t=e,N&&N in t))return!1;var t,n=J(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?R:f;return n.test(function(e){if(null!=e){try{return O.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function G(e,t){var n,r,s=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?s["string"==typeof t?"string":"hash"]:s.map}function W(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return B(n)?n:void 0}function H(e,t,n){var r;t=function(e,t){if(K(e))return!1;var n=typeof e;if("number"==n||"symbol"==n||"boolean"==n||null==e||ee(e))return!0;return d.test(e)||!u.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:K(r=t)?r:q(r);for(var s,i=-1,c=t.length;++i<c;){var l=z(t[i]);if(!(s=null!=e&&n(e,l)))break;e=e[l]}return s||!!(c=e?e.length:0)&&X(c)&&function(e,t){return t=null==t?a:t,!!t&&("number"==typeof e||m.test(e))&&e>-1&&e%1==0&&e<t}(l,c)&&(K(e)||function(e){return function(e){return Z(e)&&function(e){return null!=e&&X(e.length)&&!J(e)}(e)}(e)&&P.call(e,"callee")&&(!v.call(e,"callee")||D.call(e)==o)}(e))}U.prototype.clear=function(){this.__data__=M?M(null):{}},U.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},U.prototype.get=function(e){var t=this.__data__;if(M){var n=t[e];return n===r?void 0:n}return P.call(t,e)?t[e]:void 0},U.prototype.has=function(e){var t=this.__data__;return M?void 0!==t[e]:P.call(t,e)},U.prototype.set=function(e,t){return this.__data__[e]=M&&void 0===t?r:t,this},j.prototype.clear=function(){this.__data__=[]},j.prototype.delete=function(e){var t=this.__data__,n=k(t,e);return!(n<0)&&(n==t.length-1?t.pop():x.call(t,n,1),!0)},j.prototype.get=function(e){var t=this.__data__,n=k(t,e);return n<0?void 0:t[n][1]},j.prototype.has=function(e){return k(this.__data__,e)>-1},j.prototype.set=function(e,t){var n=this.__data__,r=k(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},V.prototype.clear=function(){this.__data__={hash:new U,map:new(w||j),string:new U}},V.prototype.delete=function(e){return G(this,e).delete(e)},V.prototype.get=function(e){return G(this,e).get(e)},V.prototype.has=function(e){return G(this,e).has(e)},V.prototype.set=function(e,t){return G(this,e).set(e,t),this};var q=Y((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(ee(e))return F?F.call(e):"";var t=e+"";return"0"==t&&1/e==-s?"-0":t}(t);var n=[];return p.test(e)&&n.push(""),e.replace(h,(function(e,t,r,s){n.push(r?s.replace(g,"$1"):t||e)})),n}));function z(e){if("string"==typeof e||ee(e))return e;var t=e+"";return"0"==t&&1/e==-s?"-0":t}function Y(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,s=t?t.apply(this,r):r[0],a=n.cache;if(a.has(s))return a.get(s);var o=e.apply(this,r);return n.cache=a.set(s,o),o};return n.cache=new(Y.Cache||V),n}Y.Cache=V;var K=Array.isArray;function J(e){var t=Q(e)?D.call(e):"";return t==i||t==c}function X(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=a}function Q(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Z(e){return!!e&&"object"==typeof e}function ee(e){return"symbol"==typeof e||Z(e)&&D.call(e)==l}e.exports=function(e,t){return null!=e&&H(e,t,$)}},953:e=>{class t{constructor(e,t,n,r,s){this.converter=c(),this.width=e,this.poly=t,this.xor_in=n,this.reflected_xor_in=l(n,e),this.xor_out=r,this.reflect=s,this.msb_mask=1<<this.width-1,this.mask=this.msb_mask-1<<1|1,this.crc_shift=this.width<8?8-this.width:0,this.shifted_xor_in=this.xor_in<<this.crc_shift;let a=this.gen_table();this.table=a,8!==this.width||this.xor_in||this.xor_out||this.reflect||(this.calculate=function(e){e=this.converter.validate_buffer(e);let t=0;for(let n=0;n<e.length;n++)t=a[t^e[n]];return t})}calculate(e){let t;e=this.converter.validate_buffer(e);let{table:n,width:r,crc_shift:s,mask:a}=this;if(this.reflect){t=this.reflected_xor_in;for(let r=0;r<e.length;r++){t=(n[255&(t^e[r])]^t>>>8)&a}}else{t=this.shifted_xor_in;for(let o=0;o<e.length;o++)t=n[255&(t>>r-8+s^e[o])]<<s^t<<8-s&a<<s;t>>=s}return t^=this.xor_out,t>>>0}calculate_no_table(e){e=this.converter.validate_buffer(e);let t=this.xor_in;for(let n=0;n<e.length;n++){let r=e[n];this.reflect&&(r=l(r,8));for(let e=0;e<8;e++){let n=t&this.msb_mask;r&128>>e&&(n^=this.msb_mask),t<<=1,n&&(t^=this.poly)}t&=this.mask}return this.reflect&&(t=l(t,this.width)),t^=this.xor_out,t>>>0}gen_table(){let e=[];for(let t=0;t<256;t++){let n=t;this.reflect&&(n=l(n,8)),n<<=this.width-8+this.crc_shift;for(let e=0;e<8;e++)0!=(n&this.msb_mask<<this.crc_shift)?(n<<=1,n^=this.poly<<this.crc_shift):n<<=1;this.reflect&&(n=l(n>>this.crc_shift,this.width)<<this.crc_shift),n=n>>this.crc_shift&this.mask,e[t]=n>>>0}return new Int32Array(e)}print_table(){let e=this.table,t=Math.ceil(this.width/4),n=t<4?4:3,r=e.length>>n,s=1<<n,a="";for(let o=0;o<r;o++){let r="";for(let a=0;a<s;a++){let s=e[o<<n|a];s="000000000"+s.toString(16),s=s.substr(s.length-t),r+="0x"+s+", "}a+=" "+r+"\n"}return a="[\n"+a.slice(0,-3)+"\n]",a}}const n="undefined"!=typeof Buffer,r="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,s=void 0!==typeof BigInt&&BigInt(256);class a{validate_buffer(e){switch(typeof e){case"number":{if(!Number.isSafeInteger(e)||e<0)throw Error(`number data must be a nonnegative safe integer, not ${e}`);if(this.fromUInt32&&e<=4294967295)return this.fromUInt32(e);const t=[];for(;e>0||t.length<4;)t.unshift(e%256),e=Math.floor(e/256);return this.fromByteArray(t)}case"string":return this.fromString(e);case"bigint":{if(e<0)throw Error(`bigint data must be nonnegative, not ${e}`);const t=[];for(;e>0||t.length<4;)t.unshift(Number(e%s)),e/=s;return this.fromByteArray(t)}default:if(n&&Buffer.isBuffer(e))return e;if(r){if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(e instanceof ArrayBuffer)return new Uint8Array(e)}throw new Error(`Unrecognized data type ${typeof e}: ${e}`)}}}class o extends a{fromUInt32(e){const t=Buffer.alloc(4);return t.writeUInt32BE(e),t}fromByteArray=Buffer.from.bind(Buffer);fromString=Buffer.from.bind(Buffer)}class i extends a{fromByteArray=Uint8Array.from.bind(Uint8Array);fromString(e){return new TextEncoder("utf-8").encode(e)}}function c(e=!1){if(r&&(e||!n))return new i;if(n)return new o;throw Error("either need TypedArrays or Buffer")}function l(e,t){let n=0;for(let r=0;r<t;r++)n=n<<1|1&e,e>>=1;return n}const u={crc1:new t(1,1,0,0,!1),crc6:new t(6,47,0,0,!1),crc8:new t(8,7,0,0,!1),crc10:new t(10,563,0,0,!1),crc16:new t(16,32773,0,0,!0),crc24:new t(24,8801531,11994318,0,!1),crc32:new t(32,79764919,4294967295,4294967295,!0),crc32c:new t(32,517762881,4294967295,4294967295,!0)};function d(e){}e.exports={CRC:t,crc:function(e,n,r,s,a){let o=new t(e,n,r,s,a);return o.calculate.bind(o)},makeBufferConverter:c,models:u,crc1:d,crc6:d,crc8:d,crc10:d,crc16:d,crc24:d,crc32:d,crc32c:d};for(let t in u){let n=u[t];e.exports[t]=n.calculate.bind(n)}}},r={};function s(e){var t=r[e];if(void 0!==t)return t.exports;var a=r[e]={id:e,loaded:!1,exports:{}};return n[e](a,a.exports,s),a.loaded=!0,a.exports}s.m=n,s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce(((t,n)=>(s.f[n](e,t),t)),[])),s.u=e=>"js/libphonenumber-web.js",s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="constellation-corejs-library:",s.l=(n,r,a,o)=>{if(e[n])e[n].push(r);else{var i,c;if(void 0!==a)for(var l=document.getElementsByTagName("script"),u=0;u<l.length;u++){var d=l[u];if(d.getAttribute("src")==n||d.getAttribute("data-webpack")==t+a){i=d;break}}i||(c=!0,(i=document.createElement("script")).charset="utf-8",s.nc&&i.setAttribute("nonce",s.nc),i.setAttribute("data-webpack",t+a),i.src=n),e[n]=[r];var p=(t,r)=>{i.onerror=i.onload=null,clearTimeout(h);var s=e[n];if(delete e[n],i.parentNode&&i.parentNode.removeChild(i),s&&s.forEach((e=>e(r))),t)return t(r)},h=setTimeout(p.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=p.bind(null,i.onerror),i.onload=p.bind(null,i.onload),c&&document.head.appendChild(i)}},s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;s.g.importScripts&&(e=s.g.location+"");var t=s.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.p=e})(),(()=>{var e={388:0};s.f.j=(t,n)=>{var r=s.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var a=new Promise(((n,s)=>r=e[t]=[n,s]));n.push(r[2]=a);var o=s.p+s.u(t),i=new Error;s.l(o,(n=>{if(s.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var a=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;i.message="Loading chunk "+t+" failed.\n("+a+": "+o+")",i.name="ChunkLoadError",i.type=a,i.request=o,r[1](i)}}),"chunk-"+t,t)}};var t=(t,n)=>{var r,a,[o,i,c]=n,l=0;if(o.some((t=>0!==e[t]))){for(r in i)s.o(i,r)&&(s.m[r]=i[r]);if(c)c(s)}for(t&&t(n);l<o.length;l++)a=o[l],s.o(e,a)&&e[a]&&e[a][0](),e[a]=0},n=self.webpackChunkconstellation_corejs_library=self.webpackChunkconstellation_corejs_library||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),(()=>{"use strict";var e={};s.r(e),s.d(e,{buildContextName:()=>H,buildModalContext:()=>K,buildTransientContextName:()=>q,getContainerIdFromContext:()=>X,getParentContext:()=>J,getParentContextName:()=>W,getTargetFromContext:()=>Y,getTransientContext:()=>z});var t={};s.r(t),s.d(t,{getResolvedTargetName:()=>Pt,getRoutingInfo:()=>Dt,getSemanticURLFromRoutingInfo:()=>Rt});var n={};s.r(n),s.d(n,{evaluate:()=>an,handleChange:()=>rn,hasDeclareExpression:()=>nn,updateDeclareExpressions:()=>sn});var r={};s.r(r),s.d(r,{hasBrowserEnv:()=>Ar,hasStandardBrowserEnv:()=>Cr,hasStandardBrowserWebWorkerEnv:()=>Sr,navigator:()=>_r,origin:()=>Tr});var a={};s.r(a),s.d(a,{publishExpressions:()=>Ui,publishResponse:()=>ji});var o={};s.r(o),s.d(o,{doesRestApiExist:()=>Wi,getCancelTokenSource:()=>Hi,getCaseApi:()=>Yi,getHeaderProcessor:()=>$i,invokeCustomRestApi:()=>Gi,invokeRestApi:()=>Bi,isRequestCanceled:()=>qi,registerInterceptor:()=>zi});var i={};s.r(i),s.d(i,{fetchViewResources:()=>_d,updateViewResources:()=>Ad});var c={};s.r(c),s.d(c,{CONTAINER_NAMES:()=>gp,CONTAINER_TYPES:()=>hp,addRootContainerItem:()=>Yp,areContainerItemsPresent:()=>_p,clearTransientData:()=>eh,closeContainerItem:()=>zp,getActiveContainerItemContext:()=>xp,getActiveContainerItemIDFromRoutingInfo:()=>ph,getActiveContainerItemName:()=>Dp,getActiveContext:()=>ch,getChildContainerItems:()=>wp,getChildContainers:()=>Mp,getChildContainersContexts:()=>Lp,getContainerAPI:()=>rh,getContainerAccessOrder:()=>Ap,getContainerData:()=>Ip,getContainerItemByKey:()=>Np,getContainerItemData:()=>yp,getContainerItemName:()=>Sp,getContainerItems:()=>Ep,getContainerLimit:()=>kp,getContainerParentContext:()=>dh,getContainerType:()=>Pp,getContextByTargetAndKey:()=>uh,getDataContextName:()=>vp,getFlowContainer:()=>gh,getLeastRecentlyUsedNonDirtyContainerItemID:()=>Hp,getParentContainerItem:()=>hh,getRootContainerName:()=>ih,getSuggestionContexts:()=>Fp,getTargetFromContainerItemID:()=>qp,getTransientItems:()=>Xp,hasContainerItems:()=>Vp,isContainerDirty:()=>Wp,isContainerInitialized:()=>Op,isContainerItemActive:()=>Rp,isContainerItemContextBeingUsedInOtherContainers:()=>Jp,isContainerItemExists:()=>Cp,isContainerLimitReached:()=>Bp,isContainerMultipleMode:()=>jp,isContainerSingleMode:()=>Up,purgeTransientData:()=>th,removeContainer:()=>sh,replaceTransientData:()=>Zp,resetContainersPayload:()=>Gp,setContainerLimit:()=>$p,updateCaseContextEtag:()=>oh,updateParentLastUpdateTime:()=>lh,updateRelatedContextEtag:()=>ah,updateTransientData:()=>Qp});var l={};s.r(l),s.d(l,{getAIAgent:()=>lg,getAdditionalInfo:()=>gg,getDataPageKeys:()=>dg,getDataPageMetadata:()=>ng,getEmbeddedPropertyMetadata:()=>Kh,getFieldParameters:()=>og,getFieldsByClassName:()=>ag,getGenAICoach:()=>cg,getInsight:()=>sg,getLocaleUtilsForLanguage:()=>zh,getLocalizationServiceFromStore:()=>Yh,getLookUpDataPage:()=>pg,getLookUpDataPageInfo:()=>hg,getParagraph:()=>ig,getPersonalizationMetadata:()=>rg,getPropertyMetadata:()=>qh,getResolvedFieldMetadata:()=>fg,getSavableDataPage:()=>ug,isViewExists:()=>eg,mergeStore:()=>Hh,resolveNavigation:()=>tg,resolveView:()=>Zh,updateNavigationStore:()=>Xh,updateStores:()=>Qh,updateViewStore:()=>Jh});var u={};s.r(u),s.d(u,{dispatch:()=>Cg,doesContextExist:()=>Fg,getActionType:()=>Rg,getContextValue:()=>Pg,getDataObject:()=>Sg,getReferenceTokens:()=>Eg,getSharedDataObject:()=>Tg,getStore:()=>_g,getValue:()=>Og,isMergeable:()=>vg,lookupContextValue:()=>Dg,mergeDeep:()=>xg,removeItem:()=>bg,replaceValue:()=>Mg,resetStore:()=>Lg,setStore:()=>Ag,updateValue:()=>wg});var d={};s.r(d),s.d(d,{activateContainerItem:()=>hf,addContainerItem:()=>nf,addMessages:()=>gf,addSharedData:()=>Tf,addTransientItem:()=>rf,addWork:()=>Qg,clearTransientData:()=>af,createWork:()=>qg,error:()=>Sf,finishAssignment:()=>Ef,initContainers:()=>ef,listAction:()=>Of,loadView:()=>Jg,mergeData:()=>Yg,openAssignment:()=>Af,openWorkByHandle:()=>Zg,postProcess:()=>Cf,purgeTransientData:()=>cf,removeAllTransientItems:()=>mf,removeContainerItem:()=>ff,removeSharedData:()=>Nf,removeTransientItem:()=>If,replaceContainerItem:()=>yf,replaceTransientData:()=>of,resetContainers:()=>tf,resetLoading:()=>df,setLoading:()=>uf,setSharedProperty:()=>Df,setStateProperty:()=>Rf,showCasePreview:()=>Pf,showHarness:()=>Kg,showHistory:()=>_f,showPage:()=>Xg,upMergeAndRemoveContainerItem:()=>pf,updateContainerItem:()=>lf,updateTransientData:()=>sf});var p=s(216),h=s.n(p);let g,f,m;const I=e=>{e&&(g=e=e||{"base-server":"http://localhost:1080/prweb/","data-end-point":"api/v1/stream/data","action-end-point":"api/v1/stream/action"},g.BASEURL=e.server,g.ACTIONURL=e["action-end-point"],g.DATAURL=e["data-end-point"],m=e.reAuthUrl)},y=()=>m,E=()=>g.BASEURL,A=e=>fetch(`${g.BASEURL}${g.ACTIONURL}`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),_=e=>{f=e},C=()=>f;var S=s(953),T=s(521),N=s.n(T),O=s(928),P=s.n(O),D=s(188),R=s.n(D),b=s(835),v=s.n(b),x=s(692),w=s.n(x),M=s(529),L=s.n(M);const F=new class{constructor(){this.needsMapping=!1}getNeedsMapping(){return this.needsMapping}setNeedsMapping(e){this.needsMapping=e}map(e){return this.needsMapping?this.replacer(e):e}transformObjectToCase(e){let t,n=!1;try{const n=this.replaceToCase(JSON.stringify(e));t=JSON.parse(n)}catch(e){console.error("not a Valid JSON",e),n=!0}return n?e:t}transformCaseData(e){const t=e?.data?.caseInfo,n=e?.uiResources;return{data:{objectInfo:{content:{...t?.content}}},uiResources:{...n}}}analyseResponse(e){e?.data?.objectInfo&&window?.PCore?.getEnvironmentInfo()?.isUnifiedObject()?this.setNeedsMapping(!0):this.setNeedsMapping(!1)}replacer(e){return this.needsMapping&&(e=e.replace("caseInfo","objectInfo").replace("caseTypeName","objectTypeName").replace("caseTypeID","objectTypeID")),e}replaceToCase(e){return e.replace("objectInfo","caseInfo").replace("objectTypeName","caseTypeName").replace("objectTypeID","caseTypeID")}},U={APP:{APP:"app",ROOT:"root",INFINITY_RUNTIME:"Infinity",PXREQUESTOR:"pxRequestor",PXUSERNAME:".pxUserName",OPERATORID:"OperatorID",USERNAME:"pxRequestor.pxUserName",PXUSERIDENTIFIER:".pxUserIdentifier",USERIDENTIFIER:"pxRequestor.pxUserIdentifier",PYIMAGEINSKEY:".pyImageInsKey",OPERATORID_IMG_INSKEY:"OperatorID.pyImageInsKey",OPERATORID_LOCALE:"OperatorID.pyUseLocale",APPLICATION_LABEL:"Application.pyLabel",APPLICATION_RULE_NAME:"Application.pyRuleName"},RESOURCE_TYPES:{ASSIGNMENT:"ASSIGNMENT",CASE:"CASE",DATA:"DATA",PAGE:"PAGE",OBJECT:"OBJECT"},RESOURCE_STATUS:{CREATE:"CREATE",UPDATE:"UPDATE",OPEN_FLOW_ACTION:"OPEN_FLOW_ACTION"},VIEW_NAMES:{PY_CASE_TAB:"pyCaseTab",DATA_OBJECT_CREATE_VIEW:"Create",DATA_OBJECT_EDIT_VIEW:"pyEdit",PY_DATA_PREVIEW:"pyDataPreview",PY_DETAILS:"pyDetails",OBJECT_CREATE_VIEW:"Create",SUBSCRIPT_CREATE_VIEW:"SubscriptView"},CONTAINERS:{ROOT_CONTAINER:"RootContainer",VIEW_CONTAINER:"ViewContainer",FLOW_CONTAINER:"FlowContainer",MODAL_VIEW_CONTAINER:"ModalViewContainer",PREVIEW_VIEW_CONTAINER:"PreviewViewContainer",HYBRID_VIEW_CONTAINER:"HybridViewContainer"},WORK_BASKET:{MY_WORK_LIST:"myWorkList",REPORTEE:"reportee",WORK_QUEUE:"workQueue",DATA_PAGES:{D__PY_GET_USER_WORK_LIST_BY_USER_ID:"D_pyGetUserWorkListByUserId",D__WORK_BASKET:"D_WorkBasket",D__PY_MY_WORK_LIST:"D_pyMyWorkList"}},CONTEXT_TREE_NODE_TYPES:{VIEW:"VIEW",FIELD:"FIELD",DECLARATIVE_TARGET:"DECLARATIVE_TARGET",WHEN:"WHEN",CONTEXT:"CONTEXT",PAGELIST:"PAGELIST"},WORKLIST:"worklist",WAIT:"wait",TODO:"todo",STANDARD_FLOW:"Standard",CASE:"CASE",ASSIGNMENT:"ASSIGNMENT",FIX_BROKEN_ASSIGNMENTS:"FixBrokenAssignments",PAGE:"PAGE",PZINSKEY:".pzInsKey",CREATE_DETAILS_VIEW_NAME:"pzCreateDetails",PREVIEW_VIEW_NAME:"pyCasePreview",CASESUMMARY_VIEW_NAME:"pyCaseSummary",APPSHELL_ACTIVE_CASES:"appshell-activecases",TRACE_ID:"x-b3-traceid",LOAD_VIEW_STRING:"View",PRIMARY:"primary",DEFER_UPDATE_CASESUMMARY_VIEW:"deferUpdateCaseSummaryView",NEXT_ASSIGNMENT_INFO_ID:"nextAssignmentInfo.ID",WORKCLASS:"Work-",DATA_INFO:{DATA_INFO:"dataInfo",DATA_INFO_CONTENT:"dataInfo.content"},OBJECT_INFO:{OBJECT_INFO:"objectInfo",OBJECT_INFO_ID:"objectInfo.ID",OBJECT_INFO_CONTENT:"objectInfo.content",ACTIVE_ACTION_ID:"objectInfo.activeActionID",OBJECT_INFO_CONTENT_CLASS_ID:"objectInfo.content.classID"},CASE_INFO:{CASE_INFO:"caseInfo",CASE_INFO_CONTENT:"caseInfo.content",CASE_INFO_NAME:"caseInfo.name",CASE_INFO_ID:"caseInfo.ID",CASE_INFO_CLASSID:"caseInfo.content.classID",CASE_INFO_CLASSNAME:"caseInfo.className",CASE_TYPE_ID:"caseInfo.caseTypeID",CASE_TYPE_NAME:"caseInfo.caseTypeName",CASE_INFO_PZINSKEY:"caseInfo.content.pzInsKey",CASE_INFO_ACTIONS:"caseInfo.availableActions",VIEW_NAME:"caseInfo.content.pyViewName",ACTION_BUTTONS:"caseInfo.actionButtons",ACTIVE_ACTION_ID:"caseInfo.activeActionID",ASSIGNMENT_LABEL:"caseInfo.assignments[0].name",ASSIGNMENT_ID:"caseInfo.assignments[0].ID",ASSIGNMENTS:"caseInfo.assignments",INSTRUCTIONS:"caseInfo.assignments[0].instructions",NAVIGATION:"caseInfo.navigation",STAGES:"caseInfo.stages",STAGEID:"caseInfo.stageID",CASECLASS:"caseInfo.caseClass",AVAILABLEACTIONS:"caseInfo.availableActions",AVAILABLEPROCESSES:"caseInfo.availableProcesses",D_CASE_ASSIGNMENTS_RESULTS:"caseInfo.assignments",CHILD_ASSIGNMENTS:"caseInfo.childCases",ASSIGNMENTACTION_ID:"caseInfo.assignments[0].actions[0].ID",ISINCREATESTAGE:"caseInfo.isInCreateStage",APPROVALFLAG:"caseInfo.content.pyApprovalResult",DUPLICATECASEFLAG:"caseInfo.content.pyDuplicateCaseActions",DUPLICATECASEID:"caseInfo.content.pyDuplicateID",DUPLICATECASEINSKEY:"caseInfo.content.pyDuplicateCaseReference.pzInsKey",HEADERS:"caseInfo.headers",PARENTCASEINFO:"caseInfo.parentCaseInfo",REMOTESYSTEMID:"caseInfo.headers.RemoteSystemID",CASE_RELATED_CASE_TYPES:"caseInfo.relatedCaseTypes",CASES:"caseInfo.cases",GETNEXTWORK:"caseInfo.confirmationLinks.getNextWork",ACTION_REFRESH_CONDITIONS:"caseInfo.assignments[0].actions[0].refreshConditions",IS_LOCAL_ACTION:"caseInfo.isLocalAction",BUSINESS_ID:"caseInfo.businessID",IS_FIRST_ASSIGNMENT:"caseInfo.isFirstAssignment",CASE_INFO_ATTACHMENTS:"caseInfo.attachments"},ACTIONS:{ACTION_ID:"actionID",ACTIONS:"availableActions",DELETEAVIALACTIONS:"deleteAvailActions",FLOWACTION:"FlowAction",DATA_PAGES:{D_PY_ADDITIONAL_CASE_ACTIONS:"D_pyAdditionalCaseActions"}},PROCESS:{FLOWPROBLEMS:"FlowProblems"},PAGE_TYPES:{PAGE:"page",LANDINGPAGE:"landingpage",LISTPAGE:"listpage"},LOCAL_ACTION_TYPE:{CASE_WIDE:"case",EXPRESS:"express",ASSIGNMENT:"Assignment",LOCAL_ACTION:"LocalAction"},LOCAL_ACTIONS:{TRANSFER_ASSIGNMENT:"pyTransferAssignment"},CONTENT:"content",MODAL:"modal",STOPMERGEACTIONS:"stopMergeActions",IS_CREATE_DATA_OBJECT:"isCreateDataObject",SUMMARY_OF_ASSIGNMENT_LAST_SUBMIT_TIME:"context_data.caseInfo.content.summary_of_assignment__.lastSubmitTime",SUMMARY_OF_ATTACHMENTS_LAST_REFRESH_TIME:"context_data.caseInfo.content.summary_of_attachments__.lastRefreshTime",CONTEXT_DATA_ASSIGNMENTID:"context_data.assignmentID",BANNER_VARIANT_SUCCESS:"success",BANNER_VARIANT_WARNING:"warning",BANNER_VARIANT_URGENT:"urgent",BANNER_VARIANT_INFO:"info",MESSAGES:{MESSAGES_TYPE_SUCCESS:"success",MESSAGES_TYPE_INFO:"info",MESSAGES_TYPE_ERROR:"error"},PUB_SUB_EVENTS:{EVENT_RENDER_APP:"renderApp",EVENT_UNMOUNT_APP:"unmountApp",EVENT_REAUTH:"reAuth",EVENT_FULL_REAUTH:"fullReAuth",EVENT_CUSTOM_REAUTH:"customReAuth",EVENT_CANCEL:"cancel",EVENT_MINIMIZE:"minimize",EVENT_EXPRESS_LOCALACTION:"expressLocalActionSubmit",EVENT_BULKACTION:"bulkActionSubmit",EVENT_SHOW_CANCEL_ALERT:"showCancelAlert",EVENT_SHOW_DELETE_ALERT:"showDeleteAlert",EVENT_DASHBOARD_FILTER_CHANGE:"dashboardFilterChange",EVENT_DASHBOARD_FILTER_CLEAR_ALL:"dashboardFilterClearAll",EVENT_PROMOTED_FILTERS_CHANGE:"promotedFiltersChange",EVENT_LOCALACTION_SUBMISSION:"localActionSubmit",EVENT_LOGOFF:"Logoff",EVENT_TRANSIENT_ITEMS:{UPDATE_PROMOTED_FILTERS:"updatePromotedFilters"},UI_EVENTS:{INSPECTOR:"inspector",INSPECTOR_SHOW_ALL:"inspectorShowAll",SHOW_PAGE_INIT:"showPageInit",SHOW_PAGE_DONE:"showPageDone",SHOW_PAGE_STARTED:"showPageStarted"},CASE_EVENTS:{CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW:"caseAttachmentsUpdateFromCaseview",CASE_FOLLOWER_UPDATED_BY_OPERATOR_FROM_CASEVIEW:"caseFollowerUpdateByOperatorFromCaseview",CASE_FOLLOWER_UPDATE_BY_OPERATOR_FROM_WIDGET:"caseFollowerUpdateByOperatorFromWidget",CASE_CREATED:"caseCreated",CREATE_STAGE_DONE:"caseCreatedDone",CREATE_STAGE_CANCELLED:"caseCancelled",CREATE_STAGE_SAVED:"caseSaved",CREATE_STAGE_DELETED:"caseDeleted",ASSIGNMENT_SUBMISSION:"assignmentSubmission",END_OF_ASSIGNMENT_PROCESSING:"endOfAssignmentProcessing",CLOSE_CONFIRM_VIEW:"closeConfirmView",CASE_OPENED:"caseOpened",CASE_CLOSED:"caseClosed",ASSIGNMENT_OPENED:"assignmentOpened",CASE_PREVIEW:"casePreview",CURRENT_ASSIGNMENT_UPDATED:"currentAssignmentUpdated",CASE_LOCK_EVENT:"caseLockEvent",GET_NEXT_WORK:"getNextWork",SAVE_ASSIGNMENT_COMPLETE:"saveAssignmentComplete"},WORK_EVENTS:{WORK_DELETED:"workDeleted"},BOOTSTRAP_SHELL_EVENTS:{CONSTELLATION_LOADED:"CONSTELLATION_LOADED"},CONTAINER_EVENTS:{CLOSE_CONTAINER_ITEM:"CLOSE_CONTAINER_ITEM",CLOSE_MULTI_TYPE_PRIMARY_CONTAINER_ITEM:"CLOSE_MULTI_TYPE_PRIMARY_CONTAINER_ITEM"},DISPLAY_CASE_CREATED_TOASTER:"displayCaseCreatedToaster",DATA_EVENTS:{DATA_OBJECT_CREATED:"dataObjectCreated",DATA_OBJECT_DELETED:"dataObjectDeleted",DATA_OBJECT_UPDATED:"dataObjectUpdated"},FETCH_SUCCESS:"fetchSuccess",FETCH_FAILURE:"fetchFailure",REVERSE_COEXISTENCE_EVENTS:{HANDLE_DISCARD:"handleDiscard",CHECK_IS_FORM_DIRTY:"checkIsFormDirty"},TIMEOUT_REMINDER:"sessionAboutToTimeout",RESET_TIMER:"resetInactivityTimer",PEGA_EMBED_CUSTOM:"pegaEmbedCustom",SUGGESTION_PROCESSED:"suggestion_processed",ERROR_ON_FINISH_ASSIGNMENT:"errorOnFinishAssignment",URL_NAVIGATION:"urlNavigation"},ERROR_TYPE:{CLIENT:"client",SERVER:"server"},CONTAINER_TYPE:{MULTIPLE:"multiple",SINGLE:"single",HYBRID:"HybridViewContainer"},REMOTE_SYSTEM_ID:"RemoteSystemID",LIST_SELECTION_MODE:{MULTI:"multi",SINGLE:"single",MULTI_ON_HOVER:"multi_on_hover"},SUBMISSION_FAILURE_TYPE:{FORM_VALIDATION_ERROR:"formValidationError"},USER_SETTINGS:{UTILITY_PANEL_USER_STATE_PATH:"presentation.templates.CaseView.utilityPanelExpanded",SUMMARY_PANEL_USER_STATE_PATH:"presentation.templates.CaseView.summaryPanelExpanded",ASSIGNMENT_COLLAPSED_STATE_PATH:"presentation.templates.CaseView.assignmentWidgetCollapsed",CASE_VIEW_PATH:"presentation.templates.CaseView"},PROMISE_VALUE:{RESOLVE:"resolve",REJECT:"reject"},APP_TYPE:{UIKIT:"uikit",THEME_COSMOS:"themecosmos"},PORTAL_TYPE:{WSS:"wss"},VIEW_TYPE:{PY_EMBEDASSIGNMENT:"pyEmbedAssignment",PY_DETAILS:"pyDetails"},ACTION:"action",CONTEXT_DATA_MODAL_VIEW:{CONTEXT_DATA_MODAL_VIEW:"context_data.modalView",IS_MULTI_RECORD_DATA:"context_data.modalView.isMultiRecordData",VIEW_NAME:"context_data.modalView.viewName",PARENT_CONTEXT:"context_data.modalView.parentContext",INTERESTPAGE:"context_data.modalView.interestPage",EDIT_TYPE:"context_data.modalView.editType",ACTION_ID:"context_data.modalView.actionID"}},j={CONTEXT:"context",AJAXCONTAINER:"primary",VIEW_CONTAINER:"ViewContainer",APP_SHELL:"AppShell",ROOT_CONTAINER:"RootContainer",HYBRID:"hybrid",HYBRID_VIEW_CONTAINER:"HybridViewContainer",HYRBID_ROOT_CONTAINERNAME:"hybridRootContainerName",MODAL_VIEW_CONTAINER:"ModalViewContainer",FLOW_CONTAINER:"FlowContainer",PREVIEW_VIEW_CONTAINER:"PreviewViewContainer",OBJECT_PAGE:"ObjectPage",CASE_CREATE_STAGE:"CaseCreateStage",CASE_VIEW:"CaseView",SELF_SERVICE_CASE_VIEW:"SelfServiceCaseView",VIEW:"view",CASE_PREVIEW:"CasePreview",CASE_STAGES:"Stages",CASEMESSAGES:"caseMessages",SUGGESTION:"suggestion",PREVIEW:"preview",TERTIARY:"tertiary",DEFAULT:"default",ACPRIMARY:"primary",ACTERTIARY:"tertiary",PERFORM_MODE:"perform",CASE_VIEW_MODE_PROP:".caseViewMode",REVIEW_MODE:"review",WORKAREA:"workarea",ACPRIMARY_NAME:"ACPRIMARY",ACTERTIARY_NAME:"ACTERTIARY",THREADNAMESEPARATOR:"/",JOINCHARACTER:"_",FORWARD_SLASH_STRING:"/",UNDERSCORE_STRING:"_",WORK_ID:"WORK_ID",EMPTY_STRING:"",PROPERTY_MESSAGES:"propertyMessages__",CONTEXT_MESSAGES:"contextMessages__",HTTP_MESSAGES:"httpMessages__",PAGE_MESSAGES:"pageMessages__",SUMMARY_OF_LISTS:"summary_of_lists__",SUMMARY_OF_GROUPS:"summary_of_groups__",SUMMARY_OF_MESSAGES:"summary_of_messages__",SUMMARY_OF_FIELD_VALUES:"summary_of_field_values__",SUMMARY_OF_WHEN_CONDITIONS:"summary_of_when_conditions__",SUMMARY_OF_DYNAMIC_WHENS:"summary_of_dynamic_whens__",SUMMARY_OF_EXPRESSIONS:"summary_of_expressions__",SUMMARY_OF_ASSOCIATED_LISTS:"summary_of_associated_lists__",CONTEXT_DATA:"context_data",TABLE:e=>`Table[${e}]`,HTTP:"HTTP",PROPERTY:"PROPERTY",PAGE_ERRORS:"page_level_errors",CUSTOM_ERROR:"custom error",NO_MESSAGES:"No messages existing",PULSE_REFERENCE:"pulse.messages",IS_LOADING:"isLoading",APPROVED:"Approved",REJECTED:"Rejected",DUPLICATE:"Duplicate",IGNORE:"Ignore",PARAGRAPH:"PARAGRAPH",X_ORIGIN_CHANNEL:"x-origin-channel",AUTHORING_PREVIEW_CONTAINER:"root/authoring-preview",EMBED:"EMBED",ERROR_FIELD_IN_PAGE:"erroneousInputOutputFieldInPage",ERROR_IN_PAGE_IDENTIFIER:"erroneousInputOutputIdentifier",ON_REFRESH_START:"onRefreshStart",ON_REFRESH_ERROR:"onRefreshError",ON_REFRESH_COMPLETE:"onRefreshComplete",UI_RESOURCES:"uiResources",UI_RESOURCES_CONTEXT_DATA:"uiResources.context_data",ACTION_BUTTONS:"uiResources.actionButtons",RESOURCES:"uiResources.resources",ROOT:"uiResources.root",CASE_INFO_IS_LOCAL_ACTION:"caseInfo.isLocalAction",OBJECT_INFO_IS_LOCAL_ACTION:"objectInfo.isObjectWideAction",DATA:"data",OPTIONS:"options",VIEWS:"uiResources.resources.views",NAVIGATIONS:"uiResources.resources.navigations",COMPONENTS:"uiResources.components",UI_RESOURCES_ROOT_CONTEXT:"uiResources.root.config.context",LOCALE_REFERENCES:"uiResources.localeReferences",STATIC_SERVER_URL:"staticServer",APPLICATION_DATA:"data.Application",REFERENCED_USERS:"referencedUsers",CASE_INFO_REFRESH_CONDITIONS:"caseInfo.refreshConditions",FIELD_LEVEL_SUCCESS:"success",FIELD_LEVEL_WARNING:"warning",FIELD_LEVEL_ERROR:"error",HASH_DELIMITER:"~^|^~",NULL_STRING:"null",DATA_PAGE:"DataPage",DECISION:"Decision",RULE_REFERENCE:"RuleReference",GET_PAGE_DATA:"getPageData",PROPERTY_ANNOTATION:"@P",FIELD_LABEL_ANNOTATION:"@FL",ATTACHMENT_ANNOTATION:"@ATTACHMENT",PARAGRAPH_ANNOTATION:"@PARAGRAPH",ASSOCIATED_PROPERTY_ANNOTATION:"@ASSOCIATED",CLASS_ANNOTATION:"@CLASS",ASSOCIATED:"associated",CLASS_ID:".classID",CLASSID:"classID",READONLY:"readonly",SHARED:"shared",RELOAD_IF_OLDER_THAN:"reloadIfOlderThan",RELOAD_ONCE_PER_INTERACTION:"reloadOncePerInteraction",PY_DETAILS:"pyDetails",PY_CONFIRM:"pyConfirm",LIST_ACTIONS:{ADD:"ADD",INSERT:"INSERT",UPDATE:"UPDATE",DELETE:"DELETE",DELETE_ALL:"DELETE ALL",MOVE:"MOVE",SELECT:"SELECT",DESELECT:"DESELECT",REPLACE:"REPLACE",DELETEPAGE:"DELETEPAGE"},LIST_ACTIONS_TYPE:{SELECT_DESELECT:"SELECT_DESELECT",DESELECT_ALL:"DESELECT_ALL"},ENV_INFO_KEYS:{APPLICATION_NAME:"APPLICATION_NAME",APPLICATION_DESC:"APPLICATION_DESC",ACCESS_GROUP:"ACCESS_GROUP",USER_NAME:"USER_NAME",USER_ID:"USER_ID",USER_IMAGE:"USER_IMAGE",LOCALE:"LOCALE",TIMEZONE:"TIMEZONE",WORK_GROUP:"WORK_GROUP"},ID:"ID",SCALARLIST:"ScalarList",COREHEADERS:"coreHeaders",SKIPCOREHEADERS:"skipCoreHeaders",COREHEADER_APP_DEBUG_ID:"X-Pega-App-Debug-ID",COREHEADER_APP_DEBUG_LEVELS:"X-Pega-App-Debug-Levels",EMBEDDED_DATA_MODAL:{SHOW_ROW:"showRow",SUBMIT_ROW:"submitRow",EDIT_TYPE:"editType",ACTION_NAME:"actionName",REFRESH_CONDITIONS:"caseInfo.refreshConditions"},LOCALIZATION_V2:2,DATA_CLASS_NOT_FOUND:"Data object class not found",PRIORITY:{CRITICAL:100,HIGH:500,MEDIUM:1e3,LOW:2e3,TRIVIAL:3e3},...U,getProperty:e=>F.map(e)},V="pyRemoteCaseDetails";class k{static remoteCaseMapping={};static setRemoteCaseMapping=e=>{this.remoteCaseMapping=e,this.setAdditionalParameters()};static getRemoteCaseMapping=()=>this.remoteCaseMapping;static getRemoteCase=e=>this.remoteCaseMapping?.[e];static isRemoteCase=e=>!!(e&&this.remoteCaseMapping&&this.remoteCaseMapping[e]);static getRemoteHeaderByContext=e=>Bg.getProperty(".RemoteSystemID",j.CASE_INFO.HEADERS,e);static getRemoteHeader=e=>this.remoteCaseMapping[e]?.RemoteSystemID;static injectRemoteCaseHeader=(e,t,n)=>{if(e&&e.RemoteSystemID)return;const r=this.getRemoteHeaderByContext(n);r?e.RemoteSystemID=r:t&&this.isRemoteCase(t.caseTypeID)&&(e.RemoteSystemID=this.getRemoteHeader(t.caseTypeID))};static isTraditionalRemoteCase=(e="")=>"Traditional"===k.getRemoteCase(e)?.RemoteApplicationType;static setAdditionalParameters=()=>{const e=Dh.environmentInfoObject?.pyRemoteCaseTypeList;e?.forEach((e=>{const t=this.getRemoteCase(e.pyWorkTypeImplementationClassName);t&&(t.name=e.pyWorkTypeName)}))};static getRemoteHeaderFromSourceClass=e=>{const t=Object.values(this.remoteCaseMapping).find((t=>t.RemoteClassName===e));return t?.RemoteSystemID};static getRemoteCaseClassBySourceClass=e=>{for(const[t,n]of Object.entries(this.remoteCaseMapping))if(n.RemoteClassName===e)return t}}const $=k,B={},G=new Map,W=e=>{let t=j.EMPTY_STRING;return t=e&&e.includes(j.FORWARD_SLASH_STRING)?e.substring(0,e.lastIndexOf("/")):e,t},H=(e,t,n=!1)=>{let r=j.EMPTY_STRING;if(t&&e){let s=`${t}${j.FORWARD_SLASH_STRING}${e}`;const a=Ip(s);if(a||t!==j.APP.APP&&t!==j.APP.ROOT)if(a){if(n&&B[s])return r=`${s}${j.UNDERSCORE_STRING}${B[s]}`,r;B[s]?B[s]+=1:B[s]=1,r=`${s}${j.UNDERSCORE_STRING}${B[s]}`}else r=H(e,W(t));else s=`${t}${j.FORWARD_SLASH_STRING}${j.PRIMARY}`,B[s]?B[s]+=1:B[s]=1,r=`${s}${j.UNDERSCORE_STRING}${B[s]}`}return r},q=(e,t)=>{if(e&&t){const n=(G[t]?.[e]??0)+1;return G[t]||(G[t]={}),G[t][e]=n,`${t}${j.FORWARD_SLASH_STRING}${e}_${n}`}return""},z=(e,t)=>{if(e&&t){const n=G[t]?.[e];return n?`${t}${j.FORWARD_SLASH_STRING}${e}_${n}`:q(e,t)}return""},Y=e=>{let t=j.EMPTY_STRING;return e&&(t=e.substring(e.lastIndexOf("/")+1,e.lastIndexOf("_")).toLowerCase()),t},K=(e,t)=>{if(null===e)return t;const[,n]=t.split(j.FORWARD_SLASH_STRING);return e+j.FORWARD_SLASH_STRING+n},J=e=>{const t=e.indexOf(j.FORWARD_SLASH_STRING),n=e.lastIndexOf(j.FORWARD_SLASH_STRING);return t===n?e:e.substring(0,n)},X=e=>{const t=e.split(j.FORWARD_SLASH_STRING);return 2===t.length?e:t[0]+j.FORWARD_SLASH_STRING+t[2]},Q="SET_PROPERTY",Z="REPLACE_PROPERTY",ee="FIELD_CHANGE",te="LOAD_VIEW",ne="SHOW_PAGE",re="SHOW_DATA",se="SHOW_INSIGHT",ae="SHOW_DASHBOARD",oe="SET_LOADING",ie="RESET_LOADING",ce="SET_SHARED_PROPERTY",le="CREATE_WORK",ue="OPEN_WORK_BY_HANDLE",de="UPDATE_DOCUMENT",pe="FINISH_ASSIGNMENT",he="CANCEL_ASSIGNMENT",ge="OPEN_ASSIGNMENT",fe="MERGE_DATA",me="REMOVE_ITEM",Ie="GET_DATAOBJECT_ACTIONS",ye="SHOW_HISTORY",Ee="ERROR",Ae="INIT_CONTAINERS",_e="RESET_CONTAINERS",Ce="ADD_CONTAINER_ITEM",Se="REMOVE_CONTAINER_ITEM",Te="ADD_TRANSIENT_ITEM",Ne="UPDATE_TRANSIENT_DATA",Oe="REMOVE_TRANSIENT_ITEM",Pe="REMOVE_ALL_TRANSIENT_ITEMS",De="CLEAR_TRANSIENT_DATA",Re="PURGE_TRANSIENT_DATA",be="REPLACE_TRANSIENT_DATA",ve="ACTIVATE_CONTAINER_ITEM",xe="UPDATE_CONTAINER_ITEM",we="UPMERGE_AND_REMOVE_CONTAINER_ITEM",Me="REPLACE_CONTAINER_ITEM",Le="ACTIVATE_MODAL_CONTAINER_ITEM",Fe="REMOVE_CONTAINER",Ue="ADD_SUGGESTION_CONTEXT",je="showView",Ve="showData",ke="showInsight",$e="showDashboard",Be="openWorkByHandle",Ge="openAssignment",We="createNewWork",He="SHOW_CANCEL_ALERT",qe="deleteCaseInCreateStage",ze="openLocalAction",Ye="openProcessAction",Ke="caseWideActions",Je="openBulkAction",Xe="performBulkAction",Qe="launchAssignment",Ze="ADD_MESSAGES",et="CLEAR_MESSAGES",tt="RESET_STORE",nt="FETCH_DATAPAGE",rt="ADD_SHARED_DATA",st="REMOVE_SHARED_DATA",at="LIST_ACTION",ot="DELETE_CASE_SUMMARY",it="ALTER_BLOCKING_ACTION_COUNT",ct="CREATE_DATA_OBJECT",lt="DELETE_DATA_OBJECT",ut="VIEW_DATA_OBJECT",dt="UPDATE_DATA_OBJECT",pt="OPEN_DATA_OBJECT_ACTION",ht="SUBMIT_DATA_OBJECT_ACTION",gt="OPEN_EMBEDDED_DATA_MODAL",ft="SUBMIT_EMBEDDED_DATA_MODAL",mt="SUBMIT_SUBSCRIPT",It="FILL_FORM_WITH_AI",yt="createWork",Et="openAssignment",At="openCase",_t="OPEN_OBJECT_ACTION",Ct="EXECUTE_OBJECT_WIDE_ACTION",St="createObject",Tt="getObject",Nt="getObjectWideAction",Ot="createExternalObject",Pt=(e,t)=>{if(!e||!t)return null;let n,r=j.EMPTY_STRING;return t&&(r=`${t}${j.FORWARD_SLASH_STRING}${e}`,n=Ip(r),n||t.includes("/")?n||(r=Pt(e,W(t))):r=`${t}${j.FORWARD_SLASH_STRING}${e}`),r},Dt=(e,t)=>{const n=Pt(e,t);return n&&Ip(n)?Ip(n):{}},Rt=(e,t)=>Ph.getSemanticURL(je,{page:e},t);class bt{constructor(e,t,n){this._grammar=e,this._state="expectOperand",this._exprStr=t||"",this._endState=n||{},this._subParser=null}static _setParent(e,t){Object.defineProperty(e,"_parent",{value:t,writable:!0})}_addToken(e){const t=jt[this._state],n=this._exprStr;if(this._exprStr+=e.element,t.subHandler){this._subParser||this._startSubExpression(n);const t=this._subParser?._addToken(e);t&&(this._endSubExpression(),this._state=t)}else{if(!t.operatorTypes?.[e.tokenType]){if(this._endState[e.tokenType])return this._endState[e.tokenType];throw new Error(`Token ${e.element} (${e.tokenType}) unexpected in expression: ${this._exprStr}`)}{const n=t.operatorTypes[e.tokenType],r=Ut[e.tokenType];r&&r.call(this,e),n.toState&&(this._state=n.toState)}}return!1}addTokens(e){e.forEach(this._addToken,this)}buildAst(){return this._subParser&&this._endSubExpression(),this._state="complete",this._position?this._tree:null}_startSubExpression(e){const{endStates:t}=jt[this._state];this._subParser=new bt(this._grammar,e,t)}_endSubExpression(){jt[this._state].subHandler.call(this,this._subParser.buildAst()),this._subParser=null}setPositionInAST(e){this._position?(this._position.right=e,bt._setParent(e,this._position)):this._tree=e,this._position=e}}const vt=bt,xt="identifier",wt={operatorType:"binaryOperator",precedence:1,evaluate:(e,t)=>e&&t},Mt={operatorType:"binaryOperator",precedence:1,evaluate:(e,t)=>e||t},Lt={">":{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>e>t},">=":{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>e>=t},"<":{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>e<t},"<=":{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>e<=t},"==":{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>e===t},"!=":{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>e!==t},"!":{operatorType:"unaryOperator",precedence:999,evaluate:e=>{let{value:t}=e;return"true"!==t&&"false"!==t||(t="true"===t),!t}},"(":{operatorType:"openParenthesis"},")":{operatorType:"closeParenthesis"},"&&":wt,AND:wt,and:wt,"||":Mt,OR:Mt,or:Mt,CONTAINS:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>e.includes(t)},NOT_CONTAINS:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>!e.includes(t)},STARTS_WITH:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>e.startsWith(t)},NOT_STARTS_WITH:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>!e.startsWith(t)},ENDS_WITH:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>e.endsWith(t)},NOT_ENDS_WITH:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>!e.endsWith(t)},IS_NULL:{operatorType:"binaryOperator",precedence:2,evaluate:e=>!e},IS_NOT_NULL:{operatorType:"binaryOperator",precedence:2,evaluate:e=>!!e},IS_IN_LIST:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>t.split(",").includes(e)},IS_NOT_IN_LIST:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>!t.split(",").includes(e)}},Ft={BinaryExpression:function(e){const t=[];let n="";const r=e.right,s=e.operator,a=e.left;if(t[0]=this.evaluateAST(a),a.operationType===xt&&this._context){const e=a.value;n=this._context.getFieldMetadata(e.substring(1))?.type??""}t[1]=r?this.evaluateAST(r,n):"";return(0,this._grammar[s].evaluate)(t[0],t[1])},identifier:function(e){return this._localDataObject?jg.getIn(this._localDataObject,e.value?e.value.substring(1).split("."):[])??"":this._contextTreeNodeContext?Bg.getLitePropertyValue(this._contextTreeNodeContext,e.value)??"":this._context.getValue(e.value)??""},literal:function(e,t){return!(void 0===t||""===t||"True-False"===t)||"true"!==e.value&&"false"!==e.value?e.value:"true"===e.value},UnaryExpression:function(e){const t=e.operator,n=e.right;return(0,this._grammar[t].evaluate)(n)}},Ut={unaryOperator:function(e){this.setPositionInAST({operationType:"UnaryExpression",operator:e.value})},binaryOperator:function(e){const{precedence:t}=this._grammar[e.value];let n=this._position._parent;const r=n?n.operator:null,s=r?this._grammar[r]:null,a=s?s.precedence:null;if(a&&t)for(;n?.operator&&a>=t;)this._position=n,n=n._parent;const o={operationType:"BinaryExpression",operator:e.value,left:this._position};vt._setParent(this._position,o),this._position=n,this.setPositionInAST(o)},identifier:function(e){const t={operationType:xt,value:e.value};this.setPositionInAST(t)},literal:function(e){this.setPositionInAST({operationType:"literal",value:e.value})},subExpression:function(e){this.setPositionInAST(e)}},jt={expectOperand:{operatorTypes:{literal:{toState:"expectBinOp"},identifier:{toState:xt},unaryOperator:{},openParenthesis:{toState:"subExpression"}}},expectBinOp:{operatorTypes:{binaryOperator:{toState:"expectOperand"}}},identifier:{operatorTypes:{binaryOperator:{toState:"expectOperand"}}},subExpression:{subHandler:Ut.subExpression,endStates:{closeParenthesis:"expectBinOp"}}},Vt=["binaryOperator","unaryOperator","openParenthesis"],kt=/^\s*$/,$t=/^[a-zA-Z_.$][(0-9)a-zA-Z0-9_.$]*$/,Bt=/\\\\/,Gt=["'(?:(?:\\\\')|[^'])*'",'"(?:(?:\\\\")|[^"])*"',"\\s+","\\btrue\\b","\\bfalse\\b"],Wt=["[a-zA-Z_.$][a-zA-Z0-9_.$]*(?:\\(\\d+\\))?(?:\\.[a-zA-Z0-9_.$]+)*","[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}|[0-9]{4}-[0-9]{2}-[0-9]{2}","(?:(?:[0-9]*\\.[0-9]+)|[0-9]+)"],Ht=/^-?(?:(?:[0-9]*\.[0-9]+)|[0-9]+)$/;class qt{constructor(e){this._grammar=e}static _isNegative(e){return Vt.some((t=>t===e[e.length-1].tokenType))}static _isWhitespace(e){return!!e.match(kt)}static _createWordboundary(e){return(e=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).match($t)&&(e=`\\b${e}\\b`),e}static _unquote(e){const[t]=e,n=new RegExp(`\\\\${t}`,"g");return e.substr(1,e.length-2).replace(n,t).replace(Bt,"\\")}_getSplitRegex(){if(!this._splitRegex){const e=Object.keys(this._grammar).sort(((e,t)=>t.length-e.length)).map((e=>qt._createWordboundary(e)),this);this._splitRegex=new RegExp(`(${[Gt.join("|"),e.join("|"),Wt.join("|")].join("|")})`)}return this._splitRegex}_splitExpression(e){const t=this._getSplitRegex();return e.split(t).filter((e=>e.trim()))}_createToken(e){const t={tokenType:"literal",value:e,element:e};return e.startsWith('"')||e.startsWith("'")?t.value=qt._unquote(e):e.match(Ht)?t.value=parseFloat(e):"true"===e||"false"===e?t.value="true"===e:this._grammar[e]?t.tokenType=this._grammar[e].operatorType:e.match($t)&&(t.tokenType="identifier"),t}_getTokens(e){const t=[];let n=!1;for(let r=0;r<e.length;r+=1)qt._isWhitespace(e[r])?t.length&&(t[t.length-1].element+=e[r]):"-"===e[r]&&qt._isNegative(t)?n=!0:(n&&(e[r]=`-${e[r]}`,n=!1),t.push(this._createToken(e[r])));return t}tokenize(e){const t=this._splitExpression(e);return this._getTokens(t)}}const zt=qt;const Yt=class{constructor(e,t){this._grammar={...Lt},this._expression=e,this._ast=null,this._contextTreeNodeContext=null,this._localDataObject=t}buildAST(){const e=new zt(this._grammar).tokenize(this._expression),t=new vt(this._grammar);return t.addTokens(e),this._ast=t.buildAst(),this}evaluate(e,t){return this._context=e,this._contextTreeNodeContext=t,this.evaluateAST(this._ast)}evaluateAST(e,t){return Zt(e.operationType,Ft)&&Ft[e.operationType].call(this,e,t)}},Kt=(e,t)=>{const n=e.replace(/[a-zA-Z0-9_)"'\s]=[a-zA-Z0-9_("'\s]/,(e=>e.replace("=","==")));return new Yt(n,t)},Jt=e=>!e||e.buildAST(),Xt=(e,t,n)=>!e||e.evaluate(t,n),Qt=(e,t,n)=>{const r=Kt(e,t),s=Jt(r);return Xt(s,n)},Zt=(e,t)=>e in t;const en=class{static handleExpression(e,t,n,r){const s=this.getContext(e,r);A({actionObject:{action:"decexp",params:{source:e,value:t,targets:n},context:s}}).then((e=>e.json())).then((e=>{this.updateState(e,r)})).catch((e=>window.console.log(e)))}static getContext(e,t){const n=e.substring(0,e.indexOf("."));return{name:n,class:Bg.getPropertyValue(`${n}.pxObjClass`,null,t)||Bg.getPropertyValue(`${n}.pyClassName`,null,t)}}static updateState(e,t){Object.keys(e).forEach((n=>Cg({type:Q,payload:{context:t,reference:n,value:e[n]}})))}},tn={},nn=(e,t)=>tn[t]&&Object.hasOwn(tn[t],e),rn=e=>{const{context:t}=e;nn(e.reference,t)&&en.handleExpression(e.reference,e.value,tn[t][e.reference],t)},sn=(e={})=>{jg.copy(e,tn)},an=(e,t,n)=>Qt(e,t,n?.pConnect.getPConnect());const on=new class{constructor(){this._dataSourceMap={}}hasContextName(e){return e in this._dataSourceMap}addContextName(e,t){t&&Object.keys(t).length>0?this._dataSourceMap[e]=t:this._dataSourceMap[e]={}}getContextObjectByName(e){return e in this._dataSourceMap?this._dataSourceMap[e]:null}deleteContextName(e){this.hasContextName(e)&&delete this._dataSourceMap[e]}addOrUpdatePropertyInContext(e,t,n){if(this.hasContextName(e)){const r=this.getContextObjectByName(e);if(r)if(Array.isArray(n))r[t]=n;else{const e=r[t];r[t]=[...new Set([...e,n])]}}else{const r={};Array.isArray(n)?r[t]=n:r[t]=[n],this.addContextName(e,r)}}deletePropertyInContext(e,t){if(this.hasContextName(e)){const n=this.getContextObjectByName(e);n&&t in n&&delete n[t]}}getPropertyFromContext(e,t){if(this.hasContextName(e)){const n=this.getContextObjectByName(e);if(n&&t in n)return n[t]}return[]}getDependencies(e,t){const n=this.getPropertyFromContext(e,t),r=new Set(n);return n.forEach((e=>{r.add(e)})),[...r]}};const cn=new class{constructor(){this.componentMap={},this.overrideMap={},this.lazyMap={},this.customComponentLazyMap={}}register(e,t){this.componentMap[e]=t}registerLazyMap(e,t){this.lazyMap[e]=t}registerCustomComponentLazyMap(e,t){this.customComponentLazyMap[e]=t}getComponent(e){return this.componentMap[e]}getLazyComponent(e){return this.lazyMap[e]}getCustomComponent(e){return this.customComponentLazyMap[e]}mergeComponentsMap(e={}){jg.copy(e,this.componentMap)}mergeOverrideMap(e={}){jg.copy(e,this.overrideMap)}getOverrideMap(){return this.overrideMap}getLazyMap(){return this.lazyMap}};const ln=new class{constructor(){this.handlers={}}registerHandler(e,t){this.handlers[e]=t}getHandler(e){return this.handlers[e]}};const un=class{static handleAnnotation(e,t,n){const r=e.indexOf(" "),s=-1===r?e:e.substring(0,r),a=ln.getHandler(s);return a?a(e.substring(r+1),t,n):e}static trimAnnotation(e){if("string"!=typeof e)return e;const t=e.indexOf(" "),n=e.substring(0,t),r=e.substring(t+1);return ln.getHandler(n)?r:e}static handleComponentMapping(e,t,n){const r=cn.getComponent(t.type);if(!r?.mapping)return;const s=r.mapping(t.config);if(s&&s["@map"]){const t=s["@map"],{source:r}=t;if(!r)return;const a=n.getValue(r);if("function"==typeof t.advanced)t.advanced(e,a);else{const n=t.inputs_map;e[t.output_property]=[];const r=e[t.output_property];a.forEach((e=>{const t={};Object.keys(n).forEach((r=>{let s=n[r];s&&0===s.indexOf(".")?(s=s.substring(1),t[r]=e[s]):t[r]=s})),r.push(t)}))}}}static getPropertyName(e=""){if(e&&jg.isString(e)){const t=e.startsWith(j.PROPERTY_ANNOTATION)||e.startsWith(j.ATTACHMENT_ANNOTATION)||e.startsWith(j.ASSOCIATED_PROPERTY_ANNOTATION),n=t?e.indexOf(" "):-1;return t?e.substring(n+2):e}return e}static getLeafPropertyName(e){if(jg.isString(e)&&!!e?.startsWith(j.PROPERTY_ANNOTATION)){const t=this.getPropertyName(e),n=t.split(".");return n.length<2?t:n.pop()}return e}static isProperty(e){return jg.isString(e)&&!!e?.startsWith(j.PROPERTY_ANNOTATION)}};function dn(e,t){return function(){return e.apply(t,arguments)}}const{toString:pn}=Object.prototype,{getPrototypeOf:hn}=Object,{iterator:gn,toStringTag:fn}=Symbol,mn=(In=Object.create(null),e=>{const t=pn.call(e);return In[t]||(In[t]=t.slice(8,-1).toLowerCase())});var In;const yn=e=>(e=e.toLowerCase(),t=>mn(t)===e),En=e=>t=>typeof t===e,{isArray:An}=Array,_n=En("undefined");function Cn(e){return null!==e&&!_n(e)&&null!==e.constructor&&!_n(e.constructor)&&Nn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Sn=yn("ArrayBuffer");const Tn=En("string"),Nn=En("function"),On=En("number"),Pn=e=>null!==e&&"object"==typeof e,Dn=e=>{if("object"!==mn(e))return!1;const t=hn(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||fn in e||gn in e)},Rn=yn("Date"),bn=yn("File"),vn=yn("Blob"),xn=yn("FileList"),wn=yn("URLSearchParams"),[Mn,Ln,Fn,Un]=["ReadableStream","Request","Response","Headers"].map(yn);function jn(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,s;if("object"!=typeof e&&(e=[e]),An(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(Cn(e))return;const s=n?Object.getOwnPropertyNames(e):Object.keys(e),a=s.length;let o;for(r=0;r<a;r++)o=s[r],t.call(null,e[o],o,e)}}function Vn(e,t){if(Cn(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,s=n.length;for(;s-- >0;)if(r=n[s],t===r.toLowerCase())return r;return null}const kn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,$n=e=>!_n(e)&&e!==kn;const Bn=(Gn="undefined"!=typeof Uint8Array&&hn(Uint8Array),e=>Gn&&e instanceof Gn);var Gn;const Wn=yn("HTMLFormElement"),Hn=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),qn=yn("RegExp"),zn=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};jn(n,((n,s)=>{let a;!1!==(a=t(n,s,e))&&(r[s]=a||n)})),Object.defineProperties(e,r)};const Yn=yn("AsyncFunction"),Kn=(Jn="function"==typeof setImmediate,Xn=Nn(kn.postMessage),Jn?setImmediate:Xn?(Qn=`axios@${Math.random()}`,Zn=[],kn.addEventListener("message",(({source:e,data:t})=>{e===kn&&t===Qn&&Zn.length&&Zn.shift()()}),!1),e=>{Zn.push(e),kn.postMessage(Qn,"*")}):e=>setTimeout(e));var Jn,Xn,Qn,Zn;const er="undefined"!=typeof queueMicrotask?queueMicrotask.bind(kn):"undefined"!=typeof process&&process.nextTick||Kn,tr={isArray:An,isArrayBuffer:Sn,isBuffer:Cn,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||Nn(e.append)&&("formdata"===(t=mn(e))||"object"===t&&Nn(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Sn(e.buffer),t},isString:Tn,isNumber:On,isBoolean:e=>!0===e||!1===e,isObject:Pn,isPlainObject:Dn,isEmptyObject:e=>{if(!Pn(e)||Cn(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:Mn,isRequest:Ln,isResponse:Fn,isHeaders:Un,isUndefined:_n,isDate:Rn,isFile:bn,isBlob:vn,isRegExp:qn,isFunction:Nn,isStream:e=>Pn(e)&&Nn(e.pipe),isURLSearchParams:wn,isTypedArray:Bn,isFileList:xn,forEach:jn,merge:function e(){const{caseless:t,skipUndefined:n}=$n(this)&&this||{},r={},s=(s,a)=>{const o=t&&Vn(r,a)||a;Dn(r[o])&&Dn(s)?r[o]=e(r[o],s):Dn(s)?r[o]=e({},s):An(s)?r[o]=s.slice():n&&_n(s)||(r[o]=s)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&jn(arguments[e],s);return r},extend:(e,t,n,{allOwnKeys:r}={})=>(jn(t,((t,r)=>{n&&Nn(t)?e[r]=dn(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let s,a,o;const i={};if(t=t||{},null==e)return t;do{for(s=Object.getOwnPropertyNames(e),a=s.length;a-- >0;)o=s[a],r&&!r(o,e,t)||i[o]||(t[o]=e[o],i[o]=!0);e=!1!==n&&hn(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:mn,kindOfTest:yn,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(An(e))return e;let t=e.length;if(!On(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[gn]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:Wn,hasOwnProperty:Hn,hasOwnProp:Hn,reduceDescriptors:zn,freezeMethods:e=>{zn(e,((t,n)=>{if(Nn(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];Nn(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return An(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:Vn,global:kn,isContextDefined:$n,isSpecCompliantForm:function(e){return!!(e&&Nn(e.append)&&"FormData"===e[fn]&&e[gn])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(Pn(e)){if(t.indexOf(e)>=0)return;if(Cn(e))return e;if(!("toJSON"in e)){t[r]=e;const s=An(e)?[]:{};return jn(e,((e,t)=>{const a=n(e,r+1);!_n(a)&&(s[t]=a)})),t[r]=void 0,s}}return e};return n(e,0)},isAsyncFn:Yn,isThenable:e=>e&&(Pn(e)||Nn(e))&&Nn(e.then)&&Nn(e.catch),setImmediate:Kn,asap:er,isIterable:e=>null!=e&&Nn(e[gn])};function nr(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}tr.inherits(nr,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:tr.toJSONObject(this.config),code:this.code,status:this.status}}});const rr=nr.prototype,sr={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{sr[e]={value:e}})),Object.defineProperties(nr,sr),Object.defineProperty(rr,"isAxiosError",{value:!0}),nr.from=(e,t,n,r,s,a)=>{const o=Object.create(rr);tr.toFlatObject(e,o,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e));const i=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return nr.call(o,i,c,n,r,s),e&&null==o.cause&&Object.defineProperty(o,"cause",{value:e,configurable:!0}),o.name=e&&e.name||"Error",a&&Object.assign(o,a),o};const ar=nr;function or(e){return tr.isPlainObject(e)||tr.isArray(e)}function ir(e){return tr.endsWith(e,"[]")?e.slice(0,-2):e}function cr(e,t,n){return e?e.concat(t).map((function(e,t){return e=ir(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const lr=tr.toFlatObject(tr,{},null,(function(e){return/^is[A-Z]/.test(e)}));const ur=function(e,t,n){if(!tr.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=tr.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!tr.isUndefined(t[e])}))).metaTokens,s=n.visitor||l,a=n.dots,o=n.indexes,i=(n.Blob||"undefined"!=typeof Blob&&Blob)&&tr.isSpecCompliantForm(t);if(!tr.isFunction(s))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(tr.isDate(e))return e.toISOString();if(tr.isBoolean(e))return e.toString();if(!i&&tr.isBlob(e))throw new ar("Blob is not supported. Use a Buffer instead.");return tr.isArrayBuffer(e)||tr.isTypedArray(e)?i&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,s){let i=e;if(e&&!s&&"object"==typeof e)if(tr.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(tr.isArray(e)&&function(e){return tr.isArray(e)&&!e.some(or)}(e)||(tr.isFileList(e)||tr.endsWith(n,"[]"))&&(i=tr.toArray(e)))return n=ir(n),i.forEach((function(e,r){!tr.isUndefined(e)&&null!==e&&t.append(!0===o?cr([n],r,a):null===o?n:n+"[]",c(e))})),!1;return!!or(e)||(t.append(cr(s,n,a),c(e)),!1)}const u=[],d=Object.assign(lr,{defaultVisitor:l,convertValue:c,isVisitable:or});if(!tr.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!tr.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),tr.forEach(n,(function(n,a){!0===(!(tr.isUndefined(n)||null===n)&&s.call(t,n,tr.isString(a)?a.trim():a,r,d))&&e(n,r?r.concat(a):[a])})),u.pop()}}(e),t};function dr(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function pr(e,t){this._pairs=[],e&&ur(e,this,t)}const hr=pr.prototype;hr.append=function(e,t){this._pairs.push([e,t])},hr.toString=function(e){const t=e?function(t){return e.call(this,t,dr)}:dr;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const gr=pr;function fr(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function mr(e,t,n){if(!t)return e;const r=n&&n.encode||fr;tr.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let a;if(a=s?s(t,n):tr.isURLSearchParams(t)?t.toString():new gr(t,n).toString(r),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}const Ir=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){tr.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},yr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Er={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:gr,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Ar="undefined"!=typeof window&&"undefined"!=typeof document,_r="object"==typeof navigator&&navigator||void 0,Cr=Ar&&(!_r||["ReactNative","NativeScript","NS"].indexOf(_r.product)<0),Sr="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Tr=Ar&&window.location.href||"http://localhost",Nr={...r,...Er};const Or=function(e){function t(e,n,r,s){let a=e[s++];if("__proto__"===a)return!0;const o=Number.isFinite(+a),i=s>=e.length;if(a=!a&&tr.isArray(r)?r.length:a,i)return tr.hasOwnProp(r,a)?r[a]=[r[a],n]:r[a]=n,!o;r[a]&&tr.isObject(r[a])||(r[a]=[]);return t(e,n,r[a],s)&&tr.isArray(r[a])&&(r[a]=function(e){const t={},n=Object.keys(e);let r;const s=n.length;let a;for(r=0;r<s;r++)a=n[r],t[a]=e[a];return t}(r[a])),!o}if(tr.isFormData(e)&&tr.isFunction(e.entries)){const n={};return tr.forEachEntry(e,((e,r)=>{t(function(e){return tr.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null};const Pr={transitional:yr,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,s=tr.isObject(e);s&&tr.isHTMLForm(e)&&(e=new FormData(e));if(tr.isFormData(e))return r?JSON.stringify(Or(e)):e;if(tr.isArrayBuffer(e)||tr.isBuffer(e)||tr.isStream(e)||tr.isFile(e)||tr.isBlob(e)||tr.isReadableStream(e))return e;if(tr.isArrayBufferView(e))return e.buffer;if(tr.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return ur(e,new Nr.classes.URLSearchParams,{visitor:function(e,t,n,r){return Nr.isNode&&tr.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((a=tr.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return ur(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return s||r?(t.setContentType("application/json",!1),function(e,t,n){if(tr.isString(e))try{return(t||JSON.parse)(e),tr.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Pr.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(tr.isResponse(e)||tr.isReadableStream(e))return e;if(e&&tr.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n){if("SyntaxError"===e.name)throw ar.from(e,ar.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Nr.classes.FormData,Blob:Nr.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};tr.forEach(["delete","get","head","post","put","patch"],(e=>{Pr.headers[e]={}}));const Dr=Pr,Rr=tr.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),br=Symbol("internals");function vr(e){return e&&String(e).trim().toLowerCase()}function xr(e){return!1===e||null==e?e:tr.isArray(e)?e.map(xr):String(e)}function wr(e,t,n,r,s){return tr.isFunction(r)?r.call(this,t,n):(s&&(t=n),tr.isString(t)?tr.isString(r)?-1!==t.indexOf(r):tr.isRegExp(r)?r.test(t):void 0:void 0)}class Mr{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function s(e,t,n){const s=vr(t);if(!s)throw new Error("header name must be a non-empty string");const a=tr.findKey(r,s);(!a||void 0===r[a]||!0===n||void 0===n&&!1!==r[a])&&(r[a||t]=xr(e))}const a=(e,t)=>tr.forEach(e,((e,n)=>s(e,n,t)));if(tr.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(tr.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))a((e=>{const t={};let n,r,s;return e&&e.split("\n").forEach((function(e){s=e.indexOf(":"),n=e.substring(0,s).trim().toLowerCase(),r=e.substring(s+1).trim(),!n||t[n]&&Rr[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t);else if(tr.isObject(e)&&tr.isIterable(e)){let n,r,s={};for(const t of e){if(!tr.isArray(t))throw TypeError("Object iterator must return a key-value pair");s[r=t[0]]=(n=s[r])?tr.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}a(s,t)}else null!=e&&s(t,e,n);return this}get(e,t){if(e=vr(e)){const n=tr.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(tr.isFunction(t))return t.call(this,e,n);if(tr.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=vr(e)){const n=tr.findKey(this,e);return!(!n||void 0===this[n]||t&&!wr(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function s(e){if(e=vr(e)){const s=tr.findKey(n,e);!s||t&&!wr(0,n[s],s,t)||(delete n[s],r=!0)}}return tr.isArray(e)?e.forEach(s):s(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const s=t[n];e&&!wr(0,this[s],s,e,!0)||(delete this[s],r=!0)}return r}normalize(e){const t=this,n={};return tr.forEach(this,((r,s)=>{const a=tr.findKey(n,s);if(a)return t[a]=xr(r),void delete t[s];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(s):String(s).trim();o!==s&&delete t[s],t[o]=xr(r),n[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return tr.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&tr.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[br]=this[br]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=vr(e);t[r]||(!function(e,t){const n=tr.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,s){return this[r].call(this,t,e,n,s)},configurable:!0})}))}(n,e),t[r]=!0)}return tr.isArray(e)?e.forEach(r):r(e),this}}Mr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),tr.reduceDescriptors(Mr.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),tr.freezeMethods(Mr);const Lr=Mr;function Fr(e,t){const n=this||Dr,r=t||n,s=Lr.from(r.headers);let a=r.data;return tr.forEach(e,(function(e){a=e.call(n,a,s.normalize(),t?t.status:void 0)})),s.normalize(),a}function Ur(e){return!(!e||!e.__CANCEL__)}function jr(e,t,n){ar.call(this,null==e?"canceled":e,ar.ERR_CANCELED,t,n),this.name="CanceledError"}tr.inherits(jr,ar,{__CANCEL__:!0});const Vr=jr;function kr(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new ar("Request failed with status code "+n.status,[ar.ERR_BAD_REQUEST,ar.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const $r=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s,a=0,o=0;return t=void 0!==t?t:1e3,function(i){const c=Date.now(),l=r[o];s||(s=c),n[a]=i,r[a]=c;let u=o,d=0;for(;u!==a;)d+=n[u++],u%=e;if(a=(a+1)%e,a===o&&(o=(o+1)%e),c-s<t)return;const p=l&&c-l;return p?Math.round(1e3*d/p):void 0}};const Br=function(e,t){let n,r,s=0,a=1e3/t;const o=(t,a=Date.now())=>{s=a,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),i=t-s;i>=a?o(e,t):(n=e,r||(r=setTimeout((()=>{r=null,o(n)}),a-i)))},()=>n&&o(n)]},Gr=(e,t,n=3)=>{let r=0;const s=$r(50,250);return Br((n=>{const a=n.loaded,o=n.lengthComputable?n.total:void 0,i=a-r,c=s(i);r=a;e({loaded:a,total:o,progress:o?a/o:void 0,bytes:i,rate:c||void 0,estimated:c&&o&&a<=o?(o-a)/c:void 0,event:n,lengthComputable:null!=o,[t?"download":"upload"]:!0})}),n)},Wr=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Hr=e=>(...t)=>tr.asap((()=>e(...t))),qr=Nr.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Nr.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Nr.origin),Nr.navigator&&/(msie|trident)/i.test(Nr.navigator.userAgent)):()=>!0,zr=Nr.hasStandardBrowserEnv?{write(e,t,n,r,s,a){const o=[e+"="+encodeURIComponent(t)];tr.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),tr.isString(r)&&o.push("path="+r),tr.isString(s)&&o.push("domain="+s),!0===a&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Yr(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Kr=e=>e instanceof Lr?{...e}:e;function Jr(e,t){t=t||{};const n={};function r(e,t,n,r){return tr.isPlainObject(e)&&tr.isPlainObject(t)?tr.merge.call({caseless:r},e,t):tr.isPlainObject(t)?tr.merge({},t):tr.isArray(t)?t.slice():t}function s(e,t,n,s){return tr.isUndefined(t)?tr.isUndefined(e)?void 0:r(void 0,e,0,s):r(e,t,0,s)}function a(e,t){if(!tr.isUndefined(t))return r(void 0,t)}function o(e,t){return tr.isUndefined(t)?tr.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function i(n,s,a){return a in t?r(n,s):a in e?r(void 0,n):void 0}const c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:i,headers:(e,t,n)=>s(Kr(e),Kr(t),0,!0)};return tr.forEach(Object.keys({...e,...t}),(function(r){const a=c[r]||s,o=a(e[r],t[r],r);tr.isUndefined(o)&&a!==i||(n[r]=o)})),n}const Xr=e=>{const t=Jr({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:a,headers:o,auth:i}=t;if(t.headers=o=Lr.from(o),t.url=mr(Yr(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),i&&o.set("Authorization","Basic "+btoa((i.username||"")+":"+(i.password?unescape(encodeURIComponent(i.password)):""))),tr.isFormData(n))if(Nr.hasStandardBrowserEnv||Nr.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(tr.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach((([e,n])=>{t.includes(e.toLowerCase())&&o.set(e,n)}))}if(Nr.hasStandardBrowserEnv&&(r&&tr.isFunction(r)&&(r=r(t)),r||!1!==r&&qr(t.url))){const e=s&&a&&zr.read(a);e&&o.set(s,e)}return t},Qr="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=Xr(e);let s=r.data;const a=Lr.from(r.headers).normalize();let o,i,c,l,u,{responseType:d,onUploadProgress:p,onDownloadProgress:h}=r;function g(){l&&l(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(o),r.signal&&r.signal.removeEventListener("abort",o)}let f=new XMLHttpRequest;function m(){if(!f)return;const r=Lr.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders());kr((function(e){t(e),g()}),(function(e){n(e),g()}),{data:d&&"text"!==d&&"json"!==d?f.response:f.responseText,status:f.status,statusText:f.statusText,headers:r,config:e,request:f}),f=null}f.open(r.method.toUpperCase(),r.url,!0),f.timeout=r.timeout,"onloadend"in f?f.onloadend=m:f.onreadystatechange=function(){f&&4===f.readyState&&(0!==f.status||f.responseURL&&0===f.responseURL.indexOf("file:"))&&setTimeout(m)},f.onabort=function(){f&&(n(new ar("Request aborted",ar.ECONNABORTED,e,f)),f=null)},f.onerror=function(t){const r=t&&t.message?t.message:"Network Error",s=new ar(r,ar.ERR_NETWORK,e,f);s.event=t||null,n(s),f=null},f.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const s=r.transitional||yr;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new ar(t,s.clarifyTimeoutError?ar.ETIMEDOUT:ar.ECONNABORTED,e,f)),f=null},void 0===s&&a.setContentType(null),"setRequestHeader"in f&&tr.forEach(a.toJSON(),(function(e,t){f.setRequestHeader(t,e)})),tr.isUndefined(r.withCredentials)||(f.withCredentials=!!r.withCredentials),d&&"json"!==d&&(f.responseType=r.responseType),h&&([c,u]=Gr(h,!0),f.addEventListener("progress",c)),p&&f.upload&&([i,l]=Gr(p),f.upload.addEventListener("progress",i),f.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(o=t=>{f&&(n(!t||t.type?new Vr(null,e,f):t),f.abort(),f=null)},r.cancelToken&&r.cancelToken.subscribe(o),r.signal&&(r.signal.aborted?o():r.signal.addEventListener("abort",o)));const I=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);I&&-1===Nr.protocols.indexOf(I)?n(new ar("Unsupported protocol "+I+":",ar.ERR_BAD_REQUEST,e)):f.send(s||null)}))},Zr=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const s=function(e){if(!n){n=!0,o();const t=e instanceof Error?e:this.reason;r.abort(t instanceof ar?t:new Vr(t instanceof Error?t.message:t))}};let a=t&&setTimeout((()=>{a=null,s(new ar(`timeout ${t} of ms exceeded`,ar.ETIMEDOUT))}),t);const o=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(s):e.removeEventListener("abort",s)})),e=null)};e.forEach((e=>e.addEventListener("abort",s)));const{signal:i}=r;return i.unsubscribe=()=>tr.asap(o),i}},es=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,s=0;for(;s<n;)r=s+t,yield e.slice(s,r),s=r},ts=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},ns=(e,t,n,r)=>{const s=async function*(e,t){for await(const n of ts(e))yield*es(n,t)}(e,t);let a,o=0,i=e=>{a||(a=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await s.next();if(t)return i(),void e.close();let a=r.byteLength;if(n){let e=o+=a;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw i(e),e}},cancel:e=>(i(e),s.return())},{highWaterMark:2})},{isFunction:rs}=tr,ss=(({Request:e,Response:t})=>({Request:e,Response:t}))(tr.global),{ReadableStream:as,TextEncoder:os}=tr.global,is=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},cs=e=>{e=tr.merge.call({skipUndefined:!0},ss,e);const{fetch:t,Request:n,Response:r}=e,s=t?rs(t):"function"==typeof fetch,a=rs(n),o=rs(r);if(!s)return!1;const i=s&&rs(as),c=s&&("function"==typeof os?(l=new os,e=>l.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var l;const u=a&&i&&is((()=>{let e=!1;const t=new n(Nr.origin,{body:new as,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),d=o&&i&&is((()=>tr.isReadableStream(new r("").body))),p={stream:d&&(e=>e.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!p[e]&&(p[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new ar(`Response type '${e}' is not supported`,ar.ERR_NOT_SUPPORT,n)})}));const h=async(e,t)=>{const r=tr.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(tr.isBlob(e))return e.size;if(tr.isSpecCompliantForm(e)){const t=new n(Nr.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return tr.isArrayBufferView(e)||tr.isArrayBuffer(e)?e.byteLength:(tr.isURLSearchParams(e)&&(e+=""),tr.isString(e)?(await c(e)).byteLength:void 0)})(t):r};return async e=>{let{url:s,method:o,data:i,signal:c,cancelToken:l,timeout:g,onDownloadProgress:f,onUploadProgress:m,responseType:I,headers:y,withCredentials:E="same-origin",fetchOptions:A}=Xr(e),_=t||fetch;I=I?(I+"").toLowerCase():"text";let C=Zr([c,l&&l.toAbortSignal()],g),S=null;const T=C&&C.unsubscribe&&(()=>{C.unsubscribe()});let N;try{if(m&&u&&"get"!==o&&"head"!==o&&0!==(N=await h(y,i))){let e,t=new n(s,{method:"POST",body:i,duplex:"half"});if(tr.isFormData(i)&&(e=t.headers.get("content-type"))&&y.setContentType(e),t.body){const[e,n]=Wr(N,Gr(Hr(m)));i=ns(t.body,65536,e,n)}}tr.isString(E)||(E=E?"include":"omit");const t=a&&"credentials"in n.prototype,c={...A,signal:C,method:o.toUpperCase(),headers:y.normalize().toJSON(),body:i,duplex:"half",credentials:t?E:void 0};S=a&&new n(s,c);let l=await(a?_(S,A):_(s,c));const g=d&&("stream"===I||"response"===I);if(d&&(f||g&&T)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=l[t]}));const t=tr.toFiniteNumber(l.headers.get("content-length")),[n,s]=f&&Wr(t,Gr(Hr(f),!0))||[];l=new r(ns(l.body,65536,n,(()=>{s&&s(),T&&T()})),e)}I=I||"text";let O=await p[tr.findKey(p,I)||"text"](l,e);return!g&&T&&T(),await new Promise(((t,n)=>{kr(t,n,{data:O,headers:Lr.from(l.headers),status:l.status,statusText:l.statusText,config:e,request:S})}))}catch(t){if(T&&T(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new ar("Network Error",ar.ERR_NETWORK,e,S),{cause:t.cause||t});throw ar.from(t,t&&t.code,e,S)}}},ls=new Map,us=e=>{let t=e?e.env:{};const{fetch:n,Request:r,Response:s}=t,a=[r,s,n];let o,i,c=a.length,l=ls;for(;c--;)o=a[c],i=l.get(o),void 0===i&&l.set(o,i=c?new Map:cs(t)),l=i;return i},ds=(us(),{http:null,xhr:Qr,fetch:{get:us}});tr.forEach(ds,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const ps=e=>`- ${e}`,hs=e=>tr.isFunction(e)||null===e||!1===e,gs=(e,t)=>{e=tr.isArray(e)?e:[e];const{length:n}=e;let r,s;const a={};for(let o=0;o<n;o++){let n;if(r=e[o],s=r,!hs(r)&&(s=ds[(n=String(r)).toLowerCase()],void 0===s))throw new ar(`Unknown adapter '${n}'`);if(s&&(tr.isFunction(s)||(s=s.get(t))))break;a[n||"#"+o]=s}if(!s){const e=Object.entries(a).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));let t=n?e.length>1?"since :\n"+e.map(ps).join("\n"):" "+ps(e[0]):"as no adapter specified";throw new ar("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return s};function fs(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Vr(null,e)}function ms(e){fs(e),e.headers=Lr.from(e.headers),e.data=Fr.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return gs(e.adapter||Dr.adapter,e)(e).then((function(t){return fs(e),t.data=Fr.call(e,e.transformResponse,t),t.headers=Lr.from(t.headers),t}),(function(t){return Ur(t)||(fs(e),t&&t.response&&(t.response.data=Fr.call(e,e.transformResponse,t.response),t.response.headers=Lr.from(t.response.headers))),Promise.reject(t)}))}const Is="1.12.2",ys={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{ys[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Es={};ys.transitional=function(e,t,n){function r(e,t){return"[Axios v"+Is+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,s,a)=>{if(!1===e)throw new ar(r(s," has been removed"+(t?" in "+t:"")),ar.ERR_DEPRECATED);return t&&!Es[s]&&(Es[s]=!0,console.warn(r(s," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,s,a)}},ys.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const As={assertOptions:function(e,t,n){if("object"!=typeof e)throw new ar("options must be an object",ar.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const a=r[s],o=t[a];if(o){const t=e[a],n=void 0===t||o(t,a,e);if(!0!==n)throw new ar("option "+a+" must be "+n,ar.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new ar("Unknown option "+a,ar.ERR_BAD_OPTION)}},validators:ys},_s=As.validators;class Cs{constructor(e){this.defaults=e||{},this.interceptors={request:new Ir,response:new Ir}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Jr(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:s}=t;void 0!==n&&As.assertOptions(n,{silentJSONParsing:_s.transitional(_s.boolean),forcedJSONParsing:_s.transitional(_s.boolean),clarifyTimeoutError:_s.transitional(_s.boolean)},!1),null!=r&&(tr.isFunction(r)?t.paramsSerializer={serialize:r}:As.assertOptions(r,{encode:_s.function,serialize:_s.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),As.assertOptions(t,{baseUrl:_s.spelling("baseURL"),withXsrfToken:_s.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=s&&tr.merge(s.common,s[t.method]);s&&tr.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete s[e]})),t.headers=Lr.concat(a,s);const o=[];let i=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(i=i&&e.synchronous,o.unshift(e.fulfilled,e.rejected))}));const c=[];let l;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let u,d=0;if(!i){const e=[ms.bind(this),void 0];for(e.unshift(...o),e.push(...c),u=e.length,l=Promise.resolve(t);d<u;)l=l.then(e[d++],e[d++]);return l}u=o.length;let p=t;for(;d<u;){const e=o[d++],t=o[d++];try{p=e(p)}catch(e){t.call(this,e);break}}try{l=ms.call(this,p)}catch(e){return Promise.reject(e)}for(d=0,u=c.length;d<u;)l=l.then(c[d++],c[d++]);return l}getUri(e){return mr(Yr((e=Jr(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}tr.forEach(["delete","get","head","options"],(function(e){Cs.prototype[e]=function(t,n){return this.request(Jr(n||{},{method:e,url:t,data:(n||{}).data}))}})),tr.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,s){return this.request(Jr(s||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Cs.prototype[e]=t(),Cs.prototype[e+"Form"]=t(!0)}));const Ss=Cs;class Ts{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,s){n.reason||(n.reason=new Vr(e,r,s),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Ts((function(t){e=t})),cancel:e}}}const Ns=Ts;const Os={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Os).forEach((([e,t])=>{Os[t]=e}));const Ps=Os;const Ds=function e(t){const n=new Ss(t),r=dn(Ss.prototype.request,n);return tr.extend(r,Ss.prototype,n,{allOwnKeys:!0}),tr.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Jr(t,n))},r}(Dr);Ds.Axios=Ss,Ds.CanceledError=Vr,Ds.CancelToken=Ns,Ds.isCancel=Ur,Ds.VERSION=Is,Ds.toFormData=ur,Ds.AxiosError=ar,Ds.Cancel=Ds.CanceledError,Ds.all=function(e){return Promise.all(e)},Ds.spread=function(e){return function(t){return e.apply(null,t)}},Ds.isAxiosError=function(e){return tr.isObject(e)&&!0===e.isAxiosError},Ds.mergeConfig=Jr,Ds.AxiosHeaders=Lr,Ds.formToJSON=e=>Or(tr.isHTMLForm(e)?new FormData(e):e),Ds.getAdapter=gs,Ds.HttpStatusCode=Ps,Ds.default=Ds;const Rs=Ds;function bs(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var vs=bs((function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}}));var xs=function(e,t){return xs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},xs(e,t)};function ws(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}xs(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function Ms(e,t,n,r){return new(n||(n=Promise))((function(s,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function i(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,i)}c((r=r.apply(e,t||[])).next())}))}function Ls(e,t){var n,r,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=i(0),o.throw=i(1),o.return=i(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function i(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,i[0]&&(a=0)),a;)try{if(n=1,r&&(s=2&i[0]?r.return:i[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,i[1])).done)return s;switch(r=0,s&&(i=[2&i[0],s.value]),i[0]){case 0:case 1:s=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(s=a.trys,(s=s.length>0&&s[s.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!s||i[1]>s[0]&&i[1]<s[3])){a.label=i[1];break}if(6===i[0]&&a.label<s[1]){a.label=s[1],s=i;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(i);break}s[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=s=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}Object.create;function Fs(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Us(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,s,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(e){s={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(s)throw s.error}}return o}function js(e,t,n){if(n||2===arguments.length)for(var r,s=0,a=t.length;s<a;s++)!r&&s in t||(r||(r=Array.prototype.slice.call(t,0,s)),r[s]=t[s]);return e.concat(r||Array.prototype.slice.call(t))}function Vs(e){return this instanceof Vs?(this.v=e,this):new Vs(e)}function ks(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,s=n.apply(e,t||[]),a=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",(function(e){return function(t){return Promise.resolve(t).then(e,l)}})),r[Symbol.asyncIterator]=function(){return this},r;function o(e,t){s[e]&&(r[e]=function(t){return new Promise((function(n,r){a.push([e,t,n,r])>1||i(e,t)}))},t&&(r[e]=t(r[e])))}function i(e,t){try{(n=s[e](t)).value instanceof Vs?Promise.resolve(n.value.v).then(c,l):u(a[0][2],n)}catch(e){u(a[0][3],e)}var n}function c(e){i("next",e)}function l(e){i("throw",e)}function u(e,t){e(t),a.shift(),a.length&&i(a[0][0],a[0][1])}}function $s(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=Fs(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,s){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,s,(t=e[n](t)).done,t.value)}))}}}Object.create;"function"==typeof SuppressedError&&SuppressedError;var Bs=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function Gs(e){return"function"==typeof e}function Ws(e){return Gs(null==e?void 0:e.then)}var Hs=bs((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}}));function qs(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var zs=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,t,n,r,s;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var o=Fs(a),i=o.next();!i.done;i=o.next()){i.value.remove(this)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}else a.remove(this);var c=this.initialTeardown;if(Gs(c))try{c()}catch(e){s=e instanceof Hs?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var u=Fs(l),d=u.next();!d.done;d=u.next()){var p=d.value;try{Js(p)}catch(e){s=null!=s?s:[],e instanceof Hs?s=js(js([],Us(s)),Us(e.errors)):s.push(e)}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}if(s)throw new Hs(s)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)Js(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&qs(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&qs(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}(),Ys=zs.EMPTY;function Ks(e){return e instanceof zs||e&&"closed"in e&&Gs(e.remove)&&Gs(e.add)&&Gs(e.unsubscribe)}function Js(e){Gs(e)?e():e.unsubscribe()}var Xs={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Qs={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var s=Qs.delegate;return(null==s?void 0:s.setTimeout)?s.setTimeout.apply(s,js([e,t],Us(n))):setTimeout.apply(void 0,js([e,t],Us(n)))},clearTimeout:function(e){var t=Qs.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function Zs(e){Qs.setTimeout((function(){var t=Xs.onUnhandledError;if(!t)throw e;t(e)}))}function ea(){}var ta=na("C",void 0,void 0);function na(e,t,n){return{kind:e,value:t,error:n}}var ra=null;function sa(e){if(Xs.useDeprecatedSynchronousErrorHandling){var t=!ra;if(t&&(ra={errorThrown:!1,error:null}),e(),t){var n=ra,r=n.errorThrown,s=n.error;if(ra=null,r)throw s}}else e()}var aa=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,Ks(t)&&t.add(n)):n.destination=pa,n}return ws(t,e),t.create=function(e,t,n){return new la(e,t,n)},t.prototype.next=function(e){this.isStopped?da(function(e){return na("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?da(na("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?da(ta,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(zs),oa=Function.prototype.bind;function ia(e,t){return oa.call(e,t)}var ca=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){ua(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){ua(e)}else ua(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){ua(e)}},e}(),la=function(e){function t(t,n,r){var s,a,o=e.call(this)||this;Gs(t)||!t?s={next:null!=t?t:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:o&&Xs.useDeprecatedNextContext?((a=Object.create(t)).unsubscribe=function(){return o.unsubscribe()},s={next:t.next&&ia(t.next,a),error:t.error&&ia(t.error,a),complete:t.complete&&ia(t.complete,a)}):s=t;return o.destination=new ca(s),o}return ws(t,e),t}(aa);function ua(e){var t;Xs.useDeprecatedSynchronousErrorHandling?(t=e,Xs.useDeprecatedSynchronousErrorHandling&&ra&&(ra.errorThrown=!0,ra.error=t)):Zs(e)}function da(e,t){var n=Xs.onStoppedNotification;n&&Qs.setTimeout((function(){return n(e,t)}))}var pa={closed:!0,next:ea,error:function(e){throw e},complete:ea},ha="function"==typeof Symbol&&Symbol.observable||"@@observable";function ga(e){return e}function fa(e){return 0===e.length?ga:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var ma=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r,s=this,a=(r=e)&&r instanceof aa||function(e){return e&&Gs(e.next)&&Gs(e.error)&&Gs(e.complete)}(r)&&Ks(r)?e:new la(e,t,n);return sa((function(){var e=s,t=e.operator,n=e.source;a.add(t?t.call(a,n):n?s._subscribe(a):s._trySubscribe(a))})),a},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=Ia(t))((function(t,r){var s=new la({next:function(t){try{e(t)}catch(e){r(e),s.unsubscribe()}},error:r,complete:t});n.subscribe(s)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[ha]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return fa(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=Ia(e))((function(e,n){var r;t.subscribe((function(e){return r=e}),(function(e){return n(e)}),(function(){return e(r)}))}))},e.create=function(t){return new e(t)},e}();function Ia(e){var t;return null!==(t=null!=e?e:Xs.Promise)&&void 0!==t?t:Promise}function ya(e){return Gs(e[ha])}function Ea(e){return Symbol.asyncIterator&&Gs(null==e?void 0:e[Symbol.asyncIterator])}function Aa(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}var _a="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function Ca(e){return Gs(null==e?void 0:e[_a])}function Sa(e){return ks(this,arguments,(function(){var t,n,r;return Ls(this,(function(s){switch(s.label){case 0:t=e.getReader(),s.label=1;case 1:s.trys.push([1,,9,10]),s.label=2;case 2:return[4,Vs(t.read())];case 3:return n=s.sent(),r=n.value,n.done?[4,Vs(void 0)]:[3,5];case 4:return[2,s.sent()];case 5:return[4,Vs(r)];case 6:return[4,s.sent()];case 7:return s.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}function Ta(e){return Gs(null==e?void 0:e.getReader)}function Na(e){if(e instanceof ma)return e;if(null!=e){if(ya(e))return s=e,new ma((function(e){var t=s[ha]();if(Gs(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(Bs(e))return r=e,new ma((function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()}));if(Ws(e))return n=e,new ma((function(e){n.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,Zs)}));if(Ea(e))return Oa(e);if(Ca(e))return t=e,new ma((function(e){var n,r;try{for(var s=Fs(t),a=s.next();!a.done;a=s.next()){var o=a.value;if(e.next(o),e.closed)return}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}e.complete()}));if(Ta(e))return Oa(Sa(e))}var t,n,r,s;throw Aa(e)}function Oa(e){return new ma((function(t){(function(e,t){var n,r,s,a;return Ms(this,void 0,void 0,(function(){var o,i;return Ls(this,(function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=$s(e),c.label=1;case 1:return[4,n.next()];case 2:if((r=c.sent()).done)return[3,4];if(o=r.value,t.next(o),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return i=c.sent(),s={error:i},[3,11];case 6:return c.trys.push([6,,9,10]),r&&!r.done&&(a=n.return)?[4,a.call(n)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(s)throw s.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}function Pa(e,t,n,r,s){void 0===r&&(r=0),void 0===s&&(s=!1);var a=t.schedule((function(){n(),s?e.add(this.schedule(null,r)):this.unsubscribe()}),r);if(e.add(a),!s)return a}function Da(e){return function(t){if(function(e){return Gs(null==e?void 0:e.lift)}(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}function Ra(e,t,n,r,s){return new ba(e,t,n,r,s)}var ba=function(e){function t(t,n,r,s,a,o){var i=e.call(this,t)||this;return i.onFinalize=a,i.shouldUnsubscribe=o,i._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,i._error=s?function(e){try{s(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,i._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,i}return ws(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},t}(aa);function va(e,t){return void 0===t&&(t=0),Da((function(n,r){n.subscribe(Ra(r,(function(n){return Pa(r,e,(function(){return r.next(n)}),t)}),(function(){return Pa(r,e,(function(){return r.complete()}),t)}),(function(n){return Pa(r,e,(function(){return r.error(n)}),t)})))}))}function xa(e,t){return void 0===t&&(t=0),Da((function(n,r){r.add(e.schedule((function(){return n.subscribe(r)}),t))}))}function wa(e,t){if(!e)throw new Error("Iterable cannot be null");return new ma((function(n){Pa(n,t,(function(){var r=e[Symbol.asyncIterator]();Pa(n,t,(function(){r.next().then((function(e){e.done?n.complete():n.next(e.value)}))}),0,!0)}))}))}function Ma(e,t){if(null!=e){if(ya(e))return function(e,t){return Na(e).pipe(xa(t),va(t))}(e,t);if(Bs(e))return function(e,t){return new ma((function(n){var r=0;return t.schedule((function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())}))}))}(e,t);if(Ws(e))return function(e,t){return Na(e).pipe(xa(t),va(t))}(e,t);if(Ea(e))return wa(e,t);if(Ca(e))return function(e,t){return new ma((function(n){var r;return Pa(n,t,(function(){r=e[_a](),Pa(n,t,(function(){var e,t,s;try{t=(e=r.next()).value,s=e.done}catch(e){return void n.error(e)}s?n.complete():n.next(t)}),0,!0)})),function(){return Gs(null==r?void 0:r.return)&&r.return()}}))}(e,t);if(Ta(e))return function(e,t){return wa(Sa(e),t)}(e,t)}throw Aa(e)}function La(e,t){return t?Ma(e,t):Na(e)}function Fa(e,t,n){var r=Gs(e)||t||n?{next:e,error:t,complete:n}:e;return r?Da((function(e,t){var n;null===(n=r.subscribe)||void 0===n||n.call(r);var s=!0;e.subscribe(Ra(t,(function(e){var n;null===(n=r.next)||void 0===n||n.call(r,e),t.next(e)}),(function(){var e;s=!1,null===(e=r.complete)||void 0===e||e.call(r),t.complete()}),(function(e){var n;s=!1,null===(n=r.error)||void 0===n||n.call(r,e),t.error(e)}),(function(){var e,t;s&&(null===(e=r.unsubscribe)||void 0===e||e.call(r)),null===(t=r.finalize)||void 0===t||t.call(r)})))})):ga}function Ua(e){return Da((function(t,n){var r,s=null,a=!1;s=t.subscribe(Ra(n,void 0,void 0,(function(o){r=Na(e(o,Ua(e)(t))),s?(s.unsubscribe(),s=null,r.subscribe(n)):a=!0}))),a&&(s.unsubscribe(),s=null,r.subscribe(n))}))}class ja{constructor(e,t,n={}){this.type=e,this.name=t,this.parent=null,this.children=[],this.eventSubscribers=[],this.value="",this.previousValue="|~#-old-#~|",this.props=n,this.references=new Map}addReference(e,t){this.references.set(e,t)}getReference(e){return e?this.references.get(e):void 0}getNode(e,t,n){return this.children.find((r=>r.type===e&&r.name===t&&r.props.index===n))}addNode(e,t,n={}){let r=this.getNode(e,t,n.index);return r?r.props=n:(r=new ja(e,t,n),r.parent=this,this.children.push(r)),r}addEventListener(e){this.eventSubscribers.push(e)}triggerEvent(e,t=!1){this.eventSubscribers.forEach((t=>{t(e)})),!t&&this.parent&&this.parent.triggerEvent(e)}setPreviousDefaultValue(){"|~#-old-#~|"===this.previousValue&&(this.previousValue=this.value)}removeReference(e,t){const n=this.references.get(e);n?.props?.index===t&&this.references.delete(e)}removeChildNode(e){const t=this.children.findIndex((t=>t.name.startsWith(e)));-1!==t&&this.children.splice(t,1)}removeChildren(){this.children.splice(0,this.children.length)}removeNode(e,t){for(let n=this.children.length-1;n>=0;n-=1){const r=this.children[n];if(r.props.index===t&&r.name===e){this.children.splice(n,1);break}}}}const Va=ja;const ka=class{constructor(e,t,n,r={}){this.type=U.CONTEXT_TREE_NODE_TYPES.WHEN,this.subType=e,this.referenceName=t,this.name=n,this.props=r}},$a=/(([^.]+)\[\d+\])/g,Ba=e=>{if((e?.split(".")??[]).length<3)return[e];const t=e?.match($a);if(!t)return[e];let n,r=t[t.length-1];return e=e?.split(r)[0],e=e?.substring(0,e.length-1),[r,n]=r.split("["),n=n?.split("]")[0],[e,r,n]},Ga=(e,t)=>{if(!e.startsWith(t))return-1;const n=e.slice(t.length).match(/\[([0-9]+)\]/);return n?parseInt(n[1],10):-1},{FIELD:Wa,WHEN:Ha,DECLARATIVE_TARGET:qa,PAGELIST:za}=j.CONTEXT_TREE_NODE_TYPES;const Ya=class{constructor(e,t,n={}){this.type=e,this.name=t,this.children=[],this.eventSubscribers=[],this.props=n,this.references=new Map([[Wa,new Map],[Ha,new Map],[qa,new Map]])}addReference(e,t){if(this.references.has(t.type)){const n=this.references.get(t.type);n.set(e,t),this.references.set(t.type,n)}else{if(t.type===za){const n=this.references.get(Wa);n.set(e,t),this.references.set(Wa,n)}}}removePageListNodes(e,t){const n=this.children.filter((t=>t.name.startsWith(e))).filter((n=>{const r=Ga(n.name,e);return-1!==r&&+r>=t}));n.length>0&&n.forEach((e=>{this.removeChildNode(e.name,t)}))}removeChildNode(e,t){const n=this.children.findIndex((t=>t.name.startsWith(e)));if(-1!==n){const[t]=this.children.splice(n,1),r=t?.parent;r?.removeChildNode(e)}const r=this.references.get(Wa),s=this.references.get(qa);[...r.keys(),...s.keys()].filter((t=>t.startsWith(e))).filter((e=>{const[,,n]=Ba(e);return+n>=t})).forEach((e=>{const t=r.get(e),n=t?.parent;n?.removeChildren(),r.delete(e)}))}getReference(e,t){if(this.references.has(t))return this.references.get(t)?.get(e)}getNode(e,t,n){return this.children.find((r=>r.type===e&&r.name===t&&r.props.index===n))}addNode(e,t,n={}){let r=this.getNode(e,t,n.index);return r?r.props=n:(r=new Va(e,t,n),r.parent=this,this.children.push(r)),r}addEventListener(e){this.eventSubscribers.push(e)}triggerEvent(e){this.eventSubscribers.forEach((t=>{t(e)}))}removeReference(e,t,n){const r=this.references.get(t),s=r?.get(e);s?.props?.index===n&&r.delete(e)}removeNode(e,t){for(let n=this.children.length-1;n>=0;n-=1){const r=this.children[n];if(r.props.index===t&&r.name===e){this.children.splice(n,1);break}}}addWhen(e,t,n,r,s){if(!(n&&r&&e&&t))return;n.startsWith(".")&&(n=n.substring(1));const a=`${e}.${n}.${r}`,o=new ka(t,n,r,s),i=this.references.get("WHEN");i?.set(a,o)}},{VIEW:Ka,FIELD:Ja,CONTEXT:Xa,DECLARATIVE_TARGET:Qa,WHEN:Za}=U.CONTEXT_TREE_NODE_TYPES;const eo=new class{constructor(){this.rootNodes={}}_isContextNodeExist(e){return Object.keys(this.rootNodes).includes(e)}addContextNode(e){if(!this._isContextNodeExist(e)){const t=new Ya(Xa,e);this.rootNodes[e]=t}return this.rootNodes[e]}getContextNode(e){return e?this.rootNodes[e]:void 0}addPageNode(e,t){return this.addContextNode(e).addNode("PAGE",t)}_addParentViewNode(e,t,n){const r=this.addContextNode(e).addNode("PAGE",t);let s=r.getReference(n);return s||(s=r.addNode("VIEW",n),r.addReference(n,s)),s}pushChildPageNodeToParentView(e,t,n){const r=e.children;let s=!1;if(r)for(let e=0;e<r.length;e+=1)if(r[e].name===n){s=!0;break}s||r.push(t),t.parent=e}addViewNode(e,t,n,r){const s=this.addContextNode(e).addNode("PAGE",t);let a=null;if(r&&n!==r){a=this._addParentViewNode(e,t,r).addNode("VIEW",n)}else a=s.addNode("VIEW",n);s.addReference(n,a);const o=t.split(".");for(;o.length>0;){o.pop();const n=o.join("."),a=this.getContextNode(e)?.getNode("PAGE",n),i=a?.getReference(r);if(i){this.pushChildPageNodeToParentView(i,s,t);break}}return a}getViewNode(e,t,n){return this.getContextNode(e)?.getNode("PAGE",t)?.getReference(n)}addPageListNode(e,t,n,r,s){if(!r)return;r.startsWith(".")&&(r=r.substring(1));const a=this.addContextNode(e),o=a.addNode("PAGE",t)?.getReference(n)?.addNode("PAGELIST",`${t}.${r}`,s);return o&&a.addReference(`${t}.${r}`,o),o}updatePageListNode(e,t,n,r){if(!n)return;n.startsWith(".")&&(n=n.substring(1));this.addContextNode(e).removePageListNodes(`${t}.${n}`,r)}removeFieldNode(e,t,n,r,s){const a=this.getContextNode(e);a?.getNode("PAGE",t)?.getReference(n)?.removeNode(`${t}${r}`,s),a?.removeReference(`${t}${r}`,Ja,s),a?.removeReference(`${t}${r}`,Qa,s)}removeViewNode(e,t,n,r){const s=this.getContextNode(e),a=s?.getNode("PAGE",t),o=a?.getReference(n);this.removeChildViewNodes(e,t,n,r);const i=o?.parent?.children?.findIndex((e=>e.name===n))??-1;i>-1&&o?.parent?.children.splice(i,1)}removeChildViewNodes(e,t,n,r){const s=this.getContextNode(e),a=s?.getNode("PAGE",t),o=a?.getReference(n);o?.children.forEach((a=>{"PAGE"===a.type?this.removeViewNode(e,a.name,n,r):a.type===Ka?this.removeChildViewNodes(e,t,a.name,r):(s.removeReference(a.name,Ja,a.props.index),s.removeReference(a.name,Qa,a.props.index),"PAGELIST"!==a.type&&"Address"!==a.props?.componentName||this.deleteAllListNodes(e,a.name))})),a?.references.delete(n)}deleteAllListNodes(e,t,n=!0){const r=r=>{const s=this.getContextNode(e),a=s?.references?.get(r);if(a)for(const[e]of a)(n&&e===t||e.startsWith(`${t}.`)||e.startsWith(`${t}[`))&&s?.references?.get(r)?.delete(e)};r(Ja),r(Qa)}deleteListNode(e,t,n){const r=r=>{const s=this.getContextNode(e),a=s?.references?.get(r);if(a)for(const[e]of a)e.includes(`${t.join(".")}[${n}]`)&&s?.references?.get(r)?.delete(e)};r(Ja),r(Qa)}getPageListNode(e,t,n,r){const s=this.getContextNode(e)?.getNode("PAGE",t)?.getReference(n);return s?.children.find((e=>"PAGELIST"===e.type&&e.name===`${t}.${r}`))}getFieldNode(e,t,n,r){return this.getViewNode(e,t,n)?.getNode(Ja,r)}_findViewNode(e,t,n,r){let s=r.addNode("PAGE",t)?.getReference(n);if(s)return s;const a=t.split(".");for(;a.length>0;){a.pop();const e=a.join(".");if(s=r.addNode("PAGE",e)?.getReference(n),s)return s}return this.addViewNode(e,t,n)}addFieldNode(e,t,n,r,s,a={}){const o=this.addContextNode(e),i=this._findViewNode(e,t,n,o),c=this.createFieldNode(i,t,r,a);return c&&this.updateFieldNode(o,i,c,e,t,r,s),c}createFieldNode(e,t,n,r){const{isDeclarativeTarget:s}=r;return s?e.addNode(Qa,`${t}${n}`,r):e.addNode(Ja,`${t}${n}`,r)}updateFieldNode(e,t,n,r,s,a,o){const i=`${s}${a}`;"Address"===n.props?.componentName&&this.deleteAllListNodes(r,n.name),e.addReference(i,n),n.value=o,n.setPreviousDefaultValue(),n.props.isInsideList&&this.handleFieldInsideList(e,t,r,s,a)}handleFieldInsideList(e,t,n,r,s){const a=qp(n),o=yp(a,n)||{},i=`${r}${s}`;let c=null;if(o?.subscriptFieldName||o?.isPageGroup)c=r.substring(0,r.lastIndexOf(`.${o?.index??""}`))||i.substring(0,i.lastIndexOf(`.${o?.index}`)),this.createListNodeIfNotExist(e,t,c);else{const n=r.substring(0,r.lastIndexOf("["))||i.substring(0,i.lastIndexOf("["));this.createListNodeIfNotExist(e,t,n)}}createListNodeIfNotExist(e,t,n){let r=e.getReference(n,Ja);r||(r=t.addNode(Ja,n,{}),e.addReference(n,r))}removeContextTreeNode(e){delete this.rootNodes[e]}onViewMutate(e,t,n,r){this.getViewNode(e,t,n)?.addEventListener(r)}mutateField(e,t,n,r){const s=this.getContextNode(e),[a,o,i]=Ba(t);n.startsWith(".")&&(n=n.substring(1)),o&&this.mutatePageList(e,a,o,{...r,rowIndex:i});const c=s?.getReference(`${t}.${n}`,Ja);c&&c instanceof Va&&c.triggerEvent(r)}onPageListMutate(e,t,n,r,s){this.getPageListNode(e,t,n,r)?.addEventListener(s)}mutatePageList(e,t,n,r,s=!1){const a=this.getContextNode(e),o=a?.getReference(`${t}.${n}`,Ja);o&&o instanceof Va&&o.triggerEvent(r,s)}getFieldsList(e){const t=this.getContextNode(e);return t?.references.get(Ja)}getFieldReferenceForProperty(e,t){let n=this.getContextNode(e)?.references?.get(Ja)?.get(t);return n||(n=this.getContextNode(e)?.references?.get(Qa)?.get(t)),n}getFieldReferencePreviousValue(e,t){let n=this.getContextNode(e)?.references?.get(Ja)?.get(t);return n||(n=this.getContextNode(e)?.references?.get(Qa)?.get(t)),n?.value}updateFieldNodeValue(e,t,n){const r=this.getContextNode(e)?.references?.get(Ja)?.get(t);r instanceof Va&&r&&(r.previousValue=r.value,void 0===r.value&&(r.previousValue=n),r.value=n)}getContextReferences(e){if(!this.getContextNode(e))return;const t=this.getContextReferencesByType(e,Ja),n=this.getContextReferencesByType(e,Qa);return new Map([...t.entries(),...n.entries()])}getContextReferencesByType(e,t){return this.getContextNode(e)?.references.get(t)||new Map}isFieldExists(e,t){return!!this.getContextReferencesByType(e,Ja)?.get(t)||!!this.getContextReferencesByType(e,Qa)?.get(t)}addWhenNode(e,t,n,r,s,a){const o=this.getContextNode(e);o?.addWhen(t,n,r,s,a)}getDeclarativeTargets(e){const t=this.getContextNode(e),n=t?.references?.get(Qa)||new Map,r=[];return n.forEach((e=>{const t=e?.props||{},{propertyName:n=""}=t,s=t.pageReference??U.CASE_INFO.CASE_INFO_CONTENT;r.push({pageReference:s,name:n})})),r}getWhens(e){const t=this.getContextNode(e),n=t?.references?.get(Za)||new Map,r=[];return n.forEach((e=>{const t=e.subType,n=e.referenceName,s=e.name,a=e?.props?.pageReference??U.CASE_INFO.CASE_INFO_CONTENT;r.push({name:s,pageReference:a,referenceName:n,type:t})})),r}},to={CONTENT_FIELDS_PATH:[j.CONTEXT_DATA,j.CASE_INFO.CASE_INFO,j.CONTENT],DATA_OBJECT_CONTENT_FIELDS_PATH:[j.CONTEXT_DATA,j.DATA_INFO.DATA_INFO,j.CONTENT],OBJECT_CONTENT_FIELDS_PATH:[j.CONTEXT_DATA,j.OBJECT_INFO.OBJECT_INFO,j.CONTENT],FIELD_MESSAGES_PATH:[j.CONTEXT_DATA,j.CASE_INFO.CASE_INFO,j.CONTENT,j.SUMMARY_OF_MESSAGES,j.PROPERTY_MESSAGES],DATA_OBJECT_FIELD_MESSAGES_PATH:[j.CONTEXT_DATA,j.DATA_INFO.DATA_INFO,j.CONTENT,j.SUMMARY_OF_MESSAGES,j.PROPERTY_MESSAGES],OBJECT_FIELD_MESSAGES_PATH:[j.CONTEXT_DATA,j.OBJECT_INFO.OBJECT_INFO,j.CONTENT,j.SUMMARY_OF_MESSAGES,j.PROPERTY_MESSAGES],PAGE_MESSAGES_PATH:[j.CONTEXT_DATA,j.SUMMARY_OF_MESSAGES,j.PAGE_MESSAGES],HTTP_MESSAGES_PATH:[j.CONTEXT_DATA,j.SUMMARY_OF_MESSAGES,j.HTTP_MESSAGES],CASE_MESSAGE_PATH:[j.CASEMESSAGES]},no=(e="",t="",n,r)=>{let s=[],a=[];null!==e&&(a=(e=>e?.startsWith(".")?e.substring(1).split("."):e.split("."))(e));const o=t&&t.startsWith(".")?t.substr(1):t;if(n===j.PROPERTY&&e||e){s=[j.CONTEXT_DATA,...o.split(".")];for(let e=0;e<a.length-1;e+=1)s.push(a[e]);s.push(j.SUMMARY_OF_MESSAGES,j.PROPERTY_MESSAGES,a[a.length-1])}else n===U.PAGE?s=[...to.PAGE_MESSAGES_PATH]:n===j.HTTP?s=[...to.HTTP_MESSAGES_PATH]:n===j.CASEMESSAGES?s=[...to.CASE_MESSAGE_PATH]:r&&(s=[j.CONTEXT_DATA,...o.split(".")]);return s.filter(Boolean)},ro=(e,t,n)=>{const r={content:{}},s=`${t.split(".").slice(2).join(".")}[${n}]`,a=jg.getIn(e?.content,s.split("."));return a&&jg.setIn(r.content,s.split("."),{...a}),r},so=(e,t,n,r,s,a,o={})=>{const i=((e,t,n)=>t<n?e.filter((e=>parseInt(e.match(/\d+/)?.[0],10)>t&&parseInt(e.match(/\d+/)?.[0],10)<=n)):e.filter((e=>parseInt(e.match(/\d+/)?.[0],10)<t&&parseInt(e.match(/\d+/)?.[0],10)>=n)))(n,r,s),c=r>s?"up":"down";i&&i?.length>0&&i?.forEach((n=>{const r=parseInt(n.match(/\d+/)?.[0],10),s=`${a}[${r}]`;o[`${a}[${r+("up"===c?1:-1)}]`]=jg.getIn(e[t],[j.CONTEXT_DATA,...s.split(".")]),jg.deleteIn(e[t],[j.CONTEXT_DATA,...s.split(".")])}));const l=Object.keys(o);l.length>0&&l.forEach((n=>{jg.setIn(e[t],[j.CONTEXT_DATA,...n.split(".")],o[n])}))},ao=(e,t,n,r,s)=>{const a=jg.deepClone(jg.getIn(e,[`${t}`])),o=jg.getIn(a,[j.CONTEXT_DATA,j.CASE_INFO.CASE_INFO]);if(!o)return;const i=(e=>{const t=[];let n=0;for(;n<e.length;)n+1<e.length&&!Number.isNaN(parseInt(e[n+1],10))?(t.push(`${e[n]}[${e[n+1]}]`),n+=2):(t.push(e[n]),n+=1);return t.join(".")})(n.split(".")),c=i.substring(0,i.lastIndexOf(".")),l=((e,t,n)=>{const r=jg.getIn(e,[j.CONTEXT_DATA,...n.split(".")],{});return Object.keys(r).filter((e=>e.includes(`${t}[`)))})(a,i.substring(i.lastIndexOf(".")+1),c);if(0===l.length)return;const u=ro(o,i,r).content;if(u&&Object.keys(u).length>0){const n={},o=`${i}[${r}]`,c=jg.getIn(a,[j.CONTEXT_DATA,...o.split(".")]);n[`${i}[${s}]`]=c,jg.deleteIn(e[t],[j.CONTEXT_DATA,...o.split(".")]),so(e,t,l,r,s,i,n)}else so(e,t,l,r,s,i)},oo=e=>{const{type:t,property:n,category:r,context:s,pageReference:a}=e;let o;n&&(o=n.slice(1));const i=Sg(s);let c=[];const l=jg.getIn(i,no(o,a,r));return t&&"all"!==t?(l&&Array.isArray(l)&&l.length>0&&(c=l.filter((e=>e.type===t))),t===U.MESSAGES.MESSAGES_TYPE_ERROR&&c.length>0&&n&&eo.mutateField(s,a,n,{messages:[...c],type:U.MESSAGES.MESSAGES_TYPE_ERROR,fieldName:n}),c):l},io=e=>{const{property:t,pageReference:n,category:r,context:s,type:a,isListEntry:o,clearContextMessages:i,deletingIndex:c}=e,l={context:s,type:a};t&&!o?(eo.mutateField(s,n,t,{type:et,fieldName:t}),l.property=t,l.pageReference=n):o?(l.pageReference=n,l.isListEntry=o,l.deletingIndex=c):l.category=r,Cg(i?{type:et,payload:{stateObj:e.stateObj,context:s}}:{type:et,payload:l})},co=e=>{const{messages:t,property:n,pageReference:r,category:s,context:a}=e,o={messages:t,context:a};n?(o.property=n,o.pageReference=r):o.category=s,Cg({type:Ze,payload:o})},lo=(e,t,n)=>{for(const r of Object.keys(e)){if(t.push(r),r===j.SUMMARY_OF_MESSAGES)n.push([...t]);else{"object"===typeof e[r]&&lo(e[r],t,n)}t.pop()}return n},uo=(e,t)=>{let n=oo({context:j.APP.ROOT,category:"HTTP"});if(Dh.getRenderingMode()===j.EMBED){const e=oo({context:j.APP.APP,category:"HTTP"});e&&(n=n?n.concat(e):e)}if(e){const e=oo({context:t,category:"HTTP"});n?e&&(n=n.concat(oo({context:t,category:"HTTP"}))):n=oo({context:t,category:"HTTP"})}return n},po=e=>{let t=null;t=Mp(e)[0]?Dp(Mp(e)[0]):e,t&&io({context:t,stateObj:Sg(t),clearContextMessages:!0})},ho=e=>(jg.getIn(Sg(e),to.PAGE_MESSAGES_PATH)??[]).some((e=>e.subType===j.CUSTOM_ERROR)),go={addMessages:co,getValidationErrorMessages:(e,t)=>{const n=Sg(e),r=(e=>{let t=to.CONTENT_FIELDS_PATH;e?.objectInfo?t=Rl.isObjectCaseType(e?.objectInfo?.objectTypeID)?to.OBJECT_CONTENT_FIELDS_PATH:t:e?.dataInfo?.content&&(t=to.DATA_OBJECT_CONTENT_FIELDS_PATH);return t})(n),s=jg.getIn(n,[...r])||{},a=[];return lo(s,[],[]).forEach((e=>{const n=jg.getIn(s,[...e,j.PROPERTY_MESSAGES]);n&&Object.keys(n).forEach((e=>{n[e].forEach((e=>{if(e.type===j.MESSAGES.MESSAGES_TYPE_ERROR){const n=t?.getLocalizedMessage(e.message)??e.message;e.fieldLabel?a.push({label:`${e.fieldLabel}:`,description:n}):a.push(n)}}))}))})),a},getMessages:oo,clearMessages:io,getRootContainerHttpMessages:uo,clearContextMessagesInActiveWorkArea:po,clearContextMessages:e=>{const{context:t}=e;Cg({type:et,payload:{clearAll:!0,context:t}})},isCustomPageErrorExist:ho},fo=go;const mo=class{constructor(e,t,n,r){this.eventType=e,this.callback=n,this.contextName=r,this.id=t}};const Io=new class{constructor(){this.subscribers={}}publish(e,t){this.subscribers[e]?.forEach((e=>{e.callback(t)}))}unsubscribe(e,t,n){const r=this.subscribers[e]||[];let s=0,a=-1;r.forEach((e=>{e.id===t&&e.contextName===n&&(a=s),s+=1})),-1!==a&&r.splice(a,1)}unsubscribeAllWithEventType(e){this.subscribers[e]=[]}subscribe(e,t,n,r,s){this.subscribers[e]=this.subscribers[e]||[];let a=!1;if(s&&this.subscribers[e].forEach((e=>{a=e.id===t&&e.contextName===r})),!a){const s=new mo(e,t,n,r);this.subscribers[e].push(s)}}clearContext(e){const t=this.subscribers;Object.keys(t).forEach((t=>{const n=this.subscribers[t],r=[];n.forEach((t=>{t.contextName!==e&&r.push(t)})),this.subscribers[t]=r}))}};const yo=class{static subscribe(e,t,n,r=!1,s="app"){Io.subscribe(e,n,t,s,r)}static subscribeOnce(e,t,n){this.subscribe(e,t,n,!0)}static publish(e,t){Io.publish(e,t)}static unsubscribe(e,t,n="app"){Io.unsubscribe(e,t,n)}static unsubscribeAllWithEventType(e){Io.unsubscribeAllWithEventType(e)}static cleanContextSubscribers(e){Io.clearContext(e)}};const Eo=new class{#e;#t;constructor(){this.#e="true"===localStorage.getItem("inspectorFlag"),this.#t=!1,this.isPreview=!1,this.debugLevels="vcv=1;tracer=0;log=0;metric=1"}toggleXRay(e){console.warn("The toggleXRay method is deprecated. Please use the toggleInspector method going forward."),e&&!this.inspectorEnabled&&this.toggleInspector(),!e&&this.inspectorEnabled&&this.toggleInspector()}get inspectorEnabled(){return this.#e}get inspectorShowAll(){return this.#t}toggleInspector(){const e="true"===localStorage.getItem("inspectorFlag");this.#e=!e,localStorage.setItem("inspectorFlag",this.#e.toString()),yo.publish(j.PUB_SUB_EVENTS.UI_EVENTS.INSPECTOR,this.#e)}toggleInspectorShowAll(){this.#t=!this.#t,yo.publish(j.PUB_SUB_EVENTS.UI_EVENTS.INSPECTOR_SHOW_ALL,this.#t)}setPreviewMode(){this.isPreview=!0}getPreviewMode(){return this.isPreview}enableTracer=()=>{this.debugLevels="vcv=1;tracer=1;log=0;metric=1"};disableTracer=()=>{this.debugLevels="vcv=1;tracer=0;log=0;metric=1"};getDebugLevels=()=>this.debugLevels};class Ao{constructor(e,t=!0){this.config=e,t?(this.ssKeyConfig=e,this.reloadConfig()):this.updateConfig(e,!1)}static init(e,t=!0){return new Ao(e,t)}updateConfig(e,t=!0){t?window.sessionStorage.setItem(this.ssKeyConfig,JSON.stringify(this.config)):Ko(e)}reloadConfig(e=!0){if(e){const e=window.sessionStorage.getItem(this.ssKeyConfig);this.config=e?JSON.parse(e):null}else this.config=Jo()}async buildAuthorizeUrl(e){e=e||window.btoa(window.location.origin);let{sessionIndex:t}=this.config;const{password:n}=this.config,r=this.config.clientId?this.config.clientId:this.config.client_id,s=this.config.redirectUri?this.config.redirectUri:this.config.redirect_uri,a=this.config.authorizeUri?this.config.authorizeUri:this.config.endPoints?.authorize,o=this.config.authService?this.config.authService:this.config.authentication_service||"pega",i=this.config.appAlias?this.config.appAlias:Ph.getApplicationAlias(),c=this.config.userIdentifier?this.config.userIdentifier:this.config.user_identifier;t=t||this.config.tokenInfo?.session_index;let l="";t?l=`&session_index=${t}`:`${c}`?l=`&UserIdentifier=${c}`:n&&(l=`&Password=${window.atob(n)}`);const u=new Uint8Array(64);window.crypto?.getRandomValues(u),this.config.codeVerifier=this.base64UrlSafeEncode(u),this.updateConfig(this.config,!1);const d=i?`+app.alias.${i.replace(/^app\//,"")}`:"";return this.getCodeChallenge(this.config.codeVerifier)?.then((t=>`${a}?client_id=${r}&response_type=code&redirect_uri=${s}&scope=openid${d}&state=${e}&code_challenge=${t}&code_challenge_method=S256&authentication_service=${o}&enable_psyncId=true${l}`))?.catch((()=>null))}getTokenAndFinish=e=>{window.removeEventListener("message",this.authMessageHandler,!1),this.getToken(e,!1).then((()=>{})).catch((e=>{console.log(e)}))};authMessageHandler=e=>{if(e.origin!==this.getRedirectUriOrigin())return;if(!e.data||!e.data.type||"PegaAuth"!==e.data.type)return;const t=e.data.code.toString();this.getTokenAndFinish(t)};getRedirectUriOrigin=()=>{let{redirectUri:e}=this.config;e=e||this.config.redirect_uri||"";const t=e.indexOf("//"),n=e.indexOf("/",t+2);return-1!==n?e.substring(0,n):e};getToken(e,t){this.reloadConfig(t);const n=this.config.clientId?this.config.clientId:this.config.client_id,r=this.config.clientSecret?this.config.clientSecret:this.config.client_secret,s=this.config.redirectUri?this.config.redirectUri:this.config.redirect_uri,a=this.config.tokenUri?this.config.tokenUri:this.config.endPoints?.token,{codeVerifier:o}=this.config,i=window.location.search,c=new URLSearchParams(i),l=e||c.get("code"),u=new URLSearchParams;return n&&u.append("client_id",n),r&&u.append("client_secret",r),u.append("grant_type","authorization_code"),u.append("code",l),s&&u.append("redirect_uri",s),o&&u.append("code_verifier",o),this.config?.secureCookie&&u.append("send_token_as_cookie","true"),Bo(a,{method:"POST",headers:new Headers({"content-type":"application/x-www-form-urlencoded"}),body:u.toString()}).then((e=>e.data)).then((e=>{e.eA=Date.now()+1e3*e.expires_in;let n=!1;if(this.config.codeVerifier&&(delete this.config.codeVerifier,n=!0),e.session_index&&(this.config.session_index=e.session_index,n=!0),n){this.updateConfig(this.config,t),this.config?.secureCookie?zo({pzCTkn:e?.csrf}):(Yo({tokenInfo:e}),zo({Authorization:`${e?.token_type} ${e?.access_token}`}));const{onTokenRetrieval:n}=this.config;n&&"function"==typeof n&&n(e),window.postMessage("oAuthSuccess")}return e})).catch((()=>null))}sha256Hash(e){return window.crypto?.subtle?.digest("SHA-256",(new TextEncoder).encode(e))}encode64(e){return window.btoa(new Uint8Array(e).reduce(((e,t)=>e+String.fromCharCode(t)),""))}base64UrlSafeEncode(e){return this.encode64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}getCodeChallenge(e){return this.sha256Hash(e)?.then((e=>this.base64UrlSafeEncode(e))).catch((e=>{console.log(e)})).finally((()=>null))}}const _o=Ao,Co=async()=>new Promise((async(e,t)=>{const n=Xo();if(!n?.tokenInfo)return void t(new Error("Missing token information."));const{access_token:r,refresh_token:s=null}=n.tokenInfo,{revoke:a}=n.endPoints,{client_id:o,client_secret:i,secureCookie:c,serverType:l}=n,u="launchpad"===l,d={"content-type":"application/x-www-form-urlencoded"};i&&!u&&(d.authorization=`Basic ${window.btoa(`${o}:${i}`)}`);const p=new URLSearchParams;i?u&&(p.append("client_id",o),p.append("client_secret",i)):p.append("client_id",o),c&&p.append("send_token_as_cookie","true");const h=s?"refresh_token":"access_token",g="access_token"===h?r:s;!c&&g&&p.append("token",g),p.append("token_type_hint",h),a&&await Bo(a,{method:"POST",headers:new Headers(d),credentials:c?"include":"omit",body:p.toString(),withoutDefaultHeaders:!0}),zo({Authorization:null}),Yo({tokenInfo:null}),e()})),So=async e=>{const t={};if("OAuth2.0"===e?.authType){const n=new _o(e,!1);t.reauthUrl=await n.buildAuthorizeUrl(),t.redirectOrigin=n.getRedirectUriOrigin(),window.addEventListener("message",n.authMessageHandler,!1)}else t.reauthUrl=E()+(y()?`${y()}`:"/?reAuth=true");return t},To=(e,t)=>{So(t).then((t=>{const n={openReauthMessageModal:!0,reAuthenticationURL:t.reauthUrl,url:e,redirectOrigin:t.redirectOrigin};yo.publish(U.PUB_SUB_EVENTS.EVENT_REAUTH,n)}))},No=e=>{let t="",n={},r={},s=!0;if("OAuth2.0"===e?.authType){t=e.endPoints.token;const a=new URLSearchParams;(!e.tokenInfo.refresh_token||e.tokenInfo.refresh_token&&e.tokenInfo.refresh_token.length<=0)&&(s=!1),a.append("client_id",e.client_id),a.append("grant_type","refresh_token"),e.clientSecret&&a.append("client_secret",e.clientSecret),e.secureCookie&&a.append("send_token_as_cookie","true"),e.tokenInfo?.refresh_token&&a.append("refresh_token",e.tokenInfo.refresh_token),n={method:"POST",body:a.toString(),headers:{"content-type":"application/x-www-form-urlencoded"}},r={success:t=>{const{data:n}=t,r={access_token:n?.access_token,refresh_token:n?.refresh_token};Yo({tokenInfo:{...e.tokenInfo,...r}}),e.secureCookie?zo({pzCTkn:n?.csrf}):zo({Authorization:`${n?.token_type} ${n?.access_token}`});const{onTokenRetrieval:s}=e;s&&"function"==typeof s&&s(n)},failure:t=>{if(e.popupReauth)return To(t,e);yo.publish(U.PUB_SUB_EVENTS.EVENT_FULL_REAUTH,e)}}}else t=`${E()}/updateSession`,n={method:"GET",headers:{}},r={failure:To};return{url:t,config:n,callback:r,isRefreshTokenPresent:s}},Oo=(e,t)=>"OAuth2.0"===t?.authType?e?.includes(t.endPoints.token):e?.includes("updateSession"),Po=e=>{const{config:t}=e,n=t.headers&&t.headers.context;return t.data&&(t.body=t.data),{url:t.url,config:t,context:n}},Do=(e,t,n)=>{const{config:r}=e,{url:s,config:a,callback:o,isRefreshTokenPresent:i}=No(n),c=r.headers&&r.headers.context;r.data&&(r.body=r.data);const l=Go(r.url,r,c,t);return i?Bo(s,a).then((e=>(t.setUpdateSessionStatus(!1),o?.success?.(e,r),yo.publish("updateSession",{updateStatus:"success"}),yo.publish("OnUpdateSession",{}),l.then((e=>Promise.resolve(e))).catch((e=>Promise.reject(e)))))).catch((e=>e&&e.config&&Oo(e.config.url,n)?(o?.failure?.(r.url,n),l):Promise.reject(e))):(o?.failure?.(r.url,n),l)},Ro=(e,t,n,r)=>{if(e.config&&Oo(e.config.url,n))return Promise.reject(e);if(e.response&&e.response.status&&401===e.response.status&&!t.getUpdateSessionStatus()){if(yo.unsubscribeAllWithEventType(wo),t.setUpdateSessionStatus(!0),"custom"===n?.authType){yo.publish(U.PUB_SUB_EVENTS.EVENT_CUSTOM_REAUTH);const{url:n,config:r,context:s}=Po(e);return Go(n,r,s,t)}return Do(e,t,n)}if(e.response&&e.response.status&&401===e.response.status&&t.getUpdateSessionStatus()){const{url:t,config:n,context:r}=Po(e);return Bo(t,n,r)}if(e.response&&e.response.status&&422!==e.response.status&&424!==e.response.status&&e.config.headers.context&&e.response.data&&!r){const t=e.response.data.errorDetails&&e.response.data.errorDetails.map((t=>((e,t)=>t[U.TRACE_ID]?{type:"error",message:e.localizedValue||e.message,correlationID:t[U.TRACE_ID]}:{type:"error",message:e.localizedValue||e.message})(t,e.response.headers))),n=e.config.headers.context;return co({messages:t,category:"HTTP",context:n}),Promise.reject(e)}return Promise.reject(e)};const bo=class{constructor(){this.updateSessionInProgress=!1}getUpdateSessionStatus=()=>this.updateSessionInProgress;setUpdateSessionStatus=e=>{this.updateSessionInProgress=e}};const vo=new class{constructor(){this.externalHeaders={},this.defaultHeaders={},this.SPECIAL_CHARS={SLASH:"/"}}registerHeader(e,t){return!this.defaultHeaders[e]&&(this.externalHeaders[e]=t,!0)}unRegisterHeader(e){this.externalHeaders[e]&&delete this.externalHeaders[e]}getRegisteredHeaders(){return this.externalHeaders}setDefaultHeaders(e){this.defaultHeaders={...this.defaultHeaders,...e}}getDefaultHeaders(){return this.defaultHeaders}addDebugHeaders(e={}){return{[j.COREHEADER_APP_DEBUG_ID]:e.debugId,[j.COREHEADER_APP_DEBUG_LEVELS]:Eo.getDebugLevels()}}getCoreHeadersFromContext(e){if(["root","app"].includes(e)||!e)return;const t=Bg.getProperty(j.COREHEADERS,"",e);return t?{...t,debugInfo:Eo.getPreviewMode()&&{...t.debugInfo,[j.COREHEADER_APP_DEBUG_LEVELS]:Eo.getDebugLevels()}}:(e=e.substr(0,e.lastIndexOf(this.SPECIAL_CHARS.SLASH)),this.getCoreHeadersFromContext(e))}processCoreHeaders(e,t,n){const r=this.getCoreHeadersFromContext(n);if(r){const t=Object.keys(e);if(t.includes(j.SKIPCOREHEADERS))return void delete e[j.SKIPCOREHEADERS];const n=Object.assign({},...Object.values(r));Object.keys({...n}).forEach((r=>{t.includes(r)||(e[r]=n[r])}))}}injectCoreAdditionalHeaders(e,t,n,r){r?.includeRemoteSystemIdIfPresent&&$.injectRemoteCaseHeader(e,t,n),this.processCoreHeaders(e,t,n)}},xo=vo;const wo="updateSession",Mo={},Lo=new bo,Fo=new class{constructor(){this.timerID=void 0,this.expiryBuffer=45,this.timeoutWarned=!1}setTimerID=e=>{this.timerID=e};getTimerID=()=>this.timerID;resetInactiveTimeout=e=>{const t=window.PCore?.getEnvironmentInfo().getInactivityTimeout();if(this.timeoutWarned&&(yo.unsubscribe(U.PUB_SUB_EVENTS.RESET_TIMER,"resetCallback"),this.timeoutWarned=!1),t)return e&&clearTimeout(e),this.startInactivityTimeout(t>60?t:60)};startInactivityTimeout=e=>{const t=setTimeout((()=>{yo.publish(U.PUB_SUB_EVENTS.TIMEOUT_REMINDER,{timeRemaining:this.expiryBuffer}),clearTimeout(t),yo.subscribe(U.PUB_SUB_EVENTS.RESET_TIMER,this.resetInactiveTimeout,"resetCallback"),this.timeoutWarned=!0}),1e3*(e-this.expiryBuffer));return this.setTimerID(t),t}};let Uo={},jo={},Vo={},ko="";const $o=e=>{Uo=e},Bo=(e,t,n="root",r={})=>{const{doNotMergeHttpMessagesForStatusCode:s=null,cancelContext:a=n,includeRemoteSystemIdIfPresent:o=!0}=r;ko=s,null===e&&window.console.error("Error: url passed to Service Broker fetch is null (or) undefined");const{body:i,signal:c,withoutDefaultHeaders:l=!1,...u}=t,{Authorization:d,pzCTkn:p,...h}=t.headers||{};l||xo.injectCoreAdditionalHeaders(h,t.body,n,{includeRemoteSystemIdIfPresent:o}),a&&Mo[a]>=0?Mo[a]+=1:a&&void 0===Mo[a]&&(Mo[a]=1);let g=l?{...h}:{...xo.getDefaultHeaders(),...xo.getRegisteredHeaders(),...h,context:n};if(e&&Oo(e,jo)&&Lo.getUpdateSessionStatus()||!Lo.getUpdateSessionStatus()){Oo(e,jo)&&"OAuth2.0"===jo?.authType&&(g={...h});const{restApi:t}=Ph.doesRestApiExist("Logout")&&Ph.getRestEndPoint("Logout")||{restApi:null};return(!t||e&&!e.endsWith(t))&&Fo.setTimerID(Fo.resetInactiveTimeout(Fo.getTimerID())),function(e,t){var n="object"==typeof t;return new Promise((function(r,s){var a,o=!1;e.subscribe({next:function(e){a=e,o=!0},error:s,complete:function(){o?r(a):n?r(t.defaultValue):s(new vs)}})}))}(La(Rs({context:n,...u,url:e,data:i,...c&&void 0===c.aborted&&{cancelToken:c},...c&&void 0!==c.aborted&&{signal:c},headers:g,withCredentials:(f=jo,!("OAuth2.0"!==f?.authType||!f.secureCookie)||!("custom"!==f?.authType||!f.customCookies)||void 0)})).pipe(Fa((()=>{const e=xo.getCoreHeadersFromContext(g.context);e&&(e=>{yo.publish(j.PUB_SUB_EVENTS.FETCH_SUCCESS,e)})({...e})})),Ua((e=>{const t=g,n=!!t?.[j.COREHEADER_APP_DEBUG_ID]?{debugInfo:{[j.COREHEADER_APP_DEBUG_ID]:t?.[j.COREHEADER_APP_DEBUG_ID],[j.COREHEADER_APP_DEBUG_LEVELS]:Eo.getDebugLevels()}}:xo.getCoreHeadersFromContext(g.context);throw n&&(e=>{yo.publish(j.PUB_SUB_EVENTS.FETCH_FAILURE,e)})({...n,error:e}),e}))))}var f;return Go(e,t,n,Lo)},Go=(e,t,n,r)=>new Promise(((s,a)=>{yo.subscribe(wo,(o=>{r.setUpdateSessionStatus(!o.updateStatus),"success"===o.updateStatus?Bo(e,t,n).then((e=>s(e))).catch((e=>a(e))):a(o.updateStatus.error)}),wo)})),Wo=e=>{Mo[e]>0&&(Mo[e]-=1,0===Mo[e]&&delete Mo[e])};Rs.interceptors.request.use((e=>(Uo.request&&(e=Uo.request(e)),e)),(e=>Promise.reject(e))),Rs.interceptors.response.use((e=>{if(202===e.status&&e.config.headers.context&&e.data?.caseInfo?.errorMessage){const t=[{type:"error",message:e.data.caseInfo.errorMessage}];let n=e.config.headers.context;return n&&n.includes("/workarea")&&(n=n.substring(0,n.lastIndexOf("/workarea"))),co({messages:t,category:"HTTP",context:n}),Promise.reject(e)}return e.config.headers&&e.config.headers.context&&(e.config.skipClearErrorMessages||(oo({type:"error",category:"HTTP",context:e.config.headers.context}).length>0&&io({type:"error",category:"HTTP",context:e.config.headers.context}),oo({type:"error",category:e.config.headers.context===j.APP.APP?"PAGE":"",context:e.config.headers.context}).length>0&&io({type:"error",category:"PAGE",context:e.config.headers.context})),Wo(e.config.headers.context)),Uo.response&&(e=Uo.response(e)),e}),(e=>(e.config&&e.config.headers&&e.config.headers.context&&Wo(e.config.headers.context),!e.response||!e.response.status||401!==e.response.status||e.config&&Oo(e.config.url,jo)||yo.subscribe(wo,(e=>{Lo.setUpdateSessionStatus(!e.updateStatus)}),wo),Ro(e,Lo,jo,e.response&&e.response.status&&e.response.status===Number(ko)?ko:null))));const Ho=()=>Rs.CancelToken.source(),qo=e=>Rs.isCancel(e),zo=e=>{xo.setDefaultHeaders(e)},Yo=e=>{jo={...jo,...e}},Ko=e=>{Vo={...Vo,...e}},Jo=()=>({...Vo}),Xo=()=>({...jo});const Qo=class{static formatPageReference(e){const t=e?.split(".").map((e=>{if(e.includes("[")){const t=e.indexOf("["),n=e.indexOf("]"),r=e.substring(t+1,n),s=Number(r)+1;return`${e.substring(0,t)}(${s})${e.substring(n+1)}`}return e}));return t.join(".")}static formatePageReferenceToArrayIndex(e){const t=e?.split(".").map((e=>{if(e.includes("(")){const t=e.indexOf("("),n=e.indexOf(")"),r=e.substring(t+1,n),s=Number(r);if(!Number.isNaN(s)){const r=s-1;return`${e.substring(0,t)}[${r}]${e.substring(n+1)}`}}return e}));return t.join(".")}static getFieldLabel(e){let t=e?.label;if(!t&&e?.inheritedProps){const n=e?.inheritedProps;(n.showLabel??1)&&(t=n.label)}return t}};const Zo=class{static execute(e,t,n,r){const s={};Object.hasOwn(n,"nonFormProperties")&&(n.nonFormProperties.forEach((e=>{s[e]=n[e],delete n[e]})),delete n.nonFormProperties);const a={instruction:"string"==typeof t?"ADD":"INSERT",content:{...jg.unflatten(n)}},o=JSON.parse(JSON.stringify(a));delete o.content.classID;return{instruction:{target:jg.buildInstructionPageReference(r,e),content:{...o.content},["string"==typeof t?"groupIndex":"listIndex"]:t,instruction:"string"==typeof t?"ADD":"INSERT"},actionPayload:a,displayPropertPayload:s}}};const ei=class{static execute(e,t,n,r,s,a,o,i){const c={instruction:"UPDATE",content:{...jg.unflatten(r)},isDefault:i},l={content:{...c.content},target:jg.buildInstructionPageReference(s,t),["string"==typeof n?"groupIndex":"listIndex"]:n,instruction:"UPDATE"};return a||Cg(Of({...c,["string"==typeof n?"groupIndex":"listIndex"]:"string"==typeof n?n:n-1,context:e,referenceList:`${s}${t}`,skipDirtyValidation:o})),l}};const ti=class{static execute(e,t,n){return{target:jg.buildInstructionPageReference(n,e),["string"==typeof t?"groupIndex":"listIndex"]:t,instruction:"DELETE"}}};const ni=class{static getDeleteAllInstruction(e,t){return{instruction:"DELETE ALL",target:jg.buildInstructionPageReference(e,t)}}static execute(e,t,n,r){r||Cg(Of({instruction:"DESELECT_ALL",context:e,referenceList:`${n}${t}`}))}};const ri=class{static execute(e,t,n,r){return{target:jg.buildInstructionPageReference(r,e),listMoveToIndex:n,listIndex:t,instruction:"MOVE"}}};const si=class{static execute(e,t,n){const r={instruction:"REPLACE",content:{...jg.unflatten(t)}};return{instruction:{target:jg.buildInstructionPageReference(n,e),content:{...r.content},instruction:"REPLACE"},actionPayload:r}}};const ai=class{static execute(e,t){return{target:jg.buildInstructionPageReference(t,e),instruction:"DELETE"}}};const oi=class{constructor(e){this.next=null,this.automatic=!1,this.instruction=e,this.previous=null,this.childrenStateMachines=[]}};const ii=class{constructor(e,t,n){this.target=e,this.pageReference=t,this.contextName=n,this.root=null,this.current=null,this.changeList={},this.targetPageReference=t+e,this.children=[],this.visibility=!0}addChild(e){null===this.current&&this.insertNode({}),this.current.childrenStateMachines.push(e)}insertNode(e){const t=new oi(e);null===this.root&&(this.root=t),null!==this.current&&(t.previous=this.current,this.current.next=t),this.current=t}buildChildSumbitPageInstructions(e,t){let n=[];return e.childrenStateMachines.forEach((e=>{e.visibility&&(n=n.concat(e.buildSubmitPageInstructions(t)))})),n}buildSubmitPageInstructions(e=!1){let t=this.root,n=[];for(;t;)!t.instruction.instruction||e&&t.automatic||n.push(t.instruction),n=[...n,...this.buildChildSumbitPageInstructions(t,e)],t=t.next;return n}initPageInstructions(e,t,n){const r=e.getValue(this.target)||[];if(Array.isArray(r)){if(t)return void r.forEach(((e,r)=>{t.forEach((t=>{const s=Il(t),a={};let o=!0;n&&(a[Il(n)]=crypto.randomUUID(),o=!1);const i={[s]:jg.getIn(e,s),...a};this.update(i,r+1,o,{isDefault:!0,skipDirtyValidation:!0})}))}));r.forEach(((e,t)=>{if(n&&!e[Il(n)]){const e={};e[Il(n)]=crypto.randomUUID(),this.update(e,t+1,!1,{isDefault:!0,skipDirtyValidation:!0})}}))}t&&r&&"object"==typeof r&&!Array.isArray(r)&&Object.keys(r).length>0&&this.processObjectRows(r,t,n)}processObjectRows(e,t,n){Object.keys(e).forEach((r=>{const s=e[r];t.forEach((e=>{const t=Il(e),a={};let o=!0;n&&(a[Il(n)]=crypto.randomUUID(),o=!1);const i={[`${t}`]:jg.getIn(s,t),...a};this.update(i,r,o,{isDefault:!0})}))}))}getChangeList(){return this.changeList}initChangeList(e){this.changeList[this.targetPageReference]=this.changeList[this.targetPageReference]||[],this.changeList[this.targetPageReference][e]=this.changeList[this.targetPageReference][e]||{}}update(e,t,n,r){const{isDefault:s=!1,skipPageinstruction:a,skipDirtyValidation:o=!1}=r,i=ei.execute(this.contextName,this.target,t,e,this.pageReference,n,o,s);if(!a){if("string"==typeof t?this.initChangeList(t):this.initChangeList(t-1),!s){const n=this.changeList?.[this.targetPageReference]?.["string"==typeof t?t:t-1].content;this.changeList[this.targetPageReference]["string"==typeof t?t:t-1]=xg(jg.deepClone(n),e,r)}if(this.current?.automatic!==s||this.current?.instruction?.groupIndex!==t&&this.current?.instruction?.listIndex!==t||"UPDATE"!==this.current?.instruction.instruction)this.insertNode(i),s&&(this.current.automatic=!0);else{const t=this.current.instruction.content;this.current.instruction.content=xg(jg.deepClone(t),jg.unflatten(e),r)}}}delete(e,t){const n=ti.execute(this.target,e,this.pageReference);this.changeList[this.targetPageReference]?.splice(e-1,1),this.insertNode(n),t||Cg(Of({instruction:"DELETE",listIndex:"string"==typeof e?e:e-1,context:this.contextName,referenceList:`${this.pageReference}${this.target}`}))}insert(e,t,n,r){const{instruction:s,actionPayload:a={content:{}},displayPropertPayload:o={}}=Zo.execute(this.target,t,e,this.pageReference),{isDefault:i=!1}=r;if(this.initChangeList("string"==typeof t?t:t-1),!i){const n=this.changeList?.[this.targetPageReference]?.["string"==typeof t?t:t-1].content;this.changeList[this.targetPageReference]["string"==typeof t?t:t-1]=xg(jg.deepClone(n),e,r)}this.root&&!this.root.instruction?.instruction&&this.current&&!this.current.instruction?.instruction?this.root.instruction=s:this.insertNode(s),n||(a.content={...a.content,...o},Cg(Of({...a,["string"==typeof t?"groupIndex":"listIndex"]:"string"==typeof t?t:t-1,c11nEnv:r.c11nEnv,context:this.contextName,referenceList:`${this.pageReference}${this.target}`}))),i&&(this.current.automatic=!0)}replacePage(e,t){const{instruction:n,actionPayload:r}=si.execute(this.target,e,this.pageReference);this.insertNode(n),t||Cg(Of({...r,context:this.contextName,referenceList:`${this.pageReference}${this.target}`}))}deletePage(e){const t=ai.execute(this.target,this.pageReference);this.insertNode(t),e||Cg(Of({instruction:"DELETEPAGE",context:this.contextName,referenceList:`${this.pageReference}${this.target}`}))}move(e,t){const n=this.changeList[this.targetPageReference]?.splice(e-1,1);this.changeList[this.targetPageReference]?.splice(t-1,0,n[0]);const r=ri.execute(this.target,e,t,this.pageReference);this.insertNode(r),Cg(Of({listIndex:e-1,listMoveToIndex:t-1,context:this.contextName,referenceList:`${this.pageReference}${this.target}`,instruction:"MOVE"}))}deleteAll(e){const t=ni.getDeleteAllInstruction(this.pageReference,this.target);this.changeList[this.targetPageReference]=[],this.insertNode(t),ni.execute(this.contextName,this.target,this.pageReference,e)}updatePage(e){const t=this.current.instruction.content;this.current.instruction.content=xg(jg.deepClone(t),e)}},ci={},li={},ui={},di=(e,t,n)=>{ci[e]||(ci[e]={}),ci[e][t]||(ci[e][t]={content:[]}),li[e]||(li[e]=[],ui[e]=[]),fl.isStateMachineExist(e,n,t)||fl.setStateMachine(e,t,n,new ii(t,n,e))},pi=e=>Qo.formatPageReference(e),hi=(e,t)=>{const n=li[e],r=ui[e],s=Il(t),a=s?.substring(0,s.indexOf("["));r?.indexOf(a)<0&&ui[e].push(a),n?.indexOf(s)<0&&li[e].push(s)},gi=e=>{delete li[e]},fi=e=>fl.buildPageInstructionsByContext(e),mi=e=>{fl.clearStateMachines(e),delete ci[e]},Ii=(e,t,n,r)=>{let[,s]=t.split(`${e}[${r}]`);""!==s&&void 0!==s&&(s=s.startsWith(".")?s.substring(1):s,Object.keys(n).forEach((e=>{n[`${s}.${e}`]=n[e],delete n[e]})))},yi=(e,t,n,r,s)=>{const{skipStateUpdate:a=!1,insertIfEmpty:o=!1}=s||{},i=n.getContextName(),c=n.getReferenceList(),l=r||n.getPageReference(),u=pi(c);di(i,u,l),hi(i,`${c}[${t}]`),Ii(c,l,e,t);const d={instruction:j.LIST_ACTIONS.INSERT,content:{...jg.unflatten(e)}};delete JSON.parse(JSON.stringify(d)).content.classID;const p=fl.getStateMachine(i,l,u);o&&p?.root||p.insert(e,t+1,a,{c11nEnv:n})},Ei=(e,t,n=0,r={})=>{const{skipStateUpdate:s=!0,pageRef:a}=r,o=t.getContextName();let i=t.getReferenceList();const c=a||t.getPageReference();i||(i=((e,t)=>{const n=e.indexOf(U.CONTENT)+U.CONTENT.length,r=e.lastIndexOf(`[${t}]`);return e.substring(n,r)})(c,n));const l=pi(i);di(o,l,c),hi(o,`${i}[${n}]`),Ii(i,c,e,n);fl.getStateMachine(o,c,l).update(e,n+1,s,r)},Ai=(e,t)=>{const[,n]=e.split("."),r=t?.split(".").pop();return n===r},_i=(e,t,n)=>{const r={};return Object.values(e).forEach((e=>{if(Ai(e,n)){const n=jg.getPropertyName(e),s=n.substr(n.indexOf(".")+1).split(".");if(s.length>1){let e=jg.getIn(t,s)??"";if(!e){const n=`!P!${s.join(":")}`;e=jg.getIn(t,n)??""}jg.setIn(r,s,e)}else{const e=jg.getIn(t,s)??"";r[s[s.length-1]]=e}}})),r},Ci=(e,t,n,r,s)=>{const a=e.getValue(t)||{};n&&Object.keys(a).length>0&&e.clearErrorMessages({property:r?s:e.getStateProps().value})},Si=(e,t,n)=>new Promise((r=>{const{skipPageInstructions:s=!1}=n,{selectionMode:a,selectionList:o,required:i}=t.getConfigProps(),c=a===j.LIST_SELECTION_MODE.MULTI,l=t.getContextName();let u=t.getPageReference(),d=((e,t,n)=>e?n.substring(1):t.substring(t.lastIndexOf(".")+1))(c,u,o);const p=t.getRawMetadata();let h=null;const g=(e=>e?.config?.dataRelationshipContext&&"SimpleTableSelect"===e.type&&"single"===e.config?.selectionMode)(p);g&&(d=p?.config?.dataRelationshipContext,h=u.concat(".").concat(d),u=h);const f=((e,t,n)=>e?`${t}${n}`:t)(c,u,o),m=((e,t,n,r)=>t?e.getFieldMetadata(`${n}`):e.getCurrentPageFieldMetadata(r))(t,c,d,h),{datasource:{parameters:I={}}}=m,y={...I};if(((e,t,n)=>{t?.descriptors?.length&&!n&&t.descriptors.forEach((t=>{const n=jg.getPropertyName(t),r=n.substr(n.indexOf(".")+1).split(".");e[r.join(".")]=t}))})(y,m,c),c){let n=o;n=pi(n);const r=t.getValue(f)||[];di(t.getContextName(),n,u);const a=[];let i=r.length;e.forEach((e=>{const t=_i(I,e,d),o={};if(Object.hasOwn(e,"displayProperty")){const t=e.displayProperty;o[t]=e[t]}const c=Object.entries(t);let p=r.findIndex((e=>c.every((([t,n])=>e[t]===n))));if(-1===p?(p=i,e.$selected&&(i+=1)):i=i?i-1:0,!s){const r=fl.getStateMachine(l,u,n);e.$selected?r.insert(t,p+1,!0,{}):r.delete(p+1,!0)}a.push({instruction:e.$selected?j.LIST_ACTIONS.SELECT:j.LIST_ACTIONS.DESELECT,listIndex:p,content:{...t,...o}})})),Cg(Of({instruction:j.LIST_ACTIONS_TYPE.SELECT_DESELECT,context:l,referenceList:`${u}.${d}`,actions:a}))}else{const n=_i(y,e[0],d);Object.keys(n).forEach((e=>{t.getActionsApi().updateFieldValue(`.${e}`,n[e],g?{contextPageReference:u}:{}),t.getActionsApi().triggerFieldChange(`.${d}.${e}`,n[e])}))}Ci(t,f,i,c,d),r()})),Ti=e=>{if(!e)return!1;const t=(n=e,fl.buildPageInstructionsByContext(n,!0));var n;return Array.isArray(t)&&t.length>0};const Ni=(e,t,n={})=>{const{skipStateUpdate:r=!1}=n,s=e.getPageReference(),a=pi(t);di(e.getContextName(),t,s);fl.getStateMachine(e.getContextName(),s,a).deleteAll(r)},Oi=e=>({insert:(t,n,r,s)=>yi(t,n,e,r,s),update:(t,n,r)=>Ei(t,e,n,r),updateProperty:(t,n,r)=>((e,t,n,r={})=>{const s=n.getPageReference(),{stateMachineTarget:a}=fl.getStateMachineObjByPath(`${s}${e}`,n.getContextName(),`${s}${e}`.endsWith("]"));if(!a){let e=s.substring(0,s.lastIndexOf("["));e||(e=s.substring(0,s.lastIndexOf(".")));const t=e.substring(e.lastIndexOf("."));e=e.substring(0,e.lastIndexOf(".")),e&&t&&di(n.getContextName(),t,e)}fl.executeStateMachine(n.getContextName(),`${s}${e}`,t,!0,r)})(t,n,e,r),deleteEntry:(t,n,r)=>((e,t,n,r)=>{const{skipStateUpdate:s=!1}=r||{},a=t.getContextName(),o=t.getReferenceList(),i=n||t.getPageReference(),c=`${i+o}[${e}]`,l=pi(o);io({type:U.MESSAGES.MESSAGES_TYPE_ERROR,pageReference:c,context:a,isListEntry:!0,deletingIndex:e}),di(a,l,i),hi(a,`${o}[${e}]`);const u=fl.getStateMachine(a,i,l);"string"==typeof e?u.delete(e,s):u.delete(e+1,s);const d=fl.getUnConnectedStateMachines(a)||{};Object.keys(d).forEach((e=>{e.includes(`${i}${l}`)&&e!==`${i}${l}`&&(d[e]=null)}))})(t,e,n,r),reorder:(t,n)=>((e,t,n)=>{const r=n.getContextName(),s=n.getReferenceList(),a=n.getPageReference(),o=pi(s);di(r,o,a),eo.deleteAllListNodes(r,`${a}${o}`,!1),hi(r,`${s}[${t}]`),fl.getStateMachine(r,a,o).move(e+1,t+1);const i=fl.getUnConnectedStateMachines(r)||{};Object.keys(i)?.forEach((e=>{e.includes(`${a}${o}`)&&e!==`${a}${o}`&&delete i[e]}))})(t,n,e),setSelectedRows:(t,n={skipPageInstructions:!1})=>Si(t,e,n),getSelectedRows:(t=!1)=>((e,t)=>{const{selectionMode:n,selectionList:r}=t.getConfigProps(),s=[];let a=t.getPageReference();const o=n===j.LIST_SELECTION_MODE.MULTI;let i=o?r.substring(1):a.substring(a.lastIndexOf(".")+1);const c=t.getRawMetadata();let l=null;c?.config?.dataRelationshipContext&&"SimpleTableSelect"===c.type&&"single"===c.config?.selectionMode&&(i=c.config.dataRelationshipContext,l=a.concat(".").concat(i),a=l);const u=o?`${a}${r}`:a;let d=t.getValue(u)||[];if(Array.isArray(d)||(d=[d]),e)return Promise.resolve(d);const{datasource:{parameters:p={}}={}}=o?t.getFieldMetadata(`${i}`):t.getCurrentPageFieldMetadata(l);return d.forEach((e=>{const t=Object.values(p).reduce(((t,n)=>{const r=n.substring(n.lastIndexOf(".")+1);return Ai(n,i)&&e[r]?`${t}${e[r]}`:t}),"");t.trim()&&s.push(t.trim())})),Promise.resolve(s)})(t,e),clearSelectedRows:()=>function(e){const{selectionList:t,required:n}=e.getConfigProps(),r=e.getContextName(),s=e.getPageReference(),a=t,o=`${s}${t}`;return new Promise((t=>{let i=a;i=pi(i),di(r,i,s),fl.getStateMachine(r,s,i).deleteAll(),Ci(e,o,n,!0,a),t()}))}(e),setVisibility:t=>((e,t=!0)=>{const n=e.getContextName(),{selectionMode:r,selectionList:s,renderMode:a,referenceList:o}=e.getComponentConfig();let i;if(r===j.LIST_SELECTION_MODE.MULTI&&s?i=s:"Editable"===a&&o&&(i=e.getStateProps().referenceList),i){i=pi(i);const r=fl.getStateMachine(n,"",`${e.getPageReference()}${i}`);r&&(r.visibility=t)}})(e,t),initDefaultPageInstructions:(t,n,r)=>((e,t,n,r)=>{const s=e.getContextName(),a=e.getPageReference(),o=pi(t);di(s,o,a),fl.getStateMachine(s,a,o).initPageInstructions(e,n,r)})(e,t,n,r),deleteAll:(t,n)=>Ni(e,t,n),replacePage:(t,n,r)=>((e,t,n,r)=>{const{skipStateUpdate:s=!1}=r||{},a=e.getPageReference(),o=e.getContextName();di(o,t,a),hi(o,jg.buildInstructionPageReference(a,t)),fl.getStateMachine(o,a,t).replacePage(n,s)})(e,t,n,r),deletePage:(t,n)=>((e,t,n)=>{const{skipStateUpdate:r=!1}=n||{},s=e.getPageReference(),a=e.getContextName();di(a,t,s),hi(a,jg.buildInstructionPageReference(s,t)),fl.getStateMachine(a,s,t).deletePage(r)})(e,t,n)});const Pi=new class{constructor(){this.fieldDefaults={}}updateFieldDefaults(e){e&&(Object.keys(this.fieldDefaults).length?jg.mergeDeep(e,this.fieldDefaults):jg.copy(e,this.fieldDefaults))}setFieldDefault(e,t,n){e&&t&&(this.fieldDefaults[e]=this.fieldDefaults[e]||{},"object"==typeof this.fieldDefaults[e]&&null!==this.fieldDefaults[e]&&(this.fieldDefaults[e][t]=n))}getDefaultsforType(e){return this.fieldDefaults[e]}},Di="downloadAttachment",Ri={},bi=e=>{const t=Ho();return Ri[e]=t,t},vi=e=>{let t="document-doc";if(!e)return t;if(e.startsWith("audio"))t="audio";else if(e.startsWith("video"))t="video";else if(e.startsWith("image"))t="picture";else if(e.includes("pdf"))t="document-pdf";else{const[,n]=e.split("/"),r=e=>e.some((e=>n.includes(e)));r(["excel","spreadsheet"])?t="document-xls":r(["zip","compressed","gzip","rar","tar"])&&(t="document-compress")}return t},xi=e=>{let t,n,r,s;return t=e.pyCategoryLabel?`${e.pyCategoryLabel},`:e.pyCategoryName?`${e.pyCategoryName},`:e.Category,n=e.pxCreateOpName?e.pxCreateOpName:e.pxCreateOperator?e.pxCreateOperator:e.CreateUser?.Name||"",r=e.pyFileName?e.pyFileName:e.FileExtension&&""!==e.FileExtension&&e.FileName.endsWith(e.FileExtension)?e.FileName.substring(0,e.FileName.lastIndexOf(e.FileExtension)-1):e.FileName,s=e.pyAttachName&&e.pyFileName?e.pyAttachName.startsWith(e.pyFileName)&&e.pyAttachName.split(".").length-1===e.pyFileName.split(".").length?e.pyAttachName.split(".").pop():"":e.FileExtension,{props:{meta:`${t} ${n}`,name:e.pyAttachName?e.pyAttachName:e.FileName,icon:vi(e.pyMimeFileExtension||e.MimeType),error:e.error||null,thumbnail:e.thumbnail||null},responseProps:{fileName:e.pyAttachName?e.pyAttachName:e.FileName,name:r,category:e.pyCategoryName?e.pyCategoryName:e.Category,extension:s,ID:e.pzInsKey?e.pzInsKey:e.ID,mimeType:e.pyMimeFileExtension?e.pyMimeFileExtension:e.MimeType,attachmentURL:e.pyAttachmentLink?e.pyAttachmentLink:e.AttachmentURL,createUser:n,createDateTime:e.pxCreateDateTime?e.pxCreateDateTime:e.CreateDateTime,responseType:e.responseType??(e.ID?"binary":null),localAttachment:!!e.localAttachment}}},wi=e=>{let t=[],n=!1;if(e&&Object.hasOwn(e,"pyCount"))n=!0,t=e?.pxResults?.filter((e=>!!e.pzInsKey)).map((e=>xi(e)))||[];else if(e&&"object"==typeof e){let n;n=Array.isArray(e)?e:[e],t=n?.filter((e=>e.ID&&e.FileName||e.pzInsKey)).map(xi)}else t=[];return{hasUploadedFiles:t.length>0,categoryName:e?.pyCategoryName||t?.[0]?.responseProps?.category||"",attachments:t,isOldAttachment:n}},Mi={uploadAttachment:(e,t,n,r)=>{const s=new FormData;s.append("appendUniqueIdToFileName","true"),s.append("file",e);const{restApi:a,reqType:o}=$f("uploadAttachment",{});return Bo(a,{method:o,headers:{"Content-Type":"multipart/form-data"},body:s,onUploadProgress:t,signal:bi(e.ID).token},r).then((t=>({type:"File",category:e.category||"File",ID:t.data.ID,clientFileID:e.ID,filename:e.name}))).catch(n?n(qo,e):e=>{throw e.isHandled=!1,e}).finally((()=>delete Ri[e.ID]))},linkAttachmentsToCase:(e,t,n,r)=>{const s={};if("File"===n){const[e]=t,{clientFileID:n}=e;delete e.clientFileID,n&&(s.signal=bi(n).token)}const{restApi:a,reqType:o}=$f("linkCaseAttachment",{caseID:e});return Bo(a,{...s,body:{attachments:t},method:o},r)},getCaseAttachments:(e,t,n=!1)=>{const{restApi:r,reqType:s}=$f("getCaseAttachments",{caseID:e,includeThumbnail:n});return Bo(r,{method:s},t).then((e=>e.data.attachments))},getAttachmentCategories:(e,t,n)=>{const{restApi:r,reqType:s}=$f("getAttachmentCategories",{caseID:e,type:t});return Bo(r,{method:s},n).then((e=>e.data))},downloadAttachment:(e,t,n)=>{const{restApi:r,reqType:s}=$f(Di,{attachmentID:e});return Bo(r,{method:s,..."binary"===n&&{responseType:"arraybuffer"}},t)},editAttachment:(e,t,n)=>{const{restApi:r,reqType:s}=$f("editAttachment",{attachmentID:e});return Bo(r,{method:s,body:{...t}},n)},deleteAttachment:(e,t)=>{const{restApi:n,reqType:r}=$f("deleteAttachment",{attachmentID:e});return Bo(n,{method:r},t)},downloadDocument:(e,t)=>{const{restApi:n,reqType:r}=$f("downloadDocument",{documentID:e});return Bo(n,{method:r},t)},deleteDocument:(e,t,n)=>{const{restApi:r,reqType:s}=$f("deleteDocument",{caseID:e,documentID:t});return Bo(r,{method:s},n)},getDocumentURL:e=>{const t=PCore.getEnvironmentInfo().getDocumentUrlDP()||"D_pxGetDocumentURL";return PCore.getDataPageUtils().getPageDataAsync(t,e.getContextName(),{},{invalidateCache:!0}).catch((t=>{e.reportError(": Error occurred during ajax call getDocumentURL API : ",t.response)}))},cancelRequest:e=>{Ri[e]&&(Ri[e].cancel(),delete Ri[e])},buildFilePropsFromResponse:xi,getAttachmentURL:e=>{const{restApi:t}=$f(Di,{attachmentID:e});return t},prepareAttachmentData:wi,validateAttachments:(e,t)=>{let n=e;if("object"==typeof t&&"attachments"in t){const{attachments:e}=t;0===e.length&&(n="")}else{const{attachments:e}=wi(t);0===e.length&&(n="")}return n}};class Li{constructor(){this.validators={}}static messageDispatcher(e,t,n,r,s){if(r){const a=[];a.push({type:U.MESSAGES.MESSAGES_TYPE_ERROR,fieldLabel:s,message:r}),co({messages:a,property:e,pageReference:t,context:n})}}register(e,t){this.validators[e]=t}getValidator(e){return this.validators[e]}validateRequired(e,t,n,r,s,a){const{required:o,value:i}=a;let c=null;if(!("true"!==o&&!0!==o)){let o=r;switch(e){case"radiobuttons":o=i;break;case"attachment":o=Mi.validateAttachments(r,i);break;case"checkbox":o&&"false"!==o||(o="");break;default:"string"==typeof o&&(o=o.trim())}c=this.getValidator("required")(o),Li.messageDispatcher(t,n,s,c,Qo.getFieldLabel(a))}return c}validateType(e,t,n,r,s,a){let o=null;const i={pageReference:n,context:s,property:t,target:a?.target,required:a?.required};let c=Pi.getDefaultsforType(a?.componentName||"")?.["client-validations"];!1!==c&&e&&this.getValidator(e)&&(o=this.getValidator(e)(r,i),(""!==r||Pi.getDefaultsforType(a?.componentName||"")?.showErrorWhenEmpty)&&Li.messageDispatcher(t,n,s,o,a?.label));const l=a?.validationType;return c=l&&Pi.getDefaultsforType(l)?.["client-validations"],!1!==c&&l&&this.getValidator(l)&&(o=this.getValidator(l)(r,i),Li.messageDispatcher(t,n,s,o,a?.label)),o}validate(e,t,n,r={}){const{context:s,disabled:a,readOnly:o,pageReference:i,skipRequiredValidation:c}=r;let l=null;return a||o||(c||(l=this.validateRequired(e,t,i,n,s,r)),l||(l=this.validateType(e,t,i,n,s,r))),{message:l}}isValidatorExist(e){return!!e.validatetype}}const Fi=new Li,Ui=(e,t)=>{e.DeclareExpressions&&t.context&&sn({[t.context]:e.DeclareExpressions})},ji=(e,t,n=!1)=>{const r=jg.getIn(e,j.RESOURCES);r&&((e=>{e&&Qh(e)})(r),Ui(r,t)),n||Yf({...e,options:t})};class Vi{static createCase(e,t){const{caseInfo:n,startingFields:r,flowType:s,viewType:a=Gc.PAGE,pageName:o,context:i=j.APP.APP,debugInfo:c,headers:l,retrieveActionViewForNewObject:u=!1}=t;let d={};n&&n.content&&(d=n.content);const{content:p,pageInstructions:h}=Vi.getExternalObjectContent(e,u,i);let g={[Vi.getKeyBasedOnWorkType(e)]:e,content:{...d,...r,...Rl.isExternalObject(e)&&!u&&{...p}}};g={...g,...Rl.isExternalObject(e)&&!u&&{pageInstructions:h},...!Rl.isObjectCaseType(e)&&{processID:s}};const f=Vi.getObjectTypeViewPayload(u,e);return Bi(Rl.getRouteKeyForCreateWork(e,u),{body:g,queryPayload:{...f,caseClassName:e,viewType:a,params:{pageName:o}},headers:{...l,...c&&{...xo.addDebugHeaders(c)}}},i).then((t=>({response:t.data,requestPayload:g,headers:Hc(t.headers,e,l)})))}static getObjectTypeViewPayload=(e,t)=>e?{objectTypeID:t,actionID:"Create"}:{};static getExternalObjectContent=(e,t,n)=>{if(Rl.isExternalObject(e)&&!t){const e=qc(n,{isExternalObject:!0}),{content:t,pageInstructions:r}=e.content;return{content:t,pageInstructions:r}}return{}};static getKeyBasedOnWorkType=e=>Rl.isObjectCaseType(e)?"objectTypeID":"caseTypeID"}const ki=Vi,$i=()=>({registerHeader:(...e)=>xo.registerHeader(...e),unRegisterHeader:(...e)=>xo.unRegisterHeader(...e),getRegisteredHeaders:()=>xo.getRegisteredHeaders()}),Bi=(e,{body:t={},queryPayload:n={},cancelTokenSource:r,headers:s={},responseType:a},o,i)=>{const{restApi:c,reqType:l}=$f(e,n),u={method:l,headers:s,body:t,...a&&{responseType:a}};return r&&(u.signal=r.token),Bo(c,u,o,i??{})},Gi=(e,{method:t="GET",body:n={},headers:r={},withoutDefaultHeaders:s=!1},a)=>{e.startsWith("http:")||e.startsWith("https:")||(e=E()+e);return Bo(e,{method:t,headers:r,body:n,withoutDefaultHeaders:s},a)},Wi=e=>Ph.doesRestApiExist(e),Hi=()=>Ho(),qi=e=>qo(e),zi=e=>{$o(e)},Yi=()=>ki,Ki="getCustomComponent",Ji="text/javascript";const Xi=new class{getTypes={SCRIPT:"script",STYLE:"link"};constructor(){this.loaderObj={},this.staticServerURL="",this.appStaticUrl=null,this.pegaOnlyUrl=!1,this.loadedAssets={},this.componentsConfig=null,this.appAlias="",this.b2sJWT=null,this.ccV2LibId="",this.imageBlobUrlCache={}}getStaticServerUrl(){return this.staticServerURL}setCCV2LibId(e){this.ccV2LibId=e}getCCV2LibId(){return this.ccV2LibId}async getThemeSchemaJSON(){const e=`${this.staticServerURL}themeOverrides.schema.json`;return fetch(e).then((e=>e.json()))}getConstellationServiceUrl(){return this.staticServerURL?.endsWith("/")?this.staticServerURL.substring(0,this.staticServerURL.length-1):this.staticServerURL}setAppAlias(e){this.appAlias=e}getAppAlias(){return this.appAlias}async getSvcComponentsConfig(e,t={}){let n="",r=0;return e.forEach((e=>{n+=`${0===r?"?":"&"}field${r}=${e.field}&value${r}=${e.value}`,r+=1})),this.pegaOnlyUrl?this.getSvcComponentsConfigSeparatedUrls(e,n,t):this.getSvcComponentsConfigCombinedUrl(e,n,t)}async getSvcComponentsConfigSeparatedUrls(e,t,n){const r=Dh.getBuiltOnAppNames(),s=this.loadAndFilterPegaComponentsConfig(e,r);let a=Promise.resolve([]);!0!==n.skipLoadCustomerComponents&&(a=this.loadAndCustomerComponentsConfig(t,e));const o=[],i=Dh.environmentInfoObject?.pyInfinityStaticService;if(i){const e=[],t=await Promise.all([s,a]),[n,r]=t,i=[];for(const t of r)!0===t.isSdkOverridden?e.push(t.componentDefinition):i.push(t.componentDefinition);const c=this.mergeComponentList([n,i,e]);o.push(...c)}else{const e=this.fetchSDKComponent(t);await Promise.all([s,a,e]).then((e=>{const t=this.mergeComponentList(e);o.push(...t)}))}if(n.alternateDesignSystemURL&&1===o.length){const r=await this.getSvcComponentsConfigADS(e,t,n);o[0].alternateDesignSystemConfig=r}return{data:{components:o}}}mergeComponentList=e=>{const[t=[],n=[],r=[]]=e,s=[...t,...n];return this.appStaticUrl?s.map((e=>{const{name:t,type:n,subtype:s}=e,a=r.reduce(((e,r)=>(t===r.name&&n===r.type&&s===r.subtype&&(e=r),e)),{});return Object.keys(a).length>0?{...e,alternateDesignSystemConfig:{...a}}:e})):s};async fetchSDKComponent(e){if(this.appStaticUrl&&this.appStaticUrl.length>8&&this.appStaticUrl!==this.staticServerURL){const t=`${this.appStaticUrl}v102/${this.appAlias}/componentslist-ext${e}`;return fetch(t,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.json())).then((e=>e.components)).catch((()=>[]))}return Promise.resolve([])}async loadAndFilterPegaComponentsConfig(e,t){return this.loadPegaComponentsConfig().then((()=>{const n=[];return this.componentsConfig&&this.componentsConfig.forEach((r=>{let s=!0;e.forEach((e=>{Array.isArray(r[e.field])?r[e.field].includes(e.value)||(s=!1):r[e.field]!==e.value&&(s=!1)})),s&&this.checkForBuiltOnSupport(t,r.allowedApplications)&&n.push(r)})),n}))}async loadPegaComponentsConfig(){let e=null;if(null===this.componentsConfig){const t=`${this.staticServerURL}components/componentsconfig.json?v=${(new Date).getTime()}`;e=fetch(t,{method:"GET"}).then((e=>e.json())).then((async e=>{this.componentsConfig=e,this.ccV2LibId&&await this.loadLibraryComponentsConfig(this.ccV2LibId).then((e=>{e&&e.length>0&&(this.componentsConfig=(this.componentsConfig||[]).concat(e))})).catch((e=>{console.error(`Exception while appending custom component config from library ${this.ccV2LibId} : ${e}`)}))})).catch()}else e=Promise.resolve();return e}async loadLibraryComponentsConfig(e){let t=null;return t=fetch(`${this.appStaticUrl}v100/componentlib/componentsconfig/${e}?v=${Date.now()}`,{headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>{if(!e.ok)throw console.error("Error while fetching custom component config/library component config"),new Error(e.statusText);return e})).then((e=>e.json())).then((e=>Promise.resolve(e))).catch((t=>(console.error(`Exception while fetching custom component config from library ${e} : ${t}`),{error:t.message}))),t}async loadAndCustomerComponentsConfig(e,t){let n=null;const r=Dh.environmentInfoObject?.pyInfinityStaticService;if(r){const e={};t.forEach(((t,n)=>{e[`field${n}`]=t.field,e[`value${n}`]=t.value})),n=PCore.getDataPageUtils().getDataAsync("D_pzGetComponentsConfig","",e).then((e=>e.data.map((e=>({componentDefinition:JSON.parse(e.pxComponentDefinition),isSdkOverridden:void 0!==e.pyIsSDKOverridden&&e.pyIsSDKOverridden})))))}else if(this.appStaticUrl&&this.appStaticUrl.length>8&&this.appStaticUrl!==this.staticServerURL){const t=`${this.appStaticUrl}v103/${this.appAlias}/componentslist${e}`;n=fetch(t,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.json())).then((e=>e.components)).catch((()=>[]))}else n=Promise.resolve([]);return n}checkForBuiltOnSupport(e,t){if(!e||!t||0===e.length||0===t.length)return!0;const n=e.split(",");return 0===n.length||n.some((e=>t.includes(e)))}async getSvcComponentsConfigCombinedUrl(e,t,n){const r=`${this.staticServerURL}v102/${this.appAlias}/componentslist${t}`,s=await fetch(r,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.json())).then((e=>({data:e})));if(!0===n.skipLoadCustomerComponents&&s?.data?.components?.length>0&&(s.data.components=s.data.components.filter((e=>void 0===e.componentKey))),n.alternateDesignSystemURL&&1===s?.data?.components?.length){const r=await this.getSvcComponentsConfigADS(e,t,n);s.data.components[0].alternateDesignSystemConfig=r}return s}getSvcComponentsConfigADS(e,t,n){const r=`${n.alternateDesignSystemURL}${n.alternateDesignSystemURL?.endsWith("/")?"":"/"}components/${e[0].value}/config-ext.json`;return fetch(r,{method:"GET"}).then((e=>{if(e.ok)return e.json();throw new Error(e.statusText)})).catch((e=>({error:e.message})))}getSvcImage(e){const t=`${this.appStaticUrl}v102/${this.appAlias}/image/${e}`;return fetch(t,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.blob())).catch()}getSvcImageUrl(e){const t=Dh.environmentInfoObject?.pyInfinityStaticService,{callUrlKey:n,queryPayload:r,callUrl:s}=this.buildImageRequest(e,t);return this.imageBlobUrlCache[s]||(this.imageBlobUrlCache[s]=this.fetchImage(n,r,s,t)),this.imageBlobUrlCache[s]}buildImageRequest(e,t){let n,r="getBinaryFile",s=`${this.appStaticUrl}v102/${this.appAlias}/image/${e}`;if(t){const t=/DATA-CONTENT-IMAGE\s([^\s!]+)!.*\/OPERATORIMAGES\//i,a=e.match(t);a&&a[1]?(r="getOperatorImage",n={user_ID:a[1].toLowerCase()}):n={fileID:e},s=$f(r,n)?.restApi||s}return{callUrlKey:r,queryPayload:n,callUrl:s}}fetchImage(e,t,n,r){return r?Bi(e,{queryPayload:t}).then((e=>{const t=this.decodeBase64ToByteArray(e.data),n=new Blob([t]);return window.URL.createObjectURL(n)})).catch((e=>{throw console.error("Error fetching image:",e),e})):fetch(n,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.blob())).then((e=>window.URL.createObjectURL(e))).catch()}decodeBase64ToByteArray(e){const t=atob(e),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e+=1)r[e]=t.charCodeAt(e);return r}getSvcLocale(e,t){const n=`${this.appStaticUrl}v102/${this.appAlias}/locales/${e}/${t}`;return fetch(n,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}})}getSvcAvailableLocales(){const e=`${this.appStaticUrl}v102/app/${this.appAlias}/locales/getLocaleCodes`;return fetch(e,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.json())).catch((()=>[]))}async getSvcComponent(e){try{const t=Dh.environmentInfoObject?.pyInfinityStaticService;if(t){const t=Dh.environmentInfoObject?.pxApplication?.pxUpdateDateTime,n=t?jg.parsePegaDateTimeToTimestamp(t):null,r=`${e}${n?`?v=${n}`:""}`;return(await Bi(Ki,{queryPayload:{componentName:r}})).data}const n=Dh.environmentInfoObject?.pyC11nDXCBDevURL,r=n?`${n}/index.js`:`${this.appStaticUrl}v102/${this.appAlias}/component/${e}`,s=await fetch(r,n?{}:{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}});if(!s.ok)throw new Error(s.statusText);return await s.text()}catch(e){throw console.error("Error fetching service component:",e),e}}async importCustomComponentMap(e){try{const t=Dh.environmentInfoObject?.pyInfinityStaticService,n=Dh.environmentInfoObject?.pyC11nDXCBDevURL;let r=`${this.appStaticUrl}v100/componentlib/componentsmap/${e}`;if(n){r=`${n.replace(/\/+$/,"")}/index.js`}if(t&&!n){const t=Dh.environmentInfoObject?.pxApplication?.pxUpdateDateTime,n=t?jg.parsePegaDateTimeToTimestamp(t):null,r=`${e}${n?`?v=${n}`:""}`,s=await Bi(Ki,{queryPayload:{componentName:r}});return void this.appendCustomScriptToHead(s.data)}if(t||n){const e=document.createElement("script");return e.src=r,e.type="text/javascript",e.onerror=()=>console.error("Error while appending custom component map"),void document.head.appendChild(e)}const s=n?{}:{headers:{Authorization:`Bearer ${this.b2sJWT}`}},a=await fetch(r,s);a.ok||console.error("Error while fetching custom component map");const o=await a.text();this.setCCV2LibId(e),this.appendCustomScriptToHead(o)}catch(e){console.error("Exception while appending custom component map:",e)}}async appendCustomScriptToHead(e){try{const t=document.createElement("script");t.src=window.URL.createObjectURL(new Blob([e],{type:Ji})),t.onerror=()=>console.error("Error while appending custom component map"),document.head.appendChild(t)}catch(e){console.error("Exception appendCustomScriptToHead:",e)}}loadSvcComponent(e){return new Promise(((t,n)=>{this.getSvcComponent(e).then((r=>{const s=document.createElement("script");s.src=window.URL.createObjectURL(new Blob([r],{type:Ji})),s.onload=()=>t(e),s.onerror=()=>n(e),document.head.appendChild(s)})).catch((()=>{n(e)}))}))}initServer(e,t,n){console.log(`asset-loader.initServer(${e}, ${t})`),this.appStaticUrl=null,this.staticServerURL=null,this.pegaOnlyUrl=!1,this.componentsConfig=null,e&&t&&"no-appstatic"!==t&&"no-cdn"!==t?(this.appStaticUrl=t.endsWith("/")?t:`${t}/`,this.staticServerURL=e.endsWith("/")?e:`${e}/`,this.pegaOnlyUrl=!0):e&&t&&"no-appstatic"===t?(this.staticServerURL=e.endsWith("/")?e:`${e}/`,this.appStaticUrl=this.staticServerURL,this.pegaOnlyUrl=!0):e&&t&&"no-cdn"===t&&(this.staticServerURL=e.endsWith("/")?e:`${e}/`,this.appStaticUrl=this.staticServerURL),console.log(`asset-loader.initServer() staticServerURL=${this.staticServerURL}, appStaticUrl=${this.appStaticUrl}, pegaOnlyUrl=${this.pegaOnlyUrl})`),this.b2sJWT=n}register(e,t){this.loaderObj[e]=t}getLoader(e){let t;const n=(e,t)=>new Promise(((n,r)=>{const s=document.createElement(t);if("script"===t){const t=s;t.onload=()=>{n(e)},t.onerror=()=>{r(e)},t.type=Ji,t.charset="UTF-8",t.async=!1,t.src=e}else{const t=s;t.type="text/css",t.rel="stylesheet",t.href=e}document.head.appendChild(s)})).catch((e=>{console.log(e)}));return t=e?this.loaderObj[e]:n,t}loadAssets(e,t){const{isDevServerMode:n}=t;if(!e)return Promise.resolve();const r=[];return e.forEach((e=>{const t=Object.keys(e)[0];let s=n?Object.values(e)[0]:this.getStaticServerUrl();s=s.endsWith("/")?s:`${s}/`,this.loadedAssets[t]||(t.includes(".js")?r.push(this.getLoader()(s+t,this.getTypes.SCRIPT)):t.includes(".css")&&this.getLoader()(s+t,this.getTypes.STYLE),this.loadedAssets[t]=!0)})),Promise.all(r)}getAssetsFromIsolations(e){const t=this.b2sJWT?.split(".")[1].replace(/-/g,"+").replace(/_/g,"/")||"",n=decodeURIComponent(s.g.atob(t).split("").map((e=>`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`)).join("")),r=JSON.parse(n),a=r?.tenant_id,{restApi:o,reqType:i}=kf("getAssetsFromIsolations",{isolationID:a,assetPath:e})||{},c=`${this.appStaticUrl}${o}`;return fetch(c,{method:i,credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.blob()))}},Qi="component-loader",Zi={},ec=async(e,t)=>{if(!e?.length||!1===window.PCore?.getBehaviorOverride("dynamicLoadComponents"))return Promise.resolve();const n=Xi.getLoader(),r=t||Xi.staticServerURL;if(Xi.getLoader(Qi))return Xi.getLoader(Qi)(e,r);const s=new Set(Object.keys(Zi)),a=e.flatMap((e=>{if(s.has(e))return[];const t=cn.getComponent(e);if(!t){const t=`${Xi.getConstellationServiceUrl()}/v860/${Xi.getAppAlias()}/component/${e}.js`;return s.add(e),[n(t,Xi.getTypes.SCRIPT)]}const a=(t.scripts||[]).map((e=>n(e.startsWith("http")?e:`${r}${e}`,Xi.getTypes.SCRIPT))),o=(t.styles||[]).map((e=>n(`${r}${e}`,Xi.getTypes.STYLE)));return s.add(e),[...a,...o]}));return Promise.all(a.map((e=>e.catch((e=>console.error("Error loading asset:",e))))))};const tc=new class{#n;constructor(){this.userSettings={},this.componentCache={},this.contextMapToClearOnCancel={},this.#n=!1}getNormalizedKey(e){return e?.toString().trim().replace(/\s/g,"-").toLowerCase()}setComponentState=(e,t)=>{sessionStorage?sessionStorage.setItem(this.getNormalizedKey(e),JSON.stringify(t)):console.error("Session Storage not found")};getComponentState=e=>{const t=sessionStorage.getItem(this.getNormalizedKey(e)),n=t?jg.isValidJson(t):void 0;return n||t};removeComponentState=e=>{sessionStorage.removeItem(this.getNormalizedKey(e))};fetchUserSettings=async()=>{if(Wi("getUserSettings")){const{restApi:e,reqType:t}=$f("getUserSettings");Bo(e,{method:t,headers:{}}).then((e=>{if(200!==e.status||!e.data)throw new Error("something went wrong while fetching getUserSettings");this.userSettings=e.data})).catch((e=>console.error(e)))}};init=()=>{Dh.getUserSettings()?this.userSettings=Dh.getUserSettings():this.fetchUserSettings()};getUserSettings=e=>{if(!e)throw new Error("path is required parameter");if("string"!=typeof e)throw new TypeError("path must be string");return jg.getIn(this.userSettings,e,{})};setUserSettings=async(e,t)=>{if(!e)return Promise.reject(new Error("path is required parameter"));if("string"!=typeof e)return Promise.reject(new TypeError("path must be string"));if(null==t||""===t)return Promise.reject(new Error("value is required parameter"));let n;if(!Wi("updateUserSettings"))return Promise.resolve("updateUserSettings route is not available");n=$f("updateUserSettings");const{restApi:r,reqType:s}=n;return Bo(r,{method:s,body:jg.setIn({},e,t)}).then((e=>{if(200!==e.status||!e.data)throw new Error("something went wrong");this.userSettings=e.data})).catch((e=>{console.error(e)}))};setComponentCache(e,t,n={}){if("string"!=typeof e||!e?.trim())return;const r=n.clearOnCancelForContext;if(r&&(Object.hasOwn(this.contextMapToClearOnCancel,r)?this.contextMapToClearOnCancel[r].add(this.getNormalizedKey(e)):this.contextMapToClearOnCancel[r]=new Set([this.getNormalizedKey(e)])),this.componentCache[this.getNormalizedKey(e)]=t,!this.#n){this.#n=!0;const e=e=>{const{context:t}=e||{};(this.contextMapToClearOnCancel[t]||new Set).forEach((e=>{this.resetComponentCache(e)})),delete this.contextMapToClearOnCancel[t]};yo.subscribe(j.PUB_SUB_EVENTS.EVENT_CANCEL,e,"RESET_COMPONENT_CACHE")}}getComponentCache(e){return"string"==typeof e&&e?.trim()?Object.hasOwn(this.componentCache,this.getNormalizedKey(e))?this.componentCache[this.getNormalizedKey(e)]:void 0:null}getURLParam(e,t){let n=new URL(window.location.href).searchParams.get(e);return n?(n=t?atob(n):n,n):null}setURLParam(e,t,n){if(!Dh.shouldUseURLParams())return;const r=new URL(window.location.href);if(t=n?btoa(t):t,r.searchParams.get(e)===t)return;r.searchParams.set(e,t);window.history.pushState({type:"ui-navigation"},"",r)}resetComponentCache(e){return!("string"!=typeof e||!e?.trim())&&(!!Object.hasOwn(this.componentCache,this.getNormalizedKey(e))&&(delete this.componentCache[this.getNormalizedKey(e)],!0))}};const nc=new class{constructor(){this.contextArray={},this.pauseDuration=2e3,this.waitingToPutUpIndicator=!1}getLoadingContext(e){let t=null;return e&&(({context:t}=e),t||(t=e.containerItemID),t||(t=e.contextName)),t}enableLoadingIndicator(e,t=!0){const n=this.getLoadingContext(e);n&&(this.addToContextArray(n),this.waitingToPutUpIndicator||(this.waitingToPutUpIndicator=!0,this.pauseBeforeShowing(n).then((e=>{t&&void 0!==this.contextArray[e]&&this.contextArray[e]>0&&Cg({type:oe,payload:{context:e}})}))))}pauseBeforeShowing=e=>new Promise((t=>{setTimeout((()=>t(e)),this.pauseDuration)}));disableLoadingIndicator(e,t=!0){const n=this.getLoadingContext(e);n&&(this.waitingToPutUpIndicator=!1,this.removeFromContextArray(n),t&&void 0!==this.contextArray[n]&&0===this.contextArray[n]&&Cg({type:ie,payload:{context:n}}))}addToContextArray=e=>{void 0===this.contextArray[e]&&(this.contextArray[e]=0),this.contextArray[e]+=1};removeFromContextArray=e=>{void 0!==this.contextArray[e]&&this.contextArray[e]>0&&(this.contextArray[e]-=1)}};const rc=new class{constructor(){this.counterActionMgrId=0,this.actionMgrActions={}}getNextActionMgrId(){return this.counterActionMgrId+=1,this.counterActionMgrId.toString()}register(e,t,n,r,s="unknown",a,o=!0){if(void 0!==this.actionMgrActions[e])return null;const i={actionType:s,promise:t,resolve:n,reject:r,actionPayload:a};return this.actionMgrActions[e]=i,o&&nc.enableLoadingIndicator(i.actionPayload),e}actionManagerPromise=(e,t="")=>{let n,r;""===t&&(t=this.getNextActionMgrId());const s=new Promise(((e,t)=>{n=e,r=t}));if(!n||!r)throw new Error("resolveFn or rejectFn is not defined.");return this.register(t,s,n,r,e),{actionMgrID:t,promise:s}};resolveActionByID(e,t,n=!0){const r=this.actionMgrActions[e];let s=e;return r?(setTimeout((()=>{r.resolve(t)}),0),nc.disableLoadingIndicator(r.actionPayload,n)):s=null,s}rejectActionByID(e,t=!0,n){const r=this.actionMgrActions[e];let s=e;return r?(r.reject(n),nc.disableLoadingIndicator(r.actionPayload,t)):s=null,s}setRemoteCaseHeaderByContext(e,t){t&&(e.headers=e.headers||{},e.headers.RemoteSystemID=t)}setTraditionalRemoteCaseParams(e,t){return e.className=t.className,e.isTraditionalRemoteCase=$.isTraditionalRemoteCase(t.className),e.remoteClassName=t.remoteClassName,e.action=t.action,e.viewName=V,e.gadgetId=t.gadgetId??Rl.getUniqueGadgetId(),e.name=t.name,e.skipSemanticUrl=!0,ne}};class sc{static actionsTargetMap=new Map;static getTargetViewContainerName=e=>{if(e){const t=e.toLowerCase();let n="primary";return this.actionsTargetMap.has(t)&&(n=this.actionsTargetMap.get(t)),n}return""};static buildActionTargetMap=e=>{e&&Object.keys(e).forEach((t=>{const n=e[t];n&&n.actions&&n.actions.forEach((e=>{this.actionsTargetMap.set(e.toLowerCase(),t)}))}))}}const ac=sc,oc=(e,t,n)=>Ph.getResolvedSemanticURL(e,t,n),ic={getResolvedSemanticURL:oc,getActions:()=>({ACTION_OPENWORKBYHANDLE:Be,ACTION_SHOWDATA:Ve,ACTION_SHOWVIEW:je,ACTION_GETOBJECT:Tt,ACTION_SHOWINSIGHT:ke,ACTION_SHOWDASHBOARD:$e}),updateSemanticURLAndDocumentTitle:e=>Ph.updateSemanticURLAndDocumentTitle(e),getSemanticURLForToaster:(e,t,n=!1)=>oc(n?Tt:Be,{caseClassName:e},{[n?"objectID":"workID"]:t})},cc={CASE_INFO:`${j.DATA}.${j.CASE_INFO.CASE_INFO}`,CASE_CLASS_NAME:`${j.DATA}.${j.CASE_INFO.CASE_TYPE_ID}`,CASE_INFO_ID:`${j.DATA}.${j.CASE_INFO.CASE_INFO_ID}`,BUSINESS_ID:`${j.DATA}.${j.CASE_INFO.BUSINESS_ID}`},lc=e=>jg.getIn(e,j.getProperty(cc.CASE_CLASS_NAME),j.EMPTY_STRING),uc=e=>jg.getIn(e,j.getProperty(cc.CASE_INFO_ID),j.EMPTY_STRING),dc=(e,t)=>{const n=uc(t);jg.setIn(e,"key",n)},pc=e=>jg.getIn(e,j.getProperty(cc.CASE_INFO),{}),hc=e=>{const t=_g();if(!e)return!1;const n=W(e),r=qp(n),s=qp(e);if(!r||!s)return!1;const a=yp(r,n),o=yp(s,e);if(!a||!o)return!1;const{key:i}=a;let{key:c}=o;return c||(c=t?.getState().data?.[e]?.objectInfo?.ID),i&&c&&i===c},gc=e=>{const t=uc(e),n=jg.getIn(e,j.getProperty(cc.BUSINESS_ID),j.EMPTY_STRING),r=t.toLowerCase().includes(n.toLowerCase())?n:t,s=lc(e);return{businessID:n,caseType:s,resolvedURL:ic.getSemanticURLForToaster(s,r,Rl.isObjectCaseType(s))}},fc=e=>{yo.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_SUBMISSION,e)},mc=e=>{yo.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.END_OF_ASSIGNMENT_PROCESSING,e)},Ic=e=>{yo.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.CASE_OPENED,e)},yc={CASE_INFO:`${j.DATA}.${j.CASE_INFO.CASE_INFO}`,CASE_CLASS_NAME:`${j.DATA}.${j.CASE_INFO.CASE_TYPE_ID}`,NEXT_ASSIGNMENT_INFO_ID:`${j.DATA}.${j.NEXT_ASSIGNMENT_INFO_ID}`,ASSIGNMENTS:`${j.DATA}.${j.CASE_INFO.ASSIGNMENTS}`,CASE_INFO_ID:`${j.DATA}.${j.CASE_INFO.CASE_INFO_ID}`,CASE_FIRST_FLOW_ACTION_NAME:`${j.DATA}.${j.CASE_INFO.ASSIGNMENTACTION_ID}`,CASE_FIRST_ASSIGNMENT_ID:`${j.DATA}.${j.CASE_INFO.ASSIGNMENT_ID}`},Ec=(e,t)=>{const{vcName:n,containerName:r}=t;return r||n||ac.getTargetViewContainerName(e)},Ac=e=>{const t=e.lastIndexOf(j.FORWARD_SLASH_STRING)+1,n=e.lastIndexOf(j.UNDERSCORE_STRING);return e.substring(t,n)},_c=e=>e===gp.WORKAREA,Cc=e=>e===gp.MODAL,Sc=e=>e===ve,Tc=e=>e===Ee,Nc=e=>e&&e.find((e=>e.type===Ee)),Oc=e=>jg.getIn(e,yc.CASE_INFO,{}),Pc=e=>e?e.split(" ").pop():void 0,Dc=e=>jg.getIn(e,yc.CASE_CLASS_NAME,j.EMPTY_STRING),Rc=(e,t=!1)=>{const n=t?pc(e):Oc(e);return vl(n)&&xl(Dh.getOperatorIdentifier(),n)},bc=e=>jg.getIn(e,yc.CASE_INFO_ID,j.EMPTY_STRING),vc=e=>jg.getIn(e,yc.CASE_FIRST_ASSIGNMENT_ID,j.EMPTY_STRING),xc=(e,t)=>{const{removeActionPayload:n,target:r}=t;if(n&&n.containerItemID){const{containerItemID:t,context:s}=n;e.push(Cf(ff,{containerItemID:t,context:s||vp(t),target:r}))}},wc=e=>{const t=_g();if(!e)return!1;const n=W(e),r=qp(n),s=qp(e);if(!r||!s)return!1;const a=yp(r,n),o=yp(s,e);if(!a||!o)return!1;const{key:i}=a||{};let{key:c}=o||{};return c||(c=t?.getState().data?.[e]?.caseInfo?.ID),i&&c&&i===c},Mc=(e,t,n={})=>{const{skipFlowNameUpdate:r}=n,s=bc(t);jg.setIn(e,"key",s);const a=vl(Oc(t));if(!r&&(e=>{const t=jg.getIn(e,yc.ASSIGNMENTS,[]);return t&&t.length>0})(t)){const n=vc(t),[,r]=n.split("!");(e=>{yo.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.CURRENT_ASSIGNMENT_UPDATED,e)})({assignmentID:n,isInCreateStage:a}),jg.setIn(e,"flowName",r)}},Lc=(e,t)=>{const{attachmentsExist:n}=t;n&&jg.setIn(e,U.SUMMARY_OF_ATTACHMENTS_LAST_REFRESH_TIME,(new Date).toLocaleString()),jg.setIn(e,U.SUMMARY_OF_ASSIGNMENT_LAST_SUBMIT_TIME,(new Date).toLocaleString())},Fc=(e,t,n)=>{let r=j.PROMISE_VALUE.RESOLVE;return Nc(e)?(r=j.PROMISE_VALUE.REJECT,n?rc.rejectActionByID(t,!0,n):rc.rejectActionByID(t)):rc.resolveActionByID(t),r},Uc=e=>{const t=Dh.getCaseTypeList();return"true"===t.filter((t=>t.pyWorkTypeImplementationClassName===e))?.[0]?.pyIsTraditionalUICase},jc=()=>"true"===Dh?.environmentInfoObject?.pxMashupDetails?.pyLaunchCaseInModal,Vc=(e,t,n)=>{const{containerItemID:r,caseID:s}=t;if(r){const{caseClassName:a,skipAssignmentsUpdate:o}=n,i=W(r),c=qp(i),l=c&&Ip(c),u=c&&Dp(c),d=Y(i);u&&l?.items?.[u]?.key===t?.caseID&&e.push(Cf(Jg,{containerItemID:i,context:i,container:d,containerName:d,caseId:s,viewName:U.CASESUMMARY_VIEW_NAME,updateData:!0,viewLoadingContainer:{context:i},caseClassName:a,...void 0!==o&&{skipAssignmentsUpdate:o}}))}},kc=(e,t)=>{const n=Dc(e?.response),r=Oc(e?.response),{caseTypeID:s}=r,a=Dh.getFeatureMap();(a?.deferUpdateCaseSummaryView??!Object.hasOwn(a,j.DEFER_UPDATE_CASESUMMARY_VIEW))&&s&&eg(j.CASESUMMARY_VIEW_NAME,s)&&Vc(t,e?.actionInPayload,{caseClassName:n,skipAssignmentsUpdate:!0})},$c=e=>Sg(e)?.context_data?.caseViewMode,{RESOURCE_TYPES:Bc}=U,Gc={PAGE:"page",FORM:"form"},Wc={[Bc.CASE]:[We,Be,Ge],[Bc.OBJECT]:[St,Tt,Ot],[Bc.PAGE]:[je,ke],[Bc.DATA]:[Ve],ASSIGNMENT:[Qe]},Hc=(e,t,n={})=>{if(!e)return{};const r={etag:e.etag},{RemoteSystemID:s}=n;return e[U.REMOTE_SYSTEM_ID]||e[U.REMOTE_SYSTEM_ID.toLowerCase()]||s?r.RemoteSystemID=e[U.REMOTE_SYSTEM_ID]||e[U.REMOTE_SYSTEM_ID.toLowerCase()]||s:t&&$.isRemoteCase(t)&&(r.RemoteSystemID=$.getRemoteHeader(t)),r},qc=(e,t={})=>{const{onlyChangedData:n=!1,nonEmptyAndChangedData:r=!1,skipUUID:s=!0,isTransientContext:a=!1,includeDisabledFields:o=!1,isObjectWideAction:i,isExternalObject:c}=t;let l={};l=Tl(e,{isTransientContext:a,includeDisabledFields:o,isObjectWideAction:i,isExternalObject:c}),n&&(delete l?.caseInfo?.content,a&&(l={}));const u=tp(e,!1);!a&&r&&((e,t)=>{Object.entries(e?.caseInfo?.content).forEach((([n,r])=>{const s=Sg(t),a=R()(s,U.CASE_INFO.CASE_INFO_CLASSID),o=qh(n,a);("True-False"===o?.type&&!r||""===r)&&delete e.caseInfo.content[n]}))})(l,e);const d=w()(u,l);let p={};({content:p}=((e,t,n=!1,r=!1)=>{let s={};const a=n||r?t?.objectInfo:t?.caseInfo;return(e||a)&&(s=e?{...t}:{...a}),{content:s}})(a,d,i,c));const h=[...fi(e)];s&&h.forEach((e=>{delete e.content?.EmbedListUUID__})),p.pageInstructions=h;if((li[e]||[]).forEach((e=>{if(p?.content){const t=e?.replace(j.getProperty(j.CASE_INFO.CASE_INFO_CONTENT),"");jg.deleteIn(p.content,(e=>{if(!e)return"";const t=e.split(".");let n,r="";for(n of t)if(n){if(n.includes("[")&&n.includes("]"))return r+=`['${n.substring(0,n.lastIndexOf("["))}']`,r;r+=`['${n}']`}return r})(t))}})),!a&&d?.dataInfo)return p={...d.dataInfo,pageInstructions:p.pageInstructions},{content:p};const g=Og(".pzAdditionalPayload",j.CASE_INFO.CASE_INFO_CONTENT,e);return p.content&&g&&(p.content.pzAdditionalPayload=g),{content:p}},zc=(e,t)=>{let n,r,s={};const a=jg.getIn(e,j.UI_RESOURCES),o=jg.getIn(e,"confirmationNote");a?(n=jg.getIn(e,j.UI_RESOURCES_CONTEXT_DATA),r=jg.getIn(e,j.ROOT),s=jg.getIn(e,j.ACTION_BUTTONS)):o&&(r={});const{data:i={},Errors:c,flowName:l}=e;let{semanticURL:u,key:d}=e;const p=i?.objectInfo?.ID;p&&(d=d||p,u=u||`objects/${p}`);const h=jg.getIn(e,"nextAssignmentInfo",null),g=jg.getIn(e,"nextAssignmentInfo.context",""),f=jg.getIn(e,"confirmationLinks",null),{isInCreateStage:m,openCaseViewAfterCreate:I,debugInfo:y,isExternalObjectCreationFlow:E}=t;return{data:{...i,key:d,flowName:l,coreHeaders:y&&{debugInfo:{[j.COREHEADER_APP_DEBUG_ID]:y.debugId}},[j.getProperty(j.CASE_INFO.CASE_INFO)]:{...i[j.getProperty(j.CASE_INFO.CASE_INFO)],actionButtons:s,headers:t.headers},[j.CONTEXT_DATA]:m?{...i[j.CONTEXT_DATA],...n,openCaseViewAfterCreate:I,errors:c,isExternalObjectCreationFlow:E}:{...i[j.CONTEXT_DATA],...n,errors:c}},semanticURL:u,nextAssignmentInfo:h,assignmentContext:g,confirmationLinks:f,key:d,root:r,...t}},Yc=async(e,t,n,r=!1,s=!1)=>{const a=jg.getIn(e,j.LOCALE_REFERENCES);await vh.loadLocaleResources(a);const o=jg.getIn(e,j.COMPONENTS);if(o)try{await ec(o)}catch(e){console.error(e)}const i={actionConfig:t,...n};r?Yf({...e,options:i,directUrlUpdation:!0}):ji(e,i,s)},Kc=(e="")=>{const t=e.indexOf(" "),n=e.indexOf("!");return e.substring(t+1,n)},Jc=e=>{if(e){const[,t]=e.split("!");return{key:Kc(e),flowName:t}}return{}},Xc=(e,t)=>{const n=[],r=[];return e.forEach((e=>{((e,t,n,r)=>{switch(!0){case Boolean(e[j.ERROR_IN_PAGE_IDENTIFIER]&&e[j.ERROR_FIELD_IN_PAGE]):{const s=`${e[j.ERROR_FIELD_IN_PAGE]}`.replace(/(\(\d+\))/g,(e=>`[${parseInt(e.substring(1,e.length-1),10)-1}]`)),a=`${s}${e[j.ERROR_IN_PAGE_IDENTIFIER]}`,o=jg.deepClone(e);o[j.ERROR_FIELD_IN_PAGE]=s,t.includes(a.slice(1))||t.includes(a.substring(a.indexOf(".")+1,a.indexOf("[")))||t.includes(a.substring(a.indexOf(".")+1,a.indexOf("(")))?r.push(o):n.push(e);break}case Boolean(e[j.ERROR_IN_PAGE_IDENTIFIER]&&!e[j.ERROR_FIELD_IN_PAGE]):{const s=e[j.ERROR_IN_PAGE_IDENTIFIER].slice(1);t.includes(s)?r.push(e):n.push(e);break}default:n.push(e)}})(e,t,n,r)})),{fieldErrors:r,pageErrors:n}},Qc=e=>{const{payload:t}=e,{err:n,context:r,actionMgrID:s}=t,a=n&&n.response?n.response.data:"",o=Ol(r);return s&&rc.rejectActionByID(s,!0,n),Cf(Sf,"Error action triggered",a,r,o)},Zc=(e,t)=>Up(e)&&Vp(e)?Cf(yf,t):Cf(nf,t),el=(e,t,n=j.APP.APP,r={})=>{let s=null;const{buildNew:a=!0}=r;return Up(e)?s=Vp(e)?Dp(e):H(t,n):jp(e)&&(Vp(e)&&!a?s=xp(e):Vp(e)&&!a||(s=H(t,n))),s},tl=e=>e&&e.type===Ce,nl=e=>{let t=!1;const n=Lp(e);for(let e=0;e<n.length;e+=1){const r=n[e];if(r&&ip(r)){t=!0;break}}return t},rl=(e,t={})=>{let n=!1,r=!1,s={},a=!0,o=!1,i=!1;const{showConfirmDialogForMaxDocumentLimitReached:c=!1,dirtyMessage:l,skipChildDirtyState:u=!1}=t;if(Up(e)){const t=Dp(e);if(!t)return{continueExecution:a,removeActionPayload:s};const r=vp(t);ip(r)&&(n=!0),u||n||(n=nl(t))}else if(jp(e)&&Bp(e)){let t=Hp(e);t||(t=Dp(e),r=!0),s.containerItemID=t,s.context=vp(t)}if(n){const e=l||Zd;o=window.confirm(vh.getLocaleValue(e,"Messages"))}if(!o&&n&&(s={},a=!1),r){const e=vh.getLocaleValue(ep,"Messages");c?i=window.confirm(e):(window.alert(e),a=!1)}return!i&&r&&(s={},a=!1),{continueExecution:a,removeActionPayload:s}},sl=(e,t)=>{let n=!1;const r=Dh.isCoexistenceAppOfType(j.APP_TYPE.UIKIT),{insKey:s,isParallelCall:a,skipFlowNameCheck:o}=t;if(!s)return{};const[,i]=s.split("!")||"",c=o?s:Kc(s),l=Sp(e,c);let u={},d=!1;if(l&&!r&&((e,t)=>{const n=yp(e,t);return n?.resourceType})(e,l)===t?.type&&(n=!0,u=yp(e,l),!o)){let e=u?.flowName;const t=Ac(l),r=wp(l);if(r.length){const n=Pt(t,r[0]);e=yp(n,r[0])?.flowName}else n=e===i;(e!==i||a)&&(d=!0)}return{activate:n,activateContainerActionPayload:{target:e,isParallelAssignment:d,containerItemID:l,semanticURL:u.semanticURL,insKey:s}}},al=(e,t,n)=>e===Bc.PAGE?((e,t={})=>{let n=!1;const{semanticURL:r}=t,s=Sp(e,r);return s&&(n=!0),{activate:n,activateContainerActionPayload:{target:e,containerItemID:s,semanticURL:r}}})(t,n):e===Bc.ASSIGNMENT?sl(t,{...n,type:e}):e===Bc.CASE||e===Bc.OBJECT?sl(t,{...n,skipFlowNameCheck:!0,type:e}):{},ol=(e,t)=>(e?.data?.caseInfo&&t?.caseInfo?.content&&(e.data.caseInfo.content=t?.caseInfo?.content),e),il=(e=[])=>{Vp(`${j.APP.APP}/${j.PREVIEW}`)&&e.push(Cf(tf,Gp({context:U.APP.APP,name:j.PREVIEW})))},cl=e=>{let t;for(const n of Object.keys(Wc))if(Wc[n].includes(e)){t=n;break}return t},ll=(e,t,n="")=>{const{data:r={},context:s,caseViewMode:a}=e,o={data:{...r},caseViewMode:a,context:W(s)};jg.deleteIn(o.data,"shared"),jg.setIn(o.data,["context_data","caseViewMode"],a),t.push({type:ot,payload:{context:o.context}});const i=n&&![U.CASE_INFO.CASE_INFO_CONTENT,U.DATA_INFO.DATA_INFO_CONTENT].includes(n);t.push(Cf(Yg,{...o,...i&&{uiRootReference:n}}))},ul=e=>{if(Array.isArray(e)&&e.length>0){const t=(e=>{const t=e[0];for(const t of e)if("other"===t?.payload?.nextAssignmentInfo?.context||"remote"===t?.payload?.nextAssignmentInfo?.context)return t;return t})(e),n=jg.getIn(t,["payload","assignmentContext"]);if("other"===n||"remote"===n){const r=jg.getIn(t,["payload","nextAssignmentInfo","ID"]);if(t?.payload?.isProcessAction){const n={acName:jg.getIn(t,["payload","target"]),caseID:t.payload.data.caseInfo.ID,containerItemID:jg.getIn(t,["payload","context"]),context:jg.getIn(t,["payload","context"])},r={type:he,payload:{...n}};e.push(r),e=e.filter((e=>delete e?.payload?.data?.caseMessages)),Cg(e),e=e.filter((e=>e.type!==he))}const s=((e,t,n)=>({assignmentID:e,vcName:j.PRIMARY,targetContainerName:jg.getIn(t,["payload","target"]),context:jg.getIn(t,["payload","context"]),..."other"===n&&{isChild:!0},isProcessAction:t?.payload?.isProcessAction,..."remote"===n&&{isRemote:!0},..."remote"===n&&{remoteClassName:t.payload.nextAssignmentInfo.className}}))(r,t,n);Up(s.targetContainerName)||t?.payload?.containerName!==j.WORKAREA||(s.isMultiDoc=!0,e=[]);const a={type:ge,payload:{...s}};e.push(a),Cg(e)}else Cg(e)}},dl=(e,t)=>w()(e,t,(function(e,t){if(Array.isArray(e))return e.concat(t)})),pl=e=>{let t={},n=dh(e);for(;n;){const e=qc(n);t=dl(e.content,t),n=dh(n)}return t};class hl{static getChanges(e){return{...tp(e)}}static getSubmitData(e,t){const{isTransientContext:n=!1,includeDisabledFields:r=!1}=t||{},{content:s}=qc(e,{isTransientContext:n,includeDisabledFields:r});return s}static isStateModified(e){return ip(e)}static isFormValid(e,t){return Nl(e,t)}static clearChangedProperties(e){return mi(e),gi(e),lp(e)}static getEditableFields(e){return Pl(e)}static setCustomValidator(e,t){Fi.register(e,t)}static isPropertyEditable(e,t){return hl.getEditableFields(e).some((e=>e.name===t))}}const gl=hl;const fl=new class{constructor(){this.states={},this.unConnectedStates={}}getStateMachine(e,t,n){return this.states?.[e]?.[`${t}${n}`]||this.unConnectedStates?.[e]?.[`${t}${n}`]}getAllStateMachines(e,t,n){return{states:this.states?.[e]?.[`${t}${n}`],unConnectedStates:this.unConnectedStates?.[e]?.[`${t}${n}`]}}getAllStateMachinesByContext(e){return{states:this.states?.[e],unConnectedStates:this.unConnectedStates?.[e]}}isStateMachineExist(e,t,n){return!!this.states?.[e]?.[`${t}${n}`]||!!this.unConnectedStates?.[e]?.[`${t}${n}`]}getUnConnectedStateMachines(e){return this.unConnectedStates?.[e]}setStateMachine(e,t,n,r){const s=`${n}${t}`,{stateMachine:a}=this.getStateMachineObjByPath(s,e,!0,!0),o=(t,n,r=!1)=>{const s=r?this.states:this.unConnectedStates;s[e]||(s[e]={}),s[e][t]||(s[e][t]={}),s[e][t]=n};if(a&&a.targetPageReference!==r.targetPageReference)return a.addChild(r),void o(s,r);const i=Object.entries(this.states[e]||{}).filter((([e])=>{if(e.includes(s)){const t=e.substring(0,s.length).length;return e.substring(t).startsWith("[")||e.substring(t).startsWith(".")}return!1})).reduce(((e,[t,n])=>({...e,[t]:n})),{});Object.keys(i)?.length?(Object.entries(i).forEach((([t,n])=>{delete this.states[e][t],r.addChild(n),o(t,n)})),this.states[e][s]=r):o(s,r,!0)}buildPageInstructionsByContext(e,t){const n=this.getStateMachinesByContext(e)||{},r=[];return Object.keys(n).sort().forEach((s=>{const a=eo.getContextReferences(e)?.get(s),o=a&&Bg.resolveContextTreeNodeProps(a.props)||{},i=n[s];if(a&&!0!==o.readOnly){const e=i.buildSubmitPageInstructions(t);r.push(...e)}})),r}buildClientChangeList(e){const t=this.getStateMachinesByContext(e)||{};let n={};const r={};return Object.keys(t).forEach((e=>{const r=t[e].getChangeList();n={...n,...r}})),jg.flatten(n,"",r),r}getStateMachinesByContext(e){return e?this.states?.[e]:void 0}clearStateMachines(e){this.states[e]={},this.unConnectedStates[e]={}}setStateMachineEmpty(e,t){const n=this.getStateMachine(e,t,""),r=eo.getFieldReferenceForProperty(e,t);if("Multiselect"===r?.props?.componentName&&n?.current?.instruction?.instruction===j.LIST_ACTIONS.DELETE_ALL)return;n.root=null,n.current=null;const s=this.getUnConnectedStateMachines(e)||{};Object.keys(s).forEach((e=>{e.includes(t)&&delete s[e]}))}removeStateMachine(e,t){delete this.states[e]?.[t]}createStateMachine(e,t){let n=e.substring(0,e.lastIndexOf("["));const r=n.substring(n.lastIndexOf("."));n=n.substring(0,n.lastIndexOf(".")),n&&r&&di(t,r,n)}getStateMachineObjByPath(e,t,n,r=!1){const s=/\[\d+\]$/gm,a=e;let o;for(;e&&!this.isStateMachineExist(t,"",e);){const i=qp(t),c=yp(i,t)||{},l=c?.isPageGroup||c?.subscriptFieldName||"string"==typeof c?.index;if(o=null,n&&e.endsWith("]")){if(o=e.match(s),o=o?.[o.length-1]?.substring(1,o[o.length-1].length-1),[e]=e.split(s),!r&&!this.isStateMachineExist(t,"",e)){this.createStateMachine(a,t);break}}else{if(c?.index&&e.includes(c.index)&&l){const t=e.split(".");o=t[3],e=t.slice(0,3).join(".");break}e=e.substring(0,e.lastIndexOf("."))}}return e?{stateMachineTarget:e,stateMachine:this.getStateMachine(t,"",e),index:o}:{}}executeStateMachine(e,t,n,r=!0,s={}){const{stateMachineTarget:a,index:o}=this.getStateMachineObjByPath(t,e,r);if(!a)return!1;const i=qp(e),c=yp(i,e)||{};let[,l]=t.split(a);if(!l)return!1;const u=c?.subscriptFieldName&&t.includes(c?.index)||c?.isPageGroup;null!==o&&([,l]=u?l.split(/(?=\.\w+)/):l.split(/^\[\d+\]/gm));const d={[Il(l)]:n},p=this.getStateMachine(e,"",a);if(null!==o)if(u){const t=fi(e);"CREATE"===c?.resourceStatus&&t.forEach((e=>{"UPDATE"!==e.instruction||e.groupIndex!==c.index||e.content[c.subscriptFieldName]||p.update({[c.subscriptFieldName]:c.index},o,s.skipStateUpdate??!0,s)})),p?.update(d,o,s.skipStateUpdate??!0,s)}else p?.update(d,Number(o)+1,s.skipStateUpdate??!0,s);else p?.updatePage(jg.unflatten(d));return!0}registerForServerChanges(){Ig.registerForListChanges(((e,t,n)=>{setTimeout((()=>{this.generatePageInstructions(e,t,n)}),0)}))}registerForServerChangesSync(){Ig.registerForListChanges(((e,t,n)=>{this.generatePageInstructions(e,t,n)}))}generatePageInstructions(e,t,n){const r="].";if(!t.includes(".classID")&&gl.isPropertyEditable(e,t)&&this.executeStateMachine(e,t,n),!t.includes(".classID")&&t.includes(r)){const s=t.substring(0,t.lastIndexOf("[")),a=gl.getEditableFields(e);if(["multiselect","checkbox"].includes(a.find((e=>e.name===s))?.type)){const a=eo.getContextReferences(e),o=a?.get(s),i=t.substring(t.lastIndexOf(r)+2);o?.props.selfReferencingDatapageKeys?.includes(i)&&this.executeStateMachine(e,t,n)}}}unRegisterForServerChanges(){Ig.unRegisterForListChanges()}},ml={},Il=e=>e.startsWith(".")?e.substring(1):e,yl=e=>{delete ml[e]},El=(e,t={})=>{const{includeDisabledFields:n=!1}=t,r=Bg.resolveContextTreeNodeProps(e),s=!0!==r.readOnly&&!1!==r.visibility&&(n||!0!==r.disabled),a="string"==typeof e?.value&&e?.value.includes("@FILTERED_LIST"),o=(e=>e.selectionList||e.selectionKey||"Editable"===e.renderMode&&e.referenceList)(e);return(e?.value||o)&&!a&&s},Al=(e,t,n,r,s)=>(fl.executeStateMachine(e,r,Bg.getLitePropertyValue(n,t))||s.push(r),s),_l=(e,t,n)=>{const r=t.isInsideList,{ignoreFieldsInsideList:s=!0}=n;return(!r||r&&!s)&&!Array.isArray(Bg.getLitePropertyValue(t,e))&&!(t.componentName&&["Address","Attachment"].includes(t.componentName))},Cl=(e,t={})=>{let n=[];const r=[],s=eo.getContextReferences(e);return s?(({editableFormFieldsReferenceList:n}=((e,t,n)=>{const{includeDisabledFields:r=!1}=n;let s=[];for(const[a,o]of e){const e=Bg.resolveContextTreeNodeProps(o.props),i=e.propertyName;El(o.props,{includeDisabledFields:r})&&_l(a,e,n)&&(s=Al(t,i,e,a,s))}return{editableFormFieldsReferenceList:s}})(s,e,t)),ml[e]&&r.push(...Object.keys(ml[e].fieldOrder??{})),{formInputs:n,formPageFields:r}):{formInputs:n,formPageFields:r}},Sl=e=>{let t=[];const n=eo.getContextReferences(e);if(n)for(const[e,r]of n){const n=r?.props;if(El(n)&&"Attachment"===n?.componentName){const r="true"===n?.allowMultiple;t=[...t,{type:"File",allowMultiple:r,fullPath:e}]}}return t},Tl=(e,t={})=>{const n={},r=Sg(e),{ignoreFieldsInsideList:s=!0,isTransientContext:a=!1,includeDisabledFields:o=!1,isObjectWideAction:i=!1,isExternalObject:c=!1}=t,l=((e,t,n)=>e||t?n?.objectInfo:n?.caseInfo)(i,c,r);if(a||l){const{formInputs:t,formPageFields:i}=Cl(e,{ignoreFieldsInsideList:s,includeDisabledFields:o});((e,t,n)=>{e.forEach((e=>{let r=jg.getIn(t,e);"object"==typeof r&&(r=jg.deepClone(r),delete r?.classID),jg.buildObject(e,n,r)}))})(i,r,n),t&&t.length>0?t.forEach((e=>{jg.buildObject(e,n,jg.getIn(r,e))})):a||jg.buildObject(U.CASE_INFO.CASE_INFO_CONTENT,n,{})}if(!a&&r?.dataInfo?.content){const{formInputs:t}=Cl(e,{ignoreFieldsInsideList:s});t.forEach((e=>{jg.buildObject(e,n,jg.getIn(r,e))}))}return n},Nl=(e,t)=>{const n=eo.getContextReferences(e);let r=!0;if(!n)return r;for(const[e,s]of n){const n=Bg.resolveContextTreeNodeProps(s.props);if(El(s.props)&&(!t||e.includes(t))){const e=Fi.validate(n.componentName?.toLowerCase(),n.propertyName,Bg.getLitePropertyValue(n,n.propertyName),n);r&&(r=!e.message)}}return r},Ol=(e,t=!1)=>{const n=eo.getContextReferences(e),r=[];if(n)for(const[e,s]of n){if(!1!==Bg.resolveContextTreeNodeProps(s.props).visibility){const n=8,s=t?e:e.substring(e.indexOf("content")+n);r.push(s)}}return r},Pl=e=>{const t=[],n=eo.getContextReferences(e);if(n)for(const[e,r]of n){const n=Bg.resolveContextTreeNodeProps(r.props);El(r.props)&&"Attachment"!==n.componentName&&"multirecordlist"!==n.type&&t.push({name:e,label:n.label,type:n.componentName?.toLowerCase()})}return t};class Dl{static isCaseActive(e,t){if(!e||!t)return!1;const n=Ip(t);if(n){const r=Dp(t),{items:s={}}=n;return!(!r||!s[r]||s[r].key!==e)}return!1}static getCaseEditMetadata=(e,t)=>{const n={caseID:e,viewID:"pyEdit"},{restApi:r,reqType:s}=$f("loadView",n);return Bo(r,{method:s},t)};static isExternalCaseType=e=>{const t=Dh.getCaseTypeList()?.find((t=>"Case"===t.objectType&&t.DisplayMandatoryInputsForObject&&t.pyWorkTypeImplementationClassName===e));return!!t};static getCaseEditLock=(e,t)=>{const n={caseID:e,actionID:"pyUpdateCaseDetails"},{restApi:r,reqType:s}=$f(Ke,n);return Bo(`${r}?viewType=page`,{method:s},t)};static updateCaseEditFieldsData=(e,t,n,r)=>{const s={caseID:e,actionID:"pyUpdateCaseDetails"},{restApi:a}=$f(Ke,s),o=t[e];return Bo(`${a}?viewType=form`,{method:"PATCH",body:{content:{...o}},headers:{"if-match":n}},r)};static getCaseMessages=e=>Sg(e)?.caseMessages;static getPropertiesToReplace=e=>(Sl(e)||[]).map((e=>({path:e.fullPath,allowMultiple:e.allowMultiple})));static getPropertiesToReArrange=e=>(Sl(e)||[]).filter((e=>e.allowMultiple)).map((e=>e.fullPath));static getUniqueGadgetId=()=>jg.generateUniqueID().substring(0,5);static getRemoteCaseMapping=()=>$.getRemoteCaseMapping();static isTraditionalRemoteCase=e=>$.isTraditionalRemoteCase(e);static getRemoteCaseKey=(e,t)=>{let n=t;try{e&&(n=e.slice(e.indexOf(" ")+1,e.indexOf("!")))}catch{}return n};static isObjectCaseType=e=>{const t=Dh.getCaseTypeList()?.filter((t=>t.pyWorkTypeImplementationClassName===e));return t&&t.length>0&&"Object"===t[0].objectType};static isExternalObject=e=>{const t=Dh.getCaseTypeList()?.filter((t=>t.pyWorkTypeImplementationClassName===e));return t&&t.length>0&&t[0].DisplayMandatoryInputsForObject};static getRouteKeyForCreateWork=(e,t=!1)=>Dl.isExternalObject(e)&&t?"retrieveActionViewForNewObject":Dl.isObjectCaseType(e)?St:yt}const Rl=Dl,bl=e=>{const{activeActionID:t,availableActions:n}=e||{};if(t&&n){const e=n.find((e=>e.ID===t));return Boolean(e)}return!1},vl=e=>{if(Rl.isObjectCaseType(String(e?.objectTypeID))&&!bl(e))return!0;if(e){const{stageID:t,stages:n=[]}=e,r=n.length;for(let e=0;e<r;e+=1){if(n[e].ID===t)return"create"===n[e].transitionType&&"active"===n[e].visited_status}}return!1},xl=(e,t)=>{if(e&&t){const n=jg.getIn(t,["assignments","0","assigneeInfo"],{}),{ID:r,type:s}=n;return"worklist"===s?.toLowerCase()&&r===e}return!1},wl=(e,t)=>{const n=Bg.getPropertyValue(U.CASE_INFO.ACTIVE_ACTION_ID,t,e),r=Bg.getPropertyValue(U.CASE_INFO.AVAILABLEACTIONS,t,e);let s=!1;if(r&&n){const e=r.find((e=>e.ID===n));e&&(s=e.type.toLowerCase()===U.LOCAL_ACTION_TYPE.CASE_WIDE.toLowerCase())}if(e&&!r){const t=Sg(e);s=t?.context_data?.actionType===j.CASE}return s},Ml=e=>Pg(null,j.CASE_VIEW_MODE_PROP,e)===j.PERFORM_MODE&&(e.includes(j.WORKAREA)||e.includes(j.MODAL)),Ll=e=>{const t=e?.parentCaseInfo?.ID;return Boolean(e&&t)},Fl=(e,t,n)=>{let r;const s=e?.find((e=>e.ID===t))?.actions,a=s?.filter((e=>e.ID===j.FIX_BROKEN_ASSIGNMENTS))||[];return r=n&&a?.length>0?a[0].ID:n||((e,t)=>{if(!Array.isArray(e)||!t)throw new Error("Invalid parameters passed to getAssignmentActionID API");return e.find((e=>e.ID===t))?.actions?.[0]?.ID})(e,t),r},Ul=(e,t,n)=>{let r,s,a,o,i,c,l,u,d;const p=Sg(e),h=p?.caseInfo?.caseTypeID||p?.objectInfo?.objectTypeID;return n?.isTriggeredFromDifferentContext?(r=p.caseInfo.assignments[0].ID,s=p.caseInfo.ID,a=p.caseInfo.assignments,o=p.caseInfo.activeActionID,i=p.caseInfo.availableActions,c=p.caseInfo,l=p.caseInfo.businessID,u=p.caseInfo.caseTypeID,d=p.caseInfo.caseTypeName):p?.objectInfo&&Rl.isObjectCaseType(h)?(s=p.objectInfo.ID,o=p.objectInfo.activeActionID,i=p.objectInfo.availableActions,c=p.objectInfo,l=p.objectInfo.businessID,u=p.objectInfo.objectTypeID,d=p.objectInfo.objectTypeName):(r=t.getValue(j.getProperty(U.CASE_INFO.ASSIGNMENT_ID)),s=t.getValue(j.getProperty(U.CASE_INFO.CASE_INFO_ID)),a=t.getValue(j.getProperty(U.CASE_INFO.ASSIGNMENTS)),o=t.getValue(j.getProperty(U.CASE_INFO.ACTIVE_ACTION_ID)),i=t.getValue(j.getProperty(U.CASE_INFO.AVAILABLEACTIONS)),c=t.getValue(j.getProperty(U.CASE_INFO.CASE_INFO)),l=t.getValue(j.getProperty(U.CASE_INFO.BUSINESS_ID)),u=t.getValue(j.getProperty(U.CASE_INFO.CASE_TYPE_ID)),d=t.getValue(j.getProperty(U.CASE_INFO.CASE_TYPE_NAME))),{assignmentID:r,caseID:s,assignments:a,localActionID:o,caseActions:i,caseInfo:c,businessID:l,caseTypeID:u,caseTypeName:d}},jl=(e,t)=>{if(Object.keys(e??{}).length>0&&t?.startsWith("http")){const n=new URL(t),r=new URLSearchParams(n.search);return Object.keys(e).forEach((t=>{r.append(t,String(e[t]))})),n.search=r.toString(),n.toString()}return t},Vl=(e,t="case")=>{const n=e?.payload?.err?.response?.data?.displayButtonsOnErrors||[],r=e?.payload?.err?.response?.status;if(Array.isArray(n)&&n.length>0&&424===r){n.forEach((e=>{e.isErrorButton=!0}));const r=e.payload.context,s=Sg(r),a=((e,t)=>(e.forEach((e=>{!0!==e.isErrorButton||t.some((t=>t.actionID===e.actionID))||(t=[...t,e])})),t))(n,s?.caseInfo?.actionButtons?.secondary||[]),o={data:{["dataObject"===t?U.DATA_INFO.DATA_INFO:U.CASE_INFO.CASE_INFO]:{actionButtons:{secondary:a}}},target:qp(r),context:r};Cg({type:fe,payload:o})}};const kl=class{constructor(e){this.c11nEnv=e}validate(e,t){const{value:n}=this.c11nEnv.getStateProps();if(!t&&!(t=n)){const e=this.c11nEnv.getComponentConfig(),n=this.c11nEnv.getStateProps();t="multi"===e.selectionMode?n.selectionList:"Editable"===e.renderMode?n.referenceList:"single"===e.selectionMode?n.selectionKey:n.value}const r=((e,t,n)=>{const r=""===t&&n?.startsWith(".")?n.substring(1,n.length):n,s=eo.getContextReferences(e)?.get(`${t}${r}`)?.props;return s?Bg.resolveContextTreeNodeProps(s):s})(this.c11nEnv.getContextName(),this.c11nEnv.getPageReference(),t),{message:s}=Fi.validate(this.c11nEnv.getComponentName()?.toLowerCase(),t,e,r);return s?{status:!1,message:s}:{status:!0}}},$l="OPEN_PROCESS_ACTION",Bl="OPEN_ASSIGNMENT",Gl="DELETE_CASE_IN_CREATE_STAGE",Wl="SAVE_AND_CLOSE",Hl=e=>({type:Wl,payload:e}),ql="DELETE_WORK";const zl=class{static getSavableDataPage(e){return ug(e)}static getLookUpDataPage(e){return pg(e)}static getLookUpDataPageInfo(e){return hg(e)}static getDataPageKeys(e){return dg(e)}};const Yl=class{static getPropertyName(e){return un.getPropertyName(e)}static isProperty(e){return un.isProperty(e)}static getLeafPropertyName(e){return un.getLeafPropertyName(e)}static isPropertyInternal(e){return e.startsWith("px")||e.startsWith("pz")}};class Kl{static createContainerPConnect(e,t,n,r=!1){const{accessedOrder:s,items:a}=e;if(s&&a){const e=s[s.length-1];if(a[e]?.view&&Object.keys(a[e].view).length>0){const s=a[e],o=e.substring(0,e.lastIndexOf("_")),{view:i,context:c}=s,{viewName:l,viewContext:u}=this.processRootViewDetails(i,s,t);if(!l)return null;return vd({meta:i,options:{context:c,pageReference:u||t,containerName:n,containerItemID:e,parentPageReference:t,hasForm:r||n===gp.WORKAREA||n===gp.MODAL||l===j.CREATE_DETAILS_VIEW_NAME,target:o}}).getPConnect}}return null}static processRootViewDetails(e,t,n){const{config:{context:r,name:s}={}}=e,{context:a}=t;let o=s,i=r;const c=Yl.isProperty(s),l=Yl.isProperty(r);if(l){const e=Yl.getPropertyName(r);i=Og(`.${e}`,e.startsWith(".")?n:"",a)}if(i||(i=n),c){const e=Yl.getPropertyName(s);o=Og(`.${e}`,i,a)}return c&&l&&""!==o&&(o=s,i=r),{viewName:o,viewContext:i}}static addFlowContainerItem(e){const t=e.getContainerManager(),n=e.getContextName();let r,s;if("review"!==e.getValue("context_data.caseViewMode")){const e=n.substring(0,n.lastIndexOf("_")),t=Dp(e),a=yp(e,t);a&&({key:r,flowName:s}=a)}t.addContainerItem({semanticURL:"",key:r,flowName:s,caseViewMode:"perform",resourceType:"ASSIGNMENT",data:e.getDataObject(n)})}static hasContainerItems=e=>{const t=e.getContextName(),n=e.getContainerName();return PCore.getContainerUtils().hasContainerItems(`${t}/${n}`)};static hasGetNextWorkLinks=e=>e.getValue(j.CASE_INFO.GETNEXTWORK);static getActiveCaseActionName=e=>{const t=e.getValue(j.CASE_INFO.CASE_INFO_ACTIONS),n=e.getValue(j.CASE_INFO.ACTIVE_ACTION_ID),r=t.find((e=>e.ID===n));return r?.name||""};static getFirstCaseActionName=e=>{const t=e.getValue(j.CASE_INFO.CASE_INFO_ACTIONS);return t[0]?.name||""};static hasNotificationMessages=e=>!!e.getValue("caseMessages");static isCaseWideLocalAction=e=>{const t=e.getValue(j.CASE_INFO.ACTIVE_ACTION_ID),n=e.getValue(j.CASE_INFO.CASE_INFO_ACTIONS);if(n&&t){const e=n.find((e=>e.ID===t));return"Case"===e?.type}return!1};static getChildCaseAssignments=e=>{const t=e.getValue(j.CASE_INFO.CHILD_ASSIGNMENTS);let n=[];return t&&t.length>0&&t.forEach((({assignments:e=[],Name:t,caseTypeID:r})=>{const s=e.map((e=>({...e,caseName:t,caseTypeID:r})));n=n.concat(s)})),n};static hasAssignments=e=>{const t=e.getValue(j.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS),n=Kl.getChildCaseAssignments(e);return!!(Array.isArray(n)&&n.length>0||Array.isArray(t)&&t.length>0||Kl.isCaseWideLocalAction(e))};static showBanner=e=>{const t=e();return Kl.hasNotificationMessages(t)||!Kl.hasAssignments(t)};static showTodo=e=>"perform"!==e.getValue("context_data.caseViewMode");static isRenderWithToDoWrapper=(e,t)=>{const n=e(),{showWithToDo:r}=t;return r&&(!Kl.isCaseWideLocalAction(n)||Kl.showTodo(n))};static getToDoAssignments=e=>{const t=e.getValue(j.CASE_INFO.CASE_INFO_ACTIONS),n=e.getValue(j.CASE_INFO.ASSIGNMENT_LABEL),r=e.getValue(j.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS)||[],s=Kl.getChildCaseAssignments(e)||[];let a=JSON.parse(JSON.stringify(s));a=a.map((e=>(e.isChild=!0,e)));const o=[...r,...a];let i=JSON.parse(JSON.stringify(o));return t&&!Kl.showTodo(e)&&(i=i.map((t=>(t.name=Kl.getActiveCaseActionName(e)||t?.name||n,t)))),i}}const Jl=Kl;const Xl=class{constructor(e){this.c11nEnv=e}containerManagerPromise=e=>{const t=rc.getNextActionMgrId();let n,r;const s=new Promise(((e,t)=>{n=e,r=t}));if(!n||!r)throw new Error("resolveFn or rejectFn is not defined.");return rc.register(t,s,n,r,e),{actionMgrID:t,promise:s}};initializeContainers(e){const t=Ae,n=this.c11nEnv,r={context:n.getContextName(),name:n.getContainerName(),type:j.CONTAINER_TYPE.SINGLE},{actionMgrID:s,promise:a}=this.containerManagerPromise(t),o={...r,...e,actionMgrID:s};return Cg(ef(o)),a}addContainerItem(e){const t=Ce,n=this.c11nEnv,r=n.getMetadata(),{children:s}=r||{};let a;Array.isArray(s)&&s.length>0&&([a]=s);const o=n.getContextName(),i=n.getContainerName(),c=H(i,o,e?.containerType===j.CONTAINER_TYPE.SINGLE),l=Pt(i,o),u={root:{...a,config:{...a?.config,context:a?.config?.context||n.getPageReference?.()}},containerItemID:c,context:c,target:l,containerName:i};e=JSON.parse(JSON.stringify(e)),[j.WORKAREA].includes(i)&&delete e.data?.coreHeaders;const{actionMgrID:d,promise:p}=this.containerManagerPromise(t),h={...u,...e,actionMgrID:d};return Cg(nf(h)),p}updateContainerItem(e){if(!e?.containerItemID)return Promise.reject(new Error("updateContainerItem : containerItemID is required in containerInfo object"));const t=xe,n={context:vp(e.containerItemID),target:qp(e.containerItemID)},{actionMgrID:r,promise:s}=this.containerManagerPromise(t),a={...n,...e,actionMgrID:r};return Cg(lf(a)),s}activateContainerItem(e){if(!e?.containerItemID)return Promise.reject(new Error("activateContainerItem : containerItemID is required in containerInfo object"));const t=ve,n={target:qp(e.containerItemID)},{actionMgrID:r,promise:s}=this.containerManagerPromise(t),a={...n,...e,actionMgrID:r};return Cg(hf(a)),s}removeContainerItem(e){if(!e?.containerItemID)return Promise.reject(new Error("removeContainerItem : containerItemID is required in containerInfo object"));const t=Se,n={context:vp(e.containerItemID),target:qp(e.containerItemID)},{actionMgrID:r,promise:s}=this.containerManagerPromise(t),a={...n,...e,actionMgrID:r};return Cg(ff(a)),s}resetContainers(e){if(!e?.context||!e?.name)return Promise.reject(new Error("resetContainers : context and name are required in containerInfo object"));const t=_e,n=Gp(e),{actionMgrID:r,promise:s}=this.containerManagerPromise(t),a={...n,...e,actionMgrID:r};return Cg(tf(a)),s}addTransientItem(e){const{id:t,data:n}=e,r=this.c11nEnv.getContextName(),s=z(t,r),a=Xp(r);return s&&a.includes(s)||Cg(rf({transientItemID:s,contextName:r,target:qp(r),data:n})),s}updateTransientData(e){const{transientItemID:t,data:n}=e,r=this.c11nEnv.getContextName();if(t){if(!Xp(r).includes(t))return;Cg(sf({transientItemID:t,data:n}))}}removeTransientItem(e){const t=this.c11nEnv.getContextName(),{target:n=this.c11nEnv.getTarget(),containerItemID:r,transientItemID:s}=e;if(s&&r){if(!Xp(t).includes(s))return;Cg(If({target:n,containerItemID:r,transientItemID:s}))}}createContainerPConnect(e,t,n,r=!1){Jl.createContainerPConnect(e,t,n,r)}hasContainerItems(){const e=this.c11nEnv.getContextName(),t=this.c11nEnv.getContainerName();return Vp(`${e}/${t}`)}isContainerInitialized(){const e=this.c11nEnv.getContextName(),t=this.c11nEnv.getContainerName();return Op(e,t)}};var Ql=function(e,t){return e===t||"function"==typeof t&&e===t.toString()};function Zl(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n,r,s=e.length;return n=1===s?function(t){return Ql(t.type,e[0])}:function(t){for(var n=0;n<s;n++)if(Ql(t.type,e[n]))return!0;return!1},Da((function(e,t){var s=0;e.subscribe(Ra(t,(function(e){return n.call(r,e,s++)&&t.next(e)})))}))}function eu(e,t){return Da((function(n,r){var s=null,a=0,o=!1,i=function(){return o&&!s&&r.complete()};n.subscribe(Ra(r,(function(n){null==s||s.unsubscribe();var o=0,c=a++;Na(e(n,c)).subscribe(s=Ra(r,(function(e){return r.next(t?t(n,e,c,o++):e)}),(function(){s=null,i()})))}),(function(){o=!0,i()})))}))}function tu(e,t){return Da((function(n,r){var s=0;n.subscribe(Ra(r,(function(n){r.next(e.call(t,n,s++))})))}))}function nu(e,t,n){return void 0===n&&(n=1/0),Gs(t)?nu((function(n,r){return tu((function(e,s){return t(n,e,r,s)}))(Na(e(n,r)))}),n):("number"==typeof t&&(n=t),Da((function(t,r){return function(e,t,n,r,s,a,o,i){var c=[],l=0,u=0,d=!1,p=function(){!d||c.length||l||t.complete()},h=function(e){return l<r?g(e):c.push(e)},g=function(e){a&&t.next(e),l++;var i=!1;Na(n(e,u++)).subscribe(Ra(t,(function(e){null==s||s(e),a?h(e):t.next(e)}),(function(){i=!0}),void 0,(function(){if(i)try{l--;for(var e=function(){var e=c.shift();o?Pa(t,o,(function(){return g(e)})):g(e)};c.length&&l<r;)e();p()}catch(e){t.error(e)}})))};return e.subscribe(Ra(t,h,(function(){d=!0,p()}))),function(){null==i||i()}}(t,r,e,n)})))}function ru(e){return e&&Gs(e.schedule)}function su(e){return e[e.length-1]}function au(e){return ru(su(e))?e.pop():void 0}function ou(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return La(e,au(e))}var iu=new ma((function(e){return e.complete()}));function cu(e){return e?function(e){return new ma((function(t){return e.schedule((function(){return t.complete()}))}))}(e):iu}const lu=(e,t,n)=>Ua((r=>("ERR_CANCELED"!==r?.code&&console.error(e,r),ou(Sf(e,r,t,null,n))))),uu=(e,t)=>n=>new ma((r=>{let s={},a=0;return n.pipe(nu((n=>{const r=Date.now();let o;return o=t||h(),o&&o(n,s)&&r-a<e?cu():(s=n,a=r,ou(n))}))).subscribe(r)})),du=e=>{const{dataPageID:t,context:n,headers:r,containerItemID:s}=e,a={data_view_ID:t},{restApi:o,reqType:i}=$f("createDataObject",a),{content:c}=qc(s);return La(Bo(o,{method:i,headers:r,body:{data:c.content,pageInstructions:c?.pageInstructions}},s)).pipe(tu((t=>({response:t.data,actionInPayload:e}))),lu("Error occurred during ajax call at createDataObject Epic",n))},pu=e=>{const{dataLookUp:t,context:n,headers:r,viewName:s,requestPayload:a}=e,o={data_view_ID:t,view_ID:s},{restApi:i,reqType:c}=$f("readDataObject",o);return La(Bo(i,{method:c,headers:r,body:{dataViewParameters:a}},n)).pipe(tu((t=>({response:t.data,headers:Hc(t.headers),actionInPayload:e}))),lu("Error occurred during ajax call at getDataObjectView Epic",n))},hu=e=>{const{dataPageID:t,context:n,headers:r,containerItemID:s,key:a}=e,o={data_view_ID:t},{restApi:i,reqType:c}=$f("updateDataObject",o),{content:l}=qc(s);return La(Bo(i,{method:c,headers:{...r,"if-match":e?.etag},body:{data:{...l.content,...a},pageInstructions:l.pageInstructions||[]}},s)).pipe(tu((t=>({response:t.data,actionInPayload:e}))),lu("Error occurred during ajax call at updateDataObject Epic",n))},gu=e=>{const{lookupDatapage:t,context:n,headers:r,actionID:s,dataViewParameters:a}=e,o={data_view_ID:t,action_ID:s},{restApi:i,reqType:c}=$f("openDataObjectAction",o);return La(Bo(i,{method:c,headers:r,body:{dataViewParameters:a}},n)).pipe(tu((t=>({response:t.data,headers:Hc(t.headers),actionInPayload:e}))),lu("Error occurred during ajax call at getDataObjectView Epic",n))},fu=e=>{const{savableDatapage:t,context:n,headers:r,actionID:s,keys:a,containerItemID:o,jsActionQueryParams:i}=e,c={data_view_ID:t,action_ID:s};let{restApi:l}=$f("submitDataObjectAction",c);const{reqType:u}=$f("submitDataObjectAction",c),{content:d}=qc(o);return l=jl(i,l),La(Bo(l,{method:u,headers:{...r,"if-match":e?.etag},body:{data:{...d?.content,...a},pageInstructions:d?.pageInstructions||[]}},n)).pipe(tu((t=>({response:t.data,actionInPayload:e}))),lu("Error occurred during ajax call at getDataObjectView Epic",n))};const mu=new class{constructor(){this.components={}}_checkComponent(e,t){return!!this.components[t]?.[e]}start(e,t,n,r,s){const a={viewName:e,pageReference:n,contextName:r,isInProgress:!0,active:!0,caseKey:t};this.components[r]=this.components[r]||{},this.components[r][s]=a}stop(e,t){this._checkComponent(e,t)&&(this.components[t][e].isInProgress=!1)}remove(e,t){this._checkComponent(e,t)&&delete this.components[t][e]}removeContext(e){delete this.components[e]}enableCascade(e){this.components[e]&&Object.values(this.components[e]).forEach((e=>{e.isInProgress&&(e.cascade=!0)}))}activate(e,t){this._checkComponent(e,t)&&(this.components[t][e].active=!0)}deactivate(e,t){this._checkComponent(e,t)&&(this.components[t][e].active=!1)}refreshActiveComponents(e){e&&this.components[e]&&Object.keys(this.components[e]).forEach((t=>{this.refreshComponent(t,e)}))}refreshComponent(e,t){if(!this._checkComponent(e,t))return;const n=this.components[t][e];if(n.active&&n.cascade){const{caseKey:e,viewName:r,pageReference:s}=n;Fd(e,r,t,s,{})}}},Iu="postDataViewMetadata",yu={getData:(e,t,n,r)=>((e,t,n,r={})=>{const s={dataViewName:e},{skipClearErrorMessages:a,signal:o,doNotMergeMessagesForStatusCode:i}=r,{restApi:c,reqType:l}=$f("getListData",s);return Bo(c,{method:l,body:t,...o&&{signal:o},...a&&{skipClearErrorMessages:a}},n,i)})(e,t,n,r),getListCount:(e,t,n)=>{const r={dataViewName:e},{restApi:s,reqType:a}=$f("getListDataCount",r);return Bo(s,{method:a,body:t},n)},getDataViewMetadata:(e,t,n,r)=>{const s=!!n,a=!!r,o=Ph.doesRestApiExist(Iu),i=(s||a)&&o?Iu:"getDataViewMetadata",c={dataViewName:e},{restApi:l,reqType:u}=$f(i,c);if(o){if(s)return Bo(l,{method:u,body:{associationFilter:n}},t);if(a)return Bo(l,{method:u,body:{propertyFilter:r}},t)}return Bo(l,{method:u},t)},getDataObjectView:(e,t,n,r,s={})=>{const{skipClearErrorMessages:a,signal:o,doNotMergeMessagesForStatusCode:i}=s,c={data_view_ID:e,view_ID:t},l={dataViewParameters:n},{restApi:u,reqType:d}=$f("readDataObject",c);return Bo(u,{method:d,body:l,...o&&{signal:o},...a&&{skipClearErrorMessages:a}},r,i)},getCaseEditMetadata:(e,t)=>Rl.getCaseEditMetadata(e,t),getCaseEditLock:(e,t)=>Rl.getCaseEditLock(e,t),updateCaseEditFieldsData:(e,t,n,r)=>Rl.updateCaseEditFieldsData(e,t,n,r),moveListRecords:(e,t)=>{const{sourceID:n,destinationID:r,context:s,listClass:a,viewName:o,viewClassName:i}=e,c={viewName:o,viewClassName:i},{restApi:l,reqType:u}=$f("moveListRecords",c);return Bo(l,{method:u,body:{content:{sourceID:n,destinationID:r,context:s,listClass:a}}},t)},isTimeElapsed:(e,t,n="")=>{if(t){if(e&&n===j.RELOAD_IF_OLDER_THAN)return new Date(e).setSeconds(t)<Date.now();if(e&&n===j.RELOAD_ONCE_PER_INTERACTION)return!0}return!0},getAppCacheKey:e=>void 0!==Mp("root").find((e=>e.includes("authoring-preview")))?`${j.AUTHORING_PREVIEW_CONTAINER}-${e}`:`${Xi.getAppAlias()}-${e}`,isDistinctResultsOnly:e=>{const t=Dh.getKeyMapping("pyGUID");return!e.some((e=>e.field===t))}};const Eu=class{constructor(e,t,n){this.filter=e,this.messageHandler=t,this.contextName=n}};const Au=class{constructor(){this.users={},this.connected=!1,this.connectionsCount=1}_handleUserPresence({message:e}){const{state:t,updateById:n}=e,r=this.users[n];r&&(r.state=t,Object.keys(r.subscribers).forEach((e=>{r.subscribers[e]?.callback({state:r.state})})))}_getAutoGenId(){return this.connectionsCount+=1,`${Date.now()}_${this.connectionsCount}`}subscribe(e,t,n){const r=this._getAutoGenId(),s=this.users[e];if(s)return s.subscribers[r]={callback:t,contextName:n},r;this.users[e]={subscribers:{[r]:{callback:t,contextName:n}}};const a={matcher:"PRESENCE",criteria:{userId:e}};return Pu.subscribe(a,this._handleUserPresence.bind(this)),r}unsubscribe(e,t){const n={matcher:"PRESENCE",unsubscribeUsers:{users:[e]}};this.users[e]&&this.users[e].subscribers&&(delete this.users[e].subscribers[t],0===Object.keys(this.users[e].subscribers).length&&(delete this.users[e],Pu.publishMessage(n)))}getUserState(e){return this.users[e]&&this.users[e].state}clearContext(e){Object.keys(this.users).forEach((t=>{Object.keys(this.users[t].subscribers).forEach((n=>{this.users[t].subscribers[n].contextName===e&&this.unsubscribe(t,n)}))}))}};var _u=s(631),Cu=s.n(_u);const Su=class{constructor(e,t){this.atomicSubscribers={},this.connectionsCount=1,this.connected=!1,this.matcher=e,this.criteria=t}_handleAtomicMessage({message:e}){Object.keys(this.atomicSubscribers).forEach((t=>{const n=this.atomicSubscribers[t],r=Object.keys(n.criteria),s=Object.keys(e);0===Cu()(r,s).length&&n.callback(e)}))}_getAutoGenId(){return this.connectionsCount+=1,`${Date.now()}_${this.connectionsCount}`}subscribe(e,t){if(!this.connected){const e={matcher:this.matcher,criteria:this.criteria};Pu.subscribe(e,this._handleAtomicMessage.bind(this)),this.connected=!0}const n=this._getAutoGenId();return this.atomicSubscribers[n]={criteria:e,callback:t},n}unsubscribe(e){delete this.atomicSubscribers[e]}};const Tu=new class{constructor(){this.subscriptions={}}getOrCreateSubscription(e){if(!this.subscriptions[e]){const t={caseId:e};this.subscriptions[e]=new Su("CASE",t)}return this.subscriptions[e]}};const Nu=class{static transformReference(e){return e.replace(/^[^.]*\./,"caseInfo.content.")}static extractReferenceParts(e){const t=e.split("."),n=t.pop()||"";return{pageReference:t.join("."),propertyName:n}}static publishCaseValuesUpdate(e,t){const n=`${t.actionInContext}/workarea`;Object.entries(e.message).forEach((([e,t])=>{const r=xp(n)||"",s=this.transformReference(e),{pageReference:a,propertyName:o}=this.extractReferenceParts(s);e.match(/\.\w+\[\d+\]\.\w+/)&&fl.executeStateMachine(r,s,t,!0,{skipStateUpdate:!0});Cg([{type:Q,payload:{reference:s,value:t,context:r}},{type:ee,payload:{reference:s,value:t,context:r,pageReference:a,propertyName:o}}])}))}};class Ou{static subscribers={};static connectionsCount=0;static webSocket=null;static connectionConfig=null;static inProgressSubscriptions=[];static inProgressMessages=[];static isServiceAlive=null;static serviceAliveHandler=null;static userPresence=new Au;static refreshB2SOffset=10;static agentSubscribeIdMap=new Map;static initConnection(e){if(!e)return;const{messagingService:t}=e;if(!t||t&&t.length<=6)return;const n=Xi.b2sJWT;if(!n||n.length<4)return;this.webSocket&&(this.cleanSocketListeners(),this.webSocket.close());const r=t.endsWith("/")?t+"ws":t+"/ws";try{const e=new WebSocket(`${r}`);this.webSocket=e,e.addEventListener("open",this.handleOnOpen.bind(this)),e.addEventListener("message",this.handleOnMessage.bind(this)),e.addEventListener("error",this.handleOnError.bind(this)),e.addEventListener("close",this.handleOnClose.bind(this))}catch(e){console.log(e)}}static handleOnError(e){this.getTokenExpiryTime()<=0&&(clearInterval(this.reInitInterval),this.reInitInterval=void 0),console.log("web socket connection error event: ",e)}static handleOnClose(e){null!==this.serviceAliveHandler&&(clearTimeout(this.serviceAliveHandler),this.serviceAliveHandler=null),e&&4001===e.code||this.connectionConfig?.disableReInit||this.reInitInterval||this.getTokenExpiryTime()<=0||this.reInitialization()}static handleOnOpen(){if(clearInterval(this.reInitInterval),this.reInitInterval=void 0,null!==this.webSocket&&1===this.webSocket.readyState){const e=Xi.b2sJWT;if(!e||e.length<4)return;this.publishMessage({token:e})}}static unsubscribeAgentMessageCaseValues(e){const t=Ou.agentSubscribeIdMap.get(e.assignmentID);Ou.unsubscribe(t??""),Ou.agentSubscribeIdMap.delete(e.assignmentID)}static subscribeAgentMessageCaseValues(e){const t={matcher:"COACH_UPDATE",criteria:{caseId:e.caseKey,assignmentId:e.assignmentID}},n=Ou.subscribe(t,(t=>{Nu.publishCaseValuesUpdate(t,e)}));Ou.agentSubscribeIdMap.set(e.assignmentID,n)}static handleOnMessage(e){if(null!==e&&"ALIVE"===e.data)null===this.isServiceAlive&&this.checkLiveliness(8e3),this.isServiceAlive=!0;else{let t=null;try{t=JSON.parse(e.data)}catch(t){console.error("Invalid data received from messaging service",e.data)}if(t&&t.msgId&&this.webSocket?.send(`{"ack":"${t.msgId}"}`),t&&t.filter){const{matcher:e,criteria:n}=t.filter;delete n.environmentID,Object.keys(this.subscribers).forEach((r=>{const s=this.subscribers[r];s.filter.matcher===e&&jg.isEqual(s.filter.criteria,n)&&s.messageHandler(t)}))}else if(t&&t.tokenExpiryTime){yo.subscribe(j.PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_OPENED,Ou.subscribeAgentMessageCaseValues),yo.subscribe(j.PUB_SUB_EVENTS.CASE_EVENTS.END_OF_ASSIGNMENT_PROCESSING,Ou.unsubscribeAgentMessageCaseValues),this.setTokenExpiryTime(t);const e=1e3*(this.getTokenExpiryTime()-this.refreshB2SOffset);setTimeout((()=>this.refreshB2STokenReInit()),e);let n=[];this.inProgressSubscriptions.forEach((({messageSubscriber:e,id:t})=>{n?.includes(t)||(n?.push(t),this.subscribeToSocket(e,t))})),this.inProgressSubscriptions=[],this.inProgressMessages.forEach((e=>{this.publishMessage(e)})),this.inProgressMessages=[],n=null}else console.error("filter missing from received data from messaging service",e.data)}}static reInitialization(e){this.reInitInterval||(Object.keys(this.subscribers).forEach((e=>{this.inProgressSubscriptions.push({messageSubscriber:this.subscribers[e],id:e})})),e?this.initConnection(this.connectionConfig):this.reInitInterval=setInterval((()=>{this.initConnection(this.connectionConfig)}),5e3))}static checkLiveliness(e){!1===this.isServiceAlive?this.reInitialization(!0):this.isServiceAlive=!1,null!==this.serviceAliveHandler&&clearTimeout(this.serviceAliveHandler),this.serviceAliveHandler=setTimeout((()=>{this.checkLiveliness(e)}),e)}static setConnectionConfig(e){this.connectionConfig=e}static cleanSocketListeners(){null!==this.webSocket&&(this.webSocket.removeEventListener("open",this.handleOnOpen.bind(this)),this.webSocket.removeEventListener("message",this.handleOnMessage.bind(this)),this.webSocket.removeEventListener("error",this.handleOnError.bind(this)),this.webSocket.removeEventListener("close",this.handleOnClose.bind(this)))}static disconnect(){null!==this.webSocket&&(this.cleanSocketListeners(),this.webSocket.close(),this.webSocket=null)}static subscribe(e,t,n,r){this.connectionsCount+=1;const s=r||`${Date.now()}_${this.connectionsCount}`,a=new Eu(e,t,n);return null!==this.webSocket&&1===this.webSocket.readyState?(this.subscribeToSocket(a,s),s):(this.inProgressSubscriptions.push({messageSubscriber:a,id:s}),null===this.webSocket&&this.initConnection(this.connectionConfig),s)}static subscribeToSocket(e,t){this.subscribers[t]=e;const n={filter:e.filter,subscribe:{id:t}};this.webSocket?.send(JSON.stringify(n))}static unsubscribe(e){if(this.subscribers[e]){delete this.subscribers[e];const t={unsubscribe:{id:e}};null!==this.webSocket&&1===this.webSocket.readyState&&this.webSocket.send(JSON.stringify(t))}}static publishMessage(e){null!==this.webSocket?null===this.webSocket||1!==this.webSocket.readyState?this.inProgressMessages.push(e):this.webSocket.send(JSON.stringify(e)):console.error("Web socket not initialized.")}static getUserPresence=()=>this.userPresence;static getCaseSubscription=e=>Tu.getOrCreateSubscription(e);static refreshB2STokenReInit=async()=>{const e={body:{B2SToken:Xi.b2sJWT}};Bi("refreshB2S",e).then((e=>{const{newB2SToken:t}=e.data;t&&t.length>30?(Xi.b2sJWT=t,this.setTokenExpiryTime({tokenExpiryTime:Math.round(Date.now()/1e3)+60}),this.webSocket?.close()):console.log("refreshB2S: invalid b2s length")})).catch((e=>{console.log(`refreshB2S: error occurred while fetching: ${e}`)}))};static getTokenExpiryTime=()=>{const e=Math.round(Date.now()/1e3);return this.tokenExpiryTime-e};static setTokenExpiryTime=e=>{this.tokenExpiryTime=e.tokenExpiryTime};static clearContext(e){Object.keys(this.subscribers).forEach((t=>{this.subscribers[t].contextName===e&&this.unsubscribe(t)})),this.userPresence.clearContext(e)}}const Pu=Ou;const Du=class{constructor(){this.records=[],this.maxRecords=0,this.isDirty=!1}getRecords(e){if(Number.isInteger(e?.pageNumber)&&Number.isInteger(e?.pageSize)){const t=[],{pageNumber:n,pageSize:r}=e,s=n*r;let a=s-r;for(;a<s;a+=1){if(!this.records[a])return this.maxRecords===a?t:[];t.push(this.records[a])}return t}return this.records}mergeRecords(e,t){if(Number.isInteger(t?.pageNumber)&&Number.isInteger(t?.pageSize)){const{pageNumber:n,pageSize:r}=t,s=n*r;let a=0;for(let t=s-r+1-1;t<s;t+=1)this.records[t]=e[a],a+=1;if(e.length<r){const t=(n-1)*r+e.length;this.setMaxRecordsCount(t)}}else e||(e=[]),Array.isArray(this.records)&&Array.isArray(e)&&(this.records=xg(this.records,e,{isArrayDeepMerge:!1})),this.setMaxRecordsCount(this.records.length)}setMaxRecordsCount(e){this.maxRecords=e}getMaxRecordsCount(){return this.maxRecords}};const Ru=new class{SUBSCRIPTION_STATUS_FAILED="FAILED";SUBSCRIPTION_STATUS_SUCCESS="SUCCESS";DATAPAGE_NOT_CACHED="Data Page Not Cached";DUPLICATE_SUBSCRIPTION_ID="Duplicate Subscription Id";MISSING_MANDATORY_FIELD="Missing Mandatory Field(s)";constructor(){this.dataStore={},this.dataStoreMeta={},this.subscribers={},this.dataPageSubscribers={},this.isCacheEnabled=!0,this.subscribedDataPageNames=new Set}getData(e,t,n,r){const s=this.generateHash(e,t,r);if(this.dataStore[e]&&this.dataStore[e][s]){const t=this.dataStore[e][s];return t.isDirty?[]:t.getRecords(n)}return[]}async getDataAsync(e,t,n={},r,s,a={}){if(this.subscribeToMessageService(e),a.purgeDataPageCache&&(this.dataStore[e]={},this._removeDataStoreMetaEntry(e)),!this.isCacheable(e,s)||a.invalidateCache){const o=await this.fetchData(e,n,r,s,t,a),i=o?.data?.data??[];return{...o.data,data:i,pageNumber:o?.data?.pageNumber,pageSize:o?.data?.pageSize,queryStats:o?.data?.queryStats,status:o?.status}}const o=this.getData(e,n,r,s);if(o.length>0)return Promise.resolve({data:o});const i=await this.fetchData(e,n,r,s,t,a);return{...i.data,data:this.mergeDataStore(e,n,r,s,i),pageNumber:i?.data?.pageNumber,pageSize:i?.data?.pageSize,queryStats:i?.data?.queryStats,status:i?.status}}async getPageDataAsync(e,t,n={},r={}){this.subscribeToMessageService(e);const s=this.generateHash(e,n,null);if(r.purgeDataPageCache&&(this.dataStore[e]={},this._removeDataStoreMetaEntry(e)),this.isCacheable(e)&&this.dataStore[e]&&this.dataStore[e][s]){if(!r?.invalidateCache)return Promise.resolve(this.dataStore[e][s]);delete this.dataStore[e][s],this._removeDataStoreMetaEntry(e,n,s)}const{restApi:a,reqType:o}=$f(j.GET_PAGE_DATA,{dataViewName:e,dataViewParameters:encodeURIComponent(JSON.stringify(n))}),i={method:o},c=a&&n&&0===Object.keys(n).length?a.split("?")[0]:a;return Bo(c,i,t).then((t=>(this.isCacheable(e)&&(this.dataStore[e]={...this.dataStore[e],[s]:t.data},this._addDataStoreMetaEntry(e,n,s)),t.data)))}subscribeToDataPageUpdates(e,t,n,r={}){if(!e||!t||!n)return!1;const s=this.generateHash(n,r,null);this.dataPageSubscribers[n]??={};const a=this.dataPageSubscribers[n];a[s]??={};const o=a[s];return!o[e]&&(o[e]??=t,!0)}unsubscribeToDataPageUpdates(e,t,n={}){if(!e||!t)return!1;const r=this.generateHash(t,n,null);return delete this.dataPageSubscribers[t]?.[r]?.[e],!0}_isDataPageCached(e,t){if(t&&jg.isObjectEmpty(t))return!!this.dataStore[e];const n=this.generateHash(e,t,null);return!!this.dataStoreMeta[e]?.[n]?.length}updateDataPageStore(e={}){Object.keys(e).forEach((t=>{this.dataStore[t]||(this.dataStore[t]={});const n=e[t];Object.keys(n).forEach((n=>{if(this.dataStore[t][n]){this.dataStore[t][n].mergeRecords(e[t][n].pxResults)}else{const r=new Du;this.dataStore[t][n]=r,r.mergeRecords(e[t][n].pxResults||[])}}))}))}_addDataStoreMetaEntry(e,t,n){const r=this.generateHash(e,t,null);this.dataStoreMeta[e]??={};const s=this.dataStoreMeta[e];s[r]??=[];const a=s[r];a.includes(n)||a.push(n)}_removeDataStoreMetaEntry(e,t,n){if(!e||t||n||(this.dataStoreMeta[e]={}),e&&t&&n){const r=this.generateHash(e,t,null);this.dataStoreMeta[e][r]=this.dataStoreMeta[e][r].filter((e=>e!==n))}}mergeDataStore(e,t,n,r,s){const a=this.generateHash(e,t,r),o=s?.data?.data;if(!o||0===o.length)return[];this.dataStore[e]||(this.dataStore[e]={}),this.dataStore[e][a]||(this.dataStore[e][a]=new Du);const i=this.dataStore[e][a];return i.mergeRecords(o,n),i.isDirty=!1,this._addDataStoreMetaEntry(e,t,a),i.getRecords(n)}isDataPage(e=""){return e.startsWith("D_")||e.startsWith("Declare_")}subscribeToUpdate(e,t,n,r,s,a){this.subscribers[e]=this.subscribers[e]||{},this.subscribers[e].callback=this.subscribers[e].callback||{},a&&!this.subscribers[e].callback?.[a]&&(this.subscribers[e].callback[a]=s),this.subscribeToCascadeUpdates(e,t,n,r,a)}unsubscribe(e,t,n,r,s){delete this.subscribers[e]?.callback?.[s],t&&t.length>0&&Ig.unRegisterFields(n,r,t,s)}handleMessage(e){const{msgId:t,message:n}=e,{datapage:r,parameters:s=""}=n,a=this.subscribers[r];this.markDataInstanceDirty(r,""===s?null:JSON.parse(s)),t&&this._executeDataPageSubscriptions(e),!t&&a?.callback&&Object.keys(a.callback).forEach((t=>{a.callback?.[t](e.message)}))}markDataInstanceDirty(e,t){let n,r;if((!t||(n=this.generateHash(e,t,null),r=this.dataStoreMeta[e]?.[n],r?.push(this.generateHash(e,null)),r))&&this.dataStore[e]){Object.keys(this.dataStore[e]).filter((e=>!t||!r||r.includes(e))).forEach((t=>{this.dataStore[e][t].isDirty=!0}))}}_executeDataPageSubscriptions(e){const{message:t}=e,{datapage:n,parameters:r}=t,s=r?JSON.parse(r):null;if(this.dataPageSubscribers[n])if(s){const t=[];t.push(this.generateHash(n,s,null)),t.push(this.generateHash(n,null,null)),t.forEach((t=>{const r=this.dataPageSubscribers[n]?.[t]??{};Object.keys(r).forEach((t=>{r[t](e.message)}))}))}else{const t=this.dataPageSubscribers[n];Object.keys(t).forEach((n=>{const r=t[n];Object.keys(r).forEach((r=>{t[n][r](e.message)}))}))}}isPerInteraction(e){const t=ng(e);return"reloadOncePerInteraction"===t?.refreshStrategy?.type}disableCache(e){this.isCacheEnabled=!e}generateHash(e,t,n){const r=ng(e);let s=[];r||(s=Object.keys(t||{}).map((e=>({name:e}))));let a="",o=e;const i=[];return(r?.parameters||s).forEach((e=>{t?.[e.name]?i.push(t[e.name]):i.push(e.defaultValue??j.NULL_STRING)})),n&&i.push(JSON.stringify(n)),i.join(j.HASH_DELIMITER)&&(a=jg.getHashedString(i.join(j.HASH_DELIMITER)),o=e+j.UNDERSCORE_STRING+a),o}async fetchData(e,t,n,r,s,a){const{additionalApiParams:{useExtendedTimeout:o=!1,includeTotalCount:i=!1}={},...c}=a,l={dataViewParameters:t};return i&&(l.includeTotalCount=!0),o&&(l.useExtendedTimeout=!0),n&&(l.paging=n),r&&(l.query=r),yu.getData(e,l,s,c)}handleCascadeUpdate(){const{dataPageName:e,scope:t}=this;t.handleMessage({message:{datapage:e,parameters:""}})}subscribeToCascadeUpdates(e,t,n,r,s){t&&t.length>0&&Ig.registerFields(n,r,t,this.handleCascadeUpdate.bind({dataPageName:e,scope:this}),s)}subscribeToMessageService(e){if(e&&this.subscribedDataPageNames.has(e))return;const t={matcher:"DATAPAGE_UPDATED",criteria:{datapage:e}};Pu.subscribe(t,this.handleMessage.bind(this)),this.subscribedDataPageNames.add(e)}isCacheable(e,t){return!(this.isPerInteraction(e)||!this.isCacheEnabled)&&!(t&&Object.keys(t).length>1)}};const bu=class{constructor(e,t,n,r,s=100,a=500){this.finalDataViewCall=e,this.combiner=t,this.comparator=n,this.separator=r,this.maxtime=s,this.maxsize=a,this.groupedDataViewArray=[]}findCombinableDataViewCall(e){return this.groupedDataViewArray.find((t=>this.comparator(t,e)))}dequeueAllDataViewCalls(){for(this.groupedDataViewArray.reverse();this.groupedDataViewArray.length>0;){const e=this.groupedDataViewArray.pop();this.finalDataViewCall(e).then((t=>{this.separator(e,t)}))}clearTimeout(this.timeoutId)}dequeueDataViewCallOnSizeExceed(e){const t=this.groupedDataViewArray.findIndex((t=>this.comparator(t,e)));this.groupedDataViewArray[t]&&(this.groupedDataViewArray.splice(t,1),this.finalDataViewCall(e).then((t=>{this.separator(e,t)})))}queueDataViewCall(e,t){let n,r,s=this.findCombinableDataViewCall(e);return n=new Promise((e=>{r=e})),s&&!s.dataViewCallMap[t]?(this.combiner(s,e),s.dataViewCallMap[t]={promise:n,resolve:r}):s?n=s.dataViewCallMap[t].promise:(s={...e,dataViewCallMap:{[t]:{promise:n,resolve:r}}},this.groupedDataViewArray.push({...e,dataViewCallMap:{[t]:{promise:n,resolve:r}}})),Object.keys(s.dataViewCallMap).length===this.maxsize?this.dequeueDataViewCallOnSizeExceed(s):(clearTimeout(this.timeoutId),this.timeoutId=setTimeout((()=>this.dequeueAllDataViewCalls()),this.maxtime)),n}};const vu=class{constructor(){this.bufferedDataQueues={}}getBufferedDataQueueForDataPage(e){return this.bufferedDataQueues[e]}addBufferedDataQueueForDataPage(e,t,n,r,s,a,o){return this.getBufferedDataQueueForDataPage(e)||(this.bufferedDataQueues[e]=new bu(t,n,s,r,a,o)),this.bufferedDataQueues[e]}},xu=(e,t)=>((e,t)=>1===Object.keys(e).length&&Object.keys(e).length===Object.keys(t).length)(e,t)&&((e,t)=>"EQ"===t.F0.comparator&&(e.F0.comparator===t.F0.comparator||"IN"===e.F0.comparator))(e,t)&&e.F0.ignoreCase===t.F0.ignoreCase,wu=e=>e.map((e=>e.field)),Mu=(e,t)=>{const n=(e.query?.filter).filterConditions,r=(t.query?.filter).filterConditions;let s=(t.query?.filter).logic;const a=Object.keys(n).length;xu(n,r)?("EQ"===n.F0.comparator&&(e=>{const t=e?.F0.rhs.value;e.F0.rhs={values:[t]},e.F0.comparator="IN"})(n),n.F0.rhs.values.push(r.F0.rhs.value)):(Object.keys(r).forEach(((e,t)=>{const o=`F${a+t}`;n[o]=r[e],s=s.replace(e,o)})),(e.query?.filter).logic+=` OR ${s}`);const o=wu(e.query?.select);wu(t.query?.select).forEach((t=>{o.includes(t)||(e.query?.select).push({field:t})}))},Lu=(e,t)=>((e,t)=>Object.keys(e.filterConditions).length%Object.keys(t.filterConditions).length==0&&!Object.keys(t.filterConditions).some((n=>e.filterConditions[n].lhs.field!==t.filterConditions[n]?.lhs.field)))(e.query?.filter,t.query?.filter)&&(((e,t)=>e.dataViewParameters&&t.dataViewParameters&&Object.keys(t.dataViewParameters).length===Object.keys(e.dataViewParameters).length&&!Object.keys(e.dataViewParameters).some((n=>"string"==typeof t.dataViewParameters?.[n]?e.dataViewParameters?.[n]!==t.dataViewParameters?.[n]:!jg.isEqual(e.dataViewParameters?.[n],t.dataViewParameters?.[n]))))(e,t)||((e,t)=>!e.dataViewParameters&&!t.dataViewParameters)(e,t)),Fu=(e,t)=>{const{data:n}=t,{dataViewCallMap:r,filterDataOnClient:s}=e;Object.keys(r).forEach((e=>{r[e].resolve({data:s(e,n)})}))},Uu=e=>({combiner:Mu,comparator:Lu,separator:Fu,...e}),ju=(e,t)=>{try{window.sessionStorage.setItem(e,t)}catch(e){}};class Vu{constructor(e,t){this.isInitialised=!1,this.isQueryable=!0,this.dataSourceMetaData={},this.nonQueryableData=[],this.fetchedNQData=!1,this.previousSearchText=null,this.totalRecordCount=0,this.fetchedRecordCount=0,this.cache={},this.pageNumber=0,this.isNQDataFetchInProgress=!1,this.fetchNQDataPromise=null,this.dataSource="",this.bufferInitialized=!1,e&&(this.listType=e.listType,this.dataSource=e.dataSource,e.enablePagination?(this.enablePagination=e.enablePagination,this.pageSize=e.pageSize):this.maxResultsDisplay=e.maxResultsDisplay,this.parameters=e.parameters,this.columns=e.columns,this.matchPosition=e.matchPosition,this.ignoreCase=!1!==e.ignoreCase,this.dataSourceMetaData=e.dataSourceMetaData,this.context=t)}static searchResultsCache={};static init(e,t){return new Promise(((n,r)=>{const s=[...e.columns.map((e=>e.value)),...Object.entries(e.parameters).map((([e,t])=>`${e}+${t}`)),e.matchPosition,e.maxResultsDisplay].join(j.HASH_DELIMITER),a=jg.getHashedString(s),o=`${e.dataSource}_${a}`,i=yu.getAppCacheKey(e.dataSource);if(window.sessionStorage.getItem(i)){const s=JSON.parse(`${window.sessionStorage.getItem(i)}`);if(t&&Vu.searchResultsCache?.[t]?.[o])n(Vu.searchResultsCache[t][o]);else if("form"!==e.cacheLifeSpan&&Vu.searchResultsCache?.persisted?.[o])n(Vu.searchResultsCache.persisted[o]);else{const a=new Vu(e,t);JSON.stringify(s.associationFilter)===JSON.stringify(e.associationFilter)?(a.dataSourceMetaData=s.dataSourceMetaData,a.isQueryable=s.isQueryable,a.isInitialised=s.isInitialised,a.associationFilter=s.associationFilter,Vu.initializeCache(t,e,o,a),n(a)):(a.associationFilter=e.associationFilter,a.propertyFilter=e.propertyFilter,a.fetchMetaData(t).then((r=>{ju(i,JSON.stringify({isQueryable:r.data.isQueryable,dataSourceMetaData:r.data,isInitialised:!0,associationFilter:e.associationFilter})),a.isQueryable=r.data.isQueryable,a.dataSourceMetaData=r.data,a.isInitialised=!0,Vu.initializeCache(t,e,o,a),n(a)})).catch((e=>{a.isInitialised=!1,r(e)})))}}else if(e.deferDatasource&&ng(e.dataSource)){const r=new Vu(e,t),s=ng(e.dataSource);r.isQueryable=!!s?.isQueryable,r.isInitialised=!0,r.dataSourceMetaData=s,ju(i,JSON.stringify({isQueryable:s?.isQueryable,dataSourceMetaData:s,isInitialised:!0})),r.context=t,Vu.initializeCache(t,e,o,r),n(r)}else{const s=new Vu(e,t);s.associationFilter=e.associationFilter,s.propertyFilter=e.propertyFilter,s.fetchMetaData(t).then((r=>{ju(i,JSON.stringify({isQueryable:r.data.isQueryable,dataSourceMetaData:r.data,isInitialised:!0,associationFilter:e.associationFilter})),s.isQueryable=r.data.isQueryable,s.dataSourceMetaData=r.data,s.isInitialised=!0,Vu.initializeCache(t,e,o,s),n(s)})).catch((e=>{s.isInitialised=!1,r(e)}))}}))}static bufferedDataView=new vu;registerForBufferedCall(e){return this.isQueryable&&(this.initializeBufferCallsForDataPage(Uu(e)),this.bufferInitialized=!0),this}static clearContextedCache(e){delete Vu.searchResultsCache[e]}static initializeCache(e,t,n,r){e&&"form"===t.cacheLifeSpan?.toLowerCase()?(void 0===Vu.searchResultsCache[e]&&(Vu.searchResultsCache[e]={}),Vu.searchResultsCache[e][n]=r):(void 0===Vu.searchResultsCache.persisted&&(Vu.searchResultsCache.persisted={}),Vu.searchResultsCache.persisted[n]=r)}fetchMetaData(e){return yu.getDataViewMetadata(this.dataSource,e,this.associationFilter,this.propertyFilter)}initializeBufferCallsForDataPage(e){Vu.bufferedDataView.addBufferedDataQueueForDataPage(this.dataSource,(e=>Ru.getDataAsync(this.dataSource,this.context,e.dataViewParameters,e.paging,e.query)),e.combiner,e.separator,e.comparator,e.waitTime,e.maxSize)}buildSchemaForQueryableBufferDP(e){return{...this.buildSchemaForQueryableDP(e),paging:void 0,filterDataOnClient:this.filterDataOnClient.bind(this)}}getData(e,t){if(this.isQueryable){if(this.bufferInitialized)try{const t=this.buildSchemaForQueryableBufferDP(e);return Vu.bufferedDataView.getBufferedDataQueueForDataPage(this.dataSource).queueDataViewCall(t,e)}catch{const n=this.buildSchemaForQueryableDP(e,t);return Ru.getDataAsync(this.dataSource,this.context,n.dataViewParameters,n.paging,n.query)}const n=this.buildSchemaForQueryableDP(e,t);return Ru.getDataAsync(this.dataSource,this.context,n.dataViewParameters,n.paging,n.query)}return this.fetchNonQueryableResults(e,t)}memoizedGetData(e,t){const n=e?.toLowerCase();if(this.enablePagination?n in this.cache&&this.pageNumber in this.cache[n]:n in this.cache)return this.enablePagination?this.cache[n][this.pageNumber]:this.cache[n];const r=this.getData(e,t);return this.enablePagination?(this.cache[n]=this.cache[n]||{},this.cache[n][this.pageNumber]=r):this.cache[n]=r,r}fetchData(e,t=!1,n){return this.isValidDatasource()?this.context&&!Fg(this.context)?Promise.resolve({data:[]}):this.isInitialised?(this.pageNumber=t?this.pageNumber:1,this.memoizedGetData(e,n)):Promise.reject(new Error):Promise.reject(new Error)}fetchPaginatedData(e){return this.pageNumber+=1,this.fetchData(e,!0)}fetchNonQueryableResults(e,t){if(void 0===e)return Promise.resolve({data:[]});if(this.fetchedNQData)return Promise.resolve({data:this.filterDataOnClient(e,this.nonQueryableData,t)});if(this.isNQDataFetchInProgress&&this.fetchNQDataPromise)return this.fetchNQDataPromise.then((()=>({data:this.filterDataOnClient(e,this.nonQueryableData,t)}))).catch((e=>Promise.reject(e)));if(this.dataSourceMetaData&&"structure"in this.dataSourceMetaData&&"list"===this.dataSourceMetaData.structure?.toLowerCase()){const n=this.buildSchemaForNonQueryableDP();return this.fetchNQDataPromise=Ru.getDataAsync(this.dataSource,this.context,n.dataViewParameters,void 0,void 0,t),this.isNQDataFetchInProgress=!0,new Promise(((n,r)=>{this.fetchNQDataPromise?.then((r=>(this.nonQueryableData=[...r.data],this.fetchedNQData=!0,n({data:this.filterDataOnClient(e,this.nonQueryableData,t)})))).catch((e=>r(e))).finally((()=>{this.isNQDataFetchInProgress=!1,this.fetchNQDataPromise=null}))}))}return Promise.resolve(null)}filterDataOnClient(e,t,n){const r=(n?.columns??this.columns)?.filter((e=>e.useForSearch)).map((e=>e.value));return t.reduce(((t,s)=>(Object.keys(s).every((a=>!(r?.includes(a)&&s[a]&&this.positionMatches(`${s[a]}`,e,n))||(t.push({...s}),!1))),t)),[])}positionMatches(e,t,n){const r=n?.ignoreCase??this.ignoreCase,s=r?e.toLowerCase():e,a=r?t.toLowerCase():t;switch(n?.matchPosition??this.matchPosition){case"start":return s.startsWith(a);case"contains":return s.includes(a);case"equals":return s===a;default:return!1}}buildSelect(e){const t=[],n=[];return(e?.columns??this.columns)?.forEach((e=>{if(!n.includes(e.value)){n.push(e.value);const r={field:e.value};t.push(r)}})),t}buildFilters(e,t){const n=t?.matchPosition??this.matchPosition,r=t?.ignoreCase??this.ignoreCase,s={};let a=0;(t?.columns??this.columns)?.forEach((t=>{if(t.useForSearch){const o=`F${a}`;a+=1;const i={field:t.value},c={value:e};let l="CONTAINS";"start"===n?l="STARTS_WITH":"equals"===n&&(l="EQ");const u={...`${parseFloat(e)}`!==e==!0&&{ignoreCase:r?"true":"false"},lhs:i,rhs:c,comparator:l};s[o]=u}}));const o=Object.keys(s).join(" OR ");return{filterConditions:s,logic:o}}buildQuery(e,t){const n=this.buildSelect(t);return e?{select:n,filter:this.buildFilters(e,t),...yu.isDistinctResultsOnly(n)&&{distinctResultsOnly:"true"}}:{select:n,...yu.isDistinctResultsOnly(n)&&{distinctResultsOnly:"true"}}}buildPageOptions(){return this.enablePagination?{pageNumber:this.pageNumber,pageSize:this.pageSize}:{maxResultsToFetch:this.maxResultsDisplay}}buildSchemaForQueryableDP(e,t){return{dataViewParameters:this.parameters,query:this.buildQuery(e,t),paging:this.buildPageOptions()}}buildSchemaForNonQueryableDP(){return{dataViewParameters:this.parameters}}isValidDatasource(){return!!this.dataSource}}const ku=Vu;class $u{constructor(){this.refreshMap={},this.propChangeRefreshMap={}}static initializeRefreshCache(e,t,n,r,s){void 0===e[t]&&(e[t]={}),e[t][n]=[{uniqueHash:r,callback:s}]}registerForRefresh(e,t,n,r,s){n=jg.convertClipboardPageToPageRefNotation(n);const a=r.split("/").join(j.HASH_DELIMITER),o=jg.getHashedString(a);if("PROP_CHANGE"===e)if(this.propChangeRefreshMap?.[s]?.[n]){this.propChangeRefreshMap[s][n].some((e=>e.uniqueHash===o))||this.propChangeRefreshMap[s][n].push({uniqueHash:o,callback:t})}else $u.initializeRefreshCache(this.propChangeRefreshMap,s,n,o,t);else if(this.refreshMap?.[s]?.[`${e}-${n}`]){this.refreshMap[s][`${e}-${n}`].some((e=>e.uniqueHash===o))||this.refreshMap[s][`${e}-${n}`].push({uniqueHash:o,callback:t})}else $u.initializeRefreshCache(this.refreshMap,s,`${e}-${n}`,o,t)}triggerRefreshForType(e,t,n){"PROP_CHANGE"===e?this.propChangeRefreshMap?.[n]?.[t]&&this.propChangeRefreshMap[n][t].forEach((e=>e.callback())):this.refreshMap?.[n]?.[`${e}-${t}`]&&this.refreshMap[n][`${e}-${t}`].forEach((e=>e.callback()))}deRegisterForRefresh(e){delete this.propChangeRefreshMap[e],delete this.refreshMap[e]}}const Bu=new $u;const Gu=class{static cleanCaches(e){Ig.purgeCascadeFields(e),mu.removeContext(e),ku.clearContextedCache(e),yo.cleanContextSubscribers(e),yl(e),eo.removeContextTreeNode(e),Pu.clearContext(e),Bu.deRegisterForRefresh(e)}},Wu="GET_DESCENDANTS",Hu={REFRESH_DATA:"REFRESH_DATA",WHENS:"WHENS",DECLARE_EXPRESSIONS:"DECLARE_EXPRESSIONS",REFRESH:"refresh",REFRESH_CASE_DATA:"refreshCaseData",REFRESH_ASSIGNMENT_DATA:"refreshAssignmentData",REFRESH_CASE_VIEW:"refreshCaseView",RECALCULATE:"recalculate",RECALCULATE_CASE_DATA:"recalculateCaseData",RECALCULATE_ASSIGNMENT_DATA:"recalculateAssignmentData",REFRESH_EXTERNAL_OBJECT:"refreshExternalObjectData"};const qu=new class{constructor(){this.runtimeParams={},this.runtimeParamsMap={}}setRuntimeParams(e){this.runtimeParams=e}getRuntimeParams(){return this.runtimeParams}setRuntimeParam(e,t){this.runtimeParamsMap[e]=t}getRuntimeParam(e){return this.runtimeParamsMap[e]}};const zu=new class{MISSING_CONTEXT_PARAM="context is required parameter";INVALID_CONTEXT_DETAILS="Invalid Context";INVALID_CONTEXT_OPERATION="Invalid Operation on Given Context";schedulePendingActionOnCompletion(e,t){const n=[],r=t.context_data?.blocking_action_counter??0,s=t.context_data?.deferred_action_queue?[...t.context_data.deferred_action_queue]:[];let a=t.context_data?.is_deferred_action_in_progress??!1;if(r<=0){if(a)n.push({type:fe,payload:{context:e,data:{context_data:{is_deferred_action_in_progress:!1}}}});else{if(!(s.length>0))return;{const t=s.shift();a=!a,n.push({type:fe,payload:{context:e,data:{context_data:{deferred_action_queue:s,blocking_action_counter:r,is_deferred_action_in_progress:a}}}}),t&&n.push(t)}}Cg(n)}}executeOrQueueDeferredAction(e){if(!e?.payload?.context)return Promise.reject(new Error("Action Context is Mandatory Field."));const t=Sg(e?.payload?.context);if(t){const n=[],r=t.context_data?.blocking_action_counter??0,s=t.context_data?.deferred_action_queue?[...t.context_data.deferred_action_queue]:[];let a=t.context_data?.is_deferred_action_in_progress??!1;return s.length<=0&&!a&&(r<=0?(n.push(e),a=!a):s.push(e),n.unshift({type:fe,payload:{context:e.payload.context,data:{context_data:{deferred_action_queue:s,blocking_action_counter:r,is_deferred_action_in_progress:a}}}}),Cg(n)),Promise.resolve()}return Promise.reject(new Error(this.INVALID_CONTEXT_DETAILS))}handleDeferredActionCompletion(e){if(!e)return Promise.reject(new Error(this.MISSING_CONTEXT_PARAM));const t=Sg(e);return t&&!0===t.context_data?.is_deferred_action_in_progress?(Cg({type:fe,payload:{context:e,data:{context_data:{is_deferred_action_in_progress:!1}}}}),this.schedulePendingActionOnCompletion(e,t),Promise.resolve()):Promise.reject(new Error(this.INVALID_CONTEXT_DETAILS))}registerBlockingAction(e){if(!e)return Promise.reject(new Error(this.MISSING_CONTEXT_PARAM));return Sg(e)?(Cg({type:it,payload:{context:e,isInitiateBlockingAction:!0}}),Promise.resolve()):Promise.reject(new Error(this.INVALID_CONTEXT_DETAILS))}deRegisterBlockingAction(e){if(!e)return Promise.reject(new Error(this.MISSING_CONTEXT_PARAM));const t={...Sg(e)};return t.context_data={...t.context_data},t&&t.context_data?.blocking_action_counter>0?(Cg({type:it,payload:{context:e,isInitiateBlockingAction:!1}}),t.context_data.blocking_action_counter-=t.context_data.blocking_action_counter,this.schedulePendingActionOnCompletion(e,t),Promise.resolve()):Promise.reject(new Error(this.INVALID_CONTEXT_OPERATION))}cancelDeferredActionsOnError(e){if(!e)return;const t=Sg(e);if(t){const n={...t};n.context_data={...n.context_data},n.context_data?.deferred_action_queue&&jg.rejectPendingActions(n.context_data.deferred_action_queue)&&(n.context_data.deferred_action_queue=[]),n.context_data?.blocking_action_counter&&(n.context_data.blocking_action_counter=0),n.context_data?.is_deferred_action_in_progress&&(n.context_data.is_deferred_action_in_progress=!1),Cg({type:fe,payload:{context:e,data:{...n}}}),nc.disableLoadingIndicator({context:e})}}isDeferredActionInProgress(e){if(!e)return Promise.reject(new Error(this.MISSING_CONTEXT_PARAM));const t=Sg(e);return!(!t||!0!==t.context_data?.is_deferred_action_in_progress)}},Yu=(e,t)=>{const n={},r=zl.getLookUpDataPage(e),s=zl.getDataPageKeys(r);if(s)for(const e of s)n[e.keyName]=e.isAlternateKeyStorage?t[e.linkedField]:t[e.keyName];return{dataViewParameters:n,dataPageID:r,dataPageKeys:s}},Ku=(e,t)=>{const n=zl.getSavableDataPage(e),r=zl.getDataPageKeys(n);return r?.forEach((e=>{e.isAlternateKeyStorage&&(e.keyName===e.linkedField||Object.keys(t).includes(e.linkedField))?e.keyName=t[e.linkedField]:e.isAlternateKeyStorage&&Object.keys(t).includes(e.keyName)&&e.keyName!==e.linkedField?(t[e.linkedField]=t[e.keyName],delete t[e.keyName]):e.keyName=t[e.keyName]})),{keys:t,dataPageID:n,dataPageKeys:r}},Ju=e=>{yo.publish(U.PUB_SUB_EVENTS.EVENT_CANCEL,e)},Xu=(e,t,n)=>{const{callbacks:r}=n;return n.callbacks=null,e(t,n).then((e=>{"cancel"===e?r?.cancel?.():r?.submit?.()}))};const Qu=class{MSG_CLASSNAME_REQUIRED="className is required parameter";MSG_CLASSNAME_STRING="className must be a string";MSG_ACTION_ID_REQUIRED="actionID is required parameter";MSG_ACTION_ID_STRING="actionID must be a string";MSG_ACTION_NAME_REQUIRED="actionName is required parameter";MSG_ACTION_NAME_STRING="actionName must be a string";MSG_KEY_PROPERTIES_REQUIRED="keyProperties is required parameter";MSG_DATAVIEWID_REQUIRED="dataViewID is required parameter";MSG_DATAVIEWID_STRING="dataViewID must be a string";MSG_CONTAINERITEMID_REQUIRED="containerItemID is required parameter";MSG_CONTAINERITEMID_STRING="containerItemID must be a string";MSG_PAGENAME_REQUIRED="pageName is required parameter";MSG_PAGENAME_STRING="pageName must be string";MSG_INSIGHTID_REQUIRED="insightID is required parameter";MSG_DASHBOARDID_REQUIRED="DashboardID is required parameter";MSG_ACTIVE_SUGGESTION_UNATTENDED="You must accept or decline autofilled fields.";MSG_CASE_ID_REQUIRED="caseID is required parameter";MSG_CONTEXT_STRING="context must be string";MSG_SUBSCRIPT_VIEW_REQUIRED="subscriptView is required";constructor(e){this.c11nEnv=e}shouldDeleteCaseInCreateStage=(e,t,n)=>!e&&t||n;getCaseID=e=>e.caseID||this.c11nEnv.getValue(j.getProperty(U.CASE_INFO.CASE_INFO_ID))||e?.links?.open?.href?.split("/")?.[2];getSaveActionPayload=(e,t=!1)=>{const n=e,r=n&&n.includes(j.MODAL),s=this.c11nEnv.getValue(U.CASE_INFO.CASE_INFO_ID),a=this.c11nEnv.getValue(U.CASE_INFO.ASSIGNMENT_ID),o=this.c11nEnv.getValue(U.CASE_INFO.ACTIVE_ACTION_ID)?this.c11nEnv.getValue(U.CASE_INFO.ACTIVE_ACTION_ID):this.c11nEnv.getValue(U.CASE_INFO.ASSIGNMENTACTION_ID),i=this.c11nEnv.getContainerName(),c=this.c11nEnv.getValue(U.CASE_INFO.CASE_TYPE_ID),l=t?void 0:Nl(this.c11nEnv.getContextName()),u=this.c11nEnv.getValue("isProcessAction","isProcessAction");return Wg.buildActionObject({context:n,containerItemID:e,assignmentID:a,actionID:o,caseID:s,containerName:i,caseType:c,isModalAction:r,isFormValid:l,isProcessAction:u,saveOnly:t},this.c11nEnv)};actionsApiPromise=(e,t,n=!0)=>{let r,s,a="";a=t&&null!==t.actionMgrID?t.actionMgrID||"":rc.getNextActionMgrId();const o=new Promise(((e,t)=>{r=e,s=t}));if(!r||!s)throw new Error("resolveFn or rejectFn is not defined.");return rc.register(a,o,r,s,e,t,n),{actionMgrID:a,promise:o}};showDataObjectCreateView(e,t=U.VIEW_NAMES.DATA_OBJECT_CREATE_VIEW){const n=Wg.buildActionObject({viewName:t,className:e},this.c11nEnv),r=ne,{promise:s}=this.actionsApiPromise(r,n);return Cg({type:r,payload:{...n,containerName:U.MODAL,skipSemanticUrl:!0,isCreateDataObject:!0}}),s}cancelDataObject(e){if(!e)return Promise.reject(new Error("containerItemId is required parameter"));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const t=e;if(!ip(t)){return new Xl(this.c11nEnv).removeContainerItem({containerItemID:e,skipReleaseLockRequest:!0})}const n=He,r=Wg.buildActionObject({containerItemID:e,context:t},this.c11nEnv),s=t&&t.includes(j.MODAL);Cg({type:n,payload:{...r,isModalAction:s,isDataObject:!0,skipReleaseLockRequest:!0}});const{promise:a}=this.actionsApiPromise(n,r);return a.then((()=>{Ju({})}))}createDataObject(e){if(!e)return Promise.reject(new Error("containerItemID is required parameter"));const{data:t}=_g()?.getState()||{},n=t[e]?.dataInfo?.content?.classID;if(!n)return Promise.reject(new Error(j.DATA_CLASS_NOT_FOUND));if(Zh(U.VIEW_NAMES.SUBSCRIPT_CREATE_VIEW)){const t=this.handleSubscript.call(this,e,this.c11nEnv);if(t)return t}const r=zl.getSavableDataPage(n),s=ct,a=!!e&&e.includes(j.MODAL),o=Wg.buildActionObject({containerItemID:e,dataPageID:r},this.c11nEnv),{promise:i}=this.actionsApiPromise(s,o);return Cg({type:"CREATE_DATA_OBJECT",payload:{...o,isModalAction:a,isFormValid:Nl(e)}}),i}deleteDataObject(e,t){if(!e)return Promise.reject(new Error("className is required parameter"));if(!t)return Promise.reject(new Error("keys is required parameter"));const n=lt,r=zl.getSavableDataPage(e),s=zl.getDataPageKeys(r),a={};if(s)for(const e of s)a[e.keyName]=e.isAlternateKeyStorage?t[e.linkedField]:t[e.keyName];const o=Wg.buildActionObject({dataViewName:r,dataViewParameters:a},this.c11nEnv),{promise:i}=this.actionsApiPromise(n,o);return Cg({type:"DELETE_DATA_OBJECT",payload:{...o}}),i}getDataObjectView(e,t,n={viewName:"",readOnly:!1,actionName:""}){if(!e)return Promise.reject(new Error(this.MSG_CLASSNAME_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CLASSNAME_STRING));if(!t)return Promise.reject(new TypeError(this.MSG_KEY_PROPERTIES_REQUIRED));if("object"!=typeof t)return Promise.reject(new TypeError("keyProperties must be a object"));const r=ut,{dataPageID:s,dataViewParameters:a}=Yu(e,t),o=Wg.buildActionObject({dataLookUp:s,keyProperties:t,requestPayload:a,viewName:n.viewName||U.VIEW_NAMES.DATA_OBJECT_EDIT_VIEW,containerName:j.MODAL,readOnly:n.readOnly,actionName:n.actionName},this.c11nEnv),{promise:i}=this.actionsApiPromise(r,o);return Cg({type:"VIEW_DATA_OBJECT",payload:{...o}}),i}updateDataObject(e,t){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if(!t)return Promise.reject(new Error("keys is required parameter"));const{data:n}=_g()?.getState()||{},r=n[e]?.dataInfo?.content?.classID;if(!r)return Promise.reject(new Error(j.DATA_CLASS_NOT_FOUND));const{dataPageID:s,keys:a}=Ku(r,t),o=dt,i=e&&e.includes(j.MODAL),c=Wg.buildActionObject({containerItemID:e,dataPageID:s,key:a},this.c11nEnv),l=n[e]?.caseInfo?.headers?.etag,{promise:u}=this.actionsApiPromise(o,c);return Cg({type:"UPDATE_DATA_OBJECT",payload:{...c,isModalAction:i,isFormValid:Nl(e),etag:l}}),u}openDataObjectAction(e,t,n,r){if(!e)return Promise.reject(new Error(this.MSG_CLASSNAME_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CLASSNAME_STRING));if(!t)return Promise.reject(new TypeError(this.MSG_KEY_PROPERTIES_REQUIRED));if("object"!=typeof t)return Promise.reject(new TypeError("keyProperties must be a object"));if(!n)return Promise.reject(new Error(this.MSG_ACTION_ID_REQUIRED));if(!r)return Promise.reject(new Error(this.MSG_ACTION_NAME_REQUIRED));const s=pt,{dataViewParameters:a,dataPageID:o,dataPageKeys:i}=Yu(e,t),c=Wg.buildActionObject({actionID:n,actionName:r,dataViewParameters:a,lookupDatapage:o,containerName:j.MODAL,dataViewPayload:i,context:this.c11nEnv.getContextName()},this.c11nEnv),{promise:l}=this.actionsApiPromise(s,c);return Cg({type:s,payload:{...c}}),l}submitDataObjectAction(e,t,n,r){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));if(!t)return Promise.reject(new Error(this.MSG_KEY_PROPERTIES_REQUIRED));if(!n)return Promise.reject(new Error(this.MSG_ACTION_ID_REQUIRED));const{data:s}=_g()?.getState()||{},a=s[e]?.dataInfo?.content?.classID;if(!a)return Promise.reject(new Error(j.DATA_CLASS_NOT_FOUND));const o=r?.jsActionQueryParams,i=hh(e),c=qp(i),l=yp(c,i)||{},{resourceType:u="",key:d=""}=l,p=ht,{dataPageID:h,keys:g}=Ku(a,t),f=Wg.buildActionObject({containerItemID:e,actionID:n,resourceType:u,key:d,keys:g,savableDatapage:h,containerName:j.MODAL,context:e,jsActionQueryParams:o},this.c11nEnv);f.context=e;const m=s[e]?.caseInfo?.headers?.etag,{promise:I}=this.actionsApiPromise(p,f);return Cg({type:p,payload:{...f,isFormValid:Nl(e),etag:m}}),I}createWork(e,t={flowType:"",containerName:"",openCaseViewAfterCreate:!1,modalOptions:{dockable:!1},startingFields:Object,remoteCaseMeta:{},channelName:""}){if(!e)return Promise.reject(new Error(this.MSG_CLASSNAME_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CLASSNAME_STRING));if(window.pms?.plugins?.c11n?.createWork)return window.pms.plugins.c11n.createWork(e,"pyStartCase",t);const{dockable:n=!1}=t?.modalOptions||{};let r=((e,t)=>Rl.isExternalObject(e)&&!t?"CREATE_EXTERNAL_OBJECT":Rl.isObjectCaseType(e)?"CREATE_OBJECT":le)(e,Og(".isExternalObjectCreationFlow","context_data",this.c11nEnv.getContextName()));const s=Wg.buildActionObject({class:e,flowType:"pyStartCase",containerName:j.PRIMARY,openCaseViewAfterCreate:!0,...t,modalOptions:{isDockable:n}},this.c11nEnv),{promise:a}=this.actionsApiPromise(r,s);if(s.headers={...s.headers},t.channelName?s.headers[j.X_ORIGIN_CHANNEL]=t.channelName:Dh.isWSSPortal()&&(s.headers[j.X_ORIGIN_CHANNEL]="WSS"),$.isRemoteCase(e)){const{RemoteClassName:t,RemoteSystemID:n,name:a}=$.getRemoteCase(e);if(s.className=e,s.class=t,rc.setRemoteCaseHeaderByContext(s,n),$.isTraditionalRemoteCase(e)){const n={className:e,name:a,action:yt,remoteClassName:t};r=rc.setTraditionalRemoteCaseParams(s,n)}}if(Eo.getPreviewMode()){s.debugInfo={debugId:jg.generateUniqueID()};const e=xo.getCoreHeadersFromContext(s?.context||""),t=String(e?.debugInfo?.[j.COREHEADER_APP_DEBUG_ID]||"");t&&r!==le&&(s.debugInfo={debugId:t})}return Cg({type:r,payload:{...s}}),a}getDataObjectActions(e,t){if(!e)return Promise.reject(new Error(this.MSG_DATAVIEWID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_DATAVIEWID_STRING));const n=Ie,r=Wg.buildActionObject({dataViewID:e,dataViewParameters:t},this.c11nEnv),{promise:s}=this.actionsApiPromise(n,r);return Cg({type:n,payload:{...r}}),s}getDescendants(e,t){if(!e)return Promise.reject(new Error(this.MSG_CASE_ID_REQUIRED));if("string"!=typeof t)return Promise.reject(new TypeError(this.MSG_CONTEXT_STRING));const n=t||this.c11nEnv.getContextName(),r=Wg.buildActionObject({caseID:e,currentContext:n},this.c11nEnv),{promise:s}=this.actionsApiPromise("GET_DESCENDANTS",r),a=(o={...r,context:n},{type:Wu,payload:o});var o;return Cg(a),s}openWorkByHandle(e,t,n={}){if(!e)return Promise.reject(new Error("workID is required parameter"));if("string"!=typeof e)return Promise.reject(new TypeError("workID must be a string"));if(!t)return Promise.reject(new Error(this.MSG_CLASSNAME_REQUIRED));if("string"!=typeof t)return Promise.reject(new TypeError(this.MSG_CLASSNAME_STRING));if(window.pms?.plugins?.c11n?.openWorkByHandle)return window.pms.plugins.c11n.openWorkByHandle(e,t);const r={insKey:e,acTargetName:n.targetContainer||j.PRIMARY,containerName:n.targetContainer||j.PRIMARY};let s=Rl.isObjectCaseType(t)?"GET_OBJECT":ue;const a=Wg.buildActionObject(r,this.c11nEnv),{promise:o}=this.actionsApiPromise(s,a);return a.headers={...a.headers},n.channelName?a.headers[j.X_ORIGIN_CHANNEL]=n.channelName:Dh.isWSSPortal()&&(a.headers[j.X_ORIGIN_CHANNEL]="WSS"),a.className=t,$.isRemoteCase(t)&&(s=this.setRemoteCaseParamsForOpenCase(a,t,n.remoteCaseMeta)??s),Eo.getPreviewMode()&&![j.WORKAREA].includes(n.targetContainer)&&(a.debugInfo={debugId:jg.generateUniqueID()}),Cg({type:s,payload:{...n,...a}}),o}setRemoteCaseParamsForOpenCase(e,t,n={}){const{RemoteSystemID:r,RemoteClassName:s,name:a}=$.getRemoteCase(t);if(rc.setRemoteCaseHeaderByContext(e,r),e.isRemoteCase=!0,e.remoteCaseClass=t,$.isTraditionalRemoteCase(t)){e.remoteCaseMeta=n;const r={className:t,name:a,action:At,remoteClassName:s};return rc.setTraditionalRemoteCaseParams(e,r)}}openAssignment(e,t,n={isActionFromToDoList:!1,isChild:!1,context:"",viewType:"",skipBrowserSemanticUrlUpdate:!1,containerName:"",channelName:"",remoteCaseMeta:{}}){if(!e)return Promise.reject(new Error("assignmentID is required parameter"));if("string"!=typeof e)return Promise.reject(new TypeError("assignmentID must be a string"));if(!t)return Promise.reject(new Error(this.MSG_CLASSNAME_REQUIRED));if("string"!=typeof t)return Promise.reject(new TypeError(this.MSG_CLASSNAME_STRING));if(window.pms?.plugins?.c11n?.openAssignment)return window.pms.plugins.c11n.openAssignment(e,t);const r={assignmentID:e,doDeleteCaseSummary:!0,containerName:n.containerName,isActionFromToDoList:n.isActionFromToDoList,isChild:!1};n.isChild&&(r.containerName=j.PRIMARY,r.isChild=n.isChild);let s=Bl;const a=Wg.buildActionObject(r,this.c11nEnv),{promise:o}=this.actionsApiPromise(s,a);if(a.headers=a.headers||{},n.channelName?a.headers[j.X_ORIGIN_CHANNEL]=n.channelName:Dh.isWSSPortal()&&(a.headers[j.X_ORIGIN_CHANNEL]="WSS"),$.isRemoteCase(t)){const{RemoteClassName:e,RemoteSystemID:r,name:o}=$.getRemoteCase(t);if(rc.setRemoteCaseHeaderByContext(a,r),$.isTraditionalRemoteCase(t)){a.remoteCaseMeta=n.remoteCaseMeta;const r={className:t,name:o,action:Et,remoteClassName:e};s=rc.setTraditionalRemoteCaseParams(a,r)}}a.className=t,a.activeItemCaseViewMode=this.c11nEnv.getValue("context_data.caseViewMode"),Eo.getPreviewMode()&&![j.WORKAREA].includes(n.containerName)&&(a.debugInfo={debugId:jg.generateUniqueID()});const i={context:a.context||n.context,containerName:a.containerName||n.containerName,targetContainerName:a.containerName||n.containerName,viewType:a.viewType||n.viewType,skipBrowserSemanticUrlUpdate:n.skipBrowserSemanticUrlUpdate};return Cg({type:s,payload:{...a,...i}}),o}finishAssignment(e,t={outcomeID:"",jsActionQueryParams:{}}){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const n=vp(e);let r=n;if(n?.includes("/workarea")&&(r=n.substring(0,r?.lastIndexOf("/workarea"))),(e=>{const t=eo.getContextReferences(e);if(t)for(const[,e]of t)if(Bg.resolveContextTreeNodeProps(e.props).hasSuggestions)return!0;return!1})(n)){const e=[{type:"error",message:this.c11nEnv.getLocalizationService().getLocalizedMessage(this.MSG_ACTIVE_SUGGESTION_UNATTENDED)}];return co({messages:e,context:r,category:U.PAGE}),Promise.reject({type:U.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR})}const s=t?.isTriggeredFromDifferentContext,{caseID:a,assignments:o,localActionID:i,caseActions:c,caseInfo:l,businessID:u,caseTypeID:d,caseTypeName:p}=Ul(e,this.c11nEnv,{isTriggeredFromDifferentContext:s}),h=vl(l);let g,f=!1;if(c){const e=c.find((e=>e.ID===i));f="Case"===e?.type}else g=Sg(n);let{assignmentID:m}=Ul(e,this.c11nEnv,{isTriggeredFromDifferentContext:s});g?.context_data?.actionType&&(f=g.context_data.actionType===j.CASE,m=m||g.context_data.assignmentID);const I=((e,t,n,r)=>{let s;return s=e?Fl(e,t,n):r||"Create",s})(o,m,i,l?.activeActionID),[y,E]=a.split(" "),A={class:y,actionID:I,assignmentID:m,caseID:a,workID:E,containerName:this.c11nEnv.getContainerName(),containerItemID:e,isCaseWideAction:f,doDeleteCaseSummary:!0,isInCreateStage:h,businessID:u,caseTypeID:d,caseTypeName:p};e?.includes(j.MODAL)&&(A.containerName=j.MODAL,A.isModalAction=!0),A.outcome=t.outcomeID,A.jsActionQueryParams=t.jsActionQueryParams,l?.isLocalAction&&(A.viewType=Gc.FORM);const _=((e,t)=>Rl.isObjectCaseType(e)||t?Ct:pe)(d,l?.isObjectWideAction),C=Wg.buildActionObject(A,this.c11nEnv),{promise:S}=this.actionsApiPromise(_,C);return C.isProcessAction=this.c11nEnv.getValue("isProcessAction","isProcessAction")||Sg(n).context_data.isProcessAction,C.headers??={},Dh.isWSSPortal()&&(C.headers[j.X_ORIGIN_CHANNEL]="WSS"),zu.executeOrQueueDeferredAction({type:_,payload:{...C,context:n}}),S}getNextWork(){if("HYBRID"===Dh.getRenderingMode())return yo.publish(U.PUB_SUB_EVENTS.CASE_EVENTS.GET_NEXT_WORK,{userIdentifier:Dh.getOperatorIdentifier()}),Promise.resolve();const e=Bl,t=Wg.buildActionObject({containerName:j.PRIMARY,isGetNextWork:!0},this.c11nEnv),{promise:n}=this.actionsApiPromise(e,t);return Cg({type:e,payload:{...t}}),n}openStage(e){if(!e)return Promise.reject(new Error("stageID is required parameter for openStage"));const t=Bl,n=this.c11nEnv.getValue(U.CASE_INFO.CASE_INFO_ID),r=this.c11nEnv.getCaseSummary().headers,s=Wg.buildActionObject({containerName:this.c11nEnv.getContainerName(),isOpenStage:!0,stageID:e},this.c11nEnv),{promise:a}=this.actionsApiPromise(t,s),o={type:t,payload:{...s,caseID:n,headers:r}};return Cg(o),a}submitBulkAction(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const t="SUBMIT_BULK_ACTION",n=this.c11nEnv.getValue(U.CASE_INFO.CASES),r=this.c11nEnv.getValue(U.CASE_INFO.ACTIVE_ACTION_ID),s={containerName:this.c11nEnv.getContainerName(),containerItemID:e,isCaseWideAction:!0,doDeleteCaseSummary:!0,isInCreateStage:!1};e&&e.includes(j.MODAL)&&(s.containerName=j.MODAL,s.isModalAction=!0);const a=Wg.buildActionObject(s,this.c11nEnv),{promise:o}=this.actionsApiPromise(t,a),i=vp(e);return Cg({type:t,payload:{...a,context:i,cases:n,actionID:r,isFormValid:Nl(i),classID:this.c11nEnv.getCurrentClassID()}}),o}submitBulkActionAsync(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const t="SUBMIT_BULK_ACTION_ASYNC",n=this.c11nEnv.getValue(U.CASE_INFO.CASES),r=this.c11nEnv.getValue(U.CASE_INFO.ACTIVE_ACTION_ID),s={containerName:e.includes(j.MODAL)?j.MODAL:this.c11nEnv.getContainerName(),containerItemID:e,isCaseWideAction:!0,doDeleteCaseSummary:!0,isInCreateStage:!1,isModalAction:e.includes(j.MODAL)},a=Wg.buildActionObject(s,this.c11nEnv),{promise:o}=this.actionsApiPromise(t,a),i=vp(e);return Cg({type:t,payload:{...a,context:i,cases:n,actionID:r,isFormValid:Nl(i),classID:this.c11nEnv.getCurrentClassID()}}),o}openBulkAction(e,t){if(!e)return Promise.reject(new Error("actionID is required parameter for openBulkAction"));if("string"!=typeof e)return Promise.reject(new TypeError("actionID must be a string openBulkAction"));if(window.pms?.plugins?.c11n?.openBulkAction){const{callbacks:n}=t;return t.callbacks=null,window.pms.plugins.c11n.openBulkAction(e,t).then((e=>{"cancel"===e?n?.cancel?.():n?.submit?.()}))}const{selectedList:n,runningMode:r}=t,s=t.type,a={selectedList:n,vcName:t.target,actionName:t?.name,actionID:e,doDeleteCaseSummary:!0,localActionType:s,runningMode:r,...t},o="OPEN_BULK_ACTION",i=Wg.buildActionObject(a,this.c11nEnv),{promise:c}=this.actionsApiPromise(o,i);return Cg({type:o,payload:{...i}}),c}cancelBulkAction(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));return new Xl(this.c11nEnv).removeContainerItem({containerItemID:e,skipReleaseLockRequest:!0})}approveCase(e){return e?"string"!=typeof e?Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING)):(Cg({type:Q,payload:{reference:U.CASE_INFO.APPROVALFLAG,value:j.APPROVED,context:e}}),this.finishAssignment(e)):Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED))}rejectCase(e){return e?"string"!=typeof e?Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING)):(Cg({type:Q,payload:{reference:U.CASE_INFO.APPROVALFLAG,value:j.REJECTED,context:e}}),this.finishAssignment(e)):Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED))}resolveDuplicateCase(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const[,t]=this.c11nEnv.getValue(U.CASE_INFO.DUPLICATECASEINSKEY).split(" "),n={type:Q,payload:{reference:U.CASE_INFO.DUPLICATECASEFLAG,value:j.DUPLICATE,context:e}},r={type:Q,payload:{reference:U.CASE_INFO.DUPLICATECASEID,value:t,context:e}};return Cg([n,r]),this.finishAssignment(e)}ignoreDuplicateCase(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const t={type:Q,payload:{reference:U.CASE_INFO.DUPLICATECASEFLAG,value:j.IGNORE,context:e}},n={type:Q,payload:{reference:U.CASE_INFO.DUPLICATECASEID,value:"",context:e}},r={type:Q,payload:{reference:U.CASE_INFO.DUPLICATECASEINSKEY,value:"",context:e}};return Cg([t,n,r]),this.finishAssignment(e)}openLocalAction(e,t){if(!e)return Promise.reject(new Error(this.MSG_ACTION_ID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_ACTION_ID_STRING));const n=this.getCaseID(t);if(window.pms?.plugins?.c11n?.openLocalAction)return t.caseID=n,Xu(window.pms.plugins.c11n.openLocalAction,e,t);const r=t.assignKey||this.c11nEnv.getValue(U.CASE_INFO.ASSIGNMENT_ID),s=t.type,a={caseID:n,assignmentID:r,vcName:t.target,actionName:t?.name,assignKey:r,actionID:e,doDeleteCaseSummary:!0,localActionType:s,...t},o=(e=>"Object"===e.type||Rl.isObjectCaseType(e?.caseClassName||"")||window.location.href.includes("/objects/")?_t:"OPEN_LOCAL_ACTION")(t),i=Wg.buildActionObject(a,this.c11nEnv),{promise:c}=this.actionsApiPromise(o,i);if(o===_t)return Cg({type:o,payload:{...i}}),c;const l=this.c11nEnv.getContextName(),u=Mp(l)[0];let d=!1;const p=$.getRemoteHeaderByContext(l);let h;if(rc.setRemoteCaseHeaderByContext(i,p),!u)return h=l,Cg({type:o,payload:{...i,contextName:l,continueExecution:d}}),c;h=Dp(u);const g=Ip(u);if(g?.accessedOrder.forEach((e=>{n===g.items[e].key&&(d=!0,h=g.items[e].context)})),!d||h&&"review"===_g()?.getState()?.data[h]?.context_data?.caseViewMode)return Cg({type:o,payload:{...i,contextName:l,continueExecution:d}}),c;const f=h,m=f&&f.includes(j.MODAL),I=t.assignKey||this.c11nEnv.getValue(U.CASE_INFO.ASSIGNMENT_ID),y=Sg(h),E=y?.caseInfo?.assignments?y.caseInfo.assignments[0]?.actions[0]?.ID:void 0,A=this.c11nEnv.getContainerName(),_=this.c11nEnv.getValue(U.CASE_INFO.CASE_TYPE_ID),C=this.c11nEnv.getValue("isProcessAction","isProcessAction"),S=Wg.buildActionObject({context:f,containerItemID:h,assignmentID:I,actionID:E,caseID:n,containerName:A,caseType:_,isModalAction:m,isFormValid:!0,isProcessAction:C},this.c11nEnv);S.context=h;const T=vp(h),N=this.c11nEnv.getCaseSummary(),O=vl(N),P=Wg.buildActionObject({caseID:n,containerItemID:h,cancelContext:T},this.c11nEnv);let D={};return m?(P.acTargetName=j.MODAL,P.isInCreateStage=O,P.isModalAction=m,D={...P}):D={...P,acName:Pt(this.c11nEnv.getContainerName(),P.context)},Cg({type:o,payload:{...i,contextName:l,saveActionPayload:S,cancelActionPayload:D,continueExecution:d}}),c}openProcessAction(e,t){if(!e)return Promise.reject(new Error(this.MSG_ACTION_ID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_ACTION_ID_STRING));const n=this.c11nEnv.getValue(U.CASE_INFO.CASE_INFO_ID)||t.caseID;if(window.pms?.plugins?.c11n?.openProcessAction)return t.caseID=n,Xu(window.pms.plugins.c11n.openProcessAction,e,t);const r=this.c11nEnv.getValue(U.CASE_INFO.ASSIGNMENT_ID)||t.assignKey,s=t.type,a={caseID:n,assignmentID:r,vcName:t.target,actionName:t?.name,assignKey:r,actionID:e,doDeleteCaseSummary:!0,processActionType:s,isProcessAction:!0,...t},o=$l,i=Wg.buildActionObject(a,this.c11nEnv),{promise:c}=this.actionsApiPromise(o,i);return Cg({type:o,payload:{...i}}),c}navigateToStep(e,t){if(!e)return Promise.reject(new Error("stepID is required parameter"));if("string"!=typeof e)return Promise.reject(new TypeError("stepID must be a string"));if(!t)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof t)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const n="NAVIGATE_TO_STEP",r=this.c11nEnv.getValue(U.NEXT_ASSIGNMENT_INFO_ID)?this.c11nEnv.getValue(U.NEXT_ASSIGNMENT_INFO_ID):this.c11nEnv.getValue(U.CASE_INFO.ASSIGNMENT_ID),s=vl(this.c11nEnv.getCaseSummary()),a=this.c11nEnv.getValue(U.CASE_INFO.CASE_INFO_ID),o={ID:r,stepID:e,acTargetName:this.c11nEnv.getContainerName(),targetContainerName:this.c11nEnv.getContainerName(),containerItemID:t,doDeleteCaseSummary:!0,isInCreateStage:s,caseID:a};t&&t.includes(j.MODAL)&&(o.acTargetName=j.MODAL);const i=Wg.buildActionObject(o,this.c11nEnv),{promise:c}=this.actionsApiPromise(n,i),l=vp(t);return Cg({type:n,payload:{...i,containerItemID:t,context:l}}),c}cancelAssignment(e,t){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const{CASE_INFO:n}=U,r=he,s=vp(e),a=e&&e.includes(j.MODAL),o=this.c11nEnv.getCaseSummary(),i=vl(o),c=this.c11nEnv.getValue(j.getProperty(n.CASE_INFO_ID)),l=this.c11nEnv.getValue(n.ASSIGNMENT_ID),u=Wg.buildActionObject({caseID:c,containerItemID:e,context:s},this.c11nEnv);let d={};a?(u.acTargetName=j.MODAL,u.isInCreateStage=i,u.isModalAction=a,d={...u}):d={...u,acName:Pt(this.c11nEnv.getContainerName(),u.context)};const{promise:p}=this.actionsApiPromise(r,u);return Cg({type:r,payload:d}),p.then((()=>{t||Ju({caseID:c,assignmentID:l,context:this.c11nEnv.getContextName()})}))}cancelLocalAction(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const{CASE_INFO:t}=U,n=e,r=He,s=e&&e.includes(j.MODAL),a=this.c11nEnv.getValue(t.CASE_INFO_ID),o=Wg.buildActionObject({caseID:a,containerItemID:e,context:n},this.c11nEnv);if(!ip(n)){return new Xl(this.c11nEnv).removeContainerItem({containerItemID:e}).then((()=>{Ju({caseID:a,context:this.c11nEnv.getContextName()})}))}Cg({type:r,payload:{...o,isModalAction:s}});const{promise:i}=this.actionsApiPromise(r,o);return i}cancelCreateStageAssignment(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const{CASE_INFO:t}=U,n=He,r=e,s=r&&r.includes(j.MODAL),a=this.c11nEnv.getCaseSummary(),o=this.c11nEnv.getValue(j.getProperty(j.CASE_INFO.CASE_TYPE_ID)),i=vl(a),c=this.c11nEnv.getValue(j.getProperty(t.CASE_INFO_ID)),l=Wg.buildActionObject({caseID:c,containerItemID:e,context:r},this.c11nEnv),u=this.c11nEnv.getValue("isProcessAction","isProcessAction"),d=Dh.isCoexistenceAppOfType(j.APP_TYPE.UIKIT);if(l.isProcessAction=u,i&&(s||d)&&!bl(a)){const t=this.c11nEnv.getValue(j.getProperty(j.CASE_INFO.IS_FIRST_ASSIGNMENT)),c=ip(r);if(this.shouldDeleteCaseInCreateStage(c,t,d)){const t=!0===Boolean(Rl.isExternalObject(o));return this.deleteCaseInCreateStage(e,t)}Cg({type:n,payload:{...l,isModalAction:s,isChildCase:Ll(a),isInCreateStage:i}})}const{promise:p}=this.actionsApiPromise(n,l);return p.then((()=>{}))}saveAssignment(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const t=Wl,n=this.getSaveActionPayload(e,!0),{promise:r}=this.actionsApiPromise(t,n);return zu.executeOrQueueDeferredAction(Hl(n)),r}saveAndClose(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const t=Wl,n=this.getSaveActionPayload(e),{promise:r}=this.actionsApiPromise(t,n);return Cg(Hl(n)),r}deleteCaseInCreateStage(e,t=!1){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const n=Gl,r=e,s=r&&r.includes(j.MODAL),a=this.c11nEnv.getValue(j.getProperty(U.CASE_INFO.CASE_INFO_ID)),o=this.c11nEnv.getValue(j.getProperty(U.CASE_INFO.CASE_TYPE_ID)),i=Wg.buildActionObject({caseID:a,caseType:o,containerItemID:e,context:r,ignoreCaseDeletion:t},this.c11nEnv),c=this.c11nEnv.getValue("isProcessAction","isProcessAction"),l=this.c11nEnv.getValue(j.getProperty(U.CASE_INFO.PARENTCASEINFO));i.isProcessAction=c,i.parentCaseInfo=l;const u=`${j.APP.APP}/${gp.PRIMARY}`,d=el(u,gp.PRIMARY);i.parentContext=d,s&&(i.targetName=j.MODAL,i.containerName=gp.MODAL,i.isModalAction=s),Cg((e=>({type:Gl,payload:e}))(i));const{promise:p}=this.actionsApiPromise(n,i);return p.then((()=>{Ju({caseID:a,context:this.c11nEnv.getContextName()})}))}getRecents(e){if(!e)return Promise.reject(new Error("maxResultsToFetch is required parameter"));if("number"!=typeof e)return Promise.reject(new TypeError("maxResultsToFetch must be number"));let{restApi:t}=Ph.getRestEndPoint("getRecents")||{};t=`${t}?maxResultsToFetch=${e}`;const n=E()+t;return Bo(n,{method:"GET",headers:{}})}updateRecents(e,t,n,r){const{restApi:s}=Ph.getRestEndPoint("updateRecents")||{},a=`${E()}${s}`;return Bo(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:{pyLabel:n,pyID:t,classID:e,ID:r}})}logout(){const{restApi:e}=Ph.getRestEndPoint("Logout")||{},t=`${E()}${e}`;return Bo(t,{method:"GET",headers:{}}).then((e=>(Object.keys(eo.rootNodes).forEach((e=>{Gu.cleanCaches(e)})),eo.rootNodes={},sessionStorage.clear(),Lg(),Promise.resolve(e))))}invoke(e,t={}){const n={method:t.method||"GET",body:t.body};return Bo(e,n,this.c11nEnv.getContextName())}showCasePreview(e,t={}){this.loadView(e,"pyCasePreview",{container:gp.PREVIEW,containerName:gp.PREVIEW,context:U.APP.APP,...t})}showDataPreview(e,t,n){return e?"string"!=typeof e?Promise.reject(new TypeError("dataContext must be string")):t?"object"!=typeof t?Promise.reject(new TypeError("dataContextParameters must be an object")):this.showData("pyDataPreview",e,t,{container:gp.PREVIEW,containerName:gp.PREVIEW,context:U.APP.APP,...n||{},skipSemanticUrl:!0}):Promise.reject(new Error("dataContextParameters is required parameter")):Promise.reject(new Error("dataContext is required parameter"))}loadView(e,t,n){let r=Wg.buildActionObject({caseId:e,viewName:t,caseClassName:this.c11nEnv.getValue(j.getProperty(U.CASE_INFO.CASE_TYPE_ID)),RemoteSystemID:$.getRemoteHeaderByContext(this.c11nEnv.getContextName())},this.c11nEnv);n||(n={containerName:this.c11nEnv.getContainerName(),updateData:!1}),n&&"object"==typeof n?(Object.hasOwn(n,"container")&&!Object.hasOwn(n,"containerName")&&(n.containerName=n.container),r={...r,...n}):r={...r,containerName:this.c11nEnv.getContainerName()};const s=te,{promise:a}=this.actionsApiPromise(s,r,!1);return Cg({type:s,payload:{...r}}),a}showPage(e,t,n={containerName:"",skipSemanticUrl:""}){if(!e)return Promise.reject(new Error(this.MSG_PAGENAME_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_PAGENAME_STRING));if(!t)return Promise.reject(new Error(this.MSG_CLASSNAME_REQUIRED));if("string"!=typeof t)return Promise.reject(new TypeError(this.MSG_CLASSNAME_STRING));if(window.pms?.plugins?.c11n?.showPage)return window.pms.plugins.c11n.showPage(e,t,n);const r=Wg.buildActionObject({viewName:e,className:t},this.c11nEnv),s=ne,{promise:a}=this.actionsApiPromise(s,r);return Eo.getPreviewMode()&&(r.debugInfo={debugId:jg.generateUniqueID()}),Cg({type:s,payload:{...r,...n,containerName:n.containerName||this.c11nEnv.getContainerName(),skipSemanticUrl:n.skipSemanticUrl}}),a}showInsight(e,t={}){if(!e)return Promise.reject(new Error(this.MSG_INSIGHTID_REQUIRED));const n=Wg.buildActionObject({},this.c11nEnv),r=se,{promise:s}=this.actionsApiPromise(r,n);return Cg({type:r,payload:{...n,containerName:this.c11nEnv.getContainerName(),skipSemanticUrl:t.skipSemanticUrl||!1,insightID:e}}),s}showDashboard(e,t={}){if(!e)return Promise.reject(new Error(this.MSG_DASHBOARDID_REQUIRED));const n=Wg.buildActionObject({},this.c11nEnv),r=ae,{promise:s}=this.actionsApiPromise(r,n);return Cg({type:r,payload:{...n,containerName:this.c11nEnv.getContainerName(),skipSemanticUrl:t.skipSemanticUrl||!1,dashboardID:e}}),s}showData(e,t,n,r={containerName:"",skipSemanticUrl:!1}){if(!e)return Promise.reject(new Error(this.MSG_PAGENAME_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_PAGENAME_STRING));if(!t)return Promise.reject(new Error("dataContext is required parameter"));if("string"!=typeof t)return Promise.reject(new TypeError("dataContext must be string"));const s=Wg.buildActionObject({pageName:e,dataContext:t,dataContextParameters:n,RemoteSystemID:$.getRemoteHeaderByContext(this.c11nEnv.getContextName())},this.c11nEnv),a=re;r?.containerName||(r.containerName="HYBRID"===Dh.getRenderingMode()?qu.getRuntimeParam(j.HYRBID_ROOT_CONTAINERNAME):ac.getTargetViewContainerName(a));const{promise:o}=this.actionsApiPromise(a,s);return Cg({type:a,payload:{...s,...r,skipSemanticUrl:Boolean(r.skipSemanticUrl)}}),o}changeHandler(e,t){Wg.changeHandler(e,t)}eventHandler(e,t){Wg.eventHandler(e,t)}triggerFieldChange(e,t,n=!1,r={skipDirtyValidation:!1}){const s=this.c11nEnv.getContextName(),a=this.c11nEnv.getPageReference(),o=Bg.getContextPath(a,e);n||this.c11nEnv.getValidationApi().validate(t),this.c11nEnv.isInsideList()&&this.c11nEnv.getListActions().updateProperty(e,t,r);let i=this.c11nEnv.getValue(j.CLASS_ID);const c=e?e.split(".").filter((e=>!!e)):[];c.length>1&&(c.pop(),i=Og(`.${c.join(".")}.classID`,a,s)),e=jg.trimDotForProperty(e),Cg({type:ee,payload:{reference:o,value:t,context:s,pageReference:this.c11nEnv.getPageReference(),propertyName:e||this.c11nEnv.getComponentConfig().value,classID:i}})}updateFieldValue(e,t,n={}){const{removePropertyFromChangedList:r=!1,isArrayDeepMerge:s=!0,contextPageReference:a="",isListEntry:o=!1,skipDirtyValidation:i=!1,associatedProperty:c}=n,l=this.c11nEnv.getContextName();let u=this.c11nEnv.getPageReference();const d=a?.startsWith(u)?a.replace(u,""):a;u=a||u;const p=Bg.getContextPath(u,e);let h=!1;this.c11nEnv.isInsideList()&&this.c11nEnv.getListActions().updateProperty(d?`${d}${e}`:e,t,{isArrayDeepMerge:s,skipDirtyValidation:i}),this.c11nEnv.isBulkAction()&&(h=!0),e||(e=this.c11nEnv.getStateProps().value),io({type:U.MESSAGES.MESSAGES_TYPE_ERROR,property:e,pageReference:u,context:l,isListEntry:o}),Cg({type:Q,payload:{reference:p,value:t,context:l,isArrayDeepMerge:s,skipDirtyValidation:i,...h&&{isStrictTracking:h},...r&&{removePropertyFromChangedList:r},...c&&{associatedProperty:`${u}${c}`}}})}activateModalContainerItem(e){const t=Le,{context:n}=e,r=n&&n.includes(j.MODAL),s=Wg.buildActionObject({...e,containerName:this.c11nEnv.getContainerName(),containerItemID:n},this.c11nEnv);r&&(s.containerName=j.MODAL,s.isModalAction=r),Cg({type:t,payload:s});const{promise:a}=this.actionsApiPromise(t,s);return a}refreshCaseView(e,t,n,r={}){const{promise:s,actionMgrID:a}=this.actionsApiPromise("REFRESH_DATA"),{autoDetectRefresh:o,propertyName:i,preserveClientChanges:c,classID:l,context:u,optionalPayload:d,isArrayDeepMerge:p}=r,h={actionMgrID:a,caseViewAction:!0,preserveClientChanges:c,propertyName:i,classID:l,isArrayDeepMerge:p,optionalPayload:d};r.refreshFor&&(h.refreshFor=r?.refreshFor),r.resetForm&&(h.resetForm=r?.resetForm);const g=u||this.c11nEnv.getContextName(),f=this.c11nEnv.getPageReference();return!this.c11nEnv.getValue(j.CONTEXT_DATA_MODAL_VIEW.IS_MULTI_RECORD_DATA)&&o&&(((e,t)=>Ml(e)&&!wl(e,t))(g,f)||wl(g,f))?Gd(g,n,h):Fd(e,t,g,n,h),s}refreshEmbeddedDataWithAction(e,t,n,r,s,a,o,i,c={}){const{promise:l}=this.actionsApiPromise(Hu.REFRESH_DATA),u=this.c11nEnv.getContextName();return Ud(e,t,n,u,r||this.c11nEnv.getPageReference(),s,a,o,i,c),l}openEmbeddedDataModal(e,t,n,r,s,a,o,i){const c=gt;let l=t.getCaseInfo().getKey();const u=t.getValue(U.CASE_INFO.IS_LOCAL_ACTION),d=t.getValue(U.CASE_INFO.ASSIGNMENT_ID),p=((e,t,n)=>n||t!==j.ACTION?e.getValue(U.CASE_INFO.ACTIVE_ACTION_ID):e.getValue(U.CASE_INFO.ASSIGNMENTACTION_ID))(t,o,u),h=t.getPageReference();let g="string"==typeof r?`${t.getPageReference().replace(j.getProperty(U.CASE_INFO.CASE_INFO_CONTENT),"")}${n}.${r}`:`${t.getPageReference().replace(j.getProperty(U.CASE_INFO.CASE_INFO_CONTENT),"")}${n}[${r}]`;h.startsWith(U.OBJECT_INFO.OBJECT_INFO)&&!l&&(l=t.getCaseInfo().getObjectKey(),g=`${t.getPageReference().replace(U.OBJECT_INFO.OBJECT_INFO_CONTENT,"")}${n}[${r}]`);const f={targetProperty:n,index:r,viewID:e,ID:l,actionType:s,interestPage:jg.convertPageRefToClipboardPageNotation(g),heading:a,editType:o,interestPageActionID:o===j.ACTION?i:void 0,actionID:p,isLocalAction:u,operationFlag:j.EMBEDDED_DATA_MODAL.SHOW_ROW,isPageGroup:"string"==typeof r,assignmentID:u||o!==j.ACTION?void 0:d},m=Wg.buildActionObject(f,this.c11nEnv);if(o===j.ACTION){const e=jg.getETag(m.context);m.headers={"If-Match":e}}const{promise:I}=this.actionsApiPromise(c,m);if(Dh.getFeatureMap().granularUIRefresh){(t.getMetadata().config.children[0].children||[]).forEach((e=>{const n=un.trimAnnotation(e.config.value),r=qh(n.startsWith(".")?n.replace(".",""):n,e.config.classID);r?.isDeclarativeTarget&&eo.addFieldNode(t.getContextName(),h+g,t.viewName,n,"",{isDeclarativeTarget:!0,propertyName:n,pageReference:h+g})}))}return Cg({type:c,payload:{...m,containerName:U.MODAL,skipSemanticUrl:!0}}),I}submitEmbeddedDataModal(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const t=ft;let n=this.c11nEnv.getValue(j.getProperty(U.CASE_INFO.CASE_INFO_ID));const r=this.c11nEnv.getValue(j.getProperty(U.CASE_INFO.ASSIGNMENT_ID));let s=this.c11nEnv.getPageReference().replace(j.getProperty(U.CASE_INFO.CASE_INFO_CONTENT),"");const a=vp(e),o=this.c11nEnv.getValue(j.getProperty(j.CONTEXT_DATA_MODAL_VIEW.CONTEXT_DATA_MODAL_VIEW)),{interestPageActionID:i,editType:c,isLocalAction:l,actionID:u,viewName:d,parentContext:p}=o;s.startsWith(U.OBJECT_INFO.OBJECT_INFO)&&!n&&(n=this.c11nEnv.getValue(U.OBJECT_INFO.OBJECT_INFO_ID),s=this.c11nEnv.getPageReference().replace(U.OBJECT_INFO.OBJECT_INFO_CONTENT,""));const h={containerItemID:e,containerName:this.c11nEnv.getContainerName(),doDeleteCaseSummary:!0,isInCreateStage:!1,ID:n,viewID:d,isFormValid:Nl(a),interestPage:jg.convertPageRefToClipboardPageNotation(s),parentContext:p,isModalAction:!1,target:this.c11nEnv.getTarget(),editType:c,actionID:u,operationFlag:j.EMBEDDED_DATA_MODAL.SUBMIT_ROW,interestPageActionID:i,isLocalAction:l,assignmentID:r};e&&e.includes(j.MODAL)&&(h.containerName=j.MODAL,h.isModalAction=!0);const g=Wg.buildActionObject(h,this.c11nEnv);if(c===j.ACTION){const e=jg.getETag(g.context);g.headers={"If-Match":e}}const{promise:f}=this.actionsApiPromise(t,g);if(ip(a)){const[e,t,n]=Ba(this.c11nEnv.getPageReference());eo.mutatePageList(p,e,t,{type:et,rowIndex:n}),Cg({type:et,payload:{pageReference:this.c11nEnv.getPageReference(),context:p,isListEntry:!0}})}return zu.executeOrQueueDeferredAction({type:t,payload:{...g,context:a}}),f}fillFormWithAI(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const t=vp(e),n=this.c11nEnv.getPageReference(),{promise:r,actionMgrID:s}=this.actionsApiPromise(It);return Gd(t,n,{actionMgrID:s,isFillFormWithAI:!0,preserveClientChanges:!1}),r}handleSubscript(e,t){if(!Zh(U.VIEW_NAMES.SUBSCRIPT_CREATE_VIEW))return Promise.reject(new Error(this.MSG_SUBSCRIPT_VIEW_REQUIRED));const n=mt,r=Wg.buildActionObject({containerItemID:e},t);Cg({type:n,payload:{...r,isDataObject:!0,skipReleaseLockRequest:!0,isFormValid:Nl(e),context:e}});const{promise:s}=this.actionsApiPromise(n,r);return s}showSubscriptCreateView(e,t,n,r=U.VIEW_NAMES.SUBSCRIPT_CREATE_VIEW){const s=Wg.buildActionObject({viewName:r,className:e,referenceListStr:t,subscriptName:n},this.c11nEnv),a=ne,{promise:o}=this.actionsApiPromise(a,s);return Cg({type:a,payload:{...s,containerName:U.MODAL,skipSemanticUrl:!0,isCreateDataObject:!0}}),o}deleteWork(e,t){if(!e)return Promise.reject(new Error("workId is required parameter"));const n=Rl.isExternalCaseType(t),r=Wg.buildActionObject({workId:e,caseTypeID:t,isExternalCase:n},this.c11nEnv),{promise:s}=this.actionsApiPromise("DELETE_WORK",r);var a;return Cg((a={...r},{type:ql,payload:a})),s}};const Zu=class{constructor(e){this.c11nEnv=e}async getCaseStages(e,t){const n={caseID:e},{restApi:r,reqType:s}=$f("getCaseStages",n);return(await Bo(r,{method:s},t)).data.stages}getCaseTypeName(){return this.c11nEnv.getValue(j.getProperty(j.CASE_INFO.CASE_TYPE_NAME))}getName(){return this.c11nEnv.getValue(j.getProperty(j.CASE_INFO.CASE_INFO_NAME))}getClassName(){return this.c11nEnv.getValue(j.getProperty(j.CASE_INFO.CASE_TYPE_ID))}getAvailableProcesses(){return this.c11nEnv.getValue(j.getProperty(j.CASE_INFO.AVAILABLEPROCESSES))}getKey(){return this.c11nEnv.getValue(j.getProperty(j.CASE_INFO.CASE_INFO_ID))}getObjectKey(){return this.c11nEnv.getValue(j.OBJECT_INFO.OBJECT_INFO_ID)}getID(){const e=this.getKey();if(e){const[,t]=e.split(" ");return t||e}}getAssignmentID(){return this.c11nEnv.getValue(j.getProperty(j.CASE_INFO.ASSIGNMENT_ID))}getActions(){return this.c11nEnv.getValue(j.getProperty(j.CASE_INFO.ACTION_BUTTONS))}getActiveFlowActionID(){return this.c11nEnv.getValue(j.getProperty(j.CASE_INFO.ACTIVE_ACTION_ID))||this.c11nEnv.getValue(j.getProperty(j.CASE_INFO.ASSIGNMENTACTION_ID))}getParentCaseInfo(){return this.c11nEnv.getValue(j.getProperty(j.CASE_INFO.PARENTCASEINFO))}isPerform(){return this.c11nEnv.getValue(`${j.CONTEXT_DATA}${j.CASE_VIEW_MODE_PROP}`)===j.PERFORM_MODE}isReview(){return this.c11nEnv.getValue(`${j.CONTEXT_DATA}${j.CASE_VIEW_MODE_PROP}`)===j.REVIEW_MODE}isAssignmentInCreateStage(){const e=this.c11nEnv.getValue(j.getProperty(j.CASE_INFO.CASE_INFO));return vl(e)}isLocalAction(){const e=this.c11nEnv.getValue(j.getProperty(j.CASE_INFO.CASE_INFO));return bl(e)}getCurrentAssignmentViewName(){let e=null,t=!1;if(this.c11nEnv.getValue("context_data.caseViewMode")===j.PERFORM_MODE){if(this.isLocalAction())return e;if(this.isAssignmentInCreateStage())t=!0;else{const t=this.c11nEnv.getTarget(),n=this.c11nEnv.getContextName(),r=yp(t,n),{config:s}=t&&n?r&&r.view:this.c11nEnv.getMetadata();e=s?.type===j.VIEW?s?.name:null}(e&&e.startsWith(j.PROPERTY_ANNOTATION)||t)&&(e=this.c11nEnv.getValue(j.getProperty(j.CASE_INFO.VIEW_NAME)))}return e}getValueByPath(e,t){let n=e;if((t=t.replace("@P ","").trim()).includes("pyViewContext")){const t=e.caseInfo?.content??{},r=t.pyViewContext;if(""===r)return n.caseInfo.content;if("string"==typeof r&&r.includes("(")&&r.includes(")")){const e=r.substring(1,r.indexOf("(")),n=parseInt(r.substring(r.indexOf("(")+1,r.indexOf(")")),10)-1;if(Array.isArray(t[e]))return t[e][n]}}const r=t.split(/[.[\]]/).filter((e=>e));for(const e of r)if("object"==typeof n&&null!==n&&e in n)n=n[e];else{if(!Array.isArray(n)||Number.isNaN(Number(e)))return;n=n[parseInt(e,10)-1]}return n}getCurrentAssignmentViewClassName(){const e=this.c11nEnv.getTarget(),t=this.c11nEnv.getContextName(),n=yp(e,t),{config:r}=e&&t&&n?n.view:this.c11nEnv.getMetadata(),s=this.c11nEnv.getValue(j.getProperty(j.CASE_INFO.CASE_INFO)),a=r?.type===j.VIEW?r.context:null;if(a){const e=this.getValueByPath({caseInfo:s},a);if("object"==typeof e&&null!==e&&"classID"in e)return e.classID}return null}getActionRefreshConditions(){if(this.c11nEnv.getValue(j.getProperty(j.CONTEXT_DATA_MODAL_VIEW.IS_MULTI_RECORD_DATA)))return this.c11nEnv.getValue(j.getProperty(j.EMBEDDED_DATA_MODAL.REFRESH_CONDITIONS));const e=this.c11nEnv.getValue(j.getProperty(j.CASE_INFO.ACTIVE_ACTION_ID)),t=W(this.c11nEnv.getContextName());let n;t&&(n=Sg(t));const r=n?.caseInfo?.availableActions,s=Sg(this.c11nEnv.getContextName()),a=s?.caseInfo?.refreshConditions;if(e){if(r){const t=r.find((t=>t.ID===e));return t?t.refreshConditions:a}return a}return this.c11nEnv.getValue(j.getProperty(j.CASE_INFO.ACTION_REFRESH_CONDITIONS))}getBusinessID(){return this.c11nEnv.getValue(j.getProperty(j.CASE_INFO.BUSINESS_ID))}getAssignments(){return this.c11nEnv.getValue(j.getProperty(j.CASE_INFO.CASE_INFO))?.assignments}getChildAssignments(){return this.c11nEnv.getValue(j.getProperty(j.CASE_INFO.CASE_INFO))?.childCases?.[0]?.assignments}isCaseWideLocalAction=()=>{const e=this.c11nEnv.getValue(j.getProperty(j.CASE_INFO.ACTIVE_ACTION_ID)),t=this.c11nEnv.getValue(j.getProperty(j.CASE_INFO.CASE_INFO_ACTIONS));if(t&&e){const n=t.find((t=>t.ID===e));return"Case"===n?.type}return!1};getAllAssignments(){const e=this.c11nEnv.getValue(j.getProperty(j.CASE_INFO.CASE_INFO_ACTIONS)),t=this.c11nEnv.getValue(j.getProperty(j.CASE_INFO.ASSIGNMENT_LABEL)),n=this.c11nEnv.getValue(j.getProperty(j.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS))||[],r=this.getChildAssignments()||[];let s=JSON.parse(JSON.stringify(r));s=s.map((e=>(e.isChild=!0,e)));const a=[...n,...s];let o=JSON.parse(JSON.stringify(a));return e&&!this.isPerform()&&(o=o.map((e=>(e.name=this.getActiveCaseActionName()||e?.name||t,e)))),o}getActiveCaseActionName(){const e=this.c11nEnv.getValue(j.getProperty(j.CASE_INFO.CASE_INFO_ACTIONS)),t=this.c11nEnv.getValue(j.getProperty(j.CASE_INFO.ACTIVE_ACTION_ID)),n=e.find((e=>e.ID===t));return n?.name||""}getFirstCaseActionName(){const e=this.c11nEnv.getValue(j.getProperty(j.CASE_INFO.CASE_INFO_ACTIONS));return e[0]?.name||""}hasAssignments(){const e=this.c11nEnv.getValue(j.getProperty(j.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS)),t=this.getChildAssignments();return!!(e||t||this.isCaseWideLocalAction())}hasMessages=()=>!!this.c11nEnv.getValue("caseMessages");hasGetNextWorkLinks(){return!!this.c11nEnv.getValue(j.getProperty(j.CASE_INFO.GETNEXTWORK))}isObjectWideAction(){const e=this.c11nEnv.getValue(j.OBJECT_INFO.OBJECT_INFO);return bl(e)}},{RESOURCE_TYPES:ed}=U;const td=class{static openCase(e,t,n,r={}){const s={insKey:e,acTargetName:n,actionMgrID:rc.getNextActionMgrId(),context:t,...r},a=ue;r&&r.channelName?s.headers={[j.X_ORIGIN_CHANNEL]:r.channelName}:Dh.isWSSPortal()&&(s.headers={[j.X_ORIGIN_CHANNEL]:"WSS"});const{promise:o}=rc.actionManagerPromise(a,s.actionMgrID);return Cg({type:a,payload:s}),o}static openAssignment(e,t,n,r={}){const s={assignmentID:e,vcName:n,doDeleteCaseSummary:!0,actionMgrID:rc.getNextActionMgrId(),context:t,...r},a=ge;r&&r.channelName?s.headers={[j.X_ORIGIN_CHANNEL]:r.channelName}:Dh.isWSSPortal()&&(s.headers={[j.X_ORIGIN_CHANNEL]:"WSS"});const{promise:o}=rc.actionManagerPromise(a,s.actionMgrID);return Cg({type:a,payload:{...s}}),o}static createCase(e,t,n,r={}){const s=le,a={class:e,acTargetName:n,actionMgrID:rc.getNextActionMgrId(),context:t,...r};r&&r.channelName?a.headers={[j.X_ORIGIN_CHANNEL]:r.channelName}:Dh.isWSSPortal()&&(a.headers={[j.X_ORIGIN_CHANNEL]:"WSS"});const{promise:o}=rc.actionManagerPromise(s,a.actionMgrID);return Cg({type:s,payload:{...a}}),o}static getNextWork(e,t,n={}){const r=ge,s={isGetNextWork:!0,vcName:t,doDeleteCaseSummary:!0,actionMgrID:rc.getNextActionMgrId(),context:e,...n},{promise:a}=rc.actionManagerPromise(r,s.actionMgrID);return Cg({type:r,payload:{...s}}),a}static getOpenedCaseItems(e){const t=[],n=Ip(e);if(n){const{items:r={}}=n,s=Object.keys(r),a=Dp(e);s.forEach((n=>{if(r[n]&&(r[n].resourceType===ed.CASE||r[n].resourceType===ed.ASSIGNMENT||r[n].resourceType===ed.OBJECT)){const{key:s="",context:o}=r[n],i=r[n],c=s.substring(s.indexOf(" ")+1),l=Og(".caseTypeID",j.CASE_INFO.CASE_INFO,o),u=a===n;t.push({...i,key:s,workID:s,caseID:c,className:l,context:o,containerItemID:n,target:e,active:u})}}))}return t}static getCaseDetails=(e,t)=>{if(!e)return Promise.reject(new Error("Case ID is required"));const n={caseID:e},{restApi:r,reqType:s}=$f(Be,n),a={},o=$.getRemoteHeaderFromSourceClass(t??"");return o&&(a.RemoteSystemID=o),Bo(r,{method:s,headers:a})};static getCaseBulkActions=async e=>{const{restApi:t,reqType:n}=$f("getBulkActions"),r=e.map((e=>({ID:e}))),s=r.length,a=s/5,o={},i=[];for(let e=0;e<s;e+=a)o.cases=r.slice(e,e+a),o.cases.length&&i.push(Bo(t,{method:n,body:o}));const c=await Promise.all(i);let l=[];for(let e=0;e<c.length;e+=1)0===e?l=c[e].data.availableActions:l.length&&(l=l.filter((t=>c[e].data.availableActions.some((e=>t.ID===e.ID)))));return l};static getCaseBulkActionsByCaseTypeID=async e=>{const t={casetypeID:e},{restApi:n,reqType:r}=$f("getCaseBulkActions",t),s=await Bo(n,{method:r});let a=[];return s.data?.availableActions?.length&&(a=s.data.availableActions),a}};class nd{constructor(e){nd._instance=this,this.context=`${e}/${j.SUGGESTION}`,_g()?.getState().data?.[this.context]||Cg({type:Ue,payload:{context:this.context,data:{}}})}getField(e){return Og(e,"",this.context)}setField(e,t){Cg({type:Q,payload:{reference:e,value:t,context:this.context}})}removeField(e,t={}){Cg({type:me,payload:{reference:e,context:this.context,...t}}),yo.publish(j.PUB_SUB_EVENTS.SUGGESTION_PROCESSED,{reference:e,context:this.context,...t})}setState(e){Cg(Yg({context:this.context,data:e,isArrayDeepMerge:!0}))}}const rd=nd;const sd=class{static getSharedState(e){const t=e.startsWith(".")?e.substring(1):e,n=Tg();return n?jg.getIn(n,t):null}static setSharedState(e,t){e&&Cg(Df({key:e,value:t}))}static updateState(e,t,n,r={}){const{isArrayDeepMerge:s=!0,pageReference:a,removePropertyFromChangedList:o=!1}=r;if(!e||!t)return;Cg(Rf({context:e,reference:a?`${a}.${t}`:t,value:n,isArrayDeepMerge:s,removePropertyFromChangedList:o}))}static getSuggestionsContext(e){return new rd(e)}static triggerRefresh(e,t){Wd({context:e,pageReference:t})}};let ad;const od=e=>{if(e){const t=(new DOMParser).parseFromString(e,"text/html").getElementsByTagName("pega-reference")[0].getAttribute("data-rule-id")??"";if(t){const e=ad.getValue(t);return ad.registerAdditionalProps({[t]:`@P ${t}`}),e}}};class id{static getParagraphStream(e,t){return((e,t)=>{ad=t;const n=e.replace(/<pega-reference(.*?)<\/pega-reference>/g,od);return/^(<p>)\s*(<\/p>)$/.test(n)?null:n})(e,t)}static isDecisionParagraph(e,t){const n=ig(e,t);return!!n?.useDecision}static processParagraph(e,t){const n=t.getCurrentClassID(),r=ig(e,n);let s;if(r?.useDecision){const n=r.dynamicContents.length;for(let a=0;a<n-1;a+=1)if(Bg.resolveWhen(r.dynamicContents[a].when,t)){s=r.dynamicContents[a],e=`${e}#${s.when}`;break}s||(s=r.dynamicContents.pop())}else s=r;const a=r?.definedOnClassID,o=vh.getParagraphLocaleValue(a||n,e);return o?id.getParagraphStream(o,t):s?.content?id.getParagraphStream(s.content,t):null}}const cd=id;class ld{constructor(e){this.fieldType=e}applyFallback(e){const t=Pi.getDefaultsforType(this.fieldType);e.currencyISOCode=e.currencyISOCode||t?.currencyISOCode||"USD"}}class ud{static getStrategy(e){switch(e){case"Currency":case"Decimal":case"Integer":case"Percentage":return new ld(e);default:return}}}const dd="DATAPAGE",pd="VIEW",hd="FIELD",gd="PARAGRAPH",fd=(e,t,n,r)=>{const s=[pd,hd,gd],a=[dd,gd];(!t||s.includes(e)&&!n)&&console.warn(`Invalid parameters for locale reference: type=${e}, id=${t}, scope=${n}, path=${r}`);const o=a.includes(e)&&r?`#${r}`:"",i=e===dd?"@BASECLASS":n;return e===dd||s.includes(e)?`${i}!${e}!${t}${o}`.toUpperCase():`${e}!${t}${o}`.toUpperCase()};class md{static COMMON_LABELS="COMMONLABELS";static MESSAGES="MESSAGES";static COMPONENT_FIELDS="COMPONENTFIELDS";lookupList=[];constructor(e,t){this.localeReference=t,this.locale=e}getLocalizedText(e,t){const n=zh(this.locale),r=this.#r(e,this.localeReference?n.localeStore[`${this.localeReference.toUpperCase()}`]:{})||this.#r(e,n.localeStore[md.COMMON_LABELS])||this.#r(e,n.localeStore[md.COMPONENT_FIELDS])||this.#s(e)||e;return(t?this.#a(r,t):r)||e}getLocalizedMessage(e,t){const n=zh(this.locale).localeStore[md.MESSAGES]??{},r=this.#r(e,n)??e;return(t?this.#a(r,t):r)||e}getLocalizedDataPage(e,t,n,r){if(!t||!n||!e)return e;const s=fd(dd,t,void 0,n),a=zh(this.locale),o=this.#r(e,a.localeStore[s])??this.#r(e,a.localeStore[md.COMMON_LABELS])??this.#s(e)??e;return(r?this.#a(o,r):o)||e}#a(e,t){return 0===t.length?e:e.replace(/\{(\d+)\}/g,((e,n)=>t[""+(Number(n)-1)]??e))}#s(e){if(0===this.lookupList.length)return;const t=zh(this.locale);for(const n of this.lookupList){const r=this.#r(e,t.localeStore[n]);if(r)return r}}#r(e,t){if(null==e||!t)return;const n=t[e]??t[e];return"string"==typeof n?n:void 0}setLookupList(e){Array.isArray(e)&&(this.lookupList=e)}}const Id=e=>F.getNeedsMapping()||e?.info===U.OBJECT_INFO.OBJECT_INFO?U.OBJECT_INFO.OBJECT_INFO:U.CASE_INFO.CASE_INFO,yd=(e,t)=>{const n=Id(t);e.data=e.data??{};const{assignments:r,availableActions:s=[]}=e.data[n]??{};if(r&&Array.isArray(r)&&r.length>0&&r[0].actions&&Array.isArray(r[0].actions)&&!t?.stopMergeActions){r[0].actions.forEach((e=>{"Assignment"!==e.type&&"LocalAction"!==e.type||s.push(e)})),e.data[n]=e.data[n]??{},e.data[n].availableActions=s}},Ed=(e,t)=>{const n=Id(t);if(e.confirmationLinks&&(e.data=e.data??{},e.data[n]=e.data[n]??{},e.data[n].confirmationLinks=e.confirmationLinks),!e.uiResources&&e.confirmationNote){let t=e;const{confirmationNote:n}=t;return yd(t),t=((e,t)=>{const n=[e];return t.data=t.data??{},t.data.caseMessages=n,t})(n,t),t}if(!e.uiResources||!e.data||!e?.uiResources?.root)return e;const r=e,{uiResources:{actionButtons:s,navigation:a},nextAssignmentInfo:o}=r;if(r.data&&r.data[n]&&(s&&(r.data[n].actionButtons=s),a&&(r.data[n].navigation=a),t&&t[U.ACTIONS.DELETEAVIALACTIONS]&&delete r.data[n].availableActions,yd(r,t),e.confirmationNote)){const{confirmationNote:e}=r,t=[e];r.data.caseMessages=t}return t&&t.isCreateDataObject&&(r.data=r.data??{},r.data.dataInfo={},r.data.dataInfo.content=r.data.pyPortal,r.uiResources.root.config.context="dataInfo.content",r.uiResources.context_data.dataInfo=r.uiResources.context_data.dataInfo??{},r.uiResources.context_data.dataInfo.content=r.uiResources.context_data.dataInfo.content??{},r.uiResources.context_data.dataInfo.content=r.uiResources.context_data?.pyPortal,delete r.data.pyPortal,delete r.key),o&&(r.data=r.data??{},r.data.nextAssignmentInfo=o),r},Ad=async e=>{const t=Ed(e),n=jg.getIn(t,j.COMPONENTS);ji(t,{},!0);const r=jg.getIn(t,j.LOCALE_REFERENCES);await vh.loadLocaleResources(r||[]),await ec(n)},_d=(e,t,n)=>Bg.resolveView(e,t,n);const Cd=class{constructor(e,t,n){this.meta=e,this.datasource=t,this.index=0,this.options=n,this.datasourceObj=Bg.getPropertyValue(t,n.pageReference,n.context)}hasNext(){return this.index<this.datasourceObj.length}next(){if(!this.hasNext())throw new Error("No Children");const e=Bg.getContextPath(this.datasource,this.index);return this.index+=1,vd({meta:this.meta,options:{...this.options,pageReference:e}})}resetIndex(){this.index=0}};class Sd{constructor(e,t){this.children=e,this.index=0,this.options=t}hasNext(){return this.index<this.children.length}next(){if(!this.hasNext())throw new Error("No Children");const e=this.children[this.index];return this.index+=1,vd({meta:e,index:this.index,options:this.options})}resetIndex(){this.index=0}}const Td=(e,t)=>{const n=!!e?.repeat;if(!!e?.["repeat-self"])return new Cd(e,e.context||"",t);if(n){const n=Dg(`${t.context}.${j.SUMMARY_OF_LISTS}`,e.pageReference,t.context);return new Cd(e.children[0],n||e.context,t)}return e?.children?new Sd(e.children,t):void 0};class Nd{static allowedComponetsForBulkProcessing={Currency:!0,TextInput:!0,Phone:!0,Percentage:!0,Email:!0,Integer:!0,Decimal:!0,URL:!0,SemanticLink:!0,Checkbox:!0,RadioButtons:!0,DateTime:!0,Date:!0,Time:!0,Text:!0,TextArea:!0,RichText:!0,Dropdown:!0,Search:!0,Location:!0,Attachment:!0,AutoComplete:!0,MultiSelect:!0,UserReference:!0,Region:!0,TextContent:!0,View:{Forms:!0,DefaultForm:!0,OneColumn:!0,TwoColumn:!0,ThreeColumn:!0}};static getItemView(e,t){const n=[];if(e&&["portal","view"].includes(t)){const{accessedOrder:t,items:r}=e;if(t&&r){const e=t[t.length-1];r[e]&&r[e].view&&Object.keys(r[e].view).length>0&&n.push(r[e])}}return n}static getDependentProperties=e=>{let t=[];return e._rawConfig?.config?.parameters?t=Object.values(e._rawConfig?.config?.parameters||{}):e.getFieldMetadata(e.getStateProps()?.value)?.datasource?.parameters&&(t=(e.getFieldMetadata(e.getStateProps()?.value)?.datasource?.parameters||[]).map((e=>e?.value))),t.filter((e=>Yl.isProperty(e))).map((e=>Yl.getPropertyName(e)))}}const Od=new Nd;let Pd;Object.freeze(Od);const Dd=(e,t,n)=>{e&&(Object.keys(e).forEach((r=>{if("children"!==r){const s=e[r],a=un.trimAnnotation(s);if("string"!=typeof a&&"string"!=typeof s||!(jg.isValidAnnotation(s)&&jg.isPropertyRef(a)||s.startsWith("@W ")||s.startsWith("@DW ")||s.startsWith("@E ")||s.startsWith("@ATTACHMENT "))){if(Array.isArray(a))a.forEach(((e,n)=>{const s={parentStateObj:t,parentKey:r,isObjHasValue:!!t[r]};t[r]=t[r]||[],t[r][n]=Object.create({}),Dd(e,t[r][n],s)}));else if(a&&"object"==typeof a&&"exp"!==a.type){const e={parentStateObj:t,parentKey:r,isObjHasValue:!!t[r]};t[r]=t[r]||{},Dd(a,t[r],e)}}else n&&n.parentKey&&(n.isObjHasValue=!0),t[r]=a}})),n&&!n.isObjHasValue&&delete n.parentStateObj[n.parentKey])},Rd=(e,t)=>{e._inheritedProps=e._inheritedProps||[],e.inheritedProps=[...e._inheritedProps,...jg.deepClone(t.inheritedProps)]};class bd{constructor(e){const{meta:t,isRoot:n,options:r={},useCustomContext:s}=e;this.meta=t,this._isRoot=n,this.options=r,this.useCustomContext=s,this._rawConfig=t?.config,this._isExpressionExist=!1,this._isWhenExist=!1,this._isValidatorExist=!1,this._pageReference="",this._referenceContext="",this._contextName="",this._stateProps={},this._actions={},this._children="",this._additionalRegisteredProps={},this._caseInfo=null,this.viewName=r.viewName,this.parentViewName=r.viewName??"",this._referenceList=r.referenceList||"",this._isInsideList=r.isInsideList||!1,this._inheritedConfig={},this._localeRuleName=r.localeReference,this._containerTarget=r.target,this._readOnly=t?.config?.readOnly||r.readOnly,this._hasSuggestions=!1,this._actionsApi=null,this._classID=null,this.index=e.index,this.categoryName=r.categoryName||"",r.inheritedConfig&&(this._inheritedConfig=jg.deepClone(r.inheritedConfig)),t?.config?.inheritedProps&&Rd(this._inheritedConfig,t?.config),this.meta?.config?.value&&"string"==typeof this.meta?.config?.value&&this.meta?.config?.value?.startsWith("@P ")&&this.meta?.config?.value?.includes("(")&&(this.meta.config.value=Qo.formatePageReferenceToArrayIndex(this.meta.config.value)),Dd(this._rawConfig,this._stateProps),this._isState=!jg.isObjectEmpty(this._stateProps),this._rawConfig&&this._rawConfig.config&&(this._isExpressionExist=jg.isExpressionExist(this._rawConfig.config),this._isWhenExist=jg.isWhenExist(this._rawConfig.config),this._isValidatorExist=Fi.isValidatorExist(this._rawConfig.config)),this._isRoot?this._contextName=U.APP.APP:this._contextName=this.meta?.config?.contextName||this.options.context||"",this._type=this.meta?.type;let a=this.options.pageReference;this.options.pageReference&&(a=un.handleAnnotation(this.options.pageReference,this)),this._pageReference=Bg.getContextPath(a||this.options.parentPageReference,this._pageReference),this._pageReference||(this._pageReference=""),"reference"===this._type&&(this._rawConfig=t);const o="reference"===this._type&&jg.isWhenExist({visibility:this.meta?.config?.visibility}),i=this._checkAndSetDecisionParagraph("instructions",this._rawConfig?.instructions);let c=!1;if("reference"!==this._type&&t&&(this._rawConfig=Bg.resolveReference(t,this)),this._rawConfig){const e=this.getRawConfigProps();e&&(this._localeRuleName=un.trimAnnotation(e.localeReference)||r.localeReference,this._isExpressionExist=jg.isExpressionExist(e),this._isWhenExist=jg.isWhenExist(e),this._isValidatorExist=Fi.isValidatorExist(e),c=this._checkAndSetDecisionParagraph("label",e?.label)),this._children=this._rawConfig.children,this._rawConfig?.type?.toLowerCase()===j.VIEW&&this._rawConfig.name&&(this.viewName=un.handleAnnotation(this._rawConfig.name,this)),this.options.hasForm&&$d(this)}(o||i||c)&&jd(this.viewName,this._contextName,this._pageReference)}_checkAndSetDecisionParagraph(e,t){let n=!1;if(t&&t.startsWith(j.PARAGRAPH_ANNOTATION)){const r=un.trimAnnotation(t);n=cd.isDecisionParagraph(r,this.getCurrentClassID()),n&&this.setStateProps({[e]:t})}return n}isDeclarativeTarget(){let e=!1;if(this.getValue(this._pageReference)||""===this._pageReference){const t=un.trimAnnotation(this.getPropertyName()),n=this.getFieldMetadata(t);e=n?.isDeclarativeTarget||!1}return e}_getPropertyName(){const e=un.trimAnnotation(this.getPropertyName());return""===this._pageReference&&e.startsWith(".")?e.substring(1,e.length):e}addFieldNode(){const e=this._getPropertyName(),{value:t,label:n,required:r,readOnly:s,disabled:a,visibility:o,validationType:i,caption:c,allowMultiple:l}=this.getRawConfigProps();if(this.getValue(this._pageReference)||""===this._pageReference){const u="Address"===this._type&&this._rawConfig?.config?.associatedView?un.trimAnnotation(this._rawConfig.config.associatedView):"",d=n||c,p={target:this._containerTarget,context:this._contextName,pageReference:this._pageReference,propertyName:un.trimAnnotation(t),label:d?.startsWith("@")?un.handleAnnotation(d,this,void 0):d,required:r,readOnly:s,disabled:a,visibility:o||this.options?.visibility,skipRequiredValidation:this.options?.isBulkAction,inheritedProps:this.getInheritedProps(),useCustomContext:this.useCustomContext,value:t,validationType:i,componentName:this._rawConfig?.type,hasSuggestions:this._hasSuggestions,isInsideList:this.isInsideList(),index:this.index,allowMultiple:l,isDeclarativeTarget:this.isDeclarativeTarget()};eo.addFieldNode(this._contextName,this._pageReference,(u||this.categoryName||this.viewName)??"",e,this.getValue(e),p)}}removeNode(){if(!this.isVisible())if(Object.hasOwn(this._rawConfig?.config??{},"value")&&"Address"!==this._type)eo.removeFieldNode(this._contextName,this._pageReference,this.viewName||"",un.trimAnnotation(this.getPropertyName()),this.index);else if("Address"===this._type&&this._rawConfig?.config?.associatedView)eo.removeViewNode(this._contextName,this._pageReference,un.trimAnnotation(this._rawConfig.config.associatedView),this.index);else{const e=this._rawConfig?.config?.context?`${this._pageReference}${this._rawConfig?.config.context}`:this._pageReference;eo.removeViewNode(this._contextName,e,this._rawConfig?.config?.name||this._rawConfig?.config?.id||"",this.index)}}addViewNode(){this._rawConfig?.type?.toLowerCase()===j.VIEW&&this._rawConfig.name&&this.viewName&&eo.addViewNode(this._contextName,this._pageReference,this.viewName,this.parentViewName),"Group"===this._rawConfig?.type&&this._rawConfig?.config?.id&&eo.addViewNode(this._contextName,this._pageReference,this._rawConfig.config.id,this.parentViewName),"Address"===this._rawConfig?.type&&this._rawConfig?.config?.associatedView&&eo.addViewNode(this._contextName,this._pageReference,un.trimAnnotation(this._rawConfig.config.associatedView),this.parentViewName),"deferload"===this._rawConfig?.type?.toLowerCase()&&this._rawConfig.config?.name&&eo.addViewNode(this._contextName,this._pageReference,this._rawConfig.config.name,this.parentViewName)}addWhenNode(){let e="",t="";const n=jg.getWhenNames(this._rawConfig?.config),r=this.getRawConfigProps();if(r?.type&&r?.type?.toLowerCase()===j.VIEW)t=j.CONTEXT_TREE_NODE_TYPES.VIEW,e=this.getCurrentView();else{t=j.CONTEXT_TREE_NODE_TYPES.FIELD;const n=this.getPropertyName();e=un.isProperty(n)?un.trimAnnotation(n):""}e&&n.forEach((n=>{eo.addWhenNode(this.getContextName(),this.getPageReference(),t,e,n,{pageReference:this.getPageReference(),context:this.getContextName()})}))}updateContextTree(){if(this.isVisible()&&(this.addViewNode(),this._rawConfig?.config&&Object.hasOwn(this._rawConfig.config,"value")&&"DISPLAY_ONLY"!==this._inheritedConfig.displayMode&&"DISPLAY_ONLY"!==this._rawConfig.config?.displayMode&&this.addFieldNode(),(this._rawConfig?.type?.toLowerCase()!==j.VIEW||"Editable"===this._rawConfig.config?.renderMode)&&this._rawConfig?.config?.referenceList&&"DISPLAY_ONLY"!==this._rawConfig.config?.displayMode)){const{value:e,label:t,required:n,readOnly:r,disabled:s,visibility:a,validationType:o,selectionMode:i,selectionList:c,selectionKey:l,referenceList:u,renderMode:d,caption:p}=this.getRawConfigProps(),h=t||p;let g=[];["Multiselect","Checkbox"].includes(this._rawConfig.type)&&(g=this.getSelfReferencingDatapageKeys()),eo.addPageListNode(this._contextName,this._pageReference,this.viewName??"",un.trimAnnotation(this.getPropertyName()),{target:this._containerTarget,context:this._contextName,pageReference:this._pageReference,propertyName:un.trimAnnotation(this.getPropertyName()),label:h?.startsWith("@")?un.handleAnnotation(h,this,void 0):h,required:n,readOnly:r,disabled:s,visibility:a||this.options.visibility,skipRequiredValidation:this.options.isBulkAction,inheritedProps:this.getInheritedProps(),useCustomContext:this.useCustomContext,value:e,validationType:o,componentName:this._rawConfig.type,type:this._rawConfig.config?.type,hasSuggestions:this._hasSuggestions,isInsideList:this.isInsideList(),selectionMode:i,selectionList:c,renderMode:d,referenceList:u,selectionKey:l,index:this.index,selfReferencingDatapageKeys:["Multiselect","Checkbox"].includes(this._rawConfig.type)?g:void 0});const f=this.getValue(un.trimAnnotation(this.getPropertyName()),this._pageReference)||[];eo.updatePageListNode(this._contextName,this._pageReference,un.trimAnnotation(this.getPropertyName()),f.length)}this.isWhenExist()&&this.addWhenNode(),this.removeNode()}getStateProps(){return this._stateProps}setStateProps(e){jg.mergeDeep(e,this._stateProps)}getMetadata(){return this._rawConfig}getSharedDataPageForReferenceList(){const e=this.getCaseInfo().getClassName(),t=this.getCurrentView();if(!t||!e)return;const n=_d(t,this,e);if(!n)return;const r=this.getRawMetadata()?.config?.referenceList;if(!r)return;let s={};"object"==typeof n.config?.parameters&&null!==n.config.parameters&&(s=n.config.parameters);const a=jg.generateDataPageHashWithParameters(s,r,this),o=Tg(),i=o?o[r]?.[a]:{};return Array.isArray(i?.pxResults)?i.pxResults:void 0}getCaseInfo(){return this._caseInfo||(this._caseInfo=new Zu(this)),this._caseInfo}getCaseLocaleReference(){const e=this.getValue(j.getProperty(j.CASE_INFO.CASE_TYPE_ID));return vh.getCaseLocaleReference(e)}getListActions(){return Oi(this)}getReferenceList(){return this._referenceList}isInsideList(){return this._isInsideList||/\[\d+\]/g.test(this.getPageReference())||/\[\d+\]/g.test(this.getPropertyName())}getRawMetadata(){return this.getMetadata()}setReferenceList(e){this._referenceList=e}getComponentConfig(){return this.getMetadata()?.config||{}}isExpressionExist(){return this._isExpressionExist}isWhenExist(){return this._isWhenExist}isConditionExist(){return this.isExpressionExist()||this.isWhenExist()}isBoundToState(){return this._isState}getPageReference(){return this._pageReference}getPropertyName(){const e=this.getComponentConfig();let t;return t="multi"===e.selectionMode?"selectionList":"single"===e.selectionMode&&e.selectionKey?"selectionKey":"Editable"===e.renderMode?"referenceList":"Address"===this._type?"addressProp":"value",this.getComponentConfig()[t]}getFullReference(){const e=this.getPageReference(),t=this.getPropertyName();return Bg.getContextPath(e,t)}getContextName(){return this._contextName}getContainerName(){const{type:e}=this.getMetadata()||{},t=[j.CONTAINERS.ROOT_CONTAINER,j.CONTAINERS.VIEW_CONTAINER,j.CONTAINERS.FLOW_CONTAINER,j.CONTAINERS.MODAL_VIEW_CONTAINER,j.CONTAINERS.PREVIEW_VIEW_CONTAINER,j.CONTAINERS.HYBRID_VIEW_CONTAINER],{acTargetName:n=gp.PRIMARY,name:r,routingInfo:s}=this.getComponentConfig();return(e&&t.includes(e)||"@ROUTING_INFO"===s)&&r?r:this.options.containerName||n}getTarget(){return this._containerTarget}getCurrentView(){return this.viewName}populateSuggestionProps(e){if(this._rawConfig?.config&&Object.hasOwn(this._rawConfig.config,"value")&&this.getStateProps()?.value&&this.options.hasForm){const t=u?.getStore()?.getState()?.data[`${this.getContextName()}/${j.SUGGESTION}`],n=this.getStateProps()?.value,r=Bg.getContextPath(this.getPageReference(),n),s=t?sd.getSuggestionsContext(this.getContextName()).getField(r):void 0;this._hasSuggestions=!!s,e.hasSuggestions=this._hasSuggestions,this._stateProps.hasSuggestions=this._hasSuggestions}}getConfigProps(e={}){const t={...Pi.getDefaultsforType(this._type),readOnly:this._readOnly,...this._rawConfig?.config,...this._additionalRegisteredProps,...this._inheritedConfig},n=ud.getStrategy(this._type);return n?.applyFallback(t),this.populateSuggestionProps(t),this.resolveConfigProps(t,e),jg.resolveStringBooleans(e)}getLocalizationService(e){const t=this.getComponentName(),n=e||("View"===t?this._rawConfig?.config?.template:t),r=Dh.getLocale()??"en-US",s=new md(r,n),a=this.getCaseLocaleReference();return a&&s.setLookupList([a]),s}getRawConfigProps(){const e={...Pi.getDefaultsforType(this._type),...this._rawConfig?.config,...this._additionalRegisteredProps,...this._inheritedConfig};return this.populateSuggestionProps(e),e}resolveConfigProps(e,t={}){return e&&(Bg.resolveProps(e,t,this),un.handleComponentMapping(t,{type:this.getComponentName()||"",config:e},this)),t}registerAdditionalProps(e={}){return Object.assign(this._additionalRegisteredProps,e),Dd(e,this._stateProps),this.resolveConfigProps(this._additionalRegisteredProps)}deRegisterAdditionalProps(e=[]){return e.forEach((e=>{delete this._additionalRegisteredProps[e]})),!0}populateAdditionalProps(e){const t=e=>e?.map((e=>({...e,message:this.getLocalizationService()?.getLocalizedMessage(e.message)??e.message}))),n=this.getComponentName(),r=this.getComponentConfig(),s=n===j.ROOT_CONTAINER&&"portal"!==e.renderingMode;if(n===j.MODAL_VIEW_CONTAINER||n===j.CASE_CREATE_STAGE){const n=Dp(`${j.APP.APP}/${this.getContainerName()}`),r=oo({context:n,category:U.PAGE});e.pageMessages=t(r),this._stateProps.pageMessages=e.pageMessages}if(this.isEditable()){let{value:t}=this.getStateProps();void 0===t&&"multi"===this.getComponentConfig()?.selectionMode?t=this.getStateProps().selectionList||un.trimAnnotation(this.getRawConfigProps().selectionList):!t&&"Editable"===this.getComponentConfig()?.renderMode&&this.getStateProps().referenceList&&(t=this.getStateProps().referenceList);const n=oo({property:t,pageReference:this.getPageReference(),context:this.getContextName(),type:U.MESSAGES.MESSAGES_TYPE_ERROR}),r=oo({property:t,pageReference:this.getPageReference(),context:this.getContextName(),type:U.MESSAGES.MESSAGES_TYPE_INFO});n&&n[0]&&(e.validatemessage=n.map((e=>this.getLocalizationService().getLocalizedMessage(e.message).replace(/\.$/,""))).join(". ")+(n[n.length-1].message.endsWith(".")?".":""),e.status=j.FIELD_LEVEL_ERROR,this._stateProps.validatemessage=e.validatemessage,this._stateProps.status=e.status),r&&r[0]&&(e.infoMessage=r[0].message,e.status=j.FIELD_LEVEL_WARNING,this._stateProps.infoMessage=e.infoMessage,this._stateProps.status=e.status)}if(n===j.ROOT_CONTAINER){const n=uo(s,Dp(`${j.APP.APP}/${this.getContainerName()}`));e.httpMessages=Array.isArray(n)?t(n):n,this._stateProps.httpMessages=e.httpMessages;const r=sd.getSharedState("isLoggedOut");e.isLoggedOut=r,this._stateProps.isLoggedOut=r;const a=oo({context:j.APP.ROOT,category:"PAGE"});e.pageMessages=t(a),this._stateProps.pageMessages=e.pageMessages}if(n===j.HYBRID_VIEW_CONTAINER){const n=oo({context:j.APP.APP,category:j.HTTP});e.httpMessages=t(n),this._stateProps.httpMessages=n}if(n===j.APP_SHELL&&e.portalDocMode===j.CONTAINER_TYPE.MULTIPLE&&(e.activeCases=td.getOpenedCaseItems(`${U.APP.APP}/${j.PRIMARY}`),this._stateProps.activeCases=e.activeCases),n===j.APP_SHELL){const n=j.APP.APP,r=Dp(`${n}/${this.getContainerName()}`),s=[...oo({context:n,category:"PAGE"})||[],...oo({context:r,category:"PAGE"})||[]],a=s.length>0?s:void 0;e.pageMessages=a&&t(a),this._stateProps.pageMessages=e.pageMessages}if(e.value&&n===j.SCALARLIST&&(this._stateProps.value=e.value),n===j.APP_SHELL||n===j.MODAL_VIEW_CONTAINER||n===j.CASE_CREATE_STAGE||r.template===j.CASE_PREVIEW){let t=oo({context:j.APP.APP,category:"HTTP"});const n=oo({context:Dp(`${j.APP.APP}/${this.getContainerName()}`),category:"HTTP"});t?n&&(t=t.concat(oo({context:Dp(`${j.APP.APP}/${this.getContainerName()}`),category:"HTTP"}))):t=oo({context:Dp(`${j.APP.APP}/${this.getContainerName()}`),category:"HTTP"}),e.httpMessages=t?t.map((e=>this.getLocalizationService().getLocalizedMessage(e.message))):t,this._stateProps.httpMessages=e.httpMessages,t?.forEach((t=>{t.errorDetails&&(e.errorDetails=e.errorDetails?e.errorDetails.push(...t.errorDetails):t.errorDetails,this._stateProps.errorDetails=e.errorDetails),t.correlationID&&(e.correlationID=t.correlationID)}))}if(n===j.VIEW_CONTAINER||n===j.FLOW_CONTAINER||n===j.MODAL_VIEW_CONTAINER||n===j.PREVIEW_VIEW_CONTAINER||n===j.ROOT_CONTAINER){if(e.routingInfo=Dt(this.getContainerName(),this._contextName),n===j.ROOT_CONTAINER&&(e.rootConfig=Nd.getItemView(e.routingInfo,e.renderingMode),this._stateProps.rootConfig=e.rootConfig),this._stateProps.routingInfo=e.routingInfo,n===j.FLOW_CONTAINER){const n=oo({context:this.getContextName(),category:j.CASEMESSAGES}),r=this.getContextName();e.caseMessages=n,this._stateProps.caseMessages=e.caseMessages,e.caseViewMode=this.getValue("context_data.caseViewMode"),this._stateProps.caseViewMode=e.caseViewMode;const s=Mp(r)[0];if(s){const n=Dp(s),r=u?.getStore()?.getState()?.data;r&&n&&(e.lastUpdateTime=r[n]?.caseInfo?.lastUpdateTime,this._stateProps.lastUpdateTime=r[n]?.caseInfo?.lastUpdateTime);const a=oo({context:n,category:U.PAGE}),o=oo({context:n,category:"HTTP"});e.httpMessages=t(o),e.pageMessages=t(a),this._stateProps.pageMessages=e.pageMessages,this._stateProps.httpMessages=e.httpMessages,o?.forEach((t=>{t.errorDetails&&(e.errorDetails=e.errorDetails?e.errorDetails.push(...t.errorDetails):t.errorDetails,this._stateProps.errorDetails=e.errorDetails),t.correlationID&&(e.correlationID=t.correlationID)}))}}if(e.loadingInfo=this.getLoadingStatus(this.getContextName()),e.assignmentNames=this.getCaseInfo().getAssignments()?.map((e=>e.name)),e.childAssignmentNames=this.getCaseInfo().getChildAssignments()?.map((e=>e.name)),n===j.MODAL_VIEW_CONTAINER){const t=e.routingInfo?.accessedOrder||[],n=t[t.length-1];n&&(e.loadingInfo=this.getLoadingStatus(n))}this._stateProps.loadingInfo=e.loadingInfo,this._stateProps.assignmentNames=e.assignmentNames,this._stateProps.childAssignmentNames=e.childAssignmentNames}else r.template===j.CASE_VIEW||r.template===j.SELF_SERVICE_CASE_VIEW||r.template===j.CASE_PREVIEW||r.template===j.OBJECT_PAGE?(e.caseInfo=this.getCaseSummary(),this._stateProps.caseInfo=e.caseInfo):n===j.CASE_STAGES&&(e.stages=this.getCaseStages(),e.stageID=this.getStageID(),this._stateProps.stages=e.stages,this._stateProps.stageID=e.stageID);const a=this.getInheritedProps()?.shouldAutoRefresh;a&&this.meta?.config?.value?.includes("@P")&&void 0===this.meta.config._autoRefresh_&&(this.meta.config._autoRefresh_=`@REFRESH ${this.meta.config?.value.split("@P ")[1]}`),this.populateFieldMetadata(e),this.updateContextTree()}populateFieldMetadata(e){const{value:t,datasource:n,listType:r}=this.getComponentConfig(),{propertyValue:s,propertyAnnotation:a}=this.getPropertyDetails(r,n,t);if(s&&"string"==typeof s&&(s.includes(a)||s.includes(j.ATTACHMENT_ANNOTATION))){const t=un.getPropertyName(s),n=this.getFieldMetadata(t);n&&this.updateConfigData(e,n,t)}}resolvePropertyMetadata(e,t){if(!e)return e;const n=gg(`${this._pageReference}.${t}`,this._contextName);return e?.additionalInformation&&this.setStateProps({additionalInformation:n}),(n||null===n)&&(e.additionalInformation=n),e}resolvePageClass(e){const t=this.getValue(j.CASE_INFO.CASE_INFO_CLASSID);if(!t)return;const n=e.split(".").slice(0,-1);let r=t;for(const e of n){const t=qh(e,r);if(!t)return;if(r=Array.isArray(t)?t[0]?.pageClass:t.pageClass,!r)return}return r}getFieldMetadata(e){if(!e)return null;const t=e.split(".");if(t.length<2){let t=this.getValue(j.CLASS_ID);return!t&&this._rawConfig&&this._rawConfig.config&&this._rawConfig.config.ruleClass&&(t=this._rawConfig.config.ruleClass),this.resolvePropertyMetadata(qh(e,t),e)}const n=t.pop(),r=t.join(".")?".":"";let s=this.getValue(`${r}${t.join(".")}${j.CLASS_ID}`);return s||(s=this.resolvePageClass(e)),this.resolvePropertyMetadata(qh(n,s),e)}getCurrentPageFieldMetadata(e=null){let t=this.getPageReference().split(".");null!==e&&(t=e.split("."));const n=t.pop();return this.resolvePropertyMetadata(qh(n,this.getValue(`${t.join(".")}${j.CLASS_ID}`)))}getCurrentClassID(){return this._classID??this.getValue(j.CLASS_ID)}getCaseSummary(){const e={...this.getDataObject()[j.getProperty(U.CASE_INFO.CASE_INFO)]};return e.CaseID=e.CaseID||this.getValue(j.getProperty(U.CASE_INFO.CASE_INFO_PZINSKEY)),{...e,isCaseWideAction:()=>wl(this.getContextName(),this.getPageReference())}}getReferencedUser(e){const t=this.getValue("referencedUsers");if(Array.isArray(t)){const n=t.find((t=>t.UserID===e));if(n)return{userId:n.UserID,UserName:n.UserName}}return t&&t[e]?t[e]:null}getCaseStages(){return this.getDataObject()[U.CASE_INFO.CASE_INFO].stages}getStageID(){return this.getDataObject()[U.CASE_INFO.CASE_INFO].stageID}getActions(){return this._actions}isRoot(){return this._isRoot}resolveContextProps(e){const{value:t}=this.getStateProps();t&&(e.error=this.getContextDataValue(`${this.getPageReference()+t}.error`),e.validatemessage=this.getContextDataValue(`${this.getPageReference()+t}.validatemessage`))}isValidatorExist(){return!!this._isValidatorExist}getValidationApi(){return new kl(this)}isEditable(){return!(!this._rawConfig||!this._rawConfig.config||this._inheritedConfig&&this._inheritedConfig.readOnly||!(Object.hasOwn(this._rawConfig.config,"value")||this._rawConfig.config.selectionList||"Editable"===this._rawConfig.config.renderMode&&this._rawConfig.config.referenceList)||"string"==typeof this._rawConfig.config?.value&&this._rawConfig.config.value.includes("@FILTERED_LIST")||Object.hasOwn(this._rawConfig.config,"readOnly")&&("true"===this._rawConfig.config.readOnly||!0===this._rawConfig.config.readOnly)||Object.hasOwn(this._rawConfig.config,"disabled")&&!0===this._rawConfig.config.disabled)}isVisible(){return this._rawConfig?.config&&Object.hasOwn(this._rawConfig?.config,"visibility")&&"string"==typeof this._rawConfig?.config?.visibility?un.handleAnnotation(this._rawConfig?.config?.visibility,this):"string"!=typeof this.options?.visibility||un.handleAnnotation(this.options?.visibility,this)}isReadOnly(){return void 0!==this._readOnly&&("true"===this._readOnly||!0===this._readOnly||un.handleAnnotation(this._readOnly,this))}hasChildren(){return!!this._children}getComputedVisibility(e=[]){const t="reference"===this._type&&!!this.getReferencedView(),n=t?this.getReferencedViewPConnect().getPConnect():this;if(t){const t=`${this.getRawMetadata()?.config?.name}!${this._ruleClass}`;if(e.includes(t))return!1;e.push(t)}if(!1===this.getConfigProps().visibility)return!1;if(!1===n.getConfigProps().requiresVisibleChildren||!1===this.getConfigProps().requiresVisibleChildren)return!0;const r=n.getConfigProps(),s={includeTypes:["Group","Region","View"],excludeTemplates:["ListView","SimpleTable","StudioTable"]};let a=n._type&&s.includeTypes.includes(n._type)&&!s.excludeTemplates.includes(r.template);if(!!r.highlightedData&&r.highlightedData.length&&r.showHighlightedData&&(a=!1),!a)return!0;const o=n.getChildren();return!!o&&o.some((t=>t.getPConnect().getComputedVisibility(e)))}getChildrenIterator(){return this._children.setContext(this.getPageReference()),this._children}setAction(e,t){this._actions[e]=t}getComponentName(){return this._rawConfig&&this._rawConfig.type}isComponentRefreshable(){return!(!this._rawConfig||!this._rawConfig.isRefreshable)}getDataObject(e){return Sg(e||this.getContextName())}getImagePath(e){return`${Xi.getConstellationServiceUrl()}/v860/${Xi.getAppAlias()}/image/${e}?org=${Ph.getOrganizationName()}`}skipRequiredValidation(){return this.options.isBulkAction}isBulkAction(){return this.options.isBulkAction}getChildren(){if(this._children&&this._children.length){const e=this.options?.inheritedProps?.find((e=>"shouldAutoRefresh"===e?.prop));e&&(this._inheritedConfig._inheritedProps=[...this._inheritedConfig._inheritedProps||[],e]);const t=Td(this._rawConfig,{pageReference:this._pageReference,context:this._contextName,localeReference:this._localeRuleName,hasForm:this.options.hasForm,isBulkAction:this.options.isBulkAction,containerName:this.getContainerName(),containerItemName:this.options.containerItemName,viewName:this.viewName,inheritedConfig:this._inheritedConfig,target:this._containerTarget,readOnly:this._readOnly,categoryName:"Group"===this._type?this._rawConfig?.config?.id:null}),n=[];for(;t?.hasNext();){const e=t.next();this.isBulkAction()&&this.#o(e)||n.push(e)}return t?.resetIndex(),n}return[]}setInheritedProp(e,t){this._inheritedConfig[e]=t}getLocaleRuleName(){return this._localeRuleName}getLocalizedValue(e,t,n){const r=n||this.getLocaleRuleName(),s=r&&t?`${r}#${t}`:r,a=this.getLocalizationService(s).getLocalizedText(e);return a===e?this.getLocalizationService().getLocalizedText(e):a}getLocalizedValueForFieldLabel(e){e.startsWith(".")&&(e=e.substring(1));const t=this.getFieldMetadata(e)?.label,n=this.getLocaleRuleName(),r=this?.getMetadata();let s=null;if(r){const n=r?.type,a=["View","Region"];let o=r?.config?.label||r?.config?.caption?`@FL ${e}`:null;const i=Array.isArray(r?.config?.inheritedProps)?r.config.inheritedProps.find((e=>"label"===e.prop)):null;if(!o&&i&&(o=i.value),o?.startsWith(j.FIELD_LABEL_ANNOTATION)){const e=this.#i(o);return vh.getLocaleValue(t,void 0,e,s)}n&&!a.includes(n)&&(s=n)}return this.getLocalizationService(n).getLocalizedText(t)}getLocaleRuleNameFromKeys(e,t,n){return`${e}!${t}!${n}`}getValue(e,t){return e=e?.replace(/\((\d+)\)/g,((e,t)=>`[${parseInt(t,10)-1}]`)),this.useCustomContext?(e=e.startsWith?.(".")?e.substring(1):e,e.split?.(".").reduce(((e,t)=>e?.[t]??void 0),this.useCustomContext)):this._hasSuggestions&&this.getStateProps()?.value===e?Bg.getPropertyValue(e,this.getPageReference(),`${this._contextName}/${j.SUGGESTION}`):Bg.getPropertyValue(e,t||this.getPageReference(),this._contextName)}setInheritedConfig(e){if(!e)return;const{readOnly:t,displayMode:n,referenceType:r,hideLabel:s}=e;s&&(this._inheritedConfig.hideLabel=s),r&&(this._inheritedConfig.referenceType=r),n&&(this._inheritedConfig.displayMode=n),(this._inheritedConfig.readOnly||t)&&(this._inheritedConfig.readOnly=t),e.inheritedProps&&(e.inheritedProps?.forEach((e=>{"required"===e.prop&&(this._inheritedConfig[e.prop]=e.value)})),Rd(this._inheritedConfig,e))}getInheritedProps(){const e={},t={};return this._inheritedConfig.inheritedProps?.forEach((e=>{t[e.prop]=e.value})),Bg.resolveProps(t,e,this),e}setValue(e,t,n,r=!1,s={}){let a,o;const{isArrayDeepMerge:i}=s;this.isInsideList()&&this.getListActions().updateProperty(e,t),this.isBulkAction()&&(a=!0,t||(o=!0)),Cg({type:"SET_PROPERTY",payload:{reference:`${this.getPageReference()}${e}`,value:t,initialValue:n,isImplicit:r,context:this.getContextName(),...void 0!==i&&{isArrayDeepMerge:i},...a&&{isStrictTracking:a},...o&&{removePropertyFromChangedList:o}}})}updateDirtyCheckChangeList(e,t){const n={reference:`${this.getPageReference()}${e}`,value:t,context:this.getContextName()};op(n)}getContextDataValue(e,t){return Pg(t||this.getPageReference(),e,this._contextName)}updateState(e){const t=this._pageReference.indexOf(j.CASE_INFO.CASE_INFO_CONTENT),n=this._pageReference.indexOf(".");let r=j.CASE_INFO.CASE_INFO_CONTENT;0!==t&&(r=n>0?this._pageReference.substring(n):this._pageReference),Cg(Yg({context:this._contextName,data:e,rootPageReference:r}))}replaceState(e,t,n={}){const{skipDirtyValidation:r=!1}=n;Cg({type:"REPLACE_PROPERTY",payload:{reference:`${this.getPageReference()}${e}`,value:t,context:this.getContextName(),skipDirtyValidation:r}})}reportError(e,t,n){Cg(Sf(e,t||{},n,t?.formFields))}getComponent(){return Pd({getPConnect:()=>this})}createComponent(e,t,n,r){let s=this._pageReference;if(t){const e=Dg(`${this.getPageReference()}.${j.SUMMARY_OF_LISTS}`,t,this._contextName);s=Bg.getContextPath(e||t,n)||t}else if(r&&r.pageReference){let e=r.pageReference;e=un.handleAnnotation(e,this),s=Bg.getContextPath(this._pageReference,e)||""}return Pd(vd({meta:e,index:this.index,options:{containerName:this.getContainerName(),hasForm:this.options.hasForm,...e.options,pageReference:s,context:this._contextName,target:this._containerTarget,readOnly:this._readOnly||this._inheritedConfig?.readOnly,viewName:this.viewName},useCustomContext:this.useCustomContext}),r)}getReferencedView(){if(this.meta)return Bg.resolveReference(this.resolveConfigProps(this.meta),this)}_resolvePageRef(e){return this.getPageReference().includes(e)||e.startsWith(j.CLASS_ANNOTATION)?this.getPageReference():`${this.getPageReference()}${e}`}getReferencedViewPConnect(e=!1){const t={...this.getComponentConfig()},n=this.options?.inheritedConfig?._inheritedProps?.find((e=>"shouldAutoRefresh"===e.prop));return n&&!t?.inheritedProps?.some((e=>"shouldAutoRefresh"===e.prop))&&t?.inheritedProps?.push(n),delete t?.name,delete t?.type,vd({meta:this.getReferencedView(),options:{...e?this.options:void 0,...t,context:this.getContextName(),pageReference:t.context?this._resolvePageRef(t.context):this.getPageReference(),viewName:this.viewName}})}getContainerManager(){return new Xl(this)}getActionsApi(){return this._actionsApi||(this._actionsApi=new Qu(this)),this._actionsApi}getActionManager(){return rc}doesContextExist(e){return Fg(e??this.getContextName())}getGoogleMapsAPIKey(){return C()}getServerURL(){return E()}getLoadingStatus(e){let t=null;return e?(t=Sg(e),t=t?t.context_data:null):t=this.getDataObject().context_data,!!t&&(!!t.isLoading&&t.isLoading)}clearErrorMessages(e){e?.property?io({type:"error",property:e.property,pageReference:this.getPageReference(),context:this.getContextName()}):e?.context?io({type:"error",...e}):(io({type:"error",...e,context:j.APP.APP}),io({type:"error",...e,context:Dp(`${j.APP.APP}/${this.getContainerName()}`)}))}resolveDatasourceReference(e){return Dg(`${this.getPageReference()}.${j.SUMMARY_OF_LISTS}`,e,this.getContextName())||e}removeFormField(){}addFormField(){}setPageValue(e,t,n){delete e?.classID,this.setValue(t,e,void 0,void 0,{isArrayDeepMerge:!1}),((e,t,n)=>{const r=Il(t);ml[e]?ml[e].fieldOrder[r]=n:ml[e]={fieldOrder:{[r]:n}}})(this.getContextName(),`${this.getPageReference()}${t}`,this),n&&((e,t,n)=>{const r=(e,t)=>{Object.entries(e).forEach((([e,s])=>{if(Array.isArray(s)){const r=PCore.createPConnect({options:{pageReference:n.getPageReference(),context:n.getContextName(),referenceList:`${t}.${e}`}}).getPConnect();Ni(r,`${t}.${e}`,{skipStateUpdate:!0});for(let e=0;e<s.length;e+=1)yi(s[e],e,r,void 0,{})}else"object"==typeof s&&r(s,`${t}.${e}`)}))};r(e,t)})(e,t,this)}acceptSuggestion(e){if(this.getStateProps()?.value&&this.options.hasForm&&this._hasSuggestions){const t=sd.getSuggestionsContext(this.getContextName()),n=this.getStateProps()?.value||e,r=Bg.getContextPath(this.getPageReference(),n),s=t.getField(r);this._hasSuggestions=!1,this.getActionsApi().updateFieldValue(n,s),this.getActionsApi().triggerFieldChange(n,s),t.removeField(r,{actionPerformed:"accepted"})}}ignoreSuggestion(e){if(this.getStateProps()?.value&&this.options.hasForm&&this._hasSuggestions){const t=this.getStateProps()?.value||e,n=Bg.getContextPath(this.getPageReference(),t);this._hasSuggestions=!1,sd.getSuggestionsContext(this.getContextName()).removeField(n,{actionPerformed:"ignored"});const r=on.getDependencies(this._contextName,n);r?.forEach((e=>{sd.getSuggestionsContext(this.getContextName()).removeField(e,{actionPerformed:"ignored"})}))}}getSelfReferencingDatapageKeys(){const e=[],t=this.getPropertyName(),n=this.getFieldMetadata(t),{datasource:{parameters:r={}}={}}=n||{};return Object.values(r).forEach((n=>{const[,r]=n.split("."),s=t?.split(".").pop();r===s&&e.push(n.substring(n.lastIndexOf(".")+1))})),e}isReadOnlyField(e,t){const n=Yl.isPropertyInternal(t),r=e.datasource,s=this.getComponentConfig().isSearchField,{isClassKey:a,isSpecial:o,isDeclarativeTarget:i}=e.fieldMetadata,c=e.listType!==j.ASSOCIATED;return!s&&(i||n||!r&&(a||o)&&c)}getPropertyDetails(e,t,n){return e===j.ASSOCIATED?{propertyValue:t,propertyAnnotation:j.ASSOCIATED_PROPERTY_ANNOTATION}:{propertyValue:n,propertyAnnotation:j.PROPERTY_ANNOTATION}}updateConfigData(e,t,n){e.fieldMetadata=t,t.additionalInformation&&(e.additionalInformation=t?.additionalInformation),this.isReadOnlyField(e,n)&&(e.readOnly=!0,this._stateProps.readOnly=e.readOnly,e.fieldMetadata.isDeclarativeTarget&&this.registerAdditionalProps({readOnly:!0})),e.fieldMetadata?.isReadOnly&&(e.readOnly=!0,this.registerAdditionalProps({readOnly:!0}))}#o(e){const t=e.getPConnect().getComponentName(),n=e.getPConnect().getConfigProps().template;return!(!0===Nd.allowedComponetsForBulkProcessing[t]||!0===Nd.allowedComponetsForBulkProcessing[t]?.[n])}#i(e){const t=e.split(`${j.FIELD_LABEL_ANNOTATION} `).pop(),n=t?.split("."),r=n?.pop();let s=`${r}`;const a=this.getFieldMetadata(s),o=a?.classID||this.getValue(`.${n?.join(".")}${j.CLASS_ID}`),i=a?.definedOnClassID;return s=`${i||o}!FIELD!${s}`,s}}function vd(e){const t=new bd(e);return{getPConnect:()=>t}}function xd(e){Pd=e}const wd=e=>({type:Hu.REFRESH_DATA,payload:e}),Md={},Ld=(e,t,n,r,s,a,o,i)=>{if(!(e&&r&&t))return;const c=i.actionMgrID||rc.getNextActionMgrId(),l={ID:e,actionID:t,objectTypeID:n,context:r,caseWideAction:s,isObjectType:a,isExternalObject:o,options:{...i,actionMgrID:c}};i.isFillFormWithAI?Cg((e=>({type:It,payload:e}))(l)):Cg(wd(l))},Fd=(e,t,n,r,s)=>{if(!(e&&n&&t))return;r&&(r=jg.convertPageRefToClipboardPageNotation(r));Cg(wd({ID:e,viewID:t,context:n,options:s,caseViewAction:!0,interestPage:r}))},Ud=(e,t,n,r,s,a,o,i,c,l={})=>{if(!((e||t)&&r&&n&&s))return;s&&(s=jg.convertPageRefToClipboardPageNotation(s));const u={ID:o||c!==j.ACTION?e:t,actionID:n,context:r,options:l,interestPage:s,interestPageActionID:a,isLocalAction:o,isMultiRecordData:i,editType:c};Cg(wd(u))},jd=(e,t,n)=>{Md[t]||(Md[t]={}),e&&!Md[t][e]&&(Md[t][e]={pageReference:n})},Vd=(e,t,n)=>{const r={pageName:(s=t.substring(t.lastIndexOf(" ")+1)).substring(0,s.lastIndexOf(".")),propertyName:s.substring(s.lastIndexOf(".")+1)};var s;const a=qh(r.propertyName,n||e.getValue(j.CLASS_ID,r.pageName));return!!a?.isDeclarativeTarget},kd=(e,t)=>{const n=e.getRawMetadata()?.config?.value;let r=!1;if(n){const s=qh(un.getLeafPropertyName(n),t||Bg.resolveClassID(n,e.getPageReference(),e.getContextName()));if(r=!!s?.isDeclarativeTarget,!r&&s?.additionalInformation){const e=un.trimAnnotation(s?.additionalInformation);r=cd.isDecisionParagraph(e,s.classID)}!r&&s?.datasource?.parameters&&(r=((e,t,n)=>{let r=!1;if(Array.isArray(t)){const s=t=>{const s=t.value;return s.startsWith("@P")&&(r=Vd(e,s,n)),r};t.some(s)}else if("object"==typeof t)for(const s of Object.keys(t))if(t[s].startsWith("@P")&&(r=Vd(e,t[s],n),r))break;return r})(e,s?.datasource?.parameters,t)),r||(r=s?.datasource?.tableType===j.DECISION)}return r},$d=e=>{(e.isWhenExist()||kd(e))&&jd(e.getCurrentView(),e.getContextName(),e.getPageReference())},Bd=e=>{if(!e)return!1;const t=_g()?.getState()?.data?.[e],n=t?.caseInfo?.caseTypeID||t?.objectInfo?.objectTypeID;return Rl.isObjectCaseType(n)},Gd=(e,t,n)=>{const r=wl(e,t),s=Rl.isObjectCaseType(n?.classID)||t.startsWith(j.OBJECT_INFO.OBJECT_INFO);let a,o,i="",c=!1;const l=n=>Bg.getPropertyValue(n,t,e)||"";if(s&&Bd(e))i=l(U.OBJECT_INFO.OBJECT_INFO_CONTENT_CLASS_ID),c=Rl.isExternalObject(i),n.isObjectWideAction=!0,a=l(U.OBJECT_INFO.ACTIVE_ACTION_ID)||j.VIEW_NAMES.OBJECT_CREATE_VIEW,o=l(j.getProperty(U.CASE_INFO.CASE_INFO_ID))||i;else if(a=l(U.CASE_INFO.ACTIVE_ACTION_ID)||l(U.CASE_INFO.ASSIGNMENTACTION_ID),r)o=l(j.getProperty(U.CASE_INFO.CASE_INFO_ID));else{o=l(j.getProperty(U.CASE_INFO.ASSIGNMENT_ID))||l(j.getProperty(U.CONTEXT_DATA_ASSIGNMENTID))}Ld(o,a,i,e,r,s,c,n)},Wd=e=>{const{context:t,pageReference:n}=e,r=(e=>Md[e]&&Object.keys(Md[e]).length>0&&Ml(e))(t);if(!r)return;const s=Bg.getPropertyValue(j.CONTEXT_DATA_MODAL_VIEW.CONTEXT_DATA_MODAL_VIEW,n,t),{isMultiRecordData:a,editType:o}=s||{};if(a){const e=Bg.getPropertyValue(U.CASE_INFO.CASE_INFO_ID,n,t),r=Bg.getPropertyValue(U.CASE_INFO.ASSIGNMENT_ID,n,t),{interestPage:i,interestPageActionID:c,actionID:l,isLocalAction:u,viewName:d}=s;o===j.ACTION?Ud(e,r,l,t,i,c,u,a,o):Fd(e,d,t,i,{})}else Gd(t,n,{})},Hd=(e,t)=>{const{requestType:n}=e;if(e?.options?.refreshFor&&"refresh"===n){t+=`?refreshFor=${e.options.refreshFor.replace(/\[(\d+)\]/g,((e,t)=>`(${parseInt(t,10)+1})`))}`}return e?.options?.isFillFormWithAI&&"refresh"===n&&(t+="?fillFormWithAI=true"),t},qd=(e,t)=>{const n=e.url?.includes("/refresh?refreshFor="),r=t.url?.includes("/refresh?refreshFor="),s=e.url?.endsWith("/refresh")&&!n,a=t.url?.endsWith("/refresh")&&!r;if(s&&a)return e.url===t.url;if(s&&r)return!0;if(n){if(a)return"CANCEL_REFRESH";if(r)return!1}return!1},zd=e=>{const t=(e=>{const t=[];return eo.getDeclarativeTargets(e).forEach((({name:e,pageReference:n})=>{const r=n.split(".");r.shift();let s=r.join(".");e&&s&&(s=jg.convertPageRefToClipboardPageNotation(s),t.push({name:e,context:s}))})),t})(e),n=(e=>{const t=[];return eo.getWhens(e).forEach((({name:e,type:n,pageReference:r})=>{const s=r.split(".");s.shift();let a=s.join(".");e&&a&&(a=jg.convertPageRefToClipboardPageNotation(a),t.push({name:e,context:a,type:n}))})),t})(e);return{fieldsWithDeclarativeTargets:t,whens:n}};const Yd=class{static isPageInstruction(e){return e&&e.includes("[")&&e.includes("]")}},{APP:Kd}=j;let Jd={},Xd={},Qd={};const Zd="You will lose unsaved changes. Do you want to continue?",ep="You have reached maximum limit of pending changes. Please commit/cancel one or more changes to continue.",tp=(e=Kd.APP,t,n)=>{let r=[],s=[];t||(r=Ol(e,!0)),n||(s=(e=>{const t=eo.getContextReferences(e),n=[];if(t)for(const[e,r]of t)!0===Bg.resolveContextTreeNodeProps(r.props).readOnly&&n.push(e);return n})(e));const a={};((e,t,n)=>{const r=Xd[t]||{};Object.keys(r).forEach((t=>{const s=r[t].associatedProperty;Object.hasOwn(r,t)&&(void 0===s||n.includes(s))&&jg.buildObject(t,e,r[t].value)}))})(a,e,r);const o=Jd[e]||{};return Object.keys(o).forEach((e=>{const n=!t&&r.includes(e)||t;Object.hasOwn(o,e)&&n&&!s.includes(e)&&jg.buildObject(e,a,o[e].value)})),a},np=e=>{const{context:t}=e,n=e.reference.startsWith(".")?e.reference.substr(1):e.reference;delete Jd[t]?.[n],delete Xd[t]?.[n]},rp=e=>e&&Qd[e],sp=(e,t)=>{const{context:n,initialValue:r="",isStrictTracking:s,associatedProperty:a}=t,o=t.reference.startsWith(".")?t.reference.substr(1):t.reference;e[o]?e[o].previousValue=Og(t.reference,null,n):(e[o]={initialValue:r||Og(t.reference,null,n)},e[o].previousValue=e[o].initialValue),e[o].value=t.value,a&&(e[o].associatedProperty=a),s&&e[o].value===e[o].initialValue&&np(t)},ap=e=>{const{payload:t}=e,{context:n}=t,r=t.reference.startsWith(".")?t.reference.substr(1):t.reference;eo.isFieldExists(n,r)||(Xd[n]=Xd[n]||{},sp(Xd[n],t)),Jd[n]=Jd[n]||{},sp(Jd[n],t)},op=({value:e,context:t,reference:n})=>{const r=qp(t),s=yp(r,t)||{};if(Yd.isPageInstruction(n)||s?.subscriptFieldName)return;const a=n?.startsWith(".")?n?.substr(1):n;Jd[t]=Jd[t]||{};Jd[t][a]||(Jd[t][a]={initialValue:Og(a,null,t)}),Jd[t][a].value=e},ip=e=>e&&Jd[e]&&Object.keys(Jd[e]).some((t=>Jd[e][t].initialValue!==Jd[e][t].value))||!!rp(e),cp=(e,t)=>{if(!e||!t)return!1;const n=Jd[e]&&Jd[e][t];return!!n&&n.previousValue!==n.value},lp=e=>{e&&Jd[e]?(Jd[e]={},Xd[e]={}):"all"===e&&(Jd={},Xd={},Qd={}),Qd[e]&&(Qd[e]=!1)},up={propertyChangeMiddleware:()=>e=>t=>{const{type:n,payload:r={}}=t||{};if(n===ee&&(rn(r),(e=>{const{context:t,pageReference:n,value:r,reference:s}=e;Ig.triggerCascade(t,s,r);const a=on.getDependencies(t,s),o=Ig.getResetDependencies(t,s),i={context:t,datapages:{}};[...a,...o].forEach((e=>{const n=jg.getPropertyNameFromDependency(e);if("multiRecord"===e.mode){const e=n.split("."),r=`.${e.pop()}`,s=e.join(".");fl.getStateMachine(t,s,r).deleteAll()}else Yd.isPageInstruction(n)&&fl.executeStateMachine(t,n,""),Cg({type:Q,payload:{reference:n,value:"",context:t,isArrayDeepMerge:!0,isImplicit:!0}})})),a.forEach((r=>{let s=n;r.startsWith(n)||(s="");const a=r.replace(`${s}`,"").split(".").filter((e=>!!e));a.pop();const o=a.join("."),c=Og(`.${o}`,s,t)?.classID||e.classID,l=qh(r.split(".").pop(),c),{datasource:u}=l,d={},p=[];u.parameters.forEach((e=>{e?.value?(d[e.name]=Yl.isProperty(e.value)?Og(`.${jg.getFullPropertyReference([o,jg.getPropertyName(e.value)])}`,s,t):e.value,void 0===d[e.name]||null===d[e.name]||""===d[e.name]?(d[e.name]="",p.push(j.NULL_STRING)):p.push(d[e.name])):(d[e.name]="",p.push(j.NULL_STRING))}));const h=u.name.concat(j.UNDERSCORE_STRING,jg.getHashedString(p.join(j.HASH_DELIMITER))),{name:g}=u,f=ng(g);i.datapages[h]={mode:u.mode,propertyName:r,name:u.name,dataViewParameters:d,refreshStrategy:f?.refreshStrategy}})),a.length&&Cg({type:nt,payload:i})})(r),setTimeout((()=>{(cp(r.context,r.reference)||Ti(r.context))&&Wd(r),Bu.triggerRefreshForType("PROP_CHANGE",r.reference,r.context)}),0)),n===at&&!r?.isDefault){const{context:e,referenceList:t,c11nEnv:n,listIndex:s,instruction:a,skipDirtyValidation:o=!1}=r;0===s&&"INSERT"===a&&n&&(e=>{let t=!1;const n=e?.getRawMetadata()?.config;n?.type&&"multirecordlist"===n.type&&n?.contextClass&&(t=function e(t,n){for(const r of n){const n=vd({meta:r}).getPConnect();if(n.isWhenExist()||kd(n,t))return!0;if(r.children&&e(t,r.children))return!0}return!1}(n.contextClass,n.children??[])),t&&jd(e.getCurrentView(),e.getContextName(),e.getPageReference())})(n),Wd({context:e,pageReference:t}),o||(Qd[`${e}`]=!0)}if(n===Q||n===Z){const{reference:e,isImplicit:n,context:s,skipDirtyValidation:a=!1}=r;eo.updateFieldNodeValue(s,e,r.value),Yd.isPageInstruction(e)||a?a||(Qd[`${s}`]=!0):ap(t),(r.removePropertyFromChangedList||n)&&np(r)}if(n===De||n===Re){const{transientItemID:e,data:t}=r;jg.iterateLeafNodes(t,(t=>{np({context:e,value:"",reference:t.join(".")})}))}if(n&&[xe,Se,Me,Pe].includes(n)){lp(r.context),Ig.purgeResetDependencies(r.context),(e=>{e&&Md[e]&&delete Md[e]})(r.context);(r.childContainersContexts||[]).forEach((e=>{lp(e)}));(r.transientItems||[]).forEach((e=>{lp(e)}))}e(t)},getChanges:tp,recordChange:ap,isDirty:()=>Object.keys(Jd).some((e=>ip(e))),isPropertyDirty:cp,isContextDirty:ip,resetChangedProperties:lp,deleteRecordedChange:np,isComplexObjectMerged:rp};const dp=new class{getCoreheaders(e){const t=`${U.APP.APP}${j.FORWARD_SLASH_STRING}${j.PRIMARY}`,n=Dp(t),r=vp(n),s=Bg.getProperty(j.COREHEADERS,"",r);if(s&&e in s)return s[e]}},pp={defaultLimit:16},hp={SINGLE:"single",MULTIPLE:"multiple"},gp={PRIMARY:"primary",WORKAREA:"workarea",MODAL:"modal",PREVIEW:"preview"},fp=()=>_g()?.getState()?.containers;function mp(e){return"string"==typeof e&&""!==e.trim()}const Ip=e=>mp(e)?_g()?.getState().containers[e]:null,yp=(e,t)=>{if(!mp(e)||!mp(t))return null;const n=fp(),r=n?.[e];return r&&r.items&&r.items[t]||null},Ep=e=>mp(e)?_g()?.getState().containers[e]?.items:null,Ap=e=>mp(e)&&_g()?.getState().containers[e]?.accessedOrder||[],_p=e=>mp(e)&&Ap(e)?.length>0||!1,Cp=(e,t,n)=>{if(!mp(e)||!mp(t))return!1;const r=fp(),s=r?.[e],a=s&&s.items||null,o=n||((e,t)=>e===t);if(t&&a)for(const e of Object.keys(a))if(o(t,a[e].key))return!0;return!1},Sp=(e,t,n)=>{if(!mp(e)||!mp(t))return null;const r=fp(),s=r?.[e],a=s&&s.items||null,o=n||((e,t)=>e?.toLowerCase()===t?.toLowerCase());if(t&&a)for(const e of Object.keys(a))if(o(t,a[e].key))return e;return null},Tp=(e,t)=>{if(e&&t)for(const s of Object.keys(t))if(n=e,r=t[s].key,n?.toLowerCase()===r?.toLowerCase())return t[s];var n,r;return null},Np=e=>{if(!mp(e))return null;const t=fp()??{};for(const n of Object.keys(t))if(t[n]){const r=t[n].items??null,s=Tp(e,r);if(s)return s}return null},Op=(e,t)=>{if(!mp(e)||!mp(t))return!1;const n=fp();return n&&Object.hasOwn(n,`${e}/${t}`)},Pp=(e,t)=>{if(!mp(e)||!mp(t))return null;const n=fp(),r=n?.[`${e}/${t}`];return r&&r.type},Dp=e=>{if(!mp(e))return null;let t=null;const n=fp();if(n&&n[e]){const r=n[e],{accessedOrder:s}=r;t=s&&s.length>0?s[s.length-1]:null}return t},Rp=(e,t,n)=>{if(!mp(e)||!mp(t))return!1;const r=Sp(e,t,n);return!!r&&r===Dp(e)},bp=(e,t)=>{let n=null;const r=fp();if(!r)return null;for(const s of Object.keys(r))if(r[s].items){const a=r[s].items[e];if(n=a?a[t]:null,n)break}return n},vp=e=>mp(e)?bp(e,"context"):null,xp=e=>{if(!mp(e))return null;let t=null;const n=fp();if(n&&n[e]){const r=n[e],{accessedOrder:s}=r,a=s&&s.length>0?s[s.length-1]:null;t=vp(a)}return t},wp=e=>{if(!mp(e))return[];const t=e.endsWith("/")?e:`${e}/`;let n=[],r=!1;const s=fp();if(!s)return[];const a=n=>{const s=[];return Object.keys(n).forEach((n=>{n.startsWith(t)&&n!==t&&s.push(n),n===e&&(r=!0)})),s};for(const e of Object.keys(s))if(s[e].items){const t=a(s[e].items);t&&t.length>0&&(n=n.concat(t)),n=n.sort()}return r?n:[]},Mp=e=>{if(!mp(e))return[];const t=[],n=fp();if(!n)return[];for(const r of Object.keys(n))r.startsWith(e)&&r!==e&&t.push(r);return t},Lp=e=>{if(!mp(e))return[];const t=[],n=fp();if(!n)return[];for(const r of Object.keys(n))if(r.startsWith(e)&&r!==e){(Ap(r)||[]).forEach((n=>{vp(n)!==e&&t.push(vp(n))}))}return t},Fp=e=>{const t=[...Lp(e),e],n=[],r=_g()?.getState().data||{};return t.forEach((e=>{Object.hasOwn(r,`${e}/${j.SUGGESTION}`)&&n.push(`${e}/${j.SUGGESTION}`)})),n},Up=e=>mp(e)?e&&Ip(e)&&Ip(e).type===hp.SINGLE:null,jp=e=>mp(e)?e&&Ip(e)&&Ip(e).type===hp.MULTIPLE:null,Vp=e=>mp(e)&&Ip(e)&&Ip(e).items&&Object.keys(Ip(e)?.items).length>0||!1,kp=e=>e&&pp[e]?pp[e]:pp.defaultLimit,$p=(e,t=pp.defaultLimit)=>{mp(e)&&(pp[e]=t)},Bp=e=>{if(!mp(e))return!1;let t=!1;const n=Ip(e),{items:r={}}=n,s=Object.keys(r),a=kp(e);return s&&s.length>0&&s.length>=a&&(t=!0),t},Gp=e=>{if(!e||!mp(e.name)||!mp(e.context))return null;const t=e?.name,n=Ip(`${e?.context}/${t}`),r=Array.isArray(n?.accessedOrder)&&n?.accessedOrder.map((e=>n?.items[`${e}`]?.context))||[],s=Mp(`${j.APP.APP}/${j.PREVIEW}`),a=Lp(`${j.APP.APP}/${j.PREVIEW}`);return{context:e?.context,name:t,containerItems:[...r,...a],childContainers:s}},Wp=e=>{if(!mp(e))return!1;const t=vp(e);return ip(t)||nl(e)},Hp=e=>{if(!mp(e))return null;let t;const n=Ip(e),{accessedOrder:r=[]}=n;for(let e=0;e<r.length;e+=1){const n=r[e];if(!Wp(n)){t=n;break}}return t},qp=e=>{if(!mp(e))return null;const{containers:t}=_g()?.getState()||{};if(t)for(const n of Object.keys(t))if(t[n]?.accessedOrder?.includes(e))return n;const n=e.lastIndexOf(j.UNDERSCORE_STRING);return e.slice(0,n)},zp=(e,t={})=>{if(!mp(e))return Promise.reject(new Error("closeContainerItem: containerItemID is the required parameter"));const n=qp(e),r=vp(e),{skipDirtyCheck:s}=t;let a=!0,o=[];if(Wp(e)&&!s&&(a=window.confirm(vh.getLocaleValue(Zd,"Messages"))),a){const{accessedOrder:t=[],items:s={},type:a}=Ip(n);o=t.filter((t=>t!==e));const i=o[o.length-1],c=s[i]||{},{semanticURL:l=j.FORWARD_SLASH_STRING,context:u}=c;o.length>0&&l&&l!==j.FORWARD_SLASH_STRING?Yf({directUrlUpdation:!0,semanticURL:l,options:{containerItemID:i,context:u}}):Yf({directUrlUpdation:!0,semanticURL:j.FORWARD_SLASH_STRING,options:{}});Cg(ff({containerItemID:e,context:r,target:n,containerInfo:{newAccessedOrder:o,containerType:a}}))}return Promise.resolve({newAccessedOrder:o,removeItem:a})},Yp=(e,t,n,r)=>{const s="root",a=H(t,s,!0),o=Pt(t,s),i={data:n,context:r?"app":a},c=[nf({root:e,containerItemID:a,context:r?"app":a,target:o,containerName:t})];c.push(Yg(i)),Cg(c)},Kp=(e,t,n)=>{let r=Ap(e);r=r.filter((e=>e!==t));let s=!1;for(let e=0;e<r.length;e+=1){if(vp(r[e])===n){s=!0;break}}return s},Jp=e=>{if(!mp(e))return!1;const t=fp(),n=vp(e),r=t?Object.keys(t):[];let s=!1;for(let t=0;t<r.length&&(s=Kp(r[t],e,n),!s);t+=1);return s},Xp=e=>{Array.isArray(e)||(e=[e]);const t=fp()||{};return e.map((e=>{const n=qp(e);return jg.getIn(t,[n,"items",e,"transientItems"])||[]})).flat()},Qp=e=>{const{transientItemID:t,data:n,options:r}=e,s=jg.deepClone(_g()?.getState().data[t]);r?.reset&&jg.iterateLeafNodes(s,(e=>{"classID"!==e[e.length-1]&&jg.setIn(s,e,"")})),Cg(sf({transientItemID:t,data:jg.mergeDeep(n,s)}))},Zp=e=>{const{transientItemID:t,data:n}=e;Cg(of({transientItemID:t,data:n}))},eh=e=>{const t=jg.deepClone(_g()?.getState().data[e]);jg.iterateLeafNodes(t,(e=>{"classID"!==e[e.length-1]&&jg.setIn(t,e,"")})),Cg(af({transientItemID:e,data:t}))},th=e=>{const t=jg.deepClone(_g()?.getState().data[e]);jg.iterateLeafNodes(t,(e=>jg.setIn(t,e,""))),Cg(cf({transientItemID:e,data:t}))};class nh{static addContainerItems(e){this.items=e}static getContainerItems(){return this.items}static deleteContainerItem(e){const t=this?.items?.indexOf(e);void 0!==t&&-1!==t&&this.items.splice(t,1)}}const rh=()=>nh,sh=e=>{const t={containerName:e};t.childContainers=Mp(e),Cg({type:Fe,payload:t})},ah=(e,t)=>{const n=wp(e),{key:r}=yp(qp(e),e),s=[];n.forEach((e=>{const{key:n}=yp(qp(e),e);if(n===r){const n={data:{caseInfo:{headers:{etag:t}}},target:qp(e),context:e};s.push({type:fe,payload:n})}})),s.length&&Cg(s)},oh=(e,t)=>{const n=[],r={data:{caseInfo:{headers:{etag:t}}},target:qp(e),context:e};n.push({type:fe,payload:r}),n.length&&Cg(n)},ih=()=>Dh.isPortalLoaded?"app":"root",ch=()=>dp,lh=(e,t)=>{const n={data:{caseInfo:{lastUpdateTime:t}},target:qp(e),context:e};Cg({type:fe,payload:n})},uh=(e,t)=>{const n=Sp(e,t),r=Sp(`${n}/workarea`,t);return vp(r)},dh=e=>mp(e)?bp(e,"parentContext"):null,ph=e=>{const{accessedOrder:t}=e;return t&&t.length>0?t[t.length-1]:""},hh=e=>{if(e&&"string"==typeof e){const t=e.split("/");return t.pop(),t.join("/")}return null},gh=()=>Jl,fh=/{(.*?)}/i,mh=/{(.*?)}/g,Ih=e=>null!==e.match(fh),yh=e=>(e&&(e.startsWith("/")&&(e=e.substring(1,e.length)),e.endsWith("/")&&(e=e.substring(0,e.length-1))),e),Eh=e=>{const t=e[e.length-1],n=e[e.length-2];if("y"!==t.toLowerCase())return`${e}s`;switch(n.toLowerCase()){case"a":case"e":case"i":case"o":case"u":return`${e}s`;default:return`${e=e.substring(0,e.length-1)}ies`}},Ah=()=>yh(window.location.pathname),_h=()=>yh(window.location.pathname+window.location.search),Ch=(e,t,n)=>{switch(n){case"warning":t?console.warn(e,t):console.warn(e);break;case"error":t?console.error(e,t):console.error(e);break;default:t?console.log(e,t):console.error(e)}},Sh=e=>{if(e.indexOf("?")>0){const[t,n]=e.split("?"),r=new URLSearchParams(n),s=new Map;for(const[e,t]of r)"portal"!==e&&"noPortal"!==e&&"debug"!==e&&"activeTab"!==e&&s.set(e,t);const a=new URLSearchParams(s).toString();return a?`${t}?${a}`:t}return e},Th=(e,t)=>e.includes("/assignments")?((e,t)=>{const n=e.split("/"),r=n.indexOf("assignments"),s=n.slice(r-2).join("/"),a=n[n.length-1],o=kf(Ge,{assignmentID:a});return{routeEndpoint:o?.restApi,requestType:o?.reqType,payload:{assignmentID:a},options:t,routeKey:Qe,urlPath:s}})(e,t):Ph.getEndPointInfo(e),Nh=()=>{const e=Dh.environmentInfoObject?.pyExecutionRuntimeName;return"Infinity"===e};const Oh=new class{staticRoutesList=[];constructor(){this.staticRoutesList=[],this.dynamicRoutesList=[],this.reqContextName="",this.defaultViewUrlPath="",this.staticRoutePage="",this.defaultClassName="",this.portalName=""}init=(e,t)=>{e&&e.routes&&e.routesMeta?(this.routingInfo=e,this.appRoutes=e.routes,this.appRoutesMeta=e.routesMeta,this.reqContextName=e.reqContextName,this.reqServletPath=e.reqServletPath,this.appName=e.appName,this.appAlias=e.appAlias,this.orgName=e.orgName,this.defaultViewUrlPath=t,this.defaultClassName="",this._createStaticDynamicRoutesList(this.appRoutes),this.appDelimeter=e.appDelimeter,this.reqServletNameReal=e.pxReqServletNameReal,this.bDefaultPortal=e.isDefaultPortal,this.portalName=e.portalName,this.ignoreFromEndPoint=["reactMode=dev","reactMode=prod"]):console.error("Routing info is not appropriate. Missing routes and routesMeta objects in routingInfo",JSON.stringify(e))};addRoutes=e=>{e?.routes&&e.routesMeta&&(this.appRoutes={...this.appRoutes,...e.routes},this.appRoutesMeta={...this.appRoutesMeta,...e.routesMeta},this.routingInfo&&(this.routingInfo.routes={...this.routingInfo.routes,...e.routes},this.routingInfo.routesMeta={...this.routingInfo.routesMeta,...e.routesMeta}),this._createStaticDynamicRoutesList(e.routes))};setDefaultRoute=e=>{this.defaultViewUrlPath=e};setStaticRoutePage=e=>{this.staticRoutePage=e};getStaticRoutePage=()=>this.staticRoutePage||"";setDefaultClassName=e=>{this.defaultClassName=e};_createStaticDynamicRoutesList=e=>{Object.keys(e).forEach((t=>{Ih(t)?this.dynamicRoutesList?.push(t):this.staticRoutesList?.push({[t]:e[t]})}))};_getDynamicKeyName=e=>{const t=e.indexOf("{")+1,n=e.lastIndexOf("}");return e.slice(t,n)};isDefaultPortal=()=>"false"!=`${this.bDefaultPortal}`;getPortalName=()=>this.portalName;getApplicationPath=()=>yh(`${this.getReqContextName()}/${this.getReqServletNameReal()}`);getReqServletNameReal=()=>`${this.reqServletNameReal}`;getAppDelimeter=()=>`${this.appDelimeter}`;getApplicationName=()=>`${this.appName}`;getApplicationAlias=()=>`${this.appAlias}`;getServletPath=()=>`${this.reqServletPath}`;getOrganizationName=()=>`${this.orgName}`;getReqContextName=()=>yh(this.reqContextName);getRoutingInfo=()=>this.routingInfo;processUrl=(e,t)=>{t&&(e=e.toLowerCase()),e&&(e=decodeURIComponent(e));const n=new RegExp(this.getApplicationPath(),"i");return(e=e.replace(n,"")).startsWith("/")&&Nh()&&"PREVIEW"!==Dh.getRenderingMode()&&this.setDefaultClassName(""),yh(e)};stripIgnoredParams(e){return this.ignoreFromEndPoint?.forEach((t=>{e.includes(t)&&(e=e.substring(0,e.indexOf(t)))})),e}getRouteDetails(e,t){if(!t)return this.appRoutes[e];let n="",r={caseClassName:"",caseID:"",RemoteSystemID:void 0,page:""};return Object.values(this.appRoutes).forEach((t=>{t.payload?.page===e?(n=t.routeKey,r={...t.payload}):this.appRoutes[e]&&(n=this.appRoutes[e].routeKey,r={...this.appRoutes[e].payload})})),{routeKey:n,payload:r}}transformRemoteCasePayload(e){const{caseClassName:t,caseID:n}=e;if(!$.isRemoteCase(t))return e;const{RemoteClassGroup:r,RemoteSystemID:s}=$.getRemoteCase(t);return{...e,caseID:n?.replace(t,r?.toUpperCase()),RemoteSystemID:s}}getEndPointInfo=e=>{e=this.stripIgnoredParams(e);const t=Nh();let n=this.processUrl(e,!0),r=this._getMatchedRouteInRoutingTable(n,t?this.defaultClassName:void 0);r||(n=this.processUrl(this.defaultViewUrlPath,!t),r=this._getMatchedRouteInRoutingTable(n,t?this.defaultClassName:void 0)||"");const{routeKey:s,payload:a}=this.getRouteDetails(r,t);if(!this.appRoutesMeta?.[s]?.restApi)return null;const{reqType:o,endPoint:i,params:c}=this.appRoutesMeta[s].restApi,l={routeKey:s,requestType:o,routeEndpoint:i,payload:{...c,...this.transformRemoteCasePayload(a)}};return this._resolveRoute(l,this.processUrl(e,!1),r)};getSemanticURL(e,t,n){return this.buildSemanticURL(e,t,n)}getResolvedSemanticURL(e,t,n={}){const r=this.getSemanticURL(e,t,n);let s=r;if(Ih(r)){const e=r.match(mh);e?.forEach((e=>{const t=this._getDynamicKeyName(e);n[t]&&(s=s.replace(e,n[t]))}))}const a=zf(s),o=new URL(a);return this.isDefaultPortal()||this.getPortalName()&&!o.searchParams.toString().includes("portal=")&&o.searchParams.append("portal",this.getPortalName()),o.toString()}updateSemanticURLAndDocumentTitle(e){const{key:t,actionName:n,caseClassName:r,isRemoteCase:s}=e;if(s&&!r)return;const a=this.getSemanticURL(n,{caseClassName:r}).replace(/{.+?}/,String(Pc(t))),o=`${U.APP.APP}${j.FORWARD_SLASH_STRING}${U.PRIMARY}`,i={semanticURL:a,directUrlUpdation:!0,options:{acName:o,context:xp(o)}};qf(i);const c=r.substring(r.lastIndexOf("-")+1),l=t.substring(t.lastIndexOf(" ")+1),u=Dh.environmentInfoObject?.pxApplication?.pyLabel;tm(`${c} (${l}) - ${u}`)}buildSemanticURL(e,t,n){const{urlPattern:r}=this.appRoutesMeta?.[e]||{},s=r?.split("/").length,a=r?.split("/");this.setDefaultClassName(t?.pageClass||this.defaultClassName);const o=Object.keys(this.appRoutes).filter((e=>s===e.split("/").length)).filter((e=>{const t=e.split("?")[0].split("/");return a?.every(((e,n)=>e.startsWith("{")||e===t[n]))}));if(1===o.length)return this._getQueryParamsResolvedURL(o[0],n);if(0===Object.keys(t).length)return"";const i=o.find((e=>{const r=this.appRoutes[e].payload,s={...n};delete s.dataViewName,delete s.dataContext;const a=r.dataViewKeys||r.dataContextParameters||{},o=Object.keys(t).every((e=>t[e]===r[e]));return!!o&&(jg.isEmpty(a)||jg.isEmpty(s)?o:Object.keys(s).every((e=>Object.hasOwn(a,e))))}));return i?this._getQueryParamsResolvedURL(i,n):o.includes("cases/{id}")&&n?.id?"cases/{id}":""}_getQueryParamsResolvedURL(e,t,n=!1){const[r,s]=e.includes("?")?e.split("?"):[e];if(s){const e={};for(const[n,r]of Object.entries(t))e[n.toLowerCase()]=r;const a=new URLSearchParams(s),o={};for(const[r,s]of a.entries())if("string"==typeof s&&Ih(s)){const a=this._getDynamicKeyName(s);o[r]=n?t[a]||e[a.toLowerCase()]:t[a]}else"string"==typeof s&&(o[r]=s);return`${r}?${new URLSearchParams(o).toString()}`}return r}_getQueryParamsObject(e){const t={},n=new URLSearchParams(e);for(const[e,r]of n.entries())t[e]=r;return t}getRestEndPoint(e,t){try{return this._buildRestApi(e,t)}catch(e){return console.error(e),null}}_buildRestApi(e,t){if(e&&this.appRoutesMeta?.[e]){const{reqType:n,body:r}=this.appRoutesMeta[e].restApi;let{endPoint:s}=this.appRoutesMeta[e].restApi;t?.params&&t.params.pageName&&(s=`${s}&pageName=${t.params.pageName}`);const a=s.match(mh);if(a)for(let e=0;e<a.length;e+=1){const n=a[e].replace("{","").replace("}",""),r=new RegExp(a[e],"g");s=s.replace(r,t?.[n])}if(r){let e={};return Object.keys(r).forEach((n=>{this._isSpecialInstruction(n)&&(e={...e,...this._processInstruction(n,r[n],t)})})),{restApi:s,reqType:n,body:e}}return{restApi:s,reqType:n}}throw new Error(`Cannot find route metadata for the routeKey: ${e}.`)}_isSpecialInstruction(e){return e&&e.startsWith("@")}_processInstruction(e,t,n){const r={};return"@COPY"===e&&t.forEach((e=>{r[e]=n[e]})),r}doesRestApiExist(e){return!(!this.appRoutesMeta||!this.appRoutesMeta[e])}_resolveRoute=(e,t,n)=>{const r=[],[s,a]=t.includes("?")?t.split("?"):[t],[o,i]=n.includes("?")?n.split("?"):[n],c=s.split("/"),l=o.split("/"),u={};for(let e=0;e<l.length;e+=1)if(r[e]=l[e],Ih(l[e])){u[this._getDynamicKeyName(l[e])]=c[e],r[e]=c[e]}const d=this._getQueryParamsObject(i),p=this._getQueryParamsObject(a),h={};for(const[e,t]of Object.entries(p))h[e.toLowerCase()]=t;for(const e of Object.keys(d))Ih(d[e])?u[e]=p[e]||h[e.toLowerCase()]:u[e]=d[e];let g;a&&(g=this._getQueryParamsResolvedURL(n,p,!0));const f=this._resolvePayload(e,u,n);return{...this._resolveRouteEndPoint(f,n),urlPath:g||r.join("/")}};_resolveRouteEndPoint=(e,t)=>{let{routeEndpoint:n}=e;if(!Ih(n))return e;const r={};if(r[t]=e,void 0!==e.payload){const t=n.match(mh);for(let s=0;s<t.length;s+=1){const a=t[s],o=this._getDynamicKeyName(a);if(void 0!==e.payload[o]){const t=e.payload[o];n=n.replace(a,t)}else this._sendWarningAndErrorMessages(`Unable to resolve dynamic token {${o}} in routeEndpoint- ${o} is missing in payload`,r)}}else this._sendWarningAndErrorMessages("Unable to resolve dynamic token(s) in routeEndpoint- payload is missing in routing table for-",r);return{...e,routeEndpoint:n}};_resolvePayload=(e,t,n)=>{if(void 0===e.payload)return e;const r={...e.payload,...this._resolvePayloadRecursive(e.payload,t)};return{...e,payload:r}};_resolvePayloadRecursive(e,t){const n={};for(const r of Object.keys(e)){let s=e[r];if("string"==typeof s&&Ih(s)){const e=s.match(mh);for(let n=0;n<e.length;n+=1){const r=e[n],a=this._getDynamicKeyName(r);if(void 0!==t[a]){const e=t[a];s=s.replace(r,e)}else this._sendWarningAndErrorMessages(`Unable to resolve dynamic token {${a}} in payload- {${a}} is missing in semantic url construct`)}n[r]=s}else"object"==typeof s&&(n[r]=this._resolvePayloadRecursive(s,t))}return n}_getMatchedRouteInRoutingTable=(e,t)=>{const[n]=e.includes("?")?e.split("?"):[e];let r=this._findMatchedRouteInStaticList(n,t);return void 0!==r?r:(r=this._findMatchedRouteInDynamicList(e),void 0!==r?r:void 0)};_findMatchedRouteInStaticList=(e,t)=>{if(!this.staticRoutesList||!e)return;const n=e.toLowerCase(),r=t?.toLowerCase();if(Nh()){const e=this._findMatchingRouteByClass(n,r);if(!e)return;const t=Object.values(e)[0],s=t?.payload?.page||"";return this.setStaticRoutePage(s),Object.keys(e)[0]}return this._findInStaticList(n)};_findMatchingRouteByClass=(e,t)=>{if(this.staticRoutesList)return this.staticRoutesList.find((n=>Object.entries(n).some((([n,r])=>{if(!r)return!1;const s=r.payload?.page?.toLowerCase(),a=r.payload?.pageClass?.toLowerCase(),o=s===e||n.toLowerCase()===e;return t?o&&a===t:o}))))};_findInStaticList=e=>{if(!this.staticRoutesList)return;const t=this.staticRoutesList.find((t=>Object.keys(t)[0].toLowerCase()===e));return t?Object.keys(t)[0]:void 0};_findMatchedRouteInDynamicList=e=>{const[t,n]=e.includes("?")?e.split("?"):[e],r=t.split("/");return this.dynamicRoutesList?.find((e=>{const[t,s]=e.includes("?")?e.split("?"):[e],a=t.split("/");if(a.length!==r.length)return!1;let o=0;for(o=0;o<a.length;o+=1){const e=a[o].toLowerCase();if(!Ih(e)&&e!==r[o]&&Eh(e)!==r[o])return!1}if(s){const e=new URLSearchParams(n.toLowerCase()),t=new URLSearchParams(s.toLowerCase()),r=new Set,a=new Set,o=/\{[a-zA-Z]+\}/;for(const t of e.keys())r.add(t);for(const e of t.keys())a.add(e);if(a.size!==r.size)return!1;for(const n of r){if(!a.has(n))return!1;const r=t.get(n);if(e.get(n)!==r&&!o.test(r))return!1}}return!0}))};_sendWarningAndErrorMessages=(e,t)=>{Ch(e,t,"warning"),Ch("Error in Generated Routing Table",null,"error"),Ch("Back | Forward for this page may NOT work as intended",null,"warning"),Ch("Bookmark | Refresh for this page may NOT work as intended",null,"warning")}},Ph=Oh;const Dh=new class{constructor(){this.environmentInfoObject=null,this.isPortalLoaded=!1,this.pageName=null,this.KeyMapping={},this.isAssignmentHeaderHidden=!1,this.coexistenceMeta={appType:"",isCoexistence:!1},this.brandingInfo=null,this.cookieComplianceMethod="none",this.isExtraCallRequiredForDefaultHome="false"}setEnvironmentInfo(e){this.environmentInfoObject=e;const t=this.environmentInfoObject?.features||jg.convertObjectWithStringToBoolean(this.environmentInfoObject?.pyFeatures)||{granularUIRefresh:!1};this.environmentInfoObject.features={...t,granularUIRefresh:t.granularUIRefresh||t.pyEnableGranularUIRefresh||!1}}getOperatorName(){return this.environmentInfoObject?.pxOperator?.pyUserName}getOperatorWorkGroup(){return this.environmentInfoObject?.pxOperator?.pyWorkGroup}getOperatorIdentifier(){return this.environmentInfoObject?.pxOperator?.pyUserIdentifier}getOperatorImageInsKey(){return this.environmentInfoObject?.pxOperator?.pyImageInsKey}getApplicationLabel(){return this.environmentInfoObject?.pxApplication?.pyLabel}getPortalName(){return Ph.getPortalName()}getApplicationName(){return this.environmentInfoObject?.pxApplication?.pyRuleName}getUseLocale(){return this.environmentInfoObject?.pxLocale?.pyUseLocale}getAccessGroup(){return this.environmentInfoObject?.pxOperator?.pyAccessGroup}getTimeZone(){return this.environmentInfoObject?.pxLocale?.pyTimeZone}getTheme(){return this.themeOverrides}setTheme(e){return this.themeOverrides=e,this.themeOverrides}setIsWebEmbed(e){return this.isWebEmbed=e,this.isWebEmbed}isWSSPortal(){return this.environmentInfoObject?.pyPortalTemplate===j.PORTAL_TYPE.WSS}getBrandingInfo(){return this.brandingInfo}setBrandingInfo(e){return this.brandingInfo=e,this.brandingInfo}getCookieComplianceMethod(){return this.cookieComplianceMethod}setCookieComplianceMethod(e){this.cookieComplianceMethod=e}setLocale(e){const t=e.replaceAll("-","_").split("_").slice(0,2);this.locale=t.join("-"),this.environmentInfoObject?.pxLocale&&(this.environmentInfoObject.pxLocale.pyUseLocale=this.locale)}getLocale=()=>this.locale;getEnvironmentKeys(){return Object.keys(j.ENV_INFO_KEYS)}getMaxAttachmentSize(){return this.environmentInfoObject?.pxApplication?.pyMaxAttachmentSize}getDefaultOperatorDP(){return this.environmentInfoObject?.pxApplication?.pyDefaultOperatorDP}getDocumentUrlDP(){return this.environmentInfoObject?.pxApplication?.pyDocumentUrlDP}getCaseInstanceListDP(){return this.environmentInfoObject?.pxApplication?.pyCaseInstanceListDP}getBaseLocale(){return this.environmentInfoObject?.pxApplication?.pyBaseLocale||"en-US"}getRenderingMode(){return this.environmentInfoObject?.renderingMode}shouldUseURLParams(){return"FULL_PORTAL"===this.environmentInfoObject?.renderingMode&&this.getFeatureMap()?.pyUseURLParams}getBuiltOnAppNames(){return this.environmentInfoObject?.pxApplication?.pyBuiltOnApplications}setPreviewMode(){Eo.setPreviewMode()}setDefaultCasePage(e){this.pageName=e}getDefaultCasePage(){return this.pageName}disableAssignmentHeader(e){this.isAssignmentHeaderHidden=e}isAssignmentHeaderDisabled(){return this.isAssignmentHeaderHidden}getDefaultPortal(){return this.environmentInfoObject?.pxOperator?.pyDefaultPortal}updateFeatureMap(e){const t=this.environmentInfoObject?.features;return this.environmentInfoObject&&e&&(this.environmentInfoObject?.features?this.environmentInfoObject.features={...t,...e}:this.environmentInfoObject.features={...e}),this.getFeatureMap()}getFeatureMap(){return this.environmentInfoObject?.features||{}}setKeyMapping(e){return this.KeyMapping=e,this.KeyMapping}getKeyMapping(e){const t=this.KeyMapping[e];return void 0!==t?t:null}setCoexistenceMeta(e){return e&&(this.coexistenceMeta=e),this.getCoexistenceMeta()}getCoexistenceMeta(){return this.coexistenceMeta}isCoexistenceAppOfType(e){return!(!this.coexistenceMeta.isCoexistence||this.coexistenceMeta.appType!==e)}getCaseTypeList(){return this.environmentInfoObject&&this.environmentInfoObject?.pyCaseTypeList||[]}getUserSettings(){return this.environmentInfoObject?.pyUserSettings||null}getLocalizationVersion(){const e=this.getFeatureMap().pyLocalizationVersion,t=this.getFeatureMap().localizationVersion;return void 0!==t?t:void 0!==e?parseInt(e,10):1}getLocalizationBundles(e=this.locale){const t=this.environmentInfoObject?.pyLanguagePacks||[];return(t.find((t=>t.pyLangCode===e))?.pyBundles??t.find((e=>e.pyLangCode===j.DEFAULT.toUpperCase()))?.pyBundles??[]).sort(((e,t)=>e.pyOrder-t.pyOrder))}getAvailableLocalePacks(){return this.getFeatureMap()?.availableLanguagePacks||void 0}getIsExtraCallRequiredForDefaultHome(){return this.isExtraCallRequiredForDefaultHome}setIsExtraCallRequiredForDefaultHome(e){this.isExtraCallRequiredForDefaultHome=e}getInactivityTimeout(){const e=this.environmentInfoObject?.pxOperator?.pyAuthenticationTimeout;return e?Number(e):e}isUnifiedObject(){return this.environmentInfoObject?.features?.isUnifiedObject||!1}getRuntime(){return"undefined"!=typeof window&&window.document?"Browser":"Native"}};const Rh=class{static regex=/\{@P[^}]*\s*:\s*[^}]*\}/g;static subRegex=/:'[a-zA-Z0-9!@#$&()\\-`.+,/\s"]*'/;static keyMap={};static formatLocaleKey(e){let t=0,n="";for(;t<=e.length;){const r=e.indexOf("{@P ",t);if(-1===r){n+=e.substring(t,e.length);break}n+=e.substring(t,r);const s=e.indexOf("}",t),a=e.substring(r,s+1),[o,i]=this.getKeyAndValue(a);this.addKeyToMap(o,i),n+=`${a.split(":")[0]}}`,t=s+1}return n}static getKeyAndValue(e){const t=e.indexOf(":"),n=e.indexOf("}");return[`${e.substring(0,t)}}`,e.substring(t+1,n)]}static addKeyToMap(e,t){this.keyMap[e]=t}static replaceWithValue(e){let t=0,n="";for(;t<=e.length;){const r=e.indexOf("{@P ",t);if(-1===r){n+=e.substring(t,e.length);break}n+=e.substring(t,r);const s=e.indexOf("}",t),a=e.substring(r,s+1);n+=this.keyMap[a],t=s+1}return n}};class bh{GENERIC_BUNDLE_KEY="@BASECLASS!GENERIC!PYGENERICFIELDS";FIELD_LABELS_BUNDLE_KEY="@BASECLASS!LABEL!PYFIELDLABELS";GENERIC_BUNDLE_KEY_LP="GENERIC!GENERICFIELDS";MESSAGE_BUNDLE_KEY="@BASECLASS!MESSAGE!PYMESSAGES";BASE_CLASS="@BASECLASS";DATA_PAGE_LOCALECONTEXT="datapage";constructor(){this.localeStore={},this.getLocaleValue=this.getLocaleValue.bind(this)}setLocaleForRule=(e,t)=>{const n=e.LocaleContent,r=t.toUpperCase();r.startsWith("@BASECLASS!DATAPAGE!")&&r.split(/[!#]/).length<4?Object.entries(n).forEach((([e,t])=>{null!==t&&"object"==typeof t&&"fields"in t&&this.updateLocaleStore(t,`${r}#${e}`.toUpperCase())})):"GENERIC!GENERICFIELDS"===r?Object.entries(n).forEach((([e,t])=>{null!==t&&"object"==typeof t&&this.sanitizeLocaleField(t,e.toUpperCase())})):this.sanitizeLocaleField(n,r)};updateLocaleStore=(e,t)=>{const n=e.fields||e,r=this.localeStore[t];r?jg.mergeDeep(n,r):n&&"object"==typeof n&&(this.localeStore[t]=n)};sanitizeLocaleField=(e,t)=>{["DASHBOARDSMANAGER","DATAEXPLORER","INSIGHT"].includes(t.toUpperCase())&&Object.entries(e).forEach((([,e])=>{null!==e&&"object"==typeof e&&"fields"in e&&this.updateLocaleStore(e,t)})),this.updateLocaleStore(e,t)};getLocaleForRule(e){return this.localeStore[e]}resetLocaleStore=()=>{this.localeStore={}};getLocaleValue(e,t,n,r){const s=this.#c(n,t),a=this.#l(e);a&&(e=Rh.formatLocaleKey(e));const o=s?this.localeStore[s.toUpperCase()]??{}:{},i=r?this.localeStore[r.toUpperCase()]??{}:{};return"MESSAGES"===n?.toUpperCase()&&"string"==typeof e?this.getLocalizedErrorMessage(o,e)||e:a?Rh.replaceWithValue(o[e]||i[e]||e):o[e]||i[e]||e}#c(e,t){return e?.toUpperCase().startsWith("@BASECLASS!DATAPAGE!")?t?`${e}#${t}`:e:e||t}getParagraphLocaleValue(e,t){const n=`${e}!${j.PARAGRAPH}!${t}`,r=this.localeStore[n.toUpperCase()];return r?decodeURIComponent(atob(r.content).split("").map((e=>`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`)).join("")):null}getPortalLocaleReference(e){return 2!==Dh.getLocalizationVersion()?"":e?`PORTAL!${e}`.toUpperCase():`PORTAL!${Dh.getPortalName()}`.toUpperCase()}getCaseLocaleReference(e){return e?`CASE!${e}`.toUpperCase():null}getLocalizationVersion(){return 2}async getLocaleJsons(e){if(!await this.isCurrentLocalePackAvailable())return[];const t=Dh.getUseLocale(),n=[],r=PCore.getLocaleUtils().localeStore;if((e=(e=e.filter((e=>!r[e]))).map((e=>e.toUpperCase()))).length>0){const r=e.map((e=>({localeRuleKey:e,promise:Xi.getSvcLocale(t,`${e}.json`)}))),s=await Promise.allSettled(r.map((e=>e.promise)));await Promise.all(s.map((async(e,t)=>{if("fulfilled"===e.status){const s=r[t];let a;try{a=await e.value.json()}catch{a=null}a&&n.push({localeRuleKey:s.localeRuleKey,jsonData:a})}})))}return n}async loadLocaleResources(e){if(Dh.getLocalizationVersion()===j.LOCALIZATION_V2)return;const t=Dh.getUseLocale(),n=Dh.getBaseLocale();if(Dh&&t&&(t!==n||"en-US"!==n)&&e?.length>0)try{(await this.getLocaleJsons(e)).forEach((e=>{this.setLocaleForRule(e.jsonData,e.localeRuleKey)}))}catch(e){console.warn(e)}}setTimezone(e){this.timezone=e}getTimeZoneInUse(){const e=Intl.DateTimeFormat().resolvedOptions().timeZone;return this.timezone||e}matchPatternWithText(e,t){let n=t;const r=[];for(let t=0;t<e.length;){const s=e[t];if(0!==s.length){const e=n.indexOf(s);if(-1===e)return null;if(t>0){const t=n.slice(0,e);r.push(t)}n=n.slice(e+s.length)}t+=1}return n&&r.push(n),r}getLocalizedErrorMessage(e,t){let n="";if(e[t])return e[t];for(const r of Object.keys(e)){const s=r.split(/\{\d+\}/),a=this.matchPatternWithText(s,t);if(a){const t=e[r];if(n=this.replacePlaceHolders(a,t),n)return n}}return n}replacePlaceHolders(e,t){for(let n=0;n<e.length;){if(!t.includes(`{${n+1}}`))return"";t=t.replace(`{${n+1}}`,e[n]),n+=1}return t}async isCurrentLocalePackAvailable(){const e=Dh.getLocale();return this.availableLangPacks||(this.availableLangPacks=await Xi.getSvcAvailableLocales()),e&&this.availableLangPacks.includes(e)}getBaseComponentLabels=()=>this.getLocaleForRule("COSMOSFIELDS");#l(e){let t=!1;return e&&"string"==typeof e&&(t=e.includes("@P ")),t}}const vh=new bh;ln.registerHandler("@L",((e,t)=>t.getLocalizationService(t.getLocaleRuleName()).getLocalizedText(e))),ln.registerHandler("@P",((e,t,n)=>t?t.getValue(e):Bg.getLitePropertyValue(n))),ln.registerHandler("@E",((e,t,n)=>{try{const r=Kt(e),s=Jt(r);return Xt(s,t,n)}catch(e){}return!0})),ln.registerHandler("@W",((e,t,n)=>{let r;if(t)r=t.getContextDataValue(`.${j.SUMMARY_OF_WHEN_CONDITIONS}.${e}`);else{const{pageReference:t,context:s}=n??{};r=Pg(t,`.${j.SUMMARY_OF_WHEN_CONDITIONS}.${e}`,s)}return!0===r||"true"===r})),ln.registerHandler("@ASSOCIATED",((e,t)=>{let n={};const r=[];let s="",a="";const o=t.getPageReference();if(e.startsWith(".")){s=`${o}.${e.substring(1)}`;const r=e.split(".").filter((e=>!!e));r.length>1&&(r.pop(),a=r.join(".")),n=t.getFieldMetadata(e.substring(1))}else n=t.getFieldMetadata(e),s=e;const i=n?.datasource?.tableType,c=n?.datasource?.mode===j.READONLY,l=n?.datasource?.name||"",u=t.getComponentConfig();if(u&&u.deferDatasource&&(u.datasourceMetadata=`@FIELD_META ${e}`,t.setStateProps({datasourceMetadata:u.datasourceMetadata}),i===j.DATA_PAGE))return null;if(i===j.DECISION||i===j.RULE_REFERENCE)return function(e,t){const n=un.getPropertyName(e?.propertyForDisplayText??""),r=un.getPropertyName(e?.propertyForValue??""),s=t.getContextDataValue(`.${j.SUMMARY_OF_EXPRESSIONS}.${e?.name}`)||[];return s?.map((e=>({key:e[r]||e[`.${r}`],value:e[n]||e[`.${n}`]})))}(n?.datasource,t);if(i!==j.DATA_PAGE){const e=t.getLocalizationService(n?.localeReference);return n?.datasource?.records?.map((t=>({key:t.key,value:e.getLocalizedText(t.value)})))}const d=un.getPropertyName(n?.datasource?.propertyForDisplayText),p=un.getPropertyName(n?.datasource?.propertyForValue),h=Array.isArray(n?.datasource?.parameters)?n?.datasource?.parameters:[],g=t.getContextName(),f=[];if(h.forEach((e=>{if(un.isProperty(e?.value)){let t=Og(`.${jg.getFullPropertyReference([a,un.getPropertyName(e.value)])}`,o,g);f.push(jg.getFullPropertyReference([o,a,un.getPropertyName(e?.value)])),null!=t&&""!==t||(t=j.NULL_STRING),r.push(t)}else r.push(e?.value||j.NULL_STRING)})),g){const e=on.getContextObjectByName(g)||{};f.forEach((t=>{if(t in e){const n=e[t];e[t]=[...new Set([...n,s])]}else e[t]=[s]})),on.addContextName(g,e)}const m=function(e,t,n,r){let s="",a=n;if(t.join(j.HASH_DELIMITER)&&(s=jg.getHashedString(t.join(j.HASH_DELIMITER)),a=n+j.UNDERSCORE_STRING+s),r){const e=Tg(),t=e?e[n]?.[a]:{};return Array.isArray(t?.pxResults)?t.pxResults:[]}const o=e.getDataObject(),i=(o?.[n]||{})[a]||{};return Array.isArray(i?.pxResults)?i.pxResults:[]}(t,r,l,c),I=t.getLocalizationService();return m.map((e=>{let t=e[d]||e[`.${d}`];var n;return"string"==typeof t&&(n=t,t=I.getLocalizedDataPage(n,l,d)),{key:e[p]||e[`.${p}`],value:t}}))})),ln.registerHandler("@ROUTING_INFO",((e,t)=>Dt(t.getContainerName(),t.getContextName()))),ln.registerHandler("@ENV",((e,t)=>{switch(e){case j.ENV_INFO_KEYS.APPLICATION_NAME:return Dh.getApplicationName();case j.ENV_INFO_KEYS.ACCESS_GROUP:return Dh.getAccessGroup();case j.ENV_INFO_KEYS.USER_NAME:return Dh.getOperatorName();case j.ENV_INFO_KEYS.USER_ID:return Dh.getOperatorIdentifier();case j.ENV_INFO_KEYS.APPLICATION_DESC:return t.getLocalizationService("APP!APPLICATION").getLocalizedText(Dh.getApplicationLabel()||"");case j.ENV_INFO_KEYS.USER_IMAGE:return Dh.getOperatorImageInsKey();case j.ENV_INFO_KEYS.LOCALE:return Dh.getUseLocale();case j.ENV_INFO_KEYS.TIMEZONE:return Dh.getTimeZone();case j.ENV_INFO_KEYS.WORK_GROUP:return Dh.getOperatorWorkGroup();default:return e}})),ln.registerHandler("@DATASOURCE",((e,t)=>{const n=t.getSharedDataPageForReferenceList()||t.getValue(e)||[],r=t.getComponentConfig(),s=Object.keys(r).find((t=>r[t]?.source?.includes(e)));if(s){const{fields:e,copyAll:t,filterDownloadedFields:a}=r[s],o=[];return n.forEach((n=>{const r={};t||a?Object.keys(n).forEach((e=>{const t=un.getPropertyName(e);r[t]=n[t]})):Object.keys(e).forEach((t=>{const s=un.getPropertyName(e[t]);r[t]=n[s]})),o.push(r)})),o}return[]})),ln.registerHandler("@FIELD_META",((e,t)=>{let n,r={};if(r=e.startsWith(".")?t.getFieldMetadata(e.substring(1)):t.getFieldMetadata(e),r&&r.datasource&&r.datasource.parameters){let s="";const a=e.split(".").filter((e=>!!e));if(a.length>1&&(a.pop(),s=`.${a.join(".")}`),Array.isArray(r.datasource.parameters)){const e=[];r.datasource.parameters.forEach((n=>{const r={},{name:a,value:o}=n;r.name=a,"string"==typeof o&&o.startsWith("@P")?r.value=`@P ${s}${o.substring(3)}`:r.value=o,e.push(t.resolveConfigProps(r))})),n=e}else n=t.resolveConfigProps(r.datasource.parameters);r={...r,datasource:{...r.datasource,parameters:n}}}return r})),ln.registerHandler("@USER",((e,t,n={})=>{const r=t?.getValue(e)||Bg.getLitePropertyValue(n,e),s=t?.getReferencedUser(r)||Bg.getReferencedUser(r,n);return{userId:r,userName:s?s.UserName:null}})),ln.registerHandler("@ACTIVE_CASES",((e,t)=>td.getOpenedCaseItems(`${t.getContextName()}/${t.getContainerName()}`))),ln.registerHandler("@LR",(e=>e)),ln.registerHandler("@CASE",((e,t)=>e===j.ID?t.getCaseInfo().getKey():e)),ln.registerHandler("@SHARED",(e=>sd.getSharedState(e))),ln.registerHandler("@PARAGRAPH",((e,t)=>cd.processParagraph(e,t))),ln.registerHandler("@FILTERED_LIST",((e,t)=>{const n=e.substring(1,e.indexOf("[")),r=e.substring(e.indexOf("]")+2),s=e.substring(e.indexOf("[")+1,e.indexOf("]"));if(!t)return null;const{useCustomContext:a}=t;let o;return jg.isEmpty(a)?o=t.getValue(`.${n}`):(o=a,o=jg.getIn(o,n)),o&&r.length>0?(s&&(o=o.filter((e=>Qt(s,e)))),o.map((e=>jg.getIn(e,r)))):null})),ln.registerHandler("@ADDRESS",((e,t)=>{const n=t.getValue(e)?.pyCountry;return n?`pyAddressForm_${n}`:"pyAddressForm"})),ln.registerHandler("@DATATYPE",((e,t)=>t.getValue(e))),ln.registerHandler("@ATTACHMENT",((e,t,n)=>{let r;return r=t?t.getValue(e):Bg.getLitePropertyValue(n),Mi.prepareAttachmentData(r)})),ln.registerHandler("@FL",((e,t)=>t.getLocalizedValueForFieldLabel(e))),ln.registerHandler("@DEFERRED",((e,t)=>{const n=t.getFieldMetadata(e);return n?.isDeclarativeTarget?{isDeferred:!0,propertyName:e}:t.getValue(e)})),ln.registerHandler("@GENAICOACH",((e,t)=>cg(e,t.getCurrentClassID()))),ln.registerHandler("@AIAGENT",((e,t)=>{const n=lg(e,t.getCurrentClassID());if(n)return n;const r=t.getComponentConfig();if(r){const n=r?.coaches?.find((t=>t?.config?.coach?.substring(9)===e&&t?.config?.ruleNamespace))?.config;if(n?.label){const r={label:n.label};t.resolveConfigProps({label:n.label},r);const s=r.label;return{insName:`${n.ruleNamespace}__${e}`,label:t.getLocalizedValue(s),type:"agent"}}}return null})),ln.registerHandler("@REFRESH",((e,t)=>{const n=t.getCaseInfo().getKey(),r=t.getContextName(),s=t.getPageReference();Bu.registerForRefresh("PROP_CHANGE",t.getActionsApi().refreshCaseView.bind(t.getActionsApi(),n,"",s,{autoDetectRefresh:!0,preserveClientChanges:!1,refreshFor:`${s.replace("caseInfo.content","")}${e}`,resetForm:!0}),`${s}${e}`,`${r}/${s}`,r)})),ln.registerHandler("@DW",((e,t,n)=>{let r;const s=`${j.CONTEXT_DATA}.${j.SUMMARY_OF_DYNAMIC_WHENS}.${e}`;if(t)r=t.getValue(s);else{const{context:e}=n??{};r=Og(s,null,e)}return!0===r||"true"===r}));const xh={},wh={},Mh={},Lh={},Fh={},Uh={},jh={},Vh={},kh={},$h={},Bh={},Gh={},Wh={},Hh=(e={},t={})=>{0!==Object.keys(t).length?Object.keys(e).forEach((n=>{const r=e[n],s=t[n];s?((e,t,n,r)=>{const s=Array.isArray(n)?n:[n];(Array.isArray(r)?r:[r]).forEach((e=>{const t=s.findIndex((t=>t.classID===e.classID));if(-1===t)s.push(e);else{const n={isDeclarativeTarget:!1},r={...s[t],...n,...e};s[t]=r}})),t[e]=1===s.length?s[0]:s})(n,t,s,r):t[n]=r})):jg.copy(e,t)},qh=(e,t="")=>{if(!e)return null;const n=Lh[e];if(!n)return null;if(!t)return jg.deepClone(n);let r;return r=Array.isArray(n)?n.find((e=>e.classID.toLowerCase()===t.toLowerCase()))||null:n.classID.toLowerCase()===t.toLowerCase()||("Page"===n.type||"Page List"===n.type)&&n?.pageClass?.toLowerCase()===t.toLowerCase()?n:null,r?jg.deepClone(r):null},zh=e=>(Gh[e]||(Gh[e]=new bh),Gh[e]),Yh=(e,t)=>(Wh[e]||(Wh[e]=t()),Wh[e]),Kh=(e,t,n,r=[])=>{if(!t||!e)return null;if(!e.includes(".")){let s;const a=qh(e,t);return r.length&&(s=r.join(".")),{...a,embeddedType:n,category:s}}const[s,...a]=e.split("."),o=qh(s,t);return o&&r.push(o.label),Kh(a.join("."),o?.pageClass,o?.type,r)},Jh=e=>{Hh(e,wh)},Xh=e=>{Hh(e,Mh)},Qh=e=>{(e=>{e.views&&Hh(e.views,wh),e.navigations&&Hh(e.navigations,Mh),e.personalizations&&Hh(e.personalizations,Uh),e.insights&&Hh(e.insights,jh),e.paragraphs&&Hh(e.paragraphs,xh),e.dataTypes&&Hh(e.dataTypes,Vh),e.datapages&&Hh(e.datapages,kh),e.genAICoaches&&Hh(e.genAICoaches,$h),e.AIAgents&&Hh(e.AIAgents,Bh)})(e),(e=>{const t=e.fields||{};Object.keys(t).forEach((n=>{const r=t[n];if(Array.isArray(r)){if(r.forEach((t=>{e.datapages&&t.datasource&&"DataPage"===t.datasource.tableType&&(t.datasource.mode=e.datapages?.[t.datasource.name].mode);const r=fd(hd,n,t.definedOnClassID??t.classID);t.localeReference=r})),1===r.length){const[e]=r;t[n]=e}}else e.datapages&&r?.datasource&&"DataPage"===r.datasource.tableType&&(r.datasource.mode=e.datapages[r.datasource.name].mode)}))})(e);const{datapages:t={}}=e;Object.keys(t).forEach((e=>{Fh[e]=t[e]})),Hh(e.fields,Lh)},Zh=e=>wh[e],eg=(e,t)=>{const n=wh[e];return Array.isArray(n)?n.some((e=>e.classID===t)):n?.classID===t},tg=e=>Mh[e],ng=e=>e in Fh?Fh[e]:null,rg=e=>e in Uh?Uh[e]:null,sg=e=>e in jh?jh[e]:null,ag=e=>{const t={};return Object.keys(Lh).forEach((n=>{const r=Lh[n];let s;Array.isArray(r)?s=r.find((t=>e===t.classID)):e===r.classID&&(s=r),s&&(t[n]=jg.deepClone(s))})),t},og=(e,t)=>{const n=qh(e,t),r=n?.datasource?.parameters;return r?jg.deepClone(r):null},ig=(e,t)=>{let n=null;const r=xh[e];return r&&(Array.isArray(r)?n=r.find((e=>e.classID===t)):r.classID===t&&(n=r)),n?jg.deepClone(n):null},cg=(e,t)=>{let n=null;const r=$h[e];return r&&(Array.isArray(r)?n=r.find((e=>e.classID===t)):r.classID===t&&(n=r)),n?jg.deepClone(n):null},lg=(e,t)=>{let n=null;const r=Bh[e];return r&&(Array.isArray(r)?n=r.find((e=>e.classID===t)):r.classID===t&&(n=r)),n?jg.deepClone(n):null},ug=e=>{if(e in Vh){const{savableDataPage:t}=Vh[e];return t}return null},dg=e=>{const t=kh[e];if(!t)return null;const{classID:n,isAlternateKeyStorage:r,parameters:s}=t;if(r)return s.map((e=>({keyName:e.name,isAlternateKeyStorage:r,linkedField:e.linkedField})));const a=Vh[n];return a?a.classKeys.map((e=>({keyName:e,isAlternateKeyStorage:r}))):[]},pg=e=>{if(e in Vh){const{lookupDataPage:t}=Vh[e];return t}return null},hg=e=>{if(Object.hasOwn(Vh,e)){const{lookupDataPageInfo:t}=Vh[e];return t}return null},gg=(e,t)=>{const n=e.split("."),r=n.pop(),s=new bd({options:{pageReference:`${n.join(".")}`,context:t}}),a=qh(r,s.getCurrentClassID())?.additionalInformation;if(!a?.includes("@PARAGRAPH"))return a;const o=un.trimAnnotation(a);return cd.processParagraph(o,s)},fg=(e,t)=>{const n=e.split("."),r=n.pop(),s=new bd({options:{pageReference:`${n.join(".")}`,context:t}}),a=qh(r,s.getCurrentClassID()),o={};return s._classID=s.getCurrentClassID(),s.resolveConfigProps(a,o),o};class mg{constructor(){this.name="CascadeManager",this.cascadeSubscribers={},this.cascadeResetSubscribers={},this.listChangeSubscribers=[]}registerResetDependencies(e,t,n,r,s,a="singleRecord"){if(!e||!n||!r?.length)return;const o=n.startsWith(".")?`${t}.${n.substring(1)}`:n,i=this.cascadeResetSubscribers[e]||{},c=this._handlePageReference(t,n,s);r.forEach((e=>{if(!e)return;let t=e.startsWith(".")?e.substring(1):e;if(t=jg.getFullPropertyReference([c,t]),t in i){const e=i[t];e.find((e=>e.propertyName===o))||e.push({propertyName:o,mode:a})}else i[t]=[{propertyName:o,mode:a}]})),Object.keys(i).length>0&&(this.cascadeResetSubscribers[e]=i)}deregisterResetDependencies(e,t,n,r,s){if(!e||!n||!r?.length)return;const a=n.startsWith(".")?`${t}.${n.substring(1)}`:n,o=this.cascadeResetSubscribers[e]||{},i=this._handlePageReference(t,n,s);r.forEach((e=>{if(e){let t=e.startsWith(".")?e.substring(1):e;if(t=jg.getFullPropertyReference([i,t]),t in o){const e=o[t];jg.removeExistingDependentProperty(e,a)}}})),Object.keys(o).length>0&&(this.cascadeResetSubscribers[e]=o)}getResetDependencies(e,t){return this.cascadeResetSubscribers[e]?.[t]||[]}purgeResetDependencies(e){e&&this.cascadeResetSubscribers[e]&&delete this.cascadeResetSubscribers[e]}registerFields(e,t,n,r,s){this.cascadeSubscribers[e]=this.cascadeSubscribers[e]||{},n?.forEach((n=>{this.cascadeSubscribers[e][`${t}${n}`]=this.cascadeSubscribers[e][`${t}${n}`]||{};const a=this.cascadeSubscribers[e][`${t}${n}`];if(!a[s]){a[s]=r;const o=Og(n,t,e);a.previousValue="object"==typeof o?null:o}}))}registerListField(e,t,n,r,s){const a=mg._getFieldsForList(e,t,n);a.length>0&&(this.registerFields(e,t,a,r,s),mu.enableCascade(e))}unRegisterListField(e,t,n,r){const s=mg._getFieldsForList(e,t,n);s.length>0&&this.unRegisterFields(e,t,s,r)}static _getFieldsForList(e,t,n){const r=[],s=qh(n,Og("classID",t,e));return s&&!Array.isArray(s)&&s.datasource&&s.datasource.parameters&&Object.values(s.datasource.parameters).forEach((e=>{if(un.isProperty(e)){const t=un.trimAnnotation(e);r.push(t)}})),r}unRegisterFields(e,t,n,r){this.cascadeSubscribers[e]&&n?.forEach((n=>{if(!this.cascadeSubscribers[e][`${t}${n}`])return;const s=this.cascadeSubscribers[e][`${t}${n}`];s[r]&&delete s[r]}))}triggerCascade(e,t,n,r){let s=!1;this.cascadeSubscribers[e]&&this.cascadeSubscribers[e][t]&&(Object.keys(this.cascadeSubscribers[e][t]).forEach((a=>{const o=this.cascadeSubscribers[e][t];"previousValue"!==a&&o.previousValue!==n&&(s=!0,r?r.add(o[a]):o[a](t,n))})),s&&(this.cascadeSubscribers[e][t].previousValue=n))}purgeCascadeFields(e){delete this.cascadeSubscribers[e]}handleServerChanges(e,t=[],n=[]){if(!e)return;const r=new Set;n.forEach((t=>{const n=Og(t,"",e);this.triggerCascade(e,t,n,r)})),r.forEach((e=>{e()})),0!==this.listChangeSubscribers.length&&0!==t.length&&t.forEach((t=>{this.listChangeSubscribers.forEach((n=>{const r=Og(t,"",e);n(e,t,r)}))}))}_updateChangedProperties(e,t,n,r,s,a,o,i){const c=n&&i.some((e=>r.startsWith(e)));if(e!==t||c){const e=r.lastIndexOf("."),t=r.substring(0,e),i=r.substring(e),c=fo.getMessages({type:"error",property:i,context:s,pageReference:t});if(c?.length>0&&o.push(r),!n)return;a.push(r)}}isChangedListPropertyExist(e){let t=!0;return 0!==this.listChangeSubscribers.length&&jg.isValidPageListProperty(e)||(t=!1),t}_getServerProperties(e,t,n,r,s,a,o){if("object"!=typeof e){s.push(n.replace(/\.(\d+)/g,"[$1]"));const i=this.isChangedListPropertyExist(n);n=n.replace(/\.(\d+)/g,"[$1]");const c=Og(n,"",t);if(void 0===c&&!e&&0!==e)return;return void this._updateChangedProperties(c,e,i,n,t,r,a,o)}const i=Object.keys(e??{});for(let c=0,l=i.length;c<l;c+=1){const l=i[c],u=`${n}.${l}`;if(Array.isArray(e[l])){const n=Og(u,"",t);n&&n?.length===e[l].length||o.push(u)}this._getServerProperties(e[l],t,u,r,s,a,o)}}getServerProperties(e,t,n=j.CASE_INFO.CASE_INFO_CONTENT){const r=[],s=[],a=[],o=jg.getIn(e,n);return o&&t?(this._getServerProperties(o,t,n,r,a,s,[]),{changedListProperty:r,leafProperty:a,changedPropertyWithError:s}):{changedListProperty:r,leafProperty:a,changedPropertyWithError:s}}_handlePageReference(e,t,n){let r=e;if("Page"===n&&t.startsWith(".")&&t.slice(1).includes(".")){r=`${e}${t.substring(0,t.lastIndexOf("."))}`}return r}registerForListChanges(e=(()=>{})){this.listChangeSubscribers.push(e)}unRegisterForListChanges(){this.listChangeSubscribers=[]}}const Ig=new mg;let yg=null;const Eg=e=>e?.split(/\.(?![^[]+\])|\[|\]/g).filter(Boolean),Ag=e=>{yg=e},_g=()=>yg,Cg=e=>{if(!e)return;let t=[],n=[],r=[];if(Array.isArray(e)||"MERGE_DATA"!==e.type||({changedListProperty:t,leafProperty:n,changedPropertyWithError:r}=Ig.getServerProperties(e.payload.data,e.payload.context,e.payload.rootPageReference)),yg?.dispatch(e),!Array.isArray(e)&&"MERGE_DATA"===e.type){if(r.length&&!e.payload.skipValidation){r.map((e=>{const t=e.lastIndexOf(".");return{property:e.substring(t),pageReference:e.substring(0,t)}})).forEach((({property:t,pageReference:n})=>{fo.clearMessages({type:"error",property:t,pageReference:n,context:e.payload.context});const r=eo.getFieldReferenceForProperty(e.payload.context,`${n}${t}`),s=Bg.resolveContextTreeNodeProps(r.props);Fi.validate(s.componentName?.toLowerCase(),s.propertyName,Bg.getLitePropertyValue(s,s.propertyName),s)}))}Ig.handleServerChanges(e.payload.context,t,n)}},Sg=e=>_g()?.getState().data?.[e],Tg=()=>_g()?.getState().data[j.SHARED],Ng=(e,t,n)=>{if(!(r=e)||r.startsWith('"')||r.startsWith("'"))return(e=>e&&e.trim().substring(1,e.length-1))(e);var r;const s=e?.startsWith(".")?t+e:e,a=Eg(s);return jg.getIn(n,a)},Og=(e,t,n)=>Ng(e,t,Sg(n)),Pg=(e,t,n)=>Ng(t,e?`${j.CONTEXT_DATA}.${e}`:`${j.CONTEXT_DATA}`,Sg(n)),Dg=(e,t,n)=>((e,t,n)=>{const r=Eg(`${t}.${n}`);return jg.getIn(e,r)})(Sg(n),`${j.CONTEXT_DATA}.${e}`,t),Rg=e=>{const{context:t}=e,n=_g()?.getState().data[t];if(n)return de;const{action:r}=e;return["createWork","showHarness","openAssignment","openWorkByHandle","initRouting"].includes(r)?Ce:de},bg=(e,t)=>{const n=Eg(t);return jg.deleteIn(e,n)},vg=e=>!Array.isArray(e)&&"object"==typeof e,xg=(e,t,n={})=>{const{isArrayDeepMerge:r,propertiesToReplace:s=[],propertiesToReArrange:a=[]}=n;Array.isArray(e)&&!t&&(t=[]),Array.isArray(s)&&s.length>0&&s.forEach((t=>{t.allowMultiple?t.allowMultiple&&!a.includes(t.path)&&jg.setIn(e,t.path,[]):jg.setIn(e,t.path,{})})),a.length>0&&jg.rearrangeProperties(a,e);const o=(e,t)=>{if(vg(e)&&null!==t&&"string"!=typeof t&&"number"!=typeof t&&"boolean"!=typeof t)return w()(e,t,o);if(Array.isArray(e)&&null!==t&&Array.isArray(t)){if(r)return w()(e,t,o);{const n=t.length;if(void 0===r&&n===e.length)return w()(e,t,o)}}return""===t&&e&&"object"==typeof e?e:t};return o(e,t)},wg=(e,t,n,r={isArrayDeepMerge:!0})=>{const{isArrayDeepMerge:s}=r,a=Eg(t);if("object"==typeof n){const t=xg(jg.getIn(e,a),n,{isArrayDeepMerge:s});return jg.setIn(e,a,t)}return jg.setIn(e,a,n)},Mg=(e,t,n)=>{const r=Eg(t);return jg.setIn(e,r,n)},Lg=()=>{const e=tt,{promise:t,actionMgrID:n}=rc.actionManagerPromise(e);return Cg({type:e,payload:{actionMgrID:n}}),t},Fg=e=>{const t=_g()?.getState();return!!t?.data?.[e]};class Ug{static mergeDeep(e,t){return w()(t,e)}static hasIn(e,t){return P()(e,t)}static getIn(e,t,n){return R()(e,t,n)}static setIn(e,t,n){return v()(e,t,n)}static deleteIn(e,t){return N()(e,t)}static isObjectEmpty(e){return!e||0===Object.entries(e).length}static isEmpty(e){return L()(e)}static deepClone(e={}){return JSON.parse(JSON.stringify(e))}static copy(e,t){Object.keys(e).forEach((n=>{t[n]=e[n]}))}static isPropertyRef(e){if(!e||!e.includes("."))return!1;for(let t=0;t<e.length;t+=1)if(" @#$%=!<>/\\".includes(e[t]))return!1;return!0}static isWhenExist(e){const t=["visibility","disabled","readOnly","required"];let n=!1;for(const r of Object.keys(e)){const s=e[r];s&&"object"==typeof s&&!Array.isArray(s)?n=Ug.isWhenExist(s):t.includes(r)&&"string"==typeof s&&s?.startsWith("@W ")&&(n=!0)}return n||"multirecordlist"!==e?.type||"Editable"!==e?.renderMode||(n=Object.keys(e?.allowActions??{}).some((t=>"string"==typeof e?.allowActions?.[t]&&e.allowActions[t]?.startsWith("@W ")))),n}static getWhenNames(e){const t=["visibility","disabled","readOnly","required"];let n="";const r=new Set;if(e&&Object.keys(e).forEach((s=>{const a=e[s];t.includes(s)&&"string"==typeof a&&a.startsWith("@W ")&&(n=un.trimAnnotation(a),r.add(n))})),"multirecordlist"===e?.type&&"Editable"===e?.renderMode){const t=e?.allowActions??{};Object.keys(t).forEach((e=>{"string"==typeof t[e]&&t[e]?.startsWith("@W ")&&(n=un.trimAnnotation(t[e]),r.add(n))}))}return[...r]}static isExpressionExist(e){const t=["disabled","visibility","readOnly","required"];let n=!1;for(const r of Object.keys(e))t.includes(r)&&"string"==typeof e[r]&&e[r]?.startsWith("@E ")&&(n=!0);return n}static buildDataObject(e,t){let n={};const r=n;if(t.indexOf(".")>0){t.split(".").forEach((e=>{if(e.includes("[")){const[t]=e.split("[");n[t]=[],n=n[t],e=e.substring(e.indexOf("[")+1,e.lastIndexOf("]"))}n[e]={},n=n[e]}))}else n[t]={},n=n[t];return Object.keys(e).forEach((t=>{let r=t;t.startsWith(".")&&(r=t.substring(1)),n[r]=e[t]})),r}static buildObject=(e,t,n)=>{if(void 0===n)return;const r=e.split(".");let s=0;for(;s<r.length-1;s+=1){const e=r[s];e?.toString().length&&!t[e]&&(t[e]={}),t[e]&&(t=t[e])}"object"==typeof n?(t[r[s]]||(t[r[s]]=Array.isArray(n)?[]:{}),xg(t[r[s]],n,{isArrayDeepMerge:!0})):t[r[s]]=n};static getHashedString(e){return(0,S.crc32)(e).toString(16)}static getPropertyName(e){if(e){const t=e.startsWith("@P"),n=t?e.indexOf(" "):-1;return t?e.substring(n+2):e}return e}static getPropertyNameFromDependency(e){return"string"==typeof e?e:e.propertyName}static isValidJson(e){try{return JSON.parse(e)}catch(e){return console.error("not a Valid JSON",e),!1}}static isEqual(e,t){return h()(e,t)}static isContains(e,t){const n=Object.keys(e);for(let r=0;r<n.length;r+=1)if(e[n[r]]&&Ug.isEqual(e[n[r]],t))return!0;return!1}static removeExistingDependentProperty(e,t){const n=e.findIndex((e=>e.propertyName===t));n>=0&&e.splice(n,1)}static getFullPropertyReference(e){return Array.isArray(e)?e.filter((e=>!!e)).join("."):""}static iterateLeafNodes(e,t){const n=(e,r=[])=>{Object.entries(e).forEach((([s,a])=>{r.push(Array.isArray(e)?Number(s):s),Array.isArray(a)?a.forEach(((e,t)=>{r.push(t),n(e,r),r.pop()})):"object"==typeof a?n(a,r):t(r.slice(),a),r.pop()}))};n(e)}static resolveStringBooleans(e){const t=["required","readOnly","visibility"];return Object.keys(e).forEach((n=>{t.includes(n)&&"string"==typeof e[n]&&(e[n]="true"===e[n])})),e}static generateUniqueID(){return crypto.randomUUID()}static unflatten(e){const t={};return Object.entries(e).forEach((([e,n])=>{const r=e.split(".");let s;r.reduce(((e,t,a)=>(s=e[t]?e[t]:Number.isNaN(Number(r[a+1]))?r.length-1===a?n:{}:[],e[t]=s,e[t])),t)})),t}static flatten(e,t,n){t||(t=""),Array.isArray(e)?e.forEach(((e,r)=>{Ug.flatten(e,`${t}[${r}]`,n)})):"object"==typeof e&&null!==e?Object.keys(e).forEach((r=>{const s=t?`${t}.${r}`:r;Ug.flatten(e[r],s,n)})):n[t]=e}static buildInstructionPageReference(e,t){const n=e.startsWith(j.OBJECT_INFO.OBJECT_INFO)?`${e}${t}`.replace(j.OBJECT_INFO.OBJECT_INFO_CONTENT,""):`${e}${t}`.replace(j.CASE_INFO.CASE_INFO_CONTENT,"").replace(j.DATA_INFO.DATA_INFO_CONTENT,"");return Qo.formatPageReference(n)}static convertPageRefToClipboardPageNotation(e){return e.replace(/\[\d+\]/g,(e=>e.replace(/\d+/g,(e=>`${parseInt(e,10)+1}`)).replace("[","(").replace("]",")")))}static convertClipboardPageToPageRefNotation(e){return e.replace(/\(\d+\)/g,(e=>e.replace(/\d+/g,(e=>""+(parseInt(e,10)-1))).replace("(","[").replace(")","]")))}static isString(e){return"string"==typeof e}static rejectPendingActions(e){return e.forEach((e=>e.payload.actionMgrID&&rc.rejectActionByID(e.payload.actionMgrID))),!0}static isValidAnnotation(e){const t=new Set(["@DATASOURCE","@ACTIVE_CASES","@ADDRESS","@ASSOCIATED","@ATTACHMENT","@CASE","@FILTERED_LIST","@PARAGRAPH","@P","@ROUTING_INFO","@USER","@W","@E","@SHARED"]),n=e.indexOf(" "),r=e.substring(0,n);return t.has(r)}static trimDotForProperty(e){return"string"==typeof e&&e.startsWith(".")?e.substring(1):e}static convertObjectWithStringToBoolean(e){if(e&&!Array.isArray(e)&&"object"==typeof e)return Object.keys(e).forEach((t=>{let n;const r=e[t];"string"==typeof r?n="true"===r||"false"!==r&&r:"object"==typeof r?(n=r,Ug.convertObjectWithStringToBoolean(r)):n=r,e[t]=n})),e}static rearrangeProperties(e,t){e.forEach((e=>{let n=Ug.getIn(t,e);if(!n)return;const r=Object.hasOwn(n,"pyCount");if(r&&(n=n.pxResults),!n)return;const s=n.filter((e=>!e.error)),a=n.filter((e=>e.error));Ug.setIn(t,r?`${e}.pxResults`:e,[...s,...a])}))}static getETag(e){if(!e)return;let t=e;const n=t?.split("/")||[],r=n.findIndex((e=>e.startsWith("workarea"))),s=n.findIndex((e=>e.startsWith("modal")));return-1!==r?t=n.slice(0,r+1).join("/"):-1!==s&&(t=n.slice(0,s+1).join("/")),_g()?.getState()?.data[t]?.caseInfo?.headers?.etag}static PAGELIST_PATH_REGEX=/^(?!.*\.\.)(?!\d)\w+(\.\w+)*\.\d+(\.\w+)+$/;static isValidPageListProperty(e){return Ug.PAGELIST_PATH_REGEX.test(e)}static generateDataPageHashWithParameters(e,t,n){const r=[];let s="";const a=n.getPageReference(),o=n.getContextName();Object.keys(e).forEach((t=>{const n=e[t];let s=un.isProperty(n)?Og(`.${un.getPropertyName(n)}`,a,o):n;null!=s&&""!==s||(s=j.NULL_STRING),r.push(s)}));let i=t;const c=r.join(j.HASH_DELIMITER);return c&&(s=Ug.getHashedString(c),i=t+j.UNDERSCORE_STRING+s),i}static parsePegaDateTimeToTimestamp(e){if(!e)return null;const t=e.replace(" GMT","").match(/^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})\.(\d{3})$/);if(!t)return null;const[,n,r,s,a,o,i,c]=t.map(Number);return new Date(n,r-1,s,a,o,i,c).getTime()}static containsEncodedPattern=e=>/%[0-9A-Fa-f]{2}/.test(e)}const jg=Ug,Vg=j.SUMMARY_OF_LISTS,kg=j.SUMMARY_OF_WHEN_CONDITIONS;class $g{static updateData(e){Object.keys(e).forEach((t=>{Cg(Yg({context:t,data:e[t]}))}))}static updateContextData(e){Object.keys(e).forEach((t=>{Cg(Yg({context:t,data:e[t]}))}))}static resolveWhen(e,t){return!!t.getContextDataValue(`.${kg}.${e}`)}static resolveFieldValue(e,t){return t.getLocalizedValue(e)}static resolveNavigation(e,t){const n=this.resolveName(e,t);return tg("string"==typeof n?n:"")}static resolveView(e,t,n=""){const r=Zh(this.resolveName(e,t));let s=[];if(Array.isArray(r)&&r.length>0){if(t&&r.length>1){if(n||(n=t.getValue(j.CLASS_ID)||""),!n)return;s=r.filter((e=>e[j.CLASSID]===n))}return 0===s.length?r[0]:s[0]}return r}static resolveName(e,t){return e&&"string"==typeof e&&e.startsWith("param.")?(e=e.substring(6),t.getContextDataValue(`.$parameters.${e}`)):(e&&"string"==typeof e&&e.startsWith("@")&&(e=un.handleAnnotation(e,t)),e)}static getContextPath(e,t){return("number"==typeof t||t)&&("number"==typeof(t=un.trimAnnotation(t))||"string"==typeof t)?"number"==typeof t&&Number.isInteger(t)?`${e}[${t}]`:"string"==typeof t&&t.startsWith(".")?e+t:t:e}static getRuleClass(e,t,n){let r;if(t)r=t.startsWith(j.CLASS_ANNOTATION)?t.split(j.CLASS_ANNOTATION)[1].trim():this.resolveClassID(t,e.getPageReference(),e.getContextName());else if(n?.authorContext){const t=e.getFieldMetadata(n.authorContext);if(t){r="manual"===t.dataRetrievalType?t.classID:t.pageClass}r||(r=n.ruleClass)}return r}static resolveReference(e,t){const{type:n}=e;let r;if("reference"===n){const{config:n}=e,s=n?.type,{ref:a,name:o,context:i}=n||{},c=this.getRuleClass(t,i,n);return t&&(t._ruleClass=c),"navigation"===s?r=this.resolveNavigation(a||o,t):"view"===s?r=this.resolveView(a||o,t,c||""):"widget"===s&&(r={type:"Widget",config:{name:o,ruleClass:c}}),r}return e}static resolvePropertyReference(e,t,n){return Og(t,e,n)}static getProperty(e,t,n){let r=this.resolvePropertyReference(t,e,n);if(null==r||0===r.length){const s=Dg(`${t}.${Vg}`,e,n);s&&(r=this.resolvePropertyReference(t,s,n))}return r}static getPropertyValue(e,t,n){return e=un.trimAnnotation(e),this.getProperty(e,t,n)}static getReferencedUser(e,t){const n=$g.getLitePropertyValue(t,"referencedUsers");if(Array.isArray(n)){const t=n.find((t=>t.UserID===e));if(t)return{userId:t.UserID,UserName:t.UserName}}return n?.[e]}static getLitePropertyValue(e,t){if(!e)return;const{useCustomContext:n,propertyName:r,hasSuggestions:s,pageReference:a,context:o}=e;let i=t||r||"";return n?(i=i.startsWith(".")?i.substring(1):i,i.split(".").reduce(((e,t)=>e?.[t]??void 0),n)):s&&i===r?$g.getPropertyValue(i,a,o?`${o}/${j.SUGGESTION}`:void 0):$g.getPropertyValue(i,a,o||void 0)}static _handlePropString(e,t,n,r,s){n.startsWith("@")?e[t]=un.handleAnnotation(n,r,s):e[t]=n}static _resolveProps(e,t,n){e&&Object.keys(e).forEach((r=>{const s=e[r];"string"==typeof s?this._handlePropString(e,r,s,t,n):Array.isArray(s)?s.forEach((r=>{this._resolveProps("object"==typeof r?r:e[r],t,n)})):"object"==typeof s&&this._resolveProps(e[r],t,n)}))}static resolveProps(e,t,n){return e&&t?(jg.mergeDeep(e,t),this._resolveProps(t,n,void 0),t):t}static resolveContextTreeNodeProps(e){const t={};return e?(jg.mergeDeep(e,t),this._resolveProps(t,void 0,e),jg.resolveStringBooleans(t)):t}static resolveClassID(e,t,n){const r=un.trimAnnotation(e);let s;for(s=r.startsWith(".")?`${t}${r}`:`${r}`;s;){const e=Og(j.CLASS_ID,s,n);if(e)return e;s=s.substring(0,s.lastIndexOf("."))}return null}}const Bg=$g;const Gg=new class{constructor(){this.actionHandlers={}}getHandler(e){return this.actionHandlers[e]}registerHandler(e,t){this.actionHandlers[e]=t}};const Wg=class{static#u=[];static#d=!1;static getActionHandlers=(e,t,n)=>{const r=[];return{mouseenter:"hover",change:"onChange",blur:"onBlur"}[n]!==t||e.forEach((e=>{const t=Gg.getHandler(e.action),{config:n}=e;r.push({handler:t,config:n})})),r};static isEditable=e=>{const{tagName:t}=e;return"INPUT"===t||"TEXTAREA"===t||"SELECT"===t||"DATETIME"===t};static isNonKeyInput=e=>{const{tagName:t,type:n}=e;return"SELECT"===t||"checkbox"===n||"radio"===n};static#p=(e,t,n)=>{for(let r=0;r<e.length;r+=1){const s=e[r],a={actionHandler:s.handler,component:t,eventType:n,config:s.config};this.#u.push(a)}};static buildActionObject=(e,t)=>{const n={...e};return n.context="Browser"===Dh.getRuntime()?t.getContextName():n.context,n.pageReference=t.getPageReference(),n.actionMgrID=rc.getNextActionMgrId(),n};static#h=e=>{const t=e.actionHandler,n=e.component,{config:r}=e,s={};Bg.resolveProps(r,s,n),t&&(t(e.eventType,s,n),this.#g())};static#g=()=>{if(!this.#d){if(0===this.#u.length)return;const e=this.#u.shift();this.#h(e),e.config&&"true"===e.config.parallel&&this.#u.length>0&&this.#g()}};static#f=()=>{this.#g()};static#m=(e,t,n)=>{this.#p(e,t,n),this.#f()};static getFullRef=e=>{const t=e.getPageReference(),n=e.getComponentConfig().value;return Bg.getContextPath(t,n)};static#I(e,t){const n=e.getComponentConfig().behaviours||[];for(let r=0;r<n.length;r+=1){const{behaviour:s,actions:a}=n[r];if(a){const n=this.getActionHandlers(a,s,t);n&&n.length>0&&this.#m(n,e,t)}}}static changeHandler=(e,t)=>{const n=e.getStateProps().value,r=e.getContextName();io({type:U.MESSAGES.MESSAGES_TYPE_ERROR,property:n,pageReference:e.getPageReference(),context:r});if(("Browser"===Dh.getRuntime()?t?.nativeEvent instanceof Event||t instanceof Event:!!t?.nativeEvent)||null!==t.value&&void 0===t.prop){let n,{target:s}=t;null===s&&t&&t.auxiliaryTarget&&(s=t.auxiliaryTarget),n=void 0===s?t.value:"value"in s?s.value:s.innerText;const a=this.getFullRef(e);Cg({type:Q,payload:{reference:a,value:n,context:r}}),void 0!==s&&this.isEditable(s)&&!this.isNonKeyInput(s)||Cg({type:ee,payload:{reference:a,pageReference:e.getPageReference(),value:n,context:r,propertyName:e.getComponentConfig().value,classID:e.getValue(j.CLASS_ID)}})}else{const n=e.getPageReference(),s=e.getStateProps();for(const e of Object.keys(t)){const a=s[e],o=t[e];Cg({type:Q,payload:{reference:Bg.getContextPath(n,a),value:o,context:r}}),Cg({type:ee,payload:{reference:Bg.getContextPath(n,a),value:o,context:r}})}}};static blurHandler=(e,t)=>{let{target:n}=t;null===n&&t&&"auxiliaryTarget"in t&&(n=t.auxiliaryTarget);const{value:r,validationValue:s}=n,a=this.getFullRef(e),o=e.getContextName();n.clearMessages&&io({type:U.MESSAGES.MESSAGES_TYPE_ERROR,property:e.getStateProps().value,pageReference:e.getPageReference(),context:o}),this.isEditable(n)&&(e.getValidationApi().validate("validationValue"in n?s:r),e.isInsideList()&&e.getListActions().updateProperty(e.getStateProps().value,r),this.isNonKeyInput(n)||Cg({type:ee,payload:{reference:a,pageReference:e.getPageReference(),value:r,context:o,propertyName:e.getComponentConfig().value,classID:e.getValue(j.CLASS_ID)}}))};static eventHandler=(e,t)=>{const{type:n}=t;switch(n){case"change":this.changeHandler(e,t);break;case"blur":this.blurHandler(e,t)}n&&this.#I(e,n)};static pause=()=>{this.#d=!0};static resume=()=>{this.#d=!1,this.#g()};static isQueueEmpty=()=>0===this.#u.length;static clearQueue=()=>{this.#u=[]};static getActionsQueue=()=>this.#u;static EVENTS_MAP={click:"onClick",change:"onChange",hover:"onMouseEnter",blur:"onBlur"}},Hg="CREATE_WORK",qg=e=>({type:Hg,payload:e});const zg=(e,t,n,r,s="")=>{const a=[];Object.keys(e).forEach((o=>{"object"==typeof e[o]&&o.includes("[")?function(e,t,n,r,s,a,o){const i=r.substring(0,r.indexOf("[")),c=r.substring(r.indexOf("[")+1,r.indexOf("]"));let l=t[i];const u=`${jg.trimDotForProperty(s)}.${i}`;o.includes(u)&&Object.hasOwn(l,"pyCount")&&(l=l.pxResults),Array.isArray(l)&&(l?.splice(+c,1,e[r]),a.push(i),n.add(`${s}.${r}`))}(e,t,n,o,s,a,r):e[o]&&"object"==typeof e[o]?(t[o]||(t[o]=Array.isArray(e[o])?[]:{}),zg(e[o],t[o],n,r,`${s}.${o}`)):t[o]=e[o]})),function(e,t,n){Object.keys(e).forEach((r=>{(Array.isArray(e[r])&&!n.includes(r)||!Array.isArray(e[r])&&!Object.hasOwn(t,r))&&delete e[r]}))}(t,e,a)},Yg=(e,t={})=>{const{serverPrecedenceFields:n=[],propertiesToReplace:r=[],propertiesToReArrange:s=[]}=t,{context:a,data:o,isArrayDeepMerge:i,preserveClientChanges:c=!1}=e,l=tp(a,!0),u=Sg(a);let d={};if(u&&o){d=JSON.parse(JSON.stringify(u));const e=JSON.parse(JSON.stringify(o));s.length>0&&jg.rearrangeProperties(s,d);const t=new Set;zg(l,d,t,s),((e,t,n)=>{const r=new Set;e.forEach((e=>{e=jg.trimDotForProperty(e);const[s,a,o]=Ba(e);if(s&&a&&o&&!r.has(`${s}.${a}`)){const e=jg.getIn(n,`${s}.${a}`)||[];Array.isArray(e)&&e.forEach(((e,n)=>{n!==+o&&jg.setIn(t,`${s}.${a}[${n}]`,e)})),r.add(`${s}.${a}`)}}))})(t,d,e)}!function(e,t){const n=jg.getIn(e,j.REFERENCED_USERS);let r;if(void 0!==n){if(!Array.isArray(n)&&"object"==typeof n)return r=jg.getIn(t,j.REFERENCED_USERS,{}),void jg.setIn(e,j.REFERENCED_USERS,{...r,...n});r=jg.getIn(t,j.REFERENCED_USERS,[]);const s=new Map;for(const e of[...r,...n])if(s.has(e.UserID)){const t=s.get(e.UserID);s.set(e.UserID,{...t,...e})}else s.set(e.UserID,e);n.length=0;for(const e of s.values())n.push(e)}}(o,u);const p=jg.getIn(e?.data,j.OBJECT_INFO.OBJECT_INFO_CONTENT_CLASS_ID),h=Rl.isExternalObject(p),g=h?{[j.OBJECT_INFO.OBJECT_INFO]:{[j.CONTENT]:{...d[j.OBJECT_INFO.OBJECT_INFO]?.[j.CONTENT]}}}:{[j.CASE_INFO.CASE_INFO]:{[j.CONTENT]:{...d[j.CASE_INFO.CASE_INFO]?.[j.CONTENT]}}},f=h?j.OBJECT_INFO.OBJECT_INFO_CONTENT:j.CASE_INFO.CASE_INFO_CONTENT;let m=o;return c?(n.forEach((e=>{const t=`${f}.${e}`;jg.deleteIn(g,t)})),m=xg(o,g,{isArrayDeepMerge:i??!0})):((e,t)=>{const n=Jd[e]||{};Object.keys(n).forEach((e=>{jg.hasIn(t,e)&&(n[e].value=jg.getIn(t,e))}));let r=fl.getStateMachinesByContext(e)||{};r={...r,...fl.getUnConnectedStateMachines(e)||{}},Object.keys(r).forEach((n=>{if(jg.hasIn(t,n)){const r=jg.getIn(t,n);r&&Array.isArray(r)&&0===r.length&&fl.setStateMachineEmpty(e,n)}}))})(a,o),{type:fe,payload:{...e,data:m,...r.length>0?{propertiesToReplace:r}:null,...s.length>0?{propertiesToReArrange:s}:null}}},Kg=e=>({type:"SHOW_HARNESS",payload:e}),Jg=e=>({type:te,payload:e}),Xg=e=>({type:ne,payload:e}),Qg=e=>({type:"ADD_WORK",payload:e}),Zg=e=>({type:ue,payload:e}),ef=e=>({type:Ae,payload:e}),tf=e=>({type:_e,payload:e}),nf=e=>({type:Ce,payload:e}),rf=e=>({type:Te,payload:e}),sf=e=>({type:Ne,payload:e}),af=e=>({type:De,payload:e}),of=e=>({type:be,payload:e}),cf=e=>({type:Re,payload:e}),lf=e=>{const{containerItemID:t}=e;e.suggestionContexts=Fp(t);const n=e?.data?.caseInfo?.content,r=Object.keys(n||{}).length>0;return e.propertiesToReplace=r?Rl.getPropertiesToReplace(t):[],{type:xe,payload:e}},uf=e=>{const{context:t}=e;return{type:oe,payload:{context:t}}},df=e=>{const{context:t}=e;return{type:ie,payload:{context:t}}},pf=e=>({type:we,payload:e}),hf=e=>({type:ve,payload:e}),gf=e=>({type:Ze,payload:e}),ff=e=>{const{context:t,containerItemID:n}=e;let r=t;return r||(r=vp(n)),e.context=r,e.deleteContext=!Jp(n),e.childContainers=Mp(n),e.childContainersContexts=Lp(n),e.transientItems=Xp([...e.childContainersContexts,n]),e.suggestionContexts=Fp(n),n===t&&(e.caseID=Og(j.CASE_INFO.CASE_INFO_ID,"",t)||Og(j.OBJECT_INFO.OBJECT_INFO_ID,"",t),e.RemoteSystemID=Og(j.CASE_INFO.REMOTESYSTEMID,"",t)),{type:Se,payload:e}},mf=e=>{const{containerItemID:t}=e;return e.transientItems=Xp([...Lp(t),t]),{type:Pe,payload:e}},If=e=>{const{transientItemID:t}=e;return e.transientItems=[t],{type:Oe,payload:e}},yf=e=>{const{context:t,containerItemID:n}=e;let r=t;if(r||(r=vp(n)),e.context=r,e.childContainers=Mp(n),e.childContainersContexts=Lp(n),e.transientItems=Xp([...e.childContainersContexts,n]),e.suggestionContexts=Fp(n),n===t){e.caseID=Og(j.CASE_INFO.CASE_INFO_ID,"",t),e.RemoteSystemID=Og(j.CASE_INFO.REMOTESYSTEMID,"",t);const n=Og(j.CASE_INFO.CASE_INFO_CLASSNAME,"",t);$.isTraditionalRemoteCase(n)&&(e.skipReleaseLockRequest=!0)}return{type:Me,payload:e}},Ef=e=>({type:pe,payload:e}),Af=e=>({type:ge,payload:e}),_f=e=>({type:ye,payload:e}),Cf=(e,...t)=>(Wg.resume(),e(...t)),Sf=(e,t,n,r,s)=>({type:Ee,payload:{msg:e,err:t,context:n,formFields:r,actionMgrID:s}}),Tf=e=>({type:rt,payload:e}),Nf=e=>({type:st,payload:e}),Of=e=>({type:at,payload:e}),Pf=e=>({type:"SHOW_CASE_PREVIEW",payload:e}),Df=e=>({type:ce,payload:e}),Rf=e=>({type:Q,payload:e}),bf="add",vf="replace",xf=["portal","noPortal","preview","debug","devtool","activeTab"];let wf="",Mf="Home",Lf="",Ff=!0;const Uf=e=>(Ff=e,Ff),jf=()=>Ff,Vf=(e,t,n)=>Ph.getSemanticURL(e,t,n),kf=(e,t)=>Ph.getRestEndPoint(e,t),$f=(e,t)=>{let n=E();const r=kf(e,t);return r?(r.restApi?.startsWith("/")||(r.restApi=`/${r.restApi}`),n?.endsWith("/")&&(n=n.substring(0,n.length-1)),r.restApi=n+r.restApi,r):{}},Bf=(e,t,n)=>{const{root:r,resources:s}=e,{views:a}=s,{config:o}=r,i=bf;let c="";if(n)c=n;else{const e=a[o.name];let t=e;Array.isArray(e)&&e.length>0&&([t]=e);c=t.config.urlPath}const l=c.match(mh);if(l){const e=jg.getIn(t,o.context);c=c.replace(l[0],e.pyID)}return c.startsWith("/")&&(c=c.substring(1,c.length)),{pxURLPath:c,historyAction:i}},Gf=(e,t,n)=>{let r,s;r=yh(t)?`${e}/${t}`:e;const a=yh(n?.pxURLPath);a&&(r=`${r}/${a}`);try{s=new URL(r).searchParams,r=r.includes("?")?r.split("?")[0]:r}catch(e){return console.log("Invalid url",e),""}const o=r.split("/"),i=o[o.length-1],c=new URLSearchParams(window.location.search);if(Nh()?(r=((e,t,n,r,s)=>{const a=Ph.getStaticRoutePage(),o=Mf?.toLowerCase(),i=a?.toLowerCase(),c=r?.toLowerCase();return i!==o&&c!==o||s.has("noPortal")?e:`${t}/${n}`})(r,e,t,i,c),Ph.setStaticRoutePage("")):i.toLowerCase()!==Mf.toLowerCase()||c.has("noPortal")||(r=`${e}/${t}`),!Ph.isDefaultPortal()){const e=Ph.getPortalName();c.has("portal")?c.set("portal",e):c.append("portal",e)}return s=((e,t)=>{for(const[n,r]of t.entries())!e.has(n)&&xf.includes(n)&&e.append(n,r);return e})(s,c),s.toString()&&(r+=`?${s.toString()}`),r},Wf=(e,{urlPathObjParam:t,infoParam:n,optionsParam:r,queryParam:s},a=!1)=>{let o,i,c;if(!1===window.PCore.getBehaviorOverride("dynamicSemanticUrl"))return;if(a)o=t,i=n,c=r;else{const{uiResources:n,data:r}=e;({options:c}=e),o=t&&t.pxURLPath&&Ih(t.pxURLPath)?Bf(n,r,t.pxURLPath):t||Bf(n,r),i=Ph.getEndPointInfo(o.pxURLPath),o.pxURLPath=i.urlPath}let l=Gf(wf,Ph.getApplicationPath(),o);const{title:u}=((e,t,n)=>{if(e=(e=>{let t=e.split(" ");return t=t.map((e=>e.charAt(0).toUpperCase()+e.slice(1))),t.join(" ")})(e=e&&""!==e?e:Ph.getApplicationName()),n===`${wf}/${t}/`)return{title:e};const r=new URL(n).pathname.replace(`${t}/`,""),s=r.split("/");return/\d/.test(r)?{title:`${e} - ${s[s.length-1]}`}:{title:`${e} - ${s[0]}`}})(Lf,Ph.getApplicationPath(),l),d=((e,t)=>(void 0!==e&&(e.options=t),{stateObj:e}))(i,{...c,title:u});o?.historyAction===bf?((e,t,n)=>{try{window.history.pushState(e,t,n),window.scrollTo(0,0)}catch(e){throw new Error("Error- Unable to Add to Browser History")}})(d,u,l):o?.historyAction===vf&&(s&&(l+=`?${s}`),((e,t,n)=>{try{window.history.replaceState(e,t,n)}catch(e){throw new Error("Error- Unable to Replace Browser History")}})(d,u,l))},Hf=e=>{let t=null;e.directUrlUpdation&&(t={historyAction:bf,pxURLPath:""},t.pxURLPath=e.semanticURL),Wf(e,{urlPathObjParam:t,infoParam:null,optionsParam:null},!1)},qf=e=>{Hf(e)},zf=e=>{const t={pxURLPath:e};return Gf(wf,Ph.getApplicationPath(),t)},Yf=e=>{const{uiResources:t}=e;jf()&&(e.directUrlUpdation||(e=>{if(e&&e.root){const{root:t}=e,{resources:n}=e,{views:r}=n,s=t.config,a=s.type,o=s.name;if("VIEW"===a.toUpperCase()){const e=r[o];let t=e;Array.isArray(e)&&e.length>0&&([t]=e);const n=t.config;if(n.type){const e=n.type;return!(!n.urlPath||"PAGE"!==e.toUpperCase())}}return!1}return!1})(t))&&Hf(e)},Kf=e=>{const t={routeEndpoint:e.routeEndpoint,requestType:e.requestType,payload:e.payload,routeKey:e.routeKey,options:null};return e.options&&(t.options=e.options),t},Jf=(e,t,n)=>{const{caseClassName:r,workID:s}=e.payload,{containerName:a,context:o}=t,{RemoteClassGroup:i,RemoteSystemID:c,name:l}=$.getRemoteCase(r),u={...e,headers:{RemoteSystemID:c},className:r,isTraditionalRemoteCase:!0,action:At,viewName:V,gadgetId:Rl.getUniqueGadgetId(),context:n??o,skipSemanticUrl:!0,insKey:`${i?.toUpperCase()} ${s}`,containerName:a,name:l};Cg(d.showPage(u))},Xf=e=>{const t=(e=>"ui-navigation"===e.state?.type?(yo.publish(U.PUB_SUB_EVENTS.URL_NAVIGATION,e.state),null):e.state?e.state.stateObj:null)(e);t&&($.isTraditionalRemoteCase(t.payload?.caseClassName)?Jf({...t},t.options):Cg(d.showHistory(Kf(t))))},Qf=()=>Ph.getApplicationPath()!==Ah(),Zf=e=>{const{acName:t,context:n,defaultViewLabel:r,ruleName:s,className:a}=e,o=((e,t)=>{const n=Ph.getRoutingInfo();if(Nh()&&Object.values(n?.routes).find((n=>n?.payload?.pageClass===t&&n?.payload?.page===e)))return e;const r=e.split(" ").join(""),s=e.split(" ").join("-").toLowerCase(),a=(e=>{const t=e.replace(/(?=[A-Z][a-z])/g,"-").toLowerCase();return t.startsWith("-")?t.substring(1):t})(e);return n?.routes[r]?r:n?.routes[s]?s:n?.routes[a]?a:e})(s||r,a);(e=>{Mf=e})(o),Ph.setDefaultRoute(o),Ph.setDefaultClassName(a);const i=H(t,n),c=Pt(t,n),l="true"===Dh.getIsExtraCallRequiredForDefaultHome(),u={historyAction:vf,pxURLPath:""};let p,h=null;const g={acName:c,context:i,actionConfig:{context:i}};if(l||!l&&Qf()){const t=Sh(_h());Dh.shouldUseURLParams()&&(h=t.includes("?")?t.split("?")[1]:null),p=Th(t,g),u.pxURLPath=p.urlPath,void 0!==p.payload?.pageClass&&(p.payload.pageClass=_g()?.getState()?.data?.app?.pyPortal?.classID);const n="showHistory",r={routeEndpoint:p.routeEndpoint,requestType:p.requestType,payload:p.payload,options:g,routeKey:p.routeKey};$.isTraditionalRemoteCase(p?.payload?.caseClassName)?Jf(r,e,g.context):Cg(d[n](Kf(r)))}else p=Ph.getEndPointInfo(Mf),u.pxURLPath="";Wf(null,{urlPathObjParam:u,infoParam:p,optionsParam:g,queryParam:h},!0)},em=(e,t=!1)=>{var n;wf=e.domain,!1===t&&jf()&&(n=Xf,window.addEventListener("popstate",(e=>n(e))),window.onbeforeunload=()=>null),Ph.init(e,Mf)},tm=e=>{(e=>{window.document.title=e})(e)};function nm(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var rm=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),sm=()=>Math.random().toString(36).substring(7).split("").join("."),am={INIT:`@@redux/INIT${sm()}`,REPLACE:`@@redux/REPLACE${sm()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${sm()}`};function om(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function im(e,t,n){if("function"!=typeof e)throw new Error(nm(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(nm(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(nm(1));return n(im)(e,t)}let r=e,s=t,a=new Map,o=a,i=0,c=!1;function l(){o===a&&(o=new Map,a.forEach(((e,t)=>{o.set(t,e)})))}function u(){if(c)throw new Error(nm(3));return s}function d(e){if("function"!=typeof e)throw new Error(nm(4));if(c)throw new Error(nm(5));let t=!0;l();const n=i++;return o.set(n,e),function(){if(t){if(c)throw new Error(nm(6));t=!1,l(),o.delete(n),a=null}}}function p(e){if(!om(e))throw new Error(nm(7));if(void 0===e.type)throw new Error(nm(8));if("string"!=typeof e.type)throw new Error(nm(17));if(c)throw new Error(nm(9));try{c=!0,s=r(s,e)}finally{c=!1}return(a=o).forEach((e=>{e()})),e}p({type:am.INIT});return{dispatch:p,subscribe:d,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error(nm(10));r=e,p({type:am.REPLACE})},[rm]:function(){const e=d;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(nm(11));function n(){const e=t;e.next&&e.next(u())}n();return{unsubscribe:e(n)}},[rm](){return this}}}}}function cm(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const s=t[r];0,"function"==typeof e[s]&&(n[s]=e[s])}const r=Object.keys(n);let s;try{!function(e){Object.keys(e).forEach((t=>{const n=e[t];if(void 0===n(void 0,{type:am.INIT}))throw new Error(nm(12));if(void 0===n(void 0,{type:am.PROBE_UNKNOWN_ACTION()}))throw new Error(nm(13))}))}(n)}catch(e){s=e}return function(e={},t){if(s)throw s;let a=!1;const o={};for(let s=0;s<r.length;s++){const i=r[s],c=n[i],l=e[i],u=c(l,t);if(void 0===u){t&&t.type;throw new Error(nm(14))}o[i]=u,a=a||u!==l}return a=a||r.length!==Object.keys(e).length,a?o:e}}function lm(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce(((e,t)=>(...n)=>e(t(...n))))}function um(e){return({dispatch:t,getState:n})=>r=>s=>"function"==typeof s?s(t,n,e):r(s)}var dm=um(),pm=um,hm=Symbol.for("immer-nothing"),gm=Symbol.for("immer-draftable"),fm=Symbol.for("immer-state");function mm(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Im=Object.getPrototypeOf;function ym(e){return!!e&&!!e[fm]}function Em(e){return!!e&&(_m(e)||Array.isArray(e)||!!e[gm]||!!e.constructor?.[gm]||Om(e)||Pm(e))}var Am=Object.prototype.constructor.toString();function _m(e){if(!e||"object"!=typeof e)return!1;const t=Im(e);if(null===t)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===Am}function Cm(e,t){0===Sm(e)?Reflect.ownKeys(e).forEach((n=>{t(n,e[n],e)})):e.forEach(((n,r)=>t(r,n,e)))}function Sm(e){const t=e[fm];return t?t.type_:Array.isArray(e)?1:Om(e)?2:Pm(e)?3:0}function Tm(e,t){return 2===Sm(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Nm(e,t,n){const r=Sm(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function Om(e){return e instanceof Map}function Pm(e){return e instanceof Set}function Dm(e){return e.copy_||e.base_}function Rm(e,t){if(Om(e))return new Map(e);if(Pm(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=_m(e);if(!0===t||"class_only"===t&&!n){const t=Object.getOwnPropertyDescriptors(e);delete t[fm];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){const s=n[r],a=t[s];!1===a.writable&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(t[s]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[s]})}return Object.create(Im(e),t)}{const t=Im(e);if(null!==t&&n)return{...e};const r=Object.create(t);return Object.assign(r,e)}}function bm(e,t=!1){return xm(e)||ym(e)||!Em(e)||(Sm(e)>1&&(e.set=e.add=e.clear=e.delete=vm),Object.freeze(e),t&&Object.entries(e).forEach((([e,t])=>bm(t,!0)))),e}function vm(){mm(2)}function xm(e){return Object.isFrozen(e)}var wm,Mm={};function Lm(e){const t=Mm[e];return t||mm(0),t}function Fm(){return wm}function Um(e,t){t&&(Lm("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function jm(e){Vm(e),e.drafts_.forEach($m),e.drafts_=null}function Vm(e){e===wm&&(wm=e.parent_)}function km(e){return wm={drafts_:[],parent_:wm,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function $m(e){const t=e[fm];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Bm(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[fm].modified_&&(jm(t),mm(4)),Em(e)&&(e=Gm(t,e),t.parent_||Hm(t,e)),t.patches_&&Lm("Patches").generateReplacementPatches_(n[fm].base_,e,t.patches_,t.inversePatches_)):e=Gm(t,n,[]),jm(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==hm?e:void 0}function Gm(e,t,n){if(xm(t))return t;const r=t[fm];if(!r)return Cm(t,((s,a)=>Wm(e,r,t,s,a,n))),t;if(r.scope_!==e)return t;if(!r.modified_)return Hm(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const t=r.copy_;let s=t,a=!1;3===r.type_&&(s=new Set(t),t.clear(),a=!0),Cm(s,((s,o)=>Wm(e,r,t,s,o,n,a))),Hm(e,t,!1),n&&e.patches_&&Lm("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function Wm(e,t,n,r,s,a,o){if(ym(s)){const o=Gm(e,s,a&&t&&3!==t.type_&&!Tm(t.assigned_,r)?a.concat(r):void 0);if(Nm(n,r,o),!ym(o))return;e.canAutoFreeze_=!1}else o&&n.add(s);if(Em(s)&&!xm(s)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Gm(e,s),t&&t.scope_.parent_||"symbol"==typeof r||!Object.prototype.propertyIsEnumerable.call(n,r)||Hm(e,s)}}function Hm(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&bm(t,n)}var qm={get(e,t){if(t===fm)return e;const n=Dm(e);if(!Tm(n,t))return function(e,t,n){const r=Km(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}(e,n,t);const r=n[t];return e.finalized_||!Em(r)?r:r===Ym(e.base_,t)?(Xm(e),e.copy_[t]=Qm(r,e)):r},has:(e,t)=>t in Dm(e),ownKeys:e=>Reflect.ownKeys(Dm(e)),set(e,t,n){const r=Km(Dm(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=Ym(Dm(e),t),o=r?.[fm];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(((s=n)===(a=r)?0!==s||1/s==1/a:s!=s&&a!=a)&&(void 0!==n||Tm(e.base_,t)))return!0;Xm(e),Jm(e)}var s,a;return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==Ym(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,Xm(e),Jm(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=Dm(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty(){mm(11)},getPrototypeOf:e=>Im(e.base_),setPrototypeOf(){mm(12)}},zm={};function Ym(e,t){const n=e[fm];return(n?Dm(n):e)[t]}function Km(e,t){if(!(t in e))return;let n=Im(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=Im(n)}}function Jm(e){e.modified_||(e.modified_=!0,e.parent_&&Jm(e.parent_))}function Xm(e){e.copy_||(e.copy_=Rm(e.base_,e.scope_.immer_.useStrictShallowCopy_))}Cm(qm,((e,t)=>{zm[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),zm.deleteProperty=function(e,t){return zm.set.call(this,e,t,void 0)},zm.set=function(e,t,n){return qm.set.call(this,e[0],t,n,e[0])};function Qm(e,t){const n=Om(e)?Lm("MapSet").proxyMap_(e,t):Pm(e)?Lm("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:Fm(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let s=r,a=qm;n&&(s=[r],a=zm);const{revoke:o,proxy:i}=Proxy.revocable(s,a);return r.draft_=i,r.revoke_=o,i}(e,t);return(t?t.scope_:Fm()).drafts_.push(n),n}function Zm(e){if(!Em(e)||xm(e))return e;const t=e[fm];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Rm(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Rm(e,!0);return Cm(n,((e,t)=>{Nm(n,e,Zm(t))})),t&&(t.finalized_=!1),n}var eI=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,n)=>{if("function"==typeof e&&"function"!=typeof t){const n=t;t=e;const r=this;return function(e=n,...s){return r.produce(e,(e=>t.call(this,e,...s)))}}let r;if("function"!=typeof t&&mm(6),void 0!==n&&"function"!=typeof n&&mm(7),Em(e)){const s=km(this),a=Qm(e,void 0);let o=!0;try{r=t(a),o=!1}finally{o?jm(s):Vm(s)}return Um(s,n),Bm(r,s)}if(!e||"object"!=typeof e){if(r=t(e),void 0===r&&(r=e),r===hm&&(r=void 0),this.autoFreeze_&&bm(r,!0),n){const t=[],s=[];Lm("Patches").generateReplacementPatches_(e,r,t,s),n(t,s)}return r}mm(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...n)=>this.produceWithPatches(t,(t=>e(t,...n)));let n,r;return[this.produce(e,t,((e,t)=>{n=e,r=t})),n,r]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Em(e)||mm(8),ym(e)&&(e=function(e){ym(e)||mm(10);return Zm(e)}(e));const t=km(this),n=Qm(e,void 0);return n[fm].isManual_=!0,Vm(t),n}finishDraft(e,t){const n=e&&e[fm];n&&n.isManual_||mm(9);const{scope_:r}=n;return Um(r,t),Bm(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));const r=Lm("Patches").applyPatches_;return ym(e)?r(e,t):this.produce(e,(e=>r(e,t)))}},tI=eI.produce;eI.produceWithPatches.bind(eI),eI.setAutoFreeze.bind(eI),eI.setUseStrictShallowCopy.bind(eI),eI.applyPatches.bind(eI),eI.createDraft.bind(eI),eI.finishDraft.bind(eI);var nI="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?lm:lm.apply(null,arguments)};"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;var rI=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return 1===t.length&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function sI(e){return Em(e)?tI(e,(()=>{})):e}var aI="RTK_autoBatch",oI=e=>t=>{setTimeout(t,e)},iI=e=>function(t){const{autoBatch:n=!0}=t??{};let r=new rI(e);return n&&r.push(((e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let s=!0,a=!1,o=!1;const i=new Set,c="tick"===e.type?queueMicrotask:"raf"===e.type?"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:oI(10):"callback"===e.type?e.queueNotification:oI(e.timeout),l=()=>{o=!1,a&&(a=!1,i.forEach((e=>e())))};return Object.assign({},r,{subscribe(e){const t=r.subscribe((()=>s&&e()));return i.add(e),()=>{t(),i.delete(e)}},dispatch(e){try{return s=!e?.meta?.[aI],a=!s,a&&(o||(o=!0,c(l))),r.dispatch(e)}finally{s=!0}}})})("object"==typeof n?n:void 0)),r};function cI(e){const t=function(e){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:s=!0}=e??{};let a=new rI;return t&&("boolean"==typeof t?a.push(dm):a.push(pm(t.extraArgument))),a},{reducer:n,middleware:r,devTools:s=!0,duplicateMiddlewareCheck:a=!0,preloadedState:o,enhancers:i}=e||{};let c,l;if("function"==typeof n)c=n;else{if(!om(n))throw new Error(pI(1));c=cm(n)}l="function"==typeof r?r(t):t();let u=lm;s&&(u=nI({trace:!1,..."object"==typeof s&&s}));const d=function(...e){return t=>(n,r)=>{const s=t(n,r);let a=()=>{throw new Error(nm(15))};const o={getState:s.getState,dispatch:(e,...t)=>a(e,...t)},i=e.map((e=>e(o)));return a=lm(...i)(s.dispatch),{...s,dispatch:a}}}(...l),p=iI(d);return im(c,o,u(..."function"==typeof i?i(p):p()))}function lI(e){const t={},n=[];let r;const s={addCase(e,n){const r="string"==typeof e?e:e.type;if(!r)throw new Error(pI(28));if(r in t)throw new Error(pI(29));return t[r]=n,s},addAsyncThunk:(e,r)=>(r.pending&&(t[e.pending.type]=r.pending),r.rejected&&(t[e.rejected.type]=r.rejected),r.fulfilled&&(t[e.fulfilled.type]=r.fulfilled),r.settled&&n.push({matcher:e.settled,reducer:r.settled}),s),addMatcher:(e,t)=>(n.push({matcher:e,reducer:t}),s),addDefaultCase:e=>(r=e,s)};return e(s),[t,n,r]}function uI(e,t){let n,[r,s,a]=lI(t);if("function"==typeof e)n=()=>sI(e());else{const t=sI(e);n=()=>t}function o(e=n(),t){let o=[r[t.type],...s.filter((({matcher:e})=>e(t))).map((({reducer:e})=>e))];return 0===o.filter((e=>!!e)).length&&(o=[a]),o.reduce(((e,n)=>{if(n){if(ym(e)){const r=n(e,t);return void 0===r?e:r}if(Em(e))return tI(e,(e=>n(e,t)));{const r=n(e,t);if(void 0===r){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return r}}return e}),e)}return o.getInitialState=n,o}var{assign:dI}=Object;Symbol.for("rtk-state-proxy-original");function pI(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var hI=function(e){function t(t,n){return e.call(this)||this}return ws(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(zs),gI={setInterval:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var s=gI.delegate;return(null==s?void 0:s.setInterval)?s.setInterval.apply(s,js([e,t],Us(n))):setInterval.apply(void 0,js([e,t],Us(n)))},clearInterval:function(e){var t=gI.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},fI=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return ws(t,e),t.prototype.schedule=function(e,t){var n;if(void 0===t&&(t=0),this.closed)return this;this.state=e;var r=this.id,s=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(s,r,t)),this.pending=!0,this.delay=t,this.id=null!==(n=this.id)&&void 0!==n?n:this.requestAsyncId(s,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),gI.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return t;null!=t&&gI.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n,r=!1;try{this.work(e)}catch(e){r=!0,n=e||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,qs(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(hI),mI=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return ws(t,e),t.prototype.schedule=function(t,n){return void 0===n&&(n=0),n>0?e.prototype.schedule.call(this,t,n):(this.delay=n,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,n){return n>0||this.closed?e.prototype.execute.call(this,t,n):this._execute(t,n)},t.prototype.requestAsyncId=function(t,n,r){return void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.flush(this),0)},t}(fI),II={now:function(){return(II.delegate||Date).now()},delegate:void 0},yI=function(){function e(t,n){void 0===n&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=II.now,e}(),EI=function(e){function t(t,n){void 0===n&&(n=yI.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r}return ws(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var n;this._active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}},t}(yI),AI=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ws(t,e),t}(EI))(mI),_I=bs((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),CI=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return ws(t,e),t.prototype.lift=function(e){var t=new SI(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new _I},t.prototype.next=function(e){var t=this;sa((function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var s=Fs(t.currentObservers),a=s.next();!a.done;a=s.next()){a.value.next(e)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}}}))},t.prototype.error=function(e){var t=this;sa((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}}))},t.prototype.complete=function(){var e=this;sa((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,s=n.isStopped,a=n.observers;return r||s?Ys:(this.currentObservers=null,a.push(e),new zs((function(){t.currentObservers=null,qs(a,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,s=t.isStopped;n?e.error(r):s&&e.complete()},t.prototype.asObservable=function(){var e=new ma;return e.source=this,e},t.create=function(e,t){return new SI(e,t)},t}(ma),SI=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return ws(t,e),t.prototype.next=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===n||n.call(t,e)},t.prototype.error=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===n||n.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,n;return null!==(n=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==n?n:Ys},t}(CI),TI=function(e,t){return TI=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},TI(e,t)};Object.create;Object.create;var NI=function(e){function t(t,n){var r=e.call(this,(function(e){var t=r.__notifier.subscribe(e);return t&&!t.closed&&e.next(r.value),t}))||this;return r.__notifier=new CI,r.value=n,t.subscribe((function(e){e!==r.value&&(r.value=e,r.__notifier.next(e))})),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}TI(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t}(ma);const OI=e=>{let t=new Set,n=t;const r=()=>{t===n&&(t=new Set(t))},s=e=>{let n=!0;return r(),t.add(e),()=>{n&&(r(),t.delete(e),n=!1)}},a=()=>{const e=Array.from(t);n=t,e.forEach((e=>e()))};return(...t)=>{const n=e(...t);let r=!1,o=!1;const i=e=>Array.isArray(e)?e.map(i):n.dispatch(e);return n.subscribe((()=>{o?r=!0:a()})),{...n,dispatch:e=>{const t=o;t||(r=!1,o=!0);const n=i(e),s=r&&!t;return t||(r=!1,o=!1),s&&a(),n},subscribe:s}}},PI=(e,t)=>{const{data:{shared:n={}}={},context:r}=t;((e,t)=>{Ru.updateDataPageStore(t),Object.keys(t).forEach((n=>{jg.getIn(e,[j.SHARED,n])?Object.keys(t[n]).forEach((r=>{jg.setIn(e,[j.SHARED,n,r],t[n][r])})):jg.setIn(e,[j.SHARED,n],t[n])}))})(e,n),r&&jg.deleteIn(e,[r,"shared"])},DI=(e,t,n=!1)=>{const{context:r,caseViewMode:s=(n?void 0:j.PERFORM_MODE),containerName:a}=t;a!==gp.WORKAREA&&s&&jg.setIn(e,[r,"context_data","caseViewMode"],s)},RI=(e,t)=>{const{context:n}=t;jg.setIn(e,[n,"context_data","actionType"],t.actionType),jg.setIn(e,[n,"context_data","assignmentID"],t.assignmentID)},bI=(e,t=[])=>{t.forEach((t=>jg.deleteIn(e,t)))},vI=(e,t=[])=>{t.forEach((t=>jg.deleteIn(e,t)))},xI=(e,t=[])=>{t.forEach((t=>{jg.deleteIn(e,t)}))},wI=(e,t,n={})=>{const{deleteAssignmentSpecificResources:r=!0,doDeleteConfirmationDetails:s=!0}=n;jg.deleteIn(e,[t,"nextAssignmentInfo"]),jg.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"availableActions"]),jg.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"availableProcesses"]),jg.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"activeActionID"]),jg.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"assignments"]),jg.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"childCases"]),s&&(jg.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"confirmationLinks"]),jg.deleteIn(e,[t,"caseMessages"])),r&&(jg.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"actionButtons"]),jg.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"navigation"]))},MI=uI({},(e=>{e.addCase(Ce,((e,t)=>{if(!t.payload.data||e[t.payload.context])return;t.payload.doDeleteCaseSummary&&wI(e,t.payload.context);const{target:n}=t.payload;!n||-1===n.indexOf(j.WORKAREA)&&-1===n.indexOf(j.MODAL)?e[t.payload.containerItemID]=t.payload.data:e[t.payload.context]=t.payload.data,DI(e,t.payload),RI(e,t.payload),PI(e,t.payload),((e,t)=>{const{context:n}=t;jg.deleteIn(e,[n,"context_data","blocking_action_counter"]),jg.deleteIn(e,[n,"context_data","deferred_action_queue"])})(e,t.payload)})).addCase(xe,((e,t)=>{t.payload.doDeleteCaseSummary&&wI(e,t.payload.context,{deleteAssignmentSpecificResources:t.payload.deleteAssignmentSpecificResources});const{target:n,propertiesToReplace:r=[]}=t.payload;!n||-1===n.indexOf(j.WORKAREA)&&-1===n.indexOf(j.MODAL)?e[t.payload.containerItemID]=xg(e[t.payload.containerItemID],t.payload.data,{propertiesToReplace:[...r]}):e[t.payload.context]=xg(e[t.payload.context],t.payload.data,{propertiesToReplace:[...r]}),(t.payload.actionType||t.payload.assignmentID)&&RI(e,t.payload),DI(e,t.payload),PI(e,t.payload),vI(e,t.payload.suggestionContexts)})).addCase(Se,((e,t)=>{const{childContainersContexts:n=[]}=t.payload;((e,t)=>{const{containerItemID:n,context:r,deleteContext:s}=t;s&&jg.deleteIn(e,[r]),jg.deleteIn(e,[n])})(e,t.payload),xI(e,n),bI(e,t.payload.transientItems),vI(e,t.payload.suggestionContexts)})).addCase(_e,((e,t)=>{const{containerItems:n}=t.payload;Array.isArray(n)?n.forEach((t=>{jg.deleteIn(e,[t])})):jg.deleteIn(e,[n])})).addCase(we,((e,t)=>{const{context:n,contextToBeRemoved:r,data:s,childContainersContextsToBeRemoved:a}=t.payload;wI(e,t.payload.context),DI(e,t.payload),e[n]=xg(e[n],e[r]),e[n]=xg(e[n],s),jg.deleteIn(e,[r]),xI(e,a),PI(e,t.payload)})).addCase(Me,((e,t)=>{const{context:n,pulseReplace:r=!0,childContainersContexts:s=[]}=t.payload;let{data:a}=t.payload;const o=jg.getIn(e[n],"pulse");let i=jg.getIn(e[n],"OperatorID"),c=jg.getIn(e[n],"pxRequestor");c&&a.pxRequestor&&(c=jg.mergeDeep(c,a.pxRequestor)),i&&a.OperatorID&&(i=jg.mergeDeep(i,a.OperatorID)),!r&&o&&(a=wg(a,"pulse",o),a=wg(a,"OperatorID",i),a=wg(a,"pxRequestor",c)),jg.setIn(e,n,a),DI(e,t.payload),PI(e,t.payload),xI(e,s),bI(e,t.payload.transientItems),vI(e,t.payload.suggestionContexts)})).addCase(ot,((e,t)=>{const{context:n,doDeleteConfirmationDetails:r=!0}=t.payload;wI(e,n,{doDeleteConfirmationDetails:r})})).addCase(Te,((e,t)=>{const{transientItemID:n,data:r}=t.payload;jg.setIn(e,n,r)})).addCase(Oe,((e,t)=>{const{transientItems:n}=t.payload;n.forEach((t=>jg.deleteIn(e,t)))})).addCase(Pe,((e,t)=>{const{transientItems:n}=t.payload;n.forEach((t=>jg.deleteIn(e,t)))})).addCase(Ne,((e,t)=>{const{transientItemID:n,data:r}=t.payload;xg(jg.getIn(e,n),r)})).addCase(De,((e,t)=>{const{transientItemID:n,data:r}=t.payload;xg(jg.getIn(e,n),r)})).addCase(Re,((e,t)=>{const{transientItemID:n,data:r}=t.payload;Object.keys(r??{}).forEach((t=>{jg.deleteIn(e,[n,t])}))})).addCase(be,((e,t)=>{const{transientItemID:n,data:r}=t.payload;jg.deleteIn(e,n),jg.setIn(e,n,r)})).addCase(ce,((e,t)=>{const{key:n,value:r}=t.payload;jg.setIn(e,`${j.SHARED}.${n}`,r)})).addCase(Ue,((e,t)=>{const{context:n,data:r}=t.payload;return jg.setIn(e,n,r)}))})),LI=MI,FI=uI({},(e=>{e.addCase(fe,((e,t)=>{const{propertiesToReplace:n=[],propertiesToReArrange:r=[],uiRootReference:s=""}=t.payload,a=s&&"string"==typeof t.payload.context?`${t.payload.context}.${s}`:t.payload.context,o="string"==typeof a?Eg(a):[],i={isArrayDeepMerge:t.payload.isArrayDeepMerge,propertiesToReplace:[...n],propertiesToReArrange:[...r]};s&&o.length?jg.setIn(e,o,xg(jg.getIn(e,o),jg.getIn(t.payload.data,Eg(s)),i)):e[t.payload.context]=xg(e[t.payload.context],t.payload.data,i),DI(e,t.payload,!0),PI(e,t.payload)})).addCase(Q,((e,t)=>{const{context:n,reference:r,value:s,isArrayDeepMerge:a}=t.payload;wg(e[n],r,s,{isArrayDeepMerge:a})})).addCase(Z,((e,t)=>{const{context:n,reference:r,value:s}=t.payload;Mg(e[n],r,s)})).addCase(me,((e,t)=>{bg(e[t.payload.context],t.payload.reference)})).addCase(oe,((e,t)=>{jg.setIn(e[t.payload.context],"context_data.isLoading",!0)})).addCase(ie,((e,t)=>{jg.setIn(e[t.payload.context],"context_data.isLoading",!1)})).addCase(rt,((e,t)=>{const{data:n}=t.payload;PI(e,{data:{shared:n}})})).addCase(st,((e,t)=>{const{dataPagesToBeRemoved:n=[]}=t.payload;n.forEach((t=>{const{dataPageName:n,dataPageNameWithHash:r}=t;jg.deleteIn(e.shared,[n,r]);const s=jg.getIn(e.shared,[n]);s&&0===Object.keys(s).length&&jg.deleteIn(e.shared,[n])}))})).addCase(it,((e,t)=>{const n=jg.getIn(e[t.payload.context].context_data,"blocking_action_counter",0);t.payload.isInitiateBlockingAction?jg.setIn(e[t.payload.context].context_data,"blocking_action_counter",n+1):jg.setIn(e[t.payload.context].context_data,"blocking_action_counter",n-1)}))})),UI=FI,jI=/\[(\d+)\]$/gi,VI=/(\d+)/gi,kI=/\[.\]$/gi,$I=(e,t,n,r=[j.CONTEXT_DATA,j.CASE_INFO.CASE_INFO,j.CONTENT])=>{const s=jg.getIn(t,r);if(s){const t=lo(s,[],[]);for(const s of t)jg.setIn(e[n],[...r,...s],{})}},BI=(e,t,n,r)=>{const{property:s,pageReference:a,category:o,type:i}=r.payload,c=jg.getIn(e[t],n);if(c&&o===j.CASEMESSAGES)jg.setIn(e[t],no(s,a,o),"");else if(c&&c.length>0&&Array.isArray(c)){const r=c.filter((e=>e.type!==i));n&&n.length>0&&jg.setIn(e[t],no(s,a,o),r)}},GI=(e,t)=>{const{property:n,pageReference:r,category:s,isListEntry:a,deletingIndex:o,stateObj:i}=t.payload,{context:c}=t.payload;if(i)return $I(e,i,c),e;const l=no(n,r,s,a);if(Number.isInteger(o)){jg.deleteIn(e[c],l);const t=l.slice(0,l.length-1);let n=jg.getIn(e[c],t)||{};const r=(u=Object.keys(n),[...u].sort(((e,t)=>{const n=e.match(jI),r=t.match(jI);if(!n&&!r)return e.localeCompare(t);if(!n&&r)return-1;if(n?.length&&r?.length){const e=n[0].match(VI),t=r[0].match(VI);if(e?.length&&t?.length)return parseInt(e[0],10)-parseInt(t[0],10)}return 1})));n=r.map((e=>n[e])),n.forEach(((n,s)=>{const a=r[s].match(jI);if(a?.length){const i=parseInt(a[0].match(VI)[0],10);i>o&&(jg.deleteIn(e[c],t.concat(r[s])),jg.setIn(e[c],t.concat(r[s].replace(kI,`[${i-1}]`)),n))}}))}else jg.setIn(e[c],l,{});var u;return e};function WI(e,t){const n=jg.getIn(e,t);return void 0!==n?.dataInfo?.content}const HI=(e,t)=>{const n=jg.getIn(e,t);return!0===Rl.isObjectCaseType(n?.objectInfo?.objectTypeID)};function qI(e,t){let n=to.FIELD_MESSAGES_PATH;return WI(e,t)?n=to.DATA_OBJECT_FIELD_MESSAGES_PATH:HI(e,t)&&(n=to.OBJECT_FIELD_MESSAGES_PATH),n}const zI=(e,t,n)=>{n.forEach((n=>{((e,t,n)=>{const r=jg.getIn(n,j.ERROR_FIELD_IN_PAGE).slice(1),s=jg.getIn(n,j.ERROR_IN_PAGE_IDENTIFIER).slice(1);if(s){let a="caseInfo.content";WI(e,t)?a="dataInfo.content":HI(e,t)&&(a="objectInfo.content");let o=r?`${a}.${r}`:a;o=o.replace(/\(/g,"[").replace(/\)/g,"]");const i=no(s,o,j.PROPERTY),c=jg.getIn(e[t],`${o}.classID`),l=qh(s,c),u=Dh.getLocale()??"en-US",d=new md(u,l?.localeReference),p={type:U.MESSAGES.MESSAGES_TYPE_ERROR,message:n.localizedValue,...l?.label&&{fieldLabel:d.getLocalizedText(l.label)}},h=jg.getIn(e[t],i,[]);if(jg.isContains(h,p))return;jg.setIn(e[t],i,[...h,p])}})(e,t,n)}))};function YI(e,t){const{err:n,formFields:r}=t.payload;let{context:s}=t.payload;const{fieldErrors:a,pageErrors:o}=Xc(n.errorDetails,r),i=qI(e,s);if(jg.setIn(e,[s,...i],{}),jg.setIn(e,[s,...to.PAGE_MESSAGES_PATH],[]),a.forEach((t=>{const n=jg.getIn(t,j.ERROR_FIELD_IN_PAGE);if(n){const t=n.slice(1);if(t){const n=function(e){let t=null;const n=e.lastIndexOf(".");return n<0?null:(t=e.substring(0,n),t?`caseInfo.content.${t}`.replace(/\(/g,"[").replace(/\)/g,"]"):t)}(t);if(!n)return!1;const r=t.substring(t.lastIndexOf(".")+1),a=no(r,n,j.PROPERTY);jg.setIn(e,[s,...a],[])}}})),a.length>0&&zI(e,s,a),o.length>0){const t=(e=>{const t=[];return e.forEach((e=>{t.push({type:U.MESSAGES.MESSAGES_TYPE_ERROR,message:e.localizedValue})})),t})(o);e[s]||(s=j.APP.APP),jg.setIn(e,[s,...to.PAGE_MESSAGES_PATH],t)}else s.includes&&s.includes(gp.WORKAREA)&&(s=W(s)),jg.deleteIn(e,[s,...to.PAGE_MESSAGES_PATH]);return e}const KI=uI({},(e=>{e.addCase(Ee,((e,t)=>t.payload.err.errorDetails&&("Validation fail"===t.payload.err.errorClassification||(t.payload.err?.displayButtonsOnErrors?.length??0)>0)?YI(e,t):e)).addCase(xe,((e,t)=>{const{context:n}=t.payload,r=[n,...qI(e,n)],s=[n,...to.PAGE_MESSAGES_PATH];if(jg.setIn(e,r,{}),jg.setIn(e,s,[]),n&&n.includes(gp.WORKAREA)){const t=[J(n),...to.PAGE_MESSAGES_PATH];jg.setIn(e,t,[])}})).addCase(et,((e,t)=>{const{isListEntry:n,clearAll:r,context:s}=t.payload;return r?(jg.deleteIn(e,[s,j.CONTEXT_DATA]),e):n?GI(e,t):((e,t)=>{const{property:n,pageReference:r,category:s,isListEntry:a,stateObj:o}=t.payload,{context:i}=t.payload;let c=i;if(o)return $I(e,o,i),e;const l=no(n,r,s,a);return s===j.PAGE&&i?.includes(gp.WORKAREA)&&(c=W(i)),BI(e,c,l,t),BI(e,i,l,t),e})(e,t)})).addCase(Ze,((e,t)=>{const{messages:n,property:r,pageReference:s,context:a,category:o}=t.payload,i=no(r,s,o);n&&n.length>0&&Array.isArray(n)&&i&&i.length>0&&jg.setIn(e[a],no(r,s,o),n)}))})),JI=KI,XI=(e,t,n,r,s)=>{jg.setIn(e[t],[...n,r],s)},QI=uI({},(e=>{e.addCase(at,((e,t)=>{const{instruction:n,actions:r,context:s,referenceList:a,listIndex:o,groupIndex:i,listMoveToIndex:c,content:l={}}=t.payload,u=Eg(a);switch(n){case j.LIST_ACTIONS.ADD:XI(e,s,u,i,l);break;case j.LIST_ACTIONS.INSERT:XI(e,s,u,o,l);break;case j.LIST_ACTIONS.UPDATE:((e,t,n,r,s)=>{const a=xg(jg.getIn(e[t],[...n,r],{}),s);jg.setIn(e[t],[...n,r],a)})(e,s,u,o??i,l);break;case j.LIST_ACTIONS.DELETE:((e,t,n,r,s)=>{const a=jg.getIn(e[t],n,[]);"string"==typeof r?delete a[r]:a.splice(r,1),jg.setIn(e[t],n,a),eo.deleteListNode(t,[s],a.length)})(e,s,u,o??i,a);break;case j.LIST_ACTIONS.MOVE:((e,t,n,r,s)=>{const a=jg.getIn(e[t],[...n,r],{}),o=jg.getIn(e[t],n,[]);o.splice(r,1),o.splice(s,0,a),jg.setIn(e[t],n,o),ao(e,t,n?.join("."),r,s)})(e,s,u,o,c);break;case j.LIST_ACTIONS_TYPE.SELECT_DESELECT:((e,t,n,r)=>{const s=jg.getIn(e[t],n)||[];r.forEach((e=>{const{instruction:r,content:a,listIndex:o}=e;if(r===j.LIST_ACTIONS.SELECT){s[o]=a;const e=n?.join(".");hi(t,e)}else delete s[o]})),jg.setIn(e[t],n,s.filter(Boolean))})(e,s,u,r);break;case j.LIST_ACTIONS_TYPE.DESELECT_ALL:((e,t,n)=>{jg.setIn(e[t],n,[])})(e,s,u);break;case j.LIST_ACTIONS.REPLACE:((e,t,n,r)=>{jg.setIn(e[t],n,r)})(e,s,u,l);break;case j.LIST_ACTIONS.DELETEPAGE:((e,t,n)=>{jg.setIn(e[t],n,{})})(e,s,u)}}))})),ZI=[UI,LI,JI,QI],ey=(e,t)=>(e||(e=iy().data),t.type===tt?iy().data:(ZI.forEach((n=>{e=n(e,t)})),e)),ty={},ny=(e,t=[])=>{t.forEach((t=>{jg.deleteIn(e,[t])}))},ry=(e,t)=>{const{type:n,payload:r}=t,s=n===xe,{target:a,context:o,semanticURL:i="",root:c,containerItemID:l,childContainers:u,flowName:d,resourceType:p="",key:h="",clearView:g=!1}=r;return c?jg.setIn(e,[a,"items",l,"view"],c):g&&jg.deleteIn(e,[a,"items",l,"view"]),o&&jg.setIn(e,[a,"items",l,"context"],o),d&&jg.setIn(e,[a,"items",l,"flowName"],d),(!s||s&&h)&&jg.setIn(e,[a,"items",l,"key"],h.trim()),((e,t,n,r)=>{""===e&&jg.deleteIn(t,[n,"items",r,"key"])})(h,e,a,l),(!s||s&&i)&&jg.setIn(e,[a,"items",l,"semanticURL"],i),(!s||s&&p)&&jg.setIn(e,[a,"items",l,"resourceType"],p),ny(e,u),e},sy=uI(ty,(e=>{e.addCase(tt,(()=>ty)).addCase(Ae,((e,t)=>{const{context:n,name:r,type:s,actionMgrID:a}=t.payload,o=`${n}/${r}`;if(rc.resolveActionByID(a,null,!1),e[o])return e;jg.setIn(e,[o],{type:s,accessedOrder:[],items:{}})})).addCase(Fe,((e,t)=>{const{containerName:n,childContainers:r=[]}=t.payload;jg.deleteIn(e,[n]),r.forEach((t=>{jg.deleteIn(e,[t])}))})).addCase(_e,((e,t)=>{const{context:n,name:r,actionMgrID:s,childContainers:a}=t.payload,o=`${n}/${r}`;rc.resolveActionByID(s,null,!1),jg.setIn(e,[o,"accessedOrder"],[]),jg.setIn(e,[o,"items"],{}),Array.isArray(a)&&a.forEach((t=>{jg.deleteIn(e,[t])}))})).addCase(Ce,((e,t)=>{const{target:n,context:r,isInCreateStage:s,isBulkAction:a,semanticURL:o,root:i,containerItemID:c,actionMgrID:l,key:u,flowName:d,resourceType:p,actionName:h,isMinimizable:g,showProgress:f,progressMessage:m,modalOptions:I,resourceStatus:y,actionID:E,isMultiRecordData:A,acTertiary:_,parentContext:C,heading:S,isTraditionalRemoteCase:T,readOnly:N,referenceList:O,subscriptName:P,subscriptFieldName:D,pageGroupName:R,isPageGroup:b,index:v}=t.payload,x=e[n],M=x&&x.type,L=x&&x.accessedOrder||[],F=x&&x.items||{};if(e[n]&&"single"===M&&L.length>0)return ry(e,t);const U={accessedOrder:[...L,c],items:{...F,[c]:{view:i,semanticURL:o,key:u,flowName:d,readOnly:N,context:r,isInCreateStage:s,resourceType:p,actionName:h,isMinimizable:g,...a&&{isBulkAction:a},showProgress:f,progressMessage:m,modalOptions:I,isTraditionalRemoteCase:T,resourceStatus:y,referenceList:O,subscriptName:P,subscriptFieldName:D,pageGroupName:R,isPageGroup:b,index:v,...E&&{actionID:E},..._&&{acTertiary:_},...A&&{isMultiRecordData:A},...C&&{parentContext:C},heading:S}}};rc.resolveActionByID(l,null,!1),e[n]=w()(e[n],U)})).addCase(xe,((e,t)=>{const{actionMgrID:n,data:r}=t.payload;try{ry(e,t),rc.resolveActionByID(n,r,!1)}catch{rc.rejectActionByID(n,!1)}})).addCase(Me,((e,t)=>((e,t)=>{const{actionMgrID:n,data:r,target:s,containerItemID:a}=t.payload;let o=e;try{const i=e&&e[s]?.type;let c=e&&e[s]?.accessedOrder||[];c="single"===i?c.length>0?c:[...c,a]:c.includes(a)?c:[...c,a],jg.setIn(e,[s,"items",a,"transientItems"],[]),jg.setIn(e,[s,"accessedOrder"],c),o=ry(e,t),rc.resolveActionByID(n,r,!1)}catch{rc.rejectActionByID(n,!1)}return o})(e,t))).addCase(ve,((e,t)=>{const{target:n,containerItemID:r,actionMgrID:s}=t.payload;try{const t=jg.getIn(e,[n,"accessedOrder"]).filter((e=>e!==r));t.push(r),jg.setIn(e,[n,"accessedOrder"],t),rc.resolveActionByID(s,null,!1)}catch{rc.rejectActionByID(s,!1)}})).addCase(we,((e,t)=>{const{target:n,containerItemID:r,actionMgrID:s,childContainers:a}=t.payload;try{const t=jg.getIn(e,[n,"accessedOrder"]).filter((e=>e!==r));jg.setIn(e,[n,"accessedOrder"],t),jg.deleteIn(e,[n,"items",r]),ny(e,a),rc.resolveActionByID(s,null,!1)}catch{rc.rejectActionByID(s,!1)}})).addCase(Se,((e,t)=>{const{target:n,containerItemID:r,actionMgrID:s,childContainers:a}=t.payload;try{const t=jg.getIn(e,[n,"accessedOrder"]).filter((e=>e!==r));jg.setIn(e,[n,"accessedOrder"],t),jg.deleteIn(e,[n,"items",r]),ny(e,a),rc.resolveActionByID(s,null,!1)}catch{rc.rejectActionByID(s,!1)}})).addCase(Te,((e,t)=>{const{transientItemID:n,target:r,contextName:s}=t.payload,a=jg.getIn(e,[r,"items",s,"transientItems"])??[];jg.setIn(e,[r,"items",s,"transientItems"],[...a,n])})).addCase(Pe,((e,t)=>{const{target:n,containerItemID:r}=t.payload;jg.deleteIn(e,[n,"items",r,"transientItems"])})).addCase(Oe,((e,t)=>{const{target:n,transientItemID:r,containerItemID:s}=t.payload,a=(jg.getIn(e,[n,"items",s,"transientItems"])??[]).filter((e=>e!==r));jg.setIn(e,[n,"items",s,"transientItems"],a)}))})),ay=sy;let oy={};const iy=()=>oy,cy=e=>((e=>{const t=e.Data||e.data,{uiResources:n={}}=e,r=n[j.CONTEXT_DATA]||e[j.CONTEXT_DATA];oy={data:{[j.APP.APP]:{...t,[j.CONTEXT_DATA]:r}},containers:{}}})(e),{data:ey,containers:ay});function ly(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=au(e),r=function(e,t){return"number"==typeof su(e)?e.pop():t}(e,1/0),s=e;return s.length?1===s.length?Na(s[0]):function(e){return void 0===e&&(e=1/0),nu(ga,e)}(r)(La(s,n)):iu}const uy=(e,t=!1)=>e===j.ACTION?t?Hu.REFRESH_CASE_DATA:Hu.REFRESH_ASSIGNMENT_DATA:Hu.REFRESH_CASE_VIEW,dy=e=>{const{context:t}=e;let n={...qc(t).content,contextData:!1};const r=pl(t);jg.isEmpty(r)||(n=dl(r,n));const s=uy(e.editType,e.isLocalAction),{restApi:a,reqType:o}=$f(s,{ID:e.isLocalAction||e.editType!==j.ACTION?e.ID:e.assignmentID,actionID:e.actionID,viewID:e.viewID});let i=a;return e.editType===j.ACTION&&(i+=`?operation=${e.operationFlag}`,n.interestPageActionID=e.interestPageActionID),n.interestPage=e.interestPage,La(Bo(i,{method:o,body:n,headers:e.headers},t)).pipe(tu((t=>({actionInPayload:e,response:t.data,headers:Hc(t.headers)}))),lu(": Error occurred during ajax call : ",t))},py={},{VIEW:hy,FIELD:gy}=j.CONTEXT_TREE_NODE_TYPES,fy=(e,t,n)=>{const r=t.value.data[n]?.objectInfo?.headers,s=t.value.data[n]?.caseInfo?.headers;return e&&r?r:s},my=e=>(e=>Mo[e])(e)>0&&py[e],Iy=(e,t)=>{const{caseWideAction:n,caseViewAction:r,fieldsWithDeclarativeTargets:s,fieldsWithWhen:a,isViewsWithWhen:o,interestPage:i,options:c,isMultiRecordData:l,editType:u,isLocalAction:d,interestPageActionID:p}=e,{optionalPayload:h}=c;h&&(t.content={...h});let g={},f={...t},m=Hu.REFRESH;if(r||l&&u===j.ACTION){const t=uy(u,d);l&&u===j.ACTION&&(f.interestPageActionID=p),g=$f(t,e),f={...f,interestPage:i}}else o?g=((e,t)=>{const{isObjectType:n,isExternalObject:r,actionID:s,context:a}=e;if(t||n&&Bd(a))return $f(r&&"Create"===s?Hu.REFRESH_EXTERNAL_OBJECT:Hu.REFRESH_CASE_DATA,e);return $f(Hu.REFRESH_ASSIGNMENT_DATA,e)})(e,n):(s.length>0||a.length>0)&&({restAPI:g,requestBody:f,requestType:m}=((e,t,n,r,s)=>(s={...s,calculations:{fields:t,whens:n}},{restAPI:$f(r?Hu.RECALCULATE_CASE_DATA:Hu.RECALCULATE_ASSIGNMENT_DATA,e),requestBody:s,requestType:Hu.RECALCULATE}))(e,s,a,n,f));return{restAPI:g,requestBody:f,requestType:m}},yy=[(e,t)=>e.pipe(Zl(Hu.REFRESH_DATA,It),tu((e=>e.payload)),nu((e=>{const{context:n,contextData:r,options:s,isObjectType:a}=e,{propertyName:o="",classID:i="",isObjectWideAction:c}=s,l=qc(n,{skipUUID:a,isObjectWideAction:c});let u=[],d=[],p=!1;Dh.getFeatureMap().granularUIRefresh?(({fieldsWithDeclarativeTargets:u=[],whens:d=[]}=zd(n)),p=d.some((e=>e.type===hy))):p=!0;const h=d.filter((e=>e.type===gy)),g=jg.getPropertyName(o),f=g?g.split("."):[],m=f.pop(),I=f.join("."),y=[];I&&((e,t,n,r,s)=>{const a=qh(e,t);if(!a||"copy"!==a.dataRetrievalType)return;const o=jg.getIn(n,`content.content.${e}`);if(!o||"object"!=typeof o)return;const i=r?Object.keys(o).filter((e=>e!==r)):Object.keys(o);i.length>0&&(i.forEach((e=>delete o[e])),s.push(e))})(I,i,l,m,y),e.serverPrecedenceFields=y;let E={...l.content,contextData:r};const A=pl(n);jg.isEmpty(A)||(E=dl(A,E));const _=Iy({...e,fieldsWithDeclarativeTargets:u,fieldsWithWhen:h,isViewsWithWhen:p},E);zu.registerBlockingAction(n).catch((()=>{}));const{restAPI:C,requestBody:S,requestType:T}=_;(e={...e,requestType:T}).requestType=T;const{reqType:N,restApi:O}=C,P={...fy(a,t,n)};P&&!P.etag&&e.isMultiRecordData&&e.editType===j.ACTION&&(P.etag=jg.getETag(e.context));return La(((e,t)=>{const{context:n}=e;(e=>{const{reqHeaders:t}=e;t&&(e.headers=e.headers||{},t.etag&&(e.headers["if-match"]=t.etag))})(e);const r=(e=>{const{ID:t,actionID:n,context:r}=e;return`${t}.${r}.${n}`})(t);if(my(r)){const t=[];for(let n=0;n<py[r].length;){const s=py[r][n],a=qd(s,e);if("CANCEL_REFRESH"===a){const e=new Error;return e.code="ERR_CANCELED",Promise.reject(e)}!0===a&&(t.push(n),s.cancelConfig?.cancel()),n+=1}t.forEach((e=>{py[r].splice(e,1)}))}const s=Ho();return e.signal=s.token,e.cancelConfig=s,py[r]?py[r].push(e):py[r]=[e],yo.publish(j.ON_REFRESH_START,{context:n}),Bo(e.url,e,n,{cancelContext:r}).then((e=>(delete py[r],e))).catch((e=>{throw e&&"ERR_CANCELED"!==e.code&&delete py[r],e}))})({reqHeaders:P,context:n,method:N,body:S,url:Hd(e,O)},e)).pipe(tu((t=>{const r=((e,t,n)=>{if(!Rl.isObjectCaseType(t)&&!n)return e;const r=jg.getIn(e?.data,U.OBJECT_INFO.OBJECT_INFO_CONTENT_CLASS_ID);return Rl.isExternalObject(r)?e:F.transformCaseData(e)})(t?.data,s?.classID,a);return s?.resetForm&&eo.removeContextTreeNode(n),{response:{...r},actionConfig:e,actionMgrID:e.options.actionMgrID,headers:Hc(t.headers)}})),lu(": Error occurred during fetch call at refreshData Epic : ",e.context,e?.options?.actionMgrID))})),nu((async e=>{if(e&&e.type===Ee)return yo.publish(j.ON_REFRESH_ERROR,{context:e.payload?.context}),zu.deRegisterBlockingAction(e.payload?.context).catch((()=>{})),Qc(e);const{actionConfig:t,response:n,actionMgrID:r}=e,{context:s,serverPrecedenceFields:a,requestType:o}=t,i=ac.getTargetViewContainerName(je),c=Pt(i,s),l={acName:c,context:s},u=Ed(n,{[U.STOPMERGEACTIONS]:!0,[U.ACTIONS.DELETEAVIALACTIONS]:!0});u.directUrlUpdation=!1,o===Hu.REFRESH&&await Yc(u,t,l);const d={target:c,context:s};let p=fl.getStateMachinesByContext(s)||{};const h=zc(u,d);p={...p,...fl.getUnConnectedStateMachines(s)||{}},Object.keys(p).forEach((e=>{if(jg.hasIn(h.data,e)){const t=jg.getIn(h.data,e),n=Og(e,void 0,s),r=eo.getContextReferences(s)?.get(e);Array.isArray(t)&&Array.isArray(n)&&n.length!==t.length&&"Multiselect"!==r?.props?.componentName&&fl.setStateMachineEmpty(s,e)}})),h.isArrayDeepMerge=t.options?.isArrayDeepMerge,h.preserveClientChanges=void 0===t.options?.preserveClientChanges||t.options.preserveClientChanges;const g=Rl.getPropertiesToReArrange(s),f=Cf(Yg,h,{serverPrecedenceFields:a,propertiesToReArrange:g});return fl.registerForServerChanges(),Cg(f),rc.resolveActionByID(r,h),fl.unRegisterForServerChanges(),zu.deRegisterBlockingAction(s).catch((()=>{})),yo.publish(j.ON_REFRESH_COMPLETE,{context:s}),[]})))],Ey=yy,Ay=[e=>e.pipe(Zl(nt),nu((async e=>{const{context:t}=e.payload,n={},r={},s=Object.keys(e.payload.datapages).map((s=>{const a=e.payload.datapages[s];if(a.mode===j.READONLY&&a?.refreshStrategy){const{timeoutSecs:e="",type:t=""}=a?.refreshStrategy||{},n=Tg()[a.name];if(n&&s in n){const r=n[s],{loadTime:a}=r;if(!yu.isTimeElapsed(a,e,t))return}}return yu.getData(a.name,{dataViewParameters:a.dataViewParameters},t).then((e=>{const t=a.mode===j.READONLY?r:n;t[a.name]?t[a.name][s]={pxResults:e.data.data,parameters:a.dataViewParameters,loadTime:e.data?.fetchDateTime}:t[a.name]={[s]:{pxResults:e.data.data,parameters:a.dataViewParameters,loadTime:e.data?.fetchDateTime}}})).catch((()=>{}))}));await Promise.allSettled(s);const a=[];return Object.keys(n).length&&a.push(Yg({context:t,data:n})),Object.keys(r).length&&a.push(Tf({data:r,context:t})),Cg(a),[]})))],_y=Ay;class Cy{static OPEN_ASSIGNMENT_ACTION="openAssignment";static DIRTY_POPUP_C11N="displayDirtyPopupFromConstellation";static HANDLE_INFINITY_DISCARD="handleDiscardInInfinity";static OPEN_ASSIGNMENT_MODAL="openAssignmentInModal";static DISPLAY_DIRTY_POPUP="displayDirtyPopup";static LOAD_PREVIEW="loadPreview";static UPDATE_COEXISTENCE_DRILLDOWN_CASE="updateCoexistenceDrilldownCase";static OPEN_WORK_ITEM="openWorkItem";static OPEN_WORK_BY_HANDLE="openWorkByHandle";static GET_NEXT_WORK_ACTION="getNextWork";static CLOSE_CONTAINER_ACTION="closeContainer";static CANCEL_CASE="cancelCase";static CREATE_WORK="createWork";constructor(){this.broadcastChannel=null,this.callback=null,this.isReverseCoexistenceCase=!1,this.broadcastEventToIframe=!1,this.isDirtyDialogActive=!1,this.onCreateCallback=null,this.openAssignmentParams=null}getGlobalObject=()=>s.g;getUniqueId=()=>this.getGlobalObject().uniqueId;setUniqueId=()=>{this.getGlobalObject().uniqueId=(new Date).getTime()};initBroadcastChannel=()=>{this.setUniqueId(),this.broadcastChannel=new BroadcastChannel("coexistence"),this.broadcastChannel.onmessage=e=>{switch(e.data.action){case Cy.DISPLAY_DIRTY_POPUP:this.displayDirtyPopup(e);break;case Cy.LOAD_PREVIEW:this.loadPreview(e);break;case Cy.UPDATE_COEXISTENCE_DRILLDOWN_CASE:this.updateCoexistenceDrilldownCase(e);break;case Cy.OPEN_ASSIGNMENT_ACTION:this.openAssignment(e);break;case Cy.GET_NEXT_WORK_ACTION:this.getNextWork(e);break;case Cy.OPEN_WORK_BY_HANDLE:this.openWorkByHandle(e);break;case Cy.CLOSE_CONTAINER_ACTION:this.closeContainer(e);break;case Cy.CANCEL_CASE:this.handleCaseCancel();break;case Cy.CREATE_WORK:this.createWork(e)}}};displayDirtyPopup=e=>{this.broadcastEventToIframe=e.data.fromInfinity,this.isDirtyDialogActive||(e.data.isFormDirty?(yo.publish(j.PUB_SUB_EVENTS.EVENT_SHOW_CANCEL_ALERT,{isModalAction:!0,hideDelete:!0}),this.isDirtyDialogActive=!0):this.callback?.call(this))};handleCaseCancel=()=>{const e=Mp(U.APP.APP),t=e[e.length-1],n=Dp(t),r=Sg(n)?.caseInfo?.ID;if(r&&n&&vd({}).getPConnect().getActionsApi().getDescendants(r,n),wc(n)){const e=hh(n);e&&vd({}).getPConnect().getActionsApi().getDescendants(r,e)}};loadPreview=e=>{const{pyID:t,caseClassName:n,uniqueId:r}=e.data;if(r===this.getUniqueId()){vd({}).getPConnect().getActionsApi().showCasePreview(t,{caseClassName:n})}};navigateToDefaultPage=()=>{const e=vd({isRoot:!0}),t=PCore.getStore()?.getState().data.app?.pyPortal?.pyPrimaryNavPages;let n;Array.isArray(t)&&t[0]&&(n=t[0]);const r=n?.pyClassName||"Data-Portal",s=n?.pyRuleName||"pyHome";e.getPConnect().getActionsApi().showPage(s,r)};closeContainer=e=>{const{uniqueId:t}=e.data;t===this.getUniqueId()&&this.navigateToDefaultPage()};updateCoexistenceDrilldownCase=e=>{const{key:t,caseClassName:n,actionApi:r,caseLabel:s}=e.data;let a=r;r===Cy.OPEN_WORK_ITEM&&(a=Cy.OPEN_WORK_BY_HANDLE),Ph.updateSemanticURLAndDocumentTitle({key:t,caseClassName:n,actionName:a});vd({}).getPConnect().getActionsApi().updateRecents(n,t.substring(t.lastIndexOf(" ")+1),s,t)};openAssignment=e=>{const{pzInsKey:t,caseClassName:n,uniqueId:r}=e.data;if(r===this.getUniqueId()){if(this.onCreateCallback&&this.openAssignmentParams&&(t&&this.openAssignmentParams[0]&&this.openAssignmentParams[0].payload&&this.openAssignmentParams[0].payload.data?this.openAssignmentParams[0].payload.data.caseInfo.assignments[0].ID=t:this.openAssignmentParams[0]&&this.openAssignmentParams[0].payload&&this.openAssignmentParams[0].payload.data&&(this.openAssignmentParams[0].payload.data.caseInfo.content.coexistenceAction="openWorkByHandle"),t)){vd({}).getPConnect().getActionsApi().openAssignment(t,n,{containerName:U.PRIMARY,context:U.APP.APP})}this.onCreateCallback=null,this.openAssignmentParams=null}};getNextWork=e=>{const{uniqueId:t}=e.data;if(t===this.getUniqueId()){const e=`${U.APP.APP}${j.FORWARD_SLASH_STRING}${U.PRIMARY}`;vd({meta:{},options:{context:xp(e)}}).getPConnect().getActionsApi().getNextWork()}};openWorkByHandle=e=>{const{key:t,caseClassName:n,uniqueId:r}=e.data;if(r===this.getUniqueId()){const e=`${U.APP.APP}${j.FORWARD_SLASH_STRING}${U.PRIMARY}`;vd({meta:{},options:{context:xp(e)}}).getPConnect().getActionsApi().openWorkByHandle(t,n)}};createWork=e=>{const{strClassName:t,uniqueId:n,strFlowParams:r,caseInitProperties:s}=e.data;if(n===this.getUniqueId()){const e=`${U.APP.APP}${j.FORWARD_SLASH_STRING}${U.PRIMARY}`,n=vd({meta:{},options:{context:xp(e)}}),a=new URLSearchParams((s+r).slice(1)),o=this.setStartingFields(a);n.getPConnect().getActionsApi().createWork(t,{startingFields:o})}};setStartingFields=e=>{const t={};return e.forEach(((e,n)=>{n&&(t[n]=e)})),t};destroyBroadcastChannel=()=>{this.getBroadCastChannel()?.close(),this.broadcastChannel=null};subscribeEvents=()=>{this.setReverseCoexistenceCaseLoaded(!0),yo.subscribe(U.PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.HANDLE_DISCARD,this.handleDiscard),yo.subscribe(U.PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.CHECK_IS_FORM_DIRTY,this.postDirtyPopupMessage)};unsubscribeEvents=()=>{yo.unsubscribeAllWithEventType(U.PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.CHECK_IS_FORM_DIRTY),yo.unsubscribeAllWithEventType(U.PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.HANDLE_DISCARD),this.setReverseCoexistenceCaseLoaded(!1),this.isDirtyDialogActive=!1};init=(e=!0)=>{null===this.broadcastChannel&&this.initBroadcastChannel(),e&&this.subscribeEvents()};destroy=()=>{this.destroyBroadcastChannel(),this.unsubscribeEvents()};setCallBackFunction=e=>{this.callback=e};setReverseCoexistenceCaseLoaded=e=>{this.isReverseCoexistenceCase=e};setIsDirtyDialogActive=e=>{this.isDirtyDialogActive=e};getBroadCastChannel=()=>this.broadcastChannel;getCallBackFunction=()=>this.callback;isReverseCoexistenceCaseLoaded=()=>this.isReverseCoexistenceCase;postDirtyPopupMessage=({callBackFunction:e})=>{this.broadcastChannel?.postMessage({action:Cy.DIRTY_POPUP_C11N,uniqueId:this.getUniqueId()}),this.setCallBackFunction(e)};handleDiscard=()=>{this.broadcastEventToIframe?(this.broadcastChannel?.postMessage({action:Cy.HANDLE_INFINITY_DISCARD,uniqueId:this.getUniqueId()}),this.broadcastEventToIframe=!1):(this.callback?.call(this),this.callback=null),this.isDirtyDialogActive=!1};postCreateCaseMessage=(e,t,n)=>{null===this.broadcastChannel&&this.init(!1),this.broadcastChannel?.postMessage({action:Cy.OPEN_ASSIGNMENT_MODAL,uniqueId:this.getUniqueId(),key:e}),this.broadcastEventToIframe=!1,this.onCreateCallback=t,this.openAssignmentParams=n}}const Sy=new Cy,Ty="nextAssignmentInfo",Ny="nextAssignmentInfo.context",Oy=e=>{const{containerName:t,isInCreateStage:n}=e;return n?j.MODAL:t||ac.getTargetViewContainerName(We)},Py=e=>Up(e)?{continueExecution:!0,removeActionPayload:{}}:rl(e),Dy=e=>{const t=jg.getIn(e,[j.DATA,j.CASE_INFO.CASE_INFO]);return vl(t)&&xl(Dh.getOperatorIdentifier(),t)},Ry=(e,t)=>{const{class:n,context:r,viewType:s=Gc.PAGE}=e,{removeActionPayload:a}=t;let o=e?.pageName?e?.pageName:Dh.getDefaultCasePage();return e.isTraditionalUICase&&(o="pyDetails"),La(ki.createCase(n,{...e,pageName:o,viewType:s,context:r})).pipe(tu((({response:t,headers:n})=>(F.analyseResponse(t),{response:t,actionInPayload:e,headers:n,removeActionPayload:a}))),lu("Error occurred during ajax call at createWork Epic : ",r))},by=e=>{yo.publish(j.PUB_SUB_EVENTS.DISPLAY_CASE_CREATED_TOASTER,e)},vy=e=>{yo.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_DONE,e)},xy=e=>{let t=0,n=[],r={},s=!1;return e.pipe(Zl(Hg),uu(100),tu((e=>(({actionMgrID:t}=e.payload),e.payload))),nu((e=>{const{context:n}=e,r=Oy(e),a=Pt(r,n),{continueExecution:o,removeActionPayload:i}=Py(a);return s=Uc(e.class),o?(e.isTraditionalUICase=s,Ry(e,{removeActionPayload:i})):(rc.rejectActionByID(t),cu())})),nu((async e=>{if(e&&e.type===Ee)return e.payload.context=ih(),n.push(Qc(e)),n;const{actionInPayload:a,response:o,headers:i,removeActionPayload:c}=e;let l;l=!(a.renderInline||Dh.getDefaultCasePage()||s)&&Dy(o),jg.setIn(o.data,U.CASE_INFO.IS_FIRST_ASSIGNMENT,!0);const u=Oy({...a,isInCreateStage:l}),d=Pt(u,a.context),p=el(d,u,a.context);if(!Cc(u)&&Up(d)){const{continueExecution:e}=rl(d);if(!e)return rc.rejectActionByID(t),cu()}if(!(a?.openCaseViewAfterCreate??!0)&&!l){const e=vc(o),{businessID:t,caseType:s,resolvedURL:a}=gc(o);return r={id:t,label:s,href:a},by(r),vy({caseId:t,assignmentId:e,caseType:s}),n}const h=Ed(o),g=String(Pc(bc(h)));let f=Vf("createWork",{caseClassName:Dc(h)});f=f.replace(/{.+?}/,g),h.semanticURL=f,tc.setComponentCache(g,xo.addDebugHeaders(a.debugInfo)),((e,t)=>{const n=Dy(e),{skipBrowserSemanticUrlUpdate:r=!1,isTraditionalUICase:s}=t,a=s&&!jc();jg.setIn(e,["directUrlUpdation"],(!n||a)&&!r)})(h,a);const m={acName:d,context:p},I=$c(p);await Yc(h,a,m);const y={target:d,context:p,containerItemID:p,headers:i,semanticURL:f,isInCreateStage:l,isMinimizable:l,caseViewMode:h.confirmationNote?j.REVIEW_MODE:j.PERFORM_MODE,currentCaseViewMode:I,assignmentContext:jg.getIn(h,Ny),nextAssignmentInfo:jg.getIn(h,Ty),resourceType:U.CASE,openCaseViewAfterCreate:a.openCaseViewAfterCreate,modalOptions:a.modalOptions,debugInfo:a.debugInfo};Mc(y,h);const E=zc(h,y);s&&(E.data.caseInfo.content.coexistenceAction="openAssignment");const A=Zc(d,E);return tl(A)&&xc(n,{removeActionPayload:c,target:d}),n.push(A),il(n),n})),tu((()=>{const e=jc(),a=vl(jg.getIn(n[0]?.payload,"data.caseInfo"));return s&&e&&a?Sy.postCreateCaseMessage(n[0]?.payload?.nextAssignmentInfo?.ID,ul,n):ul(n),Fc(n,t),r={},n=[],n})))},{RESOURCE_TYPES:wy}=U,My=(e,t=[])=>{const{viewType:n,containerName:r,targetContainerName:s,isChild:a}=e,o=Oc(t);return(e=>{if(e){const{stageID:t,stages:n=[]}=e,r=n.length;for(let e=0;e<r;e+=1)if(n[e].ID===t)return"manual"===n[e].transitionType}return!1})(o)&&e?.stageID===o.stageID?Gc.PAGE:n||(!_c(r)&&!_c(s)||a?Gc.PAGE:Gc.FORM)},Ly=(e,t,n,r,s)=>{if(xc(e,{removeActionPayload:t,target:n}),((e,t)=>{const n=Dp(t);let r=null;return n&&(r=yp(t,n)),r?.key===e&&jp(t)})(r.key,n))r.context=xp(n),r.containerItemID=r.context,e.push(Cf(yf,r));else if((s?.isChild||s?.isRemote)&&s?.isMultiDoc){const t=qp(s.context);r.target=t,r.context=s.context,r.containerItemID=s.context,e.push(Cf(yf,r))}else{const t=qp(r.context),n=Sp(t,r.key);n?(r.target=t,r.context=n,r.containerItemID=n,e.push(Cf(yf,r))):e.push(Cf(nf,r))}},Fy=(e,t,n,r,s,a,o)=>{Up(t)&&Vp(t)?((e,t,n,r,s)=>{My(e,t)===Gc.FORM?(n.caseViewMode=r||j.PERFORM_MODE,s.push(Cf(lf,n))):s.push(Cf(yf,n))})(r,s,e,a,n):Ly(n,o,t,e,r)},Uy=({restUrl:e,reqType:t,requestHeaders:n,debugInfo:r,context:s,isGetNextWork:a,doNotMergeMessagesForStatusCode:o})=>Bo(e,{method:t,headers:{"if-match":n&&n.etag,...n,...r&&{...xo.addDebugHeaders(r)}}},s,{doNotMergeHttpMessagesForStatusCode:a?o:""}),jy=(e,t)=>{const n=My(e),{headers:r,context:s,assignmentID:a,isGetNextWork:o,debugInfo:i,isOpenStage:c,stageID:l,caseID:u,jsActionQueryParams:d,isLastStepInCreateStage:p}=e;let h,g;({restApi:h,reqType:g}=o?$f("getNextWork",{viewType:n}):c?$f("openStage",{caseID:u,stageID:l}):$f(Ge,{assignmentID:a,viewType:n}));const{removeActionPayload:f}=t,m=Dh.getDefaultCasePage();let I="",y=e.pageName;e.isTraditionalUICase&&(y="pyDetails"),I=m?`${h}?viewType=${n}&pageName=${m}`:y?`${h}?viewType=${n}&pageName=${y}`:`${h}?viewType=${n}`,d&&Object.keys(d).forEach((e=>{I+=`&${e}=${d[e]}`}));const E=(e=>{let t=e?.headers??{};return e?.isRemote&&(t=Hc(t,e.remoteClassName)),t})(e);return La(Uy({restUrl:I,reqType:g,requestHeaders:E,debugInfo:i,context:s,isGetNextWork:o,doNotMergeMessagesForStatusCode:"404"})).pipe(tu((e=>{if(Dh.isCoexistenceAppOfType(j.APP_TYPE.UIKIT)&&!p){return vl(e.data.data.caseInfo)?e:(I=y?I.replaceAll(y,"pyDetails"):I,Dh.setDefaultCasePage("pyDetails"),{isReloadWithDifferentViewTypeRequired:!0,restUrl:I})}return e})),nu((e=>e?.isReloadWithDifferentViewTypeRequired?Uy({restUrl:I,reqType:g,requestHeaders:E,debugInfo:i,context:s,isGetNextWork:o,doNotMergeMessagesForStatusCode:"404"}):ou(e))),tu((t=>{const{key:s,flowName:o}=Jc(a);return F.analyseResponse(t),{response:{...t.data,key:s,flowName:o},actionInPayload:e,viewType:n,removeActionPayload:f,headers:Hc({...r,...t.headers})}})),lu("Error occurred during ajax call at openAssignment Epic : ",s))},{RESOURCE_TYPES:Vy}=U,ky=e=>{const t="Browser"===Dh.getRuntime();let n=0,r=[];const s=[];let a=!1,o=!1;return e.pipe(Zl(Bl),tu((e=>(({actionMgrID:n}=e.payload),{...e.payload,...t?{insKey:e.payload.assignmentID}:{assignmentID:e.payload.assignmentID}}))),nu((e=>{a=e.isGetNextWork;const{context:t}=e;let r;r=(e?.isChild||e?.isRemote)&&e?.isMultiDoc?Gc.FORM:My(e),e.viewType=r;const s=Ec(Ge,e),i=Pt(s,t),{activate:c,activateContainerActionPayload:l}=al(Vy.ASSIGNMENT,i,e);if(c&&!e.isParallelCall)return ou({type:ve,activateContainerActionPayload:l,actionInPayload:e});const u=Dp(i);let d;d=l?.isParallelAssignment?{continueExecution:!0,removeActionPayload:{}}:u?rl(i):{continueExecution:!0,removeActionPayload:{}};const{continueExecution:p,removeActionPayload:h}=d;return p?(o=Uc(e.className),e.isTraditionalUICase=o,jy(e,{removeActionPayload:h})):(rc.rejectActionByID(n),cu())})),nu((async e=>{if(e?.type===Ee){if(a){const{payload:t}=e,{err:n}=t,r=n.response.status;s.push({status:Number(r)})}return r.push(Qc(e)),r}const{type:t,actionInPayload:n,response:i,viewType:c,headers:l,removeActionPayload:u,activateContainerActionPayload:d}=e;if("openStage"===i?.redirectInfo?.jsAction){const e=i?.redirectInfo?.stageID,t=Bl,s=i?.data?.caseInfo?.ID;n.isOpenStage=!0,n.stageID=e,n.jsActionQueryParams=i?.redirectInfo?.jsActionQueryParams;const a={type:t,payload:{...n,caseID:s,headers:l}};return r.push(a),r}const{context:p,caseViewMode:h,debugInfo:g}=n,f=i?.data?.caseInfo?.caseTypeID;o=Uc(f),n.isTraditionalUICase=o;let m=((e,t)=>{const n=Oc(e);let r;r=!Dh.getDefaultCasePage()&&vl(n);const{isChild:s,containerName:a,isTraditionalUICase:o}=t,i=s&&r,c=r&&!t.isActionFromToDoList;return!i&&!c||o?a||Ec(Ge,t):j.MODAL})(i,n);o&&(m=n.containerName??m);const I=Pt(m,p);if(t===ve)return await(async(e,t,n)=>{const{semanticURL:r,containerItemID:s,isParallelAssignment:a,insKey:o}=t,{target:i,actionInPayload:c}=n,{skipBrowserSemanticUrlUpdate:l=!1}=c,u=vp(s);await Yc({directUrlUpdation:!l,semanticURL:r},c,{acName:i,target:i,context:u}),e.push(Cf(hf,{containerItemID:s,target:i,isParallelAssignment:a,insKey:o,resourceType:wy.CASE,context:u,doDeleteCaseSummary:c.doDeleteCaseSummary}))})(r,d,{actionInPayload:n,target:I}),il(r),r;const y=i?.data?.caseInfo?.content,E=i?.data?.caseInfo?.ID,A=i?.uiResources?.root?.config?.name,_=i?.uiResources?.root?.config?.context;y&&!y.pyViewName&&A&&"page"!==n.viewType&&(jg.setIn(y,"pyViewName",A),jg.setIn(y,"pyViewContext",_));const C=Ed(i);((e,t)=>{const n=Oc(e),r=bc(e),s=vl(n),{skipBrowserSemanticUrlUpdate:a=!1,viewType:o,isTraditionalUICase:i}=t,c=i&&!jc(),l=o===Gc.PAGE&&(!s||c)&&!a,{caseTypeID:u}=n;if(l){const t=Vf(Be,{caseClassName:u}).replace(/{.+?}/,String(Pc(r)));e.semanticURL=t,e.directUrlUpdation=!0}})(C,n);const S=el(I,m,p),T=n.debugInfo||{};T?.debugId||(T.debugId=xo.getCoreHeadersFromContext(p)?.debugInfo?.[j.COREHEADER_APP_DEBUG_ID]),tc.setComponentCache(E,xo.addDebugHeaders(T));const N={acName:I,target:I,context:S};await Yc(C,n,N);const O={target:I,context:S,containerItemID:S,headers:l,parentContext:W(n?.context),isMinimizable:vl(jg.getIn(C,"data.caseInfo")),doDeleteCaseSummary:n.doDeleteCaseSummary,acTertiary:n.acTertiary,resourceType:U.ASSIGNMENT,debugInfo:g};Mc(O,C,{skipFlowNameUpdate:n?.caseViewMode===j.REVIEW_MODE});const P=zc(C,O);return n.isProcessAction&&(P.data.isProcessAction=n.isProcessAction),o&&(P.data.caseInfo.content.coexistenceAction="openAssignment"),((e,t)=>{e.acTertiary&&(t.data.caseInfo.isFirstAssignment=e.acTertiary)})(n,P),Fy(P,I,r,n,i,h,u),((e,t)=>{if(e=$.getRemoteCaseClassBySourceClass(e)??e,$.isRemoteCase(e)){const{RemoteClassName:n,RemoteSystemID:r,name:s}=$.getRemoteCase(e);if(t.headers?.RemoteSystemID||rc.setRemoteCaseHeaderByContext(t,r),$.isTraditionalRemoteCase(e)){t.assignmentID=t.assignments?.[0]?.ID;const r={className:e,name:s,action:Et,remoteClassName:n};rc.setTraditionalRemoteCaseParams(t,r)}}})(f,P.data.caseInfo),c===Gc.FORM&&wc(P.containerItemID)&&ll(P,r,_),il(r),(e=>{yo.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_OPENED,e)})({actionInContext:p,assignmentID:n.assignmentID,caseKey:P.key}),r})),tu((()=>{const e=n,t=jc(),a=vl(jg.getIn(r[0]?.payload,"data.caseInfo"));return o&&t&&a?Sy.postCreateCaseMessage(r[0]?.payload?.data?.caseInfo?.assignments?.[0]?.ID,Cg,r):Cg(r),Fc(r,e,s),r[0]?.payload?.isParallelAssignment&&Cg({type:Bl,payload:{...r[0].payload,isParallelCall:!0}}),r=[],r})))},$y=(e,t)=>{const{insKey:n,headers:r,context:s,debugInfo:a,viewType:o}=e,{removeActionPayload:i}=t,c=e?.pageName?e?.pageName:Dh.getDefaultCasePage(),l=$f(Be,{caseID:n,params:{pageName:c}});let{restApi:u}=l;const{reqType:d}=l;return"none"===o&&(u=`${u?.split("viewType")[0]}viewType=none`),La(Bo(u,{method:d,headers:{...r,...a&&{...xo.addDebugHeaders(a)}}},s)).pipe(tu((t=>(F.analyseResponse(t),{response:t.data,actionInPayload:e,headers:Hc({...r,...t.headers}),removeActionPayload:i}))),lu("Error occurred during ajax call at openWorkByHandle Epic : ",s))},By="OPEN_WORK_BY_HANDLE",{RESOURCE_TYPES:Gy}=U,Wy=async(e,t,n)=>{const{actionInPayload:r,activateContainerActionPayload:s,type:a,response:o,removeActionPayload:i,headers:c}=e,{context:l,skipBrowserSemanticUrlUpdate:u,debugInfo:d}=r,p=Ec(Be,r),h=Pt(p,l);if(Sc(a))await(async(e,t)=>{const{activateContainerActionPayload:{semanticURL:n,containerItemID:r},actionInPayload:s,actionInPayload:{context:a,skipBrowserSemanticUrlUpdate:o,doDeleteCaseSummary:i}}=t,c=Ec(Be,s),l=Pt(c,a),u=vp(r);await Yc({directUrlUpdation:!o,semanticURL:n},s,{acName:l,containerName:c,target:l,context:u}),e.push(Cf(hf,{containerItemID:r,target:l,context:u,doDeleteCaseSummary:i}))})(t,{activateContainerActionPayload:s,actionInPayload:r});else{const s=el(h,p,l,{buildNew:!0}),a=Ed(o),g=((e,t)=>{const{isRemoteCase:n,remoteCaseClass:r}=t,s=bc(e),a=n?r:Dc(e);let o=Vf(Be,{caseClassName:a},{id:t?.insKey});return o=o?.replace("{workID}",String(Pc(s)))?.replace("{id}",t?.insKey),o})(a,r);a.semanticURL=g,a.directUrlUpdation=!u;const f={acName:h,context:s};await Yc(a,r,f);const m=zc(a,{target:h,context:s,containerItemID:s,semanticURL:g,headers:c,debugInfo:d});m.caseViewMode=j.REVIEW_MODE,m.resourceType=Gy.CASE,n&&(m.data.caseInfo.content.coexistenceAction="openWorkByHandle"),Mc(m,a,{skipFlowNameUpdate:!0}),m.currentCaseViewMode=$c(e?.actionInPayload?.context);const I=Zc(h,m);i.containerItemID&&tl(I)&&t.push(Cf(ff,{containerItemID:i.containerItemID,target:h})),t.push(I)}il(t);const g=r.insKey;Ic({caseKey:g,actionInContext:l})},Hy=e=>{let t=0,n=[];return e.pipe(Zl(By),tu((e=>(({actionMgrID:t}=e.payload),e.payload))),nu((e=>{const{context:n,isChild:r,viewType:s}=e,a=Ec(Be,e),o=Pt(a,n);let i,c=!0;if("none"!==s){const e=rl(o);c=e.continueExecution,i=e.removeActionPayload}if(!c)return rc.rejectActionByID(t),cu();const{activate:l,activateContainerActionPayload:u}=al(Gy.CASE,o,e);return l&&!r&&"none"!==s?ou({type:ve,activateContainerActionPayload:u,actionInPayload:e}):$y(e,{removeActionPayload:i})})),nu((async e=>{if(e&&Tc(e.type))return n.push(Qc(e)),n;const t=Sg(e?.actionInPayload?.context),r=Uc(e?.actionInPayload.className);if("none"===e?.actionInPayload?.viewType){if("perform"!==t?.context_data?.caseViewMode){const t=Ed(e?.response),s={data:{...t?.data},context:e?.actionInPayload?.context,isArrayDeepMerge:!0};n.push({type:ot,payload:{context:s.context,doDeleteConfirmationDetails:!1}}),r&&s.data.caseInfo?.content&&(s.data.caseInfo.content.coexistenceAction="openWorkByHandle"),n.push(Cf(Yg,s));const a=qp(e?.actionInPayload?.context),o=Ac(e?.actionInPayload?.context),i=Object.freeze({target:a,containerItemID:e?.actionInPayload?.context,context:e?.actionInPayload?.context,containerName:o});if(wc(e?.actionInPayload?.context)){const t=zc(e?.response,{...i});ll({...t,isArrayDeepMerge:!0},n)}}}else await Wy(e,n,r);return n})),tu((()=>(Cg(n),Fc(n,t),n=[],n))))},qy="FINISH_ASSIGNMENT",{RESOURCE_TYPES:zy}=U,Yy=(e,t)=>{const{containerItemID:n,context:r,actionMgrID:s,isInCreateStage:a,isModalAction:o}=t;if(a&&o){const t=Ac(n),a=Pt(t,r);e.push(Cf(hf,{containerItemID:n,target:a,actionMgrID:s}))}},Ky=(e,t)=>{const{containerItemID:n,skipReleaseLockRequest:r,isInCreateStage:s,isProcessAction:a}=t,o=vp(n),i=`${o?.includes("root")?j.APP.ROOT:j.APP.APP}/${gp.MODAL}`;e.push(Cf(ff,{containerItemID:n,context:o,target:i,skipReleaseLockRequest:r,isInCreateStage:s,isProcessAction:a}))},Jy=e=>Og(".openCaseViewAfterCreate",j.CONTEXT_DATA,e)??!0,Xy=async(e,{translatedDXAPIResponse:t,actionInPayload:n},r,s,a)=>{const{caseID:o}=n,i=(c=t,jg.getIn(c,yc.NEXT_ASSIGNMENT_INFO_ID,j.EMPTY_STRING));var c;const l=s?lc(t):Dc(t),{caseViewMode:u,headers:d,semanticURL:p,actionMgrID:h,directUrlUpdation:g,key:f,flowName:m,resourceType:I}=r,y=qp(n?.context),E=yp(y,n?.context)?.acTertiary;Object.assign(a,{caseId:o,assignmentId:i,caseType:l,isSubmitFromBlendedUI:E}),Ky(e,{...n,skipReleaseLockRequest:!0});const A=`${n?.containerItemID.includes("root")?j.APP.ROOT:j.APP.APP}/${gp.PRIMARY}`,_=el(A,gp.PRIMARY),C=xo.getCoreHeadersFromContext(n.context)||!1,S=zc(t,{target:A,context:_,containerItemID:_,caseViewMode:u,headers:d,semanticURL:p,key:f,flowName:m,resourceType:I,directUrlUpdation:g,debugInfo:C&&C.debugInfo&&{debugId:C.debugInfo[j.COREHEADER_APP_DEBUG_ID]}});if(Up(A)){const t=Sg(_),s=bc({data:t}),[,a]=s?s.split(" "):[],o=`You will lose unsaved changes for ${a}. Do you want to continue?`;if(!Jy(n.context))return e;{const{continueExecution:t}=rl(A,{dirtyMessage:o});if(!t)return r.directUrlUpdation=!1,rc.rejectActionByID(h),cu();S.currentCaseViewMode=$c(S?.context),e.push(Cf(yf,S))}}else e.push(Cf(nf,S));return t.directUrlUpdation=g,t.semanticURL=p,await Yc(t,{...S,acName:A},{acName:A,context:_}),e},Qy=(e,{isModalAction:t,target:n,transientItemID:r})=>{if(t){const t=e.find((({type:e})=>e===Me));t?.payload&&(n=t.payload.target,r=t.payload.containerItemID)}const s=mf({target:n,containerItemID:r});s.payload.transientItems.length&&e.push(s)},Zy=e=>/^app\/preview_[0-9]*/g.test(e),eE=(e,t)=>{const n=W(e);return!Zy(e)&&(n===t||/^app\/primary_[0-9]*/g.test(n))},tE=e=>{if(!Jy(e.context)){let t;const n=e?.caseTypeID,r=e?.caseTypeName;return t=e.businessID?e.businessID:e.workID,{caseID:t,caseTypeID:n,caseTypeName:r}}return{}},nE=(e,t,n,r)=>{const{data:s,caseViewMode:a}=t,o={data:s,caseViewMode:a,context:n};if(jg.setIn(o.data,["context_data","caseViewMode"],a),e.push({type:ot,payload:{context:n}}),r){const t={data:F.transformObjectToCase(s),caseViewMode:a,context:n};e.push(Cf(Yg,t))}e.push(Cf(Yg,o))},rE=async(e,t,n,r,s,a,o,i,c,l)=>{const{headers:u}=c,d=l?j.OBJECT_INFO.OBJECT_INFO:j.CASE_INFO.CASE_INFO;if(e){if("object"!=typeof c?.response?.uiResources?.root){const t=(e,t)=>{const n=e.findIndex((e=>e.ID===t));if(-1!==n){const[t]=e.splice(n,1);e.unshift(t)}return e},n=Sg(e),r=c?.response?.data?.caseInfo?.assignments??[],s=n?.caseInfo?.assignments??[],a=$c(e)===j.PERFORM_MODE,o=r[0]?.ID!==s[0]?.ID,i=r.length>0&&s.length>0;a&&o&&i&&c?.response?.data?.caseInfo?.assignments&&(c.response.data.caseInfo.assignments=t(r,s[0]?.ID))}const p=Up(qp(e));let h=!1;const g=qp(n),f=Ip(g),m=Dp(g);m&&f?.items?.[m]?.key===c?.actionInPayload?.caseID&&(h=!0),Ky(s,{...r,skipReleaseLockRequest:!0});const I=Ac(e),y={target:qp(e),containerItemID:e,context:e,containerName:I};t.doDeleteCaseSummary=r.doDeleteCaseSummary;const E=J(n),A=Sg(E),_=Sg(r.context),C=A[d]?.ID,S=_[d]?.ID,T=Sg(e)?.caseInfo?.ID;if(p&&C===S||!p&&(""===o||"review"===t.caseViewMode||!a&&t.root&&0===Object.keys(t.root).length&&T===t.data?.caseInfo?.ID))(void 0===t?.data[d]?.content||void 0!==t.data[d].content&&"object"==typeof t.data[d].content&&0===Object.keys(t.data[d].content).length)&&(t.root=void 0,delete t.data?.caseMessages),t.caseViewMode===j.REVIEW_MODE&&((e,t)=>{const n=e?.assignmentID,r=t?.data?.caseInfo?.assignments??[],s=r[0]?.ID;return n!==s})(r,i)&&(t.flowName=" ",t.clearView=!0),s.push(Cf(lf,{...t,key:o,resourceType:"",...y}));else if(a){const a=qp(e),i=Sp(a,o);if(i)y.target=a,y.context=i,y.containerItemID=i,s.push(Cf(lf,{...t,key:o,resourceType:"",...y}));else{const e=Mp(n)[0];if(r.target=e,r.context=el(e,j.WORKAREA,n),r?.context){r.containerItemID=r.context,s.push(Cf(nf,{...r,...t}));const n=r.containerItemID;s.push(Cf(hf,{parentContainerTarget:e,containerItemID:n}))}}}if(r.target=qp(e),r.containerName=Ac(e),r.context=e,r.containerItemID=e,jg.setIn(t,"acName",y.target),await Yc(i,t),h&&(n.includes(j.WORKAREA)&&wc(n)&&(n=J(n)),nE(s,t,n,l)),!a&&t.caseViewMode===j.PERFORM_MODE){const t=((e,t)=>{const n=qp(e);return Sp(n,t)})(e,o),n={data:{[d]:{headers:u}},context:t};s.push(Cf(Yg,n)),s.push(wd(((e,t=!1,n=!1)=>{const r=rc.getNextActionMgrId();return{ID:Bg.getPropertyValue(U.CASE_INFO.ASSIGNMENT_ID,"",e),actionID:Bg.getPropertyValue(U.CASE_INFO.ASSIGNMENTACTION_ID,"",e),context:e,caseWideAction:t,contextData:n,options:{actionMgrID:r}}})(t)))}}else{Ky(s,r);let e=!1;const o=qp(n),i=Ip(o),u=Dp(o);if(u&&i?.items?.[u]?.key===c?.actionInPayload?.caseID&&(e=!0),a){const e=Mp(n)[0];r.target=e,r.context=el(e,j.WORKAREA,n),r.containerItemID=r.context,s.push(Cf(nf,{...r,...t}));const a=r.containerItemID;s.push(Cf(hf,{parentContainerTarget:e,containerItemID:a}))}e&&nE(s,t,n,l)}},sE=async(e,t,n,r,s,a,o)=>{const i=a?"objectInfo":"caseInfo";((e,t,n)=>{if(t.isProcessAction&&(Ky(n,{...t,skipReleaseLockRequest:!0}),e)){const r=`${t?.containerItemID.includes("root")?j.APP.ROOT:j.APP.APP}/${gp.PRIMARY}`,s=el(r,gp.PRIMARY),a={insKey:e.ID,className:e.content.classID,context:s,acTargetName:j.PRIMARY,isChild:!0},o={type:ue,payload:{...a}};n.push(o)}})(e.data[i].parentCaseInfo,t,s);const c=e?.data[i]?.parentCaseInfo?.ID;if(c){const n=qp(t?.context),r=yp(n,t?.context)?.parentContext,s=qp(r);t?.isProcessAction&&Cp(s,c)&&lh(r,e?.data[i]?.lastUpdateTime)}n.resourceType=zy.CASE,n.directUrlUpdation=!0,t.isProcessAction||await Xy(s,{translatedDXAPIResponse:r,actionInPayload:t},n,a,o)},aE=async(e,t,n,r,s)=>{e.doDeleteCaseSummary=t.doDeleteCaseSummary,e.caseViewMode===j.REVIEW_MODE&&(e.flowName=" ",e.clearView=!0);const{containerItemID:a}=t,o=Rl.getPropertiesToReplace(a);s.push(Cf(lf,{...e,...r,propertiesToReplace:o})),jg.setIn(e,"acName",r.target),await Yc(n,e),((e,t,{data:n,caseViewMode:r})=>{const{containerItemID:s}=t,a=vp(s);if(a&&wc(s)){const t=J(a),o={data:n,caseViewMode:r,context:t};jg.setIn(o.data,["context_data","caseViewMode"],r),e.push({type:ot,payload:{context:t}});const i=Rl.getPropertiesToReplace(s);e.push(Cf(Yg,o,{propertiesToReplace:i}))}})(s,t,e)},oE=async(e,t,n,r,s,a,o,i,c,l={})=>{const{isCaseWideAction:u,isInCreateStage:d,containerItemID:p}=e,h=W(e.context),g=Rc(s,c),f=c?lc(s):Dc(s),m=d&&!g&&!u,I=Mp(h)[0],y=I?Dp(I):h,E=Ac(p),A=vp(p),_=Object.freeze({target:e.target,containerItemID:p,context:A,containerName:E});m&&!Zy(e.context)?await sE(i,e,t,s,a,c,l):eE(e.context,y)?await rE(y,t,h,e,a,n,r,s,o,c):!u&&!c||eE(e.context,y)?await aE(t,e,s,_,a):(Ky(a,e),((e,t,n)=>{const{containerItemID:r,caseID:s}=t;if(r&&/^app\/preview_[0-9]*/g.test(r)){const{caseClassName:t}=n,a=W(r),o=vp(a);e.push(Cf(Jg,{containerItemID:a,context:o,container:gp.PREVIEW,containerName:gp.PREVIEW,caseId:s,viewName:U.PREVIEW_VIEW_NAME,caseClassName:t,updateData:!0}))}})(a,e,{caseClassName:f}))},iE=(e,t,n)=>{const{isModalAction:r,isCaseWideAction:s,caseID:a}=t,o=eE(t.context,n),i=e?.data?.caseInfo?.stages,c=e?.data?.caseInfo?.stageID;fc({caseID:a,isModalAction:r,isModalLaunchedFromPrimaryValue:o,isCaseWideAction:s,stages:i,stageID:c})},cE=e=>{const t=e?.payload?.err?.errorDetails,n=e?.payload?.context;t?.forEach((e=>{e[j.ERROR_FIELD_IN_PAGE]=e[j.ERROR_FIELD_IN_PAGE].replace(/(\(\d+\))/g,(e=>`[${parseInt(e.substring(1,e.length-1),10)-1}]`));const t=e[j.ERROR_FIELD_IN_PAGE].slice(1),r=e[j.ERROR_IN_PAGE_IDENTIFIER],s=r.startsWith(".")?r.slice(1):r;if(s){let a=t?`caseInfo.content.${t}`:"caseInfo.content";a=j.getProperty(a.replace(/\(/g,"[").replace(/\)/g,"]"));const o=no(s,a,j.PROPERTY),i={type:U.MESSAGES.MESSAGES_TYPE_ERROR,message:e.localizedValue};eo.mutateField(n,a,o[o.length-1],{messages:[i],type:U.MESSAGES.MESSAGES_TYPE_ERROR,fieldName:r})}}))},lE=(e,t)=>{const{assignmentID:n,actionID:r,caseID:s,context:a,additionalHeaders:o={},outcome:i,jsActionQueryParams:c,headers:l}=e,{state$:u}=t,d=(e=>{const{isModalAction:t,viewType:n,isInCreateStage:r,isCaseWideAction:s}=e;return t&&r&&!s?Gc.PAGE:n||Gc.FORM})(e),p=(e=>{const{isCaseWideAction:t}=e;return t?"executeCaseWideActions":"finishAssignment"})(e),h={assignmentID:n,actionID:r,caseID:s,viewType:d};let{restApi:g}=$f(p,h);const{reqType:f}=$f(p,h);d&&!g?.includes("viewType=")&&(g=g?.includes("?")?`${g}&viewType=${d}`:`${g}?viewType=${d}`),i&&!g?.includes("outcome")&&(g=g?.includes("?")?`${g}&outcome=${i}`:`${g}?outcome=${i}`),g=jl(c,g),e.viewType=d;const{content:m}=qc(a),I=u.value.data[a]?.caseInfo?.headers||{},{etag:y}=I,E={"if-match":y,...l,...o};return La(Bo(g,{method:f,body:m,headers:E},a)).pipe(tu((t=>{const{data:n,headers:r}=t;return F.analyseResponse(n),{response:n,actionInPayload:e,headers:Hc({...E,...r})}})),lu("Error occurred during ajax call at finishAssignment Epic : ",a))},uE=e=>{yo.publish(j.PUB_SUB_EVENTS.EVENT_EXPRESS_LOCALACTION,e)},dE=e=>{yo.publish(j.PUB_SUB_EVENTS.ERROR_ON_FINISH_ASSIGNMENT,e)},{RESOURCE_TYPES:pE}=U,hE=(e,t)=>{let n=0,r=[],s={},a="",o={},i=!1,c=!1;return e.pipe(Zl(qy),nu((e=>{const l=Dh.isCoexistenceAppOfType(j.APP_TYPE.UIKIT);if(({actionMgrID:n}=e.payload),a=e.payload.context,io({context:a,stateObj:Sg(a),clearContextMessages:!0}),!Nl(a)||ho(a)){const t={type:U.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return rc.rejectActionByID(n,!0,t),zu.handleDeferredActionCompletion(e.payload.context).then((()=>{dE({errorType:U.ERROR_TYPE.CLIENT})})),ou([])}return ou(e.payload).pipe(nu((e=>{Yy(r,e);const n={...e};return lE(n,{state$:t})})),nu((async e=>{if(e&&e.type===Ee){Vl(e);const t=Qc(e);return r.push(t),r}ku.clearContextedCache(a);const{headers:t,actionInPayload:u,response:d}=e,{containerItemID:p,context:h=vp(p),isModalAction:g,isInCreateStage:f}=u;i=u.isCaseWideAction,c=u.isProcessAction;const m=qp(p);u.target=m;const I=Ac(p),y=Object.freeze({target:u.target,containerItemID:p,context:h,containerName:I});jg.setIn(d.data,j.CASE_INFO.IS_FIRST_ASSIGNMENT,!1),jg.setIn(d.data,j.CASE_INFO_IS_LOCAL_ACTION,!1),d?.uiResources?.root?.config?.name&&"page"!==u.viewType&&jg.setIn(d.data,j.CASE_INFO.VIEW_NAME,d?.uiResources?.root?.config?.name),uE({submitResponse:d});let E=Ed(d,{[U.STOPMERGEACTIONS]:!d.nextAssignmentInfo});const A=Dc(E),_=W(u.context),C=Mp(_)[0]?Dp(Mp(_)[0]):_,S=Rc(E),T=f&&!S;!g||f||eE(u.context,C)||(E=ol(E,Sg(p)));const N=zc(E,{headers:t,actionMgrID:n,directUrlUpdation:!1});let O,P;Lc(N.data,u),N.caseClassName=A,N.resourceType=pE.ASSIGNMENT,N.headers=t;const D=E?.data?.caseInfo?.assignments?.some((e=>e.ID===u.assignmentID)),R=((e,t)=>{const{assignmentID:n}=t;return e?.data?.caseInfo?.assignments?.some((e=>e.ID===n&&"true"===e?.canPerform))})(E,u),b=((e,t,n,r,s)=>{let a;const o=qp(t);return a=jp(o)?Sp(o,n.data?.caseInfo?.ID):Dp(o),r&&e&&Pg(null,j.CASE_VIEW_MODE_PROP,a)===j.PERFORM_MODE&&s})(D,C,E,g,R),v=u?.actionID===U.LOCAL_ACTIONS.TRANSFER_ASSIGNMENT;if(E?.data?.nextAssignmentInfo&&!v)N.caseViewMode=j.PERFORM_MODE,O=bc(E),P=!0;else if(b&&!v)E?.confirmationNote&&E?.uiResources?.root?.config?.name===j.PY_CONFIRM?N.caseViewMode=j.REVIEW_MODE:N.caseViewMode=j.PERFORM_MODE,O=bc(E),N.flowName=" ",N.deleteAssignmentSpecificResources=!1,P=!1;else{N.caseViewMode=j.REVIEW_MODE;const e=Up(qp(C));O=E?.confirmationNote&&E?.uiResources?.root?.config?.name===j.PY_CONFIRM&&!e?bc(E):"",P=!1}const x=bc(E);Mc(N,E,{skipFlowNameUpdate:N?.caseViewMode===j.REVIEW_MODE||b});const w=Vf("createWork",{caseClassName:A}).replace(/{.+?}/,String(Pc(x)));if(E.semanticURL=w,N.semanticURL=w,g?(await oE(u,N,P,O,E,r,e,d,!1,o),T&&(s=tE(u))):f&&l&&!S?(Dh.setDefaultCasePage("pyDetails"),await(async(e,t,n)=>{const r={assignmentID:e?.data?.caseInfo?.assignments[0]?.ID,className:e?.data?.caseInfo?.content?.classID,containerName:gp.PRIMARY,targetContainerName:gp.PRIMARY,viewType:Gc.PAGE,isLastStepInCreateStage:!0,context:n},s={type:ge,payload:{...r}};t.push(s)})(d,r,W(h))):await aE(N,u,E,y,r),kc(e,r),zu.handleDeferredActionCompletion(a).catch((()=>{})),iE(N,u,C),!E?.data?.nextAssignmentInfo){const e=((e,t)=>{const{isCaseWideAction:n,assignmentID:r,actionID:s}=t;return{isCaseWideAction:n,caseID:bc(e),assignmentID:n?null:r,actionID:s||null}})(E,u);mc({...e,containerItemID:p})}return Qy(r,{transientItemID:p,target:m,isModalAction:g}),r})),tu((()=>{const e=r.find((e=>e.type===Ee));return e?(zu.handleDeferredActionCompletion(a).then((()=>{dE({errorType:U.ERROR_TYPE.SERVER})})).catch((()=>{})),cE(e),rc.rejectActionByID(n)):rc.resolveActionByID(n,s),o?.caseId&&(e=>{yo.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_DONE,e)})(o),ul(r),(i||c)&&(e=>{yo.publish(j.PUB_SUB_EVENTS.EVENT_LOCALACTION_SUBMISSION,e)})({updateState:!0}),r=[],s={},o={},r})))})))},gE="CANCEL_ASSIGNMENT",fE=e=>{const t={},{routeKey:n,isModalAction:r,caseID:s,context:a,RemoteSystemID:o}=e;o&&(t.RemoteSystemID=o);const i=n||"releaseAssignmentLock",{restApi:c,reqType:l}=$f(i,{ID:s,caseID:s,viewType:Gc.PAGE}),u=tc.getComponentCache(s),d=u&&"object"==typeof u?u:{};return La(Bo(c,{method:l,headers:{...t,...d}},a,{includeRemoteSystemIdIfPresent:!!o})).pipe(tu((t=>(tc.resetComponentCache(s),r?{actionInPayload:e}:{response:t.data,actionInPayload:e,headers:Hc(t.headers)}))),lu(": Error occurred during ajax call at release lock request : ",a))},mE=(e,t)=>{const{isModalAction:n}=t;return fE({routeKey:"cancelAssignment",isModalAction:n,...e})},IE=e=>{let t=0,n=[];return e.pipe(Zl(gE),tu((e=>(({actionMgrID:t}=e.payload),e.payload))),nu((e=>{const{isModalAction:n}=e;e.context||(e.context=vp(e.containerItemID));const{context:r}=e,s=(e=>{const{isModalAction:t,containerItemID:n}=e;return t?gp.MODAL:Ac(n)})(e),a=Pt(s,r),{continueExecution:o}=rl(a);return o?(e.RemoteSystemID=$.getRemoteHeaderByContext(e.context)??void 0,La(mE(e,{isModalAction:n}))):(rc.rejectActionByID(t),cu())})),nu((e=>{if(e&&e.type===Ee)return n.push(Qc(e)),La([n]);const{actionInPayload:r,response:s}=e,{containerItemID:a,isModalAction:o,isInCreateStage:i}=r;s?.data.caseInfo&&(s.data.caseInfo.availableProcesses=s.data.caseInfo.availableProcesses??[]);const c=qp(a),l=vp(a),u={target:o?`${j.APP.APP}/${j.MODAL}`:c,containerItemID:a,caseViewMode:o?j.PERFORM_MODE:j.REVIEW_MODE,context:l,actionMgrID:t,key:bc(s),skipReleaseLockRequest:!1};return i&&n.push(Cf(lf,u)),!o&&wc(a)&&(async(e,t)=>{const{childContainerItemID:n,caseViewMode:r,referencedUsers:s,response:a}=t,o=W(n),i={context:vp(o),data:{...a.data,referencedUsers:s,context_data:{caseViewMode:r}}};a?.data?.caseInfo&&(a.data.caseInfo.assignments??=[]),e.push(Cf(Yg,i))})(n,{childContainerItemID:a,caseViewMode:j.REVIEW_MODE,referencedUsers:s?.data.referencedUsers,response:s}),u.skipReleaseLockRequest=!0,n.push(Cf(ff,u)),La([n])})),tu((()=>(Cg(n),Fc(n,t),n=[],n))))},yE="NAVIGATE_TO_STEP",EE=(e,t)=>{const{ID:n,stepID:r,containerItemID:s,context:a=vp(s),isInCreateStage:o}=e,{state$:i}=t,c={ID:n,stepID:r,viewType:o?Gc.PAGE:Gc.FORM},{restApi:l,reqType:u}=$f("navigateToStep",c),{content:d}=qc(a),p=i.value.data[a].caseInfo.headers;return La(Bo(`${l}`,{method:u,body:d,headers:{"if-match":p&&p.etag}},a)).pipe(tu((t=>({response:t.data,actionInPayload:e,headers:Hc({...p,...t.headers})}))),lu("Error occurred during ajax call at navigateToStep Epic : ",a))},{RESOURCE_TYPES:AE}=U,_E=(e,t)=>{let n=0,r=[];return e.pipe(Zl(yE),eu((e=>(({actionMgrID:n}=e.payload),ou(e.payload).pipe(nu((e=>(po(e.context),EE(e,{state$:t})))),nu((async e=>{if(e&&Tc(e.type))return r.push(Qc(e)),r;const{actionInPayload:t,response:n,headers:s}=e,{containerItemID:a,context:o=vp(a),isModalAction:i}=t;ku.clearContextedCache(t.context);const c=qp(a),l=Ac(a),u=Object.freeze({target:c,containerItemID:a,context:o,containerName:l}),d=n?.data?.caseInfo?.content,p=n?.uiResources?.root?.config?.name,h=n?.uiResources?.root?.config?.context;d&&!d.pyViewName&&p&&"page"!==t.viewType&&(jg.setIn(d,"pyViewName",p),jg.setIn(d,"pyViewContext",h));const g=Ed(n),f={acName:c,...u};await Yc(g,t,f);const m=zc(g,{...u,headers:s});n?.nextAssignmentInfo||(m.caseViewMode=j.REVIEW_MODE),kc(e,r),m.doDeleteCaseSummary=t.doDeleteCaseSummary,m.resourceType=AE.ASSIGNMENT,Mc(m,g),Lc(m.data,t);const I=g.data?.caseInfo?.stages,y=g.data?.caseInfo?.stageID;return fc({caseID:bc(g),isModalAction:i,stages:I,stageID:y}),wc(a)&&ll(m,r),r.push(Cf(lf,m)),il(r),r})),tu((()=>(Cg(r),Fc(r,n),r=[],r))))))))},CE=e=>{const{caseID:t,context:n}=e,{restApi:r,reqType:s}=$f(qe,{ID:t});return La(Bo(r,{method:s},n)).pipe(tu((t=>(F.analyseResponse(t.data),{response:t.data,actionInPayload:e,headers:Hc(t.headers)}))),lu(": Error occurred during ajax call at deleteCaseInCreateStage Epic : ",n))},SE=e=>{yo.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_DELETED,e)},TE=(e,t)=>{let n,r=0,s=[];return e.pipe(Zl(Gl),tu((e=>(({actionMgrID:r,caseType:n}=e.payload),e.payload))),nu((e=>e.ignoreCaseDeletion?ou({actionInPayload:e}):CE(e))),nu((async e=>{if(e&&Tc(e.type)){const{payload:t}=e,n=Qc({...e,...t,actionMgrID:r});return s.push(n),s}const{actionInPayload:n}=e,{context:a,isModalAction:o}=n,i=o?gp.MODAL:gp.PRIMARY,c=Pt(i,a);if(!o&&c){const e={acName:c,target:c,context:a},r=t.value.containers[c],{semanticURL:s}=(e=>{const{accessedOrder:t,items:n}=e;if(t&&t.length>1){const e=n[t[t.length-2]],{semanticURL:r}=e;if(r)return e}return{semanticURL:""}})(r);await Yc({directUrlUpdation:!0,semanticURL:s},n,e)}if(n.isProcessAction&&n.parentCaseInfo){const e={insKey:n.parentCaseInfo.ID,className:n.parentCaseInfo.content.classID,context:n.parentContext,acTargetName:j.PRIMARY,isChild:!0},t={type:ue,payload:{...e}};s.push(t)}const l={target:c,containerItemID:a,context:a,caseDeleted:!0};return s.push(Cf(ff,l)),s})),tu((()=>(Cg(s),Fc(s,r)===j.PROMISE_VALUE.RESOLVE&&SE({caseType:n}),s=[],s))))};function NE(e,t){return Gs(t)?nu(e,t,1):nu(e,1)}const OE=(e,t)=>{const{assignmentID:n,actionID:r,context:s}=e,{restApi:a,reqType:o}=$f("save",{assignmentID:n,actionID:r}),{content:i}=qc(s),c=t.value.data[s]?.caseInfo?.headers;return La(Bo(a,{method:o,body:i,headers:{"if-match":c&&c.etag}},s)).pipe(tu((t=>({response:t.data,actionInPayload:e,headers:Hc(t.headers)}))),lu(": Error occurred during ajax call at saveAndCloseAssignment Epic at save action : ",s))},PE=(e,t=!1)=>{const{action:n,state$:r,actionMgrID:s}=e;let a=[];return ou(n.payload).pipe(nu((e=>OE(e,r))),NE((e=>{if(e&&Tc(e.type))return ou(e);const{containerItemID:t}=e&&e.actionInPayload,r=W(t),s=qp(r),o=Ip(s),i=Mp(r)[0];let c=i?Dp(Mp(r)[0]):r;if(!Up(qp(c))){const t=Ip(i);t?.accessedOrder.forEach((n=>{e.actionInPayload.caseID===t.items[n].key&&(c=t.items[n].context)}))}const l=Dp(s);n.payload.canUpdateAvailableActions&&yd(e.response);if(c&&a.push((t=>Cf(Yg,{context:t,data:{caseInfo:{...e.response.data?.caseInfo||{},headers:e.headers}}}))(c)),o?.items?.[l]?.key===e?.actionInPayload?.caseID){const n={context:r,data:{...e.response.data,caseInfo:{...e.response.data?.caseInfo||{},headers:e.headers}}},s=Rl.getPropertiesToReplace(t);a.push(Cf(Yg,n,{propertiesToReplace:s})),a.push(Cf(lf,{context:t}))}return kc(e,a),fE({...e.actionInPayload,RemoteSystemID:$.getRemoteHeaderByContext(e.actionInPayload.context)??void 0})})),nu((async n=>{if(n&&Tc(n.type)){const{payload:t}=n,r=Qc({...n,...t,actionMgrID:s});a.push(r);const o=e.action.payload.modalLoadingContainer;if(o){const e=o.context,{context_data:t}=Sg(e)||{};t?.isLoading&&zp(e)}return a}const{actionInPayload:r}=n,{context:o,containerName:i}=r,c={target:Pt(i,o),containerItemID:o,context:o};return t||a.push(Cf(ff,c)),a})),tu((()=>(Cg(a),Fc(a,s),(e=>{yo.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.SAVE_ASSIGNMENT_COMPLETE,e)})({context:n.payload.context,assignmentID:n.payload.assignmentID}),t||(a=[]),zu.isDeferredActionInProgress(n.payload.context)&&zu.handleDeferredActionCompletion(n.payload.context),a))))},DE=(e,t)=>{let n,r=0;return e.pipe(Zl(Wl),eu((e=>{const{saveOnly:s}=e.payload;({actionMgrID:r,caseType:n}=e.payload);return PE({action:e,state$:t,actionMgrID:r,caseType:n},s)})))},RE=e=>{const{callbacks:t}=e;if(t?.submit){const e=e=>{var n;t.submit(e),n="expressLocalActionSubmit",yo.unsubscribe(j.PUB_SUB_EVENTS.EVENT_EXPRESS_LOCALACTION,n)};n=e,r="expressLocalActionSubmit",yo.subscribe(j.PUB_SUB_EVENTS.EVENT_EXPRESS_LOCALACTION,n,r)}var n,r},{LOCAL_ACTION_TYPE:bE}=j,{RESOURCE_TYPES:vE}=U,xE=(e,t)=>{const{actionID:n,assignmentID:r,caseID:s,context:a,openActionType:o,modalLoadingContainer:i,headers:c}=e,{isProcessAction:l}=t,u=l?Ye:(e=>{const t=e.localActionType.toLowerCase();return t===bE.CASE_WIDE||t===bE.EXPRESS?Ke:ze})(e),d=Gc.FORM,{reqType:p}=$f(u,{caseID:s,ID:r,actionID:n,viewType:d});let{restApi:h}=$f(u,{caseID:s,ID:r,actionID:n,viewType:d});e.actionType=u===Ke?j.CASE:j.ASSIGNMENT,h&&!h.includes("viewType=")&&(h=h.includes("?")?`${h}&viewType=${d}`:`${h}?viewType=${d}`);const g=i?.context??a;return La(Bo(h,{method:p,headers:c},g)).pipe(tu((t=>({response:t.data,actionInPayload:e,headers:Hc(t.headers,"",e.headers)}))),lu(`: Error occurred during ajax call at ${o} Epic : `,g))},wE=(e,t)=>{const{isProcessAction:n}=t,r=n?Ye:ze;e.openActionType=r;let s;if("modal"===Ec(r,e)){s=Mp(e.contextName)[0]?Mp(e.contextName)[0]:qp(e.contextName);const n=s?Dp(s):e.contextName,r=vp(n),a=Ec(e.openActionType,e),o=Pt(a,e.context),i=K(e.context,H(a,e.context));if(Cg(nf({target:o,context:i,containerItemID:i,key:e.caseID,caseViewMode:j.PERFORM_MODE,actionName:e.name,showProgress:!0,root:{type:"reference",config:{context:j.CASE_INFO.CASE_INFO_CONTENT,type:"view"}},data:{key:e.caseID,caseInfo:{ID:e.caseID}},headers:{...e.headers}})),Cg(uf({context:i})),e.modalLoadingContainer={target:o,context:i},!Mp(e.contextName)[0])return xE(e,t);if(!e.continueExecution)return xE(e,t);if(!ip(r))return xE(e,t);e.saveActionPayload.modalLoadingContainer=e.modalLoadingContainer,e.saveActionPayload.canUpdateAvailableActions=!e.saveActionPayload.isModalAction;return La([Hl(e.saveActionPayload)]).pipe(nu((e=>(e=>{let t,n=0;const r=[],s={value:_g()?.getState()};return ou(e).pipe(Zl(Wl),eu((e=>{const{isFormValid:a}=e.payload;if(({actionMgrID:n,caseType:t}=e.payload),!a){const e={type:U.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return rc.rejectActionByID(n,!0,e),ou([])}return PE({action:e,state$:s,actionMgrID:n,caseType:t,actionsOut:r},!0)})))})(e))),nu((n=>{if(1===n.length&&Tc(n[0].type)){const{continueExecution:n}=rl(s);if(!n)return rc.rejectActionByID(e.actionMgrID),iu.pipe(Fa((()=>cu()))).toPromise();if(n)return xE(e,t)}return xE(e,t)})),tu((e=>e)))}return xE(e,t)},ME=async(e,t,{headers:n,actionInPayload:r})=>{const{context:s,actionName:a,openActionType:o,doDeleteCaseSummary:i,modalLoadingContainer:c}=r,l=Ed(e),u=Ec(o,r),d=c?.target??Pt(u,s);let p,h,g=!1;!Vp(d)||jp(d)&&!Cp(d,e.data.caseInfo.ID)?(h=H(u,s),Cc(u)&&(h=K(s,h)),p=h,g=!0):(p=jp(d)?Sp(d,e.data.caseInfo.ID):Dp(d),h=vp(p));const f={acName:d,target:d,containerName:u,context:h};await Yc(l,r,f),(void 0===l?.data?.caseInfo?.content||void 0!==l.data.caseInfo.content&&"object"==typeof l.data.caseInfo.content&&0===Object.keys(l.data.caseInfo.content).length)&&delete l.data?.caseMessages;const m=l.uiResources?.root;let I;I=m?j.PERFORM_MODE:j.REVIEW_MODE;const y=zc(l,{target:d,context:h,containerItemID:p,caseViewMode:I,doDeleteCaseSummary:i,headers:n,actionName:a,isMinimizable:!1,isInCreateStage:Cc(u),resourceType:vE.ASSIGNMENT,isProcessAction:r.isProcessAction,showProgress:r.showProgress,progressMessage:r.progressMessage,assignmentID:r.assignmentID,actionType:r.actionType});m&&Mc(y,l),Cc(u)&&delete y.doDeleteCaseSummary,r.openActionType===Je&&(y.isBulkAction=!0,y.data.caseInfo.actionButtons.main[0].jsAction="async"===r.runningMode?"submitBulkActionAsync":"submitBulkAction",y.data.caseInfo.actionButtons.secondary[0].jsAction="cancelBulkAction",y.data.caseInfo.cases=r.selectedList);const E=g?nf:lf;if(y.data.context_data.isProcessAction=r.isProcessAction,t.push(Cf(E,y)),g||t.push(Cf(df,y)),g){const s=Mp(r.contextName),a=Sp(s,e.data.caseInfo.ID);if(a){const e={data:{caseInfo:{headers:n}},context:a};t.push(Cf(Yg,e))}}return p!==Dp(d)&&t.push(Cf(hf,{target:d,containerItemID:p})),wc(p)&&!c?.context&&ll(y,t),y.caseViewMode===j.REVIEW_MODE&&t.push(Cf(ff,y)),t},LE="OPEN_LOCAL_ACTION",FE=(e,t)=>wE(e,t),UE=e=>{let t=0,n=[];return e.pipe(Zl(LE),tu((e=>(({actionMgrID:t}=e.payload),e.payload))),nu((e=>FE(e,{actionMgrID:t}))),nu((async e=>{if(!e)return iu;if(Tc(e.type)){const t=Qc(e);n.push(t);const{context_data:r}=Sg(e.payload.context)||{};return r?.isLoading&&n.push(Cf(df,e.payload)),n}const{actionInPayload:t,headers:r,response:s}=e,{actionID:a}=t;return jg.setIn(s,"data.caseInfo.activeActionID",a),jg.setIn(s.data,j.CASE_INFO_IS_LOCAL_ACTION,!0),t.refreshConditions&&jg.setIn(s.data,j.CASE_INFO_REFRESH_CONDITIONS,t.refreshConditions),await ME(s,n,{headers:r,actionInPayload:t}),RE(t),n})),tu((()=>(Cg(n),Fc(n,t),n=[],n))))},jE=e=>{const{actionID:t,context:n,openActionType:r,caseTypeID:s,bulkContextID:a="",bulkContextType:o=""}=e,i=Je,{reqType:c,restApi:l}=$f(i,{caseTypeID:s,actionID:t,bulkContextID:a,bulkContextType:o});return La(Bo(l,{method:c},n)).pipe(tu((t=>({response:t.data,actionInPayload:e,headers:Hc(t.headers)}))),lu(`: Error occurred during ajax call at ${r} Epic : `,n))},VE=e=>{const{callbacks:t}=e;if(t?.submit){const e=e=>{var n;t.submit(e),n="bulkActionSubmit",yo.unsubscribe(j.PUB_SUB_EVENTS.EVENT_BULKACTION,n)};n=e,r="bulkActionSubmit",yo.subscribe(j.PUB_SUB_EVENTS.EVENT_BULKACTION,n,r)}var n,r},kE="OPEN_BULK_ACTION",$E=e=>{let t=0,n=[];return e.pipe(Zl(kE),tu((e=>(({actionMgrID:t}=e.payload),e.payload))),nu((e=>((e,t)=>{const{context:n}=e,{actionMgrID:r}=t;e.openActionType=Je;const s=Ec(Je,e),a=Pt(s,n),{continueExecution:o}=rl(a);return o?jE(e):(rc.rejectActionByID(r),cu())})(e,{actionMgrID:t}))),nu((async e=>{if(e&&Tc(e.type)){const t=Qc(e);return n.push(t),n}const{actionInPayload:t,headers:r,response:s}=e,{actionID:a}=t;return jg.setIn(s,"data.caseInfo.activeActionID",a),await ME(s,n,{headers:r,actionInPayload:t}),VE(t),n})),tu((()=>(1===n.length&&Tc(n[0].type)?rc.rejectActionByID(t):rc.resolveActionByID(t),Cg(n),n=[],n))))};var BE=Array.isArray,GE=Object.getPrototypeOf,WE=Object.prototype,HE=Object.keys;function qE(e){if(1===e.length){var t=e[0];if(BE(t))return{args:t,keys:null};if((r=t)&&"object"==typeof r&&GE(r)===WE){var n=HE(t);return{args:n.map((function(e){return t[e]})),keys:n}}}var r;return{args:e,keys:null}}var zE=Array.isArray;function YE(e){return tu((function(t){return function(e,t){return zE(t)?e.apply(void 0,js([],Us(t))):e(t)}(e,t)}))}function KE(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=function(e){return Gs(su(e))?e.pop():void 0}(e),r=qE(e),s=r.args,a=r.keys,o=new ma((function(e){var t=s.length;if(t)for(var n=new Array(t),r=t,o=t,i=function(t){var i=!1;Na(s[t]).subscribe(Ra(e,(function(e){i||(i=!0,o--),n[t]=e}),(function(){return r--}),void 0,(function(){r&&i||(o||e.next(a?function(e,t){return e.reduce((function(e,n,r){return e[n]=t[r],e}),{})}(a,n):n),e.complete())})))},c=0;c<t;c++)i(c);else e.complete()}));return n?o.pipe(YE(n)):o}const JE=e=>{const{actionID:t,context:n,cases:r,classID:s}=e,{content:a}=qc(n,{nonEmptyAndChangedData:!0});let o=5;try{const e=sd.getSharedState("D_pySingleExecutionBulkActionsMeta.D_pySingleExecutionBulkActionsMeta.pxResults");e?.find((e=>e.pyClassName===s))?.pyList.split(",").includes(t)&&(o=1)}catch(e){console.error('Failed to fetch to "D_pySingleExecutionBulkActionsMeta" DP response',e)}const i=r.map((e=>({ID:e}))),c=i.length/o,l=Xe,{reqType:u,restApi:d}=$f(l,{actionID:t}),p=[],h=i.length;for(let t=0;t<h;t+=c)a.cases=i.slice(t,t+c),a.cases.length&&p.push(La(Bo(d,{method:u,body:a},n)).pipe(tu((t=>{const{data:n,headers:r}=t;return{response:n,actionInPayload:e,headers:Hc({...r})}})),lu("Error occurred during ajax call at submitbulkaction Epic : ",n)));return KE(p)},XE=e=>{yo.publish(j.PUB_SUB_EVENTS.EVENT_BULKACTION,e)},QE="SUBMIT_BULK_ACTION",ZE=e=>{let t,n=0,r=[],s="";return e.pipe(Zl(QE),eu((e=>{const{isFormValid:a}=e.payload;if(({actionMgrID:n}=e.payload),!a){const e={type:U.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return rc.rejectActionByID(n,!0,e),ou([])}return ou(e.payload).pipe(nu((e=>(t=e,JE(t)))),nu((e=>{let n=0,a=0;const o=[],{containerItemID:i,context:c}=t;return e.forEach((e=>{const{response:t}=e;n+=Number(t.successCount),a+=Number(t.failureCount),a&&t.results.forEach((e=>{"200"!==e.status&&e.error&&e.error.errorDetails&&e.error.errorDetails.forEach((t=>{o.push({ID:e.BusinessID,message:t.localizedValue})}))}))})),s=`${n} record(s) updated`,XE({submitResponse:e}),t.target="HYBRID"===Dh.getRenderingMode()?qp(i):`${j.APP.APP}/${gp.MODAL}`,r.push(Cf(ff,{containerItemID:i,context:c,target:t.target,skipReleaseLockRequest:!0})),a&&r.push(Cf(gf,{messages:[{type:"error",message:1===a?"1 record failed to update":`${a} records failed to update`,errorDetails:o,showHeader:!1}],context:W(c)||c,category:"HTTP",showHeader:!1})),r})),tu((()=>(rc.resolveActionByID(n,s),Cg(r),r=[],r))))})))},eA=e=>{const{actionID:t,context:n,cases:r}=e,{content:s}=qc(n,{nonEmptyAndChangedData:!0});s.cases=r.map((e=>({ID:e})));const a=Xe,{reqType:o,restApi:i}=$f(a,{actionID:t,runningMode:"async"});return La(Bo(i,{method:o,body:s},n)).pipe(tu((t=>{const{data:n,headers:r}=t;return{response:n,actionInPayload:e,headers:Hc({...r})}})),lu("Error occurred during ajax call at submitbulkaction Epic : ",n))},tA=e=>{yo.publish(j.PUB_SUB_EVENTS.EVENT_BULKACTION,e)},nA="SUBMIT_BULK_ACTION_ASYNC",rA=e=>{let t,n=0,r=[],s="";return e.pipe(Zl(nA),eu((e=>{const{isFormValid:a}=e.payload;if(({actionMgrID:n}=e.payload),!a){const e={type:U.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return rc.rejectActionByID(n,!0,e),ou([])}return ou(e.payload).pipe(eu((e=>(t=e,eA(t)))),tu((e=>{const n=[],{containerItemID:a,context:o}=t,{response:i}=e,c=Number(i.failureCount)||0;return c>0&&i.results.forEach((({status:e,error:t,BusinessID:r})=>{"200"!==e&&t&&t.errorDetails&&t.errorDetails.forEach((({localizedValue:e})=>{n.push({ID:r,message:e})}))})),s="Processing bulk actions, please refresh to check completion",tA({submitResponse:i}),t.target=`${j.APP.APP}/${gp.MODAL}`,r.push(Cf(ff,{containerItemID:a,context:o,target:t.target,skipReleaseLockRequest:!0})),c&&r.push(Cf(gf,{messages:[{type:"error",message:1===c?"1 record failed to update":`${c} records failed to update`,errorDetails:n,showHeader:!1}],context:W(o)||o,category:"HTTP",showHeader:!1})),r})),tu((()=>(rc.resolveActionByID(n,s),Cg(r),r=[],r))))})))},sA=(e,t)=>wE(e,t),aA=e=>{let t=0,n=[];return e.pipe(Zl($l),tu((e=>(({actionMgrID:t}=e.payload),e.payload))),nu((e=>(po(e.context),sA(e,{actionMgrID:t,isProcessAction:!0})))),nu((async e=>{if(e&&Tc(e.type)){const t=Qc(e);return n.push(t),n}const{actionInPayload:t,headers:r,response:s}=e;return await ME(s,n,{headers:r,actionInPayload:t}),n})),tu((()=>(ul(n),Fc(n,t),n=[],n))))},oA=e=>{let t=0,n=[];return e.pipe(Zl(Se,Me),tu((e=>(({actionMgrID:t}=e.payload),e.payload))),nu((e=>{const{containerItemID:t,caseID:n,context:r,caseDeleted:s,skipReleaseLockRequest:a,currentCaseViewMode:o,isProcessAction:i,isInCreateStage:c}=e,l=o===j.PERFORM_MODE,u=n&&l;return i&&c?fE(e):t!==r||s||a||!u?t?.includes(j.MODAL)&&$c(hh(t))===j.REVIEW_MODE?fE(e):ou([]):fE(e)})),nu((e=>(e&&Tc(e.type)&&n.push(Qc(e)),n))),tu((()=>(Cg(n),Fc(n,t),n=[],n))))};var iA=new EI(fI),cA=iA;function lA(e,t,n){void 0===e&&(e=0),void 0===n&&(n=cA);var r=-1;return null!=t&&(ru(t)?n=t:r=t),new ma((function(t){var s,a=(s=e)instanceof Date&&!isNaN(s)?+e-n.now():e;a<0&&(a=0);var o=0;return n.schedule((function(){t.closed||(t.next(o++),0<=r?this.schedule(void 0,r):t.complete())}),a)}))}function uA(e,t){return void 0===e&&(e=0),void 0===t&&(t=iA),e<0&&(e=0),lA(e,e,t)}function dA(e){return Da((function(t,n){var r=!1,s=null,a=null,o=function(){if(null==a||a.unsubscribe(),a=null,r){r=!1;var e=s;s=null,n.next(e)}};t.subscribe(Ra(n,(function(t){null==a||a.unsubscribe(),r=!0,s=t,a=Ra(n,o,ea),Na(e(t)).subscribe(a)}),(function(){o(),n.complete()}),void 0,(function(){s=a=null})))}))}const pA=(e,t,n,r,s)=>{if(s!==j.RESOURCE_STATUS.CREATE)return;fl.isStateMachineExist(e,t,n)||fl.setStateMachine(e,n,t,new ii(n,t,e));fl.getStateMachine(e,t,n).insert({},"string"==typeof r?r:r+1,!0,{isDefault:!0})},hA=(e,t,n,r,s)=>{"string"==typeof t&&e.data?.caseInfo?.content&&n&&("CREATE"===r||"UPDATE"===r)&&(e.data.caseInfo.content[s][t][n]=t)},gA=e=>{const t=!e.isLocalAction&&e.editType===j.ACTION;return{...t?{}:{activeActionID:e.actionID},assignments:[{ID:e.assignmentID,...t?{actions:[{ID:e.actionID}]}:{}}]}},fA=e=>{let t=0,n=[],r="";return e.pipe(Zl(gt),tu((e=>(({actionMgrID:t}=e.payload),e.payload))),nu((e=>dy(e))),nu((async e=>{if(e&&e.type===Ee)return n.push(Qc(e)),{actionsOut:n,actionInPayload:{skipPageInstructions:!0}};const{actionInPayload:t,response:s,headers:a}=e,o=t.containerName,i=Pt(o,t.context);let c=el(i,o,t.context);c=K(t.context,c);const{pageReference:l,targetProperty:u,index:d,subscriptFieldName:p,pageGroupName:h,actionType:g,isPageGroup:f}=t,m=l?.startsWith(U.OBJECT_INFO.OBJECT_INFO);let I=null;m?(I=F.transformCaseData(s),I.uiResources.root.config.context=`${l}${u}[${d}]`):I=s;const y=Ed(I);y.key=t.ID,y.data?.caseInfo?(y.data.caseInfo.ID=t.ID,hA(y,d,p,g,h)):y.data?.objectInfo&&(y.data.objectInfo.ID=t.ID);const{interestPageActionID:E,editType:A,isLocalAction:_,actionID:C}=t,S={isMultiRecordData:!0,viewName:t.viewID,parentContext:t.context,interestPage:t.interestPage,interestPageActionID:E,editType:A,isLocalAction:_,actionID:C};y.uiResources.context_data.modalView=S;const T=Sg(t.context)?.context_data?.caseInfo,N=`${t.pageReference}${t.targetProperty}`,O=ro(T,N,t.index);y.uiResources.context_data.caseInfo={...y.uiResources.context_data.caseInfo,content:jg.mergeDeep(y.uiResources.context_data.caseInfo?.content,O?.content)};const P=Bg.getProperty(j.CASE_INFO.REMOTESYSTEMID,"",t.context),D={acName:i,context:c};await Yc(y,t,D);const R={target:i,context:c,containerItemID:c,headers:a,index:d,subscriptFieldName:p,pageGroupName:h,isPageGroup:f};P&&(R.headers={...R.headers,RemoteSystemID:P});const b=jg.deepClone(y.data?.caseInfo?.content);y.data?.caseInfo&&A===j.ACTION&&(v()(y.data,`${l}${u}`,new Array(d+1).fill({})),v()(y.data,`${l}${u}[${d}]`,Og(`${u}[${d}]`,l,t.context)));const x=zc(y,R);y.data?.caseInfo&&(y.data.caseInfo.content=b);const w=zc(y,R);x.resourceStatus=t.actionType,x.isMultiRecordData=!0,x.parentContext=t.context,x.heading=t.heading,x.data.caseInfo&&A===j.ACTION&&(x.data.caseInfo={...x.data.caseInfo,...gA(t),isLocalAction:t.isLocalAction}),w.skipValidation=!0;const M=Zc(i,x);r=c,n.push(M),il(n);const L=Cf(Yg,w);return{actionsOut:n,actionInPayload:t,mergeAction:L}})),tu((({actionInPayload:e,mergeAction:s})=>(Nc(n)?rc.rejectActionByID(t):rc.resolveActionByID(t),Cg(n),n=[],e.skipPageInstructions||pA(r,e.pageReference,e.targetProperty,e.index,e.actionType),e.editType===j.ACTION&&(fl.registerForServerChanges(),Cg(s),fl.unRegisterForServerChanges()),n))))},mA=e=>{let t,n="",r=[];return e.pipe(Zl(ft),eu((e=>{t=e.payload;const{isFormValid:s}=e.payload;if(({actionMgrID:n}=e.payload),!s){const t={type:U.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return rc.rejectActionByID(n,!0,t),zu.handleDeferredActionCompletion(e.payload.context),ou([])}return ou(e.payload).pipe(nu((e=>(t=e,dy(t)))),nu((async e=>((e,t)=>{if(e&&"action"===t.editType&&e.type!==Ee){const{context:n,pageReference:r}=t,s={context:n},{response:a}=e,o=r?.startsWith(U.OBJECT_INFO.OBJECT_INFO);let i=null;o?(i=F.transformCaseData(a),i.uiResources.root.config.context=r):i=a;const c=Ed(i);c.key=t.ID,c.data?.caseInfo?c.data.caseInfo.ID=t.ID:c.data?.objectInfo&&(c.data.objectInfo.ID=t.ID);const l=zc(c,s);l.skipValidation=!0;const u=Cf(Yg,l);fl.registerForServerChangesSync(),Cg(u),fl.unRegisterForServerChanges()}return e})(e,t))),nu((async e=>{if(e&&e.type===Ee){const t=Qc(e);return r.push(t),r}const{containerItemID:n,context:s,pageReference:a}=t;return((e,t,n,r)=>{fi(e).forEach((e=>{const s=jg.convertClipboardPageToPageRefNotation(e.target);fl.isStateMachineExist(t,n,s)||fl.setStateMachine(t,s,n,new ii(s,n,t));const a=fl.getStateMachine(t,n,s);switch(e.instruction.toLowerCase()){case"insert":a.insert(e.content,e.listIndex,r,{});break;case"update":a.update(e.content,e.listIndex??e.groupIndex,r,{});break;case"delete":e.listIndex?a.delete(e.listIndex,r):e.groupIndex?a.delete(e.groupIndex,r):a.deletePage();break;case"replace":a.replacePage(e.content);break;case"move":a.move(e.listIndex,e.listMoveToIndex);break;case"add":a.insert(e.content,e.groupIndex,r,{});break;case"delete all":a.deleteAll()}}))})(s,t.parentContext,a.startsWith(U.OBJECT_INFO.OBJECT_INFO_CONTENT)?j.getProperty(U.OBJECT_INFO.OBJECT_INFO_CONTENT):j.getProperty(U.CASE_INFO.CASE_INFO_CONTENT),!1),r.push(Cf(ff,{containerItemID:n,context:s,target:t.target,skipReleaseLockRequest:!0})),r})),tu((()=>{if(Nc(r))rc.rejectActionByID(n),zu.handleDeferredActionCompletion(t.context);else{rc.resolveActionByID(n),zu.handleDeferredActionCompletion(t.context);const{pageReference:r}=e.payload;if(Bg.getPropertyValue(j.CONTEXT_DATA_MODAL_VIEW.IS_MULTI_RECORD_DATA,r,t.parentContext)){const e=Bg.getPropertyValue(j.getProperty(U.CASE_INFO.CASE_INFO_ID),r,t.parentContext),n=Bg.getPropertyValue(j.CONTEXT_DATA_MODAL_VIEW.VIEW_NAME,r,t.parentContext),s=t.pageReference?.substring(0,t.pageReference?.lastIndexOf(".")),a=s.replace(j.getProperty(j.CASE_INFO.CASE_INFO_CONTENT),"");Fd(e,n,t.parentContext,a,{})}else Gd(t.parentContext,j.getProperty(j.CASE_INFO.CASE_INFO_CONTENT),{})}return Cg(r),r=[],r})))})))},IA=e=>{const{caseID:t,headers:n,debugInfo:r,context:s}=e,a=$f("getDescendants",{caseID:t}),{restApi:o}=a,{reqType:i}=a;return La(Bo(o,{method:i,headers:{...n,...r&&{...xo.addDebugHeaders(r)}}},s)).pipe(tu((t=>({actionInPayload:e,response:t.data,headers:Hc({...n,...t.headers})}))),lu("Error ocurred during ajax call at getDescendants Epic : ",s))},yA=e=>{let t=0,n=[];return e.pipe(Zl(Wu),tu((e=>(({actionMgrID:t}=e.payload),e.payload))),nu((e=>IA(e))),nu((async e=>{if(e&&Tc(e.type))return n.push(Qc(e)),n;const{actionInPayload:t,response:r}=e,s={};jg.setIn(s,"caseInfo.childCases",r?.childCases??[]);const a={data:s,context:t?.context};return n.push(Cf(Yg,a)),n})),tu((()=>(Cg(n),Fc(n,t),n=[],n))))},EA=e=>{let t,n="",r=[],s={};return e.pipe(Zl(mt),eu((e=>{t=e.payload;const{isFormValid:a}=e.payload;return({actionMgrID:n}=e.payload),a?ou(e.payload).pipe(nu((e=>(t=e,ou({})))),nu((async()=>{const{containerItemID:e}=t,a=Sg(e),o=e,i=a?.dataInfo.content;delete i.classID;const c=W(o),l=Mp(c).length,u=Mp(c)[l-1]?Dp(Mp(c)[l-1]):c,d=qp(e),p=yp(d,e)||{},h=p?.referenceList?.replaceAll(".",""),g=p?.subscriptName,f=Sg(u),m={containerItemID:u,data:{...f,caseInfo:{content:{...i}}}};r.push(Cf(lf,m)),((e,t,n)=>{ip(t)&&e.push(Cf(ff,{containerItemID:n,skipReleaseLockRequest:!0}))})(r,o,e);const I=(({itemData:e,workareaContainerData:t,subscriptData:n,pageGroupName:r,activeWorkArea:s,subscriptFieldName:a,actionMgrID:o,containerItemID:i})=>{const c={referenceList:e?.referenceList,ID:t?.caseInfo?.ID,index:n[a],containerName:U.MODAL,pageReference:U.CASE_INFO.CASE_INFO_CONTENT,viewID:U.VIEW_NAMES.DATA_OBJECT_CREATE_VIEW,skipSemanticUrl:!0,actionType:U.RESOURCE_STATUS.CREATE,interestPage:`.${r}.${n[a]??""}`,targetProperty:`.${r??""}`,pageGroupName:r,context:s??"",subscriptFieldName:a};return{type:gt,payload:{isInCreateStage:!1,isModalAction:!0,parentContext:"",target:"",...c,actionMgrID:o,containerItemID:i,doDeleteCaseSummary:!1,isFormValid:!0}}})({itemData:p,workareaContainerData:f,subscriptData:i,pageGroupName:h,activeWorkArea:u,subscriptFieldName:g,actionMgrID:n,containerItemID:e});return r.push(I),s=i,r})),tu((()=>(rc.resolveActionByID(n,s),Cg(r),r=[],r)))):(((e,t)=>{const n={type:U.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};rc.rejectActionByID(e,!0,n),zu.handleDeferredActionCompletion(t)})(n,e.payload.context),ou([]))})))},AA=[xy,ky,Hy,UE,$E,ZE,rA,aA,hE,_E,IE,oA,DE,TE,e=>e.pipe(Zl(He),dA((()=>uA(100))),tu((e=>{const{actionMgrID:t,isChildCase:n,isModalAction:r,isProcessAction:s,isDataObject:a,skipReleaseLockRequest:o,isInCreateStage:i}=e.payload;return rc.resolveActionByID(t),yo.publish(j.PUB_SUB_EVENTS.EVENT_SHOW_CANCEL_ALERT,{isModalAction:r,hideDelete:!s&&n,isDataObject:a,skipReleaseLockRequest:o,isInCreateStage:i}),[]}))),e=>e.pipe(Zl(Le),dA((()=>uA(100))),tu((e=>{const{actionMgrID:t,context:n,containerName:r,containerItemID:s}=e.payload,a=Pt(r,n);return rc.resolveActionByID(t),Cg(Cf(hf,{containerItemID:s,target:a,doDeleteCaseSummary:!1})),[]}))),fA,mA,yA,EA],_A=AA;function CA(){return Da((function(e,t){e.subscribe(Ra(t,ea))}))}const{RESOURCE_TYPES:SA}=U,TA=[e=>e.pipe(Zl(te),tu((e=>e.payload)),nu((e=>{const t={caseID:e.caseId,viewID:e.viewName,caseClassName:e.caseClassName,RemoteSystemID:e.RemoteSystemID};if(e.containerName===gp.PREVIEW&&e.context&&e.caseId&&!e.updateData){const t=Pt(gp.PREVIEW,e.context),n=el(t,gp.PREVIEW,e.context,{buildNew:!0}),r=decodeURI(e.caseId);Cg(nf({...e,context:n,target:t,containerItemID:n,key:r,caseViewMode:j.REVIEW_MODE,root:{type:"reference",config:{context:j.getProperty(j.CASE_INFO.CASE_INFO_CONTENT),name:e.viewName,type:"view"}},data:{key:r,caseInfo:{ID:r,progress:!0,error:!1,caseTypeID:e.caseClassName,content:{classID:e.caseClassName}}}})),e.viewLoadingContainer={target:t,context:n}}const n={};if(t.RemoteSystemID)n.RemoteSystemID=t.RemoteSystemID;else if($.isRemoteCase(t.caseClassName)){const{RemoteSystemID:e}=$.getRemoteCase(t.caseClassName);n.RemoteSystemID=e}let{restApi:r,reqType:s}=$f("loadView",t);return e.viewContext===SA.PAGE&&({restApi:r,reqType:s}=$f(je,{page:e.viewName,pageClass:e.pageClass})),La(Bo(r,{method:s,headers:n},e.context)).pipe(tu((t=>{const n=decodeURI(e.caseId);let r="";return"string"==typeof t.data?t.data?r=JSON.parse(t.data):(console.error("response data is empty!!"),r={}):r=t.data,{response:{...r,key:n},actionConfig:e,headers:Hc(t.headers),rootView:jg.getIn(r,j.ROOT)}})),lu(": Error ocurred during ajax call at loadView Epic : ",e.viewLoadingContainer?.context??e.context))})),nu((async e=>{const t={};if(e?.type===Ee){if(t.actionsOut=Qc(e),e?.payload?.context?.includes(gp.PREVIEW)){const n={...Sg(e.payload.context),caseInfo:{progress:!1,error:!0}},r=Pt(gp.PREVIEW,e.payload.context);t.actionsOut=Cf(lf,{key:n.key,target:r,containerName:gp.PREVIEW,context:e.payload.context,containerItemID:e.payload.context,data:n})}return t}try{t.actionMgrID=e?.actionConfig?.actionMgrID,t.rootView=e?.rootView;const{actionConfig:n,response:r,headers:s}=e;e?.actionConfig?.skipAssignmentsUpdate&&(delete r?.data?.caseInfo?.assignments,delete r?.data?.caseInfo?.availableActions,delete r?.data?.caseInfo?.availableProcesses);const{containerItemID:a,containerName:o}=n,{target:i,context:c}=(e=>{const{containerName:t,updateData:n,viewLoadingContainer:r}=e,s=t||ac.getTargetViewContainerName(je),a=r?.target??Pt(s,e.context);return{target:a,context:r?.context??(t===gp.PREVIEW&&n?e.context:el(a,s,e.context,{buildNew:!!t}))}})(n);n.context=c;const l={acName:i,context:c};let u={};u=Ed(r),u.directUrlUpdation=!1,await Yc(u,n,l);const d={...n,target:i,context:c,containerItemID:a||c,headers:s},p=zc(u,d);if(p.resourceType=SA.CASE,o&&!p.updateData){p.caseViewMode=j.REVIEW_MODE;const e=qp(p?.context);((e,t,n,r,s)=>{e&&s===gp.PREVIEW?(n.data.caseInfo.progress=!1,delete n.root,r.actionsOut=Cf(lf,{...n,containerName:s})):e?(r.actionsOut=[],r.actionsOut.push(Cf(hf,{target:t,containerItemID:e}))):r.actionsOut=Cf(nf,{...n,containerName:s})})(Sp(e,p.key),e,p,t,o)}else p.preserveClientChanges=!0,t.actionsOut=[],o===gp.PREVIEW&&t.actionsOut.push({type:ot,payload:{context:c}}),((e,t)=>{if(e.key){const n=qp(e?.context);Sp(n,e.key)&&t.actionsOut.push(Cf(Yg,e))}else t.actionsOut.push(Cf(Yg,e))})(p,t)}catch(e){console.error(e),t.rootView={type:"error",payload:e}}const{caseId:n,context:r,viewName:s}=e.actionConfig;return"pyCasePreview"===s&&(e=>{yo.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.CASE_PREVIEW,e)})({caseId:n,context:r}),t})),tu((({rootView:e,actionsOut:t,actionMgrID:n=0})=>(rc.resolveActionByID(n,e),F.setNeedsMapping(!1),t)))),e=>{let t=0,n=[];return e.pipe(Zl(ne),tu((e=>(({actionMgrID:t}=e.payload),e.payload))),nu((e=>{yo.publish(U.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_STARTED);const{debugInfo:n,context:r,viewName:s,className:a,skipSemanticUrl:o=!1,containerName:i=ac.getTargetViewContainerName(je)}=e,c=n&&{...xo.addDebugHeaders(n)},l=Pt(i,r);let u="",d={},p=!0;if(!o){if(u=Vf(je,{page:s,pageClass:a}),l&&u){const{activate:t,activateContainerActionPayload:n}=al(SA.PAGE,l,{semanticURL:u});if(t)return ou({type:ve,activateContainerActionPayload:n,actionConfig:e})}if(Dp(l)&&({continueExecution:p,removeActionPayload:d}=rl(l)),!p)return rc.rejectActionByID(t),cu()}const{restApi:h,reqType:g}=$f(je,{page:s,pageClass:a});return La(Bo(h,{method:g,headers:c},r)).pipe(tu((t=>{let n={};return n="string"==typeof t.data?JSON.parse(t.data):t.data,{response:{...n,key:u,semanticURL:u},actionConfig:e,headers:Hc(t.headers),removeActionPayload:d,skipSemanticUrl:o}})),lu(": Error ocurred during ajax call at showPage Epic : ",e.context))})),nu((async e=>{const t={};if(t.actionManagerID=e?.actionConfig?.actionMgrID,e&&e.type===Ee)return n.push(Qc(e)),t;let{type:r}=e;const{actionConfig:s,skipSemanticUrl:a}=e,o=s.containerName||ac.getTargetViewContainerName(ne),i=Pt(o,s.context);yo.publish(U.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_INIT,{pageName:e.actionConfig.viewName,pageClass:e.actionConfig.className});const{remoteCasePayload:c,updatedType:l}=((e,t,n,r)=>{let s={},a=e;if(n.isTraditionalRemoteCase){s={...n};const e=Sp(r,s.insKey);e&&(t.activateContainerActionPayload={containerItemID:e},a=ve)}return{remoteCasePayload:s,updatedType:a}})(r,e,s,i);if(r=l??r,s.isDeferLoaded){const{response:r,headers:o={}}=e,{isCreateDataObject:c,context:l}=s,u=Ed(r,{isCreateDataObject:c});u.directUrlUpdation=!a;const d={acName:i,context:l};await Yc(u,s,d);const p=zc(u,{containerItemID:l,target:i,headers:o,context:l});t.rootView=jg.getIn(u,j.ROOT),n.push(Cf(Yg,p))}else if(r===ve){const{activateContainerActionPayload:{semanticURL:t,containerItemID:r}}=e,a={acName:i,context:vp(r)};s.isTraditionalRemoteCase||await Yc({directUrlUpdation:!0,semanticURL:t},s,a,!0),n.push(Cf(hf,{target:i,containerItemID:r}))}else{const t=el(i,o,s.context),{response:r,headers:l={},removeActionPayload:u}=e,d=Ed(r,{isCreateDataObject:s.isCreateDataObject});d.directUrlUpdation=!a;const p={acName:i,context:t},h=$c(t);await Yc(d,s,p);const g={target:i,context:t,containerItemID:t,headers:l,debugInfo:s.debugInfo,currentCaseViewMode:h,referenceList:s?.referenceListStr,subscriptName:s?.subscriptName},f=zc(d,g);f.resourceType=U.PAGE,s.isCreateDataObject&&(f.resourceType=U.RESOURCE_TYPES.DATA,f.resourceStatus=U.RESOURCE_STATUS.CREATE,delete f.data.caseInfo,f.referenceList=s.referenceListStr,f.subscriptName=s.subscriptName),((e,t,n)=>{e.isTraditionalRemoteCase&&(n.resourceType=U.CASE,n.key=Rl.getRemoteCaseKey(t.assignmentID,t.insKey),n.data.caseInfo={...n.data.caseInfo,...t,classID:t.className,target:n.target,containerItemID:n.containerItemID,caseTypeID:t.className,content:{pyLabel:t.name,pyID:Pc(Rl.getRemoteCaseKey(t.assignmentID,t.insKey))}},n.isTraditionalRemoteCase=!0,n.className=t.className)})(s,c,f),f.data??={},f.data.traditionalGadgetId=Rl.getUniqueGadgetId();const m=Zc(i,f);u.containerItemID&&tl(m)&&n.push(Cf(ff,{containerItemID:u.containerItemID,target:i})),n.push(m),il(n)}return yo.publish(U.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_DONE,{target:i,pageName:e.actionConfig.viewName,pageClass:e.actionConfig.className}),t})),tu((({actionManagerID:e=0,rootView:t})=>{rc.resolveActionByID(e,t),Cg(n),n=[]})),CA())}],NA=TA,OA=(e,t)=>{const{context:n,pageName:r,dataContext:s,dataContextParameters:a,semanticURL:o,skipSemanticUrl:i,RemoteSystemID:c}=e,{removeActionPayload:l}=t,{restApi:u,reqType:d,body:p}=$f(Ve,{pageName:r,dataContext:s,dataContextParameters:a}),h={};return h.RemoteSystemID=c,La(Bo(u,{method:d,headers:h,body:p},n)).pipe(tu((t=>({response:{...t.data,key:o,semanticURL:o},actionConfig:e,headers:Hc(t.headers),removeActionPayload:l,skipSemanticUrl:i}))),lu("Error occurred during ajax call at showData Epic : ",e.context))},{RESOURCE_TYPES:PA}=U,DA=(e,t)=>{const n=Object.getOwnPropertyDescriptor(e,t);return Object.hasOwn(e,t)&&n&&!0===n.writable&&"string"==typeof e[t]},RA=e=>{let t,n=0,r=[];return e.pipe(Zl(re),NE((e=>(({actionMgrID:n}=e.payload),ou(e.payload).pipe(nu((e=>((e,t)=>{const{context:n,pageName:r,dataContext:s,dataContextParameters:a,skipSemanticUrl:o=!1,isDeferLoaded:i=!1,parentAction:c="",resourceType:l,containerName:u,RemoteSystemID:d}=e;for(let e=0,t=Object.keys(a);e<t.length;e+=1){const n=t[e];DA(a,n)&&(a[n]=decodeURIComponent(a[n]))}const p=Pt(u,n);let h="",g={},f=!1;for(let e=0,t=Object.keys(a);e<t.length;e+=1){const n=t[e],r=a[n];DA(a,n)&&(a[n]=jg.containsEncodedPattern(r)?r:encodeURIComponent(r))}if(!o){h=Vf(Ve,{pageName:r,dataViewName:s},a);const{activate:n,activateContainerActionPayload:o}=al(PA.PAGE,p,{semanticURL:h});if(n)return ou({type:ve,activateContainerActionPayload:o,actionConfig:e});if(({continueExecution:f,removeActionPayload:g}=rl(p)),!f)return rc.rejectActionByID(t),cu()}return OA({context:n,pageName:r,dataContext:s,dataContextParameters:a,semanticURL:h,skipSemanticUrl:o,containerName:u,isDeferLoaded:i,parentAction:c,resourceType:l,RemoteSystemID:d},{removeActionPayload:g})})(e,n))),nu((async e=>{if(e&&e.type===Ee)return r.push(Qc(e)),r;const{type:n,actionConfig:s,headers:a,response:o,skipSemanticUrl:i}=e;t=jg.getIn(o,j.ROOT);const{containerName:c,parentAction:l,resourceType:u}=s,d=Pt(c,s.context);let p;const h=$c(s?.context);if(s.isDeferLoaded){p=Ed(o),p.directUrlUpdation=!i;const t={acName:d,context:s.context};await Yc(p,s,t);const n={target:d,headers:a,context:s.context,containerItemID:e.containerItemID},c=zc(p,n);return r=Cf(Yg,c),r}if(n===ve){const{activateContainerActionPayload:{semanticURL:t,containerItemID:n}}=e,a={acName:d,context:vp(n)};await Yc({directUrlUpdation:!0,semanticURL:t},s,a,!0),r.push(Cf(hf,{target:d,containerItemID:n,resourceType:PA.DATA}))}else if("DATA"===u&&l===ht){const{context:e}=s,t=o?.data,n={context:e,data:t};r.push(Cf(Yg,n))}else{const t=el(d,c,s.context),{removeActionPayload:n}=e;p=Ed(o),p.directUrlUpdation=!i;const l={acName:d,context:t};await Yc(p,s,l);const u=zc(p,{target:d,context:t,containerItemID:t,headers:a,currentCaseViewMode:h});u.resourceType=PA.DATA;const g=Zc(d,u);n.containerItemID&&tl(g)&&r.push(Cf(ff,{containerItemID:n.containerItemID,target:d})),il(r),r.push(g)}return r})),tu((()=>(rc.resolveActionByID(n,t),Cg(r),r=[],r))))))))},bA=e=>{const{dataViewName:t,context:n,dataViewParameters:r}=e,s={data_view_ID:t,dataViewParameters:encodeURIComponent(JSON.stringify(r))},{restApi:a,reqType:o}=$f("deleteDataObject",s);return La(Bo(a,{method:o},n)).pipe(tu((t=>({response:t.data,actionInPayload:e}))),lu("Error occurred during ajax call at deleteDataObject Epic",n))},vA=e=>{let t=0,n=[];return e.pipe(Zl(lt),uu(100),tu((e=>(({actionMgrID:t}=e.payload),e.payload))),nu((e=>bA(e))),nu((async e=>{if(e&&e.type===Ee){const{payload:r}=e,s=Qc({...e,...r,actionMgrID:t});return n.push(s),n}return[]})),tu((()=>(1===n.length&&Tc(n[0].type)?rc.rejectActionByID(t):rc.resolveActionByID(t),Cg(n),n=[],n))))},xA=e=>{const{dataViewID:t,dataViewParameters:n,context:r}=e,s={data_view_ID:t},{restApi:a,reqType:o}=$f("getDataObjectActions",s);return La(Bo(a,{method:o,body:{dataViewParameters:n}},r)).pipe(tu((e=>({...e.data}))),lu("Error occurred during ajax call at GET data object actions : ",e.context))},wA=e=>{let t=0,n=[];let r={};return e.pipe(Zl(Ie),uu(100),tu((e=>(({actionMgrID:t}=e.payload),e.payload))),nu((e=>xA(e))),nu((async e=>e&&e.type===Ee?(n.push(Qc(e)),n):(r=e,[]))),tu((()=>(1===n.length&&Tc(n[0].type)?rc.rejectActionByID(t):rc.resolveActionByID(t,r),Cg(n),n=[],n))))},MA=[RA,e=>{let t=0,n=[];return e.pipe(Zl(ct),uu(100),eu((e=>{const{isFormValid:r}=e.payload;if(({actionMgrID:t}=e.payload),!r){const e={type:U.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return rc.rejectActionByID(t,!0,e),ou([])}return ou(e.payload).pipe(nu((e=>du(e))),nu((async e=>{if(e&&e.type===Ee){const{payload:r}=e,s=Qc({...e,...r,actionMgrID:t});return n.push(s),n}const{actionInPayload:r}=e,{containerItemID:s,isModalAction:a}=r,o=a?gp.MODAL:gp.PRIMARY,i={target:Pt(o,s),containerItemID:s,context:s};return n.push(Cf(ff,i)),n})),tu((()=>(1===n.length&&Tc(n[0].type)?rc.rejectActionByID(t):rc.resolveActionByID(t),Cg(n),n=[],n))))})))},e=>{let t=0,n=[];return e.pipe(Zl(ut),uu(100),tu((e=>(({actionMgrID:t}=e.payload),e.payload))),nu((e=>pu(e))),nu((async e=>{if(e&&e.type===Ee){const{payload:r}=e,s=Qc({...e,...r,actionMgrID:t});return n.push(s),n}const{actionInPayload:r,response:s,headers:a={}}=e,{containerName:o,readOnly:i,actionName:c}=r,l=Pt(o,r.context),u=el(l,o,r.context),d={acName:l,context:u};if(s?.data?.dataInfo){const{dataInfo:e}=s.data;e.dataContext||=r.dataLookUp,e.dataContextParameters||=r.requestPayload}await Yc(s,r,d);const p=zc(s,{target:l,context:u,containerItemID:u,headers:a});return p.resourceType=U.RESOURCE_TYPES.DATA,p.resourceStatus=U.RESOURCE_STATUS.UPDATE,p.readOnly=i,p.actionName=c,p.key=JSON.stringify(r.requestPayload),n.push(Cf(nf,p)),n})),tu((()=>(1===n.length&&Tc(n[0].type)?rc.rejectActionByID(t):rc.resolveActionByID(t),Cg(n),n=[],n))))},e=>{let t=0,n=[];return e.pipe(Zl(dt),uu(100),eu((e=>{const{isFormValid:r}=e.payload;if(({actionMgrID:t}=e.payload),!r){const e={type:U.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return rc.rejectActionByID(t,!0,e),ou([])}return ou(e.payload).pipe(nu((e=>hu(e))),nu((async e=>{if(e&&e.type===Ee){const{payload:r}=e,s=Qc({...e,...r,actionMgrID:t});return n.push(s),n}const{actionInPayload:r}=e,{containerItemID:s,isModalAction:a}=r,o=a?gp.MODAL:gp.PRIMARY,i={target:Pt(o,s),containerItemID:s,context:s};return n.push(Cf(ff,i)),n})),tu((()=>(1===n.length&&Tc(n[0].type)?rc.rejectActionByID(t):rc.resolveActionByID(t),Cg(n),n=[],n))))})))},vA,wA,e=>{let t=0,n=[];return e.pipe(Zl(pt),uu(100),tu((e=>(({actionMgrID:t}=e.payload),e.payload))),nu((e=>gu(e))),nu((async e=>{if(e&&e.type===Ee){const{payload:r}=e,s=Qc({...e,...r,actionMgrID:t});return n.push(s),n}const{actionInPayload:r,response:s,headers:a={}}=e,{containerName:o,actionID:i,context:c,actionName:l}=r,u=Pt(o,r.context);let d=H(o,c);d=K(c,d);const p={target:u,context:d,containerItemID:d,headers:a,resourceType:U.RESOURCE_TYPES.DATA,resourceStatus:U.RESOURCE_STATUS.OPEN_FLOW_ACTION,key:JSON.stringify(r.dataViewParameters),actionID:i,actionName:l};if(s?.data?.dataInfo){const{dataInfo:e}=s.data;e.dataContext||=r.lookupDatapage,e.dataContextParameters||=r.dataViewParameters}const h={acName:u,context:c};await Yc(s,r,h);const g=zc(s,p);return n.push(Cf(nf,g)),n})),tu((()=>(1===n.length&&Tc(n[0].type)?rc.rejectActionByID(t):rc.resolveActionByID(t),Cg(n),n=[],n))))},e=>{let t=0,n=[];return e.pipe(Zl(ht),uu(100),eu((e=>{const{isFormValid:r}=e.payload;({actionMgrID:t}=e.payload);const s=e.payload.context;if(!r){const e={type:U.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return rc.rejectActionByID(t,!0,e),ou([])}return io({context:s,stateObj:Sg(s),clearContextMessages:!0}),ou(e.payload).pipe(nu((e=>fu(e))),nu((async e=>{if(e&&e.type===Ee){Vl(e,"dataObject");const{payload:r}=e,s=Qc({...e,...r,actionMgrID:t});return n.push(s),n}const{actionInPayload:r,response:s,headers:a={}}=e,{containerName:o,containerItemID:i,resourceType:c,key:l}=r,u=Pt(o,r.context),d={acName:u,context:r.context};await Yc(s,r,d);const p={key:l,target:u,resourceType:c,containerItemID:i,headers:a,context:r.context};return n=((e,t,n,r)=>{const{resourceType:s,key:a,containerItemID:o}=r,i=zc(n,t);i.resourceType=s||U.RESOURCE_TYPES.DATA;const c=J(o);e.push(Cf(ff,i));const l=Og(".dataContext","dataInfo",c),u=Og(".dataContextParameters","dataInfo",c),d={context:c,skipSemanticUrl:!0,resourceType:s,parentAction:ht,dataContext:l,dataContextParameters:u},p=l&&u&&Vf(Ve,{pageName:j.PY_DETAILS,dataViewName:l},u)||"";if(o?.includes(j.PREVIEW)){const t={type:re,payload:{pageName:j.VIEW_NAMES.PY_DATA_PREVIEW,container:j.PREVIEW,containerName:j.PREVIEW,...d}};e.push(t)}else if(s!==j.PAGE&&a===p&&o?.includes(j.PRIMARY)){const t={type:re,payload:{pageName:j.VIEW_NAMES.PY_DETAILS,containerName:"",...d}};e.push(t)}return e})(n,p,s,{key:l,resourceType:c,containerItemID:i}),n})),tu((()=>(1===n.length&&Tc(n[0].type)?rc.rejectActionByID(t):rc.resolveActionByID(t),Cg(n),n=[],n))))})))}],LA=MA;function FA(e,t){return void 0===t&&(t=iA),Da((function(n,r){var s=null,a=null,o=null,i=function(){if(s){s.unsubscribe(),s=null;var e=a;a=null,r.next(e)}};function c(){var n=o+e,a=t.now();if(a<n)return s=this.schedule(void 0,n-a),void r.add(s);i()}n.subscribe(Ra(r,(function(n){a=n,o=t.now(),s||(s=t.schedule(c,e),r.add(s))}),(function(){i(),r.complete()}),void 0,(function(){a=s=null})))}))}const{RESOURCE_TYPES:{CASE:UA,DATA:jA,OBJECT:VA}}=U;let kA=[],$A=!1,BA=!1;const GA={},WA=[e=>e.pipe(Zl(ye),FA(200),tu((e=>e.payload)),nu((e=>{BA=!1,yo.subscribe(U.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_STARTED,(()=>{BA=!0}));const t=Eo.getPreviewMode()&&xo.addDebugHeaders({debugId:jg.generateUniqueID()});GA.dataContext=e.payload.dataViewName,GA.dataContextParameters=(e=>{if(!e)return e;const t={};for(let n=0,r=Object.keys(e);n<r.length;n+=1){const s=r[n];if(Object.hasOwn(e,s)){const n=e[s];t[s]=jg.containsEncodedPattern(n)?decodeURIComponent(n):encodeURIComponent(n)}}return t})(e.payload.dataViewKeys);const{context:n,requestType:r,routeKey:s}=e;let{routeEndpoint:a}=e;a&&(a.indexOf("viewType={viewType}")>0?a=a.replace("{viewType}","page"):a.indexOf('viewType=""')>0&&(a=a.replace('viewType=""','viewType="page"'))),$A=s===Tt,$A&&F.setNeedsMapping(!0);const o=E()+a,i=e.options.context;let c;const l={},u=e?.payload?.caseClassName;if($.isRemoteCase(u)){const{RemoteSystemID:e}=$.getRemoteCase(u);l.RemoteSystemID=e}if(Dh.isWSSPortal()&&(l[j.X_ORIGIN_CHANNEL]="WSS"),"POST"===r){c=e.payload,a.indexOf("viewType=")<0&&(a=`${a}?viewType=page`);let i;switch(cl(s)){case UA:case VA:i={caseTypeID:c.caseTypeID,processID:c.processID,content:{}};break;case jA:i=GA;break;default:i=c}return La(Bo(o,{method:r,body:i,headers:{...l,...t}},n)).pipe(tu((t=>({response:{...t.data},payload:e,headers:Hc(t.headers,"",l)}))),lu(": Error occurred during ajax call at historyEpic : ",e))}return La(Bo(o,{method:"GET",headers:{...l,...t}},i.substring(0,i.lastIndexOf("/")))).pipe(tu((n=>({response:n.data,payload:e,headers:{...Hc(n.headers),...t}}))),Ua((r=>{if(s===Qe){const n={messages:[{type:"error",message:r.response.data.errorDetails[0].localizedValue}],category:"PAGE"};tc.setComponentCache("assignments-launchAssignment-Error",n);const s=Sh(_h()),a=Ph.getEndPointInfo(s.split("/assignments")[0]),o=E()+a.routeEndpoint;return e={...e,routeKey:Be,resetSemanticURL:!0},La(Bo(o,{method:a.reqType,headers:{...l,...t}},i.substring(0,i.lastIndexOf("/")))).pipe(tu((n=>({response:n.data,payload:e,headers:{...Hc(n.headers),...t}}))))}return ou(Sf(": Error occurred during ajax call at historyEpic : ",r,n))})))})),nu((async e=>{if(BA)return kA;if(yo.subscribe(U.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_STARTED,(()=>{BA=!0})),e&&e.type===Ee)return Qc(e);const{headers:t={},response:n,payload:r}=e,s=Ed(n,{[U.STOPMERGEACTIONS]:!n.nextAssignmentInfo}),a=r.options.acName,o=Up(a)&&Vp(a)?Dp(a):e.payload.options.context,i=o;t.RemoteSystemID=r?.payload?.RemoteSystemID;const c={target:a,context:o,containerItemID:i,headers:t,debugInfo:{debugId:t[j.COREHEADER_APP_DEBUG_ID]}};let l=r?.payload?.pageClass;const u=r?.payload?.page,d=$A?Tt:Be,p=$A?r.payload.objectID:r.payload.workID,h=$A?"{objectID}":"{workID}";let g=$A?`objects/${p}`:"";r?.payload?.caseName&&p&&(g=Vf(d,{caseName:e.payload.payload.caseName}),g=g?.replace(h,p)||"",l=r?.payload?.caseClassName),(r?.routeKey===Qe||r?.resetSemanticURL)&&((e,t)=>{const n=bc(t);let r=Vf(Be,{caseClassName:Dc(t)},{id:n});r=r?.replace("{workID}",String(Pc(n))).replace("{id}",String(Pc(n))),Yf({directUrlUpdation:!0,semanticURL:r,options:{}})})(0,s),yo.publish(U.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_INIT,{pageName:u,pageClass:l});const f=jg.getIn(s,j.LOCALE_REFERENCES);await vh.loadLocaleResources(f);const m=jg.getIn(s,j.COMPONENTS);m&&await ec(m),ji(s,r.options.actionConfig,!0),yo.publish(U.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_DONE,{target:a,pageName:u,pageClass:l});let I=zc(s,c);return I=((e,t,n)=>{if(e===Bc.CASE||e===Bc.OBJECT||e===Bc.ASSIGNMENT){if(t?.caseInfo?.assignments&&t?.caseInfo?.assignments.length>0){const{key:e,flowName:r}=Jc(t.caseInfo.assignments[0].ID);n.key=e||t.caseInfo.ID,n.flowName=r}else n.flowName="",n.key=t?.caseInfo?.ID||t?.objectInfo?.ID||t.semanticURL;n.resourceType=e,n.semanticURL=t.semanticURL,e===Bc.ASSIGNMENT?(n.caseViewMode=j.PERFORM_MODE,n.resourceType=Bc.CASE):n.caseViewMode=j.REVIEW_MODE}else n.resourceType=e,n.semanticURL=t.semanticURL;return n})(cl(e.payload.routeKey),{...n.data,semanticURL:g,caseViewMode:j.REVIEW_MODE},I),kA.push(Zc(a,I)),((e,t)=>{let n=tc.getComponentCache("assignments-launchAssignment-Error")||{};n&&"object"==typeof n&&Object.keys(n).length>0&&(n={...n,context:e},t.push(Cf(gf,n)),tc.resetComponentCache("assignments-launchAssignment-Error"))})(o,kA),il(kA),kA})),tu((()=>(BA||Cg(kA),kA=[],$A=!1,BA=!1,kA))),lu("Error occurred"))],HA=WA,qA=[e=>{let t=0;return e.pipe(Zl(tt),tu((e=>(({actionMgrID:t}=e.payload),e.payload))),tu((()=>{const e=_g()?.getState(),n=iy();return h()(e,n)&&t>0?rc.resolveActionByID(t,{}):rc.rejectActionByID(t),[]})),CA())}],zA=[e=>{let t=0,n=[];return e.pipe(Zl(se),tu((e=>(({actionMgrID:t}=e.payload),e.payload))),nu((e=>{const{context:t,skipSemanticUrl:n=!1,insightID:r}=e;let s,a="";n||(a=Vf(ke,{insightID:"{insightID}"}),a=a.replace("{insightID}",r),s=Ph.getEndPointInfo(a));const{restApi:o,reqType:i}=$f(ke,{...s?.payload||[],insightID:r});return La(Bo(o,{method:i},t)).pipe(tu((t=>{let r={};return r="string"==typeof t.data?JSON.parse(t.data):t.data,{response:{...r,key:a,semanticURL:a},actionConfig:e,skipSemanticUrl:n}})),lu(": Error occurred during ajax call at showPage Epic : ",e.context))})),nu((async e=>{if(e&&e.type===Ee)return n.push(Qc(e)),n;const{actionConfig:t,skipSemanticUrl:r}=e,s=ac.getTargetViewContainerName(ne),a=Pt(s,t.context),o=el(a,s,t.context),{response:i}=e,c=Ed(i);c.directUrlUpdation=!r;const l={acName:a,context:o},u=!r,d=r;await Yc(c,t,l,u,d);const p=zc(c,{target:a,context:o,containerItemID:o});p.resourceType=U.PAGE;const h=Zc(a,p);return n.push(h),il(n),n})),tu((()=>{rc.resolveActionByID(t),Cg(n),n=[]})),CA())}],YA=zA,KA=[e=>{let t=0,n=[];return e.pipe(Zl(ae),tu((e=>(({actionMgrID:t}=e.payload),e.payload))),nu((e=>{const{context:t,skipSemanticUrl:n=!1,dashboardID:r}=e;let s="";n||(s=Vf($e,{dashboardID:r}),s=s.replace("{dashboardID}",r));const{restApi:a,reqType:o}=$f($e,{dashboardID:r});return La(Bo(a,{method:o},t)).pipe(tu((t=>{let r={};return r="string"==typeof t.data?JSON.parse(t.data):t.data,{response:{...r,key:s,semanticURL:s},actionConfig:e,skipSemanticUrl:n}})),lu(": Error occurred during ajax call at showPage Epic : ",e.context))})),nu((async e=>{if(e&&e.type===Ee)return n.push(Qc(e)),n;const{actionConfig:t,skipSemanticUrl:r}=e,s=ac.getTargetViewContainerName(ne),a=Pt(s,t.context),o=el(a,s,t.context),{response:i}=e,c=Ed(i);c.directUrlUpdation=!r;const l={acName:a,context:o},u=!r,d=r;await Yc(c,t,l,u,d);const p=zc(c,{target:a,context:o,containerItemID:o});p.resourceType=U.PAGE;const h=Zc(a,p);return n.push(h)})),tu((()=>{rc.resolveActionByID(t),Cg(n),n=[]})),CA())}],JA=KA,XA=e=>{const{containerName:t,isInCreateStage:n}=e;return n?j.MODAL:t||ac.getTargetViewContainerName(St)},QA=e=>"pzCreateDetails"===e?.uiResources?.root?.config?.name||!1,ZA=(e,t)=>{const n=QA(e),{skipBrowserSemanticUrlUpdate:r=!1}=t;jg.setIn(e,["directUrlUpdation"],!n&&!r)},e_=e=>e.confirmationNote?j.REVIEW_MODE:j.PERFORM_MODE,t_=(e,t)=>{let n;return n=!e.renderInline&&!Dh.getDefaultCasePage()&&QA(t),n},n_=(e,t)=>{const{class:n,context:r,viewType:s=Gc.PAGE}=e,{removeActionPayload:a}=t,o=e?.pageName?e?.pageName:Dh.getDefaultCasePage();return La(ki.createCase(n,{...e,pageName:o,viewType:s,context:r})).pipe(tu((({response:t,headers:n})=>(F.analyseResponse(t),{response:t,actionInPayload:e,headers:n,removeActionPayload:a}))),lu("Error occurred during ajax call at createObject Epic : ",r))},r_="CREATE_OBJECT",s_=e=>{let t,n=0,r=[],s={};return e.pipe(Zl(r_),uu(100),eu((e=>{if(({actionMgrID:n}=e.payload),Rl.isExternalObject(e.payload.class)&&!Nl(e.payload.context)){const e={type:U.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return rc.rejectActionByID(n,!0,e),ou([])}return ou(e.payload).pipe(nu((e=>{const{context:r}=e;t=e.class;const s=XA(e),a=Pt(s,r),{continueExecution:o,removeActionPayload:i}=Py(a);return o?n_(e,{removeActionPayload:i}):(rc.rejectActionByID(n),cu())})),nu((async e=>{if(e&&e.type===Ee)return e.payload.context=((e,t)=>Rl.isExternalObject(e)&&t?t:ih())(t,e.payload.context),r.push(Qc(e)),r;const{actionInPayload:a,response:o,headers:i,removeActionPayload:c}=e,l=t_(a,o);jg.setIn(o.data,j.getProperty(j.CASE_INFO.IS_FIRST_ASSIGNMENT),!0);const u=XA({...a,isInCreateStage:l}),d=Pt(u,a.context),p=el(d,u,a.context);if(((e,t)=>{Rl.isExternalObject(e.class)&&(e.containerItemID=e.context,Ky(t,e))})(a,r),((e,t,n)=>!Cc(e)&&Up(t)&&!Rl.isExternalObject(n))(u,d,t)){const{continueExecution:e}=rl(d);if(!e)return rc.rejectActionByID(n),cu()}if(((e,t)=>!e&&!t)(a?.openCaseViewAfterCreate??!0,l)){const{businessID:e,caseType:t,resolvedURL:n}=gc(o);return s={id:e,label:t,href:n},by(s),vy({caseId:e,caseType:t}),r}(e=>{Rl.isExternalObject(e.class)&&by({content:vh.getLocaleValue("Successfully submitted!","Assignment")})})(a);const h=Ed(o),g=String(Pc(uc(h)));let f=Vf(St,{caseClassName:lc(h)});f=f.replace(/{.+?}/,g),h.semanticURL=f,tc.setComponentCache(g,xo.addDebugHeaders(a.debugInfo)),ZA(h,a);const m={acName:d,context:p};await Yc(h,a,m);const I={target:d,context:p,headers:i,semanticURL:f,caseViewMode:e_(h),containerItemID:p,isInCreateStage:l,isMinimizable:l,assignmentContext:jg.getIn(h,Ny),nextAssignmentInfo:jg.getIn(h,Ty),resourceType:U.RESOURCE_TYPES.OBJECT,openCaseViewAfterCreate:a.openCaseViewAfterCreate,modalOptions:a.modalOptions,debugInfo:a.debugInfo};dc(I,h);const y=zc(h,I),E=Zc(d,y);return((e,t,n)=>{if(tl(e)){const{removeActionPayload:e,target:r}=t;xc(n,{removeActionPayload:e,target:r})}})(E,{removeActionPayload:c,target:d},r),r.push(E),il(r),r})),tu((()=>(ul(r),Fc(r,n),(e=>{Rl.isExternalObject(e)&&F.setNeedsMapping(!1)})(t),s={},r=[],r))))})))},a_=(e,t)=>{const{assignmentID:n,actionID:r,caseID:s,context:a,additionalHeaders:o={},jsActionQueryParams:i}=e,{state$:c}=t,l=Gc.PAGE,u="executeObjectWideAction",d={assignmentID:n,actionID:r,viewType:l,objectID:s};let{restApi:p}=$f(u,d);const{reqType:h}=$f(u,d);l&&!p?.includes("viewType=")&&(p=p?.includes("?")?`${p}&viewType=${l}`:`${p}?viewType=${l}`),p=jl(i,p),e.viewType=l;const{content:g}=qc(a,{isObjectWideAction:!0}),f=c.value.data[a]?.objectInfo?.headers||{},{etag:m}=f,I={"if-match":m,...o};return La(Bo(p,{method:h,body:g,headers:I},a)).pipe(tu((t=>{const{data:n,headers:r}=t;return F.analyseResponse(t.data),{actionInPayload:e,response:n,headers:Hc({...I,...r})}})),lu("Error occurred during ajax call at executeObjectWideAction Epic : ",a))},o_=(e,t)=>{const{isCaseWideAction:n}=t;return{isCaseWideAction:n,caseID:uc(e)}},{RESOURCE_TYPES:i_}=U,c_=(e,t)=>{let n=0,r=[],s={},a="";return e.pipe(Zl(Ct),eu((e=>{if(({actionMgrID:n}=e.payload),a=e.payload.context,io({context:a,stateObj:Sg(a),clearContextMessages:!0}),!Nl(a)){const t={type:U.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return rc.rejectActionByID(n,!0,t),zu.handleDeferredActionCompletion(e.payload.context),ou([])}return ou(e.payload).pipe(nu((e=>{Yy(r,e);const n={...e};return a_(n,{state$:t})})),nu((async e=>{if(e?.type===Ee){const t=Qc(e);return r.push(t),r}ku.clearContextedCache(a);const{headers:t,actionInPayload:o,response:i}=e,{containerItemID:c,isModalAction:l,isInCreateStage:u}=o,d=qp(c);o.target=d,jg.setIn(i.data,j.OBJECT_INFO_IS_LOCAL_ACTION,!1),uE({submitResponse:i});let p=Ed(i,{[U.STOPMERGEACTIONS]:!i.nextAssignmentInfo});const h=lc(p),g=W(o.context),f=Mp(g)[0]?Dp(Mp(g)[0]):g,m=(e=>{const t=pc(e);return vl(t)&&xl(Dh.getOperatorIdentifier(),t)})(p),I=u&&!m;!l||u||eE(o.context,f)||(p=ol(p,Sg(c)));const y=zc(p,{headers:t,actionMgrID:n,directUrlUpdation:!1});((e,t)=>{const{attachmentsExist:n}=t;n&&jg.setIn(e,U.SUMMARY_OF_ATTACHMENTS_LAST_REFRESH_TIME,(new Date).toLocaleString()),jg.setIn(e,U.SUMMARY_OF_ASSIGNMENT_LAST_SUBMIT_TIME,(new Date).toLocaleString())})(y.data,o),y.caseClassName=h,y.resourceType=i_.ASSIGNMENT,y.headers=t;const E=uc(p);dc(y,p);const A=Vf(St,{caseClassName:h}).replace(/{.+?}/,String(Pc(E)));p.semanticURL=A,y.semanticURL=A,await oE(o,y,!1,E,p,r,e,i,!0),I&&(s=tE(o),vy({caseId:o.caseID,caseType:o.caseTypeID,assignmentId:o.assignmentID})),((e,t)=>{const n=lc(e?.response),r=pc(e?.response),{caseTypeID:s}=r,a=Dh.getFeatureMap();(a?.deferUpdateCaseSummaryView??!Object.hasOwn(a,j.DEFER_UPDATE_CASESUMMARY_VIEW))&&s&&eg(j.CASESUMMARY_VIEW_NAME,s)&&Vc(t,e?.actionInPayload,{caseClassName:n})})(e,r),zu.handleDeferredActionCompletion(a),iE(y,o,f);const _=o_(p,o);return mc({..._,containerItemID:c}),Qy(r,{transientItemID:c,target:d,isModalAction:l}),r})),tu((()=>{const e=r.find((e=>e.type===Ee));return e?(zu.handleDeferredActionCompletion(a),cE(e),rc.rejectActionByID(n)):rc.resolveActionByID(n,s),ul(r),F.setNeedsMapping(!1),r=[],s={},r})))})))},l_=(e,t)=>{const{insKey:n,headers:r,context:s,debugInfo:a,viewType:o}=e,{removeActionPayload:i}=t,c=e?.pageName?e?.pageName:Dh.getDefaultCasePage(),l=$f(Tt,{objectID:n,params:{pageName:c}});let{restApi:u}=l;const{reqType:d}=l;return"none"===o&&(u=`${u?.split("viewType")[0]}viewType=none`),La(Bo(u,{method:d,headers:{...r,...a&&{...xo.addDebugHeaders(a)}}},s)).pipe(tu((t=>(F.analyseResponse(t.data),{response:t.data,actionInPayload:e,headers:Hc({...r,...t.headers}),removeActionPayload:i}))),lu("Error occurred during ajax call at getObject Epic : ",s))},u_="GET_OBJECT",{RESOURCE_TYPES:d_}=U,p_=async(e,t)=>{const{actionInPayload:n,activateContainerActionPayload:r,type:s,response:a,removeActionPayload:o,headers:i}=e,{context:c,skipBrowserSemanticUrlUpdate:l,debugInfo:u}=n,d=Ec(Tt,n),p=Pt(d,c);if(Sc(s))await(async(e,t)=>{const{activateContainerActionPayload:{semanticURL:n,containerItemID:r},actionInPayload:s,actionInPayload:{context:a,skipBrowserSemanticUrlUpdate:o,doDeleteCaseSummary:i}}=t,c=Ec(Tt,s),l=Pt(c,a),u=vp(r);await Yc({directUrlUpdation:!o,semanticURL:n},s,{acName:l,containerName:c,target:l,context:u}),e.push(Cf(hf,{containerItemID:r,target:l,context:u,doDeleteCaseSummary:i}))})(t,{activateContainerActionPayload:r,actionInPayload:n});else{const e=el(p,d,c,{buildNew:!0}),r=Ed(a),s=(e=>{const t=uc(e),n=lc(e);let r=Vf(Tt,{objectClassName:n});return r=r?.replace("{objectID}",String(Pc(t))),r})(r);r.semanticURL=s,r.directUrlUpdation=!l;const h={acName:p,context:e};await Yc(r,n,h);const g=zc(r,{target:p,context:e,containerItemID:e,semanticURL:s,headers:i,debugInfo:u});g.caseViewMode=j.REVIEW_MODE,g.resourceType=d_.OBJECT,dc(g,r);const f=Zc(p,g);o.containerItemID&&tl(f)&&t.push(Cf(ff,{containerItemID:o.containerItemID,target:p})),t.push(f)}il(t);const h=n.insKey;Ic({caseKey:h,actionInContext:c})},h_=e=>{let t=0,n=[];return e.pipe(Zl(u_),tu((e=>(({actionMgrID:t}=e.payload),e.payload))),nu((e=>{const{context:n,isChild:r,viewType:s}=e,a=Ec(Tt,e),o=Pt(a,n);let i,c=!0;if("none"!==s){const e=rl(o);c=e.continueExecution,i=e.removeActionPayload}if(!c)return rc.rejectActionByID(t),cu();const{activate:l,activateContainerActionPayload:u}=al(d_.OBJECT,o,e);return l&&!r&&"none"!==s?ou({type:ve,activateContainerActionPayload:u,actionInPayload:e}):l_(e,{removeActionPayload:i})})),nu((async e=>{if(e&&Tc(e.type))return n.push(Qc(e)),n;if("none"===e?.actionInPayload?.viewType){const t=Sg(e?.actionInPayload?.context);if(t?.context_data?.caseViewMode!==j.PERFORM_MODE){const t=Ed(e?.response),r={data:{...t?.data},context:e?.actionInPayload?.context,isArrayDeepMerge:!0};n.push({type:ot,payload:{context:r.context,doDeleteConfirmationDetails:!1}}),n.push(Cf(Yg,r));const s=qp(e?.actionInPayload?.context),a=Ac(e?.actionInPayload?.context),o=Object.freeze({target:s,containerItemID:e?.actionInPayload?.context,context:e?.actionInPayload?.context,containerName:a});if(hc(e?.actionInPayload?.context)){const t=zc(e?.response,{...o});ll({...t,isArrayDeepMerge:!0},n)}}}else await p_(e,n);return n})),tu((()=>(Cg(n),Fc(n,t),n=[],n))))},g_="OPEN_OBJECT_ACTION",f_=e=>{const{actionID:t,caseID:n,context:r,openActionType:s,modalLoadingContainer:a}=e,o=Gc.FORM,i=$f(Nt,{objectID:n,actionID:t,viewType:o}),{reqType:c}=i;let{restApi:l}=i;e.actionType=j.RESOURCE_TYPES.OBJECT,l&&!l.includes("viewType=")&&(l=l.includes("?")?`${l}&viewType=${o}`:`${l}?viewType=${o}`);const u=a?.context??r;return La(Bo(l,{method:c,headers:{}},u)).pipe(tu((t=>(F.analyseResponse(t.data),{response:t.data,actionInPayload:e,headers:Hc(t.headers)}))),lu(`: Error occurred during ajax call at ${s} Epic : `,u))},m_=async(e,t,{headers:n,actionInPayload:r})=>{const{context:s,actionName:a,openActionType:o,doDeleteCaseSummary:i,modalLoadingContainer:c}=r,l=Ed(e,{info:U.OBJECT_INFO.OBJECT_INFO}),u=Ec(o,r),d=c?.target??Pt(u,s),{context:p,containerItemID:h,isNewContainerItem:g}=((e,t,n,r)=>{let s,a,o=!1;const i=jp(e);return!Vp(e)||i&&!Cp(e,r)?(a=H(t,n),Cc(t)&&(a=K(n,a)),s=a,o=!0):(s=i?Sp(e,r):Dp(e),a=vp(s)),{context:a,containerItemID:s,isNewContainerItem:o}})(d,u,s,e.data.objectInfo.ID),f={acName:d,target:d,containerName:u,context:p};await Yc(l,r,f);const m=l.uiResources?.root,I=(e=>e?j.PERFORM_MODE:j.REVIEW_MODE)(m),y=zc(l,{target:d,context:p,containerItemID:h,caseViewMode:I,doDeleteCaseSummary:i,headers:n,actionName:a,isMinimizable:!1,isInCreateStage:Cc(u),resourceType:U.RESOURCE_TYPES.OBJECT,isProcessAction:r.isProcessAction,showProgress:r.showProgress,progressMessage:r.progressMessage,actionType:r.actionType});if(m&&dc(y,l),Cc(u)&&delete y.doDeleteCaseSummary,t.push(Cf((e=>e?nf:lf)(g),y)),g||t.push(Cf(df,y)),g){const s=Mp(r.contextName),a=Sp(s,e.data.objectInfo.ID);if(a){const e={data:{objectInfo:{headers:n}},context:a};t.push(Cf(Yg,e))}}return h!==Dp(d)&&t.push(Cf(hf,{target:d,containerItemID:h})),hc(h)&&!c?.context&&ll(y,t),t},I_=e=>{e.openActionType=Nt;if(Ec(e.openActionType,e)===j.MODAL){const t=Ec(e.openActionType,e),n=Pt(t,e.context),r=K(e.context,H(t,e.context));Cg(nf({target:n,context:r,containerItemID:r,key:e.caseID,caseViewMode:j.PERFORM_MODE,actionName:e.name,showProgress:!0,root:{type:"reference",config:{context:j.getProperty(j.CASE_INFO.CASE_INFO_CONTENT),type:"view"}},data:{key:e.caseID,objectInfo:{ID:e.caseID}}})),Cg(uf({context:r})),e.modalLoadingContainer={target:n,context:r},f_(e)}return f_(e)},y_=e=>{let t=0,n=[];return e.pipe(Zl(g_),tu((e=>(({actionMgrID:t}=e.payload),e.payload))),nu((e=>I_(e))),nu((async e=>{if(Tc(e.type)){const t=Qc(e);n.push(t);const r=Sg(e.payload.context);return r?.context_data?.isLoading&&n.push(Cf(df,e.payload)),n}const{actionInPayload:t,headers:r,response:s}=e,{actionID:a}=t;return jg.setIn(s,"data.objectInfo.activeActionID",a),jg.setIn(s.data,j.getProperty(j.OBJECT_INFO_IS_LOCAL_ACTION),!0),t.refreshConditions&&jg.setIn(s.data,j.getProperty(j.CASE_INFO_REFRESH_CONDITIONS),t.refreshConditions),await m_(s,n,{headers:r,actionInPayload:t}),RE(t),n})),tu((()=>(Cg(n),Fc(n,t),n=[],n))))},E_=e=>{const{containerName:t,isInCreateStage:n}=e;return n?j.MODAL:t||ac.getTargetViewContainerName(Ot)},A_=(e,t)=>{const{class:n,context:r,viewType:s=Gc.PAGE}=e,{removeActionPayload:a}=t,o=e?.pageName?e?.pageName:Dh.getDefaultCasePage();return La(ki.createCase(n,{...e,pageName:o,viewType:s,context:r,retrieveActionViewForNewObject:!0})).pipe(tu((({response:t,headers:n})=>(F.analyseResponse(t),{response:t,actionInPayload:e,headers:n,removeActionPayload:a}))),lu("Error occurred during ajax call at createObject Epic : ",r))},__="CREATE_EXTERNAL_OBJECT",C_=e=>{let t=0,n=[];return e.pipe(Zl(__),uu(100),tu((e=>(({actionMgrID:t}=e.payload),e.payload))),nu((e=>{const{context:n}=e,r=E_(e),s=Pt(r,n),{continueExecution:a,removeActionPayload:o}=Py(s);return a?A_(e,{removeActionPayload:o}):(rc.rejectActionByID(t),cu())})),nu((async e=>{if(e&&e.type===Ee)return e.payload.context=ih(),n.push(Qc(e)),n;const{actionInPayload:r,response:s,headers:a,removeActionPayload:o}=e,i=t_(r,s);jg.setIn(s.data,j.getProperty(j.CASE_INFO.IS_FIRST_ASSIGNMENT),!0);const c=E_({...r,isInCreateStage:i}),l=Pt(c,r.context),u=el(l,c,r.context);if(!Cc(c)&&Up(l)){const{continueExecution:e}=rl(l);if(!e)return rc.rejectActionByID(t),cu()}const d=Ed(s);let p=Vf(Ot,{caseClassName:lc(d)});p=p.replace(/{.+?}/,String(Pc(uc(d)))),d.semanticURL=p,ZA(d,r);const h={acName:l,context:u};await Yc(d,r,h);const g={target:l,context:u,headers:a,semanticURL:p,caseViewMode:e_(d),containerItemID:u,isInCreateStage:i,isMinimizable:i,assignmentContext:jg.getIn(d,Ny),nextAssignmentInfo:jg.getIn(d,Ty),resourceType:U.RESOURCE_TYPES.OBJECT,openCaseViewAfterCreate:r.openCaseViewAfterCreate,modalOptions:r.modalOptions,debugInfo:r.debugInfo,isExternalObjectCreationFlow:!0};dc(g,d);const f=zc(d,g),m=Zc(l,f);return tl(m)&&xc(n,{removeActionPayload:o,target:l}),n.push(m),il(n),n})),tu((()=>(ul(n),Fc(n,t),n=[],n))))},S_=e=>{const{workId:t,context:n,isExternalCase:r}=e,s=r?qe:"deleteWork",{restApi:a,reqType:o}=$f(s,{ID:t});return La(Bo(a,{method:o},n)).pipe(tu((t=>({response:t.data,actionInPayload:e,headers:Hc(t.headers)}))),lu("Error occurred during ajax call at deleteWork Epic : ",n))},T_=e=>{yo.publish(j.PUB_SUB_EVENTS.WORK_EVENTS.WORK_DELETED,e)},N_=e=>{let t,n=0,r=[];return e.pipe(Zl(ql),tu((e=>(({actionMgrID:n,caseTypeID:t}=e.payload),e.payload))),nu((e=>e.ignoreWorkDeletion?ou({actionInPayload:e}):S_(e))),nu((async e=>{if(e&&Tc(e.type)){const{payload:t}=e,s=Qc({...e,...t,actionMgrID:n});return r.push(s),r}const{actionInPayload:t}=e,{context:s}=t;return by({content:vh.getLocaleValue("Deleted successfully!","Messages")}),s?.includes(j.PREVIEW)&&r.push(Cf(tf,Gp({context:j.APP.APP,name:j.PREVIEW}))),s?.includes(j.PRIMARY)&&window?.history?.back(),r})),tu((()=>(Cg(r),Fc(r,n)===j.PROMISE_VALUE.RESOLVE&&T_({caseTypeID:t}),r=[],r))))},O_=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return ly.apply(void 0,e.map((function(e){var n=e.apply(void 0,t);if(!n)throw new TypeError('combineEpics: one of the provided Epics "'+(e.name||"<anonymous>")+"\" does not return a stream. Double check you're not missing a return statement!");return n})))};try{Object.defineProperty(n,"name",{value:"combineEpics("+e.map((function(e){return e.name||"<anonymous>"})).join(", ")+")"})}catch(e){}return n}(...Ey,..._A,...NA,...HA,...LA,..._y,...qA,...YA,...JA,...[s_,h_,c_,y_,C_,N_]),P_=()=>e=>t=>{const{type:n="",payload:r={}}=t||{},{category:s,context:a,transientItemID:o}=r;"HTTP"!==s&&[Ce,xe,Se,Me,Ne,be].includes(n)&&(yl(a||o),eo.removeContextTreeNode(a||o)),e(t)},D_={},R_=e=>{const t=jg.getIn(D_,[j.CONTEXT,e],[]),n=[];t.forEach((t=>{const r=t.substr(0,t.lastIndexOf("_")),s=jg.getIn(D_,[r,t],[]),a=s&&s.length>0&&s.indexOf(e);if(a>-1&&s.splice(a,1),!s||s&&0===s.length){jg.deleteIn(D_,[r,t]);const e=jg.getIn(D_,[r]);e&&0===Object.keys(e).length&&jg.deleteIn(D_,[r]),n.push({dataPageName:r,dataPageNameWithHash:t})}})),jg.deleteIn(D_,[j.CONTEXT,e]);const r=jg.getIn(D_,[j.CONTEXT]);(!r||r&&0===Object.keys(r).length)&&jg.deleteIn(D_,[j.CONTEXT]),n.length>0&&Cg(Nf({dataPagesToBeRemoved:n}))},b_=(e={},t)=>{Object.keys(e).forEach((n=>{const r=jg.getIn(e,[n],{});Object.keys(r).forEach((e=>{((e,t,n)=>{const r=jg.getIn(D_,[j.CONTEXT,n]);if(jg.getIn(D_,[e])){const r=jg.getIn(D_,[e,t],[]);jg.setIn(D_,[e,t],[...new Set([...r,n])])}else jg.setIn(D_,[e,t],[n]);r?jg.setIn(D_,[j.CONTEXT,n],[...new Set([...r,t])]):jg.setIn(D_,[j.CONTEXT,n],[t])})(n,e,t)}))}))},v_=()=>e=>t=>{(Array.isArray(t)?t:[t]).forEach((e=>{const{payload:{data:t={},context:n=null,childContainersContexts:r=[]}={},type:s}=e;if(((e,t)=>{t&&t.length>0&&(e===Me||e===Se)&&t.forEach((e=>{R_(e)}))})(s,r),s===Ce||s===fe||s===rt){const e=s===rt?t:t.shared;b_(e,n)}else s===Me?(R_(n),b_(t.shared,n)):s===Se&&R_(n)})),e(t)},x_=e=>t=>n=>{const{type:r,payload:{target:s,containerItemID:a,context:o,childContainersContexts:i=[],containerInfo:{newAccessedOrder:c,containerType:l}={}}={}}=n,{PUB_SUB_EVENTS:u}=U;if(r===Se){const{resourceType:t,key:n,context:r}=jg.getIn(e.getState(),["containers",s,"items",a])||{},o={resourceType:t,key:n,context:r,containerItemID:a};yo.publish(u.CONTAINER_EVENTS.CLOSE_CONTAINER_ITEM,o),s===`${U.APP.APP}/${j.PRIMARY}`&&l===j.CONTAINER_TYPE.MULTIPLE&&yo.publish(u.CONTAINER_EVENTS.CLOSE_MULTI_TYPE_PRIMARY_CONTAINER_ITEM,{key:n,newAccessedOrder:c})}i&&i.length>0&&(r===Me||r===Se)&&i.forEach((e=>{Gu.cleanCaches(e)})),r!==Me&&r!==Se||Gu.cleanCaches(o),t(n)},w_=()=>e=>t=>{const{payload:{context:n=null,transientItemID:r=null}={},type:s}=t;!n||s!==Ce&&s!==xe&&s!==Me&&s!==Se||(mi(n),gi(n)),r&&s===De&&(mi(r),gi(r)),e(t)},M_=function(e){void 0===e&&(e={});var t,n=new(0,AI.constructor)(AI.schedulerActionCtor),r=new CI,s=function(s){t=s;var a=new CI,o=new CI,i=a.asObservable().pipe(va(n)),c=new NI(o.pipe(va(n)),t.getState());return r.pipe(tu((function(t){var n=t(i,c,e.dependencies);if(!n)throw new TypeError('Your root Epic "'+(t.name||"<anonymous>")+"\" does not return a stream. Double check you're not missing a return statement!");return n})),nu((function(e){return La(e).pipe(xa(n),va(n))}))).subscribe(t.dispatch),function(e){return function(n){var r=e(n);return o.next(t.getState()),a.next(n),r}}};return s.run=function(e){r.next(e)},s}(),L_=e=>{if(null!==_g())return void Lg();const t=[up.propertyChangeMiddleware,P_,v_,w_,M_,x_],n=cI({reducer:cy(e),middleware:e=>e({serializableCheck:!1,thunk:!1}).concat(t),enhancers:e=>e().prepend(OI).concat(OI)});M_.run(O_),Ag(n)},F_={publishConstellationLoadedEvent:()=>{yo.publish(j.PUB_SUB_EVENTS.BOOTSTRAP_SHELL_EVENTS.CONSTELLATION_LOADED,{})}};const U_=new class{activateContainerItemOnSwitch(e){const t=`${j.APP.APP}/${j.PRIMARY}`,n={target:t,containerItemID:Sp(t,e)};vd({}).getPConnect().getContainerManager().activateContainerItem(n)}removeContainerItemOnClose(e){const t=`${j.APP.APP}/${j.PRIMARY}`,n={target:t,containerItemID:Sp(t,e)};vd({}).getPConnect().getContainerManager().removeContainerItem(n)}showCasePreview(e,t){const n=vd({meta:{type:"PreviewViewContainer",config:{name:j.PREVIEW}},options:{context:j.APP.APP,target:"root/hybrid_preview"}});n.getPConnect().getContainerManager().resetContainers({name:j.PRIMARY,context:j.APP.APP}),Op(j.APP.APP,j.PREVIEW)||n.getPConnect().getContainerManager().initializeContainers({type:"multiple",name:j.PREVIEW}),n.getPConnect().getActionsApi().showCasePreview(e,{caseClassName:t})}closeCasePreview(){vd({}).getPConnect().getContainerManager().resetContainers({name:j.PREVIEW,context:j.APP.APP})}isFormDirty(e){const t=`${j.APP.APP}/${j.PRIMARY}`,n=uh(t,e);return gl.isStateModified(n)}getEventUtils(){return F_}getBroadcastUtils(){return Sy}isTraditionalUICase(e){return Uc(e)}};const j_=class{static openCase(e,t=U.APP.APP,n={}){return n.renderInline=!0,n.pageName?Dh.setDefaultCasePage(n.pageName):(Dh.setDefaultCasePage(j.PY_DETAILS),n.pageName=j.PY_DETAILS),n?.disableAssignmentHeader?Dh.disableAssignmentHeader(n.disableAssignmentHeader):Dh.disableAssignmentHeader(!1),td.openCase(e,t,j.PRIMARY,n)}static createCase(e,t=U.APP.APP,n={}){return n.renderInline=!0,n.pageName?Dh.setDefaultCasePage(n.pageName):(Dh.setDefaultCasePage(j.PY_DETAILS),n.pageName=j.PY_DETAILS),n?.disableAssignmentHeader?Dh.disableAssignmentHeader(n.disableAssignmentHeader):Dh.disableAssignmentHeader(!1),td.createCase(e,t,j.PRIMARY,n)}static getNextWork(e=U.APP.APP,t={}){return t.renderInline=!0,t.pageName?Dh.setDefaultCasePage(t.pageName):(Dh.setDefaultCasePage(j.PY_DETAILS),t.pageName=j.PY_DETAILS),t?.disableAssignmentHeader?Dh.disableAssignmentHeader(t.disableAssignmentHeader):Dh.disableAssignmentHeader(!1),td.getNextWork(e,j.PRIMARY,t)}static openAssignment(e,t=U.APP.APP,n={}){return n.renderInline=!0,n.pageName?Dh.setDefaultCasePage(n.pageName):(Dh.setDefaultCasePage(j.PY_DETAILS),n.pageName=j.PY_DETAILS),n?.disableAssignmentHeader?Dh.disableAssignmentHeader(n.disableAssignmentHeader):Dh.disableAssignmentHeader(!1),td.openAssignment(e,t,j.PRIMARY,n)}static openPage(e,t,n=U.APP.APP,r={}){const s=ne;r?.defaultCasePage?Dh.setDefaultCasePage(r.defaultCasePage):Dh.setDefaultCasePage(j.PY_DETAILS),r?.disableAssignmentHeader?Dh.disableAssignmentHeader(r.disableAssignmentHeader):Dh.disableAssignmentHeader(!1);const a={viewName:e,className:t,acTargetName:j.PRIMARY,actionMgrID:rc.getNextActionMgrId(),context:n},{promise:o}=rc.actionManagerPromise(s,a.actionMgrID);return Cg({type:s,payload:{...a}}),o}static getCurrentContextAPI(e,t=U.APP.APP){return vd({meta:{config:{}},options:{context:t,pageReference:e,containerName:j.PRIMARY}}).getPConnect()}};const V_=new class{createC11nEnv=e=>vd(e);getContextUtils=()=>e;getRoutingManager=()=>t;getComponentsRegistry=()=>cn;getStateManager=()=>u;getActionCreators=()=>d;getStreamObservable=()=>a;getActionProcessor=()=>Wg;getActionHandler=()=>Gg;renderApp=(e,t)=>{const n={context:j.APP.APP},r={...jg.getIn(e,j.ROOT),options:n};L_(e),ji(e,n,!0);const s=this.createC11nEnv({meta:r,isRoot:!0});yo.publish(U.PUB_SUB_EVENTS.EVENT_RENDER_APP,{props:s,domContainerID:t})};updateStoreWithUiRoot=async(e,t,n)=>{const{data:r,uiResources:s={}}=e,{root:a}=s,o=jg.getIn(s,j.CONTEXT_DATA),i=Ed(e);await Yc(i,{},{},!1,!0);const c={...r,[j.CONTEXT_DATA]:o};Yp(a,t,c,n)};fetchEndPointResource=(e,t,n)=>{Bo(e,{method:"GET"},j.APP.ROOT).then((e=>{200===e.status&&this.updateStoreWithUiRoot(e.data,t,n)}))};loadComponent=async(e,t,n)=>{await ec(n);const r=this.createC11nEnv({meta:e,isRoot:!0});_g()||L_({}),yo.publish(U.PUB_SUB_EVENTS.EVENT_RENDER_APP,{props:r,domContainerID:t})};setStaticServerUrl=(e,t,n)=>{Xi.initServer(e,t,n)};loadView=async(e,t,n=[])=>{I();const r=Ed(e),s=jg.getIn(r,j.VIEWS),a=jg.getIn(r,j.NAVIGATIONS),o=jg.getIn(r,j.COMPONENTS)||[];o.push(...n);const i=jg.getIn(r,j.STATIC_SERVER_URL),c=jg.getIn(r,j.APPLICATION_DATA);s&&Jh(s),a&&Xh(a),(e=>{e&&(Lf=e.pyLabel)})(c),i&&Xi.initServer(i),await ec(o,i),this.renderApp(r,t)};initAppShell=(e,t,n)=>{em(e),ac.buildActionTargetMap(t),I(n)};initRoutingTable=(e,t)=>{em(e,!0),I(t)};setAppAlias=e=>{Xi.setAppAlias(e)};getHomeRestApi=e=>{const t=E(),{restApi:n}=kf("home",{portalName:e});return`${t}${n}`};getViewRestApi=(e,t)=>{const{restApi:n}=((e,t)=>{let n={restApi:""};try{if(Qf()&&!t){const t=Ah(),r=Ph.processUrl(t,!0),s=Ph._getMatchedRouteInRoutingTable(r)||"",a=Ph.getRoutingInfo(),o=Ph.processUrl(t,!1).split("/"),i=o[o.length-1];let{caseID:c}=a&&a.routes[s].payload;c=c.replace("{workID}",i).replace("{id}",i),n=Ph.getRestEndPoint("loadView",{caseID:c,viewID:e})||{}}else n=Ph.getRestEndPoint("showView",{page:e,pageClass:t})||{}}catch(e){}return n})(e,t);return E()+n};loadRootComponent=async(e,t,n=[],r,s,a)=>{const{config:o}=t||{},i=o?.name;if(_g()||L_({}),a){const e=`${j.APP.ROOT}/${i}`;sh(e),rh().deleteContainerItem(e)}(rh().getContainerItems()||[]).length>1&&!i?.startsWith("hybrid_")&&"authoring-preview"!==i&&Lg(),Cg(Yg({data:{},context:j.APP.ROOT}));const c=this.createC11nEnv({meta:t,options:{context:j.APP.ROOT,pageReference:"",target:`${j.APP.ROOT}/${i}`}}),l=c.getPConnect(),u=`${l.getContextName()}/${l.getContainerName()}`;Dp(u)||"noPortal"===o?.renderingMode||l.getContainerManager().initializeContainers({type:"single"});const d=["RootContainer","Region","ModalViewContainer","PreviewViewContainer","reference","URL",...n];await ec(d),yo.publish(U.PUB_SUB_EVENTS.EVENT_RENDER_APP,{props:c,domContainerID:e,componentName:"RootContainer",portalTarget:r,styleSheetTarget:s})};loadViewByName=(e,t,n,r)=>{let s=this.getViewRestApi(e,n);s===E()&&(s=this.getHomeRestApi(t)),this.fetchEndPointResource(s,r)};loadPortalView=(e,t)=>{const n=this.getHomeRestApi(e);this.fetchEndPointResource(n,t,!0)};configureForBrowserBookmark=e=>{Zf(e)};checkIfSemanticURL=()=>Qf();onPCoreReady=e=>{yo.subscribe(U.PUB_SUB_EVENTS.EVENT_RENDER_APP,e,"renderAppCallback")};onPCoreCleanup=e=>{yo.subscribe(U.PUB_SUB_EVENTS.EVENT_UNMOUNT_APP,e,"unmountAppCallback")};setFieldsDefaultConfigs=e=>{Pi.updateFieldDefaults(e)};setGoogleMapsAPIKey=e=>{_(e)};setFetchDefaultHeaders=e=>{zo(e)};setFetchAuthInfo=e=>{Yo(e)};getCaseApi=()=>td;getMashupApi=()=>j_;enableAppRouting=e=>{Uf(e)};initStore=()=>L_({});getBootstrapConfig=async(e,t)=>{const n=`${t.token_type} ${t.access_token}`;return fetch(`${e}/api/application/v2/data_views/D_pxBootstrapConfig`,{method:"GET",headers:new Headers({Authorization:n})}).then((e=>e.json()))};initCoreContainers=(e={})=>{const{containerType:t="single"}=e,n=vd({meta:{type:"RootContainer",config:{renderingMode:"noPortal"},children:[{type:"ViewContainer",config:{routingInfo:"@ROUTING_INFO",name:"primary"}}]},options:{context:"root",pageReference:"",target:"root"}});return n.getPConnect().getContainerManager().initializeContainers({type:t,name:"primary",context:"app"}),{props:{getPConnect:n.getPConnect}}}};const k_=class{constructor(e){this.appAlias=e.appAlias,this.appAliasWithoutServlet=e.appAliasWithoutServlet,this.googleMapKey=e.googleMapKey,this.staticContentServer=e.staticContentServer,this.appStaticContentServer=e.appStaticContentServer||null,this.contextPath=e.contextPath,this.messagingService=e.messagingService||null,this.reAuthUrl=e.reAuthUrl||null}};const $_=class{constructor(e){this.routingInfo=e.routingInfo,this.actionModel=e.actionModel,this.additionalHeaders=e.additionalHeaders,this.tokens=e.tokens,this.semanticUrl=e.semanticUrl,this.queryParams=e.queryParams,this.noPortal=e.noPortal,this.timezone=e.timezone,this.noHistory=e.noHistory,this.viewName=e.viewName,this.theme=e.theme,this.fieldDefaults=e.fieldDefaults,this.restServerConfig=e.restServerConfig,this.dynamicLoadComponents=void 0===e.dynamicLoadComponents||e.dynamicLoadComponents,this.dynamicSemanticUrl=void 0===e.dynamicSemanticUrl||e.dynamicSemanticUrl,this.enableRouting=void 0===e.enableRouting||e.enableRouting,this.locale=e.locale,this.environmentInfo=e.environmentInfo,this.renderingMode=e.renderingMode||"FULL_PORTAL",this.remoteCaseMapping=e.remoteCaseMapping||{},this.envType=e.envType,this.serviceConfig=new k_(e.serviceConfig),this.behaviorOverrides=e.behaviorOverrides,this.initBroadcast=!!e.initBroadcast,this.cookieComplianceMethod=e.cookieComplianceMethod??"none",this.isExtraCallRequiredForDefaultHome=e.isExtraCallRequiredForDefaultHome??"false",this.storePercentageAsDecimal=e.storeC11nPercentageAsDecimal??!1}},B_=e=>"fulfilled"===e.status,G_=async()=>{const e=Dh.getLocale();let t;const n=Dh.getLocalizationVersion();try{let r;2===n?r=[e]:(r=[vh.GENERIC_BUNDLE_KEY,vh.MESSAGE_BUNDLE_KEY,vh.FIELD_LABELS_BUNDLE_KEY],t=await vh.isCurrentLocalePackAvailable());const s=r.map((async r=>{2===n?await(async e=>{const t=Dh.getAvailableLocalePacks(),n=Dh.getLocalizationBundles();let r;if(e&&t&&t.includes(e)?r=[Bi("getLocalizationPack",{queryPayload:{locale:e}})]:n.length>0&&(r=n.map((e=>Bi("getLocalizationPack",{queryPayload:{version:e.pyBundleVersion,bundle:e.pyBundleName}})))),!r||0===r.length)return;const s=200,a=201;(await Promise.allSettled(r)).filter(B_).forEach((({value:e})=>{if([s,a].includes(e.status)&&e.data){const t=e.data,n=zh(Dh.getLocale()??"en-US");Object.keys(t).forEach((e=>{vh.setLocaleForRule(t[e],e),n.setLocaleForRule(t[e],e)}))}}))})(r):t&&await(async(e,t)=>{const n=await Xi.getSvcLocale(t,`${e}.json`);if(n.ok&&e){const t=await n.json();vh.setLocaleForRule(t,e)}})(r,e)}));await Promise.allSettled(s)}catch(e){console.warn(e)}},W_="@P .viewConfig";let H_=0;const q_=new class{init(e){const t=new $_(e),n={...t.environmentInfo,renderingMode:t.renderingMode};Uf(t.enableRouting),L_({}),Dh.setTheme(t.theme),Dh.setCookieComplianceMethod(t.cookieComplianceMethod),Dh.setIsExtraCallRequiredForDefaultHome(t.isExtraCallRequiredForDefaultHome),Pi.updateFieldDefaults(t.fieldDefaults),Pi.setFieldDefault("Percentage","storePercentageAsDecimal",t.storePercentageAsDecimal),xo.setDefaultHeaders(t.additionalHeaders),this.#y(t.routingInfo,t.actionModel,{server:t.restServerConfig,reAuthUrl:t.serviceConfig.reAuthUrl}),Xi.setAppAlias(t.serviceConfig.appAliasWithoutServlet||t.serviceConfig.appAlias),_(t.serviceConfig.googleMapKey),Xi.initServer(t.serviceConfig.staticContentServer,t.serviceConfig.appStaticContentServer,t.tokens.C11NB2S),vh.setTimezone(t.timezone),Dh.setEnvironmentInfo(n),Dh.setLocale(t.locale),$.setRemoteCaseMapping(t.remoteCaseMapping),Pu.setConnectionConfig({messagingService:t.serviceConfig.messagingService}),tc.init(),t.initBroadcast&&U_.getBroadcastUtils().init()}getBootstrapConfig=async(e,t)=>{const n=`${t.token_type} ${t.access_token}`;return fetch(`${e}/api/application/v2/data_views/D_pxBootstrapConfig`,{method:"GET",headers:new Headers({Authorization:n})}).then((e=>e.json()))};initCoreContainers=(e={})=>{const{containerType:t="single"}=e,n=vd({meta:{type:"RootContainer",config:{renderingMode:"noPortal"},children:[{type:"ViewContainer",config:{routingInfo:"@ROUTING_INFO",name:"primary"}}]},options:{context:"root",pageReference:"",target:"root"}});return n.getPConnect().getContainerManager().initializeContainers({type:t,name:"primary",context:"app"}),{props:{getPConnect:n.getPConnect}}};importReactRoot=async()=>{const e=[];return V_.getComponentsRegistry().getComponent("ReactRoot")?.modules.forEach((t=>{e.push(t())})),Promise.allSettled(e)};importDesignSystemComponentMap=async(e,t,n)=>{try{await function(e,t="true"){return new Promise(((n,r)=>{const s=document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("src",e),s.setAttribute("async",t),s.onload=n(),s.onerror=()=>r(new Error("Failed to load resource from Design System")),document.body.appendChild(s)}))}(`${e}component/project/${t}/designsystems/${n}/componentsmap.js?v=${Date.now()}`)}catch(e){console.log(e)}};buildSemanticUrl=(e,t,n,r,s)=>{const a=new URLSearchParams(t);let o=!1;"true"===n&&(o=!0);let i=null,c=null,l=null;if(e){e.startsWith("/")&&(e=e.substring(1));const t=e.split("/");i=t[0],t.length>1&&t[1]&&(c=t[1]),t.length>1&&"assignments"===t[2]&&t[3]&&(l=t[3])}else o=!1;let u=r;i&&(u=`${u}/${i}`),c&&(u=`${u}/${c}`),l&&(u=`${u}/assignments/${l}`),o&&(a.has("noPortal")||a.append("noPortal","true"),c&&s&&a.append("view",s));const d=a.toString();return u+=d?`?${d}`:"",u};initCoreConfig=e=>{const{routingInfo:t,serviceConfig:n,semanticUrl:r,queryParams:s,noPortal:a,noHistory:o,viewName:i,theme:c,restServerConfig:l,dynamicLoadComponents:u=!0,dynamicSemanticUrl:d=!0,renderingMode:p="FULL_PORTAL",envType:h,extras:g}=e,{appAlias:f,contextPath:m}=n;let I=window.location.origin;const y={};if(void 0!==l&&(I=l),m&&(I=`${I}${m}`),f&&"LAUNCHPAD"!==h&&(I=`${I}/${f}`),e.restServerConfig=I,!0===d){const e=this.buildSemanticUrl(r,s,a,I,i);!o&&e&&window.history.pushState({},"home",e)}else if("HYBRID"!==p){let e=window.location.href;e.indexOf("?")>0&&(e=e.substring(0,e.indexOf("?")),window.history.pushState({},"home",e)),y.dynamicSemanticUrl=!1}else console.log(`renderingMode :${p}`);!0!==u&&(y.dynamicLoadComponents=!1);let E=null;if(f){const e=f.indexOf("/app/");E=e>=0?f.substring(e+1):f}if(Object.keys(y).length>0&&window.PCore.setBehaviorOverrides(y),e.appAlias=E,c){let t="object"==typeof c?c:null;if(null===t)try{t=JSON.parse(c)}catch{t={}}e.theme=t}const A={...t,domain:`${window.location.protocol}//${window.location.host}`,searchParams:window.location.search};e.routingInfo=A,e.initBroadcast="true"===Dh.environmentInfoObject?.pxMashupDetails?.pyIsTraditionalCoexistence,!e.noPortal||"true"!==e.noPortal&&!0!==e.noPortal||(e.renderingMode="EMBED"),g?.cspNonce&&(window.__webpack_nonce__=g.cspNonce),this.init(e)};launchViewByName=(e,t,n,r,s,a,o,i)=>{H_+=1;const c=i||`mashup${H_}`,l={type:"RootContainer",config:{viewConfig:W_,renderingMode:"view",name:c}};V_.loadRootComponent(e,l,s,a,o).then((()=>V_.loadViewByName(t,n,r,c)))};launchView=(e,t,n=[],r,s,a,o)=>{H_+=1;const i="hybrid"===o?`hybrid_${H_}`:o;H_+=1;const c=i||`mashup${H_}`,l={type:"RootContainer",config:{viewConfig:W_,renderingMode:"portal",name:c}};o===j.HYBRID&&qu.setRuntimeParam(j.HYRBID_ROOT_CONTAINERNAME,c),qu.setRuntimeParams(r),V_.loadRootComponent(e,l,n,s,a).then((()=>V_.updateStoreWithUiRoot(t,c,!1)))};launchPortal=async(e,t,n=`portal${H_+=1}`,r=[])=>{const s={type:"RootContainer",config:{viewConfig:W_,renderingMode:"portal",skeleton:"LoadingComponent",name:n}},a=[...r,s.config.skeleton];Dh.isPortalLoaded=!0;try{return await V_.loadRootComponent(e,s,a),V_.loadPortalView(t,n)}catch(e){throw console.error(`Failed to launch portal ${t}:`,e),e}};launchMashup=(e,t=!0)=>{const n={type:"RootContainer",config:{renderingMode:"noPortal"},children:[{type:"ViewContainer",config:{routingInfoAnnotation:"@ROUTING_INFO",name:"primary"}}]};if(t){const t=document.getElementsByTagName(e)[0]?.parentNode;if(t){const e=document.createElement("style");e.setAttribute("id","portal-less-styles"),e.innerHTML="app-root.mashup > .case-view, app-root.mashup > .page-view { min-height: 0px !important; }",t.appendChild(e)}}V_.loadRootComponent(e,n,[PCore.getConstants().LOAD_VIEW_STRING,"ViewContainer"]),window.parent!==window&&s(458)(`${window.PCore.getAssetLoader().getStaticServerUrl()}constellation-mashup-bridge.js`).then((e=>{e.mashup.init({resizing:"stretch"})}))};start=async(e,t)=>{const{appStaticContentServer:n}=e.serviceConfig,{ccV2LibId:r,environmentId:s,ccLibs:a,isAlternateDesignSystemEnabled:o,alternateDesignSystemName:i}=e;this.initCoreConfig(e);const c=async()=>{await this.importReactRoot();const e=Dh.environmentInfoObject?.pyC11nDXCBDevURL;return e&&await Xi.importCustomComponentMap(""),r&&!e&&await Xi.importCustomComponentMap(r),Dh.environmentInfoObject?.pyInfinityStaticService&&a&&a.length>0&&await Promise.all(a.map((e=>Xi.importCustomComponentMap(e)))),"true"===o&&"other"!==i&&await this.importDesignSystemComponentMap(n,s,i),t&&t(),!0};return new Promise(((e,t)=>{G_().then((async()=>{const t=V_.getComponentsRegistry();"ReactRoot"in t.getLazyMap()?e(!0):t.getComponent("ReactRoot")?e(await c()):yo.subscribe("component-map-loaded",(async()=>{e(await c())}))})).catch((e=>{t(e)}))}))};registerForDebugInfo=e=>{PCore.getEnvironmentInfo().setPreviewMode(),e&&(PCore.getPubSubUtils().subscribe("fetchSuccess",(({debugInfo:t})=>{const n=t?.["X-Pega-App-Debug-ID"];e.postMessage({appDebugID:n})}),"fetchSuccess"),PCore.getPubSubUtils().subscribe("fetchFailure",(({debugInfo:t})=>{const n=t?.["X-Pega-App-Debug-ID"];e.postMessage({appDebugID:n})}),"fetchFailure"))};toggleTracerHeaders=e=>{e.addEventListener("message",(async e=>{const t=e?.data?.enableTracer;t?PCore.getDebugger().enableTracer():PCore.getDebugger().disableTracer()}))};loadEnvironmentInfo=async e=>{if(e.theme&&(!window.pms||"Android"!==window.pms.device.systemName))try{const t=JSON.parse(e.theme.definition);PCore.getEnvironmentInfo().setBrandingInfo(t.Branding),PCore.getEnvironmentInfo().setTheme(t.Theme)}catch{PCore.getEnvironmentInfo().setBrandingInfo({}),PCore.getEnvironmentInfo().setTheme({})}e.keyMapping&&PCore.getEnvironmentInfo().setKeyMapping(e.keyMapping),PCore.getEnvironmentInfo().setCookieComplianceMethod(e.cookieComplianceMethod??"none")};#y(e,t,n){em(e),ac.buildActionTargetMap(t),I(n)}},z_={createViewRule:(e,t)=>{const{restApi:n,reqType:r}=$f("createViewRuleByID");return Bo(n,{method:r,body:e},t).then((e=>e.data))},getViewRule:(e,t)=>{const{restApi:n,reqType:r}=$f("getViewRuleByID",{ID:e});return Bo(n,{method:r},t).then((e=>e.data))},updateViewRule:(e,t,n)=>{const{restApi:r,reqType:s}=$f("updateViewRuleByID",{ID:e});return Bo(r,{method:s,body:t},n).then((e=>e.data))},deleteViewRule:(e,t)=>{const{restApi:n,reqType:r}=$f("deleteViewRuleByID",{ID:e});return Bo(n,{method:r},t).then((e=>e.data))},getCalculatedFields:(e,t,n)=>{const{restApi:r,reqType:s}=$f("getCalculatedFieldsInViewByID",{caseID:e,viewID:t});return Bo(r,{method:s,body:{calculations:{fields:n}}}).then((e=>e.data))}},Y_={"Content-Type":"application/json"},K_={addCaseFollower:(e,t,n)=>{const r={caseID:e},s=JSON.stringify({users:t.map((e=>({ID:e})))});return Bi("addCaseFollower",{body:s,queryPayload:r,headers:Y_},n)},deleteCaseFollower:(e,t,n)=>Bi("deleteCaseFollower",{queryPayload:{caseID:e,followerID:t}},n),getCaseFollowers:(e,t)=>Bi("getCaseFollowers",{queryPayload:{caseID:e}},t).then((e=>e.data.followers))},J_={addRelatedCases:(e,t,n)=>{const r={caseID:e},s=JSON.stringify({cases:t});return Bi("addRelatedCases",{body:s,queryPayload:r},n)},removeRelatedCase:(e,t,n)=>Bi("removeRelatedCase",{queryPayload:{caseID:e,relatedCaseID:t}},n),getRelatedCases:(e,t)=>Bi("getRelatedCases",{queryPayload:{caseID:e}},t).then((e=>e.data.relatedCases))},X_="operatorDetails",Q_={getOperatorDetails:(e,t=!1)=>{const{reqType:n}=$f(X_,{});if("GET"===n){const t={encodedOperatorId:encodeURIComponent(`{"opname":"${e}"}`)};return Bi(X_,{queryPayload:t})}return t?Bi("operatorDetailsByBusinessID",{body:{dataViewParameters:{BusinessID:e}}}):Bi(X_,{body:{dataViewParameters:{ID:e}}})}},Z_="postCustomFeedMessages",eC={"Content-Type":"application/json"};const tC=new class{constructor(){this.mentionsTagsCancelTokenSource=[],this.mentions=[]}getFeeds=(e,t,n,r,s,a,o)=>{const i=a.getLocalizationService();o||(this.mentions=[]);let c="";r&&Array.isArray(r)&&r?.length>0&&(r.forEach((e=>{e.on&&(c=`${c}${e.id},`)})),""===c&&(c="ClearFilters"));let l="";o&&(l=a.getValue("pulse.pageLastEntry"));const u={filterForContext:e,feedID:t,feedClass:n,filterBy:c,pageSize:10,olderThan:l};for(let e=0;e<s.length;e+=1)s[e].cancel();const d=Hi();return s.push(d),Bi("getFeedMessages",{queryPayload:u,cancelTokenSource:d},a.getContextName()).then((async t=>{if(200===t.status&&t.data){s.pop();const n=[],c={};let l=!1,u=[];if(t?.data){if(u=Array.isArray(t.data.data.MessageTypes)&&t.data.data.MessageTypes.length?t.data.data.MessageTypes:[],t?.data?.data?.FeedList){const e=t.data.data.FeedList?.pxResults;Array.isArray(e)&&e?.length>0&&e.forEach(((e,t)=>{e.ID=""!==e.pzInsKey?e.pzInsKey:`message${t}`,n.push(e.ID),c[e.ID]=e,e?.mentions&&Array.isArray(e?.mentions)&&e.mentions?.length>0&&this.mentions.push(e.mentions),e?.pxResults&&Array.isArray(e?.pxResults)&&e.pxResults?.length>0&&e.pxResults.forEach((e=>{e?.mentions&&Array.isArray(e?.mentions)&&e.mentions?.length>0&&this.mentions.push(e.mentions)})),l||["pzPostDetails","pzPrivatePostDetails"].includes(e.pyMessageViewReference)||(l=!0)}))}if(l&&await Ad({uiResources:t.data.uiResources}),!r&&(r=[{id:"All",label:i.getLocalizedText("All"),on:!0,disabled:!1}],t?.data?.data?.FeedFilters)){const e=t.data.data.FeedFilters?.pxResults;let n=!0;if(e&&Array.isArray(e)&&e?.length>0){e.forEach((e=>{const t={id:e.pyFeedSourceReference,label:i.getLocalizedText(e.pyLabel),disabled:!1,on:"true"===e.pySelected};t.on||(n=!1),r.push(t)}));const t=r.find((e=>"All"===e.id));t&&(t.on=n)}}}if(o&&a.getValue("pulse.messageIDs")){let r=a.getValue("pulse.messageIDs"),s=a.getValue("pulse.messages");r=[...r,...n],s={...s,...c},Object.values(s).forEach((e=>{e?.mentions&&Array.isArray(e?.mentions)&&e.mentions?.length>0&&this.mentions.push(e.mentions),e?.pxResults&&Array.isArray(e?.pxResults)&&e.pxResults?.length>0&&e.pxResults.forEach((e=>{e?.mentions&&Array.isArray(e?.mentions)&&e.mentions?.length>0&&this.mentions.push(e.mentions)}))})),a.updateState({pulse:{messages:s,messageIDs:r,nextPageFirstEntry:t?.data?.nextPageFirstEntry||"",pageLastEntry:t?.data?.pageLastEntry||"",hideAttachment:t?.data?.hideAttachment||!1,postTypes:u,pulseContext:e}})}else a.updateState({pulse:{messages:c,messageIDs:n,nextPageFirstEntry:t?.data?.nextPageFirstEntry||"",pageLastEntry:t?.data?.pageLastEntry||"",hideAttachment:t?.data?.hideAttachment||!1,postTypes:u,pulseContext:e}});const d=[...new Map(this.mentions.flat()?.map((e=>[e.mentionsID,e]))).values()]?.filter((e=>Object.hasOwn(e,"mentionsType")))?.filter((e=>!e?.mentionsType?.toLowerCase().includes("user")))||[];return{feedFilters:r,caseMentions:d}}return a.reportError(`getFeeds call failed ${t.status}`,t.data),""})).catch((e=>{qi(e)||a.reportError(": Error occurred during ajax call at getFeeds API : ",e.response)}))};postMessage=(e,t,n,r=[],s=!1,a=[])=>{const o={message:t,context:e,parentMessageId:s?e:"",attachments:r,pyRecipients:a.length?a:void 0},i=0===a.length?{body:JSON.stringify(o),headers:eC}:{body:JSON.stringify(o),queryPayload:{type:"PegaSocial-Post-Private"},headers:eC};return Bi(a.length?Z_:"postFeedMessages",i,n.getContextName()).then((t=>{if((201===t.status||200===t.status)&&t.data){const a=t?.data;if(s){a.parentMessageID=e;const{pxResults:t,caseMentions:o}=this.buildMessageObject(a,s,n,r.length>0);return n.updateState({pulse:{messages:{[e]:{pxResults:t}}}}),o}const{messages:o,messageIDs:i,caseMentions:c}=this.buildMessageObject(a,s,n,r.length>0);return n.updateState({pulse:{messages:o,messageIDs:i}}),c}return n.reportError(`postMessage call failed with status ${t.status}`,t),""})).catch((e=>{throw n.reportError(": Error occurred during ajax call at postMessage API : ",e.response),e.response}))};postCustomMessage=(e,t,n)=>Bi(Z_,{body:t,queryPayload:{type:e},headers:eC},n.getContextName()).then((async e=>{if(201===e.status&&e.data){const r=e.data.data,s={ID:r.ID,pzInsKey:r.ID,classID:r.classID,pyPostType:r.pyPostType,postedByUser:r.postedByUser,pyIsDeleteEnabled:r.pyIsDeleteEnabled,pyMessageViewReference:r.messageViewReference,pyFeed:{pyIconType:"user",pyCommentContext:r.pyCommentContext,pyPostedOn:r.postedTime,pyFeedTitle:r.postedByUser.name,pyIconReference:r.postedByUser.ID},...r.PostMessage};_d(r.messageViewReference,n,t.context)||await Ad({uiResources:e.data.uiResources}),n.updateState({pulse:{messages:{[s.ID]:s,...n.getValue("pulse.messages")},messageIDs:[s.ID,...n.getValue("pulse.messageIDs")]}})}return n.reportError(`postCustomMessage call failed with status ${e.status}`,e),""})).catch((e=>{throw n.reportError(": Error occurred during ajax call at postCustomMessage API : ",e.response),e.response}));editMessage=({messageID:e,parentMessageID:t,message:n,pConnectObj:r,isReply:s=!1,recipients:a=[]})=>{const o=JSON.stringify({message:n,...a.length&&{pyRecipients:a}});return Bi("editFeedMessage",{queryPayload:{messageID:e},body:o,headers:eC},r.getContextName()).then((e=>{if(200===e?.status&&e?.data){const n=e?.data;if(s){n.parentMessageID=t;const{pxResults:e,caseMentions:a}=this.buildMessageObject(n,s,r,!1);return r.updateState({pulse:{messages:{[t]:{pxResults:e}}}}),a}const{messages:a,caseMentions:o}=this.buildMessageObject(n,s,r,!1);return r.updateState({pulse:{messages:a}}),o}return r.reportError(`editMessage call failed with status ${e.status}`,e),""})).catch((e=>{throw r.reportError(": Error occurred during ajax call at editMessage API : ",e.response),e.response}))};buildMessageObject=(e,t,n,r=!1)=>{const s={ID:e?.ID||"",classID:e?.classID||"PegaSocial-Message",tags:e?.tags||[],pyHasAttachment:r,pzInsKey:e?.ID||"",pyMessage:e?.message||"",mentions:e?.mentions||[],postedByUser:e?.postedByUser,pxCreateDateTime:e?.postedTime||"",pxUpdateDateTime:e?.updatedTime||"",parentMessageID:e?.parentMessageID||"",pyIsDeleteEnabled:e?.pyIsDeleteEnabled||!1,pyIsEdited:"string"==typeof e?.isEdited?"true"===e?.isEdited:e?.isEdited||!1,pyFeed:{pyPostedOn:e?.postedTime||"",pyFeedTitle:e?.postedByUser?.name||"",pyIconType:"user",pyCommentContext:e?.pyCommentContext||".pzInsKey",pyIconReference:"pi pi-case"},pyContext:"",pxIcon:"globe",pyMessageViewReference:e?.messageViewReference||"pzPostDetails",pyPostType:e?.pyPostType,pyRecipients:e?.pyRecipients?.length?e.pyRecipients:void 0},a=n.getValue("pulse.messages");if(t){let{pxResults:e=[]}=Object.values(a)?.find((e=>e?.ID===s?.parentMessageID))||{};const t=e?.findIndex((e=>e?.pzInsKey===s?.ID));if(-1!==t){const n=[...e];n[t]={...n[t],...s},e=n}else e=[...e,s];return{pxResults:e,messages:{},messageIDs:[],caseMentions:this.getCaseMentions(e)}}const o=n.getValue("pulse.messageIDs");if(o){const e=o.includes(s.ID)?{...a[s.ID],...s}:s,t={...a,[s.ID]:e};return{messages:t,messageIDs:o.includes(s.ID)?o:[s.ID,...o],caseMentions:this.getCaseMentions(Object.values(t))}}};getCaseMentions=e=>{const t=e?.filter((e=>e?.mentions&&Array.isArray(e?.mentions)&&e.mentions?.length>0))?.map((e=>e.mentions))?.concat(this.mentions);return[...new Map(t.flat()?.map((e=>[e.mentionsID,e]))).values()]?.filter((e=>Object.hasOwn(e,"mentionsType")))?.filter((e=>!e?.mentionsType?.toLowerCase().includes("user")))||[]};likeMessage=({pulseContext:e,likedBy:t,messageID:n,isReply:r,pConnectObj:s})=>{const a=t?"unlikeFeedMessages":"likeFeedMessages",o=JSON.stringify({ContextClass:e});Bi(a,{body:o,queryPayload:{pulseContext:e},headers:eC},s.getContextName()).then((a=>{if(200===a.status)if(r){const r=s.getValue(`pulse.messages.${n}`),a=r?.pxResults&&Array.isArray(r?.pxResults)&&r.pxResults?.length>0&&r.pxResults?.map((n=>{if((n={...n}).pzInsKey===e){let e=0,r=!1;const s=n.pyLikes?n?.pyLikes?.pxLikeCount:0;t?(e=s-1,r=!1):(e=s+1,r=!0),n.pyLikes={pxLikeCount:e,pxIsLiked:r}}return n}));s.updateState({pulse:{messages:{[n]:{pxResults:a}}}})}else{const r={...s.getValue(`pulse.messages.${n}`)},a=r.pyLikes?r.pyLikes.pxLikeCount:0;let o=0,i=!1;t?(o=a-1,i=!1):(o=a+1,i=!0),r.pyLikes={pxLikeCount:o,pxIsLiked:i},s.updateState({pulse:{messages:{[e]:r}}})}else s.reportError(`likeMessage call failed with status ${a.status}`,a)})).catch((e=>{s.reportError(": Error occurred during ajax call at likeMessage API : ",e.response.data)}))};deleteMessage=(e,t,n,r)=>{let s=e;t&&(s=n);Bi("deleteFeedMessage",{queryPayload:{messageID:s}},r.getContextName()).then((s=>{if(200===s.status)if(t){const t=r.getValue(`pulse.messages.${e}`),s=t?.pxResults&&Array.isArray(t?.pxResults)&&t.pxResults?.length>0&&t.pxResults?.filter((e=>e.pzInsKey!==n));r.updateState({pulse:{messages:{[e]:{pxResults:s}}}})}else{const t=r.getValue("pulse.messageIDs"),n=t&&Array.isArray(t)&&t?.length>0&&t?.filter((t=>t!==e)),s={...r.getValue("pulse.messages")};delete s[e],r.updateState({pulse:{messageIDs:n,messages:s}})}else r.reportError(`deleteMessage call failed with status ${s.status}`,s)})).catch((e=>{r.reportError(": Error occurred during ajax call at deleteMessage API : ",e.response)}))};getLikedUsers=(e,t)=>Bi("getFeedMessageLikes",{queryPayload:{messageID:e}},t.getContextName());getMentionSuggestions=(e,t)=>{const{pulseContext:n,searchFor:r,mentionsType:s,listSize:a=5}=e,o={pulseContext:n,searchFor:r,mentionsType:s,listSize:a};for(let e=0;e<this.mentionsTagsCancelTokenSource.length;e+=1)this.mentionsTagsCancelTokenSource[e].cancel();const i=Hi();return this.mentionsTagsCancelTokenSource.push(i),Bi("getMentionSuggestions",{queryPayload:o,cancelTokenSource:i},t.getContextName()).then((e=>(this.mentionsTagsCancelTokenSource=[],200===e.status&&e.data?e?.data:(t.reportError(`Get mention suggestions call failed ${e.status}`,e.data),[])))).catch((e=>{qi(e)||t.reportError(": Error occurred during ajax call at getMentionSuggestions API : ",e.response.data)}))};getMentionTypes=e=>Bi("getMentionTypes",{},e.getContextName());getPostTypeView=(e,t)=>Bi("getViewRuleByMessageType",{queryPayload:{type:e}},t.getContextName());getTagSuggestions=(e,t)=>{const{searchFor:n,listSize:r=5}=e,s={searchFor:n,listSize:r};for(let e=0;e<this.mentionsTagsCancelTokenSource.length;e+=1)this.mentionsTagsCancelTokenSource[e].cancel();const a=Hi();return this.mentionsTagsCancelTokenSource.push(a),Bi("getTagSuggestions",{queryPayload:s,cancelTokenSource:a},t.getContextName()).then((e=>{this.mentionsTagsCancelTokenSource=[];let n=[];return 200===e.status&&e?.data?n=e?.data?.tags&&Array.isArray(e?.data?.tags)&&e.data.tags.length>0&&e.data.tags?.map((e=>`#${e}`)):t.reportError(`Get tag suggestions call failed ${e.status}`,e.data),n})).catch((e=>{qi(e)||t.reportError(": Error occurred during ajax call at getTagSuggestions API : ",e.response.data)}))}},nC={getTaggedCases:(e,t)=>Bi("loadView",{queryPayload:{caseID:e,viewID:"pyTaggedCases"}},t.getContextName()).then((e=>e?.data)).catch((e=>{t.reportError(": Error occurred during ajax call at fetchTaggedcases API : ",e.response)})),getTags:(e,t)=>Bi("getCaseTags",{queryPayload:{caseID:e}},t.getContextName()).then((e=>e?.data?.tagsList)).catch((e=>{t.reportError(": Error occurred during ajax call at fetchTags API : ",e.response)})),postTags:(e,t,n)=>{const r={caseID:e},s=JSON.stringify({tags:t});return Bi("addTagsToCase",{body:s,queryPayload:r},n.getContextName()).then((e=>e?.data?.results)).catch((e=>{n.reportError(": Error occurred during ajax call at postTags API : ",e.response)}))},removeTag:(e,t,n)=>Bi("deleteCaseTag",{queryPayload:{caseID:e,tagID:t}},n.getContextName()).catch((e=>{n.reportError(": Error occurred during ajax call at removeTag API : ",e.response)})),getTagsLandingPageURL:e=>Ru.getPageDataAsync("D_pxGetTagsLandingPageURL",e.getContextName(),{},{invalidateCache:!0}).catch((t=>{e.reportError(": Error occurred during ajax call getTagsLandingPageURL API : ",t.response)}))},rC=(e,t)=>{ah(t.getContextName(),e.etag),oh(t.getContextName(),e.etag)},sC={getParticipants:(e,t)=>Bi("getAllParticipants",{queryPayload:{caseID:e}},t.getContextName()).then((e=>e?.data?.data.content.pyParticipants)).catch((e=>{t.reportError(": Error occurred during ajax call at getParticipants API : ",e.response)})),getRoleView:(e,t,n)=>Bi("getParticipantRoleView",{queryPayload:{caseID:e,participant_roleID:t}},n.getContextName()).then((e=>e?.data)).catch((e=>{n.reportError(": Error occurred during ajax call at fetchTaggedcases API : ",e.response)})),getParticipantRoles:(e,t)=>Bi("getParticipantRoles",{queryPayload:{caseID:e}},t.getContextName()).then((e=>e?.data?.participant_roles)).catch((e=>{t.reportError(": Error occurred during ajax call at getParticipantRoles API : ",e.response)})),getParticipant:(e,t,n)=>Bi("getParticipant",{queryPayload:{caseID:e,participantID:t}},n.getContextName()).then((e=>e?.data)).catch((e=>{n.reportError(": Error occurred during ajax call at getParticipant API : ",e.response)})),createParticipant:async(e,t,n,r,s)=>{const a={caseID:e},o={...n,participantRoleID:t},i={"if-match":r.getCaseSummary().headers.etag};return new Promise(((e,t)=>{Bi("createParticipant",{body:o,queryPayload:a,headers:i},r.getContextName()).then((t=>{rC(t.headers,r),e()})).catch((e=>{e.response.data.errorDetails?.forEach((e=>{e.erroneousInputOutputFieldInPage=e.erroneousInputOutputFieldInPage.replace(/\.pyWorkParty\([^)]*\)/,"")}));const n=Ol(s||r.getContextName());r.reportError(": Error occurred during ajax call at createParticipant API : ",{...e.response.data,formFields:n},s),t(e.response)}))}))},updateParticipant:async(e,t,n,r,s)=>{const a={caseID:e,participantID:t},o={"if-match":r.getCaseSummary().headers.etag};return new Promise(((e,t)=>{Bi("updateParticipant",{body:n,queryPayload:a,headers:o},r.getContextName()).then((t=>{rC(t.headers,r),e()})).catch((e=>{e.response.data.errorDetails?.forEach((e=>{e.erroneousInputOutputFieldInPage=e.erroneousInputOutputFieldInPage.replace(/\.pyWorkParty\([^)]*\)/,"")}));const n=Ol(s||r.getContextName());r.reportError(": Error occurred during ajax call at updateParticipant API : ",{...e.response.data,formFields:n},s),t(e.response)}))}))},deleteParticipant:(e,t,n)=>{const r={caseID:e,participantID:t},s={"if-match":n.getCaseSummary().headers.etag};return new Promise(((e,t)=>{Bi("deleteParticipant",{queryPayload:r,headers:s},n.getContextName()).then((t=>{rC(t.headers,n),e()})).catch((e=>{n.reportError(": Error occurred during ajax call at deleteParticipant API : ",e.response),t(e.response)}))}))}};function aC(e=[]){return e.reduce(((e,t)=>(e[t.personalizationID]={name:t.name,personalizationState:JSON.parse(t.personalizationState||"{}")},e)),{})}const oC="create",iC="update",cC="delete";function lC(e,t,n,r){const s=rg(t);if(s){switch(e){case oC:case iC:{const{markAsDefault:e,...t}=r;Object.entries(t).length>0&&(s.allPersonalizations[n]=t),e&&(s.defaultPersonalization=n);break}case cC:delete s.allPersonalizations[n],s.defaultPersonalization===n&&(s.defaultPersonalization="");break;default:return null}return s}return null}const uC={},dC=async e=>{const t=rg(e);if(t)return Array.isArray(t.allPersonalizations)&&(t.allPersonalizations=aC(t.allPersonalizations)),Promise.resolve(t);const{restApi:n,reqType:r}=$f("getUIListPersonalizations",{listID:e});return Bo(n,{method:r,body:{}}).then((e=>{const{data:t}=e;return{allPersonalizations:aC(t.allPersonalizations),defaultPersonalization:t.defaultPersonalization}}))},pC=async(e,t,n)=>{const{restApi:r,reqType:s}=$f("createListPersonalization",{listID:e});return lC(oC,e,t,n),Bo(r,{method:s,body:{...n,personalizationState:JSON.stringify(n.personalizationState)}}).then((e=>{const n=e.data;return uC[t]=n,e}))},hC=async(e,t,n)=>{const r=uC[t]||t;lC(iC,e,t,n);const{restApi:s,reqType:a}=$f("updateListPersonalization",{listID:e,personalizationID:r})||{};return Bo(s,{method:a,body:{...n,personalizationState:JSON.stringify(n.personalizationState)}})},gC=async(e,t)=>{const n=uC[t]||t;lC(cC,e,t);const{restApi:r,reqType:s}=$f("deleteListPersonalization",{listID:e,personalizationID:n});return Bo(r,{method:s,body:{}}).then((e=>(uC[t]&&delete uC[t],e)))};const fC=function(e){return e?{createPersonalization:pC.bind(null,e),updatePersonalization:hC.bind(null,e),deletePersonalization:gC.bind(null,e),fetchPersonalizations:dC.bind(null,e)}:{createPersonalization:()=>Promise.resolve(""),updatePersonalization:()=>Promise.resolve(),deletePersonalization:()=>Promise.resolve(),fetchPersonalizations:()=>Promise.resolve({})}},mC="getDataObjects",IC="getInsightByID",yC=["LocalList","RemoteList","PromptList","DataPage"];let EC=null;const AC={},_C=e=>yu.getAppCacheKey(`PrimaryFields-${e}`);function CC(e){let t;return e[1].category?t=e[1].category:e[0].indexOf(":")>0&&(t=e[0].substring(0,e[0].indexOf(":"))),t}const SC={getDataObjects:function(){const e=yu.getAppCacheKey(mC);if(window.sessionStorage.getItem(e))return Promise.resolve(JSON.parse(`${window.sessionStorage.getItem(e)}`));const{restApi:t,reqType:n}=$f(mC,{}),r=Bo(t,{method:n});return r.then((t=>{window.sessionStorage.setItem(e,JSON.stringify(t))})),r},getDataPageObjects:function(e=!0){if(EC)return EC;const t=yu.getAppCacheKey("getDataPageObjects");if(e&&window.sessionStorage.getItem(t))return Promise.resolve(JSON.parse(`${window.sessionStorage.getItem(t)}`));const{restApi:n,reqType:r}=$f("getDataPages",{datapageRequestType:"explorable"});return EC=Bo(n,{method:r,datapageRequestType:"explorable"}),EC.then((e=>{EC=null,window.sessionStorage.setItem(t,JSON.stringify(e))})),EC},getDataViewMetadata:function(e,t,n){if(!t){const{sourceMetadata:t,sourceFields:n}=function(e){const t=ng(e);if(t&&t.classID){let e=ag(t.classID);const n=t.rdFields?.fields?.filter((e=>e.indexOf(".")>0));if(n&&!jg.isEmpty(n)){const r=n.reduce(((e,n)=>{const r=Kh(n,t.classID);return e[n]=r,e}),{});e={...e,...r}}if(e&&Object.keys(e).length>0){for(const t of Object.keys(e))e[t].type.startsWith("Page")?delete e[t]:e[t]?.datasource&&yC.includes(e[t].datasource.tableType)&&(e[t].fieldType="Picklist");return{sourceFields:e,sourceMetadata:t}}}return{}}(e);if(t&&n&&Object.keys(n).length>0){const e={data:{...t,fields:Object.entries(n).map((e=>({...e[1],fieldID:e[0],fieldType:e[1].fieldType||(e[1].isUserReference?"User reference":void 0),category:CC(e),classID:e[1].associationClassID?e[1].associationClassID:e[1].classID})))}};return Promise.resolve(e)}}const r={dataSource:e,columns:[],parameters:{},associationFilter:n,matchPosition:"",ignoreCase:!1};return ku.init(r).then((({dataSourceMetaData:e})=>Promise.resolve({data:e})))},getDefaultColumns:function(e){const t=yu.getAppCacheKey(`DefaultColumns_${Object.values(e).join("_")}`);if(window.sessionStorage.getItem(t))return Promise.resolve(JSON.parse(`${window.sessionStorage.getItem(t)}`));const{restApi:n,reqType:r}=$f("getListData",{dataViewName:"D_pzGetDefaultColumns"}),s=Bo(n,{method:r,body:{dataViewParameters:e}});return s.then((e=>{window.sessionStorage.setItem(t,JSON.stringify(e))})),s},getFieldsForDataSource:function(e,t,n){if(!t){const t=ng(e),n=Array.isArray(t?.rdFields)?t?.rdFields:t?.rdFields?.fields;return n?Promise.resolve({data:{data:n.map((e=>({pyFieldName:e})))}}):Promise.resolve({data:{data:[]}})}const r=yu.getAppCacheKey(`RDColumns-${e}`);if(window.sessionStorage.getItem(r))return Promise.resolve(JSON.parse(`${window.sessionStorage.getItem(r)}`));const s=yu.getData("D_pxFieldsForDataSource",{dataViewParameters:{DataPageName:e}},n);return s.then((e=>{window.sessionStorage.setItem(r,JSON.stringify(e))})),s},getPrimaryFieldsForDataSource:function(e="",t=""){const n=yu.getAppCacheKey(`PFColumns-${e}${t}`);if(window.sessionStorage.getItem(n))return Promise.resolve(JSON.parse(`${window.sessionStorage.getItem(n)}`));const r=yu.getData("D_pxGetInitialFieldsForDataSource",{dataViewParameters:{DataPageName:e,ClassName:t}});return r.then((e=>{window.sessionStorage.setItem(n,JSON.stringify(e))})),r},getPrimaryFieldsForInsights:async function(e,t,n){const{allClasses:r,promisesToAwait:s,classesToFetch:a,isTopLevelClassPresent:o,joinedClassesToFetch:i}=function(e,t){const n=[],r=[];let s=!1;const a=[],o=[];return e&&o.push(e),t&&t.length>0&&o.push(...t),o.forEach((t=>{const o=_C(t);window.sessionStorage.getItem(o)||(AC[t]?r.push(AC[t]):(n.push(t),t===e?s=!0:a.push(t)))})),{allClasses:o,promisesToAwait:r,classesToFetch:n,isTopLevelClassPresent:s,joinedClassesToFetch:a}}(e,n);return a.length&&s.push((async(e,t,n,r)=>{const s=yu.getData("D_pxGetPrimaryFieldsForInsights",{dataViewParameters:{...t&&{topLevelClassID:t},...r&&{joinedClassIDs:r.join(",")},...n&&{topLevelDataPageID:n}}}).then((t=>{const n=t.data?.data||[],r={};e.forEach((e=>{r[e]=[]})),n.forEach((({classID:e,pyFieldName:t})=>{r[e].push(t)})),Object.entries(r).forEach((([e,t])=>{const n=_C(e);window.sessionStorage.setItem(n,JSON.stringify(t))}))})).finally((()=>{e.forEach((e=>{delete AC[e]}))}));return e.forEach((e=>{AC[e]=s})),s})(a,o?e:void 0,o?t:void 0,i.length>0?i:void 0)),Promise.allSettled(s).then((()=>{const e={};return r.forEach((t=>{const n=_C(t);if(window.sessionStorage.getItem(n))try{e[t]=JSON.parse(`${window.sessionStorage.getItem(n)}`)}catch{}})),{data:e}}))},getInsightIDs:function(){const{restApi:e,reqType:t}=$f("getInsightIDs");return Bo(e,{method:t})},getInsightByID:function(e){const t=sg(e);if(t)return Promise.resolve({data:{pyInsights:[t]}});const n={insightID:e},{restApi:r,reqType:s}=$f(IC,n);return Bo(r,{method:s})},getInsightsByID:function(e){const t={insightID:e.join(",")},{restApi:n,reqType:r}=$f(IC,t);return Bo(n,{method:r})},createInsight:function(e){const{restApi:t,reqType:n}=$f("createInsight");return Bo(t,{method:n,body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})},updateInsight:function(e,t){const n={insightID:e},{restApi:r,reqType:s}=$f("updateInsight",n);let a;return"UpdateDateTime"in t&&(a=t.UpdateDateTime),Bo(r,{method:s,body:JSON.stringify(t),headers:{"if-match":a,"Content-Type":"application/json"}})},deleteInsight:function(e){const t={insightID:e},{restApi:n,reqType:r}=$f("deleteInsight",t);return Bo(n,{method:r})},exportToExcel:function(e){const{restApi:t,reqType:n}=$f("exportToExcel");return Bo(t,{method:n,body:JSON.stringify(e)})},exportToCSV:function(e){const{restApi:t,reqType:n}=$f("exportToCSV");return Bo(t,{method:n,body:JSON.stringify(e)})},scheduleInsight:(e,t)=>{const n={insightID:e},{restApi:r,reqType:s}=$f("scheduleInsight",n);return Bo(r,{method:s,body:JSON.stringify(t)})},updateScheduledInsight:(e,t,n)=>{const r={insightID:e,scheduleID:t},{restApi:s,reqType:a}=$f("updateScheduledInsight",r);return Bo(s,{method:a,body:JSON.stringify(n)})},deleteScheduledInsight:(e,t)=>{const n={insightID:e,scheduleID:t},{restApi:r,reqType:s}=$f("deleteScheduledInsight",n);return Bo(r,{method:s})},translateStrings:function(e){const{restApi:t,reqType:n}=$f("translateStrings");return Bo(t,{method:n,body:JSON.stringify(e)})}};const TC=new class{addRoutes=e=>{return t=e,void Ph.addRoutes(t);var t}};const NC=class{static registerModule(e,t,n){n[e]=()=>t}};const OC=class{static getCaseEvent=()=>Object.freeze(U.PUB_SUB_EVENTS.CASE_EVENTS);static getDataEvent=()=>Object.freeze(U.PUB_SUB_EVENTS.DATA_EVENTS);static getTransientEvent=()=>Object.freeze(U.PUB_SUB_EVENTS.EVENT_TRANSIENT_ITEMS);static getBootstrapShellEvent=()=>Object.freeze(U.PUB_SUB_EVENTS.BOOTSTRAP_SHELL_EVENTS)};const PC=new class{constructor(){this.genericFailedMessage="Failed to display content. Contact the application administrator."}getGenericFailedMessage(){return this.genericFailedMessage}setGenericFailedMessage(e){this.genericFailedMessage=e}},DC={setTokens:e=>{Yo({tokenInfo:e}),zo(e?.csrf&&!e?.access_token?{pzCTkn:e?.csrf}:{Authorization:`${e?.token_type} ${e?.access_token}`}),setTimeout((()=>yo.publish("updateSession",{updateStatus:"success"})),0)},revokeTokens:async()=>Co(),getAuthInstance:e=>_o.init(e),setAuthorizationHeader:e=>{zo({Authorization:e}),setTimeout((()=>yo.publish("updateSession",{updateStatus:"success"})),0)}};const RC=new class{getDebouncedSubject(e){return(new CI).pipe(FA(e))}};Fi.register("email",(e=>{let t=null;return e&&!function(e){const t="[^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+",n="\\x5c[\\x00-\\x7f]",r=`(${t}|\\x5b([^\\x0d\\x5b-\\x5d\\x80-\\xff]|${n})*\\x5d)`,s=`(${t}|\\x22([^\\x0d\\x22\\x5c\\x80-\\xff]|${n})*\\x22)`;return new RegExp(`^${s}(\\x2e${s})*\\x40${r}(\\x2e${r})*$`).test(e)}(e)&&(t="Enter a valid email address"),t})),Fi.register("integer",(e=>{let t=null;return e&&!/^(-)?\d+$/.test(e)&&(t="Invalid number"),t})),Fi.register("required",(e=>Array.isArray(e)&&0===e.length||null==e||""===e?"Cannot be blank":null)),Fi.register("url",(e=>{let t=null;return e&&!function(e){let t;try{t=new URL(e)}catch{return!1}return"http:"===t.protocol||"https:"===t.protocol||"ftp:"===t.protocol}(e)&&(t="Enter a valid url"),t})),setTimeout((()=>{const e="Enter a valid phone number";s.e(667).then(s.bind(s,866)).then((({parsePhoneNumberFromString:t})=>{Fi.register("phone",(n=>{let r=null;n&&!/^\+?\d+$/.test(n)&&(r=e);const s=n?.startsWith("+");if(n&&s){const s=t(n);s&&s.isPossible()&&n===s.number||(r=e)}return r}))}))}),j.PRIORITY.TRIVIAL);const bC=(e,t)=>{switch(t){case"invalid":return`Incorrect ${e}`;case"incomplete":return`Incomplete ${e}`;default:return null}};Fi.register("datetime",(e=>bC("DateTime",e))),Fi.register("date",(e=>bC("Date",e))),Fi.register("time",(e=>bC("Time",e)));const vC=e=>{for(const t of e)if(t?.error)return"Error with one or more files";return null};Fi.register("attachment",(e=>{let t=null;return e?("pyCount"in e&&Array.isArray(e.pxResults)?t=vC(e.pxResults):Array.isArray(e)?t=vC(e):"error"in e&&e.error&&(t="Error with one or more files"),t):t}));const xC="createConversation",wC="sendMessage",MC="getConversations",LC="getMessages",FC=(e,t,n,r,s,a,o)=>{for(const e of o)e?.cancel&&"function"==typeof e.cancel&&e.cancel();const i=Hi();return o.push(i),Bi(e,{queryPayload:MC===e?{assistantID:t,contextID:n,pageSize:r,pageIndex:s}:{agentID:t,contextID:n,pageSize:r,pageIndex:s},cancelTokenSource:i},a).then((e=>(o.pop(),e)))},UC=(e,t,n,r,s)=>{for(const e of s)e?.cancel&&"function"==typeof e.cancel&&e.cancel();const a=Hi();return s.push(a),Bi(e,{queryPayload:LC===e?{assistantID:t,conversationID:n}:{agentID:t,conversationID:n}},r).then((e=>(s.pop(),e)))},jC=(e,t,n,r,s)=>{for(const e of s)e?.cancel&&"function"==typeof e.cancel&&e.cancel();const a=Hi();return s.push(a),Bi(e,{body:JSON.stringify({contextID:t}),cancelTokenSource:a,queryPayload:e===xC?{assistantID:n}:{agentID:n}},r).then((e=>(s.pop(),e)))},VC=(e,t,n,r,s,a)=>{const o={...r&&{request:r},...a&&a?.length>0&&{attachments:a}};return Bi(e,{body:JSON.stringify(o),queryPayload:e===wC?{assistantID:t,conversationID:n}:{agentID:t,conversationID:n}},s)},kC={createConversation:(e,t,n,r=[])=>jC(xC,e,t,n,r),sendMessage:(e,t,n,r)=>VC(wC,e,t,n,r),createConversationForAgent:(e,t,n,r=[])=>jC("createConversationForAgent",e,t,n,r),sendMessageForAgent:(e,t,n,r,s)=>VC("sendMessageForAgent",e,t,n,r,s),likeAgentMessage:(e,t,n,r)=>Bi("likeAgentMessage",{queryPayload:{agentID:e,conversationID:t,messageID:n}},r),unLikeAgentMessage:(e,t,n,r,s="")=>{const a={queryPayload:{agentID:e,conversationID:t,messageID:n},body:JSON.stringify({feedbackText:s})};return Bi("dislikeAgentMessage",a,r)},getConversations:(e,t,n,r,s,a=[])=>FC(MC,e,t,n,r,s,a),getConversationsForAgent:(e,t,n,r,s,a=[])=>FC("getConversationsForAgent",e,t,n,r,s,a),getMessages:(e,t,n,r=[])=>UC(LC,e,t,n,r),getMessagesForAgent:(e,t,n,r=[])=>UC("getMessagesForAgent",e,t,n,r)};const $C=class{caseTypeAccessMap=new Map;constructor(){this.caseTypeAccessMap=Dh.getCaseTypeList().reduce(((e,t)=>(e.set(t.pyWorkTypeImplementationClassName,t.hasCreateAccess??!0),e)),new Map)}hasCreateAccess(e){return this.caseTypeAccessMap.get(e)}static getInstance(){return this.instance||(this.instance=new this),this.instance}};class BC{static behaviorOverrides={};getPersonalizationUtils=fC;constructor(){BC.behaviorOverrides={}}getPCoreVersion=()=>"25.1.0";onPCoreReady=e=>V_.onPCoreReady(e);onPCoreCleanup=e=>V_.onPCoreCleanup(e);getComponentsRegistry=()=>V_.getComponentsRegistry();checkIfSemanticURL=()=>V_.checkIfSemanticURL();isValidSemanticURL=()=>(()=>{if(Qf()){const e=Ph.processUrl(Ah(),!0);return!!Ph._getMatchedRouteInRoutingTable(e)}return!1})();getRoutingUtils=()=>TC;getViewResources=()=>i;configureForBrowserBookmark=e=>V_.configureForBrowserBookmark(e);getStore=()=>_g();resetStore=()=>Lg();getMessageManager=()=>fo;getCoexistenceManager=()=>U_;getStoreValue=(e,t,n)=>Og(e,t,n);getContainerUtils=()=>c;getAnnotationUtils=()=>Yl;getFieldUtils=()=>Qo;getFieldDefaultUtils=()=>Pi;getAssetLoader=()=>Xi;getAttachmentUtils=()=>Mi;getViewRuleApi=()=>z_;getFeedUtils=()=>tC;getTagUtils=()=>nC;getGenAIAssistantUtils=()=>kC;getStakeholderUtils=()=>sC;getUserApi=()=>Q_;getCaseFollowerApi=()=>K_;getCaseUtils=()=>Rl;getStateUtils=()=>sd;getRelatedCasesApi=()=>J_;getDataApi=()=>ku;getDataApiUtils=()=>yu;getAnalyticsUtils=()=>SC;getLocaleUtils=e=>{const t=e??Dh.getLocale()??"en-US";return zh(t)};registerLocaleManager=e=>{const t=this.getLocaleUtils();Object.keys(e).forEach((n=>{t[n]=e[n]}))};setBehaviorOverrides=e=>{BC.behaviorOverrides=e};setBehaviorOverride=(e,t)=>{BC.behaviorOverrides[e]=t};getBehaviorOverrides=()=>BC.behaviorOverrides;getBehaviorOverride=e=>BC.behaviorOverrides[e];getAsynchronousUtils=()=>RC;createPConnect=e=>vd(e);getPubSubUtils=()=>yo;registerComponentCreator=e=>{xd(e)};getConstants=()=>Object.freeze(U);getResolvedConstantValue=e=>j.getProperty(e);getEvents=()=>OC;getRestClient=()=>o;getMashupApi=()=>j_;getEnvironmentInfo=()=>Dh;getRuntimeParamsAPI=()=>qu;getSemanticUrlUtils=()=>ic;getRemoteCaseUtils=()=>$;getNavigationUtils=()=>tc;registerModule=(e,t)=>NC.registerModule(e,t,this);getErrorHandler=()=>PC;getFormUtils=()=>gl;getMessagingServiceManager=()=>Pu;getMetadataUtils=()=>l;getDataPageUtils=()=>Ru;getDataTypeUtils=()=>zl;getCascadeManager=()=>Ig;isDeepEqual=(e,t)=>h()(e,t);getAuthUtils=()=>DC;getDebugger=()=>Eo;getDeferLoadManager=()=>mu;getExpressionEngine=()=>n;getActionsSequencer=()=>zu;getRefreshManager=()=>Bu;getInitialiser=()=>q_;getBootstrapUtils=()=>V_;getContextTreeManager=()=>eo;getAccessPrivilege=()=>$C.getInstance();getObjectTransformer=()=>F;getAllStateMachines=(e,t,n)=>t&&n?fl.getAllStateMachines(e,t,n):fl.getAllStateMachinesByContext(e);isNamespaceEnabled=()=>!1;getQualifiedName=(e,t)=>e;getDefaultQualifiedName=e=>this.getQualifiedName(e,"PegaPlatform")}const GC=new BC;globalThis.PCore=GC})()})();
2
2
  //# sourceMappingURL=constellation-core-web.js.map