@pega/constellationjs 0.2421.1 → 0.2612.2

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 (41) hide show
  1. package/README.md +40 -32
  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 +2 -0
  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 -0
  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.797b019a.js +2 -0
  14. package/dist/constellation-core.797b019a.js.LICENSE.txt +124 -0
  15. package/dist/constellation-core.797b019a.js.br +0 -0
  16. package/dist/constellation-core.797b019a.js.gz +0 -0
  17. package/dist/constellation-core.797b019a.js.map +1 -0
  18. package/dist/constellation-core.json +1 -1
  19. package/dist/js/libphonenumber-web.js +2 -0
  20. package/dist/js/libphonenumber-web.js.br +0 -0
  21. package/dist/js/libphonenumber-web.js.gz +0 -0
  22. package/dist/js/libphonenumber-web.js.map +1 -0
  23. package/dist/js/libphonenumber.c2686009.js +2 -0
  24. package/dist/js/libphonenumber.c2686009.js.br +0 -0
  25. package/dist/js/libphonenumber.c2686009.js.gz +0 -0
  26. package/dist/js/libphonenumber.c2686009.js.map +1 -0
  27. package/dist/lib_asset.json +1 -1
  28. package/package.json +1 -1
  29. package/dist/constellation-core.7517791f.js +0 -2
  30. package/dist/constellation-core.7517791f.js.br +0 -0
  31. package/dist/constellation-core.7517791f.js.gz +0 -0
  32. package/dist/constellation-core.7517791f.js.map +0 -1
  33. package/dist/js/531-web.js +0 -2
  34. package/dist/js/531-web.js.br +0 -0
  35. package/dist/js/531-web.js.gz +0 -0
  36. package/dist/js/531-web.js.map +0 -1
  37. package/dist/js/531.177c98ad.js +0 -2
  38. package/dist/js/531.177c98ad.js.br +0 -0
  39. package/dist/js/531.177c98ad.js.gz +0 -0
  40. package/dist/js/531.177c98ad.js.map +0 -1
  41. /package/dist/{constellation-core.7517791f.js.LICENSE.txt → constellation-core-web.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
- (()=>{var e,t,n={933:(e,t,n)=>{"use strict";var r=n(515);Object.defineProperty(t,"reduxBatch",{enumerable:!0,get:function(){return r.reduxBatch}})},515:(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})}}},923:(e,t,n)=>{e.exports=n(933)},924:(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.*?")+"$"),D=d.Symbol,R=A.propertyIsEnumerable,b=I.splice,O=D?D.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")&&(!R.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},174:(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.*?")+"$"),D=m.Symbol,R=I.splice,b=k(m,"Map"),O=k(Object,"create"),v=D?D.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():R.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}},207:(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,D=S.hasOwnProperty,R=S.toString,b=RegExp("^"+P.call(D).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&&D.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)&&D.call(e,"callee")&&(!v.call(e,"callee")||R.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 D.call(t,e)?t[e]:void 0},F.prototype.has=function(e){var t=this.__data__;return M?void 0!==t[e]:D.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)?R.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)&&R.call(e)==l}e.exports=function(e,t){return null!=e&&H(e,t,$)}},828:(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,D=S.hasOwnProperty,R=S.toString,b=RegExp("^"+P.call(D).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 R.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)&&D.call(e,"callee")&&(!v.call(e,"callee")||R.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=R.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)?R.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(D.call(e,n))return!1;return!0}},722:(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]",D="[object ArrayBuffer]",R="[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[D]=v[u]=v[R]=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 De(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Pe;++t<n;)this.add(e[t])}function Re(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 Re),h||Qe(e)?Ue(e,t,n,r,o,l):function(e,t,n,r,o,i,c){switch(n){case R:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case D: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 Re),o(v,x,n,r,l)}}if(!P)return!1;return l||(l=new Re),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 De: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},De.prototype.add=De.prototype.push=function(e){return this.__data__.set(e,r),this},De.prototype.has=function(e){return this.__data__.has(e)},Re.prototype.clear=function(){this.__data__=new Ne,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 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)))!=R||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 R;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)}},431:(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,D,R=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,D=Object,function(e){return P(D(e))}),G=Object.create,W=O.propertyIsEnumerable,H=R.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&&Re(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&&Re(c),f=!h&&!g&&we(c);d=c,h||g||f?Pe(i)?d=i:xe(A=i)&&De(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 De(e){return null!=e&&Oe(e.length)&&!be(e)}var Re=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 De(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?De(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},8:(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,D=C.toString,R=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)?D.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)?R: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)&&D.call(e)==c}e.exports=function(e,t,n){return null==e?e:$(e,t,n)}},795:(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.*?")+"$"),D=m.Symbol,R=I.splice,b=$(m,"Map"),O=$(Object,"create"),v=D?D.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():R.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)}},386: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)}},849: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=849,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/"+e+"-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&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");n.length&&(e=n[n.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.p=e})(),(()=>{var e={290: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:()=>Ca,hasStandardBrowserEnv:()=>Ta,hasStandardBrowserWebWorkerEnv:()=>Na,navigator:()=>Sa,origin:()=>Pa});var o={};s.r(o),s.d(o,{CONTAINER_NAMES:()=>sd,CONTAINER_TYPES:()=>rd,addRootContainerItem:()=>Ld,areContainerItemsPresent:()=>ud,clearTransientData:()=>$d,closeContainerItem:()=>Md,getActiveContainerItemContext:()=>Ed,getActiveContainerItemIDFromRoutingInfo:()=>Zd,getActiveContainerItemName:()=>fd,getActiveContext:()=>Kd,getChildContainerItems:()=>Ad,getChildContainers:()=>_d,getChildContainersContexts:()=>Cd,getContainerAPI:()=>Wd,getContainerAccessOrder:()=>ld,getContainerData:()=>od,getContainerItemData:()=>id,getContainerItemName:()=>pd,getContainerItems:()=>cd,getContainerLimit:()=>Dd,getContainerParentContext:()=>Qd,getContainerType:()=>gd,getContextByTargetAndKey:()=>Jd,getDataContextName:()=>Id,getFlowContainer:()=>tp,getLeastRecentlyUsedNonDirtyContainerItemID:()=>xd,getParentContainerItem:()=>ep,getRootContainerName:()=>Yd,getSuggestionContexts:()=>Sd,getTargetFromContainerItemID:()=>wd,getTransientItems:()=>jd,hasContainerItems:()=>Pd,isContainerDirty:()=>vd,isContainerInitialized:()=>hd,isContainerItemActive:()=>md,isContainerItemContextBeingUsedInOtherContainers:()=>Fd,isContainerItemExists:()=>dd,isContainerLimitReached:()=>bd,isContainerMultipleMode:()=>Nd,isContainerSingleMode:()=>Td,purgeTransientData:()=>Bd,removeContainer:()=>Hd,replaceTransientData:()=>kd,resetContainersPayload:()=>Od,setContainerLimit:()=>Rd,updateCaseContextEtag:()=>zd,updateParentLastUpdateTime:()=>Xd,updateRelatedContextEtag:()=>qd,updateTransientData:()=>Vd});var i={};s.r(i),s.d(i,{getAdditionalInfo:()=>eh,getDataPageKeys:()=>Jp,getDataPageMetadata:()=>Gp,getEmbeddedPropertyMetadata:()=>Up,getFieldParameters:()=>zp,getFieldsByClassName:()=>qp,getGenAICoach:()=>Kp,getInsight:()=>Hp,getLookUpDataPage:()=>Qp,getLookUpDataPageInfo:()=>Zp,getParagraph:()=>Yp,getPersonalizationMetadata:()=>Wp,getPropertyMetadata:()=>Lp,getResolvedFieldMetadata:()=>th,getSavableDataPage:()=>Xp,isViewExists:()=>$p,mergeStore:()=>Mp,resolveNavigation:()=>Bp,resolveView:()=>kp,updateNavigationStore:()=>jp,updateStores:()=>Vp,updateViewStore:()=>Fp});var c={};s.r(c),s.d(c,{dispatch:()=>ch,getActionType:()=>fh,getContextValue:()=>hh,getDataObject:()=>lh,getReferenceTokens:()=>ah,getSharedDataObject:()=>uh,getStore:()=>ih,getValue:()=>ph,isMergeable:()=>yh,lookupContextValue:()=>gh,mergeDeep:()=>Ih,removeItem:()=>mh,replaceValue:()=>Ah,resetStore:()=>_h,setStore:()=>oh,updateValue:()=>Eh});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:()=>qm,getCancelTokenSource:()=>zm,getCaseApi:()=>Xm,getHeaderProcessor:()=>Gm,invokeCustomRestApi:()=>Hm,invokeRestApi:()=>Wm,isRequestCanceled:()=>Ym,registerInterceptor:()=>Km});var d={};s.r(d),s.d(d,{fetchViewResources:()=>vE,updateViewResources:()=>OE});var p=s(722),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(386),T=s(795),N=s.n(T),P=s(207),D=s.n(P),R=s(174),b=s.n(R),O=s(8),v=s.n(O),x=s(431),w=s.n(x),M=s(828),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_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"},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"},START_PERFORMANCE_LOG:"start-performance-log",STOP_PERFORMANCE_LOG:"stop-performance-log",TOP_ACTION_LABEL:{CREATEWORK:"Create-Work",OPENASSIGNMENT:"Open-Assignment",OPENWORKBYHANDLE:"Open-Work-By-Handle",SAVEANDCLOSE:"Save-And-Close",SHOWDATA:"Show-Data",FINISHASSIGNMENT:"Finish-Assignment",GETDESCENDANTS:"Get-Descendants"}},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",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,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=>Dh.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=dp.environmentInfoObject?.pyRemoteCaseTypeList;e?.forEach((e=>{const t=this.getRemoteCase(e.pyWorkTypeImplementationClassName);t&&(t.name=e.pyWorkTypeName)}))}}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=od(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",De="REMOVE_ALL_TRANSIENT_ITEMS",Re="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=od(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&&od(n)?od(n):{}},It=(e,t)=>up.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=Rt[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=Dt[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}=Rt[this._state];this._subParser=new At(this._grammar,e,t)}_endSubExpression(){Rt[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?Dh.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)}},Dt={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)}},Rt={expectOperand:{operatorTypes:{literal:{toState:"expectBinOp"},identifier:{toState:Ct},unaryOperator:{},openParenthesis:{toState:"subExpression"}}},expectBinOp:{operatorTypes:{binaryOperator:{toState:"expectOperand"}}},identifier:{operatorTypes:{binaryOperator:{toState:"expectOperand"}}},subExpression:{subHandler:Dt.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:Dh.getPropertyValue(`${n}.pxObjClass`,null,t)||Dh.getPropertyValue(`${n}.pyClassName`,null,t)}}static updateState(e,t){Object.keys(e).forEach((n=>ch({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=Dh.getPropertyValue(F.CASE_INFO.ACTIVE_ACTION_ID,t,e),r=Dh.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=lh(e);s=t?.context_data?.actionType===j.CASE}return s},rn=e=>hh(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=lh(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&&ch({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]&&ch({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.includes(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}},Dn={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"},Rn=e=>({type:Dn.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?ch((e=>({type:gt,payload:e}))(o)):ch(Rn(o))},vn=(e,t,n,r,s)=>{if(!(e&&n&&t))return;r&&(r=Sh.convertPageRefToClipboardPageNotation(r));ch(Rn({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=Lp(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=Lp(Qt.getLeafPropertyName(n),Dh.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=Dh.getPropertyValue(F.CASE_INFO.ACTIVE_ACTION_ID,t,e)?Dh.getPropertyValue(F.CASE_INFO.ACTIVE_ACTION_ID,t,e):Dh.getPropertyValue(F.CASE_INFO.ASSIGNMENTACTION_ID,t,e);let a;a=r?Dh.getPropertyValue(F.CASE_INFO.CASE_INFO_ID,t,e):Dh.getPropertyValue(F.CASE_INFO.ASSIGNMENT_ID,t,e)?Dh.getPropertyValue(F.CASE_INFO.ASSIGNMENT_ID,t,e):Dh.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(Dh.getPropertyValue(j.CONTEXT_DATA_MODAL_VIEW.IS_MULTI_RECORD_DATA,n,t)){const e=Dh.getPropertyValue(F.CASE_INFO.CASE_INFO_ID,n,t),r=Dh.getPropertyValue(j.CONTEXT_DATA_MODAL_VIEW.VIEW_NAME,n,t),s=Dh.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=lh(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,ch(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,ch({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(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=_d(e)[0]?fd(_d(e)[0]):e,t&&zn({context:t,stateObj:lh(t),clearContextMessages:!0})},Qn={addMessages:Yn,getValidationErrorMessages:e=>{const t=lh(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(gp.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){const o={instruction:"UPDATE",content:{...Sh.unflatten(r)}},i={content:{...o.content},target:Sh.buildInstructionPageReference(s,t),listIndex:n,instruction:"UPDATE"};return a||ch(ug({...o,listIndex:n-1,context:e,referenceList:`${s}${t}`})),i}};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||ch(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=el(t),a={};let o=!0;n&&(a[el(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[el(n)]){const e={};e[el(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 s=tr.execute(this.contextName,this.target,t,e,this.pageReference,n),{isDefault:a=!1,skipPageinstruction:o}=r;if(!o){if(this.initChangeList(t-1),!a){const n=this.changeList?.[this.targetPageReference]?.[t-1].content;this.changeList[this.targetPageReference][t-1]=Ih(Sh.deepClone(n),e,r)}if(this.current?.automatic!==a||this.current?.instruction?.listIndex!==t||"UPDATE"!==this.current?.instruction.instruction)this.insertNode(s),a&&(this.current.automatic=!0);else{const t=this.current.instruction.content;this.current.instruction.content=Ih(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||ch(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]=Ih(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},ch(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),ch(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=Ih(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]=[]),Qc.isStateMachineExist(r,n,t)||Qc.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=el(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=>Qc.buildPageInstructionsByContext(e),yr=e=>Qc.buildPageInstructionsByContext(e,!0),Ir=e=>{Qc.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;Qc.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);Qc.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=Qc.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}})})),ch(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 Dr=(e,t,n={})=>{const{skipStateUpdate:r=!1}=n,s=e.getPageReference(),a=hr(t);pr(e,t,s);Qc.getStateMachine(e.getContextName(),s,a).deleteAll(r)},Rr=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}=Qc.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)}Qc.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}]`),Qc.getStateMachine(r,a,i).delete(e+1);const c=Qc.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}]`),Qc.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),Qc.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=Qc.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),Qc.getStateMachine(s,a,o).initPageInstructions(e,n,r)})(e,t,n,r),deleteAll:(t,n)=>Dr(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)),Qc.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)),Qc.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=(ph(`.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&&Vp(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={}}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=dp.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}`;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((()=>[]))}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===sd.WORKAREA,Kr=e=>e===sd.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(dp.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||Id(t),target:r}))}},as=e=>{const t=ih();if(!e)return!1;const n=W(e),r=wd(n),s=wd(e);if(!r||!s)return!1;const a=id(r,n),o=id(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=dp.getCaseTypeList();return"true"===t.filter((t=>t.pyWorkTypeImplementationClassName===e))?.[0]?.pyIsTraditionalUICase},us=()=>"true"===dp?.environmentInfoObject?.pxMashupDetails?.pyLaunchCaseInModal,ds=(e,t)=>{const n=es(e?.response),r=Qr(e?.response),{caseTypeID:s}=r,a=dp.getFeatureMap();(a?.deferUpdateCaseSummaryView??!Object.hasOwn(a,j.DEFER_UPDATE_CASESUMMARY_VIEW))&&s&&$p(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=wd(i),l=c&&od(c),u=c&&fd(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=>lh(e)?.context_data?.caseViewMode;function hs(e,t){return function(){return e.apply(t,arguments)}}const{toString:gs}=Object.prototype,{getPrototypeOf:fs}=Object,ms=(ys=Object.create(null),e=>{const t=gs.call(e);return ys[t]||(ys[t]=t.slice(8,-1).toLowerCase())});var ys;const Is=e=>(e=e.toLowerCase(),t=>ms(t)===e),Es=e=>t=>typeof t===e,{isArray:As}=Array,_s=Es("undefined");const Cs=Is("ArrayBuffer");const Ss=Es("string"),Ts=Es("function"),Ns=Es("number"),Ps=e=>null!==e&&"object"==typeof e,Ds=e=>{if("object"!==ms(e))return!1;const t=fs(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},Rs=Is("Date"),bs=Is("File"),Os=Is("Blob"),vs=Is("FileList"),xs=Is("URLSearchParams"),[ws,Ms,Ls,Us]=["ReadableStream","Request","Response","Headers"].map(Is);function Fs(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,s;if("object"!=typeof e&&(e=[e]),As(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 js(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 Vs="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,ks=e=>!_s(e)&&e!==Vs;const $s=(Bs="undefined"!=typeof Uint8Array&&fs(Uint8Array),e=>Bs&&e instanceof Bs);var Bs;const Gs=Is("HTMLFormElement"),Ws=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Hs=Is("RegExp"),qs=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Fs(n,((n,s)=>{let a;!1!==(a=t(n,s,e))&&(r[s]=a||n)})),Object.defineProperties(e,r)},zs="abcdefghijklmnopqrstuvwxyz",Ys="0123456789",Ks={DIGIT:Ys,ALPHA:zs,ALPHA_DIGIT:zs+zs.toUpperCase()+Ys};const Xs=Is("AsyncFunction"),Js=(Qs="function"==typeof setImmediate,Zs=Ts(Vs.postMessage),Qs?setImmediate:Zs?(ea=`axios@${Math.random()}`,ta=[],Vs.addEventListener("message",(({source:e,data:t})=>{e===Vs&&t===ea&&ta.length&&ta.shift()()}),!1),e=>{ta.push(e),Vs.postMessage(ea,"*")}):e=>setTimeout(e));var Qs,Zs,ea,ta;const na="undefined"!=typeof queueMicrotask?queueMicrotask.bind(Vs):"undefined"!=typeof process&&process.nextTick||Js,ra={isArray:As,isArrayBuffer:Cs,isBuffer:function(e){return null!==e&&!_s(e)&&null!==e.constructor&&!_s(e.constructor)&&Ts(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||Ts(e.append)&&("formdata"===(t=ms(e))||"object"===t&&Ts(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Cs(e.buffer),t},isString:Ss,isNumber:Ns,isBoolean:e=>!0===e||!1===e,isObject:Ps,isPlainObject:Ds,isReadableStream:ws,isRequest:Ms,isResponse:Ls,isHeaders:Us,isUndefined:_s,isDate:Rs,isFile:bs,isBlob:Os,isRegExp:Hs,isFunction:Ts,isStream:e=>Ps(e)&&Ts(e.pipe),isURLSearchParams:xs,isTypedArray:$s,isFileList:vs,forEach:Fs,merge:function e(){const{caseless:t}=ks(this)&&this||{},n={},r=(r,s)=>{const a=t&&js(n,s)||s;Ds(n[a])&&Ds(r)?n[a]=e(n[a],r):Ds(r)?n[a]=e({},r):As(r)?n[a]=r.slice():n[a]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&Fs(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(Fs(t,((t,r)=>{n&&Ts(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:ms,kindOfTest:Is,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(As(e))return e;let t=e.length;if(!Ns(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).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:Gs,hasOwnProperty:Ws,hasOwnProp:Ws,reduceDescriptors:qs,freezeMethods:e=>{qs(e,((t,n)=>{if(Ts(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];Ts(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 As(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:js,global:Vs,isContextDefined:ks,ALPHABET:Ks,generateString:(e=16,t=Ks.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&Ts(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(Ps(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const s=As(e)?[]:{};return Fs(e,((e,t)=>{const a=n(e,r+1);!_s(a)&&(s[t]=a)})),t[r]=void 0,s}}return e};return n(e,0)},isAsyncFn:Xs,isThenable:e=>e&&(Ps(e)||Ts(e))&&Ts(e.then)&&Ts(e.catch),setImmediate:Js,asap:na};function sa(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)}ra.inherits(sa,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:ra.toJSONObject(this.config),code:this.code,status:this.status}}});const aa=sa.prototype,oa={};["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=>{oa[e]={value:e}})),Object.defineProperties(sa,oa),Object.defineProperty(aa,"isAxiosError",{value:!0}),sa.from=(e,t,n,r,s,a)=>{const o=Object.create(aa);return ra.toFlatObject(e,o,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),sa.call(o,e.message,t,n,r,s),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};const ia=sa;function ca(e){return ra.isPlainObject(e)||ra.isArray(e)}function la(e){return ra.endsWith(e,"[]")?e.slice(0,-2):e}function ua(e,t,n){return e?e.concat(t).map((function(e,t){return e=la(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const da=ra.toFlatObject(ra,{},null,(function(e){return/^is[A-Z]/.test(e)}));const pa=function(e,t,n){if(!ra.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=ra.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!ra.isUndefined(t[e])}))).metaTokens,s=n.visitor||l,a=n.dots,o=n.indexes,i=(n.Blob||"undefined"!=typeof Blob&&Blob)&&ra.isSpecCompliantForm(t);if(!ra.isFunction(s))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(ra.isDate(e))return e.toISOString();if(!i&&ra.isBlob(e))throw new ia("Blob is not supported. Use a Buffer instead.");return ra.isArrayBuffer(e)||ra.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(ra.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(ra.isArray(e)&&function(e){return ra.isArray(e)&&!e.some(ca)}(e)||(ra.isFileList(e)||ra.endsWith(n,"[]"))&&(i=ra.toArray(e)))return n=la(n),i.forEach((function(e,r){!ra.isUndefined(e)&&null!==e&&t.append(!0===o?ua([n],r,a):null===o?n:n+"[]",c(e))})),!1;return!!ca(e)||(t.append(ua(s,n,a),c(e)),!1)}const u=[],d=Object.assign(da,{defaultVisitor:l,convertValue:c,isVisitable:ca});if(!ra.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!ra.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),ra.forEach(n,(function(n,a){!0===(!(ra.isUndefined(n)||null===n)&&s.call(t,n,ra.isString(a)?a.trim():a,r,d))&&e(n,r?r.concat(a):[a])})),u.pop()}}(e),t};function ha(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function ga(e,t){this._pairs=[],e&&pa(e,this,t)}const fa=ga.prototype;fa.append=function(e,t){this._pairs.push([e,t])},fa.toString=function(e){const t=e?function(t){return e.call(this,t,ha)}:ha;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const ma=ga;function ya(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ia(e,t,n){if(!t)return e;const r=n&&n.encode||ya,s=n&&n.serialize;let a;if(a=s?s(t,n):ra.isURLSearchParams(t)?t.toString():new ma(t,n).toString(r),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}const Ea=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){ra.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Aa={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},_a={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ma,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Ca="undefined"!=typeof window&&"undefined"!=typeof document,Sa="object"==typeof navigator&&navigator||void 0,Ta=Ca&&(!Sa||["ReactNative","NativeScript","NS"].indexOf(Sa.product)<0),Na="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Pa=Ca&&window.location.href||"http://localhost",Da={...a,..._a};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&&ra.isArray(r)?r.length:a,i)return ra.hasOwnProp(r,a)?r[a]=[r[a],n]:r[a]=n,!o;r[a]&&ra.isObject(r[a])||(r[a]=[]);return t(e,n,r[a],s)&&ra.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(ra.isFormData(e)&&ra.isFunction(e.entries)){const n={};return ra.forEachEntry(e,((e,r)=>{t(function(e){return ra.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null};const ba={transitional:Aa,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,s=ra.isObject(e);s&&ra.isHTMLForm(e)&&(e=new FormData(e));if(ra.isFormData(e))return r?JSON.stringify(Ra(e)):e;if(ra.isArrayBuffer(e)||ra.isBuffer(e)||ra.isStream(e)||ra.isFile(e)||ra.isBlob(e)||ra.isReadableStream(e))return e;if(ra.isArrayBufferView(e))return e.buffer;if(ra.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 pa(e,new Da.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return Da.isNode&&ra.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((a=ra.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return pa(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return s||r?(t.setContentType("application/json",!1),function(e,t,n){if(ra.isString(e))try{return(t||JSON.parse)(e),ra.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||ba.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(ra.isResponse(e)||ra.isReadableStream(e))return e;if(e&&ra.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 ia.from(e,ia.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:Da.classes.FormData,Blob:Da.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ra.forEach(["delete","get","head","post","put","patch"],(e=>{ba.headers[e]={}}));const Oa=ba,va=ra.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"]),xa=Symbol("internals");function wa(e){return e&&String(e).trim().toLowerCase()}function Ma(e){return!1===e||null==e?e:ra.isArray(e)?e.map(Ma):String(e)}function La(e,t,n,r,s){return ra.isFunction(r)?r.call(this,t,n):(s&&(t=n),ra.isString(t)?ra.isString(r)?-1!==t.indexOf(r):ra.isRegExp(r)?r.test(t):void 0:void 0)}class Ua{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function s(e,t,n){const s=wa(t);if(!s)throw new Error("header name must be a non-empty string");const a=ra.findKey(r,s);(!a||void 0===r[a]||!0===n||void 0===n&&!1!==r[a])&&(r[a||t]=Ma(e))}const a=(e,t)=>ra.forEach(e,((e,n)=>s(e,n,t)));if(ra.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(ra.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]&&va[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(ra.isHeaders(e))for(const[t,r]of e.entries())s(r,t,n);else null!=e&&s(t,e,n);return this}get(e,t){if(e=wa(e)){const n=ra.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(ra.isFunction(t))return t.call(this,e,n);if(ra.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=wa(e)){const n=ra.findKey(this,e);return!(!n||void 0===this[n]||t&&!La(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function s(e){if(e=wa(e)){const s=ra.findKey(n,e);!s||t&&!La(0,n[s],s,t)||(delete n[s],r=!0)}}return ra.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&&!La(0,this[s],s,e,!0)||(delete this[s],r=!0)}return r}normalize(e){const t=this,n={};return ra.forEach(this,((r,s)=>{const a=ra.findKey(n,s);if(a)return t[a]=Ma(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]=Ma(r),n[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return ra.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&ra.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")}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[xa]=this[xa]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=wa(e);t[r]||(!function(e,t){const n=ra.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 ra.isArray(e)?e.forEach(r):r(e),this}}Ua.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),ra.reduceDescriptors(Ua.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),ra.freezeMethods(Ua);const Fa=Ua;function ja(e,t){const n=this||Oa,r=t||n,s=Fa.from(r.headers);let a=r.data;return ra.forEach(e,(function(e){a=e.call(n,a,s.normalize(),t?t.status:void 0)})),s.normalize(),a}function Va(e){return!(!e||!e.__CANCEL__)}function ka(e,t,n){ia.call(this,null==e?"canceled":e,ia.ERR_CANCELED,t,n),this.name="CanceledError"}ra.inherits(ka,ia,{__CANCEL__:!0});const $a=ka;function Ba(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new ia("Request failed with status code "+n.status,[ia.ERR_BAD_REQUEST,ia.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const Ga=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 Wa=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)]},Ha=(e,t,n=3)=>{let r=0;const s=Ga(50,250);return Wa((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)},qa=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},za=e=>(...t)=>ra.asap((()=>e(...t))),Ya=Da.hasStandardBrowserEnv?function(){const e=Da.navigator&&/(msie|trident)/i.test(Da.navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=ra.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0},Ka=Da.hasStandardBrowserEnv?{write(e,t,n,r,s,a){const o=[e+"="+encodeURIComponent(t)];ra.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),ra.isString(r)&&o.push("path="+r),ra.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 Xa(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Ja=e=>e instanceof Fa?{...e}:e;function Qa(e,t){t=t||{};const n={};function r(e,t,n){return ra.isPlainObject(e)&&ra.isPlainObject(t)?ra.merge.call({caseless:n},e,t):ra.isPlainObject(t)?ra.merge({},t):ra.isArray(t)?t.slice():t}function s(e,t,n){return ra.isUndefined(t)?ra.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function a(e,t){if(!ra.isUndefined(t))return r(void 0,t)}function o(e,t){return ra.isUndefined(t)?ra.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)=>s(Ja(e),Ja(t),!0)};return ra.forEach(Object.keys(Object.assign({},e,t)),(function(r){const a=c[r]||s,o=a(e[r],t[r],r);ra.isUndefined(o)&&a!==i||(n[r]=o)})),n}const Za=e=>{const t=Qa({},e);let n,{data:r,withXSRFToken:s,xsrfHeaderName:a,xsrfCookieName:o,headers:i,auth:c}=t;if(t.headers=i=Fa.from(i),t.url=Ia(Xa(t.baseURL,t.url),e.params,e.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),ra.isFormData(r))if(Da.hasStandardBrowserEnv||Da.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(Da.hasStandardBrowserEnv&&(s&&ra.isFunction(s)&&(s=s(t)),s||!1!==s&&Ya(t.url))){const e=a&&o&&Ka.read(o);e&&i.set(a,e)}return t},eo="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=Za(e);let s=r.data;const a=Fa.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=Fa.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders());Ba((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 ia("Request aborted",ia.ECONNABORTED,e,f)),f=null)},f.onerror=function(){n(new ia("Network Error",ia.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||Aa;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new ia(t,s.clarifyTimeoutError?ia.ETIMEDOUT:ia.ECONNABORTED,e,f)),f=null},void 0===s&&a.setContentType(null),"setRequestHeader"in f&&ra.forEach(a.toJSON(),(function(e,t){f.setRequestHeader(t,e)})),ra.isUndefined(r.withCredentials)||(f.withCredentials=!!r.withCredentials),d&&"json"!==d&&(f.responseType=r.responseType),h&&([c,u]=Ha(h,!0),f.addEventListener("progress",c)),p&&f.upload&&([i,l]=Ha(p),f.upload.addEventListener("progress",i),f.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(o=t=>{f&&(n(!t||t.type?new $a(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===Da.protocols.indexOf(y)?n(new ia("Unsupported protocol "+y+":",ia.ERR_BAD_REQUEST,e)):f.send(s||null)}))},to=(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 ia?t:new $a(t instanceof Error?t.message:t))}};let a=t&&setTimeout((()=>{a=null,s(new ia(`timeout ${t} of ms exceeded`,ia.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=()=>ra.asap(o),i}},no=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},ro=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()}},so=(e,t,n,r)=>{const s=async function*(e,t){for await(const n of ro(e))yield*no(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})},ao="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,oo=ao&&"function"==typeof ReadableStream,io=ao&&("function"==typeof TextEncoder?(co=new TextEncoder,e=>co.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var co;const lo=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},uo=oo&&lo((()=>{let e=!1;const t=new Request(Da.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),po=oo&&lo((()=>ra.isReadableStream(new Response("").body))),ho={stream:po&&(e=>e.body)};var go;ao&&(go=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!ho[e]&&(ho[e]=ra.isFunction(go[e])?t=>t[e]():(t,n)=>{throw new ia(`Response type '${e}' is not supported`,ia.ERR_NOT_SUPPORT,n)})})));const fo=async(e,t)=>{const n=ra.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(ra.isBlob(e))return e.size;if(ra.isSpecCompliantForm(e)){const t=new Request(Da.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return ra.isArrayBufferView(e)||ra.isArrayBuffer(e)?e.byteLength:(ra.isURLSearchParams(e)&&(e+=""),ra.isString(e)?(await io(e)).byteLength:void 0)})(t):n},mo=ao&&(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}=Za(e);l=l?(l+"").toLowerCase():"text";let h,g=to([s,a&&a.toAbortSignal()],o);const f=g&&g.unsubscribe&&(()=>{g.unsubscribe()});let m;try{if(c&&uo&&"get"!==n&&"head"!==n&&0!==(m=await fo(u,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(ra.isFormData(r)&&(e=n.headers.get("content-type"))&&u.setContentType(e),n.body){const[e,t]=qa(m,Ha(za(c)));r=so(n.body,65536,e,t)}}ra.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);const o=po&&("stream"===l||"response"===l);if(po&&(i||o&&f)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=a[t]}));const t=ra.toFiniteNumber(a.headers.get("content-length")),[n,r]=i&&qa(t,Ha(za(i),!0))||[];a=new Response(so(a.body,65536,n,(()=>{r&&r(),f&&f()})),e)}l=l||"text";let y=await ho[ra.findKey(ho,l)||"text"](a,e);return!o&&f&&f(),await new Promise(((t,n)=>{Ba(t,n,{data:y,headers:Fa.from(a.headers),status:a.status,statusText:a.statusText,config:e,request:h})}))}catch(t){if(f&&f(),t&&"TypeError"===t.name&&/fetch/i.test(t.message))throw Object.assign(new ia("Network Error",ia.ERR_NETWORK,e,h),{cause:t.cause||t});throw ia.from(t,t&&t.code,e,h)}}),yo={http:null,xhr:eo,fetch:mo};ra.forEach(yo,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Io=e=>`- ${e}`,Eo=e=>ra.isFunction(e)||null===e||!1===e,Ao=e=>{e=ra.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,!Eo(n)&&(r=yo[(t=String(n)).toLowerCase()],void 0===r))throw new ia(`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(Io).join("\n"):" "+Io(e[0]):"as no adapter specified";throw new ia("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return r};function _o(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new $a(null,e)}function Co(e){_o(e),e.headers=Fa.from(e.headers),e.data=ja.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Ao(e.adapter||Oa.adapter)(e).then((function(t){return _o(e),t.data=ja.call(e,e.transformResponse,t),t.headers=Fa.from(t.headers),t}),(function(t){return Va(t)||(_o(e),t&&t.response&&(t.response.data=ja.call(e,e.transformResponse,t.response),t.response.headers=Fa.from(t.response.headers))),Promise.reject(t)}))}const So="1.7.7",To={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{To[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const No={};To.transitional=function(e,t,n){function r(e,t){return"[Axios v1.7.7] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,s,a)=>{if(!1===e)throw new ia(r(s," has been removed"+(t?" in "+t:"")),ia.ERR_DEPRECATED);return t&&!No[s]&&(No[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)}};const Po={assertOptions:function(e,t,n){if("object"!=typeof e)throw new ia("options must be an object",ia.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 ia("option "+a+" must be "+n,ia.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new ia("Unknown option "+a,ia.ERR_BAD_OPTION)}},validators:To},Do=Po.validators;class Ro{constructor(e){this.defaults=e,this.interceptors={request:new Ea,response:new Ea}}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=Qa(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:s}=t;void 0!==n&&Po.assertOptions(n,{silentJSONParsing:Do.transitional(Do.boolean),forcedJSONParsing:Do.transitional(Do.boolean),clarifyTimeoutError:Do.transitional(Do.boolean)},!1),null!=r&&(ra.isFunction(r)?t.paramsSerializer={serialize:r}:Po.assertOptions(r,{encode:Do.function,serialize:Do.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=s&&ra.merge(s.common,s[t.method]);s&&ra.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete s[e]})),t.headers=Fa.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=[Co.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=Co.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 Ia(Xa((e=Qa(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}ra.forEach(["delete","get","head","options"],(function(e){Ro.prototype[e]=function(t,n){return this.request(Qa(n||{},{method:e,url:t,data:(n||{}).data}))}})),ra.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,s){return this.request(Qa(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 bo=Ro;class Oo{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 $a(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 Oo((function(t){e=t})),cancel:e}}}const vo=Oo;const xo={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(xo).forEach((([e,t])=>{xo[t]=e}));const wo=xo;const Mo=function e(t){const n=new bo(t),r=hs(bo.prototype.request,n);return ra.extend(r,bo.prototype,n,{allOwnKeys:!0}),ra.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Qa(t,n))},r}(Oa);Mo.Axios=bo,Mo.CanceledError=$a,Mo.CancelToken=vo,Mo.isCancel=Va,Mo.VERSION=So,Mo.toFormData=pa,Mo.AxiosError=ia,Mo.Cancel=Mo.CanceledError,Mo.all=function(e){return Promise.all(e)},Mo.spread=function(e){return function(t){return e.apply(null,t)}},Mo.isAxiosError=function(e){return ra.isObject(e)&&!0===e.isAxiosError},Mo.mergeConfig=Qa,Mo.AxiosHeaders=Fa,Mo.formToJSON=e=>Ra(ra.isHTMLForm(e)?new FormData(e):e),Mo.getAdapter=Ao,Mo.HttpStatusCode=wo,Mo.default=Mo;const Lo=Mo;function Uo(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 Fo=Uo((function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}}));var jo=function(e,t){return jo=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])},jo(e,t)};function Vo(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}jo(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function ko(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 $o(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 Bo(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 Go(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 Wo(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 Ho(e){return this instanceof Ho?(this.v=e,this):new Ho(e)}function qo(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 Ho?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 zo(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=Bo(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 Yo=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function Ko(e){return"function"==typeof e}function Xo(e){return Ko(null==e?void 0:e.then)}var Jo=Uo((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 Qo(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var Zo=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=Bo(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(Ko(c))try{c()}catch(e){s=e instanceof Jo?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var u=Bo(l),d=u.next();!d.done;d=u.next()){var p=d.value;try{ni(p)}catch(e){s=null!=s?s:[],e instanceof Jo?s=Wo(Wo([],Go(s)),Go(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 Jo(s)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)ni(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)&&Qo(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&Qo(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}(),ei=Zo.EMPTY;function ti(e){return e instanceof Zo||e&&"closed"in e&&Ko(e.remove)&&Ko(e.add)&&Ko(e.unsubscribe)}function ni(e){Ko(e)?e():e.unsubscribe()}var ri={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},si={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var s=si.delegate;return(null==s?void 0:s.setTimeout)?s.setTimeout.apply(s,Wo([e,t],Go(n))):setTimeout.apply(void 0,Wo([e,t],Go(n)))},clearTimeout:function(e){var t=si.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function ai(e){si.setTimeout((function(){var t=ri.onUnhandledError;if(!t)throw e;t(e)}))}function oi(){}var ii=ci("C",void 0,void 0);function ci(e,t,n){return{kind:e,value:t,error:n}}var li=null;function ui(e){if(ri.useDeprecatedSynchronousErrorHandling){var t=!li;if(t&&(li={errorThrown:!1,error:null}),e(),t){var n=li,r=n.errorThrown,s=n.error;if(li=null,r)throw s}}else e()}var di=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,ti(t)&&t.add(n)):n.destination=Ii,n}return Vo(t,e),t.create=function(e,t,n){return new fi(e,t,n)},t.prototype.next=function(e){this.isStopped?yi(function(e){return ci("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?yi(ci("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?yi(ii,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}(Zo),pi=Function.prototype.bind;function hi(e,t){return pi.call(e,t)}var gi=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){mi(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){mi(e)}else mi(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){mi(e)}},e}(),fi=function(e){function t(t,n,r){var s,a,o=e.call(this)||this;Ko(t)||!t?s={next:null!=t?t:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:o&&ri.useDeprecatedNextContext?((a=Object.create(t)).unsubscribe=function(){return o.unsubscribe()},s={next:t.next&&hi(t.next,a),error:t.error&&hi(t.error,a),complete:t.complete&&hi(t.complete,a)}):s=t;return o.destination=new gi(s),o}return Vo(t,e),t}(di);function mi(e){var t;ri.useDeprecatedSynchronousErrorHandling?(t=e,ri.useDeprecatedSynchronousErrorHandling&&li&&(li.errorThrown=!0,li.error=t)):ai(e)}function yi(e,t){var n=ri.onStoppedNotification;n&&si.setTimeout((function(){return n(e,t)}))}var Ii={closed:!0,next:oi,error:function(e){throw e},complete:oi},Ei="function"==typeof Symbol&&Symbol.observable||"@@observable";function Ai(e){return e}function _i(e){return 0===e.length?Ai:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var Ci=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 di||function(e){return e&&Ko(e.next)&&Ko(e.error)&&Ko(e.complete)}(r)&&ti(r)?e:new fi(e,t,n);return ui((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=Si(t))((function(t,r){var s=new fi({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[Ei]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return _i(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=Si(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 Si(e){var t;return null!==(t=null!=e?e:ri.Promise)&&void 0!==t?t:Promise}function Ti(e){return Ko(e[Ei])}function Ni(e){return Symbol.asyncIterator&&Ko(null==e?void 0:e[Symbol.asyncIterator])}function Pi(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 Di="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function Ri(e){return Ko(null==e?void 0:e[Di])}function bi(e){return qo(this,arguments,(function(){var t,n,r;return $o(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,Ho(t.read())];case 3:return n=s.sent(),r=n.value,n.done?[4,Ho(void 0)]:[3,5];case 4:return[2,s.sent()];case 5:return[4,Ho(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 Oi(e){return Ko(null==e?void 0:e.getReader)}function vi(e){if(e instanceof Ci)return e;if(null!=e){if(Ti(e))return s=e,new Ci((function(e){var t=s[Ei]();if(Ko(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(Yo(e))return r=e,new Ci((function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()}));if(Xo(e))return n=e,new Ci((function(e){n.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,ai)}));if(Ni(e))return xi(e);if(Ri(e))return t=e,new Ci((function(e){var n,r;try{for(var s=Bo(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(Oi(e))return xi(bi(e))}var t,n,r,s;throw Pi(e)}function xi(e){return new Ci((function(t){(function(e,t){var n,r,s,a;return ko(this,void 0,void 0,(function(){var o,i;return $o(this,(function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=zo(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 wi(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 Mi(e){return function(t){if(function(e){return Ko(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 Li(e,t,n,r,s){return new Ui(e,t,n,r,s)}var Ui=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 Vo(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}(di);function Fi(e,t){return void 0===t&&(t=0),Mi((function(n,r){n.subscribe(Li(r,(function(n){return wi(r,e,(function(){return r.next(n)}),t)}),(function(){return wi(r,e,(function(){return r.complete()}),t)}),(function(n){return wi(r,e,(function(){return r.error(n)}),t)})))}))}function ji(e,t){return void 0===t&&(t=0),Mi((function(n,r){r.add(e.schedule((function(){return n.subscribe(r)}),t))}))}function Vi(e,t){if(!e)throw new Error("Iterable cannot be null");return new Ci((function(n){wi(n,t,(function(){var r=e[Symbol.asyncIterator]();wi(n,t,(function(){r.next().then((function(e){e.done?n.complete():n.next(e.value)}))}),0,!0)}))}))}function ki(e,t){if(null!=e){if(Ti(e))return function(e,t){return vi(e).pipe(ji(t),Fi(t))}(e,t);if(Yo(e))return function(e,t){return new Ci((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(Xo(e))return function(e,t){return vi(e).pipe(ji(t),Fi(t))}(e,t);if(Ni(e))return Vi(e,t);if(Ri(e))return function(e,t){return new Ci((function(n){var r;return wi(n,t,(function(){r=e[Di](),wi(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 Ko(null==r?void 0:r.return)&&r.return()}}))}(e,t);if(Oi(e))return function(e,t){return Vi(bi(e),t)}(e,t)}throw Pi(e)}function $i(e,t){return t?ki(e,t):vi(e)}function Bi(e,t,n){var r=Ko(e)||t||n?{next:e,error:t,complete:n}:e;return r?Mi((function(e,t){var n;null===(n=r.subscribe)||void 0===n||n.call(r);var s=!0;e.subscribe(Li(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)})))})):Ai}class Gi{static portalRegex=/(?<=v2\/pages\/)(.*?)(?=\?pageClass=)/;#e=0;#t=0;#n;#r=[];constructor(){this.#n=!1,Gr.subscribe(j.START_PERFORMANCE_LOG,(()=>{this.#n=!0,this.clearStorage(),this.#e=Date.now()}),j.START_PERFORMANCE_LOG),Gr.subscribe(j.STOP_PERFORMANCE_LOG,(()=>{this.#n=!1,this.#t=Date.now(),this.#s()}),j.STOP_PERFORMANCE_LOG)}static getCategory(e){return e.includes("v2/cases")||e.includes("v2/assignments")?"Case":e.includes("v2/data_views")?"DataPage":e.includes("v2/pages")?"Page":""}static getPortalLabel(e,t){const n=ph(".pyPrimaryNavPages","pyPortal",t)||[];return n.find((t=>t.pyRuleName===e))?.pyLabel??e}static extractAssignmentLabel(e,t,n){e.label===j.TOP_ACTION_LABEL.OPENASSIGNMENT&&void 0===e.assignmentLabel&&(e.assignmentLabel=n?.data?.data?.caseInfo?.assignments.find((e=>e.ID===t))?.name??"")}#a(e,t,n,r){if(e<0)return;const s=this.#r[t].serviceCalls[e],a=Date.now();s.endTime=a,s.totalTimeTaken=a-s.startTime,s.httpMethod=r.config?.method,n?s.status="CANCELLED":"headers"in r&&(s.status=r.status,s.responseBytes=r.headers["content-length"])}#o(e,t,n,r,s){let a="";if(!n){const t=e.match(Gi.portalRegex)[0];a=t?.split(" ")[0]}const o=`${t||a}${j.HASH_DELIMITER}${s.startTime}`,i=Sh.getHashedString(o);s.urlUniqueID=i;const c={label:t||`${Gi.getPortalLabel(a,r)} Portal`,actionUniqueID:i,serviceCalls:[s]};return this.#r.push(c),{actionUniqueID:i,urlUniqueID:i,topLevelAction:n}}#i(e,t,n){const r=this.#r[e];Gi.extractAssignmentLabel(r,t,n);const s=n.data?.data?.caseInfo?.content;s&&(r.caseLabel=s.pyLabel,r.caseID=s.pyID)}buildActionsList(e){const{url:t,topLevelAction:n,userAction:r,actionLabel:s,context:a}=e;let o={};if(this.#n){const e={url:t.split(E()??"")[1],startTime:Date.now(),context:a,category:Gi.getCategory(t)};if(n&&r)o=this.#o(t,s,!0,a,e);else if(Gi.portalRegex.test(t))o=this.#o(t,s,!1,a,e);else if(this.#r.length>0){const r=this.#r[this.#r.length-1].serviceCalls,s=`${t}${j.HASH_DELIMITER}${e.startTime}${j.HASH_DELIMITER}${r.length}`,a=Sh.getHashedString(s);e.urlUniqueID=a,r.push(e),o.actionUniqueID=this.#r[this.#r.length-1].actionUniqueID,o.urlUniqueID=a,o.topLevelAction=n}}return o}reformActionList(e,t,n,r){const s=t.config,{actionUniqueID:a,urlUniqueID:o,topLevelAction:i,assignmentID:c}=s;if(this.#n){const s=this.#r.findIndex((e=>e.actionUniqueID===a));if(s>=0){i&&n&&"data"in t&&this.#i(s,c,t),e=e.split(E()??"")[1];const a=this.#r[s].serviceCalls.findIndex((t=>t.url===e&&t.urlUniqueID===o));this.#a(a,s,r,t)}}}#s(){if(0===this.#r.length)return;const e={version:"1.0.0",recordedTime:this.#t-this.#e,totalActions:this.#r.length,startTime:this.#e,userActions:this.#r};localStorage.setItem("performanceData",JSON.stringify(e))}clearStorage(){localStorage.removeItem("performanceData"),this.#r=[]}}const Wi=new Gi;class Hi{constructor(e,t=!0){this.config=e,t?(this.ssKeyConfig=e,this.reloadConfig()):this.updateConfig(e,!1)}static init(e,t=!0){return new Hi(e,t)}updateConfig(e,t=!0){t?window.sessionStorage.setItem(this.ssKeyConfig,JSON.stringify(this.config)):Cc(e)}reloadConfig(e=!0){if(e){const e=window.sessionStorage.getItem(this.ssKeyConfig);this.config=e?JSON.parse(e):null}else this.config=Sc()}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:up.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"),fc(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?Ac({pzCTkn:e?.csrf}):(_c({tokenInfo:e}),Ac({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 qi=Hi,zi=async()=>new Promise((async(e,t)=>{const n=Tc();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 fc(a,{method:"POST",headers:new Headers(l),credentials:c?"include":"omit",body:u.toString(),withoutDefaultHeaders:!0}),Ac({Authorization:null}),_c({tokenInfo:null}),e()})),Yi=async e=>{const t={};if("OAuth2.0"===e?.authType){const n=new qi(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},Ki=(e,t)=>{Yi(t).then((t=>{const n={openReauthMessageModal:!0,reAuthenticationURL:t.reauthUrl,url:e,redirectOrigin:t.redirectOrigin};Gr.publish(F.PUB_SUB_EVENTS.EVENT_REAUTH,n)}))},Xi=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};_c({tokenInfo:{...e.tokenInfo,...r}}),e.secureCookie?Ac({pzCTkn:n?.csrf}):Ac({Authorization:`${n?.token_type} ${n?.access_token}`});const{onTokenRetrieval:s}=e;s&&"function"==typeof s&&s(n)},failure:t=>{if(e.popupReauth)return Ki(t,e);Gr.publish(F.PUB_SUB_EVENTS.EVENT_FULL_REAUTH,e)}}}else t=`${E()}/updateSession`,n={method:"GET",headers:{}},r={failure:Ki};return{url:t,config:n,callback:r,isRefreshTokenPresent:s}},Ji=(e,t)=>"OAuth2.0"===t?.authType?e?.includes(t.endPoints.token):e?.includes("updateSession"),Qi=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}},Zi=(e,t,n)=>{const{config:r}=e,{url:s,config:a,callback:o,isRefreshTokenPresent:i}=Xi(n),c=r.headers&&r.headers.context;r.data&&(r.body=r.data);const l=mc(r.url,r,c,t);return i?fc(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&&Ji(e.config.url,n)?(o?.failure?.(r.url,n),l):Promise.reject(e))):(o?.failure?.(r.url,n),l)},ec=(e,t,n,r)=>{if(e.config&&Ji(e.config.url,n))return Promise.reject(e);if(e.response&&e.response.status&&401===e.response.status&&!t.getUpdateSessionStatus()){if(Gr.unsubscribeAllWithEventType(oc),t.setUpdateSessionStatus(!0),"custom"===n?.authType){Gr.publish(F.PUB_SUB_EVENTS.EVENT_CUSTOM_REAUTH);const{url:n,config:r,context:s}=Qi(e);return mc(n,r,s,t)}return Zi(e,t,n)}if(e.response&&e.response.status&&401===e.response.status&&t.getUpdateSessionStatus()){const{url:t,config:n,context:r}=Qi(e);return fc(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 tc=class{constructor(){this.updateSessionInProgress=!1}getUpdateSessionStatus=()=>this.updateSessionInProgress;setUpdateSessionStatus=e=>{this.updateSessionInProgress=e}};const nc=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 rc=new class{constructor(){this.xray=!1,this.onXRayCallback=null,this.xrayRuntime=new nc(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 sc=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]:rc.getDebugLevels()}}getCoreHeadersFromContext(e){if(["root","app"].includes(e)||!e)return;const t=Dh.getProperty(j.COREHEADERS,"",e);return t?{...t,debugInfo:rc.getPreviewMode()&&{...t.debugInfo,[j.COREHEADER_APP_DEBUG_LEVELS]:rc.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)}},ac=sc;const oc="updateSession",ic={},cc=new tc,lc=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 uc={},dc={},pc={},hc="";const gc=e=>{uc=e},fc=(e,t,n="root",r={})=>{const{doNotMergeHttpMessagesForStatusCode:s=null,cancelContext:a=n,includeRemoteSystemIdIfPresent:o=!0,actionLabel:i="",assignmentID:c=""}=r;let{topLevelAction:l=!1}=r;const u=l;l||(l=t.topLevelAction||!1),hc=s,null===e&&window.console.error("Error: url passed to Service Broker fetch is null (or) undefined");const{body:d,signal:p,withoutDefaultHeaders:h=!1,...g}=t;let f={};dp.getPerformanceDashboardVisibility()&&(f={assignmentID:c,...Wi.buildActionsList({url:e,topLevelAction:l,userAction:u,actionLabel:i,context:n})});const{Authorization:m,pzCTkn:y,...I}=t.headers||{};h||ac.injectCoreAdditionalHeaders(I,t.body,n,{includeRemoteSystemIdIfPresent:o}),a&&ic[a]>=0?ic[a]+=1:a&&void 0===ic[a]&&(ic[a]=1);let E=h?{...I}:{...ac.getDefaultHeaders(),...ac.getRegisteredHeaders(),...I,context:n};if(e&&Ji(e,dc)&&cc.getUpdateSessionStatus()||!cc.getUpdateSessionStatus()){Ji(e,dc)&&"OAuth2.0"===dc?.authType&&(E={...I});const{restApi:t}=up.doesRestApiExist("Logout")&&up.getRestEndPoint("Logout")||{restApi:null};return(!t||e&&!e.endsWith(t))&&lc.setTimerID(lc.resetInactiveTimeout(lc.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 Fo)}})}))}($i(Lo({context:n,...g,url:e,data:d,...p&&void 0===p.aborted&&{cancelToken:p},...p&&void 0!==p.aborted&&{signal:p},headers:E,withCredentials:(A=dc,!("OAuth2.0"!==A?.authType||!A.secureCookie)||!("custom"!==A?.authType||!A.customCookies)||void 0),...f})).pipe(Bi((()=>{const e=ac.getCoreHeadersFromContext(E.context);e&&(e=>{Gr.publish(j.PUB_SUB_EVENTS.FETCH_SUCCESS,e)})({...e})}))))}var A;return mc(e,t,n,cc)},mc=(e,t,n,r)=>new Promise(((s,a)=>{Gr.subscribe(oc,(o=>{r.setUpdateSessionStatus(!o.updateStatus),"success"===o.updateStatus?fc(e,t,n).then((e=>s(e))).catch((e=>a(e))):a(o.updateStatus.error)}),oc)})),yc=e=>{ic[e]>0&&(ic[e]-=1,0===ic[e]&&delete ic[e])};Lo.interceptors.request.use((e=>(uc.request&&(e=uc.request(e)),e)),(e=>Promise.reject(e))),Lo.interceptors.response.use((e=>{const t=e.config.url;if(dp.getPerformanceDashboardVisibility()&&Wi.reformActionList(t,e,!0,!1),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})),yc(e.config.headers.context)),uc.response&&(e=uc.response(e)),e}),(e=>{if(e.config&&e.config.headers&&e.config.headers.context&&yc(e.config.headers.context),dp.getPerformanceDashboardVisibility()){const t=e.config.url,n=Lo.isCancel(e);Wi.reformActionList(t,n?e:e.response,!1,n)}return!e.response||!e.response.status||401!==e.response.status||e.config&&Ji(e.config.url,dc)||Gr.subscribe(oc,(e=>{cc.setUpdateSessionStatus(!e.updateStatus)}),oc),ec(e,cc,dc,e.response&&e.response.status&&e.response.status===Number(hc)?hc:null)}));const Ic=()=>Lo.CancelToken.source(),Ec=e=>Lo.isCancel(e),Ac=e=>{ac.setDefaultHeaders(e)},_c=e=>{dc={...dc,...e}},Cc=e=>{pc={...pc,...e}},Sc=()=>({...pc}),Tc=()=>({...dc});const Nc=class{static isCaseActive(e,t){if(!e||!t)return!1;const n=od(t);if(n){const r=fd(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 fc(r,{method:s},t)};static getCaseEditLock=(e,t)=>{const n={caseID:e,actionID:"pyUpdateCaseDetails"},{restApi:r,reqType:s}=Ng(Ye,n);return fc(`${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 fc(`${a}?viewType=form`,{method:"PATCH",body:{content:{...o}},headers:{"if-match":n}},r)};static getCaseMessages=e=>lh(e)?.caseMessages;static getPropertiesToReplace=e=>(cl(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:Pc}=F,Dc={PAGE:"page",FORM:"form"},Rc={[Pc.CASE]:[We,Be,Ge],[Pc.PAGE]:[je,ke],[Pc.DATA]:[Ve]},bc=(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},Oc=(e,t={})=>{const{onlyChangedData:n=!1,nonEmptyAndChangedData:r=!1,skipUUID:s=!0,isTransientContext:a=!1,includeDisabledFields:o=!1}=t;let i={};i=ll(e,{isTransientContext:a,includeDisabledFields:o}),n&&(delete i?.caseInfo?.content,a&&(i={}));const c=Sl(e,!1);!a&&r&&((e,t)=>{Object.entries(e?.caseInfo?.content).forEach((([n,r])=>{const s=lh(t),a=b()(s,F.CASE_INFO.CASE_INFO_CLASSID),o=Lp(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}},vc=(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}},xc=async(e,t,n,r=!1,s=!1)=>{const a=Sh.getIn(e,j.LOCALE_REFERENCES);await gp.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)},wc=(e="")=>{const t=e.indexOf(" "),n=e.indexOf("!");return e.substring(t+1,n)},Mc=e=>{if(e){const[,t]=e.split("!");return{key:wc(e),flowName:t}}return{}},Lc=(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}},Uc=e=>{const{payload:t}=e,{err:n,context:r,actionMgrID:s}=t,a=n&&n.response?n.response.data:"",o=dl(r);return s&&ln.rejectActionByID(s,!0,n),og(ig,"Error action triggered",a,r,o)},Fc=(e,t)=>Td(e)&&Pd(e)?og(ng,t):og($h,t),jc=(e,t,n=j.APP.APP,r={})=>{let s=null;const{buildNew:a=!0}=r;return Td(e)?s=Pd(e)?fd(e):H(t,n):Nd(e)&&(Pd(e)&&!a?s=Ed(e):Pd(e)&&!a||(s=H(t,n))),s},Vc=e=>e&&e.type===Ce,kc=e=>{let t=!1;const n=Cd(e);for(let e=0;e<n.length;e+=1){const r=n[e];if(r&&Rl(r)){t=!0;break}}return t},$c=(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(Td(e)){const t=fd(e);if(!t)return{continueExecution:a,removeActionPayload:s};const r=Id(t);Rl(r)&&(n=!0),u||n||(n=kc(t))}else if(Nd(e)&&bd(e)){let t=xd(e);t||(t=fd(e),r=!0),s.containerItemID=t,s.context=Id(t)}if(n){const e=l||_l;o=window.confirm(gp.getLocaleValue(e,"Messages"))}if(!o&&n&&(s={},a=!1),r){const e=gp.getLocaleValue(Cl,"Messages");c?i=window.confirm(e):(window.alert(e),a=!1)}return!i&&r&&(s={},a=!1),{continueExecution:a,removeActionPayload:s}},Bc=(e,t)=>{let n=!1;const r=dp.isCoexistenceAppOfType(j.APP_TYPE.UIKIT),{insKey:s,isParallelCall:a,skipFlowNameCheck:o}=t;if(!s)return{};const[,i]=s.split("!")||"",c=o?s:wc(s),l=pd(e,c);let u={},d=!1;if(l&&!r&&(n=!0,u=id(e,l),!o)){let e=u?.flowName;const t=zr(l),r=Ad(l);if(r.length){const n=mt(t,r[0]);e=id(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}}},Gc=(e,t,n)=>e===Pc.PAGE?((e,t={})=>{let n=!1;const{semanticURL:r}=t,s=pd(e,r);return s&&(n=!0),{activate:n,activateContainerActionPayload:{target:e,containerItemID:s,semanticURL:r}}})(t,n):e===Pc.ASSIGNMENT?Bc(t,n):e===Pc.CASE?Bc(t,{...n,skipFlowNameCheck:!0}):{},Wc=(e=[])=>{Pd(`${j.APP.APP}/${j.PREVIEW}`)&&e.push(og(kh,Od({context:F.APP.APP,name:j.PREVIEW})))},Hc=e=>{let t;for(const n of Object.keys(Rc))if(Rc[n].includes(e)){t=n;break}return t},qc=(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))},zc=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)),ch(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);Td(s.targetContainerName)||t?.payload?.containerName!==j.WORKAREA||(s.isMultiDoc=!0,e=[]);const a={type:ge,payload:{...s}};e.push(a),ch(e)}else ch(e)}},Yc=(e,t)=>w()(e,t,(function(e,t){if(Array.isArray(e))return e.concat(t)})),Kc=e=>{let t={},n=Qd(e);for(;n;){const e=Oc(n);t=Yc(e.content,t),n=Qd(n)}return t};class Xc{static getChanges(e){return{...Sl(e)}}static getSubmitData(e,t){const{isTransientContext:n=!1,includeDisabledFields:r=!1}=t||{},{content:s}=Oc(e,{isTransientContext:n,includeDisabledFields:r});return s}static isStateModified(e){return Rl(e)||Pr(e)||!(!e||!Nl(e))}static isFormValid(e,t){return ul(e,t)}static clearChangedProperties(e){return Ir(e),fr(e),Ol(e)}static getEditableFields(e){return pl(e)}static setCustomValidator(e,t){vr.register(e,t)}static isPropertyEditable(e,t){return Xc.getEditableFields(e).some((e=>e.name===t))}}const Jc=Xc;const Qc=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={[el(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(){rh.registerForListChanges(((e,t,n)=>{setTimeout((()=>{!t.includes(".classID")&&Jc.isPropertyEditable(e,t)&&this.executeStateMachine(e,t,n)}),0)}))}unRegisterForServerChanges(){rh.unRegisterForListChanges()}},Zc={},el=e=>e.startsWith(".")?e.substring(1):e,tl=e=>{delete Zc[e]},nl=(e,t={})=>{const{includeDisabledFields:n=!1}=t,r=Dh.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},rl=(e,t,n,r,s)=>{let a=(ph(`.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},sl=(e,t,n,r,s)=>(Qc.executeStateMachine(e,r,Dh.getLitePropertyValue(n,t))||s.push(r),s),al=e=>{const t=e.pageReference?.replace(F.CASE_INFO.CASE_INFO_CONTENT,"")?.replace(F.DATA_INFO.DATA_INFO_CONTENT,"");return"Attachment"===e.componentName&&""!==t},ol=(e,t,n)=>{const r=t.isInsideList,{ignoreFieldsInsideList:s=!0}=n;return(!r||r&&!s)&&!Array.isArray(Dh.getLitePropertyValue(t,e))&&"Address"!==t.componentName},il=(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=Dh.resolveContextTreeNodeProps(i.props),c=e.propertyName;if(nl(i.props,{includeDisabledFields:r})){const r=al(e);"Attachment"!==e.componentName||r?!r&&ol(o,e,n)&&(s=sl(t,c,e,o,s)):a=rl(a,c,t,e,o)}}return{attachmentList:a,editableFormFieldsReferenceList:s}})(a,e,t)),Zc[e])for(const t in Zc[e].fieldOrder)Object.hasOwn(Zc[e].fieldOrder,t)&&s.push(t);return{formInputs:n,attachments:r,formPageFields:s}},cl=e=>{let t=[];const n=Pn.getContextReferences(e);if(n)for(const[e,r]of n){const n=r?.props;if(nl(n)&&"Attachment"===n?.componentName){const r="true"===n?.allowMultiple;t=[...t,{type:"File",allowMultiple:r,fullPath:e}]}}return t},ll=(e,t={})=>{const n={},r=lh(e),{ignoreFieldsInsideList:s=!0,isTransientContext:a=!1,includeDisabledFields:o=!1}=t;if(a||r?.caseInfo?.content){const{formInputs:t,attachments:i,formPageFields:c}=il(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}=il(e,{ignoreFieldsInsideList:s});t.forEach((e=>{Sh.buildObject(e,n,Sh.getIn(r,e))}))}return n},ul=(e,t)=>{const n=Pn.getContextReferences(e);let r=!0;if(!n)return r;for(const[e,s]of n){const n=Dh.resolveContextTreeNodeProps(s.props);if(nl(s.props)&&(!t||e.includes(t))){const e=vr.validate(n.componentName?.toLowerCase(),n.propertyName,Dh.getLitePropertyValue(n,n.propertyName),n);r&&(r=!e.message)}}return r},dl=(e,t=!1)=>{const n=Pn.getContextReferences(e),r=[];if(n)for(const[e,s]of n){if(!1!==Dh.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=Pn.getContextReferences(e);if(n)for(const[e,r]of n){const n=Dh.resolveContextTreeNodeProps(r.props);nl(r.props)&&"Attachment"!==n.componentName&&"multirecordlist"!==n.type&&t.push({name:e,label:n.label,type:n.componentName?.toLowerCase()})}return t};const hl=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 gl=class{static isPageInstruction(e){return e&&e.includes("[")&&e.includes("]")}};class fl{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 fl.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 fl.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 ml=new fl,{APP:yl}=j;let Il={},El={},Al={};const _l="You will lose unsaved changes. Do you want to continue?",Cl="You have reached maximum limit of pending changes. Please commit/cancel one or more changes to continue.",Sl=(e=yl.APP,t,n)=>{let r=[],s=[];t||(r=dl(e,!0)),n||(s=(e=>{const t=Pn.getContextReferences(e),n=[];if(t)for(const[e,r]of t)!0===Dh.resolveContextTreeNodeProps(r.props).readOnly&&n.push(e);return n})(e));const a={};((e,t)=>{const n=El[t]||{};Object.keys(n).forEach((t=>{Object.hasOwn(n,t)&&Sh.buildObject(t,e,n[t].value)}))})(a,e);const o=Il[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},Tl=e=>{const{context:t}=e,n=e.reference.startsWith(".")?e.reference.substr(1):e.reference;delete Il[t]?.[n],delete El[t]?.[n]},Nl=e=>Al[e],Pl=(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=ph(t.reference,null,n):(e[a]={initialValue:r||ph(t.reference,null,n)},e[a].previousValue=e[a].initialValue),e[a].value=t.value,s&&e[a].value===e[a].initialValue&&Tl(t)},Dl=e=>{const{payload:t}=e,{context:n}=t,r=t.reference.startsWith(".")?t.reference.substr(1):t.reference;Pn.isFieldExists(n,r)||(El[n]=El[n]||{},Pl(El[n],t)),Il[n]=Il[n]||{},Pl(Il[n],t)},Rl=e=>{const t=yr(e)||{};return e&&Il[e]&&Object.keys(Il[e]).some((t=>Il[e][t].initialValue!==Il[e][t].value))||Object.keys(t).length>0},bl=(e,t)=>{if(!e||!t)return!1;const n=Il[e]&&Il[e][t];return!!n&&n.previousValue!==n.value},Ol=e=>{e&&Il[e]?(Il[e]={},El[e]={}):"all"===e&&(Il={},El={},Al={}),Al[e]&&(Al[e]=!1)},vl=()=>e=>t=>{const{type:n,payload:r={}}=t||{};if(n===ee&&(qt(r),(e=>{const{context:t,pageReference:n,value:r,reference:s}=e;rh.triggerCascade(t,s,r);const a=Kt.getDependencies(t,s),o=rh.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(".");Qc.getStateMachine(t,s,r).deleteAll()}else gl.isPageInstruction(n)&&Qc.executeStateMachine(t,n,""),ch({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=ph(`.${o}`,s,t)?.classID||e.classID,l=Lp(r.split(".").pop(),c),{datasource:u}=l,d={};let p=[];u.parameters.forEach((e=>{e?.value?(d[e.name]=hl.isProperty(e.value)?ph(`.${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=Gp(h);i.datapages[p]={mode:u.mode,propertyName:r,name:u.name,dataViewParameters:d,refreshStrategy:g?.refreshStrategy}})),a.length&&ch({type:et,payload:i})})(r),(bl(r.context,r.reference)||Pr(r.context))&&Un(r),ml.triggerRefreshForType("PROP_CHANGE",r.reference,r.context)),n===rt){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),gl.isPageInstruction(e)||a?a||(Al[`${s}`]=!0):Dl(t),(r.removePropertyFromChangedList||n)&&Tl(r)}if(n===Re||n===be){const{transientItemID:e,data:t}=r;Sh.iterateLeafNodes(t,(t=>{Tl({context:e,value:"",reference:t.join(".")})}))}if(n&&[xe,Se,Me,De].includes(n)){Ol(r.context),rh.purgeResetDependencies(r.context),(e=>{e&&bn[e]&&delete bn[e]})(r.context);(r.childContainersContexts||[]).forEach((e=>{Ol(e)}));(r.transientItems||[]).forEach((e=>{Ol(e)}))}e(t)};const xl=new class{getCoreheaders(e){const t=`${F.APP.APP}${j.FORWARD_SLASH_STRING}${j.PRIMARY}`,n=fd(t),r=Id(n),s=Dh.getProperty(j.COREHEADERS,"",r);if(s&&e in s)return s[e]}};const wl=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?Dh.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}}},Ml="OPEN_PROCESS_ACTION",Ll="OPEN_ASSIGNMENT",Ul="DELETE_CASE_IN_CREATE_STAGE",Fl="SAVE_AND_CLOSE",jl=e=>({type:Fl,payload:e});const Vl=class{static getSavableDataPage(e){return Xp(e)}static getLookUpDataPage(e){return Qp(e)}static getLookUpDataPageInfo(e){return Zp(e)}static getDataPageKeys(e){return Jp(e)}};const kl=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 ch(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 ch($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:Id(e.containerItemID),target:wd(e.containerItemID)},{actionMgrID:r,promise:s}=this.containerManagerPromise(t),a={...n,...e,actionMgrID:r};return ch(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:wd(e.containerItemID)},{actionMgrID:r,promise:s}=this.containerManagerPromise(t),a={...n,...e,actionMgrID:r};return ch(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:Id(e.containerItemID),target:wd(e.containerItemID)},{actionMgrID:r,promise:s}=this.containerManagerPromise(t),a={...n,...e,actionMgrID:r};return ch(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=Od(e),{actionMgrID:r,promise:s}=this.containerManagerPromise(t),a={...n,...e,actionMgrID:r};return ch(kh(a)),s}addTransientItem(e){const{id:t,data:n}=e,r=this.c11nEnv.getContextName(),s=z(t,r),a=jd(r);return s&&a.includes(s)||ch(Bh({transientItemID:s,contextName:r,target:wd(r),data:n})),s}updateTransientData(e){const{transientItemID:t,data:n}=e,r=this.c11nEnv.getContextName();if(t){if(!jd(r).includes(t))return;ch(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(!jd(t).includes(s))return;ch(tg({target:n,containerItemID:r,transientItemID:s}))}}createContainerPConnect(e,t,n,r=!1){td.createContainerPConnect(e,t,n,r)}hasContainerItems(){const e=this.c11nEnv.getContextName(),t=this.c11nEnv.getContainerName();return Pd(`${e}/${t}`)}isContainerInitialized(){const e=this.c11nEnv.getContextName(),t=this.c11nEnv.getContainerName();return hd(e,t)}};var $l=function(e,t){return e===t||"function"==typeof t&&e===t.toString()};function Bl(){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 $l(t.type,e[0])}:function(t){for(var n=0;n<s;n++)if($l(t.type,e[n]))return!0;return!1},Mi((function(e,t){var s=0;e.subscribe(Li(t,(function(e){return n.call(r,e,s++)&&t.next(e)})))}))}function Gl(e,t){return Mi((function(n,r){var s=null,a=0,o=!1,i=function(){return o&&!s&&r.complete()};n.subscribe(Li(r,(function(n){null==s||s.unsubscribe();var o=0,c=a++;vi(e(n,c)).subscribe(s=Li(r,(function(e){return r.next(t?t(n,e,c,o++):e)}),(function(){s=null,i()})))}),(function(){o=!0,i()})))}))}function Wl(e,t){return Mi((function(n,r){var s=0;n.subscribe(Li(r,(function(n){r.next(e.call(t,n,s++))})))}))}function Hl(e,t,n){return void 0===n&&(n=1/0),Ko(t)?Hl((function(n,r){return Wl((function(e,s){return t(n,e,r,s)}))(vi(e(n,r)))}),n):("number"==typeof t&&(n=t),Mi((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;vi(n(e,u++)).subscribe(Li(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?wi(t,o,(function(){return g(e)})):g(e)};c.length&&l<r;)e();p()}catch(e){t.error(e)}})))};return e.subscribe(Li(t,h,(function(){d=!0,p()}))),function(){null==i||i()}}(t,r,e,n)})))}function ql(e){return e&&Ko(e.schedule)}function zl(e){return e[e.length-1]}function Yl(e){return ql(zl(e))?e.pop():void 0}function Kl(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return $i(e,Yl(e))}function Xl(e){return Mi((function(t,n){var r,s=null,a=!1;s=t.subscribe(Li(n,void 0,void 0,(function(o){r=vi(e(o,Xl(e)(t))),s?(s.unsubscribe(),s=null,r.subscribe(n)):a=!0}))),a&&(s.unsubscribe(),s=null,r.subscribe(n))}))}var Jl=new Ci((function(e){return e.complete()}));function Ql(e){return e?function(e){return new Ci((function(t){return e.schedule((function(){return t.complete()}))}))}(e):Jl}const Zl=(e,t,n)=>Xl((r=>("ERR_CANCELED"!==r?.code&&console.error(e,r),Kl(ig(e,r,t,null,n))))),eu=(e,t)=>n=>new Ci((r=>{let s={},a=0;return n.pipe(Hl((n=>{const r=Date.now();let o;return o=t||h(),o&&o(n,s)&&r-a<e?Ql():(s=n,a=r,Kl(n))}))).subscribe(r)})),tu=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}=Oc(s);return $i(fc(o,{method:i,headers:r,body:{data:c.content}},s)).pipe(Wl((t=>({response:t.data,actionInPayload:e}))),Zl("Error occurred during ajax call at createDataObject Epic",n))},nu=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 $i(fc(i,{method:c,headers:r,body:{dataViewParameters:a}},n)).pipe(Wl((t=>({response:t.data,actionInPayload:e}))),Zl("Error occurred during ajax call at getDataObjectView Epic",n))},ru=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}=Oc(s);return $i(fc(i,{method:c,headers:r,body:{data:{...l.content,...a},pageInstructions:l.pageInstructions||[]}},s)).pipe(Wl((t=>({response:t.data,actionInPayload:e}))),Zl("Error occurred during ajax call at updateDataObject Epic",n))},su=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 $i(fc(i,{method:c,headers:r,body:{dataViewParameters:a}},n)).pipe(Wl((t=>({response:t.data,actionInPayload:e}))),Zl("Error occurred during ajax call at getDataObjectView Epic",n))},au=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}=Oc(o);return $i(fc(c,{method:l,headers:r,body:{data:{...u?.content,...a},pageInstructions:u?.pageInstructions||[]}},n)).pipe(Wl((t=>({response:t.data,actionInPayload:e}))),Zl("Error occurred during ajax call at getDataObjectView Epic",n))};const ou=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,{})}}},iu="postDataViewMetadata",cu={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 fc(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 fc(s,{method:a,body:t},n)},getDataViewMetadata:(e,t,n,r)=>{const s=!!n,a=!!r,o=up.doesRestApiExist(iu),i=(s||a)&&o?iu:"getDataViewMetadata",c={dataViewName:e},{restApi:l,reqType:u}=Ng(i,c);if(o){if(s)return fc(l,{method:u,body:{associationFilter:n}},t);if(a)return fc(l,{method:u,body:{propertyFilter:r}},t)}return fc(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 fc(u,{method:d,body:l,...o&&{signal:o},...a&&{skipClearErrorMessages:a}},r,i)},getCaseEditMetadata:(e,t)=>Nc.getCaseEditMetadata(e,t),getCaseEditLock:(e,t)=>Nc.getCaseEditLock(e,t),updateCaseEditFieldsData:(e,t,n,r)=>Nc.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 fc(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!==_d("root").find((e=>e.includes("authoring-preview")))?`${j.AUTHORING_PREVIEW_CONTAINER}-${e}`:`${Lr.getAppAlias()}-${e}`,isDistinctResultsOnly:e=>{const t=dp.getKeyMapping("pyGUID");return!e.some((e=>e.field===t))}};const lu=class{constructor(e,t,n){this.filter=e,this.messageHandler=t,this.contextName=n}};const uu=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 mu.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],mu.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 du=s(924),pu=s.n(du);const hu=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===pu()(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};mu.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 gu=new class{constructor(){this.subscriptions={}}getOrCreateSubscription(e){if(!this.subscriptions[e]){const t={caseId:e};this.subscriptions[e]=new hu("CASE",t)}return this.subscriptions[e]}};class fu{static subscribers={};static connectionsCount=0;static webSocket=null;static connectionConfig=null;static inProgressSubscriptions=[];static inProgressMessages=[];static isServiceAlive=null;static serviceAliveHandler=null;static userPresence=new uu;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 lu(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=>gu.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 mu=fu;const yu=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=Ih(this.records,e,{isArrayDeepMerge:!1})),this.setMaxRecordsCount(this.records.length)}setMaxRecordsCount(e){this.maxRecords=e}getMaxRecordsCount(){return this.maxRecords}};const Iu=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=Gp(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 fc(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 yu;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 yu);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),cu.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&&rh.unRegisterFields(n,r,t,s)}subscribeToCascadeUpdates(e,t,n,r,s){t&&t.length>0&&rh.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}};mu.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=Gp(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 Eu=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 Au=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 Eu(t,n,s,r,a,o)),this.bufferedDataQueues[e]}},_u=(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,Cu=e=>e.map((e=>e.field)),Su=(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;_u(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=Cu(e.query?.select);Cu(t.query?.select).forEach((t=>{o.includes(t)||(e.query?.select).push({field:t})}))},Tu=(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)),Nu=(e,t)=>{const{data:n}=t,{dataViewCallMap:r,filterDataOnClient:s}=e;Object.keys(r).forEach((e=>{r[e].resolve({data:s(e,n)})}))},Pu=e=>({combiner:Su,comparator:Tu,separator:Nu,...e}),Du=(e,t)=>{try{window.sessionStorage.setItem(e,t)}catch(e){}};class Ru{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=cu.getAppCacheKey(e.dataSource);if(window.sessionStorage.getItem(i)){const s=JSON.parse(window.sessionStorage.getItem(i));if(t&&Ru.searchResultsCache?.[t]?.[o])n(Ru.searchResultsCache[t][o]);else if("form"!==e.cacheLifeSpan&&Ru.searchResultsCache?.persisted?.[o])n(Ru.searchResultsCache.persisted[o]);else{const a=new Ru(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,Ru.initializeCache(t,e,o,a),n(a)):(a.associationFilter=e.associationFilter,a.propertyFilter=e.propertyFilter,a.fetchMetaData(t).then((r=>{Du(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,Ru.initializeCache(t,e,o,a),n(a)})).catch((e=>{a.isInitialised=!1,r(e)})))}}else if(e.deferDatasource&&Gp(e.dataSource)){const r=new Ru(e,t),s=Gp(e.dataSource);r.isQueryable=!!s?.isQueryable,r.isInitialised=!0,r.dataSourceMetaData=s,Du(i,JSON.stringify({isQueryable:s?.isQueryable,dataSourceMetaData:s,isInitialised:!0})),r.context=t,Ru.initializeCache(t,e,o,r),n(r)}else{const s=new Ru(e,t);s.associationFilter=e.associationFilter,s.propertyFilter=e.propertyFilter,s.fetchMetaData(t).then((r=>{Du(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,Ru.initializeCache(t,e,o,s),n(s)})).catch((e=>{s.isInitialised=!1,r(e)}))}}))}static bufferedDataView=new Au;registerForBufferedCall(e){return this.isQueryable&&(this.initializeBufferCallsForDataPage(Pu(e)),this.bufferInitialized=!0),this}static clearContextedCache(e){delete Ru.searchResultsCache[e]}static initializeCache(e,t,n,r){e&&"form"===t.cacheLifeSpan?.toLowerCase()?(void 0===Ru.searchResultsCache[e]&&(Ru.searchResultsCache[e]={}),Ru.searchResultsCache[e][n]=r):(void 0===Ru.searchResultsCache.persisted&&(Ru.searchResultsCache.persisted={}),Ru.searchResultsCache.persisted[n]=r)}fetchMetaData(e){return cu.getDataViewMetadata(this.dataSource,e,this.associationFilter,this.propertyFilter)}initializeBufferCallsForDataPage(e){Ru.bufferedDataView.addBufferedDataQueueForDataPage(this.dataSource,(e=>Iu.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 Ru.bufferedDataView.getBufferedDataQueueForDataPage(this.dataSource).queueDataViewCall(t,e)}catch{const n=this.buildSchemaForQueryableDP(e,t);return Iu.getDataAsync(this.dataSource,this.context,n.dataViewParameters,n.paging,n.query)}const n=this.buildSchemaForQueryableDP(e,t);return Iu.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=Iu.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),...cu.isDistinctResultsOnly(n)&&{distinctResultsOnly:"true"}}:{select:n,...cu.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 bu=Ru;const Ou=class{static cleanCaches(e){rh.purgeCascadeFields(e),ou.removeContext(e),bu.clearContextedCache(e),Gr.cleanContextSubscribers(e),tl(e),Pn.removeContextTreeNode(e),mu.clearContext(e),ml.deRegisterForRefresh(e)}},vu="GET_DESCENDANTS";const xu=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)}}ch(n)}}executeOrQueueDeferredAction(e){if(!e?.payload?.context)return Promise.reject(new Error("Action Context is Mandatory Field."));const t=lh(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}}}}),ch(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=lh(e);return t&&!0===t.context_data?.is_deferred_action_in_progress?(ch({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 lh(e)?(ch({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={...lh(e)};return t.context_data={...t.context_data},t&&t.context_data?.blocking_action_counter>0?(ch({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=lh(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),ch({type:fe,payload:{context:e,data:{...n}}}),cn.disableLoadingIndicator({context:e})}}},wu=(e,t)=>{const n={},r=Vl.getLookUpDataPage(e),s=Vl.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}},Mu=(e,t)=>{const n=Vl.getSavableDataPage(e),r=Vl.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}},Lu=e=>{Gr.publish(F.PUB_SUB_EVENTS.EVENT_CANCEL,e)},Uu=(e,t,n)=>{const{callbacks:r}=n;return n.callbacks=null,e(t,n).then((e=>{"cancel"===e?r?.cancel?.():r?.submit?.()}))};const Fu=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:ul(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 ch({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(!Rl(t)){return new kl(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);ch({type:n,payload:{...r,isModalAction:s,isDataObject:!0,skipReleaseLockRequest:!0}});const{promise:a}=this.actionsApiPromise(n,r);return a.then((()=>{Lu({})}))}createDataObject(e){if(!e)return Promise.reject(new Error("containerItemID is required parameter"));const{data:t}=ih()?.getState()||{},n=t[e]?.dataInfo?.content?.classID;if(!n)return Promise.reject(new Error(j.DATA_CLASS_NOT_FOUND));const r=Vl.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 ch({type:"CREATE_DATA_OBJECT",payload:{...o,isModalAction:a,isFormValid:ul(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=Vl.getSavableDataPage(e),s=Vl.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 ch({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}=wu(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 ch({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}=ih()?.getState()||{},r=n[e]?.dataInfo?.content?.classID;if(!r)return Promise.reject(new Error(j.DATA_CLASS_NOT_FOUND));const{dataPageID:s,keys:a}=Mu(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 ch({type:"UPDATE_DATA_OBJECT",payload:{...c,isModalAction:i,isFormValid:ul(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}=wu(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 ch({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}=ih()?.getState()||{},s=r[e]?.dataInfo?.content?.classID;if(!s)return Promise.reject(new Error(j.DATA_CLASS_NOT_FOUND));const a=ep(e),o=wd(a),i=id(o,a)||{},{resourceType:c="",key:l=""}=i,u=dt,{dataPageID:d,keys:p}=Mu(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 ch({type:u,payload:{...h,isFormValid:ul(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 rc.getPreviewMode()&&(s.debugInfo={debugId:Sh.generateUniqueID()}),ch({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??Nc.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 ch({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:vu,payload:o});var o;return ch(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),rc.getPreviewMode()&&![j.WORKAREA].includes(n.targetContainer)&&(a.debugInfo={debugId:Sh.generateUniqueID()}),ch({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=Ll;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"),rc.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 ch({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=Id(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(Dh.resolveContextTreeNodeProps(e.props).hasSuggestions)return!0;return!1})(n)){const e=[{type:"error",message:gp.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=lh(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=Dc.FORM);const C=bh.buildActionObject(_,this.c11nEnv),{promise:S}=this.actionsApiPromise(s,C),T=this.c11nEnv.getValue("isProcessAction","isProcessAction");return C.isProcessAction=T,xu.executeOrQueueDeferredAction({type:s,payload:{...C,context:n}}),S}getNextWork(){const e=Ll,t=bh.buildActionObject({containerName:j.PRIMARY,isGetNextWork:!0},this.c11nEnv),{promise:n}=this.actionsApiPromise(e,t);return ch({type:e,payload:{...t}}),n}openStage(e){if(!e)return Promise.reject(new Error("stageID is required parameter for openStage"));const t=Ll,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 ch(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=Id(e);return ch({type:t,payload:{...a,context:i,cases:n,actionID:r,isFormValid:ul(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=Id(e);return ch({type:t,payload:{...a,context:i,cases:n,actionID:r,isFormValid:ul(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 ch({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};ch({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)):(ch({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)):(ch({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 ch([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 ch([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,Uu(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=_d(c)[0];let d=!1;const p=$.getRemoteHeaderByContext(c);let h;if(p&&(i.headers={},i.headers.RemoteSystemID=p),!u)return h=c,ch({type:o,payload:{...i,contextName:c,continueExecution:d}}),l;h=fd(u);const g=od(u);if(g?.accessedOrder.forEach((e=>{n===g.items[e].key&&(d=!0,h=g.items[e].context)})),!d||h&&"review"===ih()?.getState()?.data[h]?.context_data?.caseViewMode)return ch({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=lh(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=Id(h),N=this.c11nEnv.getCaseSummary(),P=Zt(N),D=bh.buildActionObject({caseID:n,containerItemID:h,cancelContext:T},this.c11nEnv);let R={};return m?(D.acTargetName=j.MODAL,D.isInCreateStage=P,D.isModalAction=m,R={...D}):R={...D,acName:mt(this.c11nEnv.getContainerName(),D.context)},ch({type:o,payload:{...i,contextName:c,saveActionPayload:S,cancelActionPayload:R,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,Uu(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=Ml,i=bh.buildActionObject(a,this.c11nEnv),{promise:c}=this.actionsApiPromise(o,i);return ch({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=Id(t);return ch({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=Id(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 ch({type:r,payload:d}),p.then((()=>{t||Lu({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(!Rl(n)){return new kl(this.c11nEnv).removeContainerItem({containerItemID:e}).then((()=>{Lu({caseID:a,context:this.c11nEnv.getContextName()})}))}ch({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=dp.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=Rl(r);if(this.shouldDeleteCaseInCreateStage(i,t,u))return this.deleteCaseInCreateStage(e);ch({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=Fl,n=this.getSaveActionPayload(e,!0),{promise:r}=this.actionsApiPromise(t,n);return ch(jl(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=Fl,n=this.getSaveActionPayload(e),{promise:r}=this.actionsApiPromise(t,n);return ch(jl(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=Ul,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}/${sd.PRIMARY}`,d=jc(u,sd.PRIMARY);i.parentContext=d,s&&(i.targetName=j.MODAL,i.containerName=sd.MODAL,i.isModalAction=s),ch((e=>({type:Ul,payload:e}))(i));const{promise:p}=this.actionsApiPromise(n,i);return p.then((()=>{Lu({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}=up.getRestEndPoint("getRecents")||{};t=`${t}?maxResultsToFetch=${e}`;const n=E()+t;return fc(n,{method:"GET",headers:{}})}updateRecents(e,t,n,r){const{restApi:s}=up.getRestEndPoint("updateRecents")||{},a=`${E()}${s}`;return fc(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:{pyLabel:n,pyID:t,classID:e,ID:r}})}logout(){const{restApi:e}=up.getRestEndPoint("Logout")||{},t=`${E()}${e}`;return fc(t,{method:"GET",headers:{}}).then((e=>(Object.keys(Pn.rootNodes).forEach((e=>{Ou.cleanCaches(e)})),Pn.rootNodes={},sessionStorage.clear(),_h(),Promise.resolve(e))))}invoke(e,t={}){const n={method:t.method||"GET",body:t.body};return fc(e,n,this.c11nEnv.getContextName())}showCasePreview(e,t={}){this.loadView(e,"pyCasePreview",{container:sd.PREVIEW,containerName:sd.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:sd.PREVIEW,containerName:sd.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 ch({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 rc.getPreviewMode()&&(r.debugInfo={debugId:Sh.generateUniqueID()}),ch({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 ch({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 ch({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},this.c11nEnv),a=re,{promise:o}=this.actionsApiPromise(a,s);return ch({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=Dh.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=ph(`.${i.join(".")}.classID`,s,r)),e=Sh.trimDotForProperty(e),ch({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=Dh.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}),ch({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),ch({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);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(dp.getFeatureMap().granularUIRefresh){(t.getMetadata().config.children[0].children||[]).forEach((e=>{const n=Qt.trimAnnotation(e.config.value),r=Lp(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 ch({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=Id(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:ul(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(Rl(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}),ch({type:Qe,payload:{pageReference:this.c11nEnv.getPageReference(),context:this.c11nEnv.getValue(j.CONTEXT_DATA_MODAL_VIEW.PARENT_CONTEXT),isListEntry:!0}})}return xu.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=Id(e),n=this.c11nEnv.getPageReference(),{promise:r,actionMgrID:s}=this.actionsApiPromise(gt);return Ln(t,n,{actionMgrID:s,isFillFormWithAI:!0,preserveClientChanges:!1}),r}};const ju=class{constructor(e){this.c11nEnv=e}async getCaseStages(e,t){const n={caseID:e},{restApi:r,reqType:s}=Ng("getCaseStages",n);return(await fc(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=id(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=lh(t));const r=n?.caseInfo?.availableActions,s=lh(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:Vu}=F;const ku=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 ch({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 ch({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 ch({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 ch({type:r,payload:{...s}}),a}static getOpenedCaseItems(e){const t=[],n=od(e);if(n){const{items:r={}}=n,s=Object.keys(r),a=fd(e);s.forEach((n=>{if(r[n]&&(r[n].resourceType===Vu.CASE||r[n].resourceType===Vu.ASSIGNMENT)){const{key:s="",context:o}=r[n],i=r[n],c=s.substring(s.indexOf(" ")+1),l=ph(".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=>{const t={caseID:e},{restApi:n,reqType:r}=Ng(Be,t);return fc(n,{method:r})};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(fc(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 fc(n,{method:r});let a=[];return s.data?.availableActions?.length&&(a=s.data.availableActions),a}};class $u{constructor(e){$u._instance=this,this.context=`${e}/${j.SUGGESTION}`,ih()?.getState().data?.[this.context]||ch({type:Fe,payload:{context:this.context,data:{}}})}getField(e){return ph(e,"",this.context)}setField(e,t){ch({type:Q,payload:{reference:e,value:t,context:this.context}})}removeField(e){ch({type:me,payload:{reference:e,context:this.context}})}setState(e){ch(wh({context:this.context,data:e,isArrayDeepMerge:!0}))}}const Bu=$u;const Gu=class{static getSharedState(e){const t=e.startsWith(".")?e.substring(1):e,n=uh();return n?Sh.getIn(n,t):null}static setSharedState(e,t){e&&ch(pg({key:e,value:t}))}static updateState(e,t,n,r={}){const{isArrayDeepMerge:s=!0,pageReference:a}=r;if(!e||!t)return;ch(hg({context:e,reference:a?`${a}.${t}`:t,value:n,isArrayDeepMerge:s}))}static getSuggestionsContext(e){return new Bu(e)}};const Wu=class{constructor(e,t,n){this.meta=e,this.datasource=t,this.index=0,this.options=n,this.datasourceObj=Dh.getPropertyValue(t,n.pageReference,n.context)}hasNext(){return this.index<this.datasourceObj.length}next(){if(!this.hasNext())throw new Error("No Children");const e=Dh.getContextPath(this.datasource,this.index);return this.index+=1,Zu({meta:this.meta,options:{...this.options,pageReference:e}})}resetIndex(){this.index=0}};class Hu{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,Zu({meta:e,index:this.index,options:this.options})}resetIndex(){this.index=0}}const qu=(e,t)=>{const n=!!e?.repeat;if(!!e?.["repeat-self"])return new Wu(e,e.context||"",t);if(n){const n=gh(`${t.context}.${j.SUMMARY_OF_LISTS}`,e.pageReference,t.context);return new Wu(e.children[0],n||e.context,t)}return e?.children?new Hu(e.children,t):void 0};class zu{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=>hl.isProperty(e))).map((e=>hl.getPropertyName(e)))}}const Yu=new zu;let Ku;Object.freeze(Yu);const Xu=(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({}),Xu(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]||{},Xu(a,t[r],e)}}else n&&n.parentKey&&(n.isObjHasValue=!0),t[r]=a}})),n&&!n.isObjHasValue&&delete n.parentStateObj[n.parentKey])},Ju=(e,t)=>{e._inheritedProps=e._inheritedProps||[],e.inheritedProps=[...e._inheritedProps,...Sh.deepClone(t.inheritedProps)]};class Qu{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&&Ju(this._inheritedConfig,t?.config),Xu(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=Dh.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=Dh.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)){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;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});const g=this.getValue(Qt.trimAnnotation(this.getPropertyName()),this._pageReference)||[];Pn.updatePageListNode(this._contextName,this._pageReference,Qt.trimAnnotation(this.getPropertyName()),g.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 ju(this)),this._caseInfo}getCaseLocaleReference(){const e=this.getCaseInfo(),t=e?.getClassName();return t?gp.getCaseLocaleReference(t):null}getListActions(){return Rr(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 Dh.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=sd.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=Dh.getContextPath(this.getPageReference(),n),s=t?Gu.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&&(Dh.resolveProps(e,t,this),Qt.handleComponentMapping(t,{type:this.getComponentName(),config:e},this)),t}registerAdditionalProps(e={}){return Object.assign(this._additionalRegisteredProps,e),Xu(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=fd(`${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});if(n&&n[0]){const t=n.map((e=>gp.getLocaleValue(e.message,"Messages")));e.validatemessage=t.join(". "),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,fd(`${j.APP.APP}/${this.getContainerName()}`));e.httpMessages=t,this._stateProps.httpMessages=e.httpMessages;const n=Gu.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=ku.getOpenedCaseItems(`${F.APP.APP}/${j.PRIMARY}`),this._stateProps.activeCases=e.activeCases),t===j.APP_SHELL){const t=qn({context:j.APP.APP,category:"PAGE"});e.pageMessages=t,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:fd(`${j.APP.APP}/${this.getContainerName()}`),category:"HTTP"});t?n&&(t=t.concat(qn({context:fd(`${j.APP.APP}/${this.getContainerName()}`),category:"HTTP"}))):t=qn({context:fd(`${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=zu.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=_d(n)[0];if(r){const t=fd(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=hl.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=eh(`${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(Lp(e,t),e)}return this.resolvePropertyMetadata(Lp(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(Lp(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 wl(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 lh(e||this.getContextName())}getImagePath(e){return`${Lr.getConstellationServiceUrl()}/v860/${Lr.getAppAlias()}/image/${e}?org=${up.getOrganizationName()}`}skipRequiredValidation(){return this.options.isBulkAction}isBulkAction(){return this.options.isBulkAction}getChildren(){if(this._children&&this._children.length){const e=qu(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!==zu.allowedComponetsForBulkProcessing[e]&&!0!==zu.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;const o=dp.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}`,gp.getLocaleValue(e,o,gp.FIELD_LABELS_BUNDLE_KEY,a)}t&&!n.includes(t)&&(a=t)}return gp.getLocaleValue(e,t,r,a)}getLocalizedParagraphValue(e){const t=Yp(e,this.getCurrentClassID()),n=t?.definedOnClassID;return gp.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?Dh.getPropertyValue(e,this.getPageReference(),`${this._contextName}/${j.SUGGESTION}`):Dh.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)})),Ju(this._inheritedConfig,e))}getInheritedProps(){const e={},t={};return this._inheritedConfig.inheritedProps?.forEach((e=>{t[e.prop]=e.value})),Dh.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)),ch({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(gl.isPageInstruction(n))return;const r=n?.startsWith(".")?n?.substr(1):n;Il[t]=Il[t]||{},Il[t][r]||(Il[t][r]={initialValue:ph(r,null,t)}),Il[t][r].value=e})({reference:`${this.getPageReference()}${e}`,value:t,context:this.getContextName()})}getContextDataValue(e,t){return hh(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),ch(wh({context:this._contextName,data:e,rootPageReference:r}))}replaceState(e,t,n={}){const{skipDirtyValidation:r=!1}=n;ch({type:"REPLACE_PROPERTY",payload:{reference:`${this.getPageReference()}${e}`,value:t,context:this.getContextName(),skipDirtyValidation:r}})}reportError(e,t,n){ch(ig(e,t||{},n))}getComponent(){return Ku({getPConnect:()=>this})}createComponent(e,t,n,r){let s=this._pageReference;if(t){const e=gh(`${this.getPageReference()}.${j.SUMMARY_OF_LISTS}`,t,this._contextName);s=Dh.getContextPath(e||t,n)||t}else if(r&&r.pageReference){let e=r.pageReference;e=Qt.handleAnnotation(e,this),s=Dh.getContextPath(this._pageReference,e)||""}return Ku(Zu({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 Dh.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,Zu({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 kl(this)}getActionsApi(){return this._actionsApi||(this._actionsApi=new Fu(this)),this._actionsApi}getActionManager(){return ln}getGoogleMapsAPIKey(){return C()}getServerURL(){return E()}getLoadingStatus(e){let t=null;return e?(t=lh(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:fd(`${j.APP.APP}/${this.getContainerName()}`)}))}resolveDatasourceReference(e){return gh(`${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=el(t);Zc[e]?Zc[e].fieldOrder[r]=n:Zc[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();Dr(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=Gu.getSuggestionsContext(this.getContextName()),n=this.getStateProps()?.value||e,r=Dh.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=Dh.getContextPath(this.getPageReference(),t);this._hasSuggestions=!1,Gu.getSuggestionsContext(this.getContextName()).removeField(n)}}}function Zu(e){const t=new Qu(e);return{getPConnect:()=>t}}function ed(e){Ku=e}const td=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 Zu({meta:i,options:{context:c,pageReference:u||t,containerName:n,containerItemID:e,parentPageReference:t,hasForm:r||n===sd.WORKAREA||n===sd.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=hl.isProperty(s),l=hl.isProperty(r);if(l){const e=hl.getPropertyName(r);i=ph(`.${e}`,e.startsWith(".")?n:"",a)}if(i||(i=n),c){const e=hl.getPropertyName(s);o=ph(`.${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=fd(e),a=id(e,t);a&&({key:r,flowName:s}=a)}t.addContainerItem({semanticURL:"",key:r,flowName:s,caseViewMode:"perform",resourceType:"ASSIGNMENT",data:e.getDataObject(n)})}},nd={defaultLimit:16},rd={SINGLE:"single",MULTIPLE:"multiple"},sd={PRIMARY:"primary",WORKAREA:"workarea",MODAL:"modal",PREVIEW:"preview"},ad=()=>ih()?.getState()?.containers,od=e=>e?ih()?.getState().containers[e]:(Et.error("getContainerData: target is the required parameter"),null),id=(e,t)=>{if(!e||!t)return null;const n=ad(),r=n?.[e];return r&&r.items&&r.items[t]||null},cd=e=>e?ih()?.getState().containers[e]?.items:(Et.error("getContainerItems: target is the required parameter"),null),ld=e=>e?ih()?.getState().containers[e]?.accessedOrder||[]:(Et.error("getContainerAccessOrder: target is the required parameter"),[]),ud=e=>e?ld(e)?.length>0||!1:(Et.error("areContainerItemsPresent: target is the required parameter"),!1),dd=(e,t,n)=>{if(!e||!t)return Et.error("isContainerItemExists: target and key are required parameters"),!1;const r=ad(),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},pd=(e,t,n)=>{if(!e||!t)return Et.error("getContainerItemName: target and key are required parameters"),null;const r=ad(),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},hd=(e,t)=>{if(!e||!t)return Et.error("isContainerInitialized: context and name are required parameters"),!1;const n=ad();return n&&Object.prototype.hasOwnProperty.call(n,`${e}/${t}`)},gd=(e,t)=>{if(!e||!t)return Et.error("getContainerType: context and name are required parameters"),null;const n=ad(),r=n?.[`${e}/${t}`];return r&&r.type},fd=e=>{if(!e)return Et.error("getActiveContainerItemName: target is the required parameter"),null;let t=null;const n=ad();if(n&&n[e]){const r=n[e],{accessedOrder:s}=r;t=s&&s.length>0?s[s.length-1]:null}return t},md=(e,t,n)=>{if(!e||!t)return Et.error("isContainerItemActive: target and key are required parameters"),!1;const r=pd(e,t,n);return!!r&&r===fd(e)},yd=(e,t)=>{let n=null;const r=ad();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},Id=e=>e?yd(e,"context"):(Et.error("getDataContextName: containerItemName is required parameters"),null),Ed=e=>{if(!e)return Et.error("getActiveContainerItemContext: target is required parameters"),null;let t=null;const n=ad();if(n&&n[e]){const r=n[e],{accessedOrder:s}=r,a=s&&s.length>0?s[s.length-1]:null;t=Id(a)}return t},Ad=e=>{if(!e)return Et.error("getChildContainerItems: containerItemName is required parameters"),[];const t=e.endsWith("/")?e:`${e}/`;let n=[],r=!1;const s=ad(),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:[]},_d=e=>{if(!e)return Et.error("getChildContainers: containerItemName is required parameters"),[];const t=[],n=ad();for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&r.startsWith(e)&&r!==e&&t.push(r);return t},Cd=e=>{if(!e)return Et.error("getChildContainersContexts: parentContainerItemID is required parameters"),[];const t=[],n=ad();for(const r in n)if(Object.prototype.hasOwnProperty.call(n,r)&&r.startsWith(e)&&r!==e){(ld(r)||[]).forEach((n=>{Id(n)!==e&&t.push(Id(n))}))}return t},Sd=e=>{const t=[...Cd(e),e],n=[],r=ih()?.getState().data||{};return t.forEach((e=>{Object.prototype.hasOwnProperty.call(r,`${e}/${j.SUGGESTION}`)&&n.push(`${e}/${j.SUGGESTION}`)})),n},Td=e=>e?e&&od(e)&&od(e).type===rd.SINGLE:(Et.error("isContainerSingleMode: target is required parameters"),null),Nd=e=>e?e&&od(e)&&od(e).type===rd.MULTIPLE:(Et.error("isContainerMultipleMode: target is required parameters"),null),Pd=e=>e?od(e)&&od(e).items&&Object.keys(od(e)?.items).length>0||!1:(Et.error("hasContainerItems: target is required parameters"),!1),Dd=e=>e&&nd[e]?nd[e]:nd.defaultLimit,Rd=(e,t=nd.defaultLimit)=>{e?nd[e]=t:Et.error("setContainerLimit: target is required parameter")},bd=e=>{if(!e)return Et.error("isContainerLimitReached: target is required parameter"),!1;let t=!1;const n=od(e),{items:r={}}=n,s=Object.keys(r),a=Dd(e);return s&&s.length>0&&s.length>=a&&(t=!0),t},Od=e=>{if(!e||!e.name||!e.context)return Et.error("resetContainersPayload: containerInfo object should contain name and context"),null;const t=e?.name,n=od(`${e?.context}/${t}`),r=Array.isArray(n?.accessedOrder)&&n?.accessedOrder.map((e=>n?.items[`${e}`]?.context))||[],s=_d(`${j.APP.APP}/${j.PREVIEW}`),a=Cd(`${j.APP.APP}/${j.PREVIEW}`);return{context:e?.context,name:t,containerItems:[...r,...a],childContainers:s}},vd=e=>{if(!e)return Et.error("isContainerDirty: containerItemID is the required parameter"),!1;const t=Id(e);return Rl(t)||kc(e)},xd=e=>{if(!e)return Et.error("getLeastRecentlyUsedNonDirtyContainerItemID: target is required parameter"),null;let t;const n=od(e),{accessedOrder:r=[]}=n;for(let e=0;e<r.length;e+=1){const n=r[e];if(!vd(n)){t=n;break}}return t},wd=e=>{if(!e)return Et.error("getTargetFromContainerItemID: containerItemID is the required parameter"),null;const{containers:t}=ih()?.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)},Md=(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=wd(e),r=Id(e),{skipDirtyCheck:s}=t;let a=!0,o=[];if(vd(e)&&!s&&(a=window.confirm(gp.getLocaleValue(_l,"Messages"))),a){const{accessedOrder:t=[],items:s={},type:a}=od(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:{}});ch(Zh({containerItemID:e,context:r,target:n,containerInfo:{newAccessedOrder:o,containerType:a}}))}return Promise.resolve({newAccessedOrder:o,removeItem:a})},Ld=(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)),ch(c)},Ud=(e,t,n)=>{let r=ld(e);r=r.filter((e=>e!==t));let s=!1;for(let e=0;e<r.length;e+=1){if(Id(r[e])===n){s=!0;break}}return s},Fd=e=>{if(!e)return Et.error("isContainerItemContextBeingUsedInOtherContainers: containerItemID is the required parameter"),!1;const t=ad(),n=Id(e),r=t?Object.keys(t):[];let s=!1;for(let t=0;t<r.length&&(s=Ud(r[t],e,n),!s);t+=1);return s},jd=e=>{Array.isArray(e)||(e=[e]);const t=ad()||{};return e.map((e=>{const n=wd(e);return Sh.getIn(t,[n,"items",e,"transientItems"])||[]})).flat()},Vd=e=>{const{transientItemID:t,data:n,options:r}=e,s=Sh.deepClone(ih()?.getState().data[t]);r?.reset&&Sh.iterateLeafNodes(s,(e=>{"classID"!==e[e.length-1]&&Sh.setIn(s,e,"")})),ch(Gh({transientItemID:t,data:Sh.mergeDeep(n,s)}))},kd=e=>{const{transientItemID:t,data:n}=e;ch(Hh({transientItemID:t,data:n}))},$d=e=>{const t=Sh.deepClone(ih()?.getState().data[e]);Sh.iterateLeafNodes(t,(e=>{"classID"!==e[e.length-1]&&Sh.setIn(t,e,"")})),ch(Wh({transientItemID:e,data:t}))},Bd=e=>{const t=Sh.deepClone(ih()?.getState().data[e]);Sh.iterateLeafNodes(t,(e=>Sh.setIn(t,e,""))),ch(qh({transientItemID:e,data:t}))};class Gd{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 Wd=()=>Gd,Hd=e=>{const t={containerName:e};t.childContainers=_d(e),ch({type:Ue,payload:t})},qd=(e,t)=>{const n=Ad(e),{key:r}=id(wd(e),e),s=[];n.forEach((e=>{const{key:n}=id(wd(e),e);if(n===r){const n={data:{caseInfo:{headers:{etag:t}}},target:wd(e),context:e};s.push({type:fe,payload:n})}})),s.length&&ch(s)},zd=(e,t)=>{const n=[],r={data:{caseInfo:{headers:{etag:t}}},target:wd(e),context:e};n.push({type:fe,payload:r}),n.length&&ch(n)},Yd=()=>dp.isPortalLoaded?"app":"root",Kd=()=>xl,Xd=(e,t)=>{const n={data:{caseInfo:{lastUpdateTime:t}},target:wd(e),context:e};ch({type:fe,payload:n})},Jd=(e,t)=>{const n=pd(e,t),r=pd(`${n}/workarea`,t);return Id(r)},Qd=e=>e?yd(e,"parentContext"):(Et.error("getContainerParentContext: containerItemName is required parameters"),null),Zd=e=>{const{accessedOrder:t}=e;return t&&t.length>0?t[t.length-1]:""},ep=e=>{if(e&&"string"==typeof e){const t=e.split("/");return t.pop(),t.join("/")}return null},tp=()=>td,np=/{(.*?)}/i,rp=/{(.*?)}/g,sp=e=>null!==e.match(np),ap=e=>(e&&(e.startsWith("/")&&(e=e.substring(1,e.length)),e.endsWith("/")&&(e=e.substring(0,e.length-1))),e),op=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`}},ip=()=>ap(window.location.pathname),cp=(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 lp=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=>{sp(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=()=>ap(`${this.getReqContextName()}/${this.getReqServletNameReal()}`);getReqServletNameReal=()=>`${this.reqServletNameReal}`;getAppDelimeter=()=>`${this.appDelimeter}`;getApplicationName=()=>`${this.appName}`;getApplicationAlias=()=>`${this.appAlias}`;getServletPath=()=>`${this.reqServletPath}`;getOrganizationName=()=>`${this.orgName}`;getReqContextName=()=>ap(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,""),ap(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(sp(r)){const e=r.match(rp);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:Ed(o)}};Og(i);const c=r.substring(r.lastIndexOf("-")+1),l=t.substring(t.lastIndexOf(" ")+1),u=dp.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&&sp(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(rp);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],sp(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)sp(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(!sp(n))return e;const r={};if(r[t]=e,void 0!==e.payload){const t=n.match(rp);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&&sp(s)){const e=s.match(rp);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(!sp(e)&&e!==r[o]&&op(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)=>{cp(e,t,"warning"),cp("Error in Generated Routing Table",null,"error"),cp("Back | Forward for this page may NOT work as intended",null,"warning"),cp("Bookmark | Refresh for this page may NOT work as intended",null,"warning")}},up=lp;const dp=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.showPerformanceDashboard=!1,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 up.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(){rc.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))||[]}getPerformanceDashboardVisibility(){return this.showPerformanceDashboard}setPerformanceDashboardVisibility(e){this.showPerformanceDashboard=e}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 pp=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 hp{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)=>{if(!t)return;const n=e.LocaleContent||e;this.localeStore[hp.#c(t)]=n};getLocaleForRule(e=this.#l()){return this.localeStore[hp.#c(e)]}resetLocaleStore=()=>{this.localeStore={}};#u(e){return e?hp.#c(e):this.#l()}#d(e){let t=!1;return e&&"string"==typeof e&&(t=e.includes("@P ")),t}#p(e,t){return t!==this.FIELD_LABELS_BUNDLE_KEY?e?`${e}.fields`:"fields":e}getLocaleValue(e,t,n,r){n=this.#u(n);const s=this.#d(e);s&&(e=pp.formatLocaleKey(e));const a=this.#h(e,n,t,r);return"Messages.fields"===(t=this.#p(t,n))&&"string"==typeof e?this.getLocalizedErrorMessage(a,e)||e:s?pp.replaceWithValue(a[e]||e):a[e]||e}#h(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.#l().toUpperCase()],a=s?Sh.getIn(s,`${r}.${n}`,{}):{}),a}#l(){return 2===dp.getFeatureMap().localizationVersion?this.GENERIC_BUNDLE_KEY_LP:this.GENERIC_BUNDLE_KEY}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!${dp.getPortalName()}`.toUpperCase()}getCaseLocaleReference(e){return e?`CASE!${e}`.toUpperCase():null}getLocalizationVersion(){return dp.getFeatureMap().localizationVersion||1}async getLocaleJsons(e){if(!await this.isCurrentLocalePackAvailable())return[];const t=dp.getUseLocale(),n=[],r=PCore.getLocaleUtils().localeStore;if((e=(e=e.filter((e=>!r[hp.#c(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){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=dp.getUseLocale(),n=dp.getBaseLocale();if(dp&&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=dp.getLocale();return this.availableLangPacks||(this.availableLangPacks=await Lr.getSvcAvailableLocales()),e&&this.availableLangPacks.includes(e)}static#c(e){const t=e.indexOf("!CASE!");return-1===t?e:`CASE!${e.substring(0,t)}`}getCaseTypeLocaleReferences(){return dp.getCaseTypeList().map((e=>`${e.pyWorkTypeImplementationClassName}!CASE!${e.pyWorkTypeName}`.toUpperCase()))}}const gp=new hp;let fp;const mp=e=>{if(e){const t=(new DOMParser).parseFromString(e,"text/html").getElementsByTagName("pega-reference")[0].getAttribute("data-rule-id")??"";if(t){const e=fp.getValue(t);return fp.registerAdditionalProps({[t]:`@P ${t}`}),e}}};const yp=class{static getParagraphStream(e,t){return((e,t)=>{fp=t;const n=e.replace(/<pega-reference(.*?)<\/pega-reference>/g,mp);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):Dh.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=hh(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=ph(`.${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=uh(),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 dp.getApplicationName();case j.ENV_INFO_KEYS.ACCESS_GROUP:return dp.getAccessGroup();case j.ENV_INFO_KEYS.USER_NAME:return dp.getOperatorName();case j.ENV_INFO_KEYS.USER_ID:return dp.getOperatorIdentifier();case j.ENV_INFO_KEYS.APPLICATION_DESC:return t.getLocalizedValue(dp.getApplicationLabel()||"");case j.ENV_INFO_KEYS.USER_IMAGE:return dp.getOperatorImageInsKey();case j.ENV_INFO_KEYS.LOCALE:return dp.getUseLocale();case j.ENV_INFO_KEYS.TIMEZONE:return dp.getTimeZone();case j.ENV_INFO_KEYS.WORK_GROUP:return dp.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)||Dh.getLitePropertyValue(n,e),s=t?.getReferencedUser(r)||Dh.getReferencedUser(r,n);return{userId:r,userName:s?s.UserName:null}})),Jt.registerHandler("@ACTIVE_CASES",((e,t)=>ku.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=>Gu.getSharedState(e))),Jt.registerHandler("@PARAGRAPH",((e,t)=>{const n=t.getLocalizedParagraphValue(e);return n?yp.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 Ip="downloadAttachment",Ep={},Ap=e=>{const t=Ic();return Ep[e]=t,t},_p=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},Cp=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:_p(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)}}},Sp={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 fc(a,{method:o,headers:{"Content-Type":"multipart/form-data"},body:s,onUploadProgress:t,signal:Ap(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(Ec,e):e=>{throw e.isHandled=!1,e}).finally((()=>delete Ep[e.ID]))},linkAttachmentsToCase:(e,t,n,r)=>{const s={};if("File"===n){const[e]=t,{clientFileID:n}=e;delete e.clientFileID,s.signal=Ap(n).token}const{restApi:a,reqType:o}=Ng("linkCaseAttachment",{caseID:e});return fc(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 fc(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 fc(r,{method:s},n).then((e=>e.data))},downloadAttachment:(e,t,n)=>{const{restApi:r,reqType:s}=Ng(Ip,{attachmentID:e});return fc(r,{method:s,..."binary"===n&&{responseType:"arraybuffer"}},t)},editAttachment:(e,t,n)=>{const{restApi:r,reqType:s}=Ng("editAttachment",{attachmentID:e});return fc(r,{method:s,body:{...t}},n)},deleteAttachment:(e,t)=>{const{restApi:n,reqType:r}=Ng("deleteAttachment",{attachmentID:e});return fc(n,{method:r},t)},downloadDocument:(e,t)=>{const{restApi:n,reqType:r}=Ng("downloadDocument",{documentID:e});return fc(n,{method:r},t)},deleteDocument:(e,t,n)=>{const{restApi:r,reqType:s}=Ng("deleteDocument",{caseID:e,documentID:t});return fc(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=>{Ep[e]&&(Ep[e].cancel(),delete Ep[e])},buildFilePropsFromResponse:Cp,getAttachmentURL:e=>{const{restApi:t}=Ng(Ip,{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=>Cp(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(Cp)}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):Dh.getLitePropertyValue(n),Sp.prepareAttachmentData(r)})),Jt.registerHandler("@FL",((e,t)=>t.getLocalizedValue(t.getFieldMetadata(e)?.label))),Jt.registerHandler("@GENAICOACH",((e,t)=>Kp(e,t.getCurrentClassID()))),Jt.registerHandler("@REFRESH",((e,t)=>{const n=t.getCaseInfo().getKey(),r=t.getContextName(),s=t.getPageReference();ml.registerForRefresh("PROP_CHANGE",t.getActionsApi().refreshCaseView.bind(t.getActionsApi(),n,"",s,{autoDetectRefresh:!0,preserveClientChanges:!1,refreshFor:!0}),`${s}${e}`,`${r}/${s}`,r)}));const Tp={},Np={},Pp={},Dp={},Rp={},bp={},Op={},vp={},xp={},wp={},Mp=(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)},Lp=(e,t="")=>{if(!e)return null;const n=Dp[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},Up=(e,t,n,r=[])=>{if(!t||!e)return null;if(!e.includes(".")){let s;const a=Lp(e,t);return r.length&&(s=r.join(".")),{...a,embeddedType:n,category:s}}const[s,...a]=e.split("."),o=Lp(s,t);return o&&r.push(o.label),Up(a.join("."),o?.pageClass,o?.type,r)},Fp=e=>{Mp(e,Np)},jp=e=>{Mp(e,Pp)},Vp=e=>{if(e.views&&Mp(e.views,Np),e.navigations&&Mp(e.navigations,Pp),e.personalizations&&Mp(e.personalizations,bp),e.insights&&Mp(e.insights,Op),e.paragraphs&&Mp(e.paragraphs,Tp),e.dataTypes&&Mp(e.dataTypes,vp),e.datapages&&Mp(e.datapages,xp),e.genAICoaches&&Mp(e.genAICoaches,wp),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]}))}Mp(e.fields,Dp)},kp=e=>Np[e],$p=(e,t)=>{const n=Np[e];return Array.isArray(n)?n.some((e=>e.classID===t)):n?.classID===t},Bp=e=>Pp[e],Gp=e=>e in Rp?Rp[e]:null,Wp=e=>e in bp?bp[e]:null,Hp=e=>e in Op?Op[e]:null,qp=e=>{const t={};return Object.keys(Dp).forEach((n=>{const r=Dp[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},zp=(e,t)=>{const n=Lp(e,t)?.datasource?.parameters;return n?Sh.deepClone(n):null},Yp=(e,t)=>{let n=null;const r=Tp[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,t)=>{let n=null;const r=wp[e];return r&&(Array.isArray(r)?n=r.find((e=>e.classID===t)):r.classID===t&&(n=r)),n?Sh.deepClone(n):null},Xp=e=>{if(e in vp){const{savableDataPage:t}=vp[e];return t}return null},Jp=e=>{const t=xp[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=vp[n];return a?a.classKeys.map((e=>({keyName:e,isAlternateKeyStorage:r}))):[]},Qp=e=>{if(e in vp){const{lookupDataPage:t}=vp[e];return t}return null},Zp=e=>{if(Object.prototype.hasOwnProperty.call(vp,e)){const{lookupDataPageInfo:t}=vp[e];return t}return null},eh=(e,t)=>{const n=e.split("."),r=n.pop(),s=new Qu({options:{pageReference:`${n.join(".")}`,context:t}}),a=Lp(r,s.getCurrentClassID())?.additionalInformation;if(!a?.includes("@PARAGRAPH"))return a;const o=Qt.trimAnnotation(a),i=s.getCurrentClassID(),c=Yp(o,i),l=c?.definedOnClassID,u=gp.getParagraphLocaleValue(l||i,o);return u?yp.getParagraphStream(u,s):c?.content?yp.getParagraphStream(c.content,s):null},th=(e,t)=>{const n=e.split("."),r=n.pop(),s=new Qu({options:{pageReference:`${n.join(".")}`,context:t}}),a=Lp(r,s.getCurrentClassID()),o={};return s._classID=s.getCurrentClassID(),s.resolveConfigProps(a,o),o};class nh{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=ph(n,t,e);a.previousValue="object"==typeof o?null:o}}))}registerListField(e,t,n,r,s){const a=nh._getFieldsForList(e,t,n);a.length>0&&(this.registerFields(e,t,a,r,s),ou.enableCascade(e))}unRegisterListField(e,t,n,r){const s=nh._getFieldsForList(e,t,n);s.length>0&&this.unRegisterFields(e,t,s,r)}static _getFieldsForList(e,t,n){const r=[],s=Lp(n,ph("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=ph(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=ph(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]"));const o=/[a-zA-Z]+\.(\d+)\./g;let i=!0;0!==this.listChangeSubscribers.length&&o.test(n)||(i=!1),n=n.replace(/\.(\d+)/g,"[$1]");const c=ph(n,"",t);if(void 0===c&&!e&&0!==e)return;return void this._updateChangedProperties(c,e,i,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 rh=new nh;let sh=null;const ah=e=>e?.split(/\.(?![^[]+\])|\[|\]/g).filter(Boolean),oh=e=>{sh=e},ih=()=>sh,ch=e=>{if(!e)return;let t=[],n=[],r=[];Array.isArray(e)||"MERGE_DATA"!==e.type||({changedListProperty:t,leafProperty:n,changedPropertyWithError:r}=rh.getServerProperties(e.payload.data,e.payload.context,e.payload.rootPageReference)),ih()?.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=Dh.resolveContextTreeNodeProps(a.props);vr.validate(o.componentName?.toLowerCase(),o.propertyName,Dh.getLitePropertyValue(o,o.propertyName),o)})),rh.handleServerChanges(e.payload.context,t,n))},lh=e=>ih()?.getState().data?.[e],uh=()=>ih()?.getState().data[j.SHARED],dh=(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=ah(s);return Sh.getIn(n,a)},ph=(e,t,n)=>dh(e,t,lh(n)),hh=(e,t,n)=>dh(t,e?`${j.CONTEXT_DATA}.${e}`:`${j.CONTEXT_DATA}`,lh(n)),gh=(e,t,n)=>((e,t,n)=>{const r=ah(`${t}.${n}`);return Sh.getIn(e,r)})(lh(n),`${j.CONTEXT_DATA}.${e}`,t),fh=e=>{const{context:t}=e,n=ih()?.getState().data[t];if(n)return de;const{action:r}=e;return["createWork","showHarness","openAssignment","openWorkByHandle","initRouting"].includes(r)?Ce:de},mh=(e,t)=>{const n=ah(t);return Sh.deleteIn(e,n)},yh=e=>!Array.isArray(e)&&"object"==typeof e,Ih=(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(yh(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)},Eh=(e,t,n,r={isArrayDeepMerge:!0})=>{const{isArrayDeepMerge:s}=r,a=ah(t);if("object"==typeof n){const t=Ih(Sh.getIn(e,a),n,{isArrayDeepMerge:s});return Sh.setIn(e,a,t)}return Sh.setIn(e,a,n)},Ah=(e,t,n)=>{const r=ah(t);return Sh.setIn(e,r,n)},_h=()=>{const e=Ze,{promise:t,actionMgrID:n}=ln.actionManagerPromise(e);return ch({type:e,payload:{actionMgrID:n}}),t};class Ch{static mergeDeep(e,t){return w()(t,e)}static hasIn(e,t){return D()(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)?[]:{}),Ih(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}}const Sh=Ch,Th=j.SUMMARY_OF_LISTS,Nh=j.SUMMARY_OF_WHEN_CONDITIONS;class Ph{static updateData(e){Object.keys(e).forEach((t=>{ch(wh({context:t,data:e[t]}))}))}static updateContextData(e){Object.keys(e).forEach((t=>{ch(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 Bp([this.resolveName(e,t)])}static resolveView(e,t,n=""){const r=kp([this.resolveName(e,t)]);let s=[];return Array.isArray(r)&&r.length>0?(t&&(n||(n=t.getValue(j.CLASS_ID)),s=r.filter((e=>e[j.CLASSID]===n))),0===s.length?r[0]:s[0]):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 ph(t,e,n)}static getProperty(e,t,n){let r=this.resolvePropertyReference(t,e,n);if(null==r||0===r.length){const s=gh(`${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=ph(j.CLASS_ID,s,n);if(e)return e;s=s.substring(0,s.lastIndexOf("."))}return null}}const Dh=Ph;const Rh=new class{constructor(){this.actionHandlers={}}getHandler(e){return this.actionHandlers[e]}registerHandler(e,t){this.actionHandlers[e]=t}};const bh=class{static#g=[];static#f=!1;static getActionHandlers=(e,t,n)=>{const r=[];return{mouseenter:"hover",change:"onChange",blur:"onBlur"}[n]!==t||e.forEach((e=>{const t=Rh.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#m=(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.#g.push(a)}};static buildActionObject=(e,t)=>{const n={...e};return n.context="Browser"===dp.getRuntime()?t.getContextName():n.context,n.pageReference=t.getPageReference(),n.actionMgrID=ln.getNextActionMgrId(),n};static#y=e=>{const t=e.actionHandler,n=e.component,{config:r}=e,s={};Dh.resolveProps(r,s,n),t&&(t(e.eventType,s,n),this.#I())};static#I=()=>{if(!this.#f){if(0===this.#g.length)return;const e=this.#g.shift();this.#y(e),e.config&&"true"===e.config.parallel&&this.#g.length>0&&this.#I()}};static#E=()=>{this.#I()};static#A=(e,t,n)=>{this.#m(e,t,n),this.#E()};static getFullRef=e=>{const t=e.getPageReference(),n=e.getComponentConfig().value;return Dh.getContextPath(t,n)};static#_(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.#A(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"===dp.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);ch({type:Q,payload:{reference:a,value:s,context:r}}),void 0!==n&&this.isEditable(n)&&!this.isNonKeyInput(n)||ch({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];ch({type:Q,payload:{reference:Dh.getContextPath(n,a),value:o,context:r}}),ch({type:ee,payload:{reference:Dh.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)&&ch({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.#_(e,n)};static pause=()=>{this.#f=!0};static resume=()=>{this.#f=!1,this.#I()};static isQueueEmpty=()=>0===this.#g.length;static clearQueue=()=>{this.#g=[]};static getActionsQueue=()=>this.#g;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=Sl(s,!0);((e,t={})=>{const n=Qc.buildClientChangeList(e)||{};Object.keys(n).forEach((e=>{Sh.buildObject(e,t,n[e])}))})(s,c);const l=lh(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=Ih(a,d,{isArrayDeepMerge:!o})):((e,t)=>{const n=Il[e]||{};Object.keys(n).forEach((e=>{Sh.hasIn(t,e)&&(n[e].value=Sh.getIn(t,e))}));let r=Qc.getStateMachinesByContext(e)||{};r={...r,...Qc.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&&Qc.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:Re,payload:e}),Hh=e=>({type:Oe,payload:e}),qh=e=>({type:be,payload:e}),zh=e=>{const{containerItemID:t}=e;return e.suggestionContexts=Sd(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=Id(n)),e.context=r,e.deleteContext=!Fd(n),e.childContainers=_d(n),e.childContainersContexts=Cd(n),e.transientItems=jd([...e.childContainersContexts,n]),e.suggestionContexts=Sd(n),n===t&&(e.caseID=ph(j.CASE_INFO.CASE_INFO_ID,"",t),e.RemoteSystemID=ph(j.CASE_INFO.REMOTESYSTEMID,"",t)),{type:Se,payload:e}},eg=e=>{const{containerItemID:t}=e;return e.transientItems=jd([...Cd(t),t]),{type:De,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=Id(n)),e.context=r,e.childContainers=_d(n),e.childContainersContexts=Cd(n),e.transientItems=jd([...e.childContainersContexts,n]),e.suggestionContexts=Sd(n),n===t&&(e.caseID=ph(j.CASE_INFO.CASE_INFO_ID,"",t),e.RemoteSystemID=ph(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)=>up.getSemanticURL(e,t,n),Tg=(e,t)=>up.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(rp);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}},Dg=(e,t,n)=>{let r,s;r=ap(t)?`${e}/${t}`:e;const a=ap(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}`),!up.isDefaultPortal()){const e=up.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},Rg=(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&&sp(t.pxURLPath)?Pg(n,r,t.pxURLPath):t||Pg(n,r),o=up.getEndPointInfo(a.pxURLPath),a.pxURLPath=o.urlPath}const c=Dg(yg,up.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:up.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,up.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),Rg(e,{urlPathObjParam:t,infoParam:null,optionsParam:null},!1)},Og=e=>{bg(e)},vg=e=>{const t={pxURLPath:e};return Dg(yg,up.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:Nc.getUniqueGadgetId(),context:n??o,skipSemanticUrl:!0,insKey:`${i?.toUpperCase()} ${s}`,containerName:a,name:u};ch(l.showPage(d))},Lg=e=>{const t=(e=>e.state?e.state.stateObj:null)(e);t&&($.isTraditionalRemoteCase(t.payload?.caseClassName)?Mg({...t},t.options):ch(l.showHistory(wg(t))))},Ug=()=>up.getApplicationPath()!==ip(),Fg=e=>{const{acName:t,context:n,defaultViewLabel:r}=e,s=(e=>{const t=up.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),up.setDefaultRoute(s);const a=H(t,n),o=mt(t,n),i="true"===dp.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})(ap(window.location.pathname+window.location.search));u=up.getEndPointInfo(t),c.pxURLPath=u.urlPath,void 0!==u.payload?.pageClass&&(u.payload.pageClass=ih()?.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):ch(l[n](wg(r)))}else u=up.getEndPointInfo(Ig),c.pxURLPath="";Rg(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),up.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 Vo(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(Zo),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,Wo([e,t],Go(n))):setInterval.apply(void 0,Wo([e,t],Go(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 Vo(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,Qo(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 Vo(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 Vo(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 Vo(t,e),t}(ef))(Jg),nf=Uo((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 Vo(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;ui((function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var s=Bo(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;ui((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;ui((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?ei:(this.currentObservers=null,a.push(e),new Zo((function(){t.currentObservers=null,Qo(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 Ci;return e.source=this,e},t.create=function(e,t){return new sf(e,t)},t}(Ci),sf=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return Vo(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:ei},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}(Ci);var cf=s(923),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 Rf(e)||gf(e)||!ff(e)||(Ef(e)>1&&(e.set=e.add=e.clear=e.delete=Df),Object.freeze(e),t&&Object.entries(e).forEach((([e,t])=>Pf(t,!0)))),e}function Df(){pf(2)}function Rf(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(Rf(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)&&!Rf(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)||Rf(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)=>{Iu.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!==sd.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]=Ih(e[t.payload.containerItemID],t.payload.data,{propertiesToReplace:[...r]}):e[t.payload.context]=Ih(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]=Ih(e[n],e[r]),e[n]=Ih(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=Eh(a,"pulse",o),a=Eh(a,"OperatorID",i),a=Eh(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 De:{const{transientItems:n}=t.payload;return n.forEach((t=>Sh.deleteIn(e,t))),e}case Ne:case Re:{const{transientItemID:n,data:r}=t.payload;return Ih(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]=Ih(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 Eh(e[n],r,s,{isArrayDeepMerge:a}),e}case Z:{const{context:n,reference:r,value:s}=t.payload;return Ah(e[n],r,s),e}case me:return mh(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=Lp(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}=Lc(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(sd.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(sd.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(sd.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=ah(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=Ih(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()),(!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,D=N&&N.accessedOrder||[],R=N&&N.items||{};let b=null;return e[n]&&"single"===P&&D.length>0?Em(e,t):(b={accessedOrder:[...D,c],items:{...R,[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 De:{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=Yl(e),r=function(e,t){return"number"==typeof zl(e)?e.pop():t}(e,1/0),s=e;return s.length?1===s.length?vi(s[0]):function(e){return void 0===e&&(e=1/0),Hl(Ai,e)}(r)($i(s,n)):Jl}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},Dm={},{VIEW:Rm,FIELD:bm}=j.CONTEXT_TREE_NODE_TYPES,Om=e=>(e=>ic[e])(e)>0&&Dm[e],vm=[(e,t)=>e.pipe(Bl(Dn.REFRESH_DATA,gt),Wl((e=>e.payload)),Hl((e=>{const{context:n,contextData:r,options:s}=e,{propertyName:a="",classID:o=""}=s,i=Oc(n,{skipUUID:!1});let c=[],l=[],u=!1;dp.getFeatureMap().granularUIRefresh?(({fieldsWithDeclarativeTargets:c=[],whens:l=[]}=jn(n)),u=l.some((e=>e.type===Rm))):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=Lp(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=Kc(n);Sh.isEmpty(I)||(y=Yc(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=Dn.REFRESH;return r?(l=Ng(Dn.REFRESH_CASE_VIEW,e),d={...d,interestPage:i}):o&&n?l=Ng(Dn.REFRESH_CASE_DATA,e):o&&!n?l=Ng(Dn.REFRESH_ASSIGNMENT_DATA,e):(s.length>0||a.length>0)&&(d={...d,calculations:{fields:s,whens:a}},l=Ng(n?Dn.RECALCULATE_CASE_DATA:Dn.RECALCULATE_ASSIGNMENT_DATA,e),p=Dn.RECALCULATE),{restAPI:l,requestBody:d,requestType:p}})({...e,fieldsWithDeclarativeTargets:c,fieldsWithWhen:d,isViewsWithWhen:u},y);xu.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 $i(((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<Dm[r].length;){const s=Dm[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=>{Dm[r].splice(e,1)}))}const s=Ic();return e.signal=s.token,e.cancelConfig=s,Dm[r]?Dm[r].push(e):Dm[r]=[e],fc(e.url,e,n,{cancelContext:r}).then((e=>(delete Dm[r],e))).catch((e=>{throw e&&"ERR_CANCELED"!==e.code&&delete Dm[r],e}))})({reqHeaders:N,context:n,method:S,body:_,url:Fn(e,T)},e)).pipe(Wl((t=>({response:{...t.data||{}},actionConfig:e,actionMgrID:e.options.actionMgrID,headers:bc(t.headers)}))),Zl(": Error occurred during fetch call at refreshData Epic : ",e.context,e?.options?.actionMgrID))})),Hl((async e=>{if(e&&e.type===Ee)return xu.deRegisterBlockingAction(e.payload?.context).catch((()=>{})),Uc(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===Dn.REFRESH&&await xc(u,t,l);const d=vc(u,{target:c,context:s});d.preserveClientChanges=void 0===t.options.preserveClientChanges||t.options.preserveClientChanges;const p=Nc.getPropertiesToReplace(s),h=og(wh,d,{serverPrecedenceFields:a,propertiesToReplace:p});return Qc.registerForServerChanges(),ch(h),ln.resolveActionByID(r,d),Qc.unRegisterForServerChanges(),xu.deRegisterBlockingAction(s).catch((()=>{})),[]})))],xm=vm,wm=[e=>e.pipe(Bl(et),Hl((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=uh()[a.name];if(n&&s in n){const r=n[s],{loadTime:a}=r;if(!cu.isTimeElapsed(a,e,t))return}}return cu.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})),ch(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()){Zu({}).getPConnect().getActionsApi().showCasePreview(t,{caseClassName:n})}};navigateToDefaultPage=()=>{const e=Zu({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),up.updateSemanticURLAndDocumentTitle({key:t,caseClassName:n,actionName:a});Zu({}).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}`;Zu({meta:{},options:{context:Ed(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}`;Zu({meta:{},options:{context:Ed(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(dp.getOperatorIdentifier(),t)},$m=[j.TOP_ACTION_LABEL.CREATEWORK,j.TOP_ACTION_LABEL.OPENASSIGNMENT,j.TOP_ACTION_LABEL.FINISHASSIGNMENT,j.TOP_ACTION_LABEL.OPENWORKBYHANDLE,j.TOP_ACTION_LABEL.SAVEANDCLOSE,j.TOP_ACTION_LABEL.SHOWDATA],Bm={getActionInfo:(e,t)=>{let n={};return $m.includes(e)&&(n={topLevelAction:!0,actionLabel:e}),e===j.TOP_ACTION_LABEL.OPENASSIGNMENT&&(n.assignmentID=t),n}},Gm=()=>({registerHeader:(...e)=>ac.registerHeader(...e),unRegisterHeader:(...e)=>ac.unRegisterHeader(...e),getRegisteredHeaders:()=>ac.getRegisteredHeaders()}),Wm=(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),fc(c,u,o,i??{})},Hm=(e,{method:t="GET",body:n={},headers:r={},withoutDefaultHeaders:s=!1},a)=>{e.startsWith("http:")||e.startsWith("https:")||(e=E()+e);return fc(e,{method:t,headers:r,body:n,withoutDefaultHeaders:s},a)},qm=e=>up.doesRestApiExist(e),zm=()=>Ic(),Ym=e=>Ec(e),Km=e=>{gc(e)},Xm=()=>Jm;const Jm=class{static createCase(e,t){const{caseInfo:n,startingFields:r,flowType:s,viewType:a=Dc.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};let p={};return dp.getPerformanceDashboardVisibility()&&(p=Bm.getActionInfo(j.TOP_ACTION_LABEL.CREATEWORK)),Wm("createWork",{body:d,queryPayload:{caseClassName:e,viewType:a,params:{pageName:o}},headers:{...l,...c&&{...ac.addDebugHeaders(c)}}},i,p).then((t=>({response:t.data,requestPayload:d,headers:bc(t.headers,e,l)})))}},Qm=(e,t)=>{const{class:n,context:r,viewType:s=Dc.PAGE}=e,{removeActionPayload:a}=t;let o=e?.pageName?e?.pageName:dp.getDefaultCasePage();return e.isTraditionalUICase&&(o="pyDetails"),$i(Jm.createCase(n,{...e,pageName:o,viewType:s,context:r})).pipe(Wl((({response:t,headers:n})=>({response:t,actionInPayload:e,headers:n,removeActionPayload:a}))),Zl("Error occurred during ajax call at createWork Epic : ",r))},Zm=e=>{Gr.publish(j.PUB_SUB_EVENTS.DISPLAY_CASE_CREATED_TOASTER,e)},ey=e=>{Gr.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_DONE,e)},ty=e=>{let t=0,n=[],r="",s=!1;return e.pipe(Bl(Oh),eu(100),Wl((e=>(({actionMgrID:t}=e.payload),e.payload))),Hl((e=>{const{context:n}=e,r=Vm(e),a=mt(r,n),{continueExecution:o,removeActionPayload:i}=(e=>Td(e)?{continueExecution:!0,removeActionPayload:{}}:$c(e))(a);return s=ls(e.class),o?(e.isTraditionalUICase=s,Qm(e,{removeActionPayload:i})):(ln.rejectActionByID(t),Ql())})),Hl((async e=>{if(e&&e.type===Ee)return e.payload.context=Yd(),n.push(Uc(e)),n;const{actionInPayload:a,response:o,headers:i,removeActionPayload:c}=e;let l;l=!(a.renderInline||dp.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=jc(d,u,a.context);if(!Kr(u)&&Td(d)){const{continueExecution:e}=$c(d);if(!e)return ln.rejectActionByID(t),Ql()}if(!(a?.openCaseViewAfterCreate??!0)&&!l){const e=Sh.getIn(o.data,F.CASE_INFO.CASE_INFO_CONTENT);r=`${e.pyID} ${gp.getLocaleValue("has been created.","Assignment")}`;const t=rs(o),s=es(o);return Zm({toastMessage:r}),ey({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 xc(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=vc(h,y);s&&(I.data.caseInfo.content.coexistenceAction="openAssignment");const E=Fc(d,I);return Vc(E)&&ss(n,{removeActionPayload:c,target:d}),n.push(E),Wc(n),n})),Wl((()=>{const e=us(),a=Zt(Sh.getIn(n[0]?.payload,"data.caseInfo"));return s&&e&&a?Um.postCreateCaseMessage(n[0]?.payload?.nextAssignmentInfo?.ID,zc,n):zc(n),cs(n,t),r="",n=[],n})))},{RESOURCE_TYPES:ny}=F,ry=(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?Dc.PAGE:n||(!Yr(r)&&!Yr(s)||a?Dc.PAGE:Dc.FORM)},sy=(e,t,n,r,s)=>{if(ss(e,{removeActionPayload:t,target:n}),((e,t)=>{const n=fd(t);let r=null;return n&&(r=id(t,n)),r?.key===e&&Nd(t)})(r.key,n))r.context=Ed(n),r.containerItemID=r.context,e.push(og(ng,r));else if((s?.isChild||s?.isRemote)&&s?.isMultiDoc){const t=wd(s.context);r.target=t,r.context=s.context,r.containerItemID=s.context,e.push(og(ng,r))}else{const t=wd(r.context),n=pd(t,r.key);n?(r.target=t,r.context=n,r.containerItemID=n,e.push(og(ng,r))):e.push(og($h,r))}},ay=(e,t,n,r,s,a,o)=>{Td(t)&&Pd(t)?((e,t,n,r,s)=>{ry(e,t)===Dc.FORM?(n.caseViewMode=r||j.PERFORM_MODE,s.push(og(zh,n))):s.push(og(ng,n))})(r,s,e,a,n):sy(n,o,t,e,r)},oy=({restUrl:e,reqType:t,requestHeaders:n,debugInfo:r,context:s,isGetNextWork:a,doNotMergeMessagesForStatusCode:o,assignmentID:i})=>{let c={};return dp.getPerformanceDashboardVisibility()&&(c=Bm.getActionInfo(j.TOP_ACTION_LABEL.OPENASSIGNMENT,i)),fc(e,{method:t,headers:{"if-match":n&&n.etag,...n,...r&&{...ac.addDebugHeaders(r)}}},s,{doNotMergeHttpMessagesForStatusCode:a?o:"",...c})},iy=(e,t)=>{const n=ry(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=dp.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=bc(t,e.remoteClassName)),t})(e);return $i(oy({restUrl:y,reqType:g,requestHeaders:E,debugInfo:i,context:s,isGetNextWork:o,doNotMergeMessagesForStatusCode:"404",assignmentID:a})).pipe(Wl((e=>{if(dp.isCoexistenceAppOfType(j.APP_TYPE.UIKIT)&&!p){return Zt(e.data.data.caseInfo)?e:(y=y.replaceAll(I,"pyDetails"),dp.setDefaultCasePage("pyDetails"),{isReloadWithDifferentViewTypeRequired:!0,restUrl:y})}return e})),Hl((e=>e?.isReloadWithDifferentViewTypeRequired?oy({restUrl:y,reqType:g,requestHeaders:E,debugInfo:i,context:s,isGetNextWork:o,doNotMergeMessagesForStatusCode:"404",assignmentID:a}):Kl(e))),Wl((t=>{const{key:s,flowName:o}=Mc(a);return{response:{...t.data,key:s,flowName:o},actionInPayload:e,viewType:n,removeActionPayload:f,headers:bc({...r,...t.headers})}})),Zl("Error occurred during ajax call at openAssignment Epic : ",s))},{RESOURCE_TYPES:cy}=F,ly=e=>{const t="Browser"===dp.getRuntime();let n=0,r=[];const s=[];let a=!1,o=!1;return e.pipe(Bl(Ll),Wl((e=>(({actionMgrID:n}=e.payload),{...e.payload,...t?{insKey:e.payload.assignmentID}:{assignmentID:e.payload.assignmentID}}))),Hl((e=>{a=e.isGetNextWork;const{context:t}=e;let r;r=(e?.isChild||e?.isRemote)&&e?.isMultiDoc?Dc.FORM:ry(e),e.viewType=r;const s=qr(Ge,e),i=mt(s,t),{activate:c,activateContainerActionPayload:l}=Gc(cy.ASSIGNMENT,i,e);if(c&&!e.isParallelCall)return Kl({type:ve,activateContainerActionPayload:l,actionInPayload:e});const u=fd(i);let d;d=l?.isParallelAssignment?{continueExecution:!0,removeActionPayload:{}}:u?$c(i):{continueExecution:!0,removeActionPayload:{}};const{continueExecution:p,removeActionPayload:h}=d;return p?(o=ls(e.className),e.isTraditionalUICase=o,iy(e,{removeActionPayload:h})):(ln.rejectActionByID(n),Ql())})),Hl((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(Uc(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=Ll,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=!dp.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=Id(s);await xc({directUrlUpdation:!l,semanticURL:r},c,{acName:i,target:i,context:u}),e.push(og(Jh,{containerItemID:s,target:i,isParallelAssignment:a,insKey:o,resourceType:ny.CASE,context:u,doDeleteCaseSummary:c.doDeleteCaseSummary}))})(r,d,{actionInPayload:n,target:m}),Wc(r),r;const y=i?.data?.caseInfo?.content,I=i?.uiResources?.root?.config?.name;y&&!y.pyViewName&&I&&"page"!==n.viewType&&Sh.setIn(y,"pyViewName",I);const E=Pm(i);((e,t)=>{const n=Qr(e),r=ns(e),s=Zt(n),{skipBrowserSemanticUrlUpdate:a=!1,viewType:o,isTraditionalUICase:i}=t,c=o===Dc.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}})(E,n);const A=jc(m,f,p),_={acName:m,target:m,context:A};await xc(E,n,_);const C={target:m,context:A,containerItemID:A,headers:l,parentContext:W(n?.context),isMinimizable:Zt(Sh.getIn(E,"data.caseInfo")),doDeleteCaseSummary:n.doDeleteCaseSummary,acTertiary:n.acTertiary,resourceType:F.CASE,debugInfo:g};os(C,E,{skipFlowNameUpdate:n?.caseViewMode===j.REVIEW_MODE});const S=vc(E,C);return n.isProcessAction&&(S.data.isProcessAction=n.isProcessAction),o&&(S.data.caseInfo.content.coexistenceAction="openAssignment"),((e,t)=>{e.acTertiary&&(t.data.caseInfo.isFirstAssignment=e.acTertiary)})(n,S),ay(S,m,r,n,i,h,u),c===Dc.FORM&&as(S.containerItemID)&&qc(S,r),Wc(r),(e=>{Gr.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_OPENED,e)})({actionInContext:p,assignmentID:n.assignmentID,caseKey:S.key}),r})),Wl((()=>{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,ch,r):ch(r),cs(r,e,s),r[0]?.payload?.isParallelAssignment&&ch({type:Ll,payload:{...r[0].payload,isParallelCall:!0}}),r=[],r})))},uy=(e,t)=>{const{insKey:n,headers:r,context:s,debugInfo:a,viewType:o}=e,{removeActionPayload:i}=t,c=e?.pageName?e?.pageName:dp.getDefaultCasePage(),l=Ng(Be,{caseID:n,params:{pageName:c}});let{restApi:u}=l;const{reqType:d}=l;"none"===o&&(u=`${u?.split("viewType")[0]}viewType=none`);let p={};return dp.getPerformanceDashboardVisibility()&&(p=Bm.getActionInfo(j.TOP_ACTION_LABEL.OPENWORKBYHANDLE)),$i(fc(u,{method:d,headers:{...r,...a&&{...ac.addDebugHeaders(a)}}},s,p)).pipe(Wl((t=>({response:t.data,actionInPayload:e,headers:bc({...r,...t.headers}),removeActionPayload:i}))),Zl("Error occurred during ajax call at openWorkByHandle Epic : ",s))},dy="OPEN_WORK_BY_HANDLE",{RESOURCE_TYPES:py}=F,hy=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=Id(r);await xc({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=jc(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 xc(a,r,f);const m=vc(a,{target:h,context:s,containerItemID:s,semanticURL:g,headers:c,debugInfo:d});m.caseViewMode=j.REVIEW_MODE,m.resourceType=py.CASE,n&&(m.data.caseInfo.content.coexistenceAction="openWorkByHandle"),os(m,a,{skipFlowNameUpdate:!0}),m.currentCaseViewMode=ps(e?.actionInPayload?.context);const y=Fc(h,m);i.containerItemID&&Vc(y)&&t.push(og(Zh,{containerItemID:i.containerItemID,target:h})),t.push(y)}Wc(t);(e=>{Gr.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.CASE_OPENED,e)})({caseKey:r.insKey,actionInContext:l})},gy=e=>{let t=0,n=[];return e.pipe(Bl(dy),Wl((e=>(({actionMgrID:t}=e.payload),e.payload))),Hl((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=$c(o);c=e.continueExecution,i=e.removeActionPayload}if(!c)return ln.rejectActionByID(t),Ql();const{activate:l,activateContainerActionPayload:u}=Gc(py.CASE,o,e);return l&&!r&&"none"!==s?Kl({type:ve,activateContainerActionPayload:u,actionInPayload:e}):uy(e,{removeActionPayload:i})})),Hl((async e=>{if(e&&Xr(e.type))return n.push(Uc(e)),n;const t=lh(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=wd(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=vc(e?.response,{...i});qc({...t,isArrayDeepMerge:!0},n)}}}else await hy(e,n,r);return n})),Wl((()=>(ch(n),cs(n,t),n=[],n))))},fy="FINISH_ASSIGNMENT",{RESOURCE_TYPES:my}=F,yy=(e,t)=>{const{containerItemID:n,skipReleaseLockRequest:r,isInCreateStage:s,isProcessAction:a}=t,o=Id(n),i=`${o?.includes("root")?j.APP.ROOT:j.APP.APP}/${sd.MODAL}`;e.push(og(Zh,{containerItemID:n,context:o,target:i,skipReleaseLockRequest:r,isInCreateStage:s,isProcessAction:a}))},Iy=e=>ph(".openCaseViewAfterCreate",j.CONTEXT_DATA,e)??!0,Ey=async(e,{translatedDXAPIResponse:t,actionInPayload:n},r)=>{const{caseID:s}=n,a=(o=t,Sh.getIn(o,Hr.NEXT_ASSIGNMENT_INFO_ID,j.EMPTY_STRING));var o;const i=es(t),{caseViewMode:c,headers:l,semanticURL:u,actionMgrID:d,directUrlUpdation:p,key:h,flowName:g,resourceType:f}=r;(e=>{Gr.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_DONE,e)})({caseId:s,assignmentId:a,caseType:i}),yy(e,{...n,skipReleaseLockRequest:!0});const m=`${n?.containerItemID.includes("root")?j.APP.ROOT:j.APP.APP}/${sd.PRIMARY}`,y=jc(m,sd.PRIMARY),I=ac.getCoreHeadersFromContext(n.context)||!1,E=vc(t,{target:m,context:y,containerItemID:y,caseViewMode:c,headers:l,semanticURL:u,key:h,flowName:g,resourceType:f,directUrlUpdation:p,debugInfo:I&&I.debugInfo&&{debugId:I.debugInfo[j.COREHEADER_APP_DEBUG_ID]}});if(Td(m)){const t=lh(y),s=ns({data:t}),[,a]=s?s.split(" "):[],o=`You will lose unsaved changes for ${a}. Do you want to continue?`;if(!Iy(n.context))return e;{const{continueExecution:t}=$c(m,{dirtyMessage:o});if(!t)return r.directUrlUpdation=!1,ln.rejectActionByID(d),Ql();E.currentCaseViewMode=ps(E?.context),e.push(og(ng,E))}}else e.push(og($h,E));return t.directUrlUpdation=p,t.semanticURL=u,await xc(t,{...E,acName:m},{acName:m,context:y}),e},Ay=e=>/^app\/preview_[0-9]*/g.test(e),_y=(e,t)=>{const n=W(e);return!Ay(e)&&(n===t||/^app\/primary_[0-9]*/g.test(n))},Cy=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=lh(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=Td(wd(e));let d=!1;const p=wd(n),h=od(p),g=fd(p);g&&h?.items?.[g]?.key===c?.actionInPayload?.caseID&&(d=!0),yy(s,{...r,skipReleaseLockRequest:!0});const f=zr(e),m={target:wd(e),containerItemID:e,context:e,containerName:f};t.doDeleteCaseSummary=r.doDeleteCaseSummary;const y=X(n),I=lh(y),E=lh(r.context),A=I?.caseInfo?.ID,_=E?.caseInfo?.ID;if(u&&A===_||!u&&""===o)(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=wd(e),i=pd(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=_d(n)[0];if(r.target=e,r.context=jc(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=wd(e),r.containerName=zr(e),r.context=e,r.containerItemID=e,Sh.setIn(t,"acName",m.target),await xc(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=wd(e);return pd(n,t)})(e,o),n={data:{caseInfo:{headers:l}},context:t};s.push(og(wh,n)),s.push(Rn(((e,t=!1,n=!1)=>{const r=ln.getNextActionMgrId();return{ID:Dh.getPropertyValue(F.CASE_INFO.ASSIGNMENT_ID,"",e),actionID:Dh.getPropertyValue(F.CASE_INFO.ASSIGNMENTACTION_ID,"",e),context:e,caseWideAction:t,contextData:n,options:{actionMgrID:r}}})(t)))}}else{yy(s,r);let e=!1;const o=wd(n),i=od(o),l=fd(o);if(l&&i?.items?.[l]?.key===c?.actionInPayload?.caseID&&(e=!0),a){const e=_d(n)[0];r.target=e,r.context=jc(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))}}},Sy=async(e,t,n,r,s)=>{((e,t,n)=>{if(t.isProcessAction&&(yy(n,{...t,skipReleaseLockRequest:!0}),e)){const r=`${t?.containerItemID.includes("root")?j.APP.ROOT:j.APP.APP}/${sd.PRIMARY}`,s=jc(r,sd.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 a=e?.data?.caseInfo?.parentCaseInfo?.ID;if(a){const n=wd(t?.context),r=id(n,t?.context)?.parentContext,s=wd(r);t?.isProcessAction&&dd(s,a)&&Xd(r,e?.data?.caseInfo?.lastUpdateTime)}n.resourceType=my.CASE,n.directUrlUpdation=!0,t.isProcessAction||await Ey(s,{translatedDXAPIResponse:r,actionInPayload:t},n)},Ty=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=Nc.getPropertiesToReplace(a);s.push(og(zh,{...e,...r,propertiesToReplace:o})),Sh.setIn(e,"acName",r.target),await xc(n,e),((e,t,{data:n,caseViewMode:r})=>{const{containerItemID:s}=t,a=Id(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=Nc.getPropertiesToReplace(s);e.push(og(wh,o,{propertiesToReplace:i}))}})(s,t,e)},Ny=async(e,t,n,r,s,a,o,i)=>{const{isCaseWideAction:c,isInCreateStage:l,containerItemID:u}=e,d=W(e.context),p=ts(s),h=es(s),g=l&&!p&&!c,f=_d(d)[0],m=f?fd(f):d,y=zr(u),I=Id(u),E=Object.freeze({target:e.target,containerItemID:u,context:I,containerName:y});g&&!Ay(e.context)?await Sy(i,e,t,s,a):_y(e.context,m)?await Cy(m,t,d,e,a,n,r,s,o):c&&!_y(e.context,m)?(yy(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=Id(a);e.push(og(Lh,{containerItemID:a,context:o,container:sd.PREVIEW,containerName:sd.PREVIEW,caseId:s,viewName:F.PREVIEW_VIEW_NAME,caseClassName:t,updateData:!0}))}})(a,e,{caseClassName:h})):await Ty(t,e,s,E,a)},Py=(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?Dc.PAGE:n||Dc.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}=Oc(a);e.attachmentsExist=y;const I=u.value.data[a]?.caseInfo?.headers||{},{etag:E}=I,A={"if-match":E,...o};let _={};return dp.getPerformanceDashboardVisibility()&&(_=Bm.getActionInfo(j.TOP_ACTION_LABEL.FINISHASSIGNMENT)),$i(fc(g,{method:f,body:m,headers:A},a,_)).pipe(Wl((t=>{const{data:n,headers:r}=t;return{response:n,actionInPayload:e,headers:bc({...A,...r})}})),Zl("Error occurred during ajax call at finishAssignment Epic : ",a))},{RESOURCE_TYPES:Dy}=F,Ry=(e,t)=>{let n=0,r=[],s={},a="";return e.pipe(Bl(fy),Gl((e=>{const o=dp.isCoexistenceAppOfType(j.APP_TYPE.UIKIT);if(({actionMgrID:n}=e.payload),a=e.payload.context,zn({context:a,stateObj:lh(a),clearContextMessages:!0}),!ul(a)){const t={type:F.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return ln.rejectActionByID(n,!0,t),xu.handleDeferredActionCompletion(e.payload.context),Kl([])}return Kl(e.payload).pipe(Hl((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 Py(n,{state$:t})})),Hl((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=lh(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:wd(n),context:n};ch({type:fe,payload:a})}})(e);const t=Uc(e);return r.push(t),r}bu.clearContextedCache(a);const{headers:t,actionInPayload:i,response:c}=e,{containerItemID:l,context:u=Id(l),isModalAction:d,isInCreateStage:p}=i,h=wd(l);i.target=h;const g=zr(l),f=Object.freeze({target:i.target,containerItemID:l,context:u,containerName:g});Sh.setIn(c.data,j.CASE_INFO.IS_FIRST_ASSIGNMENT,!1),Sh.setIn(c.data,j.CASE_INFO_IS_LOCAL_ACTION,!1),c?.uiResources?.root?.config?.name&&"page"!==i.viewType&&Sh.setIn(c.data,j.CASE_INFO.VIEW_NAME,c?.uiResources?.root?.config?.name),(e=>{Gr.publish(j.PUB_SUB_EVENTS.EVENT_EXPRESS_LOCALACTION,e)})({submitResponse:c});let m=Pm(c,{[F.STOPMERGEACTIONS]:!c.nextAssignmentInfo});const y=es(m),I=W(i.context),E=_d(I)[0]?fd(_d(I)[0]):I,A=ts(m),_=p&&!A;!d||p||_y(i.context,E)||(m=((e,t)=>(e?.data?.caseInfo&&t?.caseInfo?.content&&(e.data.caseInfo.content=t?.caseInfo?.content),e))(m,lh(l)));const C=vc(m,{headers:t,actionMgrID:n,directUrlUpdation:!1});let S,T;is(C.data,i),C.caseClassName=y,C.resourceType=Dy.ASSIGNMENT,C.headers=t;const N=m?.data?.caseInfo?.assignments?.some((e=>e.ID===i.assignmentID)),P=((e,t)=>{const{assignmentID:n}=t;return e?.data?.caseInfo?.assignments?.some((e=>e.ID===n&&"true"===e?.canPerform))})(m,i),D=((e,t,n,r,s)=>{let a;const o=wd(t);return a=Nd(o)?pd(o,n.data?.caseInfo?.ID):fd(o),r&&e&&hh(null,j.CASE_VIEW_MODE_PROP,a)===j.PERFORM_MODE&&s})(N,E,m,d,P),R=i?.actionID===F.LOCAL_ACTIONS.TRANSFER_ASSIGNMENT;m?.data?.nextAssignmentInfo&&!R?(C.caseViewMode=j.PERFORM_MODE,S=ns(m),T=!0):D&&!R?(C.caseViewMode=j.PERFORM_MODE,S=ns(m),C.flowName=" ",C.deleteAssignmentSpecificResources=!1,T=!1):(C.caseViewMode=j.REVIEW_MODE,S="",T=!1);const b=ns(m);os(C,m,{skipFlowNameUpdate:C?.caseViewMode===j.REVIEW_MODE||D});const O=Sg("createWork",{caseClassName:y}).replace(/{.+?}/,String(Zr(b)));if(m.semanticURL=O,C.semanticURL=O,d?(await Ny(i,C,T,S,m,r,e,c),_&&(s=(e=>{if(!Iy(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{}})(i))):p&&o&&!A?(dp.setDefaultCasePage("pyDetails"),await(async(e,t,n)=>{const r={assignmentID:e?.data?.caseInfo?.assignments[0]?.ID,className:e?.data?.caseInfo?.content?.classID,containerName:sd.PRIMARY,targetContainerName:sd.PRIMARY,viewType:Dc.PAGE,isLastStepInCreateStage:!0,context:n},s={type:ge,payload:{...r}};t.push(s)})(c,r,W(u))):await Ty(C,i,m,f,r),ds(e,r),xu.handleDeferredActionCompletion(a),((e,t,n)=>{const{isModalAction:r,isCaseWideAction:s,caseID:a}=t,o=_y(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})})(C,i,E),!m?.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}})(m,i);(e=>{Gr.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.END_OF_ASSIGNMENT_PROCESSING,e)})({...e,containerItemID:l})}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:l,target:h,isModalAction:d}),r})),Wl((()=>{const e=r.find((e=>e.type===Ee));return e?(xu.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),zc(r),r=[],s={},r})))})))},by="CANCEL_ASSIGNMENT",Oy=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:Dc.PAGE});return rc.getPreviewMode()&&(t[j.SKIPCOREHEADERS]=!0),$i(fc(c,{method:l,headers:t},a,{includeRemoteSystemIdIfPresent:!!o})).pipe(Wl((t=>r?{actionInPayload:e}:{response:t.data,actionInPayload:e,headers:bc(t.headers)})),Zl(": Error occurred during ajax call at release lock request : ",a))},vy=(e,t)=>{const{isModalAction:n}=t;return Oy({routeKey:"cancelAssignment",isModalAction:n,...e})},xy=e=>{let t=0,n=[];return e.pipe(Bl(by),Wl((e=>(({actionMgrID:t}=e.payload),e.payload))),Hl((e=>{const{isModalAction:n}=e;e.context||(e.context=Id(e.containerItemID));const{context:r}=e,s=(e=>{const{isModalAction:t,containerItemID:n}=e;return t?sd.MODAL:zr(n)})(e),a=mt(s,r),{continueExecution:o}=$c(a);return o?(e.RemoteSystemID=$.getRemoteHeaderByContext(e.context)??void 0,vy(e,{isModalAction:n})):(ln.rejectActionByID(t),Ql())})),Hl((async e=>{if(e&&e.type===Ee)return n.push(Uc(e)),n;const{actionInPayload:r,response:s}=e,{containerItemID:a,isModalAction:o,isInCreateStage:i}=r;s&&(s.data.caseInfo.availableProcesses=s.data.caseInfo.availableProcesses??[]);const c=wd(a),l=Id(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:Id(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})),Wl((()=>(ch(n),cs(n,t),n=[],n))))},wy="NAVIGATE_TO_STEP",My=(e,t)=>{const{ID:n,stepID:r,containerItemID:s,context:a=Id(s),isInCreateStage:o}=e,{state$:i}=t,c={ID:n,stepID:r,viewType:o?Dc.PAGE:Dc.FORM},{restApi:l,reqType:u}=Ng("navigateToStep",c),{content:d}=Oc(a),p=i.value.data[a].caseInfo.headers;return $i(fc(`${l}`,{method:u,body:d,headers:{"if-match":p&&p.etag}},a)).pipe(Wl((t=>({response:t.data,actionInPayload:e,headers:bc({...p,...t.headers})}))),Zl("Error occurred during ajax call at navigateToStep Epic : ",a))},{RESOURCE_TYPES:Ly}=F,Uy=(e,t)=>{let n=0,r=[];return e.pipe(Bl(wy),Gl((e=>(({actionMgrID:n}=e.payload),Kl(e.payload).pipe(Hl((e=>(Jn(e.context),My(e,{state$:t})))),Hl((async e=>{if(e&&Xr(e.type))return r.push(Uc(e)),r;const{actionInPayload:t,response:n,headers:s}=e,{containerItemID:a,context:o=Id(a),isModalAction:i}=t;bu.clearContextedCache(t.context);const c=wd(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;d&&!d.pyViewName&&p&&"page"!==t.viewType&&Sh.setIn(d,"pyViewName",p);const h=Pm(n),g={acName:c,...u};await xc(h,t,g);const f=vc(h,{...u,headers:s});n?.nextAssignmentInfo||(f.caseViewMode=j.REVIEW_MODE),f.doDeleteCaseSummary=t.doDeleteCaseSummary,f.resourceType=Ly.ASSIGNMENT,os(f,h),is(f.data,t);const m=h.data?.caseInfo?.stages,y=h.data?.caseInfo?.stageID;return Wr({caseID:ns(h),isModalAction:i,stages:m,stageID:y}),as(a)&&qc(f,r),r.push(og(zh,f)),Wc(r),r})),Wl((()=>(ch(r),cs(r,n),r=[],r))))))))},Fy=e=>{const{caseID:t,context:n}=e,{restApi:r,reqType:s}=Ng("deleteCaseInCreateStage",{ID:t});return $i(fc(r,{method:s},n)).pipe(Wl((t=>({response:t.data,actionInPayload:e,headers:bc(t.headers)}))),Zl(": Error occurred during ajax call at deleteCaseInCreateStage Epic : ",n))},jy=e=>{Gr.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_DELETED,e)},Vy=(e,t)=>{let n,r=0,s=[];return e.pipe(Bl(Ul),Wl((e=>(({actionMgrID:r,caseType:n}=e.payload),e.payload))),Hl((e=>e.ignoreCaseDeletion?Kl({actionInPayload:e}):Fy(e))),Hl((async e=>{if(e&&Xr(e.type)){const{payload:t}=e,n=Uc({...e,...t,actionMgrID:r});return s.push(n),s}const{actionInPayload:n}=e,{context:a,isModalAction:o}=n,i=o?sd.MODAL:sd.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 xc({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})),Wl((()=>(ch(s),cs(s,r)===j.PROMISE_VALUE.RESOLVE&&jy({caseType:n}),s=[],s))))},ky=(e,t)=>{const{assignmentID:n,actionID:r,context:s}=e,{restApi:a,reqType:o}=Ng("save",{assignmentID:n,actionID:r}),{content:i}=Oc(s),c=t.value.data[s]?.caseInfo?.headers;let l={};return dp.getPerformanceDashboardVisibility()&&(l=Bm.getActionInfo(j.TOP_ACTION_LABEL.SAVEANDCLOSE)),$i(fc(a,{method:o,body:i,headers:{"if-match":c&&c.etag}},s,l)).pipe(Wl((t=>({response:t.data,actionInPayload:e,headers:bc(t.headers)}))),Zl(": Error occurred during ajax call at saveAndCloseAssignment Epic at save action : ",s))},$y=(e,t=!1)=>{const{action:n,state$:r,actionMgrID:s}=e;let a=[];return Kl(n.payload).pipe(Hl((e=>ky(e,r))),Hl((e=>{if(e&&Xr(e.type))return Kl(e);const{containerItemID:t}=e&&e.actionInPayload,r=W(t),s=wd(r),o=od(s),i=fd(s);if(n.payload.canUpdateAvailableActions&&Nm(e.response),o?.items?.[i]?.key===e?.actionInPayload?.caseID){const n={context:r,data:{...e.response.data}},s=Nc.getPropertiesToReplace(t);a.push(og(wh,n,{propertiesToReplace:s})),a.push(og(zh,{context:t}));const o={context:t,data:{caseInfo:{headers:e.headers}}};a.push(og(wh,o))}return ds(e,a),e.actionInPayload.RemoteSystemID=$.getRemoteHeaderByContext(e.actionInPayload.context)??void 0,Oy(e.actionInPayload)})),Hl((async n=>{if(n&&Xr(n.type)){const{payload:t}=n,r=Uc({...n,...t,actionMgrID:s});a.push(r);const o=e.action.payload.modalLoadingContainer;if(o){const e=o.context,{context_data:t}=lh(e)||{};t?.isLoading&&Md(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})),Wl((()=>(ch(a),cs(a,s),t||(a=[]),a))))},By=(e,t)=>{let n,r=0;return e.pipe(Bl(Fl),Gl((e=>{const{saveOnly:s}=e.payload;({actionMgrID:r,caseType:n}=e.payload);return $y({action:e,state$:t,actionMgrID:r,caseType:n},s)})))},Gy=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:Wy}=j,{RESOURCE_TYPES:Hy}=F,qy=(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===Wy.CASE_WIDE||t===Wy.EXPRESS?Ye:qe})(e),d=Dc.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 $i(fc(h,{method:p,headers:c},g)).pipe(Wl((t=>({response:t.data,actionInPayload:e,headers:bc(t.headers)}))),Zl(`: Error occurred during ajax call at ${o} Epic : `,g))},zy=(e,t)=>{const{isProcessAction:n}=t,r=n?ze:qe;e.openActionType=r;let s;if("modal"===qr(r,e)){s=_d(e.contextName)[0]?_d(e.contextName):wd(e.contextName);const n=s?fd(s):e.contextName,r=Id(n),a=qr(e.openActionType,e),o=mt(a,e.context),i=K(e.context,H(a,e.context));if(ch($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}}})),ch(Yh({context:i})),e.modalLoadingContainer={target:o,context:i},!_d(e.contextName)[0])return qy(e,t);if(!e.continueExecution)return qy(e,t);if(!Rl(r))return qy(e,t);e.saveActionPayload.modalLoadingContainer=e.modalLoadingContainer,e.saveActionPayload.canUpdateAvailableActions=!e.saveActionPayload.isModalAction;return $i([jl(e.saveActionPayload)]).pipe(Hl((e=>(e=>{let t,n=0;const r=[],s={value:ih()?.getState()};return Kl(e).pipe(Bl(Fl),Gl((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),Kl([])}return $y({action:e,state$:s,actionMgrID:n,caseType:t,actionsOut:r},!0)})))})(e))),Hl((n=>{if(1===n.length&&Xr(n[0].type)){const{continueExecution:n}=$c(s);if(!n)return ln.rejectActionByID(e.actionMgrID),Jl.pipe(Bi((()=>Ql()))).toPromise();if(n)return qy(e,t)}return qy(e,t)})),Wl((e=>e)))}return qy(e,t)},Yy=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;!Pd(d)||Nd(d)&&!dd(d,e.data.caseInfo.ID)?(h=H(u,s),Kr(u)&&(h=K(s,h)),p=h,g=!0):(p=Nd(d)?pd(d,e.data.caseInfo.ID):fd(d),h=Id(p));const f={acName:d,target:d,containerName:u,context:h};await xc(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=vc(l,{target:d,context:h,containerItemID:p,caseViewMode:y,doDeleteCaseSummary:i,headers:n,actionName:a,isMinimizable:!1,isInCreateStage:Kr(u),resourceType:Hy.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(t.push(og(E,I)),g||t.push(og(Kh,I)),g){const s=_d(r.contextName),a=pd(s,e.data.caseInfo.ID);if(a){const e={data:{caseInfo:{headers:n}},context:a};t.push(og(wh,e))}}return p!==fd(d)&&t.push(og(Jh,{target:d,containerItemID:p})),as(p)&&!c?.context&&qc(I,t),I.caseViewMode===j.REVIEW_MODE&&t.push(og(Zh,I)),t},Ky="OPEN_LOCAL_ACTION",Xy=(e,t)=>zy(e,t),Jy=e=>{let t=0,n=[];return e.pipe(Bl(Ky),Wl((e=>(({actionMgrID:t}=e.payload),e.payload))),Hl((e=>Xy(e,{actionMgrID:t}))),Hl((async e=>{if(!e)return Jl;if(Xr(e.type)){const t=Uc(e);n.push(t);const{context_data:r}=lh(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 Yy(s,n,{headers:r,actionInPayload:t}),Gy(t),n})),Wl((()=>(ch(n),cs(n,t),n=[],n))))},Qy=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 $i(fc(l,{method:c},n)).pipe(Wl((t=>({response:t.data,actionInPayload:e,headers:bc(t.headers)}))),Zl(`: Error occurred during ajax call at ${r} Epic : `,n))},Zy=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},eI="OPEN_BULK_ACTION",tI=e=>{let t=0,n=[];return e.pipe(Bl(eI),Wl((e=>(({actionMgrID:t}=e.payload),e.payload))),Hl((e=>((e,t)=>{const{context:n}=e,{actionMgrID:r}=t;e.openActionType=Ke;const s=qr(Ke,e),a=mt(s,n),{continueExecution:o}=$c(a);return o?Qy(e):(ln.rejectActionByID(r),Ql())})(e,{actionMgrID:t}))),Hl((async e=>{if(e&&Xr(e.type)){const t=Uc(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 Yy(s,n,{headers:r,actionInPayload:t}),Zy(t),n})),Wl((()=>(1===n.length&&Xr(n[0].type)?ln.rejectActionByID(t):ln.resolveActionByID(t),ch(n),n=[],n))))};var nI=Array.isArray,rI=Object.getPrototypeOf,sI=Object.prototype,aI=Object.keys;function oI(e){if(1===e.length){var t=e[0];if(nI(t))return{args:t,keys:null};if((r=t)&&"object"==typeof r&&rI(r)===sI){var n=aI(t);return{args:n.map((function(e){return t[e]})),keys:n}}}var r;return{args:e,keys:null}}var iI=Array.isArray;function cI(e){return Wl((function(t){return function(e,t){return iI(t)?e.apply(void 0,Wo([],Go(t))):e(t)}(e,t)}))}function lI(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=function(e){return Ko(zl(e))?e.pop():void 0}(e),r=oI(e),s=r.args,a=r.keys,o=new Ci((function(e){var t=s.length;if(t)for(var n=new Array(t),r=t,o=t,i=function(t){var i=!1;vi(s[t]).subscribe(Li(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(cI(n)):o}const uI=e=>{const{actionID:t,context:n,cases:r,classID:s}=e,{content:a}=Oc(n,{nonEmptyAndChangedData:!0});let o=5;try{const e=Gu.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($i(fc(d,{method:u,body:a},n)).pipe(Wl((t=>{const{data:n,headers:r}=t;return{response:n,actionInPayload:e,headers:bc({...r})}})),Zl("Error occurred during ajax call at submitbulkaction Epic : ",n)));return lI(p)},dI=e=>{Gr.publish(j.PUB_SUB_EVENTS.EVENT_BULKACTION,e)},pI="SUBMIT_BULK_ACTION",hI=e=>{let t,n=0,r=[],s="";return e.pipe(Bl(pI),Gl((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),Kl([])}return Kl(e.payload).pipe(Hl((e=>(t=e,uI(t)))),Hl((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`,dI({submitResponse:e}),t.target=`${j.APP.APP}/${sd.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})),Wl((()=>(ln.resolveActionByID(n,s),ch(r),r=[],r))))})))},gI=e=>{const{actionID:t,context:n,cases:r}=e,{content:s}=Oc(n,{nonEmptyAndChangedData:!0});s.cases=r.map((e=>({ID:e})));const a=Xe,{reqType:o,restApi:i}=Ng(a,{actionID:t,runningMode:"async"});return $i(fc(i,{method:o,body:s},n)).pipe(Wl((t=>{const{data:n,headers:r}=t;return{response:n,actionInPayload:e,headers:bc({...r})}})),Zl("Error occurred during ajax call at submitbulkaction Epic : ",n))},fI=e=>{Gr.publish(j.PUB_SUB_EVENTS.EVENT_BULKACTION,e)},mI="SUBMIT_BULK_ACTION_ASYNC",yI=e=>{let t,n=0,r=[],s="";return e.pipe(Bl(mI),Gl((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),Kl([])}return Kl(e.payload).pipe(Gl((e=>(t=e,gI(t)))),Wl((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",fI({submitResponse:i}),t.target=`${j.APP.APP}/${sd.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})),Wl((()=>(ln.resolveActionByID(n,s),ch(r),r=[],r))))})))},II=(e,t)=>zy(e,t),EI=e=>{let t=0,n=[];return e.pipe(Bl(Ml),Wl((e=>(({actionMgrID:t}=e.payload),e.payload))),Hl((e=>(Jn(e.context),II(e,{actionMgrID:t,isProcessAction:!0})))),Hl((async e=>{if(e&&Xr(e.type)){const t=Uc(e);return n.push(t),n}const{actionInPayload:t,headers:r,response:s}=e;return await Yy(s,n,{headers:r,actionInPayload:t}),n})),Wl((()=>(zc(n),cs(n,t),n=[],n))))},AI=e=>{let t=0,n=[];return e.pipe(Bl(Se,Me),Wl((e=>(({actionMgrID:t}=e.payload),e.payload))),Hl((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?Oy(e):t!==r||s||a||!u?t?.includes(j.MODAL)&&ps(ep(t))===j.REVIEW_MODE?Oy(e):Kl([]):Oy(e)})),Hl((e=>(e&&Xr(e.type)&&n.push(Uc(e)),n))),Wl((()=>(ch(n),cs(n,t),n=[],n))))};var _I=new ef(Xg),CI=_I;function SI(e,t,n){void 0===e&&(e=0),void 0===n&&(n=CI);var r=-1;return null!=t&&(ql(t)?n=t:r=t),new Ci((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 TI(e,t){return void 0===e&&(e=0),void 0===t&&(t=_I),e<0&&(e=0),SI(e,e,t)}function NI(e){return Mi((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(Li(n,(function(t){null==a||a.unsubscribe(),r=!0,s=t,a=Li(n,o,oi),vi(e(t)).subscribe(a)}),(function(){o(),n.complete()}),void 0,(function(){s=a=null})))}))}const PI=(e,t,n,r,s)=>{if(s!==j.RESOURCE_STATUS.CREATE)return;Qc.isStateMachineExist(e,t,n)||Qc.setStateMachine(e,n,t,new cr(n,t,e));Qc.getStateMachine(e,t,n).insert({},r+1,!0,{isDefault:!0})},DI=e=>{const{context:t}=e;let n={...Oc(t).content,contextData:!1};const r=Kc(t);Sh.isEmpty(r)||(n=Yc(r,n));const{restApi:s,reqType:a}=Ng("refreshCaseView",e);return n.interestPage=e.interestPage,$i(fc(s,{method:a,body:n},t)).pipe(Wl((t=>({actionInPayload:e,response:t.data,headers:bc(t.headers)}))),Zl(": Error occurred during ajax call : ",t))},RI=e=>{let t=0,n=[],r="";return e.pipe(Bl(pt),Wl((e=>(({actionMgrID:t}=e.payload),e.payload))),Hl((e=>DI(e))),Hl((async e=>{if(e&&e.type===Ee)return n.push(Uc(e)),{actionsOut:n,actionInPayload:{skipPageInstructions:!0}};const{actionInPayload:t,response:s}=e,a=t.containerName,o=mt(a,t.context);let i=jc(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=lh(t.context)?.context_data?.caseInfo,d=`${t.pageReference}${t.targetProperty}`,p=Gn(u,d.replace(F.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={acName:o,context:i};await xc(c,t,h);const g=vc(c,{target:o,context:i,containerItemID:i});g.resourceStatus=t.actionType,g.isMultiRecordData=!0,g.parentContext=t.context,g.heading=t.heading;const f=Fc(o,g);return r=i,n.push(f),Wc(n),{actionsOut:n,actionInPayload:t}})),Wl((({actionInPayload:e})=>(Jr(n)?ln.rejectActionByID(t):ln.resolveActionByID(t),ch(n),n=[],e.skipPageInstructions||PI(r,e.pageReference,e.targetProperty,e.index,e.actionType),n))))},bI=e=>{let t,n="",r=[];return e.pipe(Bl(ht),Gl((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),xu.handleDeferredActionCompletion(e.payload.context),Kl([])}return Kl(e.payload).pipe(Hl((e=>(t=e,DI(t)))),Hl((async e=>{if(e&&e.type===Ee){const t=Uc(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);Qc.isStateMachineExist(o,i,t)||Qc.setStateMachine(o,t,i,new cr(t,i,o));const n=Qc.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})),Wl((()=>{if(Jr(r))ln.rejectActionByID(n),xu.handleDeferredActionCompletion(t.context);else{ln.resolveActionByID(n),xu.handleDeferredActionCompletion(t.context);const{pageReference:r}=e.payload;if(Dh.getPropertyValue(j.CONTEXT_DATA_MODAL_VIEW.IS_MULTI_RECORD_DATA,r,t.parentContext)){const e=Dh.getPropertyValue(F.CASE_INFO.CASE_INFO_ID,r,t.parentContext),n=Dh.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 ch(r),r=[],r})))})))},OI=e=>{const{caseID:t,headers:n,debugInfo:r,context:s}=e,a=Ng("getDescendants",{caseID:t}),{restApi:o}=a,{reqType:i}=a;let c={};return dp.getPerformanceDashboardVisibility()&&(c=Bm.getActionInfo(j.TOP_ACTION_LABEL.GETDESCENDANTS)),$i(fc(o,{method:i,headers:{...n,...r&&{...ac.addDebugHeaders(r)}}},s,c)).pipe(Wl((t=>({actionInPayload:e,response:t.data,headers:bc({...n,...t.headers})}))),Zl("Error ocurred during ajax call at getDescendants Epic : ",s))},vI=e=>{let t=0,n=[];return e.pipe(Bl(vu),Wl((e=>(({actionMgrID:t}=e.payload),e.payload))),Hl((e=>OI(e))),Hl((async e=>{if(e&&Xr(e.type))return n.push(Uc(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})),Wl((()=>(ch(n),cs(n,t),n=[],n))))},xI=[ty,ly,gy,Jy,tI,hI,yI,EI,Ry,Uy,xy,AI,By,Vy,e=>e.pipe(Bl(He),NI((()=>TI(100))),Wl((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(Bl(Le),NI((()=>TI(100))),Wl((e=>{const{actionMgrID:t,context:n,containerName:r,containerItemID:s}=e.payload,a=mt(r,n);return ln.resolveActionByID(t),ch(og(Jh,{containerItemID:s,target:a,doDeleteCaseSummary:!1})),[]}))),RI,bI,vI],wI=xI;function MI(){return Mi((function(e,t){e.subscribe(Li(t,oi))}))}const{RESOURCE_TYPES:LI}=F,UI=[e=>e.pipe(Bl(te),Wl((e=>e.payload)),Hl((e=>{const t={caseID:e.caseId,viewID:e.viewName,caseClassName:e.caseClassName,RemoteSystemID:e.RemoteSystemID};if(e.containerName===sd.PREVIEW&&e.context&&e.caseId&&!e.updateData){const t=mt(sd.PREVIEW,e.context),n=jc(t,sd.PREVIEW,e.context,{buildNew:!0}),r=decodeURI(e.caseId);ch($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===LI.PAGE&&({restApi:r,reqType:s}=Ng(je,{page:e.viewName,pageClass:e.pageClass})),$i(fc(r,{method:s,headers:n},e.context)).pipe(Wl((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:bc(t.headers),rootView:Sh.getIn(r,j.ROOT)}})),Zl(": Error ocurred during ajax call at loadView Epic : ",e.viewLoadingContainer?.context??e.context))})),Hl((async e=>{const t={};if(e?.type===Ee){if(t.actionsOut=Uc(e),e?.payload?.context?.includes(sd.PREVIEW)){const n={...lh(e.payload.context),caseInfo:{progress:!1,error:!0}},r=mt(sd.PREVIEW,e.payload.context);t.actionsOut=og(zh,{key:n.key,target:r,containerName:sd.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===sd.PREVIEW&&n?e.context:jc(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 xc(u,n,l);const d={...n,target:i,context:c,containerItemID:a||c,headers:s},p=vc(u,d);if(p.resourceType=LI.CASE,o&&!p.updateData){p.caseViewMode=j.REVIEW_MODE;const e=wd(p?.context);((e,t,n,r,s)=>{e&&s===sd.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})})(pd(e,p.key),e,p,t,o)}else p.preserveClientChanges=!0,t.actionsOut=[],o===sd.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})),Wl((({rootView:e,actionsOut:t,actionMgrID:n=0})=>(ln.resolveActionByID(n,e),t)))),e=>{let t=0,n=[];return e.pipe(Bl(ne),Wl((e=>(({actionMgrID:t}=e.payload),e.payload))),Hl((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&&{...ac.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}=Gc(LI.PAGE,l,{semanticURL:u});if(t)return Kl({type:ve,activateContainerActionPayload:n,actionConfig:e})}if(fd(l)&&({continueExecution:p,removeActionPayload:d}=$c(l)),!p)return ln.rejectActionByID(t),Ql()}const{restApi:h,reqType:g}=Ng(je,{page:s,pageClass:a});return $i(fc(h,{method:g,headers:c},r)).pipe(Wl((t=>{let n={};return n="string"==typeof t.data?JSON.parse(t.data):t.data,{response:{...n,key:u,semanticURL:u},actionConfig:e,headers:bc(t.headers),removeActionPayload:d,skipSemanticUrl:o}})),Zl(": Error ocurred during ajax call at showPage Epic : ",e.context))})),Hl((async e=>{if(e&&e.type===Ee)return n.push(Uc(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=pd(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:Id(s)};r.isTraditionalRemoteCase||await xc({directUrlUpdation:!0,semanticURL:t},r,a,!0),n.push(og(Jh,{target:o,containerItemID:s}))}else{const t=jc(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 xc(d,r,p);const g={target:o,context:t,containerItemID:t,headers:l,debugInfo:r.debugInfo,currentCaseViewMode:h},f=vc(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=Nc.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(Nc.getRemoteCaseKey(t.assignmentID,t.insKey))}},n.isTraditionalRemoteCase=!0,n.className=t.className)})(r,i,f),f.data??={},f.data.traditionalGadgetId=Nc.getUniqueGadgetId();const m=Fc(o,f);u.containerItemID&&Vc(m)&&n.push(og(Zh,{containerItemID:u.containerItemID,target:o})),n.push(m),Wc(n)}return Gr.publish(F.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_DONE,{target:o,pageName:e.actionConfig.viewName,pageClass:e.actionConfig.className}),n})),Wl((()=>{ln.resolveActionByID(t),ch(n),n=[]})),MI())}],FI=UI;const jI=(e,t)=>{const{context:n,pageName:r,dataContext:s,dataContextParameters:a,semanticURL:o,skipSemanticUrl:i}=e,{removeActionPayload:c}=t,{restApi:l,reqType:u,body:d}=Ng(Ve,{pageName:r,dataContext:s,dataContextParameters:a});let p={};return dp.getPerformanceDashboardVisibility()&&(p=Bm.getActionInfo(j.TOP_ACTION_LABEL.SHOWDATA)),$i(fc(l,{method:u,body:d},n,p)).pipe(Wl((t=>({response:{...t.data,key:o,semanticURL:o},actionConfig:e,headers:bc(t.headers),removeActionPayload:c,skipSemanticUrl:i}))),Zl("Error occurred during ajax call at showData Epic : ",e.context))},{RESOURCE_TYPES:VI}=F,kI=e=>{let t,n=0,r=[];return e.pipe(Bl(re),(s=e=>(({actionMgrID:n}=e.payload),Kl(e.payload).pipe(Hl((e=>((e,t)=>{const{context:n,pageName:r,dataContext:s,dataContextParameters:a,skipSemanticUrl:o=!1,isDeferLoaded:i=!1,parentAction:c="",resourceType:l}=e;let{containerName:u}=e;u||(u=kr.getTargetViewContainerName(ne));const d=mt(u,n);let p="",h={},g=!1;if(!o){p=Sg(Ve,{pageName:r,dataViewName:s},a);const{activate:n,activateContainerActionPayload:o}=Gc(VI.PAGE,d,{semanticURL:p});if(n)return Kl({type:ve,activateContainerActionPayload:o,actionConfig:e});if(({continueExecution:g,removeActionPayload:h}=$c(d)),!g)return ln.rejectActionByID(t),Ql()}return jI({context:n,pageName:r,dataContext:s,dataContextParameters:a,semanticURL:p,skipSemanticUrl:o,containerName:u,isDeferLoaded:i,parentAction:c,resourceType:l},{removeActionPayload:h})})(e,n))),Hl((async e=>{if(e&&e.type===Ee)return r.push(Uc(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 xc(p,s,t);const n={target:d,headers:a,context:s.context,containerItemID:e.containerItemID},c=vc(p,n);return r=og(wh,c),r}if(n===ve){const{activateContainerActionPayload:{semanticURL:t,containerItemID:n}}=e,a={acName:d,context:Id(n)};await xc({directUrlUpdation:!0,semanticURL:t},s,a,!0),r.push(og(Jh,{target:d,containerItemID:n,resourceType:VI.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=jc(d,c,s.context),{removeActionPayload:n}=e;p=Pm(o),p.directUrlUpdation=!i;const l={acName:d,context:t};await xc(p,s,l);const u=vc(p,{target:d,context:t,containerItemID:t,headers:a,currentCaseViewMode:h});u.resourceType=VI.DATA;const g=Fc(d,u);n.containerItemID&&Vc(g)&&r.push(og(Zh,{containerItemID:n.containerItemID,target:d})),Wc(r),r.push(g)}return r})),Wl((()=>(ln.resolveActionByID(n,t),ch(r),r=[],r))))),Ko(a)?Hl(s,a,1):Hl(s,1)));var s,a},$I=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 $i(fc(a,{method:o},n)).pipe(Wl((t=>({response:t.data,actionInPayload:e}))),Zl("Error occurred during ajax call at deleteDataObject Epic",n))},BI=e=>{let t=0,n=[];return e.pipe(Bl(it),eu(100),Wl((e=>(({actionMgrID:t}=e.payload),e.payload))),Hl((e=>$I(e))),Hl((async e=>{if(e&&e.type===Ee){const{payload:r}=e,s=Uc({...e,...r,actionMgrID:t});return n.push(s),n}return[]})),Wl((()=>(1===n.length&&Xr(n[0].type)?ln.rejectActionByID(t):ln.resolveActionByID(t),ch(n),n=[],n))))},GI=e=>{const{dataViewID:t,dataViewParameters:n,context:r}=e,s={data_view_ID:t},{restApi:a,reqType:o}=Ng("getDataObjectActions",s);return $i(fc(a,{method:o,body:{dataViewParameters:n}},r)).pipe(Wl((e=>({...e.data}))),Zl("Error occurred during ajax call at GET data object actions : ",e.context))},WI=e=>{let t=0,n=[];let r={};return e.pipe(Bl(ye),eu(100),Wl((e=>(({actionMgrID:t}=e.payload),e.payload))),Hl((e=>GI(e))),Hl((async e=>e&&e.type===Ee?(n.push(Uc(e)),n):(r=e,[]))),Wl((()=>(1===n.length&&Xr(n[0].type)?ln.rejectActionByID(t):ln.resolveActionByID(t,r),ch(n),n=[],n))))},HI=[kI,e=>{let t=0,n=[];return e.pipe(Bl(ot),eu(100),Gl((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),Kl([])}return Kl(e.payload).pipe(Hl((e=>tu(e))),Hl((async e=>{if(e&&e.type===Ee){const{payload:r}=e,s=Uc({...e,...r,actionMgrID:t});return n.push(s),n}const{actionInPayload:r}=e,{containerItemID:s,isModalAction:a}=r,o=a?sd.MODAL:sd.PRIMARY,i={target:mt(o,s),containerItemID:s,context:s};return n.push(og(Zh,i)),n})),Wl((()=>(1===n.length&&Xr(n[0].type)?ln.rejectActionByID(t):ln.resolveActionByID(t),ch(n),n=[],n))))})))},e=>{let t=0,n=[];return e.pipe(Bl(ct),eu(100),Wl((e=>(({actionMgrID:t}=e.payload),e.payload))),Hl((e=>nu(e))),Hl((async e=>{if(e&&e.type===Ee){const{payload:r}=e,s=Uc({...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=jc(i,o,r.context),l={acName:i,context:c};await xc(s,r,l);const u=vc(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})),Wl((()=>(1===n.length&&Xr(n[0].type)?ln.rejectActionByID(t):ln.resolveActionByID(t),ch(n),n=[],n))))},e=>{let t=0,n=[];return e.pipe(Bl(lt),eu(100),Gl((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),Kl([])}return Kl(e.payload).pipe(Hl((e=>ru(e))),Hl((async e=>{if(e&&e.type===Ee){const{payload:r}=e,s=Uc({...e,...r,actionMgrID:t});return n.push(s),n}const{actionInPayload:r}=e,{containerItemID:s,isModalAction:a}=r,o=a?sd.MODAL:sd.PRIMARY,i={target:mt(o,s),containerItemID:s,context:s};return n.push(og(Zh,i)),n})),Wl((()=>(1===n.length&&Xr(n[0].type)?ln.rejectActionByID(t):ln.resolveActionByID(t),ch(n),n=[],n))))})))},BI,WI,e=>{let t=0,n=[];return e.pipe(Bl(ut),eu(100),Wl((e=>(({actionMgrID:t}=e.payload),e.payload))),Hl((e=>su(e))),Hl((async e=>{if(e&&e.type===Ee){const{payload:r}=e,s=Uc({...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 xc(s,r,h);const g=vc(s,p);return n.push(og($h,g)),n})),Wl((()=>(1===n.length&&Xr(n[0].type)?ln.rejectActionByID(t):ln.resolveActionByID(t),ch(n),n=[],n))))},e=>{let t=0,n=[];return e.pipe(Bl(dt),eu(100),Gl((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),Kl([])}return zn({context:s,stateObj:lh(s),clearContextMessages:!0}),Kl(e.payload).pipe(Hl((e=>au(e))),Hl((async e=>{if(e&&e.type===Ee){const{payload:r}=e,s=Uc({...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 xc(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=vc(n,t);i.resourceType=s||F.RESOURCE_TYPES.DATA;const c=X(o);e.push(og(Zh,i));const l=ph(".dataContext","dataInfo",c),u=ph(".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})),Wl((()=>(1===n.length&&Xr(n[0].type)?ln.rejectActionByID(t):ln.resolveActionByID(t),ch(n),n=[],n))))})))}],qI=HI;function zI(e,t){return void 0===t&&(t=_I),Mi((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(Li(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:YI,DATA:KI}}=F;let XI=[],JI=!1;const QI={},ZI=[e=>e.pipe(Bl(Ie),zI(200),Wl((e=>e.payload)),Hl((e=>{JI=!1,Gr.subscribe(F.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_STARTED,(()=>{JI=!0}));const t=rc.getPreviewMode()&&ac.addDebugHeaders({debugId:Sh.generateUniqueID()});QI.dataContext=e.payload.dataViewName,QI.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(Hc(s)){case YI:i={caseTypeID:c.caseTypeID,processID:c.processID,content:{}};break;case KI:i=QI;break;default:i=c}return $i(fc(o,{method:r,body:i,headers:{...l,...t}},n)).pipe(Wl((t=>({response:{...t.data},payload:e,headers:bc(t.headers)}))),Zl(": Error occurred during ajax call at historyEpic : ",e))}return $i(fc(o,{method:"GET",headers:{...l,...t}},i.substring(0,i.lastIndexOf("/")))).pipe(Wl((n=>({response:n.data,payload:e,headers:{...bc(n.headers),...t}}))))})),Hl((async e=>{if(JI)return XI;if(Gr.subscribe(F.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_STARTED,(()=>{JI=!0})),e&&e.type===Ee)return Uc(e);const{headers:t={},response:n,payload:r}=e,s=Pm(n,{[F.STOPMERGEACTIONS]:!n.nextAssignmentInfo}),a=r.options.acName,o=Td(a)&&Pd(a)?fd(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 gp.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=vc(s,c);return g=((e,t,n)=>{if(e===Pc.CASE){if(t?.caseInfo?.assignments&&t?.caseInfo?.assignments.length>0){const{key:e,flowName:r}=Mc(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})(Hc(e.payload.routeKey),{...n.data,semanticURL:l,caseViewMode:j.REVIEW_MODE},g),XI.push(Fc(a,g)),Wc(XI),XI})),Wl((()=>(JI||ch(XI),XI=[],JI=!1,XI))),Zl("Error occurred"))],eE=[e=>{let t=0,n=[];return e.pipe(Bl(se),Wl((e=>(({actionMgrID:t}=e.payload),e.payload))),Hl((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=up.getEndPointInfo(a));const{restApi:o,reqType:i}=Ng(ke,{...s?.payload||[],insightID:r});return $i(fc(o,{method:i},t)).pipe(Wl((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}})),Zl(": Error occurred during ajax call at showPage Epic : ",e.context))})),Hl((async e=>{if(e&&e.type===Ee)return n.push(Uc(e)),n;const{actionConfig:t,skipSemanticUrl:r}=e,s=kr.getTargetViewContainerName(ne),a=mt(s,t.context),o=jc(a,s,t.context),{response:i}=e,c=Pm(i);c.directUrlUpdation=!r;const l={acName:a,context:o},u=!r,d=r;await xc(c,t,l,u,d);const p=vc(c,{target:a,context:o,containerItemID:o});p.resourceType=F.PAGE;const h=Fc(a,p);return n.push(h),Wc(n),n})),Wl((()=>{ln.resolveActionByID(t),ch(n),n=[]})),MI())}],tE=[e=>{let t=0,n=[];return e.pipe(Bl(ae),Wl((e=>(({actionMgrID:t}=e.payload),e.payload))),Hl((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 $i(fc(a,{method:o},t)).pipe(Wl((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}})),Zl(": Error occurred during ajax call at showPage Epic : ",e.context))})),Hl((async e=>{if(e&&e.type===Ee)return n.push(Uc(e)),n;const{actionConfig:t,skipSemanticUrl:r}=e,s=kr.getTargetViewContainerName(ne),a=mt(s,t.context),o=jc(a,s,t.context),{response:i}=e,c=Pm(i);c.directUrlUpdation=!r;const l={acName:a,context:o},u=!r,d=r;await xc(c,t,l,u,d);const p=vc(c,{target:a,context:o,containerItemID:o});p.resourceType=F.PAGE;const h=Fc(a,p);return n.push(h)})),Wl((()=>{ln.resolveActionByID(t),ch(n),n=[]})),MI())}],nE=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,...wI,...FI,...ZI,...qI,...Mm,...[e=>{let t=0;return e.pipe(Bl(Ze),Wl((e=>(({actionMgrID:t}=e.payload),e.payload))),Wl((()=>{const e=ih()?.getState(),n=Cm();return h()(e,n)&&t>0?ln.resolveActionByID(t,{}):ln.rejectActionByID(t),[]})),MI())}],...eE,...tE),rE=()=>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)&&(tl(a||o),Pn.removeContextTreeNode(a||o)),e(t)},sE={},aE=e=>{const t=Sh.getIn(sE,[j.CONTEXT,e],[]),n=[];t.forEach((t=>{const r=t.substr(0,t.lastIndexOf("_")),s=Sh.getIn(sE,[r,t],[]),a=s&&s.length>0&&s.indexOf(e);if(a>-1&&s.splice(a,1),!s||s&&0===s.length){Sh.deleteIn(sE,[r,t]);const e=Sh.getIn(sE,[r]);e&&0===Object.keys(e).length&&Sh.deleteIn(sE,[r]),n.push({dataPageName:r,dataPageNameWithHash:t})}})),Sh.deleteIn(sE,[j.CONTEXT,e]);const r=Sh.getIn(sE,[j.CONTEXT]);(!r||r&&0===Object.keys(r).length)&&Sh.deleteIn(sE,[j.CONTEXT]),n.length>0&&ch(lg({dataPagesToBeRemoved:n}))},oE=(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(sE,[j.CONTEXT,n]);if(Sh.getIn(sE,[e])){const r=Sh.getIn(sE,[e,t],[]);Sh.setIn(sE,[e,t],[...new Set([...r,n])])}else Sh.setIn(sE,[e,t],[n]);r?Sh.setIn(sE,[j.CONTEXT,n],[...new Set([...r,t])]):Sh.setIn(sE,[j.CONTEXT,n],[t])})(n,e,t)}))}))},iE=()=>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=>{aE(e)})),a===Ce||a===fe||a===tt){const e=a===tt?n:n.shared;oE(e,r)}else a===Me?(aE(r),oE(n.shared,r)):a===Se&&aE(r);e(t)},cE=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=>{Ou.cleanCaches(e)})),r!==Me&&r!==Se||Ou.cleanCaches(o),t(n)},lE=()=>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===Re&&(Ir(r),fr(r)),e(t)},uE=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(Fi(n)),c=new of(o.pipe(Fi(n)),t.getState());return r.pipe(Wl((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})),Hl((function(e){return $i(e).pipe(ji(n),Fi(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}(),dE=e=>{const t=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||zg;if(null!==ih())_h();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}}}(vl,rE,iE,lE,uE,cE),cf.reduxBatch));uE.run(nE),oh(n)}};const pE=new class{#C;constructor(){this.userSettings={},this.componentCache={},this.contextMapToClearOnCancel={},this.#C=!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(qm("getUserSettings")){const{restApi:e,reqType:t}=Ng("getUserSettings");fc(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=()=>{dp.getUserSettings()?this.userSettings=dp.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(!qm("updateUserSettings"))return Promise.resolve("updateUserSettings route is not available");n=Ng("updateUserSettings");const{restApi:r,reqType:s}=n;return fc(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.#C){this.#C=!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))}},hE={publishConstellationLoadedEvent:()=>{Gr.publish(j.PUB_SUB_EVENTS.BOOTSTRAP_SHELL_EVENTS.CONSTELLATION_LOADED,{})}};const gE=new class{activateContainerItemOnSwitch(e){const t=`${j.APP.APP}/${j.PRIMARY}`,n={target:t,containerItemID:pd(t,e)};Zu({}).getPConnect().getContainerManager().activateContainerItem(n)}removeContainerItemOnClose(e){const t=`${j.APP.APP}/${j.PRIMARY}`,n={target:t,containerItemID:pd(t,e)};Zu({}).getPConnect().getContainerManager().removeContainerItem(n)}showCasePreview(e,t){const n=Zu({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}),hd(j.APP.APP,j.PREVIEW)||r.initializeContainers({type:"multiple",name:j.PREVIEW}),n.getPConnect().getActionsApi().showCasePreview(e,{caseClassName:t})}closeCasePreview(){Zu({}).getPConnect().getContainerManager().resetContainers({name:j.PREVIEW,context:j.APP.APP})}isFormDirty(e){const t=`${j.APP.APP}/${j.PRIMARY}`,n=Jd(t,e);return Jc.isStateModified(n)}getEventUtils(){return hE}getBroadcastUtils(){return Um}isTraditionalUICase(e){return ls(e)}};const fE=class{static openCase(e,t=F.APP.APP,n={}){return n.renderInline=!0,n.pageName?dp.setDefaultCasePage(n.pageName):(dp.setDefaultCasePage(j.PY_DETAILS),n.pageName=j.PY_DETAILS),n?.disableAssignmentHeader?dp.disableAssignmentHeader(n.disableAssignmentHeader):dp.disableAssignmentHeader(!1),ku.openCase(e,t,j.PRIMARY,n)}static createCase(e,t=F.APP.APP,n={}){return n.renderInline=!0,n.pageName?dp.setDefaultCasePage(n.pageName):(dp.setDefaultCasePage(j.PY_DETAILS),n.pageName=j.PY_DETAILS),n?.disableAssignmentHeader?dp.disableAssignmentHeader(n.disableAssignmentHeader):dp.disableAssignmentHeader(!1),ku.createCase(e,t,j.PRIMARY,n)}static getNextWork(e=F.APP.APP,t={}){return t.renderInline=!0,t.pageName?dp.setDefaultCasePage(t.pageName):(dp.setDefaultCasePage(j.PY_DETAILS),t.pageName=j.PY_DETAILS),t?.disableAssignmentHeader?dp.disableAssignmentHeader(t.disableAssignmentHeader):dp.disableAssignmentHeader(!1),ku.getNextWork(e,j.PRIMARY,t)}static openAssignment(e,t=F.APP.APP,n={}){return n.renderInline=!0,n.pageName?dp.setDefaultCasePage(n.pageName):(dp.setDefaultCasePage(j.PY_DETAILS),n.pageName=j.PY_DETAILS),n?.disableAssignmentHeader?dp.disableAssignmentHeader(n.disableAssignmentHeader):dp.disableAssignmentHeader(!1),ku.openAssignment(e,t,j.PRIMARY,n)}static openPage(e,t,n=F.APP.APP,r={}){const s=ne;r?.defaultCasePage?dp.setDefaultCasePage(r.defaultCasePage):dp.setDefaultCasePage(j.PY_DETAILS),r?.disableAssignmentHeader?dp.disableAssignmentHeader(r.disableAssignmentHeader):dp.disableAssignmentHeader(!1);const a={viewName:e,className:t,acTargetName:j.PRIMARY,actionMgrID:ln.getNextActionMgrId(),context:n},{promise:o}=ln.actionManagerPromise(s,a.actionMgrID);return ch({type:s,payload:{...a}}),o}static getCurrentContextAPI(e,t=F.APP.APP){return Zu({meta:{config:{}},options:{context:t,pageReference:e,containerName:j.PRIMARY}}).getPConnect()}};const mE=new class{createC11nEnv=e=>Zu(e);getContextUtils=()=>e;getRoutingManager=()=>t;getComponentsRegistry=()=>Xt;getStateManager=()=>c;getActionCreators=()=>l;getStreamObservable=()=>r;getActionProcessor=()=>bh;getActionHandler=()=>Rh;renderApp=(e,t)=>{const n={context:j.APP.APP},r={...Sh.getIn(e,j.ROOT),options:n};dE(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 xc(r,{},{},!1,!0);const i={...s,[j.CONTEXT_DATA]:o},{root:c}=a;Ld(c,t,i,n)};fetchEndPointResource=(e,t,n)=>{fc(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});ih()||dE({}),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&&Fp(s),a&&jp(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=ip(),r=up.processUrl(t,!0),s=up._getMatchedRouteInRoutingTable(r)||"",a=up.getRoutingInfo(),o=up.processUrl(t,!1).split("/"),i=o[o.length-1];let{caseID:c}=a&&a.routes[s].payload;c=c.replace("{workID}",i),n=up.getRestEndPoint("loadView",{caseID:c,viewID:e})||{}}else n=up.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;ih()||dE({}),a&&(Hd(`${j.APP.ROOT}/${o}`),Wd().deleteContainerItem(`${j.APP.ROOT}/${o}`)),Wd().getContainerItems()?.length>1&&!o?.startsWith("hybrid_")&&"authoring-preview"!==o&&_h(),ch(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();fd(`${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=>{Ac(e)};setFetchAuthInfo=e=>{_c(e)};getCaseApi=()=>ku;getMashupApi=()=>fE;enableAppRouting=e=>{_g(e)};initStore=()=>dE({});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=Zu({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 yE=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 IE=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 EE=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 IE(e.serviceConfig),this.behaviorOverrides=e.behaviorOverrides,this.initBroadcast=!!e.initBroadcast,this.cookieComplianceMethod=e.cookieComplianceMethod??"none",this.isExtraCallRequiredForDefaultHome=e.isExtraCallRequiredForDefaultHome??"false"}},AE=async()=>{const e=dp.getLocale(),t=dp.getFeatureMap().localizationVersion||1;let n;if("en-US"!==e)try{let r;2===t?r=[e]:(r=[gp.GENERIC_BUNDLE_KEY,gp.MESSAGE_BUNDLE_KEY,gp.FIELD_LABELS_BUNDLE_KEY,...gp.getCaseTypeLocaleReferences()],n=await gp.isCurrentLocalePackAvailable());const s=r.map((async r=>{2===t?await(async e=>{const t=dp.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 Wm("getLocalizationPack",{queryPayload:n});if((201===r.status||200===r.status)&&r.data){const e=r.data;Object.keys(e).forEach((t=>{gp.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();gp.setLocaleForRule(t,e)}})(r,e)}));await Promise.allSettled(s)}catch(e){console.warn(e)}},_E="@P .viewConfig";let CE=0;const SE=new class{#S(e,t,n){jg(e),kr.buildActionTargetMap(t),y(n)}init(e){const t=new EE(e),n={...t.environmentInfo,renderingMode:t.renderingMode};_g(t.enableRouting),dE({}),dp.setTheme(t.theme),dp.setCookieComplianceMethod(t.cookieComplianceMethod),dp.setIsExtraCallRequiredForDefaultHome(t.isExtraCallRequiredForDefaultHome),br.updateFieldDefaults(t.fieldDefaults),ac.setDefaultHeaders(t.additionalHeaders),this.#S(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),gp.setTimezone(t.timezone),dp.setEnvironmentInfo(n),dp.setLocale(t.locale),$.setRemoteCaseMapping(t.remoteCaseMapping),mu.setConnectionConfig({messagingService:t.serviceConfig.messagingService}),pE.init(),t.initBroadcast&&gE.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=Zu({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 mE.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"===dp.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)=>{CE+=1;const c=i||`mashup${CE}`,l={type:"RootContainer",config:{viewConfig:_E,renderingMode:"view",name:c}};mE.loadRootComponent(e,l,s,a,o).then((()=>mE.loadViewByName(t,n,r,c)))};launchView=(e,t,n=[],r,s,a,o)=>{CE+=1;const i="hybrid"===o?`hybrid_${CE}`:o;CE+=1;const c=i||`mashup${CE}`,l={type:"RootContainer",config:{viewConfig:_E,renderingMode:"portal",name:c}};yE.setRuntimeParams(r),mE.loadRootComponent(e,l,n,s,a).then((()=>mE.updateStoreWithUiRoot(t,c)))};launchPortal=(e,t,n,r=[])=>{CE+=1;const s=n||`portal${CE}`,a={type:"RootContainer",config:{viewConfig:_E,renderingMode:"portal",skeleton:"LoadingComponent",name:s}};r.push(a.config.skeleton),dp.isPortalLoaded=!0,mE.loadRootComponent(e,a,r).then((()=>mE.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)}}mE.loadRootComponent(e,n,[PCore.getConstants().LOAD_VIEW_STRING,"ViewContainer"]),window.parent!==window&&s(849)(`${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)=>{AE().then((async()=>{const t=mE.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")}},TE={createViewRule:(e,t)=>{const{restApi:n,reqType:r}=Ng("createViewRuleByID");return fc(n,{method:r,body:e},t).then((e=>e.data))},getViewRule:(e,t)=>{const{restApi:n,reqType:r}=Ng("getViewRuleByID",{ID:e});return fc(n,{method:r},t).then((e=>e.data))},updateViewRule:(e,t,n)=>{const{restApi:r,reqType:s}=Ng("updateViewRuleByID",{ID:e});return fc(r,{method:s,body:t},n).then((e=>e.data))},deleteViewRule:(e,t)=>{const{restApi:n,reqType:r}=Ng("deleteViewRuleByID",{ID:e});return fc(n,{method:r},t).then((e=>e.data))}},NE={"Content-Type":"application/json"},PE={addCaseFollower:(e,t,n)=>{const r={caseID:e},s=JSON.stringify({users:t.map((e=>({ID:e})))});return Wm("addCaseFollower",{body:s,queryPayload:r,headers:NE},n)},deleteCaseFollower:(e,t,n)=>Wm("deleteCaseFollower",{queryPayload:{caseID:e,followerID:t}},n),getCaseFollowers:(e,t)=>Wm("getCaseFollowers",{queryPayload:{caseID:e}},t).then((e=>e.data.followers))},DE={addRelatedCases:(e,t,n)=>{const r={caseID:e},s=JSON.stringify({cases:t});return Wm("addRelatedCases",{body:s,queryPayload:r},n)},removeRelatedCase:(e,t,n)=>Wm("removeRelatedCase",{queryPayload:{caseID:e,relatedCaseID:t}},n),getRelatedCases:(e,t)=>Wm("getRelatedCases",{queryPayload:{caseID:e}},t).then((e=>e.data.relatedCases))},RE="operatorDetails",bE={getOperatorDetails:(e,t=!1)=>{const{reqType:n}=Ng(RE,{});if("GET"===n){const t={encodedOperatorId:encodeURIComponent(`{"opname":"${e}"}`)};return Wm(RE,{queryPayload:t})}return t?Wm("operatorDetailsByBusinessID",{body:{dataViewParameters:{BusinessID:e}}}):Wm(RE,{body:{dataViewParameters:{ID:e}}})}},OE=async e=>{const t=Pm(e),n=Sh.getIn(t,j.COMPONENTS);wr(t,{},!0);const r=Sh.getIn(t,j.LOCALE_REFERENCES);await gp.loadLocaleResources(r||[]),await jr(n)},vE=(e,t,n)=>Dh.resolveView(e,t,n),xE={"Content-Type":"application/json"};const wE=new class{constructor(){this.mentionsTagsCancelTokenSource=[],this.mentions=[]}getFeeds=(e,t,n,r,s,a,o)=>{const{getLocaleValue:i}=gp;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=zm();return s.push(d),Wm("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 OE({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=>{Ym(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 Wm("postFeedMessages",{body:a,headers:xE},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 Wm("editFeedMessage",{queryPayload:{messageID:e},body:a,headers:xE},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});Wm(a,{body:o,queryPayload:{pulseContext:e},headers:xE},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);Wm("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)=>Wm("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=zm();return this.mentionsTagsCancelTokenSource.push(i),Wm("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=>{Ym(e)||t.reportError(": Error occurred during ajax call at getMentionSuggestions API : ",e.response.data)}))};getMentionTypes=e=>Wm("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=zm();return this.mentionsTagsCancelTokenSource.push(a),Wm("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=>{Ym(e)||t.reportError(": Error occurred during ajax call at getTagSuggestions API : ",e.response.data)}))}},ME={getTaggedCases:(e,t)=>Wm("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)=>Wm("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 Wm("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)=>Wm("deleteCaseTag",{queryPayload:{caseID:e,tagID:t}},n.getContextName()).catch((e=>{n.reportError(": Error occurred during ajax call at removeTag API : ",e.response)})),getTagsLandingPageURL:e=>Iu.getPageDataAsync("D_pxGetTagsLandingPageURL",e.getContextName(),{},{invalidateCache:!0}).catch((t=>{e.reportError(": Error occurred during ajax call getTagsLandingPageURL API : ",t.response)}))},LE=(e,t)=>{qd(t.getContextName(),e.etag),zd(t.getContextName(),e.etag)},UE={getParticipants:(e,t)=>Wm("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)=>Wm("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)=>Wm("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)=>Wm("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)=>{Wm("createParticipant",{body:a,queryPayload:s,headers:o},r.getContextName()).then((t=>{LE(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)=>{Wm("updateParticipant",{body:n,queryPayload:s,headers:a},r.getContextName()).then((t=>{LE(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)=>{Wm("deleteParticipant",{queryPayload:r,headers:s},n.getContextName()).then((t=>{LE(t.headers,n),e()})).catch((e=>{n.reportError(": Error occurred during ajax call at deleteParticipant API : ",e.response),t(e.response)}))}))}};function FE(e=[]){return e.reduce(((e,t)=>(e[t.personalizationID]={name:t.name,personalizationState:JSON.parse(t.personalizationState||"{}")},e)),{})}const jE="create",VE="update",kE="delete";function $E(e,t,n,r){const s=Wp(t);if(s){switch(e){case jE:case VE:{const{markAsDefault:e,...t}=r;Object.entries(t).length>0&&(s.allPersonalizations[n]=t),e&&(s.defaultPersonalization=n);break}case kE:delete s.allPersonalizations[n],s.defaultPersonalization===n&&(s.defaultPersonalization="");break;default:return null}return s}return null}const BE={},GE=e=>{const t=Wp(e);if(t)return Array.isArray(t.allPersonalizations)&&(t.allPersonalizations=FE(t.allPersonalizations)),Promise.resolve(t);const{restApi:n,reqType:r}=Ng("getUIListPersonalizations",{listID:e});return fc(n,{method:r,body:{}}).then((e=>{const{data:t}=e;return{allPersonalizations:FE(t.allPersonalizations),defaultPersonalization:t.defaultPersonalization}}))},WE=(e,t,n)=>{const{restApi:r,reqType:s}=Ng("createListPersonalization",{listID:e});return $E(jE,e,t,n),fc(r,{method:s,body:{...n,personalizationState:JSON.stringify(n.personalizationState)}}).then((e=>{const n=e.data;return BE[t]=n,e}))},HE=(e,t,n)=>{const r=BE[t]||t;$E(VE,e,t,n);const{restApi:s,reqType:a}=Ng("updateListPersonalization",{listID:e,personalizationID:r})||{};return fc(s,{method:a,body:{...n,personalizationState:JSON.stringify(n.personalizationState)}})},qE=(e,t)=>{const n=BE[t]||t;$E(kE,e,t);const{restApi:r,reqType:s}=Ng("deleteListPersonalization",{listID:e,personalizationID:n});return fc(r,{method:s,body:{}}).then((e=>(BE[t]&&delete BE[t],e)))};const zE=function(e){return e?{createPersonalization:WE.bind(null,e),updatePersonalization:HE.bind(null,e),deletePersonalization:qE.bind(null,e),fetchPersonalizations:GE.bind(null,e)}:{createPersonalization:()=>Promise.resolve(""),updatePersonalization:()=>Promise.resolve(),deletePersonalization:()=>Promise.resolve(),fetchPersonalizations:()=>Promise.resolve({})}},YE="getDataObjects",KE="getInsightByID",XE=["LocalList","RemoteList","PromptList","DataPage"];let JE=null;const QE={},ZE=e=>cu.getAppCacheKey(`PrimaryFields-${e}`);function eA(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 tA={getDataObjects:function(){const e=cu.getAppCacheKey(YE);if(window.sessionStorage.getItem(e))return Promise.resolve(JSON.parse(window.sessionStorage.getItem(e)));const{restApi:t,reqType:n}=Ng(YE,{}),r=fc(t,{method:n});return r.then((t=>{window.sessionStorage.setItem(e,JSON.stringify(t))})),r},getDataPageObjects:function(e=!0){if(JE)return JE;const t=cu.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 JE=fc(n,{method:r,datapageRequestType:"explorable"}),JE.then((e=>{JE=null,window.sessionStorage.setItem(t,JSON.stringify(e))})),JE},getDataViewMetadata:function(e,t,n){if(!t){const{sourceMetadata:t,sourceFields:n}=function(e){const t=Gp(e);if(t&&t.classID){let e=qp(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=Up(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&&XE.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:eA(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 bu.init(r).then((({dataSourceMetaData:e})=>Promise.resolve({data:e})))},getDefaultColumns:function(e){const t=cu.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=fc(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=Gp(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=cu.getAppCacheKey(`RDColumns-${e}`);if(window.sessionStorage.getItem(r))return Promise.resolve(JSON.parse(window.sessionStorage.getItem(r)));const s=cu.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=cu.getAppCacheKey(`PFColumns-${e}${t}`);if(window.sessionStorage.getItem(n))return Promise.resolve(JSON.parse(window.sessionStorage.getItem(n)));const r=cu.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=ZE(t);window.sessionStorage.getItem(o)||(QE[t]?r.push(QE[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=cu.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=ZE(e);window.sessionStorage.setItem(n,JSON.stringify(t))}))})).finally((()=>{e.forEach((e=>{delete QE[e]}))}));return e.forEach((e=>{QE[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=ZE(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 fc(e,{method:t})},getInsightByID:function(e){const t=Hp(e);if(t)return Promise.resolve({data:{pyInsights:[t]}});const n={insightID:e},{restApi:r,reqType:s}=Ng(KE,n);return fc(r,{method:s})},getInsightsByID:function(e){const t={insightID:e.join(",")},{restApi:n,reqType:r}=Ng(KE,t);return fc(n,{method:r})},createInsight:function(e){const{restApi:t,reqType:n}=Ng("createInsight");return fc(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 fc(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 fc(n,{method:r})},exportToExcel:function(e){const{restApi:t,reqType:n}=Ng("exportToExcel");return fc(t,{method:n,body:JSON.stringify(e)})},exportToCSV:function(e){const{restApi:t,reqType:n}=Ng("exportToCSV");return fc(t,{method:n,body:JSON.stringify(e)})},scheduleInsight:(e,t)=>{const n={insightID:e},{restApi:r,reqType:s}=Ng("scheduleInsight",n);return fc(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 fc(s,{method:a,body:JSON.stringify(n)})},deleteScheduledInsight:(e,t)=>{const n={insightID:e,scheduleID:t},{restApi:r,reqType:s}=Ng("deleteScheduledInsight",n);return fc(r,{method:s})},translateStrings:function(e){const{restApi:t,reqType:n}=Ng("translateStrings");return fc(t,{method:n,body:JSON.stringify(e)})}};const nA=new class{addRoutes=e=>{return t=e,void up.addRoutes(t);var t}};const rA=class{static registerModule(e,t,n){n[e]=()=>t}};const sA=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)},aA={getResolvedSemanticURL:(e,t,n)=>up.getResolvedSemanticURL(e,t,n),getActions:()=>({ACTION_OPENWORKBYHANDLE:Be,ACTION_SHOWDATA:Ve,ACTION_SHOWVIEW:je}),updateSemanticURLAndDocumentTitle:e=>up.updateSemanticURLAndDocumentTitle(e)};const oA=new class{constructor(){this.genericFailedMessage="Failed to display content. Contact the application administrator."}getGenericFailedMessage(){return this.genericFailedMessage}setGenericFailedMessage(e){this.genericFailedMessage=e}},iA={setTokens:e=>{_c({tokenInfo:e}),Ac(e?.csrf&&!e?.access_token?{pzCTkn:e?.csrf}:{Authorization:`${e?.token_type} ${e?.access_token}`}),setTimeout((()=>Gr.publish("updateSession",{updateStatus:"success"})),0)},revokeTokens:async()=>zi(),getAuthInstance:e=>qi.init(e),setAuthorizationHeader:e=>{Ac({Authorization:e}),setTimeout((()=>Gr.publish("updateSession",{updateStatus:"success"})),0)}};const cA=new class{getDebouncedSubject(e){return(new rf).pipe(zI(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=gp.getLocaleValue("Enter a valid email address","Messages")),t})),vr.register("integer",(e=>{let t=null;return e&&!/^(-)?\d+$/.test(e)&&(t=gp.getLocaleValue("Invalid number","Messages")),t})),vr.register("required",(e=>Array.isArray(e)&&0===e.length||null==e||""===e?gp.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=gp.getLocaleValue("Enter a valid url","Messages")),t})),setTimeout((()=>{s.e(531).then(s.bind(s,531)).then((({isPossiblePhoneNumber:e})=>{vr.register("phone",(t=>{let n=null;t&&!/^\+?\d+$/.test(t)&&(n=gp.getLocaleValue("Enter a valid phone number","Messages"));const r=t?.startsWith("+");if(t&&r){e(t)||(n=gp.getLocaleValue("Enter a valid phone number","Messages"))}return n}))}))}),j.PRIORITY.TRIVIAL);const lA=(e,t)=>{switch(t){case"invalid":return gp.getLocaleValue(`Incorrect ${e}`,"Messages");case"incomplete":return gp.getLocaleValue(`Incomplete ${e}`,"Messages");default:return null}};vr.register("datetime",(e=>lA("DateTime",e))),vr.register("date",(e=>lA("Date",e))),vr.register("time",(e=>lA("Time",e))),vr.register("attachment",((e,t)=>(ph(`.attachmentsList${t.pageReference?.replace("caseInfo.content","")}${t.property}`,"context_data",t.context)||[]).some((e=>e.props?.error))?gp.getLocaleValue("Error with one or more files"):null));const uA={createConversation:(e,t,n,r=[])=>{for(const e of r)e?.cancel&&"function"==typeof e.cancel&&e.cancel();const s=zm();r.push(s);const a={assistantID:t},o=JSON.stringify({contextID:e});return Wm("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 Wm("sendMessage",{body:a,queryPayload:s},r)}};const dA=class{caseTypeAccessMap=new Map;constructor(){this.caseTypeAccessMap=dp.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 pA{constructor(){pA.behaviorOverrides={}}static behaviorOverrides={};getPCoreVersion=()=>"24.2.1";onPCoreReady=e=>mE.onPCoreReady(e);onPCoreCleanup=e=>mE.onPCoreCleanup(e);getComponentsRegistry=()=>mE.getComponentsRegistry();checkIfSemanticURL=()=>mE.checkIfSemanticURL();isValidSemanticURL=()=>(()=>{if(Ug()){const e=up.processUrl(ip(),!0);return!!up._getMatchedRouteInRoutingTable(e)}return!1})();getRoutingUtils=()=>nA;getViewResources=()=>d;configureForBrowserBookmark=e=>mE.configureForBrowserBookmark(e);getStore=()=>ih();resetStore=()=>_h();getMessageManager=()=>Zn;getCoexistenceManager=()=>gE;getStoreValue=(e,t,n)=>ph(e,t,n);getContainerUtils=()=>o;getAnnotationUtils=()=>hl;getFieldUtils=()=>kn;getFieldDefaultUtils=()=>br;getAssetLoader=()=>Lr;getAttachmentUtils=()=>Sp;getViewRuleApi=()=>TE;getFeedUtils=()=>wE;getTagUtils=()=>ME;getGenAIAssistantUtils=()=>uA;getStakeholderUtils=()=>UE;getUserApi=()=>bE;getCaseFollowerApi=()=>PE;getCaseUtils=()=>Nc;getStateUtils=()=>Gu;getRelatedCasesApi=()=>DE;getPersonalizationUtils=zE;getDataApi=()=>bu;getDataApiUtils=()=>cu;getAnalyticsUtils=()=>tA;getLocaleUtils=()=>gp;registerLocaleManager=e=>{const t=this.getLocaleUtils();Object.keys(e).forEach((n=>{t[n]=e[n]}))};setBehaviorOverrides=e=>{pA.behaviorOverrides=e};setBehaviorOverride=(e,t)=>{pA.behaviorOverrides[e]=t};getBehaviorOverrides=()=>pA.behaviorOverrides;getBehaviorOverride=e=>pA.behaviorOverrides[e];getAsynchronousUtils=()=>cA;createPConnect=e=>Zu(e);getPubSubUtils=()=>Gr;registerComponentCreator=e=>{ed(e)};getConstants=()=>Object.freeze(F);getEvents=()=>sA;getRestClient=()=>u;getMashupApi=()=>fE;getEnvironmentInfo=()=>dp;getRuntimeParamsAPI=()=>yE;getSemanticUrlUtils=()=>aA;getRemoteCaseUtils=()=>$;getNavigationUtils=()=>pE;registerModule=(e,t)=>rA.registerModule(e,t,this);getErrorHandler=()=>oA;getFormUtils=()=>Jc;getMessagingServiceManager=()=>mu;getMetadataUtils=()=>i;getDataPageUtils=()=>Iu;getDataTypeUtils=()=>Vl;getCascadeManager=()=>rh;isDeepEqual=(e,t)=>h()(e,t);getAuthUtils=()=>iA;getDebugger=()=>rc;getDeferLoadManager=()=>ou;getExpressionEngine=()=>n;getActionsSequencer=()=>xu;getRefreshManager=()=>ml;getInitialiser=()=>SE;getAllStateMachines=(e,t,n)=>t&&n?Qc.getAllStateMachines(e,t,n):Qc.getAllStateMachinesByContext(e);getBootstrapUtils=()=>mE;getContextTreeManager=()=>Pn;getPerformanceManager=()=>Wi;getAccessPrivilege=()=>dA.getInstance()}const hA=new pA;s.g.PCore=hA})()})();
1
+ (()=>{var e,t,n={953:e=>{class t{constructor(e,t,n,s,r){this.converter=c(),this.width=e,this.poly=t,this.xor_in=n,this.reflected_xor_in=l(n,e),this.xor_out=s,this.reflect=r,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:s,crc_shift:r,mask:a}=this;if(this.reflect){t=this.reflected_xor_in;for(let s=0;s<e.length;s++){t=(n[255&(t^e[s])]^t>>>8)&a}}else{t=this.shifted_xor_in;for(let o=0;o<e.length;o++)t=n[255&(t>>s-8+r^e[o])]<<r^t<<8-r&a<<r;t>>=r}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 s=e[n];this.reflect&&(s=l(s,8));for(let e=0;e<8;e++){let n=t&this.msb_mask;s&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,s=e.length>>n,r=1<<n,a="";for(let o=0;o<s;o++){let s="";for(let a=0;a<r;a++){let r=e[o<<n|a];r="000000000"+r.toString(16),r=r.substr(r.length-t),s+="0x"+r+", "}a+=" "+s+"\n"}return a="[\n"+a.slice(0,-3)+"\n]",a}}const n="undefined"!=typeof Buffer,s="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,r=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%r)),e/=r;return this.fromByteArray(t)}default:if(n&&Buffer.isBuffer(e))return e;if(s){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(s&&(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 s=0;s<t;s++)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,s,r,a){let o=new t(e,n,s,r,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}},s={};function r(e){var t=s[e];if(void 0!==t)return t.exports;var a=s[e]={exports:{}};return n[e](a,a.exports,r),a.exports}r.m=n,r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((t,n)=>(r.f[n](e,t),t)),[])),r.u=e=>"js/libphonenumber-web.js",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="constellation-corejs-library:",r.l=(n,s,a,o)=>{if(e[n])e[n].push(s);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,r.nc&&i.setAttribute("nonce",r.nc),i.setAttribute("data-webpack",t+a),i.src=n),e[n]=[s];var p=(t,s)=>{i.onerror=i.onload=null,clearTimeout(g);var r=e[n];if(delete e[n],i.parentNode&&i.parentNode.removeChild(i),r&&r.forEach((e=>e(s))),t)return t(s)},g=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)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.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 s=n.length-1;s>-1&&(!e||!/^http(s?):/.test(e));)e=n[s--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{var e={388:0};r.f.j=(t,n)=>{var s=r.o(e,t)?e[t]:void 0;if(0!==s)if(s)n.push(s[2]);else{var a=new Promise(((n,r)=>s=e[t]=[n,r]));n.push(s[2]=a);var o=r.p+r.u(t),i=new Error;r.l(o,(n=>{if(r.o(e,t)&&(0!==(s=e[t])&&(e[t]=void 0),s)){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,s[1](i)}}),"chunk-"+t,t)}};var t=(t,n)=>{var s,a,[o,i,c]=n,l=0;if(o.some((t=>0!==e[t]))){for(s in i)r.o(i,s)&&(r.m[s]=i[s]);if(c)c(r)}for(t&&t(n);l<o.length;l++)a=o[l],r.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={};r.r(e),r.d(e,{buildContextName:()=>Hs,buildModalContext:()=>Ks,buildTransientContextName:()=>qs,getContainerIdFromContext:()=>Js,getParentContext:()=>Qs,getParentContextName:()=>Ws,getTargetFromContext:()=>Ys,getTransientContext:()=>zs});var t={};r.r(t),r.d(t,{getResolvedTargetName:()=>Va,getRoutingInfo:()=>ka,getSemanticURLFromRoutingInfo:()=>Ba});var n={};r.r(n),r.d(n,{evaluate:()=>yo,handleChange:()=>Io,hasDeclareExpression:()=>mo,updateDeclareExpressions:()=>Eo});var s={};r.r(s),r.d(s,{hasBrowserEnv:()=>ic,hasStandardBrowserEnv:()=>lc,hasStandardBrowserWebWorkerEnv:()=>uc,navigator:()=>cc,origin:()=>dc});var a={};r.r(a),r.d(a,{publishExpressions:()=>Qp,publishMetadata:()=>Kp,publishResponse:()=>Jp});var o={};r.r(o),r.d(o,{doesRestApiExist:()=>sg,getCancelTokenSource:()=>rg,getCaseApi:()=>ig,getHeaderProcessor:()=>eg,invokeCustomRestApi:()=>ng,invokeRestApi:()=>tg,isRequestCanceled:()=>ag,registerInterceptor:()=>og});var i={};r.r(i),r.d(i,{fetchViewResources:()=>im,refreshViewByName:()=>um,updateViewResources:()=>om});var c={};r.r(c),r.d(c,{CONTAINER_NAMES:()=>my,CONTAINER_TYPES:()=>fy,addRootContainerItem:()=>Xy,areContainerItemsPresent:()=>Ny,cleanupTransientContainer:()=>oA,clearContainerItems:()=>cA,clearTransientData:()=>rA,closeContainerItem:()=>Jy,getActiveContainerItemContext:()=>Uy,getActiveContainerItemIDFromRoutingInfo:()=>EA,getActiveContainerItemName:()=>xy,getActiveContext:()=>hA,getChildContainerItemId:()=>Ay,getChildContainerItems:()=>Fy,getChildContainers:()=>jy,getChildContainersContexts:()=>Vy,getContainerAPI:()=>lA,getContainerAccessOrder:()=>_y,getContainerData:()=>yy,getContainerItemByKey:()=>Ry,getContainerItemData:()=>Cy,getContainerItemName:()=>Py,getContainerItems:()=>Sy,getContainerLimit:()=>Wy,getContainerParentContext:()=>IA,getContainerType:()=>vy,getContextByTargetAndKey:()=>mA,getDataContextName:()=>Ly,getFlowContainer:()=>AA,getLeastRecentlyUsedNonDirtyContainerItemID:()=>Ky,getParentContainerItem:()=>yA,getRootContainerName:()=>gA,getSuggestionContexts:()=>ky,getTargetFromContainerItemID:()=>Qy,getTransientItems:()=>tA,hasContainerItems:()=>Gy,isContainerDirty:()=>Yy,isContainerInitialized:()=>by,isContainerItemActive:()=>wy,isContainerItemContextBeingUsedInOtherContainers:()=>eA,isContainerItemExists:()=>Ty,isContainerItemExistsWithoutKey:()=>Dy,isContainerLimitReached:()=>qy,isContainerMultipleMode:()=>$y,isContainerSingleMode:()=>By,purgeTransientData:()=>aA,removeContainer:()=>uA,replaceTransientData:()=>sA,resetContainersPayload:()=>zy,setContainerLimit:()=>Hy,updateCaseContextEtag:()=>pA,updateParentLastUpdateTime:()=>fA,updateRelatedContextEtag:()=>dA,updateTransientData:()=>nA});var l={};r.r(l),r.d(l,{beginDesignerRefresh:()=>pC,endDesignerRefresh:()=>gC,getAIAgent:()=>PC,getAdditionalInfo:()=>xC,getDataPageKeys:()=>RC,getDataPageMetadata:()=>yC,getDesignerViewStoreVersion:()=>dC,getEditableFieldConfigUtil:()=>MC,getEmbeddedPropertyMetadata:()=>lC,getFieldParameters:()=>_C,getFieldsByClassName:()=>SC,getFormat:()=>TC,getGenAICoach:()=>DC,getInsight:()=>CC,getLocaleUtilsForLanguage:()=>iC,getLocalizationServiceFromStore:()=>cC,getLookUpDataPage:()=>bC,getLookUpDataPageInfo:()=>vC,getParagraph:()=>NC,getPersonalizationMetadata:()=>AC,getPropertyMetadata:()=>oC,getResolvedFieldMetadata:()=>wC,getSavableDataPage:()=>OC,isViewExists:()=>IC,mergeStore:()=>aC,resolveNavigation:()=>EC,resolveView:()=>mC,updateNavigationStore:()=>hC,updateStores:()=>fC,updateViewStore:()=>uC});var u={};r.r(u),r.d(u,{dispatch:()=>BC,doesContextExist:()=>nS,getActionType:()=>YC,getContextValue:()=>qC,getDataObject:()=>$C,getReferenceTokens:()=>jC,getSharedDataObject:()=>GC,getStore:()=>kC,getValue:()=>HC,isMergeable:()=>QC,lookupContextValue:()=>zC,mergeDeep:()=>XC,performReplaceAndRearrange:()=>JC,removeItem:()=>KC,replaceValue:()=>eS,resetStore:()=>tS,setStore:()=>VC,updateValue:()=>ZC});var d={};r.r(d),r.d(d,{activateContainerItem:()=>wS,addContainerItem:()=>_S,addMessages:()=>MS,addSharedData:()=>WS,addTransientItem:()=>NS,addWork:()=>yS,clearTransientData:()=>DS,createWork:()=>gS,error:()=>GS,finishAssignment:()=>VS,initContainers:()=>CS,listAction:()=>qS,loadView:()=>IS,mergeData:()=>fS,openAssignment:()=>kS,openWorkByHandle:()=>AS,postProcess:()=>$S,purgeTransientData:()=>OS,removeAllTransientItems:()=>US,removeContainerItem:()=>LS,removeSharedData:()=>HS,removeTransientItem:()=>FS,replaceContainerItem:()=>jS,replaceTransientData:()=>PS,resetContainers:()=>SS,resetLoading:()=>vS,setLoading:()=>bS,setSharedProperty:()=>YS,setStateProperty:()=>KS,showCasePreview:()=>zS,showHarness:()=>mS,showHistory:()=>BS,showPage:()=>ES,upMergeAndRemoveContainerItem:()=>xS,updateContainerItem:()=>RS,updateTransientData:()=>TS});var p={};r.r(p),r.d(p,{buildResizeMessage:()=>qR,mashup:()=>zR});const g=function(){this.__data__=[],this.size=0};const h=function(e,t){return e===t||e!=e&&t!=t};const f=function(e,t){for(var n=e.length;n--;)if(h(e[n][0],t))return n;return-1};var m=Array.prototype.splice;const I=function(e){var t=this.__data__,n=f(t,e);return!(n<0)&&(n==t.length-1?t.pop():m.call(t,n,1),--this.size,!0)};const E=function(e){var t=this.__data__,n=f(t,e);return n<0?void 0:t[n][1]};const y=function(e){return f(this.__data__,e)>-1};const A=function(e,t){var n=this.__data__,s=f(n,e);return s<0?(++this.size,n.push([e,t])):n[s][1]=t,this};function C(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}C.prototype.clear=g,C.prototype.delete=I,C.prototype.get=E,C.prototype.has=y,C.prototype.set=A;const S=C;const _=function(){this.__data__=new S,this.size=0};const N=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};const T=function(e){return this.__data__.get(e)};const D=function(e){return this.__data__.has(e)};const P="object"==typeof global&&global&&global.Object===Object&&global;var O="object"==typeof self&&self&&self.Object===Object&&self;const R=P||O||Function("return this")();const b=R.Symbol;var v=Object.prototype,x=v.hasOwnProperty,w=v.toString,M=b?b.toStringTag:void 0;const L=function(e){var t=x.call(e,M),n=e[M];try{e[M]=void 0;var s=!0}catch(e){}var r=w.call(e);return s&&(t?e[M]=n:delete e[M]),r};var U=Object.prototype.toString;const F=function(e){return U.call(e)};var j=b?b.toStringTag:void 0;const V=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":j&&j in Object(e)?L(e):F(e)};const k=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};const B=function(e){if(!k(e))return!1;var t=V(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t};const $=R["__core-js_shared__"];var G,W=(G=/[^.]+$/.exec($&&$.keys&&$.keys.IE_PROTO||""))?"Symbol(src)_1."+G:"";const H=function(e){return!!W&&W in e};var q=Function.prototype.toString;const z=function(e){if(null!=e){try{return q.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var Y=/^\[object .+?Constructor\]$/,K=Function.prototype,Q=Object.prototype,J=K.toString,X=Q.hasOwnProperty,Z=RegExp("^"+J.call(X).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const ee=function(e){return!(!k(e)||H(e))&&(B(e)?Z:Y).test(z(e))};const te=function(e,t){return null==e?void 0:e[t]};const ne=function(e,t){var n=te(e,t);return ee(n)?n:void 0};const se=ne(R,"Map");const re=ne(Object,"create");const ae=function(){this.__data__=re?re(null):{},this.size=0};const oe=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t};var ie=Object.prototype.hasOwnProperty;const ce=function(e){var t=this.__data__;if(re){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return ie.call(t,e)?t[e]:void 0};var le=Object.prototype.hasOwnProperty;const ue=function(e){var t=this.__data__;return re?void 0!==t[e]:le.call(t,e)};const de=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=re&&void 0===t?"__lodash_hash_undefined__":t,this};function pe(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}pe.prototype.clear=ae,pe.prototype.delete=oe,pe.prototype.get=ce,pe.prototype.has=ue,pe.prototype.set=de;const ge=pe;const he=function(){this.size=0,this.__data__={hash:new ge,map:new(se||S),string:new ge}};const fe=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};const me=function(e,t){var n=e.__data__;return fe(t)?n["string"==typeof t?"string":"hash"]:n.map};const Ie=function(e){var t=me(this,e).delete(e);return this.size-=t?1:0,t};const Ee=function(e){return me(this,e).get(e)};const ye=function(e){return me(this,e).has(e)};const Ae=function(e,t){var n=me(this,e),s=n.size;return n.set(e,t),this.size+=n.size==s?0:1,this};function Ce(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}Ce.prototype.clear=he,Ce.prototype.delete=Ie,Ce.prototype.get=Ee,Ce.prototype.has=ye,Ce.prototype.set=Ae;const Se=Ce;const _e=function(e,t){var n=this.__data__;if(n instanceof S){var s=n.__data__;if(!se||s.length<199)return s.push([e,t]),this.size=++n.size,this;n=this.__data__=new Se(s)}return n.set(e,t),this.size=n.size,this};function Ne(e){var t=this.__data__=new S(e);this.size=t.size}Ne.prototype.clear=_,Ne.prototype.delete=N,Ne.prototype.get=T,Ne.prototype.has=D,Ne.prototype.set=_e;const Te=Ne;const De=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this};const Pe=function(e){return this.__data__.has(e)};function Oe(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Se;++t<n;)this.add(e[t])}Oe.prototype.add=Oe.prototype.push=De,Oe.prototype.has=Pe;const Re=Oe;const be=function(e,t){for(var n=-1,s=null==e?0:e.length;++n<s;)if(t(e[n],n,e))return!0;return!1};const ve=function(e,t){return e.has(t)};const xe=function(e,t,n,s,r,a){var o=1&n,i=e.length,c=t.length;if(i!=c&&!(o&&c>i))return!1;var l=a.get(e),u=a.get(t);if(l&&u)return l==t&&u==e;var d=-1,p=!0,g=2&n?new Re:void 0;for(a.set(e,t),a.set(t,e);++d<i;){var h=e[d],f=t[d];if(s)var m=o?s(f,h,d,t,e,a):s(h,f,d,e,t,a);if(void 0!==m){if(m)continue;p=!1;break}if(g){if(!be(t,(function(e,t){if(!ve(g,t)&&(h===e||r(h,e,n,s,a)))return g.push(t)}))){p=!1;break}}else if(h!==f&&!r(h,f,n,s,a)){p=!1;break}}return a.delete(e),a.delete(t),p};const we=R.Uint8Array;const Me=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,s){n[++t]=[s,e]})),n};const Le=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n};var Ue=b?b.prototype:void 0,Fe=Ue?Ue.valueOf:void 0;const je=function(e,t,n,s,r,a,o){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!a(new we(e),new we(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return h(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var i=Me;case"[object Set]":var c=1&s;if(i||(i=Le),e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;s|=2,o.set(e,t);var u=xe(i(e),i(t),s,r,a,o);return o.delete(e),u;case"[object Symbol]":if(Fe)return Fe.call(e)==Fe.call(t)}return!1};const Ve=function(e,t){for(var n=-1,s=t.length,r=e.length;++n<s;)e[r+n]=t[n];return e};const ke=Array.isArray;const Be=function(e,t,n){var s=t(e);return ke(e)?s:Ve(s,n(e))};const $e=function(e,t){for(var n=-1,s=null==e?0:e.length,r=0,a=[];++n<s;){var o=e[n];t(o,n,e)&&(a[r++]=o)}return a};const Ge=function(){return[]};var We=Object.prototype.propertyIsEnumerable,He=Object.getOwnPropertySymbols;const qe=He?function(e){return null==e?[]:(e=Object(e),$e(He(e),(function(t){return We.call(e,t)})))}:Ge;const ze=function(e,t){for(var n=-1,s=Array(e);++n<e;)s[n]=t(n);return s};const Ye=function(e){return null!=e&&"object"==typeof e};const Ke=function(e){return Ye(e)&&"[object Arguments]"==V(e)};var Qe=Object.prototype,Je=Qe.hasOwnProperty,Xe=Qe.propertyIsEnumerable;const Ze=Ke(function(){return arguments}())?Ke:function(e){return Ye(e)&&Je.call(e,"callee")&&!Xe.call(e,"callee")};const et=function(){return!1};var tt="object"==typeof exports&&exports&&!exports.nodeType&&exports,nt=tt&&"object"==typeof module&&module&&!module.nodeType&&module,st=nt&&nt.exports===tt?R.Buffer:void 0;const rt=(st?st.isBuffer:void 0)||et;var at=/^(?:0|[1-9]\d*)$/;const ot=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&at.test(e))&&e>-1&&e%1==0&&e<t};const it=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var ct={};ct["[object Float32Array]"]=ct["[object Float64Array]"]=ct["[object Int8Array]"]=ct["[object Int16Array]"]=ct["[object Int32Array]"]=ct["[object Uint8Array]"]=ct["[object Uint8ClampedArray]"]=ct["[object Uint16Array]"]=ct["[object Uint32Array]"]=!0,ct["[object Arguments]"]=ct["[object Array]"]=ct["[object ArrayBuffer]"]=ct["[object Boolean]"]=ct["[object DataView]"]=ct["[object Date]"]=ct["[object Error]"]=ct["[object Function]"]=ct["[object Map]"]=ct["[object Number]"]=ct["[object Object]"]=ct["[object RegExp]"]=ct["[object Set]"]=ct["[object String]"]=ct["[object WeakMap]"]=!1;const lt=function(e){return Ye(e)&&it(e.length)&&!!ct[V(e)]};const ut=function(e){return function(t){return e(t)}};var dt="object"==typeof exports&&exports&&!exports.nodeType&&exports,pt=dt&&"object"==typeof module&&module&&!module.nodeType&&module,gt=pt&&pt.exports===dt&&P.process,ht=function(){try{var e=pt&&pt.require&&pt.require("util").types;return e||gt&&gt.binding&&gt.binding("util")}catch(e){}}();var ft=ht&&ht.isTypedArray;const mt=ft?ut(ft):lt;var It=Object.prototype.hasOwnProperty;const Et=function(e,t){var n=ke(e),s=!n&&Ze(e),r=!n&&!s&&rt(e),a=!n&&!s&&!r&&mt(e),o=n||s||r||a,i=o?ze(e.length,String):[],c=i.length;for(var l in e)!t&&!It.call(e,l)||o&&("length"==l||r&&("offset"==l||"parent"==l)||a&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||ot(l,c))||i.push(l);return i};var yt=Object.prototype;const At=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||yt)};const Ct=function(e,t){return function(n){return e(t(n))}};const St=Ct(Object.keys,Object);var _t=Object.prototype.hasOwnProperty;const Nt=function(e){if(!At(e))return St(e);var t=[];for(var n in Object(e))_t.call(e,n)&&"constructor"!=n&&t.push(n);return t};const Tt=function(e){return null!=e&&it(e.length)&&!B(e)};const Dt=function(e){return Tt(e)?Et(e):Nt(e)};const Pt=function(e){return Be(e,Dt,qe)};var Ot=Object.prototype.hasOwnProperty;const Rt=function(e,t,n,s,r,a){var o=1&n,i=Pt(e),c=i.length;if(c!=Pt(t).length&&!o)return!1;for(var l=c;l--;){var u=i[l];if(!(o?u in t:Ot.call(t,u)))return!1}var d=a.get(e),p=a.get(t);if(d&&p)return d==t&&p==e;var g=!0;a.set(e,t),a.set(t,e);for(var h=o;++l<c;){var f=e[u=i[l]],m=t[u];if(s)var I=o?s(m,f,u,t,e,a):s(f,m,u,e,t,a);if(!(void 0===I?f===m||r(f,m,n,s,a):I)){g=!1;break}h||(h="constructor"==u)}if(g&&!h){var E=e.constructor,y=t.constructor;E==y||!("constructor"in e)||!("constructor"in t)||"function"==typeof E&&E instanceof E&&"function"==typeof y&&y instanceof y||(g=!1)}return a.delete(e),a.delete(t),g};const bt=ne(R,"DataView");const vt=ne(R,"Promise");const xt=ne(R,"Set");const wt=ne(R,"WeakMap");var Mt="[object Map]",Lt="[object Promise]",Ut="[object Set]",Ft="[object WeakMap]",jt="[object DataView]",Vt=z(bt),kt=z(se),Bt=z(vt),$t=z(xt),Gt=z(wt),Wt=V;(bt&&Wt(new bt(new ArrayBuffer(1)))!=jt||se&&Wt(new se)!=Mt||vt&&Wt(vt.resolve())!=Lt||xt&&Wt(new xt)!=Ut||wt&&Wt(new wt)!=Ft)&&(Wt=function(e){var t=V(e),n="[object Object]"==t?e.constructor:void 0,s=n?z(n):"";if(s)switch(s){case Vt:return jt;case kt:return Mt;case Bt:return Lt;case $t:return Ut;case Gt:return Ft}return t});const Ht=Wt;var qt="[object Arguments]",zt="[object Array]",Yt="[object Object]",Kt=Object.prototype.hasOwnProperty;const Qt=function(e,t,n,s,r,a){var o=ke(e),i=ke(t),c=o?zt:Ht(e),l=i?zt:Ht(t),u=(c=c==qt?Yt:c)==Yt,d=(l=l==qt?Yt:l)==Yt,p=c==l;if(p&&rt(e)){if(!rt(t))return!1;o=!0,u=!1}if(p&&!u)return a||(a=new Te),o||mt(e)?xe(e,t,n,s,r,a):je(e,t,c,n,s,r,a);if(!(1&n)){var g=u&&Kt.call(e,"__wrapped__"),h=d&&Kt.call(t,"__wrapped__");if(g||h){var f=g?e.value():e,m=h?t.value():t;return a||(a=new Te),r(f,m,n,s,a)}}return!!p&&(a||(a=new Te),Rt(e,t,n,s,r,a))};const Jt=function e(t,n,s,r,a){return t===n||(null==t||null==n||!Ye(t)&&!Ye(n)?t!=t&&n!=n:Qt(t,n,s,r,e,a))};const Xt=function(e,t){return Jt(e,t)};let Zt,en,tn;const nn=e=>{e&&(Zt=e=e||{"base-server":"http://localhost:1080/prweb/","data-end-point":"api/v1/stream/data","action-end-point":"api/v1/stream/action"},Zt.BASEURL=e.server,Zt.ACTIONURL=e["action-end-point"],Zt.DATAURL=e["data-end-point"],tn=e.reAuthUrl)},sn=()=>tn,rn=()=>Zt.BASEURL,an=e=>fetch(`${Zt.BASEURL}${Zt.ACTIONURL}`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),on=e=>{en=e},cn=()=>en;var ln=r(953);const un=function(e){return"symbol"==typeof e||Ye(e)&&"[object Symbol]"==V(e)};var dn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,pn=/^\w*$/;const gn=function(e,t){if(ke(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!un(e))||(pn.test(e)||!dn.test(e)||null!=t&&e in Object(t))};function hn(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var s=arguments,r=t?t.apply(this,s):s[0],a=n.cache;if(a.has(r))return a.get(r);var o=e.apply(this,s);return n.cache=a.set(r,o)||a,o};return n.cache=new(hn.Cache||Se),n}hn.Cache=Se;const fn=hn;const mn=function(e){var t=fn(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t};var In=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,En=/\\(\\)?/g;const yn=mn((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(In,(function(e,n,s,r){t.push(s?r.replace(En,"$1"):n||e)})),t}));const An=function(e,t){for(var n=-1,s=null==e?0:e.length,r=Array(s);++n<s;)r[n]=t(e[n],n,e);return r};var Cn=b?b.prototype:void 0,Sn=Cn?Cn.toString:void 0;const _n=function e(t){if("string"==typeof t)return t;if(ke(t))return An(t,e)+"";if(un(t))return Sn?Sn.call(t):"";var n=t+"";return"0"==n&&1/t==-Infinity?"-0":n};const Nn=function(e){return null==e?"":_n(e)};const Tn=function(e,t){return ke(e)?e:gn(e,t)?[e]:yn(Nn(e))};const Dn=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0};const Pn=function(e){if("string"==typeof e||un(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t};const On=function(e,t){for(var n=0,s=(t=Tn(t,e)).length;null!=e&&n<s;)e=e[Pn(t[n++])];return n&&n==s?e:void 0};const Rn=function(e,t,n){var s=-1,r=e.length;t<0&&(t=-t>r?0:r+t),(n=n>r?r:n)<0&&(n+=r),r=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(r);++s<r;)a[s]=e[s+t];return a};const bn=function(e,t){return t.length<2?e:On(e,Rn(t,0,-1))};var vn=Object.prototype.hasOwnProperty;const xn=function(e,t){var n=-1,s=(t=Tn(t,e)).length;if(!s)return!0;for(;++n<s;){var r=Pn(t[n]);if("__proto__"===r&&!vn.call(e,"__proto__"))return!1;if(("constructor"===r||"prototype"===r)&&n<s-1)return!1}var a=bn(e,t);return null==a||delete a[Pn(Dn(t))]};const wn=function(e,t){return null==e||xn(e,t)};var Mn=Object.prototype.hasOwnProperty;const Ln=function(e,t){return null!=e&&Mn.call(e,t)};const Un=function(e,t,n){for(var s=-1,r=(t=Tn(t,e)).length,a=!1;++s<r;){var o=Pn(t[s]);if(!(a=null!=e&&n(e,o)))break;e=e[o]}return a||++s!=r?a:!!(r=null==e?0:e.length)&&it(r)&&ot(o,r)&&(ke(e)||Ze(e))};const Fn=function(e,t){return null!=e&&Un(e,t,Ln)};const jn=function(e,t,n){var s=null==e?void 0:On(e,t);return void 0===s?n:s};const Vn=function(){try{var e=ne(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();const kn=function(e,t,n){"__proto__"==t&&Vn?Vn(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n};var Bn=Object.prototype.hasOwnProperty;const $n=function(e,t,n){var s=e[t];Bn.call(e,t)&&h(s,n)&&(void 0!==n||t in e)||kn(e,t,n)};const Gn=function(e,t,n,s){if(!k(e))return e;for(var r=-1,a=(t=Tn(t,e)).length,o=a-1,i=e;null!=i&&++r<a;){var c=Pn(t[r]),l=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(r!=o){var u=i[c];void 0===(l=s?s(u,c,i):void 0)&&(l=k(u)?u:ot(t[r+1])?[]:{})}$n(i,c,l),i=i[c]}return e};const Wn=function(e,t,n){return null==e?e:Gn(e,t,n)};const Hn=function(e,t,n){(void 0!==n&&!h(e[t],n)||void 0===n&&!(t in e))&&kn(e,t,n)};const qn=function(e){return function(t,n,s){for(var r=-1,a=Object(t),o=s(t),i=o.length;i--;){var c=o[e?i:++r];if(!1===n(a[c],c,a))break}return t}}();var zn="object"==typeof exports&&exports&&!exports.nodeType&&exports,Yn=zn&&"object"==typeof module&&module&&!module.nodeType&&module,Kn=Yn&&Yn.exports===zn?R.Buffer:void 0,Qn=Kn?Kn.allocUnsafe:void 0;const Jn=function(e,t){if(t)return e.slice();var n=e.length,s=Qn?Qn(n):new e.constructor(n);return e.copy(s),s};const Xn=function(e){var t=new e.constructor(e.byteLength);return new we(t).set(new we(e)),t};const Zn=function(e,t){var n=t?Xn(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)};const es=function(e,t){var n=-1,s=e.length;for(t||(t=Array(s));++n<s;)t[n]=e[n];return t};var ts=Object.create;const ns=function(){function e(){}return function(t){if(!k(t))return{};if(ts)return ts(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const ss=Ct(Object.getPrototypeOf,Object);const rs=function(e){return"function"!=typeof e.constructor||At(e)?{}:ns(ss(e))};const as=function(e){return Ye(e)&&Tt(e)};var os=Function.prototype,is=Object.prototype,cs=os.toString,ls=is.hasOwnProperty,us=cs.call(Object);const ds=function(e){if(!Ye(e)||"[object Object]"!=V(e))return!1;var t=ss(e);if(null===t)return!0;var n=ls.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&cs.call(n)==us};const ps=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]};const gs=function(e,t,n,s){var r=!n;n||(n={});for(var a=-1,o=t.length;++a<o;){var i=t[a],c=s?s(n[i],e[i],i,n,e):void 0;void 0===c&&(c=e[i]),r?kn(n,i,c):$n(n,i,c)}return n};const hs=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t};var fs=Object.prototype.hasOwnProperty;const ms=function(e){if(!k(e))return hs(e);var t=At(e),n=[];for(var s in e)("constructor"!=s||!t&&fs.call(e,s))&&n.push(s);return n};const Is=function(e){return Tt(e)?Et(e,!0):ms(e)};const Es=function(e){return gs(e,Is(e))};const ys=function(e,t,n,s,r,a,o){var i=ps(e,n),c=ps(t,n),l=o.get(c);if(l)Hn(e,n,l);else{var u=a?a(i,c,n+"",e,t,o):void 0,d=void 0===u;if(d){var p=ke(c),g=!p&&rt(c),h=!p&&!g&&mt(c);u=c,p||g||h?ke(i)?u=i:as(i)?u=es(i):g?(d=!1,u=Jn(c,!0)):h?(d=!1,u=Zn(c,!0)):u=[]:ds(c)||Ze(c)?(u=i,Ze(i)?u=Es(i):k(i)&&!B(i)||(u=rs(c))):d=!1}d&&(o.set(c,u),r(u,c,s,a,o),o.delete(c)),Hn(e,n,u)}};const As=function e(t,n,s,r,a){t!==n&&qn(n,(function(o,i){if(a||(a=new Te),k(o))ys(t,n,i,s,e,r,a);else{var c=r?r(ps(t,i),o,i+"",t,n,a):void 0;void 0===c&&(c=o),Hn(t,i,c)}}),Is)};const Cs=function(e){return e};const Ss=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)};var _s=Math.max;const Ns=function(e,t,n){return t=_s(void 0===t?e.length-1:t,0),function(){for(var s=arguments,r=-1,a=_s(s.length-t,0),o=Array(a);++r<a;)o[r]=s[t+r];r=-1;for(var i=Array(t+1);++r<t;)i[r]=s[r];return i[t]=n(o),Ss(e,this,i)}};const Ts=function(e){return function(){return e}};const Ds=Vn?function(e,t){return Vn(e,"toString",{configurable:!0,enumerable:!1,value:Ts(t),writable:!0})}:Cs;var Ps=Date.now;const Os=function(e){var t=0,n=0;return function(){var s=Ps(),r=16-(s-n);if(n=s,r>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(Ds);const Rs=function(e,t){return Os(Ns(e,t,Cs),e+"")};const bs=function(e,t,n){if(!k(n))return!1;var s=typeof t;return!!("number"==s?Tt(n)&&ot(t,n.length):"string"==s&&t in n)&&h(n[t],e)};const vs=function(e){return Rs((function(t,n){var s=-1,r=n.length,a=r>1?n[r-1]:void 0,o=r>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(r--,a):void 0,o&&bs(n[0],n[1],o)&&(a=r<3?void 0:a,r=1),t=Object(t);++s<r;){var i=n[s];i&&e(t,i,s,a)}return t}))}((function(e,t,n,s){As(e,t,n,s)}));var xs=Object.prototype.hasOwnProperty;const ws=function(e){if(null==e)return!0;if(Tt(e)&&(ke(e)||"string"==typeof e||"function"==typeof e.splice||rt(e)||mt(e)||Ze(e)))return!e.length;var t=Ht(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(At(e))return!Nt(e).length;for(var n in e)if(xs.call(e,n))return!1;return!0};class Ms{static setNamespaceSupport=(e=!1)=>{Ms.namespaceEnabled=e};static isNamespaceEnabled=()=>Ms.namespaceEnabled??!1;static getNamespaceList=()=>{const e=globalThis.PCore,t=e?.getEnvironmentInfo?.();if(t&&"function"==typeof t.getFeatureMap)return t.getFeatureMap()?.namespaceList};static getQualifiedName=(e,t)=>{if(!Ms.isNamespaceEnabled())return e;const n=Ms.getNamespaceList();if(Array.isArray(n)){if(n.some((t=>{const n=`${t}__`;return e.startsWith(n)})))return e}return`${t}__${e}`};static getDefaultQualifiedName=e=>Ms.getQualifiedName(e,"PegaPlatform");static namespacePrefixedRuleName(e,t){return t?Ms.getQualifiedName(e,t):Ms.getDefaultQualifiedName(e)}static getQualifiedNameForComplexRuleReferences(e,t){const{namespace:n,marker:s}=t??{},r=`${s??"caseInfo.content"}.`,a=e.lastIndexOf(r);if(-1!==a){return e.slice(0,a+r.length)+e.slice(a+r.length).split(".").map((e=>Ms.namespacePrefixedRuleName(e,n))).join(".")}if(e.includes(".")){const t=e.startsWith("."),s=(t?e.slice(1):e).split(".").filter(Boolean).map((e=>Ms.namespacePrefixedRuleName(e,n))).join(".");return t?`.${s}`:s}return Ms.namespacePrefixedRuleName(e,n)}}const Ls=Ms;const Us=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")}},Fs={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:Ls.getDefaultQualifiedName("pyCaseTab"),DATA_OBJECT_CREATE_VIEW:Ls.getDefaultQualifiedName("Create"),DATA_OBJECT_EDIT_VIEW:Ls.getDefaultQualifiedName("pyEdit"),PY_DATA_PREVIEW:Ls.getDefaultQualifiedName("pyDataPreview"),PY_DETAILS:Ls.getDefaultQualifiedName("pyDetails"),OBJECT_CREATE_VIEW:"Create",SUBSCRIPT_CREATE_VIEW:Ls.getDefaultQualifiedName("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:Ls.getDefaultQualifiedName("D_pyGetUserWorkListByUserId"),D__WORK_BASKET:Ls.getDefaultQualifiedName("D_WorkBasket"),D__PY_MY_WORK_LIST:Ls.getDefaultQualifiedName("D_pyMyWorkList"),D__PY_ASSIGNMENTS_DATA:"D_pyAssignmentsData"}},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:Ls.getDefaultQualifiedName("pzCreateDetails"),PREVIEW_VIEW_NAME:Ls.getDefaultQualifiedName("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",DATA_INFO_CONTEXT_KEY:"dataInfo.contextKey"},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_COLLABORATORS:"caseInfo.collaborators",CASE_INFO_CONTENT:"caseInfo.content",CASE_INFO_ENCRYPTED_CONTENT:"caseInfo.encryptedContent",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:Ls.getQualifiedNameForComplexRuleReferences("caseInfo.content.pzInsKey"),CASE_INFO_ACTIONS:"caseInfo.availableActions",VIEW_NAME:Ls.getQualifiedNameForComplexRuleReferences("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:Ls.getQualifiedNameForComplexRuleReferences("caseInfo.content.pyApprovalResult"),DUPLICATECASEFLAG:Ls.getQualifiedNameForComplexRuleReferences("caseInfo.content.pyDuplicateCaseActions"),DUPLICATECASEID:Ls.getQualifiedNameForComplexRuleReferences("caseInfo.content.pyDuplicateID"),DUPLICATECASEINSKEY:Ls.getQualifiedNameForComplexRuleReferences("caseInfo.content.pyDuplicateCaseReference.pzInsKey"),HEADERS:"caseInfo.headers",PARENTCASEINFO:"caseInfo.parentCaseInfo",REMOTESYSTEMID:"caseInfo.headers.RemoteSystemID",CASE_RELATED_CASE_TYPES:"caseInfo.relatedCaseTypes",CASES:"caseInfo.cases",IS_ASSIGNMENT:"caseInfo.isAssignment",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:Ls.getDefaultQualifiedName("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:Ls.getDefaultQualifiedName("pyTransferAssignment")},CONTENT:"content",MODAL:"modal",ACTIONAREA:"actionarea",STOPMERGEACTIONS:"stopMergeActions",IS_CREATE_DATA_OBJECT:"isCreateDataObject",SUMMARY_OF_ASSIGNMENT_LAST_SUBMIT_TIME:Ls.getQualifiedNameForComplexRuleReferences("context_data.caseInfo.content.summary_of_assignment__.lastSubmitTime"),SUMMARY_OF_ATTACHMENTS_LAST_REFRESH_TIME:Ls.getQualifiedNameForComplexRuleReferences("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",INVALID_INPUTS:"Invalid inputs",VALIDATION_FAIL:"Validation fail",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_CLOSE_REAUTH_MODAL:"closeReAuthModal",EVENT_CANCEL:"cancel",EVENT_MINIMIZE:"minimize",EVENT_EXPRESS_LOCALACTION:"expressLocalActionSubmit",EVENT_BULKACTION:"bulkActionSubmit",EVENT_FINISH_ASSIGNMENT_DONE:"finishAssignmentDone",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_PREVIEW_DISMISS:"previewDismiss",EVENT_LOGOFF:"Logoff",EVENT_TRANSIENT_ITEMS:{UPDATE_PROMOTED_FILTERS:"updatePromotedFilters"},UI_EVENTS:{INSPECTOR:"inspector",INSPECTOR_SHOW_ALL:"inspectorShowAll",UI_DESIGNER:"uiDesigner",UI_DESIGNER_TOOLBAR_EXPANDED:"uiDesignerToolbarExpanded",SHOW_PAGE_INIT:"showPageInit",SHOW_PAGE_DONE:"showPageDone",SHOW_PAGE_STARTED:"showPageStarted",THEME_CHANGE:"themeChange",THEME_MODE_CHANGE:"themeModeChange",NAV_ORIENTATION_CHANGE:"navOrientationChange",CASE_VIEW_TEMPLATE_CHANGE:"caseViewTemplateChange",MULTI_STEP_NAV_DISPLAY_CHANGE:"multiStepNavDisplayChange",CASE_STAGE_DISPLAY_CHANGE:"caseStageDisplayChange"},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_VIEW_OPENED_AFTER_CREATE:"caseViewOpenedAfterCreate",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",CASE_LOAD:"caseLoad",CASE_UNLOAD:"caseUnload",CASE_EDIT_OPEN:"caseEditOpen",CASE_EDIT_CLOSE:"caseEditClose",CREATE_CASE_MODAL_OPEN:"createCaseModalOpen",CREATE_CASE_MODAL_CLOSE:"createCaseModalClose"},ASSIGNMENT_EVENTS:{ASSIGNMENT_LOAD:"assignmentLoad",ASSIGNMENT_UNLOAD:"assignmentUnload"},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",DISPLAY_CASE_SUBMITTED_TOASTER:"displayCaseSubmittedToaster",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",ON_REFRESH_START:"onRefreshStart",ON_REFRESH_COMPLETE:"onRefreshComplete",ON_REFRESH_ERROR:"onRefreshError",EVENT_LOCALE_CHANGED:"localeChanged"},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",PORTAL_AGENT_SPLIT_VIEW_PATH:"presentation.templates.GenAICoach",PORTAL_AGENT_WIDTH_PATH:"presentation.templates.GenAICoach.agentPanelWidth"},PROMISE_VALUE:{RESOLVE:"resolve",REJECT:"reject"},APP_TYPE:{UIKIT:"uikit",THEME_COSMOS:"themecosmos"},PORTAL_TYPE:{WSS:"wss"},VIEW_TYPE:{PY_EMBEDASSIGNMENT:Ls.getDefaultQualifiedName("pyEmbedAssignment"),PY_DETAILS:Ls.getDefaultQualifiedName("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"},FEED:{MESSAGE_VIEW_REFERENCE:Ls.getDefaultQualifiedName("messageViewReference"),PARENT_MESSAGE_ID:Ls.getDefaultQualifiedName("parentMessageID"),PX_RESULTS:Ls.getDefaultQualifiedName("pxResults"),NAME:Ls.getDefaultQualifiedName("name"),POSTED_BY_USER:Ls.getDefaultQualifiedName("postedByUser"),UPDATED_TIME:Ls.getDefaultQualifiedName("updatedTime"),POST_MESSAGE:Ls.getDefaultQualifiedName("PostMessage"),PZ_INS_KEY:Ls.getDefaultQualifiedName("pzInsKey"),PZ_PRIVATE_POST_DETAILS:Ls.getDefaultQualifiedName("pzPrivatePostDetails"),PY_SELECTED:Ls.getDefaultQualifiedName("pySelected"),PY_LABEL:Ls.getDefaultQualifiedName("pyLabel"),PY_RECIPIENTS:Ls.getDefaultQualifiedName("pyRecipients"),MENTIONS:Ls.getDefaultQualifiedName("mentions"),PY_IS_DELETE_ENABLED:Ls.getDefaultQualifiedName("pyIsDeleteEnabled"),TAGS:Ls.getDefaultQualifiedName("tags"),PZ_POST_DETAILS:Ls.getDefaultQualifiedName("pzPostDetails"),PY_FEED_SOURCE_REFERENCE:Ls.getDefaultQualifiedName("pyFeedSourceReference"),IS_EDITED:Ls.getDefaultQualifiedName("isEdited"),PY_LIKES:Ls.getDefaultQualifiedName("pyLikes"),PY_POST_TYPE:Ls.getDefaultQualifiedName("pyPostType"),POSTED_TIME:Ls.getDefaultQualifiedName("postedTime"),PY_MESSAGE_VIEW_REFERENCE:Ls.getDefaultQualifiedName("pyMessageViewReference"),ID:Ls.getDefaultQualifiedName("ID"),PY_COMMENT_CONTEXT:Ls.getDefaultQualifiedName("pyCommentContext"),PX_LIKE_COUNT:Ls.getDefaultQualifiedName("pxLikeCount"),MESSAGE:Ls.getDefaultQualifiedName("message")},CASE_VIEW_MODE:{PERFORM:"perform",REVIEW:"review",CONFIRM:"confirm"}},js={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",RULE_VIEW:"RuleView",SELF_SERVICE_CASE_VIEW:"SelfServiceCaseView",VIEW:"view",CASE_PREVIEW:"CasePreview",RULE_PREVIEW:"RulePreview",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",OBJECTACTIONCONTAINER:"ObjectActionContainer",ACPRIMARY_NAME:"ACPRIMARY",ACTERTIARY_NAME:"ACTERTIARY",THREADNAMESEPARATOR:"/",JOINCHARACTER:"_",FORWARD_SLASH_STRING:"/",UNDERSCORE_STRING:"_",DOUBLE_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_ERROR:"onRefreshError",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",FORMAT_ANNOTATION:"@FORMAT",ASSOCIATED_PROPERTY_ANNOTATION:"@ASSOCIATED",CLASS_ASSOCIATION_ANNOTATION:"@CA",FILTERED_LIST_ANNOTATION:"@FILTERED_LIST",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:Ls.getDefaultQualifiedName("pyDetails"),PY_CONFIRM:Ls.getDefaultQualifiedName("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",APPLICATION_ID:"APPLICATION_ID",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,PING:6500},...Fs,getProperty:e=>Us.map(e),getDefaultQualifiedName:e=>Ls.getDefaultQualifiedName(e)},Vs=Ls.getDefaultQualifiedName("pyRemoteCaseDetails");class ks{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=>cS.getProperty(".RemoteSystemID",js.CASE_INFO.HEADERS,e);static getRemoteHeader=e=>this.remoteCaseMapping[e]?.RemoteSystemID;static injectRemoteCaseHeader=(e,t,n)=>{if(e&&e.RemoteSystemID)return;const s=this.getRemoteHeaderByContext(n);s?e.RemoteSystemID=s:t&&this.isRemoteCase(t.caseTypeID)&&(e.RemoteSystemID=this.getRemoteHeader(t.caseTypeID))};static isTraditionalRemoteCase=(e="")=>"Traditional"===ks.getRemoteCase(e)?.RemoteApplicationType;static setAdditionalParameters=()=>{const e=PA.environmentInfoObject?.pyRemoteCaseTypeList;e?.forEach((e=>{const t=this.getRemoteCase(e.pyWorkTypeImplementationClassName);t&&(t.name=e.pyWorkTypeName)}))};static getRemoteAppPlatformVersion=e=>{if(!e)return;const t=PA.environmentInfoObject?.pyRemoteAppPlatformVersion;if(t){return JSON.parse(t)[e]}};static isRemoteCaseVersionDifferent=e=>{if(!this.isRemoteCase(e))return!1;const t=this.getRemoteHeader(e);if(!t)return!1;const n=this.getRemoteAppPlatformVersion(t);return Boolean(n)};static getRemoteHeaderFromSourceClass=e=>{const t=Object.values(this.remoteCaseMapping).find((t=>t.RemoteClassName===e));return t?.RemoteSystemID};static getRemoteCaseClassBySourceClass=e=>{if(e)for(const[t,n]of Object.entries(this.remoteCaseMapping))if(n.RemoteClassName===e)return t}}const Bs=ks,$s={},Gs=new Map,Ws=e=>{let t=js.EMPTY_STRING;return t=e&&e.includes(js.FORWARD_SLASH_STRING)?e.substring(0,e.lastIndexOf("/")):e,t},Hs=(e,t,n=!1)=>{let s=js.EMPTY_STRING;if(t&&e){let r=`${t}${js.FORWARD_SLASH_STRING}${e}`;const a=yy(r);if(a||t!==js.APP.APP&&t!==js.APP.ROOT)if(a){if(n&&$s[r])return s=`${r}${js.UNDERSCORE_STRING}${$s[r]}`,s;$s[r]?$s[r]+=1:$s[r]=1,s=`${r}${js.UNDERSCORE_STRING}${$s[r]}`}else s=Hs(e,Ws(t));else r=`${t}${js.FORWARD_SLASH_STRING}${js.PRIMARY}`,$s[r]?$s[r]+=1:$s[r]=1,s=`${r}${js.UNDERSCORE_STRING}${$s[r]}`}return s},qs=(e,t)=>{if(e&&t){const n=(Gs[t]?.[e]??0)+1;return Gs[t]||(Gs[t]={}),Gs[t][e]=n,`${t}${js.FORWARD_SLASH_STRING}${e}_${n}`}return""},zs=(e,t)=>{if(e&&t){const n=Gs[t]?.[e];return n?`${t}${js.FORWARD_SLASH_STRING}${e}_${n}`:qs(e,t)}return""},Ys=e=>{let t=js.EMPTY_STRING;return e&&(t=e.substring(e.lastIndexOf("/")+1,e.lastIndexOf("_")).toLowerCase()),t},Ks=(e,t)=>{if(null===e)return t;const[,n]=t.split(js.FORWARD_SLASH_STRING);return e+js.FORWARD_SLASH_STRING+n},Qs=e=>{const t=e.indexOf(js.FORWARD_SLASH_STRING),n=e.lastIndexOf(js.FORWARD_SLASH_STRING);return t===n?e:e.substring(0,n)},Js=e=>{const t=e.split(js.FORWARD_SLASH_STRING);return 2===t.length?e:t[0]+js.FORWARD_SLASH_STRING+t[2]},Xs="SET_PROPERTY",Zs="REPLACE_PROPERTY",er="FIELD_CHANGE",tr="LOAD_VIEW",nr="SHOW_PAGE",sr="SHOW_DATA",rr="SHOW_INSIGHT",ar="SHOW_DASHBOARD",or="SET_LOADING",ir="RESET_LOADING",cr="APP_OFFLINE",lr="APP_ONLINE",ur="SET_SHARED_PROPERTY",dr="CREATE_WORK",pr="OPEN_WORK_BY_HANDLE",gr="UPDATE_DOCUMENT",hr="FINISH_ASSIGNMENT",fr="SAVE_AND_CLOSE",mr="CANCEL_ASSIGNMENT",Ir="OPEN_ASSIGNMENT",Er="NAVIGATE_TO_STEP",yr="OPEN_LOCAL_ACTION",Ar="OPEN_PROCESS_ACTION",Cr="MERGE_DATA",Sr="REMOVE_ITEM",_r="GET_DATAOBJECT_ACTIONS",Nr="SHOW_HISTORY",Tr="ERROR",Dr="INIT_CONTAINERS",Pr="RESET_CONTAINERS",Or="ADD_CONTAINER_ITEM",Rr="REMOVE_CONTAINER_ITEM",br="ADD_TRANSIENT_ITEM",vr="UPDATE_TRANSIENT_DATA",xr="REMOVE_TRANSIENT_ITEM",wr="REMOVE_ALL_TRANSIENT_ITEMS",Mr="CLEAR_TRANSIENT_DATA",Lr="PURGE_TRANSIENT_DATA",Ur="REPLACE_TRANSIENT_DATA",Fr="ACTIVATE_CONTAINER_ITEM",jr="UPDATE_CONTAINER_ITEM",Vr="UPMERGE_AND_REMOVE_CONTAINER_ITEM",kr="REPLACE_CONTAINER_ITEM",Br="ACTIVATE_MODAL_CONTAINER_ITEM",$r="REMOVE_CONTAINER",Gr="ADD_SUGGESTION_CONTEXT",Wr="showView",Hr="showData",qr="showInsight",zr="showDashboard",Yr="openWorkByHandle",Kr="openAssignment",Qr="createNewWork",Jr="finishAssignment",Xr="SHOW_CANCEL_ALERT",Zr="deleteCaseInCreateStage",ea="openLocalAction",ta="openProcessAction",na="caseWideActions",sa="executeCaseWideActions",ra="openBulkAction",aa="performBulkAction",oa="launchAssignment",ia="ADD_MESSAGES",ca="CLEAR_MESSAGES",la="RESET_STORE",ua="FETCH_DATAPAGE",da="ADD_SHARED_DATA",pa="REMOVE_SHARED_DATA",ga="LIST_ACTION",ha="DELETE_CASE_SUMMARY",fa="ALTER_BLOCKING_ACTION_COUNT",ma="SET_APP_LOCALE",Ia="CREATE_DATA_OBJECT",Ea="DELETE_DATA_OBJECT",ya="VIEW_DATA_OBJECT",Aa="UPDATE_DATA_OBJECT",Ca="OPEN_DATA_OBJECT_ACTION",Sa="SUBMIT_DATA_OBJECT_ACTION",_a="OPEN_EMBEDDED_DATA_MODAL",Na="GET_EMBEDDED_DATA_VIEW",Ta="SUBMIT_EMBEDDED_DATA_MODAL",Da="SUBMIT_SUBSCRIPT",Pa="FILL_FORM_WITH_AI",Oa="createWork",Ra="openAssignment",ba="openCase",va="EXECUTE_OBJECT_WIDE_ACTION",xa="CREATE_EXTERNAL_CASE",wa="DELETE_WORK",Ma="createObject",La="getObject",Ua="getObjectWideAction",Fa="createExternalObject",ja="retrieveActionViewForNewCase",Va=(e,t)=>{if(!e||!t)return null;let n,s=js.EMPTY_STRING;return t&&(s=`${t}${js.FORWARD_SLASH_STRING}${e}`,n=yy(s),n||t.includes("/")?n||(s=Va(e,Ws(t))):s=`${t}${js.FORWARD_SLASH_STRING}${e}`),s},ka=(e,t)=>{const n=Va(e,t);return n&&yy(n)?yy(n):{}},Ba=(e,t)=>TA.getSemanticURL(Wr,{page:e},t);class $a{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=Ja[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],s=Qa[e.tokenType];s&&s.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}=Ja[this._state];this._subParser=new $a(this._grammar,e,t)}_endSubExpression(){Ja[this._state].subHandler.call(this,this._subParser.buildAst()),this._subParser=null}setPositionInAST(e){this._position?(this._position.right=e,$a._setParent(e,this._position)):this._tree=e,this._position=e}}const Ga=$a,Wa="identifier",Ha={operatorType:"binaryOperator",precedence:1,evaluate:(e,t)=>"object"!=typeof e&&"object"!=typeof t&&(e&&t)},qa={operatorType:"binaryOperator",precedence:1,evaluate:(e,t)=>"object"!=typeof e&&"object"!=typeof t&&(e||t)},za=(e,t,n)=>{const s=""===e,r=""===t||null==t;if(s&&r)return n;if("boolean"==typeof t){const r=!!(!s&&"false"!==e&&"0"!==e)&&Boolean(e);return n?r===t:r!==t}return s!==r?!n:n?e===t:e!==t},Ya={">":{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)=>"object"!=typeof e&&"object"!=typeof t&&za(e,t,!0)},"!=":{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>"object"==typeof e||"object"==typeof t||za(e,t,!1)},"!":{operatorType:"unaryOperator",precedence:999,evaluate:e=>{const t="object"==typeof e?e.value:e;return"true"===t||"false"===t?"true"!==t:!t}},"(":{operatorType:"openParenthesis"},")":{operatorType:"closeParenthesis"},"&&":Ha,AND:Ha,and:Ha,"||":qa,OR:qa,or:qa,CONTAINS:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>String(e).includes(String(t))},NOT_CONTAINS:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>!String(e).includes(String(t))},STARTS_WITH:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>String(e).startsWith(String(t))},NOT_STARTS_WITH:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>!String(e).startsWith(String(t))},ENDS_WITH:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>String(e).endsWith(String(t))},NOT_ENDS_WITH:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>!String(e).endsWith(String(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)=>String(t).split(",").includes(String(e))},IS_NOT_IN_LIST:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>!String(t).split(",").includes(String(e))}},Ka={BinaryExpression:function(e){const t=[],n=e.right,s=e.operator??"",r=e.left;if(!r)return!1;let a="boolean"==typeof r.value?"True-False":"";t[0]=this.evaluateAST(r),a||r.operationType!==Wa||(a=((e,t,n)=>{if("string"!=typeof e.value)return"";const s=e.value.substring(1),r=t?.getFieldMetadata(s)?.type??"";if(r)return r;const{pageReference:a,context:o}=n??{};if(!a||!o)return"";const i=cS.resolveClassID(e.value,a,o),c=oC(s,i);return c&&!Array.isArray(c)?c.type??"":""})(r,this._context,this._contextTreeNodeContext)),t[1]=n?this.evaluateAST(n,a):"";const o=this._grammar[s];return!!o?.evaluate&&o.evaluate(t[0],t[1])},identifier:function(e){const t="string"==typeof e.value?e.value:"";if(this._localDataObject)return rS.getIn(this._localDataObject,t?t.substring(1).split("."):[])??"";if(this._contextTreeNodeContext)return cS.getLitePropertyValue(this._contextTreeNodeContext,t)??"";if(!this._context)return"";const n=this._context.getFieldMetadata(t)?.type??"",s=this._context.getValue(t)??"";if("Decimal"===n&&"string"==typeof s){const e=parseFloat(s);return Number.isNaN(e)?"":e}return s},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;if(!t||!n)return!1;const s=this._grammar[t];return!!s?.evaluate&&s.evaluate(n)}},Qa={unaryOperator:function(e){this.setPositionInAST({operationType:"UnaryExpression",operator:String(e.value)})},binaryOperator:function(e){const t=String(e.value),{precedence:n}=this._grammar[t];let s=this._position._parent;const r=s?s.operator:null,a=r?this._grammar[r]:null,o=a?a.precedence:null;if(o&&n)for(;s?.operator&&o>=n;)this._position=s,s=s._parent;const i={operationType:"BinaryExpression",operator:t,left:this._position};Ga._setParent(this._position,i),s?(this._position=s,this.setPositionInAST(i)):(this._tree=i,this._position=i)},identifier:function(e){const t={operationType:Wa,value:e.value};this.setPositionInAST(t)},literal:function(e){this.setPositionInAST({operationType:"literal",value:e.value})},subExpression:function(e){var t;"object"==typeof(t=e)&&null!==t&&"operationType"in t&&this.setPositionInAST(e)}},Ja={expectOperand:{operatorTypes:{literal:{toState:"expectBinOp"},identifier:{toState:Wa},unaryOperator:{},openParenthesis:{toState:"subExpression"}}},expectBinOp:{operatorTypes:{binaryOperator:{toState:"expectOperand"}}},identifier:{operatorTypes:{binaryOperator:{toState:"expectOperand"}}},subExpression:{subHandler:Qa.subExpression,endStates:{closeParenthesis:"expectBinOp"}}},Xa=["binaryOperator","unaryOperator","openParenthesis"],Za=/^\s*$/,eo=/^[a-zA-Z_.$][(0-9)a-zA-Z0-9_.$]*$/,to=/\\\\/,no=["'(?:(?:\\\\')|[^'])*'",'"(?:(?:\\\\")|[^"])*"',"\\s+","\\btrue\\b","\\bfalse\\b"],so=["[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]+)"],ro=/^-?(?:(?:[0-9]*\.[0-9]+)|[0-9]+)$/;class ao{constructor(e){this._grammar=e}static _isNegative(e){return Xa.some((t=>t===e[e.length-1].tokenType))}static _isWhitespace(e){return!!e.match(Za)}static _createWordboundary(e){return(e=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).match(eo)&&(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(to,"\\")}_getSplitRegex(){if(!this._splitRegex){const e=Object.keys(this._grammar).sort(((e,t)=>t.length-e.length)).map((e=>ao._createWordboundary(e)),this);this._splitRegex=new RegExp(`(${[no.join("|"),e.join("|"),so.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=ao._unquote(e):e.match(ro)?t.value=parseFloat(e):"true"===e||"false"===e?t.value="true"===e:this._grammar[e]?t.tokenType=this._grammar[e].operatorType:e.match(eo)&&(t.tokenType="identifier"),t}_getTokens(e){const t=[];let n=!1;for(let s=0;s<e.length;s+=1)ao._isWhitespace(e[s])?t.length&&(t[t.length-1].element+=e[s]):"-"===e[s]&&ao._isNegative(t)?n=!0:(n&&(e[s]=`-${e[s]}`,n=!1),t.push(this._createToken(e[s])));return t}tokenize(e){const t=this._splitExpression(e);return this._getTokens(t)}}const oo=ao;const io=class{constructor(e,t){this._grammar={...Ya},this._expression=e,this._ast=null,this._contextTreeNodeContext=null,this._localDataObject=t}buildAST(){const e=new oo(this._grammar).tokenize(this._expression),t=new Ga(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 go(e.operationType,Ka)&&Ka[e.operationType].call(this,e,t)}},co=(e,t)=>{const n=e.replace(/[a-zA-Z0-9_)"'\s]=[a-zA-Z0-9_("'\s]/,(e=>e.replace("=","==")));return new io(n,t)},lo=e=>!e||e.buildAST(),uo=(e,t,n)=>!e||e.evaluate(t,n),po=(e,t,n)=>{const s=co(e,t),r=lo(s);return uo(r,n)},go=(e,t)=>e in t;const ho=class{static handleExpression(e,t,n,s){const r=this.getContext(e,s);an({actionObject:{action:"decexp",params:{source:e,value:t,targets:n},context:r}}).then((e=>e.json())).then((e=>{this.updateState(e,s)})).catch((e=>window.console.log(e)))}static getContext(e,t){const n=e.substring(0,e.indexOf("."));return{name:n,class:cS.getPropertyValue(`${n}.${Ls.getDefaultQualifiedName("pxObjClass")}`,null,t)||cS.getPropertyValue(`${n}.${Ls.getDefaultQualifiedName("pyClassName")}`,null,t)}}static updateState(e,t){Object.keys(e).forEach((n=>BC({type:Xs,payload:{context:t,reference:n,value:e[n]}})))}},fo={},mo=(e,t)=>fo[t]&&Object.hasOwn(fo[t],e),Io=e=>{const{context:t}=e;mo(e.reference,t)&&ho.handleExpression(e.reference,e.value,fo[t][e.reference],t)},Eo=(e={})=>{rS.copy(e,fo)},yo=(e,t,n)=>po(e,t,n?.pConnect.getPConnect());const Ao=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 s=this.getContextObjectByName(e);if(s)if(Array.isArray(n))s[t]=n;else{const e=s[t];s[t]=[...new Set([...e,n])]}}else{const s={};Array.isArray(n)?s[t]=n:s[t]=[n],this.addContextName(e,s)}}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),s=new Set(n);return n.forEach((e=>{s.add(e)})),[...s]}};const Co=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={}){rS.copy(e,this.componentMap)}mergeOverrideMap(e={}){rS.copy(e,this.overrideMap)}getOverrideMap(){return this.overrideMap}getLazyMap(){return this.lazyMap}};const So=new class{constructor(){this.handlers={}}registerHandler(e,t){this.handlers[e]=t}getHandler(e){return this.handlers[e]}},_o=/^@\w+\s+(.+)$/s;const No=class{static handleAnnotation(e,t,n){const s=e.indexOf(" "),r=-1===s?e:e.substring(0,s),a=So.getHandler(r);if(!a)return e;const o=e.match(_o);return a((o?o[1]:"").trim(),t,n)}static trimAnnotation(e){if("string"!=typeof e)return e;const t=e.indexOf(" "),n=e.substring(0,t),s=e.substring(t+1);return So.getHandler(n)?s:e}static handleComponentMapping(e,t,n){const s=Co.getComponent(t.type);if(!s?.mapping)return;const r=s.mapping(t.config);if(r&&r["@map"]){const t=r["@map"],{source:s}=t;if(!s)return;const a=n.getValue(s);if("function"==typeof t.advanced)t.advanced(e,a);else{const n=t.inputs_map;e[t.output_property]=[];const s=e[t.output_property];a.forEach((e=>{const t={};Object.keys(n).forEach((s=>{let r=n[s];r?.startsWith(".")?(r=r.substring(1),t[s]=e[r]):t[s]=r})),s.push(t)}))}}}static getPropertyName(e=""){if(e&&rS.isString(e)){const t=e.startsWith(js.PROPERTY_ANNOTATION)||e.startsWith(js.ATTACHMENT_ANNOTATION)||e.startsWith(js.ASSOCIATED_PROPERTY_ANNOTATION)||e.startsWith(js.CLASS_ASSOCIATION_ANNOTATION)||e.startsWith(js.FILTERED_LIST_ANNOTATION),n=t?e.indexOf(" "):-1;return t?e.substring(n+2):e}return e}static getLeafPropertyName(e){if(rS.isString(e)&&!!e?.startsWith(js.PROPERTY_ANNOTATION)){const t=this.getPropertyName(e),n=t.split(".");return n.length<2?t:n.pop()}return e}static isProperty(e){return rS.isString(e)&&!!e?.startsWith(js.PROPERTY_ANNOTATION)}};function To(e,t){return function(){return e.apply(t,arguments)}}const{toString:Do}=Object.prototype,{getPrototypeOf:Po}=Object,{iterator:Oo,toStringTag:Ro}=Symbol,bo=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),vo=e=>"string"==typeof e&&("__proto__"===e||"constructor"===e||"prototype"===e),xo=(e,t,n)=>e===Object.prototype||!n&&null===t,wo=(e,t)=>{let n=e;const s=[];for(;null!=n;){if(-1!==s.indexOf(n))return!1;s.push(n);const r=Po(n);if(xo(n,r,n===e))return!1;if(bo(n,t))return!0;n=r}return!1},Mo=(Lo=Object.create(null),e=>{const t=Do.call(e);return Lo[t]||(Lo[t]=t.slice(8,-1).toLowerCase())});var Lo;const Uo=e=>(e=e.toLowerCase(),t=>Mo(t)===e),Fo=e=>t=>typeof t===e,{isArray:jo}=Array,Vo=Fo("undefined");function ko(e){return null!==e&&!Vo(e)&&null!==e.constructor&&!Vo(e.constructor)&&Go(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Bo=Uo("ArrayBuffer");const $o=Fo("string"),Go=Fo("function"),Wo=Fo("number"),Ho=e=>null!==e&&"object"==typeof e,qo=e=>{if(!Ho(e))return!1;const t=Po(e);return!(null!==t&&t!==Object.prototype&&null!==Po(t)||wo(e,Ro)||wo(e,Oo))},zo=Uo("Date"),Yo=Uo("File"),Ko=Uo("Blob"),Qo=Uo("FileList"),Jo=Uo("Set");const Xo="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},Zo=void 0!==Xo.FormData?Xo.FormData:void 0,ei=Uo("URLSearchParams"),[ti,ni,si,ri]=["ReadableStream","Request","Response","Headers"].map(Uo);function ai(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let s,r;if("object"!=typeof e&&(e=[e]),jo(e))for(s=0,r=e.length;s<r;s++)t.call(null,e[s],s,e);else{if(ko(e))return;const r=n?Object.getOwnPropertyNames(e):Object.keys(e),a=r.length;let o;for(s=0;s<a;s++)o=r[s],t.call(null,e[o],o,e)}}function oi(e,t){if(ko(e))return null;t=t.toLowerCase();const n=Object.keys(e);let s,r=n.length;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const ii="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,ci=e=>!Vo(e)&&e!==ii;const li=(ui="undefined"!=typeof Uint8Array&&Po(Uint8Array),e=>ui&&e instanceof ui);var ui;const di=Uo("HTMLFormElement"),{propertyIsEnumerable:pi}=Object.prototype,gi=Uo("RegExp"),hi=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),s={};ai(n,((n,r)=>{let a;!1!==(a=t(n,r,e))&&(s[r]=a||n)})),Object.defineProperties(e,s)};const fi=Uo("AsyncFunction"),mi=(Ii="function"==typeof setImmediate,Ei=Go(ii.postMessage),Ii?setImmediate:Ei?(yi=`axios@${Math.random()}`,Ai=[],ii.addEventListener("message",(({source:e,data:t})=>{e===ii&&t===yi&&Ai.length&&Ai.shift()()}),!1),e=>{Ai.push(e),ii.postMessage(yi,"*")}):e=>setTimeout(e));var Ii,Ei,yi,Ai;const Ci="undefined"!=typeof queueMicrotask?queueMicrotask.bind(ii):"undefined"!=typeof process&&process.nextTick||mi,Si=e=>null!=e&&Go(e[Oo]),_i={isArray:jo,isArrayBuffer:Bo,isBuffer:ko,isFormData:e=>{if(!e)return!1;if(Zo&&e instanceof Zo)return!0;const t=Po(e);if(!t||t===Object.prototype)return!1;if(!Go(e.append))return!1;const n=Mo(e);return"formdata"===n||"object"===n&&Go(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Bo(e.buffer),t},isString:$o,isNumber:Wo,isBoolean:e=>!0===e||!1===e,isObject:Ho,isPlainObject:qo,isEmptyObject:e=>{if(!Ho(e)||ko(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:ti,isRequest:ni,isResponse:si,isHeaders:ri,isUndefined:Vo,isDate:zo,isFile:Yo,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:Ko,isRegExp:gi,isFunction:Go,isStream:e=>Ho(e)&&Go(e.pipe),isURLSearchParams:ei,isTypedArray:li,isFileList:Qo,forEach:ai,merge:function e(...t){const{caseless:n,skipUndefined:s}=ci(this)&&this||{},r={},a=(t,a)=>{if("__proto__"===a||"constructor"===a||"prototype"===a)return;const o=n&&"string"==typeof a&&oi(r,a)||a,i=bo(r,o)?r[o]:void 0;qo(i)&&qo(t)?r[o]=e(i,t):qo(t)?r[o]=e({},t):jo(t)?r[o]=t.slice():s&&Vo(t)||(r[o]=t)};for(let e=0,n=t.length;e<n;e++){const n=t[e];if(!n||ko(n))continue;if(ai(n,a),"object"!=typeof n||jo(n))continue;const s=Object.getOwnPropertySymbols(n);for(let e=0;e<s.length;e++){const t=s[e];pi.call(n,t)&&a(n[t],t)}}return r},extend:(e,t,n,{allOwnKeys:s}={})=>(ai(t,((t,s)=>{n&&Go(t)?Object.defineProperty(e,s,{__proto__:null,value:To(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,s,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})}),{allOwnKeys:s}),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,s)=>{e.prototype=Object.create(t.prototype,s),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,s)=>{let r,a,o;const i={};if(t=t||{},null==e)return t;do{for(r=Object.getOwnPropertyNames(e),a=r.length;a-- >0;)o=r[a],s&&!s(o,e,t)||i[o]||(t[o]=e[o],i[o]=!0);e=!1!==n&&Po(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:Mo,kindOfTest:Uo,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const s=e.indexOf(t,n);return-1!==s&&s===n},toArray:e=>{if(!e)return null;if(jo(e))return e;let t=e.length;if(!Wo(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Oo]).call(e);let s;for(;(s=n.next())&&!s.done;){const n=s.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const s=[];for(;null!==(n=e.exec(t));)s.push(n);return s},isHTMLForm:di,hasOwnProperty:bo,hasOwnProp:bo,hasOwnInPrototypeChain:wo,getSafeProp:(e,t)=>null!=e&&wo(e,t)?e[t]:void 0,toSafeFlatObject:e=>{if(null==e||"object"!=typeof e&&"function"!=typeof e)return e;const t=Po(e);if(null===t&&(e=>{if(!Object.isExtensible(e))return!1;const t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&t.push(...Object.getOwnPropertySymbols(e)),t.every((t=>{if(vo(t))return!1;const n=Object.getOwnPropertyDescriptor(e,t);return!!n&&n.configurable&&!0===n.writable}))})(e))return e;const n=Object.create(null),s=Object.create(null),r=[];let a=e;for(;null!=a&&-1===r.indexOf(a);){r.push(a);const o=a===e?t:Po(a);if(xo(a,o,a===e))break;const i=Object.getOwnPropertyNames(a);Object.getOwnPropertySymbols&&i.push(...Object.getOwnPropertySymbols(a));for(const t of i)vo(t)||bo(s,t)||(n[t]=e[t],s[t]=!0);a=o}return n},reduceDescriptors:hi,freezeMethods:e=>{hi(e,((t,n)=>{if(Go(e)&&["arguments","caller","callee"].includes(n))return!1;const s=e[n];Go(s)&&(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={},s=e=>{e.forEach((e=>{n[e]=!0}))};return jo(e)?s(e):s(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:oi,global:ii,isContextDefined:ci,isSpecCompliantForm:function(e){return!!(e&&Go(e.append)&&"FormData"===e[Ro]&&e[Oo])},toJSONObject:e=>{const t=new WeakSet,n=e=>{if(Ho(e)){if(t.has(e))return;if(ko(e))return e;if(!("toJSON"in e)){let s;if(t.add(e),Jo(e)){s=[];for(const t of e){const e=n(t);!Vo(e)&&s.push(e)}}else s=jo(e)?[]:{},ai(e,((e,t)=>{const r=n(e);!Vo(r)&&(s[t]=r)}));return t.delete(e),s}}return e};return n(e)},isAsyncFn:fi,isThenable:e=>e&&(Ho(e)||Go(e))&&Go(e.then)&&Go(e.catch),setImmediate:mi,asap:Ci,isIterable:Si,isSafeIterable:e=>null!=e&&wo(e,Oo)&&Si(e)},Ni=_i.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"]);const Ti=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),Di=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function Pi(e,t){return _i.isArray(e)?e.map((e=>Pi(e,t))):function(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(t,""))}function Oi(e){const t=Object.create(null);return _i.forEach(e.toJSON(),((e,n)=>{t[n]=(e=>Pi(e,Di))(e)})),t}const Ri=Symbol("internals");function bi(e){return e&&String(e).trim().toLowerCase()}function vi(e){return!1===e||null==e?e:_i.isArray(e)?e.map(vi):(e=>Pi(e,Ti))(String(e))}const xi=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function wi(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}function Mi(e,t,n,s,r){return _i.isFunction(s)?s.call(this,t,n):(r&&(t=n),_i.isString(t)?_i.isString(s)?-1!==t.indexOf(s):_i.isRegExp(s)?s.test(t):void 0:void 0)}class Li{constructor(e){e&&this.set(e)}set(e,t,n){const s=this;function r(e,t,n){const r=bi(t);if(!r)return;const a=_i.findKey(s,r);(!a||void 0===s[a]||!0===n||void 0===n&&!1!==s[a])&&(s[a||t]=vi(e))}const a=(e,t)=>_i.forEach(e,((e,n)=>r(e,n,t)));if(_i.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(_i.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))a((e=>{const t={};let n,s,r;return e&&e.split("\n").forEach((function(e){r=e.indexOf(":"),n=e.substring(0,r).trim().toLowerCase(),s=e.substring(r+1).trim();const a=_i.hasOwnProp(t,n);!n||a&&_i.hasOwnProp(Ni,n)||("set-cookie"===n?a?t[n].push(s):t[n]=[s]:t[n]=a?t[n]+", "+s:s)})),t})(e),t);else if(_i.isObject(e)&&_i.isSafeIterable(e)){let n,s,r=Object.create(null);for(const t of e){if(!_i.isArray(t))throw new TypeError("Object iterator must return a key-value pair");s=t[0],_i.hasOwnProp(r,s)?(n=r[s],r[s]=_i.isArray(n)?[...n,t[1]]:[n,t[1]]):r[s]=t[1]}a(r,t)}else null!=e&&r(t,e,n);return this}get(e,t){if(e=bi(e)){const n=_i.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 s;for(;s=n.exec(e);)t[s[1]]=s[2];return t}(e);if(_i.isFunction(t))return t.call(this,e,n);if(_i.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=bi(e)){const n=_i.findKey(this,e);return!(!n||void 0===this[n]||t&&!Mi(0,this[n],n,t))}return!1}delete(e,t){const n=this;let s=!1;function r(e){if(e=bi(e)){const r=_i.findKey(n,e);!r||t&&!Mi(0,n[r],r,t)||(delete n[r],s=!0)}}return _i.isArray(e)?e.forEach(r):r(e),s}clear(e){const t=Object.keys(this);let n=t.length,s=!1;for(;n--;){const r=t[n];e&&!Mi(0,this[r],r,e,!0)||(delete this[r],s=!0)}return s}normalize(e){const t=this,n={};return _i.forEach(this,((s,r)=>{const a=_i.findKey(n,r);if(a)return t[a]=vi(s),void delete t[r];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(r):String(r).trim();o!==r&&delete t[r],t[o]=vi(s),n[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return _i.forEach(this,((n,s)=>{null!=n&&!1!==n&&(t[s]=e&&_i.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(){const e=this.get("set-cookie");return _i.isArray(e)?e:null==e||!1===e?[]:[e]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static parseParameters(e){return function(e){const t=Object.create(null),n=String(e);let s=0,r=!1,a=!1;function o(e){const r=wi(n.slice(s,e)),a=r.indexOf("=");if(a<1)return;const o=wi(r.slice(0,a));if(!xi.test(o))return;const i=o.toLowerCase();if("__proto__"===i||"constructor"===i||"prototype"===i)return;const c=wi(r.slice(a+1));t[i]=function(e){const t=e.length-1;if(t<1||34!==e.charCodeAt(0)||34!==e.charCodeAt(t))return e;let n="";for(let s=1;s<t;s++){const r=e.charCodeAt(s);if(34===r)return e;if(92===r&&(s+=1,s>=t))return e;n+=e[s]}return n}(c)}for(let e=0;e<n.length;e++){const t=n.charCodeAt(e);r?a?a=!1:92===t?a=!0:34===t&&(r=!1):34===t?r=!0:44!==t&&59!==t||(o(e),s=e+1)}return o(n.length),t}(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[Ri]=this[Ri]={accessors:{}}).accessors,n=this.prototype;function s(e){const s=bi(e);t[s]||(!function(e,t){const n=_i.toCamelCase(" "+t);["get","set","has"].forEach((s=>{Object.defineProperty(e,s+n,{__proto__:null,value:function(e,n,r){return this[s].call(this,t,e,n,r)},configurable:!0})}))}(n,e),t[s]=!0)}return _i.isArray(e)?e.forEach(s):s(e),this}}Li.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),_i.reduceDescriptors(Li.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),_i.freezeMethods(Li);const Ui=Li,Fi="[REDACTED ****]";function ji(e,t){const n=new Set(t.map((e=>String(e).toLowerCase()))),s=[],r=e=>{if(null===e||"object"!=typeof e)return e;if(_i.isBuffer(e))return e;if(-1!==s.indexOf(e))return;let t;if(e instanceof Ui&&(e=e.toJSON()),s.push(e),_i.isArray(e))t=[],e.forEach(((e,n)=>{const s=r(e);_i.isUndefined(s)||(t[n]=s)}));else{if(!_i.isPlainObject(e)&&function(e){if(_i.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(_i.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(e))return s.pop(),e;t=Object.create(null);for(const[s,a]of Object.entries(e)){const e=n.has(s.toLowerCase())?Fi:r(a);_i.isUndefined(e)||(t[s]=e)}}return s.pop(),t};return r(e)}function Vi(e){try{return String(e)}catch(e){return""}}class ki extends Error{static from(e,t,n,s,r,a){let o=e.message;!o&&_i.isArray(e.errors)&&e.errors.length&&(o=function(e){return e.errors.map((e=>{try{return e&&e.message?Vi(e.message):Vi(e)}catch(e){return""}})).filter(Boolean).join("; ")||e.name||"AggregateError"}(e));const i=new ki(o,t||e.code,n,s,r);return Object.defineProperty(i,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),i.name=e.name,null!=e.status&&null==i.status&&(i.status=e.status),a&&Object.assign(i,a),i}constructor(e,t,n,s,r){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),s&&(this.request=s),r&&(this.response=r,this.status=r.status)}toJSON(){const e=this.config,t=e&&_i.hasOwnProp(e,"redact")?e.redact:void 0,n=_i.isArray(t)&&t.length>0?ji(e,t):_i.toJSONObject(e);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:n,code:this.code,status:this.status}}}ki.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",ki.ERR_BAD_OPTION="ERR_BAD_OPTION",ki.ECONNABORTED="ECONNABORTED",ki.ETIMEDOUT="ETIMEDOUT",ki.ECONNREFUSED="ECONNREFUSED",ki.ERR_NETWORK="ERR_NETWORK",ki.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",ki.ERR_DEPRECATED="ERR_DEPRECATED",ki.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",ki.ERR_BAD_REQUEST="ERR_BAD_REQUEST",ki.ERR_CANCELED="ERR_CANCELED",ki.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",ki.ERR_INVALID_URL="ERR_INVALID_URL",ki.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const Bi=ki,$i=null;function Gi(e){return _i.isPlainObject(e)||_i.isArray(e)}function Wi(e){return _i.endsWith(e,"[]")?e.slice(0,-2):e}function Hi(e,t,n){return e?e.concat(t).map((function(e,t){return e=Wi(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const qi=_i.toFlatObject(_i,{},null,(function(e){return/^is[A-Z]/.test(e)}));const zi=function(e,t,n){if(!_i.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const s=(e,t)=>{const s=_i.getSafeProp(n,e);return _i.isUndefined(s)?t:s},r=s("metaTokens",!0),a=s("visitor")||h,o=s("dots",!1),i=s("indexes",!1),c=s("Blob")||"undefined"!=typeof Blob&&Blob,l=s("maxDepth",100),u=c&&_i.isSpecCompliantForm(t),d=[];if(!_i.isFunction(a))throw new TypeError("visitor must be a function");function p(e){if(null===e)return"";if(_i.isDate(e))return e.toISOString();if(_i.isBoolean(e))return e.toString();if(!u&&_i.isBlob(e))throw new Bi("Blob is not supported. Use a Buffer instead.");if(_i.isArrayBuffer(e)||_i.isTypedArray(e)){if(u&&"function"==typeof c)return new c([e]);throw new Bi("Blob is not supported. Use a Buffer instead.",Bi.ERR_NOT_SUPPORT)}return e}function g(e){if(e>l)throw new Bi("Object is too deeply nested ("+e+" levels). Max depth: "+l,Bi.ERR_FORM_DATA_DEPTH_EXCEEDED)}function h(e,n,s){let a=e;if(_i.isReactNative(t)&&_i.isReactNativeBlob(e))return t.append(Hi(s,n,o),p(e)),!1;if(e&&!s&&"object"==typeof e)if(_i.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=function(e,t){if(l===1/0)return JSON.stringify(e);const n=[];return JSON.stringify(e,(function(e,s){if(!_i.isObject(s))return s;for(;n.length&&n[n.length-1]!==this;)n.pop();return n.push(s),g(t+n.length-1),s}))}(e,1);else if(_i.isArray(e)&&function(e){return _i.isArray(e)&&!e.some(Gi)}(e)||(_i.isFileList(e)||_i.endsWith(n,"[]"))&&(a=_i.toArray(e)))return n=Wi(n),a.forEach((function(e,s){!_i.isUndefined(e)&&null!==e&&t.append(!0===i?Hi([n],s,o):null===i?n:n+"[]",p(e))})),!1;return!!Gi(e)||(t.append(Hi(s,n,o),p(e)),!1)}const f=Object.assign(qi,{defaultVisitor:h,convertValue:p,isVisitable:Gi});if(!_i.isObject(e))throw new TypeError("data must be an object");return function e(n,s,r=0){if(!_i.isUndefined(n)){if(g(r),-1!==d.indexOf(n))throw new Error("Circular reference detected in "+s.join("."));d.push(n),_i.forEach(n,(function(n,o){!0===(!(_i.isUndefined(n)||null===n)&&a.call(t,n,_i.isString(o)?o.trim():o,s,f))&&e(n,s?s.concat(o):[o],r+1)})),d.pop()}}(e),t};function Yi(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,(function(e){return t[e]}))}function Ki(e,t){this._pairs=[],e&&zi(e,this,t)}const Qi=Ki.prototype;Qi.append=function(e,t){this._pairs.push([e,t])},Qi.toString=function(e){const t=e?t=>e.call(this,t,Yi):Yi;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const Ji=Ki;function Xi(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Zi(e,t,n){if(!t)return e;e=e||"";const s=_i.isFunction(n)?{serialize:n}:n,r=_i.getSafeProp(s,"encode")||Xi,a=_i.getSafeProp(s,"serialize");let o;if(o=a?a(t,s):_i.isURLSearchParams(t)?t.toString():new Ji(t,s).toString(r),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}const ec=Symbol("internals");function tc(e){return e?e.length:0}function nc(e){if(e)for(;e.length&&null===e[e.length-1];)e.pop()}function sc(e,t){const n=e.handlers,s=tc(n);n!==t.handlersRef?(t.handlersRef=n,t.handlerEntries.clear()):s!==t.handlersLength&&(s?t.handlerEntries.forEach((function(e,s){n[e.index]!==e.handler&&t.handlerEntries.delete(s)})):t.handlerEntries.clear()),t.handlersLength=s}const rc=class{constructor(){this.handlers=[],this[ec]={handlersRef:this.handlers,handlersLength:this.handlers.length,handlerEntries:new Map,iterationDepth:0,nextId:0}}use(e,t,n){const s={fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null},r=this[ec];null==this.handlers&&(this.handlers=[]),sc(this,r);const a=r.nextId++;return this.handlers.push(s),r.handlerEntries.set(a,{handler:s,index:this.handlers.length-1}),r.handlersLength=this.handlers.length,a}eject(e){const t=this[ec];sc(this,t);const n=t.handlerEntries.get(e);if(n){if(t.handlerEntries.delete(e),this.handlers[n.index]!==n.handler)return;this.handlers[n.index]=null,t.iterationDepth||(nc(this.handlers),t.handlersLength=this.handlers.length)}}clear(){this.handlers&&(this.handlers=[],sc(this,this[ec]))}forEach(e){const t=this[ec];sc(this,t),t.iterationDepth++;try{_i.forEach(this.handlers,(function(t){null!==t&&e(t)}))}finally{--t.iterationDepth||(sc(this,t),nc(this.handlers),t.handlersLength=tc(this.handlers))}}},ac={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},oc={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Ji,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},ic="undefined"!=typeof window&&"undefined"!=typeof document,cc="object"==typeof navigator&&navigator||void 0,lc=ic&&(!cc||["ReactNative","NativeScript","NS"].indexOf(cc.product)<0),uc="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,dc=ic&&window.location.href||"http://localhost",pc={...s,...oc};const gc=100;function hc(e){if(e>gc)throw new Bi("FormData field is too deeply nested ("+e+" levels). Max depth: "+gc,Bi.ERR_FORM_DATA_DEPTH_EXCEEDED)}const fc=function(e){function t(e,n,s,r){hc(r);let a=e[r++];if("__proto__"===a)return!0;const o=Number.isFinite(+a),i=r>=e.length;if(a=!a&&_i.isArray(s)?s.length:a,i)return _i.hasOwnProp(s,a)?s[a]=_i.isArray(s[a])?s[a].concat(n):[s[a],n]:s[a]=n,!o;_i.hasOwnProp(s,a)&&_i.isObject(s[a])||(s[a]=[]);return t(e,n,s[a],r)&&_i.isArray(s[a])&&(s[a]=function(e){const t={},n=Object.keys(e);let s;const r=n.length;let a;for(s=0;s<r;s++)a=n[s],t[a]=e[a];return t}(s[a])),!o}if(_i.isFormData(e)&&_i.isFunction(e.entries)){const n={};return _i.forEachEntry(e,((e,s)=>{t(function(e){const t=[],n=/[^.[\]]+|\[([^.[\]]*)]/g;let s;for(;null!==(s=n.exec(e));)hc(t.length),t.push("[]"===s[0]?"":s[1]||s[0]);return t}(e),s,n,0)})),n}return null},mc=Object.freeze(["get","delete","head","options","post","put","patch","purge","link","unlink","query"]),Ic=(e,t)=>null!=e&&_i.hasOwnProp(e,t)?e[t]:void 0;const Ec={transitional:ac,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",s=n.indexOf("application/json")>-1,r=_i.isObject(e);r&&_i.isHTMLForm(e)&&(e=new FormData(e));if(_i.isFormData(e))return s?JSON.stringify(fc(e)):e;if(_i.isArrayBuffer(e)||_i.isBuffer(e)||_i.isStream(e)||_i.isFile(e)||_i.isBlob(e)||_i.isReadableStream(e))return e;if(_i.isArrayBufferView(e))return e.buffer;if(_i.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(r){const t=Ic(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return zi(e,new pc.classes.URLSearchParams,{visitor:function(e,t,n,s){return pc.isNode&&_i.isBuffer(e)?(this.append(t,e.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}(e,t).toString();if((a=_i.isFileList(e))||n.indexOf("multipart/form-data")>-1){const n=Ic(this,"env"),s=n&&n.FormData;return zi(a?{"files[]":e}:e,s&&new s,t)}}return r||s?(t.setContentType("application/json",!1),function(e,t,n){if(_i.isString(e))try{return(t||JSON.parse)(e),_i.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=Ic(this,"transitional")||Ec.transitional,n=t&&t.forcedJSONParsing,s=Ic(this,"responseType"),r="json"===s;if(_i.isResponse(e)||_i.isReadableStream(e))return e;if(e&&_i.isString(e)&&(n&&!s||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,Ic(this,"parseReviver"))}catch(e){if(n){if("SyntaxError"===e.name)throw Bi.from(e,Bi.ERR_BAD_RESPONSE,this,null,Ic(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:pc.classes.FormData,Blob:pc.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};_i.forEach(mc,(e=>{Ec.headers[e]={}}));const yc=Ec;function Ac(e,t){const n=this||yc,s=t||n,r=Ui.from(s.headers);let a=s.data;return _i.forEach(e,(function(e){a=e.call(n,a,r.normalize(),t?t.status:void 0)})),r.normalize(),a}function Cc(e){return!(!e||!e.__CANCEL__)}const Sc=class extends Bi{constructor(e,t,n){super(null==e?"canceled":e,Bi.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function _c(e,t,n){const s=n.config.validateStatus;n.status&&s&&!s(n.status)?t(new Bi("Request failed with status code "+n.status,n.status>=400&&n.status<500?Bi.ERR_BAD_REQUEST:Bi.ERR_BAD_RESPONSE,n.config,n.request,n)):e(n)}const Nc=/[\t\n\r]/g;function Tc(e){if("string"!=typeof e)return e;let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t).replace(Nc,"")}function Dc(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}const Pc=function(e,t){e=e||10;const n=new Array(e),s=new Array(e);let r,a=0,o=0;return t=void 0!==t?t:1e3,function(i){const c=Date.now(),l=s[o];r||(r=c),n[a]=i,s[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-r<t)return;const p=l&&c-l;return p?Math.round(1e3*d/p):void 0}};const Oc=function(e,t){let n,s,r=0,a=1e3/t;const o=(t,a=Date.now())=>{r=a,n=null,s&&(clearTimeout(s),s=null),e(...t)};return[(...e)=>{const t=Date.now(),i=t-r;i>=a?o(e,t):(n=e,s||(s=setTimeout((()=>{s=null,o(n)}),a-i)))},()=>n&&o(n),(...e)=>o(e)]},Rc=(e,t,n=3)=>{let s=0;const r=Pc(50,250);return Oc((n=>{if(!n||!_i.isNumber(n.loaded))return;const a=n.loaded,o=n.lengthComputable?n.total:void 0,i=Math.max(0,null!=o?Math.min(a,o):a),c=Math.max(0,i-s),l=r(c);s=Math.max(s,i);e({loaded:i,total:o,progress:o?i/o:void 0,bytes:c,rate:l||void 0,estimated:l&&o?(o-i)/l:void 0,event:n,lengthComputable:null!=o,[t?"download":"upload"]:!0})}),n)},bc=(e,t)=>{const n=null!=e;return[s=>t[0]({lengthComputable:n,total:e,loaded:s}),t[1]]},vc=(e,t=_i.asap)=>(...n)=>t((()=>e(...n))),xc=pc.hasStandardBrowserEnv?(wc=new URL(pc.origin),Mc=pc.navigator&&/(msie|trident)/i.test(pc.navigator.userAgent),e=>(e=new URL(e,pc.origin),wc.protocol===e.protocol&&wc.host===e.host&&(Mc||wc.port===e.port))):()=>!0;var wc,Mc;const Lc=pc.hasStandardBrowserEnv?{write(e,t,n,s,r,a,o){if("undefined"==typeof document)return;const i=[`${e}=${encodeURIComponent(t)}`];_i.isNumber(n)&&i.push(`expires=${new Date(n).toUTCString()}`),_i.isString(s)&&i.push(`path=${s}`),_i.isString(r)&&i.push(`domain=${r}`),!0===a&&i.push("secure"),_i.isString(o)&&i.push(`SameSite=${o}`),document.cookie=i.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.split(";");for(let n=0;n<t.length;n++){const s=t[n].replace(/^\s+/,""),r=s.indexOf("=");if(-1!==r&&s.slice(0,r)===e)try{return decodeURIComponent(s.slice(r+1))}catch(e){return s.slice(r+1)}}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};const Uc=/^https?:(?!\/\/)/i;function Fc(e){const t=e.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${Fi}@`),n=t.indexOf("#"),s=(-1===n?t:t.slice(0,n)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${Fi}`);return-1===n?s:`${s}#${r=t.slice(n+1),r?r.replace(/(^|&)([^=&]*=)?[^&]+/g,((e,t,n="")=>`${t}${n}${Fi}`)):r}`;var r}function jc(e,t){if("string"==typeof e){const n=Tc(e);if(Uc.test(n))throw new Bi(`Invalid URL ${JSON.stringify(Fc(n))}: missing "//" after protocol`,Bi.ERR_INVALID_URL,t)}}function Vc(e,t,n,s){jc(t,s);let r=!("string"==typeof(a=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(a));var a;return e&&(r||!1===n)?(jc(e,s),function(e,t){if(!t)return e;let n=e.length;for(;n>0&&47===e.charCodeAt(n-1);)n--;return e.slice(0,n)+"/"+t.replace(/^\/+/,"")}(e,t)):t}const kc=e=>e instanceof Ui?{...e}:e,Bc=e=>Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(e).concat(Object.getOwnPropertySymbols(e).filter((t=>Object.getOwnPropertyDescriptor(e,t).enumerable))):Object.keys(e);function $c(e,t){e=e||{},t=t||{};const n=Object.create(null);function s(e,t,n,s){return _i.isPlainObject(e)&&_i.isPlainObject(t)?_i.merge.call({caseless:s},e,t):_i.isPlainObject(t)?_i.merge({},t):_i.isArray(t)?t.slice():t}function r(e,t,n,r){return _i.isUndefined(t)?_i.isUndefined(e)?void 0:s(void 0,e,0,r):s(e,t,0,r)}function a(e,t){if(!_i.isUndefined(t))return s(void 0,t)}function o(e,t){return _i.isUndefined(t)?_i.isUndefined(e)?void 0:s(void 0,e):s(void 0,t)}function i(n,r,a){return _i.hasOwnProp(t,a)?s(n,r):_i.hasOwnProp(e,a)?s(void 0,n):void 0}Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});const c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutErrorMessage: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,allowedSocketPaths:o,responseEncoding:o,validateStatus:i,headers:(e,t,n)=>r(kc(e),kc(t),0,!0)};return _i.forEach(Bc({...e,...t}),(function(s){if("__proto__"===s||"constructor"===s||"prototype"===s)return;const a=_i.hasOwnProp(c,s)?c[s]:r,o=a(_i.hasOwnProp(e,s)?e[s]:void 0,_i.hasOwnProp(t,s)?t[s]:void 0,s);_i.isUndefined(o)&&a!==i||(n[s]=o)})),_i.hasOwnProp(t,"validateStatus")&&_i.isUndefined(t.validateStatus)&&!1===function(n){const s=_i.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!_i.isUndefined(s)){if(!_i.isPlainObject(s))return;if(_i.hasOwnProp(s,n))return s[n]}const r=_i.hasOwnProp(e,"transitional")?e.transitional:void 0;if(_i.isPlainObject(r)&&_i.hasOwnProp(r,n))return r[n]}("validateStatusUndefinedResolves")&&(_i.hasOwnProp(e,"validateStatus")?n.validateStatus=s(void 0,e.validateStatus):delete n.validateStatus),n}const Gc=["content-type","content-length"];const Wc=function(e){const t=$c({},e),n=e=>_i.hasOwnProp(t,e)?t[e]:void 0,s=n("data");let r=n("withXSRFToken");const a=n("xsrfHeaderName"),o=n("xsrfCookieName");let i=n("headers");const c=n("auth"),l=n("baseURL"),u=n("allowAbsoluteUrls"),d=n("url");if(t.headers=i=Ui.from(i),t.url=Zi(Vc(l,d,u,t),n("params"),n("paramsSerializer")),c){const t=_i.getSafeProp(c,"username")||"",n=_i.getSafeProp(c,"password")||"";try{i.set("Authorization","Basic "+btoa(t+":"+(n?encodeURIComponent(n).replace(/%([0-9A-F]{2})/gi,((e,t)=>String.fromCharCode(parseInt(t,16)))):"")))}catch(t){throw Bi.from(t,Bi.ERR_BAD_OPTION_VALUE,e)}}if(_i.isFormData(s)){const e=_i.getSafeProp(s,"getHeaders");pc.hasStandardBrowserEnv||pc.hasStandardBrowserWebWorkerEnv||_i.isReactNative(s)?i.setContentType(void 0):_i.isFunction(e)&&function(e,t,n){"content-only"===n?Object.entries(t||{}).forEach((([t,n])=>{Gc.includes(t.toLowerCase())&&e.set(t,n)})):e.set(t)}(i,e.call(s),n("formDataHeaderPolicy"))}if(pc.hasStandardBrowserEnv){_i.isFunction(r)&&(r=r(t));if(!0===r||null==r&&xc(t.url)){const e=a&&o&&Lc.read(o);e&&i.set(a,e)}}return t},Hc="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const s=Wc(e);let r=s.data;const a=Ui.from(s.headers).normalize();let o,i,c,l,u,d,{responseType:p,onUploadProgress:g,onDownloadProgress:h}=s;function f(){l&&l(),u&&u(),s.cancelToken&&s.cancelToken.unsubscribe(o),s.signal&&s.signal.removeEventListener("abort",o)}let m=new XMLHttpRequest;function I(r){if(!m)return;if(!(0!==m.status||"file"===(Dc(Tc(s.url))||Dc(pc.origin))||m.responseURL&&m.responseURL.startsWith("file:")))return n(new Bi("Request aborted",Bi.ECONNABORTED,e,m)),f(),void(m=null);try{r?d&&d(r):u&&u()}catch(e){setTimeout((()=>{throw e}))}if(!m)return;const a=Ui.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());_c((function(e){t(e),f()}),(function(e){n(e),f()}),{data:p&&"text"!==p&&"json"!==p?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:a,config:e,request:m}),m=null}m.open(s.method.toUpperCase(),s.url,!0),m.timeout=s.timeout,"onloadend"in m?m.onloadend=I:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&m.responseURL.startsWith("file:"))&&setTimeout(I)},m.onabort=function(){m&&(n(new Bi("Request aborted",Bi.ECONNABORTED,e,m)),f(),m=null)},m.onerror=function(t){const s=t&&t.message?t.message:"Network Error",r=new Bi(s,Bi.ERR_NETWORK,e,m);r.event=t||null,n(r),f(),m=null},m.ontimeout=function(){let t=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const r=s.transitional||ac;s.timeoutErrorMessage&&(t=s.timeoutErrorMessage),n(new Bi(t,r.clarifyTimeoutError?Bi.ETIMEDOUT:Bi.ECONNABORTED,e,m)),f(),m=null},void 0===r&&a.setContentType(null),"setRequestHeader"in m&&_i.forEach(Oi(a),(function(e,t){m.setRequestHeader(t,e)})),_i.isUndefined(s.withCredentials)||(m.withCredentials=!!s.withCredentials),p&&"json"!==p&&(m.responseType=s.responseType),h&&([c,u,d]=Rc(h,!0),m.addEventListener("progress",c)),g&&m.upload&&([i,l]=Rc(g),m.upload.addEventListener("progress",i),m.upload.addEventListener("loadend",l)),(s.cancelToken||s.signal)&&(o=t=>{m&&(n(!t||t.type?new Sc(null,e,m):t),m.abort(),f(),m=null)},s.cancelToken&&s.cancelToken.subscribe(o),s.signal&&(s.signal.aborted?o():s.signal.addEventListener("abort",o)));const E=Dc(s.url);if(E&&!pc.protocols.includes(E))return n(new Bi("Unsupported protocol "+E+":",Bi.ERR_BAD_REQUEST,e)),void f();m.send(r||null)}))},qc=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const n=new AbortController;let s=!1;const r=function(e){if(!s){s=!0,o();const t=e instanceof Error?e:this.reason;n.abort(t instanceof Bi?t:new Sc(t instanceof Error?t.message:t))}};let a=t&&setTimeout((()=>{a=null,r(new Bi(`timeout of ${t}ms exceeded`,Bi.ETIMEDOUT))}),t);const o=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(r):e.removeEventListener("abort",r)})),e=null)};e.forEach((e=>{s||(e.aborted?r.call(e):e.addEventListener("abort",r,{once:!0}))}));const{signal:i}=n;return i.unsubscribe=()=>_i.asap(o),i},zc=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let s,r=0;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},Yc=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()}},Kc=(e,t,n,s)=>{const r=async function*(e,t){for await(const n of Yc(e))yield*zc(n,t)}(e,t);let a,o=0,i=e=>{a||(a=!0,s&&s(e))};return new ReadableStream({async pull(e){try{const{done:t,value:s}=await r.next();if(t)return i(),void e.close();let a=s.byteLength;if(n){let e=o+=a;n(e)}e.enqueue(new Uint8Array(s))}catch(e){throw i(e),e}},cancel:e=>(i(e),r.return())},{highWaterMark:2})},Qc=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,Jc=(e,t,n)=>t+2<n&&Qc(e.charCodeAt(t+1))&&Qc(e.charCodeAt(t+2)),Xc=e=>e<=57?e-48:(223&e)-55,Zc=e=>e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||43===e||47===e||45===e||95===e,el=e=>{const t=e.length;let n=0;return t>0&&61===e.charCodeAt(t-1)&&(n++,t>1&&61===e.charCodeAt(t-2)&&n++),Math.floor(3*(t-n)/4)},tl=e=>{const t=e.length;let n=0,s=0,r=!1;for(let o=0;o<t;o++){let i=e.charCodeAt(o);37===i&&Jc(e,o,t)&&(i=16*Xc(e.charCodeAt(o+1))+Xc(e.charCodeAt(o+2)),o+=2),9!==(a=i)&&10!==a&&12!==a&&13!==a&&32!==a&&(61!==i?!Zc(i)||s>0?r=!0:n++:s++)}var a;return r||s>2||s>0&&(n+s)%4!=0||n%4==1?el(e):(e=>{const t=e%4;return 3*Math.floor(e/4)+(2===t?1:3===t?2:0)})(n)},nl=(e,t)=>{if(!e||"string"!=typeof e)return 0;if(!e.startsWith("data:"))return 0;const n=e.indexOf(",");if(n<0)return 0;const s=e.slice(5,n),r=e.slice(n+1);if(/;base64/i.test(s))return t(r);let a=0;for(let e=0,t=r.length;e<t;e++){const n=r.charCodeAt(e);if(37===n&&Jc(r,e,t))a+=1,e+=2;else if(n<128)a+=1;else if(n<2048)a+=2;else if(n>=55296&&n<=56319&&e+1<t){const t=r.charCodeAt(e+1);t>=56320&&t<=57343?(a+=4,e++):a+=3}else a+=3}return a};const sl="1.20.0",rl={cache:"default",redirect:"follow",referrer:"about:client",referrerPolicy:"",mode:"cors",integrity:"",keepalive:!1,priority:"auto",window:null},{isFunction:al}=_i,ol=e=>{if(!_i.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},il=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},cl=e=>{const t=void 0!==_i.global&&null!==_i.global?_i.global:globalThis,{ReadableStream:n,TextEncoder:s}=t;e=_i.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:r,Request:a,Response:o}=e,i=r?al(r):"function"==typeof fetch,c=al(a),l=al(o);if(!i)return!1;const u=i&&al(n),d=i&&("function"==typeof s?(p=new s,e=>p.encode(e)):async e=>new Uint8Array(await new a(e).arrayBuffer()));var p;const g=c&&u&&il((()=>{let e=!1;const t=new a(pc.origin,{body:new n,method:"POST",get duplex(){return e=!0,"half"}}),s=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!s})),h=l&&u&&il((()=>_i.isReadableStream(new o("").body))),f={stream:h&&(e=>e.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!f[e]&&(f[e]=(t,n)=>{let s=t&&t[e];if(s)return s.call(t);throw new Bi(`Response type '${e}' is not supported`,Bi.ERR_NOT_SUPPORT,n)})}));const m=async e=>{if(null==e)return 0;if(_i.isBlob(e))return e.size;if(_i.isSpecCompliantForm(e)){const t=new a(pc.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return _i.isArrayBufferView(e)||_i.isArrayBuffer(e)?e.byteLength:(_i.isURLSearchParams(e)&&(e+=""),_i.isString(e)?(await d(e)).byteLength:void 0)};return async e=>{let{url:t,method:n,data:i,signal:l,cancelToken:d,timeout:p,onDownloadProgress:I,onUploadProgress:E,responseType:y,headers:A,withCredentials:C="same-origin",fetchOptions:S,maxContentLength:_,maxBodyLength:N,maxRedirects:T}=Wc(e);const D=_i.isNumber(_)&&_>-1,P=_i.isNumber(N)&&N>-1;let O=r||fetch;y=y?(y+"").toLowerCase():"text";let R=qc([l,d&&d.toAbortSignal()],p),b=null;const v=R&&R.unsubscribe&&(()=>{R.unsubscribe()});let x,w=null;const M=()=>new Bi("Request body larger than maxBodyLength limit",Bi.ERR_BAD_REQUEST,e,b);try{let r;const l=(U="auth",_i.hasOwnProp(e,U)?e[U]:void 0);if(l){const e=_i.getSafeProp(l,"username")||"";r={username:e,password:_i.getSafeProp(l,"password")||""}}if((e=>{const t=e.indexOf("://");let n=e;return-1!==t&&(n=n.slice(t+3)),n.includes("@")||n.includes(":")})(t)){const e=new URL(t,pc.origin);if(!r&&(e.username||e.password)){const t=ol(e.username);r={username:t,password:ol(e.password)}}(e.username||e.password)&&(e.username="",e.password="",t=e.href)}if(r&&(A.delete("authorization"),A.set("Authorization","Basic "+btoa((L=(r.username||"")+":"+(r.password||""),encodeURIComponent(L).replace(/%([0-9A-F]{2})/gi,((e,t)=>String.fromCharCode(parseInt(t,16)))))))),D&&"string"==typeof t&&t.startsWith("data:")){const n=function(e){const t="string"==typeof e?e.indexOf("#"):-1;return nl(-1===t?e:e.slice(0,t),tl)}(t);if(n>_)throw new Bi("maxContentLength size of "+_+" exceeded",Bi.ERR_BAD_RESPONSE,e,b)}if(P&&"get"!==n&&"head"!==n){const e=await m(i);if("number"==typeof e&&isFinite(e)&&(x=e,e>N))throw M()}const d=P&&(_i.isReadableStream(i)||_i.isStream(i)),p=(e,t,n)=>Kc(e,65536,(e=>{if(P&&e>N)throw w=M();t&&t(e)}),n);if(g&&"get"!==n&&"head"!==n&&(E||d)){if(x=null==x?await(async(e,t)=>{const n=_i.toFiniteNumber(e.getContentLength());return null==n?m(t):n})(A,i):x,0!==x||d){let e,n=new a(t,{method:"POST",body:i,duplex:"half"});if(_i.isFormData(i)&&(e=n.headers.get("content-type"))&&A.setContentType(e),n.body){const[e,t]=E&&bc(x,Rc(vc(E)))||[];i=p(n.body,e,t)}}}else if(d&&!c&&u&&"get"!==n&&"head"!==n)i=p(i);else if(d&&c&&!g&&"get"!==n&&"head"!==n)throw new Bi("Stream request bodies are not supported by the current fetch implementation",Bi.ERR_NOT_SUPPORT,e,b);_i.isString(C)||(C=C?"include":"omit");const F=c&&"credentials"in a.prototype;if(_i.isFormData(i)){const e=A.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&A.delete("content-type")}A.set("User-Agent","axios/"+sl,!1);const j=null==S?S:Object.assign(Object.create(null),S);j&&(delete j.body,delete j.headers,delete j.method,delete j.signal,delete j.duplex,delete j.credentials);const V=Object.assign(Object.create(null),j,{signal:R,method:n.toUpperCase(),headers:Oi(A.normalize()),body:i,duplex:"half",credentials:F?C:void 0});c&&(_i.forEach(rl,((e,t)=>{void 0===V[t]&&(V[t]=e)})),void 0===V.signal&&(V.signal=null),void 0===V.body&&(V.body=null)),0===T&&(V.redirect="manual",j&&(j.redirect="manual")),b=c&&new a(t,V);let k=await(c?O(b,j):O(t,V));const B=Ui.from(k.headers);if(D){const t=_i.toFiniteNumber(B.getContentLength());if(null!=t&&t>_)throw new Bi("maxContentLength size of "+_+" exceeded",Bi.ERR_BAD_RESPONSE,e,b)}const $=h&&("stream"===y||"response"===y);if(h&&k.body&&(I||D||$&&v)){const t={};["status","statusText","headers"].forEach((e=>{t[e]=k[e]}));const n=_i.toFiniteNumber(B.getContentLength()),[s,r]=I&&bc(n,Rc(vc(I),!0))||[];let a=0;const i=t=>{if(D&&(a=t,a>_))throw new Bi("maxContentLength size of "+_+" exceeded",Bi.ERR_BAD_RESPONSE,e,b);s&&s(t)};k=new o(Kc(k.body,65536,i,(()=>{r&&r(),v&&v()})),t)}y=y||"text";let G=await f[_i.findKey(f,y)||"text"](k,e);if(D&&!h&&!$){let t;if(null!=G&&("number"==typeof G.byteLength?t=G.byteLength:"number"==typeof G.size?t=G.size:"string"==typeof G&&(t="function"==typeof s?(new s).encode(G).byteLength:G.length)),"number"==typeof t&&t>_)throw new Bi("maxContentLength size of "+_+" exceeded",Bi.ERR_BAD_RESPONSE,e,b)}return!$&&v&&v(),await new Promise(((t,n)=>{_c(t,n,{data:G,headers:Ui.from(k.headers),status:k.status,statusText:k.statusText,config:e,request:b})}))}catch(t){if(v&&v(),R&&R.aborted&&R.reason instanceof Bi){const n=R.reason;throw n.config=e,b&&(n.request=b),t!==n&&Object.defineProperty(n,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),n}if(w)throw b&&!w.request&&(w.request=b),w;if(t instanceof Bi)throw b&&!t.request&&(t.request=b),t;if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message)){const n=new Bi("Network Error",Bi.ERR_NETWORK,e,b,t&&t.response);throw Object.defineProperty(n,"cause",{__proto__:null,value:t.cause||t,writable:!0,enumerable:!1,configurable:!0}),n}throw Bi.from(t,t&&t.code,e,b,t&&t.response)}var L,U}},ll=new Map,ul=e=>{let t=e&&e.env||{};const{fetch:n,Request:s,Response:r}=t,a=[s,r,n];let o,i,c=a.length,l=ll;for(;c--;)o=a[c],i=l.get(o),void 0===i&&l.set(o,i=c?new Map:cl(t)),l=i;return i},dl=(ul(),{http:$i,xhr:Hc,fetch:{get:ul}});_i.forEach(dl,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}}));const pl=e=>`- ${e}`,gl=e=>_i.isFunction(e)||null===e||!1===e;const hl={getAdapter:function(e,t){e=_i.isArray(e)?e:[e];const{length:n}=e;let s,r;const a={};for(let o=0;o<n;o++){let n;if(s=e[o],r=s,!gl(s)&&(r=dl[(n=String(s)).toLowerCase()],void 0===r))throw new Bi(`Unknown adapter '${n}'`);if(r&&(_i.isFunction(r)||(r=r.get(t))))break;a[n||"#"+o]=r}if(!r){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(pl).join("\n"):" "+pl(e[0]):"as no adapter specified";throw new Bi("There is no suitable adapter to dispatch the request "+t,Bi.ERR_NOT_SUPPORT)}return r},adapters:dl};function fl(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Sc(null,e)}function ml(e){const t=_i.toSafeFlatObject(e);fl(t),t.headers=Ui.from(_i.getSafeProp(t,"headers")),t.data=Ac.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1);return hl.getAdapter(t.adapter||yc.adapter,t)(t).then((function(e){fl(t),t.response=e;try{e.data=Ac.call(t,t.transformResponse,e)}finally{delete t.response}return e.headers=Ui.from(e.headers),e}),(function(e){if(!Cc(e)&&(fl(t),e&&e.response)){t.response=e.response;try{e.response.data=Ac.call(t,t.transformResponse,e.response)}finally{delete t.response}e.response.headers=Ui.from(e.response.headers)}return Promise.reject(e)}))}const Il={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Il[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const El={};Il.transitional=function(e,t,n){function s(e,t){return"[Axios v"+sl+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,r,a)=>{if(!1===e)throw new Bi(s(r," has been removed"+(t?" in "+t:"")),Bi.ERR_DEPRECATED);return t&&!El[r]&&(El[r]=!0,console.warn(s(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,a)}},Il.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const yl={assertOptions:function(e,t,n){if("object"!=typeof e||null===e)throw new Bi("options must be an object",Bi.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let r=s.length;for(;r-- >0;){const a=s[r],o=Object.prototype.hasOwnProperty.call(t,a)?t[a]:void 0;if(o){const t=e[a],n=void 0===t||o(t,a,e);if(!0!==n)throw new Bi("option "+a+" must be "+n,Bi.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Bi("Unknown option "+a,Bi.ERR_BAD_OPTION)}},validators:Il},Al=yl.validators;class Cl{constructor(e){this.defaults=e||{},this.interceptors={request:new rc,response:new rc}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error)try{let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack;let s="";if("string"==typeof n){const e=n.indexOf("\n");s=-1===e?"":n.slice(e+1)}if(e.stack){if(s){const t=s.indexOf("\n"),n=-1===t?-1:s.indexOf("\n",t+1),r=-1===n?"":s.slice(n+1);String(e.stack).endsWith(r)||(e.stack+="\n"+s)}}else e.stack=s}catch(e){}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=$c(this.defaults,t);const{transitional:n,paramsSerializer:s,headers:r}=t;void 0!==n&&yl.assertOptions(n,{silentJSONParsing:Al.transitional(Al.boolean),forcedJSONParsing:Al.transitional(Al.boolean),clarifyTimeoutError:Al.transitional(Al.boolean),legacyInterceptorReqResOrdering:Al.transitional(Al.boolean),advertiseZstdAcceptEncoding:Al.transitional(Al.boolean),validateStatusUndefinedResolves:Al.transitional(Al.boolean)},!1),null!=s&&(_i.isFunction(s)?t.paramsSerializer={serialize:s}:yl.assertOptions(s,{encode:Al.function,serialize:Al.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),yl.assertOptions(t,{baseUrl:Al.spelling("baseURL"),withXsrfToken:Al.spelling("withXSRFToken")},!0),t.method=(_i.getSafeProp(t,"method")||_i.getSafeProp(this.defaults,"method")||"get").toLowerCase();let a=r&&_i.merge(r.common,r[t.method]);r&&_i.forEach(mc.concat("common"),(e=>{delete r[e]})),t.headers=Ui.concat(a,r);const o=[];let i=!0;this.interceptors.request.forEach((function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;i=i&&e.synchronous;const n=t.transitional||ac;n&&n.legacyInterceptorReqResOrdering?o.unshift(e.fulfilled,e.rejected):o.push(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=[ml.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?e(p):p}catch(e){if(!t){l=Promise.reject(e);break}try{const n=t.call(this,e);_i.isThenable(n)&&(l=Promise.resolve(n).then((()=>ml.call(this,p))))}catch(e){l=Promise.reject(e)}break}}if(!l)try{l=ml.call(this,p)}catch(e){l=Promise.reject(e)}for(d=0,u=c.length;d<u;)l=l.then(c[d++],c[d++]);return l}getUri(e){return Zi(Vc((e=$c(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}}_i.forEach(["delete","get","head","options"],(function(e){Cl.prototype[e]=function(t,n){return this.request($c(n||{},{method:e,url:t,data:n&&_i.hasOwnProp(n,"data")?n.data:void 0}))}})),_i.forEach(["post","put","patch","query"],(function(e){function t(t){return function(n,s,r){return this.request($c(r||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:s}))}}Cl.prototype[e]=t(),"query"!==e&&(Cl.prototype[e+"Form"]=t(!0))}));const Sl=Cl;class _l{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 s=new Promise((e=>{n.subscribe(e),t=e})).then(e);return s.cancel=function(){n.unsubscribe(t)},s},e((function(e,s,r){n.reason||(n.reason=new Sc(e,s,r),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 _l((function(t){e=t})),cancel:e}}}const Nl=_l;const Tl={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,ContentTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,UnprocessableContent: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,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Tl).forEach((([e,t])=>{void 0===Tl[t]&&(Tl[t]=e)}));const Dl=Tl;const Pl=function e(t){const n=new Sl(t),s=To(Sl.prototype.request,n);return _i.extend(s,Sl.prototype,n,{allOwnKeys:!0}),_i.extend(s,n,null,{allOwnKeys:!0}),s.create=function(n){return e($c(t,n))},s}(yc);Pl.Axios=Sl,Pl.CanceledError=Sc,Pl.CancelToken=Nl,Pl.isCancel=Cc,Pl.VERSION=sl,Pl.toFormData=zi,Pl.AxiosError=Bi,Pl.Cancel=Pl.CanceledError,Pl.all=function(e){return Promise.all(e)},Pl.spread=function(e){return function(t){return e.apply(null,t)}},Pl.isAxiosError=function(e){return _i.isObject(e)&&!0===e.isAxiosError},Pl.mergeConfig=$c,Pl.AxiosHeaders=Ui,Pl.formToJSON=e=>fc(_i.isHTMLForm(e)?new FormData(e):e),Pl.getAdapter=hl.getAdapter,Pl.HttpStatusCode=Dl,Pl.default=Pl;const Ol=Pl;function Rl(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 bl=Rl((function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}}));var vl=function(e,t){return vl=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])},vl(e,t)};function xl(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}vl(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function wl(e,t,n,s){return new(n||(n=Promise))((function(r,a){function o(e){try{c(s.next(e))}catch(e){a(e)}}function i(e){try{c(s.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,i)}c((s=s.apply(e,t||[])).next())}))}function Ml(e,t){var n,s,r,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[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,s&&(r=2&i[0]?s.return:i[0]?s.throw||((r=s.return)&&r.call(s),0):s.next)&&!(r=r.call(s,i[1])).done)return r;switch(s=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,s=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],s=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}Object.create;function Ll(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],s=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&s>=e.length&&(e=void 0),{value:e&&e[s++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ul(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var s,r,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(s=a.next()).done;)o.push(s.value)}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return o}function Fl(e,t,n){if(n||2===arguments.length)for(var s,r=0,a=t.length;r<a;r++)!s&&r in t||(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}function jl(e){return this instanceof jl?(this.v=e,this):new jl(e)}function Vl(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s,r=n.apply(e,t||[]),a=[];return s=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)}})),s[Symbol.asyncIterator]=function(){return this},s;function o(e,t){r[e]&&(s[e]=function(t){return new Promise((function(n,s){a.push([e,t,n,s])>1||i(e,t)}))},t&&(s[e]=t(s[e])))}function i(e,t){try{(n=r[e](t)).value instanceof jl?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 kl(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=Ll(e),t={},s("next"),s("throw"),s("return"),t[Symbol.asyncIterator]=function(){return this},t);function s(n){t[n]=e[n]&&function(t){return new Promise((function(s,r){(function(e,t,n,s){Promise.resolve(s).then((function(t){e({value:t,done:n})}),t)})(s,r,(t=e[n](t)).done,t.value)}))}}}Object.create;"function"==typeof SuppressedError&&SuppressedError;var Bl=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function $l(e){return"function"==typeof e}function Gl(e){return $l(null==e?void 0:e.then)}var Wl=Rl((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 Hl(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var ql=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var t;return e.prototype.unsubscribe=function(){var e,t,n,s,r;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var o=Ll(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($l(c))try{c()}catch(e){r=e instanceof Wl?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var u=Ll(l),d=u.next();!d.done;d=u.next()){var p=d.value;try{Kl(p)}catch(e){r=null!=r?r:[],e instanceof Wl?r=Fl(Fl([],Ul(r)),Ul(e.errors)):r.push(e)}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(s=u.return)&&s.call(u)}finally{if(n)throw n.error}}}if(r)throw new Wl(r)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)Kl(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)&&Hl(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&Hl(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}(),zl=ql.EMPTY;function Yl(e){return e instanceof ql||e&&"closed"in e&&$l(e.remove)&&$l(e.add)&&$l(e.unsubscribe)}function Kl(e){$l(e)?e():e.unsubscribe()}var Ql={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Jl={setTimeout:function(e,t){for(var n=[],s=2;s<arguments.length;s++)n[s-2]=arguments[s];var r=Jl.delegate;return(null==r?void 0:r.setTimeout)?r.setTimeout.apply(r,Fl([e,t],Ul(n))):setTimeout.apply(void 0,Fl([e,t],Ul(n)))},clearTimeout:function(e){var t=Jl.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function Xl(e){Jl.setTimeout((function(){var t=Ql.onUnhandledError;if(!t)throw e;t(e)}))}function Zl(){}var eu=tu("C",void 0,void 0);function tu(e,t,n){return{kind:e,value:t,error:n}}var nu=null;function su(e){if(Ql.useDeprecatedSynchronousErrorHandling){var t=!nu;if(t&&(nu={errorThrown:!1,error:null}),e(),t){var n=nu,s=n.errorThrown,r=n.error;if(nu=null,s)throw r}}else e()}var ru=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,Yl(t)&&t.add(n)):n.destination=du,n}return xl(t,e),t.create=function(e,t,n){return new cu(e,t,n)},t.prototype.next=function(e){this.isStopped?uu(function(e){return tu("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?uu(tu("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?uu(eu,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}(ql),au=Function.prototype.bind;function ou(e,t){return au.call(e,t)}var iu=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){lu(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){lu(e)}else lu(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){lu(e)}},e}(),cu=function(e){function t(t,n,s){var r,a,o=e.call(this)||this;$l(t)||!t?r={next:null!=t?t:void 0,error:null!=n?n:void 0,complete:null!=s?s:void 0}:o&&Ql.useDeprecatedNextContext?((a=Object.create(t)).unsubscribe=function(){return o.unsubscribe()},r={next:t.next&&ou(t.next,a),error:t.error&&ou(t.error,a),complete:t.complete&&ou(t.complete,a)}):r=t;return o.destination=new iu(r),o}return xl(t,e),t}(ru);function lu(e){var t;Ql.useDeprecatedSynchronousErrorHandling?(t=e,Ql.useDeprecatedSynchronousErrorHandling&&nu&&(nu.errorThrown=!0,nu.error=t)):Xl(e)}function uu(e,t){var n=Ql.onStoppedNotification;n&&Jl.setTimeout((function(){return n(e,t)}))}var du={closed:!0,next:Zl,error:function(e){throw e},complete:Zl},pu="function"==typeof Symbol&&Symbol.observable||"@@observable";function gu(e){return e}function hu(e){return 0===e.length?gu:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var fu=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 s,r=this,a=(s=e)&&s instanceof ru||function(e){return e&&$l(e.next)&&$l(e.error)&&$l(e.complete)}(s)&&Yl(s)?e:new cu(e,t,n);return su((function(){var e=r,t=e.operator,n=e.source;a.add(t?t.call(a,n):n?r._subscribe(a):r._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=mu(t))((function(t,s){var r=new cu({next:function(t){try{e(t)}catch(e){s(e),r.unsubscribe()}},error:s,complete:t});n.subscribe(r)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[pu]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return hu(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=mu(e))((function(e,n){var s;t.subscribe((function(e){return s=e}),(function(e){return n(e)}),(function(){return e(s)}))}))},e.create=function(t){return new e(t)},e}();function mu(e){var t;return null!==(t=null!=e?e:Ql.Promise)&&void 0!==t?t:Promise}function Iu(e){return $l(e[pu])}function Eu(e){return Symbol.asyncIterator&&$l(null==e?void 0:e[Symbol.asyncIterator])}function yu(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 Au="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function Cu(e){return $l(null==e?void 0:e[Au])}function Su(e){return Vl(this,arguments,(function(){var t,n,s;return Ml(this,(function(r){switch(r.label){case 0:t=e.getReader(),r.label=1;case 1:r.trys.push([1,,9,10]),r.label=2;case 2:return[4,jl(t.read())];case 3:return n=r.sent(),s=n.value,n.done?[4,jl(void 0)]:[3,5];case 4:return[2,r.sent()];case 5:return[4,jl(s)];case 6:return[4,r.sent()];case 7:return r.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}function _u(e){return $l(null==e?void 0:e.getReader)}function Nu(e){if(e instanceof fu)return e;if(null!=e){if(Iu(e))return r=e,new fu((function(e){var t=r[pu]();if($l(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(Bl(e))return s=e,new fu((function(e){for(var t=0;t<s.length&&!e.closed;t++)e.next(s[t]);e.complete()}));if(Gl(e))return n=e,new fu((function(e){n.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,Xl)}));if(Eu(e))return Tu(e);if(Cu(e))return t=e,new fu((function(e){var n,s;try{for(var r=Ll(t),a=r.next();!a.done;a=r.next()){var o=a.value;if(e.next(o),e.closed)return}}catch(e){n={error:e}}finally{try{a&&!a.done&&(s=r.return)&&s.call(r)}finally{if(n)throw n.error}}e.complete()}));if(_u(e))return Tu(Su(e))}var t,n,s,r;throw yu(e)}function Tu(e){return new fu((function(t){(function(e,t){var n,s,r,a;return wl(this,void 0,void 0,(function(){var o,i;return Ml(this,(function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=kl(e),c.label=1;case 1:return[4,n.next()];case 2:if((s=c.sent()).done)return[3,4];if(o=s.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(),r={error:i},[3,11];case 6:return c.trys.push([6,,9,10]),s&&!s.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(r)throw r.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}function Du(e,t,n,s,r){void 0===s&&(s=0),void 0===r&&(r=!1);var a=t.schedule((function(){n(),r?e.add(this.schedule(null,s)):this.unsubscribe()}),s);if(e.add(a),!r)return a}function Pu(e){return function(t){if(function(e){return $l(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 Ou(e,t,n,s,r){return new Ru(e,t,n,s,r)}var Ru=function(e){function t(t,n,s,r,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=r?function(e){try{r(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,i._complete=s?function(){try{s()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,i}return xl(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}(ru);function bu(e,t){return void 0===t&&(t=0),Pu((function(n,s){n.subscribe(Ou(s,(function(n){return Du(s,e,(function(){return s.next(n)}),t)}),(function(){return Du(s,e,(function(){return s.complete()}),t)}),(function(n){return Du(s,e,(function(){return s.error(n)}),t)})))}))}function vu(e,t){return void 0===t&&(t=0),Pu((function(n,s){s.add(e.schedule((function(){return n.subscribe(s)}),t))}))}function xu(e,t){if(!e)throw new Error("Iterable cannot be null");return new fu((function(n){Du(n,t,(function(){var s=e[Symbol.asyncIterator]();Du(n,t,(function(){s.next().then((function(e){e.done?n.complete():n.next(e.value)}))}),0,!0)}))}))}function wu(e,t){if(null!=e){if(Iu(e))return function(e,t){return Nu(e).pipe(vu(t),bu(t))}(e,t);if(Bl(e))return function(e,t){return new fu((function(n){var s=0;return t.schedule((function(){s===e.length?n.complete():(n.next(e[s++]),n.closed||this.schedule())}))}))}(e,t);if(Gl(e))return function(e,t){return Nu(e).pipe(vu(t),bu(t))}(e,t);if(Eu(e))return xu(e,t);if(Cu(e))return function(e,t){return new fu((function(n){var s;return Du(n,t,(function(){s=e[Au](),Du(n,t,(function(){var e,t,r;try{t=(e=s.next()).value,r=e.done}catch(e){return void n.error(e)}r?n.complete():n.next(t)}),0,!0)})),function(){return $l(null==s?void 0:s.return)&&s.return()}}))}(e,t);if(_u(e))return function(e,t){return xu(Su(e),t)}(e,t)}throw yu(e)}function Mu(e,t){return t?wu(e,t):Nu(e)}function Lu(e){return Pu((function(t,n){var s,r=null,a=!1;r=t.subscribe(Ou(n,void 0,void 0,(function(o){s=Nu(e(o,Lu(e)(t))),r?(r.unsubscribe(),r=null,s.subscribe(n)):a=!0}))),a&&(r.unsubscribe(),r=null,s.subscribe(n))}))}class Uu{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((s=>s.type===e&&s.name===t&&s.props.index===n))}addNode(e,t,n={}){let s=this.getNode(e,t,n.index);return s?s.props=n:(s=new Uu(e,t,n),s.parent=this,this.children.push(s)),s}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 s=this.children[n];if(s.props.index===t&&s.name===e){this.children.splice(n,1);break}}}}const Fu=Uu;const ju=class{constructor(e,t,n,s={}){this.type=Fs.CONTEXT_TREE_NODE_TYPES.WHEN,this.subType=e,this.referenceName=t,this.name=n,this.props=s}},Vu=/(([^.]+)\[\d+\])/g,ku=e=>{if((e?.split(".")??[]).length<3)return[e];const t=e?.match(Vu);if(!t)return[e];let n,s=t[t.length-1];return e=e?.split(s)[0],e=e?.substring(0,e.length-1),[s,n]=s.split("["),n=n?.split("]")[0],[e,s,n]},Bu=(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:$u,WHEN:Gu,DECLARATIVE_TARGET:Wu,PAGELIST:Hu}=js.CONTEXT_TREE_NODE_TYPES;let qu;const zu=class{constructor(e,t,n={}){this.type=e,this.name=t,this.children=[],this.eventSubscribers=[],this.props=n,this.references=new Map([[$u,new Map],[Gu,new Map],[Wu,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===Hu){const n=this.references.get($u);n.set(e,t),this.references.set($u,n)}}}removePageListNodes(e,t){const n=this.children.filter((t=>t.name.startsWith(e))).filter((n=>{const s=Bu(n.name,e);return-1!==s&&+s>=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),s=t?.parent;s?.removeChildNode(e)}const s=this.references.get($u),r=this.references.get(Wu);[...s.keys(),...r.keys()].filter((t=>t.startsWith(e))).filter((e=>{const[,,n]=ku(e);return+n>=t})).forEach((e=>{const t=s.get(e),n=t?.parent;n?.removeChildren(),s.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((s=>s.type===e&&s.name===t&&s.props.index===n))}addNode(e,t,n={}){let s=this.getNode(e,t,n.index);return s?s.props=n:(s=new Fu(e,t,n),s.parent=this,this.children.push(s)),s}addEventListener(e){this.eventSubscribers.push(e)}triggerEvent(e){this.eventSubscribers.forEach((t=>{t(e)}))}removeReference(e,t,n){const s=this.references.get(t),r=s?.get(e);if(r?.props?.index===n){const n=r?.props?.context;t===$u&&n&&qu?.(n,e),s.delete(e)}}removeNode(e,t){for(let n=this.children.length-1;n>=0;n-=1){const s=this.children[n];if(s.props.index===t&&s.name===e){this.children.splice(n,1);break}}}addWhen(e,t,n,s,r){if(!(n&&s&&e&&t))return;n.startsWith(".")&&(n=n.substring(1));const a=`${e}.${n}.${s}`,o=new ju(t,n,s,r),i=this.references.get("WHEN");i?.set(a,o)}},{VIEW:Yu,FIELD:Ku,CONTEXT:Qu,DECLARATIVE_TARGET:Ju,WHEN:Xu}=Fs.CONTEXT_TREE_NODE_TYPES;const Zu=new class{constructor(){this.rootNodes={}}_isContextNodeExist(e){return Object.keys(this.rootNodes).includes(e)}addContextNode(e){if(!this._isContextNodeExist(e)){const t=new zu(Qu,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 s=this.addContextNode(e).addNode("PAGE",t);let r=s.getReference(n);return r||(r=s.addNode("VIEW",n),s.addReference(n,r)),r}pushChildPageNodeToParentView(e,t,n){const s=e.children;let r=!1;if(s)for(let e=0;e<s.length;e+=1)if(s[e].name===n){r=!0;break}r||s.push(t),t.parent=e}addViewNode(e,t,n,s,r={}){const a=this.addContextNode(e).addNode("PAGE",t);let o=null;if(s&&n!==s){o=this._addParentViewNode(e,t,s).addNode("VIEW",n,r)}else o=a.addNode("VIEW",n,r);a.addReference(n,o);const i=t.split(".");for(;i.length>0;){i.pop();const n=i.join("."),r=this.getContextNode(e)?.getNode("PAGE",n),o=r?.getReference(s);if(o){this.pushChildPageNodeToParentView(o,a,t);break}}return o}getViewNode(e,t,n){return this.getContextNode(e)?.getNode("PAGE",t)?.getReference(n)}addPageListNode(e,t,n,s,r){if(!s)return;s.startsWith(".")&&(s=s.substring(1));const a=this.addContextNode(e),o=a.addNode("PAGE",t)?.getReference(n)?.addNode("PAGELIST",`${t}.${s}`,r);return o&&a.addReference(`${t}.${s}`,o),o}updatePageListNode(e,t,n,s){if(!n)return;n.startsWith(".")&&(n=n.substring(1));this.addContextNode(e).removePageListNodes(`${t}.${n}`,s)}removeFieldNode(e,t,n,s,r){const a=this.getContextNode(e);a?.getNode("PAGE",t)?.getReference(n)?.removeNode(`${t}${s}`,r),a?.removeReference(`${t}${s}`,Ku,r),a?.removeReference(`${t}${s}`,Ju,r)}removeViewNode(e,t,n,s,r={}){const a=this.getContextNode(e),o=a?.getNode("PAGE",t),i=o?.getReference(n);if("visibility"in r&&i?.props&&"visibility"in i.props&&r.visibility!==i.props.visibility)return;this.removeChildViewNodes(e,t,n,s);const c=i?.parent?.children?.findIndex((e=>e.name===n))??-1;c>-1&&i?.parent?.children.splice(c,1)}removeChildViewNodes(e,t,n,s){const r=this.getContextNode(e),a=r?.getNode("PAGE",t),o=a?.getReference(n);o?.children.forEach((a=>{"PAGE"===a.type?this.removeViewNode(e,a.name,n,s):a.type===Yu?this.removeChildViewNodes(e,t,a.name,s):(r.removeReference(a.name,Ku,a.props.index),r.removeReference(a.name,Ju,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 s=s=>{const r=this.getContextNode(e),a=r?.references?.get(s);if(a)for(const[e]of a)(n&&e===t||e.startsWith(`${t}.`)||e.startsWith(`${t}[`))&&r?.references?.get(s)?.delete(e)};s(Ku),s(Ju)}deleteListNode(e,t,n){const s=s=>{const r=this.getContextNode(e),a=r?.references?.get(s);if(a)for(const[e]of a)e.includes(`${t.join(".")}[${n}]`)&&r?.references?.get(s)?.delete(e)};s(Ku),s(Ju)}getPageListNode(e,t,n,s){const r=this.getContextNode(e)?.getNode("PAGE",t)?.getReference(n);return r?.children.find((e=>"PAGELIST"===e.type&&e.name===`${t}.${s}`))}getFieldNode(e,t,n,s){return this.getViewNode(e,t,n)?.getNode(Ku,s)}_findViewNode(e,t,n,s){let r=s.addNode("PAGE",t)?.getReference(n);if(r)return r;const a=t.split(".");for(;a.length>0;){a.pop();const e=a.join(".");if(r=s.addNode("PAGE",e)?.getReference(n),r)return r}return this.addViewNode(e,t,n)}addFieldNode(e,t,n,s,r,a={}){const o=this.addContextNode(e),i=this._findViewNode(e,t,n,o),c=this.createFieldNode(i,t,s,a);return c&&this.updateFieldNode(o,i,c,e,t,s,r),c}createFieldNode(e,t,n,s){const{isDeclarativeTarget:r}=s;return r?e.addNode(Ju,`${t}${n}`,s):e.addNode(Ku,`${t}${n}`,s)}updateFieldNode(e,t,n,s,r,a,o){const i=`${r}${a}`;"Address"===n.props?.componentName&&this.deleteAllListNodes(s,n.name),e.addReference(i,n),n.value=o,n.setPreviousDefaultValue(),n.props.isInsideList&&this.handleFieldInsideList(e,t,s,r,a)}handleFieldInsideList(e,t,n,s,r){const a=Qy(n),o=Cy(a,n)||{},i=`${s}${r}`;let c=null;if(o?.subscriptFieldName||o?.isPageGroup)c=s.substring(0,s.lastIndexOf(`.${o?.index??""}`))||i.substring(0,i.lastIndexOf(`.${o?.index}`)),this.createListNodeIfNotExist(e,t,c);else{const n=s.substring(0,s.lastIndexOf("["))||i.substring(0,i.lastIndexOf("["));this.createListNodeIfNotExist(e,t,n)}}createListNodeIfNotExist(e,t,n){let s=e.getReference(n,Ku);s||(s=t.addNode(Ku,n,{}),e.addReference(n,s))}removeContextTreeNode(e){delete this.rootNodes[e]}onViewMutate(e,t,n,s){this.getViewNode(e,t,n)?.addEventListener(s)}mutateField(e,t,n,s){const r=this.getContextNode(e),[a,o,i]=ku(t);n.startsWith(".")&&(n=n.substring(1)),o&&this.mutatePageList(e,a,o,{...s,rowIndex:i});const c=r?.getReference(`${t}.${n}`,Ku);c&&c instanceof Fu&&c.triggerEvent(s)}onPageListMutate(e,t,n,s,r){this.getPageListNode(e,t,n,s)?.addEventListener(r)}mutatePageList(e,t,n,s,r=!1){const a=this.getContextNode(e),o=a?.getReference(`${t}.${n}`,Ku);o&&o instanceof Fu&&o.triggerEvent(s,r)}getFieldsList(e){const t=this.getContextNode(e);return t?.references.get(Ku)}getFieldReferenceForProperty(e,t){let n=this.getContextNode(e)?.references?.get(Ku)?.get(t);return n||(n=this.getContextNode(e)?.references?.get(Ju)?.get(t)),n}getFieldReferencePreviousValue(e,t){let n=this.getContextNode(e)?.references?.get(Ku)?.get(t);return n||(n=this.getContextNode(e)?.references?.get(Ju)?.get(t)),n?.value}updateFieldNodeValue(e,t,n){const s=this.getContextNode(e)?.references?.get(Ku)?.get(t);s instanceof Fu&&s&&(s.previousValue=s.value,void 0===s.value&&(s.previousValue=n),s.value=n)}getContextReferences(e){if(!this.getContextNode(e))return;const t=this.getContextReferencesByType(e,Ku),n=this.getContextReferencesByType(e,Ju);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,Ku)?.get(t)||!!this.getContextReferencesByType(e,Ju)?.get(t)}addWhenNode(e,t,n,s,r,a){const o=this.getContextNode(e);o?.addWhen(t,n,s,r,a)}getDeclarativeTargets(e){const t=this.getContextNode(e),n=t?.references?.get(Ju)||new Map,s=[];return n.forEach((e=>{const t=e?.props||{},{propertyName:n=""}=t,r=t.pageReference??Fs.CASE_INFO.CASE_INFO_CONTENT;s.push({pageReference:r,name:n})})),s}getWhens(e){const t=this.getContextNode(e),n=t?.references?.get(Xu)||new Map,s=[];return n.forEach((e=>{const t=e.subType,n=e.referenceName,r=e.name,a=e?.props?.pageReference??Fs.CASE_INFO.CASE_INFO_CONTENT;s.push({name:r,pageReference:a,referenceName:n,type:t})})),s}},ed={CONTENT_FIELDS_PATH:[js.CONTEXT_DATA,js.CASE_INFO.CASE_INFO,js.CONTENT],DATA_OBJECT_CONTENT_FIELDS_PATH:[js.CONTEXT_DATA,js.DATA_INFO.DATA_INFO,js.CONTENT],OBJECT_CONTENT_FIELDS_PATH:[js.CONTEXT_DATA,js.OBJECT_INFO.OBJECT_INFO,js.CONTENT],FIELD_MESSAGES_PATH:[js.CONTEXT_DATA,js.CASE_INFO.CASE_INFO,js.CONTENT,js.SUMMARY_OF_MESSAGES,js.PROPERTY_MESSAGES],DATA_OBJECT_FIELD_MESSAGES_PATH:[js.CONTEXT_DATA,js.DATA_INFO.DATA_INFO,js.CONTENT,js.SUMMARY_OF_MESSAGES,js.PROPERTY_MESSAGES],OBJECT_FIELD_MESSAGES_PATH:[js.CONTEXT_DATA,js.OBJECT_INFO.OBJECT_INFO,js.CONTENT,js.SUMMARY_OF_MESSAGES,js.PROPERTY_MESSAGES],PAGE_MESSAGES_PATH:[js.CONTEXT_DATA,js.SUMMARY_OF_MESSAGES,js.PAGE_MESSAGES],HTTP_MESSAGES_PATH:[js.CONTEXT_DATA,js.SUMMARY_OF_MESSAGES,js.HTTP_MESSAGES],CASE_MESSAGE_PATH:[js.CASEMESSAGES]},td=(e="",t="",n,s)=>{let r=[],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===js.PROPERTY&&e||e){r=[js.CONTEXT_DATA,...o.split(".")];for(let e=0;e<a.length-1;e+=1)r.push(a[e]);r.push(js.SUMMARY_OF_MESSAGES,js.PROPERTY_MESSAGES,a[a.length-1])}else n===Fs.PAGE?r=[...ed.PAGE_MESSAGES_PATH]:n===js.HTTP?r=[...ed.HTTP_MESSAGES_PATH]:n===js.CASEMESSAGES?r=[...ed.CASE_MESSAGE_PATH]:s&&(r=[js.CONTEXT_DATA,...o.split(".")]);return r.filter(Boolean)},nd=(e,t,n)=>{const s={content:{}},r=`${t.split(".").slice(2).join(".")}[${n}]`,a=rS.getIn(e?.content,r.split("."));return a&&rS.setIn(s.content,r.split("."),{...a}),s},sd=(e,t,n,s,r,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,s,r),c=s>r?"up":"down";i&&i?.length>0&&i?.forEach((n=>{const s=parseInt(n.match(/\d+/)?.[0],10),r=`${a}[${s}]`;o[`${a}[${s+("up"===c?1:-1)}]`]=rS.getIn(e[t],[js.CONTEXT_DATA,...r.split(".")]),rS.deleteIn(e[t],[js.CONTEXT_DATA,...r.split(".")])}));const l=Object.keys(o);l.length>0&&l.forEach((n=>{rS.setIn(e[t],[js.CONTEXT_DATA,...n.split(".")],o[n])}))},rd=(e,t,n,s,r)=>{const a=rS.deepClone(rS.getIn(e,[`${t}`])),o=rS.getIn(a,[js.CONTEXT_DATA,js.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 s=rS.getIn(e,[js.CONTEXT_DATA,...n.split(".")],{});return Object.keys(s).filter((e=>e.includes(`${t}[`)))})(a,i.substring(i.lastIndexOf(".")+1),c);if(0===l.length)return;const u=nd(o,i,s).content;if(u&&Object.keys(u).length>0){const n={},o=`${i}[${s}]`,c=rS.getIn(a,[js.CONTEXT_DATA,...o.split(".")]);n[`${i}[${r}]`]=c,rS.deleteIn(e[t],[js.CONTEXT_DATA,...o.split(".")]),sd(e,t,l,s,r,i,n)}else sd(e,t,l,s,r,i)},ad=e=>{const{type:t,property:n,category:s,context:r,pageReference:a}=e;let o;n&&(o=n.slice(1));const i=$C(r);let c=[];const l=rS.getIn(i,td(o,a,s));return t&&"all"!==t?(l&&Array.isArray(l)&&l.length>0&&(c=l.filter((e=>e.type===t))),t===Fs.MESSAGES.MESSAGES_TYPE_ERROR&&c.length>0&&n&&Zu.mutateField(r,a,n,{messages:[...c],type:Fs.MESSAGES.MESSAGES_TYPE_ERROR,fieldName:n}),c):l},od=e=>{const{property:t,pageReference:n,category:s,context:r,type:a,subType:o,isListEntry:i,clearContextMessages:c,deletingIndex:l}=e,u={context:r,type:a,subType:o};t&&!i?(Zu.mutateField(r,n,t,{type:ca,fieldName:t}),u.property=t,u.pageReference=n):i?(u.pageReference=n,u.isListEntry=i,u.deletingIndex=l):u.category=s,BC(c?{type:ca,payload:{stateObj:e.stateObj,context:r}}:{type:ca,payload:u})},id=e=>{const{messages:t,property:n,pageReference:s,category:r,context:a}=e,o={messages:t,context:a};n?(o.property=n,o.pageReference=s):o.category=r,BC({type:ia,payload:o})},cd=(e,t,n)=>{for(const s of Object.keys(e)){if(t.push(s),s===js.SUMMARY_OF_MESSAGES)n.push([...t]);else{"object"===typeof e[s]&&cd(e[s],t,n)}t.pop()}return n},ld=(e,t)=>{let n=ad({context:js.APP.ROOT,category:"HTTP"});if(PA.getRenderingMode()===js.EMBED){const e=ad({context:js.APP.APP,category:"HTTP"});e&&(n=n?n.concat(e):e)}if(e){const e=ad({context:t,category:"HTTP"});n?e&&(n=n.concat(ad({context:t,category:"HTTP"}))):n=ad({context:t,category:"HTTP"})}return n},ud=e=>{let t=null;t=jy(e)[0]?xy(jy(e)[0]):e,t&&od({context:t,stateObj:$C(t),clearContextMessages:!0})},dd=e=>(rS.getIn($C(e),ed.PAGE_MESSAGES_PATH)??[]).some((e=>e.subType===js.CUSTOM_ERROR)),pd={addMessages:id,getValidationErrorMessages:(e,t)=>{const n=$C(e),s=(e=>{let t=ed.CONTENT_FIELDS_PATH;e?.objectInfo?t=YI.isObjectCaseType(e?.objectInfo?.objectTypeID)?ed.OBJECT_CONTENT_FIELDS_PATH:t:e?.dataInfo?.content&&(t=ed.DATA_OBJECT_CONTENT_FIELDS_PATH);return t})(n),r=rS.getIn(n,[...s])||{},a=[];return cd(r,[],[]).forEach((e=>{const n=rS.getIn(r,[...e,js.PROPERTY_MESSAGES]);n&&Object.keys(n).forEach((e=>{n[e].forEach((e=>{if(e.type===js.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:ad,clearMessages:od,getRootContainerHttpMessages:ld,clearContextMessagesInActiveWorkArea:ud,clearContextMessages:e=>{const{context:t}=e;BC({type:ca,payload:{clearAll:!0,context:t}})},isCustomPageErrorExist:dd};const gd=class{constructor(e,t,n,s){this.eventType=e,this.callback=n,this.contextName=s,this.id=t}};const hd=new class{constructor(){this.subscribers={}}publish(e,t){(this.subscribers[e]||[]).slice().forEach((e=>{e.callback(t)}))}unsubscribe(e,t,n){const s=this.subscribers[e]||[];let r=0,a=-1;s.forEach((e=>{e.id===t&&e.contextName===n&&(a=r),r+=1})),-1!==a&&s.splice(a,1)}unsubscribeAllWithEventType(e){this.subscribers[e]=[]}subscribe(e,t,n,s,r){this.subscribers[e]=this.subscribers[e]||[];let a=!1;if(r&&this.subscribers[e].forEach((e=>{a=e.id===t&&e.contextName===s})),!a){const r=new gd(e,t,n,s);this.subscribers[e].push(r)}}clearContext(e){const t=this.subscribers;Object.keys(t).forEach((t=>{const n=this.subscribers[t],s=[];n.forEach((t=>{t.contextName!==e&&s.push(t)})),this.subscribers[t]=s}))}};const fd=class{static subscribe(e,t,n,s=!1,r="app"){hd.subscribe(e,n,t,r,s)}static subscribeOnce(e,t,n){this.subscribe(e,t,n,!0)}static publish(e,t){hd.publish(e,t)}static unsubscribe(e,t,n="app"){hd.unsubscribe(e,t,n)}static unsubscribeAllWithEventType(e){hd.unsubscribeAllWithEventType(e)}static cleanContextSubscribers(e){hd.clearContext(e)}};const md=new class{override=null;discoveredOffline=!1;subscribers=new Set;constructor(){"function"==typeof globalThis.addEventListener&&(globalThis.addEventListener("online",this.handleOnline),globalThis.addEventListener("offline",this.handleOffline))}isOnline(){return null!==this.override?this.override:!this.discoveredOffline&&("undefined"==typeof navigator||!("onLine"in navigator)||navigator.onLine)}setOnlineOverride(e){const t=this.isOnline();this.override=e;const n=this.isOnline();n!==t&&this.notifyAll(n)}onStatusChange(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}reportNetworkFailure(){null===this.override&&(this.discoveredOffline||(this.discoveredOffline=!0,this.notifyAll(!1)))}reportNetworkRecovery(){null===this.override&&this.discoveredOffline&&(this.discoveredOffline=!1,this.notifyAll(!0))}handleOnline=()=>{null===this.override&&(this.discoveredOffline=!1,this.notifyAll(!0))};handleOffline=()=>{null===this.override&&this.notifyAll(!1)};notifyAll(e){BC({type:e?lr:cr,payload:{context:"app"}}),this.subscribers.forEach((t=>{t(e)}))}};const Id=new class{#e;#t;#n;#s;constructor(){this.#e="undefined"!=typeof localStorage&&"true"===localStorage.getItem("inspectorFlag"),this.#t=!1,this.#n=!1,this.#s=!1,this.isPreview=!1,this.debugLevels="vcv=1;tracer=0;log=0;metric=1"}#r(){return this.#n&&this.#s}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="undefined"!=typeof localStorage?localStorage:null,t="true"===e?.getItem("inspectorFlag");!t&&this.#r()||(this.#e=!t,e?.setItem("inspectorFlag",this.#e.toString()),fd.publish(js.PUB_SUB_EVENTS.UI_EVENTS.INSPECTOR,this.#e))}disableInspectorIfEnabled(){if(!this.#e)return;this.#e=!1;const e="undefined"!=typeof localStorage?localStorage:null;e?.setItem("inspectorFlag",this.#e.toString()),fd.publish(js.PUB_SUB_EVENTS.UI_EVENTS.INSPECTOR,this.#e)}toggleInspectorShowAll(){this.#t=!this.#t,fd.publish(js.PUB_SUB_EVENTS.UI_EVENTS.INSPECTOR_SHOW_ALL,this.#t)}get uiDesignerEnabled(){return this.#n}setDesignerToolbarExpanded(e){this.#s=e,fd.publish(js.PUB_SUB_EVENTS.UI_EVENTS.UI_DESIGNER_TOOLBAR_EXPANDED,e)}get uiDesignerToolbarExpanded(){return this.#s}toggleUIDesigner(){this.#n=!this.#n,this.#n||(this.#s=!1),fd.publish(js.PUB_SUB_EVENTS.UI_EVENTS.UI_DESIGNER,this.#n),fd.publish(js.PUB_SUB_EVENTS.UI_EVENTS.UI_DESIGNER_TOOLBAR_EXPANDED,this.#s)}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 Ed{constructor(e,t=!0){this.config=e,t?(this.ssKeyConfig=e,this.reloadConfig()):this.updateConfig(e,!1)}static init(e,t=!0){return new Ed(e,t)}updateConfig(e,t=!0){t?window.sessionStorage.setItem(this.ssKeyConfig,JSON.stringify(this.config)):Jd(e)}reloadConfig(e=!0){if(e){const e=window.sessionStorage.getItem(this.ssKeyConfig);this.config=e?JSON.parse(e):null}else this.config=Xd()}async buildAuthorizeUrl(e){e=e||window.btoa(window.location.origin);let{sessionIndex:t}=this.config;const{password:n}=this.config,s=this.config.clientId?this.config.clientId:this.config.client_id,r=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:TA.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=${s}&response_type=code&redirect_uri=${r}&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,s=this.config.clientSecret?this.config.clientSecret:this.config.client_secret,r=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),s&&u.append("client_secret",s),u.append("grant_type","authorization_code"),u.append("code",l),r&&u.append("redirect_uri",r),o&&u.append("code_verifier",o),this.config?.secureCookie&&u.append("send_token_as_cookie","true"),Wd(a,{method:"POST",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?Kd({pzCTkn:e?.csrf}):(Qd({tokenInfo:e}),Kd({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 yd=Ed,Ad=async()=>new Promise((async(e,t)=>{const n=Zd();if(!("tokenInfo"in n)||!n?.tokenInfo)return void t(new Error("Missing token information."));const{access_token:s,refresh_token:r=null}=n.tokenInfo,a=n.endPoints?.revoke,{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 g=r?"refresh_token":"access_token",h="access_token"===g?s:r;!c&&h&&p.append("token",h),p.append("token_type_hint",g),a&&await Wd(a,{method:"POST",headers:d,withCredentials:c,body:p.toString(),withoutDefaultHeaders:!0}),Kd({Authorization:null}),Qd({tokenInfo:null}),e()})),Cd=async e=>{const t={};if("OAuth2.0"===e?.authType){const n=new yd(e,!1);t.reauthUrl=await n.buildAuthorizeUrl(),t.redirectOrigin=n.getRedirectUriOrigin(),window.addEventListener("message",n.authMessageHandler,!1)}else t.reauthUrl=rn()+(sn()?`${sn()}`:"/?reAuth=true");return t},Sd=(e,t)=>{Cd(t).then((t=>{const n={openReauthMessageModal:!0,reAuthenticationURL:t.reauthUrl,url:e,redirectOrigin:t.redirectOrigin};fd.publish(Fs.PUB_SUB_EVENTS.EVENT_REAUTH,n)}))},_d=e=>{let t="",n={},s={},r=!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)&&(r=!1),a.append("client_id",e.client_id),a.append("grant_type","refresh_token"),e.client_secret&&a.append("client_secret",e.client_secret),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"}},s={success:t=>{const{data:n}=t,s={access_token:n?.access_token,refresh_token:n?.refresh_token};Qd({tokenInfo:{...e.tokenInfo,...s}}),e.secureCookie?Kd({pzCTkn:n?.csrf}):Kd({Authorization:`${n?.token_type} ${n?.access_token}`});const{onTokenRetrieval:r}=e;r&&"function"==typeof r&&r(n)},failure:t=>{if(e.popupReauth)return Sd(t,e);fd.publish(Fs.PUB_SUB_EVENTS.EVENT_FULL_REAUTH,e)}}}else t=`${rn()}/updateSession`,n={method:"GET",headers:{}},s={failure:Sd};return{url:t,config:n,callback:s,isRefreshTokenPresent:r}},Nd=(e,t)=>"OAuth2.0"===t?.authType?e?.includes(t.endPoints.token):e?.includes("updateSession"),Td=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}},Dd=e=>{const{url:t,config:n,callback:s}=_d(e);return Wd(t,n).then((e=>{s?.success?.(e),fd.publish("updateSession",{updateStatus:"success"}),fd.publish("OnUpdateSession",{})})).catch((e=>{throw e}))},Pd=(e,t,n)=>{const{config:s}=e,{url:r,config:a,callback:o,isRefreshTokenPresent:i}=_d(n),c=s?.headers&&s.headers.context;s?.data&&(s.body=s.data);const l=Hd(s.url,s,c,t);return i?Wd(r,a).then((e=>new Promise(((n,r)=>{setTimeout((()=>{t.setUpdateSessionStatus(!1),t.latestUpdateSessionTimeStamp=Date.now(),o?.success?.(e,s),fd.publish("updateSession",{updateStatus:"success"}),fd.publish("OnUpdateSession",{}),l.then((e=>{n(e)})).catch((e=>{r(e)}))}),0)})))).catch((e=>e&&e.config&&Nd(e.config.url,n)?(o?.failure?.(s.url,n),l):Promise.reject(e))):(o?.failure?.(s.url,n),l)},Od=new Set(["resource is stale","resource is locked","resource in the wrong state","resource not found"]),Rd=e=>"object"==typeof e&&null!==e,bd=(e,t)=>{if(!(e=>!!e&&Od.has(e.toLowerCase()))(t))return e;if(e&&e.includes("/workarea")&&!e.includes("/modal")){const t=e.lastIndexOf("/workarea");if(-1!==t)return e.slice(0,t)}return e},vd=(e,t,n,s)=>{if(e.config&&Nd(e.config.url,n))return Promise.reject(e);if(e.response&&e.response.status&&401===e.response.status&&!e.config.isExternalUrl&&!t.getUpdateSessionStatus()&&e.config.fetchTimeStamp>t.latestUpdateSessionTimeStamp){if(fd.unsubscribeAllWithEventType(Md),t.setUpdateSessionStatus(!0),"custom"===n?.authType){fd.publish(Fs.PUB_SUB_EVENTS.EVENT_CUSTOM_REAUTH);const{url:n,config:s,context:r}=Td(e);return Hd(n,s,r,t)}return Pd(e,t,n)}if(e.response&&e.response.status&&401===e.response.status&&!e.config.isExternalUrl&&t.getUpdateSessionStatus()){const{url:t,config:n,context:s}=Td(e);return Wd(t,n,s)}const r=(e=>{if(e instanceof ArrayBuffer)try{const t=(new TextDecoder).decode(e),n=JSON.parse(t);return Rd(n)?n:{}}catch{return{}}return Rd(e)?e:{}})(e.response?.data);if(e.response&&e.response.status&&422!==e.response.status&&424!==e.response.status&&(400!==e.response.status||r.errorClassification!==Fs.INVALID_INPUTS)&&e.config.headers.context&&e.response.data&&!s){const t=r.errorDetails&&r.errorDetails.map((t=>((e,t)=>t[Fs.TRACE_ID]?{type:"error",message:e.localizedValue||e.message,correlationID:t[Fs.TRACE_ID]}:{type:"error",message:e.localizedValue||e.message})(t,e.response.headers))),n=bd(e.config.headers.context,r.errorClassification);return id({messages:t,category:"HTTP",context:n}),Promise.reject(e)}return Promise.reject(e)};const xd=class{constructor(){this.updateSessionInProgress=!1,this.latestUpdateSessionTimeStamp=Date.now()}getUpdateSessionStatus=()=>this.updateSessionInProgress;setUpdateSessionStatus=e=>{this.updateSessionInProgress=e}};const wd=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){e?.Prefer&&this.defaultHeaders.Prefer&&(e.Prefer=`${this.defaultHeaders.Prefer},${e.Prefer}`),this.defaultHeaders={...this.defaultHeaders,...e}}setRequestContext(e){if(!e||0===e.length)return;const t=new URLSearchParams(window.location.search),n=this.buildHeaderMapFromRequestContext(e,t);this.registerHeadersFromMap(n)}buildHeaderMapFromRequestContext(e,t){const n={};return e?.forEach((e=>{Array.isArray(e.IncludeInHeaders)&&e.IncludeInHeaders.forEach((s=>{const r=s.Value,a=t.get(e.Key);a&&(n[r]||(n[r]=[]),n[r].push(`${e.Key}=${a}`))}))})),n}registerHeadersFromMap(e){Object.entries(e).forEach((([e,t])=>{t.length>0&&this.registerHeader(e,t.join("; "))}))}getDefaultHeaders(){return this.defaultHeaders}addDebugHeaders(e={}){return{[js.COREHEADER_APP_DEBUG_ID]:e.debugId,[js.COREHEADER_APP_DEBUG_LEVELS]:Id.getDebugLevels()}}getCoreHeadersFromContext(e){if(["root","app"].includes(e)||!e)return;const t=cS.getProperty(js.COREHEADERS,"",e);return t?{...t,debugInfo:Id.getPreviewMode()&&{...t.debugInfo,[js.COREHEADER_APP_DEBUG_LEVELS]:Id.getDebugLevels()}}:(e=e.substr(0,e.lastIndexOf(this.SPECIAL_CHARS.SLASH)),this.getCoreHeadersFromContext(e))}processCoreHeaders(e,t,n){const s=this.getCoreHeadersFromContext(n);if(s){const t=Object.keys(e);if(t.includes(js.SKIPCOREHEADERS))return void delete e[js.SKIPCOREHEADERS];const n=Object.assign({},...Object.values(s));Object.keys({...n}).forEach((s=>{t.includes(s)||(e[s]=n[s])}))}}injectCoreAdditionalHeaders(e,t,n,s){s?.includeRemoteSystemIdIfPresent&&Bs.injectRemoteCaseHeader(e,t,n),this.processCoreHeaders(e,t,n)}};const Md="updateSession",Ld={},Ud=new xd,Fd=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&&(fd.unsubscribe(Fs.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((()=>{fd.publish(Fs.PUB_SUB_EVENTS.TIMEOUT_REMINDER,{timeRemaining:this.expiryBuffer}),clearTimeout(t),fd.subscribe(Fs.PUB_SUB_EVENTS.RESET_TIMER,this.resetInactiveTimeout,"resetCallback"),this.timeoutWarned=!0}),1e3*(e-this.expiryBuffer));return this.setTimerID(t),t}};let jd={},Vd={},kd={},Bd="";const $d=e=>(e=>"ERR_NETWORK"===e.code||"ECONNABORTED"===e.code||"Network Offline"===e.message||!0===e.isOffline)(e)?($C(e.config?.headers?.context)?.isLoading&&BC({type:ir,payload:{context:e.config?.headers?.context}}),md.reportNetworkFailure(),Promise.reject(new Error("Network Offline"))):((e=>"Network Offline"!==e.message&&Boolean($C(js.APP.APP)?.context_data?.isOffline))(e)&&md.reportNetworkRecovery(),!e.response&&e.cause?.response&&(e.response=e.cause.response),(e=>Boolean(e.response&&401===e.response.status&&!e.config?.isExternalUrl&&(!e.config||!Nd(e.config.url,Vd))))(e)&&fd.subscribe(Md,(e=>{Ud.setUpdateSessionStatus(!e.updateStatus)}),Md),vd(e,Ud,Vd,(e=>e.response&&e.response.status&&e.response.status===Number(Bd)?Bd:null)(e))),Gd=e=>{if("OAuth2.0"===e?.authType&&e.secureCookie||e.customCookies)return!0},Wd=(e,t,n="root",s={})=>{const{doNotMergeHttpMessagesForStatusCode:r=null,cancelContext:a=n,includeRemoteSystemIdIfPresent:o=!0}=s;Bd=r,null===e&&window.console.error("Error: url passed to Service Broker fetch is null (or) undefined");const{body:i,signal:c,responseType:l,adapter:u,withoutDefaultHeaders:d=!1,...p}=t,{Authorization:g,pzCTkn:h,...f}=t.headers||{};d||wd.injectCoreAdditionalHeaders(f,t.body,n,{includeRemoteSystemIdIfPresent:o}),a&&Ld[a]>=0?Ld[a]+=1:a&&void 0===Ld[a]&&(Ld[a]=1);let m=d?{...f}:{...wd.getDefaultHeaders(),...wd.getRegisteredHeaders(),...f,context:n};if(p.isExternalUrl=(e=>!e?.startsWith(rn()||""))(e||""),p.fetchTimeStamp=Date.now(),e&&Nd(e,Vd)&&Ud.getUpdateSessionStatus()||!Ud.getUpdateSessionStatus()||p.isExternalUrl){Nd(e,Vd)&&"OAuth2.0"===Vd?.authType&&(m={...f});const{restApi:t}=TA.doesRestApiExist("Logout")&&TA.getRestEndPoint("Logout")||{restApi:null};return(!t||e&&!e.endsWith(t))&&Fd.setTimerID(Fd.resetInactiveTimeout(Fd.getTimerID())),function(e,t){var n="object"==typeof t;return new Promise((function(s,r){var a,o=!1;e.subscribe({next:function(e){a=e,o=!0},error:r,complete:function(){o?s(a):n?s(t.defaultValue):r(new bl)}})}))}(Mu(Ol({context:n,...p,url:e,data:i,...c&&void 0===c.aborted&&{cancelToken:c},...c&&void 0!==c.aborted&&{signal:c},responseType:l,adapter:u,headers:m,withCredentials:Gd(Vd)})).pipe((A=$l(I=()=>{const e=wd.getCoreHeadersFromContext(m.context);var t;e&&(t={...e},fd.publish(js.PUB_SUB_EVENTS.FETCH_SUCCESS,t))})||E||y?{next:I,error:E,complete:y}:I)?Pu((function(e,t){var n;null===(n=A.subscribe)||void 0===n||n.call(A);var s=!0;e.subscribe(Ou(t,(function(e){var n;null===(n=A.next)||void 0===n||n.call(A,e),t.next(e)}),(function(){var e;s=!1,null===(e=A.complete)||void 0===e||e.call(A),t.complete()}),(function(e){var n;s=!1,null===(n=A.error)||void 0===n||n.call(A,e),t.error(e)}),(function(){var e,t;s&&(null===(e=A.unsubscribe)||void 0===e||e.call(A)),null===(t=A.finalize)||void 0===t||t.call(A)})))})):gu,Lu((e=>{const t=m,n=!!t?.[js.COREHEADER_APP_DEBUG_ID]?{debugInfo:{[js.COREHEADER_APP_DEBUG_ID]:t?.[js.COREHEADER_APP_DEBUG_ID],[js.COREHEADER_APP_DEBUG_LEVELS]:Id.getDebugLevels()}}:wd.getCoreHeadersFromContext(m.context);var s;throw n&&(s={...n,error:e},fd.publish(js.PUB_SUB_EVENTS.FETCH_FAILURE,s)),e}))))}var I,E,y,A;return Hd(e,t,n,Ud)},Hd=(e,t,n,s)=>new Promise(((r,a)=>{fd.subscribe(Md,(o=>{s.setUpdateSessionStatus(!o.updateStatus),"success"===o.updateStatus?Wd(e,t,n).then((e=>r(e))).catch((e=>a(e))):a(o.updateStatus.error)}),Md)})),qd=e=>{Ld[e]>0&&(Ld[e]-=1,0===Ld[e]&&delete Ld[e])};Ol.interceptors.request.use((e=>md.isOnline()?(jd?.request&&(e=jd.request(e)),e):($C(e.context)?.isLoading&&BC({type:ir,payload:{context:e.context}}),BC({type:cr,payload:{context:"app"}}),Promise.reject(new Error("Network Offline")))),(e=>Promise.reject(e))),Ol.interceptors.response.use((e=>{if(202===e.status&&e.config.headers.context&&e.data?.caseInfo&&"object"==typeof e.data.caseInfo&&"errorMessage"in e.data.caseInfo){const t=[{type:"error",message:String(e.data.caseInfo.errorMessage)}];let n=e.config.headers.context;return n&&n.includes("/workarea")&&(n=n.substring(0,n.lastIndexOf("/workarea"))),id({messages:t,category:"HTTP",context:n}),Promise.reject(e)}if(e.config.headers&&e.config.headers.context){if(!e.config.skipClearErrorMessages){ad({type:"error",category:"HTTP",context:e.config.headers.context}).length>0&&od({type:"error",category:"HTTP",context:e.config.headers.context}),ad({type:"error",category:e.config.headers.context===js.APP.APP?"PAGE":"",context:e.config.headers.context}).length>0&&od({type:"error",category:"PAGE",context:e.config.headers.context});e.config.headers.context.slice(e.config.headers.context.lastIndexOf("/")+1).startsWith("primary")&&(ad({type:"error",category:"HTTP",context:js.APP.APP}).length>0&&od({type:"error",category:"HTTP",context:js.APP.APP}),ad({type:"error",category:"PAGE",context:js.APP.APP}).length>0&&od({type:"error",category:"PAGE",context:js.APP.APP}))}qd(e.config.headers.context)}return jd?.response&&(e=jd.response(e)),e}),(e=>(e.config&&e.config.headers&&e.config.headers.context&&qd(e.config.headers.context),jd?.error?Promise.resolve(jd.error(e)).then((t=>((e,t)=>{if("boolean"==typeof t)return t?$d(e):Promise.reject(e);if((n=t)&&"object"==typeof n&&("continueWithDefaultErrorHandler"in n||"error"in n)){const n=t.error??e;return t.continueWithDefaultErrorHandler??1?$d((e=>!(!e||"object"!=typeof e)&&"isAxiosError"in e&&"config"in e)(n)?n:e):Promise.reject(n)}var n;return $d(e)})(e,t))):$d(e))));const zd=()=>Ol.CancelToken.source(),Yd=e=>Ol.isCancel(e),Kd=e=>{wd.setDefaultHeaders(e)},Qd=e=>{Vd={...Vd,...e}},Jd=e=>{kd={...kd,...e}},Xd=()=>({...kd}),Zd=()=>({...Vd});const ep=class{static formatPageReference(e){const t=e?.split(".").map((e=>{if(e.includes("[")){const t=e.indexOf("["),n=e.indexOf("]"),s=e.substring(t+1,n),r=Number(s)+1;return`${e.substring(0,t)}(${r})${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(")"),s=e.substring(t+1,n),r=Number(s);if(!Number.isNaN(r)){const s=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}};const tp=class{static execute(e,t,n,s){const r=!PA.isInfinityRuntime(),a={};Object.hasOwn(n,"nonFormProperties")&&(n.nonFormProperties.forEach((e=>{a[e]=n[e],delete n[e]})),delete n.nonFormProperties);const o={instruction:"string"==typeof t?"ADD":"INSERT",content:{...rS.unflatten(n)}},i=JSON.parse(JSON.stringify(o)),c=i.content.classID||i.content["@class"];delete i.content.classID;return{instruction:{target:rS.buildInstructionPageReference(s,e),content:{...r&&c?{"@class":c}:{},...i.content},["string"==typeof t?"groupIndex":"listIndex"]:t,instruction:"string"==typeof t?"ADD":"INSERT"},actionPayload:o,displayPropertPayload:a}}};const np=class{static execute(e,t,n,s,r,a,o,i){const c=!PA.isInfinityRuntime(),l="string"==typeof n?`${t}(${n})`:`${t}[${n-1}]`,u=HC(".classID",`${r}${l}`,e)||HC(".@class",`${r}${l}`,e),d={instruction:"UPDATE",content:{...rS.unflatten(s)},isDefault:i},p={content:{...c&&u?{"@class":u}:{},...d.content},target:rS.buildInstructionPageReference(r,t),["string"==typeof n?"groupIndex":"listIndex"]:n,instruction:"UPDATE"};return a||BC(qS({...d,["string"==typeof n?"groupIndex":"listIndex"]:"string"==typeof n?n:n-1,context:e,referenceList:`${r}${t}`,skipDirtyValidation:o})),p}};const sp=class{static execute(e,t,n){return{target:rS.buildInstructionPageReference(n,e),["string"==typeof t?"groupIndex":"listIndex"]:t,instruction:"DELETE"}}};const rp=class{static getDeleteAllInstruction(e,t){return{instruction:"DELETE ALL",target:rS.buildInstructionPageReference(e,t)}}static execute(e,t,n,s){s||BC(qS({instruction:"DESELECT_ALL",context:e,referenceList:`${n}${t}`}))}};const ap=class{static execute(e,t,n,s){return{target:rS.buildInstructionPageReference(s,e),listMoveToIndex:n,listIndex:t,instruction:"MOVE"}}};const op=class{static execute(e,t,n){const s=!PA.isInfinityRuntime(),r={instruction:"REPLACE",content:{...rS.unflatten(t)}},a=r.content.classID||r.content["@class"];delete r.content.classID;return{instruction:{target:rS.buildInstructionPageReference(n,e),content:{...s&&a?{"@class":a}:{},...r.content},instruction:"REPLACE"},actionPayload:r}}};const ip=class{static execute(e,t){return{target:rS.buildInstructionPageReference(t,e),instruction:"DELETE"}}};const cp=class{constructor(e){this.next=null,this.automatic=!1,this.instruction=e,this.previous=null,this.childrenStateMachines=[]}};const lp=class{constructor(e,t,n){this.target=e,this.pageReference=t,this.contextName=n,this.root=null,this.current=null,this.changeList={},this.hasEncryptedContent=!1,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 cp(e);null===this.root&&(this.root=t),null!==this.current&&(t.previous=this.current,this.current.next=t),this.current=t}applyEncryptedContent(e){void 0!==e&&(this.current.instruction.encryptedContent=e)}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 s=e.getValue(this.target)||[];if(Array.isArray(s)){if(t)return void s.forEach(((e,s)=>{t.forEach((t=>{const r=wI(t),a={};let o=!0;n&&(a[wI(n)]=crypto.randomUUID(),o=!1);const i={[r]:rS.getIn(e,r),...a};this.update(i,s+1,o,{isDefault:!0,skipDirtyValidation:!0})}))}));s.forEach(((e,t)=>{if(n&&!e[wI(n)]){const e={};e[wI(n)]=crypto.randomUUID(),this.update(e,t+1,!1,{isDefault:!0,skipDirtyValidation:!0})}}))}t&&s&&"object"==typeof s&&!Array.isArray(s)&&Object.keys(s).length>0&&this.processObjectRows(s,t,n)}processObjectRows(e,t,n){Object.keys(e).forEach((s=>{const r=e[s];t.forEach((e=>{const t=wI(e),a={};let o=!0;n&&(a[wI(n)]=crypto.randomUUID(),o=!1);const i={[`${t}`]:rS.getIn(r,t),...a};this.update(i,s,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,s){const{isDefault:r=!1,skipPageinstruction:a,skipDirtyValidation:o=!1,encryptedContent:i}=s,c=np.execute(this.contextName,this.target,t,e,this.pageReference,n,o,r);if(!a){if("string"==typeof t?this.initChangeList(t):this.initChangeList(t-1),!r){const n=this.changeList?.[this.targetPageReference]?.["string"==typeof t?t:t-1].content;this.changeList[this.targetPageReference]["string"==typeof t?t:t-1]=XC(rS.deepClone(n),e,s)}if(this.current?.automatic===r&&(this.current?.instruction?.groupIndex===t||this.current?.instruction?.listIndex===t)&&"UPDATE"===this.current?.instruction.instruction){const t=this.current.instruction.content;return this.current.instruction.content=XC(rS.deepClone(t),rS.unflatten(e),s),void this.applyEncryptedContent(i)}this.insertNode(c),this.applyEncryptedContent(i),r&&(this.current.automatic=!0)}}delete(e,t){const n=sp.execute(this.target,e,this.pageReference);this.changeList[this.targetPageReference]?.splice(e-1,1),this.insertNode(n),t||BC(qS({instruction:"DELETE",listIndex:"string"==typeof e?e:e-1,context:this.contextName,referenceList:`${this.pageReference}${this.target}`}))}insert(e,t,n,s){const{instruction:r,actionPayload:a={content:{}},displayPropertPayload:o={}}=tp.execute(this.target,t,e,this.pageReference),{isDefault:i=!1,encryptedContent:c,skipDirtyValidation:l=!1}=s;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]=XC(rS.deepClone(n),e,s)}this.root&&!this.root.instruction?.instruction&&this.current&&!this.current.instruction?.instruction?this.root.instruction=r:this.insertNode(r),this.applyEncryptedContent(c),n||(a.content={...a.content,...o},BC(qS({...a,["string"==typeof t?"groupIndex":"listIndex"]:"string"==typeof t?t:t-1,c11nEnv:s.c11nEnv,context:this.contextName,referenceList:`${this.pageReference}${this.target}`,skipDirtyValidation:l}))),i&&(this.current.automatic=!0)}replacePage(e,t,n,s,r){const a=s??this.pageReference,o=n??this.target,{instruction:i,actionPayload:c}=op.execute(o,e,a);this.insertNode(i),this.applyEncryptedContent(r),t||BC(qS({...c,context:this.contextName,referenceList:`${a}${rS.convertClipboardPageToPageRefNotation(o)}`}))}deletePage(e){const t=ip.execute(this.target,this.pageReference);this.insertNode(t),e||BC(qS({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 s=ap.execute(this.target,e,t,this.pageReference);this.insertNode(s),BC(qS({listIndex:e-1,listMoveToIndex:t-1,context:this.contextName,referenceList:`${this.pageReference}${this.target}`,instruction:"MOVE"}))}deleteAll(e){const t=rp.getDeleteAllInstruction(this.pageReference,this.target);this.changeList[this.targetPageReference]=[],this.insertNode(t),rp.execute(this.contextName,this.target,this.pageReference,e)}updatePage(e){if(!this.current?.instruction||!e)return;const t=this.current.instruction.content||{};this.current.instruction.content=XC(rS.deepClone(t),e)}},up={},dp={},pp={},gp=(e,t,n)=>{up[e]||(up[e]={}),up[e][t]||(up[e][t]={content:[]}),dp[e]||(dp[e]=[],pp[e]=[]),vI.isStateMachineExist(e,n,t)||vI.setStateMachine(e,t,n,new lp(t,n,e))},hp=e=>ep.formatPageReference(e),fp=(e,t)=>{const n=dp[e],s=pp[e],r=wI(t),a=r?.substring(0,r.indexOf("["));s?.indexOf(a)<0&&pp[e].push(a),n?.indexOf(r)<0&&dp[e].push(r)},mp=e=>{delete dp[e]},Ip=e=>vI.buildPageInstructionsByContext(e),Ep=e=>{vI.clearStateMachines(e),delete up[e]},yp=(e,t,n,s)=>{let[,r]=t.split(`${e}[${s}]`);""!==r&&void 0!==r&&(r=r.startsWith(".")?r.substring(1):r,Object.keys(n).forEach((e=>{n[`${r}.${e}`]=n[e],delete n[e]})))},Ap=(e,t,n,s,r)=>{const{skipStateUpdate:a=!1,insertIfEmpty:o=!1,skipDirtyValidation:i=!1}=r||{},c=n.getContextName(),l=n.getReferenceList(),u=s||n.getPageReference(),d=hp(l);gp(c,d,u),fp(c,`${l}[${t}]`),yp(l,u,e,t);const p={instruction:js.LIST_ACTIONS.INSERT,content:{...rS.unflatten(e)}};delete JSON.parse(JSON.stringify(p)).content.classID;const g=vI.getStateMachine(c,u,d);o&&g?.root||g.insert(e,t+1,a,{c11nEnv:n,skipDirtyValidation:i})},Cp=(e,t,n=0,s={})=>{const{skipStateUpdate:r=!0,pageRef:a}=s,o=t.getContextName();let i=t.getReferenceList();const c=a||t.getPageReference();i||(i=((e,t)=>{const n=e.indexOf(Fs.CONTENT)+Fs.CONTENT.length,s=e.lastIndexOf(`[${t}]`);return e.substring(n,s)})(c,n));const l=hp(i);gp(o,l,c),fp(o,`${i}[${n}]`),yp(i,c,e,n);vI.getStateMachine(o,c,l).update(e,n+1,r,s)},Sp=(e,t)=>{const[,n]=e.split("."),s=t?.split(".").pop();return n===s},_p=e=>{const t=rS.getPropertyName(e),n=t.indexOf(".");return n>=0?t.slice(n+1):t},Np=(e,t,n)=>{const s={};return Object.values(e).forEach((e=>{if(Sp(e,n)){const n=_p(e).split(".");if(n.length>1){let e=rS.getIn(t,n)??"";if(!e){const s=`!P!${n.join(":")}`;e=rS.getIn(t,s)??""}rS.setIn(s,n,e)}else{const e=rS.getIn(t,n)??"";s[n[n.length-1]]=e}}})),s},Tp=(e,t,n,s,r)=>{const a=e.getValue(t)||{};n&&Object.keys(a).length>0&&e.clearErrorMessages({property:s?r:e.getStateProps().value})},Dp=(e,t,n)=>new Promise((s=>{const{skipPageInstructions:r=!1}=n,{selectionMode:a,selectionList:o,required:i}=t.getConfigProps(),c=a===js.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 g=null;const h=(e=>e?.config?.dataRelationshipContext&&"SimpleTableSelect"===e.type&&"single"===e.config?.selectionMode)(p);h&&(d=p?.config?.dataRelationshipContext,g=u.concat(".").concat(d),u=g);const f=((e,t,n)=>e?`${t}${n}`:t)(c,u,o),m=((e,t,n,s)=>t?e.getFieldMetadata(`${n}`):e.getCurrentPageFieldMetadata(s))(t,c,d,g),{datasource:{parameters:I={}}}=m,E={...I};if(((e,t,n)=>{t?.descriptors?.length&&!n&&t.descriptors.forEach((t=>{e[_p(t)]=t}))})(E,m,c),c){let n=o;n=hp(n);const s=t.getValue(f)||[];gp(t.getContextName(),n,u);const a=[];let i=s.length;e.forEach((e=>{const t=Np(I,e,d),o={};if(Object.hasOwn(e,"displayProperty")){const t=e.displayProperty;o[t]=e[t]}const c=Object.entries(t);let p=s.findIndex((e=>c.every((([t,n])=>e[t]===n))));if(-1===p?(p=i,e.$selected&&(i+=1)):i=i?i-1:0,!r){const s=vI.getStateMachine(l,u,n);e.$selected?s.insert(t,p+1,!0,{}):s.delete(p+1,!0)}a.push({instruction:e.$selected?js.LIST_ACTIONS.SELECT:js.LIST_ACTIONS.DESELECT,listIndex:p,content:{...t,...o}})})),BC(qS({instruction:js.LIST_ACTIONS_TYPE.SELECT_DESELECT,context:l,referenceList:`${u}.${d}`,actions:a}))}else{const n=Np(E,e[0],d),s=((e,t)=>{const{selectionKey:n,renderMode:s,referenceList:r,value:a}=e.getRawConfigProps()??{};let o=a;if(n?o=n:"Editable"===s&&(o=r),!o||"string"!=typeof o)return;const i=wI(rS.getPropertyName(o));return i.trim()?i.startsWith(`${t}.`)?`.${i.substring(t.length+1)}`:`.${i}`:void 0})(t,d),r={...h?{contextPageReference:u}:{},...s?{associatedProperty:s}:{}},a=p?.config?.compositeKeys||[];if(t.getRawConfigProps().onlyAllowRefreshOnCompositeKeys&&a.length){const s=a?.reduce(((e,t)=>(e[_p(t)]=t,e)),{})||{},o=Np(s,e[0],d);Object.keys(o).forEach((e=>{delete n[e],t.getActionsApi().updateFieldValue(`.${e}`,o[e],r),t.getActionsApi().triggerFieldChange(`.${d}.${e}`,o[e])}));const i=(e=>e.length>1&&e.pop()||"")(u.split(/\[\d+\]/gm));t.getActionsApi().updateFieldValue(i,n,r),t.getActionsApi().triggerFieldChange(i,n)}else Object.keys(n).forEach((e=>{t.getActionsApi().updateFieldValue(`.${e}`,n[e],r),t.getActionsApi().triggerFieldChange(`.${d}.${e}`,n[e])}))}Tp(t,f,i,c,d),s()})),Pp=e=>{if(!e)return!1;const t=(n=e,vI.buildPageInstructionsByContext(n,!0));var n;return Array.isArray(t)&&t.length>0};const Op=(e,t,n={})=>{const{skipStateUpdate:s=!1}=n,r=e.getPageReference(),a=hp(t);gp(e.getContextName(),t,r);vI.getStateMachine(e.getContextName(),r,a).deleteAll(s);const o=vI.getUnConnectedStateMachines(e.getContextName())||{};Object.keys(o).forEach((e=>{e.includes(`${r}${a}`)&&e!==`${r}${a}`&&(o[e]=null)}))},Rp=e=>({insert:(t,n,s,r)=>Ap(t,n,e,s,r),update:(t,n,s)=>Cp(t,e,n,s),updateProperty:(t,n,s)=>((e,t,n,s={})=>{const r=n.getPageReference(),{stateMachineTarget:a}=vI.getStateMachineObjByPath(`${r}${e}`,n.getContextName(),`${r}${e}`.endsWith("]"));if(!a){let e=r.substring(0,r.lastIndexOf("["));e||(e=r.substring(0,r.lastIndexOf(".")));const t=e.substring(e.lastIndexOf("."));e=e.substring(0,e.lastIndexOf(".")),e&&t&&gp(n.getContextName(),t,e)}vI.executeStateMachine(n.getContextName(),`${r}${e}`,t,!0,s)})(t,n,e,s),deleteEntry:(t,n,s)=>((e,t,n,s)=>{const{skipStateUpdate:r=!1}=s||{},a=t.getContextName(),o=t.getReferenceList(),i=n||t.getPageReference(),c=`${i+o}[${e}]`,l=hp(o);od({type:Fs.MESSAGES.MESSAGES_TYPE_ERROR,pageReference:c,context:a,isListEntry:!0,deletingIndex:e}),gp(a,l,i),fp(a,`${o}[${e}]`);const u=vI.getStateMachine(a,i,l);"string"==typeof e?u.delete(e,r):u.delete(e+1,r);const d=vI.getUnConnectedStateMachines(a)||{};Object.keys(d).forEach((e=>{e.includes(`${i}${l}`)&&e!==`${i}${l}`&&(d[e]=null)}))})(t,e,n,s),reorder:(t,n)=>((e,t,n)=>{const s=n.getContextName(),r=n.getReferenceList(),a=n.getPageReference(),o=hp(r);gp(s,o,a),Zu.deleteAllListNodes(s,`${a}${o}`,!1),fp(s,`${r}[${t}]`),vI.getStateMachine(s,a,o).move(e+1,t+1);const i=vI.getUnConnectedStateMachines(s)||{};Object.keys(i)?.forEach((e=>{e.includes(`${a}${o}`)&&e!==`${a}${o}`&&delete i[e]}))})(t,n,e),setSelectedRows:(t,n={skipPageInstructions:!1})=>Dp(t,e,n),getSelectedRows:(t=!1)=>((e,t)=>{const{selectionMode:n,selectionList:s}=t.getConfigProps(),r=[];let a=t.getPageReference();const o=n===js.LIST_SELECTION_MODE.MULTI;let i=o?s.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}${s}`: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 s=n.substring(n.lastIndexOf(".")+1);return Sp(n,i)&&e[s]?`${t}${e[s]}`:t}),"");t.trim()&&r.push(t.trim())})),Promise.resolve(r)})(t,e),clearSelectedRows:()=>function(e){const{selectionList:t,required:n}=e.getConfigProps(),s=e.getContextName(),r=e.getPageReference(),a=t,o=`${r}${t}`;return new Promise((t=>{let i=a;i=hp(i),gp(s,i,r),vI.getStateMachine(s,r,i).deleteAll(),Tp(e,o,n,!0,a),t()}))}(e),setVisibility:t=>((e,t=!0)=>{const n=e.getContextName(),{selectionMode:s,selectionList:r,renderMode:a,referenceList:o}=e.getComponentConfig();let i;if(s===js.LIST_SELECTION_MODE.MULTI&&r?i=r:"Editable"===a&&o&&(i=e.getStateProps().referenceList),i){i=hp(i);const s=vI.getStateMachine(n,"",`${e.getPageReference()}${i}`);s&&(s.visibility=t)}})(e,t),initDefaultPageInstructions:(t,n,s)=>((e,t,n,s)=>{const r=e.getContextName(),a=e.getPageReference(),o=hp(t);gp(r,o,a),vI.getStateMachine(r,a,o).initPageInstructions(e,n,s)})(e,t,n,s),deleteAll:(t,n)=>Op(e,t,n),replacePage:(t,n,s)=>((e,t,n,s)=>{const{skipStateUpdate:r=!1}=s||{},a=e.getPageReference(),o=e.getContextName();gp(o,t,a),fp(o,rS.buildInstructionPageReference(a,t)),vI.getStateMachine(o,a,t).replacePage(n,r)})(e,t,n,s),deletePage:(t,n)=>((e,t,n)=>{const{skipStateUpdate:s=!1}=n||{},r=e.getPageReference(),a=e.getContextName();gp(a,t,r),fp(a,rS.buildInstructionPageReference(r,t)),vI.getStateMachine(a,r,t).deletePage(s)})(e,t,n)});const bp=new class{constructor(){this.fieldDefaults={}}updateFieldDefaults(e){e&&(Object.keys(this.fieldDefaults).length?rS.mergeDeep(e,this.fieldDefaults):rS.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]}},vp="downloadAttachment",xp={};function wp(e,t){const n=Ls.getDefaultQualifiedName(t);return n!==t&&n in e?e[n]:e[t]}const Mp=e=>{const t=zd();return xp[e]=t,t};function Lp(e){const t=new URL(e,window.location.origin),n=PA.environmentInfoObject?.encCSRFToken;return n&&t.searchParams.set("pzencv1zzz",n),t.searchParams.set("mode","stream"),t.toString()}async function Up(e){const t=function(){if("undefined"!=typeof window&&"showSaveFilePicker"in window)return window.showSaveFilePicker}();if(!t)return null;try{const n=await t({suggestedName:e}),s=await n.createWritable();return{fh:n,writable:s}}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return null;throw e}}async function Fp(e,t,n){const s=await Up(t);if(s)try{const t=await async function(e,t){let n;await Wd(e,{method:"GET",adapter:async e=>(n=e,{data:null,status:204,statusText:"No Content",headers:{},config:e}),withoutDefaultHeaders:!1},t,{includeRemoteSystemIdIfPresent:!0});const s={};return Object.entries(n?.headers??{}).forEach((([e,t])=>{"string"==typeof t&&(s[e]=t)})),s}(e,n),r=await fetch(e,{method:"GET",headers:t});if(!r.ok)throw new Error(`Download failed: ${r.status}`);if(!r.body)throw new Error("Download response has no body");await r.body.pipeTo(s.writable)}catch(e){throw await s.writable.abort().catch((()=>{})),e}}const jp=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("/"),s=e=>e.some((e=>n.includes(e)));s(["excel","spreadsheet"])?t="document-xls":s(["zip","compressed","gzip","rar","tar"])&&(t="document-compress")}return t},Vp=e=>{const t=wp(e,"pyCategoryLabel"),n=wp(e,"pyCategoryName"),s=wp(e,"Category"),r=wp(e,"pxCreateOpName"),a=wp(e,"pxCreateOperator"),o=e.CreateUser,i=wp(e,"pyFileName"),c=wp(e,"FileName"),l=wp(e,"FileExtension"),u=wp(e,"pyAttachName"),d=wp(e,"pyMimeFileExtension"),p=wp(e,"MimeType"),g=wp(e,"pzInsKey"),h=wp(e,"ID"),f=wp(e,"pyAttachmentLink"),m=wp(e,"AttachmentURL"),I=wp(e,"pxAttachmentCreateTime"),E=wp(e,"pxCreateDateTime"),y=wp(e,"CreateDateTime"),A=wp(e,"pxStorageType"),C=wp(e,"pyFileSize"),S=wp(e,"error"),_=wp(e,"thumbnail"),N=wp(e,"pyIsLargeAttachment"),T=wp(e,"IsLargeAttachment");let D,P,O,R;return D=t?`${t},`:n?`${n},`:s,P=r||(a||o?.Name||""),O=i||(l&&""!==l&&c?.endsWith(l)?c.substring(0,c.lastIndexOf(l)-1):c),R=u&&i?u.startsWith(i)&&u.split(".").length-1===i.split(".").length?u.split(".").pop():"":l??"",{props:{meta:`${D} ${P}`,name:u??c??"",icon:jp(d??p??""),error:S??null,thumbnail:_??null},responseProps:{fileName:u??c??"",name:O??"",category:n??s??"",extension:R,ID:g??h??"",mimeType:d??p??"",attachmentURL:f??m??"",createUser:P??"",createDateTime:I??E??y??"",responseType:e.responseType??(h?"binary":null),localAttachment:!!e.localAttachment,storageType:A??void 0,fileSize:C??void 0,isLargeAttachment:void 0!==N?"true"===N:T}}},kp=e=>{let t=[],n=!1;if(e&&Object.hasOwn(e,Ls.getDefaultQualifiedName("pyCount"))){n=!0;const s=wp(e,"pxResults");t=Array.isArray(s)?s.filter((e=>!!wp(e,"pzInsKey"))).map((e=>Vp(e))):[]}else if(e&&"object"==typeof e){let n;n=Array.isArray(e)?e:[e],t=n?.filter((e=>wp(e,"ID")&&wp(e,"FileName")||wp(e,"pzInsKey"))).map(Vp)}else t=[];const s=e?wp(e,"pyCategoryName"):void 0;return{hasUploadedFiles:t.length>0,categoryName:("string"==typeof s?s:"")||t?.[0]?.responseProps?.category||"",attachments:t,isOldAttachment:n}},Bp={uploadAttachment:(e,t,n,s,r,a)=>{const o=new FormData;o.append("appendUniqueIdToFileName","true"),o.append("file",e),r&&o.append("contextID",r),a&&o.append("category",a);const{restApi:i,reqType:c}=i_("uploadAttachment",{}),l={"Content-Type":"multipart/form-data"};return Boolean(PA?.environmentInfoObject?.pyFeatures?.pyEnableStreamingForRepositories)&&(l["x-pega-stream-support"]="repository-stream"),Wd(i,{method:c,headers:l,body:o,onUploadProgress:t,signal:Mp(e.ID).token},s).then((t=>({type:"File",category:e.category||"File",ID:t.data.ID,clientFileID:e.ID,filename:e.name}))).catch(n?n(Yd,e):e=>{throw e.isHandled=!1,e}).finally((()=>delete xp[e.ID]))},linkAttachmentsToCase:(e,t,n,s)=>{const r={};if("File"===n){const[e]=t,{clientFileID:n}=e;delete e.clientFileID,n&&(r.signal=Mp(n).token)}const{restApi:a,reqType:o}=i_("linkCaseAttachment",{caseID:e});return Wd(a,{...r,body:{attachments:t},method:o},s)},getCaseAttachments:(e,t,n=!1)=>{const{restApi:s,reqType:r}=i_("getCaseAttachments",{caseID:e,includeThumbnail:n});return Wd(s,{method:r},t).then((e=>e.data.attachments))},getAttachmentCategories:(e,t,n)=>{const{restApi:s,reqType:r}=i_("getAttachmentCategories",{caseID:e,type:t});return Wd(s,{method:r},n).then((e=>e.data))},downloadAttachment:(e,t,n,s,r)=>{e=e.replace(/\//g,"_");const{restApi:a,reqType:o}=i_(vp,{attachmentID:e}),i=r&&a?(()=>{const e=new URL(a,window.location.origin);return e.searchParams.set("encoding",r),e.toString()})():a;return function(e){const t=PA.environmentInfoObject;return!(!t?.pyFeatures?.pyEnableStreamingForRepositories||"repository"!==e?.toLowerCase()||"EMBED"===t?.renderingMode&&!PA.isPegaMobile())}(s)&&a?async function(e){return await Dd(Zd()),{data:Lp(e)}}(a):Wd(i,{method:o,..."binary"===n&&!r&&{responseType:"arraybuffer"}},t)},editAttachment:(e,t,n)=>{const{restApi:s,reqType:r}=i_("editAttachment",{attachmentID:e});return Wd(s,{method:r,body:{...t}},n)},deleteAttachment:(e,t)=>{const{restApi:n,reqType:s}=i_("deleteAttachment",{attachmentID:e});return Wd(n,{method:s},t)},downloadDocument:(e,t)=>{const{restApi:n,reqType:s}=i_("downloadDocument",{documentID:e});return Wd(n,{method:s},t)},deleteDocument:(e,t,n)=>{const{restApi:s,reqType:r}=i_("deleteDocument",{caseID:e,documentID:t});return Wd(s,{method:r},n)},getDocumentURL:e=>{const t=PCore.getEnvironmentInfo().getDocumentUrlDP()||Ls.getDefaultQualifiedName("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=>{xp[e]&&(xp[e].cancel(),delete xp[e])},buildFilePropsFromResponse:Vp,getAttachmentURL:e=>{const{restApi:t}=i_(vp,{attachmentID:e});return t},prepareAttachmentData:kp,validateAttachments:(e,t)=>{let n=e;if((e=>null!==e&&"object"==typeof e&&"hasUploadedFiles"in e&&"boolean"==typeof e.hasUploadedFiles)(t)){const{attachments:e}=t;0===e.length&&(n="")}else{const{attachments:e}=kp(t);0===e.length&&(n="")}return n},streamDownloadAttachment:async(e,t,n)=>{if(!PA.environmentInfoObject?.pyFeatures?.pyEnableStreamingForRepositories)return;e=e.replace(/\//g,"_");const{restApi:s}=i_(vp,{attachmentID:e});s&&(await Dd(Zd()),await Fp(Lp(s),t,n))}};let $p=!1;const Gp=e=>{$p=e},Wp=new Map,Hp=(e,t)=>{Wp.set(e,t)},qp=e=>{Wp.delete(e)};class zp{constructor(){this.validators={}}static messageDispatcher(e,t,n,s,r,a){if(s){const o=[];o.push({type:Fs.MESSAGES.MESSAGES_TYPE_ERROR,fieldLabel:r,message:s,...a??{}}),id({messages:o,property:e,pageReference:t,context:n})}}register(e,t){this.validators[e]=t}getValidator(e){return this.validators[e]}validateRequired(e,t,n,s,r,a){const{required:o,value:i}=a;let c=null;if(!("true"!==o&&!0!==o)){let o=s;switch(e){case"radiobuttons":o=i;break;case"attachment":o=Bp.validateAttachments(s,i);break;case"checkbox":o&&"false"!==o||(o="");break;default:"string"==typeof o&&(o=o.trim())}c=this.getValidator("required")(o),zp.messageDispatcher(t,n,r,c,ep.getFieldLabel(a),{subType:"required"})}return c}validateType(e,t,n,s,r,a){let o=null;const i={pageReference:n,context:r,property:t,...a};let c=bp.getDefaultsforType(a?.componentName||"")?.["client-validations"];!1!==c&&e&&this.getValidator(e)&&(o=this.getValidator(e)(s,i),(""!==s||bp.getDefaultsforType(a?.componentName||"")?.showErrorWhenEmpty)&&zp.messageDispatcher(t,n,r,o,a?.label));const l=a?.validationType;return c=l&&bp.getDefaultsforType(l)?.["client-validations"],!1!==c&&l&&this.getValidator(l)&&(o=this.getValidator(l)(s,i),zp.messageDispatcher(t,n,r,o,a?.label)),o}validate(e,t,n,s={}){const{context:r,disabled:a,readOnly:o,pageReference:i,skipRequiredValidation:c}=s;let l=null;return a||o||(c||$p||(l=this.validateRequired(e,t,i,n,r,s)),l||(l=this.validateType(e,t,i,n,r,s))),{message:l}}isValidatorExist(e){return!!e.validatetype}}const Yp=new zp,Kp=e=>{e&&fC(e)},Qp=(e,t)=>{e.DeclareExpressions&&t.context&&Eo({[t.context]:e.DeclareExpressions})},Jp=(e,t,n=!1)=>{const s=rS.getIn(e,js.RESOURCES);s&&(Kp(s),Qp(s,t)),n||f_({...e,options:t})};class Xp{static createCase(e,t){const{caseInfo:n,startingFields:s,flowType:r,viewType:a=tI.PAGE,pageName:o,context:i=js.APP.APP,debugInfo:c,headers:l,theType:u,retrieveActionViewForNewObject:d=!1}=t;let p={};n&&n.content&&(p=n.content);const{content:g={},pageInstructions:h}=Xp.getExternalCaseOrObjectContent(e,d,i);let f={[Xp.getKeyBasedOnWorkType(e)]:e,content:{...p,...s,...g}};if(f={...f,...h&&{pageInstructions:h},...!YI.isObjectCaseType(e)&&{processID:r}},"CREATE_EXTERNAL_CASE"===u){const e=$C(i)?.caseInfo?.content;if(e){const t=rS.pruneKeys(e,new Set(["pxObjClass",Ls.getDefaultQualifiedName("pxObjClass"),"EmbedListUUID__",Ls.getDefaultQualifiedName("EmbedListUUID__")]),!1);f.content[js.getDefaultQualifiedName("pyAddCaseContextPage")]=t}}const m=Xp.getObjectTypeViewPayload(d,e);return tg(YI.getRouteKeyForCreateWork(e,d),{body:f,queryPayload:{...m,...YI.isExternalCaseType(e)?{casetypeID:e}:{caseClassName:e},viewType:a,params:{pageName:o}},headers:{...l,...c&&{...wd.addDebugHeaders(c)}}},i).then((t=>({response:t.data,requestPayload:f,headers:sI(t.headers,e,l)})))}static getObjectTypeViewPayload=(e,t)=>e?YI.shouldUseUnifiedHandling()?{casetypeID:t,actionID:js.getDefaultQualifiedName(js.VIEW_NAMES.OBJECT_CREATE_VIEW)}:{objectTypeID:t,actionID:js.getDefaultQualifiedName(js.VIEW_NAMES.OBJECT_CREATE_VIEW)}:{};static getExternalCaseOrObjectContent=(e,t,n)=>{const s=YI.isExternalObject(e),r=YI.isExternalCaseType(e);if((r||s)&&!t){const e=rI(n,{isExternalObject:Boolean(!r&&s)}),{content:t,pageInstructions:a}=e.content;return{content:t,pageInstructions:a}}return{}};static getKeyBasedOnWorkType=e=>YI.shouldUseUnifiedHandling()?"caseTypeID":YI.isObjectCaseType(e)?"objectTypeID":"caseTypeID"}const Zp=Xp,eg=()=>({registerHeader:(...e)=>wd.registerHeader(...e),unRegisterHeader:(...e)=>wd.unRegisterHeader(...e),getRegisteredHeaders:()=>wd.getRegisteredHeaders()}),tg=(e,{body:t={},queryPayload:n={},cancelTokenSource:s,headers:r={},responseType:a},o,i)=>{const{restApi:c,reqType:l}=i_(e,n),u={method:l,headers:r,body:t,...a&&{responseType:a}};s&&(u.signal=s.token);const d="createWork"===e?YI.appendExcludeQueryParamToUrl(c):c;return Wd(d,u,o,i??{})},ng=(e,{method:t="GET",body:n={},headers:s={},withoutDefaultHeaders:r=!1},a)=>{e.startsWith("http:")||e.startsWith("https:")||(e=rn()+e);return Wd(e,{method:t,headers:s,body:n,withoutDefaultHeaders:r},a)},sg=e=>TA.doesRestApiExist(e),rg=()=>zd(),ag=e=>Yd(e),og=e=>{jd=e},ig=()=>Zp,cg=new Set;function lg(e){try{const t=new URL(e);"https:"!==t.protocol&&"http:"!==t.protocol||cg.add(t.origin)}catch{}}function ug(e){let t,n;try{t=new URL(e,window.location.href).origin}catch{throw new Error("Blocked: malformed URL")}try{n=window.location.origin??new URL(window.location.href).origin}catch{n=""}if(t!==n&&!cg.has(t))throw new Error(`Blocked: untrusted script origin "${t}"`)}const dg="getCustomComponent",pg="text/javascript";function gg(e){let t;try{t=new URL(e).protocol}catch{throw new Error("Component fetch blocked: malformed dev server URL")}if("http:"!==t&&"https:"!==t)throw new Error(`Component fetch blocked: unsupported dev server URL scheme "${t}"`)}const hg=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="",s=0;return e.forEach((e=>{n+=`${0===s?"?":"&"}field${s}=${e.field}&value${s}=${e.value}`,s+=1})),this.pegaOnlyUrl?this.getSvcComponentsConfigSeparatedUrls(e,n,t):this.getSvcComponentsConfigCombinedUrl(e,n,t)}async getSvcComponentsConfigSeparatedUrls(e,t,n){const s=PA.getBuiltOnAppNames(),r=this.loadAndFilterPegaComponentsConfig(e,s);let a=Promise.resolve([]);!0!==n.skipLoadCustomerComponents&&(a=this.loadAndCustomerComponentsConfig(t,e));const o=[],i=PA.environmentInfoObject?.pyInfinityStaticService;if(i){const e=[],t=await Promise.all([r,a]),[n,s]=t,i=[];for(const t of s)!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([r,a,e]).then((e=>{const t=this.mergeComponentList(e);o.push(...t)}))}if(n.alternateDesignSystemURL&&1===o.length){const s=await this.getSvcComponentsConfigADS(e,t,n);o[0].alternateDesignSystemConfig=s}return{data:{components:o}}}mergeComponentList=e=>{const[t=[],n=[],s=[]]=e,r=[...t,...n];return this.appStaticUrl?r.map((e=>{const{name:t,type:n,subtype:r}=e,a=s.reduce(((e,s)=>(t===s.name&&n===s.type&&r===s.subtype&&(e=s),e)),{});return Object.keys(a).length>0?{...e,alternateDesignSystemConfig:{...a}}:e})):r};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((s=>{let r=!0;e.forEach((e=>{Array.isArray(s[e.field])?s[e.field].includes(e.value)||(r=!1):s[e.field]!==e.value&&(r=!1)})),r&&this.checkForBuiltOnSupport(t,s.allowedApplications)&&n.push(s)})),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 s=PA.environmentInfoObject?.pyInfinityStaticService;if(s){const e={};t.forEach(((t,n)=>{e[`field${n}`]=t.field,e[`value${n}`]=t.value})),n=PCore.getDataPageUtils().getDataAsync(Ls.getDefaultQualifiedName("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 s=`${this.staticServerURL}v102/${this.appAlias}/componentslist${t}`,r=await fetch(s,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.json())).then((e=>({data:e})));if(!0===n.skipLoadCustomerComponents&&r?.data?.components?.length>0&&(r.data.components=r.data.components.filter((e=>void 0===e.componentKey))),n.alternateDesignSystemURL&&1===r?.data?.components?.length){const s=await this.getSvcComponentsConfigADS(e,t,n);r.data.components[0].alternateDesignSystemConfig=s}return r}getSvcComponentsConfigADS(e,t,n){const s=`${n.alternateDesignSystemURL}${n.alternateDesignSystemURL?.endsWith("/")?"":"/"}components/${e[0].value}/config-ext.json`;return fetch(s,{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){try{const t=PA.environmentInfoObject?.pyInfinityStaticService,{callUrlKey:n,queryPayload:s,callUrl:r}=this.buildImageRequest(e,t);return this.imageBlobUrlCache[r]||(this.imageBlobUrlCache[r]=this.fetchImage(n,s,r,t)),this.imageBlobUrlCache[r]}catch(e){return Promise.resolve(null)}}buildImageRequest(e,t){let n,s="getBinaryFile",r=`${this.appStaticUrl}v102/${this.appAlias}/image/${e}`;if(t){const t=/DATA-CONTENT-IMAGE\s([^!]*)!.*\/OPERATORIMAGES\//i,a=e.match(t);if(a){const e=a[1]?.trim();if(!e)throw console.warn("AssetLoader.buildImageRequest: operator image key is missing user id"),new Error("AssetLoader.buildImageRequest: operator image key is missing user id");s="getOperatorImage",n={user_ID:e.toLowerCase()}}else n={fileID:e};r=i_(s,n)?.restApi||r}return{callUrlKey:s,queryPayload:n,callUrl:r}}fetchImage(e,t,n,s){return s?tg(e,{queryPayload:t}).then((e=>{const n=this.decodeBase64ToByteArray(e.data),s=this.getMimeTypeFromKey(t?.fileID||t?.user_ID||""),r=new Blob([n],{type:s});return window.URL.createObjectURL(r)})).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,s=new Uint8Array(n);for(let e=0;e<n;e+=1)s[e]=t.charCodeAt(e);return s}getMimeTypeFromKey(e){const t={svg:"image/svg+xml",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif"},n=e.toLowerCase().split("!").pop()||"";return t[n]?t[n]:"application/octet-stream"}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=PA.environmentInfoObject?.pyC11nDXCBDevURL;if(t){const e=t.replace(/\/+$/,"");gg(e);const n=await fetch(`${e}/index.js`);if(!n.ok)throw new Error(n.statusText);return await n.text()}const n=PA.environmentInfoObject?.pyInfinityStaticService;if(n){const t=PA.environmentInfoObject?.pxApplication?.pxUpdateDateTime,n=t?rS.parsePegaDateTimeToTimestamp(t):null,s=`${e}${n?`?v=${n}`:""}`;return(await tg(dg,{queryPayload:{componentName:s}})).data}const s=await fetch(`${this.appStaticUrl}v102/${this.appAlias}/component/${e}`,{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,t){try{const n=PA.environmentInfoObject?.pyInfinityStaticService,s=PA.environmentInfoObject?.pyC11nDXCBDevURL;let r=`${this.appStaticUrl}v100/componentlib/componentsmap/${e}`;if(s){gg(s);const e=s.replace(/\/+$/,"");r=`${e}/index.js`}if(n&&!s){const n=PA.environmentInfoObject?.pxApplication?.pxUpdateDateTime,s=rS.parsePegaDateTimeToTimestamp(n),r=rS.parsePegaDateTimeToTimestamp(t),a=[];s&&a.push(`v=${s}`),r&&a.push(`libV=${r}`);const o=a.length?`${e}?${a.join("&")}`:e,i=await tg(dg,{queryPayload:{componentName:o}});return void await this.appendCustomScriptToHead(i.data)}if(n||s){if("undefined"==typeof document)return;return void await new Promise(((e,t)=>{const n=document.createElement("script");n.src=r,n.type="text/javascript";const s=setTimeout((()=>{t(new Error(`Timed out waiting for custom component script to load: ${r}`))}),3e4);n.onload=()=>{clearTimeout(s),e()},n.onerror=()=>{clearTimeout(s),t(new Error("Error while appending custom component map"))},document.head.appendChild(n)}))}const a=await fetch(r,{headers:{Authorization:`Bearer ${this.b2sJWT}`}});a.ok||console.error("Error while fetching custom component map");const o=await a.text();this.setCCV2LibId(e),await this.appendCustomScriptToHead(o)}catch(e){console.error("Exception while appending custom component map (or load blocked):",e)}}async appendCustomScriptToHead(e){if("undefined"!=typeof document)try{await new Promise(((t,n)=>{const s=document.createElement("script");s.src=window.URL.createObjectURL(new Blob([e],{type:pg}));const r=setTimeout((()=>{n(new Error("Timed out waiting for custom component script to load"))}),3e4);s.onload=()=>{clearTimeout(r),t()},s.onerror=()=>{clearTimeout(r),n(new Error("Error while appending custom component map"))},document.head.appendChild(s)}))}catch(e){console.error("Exception appendCustomScriptToHead:",e)}}loadSvcComponent(e){return new Promise(((t,n)=>{this.getSvcComponent(e).then((s=>{if("undefined"==typeof document)return void n(e);const r=document.createElement("script");r.src=window.URL.createObjectURL(new Blob([s],{type:pg})),r.onload=()=>t(e),r.onerror=()=>n(e),document.head.appendChild(r)})).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,cg.clear(),e&&t&&"no-appstatic"!==t&&"no-cdn"!==t?(this.appStaticUrl=t.endsWith("/")?t:`${t}/`,this.staticServerURL=e.endsWith("/")?e:`${e}/`,this.pegaOnlyUrl=!0,lg(this.staticServerURL),lg(this.appStaticUrl)):e&&t&&"no-appstatic"===t?(this.staticServerURL=e.endsWith("/")?e:`${e}/`,this.appStaticUrl=this.staticServerURL,this.pegaOnlyUrl=!0,lg(this.staticServerURL)):e&&t&&"no-cdn"===t&&(this.staticServerURL=e.endsWith("/")?e:`${e}/`,this.appStaticUrl=this.staticServerURL,lg(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,s)=>{if("undefined"==typeof document)return void s(e);const r=document.createElement(t);if("script"===t){const t=r;t.onload=()=>{n(e)},t.onerror=()=>{s(e)},t.type=pg,t.charset="UTF-8",t.async=!1,t.src=e}else{const t=r;t.type="text/css",t.rel="stylesheet",t.href=e}document.head.appendChild(r)})).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 s=[];return e.forEach((e=>{const t=Object.keys(e)[0];let r=n?Object.values(e)[0]:this.getStaticServerUrl();r=r.endsWith("/")?r:`${r}/`,this.loadedAssets[t]||(t.includes(".js")?s.push(this.getLoader()(r+t,this.getTypes.SCRIPT)):t.includes(".css")&&this.getLoader()(r+t,this.getTypes.STYLE),this.loadedAssets[t]=!0)})),Promise.all(s)}getAssetsFromIsolations(e){const t=this.b2sJWT?.split(".")[1].replace(/-/g,"+").replace(/_/g,"/")||"",n=decodeURIComponent(r.g.atob(t).split("").map((e=>`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`)).join("")),s=JSON.parse(n),a=s?.tenant_id,{restApi:o,reqType:i}=o_("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()))}},fg="component-loader",mg={},Ig=async(e,t)=>{if(!e?.length||!1===window.PCore?.getBehaviorOverride("dynamicLoadComponents"))return Promise.resolve();const n=hg.getLoader(),s=t||hg.staticServerURL;if(hg.getLoader(fg))return hg.getLoader(fg)(e,s);const r=new Set(Object.keys(mg)),a=e.flatMap((e=>{if(r.has(e))return[];const t=Co.getComponent(e);if(!t){const t=`${hg.getConstellationServiceUrl()}/v860/${hg.getAppAlias()}/component/${e}.js`;return r.add(e),[n(t,hg.getTypes.SCRIPT)]}const a=(t.scripts||[]).map((e=>n(e.startsWith("http")?e:`${s}${e}`,hg.getTypes.SCRIPT))),o=(t.styles||[]).map((e=>n(`${s}${e}`,hg.getTypes.STYLE)));return r.add(e),[...a,...o]}));return Promise.all(a.map((e=>e.catch((e=>console.error("Error loading asset:",e))))))},Eg="component-state-lru-index";function yg(e){return"object"==typeof e&&null!==e&&"key"in e&&"accessedAt"in e&&"string"==typeof e.key&&"number"==typeof e.accessedAt}function Ag(){try{const e=sessionStorage.getItem(Eg);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(yg):[]}catch{return[]}}function Cg(e){try{sessionStorage.setItem(Eg,JSON.stringify(e))}catch{}}function Sg(e){const t=Ag().filter((t=>t.key!==e));t.unshift({key:e,accessedAt:Date.now()}),Cg(t)}const _g=()=>"undefined"!=typeof sessionStorage?sessionStorage:null;const Ng=new class{#a;constructor(){this.userSettings={},this.componentCache={},this.contextMapToClearOnCancel={},this.#a=!1}getNormalizedKey(e){return e?.toString().trim().replace(/\s/g,"-").toLowerCase()}setComponentState=(e,t,n)=>{_g()?n?.managed&&"FULL_PORTAL"!==PA.getRenderingMode()||(_g()?.setItem(this.getNormalizedKey(e),JSON.stringify(t)),n?.managed&&(Sg(this.getNormalizedKey(e)),function(e){const t=Ag();if(t.length<=100)return[];const n=[],s=t.slice(0,100),r=t.slice(100);for(const t of r){try{e(t.key)}catch{}n.push(t.key)}Cg(s)}((e=>{_g()?.removeItem(e)})))):console.error("Session Storage not found")};getComponentState=(e,t)=>{if(t?.managed&&"FULL_PORTAL"!==PA.getRenderingMode())return;const n=_g()?.getItem(this.getNormalizedKey(e))??null,s=n?rS.isValidJson(n):void 0;return t?.managed&&null!=(s??n)&&Sg(this.getNormalizedKey(e)),s||n};removeComponentState=(e,t)=>{t?.managed&&"FULL_PORTAL"!==PA.getRenderingMode()||(_g()?.removeItem(this.getNormalizedKey(e)),t?.managed&&function(e){const t=Ag(),n=t.filter((t=>t.key!==e));n.length!==t.length&&Cg(n)}(this.getNormalizedKey(e)))};fetchUserSettings=async()=>{if(sg("getUserSettings")){const{restApi:e,reqType:t}=i_("getUserSettings");Wd(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=()=>{PA.getUserSettings()?this.userSettings=PA.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 rS.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(!sg("updateUserSettings"))return Promise.resolve("updateUserSettings route is not available");n=i_("updateUserSettings");const{restApi:s,reqType:r}=n;return Wd(s,{method:r,body:rS.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 s=n.clearOnCancelForContext;if(s&&(Object.hasOwn(this.contextMapToClearOnCancel,s)?this.contextMapToClearOnCancel[s].add(this.getNormalizedKey(e)):this.contextMapToClearOnCancel[s]=new Set([this.getNormalizedKey(e)])),this.componentCache[this.getNormalizedKey(e)]=t,!this.#a){this.#a=!0;const e=e=>{const{context:t}=e||{};(this.contextMapToClearOnCancel[t]||new Set).forEach((e=>{this.resetComponentCache(e)})),delete this.contextMapToClearOnCancel[t]};fd.subscribe(js.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(globalThis.location.href).searchParams.get(e);return n?(n=t?atob(n):n,n):null}setURLParam(e,t,n){if(!PA.shouldUseURLParams())return;const s=new URL(globalThis.location.href);if(t=n?btoa(t):t,s.searchParams.get(e)===t)return;s.searchParams.set(e,t);globalThis.history.pushState({type:"ui-navigation"},"",s)}setURLParams(e){const t=new URL(globalThis.location.href);Object.entries(e).forEach((([e,n])=>{t.searchParams.set(e,n)}));globalThis.history.pushState({type:"update-history"},"",t)}resetComponentCache(e){return!("string"!=typeof e||!e?.trim())&&(!!Object.hasOwn(this.componentCache,this.getNormalizedKey(e))&&(delete this.componentCache[this.getNormalizedKey(e)],!0))}};const Tg=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=>{md.isOnline()&&t&&void 0!==this.contextArray[e]&&this.contextArray[e]>0&&BC({type:or,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]&&BC({type:ir,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 Dg=new class{constructor(){this.counterActionMgrId=0,this.actionMgrActions={}}getNextActionMgrId(){return this.counterActionMgrId+=1,this.counterActionMgrId.toString()}register(e,t,n,s,r="unknown",a,o=!0){if(void 0!==this.actionMgrActions[e])return null;const i={actionType:r,promise:t,resolve:n,reject:s,actionPayload:a};return this.actionMgrActions[e]=i,o&&Tg.enableLoadingIndicator(i.actionPayload),e}actionManagerPromise=(e,t="")=>{let n,s;""===t&&(t=this.getNextActionMgrId());const r=new Promise(((e,t)=>{n=e,s=t}));if(!n||!s)throw new Error("resolveFn or rejectFn is not defined.");return this.register(t,r,n,s,e),{actionMgrID:t,promise:r}};resolveActionByID(e,t,n=!0){const s=this.actionMgrActions[e];let r=e;return s?(setTimeout((()=>{s.resolve(t)}),0),Tg.disableLoadingIndicator(s.actionPayload,n)):r=null,r}rejectActionByID(e,t=!0,n){const s=this.actionMgrActions[e];let r=e;return s?(s.reject(n),Tg.disableLoadingIndicator(s.actionPayload,t)):r=null,r}setRemoteCaseHeaderByContext(e,t){t&&(e.headers=e.headers||{},e.headers.RemoteSystemID=t)}setTraditionalRemoteCaseParams(e,t){return e.className=t.className,e.isTraditionalRemoteCase=Bs.isTraditionalRemoteCase(t.className),e.remoteClassName=t.remoteClassName,e.action=t.action,e.viewName=Vs,e.gadgetId=t.gadgetId??YI.getUniqueGadgetId(),e.name=t.name,e.isRemoteCase=!0,e.skipSemanticUrl=!0,nr}};class Pg{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 Og=Pg,Rg=(e,t,n,s)=>TA.getResolvedSemanticURL(e,t,n,s),bg={getResolvedSemanticURL:Rg,getActions:()=>({ACTION_OPENWORKBYHANDLE:Yr,ACTION_SHOWDATA:Hr,ACTION_SHOWVIEW:Wr,ACTION_GETOBJECT:La,ACTION_SHOWINSIGHT:qr,ACTION_SHOWDASHBOARD:zr}),updateSemanticURLAndDocumentTitle:(e,t)=>TA.updateSemanticURLAndDocumentTitle(e,t),getSemanticURLForToaster:(e,t,n=!1,s)=>Rg(n?La:Yr,{caseClassName:e},{[n?"objectID":"workID"]:t},s)},vg={CASE_INFO:`${js.DATA}.${js.CASE_INFO.CASE_INFO}`,CASE_CLASS_NAME:`${js.DATA}.${js.CASE_INFO.CASE_TYPE_ID}`,CASE_TYPE_NAME:`${js.DATA}.${js.CASE_INFO.CASE_TYPE_NAME}`,CASE_INFO_ID:`${js.DATA}.${js.CASE_INFO.CASE_INFO_ID}`,BUSINESS_ID:`${js.DATA}.${js.CASE_INFO.BUSINESS_ID}`},xg=e=>rS.getIn(e,js.getProperty(vg.CASE_CLASS_NAME),js.EMPTY_STRING),wg=e=>rS.getIn(e,js.getProperty(vg.CASE_INFO_ID),js.EMPTY_STRING),Mg=(e,t)=>{const n=wg(t);rS.setIn(e,"key",n)},Lg=e=>rS.getIn(e,js.getProperty(vg.CASE_INFO),{}),Ug=e=>{const t=kC();if(!e)return!1;const n=Ws(e),s=Qy(n),r=Qy(e);if(!s||!r)return!1;const a=Cy(s,n),o=Cy(r,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},Fg=e=>{const t=wg(e),n=rS.getIn(e,js.getProperty(vg.BUSINESS_ID),js.EMPTY_STRING),s=t.toLowerCase().includes(n.toLowerCase())?n:t,r=xg(e),a=(o=e,rS.getIn(o,js.getProperty(vg.CASE_TYPE_NAME),js.EMPTY_STRING));var o;return{businessID:n,caseType:r,resolvedURL:bg.getSemanticURLForToaster(r,s,YI.isObjectCaseType(r)),caseTypeName:a}};const jg=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 s=$I(this.c11nEnv.getContextName(),this.c11nEnv.getPageReference(),t),{message:r}=Yp.validate(this.c11nEnv.getComponentName()?.toLowerCase(),t,e,s);return r?{status:!1,message:r}:{status:!0}}validateEmail(e,t={}){const n=Yp.getValidator("email");if(!n)return{status:"success"};const s=n(e,t);return s?{status:"failure",message:s}:{status:"success"}}},Vg="OPEN_PROCESS_ACTION",kg="OPEN_ASSIGNMENT",Bg="DELETE_CASE_IN_CREATE_STAGE",$g="SAVE_AND_CLOSE",Gg=e=>({type:$g,payload:e}),Wg="DELETE_WORK",Hg=e=>({type:Wg,payload:e});const qg=class{static getSavableDataPage(e){return OC(e)}static getLookUpDataPage(e){return bC(e)}static getLookUpDataPageInfo(e){return vC(e)}static getDataPageKeys(e){return RC(e)}};const zg=class{static getPropertyName(e){return No.getPropertyName(e)}static isProperty(e){return No.isProperty(e)}static getLeafPropertyName(e){return No.getLeafPropertyName(e)}static isPropertyInternal(e){return e.startsWith("px")||e.startsWith("pz")}};class Yg{static createContainerPConnect(e,t,n,s=!1){const{accessedOrder:r,items:a}=e;if(r&&a){const e=r[r.length-1];if(a[e]?.view&&Object.keys(a[e].view).length>0){const r=a[e],o=e.substring(0,e.lastIndexOf("_")),{view:i,context:c}=r,{viewName:l,viewContext:u}=this.processRootViewDetails(i,r,t);if(!l)return null;return Cm({meta:i,options:{context:c,pageReference:u||t,containerName:n,containerItemID:e,parentPageReference:t,hasForm:s||n===my.WORKAREA||n===my.MODAL||l===js.CREATE_DETAILS_VIEW_NAME,target:o}}).getPConnect}}return null}static processRootViewDetails(e,t,n){const{config:{context:s,name:r}={}}=e,{context:a}=t;let o=r,i=s;const c=zg.isProperty(r),l=zg.isProperty(s);if(l){const e=zg.getPropertyName(s);i=HC(`.${e}`,e.startsWith(".")?n:"",a)}if(i||(i=n),c){const e=zg.getPropertyName(r);o=HC(`.${e}`,i,a)}return c&&l&&""!==o&&(o=r,i=s),{viewName:o,viewContext:i}}static addFlowContainerItem(e){const t=e.getContainerManager(),n=e.getContextName();let s,r;if("review"!==e.getValue("context_data.caseViewMode")){const e=n.substring(0,n.lastIndexOf("_")),t=xy(e),a=Cy(e,t);a&&({key:s,flowName:r}=a)}t.addContainerItem({semanticURL:"",key:s,flowName:r,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(js.CASE_INFO.GETNEXTWORK);static getActiveCaseActionName=e=>{const t=e.getValue(js.CASE_INFO.CASE_INFO_ACTIONS),n=e.getValue(js.CASE_INFO.ACTIVE_ACTION_ID),s=t.find((e=>e.ID===n));return s?.name||""};static getFirstCaseActionName=e=>{const t=e.getValue(js.CASE_INFO.CASE_INFO_ACTIONS);return t[0]?.name||""};static hasNotificationMessages=e=>!!e.getValue("caseMessages");static isCaseWideLocalAction=e=>{const t=e.getValue(js.CASE_INFO.ACTIVE_ACTION_ID),n=e.getValue(js.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(js.CASE_INFO.CHILD_ASSIGNMENTS);let n=[];return t&&t.length>0&&t.forEach((({assignments:e=[],Name:t,caseTypeID:s})=>{const r=e.map((e=>({...e,caseName:t,caseTypeID:s})));n=n.concat(r)})),n};static hasAssignments=e=>{const t=e.getValue(js.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS),n=Yg.getChildCaseAssignments(e);return!!(Array.isArray(n)&&n.length>0||Array.isArray(t)&&t.length>0||Yg.isCaseWideLocalAction(e))};static showBanner=e=>{const t=e();return Yg.hasNotificationMessages(t)||!Yg.hasAssignments(t)};static showTodo=e=>"perform"!==e.getValue("context_data.caseViewMode");static isRenderWithToDoWrapper=(e,t)=>{const n=e(),{showWithToDo:s}=t;return s&&(!Yg.isCaseWideLocalAction(n)||Yg.showTodo(n))};static getToDoAssignments=e=>{const t=e.getValue(js.CASE_INFO.CASE_INFO_ACTIONS),n=e.getValue(js.CASE_INFO.ASSIGNMENT_LABEL),s=e.getValue(js.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS)||[],r=Yg.getChildCaseAssignments(e)||[];let a=JSON.parse(JSON.stringify(r));a=a.map((e=>(e.isChild=!0,e)));const o=[...s,...a];let i=JSON.parse(JSON.stringify(o));return t&&!Yg.showTodo(e)&&(i=i.map((t=>(t.name=Yg.getActiveCaseActionName(e)||t?.name||n,t)))),i}}const Kg=Yg;const Qg=class{constructor(e){this.c11nEnv=e}containerManagerPromise=e=>{const t=Dg.getNextActionMgrId();let n,s;const r=new Promise(((e,t)=>{n=e,s=t}));if(!n||!s)throw new Error("resolveFn or rejectFn is not defined.");return Dg.register(t,r,n,s,e),{actionMgrID:t,promise:r}};initializeContainers(e){const t=Dr,n=this.c11nEnv,s={context:n.getContextName(),name:n.getContainerName(),type:js.CONTAINER_TYPE.SINGLE},{actionMgrID:r,promise:a}=this.containerManagerPromise(t),o={...s,...e,actionMgrID:r};return BC(CS(o)),a}addContainerItem(e){const t=Or,n=this.c11nEnv,s=n.getMetadata(),{children:r}=s||{};let a;Array.isArray(r)&&r.length>0&&([a]=r);const o=n.getContextName(),i=n.getContainerName(),c=Hs(i,o,e?.containerType===js.CONTAINER_TYPE.SINGLE),l=Va(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)),[js.WORKAREA].includes(i)&&delete e.data?.coreHeaders;const{actionMgrID:d,promise:p}=this.containerManagerPromise(t),g={...u,...e,actionMgrID:d};return BC(_S(g)),p}updateContainerItem(e){if(!e?.containerItemID)return Promise.reject(new Error("updateContainerItem : containerItemID is required in containerInfo object"));const t=jr,n={context:Ly(e.containerItemID),target:Qy(e.containerItemID)},{actionMgrID:s,promise:r}=this.containerManagerPromise(t),a={...n,...e,actionMgrID:s};return BC(RS(a)),r}activateContainerItem(e){if(!e?.containerItemID)return Promise.reject(new Error("activateContainerItem : containerItemID is required in containerInfo object"));const t=Fr,n={target:Qy(e.containerItemID)},{actionMgrID:s,promise:r}=this.containerManagerPromise(t),a={...n,...e,actionMgrID:s};return BC(wS(a)),r}removeContainerItem(e){if(!e?.containerItemID)return Promise.reject(new Error("removeContainerItem : containerItemID is required in containerInfo object"));const t=Rr,n={context:Ly(e.containerItemID),target:Qy(e.containerItemID)},{actionMgrID:s,promise:r}=this.containerManagerPromise(t),a={...n,...e,actionMgrID:s};return BC(LS(a)),r}resetContainers(e){if(!e?.context||!e?.name)return Promise.reject(new Error("resetContainers : context and name are required in containerInfo object"));const t=Pr,n=zy(e),{actionMgrID:s,promise:r}=this.containerManagerPromise(t),a={...n,...e,actionMgrID:s};return BC(SS(a)),r}addTransientItem(e){const{id:t,data:n,sourceContainerItemId:s}=e,r=this.c11nEnv.getContextName(),a=zs(t,r),o=tA(r);if(a&&o.includes(a))return a;let i=n;if(s){const e=$C(s);if(!e)throw new Error(`addTransientItem: source container item "${s}" not found in store`);i=rS.deepClone(e)}return BC(NS({transientItemID:a,contextName:r,target:Qy(r),data:i})),a}updateTransientData(e){const{transientItemID:t,data:n}=e,s=this.c11nEnv.getContextName();if(t){if(!tA(s).includes(t))return;BC(TS({transientItemID:t,data:n}))}}removeTransientItem(e){const t=this.c11nEnv.getContextName(),{target:n=this.c11nEnv.getTarget(),containerItemID:s,transientItemID:r}=e;if(r&&s){if(!tA(t).includes(r))return;BC(FS({target:n,containerItemID:s,transientItemID:r}))}}createContainerPConnect(e,t,n,s=!1){Kg.createContainerPConnect(e,t,n,s)}hasContainerItems(){const e=this.c11nEnv.getContextName(),t=this.c11nEnv.getContainerName();return Gy(`${e}/${t}`)}isContainerInitialized(){const e=this.c11nEnv.getContextName(),t=this.c11nEnv.getContainerName();return by(e,t)}};function Jg(e,t){return Pu((function(n,s){var r=null,a=0,o=!1,i=function(){return o&&!r&&s.complete()};n.subscribe(Ou(s,(function(n){null==r||r.unsubscribe();var o=0,c=a++;Nu(e(n,c)).subscribe(r=Ou(s,(function(e){return s.next(t?t(n,e,c,o++):e)}),(function(){r=null,i()})))}),(function(){o=!0,i()})))}))}function Xg(e,t){return Pu((function(n,s){var r=0;n.subscribe(Ou(s,(function(n){s.next(e.call(t,n,r++))})))}))}function Zg(e,t,n){return void 0===n&&(n=1/0),$l(t)?Zg((function(n,s){return Xg((function(e,r){return t(n,e,s,r)}))(Nu(e(n,s)))}),n):("number"==typeof t&&(n=t),Pu((function(t,s){return function(e,t,n,s,r,a,o,i){var c=[],l=0,u=0,d=!1,p=function(){!d||c.length||l||t.complete()},g=function(e){return l<s?h(e):c.push(e)},h=function(e){a&&t.next(e),l++;var i=!1;Nu(n(e,u++)).subscribe(Ou(t,(function(e){null==r||r(e),a?g(e):t.next(e)}),(function(){i=!0}),void 0,(function(){if(i)try{l--;for(var e=function(){var e=c.shift();o?Du(t,o,(function(){return h(e)})):h(e)};c.length&&l<s;)e();p()}catch(e){t.error(e)}})))};return e.subscribe(Ou(t,g,(function(){d=!0,p()}))),function(){null==i||i()}}(t,s,e,n)})))}function eh(e){return e&&$l(e.schedule)}function th(e){return e[e.length-1]}function nh(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=function(e){return eh(th(e))?e.pop():void 0}(e);return Mu(e,n)}var sh=Rl((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),rh=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 xl(t,e),t.prototype.lift=function(e){var t=new ah(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new sh},t.prototype.next=function(e){var t=this;su((function(){var n,s;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var r=Ll(t.currentObservers),a=r.next();!a.done;a=r.next()){a.value.next(e)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(s=r.return)&&s.call(r)}finally{if(n)throw n.error}}}}))},t.prototype.error=function(e){var t=this;su((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;su((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,s=n.hasError,r=n.isStopped,a=n.observers;return s||r?zl:(this.currentObservers=null,a.push(e),new ql((function(){t.currentObservers=null,Hl(a,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,s=t.thrownError,r=t.isStopped;n?e.error(s):r&&e.complete()},t.prototype.asObservable=function(){var e=new fu;return e.source=this,e},t.create=function(e,t){return new ah(e,t)},t}(fu),ah=function(e){function t(t,n){var s=e.call(this)||this;return s.destination=t,s.source=n,s}return xl(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:zl},t}(rh),oh=function(e){function t(t){var n=e.call(this)||this;return n._value=t,n}return xl(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},t.prototype.getValue=function(){var e=this,t=e.hasError,n=e.thrownError,s=e._value;if(t)throw n;return this._throwIfClosed(),s},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(rh);function ih(e,t){return Pu((function(n,s){var r=0;n.subscribe(Ou(s,(function(n){return e.call(t,n,r++)&&s.next(n)})))}))}class ch extends oh{constructor(e,t){super(t)}}const lh=(...e)=>ih((t=>e.includes(t.type)));var uh=new fu((function(e){return e.complete()}));function dh(e){return e?function(e){return new fu((function(t){return e.schedule((function(){return t.complete()}))}))}(e):uh}const ph=(e,t,n)=>Lu((s=>("ERR_CANCELED"!==s?.code&&console.error(e,s),nh(GS(e,s,t,null,n))))),gh=(e,t)=>n=>new fu((s=>{let r={},a=0;return n.pipe(Zg((n=>{const s=Date.now();let o;return o=t||Xt,o&&o(n,r)&&s-a<e?dh():(r=n,a=s,nh(n))}))).subscribe(s)})),hh=e=>{const{dataPageID:t,context:n,headers:s,containerItemID:r}=e,a={data_view_ID:t},{restApi:o,reqType:i}=i_("createDataObject",a),{content:c}=rI(r);return Mu(Wd(o,{method:i,headers:s,body:{data:c.content,pageInstructions:c?.pageInstructions}},r)).pipe(Xg((t=>({response:t.data,actionInPayload:e}))),ph("Error occurred during ajax call at createDataObject Epic",n))},fh=e=>{const{dataLookUp:t,context:n,headers:s,viewName:r,requestPayload:a}=e,o={data_view_ID:t,view_ID:r},{restApi:i,reqType:c}=i_("readDataObject",o);return Mu(Wd(i,{method:c,headers:s,body:{dataViewParameters:a}},n)).pipe(Xg((t=>({response:t.data,headers:sI(t.headers),actionInPayload:e}))),ph("Error occurred during ajax call at getDataObjectView Epic",n))},mh=e=>{const{dataPageID:t,context:n,headers:s,containerItemID:r,key:a}=e,o={data_view_ID:t},{restApi:i,reqType:c}=i_("updateDataObject",o),{content:l}=rI(r);return Mu(Wd(i,{method:c,headers:{...s,"if-match":e?.etag},body:{data:{...l.content,...a},pageInstructions:l.pageInstructions||[]}},r)).pipe(Xg((t=>({response:t.data,actionInPayload:e}))),ph("Error occurred during ajax call at updateDataObject Epic",n))},Ih=e=>{const{lookupDatapage:t,context:n,headers:s,actionID:r,dataViewParameters:a}=e,o={data_view_ID:t,action_ID:r},{restApi:i,reqType:c}=i_("openDataObjectAction",o);return Mu(Wd(i,{method:c,headers:s,body:{dataViewParameters:a}},n)).pipe(Xg((t=>({response:t.data,headers:sI(t.headers),actionInPayload:e}))),ph("Error occurred during ajax call at getDataObjectView Epic",n))},Eh=e=>{const{savableDatapage:t,context:n,headers:s,actionID:r,keys:a,containerItemID:o,jsActionQueryParams:i}=e,c={data_view_ID:t,action_ID:r};let{restApi:l}=i_("submitDataObjectAction",c);const{reqType:u}=i_("submitDataObjectAction",c),{content:d}=rI(o);return l=oE(i,l),Mu(Wd(l,{method:u,headers:{...s,"if-match":e?.etag},body:{data:{...d?.content,...a},pageInstructions:d?.pageInstructions||[]}},n)).pipe(Xg((t=>({response:t.data,actionInPayload:e}))),ph("Error occurred during ajax call at getDataObjectView Epic",n))};const yh=new class{constructor(){this.components={}}_checkComponent(e,t){return!!this.components[t]?.[e]}start(e,t,n,s,r){const a={viewName:e,pageReference:n,contextName:s,isInProgress:!0,active:!0,caseKey:t};this.components[s]=this.components[s]||{},this.components[s][r]=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:s,pageReference:r}=n;dE(e,s,t,r,{})}}},Ah="postDataViewMetadata",Ch={getData:(e,t,n,s)=>((e,t,n,s={})=>{const r={dataViewName:e},{skipClearErrorMessages:a,signal:o,doNotMergeMessagesForStatusCode:i}=s,{restApi:c,reqType:l}=i_("getListData",r);return Wd(c,{method:l,body:t,...o&&{signal:o},...a&&{skipClearErrorMessages:a}},n,i)})(e,t,n,s),getListCount:(e,t,n)=>{const s={dataViewName:e},{restApi:r,reqType:a}=i_("getListDataCount",s);return Wd(r,{method:a,body:t},n)},getDataViewMetadata:(e,t,n,s)=>{const r=!!n,a=!!s,o=TA.doesRestApiExist(Ah),i=(r||a)&&o?Ah:"getDataViewMetadata",c={dataViewName:e},{restApi:l,reqType:u}=i_(i,c);if(o){if(r)return Wd(l,{method:u,body:{associationFilter:n}},t);if(a)return Wd(l,{method:u,body:{propertyFilter:s}},t)}return Wd(l,{method:u},t)},getDataObjectView:(e,t,n,s,r={})=>{const{skipClearErrorMessages:a,signal:o,doNotMergeMessagesForStatusCode:i}=r,c={data_view_ID:e,view_ID:t},l={dataViewParameters:n},{restApi:u,reqType:d}=i_("readDataObject",c);return Wd(u,{method:d,body:l,...o&&{signal:o},...a&&{skipClearErrorMessages:a}},s,i)},getCaseEditMetadata:(e,t)=>YI.getCaseEditMetadata(e,t),getCaseEditLock:(e,t)=>YI.getCaseEditLock(e,t),updateCaseEditFieldsData:(e,t,n,s)=>YI.updateCaseEditFieldsData(e,t,n,s),moveListRecords:(e,t)=>{const{sourceID:n,destinationID:s,context:r,listClass:a,viewName:o,viewClassName:i}=e,c={viewName:o,viewClassName:i},{restApi:l,reqType:u}=i_("moveListRecords",c);return Wd(l,{method:u,body:{content:{sourceID:n,destinationID:s,context:r,listClass:a}}},t)},isTimeElapsed:(e,t,n="")=>{if(t){if(e&&n===js.RELOAD_IF_OLDER_THAN)return new Date(e).setSeconds(t)<Date.now();if(e&&n===js.RELOAD_ONCE_PER_INTERACTION)return!0}return!0},getAppCacheKey:e=>void 0!==jy("root").find((e=>e.includes("authoring-preview")))?`${js.AUTHORING_PREVIEW_CONTAINER}-${e}`:`${hg.getAppAlias()}-${e}`,isDistinctResultsOnly:e=>{const t=PA.getKeyMapping("pyGUID");return!e.some((e=>e.field===t))}},Sh=/{(.*?)}/i,_h=/{(.*?)}/g,Nh=e=>null!==e.match(Sh),Th=e=>(e&&(e.startsWith("/")&&(e=e.substring(1,e.length)),e.endsWith("/")&&(e=e.substring(0,e.length-1))),e),Dh=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`}},Ph=e=>e.replaceAll("+","%20"),Oh=["portal","noPortal","debug","activeTab","contextParam","lang"],Rh=e=>{if(e.indexOf("?")>0){const[t,n]=e.split("?"),s=new URLSearchParams(n),r=new Map;for(const[e,t]of s)Oh.includes(e)||r.set(e,t);const a=Ph(new URLSearchParams(Array.from(r.entries())).toString());return a?`${t}?${a}`:t}return e},bh=(e,t)=>e.includes("/assignments")?((e,t)=>{const n=e.split("/"),s=n.indexOf("assignments"),r=n.slice(s-2).join("/"),a=n[n.length-1],o=o_(Kr,{assignmentID:a});return{routeEndpoint:o?.restApi,requestType:o?.reqType,payload:{assignmentID:a},options:t,routeKey:oa,urlPath:r}})(e,t):TA.getEndPointInfo(e),vh=()=>{const e=PA.environmentInfoObject?.pyExecutionRuntimeName;return"Infinity"===e};const xh=class{constructor(e,t,n){this.filter=e,this.messageHandler=t,this.contextName=n}};const wh=class{constructor(){this.users={},this.connected=!1,this.connectionsCount=1}_handleUserPresence({message:e}){const{state:t,updateById:n}=e,s=this.users[n];s&&(s.state=t,Object.keys(s.subscribers).forEach((e=>{s.subscribers[e]?.callback({state:s.state})})))}_getAutoGenId(){return this.connectionsCount+=1,`${Date.now()}_${this.connectionsCount}`}subscribe(e,t,n){const s=this._getAutoGenId(),r=this.users[e];if(r)return r.subscribers[s]={callback:t,contextName:n},s;this.users[e]={subscribers:{[s]:{callback:t,contextName:n}}};const a={matcher:"PRESENCE",criteria:{userId:e}};return sf.subscribe(a,this._handleUserPresence.bind(this)),s}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],sf.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)}))}))}};const Mh=function(e,t,n,s){for(var r=e.length,a=n+(s?1:-1);s?a--:++a<r;)if(t(e[a],a,e))return a;return-1};const Lh=function(e){return e!=e};const Uh=function(e,t,n){for(var s=n-1,r=e.length;++s<r;)if(e[s]===t)return s;return-1};const Fh=function(e,t,n){return t==t?Uh(e,t,n):Mh(e,Lh,n)};const jh=function(e,t){return!!(null==e?0:e.length)&&Fh(e,t,0)>-1};const Vh=function(e,t,n){for(var s=-1,r=null==e?0:e.length;++s<r;)if(n(t,e[s]))return!0;return!1};const kh=function(e,t,n,s){var r=-1,a=jh,o=!0,i=e.length,c=[],l=t.length;if(!i)return c;n&&(t=An(t,ut(n))),s?(a=Vh,o=!1):t.length>=200&&(a=ve,o=!1,t=new Re(t));e:for(;++r<i;){var u=e[r],d=null==n?u:n(u);if(u=s||0!==u?u:0,o&&d==d){for(var p=l;p--;)if(t[p]===d)continue e;c.push(u)}else a(t,d,s)||c.push(u)}return c};var Bh=b?b.isConcatSpreadable:void 0;const $h=function(e){return ke(e)||Ze(e)||!!(Bh&&e&&e[Bh])};const Gh=function e(t,n,s,r,a){var o=-1,i=t.length;for(s||(s=$h),a||(a=[]);++o<i;){var c=t[o];n>0&&s(c)?n>1?e(c,n-1,s,r,a):Ve(a,c):r||(a[a.length]=c)}return a};const Wh=Rs((function(e,t){return as(e)?kh(e,Gh(t,1,as,!0)):[]}));const Hh=class{constructor(e,t){this.atomicSubscribers={},this.connectionsCount=0,this.connected=!1,this.matcher=e,this.criteria=t,this.messagingServiceSubscriptionID=""}_handleAtomicMessage({message:e}){Object.keys(this.atomicSubscribers).forEach((t=>{const n=this.atomicSubscribers[t];if(!n)return;const s=Object.keys(n.criteria),r=Object.keys(e);0===Wh(s,r).length&&n.callback(e)}))}_getAutoGenId(){return this.connectionsCount+=1,`${Date.now()}_${this.connectionsCount}`}subscribe(e,t){const n=this._getAutoGenId();if(!this.messagingServiceSubscriptionID){this.messagingServiceSubscriptionID=n;const e={matcher:this.matcher,criteria:this.criteria},t=sf.subscribe(e,this._handleAtomicMessage.bind(this),void 0,n);this.messagingServiceSubscriptionID=t||n,this.connected=!0}return this.atomicSubscribers[n]={criteria:e,callback:t},n}unsubscribe(e){delete this.atomicSubscribers[e],0===Object.keys(this.atomicSubscribers).length&&(this.connected=!1,this.messagingServiceSubscriptionID&&(sf.unsubscribe(this.messagingServiceSubscriptionID),this.messagingServiceSubscriptionID=""))}};const qh=new class{constructor(){this.subscriptions={}}getOrCreateSubscription(e){if(!this.subscriptions[e]){const t={caseId:e};this.subscriptions[e]=new Hh("CASE",t)}return this.subscriptions[e]}};const zh=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 getContextPath(e){return e.includes("workarea")?e:Uy(`${e}/workarea`)||""}static publishCaseValuesUpdate(e,t){const n=this.getContextPath(t.actionInContext);Object.entries(e.message).forEach((([e,t])=>{const s=this.transformReference(e),{pageReference:r,propertyName:a}=this.extractReferenceParts(s);e.match(/\.\w+\[\d+\]\.\w+/)&&vI.executeStateMachine(n,s,t,!0,{skipStateUpdate:!0});BC([{type:Xs,payload:{reference:s,value:t,context:n}},{type:er,payload:{reference:s,value:t,context:n,pageReference:r,propertyName:a}}])}))}},{RESOURCE_TYPES:Yh}=Fs;const Kh=class{static openCase(e,t,n,s={}){const r={insKey:e,acTargetName:n,actionMgrID:Dg.getNextActionMgrId(),context:t,...s},a=pr;s&&s.channelName?r.headers={[js.X_ORIGIN_CHANNEL]:s.channelName}:PA.isWSSPortal()&&(r.headers={[js.X_ORIGIN_CHANNEL]:"WSS"});const{promise:o}=Dg.actionManagerPromise(a,r.actionMgrID);return BC({type:a,payload:r}),o}static openAssignment(e,t,n,s={}){const r={assignmentID:e,vcName:n,doDeleteCaseSummary:!0,actionMgrID:Dg.getNextActionMgrId(),context:t,...s},a=Ir;s&&s.channelName?r.headers={[js.X_ORIGIN_CHANNEL]:s.channelName}:PA.isWSSPortal()&&(r.headers={[js.X_ORIGIN_CHANNEL]:"WSS"});const{promise:o}=Dg.actionManagerPromise(a,r.actionMgrID);return BC({type:a,payload:{...r}}),o}static createCase(e,t,n,s={}){const r=dr,a={class:e,acTargetName:n,actionMgrID:Dg.getNextActionMgrId(),context:t,...s};s&&s.channelName?a.headers={[js.X_ORIGIN_CHANNEL]:s.channelName}:PA.isWSSPortal()&&(a.headers={[js.X_ORIGIN_CHANNEL]:"WSS"});const{promise:o}=Dg.actionManagerPromise(r,a.actionMgrID);return BC({type:r,payload:{...a}}),o}static getNextWork(e,t,n={}){const s=Ir,r={isGetNextWork:!0,vcName:t,doDeleteCaseSummary:!0,actionMgrID:Dg.getNextActionMgrId(),context:e,...n},{promise:a}=Dg.actionManagerPromise(s,r.actionMgrID);return BC({type:s,payload:{...r}}),a}static getOpenedCaseItems(e){const t=[],n=yy(e);if(n){const{items:s={}}=n,r=Object.keys(s),a=xy(e);r.forEach((n=>{if(s[n]&&(s[n].resourceType===Yh.CASE||s[n].resourceType===Yh.ASSIGNMENT||s[n].resourceType===Yh.OBJECT)){const{key:r="",context:o}=s[n],i=s[n],c=r.substring(r.indexOf(" ")+1),l=HC(".caseTypeID",js.CASE_INFO.CASE_INFO,o),u=a===n;t.push({...i,key:r,workID:r,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:s,reqType:r}=i_(Yr,n),a={},o=Bs.getRemoteHeaderFromSourceClass(t??"");return o&&(a.RemoteSystemID=o),Wd(s,{method:r,headers:a})};static getCaseBulkActions=async e=>{const{restApi:t,reqType:n}=i_("getBulkActions"),s=e.map((e=>({ID:e}))),r=s.length,a=r/5,o={},i=[];for(let e=0;e<r;e+=a)o.cases=s.slice(e,e+a),o.cases.length&&i.push(Wd(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:s}=i_("getCaseBulkActions",t),r=await Wd(n,{method:s});let a=[];return r.data?.availableActions?.length&&(a=r.data.availableActions),a};static getAssignmentBulkActions=async e=>{const{restApi:t,reqType:n}=i_("getAssignmentBulkActions"),s={assignments:e.map((e=>({ID:e})))},r=await Wd(t,{method:n,body:s});return r.data?.availableActions??[]}};class Qh{static CLOSE_CONTAINER_ITEM_EVENT=Fs.PUB_SUB_EVENTS.CONTAINER_EVENTS.CLOSE_CONTAINER_ITEM;static objectRedirectionSubIds={};static truncateNamespace(e){let t=e;return!Ls.isNamespaceEnabled()&&e&&e.includes("__")&&(t=e.substring(e.indexOf("__")+2)),t}static handleOpenObject(e){const{ObjectID:t}=e;let n;({ActionName:n}=e),n=this.truncateNamespace(n);const s=Ng.getComponentCache("lastActionID")||"";if("string"==typeof s&&s?.toLowerCase()!==n?.toLowerCase())return;let r=!1;const a=xy("app/modal");a&&(r=Cy("app/modal",a)?.isMinimizable??!1),!a||r?Kh.openCase(t,js.APP.APP,js.PRIMARY,{isAutoRedirection:!0}):fd.subscribe(this.CLOSE_CONTAINER_ITEM_EVENT,(e=>{e?.containerItemID===a&&(fd.unsubscribe(this.CLOSE_CONTAINER_ITEM_EVENT,"closeContainerItemForRedirection"),Kh.openCase(t,js.APP.APP,js.PRIMARY,{isAutoRedirection:!0}))}),"closeContainerItemForRedirection",!0)}static handleRefreshObject(e){Kh.openCase(e,js.APP.APP,js.PRIMARY,{forceRefresh:!0})}static handleObjectRedirection(e,t){const{message:n,filter:s}=e,{caseId:r,currUserID:a}=t;if(s?.criteria?.CurrentObjectID!==r||s?.criteria?.UserID?.toLowerCase()!==a?.toLowerCase())return;const{RedirectionType:o}=n||{};switch(o){case"OpenObject":this.handleOpenObject(n);break;case"RefreshObject":this.handleRefreshObject(r)}}static subscribeToRedirection(e){const t=PA.getOperatorIdentifier()||"",n={matcher:"REDIRECTION",criteria:{CurrentObjectID:e,UserID:t?.toLowerCase()}},s=sf.subscribe(n,(n=>{this.handleObjectRedirection(n,{caseId:e,currUserID:t})}));this.objectRedirectionSubIds[e]=s}static unsubscribeToRedirection(e){sf.unsubscribe(this.objectRedirectionSubIds[e]),delete this.objectRedirectionSubIds[e]}static subscribeToEvent(e,t){let n=null;if(e===js.PUB_SUB_EVENTS.CASE_EVENTS.CASE_LOAD?n=e=>{const{caseId:t}=e;this.objectRedirectionSubIds[t]||this.subscribeToRedirection(t)}:e===js.PUB_SUB_EVENTS.CASE_EVENTS.CASE_UNLOAD&&(n=e=>{const{caseId:t}=e;this.objectRedirectionSubIds[t]&&this.unsubscribeToRedirection(t)}),!n)throw new Error(`Unhandled eventKey: ${e}`);fd.subscribe(e,n,t)}static unsubscribeToEvent(e,t){fd.unsubscribe(e,t)}static subscribeToCaseEvents(){this.subscribeToEvent(js.PUB_SUB_EVENTS.CASE_EVENTS.CASE_LOAD,"case_open_for_redirection"),this.subscribeToEvent(js.PUB_SUB_EVENTS.CASE_EVENTS.CASE_UNLOAD,"case_close_for_redirection")}static unsubscribeToCaseEvents(){this.unsubscribeToEvent(js.PUB_SUB_EVENTS.CASE_EVENTS.CASE_LOAD,"case_open_for_redirection"),this.unsubscribeToEvent(js.PUB_SUB_EVENTS.CASE_EVENTS.CASE_UNLOAD,"case_close_for_redirection")}}const Jh=Qh,Xh=e=>{if("number"==typeof e)return Number.isFinite(e)?e:void 0;if("string"==typeof e&&""!==e.trim()){const t=Number(e);return Number.isFinite(t)?t:void 0}},Zh=()=>{const e=PA.getFeatureMap()?.pyMessageSequencingDelayInMS;if("number"!=typeof e&&"string"!=typeof e)return 100;const t=Number(e);return Number.isFinite(t)&&t>0&&t<=3e3?t:100};class ef{streams=new Map;arrivalCounter=0;enqueue(e,t,n){const{sequenceStreamId:s}=e,r={sequenceNumber:Xh(e.sequenceNumber),timestamp:Xh(e.timestamp),arrival:this.arrivalCounter,data:t};this.arrivalCounter+=1;const a=this.streams.get(s);if(a)return a.entries.push(r),void(a.entries.length>=20&&(console.warn(`SequencingBuffer: stream "${s}" reached 20 held messages; delivering now, later messages may arrive out of order`),this.flushStream(s)));this.streams.set(s,{entries:[r],dispatch:n,timer:setTimeout((()=>this.flushStream(s)),Zh())})}flushAll(){Array.from(this.streams.keys()).forEach((e=>this.flushStream(e)))}flushStream(e){const t=this.streams.get(e);t&&(clearTimeout(t.timer),this.streams.delete(e),ef.sortEntries(e,t.entries),t.entries.forEach((n=>{try{t.dispatch(n.data)}catch(t){console.error(`SequencingBuffer: delivering a message of stream "${e}" failed`,t)}})))}static sortEntries(e,t){t.every((e=>void 0!==e.sequenceNumber))?t.sort(ef.compareBySequenceNumber):t.every((e=>void 0!==e.timestamp))?t.sort(ef.compareByTimestamp):console.warn(`SequencingBuffer: stream "${e}" delivered in receiving order because ${ef.describeViolation(t)}`)}static describeViolation(e){return e.some((e=>void 0===e.sequenceNumber&&void 0===e.timestamp))?"a message has no ordering key":"messages mix sequenceNumber-only and timestamp-only ordering keys"}static compareBySequenceNumber(e,t){return e.sequenceNumber!==t.sequenceNumber?(e.sequenceNumber??0)-(t.sequenceNumber??0):e.timestamp!==t.timestamp?void 0===e.timestamp?1:void 0===t.timestamp?-1:e.timestamp-t.timestamp:e.arrival-t.arrival}static compareByTimestamp(e,t){return e.timestamp!==t.timestamp?(e.timestamp??0)-(t.timestamp??0):e.arrival-t.arrival}}const tf=new ef;class nf{static subscribers={};static connectionsCount=0;static webSocket=null;static connectionConfig=null;static inProgressSubscriptions=[];static inProgressMessages=[];static isServiceAlive=null;static serviceAliveHandler=null;static userPresence=new wh;static refreshB2SOffset=10;static agentSubscribeIdMap=new Map;static filterKeyToSubscriberIdMap=new Map;static get offlineEnabled(){return"undefined"!=typeof navigator&&(navigator.userAgent||"").includes("pxUsesOffline")}static isAuthenticated=!1;static initConnection(e){if(!e)return;const{messagingService:t}=e;if(!t||t&&t.length<=6)return;const n=hg.b2sJWT;if(!n||n.length<4)return;this.webSocket&&(tf.flushAll(),this.webSocket.close(),this.cleanSocketListeners());const s=t.endsWith("/")?t+"ws":t+"/ws";try{const e=new WebSocket(`${s}`);this.webSocket=e,this.boundHandleOnOpen=this.handleOnOpen.bind(this),this.boundHandleOnMessage=this.handleOnMessage.bind(this),this.boundHandleOnError=this.handleOnError.bind(this),this.boundHandleOnClose=this.handleOnClose.bind(this),e.addEventListener("open",this.boundHandleOnOpen),e.addEventListener("message",this.boundHandleOnMessage),e.addEventListener("error",this.boundHandleOnError),e.addEventListener("close",this.boundHandleOnClose)}catch(e){console.log(e)}}static handleOnError(e){this.getTokenExpiryTime()<=0&&(clearInterval(this.reInitInterval),this.reInitInterval=void 0,this.isAuthenticated=!1),console.error("web socket error - readyState:",this.webSocket?.readyState,"| isTrusted:",e?.isTrusted)}static handleOnClose(e){tf.flushAll(),null!==this.serviceAliveHandler&&(clearTimeout(this.serviceAliveHandler),this.serviceAliveHandler=null),this.isAuthenticated=!1,console.debug("web socket closed - code:",e?.code,"| wasClean:",e?.wasClean),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=hg.b2sJWT;if(!e||e.length<4)return;this.publishMessage({token:e})}}static unsubscribeAgentMessageCaseValues(e){if(e.assignmentID){const t=nf.agentSubscribeIdMap.get(e.assignmentID);nf.unsubscribe(t??""),nf.agentSubscribeIdMap.delete(e.assignmentID)}}static subscribeAgentMessageCaseValues(e){const t={matcher:"COACH_UPDATE",criteria:{caseId:e.caseKey,assignmentId:e.assignmentID}},n=nf.subscribe(t,(t=>{zh.publishCaseValuesUpdate(t,e)}));nf.agentSubscribeIdMap.set(e.assignmentID,n)}static handleOnMessage(e){if(null!==e&&"ALIVE"===e.data)null===this.isServiceAlive&&this.checkLiveliness(js.PRIORITY.PING),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}"}`),(e=>!!e?.filter)(t))"string"==typeof t.sequencing?.sequenceStreamId&&""!==t.sequencing.sequenceStreamId?tf.enqueue(t.sequencing,t,(e=>this.dispatchMessage(e,!0))):(t.sequencing&&console.warn("Message has a sequencing block without a usable sequenceStreamId; delivering it without ordering"),this.dispatchMessage(t));else if(t?.tokenExpiryTime){fd.subscribe(js.PUB_SUB_EVENTS.ASSIGNMENT_EVENTS.ASSIGNMENT_LOAD,nf.subscribeAgentMessageCaseValues),fd.subscribe(js.PUB_SUB_EVENTS.ASSIGNMENT_EVENTS.ASSIGNMENT_UNLOAD,nf.unsubscribeAgentMessageCaseValues),this.isAuthenticated=!0,this.setTokenExpiryTime({tokenExpiryTime:t.tokenExpiryTime});const e=1e3*(this.getTokenExpiryTime()-this.refreshB2SOffset);setTimeout((()=>this.refreshB2STokenReInit()),e),this.inProgressSubscriptions.forEach((({messageSubscriber:e,id:t})=>{this.subscribeToSocket(e,t)})),this.inProgressSubscriptions=[],this.inProgressMessages.forEach((e=>{this.publishMessage(e)})),this.inProgressMessages=[]}else console.error("filter missing from received data from messaging service",e.data)}}static dispatchMessage(e,t=!1){const{matcher:n,criteria:s}=e.filter;delete s.environmentID,s.productionLevel&&delete s.productionLevel,this.dispatchToSubscribers(n,s,e,t)}static dispatchToSubscribers(e,t,n,s=!1){Object.keys(this.subscribers).forEach((r=>{const a=this.subscribers[r];if(a?.filter&&a.filter.matcher===e&&rS.isEqual(a.filter.criteria,t)){if(!s)return void a.messageHandler(n);try{a.messageHandler(n)}catch(e){console.error(`Subscriber "${r}" failed while handling a sequenced message`,e)}}}))}static reInitialization(e){this.reInitInterval||(Object.keys(this.subscribers).forEach((e=>{this.unsubscribe(e,!0)})),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)}),5500))}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.boundHandleOnOpen),this.webSocket.removeEventListener("message",this.boundHandleOnMessage),this.webSocket.removeEventListener("error",this.boundHandleOnError),this.webSocket.removeEventListener("close",this.boundHandleOnClose))}static disconnect(){null!==this.webSocket&&(this.cleanSocketListeners(),tf.flushAll(),this.webSocket.close(),this.webSocket=null)}static getFilterKey(e){return`${e.matcher}:${JSON.stringify(e.criteria)}`}static findExistingSubscriberId(e){return this.filterKeyToSubscriberIdMap.get(this.getFilterKey(e))}static subscribe(e,t,n,s){this.connectionsCount+=1;const r=s||`${Date.now()}_${this.connectionsCount}`;if("COACH_UPDATE"===e.matcher){const t=this.findExistingSubscriberId(e);if(t)return t}const a=new xh(e,t,n);return null!==this.webSocket&&1===this.webSocket.readyState&&this.isAuthenticated?(this.subscribeToSocket(a,r),r):(this.inProgressSubscriptions.push({messageSubscriber:a,id:r}),e&&this.filterKeyToSubscriberIdMap.set(this.getFilterKey(e),r),this.offlineEnabled&&(this.subscribers[r]=a),null===this.webSocket&&this.initConnection(this.connectionConfig),r)}static subscribeToSocket(e,t){this.subscribers[t]=e,e.filter&&this.filterKeyToSubscriberIdMap.set(this.getFilterKey(e.filter),t);if(Object.keys(this.subscribers).filter((t=>this.subscribers[t]===e)).length>1)return;const n={filter:e.filter,subscribe:{id:t}};this.webSocket?.send(JSON.stringify(n))}static unsubscribe(e,t){if(this.subscribers[e]){if(!t){const t=this.subscribers[e].filter;t&&this.filterKeyToSubscriberIdMap.delete(this.getFilterKey(t)),delete this.subscribers[e]}const n={unsubscribe:{id:e}};null!==this.webSocket&&1===this.webSocket.readyState&&this.webSocket.send(JSON.stringify(n))}this.offlineEnabled&&!t&&this.removeFromInProgressSubscriptions(e)}static removeFromInProgressSubscriptions(e){const t=this.inProgressSubscriptions.findIndex((t=>t.id===e));if(-1!==t){const e=this.inProgressSubscriptions[t].messageSubscriber.filter;e&&this.filterKeyToSubscriberIdMap.delete(this.getFilterKey(e)),this.inProgressSubscriptions.splice(t,1)}}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 dispatchLocalMessage(e){const{matcher:t,criteria:n,message:s={}}=e,{environmentID:r,productionLevel:a,...o}=n,i={msgId:`local_${Date.now()}`,filter:{matcher:t,criteria:o},message:s};this.dispatchToSubscribers(t,o,i)}static getCaseSubscription=e=>qh.getOrCreateSubscription(e);static initObjectRedirectionSubscription=()=>Jh.subscribeToCaseEvents();static refreshB2STokenReInit=async()=>{if(vh()){const e={body:{B2SToken:hg.b2sJWT}};tg("refreshB2S",e).then((e=>{const{newB2SToken:t}=e.data;t&&t.length>30?(hg.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}`)}))}else if(!sg("refreshB2S")){ng("/uas/api/v1/isolations/token/websocket-ticket",{method:"GET",withoutDefaultHeaders:!1},"").then((e=>{const{token:t}=e.data;t&&(hg.b2sJWT=t,this.setTokenExpiryTime({tokenExpiryTime:Math.round(Date.now()/1e3)+60}),this.webSocket?.close())})).catch((e=>{console.error(`websocket-ticket: 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 sf=nf;const rf=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:s}=e,r=n*s;let a=r-s;for(;a<r;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:s}=t,r=n*s;let a=0;for(let t=r-s+1-1;t<r;t+=1)this.records[t]=e[a],a+=1;if(e.length<s){const t=(n-1)*s+e.length;this.setMaxRecordsCount(t)}}else e||(e=[]),Array.isArray(this.records)&&Array.isArray(e)&&(this.records=XC(this.records,e,{isArrayDeepMerge:!1})),this.setMaxRecordsCount(this.records.length)}setMaxRecordsCount(e){this.maxRecords=e}getMaxRecordsCount(){return this.maxRecords}};const af=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 Map}getDataViewParameters(e,t){if(!e||!t)return e;if(!t.parameters)return{};const n=Array.isArray(t.parameters)?t.parameters:[t.parameters],s=new Set(n.map((e=>e.name))),r={};return Object.keys(e).forEach((t=>{s.has(t)&&(r[t]=e[t])})),r}resolveParameterValue(e,t,n,s,r){return rS.resolveParameterValue(e,t,n,s,r)}formatParameterValue(e,t,n,s,r){return rS.formatParameterValue(e,t,n,s,r)}resolveAndFormatParameters(e,t,n,s,r){return rS.resolveAndFormatParameters(e,t,n,s,r)}getData(e,t,n,s){const r=this.generateHash(e,t,s);if(this.dataStore[e]&&this.dataStore[e][r]){const t=this.dataStore[e][r];return t.isDirty?[]:t.getRecords(n)}return[]}async getDataAsync(e,t,n={},s,r,a={}){const o=yC(e),i=this.getDataViewParameters(n,o);a.purgeDataPageCache&&(this.dataStore[e]={},this._removeDataStoreMetaEntry(e));const c={skipClearErrorMessages:!0,...a};if(!this.isCacheable(e,r)||a.invalidateCache){const n=await this.fetchData(e,i,s,r,t,c);return{...n.data,data:this.isCacheable(e,r)?this.mergeDataStore(e,i,s,r,n):n.data?.data??[],pageNumber:n?.data?.pageNumber,pageSize:n?.data?.pageSize,queryStats:n?.data?.queryStats,status:n?.status}}const l=this.getData(e,i,s,r);if(l.length>0)return Promise.resolve({data:l});const u=await this.fetchData(e,i,s,r,t,c);return{...u.data,data:this.mergeDataStore(e,i,s,r,u),pageNumber:u?.data?.pageNumber,pageSize:u?.data?.pageSize,queryStats:u?.data?.queryStats,status:u?.status}}async getPageDataAsync(e,t,n={},s={}){const r=this.generateHash(e,n,null);if(s.purgeDataPageCache&&(this.dataStore[e]={},this._removeDataStoreMetaEntry(e)),this.isCacheable(e)&&this.dataStore[e]&&this.dataStore[e][r]){if(!s?.invalidateCache)return Promise.resolve(this.dataStore[e][r]);delete this.dataStore[e][r],this._removeDataStoreMetaEntry(e,n,r)}const{restApi:a,reqType:o}=i_(js.GET_PAGE_DATA,{dataViewName:e,dataViewParameters:encodeURIComponent(JSON.stringify(n))}),i={method:o,...s.skipClearErrorMessages&&{skipClearErrorMessages:s.skipClearErrorMessages}};if(s.enableStreaming){const e=s.streamOptions||{};Object.assign(i,{responseType:"stream",adapter:"fetch",headers:{Accept:"text/event-stream"},...e})}const c=a&&n&&0===Object.keys(n).length?a.split("?")[0]:a;return Wd(c,i,t).then((t=>(this.isCacheable(e)&&(this.dataStore[e]={...this.dataStore[e],[r]:t.data},this._addDataStoreMetaEntry(e,n,r)),s.enableStreaming?t:t.data)))}subscribeToDataPageUpdates(e,t,n,s={}){if(!e||!t||!n)return!1;const r=this.generateHash(n,s,null);this.dataPageSubscribers[n]??={};const a=this.dataPageSubscribers[n];a[r]??={};const o=a[r];return this.subscribeToMessageService(n,e),!o[e]&&(o[e]??=t,!0)}unsubscribeToDataPageUpdates(e,t,n={}){if(!e||!t)return!1;const s=this.generateHash(t,n,null);delete this.dataPageSubscribers[t]?.[s]?.[e];const r=this.subscribedDataPageNames.get(t)??0;return r<=1?(this.subscribedDataPageNames.delete(t),e&&sf.unsubscribe(e)):this.subscribedDataPageNames.set(t,r-1),!0}unsubscribeToDatapageUpdates(e,t,n={}){return this.unsubscribeToDataPageUpdates(e,t??"",n)}_isDataPageCached(e,t){if(t&&rS.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],s=Ls.getDefaultQualifiedName("pxResults");Object.keys(n).forEach((n=>{if(this.dataStore[t][n]){this.dataStore[t][n].mergeRecords(e[t][n][s])}else{const r=new rf;this.dataStore[t][n]=r,r.mergeRecords(e[t][n][s]||[])}}))}))}_addDataStoreMetaEntry(e,t,n){const s=this.generateHash(e,t,null);this.dataStoreMeta[e]??={};const r=this.dataStoreMeta[e];r[s]??=[];const a=r[s];a.includes(n)||a.push(n)}_removeDataStoreMetaEntry(e,t,n){if(!e||t||n||(this.dataStoreMeta[e]={}),e&&t&&n){const s=this.generateHash(e,t,null);this.dataStoreMeta[e][s]=this.dataStoreMeta[e][s].filter((e=>e!==n))}}mergeDataStore(e,t,n,s,r){const a=this.generateHash(e,t,s),o=r?.data?.data;if(!o||0===o.length)return[];this.dataStore[e]||(this.dataStore[e]={}),this.dataStore[e][a]||(this.dataStore[e][a]=new rf);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_")||e.startsWith(Ls.getDefaultQualifiedName("D_"))||e.startsWith(Ls.getDefaultQualifiedName("Declare_"))}subscribeToUpdate(e,t,n,s,r,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]=r),this.subscribeToCascadeUpdates(e,t,n,s,a)}unsubscribe(e,t,n,s,r){delete this.subscribers[e]?.callback?.[r],t&&t.length>0&&UC.unRegisterFields(n,s,t,r)}handleMessage(e){const{msgId:t,message:n}=e,{datapage:s,parameters:r=""}=n,a=this.subscribers[s];this.markDataInstanceDirty(s,""===r?null:JSON.parse(r)),t&&this._executeDataPageSubscriptions(e),!t&&a?.callback&&Object.keys(a.callback).forEach((t=>{a.callback?.[t](e.message)}))}markDataInstanceDirty(e,t){let n,s;if((!t||(n=this.generateHash(e,t,null),s=this.dataStoreMeta[e]?.[n],s?.push(this.generateHash(e,null)),s))&&this.dataStore[e]){Object.keys(this.dataStore[e]).filter((e=>!t||!s||s.includes(e))).forEach((t=>{this.dataStore[e][t].isDirty=!0}))}}_executeDataPageSubscriptions(e){const{message:t}=e,{datapage:n,parameters:s}=t,r=s?JSON.parse(s):null;if(this.dataPageSubscribers[n])if(r){const t=[];t.push(this.generateHash(n,r,null)),t.push(this.generateHash(n,null,null)),t.forEach((t=>{const s=this.dataPageSubscribers[n]?.[t]??{};Object.keys(s).forEach((t=>{s[t](e.message)}))}))}else{const t=this.dataPageSubscribers[n];Object.keys(t).forEach((n=>{const s=t[n];Object.keys(s).forEach((s=>{t[n][s](e.message)}))}))}}isPerInteraction(e){const t=yC(e);return!t||"reloadOncePerInteraction"===t.refreshStrategy?.type}disableCache(e){this.isCacheEnabled=!e}generateHash(e,t,n){const s=yC(e);let r=[];s||(r=Object.keys(t||{}).map((e=>({name:e}))));const a=s?.parameters||r;let o="",i=e;const c=[];return Array.isArray(a)&&a.forEach((e=>{t?.[e.name]?c.push(t[e.name]):c.push(e.defaultValue??js.NULL_STRING)})),n&&c.push(JSON.stringify(n)),c.join(js.HASH_DELIMITER)&&(o=rS.getHashedString(c.join(js.HASH_DELIMITER)),i=e+js.UNDERSCORE_STRING+o),i}async fetchData(e,t,n,s,r,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),s&&(l.query=s),Ch.getData(e,l,r,c)}handleCascadeUpdate(){const{dataPageName:e,scope:t}=this;t.handleMessage({message:{datapage:e,parameters:""}})}subscribeToCascadeUpdates(e,t,n,s,r){t&&t.length>0&&UC.registerFields(n,s,t,this.handleCascadeUpdate.bind({dataPageName:e,scope:this}),r)}subscribeToMessageService(e,t){if(e&&this.subscribedDataPageNames.has(e)){const t=this.subscribedDataPageNames.get(e)??0;return void this.subscribedDataPageNames.set(e,t+1)}const n={matcher:"DATAPAGE_UPDATED",criteria:{datapage:e}};sf.subscribe(n,this.handleMessage.bind(this),void 0,t),this.subscribedDataPageNames.set(e,1)}isCacheable(e,t){return!(this.isPerInteraction(e)||!this.isCacheEnabled)&&!(t&&Object.keys(t).length>1)}};const of=class{constructor(e,t,n,s,r=100,a=500){this.finalDataViewCall=e,this.combiner=t,this.comparator=n,this.separator=s,this.maxtime=r,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,s,r=this.findCombinableDataViewCall(e);return n=new Promise((e=>{s=e})),r&&!r.dataViewCallMap[t]?(this.combiner(r,e),r.dataViewCallMap[t]={promise:n,resolve:s}):r?n=r.dataViewCallMap[t].promise:(r={...e,dataViewCallMap:{[t]:{promise:n,resolve:s}}},this.groupedDataViewArray.push({...e,dataViewCallMap:{[t]:{promise:n,resolve:s}}})),Object.keys(r.dataViewCallMap).length===this.maxsize?this.dequeueDataViewCallOnSizeExceed(r):(clearTimeout(this.timeoutId),this.timeoutId=setTimeout((()=>this.dequeueAllDataViewCalls()),this.maxtime)),n}};const cf=class{constructor(){this.bufferedDataQueues={}}getBufferedDataQueueForDataPage(e){return this.bufferedDataQueues[e]}addBufferedDataQueueForDataPage(e,t,n,s,r,a,o){return this.getBufferedDataQueueForDataPage(e)||(this.bufferedDataQueues[e]=new of(t,n,r,s,a,o)),this.bufferedDataQueues[e]}},lf=(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,uf=e=>e.map((e=>e.field)),df=(e,t)=>{const n=(e.query?.filter).filterConditions,s=(t.query?.filter).filterConditions;let r=(t.query?.filter).logic;const a=Object.keys(n).length;lf(n,s)?("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(s.F0.rhs?.value)):(Object.keys(s).forEach(((e,t)=>{const o=`F${a+t}`;n[o]=s[e],r=r.replace(e,o)})),(e.query?.filter).logic+=` OR ${r}`);const o=uf(e.query?.select);uf(t.query?.select).forEach((t=>{o.includes(t)||(e.query?.select).push({field:t})}))},pf=(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]:!rS.isEqual(e.dataViewParameters?.[n],t.dataViewParameters?.[n]))))(e,t)||((e,t)=>!e.dataViewParameters&&!t.dataViewParameters)(e,t)),gf=(e,t)=>{const{data:n}=t,{dataViewCallMap:s,filterDataOnClient:r}=e;Object.keys(s).forEach((e=>{s[e].resolve({data:r(e,n)})}))},hf=e=>({combiner:df,comparator:pf,separator:gf,...e}),ff=(e,t)=>{if("undefined"!=typeof window)try{window.sessionStorage.setItem(e,t)}catch(e){}},mf=(e,t="",n="IS_NULL")=>({comparator:n,lhs:{field:e},...t&&{rhs:{value:t}}}),If=e=>null!=e&&"object"==typeof e&&!("then"in e);class Ef{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=new Map,this.keyCache=new Map,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,s)=>{const r=[...e.columns.map((e=>e.value)),...Object.entries(e.parameters).map((([e,t])=>`${e}+${t}`)),e.matchPosition,e.maxResultsDisplay].join(js.HASH_DELIMITER),a=rS.getHashedString(r),o=`${e.dataSource}_${a}`,i=`__dataviewmetadata__${e.dataSource}`,c=Ch.getAppCacheKey(i);if("undefined"!=typeof window&&window.sessionStorage.getItem(c)){const r=JSON.parse(`${window.sessionStorage.getItem(c)}`);if(t&&Ef.searchResultsCache?.[t]?.[o])n(Ef.searchResultsCache[t][o]);else if("form"!==e.cacheLifeSpan&&Ef.searchResultsCache?.persisted?.[o])n(Ef.searchResultsCache.persisted[o]);else{const a=new Ef(e,t);JSON.stringify(r.associationFilter)===JSON.stringify(e.associationFilter)?(a.dataSourceMetaData=r.dataSourceMetaData,a.isQueryable=r.isQueryable,a.isInitialised=r.isInitialised,a.associationFilter=r.associationFilter,Ef.initializeCache(t,e,o,a),n(a)):(a.associationFilter=e.associationFilter,a.propertyFilter=e.propertyFilter,a.fetchMetaData(t).then((s=>{ff(c,JSON.stringify({isQueryable:s.data.isQueryable,dataSourceMetaData:s.data,isInitialised:!0,associationFilter:e.associationFilter})),a.isQueryable=s.data.isQueryable,a.dataSourceMetaData=s.data,a.isInitialised=!0,Ef.initializeCache(t,e,o,a),n(a)})).catch((e=>{a.isInitialised=!1,s(e)})))}}else if(e.deferDatasource&&yC(e.dataSource)){const s=new Ef(e,t),r=yC(e.dataSource);s.isQueryable=!!r?.isQueryable,s.isInitialised=!0,s.dataSourceMetaData=r,ff(c,JSON.stringify({isQueryable:r?.isQueryable,dataSourceMetaData:r,isInitialised:!0})),s.context=t,Ef.initializeCache(t,e,o,s),n(s)}else{const r=new Ef(e,t);r.associationFilter=e.associationFilter,r.propertyFilter=e.propertyFilter,r.fetchMetaData(t).then((s=>{ff(c,JSON.stringify({isQueryable:s.data.isQueryable,dataSourceMetaData:s.data,isInitialised:!0,associationFilter:e.associationFilter})),r.isQueryable=s.data.isQueryable,r.dataSourceMetaData=s.data,r.isInitialised=!0,Ef.initializeCache(t,e,o,r),n(r)})).catch((e=>{r.isInitialised=!1,s(e)}))}}))}static bufferedDataView=new cf;registerForBufferedCall(e){return this.isQueryable&&(this.initializeBufferCallsForDataPage(hf(e)),this.bufferInitialized=!0),this}static clearContextedCache(e){delete Ef.searchResultsCache[e]}static initializeCache(e,t,n,s){e&&"form"===t.cacheLifeSpan?.toLowerCase()?(void 0===Ef.searchResultsCache[e]&&(Ef.searchResultsCache[e]={}),Ef.searchResultsCache[e][n]=s):(void 0===Ef.searchResultsCache.persisted&&(Ef.searchResultsCache.persisted={}),Ef.searchResultsCache.persisted[n]=s)}fetchMetaData(e){return Ch.getDataViewMetadata(this.dataSource,e,this.associationFilter,this.propertyFilter)}initializeBufferCallsForDataPage(e){Ef.bufferedDataView.addBufferedDataQueueForDataPage(this.dataSource,(e=>af.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)}}buildQueryWithKeys=(e,t,n)=>{const s=this.buildSelect(n),r=((e=[],t={},n="")=>{if(!e.length||!Object.keys(t))return;const s={};return e.forEach(((e,n)=>{const r=t[e];let a;a=r?mf(e,r,"EQ"):mf(e),s[`T${n+1}`]=a})),{logic:Object.keys(s).join(` ${n} `),filterConditions:s}})(e,t,"AND");return{select:s,...r&&{filter:r},...Ch.isDistinctResultsOnly(s)&&{distinctResultsOnly:"true"}}};buildSchemaForQueryableDPWithKeys=(e,t,n)=>({dataViewParameters:this.parameters,query:this.buildQueryWithKeys(e,t,n),paging:this.buildPageOptions()});getRowDataByKeys=async(e,t,n)=>this.memoizedGetRowDataByKeys(e,t,n);buildKeyCacheKey(e,t,n){const s=e.map((e=>[e,t[e]??""])),r=n?.columns?.map((e=>e.value));return JSON.stringify({filterEntries:s,columns:r,pageNumber:this.pageNumber})}memoizedGetRowDataByKeys(e,t,n){const s=this.buildKeyCacheKey(e,t,n);(n?.invalidateCache||n?.purgeDataPageCache)&&this.keyCache.delete(s);const r=this.keyCache.get(s);if(r)return r;const a=this.isQueryable?this.buildSchemaForQueryableDPWithKeys(e,t,n):this.buildSchemaForNonQueryableDP(),o=af.getDataAsync(this.dataSource,this.context,a.dataViewParameters,this.isQueryable?a.paging:void 0,this.isQueryable?a.query:void 0,{...n}).catch((e=>(this.keyCache.delete(s),Promise.reject(e))));return this.keyCache.set(s,o),o}getData(e,t){if(this.isQueryable){if(this.bufferInitialized)try{const t=this.buildSchemaForQueryableBufferDP(e);return Ef.bufferedDataView.getBufferedDataQueueForDataPage(this.dataSource).queueDataViewCall(t,e)}catch{const n=this.buildSchemaForQueryableDP(e,t);return af.getDataAsync(this.dataSource,this.context,n.dataViewParameters,n.paging,n.query)}const n=this.buildSchemaForQueryableDP(e,t);return af.getDataAsync(this.dataSource,this.context,n.dataViewParameters,n.paging,n.query,{...t})}return this.fetchNonQueryableResults(e,t)}getCachedResult(e,t){if(this.enablePagination&&If(t)&&t.has(this.pageNumber))return t.get(this.pageNumber);const n=this.cache.get(e);return this.enablePagination||!n||If(n)?void 0:n}handleCacheError(e,t){if(this.enablePagination){const t=this.cache.get(e);t&&If(t)&&t.delete(this.pageNumber)}else this.cache.delete(e);return Promise.reject(t)}storeCacheResult(e,t){if(this.enablePagination){let n=this.cache.get(e);n&&If(n)||(n=new Map,this.cache.set(e,n)),n.set(this.pageNumber,t)}else this.cache.set(e,t)}isResultCached(e){if(!this.isInitialised||!this.isValidDatasource()||this.context&&!nS(this.context))return!1;const t=e.toLowerCase(),n=this.cache.get(t);return!!n&&(!this.enablePagination||If(n)&&n.has(this.pageNumber))}memoizedGetData(e,t){const n=e?.toLowerCase(),s=this.cache.get(n);if(this.isResultCached(e)&&s){const e=this.getCachedResult(n,s);if(e)return e}const r=this.getData(e,t).catch((e=>this.handleCacheError(n,e)));return this.storeCacheResult(n,r),r}fetchData(e,t=!1,n){return this.isValidDatasource()?this.context&&!nS(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=af.getDataAsync(this.dataSource,this.context,n.dataViewParameters,void 0,void 0,t),this.isNQDataFetchInProgress=!0,new Promise(((n,s)=>{this.fetchNQDataPromise?.then((s=>(this.nonQueryableData=[...s.data],this.fetchedNQData=!0,n({data:this.filterDataOnClient(e,this.nonQueryableData,t)})))).catch((e=>s(e))).finally((()=>{this.isNQDataFetchInProgress=!1,this.fetchNQDataPromise=null}))}))}return Promise.resolve(null)}filterDataOnClient(e,t,n){const s=(n?.columns??this.columns)?.filter((e=>e.useForSearch)).map((e=>e.value));return t.reduce(((t,r)=>{const a=s?.some((t=>{const s=Ef.resolveEmbeddedPath(t),a=rS.getIn(r,s);return null!=a&&this.positionMatches(`${a}`,e,n)}));return a&&t.push({...r}),t}),[])}static resolveEmbeddedPath(e){return e.startsWith("!P!")||e.startsWith("!PL!")?e.substring(e.lastIndexOf("!")+1).replace(/:/g,"."):e}positionMatches(e,t,n){const s=n?.ignoreCase??this.ignoreCase,r=s?e.toLowerCase():e,a=s?t.toLowerCase():t;switch(n?.matchPosition??this.matchPosition){case"start":return r.startsWith(a);case"contains":return r.includes(a);case"equals":return r===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 s={field:e.value};t.push(s)}})),t}buildFilters(e,t){const n=t?.matchPosition??this.matchPosition,s=t?.ignoreCase??this.ignoreCase,r={};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:s?"true":"false"},lhs:i,rhs:c,comparator:l};r[o]=u}}));const o=Object.keys(r).join(" OR ");return{filterConditions:r,logic:o}}buildQuery(e,t){const n=this.buildSelect(t);return e?{select:n,filter:this.buildFilters(e,t),...Ch.isDistinctResultsOnly(n)&&{distinctResultsOnly:"true"}}:{select:n,...Ch.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 yf=Ef;class Af{constructor(){this.refreshMap={},this.propChangeRefreshMap={}}static initializeRefreshCache(e,t,n,s,r){void 0===e[t]&&(e[t]={}),e[t][n]=[{uniqueHash:s,callback:r}]}registerForRefresh(e,t,n,s,r){n=rS.convertClipboardPageToPageRefNotation(n);const a=s.split("/").join(js.HASH_DELIMITER),o=rS.getHashedString(a);if("PROP_CHANGE"===e)if(this.propChangeRefreshMap?.[r]?.[n]){this.propChangeRefreshMap[r][n].some((e=>e.uniqueHash===o))||this.propChangeRefreshMap[r][n].push({uniqueHash:o,callback:t})}else Af.initializeRefreshCache(this.propChangeRefreshMap,r,n,o,t);else if(this.refreshMap?.[r]?.[`${e}-${n}`]){this.refreshMap[r][`${e}-${n}`].some((e=>e.uniqueHash===o))||this.refreshMap[r][`${e}-${n}`].push({uniqueHash:o,callback:t})}else Af.initializeRefreshCache(this.refreshMap,r,`${e}-${n}`,o,t)}triggerPropChangeRefresh(e,t){const n=this.propChangeRefreshMap?.[t];if(!n)return!1;const s=cS.getPropertyValue(js.CONTEXT_DATA_MODAL_VIEW.CONTEXT_DATA_MODAL_VIEW,e,t),{interestPage:r=""}=s||{},a=e=>rS.convertPageRefToClipboardPageNotation(e).replace(`${js.CASE_INFO?.CASE_INFO_CONTENT}${r}`,"");if(n[e]){const t=a(e);return n[e].forEach((e=>e.callback(t))),!0}const o=Zu.getContextReferences(t)?.get(e),i=o&&cS.resolveContextTreeNodeProps(o.props)||{},{contextPageRef:c}=i;if(c&&n[c]){const e=a(c);return n[c].forEach((t=>t.callback(e))),!0}for(const t of Object.keys(n)){let s;if(rS.segmentsMatch(t,e)?s=e:c&&rS.segmentsMatch(t,c)&&(s=c),s){const e=a(s);return n[t].forEach((t=>t.callback(e))),!0}}return!1}triggerRefreshForType(e,t,n){return"PROP_CHANGE"===e?this.triggerPropChangeRefresh(t,n):!!this.refreshMap?.[n]?.[`${e}-${t}`]&&(this.refreshMap[n][`${e}-${t}`].forEach((e=>e.callback())),!0)}deRegisterForRefresh(e){delete this.propChangeRefreshMap[e],delete this.refreshMap[e]}}const Cf=new Af;const Sf=class{static cleanCaches(e){UC.purgeCascadeFields(e),yh.removeContext(e),yf.clearContextedCache(e),fd.cleanContextSubscribers(e),MI(e),Zu.removeContextTreeNode(e),sf.clearContext(e),Cf.deRegisterForRefresh(e)}},_f="GET_DESCENDANTS",Nf={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",REFRESH_EXTERNAL_CASE_DATA:"refreshExternalCaseData"};const Tf=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]}},Df=e=>{fd.publish(js.PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_SUBMISSION,e)},Pf=e=>{fd.publish(js.PUB_SUB_EVENTS.CASE_EVENTS.END_OF_ASSIGNMENT_PROCESSING,e)},Of=e=>{fd.publish(js.PUB_SUB_EVENTS.CASE_EVENTS.CASE_OPENED,e),fd.publish(js.PUB_SUB_EVENTS.EVENT_PREVIEW_DISMISS,e)},Rf=e=>{fd.publish(js.PUB_SUB_EVENTS.CASE_EVENTS.CASE_EDIT_CLOSE,e)},bf=e=>{fd.publish(js.PUB_SUB_EVENTS.ASSIGNMENT_EVENTS.ASSIGNMENT_LOAD,e)},vf=e=>{fd.publish(js.PUB_SUB_EVENTS.ASSIGNMENT_EVENTS.ASSIGNMENT_UNLOAD,e)};const xf=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=[],s=t.context_data?.blocking_action_counter??0,r=t.context_data?.deferred_action_queue?[...t.context_data.deferred_action_queue]:[];let a=t.context_data?.is_deferred_action_in_progress??!1;if(s<=0){if(a)n.push({type:Cr,payload:{context:e,data:{context_data:{is_deferred_action_in_progress:!1}}}});else{if(!(r.length>0))return;{const t=r.shift();a=!a,n.push({type:Cr,payload:{context:e,data:{context_data:{deferred_action_queue:r,blocking_action_counter:s,is_deferred_action_in_progress:a}}}}),t&&n.push(t)}}BC(n)}}executeOrQueueDeferredAction(e){if(!e?.payload?.context)return Promise.reject(new Error("Action Context is Mandatory Field."));const t=$C(e?.payload?.context);if(t){const n=[],s=t.context_data?.blocking_action_counter??0,r=t.context_data?.deferred_action_queue?[...t.context_data.deferred_action_queue]:[];let a=t.context_data?.is_deferred_action_in_progress??!1;return r.length<=0&&!a&&(s<=0?(n.push(e),a=!a):r.push(e),n.unshift({type:Cr,payload:{context:e.payload.context,data:{context_data:{deferred_action_queue:r,blocking_action_counter:s,is_deferred_action_in_progress:a}}}}),BC(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=$C(e);return t&&!0===t.context_data?.is_deferred_action_in_progress?(BC({type:Cr,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 $C(e)?(BC({type:fa,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={...$C(e)};return t.context_data={...t.context_data},t&&t.context_data?.blocking_action_counter>0?(BC({type:fa,payload:{context:e,isInitiateBlockingAction:!1}}),t.context_data.blocking_action_counter-=1,this.schedulePendingActionOnCompletion(e,t),Promise.resolve()):Promise.reject(new Error(this.INVALID_CONTEXT_OPERATION))}cancelDeferredActionsOnError(e){if(!e)return;const t=$C(e);if(t){const n={...t};n.context_data={...n.context_data},n.context_data?.deferred_action_queue&&rS.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),BC({type:Cr,payload:{context:e,data:{...n}}}),Tg.disableLoadingIndicator({context:e})}}isDeferredActionInProgress(e){if(!e)return Promise.reject(new Error(this.MISSING_CONTEXT_PARAM));const t=$C(e);return!(!t||!0!==t.context_data?.is_deferred_action_in_progress)}},wf=(e,t)=>{const n={},s=qg.getLookUpDataPage(e),r=qg.getDataPageKeys(s);if(r)for(const e of r)n[e.keyName]=e.isAlternateKeyStorage?t[e.linkedField]:t[e.keyName];return{dataViewParameters:n,dataPageID:s,dataPageKeys:r}},Mf=(e,t)=>{const n=qg.getSavableDataPage(e),s=qg.getDataPageKeys(n);return s?.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:s}},Lf=e=>{fd.publish(Fs.PUB_SUB_EVENTS.EVENT_CANCEL,e)},Uf=(e,t,n)=>YI.shouldUseUnifiedHandling()||(e=>{if(e.includes(js.ACTIONAREA))return!0;const t=yA(e),n=xy(`${t}/${js.ACTIONAREA}`);return Boolean(n?.includes(js.ACTIONAREA))})(e)?hr:rE(t,n??!1),Ff=(e,t,n)=>{const{callbacks:s}=n;return n.callbacks=null,e(t,n).then((e=>{"cancel"===e?s?.cancel?.():s?.submit?.()}))},jf=(e,t,n)=>n||t!==js.ACTION?e.getValue(Fs.CASE_INFO.ACTIVE_ACTION_ID):e.getValue(Fs.CASE_INFO.ASSIGNMENTACTION_ID),Vf=(e,t)=>{t&&(e.remoteCaseMeta=t)};const kf=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(js.getProperty(Fs.CASE_INFO.CASE_INFO_ID))||e?.links?.open?.href?.split("/")?.[2];getSaveActionPayload=(e,t=!1,n=!1)=>{const s=e,r=s&&s.includes(js.MODAL),a=this.c11nEnv.getValue(Fs.CASE_INFO.CASE_INFO_ID),o=this.c11nEnv.getValue(Fs.CASE_INFO.ASSIGNMENT_ID),i=this.c11nEnv.getValue(Fs.CASE_INFO.ACTIVE_ACTION_ID)?this.c11nEnv.getValue(Fs.CASE_INFO.ACTIVE_ACTION_ID):this.c11nEnv.getValue(Fs.CASE_INFO.ASSIGNMENTACTION_ID),c=this.c11nEnv.getContainerName(),l=this.c11nEnv.getValue(Fs.CASE_INFO.CASE_TYPE_ID),u=t?void 0:GI(this.c11nEnv.getContextName()),d=this.c11nEnv.getValue("isProcessAction","isProcessAction");return dS.buildActionObject({context:s,containerItemID:e,assignmentID:o,actionID:i,caseID:a,containerName:c,caseType:l,isModalAction:r,isFormValid:u,isProcessAction:d,saveOnly:t,autosave:n},this.c11nEnv)};actionsApiPromise=(e,t,n=!0)=>{let s,r,a="";a=t&&null!==t.actionMgrID?t.actionMgrID||"":Dg.getNextActionMgrId();const o=new Promise(((e,t)=>{s=e,r=t}));if(!s||!r)throw new Error("resolveFn or rejectFn is not defined.");return Dg.register(a,o,s,r,e,t,n),{actionMgrID:a,promise:o}};showDataObjectCreateView(e,t=Fs.VIEW_NAMES.DATA_OBJECT_CREATE_VIEW){const n=dS.buildActionObject({viewName:t,className:e},this.c11nEnv),s=nr,{promise:r}=this.actionsApiPromise(s,n);return BC({type:s,payload:{...n,containerName:Fs.MODAL,skipSemanticUrl:!0,isCreateDataObject:!0}}),r}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(!cy(t)){return new Qg(this.c11nEnv).removeContainerItem({containerItemID:e,skipReleaseLockRequest:!0})}const n=Xr,s=dS.buildActionObject({containerItemID:e,context:t},this.c11nEnv),r=t&&t.includes(js.MODAL);BC({type:n,payload:{...s,isModalAction:r,isDataObject:!0,skipReleaseLockRequest:!0}});const{promise:a}=this.actionsApiPromise(n,s);return a.then((()=>{Lf({})}))}createDataObject(e){if(!e)return Promise.reject(new Error("containerItemID is required parameter"));const{data:t}=kC()?.getState()||{},n=t[e]?.dataInfo?.content?.classID;if(!n)return Promise.reject(new Error(js.DATA_CLASS_NOT_FOUND));if(mC(Fs.VIEW_NAMES.SUBSCRIPT_CREATE_VIEW)){const t=this.handleSubscript.call(this,e,this.c11nEnv);if(t)return t}const s=qg.getSavableDataPage(n),r=Ia,a=!!e&&e.includes(js.MODAL),o=dS.buildActionObject({containerItemID:e,dataPageID:s},this.c11nEnv),{promise:i}=this.actionsApiPromise(r,o);return BC({type:"CREATE_DATA_OBJECT",payload:{...o,isModalAction:a,isFormValid:GI(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=Ea,s=qg.getSavableDataPage(e),r=qg.getDataPageKeys(s),a={};if(r)for(const e of r)a[e.keyName]=e.isAlternateKeyStorage?t[e.linkedField]:t[e.keyName];const o=dS.buildActionObject({dataViewName:s,dataViewParameters:a},this.c11nEnv),{promise:i}=this.actionsApiPromise(n,o);return BC({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 s=ya,{dataPageID:r,dataViewParameters:a}=wf(e,t),o=dS.buildActionObject({dataLookUp:r,keyProperties:t,requestPayload:a,viewName:n.viewName||Fs.VIEW_NAMES.DATA_OBJECT_EDIT_VIEW,containerName:js.MODAL,readOnly:n.readOnly,actionName:n.actionName},this.c11nEnv),{promise:i}=this.actionsApiPromise(s,o);return BC({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}=kC()?.getState()||{},s=n[e]?.dataInfo?.content?.classID;if(!s)return Promise.reject(new Error(js.DATA_CLASS_NOT_FOUND));const{dataPageID:r,keys:a}=Mf(s,t),o=Aa,i=e&&e.includes(js.MODAL),c=dS.buildActionObject({containerItemID:e,dataPageID:r,key:a},this.c11nEnv),l=n[e]?.caseInfo?.headers?.etag,{promise:u}=this.actionsApiPromise(o,c);return BC({type:"UPDATE_DATA_OBJECT",payload:{...c,isModalAction:i,isFormValid:GI(e),etag:l}}),u}openDataObjectAction(e,t,n,s){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(!s)return Promise.reject(new Error(this.MSG_ACTION_NAME_REQUIRED));const r=Ca,{dataViewParameters:a,dataPageID:o,dataPageKeys:i}=wf(e,t),c=dS.buildActionObject({actionID:n,actionName:s,dataViewParameters:a,lookupDatapage:o,containerName:js.MODAL,dataViewPayload:i,context:this.c11nEnv.getContextName()},this.c11nEnv),{promise:l}=this.actionsApiPromise(r,c);return BC({type:r,payload:{...c}}),l}submitDataObjectAction(e,t,n,s){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}=kC()?.getState()||{},a=r[e]?.dataInfo?.content?.classID;if(!a)return Promise.reject(new Error(js.DATA_CLASS_NOT_FOUND));const o=s?.jsActionQueryParams,i=yA(e),c=Qy(i),l=Cy(c,i)||{},{resourceType:u="",key:d=""}=l,p=Sa,{dataPageID:g,keys:h}=Mf(a,t),f=dS.buildActionObject({containerItemID:e,actionID:n,resourceType:u,key:d,keys:h,savableDatapage:g,containerName:js.MODAL,context:e,jsActionQueryParams:o},this.c11nEnv);f.context=e;const m=r[e]?.caseInfo?.headers?.etag,{promise:I}=this.actionsApiPromise(p,f);return BC({type:p,payload:{...f,isFormValid:GI(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(e=Bs.getRemoteCaseClassBySourceClass(e)??e,window.pms?.plugins?.c11n?.createWork)return window.pms.plugins.c11n.createWork(e,Ls.getDefaultQualifiedName("pyStartCase"),t);const{dockable:n=!1}=t?.modalOptions||{};let s=t.theType?t.theType:(e=>{const t=YI.shouldUseUnifiedHandling();return YI.isExternalCaseType(e)?xa:YI.isExternalObject(e)?t?xa:"CREATE_EXTERNAL_OBJECT":t?dr:YI.isObjectCaseType(e)?"CREATE_OBJECT":dr})(e);const r=dS.buildActionObject({class:e,flowType:Ls.getDefaultQualifiedName("pyStartCase"),containerName:js.PRIMARY,openCaseViewAfterCreate:!0,...t,theType:s,modalOptions:{isDockable:n}},this.c11nEnv);Vf(r,t.remoteCaseMeta);const{promise:a}=this.actionsApiPromise(s,r);if(r.headers={...r.headers},t.channelName?r.headers[js.X_ORIGIN_CHANNEL]=t.channelName:PA.isWSSPortal()&&(r.headers[js.X_ORIGIN_CHANNEL]="WSS"),s=this.handleRemoteCaseForCreateWork(e,r,s),Id.getPreviewMode()){r.debugInfo={debugId:rS.generateUniqueID()};const e=wd.getCoreHeadersFromContext(r?.context||""),t=String(e?.debugInfo?.[js.COREHEADER_APP_DEBUG_ID]||"");t&&s!==dr&&(r.debugInfo={debugId:t})}return BC({type:s,payload:{...r}}),a}handleRemoteCaseForCreateWork(e,t,n){if(Bs.isRemoteCase(e)){const{RemoteClassName:n,RemoteSystemID:s,name:r}=Bs.getRemoteCase(e);if(t.className=e,t.class=n,Dg.setRemoteCaseHeaderByContext(t,s),Bs.isTraditionalRemoteCase(e)||Bs.isRemoteCaseVersionDifferent(e)){const s={className:e,name:r,action:Oa,remoteClassName:n};return Dg.setTraditionalRemoteCaseParams(t,s)}}return n}createCase(e,t={}){return this.createWork(e,{...t,theType:"CREATE_WORK"})}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=_r,s=dS.buildActionObject({dataViewID:e,dataViewParameters:t},this.c11nEnv),{promise:r}=this.actionsApiPromise(n,s);return BC({type:n,payload:{...s}}),r}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(),s=dS.buildActionObject({caseID:e,currentContext:n},this.c11nEnv),{promise:r}=this.actionsApiPromise("GET_DESCENDANTS",s),a=(o={...s,context:n},{type:_f,payload:o});var o;return BC(a),r}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(t=Bs.getRemoteCaseClassBySourceClass(t)??t,window.pms?.plugins?.c11n?.openWorkByHandle)return window.pms.plugins.c11n.openWorkByHandle(e,t);const s={insKey:e,acTargetName:n.targetContainer||js.PRIMARY,containerName:n.targetContainer||js.PRIMARY};let r=YI.shouldUseUnifiedHandling()||!YI.isObjectCaseType(t)?pr:"GET_OBJECT";const a=dS.buildActionObject(s,this.c11nEnv);Vf(a,n.remoteCaseMeta);const{promise:o}=this.actionsApiPromise(r,a);return a.headers={...a.headers},n.channelName?a.headers[js.X_ORIGIN_CHANNEL]=n.channelName:PA.isWSSPortal()&&(a.headers[js.X_ORIGIN_CHANNEL]="WSS"),a.className=t,Bs.isRemoteCase(t)&&(r=this.setRemoteCaseParamsForOpenCase(a,t,r,n.remoteCaseMeta)),Id.getPreviewMode()&&n.targetContainer!==js.WORKAREA&&(a.debugInfo={debugId:rS.generateUniqueID()}),BC({type:r,payload:{...n,...a}}),o}setRemoteCaseParamsForOpenCase(e,t,n,s={}){const{RemoteSystemID:r,RemoteClassName:a,name:o}=Bs.getRemoteCase(t);if(Dg.setRemoteCaseHeaderByContext(e,r),e.isRemoteCase=!0,e.remoteCaseClass=t,e.remoteCaseMeta=s,Bs.isTraditionalRemoteCase(t)||Bs.getRemoteAppPlatformVersion(r??"")){const n={className:t,name:o,action:ba,remoteClassName:a};return Dg.setTraditionalRemoteCaseParams(e,n)}return n}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(t=Bs.getRemoteCaseClassBySourceClass(t)??t,window.pms?.plugins?.c11n?.openAssignment)return window.pms.plugins.c11n.openAssignment(e,t);const s={assignmentID:e,doDeleteCaseSummary:!0,containerName:n.containerName,isActionFromToDoList:n.isActionFromToDoList,isChild:!1,...void 0!==n.renderInline&&{renderInline:n.renderInline},...void 0!==n.pageName&&{pageName:n.pageName}};n.isChild&&(s.containerName=js.PRIMARY,s.isChild=n.isChild);let r=kg;const a=dS.buildActionObject(s,this.c11nEnv);Vf(a,n.remoteCaseMeta);const{promise:o}=this.actionsApiPromise(r,a);if(a.headers=a.headers||{},n.channelName?a.headers[js.X_ORIGIN_CHANNEL]=n.channelName:PA.isWSSPortal()&&(a.headers[js.X_ORIGIN_CHANNEL]="WSS"),Bs.isRemoteCase(t)){const{RemoteClassName:e,RemoteSystemID:s,name:o}=Bs.getRemoteCase(t);if(Dg.setRemoteCaseHeaderByContext(a,s),a.remoteCaseMeta=n.remoteCaseMeta,Bs.isTraditionalRemoteCase(t)||Bs.getRemoteAppPlatformVersion(s??"")){const n={className:t,name:o,action:Ra,remoteClassName:e};r=Dg.setTraditionalRemoteCaseParams(a,n)}}a.className=t,a.activeItemCaseViewMode=this.c11nEnv.getValue("context_data.caseViewMode"),Id.getPreviewMode()&&![js.WORKAREA].includes(n.containerName)&&(a.debugInfo={debugId:rS.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 BC({type:r,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));e.endsWith(js.ACTIONAREA)&&(e=xy(e)||e);const n=Ly(e);let s=n;if(n?.includes(`/${js.WORKAREA}`)&&(s=n.substring(0,s?.lastIndexOf(`/${js.WORKAREA}`))),WI(n)){const e=[{type:"error",message:this.c11nEnv.getLocalizationService().getLocalizedMessage(this.MSG_ACTIVE_SUGGESTION_UNATTENDED)}];return id({messages:e,context:s,category:Fs.PAGE}),Promise.reject({type:Fs.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR})}const r=t?.isTriggeredFromDifferentContext,{caseID:a,assignments:o,localActionID:i,caseActions:c,caseInfo:l,businessID:u,caseTypeID:d,caseTypeName:p}=aE(e,this.c11nEnv,{isTriggeredFromDifferentContext:r}),g=QI(l);let h,f=!1;const m=c?.find((e=>e.ID===i));m?f="Case"===m?.type:h=$C(n);let{assignmentID:I}=aE(e,this.c11nEnv,{isTriggeredFromDifferentContext:r});h?.context_data?.actionType&&(f=h.context_data.actionType===js.CASE,I=I||h.context_data.assignmentID);const E=sE(o,I,i,l?.activeActionID),[y,A]=a.split(" "),C={class:y,actionID:E,assignmentID:I,caseID:a,workID:A,containerName:this.c11nEnv.getContainerName(),containerItemID:e,isCaseWideAction:f,doDeleteCaseSummary:!0,isInCreateStage:g,businessID:u,caseTypeID:d,caseTypeName:p};e?.includes(js.MODAL)&&(C.containerName=js.MODAL,C.isModalAction=!0),C.outcome=t.outcomeID,C.jsActionQueryParams=t.jsActionQueryParams,l?.isLocalAction&&(C.viewType=tI.FORM);const S=Uf(e,d,l?.isObjectWideAction),_=dS.buildActionObject(C,this.c11nEnv),{promise:N}=this.actionsApiPromise(S,_);return _.isProcessAction=this.c11nEnv.getValue("isProcessAction","isProcessAction")||$C(n).context_data.isProcessAction,_.headers??={},PA.isWSSPortal()&&(_.headers[js.X_ORIGIN_CHANNEL]="WSS"),xf.executeOrQueueDeferredAction({type:S,payload:{..._,context:n}}),N}getNextWork(){if("HYBRID"===PA.getRenderingMode())return fd.publish(Fs.PUB_SUB_EVENTS.CASE_EVENTS.GET_NEXT_WORK,{userIdentifier:PA.getOperatorIdentifier()}),Promise.resolve();const e=kg,t=dS.buildActionObject({containerName:js.PRIMARY,isGetNextWork:!0},this.c11nEnv),{promise:n}=this.actionsApiPromise(e,t);return BC({type:e,payload:{...t}}),n}openStage(e){if(!e)return Promise.reject(new Error("stageID is required parameter for openStage"));const t=kg,n=this.c11nEnv.getValue(Fs.CASE_INFO.CASE_INFO_ID),s=this.c11nEnv.getCaseSummary().headers,r=dS.buildActionObject({containerName:this.c11nEnv.getContainerName(),isOpenStage:!0,stageID:e},this.c11nEnv),{promise:a}=this.actionsApiPromise(t,r),o={type:t,payload:{...r,caseID:n,headers:s}};return BC(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(Fs.CASE_INFO.CASES),s=this.c11nEnv.getValue(Fs.CASE_INFO.ACTIVE_ACTION_ID),r=this.c11nEnv.getValue(Fs.CASE_INFO.IS_ASSIGNMENT),a={containerName:this.c11nEnv.getContainerName(),containerItemID:e,isCaseWideAction:!0,doDeleteCaseSummary:!0,isInCreateStage:!1};e&&e.includes(js.MODAL)&&(a.containerName=js.MODAL,a.isModalAction=!0);const o=dS.buildActionObject(a,this.c11nEnv),{promise:i}=this.actionsApiPromise(t,o),c=Ly(e);return BC({type:t,payload:{...o,context:c,cases:n,actionID:s,isAssignment:r,isFormValid:GI(c),classID:this.c11nEnv.getCurrentClassID()}}),i}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(Fs.CASE_INFO.CASES),s=this.c11nEnv.getValue(Fs.CASE_INFO.ACTIVE_ACTION_ID),r={containerName:e.includes(js.MODAL)?js.MODAL:this.c11nEnv.getContainerName(),containerItemID:e,isCaseWideAction:!0,doDeleteCaseSummary:!0,isInCreateStage:!1,isModalAction:e.includes(js.MODAL)},a=dS.buildActionObject(r,this.c11nEnv),{promise:o}=this.actionsApiPromise(t,a),i=Ly(e);return BC({type:t,payload:{...a,context:i,cases:n,actionID:s,isFormValid:GI(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:s}=t,r=t.type,a={selectedList:n,vcName:t.target,actionName:t?.name,actionID:e,doDeleteCaseSummary:!0,localActionType:r,runningMode:s,...t},o="OPEN_BULK_ACTION",i=dS.buildActionObject(a,this.c11nEnv),{promise:c}=this.actionsApiPromise(o,i);return BC({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 Qg(this.c11nEnv).removeContainerItem({containerItemID:e,skipReleaseLockRequest:!0})}approveCase(e){return e?"string"!=typeof e?Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING)):(BC({type:Xs,payload:{reference:Fs.CASE_INFO.APPROVALFLAG,value:js.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)):(BC({type:Xs,payload:{reference:Fs.CASE_INFO.APPROVALFLAG,value:js.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(Fs.CASE_INFO.DUPLICATECASEINSKEY).split(" "),n={type:Xs,payload:{reference:Fs.CASE_INFO.DUPLICATECASEFLAG,value:js.DUPLICATE,context:e}},s={type:Xs,payload:{reference:Fs.CASE_INFO.DUPLICATECASEID,value:t,context:e}};return BC([n,s]),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:Xs,payload:{reference:Fs.CASE_INFO.DUPLICATECASEFLAG,value:js.IGNORE,context:e}},n={type:Xs,payload:{reference:Fs.CASE_INFO.DUPLICATECASEID,value:"",context:e}},s={type:Xs,payload:{reference:Fs.CASE_INFO.DUPLICATECASEINSKEY,value:"",context:e}};return BC([t,n,s]),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,Ff(window.pms.plugins.c11n.openLocalAction,e,t);const s=t.assignKey||this.c11nEnv.getValue(Fs.CASE_INFO.ASSIGNMENT_ID),r=t.type,a={caseID:n,assignmentID:s,vcName:t.target,actionName:t?.name,assignKey:s,actionID:e,doDeleteCaseSummary:!0,localActionType:r,...t},o=t.containerName===js.ACTIONAREA?yr:(e=>YI.shouldUseUnifiedHandling()||"Object"!==e.type&&!YI.isObjectCaseType(e?.caseClassName||"")&&!window.location.href.includes("/objects/")?yr:"OPEN_OBJECT_ACTION")(t),i=dS.buildActionObject(a,this.c11nEnv);t.containerName!==js.ACTIONAREA&&t.containerName!==js.WORKAREA||(i.skipMergeAssignmentsAndActions=!1);const{promise:c}=this.actionsApiPromise(o,i),l=this.c11nEnv.getContextName(),u=jy(l)[0];let d;if(d=xy(u),d?.includes("actionarea")&&o===yr)return BC({type:o,payload:{...i}}),c;if("Object"===t.type)return BC({type:o,payload:{...i}}),c;const p=xy(u),g=n!==this.c11nEnv.getValue(js.getProperty(Fs.CASE_INFO.CASE_INFO_ID))&&p&&Bs.getRemoteHeaderByContext(p)||Bs.getRemoteHeaderByContext(l);if(Dg.setRemoteCaseHeaderByContext(i,g),!u)return d=l,BC({type:o,payload:{...i,contextName:l,continueExecution:!1}}),c;const{continueExecution:h,containerItemID:f}=Ay(l,n,u);if(d=f,!h||d&&"review"===kC()?.getState()?.data[d]?.context_data?.caseViewMode)return BC({type:o,payload:{...i,contextName:l,continueExecution:h}}),c;const m=d,I=m&&m.includes(js.MODAL),E=t.assignKey||this.c11nEnv.getValue(Fs.CASE_INFO.ASSIGNMENT_ID),y=$C(d),A=y?.caseInfo?.assignments?y.caseInfo.assignments[0]?.actions[0]?.ID:void 0,C=this.c11nEnv.getContainerName(),S=this.c11nEnv.getValue(Fs.CASE_INFO.CASE_TYPE_ID),_=this.c11nEnv.getValue("isProcessAction","isProcessAction"),N=dS.buildActionObject({context:m,containerItemID:d,assignmentID:E,actionID:A,caseID:n,containerName:C,caseType:S,isModalAction:I,isFormValid:!0,isProcessAction:_},this.c11nEnv);N.context=d;const T=Ly(d),D=this.c11nEnv.getCaseSummary(),P=QI(D),O=dS.buildActionObject({caseID:n,containerItemID:d,cancelContext:T},this.c11nEnv);let R={};return I?(O.acTargetName=js.MODAL,O.isInCreateStage=P,O.isModalAction=I,R={...O}):R={...O,acName:Va(this.c11nEnv.getContainerName(),O.context)},BC({type:o,payload:{...i,contextName:l,saveActionPayload:N,cancelActionPayload:R,continueExecution:h}}),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(Fs.CASE_INFO.CASE_INFO_ID)||t.caseID;if(window.pms?.plugins?.c11n?.openProcessAction)return t.caseID=n,Ff(window.pms.plugins.c11n.openProcessAction,e,t);const s=this.c11nEnv.getValue(Fs.CASE_INFO.ASSIGNMENT_ID)||t.assignKey,r=t.type,a={caseID:n,assignmentID:s,vcName:t.target,actionName:t?.name,assignKey:s,actionID:e,doDeleteCaseSummary:!0,processActionType:r,isProcessAction:!0,...t},o=Vg,i=dS.buildActionObject(a,this.c11nEnv),c=this.c11nEnv.getContextName(),l=jy(c)[0];let u=Bs.getRemoteHeaderByContext(c);if(!u&&l){const e=yy(l);e?.accessedOrder.forEach((s=>{(t.caseID||n)===e.items[s].key&&(u=Bs.getRemoteHeaderByContext(e.items[s].context))}))}Dg.setRemoteCaseHeaderByContext(i,u);const{promise:d}=this.actionsApiPromise(o,i),{containerItemID:p}=Ay(c,n,l);return BC({type:o,payload:{...i,saveContainerItemID:p}}),d}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=Er,s=this.c11nEnv.getValue(Fs.NEXT_ASSIGNMENT_INFO_ID)?this.c11nEnv.getValue(Fs.NEXT_ASSIGNMENT_INFO_ID):this.c11nEnv.getValue(Fs.CASE_INFO.ASSIGNMENT_ID),r=QI(this.c11nEnv.getCaseSummary()),a=this.c11nEnv.getValue(Fs.CASE_INFO.CASE_INFO_ID),o={ID:s,stepID:e,acTargetName:this.c11nEnv.getContainerName(),targetContainerName:this.c11nEnv.getContainerName(),containerItemID:t,doDeleteCaseSummary:!0,isInCreateStage:r,caseID:a};t&&t.includes(js.MODAL)&&(o.acTargetName=js.MODAL);const i=dS.buildActionObject(o,this.c11nEnv),{promise:c}=this.actionsApiPromise(n,i),l=Ly(t);return BC({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}=Fs,s=mr,r=Ly(e),a=e&&e.includes(js.MODAL),o=this.c11nEnv.getCaseSummary(),i=QI(o),c=this.c11nEnv.getValue(js.getProperty(n.CASE_INFO_ID)),l=this.c11nEnv.getValue(n.ASSIGNMENT_ID),u=dS.buildActionObject({caseID:c,containerItemID:e,context:r},this.c11nEnv);let d={};a?(u.acTargetName=js.MODAL,u.isInCreateStage=i,u.isModalAction=a,d={...u}):d={...u,acName:Va(this.c11nEnv.getContainerName(),u.context)};const{promise:p}=this.actionsApiPromise(s,u);return BC({type:s,payload:d}),p.then((()=>{t||Lf({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}=Fs,n=e,s=Xr,r=e&&e.includes(js.MODAL),a=this.c11nEnv.getValue(t.CASE_INFO_ID),o=dS.buildActionObject({caseID:a,containerItemID:e,context:n},this.c11nEnv);if(!cy(n)){return new Qg(this.c11nEnv).removeContainerItem({containerItemID:e}).then((()=>{Rf(a),Lf({caseID:a,context:this.c11nEnv.getContextName()})}))}BC({type:s,payload:{...o,isModalAction:r}});const{promise:i}=this.actionsApiPromise(s,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}=Fs,n=Xr,s=e,r=s&&s.includes(js.MODAL),a=this.c11nEnv.getCaseSummary(),o=this.c11nEnv.getValue(js.getProperty(js.CASE_INFO.CASE_TYPE_ID)),i=QI(a),c=this.c11nEnv.getValue(js.getProperty(t.CASE_INFO_ID)),l=dS.buildActionObject({caseID:c,containerItemID:e,context:s},this.c11nEnv),u=this.c11nEnv.getValue("isProcessAction","isProcessAction"),d=PA.isCoexistenceAppOfType(js.APP_TYPE.UIKIT);l.isProcessAction=u;const p=PA.getRenderingMode();if(i&&(r||d||"EMBED"===p)&&!KI(a)){const t=this.c11nEnv.getValue(js.getProperty(js.CASE_INFO.IS_FIRST_ASSIGNMENT)),c=cy(s);if(this.shouldDeleteCaseInCreateStage(c,t,d)){const t=!0===Boolean(YI.isExternalObject(o));return this.deleteCaseInCreateStage(e,t)}BC({type:n,payload:{...l,isModalAction:r,isChildCase:tE(a),isInCreateStage:i}})}const{promise:g}=this.actionsApiPromise(n,l);return g.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=$g,n=this.getSaveActionPayload(e,!0),{promise:s}=this.actionsApiPromise(t,n);return xf.executeOrQueueDeferredAction(Gg(n)),s}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=$g,n=this.getSaveActionPayload(e),{promise:s}=this.actionsApiPromise(t,n);return BC(Gg(n)),s}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=Bg,s=e,r=s&&s.includes(js.MODAL),a=this.c11nEnv.getValue(js.getProperty(Fs.CASE_INFO.CASE_INFO_ID)),o=this.c11nEnv.getValue(js.getProperty(Fs.CASE_INFO.CASE_TYPE_ID)),i=dS.buildActionObject({caseID:a,caseType:o,containerItemID:e,context:s,ignoreCaseDeletion:t},this.c11nEnv),c=this.c11nEnv.getValue("isProcessAction","isProcessAction"),l=this.c11nEnv.getValue(js.getProperty(Fs.CASE_INFO.PARENTCASEINFO));i.isProcessAction=c,i.parentCaseInfo=l;const u=`${js.APP.APP}/${my.PRIMARY}`,d=gI(u,my.PRIMARY);i.parentContext=d,r&&(i.targetName=js.MODAL,i.containerName=my.MODAL,i.isModalAction=r),BC((e=>({type:Bg,payload:e}))(i));const{promise:p}=this.actionsApiPromise(n,i);return p.then((()=>{Lf({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}=TA.getRestEndPoint("getRecents")||{};t=`${t}?maxResultsToFetch=${e}`;const n=rn()+t;return Wd(n,{method:"GET",headers:{}})}updateRecents(e,t,n,s){const{restApi:r}=TA.getRestEndPoint("updateRecents")||{},a=`${rn()}${r}`;return Wd(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:{pyLabel:n,pyID:t,classID:e,ID:s}})}logout(){const{restApi:e}=TA.getRestEndPoint("Logout")||{},t=`${rn()}${e}`;return Wd(t,{method:"GET",headers:{}}).then((e=>(Object.keys(Zu.rootNodes).forEach((e=>{Sf.cleanCaches(e)})),Zu.rootNodes={},sessionStorage.clear(),tS(),Promise.resolve(e))))}invoke(e,t={}){const n={method:t.method||"GET",body:t.body};return Wd(e,n,this.c11nEnv.getContextName())}showCasePreview(e,t={}){this.loadView(e,Ls.getDefaultQualifiedName("pyCasePreview"),{container:my.PREVIEW,containerName:my.PREVIEW,context:Fs.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(Ls.getDefaultQualifiedName("pyDataPreview"),e,t,{container:my.PREVIEW,containerName:my.PREVIEW,context:Fs.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 s=dS.buildActionObject({caseId:e,viewName:t,caseClassName:this.c11nEnv.getValue(js.getProperty(Fs.CASE_INFO.CASE_TYPE_ID)),RemoteSystemID:Bs.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),s={...s,...n}):s={...s,containerName:this.c11nEnv.getContainerName()};const r=tr,{promise:a}=this.actionsApiPromise(r,s,!1);return BC({type:r,payload:{...s}}),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 s=dS.buildActionObject({viewName:e,className:t},this.c11nEnv),r=nr,{promise:a}=this.actionsApiPromise(r,s);return Id.getPreviewMode()&&(s.debugInfo={debugId:rS.generateUniqueID()}),BC({type:r,payload:{...s,...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=dS.buildActionObject({},this.c11nEnv),s=rr,{promise:r}=this.actionsApiPromise(s,n);return BC({type:s,payload:{...n,containerName:this.c11nEnv.getContainerName(),skipSemanticUrl:t.skipSemanticUrl||!1,insightID:e}}),r}showDashboard(e,t={}){if(!e)return Promise.reject(new Error(this.MSG_DASHBOARDID_REQUIRED));const n=dS.buildActionObject({},this.c11nEnv),s=ar,{promise:r}=this.actionsApiPromise(s,n);return BC({type:s,payload:{...n,containerName:this.c11nEnv.getContainerName(),skipSemanticUrl:t.skipSemanticUrl||!1,dashboardID:e}}),r}showData(e,t,n,s={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 r=dS.buildActionObject({pageName:e,dataContext:t,dataContextParameters:n,RemoteSystemID:Bs.getRemoteHeaderByContext(this.c11nEnv.getContextName())},this.c11nEnv),a=sr;s?.containerName||(s.containerName="HYBRID"===PA.getRenderingMode()?Tf.getRuntimeParam(js.HYRBID_ROOT_CONTAINERNAME):Og.getTargetViewContainerName(a));const{promise:o}=this.actionsApiPromise(a,r);return BC({type:a,payload:{...r,...s,skipSemanticUrl:Boolean(s.skipSemanticUrl)}}),o}changeHandler(e,t){dS.changeHandler(e,t)}eventHandler(e,t){dS.eventHandler(e,t)}triggerFieldChange(e,t,n=!1,s={skipDirtyValidation:!1,skipPageInstructionGeneration:!1}){const r=this.c11nEnv.getContextName(),a=this.c11nEnv.getPageReference(),o=cS.getContextPath(a,e);n||this.c11nEnv.getValidationApi().validate(t),this.c11nEnv.isInsideList()&&!s.skipPageInstructionGeneration&&this.c11nEnv.getListActions().updateProperty(e,t,s);let i=this.c11nEnv.getValue(js.CLASS_ID);const c=e?e.split(".").filter((e=>!!e)):[];c.length>1&&(c.pop(),i=HC(`.${c.join(".")}.classID`,a,r)),e=rS.trimDotForProperty(e),BC({type:er,payload:{reference:o,value:t,context:r,pageReference:this.c11nEnv.getPageReference(),propertyName:e||this.c11nEnv.getComponentConfig().value,classID:i}})}updateFieldValue(e,t,n={}){const{removePropertyFromChangedList:s=!1,isArrayDeepMerge:r=!0,contextPageReference:a="",isListEntry:o=!1,skipDirtyValidation:i=!1,associatedProperty:c,skipPageInstructionGeneration:l=!1}=n,u=this.c11nEnv.getContextName();let d=this.c11nEnv.getPageReference();const p=a?.startsWith(d)?a.replace(d,""):a;d=a||d;const g=cS.getContextPath(d,e);let h=!1;this.c11nEnv.isInsideList()&&!l&&this.c11nEnv.getListActions().updateProperty(p?`${p}${e}`:e,t,{isArrayDeepMerge:r,skipDirtyValidation:i}),this.c11nEnv.isBulkAction()&&(h=!0),e||(e=this.c11nEnv.getStateProps().value),od({type:Fs.MESSAGES.MESSAGES_TYPE_ERROR,property:e,pageReference:d,context:u,isListEntry:o}),BC({type:Xs,payload:{reference:g,value:t,context:u,isArrayDeepMerge:r,skipDirtyValidation:i,...h&&{isStrictTracking:h},...s&&{removePropertyFromChangedList:s},...c&&{associatedProperty:`${d}${c}`}}})}activateModalContainerItem(e){const t=Br,{context:n}=e,s=n&&n.includes(js.MODAL),r=dS.buildActionObject({...e,containerName:this.c11nEnv.getContainerName(),containerItemID:n},this.c11nEnv);s&&(r.containerName=js.MODAL,r.isModalAction=s),BC({type:t,payload:r});const{promise:a}=this.actionsApiPromise(t,r);return a}refreshCaseView(e,t,n,s={}){const{promise:r,actionMgrID:a}=this.actionsApiPromise("REFRESH_DATA"),{autoDetectRefresh:o,propertyName:i,preserveClientChanges:c,classID:l,context:u,optionalPayload:d,isArrayDeepMerge:p}=s,g={actionMgrID:a,caseViewAction:!0,preserveClientChanges:c,propertyName:i,classID:l,isArrayDeepMerge:p,optionalPayload:d};s.refreshFor&&(g.refreshFor=s?.refreshFor),s.resetForm&&(g.resetForm=s?.resetForm),s.skipPayloadGeneration&&(g.skipPayloadGeneration=s?.skipPayloadGeneration);const h=u||this.c11nEnv.getContextName(),f=this.c11nEnv.getPageReference(),m=this.c11nEnv.getValue(js.CONTEXT_DATA_MODAL_VIEW.CONTEXT_DATA_MODAL_VIEW),{isMultiRecordData:I,editType:E}=m||{};if(o&&I&&E===js.ACTION){const t=this.c11nEnv.getValue(Fs.CASE_INFO.ASSIGNMENT_ID),{actionID:n,interestPage:s,interestPageActionID:r,isLocalAction:a}=m;pE(e,t,n,h,s,r,a,I,E,g)}else!I&&o&&(eE(h,f)||XI(h,f))?yE(h,n,g):dE(e,t,h,n,g);return r}refreshEmbeddedDataWithAction(e,t,n,s,r,a,o,i,c={}){const{promise:l}=this.actionsApiPromise(Nf.REFRESH_DATA),u=this.c11nEnv.getContextName();return pE(e,t,n,u,s||this.c11nEnv.getPageReference(),r,a,o,i,c),l}openEmbeddedDataModal(e,t,n,s,r,a,o,i,c=!1,l=Fs.MODAL){const u=_a;let d=t.getCaseInfo().getKey();const p=t.getValue(Fs.CASE_INFO.IS_LOCAL_ACTION),g=t.getValue(Fs.CASE_INFO.ASSIGNMENT_ID),h=jf(t,o,p),f=t.getPageReference();let m="string"==typeof s?`${t.getPageReference().replace(js.getProperty(Fs.CASE_INFO.CASE_INFO_CONTENT),"")}${n}.${s}`:`${t.getPageReference().replace(js.getProperty(Fs.CASE_INFO.CASE_INFO_CONTENT),"")}${n}[${s}]`;f.startsWith(Fs.OBJECT_INFO.OBJECT_INFO)&&!d&&(d=t.getCaseInfo().getObjectKey(),m=`${t.getPageReference().replace(Fs.OBJECT_INFO.OBJECT_INFO_CONTENT,"")}${n}[${s}]`);const I=t.getMetadata(),E=Array.isArray(I?.config?.children)&&I.config.children[0]?.children||[],y={readOnly:c,targetProperty:n,index:s,viewID:e,ID:d,actionType:r,interestPage:rS.convertPageRefToClipboardPageNotation(m),heading:a,editType:o,interestPageActionID:o===js.ACTION?i:void 0,actionID:h,isLocalAction:p,operationFlag:js.EMBEDDED_DATA_MODAL.SHOW_ROW,isPageGroup:"string"==typeof s,assignmentID:p||o!==js.ACTION?void 0:g,columns:E},A=dS.buildActionObject(y,this.c11nEnv);if(o===js.ACTION){const e=rS.getETag(A.context);A.headers={"If-Match":e}}const{promise:C}=this.actionsApiPromise(u,A);return PA.getFeatureMap().granularUIRefresh&&E.forEach((e=>{const n=No.trimAnnotation(e.config.value),s=oC(n.startsWith(".")?n.replace(".",""):n,e.config.classID);s&&!Array.isArray(s)&&s.isDeclarativeTarget&&Zu.addFieldNode(t.getContextName(),f+m,t.viewName??"",n,"",{isDeclarativeTarget:!0,propertyName:n,pageReference:f+m})})),BC({type:u,payload:{...A,containerName:l,skipSemanticUrl:!0}}),C}getEmbeddedDataView(e,t,n,s,r,a="",o="",i=!1,c=""){const l=Na;let u=t.getCaseInfo().getKey();const d=t.getValue(Fs.CASE_INFO.IS_LOCAL_ACTION),p=t.getValue(Fs.CASE_INFO.ASSIGNMENT_ID),g=jf(t,a,d),h=t.getPageReference();let f="string"==typeof s?`${t.getPageReference().replace(js.getProperty(Fs.CASE_INFO.CASE_INFO_CONTENT),"")}${n}.${s}`:`${t.getPageReference().replace(js.getProperty(Fs.CASE_INFO.CASE_INFO_CONTENT),"")}${n}[${s}]`;h.startsWith(Fs.OBJECT_INFO.OBJECT_INFO)&&!u&&(u=t.getCaseInfo().getObjectKey(),f=`${t.getPageReference().replace(Fs.OBJECT_INFO.OBJECT_INFO_CONTENT,"")}${n}[${s}]`);const m={readOnly:i,targetProperty:n,index:s,viewID:e,ID:u,actionType:r,interestPage:rS.convertPageRefToClipboardPageNotation(f),editType:a,interestPageActionID:a===js.ACTION?o:void 0,actionID:g,isLocalAction:d,operationFlag:js.EMBEDDED_DATA_MODAL.SHOW_ROW,isPageGroup:"string"==typeof s,assignmentID:d||a!==js.ACTION?void 0:p,containerName:c},I=dS.buildActionObject(m,this.c11nEnv);if(a===js.ACTION){const e=rS.getETag(I.context);I.headers={"If-Match":e}}const{promise:E}=this.actionsApiPromise(l,I);return BC({type:l,payload:{...I,skipSemanticUrl:!0}}),E}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=Ta;let n=this.c11nEnv.getValue(js.getProperty(Fs.CASE_INFO.CASE_INFO_ID));const s=this.c11nEnv.getValue(js.getProperty(Fs.CASE_INFO.ASSIGNMENT_ID));let r=this.c11nEnv.getPageReference().replace(js.getProperty(Fs.CASE_INFO.CASE_INFO_CONTENT),"");const a=Ly(e),o=this.c11nEnv.getValue(js.getProperty(js.CONTEXT_DATA_MODAL_VIEW.CONTEXT_DATA_MODAL_VIEW)),{interestPageActionID:i,editType:c,isLocalAction:l,actionID:u,viewName:d,parentContext:p}=o;r.startsWith(Fs.OBJECT_INFO.OBJECT_INFO)&&!n&&(n=this.c11nEnv.getValue(Fs.OBJECT_INFO.OBJECT_INFO_ID),r=this.c11nEnv.getPageReference().replace(Fs.OBJECT_INFO.OBJECT_INFO_CONTENT,"")),od({context:a,stateObj:$C(a),clearContextMessages:!0});const g={containerItemID:e,containerName:this.c11nEnv.getContainerName(),doDeleteCaseSummary:!0,isInCreateStage:!1,ID:n,viewID:d,isFormValid:GI(a),interestPage:rS.convertPageRefToClipboardPageNotation(r),parentContext:p,isModalAction:!1,target:this.c11nEnv.getTarget(),editType:c,actionID:u,operationFlag:js.EMBEDDED_DATA_MODAL.SUBMIT_ROW,interestPageActionID:i,isLocalAction:l,assignmentID:s};e&&e.includes(js.MODAL)&&(g.containerName=js.MODAL,g.isModalAction=!0);const h=dS.buildActionObject(g,this.c11nEnv);if(c===js.ACTION){const e=rS.getETag(h.context);h.headers={"If-Match":e}}const{promise:f}=this.actionsApiPromise(t,h);if(cy(a)){const[e,t,n]=ku(this.c11nEnv.getPageReference());Zu.mutatePageList(p,e,t,{type:ca,rowIndex:n}),BC({type:ca,payload:{pageReference:this.c11nEnv.getPageReference(),context:p,isListEntry:!0}})}return xf.executeOrQueueDeferredAction({type:t,payload:{...h,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=Ly(e),n=this.c11nEnv.getPageReference(),{promise:s,actionMgrID:r}=this.actionsApiPromise(Pa);return yE(t,n,{actionMgrID:r,isFillFormWithAI:!0,preserveClientChanges:!1}),s}handleSubscript(e,t){if(!mC(Fs.VIEW_NAMES.SUBSCRIPT_CREATE_VIEW))return Promise.reject(new Error(this.MSG_SUBSCRIPT_VIEW_REQUIRED));const n=Da,s=dS.buildActionObject({containerItemID:e},t);BC({type:n,payload:{...s,isDataObject:!0,skipReleaseLockRequest:!0,isFormValid:GI(e),context:e}});const{promise:r}=this.actionsApiPromise(n,s);return r}showSubscriptCreateView(e,t,n,s=Fs.VIEW_NAMES.SUBSCRIPT_CREATE_VIEW){const r=dS.buildActionObject({viewName:s,className:e,referenceListStr:t,subscriptName:n},this.c11nEnv),a=nr,{promise:o}=this.actionsApiPromise(a,r);return BC({type:a,payload:{...r,containerName:Fs.MODAL,skipSemanticUrl:!0,isCreateDataObject:!0}}),o}deleteWork(e,t,n){if(!e)return Promise.reject(new Error("workId is required parameter"));const s=wa,r=YI.isExternalCaseType(t),a=dS.buildActionObject({workId:e,caseTypeID:t,isExternalCase:r,...n?.skipDeleteConfirmation&&{skipDeleteConfirmation:!0},...n?.enableBackNavigation&&{enableBackNavigation:!0}},this.c11nEnv),{promise:o}=this.actionsApiPromise(s,a);return BC(Hg({...a})),o}deleteDataRecord(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=wa,s=dS.buildActionObject({className:e,keys:t},this.c11nEnv),{promise:r}=this.actionsApiPromise(n,s);return BC(Hg({...s})),r}};const Bf=class{constructor(e){this.c11nEnv=e}buildRemoteCaseHeaders(e,t){const n={};if(e){const s=Bs.getRemoteCaseClassBySourceClass(e)??e;Bs.injectRemoteCaseHeader(n,{caseTypeID:s},t)}return n}async getCaseStages(e,t,n){const s={caseID:e},{restApi:r,reqType:a}=i_("getCaseStages",s),{caseTypeID:o}=n||{},i=this.buildRemoteCaseHeaders(o,t);return(await Wd(r,{method:a,headers:i},t)).data.stages}async getCaseActions(e,t,n){const s={caseID:e},{restApi:r,reqType:a}=i_("getActions",s),{caseTypeID:o}=n||{},i=this.buildRemoteCaseHeaders(o,t);return(await Wd(r,{method:a,headers:i},t)).data}getCaseTypeName(){return this.c11nEnv.getValue(js.getProperty(js.CASE_INFO.CASE_TYPE_NAME))}getName(){return this.c11nEnv.getValue(js.getProperty(js.CASE_INFO.CASE_INFO_NAME))}getClassName(){return this.c11nEnv.getValue(js.getProperty(js.CASE_INFO.CASE_TYPE_ID))}getAvailableProcesses(){return this.c11nEnv.getValue(js.getProperty(js.CASE_INFO.AVAILABLEPROCESSES))}getKey(){return this.c11nEnv.getValue(js.getProperty(js.CASE_INFO.CASE_INFO_ID))}getObjectKey(){return this.c11nEnv.getValue(js.OBJECT_INFO.OBJECT_INFO_ID)}getID(){const e=this.getKey();if(e){const[,t]=e.split(" ");return t||e}}getAssignmentID(){return this.c11nEnv.getValue(js.getProperty(js.CASE_INFO.ASSIGNMENT_ID))}getActions(){return this.c11nEnv.getValue(js.getProperty(js.CASE_INFO.ACTION_BUTTONS))}getActiveFlowActionID(){return this.c11nEnv.getValue(js.getProperty(js.CASE_INFO.ACTIVE_ACTION_ID))||this.c11nEnv.getValue(js.getProperty(js.CASE_INFO.ASSIGNMENTACTION_ID))}getParentCaseInfo(){return this.c11nEnv.getValue(js.getProperty(js.CASE_INFO.PARENTCASEINFO))}isPerform(){return this.c11nEnv.getValue(`${js.CONTEXT_DATA}${js.CASE_VIEW_MODE_PROP}`)===js.PERFORM_MODE}isReview(){return this.c11nEnv.getValue(`${js.CONTEXT_DATA}${js.CASE_VIEW_MODE_PROP}`)===js.REVIEW_MODE}isAssignmentInCreateStage(){const e=this.c11nEnv.getValue(js.getProperty(js.CASE_INFO.CASE_INFO));return QI(e)}isReviewAfterCreateStage(){if(!this.isReview())return!1;const e=this.c11nEnv.getContextName(),t=Vy(e)[0];if(!t)return!1;const n=kC()?.getState().data[t]?.caseInfo?.stages;if(!Array.isArray(n))return!1;const s=[...n].reverse().find((e=>"object"==typeof e&&null!==e&&"visited_status"in e&&"transitionType"in e&&"completed"===e.visited_status));return"create"===s?.transitionType}isLocalAction(){const e=this.c11nEnv.getValue(js.getProperty(js.CASE_INFO.CASE_INFO));return KI(e)}getCurrentAssignmentViewName(){let e=null,t=!1;if(this.c11nEnv.getValue("context_data.caseViewMode")===js.PERFORM_MODE){if(this.isLocalAction())return e;if(this.isAssignmentInCreateStage())t=!0;else{const t=this.c11nEnv.getTarget(),n=this.c11nEnv.getContextName(),s=Cy(t,n),{config:r}=t&&n?s&&s.view:this.c11nEnv.getMetadata();e=r?.type===js.VIEW?r?.name:null}(e&&e.startsWith(js.PROPERTY_ANNOTATION)||t)&&(e=this.c11nEnv.getValue(Ls.getQualifiedNameForComplexRuleReferences(js.getProperty(js.CASE_INFO.VIEW_NAME))))}return e}getValueByPath(e,t){let n=e;if((t=t.replace("@P ","").trim()).includes(Ls.getDefaultQualifiedName("pyViewContext"))){const t=e.caseInfo?.content??{},s=t[Ls.getDefaultQualifiedName("pyViewContext")];if(!s)return n.caseInfo.content;if("string"==typeof s&&s.includes("(")&&s.includes(")")){const e=s.substring(1,s.indexOf("(")),n=parseInt(s.substring(s.indexOf("(")+1,s.indexOf(")")),10)-1;if(Array.isArray(t[e]))return t[e][n];const r=e.split(".").reduce(((e,t)=>e?.[t]),t);if(Array.isArray(r))return r[n]}}const s=t.split(/[.[\]]/).filter((e=>e));for(const e of s)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=Cy(e,t),{config:s}=e&&t&&n?n.view:this.c11nEnv.getMetadata(),r=this.c11nEnv.getValue(js.getProperty(js.CASE_INFO.CASE_INFO)),a=s?.type===js.VIEW?s.context:null;if(a){const e=this.getValueByPath({caseInfo:r},a);if("object"==typeof e&&null!==e&&"classID"in e)return e.classID}return null}getActionRefreshConditions(){if(this.c11nEnv.getValue(js.getProperty(js.CONTEXT_DATA_MODAL_VIEW.IS_MULTI_RECORD_DATA)))return this.c11nEnv.getValue(js.getProperty(js.EMBEDDED_DATA_MODAL.REFRESH_CONDITIONS));const e=this.c11nEnv.getValue(js.getProperty(js.CASE_INFO.ACTIVE_ACTION_ID)),t=Ws(this.c11nEnv.getContextName());let n;t&&(n=$C(t));const s=n?.caseInfo?.availableActions,r=$C(this.c11nEnv.getContextName()),a=r?.caseInfo?.refreshConditions;if(e){if(s){const t=s.find((t=>t.ID===e));return t?t.refreshConditions:a}return a}return this.c11nEnv.getValue(js.getProperty(js.CASE_INFO.ACTION_REFRESH_CONDITIONS))}getBusinessID(){return this.c11nEnv.getValue(js.getProperty(js.CASE_INFO.BUSINESS_ID))}getAssignments(){return this.c11nEnv.getValue(js.getProperty(js.CASE_INFO.CASE_INFO))?.assignments}getChildAssignments(){return this.c11nEnv.getValue(js.getProperty(js.CASE_INFO.CASE_INFO))?.childCases?.[0]?.assignments}isCaseWideLocalAction=()=>{const e=this.c11nEnv.getValue(js.getProperty(js.CASE_INFO.ACTIVE_ACTION_ID)),t=this.c11nEnv.getValue(js.getProperty(js.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(js.getProperty(js.CASE_INFO.CASE_INFO_ACTIONS)),t=this.c11nEnv.getValue(js.getProperty(js.CASE_INFO.ASSIGNMENT_LABEL)),n=this.c11nEnv.getValue(js.getProperty(js.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS))||[],s=this.getChildAssignments()||[];let r=JSON.parse(JSON.stringify(s));r=r.map((e=>(e.isChild=!0,e)));const a=[...n,...r];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(js.getProperty(js.CASE_INFO.CASE_INFO_ACTIONS)),t=this.c11nEnv.getValue(js.getProperty(js.CASE_INFO.ACTIVE_ACTION_ID)),n=e.find((e=>e.ID===t));return n?.name||""}getFirstCaseActionName(){const e=this.c11nEnv.getValue(js.getProperty(js.CASE_INFO.CASE_INFO_ACTIONS));return e[0]?.name||""}hasAssignments(){const e=this.c11nEnv.getValue(js.getProperty(js.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS)),t=this.getChildAssignments();return!!(e||t||this.isCaseWideLocalAction())}hasMessages=()=>!!this.c11nEnv.getValue("caseMessages");hasGetNextWorkLinks(){return!!this.c11nEnv.getValue(js.getProperty(js.CASE_INFO.GETNEXTWORK))}isObjectWideAction(){const e=this.c11nEnv.getValue(js.OBJECT_INFO.OBJECT_INFO);return KI(e)}getCaseCollaborators=(e=!0)=>{const t=this.c11nEnv.getValue(js.CASE_INFO.CASE_INFO_COLLABORATORS)||[];if(e){const e=PA.getOperatorIdentifier();return t.filter((t=>t.ID!==e))}return t}};const $f=class{constructor(e){this.c11nEnv=e}getContextKey(){return this.c11nEnv.getValue(js.getProperty(js.DATA_INFO.DATA_INFO_CONTEXT_KEY))}};class Gf{constructor(e){Gf._instance=this,this.context=`${e}/${js.SUGGESTION}`,kC()?.getState().data?.[this.context]||BC({type:Gr,payload:{context:this.context,data:{}}})}getField(e){return HC(e,"",this.context)}setField(e,t){BC({type:Xs,payload:{reference:e,value:t,context:this.context}})}removeField(e,t={}){BC({type:Sr,payload:{reference:e,context:this.context,...t}}),fd.publish(js.PUB_SUB_EVENTS.SUGGESTION_PROCESSED,{reference:e,context:this.context,...t})}setState(e){BC(fS({context:this.context,data:e,isArrayDeepMerge:!0}))}}const Wf=Gf;const Hf=class{static getSharedState(e){const t=e.startsWith(".")?e.substring(1):e,n=GC();return n?rS.getIn(n,t):null}static setSharedState(e,t){e&&BC(YS({key:e,value:t}))}static updateState(e,t,n,s={}){const{isArrayDeepMerge:r=!0,pageReference:a,removePropertyFromChangedList:o=!1,skipDirtyValidation:i=!1}=s;if(!e||!t)return;BC(KS({context:e,reference:a?`${a}.${t}`:t,value:n,isArrayDeepMerge:r,removePropertyFromChangedList:o,skipDirtyValidation:i}))}static getSuggestionsContext(e){return new Wf(e)}static triggerRefresh(e,t){AE({context:e,pageReference:t})}};class qf{static getParagraphStream(e,t,n){return((e,t,n)=>{if(!e)return e;const s=(new DOMParser).parseFromString(e,"text/html"),r=s.querySelectorAll("pega-reference");for(const e of r){const n=e.getAttribute("data-rule-id");if(n){const r=t.getValue(n),a=s.createTextNode(r??"");e.replaceWith(a),t.registerAdditionalProps({[n]:`@P ${n}`})}else e.replaceWith("")}let a;return a="simple"===n?rS.decodeHtmlEntities(s?.body?.textContent||""):s?.body?.innerHTML||"",/^(<p>)\s*(<\/p>)$/.test(a)?null:a})(e,t,n)}static isDecisionParagraph(e,t){const n=NC(e,t);return!!n?.useDecision}static processParagraph(e,t){const n=t.getCurrentClassID(),s=NC(e,n);let r;if(s?.useDecision){const n=s.dynamicContents.length;for(let a=0;a<n-1;a+=1)if(cS.resolveWhen(s.dynamicContents[a].when,t)){r=s.dynamicContents[a],e=`${e}#${r.when}`;break}r||(r=s.dynamicContents.pop())}else r=s;const a=s?.definedOnClassID,o=xA().getParagraphLocaleValue(a||n,e);return o?qf.getParagraphStream(o.content,t,o?.category||r?.category||s?.category):r?.content?qf.getParagraphStream(r.content,t,r?.category||s?.category):null}static processBannerDecisionParagraph(e,t){const n=t.getCurrentClassID(),s=NC(e,n);let r;if(s?.useDecision){const n=s.dynamicContents.length;for(let a=0;a<n-1;a+=1)if(cS.resolveWhen(s.dynamicContents[a].when,t)){r=s.dynamicContents[a],e=`${e}#${r.when}`;break}r||(r=s.dynamicContents.pop())}else r=s;const a=s?.definedOnClassID,o=xA().getParagraphLocaleValue(a||n,e);let i=null;return o?i=qf.getParagraphStream(o.content,t,o.category||r?.category||s?.category):r?.content&&(i=qf.getParagraphStream(r.content,t,r?.category||s?.category)),{htmlContent:i,messageType:r?.messageType,dismissBanner:r?.dismissBanner,isBanner:r?.isBanner}}static getParagraphProperties(e,t){const n=t.getCurrentClassID(),s=NC(e,n);return{useDecision:s?.useDecision,isBanner:s?.isBanner,messageType:s?.messageType,dismissBanner:s?.dismissBanner}}static isADecisionParagraph(e,t){return this.getParagraphProperties(e,t).useDecision}static isBanner(e,t){return this.getParagraphProperties(e,t).isBanner}static getParagraphMessageType(e,t){return this.getParagraphProperties(e,t).messageType}static isDismissibleBanner(e,t){return this.getParagraphProperties(e,t).dismissBanner}static hasDecisionBannerContent(e,t){const n=t.getCurrentClassID(),s=NC(e,n);return!(!s?.useDecision||!s?.dynamicContents)&&s.dynamicContents.some((e=>e.isBanner))}}const zf=qf;class Yf{constructor(e){this.fieldType=e}applyFallback(e){const t=bp.getDefaultsforType(this.fieldType);e.currencyISOCode=e.currencyISOCode||t?.currencyISOCode||"USD"}}class Kf{static getStrategy(e){switch(e){case"Currency":case"Decimal":case"Integer":case"Percentage":return new Yf(e);default:return}}}const Qf="DATAPAGE",Jf="VIEW",Xf="FIELD",Zf="CASE",em="PARAGRAPH",tm=(e,t,n,s)=>{const r=[Jf,Xf,em],a=[Qf,em].includes(e)&&s?`#${s}`:"",o=e===Qf?"@BASECLASS":n;return e===Qf||r.includes(e)?`${o}!${e}!${t}${a}`.toUpperCase():`${e}!${t}${a}`.toUpperCase()};class nm{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=[...this.localeReference?[this.localeReference.toUpperCase()]:[],...this.lookupList,nm.COMPONENT_FIELDS,nm.COMMON_LABELS],s=this.#o(e,n)||e;return(t?this.#i(s,t):s)||e}getLocalizedMessage(e,t){const n=this.#o(e,[nm.MESSAGES,nm.COMMON_LABELS])??e;return(t?this.#i(n,t):n)||e}getLocalizedDataPage(e,t,n,s){if(!t||!n||!e)return e;const r=[tm(Qf,t,void 0,n),nm.COMMON_LABELS,...this.lookupList],a=this.#o(e,r)??e;return(s?this.#i(a,s):a)||e}#i(e,t){return 0===t.length?e:e.replace(/\{(\d+)\}/g,((e,n)=>t[""+(Number(n)-1)]??e))}#o(e,t=this.lookupList){if(0===t.length)return;const n=iC(this.locale);for(const s of t){const t=this.#c(e,n.localeStore[s]);if(t)return t}}#c(e,t={}){const n=t[e];if("string"==typeof n)return n}setLookupList(e){Array.isArray(e)&&(this.lookupList=e)}}const sm=e=>Us.getNeedsMapping()||e?.info===Fs.OBJECT_INFO.OBJECT_INFO?Fs.OBJECT_INFO.OBJECT_INFO:Fs.CASE_INFO.CASE_INFO,rm=(e,t)=>{const n=sm(t);e.data=e.data??{};const{assignments:s,availableActions:r=[]}=e.data[n]??{};if(s&&Array.isArray(s)&&s.length>0&&s[0].actions&&Array.isArray(s[0].actions)&&!t?.stopMergeActions){s[0].actions.forEach((e=>{"Assignment"!==e.type&&"LocalAction"!==e.type||r.push(e)})),e.data[n]=e.data[n]??{},e.data[n].availableActions=r}},am=(e,t)=>{const n=sm(t),s=Ym();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 void 0===s||s||rm(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:a,navigation:o,settings:i},nextAssignmentInfo:c}=r;if(a&&a.main&&(a.main=a.main.map((e=>"createWork"===e.jsAction?{...e,jsAction:"createCase"}:e))),r.data&&r.data[n]&&(a&&(r.data[n].actionButtons=a),o&&(r.data[n].navigation=o),i&&(r.data[n].settings=i),t&&t[Fs.ACTIONS.DELETEAVIALACTIONS]&&delete r.data[n].availableActions,void 0===s||s||rm(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),c&&(r.data=r.data??{},r.data.nextAssignmentInfo=c),r},om=async e=>{const t=am(e),n=rS.getIn(t,js.COMPONENTS);Jp(t,{},!0),await Ig(n)},im=(e,t,n)=>cS.resolveView(e,t,n),cm=(e,t,n,s)=>{const r=e[t];if(!r)return!1;const a=rS.getIn(r,Fs.CASE_INFO.CASE_INFO_CLASSID);return rS.getIn(r,js.CASE_INFO.VIEW_NAME)===n&&(!s||a===s)},lm=e=>{const{accessedOrder:t,items:n}=e;if(!t||!n)return null;const s=t[t.length-1];return s?n[s]?.context??null:null},um=(e,t="",n="")=>{let s=n||null;if(!s){const n=`${Fs.APP.APP}/primary`;s=((e,t)=>{const n=kC();if(!n)return null;const s=n.getState(),{data:r,containers:a}=s;if(!a||!r)return null;const o=`${Fs.APP.APP}/primary`;if(a[o]){const n=lm(a[o]);if(n&&cm(r,n,e,t))return n}for(const n of Object.keys(a)){if(n===o)continue;const s=lm(a[n]);if(s&&cm(r,s,e,t))return s}return null})(e,t),s||(s=Uy(n))}if(!s)return Promise.reject(new Error(`Unable to find an active context for view "${e}".`));const r=$C(s);if(!r)return Promise.reject(new Error(`No data found for context "${s}".`));const a=rS.getIn(r,Fs.CASE_INFO.CASE_INFO_ID)||"",o=Cm({options:{context:s,pageReference:Fs.CASE_INFO.CASE_INFO_CONTENT}});return pC(),o.getPConnect().getActionsApi().refreshCaseView(a,e,"",{autoDetectRefresh:!0,preserveClientChanges:!1}).finally((()=>{gC()}))};let dm=function(e){return e.CURRENCY="Currency",e.PERCENTAGE="Percentage",e.DECIMAL="Decimal",e.INTEGER="Integer",e.TEXT_SINGLE_LINE="Text (single line)",e.TEXT_PARAGRAPH="Text (paragraph)",e.EMAIL="Email",e.URL="URL",e.PHONE="Phone",e.PICKLIST="Picklist",e.USER_REFERENCE="User Reference",e.BOOLEAN="Boolean",e.DATE_AND_TIME="Date & time",e.DATE_ONLY="Date only",e.TIME_ONLY="Time only",e.IDENTIFIER="Identifier",e.DOUBLE="Double",e.TEXT_ENCRYPTED="Text Encrypted",e.PASSWORD="Password",e}({});const pm=class{constructor(e,t,n){this.meta=e,this.datasource=t,this.index=0,this.options=n,this.datasourceObj=cS.getPropertyValue(t,n.pageReference,n.context)}hasNext(){return this.index<this.datasourceObj.length}next(){if(!this.hasNext())throw new Error("No Children");const e=cS.getContextPath(this.datasource,this.index);return this.index+=1,Cm({meta:this.meta,options:{...this.options,pageReference:e}})}resetIndex(){this.index=0}};class gm{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.index,t=this.children[e];this.index+=1;const n=t?._relativePath??`${this.options?.relativePath??""}.children[${e}]`;return Cm({meta:t,index:this.index,options:{...this.options,relativePath:n}})}resetIndex(){this.index=0}}const hm=(e,t)=>{const n=!!e?.repeat;if(!!e?.["repeat-self"])return new pm(e,e.context||"",t);if(n){const n=zC(`${t.context}.${js.SUMMARY_OF_LISTS}`,e.pageReference,t.context);return new pm(e.children[0],n||e.context,t)}return e?.children?new gm(e.children,t):void 0};class fm{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:s}=e;if(t&&s){const e=t[t.length-1];s[e]&&s[e].view&&Object.keys(s[e].view).length>0&&n.push(s[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=>zg.isProperty(e))).map((e=>zg.getPropertyName(e)))}}const mm=new fm;let Im;Object.freeze(mm);const Em=(e,t,n)=>{e&&(Object.keys(e).forEach((s=>{if("children"!==s){const r=e[s],a=No.trimAnnotation(r);if("string"!=typeof a&&"string"!=typeof r||!(rS.isValidAnnotation(r)&&rS.isPropertyRef(a)||r.startsWith("@W ")||r.startsWith("@DW ")||r.startsWith("@E ")||r.startsWith("@PARAGRAPH ")||r.startsWith("@ATTACHMENT "))){if(Array.isArray(a))a.forEach(((e,n)=>{const r={parentStateObj:t,parentKey:s,isObjHasValue:!!t[s]};t[s]=t[s]||[],t[s][n]=Object.create({}),Em(e,t[s][n],r)}));else if(a&&"object"==typeof a&&"exp"!==a.type){const e={parentStateObj:t,parentKey:s,isObjHasValue:!!t[s]};t[s]=t[s]||{},Em(a,t[s],e)}}else n&&n.parentKey&&(n.isObjHasValue=!0),r.startsWith("@PARAGRAPH ")?t[s]=r:t[s]=a}})),n&&!n.isObjHasValue&&delete n.parentStateObj[n.parentKey])},ym=(e,t)=>{e._inheritedProps=e._inheritedProps||[],e.inheritedProps=[...e._inheritedProps,...rS.deepClone(t.inheritedProps)]};class Am{constructor(e){const{meta:t,isRoot:n,options:s={},useCustomContext:r}=e;this.meta=t,this._isRoot=n,this.options=s,this.useCustomContext=r,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._dataInfo=null,this.viewName=s.viewName,this.parentViewName=s.viewName??"",this._referenceList=s.referenceList||"",this._isInsideList=s.isInsideList||!1,this._inheritedConfig={},this._localeRuleName=s.localeReference,this._containerTarget=s.target,this._readOnly=t?.config?.readOnly||s.readOnly,this._hasSuggestions=!1,this._actionsApi=null,this._classID=null,this.index=e.index,this.categoryName=s.categoryName||"",this._relativePath=s.relativePath??"",s.inheritedConfig&&(this._inheritedConfig=rS.deepClone(s.inheritedConfig)),t?.config?.inheritedProps&&ym(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=ep.formatePageReferenceToArrayIndex(this.meta.config.value)),Em(this._rawConfig,this._stateProps),this._isState=!rS.isObjectEmpty(this._stateProps),this._rawConfig&&this._rawConfig.config&&(this._isExpressionExist=rS.isExpressionExist(this._rawConfig.config),this._isWhenExist=rS.isWhenExist(this._rawConfig.config),this._isValidatorExist=Yp.isValidatorExist(this._rawConfig.config)),this._isRoot?this._contextName=Fs.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=No.handleAnnotation(this.options.pageReference,this)),this._pageReference=cS.getContextPath(a||this.options.parentPageReference,this._pageReference),this._pageReference||(this._pageReference=""),"reference"===this._type&&(this._rawConfig=t);const o="reference"===this._type&&rS.isWhenExist({visibility:this.meta?.config?.visibility}),i=this._checkAndSetDecisionParagraph("instructions",this._rawConfig?.instructions);let c=!1;if("reference"!==this._type&&t&&(this._rawConfig=cS.resolveReference(t,this)),this._rawConfig){const e=this.getRawConfigProps();e&&(this._localeRuleName=No.trimAnnotation(e.localeReference)||s.localeReference,this._isExpressionExist=rS.isExpressionExist(e),this._isWhenExist=rS.isWhenExist(e),this._isValidatorExist=Yp.isValidatorExist(e),c=this._checkAndSetDecisionParagraph("label",e?.label)),this._children=this._rawConfig.children,this._rawConfig?.type?.toLowerCase()===js.VIEW&&this._rawConfig.name&&(this.viewName=No.handleAnnotation(this._rawConfig.name,this)),this.options.hasForm&&IE(this)}(o||i||c)&&gE(this.viewName,this._contextName,this._pageReference)}_checkAndSetDecisionParagraph(e,t){let n=!1;if(t&&t.startsWith(js.PARAGRAPH_ANNOTATION)){const s=No.trimAnnotation(t);n=zf.isDecisionParagraph(s,this.getCurrentClassID()),n&&this.setStateProps({[e]:t})}return n}isDeclarativeTarget(){let e=!1;if(this.getValue(this._pageReference)||""===this._pageReference){const t=No.trimAnnotation(this.getPropertyName()),n=this.getFieldMetadata(t);e=n?.isDeclarativeTarget||!1}return e}_getPropertyName(){const e=No.trimAnnotation(this.getPropertyName());return""===this._pageReference&&e.startsWith(".")?e.substring(1,e.length):e}addFieldNode(){const e=this._getPropertyName(),{value:t,contextPage:n,label:s,required:r,readOnly:a,disabled:o,visibility:i,validationType:c,caption:l,allowMultiple:u,useRFC822Validation:d}=this.getRawConfigProps();if(this.getValue(this._pageReference)||""===this._pageReference){const p="Address"===this._type&&this._rawConfig?.config?.associatedView?No.trimAnnotation(this._rawConfig.config.associatedView):"",g=s||l,h=this._rawConfig?.type,f={target:this._containerTarget,context:this._contextName,pageReference:this._pageReference,propertyName:No.trimAnnotation(t),label:g?.startsWith("@")?No.handleAnnotation(g,this,void 0):g,required:r,readOnly:a,disabled:o,visibility:i||this.options?.visibility,skipRequiredValidation:this.options?.isBulkAction,inheritedProps:this.getInheritedProps(),useCustomContext:this.useCustomContext,value:t,validationType:c,...n&&{contextPageRef:`${this._pageReference}${No.trimAnnotation(n)}`},componentName:h,hasSuggestions:this._hasSuggestions,isInsideList:this.isInsideList(),index:this.index,allowMultiple:u,isDeclarativeTarget:this.isDeclarativeTarget(),...this._type===dm.EMAIL&&{useRFC822Validation:d}};Zu.addFieldNode(this._contextName,this._pageReference,(p||this.categoryName||this.viewName)??"",e,this.getValue(e),f)}}removeNode(){if(Object.hasOwn(this._rawConfig?.config??{},"value")&&"Address"!==this._type)Zu.removeFieldNode(this._contextName,this._pageReference,this.viewName||"",No.trimAnnotation(this.getPropertyName()),this.index);else if("Address"===this._type&&this._rawConfig?.config?.associatedView)Zu.removeViewNode(this._contextName,this._pageReference,No.trimAnnotation(this._rawConfig.config.associatedView),this.index);else{const e=this._rawConfig?.config?.context?`${this._pageReference}${this._rawConfig?.config.context}`:this._pageReference,t={visibility:this.options?.visibility??this._rawConfig?.config?.visibility??this._rawConfig?.config?.referenceVisibility};Zu.removeViewNode(this._contextName,e,this._rawConfig?.config?.name||this._rawConfig?.config?.id||"",this.index,t)}}addViewNode(){if(!this.isReadOnly()){if(this._rawConfig?.type?.toLowerCase()===js.VIEW&&this._rawConfig.name&&this.viewName){const e={visibility:this.options?.visibility??this._rawConfig.config?.visibility??this._rawConfig.config?.referenceVisibility};Zu.addViewNode(this._contextName,this._pageReference,this.viewName,this.parentViewName,e)}"Group"===this._rawConfig?.type&&this._rawConfig?.config?.id&&Zu.addViewNode(this._contextName,this._pageReference,this._rawConfig.config.id,this.parentViewName),"Address"===this._rawConfig?.type&&this._rawConfig?.config?.associatedView&&Zu.addViewNode(this._contextName,this._pageReference,No.trimAnnotation(this._rawConfig.config.associatedView),this.parentViewName),"deferload"===this._rawConfig?.type?.toLowerCase()&&this._rawConfig.config?.name&&Zu.addViewNode(this._contextName,this._pageReference,this._rawConfig.config.name,this.parentViewName)}}addWhenNode(){let e="",t="";const n=rS.getWhenNames(this._rawConfig?.config),s=this.getRawConfigProps();if(s?.type&&s?.type?.toLowerCase()===js.VIEW)t=js.CONTEXT_TREE_NODE_TYPES.VIEW,e=this.getCurrentView();else{t=js.CONTEXT_TREE_NODE_TYPES.FIELD;const n=this.getPropertyName();e=No.isProperty(n)?No.trimAnnotation(n):""}e&&n.forEach((n=>{Zu.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()!==js.VIEW||"Editable"===this._rawConfig.config?.renderMode)&&this._rawConfig?.config?.referenceList&&"DISPLAY_ONLY"!==this._rawConfig.config?.displayMode)){const{value:e,label:t,required:n,contextPage:s,readOnly:r,disabled:a,visibility:o,validationType:i,selectionMode:c,selectionList:l,selectionKey:u,referenceList:d,renderMode:p,caption:g,uniqueField:h}=this.getRawConfigProps(),f=t||g;let m=[];["Multiselect","Checkbox"].includes(this._rawConfig.type)&&(m=this.getSelfReferencingDatapageKeys()),Zu.addPageListNode(this._contextName,this._pageReference,this.viewName??"",No.trimAnnotation(this.getPropertyName()),{target:this._containerTarget,context:this._contextName,pageReference:this._pageReference,propertyName:No.trimAnnotation(this.getPropertyName()),label:f?.startsWith("@")?No.handleAnnotation(f,this,void 0):f,required:n,readOnly:r,disabled:a,...s&&{contextPageRef:`${this._pageReference}${No.trimAnnotation(s)}`},visibility:o||this.options.visibility,skipRequiredValidation:this.options.isBulkAction,inheritedProps:this.getInheritedProps(),useCustomContext:this.useCustomContext,value:e,validationType:i,componentName:this._rawConfig.type,type:this._rawConfig.config?.type,hasSuggestions:this._hasSuggestions,isInsideList:this.isInsideList(),selectionMode:c,selectionList:l,renderMode:p,referenceList:d,selectionKey:u,index:this.index,uniqueField:h,selfReferencingDatapageKeys:["Multiselect","Checkbox"].includes(this._rawConfig.type)?m:void 0});const I=this.getValue(No.trimAnnotation(this.getPropertyName()),this._pageReference)||[];Zu.updatePageListNode(this._contextName,this._pageReference,No.trimAnnotation(this.getPropertyName()),I.length)}this.isWhenExist()&&this.addWhenNode(),this.isVisible()||this.removeNode()}getStateProps(){return this._stateProps}setStateProps(e){rS.mergeDeep(e,this._stateProps)}getMetadata(){return this._rawConfig}getSharedDataPageForReferenceList(){const e=this.getCaseInfo().getClassName(),t=this.getCurrentView();if(!t||!e)return;const n=im(t,this,e);if(!n)return;const s=this.getRawMetadata()?.config?.referenceList;if(!s)return;let r={};"object"==typeof n.config?.parameters&&null!==n.config.parameters&&(r=n.config.parameters);const a=rS.generateDataPageHashWithParameters(r,s,this),o=GC(),i=o?o[s]?.[a]:{};return Array.isArray(i?.[Ls.getDefaultQualifiedName("pxResults")])?i[Ls.getDefaultQualifiedName("pxResults")]:void 0}getCaseInfo(){return this._caseInfo||(this._caseInfo=new Bf(this)),this._caseInfo}getDataInfo(){return this._dataInfo||(this._dataInfo=new $f(this)),this._dataInfo}getCaseLocaleReference(e){const t=this.getRawConfigProps(),n=e||this.getValue(js.getProperty(js.CASE_INFO.CASE_TYPE_ID))||this.getValue(js.CLASS_ID,js.getProperty(js.DATA_INFO.DATA_INFO_CONTENT))||t?.referenceClass||t?.className;return n?tm(Zf,n):null}getListActions(){return Rp(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 cS.getContextPath(e,t)}getContextName(){return this._contextName}getContainerName(){const{type:e}=this.getMetadata()||{},t=[js.CONTAINERS.ROOT_CONTAINER,js.CONTAINERS.VIEW_CONTAINER,js.CONTAINERS.FLOW_CONTAINER,js.CONTAINERS.MODAL_VIEW_CONTAINER,js.CONTAINERS.PREVIEW_VIEW_CONTAINER,js.CONTAINERS.HYBRID_VIEW_CONTAINER],{acTargetName:n=my.PRIMARY,name:s,routingInfo:r}=this.getComponentConfig();return(e&&t.includes(e)||"@ROUTING_INFO"===r)&&s?s: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()}/${js.SUGGESTION}`],n=this.getStateProps()?.value,s=cS.getContextPath(this.getPageReference(),n),r=t?Hf.getSuggestionsContext(this.getContextName()).getField(s):void 0;this._hasSuggestions=!!r,e.hasSuggestions=this._hasSuggestions,this._stateProps.hasSuggestions=this._hasSuggestions}}getConfigProps(e={}){const t={...bp.getDefaultsforType(this._type),readOnly:this._readOnly,...this._rawConfig?.config,...this._additionalRegisteredProps,...this._inheritedConfig},n=Kf.getStrategy(this._type);return n?.applyFallback(t),this.populateSuggestionProps(t),this.resolveConfigProps(t,e),rS.resolveStringBooleans(e)}getLocalizationService(e){const t=this.getComponentName(),n=e||("View"===t?this._rawConfig?.config?.template:t),s=PA.getLocale()??"en-US",r=new nm(s,n),a=this.getCaseLocaleReference();return r.setLookupList(["APP!APPLICATION"]),a&&r.setLookupList([a]),r}getRawConfigProps(){const{_deepProps:e,...t}={...bp.getDefaultsforType(this._type),...this._rawConfig?.config,...this._additionalRegisteredProps,...this._inheritedConfig};return this.populateSuggestionProps(t),t}resolveConfigProps(e,t={}){return e&&(cS.resolveProps(e,t,this),No.handleComponentMapping(t,{type:this.getComponentName()||"",config:e},this)),t}registerAdditionalProps(e={}){return Object.assign(this._additionalRegisteredProps,e),Em(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(),s=this.getComponentConfig(),r=n===js.ROOT_CONTAINER&&"portal"!==e.renderingMode;if(n===js.MODAL_VIEW_CONTAINER||n===js.CASE_CREATE_STAGE||n===js.OBJECTACTIONCONTAINER){const n=xy(`${js.APP.APP}/${this.getContainerName()}`),s=ad({context:n,category:Fs.PAGE});e.pageMessages=t(s),this._stateProps.pageMessages=e.pageMessages}if(this.isEditable()){let{value:t}=this.getStateProps();void 0===t&&"multi"===this.getComponentConfig()?.selectionMode?t=this.getStateProps().selectionList||No.trimAnnotation(this.getRawConfigProps().selectionList):!t&&"Editable"===this.getComponentConfig()?.renderMode&&this.getStateProps().referenceList&&(t=this.getStateProps().referenceList);const n=ad({property:t,pageReference:this.getPageReference(),context:this.getContextName(),type:Fs.MESSAGES.MESSAGES_TYPE_ERROR}),s=ad({property:t,pageReference:this.getPageReference(),context:this.getContextName(),type:Fs.MESSAGES.MESSAGES_TYPE_INFO});if(n&&n[0]){e.validatemessage=n.map((e=>this.getLocalizationService().getLocalizedMessage(e.message).replace(/\.$/,""))).join(". ")+(n[n.length-1].message.endsWith(".")?".":""),e.status=js.FIELD_LEVEL_ERROR,this._stateProps.validatemessage=e.validatemessage,this._stateProps.status=e.status;const s=n?.find((e=>"error"===e.type&&"required"===e.subType));s&&!e.required&&this.isVisible()&&this.clearErrorMessages({property:t,subType:"required"})}s&&s[0]&&(e.infoMessage=s[0].message,e.status=js.FIELD_LEVEL_WARNING,this._stateProps.infoMessage=e.infoMessage,this._stateProps.status=e.status)}if(n===js.ROOT_CONTAINER){const n=ld(r,xy(`${js.APP.APP}/${this.getContainerName()}`));e.httpMessages=Array.isArray(n)?t(n):n,this._stateProps.httpMessages=e.httpMessages;const s=Hf.getSharedState("isLoggedOut");e.isLoggedOut=s,this._stateProps.isLoggedOut=s;const a=ad({context:js.APP.ROOT,category:"PAGE"});e.pageMessages=t(a),this._stateProps.pageMessages=e.pageMessages}if(n===js.HYBRID_VIEW_CONTAINER){const n=ad({context:js.APP.APP,category:js.HTTP});e.httpMessages=t(n),this._stateProps.httpMessages=n}if(n===js.APP_SHELL&&e.portalDocMode===js.CONTAINER_TYPE.MULTIPLE&&(e.activeCases=Kh.getOpenedCaseItems(`${Fs.APP.APP}/${js.PRIMARY}`),this._stateProps.activeCases=e.activeCases),n===js.APP_SHELL){const n=js.APP.APP,s=xy(`${n}/${this.getContainerName()}`),r=[...ad({context:n,category:"PAGE"})||[],...ad({context:s,category:"PAGE"})||[]],a=r.length>0?r:void 0;e.pageMessages=a&&t(a),this._stateProps.pageMessages=e.pageMessages}if(e.value&&n===js.SCALARLIST&&(this._stateProps.value=e.value),n===js.APP_SHELL||n===js.MODAL_VIEW_CONTAINER||n===js.CASE_CREATE_STAGE||s.template===js.CASE_PREVIEW||s.template===js.RULE_PREVIEW){let t=ad({context:js.APP.APP,category:"HTTP"});const n="HYBRID"===PA.getRenderingMode()?`${this.getContextName()}/${this.getContainerName()}`:`${js.APP.APP}/${this.getContainerName()}`,s=ad({context:xy(n),category:"HTTP"});t?s&&(t=t.concat(ad({context:xy(n),category:"HTTP"}))):t=ad({context:xy(n),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===js.VIEW_CONTAINER||n===js.FLOW_CONTAINER||n===js.MODAL_VIEW_CONTAINER||n===js.PREVIEW_VIEW_CONTAINER||n===js.ROOT_CONTAINER||n===js.OBJECTACTIONCONTAINER){if(e.routingInfo=ka(this.getContainerName(),this._contextName),n===js.ROOT_CONTAINER&&(e.rootConfig=fm.getItemView(e.routingInfo,e.renderingMode),this._stateProps.rootConfig=e.rootConfig),this._stateProps.routingInfo=e.routingInfo,n===js.FLOW_CONTAINER||n===js.OBJECTACTIONCONTAINER){const n=ad({context:this.getContextName(),category:js.CASEMESSAGES}),s=this.getContextName();e.caseMessages=n,this._stateProps.caseMessages=e.caseMessages,e.caseViewMode=this.getValue("context_data.caseViewMode"),this._stateProps.caseViewMode=e.caseViewMode;const r=jy(s)[0];if(r){const n=xy(r),s=u?.getStore()?.getState()?.data;s&&n&&(e.lastUpdateTime=s[n]?.caseInfo?.lastUpdateTime,this._stateProps.lastUpdateTime=s[n]?.caseInfo?.lastUpdateTime);const a=ad({context:n,category:Fs.PAGE}),o=ad({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.isAppOffline=$C(js.APP.APP).context_data?.isOffline,e.assignmentNames=this.getCaseInfo().getAssignments()?.map((e=>e.name)),e.childAssignmentNames=this.getCaseInfo().getChildAssignments()?.map((e=>e.name)),n===js.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.isAppOffline=e.isAppOffline,this._stateProps.assignmentNames=e.assignmentNames,this._stateProps.childAssignmentNames=e.childAssignmentNames}else s.template===js.CASE_VIEW||s.template===js.RULE_VIEW||s.template===js.SELF_SERVICE_CASE_VIEW||s.template===js.CASE_PREVIEW||s.template===js.RULE_PREVIEW||s.template===js.OBJECT_PAGE?(e.caseInfo=this.getCaseSummary(),this._stateProps.caseInfo=e.caseInfo):n===js.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:s}=this.getComponentConfig(),{propertyValue:r,propertyAnnotation:a}=this.getPropertyDetails(s,n,t);if(r&&"string"==typeof r&&(r.includes(a)||r.includes(js.ATTACHMENT_ANNOTATION))){const t=No.getPropertyName(r),n=this.getFieldMetadata(t);n&&this.updateConfigData(e,n,t)}}resolvePropertyMetadata(e,t){if(!e)return e;const n=xC(`${this._pageReference}.${t}`,this._contextName);if(e?.additionalInformation&&this.setStateProps({additionalInformation:n}),!Array.isArray(e)){e.additionalInformation=n;const{inputFormat:t}=e;if("string"==typeof t&&t.startsWith("@")){const n=No.handleAnnotation(t,this);"object"==typeof n&&null!==n&&"pattern"in n&&"string"==typeof n.pattern?e.inputFormat={pattern:n.pattern}:e.inputFormat=null}}return e}getFieldMetadata(e){if(!e)return null;const t=e.split(".");if(t.length<2){let t=this.getValue(js.CLASS_ID);return!t&&this._rawConfig&&this._rawConfig.config&&this._rawConfig.config.ruleClass&&(t=this._rawConfig.config.ruleClass),this.resolvePropertyMetadata(oC(e,t),e)}const n=t.pop(),s=t.join(".")?".":"";let r=this.getValue(`${s}${t.join(".")}${js.CLASS_ID}`);return r||(r=rS.resolvePageClass(e,this.getCurrentClassID())),this.resolvePropertyMetadata(oC(n,r),e)}getCurrentPageFieldMetadata(e=null){let t=this.getPageReference().split(".");null!==e&&(t=e.split("."));const n=t.pop();return this.resolvePropertyMetadata(oC(n,this.getValue(`${t.join(".")}${js.CLASS_ID}`)))}getCurrentClassID(){return this._classID??this.getValue(js.CLASS_ID)}getCaseSummary(){const e={...this.getDataObject()[js.getProperty(Fs.CASE_INFO.CASE_INFO)]};return e.CaseID=e.CaseID||this.getValue(js.getProperty(Fs.CASE_INFO.CASE_INFO_PZINSKEY)),{...e,isCaseWideAction:()=>XI(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()[Fs.CASE_INFO.CASE_INFO].stages}getStageID(){return this.getDataObject()[Fs.CASE_INFO.CASE_INFO].stageID}getActions(){return this._actions}isRoot(){return this._isRoot}getRelativePath(){return this._relativePath}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 jg(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?No.handleAnnotation(this._rawConfig?.config?.visibility,this):"string"!=typeof this.options?.visibility||No.handleAnnotation(this.options?.visibility,this)}isReadOnly(){return void 0!==this._readOnly&&("true"===this._readOnly||!0===this._readOnly||"string"==typeof this._readOnly&&!0===No.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 s=n.getConfigProps(),r={includeTypes:["Group","Region","View"],excludeTemplates:["ListView","SimpleTable","StudioTable"]};let a=n._type&&r.includeTypes.includes(n._type)&&!r.excludeTemplates.includes(s.template);if(!!s.highlightedData&&s.highlightedData.length&&s.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 $C(e||this.getContextName())}getImagePath(e){return`${hg.getConstellationServiceUrl()}/v860/${hg.getAppAlias()}/image/${e}?org=${TA.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=hm(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,relativePath:this._relativePath}),n=[];for(;t?.hasNext();){const e=t.next();this.isBulkAction()&&this.#l(e)||n.push(e)}return t?.resetIndex(),n}return[]}setInheritedProp(e,t,n=!1){this._inheritedConfig[e]=t;const s=Object.hasOwn(this._inheritedConfig._deepProps??{},e);(n||s)&&(this._inheritedConfig._deepProps={...this._inheritedConfig._deepProps,[e]:t})}getDeepInheritedProps(){return{...this._inheritedConfig?._deepProps}}getDeepInheritedConfig(){const e=this.getDeepInheritedProps();return Object.keys(e).length>0?{...e,_deepProps:e}:void 0}#u(e){const t=this.getDeepInheritedConfig();return t?{...e,inheritedConfig:{...e.inheritedConfig,...t}}:e}getLocaleRuleName(){return this._localeRuleName}getLocalizedValue(e,t,n){const s=n||this.getLocaleRuleName(),r=s&&t?`${s}#${t}`:s,a=this.getLocalizationService(r).getLocalizedText(e);return a===e?this.getLocalizationService().getLocalizedText(e):a}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?cS.getPropertyValue(e,this.getPageReference(),`${this._contextName}/${js.SUGGESTION}`):cS.getPropertyValue(e,t||this.getPageReference(),this._contextName)}setInheritedConfig(e){if(!e)return;const{readOnly:t,displayMode:n,referenceType:s,hideLabel:r}=e;r&&(this._inheritedConfig.hideLabel=r),s&&(this._inheritedConfig.referenceType=s),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)})),ym(this._inheritedConfig,e))}getInheritedProps(){const e={},t={};return this._inheritedConfig.inheritedProps?.forEach((e=>{t[e.prop]=e.value})),cS.resolveProps(t,e,this),e}setValue(e,t,n,s=!1,r={}){if(!rS.isValidPropertyReference(e))return;let a,o;const{isArrayDeepMerge:i}=r;this.isInsideList()&&this.getListActions().updateProperty(e,t),this.isBulkAction()&&(a=!0,t||(o=!0)),BC({type:"SET_PROPERTY",payload:{reference:cS.getContextPath(this.getPageReference(),e),value:t,initialValue:n,isImplicit:s,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()};iy(n)}getContextDataValue(e,t){return qC(t||this.getPageReference(),e,this._contextName)}updateState(e){const t=this._pageReference.indexOf(js.CASE_INFO.CASE_INFO_CONTENT),n=this._pageReference.indexOf(".");let s=js.CASE_INFO.CASE_INFO_CONTENT;0!==t&&(s=n>0?this._pageReference.substring(n):this._pageReference),BC(fS({context:this._contextName,data:e,rootPageReference:s}))}replaceState(e,t,n={}){if(!rS.isValidPropertyReference(e))return;const{skipDirtyValidation:s=!1}=n;BC({type:"REPLACE_PROPERTY",payload:{reference:cS.getContextPath(this.getPageReference(),e),value:t,context:this.getContextName(),skipDirtyValidation:s}})}reportError(e,t,n){BC(GS(e,t||{},n,t?.formFields))}getComponent(){return Im({getPConnect:()=>this})}createComponent(e,t,n,s){let r=this._pageReference;if(t){const e=zC(`${this.getPageReference()}.${js.SUMMARY_OF_LISTS}`,t,this._contextName);r=cS.getContextPath(e||t,n)||t}else if(s&&s.pageReference){let e=s.pageReference;e=No.handleAnnotation(e,this),r=cS.getContextPath(this._pageReference,e)||""}return Im(Cm({meta:e,index:this.index,options:this.#u({containerName:this.getContainerName(),hasForm:this.options.hasForm,...e.options,pageReference:r,context:this._contextName,target:this._containerTarget,readOnly:this._readOnly||this._inheritedConfig?.readOnly,viewName:this.viewName}),useCustomContext:this.useCustomContext}),s)}getReferencedView(){if(this.meta)return cS.resolveReference(this.resolveConfigProps(this.meta),this)}_resolvePageRef(e){return this.getPageReference().includes(e)||e.startsWith(js.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,Cm({meta:this.getReferencedView(),options:this.#u({...e?this.options:void 0,...t,context:this.getContextName(),pageReference:t.context?this._resolvePageRef(t.context):this.getPageReference(),viewName:this.viewName})})}getContainerManager(){return new Qg(this)}getActionsApi(){return this._actionsApi||(this._actionsApi=new kf(this)),this._actionsApi}getActionManager(){return Dg}doesContextExist(e){return nS(e??this.getContextName())}getGoogleMapsAPIKey(){return cn()}getServerURL(){return rn()}getLoadingStatus(e){let t=null;return e?(t=$C(e),t=t?t.context_data:null):t=this.getDataObject().context_data,!!t&&(!!t.isLoading&&t.isLoading)}clearErrorMessages(e){e?.property?od({type:"error",property:e.property,pageReference:this.getPageReference(),context:this.getContextName(),...e.subType&&{subType:e.subType}}):e?.context?od({type:"error",...e}):(od({type:"error",...e,context:js.APP.APP}),od({type:"error",...e,context:xy(`${js.APP.APP}/${this.getContainerName()}`)}))}resolveDatasourceReference(e){return zC(`${this.getPageReference()}.${js.SUMMARY_OF_LISTS}`,e,this.getContextName())||e}removeFormField(){}addFormField(){}setPageValue(e,t,n){delete e?.classID,this.replaceState(t,e),n?((e,t,n)=>{const s=(e,t)=>{Object.entries(e).forEach((([e,r])=>{if(Array.isArray(r)){const s=PCore.createPConnect({options:{pageReference:n.getPageReference(),context:n.getContextName(),referenceList:`${t}.${e}`}}).getPConnect();Op(s,`${t}.${e}`,{skipStateUpdate:!0});for(let e=0;e<r.length;e+=1)Ap(r[e],e,s,void 0,{})}else"object"==typeof r&&s(r,`${t}.${e}`)}))};s(e,t)})(e,t,this):LI(this.getContextName(),`${this.getPageReference()}${t}`,this.getStateProps()?.value??"")}acceptSuggestion(e){if(this.getStateProps()?.value&&this.options.hasForm&&this._hasSuggestions){const t=Hf.getSuggestionsContext(this.getContextName()),n=this.getStateProps()?.value||e,s=cS.getContextPath(this.getPageReference(),n),r=t.getField(s);this._hasSuggestions=!1,this.getActionsApi().updateFieldValue(n,r),this.getActionsApi().triggerFieldChange(n,r),t.removeField(s,{actionPerformed:"accepted"})}}ignoreSuggestion(e){if(this.getStateProps()?.value&&this.options.hasForm&&this._hasSuggestions){const t=this.getStateProps()?.value||e,n=cS.getContextPath(this.getPageReference(),t);this._hasSuggestions=!1,Hf.getSuggestionsContext(this.getContextName()).removeField(n,{actionPerformed:"ignored"});const s=Ao.getDependencies(this._contextName,n);s?.forEach((e=>{Hf.getSuggestionsContext(this.getContextName()).removeField(e,{actionPerformed:"ignored"})}))}}getSelfReferencingDatapageKeys(){const e=[],t=this.getPropertyName(),n=this.getFieldMetadata(t),{datasource:{parameters:s={}}={}}=n||{};return Object.values(s).forEach((n=>{const[,s]=n.split("."),r=t?.split(".").pop();s===r&&e.push(n.substring(n.lastIndexOf(".")+1))})),e}isReadOnlyField(){const{value:e,datasource:t,listType:n}=this.getComponentConfig(),{propertyValue:s,propertyAnnotation:r}=this.getPropertyDetails(n,t,e);if(!s||"string"!=typeof s||!s.includes(r)&&!s.includes(js.ATTACHMENT_ANNOTATION))return!1;const a=No.getPropertyName(s),o=this.getFieldMetadata(a);if(!o)return!1;const i={...this.getComponentConfig(),fieldMetadata:o,template:this._rawConfig?.config?.template};return this.#d(i,a)}#d(e,t){const n=zg.isPropertyInternal(t),s=e.datasource,r=this.getComponentConfig().isSearchField,{isClassKey:a,isSpecial:o,isDeclarativeTarget:i}=e.fieldMetadata??{},c="DataReference"===e.template||"ObjectReference"===this.meta?.type,l=e.listType!==js.ASSOCIATED;return!r&&!!(i||n||!s&&(a&&!c||o)&&l)}getPropertyDetails(e,t,n){return e===js.ASSOCIATED?{propertyValue:t,propertyAnnotation:js.ASSOCIATED_PROPERTY_ANNOTATION}:{propertyValue:n,propertyAnnotation:js.PROPERTY_ANNOTATION}}updateConfigData(e,t,n){e.fieldMetadata=t,t.additionalInformation&&(e.additionalInformation=t?.additionalInformation),t.inputFormat&&"string"!=typeof t.inputFormat&&(e.inputFormat=t.inputFormat),this.#d(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}))}#l(e){const t=e.getPConnect().getComponentName(),n=e.getPConnect().getConfigProps().template;return!(!0===fm.allowedComponetsForBulkProcessing[t]||!0===fm.allowedComponetsForBulkProcessing[t]?.[n])}}function Cm(e){const t=new Am(e);return{getPConnect:()=>t}}function Sm(e){Im=e}const _m={CASE_INFO:`${js.DATA}.${js.CASE_INFO.CASE_INFO}`,CASE_CLASS_NAME:`${js.DATA}.${js.CASE_INFO.CASE_TYPE_ID}`,NEXT_ASSIGNMENT_INFO_ID:`${js.DATA}.${js.NEXT_ASSIGNMENT_INFO_ID}`,ASSIGNMENTS:`${js.DATA}.${js.CASE_INFO.ASSIGNMENTS}`,CASE_INFO_ID:`${js.DATA}.${js.CASE_INFO.CASE_INFO_ID}`,CASE_FIRST_FLOW_ACTION_NAME:`${js.DATA}.${js.CASE_INFO.ASSIGNMENTACTION_ID}`,CASE_FIRST_ASSIGNMENT_ID:`${js.DATA}.${js.CASE_INFO.ASSIGNMENT_ID}`},Nm=(e,t)=>{const{vcName:n,containerName:s}=t;return s||n||Og.getTargetViewContainerName(e)},Tm=e=>{const t=e.lastIndexOf(js.FORWARD_SLASH_STRING)+1,n=e.lastIndexOf(js.UNDERSCORE_STRING);return e.substring(t,n)},Dm=e=>e===my.WORKAREA,Pm=e=>e===my.MODAL,Om=e=>e===Fr,Rm=e=>e===Tr,bm=e=>e&&e.find((e=>e.type===Tr)),vm=e=>rS.getIn(e,_m.CASE_INFO,{}),xm=e=>e?e.split(" ").pop():void 0,wm=e=>rS.getIn(e,_m.CASE_CLASS_NAME,js.EMPTY_STRING),Mm=(e,t=!1)=>{const n=t?Lg(e):vm(e);return QI(n)&&JI(PA.getOperatorIdentifier(),n)},Lm=e=>rS.getIn(e,_m.CASE_INFO_ID,js.EMPTY_STRING),Um=e=>rS.getIn(e,_m.CASE_FIRST_ASSIGNMENT_ID,js.EMPTY_STRING),Fm=(e,t)=>{const{removeActionPayload:n,target:s}=t;if(n&&n.containerItemID){const{containerItemID:t,context:r}=n;e.push($S(LS,{containerItemID:t,context:r||Ly(t),target:s}))}},jm=e=>{const t=e.context;if(YI.shouldUseUnifiedHandling()){const e=Qy(t),{accessedOrder:n=[],type:s}=yy(e),r=n.filter((e=>e!==t));BC(LS({containerItemID:t,context:t,target:e,containerInfo:{newAccessedOrder:r,containerType:s}}))}else Jy(t,{skipDirtyCheck:!0})},Vm=e=>{const t=kC();if(!e)return!1;const n=Ws(e),s=Qy(n),r=Qy(e);if(!s||!r)return!1;const a=Cy(s,n),o=Cy(r,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},km=(e,t,n={})=>{const{skipFlowNameUpdate:s}=n,r=Lm(t);rS.setIn(e,"key",r);const a=QI(vm(t));if(!s&&(e=>{const t=rS.getIn(e,_m.ASSIGNMENTS,[]);return t&&t.length>0})(t)){const n=Um(t),[,s]=n.split("!");o={assignmentID:n,isInCreateStage:a},fd.publish(js.PUB_SUB_EVENTS.CASE_EVENTS.CURRENT_ASSIGNMENT_UPDATED,o),rS.setIn(e,"flowName",s)}var o},Bm=(e,t)=>{const{attachmentsExist:n}=t;n&&rS.setIn(e,Fs.SUMMARY_OF_ATTACHMENTS_LAST_REFRESH_TIME,(new Date).toLocaleString()),rS.setIn(e,Fs.SUMMARY_OF_ASSIGNMENT_LAST_SUBMIT_TIME,(new Date).toLocaleString())},$m=(e,t,n)=>{let s=js.PROMISE_VALUE.RESOLVE;return bm(e)?(s=js.PROMISE_VALUE.REJECT,n?Dg.rejectActionByID(t,!0,n):Dg.rejectActionByID(t)):Dg.resolveActionByID(t),s},Gm=e=>YI.isCoexistenceCase(e),Wm=()=>"true"===PA?.environmentInfoObject?.pxMashupDetails?.pyLaunchCaseInModal,Hm=(e,t,n,s)=>{const{containerItemID:r}=t;if(r){const{caseClassName:a,skipAssignmentsUpdate:o}=s,i=Ws(r),c=Qy(i),l=c&&yy(c),u=c&&xy(c),d=Ys(i),p=n?.data?.caseInfo?.ID;u&&l?.items?.[u]?.key===t?.caseID&&e.push($S(IS,{containerItemID:i,context:i,container:d,containerName:d,caseId:p,viewName:js.getDefaultQualifiedName(Fs.CASESUMMARY_VIEW_NAME),updateData:!0,viewLoadingContainer:{context:i},caseClassName:a,...void 0!==o&&{skipAssignmentsUpdate:o}}))}},qm=async(e,t)=>{const{context:n,containerItemID:s,shouldUpdateCaseActionsInParentContext:r}=e,a=t?.data?.caseInfo?.ID?Lm(t):void 0;if(!n||!a)return;const o=a?`${a}_actionsLoading`:"actionsLoading";try{const i=new Am({}),c=new Bf(i);Ng.setComponentCache(o,!0);const l=t?.data?.caseInfo?.caseTypeID?wm(t):void 0,u=await c.getCaseActions(a,n,{caseTypeID:l});rm(t);const d=rS.getIn(t.data,js.getProperty(js.CASE_INFO.CASE_INFO_ACTIONS)),p=Array.isArray(u.availableProcesses)&&u.availableProcesses.length>0?{availableProcesses:u.availableProcesses}:[],g=u?.availableActions,h=["pyUpdateCaseDetails"],f=Array.isArray(g)&&g.find((e=>h.includes(e.ID))),m={data:{caseInfo:{availableActions:[...u.availableActions,...void 0!==d?d:[]],...p,editActions:f?[f]:[]}}};Ng.setComponentCache(o,!1),BC($S(fS,{context:n,...m})),!0===r&&s&&(async(e,t)=>{const{containerItemID:n,caseID:s}=t;if(n){const t=Ws(n),r=Qy(t),a=r&&yy(r),o=r&&xy(r);o&&a?.items?.[o]?.key===s&&BC($S(fS,{context:t,...e}))}})(m,e)}catch(e){Ng.setComponentCache(o,!1),console.error("Error fetching case actions:",e)}},zm=(e,t)=>{const n=wm(e?.response),s=vm(e?.response),{caseTypeID:r}=s,a=PA.getFeatureMap();(a?.deferUpdateCaseSummaryView??!Object.hasOwn(a,js.DEFER_UPDATE_CASESUMMARY_VIEW))&&r&&Hm(t,e?.actionInPayload,e?.response,{caseClassName:n,skipAssignmentsUpdate:!e?.actionInPayload?.context?.includes(js.PREVIEW)})},Ym=()=>PA.isOptimizedCaseLoadingEnabled(),Km=(e,t)=>{Ym()&&qm(t,e)},Qm=e=>$C(e)?.context_data?.caseViewMode,Jm=e=>!(!Ng.getComponentCache("redirectionInProgress")||!e)&&($m([],e),!0);const Xm=new class{confirmHandler=null;registerConfirmHandler(e){this.confirmHandler=e||null}confirm(e){return this.confirmHandler?this.confirmHandler(e):Promise.resolve(window.confirm(e))}},Zm=Xm,{RESOURCE_TYPES:eI}=Fs,tI={PAGE:"page",FORM:"form"},nI={[eI.CASE]:[Qr,Yr,Kr],[eI.OBJECT]:[Ma,La,Fa],[eI.PAGE]:[Wr,qr],[eI.DATA]:[Hr],ASSIGNMENT:[oa]},sI=(e,t,n={})=>{if(!e)return{};const s={etag:e.etag},{RemoteSystemID:r}=n;return e[Fs.REMOTE_SYSTEM_ID]||e[Fs.REMOTE_SYSTEM_ID.toLowerCase()]||r?s.RemoteSystemID=e[Fs.REMOTE_SYSTEM_ID]||e[Fs.REMOTE_SYSTEM_ID.toLowerCase()]||r:t&&Bs.isRemoteCase(t)&&(s.RemoteSystemID=Bs.getRemoteHeader(t)),s},rI=(e,t={})=>{const{onlyChangedData:n=!1,nonEmptyAndChangedData:s=!1,skipUUID:r=!0,isTransientContext:a=!1,includeDisabledFields:o=!1,isObjectWideAction:i,isExternalObject:c}=t;let l={};l=BI(e,{isTransientContext:a,includeDisabledFields:o,isObjectWideAction:i,isExternalObject:c}),n&&(delete l?.caseInfo?.content,a&&(l={}));const u=ty(e,!1),d=$C(e),p=jn(d,js.CASE_INFO.CASE_INFO_ENCRYPTED_CONTENT),g=void 0!==p;!a&&s&&((e,t)=>{Object.entries(e?.caseInfo?.content).forEach((([n,s])=>{const r=$C(t),a=jn(r,Fs.CASE_INFO.CASE_INFO_CLASSID),o=oC(n,a);("True-False"===o?.type&&!s||""===s)&&delete e.caseInfo.content[n]}))})(l,e);const h=vs(u,l);let f={};({content:f}=((e,t,n=!1,s=!1)=>{let r={};const a=YI.shouldUseUnifiedHandling()||!n&&!s?t?.caseInfo:t?.objectInfo;return(e||a)&&(r=e?{...t}:{...a}),{content:r}})(a,h,i,c));const m=[...Ip(e)];if(r){const e=Ls.getDefaultQualifiedName("EmbedListUUID__");m.forEach((t=>{delete t.content?.EmbedListUUID__,delete t.content?.[e]}))}f.pageInstructions=m;if((dp[e]||[]).forEach((e=>{if(f?.content){const t=e?.replace(js.getProperty(js.CASE_INFO.CASE_INFO_CONTENT),"");rS.deleteIn(f.content,(e=>{if(!e)return"";const t=e.split(".");let n,s="";for(n of t)if(n){if(n.includes("[")&&n.includes("]"))return s+=`['${n.substring(0,n.lastIndexOf("["))}']`,s;s+=`['${n}']`}return s})(t))}})),g&&(f.encryptedContent=p),!a&&h?.dataInfo)return f={...h.dataInfo,pageInstructions:f.pageInstructions},{content:f};const I=HC(Ls.getQualifiedNameForComplexRuleReferences(".pzAdditionalPayload"),js.CASE_INFO.CASE_INFO_CONTENT,e);return f.content&&I&&(f.content[Ls.getDefaultQualifiedName("pzAdditionalPayload")]=I),{content:f}},aI=(e,t)=>{let n,s,r={};const a=rS.getIn(e,js.UI_RESOURCES),o=rS.getIn(e,"confirmationNote");a?(n=rS.getIn(e,js.UI_RESOURCES_CONTEXT_DATA),s=rS.getIn(e,js.ROOT),r=rS.getIn(e,js.ACTION_BUTTONS)):o&&!t.isActiveWorkAreaPrimaryAndWorkareaAbsent&&(s={});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 g=rS.getIn(e,"nextAssignmentInfo",null),h=rS.getIn(e,"nextAssignmentInfo.context",""),f=rS.getIn(e,"confirmationLinks",null),{isInCreateStage:m,openCaseViewAfterCreate:I,debugInfo:E,isExternalObjectCreationFlow:y,isExternalCaseCreationFlow:A}=t;return{data:{...i,key:d,flowName:l,coreHeaders:E&&{debugInfo:{[js.COREHEADER_APP_DEBUG_ID]:E.debugId}},[js.getProperty(js.CASE_INFO.CASE_INFO)]:{...i[js.getProperty(js.CASE_INFO.CASE_INFO)],actionButtons:r,headers:t.headers},[js.CONTEXT_DATA]:m?{...i[js.CONTEXT_DATA],...n,openCaseViewAfterCreate:I,errors:c,...y&&{isExternalObjectCreationFlow:y},...A&&{isExternalCaseCreationFlow:A}}:{...i[js.CONTEXT_DATA],...n,errors:c}},semanticURL:u,nextAssignmentInfo:g,assignmentContext:h,confirmationLinks:f,key:d,root:s,...t}},oI=async(e,t,n,s=!1,r=!1)=>{const a=rS.getIn(e,js.COMPONENTS);if(a)try{await Ig(a)}catch(e){console.error(e)}const o={actionConfig:t,...n};s?f_({...e,options:o,directUrlUpdation:!0}):Jp(e,o,r)},iI=(e="")=>{const t=e.indexOf(" "),n=e.indexOf("!");return e.substring(t+1,n)},cI=e=>{if(e){const[,t]=e.split("!");return{key:iI(e),flowName:t}}return{}},lI=(e,t,n,s)=>{switch(!0){case Boolean(e[js.ERROR_IN_PAGE_IDENTIFIER]&&e[js.ERROR_FIELD_IN_PAGE]):{const r=`${e[js.ERROR_FIELD_IN_PAGE]}`.replace(/(\(\d+\))/g,(e=>`[${parseInt(e.substring(1,e.length-1),10)-1}]`)),a=`${r}${e[js.ERROR_IN_PAGE_IDENTIFIER]}`,o=rS.deepClone(e);o[js.ERROR_FIELD_IN_PAGE]=r,t.includes(a.slice(1))||t.includes(a.substring(a.indexOf(".")+1,a.indexOf("[")))||t.includes(a.substring(a.indexOf(".")+1,a.indexOf("(")))?s.push(o):n.push(e);break}case Boolean(e[js.ERROR_IN_PAGE_IDENTIFIER]&&!e[js.ERROR_FIELD_IN_PAGE]):{const r=e[js.ERROR_IN_PAGE_IDENTIFIER].slice(1);t.includes(r)?s.push(e):n.push(e);break}default:n.push(e)}},uI=e=>{const{payload:t}=e,{err:n,context:s,actionMgrID:r}=t,a=n&&n.response?n.response.data:"",o=HI(s);return r&&Dg.rejectActionByID(r,!0,n),$S(GS,"Error action triggered",a,s,o)},dI=(e,t)=>By(e)&&Gy(e)?$S(jS,t):$S(_S,t),pI=(e,t)=>{t&&e.caseInfo?.content&&(e.caseInfo.content.remoteCaseMeta=t)},gI=(e,t,n=js.APP.APP,s={})=>{let r=null;const{buildNew:a=!0}=s;return By(e)?r=Gy(e)?xy(e):Hs(t,n):$y(e)&&(Gy(e)&&!a?r=Uy(e):Gy(e)&&!a||(r=Hs(t,n))),r},hI=e=>e&&e.type===Or,fI=e=>{let t=!1;const n=Vy(e);for(let e=0;e<n.length;e+=1){const s=n[e];if(s&&cy(s)){t=!0;break}}return t},mI=async(e,t={})=>{let n=!1,s=!1,r={},a=!0,o=!1,i=!1;const{showConfirmDialogForMaxDocumentLimitReached:c=!1,dirtyMessage:l,skipChildDirtyState:u=!1,loadingContext:d}=t,p=xA();if(By(e)){const t=xy(e);if(!t)return{continueExecution:a,removeActionPayload:r};const s=Ly(t);cy(s)&&(n=!0),u||n||(n=fI(t))}else if($y(e)&&qy(e)){let t=Ky(e);t||(t=xy(e),s=!0),r.containerItemID=t,r.context=Ly(t)}if(n){const t={context:d||e};Tg.disableLoadingIndicator(t);const n=l||ZE;o=await Zm.confirm(p.getLocaleValue(n,"Messages")),Tg.enableLoadingIndicator(t)}if(!o&&n&&(r={},a=!1),s){const t={context:d||e};Tg.disableLoadingIndicator(t);const n=p.getLocaleValue(ey,"Messages");c?i=await Zm.confirm(n):(await Zm.confirm(n),a=!1),Tg.enableLoadingIndicator(t)}return!i&&s&&(r={},a=!1),{continueExecution:a,removeActionPayload:r}},II=(e,t)=>{let n=!1;const s=PA.isCoexistenceAppOfType(js.APP_TYPE.UIKIT),{insKey:r,isParallelCall:a,skipFlowNameCheck:o}=t;if(!r)return{};const[,i]=r.split("!")||"",c=o?r:iI(r),l=Py(e,c);let u={},d=!1;if(l&&!s&&((e,t)=>{const n=Cy(e,t);return n?.resourceType})(e,l)===t?.type&&(n=!0,u=Cy(e,l),!o)){let e=u?.flowName;const t=Tm(l),s=Fy(l);if(s.length){const n=((e,t)=>e?.includes(js.WORKAREA)?js.WORKAREA:t)(s[0],t),r=Va(n,s[0]);e=Cy(r,s[0])?.flowName}else n=e===i;(e!==i||a)&&(d=!0)}return n=((e,t)=>!t&&e)(n,t.forceRefresh),{activate:n,activateContainerActionPayload:{target:e,isParallelAssignment:d,containerItemID:l,semanticURL:u.semanticURL,insKey:r}}},EI=(e,t,n)=>e===eI.PAGE?((e,t={})=>{let n=!1;const{semanticURL:s}=t,r=Py(e,s);return r&&(n=!0),{activate:n,activateContainerActionPayload:{target:e,containerItemID:r,semanticURL:s}}})(t,n):e===eI.ASSIGNMENT?II(t,{...n,type:e}):e===eI.CASE||e===eI.OBJECT?II(t,{...n,skipFlowNameCheck:!0,type:e}):{},yI=e=>{if(e){const t=(e=>{const t=Sy(e);if(!t)return null;for(const[e,n]of Object.entries(t))if(!n.key&&n.resourceType===Fs.PAGE)return e;return null})(e);if(t)return{activate:!0,activateContainerActionPayload:{target:e,containerItemID:t,semanticURL:""}}}return{activate:!1}},AI=(e,t,n)=>{const{semanticURL:s,isDefaultNavPage:r}=((e,t)=>{const n=a_(Wr,{page:e,pageClass:t}),s=kC()?.getState()?.data?.app?.pyPortal?.pyPrimaryNavPages,r=Array.isArray(s)?s[0]:void 0;return{semanticURL:n,isDefaultNavPage:!(r?.pyRuleName!==e||r?.pyClassName!==t)}})(e,t);if(n&&s&&!r){const e=EI(eI.PAGE,n,{semanticURL:s});if(e.activate)return{semanticURL:s,activate:!0,activateContainerActionPayload:e.activateContainerActionPayload}}if(r){const e=yI(n);return e.activate?{semanticURL:s,...e}:{semanticURL:"",activate:!1}}return{semanticURL:s,activate:!1}},CI=(e,t)=>(e?.data?.caseInfo&&t?.caseInfo?.content&&(e.data.caseInfo.content=t?.caseInfo?.content),e),SI=(e=[])=>{Gy(`${js.APP.APP}/${js.PREVIEW}`)&&e.push($S(SS,zy({context:Fs.APP.APP,name:js.PREVIEW})))},_I=e=>{let t;for(const n of Object.keys(nI))if(nI[n].includes(e)){t=n;break}return t},NI=(e,t,n="",s={})=>{const{data:r={},context:a,caseViewMode:o,skipMergeAssignmentsAndActions:i=!0}=e,c={data:{...r},caseViewMode:o,context:Ws(a)};rS.deleteIn(c.data,"shared"),rS.setIn(c.data,["context_data","caseViewMode"],o),t.push({type:ha,payload:{context:c.context,skipMergeAssignmentsAndActions:i}});const l=n&&![Fs.CASE_INFO.CASE_INFO_CONTENT,Fs.DATA_INFO.DATA_INFO_CONTENT].includes(n),{propertiesToReplace:u=[]}=s;t.push($S(fS,{...c,...l&&{uiRootReference:n}},...u.length>0?[{propertiesToReplace:u}]:[]))},TI=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=rS.getIn(t,["payload","assignmentContext"]);if("other"===n||"remote"===n){const s=rS.getIn(t,["payload","nextAssignmentInfo","ID"]);if(t?.payload?.isProcessAction){const n={acName:rS.getIn(t,["payload","target"]),caseID:t.payload.data.caseInfo.ID,containerItemID:rS.getIn(t,["payload","context"]),context:rS.getIn(t,["payload","context"])},s={type:mr,payload:{...n}};e.push(s),e=e.filter((e=>delete e?.payload?.data?.caseMessages)),BC(e),e=e.filter((e=>e.type!==mr))}const r=((e,t,n)=>({assignmentID:e,vcName:js.PRIMARY,targetContainerName:rS.getIn(t,["payload","target"]),context:rS.getIn(t,["payload","context"]),..."other"===n&&{isChild:!0},isProcessAction:t?.payload?.isProcessAction,..."remote"===n&&{isRemote:!0},..."remote"===n&&{remoteClassName:t.payload.nextAssignmentInfo.className}}))(s,t,n);By(r.targetContainerName)||t?.payload?.containerName!==js.WORKAREA||(r.isMultiDoc=!0,e=[]);const a={type:Ir,payload:{...r}};e.push(a),BC(e)}else BC(e)}},DI=(e,t)=>vs(e,t,(function(e,t){if(Array.isArray(e))return e.concat(t)})),PI=e=>{let t={},n=IA(e);for(;n;){const e=rI(n);t=DI(e.content,t),n=IA(n)}return t},OI=e=>{e?.containerItemID&&Hf.updateState(e.containerItemID,"traditionalGadgetId",YI.getUniqueGadgetId(),{skipDirtyValidation:!0})};class RI{static getChanges(e){return{...ty(e)}}static getSubmitData(e,t){const{isTransientContext:n=!1,includeDisabledFields:s=!1,onlyChangedData:r=!1}=t||{},{content:a}=rI(e,{isTransientContext:n,includeDisabledFields:s,onlyChangedData:r});return a}static isStateModified(e){return cy(e)}static hasUnsavedChanges(e){return cy(e)||Pp(e??null)}static resetComplexObjectDirtyStatus(e){return ry(e)}static isFormValid(e,t){return GI(e,t)}static clearChangedProperties(e){return Ep(e),mp(e),uy(e)}static getEditableFields(e){return qI(e)}static setCustomValidator(e,t){Yp.register(e,t)}static isPropertyEditable(e,t){return RI.getEditableFields(e).some((e=>e.name===t))}}const bI=RI;const vI=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,s){const r=`${n}${t}`,{stateMachine:a}=this.getStateMachineObjByPath(r,e,!0,!0),o=(t,n,s=!1)=>{const r=s?this.states:this.unConnectedStates;r[e]||(r[e]={}),r[e][t]||(r[e][t]={}),r[e][t]=n};if(a&&a.targetPageReference!==s.targetPageReference)return a.addChild(s),void o(r,s);const i=Object.entries(this.states[e]||{}).filter((([e])=>{if(e.includes(r)){const t=e.substring(0,r.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],s.addChild(n),o(t,n)})),this.states[e][r]=s):o(r,s,!0)}buildPageInstructionsByContext(e,t){const n=this.getStateMachinesByContext(e)||{},s=[];return Object.keys(n).sort().forEach((r=>{const a=Zu.getContextReferences(e)?.get(r),o=a&&cS.resolveContextTreeNodeProps(a.props)||{},i=n[r];if(a&&!0!==o.readOnly){const e=i.buildSubmitPageInstructions(t);s.push(...e)}else if(i.hasEncryptedContent){const e=i.buildSubmitPageInstructions(t).filter((e=>void 0!==e.encryptedContent));s.push(...e)}else a||this.setStateMachineEmpty(e,r)})),s}buildClientChangeList(e){const t=this.getStateMachinesByContext(e)||{};let n={};const s={};return Object.keys(t).forEach((e=>{const s=t[e].getChangeList();n={...n,...s}})),rS.flatten(n,"",s),s}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,n.hasEncryptedContent=!1;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 s=n.substring(n.lastIndexOf("."));n=n.substring(0,n.lastIndexOf(".")),n&&s&&gp(t,s,n)}getStateMachineObjByPath(e,t,n,s=!1){const r=/\[\d+\]$/gm,a=e;let o;for(;e&&!this.isStateMachineExist(t,"",e);){const i=Qy(t),c=Cy(i,t)||{},l=c?.isPageGroup||c?.subscriptFieldName||"string"==typeof c?.index;if(o=null,n&&e.endsWith("]")){if(o=e.match(r),o=o?.[o.length-1]?.substring(1,o[o.length-1].length-1),[e]=e.split(r),!s&&!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,s=!0,r={}){const{stateMachineTarget:a,index:o}=this.getStateMachineObjByPath(t,e,s);if(!a)return!1;const i=Qy(e),c=Cy(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={[wI(l)]:n},p=this.getStateMachine(e,"",a);if(null!==o)if(u){const t=Ip(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,r.skipStateUpdate??!0,r)})),p?.update(d,o,r.skipStateUpdate??!0,r)}else p?.update(d,Number(o)+1,r.skipStateUpdate??!0,r);else p?.updatePage(rS.unflatten(d));return!0}setUniqueField(e,t,n){const s=Zu.getContextReferences(e)?.get(n)?.props?.uniqueField;s&&(t.content||(t.content={}),t.content[wI(s)]=crypto.randomUUID())}getBasePageReference(e){return HC(Fs.DATA_INFO.DATA_INFO_CONTENT,"",e)?Fs.DATA_INFO.DATA_INFO_CONTENT:Fs.CASE_INFO.CASE_INFO_CONTENT}mergeServerPageInstructions(e,t){t.forEach((t=>{if(t.target){const n=rS.convertClipboardPageToPageRefNotation(t.target),s=`${this.getBasePageReference(e)}${n}`;if(!this.isStateMachineExist(e,s,"")){const t=s.substring(s.lastIndexOf(".")),n=s.substring(0,s.lastIndexOf("."));gp(e,t,n)}const r=this.getStateMachine(e,s,"");"INSERT"===t.instruction&&this.setUniqueField(e,t,s),void 0!==t.encryptedContent&&r&&(r.hasEncryptedContent=!0),r?.insertNode(t)}}))}registerForServerChanges(){UC.registerForListChanges(((e,t,n)=>{setTimeout((()=>{this.generatePageInstructions(e,t,n)}),0)}))}registerForServerChangesSync(){UC.registerForListChanges(((e,t,n)=>{this.generatePageInstructions(e,t,n)}))}generatePageInstructions(e,t,n){const s="].";if(!t.includes(".classID")&&bI.isPropertyEditable(e,t)&&this.executeStateMachine(e,t,n),!t.includes(".classID")&&t.includes(s)){const r=t.substring(0,t.lastIndexOf("[")),a=bI.getEditableFields(e);if(["multiselect","checkbox"].includes(a.find((e=>e.name===r))?.type)){const a=Zu.getContextReferences(e),o=a?.get(r),i=t.substring(t.lastIndexOf(s)+2);o?.props.selfReferencingDatapageKeys?.includes(i)&&this.executeStateMachine(e,t,n)}}}unRegisterForServerChanges(){UC.unRegisterForListChanges()}},xI={},wI=e=>e.startsWith(".")?e.substring(1):e,MI=e=>{delete xI[e]},LI=(e,t,n)=>{const s=wI(t);xI[e]?xI[e].fieldOrder[s]=n:xI[e]={fieldOrder:{[s]:n}}},UI=(e,t={})=>{const{includeDisabledFields:n=!1}=t,s=cS.resolveContextTreeNodeProps(e),r=!0!==s.readOnly&&!1!==s.visibility&&(n||!0!==s.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&&r},FI=(e,t,n,s,r)=>(vI.executeStateMachine(e,s,cS.getLitePropertyValue(n,t))||r.push(s),r),jI=(e,t,n)=>{const s=t.isInsideList,{ignoreFieldsInsideList:r=!0}=n;return(!s||s&&!r)&&!Array.isArray(cS.getLitePropertyValue(t,e))&&!(t.componentName&&["Address","Attachment"].includes(t.componentName))},VI=(e,t={})=>{let n=[];const s=[],r=Zu.getContextReferences(e);return r?(({editableFormFieldsReferenceList:n}=((e,t,n)=>{const{includeDisabledFields:s=!1}=n;let r=[];for(const[a,o]of e){const e=cS.resolveContextTreeNodeProps(o.props),i=e.propertyName;UI(o.props,{includeDisabledFields:s})&&jI(a,e,n)&&(r=FI(t,i,e,a,r))}return{editableFormFieldsReferenceList:r}})(r,e,t)),xI[e]&&s.push(...Object.keys(xI[e].fieldOrder??{})),{formInputs:n,formPageFields:s}):{formInputs:n,formPageFields:s}},kI=e=>{let t=[];const n=Zu.getContextReferences(e);if(n)for(const[e,s]of n){const n=s?.props;if(UI(n)&&"Attachment"===n?.componentName){const s="true"===n?.allowMultiple;t=[...t,{type:"File",allowMultiple:s,fullPath:e}]}}return t},BI=(e,t={})=>{const n={},s=$C(e),{ignoreFieldsInsideList:r=!0,isTransientContext:a=!1,includeDisabledFields:o=!1,isObjectWideAction:i=!1,isExternalObject:c=!1}=t,l=((e,t,n)=>YI.shouldUseUnifiedHandling()||!e&&!t?n?.caseInfo:n?.objectInfo)(i,c,s);if(a||l){const{formInputs:t,formPageFields:i}=VI(e,{ignoreFieldsInsideList:r,includeDisabledFields:o});((e,t,n)=>{e.forEach((e=>{let s=rS.getIn(t,e);"object"==typeof s&&(s=rS.deepClone(s),delete s?.classID),rS.buildObject(e,n,s)}))})(i,s,n),t&&t.length>0?t.forEach((e=>{rS.buildObject(e,n,rS.getIn(s,e))})):a||rS.buildObject(Fs.CASE_INFO.CASE_INFO_CONTENT,n,{})}if(!a&&s?.dataInfo?.content){const{formInputs:t}=VI(e,{ignoreFieldsInsideList:r});t.forEach((e=>{rS.buildObject(e,n,rS.getIn(s,e))}))}return n},$I=(e,t,n)=>{const s=""===t&&n?.startsWith(".")?n.substring(1,n.length):n,r=Zu.getContextReferences(e)?.get(`${t}${s}`)?.props;return r?cS.resolveContextTreeNodeProps(r):r},GI=(e,t)=>{const n=Zu.getContextReferences(e);let s=!0;if(!n)return s;for(const[e,r]of n){const n=cS.resolveContextTreeNodeProps(r.props);if(UI(r.props)&&(!t||e.includes(t))){const e=Yp.validate(n.componentName?.toLowerCase(),n.propertyName,cS.getLitePropertyValue(n,n.propertyName),n);s&&(s=!e.message)}}return s},WI=e=>{const t=Zu.getContextReferences(e);if(t)for(const[,e]of t){if(cS.resolveContextTreeNodeProps(e.props).hasSuggestions)return!0}return!1},HI=(e,t=!1)=>{const n=Zu.getContextReferences(e),s=[];if(n)for(const[e,r]of n){if(!1!==cS.resolveContextTreeNodeProps(r.props).visibility){const n=8,r=t?e:e.substring(e.indexOf("content")+n);s.push(r)}}return s},qI=e=>{const t=[],n=Zu.getContextReferences(e);if(n)for(const[e,s]of n){const n=cS.resolveContextTreeNodeProps(s.props);UI(s.props)&&"Attachment"!==n.componentName&&"multirecordlist"!==n.type&&t.push({name:e,label:n.label,type:n.componentName?.toLowerCase()})}return t};class zI{static getCaseInlineEditAction(e){return e?PA.getInlineEditActions(e):[]}static isCaseActive(e,t){if(!e||!t)return!1;const n=yy(t);if(n){const s=xy(t),{items:r={}}=n;return!(!s||!r[s]||r[s].key!==e)}return!1}static getCaseEditMetadata=(e,t)=>{const n={caseID:e,viewID:Ls.getDefaultQualifiedName("pyEdit")},{restApi:s,reqType:r}=i_("loadView",n);return Wd(s,{method:r},t)};static getCaseView=(e,t,n,s={})=>{const{signal:r}=s,a={caseID:e,viewID:t},{restApi:o,reqType:i}=i_("loadView",a);return Wd(o,{method:i,...r&&{signal:r}},n)};static isExternalCaseType=e=>{let t;return this.shouldUseUnifiedHandling()?(t=PA.getCaseTypeList()?.find((t=>t.DisplayMandatoryInputsForObject&&t.pyWorkTypeImplementationClassName===e)),!!t):(t=PA.getCaseTypeList()?.find((t=>"Case"===t.objectType&&t.DisplayMandatoryInputsForObject&&t.pyWorkTypeImplementationClassName===e)),!!t)};static getCaseEditLock=(e,t,n)=>{const s={caseID:e,actionID:this.getCaseInlineEditAction(n)[0]??Ls.getDefaultQualifiedName("pyUpdateCaseDetails")},{restApi:r,reqType:a}=i_(na,s);return Wd(`${r}?viewType=page`,{method:a},t)};static updateCaseEditFieldsData=(e,t,n,s,r)=>{const a=this.getCaseInlineEditAction(r),o=a.length?a:[Ls.getDefaultQualifiedName("pyUpdateCaseDetails")],i=t[e],c=(t,n)=>{const[r,...a]=t;return((t,n)=>{const r={caseID:e,actionID:t},{restApi:a}=i_(na,r);return Wd(`${a}?viewType=form`,{method:"PATCH",body:{content:{...i}},headers:{"if-match":n}},s)})(r,n).then((e=>a.length>0?c(a,e.headers.etag):e))};return c(o,n)};static getCaseMessages=e=>$C(e)?.caseMessages;static getPropertiesToReplace=e=>(kI(e)||[]).map((e=>({path:e.fullPath,allowMultiple:e.allowMultiple})));static getPropertiesToReArrange=e=>(kI(e)||[]).filter((e=>e.allowMultiple)).map((e=>e.fullPath));static getUniqueGadgetId=()=>rS.generateUniqueID().substring(0,5);static getRemoteCaseMapping=()=>Bs.getRemoteCaseMapping();static isTraditionalRemoteCase=e=>Bs.isTraditionalRemoteCase(e);static isCoexistenceCase=e=>!!e&&(PA.getCaseTypeList()?.some((t=>t.pyWorkTypeImplementationClassName===e&&"true"===t.pyIsTraditionalUICase))??!1);static isRemoteCase=e=>Bs.isRemoteCase(e);static isRemoteCaseVersionDifferent=e=>Bs.isRemoteCaseVersionDifferent(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=PA.getCaseTypeList()?.filter((t=>t.pyWorkTypeImplementationClassName===e));return t&&t.length>0&&"Object"===t[0].objectType};static isExternalObject=e=>{const t=PA.getCaseTypeList()?.filter((t=>t.pyWorkTypeImplementationClassName===e)),{DisplayMandatoryInputsForObject:n,objectType:s}=t?.[0]||{};return t&&t.length>0&&n&&"Object"===s};static getRouteKeyForCreateWork=(e,t=!1)=>this.isExternalCaseType(e)&&t?ja:this.isExternalObject(e)&&t?this.shouldUseUnifiedHandling()?ja:"retrieveActionViewForNewObject":this.shouldUseUnifiedHandling()?Oa:this.isObjectCaseType(e)?Ma:Oa;static shouldUseUnifiedHandling=()=>!0;static shouldAppendExcludeQueryParam=()=>PA.isOptimizedCaseLoadingEnabled();static appendExcludeQueryParamToUrl=e=>{if(!e)return e;if(!this.shouldAppendExcludeQueryParam())return e;let t=e;if(t.includes("excludeAdditionalActions=true"))return t=t.replace("excludeAdditionalActions=true","exclude=availableActions,availableProcesses,assignments"),t;const n=t.includes("?")?"&":"?";return`${t}${n}exclude=availableActions,availableProcesses`};static setTraditionalGadgetId=e=>{e.traditionalGadgetId=zI.getUniqueGadgetId()}}const YI=zI,KI=e=>{const{activeActionID:t,availableActions:n}=e||{};if(t&&n){const e=n.find((e=>e.ID===t));return Boolean(e)}return!1},QI=e=>{if(YI.shouldUseUnifiedHandling()&&YI.isObjectCaseType(String(e?.caseTypeID))&&!KI(e))return!0;if(YI.isObjectCaseType(String(e?.objectTypeID))&&!KI(e))return!0;if(e){const{stageID:t,stages:n=[]}=e,s=n.length;for(let e=0;e<s;e+=1){if(n[e].ID===t)return"create"===n[e].transitionType&&"active"===n[e].visited_status}}return!1},JI=(e,t)=>{if(e&&t){const n=rS.getIn(t,["assignments","0","assigneeInfo"],{}),{ID:s,type:r}=n;return"worklist"===r?.toLowerCase()&&s===e}return!1},XI=(e,t)=>{const n=cS.getPropertyValue(Fs.CASE_INFO.ACTIVE_ACTION_ID,t,e),s=cS.getPropertyValue(Fs.CASE_INFO.AVAILABLEACTIONS,t,e);let r=!1;if(s&&n){const e=s.find((e=>e.ID===n));e&&(r=e.type.toLowerCase()===Fs.LOCAL_ACTION_TYPE.CASE_WIDE.toLowerCase())}if(e&&!s){const t=$C(e);r=t?.context_data?.actionType===js.CASE}return r},ZI=e=>qC(null,js.CASE_VIEW_MODE_PROP,e)===js.PERFORM_MODE&&(e.includes(js.WORKAREA)||e.includes(js.MODAL)||e.includes(js.ACTIONAREA)),eE=(e,t)=>ZI(e)&&!XI(e,t),tE=e=>{const t=e?.parentCaseInfo?.ID;return Boolean(e&&t)},nE=(e,t,n)=>{let s;const r=e?.find((e=>e.ID===t))?.actions,a=r?.filter((e=>e.ID===js.FIX_BROKEN_ASSIGNMENTS))||[];return s=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),s},sE=(e,t,n,s)=>{let r;return r=e?nE(e,t,n):s||Ls.getDefaultQualifiedName("Create"),r},rE=(e,t)=>YI.shouldUseUnifiedHandling()?hr:YI.isObjectCaseType(e)||t?va:hr,aE=(e,t,n)=>{let s,r,a,o,i,c,l,u,d;const p=$C(e),g=p?.caseInfo?.caseTypeID||p?.objectInfo?.objectTypeID,h=YI.shouldUseUnifiedHandling();return n?.isTriggeredFromDifferentContext||e.includes(js.ACTIONAREA)?(s=e.includes(js.ACTIONAREA)?void 0:p.caseInfo?.assignments?.[0]?.ID,r=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):!h&&p?.objectInfo&&YI.isObjectCaseType(g)?(r=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):(s=t.getValue(js.getProperty(Fs.CASE_INFO.ASSIGNMENT_ID)),r=t.getValue(js.getProperty(Fs.CASE_INFO.CASE_INFO_ID)),a=t.getValue(js.getProperty(Fs.CASE_INFO.ASSIGNMENTS)),o=t.getValue(js.getProperty(Fs.CASE_INFO.ACTIVE_ACTION_ID)),i=t.getValue(js.getProperty(Fs.CASE_INFO.AVAILABLEACTIONS)),c=t.getValue(js.getProperty(Fs.CASE_INFO.CASE_INFO)),l=t.getValue(js.getProperty(Fs.CASE_INFO.BUSINESS_ID)),u=t.getValue(js.getProperty(Fs.CASE_INFO.CASE_TYPE_ID)),d=t.getValue(js.getProperty(Fs.CASE_INFO.CASE_TYPE_NAME))),{assignmentID:s,caseID:r,assignments:a,localActionID:o,caseActions:i,caseInfo:c,businessID:l,caseTypeID:u,caseTypeName:d}},oE=(e,t)=>{if(Object.keys(e??{}).length>0&&t?.startsWith("http")){const n=new URL(t),s=new URLSearchParams(n.search);return Object.keys(e).forEach((t=>{s.append(t,String(e[t]))})),n.search=s.toString(),n.toString()}return t},iE=(e,t="case")=>{const n=e?.payload?.err?.response?.data?.displayButtonsOnErrors||[],s=e?.payload?.err?.response?.status;if(Array.isArray(n)&&n.length>0&&424===s){n.forEach((e=>{e.isErrorButton=!0}));const s=e.payload.context,r=$C(s),a=((e,t)=>(e.forEach((e=>{!0!==e.isErrorButton||t.some((t=>t.actionID===e.actionID))||(t=[...t,e])})),t))(n,r?.caseInfo?.actionButtons?.secondary||[]),o={data:{["dataObject"===t?Fs.DATA_INFO.DATA_INFO:Fs.CASE_INFO.CASE_INFO]:{actionButtons:{secondary:a}}},target:Qy(s),context:s};BC({type:Cr,payload:o})}},cE=e=>({type:Nf.REFRESH_DATA,payload:e}),lE={},uE=(e,t,n,s,r,a,o,i,c,l)=>{if(!(e&&s&&t))return;const u=l.actionMgrID||Dg.getNextActionMgrId(),d={ID:e,actionID:t,objectTypeID:n,context:s,caseWideAction:r,isObjectType:a,isExternalObject:o,isExternalCase:i,casetypeID:c,options:{...l,actionMgrID:u}};l.isFillFormWithAI?BC((e=>({type:Pa,payload:e}))(d)):BC(cE(d))},dE=(e,t,n,s,r)=>{if(!(e&&n&&t))return;s&&(s=rS.convertPageRefToClipboardPageNotation(s));BC(cE({ID:e,viewID:t,context:n,options:r,caseViewAction:!0,interestPage:s}))},pE=(e,t,n,s,r,a,o,i,c,l={})=>{if(!((e||t)&&s&&n&&r))return;r&&(r=rS.convertPageRefToClipboardPageNotation(r));const u={ID:o||c!==js.ACTION?e:t,actionID:n,context:s,options:l,interestPage:r,interestPageActionID:a,isLocalAction:o,isMultiRecordData:i,editType:c};BC(cE(u))},gE=(e,t,n)=>{lE[t]||(lE[t]={}),e&&!lE[t][e]&&(lE[t][e]={pageReference:n})},hE=(e,t,n)=>{const s={pageName:(r=t.substring(t.lastIndexOf(" ")+1)).substring(0,r.lastIndexOf(".")),propertyName:r.substring(r.lastIndexOf(".")+1)};var r;const a=oC(s.propertyName,n||e.getValue(js.CLASS_ID,s.pageName));return!!a?.isDeclarativeTarget},fE=(e,t,n)=>{const s=n||e.getRawMetadata()?.config?.value;let r=!1;if(s){const n=No.trimAnnotation(s);let a;a=t?rS.resolvePageClass(n,t):cS.resolveClassID(s,e.getPageReference(),e.getContextName());const o=oC(No.getLeafPropertyName(s),a);if(r=!!o?.isDeclarativeTarget,!r&&o?.additionalInformation){const e=No.trimAnnotation(o?.additionalInformation);r=zf.isDecisionParagraph(e,o.classID)}!r&&o?.datasource?.parameters&&(r=((e,t,n)=>{let s=!1;if(Array.isArray(t)){const r=t=>{const r=t.value;return r.startsWith("@P")&&(s=hE(e,r,n)),s};t.some(r)}else if("object"==typeof t)for(const r of Object.keys(t))if(t[r].startsWith("@P")&&(s=hE(e,t[r],n),s))break;return s})(e,o?.datasource?.parameters,t)),r||(r=o?.datasource?.tableType===js.DECISION)}return r},mE=(e,t)=>{const n=n=>(e=>"string"==typeof e&&e.startsWith(js.PROPERTY_ANNOTATION))(n)&&fE(e,t,n),s=e=>!(!e||"object"!=typeof e)&&Object.values(e).some((e=>n(e)||s(e)));return s(e.getRawMetadata()?.config)},IE=e=>{(e.isWhenExist()||mE(e))&&gE(e.getCurrentView(),e.getContextName(),e.getPageReference())},EE=e=>{if(!e)return!1;const t=kC()?.getState()?.data?.[e],n=t?.caseInfo?.caseTypeID||t?.objectInfo?.objectTypeID;return YI.isObjectCaseType(n)},yE=(e,t,n)=>{const s=XI(e,t);let r,a,o="",i="";const c=n=>cS.getPropertyValue(n,t,e)||"",l=YI.shouldUseUnifiedHandling(),u=c(Fs.CASE_INFO.CASE_INFO_CLASSID)||c(Fs.OBJECT_INFO.OBJECT_INFO_CONTENT_CLASS_ID)||n?.classID||"",d=YI.isObjectCaseType(u)||t.startsWith(js.OBJECT_INFO.OBJECT_INFO),p=YI.isExternalCaseType(c(Fs.CASE_INFO.CASE_INFO_CLASSID)),g=YI.isExternalObject(u),h=c(js.getProperty(Fs.CASE_INFO.BUSINESS_ID));if(d&&EE(e)&&!p)o=u,n.isObjectWideAction=!0,r=c(l?Fs.CASE_INFO.ACTIVE_ACTION_ID:Fs.OBJECT_INFO.ACTIVE_ACTION_ID),r||(r=js.getDefaultQualifiedName(js.VIEW_NAMES.OBJECT_CREATE_VIEW)),a=c(js.getProperty(Fs.CASE_INFO.CASE_INFO_ID))||o;else if(p&&!h)r=js.getDefaultQualifiedName(js.VIEW_NAMES.OBJECT_CREATE_VIEW),a=c(Fs.CASE_INFO.CASE_INFO_CLASSID),i=c(Fs.CASE_INFO.CASE_TYPE_ID);else if(r=c(Fs.CASE_INFO.ACTIVE_ACTION_ID)||c(Fs.CASE_INFO.ASSIGNMENTACTION_ID),s)a=c(js.getProperty(Fs.CASE_INFO.CASE_INFO_ID));else{a=c(js.getProperty(Fs.CASE_INFO.ASSIGNMENT_ID))||c(js.getProperty(Fs.CONTEXT_DATA_ASSIGNMENTID))}uE(a,r,o,e,s,d,g,p,i,n)},AE=e=>{const{context:t,pageReference:n}=e,s=(e=>lE[e]&&Object.keys(lE[e]).length>0&&ZI(e))(t);if(!s)return;const r=cS.getPropertyValue(js.CONTEXT_DATA_MODAL_VIEW.CONTEXT_DATA_MODAL_VIEW,n,t),{isMultiRecordData:a,editType:o}=r||{};if(a){const e=cS.getPropertyValue(Fs.CASE_INFO.CASE_INFO_ID,n,t),s=cS.getPropertyValue(Fs.CASE_INFO.ASSIGNMENT_ID,n,t),{interestPage:i,interestPageActionID:c,actionID:l,isLocalAction:u,viewName:d}=r;o===js.ACTION?pE(e,s,l,t,i,c,u,a,o):dE(e,d,t,i,{})}else yE(t,n,{})},CE=(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},SE=(e,t)=>{const n=e.url===t.url,s=e.interestPage===t.interestPage;return n&&s},_E=(e,t)=>{const n=e.url?.includes("/refresh?refreshFor="),s=t.url?.includes("/refresh?refreshFor="),r=e.url?.endsWith("/refresh")&&!n,a=t.url?.endsWith("/refresh")&&!s;if(r&&a)return SE(e,t);if(r&&s)return!0;if(n){if(a)return"CANCEL_REFRESH";if(s)return SE(e,t)}return!1},NE=e=>{const t=(e=>{const t=[];return Zu.getDeclarativeTargets(e).forEach((({name:e,pageReference:n})=>{const s=n.split(".");s.shift();let r=s.join(".");e&&r&&(r=rS.convertPageRefToClipboardPageNotation(r),t.push({name:e,context:r}))})),t})(e),n=(e=>{const t=[];return Zu.getWhens(e).forEach((({name:e,type:n,pageReference:s})=>{const r=s.split(".");r.shift();let a=r.join(".");e&&a&&(a=rS.convertPageRefToClipboardPageNotation(a),t.push({name:e,context:a,type:n}))})),t})(e);return{fieldsWithDeclarativeTargets:t,whens:n}};const TE=class{static isPageInstruction(e){return e&&e.includes("[")&&e.includes("]")}},DE={IDLE:"idle",SAVING:"saving",SKIPPED:"skipped",ERROR:"error"},PE='input[type="text"], input[type="email"], input[type="number"], input[type="search"], input[type="tel"], input[type="url"], input[type="password"], input[type="date"], input[type="time"], input[type="month"], input[type="week"], input[type="datetime-local"], input:not([type])',OE=`${PE}, textarea, [contenteditable="true"]`,RE=new Map,bE=new Map,vE=new Set,xE=new Map,wE=new Map,ME=new Set,LE=(e,t)=>{xE.get(e)?.forEach((e=>e(t)))},UE=(e,t)=>{const n=bE.get(e);void 0!==n&&clearTimeout(n),bE.set(e,setTimeout((()=>{bE.delete(e),t()}),(()=>{const e=Number(PA.getFeatureMap()?.pyAutoSaveDurationInMS);return e>0?e:5e3})()))},FE=e=>{const t=Ws(e),n=Qy(t);return!n||!$y(n)||xy(n)===t},jE=async e=>{if(vE.has(e))return;if(ME.has(e))return;const t=RE.get(e);if(!t)return;if(!FE(e))return;const n="undefined"!=typeof document?document.activeElement:null;if(n&&n===(e=>Wp.get(e)??null)(e)&&n.matches(PE))return void UE(e,(()=>jE(e).catch((()=>{}))));(e=>{const t=wE.get(e);if(t&&0!==t.size){for(const[n,s]of t)vI.executeStateMachine(e,n,s,!0,{skipStateUpdate:!1,skipDirtyValidation:!1})||BC(KS({reference:n,value:s,context:e,isImplicit:!1,skipDirtyValidation:!1}));wE.delete(e)}})(e);let s=!1;Gp(!0);try{if(!bI.hasUnsavedChanges(e))return;s=bI.isFormValid(e)}finally{Gp(!1)}if(s){vE.add(e),LE(e,DE.SAVING);try{await((e,t)=>{const n=e,s=n.includes(js.MODAL),r=HC(Fs.CASE_INFO.CASE_INFO_ID,null,n),a=HC(Fs.CASE_INFO.ASSIGNMENT_ID,null,n),o=HC(Fs.CASE_INFO.ACTIVE_ACTION_ID,null,n)||HC(Fs.CASE_INFO.ASSIGNMENTACTION_ID,null,n),i=HC(Fs.CASE_INFO.CASE_TYPE_ID,null,n),c=HC("isProcessAction","isProcessAction",n),l=Dg.getNextActionMgrId(),u={context:n,containerItemID:e,assignmentID:a,actionID:o,caseID:r,containerName:t,caseType:i,isModalAction:s,isFormValid:void 0,isProcessAction:c,saveOnly:!0,autosave:!0,actionMgrID:l};let d,p;const g=new Promise(((e,t)=>{d=e,p=t}));if(!d||!p)throw new Error("Promise executor did not synchronously assign resolveFn/rejectFn.");return Dg.register(l,g,d,p,$g,u,!0),xf.executeOrQueueDeferredAction(Gg(u)),g})(e,t.containerName),bI.clearChangedProperties(e),LE(e,DE.IDLE)}catch{LE(e,DE.ERROR)}finally{vE.delete(e)}}else LE(e,DE.SKIPPED)},VE=()=>{if("undefined"==typeof document)return;const e=document.activeElement;if(e?.matches(OE))for(const e of RE.keys())bE.has(e)&&FE(e)&&UE(e,(()=>jE(e).catch((()=>{}))))},kE=VE,BE=e=>{"Tab"===e.key&&VE()},$E=e=>{const{target:t}=e;if("undefined"!=typeof Element&&t instanceof Element&&t.matches(PE))for(const e of RE.keys())bE.has(e)&&FE(e)&&(Hp(e,t),UE(e,(()=>jE(e).catch((()=>{})))))},GE=e=>RE.has(e),WE=e=>{const t=bE.get(e);void 0!==t&&clearTimeout(t),bE.delete(e),vE.delete(e),RE.delete(e),ME.delete(e),wE.delete(e),qp(e),0===RE.size&&"undefined"!=typeof document&&(document.removeEventListener("pointerdown",kE),document.removeEventListener("keydown",BE),document.removeEventListener("input",$E,{capture:!0}))},HE=e=>{const t=`${e}/`;for(const e of[...RE.keys()])e.startsWith(t)&&WE(e)},qE=e=>{const t=bE.get(e);void 0!==t&&(clearTimeout(t),bE.delete(e))},zE=e=>{RE.has(e)&&(ME.has(e)||UE(e,(()=>jE(e).catch((()=>{})))))},YE=e=>{ME.delete(e),bI.hasUnsavedChanges(e)&&zE(e)},{APP:KE}=js;let QE={},JE={},XE={};const ZE="You will lose unsaved changes. Do you want to continue?",ey="You have reached maximum limit of pending changes. Please commit/cancel one or more changes to continue.",ty=(e=KE.APP,t,n)=>{let s=[],r=[];t||(s=HI(e,!0)),n||(r=(e=>{const t=Zu.getContextReferences(e),n=[];if(t)for(const[e,s]of t)!0===cS.resolveContextTreeNodeProps(s.props).readOnly&&n.push(e);return n})(e));const a={};((e,t,n)=>{const s=JE[t]||{};Object.keys(s).forEach((t=>{const r=s[t].associatedProperty;Object.hasOwn(s,t)&&(void 0===r||n.includes(r))&&rS.buildObject(t,e,s[t].value)}))})(a,e,s);const o=QE[e]||{};return Object.keys(o).forEach((e=>{const n=!t&&s.includes(e)||t;Object.hasOwn(o,e)&&n&&!r.includes(e)&&rS.buildObject(e,a,o[e].value)})),a},ny=e=>{const{context:t}=e,n=e.reference.startsWith(".")?e.reference.substr(1):e.reference;delete QE[t]?.[n],delete JE[t]?.[n]};qu=(e,t)=>{ny({context:e,reference:t});const n=t.lastIndexOf(".");n<1||n===t.length-1||od({type:js.MESSAGES.MESSAGES_TYPE_ERROR,context:e,pageReference:t.slice(0,n),property:t.slice(n)})};const sy=e=>e&&XE[e],ry=e=>{e&&XE[e]&&(XE[e]=!1)},ay=(e,t)=>{const{context:n,initialValue:s="",isStrictTracking:r,associatedProperty:a}=t,o=t.reference.startsWith(".")?t.reference.substr(1):t.reference;e[o]?e[o].previousValue=HC(t.reference,null,n):(e[o]={initialValue:s||HC(t.reference,null,n)},e[o].previousValue=e[o].initialValue),e[o].value=t.value,a&&(e[o].associatedProperty=a),r&&e[o].value===e[o].initialValue&&ny(t)},oy=e=>{const{payload:t}=e,{context:n}=t,s=t.reference.startsWith(".")?t.reference.substr(1):t.reference;Zu.isFieldExists(n,s)||(JE[n]=JE[n]||{},ay(JE[n],t)),QE[n]=QE[n]||{},ay(QE[n],t)},iy=({value:e,context:t,reference:n})=>{const s=Qy(t),r=Cy(s,t)||{};if(TE.isPageInstruction(n)||r?.subscriptFieldName)return;const a=n?.startsWith(".")?n?.substr(1):n;QE[t]=QE[t]||{};QE[t][a]||(QE[t][a]={initialValue:HC(a,null,t)}),QE[t][a].value=e},cy=e=>e&&QE[e]&&Object.keys(QE[e]).some((t=>QE[e][t].initialValue!==QE[e][t].value))||!!sy(e),ly=(e,t)=>{if(!e||!t)return!1;const n=QE[e]&&QE[e][t];return!!n&&n.previousValue!==n.value},uy=e=>{e&&QE[e]?(QE[e]={},JE[e]={}):"all"===e&&(QE={},JE={},XE={}),XE[e]&&(XE[e]=!1),qp(e)},dy=(e,t,n=new Set)=>{if(n.has(t))return;n.add(t);[...Ao.getDependencies(e,t),...UC.getResetDependencies(e,t)].forEach((t=>{const s=rS.getPropertyNameFromDependency(t);if("object"==typeof t&&"multiRecord"===t.mode){const t=s.split("."),n=`.${t.pop()}`,r=t.join(".");if(vI.isStateMachineExist(e,r,n)){vI.getStateMachine(e,r,n).deleteAll()}else if(GE(e)){vI.setStateMachine(e,n,r,new lp(n,r,e));const t=vI.getStateMachine(e,r,n);t?.deleteAll(!1)}}else TE.isPageInstruction(s)&&vI.executeStateMachine(e,s,""),BC({type:Xs,payload:{reference:s,value:"",context:e,isArrayDeepMerge:!0,isImplicit:!0}});dy(e,s,n)}))},py={propertyChangeMiddleware:()=>e=>t=>{const{type:n,payload:s={}}=t||{};if(n===er&&(Io(s),(e=>{const{context:t,pageReference:n,value:s,reference:r}=e;UC.triggerCascade(t,r,s);const a=Ao.getDependencies(t,r),o={context:t,datapages:{}};dy(t,r),a.forEach((s=>{let r=n;s.startsWith(n)||(r="");const a=s.replace(`${r}`,"").split(".").filter((e=>!!e));a.pop();const i=a.join("."),c=HC(`.${i}`,r,t)?.classID||e.classID,l=oC(s.split(".").pop(),c),{datasource:u}=l,d={},p=[];u.parameters.forEach((e=>{e?.value?(d[e.name]=zg.isProperty(e.value)?HC(`.${rS.getFullPropertyReference([i,rS.getPropertyName(e.value)])}`,r,t):e.value,void 0===d[e.name]||null===d[e.name]||""===d[e.name]?(d[e.name]="",p.push(js.NULL_STRING)):p.push(d[e.name])):(d[e.name]="",p.push(js.NULL_STRING))}));const g=u.name.concat(js.UNDERSCORE_STRING,rS.getHashedString(p.join(js.HASH_DELIMITER))),{name:h}=u,f=yC(h);o.datapages[g]={mode:u.mode,propertyName:s,name:u.name,dataViewParameters:d,refreshStrategy:f?.refreshStrategy}})),a.length&&BC({type:ua,payload:o})})(s),xf.registerBlockingAction(s.context).catch((()=>{})),setTimeout((()=>{(ly(s.context,s.reference)||Pp(s.context))&&AE(s),Cf.triggerRefreshForType("PROP_CHANGE",s.reference,s.context),xf.deRegisterBlockingAction(s.context).catch((()=>{}))}),0)),n===ga&&!s?.isDefault){const{context:e,referenceList:t,c11nEnv:n,listIndex:r,instruction:a,skipDirtyValidation:o=!1}=s;0===r&&"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 s of n){const n=Cm({meta:s}).getPConnect();if(n.isWhenExist()||mE(n,t))return!0;if(s.children&&e(t,s.children))return!0}return!1}(n.contextClass,n.children??[])),t&&gE(e.getCurrentView(),e.getContextName(),e.getPageReference())})(n),setTimeout((()=>{Cf.triggerRefreshForType("PROP_CHANGE",t,e)||AE({context:e,pageReference:t})}),0),o||(XE[`${e}`]=!0)}if(n===Xs||n===Zs){const{reference:e,isImplicit:n,context:r,skipDirtyValidation:a=!1}=s;Zu.updateFieldNodeValue(r,e,s.value),TE.isPageInstruction(e)||a?a||(XE[`${r}`]=!0):oy(t),(s.removePropertyFromChangedList||n)&&ny(s)}if(n===Mr||n===Lr){const{transientItemID:e,data:t}=s;rS.iterateLeafNodes(t,(t=>{ny({context:e,reference:t.join(".")})}))}if(n&&[jr,Rr,kr,wr].includes(n)){uy(s.context),UC.purgeResetDependencies(s.context),(r=s.context)&&lE[r]&&delete lE[r];(s.childContainersContexts||[]).forEach((e=>{uy(e)}));(s.transientItems||[]).forEach((e=>{uy(e)}))}var r;e(t)},getChanges:ty,recordChange:oy,isDirty:()=>Object.keys(QE).some((e=>cy(e))),isPropertyDirty:ly,isContextDirty:cy,resetChangedProperties:uy,deleteRecordedChange:ny,isComplexObjectMerged:sy,resetComplexObjectDirtyStatus:ry};const gy=new class{getCoreheaders(e){const t=`${Fs.APP.APP}${js.FORWARD_SLASH_STRING}${js.PRIMARY}`,n=xy(t),s=Ly(n),r=cS.getProperty(js.COREHEADERS,"",s);if(r&&e in r)return r[e]}},hy={defaultLimit:16},fy={SINGLE:"single",MULTIPLE:"multiple"},my={PRIMARY:"primary",WORKAREA:"workarea",MODAL:"modal",PREVIEW:"preview"},Iy=()=>kC()?.getState()?.containers;function Ey(e){return"string"==typeof e&&""!==e.trim()}const yy=e=>Ey(e)?kC()?.getState().containers[e]:null,Ay=(e,t,n)=>{if(!n)return{continueExecution:!1,containerItemID:e};const s=yy(n);let r=!1,a=e;return s?.accessedOrder.forEach((e=>{t===s.items[e].key&&(r=!0,a=s.items[e].context)})),{continueExecution:r,containerItemID:a}},Cy=(e,t)=>{if(!Ey(e)||!Ey(t))return null;const n=Iy(),s=n?.[e];return s&&s.items&&s.items[t]||null},Sy=e=>Ey(e)?kC()?.getState().containers[e]?.items:null,_y=e=>Ey(e)&&kC()?.getState().containers[e]?.accessedOrder||[],Ny=e=>Ey(e)&&_y(e)?.length>0||!1,Ty=(e,t,n)=>{if(!Ey(e)||!Ey(t))return!1;const s=Iy(),r=s?.[e],a=r&&r.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},Dy=e=>{const{containers:t}=kC()?.getState()||{};return!(!t||!Ey(e))&&Object.keys(t).some((n=>t[n]?.accessedOrder?.includes(e)))},Py=(e,t,n)=>{if(!Ey(e)||!Ey(t))return null;const s=Iy(),r=s?.[e],a=r&&r.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},Oy=(e,t)=>{if(e&&t)for(const r of Object.keys(t))if(n=e,s=t[r].key,n?.toLowerCase()===s?.toLowerCase())return t[r];var n,s;return null},Ry=e=>{if(!Ey(e))return null;const t=Iy()??{};for(const n of Object.keys(t))if(t[n]){const s=t[n].items??null,r=Oy(e,s);if(r)return r}return null},by=(e,t)=>{if(!Ey(e)||!Ey(t))return!1;const n=Iy();return n&&Object.hasOwn(n,`${e}/${t}`)},vy=(e,t)=>{if(!Ey(e)||!Ey(t))return null;const n=Iy(),s=n?.[`${e}/${t}`];return s&&s.type},xy=e=>{if(!Ey(e))return null;let t=null;const n=Iy();if(n&&n[e]){const s=n[e],{accessedOrder:r}=s;t=r&&r.length>0?r[r.length-1]:null}return t},wy=(e,t,n)=>{if(!Ey(e)||!Ey(t))return!1;const s=Py(e,t,n);return!!s&&s===xy(e)},My=(e,t)=>{let n=null;const s=Iy();if(!s)return null;for(const r of Object.keys(s))if(s[r].items){const a=s[r].items[e];if(n=a?a[t]:null,n)break}return n},Ly=e=>Ey(e)?My(e,"context"):null,Uy=e=>{if(!Ey(e))return null;let t=null;const n=Iy();if(n&&n[e]){const s=n[e],{accessedOrder:r}=s,a=r&&r.length>0?r[r.length-1]:null;t=Ly(a)}return t},Fy=e=>{if(!Ey(e))return[];const t=e.endsWith("/")?e:`${e}/`;let n=[],s=!1;const r=Iy();if(!r)return[];const a=n=>{const r=[];return Object.keys(n).forEach((n=>{n.startsWith(t)&&n!==t&&r.push(n),n===e&&(s=!0)})),r};for(const e of Object.keys(r))if(r[e].items){const t=a(r[e].items);t&&t.length>0&&(n=n.concat(t)),n=n.sort()}return s?n:[]},jy=e=>{if(!Ey(e))return[];const t=[],n=Iy();if(!n)return[];const s=`${e}${js.FORWARD_SLASH_STRING}`;for(const e of Object.keys(n))e.startsWith(s)&&t.push(e);return t},Vy=e=>{if(!Ey(e))return[];const t=[],n=Iy();if(!n)return[];const s=`${e}${js.FORWARD_SLASH_STRING}`;for(const r of Object.keys(n))if(r.startsWith(s)){(_y(r)||[]).forEach((n=>{Ly(n)!==e&&t.push(Ly(n))}))}return t},ky=e=>{const t=[...Vy(e),e],n=[],s=kC()?.getState().data||{};return t.forEach((e=>{Object.hasOwn(s,`${e}/${js.SUGGESTION}`)&&n.push(`${e}/${js.SUGGESTION}`)})),n},By=e=>Ey(e)?e&&yy(e)&&yy(e).type===fy.SINGLE:null,$y=e=>Ey(e)?e&&yy(e)&&yy(e).type===fy.MULTIPLE:null,Gy=e=>Ey(e)&&yy(e)&&yy(e).items&&Object.keys(yy(e)?.items).length>0||!1,Wy=e=>e&&hy[e]?hy[e]:hy.defaultLimit,Hy=(e,t=hy.defaultLimit)=>{Ey(e)&&(hy[e]=t)},qy=e=>{if(!Ey(e))return!1;let t=!1;const n=yy(e),{items:s={}}=n,r=Object.keys(s),a=Wy(e);return r&&r.length>0&&r.length>=a&&(t=!0),t},zy=e=>{if(!e||!Ey(e.name)||!Ey(e.context))return null;const t=e?.name,n=yy(`${e?.context}/${t}`),s=Array.isArray(n?.accessedOrder)&&n?.accessedOrder.map((e=>n?.items[`${e}`]?.context))||[],r=jy(`${js.APP.APP}/${js.PREVIEW}`),a=Vy(`${js.APP.APP}/${js.PREVIEW}`);return{context:e?.context,name:t,containerItems:[...s,...a],childContainers:r}},Yy=e=>{if(!Ey(e))return!1;const t=Ly(e);return cy(t)||fI(e)},Ky=e=>{if(!Ey(e))return null;let t;const n=yy(e),{accessedOrder:s=[]}=n;for(let e=0;e<s.length;e+=1){const n=s[e];if(!Yy(n)){t=n;break}}return t},Qy=e=>{if(!Ey(e))return null;const{containers:t}=kC()?.getState()||{};if(t)for(const n of Object.keys(t))if(t[n]?.accessedOrder?.includes(e))return n;const n=e.lastIndexOf(js.UNDERSCORE_STRING);return e.slice(0,n)},Jy=async(e,t={})=>{if(!Ey(e))return Promise.reject(new Error("closeContainerItem: containerItemID is the required parameter"));const n=Qy(e),s=Ly(e),{skipDirtyCheck:r}=t;let a=!0,o=[];if(Yy(e)&&!r&&(Tg.disableLoadingIndicator({context:s}),a=await Zm.confirm(xA().getLocaleValue(ZE,"Messages")),Tg.enableLoadingIndicator({context:s})),a){const{accessedOrder:r=[],items:a={},type:i}=yy(n);o=r.filter((t=>t!==e));const c=o[o.length-1],l=a[c]||{},{semanticURL:u=js.FORWARD_SLASH_STRING,context:d}=l;o.length>0&&u&&u!==js.FORWARD_SLASH_STRING?f_({directUrlUpdation:!0,semanticURL:u,options:{containerItemID:c,context:d}}):f_({directUrlUpdation:!0,semanticURL:js.FORWARD_SLASH_STRING,options:{}});BC(LS({containerItemID:e,context:s,target:n,containerInfo:{newAccessedOrder:o,containerType:i},...void 0!==t.eventName?{eventName:t.eventName}:{}}))}return{newAccessedOrder:o,removeItem:a}},Xy=(e,t,n,s)=>{const r="root",a=Hs(t,r,!0),o=Va(t,r),i={data:n,context:s?"app":a},c=[_S({root:e,containerItemID:a,context:s?"app":a,target:o,containerName:t})];c.push(fS(i)),BC(c)},Zy=(e,t,n)=>{let s=_y(e);s=s.filter((e=>e!==t));let r=!1;for(let e=0;e<s.length;e+=1){if(Ly(s[e])===n){r=!0;break}}return r},eA=e=>{if(!Ey(e))return!1;const t=Iy(),n=Ly(e),s=t?Object.keys(t):[];let r=!1;for(let t=0;t<s.length&&(r=Zy(s[t],e,n),!r);t+=1);return r},tA=e=>{Array.isArray(e)||(e=[e]);const t=Iy()||{};return e.map((e=>{const n=Qy(e);return rS.getIn(t,[n,"items",e,"transientItems"])||[]})).flat()},nA=e=>{const{transientItemID:t,data:n,options:s}=e,r=rS.deepClone(kC()?.getState().data[t]);s?.reset&&rS.iterateLeafNodes(r,(e=>{"classID"!==e[e.length-1]&&rS.setIn(r,e,"")})),BC(TS({transientItemID:t,data:rS.mergeDeep(n,r)}))},sA=e=>{const{transientItemID:t,data:n}=e;BC(PS({transientItemID:t,data:n}))},rA=e=>{const t=rS.deepClone(kC()?.getState().data[e]);rS.iterateLeafNodes(t,(e=>{"classID"!==e[e.length-1]&&rS.setIn(t,e,"")})),BC(DS({transientItemID:e,data:t}))},aA=e=>{const t=rS.deepClone(kC()?.getState().data[e]);rS.iterateLeafNodes(t,(e=>rS.setIn(t,e,""))),BC(OS({transientItemID:e,data:t}))},oA=e=>{kC()?.getState().data[e]&&aA(e);const t=e.lastIndexOf("/"),n=t>0?e.substring(0,t):e,s=Qy(n);BC(FS({transientItemID:e,containerItemID:n,target:s}))};class iA{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 cA=(e,t={})=>{if(!Ey(e))return;const n=yy(e),s=Array.isArray(n?.accessedOrder)?n.accessedOrder:[];if(0===s.length)return;const{remove:r,keep:a}=t;let o;if(void 0!==a){const e=new Set(a);o=s.filter((t=>!e.has(t)))}else if(void 0!==r){const e=new Set(r);o=s.filter((t=>e.has(t)))}else o=[...s];for(const t of o){const n=Ly(t),s=tA(t);BC(LS({containerItemID:t,context:n,target:e,...s.length>0&&{transientItems:s}}))}},lA=()=>iA,uA=e=>{const t={containerName:e};t.childContainers=jy(e),BC({type:$r,payload:t})},dA=(e,t)=>{const n=Fy(e),{key:s}=Cy(Qy(e),e),r=[];n.forEach((e=>{const{key:n}=Cy(Qy(e),e);if(n===s){const n={data:{caseInfo:{headers:{etag:t}}},target:Qy(e),context:e};r.push({type:Cr,payload:n})}})),r.length&&BC(r)},pA=(e,t)=>{const n=[],s={data:{caseInfo:{headers:{etag:t}}},target:Qy(e),context:e};n.push({type:Cr,payload:s}),n.length&&BC(n)},gA=()=>PA.isPortalLoaded?"app":"root",hA=()=>gy,fA=(e,t)=>{const n={data:{caseInfo:{lastUpdateTime:t}},target:Qy(e),context:e};BC({type:Cr,payload:n})},mA=(e,t)=>{const n=Py(e,t),s=Py(`${n}/workarea`,t);return Ly(s)},IA=e=>Ey(e)?My(e,"parentContext"):null,EA=e=>{const{accessedOrder:t}=e;return t&&t.length>0?t[t.length-1]:""},yA=e=>{if(e&&"string"==typeof e){const t=e.split("/");return t.pop(),t.join("/")}return null},AA=()=>Kg,CA=()=>"undefined"==typeof window?"":Th(window.location.pathname),SA=()=>"undefined"==typeof window?"":Th(window.location.pathname+window.location.search),_A=(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 NA=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=>{Nh(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=()=>Th(`${this.getReqContextName()}/${this.getReqServletNameReal()}`);getReqServletNameReal=()=>`${this.reqServletNameReal}`;getAppDelimeter=()=>`${this.appDelimeter}`;getApplicationName=()=>`${this.appName}`;getApplicationAlias=()=>`${this.appAlias}`;getServletPath=()=>`${this.reqServletPath}`;getOrganizationName=()=>`${this.orgName}`;getReqContextName=()=>Th(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("/")&&vh()&&"PREVIEW"!==PA.getRenderingMode()&&this.setDefaultClassName(""),Th(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="",s={caseClassName:"",caseID:"",RemoteSystemID:void 0,page:""};return Object.keys(this.appRoutes||{}).forEach((t=>{const r=this.appRoutes[t];r&&r.payload&&r.payload.page===e&&(n=r.routeKey,s={...r.payload})})),!n&&this.appRoutes&&this.appRoutes[e]&&(n=this.appRoutes[e].routeKey,s={...this.appRoutes[e].payload}),{routeKey:n,payload:s}};transformRemoteCasePayload(e){const{caseClassName:t,caseID:n}=e;if(!Bs.isRemoteCase(t))return e;const{RemoteClassGroup:s,RemoteSystemID:r}=Bs.getRemoteCase(t??"");return{...e,caseID:n?.replace(t??"",s?.toUpperCase()),RemoteSystemID:r}}getEndPointInfo=e=>{e=this.stripIgnoredParams(e);const t=vh();let n=this.processUrl(e,!0),s=this._getMatchedRouteInRoutingTable(n,t?this.defaultClassName:void 0);s||(n=this.processUrl(this.defaultViewUrlPath,!t),s=this._getMatchedRouteInRoutingTable(n,t?this.defaultClassName:void 0)||"");const{routeKey:r,payload:a}=this.getRouteDetails(s,t);if(!this.appRoutesMeta?.[r]?.restApi)return null;const{reqType:o,endPoint:i,params:c}=this.appRoutesMeta[r].restApi,l={routeKey:r,requestType:o,routeEndpoint:i,payload:{...c,...this.transformRemoteCasePayload(a)}};return this._resolveRoute(l,this.processUrl(e,!1),s)};getSemanticURL(e,t,n){return this.buildSemanticURL(e,t,n)}getResolvedSemanticURL(e,t,n={},s){const r=this.getSemanticURL(e,t,n);let a=r;if(Nh(r)){const e=r.match(_h);e?.forEach((e=>{const t=this._getDynamicKeyName(e);n[t]&&(a=a.replace(e,String(n[t])))}))}const o=h_(a,s),i=new URL(o);return this.isDefaultPortal()||!this.getPortalName()||i.searchParams.toString().includes("portal=")||i.searchParams.append("portal",this.getPortalName()),s&&!i.searchParams.has("lang")&&i.searchParams.append("lang",s),Ph(i.toString())}buildDocumentTitle(e,t,n){const s=n??"";return PA.getCaseLabelFirstInTitle()?e&&t?`${e} (${t}) - ${s}`:s:e&&t?`${t}: ${e} - ${s}`:s}updateSemanticURLAndDocumentTitle(e,t){const{key:n,actionName:s,caseClassName:r,isRemoteCase:a,name:o}=e;if(a&&!r)return;const i=this.getSemanticURL(s,{caseClassName:r}).replace(/{.+?}/,String(xm(n))),c=`${Fs.APP.APP}${js.FORWARD_SLASH_STRING}${Fs.PRIMARY}`,l={semanticURL:i,directUrlUpdation:!0,options:{acName:c,context:Uy(c)}},u=CA();i&&!u.includes(i)&&g_(l,t);const d=n.substring(n.lastIndexOf(" ")+1),p=PA.environmentInfoObject?.pxApplication?.pyLabel,g=this.buildDocumentTitle(o,d,p);__(g)}buildSemanticURL(e,t,n){const{urlPattern:s}=this.appRoutesMeta?.[e]||{},r=s?.split("/").length,a=s?.split("/");this.setDefaultClassName(t?.pageClass||this.defaultClassName);const o=Object.keys(this.appRoutes).filter((e=>r===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 s=this.appRoutes[e].payload,r={...n};delete r.dataViewName,delete r.dataContext;const a=s.dataViewKeys||s.dataContextParameters||{},o=Object.keys(t).every((e=>t[e]===s[e]));return!!o&&(rS.isEmpty(a)||rS.isEmpty(r)?o:Object.keys(r).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[s,r]=e.includes("?")?e.split("?"):[e];if(r&&t&&Object.keys(t).length>0){const e={};for(const[n,s]of Object.entries(t))e[n.toLowerCase()]=s;const a=new URLSearchParams(r),o={};for(const[s,r]of a.entries())if("string"==typeof r&&Nh(r)){const a=this._getDynamicKeyName(r),i=a.toLowerCase(),c=n?e:t,l=n?t[a]??c[i]:c[a];null!=l&&(o[s]=l)}else"string"==typeof r&&(o[s]=r);const i=new URLSearchParams(Object.entries(o).map((([e,t])=>[e,String(t??"")])));return`${s}?${Ph(i.toString())}`}return s}_getQueryParamsObject(e){const t={};if(!e)return t;for(const n of e.split("&")){const e=n.indexOf("=");if(-1!==e){const s=n.slice(0,e),r=n.slice(e+1);try{t[decodeURIComponent(s)]=decodeURIComponent(r)}catch{t[s]=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:s}=this.appRoutesMeta[e].restApi;let{endPoint:r}=this.appRoutesMeta[e].restApi;t?.params&&t.params.pageName&&(r=`${r}&pageName=${t.params.pageName}`);const a=r.match(_h);if(a)for(let e=0;e<a.length;e+=1){const n=a[e].replace("{","").replace("}",""),s=new RegExp(a[e],"g");r=r.replace(s,t?.[n])}if(s){let e={};return Object.keys(s).forEach((n=>{if(t&&this._isSpecialInstruction(n)){const r=s[n];Array.isArray(r)&&r.every((e=>"string"==typeof e))&&(e={...e,...this._processInstruction(n,r,t)})}})),{restApi:r,reqType:n,body:e}}return{restApi:r,reqType:n}}throw new Error(`Cannot find route metadata for the routeKey: ${e}.`)}_isSpecialInstruction(e){return e&&e.startsWith("@")}_processInstruction(e,t,n){const s={};return"@COPY"===e&&t.forEach((e=>{s[e]=n?.[e]})),s}doesRestApiExist(e){return!(!this.appRoutesMeta||!this.appRoutesMeta[e])}_resolveMatchedRouteQueryParams=(e,t,n,s)=>{if(!e)return;const r=t.indexOf("?"),a=-1!==r?t.substring(r+1):void 0;if(a){const e=`${n.join("/")}?${a}`;return this._getQueryParamsResolvedURL(e,s,!0)}};_resolveRoute=(e,t,n)=>{const s=[],[r,a]=t.includes("?")?t.split("?"):[t],[o,i]=n.includes("?")?n.split("?"):[n],c=r.split("/"),l=o.split("/"),u={};for(let e=0;e<l.length;e+=1)if(s[e]=l[e],Nh(l[e])){u[this._getDynamicKeyName(l[e])]=c[e],s[e]=c[e]}const d=this._getQueryParamsObject(i),p=this._getQueryParamsObject(a),g={};for(const[e,t]of Object.entries(p))g[e.toLowerCase()]=t;for(const e of Object.keys(d))Nh(d[e])?u[e]=p[e]||g[e.toLowerCase()]:u[e]=d[e];const h=this._resolveMatchedRouteQueryParams(a,n,s,p),f=this._resolvePayload(e,u,n);return{...this._resolveRouteEndPoint(f,n),urlPath:h||s.join("/")}};_resolveRouteEndPoint=(e,t)=>{let{routeEndpoint:n}=e;if(!Nh(n))return e;const s={};if(s[t]=e,void 0!==e.payload){const t=n.match(_h);for(let r=0;r<t.length;r+=1){const a=t[r],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`,s)}}else this._sendWarningAndErrorMessages("Unable to resolve dynamic token(s) in routeEndpoint- payload is missing in routing table for-",s);return{...e,routeEndpoint:n}};_resolvePayload=(e,t,n)=>{if(void 0===e.payload)return e;const s={...e.payload,...this._resolvePayloadRecursive(e.payload,t)};return{...e,payload:s}};_resolvePayloadRecursive(e,t){if(Array.isArray(e))return e.map((e=>this._resolvePayloadRecursive(e,t))).flat();const n={};for(const s of Object.keys(e)){let r=e[s];if("string"==typeof r&&Nh(r)){const e=r.match(_h)??[];for(const n of e){const e=this._getDynamicKeyName(n);void 0!==t[e]?r=r.replace(n,t[e]):this._sendWarningAndErrorMessages(`Unable to resolve dynamic token {${e}} in payload - {${e}} is missing in semantic url construct`)}n[s]=r}else n[s]=r&&"object"==typeof r?this._resolvePayloadRecursive(r,t):r}return n}_getMatchedRouteInRoutingTable=(e,t)=>{const[n]=e.includes("?")?e.split("?"):[e];let s=this._findMatchedRouteInStaticList(n,t);return void 0!==s?s:(s=this._findMatchedRouteInDynamicList(e),void 0!==s?s:void 0)};_findMatchedRouteInStaticList=(e,t)=>{if(!this.staticRoutesList||!e)return;const n=e.toLowerCase(),s=t?.toLowerCase();if(vh()){const e=this._findMatchingRouteByClass(n,s);if(!e)return;const t=Object.values(e)[0],r=t?.payload?.page||"";return this.setStaticRoutePage(r),Object.keys(e)[0]}return this._findInStaticList(n)};_findMatchingRouteByClass=(e,t)=>{if(this.staticRoutesList)return this.staticRoutesList.find((n=>Object.entries(n).some((([n,s])=>{if(!s)return!1;const r=s.payload?.page?.toLowerCase(),a=s.payload?.pageClass?.toLowerCase(),o=r===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],s=t.split("/");return this.dynamicRoutesList?.find((e=>{const[t,r]=e.includes("?")?e.split("?"):[e],a=t.split("/");if(a.length!==s.length)return!1;let o=0;for(o=0;o<a.length;o+=1){const e=a[o].toLowerCase();if(!Nh(e)&&e!==s[o]&&Dh(e)!==s[o])return!1}if(r){const e=new URLSearchParams(n.toLowerCase()),t=new URLSearchParams(r.toLowerCase()),s=new Set,a=new Set,o=/\{[a-zA-Z]+\}/;for(const t of e.keys())s.add(t);for(const e of t.keys())a.add(e);if(a.size!==s.size)return!1;for(const n of s){if(!a.has(n))return!1;const s=t.get(n);if(e.get(n)!==s&&!o.test(s??""))return!1}}return!0}))};_sendWarningAndErrorMessages=(e,t)=>{_A(e,t,"warning"),_A("Error in Generated Routing Table",null,"error"),_A("Back | Forward for this page may NOT work as intended",null,"warning"),_A("Bookmark | Refresh for this page may NOT work as intended",null,"warning")}},TA=NA;const DA=new class{constructor(){this.languagePacks=[]}getLocalizationBundles(e=PA.getLocale()){return(this.languagePacks.find((t=>t.pyLangCode===e))?.pyBundles??this.languagePacks.find((e=>e.pyLangCode===js.DEFAULT.toUpperCase()))?.pyBundles??[]).sort(((e,t)=>e.pyOrder-t.pyOrder))}async loadLocaleBundle(e){const t=e.map((e=>af.getPageDataAsync("D_pzBundlesForLocalization","",{locale:e,onlyApp:"false"},{invalidateCache:!0}))),n=(await Promise.allSettled(t)).filter((e=>"fulfilled"===e.status)).flatMap((e=>e.value.pyLanguagePacks));this.setLanguagePack(n)}setLanguagePack(e){e.forEach((e=>{const t=this.languagePacks.findIndex((t=>t.pyLangCode===e.pyLangCode));-1!==t?this.languagePacks[t]=e:this.languagePacks.push(e)}))}};const PA=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",this.enablePriorityAndUrgencyImprovements=!1}setEnvironmentInfo(e){const t=e?.pxOperator?.pyUserName,n=t?rS.decodeHtmlEntities(t):void 0,s={...e,pxOperator:e.pxOperator?{...e.pxOperator,...n?{pyUserName:n}:{}}:e.pxOperator};this.environmentInfoObject=s;const r=this.environmentInfoObject?.features||rS.convertObjectWithStringToBoolean(this.environmentInfoObject?.pyFeatures)||{granularUIRefresh:!1};this.environmentInfoObject.features={...r,granularUIRefresh:r.granularUIRefresh||r.pyEnableGranularUIRefresh||!1},this.environmentInfoObject.pyGenAIEnabled=!!this.environmentInfoObject.pyGenAIEnabled,Ls.setNamespaceSupport(this.getFeatureMap()?.isNamespaceEnabled);const a=e.requestContext;if(Array.isArray(a)&&a.length>0){const e=a.filter((e=>e.IncludeInURL)).map((e=>e.Key));e.length>0&&N_(e)}DA.setLanguagePack(this.environmentInfoObject.pyLanguagePacks||[])}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 TA.getPortalName()}setCaseLabelFirstInTitle(e=!0){this.caseLabelFirstInTitle=e}getCaseLabelFirstInTitle(){return this.caseLabelFirstInTitle}getApplicationName(){return this.environmentInfoObject?.pxApplication?.pyRuleName}getUseLocale(){return this.environmentInfoObject?.pxLocale?.pyUseLocale}getAccessGroup(){return this.environmentInfoObject?.pxOperator?.pyAccessGroup}getApplicationID(){return this.environmentInfoObject?.pxApplication?.pyRuleId}getTimeZone(){return this.environmentInfoObject?.pxLocale?.pyTimeZone?.trim()||void 0}getTheme(e){return"dark"===e?.type?this.darkThemeOverrides:this.themeOverrides}setTheme(e,t){return"dark"===t?.type?this.darkThemeOverrides=e:this.themeOverrides=e,fd.publish(js.PUB_SUB_EVENTS.UI_EVENTS.THEME_CHANGE,e),"dark"===t?.type?this.darkThemeOverrides:this.themeOverrides}getNavOrientation(){return this.navOrientation??this.environmentInfoObject?.pyNavOrientation}setNavOrientation(e){return this.navOrientation=e,fd.publish(js.PUB_SUB_EVENTS.UI_EVENTS.NAV_ORIENTATION_CHANGE,e),this.navOrientation}setIsWebEmbed(e){return this.isWebEmbed=e,this.isWebEmbed}isWSSPortal(){return this.environmentInfoObject?.pyPortalTemplate===js.PORTAL_TYPE.WSS}isDefaultWSSPortal(){return this.isWSSPortal()&&!this.environmentInfoObject?.pyFullObjectDisplayTemplate}isInfinityRuntime(){return"Infinity"===this.environmentInfoObject?.pyExecutionRuntimeName}isGenAIEnabled(){return!!this.environmentInfoObject?.pyGenAIEnabled}getRewriteGenAIDP(){return this.environmentInfoObject?.pyRewriteGenAIDP}isBlueprintExperience(){return!!this.environmentInfoObject?.features?.fromBlueprintExperience}getBrandingInfo(e){return"dark"===e?.type?this.brandingInfoDark:this.brandingInfo}setBrandingInfo(e,t){return"dark"===t?.type?this.brandingInfoDark=e: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(js.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}isPegaMobile(){return!!window.pms?.plugins?.c11n_spa||!!window.pms?.plugins?.c11n}isOfflineEnabled(){return"undefined"!=typeof navigator&&(navigator.userAgent||"").includes("pxUsesOffline")}shouldUseURLParams(){return"FULL_PORTAL"===this.environmentInfoObject?.renderingMode&&this.getFeatureMap()?.pyUseURLParams}getBuiltOnAppNames(){return this.environmentInfoObject?.pxApplication?.pyBuiltOnApplications}setPreviewMode(){Id.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)}isOptimizedCaseLoadingEnabled(){return this.getFeatureMap().pyEnableOptimizedCaseLoading||this.getFeatureMap().optimizedCaseLoading||!1}isOpenCasePageAfterCreateInMultiDocEnabled(){return this.getFeatureMap().pyOpenCasePageAfterCreateInMultiDoc??!0}getCaseTypeList(){return this.environmentInfoObject&&this.environmentInfoObject?.pyCaseTypeList||[]}getClassesAccessList(){return this.environmentInfoObject?.pyClassesAccessList?.pxResults??[]}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){return DA.getLocalizationBundles(e)}getAvailableLocalePacks(){return this.getFeatureMap()?.availableLanguagePacks||void 0}getIsExtraCallRequiredForDefaultHome(){return this.isExtraCallRequiredForDefaultHome}setIsExtraCallRequiredForDefaultHome(e){this.isExtraCallRequiredForDefaultHome=e}getEnablePriorityAndUrgencyImprovements(){return this.enablePriorityAndUrgencyImprovements}setEnablePriorityAndUrgencyImprovements(e){this.enablePriorityAndUrgencyImprovements=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"}getInlineEditActions(e){return this.environmentInfoObject?.pyInlineEditActions?.filter((t=>t.pyClassName===e)).map((e=>e.pyActionName))??[]}getInlineEditActionViews(e){return this.environmentInfoObject?.pyInlineEditActions?.filter((t=>t.pyClassName===e)).map((e=>e.pyViewName))??[]}getFullObjectDisplayTemplate(){return this.environmentInfoObject?.pyFullObjectDisplayTemplate??void 0}setFullObjectDisplayTemplate(e){this.environmentInfoObject&&(this.environmentInfoObject.pyFullObjectDisplayTemplate=e),fd.publish(js.PUB_SUB_EVENTS.UI_EVENTS.CASE_VIEW_TEMPLATE_CHANGE,e)}getMultiStepNavDisplay(){return this.environmentInfoObject?.pyMultiStepNavDisplay??void 0}setMultiStepNavDisplay(e){this.environmentInfoObject&&(this.environmentInfoObject.pyMultiStepNavDisplay=e),fd.publish(js.PUB_SUB_EVENTS.UI_EVENTS.MULTI_STEP_NAV_DISPLAY_CHANGE,e)}getCaseStageDisplay(){return this.environmentInfoObject?.pyCaseStageDisplay??void 0}setCaseStageDisplay(e){this.environmentInfoObject&&(this.environmentInfoObject.pyCaseStageDisplay=e),fd.publish(js.PUB_SUB_EVENTS.UI_EVENTS.CASE_STAGE_DISPLAY_CHANGE,e)}},OA=e=>"fulfilled"===e.status,RA=async(e=PA.getLocale())=>{try{await(async e=>{const t=PA.getAvailableLocalePacks(),n=PA.getLocalizationBundles(e);let s;if(e&&t&&t.includes(e)?s=[tg("getLocalizationPack",{queryPayload:{locale:e}})]:n.length>0&&(s=n.map((e=>tg("getLocalizationPack",{queryPayload:{version:e.pyBundleVersion,bundle:e.pyBundleName}})))),!s||0===s.length)return;const r=200,a=201,o=await Promise.allSettled(s),i=iC(e??"en-US");o.filter(OA).forEach((({value:e})=>{if([r,a].includes(e.status)&&e.data){const t=e.data;Object.keys(t).forEach((e=>{i.setLocaleForRule(t[e],e)}))}}))})(e)}catch(e){console.warn(e)}};const bA=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 s=e.indexOf("{@P ",t);if(-1===s){n+=e.substring(t,e.length);break}n+=e.substring(t,s);const r=e.indexOf("}",t),a=e.substring(s,r+1),[o,i]=this.getKeyAndValue(a);this.addKeyToMap(o,i),n+=`${a.split(":")[0]}}`,t=r+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 s=e.indexOf("{@P ",t);if(-1===s){n+=e.substring(t,e.length);break}n+=e.substring(t,s);const r=e.indexOf("}",t),a=e.substring(s,r+1);n+=this.keyMap[a],t=r+1}return n}};class vA{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,s=t.toUpperCase();s.startsWith("@BASECLASS!DATAPAGE!")&&s.split(/[!#]/).length<4?Object.entries(n).forEach((([e,t])=>{null!==t&&"object"==typeof t&&"fields"in t&&this.updateLocaleStore(t,`${s}#${e}`.toUpperCase())})):"GENERIC!GENERICFIELDS"===s?Object.entries(n).forEach((([e,t])=>{null!==t&&"object"==typeof t&&this.sanitizeLocaleField(t,e.toUpperCase())})):this.sanitizeLocaleField(n,s)};updateLocaleStore=(e,t)=>{const n=e.fields||e,s=this.localeStore[t];s?rS.mergeDeep(n,s):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,s){const r=this.#p(n,t),a=this.#g(e);a&&(e=bA.formatLocaleKey(e));const o=r?this.localeStore[r.toUpperCase()]??{}:{},i=s?this.localeStore[s.toUpperCase()]??{}:{};return"MESSAGES"===n?.toUpperCase()&&"string"==typeof e?this.getLocalizedErrorMessage(o,e)||e:a?bA.replaceWithValue(o[e]||i[e]||e):o[e]||i[e]||e}#p(e,t){return e?.toUpperCase().startsWith("@BASECLASS!DATAPAGE!")?t?`${e}#${t}`:e:e||t}getParagraphLocaleValue(e,t){const n=`${e}!${js.PARAGRAPH}!${t}`,s=this.localeStore[n.toUpperCase()];return s?{category:s.category,content:decodeURIComponent(atob(s.content).split("").map((e=>`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`)).join(""))}:null}getPortalLocaleReference(e){return 2!==PA.getLocalizationVersion()?"":e?`PORTAL!${e}`.toUpperCase():`PORTAL!${PA.getPortalName()}`.toUpperCase()}getCaseLocaleReference(e){return e?`CASE!${e}`.toUpperCase():null}getLocalizationVersion(){return 2}async getLocaleJsons(e){if(!await this.isCurrentLocalePackAvailable())return[];const t=PA.getUseLocale(),n=[],s=PCore.getLocaleUtils().localeStore;if((e=(e=e.filter((e=>!s[e]))).map((e=>e.toUpperCase()))).length>0){const s=e.map((e=>({localeRuleKey:e,promise:hg.getSvcLocale(t,`${e}.json`)}))),r=await Promise.allSettled(s.map((e=>e.promise)));await Promise.all(r.map((async(e,t)=>{if("fulfilled"===e.status){const r=s[t];let a;try{a=await e.value.json()}catch{a=null}a&&n.push({localeRuleKey:r.localeRuleKey,jsonData:a})}})))}return n}async loadLocaleResources(e){await DA.loadLocaleBundle(e),await Promise.all(e.map((e=>RA(e))))}setTimezone(e){this.timezone=e}getTimeZoneInUse(){const e=Intl.DateTimeFormat().resolvedOptions().timeZone;return this.timezone||e}matchPatternWithText(e,t){let n=t;const s=[];for(let t=0;t<e.length;){const r=e[t];if(0!==r.length){const e=n.indexOf(r);if(-1===e)return null;if(t>0){const t=n.slice(0,e);s.push(t)}n=n.slice(e+r.length)}t+=1}return n&&s.push(n),s}getLocalizedErrorMessage(e,t){let n="";if(e[t])return e[t];for(const s of Object.keys(e)){const r=s.split(/\{\d+\}/),a=this.matchPatternWithText(r,t);if(a){const t=e[s];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=PA.getLocale();return this.availableLangPacks||(this.availableLangPacks=await hg.getSvcAvailableLocales()),e&&this.availableLangPacks.includes(e)}getBaseComponentLabels=()=>this.getLocaleForRule("COSMOSFIELDS");#g(e){let t=!1;return e&&"string"==typeof e&&(t=e.includes("@P ")),t}}const xA=e=>{const t=e??PA.getLocale()??"en-US";return iC(t)};So.registerHandler("@L",((e,t)=>t?t.getLocalizationService(t.getLocaleRuleName()).getLocalizedText(e):e)),So.registerHandler("@P",((e,t,n)=>n?cS.getLitePropertyValue(n):t.getValue(e))),So.registerHandler("@E",((e,t,n)=>{try{const s=co(e),r=lo(s);return uo(r,t,n)}catch(e){}return!0})),So.registerHandler("@W",((e,t,n)=>{let s;if(n){const{pageReference:t,context:r}=n;s=qC(t,`.${js.SUMMARY_OF_WHEN_CONDITIONS}.${e}`,r)}else s=t.getContextDataValue(`.${js.SUMMARY_OF_WHEN_CONDITIONS}.${e}`);return!0===s||"true"===s})),So.registerHandler("@ASSOCIATED",((e,t)=>{let n={};const s=[];let r="",a="";const o=t.getPageReference();if(e.startsWith(".")){r=`${o}.${e.substring(1)}`;const s=e.split(".").filter((e=>!!e));s.length>1&&(s.pop(),a=s.join(".")),n=t.getFieldMetadata(e.substring(1))}else n=t.getFieldMetadata(e),r=e;const i=n?.datasource?.tableType,c=n?.datasource?.mode===js.READONLY,l=n?.datasource?.name||"",u=t.getComponentConfig();if(u&&u.deferDatasource&&("object"==typeof u.datasourceMetadata&&null!==u.datasourceMetadata||(u.datasourceMetadata=`@FIELD_META ${e}`,t.setStateProps({datasourceMetadata:u.datasourceMetadata})),i===js.DATA_PAGE))return null;if(i===js.DECISION||i===js.RULE_REFERENCE)return function(e,t){const n=No.getPropertyName(e?.propertyForDisplayText??""),s=No.getPropertyName(e?.propertyForValue??""),r=t.getContextDataValue(`.${js.SUMMARY_OF_EXPRESSIONS}.${e?.name}`)||[];return r?.map((e=>({key:e[s]||e[`.${s}`],value:e[n]||e[`.${n}`]})))}(n?.datasource,t);if(i!==js.DATA_PAGE){const e=t.getLocalizationService(n?.localeReference);return n?.datasource?.records?.map((t=>({key:t.key,value:e.getLocalizedText(t.value)})))}const d=No.getPropertyName(n?.datasource?.propertyForDisplayText),p=No.getPropertyName(n?.datasource?.propertyForValue),g=Array.isArray(n?.datasource?.parameters)?n?.datasource?.parameters:[],h=t.getContextName(),f=[];if(g.forEach((e=>{if(No.isProperty(e?.value)){let t=HC(`.${rS.getFullPropertyReference([a,No.getPropertyName(e.value)])}`,o,h);f.push(rS.getFullPropertyReference([o,a,No.getPropertyName(e?.value)])),null!=t&&""!==t||(t=js.NULL_STRING),s.push(t)}else s.push(e?.value||js.NULL_STRING)})),h){const e=Ao.getContextObjectByName(h)||{};f.forEach((t=>{if(t in e){const n=e[t];e[t]=[...new Set([...n,r])]}else e[t]=[r]})),Ao.addContextName(h,e)}const m=function(e,t,n,s){let r="",a=n;if(t.join(js.HASH_DELIMITER)&&(r=rS.getHashedString(t.join(js.HASH_DELIMITER)),a=n+js.UNDERSCORE_STRING+r),s){const e=GC(),t=e?e[n]?.[a]:{};return Array.isArray(t?.[Ls.getDefaultQualifiedName("pxResults")])?t[Ls.getDefaultQualifiedName("pxResults")]:[]}const o=e.getDataObject(),i=o?.[n]||{},c=i?.[a]||{};return Array.isArray(c?.[Ls.getDefaultQualifiedName("pxResults")])?c[Ls.getDefaultQualifiedName("pxResults")]:[]}(t,s,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}}))})),So.registerHandler("@ROUTING_INFO",((e,t)=>ka(t.getContainerName(),t.getContextName()))),So.registerHandler("@ENV",((e,t)=>{switch(e){case js.ENV_INFO_KEYS.APPLICATION_NAME:return PA.getApplicationName();case js.ENV_INFO_KEYS.ACCESS_GROUP:return PA.getAccessGroup();case js.ENV_INFO_KEYS.APPLICATION_ID:return PA.getApplicationID()||PA.getApplicationName();case js.ENV_INFO_KEYS.USER_NAME:return PA.getOperatorName();case js.ENV_INFO_KEYS.USER_ID:return PA.getOperatorIdentifier();case js.ENV_INFO_KEYS.APPLICATION_DESC:return t.getLocalizationService().getLocalizedText(PA.getApplicationLabel()||"");case js.ENV_INFO_KEYS.USER_IMAGE:return PA.getOperatorImageInsKey();case js.ENV_INFO_KEYS.LOCALE:return PA.getUseLocale();case js.ENV_INFO_KEYS.TIMEZONE:return PA.getTimeZone();case js.ENV_INFO_KEYS.WORK_GROUP:return PA.getOperatorWorkGroup();default:return e}})),So.registerHandler("@DATASOURCE",((e,t)=>{const n=t.getSharedDataPageForReferenceList()||t.getValue(e)||[],s=t.getComponentConfig(),r=Object.keys(s).find((t=>s[t]?.source?.includes(e)));if(r){const{fields:e,copyAll:t,filterDownloadedFields:a}=s[r],o=[];return n.forEach((n=>{const s={};t||a?Object.keys(n).forEach((e=>{const t=No.getPropertyName(e);s[t]=n[t]})):Object.keys(e).forEach((t=>{const r=No.getPropertyName(e[t]);s[t]=n[r]})),o.push(s)})),o}return[]})),So.registerHandler("@FIELD_META",((e,t)=>{let n,s={};if(s=e.startsWith(".")?t.getFieldMetadata(e.substring(1)):t.getFieldMetadata(e),s&&s.datasource&&s.datasource.parameters){let r="";const a=e.split(".").filter((e=>!!e));if(a.length>1&&(a.pop(),r=`.${a.join(".")}`),Array.isArray(s.datasource.parameters)){const e=[];s.datasource.parameters.forEach((n=>{const s={},{name:a,value:o}=n;s.name=a,"string"==typeof o&&o.startsWith("@P")?s.value=`@P ${r}${o.substring(3)}`:s.value=o,e.push(t.resolveConfigProps(s))})),n=e}else n=t.resolveConfigProps(s.datasource.parameters);s={...s,datasource:{...s.datasource,parameters:n}}}return s})),So.registerHandler("@USER",((e,t,n)=>{const s=n?cS.getLitePropertyValue(n,e):t.getValue(e),r=n?cS.getReferencedUser(s,n):t.getReferencedUser(s);return{userId:s,userName:r?r.UserName:null}})),So.registerHandler("@ACTIVE_CASES",((e,t)=>Kh.getOpenedCaseItems(`${t.getContextName()}/${t.getContainerName()}`))),So.registerHandler("@LR",(e=>e)),So.registerHandler("@CASE",((e,t)=>e===js.ID?t.getCaseInfo().getKey():e)),So.registerHandler("@SHARED",(e=>Hf.getSharedState(e))),So.registerHandler("@PARAGRAPH",((e,t)=>{const{useDecision:n,isBanner:s,messageType:r,dismissBanner:a}=zf.getParagraphProperties(e,t),o=zf.hasDecisionBannerContent(e,t);return n&&o?zf.processBannerDecisionParagraph(e,t):s?{htmlContent:zf.processParagraph(e,t),messageType:r,dismissBanner:a}:zf.processParagraph(e,t)})),So.registerHandler("@FORMAT",((e,t)=>{const n=t.getCurrentClassID(),s=TC(e,n);if(!s?.dynamicContents?.length)return null;const{dynamicContents:r}=s;for(let e=0;e<r.length-1;e+=1)if(cS.resolveWhen(r[e].when,t))return{pattern:r[e].content};return{pattern:r[r.length-1].content}})),So.registerHandler("@FILTERED_LIST",((e,t)=>{const n=e.substring(1,e.indexOf("[")),s=e.substring(e.indexOf("]")+2),r=e.substring(e.indexOf("[")+1,e.indexOf("]"));if(!t)return null;const{useCustomContext:a}=t;let o;return rS.isEmpty(a)?o=t.getValue(`.${n}`):(o=a,o=rS.getIn(o,n)),o&&s.length>0?(r&&(o=o.filter((e=>po(r,e)))),o.map((e=>rS.getIn(e,s)))):null})),So.registerHandler("@ADDRESS",((e,t)=>{const n=t.getValue(e)?.[Ls.getDefaultQualifiedName("pyCountry")];return n?`${PCore.getDefaultQualifiedName("pyAddressForm")}_${n}`:PCore.getDefaultQualifiedName("pyAddressForm")})),So.registerHandler("@DATATYPE",((e,t)=>t.getValue(e))),So.registerHandler("@ATTACHMENT",((e,t,n)=>{let s;return s=n?cS.getLitePropertyValue(n):t.getValue(e),Bp.prepareAttachmentData(s)}));const wA=e=>{const t=e.lastIndexOf(".");return t<0?e:e.slice(t+1)};function MA(e,t){const n=e.authorContext;if("string"!=typeof n||!n)return!1;return(n.startsWith(".")?n.substring(1):n)===t}function LA(e,t){const n=e.config;if(!n?.name||"string"!=typeof n.name)return null;const s=t(n.name);return s?Array.isArray(s)?s.find((e=>e.classID===n.ruleClass))??null:s:null}function UA(e,t,n,s="root",r=[]){if(e.config&&function(e,t){const n="string"!=typeof(s=e.value)?null:s.startsWith("@")?s.replace(/^@\w+\s+\./,""):null;var s;return!!n&&n===t}(e.config,t)&&r.push({type:e?.type,config:e.config,path:s}),!e.children)return r;for(let a=0;a<e.children.length;a+=1){const o=e.children[a],i=`${s}.children[${a}]`,c="reference"===o.type?LA(o,n):o;c&&UA(c,t,n,i,r)}return r}So.registerHandler("@FL",((e,t)=>{const n=(e=>e.startsWith(".")?e.slice(1):e)(e),s=t.getFieldMetadata(n);return s&&s.label?t.getLocalizationService(s.localeReference).getLocalizedText(s.label):wA(n)})),So.registerHandler("@DEFERRED",((e,t)=>{const n=t.getFieldMetadata(e);return n?.isDeclarativeTarget?{isDeferred:!0,propertyName:e}:t.getValue(e)})),So.registerHandler("@GENAICOACH",((e,t)=>DC(e,t.getCurrentClassID()))),So.registerHandler("@AIAGENT",((e,t)=>{const n=PC(e,t.getCurrentClassID());if(n)return n;const s=t.getComponentConfig();if(s){const n=s?.coaches?.find((t=>t?.config?.coach?.substring(9)===e&&t?.config?.ruleNamespace))?.config;if(n?.label){const s={label:n.label};t.resolveConfigProps({label:n.label},s);const r=s.label;return{insName:PA.getFeatureMap()?.isNamespaceEnabled&&e.includes(js.DOUBLE_UNDERSCORE_STRING)?e:`${n.ruleNamespace}${js.DOUBLE_UNDERSCORE_STRING}${e}`,label:t.getLocalizedValue(r),type:"agent"}}}return null})),So.registerHandler("@REFRESH",((e,t)=>{const n=t.getCaseInfo().getKey(),s=t.getContextName(),r=t.getPageReference();Cf.registerForRefresh("PROP_CHANGE",t.getActionsApi().refreshCaseView.bind(t.getActionsApi(),n,"",r,{autoDetectRefresh:!0,preserveClientChanges:!1,refreshFor:`${r.replace("caseInfo.content","")}${e}`,resetForm:!0}),`${r}${e}`,`${s}/${r}`,s)})),So.registerHandler("@DW",((e,t,n)=>{let s;const r=`${js.CONTEXT_DATA}.${js.SUMMARY_OF_DYNAMIC_WHENS}.${e}`;if(n){const{context:e}=n??{};s=HC(r,null,e)}else s=t.getValue(r);return!0===s||"true"===s})),So.registerHandler("@CA",((e,t,n)=>n?cS.getLitePropertyValue(n):t.getValue(e)));const FA=new Set(["autocomplete","dropdown"]),jA=["displayAs","hideLabel","linkReference","localeReference","matchPosition","referenceType","selectionMode"];function VA(e,t,n){const s=t.config,r=function(e){const t=e.config??{},n={};return jA.forEach((e=>{void 0!==t[e]&&(n[e]=t[e])})),void 0===t.contextClass&&void 0===t.targetObjectClass||(n.contextClass=t.contextClass??t.targetObjectClass),void 0!==t.referenceList&&(n.referenceList=t.referenceList),n.parameters=t.parameters,n}(e),a=function(e){const t=e.inheritedProps;return Array.isArray(t)?t.reduce(((e,t)=>("object"!=typeof t||null===t||Array.isArray(t)||"prop"in t&&"string"==typeof t.prop&&"value"in t&&(e[t.prop]=t.value),e)),{}):{}}(n),o={...s??{},...r,...a};return"AutoComplete"===t.type&&void 0!==r.referenceList&&(o.datasource=r.referenceList),o}function kA(e,t,n,s){try{if(!e.name||"string"!=typeof e.name)return null;const t=s(e.name);let r;if(Array.isArray(t))r=t;else{if(!t)return null;r=[t]}const a=r.find((t=>t.classID===e.ruleClass));if(!a||!function(e){const t=e.config;return!!t&&"DataReference"===t.template&&"string"==typeof t.displayAs&&FA.has(t.displayAs.toLowerCase())}(a))return null;const o=function(e){const t=e?.children;return Array.isArray(t)&&t.length>0?t[0]:null}(a);return o?{type:o.type,config:VA(a,o,e),path:n}:null}catch{return null}}function BA(e,t,n,s="root",r=[]){if(e.config&&MA(e.config,t)){const t=kA(e.config,e.type,s,n);t&&r.push(t)}if(!e.children)return r;for(let a=0;a<e.children.length;a+=1){const o=e.children[a],i=`${s}.children[${a}]`,c="reference"!==o.type||o.config&&MA(o.config,t)?o:LA(o,n);c&&BA(c,t,n,i,r)}return r}function $A(e,t,n){const s=PA.getInlineEditActionViews(t),r=function(e,t){if(!e||"object"!=typeof e)return null;if(Array.isArray(e))return e.find((e=>e.classID===t))??null;return e}(n(s&&s.length>0?s[0]:Ls.getDefaultQualifiedName("pyEdit")),t);if(!r)return[];const a=UA(r,e,n,"root");return a.length>0?a:BA(r,e,n)}const GA={},WA={},HA={};let qA=0,zA=!1;const YA={},KA={},QA={},JA={},XA={},ZA={},eC={},tC={},nC={},sC={},rC={},aC=(e={},t={})=>{0!==Object.keys(t).length?Object.keys(e).forEach((n=>{const s=e[n],r=t[n];r?((e,t,n,s)=>{const r=Array.isArray(n)?n:[n];(Array.isArray(s)?s:[s]).forEach((e=>{const t=r.findIndex((t=>t.classID===e.classID));if(-1===t)r.push(e);else{const n={isDeclarativeTarget:!1},s={...r[t],...n,...e};r[t]=s}})),t[e]=1===r.length?r[0]:r})(n,t,r,s):t[n]=s})):rS.copy(e,t)},oC=(e,t="")=>{if(!e)return null;const n=KA[e];if(!n)return null;if(!t)return rS.deepClone(n);let s;return s=Array.isArray(n)?n.find((e=>e.classID.toLowerCase()===t.toLowerCase()||e.associationClassID?.toLowerCase()===t.toLowerCase()))||null:n.classID.toLowerCase()===t.toLowerCase()||n.associationClassID?.toLowerCase()===t.toLowerCase()||("Page"===n.type||"Page List"===n.type)&&n?.pageClass?.toLowerCase()===t.toLowerCase()?n:null,s?rS.deepClone(s):null},iC=e=>(sC[e]||(sC[e]=new vA),sC[e]),cC=(e,t)=>(rC[e]||(rC[e]=t()),rC[e]),lC=(e,t,n,s=[])=>{if(!t||!e)return null;if(!e.includes(".")){let r;const a=oC(e,t);return s.length&&(r=s.join(".")),{...a,embeddedType:n,category:r}}const[r,...a]=e.split("."),o=oC(r,t);return o&&s.push(o.label),lC(a.join("."),o?.pageClass,o?.type,s)},uC=e=>{0!==Object.keys(e).length&&(aC(e,HA),zA&&(qA+=1))},dC=()=>qA,pC=()=>{zA=!0},gC=()=>{zA=!1},hC=e=>{aC(e,YA)},fC=e=>{(e=>{e.views&&Object.keys(e.views).length>0&&(aC(e.views,HA),zA&&(qA+=1)),e.navigations&&aC(e.navigations,YA),e.personalizations&&aC(e.personalizations,JA),e.insights&&aC(e.insights,XA),e.paragraphs&&aC(e.paragraphs,GA),e.formats&&aC(e.formats,WA),e.dataTypes&&aC(e.dataTypes,ZA),e.datapages&&aC(e.datapages,eC),e.genAICoaches&&aC(e.genAICoaches,tC),e.AIAgents&&aC(e.AIAgents,nC)})(e),(e=>{const t=e.fields||{};Object.keys(t).forEach((n=>{const s=t[n];if(Array.isArray(s)){if(s.forEach((t=>{e.datapages&&t.datasource&&"DataPage"===t.datasource.tableType&&(t.datasource.mode=e.datapages?.[t.datasource.name].mode);const s=tm(Xf,n,t.definedOnClassID??t.classID);t.localeReference=s})),1===s.length){const[e]=s;t[n]=e}}else e.datapages&&s?.datasource&&"DataPage"===s.datasource.tableType&&(s.datasource.mode=e.datapages[s.datasource.name].mode)}))})(e);const{datapages:t={}}=e;Object.keys(t).forEach((e=>{QA[e]=t[e]})),aC(e.fields,KA)},mC=e=>HA[e],IC=(e,t)=>{const n=HA[e];return Array.isArray(n)?n.some((e=>e.classID===t)):n?.classID===t},EC=e=>YA[e],yC=e=>e in QA?QA[e]:null,AC=e=>e in JA?JA[e]:null,CC=e=>e in XA?XA[e]:null,SC=e=>{const t={};return Object.keys(KA).forEach((n=>{const s=KA[n];let r;Array.isArray(s)?r=s.find((t=>e===t.classID)):e===s.classID&&(r=s),r&&(t[n]=rS.deepClone(r))})),t},_C=(e,t)=>{const n=oC(e,t),s=n?.datasource?.parameters;return s?rS.deepClone(s):null},NC=(e,t)=>{let n=null;const s=GA[e];return s&&(Array.isArray(s)?n=s.find((e=>e.classID===t)):s.classID===t&&(n=s)),n?rS.deepClone(n):null},TC=(e,t)=>{let n=null;const s=WA[e];return s&&(Array.isArray(s)?n=s.find((e=>e.classID===t)):s.classID===t&&(n=s)),n?rS.deepClone(n):null},DC=(e,t)=>{let n=null;const s=tC[e];return s&&(Array.isArray(s)?n=s.find((e=>e.classID===t)):s.classID===t&&(n=s)),n?rS.deepClone(n):null},PC=(e,t)=>{let n=null;const s=nC[e];return s&&(Array.isArray(s)?n=s.find((e=>e.classID===t)):s.classID===t&&(n=s)),n?rS.deepClone(n):null},OC=e=>{if(e in ZA){const{savableDataPage:t}=ZA[e];return t}return null},RC=e=>{const t=eC[e];if(!t)return null;const{classID:n,isAlternateKeyStorage:s,parameters:r}=t;if(s)return r.map((e=>({keyName:e.name,isAlternateKeyStorage:s,linkedField:e.linkedField})));const a=ZA[n];return a?a.classKeys.map((e=>({keyName:e,isAlternateKeyStorage:s}))):[]},bC=e=>{if(e in ZA){const{lookupDataPage:t}=ZA[e];return t}return null},vC=e=>{if(Object.hasOwn(ZA,e)){const{lookupDataPageInfo:t}=ZA[e];return t}return null},xC=(e,t)=>{const n=e.split("."),s=n.pop(),r=new Am({options:{pageReference:`${n.join(".")}`,context:t}}),a=oC(s,r.getCurrentClassID())?.additionalInformation;if(!a?.includes("@PARAGRAPH"))return a;const o=No.trimAnnotation(a);return zf.processParagraph(o,r)},wC=(e,t)=>{const n=e.split("."),s=n.pop(),r=new Am({options:{pageReference:`${n.join(".")}`,context:t}}),a=oC(s,r.getCurrentClassID()),o={};return r._classID=r.getCurrentClassID(),r.resolveConfigProps(a,o),o},MC=(e,t)=>$A(e,t,mC);class LC{constructor(){this.name="CascadeManager",this.cascadeSubscribers={},this.cascadeResetSubscribers={},this.listChangeSubscribers=[]}registerResetDependencies(e,t,n,s,r,a="singleRecord"){if(!e||!n||!s?.length)return;const o=n.startsWith(".")?`${t}.${n.substring(1)}`:n,i=this.cascadeResetSubscribers[e]||{},c=this._handlePageReference(t,n,r);s.forEach((e=>{if(!e)return;let t=e.startsWith(".")?e.substring(1):e;if(t=rS.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,s,r){if(!e||!n||!s?.length)return;const a=n.startsWith(".")?`${t}.${n.substring(1)}`:n,o=this.cascadeResetSubscribers[e]||{},i=this._handlePageReference(t,n,r);s.forEach((e=>{if(e){let t=e.startsWith(".")?e.substring(1):e;if(t=rS.getFullPropertyReference([i,t]),t in o){const e=o[t];rS.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,s,r){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[r]){a[r]=s;const o=HC(n,t,e);a.previousValue="object"==typeof o?null:o}}))}registerListField(e,t,n,s,r){const a=LC._getFieldsForList(e,t,n);a.length>0&&(this.registerFields(e,t,a,s,r),yh.enableCascade(e))}unRegisterListField(e,t,n,s){const r=LC._getFieldsForList(e,t,n);r.length>0&&this.unRegisterFields(e,t,r,s)}static _getFieldsForList(e,t,n){const s=[],r=oC(n,HC("classID",t,e));return r&&!Array.isArray(r)&&r.datasource&&r.datasource.parameters&&Object.values(r.datasource.parameters).forEach((e=>{if(No.isProperty(e)){const t=No.trimAnnotation(e);s.push(t)}})),s}unRegisterFields(e,t,n,s){this.cascadeSubscribers[e]&&n?.forEach((n=>{if(!this.cascadeSubscribers[e][`${t}${n}`])return;const r=this.cascadeSubscribers[e][`${t}${n}`];r[s]&&delete r[s]}))}triggerCascade(e,t,n,s){let r=!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&&(r=!0,s?s.add(o[a]):o[a](t,n))})),r&&(this.cascadeSubscribers[e][t].previousValue=n))}purgeCascadeFields(e){delete this.cascadeSubscribers[e]}handleServerChanges(e,t=[],n=[]){if(!e)return;const s=new Set;n.forEach((t=>{const n=HC(t,"",e);this.triggerCascade(e,t,n,s)})),s.forEach((e=>{e()})),0!==this.listChangeSubscribers.length&&0!==t.length&&t.forEach((t=>{this.listChangeSubscribers.forEach((n=>{const s=HC(t,"",e);n(e,t,s)}))}))}_updateChangedProperties(e,t,n,s,r,a,o,i){const c=n&&i.some((e=>s.startsWith(e)));if(e!==t||c){const e=s.lastIndexOf("."),t=s.substring(0,e),i=s.substring(e),c=pd.getMessages({type:"error",property:i,context:r,pageReference:t});if(c?.length>0&&o.push(s),!n)return;a.push(s)}}isChangedListPropertyExist(e){let t=!0;return 0!==this.listChangeSubscribers.length&&rS.isValidPageListProperty(e)||(t=!1),t}_getServerProperties(e,t,n,s,r,a,o){if("object"!=typeof e){r.push(n.replace(/\.(\d+)/g,"[$1]"));const i=this.isChangedListPropertyExist(n);n=n.replace(/\.(\d+)/g,"[$1]");const c=HC(n,"",t);if(void 0===c&&!e&&0!==e)return;return void this._updateChangedProperties(c,e,i,n,t,s,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=HC(u,"",t);n&&n?.length===e[l].length||o.push(u.replace(/\.(\d+)/g,"[$1]"))}this._getServerProperties(e[l],t,u,s,r,a,o)}}getServerProperties(e,t,n=js.CASE_INFO.CASE_INFO_CONTENT){const s=[],r=[],a=[],o=rS.getIn(e,n);return o&&t?(this._getServerProperties(o,t,n,s,a,r,[]),{changedListProperty:s,leafProperty:a,changedPropertyWithError:r}):{changedListProperty:s,leafProperty:a,changedPropertyWithError:r}}_handlePageReference(e,t,n){let s=e;if("Page"===n&&t.startsWith(".")&&t.slice(1).includes(".")){s=`${e}${t.substring(0,t.lastIndexOf("."))}`}return s}registerForListChanges(e=(()=>{})){this.listChangeSubscribers.push(e)}unRegisterForListChanges(){this.listChangeSubscribers=[]}}const UC=new LC;let FC=null;const jC=e=>e?.split(/\.(?![^[]+\])|\[|\]/g).filter(Boolean),VC=e=>{FC=e},kC=()=>FC,BC=e=>{if(!e)return;let t=[],n=[],s=[];if(Array.isArray(e)||"MERGE_DATA"!==e.type||({changedListProperty:t,leafProperty:n,changedPropertyWithError:s}=UC.getServerProperties(e.payload.data,e.payload.context,e.payload.rootPageReference)),FC?.dispatch(e),!Array.isArray(e)&&"MERGE_DATA"===e.type){if(s.length&&!e.payload.skipValidation){s.map((e=>{const t=e.lastIndexOf(".");return{property:e.substring(t),pageReference:e.substring(0,t)}})).forEach((({property:t,pageReference:n})=>{pd.clearMessages({type:"error",property:t,pageReference:n,context:e.payload.context});const s=Zu.getFieldReferenceForProperty(e.payload.context,`${n}${t}`);if(s){const e=cS.resolveContextTreeNodeProps(s.props);Yp.validate(e.componentName?.toLowerCase(),e.propertyName,cS.getLitePropertyValue(e,e.propertyName),e)}}))}UC.handleServerChanges(e.payload.context,t,n)}},$C=e=>kC()?.getState().data?.[e],GC=()=>kC()?.getState().data[js.SHARED],WC=(e,t,n)=>{if(!(s=e)||s.startsWith('"')||s.startsWith("'"))return(e=>e&&e.trim().substring(1,e.length-1))(e);var s;const r=e?.startsWith(".")?t+e:e,a=jC(r);return rS.getIn(n,a)},HC=(e,t,n)=>WC(e,t,$C(n)),qC=(e,t,n)=>WC(t,e?`${js.CONTEXT_DATA}.${e}`:`${js.CONTEXT_DATA}`,$C(n)),zC=(e,t,n)=>((e,t,n)=>{const s=jC(`${t}.${n}`);return rS.getIn(e,s)})($C(n),`${js.CONTEXT_DATA}.${e}`,t),YC=e=>{const{context:t}=e,n=kC()?.getState().data[t];if(n)return gr;const{action:s}=e;return["createWork","showHarness","openAssignment","openWorkByHandle","initRouting"].includes(s)?Or:gr},KC=(e,t)=>{const n=jC(t);return rS.deleteIn(e,n)},QC=e=>!Array.isArray(e)&&"object"==typeof e,JC=(e,t=[],n=[])=>{Array.isArray(t)&&t.length>0&&t.forEach((t=>{t.allowMultiple?t.allowMultiple&&!n.includes(t.path)&&rS.setIn(e,t.path,[]):rS.setIn(e,t.path,{})})),n.length>0&&rS.rearrangeProperties(n,e)},XC=(e,t,n={})=>{const{isArrayDeepMerge:s,propertiesToReplace:r=[],propertiesToReArrange:a=[]}=n;Array.isArray(e)&&!t&&(t=[]),JC(e,r,a);const o=(e,t)=>{if(QC(e)&&null!==t&&"string"!=typeof t&&"number"!=typeof t&&"boolean"!=typeof t)return Array.isArray(t)?t:vs(e,t,o);if(Array.isArray(e)&&null!==t&&Array.isArray(t)){if(s)return vs(e,t,o);{const n=t.length;if(void 0===s&&n===e.length)return vs(e,t,o)}}return""===t&&e&&"object"==typeof e?e:t};return o(e,t)},ZC=(e,t,n,s={isArrayDeepMerge:!0})=>{const{isArrayDeepMerge:r}=s,a=jC(t);if("object"==typeof n){const t=XC(rS.getIn(e,a),n,{isArrayDeepMerge:r});return rS.setIn(e,a,t)}return rS.setIn(e,a,n)},eS=(e,t,n)=>{const s=jC(t);return rS.setIn(e,s,n)},tS=()=>{const e=la,{promise:t,actionMgrID:n}=Dg.actionManagerPromise(e);return BC({type:e,payload:{actionMgrID:n}}),t},nS=e=>{const t=kC()?.getState();return!!t?.data?.[e]};class sS{static mergeDeep(e,t){return vs(t,e)}static hasIn(e,t){return Fn(e,t)}static getIn(e,t,n){return jn(e,t,n)}static setIn(e,t,n){return Wn(e,t,n)}static deleteIn(e,t){return wn(e,t)}static isObjectEmpty(e){return!e||0===Object.entries(e).length}static isEmpty(e){return ws(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 isValidPropertyReference(e){return"string"==typeof e&&(""===e||""!==e.trim())}static isWhenExist(e){const t=["visibility","disabled","readOnly","required"];let n=!1;for(const s of Object.keys(e)){const r=e[s];r&&"object"==typeof r&&!Array.isArray(r)?n=n||sS.isWhenExist(r):t.includes(s)&&"string"==typeof r&&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 s=new Set;if(e&&Object.keys(e).forEach((r=>{const a=e[r];t.includes(r)&&"string"==typeof a&&a.startsWith("@W ")&&(n=No.trimAnnotation(a),s.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=No.trimAnnotation(t[e]),s.add(n))}))}return[...s]}static isExpressionExist(e){const t=["disabled","visibility","readOnly","required"];let n=!1;for(const s of Object.keys(e))t.includes(s)&&"string"==typeof e[s]&&e[s]?.startsWith("@E ")&&(n=!0);return n}static buildDataObject(e,t){let n={};const s=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 s=t;t.startsWith(".")&&(s=t.substring(1)),n[s]=e[t]})),s}static buildObject=(e,t,n)=>{if(void 0===n)return;const s=e.split(".");let r=0;for(;r<s.length-1;r+=1){const e=s[r];e?.toString().length&&!t[e]&&(t[e]={}),t[e]&&(t=t[e])}"object"==typeof n?(t[s[r]]||(t[s[r]]=Array.isArray(n)?[]:{}),XC(t[s[r]],n,{isArrayDeepMerge:!0})):t[s[r]]=n};static getHashedString(e){return(0,ln.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 Xt(e,t)}static isContains(e,t){const n=Object.keys(e);for(let s=0;s<n.length;s+=1)if(e[n[s]]&&sS.isEqual(e[n[s]],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,s=[])=>{Object.entries(e).forEach((([r,a])=>{s.push(Array.isArray(e)?Number(r):r),Array.isArray(a)?a.forEach(((e,t)=>{s.push(t),n(e,s),s.pop()})):"object"==typeof a?n(a,s):t(s.slice(),a),s.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(){if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID();const e="undefined"!=typeof performance&&"function"==typeof performance.now?performance.now().toString(36).replace(".",""):Math.random().toString(36).slice(2);return`${Date.now().toString(36)}${e}`}static unflatten(e){const t={};return Object.entries(e).forEach((([e,n])=>{const s=e.split(".");let r;s.reduce(((e,t,a)=>(r=e[t]?e[t]:Number.isNaN(Number(s[a+1]))?s.length-1===a?n:{}:[],e[t]=r,e[t])),t)})),t}static flatten(e,t,n){t||(t=""),Array.isArray(e)?e.forEach(((e,s)=>{sS.flatten(e,`${t}[${s}]`,n)})):"object"==typeof e&&null!==e?Object.keys(e).forEach((s=>{const r=t?`${t}.${s}`:s;sS.flatten(e[s],r,n)})):n[t]=e}static buildInstructionPageReference(e,t){const n=e.startsWith(js.OBJECT_INFO.OBJECT_INFO)?`${e}${t}`.replace(js.OBJECT_INFO.OBJECT_INFO_CONTENT,""):`${e}${t}`.replace(js.CASE_INFO.CASE_INFO_CONTENT,"").replace(js.DATA_INFO.DATA_INFO_CONTENT,"");return ep.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 segmentsMatch=(e,t)=>{const n=e.split("."),s=t.split(".");return n.length===s.length&&n.every(((e,t)=>{if(e===s[t])return!0;if(e.endsWith("()")){const n=e.slice(0,-2),r=s[t];return r.startsWith(n)&&/^\[\d+\]$/.test(r.slice(n.length))}return!1}))};static isString(e){return"string"==typeof e}static rejectPendingActions(e){return e.forEach((e=>e.payload.actionMgrID&&Dg.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","@CA"]),n=e.indexOf(" "),s=e.substring(0,n);return t.has(s)}static trimDotForProperty(e){return"string"==typeof e&&e.startsWith(".")?e.substring(1):e}static decodeHtmlEntities(e){if("undefined"!=typeof document){const t=document.createElement("textarea");return t.innerHTML=e,t.value}let t=e;return Object.entries({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'","&#x27;":"'","&#x2F;":"/","&#47;":"/"}).forEach((([e,n])=>{t=t.split(e).join(n)})),t=t.replace(/&#(\d+);/g,((e,t)=>String.fromCharCode(parseInt(t,10)))),t=t.replace(/&#x([a-f\d]+);/gi,((e,t)=>String.fromCharCode(parseInt(t,16)))),t}static convertObjectWithStringToBoolean(e){if(e&&!Array.isArray(e)&&"object"==typeof e)return Object.keys(e).forEach((t=>{let n;const s=e[t];"string"==typeof s?n="true"===s||"false"!==s&&s:"object"==typeof s?(n=s,sS.convertObjectWithStringToBoolean(s)):n=s,e[t]=n})),e}static rearrangeProperties(e,t){e.forEach((e=>{let n=sS.getIn(t,e);if(!n)return;const s=Object.hasOwn(n,Ls.getDefaultQualifiedName("pyCount"));if(s&&(n=n.pxResults),!n)return;const r=n.filter((e=>!e.error)),a=n.filter((e=>e.error));sS.setIn(t,s?`${e}.pxResults`:e,[...r,...a])}))}static getETag(e){if(!e)return;let t=e;const n=t?.split("/")||[],s=["workarea","modal","actionarea"],r=n.findIndex((e=>s.some((t=>e.startsWith(t)))));return-1!==r&&(t=n.slice(0,r+1).join("/")),kC()?.getState()?.data[t]?.caseInfo?.headers?.etag}static PAGELIST_PATH_REGEX=/^(?!.*\.\.)(?!\d)\w+(\.\w+)*\.\d+(\.\w+)+$/;static isValidPageListProperty(e){return sS.PAGELIST_PATH_REGEX.test(e)}static generateDataPageHashWithParameters(e,t,n){const s=[];let r="";const a=n.getPageReference(),o=n.getContextName();Object.keys(e).forEach((t=>{const n=e[t];let r=No.isProperty(n)?HC(`.${No.getPropertyName(n)}`,a,o):n;null!=r&&""!==r||(r=js.NULL_STRING),s.push(r)}));let i=t;const c=s.join(js.HASH_DELIMITER);return c&&(r=sS.getHashedString(c),i=t+js.UNDERSCORE_STRING+r),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){const t=new Date(e).getTime();return Number.isNaN(t)?null:t}const[,n,s,r,a,o,i,c]=t.map(Number);return new Date(n,s-1,r,a,o,i,c).getTime()}static formatToUTCDate(e,t){if(!e)return e;const n=new Date(e);if(Number.isNaN(n.getTime()))return e;const s=(e,t=2)=>String(e).padStart(t,"0"),r=n.getUTCFullYear(),a=s(n.getUTCMonth()+1),o=s(n.getUTCDate());if("Date"===t)return`${r}${a}${o}`;return`${r}${a}${o}T${s(n.getUTCHours())}${s(n.getUTCMinutes())}${s(n.getUTCSeconds())}.${s(n.getUTCMilliseconds(),3)} GMT`}static isLeafProperty(e){return Boolean(e)&&!e.includes(".")}static getMetadataType(e,t,n){const s=sS.isLeafProperty(e)?oC(e,t):n.getFieldMetadata(e);return Array.isArray(s)?s[0]?.type:s?.type}static toStringParameterValue(e){return"string"==typeof e?e:e instanceof Date?e.toISOString():null}static resolveParameterValue(e,t,n,s,r){if(n&&Object.hasOwn(n,e))return n[e];if(!zg.isProperty(t))return t;const a=null!==r?zg.getPropertyName(t):zg.getLeafPropertyName(t);return s.getValue(`.${a}`)}static formatParameterValue(e,t,n,s,r){if(!zg.isProperty(t))return e;const a=null!==s?zg.getPropertyName(t):zg.getLeafPropertyName(t);if(!a)return e;const o=sS.getMetadataType(a,r,n);if(!o)return e;const i=sS.toStringParameterValue(e);return"Date"===o?i?i.includes("T")?sS.formatToUTCDate(i,"Date"):sS.formatToUTCDate(`${i}T00:00:00Z`,"Date"):e:"DateTime"===o&&i?sS.formatToUTCDate(i,"DateTime"):e}static resolveAndFormatParameters(e,t,n,s,r){const a={};for(const o of Object.keys(e)){const i=e[o];if("string"!=typeof i)a[o]=i;else{const e=sS.resolveParameterValue(o,i,r,t,n);a[o]=sS.formatParameterValue(e,i,t,n,s)}}return a}static normalizePropertyRef(e){const t=e.replace(/\[\d+\]/g,"");return t.startsWith(".")?t.substring(1):t}static resolvePageClass(e,t){if(!t)return;const n=(e=this.normalizePropertyRef(e)).split(".");let s;s=n.length>1?n.slice(0,-1):n;let r=t;for(const e of s){const t=oC(e,r);if(!t)return;if(Array.isArray(t)&&t[0]?.pageClass?r=t[0].pageClass:!Array.isArray(t)&&t.pageClass&&(r=t.pageClass),!r)return}return r}static isNestedObject(e){return ds(e)&&!Array.isArray(e)}static pruneKeys=(e,t,n=!1)=>{if(!k(e))return e;const s=t instanceof Set?t:new Set(t);return n?(sS.isNestedObject(e)?Object.keys(e).forEach((t=>{const n=e[t];if(s.has(t)){const n=Object.getOwnPropertyDescriptor(e,t);n&&n.configurable?delete e[t]:Reflect.set(e,t,void 0)}else n&&(ds(n)||Array.isArray(n))&&sS.pruneKeys(n,s,!0)})):Array.isArray(e)&&e.forEach((e=>{(ds(e)||Array.isArray(e))&&sS.pruneKeys(e,s,!0)})),e):Array.isArray(e)?e.map((e=>ds(e)||Array.isArray(e)?sS.pruneKeys(e,s,!1):e)):sS.isNestedObject(e)?Object.keys(e).reduce(((t,n)=>{if(!s.has(n)){const r=e[n];t[n]=ds(r)||Array.isArray(r)?sS.pruneKeys(r,s,!1):r}return t}),{}):e}}const rS=sS,aS=js.SUMMARY_OF_LISTS,oS=js.SUMMARY_OF_WHEN_CONDITIONS;class iS{static updateData(e){Object.keys(e).forEach((t=>{BC(fS({context:t,data:e[t]}))}))}static updateContextData(e){Object.keys(e).forEach((t=>{BC(fS({context:t,data:e[t]}))}))}static resolveWhen(e,t){return!!t.getContextDataValue(`.${oS}.${e}`)}static resolveFieldValue(e,t){return t.getLocalizedValue(e)}static resolveNavigation(e,t){const n=this.resolveName(e,t);return EC("string"==typeof n?n:"")}static resolveView(e,t,n=""){const s=mC(this.resolveName(e,t));let r=[];if(Array.isArray(s)&&s.length>0){if(t&&s.length>1){if(n||(n=t.getValue(js.CLASS_ID)||""),!n)return;r=s.filter((e=>e[js.CLASSID]===n))}return 0===r.length?s[0]:r[0]}return s}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=No.handleAnnotation(e,t)),e)}static getContextPath(e,t){return("number"==typeof t||t)&&("number"==typeof(t=No.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 s;if(t)s=t.startsWith(js.CLASS_ANNOTATION)?t.split(js.CLASS_ANNOTATION)[1].trim():this.resolveClassID(t,e.getPageReference(),e.getContextName(),e.getValue(js.CASE_INFO.CASE_INFO_CLASSID));else if(n?.authorContext){const t=e.getFieldMetadata(n.authorContext);if(t){const e=["refer","copy"].includes(t.dataRetrievalType),n="Page List"===t.type;s=e&&n?t.pageClass:t.classID}s||(s=n.ruleClass)}return s}static resolveReference(e,t){const{type:n}=e;let s;if("reference"===n){const{config:n}=e,r=n?.type,{ref:a,name:o,context:i}=n||{},c=this.getRuleClass(t,i,n);return t&&(t._ruleClass=c),"navigation"===r?s=this.resolveNavigation(a||o,t):"view"===r?s=this.resolveView(a||o,t,c||""):"widget"===r&&(s={type:"Widget",config:{name:o,ruleClass:c}}),s}return e}static resolvePropertyReference(e,t,n){return HC(t,e,n)}static getProperty(e,t,n){let s=this.resolvePropertyReference(t,e,n);if(null==s||0===s.length){const r=zC(`${t}.${aS}`,e,n);r&&(s=this.resolvePropertyReference(t,r,n))}return s}static getPropertyValue(e,t,n){return e=No.trimAnnotation(e),this.getProperty(e,t,n)}static getReferencedUser(e,t){const n=iS.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:s,hasSuggestions:r,pageReference:a,context:o}=e;let i=t||s||"";return n?(i=i.startsWith(".")?i.substring(1):i,i.split(".").reduce(((e,t)=>e?.[t]??void 0),n)):r&&i===s?iS.getPropertyValue(i,a,o?`${o}/${js.SUGGESTION}`:void 0):iS.getPropertyValue(i,a,o||void 0)}static _handlePropString(e,t,n,s,r){n.startsWith("@")?e[t]=No.handleAnnotation(n,s,r):e[t]=n}static _resolveProps(e,t,n){e&&Object.keys(e).forEach((s=>{const r=e[s];"string"==typeof r?this._handlePropString(e,s,r,t,n):Array.isArray(r)?r.forEach((s=>{this._resolveProps("object"==typeof s?s:e[s],t,n)})):"object"==typeof r&&this._resolveProps(e[s],t,n)}))}static resolveProps(e,t,n){return e&&t?(rS.mergeDeep(e,t),this._resolveProps(t,n,void 0),t):t}static resolveContextTreeNodeProps(e){const t={};return e?(rS.mergeDeep(e,t),this._resolveProps(t,void 0,e),rS.resolveStringBooleans(t)):t}static resolvePropertyPageClass(e,t){const n=rS.resolvePageClass(e,t),s=e.substring(e.lastIndexOf(".")+1),r=oC(s,n);let a;if(r)return a=Array.isArray(r)?r[0]?.pageClass:r.pageClass,a}static resolveClassID(e,t,n,s){const r=No.trimAnnotation(e);let a=r.startsWith(".")?`${t}${r}`:r;for(;a;){const e=HC(js.CLASS_ID,a,n);if(e)return e;if(s){const e=this.resolvePropertyPageClass(r,s);if(e)return e}const t=a.lastIndexOf(".");if(-1===t)break;a=a.substring(0,t)}return null}}const cS=iS;const lS=new class{constructor(){this.actionHandlers={}}getHandler(e){return this.actionHandlers[e]}registerHandler(e,t){this.actionHandlers[e]=t}},uS=lS;const dS=class{static#h=[];static#f=!1;static getActionHandlers=(e,t,n)=>{const s=[];return{mouseenter:"hover",change:"onChange",blur:"onBlur"}[n]!==t||e.forEach((e=>{const t=uS.getHandler(e.action),{config:n}=e;s.push({handler:t,config:n})})),s};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#m=(e,t,n)=>{for(let s=0;s<e.length;s+=1){const r=e[s],a={actionHandler:r.handler,component:t,eventType:n,config:r.config};this.#h.push(a)}};static buildActionObject=(e,t)=>{const n={...e};return n.context="Browser"===PA.getRuntime()?t.getContextName():n.context,n.pageReference=t.getPageReference(),n.actionMgrID=Dg.getNextActionMgrId(),n};static#I=e=>{const t=e.actionHandler,n=e.component,{config:s}=e,r={};cS.resolveProps(s,r,n),t&&(t(e.eventType,r,n),this.#E())};static#E=()=>{if(!this.#f){if(0===this.#h.length)return;const e=this.#h.shift();if(!e)return;this.#I(e),e.config&&"true"===e.config.parallel&&this.#h.length>0&&this.#E()}};static#y=()=>{this.#E()};static#A=(e,t,n)=>{this.#m(e,t,n),this.#y()};static getFullRef=e=>{const t=e.getPageReference(),n=e.getComponentConfig().value;return cS.getContextPath(t,n)};static#C(e,t){const n=e.getComponentConfig().behaviours||[];for(let s=0;s<n.length;s+=1){const{behaviour:r,actions:a}=n[s];if(a){const n=this.getActionHandlers(a,r,t);n&&n.length>0&&this.#A(n,e,t)}}}static changeHandler=(e,t)=>{const n=e.getStateProps().value,s=e.getContextName();od({type:Fs.MESSAGES.MESSAGES_TYPE_ERROR,property:n,pageReference:e.getPageReference(),context:s});if(!("Browser"===PA.getRuntime()?"nativeEvent"in t&&t.nativeEvent instanceof Event||t instanceof Event:"nativeEvent"in t&&!!t.nativeEvent||t instanceof Event)&&"value"in t&&(null===t.value||"prop"in t&&void 0!==t.prop)){if("object"==typeof(r=t)&&null!==r){const n=e.getPageReference(),r=e.getStateProps();for(const e of Object.keys(t)){const a=r[e],o=t[e];BC({type:Xs,payload:{reference:cS.getContextPath(n,a),value:o,context:s}}),BC({type:er,payload:{reference:cS.getContextPath(n,a),value:o,context:s}})}}}else{let n,{target:r}=t;null===r&&t&&"auxiliaryTarget"in t&&t.auxiliaryTarget&&(r=t.auxiliaryTarget),n=void 0===r?"value"in t?t.value:void 0:"value"in r?r.value:r.innerText;const a=this.getFullRef(e);BC({type:Xs,payload:{reference:a,value:n,context:s}}),void 0!==r&&this.isEditable(r)&&!this.isNonKeyInput(r)||BC({type:er,payload:{reference:a,pageReference:e.getPageReference(),value:n,context:s,propertyName:e.getComponentConfig().value,classID:e.getValue(js.CLASS_ID)}})}var r};static blurHandler=(e,t)=>{let{target:n}=t;null===n&&t&&"auxiliaryTarget"in t&&(n=t.auxiliaryTarget);const{value:s,validationValue:r}=n,a=this.getFullRef(e),o=e.getContextName();n.clearMessages&&od({type:Fs.MESSAGES.MESSAGES_TYPE_ERROR,property:e.getStateProps().value,pageReference:e.getPageReference(),context:o}),this.isEditable(n)&&(e.getValidationApi().validate("validationValue"in n?r:s),e.isInsideList()&&e.getListActions().updateProperty(e.getStateProps().value,s),this.isNonKeyInput(n)||BC({type:er,payload:{reference:a,pageReference:e.getPageReference(),value:s,context:o,propertyName:e.getComponentConfig().value,classID:e.getValue(js.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.#C(e,n)};static pause=()=>{this.#f=!0};static resume=()=>{this.#f=!1,this.#E()};static isQueueEmpty=()=>0===this.#h.length;static clearQueue=()=>{this.#h=[]};static getActionsQueue=()=>this.#h;static EVENTS_MAP={click:"onClick",change:"onChange",hover:"onMouseEnter",blur:"onBlur"}},pS="CREATE_WORK",gS=e=>({type:pS,payload:e});const hS=(e,t,n,s,r="")=>{const a=[];Object.keys(e).forEach((o=>{"object"==typeof e[o]&&o.includes("[")?function(e,t,n,s,r,a,o){const i=s.substring(0,s.indexOf("[")),c=s.substring(s.indexOf("[")+1,s.indexOf("]"));let l=t[i];const u=`${rS.trimDotForProperty(r)}.${i}`;o.includes(u)&&Object.hasOwn(l,Ls.getDefaultQualifiedName("pyCount"))&&(l=l.pxResults),Array.isArray(l)&&(l?.splice(+c,1,e[s]),a.push(i),n.add(`${r}.${s}`))}(e,t,n,o,r,a,s):e[o]&&"object"==typeof e[o]?(t[o]||(t[o]=Array.isArray(e[o])?[]:{}),hS(e[o],t[o],n,s,`${r}.${o}`)):t[o]=e[o]})),function(e,t,n){Object.keys(e).forEach((s=>{(Array.isArray(e[s])&&!n.includes(s)||!Array.isArray(e[s])&&!Object.hasOwn(t,s))&&delete e[s]}))}(t,e,a)},fS=(e,t={})=>{const{serverPrecedenceFields:n=[],propertiesToReplace:s=[],propertiesToReArrange:r=[]}=t,{context:a,data:o,isArrayDeepMerge:i,preserveClientChanges:c=!1}=e,l=ty(a,!0),u=$C(a);let d={};if(u&&o){d=JSON.parse(JSON.stringify(u));const e=JSON.parse(JSON.stringify(o));r.length>0&&rS.rearrangeProperties(r,d);const t=new Set;hS(l,d,t,r),((e,t,n)=>{const s=new Set;e.forEach((e=>{e=rS.trimDotForProperty(e);const[r,a,o]=ku(e);if(r&&a&&o&&!s.has(`${r}.${a}`)){const e=rS.getIn(n,`${r}.${a}`)||[];Array.isArray(e)&&e.forEach(((e,n)=>{n!==+o&&rS.setIn(t,`${r}.${a}[${n}]`,e)})),s.add(`${r}.${a}`)}}))})(t,d,e)}!function(e,t){const n=rS.getIn(e,js.REFERENCED_USERS);let s;if(void 0!==n){if(!Array.isArray(n)&&"object"==typeof n)return s=rS.getIn(t,js.REFERENCED_USERS,{}),void rS.setIn(e,js.REFERENCED_USERS,{...s,...n});s=rS.getIn(t,js.REFERENCED_USERS,[]);const r=new Map;for(const e of[...s,...n])if(r.has(e.UserID)){const t=r.get(e.UserID);r.set(e.UserID,{...t,...e})}else r.set(e.UserID,e);n.length=0;for(const e of r.values())n.push(e)}}(o,u);const p=rS.getIn(e?.data,js.OBJECT_INFO.OBJECT_INFO_CONTENT_CLASS_ID),g=YI.isExternalObject(p),h=g?{[js.OBJECT_INFO.OBJECT_INFO]:{[js.CONTENT]:{...d[js.OBJECT_INFO.OBJECT_INFO]?.[js.CONTENT]}}}:{[js.CASE_INFO.CASE_INFO]:{[js.CONTENT]:{...d[js.CASE_INFO.CASE_INFO]?.[js.CONTENT]}}},f=g?js.OBJECT_INFO.OBJECT_INFO_CONTENT:js.CASE_INFO.CASE_INFO_CONTENT;let m=o;return c?(n.forEach((e=>{const t=`${f}.${e}`;rS.deleteIn(h,t)})),m=XC(o,h,{isArrayDeepMerge:i??!0})):((e,t)=>{const n=QE[e]||{};Object.keys(n).forEach((e=>{rS.hasIn(t,e)&&(n[e].value=rS.getIn(t,e))}))})(a,o),{type:Cr,payload:{...e,data:m,...s.length>0?{propertiesToReplace:s}:null,...r.length>0?{propertiesToReArrange:r}:null}}},mS=e=>({type:"SHOW_HARNESS",payload:e}),IS=e=>({type:tr,payload:e}),ES=e=>({type:nr,payload:e}),yS=e=>({type:"ADD_WORK",payload:e}),AS=e=>({type:pr,payload:e}),CS=e=>({type:Dr,payload:e}),SS=e=>({type:Pr,payload:e}),_S=e=>({type:Or,payload:e}),NS=e=>({type:br,payload:e}),TS=e=>({type:vr,payload:e}),DS=e=>({type:Mr,payload:e}),PS=e=>({type:Ur,payload:e}),OS=e=>({type:Lr,payload:e}),RS=e=>{const{containerItemID:t}=e;e.suggestionContexts=ky(t);const n=e?.data?.caseInfo?.content,s=Object.keys(n||{}).length>0;return e.propertiesToReplace||(e.propertiesToReplace=s?YI.getPropertiesToReplace(t):[]),{type:jr,payload:e}},bS=e=>{const{context:t}=e;return{type:or,payload:{context:t}}},vS=e=>{const{context:t}=e;return{type:ir,payload:{context:t}}},xS=e=>({type:Vr,payload:e}),wS=e=>({type:Fr,payload:e}),MS=e=>({type:ia,payload:e}),LS=e=>{const{context:t,containerItemID:n}=e;let s=t;return s||(s=Ly(n)),e.context=s,e.deleteContext=!eA(n),e.childContainers=jy(n),e.childContainersContexts=Vy(n),e.transientItems=tA([...e.childContainersContexts,n]),e.suggestionContexts=ky(n),n===t&&(e.caseID=HC(js.CASE_INFO.CASE_INFO_ID,"",t)||HC(js.OBJECT_INFO.OBJECT_INFO_ID,"",t),e.RemoteSystemID=HC(js.CASE_INFO.REMOTESYSTEMID,"",t)),{type:Rr,payload:e}},US=e=>{const{containerItemID:t}=e;return e.transientItems=tA([...Vy(t),t]),{type:wr,payload:e}},FS=e=>{const{transientItemID:t}=e;return e.transientItems=[t],{type:xr,payload:e}},jS=e=>{const{context:t,containerItemID:n}=e;let s=t;if(s||(s=Ly(n)),e.context=s,e.childContainers=jy(n),e.childContainersContexts=Vy(n),e.transientItems=tA([...e.childContainersContexts,n]),e.suggestionContexts=ky(n),n===t){e.caseID=HC(js.CASE_INFO.CASE_INFO_ID,"",t),e.RemoteSystemID=HC(js.CASE_INFO.REMOTESYSTEMID,"",t);const n=HC(js.CASE_INFO.CASE_INFO_CLASSNAME,"",t);Bs.isTraditionalRemoteCase(n)&&(e.skipReleaseLockRequest=!0)}return{type:kr,payload:e}},VS=e=>({type:hr,payload:e}),kS=e=>({type:Ir,payload:e}),BS=e=>({type:Nr,payload:e}),$S=(e,...t)=>(dS.resume(),e(...t)),GS=(e,t,n,s,r)=>({type:Tr,payload:{msg:e,err:t,context:n,formFields:s,actionMgrID:r}}),WS=e=>({type:da,payload:e}),HS=e=>({type:pa,payload:e}),qS=e=>({type:ga,payload:e}),zS=e=>({type:"SHOW_CASE_PREVIEW",payload:e}),YS=e=>({type:ur,payload:e}),KS=e=>({type:Xs,payload:e}),QS="add",JS="replace",XS=["portal","noPortal","preview","debug","devtool","activeTab","contextParam","lang"];let ZS="",e_="Home",t_="",n_=!0;const s_=e=>(n_=e,n_),r_=()=>n_,a_=(e,t,n)=>TA.getSemanticURL(e,t,n),o_=(e,t)=>TA.getRestEndPoint(e,t),i_=(e,t)=>{let n=rn();const s=o_(e,t);return s?(s.restApi?.startsWith("/")||(s.restApi=`/${s.restApi}`),n?.endsWith("/")&&(n=n.substring(0,n.length-1)),s.restApi=n+s.restApi,s):{}},c_=(e,t,n)=>{const{root:s,resources:r}=e,{views:a}=r,{config:o}=s,i=QS;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(_h);if(l){const e=rS.getIn(t,o.context);c=c.replace(l[0],e.pyID)}return c.startsWith("/")&&(c=c.substring(1,c.length)),{pxURLPath:c,historyAction:i}},l_=(e,t)=>{const n=`${e}/${t}`;if(!("EMBED"===PA.getRenderingMode()))return n;const s=TA.getRoutingInfo()?.authServiceAlias;if(!s)return n;const r=encodeURIComponent(s);let a;try{a=new URL(n)}catch{return n}const o=a.pathname.split("/").filter(Boolean),i=o.findIndex((e=>"app"===e.toLowerCase()));if(i<0)return n;"prauth"!==o[i-1]?.toLowerCase()&&o.splice(i,0,"PRAuth");const c=o.findIndex((e=>"app"===e.toLowerCase()))+2;return c!==o.length&&o[c]===r||o.splice(c,0,r),a.pathname=`/${o.join("/")}`,a.toString().replace(/\/$/,"")},u_=(e,t,n,s)=>{let r,a;r=Th(t)?l_(e,t):e;const o=Th(n?.pxURLPath||"");o&&(r=`${r}/${o}`);try{a=new URL(r).searchParams,r=r.includes("?")?r.split("?")[0]:r}catch(e){return console.log("Invalid url",e),""}const i=r.split("/"),c=i[i.length-1],l=new URLSearchParams("undefined"==typeof window?"":window.location.search);if(vh()?(r=((e,t,n,s,r)=>{const a=TA.getStaticRoutePage(),o=e_?.toLowerCase(),i=a?.toLowerCase(),c=s?.toLowerCase();return i!==o&&c!==o||r.has("noPortal")?e:l_(t,n)})(r,e,t,c,l),TA.setStaticRoutePage("")):c.toLowerCase()!==e_.toLowerCase()||l.has("noPortal")||(r=l_(e,t)),!TA.isDefaultPortal()){const e=TA.getPortalName();l.has("portal")?l.set("portal",e):l.append("portal",e)}a=((e,t,n)=>{for(const[n,s]of t.entries())!e.has(n)&&XS.includes(n)&&e.append(n,s);n&&!e.has("lang")&&e.append("lang",n);const s=TA.getRoutingInfo()?.embedQueryParams;if(s)for(const[t,n]of Object.entries(s))e.has(t)||e.append(t,String(n));return e})(a,l,s);const u=Ph(a.toString());return u&&(r+=`?${u}`),r},d_=(e,{urlPathObjParam:t,infoParam:n,optionsParam:s,queryParam:r},a=!1,o)=>{let i,c,l;if(!1===window.PCore.getBehaviorOverride("dynamicSemanticUrl"))return;if(a)i=t,c=n,l=s;else{const{uiResources:n,data:s}=e;({options:l}=e),i=t&&t.pxURLPath&&Nh(t.pxURLPath)?c_(n,s,t.pxURLPath):t||c_(n,s),c=TA.getEndPointInfo(i.pxURLPath),i.pxURLPath=c.urlPath}let u=u_(ZS,TA.getApplicationPath(),i,o);const{title:d}=((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:TA.getApplicationName()),n===`${ZS}/${t}/`)return{title:e};const s=new URL(n).pathname.replace(`${t}/`,""),r=s.split("/");return/\d/.test(s)?{title:`${e} - ${r[r.length-1]}`}:{title:`${e} - ${r[0]}`}})(t_,TA.getApplicationPath(),u),p=((e,t)=>(void 0!==e&&(e.options=t),{stateObj:e}))(c,{...l,title:d});i?.historyAction===QS?((e,t,n)=>{if("undefined"!=typeof window)try{window.history.pushState(e,t,n),window.scrollTo(0,0)}catch(e){throw new Error("Error- Unable to Add to Browser History")}})(p,d,u):i?.historyAction===JS&&(r&&(u+=`?${r}`),((e,t,n)=>{if("undefined"!=typeof window)try{window.history.replaceState(e,t,n)}catch(e){throw new Error("Error- Unable to Replace Browser History")}})(p,d,u))},p_=(e,t)=>{let n=null;e.directUrlUpdation&&(n={historyAction:QS,pxURLPath:""},n.pxURLPath=e.semanticURL),d_(e,{urlPathObjParam:n,infoParam:null,optionsParam:null},!1,t)},g_=(e,t)=>{p_(e,t)},h_=(e,t)=>{const n={pxURLPath:e};return u_(ZS,TA.getApplicationPath(),n,t)},f_=e=>{const{uiResources:t}=e;r_()&&(e.directUrlUpdation||(e=>{if(e&&e.root){const{root:t}=e,{resources:n}=e,{views:s}=n,r=t.config,a=r.type,o=r.name;if("VIEW"===a.toUpperCase()){const e=s[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))&&p_(e)},m_=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},I_=(e,t,n)=>{const{caseClassName:s,workID:r}=e.payload,{containerName:a,context:o}=t,{RemoteClassGroup:i,RemoteSystemID:c,name:l}=Bs.getRemoteCase(s),u={...e,headers:{RemoteSystemID:c},className:s,isTraditionalRemoteCase:Bs.isTraditionalRemoteCase(s),isRemoteCase:Bs.isRemoteCase(s),action:ba,viewName:Vs,gadgetId:YI.getUniqueGadgetId(),context:n??o,skipSemanticUrl:!0,insKey:`${i?.toUpperCase()} ${r}`,containerName:a,name:l};BC(d.showPage(u))};let E_=!1;const y_=async e=>{if(E_)return void(E_=!1);const t=(e=>"ui-navigation"===e.state?.type?(fd.publish(Fs.PUB_SUB_EVENTS.URL_NAVIGATION,e.state),null):e.state?e.state.stateObj:null)(e);if(t){const e=gA(),n=xy(`${e}/primary`);if(n&&Yy(n)){const e=xA().getLocaleValue(ZE,"Messages");if(!await Zm.confirm(e))return E_=!0,void window.history.go(1)}Bs.isRemoteCase(t.payload?.caseClassName)?I_({...t},t.options):BC(d.showHistory(m_(t)))}},A_=()=>TA.getApplicationPath()!==CA(),C_=e=>{const{acName:t,context:n,defaultViewLabel:s,ruleName:r,className:a}=e,o=((e,t)=>{const n=TA.getRoutingInfo();if(vh()&&Object.values(n?.routes??{}).find((n=>n?.payload?.pageClass===t&&n?.payload?.page===e)))return e;const s=e.split(" ").join(""),r=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?.[s]?s:n?.routes?.[r]?r:n?.routes?.[a]?a:e})(r||s,a);(e=>{e_=e})(o),TA.setDefaultRoute(o),TA.setDefaultClassName(a);const i=Hs(t,n),c=Va(t,n),l=(()=>{const e=PA.getIsExtraCallRequiredForDefaultHome();return!0===e||"true"===e})(),u={historyAction:JS,pxURLPath:""};let p,g=null;const h={acName:c,context:i,actionConfig:{context:i}};if(l||!l&&A_()){const t=Rh(SA());PA.shouldUseURLParams()&&(g=t.includes("?")?t.split("?")[1]:null),p=bh(t,h),u.pxURLPath=p.urlPath,void 0!==p.payload?.pageClass&&(p.payload.pageClass=kC()?.getState()?.data?.app?.pyPortal?.classID);const n="showHistory",s={routeEndpoint:p.routeEndpoint,requestType:p.requestType,payload:p.payload,options:h,routeKey:p.routeKey};f=p?.payload?.caseClassName,f&&Bs.isRemoteCase(f)&&(Bs.isTraditionalRemoteCase(f)||Bs.isRemoteCaseVersionDifferent(f))?I_(s,e,h.context):BC(d[n](m_(s)))}else p=TA.getEndPointInfo(e_),u.pxURLPath="";var f;d_(null,{urlPathObjParam:u,infoParam:p,optionsParam:h,queryParam:g},!0)},S_=(e,t=!1)=>{var n;ZS=e.domain,!1===t&&r_()&&(n=y_,"undefined"!=typeof window&&window.addEventListener("popstate",(e=>n(e))),"undefined"!=typeof window&&(window.onbeforeunload=()=>null)),TA.init(e,e_)},__=e=>{(e=>{"undefined"!=typeof window&&(window.document.title=e)})(e)},N_=e=>{for(const t of e)XS.includes(t)||XS.push(t)};var T_=Symbol.for("immer-nothing"),D_=Symbol.for("immer-draftable"),P_=Symbol.for("immer-state");function O_(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var R_=Object,b_=R_.getPrototypeOf,v_="constructor",x_="prototype",w_="configurable",M_="enumerable",L_="writable",U_="value",F_=e=>!!e&&!!e[P_];function j_(e){return!!e&&(B_(e)||z_(e)||!!e[D_]||!!e[v_]?.[D_]||Y_(e)||K_(e))}var V_=R_[x_][v_].toString(),k_=new WeakMap;function B_(e){if(!e||!Q_(e))return!1;const t=b_(e);if(null===t||t===R_[x_])return!0;const n=R_.hasOwnProperty.call(t,v_)&&t[v_];if(n===Object)return!0;if(!J_(n))return!1;let s=k_.get(n);return void 0===s&&(s=Function.toString.call(n),k_.set(n,s)),s===V_}function $_(e,t,n=!0){if(0===G_(e)){(n?Reflect.ownKeys(e):R_.keys(e)).forEach((n=>{t(n,e[n],e)}))}else e.forEach(((n,s)=>t(s,n,e)))}function G_(e){const t=e[P_];return t?t.type_:z_(e)?1:Y_(e)?2:K_(e)?3:0}var W_=(e,t,n=G_(e))=>2===n?e.has(t):R_[x_].hasOwnProperty.call(e,t),H_=(e,t,n=G_(e))=>2===n?e.get(t):e[t],q_=(e,t,n,s=G_(e))=>{2===s?e.set(t,n):3===s?e.add(n):e[t]=n};var z_=Array.isArray,Y_=e=>e instanceof Map,K_=e=>e instanceof Set,Q_=e=>"object"==typeof e,J_=e=>"function"==typeof e,X_=e=>"boolean"==typeof e;var Z_=e=>e.copy_||e.base_,eN=e=>e.modified_?e.copy_:e.base_;function tN(e,t){if(Y_(e))return new Map(e);if(K_(e))return new Set(e);if(z_(e))return Array[x_].slice.call(e);const n=B_(e);if(!0===t||"class_only"===t&&!n){const t=R_.getOwnPropertyDescriptors(e);delete t[P_];let n=Reflect.ownKeys(t);for(let s=0;s<n.length;s++){const r=n[s],a=t[r];!1===a[L_]&&(a[L_]=!0,a[w_]=!0),(a.get||a.set)&&(t[r]={[w_]:!0,[L_]:!0,[M_]:a[M_],[U_]:e[r]})}return R_.create(b_(e),t)}{const t=b_(e);if(null!==t&&n)return{...e};const s=R_.create(t);return R_.assign(s,e)}}function nN(e,t=!1){return rN(e)||F_(e)||!j_(e)||(G_(e)>1&&R_.defineProperties(e,{set:sN,add:sN,clear:sN,delete:sN}),R_.freeze(e),t&&$_(e,((e,t)=>{nN(t,!0)}),!1)),e}var sN={[U_]:function(){O_(2)}};function rN(e){return null===e||!Q_(e)||R_.isFrozen(e)}var aN="MapSet",oN="Patches",iN="ArrayMethods",cN={};function lN(e){const t=cN[e];return t||O_(0),t}var uN,dN=e=>!!cN[e];var pN=()=>uN;function gN(e,t){t&&(e.patchPlugin_=lN(oN),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function hN(e){fN(e),e.drafts_.forEach(IN),e.drafts_=null}function fN(e){e===uN&&(uN=e.parent_)}var mN=e=>uN={drafts_:[],parent_:uN,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:dN(aN)?lN(aN):void 0,arrayMethodsPlugin_:dN(iN)?lN(iN):void 0};function IN(e){const t=e[P_];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function EN(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(void 0!==e&&e!==n){n[P_].modified_&&(hN(t),O_(4)),j_(e)&&(e=yN(t,e));const{patchPlugin_:s}=t;s&&s.generateReplacementPatches_(n[P_].base_,e,t)}else e=yN(t,n);return function(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&nN(t,n)}(t,e,!0),hN(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==T_?e:void 0}function yN(e,t){if(rN(t))return t;const n=t[P_];if(!n){return DN(t,e.handledSet_,e)}if(!CN(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:t}=n;if(t)for(;t.length>0;){t.pop()(e)}NN(n,e)}return n.copy_}function AN(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var CN=(e,t)=>e.scope_===t,SN=[];function _N(e,t,n,s){const r=Z_(e),a=e.type_;if(void 0!==s){if(H_(r,s,a)===t)return void q_(r,s,n,a)}if(!e.draftLocations_){const t=e.draftLocations_=new Map;$_(r,((e,n)=>{if(F_(n)){const s=t.get(n)||[];s.push(e),t.set(n,s)}}))}const o=e.draftLocations_.get(t)??SN;for(const e of o)q_(r,e,n,a)}function NN(e,t){if(e.modified_&&!e.finalized_&&(3===e.type_||1===e.type_&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){const{patchPlugin_:n}=t;if(n){const s=n.getPath(e);s&&n.generatePatches_(e,s,t)}AN(e)}}function TN(e,t,n){const{scope_:s}=e;if(F_(n)){const r=n[P_];CN(r,s)&&r.callbacks_.push((function(){xN(e);const s=eN(r);_N(e,n,s,t)}))}else j_(n)&&e.callbacks_.push((function(){const r=Z_(e);3===e.type_?r.has(n)&&DN(n,s.handledSet_,s):H_(r,t,e.type_)===n&&s.drafts_.length>1&&!0===(e.assigned_.get(t)??!1)&&e.copy_&&DN(H_(e.copy_,t,e.type_),s.handledSet_,s)}))}function DN(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||F_(e)||t.has(e)||!j_(e)||rN(e)||(t.add(e),$_(e,((s,r)=>{if(F_(r)){const t=r[P_];if(CN(t,n)){const n=eN(t);q_(e,s,n,e.type_),AN(t)}}else j_(r)&&DN(r,t,n)}))),e}var PN={get(e,t){if(t===P_)return e;let n=e.scope_.arrayMethodsPlugin_;const s=1===e.type_&&"string"==typeof t;if(s&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const r=Z_(e);if(!W_(r,t,e.type_))return function(e,t,n){const s=bN(t,n);return s?U_ in s?s[U_]:s.get?.call(e.draft_):void 0}(e,r,t);const a=r[t];if(e.finalized_||!j_(a))return a;if(s&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&function(e){const t=+e;return Number.isInteger(t)&&String(t)===e}(t))return a;if(a===RN(e.base_,t)||function(e,t,n){if(1!==e.type_||!e.allIndicesReassigned_||e.assigned_?.get(t)||!j_(n)||n[P_])return!1;return e.baseRefs_.has(n)}(e,t,a)){xN(e);const n=1===e.type_?+t:t,s=wN(e.scope_,a,e,n);return e.copy_[n]=s}return a},has:(e,t)=>t in Z_(e),ownKeys:e=>Reflect.ownKeys(Z_(e)),set(e,t,n){const s=bN(Z_(e),t);if(s?.set)return s.set.call(e.draft_,n),!0;if(!e.modified_){const s=RN(Z_(e),t),o=s?.[P_];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(((r=n)===(a=s)?0!==r||1/r==1/a:r!=r&&a!=a)&&(void 0!==n||W_(e.base_,t,e.type_)))return!0;xN(e),vN(e)}var r,a;return e.copy_[t]===n&&(void 0!==n||W_(e.copy_,t,e.type_))||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),TN(e,t,n)),!0},deleteProperty:(e,t)=>(xN(e),void 0!==RN(e.base_,t)||t in e.base_?(e.assigned_.set(t,!1),vN(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=Z_(e),s=Reflect.getOwnPropertyDescriptor(n,t);return s?{[L_]:!0,[w_]:1!==e.type_||"length"!==t,[M_]:s[M_],[U_]:n[t]}:s},defineProperty(){O_(11)},getPrototypeOf:e=>b_(e.base_),setPrototypeOf(){O_(12)}},ON={};for(let e in PN){let t=PN[e];ON[e]=function(){const e=arguments;return e[0]=e[0][0],t.apply(this,e)}}function RN(e,t){const n=e[P_];return(n?Z_(n):e)[t]}function bN(e,t){if(!(t in e))return;let n=b_(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=b_(n)}}function vN(e){e.modified_||(e.modified_=!0,e.parent_&&vN(e.parent_))}function xN(e){e.copy_||(e.assigned_=new Map,e.copy_=tN(e.base_,e.scope_.immer_.useStrictShallowCopy_))}ON.deleteProperty=function(e,t){return ON.set.call(this,e,t,void 0)},ON.set=function(e,t,n){return PN.set.call(this,e[0],t,n,e[0])};function wN(e,t,n,s){const[r,a]=Y_(t)?lN(aN).proxyMap_(t,n):K_(t)?lN(aN).proxySet_(t,n):function(e,t){const n=z_(e),s={type_:n?1:0,scope_:t?t.scope_:pN(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let r=s,a=PN;n&&(r=[s],a=ON);const{revoke:o,proxy:i}=Proxy.revocable(r,a);return s.draft_=i,s.revoke_=o,[i,s]}(t,n);return(n?.scope_??pN()).drafts_.push(r),a.callbacks_=n?.callbacks_??[],a.key_=s,n&&void 0!==s?function(e,t,n){e.callbacks_.push((function(s){const r=t;if(!r||!CN(r,s))return;s.mapSetPlugin_?.fixSetContents(r);const a=eN(r);_N(e,r.draft_??r,a,n),NN(r,s)}))}(n,a,s):a.callbacks_.push((function(e){e.mapSetPlugin_?.fixSetContents(a);const{patchPlugin_:t}=e;a.modified_&&t&&t.generatePatches_(a,[],e)})),r}function MN(e){if(!j_(e)||rN(e))return e;const t=e[P_];let n,s=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=tN(e,t.scope_.immer_.useStrictShallowCopy_),s=t.scope_.immer_.shouldUseStrictIteration()}else n=tN(e,!0);return $_(n,((e,t)=>{q_(n,e,MN(t))}),s),t&&(t.finalized_=!1),n}globalThis.Iterator;var LN=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(J_(e)&&!J_(t)){const n=t;t=e;const s=this;return function(e=n,...r){return s.produce(e,(e=>t.call(this,e,...r)))}}let s;if(J_(t)||O_(6),void 0===n||J_(n)||O_(7),j_(e)){const r=mN(this),a=wN(r,e,void 0);let o=!0;try{s=t(a),o=!1}finally{o?hN(r):fN(r)}return gN(r,n),EN(s,r)}if(!e||!Q_(e)){if(s=t(e),void 0===s&&(s=e),s===T_&&(s=void 0),this.autoFreeze_&&nN(s,!0),n){const t=[],r=[];lN(oN).generateReplacementPatches_(e,s,{patches_:t,inversePatches_:r}),n(t,r)}return s}O_(1)},this.produceWithPatches=(e,t)=>{if(J_(e))return(t,...n)=>this.produceWithPatches(t,(t=>e(t,...n)));let n,s;return[this.produce(e,t,((e,t)=>{n=e,s=t})),n,s]},X_(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),X_(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),X_(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){j_(e)||O_(8),F_(e)&&(e=function(e){F_(e)||O_(10);return MN(e)}(e));const t=mN(this),n=wN(t,e,void 0);return n[P_].isManual_=!0,fN(t),n}finishDraft(e,t){const n=e&&e[P_];n&&n.isManual_||O_(9);const{scope_:s}=n;return gN(s,t),EN(void 0,s)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const s=t[n];if(0===s.path.length&&"replace"===s.op){e=s.value;break}}n>-1&&(t=t.slice(n+1));const s=lN(oN).applyPatches_;return F_(e)?s(e,t):this.produce(e,(e=>s(e,t)))}},UN=LN.produce;function FN(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 jN=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),VN=()=>Math.random().toString(36).substring(7).split("").join("."),kN={INIT:`@@redux/INIT${VN()}`,REPLACE:`@@redux/REPLACE${VN()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${VN()}`};function BN(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 $N(e,t,n){if("function"!=typeof e)throw new Error(FN(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(FN(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(FN(1));return n($N)(e,t)}let s=e,r=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(FN(3));return r}function d(e){if("function"!=typeof e)throw new Error(FN(4));if(c)throw new Error(FN(5));let t=!0;l();const n=i++;return o.set(n,e),function(){if(t){if(c)throw new Error(FN(6));t=!1,l(),o.delete(n),a=null}}}function p(e){if(!BN(e))throw new Error(FN(7));if(void 0===e.type)throw new Error(FN(8));if("string"!=typeof e.type)throw new Error(FN(17));if(c)throw new Error(FN(9));try{c=!0,r=s(r,e)}finally{c=!1}return(a=o).forEach((e=>{e()})),e}p({type:kN.INIT});return{dispatch:p,subscribe:d,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error(FN(10));s=e,p({type:kN.REPLACE})},[jN]:function(){const e=d;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(FN(11));function n(){const e=t;e.next&&e.next(u())}n();return{unsubscribe:e(n)}},[jN](){return this}}}}}function GN(e){const t=Object.keys(e),n={};for(let s=0;s<t.length;s++){const r=t[s];0,"function"==typeof e[r]&&(n[r]=e[r])}const s=Object.keys(n);let r;try{!function(e){Object.keys(e).forEach((t=>{const n=e[t];if(void 0===n(void 0,{type:kN.INIT}))throw new Error(FN(12));if(void 0===n(void 0,{type:kN.PROBE_UNKNOWN_ACTION()}))throw new Error(FN(13))}))}(n)}catch(e){r=e}return function(e={},t){if(r)throw r;let a=!1;const o={};for(let r=0;r<s.length;r++){const i=s[r],c=n[i],l=e[i],u=c(l,t);if(void 0===u){t&&t.type;throw new Error(FN(14))}o[i]=u,a=a||u!==l}return a=a||s.length!==Object.keys(e).length,a?o:e}}function WN(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce(((e,t)=>(...n)=>e(t(...n))))}function HN(e){return({dispatch:t,getState:n})=>s=>r=>"function"==typeof r?r(t,n,e):s(r)}var qN=HN(),zN=HN,YN="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?WN:WN.apply(null,arguments)};"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function KN(e,t){function n(...n){if(t){let s=t(...n);if(!s)throw new Error(aT(0));return{type:e,payload:s.payload,..."meta"in s&&{meta:s.meta},..."error"in s&&{error:s.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>function(e){return BN(e)&&"type"in e&&"string"==typeof e.type}(t)&&t.type===e,n}var QN=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 JN(e){return j_(e)?UN(e,(()=>{})):e}var XN="RTK_autoBatch",ZN=e=>t=>{setTimeout(t,e)},eT=(e={type:"raf"})=>t=>(...n)=>{const s=t(...n);let r=!0,a=!1,o=!1;const i=new Set,c="tick"===e.type?queueMicrotask:"raf"===e.type?"undefined"!=typeof window&&window.requestAnimationFrame?(l=window.requestAnimationFrame,u=100,e=>{let t=!1;const n=()=>{t||(t=!0,cancelAnimationFrame(s),clearTimeout(r),e())},s=l(n),r=setTimeout(n,u)}):ZN(10):"callback"===e.type?e.queueNotification:ZN(e.timeout);var l,u;const d=()=>{o=!1,a&&(a=!1,i.forEach((e=>e())))};return Object.assign({},s,{subscribe(e){const t=s.subscribe((()=>r&&e()));return i.add(e),()=>{t(),i.delete(e)}},dispatch(e){try{return r=!e?.meta?.[XN],a=!r,a&&(o||(o=!0,c(d))),s.dispatch(e)}finally{r=!0}}})};function tT(e){const t=function(e){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:s=!0,actionCreatorCheck:r=!0}=e??{};let a=new QN;return t&&("boolean"==typeof t?a.push(qN):a.push(zN(t.extraArgument))),a},{reducer:n,middleware:s,devTools:r=!0,duplicateMiddlewareCheck:a=!0,preloadedState:o,enhancers:i}=e||{};let c,l;if("function"==typeof n)c=n;else{if(!BN(n))throw new Error(aT(1));c=GN(n)}l="function"==typeof s?s(t):t();let u=WN;r&&(u=YN({trace:!1,..."object"==typeof r&&r}));const d=function(...e){return t=>(n,s)=>{const r=t(n,s);let a=()=>{throw new Error(FN(15))};const o={getState:r.getState,dispatch:(e,...t)=>a(e,...t)},i=e.map((e=>e(o)));return a=WN(...i)(r.dispatch),{...r,dispatch:a}}}(...l),p=(e=>function(t){const{autoBatch:n=!0}=t??{};let s=new QN(e);return n&&s.push(eT("object"==typeof n?n:void 0)),s})(d);return $N(c,o,u(..."function"==typeof i?i(p):p()))}function nT(e){const t={},n=[];let s;const r={addCase(e,n){const s="string"==typeof e?e:e.type;if(!s)throw new Error(aT(28));if(s in t)throw new Error(aT(29));return t[s]=n,r},addAsyncThunk:(e,s)=>(s.pending&&(t[e.pending.type]=s.pending),s.rejected&&(t[e.rejected.type]=s.rejected),s.fulfilled&&(t[e.fulfilled.type]=s.fulfilled),s.settled&&n.push({matcher:e.settled,reducer:s.settled}),r),addMatcher:(e,t)=>(n.push({matcher:e,reducer:t}),r),addDefaultCase:e=>(s=e,r)};return e(r),[t,n,s]}function sT(e,t){let n,[s,r,a]=nT(t);if("function"==typeof e)n=()=>JN(e());else{const t=JN(e);n=()=>t}function o(e=n(),t){let o=[s[t.type],...r.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(F_(e)){const s=n(e,t);return void 0===s?e:s}if(j_(e))return UN(e,(e=>n(e,t)));{const s=n(e,t);if(void 0===s){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return s}}return e}),e)}return o.getInitialState=n,o}var{assign:rT}=Object;function aT(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. `}const oT=e=>{let t=new Set,n=t;const s=()=>{t===n&&(t=new Set(t))},r=e=>{let n=!0;return s(),t.add(e),()=>{n&&(s(),t.delete(e),n=!1)}},a=()=>{const e=Array.from(t);n=t,e.forEach((e=>e()))};return(...t)=>{const n=e(...t);let s=!1,o=!1;const i=e=>Array.isArray(e)?e.map(i):n.dispatch(e);return n.subscribe((()=>{o?s=!0:a()})),{...n,dispatch:e=>{const t=o;t||(s=!1,o=!0);const n=i(e),r=s&&!t;return t||(s=!1,o=!1),r&&a(),n},subscribe:r}}},iT=(e,t)=>{const{data:{shared:n={}}={},context:s}=t;((e,t)=>{af.updateDataPageStore(t),Object.keys(t).forEach((n=>{rS.getIn(e,[js.SHARED,n])?Object.keys(t[n]).forEach((s=>{rS.setIn(e,[js.SHARED,n,s],t[n][s])})):rS.setIn(e,[js.SHARED,n],t[n])}))})(e,n),s&&rS.deleteIn(e,[s,"shared"])},cT=(e,t,n=!1)=>{const{context:s,caseViewMode:r=(n?void 0:js.PERFORM_MODE),containerName:a}=t;a!==my.WORKAREA&&r&&rS.setIn(e,[s,"context_data","caseViewMode"],r)},lT=(e,t)=>{const{context:n}=t;rS.setIn(e,[n,"context_data","actionType"],t.actionType),rS.setIn(e,[n,"context_data","assignmentID"],t.assignmentID)},uT=e=>null!==e&&"object"==typeof e,dT=(e,t=[])=>{t.forEach((t=>rS.deleteIn(e,t)))},pT=(e,t=[])=>{t.forEach((t=>rS.deleteIn(e,t)))},gT=(e,t=[])=>{t.forEach((t=>{rS.deleteIn(e,t)}))},hT=(e,t,n={})=>{const{deleteAssignmentSpecificResources:s=!0,doDeleteConfirmationDetails:r=!0,skipMergeAssignmentsAndActions:a=!0}=n;rS.deleteIn(e,[t,"nextAssignmentInfo"]),a&&(rS.deleteIn(e,[t,js.CASE_INFO.CASE_INFO,"availableActions"]),rS.deleteIn(e,[t,js.CASE_INFO.CASE_INFO,"availableProcesses"]),rS.deleteIn(e,[t,js.CASE_INFO.CASE_INFO,"assignments"])),rS.deleteIn(e,[t,js.CASE_INFO.CASE_INFO,"activeActionID"]),rS.deleteIn(e,[t,js.CASE_INFO.CASE_INFO,"childCases"]),r&&(rS.deleteIn(e,[t,js.CASE_INFO.CASE_INFO,"confirmationLinks"]),rS.deleteIn(e,[t,"caseMessages"])),s&&(rS.deleteIn(e,[t,js.CASE_INFO.CASE_INFO,"actionButtons"]),rS.deleteIn(e,[t,js.CASE_INFO.CASE_INFO,"navigation"]))},fT=sT({},(e=>{e.addCase(Or,((e,t)=>{if(!t.payload.data||e[t.payload.context])return;t.payload.doDeleteCaseSummary&&hT(e,t.payload.context);const{target:n}=t.payload;n&&(n.includes(js.WORKAREA)||n.includes(js.MODAL))?e[t.payload.context]=t.payload.data:e[t.payload.containerItemID]=t.payload.data,cT(e,t.payload),lT(e,t.payload),iT(e,t.payload),((e,t)=>{const{context:n}=t;rS.deleteIn(e,[n,"context_data","blocking_action_counter"]),rS.deleteIn(e,[n,"context_data","deferred_action_queue"])})(e,t.payload)})).addCase(jr,((e,t)=>{t.payload.doDeleteCaseSummary&&hT(e,t.payload.context,{deleteAssignmentSpecificResources:t.payload.deleteAssignmentSpecificResources});const{target:n,propertiesToReplace:s=[]}=t.payload;if(n&&(n.includes(js.WORKAREA)||n.includes(js.MODAL))){const n=e[t.payload.context];uT(n)&&(e[t.payload.context]=XC(n,t.payload.data,{propertiesToReplace:[...s]}))}else{const n=e[t.payload.containerItemID];uT(n)&&(e[t.payload.containerItemID]=XC(n,t.payload.data,{propertiesToReplace:[...s]}))}(t.payload.actionType||t.payload.assignmentID)&&lT(e,t.payload),cT(e,t.payload),iT(e,t.payload),pT(e,t.payload.suggestionContexts)})).addCase(Rr,((e,t)=>{const{childContainersContexts:n=[]}=t.payload;((e,t)=>{const{containerItemID:n,context:s,deleteContext:r}=t;r&&rS.deleteIn(e,[s]),rS.deleteIn(e,[n])})(e,t.payload),gT(e,n),dT(e,t.payload.transientItems),pT(e,t.payload.suggestionContexts)})).addCase(Pr,((e,t)=>{const{containerItems:n}=t.payload;Array.isArray(n)?n.forEach((t=>{rS.deleteIn(e,[t])})):rS.deleteIn(e,[n])})).addCase(Vr,((e,t)=>{const{context:n,contextToBeRemoved:s,data:r,childContainersContextsToBeRemoved:a}=t.payload;hT(e,t.payload.context),cT(e,t.payload);const o=e[n],i=e[s];if(!uT(o)||!uT(i))return;const c=XC(o,i);uT(c)&&(e[n]=XC(c,r),rS.deleteIn(e,[s]),gT(e,a),iT(e,t.payload))})).addCase(kr,((e,t)=>{const{context:n,pulseReplace:s=!0,childContainersContexts:r=[]}=t.payload;let{data:a}=t.payload;const o=rS.getIn(e[n],"pulse");let i=rS.getIn(e[n],"OperatorID"),c=rS.getIn(e[n],"pxRequestor");c&&a.pxRequestor&&(c=rS.mergeDeep(c,a.pxRequestor)),i&&a.OperatorID&&(i=rS.mergeDeep(i,a.OperatorID)),!s&&o&&(a=ZC(a,"pulse",o),a=ZC(a,"OperatorID",i),a=ZC(a,"pxRequestor",c)),rS.setIn(e,n,a),cT(e,t.payload),iT(e,t.payload),gT(e,r),dT(e,t.payload.transientItems),pT(e,t.payload.suggestionContexts)})).addCase(ha,((e,t)=>{const{context:n,doDeleteConfirmationDetails:s=!0,skipMergeAssignmentsAndActions:r=!0}=t.payload;hT(e,n,{doDeleteConfirmationDetails:s,skipMergeAssignmentsAndActions:r})})).addCase(br,((e,t)=>{const{transientItemID:n,data:s}=t.payload;rS.setIn(e,n,s)})).addCase(xr,((e,t)=>{const{transientItems:n}=t.payload;n.forEach((t=>rS.deleteIn(e,t)))})).addCase(wr,((e,t)=>{const{transientItems:n}=t.payload;n.forEach((t=>rS.deleteIn(e,t)))})).addCase(vr,((e,t)=>{const{transientItemID:n,data:s}=t.payload;XC(rS.getIn(e,n),s)})).addCase(Mr,((e,t)=>{const{transientItemID:n,data:s}=t.payload;XC(rS.getIn(e,n),s)})).addCase(Lr,((e,t)=>{const{transientItemID:n,data:s}=t.payload;Object.keys(s??{}).forEach((t=>{rS.deleteIn(e,[n,t])}))})).addCase(Ur,((e,t)=>{const{transientItemID:n,data:s}=t.payload;rS.deleteIn(e,n),rS.setIn(e,n,s)})).addCase(ur,((e,t)=>{const{key:n,value:s}=t.payload;rS.setIn(e,`${js.SHARED}.${n}`,s)})).addCase(Gr,((e,t)=>{const{context:n,data:s}=t.payload;return rS.setIn(e,n,s)}))}));function mT(e){if("object"==typeof e&&null!==e&&"payload"in e&&"object"==typeof e.payload&&null!==e.payload){const t=e.payload.context;return"string"==typeof t?t:void 0}}const IT=KN(ma),ET=sT({},(e=>{e.addCase(Cr,((e,t)=>{const{propertiesToReplace:n=[],propertiesToReArrange:s=[],uiRootReference:r="",interestPath:a}=t.payload,o=r&&"string"==typeof t.payload.context?`${t.payload.context}.${r}`:t.payload.context,i="string"==typeof o?jC(o):[],c={isArrayDeepMerge:t.payload.isArrayDeepMerge,propertiesToReplace:[...n],propertiesToReArrange:[...s]};if(r&&i.length)rS.setIn(e,i,XC(rS.getIn(e,i),rS.getIn(t.payload.data,jC(r)),c));else if(a){const r=rS.getIn(e[t.payload.context],a),o=rS.getIn(t.payload.data,a),i=XC(r,o,{isArrayDeepMerge:!0}),c=rS.getIn(t.payload.data.context_data,a);JC(e[t.payload.context],[...n],[...s]),rS.setIn(e[t.payload.context],a,i),e[t.payload.context]&&c&&rS.setIn(e[t.payload.context].context_data,a,XC(rS.getIn(e[t.payload.context].context_data,a),c,{isArrayDeepMerge:!0}))}else e[t.payload.context]=XC(e[t.payload.context],t.payload.data,c);cT(e,t.payload,!0),iT(e,t.payload)})).addCase(Xs,((e,t)=>{const{context:n,reference:s,value:r,isArrayDeepMerge:a}=t.payload;ZC(e[n],s,r,{isArrayDeepMerge:a})})).addCase(Zs,((e,t)=>{const{context:n,reference:s,value:r}=t.payload;eS(e[n],s,r)})).addCase(Sr,((e,t)=>{KC(e[t.payload.context],t.payload.reference)})).addCase(or,((e,t)=>{rS.setIn(e[t.payload.context],"context_data.isLoading",!0)})).addCase(ir,((e,t)=>{rS.setIn(e[t.payload.context],"context_data.isLoading",!1)})).addCase(cr,((e,t)=>{const n=mT(t);n&&(e[n]||(e[n]={}),rS.setIn(e[n],"context_data.isOffline",!0))})).addCase(lr,((e,t)=>{const n=mT(t);n&&(e[n]||(e[n]={}),rS.setIn(e[n],"context_data.isOffline",!1))})).addCase(da,((e,t)=>{const{data:n}=t.payload;iT(e,{data:{shared:n}})})).addCase(pa,((e,t)=>{const{dataPagesToBeRemoved:n=[]}=t.payload;n.forEach((t=>{const{dataPageName:n,dataPageNameWithHash:s}=t;rS.deleteIn(e.shared,[n,s]);const r=rS.getIn(e.shared,[n]);r&&0===Object.keys(r).length&&rS.deleteIn(e.shared,[n])}))})).addCase(fa,((e,t)=>{const n=rS.getIn(e[t.payload.context].context_data,"blocking_action_counter",0);t.payload.isInitiateBlockingAction?rS.setIn(e[t.payload.context].context_data,"blocking_action_counter",n+1):rS.setIn(e[t.payload.context].context_data,"blocking_action_counter",n-1)})).addCase(IT,((e,t)=>{e.locale=rS.getIn(t.payload,"locale","")}))})),yT=/\[(\d+)\]$/gi,AT=/(\d+)/gi,CT=/\[\d+\]$/,ST=(e,t,n,s=[js.CONTEXT_DATA,js.CASE_INFO.CASE_INFO,js.CONTENT])=>{const r=rS.getIn(t,s);if(r){const t=cd(r,[],[]);for(const r of t)rS.setIn(e[n],[...s,...r],{})}},_T=(e,t,n,s)=>{const{property:r,pageReference:a,category:o,type:i,subType:c}=s.payload,l=rS.getIn(e[t],n);if(l&&o===js.CASEMESSAGES)rS.setIn(e[t],td(r,a,o),"");else if(l&&l.length>0&&Array.isArray(l)){let s;s=c?l.filter((e=>!(e.type===i&&e.subType===c))):l.filter((e=>e.type!==i)),n&&n.length>0&&rS.setIn(e[t],td(r,a,o),s)}},NT=(e,t)=>{const{property:n,pageReference:s,category:r,isListEntry:a,deletingIndex:o,stateObj:i}=t.payload,{context:c}=t.payload;if(i)return ST(e,i,c),e;const l=td(n,s,r,a);if(Number.isInteger(o)){rS.deleteIn(e[c],l);const t=l.slice(0,l.length-1);let n=rS.getIn(e[c],t)||{};const s=(u=Object.keys(n),[...u].sort(((e,t)=>{const n=e.match(yT),s=t.match(yT);if(!n&&!s)return e.localeCompare(t);if(!n&&s)return-1;if(n?.length&&s?.length){const e=n[0].match(AT),t=s[0].match(AT);if(e?.length&&t?.length)return parseInt(e[0],10)-parseInt(t[0],10)}return 1})));n=s.map((e=>n[e])),n.forEach(((n,r)=>{const a=s[r].match(yT);if(a?.length){const i=parseInt(a[0].match(AT)[0],10);i>o&&(rS.deleteIn(e[c],t.concat(s[r])),rS.setIn(e[c],t.concat(s[r].replace(CT,`[${i-1}]`)),n))}}))}else rS.setIn(e[c],l,{});var u;return e};function TT(e,t){const n=rS.getIn(e,t);return void 0!==n?.dataInfo?.content}const DT=(e,t)=>{const n=rS.getIn(e,t);return!0===YI.isObjectCaseType(n?.objectInfo?.objectTypeID)};function PT(e,t){let n=ed.FIELD_MESSAGES_PATH;return TT(e,t)?n=ed.DATA_OBJECT_FIELD_MESSAGES_PATH:DT(e,t)&&(n=ed.OBJECT_FIELD_MESSAGES_PATH),n}const OT=(e,t,n)=>{n.forEach((n=>{((e,t,n)=>{const s=rS.getIn(n,js.ERROR_FIELD_IN_PAGE).slice(1),r=rS.getIn(n,js.ERROR_IN_PAGE_IDENTIFIER).slice(1);if(r){let a="caseInfo.content";TT(e,t)?a="dataInfo.content":DT(e,t)&&(a="objectInfo.content");let o=s?`${a}.${s}`:a;o=o.replace(/\(/g,"[").replace(/\)/g,"]");const i=td(r,o,js.PROPERTY),c=rS.getIn(e[t],`${o}.classID`),l=oC(r,c),u=PA.getLocale()??"en-US",d=new nm(u,l?.localeReference),p={type:Fs.MESSAGES.MESSAGES_TYPE_ERROR,message:n.localizedValue,...l?.label&&{fieldLabel:d.getLocalizedText(l.label)}},g=rS.getIn(e[t],i,[]);if(rS.isContains(g,p))return;rS.setIn(e[t],i,[...g,p])}})(e,t,n)}))};function RT(e,t){const{err:n,formFields:s}=t.payload;let{context:r}=t.payload;const{fieldErrors:a,pageErrors:o}=((e,t)=>{const n=new Map(t.map(((e,t)=>[e,t]))),s=e=>n.get((e=>{const t=(e.erroneousInputOutputFieldInPage||"").replace(/^\./,""),n=(e.erroneousInputOutputIdentifier||"").replace(/^\./,"");return t?`${t}.${n}`:n})(e))??Number.MAX_SAFE_INTEGER,r=e.slice().sort(((e,t)=>s(e)-s(t))),a=[],o=[];for(const e of r)lI(e,t,a,o);return{fieldErrors:o,pageErrors:a}})(n.errorDetails,s),i=PT(e,r);if(rS.setIn(e,[r,...i],{}),rS.setIn(e,[r,...ed.PAGE_MESSAGES_PATH],[]),a.forEach((t=>{const n=rS.getIn(t,js.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 s=t.substring(t.lastIndexOf(".")+1),a=td(s,n,js.PROPERTY);rS.setIn(e,[r,...a],[])}}})),a.length>0&&OT(e,r,a),o.length>0){const t=(e=>{const t=[];return e.forEach((e=>{const n=e.erroneousInputOutputFieldInPage?.replace(/^\./,"");t.push({type:Fs.MESSAGES.MESSAGES_TYPE_ERROR,message:e.localizedValue,...n&&{fieldInPage:n}})})),t})(o);e[r]||(r=js.APP.APP),rS.setIn(e,[r,...ed.PAGE_MESSAGES_PATH],t)}else r.includes&&r.includes(my.WORKAREA)&&(r=Ws(r)),rS.deleteIn(e,[r,...ed.PAGE_MESSAGES_PATH]);return e}const bT=sT({},(e=>{e.addCase(Tr,((e,t)=>t.payload.err.errorDetails&&(t.payload.err.errorClassification===Fs.VALIDATION_FAIL||t.payload.err.errorClassification===Fs.INVALID_INPUTS||(t.payload.err?.displayButtonsOnErrors?.length??0)>0)?RT(e,t):e)).addCase(jr,((e,t)=>{const{context:n}=t.payload,s=[n,...PT(e,n)],r=[n,...ed.PAGE_MESSAGES_PATH];if(rS.setIn(e,s,{}),rS.setIn(e,r,[]),n&&n.includes(my.WORKAREA)){const t=[Qs(n),...ed.PAGE_MESSAGES_PATH];rS.setIn(e,t,[])}})).addCase(ca,((e,t)=>{const{isListEntry:n,clearAll:s,context:r}=t.payload;return s?(rS.deleteIn(e,[r,js.CONTEXT_DATA]),e):n?NT(e,t):((e,t)=>{const{property:n,pageReference:s,category:r,isListEntry:a,stateObj:o}=t.payload,{context:i}=t.payload;let c=i;if(o)return ST(e,o,i),e;const l=td(n,s,r,a);return r===js.PAGE&&i?.includes(my.WORKAREA)&&(c=Ws(i)),_T(e,c,l,t),_T(e,i,l,t),e})(e,t)})).addCase(ia,((e,t)=>{const{messages:n,property:s,pageReference:r,context:a,category:o}=t.payload,i=td(s,r,o);n&&n.length>0&&Array.isArray(n)&&i&&i.length>0&&rS.setIn(e[a],td(s,r,o),n)}))})),vT=(e,t,n,s,r)=>{rS.setIn(e[t],[...n,s],r)},xT=[ET,fT,bT,sT({},(e=>{e.addCase(ga,((e,t)=>{const{instruction:n,actions:s,context:r,referenceList:a,listIndex:o,groupIndex:i,listMoveToIndex:c,content:l={}}=t.payload,u=jC(a);switch(n){case js.LIST_ACTIONS.ADD:vT(e,r,u,i,l);break;case js.LIST_ACTIONS.INSERT:vT(e,r,u,o,l);break;case js.LIST_ACTIONS.UPDATE:((e,t,n,s,r)=>{const a=XC(rS.getIn(e[t],[...n,s],{}),r);rS.setIn(e[t],[...n,s],a)})(e,r,u,o??i,l);break;case js.LIST_ACTIONS.DELETE:((e,t,n,s,r)=>{const a=rS.getIn(e[t],n,[]);"string"==typeof s?delete a[s]:a.splice(s,1),rS.setIn(e[t],n,a),Zu.deleteListNode(t,[r],a.length)})(e,r,u,o??i,a);break;case js.LIST_ACTIONS.MOVE:((e,t,n,s,r)=>{const a=rS.getIn(e[t],[...n,s],{}),o=rS.getIn(e[t],n,[]);o.splice(s,1),o.splice(r,0,a),rS.setIn(e[t],n,o),rd(e,t,n?.join("."),s,r)})(e,r,u,o,c);break;case js.LIST_ACTIONS_TYPE.SELECT_DESELECT:((e,t,n,s)=>{const r=rS.getIn(e[t],n)||[];s.forEach((e=>{const{instruction:s,content:a,listIndex:o}=e;if(s===js.LIST_ACTIONS.SELECT){r[o]=a;const e=n?.join(".");fp(t,e)}else delete r[o]})),rS.setIn(e[t],n,r.filter(Boolean))})(e,r,u,s);break;case js.LIST_ACTIONS_TYPE.DESELECT_ALL:((e,t,n)=>{rS.setIn(e[t],n,[])})(e,r,u);break;case js.LIST_ACTIONS.REPLACE:((e,t,n,s)=>{rS.setIn(e[t],n,s)})(e,r,u,l);break;case js.LIST_ACTIONS.DELETEPAGE:((e,t,n)=>{rS.setIn(e[t],n,{})})(e,r,u)}}))}))],wT=(e,t)=>(e||(e=VT().data),t.type===la?VT().data:(xT.forEach((n=>{e=n(e,t)})),e)),MT={},LT=(e,t=[])=>{t.forEach((t=>{rS.deleteIn(e,[t])}))},UT=(e,t)=>{const{type:n,payload:s}=t,r=n===jr,{target:a,context:o,semanticURL:i="",root:c,containerItemID:l,childContainers:u,flowName:d,resourceType:p="",key:g="",clearView:h=!1}=s;return c?rS.setIn(e,[a,"items",l,"view"],c):h&&rS.deleteIn(e,[a,"items",l,"view"]),o&&rS.setIn(e,[a,"items",l,"context"],o),d&&rS.setIn(e,[a,"items",l,"flowName"],d),(!r||r&&g)&&rS.setIn(e,[a,"items",l,"key"],g.trim()),((e,t,n,s)=>{""===e&&rS.deleteIn(t,[n,"items",s,"key"])})(g,e,a,l),(!r||r&&i)&&rS.setIn(e,[a,"items",l,"semanticURL"],i),(!r||r&&p)&&rS.setIn(e,[a,"items",l,"resourceType"],p),LT(e,u),e},FT=sT(MT,(e=>{e.addCase(la,(()=>MT)).addCase(Dr,((e,t)=>{const{context:n,name:s,type:r,actionMgrID:a}=t.payload,o=`${n}/${s}`;if(Dg.resolveActionByID(a,null,!1),e[o])return e;rS.setIn(e,[o],{type:r,accessedOrder:[],items:{}})})).addCase($r,((e,t)=>{const{containerName:n,childContainers:s=[]}=t.payload;rS.deleteIn(e,[n]),s.forEach((t=>{rS.deleteIn(e,[t])}))})).addCase(Pr,((e,t)=>{const{context:n,name:s,actionMgrID:r,childContainers:a}=t.payload,o=`${n}/${s}`;Dg.resolveActionByID(r,null,!1),rS.setIn(e,[o,"accessedOrder"],[]),rS.setIn(e,[o,"items"],{}),Array.isArray(a)&&a.forEach((t=>{rS.deleteIn(e,[t])}))})).addCase(Or,((e,t)=>{const{target:n,context:s,isInCreateStage:r,isBulkAction:a,semanticURL:o,root:i,containerItemID:c,actionMgrID:l,key:u,flowName:d,resourceType:p,actionName:g,isMinimizable:h,showProgress:f,progressMessage:m,modalOptions:I,resourceStatus:E,actionID:y,isMultiRecordData:A,acTertiary:C,parentContext:S,heading:_,isTraditionalRemoteCase:N,readOnly:T,referenceList:D,subscriptName:P,subscriptFieldName:O,pageGroupName:R,isPageGroup:b,index:v,isDeleteConfirmation:x,workId:w,caseTypeID:M,className:L,keys:U,enableBackNavigation:F}=t.payload,j=e[n],V=j&&j.type,k=j&&j.accessedOrder||[],B=j&&j.items||{};if(e[n]&&"single"===V&&k.length>0)return UT(e,t);const $={accessedOrder:[...k,c],items:{...B,[c]:{view:i,semanticURL:o,key:u,flowName:d,readOnly:T,context:s,isInCreateStage:r,resourceType:p,actionName:g,isMinimizable:h,...a&&{isBulkAction:a},showProgress:f,progressMessage:m,modalOptions:I,isTraditionalRemoteCase:N,resourceStatus:E,referenceList:D,subscriptName:P,subscriptFieldName:O,pageGroupName:R,isPageGroup:b,index:v,...y&&{actionID:y},...C&&{acTertiary:C},...A&&{isMultiRecordData:A},...S&&{parentContext:S},...x&&{isDeleteConfirmation:x,workId:w,caseTypeID:M,className:L,keys:U,enableBackNavigation:F},heading:_}}};Dg.resolveActionByID(l,null,!1),e[n]=vs(e[n],$)})).addCase(jr,((e,t)=>{const{actionMgrID:n,data:s}=t.payload;try{UT(e,t),Dg.resolveActionByID(n,s,!1)}catch{Dg.rejectActionByID(n,!1)}})).addCase(kr,((e,t)=>((e,t)=>{const{actionMgrID:n,data:s,target:r,containerItemID:a}=t.payload;let o=e;try{const i=e&&e[r]?.type;let c=e&&e[r]?.accessedOrder||[];c="single"===i?c.length>0?c:[...c,a]:c.includes(a)?c:[...c,a],rS.setIn(e,[r,"items",a,"transientItems"],[]),rS.setIn(e,[r,"accessedOrder"],c),o=UT(e,t),Dg.resolveActionByID(n,s,!1)}catch{Dg.rejectActionByID(n,!1)}return o})(e,t))).addCase(Fr,((e,t)=>{const{target:n,containerItemID:s,actionMgrID:r}=t.payload;try{const t=rS.getIn(e,[n,"accessedOrder"]).filter((e=>e!==s));t.push(s),rS.setIn(e,[n,"accessedOrder"],t),Dg.resolveActionByID(r,null,!1)}catch{Dg.rejectActionByID(r,!1)}})).addCase(Vr,((e,t)=>{const{target:n,containerItemID:s,actionMgrID:r,childContainers:a}=t.payload;try{const t=rS.getIn(e,[n,"accessedOrder"]).filter((e=>e!==s));rS.setIn(e,[n,"accessedOrder"],t),rS.deleteIn(e,[n,"items",s]),LT(e,a),Dg.resolveActionByID(r,null,!1)}catch{Dg.rejectActionByID(r,!1)}})).addCase(Rr,((e,t)=>{const{target:n,containerItemID:s,actionMgrID:r,childContainers:a}=t.payload;try{const t=rS.getIn(e,[n,"accessedOrder"]).filter((e=>e!==s));rS.setIn(e,[n,"accessedOrder"],t),rS.deleteIn(e,[n,"items",s]),LT(e,a),Dg.resolveActionByID(r,null,!1)}catch{Dg.rejectActionByID(r,!1)}})).addCase(br,((e,t)=>{const{transientItemID:n,target:s,contextName:r}=t.payload,a=rS.getIn(e,[s,"items",r,"transientItems"])??[];rS.setIn(e,[s,"items",r,"transientItems"],[...a,n])})).addCase(wr,((e,t)=>{const{target:n,containerItemID:s}=t.payload;rS.deleteIn(e,[n,"items",s,"transientItems"])})).addCase(xr,((e,t)=>{const{target:n,transientItemID:s,containerItemID:r}=t.payload,a=(rS.getIn(e,[n,"items",r,"transientItems"])??[]).filter((e=>e!==s));rS.setIn(e,[n,"items",r,"transientItems"],a)}))}));let jT={};const VT=()=>jT,kT=e=>((e=>{const t=e.Data||e.data,{uiResources:n={}}=e,s=n[js.CONTEXT_DATA]||e[js.CONTEXT_DATA];jT={data:{locale:PA.getLocale(),[js.APP.APP]:{...t,[js.CONTEXT_DATA]:s}},containers:{}}})(e),{data:wT,containers:FT}),BT=(e,t=!1)=>e===js.ACTION?t?Nf.REFRESH_CASE_DATA:Nf.REFRESH_ASSIGNMENT_DATA:Nf.REFRESH_CASE_VIEW,$T=(e,t,n)=>{const s=[];t&&n&&s.push({page:t,actionID:n});let r=e;for(;r;){const e=cS.getPropertyValue(js.CONTEXT_DATA_MODAL_VIEW.CONTEXT_DATA_MODAL_VIEW,"",r);if(!e?.isMultiRecordData||e.editType!==js.ACTION||!e.interestPage||!e.interestPageActionID)break;e.interestPage!==t&&s.unshift({page:e.interestPage,actionID:e.interestPageActionID}),r=e.parentContext}return s},GT=e=>{const{context:t}=e;let n={...rI(t).content,contextData:!1};const s=PI(t);rS.isEmpty(s)||(n=DI(s,n));const r=BT(e.editType,e.isLocalAction),{restApi:a,reqType:o}=i_(r,{ID:e.isLocalAction||e.editType!==js.ACTION?e.ID:e.assignmentID,actionID:e.actionID,viewID:e.viewID});let i=a;return e.editType===js.ACTION&&(i+=`?operation=${e.operationFlag}`,n.interestPageActionID=e.interestPageActionID,PA.getFeatureMap()?.pyEnableOptimisationForEmbedTable&&(n.actionIdArrayToBeProcessed=$T(t,e.interestPage,e.interestPageActionID))),n.interestPage=e.interestPage,Mu(Wd(i,{method:o,body:n,headers:e.headers},t)).pipe(Xg((t=>({actionInPayload:e,response:t.data,headers:sI(t.headers)}))),ph(": Error occurred during ajax call : ",t))},WT={},{VIEW:HT,FIELD:qT}=js.CONTEXT_TREE_NODE_TYPES,zT=(e,t,n)=>{const s=t.value.data[n]?.objectInfo?.headers,r=t.value.data[n]?.caseInfo?.headers;return!YI.shouldUseUnifiedHandling()&&e&&s?s:r},YT=e=>Ld[e]>0&&WT[e],KT=(e,t)=>{const{caseWideAction:n,caseViewAction:s,fieldsWithDeclarativeTargets:r,fieldsWithWhen:a,isViewsWithWhen:o,interestPage:i,options:c,isMultiRecordData:l,editType:u,isLocalAction:d,interestPageActionID:p,context:g}=e,{optionalPayload:h}=c;h&&(t.content={...h});let f={},m={...t},I=Nf.REFRESH;if(s||l&&u===js.ACTION){const t=BT(u,d);l&&u===js.ACTION&&(m.interestPageActionID=p,PA.getFeatureMap()?.pyEnableOptimisationForEmbedTable&&(m.actionIdArrayToBeProcessed=$T(g))),f=i_(t,e),m={...m,interestPage:i}}else o?f=((e,t)=>{const{isObjectType:n,isExternalObject:s,actionID:r,context:a,isExternalCase:o,casetypeID:i}=e,c=js.getDefaultQualifiedName(js.VIEW_NAMES.OBJECT_CREATE_VIEW);if(t||n&&EE(a)){let t=s&&r===c?Nf.REFRESH_EXTERNAL_OBJECT:Nf.REFRESH_CASE_DATA;const n=YI.shouldUseUnifiedHandling();return s&&r===c&&n&&(t=Nf.REFRESH_EXTERNAL_CASE_DATA),i_(t,e)}return i_(o&&i&&r===c?Nf.REFRESH_EXTERNAL_CASE_DATA:Nf.REFRESH_ASSIGNMENT_DATA,e)})(e,n):(r.length>0||a.length>0)&&({restAPI:f,requestBody:m,requestType:I}=((e,t,n,s,r)=>(r={...r,calculations:{fields:t,whens:n}},{restAPI:i_(s?Nf.RECALCULATE_CASE_DATA:Nf.RECALCULATE_ASSIGNMENT_DATA,e),requestBody:r,requestType:Nf.RECALCULATE}))(e,r,a,n,m));return{restAPI:f,requestBody:m,requestType:I}},QT=[(e,t)=>e.pipe(lh(Nf.REFRESH_DATA,Pa),Xg((e=>e.payload)),ih((e=>!Jm(e?.options?.actionMgrID))),Zg((e=>{const{context:n,contextData:s,options:r,isObjectType:a}=e,{propertyName:o="",classID:i="",isObjectWideAction:c,skipPayloadGeneration:l}=r,u=l?{content:{}}:rI(n,{skipUUID:!1,isObjectWideAction:c});let d=[],p=[],g=!1;PA.getFeatureMap().granularUIRefresh?(({fieldsWithDeclarativeTargets:d=[],whens:p=[]}=NE(n)),g=p.some((e=>e.type===HT))):g=!0;const h=p.filter((e=>e.type===qT)),f=rS.getPropertyName(o),m=f?f.split("."):[],I=m.pop(),E=m.join("."),y=[];E&&((e,t,n,s,r)=>{const a=oC(e,t);if(!a||"copy"!==a.dataRetrievalType)return;const o=rS.getIn(n,`content.content.${e}`);if(!o||"object"!=typeof o)return;(s?Object.keys(o).filter((e=>e!==s)):Object.keys(o)).length>0&&r.push(e)})(E,i,u,I,y),e.serverPrecedenceFields=y;let A={...u.content,contextData:s};const C=PI(n);rS.isEmpty(C)||(A=DI(C,A));const S=KT({...e,fieldsWithDeclarativeTargets:d,fieldsWithWhen:h,isViewsWithWhen:g},A);xf.registerBlockingAction(n).catch((()=>{}));const{restAPI:_,requestBody:N,requestType:T}=S;(e={...e,requestType:T}).requestType=T;const{reqType:D,restApi:P}=_,O={...zT(a,t,n)};O&&!O.etag&&e.isMultiRecordData&&e.editType===js.ACTION&&(O.etag=rS.getETag(e.context));return Mu(((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 s=(e=>{const{ID:t,actionID:n,context:s}=e;return`${t}.${s}.${n}`})(t);if(t.interestPage&&(e.interestPage=t.interestPage),YT(s)){const t=[];for(let n=0;n<WT[s].length;){const r=WT[s][n],a=_E(r,e);if("CANCEL_REFRESH"===a){const e=new Error;return e.code="ERR_CANCELED",Promise.reject(e)}!0===a&&(t.push(n),r.cancelConfig?.cancel()),n+=1}t.forEach((e=>{WT[s].splice(e,1)}))}const r=zd();return e.signal=r.token,e.cancelConfig=r,WT[s]?WT[s].push(e):WT[s]=[e],fd.publish(Fs.PUB_SUB_EVENTS.ON_REFRESH_START,{context:n}),Wd(e.url,e,n,{cancelContext:s}).then((e=>(delete WT[s],e))).catch((e=>{throw e&&"ERR_CANCELED"!==e.code&&delete WT[s],e}))})({reqHeaders:O,context:n,method:D,body:N,url:CE(e,P)},e)).pipe(Xg((t=>{const s=((e,t,n)=>{const s=YI.shouldUseUnifiedHandling(),r=YI.isObjectCaseType(t)||n;if(s||!r)return e;const a=rS.getIn(e?.data,Fs.OBJECT_INFO.OBJECT_INFO_CONTENT_CLASS_ID);return YI.isExternalObject(a)?e:Us.transformCaseData(e)})(t?.data,r?.classID,a);return r?.resetForm&&Zu.removeContextTreeNode(n),{response:{...s},actionConfig:e,actionMgrID:e.options.actionMgrID,headers:sI(t.headers)}})),ph(": Error occurred during fetch call at refreshData Epic : ",e.context,e?.options?.actionMgrID))})),Zg((async e=>{if(e&&e.type===Tr)return xf.deRegisterBlockingAction(e.payload?.context).catch((()=>{})),"ERR_CANCELED"===e.payload?.err?.code?[]:(fd.publish(js.ON_REFRESH_ERROR,{context:e.payload?.context}),uI(e));const{actionConfig:t,response:n,actionMgrID:s}=e,{context:r,serverPrecedenceFields:a,requestType:o}=t,i=Og.getTargetViewContainerName(Wr),c=Va(i,r),l={acName:c,context:r},u=am(n,{[Fs.STOPMERGEACTIONS]:!0,[Fs.ACTIONS.DELETEAVIALACTIONS]:!0});u.directUrlUpdation=!1,o===Nf.REFRESH&&await oI(u,t,l);const d=aI(u,{target:c,context:r});t.interestPage&&(d.interestPath=`caseInfo.content${rS.convertClipboardPageToPageRefNotation(t.interestPage)}`),d.isArrayDeepMerge=t.options?.isArrayDeepMerge,d.preserveClientChanges=void 0===t.options?.preserveClientChanges||t.options.preserveClientChanges;const p=YI.getPropertiesToReArrange(r),g=$S(fS,d,{serverPrecedenceFields:a,propertiesToReArrange:p}),h=g.payload?.data?.pageInstructions;return h?.length>0&&(delete g.payload?.data?.pageInstructions,vI.mergeServerPageInstructions(r,h)),BC(g),Dg.resolveActionByID(s,d),fd.publish(Fs.PUB_SUB_EVENTS.ON_REFRESH_COMPLETE,{context:r}),xf.deRegisterBlockingAction(r).catch((()=>{})),[]})))],JT=[e=>e.pipe(lh(ua),Zg((async e=>{const{context:t}=e.payload,n={},s={},r=Object.keys(e.payload.datapages).map((r=>{const a=e.payload.datapages[r];if(a.mode===js.READONLY&&a?.refreshStrategy){const{timeoutSecs:e="",type:t=""}=a?.refreshStrategy||{},n=GC()[a.name];if(n&&r in n){const s=n[r],{loadTime:a}=s;if(!Ch.isTimeElapsed(a,e,t))return}}return Ch.getData(a.name,{dataViewParameters:a.dataViewParameters},t).then((e=>{const t=a.mode===js.READONLY?s:n;t[a.name]?t[a.name][r]={pxResults:e.data.data,parameters:a.dataViewParameters,loadTime:e.data?.fetchDateTime}:t[a.name]={[r]:{pxResults:e.data.data,parameters:a.dataViewParameters,loadTime:e.data?.fetchDateTime}}})).catch((()=>{}))}));await Promise.allSettled(r);const a=[];return Object.keys(n).length&&a.push(fS({context:t,data:n})),Object.keys(s).length&&a.push(WS({data:s,context:t})),BC(a),[]})))];class XT{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=()=>r.g;getUniqueId=()=>this.getGlobalObject().uniqueId;setUniqueId=()=>{this.getGlobalObject().uniqueId=(new Date).getTime()};initBroadcastChannel=()=>{this.setUniqueId(),this.broadcastChannel=new BroadcastChannel("coexistence"),this.broadcastChannel.onmessage=e=>{const{uniqueId:t}=e.data;if(t===this.getUniqueId())switch(e.data.action){case XT.DISPLAY_DIRTY_POPUP:this.displayDirtyPopup(e);break;case XT.LOAD_PREVIEW:this.loadPreview(e);break;case XT.UPDATE_COEXISTENCE_DRILLDOWN_CASE:this.updateCoexistenceDrilldownCase(e);break;case XT.OPEN_ASSIGNMENT_ACTION:this.openAssignment(e);break;case XT.GET_NEXT_WORK_ACTION:this.getNextWork(e);break;case XT.OPEN_WORK_BY_HANDLE:this.openWorkByHandle(e);break;case XT.CLOSE_CONTAINER_ACTION:this.closeContainer(e);break;case XT.CANCEL_CASE:this.handleCaseCancel();break;case XT.CREATE_WORK:this.createWork(e)}}};displayDirtyPopup=e=>{this.broadcastEventToIframe=e.data.fromInfinity,this.isDirtyDialogActive||(e.data.isFormDirty?(fd.publish(js.PUB_SUB_EVENTS.EVENT_SHOW_CANCEL_ALERT,{isModalAction:!0,hideDelete:!0}),this.isDirtyDialogActive=!0):this.callback?.call(this))};handleCaseCancel=()=>{const e=jy(Fs.APP.APP),t=e[e.length-1],n=xy(t),s=$C(n)?.caseInfo?.ID;if(s&&n&&Cm({}).getPConnect().getActionsApi().getDescendants(s,n),Vm(n)){const e=yA(n);e&&Cm({}).getPConnect().getActionsApi().getDescendants(s,e)}};loadPreview=e=>{const{pyID:t,caseClassName:n,uniqueId:s}=e.data;if(s===this.getUniqueId()){Cm({}).getPConnect().getActionsApi().showCasePreview(t,{caseClassName:n})}};navigateToDefaultPage=()=>{const e=`${Fs.APP.APP}${js.FORWARD_SLASH_STRING}${Fs.PRIMARY}`;if(!0!==By(e))return;const t=Ls.getDefaultQualifiedName("Data-Portal"),n=Ls.getDefaultQualifiedName("pyHome"),s=Cm({isRoot:!0}),r=PCore.getStore()?.getState().data.app?.pyPortal?.pyPrimaryNavPages;let a;Array.isArray(r)&&r[0]&&(a=r[0]);const o=a?.pyClassName||t,i=a?.pyRuleName||n;s.getPConnect().getActionsApi().showPage(i,o)};closeContainer=e=>{const{uniqueId:t}=e.data;t===this.getUniqueId()&&this.navigateToDefaultPage()};updateCoexistenceDrilldownCase=e=>{const{key:t,caseClassName:n,actionApi:s,caseLabel:r,uniqueId:a}=e.data;if(a!==this.getUniqueId())return;let o=s;s===XT.OPEN_WORK_ITEM&&(o=XT.OPEN_WORK_BY_HANDLE),TA.updateSemanticURLAndDocumentTitle({key:t,caseClassName:n,actionName:o,name:r});Cm({}).getPConnect().getActionsApi().updateRecents(n,t.substring(t.lastIndexOf(" ")+1),r,t)};openAssignment=e=>{const{pzInsKey:t,caseClassName:n,uniqueId:s}=e.data;if(s===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)){Cm({}).getPConnect().getActionsApi().openAssignment(t,n,{containerName:Fs.PRIMARY,context:Fs.APP.APP})}this.onCreateCallback=null,this.openAssignmentParams=null}};getNextWork=e=>{const{uniqueId:t}=e.data;if(t===this.getUniqueId()){const e=`${Fs.APP.APP}${js.FORWARD_SLASH_STRING}${Fs.PRIMARY}`;Cm({meta:{},options:{context:Uy(e)}}).getPConnect().getActionsApi().getNextWork()}};openWorkByHandle=e=>{const{key:t,caseClassName:n,uniqueId:s}=e.data;if(s===this.getUniqueId()){const e=`${Fs.APP.APP}${js.FORWARD_SLASH_STRING}${Fs.PRIMARY}`;Cm({meta:{},options:{context:Uy(e)}}).getPConnect().getActionsApi().openWorkByHandle(t,n)}};createWork=e=>{const{strClassName:t,uniqueId:n,strFlowParams:s,caseInitProperties:r}=e.data;if(n===this.getUniqueId()){const e=`${Fs.APP.APP}${js.FORWARD_SLASH_STRING}${Fs.PRIMARY}`,n=Cm({meta:{},options:{context:Uy(e)}}),a=new URLSearchParams((r+s).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),fd.subscribe(Fs.PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.HANDLE_DISCARD,this.handleDiscard),fd.subscribe(Fs.PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.CHECK_IS_FORM_DIRTY,this.postDirtyPopupMessage)};unsubscribeEvents=()=>{fd.unsubscribeAllWithEventType(Fs.PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.CHECK_IS_FORM_DIRTY),fd.unsubscribeAllWithEventType(Fs.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:XT.DIRTY_POPUP_C11N,uniqueId:this.getUniqueId()}),this.setCallBackFunction(e)};handleDiscard=()=>{this.broadcastEventToIframe?(this.broadcastChannel?.postMessage({action:XT.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:XT.OPEN_ASSIGNMENT_MODAL,uniqueId:this.getUniqueId(),key:e}),this.broadcastEventToIframe=!1,this.onCreateCallback=t,this.openAssignmentParams=n}}const ZT=new XT,eD="nextAssignmentInfo",tD="nextAssignmentInfo.context",nD=e=>{const{containerName:t,isInCreateStage:n}=e;return n?js.MODAL:t||Og.getTargetViewContainerName(Qr)},sD=async(e,t)=>{if(By(e))return{continueExecution:!0,removeActionPayload:{},dirtyCheckPerformed:!1};return{...await mI(e,t),dirtyCheckPerformed:!0}},rD=e=>{if(YI.shouldUseUnifiedHandling()&&!PA.isInfinityRuntime())return e?.uiResources?.root?.config?.name===Ls.getDefaultQualifiedName("pzCreateDetails")||!1;const t=rS.getIn(e,[js.DATA,js.CASE_INFO.CASE_INFO]);return QI(t)&&JI(PA.getOperatorIdentifier(),t)},aD=(e,t)=>{const{class:n,context:s,viewType:r=tI.PAGE}=e,{removeActionPayload:a}=t;let o=e?.pageName?e?.pageName:PA.getDefaultCasePage();return e.isTraditionalUICase&&(o=Ls.getDefaultQualifiedName("pyDetails")),Mu(Zp.createCase(n,{...e,pageName:o,viewType:r,context:s})).pipe(Xg((({response:t,headers:n})=>(Us.analyseResponse(t),{response:t,actionInPayload:e,headers:n,removeActionPayload:a}))),ph("Error occurred during ajax call at createWork Epic : ",s))},oD=e=>{fd.publish(js.PUB_SUB_EVENTS.DISPLAY_CASE_CREATED_TOASTER,e)},iD=e=>{fd.publish(js.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_DONE,e)},cD=e=>{fd.publish(js.PUB_SUB_EVENTS.CASE_EVENTS.CASE_VIEW_OPENED_AFTER_CREATE,e)},lD=e=>{let t,n=0,s=[],r={},a=!1,o=!1;return e.pipe(lh(pS),gh(100),Xg((e=>(({actionMgrID:n}=e.payload),e.payload))),Zg((e=>{const{context:s}=e;if(t=e.class,o=!1,YI.isExternalCaseType(t)&&(od({context:s,stateObj:$C(s),clearContextMessages:!0}),!GI(s))){const e={type:Fs.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return Dg.rejectActionByID(n,!0,e),dh()}const r=nD(e),i=Va(r,s);return a=Gm(t),Mu(sD(i,{loadingContext:s})).pipe(Zg((({continueExecution:t,removeActionPayload:s,dirtyCheckPerformed:r})=>t?(o=r,e.isTraditionalUICase=a,aD(e,{removeActionPayload:s})):(Dg.rejectActionByID(n),uh))))})),Zg((async e=>{if(e?.type===Tr)return e.payload.context=((e,t)=>YI.isExternalCaseType(e)&&t?t:gA())(t,e.payload.context),s.push(uI(e)),s;const{actionInPayload:i,response:c,headers:l,removeActionPayload:u}=e,d=YI.isExternalCaseType(i.class);let p=rD(c);(i.renderInline||PA.getDefaultCasePage()||a)&&(p=!1),rS.setIn(c.data,Fs.CASE_INFO.IS_FIRST_ASSIGNMENT,!0);const g=nD({...i,isInCreateStage:p}),h=Va(g,i.context),f=gI(h,g,i.context),{openCaseViewAfterCreate:m}=i;if(!o&&((e,t,n)=>!Pm(e)&&By(t)&&(n??!0))(g,h,m)){const{continueExecution:e}=await mI(h,{loadingContext:i.context});if(!e)return Dg.rejectActionByID(n),s}const I=i?.openCaseViewAfterCreate??!0,E=am(c);if(!I&&!p&&!(e=>$y(e)&&PA.isOpenCasePageAfterCreateInMultiDocEnabled())(h)){const e=Um(c),{businessID:t,caseType:n,resolvedURL:a,caseTypeName:o}=Fg(c);return r={caseId:t,label:o,href:a},oD(r),iD({caseId:t,assignmentId:e,caseType:n,ID:Lm(E)}),d&&jm(i),s}const y=String(xm(Lm(E)));let A=a_("createWork",{caseClassName:wm(E)});A=A.replace(/{.+?}/,y),E.semanticURL=A,Ng.setComponentCache(y,wd.addDebugHeaders(i.debugInfo)),((e,t)=>{const n=rD(e),{skipBrowserSemanticUrlUpdate:s=!1,isTraditionalUICase:r}=t,a=r&&!Wm();rS.setIn(e,["directUrlUpdation"],(!n||a)&&!s)})(E,i);const C={acName:h,context:f},S=Qm(f);await oI(E,i,C);const _={target:h,context:f,containerItemID:f,headers:l,semanticURL:A,isInCreateStage:p,isMinimizable:p,caseViewMode:E.confirmationNote?js.REVIEW_MODE:js.PERFORM_MODE,currentCaseViewMode:S,assignmentContext:rS.getIn(E,tD),nextAssignmentInfo:rS.getIn(E,eD),resourceType:Fs.CASE,openCaseViewAfterCreate:i.openCaseViewAfterCreate,modalOptions:i.modalOptions,debugInfo:i.debugInfo};km(_,E);const N=aI(E,_);pI(N.data,i.remoteCaseMeta),a&&(delete N.data.caseInfo.actionButtons,N.data.caseInfo.content.coexistenceAction="openAssignment"),YI.setTraditionalGadgetId(N.data);const T=dI(h,N);return hI(T)&&Fm(s,{removeActionPayload:u,target:h}),d&&jm(i),s.push(T),Km(E,_),cD({caseId:y}),s})),Xg((()=>{const e=Wm(),t=QI(rS.getIn(s[0]?.payload,"data.caseInfo"));return a&&e&&t?ZT.postCreateCaseMessage(s[0]?.payload?.nextAssignmentInfo?.ID,TI,s):TI(s),$m(s,n),r={},s=[],s})))},{RESOURCE_TYPES:uD}=Fs,dD=(e,t)=>{const{containerItemID:n,context:s,actionMgrID:r,isInCreateStage:a,isModalAction:o}=t;if(a&&o){const t=Tm(n),a=Va(t,s);e.push($S(wS,{containerItemID:n,target:a,actionMgrID:r}))}},pD=(e,t)=>{const{containerItemID:n,skipReleaseLockRequest:s,isInCreateStage:r,isProcessAction:a}=t,o=Ly(n),i=`${o?.includes("root")?js.APP.ROOT:js.APP.APP}/${my.MODAL}`;e.push($S(LS,{containerItemID:n,context:o,target:i,skipReleaseLockRequest:s,isInCreateStage:r,isProcessAction:a}))},gD=e=>HC(".openCaseViewAfterCreate",js.CONTEXT_DATA,e)??!0,hD=async(e,{translatedDXAPIResponse:t,actionInPayload:n},s,r,a)=>{const{caseID:o}=n,i=(c=t,rS.getIn(c,_m.NEXT_ASSIGNMENT_INFO_ID,js.EMPTY_STRING));var c;const l=r?xg(t):wm(t),{caseViewMode:u,headers:d,semanticURL:p,actionMgrID:g,directUrlUpdation:h,key:f,flowName:m,resourceType:I}=s,E=Qy(n?.context),y=Cy(E,n?.context)?.acTertiary;Object.assign(a,{caseId:o,assignmentId:i,caseType:l,isSubmitFromBlendedUI:y}),pD(e,{...n,skipReleaseLockRequest:!0});const A=`${n?.containerItemID.includes("root")?js.APP.ROOT:js.APP.APP}/${my.PRIMARY}`,C=gI(A,my.PRIMARY),S=wd.getCoreHeadersFromContext(n.context)||!1,_=aI(t,{target:A,context:C,containerItemID:C,caseViewMode:u,headers:d,semanticURL:p,key:f,flowName:m,resourceType:I,directUrlUpdation:h,debugInfo:S&&S.debugInfo&&{debugId:S.debugInfo[js.COREHEADER_APP_DEBUG_ID]},shouldUpdateCaseActionsInParentContext:!0});if(By(A)){const t=$C(C),r=Lm({data:t}),[,a]=r?r.split(" "):[],o=`You will lose unsaved changes for ${a}. Do you want to continue?`;if(!gD(n.context))return e;{const{continueExecution:t}=await mI(A,{dirtyMessage:o});if(!t)return s.directUrlUpdation=!1,Dg.rejectActionByID(g),dh();_.currentCaseViewMode=Qm(_?.context),e.push($S(jS,_)),n.__deferCaseActionsPayload=_}}else{if(!((e,t)=>$y(e)&&(gD(t)||PA.isOpenCasePageAfterCreateInMultiDocEnabled()))(A,n.context))return e;e.push($S(_S,_))}return t.directUrlUpdation=h,t.semanticURL=p,await oI(t,{..._,acName:A},{acName:A,context:C}),e},fD=(e,{isModalAction:t,target:n,transientItemID:s})=>{if(t){const t=e.find((({type:e})=>e===kr));t?.payload&&(n=t.payload.target,s=t.payload.containerItemID)}const r=US({target:n,containerItemID:s});r.payload.transientItems.length&&e.push(r)},mD=e=>/^app\/preview_[0-9]*/g.test(e),ID=(e,t)=>{const n=Ws(e);return!mD(e)&&(n===t||/^app\/primary_[0-9]*/g.test(n))},ED=e=>{if(!gD(e.context)){let t;const n=e?.caseTypeID,s=e?.caseTypeName;return t=e.businessID?e.businessID:e.workID,{caseID:t,caseTypeID:n,caseTypeName:s}}return{}},yD=(e,t,n,s)=>{const{data:r,caseViewMode:a}=t,o={data:r,caseViewMode:a,context:n};if(rS.setIn(o.data,["context_data","caseViewMode"],a),e.push({type:ha,payload:{context:n}}),s){const t={data:Us.transformObjectToCase(r),caseViewMode:a,context:n};e.push($S(fS,t))}e.push($S(fS,o))},AD=async(e,t,n,s,r,a,o,i,c,l)=>{const{headers:u}=c,d=l?js.OBJECT_INFO.OBJECT_INFO:js.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=$C(e),s=c?.response?.data?.caseInfo?.assignments??[],r=n?.caseInfo?.assignments??[],a=Qm(e)===js.PERFORM_MODE,o=s[0]?.ID!==r[0]?.ID,i=s.length>0&&r.length>0;a&&o&&i&&c?.response?.data?.caseInfo?.assignments&&(c.response.data.caseInfo.assignments=t(s,r[0]?.ID))}const p=By(Qy(e));let g=!1;const h=Qy(n),f=yy(h),m=xy(h);m&&f?.items?.[m]?.key===c?.actionInPayload?.caseID&&(g=!0),pD(r,{...s,skipReleaseLockRequest:!0});const I=Tm(e),E={target:Qy(e),containerItemID:e,context:e,containerName:I};t.doDeleteCaseSummary=s.doDeleteCaseSummary;const y=Qs(n),A=$C(y),C=$C(s.context),S=A[d]?.ID,_=C[d]?.ID,N=$C(e)?.caseInfo?.ID;if(p&&S===_||!p&&(""===o||E.containerItemID.includes(js.WORKAREA)&&t.caseViewMode===js.REVIEW_MODE&&N===t.data?.caseInfo?.ID||!a&&t.root&&0===Object.keys(t.root).length&&N===t.data?.caseInfo?.ID))if((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),e.includes(js.WORKAREA)&&t.caseViewMode===js.REVIEW_MODE&&((e,t)=>{const n=e?.assignmentID,s=t?.data?.caseInfo?.assignments??[],r=s[0]?.ID;return n!==r})(s,i)&&(t.flowName=" ",t.clearView=!0,t.root?.config?.name!==js.PY_CONFIRM&&(t.root=void 0)),e.includes(js.ACTIONAREA))r.push($S(fS,{...t,key:o,resourceType:"",...E}));else{const e=Cy(E.target,E.containerItemID);e?.resourceType!==uD.PAGE&&r.push($S(RS,{...t,key:o,resourceType:"",...E}))}else if(a){const a=Qy(e),i=Py(a,o);if(i)E.target=a,E.context=i,E.containerItemID=i,r.push($S(RS,{...t,key:o,resourceType:"",...E}));else{const e=jy(n)[0];if(s.target=e,s.context=gI(e,js.WORKAREA,n),s?.context){s.containerItemID=s.context,r.push($S(_S,{...s,...t}));const n=s.containerItemID;r.push($S(wS,{parentContainerTarget:e,containerItemID:n}))}}}if(s.target=Qy(e),s.containerName=Tm(e),s.context=e,s.containerItemID=e,s.shouldUpdateCaseActionsInParentContext=!0,rS.setIn(t,"acName",E.target),await oI(i,t),s.__deferCaseActionsPayload=s,g&&(n.includes(js.WORKAREA)&&Vm(n)&&(n=Qs(n)),yD(r,t,n,l)),!a&&t.caseViewMode===js.PERFORM_MODE){const t=((e,t)=>{const n=Qy(e);return Py(n,t)})(e,o),n={data:{[d]:{headers:u}},context:t};r.push($S(fS,n)),r.push(cE(((e,t=!1,n=!1)=>{const s=Dg.getNextActionMgrId();return{ID:cS.getPropertyValue(Fs.CASE_INFO.ASSIGNMENT_ID,"",e),actionID:cS.getPropertyValue(Fs.CASE_INFO.ASSIGNMENTACTION_ID,"",e),context:e,caseWideAction:t,contextData:n,options:{actionMgrID:s}}})(t)))}}else{pD(r,s);let e=!1;const o=Qy(n),i=yy(o),u=xy(o);if(u&&i?.items?.[u]?.key===c?.actionInPayload?.caseID&&(e=!0),a){const e=jy(n)[0];s.target=e,s.context=gI(e,js.WORKAREA,n),s.containerItemID=s.context,r.push($S(_S,{...s,...t}));const a=s.containerItemID;r.push($S(wS,{parentContainerTarget:e,containerItemID:a}))}e&&yD(r,t,n,l)}},CD=async(e,t,n,s,r,a,o)=>{const i=a?"objectInfo":"caseInfo";((e,t,n)=>{if(t.isProcessAction&&(pD(n,{...t,skipReleaseLockRequest:!0}),e)){const s=`${t?.containerItemID.includes("root")?js.APP.ROOT:js.APP.APP}/${my.PRIMARY}`,r=gI(s,my.PRIMARY),a={insKey:e.ID,className:e.content.classID,context:r,acTargetName:js.PRIMARY,isChild:!0},o={type:pr,payload:{...a}};n.push(o)}})(e.data[i].parentCaseInfo,t,r);const c=e?.data[i]?.parentCaseInfo?.ID;if(c){const n=Qy(t?.context),s=Cy(n,t?.context)?.parentContext,r=Qy(s);t?.isProcessAction&&Ty(r,c)&&fA(s,e?.data[i]?.lastUpdateTime)}n.resourceType=uD.CASE,n.directUrlUpdation=!0,t.isProcessAction||await hD(r,{translatedDXAPIResponse:s,actionInPayload:t},n,a,o)},SD=async(e,t,n,s,r)=>{e.doDeleteCaseSummary=t.doDeleteCaseSummary,e.caseViewMode===js.REVIEW_MODE&&(e.flowName=" ",e.clearView=!0);const{containerItemID:a}=t;By(Qy(a))||rS.setIn(e.data,["context_data","caseViewMode"],e.caseViewMode);const o=YI.getPropertiesToReplace(a);r.push($S(RS,{...e,...s,propertiesToReplace:o})),rS.setIn(e,"acName",s.target),await oI(n,e),((e,t,n)=>{const{containerItemID:s}=t,r=Ly(s),{data:a,caseViewMode:o}=n;if(r&&Vm(s)){const n=Qs(r),i={data:a,caseViewMode:o,context:n};rS.setIn(i.data,["context_data","caseViewMode"],o),e.push({type:ha,payload:{context:n}});const c=YI.getPropertiesToReplace(s);e.push($S(fS,i,{propertiesToReplace:c})),t.shouldUpdateCaseActionsInParentContext=!0,t.__deferCaseActionsPayload=t}})(r,t,e)},_D=async(e,t,n,s,r,a,o,i,c,l={})=>{const{isCaseWideAction:u,isInCreateStage:d,containerItemID:p}=e,g=Ws(e.context),h=Mm(r,c),f=c?xg(r):wm(r),m=d&&!h&&!u,I=jy(g)[0],E=I?xy(I):g,y=Tm(p),A=Ly(p),C=Object.freeze({target:e.target,containerItemID:p,context:A,containerName:y});m&&!mD(e.context)?await CD(i,e,t,r,a,c,l):ID(e.context,E)?await AD(E,t,g,e,a,n,s,r,o,c):!u&&!c||ID(e.context,E)?await SD(t,e,r,C,a):(pD(a,e),((e,t,n)=>{const{containerItemID:s,caseID:r}=t;if(s&&/^app\/preview_[0-9]*/g.test(s)){const{caseClassName:t}=n,a=Ws(s),o=Ly(a);e.push($S(IS,{containerItemID:a,context:o,container:my.PREVIEW,containerName:my.PREVIEW,caseId:r,viewName:Fs.PREVIEW_VIEW_NAME,caseClassName:t,updateData:!0}))}})(a,e,{caseClassName:f}))},ND=(e,t,n)=>{const{isModalAction:s,isCaseWideAction:r,caseID:a}=t,o=ID(t.context,n),i=e?.data?.caseInfo?.stages,c=e?.data?.caseInfo?.stageID;Df({caseID:a,isModalAction:s,isModalLaunchedFromPrimaryValue:o,isCaseWideAction:r,stages:i,stageID:c})},TD=e=>{const t=e?.payload?.err?.errorDetails,n=e?.payload?.context;t?.forEach((e=>{e[js.ERROR_FIELD_IN_PAGE]=e[js.ERROR_FIELD_IN_PAGE].replace(/(\(\d+\))/g,(e=>`[${parseInt(e.substring(1,e.length-1),10)-1}]`));const t=e[js.ERROR_FIELD_IN_PAGE].slice(1),s=e[js.ERROR_IN_PAGE_IDENTIFIER],r=s.startsWith(".")?s.slice(1):s;if(r){let a=t?`caseInfo.content.${t}`:"caseInfo.content";a=js.getProperty(a.replace(/\(/g,"[").replace(/\)/g,"]"));const o=td(r,a,js.PROPERTY),i={type:Fs.MESSAGES.MESSAGES_TYPE_ERROR,message:e.localizedValue};Zu.mutateField(n,a,o[o.length-1],{messages:[i],type:Fs.MESSAGES.MESSAGES_TYPE_ERROR,fieldName:s})}}))},DD=e=>{const t=$C("app")?.pyPortal?.pyPrimaryNavPages,n=Array.isArray(t)?t[0]:null;return n?(bI.clearChangedProperties(e),[{type:nr,payload:{className:n.pyClassName,containerName:js.PRIMARY,context:js.APP.APP,pageReference:"pyPortal",viewName:n.pyRuleName,skipSemanticUrl:""}}]):[]},PD=e=>{const{containerName:t,isInCreateStage:n}=e;return n?js.MODAL:t||Og.getTargetViewContainerName(Ma)},OD=e=>e?.uiResources?.root?.config?.name===Ls.getDefaultQualifiedName("pzCreateDetails")||!1,RD=(e,t)=>{const n=OD(e),{skipBrowserSemanticUrlUpdate:s=!1}=t;rS.setIn(e,["directUrlUpdation"],!n&&!s)},bD=e=>e.confirmationNote?js.REVIEW_MODE:js.PERFORM_MODE,vD=(e,t)=>{let n;return n=!e.renderInline&&!PA.getDefaultCasePage()&&OD(t),n},xD=e=>{const{containerName:t,isInCreateStage:n}=e;return n?js.MODAL:t||Og.getTargetViewContainerName(Fa)},wD=(e,t)=>{const{class:n,context:s,viewType:r=tI.PAGE}=e,{removeActionPayload:a}=t,o=e?.pageName?e?.pageName:PA.getDefaultCasePage();return Mu(Zp.createCase(n,{...e,pageName:o,viewType:r,context:s,retrieveActionViewForNewObject:!0})).pipe(Xg((({response:t,headers:n})=>(Us.analyseResponse(t),{response:t,actionInPayload:e,headers:n,removeActionPayload:a}))),ph("Error occurred during ajax call at createObject Epic : ",s))},MD="CREATE_EXTERNAL_CASE",LD=e=>{let t=0,n=[],s=!1;return e.pipe(lh(MD),gh(100),Xg((e=>(({actionMgrID:t}=e.payload),e.payload))),Zg((e=>{const{context:n}=e,r=xD(e),a=Va(r,n);return s=!1,Mu(sD(a,{loadingContext:n})).pipe(Zg((({continueExecution:n,removeActionPayload:r,dirtyCheckPerformed:a})=>n?(s=a,wD(e,{removeActionPayload:r})):(Dg.rejectActionByID(t),uh))))})),Zg((async e=>{if(e&&e.type===Tr)return e.payload.context=gA(),n.push(uI(e)),n;const{actionInPayload:r,response:a,headers:o,removeActionPayload:i}=e,c=vD(r,a);rS.setIn(a.data,js.getProperty(js.CASE_INFO.IS_FIRST_ASSIGNMENT),!0);const l=xD({...r,isInCreateStage:c}),u=Va(l,r.context),d=gI(u,l,r.context);if(!s&&!Pm(l)&&By(u)){const{continueExecution:e}=await mI(u,{loadingContext:r.context});if(!e)return Dg.rejectActionByID(t),n}const p=am(a);let g=a_(Oa,{caseClassName:wm(p)});g=g.replace(/{.+?}/,String(xm(Lm(p)))),p.semanticURL=g,RD(p,r);const h={acName:u,context:d};await oI(p,r,h);const f={target:u,context:d,headers:o,semanticURL:g,caseViewMode:bD(p),containerItemID:d,isInCreateStage:c,isMinimizable:c,assignmentContext:rS.getIn(p,tD),nextAssignmentInfo:rS.getIn(p,eD),resourceType:Fs.RESOURCE_TYPES.CASE,openCaseViewAfterCreate:r.openCaseViewAfterCreate,modalOptions:r.modalOptions,debugInfo:r.debugInfo,isExternalCaseCreationFlow:!0};km(f,p);const m=aI(p,f),I=dI(u,m);return hI(I)&&Fm(n,{removeActionPayload:i,target:u}),n.push(I),SI(n),n})),Xg((()=>(TI(n),$m(n,t),n=[],n))))},{RESOURCE_TYPES:UD}=Fs,FD=(e,t={})=>{const{viewType:n,containerName:s,targetContainerName:r,isChild:a}=e,o=vm(t);return(e=>{if(e){const{stageID:t,stages:n=[]}=e,s=n.length;for(let e=0;e<s;e+=1)if(n[e].ID===t)return"manual"===n[e].transitionType}return!1})(o)&&e?.stageID===o.stageID?tI.PAGE:n||(!Dm(s)&&!Dm(r)||a?tI.PAGE:tI.FORM)},jD=(e,t,n,s,r)=>{if(Fm(e,{removeActionPayload:t,target:n}),((e,t)=>{const n=xy(t);let s=null;return n&&(s=Cy(t,n)),s?.key===e&&$y(t)})(s.key,n))s.context=Uy(n),s.containerItemID=s.context,e.push($S(jS,s));else if((r?.isChild||r?.isRemote)&&r?.isMultiDoc){const t=Qy(r.context);s.target=t,s.context=r.context,s.containerItemID=r.context,e.push($S(jS,s))}else{const t=Qy(s.context),n=Py(t,s.key);n?(s.target=t,s.context=n,s.containerItemID=n,e.push($S(jS,s))):e.push($S(_S,s))}},VD=(e,t,n,s,r,a,o)=>{By(t)&&Gy(t)?((e,t,n,s,r)=>{FD(e,t)===tI.FORM?(n.caseViewMode=s||js.PERFORM_MODE,r.push($S(RS,n))):r.push($S(jS,n))})(s,r,e,a,n):jD(n,o,t,e,s)},kD=(e,t,n)=>{if(!(e&&t&&(e=>{const{inlineViewType:t,caseTypeID:n,RedirectURL:s}=e;if(t&&t.toLowerCase().includes("remote"))return!1;const r=Bs.getRemoteCaseClassBySourceClass(n)??n;return!Bs.isRemoteCase(r)&&!!s})(t)&&t.RedirectURL))return!1;try{const e=new URL(t.RedirectURL);if("https:"===e.protocol)return globalThis.open(e.href,"_blank","noopener,noreferrer"),Dg.resolveActionByID(n),!0}catch{}return!1},BD=({restUrl:e,reqType:t,requestHeaders:n,debugInfo:s,context:r,isGetNextWork:a,doNotMergeMessagesForStatusCode:o})=>{const i=YI.appendExcludeQueryParamToUrl(e);return Wd(i,{method:t,headers:{"if-match":n&&n.etag,...n,...s&&{...wd.addDebugHeaders(s)}}},r,{doNotMergeHttpMessagesForStatusCode:a?o:""})},$D=(e,t)=>{const n=FD(e),{headers:s,context:r,assignmentID:a,isGetNextWork:o,debugInfo:i,isOpenStage:c,stageID:l,caseID:u,jsActionQueryParams:d,isLastStepInCreateStage:p}=e;let g,h;({restApi:g,reqType:h}=o?i_("getNextWork",{viewType:n}):c?i_("openStage",{caseID:u,stageID:l}):i_(Kr,{assignmentID:a,viewType:n}));const{removeActionPayload:f}=t,m=PA.getDefaultCasePage();let I="",E=e.pageName;e.isTraditionalUICase&&(E=Ls.getDefaultQualifiedName("pyDetails")),I=m?`${g}?viewType=${n}&pageName=${m}`:E?`${g}?viewType=${n}&pageName=${E}`:`${g}?viewType=${n}`,d&&Object.keys(d).forEach((e=>{I+=`&${e}=${d[e]}`}));const y=(e=>{let t=e?.headers??{};return e?.isRemote&&(t=sI(t,e.remoteClassName)),t})(e);return Mu(BD({restUrl:I,reqType:h,requestHeaders:y,debugInfo:i,context:r,isGetNextWork:o,doNotMergeMessagesForStatusCode:"404"})).pipe(Xg((e=>{if(PA.isCoexistenceAppOfType(js.APP_TYPE.UIKIT)&&!p){return QI(e.data.data.caseInfo)?e:(I=E?I.replaceAll(E,Ls.getDefaultQualifiedName("pyDetails")):I,PA.setDefaultCasePage(Ls.getDefaultQualifiedName("pyDetails")),{isReloadWithDifferentViewTypeRequired:!0,restUrl:I})}return e})),Zg((e=>e?.isReloadWithDifferentViewTypeRequired?BD({restUrl:I,reqType:h,requestHeaders:y,debugInfo:i,context:r,isGetNextWork:o,doNotMergeMessagesForStatusCode:"404"}):nh(e))),Xg((t=>{const{key:r,flowName:o}=cI(a);return Us.analyseResponse(t),{response:{...t.data,key:r,flowName:o},actionInPayload:e,viewType:n,removeActionPayload:f,headers:sI({...s,...t.headers})}})),ph("Error occurred during ajax call at openAssignment Epic : ",r))},{RESOURCE_TYPES:GD}=Fs,WD=e=>{const t="Browser"===PA.getRuntime();let n=0,s=[];const r=[];let a=!1,o=!1;return e.pipe(lh(kg),Xg((e=>(({actionMgrID:n}=e.payload),{...e.payload,...t?{insKey:e.payload.assignmentID}:{assignmentID:e.payload.assignmentID}}))),Zg((e=>{a=e.isGetNextWork;const{context:t}=e;let s;s=(e?.isChild||e?.isRemote)&&e?.isMultiDoc?tI.FORM:FD(e),e.viewType=s;const r=Nm(Kr,e),i=Va(r,t),{activate:c,activateContainerActionPayload:l}=EI(GD.ASSIGNMENT,i,e);if(c&&!e.isParallelCall)return nh({type:Fr,activateContainerActionPayload:l,actionInPayload:e});const u=xy(i);let d;return d=l?.isParallelAssignment?Promise.resolve({continueExecution:!0,removeActionPayload:{}}):u?mI(i,{loadingContext:t}):Promise.resolve({continueExecution:!0,removeActionPayload:{}}),Mu(d).pipe(Zg((({continueExecution:t,removeActionPayload:s})=>t?(o=Gm(e.className),e.isTraditionalUICase=o,PA.isWSSPortal()&&(e.headers={...e.headers,[js.X_ORIGIN_CHANNEL]:"WSS"}),$D(e,{removeActionPayload:s})):(Dg.rejectActionByID(n),uh))))})),Zg((async e=>{if(e?.type===Tr){if(a){const{payload:t}=e,{err:n}=t,s=n.response.status;r.push({status:Number(s)})}return s.push(uI(e)),s}const{type:t,actionInPayload:i,response:c,viewType:l,headers:u,removeActionPayload:d,activateContainerActionPayload:p}=e;if("openStage"===c?.redirectInfo?.jsAction){const e=c?.redirectInfo?.stageID,t=kg,n=c?.data?.caseInfo?.ID;i.isOpenStage=!0,i.stageID=e,i.jsActionQueryParams=c?.redirectInfo?.jsActionQueryParams;const r={type:t,payload:{...i,caseID:n,headers:u}};return s.push(r),s}if(kD(a,c?.data?.caseInfo,n))return s;const{context:g,caseViewMode:h,debugInfo:f}=i,m=c?.data?.caseInfo?.assignments?.find((e=>e.ID===i.assignmentID));i.caseViewMode=((e,t)=>e&&"false"===String(e.canPerform)?js.REVIEW_MODE:t??js.PERFORM_MODE)(m,h);const I=c?.data?.caseInfo?.caseTypeID;o=Gm(I),i.isTraditionalUICase=o;let E=((e,t)=>{const n=vm(e);let s;s=!PA.getDefaultCasePage()&&QI(n);const{isChild:r,containerName:a,isTraditionalUICase:o}=t,i=r&&s,c=s&&!t.isActionFromToDoList;return!i&&!c||o||t.renderInline?a||Nm(Kr,t):js.MODAL})(c,i);o&&(E=i.containerName??E);const y=Va(E,g);if(t===Fr)return await(async(e,t,n)=>{const{semanticURL:s,containerItemID:r,isParallelAssignment:a,insKey:o}=t,{target:i,actionInPayload:c}=n,{skipBrowserSemanticUrlUpdate:l=!1}=c,u=Ly(r);await oI({directUrlUpdation:!l,semanticURL:s},c,{acName:i,target:i,context:u}),e.push($S(wS,{containerItemID:r,target:i,isParallelAssignment:a,insKey:o,resourceType:UD.CASE,context:u,doDeleteCaseSummary:c.doDeleteCaseSummary}))})(s,p,{actionInPayload:i,target:y}),s;const A=c?.data?.caseInfo?.content,C=c?.data?.caseInfo?.ID,S=c?.uiResources?.root?.config?.name,_=c?.uiResources?.root?.config?.context;A&&!A[Ls.getDefaultQualifiedName("pyViewName")]&&S&&"page"!==i.viewType&&(rS.setIn(A,Ls.getDefaultQualifiedName("pyViewName"),S),rS.setIn(A,Ls.getDefaultQualifiedName("pyViewContext"),_));const N=am(c);((e,t)=>{const n=vm(e),s=Lm(e),r=QI(n),{skipBrowserSemanticUrlUpdate:a=!1,viewType:o,isTraditionalUICase:i}=t,c=i&&!Wm(),l=o===tI.PAGE&&(!r||c)&&!a,{caseTypeID:u}=n;if(l){const t=a_(Yr,{caseClassName:u}).replace(/{.+?}/,String(xm(s)));e.semanticURL=t,e.directUrlUpdation=!0}})(N,i);const T=gI(y,E,g),D={...i.debugInfo,debugId:i.debugInfo?.debugId??wd.getCoreHeadersFromContext(g)?.debugInfo?.[js.COREHEADER_APP_DEBUG_ID]};D.debugId&&Ng.setComponentCache(C,wd.addDebugHeaders(D));const P={acName:y,target:y,context:T};await oI(N,i,P);const O={target:y,context:T,containerItemID:T,headers:u,parentContext:Ws(i?.context),isMinimizable:QI(rS.getIn(N,"data.caseInfo")),doDeleteCaseSummary:i.doDeleteCaseSummary,acTertiary:i.acTertiary,resourceType:Fs.ASSIGNMENT,debugInfo:f,shouldUpdateCaseActionsInParentContext:!0,caseID:C};km(O,N,{skipFlowNameUpdate:i?.caseViewMode===js.REVIEW_MODE});const R=aI(N,O);var b;return pI(R.data,i.remoteCaseMeta),i.isProcessAction&&(R.data.isProcessAction=i.isProcessAction),((e,t)=>{e&&(delete t.data.caseInfo.actionButtons,t.data.caseInfo.content.coexistenceAction="openAssignment")})(o,R),YI.setTraditionalGadgetId(R.data),((e,t)=>{e.acTertiary&&(t.data.caseInfo.isFirstAssignment=e.acTertiary)})(i,R),R.caseViewMode=i.caseViewMode,VD(R,y,s,i,c,h,d),((e,t)=>{if(e=Bs.getRemoteCaseClassBySourceClass(e)??e,Bs.isRemoteCase(e)){const{RemoteClassName:n,RemoteSystemID:s,name:r}=Bs.getRemoteCase(e);if(t.headers?.RemoteSystemID||Dg.setRemoteCaseHeaderByContext(t,s),Bs.isTraditionalRemoteCase(e)||Bs.getRemoteAppPlatformVersion(s)){t.assignmentID=t.assignments?.[0]?.ID;const s={className:e,name:r,action:Ra,remoteClassName:n};Dg.setTraditionalRemoteCaseParams(t,s)}}})(I,R.data.caseInfo),l===tI.FORM&&Vm(R.containerItemID)&&(R.skipMergeAssignmentsAndActions=!1,NI(R,s,_)),Km(N,O),b={actionInContext:g,assignmentID:i.assignmentID,caseKey:R.key},fd.publish(js.PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_OPENED,b),s})),Xg((()=>{const e=n,t=Wm(),a=QI(rS.getIn(s[0]?.payload,"data.caseInfo"));return o&&t&&a?ZT.postCreateCaseMessage(s[0]?.payload?.data?.caseInfo?.assignments?.[0]?.ID,BC,s):BC(s),$m(s,e,r),s[0]?.payload?.isParallelAssignment&&BC({type:kg,payload:{...s[0].payload,isParallelCall:!0}}),s=[],s})))};const HD=(e,t)=>{const{insKey:n,headers:s,context:r,debugInfo:a,viewType:o}=e,{removeActionPayload:i}=t,c=e?.pageName?e?.pageName:PA.getDefaultCasePage(),l=i_(Yr,{caseID:n,params:{pageName:c}});let{restApi:u}=l;const{reqType:d}=l;return"none"===o&&(u=`${u?.split("viewType")[0]}viewType=none`),u=YI.appendExcludeQueryParamToUrl(u),Mu(Wd(u,{method:d,headers:{...s,...a&&{...wd.addDebugHeaders(a)}}},r)).pipe(Xg((t=>(Us.analyseResponse(t),{response:t.data,actionInPayload:e,headers:sI({...s,...t.headers}),removeActionPayload:i}))),ph("Error occurred during ajax call at openWorkByHandle Epic : ",r))},qD="OPEN_WORK_BY_HANDLE",{RESOURCE_TYPES:zD}=Fs,YD=async(e,t,n)=>{const s=t?.containerItemID||null,r=s&&jy(s)[0]?xy(jy(s)[0]):s,a=r||s,o=Ly(a)||a,i=Qy(o)||Qy(a),c=o?Qm(o):void 0,l=r?$C(r)?.caseInfo?.ID:void 0,u=e?.insKey;if(!(o&&a&&c===js.REVIEW_MODE&&r!==s&&l&&u&&l===u))return;let d;try{d=await(p=HD({...e,context:o,viewType:"none"},{removeActionPayload:void 0}),h="object"==typeof g,new Promise((function(e,t){var n=new cu({next:function(t){e(t),n.unsubscribe()},error:t,complete:function(){h?e(g.defaultValue):t(new bl)}});p.subscribe(n)})))}catch(e){return}var p,g,h;if(!d||Rm(d.type))return;const f=am(d.response),m=[{path:js.CASE_INFO.ASSIGNMENTS,allowMultiple:!0}],I={...f?.data,caseInfo:{...f?.data?.caseInfo??{},assignments:f?.data?.caseInfo?.assignments??[]}};n.push($S(jS,{containerItemID:a,target:i,context:o,data:I,caseViewMode:js.REVIEW_MODE,isArrayDeepMerge:!0,propertiesToReplace:m}))},KD=async(e,t,n)=>{const{actionInPayload:s,activateContainerActionPayload:r,type:a,response:o,removeActionPayload:i,headers:c}=e,{context:l,skipBrowserSemanticUrlUpdate:u,debugInfo:d}=s,p=Nm(Yr,s),g=Va(p,l);if(Om(a))await(async(e,t)=>{const{activateContainerActionPayload:{semanticURL:n,containerItemID:s},actionInPayload:r,actionInPayload:{context:a,skipBrowserSemanticUrlUpdate:o,doDeleteCaseSummary:i}}=t,c=Nm(Yr,r),l=Va(c,a),u=Ly(s);await oI({directUrlUpdation:!o,semanticURL:n},r,{acName:l,containerName:c,target:l,context:u}),e.push($S(wS,{containerItemID:s,target:l,context:u,doDeleteCaseSummary:i}))})(t,{activateContainerActionPayload:r,actionInPayload:s}),await YD(s,r,t);else{const r=gI(g,p,l,{buildNew:!0}),a=am(o),h=((e,t)=>{const{isRemoteCase:n,remoteCaseClass:s}=t,r=Lm(e),a=n?s:wm(e);let o=a_(Yr,{caseClassName:a},{id:t?.insKey});return o=o?.replace("{workID}",String(xm(r)))?.replace("{id}",t?.insKey),o})(a,s);a.semanticURL=h,a.directUrlUpdation=!u;const f={acName:g,context:r};await oI(a,s,f);const m=aI(a,{target:g,context:r,containerItemID:r,semanticURL:h,headers:c,debugInfo:d});m.caseViewMode=js.REVIEW_MODE,m.resourceType=zD.CASE,pI(m.data,s.remoteCaseMeta),n&&(m.data.caseInfo.content.coexistenceAction="openWorkByHandle",m.data.caseID=m.data.caseInfo.ID),YI.setTraditionalGadgetId(m.data),km(m,a,{skipFlowNameUpdate:!0}),m.currentCaseViewMode=Qm(e?.actionInPayload?.context);const I=dI(g,m);i.containerItemID&&hI(I)&&t.push($S(LS,{containerItemID:i.containerItemID,target:g})),t.push(I),Km(a,m)}const h=s.insKey;Of({caseKey:h,actionInContext:l})},QD=e=>{let t=0,n=[],s=!1;return e.pipe(lh(qD),Xg((e=>(({actionMgrID:t,isAutoRedirection:s=!1}=e.payload),e.payload))),Zg((e=>{const{context:n,isChild:r,viewType:a}=e,o=Nm(Yr,e),i=Va(o,n);let{activate:c,activateContainerActionPayload:l}=EI(zD.CASE,i,e);const u=By(i);if(!c&&!u&&e.insKey&&i){const t=((e,t)=>{const n=Py(e,t);if(!n)return null;const s=Cy(e,n);if(s?.resourceType!==zD.ASSIGNMENT||"string"!=typeof s?.context||""===s.context)return null;const r="string"==typeof s.semanticURL?s.semanticURL.trim():"";return r?{target:e,containerItemID:n,semanticURL:r,insKey:t}:null})(i,e.insKey);t&&(c=!0,l=t)}const d=c&&!r&&"none"!==a;return Mu("none"===a||d?Promise.resolve({continueExecution:!0,removeActionPayload:void 0}):mI(i,{loadingContext:n})).pipe(Zg((({continueExecution:n,removeActionPayload:r})=>n?d?(OI(l),nh({type:Fr,activateContainerActionPayload:l,actionInPayload:e})):(s&&Ng.setComponentCache("redirectionInProgress",!0),HD(e,{removeActionPayload:r})):(Dg.rejectActionByID(t),uh))))})),Zg((async e=>{if(e&&Rm(e.type))return n.push(uI(e)),n;const t=$C(e?.actionInPayload?.context),s=Gm(e?.actionInPayload.className);if("none"===e?.actionInPayload?.viewType){if("perform"!==t?.context_data?.caseViewMode){const t=am(e?.response),r={data:{...t?.data},context:e?.actionInPayload?.context,isArrayDeepMerge:!0};n.push({type:ha,payload:{context:r.context,doDeleteConfirmationDetails:!1}}),s&&r.data.caseInfo?.content&&(r.data.caseInfo.content.coexistenceAction="openWorkByHandle",r.data.caseID=r.data.caseInfo.ID),pI(r.data,e.actionInPayload.remoteCaseMeta),YI.setTraditionalGadgetId(r.data),n.push($S(fS,r));const a=Qy(e?.actionInPayload?.context),o=Tm(e?.actionInPayload?.context),i=Object.freeze({target:a,containerItemID:e?.actionInPayload?.context,context:e?.actionInPayload?.context,containerName:o});if(Vm(e?.actionInPayload?.context)){const t=aI(e?.response,{...i});NI({...t,isArrayDeepMerge:!0},n)}e.actionInPayload.shouldUpdateCaseActionsInParentContext=!0,e.actionInPayload.containerItemID=e?.actionInPayload?.context,e.actionInPayload.caseID=e?.actionInPayload?.insKey,Km(t,e?.actionInPayload)}}else await KD(e,n,s);return n})),Xg((()=>(s&&Ng.setComponentCache("redirectionInProgress",!1),BC(n),$m(n,t),n=[],n))))},JD="FINISH_ASSIGNMENT",XD=(e,t)=>{const{assignmentID:n,actionID:s,caseID:r,context:a,additionalHeaders:o={},outcome:i,jsActionQueryParams:c,headers:l}=e,{state$:u}=t,d=(e=>{const{isModalAction:t,viewType:n,isInCreateStage:s,isCaseWideAction:r}=e;return t&&s&&!r?tI.PAGE:n||tI.FORM})(e),p=(e=>{const{isCaseWideAction:t,caseTypeID:n}=e;return YI.shouldUseUnifiedHandling()?t||YI.isObjectCaseType(n)?sa:Jr:t?sa:Jr})(e),g={assignmentID:n,actionID:s,caseID:r,viewType:d};let{restApi:h}=i_(p,g);const{reqType:f}=i_(p,g);d&&!h?.includes("viewType=")&&(h=h?.includes("?")?`${h}&viewType=${d}`:`${h}?viewType=${d}`),i&&!h?.includes("outcome")&&(h=h?.includes("?")?`${h}&outcome=${i}`:`${h}?outcome=${i}`),h=oE(c,h),h=YI.appendExcludeQueryParamToUrl(h),e.viewType=d;const{content:m}=rI(a),I=u.value.data[a]?.caseInfo?.headers||{},{etag:E}=I,y={"if-match":E,...l,...o};return Mu(Wd(h,{method:f,body:m,headers:y},a)).pipe(Xg((t=>{const{data:n,headers:s}=t;return Us.analyseResponse(n),{response:n,actionInPayload:e,headers:sI({...y,...s})}})),ph("Error occurred during ajax call at finishAssignment Epic : ",a))},ZD=e=>{fd.publish(js.PUB_SUB_EVENTS.EVENT_EXPRESS_LOCALACTION,e)},eP=e=>{fd.publish(js.PUB_SUB_EVENTS.ERROR_ON_FINISH_ASSIGNMENT,e)},{RESOURCE_TYPES:tP}=Fs,nP=e=>{const t=kC()?.getState()?.data,n=t?Object.keys(t).find((e=>e.includes(js.WORKAREA))):void 0;return/^app\/primary(_\d+)?$/.test(e)&&!n},sP=(e,t)=>{let n,s=0,r=[],a={},o="",i={},c=!1,l=!1;return e.pipe(lh(JD),Zg((e=>{let u,d;const p=PA.isCoexistenceAppOfType(js.APP_TYPE.UIKIT);if(({actionMgrID:s}=e.payload),o=e.payload.context,od({context:o,stateObj:$C(o),clearContextMessages:!0}),!GI(o)||dd(o)){const t={type:Fs.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return Dg.rejectActionByID(s,!0,t),xf.handleDeferredActionCompletion(e.payload.context).then((()=>{eP({errorType:Fs.ERROR_TYPE.CLIENT})})),nh([])}return nh(e.payload).pipe(Zg((e=>{Ng.setComponentCache("lastActionID",e?.actionID),dD(r,e);const n={...e};return XD(n,{state$:t})})),Zg((async e=>{if(e&&e.type===Tr){iE(e);const t=uI(e);return r.push(t),r}yf.clearContextedCache(o);const{headers:t,actionInPayload:g,response:h}=e,{containerItemID:f,context:m=Ly(f),isModalAction:I,isInCreateStage:E}=g;c=g.isCaseWideAction,l=g.isProcessAction;const y=Qy(f);g.target=y;const A=Tm(f),C=Object.freeze({target:g.target,containerItemID:f,context:m,containerName:A});rS.setIn(h.data,js.CASE_INFO.IS_FIRST_ASSIGNMENT,!1),rS.setIn(h.data,js.CASE_INFO_IS_LOCAL_ACTION,!1),h?.uiResources?.root?.config?.name&&"page"!==g.viewType&&rS.setIn(h.data,js.CASE_INFO.VIEW_NAME,h?.uiResources?.root?.config?.name),ZD({submitResponse:h});let S=am(h,{[Fs.STOPMERGEACTIONS]:!h.nextAssignmentInfo});const _=wm(S),N=Ws(g.context),T=jy(N)[0]?xy(jy(N)[0]):N,D=Mm(S),P=E&&!D;!I||E||ID(g.context,T)||(S=CI(S,$C(f)));const O=aI(S,{headers:t,actionMgrID:s,directUrlUpdation:!1,isActiveWorkAreaPrimaryAndWorkareaAbsent:nP(T||"")});Bm(O.data,g),O.caseClassName=_,O.resourceType=tP.ASSIGNMENT,O.headers=t;const R=S?.uiResources?.root;if("AutoClose"===R?.type){const e=kC()?.getState()?.data?.[C.context]?.caseInfo,{ID:t,name:n,content:s}=e;return r=await(async e=>{const{target:t,containerItemID:n,context:s}=e,r=Uy("app/primary"),a=Cy(t,n)?.parentContext,o=Boolean(t)&&$y(t),i=$y("app/primary");if(o&&a!==js.APP.APP){if(await Jy(n,{skipDirtyCheck:!0}),0===_y(t).length)return DD(s)}else{if(!r||!i||a)return DD(s);await Jy(r,{skipDirtyCheck:!0,eventName:"Dismiss case"})}return[]})(g),b={ID:t,caseName:n,content:s,status:vm(S).status},fd.publish(js.PUB_SUB_EVENTS.DISPLAY_CASE_SUBMITTED_TOASTER,b),r}var b;let v,x;const w=S?.data?.caseInfo?.assignments?.some((e=>e.ID===g.assignmentID)),M=((e,t)=>{const{assignmentID:n}=t;return e?.data?.caseInfo?.assignments?.some((e=>e.ID===n&&"true"===e?.canPerform))})(S,g),L=((e,t,n,s,r)=>{let a;const o=Qy(t);a=$y(o)?Py(o,n.data?.caseInfo?.ID):xy(o);let i=!0;if(e&&a){const e=cS.getPropertyValue(Fs.CASE_INFO.ASSIGNMENTACTION_ID,"",a),t=cS.getPropertyValue(Fs.CASE_INFO.ASSIGNMENT_ID,"",a);if(e){const s=n?.data?.caseInfo?.assignments?.find((e=>e.ID===t)),r=s?.actions;r&&!r.some((t=>t?.ID===e))&&(i=!1)}}return s&&e&&i&&qC(null,js.CASE_VIEW_MODE_PROP,a)===js.PERFORM_MODE&&r})(w,T,S,I,M),U=g?.actionID===Fs.LOCAL_ACTIONS.TRANSFER_ASSIGNMENT;if(S?.data?.nextAssignmentInfo&&!U)O.caseViewMode=js.PERFORM_MODE,v=Lm(S),x=!0;else if(L&&!U)S?.confirmationNote&&S?.uiResources?.root?.config?.name===js.PY_CONFIRM?O.caseViewMode=js.REVIEW_MODE:O.caseViewMode=js.PERFORM_MODE,v=Lm(S),O.flowName=" ",O.deleteAssignmentSpecificResources=!1,x=!1;else{O.caseViewMode=js.REVIEW_MODE,rS.setIn(O.data,"context_data.caseViewMode",js.REVIEW_MODE);const e=By(Qy(T)),t=(e=>{if(e){const{stageID:t,stages:n=[]}=e,s=n.length;for(let e=0;e<s;e+=1)if(n[e].ID===t)return"resolution"===n[e].transitionType}return!1})(S?.data?.caseInfo);v=!S?.confirmationNote||!t&&S?.uiResources?.root?.config?.name!==js.PY_CONFIRM||e?"":Lm(S),x=!1}const F=Lm(S);km(O,S,{skipFlowNameUpdate:O?.caseViewMode===js.REVIEW_MODE||L});const j=a_("createWork",{caseClassName:_}).replace(/{.+?}/,String(xm(F)));if(S.semanticURL=j,O.semanticURL=j,I?(await _D(g,O,x,v,S,r,e,h,!1,i),P&&(a=ED(g))):E&&p&&!D?(PA.setDefaultCasePage(js.PY_DETAILS),await(async(e,t,n)=>{const s={assignmentID:e?.data?.caseInfo?.assignments[0]?.ID,className:e?.data?.caseInfo?.content?.classID,containerName:my.PRIMARY,targetContainerName:my.PRIMARY,viewType:tI.PAGE,isLastStepInCreateStage:!0,context:n},r={type:Ir,payload:{...s}};t.push(r)})(h,r,Ws(m))):await SD(O,g,S,C,r),T?.includes(js.ACTIONAREA)&&m===T){uy(m);const e=$C(T);r=[{type:yr,payload:{actionID:e.caseInfo.activeActionID,context:T,containerItemID:f,target:Qy(T),actionMgrID:Dg.getNextActionMgrId(),containerName:js.ACTIONAREA,localActionType:Fs.LOCAL_ACTION_TYPE.CASE_WIDE,caseID:e.caseInfo.ID}}]}if(zm(e,r),xf.handleDeferredActionCompletion(o).catch((()=>{})),ND(O,g,T),!S?.data?.nextAssignmentInfo){const e=((e,t)=>{const{isCaseWideAction:n,assignmentID:s,actionID:r}=t;return{isCaseWideAction:n,caseID:Lm(e),assignmentID:n?null:s,actionID:r||null}})(S,g);Pf({...e,containerItemID:f})}return fD(r,{transientItemID:f,target:y,isModalAction:I}),u=S,d=g,n=g,r})),Xg((()=>{const t=r.find((e=>e.type===Tr));var p;if(t?(xf.handleDeferredActionCompletion(o).then((()=>{eP({errorType:Fs.ERROR_TYPE.SERVER})})).catch((()=>{})),TD(t),Dg.rejectActionByID(s)):Dg.resolveActionByID(s,a),i?.caseId&&(p=i,fd.publish(js.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_DONE,p)),TI(r),Ym()&&u&&d&&Km(u,d.__deferCaseActionsPayload??d),!t&&(c||l)){const t=e.payload.caseID;Rf(t),(e=>{fd.publish(js.PUB_SUB_EVENTS.EVENT_LOCALACTION_SUBMISSION,e)})({updateState:!0})}return!t&&n&&(e=>{fd.publish(js.PUB_SUB_EVENTS.EVENT_FINISH_ASSIGNMENT_DONE,e)})(n),r=[],a={},i={},r})))})))},rP="CANCEL_ASSIGNMENT",aP=e=>{const t={},{routeKey:n,isModalAction:s,caseID:r,context:a,RemoteSystemID:o}=e;o&&(t.RemoteSystemID=o);const i=n||"releaseAssignmentLock",{restApi:c,reqType:l}=i_(i,{ID:r,caseID:r,viewType:tI.PAGE}),u=Ng.getComponentCache(r),d=u&&"object"==typeof u?u:{},p=YI.appendExcludeQueryParamToUrl(c);return Mu(Wd(p,{method:l,headers:{...t,...d}},a,{includeRemoteSystemIdIfPresent:!!o})).pipe(Xg((t=>(Ng.resetComponentCache(r),s?{actionInPayload:e}:{response:t.data,actionInPayload:e,headers:sI(t.headers)}))),ph(": Error occurred during ajax call at release lock request : ",a))},oP=(e,t)=>{const{isModalAction:n}=t;return aP({routeKey:"cancelAssignment",isModalAction:n,...e})},iP=e=>{let t=0,n=[];return e.pipe(lh(rP),Xg((e=>(({actionMgrID:t}=e.payload),e.payload))),Zg((e=>{const{isModalAction:n}=e;e.context||(e.context=Ly(e.containerItemID));const{context:s}=e,r=(e=>{const{isModalAction:t,containerItemID:n}=e;return t?my.MODAL:Tm(n)})(e),a=Va(r,s);return Mu(mI(a,{loadingContext:s})).pipe(Zg((({continueExecution:s})=>s?(e.RemoteSystemID=Bs.getRemoteHeaderByContext(e.context)??void 0,Mu(oP(e,{isModalAction:n}))):(Dg.rejectActionByID(t),uh))))})),Zg((e=>{if(e&&e.type===Tr)return n.push(uI(e)),Mu([n]);const{actionInPayload:s,response:r}=e,{containerItemID:a,isModalAction:o,isInCreateStage:i}=s;r?.data.caseInfo&&(r.data.caseInfo.availableProcesses=r.data.caseInfo.availableProcesses??[]);const c=Qy(a),l=Ly(a),u={target:o?`${js.APP.APP}/${js.MODAL}`:c,containerItemID:a,caseViewMode:o?js.PERFORM_MODE:js.REVIEW_MODE,context:l,actionMgrID:t,key:Lm(r),skipReleaseLockRequest:!1};return i&&n.push($S(RS,u)),!o&&Vm(a)&&(async(e,t)=>{const{childContainerItemID:n,caseViewMode:s,referencedUsers:r,response:a}=t,o=Ws(n),i=Ly(o);let c=!1;const l=a?.data?.caseInfo;l&&(c=Object.prototype.hasOwnProperty.call(l,"assignments"),l.assignments??=[]);const u={context:i,data:{...a.data,referencedUsers:r,context_data:{caseViewMode:s}}},d=[];c&&d.push({path:js.CASE_INFO.ASSIGNMENTS,allowMultiple:!0}),d.length>0?e.push($S(fS,u,{propertiesToReplace:d})):e.push($S(fS,u))})(n,{childContainerItemID:a,caseViewMode:js.REVIEW_MODE,referencedUsers:r?.data.referencedUsers,response:r}),u.skipReleaseLockRequest=!0,e.actionInPayload.shouldUpdateCaseActionsInParentContext=!0,Km(e?.response,e?.actionInPayload),n.push($S(LS,u)),Mu([n])})),Xg((()=>(BC(n),$m(n,t),n=[],n))))},cP="NAVIGATE_TO_STEP",lP=(e,t)=>{const{ID:n,stepID:s,containerItemID:r,context:a=Ly(r),isInCreateStage:o}=e,{state$:i}=t,c={ID:n,stepID:s,viewType:o?tI.PAGE:tI.FORM},{restApi:l,reqType:u}=i_("navigateToStep",c),{content:d}=rI(a),p=i.value.data[a].caseInfo.headers,g=YI.appendExcludeQueryParamToUrl(l);return Mu(Wd(`${g}`,{method:u,body:d,headers:{"if-match":p&&p.etag}},a)).pipe(Xg((t=>({response:t.data,actionInPayload:e,headers:sI({...p,...t.headers})}))),ph("Error occurred during ajax call at navigateToStep Epic : ",a))},{RESOURCE_TYPES:uP}=Fs,dP=(e,t)=>{let n=0,s=[];return e.pipe(lh(cP),Jg((e=>{let r,a;return({actionMgrID:n}=e.payload),nh(e.payload).pipe(Zg((e=>(ud(e.context),lP(e,{state$:t})))),Zg((async e=>{if(e&&Rm(e.type))return s.push(uI(e)),s;const{actionInPayload:t,response:n,headers:o}=e,{containerItemID:i,context:c=Ly(i),isModalAction:l}=t;yf.clearContextedCache(t.context);const u=Qy(i),d=Tm(i),p=Object.freeze({target:u,containerItemID:i,context:c,containerName:d}),g=n?.data?.caseInfo?.content,h=n?.uiResources?.root?.config?.name,f=n?.uiResources?.root?.config?.context;g&&!g[Ls.getDefaultQualifiedName("pyViewName")]&&h&&"page"!==t.viewType&&(rS.setIn(g,Ls.getDefaultQualifiedName("pyViewName"),h),rS.setIn(g,Ls.getDefaultQualifiedName("pyViewContext"),f)),r=am(n);const m={acName:u,...p};await oI(r,t,m),a=aI(r,{...p,headers:o}),n?.nextAssignmentInfo||(a.caseViewMode=js.REVIEW_MODE),zm(e,s),a.doDeleteCaseSummary=t.doDeleteCaseSummary,a.resourceType=uP.ASSIGNMENT,a.caseID=Lm(r),km(a,r),Bm(a.data,t);const I=r.data?.caseInfo?.stages,E=r.data?.caseInfo?.stageID;if(Df({caseID:Lm(r),isModalAction:l,stages:I,stageID:E}),Vm(i)){const e=YI.getPropertiesToReplace(i);NI(a,s,"",{propertiesToReplace:e})}return s.push($S(RS,a)),a.shouldUpdateCaseActionsInParentContext=!0,s})),Xg((()=>(BC(s),r&&a&&Km(r,a),$m(s,n),s=[],s))))})))},pP=e=>{const{caseID:t,context:n}=e,{restApi:s,reqType:r}=i_(Zr,{ID:t});return Mu(Wd(s,{method:r},n)).pipe(Xg((t=>(Us.analyseResponse(t.data),{response:t.data,actionInPayload:e,headers:sI(t.headers)}))),ph(": Error occurred during ajax call at deleteCaseInCreateStage Epic : ",n))},gP=e=>{fd.publish(js.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_DELETED,e)},hP=(e,t)=>{let n,s=0,r=[];return e.pipe(lh(Bg),Xg((e=>(({actionMgrID:s,caseType:n}=e.payload),e.payload))),Zg((e=>e.ignoreCaseDeletion?nh({actionInPayload:e}):pP(e))),Zg((async e=>{if(e&&Rm(e.type)){const{payload:t}=e,n=uI({...e,...t,actionMgrID:s});return r.push(n),r}const{actionInPayload:n}=e,{context:a,isModalAction:o}=n,i=o?my.MODAL:my.PRIMARY,c=Va(i,a);if(!o&&c){const e={acName:c,target:c,context:a},s=t.value.containers[c],{semanticURL:r}=(e=>{const{accessedOrder:t,items:n}=e;if(t&&t.length>1){const e=n[t[t.length-2]],{semanticURL:s}=e;if(s)return e}return{semanticURL:""}})(s);await oI({directUrlUpdation:!0,semanticURL:r},n,e)}if(n.isProcessAction&&n.parentCaseInfo){const e={insKey:n.parentCaseInfo.ID,className:n.parentCaseInfo.content.classID,context:n.parentContext,acTargetName:js.PRIMARY,isChild:!0},t={type:pr,payload:{...e}};r.push(t)}const l={target:c,containerItemID:a,context:a,caseDeleted:!0};return r.push($S(LS,l)),r})),Xg((()=>(BC(r),$m(r,s)===js.PROMISE_VALUE.RESOLVE&&gP({caseType:n}),r=[],r))))};function fP(e,t){return $l(t)?Zg(e,t,1):Zg(e,1)}const mP=(e,t)=>{const{assignmentID:n,actionID:s,context:r}=e,{restApi:a,reqType:o}=i_("save",{assignmentID:n,actionID:s}),{content:i}=rI(r),c=t.value.data[r]?.caseInfo?.headers,l=YI.appendExcludeQueryParamToUrl(a);return Mu(Wd(l,{method:o,body:i,headers:{"if-match":c&&c.etag}},r)).pipe(Xg((t=>({response:t.data,actionInPayload:e,headers:sI(t.headers)}))),ph(": Error occurred during ajax call at saveAndCloseAssignment Epic at save action : ",r))},IP=(e,t=!1)=>{const{action:n,state$:s,actionMgrID:r}=e,a=!0===n.payload.autosave;let o=[];return nh(n.payload).pipe(Zg((e=>mP(e,s))),fP((e=>{if(e&&Rm(e.type))return nh(e);const{containerItemID:t}=e&&e.actionInPayload,s=Ws(t),r=Qy(s),i=yy(r),c=jy(s)[0];let l=c?xy(c):s;!By(Qy(l))&&({containerItemID:l}=Ay(l,e.actionInPayload.caseID,c));const u=xy(r);n.payload.canUpdateAvailableActions&&rm(e.response);const d=Bs.getRemoteHeaderByContext(e.actionInPayload.context),p={...e.actionInPayload,RemoteSystemID:null===d?void 0:d};if(l&&o.push($S(fS,{context:l,data:{caseInfo:{...e.response.data?.caseInfo||{},headers:e.headers}}})),i?.items?.[u]?.key===e?.actionInPayload?.caseID){const n={context:s,data:{...e.response.data,caseInfo:{...e.response.data?.caseInfo||{},headers:e.headers}}},r=YI.getPropertiesToReplace(t);o.push($S(fS,n,{propertiesToReplace:r}))}return a||o.push($S(RS,{context:t})),zm(e,o),aP(p)})),Zg((async n=>{if(n&&Rm(n.type)){const{payload:t}=n,s=uI({...n,...t,actionMgrID:r});o.push(s);const a=e.action.payload.modalLoadingContainer;if(a){const e=a.context,{context_data:t}=$C(e)||{};t?.isLoading&&Jy(e)}return o}const{actionInPayload:s,response:i}=n,{context:c,containerName:l}=s,u={target:Va(l,c),containerItemID:c,context:c};return s.shouldUpdateCaseActionsInParentContext=!0,Km(i,s),t||a||o.push($S(LS,u)),o})),Xg((()=>{var e;return BC(o),$m(o,r),a||(e={context:n.payload.context,assignmentID:n.payload.assignmentID},fd.publish(js.PUB_SUB_EVENTS.CASE_EVENTS.SAVE_ASSIGNMENT_COMPLETE,e)),t||(o=[]),xf.isDeferredActionInProgress(n.payload.context)&&xf.handleDeferredActionCompletion(n.payload.context),o})))},EP=(e,t)=>{let n,s=0;return e.pipe(lh($g),Jg((e=>{const{saveOnly:r}=e.payload;({actionMgrID:s,caseType:n}=e.payload);return IP({action:e,state$:t,actionMgrID:s,caseType:n},r)})))},yP=e=>{const{callbacks:t}=e;if(t?.submit){const e=e=>{var n;t.submit(e),n="expressLocalActionSubmit",fd.unsubscribe(js.PUB_SUB_EVENTS.EVENT_EXPRESS_LOCALACTION,n)};n=e,s="expressLocalActionSubmit",fd.subscribe(js.PUB_SUB_EVENTS.EVENT_EXPRESS_LOCALACTION,n,s)}var n,s},{LOCAL_ACTION_TYPE:AP}=js,{RESOURCE_TYPES:CP}=Fs,SP=(e,t)=>{const{actionID:n,assignmentID:s,caseID:r,context:a,openActionType:o,modalLoadingContainer:i,headers:c}=e,{isProcessAction:l}=t,u=l?ta:(e=>{const t=e.localActionType?.toLowerCase();return t===AP.CASE_WIDE||t===AP.EXPRESS||t&&e.isPromotedAction?na:ea})(e),d=tI.FORM,{reqType:p}=i_(u,{caseID:r,ID:s,actionID:n,viewType:d});let{restApi:g}=i_(u,{caseID:r,ID:s,actionID:n,viewType:d});e.actionType=u===na?js.CASE:js.ASSIGNMENT,g&&!g.includes("viewType=")&&(g=g.includes("?")?`${g}&viewType=${d}`:`${g}?viewType=${d}`),g=YI.appendExcludeQueryParamToUrl(g);const h=i?.context??a;return Mu(Wd(g,{method:p,headers:c},h)).pipe(Xg((t=>({response:t.data,actionInPayload:e,headers:sI(t.headers,"",e.headers)}))),ph(`: Error occurred during ajax call at ${o} Epic : `,h))},_P=(e,t)=>{const{isProcessAction:n}=t,s=n?ta:ea;e.openActionType=s;let r;if("modal"===Nm(s,e)){if(!md.isOnline()||e.isAppOffline)return Dg.rejectActionByID(e.actionMgrID),Promise.resolve();r=jy(e.contextName)[0]?jy(e.contextName)[0]:Qy(e.contextName);const n=r?xy(r):e.contextName,s=Ly(n),a=Nm(e.openActionType,e),o=Va(a,e.context),i=Ks(e.context,Hs(a,e.context));if(BC(_S({target:o,context:i,containerItemID:i,key:e.caseID,caseViewMode:js.PERFORM_MODE,actionName:e.name,showProgress:!0,root:{type:"reference",config:{context:js.CASE_INFO.CASE_INFO_CONTENT,type:"view"}},data:{key:e.caseID,caseInfo:{ID:e.caseID}},headers:{...e.headers}})),BC(bS({context:i})),e.modalLoadingContainer={target:o,context:i},!jy(e.contextName)[0])return SP(e,t);if(!e.continueExecution)return SP(e,t);if(!cy(s))return SP(e,t);e.saveActionPayload.modalLoadingContainer=e.modalLoadingContainer,e.saveActionPayload.canUpdateAvailableActions=!e.saveActionPayload.isModalAction;return Mu([Gg(e.saveActionPayload)]).pipe(Zg((e=>(e=>{let t,n=0;const s=[],r={value:kC()?.getState()};return nh(e).pipe(lh($g),Jg((e=>{const{isFormValid:a}=e.payload;if(({actionMgrID:n,caseType:t}=e.payload),!a){const e={type:Fs.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return Dg.rejectActionByID(n,!0,e),nh([])}return IP({action:e,state$:r,actionMgrID:n,caseType:t,actionsOut:s},!0)})))})(e))),Zg((n=>1===n.length&&Rm(n[0].type)?Mu(mI(r,{loadingContext:e.context})).pipe(Zg((({continueExecution:n})=>n?SP(e,t):(Dg.rejectActionByID(e.actionMgrID),uh)))):SP(e,t))),Xg((e=>e)))}return SP(e,t)},NP=async(e,t,{headers:n,actionInPayload:s})=>{const{context:r,actionName:a,openActionType:o,doDeleteCaseSummary:i,modalLoadingContainer:c,skipMergeAssignmentsAndActions:l}=s,u=am(e),d=Nm(o,s),p=c?.target??Va(d,r);let g,h,f=!1;!Gy(p)||$y(p)&&!Ty(p,e.data.caseInfo.ID)?(h=Hs(d,r),Pm(d)&&(h=Ks(r,h)),g=h,f=!0):(g=$y(p)?Py(p,e.data.caseInfo.ID):xy(p),h=Ly(g));const m={acName:p,target:p,containerName:d,context:h};await oI(u,s,m),(void 0===u?.data?.caseInfo?.content||void 0!==u.data.caseInfo.content&&"object"==typeof u.data.caseInfo.content&&0===Object.keys(u.data.caseInfo.content).length)&&delete u.data?.caseMessages;const I=u.uiResources?.root;let E;E=I?js.PERFORM_MODE:js.REVIEW_MODE;const y=aI(u,{target:p,context:h,containerItemID:g,caseViewMode:E,doDeleteCaseSummary:i,headers:n,actionName:a,isMinimizable:!1,isInCreateStage:Pm(d),resourceType:CP.ASSIGNMENT,isProcessAction:s.isProcessAction,showProgress:s.showProgress,progressMessage:s.progressMessage,assignmentID:s.assignmentID,actionType:s.actionType,skipMergeAssignmentsAndActions:l});let A;if(I&&km(y,u),Pm(d)&&delete y.doDeleteCaseSummary,s.openActionType===ra&&(y.isBulkAction=!0,y.data.caseInfo.actionButtons.main[0].jsAction="async"===s.runningMode?"submitBulkActionAsync":"submitBulkAction",y.data.caseInfo.actionButtons.secondary[0].jsAction="cancelBulkAction",y.data.caseInfo.cases=s.selectedList,y.data.caseInfo.isAssignment=s.isAssignment),A=f?_S:s.isProcessAction||(e=>e.containerItemID?.includes(js.ACTIONAREA)&&e.context?.includes(js.ACTIONAREA))(s)?jS:RS,y.data.context_data.isProcessAction=s.isProcessAction,t.push($S(A,y)),f||t.push($S(vS,y)),f){const r=jy(s.contextName),a=Py(r,e.data.caseInfo.ID);if(a){const e={data:{caseInfo:{headers:n}},context:a};t.push($S(fS,e))}}g!==xy(p)&&t.push($S(wS,{target:p,containerItemID:g})),Vm(g)&&!c?.context&&NI(y,t);const C="other"===y.nextAssignmentInfo?.context;!s.isProcessAction||Gm(y.nextAssignmentInfo?.className)||C||zm({response:u,actionInPayload:{...s,containerItemID:g}},t),y.caseViewMode===js.REVIEW_MODE&&t.push($S(LS,y)),y.shouldUpdateCaseActionsInParentContext=!0;return rS.getIn(e.data,["caseInfo","isLocalAction"])||Km(u,y),t},TP="OPEN_LOCAL_ACTION",DP=(e,t)=>_P(e,t),PP=e=>{let t=0,n=[];return e.pipe(lh(TP),Xg((e=>(({actionMgrID:t}=e.payload),e.payload))),ih((()=>!Jm(t))),Zg((e=>DP(e,{actionMgrID:t}))),Zg((async e=>{if(!e)return uh;if(Rm(e.type)){const t=uI(e);n.push(t);const{context_data:s}=$C(e.payload.context)||{};return s?.isLoading&&n.push($S(vS,e.payload)),n}const{actionInPayload:t,headers:s,response:r}=e,{actionID:a}=t;rS.setIn(r,"data.caseInfo.activeActionID",a);return(e=>{fd.publish(js.PUB_SUB_EVENTS.CASE_EVENTS.CASE_EDIT_OPEN,e)})(rS.getIn(r,"data.caseInfo.ID")),rS.setIn(r.data,js.CASE_INFO_IS_LOCAL_ACTION,!0),t.refreshConditions&&rS.setIn(r.data,js.CASE_INFO_REFRESH_CONDITIONS,t.refreshConditions),await NP(r,n,{headers:s,actionInPayload:t}),yP(t),n})),Xg((()=>(BC(n),$m(n,t),n=[],n))))},OP=e=>{const{actionID:t,context:n,openActionType:s,caseTypeID:r,bulkContextID:a="",bulkContextType:o=""}=e,i=ra,{reqType:c,restApi:l}=i_(i,{caseTypeID:r,actionID:t,bulkContextID:a,bulkContextType:o});return Mu(Wd(l,{method:c},n)).pipe(Xg((t=>({response:t.data,actionInPayload:e,headers:sI(t.headers)}))),ph(`: Error occurred during ajax call at ${s} Epic : `,n))},RP=e=>{const{callbacks:t}=e;if(t?.submit){const e=e=>{var n;t.submit(e),n="bulkActionSubmit",fd.unsubscribe(js.PUB_SUB_EVENTS.EVENT_BULKACTION,n)};n=e,s="bulkActionSubmit",fd.subscribe(js.PUB_SUB_EVENTS.EVENT_BULKACTION,n,s)}var n,s},bP="OPEN_BULK_ACTION",vP=e=>{let t=0,n=[];return e.pipe(lh(bP),Xg((e=>(({actionMgrID:t}=e.payload),e.payload))),Zg((e=>((e,t)=>{const{context:n}=e,{actionMgrID:s}=t;e.openActionType=ra;const r=Nm(ra,e),a=Va(r,n);return Mu(mI(a,{loadingContext:n})).pipe(Zg((({continueExecution:t})=>t?OP(e):(Dg.rejectActionByID(s),uh))))})(e,{actionMgrID:t}))),Zg((async e=>{if(e&&Rm(e.type??"")){const t=uI(e);return n.push(t),n}const{actionInPayload:t,headers:s,response:r}=e,{actionID:a}=t;return rS.setIn(r,"data.caseInfo.activeActionID",a),await NP(r,n,{headers:s,actionInPayload:t}),RP(t),n})),Xg((()=>(1===n.length&&Rm(n[0].type)?Dg.rejectActionByID(t):Dg.resolveActionByID(t),BC(n),n=[],n))))};var xP=Array.isArray,wP=Object.getPrototypeOf,MP=Object.prototype,LP=Object.keys;function UP(e){if(1===e.length){var t=e[0];if(xP(t))return{args:t,keys:null};if((s=t)&&"object"==typeof s&&wP(s)===MP){var n=LP(t);return{args:n.map((function(e){return t[e]})),keys:n}}}var s;return{args:e,keys:null}}var FP=Array.isArray;function jP(e){return Xg((function(t){return function(e,t){return FP(t)?e.apply(void 0,Fl([],Ul(t))):e(t)}(e,t)}))}function VP(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=function(e){return $l(th(e))?e.pop():void 0}(e),s=UP(e),r=s.args,a=s.keys,o=new fu((function(e){var t=r.length;if(t)for(var n=new Array(t),s=t,o=t,i=function(t){var i=!1;Nu(r[t]).subscribe(Ou(e,(function(e){i||(i=!0,o--),n[t]=e}),(function(){return s--}),void 0,(function(){s&&i||(o||e.next(a?function(e,t){return e.reduce((function(e,n,s){return e[n]=t[s],e}),{})}(a,n):n),e.complete())})))},c=0;c<t;c++)i(c);else e.complete()}));return n?o.pipe(jP(n)):o}const kP=e=>{const{actionID:t,context:n,cases:s,classID:r,isAssignment:a}=e,{content:o}=rI(n,{nonEmptyAndChangedData:!0});let i=5;try{const e=Hf.getSharedState(Ls.getQualifiedNameForComplexRuleReferences("D_pySingleExecutionBulkActionsMeta.D_pySingleExecutionBulkActionsMeta.pxResults"));e?.find((e=>e[Ls.getDefaultQualifiedName("pyClassName")]===r))?.pyList.split(",").includes(t)&&(i=1)}catch(e){console.error('Failed to fetch to "D_pySingleExecutionBulkActionsMeta" DP response',e)}const c=s.map((e=>({ID:e}))),l=c.length/i,u=a?"performAssignmentBulkAction":aa,{reqType:d,restApi:p}=i_(u,{actionID:t}),g=[],h=c.length;for(let t=0;t<h;t+=l){const s=c.slice(t,t+l);a?o.assignments=s:o.cases=s,s.length&&g.push(Mu(Wd(p,{method:d,body:o},n)).pipe(Xg((t=>{const{data:n,headers:s}=t;return{response:n,actionInPayload:e,headers:sI({...s})}})),ph("Error occurred during ajax call at submitbulkaction Epic : ",n)))}return VP(g)},BP=e=>{fd.publish(js.PUB_SUB_EVENTS.EVENT_BULKACTION,e)},$P="SUBMIT_BULK_ACTION",GP=e=>{let t,n=0,s=[],r="";return e.pipe(lh($P),Jg((e=>{const{isFormValid:a}=e.payload;if(({actionMgrID:n}=e.payload),!a){const e={type:Fs.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return Dg.rejectActionByID(n,!0,e),nh([])}return nh(e.payload).pipe(Zg((e=>(t=e,kP(t)))),Zg((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})}))}))})),r=`${n} record(s) updated`,BP({submitResponse:e}),t.target="HYBRID"===PA.getRenderingMode()?Qy(i):`${js.APP.APP}/${my.MODAL}`,s.push($S(LS,{containerItemID:i,context:c,target:t.target,skipReleaseLockRequest:!0})),a&&s.push($S(MS,{messages:[{type:"error",message:1===a?"1 record failed to update":`${a} records failed to update`,errorDetails:o,showHeader:!1}],context:Ws(c)||c,category:"HTTP",showHeader:!1})),s})),Xg((()=>(Dg.resolveActionByID(n,r),BC(s),s=[],s))))})))},WP=e=>{const{actionID:t,context:n,cases:s}=e,{content:r}=rI(n,{nonEmptyAndChangedData:!0});r.cases=s.map((e=>({ID:e})));const a=aa,{reqType:o,restApi:i}=i_(a,{actionID:t,runningMode:"async"});return Mu(Wd(i,{method:o,body:r},n)).pipe(Xg((t=>{const{data:n,headers:s}=t;return{response:n,actionInPayload:e,headers:sI({...s})}})),ph("Error occurred during ajax call at submitbulkactionasync Epic : ",n))},HP=e=>{fd.publish(js.PUB_SUB_EVENTS.EVENT_BULKACTION,e)},qP="SUBMIT_BULK_ACTION_ASYNC",zP=e=>{let t,n=0,s=[],r={};return e.pipe(lh(qP),Jg((e=>{const{isFormValid:a}=e.payload;if(({actionMgrID:n}=e.payload),!a){const e={type:Fs.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return Dg.rejectActionByID(n,!0,e),nh([])}return nh(e.payload).pipe(Jg((e=>(t=e,WP(t)))),Xg((e=>{const{containerItemID:n,context:a}=t,{response:o}=e;return r={caseID:o.caseID,caseTypeID:"BackgroundJob"},HP({submitResponse:o}),t.target=`${js.APP.APP}/${my.MODAL}`,s.push($S(LS,{containerItemID:n,context:a,target:t.target,skipReleaseLockRequest:!0})),s})),Xg((()=>(Dg.resolveActionByID(n,r),BC(s),s=[],s))))})))},YP=(e,t)=>_P(e,t),KP=e=>{let t=0,n=[];return e.pipe(lh(Vg),Xg((e=>(({actionMgrID:t}=e.payload),e.payload))),Zg((e=>{const n=Nm(ta,e),s=Va(n,e.context);return Mu(mI(s,{loadingContext:e.context})).pipe(Zg((({continueExecution:n})=>n?(ud(e.context),YP(e,{actionMgrID:t,isProcessAction:!0})):(Dg.rejectActionByID(e.actionMgrID),uh))))})),Zg((async e=>{if(e&&Rm(e.type)){const t=uI(e);return n.push(t),n}const{actionInPayload:t,headers:s,response:r}=e;return await NP(r,n,{headers:s,actionInPayload:t}),n})),Xg((()=>(TI(n),$m(n,t),n=[],n))))},QP=e=>{let t=0,n=[];return e.pipe(lh(Rr,kr),Xg((e=>(({actionMgrID:t}=e.payload),e.payload))),Zg((e=>{const{containerItemID:t,caseID:n,context:s,caseDeleted:r,skipReleaseLockRequest:a,currentCaseViewMode:o,isProcessAction:i,isInCreateStage:c,deleteWork:l}=e,u=o===js.PERFORM_MODE,d=n&&u;return l?nh([]):i&&c?aP(e):t!==s||r||a||!d?t?.includes(js.MODAL)&&Qm(yA(t))===js.REVIEW_MODE?aP(e):nh([]):aP(e)})),Zg((e=>(e&&Rm(e.type)&&n.push(uI(e)),n))),Xg((()=>(BC(n),$m(n,t),n=[],n))))};var JP=function(e){function t(t,n){return e.call(this)||this}return xl(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(ql),XP={setInterval:function(e,t){for(var n=[],s=2;s<arguments.length;s++)n[s-2]=arguments[s];var r=XP.delegate;return(null==r?void 0:r.setInterval)?r.setInterval.apply(r,Fl([e,t],Ul(n))):setInterval.apply(void 0,Fl([e,t],Ul(n)))},clearInterval:function(e){var t=XP.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},ZP=function(e){function t(t,n){var s=e.call(this,t,n)||this;return s.scheduler=t,s.work=n,s.pending=!1,s}return xl(t,e),t.prototype.schedule=function(e,t){var n;if(void 0===t&&(t=0),this.closed)return this;this.state=e;var s=this.id,r=this.scheduler;return null!=s&&(this.id=this.recycleAsyncId(r,s,t)),this.pending=!0,this.delay=t,this.id=null!==(n=this.id)&&void 0!==n?n:this.requestAsyncId(r,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),XP.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&&XP.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,s=!1;try{this.work(e)}catch(e){s=!0,n=e||new Error("Scheduled action threw falsy error")}if(s)return this.unsubscribe(),n},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,n=this.scheduler,s=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Hl(s,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(JP),eO={now:function(){return(eO.delegate||Date).now()},delegate:void 0},tO=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=eO.now,e}(),nO=new(function(e){function t(t,n){void 0===n&&(n=tO.now);var s=e.call(this,t,n)||this;return s.actions=[],s._active=!1,s}return xl(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}(tO))(ZP),sO=nO;function rO(e,t,n){void 0===e&&(e=0),void 0===n&&(n=sO);var s=-1;return null!=t&&(eh(t)?n=t:s=t),new fu((function(t){var r,a=(r=e)instanceof Date&&!isNaN(r)?+e-n.now():e;a<0&&(a=0);var o=0;return n.schedule((function(){t.closed||(t.next(o++),0<=s?this.schedule(void 0,s):t.complete())}),a)}))}function aO(e,t){return void 0===e&&(e=0),void 0===t&&(t=nO),e<0&&(e=0),rO(e,e,t)}function oO(e){return Pu((function(t,n){var s=!1,r=null,a=null,o=function(){if(null==a||a.unsubscribe(),a=null,s){s=!1;var e=r;r=null,n.next(e)}};t.subscribe(Ou(n,(function(t){null==a||a.unsubscribe(),s=!0,r=t,a=Ou(n,o,Zl),Nu(e(t)).subscribe(a)}),(function(){o(),n.complete()}),void 0,(function(){r=a=null})))}))}const iO=(e,t,n,s,r)=>{if(r!==js.RESOURCE_STATUS.CREATE)return;vI.isStateMachineExist(e,t,n)||vI.setStateMachine(e,n,t,new lp(n,t,e));vI.getStateMachine(e,t,n).insert({},"string"==typeof s?s:s+1,!0,{isDefault:!0})},cO=(e,t,n,s,r)=>{"string"==typeof t&&e.data?.caseInfo?.content&&n&&("CREATE"===s||"UPDATE"===s)&&(e.data.caseInfo.content[r][t][n]=t)},lO=e=>{const t=!e.isLocalAction&&e.editType===js.ACTION;return{...t?{}:{activeActionID:e.actionID},assignments:[{ID:e.assignmentID,...t?{actions:[{ID:e.actionID}]}:{}}]}},uO=e=>{let t=0,n=[],s="";return e.pipe(lh(_a),Xg((e=>(({actionMgrID:t}=e.payload),e.payload))),Zg((e=>GT(e))),Zg((async e=>{if(e&&e.type===Tr)return n.push(uI(e)),{actionsOut:n,actionInPayload:{skipPageInstructions:!0}};const{actionInPayload:t,response:r,headers:a}=e,o=t.containerName,i=Va(o,t.context);let c=gI(i,o,t.context);c=Ks(t.context,c);const{pageReference:l,targetProperty:u,index:d,subscriptFieldName:p,pageGroupName:g,actionType:h,isPageGroup:f}=t,m=l?.startsWith(Fs.OBJECT_INFO.OBJECT_INFO);let I=null;m?(I=Us.transformCaseData(r),I.uiResources.root.config.context=`${l}${u}[${d}]`):I=r;const E=am(I);E.key=t.ID,E.data?.caseInfo?(E.data.caseInfo.ID=t.ID,cO(E,d,p,h,g)):E.data?.objectInfo&&(E.data.objectInfo.ID=t.ID);const{interestPageActionID:y,editType:A,isLocalAction:C,actionID:S}=t,_={isMultiRecordData:!0,viewName:t.viewID,parentContext:t.context,interestPage:t.interestPage,interestPageActionID:y,editType:A,isLocalAction:C,actionID:S};E.uiResources.context_data.modalView=_;const N=$C(t.context)?.context_data?.caseInfo,T=`${t.pageReference}${t.targetProperty}`,D=nd(N,T,t.index);E.uiResources.context_data.caseInfo={...E.uiResources.context_data.caseInfo,content:rS.mergeDeep(E.uiResources.context_data.caseInfo?.content,D?.content)};const P=cS.getProperty(js.CASE_INFO.REMOTESYSTEMID,"",t.context),O={acName:i,context:c};await oI(E,t,O);const R={target:i,context:c,containerItemID:c,headers:a,index:d,subscriptFieldName:p,pageGroupName:g,isPageGroup:f};P&&(R.headers={...R.headers,RemoteSystemID:P});const b=aI(E,R);b.resourceStatus=t.actionType,b.isMultiRecordData=!0,b.readOnly=t.readOnly,b.parentContext=t.context,b.heading=t.heading,b.data.caseInfo&&A===js.ACTION&&(b.data.caseInfo={...b.data.caseInfo,...lO(t),isLocalAction:t.isLocalAction}),b.clearStateMachine=!1;const v=dI(i,b);s=c,n.push(v);let x={changedListProperty:[],leafProperty:[]};return A===js.ACTION&&(vI.registerForServerChanges(),x=UC.getServerProperties(b.data,c)),{actionsOut:n,actionInPayload:t,serverProps:x}})),Xg((({actionInPayload:e,serverProps:r={changedListProperty:[],leafProperty:[]}})=>{if(bm(n)?Dg.rejectActionByID(t):Dg.resolveActionByID(t),e.skipPageInstructions||iO(s,e.pageReference,e.targetProperty,e.index,e.actionType),BC(n),n=[],e.editType===js.ACTION){UC.handleServerChanges(s,r.changedListProperty,r.leafProperty),vI.unRegisterForServerChanges();const t=js.getProperty(Fs.CASE_INFO.CASE_INFO_CONTENT)+rS.convertClipboardPageToPageRefNotation(e.interestPage);e.columns.forEach((n=>{const r=No.trimAnnotation(n.config.value),a=HC(r,t,s),o=oC(r.startsWith(".")?r.split(".").pop():r,n.config.classID);Zu.addFieldNode(s,t,e.viewID,r,a,{isDeclarativeTarget:!!o?.isDeclarativeTarget,context:s,propertyName:r,pageReference:t,value:n.config.value,isInsideList:/\[\d+\]/.test(t)||/\[\d+\]/.test(r)})}))}return n})))},dO=e=>{const{context:t}=e;let n={...rI(t).content,contextData:!1};const s=PI(t);rS.isEmpty(s)||(n=DI(s,n));const r=((e,t=!1)=>e===js.ACTION?t?Nf.REFRESH_CASE_DATA:Nf.REFRESH_ASSIGNMENT_DATA:Nf.REFRESH_CASE_VIEW)(e.editType,e.isLocalAction),{restApi:a,reqType:o}=i_(r,{ID:e.isLocalAction||e.editType!==js.ACTION?e.ID:e.assignmentID,actionID:e.actionID,viewID:e.viewID});let i=a;return e.editType===js.ACTION&&(i+=`?operation=${e.operationFlag}`,n.interestPageActionID=e.interestPageActionID),n.interestPage=e.interestPage,Mu(Wd(i,{method:o,body:n,headers:e.headers},t)).pipe(Xg((t=>({actionInPayload:e,response:t.data,headers:sI(t.headers)}))),ph(": Error occurred during getEmbeddedDataView request : ",t))},pO=(e,t,n)=>"string"==typeof n?`${e}${t}.${n}`:`${e}${t}[${n}]`,gO=(e,t,n,s,r)=>{const a=e.data?.caseInfo?.content;if(a){const e=((e,t,n)=>{const s=(e,t)=>{if((e=>"object"==typeof e&&null!==e)(e))return e[t]},r=t.replace(/^\./,"").split(".");let a=e;for(const e of r)a=s(a,e);return"string"==typeof n?s(a,n)??null:Array.isArray(a)?a[n]??null:null})(a,s,r);e&&BC(KS({context:t,reference:n,value:e}))}const o=e.uiResources?.context_data;o&&BC(KS({context:t,reference:js.CONTEXT_DATA,value:o}))},hO=e=>{let t=0,n=[];return e.pipe(lh(Na),Xg((e=>{const{payload:n}=e;return({actionMgrID:t}=n),n})),Zg((e=>dO(e))),fP((async e=>{const t={rootView:null,data:null,uiResources:null,containerContext:null};if(e?.type===Tr)return n.push(uI(e)),{actionsOut:n,actionInPayload:{skipPageInstructions:!0},responseData:t};const{actionInPayload:s,response:r,headers:a}=e,{pageReference:o,targetProperty:i,index:c,containerName:l}=s,u=o?.startsWith(Fs.OBJECT_INFO.OBJECT_INFO),{context:d,containerContext:p,target:g}=(e=>{const{containerName:t,context:n}=e;if(!t)return{context:n,containerContext:null,target:null};const s=Va(t,n),r=gI(s,t,n)||t,a=Ks(n,r);return{context:a,containerContext:a,target:s}})(s),h=((e,t,n,s,r)=>{if(r){const r=Us.transformCaseData(e);return r.uiResources.root.config.context=pO(t,n,s),r}return e})(r,o,i,c,u),f=am(h);f.key=s.ID;const m=pO(o,i,c),I=l?{acName:g,context:d}:{context:d};if(await oI(f,s,I),l&&g){const e=aI(f,{target:g,context:d,containerItemID:d,headers:a,index:c});e.resourceStatus=s.actionType,e.isMultiRecordData=!0,e.readOnly=s.readOnly,e.parentContext=s.context,e.clearStateMachine=!1;const t=dI(g,e);n.push(t)}else gO(f,d,m,i,c);const E=f.uiResources?.root||null;return E?.config&&(E.config.context=m),t.rootView=E,t.data=f.data,t.uiResources=f.uiResources,t.containerContext=p,{actionsOut:n,actionInPayload:s,responseData:t}})),Xg((({actionsOut:e,responseData:s})=>{bm(e)?Dg.rejectActionByID(t):Dg.resolveActionByID(t,s);return n=[],e})))},fO=e=>{let t,n="",s=[];return e.pipe(lh(Ta),Jg((e=>{t=e.payload;const{isFormValid:r}=e.payload;if(({actionMgrID:n}=e.payload),!r){const t={type:Fs.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return Dg.rejectActionByID(n,!0,t),xf.handleDeferredActionCompletion(e.payload.context),nh([])}return nh(e.payload).pipe(Zg((e=>(t=e,GT(t)))),Zg((async e=>((e,t)=>{if(e&&"action"===t.editType&&e.type!==Tr){const{context:n,pageReference:s}=t,r={context:n},{response:a}=e,o=s?.startsWith(Fs.OBJECT_INFO.OBJECT_INFO);let i=null;o?(i=Us.transformCaseData(a),i.uiResources.root.config.context=s):i=a;const c=am(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=aI(c,r);l.skipValidation=!0;const u=$S(fS,l);vI.registerForServerChangesSync(),BC(u),vI.unRegisterForServerChanges()}return e})(e,t))),Zg((async e=>{if(e&&e.type===Tr){const t=uI(e);return s.push(t),s}const{containerItemID:n,context:r,pageReference:a,interestPage:o}=t,i=o?.replace(/\(\d+\)$/,"");return((e,t,n,s,r)=>{Ip(e).forEach((e=>{const a=r&&"replace"===e.instruction.toLowerCase()?rS.convertClipboardPageToPageRefNotation(r):rS.convertClipboardPageToPageRefNotation(e.target);vI.isStateMachineExist(t,n,a)||vI.setStateMachine(t,a,n,new lp(a,n,t));const o=vI.getStateMachine(t,n,a);switch(e.instruction.toLowerCase()){case"insert":o.insert(e.content,e.listIndex,s,{encryptedContent:e.encryptedContent});break;case"update":o.update(e.content,e.listIndex??e.groupIndex,s,{encryptedContent:e.encryptedContent});break;case"delete":e.listIndex?o.delete(e.listIndex,s):e.groupIndex?o.delete(e.groupIndex,s):o.deletePage();break;case"replace":o.replacePage(e.content,s,r?e.target:void 0,r?n:void 0,e.encryptedContent);break;case"move":o.move(e.listIndex,e.listMoveToIndex);break;case"add":o.insert(e.content,e.groupIndex,s,{encryptedContent:e.encryptedContent});break;case"delete all":o.deleteAll()}}))})(r,t.parentContext,a.startsWith(Fs.OBJECT_INFO.OBJECT_INFO_CONTENT)?js.getProperty(Fs.OBJECT_INFO.OBJECT_INFO_CONTENT):js.getProperty(Fs.CASE_INFO.CASE_INFO_CONTENT),!1,i),s.push($S(LS,{containerItemID:n,context:r,target:t.target,skipReleaseLockRequest:!0})),s})),Xg((()=>{if(bm(s))Dg.rejectActionByID(n),xf.handleDeferredActionCompletion(t.context);else{Dg.resolveActionByID(n),xf.handleDeferredActionCompletion(t.context);const{pageReference:s}=e.payload,r=cS.getPropertyValue(js.CONTEXT_DATA_MODAL_VIEW.IS_MULTI_RECORD_DATA,s,t.parentContext);r?((e,t)=>{const{pageReference:n,isMultiRecordData:s}=t,r=cS.getPropertyValue(js.getProperty(Fs.CASE_INFO.CASE_INFO_ID),n,e.parentContext),a=cS.getPropertyValue(js.CONTEXT_DATA_MODAL_VIEW.VIEW_NAME,n,e.parentContext),o=cS.getPropertyValue(Fs.CASE_INFO.ASSIGNMENT_ID,n,e.parentContext),i=cS.getPropertyValue(js.CONTEXT_DATA_MODAL_VIEW.CONTEXT_DATA_MODAL_VIEW,n,e.parentContext),{interestPage:c,interestPageActionID:l,actionID:u,isLocalAction:d}=i,p=e.pageReference.substring(0,e.pageReference?.lastIndexOf(".")).replace(js.getProperty(js.CASE_INFO.CASE_INFO_CONTENT),"");"action"===i.editType?pE(r,o,u,e.parentContext,c,l,d,s,i.editType):dE(r,a,e.parentContext,p,{})})(t,{isMultiRecordData:r,pageReference:s}):yE(t.parentContext,js.getProperty(js.CASE_INFO.CASE_INFO_CONTENT),{})}return BC(s),s=[],s})))})))},mO=e=>{const{caseID:t,headers:n,debugInfo:s,context:r}=e,a=i_("getDescendants",{caseID:t}),{restApi:o}=a,{reqType:i}=a;return Mu(Wd(o,{method:i,headers:{...n,...s&&{...wd.addDebugHeaders(s)}}},r)).pipe(Xg((t=>({actionInPayload:e,response:t.data,headers:sI({...n,...t.headers})}))),ph("Error ocurred during ajax call at getDescendants Epic : ",r))},IO=e=>{let t=0,n=[];return e.pipe(lh(_f),Xg((e=>(({actionMgrID:t}=e.payload),e.payload))),Zg((e=>mO(e))),Zg((async e=>{if(e&&Rm(e.type))return n.push(uI(e)),n;const{actionInPayload:t,response:s}=e,r={};rS.setIn(r,"caseInfo.childCases",s?.childCases??[]),s?.uiResources?.resources&&fC(s.uiResources.resources),s?.uiResources?.components&&await Ig(s.uiResources.components),s?.uiResources?.localeReferences&&rS.setIn(r,"localeReferences",s.uiResources.localeReferences),s?.uiResources?.childCases_context_data&&rS.setIn(r,"childCases_context_data",s.uiResources.childCases_context_data);const a={data:r,context:t?.context};return n.push($S(fS,a)),n})),Xg((()=>(BC(n),$m(n,t),n=[],n))))},EO=e=>{let t,n="",s=[],r={};return e.pipe(lh(Da),Jg((e=>{t=e.payload;const{isFormValid:a}=e.payload;return({actionMgrID:n}=e.payload),a?nh(e.payload).pipe(Zg((e=>(t=e,nh({})))),Zg((async()=>{const{containerItemID:e}=t,a=$C(e),o=e,i=a?.dataInfo.content;delete i.classID;const c=Ws(o),l=jy(c).length,u=jy(c)[l-1]?xy(jy(c)[l-1]):c,d=Qy(e),p=Cy(d,e)||{},g=p?.referenceList?.replaceAll(".",""),h=p?.subscriptName,f=$C(u),m={containerItemID:u,data:{...f,caseInfo:{content:{...i}}}};s.push($S(RS,m)),((e,t,n)=>{cy(t)&&e.push($S(LS,{containerItemID:n,skipReleaseLockRequest:!0}))})(s,o,e);const I=(({itemData:e,workareaContainerData:t,subscriptData:n,pageGroupName:s,activeWorkArea:r,subscriptFieldName:a,actionMgrID:o,containerItemID:i})=>{const c={referenceList:e?.referenceList,ID:t?.caseInfo?.ID,index:n[a],containerName:Fs.MODAL,pageReference:Fs.CASE_INFO.CASE_INFO_CONTENT,viewID:Fs.VIEW_NAMES.DATA_OBJECT_CREATE_VIEW,skipSemanticUrl:!0,actionType:Fs.RESOURCE_STATUS.CREATE,interestPage:`.${s}.${n[a]??""}`,targetProperty:`.${s??""}`,pageGroupName:s,context:r??"",subscriptFieldName:a};return{type:_a,payload:{isInCreateStage:!1,isModalAction:!0,parentContext:"",target:"",...c,actionMgrID:o,containerItemID:i,doDeleteCaseSummary:!1,isFormValid:!0}}})({itemData:p,workareaContainerData:f,subscriptData:i,pageGroupName:g,activeWorkArea:u,subscriptFieldName:h,actionMgrID:n,containerItemID:e});return s.push(I),r=i,s})),Xg((()=>(Dg.resolveActionByID(n,r),BC(s),s=[],s)))):(((e,t)=>{const n={type:Fs.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};Dg.rejectActionByID(e,!0,n),xf.handleDeferredActionCompletion(t)})(n,e.payload.context),nh([]))})))},yO=[lD,LD,WD,QD,PP,vP,GP,zP,KP,sP,dP,iP,QP,EP,hP,e=>e.pipe(lh(Xr),oO((()=>aO(100))),Xg((e=>{const{actionMgrID:t,isChildCase:n,isModalAction:s,isProcessAction:r,isDataObject:a,skipReleaseLockRequest:o,isInCreateStage:i,containerItemID:c,context:l}=e.payload;return Dg.resolveActionByID(t),fd.publish(js.PUB_SUB_EVENTS.EVENT_SHOW_CANCEL_ALERT,{isModalAction:s,hideDelete:!r&&n,isDataObject:a,skipReleaseLockRequest:o,isInCreateStage:i,containerItemID:l||c}),[]}))),e=>e.pipe(lh(Br),oO((()=>aO(100))),Xg((e=>{const{actionMgrID:t,context:n,containerName:s,containerItemID:r}=e.payload,a=Va(s,n);return Dg.resolveActionByID(t),BC($S(wS,{containerItemID:r,target:a,doDeleteCaseSummary:!1})),[]}))),uO,hO,fO,IO,EO];function AO(){return Pu((function(e,t){e.subscribe(Ou(t,Zl))}))}const{RESOURCE_TYPES:CO}=Fs,SO="pyCasePreview",_O=(e,t)=>{const n=YI.isObjectCaseType(e.caseClassName);if(e.key&&!n){const n=Qy(e?.context),s=Py(n,e.key),r=e?.context;(s||e.updateData||(e=>{const t=kC();if(!e)return!1;const n=Ws(e),s=Qy(n),r=Qy(e);if(!s||!r)return!1;const a=Cy(s,n),o=Cy(r,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)})(r))&&t.actionsOut.push($S(fS,e))}else t.actionsOut.push($S(fS,e))},NO=[e=>e.pipe(lh(tr),Xg((e=>e.payload)),ih((e=>!Jm(e.actionMgrID))),Zg((e=>{const t={caseID:e.caseId,viewID:e.viewName,caseClassName:e.caseClassName,RemoteSystemID:e.RemoteSystemID};if(e.containerName===my.PREVIEW&&e.context&&e.caseId&&!e.updateData){const t=Va(my.PREVIEW,e.context),n=gI(t,my.PREVIEW,e.context,{buildNew:!0}),s=decodeURI(e.caseId);BC(_S({...e,context:n,target:t,containerItemID:n,key:s,caseViewMode:js.REVIEW_MODE,root:{type:"reference",config:{context:js.getProperty(js.CASE_INFO.CASE_INFO_CONTENT),name:e.viewName,type:"view"}},data:{key:s,caseInfo:{ID:s,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(Bs.isRemoteCase(t.caseClassName)){const{RemoteSystemID:e}=Bs.getRemoteCase(t.caseClassName);n.RemoteSystemID=e}const{restApi:s,reqType:r}=((e,t)=>{let n=i_("loadView",t);e.viewContext===CO.PAGE&&(n=i_(Wr,{page:e.viewName,pageClass:e.pageClass}));const s=Ls.getDefaultQualifiedName(SO);return e.containerName===my.PREVIEW&&Boolean(e.caseId)&&e.viewContext!==CO.PAGE&&(e.viewName===s||e.viewName===SO)&&(n=i_(Yr,{caseID:e.caseId,params:{pageName:s}})),n})(e,t);return Mu(Wd(YI.appendExcludeQueryParamToUrl(s),{method:r,headers:n},e.context)).pipe(Xg((t=>{const n=decodeURI(e.caseId);let s="";return"string"==typeof t.data?t.data?s=JSON.parse(t.data):(console.error("response data is empty!!"),s={}):s=t.data,{response:{...s,key:n},actionConfig:e,headers:sI(t.headers),rootView:rS.getIn(s,js.ROOT)}})),ph(": Error ocurred during ajax call at loadView Epic : ",e.viewLoadingContainer?.context??e.context))})),Zg((async e=>{const t={};if(e?.type===Tr){if(t.actionsOut=uI(e),e?.payload?.context?.includes(my.PREVIEW)){const n={...$C(e.payload.context),caseInfo:{progress:!1,error:!0}},s=Va(my.PREVIEW,e.payload.context);t.actionsOut=$S(RS,{key:n.key,target:s,containerName:my.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:s,headers:r}=e;e?.actionConfig?.skipAssignmentsUpdate&&(delete s?.data?.caseInfo?.assignments,delete s?.data?.caseInfo?.availableActions,delete s?.data?.caseInfo?.availableProcesses);const{containerItemID:a,containerName:o}=n,{target:i,context:c}=(e=>{const{containerName:t,updateData:n,viewLoadingContainer:s}=e,r=t||Og.getTargetViewContainerName(Wr),a=s?.target??Va(r,e.context);return{target:a,context:s?.context??(t===my.PREVIEW&&n?e.context:gI(a,r,e.context,{buildNew:!!t}))}})(n);n.context=c;const l={acName:i,context:c};let u={};u=am(s),u.directUrlUpdation=!1,await oI(u,n,l);const d={...n,target:i,context:c,containerItemID:a||c,headers:r},p=aI(u,d);if(p.resourceType=CO.CASE,n.viewName===js.PY_CONFIRM&&(p.caseViewMode=js.REVIEW_MODE,rS.setIn(p.data,["context_data","caseViewMode"],js.REVIEW_MODE)),o&&!p.updateData){p.caseViewMode=js.REVIEW_MODE,rS.setIn(p.data,["context_data","caseViewMode"],p.caseViewMode);const e=Qy(p?.context);((e,t,n,s,r)=>{e&&r===my.PREVIEW?(n.data.caseInfo.progress=!1,delete n.root,Km(n,n),s.actionsOut=$S(RS,{...n,containerName:r})):e?(s.actionsOut=[],s.actionsOut.push($S(wS,{target:t,containerItemID:e}))):s.actionsOut=$S(_S,{...n,containerName:r})})(Py(e,p.key),e,p,t,o)}else{p.preserveClientChanges=!0,t.actionsOut=[],o===my.PREVIEW&&t.actionsOut.push({type:ha,payload:{context:c,skipMergeAssignmentsAndActions:!1}});const{viewName:e}=n;e===Ls.getDefaultQualifiedName(SO)&&Km(p,p),_O(p,t)}}catch(e){console.error(e),t.rootView={type:"error",payload:e}}const{caseId:n,context:s,viewName:r}=e.actionConfig;return r===Ls.getDefaultQualifiedName(SO)&&(e=>{fd.publish(js.PUB_SUB_EVENTS.CASE_EVENTS.CASE_PREVIEW,e)})({caseId:n,context:s}),t})),Xg((({rootView:e,actionsOut:t,actionMgrID:n=0})=>(Dg.resolveActionByID(n,e),Us.setNeedsMapping(!1),t)))),e=>{let t=0,n=[];return e.pipe(lh(nr),Xg((e=>(({actionMgrID:t}=e.payload),e.payload))),Zg((e=>{fd.publish(Fs.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_STARTED);const{debugInfo:n,context:s,viewName:r,className:a,skipSemanticUrl:o=!1,containerName:i=Og.getTargetViewContainerName(Wr)}=e,c=n&&{...wd.addDebugHeaders(n)},l=Va(i,s);let u="";if(!o){const{semanticURL:t,activate:n,activateContainerActionPayload:s}=AI(r,a,l);if(u=t,n)return OI(s),nh({type:Fr,activateContainerActionPayload:s,actionConfig:e})}return Mu(xy(l)?mI(l,{loadingContext:s}):Promise.resolve({continueExecution:!0,removeActionPayload:{}})).pipe(Zg((({continueExecution:n,removeActionPayload:i})=>{if(!n)return Dg.rejectActionByID(t),uh;const{restApi:l,reqType:d}=i_(Wr,{page:r,pageClass:a});return Mu(Wd(l,{method:d,headers:c},s)).pipe(Xg((t=>{let n={};return n="string"==typeof t.data?JSON.parse(t.data):t.data,{response:{...n,key:u,semanticURL:u},actionConfig:e,headers:sI(t.headers),removeActionPayload:i,skipSemanticUrl:o}})),ph(": Error ocurred during ajax call at showPage Epic : ",e.context))})))})),Zg((async e=>{const t={};if(t.actionManagerID=e?.actionConfig?.actionMgrID,e&&e.type===Tr)return n.push(uI(e)),t;let{type:s}=e;const{actionConfig:r,skipSemanticUrl:a}=e,o=r.containerName||Og.getTargetViewContainerName(nr),i=Va(o,r.context);fd.publish(Fs.PUB_SUB_EVENTS.EVENT_PREVIEW_DISMISS,{pageName:e.actionConfig.viewName,pageClass:e.actionConfig.className}),fd.publish(Fs.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_INIT,{pageName:e.actionConfig.viewName,pageClass:e.actionConfig.className});const{remoteCasePayload:c,updatedType:l}=((e,t,n,s)=>{let r={},a=e;if(n.isRemoteCase){r={...n};const e=Py(s,r.insKey);e&&(t.activateContainerActionPayload={containerItemID:e},a=Fr)}return{remoteCasePayload:r,updatedType:a}})(s,e,r,i);if(s=l??s,r.isDeferLoaded){const{response:s,headers:o={}}=e,{isCreateDataObject:c,context:l}=r,u=am(s,{isCreateDataObject:c});u.directUrlUpdation=!a;const d={acName:i,context:l};await oI(u,r,d);const p=aI(u,{containerItemID:l,target:i,headers:o,context:l});t.rootView=rS.getIn(u,js.ROOT),n.push($S(fS,p))}else if(s===Fr){const{activateContainerActionPayload:{semanticURL:t,containerItemID:s}}=e,a={acName:i,context:Ly(s)};r.isTraditionalRemoteCase||await oI({directUrlUpdation:!0,semanticURL:t},r,a,!0),n.push($S(wS,{target:i,containerItemID:s}))}else{const t=gI(i,o,r.context),{response:s,headers:l={},removeActionPayload:u}=e,d=am(s,{isCreateDataObject:r.isCreateDataObject});d.directUrlUpdation=!a;const p={acName:i,context:t},g=Qm(t);await oI(d,r,p);const h={target:i,context:t,containerItemID:t,headers:l,debugInfo:r.debugInfo,currentCaseViewMode:g,referenceList:r?.referenceListStr,subscriptName:r?.subscriptName},f=aI(d,h);f.resourceType=Fs.PAGE,r.isCreateDataObject&&(f.resourceType=Fs.RESOURCE_TYPES.DATA,f.resourceStatus=Fs.RESOURCE_STATUS.CREATE,delete f.data.caseInfo,f.referenceList=r.referenceListStr,f.subscriptName=r.subscriptName),((e,t,n)=>{e.isRemoteCase&&(n.resourceType=Fs.CASE,n.key=YI.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:xm(YI.getRemoteCaseKey(t.assignmentID,t.insKey))}},pI(n.data,t.remoteCaseMeta),n.isTraditionalRemoteCase=e.isTraditionalRemoteCase||!1,n.className=t.className)})(r,c,f),f.data??={},f.data.traditionalGadgetId=YI.getUniqueGadgetId();const m=dI(i,f);u.containerItemID&&hI(m)&&n.push($S(LS,{containerItemID:u.containerItemID,target:i})),n.push(m)}return fd.publish(Fs.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_DONE,{target:i,pageName:e.actionConfig.viewName,pageClass:e.actionConfig.className}),t})),Xg((({actionManagerID:e=0,rootView:t})=>{Dg.resolveActionByID(e,t),BC(n),n=[]})),AO())}],TO=(e,t,n)=>{const{context:s,pageName:r,dataContext:a,dataContextParameters:o,semanticURL:i,skipSemanticUrl:c,RemoteSystemID:l}=e,{removeActionPayload:u}=t,{restApi:d,reqType:p,body:g}=i_(Hr,{pageName:r,dataContext:a,dataContextParameters:o}),h={};return h.RemoteSystemID=l,Mu(Wd(d,{method:p,headers:h,body:g},s)).pipe(Xg((t=>({response:{...t.data,key:i,semanticURL:i},actionConfig:e,headers:sI(t.headers),removeActionPayload:u,skipSemanticUrl:c}))),ph("Error occurred during ajax call at showData Epic : ",e.context,String(n)))},{RESOURCE_TYPES:DO}=Fs,PO=e=>{const{dataViewName:t,context:n,dataViewParameters:s}=e,r={data_view_ID:t,dataViewParameters:encodeURIComponent(JSON.stringify(s))},{restApi:a,reqType:o}=i_("deleteDataObject",r);return Mu(Wd(a,{method:o},n)).pipe(Xg((t=>({response:t.data,actionInPayload:e}))),ph("Error occurred during ajax call at deleteDataObject Epic",n))},OO=e=>{const{dataViewID:t,dataViewParameters:n,context:s}=e,r={data_view_ID:t},{restApi:a,reqType:o}=i_("getDataObjectActions",r);return Mu(Wd(a,{method:o,body:{dataViewParameters:n}},s)).pipe(Xg((e=>({...e.data}))),ph("Error occurred during ajax call at GET data object actions : ",e.context))},RO=[e=>{let t,n=0,s=[];return e.pipe(lh(sr),fP((e=>(({actionMgrID:n}=e.payload),nh(e.payload).pipe(Zg((e=>((e,t)=>{const{context:n,pageName:s,dataContext:r,dataContextParameters:a,skipSemanticUrl:o=!1,isDeferLoaded:i=!1,parentAction:c="",resourceType:l,containerName:u,RemoteSystemID:d}=e,p=Va(u,n);let g="";const h={context:n,pageName:s,dataContext:r,dataContextParameters:a,semanticURL:g,skipSemanticUrl:o,containerName:u,isDeferLoaded:i,parentAction:c,resourceType:l,RemoteSystemID:d};if(!o){g=a_(Hr,{pageName:s,dataViewName:r},a),h.semanticURL=g;const{activate:o,activateContainerActionPayload:i}=EI(DO.PAGE,p,{semanticURL:g});return o?nh({type:Fr,activateContainerActionPayload:i,actionConfig:e}):Mu(mI(p,{loadingContext:n})).pipe(Zg((({continueExecution:e,removeActionPayload:n})=>e?TO(h,{removeActionPayload:n},t):(Dg.rejectActionByID(t),uh))))}return TO(h,{removeActionPayload:{}},t)})(e,n))),Zg((async e=>{if(e&&e.type===Tr)return s.push(uI(e)),s;const{type:n,actionConfig:r,headers:a,response:o,skipSemanticUrl:i}=e;t=rS.getIn(o,js.ROOT);const{containerName:c,parentAction:l,resourceType:u}=r,d=Va(c,r.context);let p;const g=Qm(r?.context);if(r.isDeferLoaded){p=am(o),p.directUrlUpdation=!i;const t={acName:d,context:r.context};await oI(p,r,t);const n={target:d,headers:a,context:r.context,containerItemID:e.containerItemID},c=aI(p,n);return s=$S(fS,c),s}if(n===Fr){const{activateContainerActionPayload:{semanticURL:t,containerItemID:n}}=e,a={acName:d,context:Ly(n)};await oI({directUrlUpdation:!0,semanticURL:t},r,a,!0),s.push($S(wS,{target:d,containerItemID:n,resourceType:DO.DATA}))}else if("DATA"===u&&l===Sa){const{context:e}=r,t=o?.data,n={context:e,data:t};s.push($S(fS,n))}else{const t=gI(d,c,r.context),{removeActionPayload:n}=e;p=am(o),p.directUrlUpdation=!i;const l={acName:d,context:t};await oI(p,r,l);const u=aI(p,{target:d,context:t,containerItemID:t,headers:a,currentCaseViewMode:g});u.resourceType=DO.DATA;const h=dI(d,u);n.containerItemID&&hI(h)&&s.push($S(LS,{containerItemID:n.containerItemID,target:d})),SI(s),s.push(h)}return s})),Xg((()=>(Dg.resolveActionByID(n,t),BC(s),s=[],s))))))))},e=>{let t=0,n=[];return e.pipe(lh(Ia),gh(100),Jg((e=>{const{isFormValid:s}=e.payload;if(({actionMgrID:t}=e.payload),!s){const e={type:Fs.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return Dg.rejectActionByID(t,!0,e),nh([])}return nh(e.payload).pipe(Zg((e=>hh(e))),Zg((async e=>{if(e&&e.type===Tr){const{payload:s}=e,r=uI({...e,...s,actionMgrID:t});return n.push(r),{actionsOut:n,data:void 0}}const{actionInPayload:s}=e,{containerItemID:r,isModalAction:a}=s,o=a?my.MODAL:my.PRIMARY,i={target:Va(o,r),containerItemID:r,context:r};return n.push($S(LS,i)),{actionsOut:n,data:e?.response}})),Xg((({data:e})=>(1===n.length&&Rm(n[0].type)?Dg.rejectActionByID(t):Dg.resolveActionByID(t,e),BC(n),n=[],n))))})))},e=>{let t=0,n=[];return e.pipe(lh(ya),gh(100),Xg((e=>(({actionMgrID:t}=e.payload),e.payload))),Zg((e=>fh(e))),Zg((async e=>{if(e&&e.type===Tr){const{payload:s}=e,r=uI({...e,...s,actionMgrID:t});return n.push(r),n}const{actionInPayload:s,response:r,headers:a={}}=e,{containerName:o,readOnly:i,actionName:c}=s,l=Va(o,s.context),u=gI(l,o,s.context),d={acName:l,context:u};if(r?.data?.dataInfo){const{dataInfo:e}=r.data;e.dataContext||=s.dataLookUp,e.dataContextParameters||=s.requestPayload}await oI(r,s,d);const p=aI(r,{target:l,context:u,containerItemID:u,headers:a});return p.resourceType=Fs.RESOURCE_TYPES.DATA,p.resourceStatus=Fs.RESOURCE_STATUS.UPDATE,p.readOnly=i,p.actionName=c,p.key=JSON.stringify(s.requestPayload),n.push($S(_S,p)),n})),Xg((()=>(1===n.length&&Rm(n[0].type)?Dg.rejectActionByID(t):Dg.resolveActionByID(t),BC(n),n=[],n))))},e=>{let t=0,n=[];return e.pipe(lh(Aa),gh(100),Jg((e=>{const{isFormValid:s}=e.payload;if(({actionMgrID:t}=e.payload),!s){const e={type:Fs.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return Dg.rejectActionByID(t,!0,e),nh([])}return nh(e.payload).pipe(Zg((e=>mh(e))),Zg((async e=>{if(e&&e.type===Tr){const{payload:s}=e,r=uI({...e,...s,actionMgrID:t});return n.push(r),n}const{actionInPayload:s}=e,{containerItemID:r,isModalAction:a}=s,o=a?my.MODAL:my.PRIMARY,i={target:Va(o,r),containerItemID:r,context:r};return n.push($S(LS,i)),n})),Xg((()=>(1===n.length&&Rm(n[0].type)?Dg.rejectActionByID(t):Dg.resolveActionByID(t),BC(n),n=[],n))))})))},e=>{let t=0,n=[];return e.pipe(lh(Ea),gh(100),Xg((e=>(({actionMgrID:t}=e.payload),e.payload))),Zg((e=>PO(e))),Zg((async e=>{if(e&&e.type===Tr){const{payload:s}=e,r=uI({...e,...s,actionMgrID:t});return n.push(r),n}return[]})),Xg((()=>(1===n.length&&Rm(n[0].type)?Dg.rejectActionByID(t):Dg.resolveActionByID(t),BC(n),n=[],n))))},e=>{let t=0,n=[];let s={};return e.pipe(lh(_r),gh(100),Xg((e=>(({actionMgrID:t}=e.payload),e.payload))),Zg((e=>OO(e))),Zg((async e=>e&&e.type===Tr?(n.push(uI(e)),n):(s=e,[]))),Xg((()=>(1===n.length&&Rm(n[0].type)?Dg.rejectActionByID(t):Dg.resolveActionByID(t,s),BC(n),n=[],n))))},e=>{let t=0,n=[];return e.pipe(lh(Ca),gh(100),Xg((e=>(({actionMgrID:t}=e.payload),e.payload))),Zg((e=>Ih(e))),Zg((async e=>{if(e&&e.type===Tr){const{payload:s}=e,r=uI({...e,...s,actionMgrID:t});return n.push(r),n}const{actionInPayload:s,response:r,headers:a={}}=e,{containerName:o,actionID:i,context:c,actionName:l}=s,u=Va(o,s.context);let d=Hs(o,c);d=Ks(c,d);const p={target:u,context:d,containerItemID:d,headers:a,resourceType:Fs.RESOURCE_TYPES.DATA,resourceStatus:Fs.RESOURCE_STATUS.OPEN_FLOW_ACTION,key:JSON.stringify(s.dataViewParameters),actionID:i,actionName:l};if(r?.data?.dataInfo){const{dataInfo:e}=r.data;e.dataContext||=s.lookupDatapage,e.dataContextParameters||=s.dataViewParameters}const g={acName:u,context:c};await oI(r,s,g);const h=aI(r,p);return n.push($S(_S,h)),n})),Xg((()=>(1===n.length&&Rm(n[0].type)?Dg.rejectActionByID(t):Dg.resolveActionByID(t),BC(n),n=[],n))))},e=>{let t=0,n=[];return e.pipe(lh(Sa),gh(100),Jg((e=>{const{isFormValid:s}=e.payload;({actionMgrID:t}=e.payload);const r=e.payload.context;if(!s){const e={type:Fs.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return Dg.rejectActionByID(t,!0,e),nh([])}return od({context:r,stateObj:$C(r),clearContextMessages:!0}),nh(e.payload).pipe(Zg((e=>Eh(e))),Zg((async e=>{if(e&&e.type===Tr){iE(e,"dataObject");const{payload:s}=e,r=uI({...e,...s,actionMgrID:t});return n.push(r),n}const{actionInPayload:s,response:r,headers:a={}}=e,{containerName:o,containerItemID:i,resourceType:c,key:l}=s,u=Va(o,s.context),d={acName:u,context:s.context};await oI(r,s,d);const p={key:l,target:u,resourceType:c,containerItemID:i,headers:a,context:s.context};return n=((e,t,n,s)=>{const{resourceType:r,key:a,containerItemID:o}=s,i=aI(n,t);i.resourceType=r||Fs.RESOURCE_TYPES.DATA;const c=Qs(o);e.push($S(LS,i));const l=HC(".dataContext","dataInfo",c),u=HC(".dataContextParameters","dataInfo",c),d={context:c,skipSemanticUrl:!0,resourceType:r,parentAction:Sa,dataContext:l,dataContextParameters:u},p=l&&u&&a_(Hr,{pageName:js.PY_DETAILS,dataViewName:l},u)||"";if(o?.includes(js.PREVIEW)){const t={type:sr,payload:{pageName:js.VIEW_NAMES.PY_DATA_PREVIEW,container:js.PREVIEW,containerName:js.PREVIEW,...d}};e.push(t)}else if(r!==js.PAGE&&a===p&&o?.includes(js.PRIMARY)){const t={type:sr,payload:{pageName:js.VIEW_NAMES.PY_DETAILS,containerName:"",...d}};e.push(t)}return e})(n,p,r,{key:l,resourceType:c,containerItemID:i}),n})),Xg((()=>(1===n.length&&Rm(n[0].type)?Dg.rejectActionByID(t):Dg.resolveActionByID(t),BC(n),n=[],n))))})))}];function bO(e,t){return void 0===t&&(t=nO),Pu((function(n,s){var r=null,a=null,o=null,i=function(){if(r){r.unsubscribe(),r=null;var e=a;a=null,s.next(e)}};function c(){var n=o+e,a=t.now();if(a<n)return r=this.schedule(void 0,n-a),void s.add(r);i()}n.subscribe(Ou(s,(function(n){a=n,o=t.now(),r||(r=t.schedule(c,e),s.add(r))}),(function(){i(),s.complete()}),void 0,(function(){a=r=null})))}))}const{RESOURCE_TYPES:{CASE:vO,DATA:xO,OBJECT:wO}}=Fs;let MO=[],LO=!1,UO=!1,FO=null,jO=null;const VO={},kO=[e=>e.pipe(lh(Nr),bO(200),Xg((e=>e.payload)),Zg((e=>{UO=!1,fd.subscribe(Fs.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_STARTED,(()=>{UO=!0}));const t=Id.getPreviewMode()&&wd.addDebugHeaders({debugId:rS.generateUniqueID()});VO.dataContext=e.payload.dataViewName,VO.dataContextParameters=e.payload.dataViewKeys;const{context:n,requestType:s,routeKey:r}=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"'))),LO=r===La,LO&&Us.setNeedsMapping(!0);const o=rn()+a,i=e.options.context;let c;const l={},u=e?.payload?.caseClassName;if(Bs.isRemoteCase(u)){const{RemoteSystemID:e}=Bs.getRemoteCase(u);l.RemoteSystemID=e}if(PA.isWSSPortal()&&(l[js.X_ORIGIN_CHANNEL]="WSS"),"POST"===s){c=e.payload,a.indexOf("viewType=")<0&&(a=`${a}?viewType=page`);let i;switch(_I(r)){case vO:case wO:i={caseTypeID:c.caseTypeID,processID:c.processID,content:{}};break;case xO:i=VO;break;default:i=c}return Mu(Wd(o,{method:s,body:i,headers:{...l,...t}},n)).pipe(Xg((t=>({response:{...t.data},payload:e,headers:sI(t.headers,"",l)}))),ph(": Error occurred during ajax call at historyEpic : ",e))}return Mu(Wd(YI.appendExcludeQueryParamToUrl(o),{method:"GET",headers:{...l,...t}},i.substring(0,i.lastIndexOf("/")))).pipe(Xg((n=>({response:n.data,payload:e,headers:{...sI(n.headers),...t}}))),Lu((s=>{if(r===oa){const n={messages:[{type:"error",message:s.response.data.errorDetails[0].localizedValue}],category:"PAGE"};Ng.setComponentCache("assignments-launchAssignment-Error",n);const r=Rh(SA()),a=TA.getEndPointInfo(r.split("/assignments")[0]),o=rn()+a.routeEndpoint;return e={...e,routeKey:Yr,resetSemanticURL:!0},Mu(Wd(o,{method:a.reqType,headers:{...l,...t}},i.substring(0,i.lastIndexOf("/")))).pipe(Xg((n=>({response:n.data,payload:e,headers:{...sI(n.headers),...t}}))))}return nh(GS(": Error occurred during ajax call at historyEpic : ",s,n))})))})),Zg((async e=>{if(UO)return MO;if(fd.subscribe(Fs.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_STARTED,(()=>{UO=!0})),e&&e.type===Tr)return uI(e);const{headers:t={},response:n,payload:s}=e,r=am(n,{[Fs.STOPMERGEACTIONS]:!n.nextAssignmentInfo}),a=s.options.acName,o=By(a)&&Gy(a)?xy(a):e.payload.options.context,i=o;t.RemoteSystemID=s?.payload?.RemoteSystemID,jO={target:a,context:o,containerItemID:i,headers:t,debugInfo:{debugId:t[js.COREHEADER_APP_DEBUG_ID]}};let c=s?.payload?.pageClass;const l=s?.payload?.page,u=LO?La:Yr,d=LO?s.payload.objectID:s.payload.workID,p=LO?"{objectID}":"{workID}";let g=LO?`objects/${d}`:"";s?.payload?.caseName&&d&&(g=a_(u,{caseName:e.payload.payload.caseName}),g=g?.replace(p,d)||"",c=s?.payload?.caseClassName),(s?.routeKey===oa||s?.resetSemanticURL)&&((e,t)=>{const n=Lm(t);let s=a_(Yr,{caseClassName:wm(t)},{id:n});s=s?.replace("{workID}",String(xm(n))).replace("{id}",String(xm(n))),f_({directUrlUpdation:!0,semanticURL:s,options:{}})})(0,r),((e,t)=>{const n=t?.data?.caseInfo;e===oa&&n?.caseTypeID&&n?.content&&Gm(n.caseTypeID)&&(n.content.coexistenceAction=Kr)})(s?.routeKey,r),(e=>{const t=e?.data?.caseInfo;if(!t)return;const{ID:n,caseTypeID:s}=t;n&&s&&Gm(s)&&(e.data.caseID=n)})(r),fd.publish(Fs.PUB_SUB_EVENTS.EVENT_PREVIEW_DISMISS,{pageName:l,pageClass:c}),fd.publish(Fs.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_INIT,{pageName:l,pageClass:c});const h=rS.getIn(r,js.COMPONENTS);h&&await Ig(h),Jp(r,s.options.actionConfig,!0),fd.publish(Fs.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_DONE,{target:a,pageName:l,pageClass:c});let f=aI(r,jO);return f=((e,t,n)=>{if(e===eI.CASE||e===eI.OBJECT||e===eI.ASSIGNMENT){if(t?.caseInfo?.assignments&&t?.caseInfo?.assignments.length>0){const{key:e,flowName:s}=cI(t.caseInfo.assignments[0].ID);n.key=e||t.caseInfo.ID,n.flowName=s}else n.flowName="",n.key=t?.caseInfo?.ID||t?.objectInfo?.ID||t.semanticURL;n.resourceType=e,n.semanticURL=t.semanticURL,e===eI.ASSIGNMENT?(n.caseViewMode=js.PERFORM_MODE,n.resourceType=eI.CASE):n.caseViewMode=js.REVIEW_MODE}else n.resourceType=e,n.semanticURL=t.semanticURL;return n})(_I(e.payload.routeKey),{...n.data,semanticURL:g,caseViewMode:js.REVIEW_MODE},f),f.data.traditionalGadgetId=YI.getUniqueGadgetId(),MO.push(dI(a,f)),FO=r,((e,t)=>{let n=Ng.getComponentCache("assignments-launchAssignment-Error")||{};n&&"object"==typeof n&&Object.keys(n).length>0&&(n={...n,context:e},t.push($S(MS,n)),Ng.resetComponentCache("assignments-launchAssignment-Error"))})(o,MO),MO})),Xg((()=>(UO||BC(MO),FO&&jO&&Km(FO,jO),MO=[],LO=!1,UO=!1,jO=null,FO=null,MO))),ph("Error occurred"))],BO=[e=>{let t=0;return e.pipe(lh(la),Xg((e=>(({actionMgrID:t}=e.payload),e.payload))),Xg((()=>{const e=kC()?.getState(),n=VT();return Xt(e,n)&&t>0?Dg.resolveActionByID(t,{}):Dg.rejectActionByID(t),[]})),AO())}],$O=[e=>{let t=0,n=[];return e.pipe(lh(rr),Xg((e=>(({actionMgrID:t}=e.payload),e.payload))),Zg((e=>{const{context:t,skipSemanticUrl:n=!1,insightID:s}=e;let r,a="";n||(a=a_(qr,{insightID:"{insightID}"}),a=a.replace("{insightID}",s),r=TA.getEndPointInfo(a));const{restApi:o,reqType:i}=i_(qr,{...r?.payload||[],insightID:s});return Mu(Wd(o,{method:i},t)).pipe(Xg((t=>{let s={};return s="string"==typeof t.data?JSON.parse(t.data):t.data,{response:{...s,key:a,semanticURL:a},actionConfig:e,skipSemanticUrl:n}})),ph(": Error occurred during ajax call at showPage Epic : ",e.context))})),Zg((async e=>{if(e&&e.type===Tr)return n.push(uI(e)),n;const{actionConfig:t,skipSemanticUrl:s}=e,r=Og.getTargetViewContainerName(nr),a=Va(r,t.context),o=gI(a,r,t.context),{response:i}=e,c=am(i);c.directUrlUpdation=!s;const l={acName:a,context:o},u=!s,d=s;await oI(c,t,l,u,d);const p=aI(c,{target:a,context:o,containerItemID:o});p.resourceType=Fs.PAGE;const g=dI(a,p);return n.push(g),n})),Xg((()=>{Dg.resolveActionByID(t),BC(n),n=[]})),AO())}],GO=[e=>{let t=0,n=[];return e.pipe(lh(ar),Xg((e=>(({actionMgrID:t}=e.payload),e.payload))),Zg((e=>{const{context:t,skipSemanticUrl:n=!1,dashboardID:s}=e;let r="";n||(r=a_(zr,{dashboardID:s}),r=r.replace("{dashboardID}",s));const{restApi:a,reqType:o}=i_(zr,{dashboardID:s});return Mu(Wd(a,{method:o},t)).pipe(Xg((t=>{let s={};return s="string"==typeof t.data?JSON.parse(t.data):t.data,{response:{...s,key:r,semanticURL:r},actionConfig:e,skipSemanticUrl:n}})),ph(": Error occurred during ajax call at showPage Epic : ",e.context))})),Zg((async e=>{if(e&&e.type===Tr)return n.push(uI(e)),n;const{actionConfig:t,skipSemanticUrl:s}=e,r=Og.getTargetViewContainerName(nr),a=Va(r,t.context),o=gI(a,r,t.context),{response:i}=e,c=am(i);c.directUrlUpdation=!s;const l={acName:a,context:o},u=!s,d=s;await oI(c,t,l,u,d);const p=aI(c,{target:a,context:o,containerItemID:o});p.resourceType=Fs.PAGE;const g=dI(a,p);return n.push(g)})),Xg((()=>{Dg.resolveActionByID(t),BC(n),n=[]})),AO())}],WO=(e,t)=>{const{class:n,context:s,viewType:r=tI.PAGE}=e,{removeActionPayload:a}=t,o=e?.pageName?e?.pageName:PA.getDefaultCasePage();return Mu(Zp.createCase(n,{...e,pageName:o,viewType:r,context:s})).pipe(Xg((({response:t,headers:n})=>(Us.analyseResponse(t),{response:t,actionInPayload:e,headers:n,removeActionPayload:a}))),ph("Error occurred during ajax call at createObject Epic : ",s))},HO="CREATE_OBJECT",qO=e=>{let t,n=0,s=[],r={};let a=!1;return e.pipe(lh(HO),gh(100),Jg((e=>{if(({actionMgrID:n}=e.payload),YI.isExternalObject(e.payload.class)&&!GI(e.payload.context)){const e={type:Fs.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return Dg.rejectActionByID(n,!0,e),nh([])}return nh(e.payload).pipe(Zg((e=>{const{context:s}=e;t=e.class;const r=PD(e),o=Va(r,s);return a=!1,Mu(sD(o,{loadingContext:s})).pipe(Zg((({continueExecution:t,removeActionPayload:s,dirtyCheckPerformed:r})=>t?(a=r,WO(e,{removeActionPayload:s})):(Dg.rejectActionByID(n),uh))))})),Zg((async e=>{if(e&&e.type===Tr)return e.payload.context=((e,t)=>YI.isExternalObject(e)&&t?t:gA())(t,e.payload.context),s.push(uI(e)),s;const{actionInPayload:o,response:i,headers:c,removeActionPayload:l}=e,u=vD(o,i);rS.setIn(i.data,js.getProperty(js.CASE_INFO.IS_FIRST_ASSIGNMENT),!0);const d=PD({...o,isInCreateStage:u}),p=Va(d,o.context),g=gI(p,d,o.context);if(((e,t)=>{YI.isExternalObject(e.class)&&(e.containerItemID=e.context,pD(t,e))})(o,s),!a&&((e,t,n)=>!Pm(e)&&By(t)&&!YI.isExternalObject(n))(d,p,t)){const{continueExecution:e}=await mI(p,{loadingContext:o.context});if(!e)return Dg.rejectActionByID(n),s}if(((e,t)=>!e&&!t)(o?.openCaseViewAfterCreate??!0,u)){const{businessID:e,caseType:t,resolvedURL:n}=Fg(i);return r={id:e,label:t,href:n},oD(r),iD({caseId:e,caseType:t}),s}(e=>{YI.isExternalObject(e.class)&&oD({content:xA().getLocaleValue("Successfully submitted!","Assignment")})})(o);const h=am(i),f=String(xm(wg(h)));let m=a_(Ma,{caseClassName:xg(h)});m=m.replace(/{.+?}/,f),h.semanticURL=m,Ng.setComponentCache(f,wd.addDebugHeaders(o.debugInfo)),RD(h,o);const I={acName:p,context:g};await oI(h,o,I);const E={target:p,context:g,headers:c,semanticURL:m,caseViewMode:bD(h),containerItemID:g,isInCreateStage:u,isMinimizable:u,assignmentContext:rS.getIn(h,tD),nextAssignmentInfo:rS.getIn(h,eD),resourceType:Fs.RESOURCE_TYPES.OBJECT,openCaseViewAfterCreate:o.openCaseViewAfterCreate,modalOptions:o.modalOptions,debugInfo:o.debugInfo};Mg(E,h);const y=aI(h,E),A=dI(p,y);return((e,t,n)=>{if(hI(e)){const{removeActionPayload:e,target:s}=t;Fm(n,{removeActionPayload:e,target:s})}})(A,{removeActionPayload:l,target:p},s),s.push(A),s})),Xg((()=>(TI(s),$m(s,n),setTimeout((()=>(e=>{YI.isExternalObject(e)&&Us.setNeedsMapping(!1)})(t))),r={},s=[],s))))})))},zO=(e,t)=>{const{assignmentID:n,actionID:s,caseID:r,context:a,additionalHeaders:o={},jsActionQueryParams:i}=e,{state$:c}=t,l=tI.PAGE,u="executeObjectWideAction",d={assignmentID:n,actionID:s,viewType:l,objectID:r};let{restApi:p}=i_(u,d);const{reqType:g}=i_(u,d);l&&!p?.includes("viewType=")&&(p=p?.includes("?")?`${p}&viewType=${l}`:`${p}?viewType=${l}`),p=oE(i,p),e.viewType=l;const{content:h}=rI(a,{isObjectWideAction:!0}),f=c.value.data[a]?.objectInfo?.headers||{},{etag:m}=f,I={"if-match":m,...o};return Mu(Wd(p,{method:g,body:h,headers:I},a)).pipe(Xg((t=>{const{data:n,headers:s}=t;return Us.analyseResponse(t.data),{actionInPayload:e,response:n,headers:sI({...I,...s})}})),ph("Error occurred during ajax call at executeObjectWideAction Epic : ",a))},YO=(e,t)=>{const{isCaseWideAction:n}=t;return{isCaseWideAction:n,caseID:wg(e)}},{RESOURCE_TYPES:KO}=Fs,QO=(e,t)=>{let n=0,s=[],r={},a="";return e.pipe(lh(va),Jg((e=>{if(({actionMgrID:n}=e.payload),a=e.payload.context,od({context:a,stateObj:$C(a),clearContextMessages:!0}),!GI(a)){const t={type:Fs.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return Dg.rejectActionByID(n,!0,t),xf.handleDeferredActionCompletion(e.payload.context),nh([])}return nh(e.payload).pipe(Zg((e=>{dD(s,e);const n={...e};return zO(n,{state$:t})})),Zg((async e=>{if(e?.type===Tr){const t=uI(e);return s.push(t),s}yf.clearContextedCache(a);const{headers:t,actionInPayload:o,response:i}=e,{containerItemID:c,isModalAction:l,isInCreateStage:u}=o,d=Qy(c);o.target=d,rS.setIn(i.data,js.OBJECT_INFO_IS_LOCAL_ACTION,!1),ZD({submitResponse:i});let p=am(i,{[Fs.STOPMERGEACTIONS]:!i.nextAssignmentInfo});const g=xg(p),h=Ws(o.context),f=jy(h)[0]?xy(jy(h)[0]):h,m=(e=>{const t=Lg(e);return QI(t)&&JI(PA.getOperatorIdentifier(),t)})(p),I=u&&!m;!l||u||ID(o.context,f)||(p=CI(p,$C(c)));const E=aI(p,{headers:t,actionMgrID:n,directUrlUpdation:!1});((e,t)=>{const{attachmentsExist:n}=t;n&&rS.setIn(e,Fs.SUMMARY_OF_ATTACHMENTS_LAST_REFRESH_TIME,(new Date).toLocaleString()),rS.setIn(e,Fs.SUMMARY_OF_ASSIGNMENT_LAST_SUBMIT_TIME,(new Date).toLocaleString())})(E.data,o),E.caseClassName=g,E.resourceType=KO.ASSIGNMENT,E.headers=t;const y=wg(p);Mg(E,p);const A=a_(Ma,{caseClassName:g}).replace(/{.+?}/,String(xm(y)));p.semanticURL=A,E.semanticURL=A,await _D(o,E,!1,y,p,s,e,i,!0),I&&(r=ED(o),iD({caseId:o.caseID,caseType:o.caseTypeID,assignmentId:o.assignmentID})),((e,t)=>{const n=xg(e?.response),s=Lg(e?.response),{caseTypeID:r}=s,a=PA.getFeatureMap();(a?.deferUpdateCaseSummaryView??!Object.hasOwn(a,js.DEFER_UPDATE_CASESUMMARY_VIEW))&&r&&IC(js.CASESUMMARY_VIEW_NAME,r)&&Hm(t,e?.actionInPayload,e?.response,{caseClassName:n})})(e,s),xf.handleDeferredActionCompletion(a),ND(E,o,f);const C=YO(p,o);return Pf({...C,containerItemID:c}),fD(s,{transientItemID:c,target:d,isModalAction:l}),s})),Xg((()=>{const e=s.find((e=>e.type===Tr));return e?(xf.handleDeferredActionCompletion(a),TD(e),Dg.rejectActionByID(n)):Dg.resolveActionByID(n,r),TI(s),Us.setNeedsMapping(!1),s=[],r={},s})))})))},JO=(e,t)=>{const{insKey:n,headers:s,context:r,debugInfo:a,viewType:o}=e,{removeActionPayload:i}=t,c=e.pageName?e.pageName:js.VIEW_NAMES.PY_DETAILS,l=i_(La,{objectID:n,params:{pageName:c}});let{restApi:u}=l;const{reqType:d}=l;return"none"===o&&(u=`${u?.split("viewType")[0]}viewType=none`),Mu(Wd(u,{method:d,headers:{...s,...a&&{...wd.addDebugHeaders(a)}}},r)).pipe(Xg((t=>(Us.analyseResponse(t.data),{response:t.data,actionInPayload:e,headers:sI({...s,...t.headers}),removeActionPayload:i}))),ph("Error occurred during ajax call at getObject Epic : ",r))},XO="GET_OBJECT",{RESOURCE_TYPES:ZO}=Fs,eR=async(e,t)=>{const{actionInPayload:n,activateContainerActionPayload:s,type:r,response:a,removeActionPayload:o,headers:i}=e,{context:c,skipBrowserSemanticUrlUpdate:l,debugInfo:u}=n,d=Nm(La,n),p=Va(d,c);if(Om(r))await(async(e,t)=>{const{activateContainerActionPayload:{semanticURL:n,containerItemID:s},actionInPayload:r,actionInPayload:{context:a,skipBrowserSemanticUrlUpdate:o,doDeleteCaseSummary:i}}=t,c=Nm(La,r),l=Va(c,a),u=Ly(s);await oI({directUrlUpdation:!o,semanticURL:n},r,{acName:l,containerName:c,target:l,context:u}),e.push($S(wS,{containerItemID:s,target:l,context:u,doDeleteCaseSummary:i}))})(t,{activateContainerActionPayload:s,actionInPayload:n});else{const e=gI(p,d,c,{buildNew:!0}),s=am(a),r=(e=>{const t=wg(e),n=xg(e);let s=a_(La,{objectClassName:n});return s=s?.replace("{objectID}",String(xm(t))),s})(s);s.semanticURL=r,s.directUrlUpdation=!l;const g={acName:p,context:e};await oI(s,n,g);const h=aI(s,{target:p,context:e,containerItemID:e,semanticURL:r,headers:i,debugInfo:u});h.caseViewMode=js.REVIEW_MODE,h.resourceType=ZO.OBJECT,Mg(h,s);const f=dI(p,h);o.containerItemID&&hI(f)&&t.push($S(LS,{containerItemID:o.containerItemID,target:p})),t.push(f)}const g=n.insKey;Of({caseKey:g,actionInContext:c})},tR="OPEN_OBJECT_ACTION",nR=e=>{const{actionID:t,caseID:n,context:s,openActionType:r,modalLoadingContainer:a}=e,o=tI.FORM,i=i_(Ua,{objectID:n,actionID:t,viewType:o}),{reqType:c}=i;let{restApi:l}=i;e.actionType=js.RESOURCE_TYPES.OBJECT,l&&!l.includes("viewType=")&&(l=l.includes("?")?`${l}&viewType=${o}`:`${l}?viewType=${o}`);const u=a?.context??s;return Mu(Wd(l,{method:c,headers:{}},u)).pipe(Xg((t=>(Us.analyseResponse(t.data),{response:t.data,actionInPayload:e,headers:sI(t.headers)}))),ph(`: Error occurred during ajax call at ${r} Epic : `,u))},sR=async(e,t,{headers:n,actionInPayload:s})=>{const{context:r,actionName:a,openActionType:o,doDeleteCaseSummary:i,modalLoadingContainer:c}=s,l=am(e,{info:Fs.OBJECT_INFO.OBJECT_INFO}),u=Nm(o,s),d=c?.target??Va(u,r),{context:p,containerItemID:g,isNewContainerItem:h}=((e,t,n,s)=>{let r,a,o=!1;const i=$y(e);return!Gy(e)||i&&!Ty(e,s)?(a=Hs(t,n),Pm(t)&&(a=Ks(n,a)),r=a,o=!0):(r=i?Py(e,s):xy(e),a=Ly(r)),{context:a,containerItemID:r,isNewContainerItem:o}})(d,u,r,e.data.objectInfo.ID),f={acName:d,target:d,containerName:u,context:p};await oI(l,s,f);const m=l.uiResources?.root,I=(e=>e?js.PERFORM_MODE:js.REVIEW_MODE)(m),E=aI(l,{target:d,context:p,containerItemID:g,caseViewMode:I,doDeleteCaseSummary:i,headers:n,actionName:a,isMinimizable:!1,isInCreateStage:Pm(u),resourceType:Fs.RESOURCE_TYPES.OBJECT,isProcessAction:s.isProcessAction,showProgress:s.showProgress,progressMessage:s.progressMessage,actionType:s.actionType});if(m&&Mg(E,l),Pm(u)&&delete E.doDeleteCaseSummary,t.push($S((e=>e?_S:RS)(h),E)),h||t.push($S(vS,E)),h){const r=jy(s.contextName),a=Py(r,e.data.objectInfo.ID);if(a){const e={data:{objectInfo:{headers:n}},context:a};t.push($S(fS,e))}}return g!==xy(d)&&t.push($S(wS,{target:d,containerItemID:g})),Ug(g)&&!c?.context&&NI(E,t),t},rR=e=>{e.openActionType=Ua;if(Nm(e.openActionType,e)===js.MODAL){const t=Nm(e.openActionType,e),n=Va(t,e.context),s=Ks(e.context,Hs(t,e.context));return BC(_S({target:n,context:s,containerItemID:s,key:e.caseID,caseViewMode:js.PERFORM_MODE,actionName:e.name,showProgress:!0,root:{type:"reference",config:{context:js.getProperty(js.CASE_INFO.CASE_INFO_CONTENT),type:"view"}},data:{key:e.caseID,objectInfo:{ID:e.caseID}}})),BC(bS({context:s})),e.modalLoadingContainer={target:n,context:s},nR(e)}return nR(e)},aR=e=>{const{containerName:t,isInCreateStage:n}=e;return n?js.MODAL:t||Og.getTargetViewContainerName(Fa)},oR=(e,t)=>{const{class:n,context:s,viewType:r=tI.PAGE}=e,{removeActionPayload:a}=t,o=e?.pageName?e?.pageName:PA.getDefaultCasePage();return Mu(Zp.createCase(n,{...e,pageName:o,viewType:r,context:s,retrieveActionViewForNewObject:!0})).pipe(Xg((({response:t,headers:n})=>(Us.analyseResponse(t),{response:t,actionInPayload:e,headers:n,removeActionPayload:a}))),ph("Error occurred during ajax call at createObject Epic : ",s))},iR="CREATE_EXTERNAL_OBJECT",cR=e=>{const{workId:t,context:n,isExternalCase:s}=e,r=s?Zr:"deleteWork",{restApi:a,reqType:o}=i_(r,{ID:t});return Mu(Wd(a,{method:o},n)).pipe(Xg((t=>({response:t.data,actionInPayload:e,headers:sI(t.headers)}))),ph("Error occurred during ajax call at deleteWork Epic : ",n))},lR=e=>{fd.publish(js.PUB_SUB_EVENTS.WORK_EVENTS.WORK_DELETED,e)},uR=((...e)=>(t,n)=>new fu((s=>{const r=e.map((e=>e(t,n).subscribe(s)));return()=>{r.forEach((e=>e.unsubscribe()))}})))(...QT,...yO,...NO,...kO,...RO,...JT,...BO,...$O,...GO,...[qO,e=>{let t=0,n=[];return e.pipe(lh(XO),Xg((e=>(({actionMgrID:t}=e.payload),e.payload))),Zg((e=>{const{context:n,isChild:s,viewType:r}=e,a=Nm(La,e),o=Va(a,n);return Mu("none"!==r?mI(o,{loadingContext:n}):Promise.resolve({continueExecution:!0,removeActionPayload:void 0})).pipe(Zg((({continueExecution:n,removeActionPayload:a})=>{if(!n)return Dg.rejectActionByID(t),uh;const{activate:i,activateContainerActionPayload:c}=EI(ZO.OBJECT,o,e);return i&&!s&&"none"!==r?nh({type:Fr,activateContainerActionPayload:c,actionInPayload:e}):JO(e,{removeActionPayload:a})})))})),Zg((async e=>{if(e&&Rm(e.type))return n.push(uI(e)),n;if("none"===e?.actionInPayload?.viewType){const t=$C(e?.actionInPayload?.context);if(t?.context_data?.caseViewMode!==js.PERFORM_MODE){const t=am(e?.response),s={data:{...t?.data},context:e?.actionInPayload?.context,isArrayDeepMerge:!0};n.push({type:ha,payload:{context:s.context,doDeleteConfirmationDetails:!1}}),n.push($S(fS,s));const r=Qy(e?.actionInPayload?.context),a=Tm(e?.actionInPayload?.context),o=Object.freeze({target:r,containerItemID:e?.actionInPayload?.context,context:e?.actionInPayload?.context,containerName:a});if(Ug(e?.actionInPayload?.context)){const t=aI(e?.response,{...o});NI({...t,isArrayDeepMerge:!0},n)}}}else await eR(e,n);return n})),Xg((()=>(BC(n),$m(n,t),n=[],n))))},QO,e=>{let t=0,n=[];return e.pipe(lh(tR),Xg((e=>(({actionMgrID:t}=e.payload),e.payload))),Zg((e=>rR(e))),Zg((async e=>{if(Rm(e.type)){const t=uI(e);n.push(t);const s=$C(e.payload.context);return s?.context_data?.isLoading&&n.push($S(vS,e.payload)),n}const{actionInPayload:t,headers:s,response:r}=e,{actionID:a}=t;return rS.setIn(r,"data.objectInfo.activeActionID",a),rS.setIn(r.data,js.getProperty(js.OBJECT_INFO_IS_LOCAL_ACTION),!0),t.refreshConditions&&rS.setIn(r.data,js.getProperty(js.CASE_INFO_REFRESH_CONDITIONS),t.refreshConditions),await sR(r,n,{headers:s,actionInPayload:t}),yP(t),n})),Xg((()=>(BC(n),$m(n,t),n=[],n))))},e=>{let t=0,n=[],s=!1;return e.pipe(lh(iR),gh(100),Xg((e=>(({actionMgrID:t}=e.payload),e.payload))),Zg((e=>{const{context:n}=e,r=aR(e),a=Va(r,n);return s=!1,Mu(sD(a,{loadingContext:n})).pipe(Zg((({continueExecution:n,removeActionPayload:r,dirtyCheckPerformed:a})=>n?(s=a,oR(e,{removeActionPayload:r})):(Dg.rejectActionByID(t),uh))))})),Zg((async e=>{if(e&&e.type===Tr)return e.payload.context=gA(),n.push(uI(e)),n;const{actionInPayload:r,response:a,headers:o,removeActionPayload:i}=e,c=vD(r,a);rS.setIn(a.data,js.getProperty(js.CASE_INFO.IS_FIRST_ASSIGNMENT),!0);const l=aR({...r,isInCreateStage:c}),u=Va(l,r.context),d=gI(u,l,r.context);if(!s&&!Pm(l)&&By(u)){const{continueExecution:e}=await mI(u,{loadingContext:r.context});if(!e)return Dg.rejectActionByID(t),n}const p=am(a);let g=a_(Fa,{caseClassName:xg(p)});g=g.replace(/{.+?}/,String(xm(wg(p)))),p.semanticURL=g,RD(p,r);const h={acName:u,context:d};await oI(p,r,h);const f={target:u,context:d,headers:o,semanticURL:g,caseViewMode:bD(p),containerItemID:d,isInCreateStage:c,isMinimizable:c,assignmentContext:rS.getIn(p,tD),nextAssignmentInfo:rS.getIn(p,eD),resourceType:Fs.RESOURCE_TYPES.OBJECT,openCaseViewAfterCreate:r.openCaseViewAfterCreate,modalOptions:r.modalOptions,debugInfo:r.debugInfo,isExternalObjectCreationFlow:!0};Mg(f,p);const m=aI(p,f),I=dI(u,m);return hI(I)&&Fm(n,{removeActionPayload:i,target:u}),n.push(I),n})),Xg((()=>(TI(n),$m(n,t),n=[],n))))},e=>{let t,n=0,s=[];return e.pipe(lh(Wg),Xg((e=>(({actionMgrID:n,caseTypeID:t}=e.payload),e.payload))),Zg((e=>{if(!e.skipDeleteConfirmation&&!e.ignoreWorkDeletion){const s=my.MODAL,r=Va(s,e.context),a=Ks(e.context,Hs(s,e.context));return BC([$S(_S,{target:r,context:a,containerItemID:a,containerName:s,isDeleteConfirmation:!0,actionName:"Delete",workId:e.workId,caseTypeID:t,className:e.className,keys:e.keys,...e.enableBackNavigation&&{enableBackNavigation:!0},data:{caseInfo:{caseTypeID:t}}})]),Dg.resolveActionByID(n),uh}return e.ignoreWorkDeletion?nh({actionInPayload:e}):cR(e)})),Zg((async e=>{if(e&&Rm(e.type)){const{payload:t}=e;return s.push(uI({...e,...t,actionMgrID:n})),s}const{actionInPayload:t}=e,{context:r}=t;if(oD({content:xA().getLocaleValue("Deleted successfully!","Messages")}),r?.includes(js.PREVIEW)&&s.push($S(SS,zy({context:js.APP.APP,name:js.PREVIEW}))),r?.includes(js.MODAL)){const e=my.MODAL,t=Va(e,r),n=Cy(t,r);n?.enableBackNavigation&&window?.history?.back()}return s})),Xg((()=>(BC(s),$m(s,n)===js.PROMISE_VALUE.RESOLVE&&lR({caseTypeID:t}),s=[],s))))}]),dR=()=>e=>t=>{const{type:n="",payload:s={}}=t||{},{category:r,context:a,transientItemID:o}=s;"HTTP"!==r&&[Or,jr,Rr,kr,vr,Ur].includes(n)&&(MI(a||o),Zu.removeContextTreeNode(a||o),n!==Or&&n!==Rr||-1===s?.target?.indexOf("modal")||fd.publish(Fs.PUB_SUB_EVENTS.PEGA_EMBED_CUSTOM,n)),e(t)},pR={},gR=e=>{const t=rS.getIn(pR,[js.CONTEXT,e],[]),n=[];t.forEach((t=>{const s=t.substr(0,t.lastIndexOf("_")),r=rS.getIn(pR,[s,t],[]),a=r&&r.length>0&&r.indexOf(e);if(a>-1&&r.splice(a,1),!r||r&&0===r.length){rS.deleteIn(pR,[s,t]);const e=rS.getIn(pR,[s]);e&&0===Object.keys(e).length&&rS.deleteIn(pR,[s]),n.push({dataPageName:s,dataPageNameWithHash:t})}})),rS.deleteIn(pR,[js.CONTEXT,e]);const s=rS.getIn(pR,[js.CONTEXT]);(!s||s&&0===Object.keys(s).length)&&rS.deleteIn(pR,[js.CONTEXT]),n.length>0&&BC(HS({dataPagesToBeRemoved:n}))},hR=(e={},t)=>{Object.keys(e).forEach((n=>{const s=rS.getIn(e,[n],{});Object.keys(s).forEach((e=>{((e,t,n)=>{const s=rS.getIn(pR,[js.CONTEXT,n]);if(rS.getIn(pR,[e])){const s=rS.getIn(pR,[e,t],[]);rS.setIn(pR,[e,t],[...new Set([...s,n])])}else rS.setIn(pR,[e,t],[n]);s?rS.setIn(pR,[js.CONTEXT,n],[...new Set([...s,t])]):rS.setIn(pR,[js.CONTEXT,n],[t])})(n,e,t)}))}))},fR=()=>e=>t=>{(Array.isArray(t)?t:[t]).forEach((e=>{const{payload:{data:t={},context:n=null,childContainersContexts:s=[]}={},type:r}=e;if(((e,t)=>{t&&t.length>0&&(e===kr||e===Rr)&&t.forEach((e=>{gR(e)}))})(r,s),r===Or||r===Cr||r===da){const e=r===da?t:t.shared;hR(e,n)}else r===kr?(gR(n),hR(t.shared,n)):r===Rr&&gR(n)})),e(t)},{PUB_SUB_EVENTS:mR}=Fs,IR=e=>t=>n=>{const{type:s,payload:{target:r,containerItemID:a,context:o,deleteContext:i,childContainersContexts:c=[],containerInfo:{newAccessedOrder:l,containerType:u}={newAccessedOrder:new Array,containerType:""},eventName:d}={}}=n;s===Rr&&((e,t,n,s,r,a)=>{const{resourceType:o,key:i,context:c}=rS.getIn(e.getState(),["containers",t,"items",n])||{},l={resourceType:o,key:i,context:c,containerItemID:n,...void 0!==s?{eventName:s}:{}};fd.publish(mR.CONTAINER_EVENTS.CLOSE_CONTAINER_ITEM,l),t===`${Fs.APP.APP}/${js.PRIMARY}`&&a===js.CONTAINER_TYPE.MULTIPLE&&fd.publish(mR.CONTAINER_EVENTS.CLOSE_MULTI_TYPE_PRIMARY_CONTAINER_ITEM,{key:i,newAccessedOrder:r})})(e,r,a,d,l,u),((e,t)=>{t&&t.length>0&&(e===kr||e===Rr)&&t.forEach((e=>{e&&Sf.cleanCaches(e)}))})(s,c),o&&(s===kr||s===Rr&&i)&&Sf.cleanCaches(o),t(n)},ER=e=>e===`${js.APP.APP}/${js.MODAL}`,yR=(e,t,n,s,r)=>{var a;e&&t&&(ER(r)?(a={caseId:e,caseClass:n,context:s||""},fd.publish(js.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_CASE_MODAL_OPEN,a)):(e=>{fd.publish(js.PUB_SUB_EVENTS.CASE_EVENTS.CASE_LOAD,e)})({caseId:e,caseClass:n,context:s||""}))},AR=(e,t)=>{var n;e&&(ER(t)?(n={caseId:e,caseClass:"",context:""},fd.publish(js.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_CASE_MODAL_CLOSE,n)):(e=>{fd.publish(js.PUB_SUB_EVENTS.CASE_EVENTS.CASE_UNLOAD,e)})({caseId:e}))},CR=()=>e=>t=>{if(t&&"object"==typeof t&&"type"in t&&"payload"in t){const{type:e,payload:n}=t,{target:s,key:r,context:a,data:o}=n||{};if((e=>e===`${js.APP.APP}/${js.PRIMARY}`)(s)||ER(s)){const t=o?.caseInfo?.ID,n=a||"",i=HC(js.CASE_INFO.CASE_INFO_ID,"",n)||"",c=o?.caseInfo?.caseTypeID||"";e!==kr&&e!==Rr||AR(i,s),e!==Or&&e!==kr||yR(r,!!t,c,n,s)}}e(t)},SR=()=>e=>t=>{const{payload:{context:n=null,transientItemID:s=null,clearStateMachine:r=!0}={},type:a}=t;n&&(a===Or||a===jr||a===kr||a===Rr)&&r&&(Ep(n),mp(n)),s&&a===Mr&&(Ep(s),mp(s)),e(t)},_R=e=>rS.getIn(e,js.CASE_INFO.ASSIGNMENT_ID),NR=e=>{Object.keys(sf.subscribers).forEach((t=>{"COACH_UPDATE"===sf.subscribers[t].filter.matcher&&sf.subscribers[t].filter.criteria?.caseId===e&&sf.unsubscribe(t)}))},TR=(e,t)=>{if(n=t.target,n?.toString().includes(js.MODAL))return;var n;const{context:s,data:r,resourceType:a,caseID:o}=t;e===Or?((e,t,n)=>{if(n===js.RESOURCE_TYPES.ASSIGNMENT){const n=_R(t),s=rS.getIn(t,["caseInfo","ID"]);n&&s&&bf({actionInContext:e,assignmentID:n,caseKey:s})}else if(n===js.RESOURCE_TYPES.CASE&&e?.includes("workarea")){const n=rS.getIn(t,["caseInfo","ID"]),s=_R(t);n&&s&&bf({actionInContext:e,assignmentID:s,caseKey:n})}})(s,r,a):e===jr?((e,t,n)=>{if(n!==js.RESOURCE_TYPES.ASSIGNMENT)return;const s=_R($C(e)),r=_R(t),a=rS.getIn(t,["caseInfo","ID"]);s&&s!==r&&vf({actionInContext:e,assignmentID:s,caseKey:a}),r&&a&&bf({actionInContext:e,assignmentID:r,caseKey:a})})(s,r,a):e===Rr&&o?((e,t)=>{if(e?.includes("workarea")){const n=_R($C(e));n&&vf({actionInContext:e,assignmentID:n,caseKey:t})}else NR(t)})(s,o):e===kr&&o&&((e,t,n,s)=>{if(e?.includes("workarea")){const t=_R($C(e));t&&vf({actionInContext:e,assignmentID:t,caseKey:s})}else NR(s);if(n===js.RESOURCE_TYPES.ASSIGNMENT){const n=_R(t);n&&bf({actionInContext:e,assignmentID:n,caseKey:s})}})(s,r,a,o)},DR=()=>e=>t=>{if(t&&"object"==typeof t&&"type"in t&&"payload"in t){const{type:e,payload:s}=t;"object"==typeof(n=s)&&null!==n&&TR(e,s)}var n;e(t)},PR=[hr,mr,Er,"DELETE_CASE_IN_CREATE_STAGE",yr,Ar],OR=new Set([Or,kr,jr,Rr,fr,_a,er,ga,...PR]),RR=(e,t)=>{if(!(e=>{const t=e?.data?.caseInfo?.settings?.autoSave;if(null!=t)return Boolean(t);const n=e?.containerItemID??e?.context;if(n){const e=HC("caseInfo.settings.autoSave",null,n);if(null!=e)return Boolean(e)}return!1})(t))return!1;const n=t.containerItemID||e,s=t.target||Qy(n),r=Cy(s,n),a=t.resourceType||r?.resourceType,o=t.key||r?.key;return a===js.RESOURCE_TYPES.ASSIGNMENT&&Boolean(o)},bR=(e,t,n)=>{e===Or||e===kr||e===jr&&t.data?(GE(n)&&WE(n),e===kr&&HE(n),RR(n,t)&&((e,t)=>{0===RE.size&&"undefined"!=typeof document&&(document.addEventListener("pointerdown",kE,{passive:!0}),document.addEventListener("keydown",BE,{passive:!0}),document.addEventListener("input",$E,{capture:!0,passive:!0})),RE.set(e,t)})(n,{containerName:t.containerName??""})):e===Rr&&(GE(n)&&WE(n),HE(n))},vR=(e,t)=>{if(e!==Rr||!t.includes(js.MODAL))return;const n=Qs(t),s=`${n}/`;for(const e of ME)(e===n||e.startsWith(s))&&YE(e)},xR=(e,t,n)=>{e!==fr?e!==_a?PR.includes(e)&&qE(n):(e=>{qE(e),ME.add(e)})(n):t.autosave||qE(n)},wR=()=>e=>t=>{if(t&&"object"==typeof t&&"type"in t&&"payload"in t&&"string"==typeof t.type&&OR.has(t.type)&&("object"==typeof(n=t.payload)&&null!==n)){const{type:e,payload:n}=t,s=((e,t)=>e===yr?t.saveActionPayload?.containerItemID:e===Ar?t.saveContainerItemID??t.context:t.containerItemID??t.context)(e,n);s&&(vR(e,s),bR(e,n,s),GE(s)&&(((e,t)=>{if(t.context)e===er?(Hp(t.context,null),zE(t.context)):e!==ga||t?.isDefault||t?.skipDirtyValidation||zE(t.context)})(e,n),xR(e,n,s)))}var n;e(t)},MR=(()=>{const e=new rh;let t=null,n=null;const s=s=>(n=s,t=new ch(e.asObservable(),s.getState()),n=>r=>{const a=n(r);var o;return t?.next(s.getState()),"object"==typeof(o=r)&&null!==o&&"type"in o&&"string"==typeof o.type&&e.next(r),a});return s.run=s=>{if(!t||!n)throw new Error("Epic middleware must be added to the store before calling run().");return s(e.asObservable(),t).subscribe((e=>{n?.dispatch(e)}))},s})(),LR=e=>{if(null!==kC())return void tS();const t=[py.propertyChangeMiddleware,dR,fR,SR,MR,DR,wR,CR,IR],n=tT({reducer:kT(e),middleware:e=>e({serializableCheck:!1,thunk:!1}).concat(t),enhancers:e=>e().prepend(oT).concat(oT)});MR.run(uR),VC(n)},UR=["ar","arc","ckb","dv","fa","ha","he","khw","ks","ps","ur","yi"],FR=e=>UR.includes(e.split("-")[0])?"rtl":"ltr";const jR=async function(e){if(!e)return;const t=PA.getLocale();PA.setLocale(e);const n=PA.getLocale();if(n&&n!==t){if(N_(["lang"]),"undefined"!=typeof window){const e=new URL(window.location.href);e.searchParams.set("lang",n),window.history.replaceState(window.history.state,"",e.toString())}PA.isInfinityRuntime()&&await DA.loadLocaleBundle([n]),await RA(n),"undefined"!=typeof document&&(document.documentElement.lang=n,document.documentElement.dir=FR(n)),BC({type:ma,payload:{locale:n}}),fd.publish(js.PUB_SUB_EVENTS.EVENT_LOCALE_CHANGED,{locale:n,previousLocale:t})}};class VR{static EDIT_OPEN="edit_open";static EDIT_CLOSE="edit_close";static VIEW_OPEN="view_open";static VIEW_CLOSE="view_close";static caseCollabSubIds={};static init(e){e&&(this.collabConfig=e)}static dispatchCollaboratorAction=(e,t,n,s,r)=>{BC({type:"LIST_ACTION",payload:{instruction:e,context:t,referenceList:s,listIndex:n,content:r,skipDirtyValidation:!0}})};static handleCaseCollaboratorsUpdate(e,t){const n=t?.message??{},[s,r]=Object.entries(n)[0];if(s===PA.getOperatorIdentifier())return;const a={ID:s,state:r},o=HC(js.CASE_INFO.CASE_INFO_COLLABORATORS,"",e)||[],i=o.findIndex((e=>e.ID===s));if(-1!==i)"closed"===r?this.dispatchCollaboratorAction("DELETE",e,i,js.CASE_INFO.CASE_INFO_COLLABORATORS,null):this.dispatchCollaboratorAction("REPLACE",e,null,`${js.CASE_INFO.CASE_INFO_COLLABORATORS}[${i}]`,a);else{if("closed"===r)return;this.dispatchCollaboratorAction("INSERT",e,o.length,js.CASE_INFO.CASE_INFO_COLLABORATORS,a)}}static subscribeToCollaborators(e,t){const n=sf.subscribe({matcher:"CASE_COLLABORATOR",criteria:{caseId:e}},(e=>this.handleCaseCollaboratorsUpdate(t,e)));this.caseCollabSubIds[e]=n}static unsubscribeToCollaborators(e){sf.unsubscribe(this.caseCollabSubIds[e]),delete this.caseCollabSubIds[e]}static publishCaseEvent(e,t){sf.publishMessage({filter:{matcher:"CASE_COLLABORATOR",criteria:{caseId:t}},message:e})}static subscribeToEvent(e,t,n){let s=null;if(e===js.PUB_SUB_EVENTS.CASE_EVENTS.CASE_EDIT_OPEN||e===js.PUB_SUB_EVENTS.CASE_EVENTS.CASE_EDIT_CLOSE?s=e=>this.publishCaseEvent(t,e):e===js.PUB_SUB_EVENTS.CASE_EVENTS.CASE_LOAD?s=e=>{const{caseId:t,context:n}=e;this.caseCollabSubIds[t]||this.subscribeToCollaborators(t,n)}:e===js.PUB_SUB_EVENTS.CASE_EVENTS.CASE_UNLOAD&&(s=e=>{const{caseId:t}=e;this.caseCollabSubIds[t]&&this.unsubscribeToCollaborators(t)}),!s)throw new Error(`Unhandled eventKey: ${e}`);fd.subscribe(e,s,n)}static unsubscribeFromEvent(e,t){fd.unsubscribe(e,t)}static subscribeToCaseEvents(){VR.collabConfig?.appEnabled&&VR.collabConfig?.portalEnabled&&(this.subscribeToEvent(js.PUB_SUB_EVENTS.CASE_EVENTS.CASE_LOAD,this.VIEW_OPEN,"case_view_open"),this.subscribeToEvent(js.PUB_SUB_EVENTS.CASE_EVENTS.CASE_UNLOAD,this.VIEW_CLOSE,"case_view_close"),this.subscribeToEvent(js.PUB_SUB_EVENTS.CASE_EVENTS.CASE_EDIT_OPEN,this.EDIT_OPEN,"case_edit_open"),this.subscribeToEvent(js.PUB_SUB_EVENTS.CASE_EVENTS.CASE_EDIT_CLOSE,this.EDIT_CLOSE,"case_edit_close"))}static unsubscribeToCaseEvents(){VR.collabConfig?.appEnabled&&VR.collabConfig?.portalEnabled&&(this.unsubscribeFromEvent(js.PUB_SUB_EVENTS.CASE_EVENTS.CASE_LOAD,"case_view_open"),this.unsubscribeFromEvent(js.PUB_SUB_EVENTS.CASE_EVENTS.CASE_UNLOAD,"case_view_close"),this.unsubscribeFromEvent(js.PUB_SUB_EVENTS.CASE_EVENTS.CASE_EDIT_OPEN,"case_edit_open"),this.unsubscribeFromEvent(js.PUB_SUB_EVENTS.CASE_EVENTS.CASE_EDIT_CLOSE,"case_edit_close"))}}const kR=VR;const BR=new class{#S(e,t,n,s,r){let a=!1;return e.IncludeInURL&&void 0!==t&&(s[e.Key]=t,"portal"===e.Key&&t!==n&&(a=!0)),Array.isArray(e.IncludeInHeaders)&&void 0!==t&&e.IncludeInHeaders.forEach((n=>{r[n.Value]||(r[n.Value]=[]),r[n.Value].push(`${e.Key}=${t}`)})),a}#_(e,t,n){const s={},r={};let a=!1;return Array.isArray(e)&&e.forEach((e=>{const o=t[e.Key];this.#S(e,o,n,s,r)&&(a=!0)})),{urlParams:s,headerMap:r,isPortalChanged:a}}#N(e){const t=Ng.getComponentCache("lastActionID");return Jh.truncateNamespace(e)===Jh.truncateNamespace("string"==typeof t?t:(t??"").toString())}#T({message:e}){const{RequestContext:t,ActionName:n}=e;if(!this.#N(n))return;const s=JSON.parse(t),r=PA.environmentInfoObject?.requestContext,a=new URL(window.location.href).searchParams.get("portal"),{urlParams:o,headerMap:i,isPortalChanged:c}=this.#_(r,s,a);Ng.setURLParams(o),Object.entries(i).forEach((([e,t])=>{wd.registerHeader(e,t.join("; "))})),Ng.setComponentCache("lastActionID",""),c&&globalThis.location.reload()}subscribeToGlobalEvents(){const e=rS.generateUniqueID(),t={matcher:"SWITCH_REQUEST_CONTEXT",criteria:{UserID:PA.getOperatorIdentifier()||""}};sf.subscribe(t,this.#T.bind(this),void 0,e)}},$R={publishConstellationLoadedEvent:()=>{fd.publish(js.PUB_SUB_EVENTS.BOOTSTRAP_SHELL_EVENTS.CONSTELLATION_LOADED,{})}};const GR=new class{activateContainerItemOnSwitch(e){const t=`${js.APP.APP}/${js.PRIMARY}`,n={target:t,containerItemID:Py(t,e)};Cm({}).getPConnect().getContainerManager().activateContainerItem(n)}removeContainerItemOnClose(e){const t=`${js.APP.APP}/${js.PRIMARY}`,n={target:t,containerItemID:Py(t,e)};Cm({}).getPConnect().getContainerManager().removeContainerItem(n)}showCasePreview(e,t){const n=Cm({meta:{type:"PreviewViewContainer",config:{name:js.PREVIEW}},options:{context:js.APP.APP,target:"root/hybrid_preview"}});n.getPConnect().getContainerManager().resetContainers({name:js.PRIMARY,context:js.APP.APP}),by(js.APP.APP,js.PREVIEW)||n.getPConnect().getContainerManager().initializeContainers({type:"multiple",name:js.PREVIEW}),n.getPConnect().getActionsApi().showCasePreview(e,{caseClassName:t})}closeCasePreview(){Cm({}).getPConnect().getContainerManager().resetContainers({name:js.PREVIEW,context:js.APP.APP})}isFormDirty(e){const t=`${js.APP.APP}/${js.PRIMARY}`,n=mA(t,e);return bI.isStateModified(n)}getEventUtils(){return $R}getBroadcastUtils(){return ZT}isTraditionalUICase(e){return Gm(e)}};const WR=class{static openCase(e,t=Fs.APP.APP,n={}){return n.renderInline=!0,n.pageName?(PA.setDefaultCasePage(Ls.getDefaultQualifiedName(n.pageName)),n.pageName=Ls.getDefaultQualifiedName(n.pageName)):(PA.setDefaultCasePage(Ls.getDefaultQualifiedName(js.PY_DETAILS)),n.pageName=Ls.getDefaultQualifiedName(js.PY_DETAILS)),n?.disableAssignmentHeader?PA.disableAssignmentHeader(n.disableAssignmentHeader):PA.disableAssignmentHeader(!1),Kh.openCase(e,t,js.PRIMARY,n)}static createCase(e,t=Fs.APP.APP,n={}){return n.renderInline=!0,n.pageName?(PA.setDefaultCasePage(Ls.getDefaultQualifiedName(n.pageName)),n.pageName=Ls.getDefaultQualifiedName(n.pageName)):(PA.setDefaultCasePage(Ls.getDefaultQualifiedName(js.PY_DETAILS)),n.pageName=Ls.getDefaultQualifiedName(js.PY_DETAILS)),n?.disableAssignmentHeader?PA.disableAssignmentHeader(n.disableAssignmentHeader):PA.disableAssignmentHeader(!1),Kh.createCase(e,t,js.PRIMARY,n)}static getNextWork(e=Fs.APP.APP,t={}){return t.renderInline=!0,t.pageName?(PA.setDefaultCasePage(Ls.getDefaultQualifiedName(t.pageName)),t.pageName=Ls.getDefaultQualifiedName(t.pageName)):(PA.setDefaultCasePage(Ls.getDefaultQualifiedName(js.PY_DETAILS)),t.pageName=Ls.getDefaultQualifiedName(js.PY_DETAILS)),t?.disableAssignmentHeader?PA.disableAssignmentHeader(t.disableAssignmentHeader):PA.disableAssignmentHeader(!1),Kh.getNextWork(e,js.PRIMARY,t)}static openAssignment(e,t=Fs.APP.APP,n={}){return n.renderInline=!0,n.pageName?(PA.setDefaultCasePage(Ls.getDefaultQualifiedName(n.pageName)),n.pageName=Ls.getDefaultQualifiedName(n.pageName)):(PA.setDefaultCasePage(Ls.getDefaultQualifiedName(js.PY_DETAILS)),n.pageName=Ls.getDefaultQualifiedName(js.PY_DETAILS)),n?.disableAssignmentHeader?PA.disableAssignmentHeader(n.disableAssignmentHeader):PA.disableAssignmentHeader(!1),Kh.openAssignment(e,t,js.PRIMARY,n)}static openPage(e,t,n=Fs.APP.APP,s={}){const r=nr;s?.defaultCasePage?(PA.setDefaultCasePage(Ls.getDefaultQualifiedName(s.defaultCasePage)),s.defaultCasePage=Ls.getDefaultQualifiedName(s.defaultCasePage)):PA.setDefaultCasePage(Ls.getDefaultQualifiedName(js.PY_DETAILS)),s?.disableAssignmentHeader?PA.disableAssignmentHeader(s.disableAssignmentHeader):PA.disableAssignmentHeader(!1);const a={viewName:e,className:t,acTargetName:js.PRIMARY,actionMgrID:Dg.getNextActionMgrId(),context:n},{promise:o}=Dg.actionManagerPromise(r,a.actionMgrID);return BC({type:r,payload:{...a}}),o}static getCurrentContextAPI(e,t=Fs.APP.APP){return Cm({meta:{config:{}},options:{context:t,pageReference:e,containerName:js.PRIMARY}}).getPConnect()}};function HR(e){if(!e||"*"===e||"null"===e)return"";try{const t=new URL(e);return"https:"!==t.protocol&&"http:"!==t.protocol||"null"===t.origin?"":t.origin}catch{return""}}function qR(e){if(e.contentRect)return{height:e.contentRect.height};const t=Array.isArray(e.contentBoxSize)?e.contentBoxSize[0]:e.contentBoxSize;return"blockSize"in t?{height:t.blockSize}:"height"in t&&"number"==typeof t.height?{height:t.height}:{height:0}}const zR=new class{gadgetName="";resize=!1;parentOrigin="";boundOnMessage=this.onMessage.bind(this);init(e){if("undefined"==typeof window)return;const{resizing:t,parentOrigin:n}=e;this.gadgetName=window.name,this.resize="stretch"===t,this.parentOrigin="",n?this.parentOrigin=HR(n):document.referrer?this.parentOrigin=HR(document.referrer):this.parentOrigin=HR(function(){try{const{ancestorOrigins:e}=window.location;if(e&&e.length>0)return e[0]??""}catch{}return""}());const s=document.getElementsByTagName("app-root")[0];s.classList.add("mashup"),window.parent!==window&&this.resize&&this._registerResizeObserver(s)}send(e){const{action:t,message:n}=e,s=JSON.stringify({gadgetName:this.gadgetName,action:t,message:n});window.parent.postMessage(s,this.parentOrigin||window.location.origin)}_registerResizeObserver(e){new ResizeObserver((e=>{for(const t of e){const e=qR(t);this.send({action:"resize",message:e})}})).observe(e)}_updateUrl(e){window.history.pushState({},"home",e),PCore.configureForBrowserBookmark({semanticURL:"",context:js.APP.ROOT,acName:"primary"})}onMessage(e){if(!this.parentOrigin||e.origin!==this.parentOrigin)return!1;if("string"!=typeof e.data)return!1;let t;try{t=JSON.parse(e.data)}catch{return!1}return"UpdateUrl"===t.action&&this._updateUrl(t.message.url),!0}getMessageHandler(){return this.boundOnMessage}};"undefined"!=typeof window&&window.addEventListener("message",zR.getMessageHandler(),!1);const YR={type:"RootContainer",config:{renderingMode:"noPortal"},children:[{type:"ViewContainer",config:{routingInfo:"@ROUTING_INFO",name:"primary"}}]},KR={type:"RootContainer",config:{renderingMode:"hybrid"},children:[{type:"HybridViewContainer",config:{routingInfo:"@ROUTING_INFO",name:"primary",contextName:"app"},children:[]}]},QR="portal-less-styles";const JR=new class{createC11nEnv=e=>Cm(e);getContextUtils=()=>e;getRoutingManager=()=>t;getComponentsRegistry=()=>Co;getStateManager=()=>u;getActionCreators=()=>d;getStreamObservable=()=>a;getActionProcessor=()=>dS;getActionHandler=()=>uS;renderApp=(e,t)=>{const n={context:js.APP.APP},s={...rS.getIn(e,js.ROOT),options:n};LR(e),Jp(e,n,!0);const r=this.createC11nEnv({meta:s,isRoot:!0});fd.publish(Fs.PUB_SUB_EVENTS.EVENT_RENDER_APP,{props:r,domContainerID:t})};updateStoreWithUiRoot=async(e,t,n)=>{const{data:s,uiResources:r={}}=e,{root:a}=r,o=rS.getIn(r,js.CONTEXT_DATA),i=am(e);await oI(i,{},{},!1,!0);const c={...s,[js.CONTEXT_DATA]:o};Xy(a,t,c,n)};fetchEndPointResource=(e,t,n)=>{Wd(e,{method:"GET"},js.APP.ROOT).then((e=>{200===e.status&&this.updateStoreWithUiRoot(e.data,t,n)}))};loadComponent=async(e,t,n)=>{await Ig(n);const s=this.createC11nEnv({meta:e,isRoot:!0});kC()||LR({}),fd.publish(Fs.PUB_SUB_EVENTS.EVENT_RENDER_APP,{props:s,domContainerID:t})};setStaticServerUrl=(e,t,n)=>{hg.initServer(e,t,n)};loadView=async(e,t,n=[])=>{nn();const s=am(e),r=rS.getIn(s,js.VIEWS),a=rS.getIn(s,js.NAVIGATIONS),o=rS.getIn(s,js.COMPONENTS)||[];o.push(...n);const i=rS.getIn(s,js.STATIC_SERVER_URL),c=rS.getIn(s,js.APPLICATION_DATA);r&&uC(r),a&&hC(a),(e=>{e&&(t_=e.pyLabel)})(c),i&&hg.initServer(i),await Ig(o,i),this.renderApp(s,t)};initAppShell=(e,t,n)=>{S_(e),Og.buildActionTargetMap(t),nn(n)};initRoutingTable=(e,t)=>{S_(e,!0),nn(t)};setAppAlias=e=>{hg.setAppAlias(e)};getHomeRestApi=e=>{const t=rn(),{restApi:n}=o_("home",{portalName:e});return`${t}${n}`};getViewRestApi=(e,t)=>{const{restApi:n}=((e,t)=>{let n={restApi:""};try{if(A_()&&!t){const t=CA(),s=TA.processUrl(t,!0),r=TA._getMatchedRouteInRoutingTable(s)||"",a=TA.getRoutingInfo(),o=TA.processUrl(t,!1).split("/"),i=o[o.length-1],c=a?.routes?.[r]?.payload?.caseID?.replace("{workID}",i).replace("{id}",i);n=TA.getRestEndPoint("loadView",{caseID:c,viewID:e})||{}}else n=TA.getRestEndPoint("showView",{page:e,pageClass:t})||{}}catch(e){}return n})(e,t);return rn()+n};loadRootComponent=async(e,t,n=[],s,r,a)=>{const{config:o}=t||{},i=o?.name;if(kC()||LR({}),a){const e=`${js.APP.ROOT}/${i}`;uA(e),lA().deleteContainerItem(e)}(lA().getContainerItems()||[]).length>1&&!i?.startsWith("hybrid_")&&"authoring-preview"!==i&&tS(),BC(fS({data:{},context:js.APP.ROOT}));const c=this.createC11nEnv({meta:t,options:{context:js.APP.ROOT,pageReference:"",target:`${js.APP.ROOT}/${i}`}}),l=c.getPConnect(),u=`${l.getContextName()}/${l.getContainerName()}`;xy(u)||"noPortal"===o?.renderingMode||l.getContainerManager().initializeContainers({type:"single"});const d=["RootContainer","Region","ModalViewContainer","PreviewViewContainer","reference","URL",...n];await Ig(d),fd.publish(Fs.PUB_SUB_EVENTS.EVENT_RENDER_APP,{props:c,domContainerID:e,componentName:"RootContainer",portalTarget:s,styleSheetTarget:r})};loadViewByName=(e,t,n,s)=>{let r=this.getViewRestApi(e,n);r===rn()&&(r=this.getHomeRestApi(t)),this.fetchEndPointResource(r,s)};loadPortalView=(e,t)=>{const n=this.getHomeRestApi(e);this.fetchEndPointResource(n,t,!0)};configureForBrowserBookmark=e=>{C_(e)};checkIfSemanticURL=()=>A_();onPCoreReady=e=>{fd.subscribe(Fs.PUB_SUB_EVENTS.EVENT_RENDER_APP,e,"renderAppCallback")};onPCoreCleanup=e=>{fd.subscribe(Fs.PUB_SUB_EVENTS.EVENT_UNMOUNT_APP,e,"unmountAppCallback")};setFieldsDefaultConfigs=e=>{bp.updateFieldDefaults(e)};setGoogleMapsAPIKey=e=>{on(e)};setFetchDefaultHeaders=e=>{Kd(e)};setFetchAuthInfo=e=>{Qd(e)};getCaseApi=()=>Kh;getMashupApi=()=>WR;enableAppRouting=e=>{s_(e)};initStore=()=>LR({});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()))};getBootstrapConfigViaSB=async(e,t,n)=>{const s=n?`?dataViewParameters=${encodeURIComponent(JSON.stringify({themeID:n}))}`:"";return Wd(`${e}/api/application/v2/data_views/D_pxBootstrapConfig${s}`,{method:"GET",headers:new Headers(t)}).then((e=>{if(e.data)return e.data;throw Error("D_pxBootstrapConfig load failed.",{cause:e.status})}))};initCoreContainers=(e={})=>{const{containerType:t="single"}=e,n=Cm({meta:YR,options:{context:"root",pageReference:"",target:"root"}});return n.getPConnect().getContainerManager().initializeContainers({type:t,name:"primary",context:"app"}),{props:{getPConnect:n.getPConnect}}};loadMashup=async(e,t=!0)=>{if(t){const t=document.querySelector(e)??document.getElementsByTagName(e)[0],n=t?.parentNode;if(n&&!document.getElementById(QR)){const e=document.createElement("style");e.id=QR,e.textContent="app-root.mashup > .case-view, app-root.mashup > .page-view { min-height: 0px !important; }",n.appendChild(e)}}await this.loadRootComponent(e,YR,[js.LOAD_VIEW_STRING,"ViewContainer"]),globalThis.parent!==globalThis&&zR.init({resizing:"stretch"})};bootstrapWithAuthHeader=async(e,t,n=[],s,r)=>{const{customRendering:a=!1,onPCoreReadyCallback:o,staticContentServerUrl:i,dynamicSetCookie:c=!1,renderingMode:l,locale:u,envType:d,themeID:p,customCookies:g=!1,enableRouting:h}=e;let{restServerUrl:f,authInfo:m,authorizationHeader:I,appAlias:E,theme:y={}}=e,A=e.additionalHeaders?{...e.additionalHeaders}:{},C=null;const S=!I&&m&&!m.authType;if(m||(e.authInfo={},m=e.authInfo),(I&&0===Object.keys(m).length||g&&!S&&!m.authType)&&(m.authType="custom"),m.customCookies=g,!I&&m.tokenInfo?.access_token){const{tokenInfo:e}=m;I=`${e.token_type} ${e.access_token}`}if(m.tokenInfo?.csrf&&(A={...A,pzCTkn:m.tokenInfo.csrf}),E&&-1===E.indexOf("/")&&(E=`app/${E}`),"LAUNCHPAD"===d){A={...A,"X-Constellation-App":"Pega"},f=f.endsWith("/dx")?f:`${f}/dx`;const e=p?`?themeID=${p}`:"";globalThis.PCore&&(C=await this.getLPConfig(`${f}/api/application/v2/environmentInfo${e}`,I,A,g)),0===Object.keys(y).length&&C?.theme?.definition&&(y=JSON.parse(C.theme.definition).Theme)}else C=S?await this.preInitBootstrapConfig(e,E,A,p):await this.getBootstrapConfigExtended(E?`${f}/${E}`:`${f}`,I,A,p,g,u);const _=C?.pyConfigJSON?JSON.parse(C.pyConfigJSON):{...C};"LAUNCHPAD"===d&&await this.applyEnvironmentInfoResponse(_),_.restServerConfig=f,_.dynamicSemanticUrl=!1,_.dynamicSetCookie=c,_.enableRouting=!1,_.serviceConfig?Object.assign(_.serviceConfig,{contextPath:"",appAlias:E}):_.serviceConfig={contextPath:"",appAlias:E,staticContentServer:i,appStaticContentServer:"no-appstatic"},_.additionalHeaders={Authorization:I,...A},_.envType=d,_.dynamicLoadComponents=!a,_.dynamicSemanticUrl=!a,_.noHistory=!0,_.theme=y??{};const N=p&&_?.themeObject?_.themeObject:null;_.theme=N||y,_.renderingMode=l??_.renderingMode,_.locale=u||_.locale,e.semanticUrlArgs&&(_.semanticUrlArgs=e.semanticUrlArgs);const T=i||_.serviceConfig.staticContentServer;if(_.isSdk?(_.enableRouting=h,_.dynamicSemanticUrl=_.enableRouting,hg.initServer(i,"no-appstatic")):(_.serviceConfig.staticContentServer=T,_.serviceConfig.appStaticContentServer=_.serviceConfig.appStaticContentServer||"no-appstatic",hg.initServer(T,T)),"EMBED"===_.renderingMode&&m?.authentication_service&&"pega"!==m.authentication_service&&(_.routingInfo||(_.routingInfo={}),_.routingInfo.authServiceAlias=m.authentication_service),await nb.initCoreConfig(_),o&&fd.subscribe(Fs.PUB_SUB_EVENTS.EVENT_RENDER_APP,o,"renderAppCallback"),"LAUNCHPAD"===_.envType&&"EMBED"===_.renderingMode&&PA.setIsWebEmbed(!0),m&&["OAuth2.0","custom"].includes(m?.authType)&&this.setFetchAuthInfo(m),!a){const e=PA.environmentInfoObject?.pyInfinityStaticService;let a=null;if(e){const e=await af.getDataAsync("D_pxGetComponentLibraryListAndMap","",{});Array.isArray(e.data)&&e.data.length>0&&(a=e.data)}const o=new Promise((async(e,t)=>{try{const t=async()=>{await this.importReactRoot(),e(!0)};fd.subscribe("component-map-loaded",t),"ReactRoot"in Co.getLazyMap()&&e(!0)}catch(e){t(e)}}));await o,nb.initCoreContainers(),await this.loadRootContainerWithHybrid(t,n,s,r),a&&await Promise.all(a.map((({pyComponentMap:e,pxUpdateDateTime:t})=>hg.importCustomComponentMap(e,t))))}};loadRootContainerWithHybrid=(e,t=[],n,s)=>(t.push(js.CONTAINER_TYPE?.HYBRID||"HybridViewContainer",js.LOAD_VIEW_STRING),this.loadRootComponent(e,KR,t,n,s));getBootstrapConfigExtended=async(e,t,n,s,r,a)=>{const o={};s&&(o.themeID=s),a&&(o.locale=a);const i=`${e}/api/application/v2/data_views/D_pxBootstrapConfig${s||a?`?dataViewParameters=${encodeURIComponent(JSON.stringify(o))}`:""}`,c=t?{Authorization:t,...n}:n;return fetch(i,{method:"GET",headers:new Headers(c),credentials:t&&!r?"same-origin":"include"}).then((e=>{if(e.ok)return e.json();throw Error("D_pxBootstrapConfig load failed.",{cause:e.status})}))};getLPConfig=async(e,t,n,s)=>{const r=new Headers({...n,...t&&{Authorization:t}}),a=await fetch(e,{method:"GET",headers:r,credentials:t&&!s?"same-origin":"include"});if(!a.ok)throw new Error("environmentInfo load failed.",{cause:a.status});return a.json()};applyEnvironmentInfoResponse=async e=>{const{environmentInfo:t,pyCaseTypeList:n,theme:s,keyMapping:r}=e,{pxApplication:a,features:o,pxLocale:i}=t,c={simpleTable:{pageInstructionUUIDGeneration:!1},...o},l=Intl.DateTimeFormat().resolvedOptions().timeZone.toUpperCase(),u="ETC/UNKNOWN"===l?"America/New_York":l;e.environmentInfo={...t,pxApplication:{...a},features:c,pyCaseTypeList:n,pxLocale:{...i,pyTimeZone:u}},e.timezone=u;const d=Object.keys(e.environmentInfo);return{isEnvInfoValid:["pxOperator","pxLocale","pxApplication"].every((e=>d.includes(e))),theme:s,keyMapping:r,features:c}};importReactRoot=async()=>{const e=[];return Co.getComponent("ReactRoot").modules.forEach((t=>{e.push(t())})),Promise.allSettled(e)};preInitBootstrapConfig=async(e,t,n,s)=>{const{restServerUrl:r,customRendering:a=!1,staticContentServerUrl:o,dynamicSetCookie:i=!1,authInfo:c,renderingMode:l,locale:u,timezone:d="America/New_York",envType:p,theme:g={}}=e,h=s??null,f={restServerUrl:r,restServerConfig:r,dynamicSetCookie:i,enableRouting:!1,serviceConfig:{contextPath:"",appAlias:t,staticContentServer:o,appStaticContentServer:"no-appstatic"},additionalHeaders:{...n},envType:p,dynamicLoadComponents:!a,dynamicSemanticUrl:!a,noHistory:!0,themeIDObj:h,theme:h||g,renderingMode:l,locale:u,timezone:d,tokens:{C11NB2S:""}};return hg.initServer(o,"no-appstatic"),await nb.init(f),c&&["OAuth2.0","custom"].includes(c?.authType)&&this.setFetchAuthInfo(c),this.getBootstrapConfigViaSB(t?`${r}/${t}`:`${r}`,n,s)}};const XR=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 ZR=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.portalTemplate=e.portalTemplate,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=e.dynamicLoadComponents??!0,this.dynamicSemanticUrl=e.dynamicSemanticUrl??!0,this.enableRouting=e.enableRouting??!0,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 XR(e.serviceConfig),this.behaviorOverrides=e.behaviorOverrides,this.initBroadcast=!!e.initBroadcast,this.cookieComplianceMethod=e.cookieComplianceMethod??"none",this.isExtraCallRequiredForDefaultHome=e.isExtraCallRequiredForDefaultHome??"false",this.enablePriorityAndUrgencyImprovements=e.enablePriorityAndUrgencyImprovements??!1,this.storePercentageAsDecimal=e.storeC11nPercentageAsDecimal??!1,this.collab=e.collab,this.requestContext=e.requestContext,this.pzencv1zzz=e.pzencv1zzz}},eb="@P .viewConfig";let tb=0;const nb=new class{async init(e){const t=new ZR(e);s_(t.enableRouting),LR({}),bp.updateFieldDefaults(t.fieldDefaults),bp.setFieldDefault("Percentage","storePercentageAsDecimal",t.storePercentageAsDecimal),this.#D(t.routingInfo,t.actionModel,{server:t.restServerConfig,reAuthUrl:t.serviceConfig.reAuthUrl});const{appAliasWithoutServlet:n,appAlias:s,googleMapKey:r,staticContentServer:a,appStaticContentServer:o}=t.serviceConfig;hg.setAppAlias(n||s),on(r),hg.initServer(a,o,t.tokens.C11NB2S),Bs.setRemoteCaseMapping(t.remoteCaseMapping),kR.init(t.collab),kR.subscribeToCaseEvents(),Jh.subscribeToCaseEvents(),sf.setConnectionConfig({messagingService:t.serviceConfig.messagingService}),t.initBroadcast&&GR.getBroadcastUtils().init(),wd.setDefaultHeaders(t.additionalHeaders),wd.setRequestContext(t.requestContext),"Infinity"===t.envType&&await this.loadEnvironmentInfoFromDataPage(t);const i={...t.environmentInfo,encCSRFToken:t.pzencv1zzz,renderingMode:t.renderingMode,...t.portalTemplate?{pyPortalTemplate:t.portalTemplate}:{}};i.pyCaseTypeList?.forEach((e=>{const t=e.pyWorkTypeImplementationClassName;t&&(e.localeReference=tm(Zf,t))})),i.features?.isNamespaceEnabled&&(t.additionalHeaders.Prefer="namespaced",wd.setDefaultHeaders(t.additionalHeaders)),this.configureTheme(t.theme),PA.setCookieComplianceMethod(t.cookieComplianceMethod),PA.setIsExtraCallRequiredForDefaultHome(t.isExtraCallRequiredForDefaultHome),PA.setEnablePriorityAndUrgencyImprovements(t.enablePriorityAndUrgencyImprovements),PA.setEnvironmentInfo(i);const c=new URLSearchParams(window.location.search).get("lang")||t.locale||navigator.language||"en-US";PA.setLocale(c),"undefined"!=typeof document&&(document.documentElement.lang=c,document.documentElement.dir=FR(c)),xA().setTimezone(t.timezone),Ng.init(),"Infinity"!==t.envType&&BR.subscribeToGlobalEvents(),t.initBroadcast&&GR.getBroadcastUtils().init(),await RA()}configureTheme=e=>{if(e){const t=e.light,n=e.dark;void 0!==t&&void 0!==n?(this.#P(t),this.#P(n,{type:"dark"})):PA.setTheme(e)}};getBootstrapConfig=async(e,t)=>{const n=`${t.token_type} ${t.access_token}`,s=`${e}/api/application/v2/data_views/${Ls.getDefaultQualifiedName("D_pxBootstrapConfig")}`;return(await fetch(s,{method:"GET",headers:new Headers({Authorization:n})})).json()};initCoreContainers=(e={})=>{const{containerType:t="single"}=e,n=Cm({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 JR.getComponentsRegistry().getComponent("ReactRoot")?.modules?.forEach((t=>{e.push(t())})),Promise.allSettled(e)};importDesignSystemComponentMap=async(e,t,n)=>{try{ug(e)}catch(e){return void console.error("Design system load blocked: untrusted or malformed URL",e)}try{await((e,t="true")=>new Promise(((n,s)=>{if("undefined"==typeof document)return void s(new Error("document is not available in this environment"));const r=document.createElement("script");r.type="text/javascript",r.src=e,r.async="true"===t,r.onload=()=>n(void 0),r.onerror=()=>s(new Error("Failed to load resource from Design System")),document.body.appendChild(r)})))(`${e}component/project/${t}/designsystems/${n}/componentsmap.js?v=${Date.now()}`)}catch(e){console.log(e)}};buildSemanticUrl=(e,t,n,s,r)=>{const a=new URLSearchParams(t),o="true"===n&&!!e,i=new URLSearchParams(window.location.search).get("lang");i&&!a.has("lang")&&a.set("lang",i);let c=null,l=null,u=null;if(e){const t=(e.startsWith("/")?e.substring(1):e).split("/");c=t[0]||null,l=t[1]||null,"assignments"===t[2]&&t[3]&&(u=t[3])}const d=[s];c&&d.push(c),l&&d.push(l),u&&d.push("assignments",u),o&&(a.has("noPortal")||a.append("noPortal","true"),l&&r&&a.append("view",r));const p=a.toString();return d.join("/")+(p?`?${p}`:"")};initCoreConfig=async e=>{const{routingInfo:t,serviceConfig:n,semanticUrl:s,queryParams:r,noPortal:a,noHistory:o,viewName:i,theme:c,restServerConfig:l,dynamicLoadComponents:u=!0,dynamicSemanticUrl:d=!0,renderingMode:p="FULL_PORTAL",envType:g,extras:h}=e,{appAlias:f,contextPath:m}=n,I=window.location,E=I.origin;let y=l??E;const A={};if(m&&(y+=m),f&&"LAUNCHPAD"!==g&&(y+=`/${f}`),e.restServerConfig=y,this.#O(),!0===d){const e=this.buildSemanticUrl(s,r,a,y,i);!o&&e&&"undefined"!=typeof window&&window.history.replaceState({},"home",e)}else if("HYBRID"!==p){const e=I.href,t=e.indexOf("?");t>0&&"undefined"!=typeof window&&window.history.pushState({},"home",e.substring(0,t)),A.dynamicSemanticUrl=!1}else console.log(`renderingMode :${p}`);!0!==u&&(A.dynamicLoadComponents=!1);let C=null;if(f){const e=f.indexOf("/app/");C=e>=0?f.substring(e+1):f}if((!1===A.dynamicSemanticUrl||!1===A.dynamicLoadComponents)&&PCore.setBehaviorOverrides(A),e.appAlias=C,c)if("object"==typeof c)e.theme=c;else try{e.theme=JSON.parse(c)}catch{e.theme={}}let S=I?`${I.protocol}//${I.host}`:t.domain;if("EMBED"===p)try{S=new URL(e.restServerConfig).origin}catch{}const _={...t,domain:S,searchParams:I?I.search:"",embedQueryParams:e.semanticUrlArgs};e.routingInfo=_,e.initBroadcast="true"===PA.environmentInfoObject?.pxMashupDetails?.pyIsTraditionalCoexistence,!e.noPortal||"true"!==e.noPortal&&!0!==e.noPortal||(e.renderingMode="EMBED"),h?.cspNonce&&(window.__webpack_nonce__=h.cspNonce),PA.setCaseLabelFirstInTitle(e.extras?.useDefaultBrowserTabTitle??!0),await this.init(e)};launchViewByName=async(e,t,n,s,r,a,o,i,c=[])=>{tb+=1;const l=i||`mashup${tb}`,u={type:"RootContainer",config:{viewConfig:eb,renderingMode:"view",name:l}};await JR.loadRootComponent(e,u,r,a,o),await this.loadCustomComponentLibrariesIfEnabled(c),JR.loadViewByName(t,n,s,l)};launchView=(e,t,n=[],s,r,a,o)=>{let i;tb+=1,i="hybrid"===o?`hybrid_${tb}`:o||`mashup${tb}`;const c={type:"RootContainer",config:{viewConfig:eb,renderingMode:"portal",name:i}};o===js.HYBRID&&Tf.setRuntimeParam(js.HYRBID_ROOT_CONTAINERNAME,i),Tf.setRuntimeParams(s),JR.loadRootComponent(e,c,n,r,a).then((()=>JR.updateStoreWithUiRoot(t,i,!1)))};launchPortal=async(e,t,n=`portal${tb+=1}`,s=[],r=[])=>{const a="LoadingComponent",o={type:"RootContainer",config:{viewConfig:eb,renderingMode:"portal",skeleton:a,name:n}},i=[...s,a];PA.isPortalLoaded=!0;try{return await JR.loadRootComponent(e,o,i),await this.loadCustomComponentLibrariesIfEnabled(r),JR.loadPortalView(t,n)}catch(e){throw console.error(`Failed to launch portal ${t}:`,e),e}};launchMashup=(e,t=!0,n=[])=>{const s={type:"RootContainer",config:{renderingMode:"noPortal"},children:[{type:"ViewContainer",config:{routingInfoAnnotation:"@ROUTING_INFO",name:"primary"}}]};if(t&&!document.getElementById("portal-less-styles")){const t=document.getElementsByTagName(e),n=t[0]?.parentNode;if(n){const e=document.createElement("style");e.id="portal-less-styles",e.textContent="app-root.mashup > .case-view, app-root.mashup > .page-view { min-height: 0px !important; }",n.appendChild(e)}}if((async()=>{await JR.loadRootComponent(e,s,[js.LOAD_VIEW_STRING,"ViewContainer"]),await this.loadCustomComponentLibrariesIfEnabled(n)})(),window.parent!==window){const e=hg.getStaticServerUrl();r(754)(`${e}constellation-mashup-bridge.js`).then((e=>{e.mashup.init({resizing:"stretch"})}))}};loadEnvironmentInfoFromDataPage=async e=>{if("wss"===e.portalType&&(e.environmentInfo={...e.environmentInfo,features:{case:{createInModal:!1}}}),e.environmentInfo?.pyDataPages&&Array.isArray(e.environmentInfo.pyDataPages)){const t=e.environmentInfo.pyDataPages;setTimeout((()=>{this.loadDataPagesIntoEnvironmentInfo(t).catch((e=>{console.error("Error loading data pages into environment info:",e)}))}),js.PRIORITY.TRIVIAL)}};loadDataPagesIntoEnvironmentInfo=async e=>{if(!e?.length)return;const t=PA.environmentInfoObject;if(!t)return;const n=e.filter((({pyName:e,pyPath:t})=>!(!e||!t)||(console.warn("Invalid data page configuration: missing pyName or pyPath"),!1)));if(0===n.length)return;const s=await Promise.allSettled(n.map((async({pyName:e,pyPath:t})=>{try{return{pyPath:t,response:await af.getPageDataAsync(e,"",{})}}catch(t){return console.error(`Failed to load data page ${e}:`,t),null}}))),r=s.length;let a=!1;for(let e=0;e<r;e+=1){const n=s[e];if("fulfilled"===n.status&&n.value){const{pyPath:e,response:s}=n.value;this.setNestedProperty(t,e,s),a=!0}}a&&PA.setEnvironmentInfo(t)};#R(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&Object.getPrototypeOf(e)===Object.prototype}setNestedProperty(e,t,n){const s=t.startsWith(".")?t.slice(1):t;if(!s)return void("object"==typeof n&&null!==n&&Object.assign(e,n));const r=s.split("."),a=r.length;let o=e;for(let e=0;e<a-1;e+=1){const t=r[e],n=o[t];if(this.#R(n))o=n;else{const e={};o[t]=e,o=e}}o[r[a-1]]=n}start=async(e,t)=>{const{serviceConfig:{appStaticContentServer:n},ccV2LibId:s,environmentId:r,isAlternateDesignSystemEnabled:a,alternateDesignSystemName:o}=e;await this.initCoreConfig(e);const i=PA.environmentInfoObject?.pyC11nDXCBDevURL,c="true"===a&&"other"!==o,l=async()=>{await this.importReactRoot();const e=[];i?e.push(hg.importCustomComponentMap("")):s&&e.push(hg.importCustomComponentMap(s)),c&&e.push(this.importDesignSystemComponentMap(n,r,o)),e.length&&await Promise.all(e),t?.()},u=JR.getComponentsRegistry();if("ReactRoot"in u.getLazyMap())return!0;return u.getComponent("ReactRoot")?(await l(),!0):new Promise((e=>{fd.subscribeOnce("component-map-loaded",(async()=>{await l(),fd.unsubscribe("component-map-loaded","component-map-loaded-id"),e(!0)}),"component-map-loaded-id")}))};registerForDebugInfo=e=>{if(PA.setPreviewMode(),!e)return;const t=({debugInfo:t})=>{const n=t?.["X-Pega-App-Debug-ID"];n&&e.postMessage({appDebugID:n})};fd.subscribe("fetchSuccess",t,"fetchSuccess"),fd.subscribe("fetchFailure",t,"fetchFailure")};toggleTracerHeaders=e=>{e.addEventListener("message",(e=>{const t=e?.data?.enableTracer;t?Id.enableTracer():Id.disableTracer()}))};loadEnvironmentInfo=async e=>{const t="Android"===window.pms?.device.systemName;if(e.theme&&!t)try{const t=JSON.parse(e.theme.definition),n=t.Branding,s=t.Theme;PA.setBrandingInfo(n),PA.setTheme(s)}catch{PA.setBrandingInfo({}),PA.setTheme({})}if(e.darkTheme&&!t){const t={type:"dark"};try{const n=JSON.parse(e.darkTheme.definition);PA.setBrandingInfo(n.Branding,t),PA.setTheme(n.Theme,t)}catch{PA.setBrandingInfo({},t),PA.setTheme(void 0,t)}}e.keyMapping&&PA.setKeyMapping(e.keyMapping),PA.setCookieComplianceMethod(e.cookieComplianceMethod??"none")};async loadCustomComponentLibrariesIfEnabled(e){e?.length>0&&PA.environmentInfoObject?.pyInfinityStaticService&&await this.loadCustomComponentLibraries(e)}async loadCustomComponentLibraries(e){const t=e.map((e=>this.importSingleCustomComponent(e)));await Promise.all(t)}importSingleCustomComponent(e){return"object"==typeof e&&"pyComponentMap"in e?hg.importCustomComponentMap(e.pyComponentMap,e.pxUpdateDateTime):hg.importCustomComponentMap(e)}#D(e,t,n){S_(e),Og.buildActionTargetMap(t),nn(n)}#O(){document.querySelectorAll('head link[rel~="icon"], head link[rel~="apple-touch-icon"]').forEach((e=>{e.setAttribute("href",e.href)}))}#P(e,t){if(null===e)return;if("object"==typeof e)return void PA.setTheme(e,t);let n;try{n=JSON.parse(e)}catch{return void PA.setTheme("dark"===t?.type?void 0:{},t)}PA.setTheme(n,t)}},sb={createViewRule:(e,t)=>{const{restApi:n,reqType:s}=i_("createViewRuleByID");return Wd(n,{method:s,body:e},t).then((e=>e.data))},getViewRule:(e,t)=>{const{restApi:n,reqType:s}=i_("getViewRuleByID",{ID:e});return Wd(n,{method:s},t).then((e=>e.data))},updateViewRule:(e,t,n)=>{const{restApi:s,reqType:r}=i_("updateViewRuleByID",{ID:e});return Wd(s,{method:r,body:t},n).then((e=>e.data))},deleteViewRule:(e,t)=>{const{restApi:n,reqType:s}=i_("deleteViewRuleByID",{ID:e});return Wd(n,{method:s},t).then((e=>e.data))},getCalculatedFields:(e,t,n)=>{const{restApi:s,reqType:r}=i_("getCalculatedFieldsInViewByID",{caseID:e,viewID:t});return Wd(s,{method:r,body:{calculations:{fields:n}}}).then((e=>e.data))}},rb={"Content-Type":"application/json"},ab={addCaseFollower:(e,t,n)=>{const s={caseID:e},r=JSON.stringify({users:t.map((e=>({ID:e})))});return tg("addCaseFollower",{body:r,queryPayload:s,headers:rb},n)},deleteCaseFollower:(e,t,n)=>tg("deleteCaseFollower",{queryPayload:{caseID:e,followerID:t}},n),getCaseFollowers:(e,t)=>tg("getCaseFollowers",{queryPayload:{caseID:e}},t).then((e=>e.data.followers))},ob={addRelatedCases:(e,t,n)=>{const s={caseID:e},r=JSON.stringify({cases:t});return tg("addRelatedCases",{body:r,queryPayload:s},n)},removeRelatedCase:(e,t,n)=>tg("removeRelatedCase",{queryPayload:{caseID:e,relatedCaseID:t}},n),getRelatedCases:(e,t)=>tg("getRelatedCases",{queryPayload:{caseID:e}},t).then((e=>e.data.relatedCases))},ib="operatorDetails",cb={getOperatorDetails:(e,t=!1)=>{const{reqType:n}=i_(ib,{});if("GET"===n){const t={encodedOperatorId:encodeURIComponent(`{"opname":"${e}"}`)};return tg(ib,{queryPayload:t})}return t?tg("operatorDetailsByBusinessID",{body:{dataViewParameters:{BusinessID:e}}}):tg(ib,{body:{dataViewParameters:{ID:e}}})}},lb="postCustomFeedMessages",ub={"Content-Type":"application/json"};const db=new class{constructor(){this.mentionsTagsCancelTokenSource=[],this.mentions=[]}getFeeds=(e,t,n,s,r,a,o)=>{const i=a.getLocalizationService();o||(this.mentions=[]);let c="";s&&Array.isArray(s)&&s?.length>0&&(s.forEach((e=>{e.on&&(c=`${c}${e.id},`)})),""===c&&(c="ClearFilters"));let l="";o&&(l=a.getValue("pulse.pageLastEntry"));const u={filterForContext:"pyDataFeed"===t?encodeURIComponent(e):e,feedID:t,feedClass:n,filterBy:c,pageSize:10,olderThan:l};for(let e=0;e<r.length;e+=1)r[e].cancel();const d=rg();return r.push(d),tg("getFeedMessages",{queryPayload:u,cancelTokenSource:d},a.getContextName()).then((async t=>{if(200!==t.status||!t.data)return a.reportError(`getFeeds call failed ${t.status}`,t.data),t;{r.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 om({uiResources:t.data.uiResources}),!s&&(s=[{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),s.push(t)}));const t=s.find((e=>"All"===e.id));t&&(t.on=n)}}}if(o&&a.getValue("pulse.messageIDs")){let e=a.getValue("pulse.messages");e={...e,...c},Object.values(e).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)}))}))}if(Dy(a.getContextName())){a.updateState({pulse:{messages:o&&a.getValue("pulse.messageIDs")?{...a.getValue("pulse.messages"),...c}:c,messageIDs:o&&a.getValue("pulse.messageIDs")?[...a.getValue("pulse.messageIDs"),...n]:n,nextPageFirstEntry:t?.data?.nextPageFirstEntry||"",pageLastEntry:t?.data?.pageLastEntry||"",hideAttachment:t?.data?.hideAttachment||!1,postTypes:u,pulseContext:e}});const r=[...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:s,caseMentions:r}}}})).catch((e=>{if(!ag(e))return a.reportError(": Error occurred during ajax call at getFeeds API : ",e.response),e.response}))};postMessage=(e,t,n,s=[],r=!1,a=[])=>{const o={message:t,context:e,parentMessageId:r?e:"",attachments:s,pyRecipients:a.length?a:void 0},i=0===a.length?{body:JSON.stringify(o),headers:ub}:{body:JSON.stringify(o),queryPayload:{type:"PegaSocial-Post-Private"},headers:ub};return tg(a.length?lb:"postFeedMessages",i,n.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,n,s.length>0);return n.updateState({pulse:{messages:{[e]:{pxResults:t}}}}),o}const{messages:o,messageIDs:i,caseMentions:c}=this.buildMessageObject(a,r,n,s.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)=>tg(lb,{body:t,queryPayload:{type:e},headers:ub},n.getContextName()).then((async e=>{if(201===e.status&&e.data){const s=e.data.data,r={ID:s.ID,pzInsKey:s.ID,classID:s.classID,pyPostType:s.pyPostType,postedByUser:s.postedByUser,pyIsDeleteEnabled:s.pyIsDeleteEnabled,pyMessageViewReference:s.messageViewReference,pyFeed:{pyIconType:"user",pyCommentContext:s.pyCommentContext,pyPostedOn:s.postedTime,pyFeedTitle:s.postedByUser.name,pyIconReference:s.postedByUser.ID},...s.PostMessage};im(s.messageViewReference,n,t.context)||await om({uiResources:e.data.uiResources}),n.updateState({pulse:{messages:{[r.ID]:r,...n.getValue("pulse.messages")},messageIDs:[r.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:s,isReply:r=!1,recipients:a=[]})=>{const o=JSON.stringify({message:n,...a.length&&{pyRecipients:a}});return tg("editFeedMessage",{queryPayload:{messageID:e},body:o,headers:ub},s.getContextName()).then((e=>{if(200===e?.status&&e?.data){const n=e?.data;if(r){n.parentMessageID=t;const{pxResults:e,caseMentions:a}=this.buildMessageObject(n,r,s,!1);return s.updateState({pulse:{messages:{[t]:{pxResults:e}}}}),a}const{messages:a,caseMentions:o}=this.buildMessageObject(n,r,s,!1);return s.updateState({pulse:{messages:a}}),o}return s.reportError(`editMessage call failed with status ${e.status}`,e),""})).catch((e=>{throw s.reportError(": Error occurred during ajax call at editMessage API : ",e.response),e.response}))};buildMessageObject=(e,t,n,s=!1)=>{const r={ID:e?.ID||"",classID:e?.classID||"PegaSocial-Message",tags:e?.tags||[],pyHasAttachment:s,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===r?.parentMessageID))||{};const t=e?.findIndex((e=>e?.pzInsKey===r?.ID));if(-1!==t){const n=[...e];n[t]={...n[t],...r},e=n}else e=[...e,r];return{pxResults:e,messages:{},messageIDs:[],caseMentions:this.getCaseMentions(e)}}const o=n.getValue("pulse.messageIDs");if(o){const e=o.includes(r.ID)?{...a[r.ID],...r}:r,t={...a,[r.ID]:e};return{messages:t,messageIDs:o.includes(r.ID)?o:[r.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:s,pConnectObj:r})=>{const a=t?"unlikeFeedMessages":"likeFeedMessages",o=JSON.stringify({ContextClass:e});tg(a,{body:o,queryPayload:{pulseContext:e},headers:ub},r.getContextName()).then((a=>{if(200===a.status)if(s){const s=r.getValue(`pulse.messages.${n}`),a=s?.pxResults&&Array.isArray(s?.pxResults)&&s.pxResults?.length>0&&s.pxResults?.map((n=>{if((n={...n}).pzInsKey===e){let e=0,s=!1;const r=n.pyLikes?n?.pyLikes?.pxLikeCount:0;t?(e=r-1,s=!1):(e=r+1,s=!0),n.pyLikes={pxLikeCount:e,pxIsLiked:s}}return n}));r.updateState({pulse:{messages:{[n]:{pxResults:a}}}})}else{const s={...r.getValue(`pulse.messages.${n}`)},a=s.pyLikes?s.pyLikes.pxLikeCount:0;let o=0,i=!1;t?(o=a-1,i=!1):(o=a+1,i=!0),s.pyLikes={pxLikeCount:o,pxIsLiked:i},r.updateState({pulse:{messages:{[e]:s}}})}else r.reportError(`likeMessage call failed with status ${a.status}`,a)})).catch((e=>{r.reportError(": Error occurred during ajax call at likeMessage API : ",e.response.data)}))};deleteMessage=(e,t,n,s)=>{let r=e;t&&(r=n);tg("deleteFeedMessage",{queryPayload:{messageID:r}},s.getContextName()).then((r=>{if(200===r.status)if(t){const t=s.getValue(`pulse.messages.${e}`),r=t?.pxResults&&Array.isArray(t?.pxResults)&&t.pxResults?.length>0&&t.pxResults?.filter((e=>e.pzInsKey!==n));s.updateState({pulse:{messages:{[e]:{pxResults:r}}}})}else{const t=s.getValue("pulse.messageIDs"),n=t&&Array.isArray(t)&&t?.length>0&&t?.filter((t=>t!==e)),r={...s.getValue("pulse.messages")};delete r[e],s.updateState({pulse:{messageIDs:n,messages:r}})}else s.reportError(`deleteMessage call failed with status ${r.status}`,r)})).catch((e=>{s.reportError(": Error occurred during ajax call at deleteMessage API : ",e.response)}))};getLikedUsers=(e,t)=>tg("getFeedMessageLikes",{queryPayload:{messageID:e}},t.getContextName());getMentionSuggestions=(e,t)=>{const{pulseContext:n,searchFor:s,mentionsType:r,listSize:a=5}=e,o={pulseContext:n,searchFor:s,mentionsType:r,listSize:a};for(let e=0;e<this.mentionsTagsCancelTokenSource.length;e+=1)this.mentionsTagsCancelTokenSource[e].cancel();const i=rg();return this.mentionsTagsCancelTokenSource.push(i),tg("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=>{ag(e)||t.reportError(": Error occurred during ajax call at getMentionSuggestions API : ",e.response.data)}))};getMentionTypes=e=>tg("getMentionTypes",{},e.getContextName());getPostTypeView=(e,t,n)=>tg("getViewRuleByMessageType",{queryPayload:{type:e,contextID:n??""}},t.getContextName());getTagSuggestions=(e,t)=>{const{searchFor:n,listSize:s=5}=e,r={searchFor:n,listSize:s};for(let e=0;e<this.mentionsTagsCancelTokenSource.length;e+=1)this.mentionsTagsCancelTokenSource[e].cancel();const a=rg();return this.mentionsTagsCancelTokenSource.push(a),tg("getTagSuggestions",{queryPayload:r,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=>{ag(e)||t.reportError(": Error occurred during ajax call at getTagSuggestions API : ",e.response.data)}))}},pb={getTaggedCases:(e,t)=>{const n={caseID:e,viewID:Ls.getDefaultQualifiedName("pyTaggedCases")};return tg("loadView",{queryPayload:n},t.getContextName()).then((e=>e?.data)).catch((e=>{t.reportError(": Error occurred during ajax call at fetchTaggedcases API : ",e.response)}))},getTags:(e,t)=>tg("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 s={caseID:e},r=JSON.stringify({tags:t});return tg("addTagsToCase",{body:r,queryPayload:s},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)=>tg("deleteCaseTag",{queryPayload:{caseID:e,tagID:t}},n.getContextName()).catch((e=>{n.reportError(": Error occurred during ajax call at removeTag API : ",e.response)})),getTagsLandingPageURL:e=>{const t=Ls.getDefaultQualifiedName("D_pxGetTagsLandingPageURL");return af.getPageDataAsync(t,e.getContextName(),{},{invalidateCache:!0}).catch((t=>{e.reportError(": Error occurred during ajax call getTagsLandingPageURL API : ",t.response)}))}},gb=(e,t)=>{dA(t.getContextName(),e.etag),pA(t.getContextName(),e.etag)},hb={getParticipants:(e,t)=>tg("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)=>tg("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)=>tg("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)=>tg("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,s,r)=>{const a={caseID:e},o={...n,participantRoleID:t},i={"if-match":s.getCaseSummary().headers.etag};return new Promise(((e,t)=>{tg("createParticipant",{body:o,queryPayload:a,headers:i},s.getContextName()).then((t=>{gb(t.headers,s),e()})).catch((e=>{e.response.data.errorDetails?.forEach((e=>{e.erroneousInputOutputFieldInPage=e.erroneousInputOutputFieldInPage.replace(/\.pyWorkParty\([^)]*\)/,"")}));const n=HI(r||s.getContextName());s.reportError(": Error occurred during ajax call at createParticipant API : ",{...e.response.data,formFields:n},r),t(e.response)}))}))},updateParticipant:async(e,t,n,s,r)=>{const a={caseID:e,participantID:t},o={"if-match":s.getCaseSummary().headers.etag};return new Promise(((e,t)=>{tg("updateParticipant",{body:n,queryPayload:a,headers:o},s.getContextName()).then((t=>{gb(t.headers,s),e()})).catch((e=>{e.response.data.errorDetails?.forEach((e=>{e.erroneousInputOutputFieldInPage=e.erroneousInputOutputFieldInPage.replace(/\.pyWorkParty\([^)]*\)/,"")}));const n=HI(r||s.getContextName());s.reportError(": Error occurred during ajax call at updateParticipant API : ",{...e.response.data,formFields:n},r),t(e.response)}))}))},deleteParticipant:(e,t,n)=>{const s={caseID:e,participantID:t},r={"if-match":n.getCaseSummary().headers.etag};return new Promise(((e,t)=>{tg("deleteParticipant",{queryPayload:s,headers:r},n.getContextName()).then((t=>{gb(t.headers,n),e()})).catch((e=>{n.reportError(": Error occurred during ajax call at deleteParticipant API : ",e.response),t(e.response)}))}))}};function fb(e=[]){return e.reduce(((e,t)=>(e[t.personalizationID]={name:t.name,personalizationState:JSON.parse(t.personalizationState||"{}")},e)),{})}const mb="create",Ib="update",Eb="delete";function yb(e,t,n,s){const r=AC(t);if(r){switch(e){case mb:case Ib:{const{markAsDefault:e,...t}=s;Object.entries(t).length>0&&(r.allPersonalizations[n]=t),e&&(r.defaultPersonalization=n);break}case Eb:delete r.allPersonalizations[n],r.defaultPersonalization===n&&(r.defaultPersonalization="");break;default:return null}return r}return null}const Ab={},Cb=async e=>{const t=AC(e);if(t)return Array.isArray(t.allPersonalizations)&&(t.allPersonalizations=fb(t.allPersonalizations)),Promise.resolve(t);const{restApi:n,reqType:s}=i_("getUIListPersonalizations",{listID:e});return Wd(n,{method:s,body:{}}).then((e=>{const{data:t}=e;return{allPersonalizations:fb(t.allPersonalizations),defaultPersonalization:t.defaultPersonalization}}))},Sb=async(e,t,n)=>{const{restApi:s,reqType:r}=i_("createListPersonalization",{listID:e});return yb(mb,e,t,n),Wd(s,{method:r,body:{...n,personalizationState:JSON.stringify(n.personalizationState)}}).then((e=>{const n=e.data;return Ab[t]=n,e}))},_b=async(e,t,n)=>{const s=Ab[t]||t;yb(Ib,e,t,n);const{restApi:r,reqType:a}=i_("updateListPersonalization",{listID:e,personalizationID:s})||{};return Wd(r,{method:a,body:{...n,personalizationState:JSON.stringify(n.personalizationState)}})},Nb=async(e,t)=>{const n=Ab[t]||t;yb(Eb,e,t);const{restApi:s,reqType:r}=i_("deleteListPersonalization",{listID:e,personalizationID:n});return Wd(s,{method:r,body:{}}).then((e=>(Ab[t]&&delete Ab[t],e)))};const Tb=function(e){return e?{createPersonalization:Sb.bind(null,e),updatePersonalization:_b.bind(null,e),deletePersonalization:Nb.bind(null,e),fetchPersonalizations:Cb.bind(null,e)}:{createPersonalization:()=>Promise.resolve(""),updatePersonalization:()=>Promise.resolve(),deletePersonalization:()=>Promise.resolve(),fetchPersonalizations:()=>Promise.resolve({})}},Db="undefined"!=typeof window?window.sessionStorage:{getItem:()=>null,setItem:()=>{}},Pb="getDataObjects",Ob="getInsightByID",Rb=["LocalList","RemoteList","PromptList","DataPage"];let bb=null;const vb=[];const xb={},wb=e=>Ch.getAppCacheKey(`PrimaryFields-${e}`);function Mb(e){let t;return e[1].category?t=e[1].category:e[0].indexOf(":")>0&&(t=e[0].substring(0,e[0].indexOf(":"))),t}function Lb(e){return"object"==typeof e&&null!==e}function Ub(e){return{...e[1],fieldID:e[0],fieldType:e[1].fieldType||(e[1].isUserReference?"User reference":void 0),category:Mb(e),classID:e[1].associationClassID?e[1].associationClassID:e[1].classID}}function Fb({data:e}){const t=(e,t)=>tm("FIELD",e,t),n="string"==typeof e.classID?e.classID:"",s=tm("CASE",n);e.classNameLocaleReference=s;const r=Array.isArray(e.fields)?e.fields:[];for(let e=0;e<r.length;e+=1){const n=r[e];if(Lb(n)){const e={nameLocaleReference:"INSIGHTS",categoryLocaleReference:"INSIGHTS",parentCategoryLocaleReference:"INSIGHTS"},r=n.definedOnClassIDs;if("string"==typeof r){const a=r.split(":").reverse(),o="string"==typeof n.fieldID?n.fieldID:"",i=o.split("!").pop()?.split(":").reverse()||[];a[0]&&i[0]&&(e.nameLocaleReference=t(i[0],a[0])),a[1]&&i[1]&&(e.categoryLocaleReference=t(i[1],a[1])),a[2]&&i[2]?e.parentCategoryLocaleReference=t(i[2],a[2]):n.parentCategory&&(e.parentCategoryLocaleReference=s)}Object.assign(n,e)}}return{data:e}}const jb={getDataObjects:function(){const e=Ch.getAppCacheKey(Pb);if(Db.getItem(e))return Promise.resolve(JSON.parse(`${Db.getItem(e)}`));const{restApi:t,reqType:n}=i_(Pb,{}),s=Wd(t,{method:n});return s.then((t=>{Db.setItem(e,JSON.stringify(t))})),s},getDataPageObjects:function(e=!0){if(bb)return bb;const t=Ch.getAppCacheKey("getDataPageObjects");if(e&&Db.getItem(t))return Promise.resolve(JSON.parse(`${Db.getItem(t)}`));const{restApi:n,reqType:s}=i_("getDataPages",{datapageRequestType:"explorable"});return bb=Wd(n,{method:s,datapageRequestType:"explorable"}),bb.then((e=>{bb=null,Db.setItem(t,JSON.stringify(e))})),bb},getDataViewMetadata:function(e,t,n){if(!t){const{sourceMetadata:t,sourceFields:n}=function(e){const t=yC(e);if(t&&t.classID){let e=SC(t.classID);const n=t.rdFields,s=(n&&!Array.isArray(n)?n.fields:void 0)?.filter((e=>e.indexOf(".")>0));if(s&&!rS.isEmpty(s)){const n=s.reduce(((e,n)=>{const s=lC(n,t.classID);var r;return s&&"type"in(r=s)&&"classID"in r&&(e[n]=s),e}),{});e={...e,...n}}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&&Rb.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={...t,fields:Object.entries(n).map(Ub)};if(Lb(s=e)&&"string"==typeof s.classID&&Array.isArray(s.fields)){const t=Fb({data:e});return Promise.resolve(t)}}}var s;const r={dataSource:e,columns:[],parameters:{},associationFilter:n,matchPosition:"",ignoreCase:!1};return yf.init(r).then((({dataSourceMetaData:e})=>e?Fb({data:e}):{data:{classID:"",className:"",isQueryable:!1,fields:[]}}))},getDefaultColumns:function(e){const t=Ch.getAppCacheKey(`DefaultColumns_${Object.values(e).join("_")}`);if(Db.getItem(t))return Promise.resolve(JSON.parse(`${Db.getItem(t)}`));const n={dataViewName:Ls.getDefaultQualifiedName("D_pzGetDefaultColumns")},{restApi:s,reqType:r}=i_("getListData",n),a=Wd(s,{method:r,body:{dataViewParameters:e}});return a.then((e=>{Db.setItem(t,JSON.stringify(e))})),a},getFieldsForDataSource:function(e,t,n){if(!t){const t=yC(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 s=Ch.getAppCacheKey(`RDColumns-${e}`);if(Db.getItem(s))return Promise.resolve(JSON.parse(`${Db.getItem(s)}`));const r=Ch.getData(Ls.getDefaultQualifiedName("D_pxFieldsForDataSource"),{dataViewParameters:{DataPageName:e}},n);return r.then((e=>{Db.setItem(s,JSON.stringify(e))})),r},getPrimaryFieldsForDataSource:function(e="",t=""){const n=Ch.getAppCacheKey(`PFColumns-${e}${t}`);if(Db.getItem(n))return Promise.resolve(JSON.parse(`${Db.getItem(n)}`));const s=Ch.getData(Ls.getDefaultQualifiedName("D_pxGetInitialFieldsForDataSource"),{dataViewParameters:{DataPageName:e,ClassName:t}});return s.then((e=>{Db.setItem(n,JSON.stringify(e))})),s},getPrimaryFieldsForInsights:async function(e,t,n,s){const{allClasses:r,promisesToAwait:a,classesToFetch:o,isTopLevelClassPresent:i,joinedClassesToFetch:c}=function(e,t){const n=[],s=[];let r=!1;const a=[],o=[];return e&&o.push(e),t&&t.length>0&&o.push(...t),o.forEach((t=>{const o=wb(t);if(Db.getItem(o))return;const i=xb[t];i?s.push(i):(n.push(t),t===e?r=!0:a.push(t))})),{allClasses:o,promisesToAwait:s,classesToFetch:n,isTopLevelClassPresent:r,joinedClassesToFetch:a}}(e,n);return o.length&&a.push((async(e,t,n,s,r)=>{const a=Ch.getData(Ls.getDefaultQualifiedName("D_pxGetPrimaryFieldsForInsights"),{dataViewParameters:{...t&&{topLevelClassID:t},...s&&{joinedClassIDs:s.join(",")},...n&&{topLevelDataPageID:n}}},r).then((t=>{const n=t.data?.data||[],s={};e.forEach((e=>{s[e]=[]})),n.forEach((e=>{const t=e.classID,n=e[Ls.getDefaultQualifiedName("pyFieldName")];s[t].push(n)})),Object.entries(s).forEach((([e,t])=>{const n=wb(e);Db.setItem(n,JSON.stringify(t))}))})).finally((()=>{e.forEach((e=>{delete xb[e]}))}));return e.forEach((e=>{xb[e]=a})),a})(o,i?e:void 0,i?t:void 0,c.length>0?c:void 0,s)),Promise.allSettled(a).then((()=>{const e={};return r.forEach((t=>{const n=wb(t);if(Db.getItem(n))try{e[t]=JSON.parse(`${Db.getItem(n)}`)}catch{}})),{data:e}}))},getInsightIDs:function(){const{restApi:e,reqType:t}=i_("getInsightIDs");return Wd(e,{method:t})},getInsightByID:function(e){const t=CC(e);if(t)return Promise.resolve({data:{pyInsights:[t]}});const n={insightID:e},{restApi:s,reqType:r}=i_(Ob,n);return Wd(s,{method:r})},getInsightsByID:function(e){const t={insightID:e.join(",")},{restApi:n,reqType:s}=i_(Ob,t);return Wd(n,{method:s})},loadClassResources:async e=>{const t=e.filter((e=>!vb.includes(e)));if(0===t.length)return;const n={classIDs:e.join(",")},{restApi:s,reqType:r}=i_("getClassResources",n);return Wd(s,{method:r}).then((e=>{e.data.resources&&(vb.push(...t),Kp(e.data.resources))}))},createInsight:function(e){const{restApi:t,reqType:n}=i_("createInsight");return Wd(t,{method:n,body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})},updateInsight:function(e,t){const n={insightID:e},{restApi:s,reqType:r}=i_("updateInsight",n);let a;return"UpdateDateTime"in t&&(a=t.UpdateDateTime),Wd(s,{method:r,body:JSON.stringify(t),headers:{"if-match":a,"Content-Type":"application/json"}})},deleteInsight:function(e){const t={insightID:e},{restApi:n,reqType:s}=i_("deleteInsight",t);return Wd(n,{method:s})},exportToExcel:function(e){const{restApi:t,reqType:n}=i_("exportToExcel");return Wd(t,{method:n,body:JSON.stringify(e)})},exportToCSV:function(e){const{restApi:t,reqType:n}=i_("exportToCSV");return Wd(t,{method:n,body:JSON.stringify(e)})},scheduleInsight:(e,t)=>{const n={insightID:e},{restApi:s,reqType:r}=i_("scheduleInsight",n);return Wd(s,{method:r,body:JSON.stringify(t)})},updateScheduledInsight:(e,t,n)=>{const s={insightID:e,scheduleID:t},{restApi:r,reqType:a}=i_("updateScheduledInsight",s);return Wd(r,{method:a,body:JSON.stringify(n)})},deleteScheduledInsight:(e,t)=>{const n={insightID:e,scheduleID:t},{restApi:s,reqType:r}=i_("deleteScheduledInsight",n);return Wd(s,{method:r})},translateStrings:function(e){const{restApi:t,reqType:n}=i_("translateStrings");return Wd(t,{method:n,body:JSON.stringify(e)})}};const Vb=new class{addRoutes=e=>{return t=e,void TA.addRoutes(t);var t}};const kb=class{static registerModule(e,t,n){n[e]=()=>t}};const Bb=class{static getCaseEvent=()=>Object.freeze(Fs.PUB_SUB_EVENTS.CASE_EVENTS);static getDataEvent=()=>Object.freeze(Fs.PUB_SUB_EVENTS.DATA_EVENTS);static getTransientEvent=()=>Object.freeze(Fs.PUB_SUB_EVENTS.EVENT_TRANSIENT_ITEMS);static getBootstrapShellEvent=()=>Object.freeze(Fs.PUB_SUB_EVENTS.BOOTSTRAP_SHELL_EVENTS);static getBulkProcessEvent=()=>Object.freeze(Fs.PUB_SUB_EVENTS.EVENT_BULKACTION);static getLocalActionProcessEvent=()=>Object.freeze(Fs.PUB_SUB_EVENTS.EVENT_LOCALACTION_SUBMISSION)};const $b=new class{constructor(){this.genericFailedMessage="Failed to display content. Contact the application administrator."}getGenericFailedMessage(){return this.genericFailedMessage}setGenericFailedMessage(e){this.genericFailedMessage=e}},Gb={setTokens:e=>{Qd({tokenInfo:e}),Kd(e?.csrf&&!e?.access_token?{pzCTkn:e?.csrf}:{Authorization:`${e?.token_type} ${e?.access_token}`}),setTimeout((()=>fd.publish("updateSession",{updateStatus:"success"})),0)},revokeTokens:async()=>Ad(),getAuthInstance:e=>yd.init(e),setAuthorizationHeader:e=>{Kd({Authorization:e}),setTimeout((()=>fd.publish("updateSession",{updateStatus:"success"})),0)}};const Wb=new class{getDebouncedSubject(e){return(new rh).pipe(bO(e))}},Hb=(()=>{const e="[!#-'*+/0-9=?A-Z\\^_`a-z{|}~\\-]+",t="\\\\[\\x00-\\x7f]",n=`(?:${e}|${`"(?:[^\\r"\\\\\\x80-\\xff]|${t})*"`})`,s=`(?:${e}|${`\\[(?:[^\\r\\[\\]\\\\\\x80-\\xff]|${t})*\\]`})`;return new RegExp(`^${`${n}(?:\\.${n})*`}@${`${s}(?:\\.${s})*`}$`)})();const qb=(()=>{const e="[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+";return new RegExp(`^${`${`(?:${`${e}(?:\\.${e})*`}|"(?:[^\\x0d\\x22\\x5c]|\\\\[\\x00-\\x7f])+")`}@(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\\.)+[A-Za-z]{2,63}`}$`)})();Yp.register("email",((e,{useRFC822Validation:t})=>{let n=null;const s=t?(r=e,Hb.test(r)):function(e){return qb.test(e)}(e);var r;return e&&!s&&(n="Enter a valid email address"),n})),Yp.register("integer",(e=>{let t=null;return e&&!/^(-)?\d+$/.test(e)&&(t="Invalid number"),t})),Yp.register("required",(e=>Array.isArray(e)&&0===e.length||null==e||""===e?"Cannot be blank":null)),Yp.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";r.e(667).then(r.bind(r,816)).then((({parsePhoneNumberFromString:t})=>{Yp.register("phone",(n=>{let s=null;n&&!/^\+?\d+$/.test(n)&&(s=e);const r=n?.startsWith("+");if(n&&r){const r=t(n);r&&r.isPossible()&&n===r.number||(s=e)}return s}))}))}),js.PRIORITY.TRIVIAL);const zb=(e,t)=>{switch(t){case"invalid":return`Incorrect ${e}`;case"incomplete":return`Incomplete ${e}`;default:return null}};Yp.register("datetime",(e=>zb("date and time",e))),Yp.register("date",(e=>zb("date",e))),Yp.register("time",(e=>zb("time",e)));const Yb=e=>{for(const t of e)if(t?.error)return"Error with one or more files";return null};Yp.register("attachment",(e=>{let t=null;return e?("pyCount"in e&&Array.isArray(e.pxResults)?t=Yb(e.pxResults):Array.isArray(e)?t=Yb(e):"error"in e&&e.error&&(t="Error with one or more files"),t):t}));const Kb=()=>{const e={},t="undefined"!=typeof Intl?Intl.DateTimeFormat().resolvedOptions().timeZone:void 0;t&&(e["user-timezone"]=t);const n="undefined"!=typeof navigator?navigator.language:void 0;return n&&(e["user-locale"]=n),e},Qb="createConversation",Jb="sendMessage",Xb="getConversations",Zb="getMessages",ev="createConversationForAgent",tv="sendMessageForAgent",nv="getCoach",sv=(e,t,n,s,r,a,o)=>{for(const e of o)e?.cancel&&"function"==typeof e.cancel&&e.cancel();const i=rg();return o.push(i),tg(e,{queryPayload:Xb===e?{assistantID:t,contextID:n,pageSize:s,pageIndex:r}:{agentID:t,contextID:n,pageSize:s,pageIndex:r},cancelTokenSource:i,headers:Kb()},a).then((e=>(o.pop(),e)))},rv=(e,t,n,s,r)=>{for(const e of r)e?.cancel&&"function"==typeof e.cancel&&e.cancel();const a=rg();return r.push(a),tg(e,{queryPayload:Zb===e?{assistantID:t,conversationID:n}:{agentID:t,conversationID:n},cancelTokenSource:a,headers:Kb()},s).then((e=>(r.pop(),e)))},av=(e,t,n,s,r,a,o=!1)=>{for(const e of r)e?.cancel&&"function"==typeof e.cancel&&e.cancel();const i=rg();return r.push(i),tg(e,{body:JSON.stringify({contextID:t,executeStarterQuestion:!1,...a&&a.isManualConfirmationSupported&&{capabilities:{tools:{isManualConfirmationSupported:!0}}},...e===ev&&o&&{showAgentRecommendations:o}}),cancelTokenSource:i,queryPayload:e===Qb?{assistantID:n}:{agentID:n},headers:Kb()},s).then((e=>(r.pop(),e)))},ov=(e,t,n,s,r,a,o)=>{const i={...s&&{request:s},...o&&o.additionalInstruction&&{additionalInstruction:o.additionalInstruction},...o&&o.isManualConfirmationSupported&&{capabilities:{tools:{isManualConfirmationSupported:!0}}},...o&&o.toolsReviewed&&o.toolsReviewed.length>0&&{toolsReviewed:o.toolsReviewed},...a&&a?.length>0&&{attachments:a}};return tg(e,{body:JSON.stringify(i),queryPayload:e===Jb?{assistantID:t,conversationID:n}:{agentID:t,conversationID:n},headers:Kb()},r)},iv=(e,t,n,s,r,a,o,i)=>{const c={...s&&{request:s},...o&&o.additionalInstruction&&{additionalInstruction:o.additionalInstruction},...a&&a.length>0&&{attachments:a},...o&&o.toolsReviewed&&o.toolsReviewed.length>0&&{toolsReviewed:o.toolsReviewed},capabilities:{stream:{isEnabled:!0},...o&&o.isManualConfirmationSupported&&{tools:{isManualConfirmationSupported:!0}}},...o&&o.questionnaire&&{questionnaire:o.questionnaire}},l=e===Jb?{assistantID:t,conversationID:n}:{agentID:t,conversationID:n},{restApi:u,reqType:d}=i_(e,l),p={method:d,headers:{Accept:"text/event-stream",...Kb()},body:JSON.stringify(c),responseType:"stream",adapter:"fetch",...i&&{signal:i.token}};return Wd(u,p,r)},cv=(e,t,n,s,r)=>{for(const e of s)e?.cancel&&"function"==typeof e.cancel&&e.cancel();const a=rg();return s.push(a),tg(e,{queryPayload:e===nv?{assistantID:t,...r&&{contextID:r}}:{agentID:t,...r&&{contextID:r}},cancelTokenSource:a},n).then((e=>(s.pop(),e))).catch((e=>{throw s.pop(),e}))},lv={createConversation:(e,t,n,s=[])=>av(Qb,e,t,n,s),sendMessage:(e,t,n,s,r)=>r?.enableStreaming?iv(Jb,e,t,n,s,void 0,r):ov(Jb,e,t,n,s),createConversationForAgent:(e,t,n,s=[],r,a)=>av(ev,e,t,n,s,r,a),sendMessageForAgent:(e,t,n,s,r,a)=>a?.enableStreaming?iv(tv,e,t,n,s,r,a,a.cancelTokenSource):ov(tv,e,t,n,s,r,a),getAgent:(e,t,n,s=[])=>cv("getAgent",e,t,s,n),getCoach:(e,t,n,s=[])=>cv(nv,e,t,s,n),likeAgentMessage:(e,t,n,s)=>{const r={queryPayload:{agentID:e,conversationID:t,messageID:n},headers:Kb()};return tg("likeAgentMessage",r,s)},unLikeAgentMessage:(e,t,n,s,r="")=>{const a={queryPayload:{agentID:e,conversationID:t,messageID:n},body:JSON.stringify({feedbackText:r}),headers:Kb()};return tg("dislikeAgentMessage",a,s)},getConversations:(e,t,n,s,r,a=[])=>sv(Xb,e,t,n,s,r,a),getConversationsForAgent:(e,t,n,s,r,a=[])=>sv("getConversationsForAgent",e,t,n,s,r,a),getMessages:(e,t,n,s=[])=>rv(Zb,e,t,n,s),getMessagesForAgent:(e,t,n,s=[])=>rv("getMessagesForAgent",e,t,n,s)};const uv=new class{async rewriteText(e){const{originalText:t,rewriteAction:n,additionalInstructions:s,context:r}=e,a=PA.isInfinityRuntime(),o=PA.getRewriteGenAIDP()??Ls.getDefaultQualifiedName("D_RewriteWithAI"),i={OriginalText:t,RewriteAction:n,AdditionalInstructions:s||""};try{let e,t;if(a){const t=await af.getPageDataAsync(o,r,i),n=Object.fromEntries(Object.entries(t)).pyResponseData;e="string"==typeof n?n:void 0}else{const n=(await af.getDataAsync(o,r,i)).data[0],s=n[Ls.getDefaultQualifiedName("Content")];e="string"==typeof s?s:void 0;const a=n[Ls.getDefaultQualifiedName("ErrorMessage")];t="string"==typeof a?a:void 0}return e?{success:!0,rewrittenText:e}:{success:!1,errorMessage:t||"AI rewrite failed: No rewritten text returned"}}catch(e){return{success:!1,errorMessage:e instanceof Error?e.message:"An unexpected error occurred during AI rewrite"}}}};const dv=class{classAccessMap=new Map;constructor(){const e=PA.getClassesAccessList();0!==e.length?this.classAccessMap=e.reduce(((e,t)=>(e.set(t.pyClassName,t.pyHasCreateAccess),e)),new Map):this.classAccessMap=PA.getCaseTypeList().reduce(((e,t)=>(e.set(t.pyWorkTypeImplementationClassName,t.hasCreateAccess??!0),e)),new Map)}hasCreateAccess(e){return this.classAccessMap.get(e)}static getInstance(){return this.instance||(this.instance=new this),this.instance}};const pv=class{static AUTOSAVE_SAVE_STATUS=DE;static isAutosaveEnabledForContext(e){return GE(e)}static subscribeAutosaveStatus(e,t){return((e,t)=>{let n=xE.get(e);return n||(n=new Set,xE.set(e,n)),n.add(t),()=>{const n=xE.get(e);n&&(n.delete(t),0===n.size&&xE.delete(e))}})(e,t)}static notifyChange(e,t,n){GE(e)&&(((e,t,n)=>{let s=wE.get(e);s||(s=new Map,wE.set(e,s)),s.set(t,n)})(e,t,n),zE(e))}};class gv{static behaviorOverrides={};getPersonalizationUtils=Tb;constructor(){gv.behaviorOverrides={}}getPCoreVersion=()=>"26.1.2";onPCoreReady=e=>JR.onPCoreReady(e);onPCoreCleanup=e=>JR.onPCoreCleanup(e);getComponentsRegistry=()=>JR.getComponentsRegistry();checkIfSemanticURL=()=>JR.checkIfSemanticURL();isValidSemanticURL=()=>(()=>{if(A_()){const e=TA.processUrl(CA(),!0);return!!TA._getMatchedRouteInRoutingTable(e)}return!1})();getRoutingUtils=()=>Vb;getViewResources=()=>i;configureForBrowserBookmark=e=>JR.configureForBrowserBookmark(e);getStore=()=>kC();resetStore=()=>tS();getMessageManager=()=>pd;getCoexistenceManager=()=>GR;getStoreValue=(e,t,n)=>HC(e,t,n);getContainerUtils=()=>c;getAnnotationUtils=()=>zg;getFieldUtils=()=>ep;getFieldDefaultUtils=()=>bp;getAssetLoader=()=>hg;getAttachmentUtils=()=>Bp;getViewRuleApi=()=>sb;getFeedUtils=()=>db;getTagUtils=()=>pb;getGenAIAssistantUtils=()=>lv;getGenAIUtils=()=>uv;getStakeholderUtils=()=>hb;getUserApi=()=>cb;getCaseFollowerApi=()=>ab;getCaseUtils=()=>YI;getStateUtils=()=>Hf;getRelatedCasesApi=()=>ob;getDataApi=()=>yf;getDataApiUtils=()=>Ch;getAnalyticsUtils=()=>jb;getLocaleUtils=e=>{const t=e??PA.getLocale()??"en-US";return iC(t)};registerLocaleManager=e=>{const t=this.getLocaleUtils();Object.keys(e).forEach((n=>{t[n]=e[n]}))};setBehaviorOverrides=e=>{gv.behaviorOverrides=e};setBehaviorOverride=(e,t)=>{gv.behaviorOverrides[e]=t};getBehaviorOverrides=()=>gv.behaviorOverrides;getBehaviorOverride=e=>gv.behaviorOverrides[e];getAsynchronousUtils=()=>Wb;createPConnect=e=>Cm(e);getPubSubUtils=()=>fd;registerComponentCreator=e=>{Sm(e)};getConstants=()=>Object.freeze(Fs);getResolvedConstantValue=e=>js.getProperty(e);getEvents=()=>Bb;getRestClient=()=>o;getMashupApi=()=>WR;getEnvironmentInfo=()=>PA;switchLocale=e=>jR(e);getRuntimeParamsAPI=()=>Tf;getSemanticUrlUtils=()=>bg;getRemoteCaseUtils=()=>Bs;getNavigationUtils=()=>Ng;registerModule=(e,t)=>kb.registerModule(e,t,this);getErrorHandler=()=>$b;getFormUtils=()=>bI;getAutosaveUtils=()=>pv;getMessagingServiceManager=()=>sf;getMetadataUtils=()=>l;getDataPageUtils=()=>af;getDataTypeUtils=()=>qg;getCascadeManager=()=>UC;isDeepEqual=(e,t)=>Xt(e,t);getAuthUtils=()=>Gb;getDebugger=()=>Id;getDeferLoadManager=()=>yh;getExpressionEngine=()=>n;getActionsSequencer=()=>xf;getRefreshManager=()=>Cf;getInitialiser=()=>nb;getBootstrapUtils=()=>JR;getContextTreeManager=()=>Zu;getAccessPrivilege=()=>dv.getInstance();getObjectTransformer=()=>Us;getAllStateMachines=(e,t,n)=>t&&n?vI.getAllStateMachines(e,t,n):vI.getAllStateMachinesByContext(e);isNamespaceEnabled=()=>Ls.isNamespaceEnabled();getQualifiedName=(e,t)=>Ls.getQualifiedName(e,t);getDefaultQualifiedName=e=>this.getQualifiedName(e,"PegaPlatform");getNameSpaceUtils=()=>Ls;getNetworkUtils=()=>md;getMashupBridge=()=>p;getConfirmDialogService=()=>Zm}const hv=new gv;globalThis.PCore=hv})()})();
2
2
  //# sourceMappingURL=constellation-core-web.js.map