@pega/constellationjs 24.2.3 → 24.2.4

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.
@@ -1,2 +1,2 @@
1
- (()=>{var e,t,n={851:(e,t,n)=>{"use strict";var r=n(681);Object.defineProperty(t,"reduxBatch",{enumerable:!0,get:function(){return r.reduxBatch}})},681:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reduxBatch=function(e){var t=[],n=void 0;function r(){t===n&&(t=t.slice())}function s(e){if("function"!=typeof e)throw new Error("Invalid listener, expected a function");var n=!0;return r(),t.push(e),function(){n&&(r(),t.splice(t.indexOf(e),1),n=!1)}}function a(){for(var e=t,r=0;r<e.length;++r)n=e,e[r]()}return function(){var t=e.apply(void 0,arguments),n=!1,r=!1;function o(e){return Array.isArray(e)?e.map((function(e){return o(e)})):t.dispatch(e)}return t.subscribe((function(){r?n=!0:a()})),Object.assign({},t,{dispatch:function(e){var t=r;t||(n=!1,r=!0);var s=o(e),i=n&&!t;return t||(n=!1,r=!1),i&&a(),s},subscribe:s})}}},52:(e,t,n)=>{e.exports=n(851)},631:(e,t,n)=>{var r="__lodash_hash_undefined__",s=9007199254740991,a="[object Arguments]",o="[object Function]",i="[object GeneratorFunction]",c=/^\[object .+?Constructor\]$/,l="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,u="object"==typeof self&&self&&self.Object===Object&&self,d=l||u||Function("return this")();function p(e,t){return!!(e?e.length:0)&&function(e,t,n){if(t!=t)return function(e,t,n,r){var s=e.length,a=n+(r?1:-1);for(;r?a--:++a<s;)if(t(e[a],a,e))return a;return-1}(e,f,n);var r=n-1,s=e.length;for(;++r<s;)if(e[r]===t)return r;return-1}(e,t,0)>-1}function h(e,t,n){for(var r=-1,s=e?e.length:0;++r<s;)if(n(t,e[r]))return!0;return!1}function g(e,t){for(var n=-1,r=t.length,s=e.length;++n<r;)e[s+n]=t[n];return e}function f(e){return e!=e}function m(e,t){return e.has(t)}var y,I=Array.prototype,E=Function.prototype,A=Object.prototype,_=d["__core-js_shared__"],C=(y=/[^.]+$/.exec(_&&_.keys&&_.keys.IE_PROTO||""))?"Symbol(src)_1."+y:"",S=E.toString,T=A.hasOwnProperty,N=A.toString,P=RegExp("^"+S.call(T).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),R=d.Symbol,D=A.propertyIsEnumerable,b=I.splice,O=R?R.isConcatSpreadable:void 0,v=Math.max,x=G(d,"Map"),w=G(Object,"create");function M(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function L(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function U(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function F(e){var t=-1,n=e?e.length:0;for(this.__data__=new U;++t<n;)this.add(e[t])}function j(e,t){for(var n,r,s=e.length;s--;)if((n=e[s][0])===(r=t)||n!=n&&r!=r)return s;return-1}function V(e,t,n,r){var s,a=-1,o=p,i=!0,c=e.length,l=[],u=t.length;if(!c)return l;n&&(t=function(e,t){for(var n=-1,r=e?e.length:0,s=Array(r);++n<r;)s[n]=t(e[n],n,e);return s}(t,(s=n,function(e){return s(e)}))),r?(o=h,i=!1):t.length>=200&&(o=m,i=!1,t=new F(t));e:for(;++a<c;){var d=e[a],g=n?n(d):d;if(d=r||0!==d?d:0,i&&g==g){for(var f=u;f--;)if(t[f]===g)continue e;l.push(d)}else o(t,g,r)||l.push(d)}return l}function k(e,t,n,r,s){var a=-1,o=e.length;for(n||(n=W),s||(s=[]);++a<o;){var i=e[a];t>0&&n(i)?t>1?k(i,t-1,n,r,s):g(s,i):r||(s[s.length]=i)}return s}function $(e){if(!Q(e)||(t=e,C&&C in t))return!1;var t,n=J(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?P:c;return n.test(function(e){if(null!=e){try{return S.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function B(e,t){var n,r,s=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?s["string"==typeof t?"string":"hash"]:s.map}function G(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return $(n)?n:void 0}function W(e){return z(e)||function(e){return X(e)&&T.call(e,"callee")&&(!D.call(e,"callee")||N.call(e)==a)}(e)||!!(O&&e&&e[O])}M.prototype.clear=function(){this.__data__=w?w(null):{}},M.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},M.prototype.get=function(e){var t=this.__data__;if(w){var n=t[e];return n===r?void 0:n}return T.call(t,e)?t[e]:void 0},M.prototype.has=function(e){var t=this.__data__;return w?void 0!==t[e]:T.call(t,e)},M.prototype.set=function(e,t){return this.__data__[e]=w&&void 0===t?r:t,this},L.prototype.clear=function(){this.__data__=[]},L.prototype.delete=function(e){var t=this.__data__,n=j(t,e);return!(n<0)&&(n==t.length-1?t.pop():b.call(t,n,1),!0)},L.prototype.get=function(e){var t=this.__data__,n=j(t,e);return n<0?void 0:t[n][1]},L.prototype.has=function(e){return j(this.__data__,e)>-1},L.prototype.set=function(e,t){var n=this.__data__,r=j(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},U.prototype.clear=function(){this.__data__={hash:new M,map:new(x||L),string:new M}},U.prototype.delete=function(e){return B(this,e).delete(e)},U.prototype.get=function(e){return B(this,e).get(e)},U.prototype.has=function(e){return B(this,e).has(e)},U.prototype.set=function(e,t){return B(this,e).set(e,t),this},F.prototype.add=F.prototype.push=function(e){return this.__data__.set(e,r),this},F.prototype.has=function(e){return this.__data__.has(e)};var H,q,Y=(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 z=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=Y},188:(e,t,n)=>{var r="__lodash_hash_undefined__",s=1/0,a="[object Function]",o="[object GeneratorFunction]",i="[object Symbol]",c=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,l=/^\w*$/,u=/^\./,d=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,p=/\\(\\)?/g,h=/^\[object .+?Constructor\]$/,g="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,f="object"==typeof self&&self&&self.Object===Object&&self,m=g||f||Function("return this")();var y,I=Array.prototype,E=Function.prototype,A=Object.prototype,_=m["__core-js_shared__"],C=(y=/[^.]+$/.exec(_&&_.keys&&_.keys.IE_PROTO||""))?"Symbol(src)_1."+y:"",S=E.toString,T=A.hasOwnProperty,N=A.toString,P=RegExp("^"+S.call(T).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),R=m.Symbol,D=I.splice,b=k(m,"Map"),O=k(Object,"create"),v=R?R.prototype:void 0,x=v?v.toString:void 0;function w(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function M(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function L(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function U(e,t){for(var n,r,s=e.length;s--;)if((n=e[s][0])===(r=t)||n!=n&&r!=r)return s;return-1}function F(e,t){var n;t=function(e,t){if(W(e))return!1;var n=typeof e;if("number"==n||"symbol"==n||"boolean"==n||null==e||q(e))return!0;return l.test(e)||!c.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:W(n=t)?n:$(n);for(var r=0,s=t.length;null!=e&&r<s;)e=e[B(t[r++])];return r&&r==s?e:void 0}function j(e){if(!H(e)||(t=e,C&&C in t))return!1;var t,n=function(e){var t=H(e)?N.call(e):"";return t==a||t==o}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?P:h;return n.test(function(e){if(null!=e){try{return S.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function V(e,t){var n,r,s=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?s["string"==typeof t?"string":"hash"]:s.map}function k(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return j(n)?n:void 0}w.prototype.clear=function(){this.__data__=O?O(null):{}},w.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},w.prototype.get=function(e){var t=this.__data__;if(O){var n=t[e];return n===r?void 0:n}return T.call(t,e)?t[e]:void 0},w.prototype.has=function(e){var t=this.__data__;return O?void 0!==t[e]:T.call(t,e)},w.prototype.set=function(e,t){return this.__data__[e]=O&&void 0===t?r:t,this},M.prototype.clear=function(){this.__data__=[]},M.prototype.delete=function(e){var t=this.__data__,n=U(t,e);return!(n<0)&&(n==t.length-1?t.pop():D.call(t,n,1),!0)},M.prototype.get=function(e){var t=this.__data__,n=U(t,e);return n<0?void 0:t[n][1]},M.prototype.has=function(e){return U(this.__data__,e)>-1},M.prototype.set=function(e,t){var n=this.__data__,r=U(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},L.prototype.clear=function(){this.__data__={hash:new w,map:new(b||M),string:new w}},L.prototype.delete=function(e){return V(this,e).delete(e)},L.prototype.get=function(e){return V(this,e).get(e)},L.prototype.has=function(e){return V(this,e).has(e)},L.prototype.set=function(e,t){return V(this,e).set(e,t),this};var $=G((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(q(e))return x?x.call(e):"";var t=e+"";return"0"==t&&1/e==-s?"-0":t}(t);var n=[];return u.test(e)&&n.push(""),e.replace(d,(function(e,t,r,s){n.push(r?s.replace(p,"$1"):t||e)})),n}));function B(e){if("string"==typeof e||q(e))return e;var t=e+"";return"0"==t&&1/e==-s?"-0":t}function G(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,s=t?t.apply(this,r):r[0],a=n.cache;if(a.has(s))return a.get(s);var o=e.apply(this,r);return n.cache=a.set(s,o),o};return n.cache=new(G.Cache||L),n}G.Cache=L;var W=Array.isArray;function H(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function q(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&N.call(e)==i}e.exports=function(e,t,n){var r=null==e?void 0:F(e,t);return void 0===r?n:r}},928:(e,t,n)=>{var r="__lodash_hash_undefined__",s=1/0,a=9007199254740991,o="[object Arguments]",i="[object Function]",c="[object GeneratorFunction]",l="[object Symbol]",u=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,d=/^\w*$/,p=/^\./,h=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,g=/\\(\\)?/g,f=/^\[object .+?Constructor\]$/,m=/^(?:0|[1-9]\d*)$/,y="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,I="object"==typeof self&&self&&self.Object===Object&&self,E=y||I||Function("return this")();var A,_=Array.prototype,C=Function.prototype,S=Object.prototype,T=E["__core-js_shared__"],N=(A=/[^.]+$/.exec(T&&T.keys&&T.keys.IE_PROTO||""))?"Symbol(src)_1."+A:"",P=C.toString,R=S.hasOwnProperty,D=S.toString,b=RegExp("^"+P.call(R).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),O=E.Symbol,v=S.propertyIsEnumerable,x=_.splice,w=W(E,"Map"),M=W(Object,"create"),L=O?O.prototype:void 0,U=L?L.toString:void 0;function F(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function j(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function V(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function k(e,t){for(var n,r,s=e.length;s--;)if((n=e[s][0])===(r=t)||n!=n&&r!=r)return s;return-1}function $(e,t){return null!=e&&R.call(e,t)}function B(e){if(!Q(e)||(t=e,N&&N in t))return!1;var t,n=X(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?b:f;return n.test(function(e){if(null!=e){try{return P.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function G(e,t){var n,r,s=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?s["string"==typeof t?"string":"hash"]:s.map}function W(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return B(n)?n:void 0}function H(e,t,n){var r;t=function(e,t){if(K(e))return!1;var n=typeof e;if("number"==n||"symbol"==n||"boolean"==n||null==e||ee(e))return!0;return d.test(e)||!u.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:K(r=t)?r:q(r);for(var s,i=-1,c=t.length;++i<c;){var l=Y(t[i]);if(!(s=null!=e&&n(e,l)))break;e=e[l]}return s||!!(c=e?e.length:0)&&J(c)&&function(e,t){return t=null==t?a:t,!!t&&("number"==typeof e||m.test(e))&&e>-1&&e%1==0&&e<t}(l,c)&&(K(e)||function(e){return function(e){return Z(e)&&function(e){return null!=e&&J(e.length)&&!X(e)}(e)}(e)&&R.call(e,"callee")&&(!v.call(e,"callee")||D.call(e)==o)}(e))}F.prototype.clear=function(){this.__data__=M?M(null):{}},F.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},F.prototype.get=function(e){var t=this.__data__;if(M){var n=t[e];return n===r?void 0:n}return R.call(t,e)?t[e]:void 0},F.prototype.has=function(e){var t=this.__data__;return M?void 0!==t[e]:R.call(t,e)},F.prototype.set=function(e,t){return this.__data__[e]=M&&void 0===t?r:t,this},j.prototype.clear=function(){this.__data__=[]},j.prototype.delete=function(e){var t=this.__data__,n=k(t,e);return!(n<0)&&(n==t.length-1?t.pop():x.call(t,n,1),!0)},j.prototype.get=function(e){var t=this.__data__,n=k(t,e);return n<0?void 0:t[n][1]},j.prototype.has=function(e){return k(this.__data__,e)>-1},j.prototype.set=function(e,t){var n=this.__data__,r=k(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},V.prototype.clear=function(){this.__data__={hash:new F,map:new(w||j),string:new F}},V.prototype.delete=function(e){return G(this,e).delete(e)},V.prototype.get=function(e){return G(this,e).get(e)},V.prototype.has=function(e){return G(this,e).has(e)},V.prototype.set=function(e,t){return G(this,e).set(e,t),this};var q=z((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 Y(e){if("string"==typeof e||ee(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||V),n}z.Cache=V;var K=Array.isArray;function X(e){var t=Q(e)?D.call(e):"";return t==i||t==c}function J(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=a}function Q(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Z(e){return!!e&&"object"==typeof e}function ee(e){return"symbol"==typeof e||Z(e)&&D.call(e)==l}e.exports=function(e,t){return null!=e&&H(e,t,$)}},529:(e,t,n)=>{e=n.nmd(e);var r=9007199254740991,s="[object Arguments]",a="[object Function]",o="[object GeneratorFunction]",i="[object Map]",c="[object Promise]",l="[object Set]",u="[object WeakMap]",d="[object DataView]",p=/^\[object .+?Constructor\]$/,h="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,g="object"==typeof self&&self&&self.Object===Object&&self,f=h||g||Function("return this")(),m=t&&!t.nodeType&&t,y=m&&e&&!e.nodeType&&e,I=y&&y.exports===m;var E,A,_,C=Function.prototype,S=Object.prototype,T=f["__core-js_shared__"],N=(E=/[^.]+$/.exec(T&&T.keys&&T.keys.IE_PROTO||""))?"Symbol(src)_1."+E:"",P=C.toString,R=S.hasOwnProperty,D=S.toString,b=RegExp("^"+P.call(R).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),O=I?f.Buffer:void 0,v=S.propertyIsEnumerable,x=O?O.isBuffer:void 0,w=(A=Object.keys,_=Object,function(e){return A(_(e))}),M=q(f,"DataView"),L=q(f,"Map"),U=q(f,"Promise"),F=q(f,"Set"),j=q(f,"WeakMap"),V=!v.call({valueOf:1},"valueOf"),k=z(M),$=z(L),B=z(U),G=z(F),W=z(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(z(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 Y=function(e){return D.call(e)};function z(e){if(null!=e){try{return P.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function K(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&J(e)}(e)&&R.call(e,"callee")&&(!v.call(e,"callee")||D.call(e)==s)}(M&&Y(new M(new ArrayBuffer(1)))!=d||L&&Y(new L)!=i||U&&Y(U.resolve())!=c||F&&Y(new F)!=l||j&&Y(new j)!=u)&&(Y=function(e){var t=D.call(e),n="[object Object]"==t?e.constructor:void 0,r=n?z(n):void 0;if(r)switch(r){case k:return d;case $:return i;case B:return c;case G:return l;case W:return u}return t});var X=Array.isArray;function J(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}(e.length)&&!Z(e)}var Q=x||function(){return!1};function Z(e){var t=ee(e)?D.call(e):"";return t==a||t==o}function ee(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=function(e){if(J(e)&&(X(e)||"string"==typeof e||"function"==typeof e.splice||Q(e)||K(e)))return!e.length;var t=Y(e);if(t==i||t==l)return!e.size;if(V||function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||S)}(e))return!w(e).length;for(var n in e)if(R.call(e,n))return!1;return!0}},216:(e,t,n)=>{e=n.nmd(e);var r="__lodash_hash_undefined__",s=1,a=2,o=9007199254740991,i="[object Arguments]",c="[object Array]",l="[object AsyncFunction]",u="[object Boolean]",d="[object Date]",p="[object Error]",h="[object Function]",g="[object GeneratorFunction]",f="[object Map]",m="[object Number]",y="[object Null]",I="[object Object]",E="[object Promise]",A="[object Proxy]",_="[object RegExp]",C="[object Set]",S="[object String]",T="[object Symbol]",N="[object Undefined]",P="[object WeakMap]",R="[object ArrayBuffer]",D="[object DataView]",b=/^\[object .+?Constructor\]$/,O=/^(?:0|[1-9]\d*)$/,v={};v["[object Float32Array]"]=v["[object Float64Array]"]=v["[object Int8Array]"]=v["[object Int16Array]"]=v["[object Int32Array]"]=v["[object Uint8Array]"]=v["[object Uint8ClampedArray]"]=v["[object Uint16Array]"]=v["[object Uint32Array]"]=!0,v[i]=v[c]=v[R]=v[u]=v[D]=v[d]=v[p]=v[h]=v[f]=v[m]=v[I]=v[_]=v[C]=v[S]=v[P]=!1;var x="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,w="object"==typeof self&&self&&self.Object===Object&&self,M=x||w||Function("return this")(),L=t&&!t.nodeType&&t,U=L&&e&&!e.nodeType&&e,F=U&&U.exports===L,j=F&&x.process,V=function(){try{return j&&j.binding&&j.binding("util")}catch(e){}}(),k=V&&V.isTypedArray;function $(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function B(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function G(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var W,H,q,Y=Array.prototype,z=Function.prototype,K=Object.prototype,X=M["__core-js_shared__"],J=z.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=Y.splice,ie=re?re.toStringTag:void 0,ce=Object.getOwnPropertySymbols,le=ne?ne.isBuffer:void 0,ue=(H=Object.keys,q=Object,function(e){return H(q(e))}),de=Ve(M,"DataView"),pe=Ve(M,"Map"),he=Ve(M,"Promise"),ge=Ve(M,"Set"),fe=Ve(M,"WeakMap"),me=Ve(Object,"create"),ye=Ge(de),Ie=Ge(pe),Ee=Ge(he),Ae=Ge(ge),_e=Ge(fe),Ce=re?re.prototype:void 0,Se=Ce?Ce.valueOf:void 0;function Te(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ne(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Pe(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Re(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Pe;++t<n;)this.add(e[t])}function De(e){var t=this.__data__=new Ne(e);this.size=t.size}function be(e,t){var n=qe(e),r=!n&&He(e),s=!n&&!r&&Ye(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&&Ye(e)){if(!Ye(t))return!1;h=!0,A=!1}if(P&&!A)return l||(l=new De),h||Qe(e)?Ue(e,t,n,r,o,l):function(e,t,n,r,o,i,c){switch(n){case D:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case R:return!(e.byteLength!=t.byteLength||!i(new se(e),new se(t)));case u:case d:case m:return We(+e,+t);case p:return e.name==t.name&&e.message==t.message;case _:case S:return e==t+"";case f:var l=B;case C:var h=r&s;if(l||(l=G),e.size!=t.size&&!h)return!1;var g=c.get(e);if(g)return g==t;r|=a,c.set(e,t);var y=Ue(l(e),l(t),r,o,i,c);return c.delete(e),y;case T:if(Se)return Se.call(e)==Se.call(t)}return!1}(e,t,y,n,r,o,l);if(!(n&s)){var b=A&&Q.call(e,"__wrapped__"),O=N&&Q.call(t,"__wrapped__");if(b||O){var v=b?e.value():e,x=O?t.value():t;return l||(l=new De),o(v,x,n,r,l)}}if(!P)return!1;return l||(l=new De),function(e,t,n,r,a,o){var i=n&s,c=Fe(e),l=c.length,u=Fe(t),d=u.length;if(l!=d&&!i)return!1;var p=l;for(;p--;){var h=c[p];if(!(i?h in t:Q.call(t,h)))return!1}var g=o.get(e);if(g&&o.get(t))return g==t;var f=!0;o.set(e,t),o.set(t,e);var m=i;for(;++p<l;){var y=e[h=c[p]],I=t[h];if(r)var E=i?r(I,y,h,t,e,o):r(y,I,h,e,t,o);if(!(void 0===E?y===I||a(y,I,n,r,o):E)){f=!1;break}m||(m="constructor"==h)}if(f&&!m){var A=e.constructor,_=t.constructor;A==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof A&&A instanceof A&&"function"==typeof _&&_ instanceof _||(f=!1)}return o.delete(e),o.delete(t),f}(e,t,n,r,o,l)}(e,t,n,r,we,o))}function Me(e){return!(!Xe(e)||function(e){return!!Z&&Z in e}(e))&&(ze(e)?te:b).test(Ge(e))}function Le(e){if(n=(t=e)&&t.constructor,r="function"==typeof n&&n.prototype||K,t!==r)return ue(e);var t,n,r,s=[];for(var a in Object(e))Q.call(e,a)&&"constructor"!=a&&s.push(a);return s}function Ue(e,t,n,r,o,i){var c=n&s,l=e.length,u=t.length;if(l!=u&&!(c&&u>l))return!1;var d=i.get(e);if(d&&i.get(t))return d==t;var p=-1,h=!0,g=n&a?new Re:void 0;for(i.set(e,t),i.set(t,e);++p<l;){var f=e[p],m=t[p];if(r)var y=c?r(m,f,p,t,e,i):r(f,m,p,e,t,i);if(void 0!==y){if(y)continue;h=!1;break}if(g){if(!$(t,(function(e,t){if(s=t,!g.has(s)&&(f===e||o(f,e,n,r,i)))return g.push(t);var s}))){h=!1;break}}else if(f!==m&&!o(f,m,n,r,i)){h=!1;break}}return i.delete(e),i.delete(t),h}function Fe(e){return function(e,t,n){var r=t(e);return qe(e)?r:function(e,t){for(var n=-1,r=t.length,s=e.length;++n<r;)e[s+n]=t[n];return e}(r,n(e))}(e,Ze,ke)}function je(e,t){var n,r,s=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?s["string"==typeof t?"string":"hash"]:s.map}function Ve(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Me(n)?n:void 0}Te.prototype.clear=function(){this.__data__=me?me(null):{},this.size=0},Te.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Te.prototype.get=function(e){var t=this.__data__;if(me){var n=t[e];return n===r?void 0:n}return Q.call(t,e)?t[e]:void 0},Te.prototype.has=function(e){var t=this.__data__;return me?void 0!==t[e]:Q.call(t,e)},Te.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=me&&void 0===t?r:t,this},Ne.prototype.clear=function(){this.__data__=[],this.size=0},Ne.prototype.delete=function(e){var t=this.__data__,n=Oe(t,e);return!(n<0)&&(n==t.length-1?t.pop():oe.call(t,n,1),--this.size,!0)},Ne.prototype.get=function(e){var t=this.__data__,n=Oe(t,e);return n<0?void 0:t[n][1]},Ne.prototype.has=function(e){return Oe(this.__data__,e)>-1},Ne.prototype.set=function(e,t){var n=this.__data__,r=Oe(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Pe.prototype.clear=function(){this.size=0,this.__data__={hash:new Te,map:new(pe||Ne),string:new Te}},Pe.prototype.delete=function(e){var t=je(this,e).delete(e);return this.size-=t?1:0,t},Pe.prototype.get=function(e){return je(this,e).get(e)},Pe.prototype.has=function(e){return je(this,e).has(e)},Pe.prototype.set=function(e,t){var n=je(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Re.prototype.add=Re.prototype.push=function(e){return this.__data__.set(e,r),this},Re.prototype.has=function(e){return this.__data__.has(e)},De.prototype.clear=function(){this.__data__=new Ne,this.size=0},De.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},De.prototype.get=function(e){return this.__data__.get(e)},De.prototype.has=function(e){return this.__data__.has(e)},De.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Ne){var r=n.__data__;if(!pe||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Pe(r)}return n.set(e,t),this.size=n.size,this};var ke=ce?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,s=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[s++]=o)}return a}(ce(e),(function(t){return ae.call(e,t)})))}:function(){return[]},$e=ve;function Be(e,t){return!!(t=null==t?o:t)&&("number"==typeof e||O.test(e))&&e>-1&&e%1==0&&e<t}function Ge(e){if(null!=e){try{return J.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function We(e,t){return e===t||e!=e&&t!=t}(de&&$e(new de(new ArrayBuffer(1)))!=D||pe&&$e(new pe)!=f||he&&$e(he.resolve())!=E||ge&&$e(new ge)!=C||fe&&$e(new fe)!=P)&&($e=function(e){var t=ve(e),n=t==I?e.constructor:void 0,r=n?Ge(n):"";if(r)switch(r){case ye:return D;case Ie:return f;case Ee:return E;case Ae:return C;case _e:return P}return t});var He=xe(function(){return arguments}())?xe:function(e){return Je(e)&&Q.call(e,"callee")&&!ae.call(e,"callee")},qe=Array.isArray;var Ye=le||function(){return!1};function ze(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)&&!ze(t)?be(e):Le(e);var t}e.exports=function(e,t){return we(e,t)}},692:(e,t,n)=>{e=n.nmd(e);var r="__lodash_hash_undefined__",s=9007199254740991,a="[object Arguments]",o="[object AsyncFunction]",i="[object Function]",c="[object GeneratorFunction]",l="[object Null]",u="[object Object]",d="[object Proxy]",p="[object Undefined]",h=/^\[object .+?Constructor\]$/,g=/^(?:0|[1-9]\d*)$/,f={};f["[object Float32Array]"]=f["[object Float64Array]"]=f["[object Int8Array]"]=f["[object Int16Array]"]=f["[object Int32Array]"]=f["[object Uint8Array]"]=f["[object Uint8ClampedArray]"]=f["[object Uint16Array]"]=f["[object Uint32Array]"]=!0,f[a]=f["[object Array]"]=f["[object ArrayBuffer]"]=f["[object Boolean]"]=f["[object DataView]"]=f["[object Date]"]=f["[object Error]"]=f[i]=f["[object Map]"]=f["[object Number]"]=f[u]=f["[object RegExp]"]=f["[object Set]"]=f["[object String]"]=f["[object WeakMap]"]=!1;var m="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,y="object"==typeof self&&self&&self.Object===Object&&self,I=m||y||Function("return this")(),E=t&&!t.nodeType&&t,A=E&&e&&!e.nodeType&&e,_=A&&A.exports===E,C=_&&m.process,S=function(){try{var e=A&&A.require&&A.require("util").types;return e||C&&C.binding&&C.binding("util")}catch(e){}}(),T=S&&S.isTypedArray;var N,P,R,D=Array.prototype,b=Function.prototype,O=Object.prototype,v=I["__core-js_shared__"],x=b.toString,w=O.hasOwnProperty,M=(N=/[^.]+$/.exec(v&&v.keys&&v.keys.IE_PROTO||""))?"Symbol(src)_1."+N:"",L=O.toString,U=x.call(Object),F=RegExp("^"+x.call(w).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),j=_?I.Buffer:void 0,V=I.Symbol,k=I.Uint8Array,$=j?j.allocUnsafe:void 0,B=(P=Object.getPrototypeOf,R=Object,function(e){return P(R(e))}),G=Object.create,W=O.propertyIsEnumerable,H=D.splice,q=V?V.toStringTag:void 0,Y=function(){try{var e=Ee(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),z=j?j.isBuffer:void 0,K=Math.max,X=Date.now,J=Ee(I,"Map"),Q=Ee(Object,"create"),Z=function(){function e(){}return function(t){if(!ve(t))return{};if(G)return G(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function ee(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function te(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ne(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function re(e){var t=this.__data__=new te(e);this.size=t.size}function se(e,t){var n=Pe(e),r=!n&&Ne(e),s=!n&&!r&&De(e),a=!n&&!r&&!s&&we(e),o=n||r||s||a,i=o?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],c=i.length;for(var l in e)!t&&!w.call(e,l)||o&&("length"==l||s&&("offset"==l||"parent"==l)||a&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Ae(l,c))||i.push(l);return i}function ae(e,t,n){(void 0!==n&&!Te(e[t],n)||void 0===n&&!(t in e))&&ce(e,t,n)}function oe(e,t,n){var r=e[t];w.call(e,t)&&Te(r,n)&&(void 0!==n||t in e)||ce(e,t,n)}function ie(e,t){for(var n=e.length;n--;)if(Te(e[n][0],t))return n;return-1}function ce(e,t,n){"__proto__"==t&&Y?Y(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}ee.prototype.clear=function(){this.__data__=Q?Q(null):{},this.size=0},ee.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ee.prototype.get=function(e){var t=this.__data__;if(Q){var n=t[e];return n===r?void 0:n}return w.call(t,e)?t[e]:void 0},ee.prototype.has=function(e){var t=this.__data__;return Q?void 0!==t[e]:w.call(t,e)},ee.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Q&&void 0===t?r:t,this},te.prototype.clear=function(){this.__data__=[],this.size=0},te.prototype.delete=function(e){var t=this.__data__,n=ie(t,e);return!(n<0)&&(n==t.length-1?t.pop():H.call(t,n,1),--this.size,!0)},te.prototype.get=function(e){var t=this.__data__,n=ie(t,e);return n<0?void 0:t[n][1]},te.prototype.has=function(e){return ie(this.__data__,e)>-1},te.prototype.set=function(e,t){var n=this.__data__,r=ie(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},ne.prototype.clear=function(){this.size=0,this.__data__={hash:new ee,map:new(J||te),string:new ee}},ne.prototype.delete=function(e){var t=Ie(this,e).delete(e);return this.size-=t?1:0,t},ne.prototype.get=function(e){return Ie(this,e).get(e)},ne.prototype.has=function(e){return Ie(this,e).has(e)},ne.prototype.set=function(e,t){var n=Ie(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},re.prototype.clear=function(){this.__data__=new te,this.size=0},re.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},re.prototype.get=function(e){return this.__data__.get(e)},re.prototype.has=function(e){return this.__data__.has(e)},re.prototype.set=function(e,t){var n=this.__data__;if(n instanceof te){var r=n.__data__;if(!J||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ne(r)}return n.set(e,t),this.size=n.size,this};var le,ue=function(e,t,n){for(var r=-1,s=Object(e),a=n(e),o=a.length;o--;){var i=a[le?o:++r];if(!1===t(s[i],i,s))break}return e};function de(e){return null==e?void 0===e?p:l:q&&q in Object(e)?function(e){var t=w.call(e,q),n=e[q];try{e[q]=void 0;var r=!0}catch(e){}var s=L.call(e);r&&(t?e[q]=n:delete e[q]);return s}(e):function(e){return L.call(e)}(e)}function pe(e){return xe(e)&&de(e)==a}function he(e){return!(!ve(e)||function(e){return!!M&&M in e}(e))&&(be(e)?F:h).test(function(e){if(null!=e){try{return x.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function ge(e){if(!ve(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=_e(e),n=[];for(var r in e)("constructor"!=r||!t&&w.call(e,r))&&n.push(r);return n}function fe(e,t,n,r,s){e!==t&&ue(t,(function(a,o){if(s||(s=new re),ve(a))!function(e,t,n,r,s,a,o){var i=Ce(e,n),c=Ce(t,n),l=o.get(c);if(l)return void ae(e,n,l);var d=a?a(i,c,n+"",e,t,o):void 0,p=void 0===d;if(p){var h=Pe(c),g=!h&&De(c),f=!h&&!g&&we(c);d=c,h||g||f?Pe(i)?d=i:xe(A=i)&&Re(A)?d=function(e,t){var n=-1,r=e.length;t||(t=Array(r));for(;++n<r;)t[n]=e[n];return t}(i):g?(p=!1,d=function(e,t){if(t)return e.slice();var n=e.length,r=$?$(n):new e.constructor(n);return e.copy(r),r}(c,!0)):f?(p=!1,m=c,y=!0?(I=m.buffer,E=new I.constructor(I.byteLength),new k(E).set(new k(I)),E):m.buffer,d=new m.constructor(y,m.byteOffset,m.length)):d=[]:function(e){if(!xe(e)||de(e)!=u)return!1;var t=B(e);if(null===t)return!0;var n=w.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&x.call(n)==U}(c)||Ne(c)?(d=i,Ne(i)?d=function(e){return function(e,t,n,r){var s=!n;n||(n={});var a=-1,o=t.length;for(;++a<o;){var i=t[a],c=r?r(n[i],e[i],i,n,e):void 0;void 0===c&&(c=e[i]),s?ce(n,i,c):oe(n,i,c)}return n}(e,Me(e))}(i):ve(i)&&!be(i)||(d=function(e){return"function"!=typeof e.constructor||_e(e)?{}:Z(B(e))}(c))):p=!1}var m,y,I,E;var A;p&&(o.set(c,d),s(d,c,r,a,o),o.delete(c));ae(e,n,d)}(e,t,o,n,fe,r,s);else{var i=r?r(Ce(e,o),a,o+"",e,t,s):void 0;void 0===i&&(i=a),ae(e,o,i)}}),Me)}function me(e,t){return Se(function(e,t,n){return t=K(void 0===t?e.length-1:t,0),function(){for(var r=arguments,s=-1,a=K(r.length-t,0),o=Array(a);++s<a;)o[s]=r[t+s];s=-1;for(var i=Array(t+1);++s<t;)i[s]=r[s];return i[t]=n(o),function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}(e,this,i)}}(e,t,Fe),e+"")}var ye=Y?function(e,t){return Y(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:Fe;function Ie(e,t){var n,r,s=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?s["string"==typeof t?"string":"hash"]:s.map}function Ee(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return he(n)?n:void 0}function Ae(e,t){var n=typeof e;return!!(t=null==t?s:t)&&("number"==n||"symbol"!=n&&g.test(e))&&e>-1&&e%1==0&&e<t}function _e(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||O)}function Ce(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Se=function(e){var t=0,n=0;return function(){var r=X(),s=16-(r-n);if(n=r,s>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(ye);function Te(e,t){return e===t||e!=e&&t!=t}var Ne=pe(function(){return arguments}())?pe:function(e){return xe(e)&&w.call(e,"callee")&&!W.call(e,"callee")},Pe=Array.isArray;function Re(e){return null!=e&&Oe(e.length)&&!be(e)}var De=z||function(){return!1};function be(e){if(!ve(e))return!1;var t=de(e);return t==i||t==c||t==o||t==d}function Oe(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=s}function ve(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function xe(e){return null!=e&&"object"==typeof e}var we=T?function(e){return function(t){return e(t)}}(T):function(e){return xe(e)&&Oe(e.length)&&!!f[de(e)]};function Me(e){return Re(e)?se(e,!0):ge(e)}var Le,Ue=(Le=function(e,t,n,r){fe(e,t,n,r)},me((function(e,t){var n=-1,r=t.length,s=r>1?t[r-1]:void 0,a=r>2?t[2]:void 0;for(s=Le.length>3&&"function"==typeof s?(r--,s):void 0,a&&function(e,t,n){if(!ve(n))return!1;var r=typeof t;return!!("number"==r?Re(n)&&Ae(t,n.length):"string"==r&&t in n)&&Te(n[t],e)}(t[0],t[1],a)&&(s=r<3?void 0:s,r=1),e=Object(e);++n<r;){var o=t[n];o&&Le(e,o,n,s)}return e})));function Fe(e){return e}e.exports=Ue},835:(e,t,n)=>{var r="__lodash_hash_undefined__",s=1/0,a=9007199254740991,o="[object Function]",i="[object GeneratorFunction]",c="[object Symbol]",l=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u=/^\w*$/,d=/^\./,p=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,h=/\\(\\)?/g,g=/^\[object .+?Constructor\]$/,f=/^(?:0|[1-9]\d*)$/,m="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,y="object"==typeof self&&self&&self.Object===Object&&self,I=m||y||Function("return this")();var E,A=Array.prototype,_=Function.prototype,C=Object.prototype,S=I["__core-js_shared__"],T=(E=/[^.]+$/.exec(S&&S.keys&&S.keys.IE_PROTO||""))?"Symbol(src)_1."+E:"",N=_.toString,P=C.hasOwnProperty,R=C.toString,D=RegExp("^"+N.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),b=I.Symbol,O=A.splice,v=G(I,"Map"),x=G(Object,"create"),w=b?b.prototype:void 0,M=w?w.toString:void 0;function L(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function U(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function F(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function j(e,t,n){var r=e[t];P.call(e,t)&&z(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function V(e,t){for(var n=e.length;n--;)if(z(e[n][0],t))return n;return-1}function k(e){if(!X(e)||(t=e,T&&T in t))return!1;var t,n=function(e){var t=X(e)?R.call(e):"";return t==o||t==i}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?D:g;return n.test(function(e){if(null!=e){try{return N.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function $(e,t,n,r){if(!X(e))return e;t=function(e,t){if(K(e))return!1;var n=typeof e;if("number"==n||"symbol"==n||"boolean"==n||null==e||J(e))return!0;return u.test(e)||!l.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:function(e){return K(e)?e:H(e)}(t);for(var s=-1,a=t.length,o=a-1,i=e;null!=i&&++s<a;){var c=q(t[s]),d=n;if(s!=o){var p=i[c];void 0===(d=r?r(p,c,i):void 0)&&(d=X(p)?p:W(t[s+1])?[]:{})}j(i,c,d),i=i[c]}return e}function B(e,t){var n,r,s=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?s["string"==typeof t?"string":"hash"]:s.map}function G(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return k(n)?n:void 0}function W(e,t){return!!(t=null==t?a:t)&&("number"==typeof e||f.test(e))&&e>-1&&e%1==0&&e<t}L.prototype.clear=function(){this.__data__=x?x(null):{}},L.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},L.prototype.get=function(e){var t=this.__data__;if(x){var n=t[e];return n===r?void 0:n}return P.call(t,e)?t[e]:void 0},L.prototype.has=function(e){var t=this.__data__;return x?void 0!==t[e]:P.call(t,e)},L.prototype.set=function(e,t){return this.__data__[e]=x&&void 0===t?r:t,this},U.prototype.clear=function(){this.__data__=[]},U.prototype.delete=function(e){var t=this.__data__,n=V(t,e);return!(n<0)&&(n==t.length-1?t.pop():O.call(t,n,1),!0)},U.prototype.get=function(e){var t=this.__data__,n=V(t,e);return n<0?void 0:t[n][1]},U.prototype.has=function(e){return V(this.__data__,e)>-1},U.prototype.set=function(e,t){var n=this.__data__,r=V(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},F.prototype.clear=function(){this.__data__={hash:new L,map:new(v||U),string:new L}},F.prototype.delete=function(e){return B(this,e).delete(e)},F.prototype.get=function(e){return B(this,e).get(e)},F.prototype.has=function(e){return B(this,e).has(e)},F.prototype.set=function(e,t){return B(this,e).set(e,t),this};var H=Y((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 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||F),n}function z(e,t){return e===t||e!=e&&t!=t}Y.Cache=F;var K=Array.isArray;function X(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function J(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&R.call(e)==c}e.exports=function(e,t,n){return null==e?e:$(e,t,n)}},521:(e,t,n)=>{var r="__lodash_hash_undefined__",s=1/0,a="[object Function]",o="[object GeneratorFunction]",i="[object Symbol]",c=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,l=/^\w*$/,u=/^\./,d=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,p=/\\(\\)?/g,h=/^\[object .+?Constructor\]$/,g="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,f="object"==typeof self&&self&&self.Object===Object&&self,m=g||f||Function("return this")();var y,I=Array.prototype,E=Function.prototype,A=Object.prototype,_=m["__core-js_shared__"],C=(y=/[^.]+$/.exec(_&&_.keys&&_.keys.IE_PROTO||""))?"Symbol(src)_1."+y:"",S=E.toString,T=A.hasOwnProperty,N=A.toString,P=RegExp("^"+S.call(T).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),R=m.Symbol,D=I.splice,b=$(m,"Map"),O=$(Object,"create"),v=R?R.prototype:void 0,x=v?v.toString:void 0;function w(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function M(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function L(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function U(e,t){for(var n,r,s=e.length;s--;)if((n=e[s][0])===(r=t)||n!=n&&r!=r)return s;return-1}function F(e){if(!Y(e)||(t=e,C&&C in t))return!1;var t,n=function(e){var t=Y(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&&!z(e))||(l.test(e)||!c.test(e)||null!=t&&e in Object(t))}w.prototype.clear=function(){this.__data__=O?O(null):{}},w.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},w.prototype.get=function(e){var t=this.__data__;if(O){var n=t[e];return n===r?void 0:n}return T.call(t,e)?t[e]:void 0},w.prototype.has=function(e){var t=this.__data__;return O?void 0!==t[e]:T.call(t,e)},w.prototype.set=function(e,t){return this.__data__[e]=O&&void 0===t?r:t,this},M.prototype.clear=function(){this.__data__=[]},M.prototype.delete=function(e){var t=this.__data__,n=U(t,e);return!(n<0)&&(n==t.length-1?t.pop():D.call(t,n,1),!0)},M.prototype.get=function(e){var t=this.__data__,n=U(t,e);return n<0?void 0:t[n][1]},M.prototype.has=function(e){return U(this.__data__,e)>-1},M.prototype.set=function(e,t){var n=this.__data__,r=U(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},L.prototype.clear=function(){this.__data__={hash:new w,map:new(b||M),string:new w}},L.prototype.delete=function(e){return k(this,e).delete(e)},L.prototype.get=function(e){return k(this,e).get(e)},L.prototype.has=function(e){return k(this,e).has(e)},L.prototype.set=function(e,t){return k(this,e).set(e,t),this};var G=H((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(z(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||z(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 Y(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function z(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&N.call(e)==i}e.exports=function(e,t){return null==e||j(e,t)}},953:e=>{class t{constructor(e,t,n,r,s){this.converter=c(),this.width=e,this.poly=t,this.xor_in=n,this.reflected_xor_in=l(n,e),this.xor_out=r,this.reflect=s,this.msb_mask=1<<this.width-1,this.mask=this.msb_mask-1<<1|1,this.crc_shift=this.width<8?8-this.width:0,this.shifted_xor_in=this.xor_in<<this.crc_shift;let a=this.gen_table();this.table=a,8!==this.width||this.xor_in||this.xor_out||this.reflect||(this.calculate=function(e){e=this.converter.validate_buffer(e);let t=0;for(let n=0;n<e.length;n++)t=a[t^e[n]];return t})}calculate(e){let t;e=this.converter.validate_buffer(e);let{table:n,width:r,crc_shift:s,mask:a}=this;if(this.reflect){t=this.reflected_xor_in;for(let r=0;r<e.length;r++){t=(n[255&(t^e[r])]^t>>>8)&a}}else{t=this.shifted_xor_in;for(let o=0;o<e.length;o++)t=n[255&(t>>r-8+s^e[o])]<<s^t<<8-s&a<<s;t>>=s}return t^=this.xor_out,t>>>0}calculate_no_table(e){e=this.converter.validate_buffer(e);let t=this.xor_in;for(let n=0;n<e.length;n++){let r=e[n];this.reflect&&(r=l(r,8));for(let e=0;e<8;e++){let n=t&this.msb_mask;r&128>>e&&(n^=this.msb_mask),t<<=1,n&&(t^=this.poly)}t&=this.mask}return this.reflect&&(t=l(t,this.width)),t^=this.xor_out,t>>>0}gen_table(){let e=[];for(let t=0;t<256;t++){let n=t;this.reflect&&(n=l(n,8)),n<<=this.width-8+this.crc_shift;for(let e=0;e<8;e++)0!=(n&this.msb_mask<<this.crc_shift)?(n<<=1,n^=this.poly<<this.crc_shift):n<<=1;this.reflect&&(n=l(n>>this.crc_shift,this.width)<<this.crc_shift),n=n>>this.crc_shift&this.mask,e[t]=n>>>0}return new Int32Array(e)}print_table(){let e=this.table,t=Math.ceil(this.width/4),n=t<4?4:3,r=e.length>>n,s=1<<n,a="";for(let o=0;o<r;o++){let r="";for(let a=0;a<s;a++){let s=e[o<<n|a];s="000000000"+s.toString(16),s=s.substr(s.length-t),r+="0x"+s+", "}a+=" "+r+"\n"}return a="[\n"+a.slice(0,-3)+"\n]",a}}const n="undefined"!=typeof Buffer,r="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,s=void 0!==typeof BigInt&&BigInt(256);class a{validate_buffer(e){switch(typeof e){case"number":{if(!Number.isSafeInteger(e)||e<0)throw Error(`number data must be a nonnegative safe integer, not ${e}`);if(this.fromUInt32&&e<=4294967295)return this.fromUInt32(e);const t=[];for(;e>0||t.length<4;)t.unshift(e%256),e=Math.floor(e/256);return this.fromByteArray(t)}case"string":return this.fromString(e);case"bigint":{if(e<0)throw Error(`bigint data must be nonnegative, not ${e}`);const t=[];for(;e>0||t.length<4;)t.unshift(Number(e%s)),e/=s;return this.fromByteArray(t)}default:if(n&&Buffer.isBuffer(e))return e;if(r){if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(e instanceof ArrayBuffer)return new Uint8Array(e)}throw new Error(`Unrecognized data type ${typeof e}: ${e}`)}}}class o extends a{fromUInt32(e){const t=Buffer.alloc(4);return t.writeUInt32BE(e),t}fromByteArray=Buffer.from.bind(Buffer);fromString=Buffer.from.bind(Buffer)}class i extends a{fromByteArray=Uint8Array.from.bind(Uint8Array);fromString(e){return new TextEncoder("utf-8").encode(e)}}function c(e=!1){if(r&&(e||!n))return new i;if(n)return new o;throw Error("either need TypedArrays or Buffer")}function l(e,t){let n=0;for(let r=0;r<t;r++)n=n<<1|1&e,e>>=1;return n}const u={crc1:new t(1,1,0,0,!1),crc6:new t(6,47,0,0,!1),crc8:new t(8,7,0,0,!1),crc10:new t(10,563,0,0,!1),crc16:new t(16,32773,0,0,!0),crc24:new t(24,8801531,11994318,0,!1),crc32:new t(32,79764919,4294967295,4294967295,!0),crc32c:new t(32,517762881,4294967295,4294967295,!0)};function d(e){}e.exports={CRC:t,crc:function(e,n,r,s,a){let o=new t(e,n,r,s,a);return o.calculate.bind(o)},makeBufferConverter:c,models:u,crc1:d,crc6:d,crc8:d,crc10:d,crc16:d,crc24:d,crc32:d,crc32c:d};for(let t in u){let n=u[t];e.exports[t]=n.calculate.bind(n)}},754:e=>{function t(e){return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}))}t.keys=()=>[],t.resolve=t,t.id=754,e.exports=t}},r={};function s(e){var t=r[e];if(void 0!==t)return t.exports;var a=r[e]={id:e,loaded:!1,exports:{}};return n[e](a,a.exports,s),a.loaded=!0,a.exports}s.m=n,s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce(((t,n)=>(s.f[n](e,t),t)),[])),s.u=e=>"js/"+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&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.p=e})(),(()=>{var e={388:0};s.f.j=(t,n)=>{var r=s.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var a=new Promise(((n,s)=>r=e[t]=[n,s]));n.push(r[2]=a);var o=s.p+s.u(t),i=new Error;s.l(o,(n=>{if(s.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var a=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;i.message="Loading chunk "+t+" failed.\n("+a+": "+o+")",i.name="ChunkLoadError",i.type=a,i.request=o,r[1](i)}}),"chunk-"+t,t)}};var t=(t,n)=>{var r,a,[o,i,c]=n,l=0;if(o.some((t=>0!==e[t]))){for(r in i)s.o(i,r)&&(s.m[r]=i[r]);if(c)c(s)}for(t&&t(n);l<o.length;l++)a=o[l],s.o(e,a)&&e[a]&&e[a][0](),e[a]=0},n=self.webpackChunkconstellation_corejs_library=self.webpackChunkconstellation_corejs_library||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),(()=>{"use strict";var e={};s.r(e),s.d(e,{buildContextName:()=>H,buildModalContext:()=>K,buildTransientContextName:()=>q,getContainerIdFromContext:()=>J,getParentContext:()=>X,getParentContextName:()=>W,getTargetFromContext:()=>z,getTransientContext:()=>Y});var t={};s.r(t),s.d(t,{getResolvedTargetName:()=>yt,getRoutingInfo:()=>It,getSemanticURLFromRoutingInfo:()=>Et});var n={};s.r(n),s.d(n,{evaluate:()=>Kt,handleChange:()=>Yt,hasDeclareExpression:()=>qt,updateDeclareExpressions:()=>zt});var r={};s.r(r),s.d(r,{publishExpressions:()=>wr,publishResponse:()=>Mr});var a={};s.r(a),s.d(a,{hasBrowserEnv:()=>qs,hasStandardBrowserEnv:()=>zs,hasStandardBrowserWebWorkerEnv:()=>Ks,navigator:()=>Ys,origin:()=>Xs});var o={};s.r(o),s.d(o,{doesRestApiExist:()=>ec,getCancelTokenSource:()=>tc,getCaseApi:()=>sc,getHeaderProcessor:()=>Ji,invokeCustomRestApi:()=>Zi,invokeRestApi:()=>Qi,isRequestCanceled:()=>nc,registerInterceptor:()=>rc});var i={};s.r(i),s.d(i,{CONTAINER_NAMES:()=>dd,CONTAINER_TYPES:()=>ud,addRootContainerItem:()=>Wd,areContainerItemsPresent:()=>yd,clearTransientData:()=>Xd,closeContainerItem:()=>Gd,getActiveContainerItemContext:()=>Dd,getActiveContainerItemIDFromRoutingInfo:()=>cp,getActiveContainerItemName:()=>Td,getActiveContext:()=>sp,getChildContainerItems:()=>bd,getChildContainers:()=>Od,getChildContainersContexts:()=>vd,getContainerAPI:()=>Zd,getContainerAccessOrder:()=>md,getContainerData:()=>hd,getContainerItemByKey:()=>_d,getContainerItemData:()=>gd,getContainerItemName:()=>Ed,getContainerItems:()=>fd,getContainerLimit:()=>Ud,getContainerParentContext:()=>ip,getContainerType:()=>Sd,getContextByTargetAndKey:()=>op,getDataContextName:()=>Rd,getFlowContainer:()=>up,getLeastRecentlyUsedNonDirtyContainerItemID:()=>$d,getParentContainerItem:()=>lp,getRootContainerName:()=>rp,getSuggestionContexts:()=>xd,getTargetFromContainerItemID:()=>Bd,getTransientItems:()=>Yd,hasContainerItems:()=>Ld,isContainerDirty:()=>kd,isContainerInitialized:()=>Cd,isContainerItemActive:()=>Nd,isContainerItemContextBeingUsedInOtherContainers:()=>qd,isContainerItemExists:()=>Id,isContainerLimitReached:()=>jd,isContainerMultipleMode:()=>Md,isContainerSingleMode:()=>wd,purgeTransientData:()=>Jd,removeContainer:()=>ep,replaceTransientData:()=>Kd,resetContainersPayload:()=>Vd,setContainerLimit:()=>Fd,updateCaseContextEtag:()=>np,updateParentLastUpdateTime:()=>ap,updateRelatedContextEtag:()=>tp,updateTransientData:()=>zd});var c={};s.r(c),s.d(c,{getAdditionalInfo:()=>ch,getDataPageKeys:()=>ah,getDataPageMetadata:()=>Jp,getEmbeddedPropertyMetadata:()=>Wp,getFieldParameters:()=>th,getFieldsByClassName:()=>eh,getGenAICoach:()=>rh,getInsight:()=>Zp,getLookUpDataPage:()=>oh,getLookUpDataPageInfo:()=>ih,getParagraph:()=>nh,getPersonalizationMetadata:()=>Qp,getPropertyMetadata:()=>Gp,getResolvedFieldMetadata:()=>lh,getSavableDataPage:()=>sh,isViewExists:()=>Kp,mergeStore:()=>Bp,resolveNavigation:()=>Xp,resolveView:()=>zp,updateNavigationStore:()=>qp,updateStores:()=>Yp,updateViewStore:()=>Hp});var l={};s.r(l),s.d(l,{dispatch:()=>mh,doesContextExist:()=>vh,getActionType:()=>Sh,getContextValue:()=>_h,getDataObject:()=>yh,getReferenceTokens:()=>hh,getSharedDataObject:()=>Ih,getStore:()=>fh,getValue:()=>Ah,isMergeable:()=>Nh,lookupContextValue:()=>Ch,mergeDeep:()=>Rh,performReplace:()=>Ph,removeItem:()=>Th,replaceValue:()=>bh,resetStore:()=>Oh,setStore:()=>gh,updateValue:()=>Dh});var u={};s.r(u),s.d(u,{activateContainerItem:()=>ig,addContainerItem:()=>Jh,addMessages:()=>cg,addSharedData:()=>Ig,addTransientItem:()=>Qh,addWork:()=>Yh,clearTransientData:()=>eg,createWork:()=>$h,error:()=>yg,finishAssignment:()=>hg,initContainers:()=>Kh,listAction:()=>Ag,loadView:()=>Hh,mergeData:()=>Gh,openAssignment:()=>gg,openWorkByHandle:()=>zh,postProcess:()=>mg,purgeTransientData:()=>ng,removeAllTransientItems:()=>ug,removeContainerItem:()=>lg,removeSharedData:()=>Eg,removeTransientItem:()=>dg,replaceContainerItem:()=>pg,replaceTransientData:()=>tg,resetContainers:()=>Xh,resetLoading:()=>ag,setLoading:()=>sg,setSharedProperty:()=>Cg,setStateProperty:()=>Sg,showCasePreview:()=>_g,showHarness:()=>Wh,showHistory:()=>fg,showPage:()=>qh,upMergeAndRemoveContainerItem:()=>og,updateContainerItem:()=>rg,updateTransientData:()=>Zh});var d={};s.r(d),s.d(d,{fetchViewResources:()=>wE,updateViewResources:()=>xE});var p=s(216),h=s.n(p);let g,f,m;const y=e=>{e&&(g=e=e||{"base-server":"http://localhost:1080/prweb/","data-end-point":"api/v1/stream/data","action-end-point":"api/v1/stream/action"},g.BASEURL=e.server,g.ACTIONURL=e["action-end-point"],g.DATAURL=e["data-end-point"],m=e.reAuthUrl)},I=()=>m,E=()=>g.BASEURL,A=e=>fetch(`${g.BASEURL}${g.ACTIONURL}`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),_=e=>{f=e},C=()=>f;var S=s(953),T=s(521),N=s.n(T),P=s(928),R=s.n(P),D=s(188),b=s.n(D),O=s(835),v=s.n(O),x=s(692),w=s.n(x),M=s(529),L=s.n(M);const U=new class{constructor(){this.needsMapping=!1}getNeedsMapping(){return this.needsMapping}setNeedsMapping(e){this.needsMapping=e}map(e){return this.needsMapping?this.replacer(e):e}analyseResponse(e){e?.data?.objectInfo&&window?.PCore?.getEnvironmentInfo()?.isUnifiedObject()?this.setNeedsMapping(!0):this.setNeedsMapping(!1)}replacer(e){return this.needsMapping&&(e=e.replace("caseInfo","objectInfo").replace("caseTypeName","objectTypeName").replace("caseTypeID","objectTypeID")),e}},F={APP:{APP:"app",ROOT:"root",PXREQUESTOR:"pxRequestor",PXUSERNAME:".pxUserName",OPERATORID:"OperatorID",USERNAME:"pxRequestor.pxUserName",PXUSERIDENTIFIER:".pxUserIdentifier",USERIDENTIFIER:"pxRequestor.pxUserIdentifier",PYIMAGEINSKEY:".pyImageInsKey",OPERATORID_IMG_INSKEY:"OperatorID.pyImageInsKey",OPERATORID_LOCALE:"OperatorID.pyUseLocale",APPLICATION_LABEL:"Application.pyLabel",APPLICATION_RULE_NAME:"Application.pyRuleName"},RESOURCE_TYPES:{ASSIGNMENT:"ASSIGNMENT",CASE:"CASE",DATA:"DATA",PAGE:"PAGE"},RESOURCE_STATUS:{CREATE:"CREATE",UPDATE:"UPDATE",OPEN_FLOW_ACTION:"OPEN_FLOW_ACTION"},VIEW_NAMES:{PY_CASE_TAB:"pyCaseTab",DATA_OBJECT_CREATE_VIEW:"Create",DATA_OBJECT_EDIT_VIEW:"pyEdit",PY_DATA_PREVIEW:"pyDataPreview",PY_DETAILS:"pyDetails"},CONTAINERS:{ROOT_CONTAINER:"RootContainer",VIEW_CONTAINER:"ViewContainer",FLOW_CONTAINER:"FlowContainer",MODAL_VIEW_CONTAINER:"ModalViewContainer",PREVIEW_VIEW_CONTAINER:"PreviewViewContainer",HYBRID_VIEW_CONTAINER:"HybridViewContainer"},WORK_BASKET:{MY_WORK_LIST:"myWorkList",REPORTEE:"reportee",WORK_QUEUE:"workQueue",DATA_PAGES:{D__PY_GET_USER_WORK_LIST_BY_USER_ID:"D_pyGetUserWorkListByUserId",D__WORK_BASKET:"D_WorkBasket",D__PY_MY_WORK_LIST:"D_pyMyWorkList"}},CONTEXT_TREE_NODE_TYPES:{VIEW:"VIEW",FIELD:"FIELD",DECLARATIVE_TARGET:"DECLARATIVE_TARGET",WHEN:"WHEN",CONTEXT:"CONTEXT",PAGELIST:"PAGELIST"},WORKLIST:"worklist",WAIT:"wait",TODO:"todo",STANDARD_FLOW:"Standard",CASE:"CASE",ASSIGNMENT:"ASSIGNMENT",FIX_BROKEN_ASSIGNMENTS:"FixBrokenAssignments",PAGE:"PAGE",PZINSKEY:".pzInsKey",CREATE_DETAILS_VIEW_NAME:"pzCreateDetails",PREVIEW_VIEW_NAME:"pyCasePreview",CASESUMMARY_VIEW_NAME:"pyCaseSummary",APPSHELL_ACTIVE_CASES:"appshell-activecases",TRACE_ID:"x-b3-traceid",LOAD_VIEW_STRING:"View",PRIMARY:"primary",DEFER_UPDATE_CASESUMMARY_VIEW:"deferUpdateCaseSummaryView",NEXT_ASSIGNMENT_INFO_ID:"nextAssignmentInfo.ID",WORKCLASS:"Work-",DATA_INFO:{DATA_INFO:"dataInfo",DATA_INFO_CONTENT:"dataInfo.content"},CASE_INFO:{CASE_INFO:"caseInfo",CASE_INFO_CONTENT:"caseInfo.content",CASE_INFO_NAME:"caseInfo.name",CASE_INFO_ID:"caseInfo.ID",CASE_INFO_CLASSID:"caseInfo.content.classID",CASE_TYPE_ID:"caseInfo.caseTypeID",CASE_TYPE_NAME:"caseInfo.caseTypeName",CASE_INFO_PZINSKEY:"caseInfo.content.pzInsKey",CASE_INFO_ACTIONS:"caseInfo.availableActions",VIEW_NAME:"caseInfo.content.pyViewName",ACTION_BUTTONS:"caseInfo.actionButtons",ACTIVE_ACTION_ID:"caseInfo.activeActionID",ASSIGNMENT_LABEL:"caseInfo.assignments[0].name",ASSIGNMENT_ID:"caseInfo.assignments[0].ID",ASSIGNMENTS:"caseInfo.assignments",INSTRUCTIONS:"caseInfo.assignments[0].instructions",NAVIGATION:"caseInfo.navigation",STAGES:"caseInfo.stages",STAGEID:"caseInfo.stageID",CASECLASS:"caseInfo.caseClass",AVAILABLEACTIONS:"caseInfo.availableActions",AVAILABLEPROCESSES:"caseInfo.availableProcesses",D_CASE_ASSIGNMENTS_RESULTS:"caseInfo.assignments",CHILD_ASSIGNMENTS:"caseInfo.childCases",ASSIGNMENTACTION_ID:"caseInfo.assignments[0].actions[0].ID",ISINCREATESTAGE:"caseInfo.isInCreateStage",APPROVALFLAG:"caseInfo.content.pyApprovalResult",DUPLICATECASEFLAG:"caseInfo.content.pyDuplicateCaseActions",DUPLICATECASEID:"caseInfo.content.pyDuplicateID",DUPLICATECASEINSKEY:"caseInfo.content.pyDuplicateCaseReference.pzInsKey",HEADERS:"caseInfo.headers",PARENTCASEINFO:"caseInfo.parentCaseInfo",REMOTESYSTEMID:"caseInfo.headers.RemoteSystemID",CASE_RELATED_CASE_TYPES:"caseInfo.relatedCaseTypes",CASES:"caseInfo.cases",GETNEXTWORK:"caseInfo.confirmationLinks.getNextWork",ACTION_REFRESH_CONDITIONS:"caseInfo.assignments[0].actions[0].refreshConditions",IS_LOCAL_ACTION:"caseInfo.isLocalAction",BUSINESS_ID:"caseInfo.businessID",IS_FIRST_ASSIGNMENT:"caseInfo.isFirstAssignment"},ACTIONS:{ACTION_ID:"actionID",ACTIONS:"availableActions",DELETEAVIALACTIONS:"deleteAvailActions",FLOWACTION:"FlowAction",DATA_PAGES:{D_PY_ADDITIONAL_CASE_ACTIONS:"D_pyAdditionalCaseActions"}},PROCESS:{FLOWPROBLEMS:"FlowProblems"},PAGE_TYPES:{PAGE:"page",LANDINGPAGE:"landingpage",LISTPAGE:"listpage"},LOCAL_ACTION_TYPE:{CASE_WIDE:"case",EXPRESS:"express",ASSIGNMENT:"Assignment",LOCAL_ACTION:"LocalAction"},LOCAL_ACTIONS:{TRANSFER_ASSIGNMENT:"pyTransferAssignment"},CONTENT:"content",MODAL:"modal",STOPMERGEACTIONS:"stopMergeActions",IS_CREATE_DATA_OBJECT:"isCreateDataObject",SUMMARY_OF_ASSIGNMENT_LAST_SUBMIT_TIME:"context_data.caseInfo.content.summary_of_assignment__.lastSubmitTime",SUMMARY_OF_ATTACHMENTS_LAST_REFRESH_TIME:"context_data.caseInfo.content.summary_of_attachments__.lastRefreshTime",CONTEXT_DATA_ASSIGNMENTID:"context_data.assignmentID",BANNER_VARIANT_SUCCESS:"success",BANNER_VARIANT_WARNING:"warning",BANNER_VARIANT_URGENT:"urgent",BANNER_VARIANT_INFO:"info",MESSAGES:{MESSAGES_TYPE_SUCCESS:"success",MESSAGES_TYPE_INFO:"info",MESSAGES_TYPE_ERROR:"error"},PUB_SUB_EVENTS:{EVENT_RENDER_APP:"renderApp",EVENT_UNMOUNT_APP:"unmountApp",EVENT_REAUTH:"reAuth",EVENT_FULL_REAUTH:"fullReAuth",EVENT_CUSTOM_REAUTH:"customReAuth",EVENT_CANCEL:"cancel",EVENT_MINIMIZE:"minimize",EVENT_EXPRESS_LOCALACTION:"expressLocalActionSubmit",EVENT_LOCALACTION_SUBMISSION:"localActionSubmit",EVENT_BULKACTION:"bulkActionSubmit",EVENT_SHOW_CANCEL_ALERT:"showCancelAlert",EVENT_SHOW_DELETE_ALERT:"showDeleteAlert",EVENT_DASHBOARD_FILTER_CHANGE:"dashboardFilterChange",EVENT_DASHBOARD_FILTER_CLEAR_ALL:"dashboardFilterClearAll",EVENT_PROMOTED_FILTERS_CHANGE:"promotedFiltersChange",EVENT_LOGOFF:"Logoff",EVENT_TRANSIENT_ITEMS:{UPDATE_PROMOTED_FILTERS:"updatePromotedFilters"},UI_EVENTS:{SHOW_PAGE_INIT:"showPageInit",SHOW_PAGE_DONE:"showPageDone",SHOW_PAGE_STARTED:"showPageStarted"},CASE_EVENTS:{CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW:"caseAttachmentsUpdateFromCaseview",CASE_FOLLOWER_UPDATED_BY_OPERATOR_FROM_CASEVIEW:"caseFollowerUpdateByOperatorFromCaseview",CASE_FOLLOWER_UPDATE_BY_OPERATOR_FROM_WIDGET:"caseFollowerUpdateByOperatorFromWidget",CASE_CREATED:"caseCreated",CREATE_STAGE_DONE:"caseCreatedDone",CREATE_STAGE_CANCELLED:"caseCancelled",CREATE_STAGE_SAVED:"caseSaved",CREATE_STAGE_DELETED:"caseDeleted",ASSIGNMENT_SUBMISSION:"assignmentSubmission",END_OF_ASSIGNMENT_PROCESSING:"endOfAssignmentProcessing",CLOSE_CONFIRM_VIEW:"closeConfirmView",CASE_OPENED:"caseOpened",CASE_CLOSED:"caseClosed",ASSIGNMENT_OPENED:"assignmentOpened",CASE_PREVIEW:"casePreview",CURRENT_ASSIGNMENT_UPDATED:"currentAssignmentUpdated",CASE_LOCK_EVENT:"caseLockEvent",NOTIFICATION_UPDATED:"notificationUpdated"},BOOTSTRAP_SHELL_EVENTS:{CONSTELLATION_LOADED:"CONSTELLATION_LOADED"},CONTAINER_EVENTS:{CLOSE_CONTAINER_ITEM:"CLOSE_CONTAINER_ITEM",CLOSE_MULTI_TYPE_PRIMARY_CONTAINER_ITEM:"CLOSE_MULTI_TYPE_PRIMARY_CONTAINER_ITEM"},DISPLAY_CASE_CREATED_TOASTER:"displayCaseCreatedToaster",DATA_EVENTS:{DATA_OBJECT_CREATED:"dataObjectCreated",DATA_OBJECT_DELETED:"dataObjectDeleted",DATA_OBJECT_UPDATED:"dataObjectUpdated"},FETCH_SUCCESS:"fetchSuccess",REVERSE_COEXISTENCE_EVENTS:{HANDLE_DISCARD:"handleDiscard",CHECK_IS_FORM_DIRTY:"checkIsFormDirty"},TIMEOUT_REMINDER:"sessionAboutToTimeout",RESET_TIMER:"resetInactivityTimer"},CONTAINER_TYPE:{MULTIPLE:"multiple",SINGLE:"single",HYBRID:"HybridViewContainer"},REMOTE_SYSTEM_ID:"RemoteSystemID",LIST_SELECTION_MODE:{MULTI:"multi",SINGLE:"single",MULTI_ON_HOVER:"multi_on_hover"},SUBMISSION_FAILURE_TYPE:{FORM_VALIDATION_ERROR:"formValidationError"},USER_SETTINGS:{UTILITY_PANEL_USER_STATE_PATH:"presentation.templates.CaseView.utilityPanelExpanded",SUMMARY_PANEL_USER_STATE_PATH:"presentation.templates.CaseView.summaryPanelExpanded",ASSIGNMENT_COLLAPSED_STATE_PATH:"presentation.templates.CaseView.assignmentWidgetCollapsed",CASE_VIEW_PATH:"presentation.templates.CaseView"},PROMISE_VALUE:{RESOLVE:"resolve",REJECT:"reject"},APP_TYPE:{UIKIT:"uikit",THEME_COSMOS:"themecosmos"},VIEW_TYPE:{PY_EMBEDASSIGNMENT:"pyEmbedAssignment",PY_DETAILS:"pyDetails"}},j={CONTEXT:"context",AJAXCONTAINER:"primary",VIEW_CONTAINER:"ViewContainer",APP_SHELL:"AppShell",ROOT_CONTAINER:"RootContainer",HYBRID:"hybrid",HYBRID_VIEW_CONTAINER:"HybridViewContainer",HYBRID_ROOT_CONTAINERNAME:"hybridRootContainerName",MODAL_VIEW_CONTAINER:"ModalViewContainer",FLOW_CONTAINER:"FlowContainer",PREVIEW_VIEW_CONTAINER:"PreviewViewContainer",OBJECT_PAGE:"ObjectPage",CASE_CREATE_STAGE:"CaseCreateStage",CASE_VIEW:"CaseView",VIEW:"view",CASE_PREVIEW:"CasePreview",CASE_STAGES:"Stages",CASEMESSAGES:"caseMessages",SUGGESTION:"suggestion",PREVIEW:"preview",TERTIARY:"tertiary",DEFAULT:"default",ACPRIMARY:"primary",ACTERTIARY:"tertiary",PERFORM_MODE:"perform",CASE_VIEW_MODE_PROP:".caseViewMode",REVIEW_MODE:"review",WORKAREA:"workarea",ACPRIMARY_NAME:"ACPRIMARY",ACTERTIARY_NAME:"ACTERTIARY",THREADNAMESEPARATOR:"/",JOINCHARACTER:"_",FORWARD_SLASH_STRING:"/",UNDERSCORE_STRING:"_",WORK_ID:"WORK_ID",EMPTY_STRING:"",PROPERTY_MESSAGES:"propertyMessages__",CONTEXT_MESSAGES:"contextMessages__",HTTP_MESSAGES:"httpMessages__",PAGE_MESSAGES:"pageMessages__",SUMMARY_OF_LISTS:"summary_of_lists__",SUMMARY_OF_GROUPS:"summary_of_groups__",SUMMARY_OF_MESSAGES:"summary_of_messages__",SUMMARY_OF_FIELD_VALUES:"summary_of_field_values__",SUMMARY_OF_WHEN_CONDITIONS:"summary_of_when_conditions__",SUMMARY_OF_EXPRESSIONS:"summary_of_expressions__",SUMMARY_OF_ASSOCIATED_LISTS:"summary_of_associated_lists__",CONTEXT_DATA:"context_data",TABLE:e=>`Table[${e}]`,HTTP:"HTTP",PROPERTY:"PROPERTY",PAGE_ERRORS:"page_level_errors",NO_MESSAGES:"No messages existing",PULSE_REFERENCE:"pulse.messages",IS_LOADING:"isLoading",APPROVED:"Approved",REJECTED:"Rejected",DUPLICATE:"Duplicate",IGNORE:"Ignore",PARAGRAPH:"PARAGRAPH",X_ORIGIN_CHANNEL:"x-origin-channel",AUTHORING_PREVIEW_CONTAINER:"root/authoring-preview",ERROR_FIELD_IN_PAGE:"erroneousInputOutputFieldInPage",ERROR_IN_PAGE_IDENTIFIER:"erroneousInputOutputIdentifier",UI_RESOURCES:"uiResources",UI_RESOURCES_CONTEXT_DATA:"uiResources.context_data",ACTION_BUTTONS:"uiResources.actionButtons",RESOURCES:"uiResources.resources",ROOT:"uiResources.root",CASE_INFO_IS_LOCAL_ACTION:"caseInfo.isLocalAction",DATA:"data",OPTIONS:"options",VIEWS:"uiResources.resources.views",NAVIGATIONS:"uiResources.resources.navigations",COMPONENTS:"uiResources.components",LOCALE_REFERENCES:"uiResources.localeReferences",STATIC_SERVER_URL:"staticServer",APPLICATION_DATA:"data.Application",REFERENCED_USERS:"referencedUsers",CASE_INFO_REFRESH_CONDITIONS:"caseInfo.refreshConditions",FIELD_LEVEL_SUCCESS:"success",FIELD_LEVEL_WARNING:"warning",FIELD_LEVEL_ERROR:"error",HASH_DELIMITER:"~^|^~",NULL_STRING:"null",DATA_PAGE:"DataPage",DECISION:"Decision",RULE_REFERENCE:"RuleReference",GET_PAGE_DATA:"getPageData",PROPERTY_ANNOTATION:"@P",FIELD_LABEL_ANNOTATION:"@FL",ATTACHMENT_ANNOTATION:"@ATTACHMENT",ASSOCIATED_PROPERTY_ANNOTATION:"@ASSOCIATED",CLASS_ANNOTATION:"@CLASS",ASSOCIATED:"associated",CLASS_ID:".classID",CLASSID:"classID",READONLY:"readonly",SHARED:"shared",RELOAD_IF_OLDER_THAN:"reloadIfOlderThan",RELOAD_ONCE_PER_INTERACTION:"reloadOncePerInteraction",PY_DETAILS:"pyDetails",PY_CONFIRM:"pyConfirm",LIST_ACTIONS:{INSERT:"INSERT",UPDATE:"UPDATE",DELETE:"DELETE",DELETE_ALL:"DELETE ALL",MOVE:"MOVE",SELECT:"SELECT",DESELECT:"DESELECT"},LIST_ACTIONS_TYPE:{SELECT_DESELECT:"SELECT_DESELECT",DESELECT_ALL:"DESELECT_ALL"},ENV_INFO_KEYS:{APPLICATION_NAME:"APPLICATION_NAME",APPLICATION_DESC:"APPLICATION_DESC",ACCESS_GROUP:"ACCESS_GROUP",USER_NAME:"USER_NAME",USER_ID:"USER_ID",USER_IMAGE:"USER_IMAGE",LOCALE:"LOCALE",TIMEZONE:"TIMEZONE",WORK_GROUP:"WORK_GROUP"},ID:"ID",SCALARLIST:"ScalarList",COREHEADERS:"coreHeaders",SKIPCOREHEADERS:"skipCoreHeaders",COREHEADER_APP_DEBUG_ID:"X-Pega-App-Debug-ID",COREHEADER_APP_DEBUG_LEVELS:"X-Pega-App-Debug-Levels",CONTEXT_DATA_MODAL_VIEW:{IS_MULTI_RECORD_DATA:"context_data.modalView.isMultiRecordData",VIEW_NAME:"context_data.modalView.viewName",PARENT_CONTEXT:"context_data.modalView.parentContext",INTERESTPAGE:"context_data.modalView.interestPage"},DATA_CLASS_NOT_FOUND:"Data object class not found",PRIORITY:{CRITICAL:100,HIGH:500,MEDIUM:1e3,LOW:2e3,TRIVIAL:3e3},...F,EMBED:"EMBED",getProperty:e=>U.map(e)},V="pyRemoteCaseDetails";class k{static remoteCaseMapping={};static setRemoteCaseMapping=e=>{this.remoteCaseMapping=e,this.setAdditionalParameters()};static getRemoteCaseMapping=()=>this.remoteCaseMapping;static getRemoteCase=e=>this.remoteCaseMapping?.[e];static isRemoteCase=e=>!!(e&&this.remoteCaseMapping&&this.remoteCaseMapping[e]);static getRemoteHeaderByContext=e=>Fh.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=_p.environmentInfoObject?.pyRemoteCaseTypeList;e?.forEach((e=>{const t=this.getRemoteCase(e.pyWorkTypeImplementationClassName);t&&(t.name=e.pyWorkTypeName)}))};static getRemoteHeaderFromSourceClass=e=>{const t=Object.values(this.remoteCaseMapping).find((t=>t.RemoteClassName===e));return t?.RemoteSystemID}}const $=k,B={},G=new Map,W=e=>{let t=j.EMPTY_STRING;return t=e&&e.includes(j.FORWARD_SLASH_STRING)?e.substring(0,e.lastIndexOf("/")):e,t},H=(e,t,n=!1)=>{let r=j.EMPTY_STRING;if(t&&e){let s=`${t}${j.FORWARD_SLASH_STRING}${e}`;const a=hd(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""},Y=(e,t)=>{if(e&&t){const n=G[t]?.[e];return n?`${t}${j.FORWARD_SLASH_STRING}${e}_${n}`:q(e,t)}return""},z=e=>{let t=j.EMPTY_STRING;return e&&(t=e.substring(e.lastIndexOf("/")+1,e.lastIndexOf("_")).toLowerCase()),t},K=(e,t)=>{if(null===e)return t;const[,n]=t.split(j.FORWARD_SLASH_STRING);return e+j.FORWARD_SLASH_STRING+n},X=e=>{const t=e.indexOf(j.FORWARD_SLASH_STRING),n=e.lastIndexOf(j.FORWARD_SLASH_STRING);return t===n?e:e.substring(0,n)},J=e=>{const t=e.split(j.FORWARD_SLASH_STRING);return 2===t.length?e:t[0]+j.FORWARD_SLASH_STRING+t[2]},Q="SET_PROPERTY",Z="REPLACE_PROPERTY",ee="FIELD_CHANGE",te="LOAD_VIEW",ne="SHOW_PAGE",re="SHOW_DATA",se="SHOW_INSIGHT",ae="SHOW_DASHBOARD",oe="SET_LOADING",ie="RESET_LOADING",ce="SET_SHARED_PROPERTY",le="CREATE_WORK",ue="OPEN_WORK_BY_HANDLE",de="UPDATE_DOCUMENT",pe="FINISH_ASSIGNMENT",he="CANCEL_ASSIGNMENT",ge="OPEN_ASSIGNMENT",fe="MERGE_DATA",me="REMOVE_ITEM",ye="GET_DATAOBJECT_ACTIONS",Ie="SHOW_HISTORY",Ee="ERROR",Ae="INIT_CONTAINERS",_e="RESET_CONTAINERS",Ce="ADD_CONTAINER_ITEM",Se="REMOVE_CONTAINER_ITEM",Te="ADD_TRANSIENT_ITEM",Ne="UPDATE_TRANSIENT_DATA",Pe="REMOVE_TRANSIENT_ITEM",Re="REMOVE_ALL_TRANSIENT_ITEMS",De="CLEAR_TRANSIENT_DATA",be="PURGE_TRANSIENT_DATA",Oe="REPLACE_TRANSIENT_DATA",ve="ACTIVATE_CONTAINER_ITEM",xe="UPDATE_CONTAINER_ITEM",we="UPMERGE_AND_REMOVE_CONTAINER_ITEM",Me="REPLACE_CONTAINER_ITEM",Le="ACTIVATE_MODAL_CONTAINER_ITEM",Ue="REMOVE_CONTAINER",Fe="ADD_SUGGESTION_CONTEXT",je="showView",Ve="showData",ke="showInsight",$e="showDashboard",Be="openWorkByHandle",Ge="openAssignment",We="createNewWork",He="SHOW_CANCEL_ALERT",qe="openLocalAction",Ye="openProcessAction",ze="caseWideActions",Ke="openBulkAction",Xe="performBulkAction",Je="launchAssignment",Qe="ADD_MESSAGES",Ze="CLEAR_MESSAGES",et="RESET_STORE",tt="FETCH_DATAPAGE",nt="ADD_SHARED_DATA",rt="REMOVE_SHARED_DATA",st="LIST_ACTION",at="DELETE_CASE_SUMMARY",ot="ALTER_BLOCKING_ACTION_COUNT",it="CREATE_DATA_OBJECT",ct="DELETE_DATA_OBJECT",lt="VIEW_DATA_OBJECT",ut="UPDATE_DATA_OBJECT",dt="OPEN_DATA_OBJECT_ACTION",pt="SUBMIT_DATA_OBJECT_ACTION",ht="OPEN_EMBEDDED_DATA_MODAL",gt="SUBMIT_EMBEDDED_DATA_MODAL",ft="FILL_FORM_WITH_AI",mt="openCase",yt=(e,t)=>{if(!e||!t)return null;let n,r=j.EMPTY_STRING;return t&&(r=`${t}${j.FORWARD_SLASH_STRING}${e}`,n=hd(r),n||t.includes("/")?n||(r=yt(e,W(t))):r=`${t}${j.FORWARD_SLASH_STRING}${e}`),r},It=(e,t)=>{const n=yt(e,t);return n&&hd(n)?hd(n):{}},Et=(e,t)=>Ap.getSemanticURL(je,{page:e},t);const At=new class{error=e=>{console.error(e)}};class _t{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=bt[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}=bt[this._state];this._subParser=new _t(this._grammar,e,t)}_endSubExpression(){bt[this._state].subHandler.call(this,this._subParser.buildAst()),this._subParser=null}setPositionInAST(e){this._position?(this._position.right=e,_t._setParent(e,this._position)):this._tree=e,this._position=e}}const Ct=_t,St="identifier",Tt={operatorType:"binaryOperator",precedence:1,evaluate:(e,t)=>e&&t},Nt={operatorType:"binaryOperator",precedence:1,evaluate:(e,t)=>e||t},Pt={">":{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"},"&&":Tt,AND:Tt,and:Tt,"||":Nt,OR:Nt,or:Nt,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)}},Rt={BinaryExpression:function(e){const t=[];let n="";return t[0]=this.evaluateAST(e.left),e.left.operationType===St&&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?Fh.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};Ct._setParent(this._position,r),this._position=n,this.setPositionInAST(r)},identifier:function(e){const t={operationType:St,value:e.value};this.setPositionInAST(t)},literal:function(e){this.setPositionInAST({operationType:"literal",value:e.value})},subExpression:function(e){this.setPositionInAST(e)}},bt={expectOperand:{operatorTypes:{literal:{toState:"expectBinOp"},identifier:{toState:St},unaryOperator:{},openParenthesis:{toState:"subExpression"}}},expectBinOp:{operatorTypes:{binaryOperator:{toState:"expectOperand"}}},identifier:{operatorTypes:{binaryOperator:{toState:"expectOperand"}}},subExpression:{subHandler:Dt.subExpression,endStates:{closeParenthesis:"expectBinOp"}}},Ot=["binaryOperator","unaryOperator","openParenthesis"],vt=/^\s*$/,xt=/^[a-zA-Z_.$][(0-9)a-zA-Z0-9_.$]*$/,wt=/\\\\/,Mt=["'(?:(?:\\\\')|[^'])*'",'"(?:(?:\\\\")|[^"])*"',"\\s+","\\btrue\\b","\\bfalse\\b"],Lt=["[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]+)"],Ut=/^-?(?:(?:[0-9]*\.[0-9]+)|[0-9]+)$/;class Ft{constructor(e){this._grammar=e}static _isNegative(e){return Ot.some((t=>t===e[e.length-1].tokenType))}static _isWhitespace(e){return!!e.match(vt)}static _createWordboundary(e){return(e=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).match(xt)&&(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(wt,"\\")}_getSplitRegex(){if(!this._splitRegex){const e=Object.keys(this._grammar).sort(((e,t)=>t.length-e.length)).map((e=>Ft._createWordboundary(e)),this);this._splitRegex=new RegExp(`(${[Mt.join("|"),e.join("|"),Lt.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=Ft._unquote(e):e.match(Ut)?t.value=parseFloat(e):"true"===e||"false"===e?t.value="true"===e:this._grammar[e]?t.tokenType=this._grammar[e].operatorType:e.match(xt)&&(t.tokenType="identifier"),t}_getTokens(e){const t=[];let n=!1;for(let r=0;r<e.length;r+=1)Ft._isWhitespace(e[r])?t.length&&(t[t.length-1].element+=e[r]):"-"===e[r]&&Ft._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 jt=Ft;const Vt=class{constructor(e,t){this._grammar={...Pt},this._expression=e,this._ast=null,this._context={},this._contextTreeNodeContext=null,this._localDataObject=t}buildAST(){const e=new jt(this._grammar).tokenize(this._expression),t=new Ct(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 Rt[e.operationType].call(this,e,t)}},kt=(e,t)=>{const n=e.replace(/[a-zA-Z0-9_)"'\s]=[a-zA-Z0-9_("'\s]/,(e=>e.replace("=","==")));return new Vt(n,t)},$t=e=>!e||e.buildAST(),Bt=(e,t,n)=>!e||e.evaluate(t,n),Gt=(e,t,n)=>{const r=kt(e,t),s=$t(r);return Bt(s,n)};const Wt=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:Fh.getPropertyValue(`${n}.pxObjClass`,null,t)||Fh.getPropertyValue(`${n}.pyClassName`,null,t)}}static updateState(e,t){Object.keys(e).forEach((n=>mh({type:Q,payload:{context:t,reference:n,value:e[n]}})))}},Ht={},qt=(e,t)=>Ht[t]&&Object.prototype.hasOwnProperty.call(Ht[t],e),Yt=e=>{const{context:t}=e;qt(e.reference,t)&&Wt.handleExpression(e.reference,e.value,Ht[t][e.reference],t)},zt=(e={})=>{wh.copy(e,Ht)},Kt=(e,t,n)=>Gt(e,t,n?.pConnect.getPConnect());const Xt=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 Jt=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={}){wh.copy(e,this.componentMap)}mergeOverrideMap(e={}){wh.copy(e,this.overrideMap)}getOverrideMap(){return this.overrideMap}getLazyMap(){return this.lazyMap}};const Qt=new class{constructor(){this.handlers={}}registerHandler(e,t){this.handlers[e]=t}getHandler(e){return this.handlers[e]}};const Zt=class{static handleAnnotation(e,t,n){const r=e.indexOf(" "),s=-1===r?e:e.substring(0,r),a=Qt.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 Qt.getHandler(n)?r:e}static handleComponentMapping(e,t,n){const r=Jt.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&&wh.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(wh.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 wh.isString(e)&&!!e?.startsWith(j.PROPERTY_ANNOTATION)}},en=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},tn=(e,t)=>{if(e&&t){const n=wh.getIn(t,["assignments","0","assigneeInfo"],{}),{ID:r,type:s}=n;return"worklist"===s?.toLowerCase()&&r===e}return!1},nn=e=>{const{activeActionID:t,availableActions:n}=e||{};if(t&&n){const e=n.find((e=>e.ID===t));return Boolean(e)}return!1},rn=(e,t)=>{const n=Fh.getPropertyValue(F.CASE_INFO.ACTIVE_ACTION_ID,t,e),r=Fh.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=yh(e);s=t?.context_data?.actionType===j.CASE}return s},sn=e=>_h(null,j.CASE_VIEW_MODE_PROP,e)===j.PERFORM_MODE&&(e.includes(j.WORKAREA)||e.includes(j.MODAL)),an=e=>{const t=e?.parentCaseInfo?.ID;return Boolean(e&&t)},on=(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},cn=(e,t,n)=>{let r,s,a,o,i,c,l,u,d;const p=yh(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 ln=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&&mh({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]&&mh({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 un=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&&ln.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),ln.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),ln.disableLoadingIndicator(r.actionPayload,t)):s=null,s}};class dn{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 dn(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 pn=dn;const hn=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}},gn=/(([^.]+)\[\d+\])/g,fn=e=>{if((e?.split(".")??[]).length<3)return[e];const t=e?.match(gn);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]},mn=(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:yn,WHEN:In,DECLARATIVE_TARGET:En,PAGELIST:An}=j.CONTEXT_TREE_NODE_TYPES;const _n=class{constructor(e,t,n={}){this.type=e,this.name=t,this.children=[],this.eventSubscribers=[],this.props=n,this.references=new Map([[yn,new Map],[In,new Map],[En,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===An){const n=this.references.get(yn);n.set(e,t),this.references.set(yn,n)}}}removePageListNodes(e,t){const n=this.children.filter((t=>t.name.startsWith(e))).filter((n=>{const r=mn(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(yn),s=this.references.get(En);[...r.keys(),...s.keys()].filter((t=>t.startsWith(e))).filter((e=>{const[,,n]=fn(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 pn(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 hn(t,n,r,s),i=this.references.get("WHEN");i?.set(a,o)}},{VIEW:Cn,FIELD:Sn,CONTEXT:Tn,DECLARATIVE_TARGET:Nn,WHEN:Pn}=F.CONTEXT_TREE_NODE_TYPES;const Rn=new class{constructor(){this.rootNodes={}}_isContextNodeExist(e){return Object.keys(this.rootNodes).includes(e)}addContextNode(e){if(!this._isContextNodeExist(e)){const t=new _n(Tn,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}`,Sn,s),a?.removeReference(`${t}${r}`,Nn,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===Cn?this.removeChildViewNodes(e,t,a.name,r):(s.removeReference(a.name,Sn,a.props.index),s.removeReference(a.name,Nn,a.props.index),"PAGELIST"!==a.type&&"Address"!==a.props?.componentName||this.deleteAllListNodes(e,a.name))})),a?.references.delete(n)}deleteAllListNodes(e,t){const n=n=>{const r=this.getContextNode(e),s=r?.references?.get(n);if(s)for(const[e]of s)(e===t||e.startsWith(`${t}.`)||e.startsWith(`${t}[`))&&r?.references?.get(n)?.delete(e)};n(Sn),n(Nn)}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(Sn),r(Nn)}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(Sn,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(Nn,`${t}${r}`,a):i.addNode(Sn,`${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}${r}`,n=t.substring(0,t.lastIndexOf("["))||e.substring(0,e.lastIndexOf("["));let s=o.getReference(n,Sn);s||(s=i.addNode(Sn,n,{}),o.addReference(n,s))}}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]=fn(t);n.startsWith(".")&&(n=n.substring(1)),o&&this.mutatePageList(e,a,o,{...r,rowIndex:i},!0);const c=s?.getReference(`${t}.${n}`,Sn);c&&c instanceof pn&&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}`,Sn);o&&o instanceof pn&&o.triggerEvent(r,s)}getFieldsList(e){const t=this.getContextNode(e);return t?.references.get(Sn)}getFieldReferenceForProperty(e,t){let n=this.getContextNode(e)?.references?.get(Sn)?.get(t);return n||(n=this.getContextNode(e)?.references?.get(Nn)?.get(t)),n}getFieldReferencePreviousValue(e,t){let n=this.getContextNode(e)?.references?.get(Sn)?.get(t);return n||(n=this.getContextNode(e)?.references?.get(Nn)?.get(t)),n?.value}updateFieldNodeValue(e,t,n){const r=this.getContextNode(e)?.references?.get(Sn)?.get(t);r instanceof pn&&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,Sn),n=this.getContextReferencesByType(e,Nn);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,Sn)?.get(t)||!!this.getContextReferencesByType(e,Nn)?.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(Nn)||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(Pn)||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"},bn=e=>({type:Dn.REFRESH_DATA,payload:e}),On={},vn=(e,t,n,r,s)=>{if(!(e&&n&&t))return;const a=s.actionMgrID||un.getNextActionMgrId(),o={ID:e,actionID:t,context:n,caseWideAction:r,options:{...s,actionMgrID:a}};s.isFillFormWithAI?mh((e=>({type:ft,payload:e}))(o)):mh(bn(o))},xn=(e,t,n,r,s)=>{if(!(e&&n&&t))return;r&&(r=wh.convertPageRefToClipboardPageNotation(r));mh(bn({ID:e,viewID:t,context:n,options:s,caseViewAction:!0,interestPage:r}))},wn=(e,t,n)=>{On[t]||(On[t]={}),e&&!On[t][e]&&(On[t][e]={pageReference:n})},Mn=(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=Gp(n.propertyName,e.getValue(j.CLASS_ID,n.pageName));return!!s?.isDeclarativeTarget},Ln=e=>{let t=!1;if(e.isWhenExist())t=!0;else{const n=e.getRawMetadata()?.config?.value;if(n){const r=Gp(Zt.getLeafPropertyName(n),Fh.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=Mn(e,r)),n};t.some(r)}else if("object"==typeof t)for(const r in t)if(t[r].startsWith("@P")&&(n=Mn(e,t[r]),n))break;return n})(e,r?.datasource?.parameters)),t||(t=r?.datasource?.tableType===j.DECISION)}}t&&wn(e.getCurrentView(),e.getContextName(),e.getPageReference())},Un=(e,t,n)=>{const r=rn(e,t),s=Fh.getPropertyValue(F.CASE_INFO.ACTIVE_ACTION_ID,t,e)?Fh.getPropertyValue(F.CASE_INFO.ACTIVE_ACTION_ID,t,e):Fh.getPropertyValue(F.CASE_INFO.ASSIGNMENTACTION_ID,t,e);let a;a=r?Fh.getPropertyValue(F.CASE_INFO.CASE_INFO_ID,t,e):Fh.getPropertyValue(F.CASE_INFO.ASSIGNMENT_ID,t,e)?Fh.getPropertyValue(F.CASE_INFO.ASSIGNMENT_ID,t,e):Fh.getPropertyValue(F.CONTEXT_DATA_ASSIGNMENTID,t,e),vn(a,s,e,r,n)},Fn=e=>{const{context:t,pageReference:n}=e,r=(e=>On[e]&&Object.keys(On[e]).length>0&&sn(e))(t);if(!r)return;if(Fh.getPropertyValue(j.CONTEXT_DATA_MODAL_VIEW.IS_MULTI_RECORD_DATA,n,t)){const e=Fh.getPropertyValue(F.CASE_INFO.CASE_INFO_ID,n,t),r=Fh.getPropertyValue(j.CONTEXT_DATA_MODAL_VIEW.VIEW_NAME,n,t),s=Fh.getPropertyValue(j.CONTEXT_DATA_MODAL_VIEW.INTERESTPAGE,n,t);xn(e,r,t,s,{})}else Un(t,n,{})},jn=(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},Vn=e=>{const t=(e=>{const t=[];return Rn.getDeclarativeTargets(e).forEach((({name:e,pageReference:n})=>{const r=n.split(".");r.shift();let s=r.join(".");e&&s&&(s=wh.convertPageRefToClipboardPageNotation(s),t.push({name:e,context:s}))})),t})(e),n=(e=>{const t=[];return Rn.getWhens(e).forEach((({name:e,type:n,pageReference:r})=>{const s=r.split(".");s.shift();let a=s.join(".");e&&a&&(a=wh.convertPageRefToClipboardPageNotation(a),t.push({name:e,context:a,type:n}))})),t})(e);return{fieldsWithDeclarativeTargets:t,whens:n}},kn=(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,t)=>{const n=e.url===t.url,r=e.interestPage===t.interestPage;return n&&r})(e,t);if(s&&r)return!0;if(n){if(a)return"CANCEL_REFRESH";if(r)return!1}return!1};const $n=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}},Bn={CONTENT_FIELDS_PATH:[j.CONTEXT_DATA,j.CASE_INFO.CASE_INFO,j.CONTENT],DATA_OBJECT_CONTENT_FIELDS_PATH:[j.CONTEXT_DATA,j.DATA_INFO.DATA_INFO,j.CONTENT],FIELD_MESSAGES_PATH:[j.CONTEXT_DATA,j.CASE_INFO.CASE_INFO,j.CONTENT,j.SUMMARY_OF_MESSAGES,j.PROPERTY_MESSAGES],DATA_OBJECT_FIELD_MESSAGES_PATH:[j.CONTEXT_DATA,j.DATA_INFO.DATA_INFO,j.CONTENT,j.SUMMARY_OF_MESSAGES,j.PROPERTY_MESSAGES],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]},Gn=(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=[...Bn.PAGE_MESSAGES_PATH]:n===j.HTTP?a=[...Bn.HTTP_MESSAGES_PATH]:n===j.CASEMESSAGES?a=[...Bn.CASE_MESSAGE_PATH]:r&&(a=[j.CONTEXT_DATA,...o.split(".")]);return a.filter(Boolean)},Wn=(e,t,n)=>{const r={content:{}},s=`${t}[${n}]`,a=wh.getIn(e?.content,s.split("."));return a&&wh.setIn(r.content,s.split("."),{...a}),r},Hn=(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)}]`]=wh.getIn(e[t],[j.CONTEXT_DATA,...s.split(".")]),wh.deleteIn(e[t],[j.CONTEXT_DATA,...s.split(".")])}));const l=Object.keys(o);l.length>0&&l.forEach((n=>{wh.setIn(e[t],[j.CONTEXT_DATA,...n.split(".")],o[n])}))},qn=(e,t,n,r,s)=>{const a=wh.deepClone(wh.getIn(e,[`${t}`])),o=wh.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=wh.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(Wn(o,c,r).content[`${c}[${r}]`]){const o={},i=`${n}[${r}]`,c=wh.getIn(a,[j.CONTEXT_DATA,...i.split(".")]);o[`${n}[${s}]`]=c,wh.deleteIn(e[t],[j.CONTEXT_DATA,...i.split(".")]),Hn(e,t,l,r,s,n,o)}else Hn(e,t,l,r,s,n)},Yn=e=>{const{type:t,property:n,category:r,context:s,pageReference:a}=e;let o;n&&(o=n.slice(1));const i=yh(s);let c=[];const l=wh.getIn(i,Gn(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&&Rn.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?(Rn.mutateField(s,n,t,{type:Ze,fieldName:t}),l.property=t,l.pageReference=n):o?(l.pageReference=n,l.isListEntry=o,l.deletingIndex=c):l.category=r,mh(i?{type:Ze,payload:{stateObj:e.stateObj,context:s}}:{type:Ze,payload:l})},Kn=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,mh({type:Qe,payload:o})},Xn=(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]&&Xn(e[r],t,n)}t.pop()}return n},Jn=(e,t)=>{let n=Yn({context:j.APP.ROOT,category:"HTTP"});if(_p.getRenderingMode()===j.EMBED){const e=Yn({context:j.APP.APP,category:"HTTP"});e&&(n=n?n.concat(e):e)}if(e){const e=Yn({context:t,category:"HTTP"});n?e&&(n=n.concat(Yn({context:t,category:"HTTP"}))):n=Yn({context:t,category:"HTTP"})}return n},Qn=e=>{let t=null;t=Od(e)[0]?Td(Od(e)[0]):e,t&&zn({context:t,stateObj:yh(t),clearContextMessages:!0})},Zn={addMessages:Kn,getValidationErrorMessages:e=>{const t=yh(e),n=[],r=(e=>{let t=Bn.CONTENT_FIELDS_PATH;return e?.dataInfo?.content&&(t=Bn.DATA_OBJECT_CONTENT_FIELDS_PATH),t})(t),s=wh.getIn(t,[...r])||{};return Xn(s,[],[]).forEach((e=>{const t=wh.getIn(s,[...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:Tp.getLocaleValue(e.message,"Messages")}):n.push(Tp.getLocaleValue(e.message,"Messages")))}))}))})),n},getMessages:Yn,clearMessages:zn,getRootContainerHttpMessages:Jn,clearContextMessagesInActiveWorkArea:Qn},er=Zn;const tr=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:{...wh.unflatten(n)}},o=JSON.parse(JSON.stringify(a));delete o.content.classID;return{instruction:{target:wh.buildInstructionPageReference(r,e),content:{...o.content},listIndex:t,instruction:"INSERT"},actionPayload:a,displayPropertPayload:s}}};const nr=class{static execute(e,t,n,r,s,a,o){const i={instruction:"UPDATE",content:{...wh.unflatten(r)},isDefault:o},c={content:{...i.content},target:wh.buildInstructionPageReference(s,t),listIndex:n,instruction:"UPDATE"};return a||mh(Ag({...i,listIndex:n-1,context:e,referenceList:`${s}${t}`})),c}};const rr=class{static execute(e,t,n){return{target:wh.buildInstructionPageReference(n,e),listIndex:t,instruction:"DELETE"}}};const sr=class{static getDeleteAllInstruction(e,t){return{instruction:"DELETE ALL",target:wh.buildInstructionPageReference(e,t)}}static execute(e,t,n,r){r||mh(Ag({instruction:"DESELECT_ALL",context:e,referenceList:`${n}${t}`}))}};const ar=class{static execute(e,t,n,r){return{target:wh.buildInstructionPageReference(r,e),listMoveToIndex:n,listIndex:t,instruction:"MOVE"}}};const or=class{static execute(e,t,n,r){return{content:{...{...wh.unflatten(n)}},target:wh.buildInstructionPageReference(r,t),instruction:"REPLACE"}}};const ir=class{static execute(e,t){return{target:wh.buildInstructionPageReference(t,e),instruction:"DELETE"}}};const cr=class{constructor(e){this.next=null,this.automatic=!1,this.instruction=e,this.previous=null,this.childrenStateMachines=[]}};const lr=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 cr(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=ol(t),a={};let o=!0;n&&(a[ol(n)]=crypto.randomUUID(),o=!1);const i={[s]:wh.getIn(e,s),...a};this.update(i,r+1,o,{isDefault:!0})}))})):r.forEach(((e,t)=>{if(n&&!e[ol(n)]){const e={};e[ol(n)]=crypto.randomUUID(),this.update(e,t+1,!1,{isDefault:!0})}}))}getChangeList(){return this.changeList}initChangeList(e){this.changeList[this.targetPageReference]=this.changeList[this.targetPageReference]||[],this.changeList[this.targetPageReference][e]=this.changeList[this.targetPageReference][e]||{}}update(e,t,n,r){const{isDefault:s=!1,skipPageinstruction:a}=r,o=nr.execute(this.contextName,this.target,t,e,this.pageReference,n,s);if(!a){if(this.initChangeList(t-1),!s){const n=this.changeList?.[this.targetPageReference]?.[t-1].content;this.changeList[this.targetPageReference][t-1]=Rh(wh.deepClone(n),e,r)}if(this.current?.automatic!==s||this.current?.instruction?.listIndex!==t||"UPDATE"!==this.current?.instruction.instruction)this.insertNode(o),s&&(this.current.automatic=!0);else{const t=this.current.instruction.content;this.current.instruction.content=Rh(wh.deepClone(t),wh.unflatten(e),r)}}}delete(e,t){const n=rr.execute(this.target,e,this.pageReference);this.changeList[this.targetPageReference]?.splice(e-1,1),this.insertNode(n),t||mh(Ag({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={}}=tr.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]=Rh(wh.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},mh(Ag({...a,listIndex:t-1,context:this.contextName,referenceList:`${this.pageReference}${this.target}`}))),i&&(this.current.automatic=!0)}replacePage(e){const t=or.execute(this.contextName,this.target,e,this.pageReference);this.insertNode(t)}deletePage(){const e=ir.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=ar.execute(this.target,e,t,this.pageReference);this.insertNode(r),mh(Ag({listIndex:e-1,listMoveToIndex:t-1,context:this.contextName,referenceList:`${this.pageReference}${this.target}`,instruction:"MOVE"}))}deleteAll(e){const t=sr.getDeleteAllInstruction(this.pageReference,this.target);this.changeList[this.targetPageReference]=[],this.insertNode(t),sr.execute(this.contextName,this.target,this.pageReference,e)}updatePage(e){const t=this.current.instruction.content;this.current.instruction.content=Rh(wh.deepClone(t),e)}},ur={},dr={},pr={},hr=(e,t,n)=>{ur[e]||(ur[e]={}),ur[e][t]||(ur[e][t]={content:[]}),dr[e]||(dr[e]=[],pr[e]=[]),sl.isStateMachineExist(e,n,t)||sl.setStateMachine(e,t,n,new lr(t,n,e))},gr=e=>$n.formatPageReference(e),fr=(e,t)=>{const n=dr[e],r=pr[e],s=ol(t),a=s?.substring(0,s.indexOf("["));r?.indexOf(a)<0&&pr[e].push(a),n?.indexOf(s)<0&&dr[e].push(s)},mr=e=>{delete dr[e]},yr=e=>sl.buildPageInstructionsByContext(e),Ir=e=>sl.buildPageInstructionsByContext(e,!0),Er=e=>{sl.clearStateMachines(e),delete ur[e]},Ar=(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]})))},_r=(e,t,n,r,s)=>{const{skipStateUpdate:a=!1}=s||{},o=n.getContextName(),i=n.getReferenceList(),c=r||n.getPageReference(),l=gr(i);hr(o,l,c),fr(o,`${i}[${t}]`),Ar(i,c,e,t);const u={instruction:j.LIST_ACTIONS.INSERT,content:{...wh.unflatten(e)}};delete JSON.parse(JSON.stringify(u)).content.classID;sl.getStateMachine(o,c,l).insert(e,t+1,a,{})},Cr=(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=gr(i);hr(o,l,c),fr(o,`${i}[${n}]`),Ar(i,c,e,n);sl.getStateMachine(o,c,l).update(e,n+1,s,r)},Sr=(e,t)=>{const[,n]=e.split("."),r=t?.split(".").pop();return n===r},Tr=(e,t,n)=>{const r={};return Object.values(e).forEach((e=>{if(Sr(e,n)){const n=wh.getPropertyName(e),s=n.substr(n.indexOf(".")+1).split(".");if(s.length>1){let e=wh.getIn(t,s)??"";if(!e){const n=`!P!${s.join(":")}`;e=wh.getIn(t,n)??""}wh.setIn(r,s,e)}else{const e=wh.getIn(t,s)??"";r[s[s.length-1]]=e}}})),r},Nr=(e,t,n,r,s)=>{const a=e.getValue(t)||{};n&&Object.keys(a).length>0&&e.clearErrorMessages({property:r?s:e.getStateProps().value})},Pr=(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=wh.getPropertyName(t),r=n.substr(n.indexOf(".")+1).split(".");e[r.join(".")]=t}))})(I,m,c),c){let n=o;n=gr(n);const r=t.getValue(f)||[];hr(l,n,u);const a=[];let i=r.length;e.forEach((e=>{const t=Tr(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=sl.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}})})),mh(Ag({instruction:j.LIST_ACTIONS_TYPE.SELECT_DESELECT,context:l,referenceList:`${u}.${d}`,actions:a}))}else{const n=Tr(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])}))}Nr(t,f,i,c,d),r()})),Rr=e=>{if(!e)return!1;const t=Ir(e);return Array.isArray(t)&&t.length>0};const Dr=(e,t,n={})=>{const{skipStateUpdate:r=!1}=n,s=e.getPageReference(),a=gr(t);hr(e.getContextName(),t,s);sl.getStateMachine(e.getContextName(),s,a).deleteAll(r)},br=e=>({insert:(t,n,r,s)=>_r(t,n,e,r,s),update:(t,n,r)=>Cr(t,e,n,r),updateProperty:(t,n,r)=>((e,t,n,r={})=>{const s=n.getPageReference(),{stateMachineTarget:a}=sl.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&&hr(n.getContextName(),t,e)}sl.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=gr(s);zn({type:F.MESSAGES.MESSAGES_TYPE_ERROR,pageReference:o,context:r,isListEntry:!0,deletingIndex:e}),hr(r,i,a),fr(r,`${s}[${e}]`),sl.getStateMachine(r,a,i).delete(e+1);const c=sl.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=gr(s);hr(r,o,a),fr(r,`${s}[${t}]`),sl.getStateMachine(r,a,o).move(e+1,t+1)})(t,n,e),setSelectedRows:(t,n={skipPageInstructions:!1})=>Pr(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 Sr(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=gr(i),hr(r,i,s),sl.getStateMachine(r,s,i).deleteAll(),Nr(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=gr(i);const r=sl.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=gr(t);hr(s,o,a),sl.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();hr(s,t,r),fr(s,wh.buildInstructionPageReference(r,t)),sl.getStateMachine(s,r,t).replacePage(n)})(e,t,n),deletePage:t=>((e,t)=>{const n=e.getPageReference(),r=e.getContextName();hr(r,t,n),fr(r,wh.buildInstructionPageReference(n,t)),sl.getStateMachine(r,n,t).deletePage()})(e,t)});const Or=new class{constructor(){this.fieldDefaults={}}updateFieldDefaults(e){e&&(Object.keys(this.fieldDefaults).length?wh.mergeDeep(e,this.fieldDefaults):wh.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 vr{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=(Ah(`.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),vr.messageDispatcher(t,n,s,c,$n.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=Or.getDefaultsforType(a?.componentName||"")?.["client-validations"];!1!==c&&e&&this.getValidator(e)&&(o=this.getValidator(e)(r,i),""!==r&&vr.messageDispatcher(t,n,s,o,a?.label));const l=a?.validationType;return c=l&&Or.getDefaultsforType(l)?.["client-validations"],!1!==c&&l&&this.getValidator(l)&&(o=this.getValidator(l)(r,i),vr.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}),Kn({messages:a,property:e,pageReference:t,context:n})}}isValidatorExist(e){return!!e.validatetype}}const xr=new vr,wr=(e,t)=>{e.DeclareExpressions&&zt({[t.context]:e.DeclareExpressions})},Mr=(e,t,n=!1)=>{const r=wh.getIn(e,j.RESOURCES);r&&((e=>{e&&Yp(e)})(r),wr(r,t)),n||Wg({...e,options:t})},Lr="text/javascript";const Ur=new class{constructor(){this.loaderObj={},this.staticServerURL="",this.appStaticUrl=null,this.pegaOnlyUrl=!1,this.loadedAssets={},this.componentsConfig=null,this.appAlias="",this.b2sJWT=null,this.ccV2LibId="",this.imageBlobUrlCache={},this.svcLocaleErrorCache=new Map}getTypes={SCRIPT:"script",STYLE:"link"};getStaticServerUrl(){return this.staticServerURL}setCCV2LibId(e){this.ccV2LibId=e}getCCV2LibId(){return this.ccV2LibId}async getThemeSchemaJSON(){const e=`${this.staticServerURL}themeOverrides.schema.json`;return fetch(e).then((e=>e.json()))}getConstellationServiceUrl(){return this.staticServerURL?.endsWith("/")?this.staticServerURL.substring(0,this.staticServerURL.length-1):this.staticServerURL}setAppAlias(e){this.appAlias=e}getAppAlias(){return this.appAlias}async getSvcComponentsConfig(e,t={}){let n="",r=0;return e.forEach((e=>{n+=`${0===r?"?":"&"}field${r}=${e.field}&value${r}=${e.value}`,r+=1})),this.pegaOnlyUrl?this.getSvcComponentsConfigSeparatedUrls(e,n,t):this.getSvcComponentsConfigCombinedUrl(e,n,t)}async getSvcComponentsConfigSeparatedUrls(e,t,n){const r=_p.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))),s?.data?.components?.length>0&&Array.isArray(e)&&(s.data.components=s.data.components.filter((t=>{let n=!0;for(const r of e){const e=t[r.field];Array.isArray(e)?e.includes(r.value)||(n=!1):e!==r.value&&(n=!1)}return n}))),n.alternateDesignSystemURL&&1===s?.data?.components?.length){const r=await this.getSvcComponentsConfigADS(e,t,n);s.data.components[0].alternateDesignSystemConfig=r}return s}getSvcComponentsConfigADS(e,t,n){const r=`${n.alternateDesignSystemURL}${n.alternateDesignSystemURL?.endsWith("/")?"":"/"}components/${e[0].value}/config-ext.json`;return fetch(r,{method:"GET"}).then((e=>{if(e.ok)return e.json();throw new Error(e.statusText)})).catch((e=>({error:e.message})))}getSvcImage(e){const t=`${this.appStaticUrl}v102/${this.appAlias}/image/${e}`;return fetch(t,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.blob())).catch()}getSvcImageUrl(e){const t=`${this.appStaticUrl}v102/${this.appAlias}/image/${e}`;return void 0===this.imageBlobUrlCache[t]&&(this.imageBlobUrlCache[t]=fetch(t,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.blob())).then((e=>window.URL.createObjectURL(e))).catch()),this.imageBlobUrlCache[t]}getSvcLocale(e,t){const n=`${this.appStaticUrl}v102/${this.appAlias}/locales/${e}/${t}`,r=`${this.appStaticUrl}::${this.appAlias}::${e}::${t}`;return!0===this.svcLocaleErrorCache.get(r)?Promise.resolve(null):fetch(n,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>400===e.status||404===e.status?(this.svcLocaleErrorCache.set(r,!0),null):e)).catch((()=>null))}getSvcAvailableLocales(){const e=`${this.appStaticUrl}v102/app/${this.appAlias}/locales/getLocaleCodes`;return fetch(e,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.json())).catch((()=>[]))}getSvcComponent(e){const t=`${this.appStaticUrl}v102/${this.appAlias}/component/${e}`;return fetch(t,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>{if(!e.ok)throw Error(e.statusText);return e})).then((e=>e.text())).then((e=>e)).catch()}async importCustomComponentMap(e){fetch(`${this.appStaticUrl}v100/componentlib/componentsmap/${e}`,{headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>(e.ok||console.error("Error while fetching custom component map"),e))).then((e=>e.text())).then((t=>{this.setCCV2LibId(e);const n=document.createElement("script");n.src=window.URL.createObjectURL(new Blob([t],{type:Lr})),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:Lr})),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=Lr,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}=Ug("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()))}},Fr="component-loader",jr={},Vr=async(e,t)=>{const n=Ur.getLoader(),r=t||Ur.staticServerURL;if(!e||window.PCore&&!1===window.PCore.getBehaviorOverride("dynamicLoadComponents"))return Promise.resolve();if(Ur.getLoader(Fr))return Ur.getLoader(Fr)(e,r);const s=[];return e.forEach((e=>{if(jr[e])return;const t=Jt.getComponent(e);if(!t){const t=`${Ur.getConstellationServiceUrl()}/v860/${Ur.getAppAlias()}/component/${e}.js`;return void s.push(n(t,Ur.getTypes.SCRIPT))}(t.scripts||[]).forEach((e=>{const t=e.startsWith("http")?e:r+e;s.push(n(t,Ur.getTypes.SCRIPT))}));(t.styles||[]).forEach((e=>{s.push(n(r+e,Ur.getTypes.STYLE))})),jr[e]=!0})),Promise.all(s)};function kr(e,t){return function(){return e.apply(t,arguments)}}const{toString:$r}=Object.prototype,{getPrototypeOf:Br}=Object,Gr=(Wr=Object.create(null),e=>{const t=$r.call(e);return Wr[t]||(Wr[t]=t.slice(8,-1).toLowerCase())});var Wr;const Hr=e=>(e=e.toLowerCase(),t=>Gr(t)===e),qr=e=>t=>typeof t===e,{isArray:Yr}=Array,zr=qr("undefined");const Kr=Hr("ArrayBuffer");const Xr=qr("string"),Jr=qr("function"),Qr=qr("number"),Zr=e=>null!==e&&"object"==typeof e,es=e=>{if("object"!==Gr(e))return!1;const t=Br(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},ts=Hr("Date"),ns=Hr("File"),rs=Hr("Blob"),ss=Hr("FileList"),as=Hr("URLSearchParams"),[os,is,cs,ls]=["ReadableStream","Request","Response","Headers"].map(Hr);function us(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,s;if("object"!=typeof e&&(e=[e]),Yr(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 ds(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 ps="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,hs=e=>!zr(e)&&e!==ps;const gs=(fs="undefined"!=typeof Uint8Array&&Br(Uint8Array),e=>fs&&e instanceof fs);var fs;const ms=Hr("HTMLFormElement"),ys=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Is=Hr("RegExp"),Es=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};us(n,((n,s)=>{let a;!1!==(a=t(n,s,e))&&(r[s]=a||n)})),Object.defineProperties(e,r)};const As=Hr("AsyncFunction"),_s=(Cs="function"==typeof setImmediate,Ss=Jr(ps.postMessage),Cs?setImmediate:Ss?(Ts=`axios@${Math.random()}`,Ns=[],ps.addEventListener("message",(({source:e,data:t})=>{e===ps&&t===Ts&&Ns.length&&Ns.shift()()}),!1),e=>{Ns.push(e),ps.postMessage(Ts,"*")}):e=>setTimeout(e));var Cs,Ss,Ts,Ns;const Ps="undefined"!=typeof queueMicrotask?queueMicrotask.bind(ps):"undefined"!=typeof process&&process.nextTick||_s,Rs={isArray:Yr,isArrayBuffer:Kr,isBuffer:function(e){return null!==e&&!zr(e)&&null!==e.constructor&&!zr(e.constructor)&&Jr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||Jr(e.append)&&("formdata"===(t=Gr(e))||"object"===t&&Jr(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Kr(e.buffer),t},isString:Xr,isNumber:Qr,isBoolean:e=>!0===e||!1===e,isObject:Zr,isPlainObject:es,isReadableStream:os,isRequest:is,isResponse:cs,isHeaders:ls,isUndefined:zr,isDate:ts,isFile:ns,isBlob:rs,isRegExp:Is,isFunction:Jr,isStream:e=>Zr(e)&&Jr(e.pipe),isURLSearchParams:as,isTypedArray:gs,isFileList:ss,forEach:us,merge:function e(){const{caseless:t}=hs(this)&&this||{},n={},r=(r,s)=>{const a=t&&ds(n,s)||s;es(n[a])&&es(r)?n[a]=e(n[a],r):es(r)?n[a]=e({},r):Yr(r)?n[a]=r.slice():n[a]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&us(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(us(t,((t,r)=>{n&&Jr(t)?e[r]=kr(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&&Br(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:Gr,kindOfTest:Hr,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(Yr(e))return e;let t=e.length;if(!Qr(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:ms,hasOwnProperty:ys,hasOwnProp:ys,reduceDescriptors:Es,freezeMethods:e=>{Es(e,((t,n)=>{if(Jr(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];Jr(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 Yr(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:ds,global:ps,isContextDefined:hs,isSpecCompliantForm:function(e){return!!(e&&Jr(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(Zr(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const s=Yr(e)?[]:{};return us(e,((e,t)=>{const a=n(e,r+1);!zr(a)&&(s[t]=a)})),t[r]=void 0,s}}return e};return n(e,0)},isAsyncFn:As,isThenable:e=>e&&(Zr(e)||Jr(e))&&Jr(e.then)&&Jr(e.catch),setImmediate:_s,asap:Ps};function Ds(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)}Rs.inherits(Ds,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:Rs.toJSONObject(this.config),code:this.code,status:this.status}}});const bs=Ds.prototype,Os={};["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=>{Os[e]={value:e}})),Object.defineProperties(Ds,Os),Object.defineProperty(bs,"isAxiosError",{value:!0}),Ds.from=(e,t,n,r,s,a)=>{const o=Object.create(bs);return Rs.toFlatObject(e,o,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),Ds.call(o,e.message,t,n,r,s),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};const vs=Ds;function xs(e){return Rs.isPlainObject(e)||Rs.isArray(e)}function ws(e){return Rs.endsWith(e,"[]")?e.slice(0,-2):e}function Ms(e,t,n){return e?e.concat(t).map((function(e,t){return e=ws(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const Ls=Rs.toFlatObject(Rs,{},null,(function(e){return/^is[A-Z]/.test(e)}));const Us=function(e,t,n){if(!Rs.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=Rs.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!Rs.isUndefined(t[e])}))).metaTokens,s=n.visitor||l,a=n.dots,o=n.indexes,i=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Rs.isSpecCompliantForm(t);if(!Rs.isFunction(s))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(Rs.isDate(e))return e.toISOString();if(!i&&Rs.isBlob(e))throw new vs("Blob is not supported. Use a Buffer instead.");return Rs.isArrayBuffer(e)||Rs.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(Rs.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(Rs.isArray(e)&&function(e){return Rs.isArray(e)&&!e.some(xs)}(e)||(Rs.isFileList(e)||Rs.endsWith(n,"[]"))&&(i=Rs.toArray(e)))return n=ws(n),i.forEach((function(e,r){!Rs.isUndefined(e)&&null!==e&&t.append(!0===o?Ms([n],r,a):null===o?n:n+"[]",c(e))})),!1;return!!xs(e)||(t.append(Ms(s,n,a),c(e)),!1)}const u=[],d=Object.assign(Ls,{defaultVisitor:l,convertValue:c,isVisitable:xs});if(!Rs.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!Rs.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),Rs.forEach(n,(function(n,a){!0===(!(Rs.isUndefined(n)||null===n)&&s.call(t,n,Rs.isString(a)?a.trim():a,r,d))&&e(n,r?r.concat(a):[a])})),u.pop()}}(e),t};function Fs(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function js(e,t){this._pairs=[],e&&Us(e,this,t)}const Vs=js.prototype;Vs.append=function(e,t){this._pairs.push([e,t])},Vs.toString=function(e){const t=e?function(t){return e.call(this,t,Fs)}:Fs;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const ks=js;function $s(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Bs(e,t,n){if(!t)return e;const r=n&&n.encode||$s;Rs.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let a;if(a=s?s(t,n):Rs.isURLSearchParams(t)?t.toString():new ks(t,n).toString(r),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}const Gs=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){Rs.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Ws={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Hs={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ks,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},qs="undefined"!=typeof window&&"undefined"!=typeof document,Ys="object"==typeof navigator&&navigator||void 0,zs=qs&&(!Ys||["ReactNative","NativeScript","NS"].indexOf(Ys.product)<0),Ks="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Xs=qs&&window.location.href||"http://localhost",Js={...a,...Hs};const Qs=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&&Rs.isArray(r)?r.length:a,i)return Rs.hasOwnProp(r,a)?r[a]=[r[a],n]:r[a]=n,!o;r[a]&&Rs.isObject(r[a])||(r[a]=[]);return t(e,n,r[a],s)&&Rs.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(Rs.isFormData(e)&&Rs.isFunction(e.entries)){const n={};return Rs.forEachEntry(e,((e,r)=>{t(function(e){return Rs.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null};const Zs={transitional:Ws,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,s=Rs.isObject(e);s&&Rs.isHTMLForm(e)&&(e=new FormData(e));if(Rs.isFormData(e))return r?JSON.stringify(Qs(e)):e;if(Rs.isArrayBuffer(e)||Rs.isBuffer(e)||Rs.isStream(e)||Rs.isFile(e)||Rs.isBlob(e)||Rs.isReadableStream(e))return e;if(Rs.isArrayBufferView(e))return e.buffer;if(Rs.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 Us(e,new Js.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return Js.isNode&&Rs.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((a=Rs.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Us(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return s||r?(t.setContentType("application/json",!1),function(e,t,n){if(Rs.isString(e))try{return(t||JSON.parse)(e),Rs.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Zs.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(Rs.isResponse(e)||Rs.isReadableStream(e))return e;if(e&&Rs.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 vs.from(e,vs.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:Js.classes.FormData,Blob:Js.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Rs.forEach(["delete","get","head","post","put","patch"],(e=>{Zs.headers[e]={}}));const ea=Zs,ta=Rs.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"]),na=Symbol("internals");function ra(e){return e&&String(e).trim().toLowerCase()}function sa(e){return!1===e||null==e?e:Rs.isArray(e)?e.map(sa):String(e)}function aa(e,t,n,r,s){return Rs.isFunction(r)?r.call(this,t,n):(s&&(t=n),Rs.isString(t)?Rs.isString(r)?-1!==t.indexOf(r):Rs.isRegExp(r)?r.test(t):void 0:void 0)}class oa{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function s(e,t,n){const s=ra(t);if(!s)throw new Error("header name must be a non-empty string");const a=Rs.findKey(r,s);(!a||void 0===r[a]||!0===n||void 0===n&&!1!==r[a])&&(r[a||t]=sa(e))}const a=(e,t)=>Rs.forEach(e,((e,n)=>s(e,n,t)));if(Rs.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(Rs.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]&&ta[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(Rs.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=ra(e)){const n=Rs.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(Rs.isFunction(t))return t.call(this,e,n);if(Rs.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ra(e)){const n=Rs.findKey(this,e);return!(!n||void 0===this[n]||t&&!aa(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function s(e){if(e=ra(e)){const s=Rs.findKey(n,e);!s||t&&!aa(0,n[s],s,t)||(delete n[s],r=!0)}}return Rs.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&&!aa(0,this[s],s,e,!0)||(delete this[s],r=!0)}return r}normalize(e){const t=this,n={};return Rs.forEach(this,((r,s)=>{const a=Rs.findKey(n,s);if(a)return t[a]=sa(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]=sa(r),n[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Rs.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Rs.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[na]=this[na]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=ra(e);t[r]||(!function(e,t){const n=Rs.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 Rs.isArray(e)?e.forEach(r):r(e),this}}oa.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Rs.reduceDescriptors(oa.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),Rs.freezeMethods(oa);const ia=oa;function ca(e,t){const n=this||ea,r=t||n,s=ia.from(r.headers);let a=r.data;return Rs.forEach(e,(function(e){a=e.call(n,a,s.normalize(),t?t.status:void 0)})),s.normalize(),a}function la(e){return!(!e||!e.__CANCEL__)}function ua(e,t,n){vs.call(this,null==e?"canceled":e,vs.ERR_CANCELED,t,n),this.name="CanceledError"}Rs.inherits(ua,vs,{__CANCEL__:!0});const da=ua;function pa(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new vs("Request failed with status code "+n.status,[vs.ERR_BAD_REQUEST,vs.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const ha=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s,a=0,o=0;return t=void 0!==t?t:1e3,function(i){const c=Date.now(),l=r[o];s||(s=c),n[a]=i,r[a]=c;let u=o,d=0;for(;u!==a;)d+=n[u++],u%=e;if(a=(a+1)%e,a===o&&(o=(o+1)%e),c-s<t)return;const p=l&&c-l;return p?Math.round(1e3*d/p):void 0}};const ga=function(e,t){let n,r,s=0,a=1e3/t;const o=(t,a=Date.now())=>{s=a,n=null,r&&(clearTimeout(r),r=null),e.apply(null,t)};return[(...e)=>{const t=Date.now(),i=t-s;i>=a?o(e,t):(n=e,r||(r=setTimeout((()=>{r=null,o(n)}),a-i)))},()=>n&&o(n)]},fa=(e,t,n=3)=>{let r=0;const s=ha(50,250);return ga((n=>{const a=n.loaded,o=n.lengthComputable?n.total:void 0,i=a-r,c=s(i);r=a;e({loaded:a,total:o,progress:o?a/o:void 0,bytes:i,rate:c||void 0,estimated:c&&o&&a<=o?(o-a)/c:void 0,event:n,lengthComputable:null!=o,[t?"download":"upload"]:!0})}),n)},ma=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ya=e=>(...t)=>Rs.asap((()=>e(...t))),Ia=Js.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Js.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Js.origin),Js.navigator&&/(msie|trident)/i.test(Js.navigator.userAgent)):()=>!0,Ea=Js.hasStandardBrowserEnv?{write(e,t,n,r,s,a){const o=[e+"="+encodeURIComponent(t)];Rs.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),Rs.isString(r)&&o.push("path="+r),Rs.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 Aa(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const _a=e=>e instanceof ia?{...e}:e;function Ca(e,t){t=t||{};const n={};function r(e,t,n,r){return Rs.isPlainObject(e)&&Rs.isPlainObject(t)?Rs.merge.call({caseless:r},e,t):Rs.isPlainObject(t)?Rs.merge({},t):Rs.isArray(t)?t.slice():t}function s(e,t,n,s){return Rs.isUndefined(t)?Rs.isUndefined(e)?void 0:r(void 0,e,0,s):r(e,t,0,s)}function a(e,t){if(!Rs.isUndefined(t))return r(void 0,t)}function o(e,t){return Rs.isUndefined(t)?Rs.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function i(n,s,a){return a in t?r(n,s):a in e?r(void 0,n):void 0}const c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:i,headers:(e,t,n)=>s(_a(e),_a(t),0,!0)};return Rs.forEach(Object.keys(Object.assign({},e,t)),(function(r){const a=c[r]||s,o=a(e[r],t[r],r);Rs.isUndefined(o)&&a!==i||(n[r]=o)})),n}const Sa=e=>{const t=Ca({},e);let n,{data:r,withXSRFToken:s,xsrfHeaderName:a,xsrfCookieName:o,headers:i,auth:c}=t;if(t.headers=i=ia.from(i),t.url=Bs(Aa(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),Rs.isFormData(r))if(Js.hasStandardBrowserEnv||Js.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(Js.hasStandardBrowserEnv&&(s&&Rs.isFunction(s)&&(s=s(t)),s||!1!==s&&Ia(t.url))){const e=a&&o&&Ea.read(o);e&&i.set(a,e)}return t},Ta="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=Sa(e);let s=r.data;const a=ia.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=ia.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders());pa((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 vs("Request aborted",vs.ECONNABORTED,e,f)),f=null)},f.onerror=function(){n(new vs("Network Error",vs.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||Ws;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new vs(t,s.clarifyTimeoutError?vs.ETIMEDOUT:vs.ECONNABORTED,e,f)),f=null},void 0===s&&a.setContentType(null),"setRequestHeader"in f&&Rs.forEach(a.toJSON(),(function(e,t){f.setRequestHeader(t,e)})),Rs.isUndefined(r.withCredentials)||(f.withCredentials=!!r.withCredentials),d&&"json"!==d&&(f.responseType=r.responseType),h&&([c,u]=fa(h,!0),f.addEventListener("progress",c)),p&&f.upload&&([i,l]=fa(p),f.upload.addEventListener("progress",i),f.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(o=t=>{f&&(n(!t||t.type?new da(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===Js.protocols.indexOf(y)?n(new vs("Unsupported protocol "+y+":",vs.ERR_BAD_REQUEST,e)):f.send(s||null)}))},Na=(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 vs?t:new da(t instanceof Error?t.message:t))}};let a=t&&setTimeout((()=>{a=null,s(new vs(`timeout ${t} of ms exceeded`,vs.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=()=>Rs.asap(o),i}},Pa=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},Ra=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()}},Da=(e,t,n,r)=>{const s=async function*(e,t){for await(const n of Ra(e))yield*Pa(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})},ba="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,Oa=ba&&"function"==typeof ReadableStream,va=ba&&("function"==typeof TextEncoder?(xa=new TextEncoder,e=>xa.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var xa;const wa=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Ma=Oa&&wa((()=>{let e=!1;const t=new Request(Js.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),La=Oa&&wa((()=>Rs.isReadableStream(new Response("").body))),Ua={stream:La&&(e=>e.body)};var Fa;ba&&(Fa=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!Ua[e]&&(Ua[e]=Rs.isFunction(Fa[e])?t=>t[e]():(t,n)=>{throw new vs(`Response type '${e}' is not supported`,vs.ERR_NOT_SUPPORT,n)})})));const ja=async(e,t)=>{const n=Rs.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(Rs.isBlob(e))return e.size;if(Rs.isSpecCompliantForm(e)){const t=new Request(Js.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Rs.isArrayBufferView(e)||Rs.isArrayBuffer(e)?e.byteLength:(Rs.isURLSearchParams(e)&&(e+=""),Rs.isString(e)?(await va(e)).byteLength:void 0)})(t):n},Va=ba&&(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}=Sa(e);l=l?(l+"").toLowerCase():"text";let h,g=Na([s,a&&a.toAbortSignal()],o);const f=g&&g.unsubscribe&&(()=>{g.unsubscribe()});let m;try{if(c&&Ma&&"get"!==n&&"head"!==n&&0!==(m=await ja(u,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(Rs.isFormData(r)&&(e=n.headers.get("content-type"))&&u.setContentType(e),n.body){const[e,t]=ma(m,fa(ya(c)));r=Da(n.body,65536,e,t)}}Rs.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=La&&("stream"===l||"response"===l);if(La&&(i||o&&f)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=a[t]}));const t=Rs.toFiniteNumber(a.headers.get("content-length")),[n,r]=i&&ma(t,fa(ya(i),!0))||[];a=new Response(Da(a.body,65536,n,(()=>{r&&r(),f&&f()})),e)}l=l||"text";let y=await Ua[Rs.findKey(Ua,l)||"text"](a,e);return!o&&f&&f(),await new Promise(((t,n)=>{pa(t,n,{data:y,headers:ia.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 vs("Network Error",vs.ERR_NETWORK,e,h),{cause:t.cause||t});throw vs.from(t,t&&t.code,e,h)}}),ka={http:null,xhr:Ta,fetch:Va};Rs.forEach(ka,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const $a=e=>`- ${e}`,Ba=e=>Rs.isFunction(e)||null===e||!1===e,Ga=e=>{e=Rs.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,!Ba(n)&&(r=ka[(t=String(n)).toLowerCase()],void 0===r))throw new vs(`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($a).join("\n"):" "+$a(e[0]):"as no adapter specified";throw new vs("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return r};function Wa(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new da(null,e)}function Ha(e){Wa(e),e.headers=ia.from(e.headers),e.data=ca.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Ga(e.adapter||ea.adapter)(e).then((function(t){return Wa(e),t.data=ca.call(e,e.transformResponse,t),t.headers=ia.from(t.headers),t}),(function(t){return la(t)||(Wa(e),t&&t.response&&(t.response.data=ca.call(e,e.transformResponse,t.response),t.response.headers=ia.from(t.response.headers))),Promise.reject(t)}))}const qa="1.8.4",Ya={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Ya[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const za={};Ya.transitional=function(e,t,n){function r(e,t){return"[Axios v1.8.4] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,s,a)=>{if(!1===e)throw new vs(r(s," has been removed"+(t?" in "+t:"")),vs.ERR_DEPRECATED);return t&&!za[s]&&(za[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)}},Ya.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const Ka={assertOptions:function(e,t,n){if("object"!=typeof e)throw new vs("options must be an object",vs.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 vs("option "+a+" must be "+n,vs.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new vs("Unknown option "+a,vs.ERR_BAD_OPTION)}},validators:Ya},Xa=Ka.validators;class Ja{constructor(e){this.defaults=e,this.interceptors={request:new Gs,response:new Gs}}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=Ca(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:s}=t;void 0!==n&&Ka.assertOptions(n,{silentJSONParsing:Xa.transitional(Xa.boolean),forcedJSONParsing:Xa.transitional(Xa.boolean),clarifyTimeoutError:Xa.transitional(Xa.boolean)},!1),null!=r&&(Rs.isFunction(r)?t.paramsSerializer={serialize:r}:Ka.assertOptions(r,{encode:Xa.function,serialize:Xa.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Ka.assertOptions(t,{baseUrl:Xa.spelling("baseURL"),withXsrfToken:Xa.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=s&&Rs.merge(s.common,s[t.method]);s&&Rs.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete s[e]})),t.headers=ia.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=[Ha.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=Ha.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 Bs(Aa((e=Ca(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}Rs.forEach(["delete","get","head","options"],(function(e){Ja.prototype[e]=function(t,n){return this.request(Ca(n||{},{method:e,url:t,data:(n||{}).data}))}})),Rs.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,s){return this.request(Ca(s||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Ja.prototype[e]=t(),Ja.prototype[e+"Form"]=t(!0)}));const Qa=Ja;class Za{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 da(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 Za((function(t){e=t})),cancel:e}}}const eo=Za;const to={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(to).forEach((([e,t])=>{to[t]=e}));const no=to;const ro=function e(t){const n=new Qa(t),r=kr(Qa.prototype.request,n);return Rs.extend(r,Qa.prototype,n,{allOwnKeys:!0}),Rs.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Ca(t,n))},r}(ea);ro.Axios=Qa,ro.CanceledError=da,ro.CancelToken=eo,ro.isCancel=la,ro.VERSION=qa,ro.toFormData=Us,ro.AxiosError=vs,ro.Cancel=ro.CanceledError,ro.all=function(e){return Promise.all(e)},ro.spread=function(e){return function(t){return e.apply(null,t)}},ro.isAxiosError=function(e){return Rs.isObject(e)&&!0===e.isAxiosError},ro.mergeConfig=Ca,ro.AxiosHeaders=ia,ro.formToJSON=e=>Qs(Rs.isHTMLForm(e)?new FormData(e):e),ro.getAdapter=Ga,ro.HttpStatusCode=no,ro.default=ro;const so=ro;function ao(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 oo=ao((function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}}));var io=function(e,t){return io=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])},io(e,t)};function co(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}io(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function lo(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 uo(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 po(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 ho(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,s,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(e){s={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(s)throw s.error}}return o}function go(e,t,n){if(n||2===arguments.length)for(var r,s=0,a=t.length;s<a;s++)!r&&s in t||(r||(r=Array.prototype.slice.call(t,0,s)),r[s]=t[s]);return e.concat(r||Array.prototype.slice.call(t))}function fo(e){return this instanceof fo?(this.v=e,this):new fo(e)}function mo(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 fo?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 yo(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=po(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 Io=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function Eo(e){return"function"==typeof e}function Ao(e){return Eo(null==e?void 0:e.then)}var _o=ao((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 Co(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var So=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=po(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(Eo(c))try{c()}catch(e){s=e instanceof _o?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var u=po(l),d=u.next();!d.done;d=u.next()){var p=d.value;try{Po(p)}catch(e){s=null!=s?s:[],e instanceof _o?s=go(go([],ho(s)),ho(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 _o(s)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)Po(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)&&Co(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&Co(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}(),To=So.EMPTY;function No(e){return e instanceof So||e&&"closed"in e&&Eo(e.remove)&&Eo(e.add)&&Eo(e.unsubscribe)}function Po(e){Eo(e)?e():e.unsubscribe()}var Ro={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Do={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var s=Do.delegate;return(null==s?void 0:s.setTimeout)?s.setTimeout.apply(s,go([e,t],ho(n))):setTimeout.apply(void 0,go([e,t],ho(n)))},clearTimeout:function(e){var t=Do.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function bo(e){Do.setTimeout((function(){var t=Ro.onUnhandledError;if(!t)throw e;t(e)}))}function Oo(){}var vo=xo("C",void 0,void 0);function xo(e,t,n){return{kind:e,value:t,error:n}}var wo=null;function Mo(e){if(Ro.useDeprecatedSynchronousErrorHandling){var t=!wo;if(t&&(wo={errorThrown:!1,error:null}),e(),t){var n=wo,r=n.errorThrown,s=n.error;if(wo=null,r)throw s}}else e()}var Lo=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,No(t)&&t.add(n)):n.destination=Bo,n}return co(t,e),t.create=function(e,t,n){return new Vo(e,t,n)},t.prototype.next=function(e){this.isStopped?$o(function(e){return xo("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?$o(xo("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?$o(vo,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}(So),Uo=Function.prototype.bind;function Fo(e,t){return Uo.call(e,t)}var jo=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){ko(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){ko(e)}else ko(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){ko(e)}},e}(),Vo=function(e){function t(t,n,r){var s,a,o=e.call(this)||this;Eo(t)||!t?s={next:null!=t?t:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:o&&Ro.useDeprecatedNextContext?((a=Object.create(t)).unsubscribe=function(){return o.unsubscribe()},s={next:t.next&&Fo(t.next,a),error:t.error&&Fo(t.error,a),complete:t.complete&&Fo(t.complete,a)}):s=t;return o.destination=new jo(s),o}return co(t,e),t}(Lo);function ko(e){var t;Ro.useDeprecatedSynchronousErrorHandling?(t=e,Ro.useDeprecatedSynchronousErrorHandling&&wo&&(wo.errorThrown=!0,wo.error=t)):bo(e)}function $o(e,t){var n=Ro.onStoppedNotification;n&&Do.setTimeout((function(){return n(e,t)}))}var Bo={closed:!0,next:Oo,error:function(e){throw e},complete:Oo},Go="function"==typeof Symbol&&Symbol.observable||"@@observable";function Wo(e){return e}function Ho(e){return 0===e.length?Wo:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var qo=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 Lo||function(e){return e&&Eo(e.next)&&Eo(e.error)&&Eo(e.complete)}(r)&&No(r)?e:new Vo(e,t,n);return Mo((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=Yo(t))((function(t,r){var s=new Vo({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[Go]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ho(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=Yo(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 Yo(e){var t;return null!==(t=null!=e?e:Ro.Promise)&&void 0!==t?t:Promise}function zo(e){return Eo(e[Go])}function Ko(e){return Symbol.asyncIterator&&Eo(null==e?void 0:e[Symbol.asyncIterator])}function Xo(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 Jo="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function Qo(e){return Eo(null==e?void 0:e[Jo])}function Zo(e){return mo(this,arguments,(function(){var t,n,r;return uo(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,fo(t.read())];case 3:return n=s.sent(),r=n.value,n.done?[4,fo(void 0)]:[3,5];case 4:return[2,s.sent()];case 5:return[4,fo(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 ei(e){return Eo(null==e?void 0:e.getReader)}function ti(e){if(e instanceof qo)return e;if(null!=e){if(zo(e))return s=e,new qo((function(e){var t=s[Go]();if(Eo(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(Io(e))return r=e,new qo((function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()}));if(Ao(e))return n=e,new qo((function(e){n.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,bo)}));if(Ko(e))return ni(e);if(Qo(e))return t=e,new qo((function(e){var n,r;try{for(var s=po(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(ei(e))return ni(Zo(e))}var t,n,r,s;throw Xo(e)}function ni(e){return new qo((function(t){(function(e,t){var n,r,s,a;return lo(this,void 0,void 0,(function(){var o,i;return uo(this,(function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=yo(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 ri(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 si(e){return function(t){if(function(e){return Eo(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 ai(e,t,n,r,s){return new oi(e,t,n,r,s)}var oi=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 co(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}(Lo);function ii(e,t){return void 0===t&&(t=0),si((function(n,r){n.subscribe(ai(r,(function(n){return ri(r,e,(function(){return r.next(n)}),t)}),(function(){return ri(r,e,(function(){return r.complete()}),t)}),(function(n){return ri(r,e,(function(){return r.error(n)}),t)})))}))}function ci(e,t){return void 0===t&&(t=0),si((function(n,r){r.add(e.schedule((function(){return n.subscribe(r)}),t))}))}function li(e,t){if(!e)throw new Error("Iterable cannot be null");return new qo((function(n){ri(n,t,(function(){var r=e[Symbol.asyncIterator]();ri(n,t,(function(){r.next().then((function(e){e.done?n.complete():n.next(e.value)}))}),0,!0)}))}))}function ui(e,t){if(null!=e){if(zo(e))return function(e,t){return ti(e).pipe(ci(t),ii(t))}(e,t);if(Io(e))return function(e,t){return new qo((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(Ao(e))return function(e,t){return ti(e).pipe(ci(t),ii(t))}(e,t);if(Ko(e))return li(e,t);if(Qo(e))return function(e,t){return new qo((function(n){var r;return ri(n,t,(function(){r=e[Jo](),ri(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 Eo(null==r?void 0:r.return)&&r.return()}}))}(e,t);if(ei(e))return function(e,t){return li(Zo(e),t)}(e,t)}throw Xo(e)}function di(e,t){return t?ui(e,t):ti(e)}function pi(e,t,n){var r=Eo(e)||t||n?{next:e,error:t,complete:n}:e;return r?si((function(e,t){var n;null===(n=r.subscribe)||void 0===n||n.call(r);var s=!0;e.subscribe(ai(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)})))})):Wo}const hi=class{constructor(e,t,n,r){this.eventType=e,this.callback=n,this.contextName=r,this.id=t}};const gi=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 hi(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 fi=class{static subscribe(e,t,n,r=!1,s="app"){gi.subscribe(e,n,t,s,r)}static subscribeOnce(e,t,n){this.subscribe(e,t,n,!0)}static publish(e,t){gi.publish(e,t)}static unsubscribe(e,t,n="app"){gi.unsubscribe(e,t,n)}static unsubscribeAllWithEventType(e){gi.unsubscribeAllWithEventType(e)}static cleanContextSubscribers(e){gi.clearContext(e)}};class mi{constructor(e,t=!0){this.config=e,t?(this.ssKeyConfig=e,this.reloadConfig()):this.updateConfig(e,!1)}static init(e,t=!0){return new mi(e,t)}updateConfig(e,t=!0){t?window.sessionStorage.setItem(this.ssKeyConfig,JSON.stringify(this.config)):Yi(e)}reloadConfig(e=!0){if(e){const e=window.sessionStorage.getItem(this.ssKeyConfig);this.config=e?JSON.parse(e):null}else this.config=zi()}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:Ap.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"),ki(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?Hi({pzCTkn:e?.csrf}):(qi({tokenInfo:e}),Hi({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 yi=mi,Ii=async()=>new Promise((async(e,t)=>{const n=Ki();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 ki(a,{method:"POST",headers:new Headers(l),credentials:c?"include":"omit",body:u.toString(),withoutDefaultHeaders:!0}),Hi({Authorization:null}),qi({tokenInfo:null}),e()})),Ei=async e=>{const t={};if("OAuth2.0"===e?.authType){const n=new yi(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},Ai=(e,t)=>{Ei(t).then((t=>{const n={openReauthMessageModal:!0,reAuthenticationURL:t.reauthUrl,url:e,redirectOrigin:t.redirectOrigin};fi.publish(F.PUB_SUB_EVENTS.EVENT_REAUTH,n)}))},_i=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};qi({tokenInfo:{...e.tokenInfo,...r}}),e.secureCookie?Hi({pzCTkn:n?.csrf}):Hi({Authorization:`${n?.token_type} ${n?.access_token}`});const{onTokenRetrieval:s}=e;s&&"function"==typeof s&&s(n)},failure:t=>{if(e.popupReauth)return Ai(t,e);fi.publish(F.PUB_SUB_EVENTS.EVENT_FULL_REAUTH,e)}}}else t=`${E()}/updateSession`,n={method:"GET",headers:{}},r={failure:Ai};return{url:t,config:n,callback:r,isRefreshTokenPresent:s}},Ci=(e,t)=>"OAuth2.0"===t?.authType?e?.includes(t.endPoints.token):e?.includes("updateSession"),Si=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}},Ti=(e,t,n)=>{const{config:r}=e,{url:s,config:a,callback:o,isRefreshTokenPresent:i}=_i(n),c=r.headers&&r.headers.context;r.data&&(r.body=r.data);const l=$i(r.url,r,c,t);return i?ki(s,a).then((e=>(t.setUpdateSessionStatus(!1),o?.success?.(e,r),fi.publish("updateSession",{updateStatus:"success"}),l.then((e=>Promise.resolve(e))).catch((e=>Promise.reject(e)))))).catch((e=>e&&e.config&&Ci(e.config.url,n)?(o?.failure?.(r.url,n),l):Promise.reject(e))):(o?.failure?.(r.url,n),l)},Ni=(e,t,n,r)=>{if(e.config&&Ci(e.config.url,n))return Promise.reject(e);if(e.response&&e.response.status&&401===e.response.status&&!t.getUpdateSessionStatus()){if(fi.unsubscribeAllWithEventType(vi),t.setUpdateSessionStatus(!0),"custom"===n?.authType){fi.publish(F.PUB_SUB_EVENTS.EVENT_CUSTOM_REAUTH);const{url:n,config:r,context:s}=Si(e);return $i(n,r,s,t)}return Ti(e,t,n)}if(e.response&&e.response.status&&401===e.response.status&&t.getUpdateSessionStatus()){const{url:t,config:n,context:r}=Si(e);return ki(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)));let n=e.config.headers.context;return n&&n.includes("/workarea")&&!n.includes("/modal")&&(n=n.substring(0,n.lastIndexOf("/workarea"))),Kn({messages:t,category:"HTTP",context:n}),Promise.reject(e)}return Promise.reject(e)};const Pi=class{constructor(){this.updateSessionInProgress=!1}getUpdateSessionStatus=()=>this.updateSessionInProgress;setUpdateSessionStatus=e=>{this.updateSessionInProgress=e}};const Ri=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 Di=new class{constructor(){this.xray=!1,this.onXRayCallback=null,this.xrayRuntime=new Ri(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 bi=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]:Di.getDebugLevels()}}getCoreHeadersFromContext(e){if(["root","app"].includes(e)||!e)return;const t=Fh.getProperty(j.COREHEADERS,"",e);return t?{...t,debugInfo:Di.getPreviewMode()&&{...t.debugInfo,[j.COREHEADER_APP_DEBUG_LEVELS]:Di.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)}},Oi=bi;const vi="updateSession",xi={},wi=new Pi,Mi=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&&(fi.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((()=>{fi.publish(F.PUB_SUB_EVENTS.TIMEOUT_REMINDER,{timeRemaining:this.expiryBuffer}),clearTimeout(t),fi.subscribe(F.PUB_SUB_EVENTS.RESET_TIMER,this.resetInactiveTimeout,"resetCallback"),this.timeoutWarned=!0}),1e3*(e-this.expiryBuffer));return this.setTimerID(t),t}};let Li={},Ui={},Fi={},ji="";const Vi=e=>{Li=e},ki=(e,t,n="root",r={})=>{const{doNotMergeHttpMessagesForStatusCode:s=null,cancelContext:a=n,includeRemoteSystemIdIfPresent:o=!0}=r;ji=s,null===e&&window.console.error("Error: url passed to Service Broker fetch is null (or) undefined");const{body:i,signal:c,withoutDefaultHeaders:l=!1,...u}=t,{Authorization:d,pzCTkn:p,...h}=t.headers||{};l||Oi.injectCoreAdditionalHeaders(h,t.body,n,{includeRemoteSystemIdIfPresent:o}),a&&xi[a]>=0?xi[a]+=1:a&&void 0===xi[a]&&(xi[a]=1);let g=l?{...h}:{...Oi.getDefaultHeaders(),...Oi.getRegisteredHeaders(),...h,context:n};if(e&&Ci(e,Ui)&&wi.getUpdateSessionStatus()||!wi.getUpdateSessionStatus()){Ci(e,Ui)&&"OAuth2.0"===Ui?.authType&&(g={...h});const{restApi:t}=Ap.doesRestApiExist("Logout")&&Ap.getRestEndPoint("Logout")||{restApi:null};return(!t||e&&!e.endsWith(t))&&Mi.setTimerID(Mi.resetInactiveTimeout(Mi.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 oo)}})}))}(di(so({context:n,...u,url:e,data:i,...c&&void 0===c.aborted&&{cancelToken:c},...c&&void 0!==c.aborted&&{signal:c},headers:g,withCredentials:(f=Ui,!("OAuth2.0"!==f?.authType||!f.secureCookie)||!("custom"!==f?.authType||!f.customCookies)||void 0)})).pipe(pi((()=>{const e=Oi.getCoreHeadersFromContext(g.context);e&&(e=>{fi.publish(j.PUB_SUB_EVENTS.FETCH_SUCCESS,e)})({...e})}))))}var f;return $i(e,t,n,wi)},$i=(e,t,n,r)=>new Promise(((s,a)=>{fi.subscribe(vi,(o=>{r.setUpdateSessionStatus(!o.updateStatus),"success"===o.updateStatus?ki(e,t,n).then((e=>s(e))).catch((e=>a(e))):a(o.updateStatus.error)}),vi)})),Bi=e=>{xi[e]>0&&(xi[e]-=1,0===xi[e]&&delete xi[e])};so.interceptors.request.use((e=>(Li.request&&(e=Li.request(e)),e)),(e=>Promise.reject(e))),so.interceptors.response.use((e=>{if(202===e.status&&e.config.headers.context&&e.data?.caseInfo?.errorMessage){const t=[{type:"error",message:e.data.caseInfo.errorMessage}];let n=e.config.headers.context;return n&&n.includes("/workarea")&&(n=n.substring(0,n.lastIndexOf("/workarea"))),Kn({messages:t,category:"HTTP",context:n}),Promise.reject(e)}return e.config.headers&&e.config.headers.context&&(e.config.skipClearErrorMessages||(Yn({type:"error",category:"HTTP",context:e.config.headers.context}).length>0&&zn({type:"error",category:"HTTP",context:e.config.headers.context}),Yn({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})),Bi(e.config.headers.context)),Li.response&&(e=Li.response(e)),e}),(e=>(e.config&&e.config.headers&&e.config.headers.context&&Bi(e.config.headers.context),!e.response||!e.response.status||401!==e.response.status||e.config&&Ci(e.config.url,Ui)||fi.subscribe(vi,(e=>{wi.setUpdateSessionStatus(!e.updateStatus)}),vi),Ni(e,wi,Ui,e.response&&e.response.status&&e.response.status===Number(ji)?ji:null))));const Gi=()=>so.CancelToken.source(),Wi=e=>so.isCancel(e),Hi=e=>{Oi.setDefaultHeaders(e)},qi=e=>{Ui={...Ui,...e}},Yi=e=>{Fi={...Fi,...e}},zi=()=>({...Fi}),Ki=()=>({...Ui});const Xi=class{static createCase(e,t){const{caseInfo:n,startingFields:r,flowType:s,viewType:a=wc.PAGE,pageName:o,context:i=j.APP.APP,debugInfo:c,headers:l}=t;let u={};n&&n.content&&(u=n.content);const d={caseTypeID:e,content:{...u,...r},processID:s};return Qi("createWork",{body:d,queryPayload:{caseClassName:e,viewType:a,params:{pageName:o}},headers:{...l,...c&&{...Oi.addDebugHeaders(c)}}},i).then((t=>({response:t.data,requestPayload:d,headers:Lc(t.headers,e,l)})))}},Ji=()=>({registerHeader:(...e)=>Oi.registerHeader(...e),unRegisterHeader:(...e)=>Oi.unRegisterHeader(...e),getRegisteredHeaders:()=>Oi.getRegisteredHeaders()}),Qi=(e,{body:t={},queryPayload:n={},cancelTokenSource:r,headers:s={},responseType:a},o,i)=>{const{restApi:c,reqType:l}=Fg(e,n),u={method:l,headers:s,body:t,...a&&{responseType:a}};return r&&(u.signal=r.token),ki(c,u,o,i??{})},Zi=(e,{method:t="GET",body:n={},headers:r={},withoutDefaultHeaders:s=!1},a)=>{e.startsWith("http:")||e.startsWith("https:")||(e=E()+e);return ki(e,{method:t,headers:r,body:n,withoutDefaultHeaders:s},a)},ec=e=>Ap.doesRestApiExist(e),tc=()=>Gi(),nc=e=>Wi(e),rc=e=>{Vi(e)},sc=()=>Xi;const ac=new class{#e;constructor(){this.userSettings={},this.componentCache={},this.contextMapToClearOnCancel={},this.#e=!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?wh.isValidJson(t):void 0;return n||t};removeComponentState=e=>{sessionStorage.removeItem(this.getNormalizedKey(e))};fetchUserSettings=async()=>{if(ec("getUserSettings")){const{restApi:e,reqType:t}=Fg("getUserSettings");ki(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=()=>{_p.getUserSettings()?this.userSettings=_p.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 wh.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(!ec("updateUserSettings"))return Promise.resolve("updateUserSettings route is not available");n=Fg("updateUserSettings");const{restApi:r,reqType:s}=n;return ki(r,{method:s,body:wh.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.#e){this.#e=!0;const e=e=>{const{context:t}=e||{};(this.contextMapToClearOnCancel[t]||new Set).forEach((e=>{this.resetComponentCache(e)})),delete this.contextMapToClearOnCancel[t]};fi.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))}};class oc{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 ic=oc,cc=e=>{fi.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_SUBMISSION,e)},lc={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}`},uc=(e,t)=>{const{vcName:n,containerName:r}=t;return r||n||ic.getTargetViewContainerName(e)},dc=e=>{const t=e.lastIndexOf(j.FORWARD_SLASH_STRING)+1,n=e.lastIndexOf(j.UNDERSCORE_STRING);return e.substring(t,n)},pc=e=>e===dd.WORKAREA,hc=e=>e===dd.MODAL,gc=e=>e===Ee,fc=e=>e&&e.find((e=>e.type===Ee)),mc=e=>wh.getIn(e,lc.CASE_INFO,{}),yc=e=>e?e.split(" ").pop():void 0,Ic=e=>wh.getIn(e,lc.CASE_CLASS_NAME,j.EMPTY_STRING),Ec=e=>{const t=mc(e);return en(t)&&tn(_p.getOperatorIdentifier(),t)},Ac=e=>wh.getIn(e,lc.CASE_INFO_ID,j.EMPTY_STRING),_c=e=>wh.getIn(e,lc.CASE_FIRST_ASSIGNMENT_ID,j.EMPTY_STRING),Cc=(e,t)=>{const{removeActionPayload:n,target:r}=t;if(n&&n.containerItemID){const{containerItemID:t,context:s}=n;e.push(mg(lg,{containerItemID:t,context:s||Rd(t),target:r}))}},Sc=e=>{const t=fh();if(!e)return!1;const n=W(e),r=Bd(n),s=Bd(e);if(!r||!s)return!1;const a=gd(r,n),o=gd(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},Tc=(e,t,n={})=>{const{skipFlowNameUpdate:r}=n,s=Ac(t);wh.setIn(e,"key",s);const a=en(mc(t));if(!r&&(e=>{const t=wh.getIn(e,lc.ASSIGNMENTS,[]);return t&&t.length>0})(t)){const n=_c(t),[,r]=n.split("!");(e=>{fi.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.CURRENT_ASSIGNMENT_UPDATED,e)})({assignmentID:n,isInCreateStage:a}),wh.setIn(e,"flowName",r)}},Nc=(e,t)=>{const{attachmentsExist:n}=t;n&&wh.setIn(e,F.SUMMARY_OF_ATTACHMENTS_LAST_REFRESH_TIME,(new Date).toLocaleString()),wh.setIn(e,F.SUMMARY_OF_ASSIGNMENT_LAST_SUBMIT_TIME,(new Date).toLocaleString())},Pc=(e,t,n)=>{let r=j.PROMISE_VALUE.RESOLVE;return fc(e)?(r=j.PROMISE_VALUE.REJECT,n?un.rejectActionByID(t,!0,n):un.rejectActionByID(t)):un.resolveActionByID(t),r},Rc=e=>{const t=_p.getCaseTypeList();return"true"===t.filter((t=>t.pyWorkTypeImplementationClassName===e))?.[0]?.pyIsTraditionalUICase},Dc=()=>"true"===_p?.environmentInfoObject?.pxMashupDetails?.pyLaunchCaseInModal,bc=(e,t)=>{const n=Ic(e?.response),r=mc(e?.response),{caseTypeID:s}=r,a=_p.getFeatureMap();(a?.deferUpdateCaseSummaryView??!Object.hasOwn(a,j.DEFER_UPDATE_CASESUMMARY_VIEW))&&s&&Kp(j.CASESUMMARY_VIEW_NAME,s)&&((e,t,n)=>{const{containerItemID:r,caseID:s}=t;if(r){const{caseClassName:a,skipAssignmentsUpdate:o}=n,i=W(r),c=Bd(i),l=c&&hd(c),u=c&&Td(c),d=z(i);u&&l?.items?.[u]?.key===t?.caseID&&e.push(mg(Hh,{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})},Oc=e=>yh(e)?.context_data?.caseViewMode;const vc=class{static isCaseActive(e,t){if(!e||!t)return!1;const n=hd(t);if(n){const r=Td(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}=Fg("loadView",n);return ki(r,{method:s},t)};static getCaseEditLock=(e,t)=>{const n={caseID:e,actionID:"pyUpdateCaseDetails"},{restApi:r,reqType:s}=Fg(ze,n);return ki(`${r}?viewType=page`,{method:s},t)};static updateCaseEditFieldsData=(e,t,n,r)=>{const s={caseID:e,actionID:"pyUpdateCaseDetails"},{restApi:a}=Fg(ze,s),o=t[e];return ki(`${a}?viewType=form`,{method:"PATCH",body:{content:{...o}},headers:{"if-match":n}},r)};static getCaseMessages=e=>yh(e)?.caseMessages;static getPropertiesToReplace=e=>(gl(e)||[]).map((e=>({path:e.fullPath,allowMultiple:e.allowMultiple})));static getUniqueGadgetId=()=>wh.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:xc}=F,wc={PAGE:"page",FORM:"form"},Mc={[xc.CASE]:[We,Be,Ge],[xc.PAGE]:[je,ke],[xc.DATA]:[Ve],ASSIGNMENT:[Je]},Lc=(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},Uc=(e,t={})=>{const{onlyChangedData:n=!1,nonEmptyAndChangedData:r=!1,skipUUID:s=!0,isTransientContext:a=!1,includeDisabledFields:o=!1}=t;let i={};i=fl(e,{isTransientContext:a,includeDisabledFields:o}),n&&(delete i?.caseInfo?.content,a&&(i={}));const c=bl(e,!1);!a&&r&&((e,t)=>{Object.entries(e?.caseInfo?.content).forEach((([n,r])=>{const s=yh(t),a=b()(s,F.CASE_INFO.CASE_INFO_CLASSID),o=Gp(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=[...yr(e)];s&&p.forEach((e=>{delete e.content?.EmbedListUUID__})),u.pageInstructions=p;return(dr[e]||[]).forEach((e=>{if(u?.content){const t=e?.replace(j.CASE_INFO.CASE_INFO_CONTENT,"");wh.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}},Fc=(e,t)=>{let n,r,s={};const a=wh.getIn(e,j.UI_RESOURCES),o=wh.getIn(e,"confirmationNote");a?(n=wh.getIn(e,j.UI_RESOURCES_CONTEXT_DATA),r=wh.getIn(e,j.ROOT),s=wh.getIn(e,j.ACTION_BUTTONS)):o&&(r={});const{data:i={},Errors:c,semanticURL:l,key:u,flowName:d}=e,p=wh.getIn(e,"nextAssignmentInfo",null),h=wh.getIn(e,"nextAssignmentInfo.context",""),g=wh.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}},jc=async(e,t,n,r=!1,s=!1)=>{const a=wh.getIn(e,j.LOCALE_REFERENCES);await Tp.loadLocaleResources(a);const o=wh.getIn(e,j.COMPONENTS);if(o)try{await Vr(o)}catch(e){console.error(e)}const i={actionConfig:t,...n};r?Wg({...e,options:i,directUrlUpdation:!0}):Mr(e,i,s)},Vc=(e="")=>{const t=e.indexOf(" "),n=e.indexOf("!");return e.substring(t+1,n)},kc=e=>{if(e){const[,t]=e.split("!");return{key:Vc(e),flowName:t}}return{}},$c=(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=wh.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}},Bc=e=>{const{payload:t}=e,{err:n,context:r,actionMgrID:s}=t,a=n&&n.response?n.response.data:"",o=yl(r);return s&&un.rejectActionByID(s,!0,n),mg(yg,"Error action triggered",a,r,o)},Gc=(e,t)=>wd(e)&&Ld(e)?mg(pg,t):mg(Jh,t),Wc=(e,t,n=j.APP.APP,r={})=>{let s=null;const{buildNew:a=!0}=r;return wd(e)?s=Ld(e)?Td(e):H(t,n):Md(e)&&(Ld(e)&&!a?s=Dd(e):Ld(e)&&!a||(s=H(t,n))),s},Hc=e=>e&&e.type===Ce,qc=e=>{let t=!1;const n=vd(e);for(let e=0;e<n.length;e+=1){const r=n[e];if(r&&Ml(r)){t=!0;break}}return t},Yc=(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(wd(e)){const t=Td(e);if(!t)return{continueExecution:a,removeActionPayload:s};const r=Rd(t);Ml(r)&&(n=!0),u||n||(n=qc(t))}else if(Md(e)&&jd(e)){let t=$d(e);t||(t=Td(e),r=!0),s.containerItemID=t,s.context=Rd(t)}if(n){const e=l||Rl;o=window.confirm(Tp.getLocaleValue(e,"Messages"))}if(!o&&n&&(s={},a=!1),r){const e=Tp.getLocaleValue(Dl,"Messages");c?i=window.confirm(e):(window.alert(e),a=!1)}return!i&&r&&(s={},a=!1),{continueExecution:a,removeActionPayload:s}},zc=(e,t)=>{let n=!1;const r=_p.isCoexistenceAppOfType(j.APP_TYPE.UIKIT),{insKey:s,isParallelCall:a,skipFlowNameCheck:o}=t;if(!s)return{};const[,i]=s.split("!")||"",c=o?s:Vc(s),l=Ed(e,c);let u={},d=!1;if(l&&!r&&((e,t)=>{const n=gd(e,t);return n?.resourceType})(e,l)===t?.type&&(n=!0,u=gd(e,l),!o)){let e=u?.flowName;const t=dc(l),r=bd(l);if(r.length){const n=yt(t,r[0]);e=gd(n,r[0])?.flowName}else n=e===i;(e!==i||a)&&(d=!0)}return{activate:n,activateContainerActionPayload:{target:e,isParallelAssignment:d,containerItemID:l,semanticURL:u.semanticURL,insKey:s}}},Kc=(e,t,n)=>e===xc.PAGE?((e,t={})=>{let n=!1;const{semanticURL:r}=t,s=Ed(e,r);return s&&(n=!0),{activate:n,activateContainerActionPayload:{target:e,containerItemID:s,semanticURL:r}}})(t,n):e===xc.ASSIGNMENT?zc(t,{...n,type:e}):e===xc.CASE?zc(t,{...n,skipFlowNameCheck:!0,type:e}):{},Xc=(e=[])=>{Ld(`${j.APP.APP}/${j.PREVIEW}`)&&e.push(mg(Xh,Vd({context:F.APP.APP,name:j.PREVIEW})))},Jc=e=>{let t;for(const n of Object.keys(Mc))if(Mc[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)};wh.deleteIn(a.data,"shared"),wh.setIn(a.data,["context_data","caseViewMode"],s),t.push({type:at,payload:{context:a.context}}),t.push(mg(Gh,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=wh.getIn(t,["payload","assignmentContext"]);if("other"===n||"remote"===n){const r=wh.getIn(t,["payload","nextAssignmentInfo","ID"]);if(t?.payload?.isProcessAction){const n={acName:wh.getIn(t,["payload","target"]),caseID:t.payload.data.caseInfo.ID,containerItemID:wh.getIn(t,["payload","context"]),context:wh.getIn(t,["payload","context"])},r={type:he,payload:{...n}};e.push(r),e=e.filter((e=>delete e?.payload?.data?.caseMessages)),mh(e),e=e.filter((e=>e.type!==he))}const s=((e,t,n)=>({assignmentID:e,vcName:j.PRIMARY,targetContainerName:wh.getIn(t,["payload","target"]),context:wh.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);wd(s.targetContainerName)||t?.payload?.containerName!==j.WORKAREA||(s.isMultiDoc=!0,e=[]);const a={type:ge,payload:{...s}};e.push(a),mh(e)}else mh(e)}},el=(e,t)=>w()(e,t,(function(e,t){if(Array.isArray(e))return e.concat(t)})),tl=e=>{let t={},n=ip(e);for(;n;){const e=Uc(n);t=el(e.content,t),n=ip(n)}return t};class nl{static getChanges(e){return{...bl(e)}}static getSubmitData(e,t){const{isTransientContext:n=!1,includeDisabledFields:r=!1}=t||{},{content:s}=Uc(e,{isTransientContext:n,includeDisabledFields:r});return s}static isStateModified(e){return Ml(e)||Rr(e)||!(!e||!vl(e))}static isFormValid(e,t){return ml(e,t)}static clearChangedProperties(e){return Er(e),mr(e),Ul(e)}static getEditableFields(e){return Il(e)}static setCustomValidator(e,t){xr.register(e,t)}static isPropertyEditable(e,t){return nl.getEditableFields(e).some((e=>e.name===t))}}const rl=nl;const sl=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,!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=Rn.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}})),wh.flatten(n,"",r),r}getStateMachinesByContext(e){return e?this.states?.[e]:void 0}clearStateMachines(e){this.states[e]={},this.unConnectedStates[e]={}}setStateMachineEmpty(e,t){const n=this.getStateMachine(e,t,""),r=Rn.getFieldReferenceForProperty(e,t);if("Multiselect"===r?.props?.componentName&&n?.current?.instruction?.instruction===j.LIST_ACTIONS.DELETE_ALL)return;n.root=null,n.current=null;const s=this.getUnConnectedStateMachines(e)||{};Object.keys(s).forEach((e=>{e.includes(t)&&delete s[e]}))}removeStateMachine(e,t){delete this.states[e]?.[t]}createStateMachine(e,t){let n=e.substring(0,e.lastIndexOf("["));const r=n.substring(n.lastIndexOf("."));n=n.substring(0,n.lastIndexOf(".")),n&&r&&hr(t,r,n)}getStateMachineObjByPath(e,t,n,r=!1){const s=/\[\d+\]$/gm,a=e;let o;for(;e&&!this.isStateMachineExist(t,"",e);){if(o=null,n&&e.endsWith("]")){if(o=e.match(s),o=o?.[o.length-1]?.substring(1,o[o.length-1].length-1),[e]=e.split(s),!r&&!this.isStateMachineExist(t,"",e)){this.createStateMachine(a,t);break}break}e=e.substring(0,e.lastIndexOf("."))}return e?{stateMachineTarget:e,stateMachine:this.getStateMachine(t,"",e),index:o}:{}}executeStateMachine(e,t,n,r=!0,s={}){const{stateMachineTarget:a,index:o}=this.getStateMachineObjByPath(t,e,r);if(!a)return!1;let[,i]=t.split(a);if(!i)return!1;null!==o&&([,i]=i.split(/^\[\d+\]/gm));const c={[ol(i)]:n},l=this.getStateMachine(e,"",a);return null!==o?l?.update(c,Number(o)+1,s.skipStateUpdate??!0,s):l?.updatePage(wh.unflatten(c)),!0}registerForServerChanges(){dh.registerForListChanges(((e,t,n)=>{setTimeout((()=>{const r="].";if(!t.includes(".classID")&&rl.isPropertyEditable(e,t)&&this.executeStateMachine(e,t,n),!t.includes(".classID")&&t.includes(r)){const s=t.substring(0,t.lastIndexOf("[")),a=rl.getEditableFields(e);if(["multiselect","checkbox"].includes(a.find((e=>e.name===s))?.type)){const a=Rn.getContextReferences(e),o=a?.get(s),i=t.substring(t.lastIndexOf(r)+2);o?.props.selfReferencingDatapageKeys?.includes(i)&&this.executeStateMachine(e,t,n)}}}),0)}))}unRegisterForServerChanges(){dh.unRegisterForListChanges()}},al={},ol=e=>e.startsWith(".")?e.substring(1):e,il=e=>{delete al[e]},cl=(e,t={})=>{const{includeDisabledFields:n=!1}=t,r=Fh.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},ll=(e,t,n,r,s)=>{let a=(Ah(`.attachmentsList.${t?.replace(".","")}`,"context_data",n)||[]).filter((e=>`${r.pageReference}.${e.label}`===s));return a=wh.buildAttachmentsFormData(a),a.length>0&&(e=[...e,...a]),e},ul=(e,t,n,r,s)=>(sl.executeStateMachine(e,r,Fh.getLitePropertyValue(n,t))||s.push(r),s),dl=e=>{const t=e.pageReference?.replace(F.CASE_INFO.CASE_INFO_CONTENT,"")?.replace(F.DATA_INFO.DATA_INFO_CONTENT,"");return"Attachment"===e.componentName&&""!==t},pl=(e,t,n)=>{const r=t.isInsideList,{ignoreFieldsInsideList:s=!0}=n;return(!r||r&&!s)&&!Array.isArray(Fh.getLitePropertyValue(t,e))&&"Address"!==t.componentName},hl=(e,t={})=>{let n=[],r=[];const s=[],a=Rn.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=Fh.resolveContextTreeNodeProps(i.props),c=e.propertyName;if(cl(i.props,{includeDisabledFields:r})){const r=dl(e);"Attachment"!==e.componentName||r?!r&&pl(o,e,n)&&(s=ul(t,c,e,o,s)):a=ll(a,c,t,e,o)}}return{attachmentList:a,editableFormFieldsReferenceList:s}})(a,e,t)),al[e])for(const t in al[e].fieldOrder)Object.hasOwn(al[e].fieldOrder,t)&&s.push(t);return{formInputs:n,attachments:r,formPageFields:s}},gl=e=>{let t=[];const n=Rn.getContextReferences(e);if(n)for(const[e,r]of n){const n=r?.props;if(cl(n)&&"Attachment"===n?.componentName){const r="true"===n?.allowMultiple;t=[...t,{type:"File",allowMultiple:r,fullPath:e}]}}return t},fl=(e,t={})=>{const n={},r=yh(e),{ignoreFieldsInsideList:s=!0,isTransientContext:a=!1,includeDisabledFields:o=!1}=t;if(a||r?.caseInfo?.content){const{formInputs:t,attachments:i,formPageFields:c}=hl(e,{ignoreFieldsInsideList:s,includeDisabledFields:o});i&&i.length>0&&wh.buildObject("caseInfo.attachments",n,i),((e,t,n)=>{e.forEach((e=>{let r=wh.getIn(t,e);"object"==typeof r&&(r=wh.deepClone(r),delete r?.classID),wh.buildObject(e,n,r)}))})(c,r,n),t&&t.length>0?t.forEach((e=>{wh.buildObject(e,n,wh.getIn(r,e))})):a||wh.buildObject(F.CASE_INFO.CASE_INFO_CONTENT,n,{})}if(!a&&r?.dataInfo?.content){const{formInputs:t}=hl(e,{ignoreFieldsInsideList:s});t.forEach((e=>{wh.buildObject(e,n,wh.getIn(r,e))}))}return n},ml=(e,t)=>{const n=Rn.getContextReferences(e);let r=!0;if(!n)return r;for(const[e,s]of n){const n=Fh.resolveContextTreeNodeProps(s.props);if(cl(s.props)&&(!t||e.includes(t))){const e=xr.validate(n.componentName?.toLowerCase(),n.propertyName,Fh.getLitePropertyValue(n,n.propertyName),n);r&&(r=!e.message)}}return r},yl=(e,t=!1)=>{const n=Rn.getContextReferences(e),r=[];if(n)for(const[e,s]of n){if(!1!==Fh.resolveContextTreeNodeProps(s.props).visibility){const n=8,s=t?e:e.substring(e.indexOf("content")+n);r.push(s)}}return r},Il=e=>{const t=[],n=Rn.getContextReferences(e);if(n)for(const[e,r]of n){const n=Fh.resolveContextTreeNodeProps(r.props);cl(r.props)&&"Attachment"!==n.componentName&&"multirecordlist"!==n.type&&t.push({name:e,label:n.label,type:n.componentName?.toLowerCase()})}return t};const El=class{static getPropertyName(e){return Zt.getPropertyName(e)}static isProperty(e){return Zt.isProperty(e)}static getLeafPropertyName(e){return Zt.getLeafPropertyName(e)}static isPropertyInternal(e){return e.startsWith("px")||e.startsWith("pz")}};const Al=class{static isPageInstruction(e){return e&&e.includes("[")&&e.includes("]")}};class _l{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=wh.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 _l.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 _l.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 Cl=new _l,{APP:Sl}=j;let Tl={},Nl={},Pl={};const Rl="You will lose unsaved changes. Do you want to continue?",Dl="You have reached maximum limit of pending changes. Please commit/cancel one or more changes to continue.",bl=(e=Sl.APP,t,n)=>{let r=[],s=[];t||(r=yl(e,!0)),n||(s=(e=>{const t=Rn.getContextReferences(e),n=[];if(t)for(const[e,r]of t)!0===Fh.resolveContextTreeNodeProps(r.props).readOnly&&n.push(e);return n})(e));const a={};((e,t)=>{const n=Nl[t]||{};Object.keys(n).forEach((t=>{Object.hasOwn(n,t)&&wh.buildObject(t,e,n[t].value)}))})(a,e);const o=Tl[e]||{};return Object.keys(o).forEach((e=>{const n=!t&&r.includes(e)||t;Object.prototype.hasOwnProperty.call(o,e)&&n&&!s.includes(e)&&wh.buildObject(e,a,o[e].value)})),a},Ol=e=>{const{context:t}=e,n=e.reference.startsWith(".")?e.reference.substr(1):e.reference;delete Tl[t]?.[n],delete Nl[t]?.[n]},vl=e=>Pl[e],xl=(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=Ah(t.reference,null,n):(e[a]={initialValue:r||Ah(t.reference,null,n)},e[a].previousValue=e[a].initialValue),e[a].value=t.value,s&&e[a].value===e[a].initialValue&&Ol(t)},wl=e=>{const{payload:t}=e,{context:n}=t,r=t.reference.startsWith(".")?t.reference.substr(1):t.reference;Rn.isFieldExists(n,r)||(Nl[n]=Nl[n]||{},xl(Nl[n],t)),Tl[n]=Tl[n]||{},xl(Tl[n],t)},Ml=e=>{const t=Ir(e)||{};return e&&Tl[e]&&Object.keys(Tl[e]).some((t=>Tl[e][t].initialValue!==Tl[e][t].value))||Object.keys(t).length>0},Ll=(e,t)=>{if(!e||!t)return!1;const n=Tl[e]&&Tl[e][t];return!!n&&n.previousValue!==n.value},Ul=e=>{e&&Tl[e]?(Tl[e]={},Nl[e]={}):"all"===e&&(Tl={},Nl={},Pl={}),Pl[e]&&(Pl[e]=!1)},Fl=()=>e=>t=>{const{type:n,payload:r={}}=t||{};if(n===ee&&(Yt(r),(e=>{const{context:t,pageReference:n,value:r,reference:s}=e;dh.triggerCascade(t,s,r);const a=Xt.getDependencies(t,s),o=dh.getResetDependencies(t,s),i={context:t,datapages:{}};[...a,...o].forEach((e=>{const n=wh.getPropertyNameFromDependency(e);if("multiRecord"===e.mode){const e=n.split("."),r=`.${e.pop()}`,s=e.join(".");sl.isStateMachineExist(t,s,r)&&sl.getStateMachine(t,s,r).deleteAll()}else Al.isPageInstruction(n)&&sl.executeStateMachine(t,n,""),mh({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=Ah(`.${o}`,s,t)?.classID||e.classID,l=Gp(r.split(".").pop(),c),{datasource:u}=l,d={};let p=[];u.parameters.forEach((e=>{e?.value?(d[e.name]=El.isProperty(e.value)?Ah(`.${wh.getFullPropertyReference([o,wh.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,wh.getHashedString(p.join(j.HASH_DELIMITER)));const{name:h}=u,g=Jp(h);i.datapages[p]={mode:u.mode,propertyName:r,name:u.name,dataViewParameters:d,refreshStrategy:g?.refreshStrategy}})),a.length&&mh({type:tt,payload:i})})(r),setTimeout((()=>{(Ll(r.context,r.reference)||Rr(r.context))&&Fn(r),Cl.triggerRefreshForType("PROP_CHANGE",r.reference,r.context)}),0)),n===st&&!r?.isDefault){const{context:e,referenceList:t}=r;Fn({context:e,pageReference:t})}if(n===Q||n===Z){const{reference:e,isImplicit:n,context:s,skipDirtyValidation:a=!1}=r;Rn.updateFieldNodeValue(s,e,r.value),Al.isPageInstruction(e)||a?a||(Pl[`${s}`]=!0):wl(t),(r.removePropertyFromChangedList||n)&&Ol(r)}if(n===De||n===be){const{transientItemID:e,data:t}=r;wh.iterateLeafNodes(t,(t=>{Ol({context:e,value:"",reference:t.join(".")})}))}if(n&&[xe,Se,Me,Re].includes(n)){Ul(r.context),dh.purgeResetDependencies(r.context),(e=>{e&&On[e]&&delete On[e]})(r.context);(r.childContainersContexts||[]).forEach((e=>{Ul(e)}));(r.transientItems||[]).forEach((e=>{Ul(e)}))}e(t)};const jl=new class{getCoreheaders(e){const t=`${F.APP.APP}${j.FORWARD_SLASH_STRING}${j.PRIMARY}`,n=Td(t),r=Rd(n),s=Fh.getProperty(j.COREHEADERS,"",r);if(s&&e in s)return s[e]}};const Vl=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=Rn.getContextReferences(e)?.get(`${t}${r}`)?.props;return s?Fh.resolveContextTreeNodeProps(s):s})(this.c11nEnv.getContextName(),this.c11nEnv.getPageReference(),t),{message:s}=xr.validate(this.c11nEnv.getComponentName()?.toLowerCase(),t,e,r);return s?{status:!1,message:s}:{status:!0}}},kl="OPEN_PROCESS_ACTION",$l="OPEN_ASSIGNMENT",Bl="DELETE_CASE_IN_CREATE_STAGE",Gl="SAVE_AND_CLOSE",Wl=e=>({type:Gl,payload:e});const Hl=class{static getSavableDataPage(e){return sh(e)}static getLookUpDataPage(e){return oh(e)}static getLookUpDataPageInfo(e){return ih(e)}static getDataPageKeys(e){return ah(e)}};const ql=class{constructor(e){this.c11nEnv=e}containerManagerPromise=e=>{const t=un.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 un.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 mh(Kh(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=yt(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 mh(Jh(h)),p}updateContainerItem(e){if(!e?.containerItemID)return Promise.reject(new Error("updateContainerItem : containerItemID is required in containerInfo object"));const t=xe,n={context:Rd(e.containerItemID),target:Bd(e.containerItemID)},{actionMgrID:r,promise:s}=this.containerManagerPromise(t),a={...n,...e,actionMgrID:r};return mh(rg(a)),s}activateContainerItem(e){if(!e?.containerItemID)return Promise.reject(new Error("activateContainerItem : containerItemID is required in containerInfo object"));const t=ve,n={target:Bd(e.containerItemID)},{actionMgrID:r,promise:s}=this.containerManagerPromise(t),a={...n,...e,actionMgrID:r};return mh(ig(a)),s}removeContainerItem(e){if(!e?.containerItemID)return Promise.reject(new Error("removeContainerItem : containerItemID is required in containerInfo object"));const t=Se,n={context:Rd(e.containerItemID),target:Bd(e.containerItemID)},{actionMgrID:r,promise:s}=this.containerManagerPromise(t),a={...n,...e,actionMgrID:r};return mh(lg(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=Vd(e),{actionMgrID:r,promise:s}=this.containerManagerPromise(t),a={...n,...e,actionMgrID:r};return mh(Xh(a)),s}addTransientItem(e){const{id:t,data:n}=e,r=this.c11nEnv.getContextName(),s=Y(t,r),a=Yd(r);return s&&a.includes(s)||mh(Qh({transientItemID:s,contextName:r,target:Bd(r),data:n})),s}updateTransientData(e){const{transientItemID:t,data:n}=e,r=this.c11nEnv.getContextName();if(t){if(!Yd(r).includes(t))return;mh(Zh({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(!Yd(t).includes(s))return;mh(dg({target:n,containerItemID:r,transientItemID:s}))}}createContainerPConnect(e,t,n,r=!1){cd.createContainerPConnect(e,t,n,r)}hasContainerItems(){const e=this.c11nEnv.getContextName(),t=this.c11nEnv.getContainerName();return Ld(`${e}/${t}`)}isContainerInitialized(){const e=this.c11nEnv.getContextName(),t=this.c11nEnv.getContainerName();return Cd(e,t)}};var Yl=function(e,t){return e===t||"function"==typeof t&&e===t.toString()};function zl(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n,r,s=e.length;return n=1===s?function(t){return Yl(t.type,e[0])}:function(t){for(var n=0;n<s;n++)if(Yl(t.type,e[n]))return!0;return!1},si((function(e,t){var s=0;e.subscribe(ai(t,(function(e){return n.call(r,e,s++)&&t.next(e)})))}))}function Kl(e,t){return si((function(n,r){var s=null,a=0,o=!1,i=function(){return o&&!s&&r.complete()};n.subscribe(ai(r,(function(n){null==s||s.unsubscribe();var o=0,c=a++;ti(e(n,c)).subscribe(s=ai(r,(function(e){return r.next(t?t(n,e,c,o++):e)}),(function(){s=null,i()})))}),(function(){o=!0,i()})))}))}function Xl(e,t){return si((function(n,r){var s=0;n.subscribe(ai(r,(function(n){r.next(e.call(t,n,s++))})))}))}function Jl(e,t,n){return void 0===n&&(n=1/0),Eo(t)?Jl((function(n,r){return Xl((function(e,s){return t(n,e,r,s)}))(ti(e(n,r)))}),n):("number"==typeof t&&(n=t),si((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;ti(n(e,u++)).subscribe(ai(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?ri(t,o,(function(){return g(e)})):g(e)};c.length&&l<r;)e();p()}catch(e){t.error(e)}})))};return e.subscribe(ai(t,h,(function(){d=!0,p()}))),function(){null==i||i()}}(t,r,e,n)})))}function Ql(e){return e&&Eo(e.schedule)}function Zl(e){return e[e.length-1]}function eu(e){return Ql(Zl(e))?e.pop():void 0}function tu(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return di(e,eu(e))}function nu(e){return si((function(t,n){var r,s=null,a=!1;s=t.subscribe(ai(n,void 0,void 0,(function(o){r=ti(e(o,nu(e)(t))),s?(s.unsubscribe(),s=null,r.subscribe(n)):a=!0}))),a&&(s.unsubscribe(),s=null,r.subscribe(n))}))}var ru=new qo((function(e){return e.complete()}));function su(e){return e?function(e){return new qo((function(t){return e.schedule((function(){return t.complete()}))}))}(e):ru}const au=(e,t,n)=>nu((r=>("ERR_CANCELED"!==r?.code&&console.error(e,r),tu(yg(e,r,t,null,n))))),ou=(e,t)=>n=>new qo((r=>{let s={},a=0;return n.pipe(Jl((n=>{const r=Date.now();let o;return o=t||h(),o&&o(n,s)&&r-a<e?su():(s=n,a=r,tu(n))}))).subscribe(r)})),iu=e=>{const{dataPageID:t,context:n,headers:r,containerItemID:s}=e,a={data_view_ID:t},{restApi:o,reqType:i}=Fg("createDataObject",a),{content:c}=Uc(s);return di(ki(o,{method:i,headers:r,body:{data:c.content}},s)).pipe(Xl((t=>({response:t.data,actionInPayload:e}))),au("Error occurred during ajax call at createDataObject Epic",n))},cu=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}=Fg("readDataObject",o);return di(ki(i,{method:c,headers:r,body:{dataViewParameters:a}},n)).pipe(Xl((t=>({response:t.data,actionInPayload:e}))),au("Error occurred during ajax call at getDataObjectView Epic",n))},lu=e=>{const{dataPageID:t,context:n,headers:r,containerItemID:s,key:a}=e,o={data_view_ID:t},{restApi:i,reqType:c}=Fg("updateDataObject",o),{content:l}=Uc(s);return di(ki(i,{method:c,headers:r,body:{data:{...l.content,...a},pageInstructions:l.pageInstructions||[]}},s)).pipe(Xl((t=>({response:t.data,actionInPayload:e}))),au("Error occurred during ajax call at updateDataObject Epic",n))},uu=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}=Fg("openDataObjectAction",o);return di(ki(i,{method:c,headers:r,body:{dataViewParameters:a}},n)).pipe(Xl((t=>({response:t.data,actionInPayload:e}))),au("Error occurred during ajax call at getDataObjectView Epic",n))},du=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}=Fg("submitDataObjectAction",i),{content:u}=Uc(o);return di(ki(c,{method:l,headers:r,body:{data:{...u?.content,...a},pageInstructions:u?.pageInstructions||[]}},n)).pipe(Xl((t=>({response:t.data,actionInPayload:e}))),au("Error occurred during ajax call at getDataObjectView Epic",n))};const pu=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;xn(e,r,t,s,{})}}},hu="postDataViewMetadata",gu={getData:(e,t,n,r)=>((e,t,n,r={})=>{const s={dataViewName:e},{skipClearErrorMessages:a,signal:o,doNotMergeMessagesForStatusCode:i}=r,{restApi:c,reqType:l}=Fg("getListData",s);return ki(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}=Fg("getListDataCount",r);return ki(s,{method:a,body:t},n)},getDataViewMetadata:(e,t,n,r)=>{const s=!!n,a=!!r,o=Ap.doesRestApiExist(hu),i=(s||a)&&o?hu:"getDataViewMetadata",c={dataViewName:e},{restApi:l,reqType:u}=Fg(i,c);if(o){if(s)return ki(l,{method:u,body:{associationFilter:n}},t);if(a)return ki(l,{method:u,body:{propertyFilter:r}},t)}return ki(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}=Fg("readDataObject",c);return ki(u,{method:d,body:l,...o&&{signal:o},...a&&{skipClearErrorMessages:a}},r,i)},getCaseEditMetadata:(e,t)=>vc.getCaseEditMetadata(e,t),getCaseEditLock:(e,t)=>vc.getCaseEditLock(e,t),updateCaseEditFieldsData:(e,t,n,r)=>vc.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}=Fg("moveListRecords",c);return ki(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!==Od("root").find((e=>e.includes("authoring-preview")))?`${j.AUTHORING_PREVIEW_CONTAINER}-${e}`:`${Ur.getAppAlias()}-${e}`,isDistinctResultsOnly:e=>{const t=_p.getKeyMapping("pyGUID");return!e.some((e=>e.field===t))}};const fu=class{constructor(e,t,n){this.filter=e,this.messageHandler=t,this.contextName=n}};const mu=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 Cu.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],Cu.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 yu=s(631),Iu=s.n(yu);const Eu=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===Iu()(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};Cu.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 Au=new class{constructor(){this.subscriptions={}}getOrCreateSubscription(e){if(!this.subscriptions[e]){const t={caseId:e};this.subscriptions[e]=new Eu("CASE",t)}return this.subscriptions[e]}};class _u{static subscribers={};static connectionsCount=0;static webSocket=null;static connectionConfig=null;static inProgressSubscriptions=[];static inProgressMessages=[];static isServiceAlive=null;static serviceAliveHandler=null;static userPresence=new mu;static refreshB2SOffset=10;static initConnection(e){if(!e)return;const{messagingService:t}=e;if(!t||t&&t.length<=6)return;const n=Ur.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=Ur.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&&wh.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 fu(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=>Au.getOrCreateSubscription(e);static refreshB2STokenReInit=async()=>{const e={body:{B2SToken:Ur.b2sJWT}};PCore.getRestClient().invokeRestApi("refreshB2S",e).then((e=>{const{newB2SToken:t}=e.data;t&&t.length>30?(Ur.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 Cu=_u;const Su=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=Rh(this.records,e,{isArrayDeepMerge:!1})),this.setMaxRecordsCount(this.records.length)}setMaxRecordsCount(e){this.maxRecords=e}getMaxRecordsCount(){return this.maxRecords}};const Tu=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=Jp(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=wh.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}=Fg(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 ki(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&&wh.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 Su;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 Su);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),gu.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&&dh.unRegisterFields(n,r,t,s)}subscribeToCascadeUpdates(e,t,n,r,s){t&&t.length>0&&dh.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}};Cu.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=Jp(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 Nu=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 Pu=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 Nu(t,n,s,r,a,o)),this.bufferedDataQueues[e]}},Ru=(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,Du=e=>e.map((e=>e.field)),bu=(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;Ru(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=Du(e.query?.select);Du(t.query?.select).forEach((t=>{o.includes(t)||(e.query?.select).push({field:t})}))},Ou=(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]:!wh.isEqual(e.dataViewParameters?.[n],t.dataViewParameters?.[n]))))(e,t)||((e,t)=>!e.dataViewParameters&&!t.dataViewParameters)(e,t)),vu=(e,t)=>{const{data:n}=t,{dataViewCallMap:r,filterDataOnClient:s}=e;Object.keys(r).forEach((e=>{r[e].resolve({data:s(e,n)})}))},xu=e=>({combiner:bu,comparator:Ou,separator:vu,...e}),wu=(e,t)=>{try{window.sessionStorage.setItem(e,t)}catch(e){}};class Mu{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=wh.getHashedString(s),o=`${e.dataSource}_${a}`,i=gu.getAppCacheKey(e.dataSource);if(window.sessionStorage.getItem(i)){const s=JSON.parse(window.sessionStorage.getItem(i));if(t&&Mu.searchResultsCache?.[t]?.[o])n(Mu.searchResultsCache[t][o]);else if("form"!==e.cacheLifeSpan&&Mu.searchResultsCache?.persisted?.[o])n(Mu.searchResultsCache.persisted[o]);else{const a=new Mu(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,Mu.initializeCache(t,e,o,a),n(a)):(a.associationFilter=e.associationFilter,a.propertyFilter=e.propertyFilter,a.fetchMetaData(t).then((r=>{wu(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,Mu.initializeCache(t,e,o,a),n(a)})).catch((e=>{a.isInitialised=!1,r(e)})))}}else if(e.deferDatasource&&Jp(e.dataSource)){const r=new Mu(e,t),s=Jp(e.dataSource);r.isQueryable=!!s?.isQueryable,r.isInitialised=!0,r.dataSourceMetaData=s,wu(i,JSON.stringify({isQueryable:s?.isQueryable,dataSourceMetaData:s,isInitialised:!0})),r.context=t,Mu.initializeCache(t,e,o,r),n(r)}else{const s=new Mu(e,t);s.associationFilter=e.associationFilter,s.propertyFilter=e.propertyFilter,s.fetchMetaData(t).then((r=>{wu(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,Mu.initializeCache(t,e,o,s),n(s)})).catch((e=>{s.isInitialised=!1,r(e)}))}}))}static bufferedDataView=new Pu;registerForBufferedCall(e){return this.isQueryable&&(this.initializeBufferCallsForDataPage(xu(e)),this.bufferInitialized=!0),this}static clearContextedCache(e){delete Mu.searchResultsCache[e]}static initializeCache(e,t,n,r){e&&"form"===t.cacheLifeSpan?.toLowerCase()?(void 0===Mu.searchResultsCache[e]&&(Mu.searchResultsCache[e]={}),Mu.searchResultsCache[e][n]=r):(void 0===Mu.searchResultsCache.persisted&&(Mu.searchResultsCache.persisted={}),Mu.searchResultsCache.persisted[n]=r)}fetchMetaData(e){return gu.getDataViewMetadata(this.dataSource,e,this.associationFilter,this.propertyFilter)}initializeBufferCallsForDataPage(e){Mu.bufferedDataView.addBufferedDataQueueForDataPage(this.dataSource,(e=>Tu.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 Mu.bufferedDataView.getBufferedDataQueueForDataPage(this.dataSource).queueDataViewCall(t,e)}catch{const n=this.buildSchemaForQueryableDP(e,t);return Tu.getDataAsync(this.dataSource,this.context,n.dataViewParameters,n.paging,n.query)}const n=this.buildSchemaForQueryableDP(e,t);return Tu.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=Tu.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),...gu.isDistinctResultsOnly(n)&&{distinctResultsOnly:"true"}}:{select:n,...gu.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 Lu=Mu;const Uu=class{static cleanCaches(e){dh.purgeCascadeFields(e),pu.removeContext(e),Lu.clearContextedCache(e),fi.cleanContextSubscribers(e),il(e),Rn.removeContextTreeNode(e),Cu.clearContext(e),Cl.deRegisterForRefresh(e)}},Fu="GET_DESCENDANTS";const ju=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 Vu=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)}}mh(n)}}executeOrQueueDeferredAction(e){if(!e?.payload?.context)return Promise.reject(new Error("Action Context is Mandatory Field."));const t=yh(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}}}}),mh(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=yh(e);return t&&!0===t.context_data?.is_deferred_action_in_progress?(mh({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 yh(e)?(mh({type:ot,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={...yh(e)};return t.context_data={...t.context_data},t&&t.context_data?.blocking_action_counter>0?(mh({type:ot,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=yh(e);if(t){const n={...t};n.context_data={...n.context_data},n.context_data?.deferred_action_queue&&wh.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),mh({type:fe,payload:{context:e,data:{...n}}}),ln.disableLoadingIndicator({context:e})}}},ku=(e,t)=>{const n={},r=Hl.getLookUpDataPage(e),s=Hl.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}},$u=(e,t)=>{const n=Hl.getSavableDataPage(e),r=Hl.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}},Bu=e=>{fi.publish(F.PUB_SUB_EVENTS.EVENT_CANCEL,e)},Gu=(e,t,n)=>{const{callbacks:r}=n;return n.callbacks=null,e(t,n).then((e=>{"cancel"===e?r?.cancel?.():r?.submit?.()}))};const Wu=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:ml(this.c11nEnv.getContextName()),u=this.c11nEnv.getValue("isProcessAction","isProcessAction");return Vh.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||"":un.getNextActionMgrId();const o=new Promise(((e,t)=>{r=e,s=t}));if(!r||!s)throw new Error("resolveFn or rejectFn is not defined.");return un.register(a,o,r,s,e,t,n),{actionMgrID:a,promise:o}};showDataObjectCreateView(e,t=F.VIEW_NAMES.DATA_OBJECT_CREATE_VIEW){const n=Vh.buildActionObject({viewName:t,className:e},this.c11nEnv),r=ne,{promise:s}=this.actionsApiPromise(r,n);return mh({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(!Ml(t)){return new ql(this.c11nEnv).removeContainerItem({containerItemID:e,skipReleaseLockRequest:!0})}const n=He,r=Vh.buildActionObject({containerItemID:e,context:t},this.c11nEnv),s=t&&t.includes(j.MODAL);mh({type:n,payload:{...r,isModalAction:s,isDataObject:!0,skipReleaseLockRequest:!0}});const{promise:a}=this.actionsApiPromise(n,r);return a.then((()=>{Bu({})}))}createDataObject(e){if(!e)return Promise.reject(new Error("containerItemID is required parameter"));const{data:t}=fh()?.getState()||{},n=t[e]?.dataInfo?.content?.classID;if(!n)return Promise.reject(new Error(j.DATA_CLASS_NOT_FOUND));const r=Hl.getSavableDataPage(n),s=it,a=!!e&&e.includes(j.MODAL),o=Vh.buildActionObject({containerItemID:e,dataPageID:r},this.c11nEnv),{promise:i}=this.actionsApiPromise(s,o);return mh({type:"CREATE_DATA_OBJECT",payload:{...o,isModalAction:a,isFormValid:ml(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=ct,r=Hl.getSavableDataPage(e),s=Hl.getDataPageKeys(r),a={};if(s)for(const e of s)a[e.keyName]=e.isAlternateKeyStorage?t[e.linkedField]:t[e.keyName];const o=Vh.buildActionObject({dataViewName:r,dataViewParameters:a},this.c11nEnv),{promise:i}=this.actionsApiPromise(n,o);return mh({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=lt,{dataPageID:s,dataViewParameters:a}=ku(e,t),o=Vh.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 mh({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}=fh()?.getState()||{},r=n[e]?.dataInfo?.content?.classID;if(!r)return Promise.reject(new Error(j.DATA_CLASS_NOT_FOUND));const{dataPageID:s,keys:a}=$u(r,t),o=ut,i=e&&e.includes(j.MODAL),c=Vh.buildActionObject({containerItemID:e,dataPageID:s,key:a},this.c11nEnv),{promise:l}=this.actionsApiPromise(o,c);return mh({type:"UPDATE_DATA_OBJECT",payload:{...c,isModalAction:i,isFormValid:ml(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=dt,{dataViewParameters:a,dataPageID:o,dataPageKeys:i}=ku(e,t),c=Vh.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 mh({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}=fh()?.getState()||{},s=r[e]?.dataInfo?.content?.classID;if(!s)return Promise.reject(new Error(j.DATA_CLASS_NOT_FOUND));const a=lp(e),o=Bd(a),i=gd(o,a)||{},{resourceType:c="",key:l=""}=i,u=pt,{dataPageID:d,keys:p}=$u(s,t),h=Vh.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 mh({type:u,payload:{...h,isFormValid:ml(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",t);const{dockable:n=!1}=t?.modalOptions||{};let r=le;const s=Vh.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 Di.getPreviewMode()&&(s.debugInfo={debugId:wh.generateUniqueID()}),mh({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??vc.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=Vh.buildActionObject({dataViewID:e,dataViewParameters:t},this.c11nEnv),{promise:s}=this.actionsApiPromise(n,r);return mh({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=Vh.buildActionObject({caseID:e,currentContext:n},this.c11nEnv),{promise:s}=this.actionsApiPromise("GET_DESCENDANTS",r),a=(o={...r,context:n},{type:Fu,payload:o});var o;return mh(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=Vh.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),Di.getPreviewMode()&&![j.WORKAREA].includes(n.targetContainer)&&(a.debugInfo={debugId:wh.generateUniqueID()}),mh({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:mt,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=$l;const a=Vh.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"),Di.getPreviewMode()&&![j.WORKAREA].includes(n.containerName)&&(a.debugInfo={debugId:wh.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 mh({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=Rd(e);let r=n;if(n?.includes("/workarea")&&(r=n.substring(0,r?.lastIndexOf("/workarea"))),(e=>{const t=Rn.getContextReferences(e);if(t)for(const[,e]of t)if(Fh.resolveContextTreeNodeProps(e.props).hasSuggestions)return!0;return!1})(n)){const e=[{type:"error",message:Tp.getLocaleValue(this.MSG_ACTIVE_SUGGESTION_UNATTENDED,"Messages")}];return Kn({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}=cn(e,this.c11nEnv,{isTriggeredFromDifferentContext:a}),g=en(u);let f,m=!1;if(l){const e=l.find((e=>e.ID===c));m="Case"===e?.type}else f=yh(n);let{assignmentID:y}=cn(e,this.c11nEnv,{isTriggeredFromDifferentContext:a});f?.context_data?.actionType&&(m=f.context_data.actionType===j.CASE,y=y||f.context_data.assignmentID);const I=on(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=wc.FORM);const C=Vh.buildActionObject(_,this.c11nEnv),{promise:S}=this.actionsApiPromise(s,C);return C.isProcessAction=this.c11nEnv.getValue("isProcessAction","isProcessAction")||yh(n).context_data.isProcessAction,Vu.executeOrQueueDeferredAction({type:s,payload:{...C,context:n}}),S}getNextWork(){const e=$l,t=Vh.buildActionObject({containerName:j.PRIMARY,isGetNextWork:!0},this.c11nEnv),{promise:n}=this.actionsApiPromise(e,t);return mh({type:e,payload:{...t}}),n}openStage(e){if(!e)return Promise.reject(new Error("stageID is required parameter for openStage"));const t=$l,n=this.c11nEnv.getValue(F.CASE_INFO.CASE_INFO_ID),r=this.c11nEnv.getCaseSummary().headers,s=Vh.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 mh(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=Vh.buildActionObject(s,this.c11nEnv),{promise:o}=this.actionsApiPromise(t,a),i=Rd(e);return mh({type:t,payload:{...a,context:i,cases:n,actionID:r,isFormValid:ml(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=Vh.buildActionObject(s,this.c11nEnv),{promise:o}=this.actionsApiPromise(t,a),i=Rd(e);return mh({type:t,payload:{...a,context:i,cases:n,actionID:r,isFormValid:ml(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=Vh.buildActionObject(a,this.c11nEnv),{promise:c}=this.actionsApiPromise(o,i);return mh({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 ql(this.c11nEnv).removeContainerItem({containerItemID:e,skipReleaseLockRequest:!0})}approveCase(e){return e?"string"!=typeof e?Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING)):(mh({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)):(mh({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 mh([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 mh([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,Gu(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=Vh.buildActionObject(a,this.c11nEnv),c=this.c11nEnv.getContextName(),{promise:l}=this.actionsApiPromise(o,i),u=Od(c)[0];let d=!1;const p=$.getRemoteHeaderByContext(c);let h;if(p&&(i.headers={},i.headers.RemoteSystemID=p),!u)return h=c,mh({type:o,payload:{...i,contextName:c,continueExecution:d}}),l;h=Td(u);const g=hd(u);if(g?.accessedOrder.forEach((e=>{n===g.items[e].key&&(d=!0,h=g.items[e].context)})),!d||h&&"review"===fh()?.getState()?.data[h]?.context_data?.caseViewMode)return mh({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=yh(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=Vh.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=Rd(h),N=this.c11nEnv.getCaseSummary(),P=en(N),R=Vh.buildActionObject({caseID:n,containerItemID:h,cancelContext:T},this.c11nEnv);let D={};return m?(R.acTargetName=j.MODAL,R.isInCreateStage=P,R.isModalAction=m,D={...R}):D={...R,acName:yt(this.c11nEnv.getContainerName(),R.context)},mh({type:o,payload:{...i,contextName:c,saveActionPayload:S,cancelActionPayload:D,continueExecution:d}}),l}openProcessAction(e,t){if(!e)return Promise.reject(new Error(this.MSG_ACTION_ID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_ACTION_ID_STRING));const n=this.c11nEnv.getValue(F.CASE_INFO.CASE_INFO_ID)||t.caseID;if(window.pms?.plugins?.c11n?.openProcessAction)return t.caseID=n,Gu(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=kl,i=Vh.buildActionObject(a,this.c11nEnv),{promise:c}=this.actionsApiPromise(o,i);return mh({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=en(this.c11nEnv.getCaseSummary()),a=this.c11nEnv.getValue(F.CASE_INFO.CASE_INFO_ID),o={ID:r,stepID:e,acTargetName:this.c11nEnv.getContainerName(),targetContainerName:this.c11nEnv.getContainerName(),containerItemID:t,doDeleteCaseSummary:!0,isInCreateStage:s,caseID:a};t&&t.includes(j.MODAL)&&(o.acTargetName=j.MODAL);const i=Vh.buildActionObject(o,this.c11nEnv),{promise:c}=this.actionsApiPromise(n,i),l=Rd(t);return mh({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}=F,r=he,s=Rd(e),a=e&&e.includes(j.MODAL),o=this.c11nEnv.getCaseSummary(),i=en(o),c=this.c11nEnv.getValue(n.CASE_INFO_ID),l=this.c11nEnv.getValue(n.ASSIGNMENT_ID),u=Vh.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:yt(this.c11nEnv.getContainerName(),u.context)};const{promise:p}=this.actionsApiPromise(r,u);return mh({type:r,payload:d}),p.then((()=>{t||Bu({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=Vh.buildActionObject({caseID:a,containerItemID:e,context:n},this.c11nEnv);if(!Ml(n)){return new ql(this.c11nEnv).removeContainerItem({containerItemID:e}).then((()=>{Bu({caseID:a,context:this.c11nEnv.getContextName()})}))}mh({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=en(a),i=this.c11nEnv.getValue(t.CASE_INFO_ID),c=Vh.buildActionObject({caseID:i,containerItemID:e,context:r},this.c11nEnv),l=this.c11nEnv.getValue("isProcessAction","isProcessAction"),u=_p.isCoexistenceAppOfType(j.APP_TYPE.UIKIT);if(c.isProcessAction=l,o&&(s||u)&&!nn(a)){const t=this.c11nEnv.getValue(j.CASE_INFO.IS_FIRST_ASSIGNMENT),i=Ml(r);if(this.shouldDeleteCaseInCreateStage(i,t,u))return this.deleteCaseInCreateStage(e);mh({type:n,payload:{...c,isModalAction:s,isChildCase:an(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=Gl,n=this.getSaveActionPayload(e,!0),{promise:r}=this.actionsApiPromise(t,n);return mh(Wl(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=Gl,n=this.getSaveActionPayload(e),{promise:r}=this.actionsApiPromise(t,n);return mh(Wl(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=Bl,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=Vh.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}/${dd.PRIMARY}`,d=Wc(u,dd.PRIMARY);i.parentContext=d,s&&(i.targetName=j.MODAL,i.containerName=dd.MODAL,i.isModalAction=s),mh((e=>({type:Bl,payload:e}))(i));const{promise:p}=this.actionsApiPromise(n,i);return p.then((()=>{Bu({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}=Ap.getRestEndPoint("getRecents")||{};t=`${t}?maxResultsToFetch=${e}`;const n=E()+t;return ki(n,{method:"GET",headers:{}})}updateRecents(e,t,n,r){const{restApi:s}=Ap.getRestEndPoint("updateRecents")||{},a=`${E()}${s}`;return ki(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:{pyLabel:n,pyID:t,classID:e,ID:r}})}logout(){const{restApi:e}=Ap.getRestEndPoint("Logout")||{},t=`${E()}${e}`;return ki(t,{method:"GET",headers:{}}).then((e=>(Object.keys(Rn.rootNodes).forEach((e=>{Uu.cleanCaches(e)})),Rn.rootNodes={},sessionStorage.clear(),Oh(),Promise.resolve(e))))}invoke(e,t={}){const n={method:t.method||"GET",body:t.body};return ki(e,n,this.c11nEnv.getContextName())}showCasePreview(e,t={}){this.loadView(e,"pyCasePreview",{container:dd.PREVIEW,containerName:dd.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:dd.PREVIEW,containerName:dd.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=Vh.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 mh({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=Vh.buildActionObject({viewName:e,className:t},this.c11nEnv),s=ne,{promise:a}=this.actionsApiPromise(s,r);return Di.getPreviewMode()&&(r.debugInfo={debugId:wh.generateUniqueID()}),mh({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=Vh.buildActionObject({},this.c11nEnv),r=se,{promise:s}=this.actionsApiPromise(r,n);return mh({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=Vh.buildActionObject({},this.c11nEnv),r=ae,{promise:s}=this.actionsApiPromise(r,n);return mh({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=Vh.buildActionObject({pageName:e,dataContext:t,dataContextParameters:n,RemoteSystemID:$.getRemoteHeaderByContext(this.c11nEnv.getContextName())},this.c11nEnv),a=re;r?.containerName||(r.containerName="HYBRID"===_p.getRenderingMode()?ju.getRuntimeParam(j.HYBRID_ROOT_CONTAINERNAME):ic.getTargetViewContainerName(a));const{promise:o}=this.actionsApiPromise(a,s);return mh({type:a,payload:{...s,...r,skipSemanticUrl:Boolean(r.skipSemanticUrl)}}),o}changeHandler(e,t){Vh.changeHandler(e,t)}eventHandler(e,t){Vh.eventHandler(e,t)}triggerFieldChange(e,t,n=!1){const r=this.c11nEnv.getContextName(),s=this.c11nEnv.getPageReference(),a=Fh.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=Ah(`.${i.join(".")}.classID`,s,r)),e=wh.trimDotForProperty(e),mh({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=Fh.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}),mh({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=Vh.buildActionObject({...e,containerName:this.c11nEnv.getContainerName(),containerItemID:n},this.c11nEnv);r&&(s.containerName=j.MODAL,s.isModalAction=r),mh({type:t,payload:s});const{promise:a}=this.actionsApiPromise(t,s);return a}refreshCaseView(e,t,n,r={}){const{promise:s,actionMgrID:a}=this.actionsApiPromise("REFRESH_DATA"),{autoDetectRefresh:o,propertyName:i,preserveClientChanges:c,classID:l,context:u,optionalPayload:d}=r,p={actionMgrID:a,caseViewAction:!0,preserveClientChanges:c,propertyName:i,classID:l,optionalPayload:d};r.refreshFor&&(p.refreshFor=r?.refreshFor),r.skipDataMerge&&(p.skipDataMerge=r?.skipDataMerge);const h=u||this.c11nEnv.getContextName(),g=this.c11nEnv.getPageReference();return!this.c11nEnv.getValue(j.CONTEXT_DATA_MODAL_VIEW.IS_MULTI_RECORD_DATA)&&o&&(((e,t)=>sn(e)&&!rn(e,t))(h,g)||rn(h,g))?Un(h,n,p):xn(e,t,h,n,p),s}openEmbeddedDataModal(e,t,n,r,s,a){const o=ht,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:wh.convertPageRefToClipboardPageNotation(c),heading:a},u=Vh.buildActionObject(l,this.c11nEnv),{promise:d}=this.actionsApiPromise(o,u);if(_p.getFeatureMap().granularUIRefresh){(t.getMetadata().config.children[0].children||[]).forEach((e=>{const n=Zt.trimAnnotation(e.config.value),r=Gp(n.startsWith(".")?n.replace(".",""):n,e.config.classID);if(r?.isDeclarativeTarget){const e=t.getPageReference();Rn.addFieldNode(t.getContextName(),e+c,t.viewName,n,"",{isDeclarativeTarget:!0,propertyName:n,pageReference:e+c})}}))}return mh({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=gt,n=this.c11nEnv.getPageReference().replace(F.CASE_INFO.CASE_INFO_CONTENT,""),r=Rd(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:ml(r),interestPage:wh.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=Vh.buildActionObject(s,this.c11nEnv),{promise:o}=this.actionsApiPromise(t,a);if(Ml(r)){const[e,t,n]=fn(this.c11nEnv.getPageReference());Rn.mutatePageList(this.c11nEnv.getValue(j.CONTEXT_DATA_MODAL_VIEW.PARENT_CONTEXT),e,t,{type:Ze,rowIndex:n}),mh({type:Ze,payload:{pageReference:this.c11nEnv.getPageReference(),context:this.c11nEnv.getValue(j.CONTEXT_DATA_MODAL_VIEW.PARENT_CONTEXT),isListEntry:!0}})}return Vu.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=Rd(e),n=this.c11nEnv.getPageReference(),{promise:r,actionMgrID:s}=this.actionsApiPromise(ft);return Un(t,n,{actionMgrID:s,isFillFormWithAI:!0,preserveClientChanges:!1}),r}};const Hu=class{constructor(e){this.c11nEnv=e}async getCaseStages(e,t){const n={caseID:e},{restApi:r,reqType:s}=Fg("getCaseStages",n);return(await ki(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 en(e)}isLocalAction(){const e=this.c11nEnv.getValue(j.CASE_INFO.CASE_INFO);return nn(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=gd(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=yh(t));const r=n?.caseInfo?.availableActions,s=yh(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:qu}=F;const Yu=class{static openCase(e,t,n,r={}){const s={insKey:e,acTargetName:n,actionMgrID:un.getNextActionMgrId(),context:t,...r},a=ue;r&&r.channelName&&(s.headers={},s.headers[j.X_ORIGIN_CHANNEL]=r.channelName);const{promise:o}=un.actionManagerPromise(a,s.actionMgrID);return mh({type:a,payload:s}),o}static openAssignment(e,t,n,r={}){const s={assignmentID:e,vcName:n,doDeleteCaseSummary:!0,actionMgrID:un.getNextActionMgrId(),context:t,...r},a=ge;r&&r.channelName&&(s.headers={},s.headers[j.X_ORIGIN_CHANNEL]=r.channelName);const{promise:o}=un.actionManagerPromise(a,s.actionMgrID);return mh({type:a,payload:{...s}}),o}static createCase(e,t,n,r={}){const s=le,a={class:e,acTargetName:n,actionMgrID:un.getNextActionMgrId(),context:t,...r};r&&r.channelName&&(a.headers={},a.headers[j.X_ORIGIN_CHANNEL]=r.channelName);const{promise:o}=un.actionManagerPromise(s,a.actionMgrID);return mh({type:s,payload:{...a}}),o}static getNextWork(e,t,n={}){const r=ge,s={isGetNextWork:!0,vcName:t,doDeleteCaseSummary:!0,actionMgrID:un.getNextActionMgrId(),context:e,...n},{promise:a}=un.actionManagerPromise(r,s.actionMgrID);return mh({type:r,payload:{...s}}),a}static getOpenedCaseItems(e){const t=[],n=hd(e);if(n){const{items:r={}}=n,s=Object.keys(r),a=Td(e);s.forEach((n=>{if(r[n]&&(r[n].resourceType===qu.CASE||r[n].resourceType===qu.ASSIGNMENT)){const{key:s="",context:o}=r[n],i=r[n],c=s.substring(s.indexOf(" ")+1),l=Ah(".caseTypeID",j.CASE_INFO.CASE_INFO,o),u=a===n;t.push({...i,key:s,workID:s,caseID:c,className:l,context:o,containerItemID:n,target:e,active:u})}}))}return t}static getCaseDetails=(e,t)=>{if(!e)return Promise.reject(new Error("Case ID is required"));const n={caseID:e},{restApi:r,reqType:s}=Fg(Be,n),a={},o=$.getRemoteHeaderFromSourceClass(t??"");return o&&(a.RemoteSystemID=o),ki(r,{method:s,headers:a})};static getCaseBulkActions=async e=>{const{restApi:t,reqType:n}=Fg("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(ki(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}=Fg("getCaseBulkActions",t),s=await ki(n,{method:r});let a=[];return s.data?.availableActions?.length&&(a=s.data.availableActions),a}};class zu{constructor(e){zu._instance=this,this.context=`${e}/${j.SUGGESTION}`,fh()?.getState().data?.[this.context]||mh({type:Fe,payload:{context:this.context,data:{}}})}getField(e){return Ah(e,"",this.context)}setField(e,t){mh({type:Q,payload:{reference:e,value:t,context:this.context}})}removeField(e){mh({type:me,payload:{reference:e,context:this.context}})}setState(e){mh(Gh({context:this.context,data:e,isArrayDeepMerge:!0}))}}const Ku=zu;const Xu=class{static getSharedState(e){const t=e.startsWith(".")?e.substring(1):e,n=Ih();return n?wh.getIn(n,t):null}static setSharedState(e,t){e&&mh(Cg({key:e,value:t}))}static updateState(e,t,n,r={}){const{isArrayDeepMerge:s=!0,pageReference:a}=r;if(!e||!t)return;mh(Sg({context:e,reference:a?`${a}.${t}`:t,value:n,isArrayDeepMerge:s}))}static getSuggestionsContext(e){return new Ku(e)}};const Ju=class{constructor(e,t,n){this.meta=e,this.datasource=t,this.index=0,this.options=n,this.datasourceObj=Fh.getPropertyValue(t,n.pageReference,n.context)}hasNext(){return this.index<this.datasourceObj.length}next(){if(!this.hasNext())throw new Error("No Children");const e=Fh.getContextPath(this.datasource,this.index);return this.index+=1,od({meta:this.meta,options:{...this.options,pageReference:e}})}resetIndex(){this.index=0}};class Qu{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,od({meta:e,index:this.index,options:this.options})}resetIndex(){this.index=0}}const Zu=(e,t)=>{const n=!!e?.repeat;if(!!e?.["repeat-self"])return new Ju(e,e.context||"",t);if(n){const n=Ch(`${t.context}.${j.SUMMARY_OF_LISTS}`,e.pageReference,t.context);return new Ju(e.children[0],n||e.context,t)}return e?.children?new Qu(e.children,t):void 0};class ed{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=>El.isProperty(e))).map((e=>El.getPropertyName(e)))}}const td=new ed;let nd;Object.freeze(td);const rd=(e,t,n)=>{e&&(Object.keys(e).forEach((r=>{if("children"!==r){const s=e[r],a=Zt.trimAnnotation(s);if("string"!=typeof a&&"string"!=typeof s||!(wh.isValidAnnotation(s)&&wh.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({}),rd(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]||{},rd(a,t[r],e)}}else n&&n.parentKey&&(n.isObjHasValue=!0),t[r]=a}})),n&&!n.isObjHasValue&&delete n.parentStateObj[n.parentKey])},sd=(e,t)=>{e._inheritedProps=e._inheritedProps||[],e.inheritedProps=[...e._inheritedProps,...wh.deepClone(t.inheritedProps)]};class ad{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=wh.deepClone(r.inheritedConfig)),t?.config?.inheritedProps&&sd(this._inheritedConfig,t?.config),rd(this._rawConfig,this._stateProps),this._isState=!wh.isObjectEmpty(this._stateProps),this._rawConfig&&this._rawConfig.config&&(this._isExpressionExist=wh.isExpressionExist(this._rawConfig.config),this._isWhenExist=wh.isWhenExist(this._rawConfig.config),this._isValidatorExist=xr.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=Zt.handleAnnotation(this.options.pageReference,this)),this._pageReference=Fh.getContextPath(a||this.options.parentPageReference,this._pageReference),this._pageReference||(this._pageReference=""),"reference"===this._type&&(this._rawConfig=t),"reference"===this._type&&wh.isWhenExist({visibility:this.meta?.config?.visibility})&&wn(this.viewName,this._contextName,this._pageReference),"reference"!==this._type&&t&&(this._rawConfig=Fh.resolveReference(t,this)),this._rawConfig){const e=this.getRawConfigProps();e&&(this._localeRuleName=Zt.trimAnnotation(e.localeReference)||r.localeReference,this._isExpressionExist=wh.isExpressionExist(e),this._isWhenExist=wh.isWhenExist(e),this._isValidatorExist=xr.isValidatorExist(e)),this._children=this._rawConfig.children,this._rawConfig?.type?.toLowerCase()===j.VIEW&&this._rawConfig.name&&(this.viewName=Zt.handleAnnotation(this._rawConfig.name,this)),this.options.hasForm&&Ln(this)}}isDeclarativeTarget(){let e=!1;if(this.getValue(this._pageReference)||""===this._pageReference){const t=Zt.trimAnnotation(this.getPropertyName()),n=this.getFieldMetadata(t);e=n?.isDeclarativeTarget||!1}return e}_getPropertyName(){const e=Zt.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?Zt.trimAnnotation(this._rawConfig.config.associatedView):"",d=n||c,p={target:this._containerTarget,context:this._contextName,pageReference:this._pageReference,propertyName:Zt.trimAnnotation(t),label:d?.startsWith("@")?Zt.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()};Rn.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"))Rn.removeFieldNode(this._contextName,this._pageReference,this.viewName||"",Zt.trimAnnotation(this.getPropertyName()),this.index);else{const e=this._rawConfig?.config?.context?`${this._pageReference}${this._rawConfig?.config.context}`:this._pageReference;Rn.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&&Rn.addViewNode(this._contextName,this._pageReference,this.viewName,this.parentViewName),"Group"===this._rawConfig?.type&&this._rawConfig?.config?.id&&Rn.addViewNode(this._contextName,this._pageReference,this._rawConfig.config.id,this.parentViewName),"Address"===this._rawConfig?.type&&this._rawConfig?.config?.associatedView&&Rn.addViewNode(this._contextName,this._pageReference,Zt.trimAnnotation(this._rawConfig.config.associatedView),this.parentViewName),"deferload"===this._rawConfig?.type?.toLowerCase()&&this._rawConfig.config?.name&&Rn.addViewNode(this._contextName,this._pageReference,this._rawConfig.config.name,this.parentViewName)}addWhenNode(){let e="",t="";const n=wh.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=Zt.isProperty(n)?Zt.trimAnnotation(n):""}e&&n.forEach((n=>{Rn.addWhenNode(this.getContextName(),this.getPageReference(),t,e,n,{pageReference:this.getPageReference(),context:this.getContextName()})}))}updateContextTree(){if(this.isVisible()&&(this.addViewNode(),this._rawConfig?.config&&Object.hasOwn(this._rawConfig.config,"value")&&"DISPLAY_ONLY"!==this._inheritedConfig.displayMode&&"DISPLAY_ONLY"!==this._rawConfig.config?.displayMode&&this.addFieldNode(),(this._rawConfig?.type?.toLowerCase()!==j.VIEW||"Editable"===this._rawConfig.config?.renderMode)&&this._rawConfig?.config?.referenceList&&"DISPLAY_ONLY"!==this._rawConfig.config?.displayMode)){const{value:e,label:t,required:n,readOnly:r,disabled:s,visibility:a,validationType:o,selectionMode:i,selectionList:c,selectionKey:l,referenceList:u,renderMode:d,caption:p}=this.getRawConfigProps(),h=t||p;let g=[];["Multiselect","Checkbox"].includes(this._rawConfig.type)&&(g=this.getSelfReferencingDatapageKeys()),Rn.addPageListNode(this._contextName,this._pageReference,this.viewName??"",Zt.trimAnnotation(this.getPropertyName()),{target:this._containerTarget,context:this._contextName,pageReference:this._pageReference,propertyName:Zt.trimAnnotation(this.getPropertyName()),label:h?.startsWith("@")?Zt.handleAnnotation(h,this,void 0):h,required:n,readOnly:r,disabled:s,visibility:a||this.options.visibility,skipRequiredValidation:this.options.isBulkAction,inheritedProps:this.getInheritedProps(),useCustomContext:this.useCustomContext,value:e,validationType:o,componentName:this._rawConfig.type,type:this._rawConfig.config?.type,hasSuggestions:this._hasSuggestions,isInsideList:this.isInsideList(),selectionMode:i,selectionList:c,renderMode:d,referenceList:u,selectionKey:l,index:this.index,selfReferencingDatapageKeys:["Multiselect","Checkbox"].includes(this._rawConfig.type)?g:void 0});const f=this.getValue(Zt.trimAnnotation(this.getPropertyName()),this._pageReference)||[];Rn.updatePageListNode(this._contextName,this._pageReference,Zt.trimAnnotation(this.getPropertyName()),f.length)}this.isWhenExist()&&this.addWhenNode(),this.removeNode()}setXRayInfo(e){wh.mergeDeep(e,this.xrayInfo)}getXRayInfo(){return this.xrayInfo}getStateProps(){return this._stateProps}setStateProps(e){wh.mergeDeep(e,this._stateProps)}getMetadata(){return this._rawConfig}getCaseInfo(){return this._caseInfo||(this._caseInfo=new Hu(this)),this._caseInfo}getCaseLocaleReference(){const e=this.getCaseInfo().getClassName();return e?`CASE!${e}`.toUpperCase():null}getListActions(){return br(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 Fh.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=dd.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=l?.getStore()?.getState()?.data[`${this.getContextName()}/${j.SUGGESTION}`],n=this.getStateProps()?.value,r=Fh.getContextPath(this.getPageReference(),n),s=t?Xu.getSuggestionsContext(this.getContextName()).getField(r):void 0;this._hasSuggestions=!!s,e.hasSuggestions=this._hasSuggestions,this._stateProps.hasSuggestions=this._hasSuggestions}}getConfigProps(e={}){const t={...Or.getDefaultsforType(this._type),readOnly:this._readOnly,...this._rawConfig&&this._rawConfig.config,...this._additionalRegisteredProps,...this._inheritedConfig};return this.populateSuggestionProps(t),this.resolveConfigProps(t,e),wh.resolveStringBooleans(e)}getRawConfigProps(){const e={...Or.getDefaultsforType(this._type),...this._rawConfig?.config,...this._additionalRegisteredProps,...this._inheritedConfig};return this.populateSuggestionProps(e),e}resolveConfigProps(e,t={}){return e&&(Fh.resolveProps(e,t,this),Zt.handleComponentMapping(t,{type:this.getComponentName(),config:e},this)),t}registerAdditionalProps(e={}){return Object.assign(this._additionalRegisteredProps,e),rd(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=Td(`${j.APP.APP}/${this.getContainerName()}`),n=Yn({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||Zt.trimAnnotation(this.getRawConfigProps().selectionList):!t&&"Editable"===this.getComponentConfig()?.renderMode&&this.getStateProps().referenceList&&(t=this.getStateProps().referenceList);const n=Yn({property:t,pageReference:this.getPageReference(),context:this.getContextName(),type:F.MESSAGES.MESSAGES_TYPE_ERROR}),r=Yn({property:t,pageReference:this.getPageReference(),context:this.getContextName(),type:F.MESSAGES.MESSAGES_TYPE_INFO});n&&n[0]&&(e.validatemessage=n.map((e=>Tp.getLocaleValue(e.message.replace(/\.$/,""),"Messages"))).join(". ")+(n[n.length-1].message.endsWith(".")?".":""),e.status=j.FIELD_LEVEL_ERROR,this._stateProps.validatemessage=e.validatemessage,this._stateProps.status=e.status),r&&r[0]&&(e.infoMessage=r[0].message,e.status=j.FIELD_LEVEL_WARNING,this._stateProps.infoMessage=e.infoMessage,this._stateProps.status=e.status)}if(t===j.ROOT_CONTAINER){const t=Jn(r,Td(`${j.APP.APP}/${this.getContainerName()}`));e.httpMessages=t,this._stateProps.httpMessages=e.httpMessages;const n=Xu.getSharedState("isLoggedOut");e.isLoggedOut=n,this._stateProps.isLoggedOut=n;const s=Yn({context:j.APP.ROOT,category:"PAGE"});e.pageMessages=s,this._stateProps.pageMessages=e.pageMessages}if(t===j.HYBRID_VIEW_CONTAINER){const t=Yn({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=Yu.getOpenedCaseItems(`${F.APP.APP}/${j.PRIMARY}`),this._stateProps.activeCases=e.activeCases),t===j.APP_SHELL){const t=j.APP.APP,n=Td(`${t}/${this.getContainerName()}`),r=[...Yn({context:t,category:"PAGE"})||[],...Yn({context:n,category:"PAGE"})||[]],s=r.length>0?r:void 0;e.pageMessages=s,this._stateProps.pageMessages=e.pageMessages}if(e.value&&t===j.SCALARLIST&&(this._stateProps.value=e.value),t===j.APP_SHELL||t===j.MODAL_VIEW_CONTAINER||t===j.CASE_CREATE_STAGE||n.template===j.CASE_PREVIEW){let t=Yn({context:j.APP.APP,category:"HTTP"});const n="HYBRID"===_p.getRenderingMode()?`${this.getContextName()}/${this.getContainerName()}`:`${j.APP.APP}/${this.getContainerName()}`,r=Yn({context:Td(n),category:"HTTP"});t?r&&(t=t.concat(Yn({context:Td(n),category:"HTTP"}))):t=Yn({context:Td(n),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=It(this.getContainerName(),this._contextName),t===j.ROOT_CONTAINER&&(e.rootConfig=ed.getItemView(e.routingInfo,e.renderingMode),this._stateProps.rootConfig=e.rootConfig),this._stateProps.routingInfo=e.routingInfo,t===j.FLOW_CONTAINER){const t=Yn({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=Od(n)[0];if(r){const t=Td(r),n=l?.getStore()?.getState()?.data;n&&t&&(e.lastUpdateTime=n[t]?.caseInfo?.lastUpdateTime,this._stateProps.lastUpdateTime=n[t]?.caseInfo?.lastUpdateTime);const s=Yn({context:t,category:F.PAGE}),a=Yn({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=El.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=Zt.getPropertyName(s),n=this.getFieldMetadata(t);n&&this.updateConfigData(e,n,t)}}resolvePropertyMetadata(e,t){if(!e)return e;const n=ch(`${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(Gp(e,t),e)}return this.resolvePropertyMetadata(Gp(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(Gp(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:()=>rn(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 Vl(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?Zt.handleAnnotation(this._rawConfig?.config?.visibility,this):"string"!=typeof this.options?.visibility||Zt.handleAnnotation(this.options?.visibility,this)}isReadOnly(){return void 0!==this._readOnly&&("true"===this._readOnly||!0===this._readOnly||"string"==typeof this._readOnly&&Zt.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 yh(e||this.getContextName())}getImagePath(e){return`${Ur.getConstellationServiceUrl()}/v860/${Ur.getAppAlias()}/image/${e}?org=${Ap.getOrganizationName()}`}skipRequiredValidation(){return this.options.isBulkAction}isBulkAction(){return this.options.isBulkAction}getChildren(){if(this._children&&this._children.length){const e=Zu(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!==ed.allowedComponetsForBulkProcessing[e]&&!0!==ed.allowedComponetsForBulkProcessing[e]?.[t])continue}t.push(n)}return e?.resetIndex(),t}return[]}setInheritedProp(e,t){this._inheritedConfig[e]=t}getLocaleRuleName(){return this._localeRuleName}getLocalizedValue(e,t,n){const r=n||this.getLocaleRuleName(),s=this?.getMetadata();let a=null;if(s){const e=s?.type;e&&!["View","Region"].includes(e)&&(a=e)}return Tp.getLocaleValue(e,t,r,a)}isNonEnglishAndAnnotated=(e,t)=>!(!e||!t)&&("en-US"!==e&&t?.startsWith(j.FIELD_LABEL_ANNOTATION));isNonExcludedComponent=e=>!!e&&!["View","Region"].includes(e);getLocalizedValueForFieldLabel(e,t,n){e?.startsWith(".")&&(e=e.substring(1));const r=n||this.getLocaleRuleName(),s=this?.getMetadata();let a=null;const o=_p.getLocale();if(s){const t=s?.type,n=s?.config?.label??s?.config?.caption;if(this.isNonEnglishAndAnnotated(o,n)){const t=n?.split(`${j.FIELD_LABEL_ANNOTATION} `).pop(),r=t?.split("."),s=r?.[r.length-1];let o=`${s}`;const i=this.getFieldMetadata(r?.slice(1).join(".")||""),c=i?.classID||this.getValue(`.${r?.join(".")}${j.CLASS_ID}`),l=i?.definedOnClassID;return o=`${l||c}.${o}`,Tp.getLocaleValue(e,o,Tp.FIELD_LABELS_BUNDLE_KEY,a)}this.isNonExcludedComponent(t)&&(a=t)}return Tp.getLocaleValue(e,t,r,a)}getLocalizedParagraphValue(e){const t=nh(e,this.getCurrentClassID()),n=t?.definedOnClassID;return Tp.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?Fh.getPropertyValue(e,this.getPageReference(),`${this._contextName}/${j.SUGGESTION}`):Fh.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)})),sd(this._inheritedConfig,e))}getInheritedProps(){const e={},t={};return this._inheritedConfig.inheritedProps?.forEach((e=>{t[e.prop]=e.value})),Fh.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)),mh({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(Al.isPageInstruction(n))return;const r=n?.startsWith(".")?n?.substr(1):n;Tl[t]=Tl[t]||{},Tl[t][r]||(Tl[t][r]={initialValue:Ah(r,null,t)}),Tl[t][r].value=e})({reference:`${this.getPageReference()}${e}`,value:t,context:this.getContextName()})}getContextDataValue(e,t){return _h(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),mh(Gh({context:this._contextName,data:e,rootPageReference:r}))}replaceState(e,t,n={}){const{skipDirtyValidation:r=!1}=n;mh({type:"REPLACE_PROPERTY",payload:{reference:`${this.getPageReference()}${e}`,value:t,context:this.getContextName(),skipDirtyValidation:r}})}reportError(e,t,n){mh(yg(e,t||{},n))}getComponent(){return nd({getPConnect:()=>this})}createComponent(e,t,n,r){let s=this._pageReference;if(t){const e=Ch(`${this.getPageReference()}.${j.SUMMARY_OF_LISTS}`,t,this._contextName);s=Fh.getContextPath(e||t,n)||t}else if(r&&r.pageReference){let e=r.pageReference;e=Zt.handleAnnotation(e,this),s=Fh.getContextPath(this._pageReference,e)||""}return nd(od({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 Fh.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,od({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 ql(this)}getActionsApi(){return this._actionsApi||(this._actionsApi=new Wu(this)),this._actionsApi}getActionManager(){return un}doesContextExist(e){return vh(e??this.getContextName())}getGoogleMapsAPIKey(){return C()}getServerURL(){return E()}getLoadingStatus(e){let t=null;return e?(t=yh(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:Td(`${j.APP.APP}/${this.getContainerName()}`)}))}resolveDatasourceReference(e){return Ch(`${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=ol(t);al[e]?al[e].fieldOrder[r]=n:al[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)_r(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=Xu.getSuggestionsContext(this.getContextName()),n=this.getStateProps()?.value||e,r=Fh.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=Fh.getContextPath(this.getPageReference(),t);this._hasSuggestions=!1,Xu.getSuggestionsContext(this.getContextName()).removeField(n)}}getSelfReferencingDatapageKeys(){const e=[],t=this.getPropertyName(),n=this.getFieldMetadata(t),{datasource:{parameters:r={}}={}}=n||{};return Object.values(r).forEach((n=>{const[,r]=n.split("."),s=t?.split(".").pop();r===s&&e.push(n.substring(n.lastIndexOf(".")+1))})),e}}function od(e){const t=new ad(e);return{getPConnect:()=>t}}function id(e){nd=e}const cd=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 od({meta:i,options:{context:c,pageReference:u||t,containerName:n,containerItemID:e,parentPageReference:t,hasForm:r||n===dd.WORKAREA||n===dd.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=El.isProperty(s),l=El.isProperty(r);if(l){const e=El.getPropertyName(r);i=Ah(`.${e}`,e.startsWith(".")?n:"",a)}if(i||(i=n),c){const e=El.getPropertyName(s);o=Ah(`.${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=Td(e),a=gd(e,t);a&&({key:r,flowName:s}=a)}t.addContainerItem({semanticURL:"",key:r,flowName:s,caseViewMode:"perform",resourceType:"ASSIGNMENT",data:e.getDataObject(n)})}},ld={defaultLimit:16},ud={SINGLE:"single",MULTIPLE:"multiple"},dd={PRIMARY:"primary",WORKAREA:"workarea",MODAL:"modal",PREVIEW:"preview"},pd=()=>fh()?.getState()?.containers,hd=e=>e?fh()?.getState().containers[e]:(At.error("getContainerData: target is the required parameter"),null),gd=(e,t)=>{if(!e||!t)return null;const n=pd(),r=n?.[e];return r&&r.items&&r.items[t]||null},fd=e=>e?fh()?.getState().containers[e]?.items:(At.error("getContainerItems: target is the required parameter"),null),md=e=>e?fh()?.getState().containers[e]?.accessedOrder||[]:(At.error("getContainerAccessOrder: target is the required parameter"),[]),yd=e=>e?md(e)?.length>0||!1:(At.error("areContainerItemsPresent: target is the required parameter"),!1),Id=(e,t,n)=>{if(!e||!t)return At.error("isContainerItemExists: target and key are required parameters"),!1;const r=pd(),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},Ed=(e,t,n)=>{if(!e||!t)return At.error("getContainerItemName: target and key are required parameters"),null;const r=pd(),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},Ad=(e,t)=>{if(e&&t)for(const s of Object.keys(t))if(n=e,r=t[s].key,n?.toLowerCase()===r?.toLowerCase())return t[s];var n,r;return null},_d=e=>{if(!e)return At.error("getContainerItemByKey: key is required parameter"),null;const t=pd()??{};for(const n of Object.keys(t))if(t[n]){const r=t[n].items??null,s=Ad(e,r);if(s)return s}return null},Cd=(e,t)=>{if(!e||!t)return At.error("isContainerInitialized: context and name are required parameters"),!1;const n=pd();return n&&Object.prototype.hasOwnProperty.call(n,`${e}/${t}`)},Sd=(e,t)=>{if(!e||!t)return At.error("getContainerType: context and name are required parameters"),null;const n=pd(),r=n?.[`${e}/${t}`];return r&&r.type},Td=e=>{if(!e)return At.error("getActiveContainerItemName: target is the required parameter"),null;let t=null;const n=pd();if(n&&n[e]){const r=n[e],{accessedOrder:s}=r;t=s&&s.length>0?s[s.length-1]:null}return t},Nd=(e,t,n)=>{if(!e||!t)return At.error("isContainerItemActive: target and key are required parameters"),!1;const r=Ed(e,t,n);return!!r&&r===Td(e)},Pd=(e,t)=>{let n=null;const r=pd();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},Rd=e=>e?Pd(e,"context"):(At.error("getDataContextName: containerItemName is required parameters"),null),Dd=e=>{if(!e)return At.error("getActiveContainerItemContext: target is required parameters"),null;let t=null;const n=pd();if(n&&n[e]){const r=n[e],{accessedOrder:s}=r,a=s&&s.length>0?s[s.length-1]:null;t=Rd(a)}return t},bd=e=>{if(!e)return At.error("getChildContainerItems: containerItemName is required parameters"),[];const t=e.endsWith("/")?e:`${e}/`;let n=[],r=!1;const s=pd(),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:[]},Od=e=>{if(!e)return At.error("getChildContainers: containerItemName is required parameters"),[];const t=[],n=pd();for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&r.startsWith(e)&&r!==e&&t.push(r);return t},vd=e=>{if(!e)return At.error("getChildContainersContexts: parentContainerItemID is required parameters"),[];const t=[],n=pd();for(const r in n)if(Object.prototype.hasOwnProperty.call(n,r)&&r.startsWith(e)&&r!==e){(md(r)||[]).forEach((n=>{Rd(n)!==e&&t.push(Rd(n))}))}return t},xd=e=>{const t=[...vd(e),e],n=[],r=fh()?.getState().data||{};return t.forEach((e=>{Object.prototype.hasOwnProperty.call(r,`${e}/${j.SUGGESTION}`)&&n.push(`${e}/${j.SUGGESTION}`)})),n},wd=e=>e?e&&hd(e)&&hd(e).type===ud.SINGLE:(At.error("isContainerSingleMode: target is required parameters"),null),Md=e=>e?e&&hd(e)&&hd(e).type===ud.MULTIPLE:(At.error("isContainerMultipleMode: target is required parameters"),null),Ld=e=>e?hd(e)&&hd(e).items&&Object.keys(hd(e)?.items).length>0||!1:(At.error("hasContainerItems: target is required parameters"),!1),Ud=e=>e&&ld[e]?ld[e]:ld.defaultLimit,Fd=(e,t=ld.defaultLimit)=>{e?ld[e]=t:At.error("setContainerLimit: target is required parameter")},jd=e=>{if(!e)return At.error("isContainerLimitReached: target is required parameter"),!1;let t=!1;const n=hd(e),{items:r={}}=n,s=Object.keys(r),a=Ud(e);return s&&s.length>0&&s.length>=a&&(t=!0),t},Vd=e=>{if(!e||!e.name||!e.context)return At.error("resetContainersPayload: containerInfo object should contain name and context"),null;const t=e?.name,n=hd(`${e?.context}/${t}`),r=Array.isArray(n?.accessedOrder)&&n?.accessedOrder.map((e=>n?.items[`${e}`]?.context))||[],s=Od(`${j.APP.APP}/${j.PREVIEW}`),a=vd(`${j.APP.APP}/${j.PREVIEW}`);return{context:e?.context,name:t,containerItems:[...r,...a],childContainers:s}},kd=e=>{if(!e)return At.error("isContainerDirty: containerItemID is the required parameter"),!1;const t=Rd(e);return Ml(t)||qc(e)},$d=e=>{if(!e)return At.error("getLeastRecentlyUsedNonDirtyContainerItemID: target is required parameter"),null;let t;const n=hd(e),{accessedOrder:r=[]}=n;for(let e=0;e<r.length;e+=1){const n=r[e];if(!kd(n)){t=n;break}}return t},Bd=e=>{if(!e)return At.error("getTargetFromContainerItemID: containerItemID is the required parameter"),null;const{containers:t}=fh()?.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)},Gd=(e,t={})=>{if(!e)return At.error("closeContainerItem: containerItemID is the required parameter"),Promise.reject(new Error("closeContainerItem: containerItemID is the required parameter"));const n=Bd(e),r=Rd(e),{skipDirtyCheck:s}=t;let a=!0,o=[];if(kd(e)&&!s&&(a=window.confirm(Tp.getLocaleValue(Rl,"Messages"))),a){const{accessedOrder:t=[],items:s={},type:a}=hd(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?Wg({directUrlUpdation:!0,semanticURL:l,options:{containerItemID:i,context:u}}):Wg({directUrlUpdation:!0,semanticURL:j.FORWARD_SLASH_STRING,options:{}});mh(lg({containerItemID:e,context:r,target:n,containerInfo:{newAccessedOrder:o,containerType:a}}))}return Promise.resolve({newAccessedOrder:o,removeItem:a})},Wd=(e,t,n,r)=>{const s="root",a=H(t,s,!0),o=yt(t,s),i={data:n,context:r?"app":a},c=[Jh({root:e,containerItemID:a,context:r?"app":a,target:o,containerName:t})];c.push(Gh(i)),mh(c)},Hd=(e,t,n)=>{let r=md(e);r=r.filter((e=>e!==t));let s=!1;for(let e=0;e<r.length;e+=1){if(Rd(r[e])===n){s=!0;break}}return s},qd=e=>{if(!e)return At.error("isContainerItemContextBeingUsedInOtherContainers: containerItemID is the required parameter"),!1;const t=pd(),n=Rd(e),r=t?Object.keys(t):[];let s=!1;for(let t=0;t<r.length&&(s=Hd(r[t],e,n),!s);t+=1);return s},Yd=e=>{Array.isArray(e)||(e=[e]);const t=pd()||{};return e.map((e=>{const n=Bd(e);return wh.getIn(t,[n,"items",e,"transientItems"])||[]})).flat()},zd=e=>{const{transientItemID:t,data:n,options:r}=e,s=wh.deepClone(fh()?.getState().data[t]);r?.reset&&wh.iterateLeafNodes(s,(e=>{"classID"!==e[e.length-1]&&wh.setIn(s,e,"")})),mh(Zh({transientItemID:t,data:wh.mergeDeep(n,s)}))},Kd=e=>{const{transientItemID:t,data:n}=e;mh(tg({transientItemID:t,data:n}))},Xd=e=>{const t=wh.deepClone(fh()?.getState().data[e]);wh.iterateLeafNodes(t,(e=>{"classID"!==e[e.length-1]&&wh.setIn(t,e,"")})),mh(eg({transientItemID:e,data:t}))},Jd=e=>{const t=wh.deepClone(fh()?.getState().data[e]);wh.iterateLeafNodes(t,(e=>wh.setIn(t,e,""))),mh(ng({transientItemID:e,data:t}))};class Qd{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 Zd=()=>Qd,ep=e=>{const t={containerName:e};t.childContainers=Od(e),mh({type:Ue,payload:t})},tp=(e,t)=>{const n=bd(e),{key:r}=gd(Bd(e),e),s=[];n.forEach((e=>{const{key:n}=gd(Bd(e),e);if(n===r){const n={data:{caseInfo:{headers:{etag:t}}},target:Bd(e),context:e};s.push({type:fe,payload:n})}})),s.length&&mh(s)},np=(e,t)=>{const n=[],r={data:{caseInfo:{headers:{etag:t}}},target:Bd(e),context:e};n.push({type:fe,payload:r}),n.length&&mh(n)},rp=()=>_p.isPortalLoaded?"app":"root",sp=()=>jl,ap=(e,t)=>{const n={data:{caseInfo:{lastUpdateTime:t}},target:Bd(e),context:e};mh({type:fe,payload:n})},op=(e,t)=>{const n=Ed(e,t),r=Ed(`${n}/workarea`,t);return Rd(r)},ip=e=>e?Pd(e,"parentContext"):(At.error("getContainerParentContext: containerItemName is required parameters"),null),cp=e=>{const{accessedOrder:t}=e;return t&&t.length>0?t[t.length-1]:""},lp=e=>{if(e&&"string"==typeof e){const t=e.split("/");return t.pop(),t.join("/")}return null},up=()=>cd,dp=/{(.*?)}/i,pp=/{(.*?)}/g,hp=e=>null!==e.match(dp),gp=e=>(e&&(e.startsWith("/")&&(e=e.substring(1,e.length)),e.endsWith("/")&&(e=e.substring(0,e.length-1))),e),fp=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`}},mp=()=>gp(window.location.pathname),yp=()=>gp(window.location.pathname+window.location.search),Ip=(e,t,n)=>{switch(n){case"warning":t?console.warn(e,t):console.warn(e);break;case"error":t?console.error(e,t):console.error(e);break;default:t?console.log(e,t):console.error(e)}};const Ep=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=>{hp(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=()=>gp(`${this.getReqContextName()}/${this.getReqServletNameReal()}`);getReqServletNameReal=()=>`${this.reqServletNameReal}`;getAppDelimeter=()=>`${this.appDelimeter}`;getApplicationName=()=>`${this.appName}`;getApplicationAlias=()=>`${this.appAlias}`;getServletPath=()=>`${this.reqServletPath}`;getOrganizationName=()=>`${this.orgName}`;getReqContextName=()=>gp(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,""),gp(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(hp(r)){const e=r.match(pp);e?.forEach((e=>{const t=this._getDynamicKeyName(e);n[t]&&(s=s.replace(e,n[t]))}))}const a=Gg(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(yc(t))),o=`${F.APP.APP}${j.FORWARD_SLASH_STRING}${F.PRIMARY}`,i={semanticURL:a,directUrlUpdation:!0,options:{acName:o,context:Dd(o)}};Bg(i);const c=r.substring(r.lastIndexOf("-")+1),l=t.substring(t.lastIndexOf(" ")+1),u=_p.environmentInfoObject?.pxApplication?.pyLabel;Jg(`${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&&(wh.isEmpty(a)||wh.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&&hp(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(pp);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],hp(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)hp(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(!hp(n))return e;const r={};if(r[t]=e,void 0!==e.payload){const t=n.match(pp);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&&hp(s)){const e=s.match(pp);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(!hp(e)&&e!==r[o]&&fp(e)!==r[o])return!1}if(s){const e=new URLSearchParams(n.toLowerCase()),t=new URLSearchParams(s.toLowerCase()),r=new Set,a=new Set,o=/\{[a-zA-Z]+\}/;for(const t of e.keys())r.add(t);for(const e of t.keys())a.add(e);if(a.size!==r.size)return!1;for(const n of r){if(!a.has(n))return!1;const r=t.get(n);if(e.get(n)!==r&&!o.test(r))return!1}}return!0}))};_sendWarningAndErrorMessages=(e,t)=>{Ip(e,t,"warning"),Ip("Error in Generated Routing Table",null,"error"),Ip("Back | Forward for this page may NOT work as intended",null,"warning"),Ip("Bookmark | Refresh for this page may NOT work as intended",null,"warning")}},Ap=Ep;const _p=new class{constructor(){this.environmentInfoObject=null,this.isPortalLoaded=!1,this.pageName=null,this.KeyMapping={},this.isAssignmentHeaderHidden=!1,this.coexistenceMeta={appType:"",isCoexistence:!1},this.brandingInfo=null,this.cookieComplianceMethod="none",this.isExtraCallRequiredForDefaultHome="false"}setEnvironmentInfo(e){this.environmentInfoObject=e;const t=this.environmentInfoObject?.features||wh.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 Ap.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(){Di.setPreviewMode()}setDefaultCasePage(e){this.pageName=e}getDefaultCasePage(){return this.pageName}disableAssignmentHeader(e){this.isAssignmentHeaderHidden=e}isAssignmentHeaderDisabled(){return this.isAssignmentHeaderHidden}getDefaultPortal(){return this.environmentInfoObject?.pxOperator?.pyDefaultPortal}updateFeatureMap(e){const t=this.environmentInfoObject?.features;return this.environmentInfoObject&&e&&(this.environmentInfoObject?.features?this.environmentInfoObject.features={...t,...e}:this.environmentInfoObject.features={...e}),this.getFeatureMap()}getFeatureMap(){return this.environmentInfoObject?.features||{}}setKeyMapping(e){return this.KeyMapping=e,this.KeyMapping}getKeyMapping(e){const t=this.KeyMapping[e];return void 0!==t?t:null}setCoexistenceMeta(e){return e&&(this.coexistenceMeta=e),this.getCoexistenceMeta()}getCoexistenceMeta(){return this.coexistenceMeta}isCoexistenceAppOfType(e){return!(!this.coexistenceMeta.isCoexistence||this.coexistenceMeta.appType!==e)}getCaseTypeList(){return this.environmentInfoObject&&this.environmentInfoObject?.pyCaseTypeList||[]}getUserSettings(){return this.environmentInfoObject?.pyUserSettings||null}getAvailableLocalePacks(){return this.environmentInfoObject?.pyAvailableLocalePacks?.map((e=>e.pyLabel))||[]}getIsExtraCallRequiredForDefaultHome(){return this.isExtraCallRequiredForDefaultHome}setIsExtraCallRequiredForDefaultHome(e){this.isExtraCallRequiredForDefaultHome=e}getInactivityTimeout(){const e=this.environmentInfoObject?.pxOperator?.pyAuthenticationTimeout;return e?Number(e):e}isUnifiedObject(){return this.environmentInfoObject?.features?.isUnifiedObject||!1}getRuntime(){return"undefined"!=typeof window&&window.document?"Browser":"Native"}};const Cp=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 Sp{GENERIC_BUNDLE_KEY="@BASECLASS!GENERIC!PYGENERICFIELDS";FIELD_LABELS_BUNDLE_KEY="@BASECLASS!LABEL!PYFIELDLABELS";GENERIC_BUNDLE_KEY_LP="GENERIC!GENERICFIELDS";MESSAGE_BUNDLE_KEY="@BASECLASS!MESSAGE!PYMESSAGES";BASE_CLASS="@BASECLASS";DATA_PAGE_LOCALECONTEXT="datapage";constructor(){this.localeStore={},this.getLocaleValue=this.getLocaleValue.bind(this)}setLocaleForRule=(e,t)=>{const n=e.LocaleContent||e;this.localeStore[Sp.#t(t)]=n};getLocaleForRule(e=this.#n()){return this.localeStore[Sp.#t(e)]}resetLocaleStore=()=>{this.localeStore={}};#r(e){return e?Sp.#t(e):this.#n()}#s(e){let t=!1;return e&&"string"==typeof e&&(t=e.includes("@P ")),t}#a(e,t){return t!==this.FIELD_LABELS_BUNDLE_KEY?e?`${e}.fields`:"fields":e}getLocaleValue(e,t,n,r){n=this.#r(n);const s=this.#s(e);s&&(e=Cp.formatLocaleKey(e));const a=this.#o(e,n,t,r);return"Messages.fields"===(t=this.#a(t,n))&&"string"==typeof e?this.getLocalizedErrorMessage(a,e)||e:s?Cp.replaceWithValue(a[e]||e):a[e]||e}#o(e,t,n,r){t!==this.FIELD_LABELS_BUNDLE_KEY&&(n=n?`${n}.fields`:"fields");let s=this.localeStore[t.toUpperCase()],a=s?wh.getIn(s,n,{}):{};return!a[e]&&r&&(s=this.localeStore[this.#n().toUpperCase()],a=s?wh.getIn(s,`${r}.${n}`,{}):{}),a}#n(){return void 0===_p.getFeatureMap()?.localizationVersion?this.GENERIC_BUNDLE_KEY:this.GENERIC_BUNDLE_KEY_LP}getParagraphLocaleValue(e,t){const n=`${e}!${j.PARAGRAPH}!${t}`,r=this.localeStore[n.toUpperCase()];return r?decodeURIComponent(atob(r.content).split("").map((e=>`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`)).join("")):null}getPortalLocaleReference(e){return e?`PORTAL!${e}`.toUpperCase():`PORTAL!${_p.getPortalName()}`.toUpperCase()}getCaseLocaleReference(e){return e?`CASE!${e}`.toUpperCase():null}getLocalizationVersion(){return _p.getFeatureMap().localizationVersion||1}async getLocaleJsons(e){if(!await this.isCurrentLocalePackAvailable())return[];const t=_p.getUseLocale(),n=[],r=PCore.getLocaleUtils().localeStore;if((e=(e=e.filter((e=>!r[Sp.#t(e)]))).map((e=>e.toUpperCase()))).length>0){const r=e.map((e=>({localeRuleKey:e,promise:Ur.getSvcLocale(t,`${e}.json`)}))),s=await Promise.allSettled(r.map((e=>e.promise)));await Promise.all(s.map((async(e,t)=>{if("fulfilled"===e.status&&null!==e.value){const s=r[t];let a;try{a=await e.value.json()}catch{a=null}a&&n.push({localeRuleKey:s.localeRuleKey,jsonData:a})}})))}return n}async loadLocaleResources(e){const t=_p.getUseLocale(),n=_p.getBaseLocale();if(_p&&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=_p.getLocale();return this.availableLangPacks?.length||(this.availableLangPacks=_p.getAvailableLocalePacks()),e&&this.availableLangPacks.includes(e)}static#t(e){if(!e)return e;const t=e.indexOf("!CASE!");return-1===t?e:`CASE!${e.substring(0,t)}`}getCaseTypeLocaleReferences(){return _p.getCaseTypeList().map((e=>`${e.pyWorkTypeImplementationClassName}!CASE!${e.pyWorkTypeName}`.toUpperCase()))}}const Tp=new Sp;const Np=class{static getParagraphStream(e,t){return((e,t)=>{if(!e)return e;const n=(new DOMParser).parseFromString(e,"text/html"),r=n.querySelectorAll("pega-reference");for(const e of r){const r=e.getAttribute("data-rule-id");if(r){const s=t.getValue(r),a=n.createTextNode(s??"");e.replaceWith(a),t.registerAdditionalProps({[r]:`@P ${r}`})}else e.replaceWith("")}const s=n?.body?.innerHTML||"";return/^(<p>)\s*(<\/p>)$/.test(s)?null:s})(e,t)}};Qt.registerHandler("@L",((e,t)=>t.getLocalizedValue(e))),Qt.registerHandler("@P",((e,t,n)=>t?t.getValue(e):Fh.getLitePropertyValue(n))),Qt.registerHandler("@E",((e,t,n)=>{try{const r=kt(e),s=$t(r);return Bt(s,t,n)}catch(e){}return!0})),Qt.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=_h(t,`.${j.SUMMARY_OF_WHEN_CONDITIONS}.${e}`,s)}return!0===r||"true"===r})),Qt.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=Zt.getPropertyName(e?.propertyForDisplayText??""),r=Zt.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=Zt.getPropertyName(n?.datasource?.propertyForDisplayText),p=Zt.getPropertyName(n?.datasource?.propertyForValue),h=Array.isArray(n?.datasource?.parameters)?n?.datasource?.parameters:[],g=t.getContextName(),f=[];if(h.forEach((e=>{if(Zt.isProperty(e?.value)){let t=Ah(`.${wh.getFullPropertyReference([a,Zt.getPropertyName(e.value)])}`,o,g);f.push(wh.getFullPropertyReference([o,a,Zt.getPropertyName(e?.value)])),null!=t&&""!==t||(t=j.NULL_STRING),r.push(t)}else r.push(e?.value||j.NULL_STRING)})),g){const e=Xt.getContextObjectByName(g)||{};f.forEach((t=>{if(t in e){const n=e[t];e[t]=[...new Set([...n,s])]}else e[t]=[s]})),Xt.addContextName(g,e)}const m=function(e,t,n,r){let s="",a=n;if(t.join(j.HASH_DELIMITER)&&(s=wh.getHashedString(t.join(j.HASH_DELIMITER)),a=n+j.UNDERSCORE_STRING+s),r){const e=Ih(),t=e?e[n]?.[a]:{};return Array.isArray(t?.pxResults)?t.pxResults:[]}const o=e.getDataObject(),i=o?.[n]||{},c=i?.[a]||{};return Array.isArray(c?.pxResults)?c.pxResults:[]}(t,r,l,c);return m.map((e=>({key:e[p]||e[`.${p}`],value:e[d]||e[`.${d}`]})))})),Qt.registerHandler("@ROUTING_INFO",((e,t)=>It(t.getContainerName(),t.getContextName()))),Qt.registerHandler("@ENV",((e,t)=>{switch(e){case j.ENV_INFO_KEYS.APPLICATION_NAME:return _p.getApplicationName();case j.ENV_INFO_KEYS.ACCESS_GROUP:return _p.getAccessGroup();case j.ENV_INFO_KEYS.USER_NAME:return _p.getOperatorName();case j.ENV_INFO_KEYS.USER_ID:return _p.getOperatorIdentifier();case j.ENV_INFO_KEYS.APPLICATION_DESC:return t.getLocalizedValue(_p.getApplicationLabel()||"");case j.ENV_INFO_KEYS.USER_IMAGE:return _p.getOperatorImageInsKey();case j.ENV_INFO_KEYS.LOCALE:return _p.getUseLocale();case j.ENV_INFO_KEYS.TIMEZONE:return _p.getTimeZone();case j.ENV_INFO_KEYS.WORK_GROUP:return _p.getOperatorWorkGroup();default:return e}})),Qt.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=Zt.getPropertyName(e);r[t]=n[t]})):Object.keys(e).forEach((t=>{const s=Zt.getPropertyName(e[t]);r[t]=n[s]})),a.push(r)})),a}return[]})),Qt.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})),Qt.registerHandler("@USER",((e,t,n={})=>{const r=t?.getValue(e)||Fh.getLitePropertyValue(n,e),s=t?.getReferencedUser(r)||Fh.getReferencedUser(r,n);return{userId:r,userName:s?s.UserName:null}})),Qt.registerHandler("@ACTIVE_CASES",((e,t)=>Yu.getOpenedCaseItems(`${t.getContextName()}/${t.getContainerName()}`))),Qt.registerHandler("@LR",(e=>e)),Qt.registerHandler("@CASE",((e,t)=>e===j.ID?t.getCaseInfo().getKey():e)),Qt.registerHandler("@SHARED",(e=>Xu.getSharedState(e))),Qt.registerHandler("@PARAGRAPH",((e,t)=>{const n=t.getLocalizedParagraphValue(e);return n?Np.getParagraphStream(n,t):null})),Qt.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 wh.isEmpty(a)?o=t.getValue(`.${n}`):(o=a,o=wh.getIn(o,n)),o&&r.length>0?(s&&(o=o.filter((e=>Gt(s,e)))),o.map((e=>wh.getIn(e,r)))):null})),Qt.registerHandler("@ADDRESS",((e,t)=>{const n=t.getValue(e)?.pyCountry;return n?`pyAddressForm_${n}`:"pyAddressForm"})),Qt.registerHandler("@DATATYPE",((e,t)=>t.getValue(e)));const Pp="downloadAttachment",Rp={},Dp=e=>{const t=Gi();return Rp[e]=t,t},bp=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},Op=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:bp(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)}}},vp={uploadAttachment:(e,t,n,r,s)=>{const a=new FormData;a.append("appendUniqueIdToFileName",!0),a.append("file",e),s&&a.append("contextID",s);const{restApi:o,reqType:i}=Fg("uploadAttachment",{});return ki(o,{method:i,headers:{"Content-Type":"multipart/form-data"},body:a,onUploadProgress:t,signal:Dp(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(Wi,e):e=>{throw e.isHandled=!1,e}).finally((()=>delete Rp[e.ID]))},linkAttachmentsToCase:(e,t,n,r)=>{const s={};if("File"===n){const[e]=t,{clientFileID:n}=e;delete e.clientFileID,s.signal=Dp(n).token}const{restApi:a,reqType:o}=Fg("linkCaseAttachment",{caseID:e});return ki(a,{...s,body:{attachments:t},method:o},r)},getCaseAttachments:(e,t,n=!1)=>{const{restApi:r,reqType:s}=Fg("getCaseAttachments",{caseID:e,includeThumbnail:n});return ki(r,{method:s},t).then((e=>e.data.attachments))},getAttachmentCategories:(e,t,n)=>{const{restApi:r,reqType:s}=Fg("getAttachmentCategories",{caseID:e,type:t});return ki(r,{method:s},n).then((e=>e.data))},downloadAttachment:(e,t,n)=>{const{restApi:r,reqType:s}=Fg(Pp,{attachmentID:e});return ki(r,{method:s,..."binary"===n&&{responseType:"arraybuffer"}},t)},editAttachment:(e,t,n)=>{const{restApi:r,reqType:s}=Fg("editAttachment",{attachmentID:e});return ki(r,{method:s,body:{...t}},n)},deleteAttachment:(e,t)=>{const{restApi:n,reqType:r}=Fg("deleteAttachment",{attachmentID:e});return ki(n,{method:r},t)},downloadDocument:(e,t)=>{const{restApi:n,reqType:r}=Fg("downloadDocument",{documentID:e});return ki(n,{method:r},t)},deleteDocument:(e,t,n)=>{const{restApi:r,reqType:s}=Fg("deleteDocument",{caseID:e,documentID:t});return ki(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=>{Rp[e]&&(Rp[e].cancel(),delete Rp[e])},buildFilePropsFromResponse:Op,getAttachmentURL:e=>{const{restApi:t}=Fg(Pp,{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=>Op(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(Op)}else t=[];return{hasUploadedFiles:t.length>0,categoryName:e?.pyCategoryName||t?.[0]?.responseProps?.category||"",attachments:t}}};Qt.registerHandler("@ATTACHMENT",((e,t,n)=>{let r;return r=t?t.getValue(e):Fh.getLitePropertyValue(n),vp.prepareAttachmentData(r)})),Qt.registerHandler("@FL",((e,t)=>t.getLocalizedValueForFieldLabel(t.getFieldMetadata(e)?.label))),Qt.registerHandler("@GENAICOACH",((e,t)=>rh(e,t.getCurrentClassID()))),Qt.registerHandler("@REFRESH",((e,t)=>{const n=t.getCaseInfo().getKey(),r=t.getContextName(),s=t.getPageReference();Cl.registerForRefresh("PROP_CHANGE",t.getActionsApi().refreshCaseView.bind(t.getActionsApi(),n,"",s,{autoDetectRefresh:!0,preserveClientChanges:!1,refreshFor:!0}),`${s}${e}`,`${r}/${s}`,r)}));const xp={},wp={},Mp={},Lp={},Up={},Fp={},jp={},Vp={},kp={},$p={},Bp=(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})):wh.copy(e,t)},Gp=(e,t="")=>{if(!e)return null;const n=Lp[e];if(!n)return null;if(!t)return wh.deepClone(n);let r;return r=Array.isArray(n)?n.find((e=>e.classID.toLowerCase()===t.toLowerCase()))||null:n.classID.toLowerCase()===t.toLowerCase()||("Page"===n.type||"Page List"===n.type)&&n?.pageClass?.toLowerCase()===t.toLowerCase()?n:null,r?wh.deepClone(r):null},Wp=(e,t,n,r=[])=>{if(!t||!e)return null;if(!e.includes(".")){let s;const a=Gp(e,t);return r.length&&(s=r.join(".")),{...a,embeddedType:n,category:s}}const[s,...a]=e.split("."),o=Gp(s,t);return o&&r.push(o.label),Wp(a.join("."),o?.pageClass,o?.type,r)},Hp=e=>{Bp(e,wp)},qp=e=>{Bp(e,Mp)},Yp=e=>{if(e.views&&Bp(e.views,wp),e.navigations&&Bp(e.navigations,Mp),e.personalizations&&Bp(e.personalizations,Fp),e.insights&&Bp(e.insights,jp),e.paragraphs&&Bp(e.paragraphs,xp),e.dataTypes&&Bp(e.dataTypes,Vp),e.datapages&&Bp(e.datapages,kp),e.genAICoaches&&Bp(e.genAICoaches,$p),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=>{Up[e]=t[e]}))}Bp(e.fields,Lp)},zp=e=>wp[e],Kp=(e,t)=>{const n=wp[e];return Array.isArray(n)?n.some((e=>e.classID===t)):n?.classID===t},Xp=e=>Mp[e],Jp=e=>e in Up?Up[e]:null,Qp=e=>e in Fp?Fp[e]:null,Zp=e=>e in jp?jp[e]:null,eh=e=>{const t={};return Object.keys(Lp).forEach((n=>{const r=Lp[n];let s;Array.isArray(r)?s=r.find((t=>e===t.classID)):e===r.classID&&(s=r),s&&(t[n]=wh.deepClone(s))})),t},th=(e,t)=>{const n=Gp(e,t)?.datasource?.parameters;return n?wh.deepClone(n):null},nh=(e,t)=>{let n=null;const r=xp[e];return r&&(Array.isArray(r)?n=r.find((e=>e.classID===t)):r.classID===t&&(n=r)),n?wh.deepClone(n):null},rh=(e,t)=>{let n=null;const r=$p[e];return r&&(Array.isArray(r)?n=r.find((e=>e.classID===t)):r.classID===t&&(n=r)),n?wh.deepClone(n):null},sh=e=>{if(e in Vp){const{savableDataPage:t}=Vp[e];return t}return null},ah=e=>{const t=kp[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}))):[]},oh=e=>{if(e in Vp){const{lookupDataPage:t}=Vp[e];return t}return null},ih=e=>{if(Object.prototype.hasOwnProperty.call(Vp,e)){const{lookupDataPageInfo:t}=Vp[e];return t}return null},ch=(e,t)=>{const n=e.split("."),r=n.pop(),s=new ad({options:{pageReference:`${n.join(".")}`,context:t}}),a=Gp(r,s.getCurrentClassID())?.additionalInformation;if(!a?.includes("@PARAGRAPH"))return a;const o=Zt.trimAnnotation(a),i=s.getCurrentClassID(),c=nh(o,i),l=c?.definedOnClassID,u=Tp.getParagraphLocaleValue(l||i,o);return u?Np.getParagraphStream(u,s):c?.content?Np.getParagraphStream(c.content,s):null},lh=(e,t)=>{const n=e.split("."),r=n.pop(),s=new ad({options:{pageReference:`${n.join(".")}`,context:t}}),a=Gp(r,s.getCurrentClassID()),o={};return s._classID=s.getCurrentClassID(),s.resolveConfigProps(a,o),o};class uh{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=wh.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=wh.getFullPropertyReference([i,t]),t in o){const e=o[t];wh.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=Ah(n,t,e);a.previousValue="object"==typeof o?null:o}}))}registerListField(e,t,n,r,s){const a=uh._getFieldsForList(e,t,n);a.length>0&&(this.registerFields(e,t,a,r,s),pu.enableCascade(e))}unRegisterListField(e,t,n,r){const s=uh._getFieldsForList(e,t,n);s.length>0&&this.unRegisterFields(e,t,s,r)}static _getFieldsForList(e,t,n){const r=[],s=Gp(n,Ah("classID",t,e));return s&&!Array.isArray(s)&&s.datasource&&s.datasource.parameters&&Object.values(s.datasource.parameters).forEach((e=>{if(Zt.isProperty(e)){const t=Zt.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=Ah(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=Ah(t,"",e);n(e,t,r)}))}))}_updateChangedProperties(e,t,n,r,s,a,o,i){const c=n&&i.some((e=>r.startsWith(e)));if(e!==t||c){const e=r.lastIndexOf("."),t=r.substring(0,e),i=r.substring(e),c=er.getMessages({type:"error",property:i,context:s,pageReference:t});if(c?.length>0&&o.push(r),!n)return;a.push(r)}}isChangedListPropertyExist(e){let t=!0;return 0!==this.listChangeSubscribers.length&&wh.isValidPageListProperty(e)||(t=!1),t}_getServerProperties(e,t,n,r,s,a,o){if("object"!=typeof e){s.push(n.replace(/\.(\d+)/g,"[$1]"));const i=this.isChangedListPropertyExist(n);n=n.replace(/\.(\d+)/g,"[$1]");const c=Ah(n,"",t);if(void 0===c&&!e&&0!==e)return;return void this._updateChangedProperties(c,e,i,n,t,r,a,o)}const i=Object.keys(e??{});for(let c=0,l=i.length;c<l;c+=1){const l=i[c],u=`${n}.${l}`;if(Array.isArray(e[l])){const n=Ah(u,"",t);n&&n?.length===e[l].length||o.push(u)}this._getServerProperties(e[l],t,u,r,s,a,o)}}getServerProperties(e,t,n=j.CASE_INFO.CASE_INFO_CONTENT){const r=[],s=[],a=[],o=wh.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 dh=new uh;let ph=null;const hh=e=>e?.split(/\.(?![^[]+\])|\[|\]/g).filter(Boolean),gh=e=>{ph=e},fh=()=>ph,mh=e=>{if(!e)return;let t=[],n=[],r=[];Array.isArray(e)||"MERGE_DATA"!==e.type||({changedListProperty:t,leafProperty:n,changedPropertyWithError:r}=dh.getServerProperties(e.payload.data,e.payload.context,e.payload.rootPageReference)),fh()?.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);er.clearMessages({type:"error",property:s,pageReference:r,context:e.payload.context});const a=Rn.getFieldReferenceForProperty(e.payload.context,t),o=Fh.resolveContextTreeNodeProps(a.props);xr.validate(o.componentName?.toLowerCase(),o.propertyName,Fh.getLitePropertyValue(o,o.propertyName),o)})),dh.handleServerChanges(e.payload.context,t,n))},yh=e=>fh()?.getState().data?.[e],Ih=()=>fh()?.getState().data[j.SHARED],Eh=(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=hh(s);return wh.getIn(n,a)},Ah=(e,t,n)=>Eh(e,t,yh(n)),_h=(e,t,n)=>Eh(t,e?`${j.CONTEXT_DATA}.${e}`:`${j.CONTEXT_DATA}`,yh(n)),Ch=(e,t,n)=>((e,t,n)=>{const r=hh(`${t}.${n}`);return wh.getIn(e,r)})(yh(n),`${j.CONTEXT_DATA}.${e}`,t),Sh=e=>{const{context:t}=e,n=fh()?.getState().data[t];if(n)return de;const{action:r}=e;return["createWork","showHarness","openAssignment","openWorkByHandle","initRouting"].includes(r)?Ce:de},Th=(e,t)=>{const n=hh(t);return wh.deleteIn(e,n)},Nh=e=>!Array.isArray(e)&&"object"==typeof e,Ph=(e,t=[])=>{Array.isArray(t)&&t.length>0&&t.forEach((t=>{t.allowMultiple?t.allowMultiple&&wh.setIn(e,t.path,[]):wh.setIn(e,t.path,{})}))},Rh=(e,t,n={})=>{const{isArrayDeepMerge:r,propertiesToReplace:s=[]}=n;Array.isArray(e)&&!t&&(t=[]),Ph(e,s);const a=(e,t)=>{if(Nh(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)},Dh=(e,t,n,r={isArrayDeepMerge:!0})=>{const{isArrayDeepMerge:s}=r,a=hh(t);if("object"==typeof n){const t=Rh(wh.getIn(e,a),n,{isArrayDeepMerge:s});return wh.setIn(e,a,t)}return wh.setIn(e,a,n)},bh=(e,t,n)=>{const r=hh(t);return wh.setIn(e,r,n)},Oh=()=>{const e=et,{promise:t,actionMgrID:n}=un.actionManagerPromise(e);return mh({type:e,payload:{actionMgrID:n}}),t},vh=e=>{const t=fh()?.getState();return!!t?.data?.[e]};class xh{static mergeDeep(e,t){return w()(t,e)}static hasIn(e,t){return R()(e,t)}static getIn(e,t,n){return b()(e,t,n)}static setIn(e,t,n){return v()(e,t,n)}static deleteIn(e,t){return N()(e,t)}static isObjectEmpty(e){return!e||0===Object.entries(e).length}static isEmpty(e){return L()(e)}static deepClone(e={}){return JSON.parse(JSON.stringify(e))}static copy(e,t){Object.keys(e).forEach((n=>{t[n]=e[n]}))}static isPropertyRef(e){if(!e||-1===e.indexOf("."))return!1;let t=0;const n=e.length;for(;t<n;t+=1)if(" @#$%=!<>/\\".includes(e[t]))return!1;return!0}static isWhenExist(e){const t=["visibility","disabled","readOnly","required"];let n=!1;for(const r in e)t.includes(r)&&"string"==typeof e[r]&&e[r]?.startsWith("@W ")&&(n=!0);return n||"multirecordlist"!==e?.type||"Editable"!==e?.renderMode||(n=Object.keys(e?.allowActions??{}).some((t=>"string"==typeof e?.allowActions?.[t]&&e.allowActions[t]?.startsWith("@W ")))),n}static getWhenNames(e){const t=["visibility","disabled","readOnly","required"];let n="";const r=new Set;for(const s in e)t.includes(s)&&"string"==typeof e[s]&&e[s]?.startsWith("@W ")&&(n=Zt.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=Zt.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)?[]:{}),Rh(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]]&&xh.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)=>{xh.flatten(e,`${t}[${r}]`,n)})):"object"==typeof e&&null!==e?Object.keys(e).forEach((r=>{const s=t?`${t}.${r}`:r;xh.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 $n.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&&un.rejectActionByID(e.payload.actionMgrID))),!0}static isValidAnnotation(e){const t=new Set(["@DATASOURCE","@ACTIVE_CASES","@ADDRESS","@ASSOCIATED","@ATTACHMENT","@CASE","@FILTERED_LIST","@PARAGRAPH","@P","@ROUTING_INFO","@USER","@W","@E","@SHARED"]),n=e.indexOf(" "),r=e.substring(0,n);return t.has(r)}static trimDotForProperty(e){return"string"==typeof e&&e.startsWith(".")?e.substring(1):e}static convertObjectWithStringToBoolean(e){if(e&&!Array.isArray(e)&&"object"==typeof e)return Object.keys(e).forEach((t=>{let n;const r=e[t];n="string"==typeof r?"true"===r||"false"!==r&&r:r,e[t]=n})),e}static isValidPageListProperty(e){return!!e&&/^(?!.*\.\.)(?!\d)\w+(\.\w+)*\.\d+(\.\w+)+$/.test(e)}}const wh=xh,Mh=j.SUMMARY_OF_LISTS,Lh=j.SUMMARY_OF_WHEN_CONDITIONS;class Uh{static updateData(e){Object.keys(e).forEach((t=>{mh(Gh({context:t,data:e[t]}))}))}static updateContextData(e){Object.keys(e).forEach((t=>{mh(Gh({context:t,data:e[t]}))}))}static resolveWhen(e,t){return!!t.getContextDataValue(`.${Lh}.${e}`)}static resolveFieldValue(e,t){return t.getLocalizedValue(e)}static resolveNavigation(e,t){return Xp([this.resolveName(e,t)])}static resolveView(e,t,n=""){const r=zp([this.resolveName(e,t)]);let s=[];if(Array.isArray(r)&&r.length>0){if(t&&r.length>1){if(n||(n=t.getValue(j.CLASS_ID)),!n)return;s=r.filter((e=>e[j.CLASSID]===n))}return 0===s.length?r[0]:s[0]}return r}static resolveName(e,t){return e&&"string"==typeof e&&e.startsWith("param.")?(e=e.substring(6),t.getContextDataValue(`.$parameters.${e}`)):(e&&"string"==typeof e&&e.startsWith("@")&&(e=Zt.handleAnnotation(e,t)),e)}static getContextPath(e,t){return("number"==typeof t||t)&&("number"==typeof(t=Zt.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;if(t)r=t.startsWith(j.CLASS_ANNOTATION)?t.split(j.CLASS_ANNOTATION)[1].trim():this.resolveClassID(t,e.getPageReference(),e.getContextName());else if(n?.authorContext){const t=e.getFieldMetadata(n.authorContext);if(t){r="manual"===t.dataRetrievalType?t.classID:t.pageClass}r||(r=n.ruleClass)}return r}static resolveReference(e,t){const{type:n}=e;let r;if("reference"===n){const{config:n}=e,s=n?.type,{ref:a,name:o,context:i}=n||{},c=this.getRuleClass(t,i,n);return"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 Ah(t,e,n)}static getProperty(e,t,n){let r=this.resolvePropertyReference(t,e,n);if(null==r||0===r.length){const s=Ch(`${t}.${Mh}`,e,n);s&&(r=this.resolvePropertyReference(t,s,n))}return r}static getPropertyValue(e,t,n){return e=Zt.trimAnnotation(e),this.getProperty(e,t,n)}static getReferencedUser(e,t){const n=Uh.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?Uh.getPropertyValue(i,a,`${o}/${j.SUGGESTION}`):Uh.getPropertyValue(i,a,o)}static _handlePropString(e,t,n,r,s){n.startsWith("@")?e[t]=Zt.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?(wh.mergeDeep(e,t),this._resolveProps(t,n,void 0),t):t}static resolveContextTreeNodeProps(e){const t={};return e?(wh.mergeDeep(e,t),this._resolveProps(t,void 0,e),wh.resolveStringBooleans(t)):t}static resolveClassID(e,t,n){const r=Zt.trimAnnotation(e);let s;for(s=r.startsWith(".")?`${t}${r}`:`${r}`;s;){const e=Ah(j.CLASS_ID,s,n);if(e)return e;s=s.substring(0,s.lastIndexOf("."))}return null}}const Fh=Uh;const jh=new class{constructor(){this.actionHandlers={}}getHandler(e){return this.actionHandlers[e]}registerHandler(e,t){this.actionHandlers[e]=t}};const Vh=class{static#i=[];static#c=!1;static getActionHandlers=(e,t,n)=>{const r=[];return{mouseenter:"hover",change:"onChange",blur:"onBlur"}[n]!==t||e.forEach((e=>{const t=jh.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#l=(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.#i.push(a)}};static buildActionObject=(e,t)=>{const n={...e};return n.context="Browser"===_p.getRuntime()?t.getContextName():n.context,n.pageReference=t.getPageReference(),n.actionMgrID=un.getNextActionMgrId(),n};static#u=e=>{const t=e.actionHandler,n=e.component,{config:r}=e,s={};Fh.resolveProps(r,s,n),t&&(t(e.eventType,s,n),this.#d())};static#d=()=>{if(!this.#c){if(0===this.#i.length)return;const e=this.#i.shift();this.#u(e),e.config&&"true"===e.config.parallel&&this.#i.length>0&&this.#d()}};static#p=()=>{this.#d()};static#h=(e,t,n)=>{this.#l(e,t,n),this.#p()};static getFullRef=e=>{const t=e.getPageReference(),n=e.getComponentConfig().value;return Fh.getContextPath(t,n)};static#g(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.#h(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"===_p.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);mh({type:Q,payload:{reference:a,value:s,context:r}}),void 0!==n&&this.isEditable(n)&&!this.isNonKeyInput(n)||mh({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];mh({type:Q,payload:{reference:Fh.getContextPath(n,a),value:o,context:r}}),mh({type:ee,payload:{reference:Fh.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)&&mh({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.#g(e,n)};static pause=()=>{this.#c=!0};static resume=()=>{this.#c=!1,this.#d()};static isQueueEmpty=()=>0===this.#i.length;static clearQueue=()=>{this.#i=[]};static getActionsQueue=()=>this.#i;static EVENTS_MAP={click:"onClick",change:"onChange",hover:"onMouseEnter",blur:"onBlur"}},kh="CREATE_WORK",$h=e=>({type:kh,payload:e});const Bh=(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])?[]:{}),Bh(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)},Gh=(e,t={})=>{const{serverPrecedenceFields:n=[],propertiesToReplace:r=[]}=t,{context:s,data:a,isArrayDeepMerge:o,preserveClientChanges:i=!1}=e,c=bl(s,!0),l=yh(s);let u={};if(l&&a){u=JSON.parse(JSON.stringify(l));const e=JSON.parse(JSON.stringify(a)),t=new Set;Bh(c,u,t),((e,t,n)=>{const r=new Set;e.forEach((e=>{e=wh.trimDotForProperty(e);const[s,a,o]=fn(e);s&&a&&o&&!r.has(`${s}.${a}`)&&((wh.getIn(n,`${s}.${a}`)||[]).forEach(((e,n)=>{n!==+o&&wh.setIn(t,`${s}.${a}[${n}]`,e)})),r.add(`${s}.${a}`))}))})(t,u,e)}!function(e,t){const n=wh.getIn(e,j.REFERENCED_USERS);let r;if(void 0!==n){if(!Array.isArray(n)&&"object"==typeof n)return r=wh.getIn(t,j.REFERENCED_USERS,{}),void wh.setIn(e,j.REFERENCED_USERS,{...r,...n});r=wh.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=>{wh.deleteIn(d,`caseInfo.content.${e}`)})),p=Rh(a,d,{isArrayDeepMerge:!o})):((e,t)=>{const n=Tl[e]||{};Object.keys(n).forEach((e=>{wh.hasIn(t,e)&&(n[e].value=wh.getIn(t,e))}));let r=sl.getStateMachinesByContext(e)||{};r={...r,...sl.getUnConnectedStateMachines(e)||{}},Object.keys(r).forEach((n=>{if(wh.hasIn(t,n)){const r=wh.getIn(t,n);r&&Array.isArray(r)&&0===r.length&&sl.setStateMachineEmpty(e,n)}}))})(s,a),{type:fe,payload:{...e,data:p,...r.length>0?{propertiesToReplace:r}:null}}},Wh=e=>({type:"SHOW_HARNESS",payload:e}),Hh=e=>({type:te,payload:e}),qh=e=>({type:ne,payload:e}),Yh=e=>({type:"ADD_WORK",payload:e}),zh=e=>({type:ue,payload:e}),Kh=e=>({type:Ae,payload:e}),Xh=e=>({type:_e,payload:e}),Jh=e=>({type:Ce,payload:e}),Qh=e=>({type:Te,payload:e}),Zh=e=>({type:Ne,payload:e}),eg=e=>({type:De,payload:e}),tg=e=>({type:Oe,payload:e}),ng=e=>({type:be,payload:e}),rg=e=>{const{containerItemID:t}=e;e.suggestionContexts=xd(t);const n=e?.data?.caseInfo?.content,r=Object.keys(n||{}).length>0;return e.propertiesToReplace=r?vc.getPropertiesToReplace(t):[],{type:xe,payload:e}},sg=e=>{const{context:t}=e;return{type:oe,payload:{context:t}}},ag=e=>{const{context:t}=e;return{type:ie,payload:{context:t}}},og=e=>({type:we,payload:e}),ig=e=>({type:ve,payload:e}),cg=e=>({type:Qe,payload:e}),lg=e=>{const{context:t,containerItemID:n}=e;let r=t;return r||(r=Rd(n)),e.context=r,e.deleteContext=!qd(n),e.childContainers=Od(n),e.childContainersContexts=vd(n),e.transientItems=Yd([...e.childContainersContexts,n]),e.suggestionContexts=xd(n),n===t&&(e.caseID=Ah(j.CASE_INFO.CASE_INFO_ID,"",t),e.RemoteSystemID=Ah(j.CASE_INFO.REMOTESYSTEMID,"",t)),{type:Se,payload:e}},ug=e=>{const{containerItemID:t}=e;return e.transientItems=Yd([...vd(t),t]),{type:Re,payload:e}},dg=e=>{const{transientItemID:t}=e;return e.transientItems=[t],{type:Pe,payload:e}},pg=e=>{const{context:t,containerItemID:n}=e;let r=t;return r||(r=Rd(n)),e.context=r,e.childContainers=Od(n),e.childContainersContexts=vd(n),e.transientItems=Yd([...e.childContainersContexts,n]),e.suggestionContexts=xd(n),n===t&&(e.caseID=Ah(j.CASE_INFO.CASE_INFO_ID,"",t),e.RemoteSystemID=Ah(j.CASE_INFO.REMOTESYSTEMID,"",t)),{type:Me,payload:e}},hg=e=>({type:pe,payload:e}),gg=e=>({type:ge,payload:e}),fg=e=>({type:Ie,payload:e}),mg=(e,...t)=>(Vh.resume(),e(...t)),yg=(e,t,n,r,s)=>({type:Ee,payload:{msg:e,err:t,context:n,formFields:r,actionMgrID:s}}),Ig=e=>({type:nt,payload:e}),Eg=e=>({type:rt,payload:e}),Ag=e=>({type:st,payload:e}),_g=e=>({type:"SHOW_CASE_PREVIEW",payload:e}),Cg=e=>({type:ce,payload:e}),Sg=e=>({type:Q,payload:e}),Tg=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},Ng=(e,t)=>e.includes("/assignments")?((e,t)=>{const n=e.split("/"),r=n.indexOf("assignments"),s=n.slice(r-2).join("/"),a=n[n.length-1],o=Ug(Ge,{assignmentID:a});return{routeEndpoint:o?.restApi,requestType:o?.reqType,payload:{assignmentID:a},options:t,routeKey:Je,urlPath:s}})(e,t):Ap.getEndPointInfo(e),Pg="add",Rg="replace",Dg=["portal","noPortal","preview","debug","devtool"];let bg="",Og="Home",vg="",xg=!0;const wg=e=>(xg=e,xg),Mg=()=>xg,Lg=(e,t,n)=>Ap.getSemanticURL(e,t,n),Ug=(e,t)=>Ap.getRestEndPoint(e,t),Fg=(e,t)=>{let n=E();const r=Ug(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):{}},jg=(e,t,n)=>{const{root:r,resources:s}=e,{views:a}=s,{config:o}=r,i=Pg;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(pp);if(l){const e=wh.getIn(t,o.context);c=c.replace(l[0],e.pyID)}return c.startsWith("/")&&(c=c.substring(1,c.length)),{pxURLPath:c,historyAction:i}},Vg=(e,t,n)=>{let r,s;r=gp(t)?`${e}/${t}`:e;const a=gp(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()!==Og.toLowerCase()||c.has("noPortal")||(r=`${e}/${t}`),!Ap.isDefaultPortal()){const e=Ap.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)&&Dg.includes(n)&&e.append(n,r);return e})(s,c),s.toString()&&(r+=`?${s.toString()}`),r},kg=(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&&hp(t.pxURLPath)?jg(n,r,t.pxURLPath):t||jg(n,r),o=Ap.getEndPointInfo(a.pxURLPath),a.pxURLPath=o.urlPath}const c=Vg(bg,Ap.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:Ap.getApplicationName()),n===`${bg}/${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]}`}})(vg,Ap.getApplicationPath(),c),u=((e,t)=>(void 0!==e&&(e.options=t),{stateObj:e}))(o,{...i,title:l});a.historyAction===Pg?((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===Rg&&((e,t,n)=>{try{window.history.replaceState(e,t,n)}catch(e){throw new Error("Error- Unable to Replace Browser History")}})(u,l,c)},$g=e=>{let t=null;e.directUrlUpdation&&(t={historyAction:Pg,pxURLPath:""},t.pxURLPath=e.semanticURL),kg(e,{urlPathObjParam:t,infoParam:null,optionsParam:null},!1)},Bg=e=>{$g(e)},Gg=e=>{const t={pxURLPath:e};return Vg(bg,Ap.getApplicationPath(),t)},Wg=e=>{const{uiResources:t}=e;Mg()&&(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))&&$g(e)},Hg=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},qg=(e,t,n)=>{const{caseClassName:r,workID:s}=e.payload,{containerName:a,context:o}=t,{RemoteClassGroup:i,RemoteSystemID:c,name:l}=$.getRemoteCase(r),d={...e,headers:{RemoteSystemID:c},className:r,isTraditionalRemoteCase:!0,action:mt,viewName:V,gadgetId:vc.getUniqueGadgetId(),context:n??o,skipSemanticUrl:!0,insKey:`${i?.toUpperCase()} ${s}`,containerName:a,name:l};mh(u.showPage(d))},Yg=e=>{const t=(e=>e.state?e.state.stateObj:null)(e);t&&($.isTraditionalRemoteCase(t.payload?.caseClassName)?qg({...t},t.options):mh(u.showHistory(Hg(t))))},zg=()=>Ap.getApplicationPath()!==mp(),Kg=e=>{const{acName:t,context:n,defaultViewLabel:r}=e,s=(e=>{const t=Ap.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=>{Og=e})(s),Ap.setDefaultRoute(s);const a=H(t,n),o=yt(t,n),i="true"===_p.getIsExtraCallRequiredForDefaultHome(),c={historyAction:Rg,pxURLPath:""};let l;const d={acName:o,context:a,actionConfig:{context:a}};if(i||!i&&zg()){const t=Tg(yp());l=Ng(t,d),c.pxURLPath=l.urlPath,void 0!==l.payload?.pageClass&&(l.payload.pageClass=fh()?.getState()?.data?.app?.pyPortal?.classID);const n="showHistory",r={routeEndpoint:l.routeEndpoint,requestType:l.requestType,payload:l.payload,options:d,routeKey:l.routeKey};$.isTraditionalRemoteCase(l?.payload?.caseClassName)?qg(r,e,d.context):mh(u[n](Hg(r)))}else l=Ap.getEndPointInfo(Og),c.pxURLPath="";kg(null,{urlPathObjParam:c,infoParam:l,optionsParam:d},!0)},Xg=(e,t=!1)=>{var n;bg=e.domain,!1===t&&Mg()&&(n=Yg,window.addEventListener("popstate",(e=>n(e))),window.onbeforeunload=()=>null),Ap.init(e,Og)},Jg=e=>{(e=>{window.document.title=e})(e)};function Qg(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 Zg=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),ef=()=>Math.random().toString(36).substring(7).split("").join("."),tf={INIT:`@@redux/INIT${ef()}`,REPLACE:`@@redux/REPLACE${ef()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${ef()}`};function nf(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 rf(e,t,n){if("function"!=typeof e)throw new Error(Qg(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(Qg(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(Qg(1));return n(rf)(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(Qg(3));return s}function d(e){if("function"!=typeof e)throw new Error(Qg(4));if(c)throw new Error(Qg(5));let t=!0;l();const n=i++;return o.set(n,e),function(){if(t){if(c)throw new Error(Qg(6));t=!1,l(),o.delete(n),a=null}}}function p(e){if(!nf(e))throw new Error(Qg(7));if(void 0===e.type)throw new Error(Qg(8));if("string"!=typeof e.type)throw new Error(Qg(17));if(c)throw new Error(Qg(9));try{c=!0,s=r(s,e)}finally{c=!1}return(a=o).forEach((e=>{e()})),e}p({type:tf.INIT});return{dispatch:p,subscribe:d,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error(Qg(10));r=e,p({type:tf.REPLACE})},[Zg]:function(){const e=d;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(Qg(11));function n(){const e=t;e.next&&e.next(u())}n();return{unsubscribe:e(n)}},[Zg](){return this}}}}}function sf(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:tf.INIT}))throw new Error(Qg(12));if(void 0===n(void 0,{type:tf.PROBE_UNKNOWN_ACTION()}))throw new Error(Qg(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(Qg(14))}o[i]=u,a=a||u!==l}return a=a||r.length!==Object.keys(e).length,a?o:e}}function af(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce(((e,t)=>(...n)=>e(t(...n))))}var of=function(e){function t(t,n){return e.call(this)||this}return co(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(So),cf={setInterval:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var s=cf.delegate;return(null==s?void 0:s.setInterval)?s.setInterval.apply(s,go([e,t],ho(n))):setInterval.apply(void 0,go([e,t],ho(n)))},clearInterval:function(e){var t=cf.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},lf=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 co(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),cf.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&&cf.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,Co(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(of),uf=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return co(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}(lf),df={now:function(){return(df.delegate||Date).now()},delegate:void 0},pf=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=df.now,e}(),hf=function(e){function t(t,n){void 0===n&&(n=pf.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r}return co(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}(pf),gf=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return co(t,e),t}(hf))(uf),ff=ao((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),mf=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 co(t,e),t.prototype.lift=function(e){var t=new yf(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new ff},t.prototype.next=function(e){var t=this;Mo((function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var s=po(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;Mo((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;Mo((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?To:(this.currentObservers=null,a.push(e),new So((function(){t.currentObservers=null,Co(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 qo;return e.source=this,e},t.create=function(e,t){return new yf(e,t)},t}(qo),yf=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return co(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:To},t}(mf),If=function(e,t){return If=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])},If(e,t)};Object.create;Object.create;var Ef=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 mf,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}If(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t}(qo);var Af=s(52),_f=Symbol.for("immer-nothing"),Cf=Symbol.for("immer-draftable"),Sf=Symbol.for("immer-state");function Tf(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Nf=Object.getPrototypeOf;function Pf(e){return!!e&&!!e[Sf]}function Rf(e){return!!e&&(bf(e)||Array.isArray(e)||!!e[Cf]||!!e.constructor?.[Cf]||Mf(e)||Lf(e))}var Df=Object.prototype.constructor.toString();function bf(e){if(!e||"object"!=typeof e)return!1;const t=Nf(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)===Df}function Of(e,t){0===vf(e)?Reflect.ownKeys(e).forEach((n=>{t(n,e[n],e)})):e.forEach(((n,r)=>t(r,n,e)))}function vf(e){const t=e[Sf];return t?t.type_:Array.isArray(e)?1:Mf(e)?2:Lf(e)?3:0}function xf(e,t){return 2===vf(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function wf(e,t,n){const r=vf(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function Mf(e){return e instanceof Map}function Lf(e){return e instanceof Set}function Uf(e){return e.copy_||e.base_}function Ff(e,t){if(Mf(e))return new Map(e);if(Lf(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=bf(e);if(!0===t||"class_only"===t&&!n){const t=Object.getOwnPropertyDescriptors(e);delete t[Sf];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(Nf(e),t)}{const t=Nf(e);if(null!==t&&n)return{...e};const r=Object.create(t);return Object.assign(r,e)}}function jf(e,t=!1){return kf(e)||Pf(e)||!Rf(e)||(vf(e)>1&&(e.set=e.add=e.clear=e.delete=Vf),Object.freeze(e),t&&Object.entries(e).forEach((([e,t])=>jf(t,!0)))),e}function Vf(){Tf(2)}function kf(e){return Object.isFrozen(e)}var $f,Bf={};function Gf(e){const t=Bf[e];return t||Tf(0),t}function Wf(){return $f}function Hf(e,t){t&&(Gf("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function qf(e){Yf(e),e.drafts_.forEach(Kf),e.drafts_=null}function Yf(e){e===$f&&($f=e.parent_)}function zf(e){return $f={drafts_:[],parent_:$f,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Kf(e){const t=e[Sf];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Xf(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[Sf].modified_&&(qf(t),Tf(4)),Rf(e)&&(e=Jf(t,e),t.parent_||Zf(t,e)),t.patches_&&Gf("Patches").generateReplacementPatches_(n[Sf].base_,e,t.patches_,t.inversePatches_)):e=Jf(t,n,[]),qf(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==_f?e:void 0}function Jf(e,t,n){if(kf(t))return t;const r=t[Sf];if(!r)return Of(t,((s,a)=>Qf(e,r,t,s,a,n))),t;if(r.scope_!==e)return t;if(!r.modified_)return Zf(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),Of(s,((s,o)=>Qf(e,r,t,s,o,n,a))),Zf(e,t,!1),n&&e.patches_&&Gf("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function Qf(e,t,n,r,s,a,o){if(Pf(s)){const o=Jf(e,s,a&&t&&3!==t.type_&&!xf(t.assigned_,r)?a.concat(r):void 0);if(wf(n,r,o),!Pf(o))return;e.canAutoFreeze_=!1}else o&&n.add(s);if(Rf(s)&&!kf(s)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Jf(e,s),t&&t.scope_.parent_||"symbol"==typeof r||!Object.prototype.propertyIsEnumerable.call(n,r)||Zf(e,s)}}function Zf(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&jf(t,n)}var em={get(e,t){if(t===Sf)return e;const n=Uf(e);if(!xf(n,t))return function(e,t,n){const r=rm(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_||!Rf(r)?r:r===nm(e.base_,t)?(am(e),e.copy_[t]=om(r,e)):r},has:(e,t)=>t in Uf(e),ownKeys:e=>Reflect.ownKeys(Uf(e)),set(e,t,n){const r=rm(Uf(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=nm(Uf(e),t),o=r?.[Sf];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||xf(e.base_,t)))return!0;am(e),sm(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!==nm(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,am(e),sm(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=Uf(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty(){Tf(11)},getPrototypeOf:e=>Nf(e.base_),setPrototypeOf(){Tf(12)}},tm={};function nm(e,t){const n=e[Sf];return(n?Uf(n):e)[t]}function rm(e,t){if(!(t in e))return;let n=Nf(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=Nf(n)}}function sm(e){e.modified_||(e.modified_=!0,e.parent_&&sm(e.parent_))}function am(e){e.copy_||(e.copy_=Ff(e.base_,e.scope_.immer_.useStrictShallowCopy_))}Of(em,((e,t)=>{tm[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),tm.deleteProperty=function(e,t){return tm.set.call(this,e,t,void 0)},tm.set=function(e,t,n){return em.set.call(this,e[0],t,n,e[0])};function om(e,t){const n=Mf(e)?Gf("MapSet").proxyMap_(e,t):Lf(e)?Gf("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:Wf(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let s=r,a=em;n&&(s=[r],a=tm);const{revoke:o,proxy:i}=Proxy.revocable(s,a);return r.draft_=i,r.revoke_=o,i}(e,t);return(t?t.scope_:Wf()).drafts_.push(n),n}function im(e){if(!Rf(e)||kf(e))return e;const t=e[Sf];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Ff(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Ff(e,!0);return Of(n,((e,t)=>{wf(n,e,im(t))})),t&&(t.finalized_=!1),n}var cm=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&&Tf(6),void 0!==n&&"function"!=typeof n&&Tf(7),Rf(e)){const s=zf(this),a=om(e,void 0);let o=!0;try{r=t(a),o=!1}finally{o?qf(s):Yf(s)}return Hf(s,n),Xf(r,s)}if(!e||"object"!=typeof e){if(r=t(e),void 0===r&&(r=e),r===_f&&(r=void 0),this.autoFreeze_&&jf(r,!0),n){const t=[],s=[];Gf("Patches").generateReplacementPatches_(e,r,t,s),n(t,s)}return r}Tf(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){Rf(e)||Tf(8),Pf(e)&&(e=function(e){Pf(e)||Tf(10);return im(e)}(e));const t=zf(this),n=om(e,void 0);return n[Sf].isManual_=!0,Yf(t),n}finishDraft(e,t){const n=e&&e[Sf];n&&n.isManual_||Tf(9);const{scope_:r}=n;return Hf(r,t),Xf(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=Gf("Patches").applyPatches_;return Pf(e)?r(e,t):this.produce(e,(e=>r(e,t)))}},lm=cm.produce;cm.produceWithPatches.bind(cm),cm.setAutoFreeze.bind(cm),cm.setUseStrictShallowCopy.bind(cm),cm.applyPatches.bind(cm),cm.createDraft.bind(cm),cm.finishDraft.bind(cm);const um=(e,t)=>{const{data:{shared:n={}}={},context:r}=t;((e,t)=>{Tu.updateDataPageStore(t),Object.keys(t).forEach((n=>{wh.getIn(e,[j.SHARED,n])?Object.keys(t[n]).forEach((r=>{wh.setIn(e,[j.SHARED,n,r],t[n][r])})):wh.setIn(e,[j.SHARED,n],t[n])}))})(e,n),r&&wh.deleteIn(e,[r,"shared"])},dm=(e,t,n=!1)=>{const{context:r,caseViewMode:s=(n?void 0:j.PERFORM_MODE),containerName:a}=t;a!==dd.WORKAREA&&s&&wh.setIn(e,[r,"context_data","caseViewMode"],s)},pm=(e,t)=>{const{context:n}=t;wh.setIn(e,[n,"context_data","actionType"],t.actionType),wh.setIn(e,[n,"context_data","assignmentID"],t.assignmentID)},hm=(e,t=[])=>{t.forEach((t=>wh.deleteIn(e,t)))},gm=(e,t=[])=>{t.forEach((t=>wh.deleteIn(e,t)))},fm=(e,t=[])=>{t.forEach((t=>{wh.deleteIn(e,t)}))},mm=(e,t,n={})=>{const{deleteAssignmentSpecificResources:r=!0,doDeleteConfirmationDetails:s=!0}=n;wh.deleteIn(e,[t,"nextAssignmentInfo"]),wh.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"availableActions"]),wh.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"availableProcesses"]),wh.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"activeActionID"]),wh.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"assignments"]),wh.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"childCases"]),s&&(wh.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"confirmationLinks"]),wh.deleteIn(e,[t,"caseMessages"])),r&&(wh.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"actionButtons"]),wh.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"navigation"]))},ym=(e,t)=>lm(e||{},(e=>{switch(t.type){case Ce:{if(!t.payload.data||e[t.payload.context])return e;t.payload.doDeleteCaseSummary&&mm(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,dm(e,t.payload),pm(e,t.payload),um(e,t.payload),((e,t)=>{const{context:n}=t;wh.deleteIn(e,[n,"context_data","blocking_action_counter"]),wh.deleteIn(e,[n,"context_data","deferred_action_queue"])})(e,t.payload),e}case xe:{t.payload.doDeleteCaseSummary&&mm(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]=Rh(e[t.payload.containerItemID],t.payload.data,{propertiesToReplace:[...r]}):e[t.payload.context]=Rh(e[t.payload.context],t.payload.data,{propertiesToReplace:[...r]}),(t.payload.actionType||t.payload.assignmentID)&&pm(e,t.payload),dm(e,t.payload),um(e,t.payload),gm(e,t.payload.suggestionContexts),e}case Se:{const{childContainersContexts:n=[]}=t.payload;return((e,t)=>{const{containerItemID:n,context:r,deleteContext:s}=t;s&&wh.deleteIn(e,[r]),wh.deleteIn(e,[n])})(e,t.payload),fm(e,n),hm(e,t.payload.transientItems),gm(e,t.payload.suggestionContexts),e}case _e:{const{containerItems:n}=t.payload;return Array.isArray(n)?n.forEach((t=>{wh.deleteIn(e,[t])})):wh.deleteIn(e,[n]),e}case we:{const{context:n,contextToBeRemoved:r,data:s,childContainersContextsToBeRemoved:a}=t.payload;return mm(e,t.payload.context),dm(e,t.payload),e[n]=Rh(e[n],e[r]),e[n]=Rh(e[n],s),wh.deleteIn(e,[r]),fm(e,a),um(e,t.payload),e}case Me:{const{payload:{context:n,pulseReplace:r=!0,childContainersContexts:s=[]}}=t;let{payload:{data:a}}=t;const o=wh.getIn(e[n],"pulse");let i=wh.getIn(e[n],"OperatorID"),c=wh.getIn(e[n],"pxRequestor");return c&&a.pxRequestor&&(c=wh.mergeDeep(c,a.pxRequestor)),i&&a.OperatorID&&(i=wh.mergeDeep(i,a.OperatorID)),!r&&o&&(a=Dh(a,"pulse",o),a=Dh(a,"OperatorID",i),a=Dh(a,"pxRequestor",c)),wh.setIn(e,n,a),dm(e,t.payload),um(e,t.payload),fm(e,s),hm(e,t.payload.transientItems),gm(e,t.payload.suggestionContexts),e}case at:{const{context:n,doDeleteConfirmationDetails:r=!0}=t.payload;return mm(e,n,{doDeleteConfirmationDetails:r}),e}case Te:{const{transientItemID:n,data:r}=t.payload;return wh.setIn(e,n,r)}case Pe:case Re:{const{transientItems:n}=t.payload;return n.forEach((t=>wh.deleteIn(e,t))),e}case Ne:case De:{const{transientItemID:n,data:r}=t.payload;return Rh(wh.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)&&wh.deleteIn(e,[n,t]);return e}case Oe:{const{transientItemID:n,data:r}=t.payload;return wh.deleteIn(e,n),wh.setIn(e,n,r)}case ce:{const{key:n,value:r}=t.payload;return wh.setIn(e,`${j.SHARED}.${n}`,r),e}case Fe:{const{context:n,data:r}=t.payload;return wh.setIn(e,n,r)}default:return e}})),Im=(e,t)=>lm(e,(e=>{switch(t.type){case fe:{const{propertiesToReplace:n=[],interestPath:r}=t.payload;if(r){const s=wh.getIn(e[t.payload.context],r),a=wh.getIn(t.payload.data,r),o=Rh(s,a,{isArrayDeepMerge:!0});Ph(e[t.payload.context],[...n]),wh.setIn(e[t.payload.context],r,o)}else e[t.payload.context]=Rh(e[t.payload.context],t.payload.data,{isArrayDeepMerge:t.payload.isArrayDeepMerge,propertiesToReplace:[...n]});return dm(e,t.payload,!0),um(e,t.payload),e}case Q:{const{context:n,reference:r,value:s,isArrayDeepMerge:a}=t.payload;return Dh(e[n],r,s,{isArrayDeepMerge:a}),e}case Z:{const{context:n,reference:r,value:s}=t.payload;return bh(e[n],r,s),e}case me:return Th(e[t.payload.context],t.payload.reference),e;case oe:return wh.setIn(e[t.payload.context],"context_data.isLoading",!0),e;case ie:return wh.setIn(e[t.payload.context],"context_data.isLoading",!1),e;case nt:{const{data:n}=t.payload;return um(e,{data:{shared:n}}),e}case rt:{const{dataPagesToBeRemoved:n=[]}=t.payload;return n.forEach((t=>{const{dataPageName:n,dataPageNameWithHash:r}=t;wh.deleteIn(e.shared,[n,r]);const s=wh.getIn(e.shared,[n]);s&&0===Object.keys(s).length&&wh.deleteIn(e.shared,[n])})),e}case ot:{const n=wh.getIn(e[t.payload.context].context_data,"blocking_action_counter",0);return t.payload.isInitiateBlockingAction?wh.setIn(e[t.payload.context].context_data,"blocking_action_counter",n+1):wh.setIn(e[t.payload.context].context_data,"blocking_action_counter",n-1),e}default:return e}})),Em=/\[(\d+)\]$/gi,Am=/(\d+)/gi,_m=/\[.\]$/gi,Cm=(e,t,n,r=[j.CONTEXT_DATA,j.CASE_INFO.CASE_INFO,j.CONTENT])=>{const s=wh.getIn(t,r);if(s){const t=Xn(s,[],[]);for(const s of t)wh.setIn(e[n],[...r,...s],{})}},Sm=(e,t,n,r)=>{const{property:s,pageReference:a,category:o,type:i}=r.payload,c=wh.getIn(e[t],n);if(c&&o===j.CASEMESSAGES)wh.setIn(e[t],Gn(s,a,o),"");else if(c&&c.length>0&&Array.isArray(c)){const r=c.filter((e=>e.type!==i));n&&n.length>0&&wh.setIn(e[t],Gn(s,a,o),r)}},Tm=(e,t)=>{const{property:n,pageReference:r,category:s,isListEntry:a,deletingIndex:o,stateObj:i}=t.payload,{context:c}=t.payload;if(i)return Cm(e,i,c),e;const l=Gn(n,r,s,a);if(Number.isInteger(o)){wh.deleteIn(e[c],l);const t=l.slice(0,l.length-1);let n=wh.getIn(e[c],t)||{};const r=(u=Object.keys(n),[...u].sort(((e,t)=>{const n=e.match(Em),r=t.match(Em);if(!n&&!r)return e.localeCompare(t);if(!n&&r)return-1;if(n?.length&&r?.length){const e=n[0].match(Am),t=r[0].match(Am);if(e?.length&&t?.length)return parseInt(e[0],10)-parseInt(t[0],10)}return 1})));n=r.map((e=>n[e])),n.forEach(((n,s)=>{const a=r[s].match(Em);if(a?.length){const i=parseInt(a[0].match(Am)[0],10);i>o&&(wh.deleteIn(e[c],t.concat(r[s])),wh.setIn(e[c],t.concat(r[s].replace(_m,`[${i-1}]`)),n))}}))}else wh.setIn(e[c],l,{});var u;return e};function Nm(e,t){const n=wh.getIn(e,t);return void 0!==n?.dataInfo?.content}function Pm(e,t){let n=Bn.FIELD_MESSAGES_PATH;return Nm(e,t)&&(n=Bn.DATA_OBJECT_FIELD_MESSAGES_PATH),n}const Rm=(e,t,n)=>{n.forEach((n=>{((e,t,n)=>{const r=wh.getIn(n,j.ERROR_FIELD_IN_PAGE).slice(1),s=wh.getIn(n,j.ERROR_IN_PAGE_IDENTIFIER).slice(1);if(s){let a="caseInfo.content";Nm(e,t)&&(a="dataInfo.content");let o=r?`${a}.${r}`:a;o=o.replace(/\(/g,"[").replace(/\)/g,"]");const i=Gn(s,o,j.PROPERTY),c=wh.getIn(e[t],`${o}.classID`),l=Gp(s,c),u=PCore.getLocaleUtils(),d=`${l?.definedOnClassID||l?.classID}.${s}`,p={type:F.MESSAGES.MESSAGES_TYPE_ERROR,message:n.localizedValue,...l?.label&&{fieldLabel:u.getLocaleValue(l.label,d,u.FIELD_LABELS_BUNDLE_KEY)}},h=wh.getIn(e[t],i,[]);if(wh.isContains(h,p))return;wh.setIn(e[t],i,[...h,p])}})(e,t,n)}))};function Dm(e,t){const{err:n,formFields:r}=t.payload;let{context:s}=t.payload;const{fieldErrors:a,pageErrors:o}=$c(n.errorDetails,r),i=Pm(e,s);if(wh.setIn(e,[s,...i],{}),wh.setIn(e,[s,...Bn.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=Gn(r,t,j.PROPERTY);wh.setIn(e,[s,...a],[])}}})),a.length>0&&Rm(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),wh.setIn(e,[s,...Bn.PAGE_MESSAGES_PATH],t)}else s.includes&&s.includes(dd.WORKAREA)&&(s=W(s)),wh.deleteIn(e,[s,...Bn.PAGE_MESSAGES_PATH]);return e}const bm=(e,t)=>lm(e||Fm().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)?Dm(e,t):e;case xe:{const{context:n}=t.payload,r=[n,...Pm(e,n)],s=[n,...Bn.PAGE_MESSAGES_PATH];if(wh.setIn(e,r,{}),wh.setIn(e,s,[]),n&&n.includes(dd.WORKAREA)){const t=[X(n),...Bn.PAGE_MESSAGES_PATH];wh.setIn(e,t,[])}return e}case Ze:{const{isListEntry:n}=t.payload;return n?Tm(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 Cm(e,o,i),e;const l=Gn(n,r,s,a);return s===j.PAGE&&i?.includes(dd.WORKAREA)&&(c=W(i)),Sm(e,c,l,t),Sm(e,i,l,t),e})(e,t)}case Qe:{const{messages:n,property:r,pageReference:s,context:a,category:o}=t.payload,i=Gn(r,s,o);return n&&n.length>0&&Array.isArray(n)&&i&&i.length>0&&wh.setIn(e[a],Gn(r,s,o),n),e}default:return e}})),Om=(e,t)=>lm(e,(e=>{if(t.type===st){const{instruction:n,actions:r,context:s,referenceList:a,listIndex:o,listMoveToIndex:i,content:c={}}=t.payload,l=hh(a);switch(n){case j.LIST_ACTIONS.INSERT:((e,t,n,r,s)=>{wh.setIn(e[t],[...n,r],s)})(e,s,l,o,c);break;case j.LIST_ACTIONS.UPDATE:((e,t,n,r,s)=>{const a=Rh(wh.getIn(e[t],[...n,r],{}),s);wh.setIn(e[t],[...n,r],a)})(e,s,l,o,c);break;case j.LIST_ACTIONS.DELETE:((e,t,n,r)=>{const s=wh.getIn(e[t],n,[]);s.splice(r,1),wh.setIn(e[t],n,s),Rn.deleteListNode(t,n,s.length)})(e,s,l,o);break;case j.LIST_ACTIONS.MOVE:((e,t,n,r,s)=>{const a=wh.getIn(e[t],[...n,r],{}),o=wh.getIn(e[t],n,[]);o.splice(r,1),o.splice(s,0,a),wh.setIn(e[t],n,o),qn(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=wh.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(".");fr(t,e)}else delete s[o]})),wh.setIn(e[t],n,s.filter(Boolean))})(e,s,l,r);break;case j.LIST_ACTIONS_TYPE.DESELECT_ALL:((e,t,n)=>{wh.setIn(e[t],n,[])})(e,s,l)}}return e})),vm=[Im,ym,bm,Om],xm=(e,t)=>(e||(e=Fm().data),t.type===et?Fm().data:(vm.forEach((n=>{e=n(e,t)})),e)),wm=(e,t=[])=>{t.forEach((t=>{wh.deleteIn(e,[t])}))},Mm=(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?wh.setIn(e,[a,"items",l,"view"],c):g&&wh.deleteIn(e,[a,"items",l,"view"]),o&&wh.setIn(e,[a,"items",l,"context"],o),d&&wh.setIn(e,[a,"items",l,"flowName"],d),(!s||s&&h)&&wh.setIn(e,[a,"items",l,"key"],h.trim()),((e,t,n,r)=>{""===e&&wh.deleteIn(t,[n,"items",r,"key"])})(h,e,a,l),(!s||s&&i)&&wh.setIn(e,[a,"items",l,"semanticURL"],i),(!s||s&&p)&&wh.setIn(e,[a,"items",l,"resourceType"],p),wm(e,u),e},Lm=(e,t)=>(e||(e=Fm().containers),t.type===et?Fm().containers:lm(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 un.resolveActionByID(a,null,!1),e[o]?e:(i={type:s,accessedOrder:[],items:{}},wh.setIn(e,[o],i),e)}case Ue:{const{containerName:n,childContainers:r=[]}=t.payload;return wh.deleteIn(e,[n]),r.forEach((t=>{wh.deleteIn(e,[t])})),e}case _e:{const{context:n,name:r,actionMgrID:s,childContainers:a}=t.payload,o=`${n}/${r}`;return un.resolveActionByID(s,null,!1),wh.setIn(e,[o,"accessedOrder"],[]),wh.setIn(e,[o,"items"],{}),Array.isArray(a)&&a.forEach((t=>{wh.deleteIn(e,[t])})),e}case Ce:{const{target:n,context:r,isInCreateStage:s,isBulkAction:a,semanticURL:o,root:i,containerItemID:c,actionMgrID:l,key:u,flowName:d,resourceType:p,actionName:h,isMinimizable:g,showProgress:f,progressMessage:m,modalOptions:y,resourceStatus:I,actionID:E,isMultiRecordData:A,acTertiary:_,parentContext:C,heading:S,isTraditionalRemoteCase:T}=t.payload,N=e[n],P=N&&N.type,R=N&&N.accessedOrder||[],D=N&&N.items||{};let b=null;return e[n]&&"single"===P&&R.length>0?Mm(e,t):(b={accessedOrder:[...R,c],items:{...D,[c]:{view:i,semanticURL:o,key:u,flowName:d,context:r,isInCreateStage:s,resourceType:p,actionName:h,isMinimizable:g,...a&&{isBulkAction:a},showProgress:f,progressMessage:m,modalOptions:y,isTraditionalRemoteCase:T,resourceStatus:I,...E&&{actionID:E},..._&&{acTertiary:_},...A&&{isMultiRecordData:A},...C&&{parentContext:C},heading:S}}},un.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=Mm(e,t),un.resolveActionByID(n,r,!1)}catch{un.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],wh.setIn(e,[s,"items",a,"transientItems"],[]),wh.setIn(e,[s,"accessedOrder"],c),o=Mm(e,t),un.resolveActionByID(n,r,!1)}catch{un.rejectActionByID(n,!1)}return o})(e,t);case ve:{const{target:n,containerItemID:r,actionMgrID:s}=t.payload;try{const t=wh.getIn(e,[n,"accessedOrder"]).filter((e=>e!==r));t.push(r),wh.setIn(e,[n,"accessedOrder"],t),un.resolveActionByID(s,null,!1)}catch{un.rejectActionByID(s,!1)}return e}case we:case Se:{const{target:n,containerItemID:r,actionMgrID:s,childContainers:a}=t.payload;try{const t=wh.getIn(e,[n,"accessedOrder"]).filter((e=>e!==r));wh.setIn(e,[n,"accessedOrder"],t),wh.deleteIn(e,[n,"items",r]),wm(e,a),un.resolveActionByID(s,null,!1)}catch{un.rejectActionByID(s,!1)}return e}case Te:{const{transientItemID:n,target:r,contextName:s}=t.payload,a=wh.getIn(e,[r,"items",s,"transientItems"])??[];return wh.setIn(e,[r,"items",s,"transientItems"],[...a,n])}case Re:{const{target:n,containerItemID:r}=t.payload;return wh.deleteIn(e,[n,"items",r,"transientItems"]),e}case Pe:{const{target:n,transientItemID:r,containerItemID:s}=t.payload,a=(wh.getIn(e,[n,"items",s,"transientItems"])??[]).filter((e=>e!==r));return wh.setIn(e,[n,"items",s,"transientItems"],a)}default:return e}})));let Um={};const Fm=()=>Um,jm=e=>((e=>{const t=e.Data||e.data,{uiResources:n={}}=e,r=n[j.CONTEXT_DATA]||e[j.CONTEXT_DATA];Um={data:{[j.APP.APP]:{...t,[j.CONTEXT_DATA]:r}},containers:{}}})(e),sf({data:xm,containers:Lm}));function Vm(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=eu(e),r=function(e,t){return"number"==typeof Zl(e)?e.pop():t}(e,1/0),s=e;return s.length?1===s.length?ti(s[0]):function(e){return void 0===e&&(e=1/0),Jl(Wo,e)}(r)(di(s,n)):ru}const km=(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}},$m=(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 km(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 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,km(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},Bm={},{VIEW:Gm,FIELD:Wm}=j.CONTEXT_TREE_NODE_TYPES,Hm=e=>(e=>xi[e])(e)>0&&Bm[e],qm=[(e,t)=>e.pipe(zl(Dn.REFRESH_DATA,ft),Xl((e=>e.payload)),Jl((e=>{const{context:n,contextData:r,options:s}=e,{propertyName:a="",classID:o=""}=s,i=Uc(n,{skipUUID:!1});let c=[],l=[],u=!1;_p.getFeatureMap().granularUIRefresh?(({fieldsWithDeclarativeTargets:c=[],whens:l=[]}=Vn(n)),u=l.some((e=>e.type===Gm))):u=!0;const d=l.filter((e=>e.type===Wm)),p=wh.getPropertyName(a),h=p?p.split("."):[],g=h.pop(),f=h.join("."),m=[];if(f){const e=Gp(f,o);if(e&&"copy"===e.dataRetrievalType){const e=wh.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=tl(n);wh.isEmpty(I)||(y=el(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=Fg(Dn.REFRESH_CASE_VIEW,e),d={...d,interestPage:i}):o&&n?l=Fg(Dn.REFRESH_CASE_DATA,e):o&&!n?l=Fg(Dn.REFRESH_ASSIGNMENT_DATA,e):(s.length>0||a.length>0)&&(d={...d,calculations:{fields:s,whens:a}},l=Fg(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);Vu.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 di(((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(t.interestPage&&(e.interestPage=t.interestPage),Hm(r)){const t=[];for(let n=0;n<Bm[r].length;){const s=Bm[r][n],a=kn(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=>{Bm[r].splice(e,1)}))}const s=Gi();return e.signal=s.token,e.cancelConfig=s,Bm[r]?Bm[r].push(e):Bm[r]=[e],ki(e.url,e,n,{cancelContext:r}).then((e=>(delete Bm[r],e))).catch((e=>{throw e&&"ERR_CANCELED"!==e.code&&delete Bm[r],e}))})({reqHeaders:N,context:n,method:S,body:_,url:jn(e,T)},e)).pipe(Xl((t=>({response:{...t.data||{}},actionConfig:e,actionMgrID:e.options.actionMgrID,headers:Lc(t.headers)}))),au(": Error occurred during fetch call at refreshData Epic : ",e.context,e?.options?.actionMgrID))})),Jl((async e=>{if(e&&e.type===Ee)return Vu.deRegisterBlockingAction(e.payload?.context).catch((()=>{})),Bc(e);const{actionConfig:t,response:n,actionMgrID:r}=e,{context:s,serverPrecedenceFields:a,requestType:o}=t,i=ic.getTargetViewContainerName(je),c=yt(i,s),l={acName:c,context:s},u=$m(n,{[F.STOPMERGEACTIONS]:!0,[F.ACTIONS.DELETEAVIALACTIONS]:!0});u.directUrlUpdation=!1,o===Dn.REFRESH&&await jc(u,t,l);const d={target:c,context:s};let p=sl.getStateMachinesByContext(s)||{};const h=Fc(u,d);t.interestPage&&(h.interestPath=`caseInfo.content${wh.convertClipboardPageToPageRefNotation(t.interestPage)}`),p={...p,...sl.getUnConnectedStateMachines(s)||{}},Object.keys(p).forEach((e=>{if(wh.hasIn(h.data,e)){const t=wh.getIn(h.data,e),n=Ah(e,void 0,s),r=Rn.getContextReferences(s)?.get(e);((e,t,n,r,s)=>Array.isArray(e)&&Array.isArray(t)&&t.length!==e.length&&"Multiselect"!==n&&(!r.interestPath||s.startsWith(r.interestPath)))(t,n,r?.props?.componentName,h,e)&&sl.setStateMachineEmpty(s,e)}})),t.options?.skipDataMerge&&h.data?.caseInfo?.content&&(h.data.caseInfo.content={}),h.preserveClientChanges=void 0===t.options.preserveClientChanges||t.options.preserveClientChanges;const g=vc.getPropertiesToReplace(s),f=mg(Gh,h,{serverPrecedenceFields:a,propertiesToReplace:g});return sl.registerForServerChanges(),mh(f),un.resolveActionByID(r,h),sl.unRegisterForServerChanges(),Vu.deRegisterBlockingAction(s).catch((()=>{})),[]})))],Ym=qm,zm=[e=>e.pipe(zl(tt),Jl((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=Ih()[a.name];if(n&&s in n){const r=n[s],{loadTime:a}=r;if(!gu.isTimeElapsed(a,e,t))return}}return gu.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(Gh({context:t,data:n})),Object.keys(r).length&&a.push(Ig({data:r,context:t})),mh(a),[]})))],Km=zm;class Xm{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 Xm.DISPLAY_DIRTY_POPUP:this.broadcastEventToIframe=e.data.fromInfinity,this.isDirtyDialogActive||(e.data.isFormDirty?(fi.publish(j.PUB_SUB_EVENTS.EVENT_SHOW_CANCEL_ALERT,{isModalAction:!0,hideDelete:!0}),this.isDirtyDialogActive=!0):this.callback?.call(this));break;case Xm.LOAD_PREVIEW:this.loadPreview(e);break;case Xm.UPDATE_COEXISTENCE_DRILLDOWN_CASE:this.updateCoexistenceDrilldownCase(e);break;case Xm.OPEN_ASSIGNMENT_ACTION:this.openAssignment(e);break;case Xm.GET_NEXT_WORK_ACTION:this.getNextWork(e);break;case Xm.OPEN_WORK_BY_HANDLE:this.openWorkByHandle(e);break;case Xm.CLOSE_CONTAINER_ACTION:this.closeContainer(e)}}};loadPreview=e=>{const{pyID:t,caseClassName:n,uniqueId:r}=e.data;if(r===this.getUniqueId()){od({}).getPConnect().getActionsApi().showCasePreview(t,{caseClassName:n})}};navigateToDefaultPage=()=>{const e=od({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===Xm.OPEN_WORK_ITEM&&(a=Xm.OPEN_WORK_BY_HANDLE),Ap.updateSemanticURLAndDocumentTitle({key:t,caseClassName:n,actionName:a});od({}).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}`;od({meta:{},options:{context:Dd(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}`;od({meta:{},options:{context:Dd(e)}}).getPConnect().getActionsApi().openWorkByHandle(t,n)}};destroyBroadcastChannel=()=>{this.getBroadCastChannel()?.close(),this.broadcastChannel=null};subscribeEvents=()=>{this.setReverseCoexistenceCaseLoaded(!0),fi.subscribe(F.PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.HANDLE_DISCARD,this.handleDiscard),fi.subscribe(F.PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.CHECK_IS_FORM_DIRTY,this.postDirtyPopupMessage)};unsubscribeEvents=()=>{fi.unsubscribeAllWithEventType(F.PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.CHECK_IS_FORM_DIRTY),fi.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:Xm.DIRTY_POPUP_C11N,uniqueId:this.getUniqueId()}),this.setCallBackFunction(e)};handleDiscard=()=>{this.broadcastEventToIframe?(this.broadcastChannel?.postMessage({action:Xm.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:Xm.OPEN_ASSIGNMENT_MODAL,uniqueId:this.getUniqueId(),key:e}),this.broadcastEventToIframe=!1,this.onCreateCallback=t,this.openAssignmentParams=n}}const Jm=new Xm,Qm="nextAssignmentInfo",Zm="nextAssignmentInfo.context",ey=e=>{const{containerName:t,isInCreateStage:n}=e;return n?j.MODAL:t||ic.getTargetViewContainerName(We)},ty=e=>{const t=wh.getIn(e,[j.DATA,j.CASE_INFO.CASE_INFO]);return en(t)&&tn(_p.getOperatorIdentifier(),t)},ny=(e,t)=>{const{class:n,context:r,viewType:s=wc.PAGE}=e,{removeActionPayload:a}=t;let o=e?.pageName?e?.pageName:_p.getDefaultCasePage();return e.isTraditionalUICase&&(o="pyDetails"),di(Xi.createCase(n,{...e,pageName:o,viewType:s,context:r})).pipe(Xl((({response:t,headers:n})=>({response:t,actionInPayload:e,headers:n,removeActionPayload:a}))),au("Error occurred during ajax call at createWork Epic : ",r))},ry=e=>{fi.publish(j.PUB_SUB_EVENTS.DISPLAY_CASE_CREATED_TOASTER,e)},sy=e=>{fi.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_DONE,e)},ay=e=>{let t=0,n=[],r="",s=!1;return e.pipe(zl(kh),ou(100),Xl((e=>(({actionMgrID:t}=e.payload),e.payload))),Jl((e=>{const{context:n}=e,r=ey(e),a=yt(r,n),{continueExecution:o,removeActionPayload:i}=(e=>wd(e)?{continueExecution:!0,removeActionPayload:{}}:Yc(e))(a);return s=Rc(e.class),o?(e.isTraditionalUICase=s,ny(e,{removeActionPayload:i})):(un.rejectActionByID(t),su())})),Jl((async e=>{if(e&&e.type===Ee)return e.payload.context=rp(),n.push(Bc(e)),n;const{actionInPayload:a,response:o,headers:i,removeActionPayload:c}=e;let l;l=!(a.renderInline||_p.getDefaultCasePage()||s)&&ty(o),wh.setIn(o.data,F.CASE_INFO.IS_FIRST_ASSIGNMENT,!0);const u=ey({...a,isInCreateStage:l}),d=yt(u,a.context),p=Wc(d,u,a.context);if(!hc(u)&&wd(d)){const{continueExecution:e}=Yc(d);if(!e)return un.rejectActionByID(t),su()}if(!(a?.openCaseViewAfterCreate??!0)&&!l){const e=wh.getIn(o.data,F.CASE_INFO.CASE_INFO_CONTENT);r=`${e.pyID} ${Tp.getLocaleValue("has been created.","Assignment")}`;const t=_c(o),s=Ic(o);return ry({toastMessage:r}),sy({caseId:`${e.pyID}`,assignmentId:t,caseType:s}),n}const h=$m(o);let g=Lg("createWork",{caseClassName:Ic(h)});g=g.replace(/{.+?}/,String(yc(Ac(h)))),h.semanticURL=g,((e,t)=>{const n=ty(e),{skipBrowserSemanticUrlUpdate:r=!1,isTraditionalUICase:s}=t;wh.setIn(e,["directUrlUpdation"],(!n||s)&&!r)})(h,a);const f={acName:d,context:p},m=Oc(p);await jc(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:wh.getIn(h,Zm),nextAssignmentInfo:wh.getIn(h,Qm),resourceType:F.CASE,openCaseViewAfterCreate:a.openCaseViewAfterCreate,modalOptions:a.modalOptions,debugInfo:a.debugInfo};Tc(y,h);const I=Fc(h,y);s&&(I.data.caseInfo.content.coexistenceAction="openAssignment");const E=Gc(d,I);return Hc(E)&&Cc(n,{removeActionPayload:c,target:d}),n.push(E),Xc(n),n})),Xl((()=>{const e=Dc(),a=en(wh.getIn(n[0]?.payload,"data.caseInfo"));return s&&e&&a?Jm.postCreateCaseMessage(n[0]?.payload?.nextAssignmentInfo?.ID,Zc,n):Zc(n),Pc(n,t),r="",n=[],n})))},{RESOURCE_TYPES:oy}=F,iy=(e,t=[])=>{const{viewType:n,containerName:r,targetContainerName:s,isChild:a}=e,o=mc(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?wc.PAGE:n||(!pc(r)&&!pc(s)||a?wc.PAGE:wc.FORM)},cy=(e,t,n,r,s)=>{if(Cc(e,{removeActionPayload:t,target:n}),((e,t)=>{const n=Td(t);let r=null;return n&&(r=gd(t,n)),r?.key===e&&Md(t)})(r.key,n))r.context=Dd(n),r.containerItemID=r.context,e.push(mg(pg,r));else if((s?.isChild||s?.isRemote)&&s?.isMultiDoc){const t=Bd(s.context);r.target=t,r.context=s.context,r.containerItemID=s.context,e.push(mg(pg,r))}else{const t=Bd(r.context),n=Ed(t,r.key);n?(r.target=t,r.context=n,r.containerItemID=n,e.push(mg(pg,r))):e.push(mg(Jh,r))}},ly=(e,t,n,r,s,a,o)=>{wd(t)&&Ld(t)?((e,t,n,r,s)=>{iy(e,t)===wc.FORM?(n.caseViewMode=r||j.PERFORM_MODE,s.push(mg(rg,n))):s.push(mg(pg,n))})(r,s,e,a,n):cy(n,o,t,e,r)},uy=({restUrl:e,reqType:t,requestHeaders:n,debugInfo:r,context:s,isGetNextWork:a,doNotMergeMessagesForStatusCode:o})=>ki(e,{method:t,headers:{"if-match":n&&n.etag,...n,...r&&{...Oi.addDebugHeaders(r)}}},s,{doNotMergeHttpMessagesForStatusCode:a?o:""}),dy=(e,t)=>{const n=iy(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?Fg("getNextWork",{viewType:n}):c?Fg("openStage",{caseID:u,stageID:l}):Fg(Ge,{assignmentID:a,viewType:n}),{removeActionPayload:f}=t,m=_p.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=Lc(t,e.remoteClassName)),t})(e);return di(uy({restUrl:y,reqType:g,requestHeaders:E,debugInfo:i,context:s,isGetNextWork:o,doNotMergeMessagesForStatusCode:"404"})).pipe(Xl((e=>{if(_p.isCoexistenceAppOfType(j.APP_TYPE.UIKIT)&&!p){return en(e.data.data.caseInfo)?e:(y=y.replaceAll(I,"pyDetails"),_p.setDefaultCasePage("pyDetails"),{isReloadWithDifferentViewTypeRequired:!0,restUrl:y})}return e})),Jl((e=>e?.isReloadWithDifferentViewTypeRequired?uy({restUrl:y,reqType:g,requestHeaders:E,debugInfo:i,context:s,isGetNextWork:o,doNotMergeMessagesForStatusCode:"404"}):tu(e))),Xl((t=>{const{key:s,flowName:o}=kc(a);return{response:{...t.data,key:s,flowName:o},actionInPayload:e,viewType:n,removeActionPayload:f,headers:Lc({...r,...t.headers})}})),au("Error occurred during ajax call at openAssignment Epic : ",s))},{RESOURCE_TYPES:py}=F,hy=e=>{const t="Browser"===_p.getRuntime();let n=0,r=[];const s=[];let a=!1,o=!1;return e.pipe(zl($l),Xl((e=>(({actionMgrID:n}=e.payload),{...e.payload,...t?{insKey:e.payload.assignmentID}:{assignmentID:e.payload.assignmentID}}))),Jl((e=>{a=e.isGetNextWork;const{context:t}=e;let r;r=(e?.isChild||e?.isRemote)&&e?.isMultiDoc?wc.FORM:iy(e),e.viewType=r;const s=uc(Ge,e),i=yt(s,t),{activate:c,activateContainerActionPayload:l}=Kc(py.ASSIGNMENT,i,e);if(c&&!e.isParallelCall)return tu({type:ve,activateContainerActionPayload:l,actionInPayload:e});const u=Td(i);let d;d=l?.isParallelAssignment?{continueExecution:!0,removeActionPayload:{}}:u?Yc(i):{continueExecution:!0,removeActionPayload:{}};const{continueExecution:p,removeActionPayload:h}=d;return p?(o=Rc(e.className),e.isTraditionalUICase=o,dy(e,{removeActionPayload:h})):(un.rejectActionByID(n),su())})),Jl((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(Bc(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=$l,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=mc(e);let r;r=!_p.getDefaultCasePage()&&en(n);const{isChild:s,containerName:a}=t,o=s&&r,i=r&&!t.isActionFromToDoList;return o||i?j.MODAL:a||uc(Ge,t)})(i,n);o=Rc(i?.data?.caseInfo?.caseTypeID),n.isTraditionalUICase=o,o&&(f=n.containerName);const m=yt(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=Rd(s);await jc({directUrlUpdation:!l,semanticURL:r},c,{acName:i,target:i,context:u}),e.push(mg(ig,{containerItemID:s,target:i,isParallelAssignment:a,insKey:o,resourceType:oy.CASE,context:u,doDeleteCaseSummary:c.doDeleteCaseSummary}))})(r,d,{actionInPayload:n,target:m}),Xc(r),r;const y=i?.data?.caseInfo?.content,I=i?.uiResources?.root?.config?.name,E=i?.uiResources?.root?.config?.context;y&&!y.pyViewName&&I&&"page"!==n.viewType&&(wh.setIn(y,"pyViewName",I),wh.setIn(y,"pyViewContext",E));const A=$m(i);((e,t)=>{const n=mc(e),r=Ac(e),s=en(n),{skipBrowserSemanticUrlUpdate:a=!1,viewType:o,isTraditionalUICase:i}=t,c=o===wc.PAGE&&(!s||i)&&!a,{caseTypeID:l}=n;if(c){const t=Lg(Be,{caseClassName:l}).replace(/{.+?}/,String(yc(r)));e.semanticURL=t,e.directUrlUpdation=!0}})(A,n);const _=Wc(m,f,p),C={acName:m,target:m,context:_};await jc(A,n,C);const S={target:m,context:_,containerItemID:_,headers:l,parentContext:W(n?.context),isMinimizable:en(wh.getIn(A,"data.caseInfo")),doDeleteCaseSummary:n.doDeleteCaseSummary,acTertiary:n.acTertiary,resourceType:F.ASSIGNMENT,debugInfo:g};Tc(S,A,{skipFlowNameUpdate:n?.caseViewMode===j.REVIEW_MODE});const T=Fc(A,S);return n.isProcessAction&&(T.data.isProcessAction=n.isProcessAction),o&&(T.data.caseInfo.content.coexistenceAction="openAssignment"),((e,t)=>{e.acTertiary&&(t.data.caseInfo.isFirstAssignment=e.acTertiary)})(n,T),ly(T,m,r,n,i,h,u),c===wc.FORM&&Sc(T.containerItemID)&&Qc(T,r),Xc(r),(e=>{fi.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_OPENED,e)})({actionInContext:p,assignmentID:n.assignmentID,caseKey:T.key}),r})),Xl((()=>{const e=n,t=Dc(),a=en(wh.getIn(r[0]?.payload,"data.caseInfo"));return o&&t&&a?Jm.postCreateCaseMessage(r[0]?.payload?.data?.caseInfo?.assignments?.[0]?.ID,mh,r):mh(r),Pc(r,e,s),r[0]?.payload?.isParallelAssignment&&mh({type:$l,payload:{...r[0].payload,isParallelCall:!0}}),r=[],r})))},gy=(e,t)=>{const{insKey:n,headers:r,context:s,debugInfo:a,viewType:o}=e,{removeActionPayload:i}=t,c=e?.pageName?e?.pageName:_p.getDefaultCasePage(),l=Fg(Be,{caseID:n,params:{pageName:c}});let{restApi:u}=l;const{reqType:d}=l;return"none"===o&&(u=`${u?.split("viewType")[0]}viewType=none`),di(ki(u,{method:d,headers:{...r,...a&&{...Oi.addDebugHeaders(a)}}},s)).pipe(Xl((t=>({response:t.data,actionInPayload:e,headers:Lc({...r,...t.headers}),removeActionPayload:i}))),au("Error occurred during ajax call at openWorkByHandle Epic : ",s))},fy="OPEN_WORK_BY_HANDLE",{RESOURCE_TYPES:my}=F,yy=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=uc(Be,r),h=yt(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=uc(Be,s),l=yt(c,a),u=Rd(r);await jc({directUrlUpdation:!o,semanticURL:n},s,{acName:l,containerName:c,target:l,context:u}),e.push(mg(ig,{containerItemID:r,target:l,context:u,doDeleteCaseSummary:i}))})(t,{activateContainerActionPayload:s,actionInPayload:r});else{const s=Wc(h,p,l,{buildNew:!0}),a=$m(o),g=((e,t)=>{const{isRemoteCase:n,remoteCaseClass:r}=t,s=Ac(e),a=n?r:Ic(e);let o=Lg(Be,{caseClassName:a},{id:t?.insKey});return o=o?.replace("{workID}",String(yc(s)))?.replace("{id}",t?.insKey),o})(a,r);a.semanticURL=g,a.directUrlUpdation=!u;const f={acName:h,context:s};await jc(a,r,f);const m=Fc(a,{target:h,context:s,containerItemID:s,semanticURL:g,headers:c,debugInfo:d});m.caseViewMode=j.REVIEW_MODE,m.resourceType=my.CASE,n&&(m.data.caseInfo.content.coexistenceAction="openWorkByHandle"),Tc(m,a,{skipFlowNameUpdate:!0}),m.currentCaseViewMode=Oc(e?.actionInPayload?.context);const y=Gc(h,m);i.containerItemID&&Hc(y)&&t.push(mg(lg,{containerItemID:i.containerItemID,target:h})),t.push(y)}Xc(t);(e=>{fi.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.CASE_OPENED,e)})({caseKey:r.insKey,actionInContext:l})},Iy=e=>{let t=0,n=[];return e.pipe(zl(fy),Xl((e=>(({actionMgrID:t}=e.payload),e.payload))),Jl((e=>{const{context:n,isChild:r,viewType:s}=e,a=uc(Be,e),o=yt(a,n);let i,c=!0;if("none"!==s){const e=Yc(o);c=e.continueExecution,i=e.removeActionPayload}if(!c)return un.rejectActionByID(t),su();const{activate:l,activateContainerActionPayload:u}=Kc(my.CASE,o,e);return l&&!r&&"none"!==s?tu({type:ve,activateContainerActionPayload:u,actionInPayload:e}):gy(e,{removeActionPayload:i})})),Jl((async e=>{if(e&&gc(e.type))return n.push(Bc(e)),n;const t=yh(e?.actionInPayload?.context),r=Rc(e?.actionInPayload.className);if("none"===e?.actionInPayload?.viewType){if("perform"!==t?.context_data?.caseViewMode){const t=$m(e?.response),s={data:{...t?.data},context:e?.actionInPayload?.context,isArrayDeepMerge:!0};n.push({type:at,payload:{context:s.context,doDeleteConfirmationDetails:!1}}),r&&s.data.caseInfo?.content&&(s.data.caseInfo.content.coexistenceAction="openWorkByHandle"),n.push(mg(Gh,s));const a=Bd(e?.actionInPayload?.context),o=dc(e?.actionInPayload?.context),i=Object.freeze({target:a,containerItemID:e?.actionInPayload?.context,context:e?.actionInPayload?.context,containerName:o});if(Sc(e?.actionInPayload?.context)){const t=Fc(e?.response,{...i});Qc({...t,isArrayDeepMerge:!0},n)}}}else await yy(e,n,r);return n})),Xl((()=>(mh(n),Pc(n,t),n=[],n))))},Ey="FINISH_ASSIGNMENT",{RESOURCE_TYPES:Ay}=F,_y=(e,t)=>{const{containerItemID:n,skipReleaseLockRequest:r,isInCreateStage:s,isProcessAction:a}=t,o=Rd(n),i=`${o?.includes("root")?j.APP.ROOT:j.APP.APP}/${dd.MODAL}`;e.push(mg(lg,{containerItemID:n,context:o,target:i,skipReleaseLockRequest:r,isInCreateStage:s,isProcessAction:a}))},Cy=e=>Ah(".openCaseViewAfterCreate",j.CONTEXT_DATA,e)??!0,Sy=async(e,{translatedDXAPIResponse:t,actionInPayload:n},r,s)=>{const{caseID:a}=n,o=(i=t,wh.getIn(i,lc.NEXT_ASSIGNMENT_INFO_ID,j.EMPTY_STRING));var i;const c=Ic(t),{caseViewMode:l,headers:u,semanticURL:d,actionMgrID:p,directUrlUpdation:h,key:g,flowName:f,resourceType:m}=r;s&&Object.assign(s,{caseId:a,assignmentId:o,caseType:c}),_y(e,{...n,skipReleaseLockRequest:!0});const y=`${n?.containerItemID.includes("root")?j.APP.ROOT:j.APP.APP}/${dd.PRIMARY}`,I=Wc(y,dd.PRIMARY),E=Oi.getCoreHeadersFromContext(n.context)||!1,A=Fc(t,{target:y,context:I,containerItemID:I,caseViewMode:l,headers:u,semanticURL:d,key:g,flowName:f,resourceType:m,directUrlUpdation:h,debugInfo:E&&E.debugInfo&&{debugId:E.debugInfo[j.COREHEADER_APP_DEBUG_ID]}});if(wd(y)){const t=yh(I),s=Ac({data:t}),[,a]=s?s.split(" "):[],o=`You will lose unsaved changes for ${a}. Do you want to continue?`;if(!Cy(n.context))return e;{const{continueExecution:t}=Yc(y,{dirtyMessage:o});if(!t)return r.directUrlUpdation=!1,un.rejectActionByID(p),su();A.currentCaseViewMode=Oc(A?.context),e.push(mg(pg,A))}}else e.push(mg(Jh,A));return t.directUrlUpdation=h,t.semanticURL=d,await jc(t,{...A,acName:y},{acName:y,context:I}),e},Ty=e=>/^app\/preview_[0-9]*/g.test(e),Ny=(e,t)=>{const n=W(e);return!Ty(e)&&(n===t||/^app\/primary_[0-9]*/g.test(n))},Py=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=yh(e),r=c?.response?.data?.caseInfo?.assignments??[],s=n?.caseInfo?.assignments??[],a=Oc(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=wd(Bd(e));let d=!1;const p=Bd(n),h=hd(p),g=Td(p);g&&h?.items?.[g]?.key===c?.actionInPayload?.caseID&&(d=!0),_y(s,{...r,skipReleaseLockRequest:!0});const f=dc(e),m={target:Bd(e),containerItemID:e,context:e,containerName:f};t.doDeleteCaseSummary=r.doDeleteCaseSummary;const y=X(n),I=yh(y),E=yh(r.context),A=I?.caseInfo?.ID,_=E?.caseInfo?.ID,C=yh(e)?.caseInfo?.ID;if(u&&A===_||!u&&(""===o||m.containerItemID.includes(j.WORKAREA)&&"review"===t.caseViewMode||!a&&t.root&&0===Object.keys(t.root).length&&C===t.data?.caseInfo?.ID))(void 0===t?.data?.caseInfo?.content||void 0!==t.data.caseInfo.content&&"object"==typeof t.data.caseInfo.content&&0===Object.keys(t.data.caseInfo.content).length)&&(t.root=void 0,delete t.data?.caseMessages),e.includes(j.WORKAREA)&&t.caseViewMode===j.REVIEW_MODE&&((e,t)=>{const n=e?.assignmentID,r=t?.data?.caseInfo?.assignments??[],s=r[0]?.ID;return n!==s})(r,i)&&(t.flowName=" ",t.clearView=!0),s.push(mg(rg,{...t,key:o,resourceType:"",...m}));else if(a){const a=Bd(e),i=Ed(a,o);if(i)m.target=a,m.context=i,m.containerItemID=i,s.push(mg(rg,{...t,key:o,resourceType:"",...m}));else{const e=Od(n)[0];if(r.target=e,r.context=Wc(e,j.WORKAREA,n),r?.context){r.containerItemID=r.context,s.push(mg(Jh,{...r,...t}));const n=r.containerItemID;s.push(mg(ig,{parentContainerTarget:e,containerItemID:n}))}}}if(r.target=Bd(e),r.containerName=dc(e),r.context=e,r.containerItemID=e,wh.setIn(t,"acName",m.target),await jc(i,t),d){const{data:e,caseViewMode:r}=t;n.includes(j.WORKAREA)&&Sc(n)&&(n=X(n));const a={data:e,caseViewMode:r,context:n};wh.setIn(a.data,["context_data","caseViewMode"],r),s.push({type:at,payload:{context:n}}),s.push(mg(Gh,a))}if(!a&&t.caseViewMode===j.PERFORM_MODE){const t=((e,t)=>{const n=Bd(e);return Ed(n,t)})(e,o),n={data:{caseInfo:{headers:l}},context:t};s.push(mg(Gh,n)),s.push(bn(((e,t=!1,n=!1)=>{const r=un.getNextActionMgrId();return{ID:Fh.getPropertyValue(F.CASE_INFO.ASSIGNMENT_ID,"",e),actionID:Fh.getPropertyValue(F.CASE_INFO.ASSIGNMENTACTION_ID,"",e),context:e,caseWideAction:t,contextData:n,options:{actionMgrID:r}}})(t)))}}else{_y(s,r);let e=!1;const o=Bd(n),i=hd(o),l=Td(o);if(l&&i?.items?.[l]?.key===c?.actionInPayload?.caseID&&(e=!0),a){const e=Od(n)[0];r.target=e,r.context=Wc(e,j.WORKAREA,n),r.containerItemID=r.context,s.push(mg(Jh,{...r,...t}));const a=r.containerItemID;s.push(mg(ig,{parentContainerTarget:e,containerItemID:a}))}if(e){const{data:e,caseViewMode:r}=t,a={data:e,caseViewMode:r,context:n};wh.setIn(a.data,["context_data","caseViewMode"],r),s.push({type:at,payload:{context:n}}),s.push(mg(Gh,a))}}},Ry=async(e,t,n,r,s,a)=>{((e,t,n)=>{if(t.isProcessAction&&(_y(n,{...t,skipReleaseLockRequest:!0}),e)){const r=`${t?.containerItemID.includes("root")?j.APP.ROOT:j.APP.APP}/${dd.PRIMARY}`,s=Wc(r,dd.PRIMARY),a={insKey:e.ID,className:e.content.classID,context:s,acTargetName:j.PRIMARY,isChild:!0},o={type:ue,payload:{...a}};n.push(o)}})(e.data.caseInfo.parentCaseInfo,t,s);const o=e?.data?.caseInfo?.parentCaseInfo?.ID;if(o){const n=Bd(t?.context),r=gd(n,t?.context)?.parentContext,s=Bd(r);t?.isProcessAction&&Id(s,o)&&ap(r,e?.data?.caseInfo?.lastUpdateTime)}n.resourceType=Ay.CASE,n.directUrlUpdation=!0,t.isProcessAction||await Sy(s,{translatedDXAPIResponse:r,actionInPayload:t},n,a)},Dy=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=vc.getPropertiesToReplace(a);s.push(mg(rg,{...e,...r,propertiesToReplace:o})),wh.setIn(e,"acName",r.target),await jc(n,e),((e,t,{data:n,caseViewMode:r})=>{const{containerItemID:s}=t,a=Rd(s);if(a&&Sc(s)){const t=X(a),o={data:n,caseViewMode:r,context:t};wh.setIn(o.data,["context_data","caseViewMode"],r),e.push({type:at,payload:{context:t}});const i=vc.getPropertiesToReplace(s);e.push(mg(Gh,o,{propertiesToReplace:i}))}})(s,t,e)},by=async(e,t,n,r,s,a,o,i,c)=>{const{isCaseWideAction:l,isInCreateStage:u,containerItemID:d}=e,p=W(e.context),h=Ec(s),g=Ic(s),f=u&&!h&&!l,m=Od(p)[0],y=m?Td(m):p,I=dc(d),E=Rd(d),A=Object.freeze({target:e.target,containerItemID:d,context:E,containerName:I});f&&!Ty(e.context)?await Ry(i,e,t,s,a,c):Ny(e.context,y)?await Py(y,t,p,e,a,n,r,s,o):l&&!Ny(e.context,y)?(_y(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=Rd(a);e.push(mg(Hh,{containerItemID:a,context:o,container:dd.PREVIEW,containerName:dd.PREVIEW,caseId:s,viewName:F.PREVIEW_VIEW_NAME,caseClassName:t,updateData:!0}))}})(a,e,{caseClassName:g})):await Dy(t,e,s,A,a)},Oy=(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?wc.PAGE:n||wc.FORM})(e),p=(e=>{const{isCaseWideAction:t}=e;return t?ze:"finishAssignment"})(e),h={assignmentID:n,actionID:r,caseID:s,viewType:d};let{restApi:g}=Fg(p,h),{reqType:f}=Fg(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}=Uc(a);e.attachmentsExist=y;const I=u.value.data[a]?.caseInfo?.headers||{},{etag:E}=I,A={"if-match":E,...o};return di(ki(g,{method:f,body:m,headers:A},a)).pipe(Xl((t=>{const{data:n,headers:r}=t;return{response:n,actionInPayload:e,headers:Lc({...A,...r})}})),au("Error occurred during ajax call at finishAssignment Epic : ",a))},{RESOURCE_TYPES:vy}=F,xy=(e,t)=>{let n=0,r=[],s={},a="",o={},i=!1,c=!1;return e.pipe(zl(Ey),Kl((e=>{const l=_p.isCoexistenceAppOfType(j.APP_TYPE.UIKIT);if(({actionMgrID:n}=e.payload),a=e.payload.context,zn({context:a,stateObj:yh(a),clearContextMessages:!0}),!ml(a)){const t={type:F.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return un.rejectActionByID(n,!0,t),Vu.handleDeferredActionCompletion(e.payload.context),tu([])}return tu(e.payload).pipe(Jl((e=>{((e,t)=>{const{containerItemID:n,context:r,actionMgrID:s,isInCreateStage:a,isModalAction:o}=t;if(a&&o){const t=dc(n),a=yt(t,r);e.push(mg(ig,{containerItemID:n,target:a,actionMgrID:s}))}})(r,e);const n={...e};return Oy(n,{state$:t})})),Jl((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=yh(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:Bd(n),context:n};mh({type:fe,payload:a})}})(e);const t=Bc(e);return r.push(t),r}Lu.clearContextedCache(a);const{headers:t,actionInPayload:u,response:d}=e,{containerItemID:p,context:h=Rd(p),isModalAction:g,isInCreateStage:f}=u;i=u.isCaseWideAction,c=u.isProcessAction;const m=Bd(p);u.target=m;const y=dc(p),I=Object.freeze({target:u.target,containerItemID:p,context:h,containerName:y});wh.setIn(d.data,j.CASE_INFO.IS_FIRST_ASSIGNMENT,!1),wh.setIn(d.data,j.CASE_INFO_IS_LOCAL_ACTION,!1),d?.uiResources?.root?.config?.name&&"page"!==u.viewType&&wh.setIn(d.data,j.CASE_INFO.VIEW_NAME,d?.uiResources?.root?.config?.name),(e=>{fi.publish(j.PUB_SUB_EVENTS.EVENT_EXPRESS_LOCALACTION,e)})({submitResponse:d});let E=$m(d,{[F.STOPMERGEACTIONS]:!d.nextAssignmentInfo});const A=Ic(E),_=W(u.context),C=Od(_)[0]?Td(Od(_)[0]):_,S=Ec(E),T=f&&!S;!g||f||Ny(u.context,C)||(E=((e,t)=>(e?.data?.caseInfo&&t?.caseInfo?.content&&(e.data.caseInfo.content=t?.caseInfo?.content),e))(E,yh(p)));const N=Fc(E,{headers:t,actionMgrID:n,directUrlUpdation:!1});let P,R;Nc(N.data,u),N.caseClassName=A,N.resourceType=vy.ASSIGNMENT,N.headers=t;const D=E?.data?.caseInfo?.assignments?.some((e=>e.ID===u.assignmentID)),b=((e,t)=>{const{assignmentID:n}=t;return e?.data?.caseInfo?.assignments?.some((e=>e.ID===n&&"true"===e?.canPerform))})(E,u),O=((e,t,n,r,s)=>{let a;const o=Bd(t);return a=Md(o)?Ed(o,n.data?.caseInfo?.ID):Td(o),r&&e&&_h(null,j.CASE_VIEW_MODE_PROP,a)===j.PERFORM_MODE&&s})(D,C,E,g,b),v=u?.actionID===F.LOCAL_ACTIONS.TRANSFER_ASSIGNMENT;if(E?.data?.nextAssignmentInfo&&!v)N.caseViewMode=j.PERFORM_MODE,P=Ac(E),R=!0;else if(O&&!v)N.caseViewMode=j.PERFORM_MODE,P=Ac(E),N.flowName=" ",N.deleteAssignmentSpecificResources=!1,R=!1;else{N.caseViewMode=j.REVIEW_MODE;const e=wd(Bd(C));P=E?.confirmationNote&&E?.uiResources?.root?.config?.name===j.PY_CONFIRM&&!e?Ac(E):"",R=!1}const x=Ac(E);Tc(N,E,{skipFlowNameUpdate:N?.caseViewMode===j.REVIEW_MODE||O});const w=Lg("createWork",{caseClassName:A}).replace(/{.+?}/,String(yc(x)));if(E.semanticURL=w,N.semanticURL=w,g?(await by(u,N,R,P,E,r,e,d,o),T&&(s=(e=>{if(!Cy(e.context)){let t;const n=e?.caseTypeID,r=e?.caseTypeName;return t=e.businessID?e.businessID:e.workID,{caseID:t,caseTypeID:n,caseTypeName:r}}return{}})(u))):f&&l&&!S?(_p.setDefaultCasePage("pyDetails"),await(async(e,t,n)=>{const r={assignmentID:e?.data?.caseInfo?.assignments[0]?.ID,className:e?.data?.caseInfo?.content?.classID,containerName:dd.PRIMARY,targetContainerName:dd.PRIMARY,viewType:wc.PAGE,isLastStepInCreateStage:!0,context:n},s={type:ge,payload:{...r}};t.push(s)})(d,r,W(h))):await Dy(N,u,E,I,r),bc(e,r),Vu.handleDeferredActionCompletion(a).catch((()=>{})),((e,t,n)=>{const{isModalAction:r,isCaseWideAction:s,caseID:a}=t,o=Ny(t.context,n),i=e?.data?.caseInfo?.stages||[],c=e?.data?.caseInfo?.stageID;cc({caseID:a,isModalAction:r,isModalLaunchedFromPrimaryValue:o,isCaseWideAction:s,stages:i,stageID:c})})(N,u,C),!E?.data?.nextAssignmentInfo){const e=((e,t)=>{const{isCaseWideAction:n,assignmentID:r,actionID:s}=t;return{isCaseWideAction:n,caseID:Ac(e),assignmentID:n?null:r,actionID:n?s:null}})(E,u);(e=>{fi.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.END_OF_ASSIGNMENT_PROCESSING,e)})({...e,containerItemID:p})}return((e,{isModalAction:t,target:n,transientItemID:r})=>{if(t){const t=e.find((({type:e})=>e===Me));t?.payload&&(n=t.payload.target,r=t.payload.containerItemID)}const s=ug({target:n,containerItemID:r});s.payload.transientItems.length&&e.push(s)})(r,{transientItemID:p,target:m,isModalAction:g}),r})),Xl((()=>{const e=r.find((e=>e.type===Ee));return e?(Vu.handleDeferredActionCompletion(a).catch((()=>{})),(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=Gn(s,a,j.PROPERTY),i={type:F.MESSAGES.MESSAGES_TYPE_ERROR,message:e.localizedValue};Rn.mutateField(n,a,o[o.length-1],{messages:[i],type:F.MESSAGES.MESSAGES_TYPE_ERROR,fieldName:r})}}))})(e),un.rejectActionByID(n)):un.resolveActionByID(n,s),o?.caseId&&(e=>{fi.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_DONE,e)})(o),Zc(r),(i||c)&&(e=>{fi.publish(j.PUB_SUB_EVENTS.EVENT_LOCALACTION_SUBMISSION,e)})({updateState:!0}),r=[],s={},o={},r})))})))},wy="CANCEL_ASSIGNMENT",My=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}=Fg(i,{ID:s,caseID:s,viewType:wc.PAGE});return Di.getPreviewMode()&&(t[j.SKIPCOREHEADERS]=!0),di(ki(c,{method:l,headers:t},a,{includeRemoteSystemIdIfPresent:!!o})).pipe(Xl((t=>r?{actionInPayload:e}:{response:t.data,actionInPayload:e,headers:Lc(t.headers)})),au(": Error occurred during ajax call at release lock request : ",a))},Ly=(e,t)=>{const{isModalAction:n}=t;return My({routeKey:"cancelAssignment",isModalAction:n,...e})},Uy=e=>{let t=0,n=[];return e.pipe(zl(wy),Xl((e=>(({actionMgrID:t}=e.payload),e.payload))),Jl((e=>{const{isModalAction:n}=e;e.context||(e.context=Rd(e.containerItemID));const{context:r}=e,s=(e=>{const{isModalAction:t,containerItemID:n}=e;return t?dd.MODAL:dc(n)})(e),a=yt(s,r),{continueExecution:o}=Yc(a);return o?(e.RemoteSystemID=$.getRemoteHeaderByContext(e.context)??void 0,Ly(e,{isModalAction:n})):(un.rejectActionByID(t),su())})),Jl((async e=>{if(e&&e.type===Ee)return n.push(Bc(e)),n;const{actionInPayload:r,response:s}=e,{containerItemID:a,isModalAction:o,isInCreateStage:i}=r,c=Bd(a),l=Rd(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:Ac(s),skipReleaseLockRequest:!1};return i&&n.push(mg(rg,u)),!o&&Sc(a)&&(async(e,t)=>{const{childContainerItemID:n,caseViewMode:r,referencedUsers:s}=t,a=W(n),o={context:Rd(a),data:{referencedUsers:s,context_data:{caseViewMode:r}}};o.data={...t.response.data,...o.data},e.push(mg(Gh,o))})(n,{childContainerItemID:a,caseViewMode:j.REVIEW_MODE,referencedUsers:s?.data.referencedUsers,response:s}),u.skipReleaseLockRequest=!0,n.push(mg(lg,u)),n})),Xl((()=>(mh(n),Pc(n,t),n=[],n))))},Fy="NAVIGATE_TO_STEP",jy=(e,t)=>{const{ID:n,stepID:r,containerItemID:s,context:a=Rd(s),isInCreateStage:o}=e,{state$:i}=t,c={ID:n,stepID:r,viewType:o?wc.PAGE:wc.FORM},{restApi:l,reqType:u}=Fg("navigateToStep",c),{content:d}=Uc(a),p=i.value.data[a].caseInfo.headers;return di(ki(`${l}`,{method:u,body:d,headers:{"if-match":p&&p.etag}},a)).pipe(Xl((t=>({response:t.data,actionInPayload:e,headers:Lc({...p,...t.headers})}))),au("Error occurred during ajax call at navigateToStep Epic : ",a))},{RESOURCE_TYPES:Vy}=F,ky=(e,t)=>{let n=0,r=[];return e.pipe(zl(Fy),Kl((e=>(({actionMgrID:n}=e.payload),tu(e.payload).pipe(Jl((e=>(Qn(e.context),jy(e,{state$:t})))),Jl((async e=>{if(e&&gc(e.type))return r.push(Bc(e)),r;const{actionInPayload:t,response:n,headers:s}=e,{containerItemID:a,context:o=Rd(a),isModalAction:i}=t;Lu.clearContextedCache(t.context);const c=Bd(a),l=dc(a),u=Object.freeze({target:c,containerItemID:a,context:o,containerName:l}),d=n?.data?.caseInfo?.content,p=n?.uiResources?.root?.config?.name,h=n?.uiResources?.root?.config?.context;d&&!d.pyViewName&&p&&"page"!==t.viewType&&(wh.setIn(d,"pyViewName",p),wh.setIn(d,"pyViewContext",h));const g=$m(n),f={acName:c,...u};await jc(g,t,f);const m=Fc(g,{...u,headers:s});n?.nextAssignmentInfo||(m.caseViewMode=j.REVIEW_MODE),bc(e,r),m.doDeleteCaseSummary=t.doDeleteCaseSummary,m.resourceType=Vy.ASSIGNMENT,Tc(m,g),Nc(m.data,t);const y=g.data?.caseInfo?.stages,I=g.data?.caseInfo?.stageID;return cc({caseID:Ac(g),isModalAction:i,stages:y,stageID:I}),Sc(a)&&Qc(m,r),r.push(mg(rg,m)),Xc(r),r})),Xl((()=>(mh(r),Pc(r,n),r=[],r))))))))},$y=e=>{const{caseID:t,context:n}=e,{restApi:r,reqType:s}=Fg("deleteCaseInCreateStage",{ID:t});return di(ki(r,{method:s},n)).pipe(Xl((t=>({response:t.data,actionInPayload:e,headers:Lc(t.headers)}))),au(": Error occurred during ajax call at deleteCaseInCreateStage Epic : ",n))},By=e=>{fi.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_DELETED,e)},Gy=(e,t)=>{let n,r=0,s=[];return e.pipe(zl(Bl),Xl((e=>(({actionMgrID:r,caseType:n}=e.payload),e.payload))),Jl((e=>e.ignoreCaseDeletion?tu({actionInPayload:e}):$y(e))),Jl((async e=>{if(e&&gc(e.type)){const{payload:t}=e,n=Bc({...e,...t,actionMgrID:r});return s.push(n),s}const{actionInPayload:n}=e,{context:a,isModalAction:o}=n,i=o?dd.MODAL:dd.PRIMARY,c=yt(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 jc({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(mg(lg,l)),s})),Xl((()=>(mh(s),Pc(s,r)===j.PROMISE_VALUE.RESOLVE&&By({caseType:n}),s=[],s))))},Wy=(e,t)=>{const{assignmentID:n,actionID:r,context:s}=e,{restApi:a,reqType:o}=Fg("save",{assignmentID:n,actionID:r}),{content:i}=Uc(s),c=t.value.data[s]?.caseInfo?.headers;return di(ki(a,{method:o,body:i,headers:{"if-match":c&&c.etag}},s)).pipe(Xl((t=>({response:t.data,actionInPayload:e,headers:Lc(t.headers)}))),au(": Error occurred during ajax call at saveAndCloseAssignment Epic at save action : ",s))},Hy=(e,t=!1)=>{const{action:n,state$:r,actionMgrID:s}=e;let a=[];return tu(n.payload).pipe(Jl((e=>Wy(e,r))),Jl((e=>{if(e&&gc(e.type))return tu(e);const{containerItemID:t}=e&&e.actionInPayload,r=W(t),s=Bd(r),o=hd(s),i=Od(r)[0];let c=i?Td(Od(r)[0]):r;if(!wd(Bd(c))){const t=hd(i);t?.accessedOrder.forEach((n=>{e.actionInPayload.caseID===t.items[n].key&&(c=t.items[n].context)}))}const l=Td(s);n.payload.canUpdateAvailableActions&&km(e.response);if(c&&a.push((t=>mg(Gh,{context:t,data:{caseInfo:{headers:e.headers}}}))(c)),o?.items?.[l]?.key===e?.actionInPayload?.caseID){const n={context:r,data:{...e.response.data,caseInfo:{...e.response.data?.caseInfo||{},headers:e.headers}}},s=vc.getPropertiesToReplace(t);a.push(mg(Gh,n,{propertiesToReplace:s})),a.push(mg(rg,{context:t}))}return bc(e,a),e.actionInPayload.RemoteSystemID=$.getRemoteHeaderByContext(e.actionInPayload.context)??void 0,My(e.actionInPayload)})),Jl((async n=>{if(n&&gc(n.type)){const{payload:t}=n,r=Bc({...n,...t,actionMgrID:s});a.push(r);const o=e.action.payload.modalLoadingContainer;if(o){const e=o.context,{context_data:t}=yh(e)||{};t?.isLoading&&Gd(e)}return a}const{actionInPayload:r}=n,{context:o,containerName:i}=r,c={target:yt(i,o),containerItemID:o,context:o};return t||a.push(mg(lg,c)),a})),Xl((()=>(mh(a),Pc(a,s),t||(a=[]),a))))},qy=(e,t)=>{let n,r=0;return e.pipe(zl(Gl),Kl((e=>{const{saveOnly:s}=e.payload;({actionMgrID:r,caseType:n}=e.payload);return Hy({action:e,state$:t,actionMgrID:r,caseType:n},s)})))},Yy=e=>{const{callbacks:t}=e;if(t?.submit){const e=e=>{var n;t.submit(e),n="expressLocalActionSubmit",fi.unsubscribe(j.PUB_SUB_EVENTS.EVENT_EXPRESS_LOCALACTION,n)};n=e,r="expressLocalActionSubmit",fi.subscribe(j.PUB_SUB_EVENTS.EVENT_EXPRESS_LOCALACTION,n,r)}var n,r},{LOCAL_ACTION_TYPE:zy}=j,{RESOURCE_TYPES:Ky}=F,Xy=(e,t)=>{const{actionID:n,assignmentID:r,caseID:s,context:a,openActionType:o,modalLoadingContainer:i,headers:c}=e,{isProcessAction:l}=t,u=l?Ye:(e=>{const t=e.localActionType.toLowerCase();return t===zy.CASE_WIDE||t===zy.EXPRESS?ze:qe})(e),d=wc.FORM,{reqType:p}=Fg(u,{caseID:s,ID:r,actionID:n,viewType:d});let{restApi:h}=Fg(u,{caseID:s,ID:r,actionID:n,viewType:d});e.actionType=u===ze?j.CASE:j.ASSIGNMENT,h&&!h.includes("viewType=")&&(h=h.includes("?")?`${h}&viewType=${d}`:`${h}?viewType=${d}`);const g=i?.context??a;return di(ki(h,{method:p,headers:c},g)).pipe(Xl((t=>({response:t.data,actionInPayload:e,headers:Lc(t.headers)}))),au(`: Error occurred during ajax call at ${o} Epic : `,g))},Jy=(e,t)=>{const{isProcessAction:n}=t,r=n?Ye:qe;e.openActionType=r;let s;if("modal"===uc(r,e)){s=Od(e.contextName)[0]?Od(e.contextName):Bd(e.contextName);const n=s?Td(s):e.contextName,r=Rd(n),a=uc(e.openActionType,e),o=yt(a,e.context),i=K(e.context,H(a,e.context));if(mh(Jh({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}}})),mh(sg({context:i})),e.modalLoadingContainer={target:o,context:i},!Od(e.contextName)[0])return Xy(e,t);if(!e.continueExecution)return Xy(e,t);if(!Ml(r))return Xy(e,t);e.saveActionPayload.modalLoadingContainer=e.modalLoadingContainer,e.saveActionPayload.canUpdateAvailableActions=!e.saveActionPayload.isModalAction;return di([Wl(e.saveActionPayload)]).pipe(Jl((e=>(e=>{let t,n=0;const r=[],s={value:fh()?.getState()};return tu(e).pipe(zl(Gl),Kl((e=>{const{isFormValid:a}=e.payload;if(({actionMgrID:n,caseType:t}=e.payload),!a){const e={type:F.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return un.rejectActionByID(n,!0,e),tu([])}return Hy({action:e,state$:s,actionMgrID:n,caseType:t,actionsOut:r},!0)})))})(e))),Jl((n=>{if(1===n.length&&gc(n[0].type)){const{continueExecution:n}=Yc(s);if(!n)return un.rejectActionByID(e.actionMgrID),ru.pipe(pi((()=>su()))).toPromise();if(n)return Xy(e,t)}return Xy(e,t)})),Xl((e=>e)))}return Xy(e,t)},Qy=async(e,t,{headers:n,actionInPayload:r})=>{const{context:s,actionName:a,openActionType:o,doDeleteCaseSummary:i,modalLoadingContainer:c}=r,l=$m(e),u=uc(o,r),d=c?.target??yt(u,s);let p,h,g=!1;!Ld(d)||Md(d)&&!Id(d,e.data.caseInfo.ID)?(h=H(u,s),hc(u)&&(h=K(s,h)),p=h,g=!0):(p=Md(d)?Ed(d,e.data.caseInfo.ID):Td(d),h=Rd(p));const f={acName:d,target:d,containerName:u,context:h};await jc(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=Fc(l,{target:d,context:h,containerItemID:p,caseViewMode:y,doDeleteCaseSummary:i,headers:n,actionName:a,isMinimizable:!1,isInCreateStage:hc(u),resourceType:Ky.ASSIGNMENT,isProcessAction:r.isProcessAction,showProgress:r.showProgress,progressMessage:r.progressMessage,assignmentID:r.assignmentID,actionType:r.actionType});m&&Tc(I,l),hc(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?Jh:rg;if(I.data.context_data.isProcessAction=r.isProcessAction,t.push(mg(E,I)),g||t.push(mg(ag,I)),g){const s=Od(r.contextName),a=Ed(s,e.data.caseInfo.ID);if(a){const e={data:{caseInfo:{headers:n}},context:a};t.push(mg(Gh,e))}}return p!==Td(d)&&t.push(mg(ig,{target:d,containerItemID:p})),Sc(p)&&!c?.context&&Qc(I,t),I.caseViewMode===j.REVIEW_MODE&&t.push(mg(lg,I)),t},Zy="OPEN_LOCAL_ACTION",eI=(e,t)=>Jy(e,t),tI=e=>{let t=0,n=[];return e.pipe(zl(Zy),Xl((e=>(({actionMgrID:t}=e.payload),e.payload))),Jl((e=>eI(e,{actionMgrID:t}))),Jl((async e=>{if(!e)return ru;if(gc(e.type)){const t=Bc(e);n.push(t);const{context_data:r}=yh(e.payload.context)||{};return r?.isLoading&&n.push(mg(ag,e.payload)),n}const{actionInPayload:t,headers:r,response:s}=e,{actionID:a}=t;return wh.setIn(s,"data.caseInfo.activeActionID",a),wh.setIn(s.data,j.CASE_INFO_IS_LOCAL_ACTION,!0),t.refreshConditions&&wh.setIn(s.data,j.CASE_INFO_REFRESH_CONDITIONS,t.refreshConditions),await Qy(s,n,{headers:r,actionInPayload:t}),Yy(t),n})),Xl((()=>(mh(n),Pc(n,t),n=[],n))))},nI=e=>{const{actionID:t,context:n,openActionType:r,caseTypeID:s,bulkContextID:a="",bulkContextType:o=""}=e,i=Ke,{reqType:c,restApi:l}=Fg(i,{caseTypeID:s,actionID:t,bulkContextID:a,bulkContextType:o});return di(ki(l,{method:c},n)).pipe(Xl((t=>({response:t.data,actionInPayload:e,headers:Lc(t.headers)}))),au(`: Error occurred during ajax call at ${r} Epic : `,n))},rI=e=>{const{callbacks:t}=e;if(t?.submit){const e=e=>{var n;t.submit(e),n="bulkActionSubmit",fi.unsubscribe(j.PUB_SUB_EVENTS.EVENT_BULKACTION,n)};n=e,r="bulkActionSubmit",fi.subscribe(j.PUB_SUB_EVENTS.EVENT_BULKACTION,n,r)}var n,r},sI="OPEN_BULK_ACTION",aI=e=>{let t=0,n=[];return e.pipe(zl(sI),Xl((e=>(({actionMgrID:t}=e.payload),e.payload))),Jl((e=>((e,t)=>{const{context:n}=e,{actionMgrID:r}=t;e.openActionType=Ke;const s=uc(Ke,e),a=yt(s,n),{continueExecution:o}=Yc(a);return o?nI(e):(un.rejectActionByID(r),su())})(e,{actionMgrID:t}))),Jl((async e=>{if(e&&gc(e.type)){const t=Bc(e);return n.push(t),n}const{actionInPayload:t,headers:r,response:s}=e,{actionID:a}=t;return wh.setIn(s,"data.caseInfo.activeActionID",a),await Qy(s,n,{headers:r,actionInPayload:t}),rI(t),n})),Xl((()=>(1===n.length&&gc(n[0].type)?un.rejectActionByID(t):un.resolveActionByID(t),mh(n),n=[],n))))};var oI=Array.isArray,iI=Object.getPrototypeOf,cI=Object.prototype,lI=Object.keys;function uI(e){if(1===e.length){var t=e[0];if(oI(t))return{args:t,keys:null};if((r=t)&&"object"==typeof r&&iI(r)===cI){var n=lI(t);return{args:n.map((function(e){return t[e]})),keys:n}}}var r;return{args:e,keys:null}}var dI=Array.isArray;function pI(e){return Xl((function(t){return function(e,t){return dI(t)?e.apply(void 0,go([],ho(t))):e(t)}(e,t)}))}function hI(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=function(e){return Eo(Zl(e))?e.pop():void 0}(e),r=uI(e),s=r.args,a=r.keys,o=new qo((function(e){var t=s.length;if(t)for(var n=new Array(t),r=t,o=t,i=function(t){var i=!1;ti(s[t]).subscribe(ai(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(pI(n)):o}const gI=e=>{const{actionID:t,context:n,cases:r,classID:s}=e,{content:a}=Uc(n,{nonEmptyAndChangedData:!0});let o=5;try{const e=Xu.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}=Fg(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(di(ki(d,{method:u,body:a},n)).pipe(Xl((t=>{const{data:n,headers:r}=t;return{response:n,actionInPayload:e,headers:Lc({...r})}})),au("Error occurred during ajax call at submitbulkaction Epic : ",n)));return hI(p)},fI=e=>{fi.publish(j.PUB_SUB_EVENTS.EVENT_BULKACTION,e)},mI="SUBMIT_BULK_ACTION",yI=e=>{let t,n=0,r=[],s="";return e.pipe(zl(mI),Kl((e=>{const{isFormValid:a}=e.payload;if(({actionMgrID:n}=e.payload),!a){const e={type:F.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return un.rejectActionByID(n,!0,e),tu([])}return tu(e.payload).pipe(Jl((e=>(t=e,gI(t)))),Jl((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`,fI({submitResponse:e}),t.target="HYBRID"===_p.getRenderingMode()?Bd(i):`${j.APP.APP}/${dd.MODAL}`,r.push(mg(lg,{containerItemID:i,context:c,target:t.target,skipReleaseLockRequest:!0})),a&&r.push(mg(cg,{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})),Xl((()=>(un.resolveActionByID(n,s),mh(r),r=[],r))))})))},II=e=>{const{actionID:t,context:n,cases:r}=e,{content:s}=Uc(n,{nonEmptyAndChangedData:!0});s.cases=r.map((e=>({ID:e})));const a=Xe,{reqType:o,restApi:i}=Fg(a,{actionID:t,runningMode:"async"});return di(ki(i,{method:o,body:s},n)).pipe(Xl((t=>{const{data:n,headers:r}=t;return{response:n,actionInPayload:e,headers:Lc({...r})}})),au("Error occurred during ajax call at submitbulkaction Epic : ",n))},EI=e=>{fi.publish(j.PUB_SUB_EVENTS.EVENT_BULKACTION,e)},AI="SUBMIT_BULK_ACTION_ASYNC",_I=e=>{let t,n=0,r=[],s="";return e.pipe(zl(AI),Kl((e=>{const{isFormValid:a}=e.payload;if(({actionMgrID:n}=e.payload),!a){const e={type:F.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return un.rejectActionByID(n,!0,e),tu([])}return tu(e.payload).pipe(Kl((e=>(t=e,II(t)))),Xl((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",EI({submitResponse:i}),t.target=`${j.APP.APP}/${dd.MODAL}`,r.push(mg(lg,{containerItemID:a,context:o,target:t.target,skipReleaseLockRequest:!0})),c&&r.push(mg(cg,{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})),Xl((()=>(un.resolveActionByID(n,s),mh(r),r=[],r))))})))},CI=(e,t)=>Jy(e,t),SI=e=>{let t=0,n=[];return e.pipe(zl(kl),Xl((e=>(({actionMgrID:t}=e.payload),e.payload))),Jl((e=>(Qn(e.context),CI(e,{actionMgrID:t,isProcessAction:!0})))),Jl((async e=>{if(e&&gc(e.type)){const t=Bc(e);return n.push(t),n}const{actionInPayload:t,headers:r,response:s}=e;return await Qy(s,n,{headers:r,actionInPayload:t}),n})),Xl((()=>(Zc(n),Pc(n,t),n=[],n))))},TI=e=>{let t=0,n=[];return e.pipe(zl(Se,Me),Xl((e=>(({actionMgrID:t}=e.payload),e.payload))),Jl((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?My(e):t!==r||s||a||!u?t?.includes(j.MODAL)&&Oc(lp(t))===j.REVIEW_MODE?My(e):tu([]):My(e)})),Jl((e=>(e&&gc(e.type)&&n.push(Bc(e)),n))),Xl((()=>(mh(n),Pc(n,t),n=[],n))))};var NI=new hf(lf),PI=NI;function RI(e,t,n){void 0===e&&(e=0),void 0===n&&(n=PI);var r=-1;return null!=t&&(Ql(t)?n=t:r=t),new qo((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 DI(e,t){return void 0===e&&(e=0),void 0===t&&(t=NI),e<0&&(e=0),RI(e,e,t)}function bI(e){return si((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(ai(n,(function(t){null==a||a.unsubscribe(),r=!0,s=t,a=ai(n,o,Oo),ti(e(t)).subscribe(a)}),(function(){o(),n.complete()}),void 0,(function(){s=a=null})))}))}const OI=(e,t,n,r,s)=>{if(s!==j.RESOURCE_STATUS.CREATE)return;sl.isStateMachineExist(e,t,n)||sl.setStateMachine(e,n,t,new lr(n,t,e));sl.getStateMachine(e,t,n).insert({},r+1,!0,{isDefault:!0})},vI=e=>{const{context:t}=e;let n={...Uc(t).content,contextData:!1};const r=tl(t);wh.isEmpty(r)||(n=el(r,n));const{restApi:s,reqType:a}=Fg("refreshCaseView",e);return n.interestPage=e.interestPage,di(ki(s,{method:a,body:n},t)).pipe(Xl((t=>({actionInPayload:e,response:t.data,headers:Lc(t.headers)}))),au(": Error occurred during ajax call : ",t))},xI=e=>{let t=0,n=[],r="";return e.pipe(zl(ht),Xl((e=>(({actionMgrID:t}=e.payload),e.payload))),Jl((e=>vI(e))),Jl((async e=>{if(e&&e.type===Ee)return n.push(Bc(e)),{actionsOut:n,actionInPayload:{skipPageInstructions:!0}};const{actionInPayload:t,response:s}=e,a=t.containerName,o=yt(a,t.context);let i=Wc(o,a,t.context);i=K(t.context,i);const c=$m(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=yh(t.context)?.context_data?.caseInfo,d=`${t.pageReference}${t.targetProperty}`,p=Wn(u,d.replace(j.CASE_INFO.CASE_INFO_CONTENT,"").slice(1),t.index);c.uiResources.context_data.caseInfo={...c.uiResources.context_data.caseInfo,content:wh.mergeDeep(c.uiResources.context_data.caseInfo?.content,p?.content)};const h=Fh.getProperty(".RemoteSystemID",j.CASE_INFO.HEADERS,t.context),g={acName:o,context:i};await jc(c,t,g);const f={target:o,context:i,containerItemID:i};h&&(f.headers={RemoteSystemID:h});const m=Fc(c,f);m.resourceStatus=t.actionType,m.isMultiRecordData=!0,m.parentContext=t.context,m.heading=t.heading;const y=Gc(o,m);return r=i,n.push(y),Xc(n),{actionsOut:n,actionInPayload:t}})),Xl((({actionInPayload:e})=>(fc(n)?un.rejectActionByID(t):un.resolveActionByID(t),e.skipPageInstructions||OI(r,e.pageReference,e.targetProperty,e.index,e.actionType),mh(n),n=[],n))))},wI=e=>{let t,n="",r=[];return e.pipe(zl(gt),Kl((e=>{t=e.payload;const{isFormValid:s}=e.payload;if(({actionMgrID:n}=e.payload),!s){const t={type:F.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return un.rejectActionByID(n,!0,t),Vu.handleDeferredActionCompletion(e.payload.context),tu([])}return tu(e.payload).pipe(Jl((e=>(t=e,vI(t)))),Jl((async e=>{if(e&&e.type===Ee){const t=Bc(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,yr(a).forEach((e=>{const t=wh.convertClipboardPageToPageRefNotation(e.target);sl.isStateMachineExist(o,i,t)||sl.setStateMachine(o,t,i,new lr(t,i,o));const n=sl.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(mg(lg,{containerItemID:n,context:s,target:t.target,skipReleaseLockRequest:!0})),r})),Xl((()=>{if(fc(r))un.rejectActionByID(n),Vu.handleDeferredActionCompletion(t.context);else{un.resolveActionByID(n),Vu.handleDeferredActionCompletion(t.context);const{pageReference:r}=e.payload;if(Fh.getPropertyValue(j.CONTEXT_DATA_MODAL_VIEW.IS_MULTI_RECORD_DATA,r,t.parentContext)){const e=Fh.getPropertyValue(F.CASE_INFO.CASE_INFO_ID,r,t.parentContext),n=Fh.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,"");xn(e,n,t.parentContext,a,{})}else Un(t.parentContext,j.CASE_INFO.CASE_INFO_CONTENT,{})}return mh(r),r=[],r})))})))},MI=e=>{const{caseID:t,headers:n,debugInfo:r,context:s}=e,a=Fg("getDescendants",{caseID:t}),{restApi:o}=a,{reqType:i}=a;return di(ki(o,{method:i,headers:{...n,...r&&{...Oi.addDebugHeaders(r)}}},s)).pipe(Xl((t=>({actionInPayload:e,response:t.data,headers:Lc({...n,...t.headers})}))),au("Error ocurred during ajax call at getDescendants Epic : ",s))},LI=e=>{let t=0,n=[];return e.pipe(zl(Fu),Xl((e=>(({actionMgrID:t}=e.payload),e.payload))),Jl((e=>MI(e))),Jl((async e=>{if(e&&gc(e.type))return n.push(Bc(e)),n;const{actionInPayload:t,response:r}=e,s={};wh.setIn(s,"caseInfo.childCases",r?.childCases??[]);const a={data:s,context:t?.context};return n.push(mg(Gh,a)),n})),Xl((()=>(mh(n),Pc(n,t),n=[],n))))},UI=[ay,hy,Iy,tI,aI,yI,_I,SI,xy,ky,Uy,TI,qy,Gy,e=>e.pipe(zl(He),bI((()=>DI(100))),Xl((e=>{const{actionMgrID:t,isChildCase:n,isModalAction:r,isProcessAction:s,isDataObject:a,skipReleaseLockRequest:o,isInCreateStage:i}=e.payload;return un.resolveActionByID(t),fi.publish(j.PUB_SUB_EVENTS.EVENT_SHOW_CANCEL_ALERT,{isModalAction:r,hideDelete:!s&&n,isDataObject:a,skipReleaseLockRequest:o,isInCreateStage:i}),[]}))),e=>e.pipe(zl(Le),bI((()=>DI(100))),Xl((e=>{const{actionMgrID:t,context:n,containerName:r,containerItemID:s}=e.payload,a=yt(r,n);return un.resolveActionByID(t),mh(mg(ig,{containerItemID:s,target:a,doDeleteCaseSummary:!1})),[]}))),xI,wI,LI],FI=UI;function jI(){return si((function(e,t){e.subscribe(ai(t,Oo))}))}const{RESOURCE_TYPES:VI}=F,kI=[e=>e.pipe(zl(te),Xl((e=>e.payload)),Jl((e=>{const t={caseID:e.caseId,viewID:e.viewName,caseClassName:e.caseClassName,RemoteSystemID:e.RemoteSystemID};if(e.containerName===dd.PREVIEW&&e.context&&e.caseId&&!e.updateData){const t=yt(dd.PREVIEW,e.context),n=Wc(t,dd.PREVIEW,e.context,{buildNew:!0}),r=decodeURI(e.caseId);mh(Jh({...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}=Fg("loadView",t);return e.viewContext===VI.PAGE&&({restApi:r,reqType:s}=Fg(je,{page:e.viewName,pageClass:e.pageClass})),di(ki(r,{method:s,headers:n},e.context)).pipe(Xl((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:Lc(t.headers),rootView:wh.getIn(r,j.ROOT)}})),au(": Error ocurred during ajax call at loadView Epic : ",e.viewLoadingContainer?.context??e.context))})),Jl((async e=>{const t={};if(e?.type===Ee){if(t.actionsOut=Bc(e),e?.payload?.context?.includes(dd.PREVIEW)){const n={...yh(e.payload.context),caseInfo:{progress:!1,error:!0}},r=yt(dd.PREVIEW,e.payload.context);t.actionsOut=mg(rg,{key:n.key,target:r,containerName:dd.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||ic.getTargetViewContainerName(je),a=r?.target??yt(s,e.context);return{target:a,context:r?.context??(t===dd.PREVIEW&&n?e.context:Wc(a,s,e.context,{buildNew:!!t}))}})(n);n.context=c;const l={acName:i,context:c};let u={};u=$m(r),u.directUrlUpdation=!1,await jc(u,n,l);const d={...n,target:i,context:c,containerItemID:a||c,headers:s},p=Fc(u,d);if(p.resourceType=VI.CASE,o&&!p.updateData){p.caseViewMode=j.REVIEW_MODE;const e=Bd(p?.context);((e,t,n,r,s)=>{e&&s===dd.PREVIEW?(n.data.caseInfo.progress=!1,delete n.root,r.actionsOut=mg(rg,{...n,containerName:s})):e?(r.actionsOut=[],r.actionsOut.push(mg(ig,{target:t,containerItemID:e}))):r.actionsOut=mg(Jh,{...n,containerName:s})})(Ed(e,p.key),e,p,t,o)}else p.preserveClientChanges=!0,t.actionsOut=[],o===dd.PREVIEW&&t.actionsOut.push({type:at,payload:{context:c}}),((e,t)=>{if(e.key){const n=Bd(e?.context);Ed(n,e.key)&&t?.actionsOut?.push(mg(Gh,e))}else t?.actionsOut?.push(mg(Gh,e))})(p,t)}catch(e){console.error(e),t.rootView={type:"error",payload:e}}const{caseId:n,context:r,viewName:s}=e.actionConfig;return"pyCasePreview"===s&&(e=>{fi.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.CASE_PREVIEW,e)})({caseId:n,context:r}),t})),Xl((({rootView:e,actionsOut:t,actionMgrID:n=0})=>(un.resolveActionByID(n,e),t)))),e=>{let t=0,n=[];return e.pipe(zl(ne),Xl((e=>(({actionMgrID:t}=e.payload),e.payload))),Jl((e=>{fi.publish(F.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_STARTED);const{debugInfo:n,context:r,viewName:s,className:a,skipSemanticUrl:o=!1,containerName:i=ic.getTargetViewContainerName(je)}=e,c=n&&{...Oi.addDebugHeaders(n)},l=yt(i,r);let u="",d={},p=!0;if(!o){if(u=Lg(je,{page:s,pageClass:a}),l&&u){const{activate:t,activateContainerActionPayload:n}=Kc(VI.PAGE,l,{semanticURL:u});if(t)return tu({type:ve,activateContainerActionPayload:n,actionConfig:e})}if(Td(l)&&({continueExecution:p,removeActionPayload:d}=Yc(l)),!p)return un.rejectActionByID(t),su()}const{restApi:h,reqType:g}=Fg(je,{page:s,pageClass:a});return di(ki(h,{method:g,headers:c},r)).pipe(Xl((t=>{let n={};return n="string"==typeof t.data?JSON.parse(t.data):t.data,{response:{...n,key:u,semanticURL:u},actionConfig:e,headers:Lc(t.headers),removeActionPayload:d,skipSemanticUrl:o}})),au(": Error ocurred during ajax call at showPage Epic : ",e.context))})),Jl((async e=>{if(e&&e.type===Ee)return n.push(Bc(e)),n;let{type:t}=e;const{actionConfig:r,skipSemanticUrl:s}=e,a=r.containerName||ic.getTargetViewContainerName(ne),o=yt(a,r.context);fi.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=Ed(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:Rd(s)};r.isTraditionalRemoteCase||await jc({directUrlUpdation:!0,semanticURL:t},r,a,!0),n.push(mg(ig,{target:o,containerItemID:s}))}else{const t=Wc(o,a,r.context),{response:c,headers:l={},removeActionPayload:u}=e,d=$m(c,{isCreateDataObject:r.isCreateDataObject});d.directUrlUpdation=!s;const p={acName:o,context:t},h=Oc(t);await jc(d,r,p);const g={target:o,context:t,containerItemID:t,headers:l,debugInfo:r.debugInfo,currentCaseViewMode:h},f=Fc(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=vc.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:yc(vc.getRemoteCaseKey(t.assignmentID,t.insKey))}},n.isTraditionalRemoteCase=!0,n.className=t.className)})(r,i,f),f.data??={},f.data.traditionalGadgetId=vc.getUniqueGadgetId();const m=Gc(o,f);u.containerItemID&&Hc(m)&&n.push(mg(lg,{containerItemID:u.containerItemID,target:o})),n.push(m),Xc(n)}return fi.publish(F.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_DONE,{target:o,pageName:e.actionConfig.viewName,pageClass:e.actionConfig.className}),n})),Xl((()=>{un.resolveActionByID(t),mh(n),n=[]})),jI())}],$I=kI;const BI=(e,t)=>{const{context:n,pageName:r,dataContext:s,dataContextParameters:a,semanticURL:o,skipSemanticUrl:i,RemoteSystemID:c}=e,{removeActionPayload:l}=t,{restApi:u,reqType:d,body:p}=Fg(Ve,{pageName:r,dataContext:s,dataContextParameters:a}),h={};return h.RemoteSystemID=c,di(ki(u,{method:d,headers:h,body:p},n)).pipe(Xl((t=>({response:{...t.data,key:o,semanticURL:o},actionConfig:e,headers:Lc(t.headers),removeActionPayload:l,skipSemanticUrl:i}))),au("Error occurred during ajax call at showData Epic : ",e.context))},{RESOURCE_TYPES:GI}=F,WI=e=>{let t,n=0,r=[];return e.pipe(zl(re),(s=e=>(({actionMgrID:n}=e.payload),tu(e.payload).pipe(Jl((e=>((e,t)=>{const{context:n,pageName:r,dataContext:s,dataContextParameters:a,skipSemanticUrl:o=!1,isDeferLoaded:i=!1,parentAction:c="",resourceType:l,containerName:u,RemoteSystemID:d}=e,p=yt(u,n);let h="",g={},f=!1;if(!o){h=Lg(Ve,{pageName:r,dataViewName:s},a);const{activate:n,activateContainerActionPayload:o}=Kc(GI.PAGE,p,{semanticURL:h});if(n)return tu({type:ve,activateContainerActionPayload:o,actionConfig:e});if(({continueExecution:f,removeActionPayload:g}=Yc(p)),!f)return un.rejectActionByID(t),su()}return BI({context:n,pageName:r,dataContext:s,dataContextParameters:a,semanticURL:h,skipSemanticUrl:o,containerName:u,isDeferLoaded:i,parentAction:c,resourceType:l,RemoteSystemID:d},{removeActionPayload:g})})(e,n))),Jl((async e=>{if(e&&e.type===Ee)return r.push(Bc(e)),r;const{type:n,actionConfig:s,headers:a,response:o,skipSemanticUrl:i}=e;t=wh.getIn(o,j.ROOT);const{containerName:c,parentAction:l,resourceType:u}=s,d=yt(c,s.context);let p;const h=Oc(s?.context);if(s.isDeferLoaded){p=$m(o),p.directUrlUpdation=!i;const t={acName:d,context:s.context};await jc(p,s,t);const n={target:d,headers:a,context:s.context,containerItemID:e.containerItemID},c=Fc(p,n);return r=mg(Gh,c),r}if(n===ve){const{activateContainerActionPayload:{semanticURL:t,containerItemID:n}}=e,a={acName:d,context:Rd(n)};await jc({directUrlUpdation:!0,semanticURL:t},s,a,!0),r.push(mg(ig,{target:d,containerItemID:n,resourceType:GI.DATA}))}else if("DATA"===u&&l===pt){const{context:e}=s,t=o?.data,n={context:e,data:t};r.push(mg(Gh,n))}else{const t=Wc(d,c,s.context),{removeActionPayload:n}=e;p=$m(o),p.directUrlUpdation=!i;const l={acName:d,context:t};await jc(p,s,l);const u=Fc(p,{target:d,context:t,containerItemID:t,headers:a,currentCaseViewMode:h});u.resourceType=GI.DATA;const g=Gc(d,u);n.containerItemID&&Hc(g)&&r.push(mg(lg,{containerItemID:n.containerItemID,target:d})),Xc(r),r.push(g)}return r})),Xl((()=>(un.resolveActionByID(n,t),mh(r),r=[],r))))),Eo(a)?Jl(s,a,1):Jl(s,1)));var s,a},HI=e=>{const{dataViewName:t,context:n,dataViewParameters:r}=e,s={data_view_ID:t,dataViewParameters:encodeURIComponent(JSON.stringify(r))},{restApi:a,reqType:o}=Fg("deleteDataObject",s);return di(ki(a,{method:o},n)).pipe(Xl((t=>({response:t.data,actionInPayload:e}))),au("Error occurred during ajax call at deleteDataObject Epic",n))},qI=e=>{let t=0,n=[];return e.pipe(zl(ct),ou(100),Xl((e=>(({actionMgrID:t}=e.payload),e.payload))),Jl((e=>HI(e))),Jl((async e=>{if(e&&e.type===Ee){const{payload:r}=e,s=Bc({...e,...r,actionMgrID:t});return n.push(s),n}return[]})),Xl((()=>(1===n.length&&gc(n[0].type)?un.rejectActionByID(t):un.resolveActionByID(t),mh(n),n=[],n))))},YI=e=>{const{dataViewID:t,dataViewParameters:n,context:r}=e,s={data_view_ID:t},{restApi:a,reqType:o}=Fg("getDataObjectActions",s);return di(ki(a,{method:o,body:{dataViewParameters:n}},r)).pipe(Xl((e=>({...e.data}))),au("Error occurred during ajax call at GET data object actions : ",e.context))},zI=e=>{let t=0,n=[];let r={};return e.pipe(zl(ye),ou(100),Xl((e=>(({actionMgrID:t}=e.payload),e.payload))),Jl((e=>YI(e))),Jl((async e=>e&&e.type===Ee?(n.push(Bc(e)),n):(r=e,[]))),Xl((()=>(1===n.length&&gc(n[0].type)?un.rejectActionByID(t):un.resolveActionByID(t,r),mh(n),n=[],n))))},KI=[WI,e=>{let t=0,n=[];return e.pipe(zl(it),ou(100),Kl((e=>{const{isFormValid:r}=e.payload;if(({actionMgrID:t}=e.payload),!r){const e={type:F.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return un.rejectActionByID(t,!0,e),tu([])}return tu(e.payload).pipe(Jl((e=>iu(e))),Jl((async e=>{if(e&&e.type===Ee){const{payload:r}=e,s=Bc({...e,...r,actionMgrID:t});return n.push(s),n}const{actionInPayload:r}=e,{containerItemID:s,isModalAction:a}=r,o=a?dd.MODAL:dd.PRIMARY,i={target:yt(o,s),containerItemID:s,context:s};return n.push(mg(lg,i)),n})),Xl((()=>(1===n.length&&gc(n[0].type)?un.rejectActionByID(t):un.resolveActionByID(t),mh(n),n=[],n))))})))},e=>{let t=0,n=[];return e.pipe(zl(lt),ou(100),Xl((e=>(({actionMgrID:t}=e.payload),e.payload))),Jl((e=>cu(e))),Jl((async e=>{if(e&&e.type===Ee){const{payload:r}=e,s=Bc({...e,...r,actionMgrID:t});return n.push(s),n}const{actionInPayload:r,response:s,headers:a={}}=e,{containerName:o}=r,i=yt(o,r.context),c=Wc(i,o,r.context),l={acName:i,context:c};await jc(s,r,l);const u=Fc(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(mg(Jh,u)),n})),Xl((()=>(1===n.length&&gc(n[0].type)?un.rejectActionByID(t):un.resolveActionByID(t),mh(n),n=[],n))))},e=>{let t=0,n=[];return e.pipe(zl(ut),ou(100),Kl((e=>{const{isFormValid:r}=e.payload;if(({actionMgrID:t}=e.payload),!r){const e={type:F.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return un.rejectActionByID(t,!0,e),tu([])}return tu(e.payload).pipe(Jl((e=>lu(e))),Jl((async e=>{if(e&&e.type===Ee){const{payload:r}=e,s=Bc({...e,...r,actionMgrID:t});return n.push(s),n}const{actionInPayload:r}=e,{containerItemID:s,isModalAction:a}=r,o=a?dd.MODAL:dd.PRIMARY,i={target:yt(o,s),containerItemID:s,context:s};return n.push(mg(lg,i)),n})),Xl((()=>(1===n.length&&gc(n[0].type)?un.rejectActionByID(t):un.resolveActionByID(t),mh(n),n=[],n))))})))},qI,zI,e=>{let t=0,n=[];return e.pipe(zl(dt),ou(100),Xl((e=>(({actionMgrID:t}=e.payload),e.payload))),Jl((e=>uu(e))),Jl((async e=>{if(e&&e.type===Ee){const{payload:r}=e,s=Bc({...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=yt(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 jc(s,r,h);const g=Fc(s,p);return n.push(mg(Jh,g)),n})),Xl((()=>(1===n.length&&gc(n[0].type)?un.rejectActionByID(t):un.resolveActionByID(t),mh(n),n=[],n))))},e=>{let t=0,n=[];return e.pipe(zl(pt),ou(100),Kl((e=>{const{isFormValid:r}=e.payload;({actionMgrID:t}=e.payload);const s=e.payload.context;if(!r){const e={type:F.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return un.rejectActionByID(t,!0,e),tu([])}return zn({context:s,stateObj:yh(s),clearContextMessages:!0}),tu(e.payload).pipe(Jl((e=>du(e))),Jl((async e=>{if(e&&e.type===Ee){const{payload:r}=e,s=Bc({...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=yt(o,r.context),d={acName:u,context:r.context};await jc(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=Fc(n,t);i.resourceType=s||F.RESOURCE_TYPES.DATA;const c=X(o);e.push(mg(lg,i));const l=Ah(".dataContext","dataInfo",c),u=Ah(".dataContextParameters","dataInfo",c),d={context:c,skipSemanticUrl:!0,resourceType:s,parentAction:pt,dataContext:l,dataContextParameters:u},p=l&&u&&Lg(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})),Xl((()=>(1===n.length&&gc(n[0].type)?un.rejectActionByID(t):un.resolveActionByID(t),mh(n),n=[],n))))})))}],XI=KI;function JI(e,t){return void 0===t&&(t=NI),si((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(ai(r,(function(n){a=n,o=t.now(),s||(s=t.schedule(c,e),r.add(s))}),(function(){i(),r.complete()}),void 0,(function(){a=s=null})))}))}const{RESOURCE_TYPES:{CASE:QI,DATA:ZI}}=F;let eE=[],tE=!1;const nE={},rE=[e=>e.pipe(zl(Ie),JI(200),Xl((e=>e.payload)),Jl((e=>{tE=!1,fi.subscribe(F.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_STARTED,(()=>{tE=!0}));const t=Di.getPreviewMode()&&Oi.addDebugHeaders({debugId:wh.generateUniqueID()});nE.dataContext=e.payload.dataViewName,nE.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(Jc(s)){case QI:i={caseTypeID:c.caseTypeID,processID:c.processID,content:{}};break;case ZI:i=nE;break;default:i=c}return di(ki(o,{method:r,body:i,headers:{...l,...t}},n)).pipe(Xl((t=>({response:{...t.data},payload:e,headers:Lc(t.headers)}))),au(": Error occurred during ajax call at historyEpic : ",e))}return di(ki(o,{method:"GET",headers:{...l,...t}},i.substring(0,i.lastIndexOf("/")))).pipe(Xl((n=>({response:n.data,payload:e,headers:{...Lc(n.headers),...t}}))),nu((r=>{if(s===Je){const n={messages:[{type:"error",message:r.response.data.errorDetails[0].localizedValue}],category:"PAGE"};ac.setComponentCache("assignments-launchAssignment-Error",n);const s=Tg(yp()),a=Ap.getEndPointInfo(s.split("/assignments")[0]),o=E()+a.routeEndpoint;return e={...e,routeKey:Be,resetSemanticURL:!0},di(ki(o,{method:a.reqType,headers:{...l,...t}},i.substring(0,i.lastIndexOf("/")))).pipe(Xl((n=>({response:n.data,headers:{...Lc(n.headers),...t},payload:e}))))}return tu(yg(": Error occurred during ajax call at historyEpic : ",r,n))})))})),Jl((async e=>{if(tE)return eE;if(fi.subscribe(F.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_STARTED,(()=>{tE=!0})),e&&e.type===Ee)return Bc(e);const{headers:t={},response:n,payload:r}=e,s=$m(n,{[F.STOPMERGEACTIONS]:!n.nextAssignmentInfo}),a=r.options.acName,o=wd(a)&&Ld(a)?Td(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=Lg(Be,{caseName:e.payload.payload.caseName}),l=l&&l.replace("{workID}",e.payload.payload.workID)||"",d=r?.payload?.caseClassName),(r?.routeKey===Je||r?.resetSemanticURL)&&(e=>{const t=Ac(e);let n=Lg(Be,{caseClassName:Ic(e)},{id:t});n=n?.replace("{workID}",String(yc(t))).replace("{id}",String(yc(t))),Wg({semanticURL:n,directUrlUpdation:!0,options:{}})})(s),fi.publish(F.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_INIT,{pageName:u,pageClass:d});const p=wh.getIn(s,j.LOCALE_REFERENCES);await Tp.loadLocaleResources(p);const h=wh.getIn(s,j.COMPONENTS);h&&await Vr(h),Mr(s,r.options.actionConfig,!0),fi.publish(F.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_DONE,{target:a,pageName:u,pageClass:d});let g=Fc(s,c);return g=((e,t,n)=>{if(e===xc.CASE||e===xc.ASSIGNMENT){if(t?.caseInfo?.assignments&&t?.caseInfo?.assignments.length>0){const{key:e,flowName:r}=kc(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,e===xc.ASSIGNMENT?(n.caseViewMode=j.PERFORM_MODE,n.resourceType=xc.CASE):n.caseViewMode=j.REVIEW_MODE}else n.resourceType=e,n.semanticURL=t.semanticURL;return n})(Jc(e.payload.routeKey),{...n.data,semanticURL:l,caseViewMode:j.REVIEW_MODE},g),eE.push(Gc(a,g)),((e,t)=>{let n=ac.getComponentCache("assignments-launchAssignment-Error")||{};n&&"object"==typeof n&&Object.keys(n).length>0&&(n={...n,context:e},t.push(mg(cg,n)),ac.resetComponentCache("assignments-launchAssignment-Error"))})(o,eE),Xc(eE),eE})),Xl((()=>(tE||mh(eE),eE=[],tE=!1,eE))),au("Error occurred"))],sE=[e=>{let t=0,n=[];return e.pipe(zl(se),Xl((e=>(({actionMgrID:t}=e.payload),e.payload))),Jl((e=>{const{context:t,skipSemanticUrl:n=!1,insightID:r}=e;let s,a="";n||(a=Lg(ke,{insightID:"{insightID}"}),a=a.replace("{insightID}",r),s=Ap.getEndPointInfo(a));const{restApi:o,reqType:i}=Fg(ke,{...s?.payload||[],insightID:r});return di(ki(o,{method:i},t)).pipe(Xl((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}})),au(": Error occurred during ajax call at showPage Epic : ",e.context))})),Jl((async e=>{if(e&&e.type===Ee)return n.push(Bc(e)),n;const{actionConfig:t,skipSemanticUrl:r}=e,s=ic.getTargetViewContainerName(ne),a=yt(s,t.context),o=Wc(a,s,t.context),{response:i}=e,c=$m(i);c.directUrlUpdation=!r;const l={acName:a,context:o},u=!r,d=r;await jc(c,t,l,u,d);const p=Fc(c,{target:a,context:o,containerItemID:o});p.resourceType=F.PAGE;const h=Gc(a,p);return n.push(h),Xc(n),n})),Xl((()=>{un.resolveActionByID(t),mh(n),n=[]})),jI())}],aE=[e=>{let t=0,n=[];return e.pipe(zl(ae),Xl((e=>(({actionMgrID:t}=e.payload),e.payload))),Jl((e=>{const{context:t,skipSemanticUrl:n=!1,dashboardID:r}=e;let s="";n||(s=Lg($e,{dashboardID:r}),s=s.replace("{dashboardID}",r));const{restApi:a,reqType:o}=Fg($e,{dashboardID:r});return di(ki(a,{method:o},t)).pipe(Xl((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}})),au(": Error occurred during ajax call at showPage Epic : ",e.context))})),Jl((async e=>{if(e&&e.type===Ee)return n.push(Bc(e)),n;const{actionConfig:t,skipSemanticUrl:r}=e,s=ic.getTargetViewContainerName(ne),a=yt(s,t.context),o=Wc(a,s,t.context),{response:i}=e,c=$m(i);c.directUrlUpdation=!r;const l={acName:a,context:o},u=!r,d=r;await jc(c,t,l,u,d);const p=Fc(c,{target:a,context:o,containerItemID:o});p.resourceType=F.PAGE;const h=Gc(a,p);return n.push(h)})),Xl((()=>{un.resolveActionByID(t),mh(n),n=[]})),jI())}],oE=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 Vm.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}(...Ym,...FI,...$I,...rE,...XI,...Km,...[e=>{let t=0;return e.pipe(zl(et),Xl((e=>(({actionMgrID:t}=e.payload),e.payload))),Xl((()=>{const e=fh()?.getState(),n=Fm();return h()(e,n)&&t>0?un.resolveActionByID(t,{}):un.rejectActionByID(t),[]})),jI())}],...sE,...aE),iE=()=>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)&&(il(a||o),Rn.removeContextTreeNode(a||o)),e(t)},cE={},lE=e=>{const t=wh.getIn(cE,[j.CONTEXT,e],[]),n=[];t.forEach((t=>{const r=t.substr(0,t.lastIndexOf("_")),s=wh.getIn(cE,[r,t],[]),a=s&&s.length>0&&s.indexOf(e);if(a>-1&&s.splice(a,1),!s||s&&0===s.length){wh.deleteIn(cE,[r,t]);const e=wh.getIn(cE,[r]);e&&0===Object.keys(e).length&&wh.deleteIn(cE,[r]),n.push({dataPageName:r,dataPageNameWithHash:t})}})),wh.deleteIn(cE,[j.CONTEXT,e]);const r=wh.getIn(cE,[j.CONTEXT]);(!r||r&&0===Object.keys(r).length)&&wh.deleteIn(cE,[j.CONTEXT]),n.length>0&&mh(Eg({dataPagesToBeRemoved:n}))},uE=(e={},t)=>{Object.keys(e).forEach((n=>{const r=wh.getIn(e,[n],{});Object.keys(r).forEach((e=>{((e,t,n)=>{const r=wh.getIn(cE,[j.CONTEXT,n]);if(wh.getIn(cE,[e])){const r=wh.getIn(cE,[e,t],[]);wh.setIn(cE,[e,t],[...new Set([...r,n])])}else wh.setIn(cE,[e,t],[n]);r?wh.setIn(cE,[j.CONTEXT,n],[...new Set([...r,t])]):wh.setIn(cE,[j.CONTEXT,n],[t])})(n,e,t)}))}))},dE=()=>e=>t=>{(Array.isArray(t)?t:[t]).forEach((e=>{const{payload:{data:t={},context:n=null,childContainersContexts:r=[]}={},type:s}=e;if(((e,t)=>{t&&t.length>0&&(e===Me||e===Se)&&t.forEach((e=>{lE(e)}))})(s,r),s===Ce||s===fe||s===nt){const e=s===nt?t:t.shared;uE(e,n)}else s===Me?(lE(n),uE(t.shared,n)):s===Se&&lE(n)})),e(t)},pE=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}=wh.getIn(e.getState(),["containers",s,"items",a])||{},o={resourceType:t,key:n,context:r,containerItemID:a};fi.publish(u.CONTAINER_EVENTS.CLOSE_CONTAINER_ITEM,o),s===`${F.APP.APP}/${j.PRIMARY}`&&l===j.CONTAINER_TYPE.MULTIPLE&&fi.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=>{Uu.cleanCaches(e)})),r!==Me&&r!==Se||Uu.cleanCaches(o),t(n)},hE=()=>e=>t=>{const{payload:{context:n=null,transientItemID:r=null}={},type:s}=t;!n||s!==Ce&&s!==xe&&s!==Me&&s!==Se||(Er(n),mr(n)),r&&s===De&&(Er(r),mr(r)),e(t)},gE=function(e){void 0===e&&(e={});var t,n=new(0,gf.constructor)(gf.schedulerActionCtor),r=new mf,s=function(s){t=s;var a=new mf,o=new mf,i=a.asObservable().pipe(ii(n)),c=new Ef(o.pipe(ii(n)),t.getState());return r.pipe(Xl((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})),Jl((function(e){return di(e).pipe(ci(n),ii(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}(),fE=e=>{const t=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||af;if(null!==fh())Oh();else{const n=rf(jm(e),t(Af.reduxBatch,function(...e){return t=>(n,r)=>{const s=t(n,r);let a=()=>{throw new Error(Qg(15))};const o={getState:s.getState,dispatch:(e,...t)=>a(e,...t)},i=e.map((e=>e(o)));return a=af(...i)(s.dispatch),{...s,dispatch:a}}}(Fl,iE,dE,hE,gE,pE),Af.reduxBatch));gE.run(oE),gh(n)}},mE={publishConstellationLoadedEvent:()=>{fi.publish(j.PUB_SUB_EVENTS.BOOTSTRAP_SHELL_EVENTS.CONSTELLATION_LOADED,{})}};const yE=new class{activateContainerItemOnSwitch(e){const t=`${j.APP.APP}/${j.PRIMARY}`,n={target:t,containerItemID:Ed(t,e)};od({}).getPConnect().getContainerManager().activateContainerItem(n)}removeContainerItemOnClose(e){const t=`${j.APP.APP}/${j.PRIMARY}`,n={target:t,containerItemID:Ed(t,e)};od({}).getPConnect().getContainerManager().removeContainerItem(n)}showCasePreview(e,t){const n=od({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}),Cd(j.APP.APP,j.PREVIEW)||r.initializeContainers({type:"multiple",name:j.PREVIEW}),n.getPConnect().getActionsApi().showCasePreview(e,{caseClassName:t})}closeCasePreview(){od({}).getPConnect().getContainerManager().resetContainers({name:j.PREVIEW,context:j.APP.APP})}isFormDirty(e){const t=`${j.APP.APP}/${j.PRIMARY}`,n=op(t,e);return rl.isStateModified(n)}getEventUtils(){return mE}getBroadcastUtils(){return Jm}isTraditionalUICase(e){return Rc(e)}};const IE=class{static openCase(e,t=F.APP.APP,n={}){return n.renderInline=!0,n.pageName?_p.setDefaultCasePage(n.pageName):(_p.setDefaultCasePage(j.PY_DETAILS),n.pageName=j.PY_DETAILS),n?.disableAssignmentHeader?_p.disableAssignmentHeader(n.disableAssignmentHeader):_p.disableAssignmentHeader(!1),Yu.openCase(e,t,j.PRIMARY,n)}static createCase(e,t=F.APP.APP,n={}){return n.renderInline=!0,n.pageName?_p.setDefaultCasePage(n.pageName):(_p.setDefaultCasePage(j.PY_DETAILS),n.pageName=j.PY_DETAILS),n?.disableAssignmentHeader?_p.disableAssignmentHeader(n.disableAssignmentHeader):_p.disableAssignmentHeader(!1),Yu.createCase(e,t,j.PRIMARY,n)}static getNextWork(e=F.APP.APP,t={}){return t.renderInline=!0,t.pageName?_p.setDefaultCasePage(t.pageName):(_p.setDefaultCasePage(j.PY_DETAILS),t.pageName=j.PY_DETAILS),t?.disableAssignmentHeader?_p.disableAssignmentHeader(t.disableAssignmentHeader):_p.disableAssignmentHeader(!1),Yu.getNextWork(e,j.PRIMARY,t)}static openAssignment(e,t=F.APP.APP,n={}){return n.renderInline=!0,n.pageName?_p.setDefaultCasePage(n.pageName):(_p.setDefaultCasePage(j.PY_DETAILS),n.pageName=j.PY_DETAILS),n?.disableAssignmentHeader?_p.disableAssignmentHeader(n.disableAssignmentHeader):_p.disableAssignmentHeader(!1),Yu.openAssignment(e,t,j.PRIMARY,n)}static openPage(e,t,n=F.APP.APP,r={}){const s=ne;r?.defaultCasePage?_p.setDefaultCasePage(r.defaultCasePage):_p.setDefaultCasePage(j.PY_DETAILS),r?.disableAssignmentHeader?_p.disableAssignmentHeader(r.disableAssignmentHeader):_p.disableAssignmentHeader(!1);const a={viewName:e,className:t,acTargetName:j.PRIMARY,actionMgrID:un.getNextActionMgrId(),context:n},{promise:o}=un.actionManagerPromise(s,a.actionMgrID);return mh({type:s,payload:{...a}}),o}static getCurrentContextAPI(e,t=F.APP.APP){return od({meta:{config:{}},options:{context:t,pageReference:e,containerName:j.PRIMARY}}).getPConnect()}};const EE=new class{createC11nEnv=e=>od(e);getContextUtils=()=>e;getRoutingManager=()=>t;getComponentsRegistry=()=>Jt;getStateManager=()=>l;getActionCreators=()=>u;getStreamObservable=()=>r;getActionProcessor=()=>Vh;getActionHandler=()=>jh;renderApp=(e,t)=>{const n={context:j.APP.APP},r={...wh.getIn(e,j.ROOT),options:n};fE(e),Mr(e,n,!0);const s=this.createC11nEnv({meta:r,isRoot:!0});fi.publish(F.PUB_SUB_EVENTS.EVENT_RENDER_APP,{props:s,domContainerID:t})};updateStoreWithUiRoot=async(e,t,n)=>{const r=$m(e),{data:s,uiResources:a={}}=e,o=wh.getIn(a,j.CONTEXT_DATA);await jc(r,{},{},!1,!0);const i={...s,[j.CONTEXT_DATA]:o},{root:c}=a;Wd(c,t,i,n)};fetchEndPointResource=(e,t,n)=>{ki(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)=>Vr(n).then((()=>{const n=this.createC11nEnv({meta:e,isRoot:!0});fh()||fE({}),fi.publish(F.PUB_SUB_EVENTS.EVENT_RENDER_APP,{props:n,domContainerID:t})}));setStaticServerUrl=(e,t,n)=>{Ur.initServer(e,t,n)};loadView=async(e,t,n=[])=>{y();const r=$m(e),s=wh.getIn(r,j.VIEWS),a=wh.getIn(r,j.NAVIGATIONS),o=wh.getIn(r,j.COMPONENTS)||[];o.push(...n);const i=wh.getIn(r,j.STATIC_SERVER_URL),c=wh.getIn(r,j.APPLICATION_DATA);s&&Hp(s),a&&qp(a),(e=>{e&&(vg=e.pyLabel)})(c),i&&Ur.initServer(i),await Vr(o,i).then((()=>this.renderApp(r,t)))};initAppShell=(e,t,n)=>{Xg(e),ic.buildActionTargetMap(t),y(n)};initRoutingTable=(e,t)=>{Xg(e,!0),y(t)};setAppAlias=e=>{Ur.setAppAlias(e)};getHomeRestApi=e=>{const{restApi:t}=Ug("home",{portalName:e});return E()+t};getViewRestApi=(e,t)=>{const{restApi:n}=((e,t)=>{let n={restApi:""};try{if(zg()&&!t){const t=mp(),r=Ap.processUrl(t,!0),s=Ap._getMatchedRouteInRoutingTable(r)||"",a=Ap.getRoutingInfo(),o=Ap.processUrl(t,!1).split("/"),i=o[o.length-1];let{caseID:c}=a&&a.routes[s].payload;c=c.replace("{workID}",i),n=Ap.getRestEndPoint("loadView",{caseID:c,viewID:e})||{}}else n=Ap.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;fh()||fE({}),a&&(ep(`${j.APP.ROOT}/${o}`),Zd().deleteContainerItem(`${j.APP.ROOT}/${o}`)),Zd().getContainerItems()?.length>1&&!o?.startsWith("hybrid_")&&"authoring-preview"!==o&&Oh(),mh(Gh({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();Td(`${l}/${u}`)||"noPortal"===t.config?.renderingMode||d.initializeContainers({type:"single"});const p=["RootContainer","Region","ModalViewContainer","PreviewViewContainer","reference",...n];return Vr(p).then((()=>{fi.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=>{Kg(e)};checkIfSemanticURL=()=>zg();onPCoreReady=e=>{fi.subscribe(F.PUB_SUB_EVENTS.EVENT_RENDER_APP,e,"renderAppCallback")};onPCoreCleanup=e=>{fi.subscribe(F.PUB_SUB_EVENTS.EVENT_UNMOUNT_APP,e,"unmountAppCallback")};setFieldsDefaultConfigs=e=>{Or.updateFieldDefaults(e)};setGoogleMapsAPIKey=e=>{_(e)};setFetchDefaultHeaders=e=>{Hi(e)};setFetchAuthInfo=e=>{qi(e)};getCaseApi=()=>Yu;getMashupApi=()=>IE;enableAppRouting=e=>{wg(e)};initStore=()=>fE({});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=od({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 AE=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 _E=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 AE(e.serviceConfig),this.behaviorOverrides=e.behaviorOverrides,this.initBroadcast=!!e.initBroadcast,this.cookieComplianceMethod=e.cookieComplianceMethod??"none",this.isExtraCallRequiredForDefaultHome=e.isExtraCallRequiredForDefaultHome??"false"}},CE=async()=>{const e=_p.getLocale(),t=_p.getFeatureMap().localizationVersion||1;let n;if("en-US"!==e)try{let r;2===t?r=[e]:(r=[Tp.GENERIC_BUNDLE_KEY,Tp.MESSAGE_BUNDLE_KEY,Tp.FIELD_LABELS_BUNDLE_KEY,...Tp.getCaseTypeLocaleReferences()],n=await Tp.isCurrentLocalePackAvailable());const s=r.map((async r=>{2===t?await(async e=>{const t=_p.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 Qi("getLocalizationPack",{queryPayload:n});if((201===r.status||200===r.status)&&r.data){const e=r.data;Object.keys(e).forEach((t=>{Tp.setLocaleForRule(e[t],t)}))}})(r):n&&await(async(e,t)=>{const n=await Ur.getSvcLocale(t,`${e}.json`);if(n?.ok&&e){const t=await n.json();Tp.setLocaleForRule(t,e)}})(r,e)}));await Promise.allSettled(s)}catch(e){console.warn(e)}},SE="@P .viewConfig";let TE=0;const NE=new class{#f(e,t,n){Xg(e),ic.buildActionTargetMap(t),y(n)}init(e){const t=new _E(e),n={...t.environmentInfo,renderingMode:t.renderingMode};wg(t.enableRouting),fE({}),_p.setTheme(t.theme),_p.setCookieComplianceMethod(t.cookieComplianceMethod),_p.setIsExtraCallRequiredForDefaultHome(t.isExtraCallRequiredForDefaultHome),Or.updateFieldDefaults(t.fieldDefaults),Oi.setDefaultHeaders(t.additionalHeaders),this.#f(t.routingInfo,t.actionModel,{server:t.restServerConfig,reAuthUrl:t.serviceConfig.reAuthUrl}),Ur.setAppAlias(t.serviceConfig.appAliasWithoutServlet||t.serviceConfig.appAlias),_(t.serviceConfig.googleMapKey),Ur.initServer(t.serviceConfig.staticContentServer,t.serviceConfig.appStaticContentServer,t.tokens.C11NB2S),Tp.setTimezone(t.timezone),_p.setEnvironmentInfo(n),_p.setLocale(t.locale),$.setRemoteCaseMapping(t.remoteCaseMapping),Cu.setConnectionConfig({messagingService:t.serviceConfig.messagingService}),ac.init(),t.initBroadcast&&yE.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=od({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 EE.getComponentsRegistry().getComponent("ReactRoot").modules.forEach((t=>{e.push(t())})),Promise.allSettled(e)};importDesignSystemComponentMap=async(e,t,n)=>{try{await function(e,t="true"){return new Promise(((n,r)=>{const s=document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("src",e),s.setAttribute("async",t),s.onload=n(),s.onerror=()=>r(new Error("Failed to load resource from Design System")),document.body.appendChild(s)}))}(`${e}component/project/${t}/designsystems/${n}/componentsmap.js?v=${Date.now()}`)}catch(e){console.log(e)}};buildSemanticUrl=(e,t,n,r,s)=>{const a=new URLSearchParams(t);let o=!1;"true"===n&&(o=!0);let i=null,c=null,l=null;if(e){e.startsWith("/")&&(e=e.substring(1));const t=e.split("/");i=t[0],t.length>1&&t[1]&&(c=t[1]),t.length>1&&"assignments"===t[2]&&t[3]&&(l=t[3])}else o=!1;let u=r;i&&(u=`${u}/${i}`),c&&(u=`${u}/${c}`),l&&(u=`${u}/assignments/${l}`),o&&(a.has("noPortal")||a.append("noPortal","true"),c&&s&&a.append("view",s));const d=a.toString();return u+=d?`?${d}`:"",u};initCoreConfig=e=>{const{routingInfo:t,serviceConfig:n,semanticUrl:r,queryParams:s,noPortal:a,noHistory:o,viewName:i,theme:c,restServerConfig:l,dynamicLoadComponents:u=!0,dynamicSemanticUrl:d=!0,renderingMode:p="FULL_PORTAL",envType:h,extras:g}=e,{appAlias:f,contextPath:m}=n;let 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"===_p.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)=>{TE+=1;const c=i||`mashup${TE}`,l={type:"RootContainer",config:{viewConfig:SE,renderingMode:"view",name:c}};EE.loadRootComponent(e,l,s,a,o).then((()=>EE.loadViewByName(t,n,r,c)))};launchView=(e,t,n=[],r,s,a,o)=>{TE+=1;const i="hybrid"===o?`hybrid_${TE}`:o;TE+=1;const c=i||`mashup${TE}`,l={type:"RootContainer",config:{viewConfig:SE,renderingMode:"portal",name:c}};o===j.HYBRID&&ju.setRuntimeParam(j.HYBRID_ROOT_CONTAINERNAME,c),ju.setRuntimeParams(r),EE.loadRootComponent(e,l,n,s,a).then((()=>EE.updateStoreWithUiRoot(t,c)))};launchPortal=(e,t,n,r=[])=>{TE+=1;const s=n||`portal${TE}`,a={type:"RootContainer",config:{viewConfig:SE,renderingMode:"portal",skeleton:"LoadingComponent",name:s}};r.push(a.config.skeleton),_p.isPortalLoaded=!0,EE.loadRootComponent(e,a,r).then((()=>EE.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)}}EE.loadRootComponent(e,n,[PCore.getConstants().LOAD_VIEW_STRING,"ViewContainer"]),window.parent!==window&&s(754)(`${window.PCore.getAssetLoader().getStaticServerUrl()}constellation-mashup-bridge.js`).then((e=>{e.mashup.init({resizing:"stretch"})}))};start=async(e,t)=>{const{appStaticContentServer:n}=e.serviceConfig,{ccV2LibId:r,environmentId:s,isAlternateDesignSystemEnabled:a,alternateDesignSystemName:o}=e;this.initCoreConfig(e);const i=async()=>(await this.importReactRoot(),r&&await Ur.importCustomComponentMap(r),"true"===a&&"other"!==o&&await this.importDesignSystemComponentMap(n,s,o),t&&t(),!0);return new Promise(((e,t)=>{CE().then((async()=>{const t=EE.getComponentsRegistry();"ReactRoot"in t.getLazyMap()?e(!0):t.getComponent("ReactRoot")?e(await i()):fi.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")}},PE={createViewRule:(e,t)=>{const{restApi:n,reqType:r}=Fg("createViewRuleByID");return ki(n,{method:r,body:e},t).then((e=>e.data))},getViewRule:(e,t)=>{const{restApi:n,reqType:r}=Fg("getViewRuleByID",{ID:e});return ki(n,{method:r},t).then((e=>e.data))},updateViewRule:(e,t,n)=>{const{restApi:r,reqType:s}=Fg("updateViewRuleByID",{ID:e});return ki(r,{method:s,body:t},n).then((e=>e.data))},deleteViewRule:(e,t)=>{const{restApi:n,reqType:r}=Fg("deleteViewRuleByID",{ID:e});return ki(n,{method:r},t).then((e=>e.data))}},RE={"Content-Type":"application/json"},DE={addCaseFollower:(e,t,n)=>{const r={caseID:e},s=JSON.stringify({users:t.map((e=>({ID:e})))});return Qi("addCaseFollower",{body:s,queryPayload:r,headers:RE},n)},deleteCaseFollower:(e,t,n)=>Qi("deleteCaseFollower",{queryPayload:{caseID:e,followerID:t}},n),getCaseFollowers:(e,t)=>Qi("getCaseFollowers",{queryPayload:{caseID:e}},t).then((e=>e.data.followers))},bE={addRelatedCases:(e,t,n)=>{const r={caseID:e},s=JSON.stringify({cases:t});return Qi("addRelatedCases",{body:s,queryPayload:r},n)},removeRelatedCase:(e,t,n)=>Qi("removeRelatedCase",{queryPayload:{caseID:e,relatedCaseID:t}},n),getRelatedCases:(e,t)=>Qi("getRelatedCases",{queryPayload:{caseID:e}},t).then((e=>e.data.relatedCases))},OE="operatorDetails",vE={getOperatorDetails:(e,t=!1)=>{const{reqType:n}=Fg(OE,{});if("GET"===n){const t={encodedOperatorId:encodeURIComponent(`{"opname":"${e}"}`)};return Qi(OE,{queryPayload:t})}return t?Qi("operatorDetailsByBusinessID",{body:{dataViewParameters:{BusinessID:e}}}):Qi(OE,{body:{dataViewParameters:{ID:e}}})}},xE=async e=>{const t=$m(e),n=wh.getIn(t,j.COMPONENTS);Mr(t,{},!0);const r=wh.getIn(t,j.LOCALE_REFERENCES);await Tp.loadLocaleResources(r||[]),await Vr(n)},wE=(e,t,n)=>Fh.resolveView(e,t,n),ME={"Content-Type":"application/json"};const LE=new class{constructor(){this.mentionsTagsCancelTokenSource=[],this.mentions=[]}getFeeds=(e,t,n,r,s,a,o)=>{const{getLocaleValue:i}=Tp;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=tc();return s.push(d),Qi("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 xE({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=>{nc(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 Qi("postFeedMessages",{body:a,headers:ME},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 Qi("editFeedMessage",{queryPayload:{messageID:e},body:a,headers:ME},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});Qi(a,{body:o,queryPayload:{pulseContext:e},headers:ME},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);Qi("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)=>Qi("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=tc();return this.mentionsTagsCancelTokenSource.push(i),Qi("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=>{nc(e)||t.reportError(": Error occurred during ajax call at getMentionSuggestions API : ",e.response.data)}))};getMentionTypes=e=>Qi("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=tc();return this.mentionsTagsCancelTokenSource.push(a),Qi("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=>{nc(e)||t.reportError(": Error occurred during ajax call at getTagSuggestions API : ",e.response.data)}))}},UE={getTaggedCases:(e,t)=>Qi("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)=>Qi("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 Qi("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)=>Qi("deleteCaseTag",{queryPayload:{caseID:e,tagID:t}},n.getContextName()).catch((e=>{n.reportError(": Error occurred during ajax call at removeTag API : ",e.response)})),getTagsLandingPageURL:e=>Tu.getPageDataAsync("D_pxGetTagsLandingPageURL",e.getContextName(),{},{invalidateCache:!0}).catch((t=>{e.reportError(": Error occurred during ajax call getTagsLandingPageURL API : ",t.response)}))},FE=(e,t)=>{tp(t.getContextName(),e.etag),np(t.getContextName(),e.etag)},jE={getParticipants:(e,t)=>Qi("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)=>Qi("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)=>Qi("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)=>Qi("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)=>{Qi("createParticipant",{body:a,queryPayload:s,headers:o},r.getContextName()).then((t=>{FE(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)=>{Qi("updateParticipant",{body:n,queryPayload:s,headers:a},r.getContextName()).then((t=>{FE(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)=>{Qi("deleteParticipant",{queryPayload:r,headers:s},n.getContextName()).then((t=>{FE(t.headers,n),e()})).catch((e=>{n.reportError(": Error occurred during ajax call at deleteParticipant API : ",e.response),t(e.response)}))}))}};function VE(e=[]){return e.reduce(((e,t)=>(e[t.personalizationID]={name:t.name,personalizationState:JSON.parse(t.personalizationState||"{}")},e)),{})}const kE="create",$E="update",BE="delete";function GE(e,t,n,r){const s=Qp(t);if(s){switch(e){case kE:case $E:{const{markAsDefault:e,...t}=r;Object.entries(t).length>0&&(s.allPersonalizations[n]=t),e&&(s.defaultPersonalization=n);break}case BE:delete s.allPersonalizations[n],s.defaultPersonalization===n&&(s.defaultPersonalization="");break;default:return null}return s}return null}const WE={},HE=e=>{const t=Qp(e);if(t)return Array.isArray(t.allPersonalizations)&&(t.allPersonalizations=VE(t.allPersonalizations)),Promise.resolve(t);const{restApi:n,reqType:r}=Fg("getUIListPersonalizations",{listID:e});return ki(n,{method:r,body:{}}).then((e=>{const{data:t}=e;return{allPersonalizations:VE(t.allPersonalizations),defaultPersonalization:t.defaultPersonalization}}))},qE=(e,t,n)=>{const{restApi:r,reqType:s}=Fg("createListPersonalization",{listID:e});return GE(kE,e,t,n),ki(r,{method:s,body:{...n,personalizationState:JSON.stringify(n.personalizationState)}}).then((e=>{const n=e.data;return WE[t]=n,e}))},YE=(e,t,n)=>{const r=WE[t]||t;GE($E,e,t,n);const{restApi:s,reqType:a}=Fg("updateListPersonalization",{listID:e,personalizationID:r})||{};return ki(s,{method:a,body:{...n,personalizationState:JSON.stringify(n.personalizationState)}})},zE=(e,t)=>{const n=WE[t]||t;GE(BE,e,t);const{restApi:r,reqType:s}=Fg("deleteListPersonalization",{listID:e,personalizationID:n});return ki(r,{method:s,body:{}}).then((e=>(WE[t]&&delete WE[t],e)))};const KE=function(e){return e?{createPersonalization:qE.bind(null,e),updatePersonalization:YE.bind(null,e),deletePersonalization:zE.bind(null,e),fetchPersonalizations:HE.bind(null,e)}:{createPersonalization:()=>Promise.resolve(""),updatePersonalization:()=>Promise.resolve(),deletePersonalization:()=>Promise.resolve(),fetchPersonalizations:()=>Promise.resolve({})}},XE="getDataObjects",JE="getInsightByID",QE=["LocalList","RemoteList","PromptList","DataPage"];let ZE=null;const eA={},tA=e=>gu.getAppCacheKey(`PrimaryFields-${e}`);function nA(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 rA={getDataObjects:function(){const e=gu.getAppCacheKey(XE);if(window.sessionStorage.getItem(e))return Promise.resolve(JSON.parse(window.sessionStorage.getItem(e)));const{restApi:t,reqType:n}=Fg(XE,{}),r=ki(t,{method:n});return r.then((t=>{window.sessionStorage.setItem(e,JSON.stringify(t))})),r},getDataPageObjects:function(e=!0){if(ZE)return ZE;const t=gu.getAppCacheKey("getDataPageObjects");if(e&&window.sessionStorage.getItem(t))return Promise.resolve(JSON.parse(window.sessionStorage.getItem(t)));const{restApi:n,reqType:r}=Fg("getDataPages",{datapageRequestType:"explorable"});return ZE=ki(n,{method:r,datapageRequestType:"explorable"}),ZE.then((e=>{ZE=null,window.sessionStorage.setItem(t,JSON.stringify(e))})),ZE},getDataViewMetadata:function(e,t,n){if(!t){const{sourceMetadata:t,sourceFields:n}=function(e){const t=Jp(e);if(t&&t.classID){let e=eh(t.classID);const n=new Set(t.primaryFields),r=t.rdFields?.fields?.filter((e=>e.indexOf(".")>0));if(r&&!wh.isEmpty(r)){const n=r.reduce(((e,n)=>{const r=Wp(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&&QE.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:nA(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 Lu.init(r).then((({dataSourceMetaData:e})=>Promise.resolve({data:e})))},getDefaultColumns:function(e){const t=gu.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}=Fg("getListData",{dataViewName:"D_pzGetDefaultColumns"}),s=ki(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=Jp(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=gu.getAppCacheKey(`RDColumns-${e}`);if(window.sessionStorage.getItem(r))return Promise.resolve(JSON.parse(window.sessionStorage.getItem(r)));const s=gu.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=gu.getAppCacheKey(`PFColumns-${e}${t}`);if(window.sessionStorage.getItem(n))return Promise.resolve(JSON.parse(window.sessionStorage.getItem(n)));const r=gu.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=tA(t);window.sessionStorage.getItem(o)||(eA[t]?r.push(eA[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=gu.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=tA(e);window.sessionStorage.setItem(n,JSON.stringify(t))}))})).finally((()=>{e.forEach((e=>{delete eA[e]}))}));return e.forEach((e=>{eA[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=tA(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}=Fg("getInsightIDs");return ki(e,{method:t})},getInsightByID:function(e){const t=Zp(e);if(t)return Promise.resolve({data:{pyInsights:[t]}});const n={insightID:e},{restApi:r,reqType:s}=Fg(JE,n);return ki(r,{method:s})},getInsightsByID:function(e){const t={insightID:e.join(",")},{restApi:n,reqType:r}=Fg(JE,t);return ki(n,{method:r})},createInsight:function(e){const{restApi:t,reqType:n}=Fg("createInsight");return ki(t,{method:n,body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})},updateInsight:function(e,t){const n={insightID:e},{restApi:r,reqType:s}=Fg("updateInsight",n),a=t.UpdateDateTime;return ki(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}=Fg("deleteInsight",t);return ki(n,{method:r})},exportToExcel:function(e){const{restApi:t,reqType:n}=Fg("exportToExcel");return ki(t,{method:n,body:JSON.stringify(e)})},exportToCSV:function(e){const{restApi:t,reqType:n}=Fg("exportToCSV");return ki(t,{method:n,body:JSON.stringify(e)})},scheduleInsight:(e,t)=>{const n={insightID:e},{restApi:r,reqType:s}=Fg("scheduleInsight",n);return ki(r,{method:s,body:JSON.stringify(t)})},updateScheduledInsight:(e,t,n)=>{const r={insightID:e,scheduleID:t},{restApi:s,reqType:a}=Fg("updateScheduledInsight",r);return ki(s,{method:a,body:JSON.stringify(n)})},deleteScheduledInsight:(e,t)=>{const n={insightID:e,scheduleID:t},{restApi:r,reqType:s}=Fg("deleteScheduledInsight",n);return ki(r,{method:s})},translateStrings:function(e){const{restApi:t,reqType:n}=Fg("translateStrings");return ki(t,{method:n,body:JSON.stringify(e)})}};const sA=new class{addRoutes=e=>{return t=e,void Ap.addRoutes(t);var t}};const aA=class{static registerModule(e,t,n){n[e]=()=>t}};const oA=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)},iA={getResolvedSemanticURL:(e,t,n)=>Ap.getResolvedSemanticURL(e,t,n),getActions:()=>({ACTION_OPENWORKBYHANDLE:Be,ACTION_SHOWDATA:Ve,ACTION_SHOWVIEW:je}),updateSemanticURLAndDocumentTitle:e=>Ap.updateSemanticURLAndDocumentTitle(e)};const cA=new class{constructor(){this.genericFailedMessage="Failed to display content. Contact the application administrator."}getGenericFailedMessage(){return this.genericFailedMessage}setGenericFailedMessage(e){this.genericFailedMessage=e}},lA={setTokens:e=>{qi({tokenInfo:e}),Hi(e?.csrf&&!e?.access_token?{pzCTkn:e?.csrf}:{Authorization:`${e?.token_type} ${e?.access_token}`}),setTimeout((()=>fi.publish("updateSession",{updateStatus:"success"})),0)},revokeTokens:async()=>Ii(),getAuthInstance:e=>yi.init(e),setAuthorizationHeader:e=>{Hi({Authorization:e}),setTimeout((()=>fi.publish("updateSession",{updateStatus:"success"})),0)}};const uA=new class{getDebouncedSubject(e){return(new mf).pipe(JI(e))}};xr.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=Tp.getLocaleValue("Enter a valid email address","Messages")),t})),xr.register("integer",(e=>{let t=null;return e&&!/^(-)?\d+$/.test(e)&&(t=Tp.getLocaleValue("Invalid number","Messages")),t})),xr.register("required",(e=>Array.isArray(e)&&0===e.length||null==e||""===e?Tp.getLocaleValue("Cannot be blank","Messages"):null)),xr.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=Tp.getLocaleValue("Enter a valid url","Messages")),t})),setTimeout((()=>{const e=Tp.getLocaleValue("Enter a valid phone number","Messages");s.e(654).then(s.bind(s,654)).then((({parsePhoneNumberFromString:t})=>{xr.register("phone",(n=>{let r=null;n&&!/^\+?\d+$/.test(n)&&(r=e);const s=n?.startsWith("+");if(n&&s){const s=t(n);s?.isPossible()&&n===s?.number||(r=e)}return r}))}))}),j.PRIORITY.TRIVIAL);const dA=(e,t)=>{switch(t){case"invalid":return Tp.getLocaleValue(`Incorrect ${e}`,"Messages");case"incomplete":return Tp.getLocaleValue(`Incomplete ${e}`,"Messages");default:return null}};xr.register("datetime",(e=>dA("DateTime",e))),xr.register("date",(e=>dA("Date",e))),xr.register("time",(e=>dA("Time",e))),xr.register("attachment",((e,t)=>(Ah(`.attachmentsList${t.pageReference?.replace("caseInfo.content","")}${t.property}`,"context_data",t.context)||[]).some((e=>e.props?.error))?Tp.getLocaleValue("Error with one or more files"):null));const pA={createConversation:(e,t,n,r=[])=>{for(const e of r)e?.cancel&&"function"==typeof e.cancel&&e.cancel();const s=tc();r.push(s);const a={assistantID:t},o=JSON.stringify({contextID:e});return Qi("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 Qi("sendMessage",{body:a,queryPayload:s},r)}};const hA=class{caseTypeAccessMap=new Map;constructor(){this.caseTypeAccessMap=_p.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 gA{constructor(){gA.behaviorOverrides={}}static behaviorOverrides={};getPCoreVersion=()=>"24.2.3";onPCoreReady=e=>EE.onPCoreReady(e);onPCoreCleanup=e=>EE.onPCoreCleanup(e);getComponentsRegistry=()=>EE.getComponentsRegistry();checkIfSemanticURL=()=>EE.checkIfSemanticURL();isValidSemanticURL=()=>(()=>{if(zg()){const e=Ap.processUrl(mp(),!0);return!!Ap._getMatchedRouteInRoutingTable(e)}return!1})();getRoutingUtils=()=>sA;getViewResources=()=>d;configureForBrowserBookmark=e=>EE.configureForBrowserBookmark(e);getStore=()=>fh();resetStore=()=>Oh();getMessageManager=()=>er;getCoexistenceManager=()=>yE;getStoreValue=(e,t,n)=>Ah(e,t,n);getContainerUtils=()=>i;getAnnotationUtils=()=>El;getFieldUtils=()=>$n;getFieldDefaultUtils=()=>Or;getAssetLoader=()=>Ur;getAttachmentUtils=()=>vp;getViewRuleApi=()=>PE;getFeedUtils=()=>LE;getTagUtils=()=>UE;getGenAIAssistantUtils=()=>pA;getStakeholderUtils=()=>jE;getUserApi=()=>vE;getCaseFollowerApi=()=>DE;getCaseUtils=()=>vc;getStateUtils=()=>Xu;getRelatedCasesApi=()=>bE;getPersonalizationUtils=KE;getDataApi=()=>Lu;getDataApiUtils=()=>gu;getAnalyticsUtils=()=>rA;getLocaleUtils=()=>Tp;registerLocaleManager=e=>{const t=this.getLocaleUtils();Object.keys(e).forEach((n=>{t[n]=e[n]}))};setBehaviorOverrides=e=>{gA.behaviorOverrides=e};setBehaviorOverride=(e,t)=>{gA.behaviorOverrides[e]=t};getBehaviorOverrides=()=>gA.behaviorOverrides;getBehaviorOverride=e=>gA.behaviorOverrides[e];getAsynchronousUtils=()=>uA;createPConnect=e=>od(e);getPubSubUtils=()=>fi;registerComponentCreator=e=>{id(e)};getConstants=()=>Object.freeze(F);getEvents=()=>oA;getRestClient=()=>o;getMashupApi=()=>IE;getEnvironmentInfo=()=>_p;getRuntimeParamsAPI=()=>ju;getSemanticUrlUtils=()=>iA;getRemoteCaseUtils=()=>$;getNavigationUtils=()=>ac;registerModule=(e,t)=>aA.registerModule(e,t,this);getErrorHandler=()=>cA;getFormUtils=()=>rl;getMessagingServiceManager=()=>Cu;getMetadataUtils=()=>c;getDataPageUtils=()=>Tu;getDataTypeUtils=()=>Hl;getCascadeManager=()=>dh;isDeepEqual=(e,t)=>h()(e,t);getAuthUtils=()=>lA;getDebugger=()=>Di;getDeferLoadManager=()=>pu;getExpressionEngine=()=>n;getActionsSequencer=()=>Vu;getRefreshManager=()=>Cl;getInitialiser=()=>NE;getAllStateMachines=(e,t,n)=>t&&n?sl.getAllStateMachines(e,t,n):sl.getAllStateMachinesByContext(e);getBootstrapUtils=()=>EE;getContextTreeManager=()=>Rn;getAccessPrivilege=()=>hA.getInstance()}const fA=new gA;s.g.PCore=fA})()})();
1
+ (()=>{var e,t,n={851:(e,t,n)=>{"use strict";var r=n(681);Object.defineProperty(t,"reduxBatch",{enumerable:!0,get:function(){return r.reduxBatch}})},681:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reduxBatch=function(e){var t=[],n=void 0;function r(){t===n&&(t=t.slice())}function s(e){if("function"!=typeof e)throw new Error("Invalid listener, expected a function");var n=!0;return r(),t.push(e),function(){n&&(r(),t.splice(t.indexOf(e),1),n=!1)}}function a(){for(var e=t,r=0;r<e.length;++r)n=e,e[r]()}return function(){var t=e.apply(void 0,arguments),n=!1,r=!1;function o(e){return Array.isArray(e)?e.map((function(e){return o(e)})):t.dispatch(e)}return t.subscribe((function(){r?n=!0:a()})),Object.assign({},t,{dispatch:function(e){var t=r;t||(n=!1,r=!0);var s=o(e),i=n&&!t;return t||(n=!1,r=!1),i&&a(),s},subscribe:s})}}},52:(e,t,n)=>{e.exports=n(851)},631:(e,t,n)=>{var r="__lodash_hash_undefined__",s=9007199254740991,a="[object Arguments]",o="[object Function]",i="[object GeneratorFunction]",c=/^\[object .+?Constructor\]$/,l="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,u="object"==typeof self&&self&&self.Object===Object&&self,d=l||u||Function("return this")();function p(e,t){return!!(e?e.length:0)&&function(e,t,n){if(t!=t)return function(e,t,n,r){var s=e.length,a=n+(r?1:-1);for(;r?a--:++a<s;)if(t(e[a],a,e))return a;return-1}(e,f,n);var r=n-1,s=e.length;for(;++r<s;)if(e[r]===t)return r;return-1}(e,t,0)>-1}function h(e,t,n){for(var r=-1,s=e?e.length:0;++r<s;)if(n(t,e[r]))return!0;return!1}function g(e,t){for(var n=-1,r=t.length,s=e.length;++n<r;)e[s+n]=t[n];return e}function f(e){return e!=e}function m(e,t){return e.has(t)}var y,E=Array.prototype,I=Function.prototype,A=Object.prototype,_=d["__core-js_shared__"],C=(y=/[^.]+$/.exec(_&&_.keys&&_.keys.IE_PROTO||""))?"Symbol(src)_1."+y:"",S=I.toString,T=A.hasOwnProperty,N=A.toString,R=RegExp("^"+S.call(T).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),P=d.Symbol,D=A.propertyIsEnumerable,b=E.splice,O=P?P.isConcatSpreadable:void 0,v=Math.max,x=G(d,"Map"),w=G(Object,"create");function M(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function L(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function 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)?R:c;return n.test(function(e){if(null!=e){try{return S.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function B(e,t){var n,r,s=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?s["string"==typeof t?"string":"hash"]:s.map}function G(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return $(n)?n:void 0}function W(e){return Y(e)||function(e){return X(e)&&T.call(e,"callee")&&(!D.call(e,"callee")||N.call(e)==a)}(e)||!!(O&&e&&e[O])}M.prototype.clear=function(){this.__data__=w?w(null):{}},M.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},M.prototype.get=function(e){var t=this.__data__;if(w){var n=t[e];return n===r?void 0:n}return T.call(t,e)?t[e]:void 0},M.prototype.has=function(e){var t=this.__data__;return w?void 0!==t[e]:T.call(t,e)},M.prototype.set=function(e,t){return this.__data__[e]=w&&void 0===t?r:t,this},L.prototype.clear=function(){this.__data__=[]},L.prototype.delete=function(e){var t=this.__data__,n=j(t,e);return!(n<0)&&(n==t.length-1?t.pop():b.call(t,n,1),!0)},L.prototype.get=function(e){var t=this.__data__,n=j(t,e);return n<0?void 0:t[n][1]},L.prototype.has=function(e){return j(this.__data__,e)>-1},L.prototype.set=function(e,t){var n=this.__data__,r=j(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},U.prototype.clear=function(){this.__data__={hash:new M,map:new(x||L),string:new M}},U.prototype.delete=function(e){return B(this,e).delete(e)},U.prototype.get=function(e){return B(this,e).get(e)},U.prototype.has=function(e){return B(this,e).has(e)},U.prototype.set=function(e,t){return B(this,e).set(e,t),this},F.prototype.add=F.prototype.push=function(e){return this.__data__.set(e,r),this},F.prototype.has=function(e){return this.__data__.has(e)};var H,q,z=(H=function(e,t){return X(e)?V(e,k(t,1,X,!0)):[]},q=v(void 0===q?H.length-1:q,0),function(){for(var e=arguments,t=-1,n=v(e.length-q,0),r=Array(n);++t<n;)r[t]=e[q+t];t=-1;for(var s=Array(q+1);++t<q;)s[t]=e[t];return s[q]=r,function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}(H,this,s)});var Y=Array.isArray;function K(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=s}(e.length)&&!J(e)}function X(e){return function(e){return!!e&&"object"==typeof e}(e)&&K(e)}function J(e){var t=Q(e)?N.call(e):"";return t==o||t==i}function Q(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=z},188:(e,t,n)=>{var r="__lodash_hash_undefined__",s=1/0,a="[object Function]",o="[object GeneratorFunction]",i="[object Symbol]",c=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,l=/^\w*$/,u=/^\./,d=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,p=/\\(\\)?/g,h=/^\[object .+?Constructor\]$/,g="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,f="object"==typeof self&&self&&self.Object===Object&&self,m=g||f||Function("return this")();var y,E=Array.prototype,I=Function.prototype,A=Object.prototype,_=m["__core-js_shared__"],C=(y=/[^.]+$/.exec(_&&_.keys&&_.keys.IE_PROTO||""))?"Symbol(src)_1."+y:"",S=I.toString,T=A.hasOwnProperty,N=A.toString,R=RegExp("^"+S.call(T).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),P=m.Symbol,D=E.splice,b=k(m,"Map"),O=k(Object,"create"),v=P?P.prototype:void 0,x=v?v.toString:void 0;function w(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function M(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function L(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function 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)?R:h;return n.test(function(e){if(null!=e){try{return S.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function V(e,t){var n,r,s=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?s["string"==typeof t?"string":"hash"]:s.map}function k(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return j(n)?n:void 0}w.prototype.clear=function(){this.__data__=O?O(null):{}},w.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},w.prototype.get=function(e){var t=this.__data__;if(O){var n=t[e];return n===r?void 0:n}return T.call(t,e)?t[e]:void 0},w.prototype.has=function(e){var t=this.__data__;return O?void 0!==t[e]:T.call(t,e)},w.prototype.set=function(e,t){return this.__data__[e]=O&&void 0===t?r:t,this},M.prototype.clear=function(){this.__data__=[]},M.prototype.delete=function(e){var t=this.__data__,n=U(t,e);return!(n<0)&&(n==t.length-1?t.pop():D.call(t,n,1),!0)},M.prototype.get=function(e){var t=this.__data__,n=U(t,e);return n<0?void 0:t[n][1]},M.prototype.has=function(e){return U(this.__data__,e)>-1},M.prototype.set=function(e,t){var n=this.__data__,r=U(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},L.prototype.clear=function(){this.__data__={hash:new w,map:new(b||M),string:new w}},L.prototype.delete=function(e){return V(this,e).delete(e)},L.prototype.get=function(e){return V(this,e).get(e)},L.prototype.has=function(e){return V(this,e).has(e)},L.prototype.set=function(e,t){return V(this,e).set(e,t),this};var $=G((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(q(e))return x?x.call(e):"";var t=e+"";return"0"==t&&1/e==-s?"-0":t}(t);var n=[];return u.test(e)&&n.push(""),e.replace(d,(function(e,t,r,s){n.push(r?s.replace(p,"$1"):t||e)})),n}));function B(e){if("string"==typeof e||q(e))return e;var t=e+"";return"0"==t&&1/e==-s?"-0":t}function G(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,s=t?t.apply(this,r):r[0],a=n.cache;if(a.has(s))return a.get(s);var o=e.apply(this,r);return n.cache=a.set(s,o),o};return n.cache=new(G.Cache||L),n}G.Cache=L;var W=Array.isArray;function H(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function q(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&N.call(e)==i}e.exports=function(e,t,n){var r=null==e?void 0:F(e,t);return void 0===r?n:r}},928:(e,t,n)=>{var r="__lodash_hash_undefined__",s=1/0,a=9007199254740991,o="[object Arguments]",i="[object Function]",c="[object GeneratorFunction]",l="[object Symbol]",u=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,d=/^\w*$/,p=/^\./,h=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,g=/\\(\\)?/g,f=/^\[object .+?Constructor\]$/,m=/^(?:0|[1-9]\d*)$/,y="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,E="object"==typeof self&&self&&self.Object===Object&&self,I=y||E||Function("return this")();var A,_=Array.prototype,C=Function.prototype,S=Object.prototype,T=I["__core-js_shared__"],N=(A=/[^.]+$/.exec(T&&T.keys&&T.keys.IE_PROTO||""))?"Symbol(src)_1."+A:"",R=C.toString,P=S.hasOwnProperty,D=S.toString,b=RegExp("^"+R.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),O=I.Symbol,v=S.propertyIsEnumerable,x=_.splice,w=W(I,"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&&P.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 R.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)&&P.call(e,"callee")&&(!v.call(e,"callee")||D.call(e)==o)}(e))}F.prototype.clear=function(){this.__data__=M?M(null):{}},F.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},F.prototype.get=function(e){var t=this.__data__;if(M){var n=t[e];return n===r?void 0:n}return P.call(t,e)?t[e]:void 0},F.prototype.has=function(e){var t=this.__data__;return M?void 0!==t[e]:P.call(t,e)},F.prototype.set=function(e,t){return this.__data__[e]=M&&void 0===t?r:t,this},j.prototype.clear=function(){this.__data__=[]},j.prototype.delete=function(e){var t=this.__data__,n=k(t,e);return!(n<0)&&(n==t.length-1?t.pop():x.call(t,n,1),!0)},j.prototype.get=function(e){var t=this.__data__,n=k(t,e);return n<0?void 0:t[n][1]},j.prototype.has=function(e){return k(this.__data__,e)>-1},j.prototype.set=function(e,t){var n=this.__data__,r=k(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},V.prototype.clear=function(){this.__data__={hash:new F,map:new(w||j),string:new F}},V.prototype.delete=function(e){return G(this,e).delete(e)},V.prototype.get=function(e){return G(this,e).get(e)},V.prototype.has=function(e){return G(this,e).has(e)},V.prototype.set=function(e,t){return G(this,e).set(e,t),this};var q=Y((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(ee(e))return U?U.call(e):"";var t=e+"";return"0"==t&&1/e==-s?"-0":t}(t);var n=[];return p.test(e)&&n.push(""),e.replace(h,(function(e,t,r,s){n.push(r?s.replace(g,"$1"):t||e)})),n}));function z(e){if("string"==typeof e||ee(e))return e;var t=e+"";return"0"==t&&1/e==-s?"-0":t}function Y(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,s=t?t.apply(this,r):r[0],a=n.cache;if(a.has(s))return a.get(s);var o=e.apply(this,r);return n.cache=a.set(s,o),o};return n.cache=new(Y.Cache||V),n}Y.Cache=V;var K=Array.isArray;function X(e){var t=Q(e)?D.call(e):"";return t==i||t==c}function J(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=a}function Q(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Z(e){return!!e&&"object"==typeof e}function ee(e){return"symbol"==typeof e||Z(e)&&D.call(e)==l}e.exports=function(e,t){return null!=e&&H(e,t,$)}},529:(e,t,n)=>{e=n.nmd(e);var r=9007199254740991,s="[object Arguments]",a="[object Function]",o="[object GeneratorFunction]",i="[object Map]",c="[object Promise]",l="[object Set]",u="[object WeakMap]",d="[object DataView]",p=/^\[object .+?Constructor\]$/,h="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,g="object"==typeof self&&self&&self.Object===Object&&self,f=h||g||Function("return this")(),m=t&&!t.nodeType&&t,y=m&&e&&!e.nodeType&&e,E=y&&y.exports===m;var I,A,_,C=Function.prototype,S=Object.prototype,T=f["__core-js_shared__"],N=(I=/[^.]+$/.exec(T&&T.keys&&T.keys.IE_PROTO||""))?"Symbol(src)_1."+I:"",R=C.toString,P=S.hasOwnProperty,D=S.toString,b=RegExp("^"+R.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),O=E?f.Buffer:void 0,v=S.propertyIsEnumerable,x=O?O.isBuffer:void 0,w=(A=Object.keys,_=Object,function(e){return A(_(e))}),M=q(f,"DataView"),L=q(f,"Map"),U=q(f,"Promise"),F=q(f,"Set"),j=q(f,"WeakMap"),V=!v.call({valueOf:1},"valueOf"),k=Y(M),$=Y(L),B=Y(U),G=Y(F),W=Y(j);function H(e){if(!ee(e)||function(e){return!!N&&N in e}(e))return!1;var t=Z(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?b:p;return t.test(Y(e))}function q(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return H(n)?n:void 0}var z=function(e){return D.call(e)};function Y(e){if(null!=e){try{return R.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)&&P.call(e,"callee")&&(!v.call(e,"callee")||D.call(e)==s)}(M&&z(new M(new ArrayBuffer(1)))!=d||L&&z(new L)!=i||U&&z(U.resolve())!=c||F&&z(new F)!=l||j&&z(new j)!=u)&&(z=function(e){var t=D.call(e),n="[object Object]"==t?e.constructor:void 0,r=n?Y(n):void 0;if(r)switch(r){case k:return d;case $:return i;case B:return c;case G:return l;case W:return u}return t});var X=Array.isArray;function J(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}(e.length)&&!Z(e)}var Q=x||function(){return!1};function Z(e){var t=ee(e)?D.call(e):"";return t==a||t==o}function ee(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=function(e){if(J(e)&&(X(e)||"string"==typeof e||"function"==typeof e.splice||Q(e)||K(e)))return!e.length;var t=z(e);if(t==i||t==l)return!e.size;if(V||function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||S)}(e))return!w(e).length;for(var n in e)if(P.call(e,n))return!1;return!0}},216:(e,t,n)=>{e=n.nmd(e);var r="__lodash_hash_undefined__",s=1,a=2,o=9007199254740991,i="[object Arguments]",c="[object Array]",l="[object AsyncFunction]",u="[object Boolean]",d="[object Date]",p="[object Error]",h="[object Function]",g="[object GeneratorFunction]",f="[object Map]",m="[object Number]",y="[object Null]",E="[object Object]",I="[object Promise]",A="[object Proxy]",_="[object RegExp]",C="[object Set]",S="[object String]",T="[object Symbol]",N="[object Undefined]",R="[object WeakMap]",P="[object ArrayBuffer]",D="[object DataView]",b=/^\[object .+?Constructor\]$/,O=/^(?:0|[1-9]\d*)$/,v={};v["[object Float32Array]"]=v["[object Float64Array]"]=v["[object Int8Array]"]=v["[object Int16Array]"]=v["[object Int32Array]"]=v["[object Uint8Array]"]=v["[object Uint8ClampedArray]"]=v["[object Uint16Array]"]=v["[object Uint32Array]"]=!0,v[i]=v[c]=v[P]=v[u]=v[D]=v[d]=v[p]=v[h]=v[f]=v[m]=v[E]=v[_]=v[C]=v[S]=v[R]=!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),Ee=Ge(pe),Ie=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 Re(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Pe(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Re;++t<n;)this.add(e[t])}function De(e){var t=this.__data__=new Ne(e);this.size=t.size}function be(e,t){var n=qe(e),r=!n&&He(e),s=!n&&!r&&ze(e),a=!n&&!r&&!s&&Qe(e),o=n||r||s||a,i=o?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],c=i.length;for(var l in e)!t&&!Q.call(e,l)||o&&("length"==l||s&&("offset"==l||"parent"==l)||a&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Be(l,c))||i.push(l);return i}function Oe(e,t){for(var n=e.length;n--;)if(We(e[n][0],t))return n;return-1}function ve(e){return null==e?void 0===e?N:y:ie&&ie in Object(e)?function(e){var t=Q.call(e,ie),n=e[ie];try{e[ie]=void 0;var r=!0}catch(e){}var s=ee.call(e);r&&(t?e[ie]=n:delete e[ie]);return s}(e):function(e){return ee.call(e)}(e)}function xe(e){return Je(e)&&ve(e)==i}function we(e,t,n,r,o){return e===t||(null==e||null==t||!Je(e)&&!Je(t)?e!=e&&t!=t:function(e,t,n,r,o,l){var h=qe(e),g=qe(t),y=h?c:$e(e),I=g?c:$e(t),A=(y=y==i?E:y)==E,N=(I=I==i?E:I)==E,R=y==I;if(R&&ze(e)){if(!ze(t))return!1;h=!0,A=!1}if(R&&!A)return l||(l=new De),h||Qe(e)?Ue(e,t,n,r,o,l):function(e,t,n,r,o,i,c){switch(n){case D:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case P:return!(e.byteLength!=t.byteLength||!i(new se(e),new se(t)));case u:case d:case m:return We(+e,+t);case p:return e.name==t.name&&e.message==t.message;case _:case S:return e==t+"";case f:var l=B;case C:var h=r&s;if(l||(l=G),e.size!=t.size&&!h)return!1;var g=c.get(e);if(g)return g==t;r|=a,c.set(e,t);var y=Ue(l(e),l(t),r,o,i,c);return c.delete(e),y;case T:if(Se)return Se.call(e)==Se.call(t)}return!1}(e,t,y,n,r,o,l);if(!(n&s)){var b=A&&Q.call(e,"__wrapped__"),O=N&&Q.call(t,"__wrapped__");if(b||O){var v=b?e.value():e,x=O?t.value():t;return l||(l=new De),o(v,x,n,r,l)}}if(!R)return!1;return l||(l=new De),function(e,t,n,r,a,o){var i=n&s,c=Fe(e),l=c.length,u=Fe(t),d=u.length;if(l!=d&&!i)return!1;var p=l;for(;p--;){var h=c[p];if(!(i?h in t:Q.call(t,h)))return!1}var g=o.get(e);if(g&&o.get(t))return g==t;var f=!0;o.set(e,t),o.set(t,e);var m=i;for(;++p<l;){var y=e[h=c[p]],E=t[h];if(r)var I=i?r(E,y,h,t,e,o):r(y,E,h,e,t,o);if(!(void 0===I?y===E||a(y,E,n,r,o):I)){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 Pe: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},Re.prototype.clear=function(){this.size=0,this.__data__={hash:new Te,map:new(pe||Ne),string:new Te}},Re.prototype.delete=function(e){var t=je(this,e).delete(e);return this.size-=t?1:0,t},Re.prototype.get=function(e){return je(this,e).get(e)},Re.prototype.has=function(e){return je(this,e).has(e)},Re.prototype.set=function(e,t){var n=je(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Pe.prototype.add=Pe.prototype.push=function(e){return this.__data__.set(e,r),this},Pe.prototype.has=function(e){return this.__data__.has(e)},De.prototype.clear=function(){this.__data__=new Ne,this.size=0},De.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},De.prototype.get=function(e){return this.__data__.get(e)},De.prototype.has=function(e){return this.__data__.has(e)},De.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Ne){var r=n.__data__;if(!pe||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Re(r)}return n.set(e,t),this.size=n.size,this};var ke=ce?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,s=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[s++]=o)}return a}(ce(e),(function(t){return ae.call(e,t)})))}:function(){return[]},$e=ve;function Be(e,t){return!!(t=null==t?o:t)&&("number"==typeof e||O.test(e))&&e>-1&&e%1==0&&e<t}function Ge(e){if(null!=e){try{return J.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function We(e,t){return e===t||e!=e&&t!=t}(de&&$e(new de(new ArrayBuffer(1)))!=D||pe&&$e(new pe)!=f||he&&$e(he.resolve())!=I||ge&&$e(new ge)!=C||fe&&$e(new fe)!=R)&&($e=function(e){var t=ve(e),n=t==E?e.constructor:void 0,r=n?Ge(n):"";if(r)switch(r){case ye:return D;case Ee:return f;case Ie:return I;case Ae:return C;case _e:return R}return t});var He=xe(function(){return arguments}())?xe:function(e){return Je(e)&&Q.call(e,"callee")&&!ae.call(e,"callee")},qe=Array.isArray;var ze=le||function(){return!1};function Ye(e){if(!Xe(e))return!1;var t=ve(e);return t==h||t==g||t==l||t==A}function Ke(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}function Xe(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Je(e){return null!=e&&"object"==typeof e}var Qe=k?function(e){return function(t){return e(t)}}(k):function(e){return Je(e)&&Ke(e.length)&&!!v[ve(e)]};function Ze(e){return null!=(t=e)&&Ke(t.length)&&!Ye(t)?be(e):Le(e);var t}e.exports=function(e,t){return we(e,t)}},692:(e,t,n)=>{e=n.nmd(e);var r="__lodash_hash_undefined__",s=9007199254740991,a="[object Arguments]",o="[object AsyncFunction]",i="[object Function]",c="[object GeneratorFunction]",l="[object Null]",u="[object Object]",d="[object Proxy]",p="[object Undefined]",h=/^\[object .+?Constructor\]$/,g=/^(?:0|[1-9]\d*)$/,f={};f["[object Float32Array]"]=f["[object Float64Array]"]=f["[object Int8Array]"]=f["[object Int16Array]"]=f["[object Int32Array]"]=f["[object Uint8Array]"]=f["[object Uint8ClampedArray]"]=f["[object Uint16Array]"]=f["[object Uint32Array]"]=!0,f[a]=f["[object Array]"]=f["[object ArrayBuffer]"]=f["[object Boolean]"]=f["[object DataView]"]=f["[object Date]"]=f["[object Error]"]=f[i]=f["[object Map]"]=f["[object Number]"]=f[u]=f["[object RegExp]"]=f["[object Set]"]=f["[object String]"]=f["[object WeakMap]"]=!1;var m="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,y="object"==typeof self&&self&&self.Object===Object&&self,E=m||y||Function("return this")(),I=t&&!t.nodeType&&t,A=I&&e&&!e.nodeType&&e,_=A&&A.exports===I,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,R,P,D=Array.prototype,b=Function.prototype,O=Object.prototype,v=E["__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=_?E.Buffer:void 0,V=E.Symbol,k=E.Uint8Array,$=j?j.allocUnsafe:void 0,B=(R=Object.getPrototypeOf,P=Object,function(e){return R(P(e))}),G=Object.create,W=O.propertyIsEnumerable,H=D.splice,q=V?V.toStringTag:void 0,z=function(){try{var e=Ie(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),Y=j?j.isBuffer:void 0,K=Math.max,X=Date.now,J=Ie(E,"Map"),Q=Ie(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=Re(e),r=!n&&Ne(e),s=!n&&!r&&De(e),a=!n&&!r&&!s&&we(e),o=n||r||s||a,i=o?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],c=i.length;for(var l in e)!t&&!w.call(e,l)||o&&("length"==l||s&&("offset"==l||"parent"==l)||a&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Ae(l,c))||i.push(l);return i}function ae(e,t,n){(void 0!==n&&!Te(e[t],n)||void 0===n&&!(t in e))&&ce(e,t,n)}function oe(e,t,n){var r=e[t];w.call(e,t)&&Te(r,n)&&(void 0!==n||t in e)||ce(e,t,n)}function ie(e,t){for(var n=e.length;n--;)if(Te(e[n][0],t))return n;return-1}function ce(e,t,n){"__proto__"==t&&z?z(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}ee.prototype.clear=function(){this.__data__=Q?Q(null):{},this.size=0},ee.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ee.prototype.get=function(e){var t=this.__data__;if(Q){var n=t[e];return n===r?void 0:n}return w.call(t,e)?t[e]:void 0},ee.prototype.has=function(e){var t=this.__data__;return Q?void 0!==t[e]:w.call(t,e)},ee.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Q&&void 0===t?r:t,this},te.prototype.clear=function(){this.__data__=[],this.size=0},te.prototype.delete=function(e){var t=this.__data__,n=ie(t,e);return!(n<0)&&(n==t.length-1?t.pop():H.call(t,n,1),--this.size,!0)},te.prototype.get=function(e){var t=this.__data__,n=ie(t,e);return n<0?void 0:t[n][1]},te.prototype.has=function(e){return ie(this.__data__,e)>-1},te.prototype.set=function(e,t){var n=this.__data__,r=ie(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},ne.prototype.clear=function(){this.size=0,this.__data__={hash:new ee,map:new(J||te),string:new ee}},ne.prototype.delete=function(e){var t=Ee(this,e).delete(e);return this.size-=t?1:0,t},ne.prototype.get=function(e){return Ee(this,e).get(e)},ne.prototype.has=function(e){return Ee(this,e).has(e)},ne.prototype.set=function(e,t){var n=Ee(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=Re(c),g=!h&&De(c),f=!h&&!g&&we(c);d=c,h||g||f?Re(i)?d=i:xe(A=i)&&Pe(A)?d=function(e,t){var n=-1,r=e.length;t||(t=Array(r));for(;++n<r;)t[n]=e[n];return t}(i):g?(p=!1,d=function(e,t){if(t)return e.slice();var n=e.length,r=$?$(n):new e.constructor(n);return e.copy(r),r}(c,!0)):f?(p=!1,m=c,y=!0?(E=m.buffer,I=new E.constructor(E.byteLength),new k(I).set(new k(E)),I):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,E,I;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 Ee(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 Ie(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")},Re=Array.isArray;function Pe(e){return null!=e&&Oe(e.length)&&!be(e)}var De=Y||function(){return!1};function be(e){if(!ve(e))return!1;var t=de(e);return t==i||t==c||t==o||t==d}function Oe(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=s}function ve(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function xe(e){return null!=e&&"object"==typeof e}var we=T?function(e){return function(t){return e(t)}}(T):function(e){return xe(e)&&Oe(e.length)&&!!f[de(e)]};function Me(e){return Pe(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?Pe(n)&&Ae(t,n.length):"string"==r&&t in n)&&Te(n[t],e)}(t[0],t[1],a)&&(s=r<3?void 0:s,r=1),e=Object(e);++n<r;){var o=t[n];o&&Le(e,o,n,s)}return e})));function Fe(e){return e}e.exports=Ue},835:(e,t,n)=>{var r="__lodash_hash_undefined__",s=1/0,a=9007199254740991,o="[object Function]",i="[object GeneratorFunction]",c="[object Symbol]",l=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u=/^\w*$/,d=/^\./,p=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,h=/\\(\\)?/g,g=/^\[object .+?Constructor\]$/,f=/^(?:0|[1-9]\d*)$/,m="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,y="object"==typeof self&&self&&self.Object===Object&&self,E=m||y||Function("return this")();var I,A=Array.prototype,_=Function.prototype,C=Object.prototype,S=E["__core-js_shared__"],T=(I=/[^.]+$/.exec(S&&S.keys&&S.keys.IE_PROTO||""))?"Symbol(src)_1."+I:"",N=_.toString,R=C.hasOwnProperty,P=C.toString,D=RegExp("^"+N.call(R).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),b=E.Symbol,O=A.splice,v=G(E,"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];R.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)?P.call(e):"";return t==o||t==i}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?D:g;return n.test(function(e){if(null!=e){try{return N.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function $(e,t,n,r){if(!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 R.call(t,e)?t[e]:void 0},L.prototype.has=function(e){var t=this.__data__;return x?void 0!==t[e]:R.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)&&P.call(e)==c}e.exports=function(e,t,n){return null==e?e:$(e,t,n)}},521:(e,t,n)=>{var r="__lodash_hash_undefined__",s=1/0,a="[object Function]",o="[object GeneratorFunction]",i="[object Symbol]",c=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,l=/^\w*$/,u=/^\./,d=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,p=/\\(\\)?/g,h=/^\[object .+?Constructor\]$/,g="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,f="object"==typeof self&&self&&self.Object===Object&&self,m=g||f||Function("return this")();var y,E=Array.prototype,I=Function.prototype,A=Object.prototype,_=m["__core-js_shared__"],C=(y=/[^.]+$/.exec(_&&_.keys&&_.keys.IE_PROTO||""))?"Symbol(src)_1."+y:"",S=I.toString,T=A.hasOwnProperty,N=A.toString,R=RegExp("^"+S.call(T).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),P=m.Symbol,D=E.splice,b=$(m,"Map"),O=$(Object,"create"),v=P?P.prototype:void 0,x=v?v.toString:void 0;function w(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function M(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function L(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function 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)?R:h;return n.test(function(e){if(null!=e){try{return S.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function j(e,t){e=function(e,t){return 1==t.length?e:function(e,t){for(var n=0,r=(t=B(t,e)?[t]:V(t)).length;null!=e&&n<r;)e=e[W(t[n++])];return n&&n==r?e:void 0}(e,function(e,t,n){var r=-1,s=e.length;t<0&&(t=-t>s?0:s+t),(n=n>s?s:n)<0&&(n+=s),s=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(s);++r<s;)a[r]=e[r+t];return a}(t,0,-1))}(e,t=B(t,e)?[t]:V(t));var n,r,s=W((r=(n=t)?n.length:0)?n[r-1]:void 0);return!(null!=e&&T.call(e,s))||delete e[s]}function V(e){return q(e)?e:G(e)}function k(e,t){var n,r,s=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?s["string"==typeof t?"string":"hash"]:s.map}function $(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return F(n)?n:void 0}function B(e,t){if(q(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Y(e))||(l.test(e)||!c.test(e)||null!=t&&e in Object(t))}w.prototype.clear=function(){this.__data__=O?O(null):{}},w.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},w.prototype.get=function(e){var t=this.__data__;if(O){var n=t[e];return n===r?void 0:n}return T.call(t,e)?t[e]:void 0},w.prototype.has=function(e){var t=this.__data__;return O?void 0!==t[e]:T.call(t,e)},w.prototype.set=function(e,t){return this.__data__[e]=O&&void 0===t?r:t,this},M.prototype.clear=function(){this.__data__=[]},M.prototype.delete=function(e){var t=this.__data__,n=U(t,e);return!(n<0)&&(n==t.length-1?t.pop():D.call(t,n,1),!0)},M.prototype.get=function(e){var t=this.__data__,n=U(t,e);return n<0?void 0:t[n][1]},M.prototype.has=function(e){return U(this.__data__,e)>-1},M.prototype.set=function(e,t){var n=this.__data__,r=U(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},L.prototype.clear=function(){this.__data__={hash:new w,map:new(b||M),string:new w}},L.prototype.delete=function(e){return k(this,e).delete(e)},L.prototype.get=function(e){return k(this,e).get(e)},L.prototype.has=function(e){return k(this,e).has(e)},L.prototype.set=function(e,t){return k(this,e).set(e,t),this};var G=H((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(Y(e))return x?x.call(e):"";var t=e+"";return"0"==t&&1/e==-s?"-0":t}(t);var n=[];return u.test(e)&&n.push(""),e.replace(d,(function(e,t,r,s){n.push(r?s.replace(p,"$1"):t||e)})),n}));function W(e){if("string"==typeof e||Y(e))return e;var t=e+"";return"0"==t&&1/e==-s?"-0":t}function H(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,s=t?t.apply(this,r):r[0],a=n.cache;if(a.has(s))return a.get(s);var o=e.apply(this,r);return n.cache=a.set(s,o),o};return n.cache=new(H.Cache||L),n}H.Cache=L;var q=Array.isArray;function z(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Y(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&N.call(e)==i}e.exports=function(e,t){return null==e||j(e,t)}},953:e=>{class t{constructor(e,t,n,r,s){this.converter=c(),this.width=e,this.poly=t,this.xor_in=n,this.reflected_xor_in=l(n,e),this.xor_out=r,this.reflect=s,this.msb_mask=1<<this.width-1,this.mask=this.msb_mask-1<<1|1,this.crc_shift=this.width<8?8-this.width:0,this.shifted_xor_in=this.xor_in<<this.crc_shift;let a=this.gen_table();this.table=a,8!==this.width||this.xor_in||this.xor_out||this.reflect||(this.calculate=function(e){e=this.converter.validate_buffer(e);let t=0;for(let n=0;n<e.length;n++)t=a[t^e[n]];return t})}calculate(e){let t;e=this.converter.validate_buffer(e);let{table:n,width:r,crc_shift:s,mask:a}=this;if(this.reflect){t=this.reflected_xor_in;for(let r=0;r<e.length;r++){t=(n[255&(t^e[r])]^t>>>8)&a}}else{t=this.shifted_xor_in;for(let o=0;o<e.length;o++)t=n[255&(t>>r-8+s^e[o])]<<s^t<<8-s&a<<s;t>>=s}return t^=this.xor_out,t>>>0}calculate_no_table(e){e=this.converter.validate_buffer(e);let t=this.xor_in;for(let n=0;n<e.length;n++){let r=e[n];this.reflect&&(r=l(r,8));for(let e=0;e<8;e++){let n=t&this.msb_mask;r&128>>e&&(n^=this.msb_mask),t<<=1,n&&(t^=this.poly)}t&=this.mask}return this.reflect&&(t=l(t,this.width)),t^=this.xor_out,t>>>0}gen_table(){let e=[];for(let t=0;t<256;t++){let n=t;this.reflect&&(n=l(n,8)),n<<=this.width-8+this.crc_shift;for(let e=0;e<8;e++)0!=(n&this.msb_mask<<this.crc_shift)?(n<<=1,n^=this.poly<<this.crc_shift):n<<=1;this.reflect&&(n=l(n>>this.crc_shift,this.width)<<this.crc_shift),n=n>>this.crc_shift&this.mask,e[t]=n>>>0}return new Int32Array(e)}print_table(){let e=this.table,t=Math.ceil(this.width/4),n=t<4?4:3,r=e.length>>n,s=1<<n,a="";for(let o=0;o<r;o++){let r="";for(let a=0;a<s;a++){let s=e[o<<n|a];s="000000000"+s.toString(16),s=s.substr(s.length-t),r+="0x"+s+", "}a+=" "+r+"\n"}return a="[\n"+a.slice(0,-3)+"\n]",a}}const n="undefined"!=typeof Buffer,r="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,s=void 0!==typeof BigInt&&BigInt(256);class a{validate_buffer(e){switch(typeof e){case"number":{if(!Number.isSafeInteger(e)||e<0)throw Error(`number data must be a nonnegative safe integer, not ${e}`);if(this.fromUInt32&&e<=4294967295)return this.fromUInt32(e);const t=[];for(;e>0||t.length<4;)t.unshift(e%256),e=Math.floor(e/256);return this.fromByteArray(t)}case"string":return this.fromString(e);case"bigint":{if(e<0)throw Error(`bigint data must be nonnegative, not ${e}`);const t=[];for(;e>0||t.length<4;)t.unshift(Number(e%s)),e/=s;return this.fromByteArray(t)}default:if(n&&Buffer.isBuffer(e))return e;if(r){if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(e instanceof ArrayBuffer)return new Uint8Array(e)}throw new Error(`Unrecognized data type ${typeof e}: ${e}`)}}}class o extends a{fromUInt32(e){const t=Buffer.alloc(4);return t.writeUInt32BE(e),t}fromByteArray=Buffer.from.bind(Buffer);fromString=Buffer.from.bind(Buffer)}class i extends a{fromByteArray=Uint8Array.from.bind(Uint8Array);fromString(e){return new TextEncoder("utf-8").encode(e)}}function c(e=!1){if(r&&(e||!n))return new i;if(n)return new o;throw Error("either need TypedArrays or Buffer")}function l(e,t){let n=0;for(let r=0;r<t;r++)n=n<<1|1&e,e>>=1;return n}const u={crc1:new t(1,1,0,0,!1),crc6:new t(6,47,0,0,!1),crc8:new t(8,7,0,0,!1),crc10:new t(10,563,0,0,!1),crc16:new t(16,32773,0,0,!0),crc24:new t(24,8801531,11994318,0,!1),crc32:new t(32,79764919,4294967295,4294967295,!0),crc32c:new t(32,517762881,4294967295,4294967295,!0)};function d(e){}e.exports={CRC:t,crc:function(e,n,r,s,a){let o=new t(e,n,r,s,a);return o.calculate.bind(o)},makeBufferConverter:c,models:u,crc1:d,crc6:d,crc8:d,crc10:d,crc16:d,crc24:d,crc32:d,crc32c:d};for(let t in u){let n=u[t];e.exports[t]=n.calculate.bind(n)}},754:e=>{function t(e){return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}))}t.keys=()=>[],t.resolve=t,t.id=754,e.exports=t}},r={};function s(e){var t=r[e];if(void 0!==t)return t.exports;var a=r[e]={id:e,loaded:!1,exports:{}};return n[e](a,a.exports,s),a.loaded=!0,a.exports}s.m=n,s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce(((t,n)=>(s.f[n](e,t),t)),[])),s.u=e=>"js/"+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&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.p=e})(),(()=>{var e={388:0};s.f.j=(t,n)=>{var r=s.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var a=new Promise(((n,s)=>r=e[t]=[n,s]));n.push(r[2]=a);var o=s.p+s.u(t),i=new Error;s.l(o,(n=>{if(s.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var a=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;i.message="Loading chunk "+t+" failed.\n("+a+": "+o+")",i.name="ChunkLoadError",i.type=a,i.request=o,r[1](i)}}),"chunk-"+t,t)}};var t=(t,n)=>{var r,a,[o,i,c]=n,l=0;if(o.some((t=>0!==e[t]))){for(r in i)s.o(i,r)&&(s.m[r]=i[r]);if(c)c(s)}for(t&&t(n);l<o.length;l++)a=o[l],s.o(e,a)&&e[a]&&e[a][0](),e[a]=0},n=self.webpackChunkconstellation_corejs_library=self.webpackChunkconstellation_corejs_library||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),(()=>{"use strict";var e={};s.r(e),s.d(e,{buildContextName:()=>H,buildModalContext:()=>K,buildTransientContextName:()=>q,getContainerIdFromContext:()=>J,getParentContext:()=>X,getParentContextName:()=>W,getTargetFromContext:()=>Y,getTransientContext:()=>z});var t={};s.r(t),s.d(t,{getResolvedTargetName:()=>yt,getRoutingInfo:()=>Et,getSemanticURLFromRoutingInfo:()=>It});var n={};s.r(n),s.d(n,{evaluate:()=>Xt,handleChange:()=>Yt,hasDeclareExpression:()=>zt,updateDeclareExpressions:()=>Kt});var r={};s.r(r),s.d(r,{publishExpressions:()=>Lr,publishResponse:()=>Ur});var a={};s.r(a),s.d(a,{hasBrowserEnv:()=>oa,hasStandardBrowserEnv:()=>ca,hasStandardBrowserWebWorkerEnv:()=>la,navigator:()=>ia,origin:()=>ua});var o={};s.r(o),s.d(o,{doesRestApiExist:()=>nc,getCancelTokenSource:()=>rc,getCaseApi:()=>oc,getHeaderProcessor:()=>Zi,invokeCustomRestApi:()=>tc,invokeRestApi:()=>ec,isRequestCanceled:()=>sc,registerInterceptor:()=>ac});var i={};s.r(i),s.d(i,{CONTAINER_NAMES:()=>hd,CONTAINER_TYPES:()=>pd,addRootContainerItem:()=>qd,areContainerItemsPresent:()=>Id,clearTransientData:()=>Qd,closeContainerItem:()=>Hd,getActiveContainerItemContext:()=>Od,getActiveContainerItemIDFromRoutingInfo:()=>up,getActiveContainerItemName:()=>Rd,getActiveContext:()=>op,getChildContainerItems:()=>vd,getChildContainers:()=>xd,getChildContainersContexts:()=>wd,getContainerAPI:()=>tp,getContainerAccessOrder:()=>Ed,getContainerData:()=>fd,getContainerItemByKey:()=>Sd,getContainerItemData:()=>md,getContainerItemName:()=>_d,getContainerItems:()=>yd,getContainerLimit:()=>jd,getContainerParentContext:()=>lp,getContainerType:()=>Nd,getContextByTargetAndKey:()=>cp,getDataContextName:()=>bd,getFlowContainer:()=>pp,getLeastRecentlyUsedNonDirtyContainerItemID:()=>Gd,getParentContainerItem:()=>dp,getRootContainerName:()=>ap,getSuggestionContexts:()=>Md,getTargetFromContainerItemID:()=>Wd,getTransientItems:()=>Kd,hasContainerItems:()=>Fd,isContainerDirty:()=>Bd,isContainerInitialized:()=>Td,isContainerItemActive:()=>Pd,isContainerItemContextBeingUsedInOtherContainers:()=>Yd,isContainerItemExists:()=>Ad,isContainerLimitReached:()=>kd,isContainerMultipleMode:()=>Ud,isContainerSingleMode:()=>Ld,purgeTransientData:()=>Zd,removeContainer:()=>np,replaceTransientData:()=>Jd,resetContainersPayload:()=>$d,setContainerLimit:()=>Vd,updateCaseContextEtag:()=>sp,updateParentLastUpdateTime:()=>ip,updateRelatedContextEtag:()=>rp,updateTransientData:()=>Xd});var c={};s.r(c),s.d(c,{getAdditionalInfo:()=>uh,getDataPageKeys:()=>ih,getDataPageMetadata:()=>Zp,getEmbeddedPropertyMetadata:()=>qp,getFieldParameters:()=>rh,getFieldsByClassName:()=>nh,getGenAICoach:()=>ah,getInsight:()=>th,getLookUpDataPage:()=>ch,getLookUpDataPageInfo:()=>lh,getParagraph:()=>sh,getPersonalizationMetadata:()=>eh,getPropertyMetadata:()=>Hp,getResolvedFieldMetadata:()=>dh,getSavableDataPage:()=>oh,isViewExists:()=>Jp,mergeStore:()=>Wp,resolveNavigation:()=>Qp,resolveView:()=>Xp,updateNavigationStore:()=>Yp,updateStores:()=>Kp,updateViewStore:()=>zp});var l={};s.r(l),s.d(l,{dispatch:()=>Eh,doesContextExist:()=>wh,getActionType:()=>Nh,getContextValue:()=>Sh,getDataObject:()=>Ih,getReferenceTokens:()=>fh,getSharedDataObject:()=>Ah,getStore:()=>yh,getValue:()=>Ch,isMergeable:()=>Ph,lookupContextValue:()=>Th,mergeDeep:()=>bh,performReplace:()=>Dh,removeItem:()=>Rh,replaceValue:()=>vh,resetStore:()=>xh,setStore:()=>mh,updateValue:()=>Oh});var u={};s.r(u),s.d(u,{activateContainerItem:()=>lg,addContainerItem:()=>Zh,addMessages:()=>ug,addSharedData:()=>Ag,addTransientItem:()=>eg,addWork:()=>Kh,clearTransientData:()=>ng,createWork:()=>Gh,error:()=>Ig,finishAssignment:()=>fg,initContainers:()=>Jh,listAction:()=>Cg,loadView:()=>zh,mergeData:()=>Hh,openAssignment:()=>mg,openWorkByHandle:()=>Xh,postProcess:()=>Eg,purgeTransientData:()=>sg,removeAllTransientItems:()=>pg,removeContainerItem:()=>dg,removeSharedData:()=>_g,removeTransientItem:()=>hg,replaceContainerItem:()=>gg,replaceTransientData:()=>rg,resetContainers:()=>Qh,resetLoading:()=>ig,setLoading:()=>og,setSharedProperty:()=>Tg,setStateProperty:()=>Ng,showCasePreview:()=>Sg,showHarness:()=>qh,showHistory:()=>yg,showPage:()=>Yh,upMergeAndRemoveContainerItem:()=>cg,updateContainerItem:()=>ag,updateTransientData:()=>tg});var d={};s.r(d),s.d(d,{fetchViewResources:()=>LI,updateViewResources:()=>MI});var p=s(216),h=s.n(p);let g,f,m;const y=e=>{e&&(g=e=e||{"base-server":"http://localhost:1080/prweb/","data-end-point":"api/v1/stream/data","action-end-point":"api/v1/stream/action"},g.BASEURL=e.server,g.ACTIONURL=e["action-end-point"],g.DATAURL=e["data-end-point"],m=e.reAuthUrl)},E=()=>m,I=()=>g.BASEURL,A=e=>fetch(`${g.BASEURL}${g.ACTIONURL}`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),_=e=>{f=e},C=()=>f;var S=s(953),T=s(521),N=s.n(T),R=s(928),P=s.n(R),D=s(188),b=s.n(D),O=s(835),v=s.n(O),x=s(692),w=s.n(x),M=s(529),L=s.n(M);const U=new class{constructor(){this.needsMapping=!1}getNeedsMapping(){return this.needsMapping}setNeedsMapping(e){this.needsMapping=e}map(e){return this.needsMapping?this.replacer(e):e}analyseResponse(e){e?.data?.objectInfo&&window?.PCore?.getEnvironmentInfo()?.isUnifiedObject()?this.setNeedsMapping(!0):this.setNeedsMapping(!1)}replacer(e){return this.needsMapping&&(e=e.replace("caseInfo","objectInfo").replace("caseTypeName","objectTypeName").replace("caseTypeID","objectTypeID")),e}},F={APP:{APP:"app",ROOT:"root",PXREQUESTOR:"pxRequestor",PXUSERNAME:".pxUserName",OPERATORID:"OperatorID",USERNAME:"pxRequestor.pxUserName",PXUSERIDENTIFIER:".pxUserIdentifier",USERIDENTIFIER:"pxRequestor.pxUserIdentifier",PYIMAGEINSKEY:".pyImageInsKey",OPERATORID_IMG_INSKEY:"OperatorID.pyImageInsKey",OPERATORID_LOCALE:"OperatorID.pyUseLocale",APPLICATION_LABEL:"Application.pyLabel",APPLICATION_RULE_NAME:"Application.pyRuleName"},RESOURCE_TYPES:{ASSIGNMENT:"ASSIGNMENT",CASE:"CASE",DATA:"DATA",PAGE:"PAGE"},RESOURCE_STATUS:{CREATE:"CREATE",UPDATE:"UPDATE",OPEN_FLOW_ACTION:"OPEN_FLOW_ACTION"},VIEW_NAMES:{PY_CASE_TAB:"pyCaseTab",DATA_OBJECT_CREATE_VIEW:"Create",DATA_OBJECT_EDIT_VIEW:"pyEdit",PY_DATA_PREVIEW:"pyDataPreview",PY_DETAILS:"pyDetails"},CONTAINERS:{ROOT_CONTAINER:"RootContainer",VIEW_CONTAINER:"ViewContainer",FLOW_CONTAINER:"FlowContainer",MODAL_VIEW_CONTAINER:"ModalViewContainer",PREVIEW_VIEW_CONTAINER:"PreviewViewContainer",HYBRID_VIEW_CONTAINER:"HybridViewContainer"},WORK_BASKET:{MY_WORK_LIST:"myWorkList",REPORTEE:"reportee",WORK_QUEUE:"workQueue",DATA_PAGES:{D__PY_GET_USER_WORK_LIST_BY_USER_ID:"D_pyGetUserWorkListByUserId",D__WORK_BASKET:"D_WorkBasket",D__PY_MY_WORK_LIST:"D_pyMyWorkList"}},CONTEXT_TREE_NODE_TYPES:{VIEW:"VIEW",FIELD:"FIELD",DECLARATIVE_TARGET:"DECLARATIVE_TARGET",WHEN:"WHEN",CONTEXT:"CONTEXT",PAGELIST:"PAGELIST"},WORKLIST:"worklist",WAIT:"wait",TODO:"todo",STANDARD_FLOW:"Standard",CASE:"CASE",ASSIGNMENT:"ASSIGNMENT",FIX_BROKEN_ASSIGNMENTS:"FixBrokenAssignments",PAGE:"PAGE",PZINSKEY:".pzInsKey",CREATE_DETAILS_VIEW_NAME:"pzCreateDetails",PREVIEW_VIEW_NAME:"pyCasePreview",CASESUMMARY_VIEW_NAME:"pyCaseSummary",APPSHELL_ACTIVE_CASES:"appshell-activecases",TRACE_ID:"x-b3-traceid",LOAD_VIEW_STRING:"View",PRIMARY:"primary",DEFER_UPDATE_CASESUMMARY_VIEW:"deferUpdateCaseSummaryView",NEXT_ASSIGNMENT_INFO_ID:"nextAssignmentInfo.ID",WORKCLASS:"Work-",DATA_INFO:{DATA_INFO:"dataInfo",DATA_INFO_CONTENT:"dataInfo.content"},CASE_INFO:{CASE_INFO:"caseInfo",CASE_INFO_CONTENT:"caseInfo.content",CASE_INFO_NAME:"caseInfo.name",CASE_INFO_ID:"caseInfo.ID",CASE_INFO_CLASSID:"caseInfo.content.classID",CASE_TYPE_ID:"caseInfo.caseTypeID",CASE_TYPE_NAME:"caseInfo.caseTypeName",CASE_INFO_PZINSKEY:"caseInfo.content.pzInsKey",CASE_INFO_ACTIONS:"caseInfo.availableActions",VIEW_NAME:"caseInfo.content.pyViewName",ACTION_BUTTONS:"caseInfo.actionButtons",ACTIVE_ACTION_ID:"caseInfo.activeActionID",ASSIGNMENT_LABEL:"caseInfo.assignments[0].name",ASSIGNMENT_ID:"caseInfo.assignments[0].ID",ASSIGNMENTS:"caseInfo.assignments",INSTRUCTIONS:"caseInfo.assignments[0].instructions",NAVIGATION:"caseInfo.navigation",STAGES:"caseInfo.stages",STAGEID:"caseInfo.stageID",CASECLASS:"caseInfo.caseClass",AVAILABLEACTIONS:"caseInfo.availableActions",AVAILABLEPROCESSES:"caseInfo.availableProcesses",D_CASE_ASSIGNMENTS_RESULTS:"caseInfo.assignments",CHILD_ASSIGNMENTS:"caseInfo.childCases",ASSIGNMENTACTION_ID:"caseInfo.assignments[0].actions[0].ID",ISINCREATESTAGE:"caseInfo.isInCreateStage",APPROVALFLAG:"caseInfo.content.pyApprovalResult",DUPLICATECASEFLAG:"caseInfo.content.pyDuplicateCaseActions",DUPLICATECASEID:"caseInfo.content.pyDuplicateID",DUPLICATECASEINSKEY:"caseInfo.content.pyDuplicateCaseReference.pzInsKey",HEADERS:"caseInfo.headers",PARENTCASEINFO:"caseInfo.parentCaseInfo",REMOTESYSTEMID:"caseInfo.headers.RemoteSystemID",CASE_RELATED_CASE_TYPES:"caseInfo.relatedCaseTypes",CASES:"caseInfo.cases",GETNEXTWORK:"caseInfo.confirmationLinks.getNextWork",ACTION_REFRESH_CONDITIONS:"caseInfo.assignments[0].actions[0].refreshConditions",IS_LOCAL_ACTION:"caseInfo.isLocalAction",BUSINESS_ID:"caseInfo.businessID",IS_FIRST_ASSIGNMENT:"caseInfo.isFirstAssignment"},ACTIONS:{ACTION_ID:"actionID",ACTIONS:"availableActions",DELETEAVIALACTIONS:"deleteAvailActions",FLOWACTION:"FlowAction",DATA_PAGES:{D_PY_ADDITIONAL_CASE_ACTIONS:"D_pyAdditionalCaseActions"}},PROCESS:{FLOWPROBLEMS:"FlowProblems"},PAGE_TYPES:{PAGE:"page",LANDINGPAGE:"landingpage",LISTPAGE:"listpage"},LOCAL_ACTION_TYPE:{CASE_WIDE:"case",EXPRESS:"express",ASSIGNMENT:"Assignment",LOCAL_ACTION:"LocalAction"},LOCAL_ACTIONS:{TRANSFER_ASSIGNMENT:"pyTransferAssignment"},CONTENT:"content",MODAL:"modal",STOPMERGEACTIONS:"stopMergeActions",IS_CREATE_DATA_OBJECT:"isCreateDataObject",SUMMARY_OF_ASSIGNMENT_LAST_SUBMIT_TIME:"context_data.caseInfo.content.summary_of_assignment__.lastSubmitTime",SUMMARY_OF_ATTACHMENTS_LAST_REFRESH_TIME:"context_data.caseInfo.content.summary_of_attachments__.lastRefreshTime",CONTEXT_DATA_ASSIGNMENTID:"context_data.assignmentID",BANNER_VARIANT_SUCCESS:"success",BANNER_VARIANT_WARNING:"warning",BANNER_VARIANT_URGENT:"urgent",BANNER_VARIANT_INFO:"info",MESSAGES:{MESSAGES_TYPE_SUCCESS:"success",MESSAGES_TYPE_INFO:"info",MESSAGES_TYPE_ERROR:"error"},PUB_SUB_EVENTS:{EVENT_RENDER_APP:"renderApp",EVENT_UNMOUNT_APP:"unmountApp",EVENT_REAUTH:"reAuth",EVENT_FULL_REAUTH:"fullReAuth",EVENT_CUSTOM_REAUTH:"customReAuth",EVENT_CANCEL:"cancel",EVENT_MINIMIZE:"minimize",EVENT_EXPRESS_LOCALACTION:"expressLocalActionSubmit",EVENT_LOCALACTION_SUBMISSION:"localActionSubmit",EVENT_BULKACTION:"bulkActionSubmit",EVENT_SHOW_CANCEL_ALERT:"showCancelAlert",EVENT_SHOW_DELETE_ALERT:"showDeleteAlert",EVENT_DASHBOARD_FILTER_CHANGE:"dashboardFilterChange",EVENT_DASHBOARD_FILTER_CLEAR_ALL:"dashboardFilterClearAll",EVENT_PROMOTED_FILTERS_CHANGE:"promotedFiltersChange",EVENT_LOGOFF:"Logoff",EVENT_TRANSIENT_ITEMS:{UPDATE_PROMOTED_FILTERS:"updatePromotedFilters"},UI_EVENTS:{SHOW_PAGE_INIT:"showPageInit",SHOW_PAGE_DONE:"showPageDone",SHOW_PAGE_STARTED:"showPageStarted"},CASE_EVENTS:{CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW:"caseAttachmentsUpdateFromCaseview",CASE_FOLLOWER_UPDATED_BY_OPERATOR_FROM_CASEVIEW:"caseFollowerUpdateByOperatorFromCaseview",CASE_FOLLOWER_UPDATE_BY_OPERATOR_FROM_WIDGET:"caseFollowerUpdateByOperatorFromWidget",CASE_CREATED:"caseCreated",CREATE_STAGE_DONE:"caseCreatedDone",CREATE_STAGE_CANCELLED:"caseCancelled",CREATE_STAGE_SAVED:"caseSaved",CREATE_STAGE_DELETED:"caseDeleted",ASSIGNMENT_SUBMISSION:"assignmentSubmission",END_OF_ASSIGNMENT_PROCESSING:"endOfAssignmentProcessing",CLOSE_CONFIRM_VIEW:"closeConfirmView",CASE_OPENED:"caseOpened",CASE_CLOSED:"caseClosed",ASSIGNMENT_OPENED:"assignmentOpened",CASE_PREVIEW:"casePreview",CURRENT_ASSIGNMENT_UPDATED:"currentAssignmentUpdated",CASE_LOCK_EVENT:"caseLockEvent",NOTIFICATION_UPDATED:"notificationUpdated"},BOOTSTRAP_SHELL_EVENTS:{CONSTELLATION_LOADED:"CONSTELLATION_LOADED"},CONTAINER_EVENTS:{CLOSE_CONTAINER_ITEM:"CLOSE_CONTAINER_ITEM",CLOSE_MULTI_TYPE_PRIMARY_CONTAINER_ITEM:"CLOSE_MULTI_TYPE_PRIMARY_CONTAINER_ITEM"},DISPLAY_CASE_CREATED_TOASTER:"displayCaseCreatedToaster",DATA_EVENTS:{DATA_OBJECT_CREATED:"dataObjectCreated",DATA_OBJECT_DELETED:"dataObjectDeleted",DATA_OBJECT_UPDATED:"dataObjectUpdated"},FETCH_SUCCESS:"fetchSuccess",REVERSE_COEXISTENCE_EVENTS:{HANDLE_DISCARD:"handleDiscard",CHECK_IS_FORM_DIRTY:"checkIsFormDirty"},TIMEOUT_REMINDER:"sessionAboutToTimeout",RESET_TIMER:"resetInactivityTimer"},CONTAINER_TYPE:{MULTIPLE:"multiple",SINGLE:"single",HYBRID:"HybridViewContainer"},REMOTE_SYSTEM_ID:"RemoteSystemID",LIST_SELECTION_MODE:{MULTI:"multi",SINGLE:"single",MULTI_ON_HOVER:"multi_on_hover"},SUBMISSION_FAILURE_TYPE:{FORM_VALIDATION_ERROR:"formValidationError"},USER_SETTINGS:{UTILITY_PANEL_USER_STATE_PATH:"presentation.templates.CaseView.utilityPanelExpanded",SUMMARY_PANEL_USER_STATE_PATH:"presentation.templates.CaseView.summaryPanelExpanded",ASSIGNMENT_COLLAPSED_STATE_PATH:"presentation.templates.CaseView.assignmentWidgetCollapsed",CASE_VIEW_PATH:"presentation.templates.CaseView"},PROMISE_VALUE:{RESOLVE:"resolve",REJECT:"reject"},APP_TYPE:{UIKIT:"uikit",THEME_COSMOS:"themecosmos"},VIEW_TYPE:{PY_EMBEDASSIGNMENT:"pyEmbedAssignment",PY_DETAILS:"pyDetails"}},j={CONTEXT:"context",AJAXCONTAINER:"primary",VIEW_CONTAINER:"ViewContainer",APP_SHELL:"AppShell",ROOT_CONTAINER:"RootContainer",HYBRID:"hybrid",HYBRID_VIEW_CONTAINER:"HybridViewContainer",HYBRID_ROOT_CONTAINERNAME:"hybridRootContainerName",MODAL_VIEW_CONTAINER:"ModalViewContainer",FLOW_CONTAINER:"FlowContainer",PREVIEW_VIEW_CONTAINER:"PreviewViewContainer",OBJECT_PAGE:"ObjectPage",CASE_CREATE_STAGE:"CaseCreateStage",CASE_VIEW:"CaseView",VIEW:"view",CASE_PREVIEW:"CasePreview",CASE_STAGES:"Stages",CASEMESSAGES:"caseMessages",SUGGESTION:"suggestion",PREVIEW:"preview",TERTIARY:"tertiary",DEFAULT:"default",ACPRIMARY:"primary",ACTERTIARY:"tertiary",PERFORM_MODE:"perform",CASE_VIEW_MODE_PROP:".caseViewMode",REVIEW_MODE:"review",WORKAREA:"workarea",ACPRIMARY_NAME:"ACPRIMARY",ACTERTIARY_NAME:"ACTERTIARY",THREADNAMESEPARATOR:"/",JOINCHARACTER:"_",FORWARD_SLASH_STRING:"/",UNDERSCORE_STRING:"_",WORK_ID:"WORK_ID",EMPTY_STRING:"",PROPERTY_MESSAGES:"propertyMessages__",CONTEXT_MESSAGES:"contextMessages__",HTTP_MESSAGES:"httpMessages__",PAGE_MESSAGES:"pageMessages__",SUMMARY_OF_LISTS:"summary_of_lists__",SUMMARY_OF_GROUPS:"summary_of_groups__",SUMMARY_OF_MESSAGES:"summary_of_messages__",SUMMARY_OF_FIELD_VALUES:"summary_of_field_values__",SUMMARY_OF_WHEN_CONDITIONS:"summary_of_when_conditions__",SUMMARY_OF_EXPRESSIONS:"summary_of_expressions__",SUMMARY_OF_ASSOCIATED_LISTS:"summary_of_associated_lists__",CONTEXT_DATA:"context_data",TABLE:e=>`Table[${e}]`,HTTP:"HTTP",PROPERTY:"PROPERTY",PAGE_ERRORS:"page_level_errors",NO_MESSAGES:"No messages existing",PULSE_REFERENCE:"pulse.messages",IS_LOADING:"isLoading",APPROVED:"Approved",REJECTED:"Rejected",DUPLICATE:"Duplicate",IGNORE:"Ignore",PARAGRAPH:"PARAGRAPH",X_ORIGIN_CHANNEL:"x-origin-channel",AUTHORING_PREVIEW_CONTAINER:"root/authoring-preview",ERROR_FIELD_IN_PAGE:"erroneousInputOutputFieldInPage",ERROR_IN_PAGE_IDENTIFIER:"erroneousInputOutputIdentifier",UI_RESOURCES:"uiResources",UI_RESOURCES_CONTEXT_DATA:"uiResources.context_data",ACTION_BUTTONS:"uiResources.actionButtons",RESOURCES:"uiResources.resources",ROOT:"uiResources.root",CASE_INFO_IS_LOCAL_ACTION:"caseInfo.isLocalAction",DATA:"data",OPTIONS:"options",VIEWS:"uiResources.resources.views",NAVIGATIONS:"uiResources.resources.navigations",COMPONENTS:"uiResources.components",LOCALE_REFERENCES:"uiResources.localeReferences",STATIC_SERVER_URL:"staticServer",APPLICATION_DATA:"data.Application",REFERENCED_USERS:"referencedUsers",CASE_INFO_REFRESH_CONDITIONS:"caseInfo.refreshConditions",FIELD_LEVEL_SUCCESS:"success",FIELD_LEVEL_WARNING:"warning",FIELD_LEVEL_ERROR:"error",HASH_DELIMITER:"~^|^~",NULL_STRING:"null",DATA_PAGE:"DataPage",DECISION:"Decision",RULE_REFERENCE:"RuleReference",GET_PAGE_DATA:"getPageData",PROPERTY_ANNOTATION:"@P",FIELD_LABEL_ANNOTATION:"@FL",ATTACHMENT_ANNOTATION:"@ATTACHMENT",ASSOCIATED_PROPERTY_ANNOTATION:"@ASSOCIATED",CLASS_ANNOTATION:"@CLASS",ASSOCIATED:"associated",CLASS_ID:".classID",CLASSID:"classID",READONLY:"readonly",SHARED:"shared",RELOAD_IF_OLDER_THAN:"reloadIfOlderThan",RELOAD_ONCE_PER_INTERACTION:"reloadOncePerInteraction",PY_DETAILS:"pyDetails",PY_CONFIRM:"pyConfirm",LIST_ACTIONS:{INSERT:"INSERT",UPDATE:"UPDATE",DELETE:"DELETE",DELETE_ALL:"DELETE ALL",MOVE:"MOVE",SELECT:"SELECT",DESELECT:"DESELECT",REPLACE:"REPLACE",DELETE_PAGE:"DELETEPAGE"},LIST_ACTIONS_TYPE:{SELECT_DESELECT:"SELECT_DESELECT",DESELECT_ALL:"DESELECT_ALL"},ENV_INFO_KEYS:{APPLICATION_NAME:"APPLICATION_NAME",APPLICATION_DESC:"APPLICATION_DESC",ACCESS_GROUP:"ACCESS_GROUP",USER_NAME:"USER_NAME",USER_ID:"USER_ID",USER_IMAGE:"USER_IMAGE",LOCALE:"LOCALE",TIMEZONE:"TIMEZONE",WORK_GROUP:"WORK_GROUP"},ID:"ID",SCALARLIST:"ScalarList",COREHEADERS:"coreHeaders",SKIPCOREHEADERS:"skipCoreHeaders",COREHEADER_APP_DEBUG_ID:"X-Pega-App-Debug-ID",COREHEADER_APP_DEBUG_LEVELS:"X-Pega-App-Debug-Levels",CONTEXT_DATA_MODAL_VIEW:{IS_MULTI_RECORD_DATA:"context_data.modalView.isMultiRecordData",VIEW_NAME:"context_data.modalView.viewName",PARENT_CONTEXT:"context_data.modalView.parentContext",INTERESTPAGE:"context_data.modalView.interestPage"},DATA_CLASS_NOT_FOUND:"Data object class not found",PRIORITY:{CRITICAL:100,HIGH:500,MEDIUM:1e3,LOW:2e3,TRIVIAL:3e3},...F,EMBED:"EMBED",getProperty:e=>U.map(e)},V="pyRemoteCaseDetails";class k{static remoteCaseMapping={};static setRemoteCaseMapping=e=>{this.remoteCaseMapping=e,this.setAdditionalParameters()};static getRemoteCaseMapping=()=>this.remoteCaseMapping;static getRemoteCase=e=>this.remoteCaseMapping?.[e];static isRemoteCase=e=>!!(e&&this.remoteCaseMapping&&this.remoteCaseMapping[e]);static getRemoteHeaderByContext=e=>Vh.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=Sp.environmentInfoObject?.pyRemoteCaseTypeList;e?.forEach((e=>{const t=this.getRemoteCase(e.pyWorkTypeImplementationClassName);t&&(t.name=e.pyWorkTypeName)}))};static getRemoteHeaderFromSourceClass=e=>{const t=Object.values(this.remoteCaseMapping).find((t=>t.RemoteClassName===e));return t?.RemoteSystemID}}const $=k,B={},G=new Map,W=e=>{let t=j.EMPTY_STRING;return t=e&&e.includes(j.FORWARD_SLASH_STRING)?e.substring(0,e.lastIndexOf("/")):e,t},H=(e,t,n=!1)=>{let r=j.EMPTY_STRING;if(t&&e){let s=`${t}${j.FORWARD_SLASH_STRING}${e}`;const a=fd(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",Ee="SHOW_HISTORY",Ie="ERROR",Ae="INIT_CONTAINERS",_e="RESET_CONTAINERS",Ce="ADD_CONTAINER_ITEM",Se="REMOVE_CONTAINER_ITEM",Te="ADD_TRANSIENT_ITEM",Ne="UPDATE_TRANSIENT_DATA",Re="REMOVE_TRANSIENT_ITEM",Pe="REMOVE_ALL_TRANSIENT_ITEMS",De="CLEAR_TRANSIENT_DATA",be="PURGE_TRANSIENT_DATA",Oe="REPLACE_TRANSIENT_DATA",ve="ACTIVATE_CONTAINER_ITEM",xe="UPDATE_CONTAINER_ITEM",we="UPMERGE_AND_REMOVE_CONTAINER_ITEM",Me="REPLACE_CONTAINER_ITEM",Le="ACTIVATE_MODAL_CONTAINER_ITEM",Ue="REMOVE_CONTAINER",Fe="ADD_SUGGESTION_CONTEXT",je="showView",Ve="showData",ke="showInsight",$e="showDashboard",Be="openWorkByHandle",Ge="openAssignment",We="createNewWork",He="SHOW_CANCEL_ALERT",qe="openLocalAction",ze="openProcessAction",Ye="caseWideActions",Ke="openBulkAction",Xe="performBulkAction",Je="launchAssignment",Qe="ADD_MESSAGES",Ze="CLEAR_MESSAGES",et="RESET_STORE",tt="FETCH_DATAPAGE",nt="ADD_SHARED_DATA",rt="REMOVE_SHARED_DATA",st="LIST_ACTION",at="DELETE_CASE_SUMMARY",ot="ALTER_BLOCKING_ACTION_COUNT",it="CREATE_DATA_OBJECT",ct="DELETE_DATA_OBJECT",lt="VIEW_DATA_OBJECT",ut="UPDATE_DATA_OBJECT",dt="OPEN_DATA_OBJECT_ACTION",pt="SUBMIT_DATA_OBJECT_ACTION",ht="OPEN_EMBEDDED_DATA_MODAL",gt="SUBMIT_EMBEDDED_DATA_MODAL",ft="FILL_FORM_WITH_AI",mt="openCase",yt=(e,t)=>{if(!e||!t)return null;let n,r=j.EMPTY_STRING;return t&&(r=`${t}${j.FORWARD_SLASH_STRING}${e}`,n=fd(r),n||t.includes("/")?n||(r=yt(e,W(t))):r=`${t}${j.FORWARD_SLASH_STRING}${e}`),r},Et=(e,t)=>{const n=yt(e,t);return n&&fd(n)?fd(n):{}},It=(e,t)=>Cp.getSemanticURL(je,{page:e},t);const At=new class{error=e=>{console.error(e)}};class _t{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=Ot[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=bt[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}=Ot[this._state];this._subParser=new _t(this._grammar,e,t)}_endSubExpression(){Ot[this._state].subHandler.call(this,this._subParser.buildAst()),this._subParser=null}setPositionInAST(e){this._position?(this._position.right=e,_t._setParent(e,this._position)):this._tree=e,this._position=e}}const Ct=_t,St="identifier",Tt={operatorType:"binaryOperator",precedence:1,evaluate:(e,t)=>e&&t},Nt={operatorType:"binaryOperator",precedence:1,evaluate:(e,t)=>e||t},Rt=(e,t,n)=>{const r=""===e,s=""===t||null==t;return r&&s?n:"boolean"==typeof t?((e,t,n,r)=>{const s=!(e||"false"===t||"0"===t)&&Boolean(t);return r?s===n:s!==n})(r,e,t,n):r!==s?!n:n?e===t:e!==t},Pt={">":{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)=>Rt(e,t,!0)},"!=":{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>Rt(e,t,!1)},"!":{operatorType:"unaryOperator",precedence:999,evaluate:e=>{let{value:t}=e;return"true"!==t&&"false"!==t||(t="true"===t),!t}},"(":{operatorType:"openParenthesis"},")":{operatorType:"closeParenthesis"},"&&":Tt,AND:Tt,and:Tt,"||":Nt,OR:Nt,or:Nt,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)}},Dt={BinaryExpression:function(e){const t=[];let n="";return t[0]=this.evaluateAST(e.left),e.left.operationType===St&&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?Vh.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)}},bt={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};Ct._setParent(this._position,r),this._position=n,this.setPositionInAST(r)},identifier:function(e){const t={operationType:St,value:e.value};this.setPositionInAST(t)},literal:function(e){this.setPositionInAST({operationType:"literal",value:e.value})},subExpression:function(e){this.setPositionInAST(e)}},Ot={expectOperand:{operatorTypes:{literal:{toState:"expectBinOp"},identifier:{toState:St},unaryOperator:{},openParenthesis:{toState:"subExpression"}}},expectBinOp:{operatorTypes:{binaryOperator:{toState:"expectOperand"}}},identifier:{operatorTypes:{binaryOperator:{toState:"expectOperand"}}},subExpression:{subHandler:bt.subExpression,endStates:{closeParenthesis:"expectBinOp"}}},vt=["binaryOperator","unaryOperator","openParenthesis"],xt=/^\s*$/,wt=/^[a-zA-Z_.$][(0-9)a-zA-Z0-9_.$]*$/,Mt=/\\\\/,Lt=["'(?:(?:\\\\')|[^'])*'",'"(?:(?:\\\\")|[^"])*"',"\\s+","\\btrue\\b","\\bfalse\\b"],Ut=["[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]+)"],Ft=/^-?(?:(?:[0-9]*\.[0-9]+)|[0-9]+)$/;class jt{constructor(e){this._grammar=e}static _isNegative(e){return vt.some((t=>t===e[e.length-1].tokenType))}static _isWhitespace(e){return!!e.match(xt)}static _createWordboundary(e){return(e=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).match(wt)&&(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(Mt,"\\")}_getSplitRegex(){if(!this._splitRegex){const e=Object.keys(this._grammar).sort(((e,t)=>t.length-e.length)).map((e=>jt._createWordboundary(e)),this);this._splitRegex=new RegExp(`(${[Lt.join("|"),e.join("|"),Ut.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=jt._unquote(e):e.match(Ft)?t.value=parseFloat(e):"true"===e||"false"===e?t.value="true"===e:this._grammar[e]?t.tokenType=this._grammar[e].operatorType:e.match(wt)&&(t.tokenType="identifier"),t}_getTokens(e){const t=[];let n=!1;for(let r=0;r<e.length;r+=1)jt._isWhitespace(e[r])?t.length&&(t[t.length-1].element+=e[r]):"-"===e[r]&&jt._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 Vt=jt;const kt=class{constructor(e,t){this._grammar={...Pt},this._expression=e,this._ast=null,this._context={},this._contextTreeNodeContext=null,this._localDataObject=t}buildAST(){const e=new Vt(this._grammar).tokenize(this._expression),t=new Ct(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 Dt[e.operationType].call(this,e,t)}},$t=(e,t)=>{const n=e.replace(/[a-zA-Z0-9_)"'\s]=[a-zA-Z0-9_("'\s]/,(e=>e.replace("=","==")));return new kt(n,t)},Bt=e=>!e||e.buildAST(),Gt=(e,t,n)=>!e||e.evaluate(t,n),Wt=(e,t,n)=>{const r=$t(e,t),s=Bt(r);return Gt(s,n)};const Ht=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:Vh.getPropertyValue(`${n}.pxObjClass`,null,t)||Vh.getPropertyValue(`${n}.pyClassName`,null,t)}}static updateState(e,t){Object.keys(e).forEach((n=>Eh({type:Q,payload:{context:t,reference:n,value:e[n]}})))}},qt={},zt=(e,t)=>qt[t]&&Object.prototype.hasOwnProperty.call(qt[t],e),Yt=e=>{const{context:t}=e;zt(e.reference,t)&&Ht.handleExpression(e.reference,e.value,qt[t][e.reference],t)},Kt=(e={})=>{Lh.copy(e,qt)},Xt=(e,t,n)=>Wt(e,t,n?.pConnect.getPConnect());const Jt=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&&Eh({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]&&Eh({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 Qt=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)}}Eh(n)}}executeOrQueueDeferredAction(e){if(!e?.payload?.context)return Promise.reject(new Error("Action Context is Mandatory Field."));const t=Ih(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}}}}),Eh(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=Ih(e);return t&&!0===t.context_data?.is_deferred_action_in_progress?(Eh({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 Ih(e)?(Eh({type:ot,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={...Ih(e)};return t.context_data={...t.context_data},t&&t.context_data?.blocking_action_counter>0?(Eh({type:ot,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=Ih(e);if(t){const n={...t};n.context_data={...n.context_data},n.context_data?.deferred_action_queue&&Lh.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),Eh({type:fe,payload:{context:e,data:{...n}}}),Jt.disableLoadingIndicator({context:e})}}};const Zt=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 en=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={}){Lh.copy(e,this.componentMap)}mergeOverrideMap(e={}){Lh.copy(e,this.overrideMap)}getOverrideMap(){return this.overrideMap}getLazyMap(){return this.lazyMap}};const tn=new class{constructor(){this.handlers={}}registerHandler(e,t){this.handlers[e]=t}getHandler(e){return this.handlers[e]}};const nn=class{static handleAnnotation(e,t,n){const r=e.indexOf(" "),s=-1===r?e:e.substring(0,r),a=tn.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 tn.getHandler(n)?r:e}static handleComponentMapping(e,t,n){const r=en.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&&Lh.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(Lh.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 Lh.isString(e)&&!!e?.startsWith(j.PROPERTY_ANNOTATION)}},rn=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},sn=(e,t)=>{if(e&&t){const n=Lh.getIn(t,["assignments","0","assigneeInfo"],{}),{ID:r,type:s}=n;return"worklist"===s?.toLowerCase()&&r===e}return!1},an=e=>{const{activeActionID:t,availableActions:n}=e||{};if(t&&n){const e=n.find((e=>e.ID===t));return Boolean(e)}return!1},on=(e,t)=>{const n=Vh.getPropertyValue(F.CASE_INFO.ACTIVE_ACTION_ID,t,e),r=Vh.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=Ih(e);s=t?.context_data?.actionType===j.CASE}return s},cn=e=>Sh(null,j.CASE_VIEW_MODE_PROP,e)===j.PERFORM_MODE&&(e.includes(j.WORKAREA)||e.includes(j.MODAL)),ln=e=>{const t=e?.parentCaseInfo?.ID;return Boolean(e&&t)},un=(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},dn=(e,t,n)=>{let r,s,a,o,i,c,l,u,d;const p=Ih(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 pn=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&&Jt.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),Jt.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),Jt.disableLoadingIndicator(r.actionPayload,t)):s=null,s}};class hn{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 hn(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 gn=hn;const fn=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}},mn=/(([^.]+)\[\d+\])/g,yn=e=>{if((e?.split(".")??[]).length<3)return[e];const t=e?.match(mn);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]},En=(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:In,WHEN:An,DECLARATIVE_TARGET:_n,PAGELIST:Cn}=j.CONTEXT_TREE_NODE_TYPES;const Sn=class{constructor(e,t,n={}){this.type=e,this.name=t,this.children=[],this.eventSubscribers=[],this.props=n,this.references=new Map([[In,new Map],[An,new Map],[_n,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===Cn){const n=this.references.get(In);n.set(e,t),this.references.set(In,n)}}}removePageListNodes(e,t){const n=this.children.filter((t=>t.name.startsWith(e))).filter((n=>{const r=En(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(In),s=this.references.get(_n);[...r.keys(),...s.keys()].filter((t=>t.startsWith(e))).filter((e=>{const[,,n]=yn(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 gn(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 fn(t,n,r,s),i=this.references.get("WHEN");i?.set(a,o)}},{VIEW:Tn,FIELD:Nn,CONTEXT:Rn,DECLARATIVE_TARGET:Pn,WHEN:Dn}=F.CONTEXT_TREE_NODE_TYPES;const bn=new class{constructor(){this.rootNodes={}}_isContextNodeExist(e){return Object.keys(this.rootNodes).includes(e)}addContextNode(e){if(!this._isContextNodeExist(e)){const t=new Sn(Rn,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}`,Nn,s),a?.removeReference(`${t}${r}`,Pn,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===Tn?this.removeChildViewNodes(e,t,a.name,r):(s.removeReference(a.name,Nn,a.props.index),s.removeReference(a.name,Pn,a.props.index),"PAGELIST"!==a.type&&"Address"!==a.props?.componentName||this.deleteAllListNodes(e,a.name))})),a?.references.delete(n)}deleteAllListNodes(e,t){const n=n=>{const r=this.getContextNode(e),s=r?.references?.get(n);if(s)for(const[e]of s)(e===t||e.startsWith(`${t}.`)||e.startsWith(`${t}[`))&&r?.references?.get(n)?.delete(e)};n(Nn),n(Pn)}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(Nn),r(Pn)}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(Nn,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(Pn,`${t}${r}`,a):i.addNode(Nn,`${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}${r}`,n=t.substring(0,t.lastIndexOf("["))||e.substring(0,e.lastIndexOf("["));let s=o.getReference(n,Nn);s||(s=i.addNode(Nn,n,{}),o.addReference(n,s))}}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]=yn(t);n.startsWith(".")&&(n=n.substring(1)),o&&this.mutatePageList(e,a,o,{...r,rowIndex:i},!0);const c=s?.getReference(`${t}.${n}`,Nn);c&&c instanceof gn&&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}`,Nn);o&&o instanceof gn&&o.triggerEvent(r,s)}getFieldsList(e){const t=this.getContextNode(e);return t?.references.get(Nn)}getFieldReferenceForProperty(e,t){let n=this.getContextNode(e)?.references?.get(Nn)?.get(t);return n||(n=this.getContextNode(e)?.references?.get(Pn)?.get(t)),n}getFieldReferencePreviousValue(e,t){let n=this.getContextNode(e)?.references?.get(Nn)?.get(t);return n||(n=this.getContextNode(e)?.references?.get(Pn)?.get(t)),n?.value}updateFieldNodeValue(e,t,n){const r=this.getContextNode(e)?.references?.get(Nn)?.get(t);r instanceof gn&&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,Nn),n=this.getContextReferencesByType(e,Pn);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,Nn)?.get(t)||!!this.getContextReferencesByType(e,Pn)?.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(Pn)||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(Dn)||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}},On={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"},vn=e=>({type:On.REFRESH_DATA,payload:e}),xn={},wn=(e,t,n,r,s)=>{if(!(e&&n&&t))return;const a=s.actionMgrID||pn.getNextActionMgrId(),o={ID:e,actionID:t,context:n,caseWideAction:r,options:{...s,actionMgrID:a}};s.isFillFormWithAI?Eh((e=>({type:ft,payload:e}))(o)):Eh(vn(o))},Mn=(e,t,n,r,s)=>{if(!(e&&n&&t))return;r&&(r=Lh.convertPageRefToClipboardPageNotation(r));Eh(vn({ID:e,viewID:t,context:n,options:s,caseViewAction:!0,interestPage:r}))},Ln=(e,t,n)=>{xn[t]||(xn[t]={}),e&&!xn[t][e]&&(xn[t][e]={pageReference:n})},Un=(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=Hp(n.propertyName,e.getValue(j.CLASS_ID,n.pageName));return!!s?.isDeclarativeTarget},Fn=e=>{let t=!1;if(e.isWhenExist())t=!0;else{const n=e.getRawMetadata()?.config?.value;if(n){const r=Hp(nn.getLeafPropertyName(n),Vh.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=Un(e,r)),n};t.some(r)}else if("object"==typeof t)for(const r in t)if(t[r].startsWith("@P")&&(n=Un(e,t[r]),n))break;return n})(e,r?.datasource?.parameters)),t||(t=r?.datasource?.tableType===j.DECISION)}}t&&Ln(e.getCurrentView(),e.getContextName(),e.getPageReference())},jn=(e,t,n)=>{const r=on(e,t),s=Vh.getPropertyValue(F.CASE_INFO.ACTIVE_ACTION_ID,t,e)?Vh.getPropertyValue(F.CASE_INFO.ACTIVE_ACTION_ID,t,e):Vh.getPropertyValue(F.CASE_INFO.ASSIGNMENTACTION_ID,t,e);let a;a=r?Vh.getPropertyValue(F.CASE_INFO.CASE_INFO_ID,t,e):Vh.getPropertyValue(F.CASE_INFO.ASSIGNMENT_ID,t,e)?Vh.getPropertyValue(F.CASE_INFO.ASSIGNMENT_ID,t,e):Vh.getPropertyValue(F.CONTEXT_DATA_ASSIGNMENTID,t,e),wn(a,s,e,r,n)},Vn=e=>{const{context:t,pageReference:n}=e,r=(e=>xn[e]&&Object.keys(xn[e]).length>0&&cn(e))(t);if(!r)return;if(Vh.getPropertyValue(j.CONTEXT_DATA_MODAL_VIEW.IS_MULTI_RECORD_DATA,n,t)){const e=Vh.getPropertyValue(F.CASE_INFO.CASE_INFO_ID,n,t),r=Vh.getPropertyValue(j.CONTEXT_DATA_MODAL_VIEW.VIEW_NAME,n,t),s=Vh.getPropertyValue(j.CONTEXT_DATA_MODAL_VIEW.INTERESTPAGE,n,t);Mn(e,r,t,s,{})}else jn(t,n,{})},kn=(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},$n=e=>{const t=(e=>{const t=[];return bn.getDeclarativeTargets(e).forEach((({name:e,pageReference:n})=>{const r=n.split(".");r.shift();let s=r.join(".");e&&s&&(s=Lh.convertPageRefToClipboardPageNotation(s),t.push({name:e,context:s}))})),t})(e),n=(e=>{const t=[];return bn.getWhens(e).forEach((({name:e,type:n,pageReference:r})=>{const s=r.split(".");s.shift();let a=s.join(".");e&&a&&(a=Lh.convertPageRefToClipboardPageNotation(a),t.push({name:e,context:a,type:n}))})),t})(e);return{fieldsWithDeclarativeTargets:t,whens:n}},Bn=(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,t)=>{const n=e.url===t.url,r=e.interestPage===t.interestPage;return n&&r})(e,t);if(s&&r)return!0;if(n){if(a)return"CANCEL_REFRESH";if(r)return!1}return!1};const Gn=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}},Wn={CONTENT_FIELDS_PATH:[j.CONTEXT_DATA,j.CASE_INFO.CASE_INFO,j.CONTENT],DATA_OBJECT_CONTENT_FIELDS_PATH:[j.CONTEXT_DATA,j.DATA_INFO.DATA_INFO,j.CONTENT],FIELD_MESSAGES_PATH:[j.CONTEXT_DATA,j.CASE_INFO.CASE_INFO,j.CONTENT,j.SUMMARY_OF_MESSAGES,j.PROPERTY_MESSAGES],DATA_OBJECT_FIELD_MESSAGES_PATH:[j.CONTEXT_DATA,j.DATA_INFO.DATA_INFO,j.CONTENT,j.SUMMARY_OF_MESSAGES,j.PROPERTY_MESSAGES],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]},Hn=(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=[...Wn.PAGE_MESSAGES_PATH]:n===j.HTTP?a=[...Wn.HTTP_MESSAGES_PATH]:n===j.CASEMESSAGES?a=[...Wn.CASE_MESSAGE_PATH]:r&&(a=[j.CONTEXT_DATA,...o.split(".")]);return a.filter(Boolean)},qn=(e,t,n)=>{const r={content:{}},s=`${t}[${n}]`,a=Lh.getIn(e?.content,s.split("."));return a&&Lh.setIn(r.content,s.split("."),{...a}),r},zn=(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)}]`]=Lh.getIn(e[t],[j.CONTEXT_DATA,...s.split(".")]),Lh.deleteIn(e[t],[j.CONTEXT_DATA,...s.split(".")])}));const l=Object.keys(o);l.length>0&&l.forEach((n=>{Lh.setIn(e[t],[j.CONTEXT_DATA,...n.split(".")],o[n])}))},Yn=(e,t,n,r,s)=>{const a=Lh.deepClone(Lh.getIn(e,[`${t}`])),o=Lh.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=Lh.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(qn(o,c,r).content[`${c}[${r}]`]){const o={},i=`${n}[${r}]`,c=Lh.getIn(a,[j.CONTEXT_DATA,...i.split(".")]);o[`${n}[${s}]`]=c,Lh.deleteIn(e[t],[j.CONTEXT_DATA,...i.split(".")]),zn(e,t,l,r,s,n,o)}else zn(e,t,l,r,s,n)},Kn=e=>{const{type:t,property:n,category:r,context:s,pageReference:a}=e;let o;n&&(o=n.slice(1));const i=Ih(s);let c=[];const l=Lh.getIn(i,Hn(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&&bn.mutateField(s,a,n,{messages:[...c],type:F.MESSAGES.MESSAGES_TYPE_ERROR,fieldName:n}),c):l},Xn=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?(bn.mutateField(s,n,t,{type:Ze,fieldName:t}),l.property=t,l.pageReference=n):o?(l.pageReference=n,l.isListEntry=o,l.deletingIndex=c):l.category=r,Eh(i?{type:Ze,payload:{stateObj:e.stateObj,context:s}}:{type:Ze,payload:l})},Jn=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,Eh({type:Qe,payload:o})},Qn=(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]&&Qn(e[r],t,n)}t.pop()}return n},Zn=(e,t)=>{let n=Kn({context:j.APP.ROOT,category:"HTTP"});if(Sp.getRenderingMode()===j.EMBED){const e=Kn({context:j.APP.APP,category:"HTTP"});e&&(n=n?n.concat(e):e)}if(e){const e=Kn({context:t,category:"HTTP"});n?e&&(n=n.concat(Kn({context:t,category:"HTTP"}))):n=Kn({context:t,category:"HTTP"})}return n},er=e=>{let t=null;t=xd(e)[0]?Rd(xd(e)[0]):e,t&&Xn({context:t,stateObj:Ih(t),clearContextMessages:!0})},tr={addMessages:Jn,getValidationErrorMessages:e=>{const t=Ih(e),n=[],r=(e=>{let t=Wn.CONTENT_FIELDS_PATH;return e?.dataInfo?.content&&(t=Wn.DATA_OBJECT_CONTENT_FIELDS_PATH),t})(t),s=Lh.getIn(t,[...r])||{};return Qn(s,[],[]).forEach((e=>{const t=Lh.getIn(s,[...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:Rp.getLocaleValue(e.message,"Messages")}):n.push(Rp.getLocaleValue(e.message,"Messages")))}))}))})),n},getMessages:Kn,clearMessages:Xn,getRootContainerHttpMessages:Zn,clearContextMessagesInActiveWorkArea:er},nr=tr;const rr=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:{...Lh.unflatten(n)}},o=JSON.parse(JSON.stringify(a));delete o.content.classID;return{instruction:{target:Lh.buildInstructionPageReference(r,e),content:{...o.content},listIndex:t,instruction:"INSERT"},actionPayload:a,displayPropertyPayload:s}}};const sr=class{static execute(e,t,n,r,s,a,o){const i={instruction:"UPDATE",content:{...Lh.unflatten(r)},isDefault:o},c={content:{...i.content},target:Lh.buildInstructionPageReference(s,t),listIndex:n,instruction:"UPDATE"};return a||Eh(Cg({...i,listIndex:n-1,context:e,referenceList:`${s}${t}`})),c}};const ar=class{static execute(e,t,n){return{target:Lh.buildInstructionPageReference(n,e),listIndex:t,instruction:"DELETE"}}};const or=class{static getDeleteAllInstruction(e,t){return{instruction:"DELETE ALL",target:Lh.buildInstructionPageReference(e,t)}}static execute(e,t,n,r){r||Eh(Cg({instruction:"DESELECT_ALL",context:e,referenceList:`${n}${t}`}))}};const ir=class{static execute(e,t,n,r){return{target:Lh.buildInstructionPageReference(r,e),listMoveToIndex:n,listIndex:t,instruction:"MOVE"}}};const cr=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:"REPLACE",content:{...Lh.unflatten(n)}};return{instruction:{target:Lh.buildInstructionPageReference(r,t),content:{...a.content},instruction:"REPLACE"},actionPayload:a,displayPropertyPayload:s}}};const lr=class{static execute(e,t){return{target:Lh.buildInstructionPageReference(t,e),instruction:"DELETE"}}};const ur=class{constructor(e){this.next=null,this.automatic=!1,this.instruction=e,this.previous=null,this.childrenStateMachines=[]}};const dr=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 ur(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=dl(t),a={};let o=!0;n&&(a[dl(n)]=crypto.randomUUID(),o=!1);const i={[s]:Lh.getIn(e,s),...a};this.update(i,r+1,o,{isDefault:!0})}))})):r.forEach(((e,t)=>{if(n&&!e[dl(n)]){const e={};e[dl(n)]=crypto.randomUUID(),this.update(e,t+1,!1,{isDefault:!0})}}))}getChangeList(){return this.changeList}initChangeList(e){this.changeList[this.targetPageReference]=this.changeList[this.targetPageReference]||[],this.changeList[this.targetPageReference][e]=this.changeList[this.targetPageReference][e]||{}}update(e,t,n,r){const{isDefault:s=!1,skipPageinstruction:a}=r,o=sr.execute(this.contextName,this.target,t,e,this.pageReference,n,s);if(!a){if(this.initChangeList(t-1),!s){const n=this.changeList?.[this.targetPageReference]?.[t-1].content;this.changeList[this.targetPageReference][t-1]=bh(Lh.deepClone(n),e,r)}if(this.current?.automatic!==s||this.current?.instruction?.listIndex!==t||"UPDATE"!==this.current?.instruction.instruction)this.insertNode(o),s&&(this.current.automatic=!0);else{const t=this.current.instruction.content;this.current.instruction.content=bh(Lh.deepClone(t),Lh.unflatten(e),r)}}}delete(e,t){const n=ar.execute(this.target,e,this.pageReference);this.changeList[this.targetPageReference]?.splice(e-1,1),this.insertNode(n),t||Eh(Cg({instruction:"DELETE",listIndex:e-1,context:this.contextName,referenceList:`${this.pageReference}${this.target}`}))}insert(e,t,n,r){const{instruction:s,actionPayload:a={content:{}},displayPropertyPayload:o={}}=rr.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]=bh(Lh.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},Eh(Cg({...a,listIndex:t-1,context:this.contextName,referenceList:`${this.pageReference}${this.target}`}))),i&&(this.current.automatic=!0)}replacePage(e,t=!0){const{instruction:n,actionPayload:r,displayPropertyPayload:s={}}=cr.execute(this.contextName,this.target,e,this.pageReference);this.insertNode(n),t||(r.content={...r.content,...s},Eh(Cg({...r,context:this.contextName,referenceList:`${this.pageReference}${this.target}`})))}deletePage(e=!0){const t=lr.execute(this.target,this.pageReference);this.insertNode(t),e||Eh(Cg({instruction:"DELETEPAGE",context:this.contextName,referenceList:`${this.pageReference}${this.target}`}))}move(e,t){const n=this.changeList[this.targetPageReference]?.splice(e-1,1);this.changeList[this.targetPageReference]?.splice(t-1,0,n[0]);const r=ir.execute(this.target,e,t,this.pageReference);this.insertNode(r),Eh(Cg({listIndex:e-1,listMoveToIndex:t-1,context:this.contextName,referenceList:`${this.pageReference}${this.target}`,instruction:"MOVE"}))}deleteAll(e){const t=or.getDeleteAllInstruction(this.pageReference,this.target);this.changeList[this.targetPageReference]=[],this.insertNode(t),or.execute(this.contextName,this.target,this.pageReference,e)}updatePage(e){const t=this.current.instruction.content;this.current.instruction.content=bh(Lh.deepClone(t),e)}},pr={},hr={},gr={},fr=(e,t,n)=>{pr[e]||(pr[e]={}),pr[e][t]||(pr[e][t]={content:[]}),hr[e]||(hr[e]=[],gr[e]=[]),ll.isStateMachineExist(e,n,t)||ll.setStateMachine(e,t,n,new dr(t,n,e))},mr=e=>Gn.formatPageReference(e),yr=(e,t)=>{const n=hr[e],r=gr[e],s=dl(t),a=s?.substring(0,s.indexOf("["));r?.indexOf(a)<0&&gr[e].push(a),n?.indexOf(s)<0&&hr[e].push(s)},Er=e=>{delete hr[e]},Ir=e=>ll.buildPageInstructionsByContext(e),Ar=e=>ll.buildPageInstructionsByContext(e,!0),_r=e=>{ll.clearStateMachines(e),delete pr[e]},Cr=(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]})))},Sr=(e,t,n,r,s)=>{const{skipStateUpdate:a=!1}=s||{},o=n.getContextName(),i=n.getReferenceList(),c=r||n.getPageReference(),l=mr(i);fr(o,l,c),yr(o,`${i}[${t}]`),Cr(i,c,e,t);const u={instruction:j.LIST_ACTIONS.INSERT,content:{...Lh.unflatten(e)}};delete JSON.parse(JSON.stringify(u)).content.classID;ll.getStateMachine(o,c,l).insert(e,t+1,a,{})},Tr=(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=mr(i);fr(o,l,c),yr(o,`${i}[${n}]`),Cr(i,c,e,n);ll.getStateMachine(o,c,l).update(e,n+1,s,r)},Nr=(e,t)=>{const[,n]=e.split("."),r=t?.split(".").pop();return n===r},Rr=(e,t,n)=>{const r={};return Object.values(e).forEach((e=>{if(Nr(e,n)){const n=Lh.getPropertyName(e),s=n.substr(n.indexOf(".")+1).split(".");if(s.length>1){let e=Lh.getIn(t,s)??"";if(!e){const n=`!P!${s.join(":")}`;e=Lh.getIn(t,n)??""}Lh.setIn(r,s,e)}else{const e=Lh.getIn(t,s)??"";r[s[s.length-1]]=e}}})),r},Pr=(e,t,n,r,s)=>{const a=e.getValue(t)||{};n&&Object.keys(a).length>0&&e.clearErrorMessages({property:r?s:e.getStateProps().value})},Dr=(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,E={...y};if(((e,t,n)=>{t?.descriptors?.length&&!n&&t.descriptors.forEach((t=>{const n=Lh.getPropertyName(t),r=n.substr(n.indexOf(".")+1).split(".");e[r.join(".")]=t}))})(E,m,c),c){let n=o;n=mr(n);const r=t.getValue(f)||[];fr(l,n,u);const a=[];let i=r.length;e.forEach((e=>{const t=Rr(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=ll.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}})})),Eh(Cg({instruction:j.LIST_ACTIONS_TYPE.SELECT_DESELECT,context:l,referenceList:`${u}.${d}`,actions:a}))}else{const n=Rr(E,e[0],d);Object.keys(n).forEach((e=>{t.getActionsApi().updateFieldValue(`.${e}`,n[e],g?{contextPageReference:u}:{}),t.getActionsApi().triggerFieldChange(`.${d}.${e}`,n[e])}))}Pr(t,f,i,c,d),r()})),br=e=>{if(!e)return!1;const t=Ar(e);return Array.isArray(t)&&t.length>0};const Or=(e,t,n={})=>{const{skipStateUpdate:r=!1}=n,s=e.getPageReference(),a=mr(t);fr(e.getContextName(),t,s);ll.getStateMachine(e.getContextName(),s,a).deleteAll(r)},vr=e=>({insert:(t,n,r,s)=>Sr(t,n,e,r,s),update:(t,n,r)=>Tr(t,e,n,r),updateProperty:(t,n,r)=>((e,t,n,r={})=>{const s=n.getPageReference(),{stateMachineTarget:a}=ll.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&&fr(n.getContextName(),t,e)}ll.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=mr(s);Xn({type:F.MESSAGES.MESSAGES_TYPE_ERROR,pageReference:o,context:r,isListEntry:!0,deletingIndex:e}),fr(r,i,a),yr(r,`${s}[${e}]`),ll.getStateMachine(r,a,i).delete(e+1);const c=ll.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=mr(s);fr(r,o,a),yr(r,`${s}[${t}]`),ll.getStateMachine(r,a,o).move(e+1,t+1)})(t,n,e),setSelectedRows:(t,n={skipPageInstructions:!1})=>Dr(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 Nr(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=mr(i),fr(r,i,s),ll.getStateMachine(r,s,i).deleteAll(),Pr(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=mr(i);const r=ll.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=mr(t);fr(s,o,a),ll.getStateMachine(s,a,o).initPageInstructions(e,n,r)})(e,t,n,r),deleteAll:(t,n)=>Or(e,t,n),replacePage:(t,n,r)=>((e,t,n,r)=>{const{skipStateUpdate:s=!0}=r||{},a=e.getPageReference(),o=e.getContextName();fr(o,t,a),yr(o,Lh.buildInstructionPageReference(a,t)),ll.getStateMachine(o,a,t).replacePage(n,s)})(e,t,n,r),deletePage:(t,n)=>((e,t,n)=>{const{skipStateUpdate:r=!0}=n||{},s=e.getPageReference(),a=e.getContextName();fr(a,t,s),yr(a,Lh.buildInstructionPageReference(s,t)),ll.getStateMachine(a,s,t).deletePage(r)})(e,t,n)});const xr=new class{constructor(){this.fieldDefaults={}}updateFieldDefaults(e){e&&(Object.keys(this.fieldDefaults).length?Lh.mergeDeep(e,this.fieldDefaults):Lh.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 wr{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=(Ch(`.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),wr.messageDispatcher(t,n,s,c,Gn.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=xr.getDefaultsforType(a?.componentName||"")?.["client-validations"];!1!==c&&e&&this.getValidator(e)&&(o=this.getValidator(e)(r,i),""!==r&&wr.messageDispatcher(t,n,s,o,a?.label));const l=a?.validationType;return c=l&&xr.getDefaultsforType(l)?.["client-validations"],!1!==c&&l&&this.getValidator(l)&&(o=this.getValidator(l)(r,i),wr.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}),Jn({messages:a,property:e,pageReference:t,context:n})}}isValidatorExist(e){return!!e.validatetype}}const Mr=new wr,Lr=(e,t)=>{e.DeclareExpressions&&Kt({[t.context]:e.DeclareExpressions})},Ur=(e,t,n=!1)=>{const r=Lh.getIn(e,j.RESOURCES);r&&((e=>{e&&Kp(e)})(r),Lr(r,t)),n||qg({...e,options:t})},Fr="text/javascript";const jr=new class{constructor(){this.loaderObj={},this.staticServerURL="",this.appStaticUrl=null,this.pegaOnlyUrl=!1,this.loadedAssets={},this.componentsConfig=null,this.appAlias="",this.b2sJWT=null,this.ccV2LibId="",this.imageBlobUrlCache={},this.svcLocaleErrorCache=new Map}getTypes={SCRIPT:"script",STYLE:"link"};getStaticServerUrl(){return this.staticServerURL}setCCV2LibId(e){this.ccV2LibId=e}getCCV2LibId(){return this.ccV2LibId}async getThemeSchemaJSON(){const e=`${this.staticServerURL}themeOverrides.schema.json`;return fetch(e).then((e=>e.json()))}getConstellationServiceUrl(){return this.staticServerURL?.endsWith("/")?this.staticServerURL.substring(0,this.staticServerURL.length-1):this.staticServerURL}setAppAlias(e){this.appAlias=e}getAppAlias(){return this.appAlias}async getSvcComponentsConfig(e,t={}){let n="",r=0;return e.forEach((e=>{n+=`${0===r?"?":"&"}field${r}=${e.field}&value${r}=${e.value}`,r+=1})),this.pegaOnlyUrl?this.getSvcComponentsConfigSeparatedUrls(e,n,t):this.getSvcComponentsConfigCombinedUrl(e,n,t)}async getSvcComponentsConfigSeparatedUrls(e,t,n){const r=Sp.getBuiltOnAppNames(),s=this.loadAndFilterPegaComponentsConfig(e,r);let a=Promise.resolve([]);!0!==n.skipLoadCustomerComponents&&(a=this.loadAndCustomerComponentsConfig(t));const o=this.fetchSDKComponent(t),i=[];if(await Promise.all([s,a,o]).then((e=>{const t=this.mergeComponentList(e);i.push(...t)})),n.alternateDesignSystemURL&&1===i.length){const r=await this.getSvcComponentsConfigADS(e,t,n);i[0].alternateDesignSystemConfig=r}return{data:{components:i}}}mergeComponentList=e=>{const[t=[],n=[],r=[]]=e,s=[...t,...n];return this.appStaticUrl?s.map((e=>{const{name:t,type:n,subtype:s}=e,a=r.reduce(((e,r)=>(t===r.name&&n===r.type&&s===r.subtype&&(e=r),e)),{});return Object.keys(a).length>0?{...e,alternateDesignSystemConfig:{...a}}:e})):s};async fetchSDKComponent(e){if(this.appStaticUrl&&this.appStaticUrl.length>8&&this.appStaticUrl!==this.staticServerURL){const t=`${this.appStaticUrl}v102/${this.appAlias}/componentslist-ext${e}`;return fetch(t,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.json())).then((e=>e.components)).catch((()=>[]))}return Promise.resolve([])}async loadAndFilterPegaComponentsConfig(e,t){return this.loadPegaComponentsConfig().then((()=>{const n=[];return this.componentsConfig&&this.componentsConfig.forEach((r=>{let s=!0;e.forEach((e=>{Array.isArray(r[e.field])?r[e.field].includes(e.value)||(s=!1):r[e.field]!==e.value&&(s=!1)})),s&&this.checkForBuiltOnSupport(t,r.allowedApplications)&&n.push(r)})),n}))}async loadPegaComponentsConfig(){let e=null;if(null===this.componentsConfig){const t=`${this.staticServerURL}components/componentsconfig.json?v=${(new Date).getTime()}`;e=fetch(t,{method:"GET"}).then((e=>e.json())).then((async e=>{this.componentsConfig=e,this.ccV2LibId&&await this.loadLibraryComponentsConfig(this.ccV2LibId).then((e=>{e&&e.length>0&&(this.componentsConfig=(this.componentsConfig||[]).concat(e))})).catch((e=>{console.error(`Exception while appending custom component config from library ${this.ccV2LibId} : ${e}`)}))})).catch()}else e=Promise.resolve();return e}async loadLibraryComponentsConfig(e){let t=null;return t=fetch(`${this.appStaticUrl}v100/componentlib/componentsconfig/${e}?v=${Date.now()}`,{headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>{if(!e.ok)throw console.error("Error while fetching custom component config/library component config"),new Error(e.statusText);return e})).then((e=>e.json())).then((e=>Promise.resolve(e))).catch((t=>(console.error(`Exception while fetching custom component config from library ${e} : ${t}`),{error:t.message}))),t}async loadAndCustomerComponentsConfig(e){let t=null;if(this.appStaticUrl&&this.appStaticUrl.length>8&&this.appStaticUrl!==this.staticServerURL){const n=`${this.appStaticUrl}v103/${this.appAlias}/componentslist${e}`;t=fetch(n,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.json())).then((e=>e.components)).catch((()=>[]))}else t=Promise.resolve([]);return t}checkForBuiltOnSupport(e,t){if(!e||!t||0===e.length||0===t.length)return!0;const n=e.split(",");return 0===n.length||n.some((function(e){return-1!==t.indexOf(e)}))}async getSvcComponentsConfigCombinedUrl(e,t,n){const r=`${this.staticServerURL}v102/${this.appAlias}/componentslist${t}`,s=await fetch(r,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.json())).then((e=>({data:e})));if(!0===n.skipLoadCustomerComponents&&s?.data?.components?.length>0&&(s.data.components=s.data.components.filter((e=>void 0===e.componentKey))),n.alternateDesignSystemURL&&1===s?.data?.components?.length){const r=await this.getSvcComponentsConfigADS(e,t,n);s.data.components[0].alternateDesignSystemConfig=r}return s}getSvcComponentsConfigADS(e,t,n){const r=`${n.alternateDesignSystemURL}${n.alternateDesignSystemURL?.endsWith("/")?"":"/"}components/${e[0].value}/config-ext.json`;return fetch(r,{method:"GET"}).then((e=>{if(e.ok)return e.json();throw new Error(e.statusText)})).catch((e=>({error:e.message})))}getSvcImage(e){const t=`${this.appStaticUrl}v102/${this.appAlias}/image/${e}`;return fetch(t,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.blob())).catch()}getSvcImageUrl(e){const t=`${this.appStaticUrl}v102/${this.appAlias}/image/${e}`;return void 0===this.imageBlobUrlCache[t]&&(this.imageBlobUrlCache[t]=fetch(t,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.blob())).then((e=>window.URL.createObjectURL(e))).catch()),this.imageBlobUrlCache[t]}getSvcLocale(e,t){const n=`${this.appStaticUrl}v102/${this.appAlias}/locales/${e}/${t}`,r=`${this.appStaticUrl}::${this.appAlias}::${e}::${t}`;return!0===this.svcLocaleErrorCache.get(r)?Promise.resolve(null):fetch(n,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>400===e.status||404===e.status?(this.svcLocaleErrorCache.set(r,!0),null):e)).catch((()=>null))}getSvcAvailableLocales(){const e=`${this.appStaticUrl}v102/app/${this.appAlias}/locales/getLocaleCodes`;return fetch(e,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.json())).catch((()=>[]))}getSvcComponent(e){const t=`${this.appStaticUrl}v102/${this.appAlias}/component/${e}`;return fetch(t,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>{if(!e.ok)throw Error(e.statusText);return e})).then((e=>e.text())).then((e=>e)).catch()}async importCustomComponentMap(e){fetch(`${this.appStaticUrl}v100/componentlib/componentsmap/${e}`,{headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>(e.ok||console.error("Error while fetching custom component map"),e))).then((e=>e.text())).then((t=>{this.setCCV2LibId(e);const n=document.createElement("script");n.src=window.URL.createObjectURL(new Blob([t],{type:Fr})),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:Fr})),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=Fr,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}=jg("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()))}},Vr="component-loader",kr={},$r=async(e,t)=>{const n=jr.getLoader(),r=t||jr.staticServerURL;if(!e||window.PCore&&!1===window.PCore.getBehaviorOverride("dynamicLoadComponents"))return Promise.resolve();if(jr.getLoader(Vr))return jr.getLoader(Vr)(e,r);const s=[];return e.forEach((e=>{if(kr[e])return;const t=en.getComponent(e);if(!t){const t=`${jr.getConstellationServiceUrl()}/v860/${jr.getAppAlias()}/component/${e}.js`;return void s.push(n(t,jr.getTypes.SCRIPT))}(t.scripts||[]).forEach((e=>{const t=e.startsWith("http")?e:r+e;s.push(n(t,jr.getTypes.SCRIPT))}));(t.styles||[]).forEach((e=>{s.push(n(r+e,jr.getTypes.STYLE))})),kr[e]=!0})),Promise.all(s)};function Br(e,t){return function(){return e.apply(t,arguments)}}const{toString:Gr}=Object.prototype,{getPrototypeOf:Wr}=Object,{iterator:Hr,toStringTag:qr}=Symbol,zr=(Yr=Object.create(null),e=>{const t=Gr.call(e);return Yr[t]||(Yr[t]=t.slice(8,-1).toLowerCase())});var Yr;const Kr=e=>(e=e.toLowerCase(),t=>zr(t)===e),Xr=e=>t=>typeof t===e,{isArray:Jr}=Array,Qr=Xr("undefined");function Zr(e){return null!==e&&!Qr(e)&&null!==e.constructor&&!Qr(e.constructor)&&ns(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const es=Kr("ArrayBuffer");const ts=Xr("string"),ns=Xr("function"),rs=Xr("number"),ss=e=>null!==e&&"object"==typeof e,as=e=>{if("object"!==zr(e))return!1;const t=Wr(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||qr in e||Hr in e)},os=Kr("Date"),is=Kr("File"),cs=Kr("Blob"),ls=Kr("FileList");const us="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},ds=void 0!==us.FormData?us.FormData:void 0,ps=Kr("URLSearchParams"),[hs,gs,fs,ms]=["ReadableStream","Request","Response","Headers"].map(Kr);function ys(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,s;if("object"!=typeof e&&(e=[e]),Jr(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(Zr(e))return;const s=n?Object.getOwnPropertyNames(e):Object.keys(e),a=s.length;let o;for(r=0;r<a;r++)o=s[r],t.call(null,e[o],o,e)}}function Es(e,t){if(Zr(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,s=n.length;for(;s-- >0;)if(r=n[s],t===r.toLowerCase())return r;return null}const Is="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,As=e=>!Qr(e)&&e!==Is;const _s=(Cs="undefined"!=typeof Uint8Array&&Wr(Uint8Array),e=>Cs&&e instanceof Cs);var Cs;const Ss=Kr("HTMLFormElement"),Ts=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Ns=Kr("RegExp"),Rs=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};ys(n,((n,s)=>{let a;!1!==(a=t(n,s,e))&&(r[s]=a||n)})),Object.defineProperties(e,r)};const Ps=Kr("AsyncFunction"),Ds=(bs="function"==typeof setImmediate,Os=ns(Is.postMessage),bs?setImmediate:Os?(vs=`axios@${Math.random()}`,xs=[],Is.addEventListener("message",(({source:e,data:t})=>{e===Is&&t===vs&&xs.length&&xs.shift()()}),!1),e=>{xs.push(e),Is.postMessage(vs,"*")}):e=>setTimeout(e));var bs,Os,vs,xs;const ws="undefined"!=typeof queueMicrotask?queueMicrotask.bind(Is):"undefined"!=typeof process&&process.nextTick||Ds,Ms={isArray:Jr,isArrayBuffer:es,isBuffer:Zr,isFormData:e=>{if(!e)return!1;if(ds&&e instanceof ds)return!0;const t=Wr(e);if(!t||t===Object.prototype)return!1;if(!ns(e.append))return!1;const n=zr(e);return"formdata"===n||"object"===n&&ns(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&es(e.buffer),t},isString:ts,isNumber:rs,isBoolean:e=>!0===e||!1===e,isObject:ss,isPlainObject:as,isEmptyObject:e=>{if(!ss(e)||Zr(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:hs,isRequest:gs,isResponse:fs,isHeaders:ms,isUndefined:Qr,isDate:os,isFile:is,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:cs,isRegExp:Ns,isFunction:ns,isStream:e=>ss(e)&&ns(e.pipe),isURLSearchParams:ps,isTypedArray:_s,isFileList:ls,forEach:ys,merge:function e(...t){const{caseless:n,skipUndefined:r}=As(this)&&this||{},s={},a=(t,a)=>{if("__proto__"===a||"constructor"===a||"prototype"===a)return;const o=n&&Es(s,a)||a,i=Ts(s,o)?s[o]:void 0;as(i)&&as(t)?s[o]=e(i,t):as(t)?s[o]=e({},t):Jr(t)?s[o]=t.slice():r&&Qr(t)||(s[o]=t)};for(let e=0,n=t.length;e<n;e++)t[e]&&ys(t[e],a);return s},extend:(e,t,n,{allOwnKeys:r}={})=>(ys(t,((t,r)=>{n&&ns(t)?Object.defineProperty(e,r,{__proto__:null,value:Br(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})}),{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),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,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&&Wr(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:zr,kindOfTest:Kr,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(Jr(e))return e;let t=e.length;if(!rs(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Hr]).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:Ss,hasOwnProperty:Ts,hasOwnProp:Ts,reduceDescriptors:Rs,freezeMethods:e=>{Rs(e,((t,n)=>{if(ns(e)&&["arguments","caller","callee"].includes(n))return!1;const r=e[n];ns(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 Jr(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:Es,global:Is,isContextDefined:As,isSpecCompliantForm:function(e){return!!(e&&ns(e.append)&&"FormData"===e[qr]&&e[Hr])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(ss(e)){if(t.indexOf(e)>=0)return;if(Zr(e))return e;if(!("toJSON"in e)){t[r]=e;const s=Jr(e)?[]:{};return ys(e,((e,t)=>{const a=n(e,r+1);!Qr(a)&&(s[t]=a)})),t[r]=void 0,s}}return e};return n(e,0)},isAsyncFn:Ps,isThenable:e=>e&&(ss(e)||ns(e))&&ns(e.then)&&ns(e.catch),setImmediate:Ds,asap:ws,isIterable:e=>null!=e&&ns(e[Hr])},Ls=Ms.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"]),Us=Symbol("internals"),Fs=/[^\x09\x20-\x7E\x80-\xFF]/g;function js(e){return e&&String(e).trim().toLowerCase()}function Vs(e){return!1===e||null==e?e:Ms.isArray(e)?e.map(Vs):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(Fs,""))}function ks(e,t,n,r,s){return Ms.isFunction(r)?r.call(this,t,n):(s&&(t=n),Ms.isString(t)?Ms.isString(r)?-1!==t.indexOf(r):Ms.isRegExp(r)?r.test(t):void 0:void 0)}class $s{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function s(e,t,n){const s=js(t);if(!s)throw new Error("header name must be a non-empty string");const a=Ms.findKey(r,s);(!a||void 0===r[a]||!0===n||void 0===n&&!1!==r[a])&&(r[a||t]=Vs(e))}const a=(e,t)=>Ms.forEach(e,((e,n)=>s(e,n,t)));if(Ms.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(Ms.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]&&Ls[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(Ms.isObject(e)&&Ms.isIterable(e)){let n,r,s={};for(const t of e){if(!Ms.isArray(t))throw TypeError("Object iterator must return a key-value pair");s[r=t[0]]=(n=s[r])?Ms.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}a(s,t)}else null!=e&&s(t,e,n);return this}get(e,t){if(e=js(e)){const n=Ms.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(Ms.isFunction(t))return t.call(this,e,n);if(Ms.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=js(e)){const n=Ms.findKey(this,e);return!(!n||void 0===this[n]||t&&!ks(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function s(e){if(e=js(e)){const s=Ms.findKey(n,e);!s||t&&!ks(0,n[s],s,t)||(delete n[s],r=!0)}}return Ms.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&&!ks(0,this[s],s,e,!0)||(delete this[s],r=!0)}return r}normalize(e){const t=this,n={};return Ms.forEach(this,((r,s)=>{const a=Ms.findKey(n,s);if(a)return t[a]=Vs(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]=Vs(r),n[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Ms.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Ms.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[Us]=this[Us]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=js(e);t[r]||(!function(e,t){const n=Ms.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{__proto__:null,value:function(e,n,s){return this[r].call(this,t,e,n,s)},configurable:!0})}))}(n,e),t[r]=!0)}return Ms.isArray(e)?e.forEach(r):r(e),this}}$s.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Ms.reduceDescriptors($s.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),Ms.freezeMethods($s);const Bs=$s;function Gs(e,t){const n=new Set(t.map((e=>String(e).toLowerCase()))),r=[],s=e=>{if(null===e||"object"!=typeof e)return e;if(Ms.isBuffer(e))return e;if(-1!==r.indexOf(e))return;let t;if(e instanceof Bs&&(e=e.toJSON()),r.push(e),Ms.isArray(e))t=[],e.forEach(((e,n)=>{const r=s(e);Ms.isUndefined(r)||(t[n]=r)}));else{if(!Ms.isPlainObject(e)&&function(e){if(Ms.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(Ms.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(e))return r.pop(),e;t=Object.create(null);for(const[r,a]of Object.entries(e)){const e=n.has(r.toLowerCase())?"[REDACTED ****]":s(a);Ms.isUndefined(e)||(t[r]=e)}}return r.pop(),t};return s(e)}class Ws extends Error{static from(e,t,n,r,s,a){const o=new Ws(e.message,t||e.code,n,r,s);return o.cause=e,o.name=e.name,null!=e.status&&null==o.status&&(o.status=e.status),a&&Object.assign(o,a),o}constructor(e,t,n,r,s){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),r&&(this.request=r),s&&(this.response=s,this.status=s.status)}toJSON(){const e=this.config,t=e&&Ms.hasOwnProp(e,"redact")?e.redact:void 0,n=Ms.isArray(t)&&t.length>0?Gs(e,t):Ms.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}}}Ws.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",Ws.ERR_BAD_OPTION="ERR_BAD_OPTION",Ws.ECONNABORTED="ECONNABORTED",Ws.ETIMEDOUT="ETIMEDOUT",Ws.ECONNREFUSED="ECONNREFUSED",Ws.ERR_NETWORK="ERR_NETWORK",Ws.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",Ws.ERR_DEPRECATED="ERR_DEPRECATED",Ws.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",Ws.ERR_BAD_REQUEST="ERR_BAD_REQUEST",Ws.ERR_CANCELED="ERR_CANCELED",Ws.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",Ws.ERR_INVALID_URL="ERR_INVALID_URL",Ws.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const Hs=Ws;function qs(e){return Ms.isPlainObject(e)||Ms.isArray(e)}function zs(e){return Ms.endsWith(e,"[]")?e.slice(0,-2):e}function Ys(e,t,n){return e?e.concat(t).map((function(e,t){return e=zs(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const Ks=Ms.toFlatObject(Ms,{},null,(function(e){return/^is[A-Z]/.test(e)}));const Xs=function(e,t,n){if(!Ms.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=Ms.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!Ms.isUndefined(t[e])}))).metaTokens,s=n.visitor||d,a=n.dots,o=n.indexes,i=n.Blob||"undefined"!=typeof Blob&&Blob,c=void 0===n.maxDepth?100:n.maxDepth,l=i&&Ms.isSpecCompliantForm(t);if(!Ms.isFunction(s))throw new TypeError("visitor must be a function");function u(e){if(null===e)return"";if(Ms.isDate(e))return e.toISOString();if(Ms.isBoolean(e))return e.toString();if(!l&&Ms.isBlob(e))throw new Hs("Blob is not supported. Use a Buffer instead.");return Ms.isArrayBuffer(e)||Ms.isTypedArray(e)?l&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function d(e,n,s){let i=e;if(Ms.isReactNative(t)&&Ms.isReactNativeBlob(e))return t.append(Ys(s,n,a),u(e)),!1;if(e&&!s&&"object"==typeof e)if(Ms.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(Ms.isArray(e)&&function(e){return Ms.isArray(e)&&!e.some(qs)}(e)||(Ms.isFileList(e)||Ms.endsWith(n,"[]"))&&(i=Ms.toArray(e)))return n=zs(n),i.forEach((function(e,r){!Ms.isUndefined(e)&&null!==e&&t.append(!0===o?Ys([n],r,a):null===o?n:n+"[]",u(e))})),!1;return!!qs(e)||(t.append(Ys(s,n,a),u(e)),!1)}const p=[],h=Object.assign(Ks,{defaultVisitor:d,convertValue:u,isVisitable:qs});if(!Ms.isObject(e))throw new TypeError("data must be an object");return function e(n,r,a=0){if(!Ms.isUndefined(n)){if(a>c)throw new Hs("Object is too deeply nested ("+a+" levels). Max depth: "+c,Hs.ERR_FORM_DATA_DEPTH_EXCEEDED);if(-1!==p.indexOf(n))throw Error("Circular reference detected in "+r.join("."));p.push(n),Ms.forEach(n,(function(n,o){!0===(!(Ms.isUndefined(n)||null===n)&&s.call(t,n,Ms.isString(o)?o.trim():o,r,h))&&e(n,r?r.concat(o):[o],a+1)})),p.pop()}}(e),t};function Js(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,(function(e){return t[e]}))}function Qs(e,t){this._pairs=[],e&&Xs(e,this,t)}const Zs=Qs.prototype;Zs.append=function(e,t){this._pairs.push([e,t])},Zs.toString=function(e){const t=e?function(t){return e.call(this,t,Js)}:Js;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const ea=Qs;function ta(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function na(e,t,n){if(!t)return e;const r=n&&n.encode||ta,s=Ms.isFunction(n)?{serialize:n}:n,a=s&&s.serialize;let o;if(o=a?a(t,s):Ms.isURLSearchParams(t)?t.toString():new ea(t,s).toString(r),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}const ra=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){Ms.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},sa={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},aa={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ea,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},oa="undefined"!=typeof window&&"undefined"!=typeof document,ia="object"==typeof navigator&&navigator||void 0,ca=oa&&(!ia||["ReactNative","NativeScript","NS"].indexOf(ia.product)<0),la="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ua=oa&&window.location.href||"http://localhost",da={...a,...aa};const pa=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&&Ms.isArray(r)?r.length:a,i)return Ms.hasOwnProp(r,a)?r[a]=Ms.isArray(r[a])?r[a].concat(n):[r[a],n]:r[a]=n,!o;r[a]&&Ms.isObject(r[a])||(r[a]=[]);return t(e,n,r[a],s)&&Ms.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(Ms.isFormData(e)&&Ms.isFunction(e.entries)){const n={};return Ms.forEachEntry(e,((e,r)=>{t(function(e){return Ms.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null},ha=(e,t)=>null!=e&&Ms.hasOwnProp(e,t)?e[t]:void 0;const ga={transitional:sa,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,s=Ms.isObject(e);s&&Ms.isHTMLForm(e)&&(e=new FormData(e));if(Ms.isFormData(e))return r?JSON.stringify(pa(e)):e;if(Ms.isArrayBuffer(e)||Ms.isBuffer(e)||Ms.isStream(e)||Ms.isFile(e)||Ms.isBlob(e)||Ms.isReadableStream(e))return e;if(Ms.isArrayBufferView(e))return e.buffer;if(Ms.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(s){const t=ha(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Xs(e,new da.classes.URLSearchParams,{visitor:function(e,t,n,r){return da.isNode&&Ms.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,t).toString();if((a=Ms.isFileList(e))||n.indexOf("multipart/form-data")>-1){const n=ha(this,"env"),r=n&&n.FormData;return Xs(a?{"files[]":e}:e,r&&new r,t)}}return s||r?(t.setContentType("application/json",!1),function(e,t,n){if(Ms.isString(e))try{return(t||JSON.parse)(e),Ms.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=ha(this,"transitional")||ga.transitional,n=t&&t.forcedJSONParsing,r=ha(this,"responseType"),s="json"===r;if(Ms.isResponse(e)||Ms.isReadableStream(e))return e;if(e&&Ms.isString(e)&&(n&&!r||s)){const n=!(t&&t.silentJSONParsing)&&s;try{return JSON.parse(e,ha(this,"parseReviver"))}catch(e){if(n){if("SyntaxError"===e.name)throw Hs.from(e,Hs.ERR_BAD_RESPONSE,this,null,ha(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}}};Ms.forEach(["delete","get","head","post","put","patch","query"],(e=>{ga.headers[e]={}}));const fa=ga;function ma(e,t){const n=this||fa,r=t||n,s=Bs.from(r.headers);let a=r.data;return Ms.forEach(e,(function(e){a=e.call(n,a,s.normalize(),t?t.status:void 0)})),s.normalize(),a}function ya(e){return!(!e||!e.__CANCEL__)}const Ea=class extends Hs{constructor(e,t,n){super(null==e?"canceled":e,Hs.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function Ia(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Hs("Request failed with status code "+n.status,n.status>=400&&n.status<500?Hs.ERR_BAD_REQUEST:Hs.ERR_BAD_RESPONSE,n.config,n.request,n)):e(n)}const Aa=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 _a=function(e,t){let n,r,s=0,a=1e3/t;const o=(t,a=Date.now())=>{s=a,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),i=t-s;i>=a?o(e,t):(n=e,r||(r=setTimeout((()=>{r=null,o(n)}),a-i)))},()=>n&&o(n)]},Ca=(e,t,n=3)=>{let r=0;const s=Aa(50,250);return _a((n=>{const a=n.loaded,o=n.lengthComputable?n.total:void 0,i=null!=o?Math.min(a,o):a,c=Math.max(0,i-r),l=s(c);r=Math.max(r,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)},Sa=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Ta=e=>(...t)=>Ms.asap((()=>e(...t))),Na=da.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,da.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(da.origin),da.navigator&&/(msie|trident)/i.test(da.navigator.userAgent)):()=>!0,Ra=da.hasStandardBrowserEnv?{write(e,t,n,r,s,a,o){if("undefined"==typeof document)return;const i=[`${e}=${encodeURIComponent(t)}`];Ms.isNumber(n)&&i.push(`expires=${new Date(n).toUTCString()}`),Ms.isString(r)&&i.push(`path=${r}`),Ms.isString(s)&&i.push(`domain=${s}`),!0===a&&i.push("secure"),Ms.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 r=t[n].replace(/^\s+/,""),s=r.indexOf("=");if(-1!==s&&r.slice(0,s)===e)return decodeURIComponent(r.slice(s+1))}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function Pa(e,t,n){let r=!("string"==typeof(s=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(s));var s;return e&&(r||!1===n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Da=e=>e instanceof Bs?{...e}:e;function ba(e,t){t=t||{};const n=Object.create(null);function r(e,t,n,r){return Ms.isPlainObject(e)&&Ms.isPlainObject(t)?Ms.merge.call({caseless:r},e,t):Ms.isPlainObject(t)?Ms.merge({},t):Ms.isArray(t)?t.slice():t}function s(e,t,n,s){return Ms.isUndefined(t)?Ms.isUndefined(e)?void 0:r(void 0,e,0,s):r(e,t,0,s)}function a(e,t){if(!Ms.isUndefined(t))return r(void 0,t)}function o(e,t){return Ms.isUndefined(t)?Ms.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function i(n,s,a){return Ms.hasOwnProp(t,a)?r(n,s):Ms.hasOwnProp(e,a)?r(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,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,allowedSocketPaths:o,responseEncoding:o,validateStatus:i,headers:(e,t,n)=>s(Da(e),Da(t),0,!0)};return Ms.forEach(Object.keys({...e,...t}),(function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;const a=Ms.hasOwnProp(c,r)?c[r]:s,o=a(Ms.hasOwnProp(e,r)?e[r]:void 0,Ms.hasOwnProp(t,r)?t[r]:void 0,r);Ms.isUndefined(o)&&a!==i||(n[r]=o)})),n}const Oa=["content-type","content-length"];const va=e=>{const t=ba({},e),n=e=>Ms.hasOwnProp(t,e)?t[e]:void 0,r=n("data");let s=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");var p;if(t.headers=i=Bs.from(i),t.url=na(Pa(l,d,u),e.params,e.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?(p=c.password,encodeURIComponent(p).replace(/%([0-9A-F]{2})/gi,((e,t)=>String.fromCharCode(parseInt(t,16))))):""))),Ms.isFormData(r)&&(da.hasStandardBrowserEnv||da.hasStandardBrowserWebWorkerEnv?i.setContentType(void 0):Ms.isFunction(r.getHeaders)&&function(e,t,n){"content-only"===n?Object.entries(t).forEach((([t,n])=>{Oa.includes(t.toLowerCase())&&e.set(t,n)})):e.set(t)}(i,r.getHeaders(),n("formDataHeaderPolicy"))),da.hasStandardBrowserEnv){Ms.isFunction(s)&&(s=s(t));if(!0===s||null==s&&Na(t.url)){const e=a&&o&&Ra.read(o);e&&i.set(a,e)}}return t},xa="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=va(e);let s=r.data;const a=Bs.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=Bs.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders());Ia((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&&f.responseURL.startsWith("file:"))&&setTimeout(m)},f.onabort=function(){f&&(n(new Hs("Request aborted",Hs.ECONNABORTED,e,f)),g(),f=null)},f.onerror=function(t){const r=t&&t.message?t.message:"Network Error",s=new Hs(r,Hs.ERR_NETWORK,e,f);s.event=t||null,n(s),g(),f=null},f.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const s=r.transitional||sa;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Hs(t,s.clarifyTimeoutError?Hs.ETIMEDOUT:Hs.ECONNABORTED,e,f)),g(),f=null},void 0===s&&a.setContentType(null),"setRequestHeader"in f&&Ms.forEach(a.toJSON(),(function(e,t){f.setRequestHeader(t,e)})),Ms.isUndefined(r.withCredentials)||(f.withCredentials=!!r.withCredentials),d&&"json"!==d&&(f.responseType=r.responseType),h&&([c,u]=Ca(h,!0),f.addEventListener("progress",c)),p&&f.upload&&([i,l]=Ca(p),f.upload.addEventListener("progress",i),f.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(o=t=>{f&&(n(!t||t.type?new Ea(null,e,f):t),f.abort(),g(),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||da.protocols.includes(y)?f.send(s||null):n(new Hs("Unsupported protocol "+y+":",Hs.ERR_BAD_REQUEST,e))}))},wa=(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 Hs?t:new Ea(t instanceof Error?t.message:t))}};let a=t&&setTimeout((()=>{a=null,s(new Hs(`timeout of ${t}ms exceeded`,Hs.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=()=>Ms.asap(o),i}},Ma=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},La=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()}},Ua=(e,t,n,r)=>{const s=async function*(e,t){for await(const n of La(e))yield*Ma(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})};const Fa="1.16.0",{isFunction:ja}=Ms,Va=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},ka=e=>{const t=Ms.global??globalThis,{ReadableStream:n,TextEncoder:r}=t;e=Ms.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:s,Request:a,Response:o}=e,i=s?ja(s):"function"==typeof fetch,c=ja(a),l=ja(o);if(!i)return!1;const u=i&&ja(n),d=i&&("function"==typeof r?(p=new r,e=>p.encode(e)):async e=>new Uint8Array(await new a(e).arrayBuffer()));var p;const h=c&&u&&Va((()=>{let e=!1;const t=new a(da.origin,{body:new n,method:"POST",get duplex(){return e=!0,"half"}}),r=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!r})),g=l&&u&&Va((()=>Ms.isReadableStream(new o("").body))),f={stream:g&&(e=>e.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!f[e]&&(f[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new Hs(`Response type '${e}' is not supported`,Hs.ERR_NOT_SUPPORT,n)})}));const m=async(e,t)=>{const n=Ms.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(Ms.isBlob(e))return e.size;if(Ms.isSpecCompliantForm(e)){const t=new a(da.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Ms.isArrayBufferView(e)||Ms.isArrayBuffer(e)?e.byteLength:(Ms.isURLSearchParams(e)&&(e+=""),Ms.isString(e)?(await d(e)).byteLength:void 0)})(t):n};return async e=>{let{url:t,method:n,data:i,signal:l,cancelToken:u,timeout:d,onDownloadProgress:p,onUploadProgress:y,responseType:E,headers:I,withCredentials:A="same-origin",fetchOptions:_,maxContentLength:C,maxBodyLength:S}=va(e);const T=Ms.isNumber(C)&&C>-1,N=Ms.isNumber(S)&&S>-1;let R=s||fetch;E=E?(E+"").toLowerCase():"text";let P=wa([l,u&&u.toAbortSignal()],d),D=null;const b=P&&P.unsubscribe&&(()=>{P.unsubscribe()});let O;try{if(T&&"string"==typeof t&&t.startsWith("data:")){const n=function(e){if(!e||"string"!=typeof e)return 0;if(!e.startsWith("data:"))return 0;const t=e.indexOf(",");if(t<0)return 0;const n=e.slice(5,t),r=e.slice(t+1);if(/;base64/i.test(n)){let e=r.length;const t=r.length;for(let n=0;n<t;n++)if(37===r.charCodeAt(n)&&n+2<t){const t=r.charCodeAt(n+1),s=r.charCodeAt(n+2);(t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102)&&(s>=48&&s<=57||s>=65&&s<=70||s>=97&&s<=102)&&(e-=2,n+=2)}let n=0,s=t-1;const a=e=>e>=2&&37===r.charCodeAt(e-2)&&51===r.charCodeAt(e-1)&&(68===r.charCodeAt(e)||100===r.charCodeAt(e));s>=0&&(61===r.charCodeAt(s)?(n++,s--):a(s)&&(n++,s-=3)),1===n&&s>=0&&(61===r.charCodeAt(s)||a(s))&&n++;const o=3*Math.floor(e/4)-(n||0);return o>0?o:0}if("undefined"!=typeof Buffer&&"function"==typeof Buffer.byteLength)return Buffer.byteLength(r,"utf8");let s=0;for(let e=0,t=r.length;e<t;e++){const n=r.charCodeAt(e);if(n<128)s+=1;else if(n<2048)s+=2;else if(n>=55296&&n<=56319&&e+1<t){const t=r.charCodeAt(e+1);t>=56320&&t<=57343?(s+=4,e++):s+=3}else s+=3}return s}(t);if(n>C)throw new Hs("maxContentLength size of "+C+" exceeded",Hs.ERR_BAD_RESPONSE,e,D)}if(N&&"get"!==n&&"head"!==n){const t=await m(I,i);if("number"==typeof t&&isFinite(t)&&t>S)throw new Hs("Request body larger than maxBodyLength limit",Hs.ERR_BAD_REQUEST,e,D)}if(y&&h&&"get"!==n&&"head"!==n&&0!==(O=await m(I,i))){let e,n=new a(t,{method:"POST",body:i,duplex:"half"});if(Ms.isFormData(i)&&(e=n.headers.get("content-type"))&&I.setContentType(e),n.body){const[e,t]=Sa(O,Ca(Ta(y)));i=Ua(n.body,65536,e,t)}}Ms.isString(A)||(A=A?"include":"omit");const s=c&&"credentials"in a.prototype;if(Ms.isFormData(i)){const e=I.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&I.delete("content-type")}I.set("User-Agent","axios/"+Fa,!1);const l={..._,signal:P,method:n.toUpperCase(),headers:I.normalize().toJSON(),body:i,duplex:"half",credentials:s?A:void 0};D=c&&new a(t,l);let u=await(c?R(D,_):R(t,l));if(T){const t=Ms.toFiniteNumber(u.headers.get("content-length"));if(null!=t&&t>C)throw new Hs("maxContentLength size of "+C+" exceeded",Hs.ERR_BAD_RESPONSE,e,D)}const d=g&&("stream"===E||"response"===E);if(g&&u.body&&(p||T||d&&b)){const t={};["status","statusText","headers"].forEach((e=>{t[e]=u[e]}));const n=Ms.toFiniteNumber(u.headers.get("content-length")),[r,s]=p&&Sa(n,Ca(Ta(p),!0))||[];let a=0;const i=t=>{if(T&&(a=t,a>C))throw new Hs("maxContentLength size of "+C+" exceeded",Hs.ERR_BAD_RESPONSE,e,D);r&&r(t)};u=new o(Ua(u.body,65536,i,(()=>{s&&s(),b&&b()})),t)}E=E||"text";let v=await f[Ms.findKey(f,E)||"text"](u,e);if(T&&!g&&!d){let t;if(null!=v&&("number"==typeof v.byteLength?t=v.byteLength:"number"==typeof v.size?t=v.size:"string"==typeof v&&(t="function"==typeof r?(new r).encode(v).byteLength:v.length)),"number"==typeof t&&t>C)throw new Hs("maxContentLength size of "+C+" exceeded",Hs.ERR_BAD_RESPONSE,e,D)}return!d&&b&&b(),await new Promise(((t,n)=>{Ia(t,n,{data:v,headers:Bs.from(u.headers),status:u.status,statusText:u.statusText,config:e,request:D})}))}catch(t){if(b&&b(),P&&P.aborted&&P.reason instanceof Hs){const n=P.reason;throw n.config=e,D&&(n.request=D),t!==n&&(n.cause=t),n}if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new Hs("Network Error",Hs.ERR_NETWORK,e,D,t&&t.response),{cause:t.cause||t});throw Hs.from(t,t&&t.code,e,D,t&&t.response)}}},$a=new Map,Ba=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,a=[r,s,n];let o,i,c=a.length,l=$a;for(;c--;)o=a[c],i=l.get(o),void 0===i&&l.set(o,i=c?new Map:ka(t)),l=i;return i},Ga=(Ba(),{http:null,xhr:xa,fetch:{get:Ba}});Ms.forEach(Ga,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}}));const Wa=e=>`- ${e}`,Ha=e=>Ms.isFunction(e)||null===e||!1===e;const qa={getAdapter:function(e,t){e=Ms.isArray(e)?e:[e];const{length:n}=e;let r,s;const a={};for(let o=0;o<n;o++){let n;if(r=e[o],s=r,!Ha(r)&&(s=Ga[(n=String(r)).toLowerCase()],void 0===s))throw new Hs(`Unknown adapter '${n}'`);if(s&&(Ms.isFunction(s)||(s=s.get(t))))break;a[n||"#"+o]=s}if(!s){const e=Object.entries(a).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));let t=n?e.length>1?"since :\n"+e.map(Wa).join("\n"):" "+Wa(e[0]):"as no adapter specified";throw new Hs("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return s},adapters:Ga};function za(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ea(null,e)}function Ya(e){za(e),e.headers=Bs.from(e.headers),e.data=ma.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return qa.getAdapter(e.adapter||fa.adapter,e)(e).then((function(t){za(e),e.response=t;try{t.data=ma.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=Bs.from(t.headers),t}),(function(t){if(!ya(t)&&(za(e),t&&t.response)){e.response=t.response;try{t.response.data=ma.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=Bs.from(t.response.headers)}return Promise.reject(t)}))}const Ka={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Ka[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Xa={};Ka.transitional=function(e,t,n){function r(e,t){return"[Axios v"+Fa+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,s,a)=>{if(!1===e)throw new Hs(r(s," has been removed"+(t?" in "+t:"")),Hs.ERR_DEPRECATED);return t&&!Xa[s]&&(Xa[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)}},Ka.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const Ja={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Hs("options must be an object",Hs.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const a=r[s],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 Hs("option "+a+" must be "+n,Hs.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Hs("Unknown option "+a,Hs.ERR_BAD_OPTION)}},validators:Ka},Qa=Ja.validators;class Za{constructor(e){this.defaults=e||{},this.interceptors={request:new ra,response:new ra}}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=(()=>{if(!t.stack)return"";const e=t.stack.indexOf("\n");return-1===e?"":t.stack.slice(e+1)})();try{if(e.stack){if(n){const t=n.indexOf("\n"),r=-1===t?-1:n.indexOf("\n",t+1),s=-1===r?"":n.slice(r+1);String(e.stack).endsWith(s)||(e.stack+="\n"+n)}}else e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=ba(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:s}=t;void 0!==n&&Ja.assertOptions(n,{silentJSONParsing:Qa.transitional(Qa.boolean),forcedJSONParsing:Qa.transitional(Qa.boolean),clarifyTimeoutError:Qa.transitional(Qa.boolean),legacyInterceptorReqResOrdering:Qa.transitional(Qa.boolean)},!1),null!=r&&(Ms.isFunction(r)?t.paramsSerializer={serialize:r}:Ja.assertOptions(r,{encode:Qa.function,serialize:Qa.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Ja.assertOptions(t,{baseUrl:Qa.spelling("baseURL"),withXsrfToken:Qa.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=s&&Ms.merge(s.common,s[t.method]);s&&Ms.forEach(["delete","get","head","post","put","patch","query","common"],(e=>{delete s[e]})),t.headers=Bs.concat(a,s);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||sa;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=[Ya.bind(this),void 0];for(e.unshift(...o),e.push(...c),u=e.length,l=Promise.resolve(t);d<u;)l=l.then(e[d++],e[d++]);return l}u=o.length;let p=t;for(;d<u;){const e=o[d++],t=o[d++];try{p=e(p)}catch(e){t.call(this,e);break}}try{l=Ya.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 na(Pa((e=ba(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}Ms.forEach(["delete","get","head","options"],(function(e){Za.prototype[e]=function(t,n){return this.request(ba(n||{},{method:e,url:t,data:(n||{}).data}))}})),Ms.forEach(["post","put","patch","query"],(function(e){function t(t){return function(n,r,s){return this.request(ba(s||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Za.prototype[e]=t(),"query"!==e&&(Za.prototype[e+"Form"]=t(!0))}));const eo=Za;class to{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 Ea(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 to((function(t){e=t})),cancel:e}}}const no=to;const ro={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(ro).forEach((([e,t])=>{ro[t]=e}));const so=ro;const ao=function e(t){const n=new eo(t),r=Br(eo.prototype.request,n);return Ms.extend(r,eo.prototype,n,{allOwnKeys:!0}),Ms.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(ba(t,n))},r}(fa);ao.Axios=eo,ao.CanceledError=Ea,ao.CancelToken=no,ao.isCancel=ya,ao.VERSION=Fa,ao.toFormData=Xs,ao.AxiosError=Hs,ao.Cancel=ao.CanceledError,ao.all=function(e){return Promise.all(e)},ao.spread=function(e){return function(t){return e.apply(null,t)}},ao.isAxiosError=function(e){return Ms.isObject(e)&&!0===e.isAxiosError},ao.mergeConfig=ba,ao.AxiosHeaders=Bs,ao.formToJSON=e=>pa(Ms.isHTMLForm(e)?new FormData(e):e),ao.getAdapter=qa.getAdapter,ao.HttpStatusCode=so,ao.default=ao;const oo=ao;function io(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 co=io((function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}}));var lo=function(e,t){return lo=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])},lo(e,t)};function uo(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}lo(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function po(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 ho(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 go(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 fo(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 mo(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 yo(e){return this instanceof yo?(this.v=e,this):new yo(e)}function Eo(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 yo?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 Io(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=go(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 Ao=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function _o(e){return"function"==typeof e}function Co(e){return _o(null==e?void 0:e.then)}var So=io((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 To(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var No=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=go(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(_o(c))try{c()}catch(e){s=e instanceof So?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var u=go(l),d=u.next();!d.done;d=u.next()){var p=d.value;try{Do(p)}catch(e){s=null!=s?s:[],e instanceof So?s=mo(mo([],fo(s)),fo(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 So(s)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)Do(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)&&To(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&To(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}(),Ro=No.EMPTY;function Po(e){return e instanceof No||e&&"closed"in e&&_o(e.remove)&&_o(e.add)&&_o(e.unsubscribe)}function Do(e){_o(e)?e():e.unsubscribe()}var bo={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Oo={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var s=Oo.delegate;return(null==s?void 0:s.setTimeout)?s.setTimeout.apply(s,mo([e,t],fo(n))):setTimeout.apply(void 0,mo([e,t],fo(n)))},clearTimeout:function(e){var t=Oo.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function vo(e){Oo.setTimeout((function(){var t=bo.onUnhandledError;if(!t)throw e;t(e)}))}function xo(){}var wo=Mo("C",void 0,void 0);function Mo(e,t,n){return{kind:e,value:t,error:n}}var Lo=null;function Uo(e){if(bo.useDeprecatedSynchronousErrorHandling){var t=!Lo;if(t&&(Lo={errorThrown:!1,error:null}),e(),t){var n=Lo,r=n.errorThrown,s=n.error;if(Lo=null,r)throw s}}else e()}var Fo=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,Po(t)&&t.add(n)):n.destination=Wo,n}return uo(t,e),t.create=function(e,t,n){return new $o(e,t,n)},t.prototype.next=function(e){this.isStopped?Go(function(e){return Mo("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?Go(Mo("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?Go(wo,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}(No),jo=Function.prototype.bind;function Vo(e,t){return jo.call(e,t)}var ko=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){Bo(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){Bo(e)}else Bo(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){Bo(e)}},e}(),$o=function(e){function t(t,n,r){var s,a,o=e.call(this)||this;_o(t)||!t?s={next:null!=t?t:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:o&&bo.useDeprecatedNextContext?((a=Object.create(t)).unsubscribe=function(){return o.unsubscribe()},s={next:t.next&&Vo(t.next,a),error:t.error&&Vo(t.error,a),complete:t.complete&&Vo(t.complete,a)}):s=t;return o.destination=new ko(s),o}return uo(t,e),t}(Fo);function Bo(e){var t;bo.useDeprecatedSynchronousErrorHandling?(t=e,bo.useDeprecatedSynchronousErrorHandling&&Lo&&(Lo.errorThrown=!0,Lo.error=t)):vo(e)}function Go(e,t){var n=bo.onStoppedNotification;n&&Oo.setTimeout((function(){return n(e,t)}))}var Wo={closed:!0,next:xo,error:function(e){throw e},complete:xo},Ho="function"==typeof Symbol&&Symbol.observable||"@@observable";function qo(e){return e}function zo(e){return 0===e.length?qo:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var Yo=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 Fo||function(e){return e&&_o(e.next)&&_o(e.error)&&_o(e.complete)}(r)&&Po(r)?e:new $o(e,t,n);return Uo((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=Ko(t))((function(t,r){var s=new $o({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[Ho]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return zo(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=Ko(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 Ko(e){var t;return null!==(t=null!=e?e:bo.Promise)&&void 0!==t?t:Promise}function Xo(e){return _o(e[Ho])}function Jo(e){return Symbol.asyncIterator&&_o(null==e?void 0:e[Symbol.asyncIterator])}function Qo(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 Zo="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function ei(e){return _o(null==e?void 0:e[Zo])}function ti(e){return Eo(this,arguments,(function(){var t,n,r;return ho(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,yo(t.read())];case 3:return n=s.sent(),r=n.value,n.done?[4,yo(void 0)]:[3,5];case 4:return[2,s.sent()];case 5:return[4,yo(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 ni(e){return _o(null==e?void 0:e.getReader)}function ri(e){if(e instanceof Yo)return e;if(null!=e){if(Xo(e))return s=e,new Yo((function(e){var t=s[Ho]();if(_o(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(Ao(e))return r=e,new Yo((function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()}));if(Co(e))return n=e,new Yo((function(e){n.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,vo)}));if(Jo(e))return si(e);if(ei(e))return t=e,new Yo((function(e){var n,r;try{for(var s=go(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(ni(e))return si(ti(e))}var t,n,r,s;throw Qo(e)}function si(e){return new Yo((function(t){(function(e,t){var n,r,s,a;return po(this,void 0,void 0,(function(){var o,i;return ho(this,(function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=Io(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 ai(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 oi(e){return function(t){if(function(e){return _o(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 ii(e,t,n,r,s){return new ci(e,t,n,r,s)}var ci=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 uo(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}(Fo);function li(e,t){return void 0===t&&(t=0),oi((function(n,r){n.subscribe(ii(r,(function(n){return ai(r,e,(function(){return r.next(n)}),t)}),(function(){return ai(r,e,(function(){return r.complete()}),t)}),(function(n){return ai(r,e,(function(){return r.error(n)}),t)})))}))}function ui(e,t){return void 0===t&&(t=0),oi((function(n,r){r.add(e.schedule((function(){return n.subscribe(r)}),t))}))}function di(e,t){if(!e)throw new Error("Iterable cannot be null");return new Yo((function(n){ai(n,t,(function(){var r=e[Symbol.asyncIterator]();ai(n,t,(function(){r.next().then((function(e){e.done?n.complete():n.next(e.value)}))}),0,!0)}))}))}function pi(e,t){if(null!=e){if(Xo(e))return function(e,t){return ri(e).pipe(ui(t),li(t))}(e,t);if(Ao(e))return function(e,t){return new Yo((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(Co(e))return function(e,t){return ri(e).pipe(ui(t),li(t))}(e,t);if(Jo(e))return di(e,t);if(ei(e))return function(e,t){return new Yo((function(n){var r;return ai(n,t,(function(){r=e[Zo](),ai(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 _o(null==r?void 0:r.return)&&r.return()}}))}(e,t);if(ni(e))return function(e,t){return di(ti(e),t)}(e,t)}throw Qo(e)}function hi(e,t){return t?pi(e,t):ri(e)}function gi(e,t,n){var r=_o(e)||t||n?{next:e,error:t,complete:n}:e;return r?oi((function(e,t){var n;null===(n=r.subscribe)||void 0===n||n.call(r);var s=!0;e.subscribe(ii(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)})))})):qo}const fi=class{constructor(e,t,n,r){this.eventType=e,this.callback=n,this.contextName=r,this.id=t}};const mi=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 fi(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 yi=class{static subscribe(e,t,n,r=!1,s="app"){mi.subscribe(e,n,t,s,r)}static subscribeOnce(e,t,n){this.subscribe(e,t,n,!0)}static publish(e,t){mi.publish(e,t)}static unsubscribe(e,t,n="app"){mi.unsubscribe(e,t,n)}static unsubscribeAllWithEventType(e){mi.unsubscribeAllWithEventType(e)}static cleanContextSubscribers(e){mi.clearContext(e)}};class Ei{constructor(e,t=!0){this.config=e,t?(this.ssKeyConfig=e,this.reloadConfig()):this.updateConfig(e,!1)}static init(e,t=!0){return new Ei(e,t)}updateConfig(e,t=!0){t?window.sessionStorage.setItem(this.ssKeyConfig,JSON.stringify(this.config)):Ki(e)}reloadConfig(e=!0){if(e){const e=window.sessionStorage.getItem(this.ssKeyConfig);this.config=e?JSON.parse(e):null}else this.config=Xi()}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:Cp.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"),Bi(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?zi({pzCTkn:e?.csrf}):(Yi({tokenInfo:e}),zi({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 Ii=Ei,Ai=async()=>new Promise((async(e,t)=>{const n=Ji();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 Bi(a,{method:"POST",headers:new Headers(l),credentials:c?"include":"omit",body:u.toString(),withoutDefaultHeaders:!0}),zi({Authorization:null}),Yi({tokenInfo:null}),e()})),_i=async e=>{const t={};if("OAuth2.0"===e?.authType){const n=new Ii(e,!1);t.reauthUrl=await n.buildAuthorizeUrl(),t.redirectOrigin=n.getRedirectUriOrigin(),window.addEventListener("message",n.authMessageHandler,!1)}else t.reauthUrl=I()+(E()?`${E()}`:"/?reAuth=true");return t},Ci=(e,t)=>{_i(t).then((t=>{const n={openReauthMessageModal:!0,reAuthenticationURL:t.reauthUrl,url:e,redirectOrigin:t.redirectOrigin};yi.publish(F.PUB_SUB_EVENTS.EVENT_REAUTH,n)}))},Si=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};Yi({tokenInfo:{...e.tokenInfo,...r}}),e.secureCookie?zi({pzCTkn:n?.csrf}):zi({Authorization:`${n?.token_type} ${n?.access_token}`});const{onTokenRetrieval:s}=e;s&&"function"==typeof s&&s(n)},failure:t=>{if(e.popupReauth)return Ci(t,e);yi.publish(F.PUB_SUB_EVENTS.EVENT_FULL_REAUTH,e)}}}else t=`${I()}/updateSession`,n={method:"GET",headers:{}},r={failure:Ci};return{url:t,config:n,callback:r,isRefreshTokenPresent:s}},Ti=(e,t)=>"OAuth2.0"===t?.authType?e?.includes(t.endPoints.token):e?.includes("updateSession"),Ni=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}},Ri=(e,t,n)=>{const{config:r}=e,{url:s,config:a,callback:o,isRefreshTokenPresent:i}=Si(n),c=r.headers&&r.headers.context;r.data&&(r.body=r.data);const l=Gi(r.url,r,c,t);return i?Bi(s,a).then((e=>new Promise(((n,s)=>{setTimeout((()=>{t.setUpdateSessionStatus(!1),t.latestUpdateSessionTimeStamp=Date.now(),o?.success?.(e,r),yi.publish("updateSession",{updateStatus:"success"}),yi.publish("OnUpdateSession",{}),l.then((e=>{n(e)})).catch((e=>{s(e)}))}),0)})))).catch((e=>e&&e.config&&Ti(e.config.url,n)?(o?.failure?.(r.url,n),l):Promise.reject(e))):(o?.failure?.(r.url,n),l)},Pi=(e,t,n,r)=>{if(e.config&&Ti(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(yi.unsubscribeAllWithEventType(wi),t.setUpdateSessionStatus(!0),"custom"===n?.authType){yi.publish(F.PUB_SUB_EVENTS.EVENT_CUSTOM_REAUTH);const{url:n,config:r,context:s}=Ni(e);return Gi(n,r,s,t)}return Ri(e,t,n)}if(e.response&&e.response.status&&401===e.response.status&&!e.config.isExternalUrl&&t.getUpdateSessionStatus()){const{url:t,config:n,context:r}=Ni(e);return Bi(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)));let n=e.config.headers.context;return n&&n.includes("/workarea")&&!n.includes("/modal")&&(n=n.substring(0,n.lastIndexOf("/workarea"))),Jn({messages:t,category:"HTTP",context:n}),Promise.reject(e)}return Promise.reject(e)};const Di=class{constructor(){this.updateSessionInProgress=!1,this.latestUpdateSessionTimeStamp=Date.now()}getUpdateSessionStatus=()=>this.updateSessionInProgress;setUpdateSessionStatus=e=>{this.updateSessionInProgress=e}};const bi=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 Oi=new class{constructor(){this.xray=!1,this.onXRayCallback=null,this.xrayRuntime=new bi(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 vi=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]:Oi.getDebugLevels()}}getCoreHeadersFromContext(e){if(["root","app"].includes(e)||!e)return;const t=Vh.getProperty(j.COREHEADERS,"",e);return t?{...t,debugInfo:Oi.getPreviewMode()&&{...t.debugInfo,[j.COREHEADER_APP_DEBUG_LEVELS]:Oi.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)}},xi=vi;const wi="updateSession",Mi={},Li=new Di,Ui=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&&(yi.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((()=>{yi.publish(F.PUB_SUB_EVENTS.TIMEOUT_REMINDER,{timeRemaining:this.expiryBuffer}),clearTimeout(t),yi.subscribe(F.PUB_SUB_EVENTS.RESET_TIMER,this.resetInactiveTimeout,"resetCallback"),this.timeoutWarned=!0}),1e3*(e-this.expiryBuffer));return this.setTimerID(t),t}};let Fi={},ji={},Vi={},ki="";const $i=e=>{Fi=e},Bi=(e,t,n="root",r={})=>{const{doNotMergeHttpMessagesForStatusCode:s=null,cancelContext:a=n,includeRemoteSystemIdIfPresent:o=!0}=r;ki=s,null===e&&window.console.error("Error: url passed to Service Broker fetch is null (or) undefined");const{body:i,signal:c,withoutDefaultHeaders:l=!1,...u}=t,{Authorization:d,pzCTkn:p,...h}=t.headers||{};l||xi.injectCoreAdditionalHeaders(h,t.body,n,{includeRemoteSystemIdIfPresent:o}),a&&Mi[a]>=0?Mi[a]+=1:a&&void 0===Mi[a]&&(Mi[a]=1);let g=l?{...h}:{...xi.getDefaultHeaders(),...xi.getRegisteredHeaders(),...h,context:n};if(u.isExternalUrl=(e=>!e?.startsWith(I()||""))(e||""),u.fetchTimeStamp=Date.now(),e&&Ti(e,ji)&&Li.getUpdateSessionStatus()||!Li.getUpdateSessionStatus()||u.isExternalUrl){Ti(e,ji)&&"OAuth2.0"===ji?.authType&&(g={...h});const{restApi:t}=Cp.doesRestApiExist("Logout")&&Cp.getRestEndPoint("Logout")||{restApi:null};return(!t||e&&!e.endsWith(t))&&Ui.setTimerID(Ui.resetInactiveTimeout(Ui.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 co)}})}))}(hi(oo({context:n,...u,url:e,data:i,...c&&void 0===c.aborted&&{cancelToken:c},...c&&void 0!==c.aborted&&{signal:c},headers:g,withCredentials:(f=ji,!("OAuth2.0"!==f?.authType||!f.secureCookie)||!("custom"!==f?.authType||!f.customCookies)||void 0)})).pipe(gi((()=>{const e=xi.getCoreHeadersFromContext(g.context);e&&(e=>{yi.publish(j.PUB_SUB_EVENTS.FETCH_SUCCESS,e)})({...e})}))))}var f;return Gi(e,t,n,Li)},Gi=(e,t,n,r)=>new Promise(((s,a)=>{yi.subscribe(wi,(o=>{r.setUpdateSessionStatus(!o.updateStatus),"success"===o.updateStatus?Bi(e,t,n).then((e=>s(e))).catch((e=>a(e))):a(o.updateStatus.error)}),wi)})),Wi=e=>{Mi[e]>0&&(Mi[e]-=1,0===Mi[e]&&delete Mi[e])};oo.interceptors.request.use((e=>(Fi.request&&(e=Fi.request(e)),e)),(e=>Promise.reject(e))),oo.interceptors.response.use((e=>{if(202===e.status&&e.config.headers.context&&e.data?.caseInfo?.errorMessage){const t=[{type:"error",message:e.data.caseInfo.errorMessage}];let n=e.config.headers.context;return n&&n.includes("/workarea")&&(n=n.substring(0,n.lastIndexOf("/workarea"))),Jn({messages:t,category:"HTTP",context:n}),Promise.reject(e)}return e.config.headers&&e.config.headers.context&&(e.config.skipClearErrorMessages||(Kn({type:"error",category:"HTTP",context:e.config.headers.context}).length>0&&Xn({type:"error",category:"HTTP",context:e.config.headers.context}),Kn({type:"error",category:e.config.headers.context===j.APP.APP?"PAGE":"",context:e.config.headers.context}).length>0&&Xn({type:"error",category:"PAGE",context:e.config.headers.context})),Wi(e.config.headers.context)),Fi.response&&(e=Fi.response(e)),e}),(e=>(e.config&&e.config.headers&&e.config.headers.context&&Wi(e.config.headers.context),!e.response||!e.response.status||401!==e.response.status||e.config.isExternalUrl||e.config&&Ti(e.config.url,ji)||yi.subscribe(wi,(e=>{Li.setUpdateSessionStatus(!e.updateStatus)}),wi),Pi(e,Li,ji,e.response&&e.response.status&&e.response.status===Number(ki)?ki:null))));const Hi=()=>oo.CancelToken.source(),qi=e=>oo.isCancel(e),zi=e=>{xi.setDefaultHeaders(e)},Yi=e=>{ji={...ji,...e}},Ki=e=>{Vi={...Vi,...e}},Xi=()=>({...Vi}),Ji=()=>({...ji});const Qi=class{static createCase(e,t){const{caseInfo:n,startingFields:r,flowType:s,viewType:a=jc.PAGE,pageName:o,context:i=j.APP.APP,debugInfo:c,headers:l}=t;let u={};n&&n.content&&(u=n.content);const d={caseTypeID:e,content:{...u,...r},processID:s};return ec("createWork",{body:d,queryPayload:{caseClassName:e,viewType:a,params:{pageName:o}},headers:{...l,...c&&{...xi.addDebugHeaders(c)}}},i).then((t=>({response:t.data,requestPayload:d,headers:kc(t.headers,e,l)})))}},Zi=()=>({registerHeader:(...e)=>xi.registerHeader(...e),unRegisterHeader:(...e)=>xi.unRegisterHeader(...e),getRegisteredHeaders:()=>xi.getRegisteredHeaders()}),ec=(e,{body:t={},queryPayload:n={},cancelTokenSource:r,headers:s={},responseType:a},o,i)=>{const{restApi:c,reqType:l}=Vg(e,n),u={method:l,headers:s,body:t,...a&&{responseType:a}};return r&&(u.signal=r.token),Bi(c,u,o,i??{})},tc=(e,{method:t="GET",body:n={},headers:r={},withoutDefaultHeaders:s=!1},a)=>{e.startsWith("http:")||e.startsWith("https:")||(e=I()+e);return Bi(e,{method:t,headers:r,body:n,withoutDefaultHeaders:s},a)},nc=e=>Cp.doesRestApiExist(e),rc=()=>Hi(),sc=e=>qi(e),ac=e=>{$i(e)},oc=()=>Qi;const ic=new class{#e;constructor(){this.userSettings={},this.componentCache={},this.contextMapToClearOnCancel={},this.#e=!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?Lh.isValidJson(t):void 0;return n||t};removeComponentState=e=>{sessionStorage.removeItem(this.getNormalizedKey(e))};fetchUserSettings=async()=>{if(nc("getUserSettings")){const{restApi:e,reqType:t}=Vg("getUserSettings");Bi(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=()=>{Sp.getUserSettings()?this.userSettings=Sp.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 Lh.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(!nc("updateUserSettings"))return Promise.resolve("updateUserSettings route is not available");n=Vg("updateUserSettings");const{restApi:r,reqType:s}=n;return Bi(r,{method:s,body:Lh.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.#e){this.#e=!0;const e=e=>{const{context:t}=e||{};(this.contextMapToClearOnCancel[t]||new Set).forEach((e=>{this.resetComponentCache(e)})),delete this.contextMapToClearOnCancel[t]};yi.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))}};class cc{constructor(e){cc._instance=this,this.context=`${e}/${j.SUGGESTION}`,yh()?.getState().data?.[this.context]||Eh({type:Fe,payload:{context:this.context,data:{}}})}getField(e){return Ch(e,"",this.context)}setField(e,t){Eh({type:Q,payload:{reference:e,value:t,context:this.context}})}removeField(e){Eh({type:me,payload:{reference:e,context:this.context}})}setState(e){Eh(Hh({context:this.context,data:e,isArrayDeepMerge:!0}))}}const lc=cc;const uc=class{static getSharedState(e){const t=e.startsWith(".")?e.substring(1):e,n=Ah();return n?Lh.getIn(n,t):null}static setSharedState(e,t){e&&Eh(Tg({key:e,value:t}))}static updateState(e,t,n,r={}){const{isArrayDeepMerge:s=!0,pageReference:a,skipDirtyValidation:o=!1}=r;if(!e||!t)return;Eh(Ng({context:e,reference:a?`${a}.${t}`:t,value:n,isArrayDeepMerge:s,skipDirtyValidation:o}))}static getSuggestionsContext(e){return new lc(e)}};class dc{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 pc=dc,hc=e=>{yi.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_SUBMISSION,e)},gc={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}`},fc=(e,t)=>{const{vcName:n,containerName:r}=t;return r||n||pc.getTargetViewContainerName(e)},mc=e=>{const t=e.lastIndexOf(j.FORWARD_SLASH_STRING)+1,n=e.lastIndexOf(j.UNDERSCORE_STRING);return e.substring(t,n)},yc=e=>e===hd.WORKAREA,Ec=e=>e===hd.MODAL,Ic=e=>e===Ie,Ac=e=>e&&e.find((e=>e.type===Ie)),_c=e=>Lh.getIn(e,gc.CASE_INFO,{}),Cc=e=>e?e.split(" ").pop():void 0,Sc=e=>Lh.getIn(e,gc.CASE_CLASS_NAME,j.EMPTY_STRING),Tc=e=>{const t=_c(e);return rn(t)&&sn(Sp.getOperatorIdentifier(),t)},Nc=e=>Lh.getIn(e,gc.CASE_INFO_ID,j.EMPTY_STRING),Rc=e=>Lh.getIn(e,gc.CASE_FIRST_ASSIGNMENT_ID,j.EMPTY_STRING),Pc=(e,t)=>{const{removeActionPayload:n,target:r}=t;if(n&&n.containerItemID){const{containerItemID:t,context:s}=n;e.push(Eg(dg,{containerItemID:t,context:s||bd(t),target:r}))}},Dc=e=>{const t=yh();if(!e)return!1;const n=W(e),r=Wd(n),s=Wd(e);if(!r||!s)return!1;const a=md(r,n),o=md(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},bc=(e,t,n={})=>{const{skipFlowNameUpdate:r}=n,s=Nc(t);Lh.setIn(e,"key",s);const a=rn(_c(t));if(!r&&(e=>{const t=Lh.getIn(e,gc.ASSIGNMENTS,[]);return t&&t.length>0})(t)){const n=Rc(t),[,r]=n.split("!");(e=>{yi.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.CURRENT_ASSIGNMENT_UPDATED,e)})({assignmentID:n,isInCreateStage:a}),Lh.setIn(e,"flowName",r)}},Oc=(e,t)=>{const{attachmentsExist:n}=t;n&&Lh.setIn(e,F.SUMMARY_OF_ATTACHMENTS_LAST_REFRESH_TIME,(new Date).toLocaleString()),Lh.setIn(e,F.SUMMARY_OF_ASSIGNMENT_LAST_SUBMIT_TIME,(new Date).toLocaleString())},vc=(e,t,n)=>{let r=j.PROMISE_VALUE.RESOLVE;return Ac(e)?(r=j.PROMISE_VALUE.REJECT,n?pn.rejectActionByID(t,!0,n):pn.rejectActionByID(t)):pn.resolveActionByID(t),r},xc=e=>{const t=Sp.getCaseTypeList();return"true"===t.filter((t=>t.pyWorkTypeImplementationClassName===e))?.[0]?.pyIsTraditionalUICase},wc=()=>"true"===Sp?.environmentInfoObject?.pxMashupDetails?.pyLaunchCaseInModal,Mc=(e,t)=>{const n=Sc(e?.response),r=_c(e?.response),{caseTypeID:s}=r,a=Sp.getFeatureMap();(a?.deferUpdateCaseSummaryView??!Object.hasOwn(a,j.DEFER_UPDATE_CASESUMMARY_VIEW))&&s&&((e,t,n,r)=>{const{containerItemID:s}=t;if(s){const{caseClassName:a,skipAssignmentsUpdate:o}=r,i=W(s),c=Wd(i),l=c&&fd(c),u=c&&Rd(c),d=Y(i),p=n?.data?.caseInfo?.ID;u&&l?.items?.[u]?.key===t?.caseID&&e.push(Eg(zh,{containerItemID:i,context:i,container:d,containerName:d,caseId:p,viewName:F.CASESUMMARY_VIEW_NAME,updateData:!0,viewLoadingContainer:{context:i},caseClassName:a,...void 0!==o&&{skipAssignmentsUpdate:o}}))}})(t,e?.actionInPayload,e?.response,{caseClassName:n,skipAssignmentsUpdate:!0})},Lc=e=>Ih(e)?.context_data?.caseViewMode;const Uc=class{static isCaseActive(e,t){if(!e||!t)return!1;const n=fd(t);if(n){const r=Rd(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}=Vg("loadView",n);return Bi(r,{method:s},t)};static getCaseEditLock=(e,t)=>{const n={caseID:e,actionID:"pyUpdateCaseDetails"},{restApi:r,reqType:s}=Vg(Ye,n);return Bi(`${r}?viewType=page`,{method:s},t)};static updateCaseEditFieldsData=(e,t,n,r)=>{const s={caseID:e,actionID:"pyUpdateCaseDetails"},{restApi:a}=Vg(Ye,s),o=t[e];return Bi(`${a}?viewType=form`,{method:"PATCH",body:{content:{...o}},headers:{"if-match":n}},r)};static getCaseMessages=e=>Ih(e)?.caseMessages;static getPropertiesToReplace=e=>(Il(e)||[]).map((e=>({path:e.fullPath,allowMultiple:e.allowMultiple})));static getUniqueGadgetId=()=>Lh.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:Fc}=F,jc={PAGE:"page",FORM:"form"},Vc={[Fc.CASE]:[We,Be,Ge],[Fc.PAGE]:[je,ke],[Fc.DATA]:[Ve],ASSIGNMENT:[Je]},kc=(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},$c=(e,t={})=>{const{onlyChangedData:n=!1,nonEmptyAndChangedData:r=!1,skipUUID:s=!0,isTransientContext:a=!1,includeDisabledFields:o=!1}=t;let i={};i=Al(e,{isTransientContext:a,includeDisabledFields:o}),n&&(delete i?.caseInfo?.content,a&&(i={}));const c=Ml(e,!1);!a&&r&&((e,t)=>{Object.entries(e?.caseInfo?.content).forEach((([n,r])=>{const s=Ih(t),a=b()(s,F.CASE_INFO.CASE_INFO_CLASSID),o=Hp(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=[...Ir(e)];s&&p.forEach((e=>{delete e.content?.EmbedListUUID__})),u.pageInstructions=p;return(hr[e]||[]).forEach((e=>{if(u?.content){const t=e?.replace(j.CASE_INFO.CASE_INFO_CONTENT,"");Lh.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}},Bc=(e,t)=>{let n,r,s={};const a=Lh.getIn(e,j.UI_RESOURCES),o=Lh.getIn(e,"confirmationNote");a?(n=Lh.getIn(e,j.UI_RESOURCES_CONTEXT_DATA),r=Lh.getIn(e,j.ROOT),s=Lh.getIn(e,j.ACTION_BUTTONS)):o&&(r={});const{data:i={},Errors:c,semanticURL:l,key:u,flowName:d}=e,p=Lh.getIn(e,"nextAssignmentInfo",null),h=Lh.getIn(e,"nextAssignmentInfo.context",""),g=Lh.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}},Gc=async(e,t,n,r=!1,s=!1)=>{const a=Lh.getIn(e,j.LOCALE_REFERENCES);await Rp.loadLocaleResources(a);const o=Lh.getIn(e,j.COMPONENTS);if(o)try{await $r(o)}catch(e){console.error(e)}const i={actionConfig:t,...n};r?qg({...e,options:i,directUrlUpdation:!0}):Ur(e,i,s)},Wc=(e="")=>{const t=e.indexOf(" "),n=e.indexOf("!");return e.substring(t+1,n)},Hc=e=>{if(e){const[,t]=e.split("!");return{key:Wc(e),flowName:t}}return{}},qc=(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=Lh.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}},zc=e=>{const{payload:t}=e,{err:n,context:r,actionMgrID:s}=t,a=n&&n.response?n.response.data:"",o=Cl(r);return s&&pn.rejectActionByID(s,!0,n),Eg(Ig,"Error action triggered",a,r,o)},Yc=(e,t)=>Ld(e)&&Fd(e)?Eg(gg,t):Eg(Zh,t),Kc=(e,t,n=j.APP.APP,r={})=>{let s=null;const{buildNew:a=!0}=r;return Ld(e)?s=Fd(e)?Rd(e):H(t,n):Ud(e)&&(Fd(e)&&!a?s=Od(e):Fd(e)&&!a||(s=H(t,n))),s},Xc=e=>e&&e.type===Ce,Jc=e=>{let t=!1;const n=wd(e);for(let e=0;e<n.length;e+=1){const r=n[e];if(r&&Vl(r)){t=!0;break}}return t},Qc=(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(Ld(e)){const t=Rd(e);if(!t)return{continueExecution:a,removeActionPayload:s};const r=bd(t);Vl(r)&&(n=!0),u||n||(n=Jc(t))}else if(Ud(e)&&kd(e)){let t=Gd(e);t||(t=Rd(e),r=!0),s.containerItemID=t,s.context=bd(t)}if(n){const e=l||xl;o=window.confirm(Rp.getLocaleValue(e,"Messages"))}if(!o&&n&&(s={},a=!1),r){const e=Rp.getLocaleValue(wl,"Messages");c?i=window.confirm(e):(window.alert(e),a=!1)}return!i&&r&&(s={},a=!1),{continueExecution:a,removeActionPayload:s}},Zc=(e,t)=>{let n=!1;const r=Sp.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=_d(e,c);let u={},d=!1;if(l&&!r&&((e,t)=>{const n=md(e,t);return n?.resourceType})(e,l)===t?.type&&(n=!0,u=md(e,l),!o)){let e=u?.flowName;const t=mc(l),r=vd(l);if(r.length){const n=yt(t,r[0]);e=md(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}}},el=(e,t,n)=>e===Fc.PAGE?((e,t={})=>{let n=!1;const{semanticURL:r}=t,s=_d(e,r);return s&&(n=!0),{activate:n,activateContainerActionPayload:{target:e,containerItemID:s,semanticURL:r}}})(t,n):e===Fc.ASSIGNMENT?Zc(t,{...n,type:e}):e===Fc.CASE?Zc(t,{...n,skipFlowNameCheck:!0,type:e}):{},tl=(e=[])=>{Fd(`${j.APP.APP}/${j.PREVIEW}`)&&e.push(Eg(Qh,$d({context:F.APP.APP,name:j.PREVIEW})))},nl=e=>{let t;for(const n of Object.keys(Vc))if(Vc[n].includes(e)){t=n;break}return t},rl=(e,t)=>{const{data:n={},context:r,caseViewMode:s}=e,a={data:{...n},caseViewMode:s,context:W(r)};Lh.deleteIn(a.data,"shared"),Lh.setIn(a.data,["context_data","caseViewMode"],s),t.push({type:at,payload:{context:a.context}}),t.push(Eg(Hh,a))},sl=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=Lh.getIn(t,["payload","assignmentContext"]);if("other"===n||"remote"===n){const r=Lh.getIn(t,["payload","nextAssignmentInfo","ID"]);if(t?.payload?.isProcessAction){const n={acName:Lh.getIn(t,["payload","target"]),caseID:t.payload.data.caseInfo.ID,containerItemID:Lh.getIn(t,["payload","context"]),context:Lh.getIn(t,["payload","context"])},r={type:he,payload:{...n}};e.push(r),e=e.filter((e=>delete e?.payload?.data?.caseMessages)),Eh(e),e=e.filter((e=>e.type!==he))}const s=((e,t,n)=>({assignmentID:e,vcName:j.PRIMARY,targetContainerName:Lh.getIn(t,["payload","target"]),context:Lh.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);Ld(s.targetContainerName)||t?.payload?.containerName!==j.WORKAREA||(s.isMultiDoc=!0,e=[]);const a={type:ge,payload:{...s}};e.push(a),Eh(e)}else Eh(e)}},al=(e,t)=>w()(e,t,(function(e,t){if(Array.isArray(e))return e.concat(t)})),ol=e=>{let t={},n=lp(e);for(;n;){const e=$c(n);t=al(e.content,t),n=lp(n)}return t};class il{static getChanges(e){return{...Ml(e)}}static getSubmitData(e,t){const{isTransientContext:n=!1,includeDisabledFields:r=!1}=t||{},{content:s}=$c(e,{isTransientContext:n,includeDisabledFields:r});return s}static isStateModified(e){return Vl(e)||br(e)||!(!e||!Ul(e))}static isFormValid(e,t){return _l(e,t)}static clearChangedProperties(e){return _r(e),Er(e),$l(e)}static getEditableFields(e){return Sl(e)}static setCustomValidator(e,t){Mr.register(e,t)}static isPropertyEditable(e,t){return il.getEditableFields(e).some((e=>e.name===t))}}const cl=il;const ll=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,!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=bn.getContextReferences(e)?.get(s),o=a&&Vh.resolveContextTreeNodeProps(a.props)||{},i=n[s];if(a&&!0!==o.readOnly){const e=i.buildSubmitPageInstructions(t);r.push(...e)}})),r}buildClientChangeList(e){const t=this.getStateMachinesByContext(e)||{};let n={};const r={};return Object.keys(t).forEach((e=>{const r=t[e].getChangeList();n={...n,...r}})),Lh.flatten(n,"",r),r}getStateMachinesByContext(e){return e?this.states?.[e]:void 0}clearStateMachines(e){this.states[e]={},this.unConnectedStates[e]={}}setStateMachineEmpty(e,t){const n=this.getStateMachine(e,t,""),r=bn.getFieldReferenceForProperty(e,t);if("Multiselect"===r?.props?.componentName&&n?.current?.instruction?.instruction===j.LIST_ACTIONS.DELETE_ALL)return;n.root=null,n.current=null;const s=this.getUnConnectedStateMachines(e)||{};Object.keys(s).forEach((e=>{e.includes(t)&&delete s[e]}))}removeStateMachine(e,t){delete this.states[e]?.[t]}createStateMachine(e,t){let n=e.substring(0,e.lastIndexOf("["));const r=n.substring(n.lastIndexOf("."));n=n.substring(0,n.lastIndexOf(".")),n&&r&&fr(t,r,n)}getStateMachineObjByPath(e,t,n,r=!1){const s=/\[\d+\]$/gm,a=e;let o;for(;e&&!this.isStateMachineExist(t,"",e);){if(o=null,n&&e.endsWith("]")){if(o=e.match(s),o=o?.[o.length-1]?.substring(1,o[o.length-1].length-1),[e]=e.split(s),!r&&!this.isStateMachineExist(t,"",e)){this.createStateMachine(a,t);break}break}e=e.substring(0,e.lastIndexOf("."))}return e?{stateMachineTarget:e,stateMachine:this.getStateMachine(t,"",e),index:o}:{}}executeStateMachine(e,t,n,r=!0,s={}){const{stateMachineTarget:a,index:o}=this.getStateMachineObjByPath(t,e,r);if(!a)return!1;let[,i]=t.split(a);if(!i)return!1;null!==o&&([,i]=i.split(/^\[\d+\]/gm));const c={[dl(i)]:n},l=this.getStateMachine(e,"",a);return null!==o?l?.update(c,Number(o)+1,s.skipStateUpdate??!0,s):l?.updatePage(Lh.unflatten(c)),!0}registerForServerChanges(){hh.registerForListChanges(((e,t,n)=>{setTimeout((()=>{const r="].";if(!t.includes(".classID")&&cl.isPropertyEditable(e,t)&&this.executeStateMachine(e,t,n),!t.includes(".classID")&&t.includes(r)){const s=t.substring(0,t.lastIndexOf("[")),a=cl.getEditableFields(e);if(["multiselect","checkbox"].includes(a.find((e=>e.name===s))?.type)){const a=bn.getContextReferences(e),o=a?.get(s),i=t.substring(t.lastIndexOf(r)+2);o?.props.selfReferencingDatapageKeys?.includes(i)&&this.executeStateMachine(e,t,n)}}}),0)}))}unRegisterForServerChanges(){hh.unRegisterForListChanges()}},ul={},dl=e=>e.startsWith(".")?e.substring(1):e,pl=e=>{delete ul[e]},hl=(e,t={})=>{const{includeDisabledFields:n=!1}=t,r=Vh.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},gl=(e,t,n,r,s)=>{let a=(Ch(`.attachmentsList.${t?.replace(".","")}`,"context_data",n)||[]).filter((e=>`${r.pageReference}.${e.label}`===s));return a=Lh.buildAttachmentsFormData(a),a.length>0&&(e=[...e,...a]),e},fl=(e,t,n,r,s)=>(ll.executeStateMachine(e,r,Vh.getLitePropertyValue(n,t))||s.push(r),s),ml=e=>{const t=e.pageReference?.replace(F.CASE_INFO.CASE_INFO_CONTENT,"")?.replace(F.DATA_INFO.DATA_INFO_CONTENT,"");return"Attachment"===e.componentName&&""!==t},yl=(e,t,n)=>{const r=t.isInsideList,{ignoreFieldsInsideList:s=!0}=n;return(!r||r&&!s)&&!Array.isArray(Vh.getLitePropertyValue(t,e))&&"Address"!==t.componentName},El=(e,t={})=>{let n=[],r=[];const s=[],a=bn.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=Vh.resolveContextTreeNodeProps(i.props),c=e.propertyName;if(hl(i.props,{includeDisabledFields:r})){const r=ml(e);"Attachment"!==e.componentName||r?!r&&yl(o,e,n)&&(s=fl(t,c,e,o,s)):a=gl(a,c,t,e,o)}}return{attachmentList:a,editableFormFieldsReferenceList:s}})(a,e,t)),ul[e])for(const t in ul[e].fieldOrder)Object.hasOwn(ul[e].fieldOrder,t)&&s.push(t);return{formInputs:n,attachments:r,formPageFields:s}},Il=e=>{let t=[];const n=bn.getContextReferences(e);if(n)for(const[e,r]of n){const n=r?.props;if(hl(n)&&"Attachment"===n?.componentName){const r="true"===n?.allowMultiple;t=[...t,{type:"File",allowMultiple:r,fullPath:e}]}}return t},Al=(e,t={})=>{const n={},r=Ih(e),{ignoreFieldsInsideList:s=!0,isTransientContext:a=!1,includeDisabledFields:o=!1}=t;if(a||r?.caseInfo?.content){const{formInputs:t,attachments:i,formPageFields:c}=El(e,{ignoreFieldsInsideList:s,includeDisabledFields:o});i&&i.length>0&&Lh.buildObject("caseInfo.attachments",n,i),((e,t,n)=>{e.forEach((e=>{let r=Lh.getIn(t,e);"object"==typeof r&&(r=Lh.deepClone(r),delete r?.classID),Lh.buildObject(e,n,r)}))})(c,r,n),t&&t.length>0?t.forEach((e=>{Lh.buildObject(e,n,Lh.getIn(r,e))})):a||Lh.buildObject(F.CASE_INFO.CASE_INFO_CONTENT,n,{})}if(!a&&r?.dataInfo?.content){const{formInputs:t}=El(e,{ignoreFieldsInsideList:s});t.forEach((e=>{Lh.buildObject(e,n,Lh.getIn(r,e))}))}return n},_l=(e,t)=>{const n=bn.getContextReferences(e);let r=!0;if(!n)return r;for(const[e,s]of n){const n=Vh.resolveContextTreeNodeProps(s.props);if(hl(s.props)&&(!t||e.includes(t))){const e=Mr.validate(n.componentName?.toLowerCase(),n.propertyName,Vh.getLitePropertyValue(n,n.propertyName),n);r&&(r=!e.message)}}return r},Cl=(e,t=!1)=>{const n=bn.getContextReferences(e),r=[];if(n)for(const[e,s]of n){if(!1!==Vh.resolveContextTreeNodeProps(s.props).visibility){const n=8,s=t?e:e.substring(e.indexOf("content")+n);r.push(s)}}return r},Sl=e=>{const t=[],n=bn.getContextReferences(e);if(n)for(const[e,r]of n){const n=Vh.resolveContextTreeNodeProps(r.props);hl(r.props)&&"Attachment"!==n.componentName&&"multirecordlist"!==n.type&&t.push({name:e,label:n.label,type:n.componentName?.toLowerCase()})}return t};const Tl=class{static getPropertyName(e){return nn.getPropertyName(e)}static isProperty(e){return nn.isProperty(e)}static getLeafPropertyName(e){return nn.getLeafPropertyName(e)}static isPropertyInternal(e){return e.startsWith("px")||e.startsWith("pz")}};const Nl=class{static isPageInstruction(e){return e&&e.includes("[")&&e.includes("]")}};class Rl{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=Lh.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 Rl.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 Rl.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 Pl=new Rl,{APP:Dl}=j;let bl={},Ol={},vl={};const xl="You will lose unsaved changes. Do you want to continue?",wl="You have reached maximum limit of pending changes. Please commit/cancel one or more changes to continue.",Ml=(e=Dl.APP,t,n)=>{let r=[],s=[];t||(r=Cl(e,!0)),n||(s=(e=>{const t=bn.getContextReferences(e),n=[];if(t)for(const[e,r]of t)!0===Vh.resolveContextTreeNodeProps(r.props).readOnly&&n.push(e);return n})(e));const a={};((e,t)=>{const n=Ol[t]||{};Object.keys(n).forEach((t=>{Object.hasOwn(n,t)&&Lh.buildObject(t,e,n[t].value)}))})(a,e);const o=bl[e]||{};return Object.keys(o).forEach((e=>{const n=!t&&r.includes(e)||t;Object.prototype.hasOwnProperty.call(o,e)&&n&&!s.includes(e)&&Lh.buildObject(e,a,o[e].value)})),a},Ll=e=>{const{context:t}=e,n=e.reference.startsWith(".")?e.reference.substr(1):e.reference;delete bl[t]?.[n],delete Ol[t]?.[n]},Ul=e=>vl[e],Fl=(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=Ch(t.reference,null,n):(e[a]={initialValue:r||Ch(t.reference,null,n)},e[a].previousValue=e[a].initialValue),e[a].value=t.value,s&&e[a].value===e[a].initialValue&&Ll(t)},jl=e=>{const{payload:t}=e,{context:n}=t,r=t.reference.startsWith(".")?t.reference.substr(1):t.reference;bn.isFieldExists(n,r)||(Ol[n]=Ol[n]||{},Fl(Ol[n],t)),bl[n]=bl[n]||{},Fl(bl[n],t)},Vl=e=>{const t=Ar(e)||{};return e&&bl[e]&&Object.keys(bl[e]).some((t=>bl[e][t].initialValue!==bl[e][t].value))||Object.keys(t).length>0},kl=(e,t)=>{if(!e||!t)return!1;const n=bl[e]&&bl[e][t];return!!n&&n.previousValue!==n.value},$l=e=>{e&&bl[e]?(bl[e]={},Ol[e]={}):"all"===e&&(bl={},Ol={},vl={}),vl[e]&&(vl[e]=!1)},Bl=(e,t,n=new Set)=>{if(n.has(t))return;n.add(t);[...Zt.getDependencies(e,t),...hh.getResetDependencies(e,t)].forEach((t=>{const r=Lh.getPropertyNameFromDependency(t);if("object"==typeof t&&"multiRecord"===t.mode){const t=r.split("."),n=`.${t.pop()}`,s=t.join(".");if(ll.isStateMachineExist(e,s,n)){ll.getStateMachine(e,s,n).deleteAll()}}else Nl.isPageInstruction(r)&&ll.executeStateMachine(e,r,""),Eh({type:Q,payload:{reference:r,value:"",context:e,isArrayDeepMerge:!0,isImplicit:!0}});Bl(e,r,n)}))},Gl=()=>e=>t=>{const{type:n,payload:r={}}=t||{};if(n===ee&&(Yt(r),(e=>{const{context:t,pageReference:n,value:r,reference:s}=e;hh.triggerCascade(t,s,r);const a=Zt.getDependencies(t,s),o={context:t,datapages:{}};Bl(t,s),a.forEach((r=>{let s=n;r.startsWith(n)||(s="");const a=r.replace(`${s}`,"").split(".").filter((e=>!!e));a.pop();const i=a.join("."),c=Ch(`.${i}`,s,t)?.classID||e.classID,l=Hp(r.split(".").pop(),c),{datasource:u}=l,d={};let p=[];u.parameters.forEach((e=>{e?.value?(d[e.name]=Tl.isProperty(e.value)?Ch(`.${Lh.getFullPropertyReference([i,Lh.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,Lh.getHashedString(p.join(j.HASH_DELIMITER)));const{name:h}=u,g=Zp(h);o.datapages[p]={mode:u.mode,propertyName:r,name:u.name,dataViewParameters:d,refreshStrategy:g?.refreshStrategy}})),a.length&&Eh({type:tt,payload:o})})(r),Qt.registerBlockingAction(r.context).catch((()=>{})),setTimeout((()=>{(kl(r.context,r.reference)||br(r.context))&&Vn(r),Pl.triggerRefreshForType("PROP_CHANGE",r.reference,r.context),Qt.deRegisterBlockingAction(r.context).catch((()=>{}))}),0)),n===st&&!r?.isDefault){const{context:e,referenceList:t}=r;Vn({context:e,pageReference:t})}if(n===Q||n===Z){const{reference:e,isImplicit:n,context:s,skipDirtyValidation:a=!1}=r;bn.updateFieldNodeValue(s,e,r.value),Nl.isPageInstruction(e)||a?a||(vl[`${s}`]=!0):jl(t),(r.removePropertyFromChangedList||n)&&Ll(r)}if(n===De||n===be){const{transientItemID:e,data:t}=r;Lh.iterateLeafNodes(t,(t=>{Ll({context:e,value:"",reference:t.join(".")})}))}if(n&&[xe,Se,Me,Pe].includes(n)){$l(r.context),hh.purgeResetDependencies(r.context),(e=>{e&&xn[e]&&delete xn[e]})(r.context);(r.childContainersContexts||[]).forEach((e=>{$l(e)}));(r.transientItems||[]).forEach((e=>{$l(e)}))}e(t)};const Wl=new class{getCoreheaders(e){const t=`${F.APP.APP}${j.FORWARD_SLASH_STRING}${j.PRIMARY}`,n=Rd(t),r=bd(n),s=Vh.getProperty(j.COREHEADERS,"",r);if(s&&e in s)return s[e]}};const Hl=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=bn.getContextReferences(e)?.get(`${t}${r}`)?.props;return s?Vh.resolveContextTreeNodeProps(s):s})(this.c11nEnv.getContextName(),this.c11nEnv.getPageReference(),t),{message:s}=Mr.validate(this.c11nEnv.getComponentName()?.toLowerCase(),t,e,r);return s?{status:!1,message:s}:{status:!0}}},ql="OPEN_PROCESS_ACTION",zl="OPEN_ASSIGNMENT",Yl="DELETE_CASE_IN_CREATE_STAGE",Kl="SAVE_AND_CLOSE",Xl=e=>({type:Kl,payload:e});const Jl=class{static getSavableDataPage(e){return oh(e)}static getLookUpDataPage(e){return ch(e)}static getLookUpDataPageInfo(e){return lh(e)}static getDataPageKeys(e){return ih(e)}};const Ql=class{constructor(e){this.c11nEnv=e}containerManagerPromise=e=>{const t=pn.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 pn.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 Eh(Jh(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=yt(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 Eh(Zh(h)),p}updateContainerItem(e){if(!e?.containerItemID)return Promise.reject(new Error("updateContainerItem : containerItemID is required in containerInfo object"));const t=xe,n={context:bd(e.containerItemID),target:Wd(e.containerItemID)},{actionMgrID:r,promise:s}=this.containerManagerPromise(t),a={...n,...e,actionMgrID:r};return Eh(ag(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 Eh(lg(a)),s}removeContainerItem(e){if(!e?.containerItemID)return Promise.reject(new Error("removeContainerItem : containerItemID is required in containerInfo object"));const t=Se,n={context:bd(e.containerItemID),target:Wd(e.containerItemID)},{actionMgrID:r,promise:s}=this.containerManagerPromise(t),a={...n,...e,actionMgrID:r};return Eh(dg(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=$d(e),{actionMgrID:r,promise:s}=this.containerManagerPromise(t),a={...n,...e,actionMgrID:r};return Eh(Qh(a)),s}addTransientItem(e){const{id:t,data:n}=e,r=this.c11nEnv.getContextName(),s=z(t,r),a=Kd(r);return s&&a.includes(s)||Eh(eg({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(!Kd(r).includes(t))return;Eh(tg({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(!Kd(t).includes(s))return;Eh(hg({target:n,containerItemID:r,transientItemID:s}))}}createContainerPConnect(e,t,n,r=!1){ud.createContainerPConnect(e,t,n,r)}hasContainerItems(){const e=this.c11nEnv.getContextName(),t=this.c11nEnv.getContainerName();return Fd(`${e}/${t}`)}isContainerInitialized(){const e=this.c11nEnv.getContextName(),t=this.c11nEnv.getContainerName();return Td(e,t)}};var Zl=function(e,t){return e===t||"function"==typeof t&&e===t.toString()};function eu(){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 Zl(t.type,e[0])}:function(t){for(var n=0;n<s;n++)if(Zl(t.type,e[n]))return!0;return!1},oi((function(e,t){var s=0;e.subscribe(ii(t,(function(e){return n.call(r,e,s++)&&t.next(e)})))}))}function tu(e,t){return oi((function(n,r){var s=null,a=0,o=!1,i=function(){return o&&!s&&r.complete()};n.subscribe(ii(r,(function(n){null==s||s.unsubscribe();var o=0,c=a++;ri(e(n,c)).subscribe(s=ii(r,(function(e){return r.next(t?t(n,e,c,o++):e)}),(function(){s=null,i()})))}),(function(){o=!0,i()})))}))}function nu(e,t){return oi((function(n,r){var s=0;n.subscribe(ii(r,(function(n){r.next(e.call(t,n,s++))})))}))}function ru(e,t,n){return void 0===n&&(n=1/0),_o(t)?ru((function(n,r){return nu((function(e,s){return t(n,e,r,s)}))(ri(e(n,r)))}),n):("number"==typeof t&&(n=t),oi((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;ri(n(e,u++)).subscribe(ii(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?ai(t,o,(function(){return g(e)})):g(e)};c.length&&l<r;)e();p()}catch(e){t.error(e)}})))};return e.subscribe(ii(t,h,(function(){d=!0,p()}))),function(){null==i||i()}}(t,r,e,n)})))}function su(e){return e&&_o(e.schedule)}function au(e){return e[e.length-1]}function ou(e){return su(au(e))?e.pop():void 0}function iu(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return hi(e,ou(e))}function cu(e){return oi((function(t,n){var r,s=null,a=!1;s=t.subscribe(ii(n,void 0,void 0,(function(o){r=ri(e(o,cu(e)(t))),s?(s.unsubscribe(),s=null,r.subscribe(n)):a=!0}))),a&&(s.unsubscribe(),s=null,r.subscribe(n))}))}var lu=new Yo((function(e){return e.complete()}));function uu(e){return e?function(e){return new Yo((function(t){return e.schedule((function(){return t.complete()}))}))}(e):lu}const du=(e,t,n)=>cu((r=>("ERR_CANCELED"!==r?.code&&console.error(e,r),iu(Ig(e,r,t,null,n))))),pu=(e,t)=>n=>new Yo((r=>{let s={},a=0;return n.pipe(ru((n=>{const r=Date.now();let o;return o=t||h(),o&&o(n,s)&&r-a<e?uu():(s=n,a=r,iu(n))}))).subscribe(r)})),hu=e=>{const{dataPageID:t,context:n,headers:r,containerItemID:s}=e,a={data_view_ID:t},{restApi:o,reqType:i}=Vg("createDataObject",a),{content:c}=$c(s);return hi(Bi(o,{method:i,headers:r,body:{data:c.content}},s)).pipe(nu((t=>({response:t.data,actionInPayload:e}))),du("Error occurred during ajax call at createDataObject Epic",n))},gu=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}=Vg("readDataObject",o);return hi(Bi(i,{method:c,headers:r,body:{dataViewParameters:a}},n)).pipe(nu((t=>({response:t.data,actionInPayload:e}))),du("Error occurred during ajax call at getDataObjectView Epic",n))},fu=e=>{const{dataPageID:t,context:n,headers:r,containerItemID:s,key:a}=e,o={data_view_ID:t},{restApi:i,reqType:c}=Vg("updateDataObject",o),{content:l}=$c(s);return hi(Bi(i,{method:c,headers:r,body:{data:{...l.content,...a},pageInstructions:l.pageInstructions||[]}},s)).pipe(nu((t=>({response:t.data,actionInPayload:e}))),du("Error occurred during ajax call at updateDataObject Epic",n))},mu=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}=Vg("openDataObjectAction",o);return hi(Bi(i,{method:c,headers:r,body:{dataViewParameters:a}},n)).pipe(nu((t=>({response:t.data,actionInPayload:e}))),du("Error occurred during ajax call at getDataObjectView Epic",n))},yu=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}=Vg("submitDataObjectAction",i),{content:u}=$c(o);return hi(Bi(c,{method:l,headers:r,body:{data:{...u?.content,...a},pageInstructions:u?.pageInstructions||[]}},n)).pipe(nu((t=>({response:t.data,actionInPayload:e}))),du("Error occurred during ajax call at getDataObjectView Epic",n))};const Eu=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;Mn(e,r,t,s,{})}}},Iu="postDataViewMetadata",Au={getData:(e,t,n,r)=>((e,t,n,r={})=>{const s={dataViewName:e},{skipClearErrorMessages:a,signal:o,doNotMergeMessagesForStatusCode:i}=r,{restApi:c,reqType:l}=Vg("getListData",s);return Bi(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}=Vg("getListDataCount",r);return Bi(s,{method:a,body:t},n)},getDataViewMetadata:(e,t,n,r)=>{const s=!!n,a=!!r,o=Cp.doesRestApiExist(Iu),i=(s||a)&&o?Iu:"getDataViewMetadata",c={dataViewName:e},{restApi:l,reqType:u}=Vg(i,c);if(o){if(s)return Bi(l,{method:u,body:{associationFilter:n}},t);if(a)return Bi(l,{method:u,body:{propertyFilter:r}},t)}return Bi(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}=Vg("readDataObject",c);return Bi(u,{method:d,body:l,...o&&{signal:o},...a&&{skipClearErrorMessages:a}},r,i)},getCaseEditMetadata:(e,t)=>Uc.getCaseEditMetadata(e,t),getCaseEditLock:(e,t)=>Uc.getCaseEditLock(e,t),updateCaseEditFieldsData:(e,t,n,r)=>Uc.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}=Vg("moveListRecords",c);return Bi(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!==xd("root").find((e=>e.includes("authoring-preview")))?`${j.AUTHORING_PREVIEW_CONTAINER}-${e}`:`${jr.getAppAlias()}-${e}`,isDistinctResultsOnly:e=>{const t=Sp.getKeyMapping("pyGUID");return!e.some((e=>e.field===t))}};const _u=class{constructor(e,t,n){this.filter=e,this.messageHandler=t,this.contextName=n}};const Cu=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 Du.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],Du.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 Su=s(631),Tu=s.n(Su);const Nu=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===Tu()(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};Du.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 Ru=new class{constructor(){this.subscriptions={}}getOrCreateSubscription(e){if(!this.subscriptions[e]){const t={caseId:e};this.subscriptions[e]=new Nu("CASE",t)}return this.subscriptions[e]}};class Pu{static subscribers={};static connectionsCount=0;static webSocket=null;static connectionConfig=null;static inProgressSubscriptions=[];static inProgressMessages=[];static isServiceAlive=null;static serviceAliveHandler=null;static userPresence=new Cu;static refreshB2SOffset=10;static isAuthenticated=!1;static initConnection(e){if(!e)return;const{messagingService:t}=e;if(!t||t&&t.length<=6)return;const n=jr.b2sJWT;if(!n||n.length<4)return;this.webSocket&&(this.webSocket.close(),this.cleanSocketListeners());const r=t.endsWith("/")?t+"ws":t+"/ws";try{const e=new WebSocket(`${r}`);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.log("web socket connection error event: ",e)}static handleOnClose(e){null!==this.serviceAliveHandler&&(clearTimeout(this.serviceAliveHandler),this.serviceAliveHandler=null),this.isAuthenticated=!1,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=jr.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(1e4),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&&s.filter.matcher===e&&Lh.isEqual(s.filter.criteria,n)&&s.messageHandler(t)}))}else if(t&&t.tokenExpiryTime){this.isAuthenticated=!0,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.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(),this.webSocket.close(),this.webSocket=null)}static subscribe(e,t,n,r){this.connectionsCount+=1;const s=r||`${Date.now()}_${this.connectionsCount}`,a=new _u(e,t,n);return null!==this.webSocket&&1===this.webSocket.readyState&&this.isAuthenticated?(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,t){if(this.subscribers[e]){t||delete this.subscribers[e];const n={unsubscribe:{id:e}};null!==this.webSocket&&1===this.webSocket.readyState&&this.webSocket.send(JSON.stringify(n))}}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=>Ru.getOrCreateSubscription(e);static refreshB2STokenReInit=async()=>{const e={body:{B2SToken:jr.b2sJWT}};PCore.getRestClient().invokeRestApi("refreshB2S",e).then((e=>{const{newB2SToken:t}=e.data;t&&t.length>30?(jr.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 Du=Pu;const bu=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=bh(this.records,e,{isArrayDeepMerge:!1})),this.setMaxRecordsCount(this.records.length)}setMaxRecordsCount(e){this.maxRecords=e}getMaxRecordsCount(){return this.maxRecords}};const Ou=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=Zp(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=Lh.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}=Vg(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 Bi(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&&Lh.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 bu;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 bu);const i=this.dataStore[e][a];return i.mergeRecords(o,n),i.isDirty=!1,this._addDataStoreMetaEntry(e,t,a),i.getRecords(n)}async fetchData(e,t,n,r,s,a){const{additionalApiParams:{useExtendedTimeout:o=!1,includeTotalCount:i=!1}={},...c}=a,l={dataViewParameters:t};return i&&(l.includeTotalCount=!0),o&&(l.useExtendedTimeout=!0),n&&(l.paging=n),r&&(l.query=r),Au.getData(e,l,s,c)}isDataPage(e=""){return e.startsWith("D_")||e.startsWith("Declare_")}handleCascadeUpdate(){const{dataPageName:e,scope:t}=this;t.handleMessage({message:{datapage:e,parameters:""}})}subscribeToUpdate(e,t,n,r,s,a){this.subscribers[e]=this.subscribers[e]||{},this.subscribers[e].callback=this.subscribers[e].callback||{},a&&!this.subscribers[e].callback?.[a]&&(this.subscribers[e].callback[a]=s),this.subscribeToCascadeUpdates(e,t,n,r,a)}unsubscribe(e,t,n,r,s){delete this.subscribers[e]?.callback?.[s],t&&t.length>0&&hh.unRegisterFields(n,r,t,s)}subscribeToCascadeUpdates(e,t,n,r,s){t&&t.length>0&&hh.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}};Du.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=Zp(e);return!t||"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 vu=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 xu=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 vu(t,n,s,r,a,o)),this.bufferedDataQueues[e]}},wu=(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,Mu=e=>e.map((e=>e.field)),Lu=(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;wu(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=Mu(e.query?.select);Mu(t.query?.select).forEach((t=>{o.includes(t)||(e.query?.select).push({field:t})}))},Uu=(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]:!Lh.isEqual(e.dataViewParameters?.[n],t.dataViewParameters?.[n]))))(e,t)||((e,t)=>!e.dataViewParameters&&!t.dataViewParameters)(e,t)),Fu=(e,t)=>{const{data:n}=t,{dataViewCallMap:r,filterDataOnClient:s}=e;Object.keys(r).forEach((e=>{r[e].resolve({data:s(e,n)})}))},ju=e=>({combiner:Lu,comparator:Uu,separator:Fu,...e}),Vu=(e,t)=>{try{window.sessionStorage.setItem(e,t)}catch(e){}};class ku{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=Lh.getHashedString(s),o=`${e.dataSource}_${a}`,i=Au.getAppCacheKey(e.dataSource);if(window.sessionStorage.getItem(i)){const s=JSON.parse(window.sessionStorage.getItem(i));if(t&&ku.searchResultsCache?.[t]?.[o])n(ku.searchResultsCache[t][o]);else if("form"!==e.cacheLifeSpan&&ku.searchResultsCache?.persisted?.[o])n(ku.searchResultsCache.persisted[o]);else{const a=new ku(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,ku.initializeCache(t,e,o,a),n(a)):(a.associationFilter=e.associationFilter,a.propertyFilter=e.propertyFilter,a.fetchMetaData(t).then((r=>{Vu(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,ku.initializeCache(t,e,o,a),n(a)})).catch((e=>{a.isInitialised=!1,r(e)})))}}else if(e.deferDatasource&&Zp(e.dataSource)){const r=new ku(e,t),s=Zp(e.dataSource);r.isQueryable=!!s?.isQueryable,r.isInitialised=!0,r.dataSourceMetaData=s,Vu(i,JSON.stringify({isQueryable:s?.isQueryable,dataSourceMetaData:s,isInitialised:!0})),r.context=t,ku.initializeCache(t,e,o,r),n(r)}else{const s=new ku(e,t);s.associationFilter=e.associationFilter,s.propertyFilter=e.propertyFilter,s.fetchMetaData(t).then((r=>{Vu(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,ku.initializeCache(t,e,o,s),n(s)})).catch((e=>{s.isInitialised=!1,r(e)}))}}))}static bufferedDataView=new xu;registerForBufferedCall(e){return this.isQueryable&&(this.initializeBufferCallsForDataPage(ju(e)),this.bufferInitialized=!0),this}static clearContextedCache(e){delete ku.searchResultsCache[e]}static initializeCache(e,t,n,r){e&&"form"===t.cacheLifeSpan?.toLowerCase()?(void 0===ku.searchResultsCache[e]&&(ku.searchResultsCache[e]={}),ku.searchResultsCache[e][n]=r):(void 0===ku.searchResultsCache.persisted&&(ku.searchResultsCache.persisted={}),ku.searchResultsCache.persisted[n]=r)}fetchMetaData(e){return Au.getDataViewMetadata(this.dataSource,e,this.associationFilter,this.propertyFilter)}initializeBufferCallsForDataPage(e){ku.bufferedDataView.addBufferedDataQueueForDataPage(this.dataSource,(e=>Ou.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 ku.bufferedDataView.getBufferedDataQueueForDataPage(this.dataSource).queueDataViewCall(t,e)}catch{const n=this.buildSchemaForQueryableDP(e,t);return Ou.getDataAsync(this.dataSource,this.context,n.dataViewParameters,n.paging,n.query)}const n=this.buildSchemaForQueryableDP(e,t);return Ou.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=Ou.getDataAsync(this.dataSource,this.context,n.dataViewParameters),this.isNQDataFetchInProgress=!0,new Promise(((n,r)=>{this.fetchNQDataPromise?.then((r=>(this.nonQueryableData=[...r.data],this.fetchedNQData=!0,n({data:this.filterDataOnClient(e,this.nonQueryableData,t)})))).catch((e=>r(e))).finally((()=>{this.isNQDataFetchInProgress=!1,this.fetchNQDataPromise=null}))}))}return Promise.resolve(null)}filterDataOnClient(e,t,n){const r=(n?.columns??this.columns)?.filter((e=>e.useForSearch)).map((e=>e.value));return t.reduce(((t,s)=>(Object.keys(s).every((a=>!(r?.includes(a)&&s[a]&&this.positionMatches(`${s[a]}`,e,n))||(t.push({...s}),!1))),t)),[])}positionMatches(e,t,n){const r=n?.ignoreCase??this.ignoreCase,s=r?e.toLowerCase():e,a=r?t.toLowerCase():t;switch(n?.matchPosition??this.matchPosition){case"start":return s.startsWith(a);case"contains":return s.includes(a);case"equals":return s===a;default:return!1}}buildSelect(e){const t=[],n=[];return(e?.columns??this.columns)?.forEach((e=>{if(!n.includes(e.value)){n.push(e.value);const r={field:e.value};t.push(r)}})),t}buildFilters(e,t){const n=t?.matchPosition??this.matchPosition,r=t?.ignoreCase??this.ignoreCase,s={};let a=0;(t?.columns??this.columns)?.forEach((t=>{if(t.useForSearch){const o=`F${a}`;a+=1;const i={field:t.value},c={value:e};let l="CONTAINS";"start"===n?l="STARTS_WITH":"equals"===n&&(l="EQ");const u={...`${parseFloat(e)}`!==e==!0&&{ignoreCase:r?"true":"false"},lhs:i,rhs:c,comparator:l};s[o]=u}}));const o=Object.keys(s).join(" OR ");return{filterConditions:s,logic:o}}buildQuery(e,t){const n=this.buildSelect(t);return e?{select:n,filter:this.buildFilters(e,t),...Au.isDistinctResultsOnly(n)&&{distinctResultsOnly:"true"}}:{select:n,...Au.isDistinctResultsOnly(n)&&{distinctResultsOnly:"true"}}}buildPageOptions(){return this.enablePagination?{pageNumber:this.pageNumber,pageSize:this.pageSize}:{maxResultsToFetch:this.maxResultsDisplay}}buildSchemaForQueryableDP(e,t){return{dataViewParameters:this.parameters,query:this.buildQuery(e,t),paging:this.buildPageOptions()}}buildSchemaForNonQueryableDP(){return{dataViewParameters:this.parameters}}isValidDatasource(){return!!this.dataSource}}const $u=ku;const Bu=class{static cleanCaches(e){hh.purgeCascadeFields(e),Eu.removeContext(e),$u.clearContextedCache(e),yi.cleanContextSubscribers(e),pl(e),bn.removeContextTreeNode(e),Du.clearContext(e),Pl.deRegisterForRefresh(e)}},Gu="GET_DESCENDANTS";const Wu=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]}},Hu=(e,t)=>{const n={},r=Jl.getLookUpDataPage(e),s=Jl.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}},qu=(e,t)=>{const n=Jl.getSavableDataPage(e),r=Jl.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}},zu=e=>{yi.publish(F.PUB_SUB_EVENTS.EVENT_CANCEL,e)},Yu=(e,t,n)=>{const{callbacks:r}=n;return n.callbacks=null,e(t,n).then((e=>{"cancel"===e?r?.cancel?.():r?.submit?.()}))};const Ku=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:_l(this.c11nEnv.getContextName()),u=this.c11nEnv.getValue("isProcessAction","isProcessAction");return $h.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||"":pn.getNextActionMgrId();const o=new Promise(((e,t)=>{r=e,s=t}));if(!r||!s)throw new Error("resolveFn or rejectFn is not defined.");return pn.register(a,o,r,s,e,t,n),{actionMgrID:a,promise:o}};showDataObjectCreateView(e,t=F.VIEW_NAMES.DATA_OBJECT_CREATE_VIEW){const n=$h.buildActionObject({viewName:t,className:e},this.c11nEnv),r=ne,{promise:s}=this.actionsApiPromise(r,n);return Eh({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(!Vl(t)){return new Ql(this.c11nEnv).removeContainerItem({containerItemID:e,skipReleaseLockRequest:!0})}const n=He,r=$h.buildActionObject({containerItemID:e,context:t},this.c11nEnv),s=t&&t.includes(j.MODAL);Eh({type:n,payload:{...r,isModalAction:s,isDataObject:!0,skipReleaseLockRequest:!0}});const{promise:a}=this.actionsApiPromise(n,r);return a.then((()=>{zu({})}))}createDataObject(e){if(!e)return Promise.reject(new Error("containerItemID is required parameter"));const{data:t}=yh()?.getState()||{},n=t[e]?.dataInfo?.content?.classID;if(!n)return Promise.reject(new Error(j.DATA_CLASS_NOT_FOUND));const r=Jl.getSavableDataPage(n),s=it,a=!!e&&e.includes(j.MODAL),o=$h.buildActionObject({containerItemID:e,dataPageID:r},this.c11nEnv),{promise:i}=this.actionsApiPromise(s,o);return Eh({type:"CREATE_DATA_OBJECT",payload:{...o,isModalAction:a,isFormValid:_l(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=ct,r=Jl.getSavableDataPage(e),s=Jl.getDataPageKeys(r),a={};if(s)for(const e of s)a[e.keyName]=e.isAlternateKeyStorage?t[e.linkedField]:t[e.keyName];const o=$h.buildActionObject({dataViewName:r,dataViewParameters:a},this.c11nEnv),{promise:i}=this.actionsApiPromise(n,o);return Eh({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=lt,{dataPageID:s,dataViewParameters:a}=Hu(e,t),o=$h.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 Eh({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}=yh()?.getState()||{},r=n[e]?.dataInfo?.content?.classID;if(!r)return Promise.reject(new Error(j.DATA_CLASS_NOT_FOUND));const{dataPageID:s,keys:a}=qu(r,t),o=ut,i=e&&e.includes(j.MODAL),c=$h.buildActionObject({containerItemID:e,dataPageID:s,key:a},this.c11nEnv),{promise:l}=this.actionsApiPromise(o,c);return Eh({type:"UPDATE_DATA_OBJECT",payload:{...c,isModalAction:i,isFormValid:_l(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=dt,{dataViewParameters:a,dataPageID:o,dataPageKeys:i}=Hu(e,t),c=$h.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 Eh({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}=yh()?.getState()||{},s=r[e]?.dataInfo?.content?.classID;if(!s)return Promise.reject(new Error(j.DATA_CLASS_NOT_FOUND));const a=dp(e),o=Wd(a),i=md(o,a)||{},{resourceType:c="",key:l=""}=i,u=pt,{dataPageID:d,keys:p}=qu(s,t),h=$h.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 Eh({type:u,payload:{...h,isFormValid:_l(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",t);const{dockable:n=!1}=t?.modalOptions||{};let r=le;const s=$h.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 Oi.getPreviewMode()&&(s.debugInfo={debugId:Lh.generateUniqueID()}),Eh({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??Uc.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=$h.buildActionObject({dataViewID:e,dataViewParameters:t},this.c11nEnv),{promise:s}=this.actionsApiPromise(n,r);return Eh({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=$h.buildActionObject({caseID:e,currentContext:n},this.c11nEnv),{promise:s}=this.actionsApiPromise("GET_DESCENDANTS",r),a=(o={...r,context:n},{type:Gu,payload:o});var o;return Eh(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=$h.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),Oi.getPreviewMode()&&![j.WORKAREA].includes(n.targetContainer)&&(a.debugInfo={debugId:Lh.generateUniqueID()}),Eh({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:mt,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=zl;const a=$h.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"),Oi.getPreviewMode()&&![j.WORKAREA].includes(n.containerName)&&(a.debugInfo={debugId:Lh.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 Eh({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=bd(e);let r=n;if(n?.includes("/workarea")&&(r=n.substring(0,r?.lastIndexOf("/workarea"))),(e=>{const t=bn.getContextReferences(e);if(t)for(const[,e]of t)if(Vh.resolveContextTreeNodeProps(e.props).hasSuggestions)return!0;return!1})(n)){const e=[{type:"error",message:Rp.getLocaleValue(this.MSG_ACTIVE_SUGGESTION_UNATTENDED,"Messages")}];return Jn({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}=dn(e,this.c11nEnv,{isTriggeredFromDifferentContext:a}),g=rn(u);let f,m=!1;if(l){const e=l.find((e=>e.ID===c));m="Case"===e?.type}else f=Ih(n);let{assignmentID:y}=dn(e,this.c11nEnv,{isTriggeredFromDifferentContext:a});f?.context_data?.actionType&&(m=f.context_data.actionType===j.CASE,y=y||f.context_data.assignmentID);const E=un(i,y,c),[I,A]=o.split(" "),_={class:I,actionID:E,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=jc.FORM);const C=$h.buildActionObject(_,this.c11nEnv),{promise:S}=this.actionsApiPromise(s,C);return C.isProcessAction=this.c11nEnv.getValue("isProcessAction","isProcessAction")||Ih(n).context_data.isProcessAction,Qt.executeOrQueueDeferredAction({type:s,payload:{...C,context:n}}),S}getNextWork(){const e=zl,t=$h.buildActionObject({containerName:j.PRIMARY,isGetNextWork:!0},this.c11nEnv),{promise:n}=this.actionsApiPromise(e,t);return Eh({type:e,payload:{...t}}),n}openStage(e){if(!e)return Promise.reject(new Error("stageID is required parameter for openStage"));const t=zl,n=this.c11nEnv.getValue(F.CASE_INFO.CASE_INFO_ID),r=this.c11nEnv.getCaseSummary().headers,s=$h.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 Eh(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=$h.buildActionObject(s,this.c11nEnv),{promise:o}=this.actionsApiPromise(t,a),i=bd(e);return Eh({type:t,payload:{...a,context:i,cases:n,actionID:r,isFormValid:_l(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=$h.buildActionObject(s,this.c11nEnv),{promise:o}=this.actionsApiPromise(t,a),i=bd(e);return Eh({type:t,payload:{...a,context:i,cases:n,actionID:r,isFormValid:_l(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=$h.buildActionObject(a,this.c11nEnv),{promise:c}=this.actionsApiPromise(o,i);return Eh({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 Ql(this.c11nEnv).removeContainerItem({containerItemID:e,skipReleaseLockRequest:!0})}approveCase(e){return e?"string"!=typeof e?Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING)):(Eh({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)):(Eh({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 Eh([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 Eh([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,Yu(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=$h.buildActionObject(a,this.c11nEnv),c=this.c11nEnv.getContextName(),{promise:l}=this.actionsApiPromise(o,i),u=xd(c)[0];let d=!1;const p=$.getRemoteHeaderByContext(c);let h;if(p&&(i.headers={},i.headers.RemoteSystemID=p),!u)return h=c,Eh({type:o,payload:{...i,contextName:c,continueExecution:d}}),l;h=Rd(u);const g=fd(u);if(g?.accessedOrder.forEach((e=>{n===g.items[e].key&&(d=!0,h=g.items[e].context)})),!d||h&&"review"===yh()?.getState()?.data[h]?.context_data?.caseViewMode)return Eh({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),E=Ih(h),I=E?.caseInfo?.assignments?E.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=$h.buildActionObject({context:f,containerItemID:h,assignmentID:y,actionID:I,caseID:n,containerName:A,caseType:_,isModalAction:m,isFormValid:!0,isProcessAction:C},this.c11nEnv);S.context=h;const T=bd(h),N=this.c11nEnv.getCaseSummary(),R=rn(N),P=$h.buildActionObject({caseID:n,containerItemID:h,cancelContext:T},this.c11nEnv);let D={};return m?(P.acTargetName=j.MODAL,P.isInCreateStage=R,P.isModalAction=m,D={...P}):D={...P,acName:yt(this.c11nEnv.getContainerName(),P.context)},Eh({type:o,payload:{...i,contextName:c,saveActionPayload:S,cancelActionPayload:D,continueExecution:d}}),l}openProcessAction(e,t){if(!e)return Promise.reject(new Error(this.MSG_ACTION_ID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_ACTION_ID_STRING));const n=this.c11nEnv.getValue(F.CASE_INFO.CASE_INFO_ID)||t.caseID;if(window.pms?.plugins?.c11n?.openProcessAction)return t.caseID=n,Yu(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=ql,i=$h.buildActionObject(a,this.c11nEnv),{promise:c}=this.actionsApiPromise(o,i);return Eh({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=rn(this.c11nEnv.getCaseSummary()),a=this.c11nEnv.getValue(F.CASE_INFO.CASE_INFO_ID),o={ID:r,stepID:e,acTargetName:this.c11nEnv.getContainerName(),targetContainerName:this.c11nEnv.getContainerName(),containerItemID:t,doDeleteCaseSummary:!0,isInCreateStage:s,caseID:a};t&&t.includes(j.MODAL)&&(o.acTargetName=j.MODAL);const i=$h.buildActionObject(o,this.c11nEnv),{promise:c}=this.actionsApiPromise(n,i),l=bd(t);return Eh({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}=F,r=he,s=bd(e),a=e&&e.includes(j.MODAL),o=this.c11nEnv.getCaseSummary(),i=rn(o),c=this.c11nEnv.getValue(n.CASE_INFO_ID),l=this.c11nEnv.getValue(n.ASSIGNMENT_ID),u=$h.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:yt(this.c11nEnv.getContainerName(),u.context)};const{promise:p}=this.actionsApiPromise(r,u);return Eh({type:r,payload:d}),p.then((()=>{t||zu({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=$h.buildActionObject({caseID:a,containerItemID:e,context:n},this.c11nEnv);if(!Vl(n)){return new Ql(this.c11nEnv).removeContainerItem({containerItemID:e}).then((()=>{zu({caseID:a,context:this.c11nEnv.getContextName()})}))}Eh({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=rn(a),i=this.c11nEnv.getValue(t.CASE_INFO_ID),c=$h.buildActionObject({caseID:i,containerItemID:e,context:r},this.c11nEnv),l=this.c11nEnv.getValue("isProcessAction","isProcessAction"),u=Sp.isCoexistenceAppOfType(j.APP_TYPE.UIKIT);if(c.isProcessAction=l,o&&(s||u)&&!an(a)){const t=this.c11nEnv.getValue(j.CASE_INFO.IS_FIRST_ASSIGNMENT),i=Vl(r);if(this.shouldDeleteCaseInCreateStage(i,t,u))return this.deleteCaseInCreateStage(e);Eh({type:n,payload:{...c,isModalAction:s,isChildCase:ln(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=Kl,n=this.getSaveActionPayload(e,!0),{promise:r}=this.actionsApiPromise(t,n);return Eh(Xl(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=Kl,n=this.getSaveActionPayload(e),{promise:r}=this.actionsApiPromise(t,n);return Eh(Xl(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=Yl,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=$h.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}/${hd.PRIMARY}`,d=Kc(u,hd.PRIMARY);i.parentContext=d,s&&(i.targetName=j.MODAL,i.containerName=hd.MODAL,i.isModalAction=s),Eh((e=>({type:Yl,payload:e}))(i));const{promise:p}=this.actionsApiPromise(n,i);return p.then((()=>{zu({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}=Cp.getRestEndPoint("getRecents")||{};t=`${t}?maxResultsToFetch=${e}`;const n=I()+t;return Bi(n,{method:"GET",headers:{}})}updateRecents(e,t,n,r){const{restApi:s}=Cp.getRestEndPoint("updateRecents")||{},a=`${I()}${s}`;return Bi(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:{pyLabel:n,pyID:t,classID:e,ID:r}})}logout(){const{restApi:e}=Cp.getRestEndPoint("Logout")||{},t=`${I()}${e}`;return Bi(t,{method:"GET",headers:{}}).then((e=>(Object.keys(bn.rootNodes).forEach((e=>{Bu.cleanCaches(e)})),bn.rootNodes={},sessionStorage.clear(),xh(),Promise.resolve(e))))}invoke(e,t={}){const n={method:t.method||"GET",body:t.body};return Bi(e,n,this.c11nEnv.getContextName())}showCasePreview(e,t={}){this.loadView(e,"pyCasePreview",{container:hd.PREVIEW,containerName:hd.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:hd.PREVIEW,containerName:hd.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=$h.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 Eh({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=$h.buildActionObject({viewName:e,className:t},this.c11nEnv),s=ne,{promise:a}=this.actionsApiPromise(s,r);return Oi.getPreviewMode()&&(r.debugInfo={debugId:Lh.generateUniqueID()}),Eh({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=$h.buildActionObject({},this.c11nEnv),r=se,{promise:s}=this.actionsApiPromise(r,n);return Eh({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=$h.buildActionObject({},this.c11nEnv),r=ae,{promise:s}=this.actionsApiPromise(r,n);return Eh({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=$h.buildActionObject({pageName:e,dataContext:t,dataContextParameters:n,RemoteSystemID:$.getRemoteHeaderByContext(this.c11nEnv.getContextName())},this.c11nEnv),a=re;r?.containerName||(r.containerName="HYBRID"===Sp.getRenderingMode()?Wu.getRuntimeParam(j.HYBRID_ROOT_CONTAINERNAME):pc.getTargetViewContainerName(a));const{promise:o}=this.actionsApiPromise(a,s);return Eh({type:a,payload:{...s,...r,skipSemanticUrl:Boolean(r.skipSemanticUrl)}}),o}changeHandler(e,t){$h.changeHandler(e,t)}eventHandler(e,t){$h.eventHandler(e,t)}triggerFieldChange(e,t,n=!1){const r=this.c11nEnv.getContextName(),s=this.c11nEnv.getPageReference(),a=Vh.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=Ch(`.${i.join(".")}.classID`,s,r)),e=Lh.trimDotForProperty(e),Eh({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=Vh.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),Xn({type:F.MESSAGES.MESSAGES_TYPE_ERROR,property:e,pageReference:l,context:c,isListEntry:o}),Eh({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=$h.buildActionObject({...e,containerName:this.c11nEnv.getContainerName(),containerItemID:n},this.c11nEnv);r&&(s.containerName=j.MODAL,s.isModalAction=r),Eh({type:t,payload:s});const{promise:a}=this.actionsApiPromise(t,s);return a}refreshCaseView(e,t,n,r={}){const{promise:s,actionMgrID:a}=this.actionsApiPromise("REFRESH_DATA"),{autoDetectRefresh:o,propertyName:i,preserveClientChanges:c,classID:l,context:u,optionalPayload:d}=r,p={actionMgrID:a,caseViewAction:!0,preserveClientChanges:c,propertyName:i,classID:l,optionalPayload:d};r.refreshFor&&(p.refreshFor=r?.refreshFor),r.skipDataMerge&&(p.skipDataMerge=r?.skipDataMerge);const h=u||this.c11nEnv.getContextName(),g=this.c11nEnv.getPageReference();return!this.c11nEnv.getValue(j.CONTEXT_DATA_MODAL_VIEW.IS_MULTI_RECORD_DATA)&&o&&(((e,t)=>cn(e)&&!on(e,t))(h,g)||on(h,g))?jn(h,n,p):Mn(e,t,h,n,p),s}openEmbeddedDataModal(e,t,n,r,s,a){const o=ht,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:Lh.convertPageRefToClipboardPageNotation(c),heading:a},u=$h.buildActionObject(l,this.c11nEnv),{promise:d}=this.actionsApiPromise(o,u);if(Sp.getFeatureMap().granularUIRefresh){(t.getMetadata().config.children[0].children||[]).forEach((e=>{const n=nn.trimAnnotation(e.config.value),r=Hp(n.startsWith(".")?n.replace(".",""):n,e.config.classID);if(r?.isDeclarativeTarget){const e=t.getPageReference();bn.addFieldNode(t.getContextName(),e+c,t.viewName,n,"",{isDeclarativeTarget:!0,propertyName:n,pageReference:e+c})}}))}return Eh({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=gt,n=this.c11nEnv.getPageReference().replace(F.CASE_INFO.CASE_INFO_CONTENT,""),r=bd(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:_l(r),interestPage:Lh.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=$h.buildActionObject(s,this.c11nEnv),{promise:o}=this.actionsApiPromise(t,a);if(Vl(r)){const[e,t,n]=yn(this.c11nEnv.getPageReference());bn.mutatePageList(this.c11nEnv.getValue(j.CONTEXT_DATA_MODAL_VIEW.PARENT_CONTEXT),e,t,{type:Ze,rowIndex:n}),Eh({type:Ze,payload:{pageReference:this.c11nEnv.getPageReference(),context:this.c11nEnv.getValue(j.CONTEXT_DATA_MODAL_VIEW.PARENT_CONTEXT),isListEntry:!0}})}return Qt.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=bd(e),n=this.c11nEnv.getPageReference(),{promise:r,actionMgrID:s}=this.actionsApiPromise(ft);return jn(t,n,{actionMgrID:s,isFillFormWithAI:!0,preserveClientChanges:!1}),r}};const Xu=class{constructor(e){this.c11nEnv=e}async getCaseStages(e,t){const n={caseID:e},{restApi:r,reqType:s}=Vg("getCaseStages",n);return(await Bi(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 rn(e)}isLocalAction(){const e=this.c11nEnv.getValue(j.CASE_INFO.CASE_INFO);return an(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=md(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=Ih(t));const r=n?.caseInfo?.availableActions,s=Ih(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:Ju}=F;const Qu=class{static openCase(e,t,n,r={}){const s={insKey:e,acTargetName:n,actionMgrID:pn.getNextActionMgrId(),context:t,...r},a=ue;r&&r.channelName&&(s.headers={},s.headers[j.X_ORIGIN_CHANNEL]=r.channelName);const{promise:o}=pn.actionManagerPromise(a,s.actionMgrID);return Eh({type:a,payload:s}),o}static openAssignment(e,t,n,r={}){const s={assignmentID:e,vcName:n,doDeleteCaseSummary:!0,actionMgrID:pn.getNextActionMgrId(),context:t,...r},a=ge;r&&r.channelName&&(s.headers={},s.headers[j.X_ORIGIN_CHANNEL]=r.channelName);const{promise:o}=pn.actionManagerPromise(a,s.actionMgrID);return Eh({type:a,payload:{...s}}),o}static createCase(e,t,n,r={}){const s=le,a={class:e,acTargetName:n,actionMgrID:pn.getNextActionMgrId(),context:t,...r};r&&r.channelName&&(a.headers={},a.headers[j.X_ORIGIN_CHANNEL]=r.channelName);const{promise:o}=pn.actionManagerPromise(s,a.actionMgrID);return Eh({type:s,payload:{...a}}),o}static getNextWork(e,t,n={}){const r=ge,s={isGetNextWork:!0,vcName:t,doDeleteCaseSummary:!0,actionMgrID:pn.getNextActionMgrId(),context:e,...n},{promise:a}=pn.actionManagerPromise(r,s.actionMgrID);return Eh({type:r,payload:{...s}}),a}static getOpenedCaseItems(e){const t=[],n=fd(e);if(n){const{items:r={}}=n,s=Object.keys(r),a=Rd(e);s.forEach((n=>{if(r[n]&&(r[n].resourceType===Ju.CASE||r[n].resourceType===Ju.ASSIGNMENT)){const{key:s="",context:o}=r[n],i=r[n],c=s.substring(s.indexOf(" ")+1),l=Ch(".caseTypeID",j.CASE_INFO.CASE_INFO,o),u=a===n;t.push({...i,key:s,workID:s,caseID:c,className:l,context:o,containerItemID:n,target:e,active:u})}}))}return t}static getCaseDetails=(e,t)=>{if(!e)return Promise.reject(new Error("Case ID is required"));const n={caseID:e},{restApi:r,reqType:s}=Vg(Be,n),a={},o=$.getRemoteHeaderFromSourceClass(t??"");return o&&(a.RemoteSystemID=o),Bi(r,{method:s,headers:a})};static getCaseBulkActions=async e=>{const{restApi:t,reqType:n}=Vg("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(Bi(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}=Vg("getCaseBulkActions",t),s=await Bi(n,{method:r});let a=[];return s.data?.availableActions?.length&&(a=s.data.availableActions),a}};const Zu=class{constructor(e,t,n){this.meta=e,this.datasource=t,this.index=0,this.options=n,this.datasourceObj=Vh.getPropertyValue(t,n.pageReference,n.context)}hasNext(){return this.index<this.datasourceObj.length}next(){if(!this.hasNext())throw new Error("No Children");const e=Vh.getContextPath(this.datasource,this.index);return this.index+=1,cd({meta:this.meta,options:{...this.options,pageReference:e}})}resetIndex(){this.index=0}};class ed{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,cd({meta:e,index:this.index,options:this.options})}resetIndex(){this.index=0}}const td=(e,t)=>{const n=!!e?.repeat;if(!!e?.["repeat-self"])return new Zu(e,e.context||"",t);if(n){const n=Th(`${t.context}.${j.SUMMARY_OF_LISTS}`,e.pageReference,t.context);return new Zu(e.children[0],n||e.context,t)}return e?.children?new ed(e.children,t):void 0};class nd{static allowedComponetsForBulkProcessing={Currency:!0,TextInput:!0,Phone:!0,Percentage:!0,Email:!0,Integer:!0,Decimal:!0,URL:!0,SemanticLink:!0,Checkbox:!0,RadioButtons:!0,DateTime:!0,Date:!0,Time:!0,Text:!0,TextArea:!0,RichText:!0,Dropdown:!0,Search:!0,Location:!0,Attachment:!0,AutoComplete:!0,MultiSelect:!0,UserReference:!0,Region:!0,TextContent:!0,View:{Forms:!0,DefaultForm:!0,OneColumn:!0,TwoColumn:!0,ThreeColumn:!0}};static getItemView(e,t){const n=[];if(e&&["portal","view"].includes(t)){const{accessedOrder:t,items:r}=e;if(t&&r){const e=t[t.length-1];r[e]&&r[e].view&&Object.keys(r[e].view).length>0&&n.push(r[e])}}return n}static getDependentProperties=e=>{let t=[];return e._rawConfig?.config?.parameters?t=Object.values(e._rawConfig?.config?.parameters||{}):e.getFieldMetadata(e.getStateProps()?.value)?.datasource?.parameters&&(t=(e.getFieldMetadata(e.getStateProps()?.value)?.datasource?.parameters||[]).map((e=>e?.value))),t.filter((e=>Tl.isProperty(e))).map((e=>Tl.getPropertyName(e)))}}const rd=new nd;let sd;Object.freeze(rd);const ad=(e,t,n)=>{e&&(Object.keys(e).forEach((r=>{if("children"!==r){const s=e[r],a=nn.trimAnnotation(s);if("string"!=typeof a&&"string"!=typeof s||!(Lh.isValidAnnotation(s)&&Lh.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({}),ad(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]||{},ad(a,t[r],e)}}else n&&n.parentKey&&(n.isObjHasValue=!0),t[r]=a}})),n&&!n.isObjHasValue&&delete n.parentStateObj[n.parentKey])},od=(e,t)=>{e._inheritedProps=e._inheritedProps||[],e.inheritedProps=[...e._inheritedProps,...Lh.deepClone(t.inheritedProps)]};class id{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=Lh.deepClone(r.inheritedConfig)),t?.config?.inheritedProps&&od(this._inheritedConfig,t?.config),ad(this._rawConfig,this._stateProps),this._isState=!Lh.isObjectEmpty(this._stateProps),this._rawConfig&&this._rawConfig.config&&(this._isExpressionExist=Lh.isExpressionExist(this._rawConfig.config),this._isWhenExist=Lh.isWhenExist(this._rawConfig.config),this._isValidatorExist=Mr.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=nn.handleAnnotation(this.options.pageReference,this)),this._pageReference=Vh.getContextPath(a||this.options.parentPageReference,this._pageReference),this._pageReference||(this._pageReference=""),"reference"===this._type&&(this._rawConfig=t),"reference"===this._type&&Lh.isWhenExist({visibility:this.meta?.config?.visibility})&&Ln(this.viewName,this._contextName,this._pageReference),"reference"!==this._type&&t&&(this._rawConfig=Vh.resolveReference(t,this)),this._rawConfig){const e=this.getRawConfigProps();e&&(this._localeRuleName=nn.trimAnnotation(e.localeReference)||r.localeReference,this._isExpressionExist=Lh.isExpressionExist(e),this._isWhenExist=Lh.isWhenExist(e),this._isValidatorExist=Mr.isValidatorExist(e)),this._children=this._rawConfig.children,this._rawConfig?.type?.toLowerCase()===j.VIEW&&this._rawConfig.name&&(this.viewName=nn.handleAnnotation(this._rawConfig.name,this)),this.options.hasForm&&Fn(this)}}isDeclarativeTarget(){let e=!1;if(this.getValue(this._pageReference)||""===this._pageReference){const t=nn.trimAnnotation(this.getPropertyName()),n=this.getFieldMetadata(t);e=n?.isDeclarativeTarget||!1}return e}_getPropertyName(){const e=nn.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?nn.trimAnnotation(this._rawConfig.config.associatedView):"",d=n||c,p={target:this._containerTarget,context:this._contextName,pageReference:this._pageReference,propertyName:nn.trimAnnotation(t),label:d?.startsWith("@")?nn.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()};bn.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"))bn.removeFieldNode(this._contextName,this._pageReference,this.viewName||"",nn.trimAnnotation(this.getPropertyName()),this.index);else{const e=this._rawConfig?.config?.context?`${this._pageReference}${this._rawConfig?.config.context}`:this._pageReference;bn.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&&bn.addViewNode(this._contextName,this._pageReference,this.viewName,this.parentViewName),"Group"===this._rawConfig?.type&&this._rawConfig?.config?.id&&bn.addViewNode(this._contextName,this._pageReference,this._rawConfig.config.id,this.parentViewName),"Address"===this._rawConfig?.type&&this._rawConfig?.config?.associatedView&&bn.addViewNode(this._contextName,this._pageReference,nn.trimAnnotation(this._rawConfig.config.associatedView),this.parentViewName),"deferload"===this._rawConfig?.type?.toLowerCase()&&this._rawConfig.config?.name&&bn.addViewNode(this._contextName,this._pageReference,this._rawConfig.config.name,this.parentViewName)}addWhenNode(){let e="",t="";const n=Lh.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=nn.isProperty(n)?nn.trimAnnotation(n):""}e&&n.forEach((n=>{bn.addWhenNode(this.getContextName(),this.getPageReference(),t,e,n,{pageReference:this.getPageReference(),context:this.getContextName()})}))}updateContextTree(){if(this.isVisible()&&(this.addViewNode(),this._rawConfig?.config&&Object.hasOwn(this._rawConfig.config,"value")&&"DISPLAY_ONLY"!==this._inheritedConfig.displayMode&&"DISPLAY_ONLY"!==this._rawConfig.config?.displayMode&&this.addFieldNode(),(this._rawConfig?.type?.toLowerCase()!==j.VIEW||"Editable"===this._rawConfig.config?.renderMode)&&this._rawConfig?.config?.referenceList&&"DISPLAY_ONLY"!==this._rawConfig.config?.displayMode)){const{value:e,label:t,required:n,readOnly:r,disabled:s,visibility:a,validationType:o,selectionMode:i,selectionList:c,selectionKey:l,referenceList:u,renderMode:d,caption:p}=this.getRawConfigProps(),h=t||p;let g=[];["Multiselect","Checkbox"].includes(this._rawConfig.type)&&(g=this.getSelfReferencingDatapageKeys()),bn.addPageListNode(this._contextName,this._pageReference,this.viewName??"",nn.trimAnnotation(this.getPropertyName()),{target:this._containerTarget,context:this._contextName,pageReference:this._pageReference,propertyName:nn.trimAnnotation(this.getPropertyName()),label:h?.startsWith("@")?nn.handleAnnotation(h,this,void 0):h,required:n,readOnly:r,disabled:s,visibility:a||this.options.visibility,skipRequiredValidation:this.options.isBulkAction,inheritedProps:this.getInheritedProps(),useCustomContext:this.useCustomContext,value:e,validationType:o,componentName:this._rawConfig.type,type:this._rawConfig.config?.type,hasSuggestions:this._hasSuggestions,isInsideList:this.isInsideList(),selectionMode:i,selectionList:c,renderMode:d,referenceList:u,selectionKey:l,index:this.index,selfReferencingDatapageKeys:["Multiselect","Checkbox"].includes(this._rawConfig.type)?g:void 0});const f=this.getValue(nn.trimAnnotation(this.getPropertyName()),this._pageReference)||[];bn.updatePageListNode(this._contextName,this._pageReference,nn.trimAnnotation(this.getPropertyName()),f.length)}this.isWhenExist()&&this.addWhenNode(),this.removeNode()}setXRayInfo(e){Lh.mergeDeep(e,this.xrayInfo)}getXRayInfo(){return this.xrayInfo}getStateProps(){return this._stateProps}setStateProps(e){Lh.mergeDeep(e,this._stateProps)}getMetadata(){return this._rawConfig}getCaseInfo(){return this._caseInfo||(this._caseInfo=new Xu(this)),this._caseInfo}getCaseLocaleReference(){const e=this.getCaseInfo().getClassName();return e?`CASE!${e}`.toUpperCase():null}getListActions(){return vr(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 Vh.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=hd.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=l?.getStore()?.getState()?.data[`${this.getContextName()}/${j.SUGGESTION}`],n=this.getStateProps()?.value,r=Vh.getContextPath(this.getPageReference(),n),s=t?uc.getSuggestionsContext(this.getContextName()).getField(r):void 0;this._hasSuggestions=!!s,e.hasSuggestions=this._hasSuggestions,this._stateProps.hasSuggestions=this._hasSuggestions}}getConfigProps(e={}){const t={...xr.getDefaultsforType(this._type),readOnly:this._readOnly,...this._rawConfig&&this._rawConfig.config,...this._additionalRegisteredProps,...this._inheritedConfig};return this.populateSuggestionProps(t),this.resolveConfigProps(t,e),Lh.resolveStringBooleans(e)}getRawConfigProps(){const e={...xr.getDefaultsforType(this._type),...this._rawConfig?.config,...this._additionalRegisteredProps,...this._inheritedConfig};return this.populateSuggestionProps(e),e}resolveConfigProps(e,t={}){return e&&(Vh.resolveProps(e,t,this),nn.handleComponentMapping(t,{type:this.getComponentName(),config:e},this)),t}registerAdditionalProps(e={}){return Object.assign(this._additionalRegisteredProps,e),ad(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=Rd(`${j.APP.APP}/${this.getContainerName()}`),n=Kn({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||nn.trimAnnotation(this.getRawConfigProps().selectionList):!t&&"Editable"===this.getComponentConfig()?.renderMode&&this.getStateProps().referenceList&&(t=this.getStateProps().referenceList);const n=Kn({property:t,pageReference:this.getPageReference(),context:this.getContextName(),type:F.MESSAGES.MESSAGES_TYPE_ERROR}),r=Kn({property:t,pageReference:this.getPageReference(),context:this.getContextName(),type:F.MESSAGES.MESSAGES_TYPE_INFO});n&&n[0]&&(e.validatemessage=n.map((e=>Rp.getLocaleValue(e.message.replace(/\.$/,""),"Messages"))).join(". ")+(n[n.length-1].message.endsWith(".")?".":""),e.status=j.FIELD_LEVEL_ERROR,this._stateProps.validatemessage=e.validatemessage,this._stateProps.status=e.status),r&&r[0]&&(e.infoMessage=r[0].message,e.status=j.FIELD_LEVEL_WARNING,this._stateProps.infoMessage=e.infoMessage,this._stateProps.status=e.status)}if(t===j.ROOT_CONTAINER){const t=Zn(r,Rd(`${j.APP.APP}/${this.getContainerName()}`));e.httpMessages=t,this._stateProps.httpMessages=e.httpMessages;const n=uc.getSharedState("isLoggedOut");e.isLoggedOut=n,this._stateProps.isLoggedOut=n;const s=Kn({context:j.APP.ROOT,category:"PAGE"});e.pageMessages=s,this._stateProps.pageMessages=e.pageMessages}if(t===j.HYBRID_VIEW_CONTAINER){const t=Kn({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=Qu.getOpenedCaseItems(`${F.APP.APP}/${j.PRIMARY}`),this._stateProps.activeCases=e.activeCases),t===j.APP_SHELL){const t=j.APP.APP,n=Rd(`${t}/${this.getContainerName()}`),r=[...Kn({context:t,category:"PAGE"})||[],...Kn({context:n,category:"PAGE"})||[]],s=r.length>0?r:void 0;e.pageMessages=s,this._stateProps.pageMessages=e.pageMessages}if(e.value&&t===j.SCALARLIST&&(this._stateProps.value=e.value),t===j.APP_SHELL||t===j.MODAL_VIEW_CONTAINER||t===j.CASE_CREATE_STAGE||n.template===j.CASE_PREVIEW){let t=Kn({context:j.APP.APP,category:"HTTP"});const n="HYBRID"===Sp.getRenderingMode()?`${this.getContextName()}/${this.getContainerName()}`:`${j.APP.APP}/${this.getContainerName()}`,r=Kn({context:Rd(n),category:"HTTP"});t?r&&(t=t.concat(Kn({context:Rd(n),category:"HTTP"}))):t=Kn({context:Rd(n),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=Et(this.getContainerName(),this._contextName),t===j.ROOT_CONTAINER&&(e.rootConfig=nd.getItemView(e.routingInfo,e.renderingMode),this._stateProps.rootConfig=e.rootConfig),this._stateProps.routingInfo=e.routingInfo,t===j.FLOW_CONTAINER){const t=Kn({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=xd(n)[0];if(r){const t=Rd(r),n=l?.getStore()?.getState()?.data;n&&t&&(e.lastUpdateTime=n[t]?.caseInfo?.lastUpdateTime,this._stateProps.lastUpdateTime=n[t]?.caseInfo?.lastUpdateTime);const s=Kn({context:t,category:F.PAGE}),a=Kn({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=Tl.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=nn.getPropertyName(s),n=this.getFieldMetadata(t);n&&this.updateConfigData(e,n,t)}}resolvePropertyMetadata(e,t){if(!e)return e;const n=uh(`${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(Hp(e,t),e)}return this.resolvePropertyMetadata(Hp(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(Hp(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:()=>on(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 Hl(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?nn.handleAnnotation(this._rawConfig?.config?.visibility,this):"string"!=typeof this.options?.visibility||nn.handleAnnotation(this.options?.visibility,this)}isReadOnly(){return void 0!==this._readOnly&&("true"===this._readOnly||!0===this._readOnly||"string"==typeof this._readOnly&&nn.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 Ih(e||this.getContextName())}getImagePath(e){return`${jr.getConstellationServiceUrl()}/v860/${jr.getAppAlias()}/image/${e}?org=${Cp.getOrganizationName()}`}skipRequiredValidation(){return this.options.isBulkAction}isBulkAction(){return this.options.isBulkAction}getChildren(){if(this._children&&this._children.length){const e=td(this._rawConfig,{pageReference:this._pageReference,context:this._contextName,localeReference:this._localeRuleName,hasForm:this.options.hasForm,isBulkAction:this.options.isBulkAction,containerName:this.getContainerName(),containerItemName:this.options.containerItemName,viewName:this.viewName,inheritedConfig:this._inheritedConfig,target:this._containerTarget,readOnly:this._readOnly,categoryName:"Group"===this._type?this._rawConfig?.config?.id:null}),t=[];for(;e?.hasNext();){const n=e.next();if(this.isBulkAction()){const e=n.getPConnect().getComponentName(),{template:t}=n.getPConnect().getConfigProps();if(!e||!0!==nd.allowedComponetsForBulkProcessing[e]&&!0!==nd.allowedComponetsForBulkProcessing[e]?.[t])continue}t.push(n)}return e?.resetIndex(),t}return[]}setInheritedProp(e,t){this._inheritedConfig[e]=t}getLocaleRuleName(){return this._localeRuleName}getLocalizedValue(e,t,n){const r=n||this.getLocaleRuleName(),s=this?.getMetadata();let a=null;if(s){const e=s?.type;e&&!["View","Region"].includes(e)&&(a=e)}return Rp.getLocaleValue(e,t,r,a)}isNonEnglishAndAnnotated=(e,t)=>!(!e||!t)&&("en-US"!==e&&t?.startsWith(j.FIELD_LABEL_ANNOTATION));isNonExcludedComponent=e=>!!e&&!["View","Region"].includes(e);getLocalizedValueForFieldLabel(e,t,n){e?.startsWith(".")&&(e=e.substring(1));const r=n||this.getLocaleRuleName(),s=this?.getMetadata();let a=null;const o=Sp.getLocale();if(s){const t=s?.type,n=s?.config?.label??s?.config?.caption;if(this.isNonEnglishAndAnnotated(o,n)){const t=n?.split(`${j.FIELD_LABEL_ANNOTATION} `).pop(),r=t?.split("."),s=r?.[r.length-1];let o=`${s}`;const i=this.getFieldMetadata(r?.slice(1).join(".")||""),c=i?.classID||this.getValue(`.${r?.join(".")}${j.CLASS_ID}`),l=i?.definedOnClassID;return o=`${l||c}.${o}`,Rp.getLocaleValue(e,o,Rp.FIELD_LABELS_BUNDLE_KEY,a)}this.isNonExcludedComponent(t)&&(a=t)}return Rp.getLocaleValue(e,t,r,a)}getLocalizedParagraphValue(e){const t=sh(e,this.getCurrentClassID()),n=t?.definedOnClassID;return Rp.getParagraphLocaleValue(n||this.getCurrentClassID(),e)||t}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?Vh.getPropertyValue(e,this.getPageReference(),`${this._contextName}/${j.SUGGESTION}`):Vh.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)})),od(this._inheritedConfig,e))}getInheritedProps(){const e={},t={};return this._inheritedConfig.inheritedProps?.forEach((e=>{t[e.prop]=e.value})),Vh.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)),Eh({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(Nl.isPageInstruction(n))return;const r=n?.startsWith(".")?n?.substr(1):n;bl[t]=bl[t]||{},bl[t][r]||(bl[t][r]={initialValue:Ch(r,null,t)}),bl[t][r].value=e})({reference:`${this.getPageReference()}${e}`,value:t,context:this.getContextName()})}getContextDataValue(e,t){return Sh(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),Eh(Hh({context:this._contextName,data:e,rootPageReference:r}))}replaceState(e,t,n={}){const{skipDirtyValidation:r=!1}=n;Eh({type:"REPLACE_PROPERTY",payload:{reference:`${this.getPageReference()}${e}`,value:t,context:this.getContextName(),skipDirtyValidation:r}})}reportError(e,t,n){Eh(Ig(e,t||{},n))}getComponent(){return sd({getPConnect:()=>this})}createComponent(e,t,n,r){let s=this._pageReference;if(t){const e=Th(`${this.getPageReference()}.${j.SUMMARY_OF_LISTS}`,t,this._contextName);s=Vh.getContextPath(e||t,n)||t}else if(r&&r.pageReference){let e=r.pageReference;e=nn.handleAnnotation(e,this),s=Vh.getContextPath(this._pageReference,e)||""}return sd(cd({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 Vh.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,cd({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 Ql(this)}getActionsApi(){return this._actionsApi||(this._actionsApi=new Ku(this)),this._actionsApi}getActionManager(){return pn}doesContextExist(e){return wh(e??this.getContextName())}getGoogleMapsAPIKey(){return C()}getServerURL(){return I()}getLoadingStatus(e){let t=null;return e?(t=Ih(e),t=t?t.context_data:null):t=this.getDataObject().context_data,!!t&&(!!t.isLoading&&t.isLoading)}clearErrorMessages(e){e?.property?Xn({type:"error",property:e.property,pageReference:this.getPageReference(),context:this.getContextName()}):e?.context?Xn({type:"error",...e}):(Xn({type:"error",...e,context:j.APP.APP}),Xn({type:"error",...e,context:Rd(`${j.APP.APP}/${this.getContainerName()}`)}))}resolveDatasourceReference(e){return Th(`${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=dl(t);ul[e]?ul[e].fieldOrder[r]=n:ul[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();Or(r,`${t}.${e}`,{skipStateUpdate:!0});for(let e=0;e<s.length;e+=1)Sr(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=uc.getSuggestionsContext(this.getContextName()),n=this.getStateProps()?.value||e,r=Vh.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=Vh.getContextPath(this.getPageReference(),t);this._hasSuggestions=!1,uc.getSuggestionsContext(this.getContextName()).removeField(n)}}getSelfReferencingDatapageKeys(){const e=[],t=this.getPropertyName(),n=this.getFieldMetadata(t),{datasource:{parameters:r={}}={}}=n||{};return Object.values(r).forEach((n=>{const[,r]=n.split("."),s=t?.split(".").pop();r===s&&e.push(n.substring(n.lastIndexOf(".")+1))})),e}}function cd(e){const t=new id(e);return{getPConnect:()=>t}}function ld(e){sd=e}const ud=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 cd({meta:i,options:{context:c,pageReference:u||t,containerName:n,containerItemID:e,parentPageReference:t,hasForm:r||n===hd.WORKAREA||n===hd.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=Tl.isProperty(s),l=Tl.isProperty(r);if(l){const e=Tl.getPropertyName(r);i=Ch(`.${e}`,e.startsWith(".")?n:"",a)}if(i||(i=n),c){const e=Tl.getPropertyName(s);o=Ch(`.${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=Rd(e),a=md(e,t);a&&({key:r,flowName:s}=a)}t.addContainerItem({semanticURL:"",key:r,flowName:s,caseViewMode:"perform",resourceType:"ASSIGNMENT",data:e.getDataObject(n)})}},dd={defaultLimit:16},pd={SINGLE:"single",MULTIPLE:"multiple"},hd={PRIMARY:"primary",WORKAREA:"workarea",MODAL:"modal",PREVIEW:"preview"},gd=()=>yh()?.getState()?.containers,fd=e=>e?yh()?.getState().containers[e]:(At.error("getContainerData: target is the required parameter"),null),md=(e,t)=>{if(!e||!t)return null;const n=gd(),r=n?.[e];return r&&r.items&&r.items[t]||null},yd=e=>e?yh()?.getState().containers[e]?.items:(At.error("getContainerItems: target is the required parameter"),null),Ed=e=>e?yh()?.getState().containers[e]?.accessedOrder||[]:(At.error("getContainerAccessOrder: target is the required parameter"),[]),Id=e=>e?Ed(e)?.length>0||!1:(At.error("areContainerItemsPresent: target is the required parameter"),!1),Ad=(e,t,n)=>{if(!e||!t)return At.error("isContainerItemExists: target and key are required parameters"),!1;const r=gd(),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},_d=(e,t,n)=>{if(!e||!t)return At.error("getContainerItemName: target and key are required parameters"),null;const r=gd(),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},Cd=(e,t)=>{if(e&&t)for(const s of Object.keys(t))if(n=e,r=t[s].key,n?.toLowerCase()===r?.toLowerCase())return t[s];var n,r;return null},Sd=e=>{if(!e)return At.error("getContainerItemByKey: key is required parameter"),null;const t=gd()??{};for(const n of Object.keys(t))if(t[n]){const r=t[n].items??null,s=Cd(e,r);if(s)return s}return null},Td=(e,t)=>{if(!e||!t)return At.error("isContainerInitialized: context and name are required parameters"),!1;const n=gd();return n&&Object.prototype.hasOwnProperty.call(n,`${e}/${t}`)},Nd=(e,t)=>{if(!e||!t)return At.error("getContainerType: context and name are required parameters"),null;const n=gd(),r=n?.[`${e}/${t}`];return r&&r.type},Rd=e=>{if(!e)return At.error("getActiveContainerItemName: target is the required parameter"),null;let t=null;const n=gd();if(n&&n[e]){const r=n[e],{accessedOrder:s}=r;t=s&&s.length>0?s[s.length-1]:null}return t},Pd=(e,t,n)=>{if(!e||!t)return At.error("isContainerItemActive: target and key are required parameters"),!1;const r=_d(e,t,n);return!!r&&r===Rd(e)},Dd=(e,t)=>{let n=null;const r=gd();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},bd=e=>e?Dd(e,"context"):(At.error("getDataContextName: containerItemName is required parameters"),null),Od=e=>{if(!e)return At.error("getActiveContainerItemContext: target is required parameters"),null;let t=null;const n=gd();if(n&&n[e]){const r=n[e],{accessedOrder:s}=r,a=s&&s.length>0?s[s.length-1]:null;t=bd(a)}return t},vd=e=>{if(!e)return At.error("getChildContainerItems: containerItemName is required parameters"),[];const t=e.endsWith("/")?e:`${e}/`;let n=[],r=!1;const s=gd(),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:[]},xd=e=>{if(!e)return At.error("getChildContainers: containerItemName is required parameters"),[];const t=[],n=gd();for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&r.startsWith(e)&&r!==e&&t.push(r);return t},wd=e=>{if(!e)return At.error("getChildContainersContexts: parentContainerItemID is required parameters"),[];const t=[],n=gd();for(const r in n)if(Object.prototype.hasOwnProperty.call(n,r)&&r.startsWith(e)&&r!==e){(Ed(r)||[]).forEach((n=>{bd(n)!==e&&t.push(bd(n))}))}return t},Md=e=>{const t=[...wd(e),e],n=[],r=yh()?.getState().data||{};return t.forEach((e=>{Object.prototype.hasOwnProperty.call(r,`${e}/${j.SUGGESTION}`)&&n.push(`${e}/${j.SUGGESTION}`)})),n},Ld=e=>e?e&&fd(e)&&fd(e).type===pd.SINGLE:(At.error("isContainerSingleMode: target is required parameters"),null),Ud=e=>e?e&&fd(e)&&fd(e).type===pd.MULTIPLE:(At.error("isContainerMultipleMode: target is required parameters"),null),Fd=e=>e?fd(e)&&fd(e).items&&Object.keys(fd(e)?.items).length>0||!1:(At.error("hasContainerItems: target is required parameters"),!1),jd=e=>e&&dd[e]?dd[e]:dd.defaultLimit,Vd=(e,t=dd.defaultLimit)=>{e?dd[e]=t:At.error("setContainerLimit: target is required parameter")},kd=e=>{if(!e)return At.error("isContainerLimitReached: target is required parameter"),!1;let t=!1;const n=fd(e),{items:r={}}=n,s=Object.keys(r),a=jd(e);return s&&s.length>0&&s.length>=a&&(t=!0),t},$d=e=>{if(!e||!e.name||!e.context)return At.error("resetContainersPayload: containerInfo object should contain name and context"),null;const t=e?.name,n=fd(`${e?.context}/${t}`),r=Array.isArray(n?.accessedOrder)&&n?.accessedOrder.map((e=>n?.items[`${e}`]?.context))||[],s=xd(`${j.APP.APP}/${j.PREVIEW}`),a=wd(`${j.APP.APP}/${j.PREVIEW}`);return{context:e?.context,name:t,containerItems:[...r,...a],childContainers:s}},Bd=e=>{if(!e)return At.error("isContainerDirty: containerItemID is the required parameter"),!1;const t=bd(e);return Vl(t)||Jc(e)},Gd=e=>{if(!e)return At.error("getLeastRecentlyUsedNonDirtyContainerItemID: target is required parameter"),null;let t;const n=fd(e),{accessedOrder:r=[]}=n;for(let e=0;e<r.length;e+=1){const n=r[e];if(!Bd(n)){t=n;break}}return t},Wd=e=>{if(!e)return At.error("getTargetFromContainerItemID: containerItemID is the required parameter"),null;const{containers:t}=yh()?.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)},Hd=(e,t={})=>{if(!e)return At.error("closeContainerItem: containerItemID is the required parameter"),Promise.reject(new Error("closeContainerItem: containerItemID is the required parameter"));const n=Wd(e),r=bd(e),{skipDirtyCheck:s}=t;let a=!0,o=[];if(Bd(e)&&!s&&(a=window.confirm(Rp.getLocaleValue(xl,"Messages"))),a){const{accessedOrder:t=[],items:s={},type:a}=fd(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?qg({directUrlUpdation:!0,semanticURL:l,options:{containerItemID:i,context:u}}):qg({directUrlUpdation:!0,semanticURL:j.FORWARD_SLASH_STRING,options:{}});Eh(dg({containerItemID:e,context:r,target:n,containerInfo:{newAccessedOrder:o,containerType:a}}))}return Promise.resolve({newAccessedOrder:o,removeItem:a})},qd=(e,t,n,r)=>{const s="root",a=H(t,s,!0),o=yt(t,s),i={data:n,context:r?"app":a},c=[Zh({root:e,containerItemID:a,context:r?"app":a,target:o,containerName:t})];c.push(Hh(i)),Eh(c)},zd=(e,t,n)=>{let r=Ed(e);r=r.filter((e=>e!==t));let s=!1;for(let e=0;e<r.length;e+=1){if(bd(r[e])===n){s=!0;break}}return s},Yd=e=>{if(!e)return At.error("isContainerItemContextBeingUsedInOtherContainers: containerItemID is the required parameter"),!1;const t=gd(),n=bd(e),r=t?Object.keys(t):[];let s=!1;for(let t=0;t<r.length&&(s=zd(r[t],e,n),!s);t+=1);return s},Kd=e=>{Array.isArray(e)||(e=[e]);const t=gd()||{};return e.map((e=>{const n=Wd(e);return Lh.getIn(t,[n,"items",e,"transientItems"])||[]})).flat()},Xd=e=>{const{transientItemID:t,data:n,options:r}=e,s=Lh.deepClone(yh()?.getState().data[t]);r?.reset&&Lh.iterateLeafNodes(s,(e=>{"classID"!==e[e.length-1]&&Lh.setIn(s,e,"")})),Eh(tg({transientItemID:t,data:Lh.mergeDeep(n,s)}))},Jd=e=>{const{transientItemID:t,data:n}=e;Eh(rg({transientItemID:t,data:n}))},Qd=e=>{const t=Lh.deepClone(yh()?.getState().data[e]);Lh.iterateLeafNodes(t,(e=>{"classID"!==e[e.length-1]&&Lh.setIn(t,e,"")})),Eh(ng({transientItemID:e,data:t}))},Zd=e=>{const t=Lh.deepClone(yh()?.getState().data[e]);Lh.iterateLeafNodes(t,(e=>Lh.setIn(t,e,""))),Eh(sg({transientItemID:e,data:t}))};class ep{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 tp=()=>ep,np=e=>{const t={containerName:e};t.childContainers=xd(e),Eh({type:Ue,payload:t})},rp=(e,t)=>{const n=vd(e),{key:r}=md(Wd(e),e),s=[];n.forEach((e=>{const{key:n}=md(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&&Eh(s)},sp=(e,t)=>{const n=[],r={data:{caseInfo:{headers:{etag:t}}},target:Wd(e),context:e};n.push({type:fe,payload:r}),n.length&&Eh(n)},ap=()=>Sp.isPortalLoaded?"app":"root",op=()=>Wl,ip=(e,t)=>{const n={data:{caseInfo:{lastUpdateTime:t}},target:Wd(e),context:e};Eh({type:fe,payload:n})},cp=(e,t)=>{const n=_d(e,t),r=_d(`${n}/workarea`,t);return bd(r)},lp=e=>e?Dd(e,"parentContext"):(At.error("getContainerParentContext: containerItemName is required parameters"),null),up=e=>{const{accessedOrder:t}=e;return t&&t.length>0?t[t.length-1]:""},dp=e=>{if(e&&"string"==typeof e){const t=e.split("/");return t.pop(),t.join("/")}return null},pp=()=>ud,hp=/{(.*?)}/i,gp=/{(.*?)}/g,fp=e=>null!==e.match(hp),mp=e=>(e&&(e.startsWith("/")&&(e=e.substring(1,e.length)),e.endsWith("/")&&(e=e.substring(0,e.length-1))),e),yp=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`}},Ep=()=>mp(window.location.pathname),Ip=()=>mp(window.location.pathname+window.location.search),Ap=(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 _p=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=>{fp(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=()=>mp(`${this.getReqContextName()}/${this.getReqServletNameReal()}`);getReqServletNameReal=()=>`${this.reqServletNameReal}`;getAppDelimeter=()=>`${this.appDelimeter}`;getApplicationName=()=>`${this.appName}`;getApplicationAlias=()=>`${this.appAlias}`;getServletPath=()=>`${this.reqServletPath}`;getOrganizationName=()=>`${this.orgName}`;getReqContextName=()=>mp(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,""),mp(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(fp(r)){const e=r.match(gp);e?.forEach((e=>{const t=this._getDynamicKeyName(e);n[t]&&(s=s.replace(e,n[t]))}))}const a=Hg(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(Cc(t))),o=`${F.APP.APP}${j.FORWARD_SLASH_STRING}${F.PRIMARY}`,i={semanticURL:a,directUrlUpdation:!0,options:{acName:o,context:Od(o)}};Wg(i);const c=r.substring(r.lastIndexOf("-")+1),l=t.substring(t.lastIndexOf(" ")+1),u=Sp.environmentInfoObject?.pxApplication?.pyLabel;Zg(`${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&&(Lh.isEmpty(a)||Lh.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&&fp(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(gp);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],fp(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)fp(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(!fp(n))return e;const r={};if(r[t]=e,void 0!==e.payload){const t=n.match(gp);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&&fp(s)){const e=s.match(gp);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(!fp(e)&&e!==r[o]&&yp(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)=>{Ap(e,t,"warning"),Ap("Error in Generated Routing Table",null,"error"),Ap("Back | Forward for this page may NOT work as intended",null,"warning"),Ap("Bookmark | Refresh for this page may NOT work as intended",null,"warning")}},Cp=_p;const Sp=new class{constructor(){this.environmentInfoObject=null,this.isPortalLoaded=!1,this.pageName=null,this.KeyMapping={},this.isAssignmentHeaderHidden=!1,this.coexistenceMeta={appType:"",isCoexistence:!1},this.brandingInfo=null,this.cookieComplianceMethod="none",this.isExtraCallRequiredForDefaultHome="false"}setEnvironmentInfo(e){this.environmentInfoObject=e;const t=this.environmentInfoObject?.features||Lh.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 Cp.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(){Oi.setPreviewMode()}setDefaultCasePage(e){this.pageName=e}getDefaultCasePage(){return this.pageName}disableAssignmentHeader(e){this.isAssignmentHeaderHidden=e}isAssignmentHeaderDisabled(){return this.isAssignmentHeaderHidden}getDefaultPortal(){return this.environmentInfoObject?.pxOperator?.pyDefaultPortal}updateFeatureMap(e){const t=this.environmentInfoObject?.features;return this.environmentInfoObject&&e&&(this.environmentInfoObject?.features?this.environmentInfoObject.features={...t,...e}:this.environmentInfoObject.features={...e}),this.getFeatureMap()}getFeatureMap(){return this.environmentInfoObject?.features||{}}setKeyMapping(e){return this.KeyMapping=e,this.KeyMapping}getKeyMapping(e){const t=this.KeyMapping[e];return void 0!==t?t:null}setCoexistenceMeta(e){return e&&(this.coexistenceMeta=e),this.getCoexistenceMeta()}getCoexistenceMeta(){return this.coexistenceMeta}isCoexistenceAppOfType(e){return!(!this.coexistenceMeta.isCoexistence||this.coexistenceMeta.appType!==e)}getCaseTypeList(){return this.environmentInfoObject&&this.environmentInfoObject?.pyCaseTypeList||[]}getUserSettings(){return this.environmentInfoObject?.pyUserSettings||null}getAvailableLocalePacks(){return this.environmentInfoObject?.pyAvailableLocalePacks?.map((e=>e.pyLabel))||[]}getIsExtraCallRequiredForDefaultHome(){return this.isExtraCallRequiredForDefaultHome}setIsExtraCallRequiredForDefaultHome(e){this.isExtraCallRequiredForDefaultHome=e}getInactivityTimeout(){const e=this.environmentInfoObject?.pxOperator?.pyAuthenticationTimeout;return e?Number(e):e}isUnifiedObject(){return this.environmentInfoObject?.features?.isUnifiedObject||!1}getRuntime(){return"undefined"!=typeof window&&window.document?"Browser":"Native"}};const Tp=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 Np{GENERIC_BUNDLE_KEY="@BASECLASS!GENERIC!PYGENERICFIELDS";FIELD_LABELS_BUNDLE_KEY="@BASECLASS!LABEL!PYFIELDLABELS";GENERIC_BUNDLE_KEY_LP="GENERIC!GENERICFIELDS";MESSAGE_BUNDLE_KEY="@BASECLASS!MESSAGE!PYMESSAGES";BASE_CLASS="@BASECLASS";DATA_PAGE_LOCALECONTEXT="datapage";constructor(){this.localeStore={},this.getLocaleValue=this.getLocaleValue.bind(this)}setLocaleForRule=(e,t)=>{const n=e.LocaleContent||e;this.localeStore[Np.#t(t)]=n};getLocaleForRule(e=this.#n()){return this.localeStore[Np.#t(e)]}resetLocaleStore=()=>{this.localeStore={}};#r(e){return e?Np.#t(e):this.#n()}#s(e){let t=!1;return e&&"string"==typeof e&&(t=e.includes("@P ")),t}#a(e,t){return t!==this.FIELD_LABELS_BUNDLE_KEY?e?`${e}.fields`:"fields":e}getLocaleValue(e,t,n,r){n=this.#r(n);const s=this.#s(e);s&&(e=Tp.formatLocaleKey(e));const a=this.#o(e,n,t,r);return"Messages.fields"===(t=this.#a(t,n))&&"string"==typeof e?this.getLocalizedErrorMessage(a,e)||e:s?Tp.replaceWithValue(a[e]||e):a[e]||e}#o(e,t,n,r){t!==this.FIELD_LABELS_BUNDLE_KEY&&(n=n?`${n}.fields`:"fields");let s=this.localeStore[t.toUpperCase()],a=s?Lh.getIn(s,n,{}):{};return!a[e]&&r&&(s=this.localeStore[this.#n().toUpperCase()],a=s?Lh.getIn(s,`${r}.${n}`,{}):{}),a}#n(){return void 0===Sp.getFeatureMap()?.localizationVersion?this.GENERIC_BUNDLE_KEY:this.GENERIC_BUNDLE_KEY_LP}getParagraphLocaleValue(e,t){const n=`${e}!${j.PARAGRAPH}!${t}`,r=this.localeStore[n.toUpperCase()];return r?{category:r.category,content: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!${Sp.getPortalName()}`.toUpperCase()}getCaseLocaleReference(e){return e?`CASE!${e}`.toUpperCase():null}getLocalizationVersion(){return Sp.getFeatureMap().localizationVersion||1}async getLocaleJsons(e){if(!await this.isCurrentLocalePackAvailable())return[];const t=Sp.getUseLocale(),n=[],r=PCore.getLocaleUtils().localeStore;if((e=(e=e.filter((e=>!r[Np.#t(e)]))).map((e=>e.toUpperCase()))).length>0){const r=e.map((e=>({localeRuleKey:e,promise:jr.getSvcLocale(t,`${e}.json`)}))),s=await Promise.allSettled(r.map((e=>e.promise)));await Promise.all(s.map((async(e,t)=>{if("fulfilled"===e.status&&null!==e.value){const s=r[t];let a;try{a=await e.value.json()}catch{a=null}a&&n.push({localeRuleKey:s.localeRuleKey,jsonData:a})}})))}return n}async loadLocaleResources(e){const t=Sp.getUseLocale(),n=Sp.getBaseLocale();if(Sp&&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=Sp.getLocale();return this.availableLangPacks?.length||(this.availableLangPacks=Sp.getAvailableLocalePacks()),e&&this.availableLangPacks.includes(e)}static#t(e){if(!e)return e;const t=e.indexOf("!CASE!");return-1===t?e:`CASE!${e.substring(0,t)}`}getCaseTypeLocaleReferences(){return Sp.getCaseTypeList().map((e=>`${e.pyWorkTypeImplementationClassName}!CASE!${e.pyWorkTypeName}`.toUpperCase()))}}const Rp=new Np;const Pp=class{static getParagraphStream(e,t,n){return((e,t,n)=>{if(!e)return e;const r=(new DOMParser).parseFromString(e,"text/html"),s=r.querySelectorAll("pega-reference");for(const e of s){const n=e.getAttribute("data-rule-id");if(n){const s=t.getValue(n),a=r.createTextNode(s??"");e.replaceWith(a),t.registerAdditionalProps({[n]:`@P ${n}`})}else e.replaceWith("")}let a;return a="simple"===n?r?.body?.textContent||"":r?.body?.innerHTML||"",/^(<p>)\s*(<\/p>)$/.test(a)?null:a})(e,t,n)}};tn.registerHandler("@L",((e,t)=>t.getLocalizedValue(e))),tn.registerHandler("@P",((e,t,n)=>t?t.getValue(e):Vh.getLitePropertyValue(n))),tn.registerHandler("@E",((e,t,n)=>{try{const r=$t(e),s=Bt(r);return Gt(s,t,n)}catch(e){}return!0})),tn.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=Sh(t,`.${j.SUMMARY_OF_WHEN_CONDITIONS}.${e}`,s)}return!0===r||"true"===r})),tn.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=nn.getPropertyName(e?.propertyForDisplayText??""),r=nn.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=nn.getPropertyName(n?.datasource?.propertyForDisplayText),p=nn.getPropertyName(n?.datasource?.propertyForValue),h=Array.isArray(n?.datasource?.parameters)?n?.datasource?.parameters:[],g=t.getContextName(),f=[];if(h.forEach((e=>{if(nn.isProperty(e?.value)){let t=Ch(`.${Lh.getFullPropertyReference([a,nn.getPropertyName(e.value)])}`,o,g);f.push(Lh.getFullPropertyReference([o,a,nn.getPropertyName(e?.value)])),null!=t&&""!==t||(t=j.NULL_STRING),r.push(t)}else r.push(e?.value||j.NULL_STRING)})),g){const e=Zt.getContextObjectByName(g)||{};f.forEach((t=>{if(t in e){const n=e[t];e[t]=[...new Set([...n,s])]}else e[t]=[s]})),Zt.addContextName(g,e)}const m=function(e,t,n,r){let s="",a=n;if(t.join(j.HASH_DELIMITER)&&(s=Lh.getHashedString(t.join(j.HASH_DELIMITER)),a=n+j.UNDERSCORE_STRING+s),r){const e=Ah(),t=e?e[n]?.[a]:{};return Array.isArray(t?.pxResults)?t.pxResults:[]}const o=e.getDataObject(),i=o?.[n]||{},c=i?.[a]||{};return Array.isArray(c?.pxResults)?c.pxResults:[]}(t,r,l,c);return m.map((e=>({key:e[p]||e[`.${p}`],value:e[d]||e[`.${d}`]})))})),tn.registerHandler("@ROUTING_INFO",((e,t)=>Et(t.getContainerName(),t.getContextName()))),tn.registerHandler("@ENV",((e,t)=>{switch(e){case j.ENV_INFO_KEYS.APPLICATION_NAME:return Sp.getApplicationName();case j.ENV_INFO_KEYS.ACCESS_GROUP:return Sp.getAccessGroup();case j.ENV_INFO_KEYS.USER_NAME:return Sp.getOperatorName();case j.ENV_INFO_KEYS.USER_ID:return Sp.getOperatorIdentifier();case j.ENV_INFO_KEYS.APPLICATION_DESC:return t.getLocalizedValue(Sp.getApplicationLabel()||"");case j.ENV_INFO_KEYS.USER_IMAGE:return Sp.getOperatorImageInsKey();case j.ENV_INFO_KEYS.LOCALE:return Sp.getUseLocale();case j.ENV_INFO_KEYS.TIMEZONE:return Sp.getTimeZone();case j.ENV_INFO_KEYS.WORK_GROUP:return Sp.getOperatorWorkGroup();default:return e}})),tn.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=nn.getPropertyName(e);r[t]=n[t]})):Object.keys(e).forEach((t=>{const s=nn.getPropertyName(e[t]);r[t]=n[s]})),a.push(r)})),a}return[]})),tn.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})),tn.registerHandler("@USER",((e,t,n={})=>{const r=t?.getValue(e)||Vh.getLitePropertyValue(n,e),s=t?.getReferencedUser(r)||Vh.getReferencedUser(r,n);return{userId:r,userName:s?s.UserName:null}})),tn.registerHandler("@ACTIVE_CASES",((e,t)=>Qu.getOpenedCaseItems(`${t.getContextName()}/${t.getContainerName()}`))),tn.registerHandler("@LR",(e=>e)),tn.registerHandler("@CASE",((e,t)=>e===j.ID?t.getCaseInfo().getKey():e)),tn.registerHandler("@SHARED",(e=>uc.getSharedState(e))),tn.registerHandler("@PARAGRAPH",((e,t)=>{const n=t.getLocalizedParagraphValue(e),r=n?.content?n.content:null,s=n?.category?n.category:null;return r?Pp.getParagraphStream(r,t,s):null})),tn.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 Lh.isEmpty(a)?o=t.getValue(`.${n}`):(o=a,o=Lh.getIn(o,n)),o&&r.length>0?(s&&(o=o.filter((e=>Wt(s,e)))),o.map((e=>Lh.getIn(e,r)))):null})),tn.registerHandler("@ADDRESS",((e,t)=>{const n=t.getValue(e)?.pyCountry;return n?`pyAddressForm_${n}`:"pyAddressForm"})),tn.registerHandler("@DATATYPE",((e,t)=>t.getValue(e)));const Dp="downloadAttachment",bp={},Op=e=>{const t=Hi();return bp[e]=t,t},vp=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},xp=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:vp(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)}}},wp={uploadAttachment:(e,t,n,r,s)=>{const a=new FormData;a.append("appendUniqueIdToFileName",!0),a.append("file",e),s&&a.append("contextID",s);const{restApi:o,reqType:i}=Vg("uploadAttachment",{});return Bi(o,{method:i,headers:{"Content-Type":"multipart/form-data"},body:a,onUploadProgress:t,signal:Op(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(qi,e):e=>{throw e.isHandled=!1,e}).finally((()=>delete bp[e.ID]))},linkAttachmentsToCase:(e,t,n,r)=>{const s={};if("File"===n){const[e]=t,{clientFileID:n}=e;delete e.clientFileID,s.signal=Op(n).token}const{restApi:a,reqType:o}=Vg("linkCaseAttachment",{caseID:e});return Bi(a,{...s,body:{attachments:t},method:o},r)},getCaseAttachments:(e,t,n=!1)=>{const{restApi:r,reqType:s}=Vg("getCaseAttachments",{caseID:e,includeThumbnail:n});return Bi(r,{method:s},t).then((e=>e.data.attachments))},getAttachmentCategories:(e,t,n)=>{const{restApi:r,reqType:s}=Vg("getAttachmentCategories",{caseID:e,type:t});return Bi(r,{method:s},n).then((e=>e.data))},downloadAttachment:(e,t,n)=>{const{restApi:r,reqType:s}=Vg(Dp,{attachmentID:e});return Bi(r,{method:s,..."binary"===n&&{responseType:"arraybuffer"}},t)},editAttachment:(e,t,n)=>{const{restApi:r,reqType:s}=Vg("editAttachment",{attachmentID:e});return Bi(r,{method:s,body:{...t}},n)},deleteAttachment:(e,t)=>{const{restApi:n,reqType:r}=Vg("deleteAttachment",{attachmentID:e});return Bi(n,{method:r},t)},downloadDocument:(e,t)=>{const{restApi:n,reqType:r}=Vg("downloadDocument",{documentID:e});return Bi(n,{method:r},t)},deleteDocument:(e,t,n)=>{const{restApi:r,reqType:s}=Vg("deleteDocument",{caseID:e,documentID:t});return Bi(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=>{bp[e]&&(bp[e].cancel(),delete bp[e])},buildFilePropsFromResponse:xp,getAttachmentURL:e=>{const{restApi:t}=Vg(Dp,{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=>xp(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(xp)}else t=[];return{hasUploadedFiles:t.length>0,categoryName:e?.pyCategoryName||t?.[0]?.responseProps?.category||"",attachments:t}}};tn.registerHandler("@ATTACHMENT",((e,t,n)=>{let r;return r=t?t.getValue(e):Vh.getLitePropertyValue(n),wp.prepareAttachmentData(r)})),tn.registerHandler("@FL",((e,t)=>t.getLocalizedValueForFieldLabel(t.getFieldMetadata(e)?.label))),tn.registerHandler("@GENAICOACH",((e,t)=>ah(e,t.getCurrentClassID()))),tn.registerHandler("@REFRESH",((e,t)=>{const n=t.getCaseInfo().getKey(),r=t.getContextName(),s=t.getPageReference();Pl.registerForRefresh("PROP_CHANGE",t.getActionsApi().refreshCaseView.bind(t.getActionsApi(),n,"",s,{autoDetectRefresh:!0,preserveClientChanges:!1,refreshFor:!0}),`${s}${e}`,`${r}/${s}`,r)}));const Mp={},Lp={},Up={},Fp={},jp={},Vp={},kp={},$p={},Bp={},Gp={},Wp=(e={},t={})=>{0!==Object.keys(t).length?Object.keys(e).forEach((n=>{const r=e[n],s=t[n];if(s){const e=Array.isArray(s)?s:[s];(Array.isArray(r)?r:[r]).forEach((t=>{const n=e.findIndex((e=>e.classID===t.classID));if(-1===n)e.push(t);else{const r={isDeclarativeTarget:!1},s={...e[n],...r,...t};e[n]=s}})),t[n]=1===e.length?e[0]:e}else t[n]=r})):Lh.copy(e,t)},Hp=(e,t="")=>{if(!e)return null;const n=Fp[e];if(!n)return null;if(!t)return Lh.deepClone(n);let r;return r=Array.isArray(n)?n.find((e=>e.classID.toLowerCase()===t.toLowerCase()))||null:n.classID.toLowerCase()===t.toLowerCase()||("Page"===n.type||"Page List"===n.type)&&n?.pageClass?.toLowerCase()===t.toLowerCase()?n:null,r?Lh.deepClone(r):null},qp=(e,t,n,r=[])=>{if(!t||!e)return null;if(!e.includes(".")){let s;const a=Hp(e,t);return r.length&&(s=r.join(".")),{...a,embeddedType:n,category:s}}const[s,...a]=e.split("."),o=Hp(s,t);return o&&r.push(o.label),qp(a.join("."),o?.pageClass,o?.type,r)},zp=e=>{Wp(e,Lp)},Yp=e=>{Wp(e,Up)},Kp=e=>{if(e.views&&Wp(e.views,Lp),e.navigations&&Wp(e.navigations,Up),e.personalizations&&Wp(e.personalizations,Vp),e.insights&&Wp(e.insights,kp),e.paragraphs&&Wp(e.paragraphs,Mp),e.dataTypes&&Wp(e.dataTypes,$p),e.datapages&&Wp(e.datapages,Bp),e.genAICoaches&&Wp(e.genAICoaches,Gp),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=>{jp[e]=t[e]}))}Wp(e.fields,Fp)},Xp=e=>Lp[e],Jp=(e,t)=>{const n=Lp[e];return Array.isArray(n)?n.some((e=>e.classID===t)):n?.classID===t},Qp=e=>Up[e],Zp=e=>e in jp?jp[e]:null,eh=e=>e in Vp?Vp[e]:null,th=e=>e in kp?kp[e]:null,nh=e=>{const t={};return Object.keys(Fp).forEach((n=>{const r=Fp[n];let s;Array.isArray(r)?s=r.find((t=>e===t.classID)):e===r.classID&&(s=r),s&&(t[n]=Lh.deepClone(s))})),t},rh=(e,t)=>{const n=Hp(e,t)?.datasource?.parameters;return n?Lh.deepClone(n):null},sh=(e,t)=>{let n=null;const r=Mp[e];return r&&(Array.isArray(r)?n=r.find((e=>e.classID===t)):r.classID===t&&(n=r)),n?Lh.deepClone(n):null},ah=(e,t)=>{let n=null;const r=Gp[e];return r&&(Array.isArray(r)?n=r.find((e=>e.classID===t)):r.classID===t&&(n=r)),n?Lh.deepClone(n):null},oh=e=>{if(e in $p){const{savableDataPage:t}=$p[e];return t}return null},ih=e=>{const t=Bp[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=$p[n];return a?a.classKeys.map((e=>({keyName:e,isAlternateKeyStorage:r}))):[]},ch=e=>{if(e in $p){const{lookupDataPage:t}=$p[e];return t}return null},lh=e=>{if(Object.prototype.hasOwnProperty.call($p,e)){const{lookupDataPageInfo:t}=$p[e];return t}return null},uh=(e,t)=>{const n=e.split("."),r=n.pop(),s=new id({options:{pageReference:`${n.join(".")}`,context:t}}),a=Hp(r,s.getCurrentClassID())?.additionalInformation;if(!a?.includes("@PARAGRAPH"))return a;const o=nn.trimAnnotation(a),i=s.getCurrentClassID(),c=sh(o,i),l=c?.definedOnClassID,u=Rp.getParagraphLocaleValue(l||i,o),d=u?.content,p=u?.category;return d?Pp.getParagraphStream(d,s,p):c?.content?Pp.getParagraphStream(c.content,s,p):null},dh=(e,t)=>{const n=e.split("."),r=n.pop(),s=new id({options:{pageReference:`${n.join(".")}`,context:t}}),a=Hp(r,s.getCurrentClassID()),o={};return s._classID=s.getCurrentClassID(),s.resolveConfigProps(a,o),o};class ph{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=Lh.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=Lh.getFullPropertyReference([i,t]),t in o){const e=o[t];Lh.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=Ch(n,t,e);a.previousValue="object"==typeof o?null:o}}))}registerListField(e,t,n,r,s){const a=ph._getFieldsForList(e,t,n);a.length>0&&(this.registerFields(e,t,a,r,s),Eu.enableCascade(e))}unRegisterListField(e,t,n,r){const s=ph._getFieldsForList(e,t,n);s.length>0&&this.unRegisterFields(e,t,s,r)}static _getFieldsForList(e,t,n){const r=[],s=Hp(n,Ch("classID",t,e));return s&&!Array.isArray(s)&&s.datasource&&s.datasource.parameters&&Object.values(s.datasource.parameters).forEach((e=>{if(nn.isProperty(e)){const t=nn.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=Ch(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=Ch(t,"",e);n(e,t,r)}))}))}_updateChangedProperties(e,t,n,r,s,a,o,i){const c=n&&i.some((e=>r.startsWith(e)));if(e!==t||c){const e=r.lastIndexOf("."),t=r.substring(0,e),i=r.substring(e),c=nr.getMessages({type:"error",property:i,context:s,pageReference:t});if(c?.length>0&&o.push(r),!n)return;a.push(r)}}isChangedListPropertyExist(e){let t=!0;return 0!==this.listChangeSubscribers.length&&Lh.isValidPageListProperty(e)||(t=!1),t}_getServerProperties(e,t,n,r,s,a,o){if("object"!=typeof e){s.push(n.replace(/\.(\d+)/g,"[$1]"));const i=this.isChangedListPropertyExist(n);n=n.replace(/\.(\d+)/g,"[$1]");const c=Ch(n,"",t);if(void 0===c&&!e&&0!==e)return;return void this._updateChangedProperties(c,e,i,n,t,r,a,o)}const i=Object.keys(e??{});for(let c=0,l=i.length;c<l;c+=1){const l=i[c],u=`${n}.${l}`;if(Array.isArray(e[l])){const n=Ch(u,"",t);n&&n?.length===e[l].length||o.push(u.replace(/\.(\d+)/g,"[$1]"))}this._getServerProperties(e[l],t,u,r,s,a,o)}}getServerProperties(e,t,n=j.CASE_INFO.CASE_INFO_CONTENT){const r=[],s=[],a=[],o=Lh.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 hh=new ph;let gh=null;const fh=e=>e?.split(/\.(?![^[]+\])|\[|\]/g).filter(Boolean),mh=e=>{gh=e},yh=()=>gh,Eh=e=>{if(!e)return;let t=[],n=[],r=[];Array.isArray(e)||"MERGE_DATA"!==e.type||({changedListProperty:t,leafProperty:n,changedPropertyWithError:r}=hh.getServerProperties(e.payload.data,e.payload.context,e.payload.rootPageReference)),yh()?.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);nr.clearMessages({type:"error",property:s,pageReference:r,context:e.payload.context});const a=bn.getFieldReferenceForProperty(e.payload.context,t);if(a){const e=Vh.resolveContextTreeNodeProps(a.props);Mr.validate(e.componentName?.toLowerCase(),e.propertyName,Vh.getLitePropertyValue(e,e.propertyName),e)}})),hh.handleServerChanges(e.payload.context,t,n))},Ih=e=>yh()?.getState().data?.[e],Ah=()=>yh()?.getState().data[j.SHARED],_h=(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=fh(s);return Lh.getIn(n,a)},Ch=(e,t,n)=>_h(e,t,Ih(n)),Sh=(e,t,n)=>_h(t,e?`${j.CONTEXT_DATA}.${e}`:`${j.CONTEXT_DATA}`,Ih(n)),Th=(e,t,n)=>((e,t,n)=>{const r=fh(`${t}.${n}`);return Lh.getIn(e,r)})(Ih(n),`${j.CONTEXT_DATA}.${e}`,t),Nh=e=>{const{context:t}=e,n=yh()?.getState().data[t];if(n)return de;const{action:r}=e;return["createWork","showHarness","openAssignment","openWorkByHandle","initRouting"].includes(r)?Ce:de},Rh=(e,t)=>{const n=fh(t);return Lh.deleteIn(e,n)},Ph=e=>!Array.isArray(e)&&"object"==typeof e,Dh=(e,t)=>{Array.isArray(t)&&t.length>0&&t.forEach((t=>{t.allowMultiple?t.allowMultiple&&Lh.setIn(e,t.path,[]):Lh.setIn(e,t.path,{})}))},bh=(e,t,n={})=>{const{isArrayDeepMerge:r,propertiesToReplace:s=[]}=n;Array.isArray(e)&&!t&&(t=[]),Dh(e,s);const a=(e,t)=>{if(Ph(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)},Oh=(e,t,n,r={isArrayDeepMerge:!0})=>{const{isArrayDeepMerge:s}=r,a=fh(t);if("object"==typeof n){const t=bh(Lh.getIn(e,a),n,{isArrayDeepMerge:s});return Lh.setIn(e,a,t)}return Lh.setIn(e,a,n)},vh=(e,t,n)=>{const r=fh(t);return Lh.setIn(e,r,n)},xh=()=>{const e=et,{promise:t,actionMgrID:n}=pn.actionManagerPromise(e);return Eh({type:e,payload:{actionMgrID:n}}),t},wh=e=>{const t=yh()?.getState();return!!t?.data?.[e]};class Mh{static mergeDeep(e,t){return w()(t,e)}static hasIn(e,t){return P()(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=nn.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=nn.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)?[]:{}),bh(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]]&&Mh.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)=>{Mh.flatten(e,`${t}[${r}]`,n)})):"object"==typeof e&&null!==e?Object.keys(e).forEach((r=>{const s=t?`${t}.${r}`:r;Mh.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 Gn.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&&pn.rejectActionByID(e.payload.actionMgrID))),!0}static isValidAnnotation(e){const t=new Set(["@DATASOURCE","@ACTIVE_CASES","@ADDRESS","@ASSOCIATED","@ATTACHMENT","@CASE","@FILTERED_LIST","@PARAGRAPH","@P","@ROUTING_INFO","@USER","@W","@E","@SHARED"]),n=e.indexOf(" "),r=e.substring(0,n);return t.has(r)}static trimDotForProperty(e){return"string"==typeof e&&e.startsWith(".")?e.substring(1):e}static convertObjectWithStringToBoolean(e){if(e&&!Array.isArray(e)&&"object"==typeof e)return Object.keys(e).forEach((t=>{let n;const r=e[t];n="string"==typeof r?"true"===r||"false"!==r&&r:r,e[t]=n})),e}static isValidPageListProperty(e){return!!e&&/^(?!.*\.\.)(?!\d)\w+(\.\w+)*\.\d+(\.\w+)+$/.test(e)}}const Lh=Mh,Uh=j.SUMMARY_OF_LISTS,Fh=j.SUMMARY_OF_WHEN_CONDITIONS;class jh{static updateData(e){Object.keys(e).forEach((t=>{Eh(Hh({context:t,data:e[t]}))}))}static updateContextData(e){Object.keys(e).forEach((t=>{Eh(Hh({context:t,data:e[t]}))}))}static resolveWhen(e,t){return!!t.getContextDataValue(`.${Fh}.${e}`)}static resolveFieldValue(e,t){return t.getLocalizedValue(e)}static resolveNavigation(e,t){return Qp([this.resolveName(e,t)])}static resolveView(e,t,n=""){const r=Xp([this.resolveName(e,t)]);let s=[];if(Array.isArray(r)&&r.length>0){if(t&&r.length>1){if(n||(n=t.getValue(j.CLASS_ID)),!n)return;s=r.filter((e=>e[j.CLASSID]===n))}return 0===s.length?r[0]:s[0]}return r}static resolveName(e,t){return e&&"string"==typeof e&&e.startsWith("param.")?(e=e.substring(6),t.getContextDataValue(`.$parameters.${e}`)):(e&&"string"==typeof e&&e.startsWith("@")&&(e=nn.handleAnnotation(e,t)),e)}static getContextPath(e,t){return("number"==typeof t||t)&&("number"==typeof(t=nn.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;if(t)r=t.startsWith(j.CLASS_ANNOTATION)?t.split(j.CLASS_ANNOTATION)[1].trim():this.resolveClassID(t,e.getPageReference(),e.getContextName());else if(n?.authorContext){const t=e.getFieldMetadata(n.authorContext);if(t){r="manual"===t.dataRetrievalType?t.classID:t.pageClass}r||(r=n.ruleClass)}return r}static resolveReference(e,t){const{type:n}=e;let r;if("reference"===n){const{config:n}=e,s=n?.type,{ref:a,name:o,context:i}=n||{},c=this.getRuleClass(t,i,n);return"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 Ch(t,e,n)}static getProperty(e,t,n){let r=this.resolvePropertyReference(t,e,n);if(null==r||0===r.length){const s=Th(`${t}.${Uh}`,e,n);s&&(r=this.resolvePropertyReference(t,s,n))}return r}static getPropertyValue(e,t,n){return e=nn.trimAnnotation(e),this.getProperty(e,t,n)}static getReferencedUser(e,t){const n=jh.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?jh.getPropertyValue(i,a,`${o}/${j.SUGGESTION}`):jh.getPropertyValue(i,a,o)}static _handlePropString(e,t,n,r,s){n.startsWith("@")?e[t]=nn.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?(Lh.mergeDeep(e,t),this._resolveProps(t,n,void 0),t):t}static resolveContextTreeNodeProps(e){const t={};return e?(Lh.mergeDeep(e,t),this._resolveProps(t,void 0,e),Lh.resolveStringBooleans(t)):t}static resolveClassID(e,t,n){const r=nn.trimAnnotation(e);let s;for(s=r.startsWith(".")?`${t}${r}`:`${r}`;s;){const e=Ch(j.CLASS_ID,s,n);if(e)return e;s=s.substring(0,s.lastIndexOf("."))}return null}}const Vh=jh;const kh=new class{constructor(){this.actionHandlers={}}getHandler(e){return this.actionHandlers[e]}registerHandler(e,t){this.actionHandlers[e]=t}};const $h=class{static#i=[];static#c=!1;static getActionHandlers=(e,t,n)=>{const r=[];return{mouseenter:"hover",change:"onChange",blur:"onBlur"}[n]!==t||e.forEach((e=>{const t=kh.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#l=(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.#i.push(a)}};static buildActionObject=(e,t)=>{const n={...e};return n.context="Browser"===Sp.getRuntime()?t.getContextName():n.context,n.pageReference=t.getPageReference(),n.actionMgrID=pn.getNextActionMgrId(),n};static#u=e=>{const t=e.actionHandler,n=e.component,{config:r}=e,s={};Vh.resolveProps(r,s,n),t&&(t(e.eventType,s,n),this.#d())};static#d=()=>{if(!this.#c){if(0===this.#i.length)return;const e=this.#i.shift();this.#u(e),e.config&&"true"===e.config.parallel&&this.#i.length>0&&this.#d()}};static#p=()=>{this.#d()};static#h=(e,t,n)=>{this.#l(e,t,n),this.#p()};static getFullRef=e=>{const t=e.getPageReference(),n=e.getComponentConfig().value;return Vh.getContextPath(t,n)};static#g(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.#h(n,e,t)}}}static changeHandler=(e,t)=>{const n=e.getStateProps().value,r=e.getContextName();Xn({type:F.MESSAGES.MESSAGES_TYPE_ERROR,property:n,pageReference:e.getPageReference(),context:r});if(("Browser"===Sp.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);Eh({type:Q,payload:{reference:a,value:s,context:r}}),void 0!==n&&this.isEditable(n)&&!this.isNonKeyInput(n)||Eh({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];Eh({type:Q,payload:{reference:Vh.getContextPath(n,a),value:o,context:r}}),Eh({type:ee,payload:{reference:Vh.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&&Xn({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)&&Eh({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.#g(e,n)};static pause=()=>{this.#c=!0};static resume=()=>{this.#c=!1,this.#d()};static isQueueEmpty=()=>0===this.#i.length;static clearQueue=()=>{this.#i=[]};static getActionsQueue=()=>this.#i;static EVENTS_MAP={click:"onClick",change:"onChange",hover:"onMouseEnter",blur:"onBlur"}},Bh="CREATE_WORK",Gh=e=>({type:Bh,payload:e});const Wh=(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])?[]:{}),Wh(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)},Hh=(e,t={})=>{const{serverPrecedenceFields:n=[],propertiesToReplace:r=[]}=t,{context:s,data:a,isArrayDeepMerge:o,preserveClientChanges:i=!1}=e,c=Ml(s,!0),l=Ih(s);let u={};if(l&&a){u=JSON.parse(JSON.stringify(l));const e=JSON.parse(JSON.stringify(a)),t=new Set;Wh(c,u,t),((e,t,n)=>{const r=new Set;e.forEach((e=>{e=Lh.trimDotForProperty(e);const[s,a,o]=yn(e);s&&a&&o&&!r.has(`${s}.${a}`)&&((Lh.getIn(n,`${s}.${a}`)||[]).forEach(((e,n)=>{n!==+o&&Lh.setIn(t,`${s}.${a}[${n}]`,e)})),r.add(`${s}.${a}`))}))})(t,u,e)}!function(e,t){const n=Lh.getIn(e,j.REFERENCED_USERS);let r;if(void 0!==n){if(!Array.isArray(n)&&"object"==typeof n)return r=Lh.getIn(t,j.REFERENCED_USERS,{}),void Lh.setIn(e,j.REFERENCED_USERS,{...r,...n});r=Lh.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=>{Lh.deleteIn(d,`caseInfo.content.${e}`)})),p=bh(a,d,{isArrayDeepMerge:!o})):((e,t)=>{const n=bl[e]||{};Object.keys(n).forEach((e=>{Lh.hasIn(t,e)&&(n[e].value=Lh.getIn(t,e))}));let r=ll.getStateMachinesByContext(e)||{};r={...r,...ll.getUnConnectedStateMachines(e)||{}},Object.keys(r).forEach((n=>{if(Lh.hasIn(t,n)){const r=Lh.getIn(t,n);r&&Array.isArray(r)&&0===r.length&&ll.setStateMachineEmpty(e,n)}}))})(s,a),{type:fe,payload:{...e,data:p,...r.length>0?{propertiesToReplace:r}:null}}},qh=e=>({type:"SHOW_HARNESS",payload:e}),zh=e=>({type:te,payload:e}),Yh=e=>({type:ne,payload:e}),Kh=e=>({type:"ADD_WORK",payload:e}),Xh=e=>({type:ue,payload:e}),Jh=e=>({type:Ae,payload:e}),Qh=e=>({type:_e,payload:e}),Zh=e=>({type:Ce,payload:e}),eg=e=>({type:Te,payload:e}),tg=e=>({type:Ne,payload:e}),ng=e=>({type:De,payload:e}),rg=e=>({type:Oe,payload:e}),sg=e=>({type:be,payload:e}),ag=e=>{const{containerItemID:t}=e;e.suggestionContexts=Md(t);const n=e?.data?.caseInfo?.content,r=Object.keys(n||{}).length>0;return e.propertiesToReplace=r?Uc.getPropertiesToReplace(t):[],{type:xe,payload:e}},og=e=>{const{context:t}=e;return{type:oe,payload:{context:t}}},ig=e=>{const{context:t}=e;return{type:ie,payload:{context:t}}},cg=e=>({type:we,payload:e}),lg=e=>({type:ve,payload:e}),ug=e=>({type:Qe,payload:e}),dg=e=>{const{context:t,containerItemID:n}=e;let r=t;return r||(r=bd(n)),e.context=r,e.deleteContext=!Yd(n),e.childContainers=xd(n),e.childContainersContexts=wd(n),e.transientItems=Kd([...e.childContainersContexts,n]),e.suggestionContexts=Md(n),n===t&&(e.caseID=Ch(j.CASE_INFO.CASE_INFO_ID,"",t),e.RemoteSystemID=Ch(j.CASE_INFO.REMOTESYSTEMID,"",t)),{type:Se,payload:e}},pg=e=>{const{containerItemID:t}=e;return e.transientItems=Kd([...wd(t),t]),{type:Pe,payload:e}},hg=e=>{const{transientItemID:t}=e;return e.transientItems=[t],{type:Re,payload:e}},gg=e=>{const{context:t,containerItemID:n}=e;let r=t;return r||(r=bd(n)),e.context=r,e.childContainers=xd(n),e.childContainersContexts=wd(n),e.transientItems=Kd([...e.childContainersContexts,n]),e.suggestionContexts=Md(n),n===t&&(e.caseID=Ch(j.CASE_INFO.CASE_INFO_ID,"",t),e.RemoteSystemID=Ch(j.CASE_INFO.REMOTESYSTEMID,"",t)),{type:Me,payload:e}},fg=e=>({type:pe,payload:e}),mg=e=>({type:ge,payload:e}),yg=e=>({type:Ee,payload:e}),Eg=(e,...t)=>($h.resume(),e(...t)),Ig=(e,t,n,r,s)=>({type:Ie,payload:{msg:e,err:t,context:n,formFields:r,actionMgrID:s}}),Ag=e=>({type:nt,payload:e}),_g=e=>({type:rt,payload:e}),Cg=e=>({type:st,payload:e}),Sg=e=>({type:"SHOW_CASE_PREVIEW",payload:e}),Tg=e=>({type:ce,payload:e}),Ng=e=>({type:Q,payload:e}),Rg=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},Pg=(e,t)=>e.includes("/assignments")?((e,t)=>{const n=e.split("/"),r=n.indexOf("assignments"),s=n.slice(r-2).join("/"),a=n[n.length-1],o=jg(Ge,{assignmentID:a});return{routeEndpoint:o?.restApi,requestType:o?.reqType,payload:{assignmentID:a},options:t,routeKey:Je,urlPath:s}})(e,t):Cp.getEndPointInfo(e),Dg="add",bg="replace",Og=["portal","noPortal","preview","debug","devtool"];let vg="",xg="Home",wg="",Mg=!0;const Lg=e=>(Mg=e,Mg),Ug=()=>Mg,Fg=(e,t,n)=>Cp.getSemanticURL(e,t,n),jg=(e,t)=>Cp.getRestEndPoint(e,t),Vg=(e,t)=>{let n=I();const r=jg(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):{}},kg=(e,t,n)=>{const{root:r,resources:s}=e,{views:a}=s,{config:o}=r,i=Dg;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(gp);if(l){const e=Lh.getIn(t,o.context);c=c.replace(l[0],e.pyID)}return c.startsWith("/")&&(c=c.substring(1,c.length)),{pxURLPath:c,historyAction:i}},$g=(e,t,n)=>{let r,s;r=mp(t)?`${e}/${t}`:e;const a=mp(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()!==xg.toLowerCase()||c.has("noPortal")||(r=`${e}/${t}`),!Cp.isDefaultPortal()){const e=Cp.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)&&Og.includes(n)&&e.append(n,r);return e})(s,c),s.toString()&&(r+=`?${s.toString()}`),r},Bg=(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&&fp(t.pxURLPath)?kg(n,r,t.pxURLPath):t||kg(n,r),o=Cp.getEndPointInfo(a.pxURLPath),a.pxURLPath=o.urlPath}const c=$g(vg,Cp.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:Cp.getApplicationName()),n===`${vg}/${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]}`}})(wg,Cp.getApplicationPath(),c),u=((e,t)=>(void 0!==e&&(e.options=t),{stateObj:e}))(o,{...i,title:l});a.historyAction===Dg?((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===bg&&((e,t,n)=>{try{window.history.replaceState(e,t,n)}catch(e){throw new Error("Error- Unable to Replace Browser History")}})(u,l,c)},Gg=e=>{let t=null;e.directUrlUpdation&&(t={historyAction:Dg,pxURLPath:""},t.pxURLPath=e.semanticURL),Bg(e,{urlPathObjParam:t,infoParam:null,optionsParam:null},!1)},Wg=e=>{Gg(e)},Hg=e=>{const t={pxURLPath:e};return $g(vg,Cp.getApplicationPath(),t)},qg=e=>{const{uiResources:t}=e;Ug()&&(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))&&Gg(e)},zg=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},Yg=(e,t,n)=>{const{caseClassName:r,workID:s}=e.payload,{containerName:a,context:o}=t,{RemoteClassGroup:i,RemoteSystemID:c,name:l}=$.getRemoteCase(r),d={...e,headers:{RemoteSystemID:c},className:r,isTraditionalRemoteCase:!0,action:mt,viewName:V,gadgetId:Uc.getUniqueGadgetId(),context:n??o,skipSemanticUrl:!0,insKey:`${i?.toUpperCase()} ${s}`,containerName:a,name:l};Eh(u.showPage(d))},Kg=e=>{const t=(e=>e.state?e.state.stateObj:null)(e);t&&($.isTraditionalRemoteCase(t.payload?.caseClassName)?Yg({...t},t.options):Eh(u.showHistory(zg(t))))},Xg=()=>Cp.getApplicationPath()!==Ep(),Jg=e=>{const{acName:t,context:n,defaultViewLabel:r}=e,s=(e=>{const t=Cp.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=>{xg=e})(s),Cp.setDefaultRoute(s);const a=H(t,n),o=yt(t,n),i="true"===Sp.getIsExtraCallRequiredForDefaultHome(),c={historyAction:bg,pxURLPath:""};let l;const d={acName:o,context:a,actionConfig:{context:a}};if(i||!i&&Xg()){const t=Rg(Ip());l=Pg(t,d),c.pxURLPath=l.urlPath,void 0!==l.payload?.pageClass&&(l.payload.pageClass=yh()?.getState()?.data?.app?.pyPortal?.classID);const n="showHistory",r={routeEndpoint:l.routeEndpoint,requestType:l.requestType,payload:l.payload,options:d,routeKey:l.routeKey};$.isTraditionalRemoteCase(l?.payload?.caseClassName)?Yg(r,e,d.context):Eh(u[n](zg(r)))}else l=Cp.getEndPointInfo(xg),c.pxURLPath="";Bg(null,{urlPathObjParam:c,infoParam:l,optionsParam:d},!0)},Qg=(e,t=!1)=>{var n;vg=e.domain,!1===t&&Ug()&&(n=Kg,window.addEventListener("popstate",(e=>n(e))),window.onbeforeunload=()=>null),Cp.init(e,xg)},Zg=e=>{(e=>{window.document.title=e})(e)};function ef(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 tf=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),nf=()=>Math.random().toString(36).substring(7).split("").join("."),rf={INIT:`@@redux/INIT${nf()}`,REPLACE:`@@redux/REPLACE${nf()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${nf()}`};function sf(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 af(e,t,n){if("function"!=typeof e)throw new Error(ef(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(ef(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(ef(1));return n(af)(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(ef(3));return s}function d(e){if("function"!=typeof e)throw new Error(ef(4));if(c)throw new Error(ef(5));let t=!0;l();const n=i++;return o.set(n,e),function(){if(t){if(c)throw new Error(ef(6));t=!1,l(),o.delete(n),a=null}}}function p(e){if(!sf(e))throw new Error(ef(7));if(void 0===e.type)throw new Error(ef(8));if("string"!=typeof e.type)throw new Error(ef(17));if(c)throw new Error(ef(9));try{c=!0,s=r(s,e)}finally{c=!1}return(a=o).forEach((e=>{e()})),e}p({type:rf.INIT});return{dispatch:p,subscribe:d,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error(ef(10));r=e,p({type:rf.REPLACE})},[tf]:function(){const e=d;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(ef(11));function n(){const e=t;e.next&&e.next(u())}n();return{unsubscribe:e(n)}},[tf](){return this}}}}}function of(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:rf.INIT}))throw new Error(ef(12));if(void 0===n(void 0,{type:rf.PROBE_UNKNOWN_ACTION()}))throw new Error(ef(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(ef(14))}o[i]=u,a=a||u!==l}return a=a||r.length!==Object.keys(e).length,a?o:e}}function cf(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce(((e,t)=>(...n)=>e(t(...n))))}var lf=function(e){function t(t,n){return e.call(this)||this}return uo(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(No),uf={setInterval:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var s=uf.delegate;return(null==s?void 0:s.setInterval)?s.setInterval.apply(s,mo([e,t],fo(n))):setInterval.apply(void 0,mo([e,t],fo(n)))},clearInterval:function(e){var t=uf.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},df=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 uo(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),uf.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&&uf.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,To(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(lf),pf=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return uo(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}(df),hf={now:function(){return(hf.delegate||Date).now()},delegate:void 0},gf=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=hf.now,e}(),ff=function(e){function t(t,n){void 0===n&&(n=gf.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r}return uo(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}(gf),mf=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return uo(t,e),t}(ff))(pf),yf=io((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),Ef=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 uo(t,e),t.prototype.lift=function(e){var t=new If(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new yf},t.prototype.next=function(e){var t=this;Uo((function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var s=go(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;Uo((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;Uo((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?Ro:(this.currentObservers=null,a.push(e),new No((function(){t.currentObservers=null,To(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 Yo;return e.source=this,e},t.create=function(e,t){return new If(e,t)},t}(Yo),If=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return uo(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:Ro},t}(Ef),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 _f=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 Ef,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}(Yo);var Cf=s(52),Sf=Symbol.for("immer-nothing"),Tf=Symbol.for("immer-draftable"),Nf=Symbol.for("immer-state");function Rf(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Pf=Object.getPrototypeOf;function Df(e){return!!e&&!!e[Nf]}function bf(e){return!!e&&(vf(e)||Array.isArray(e)||!!e[Tf]||!!e.constructor?.[Tf]||Uf(e)||Ff(e))}var Of=Object.prototype.constructor.toString();function vf(e){if(!e||"object"!=typeof e)return!1;const t=Pf(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)===Of}function xf(e,t){0===wf(e)?Reflect.ownKeys(e).forEach((n=>{t(n,e[n],e)})):e.forEach(((n,r)=>t(r,n,e)))}function wf(e){const t=e[Nf];return t?t.type_:Array.isArray(e)?1:Uf(e)?2:Ff(e)?3:0}function Mf(e,t){return 2===wf(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Lf(e,t,n){const r=wf(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function Uf(e){return e instanceof Map}function Ff(e){return e instanceof Set}function jf(e){return e.copy_||e.base_}function Vf(e,t){if(Uf(e))return new Map(e);if(Ff(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=vf(e);if(!0===t||"class_only"===t&&!n){const t=Object.getOwnPropertyDescriptors(e);delete t[Nf];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(Pf(e),t)}{const t=Pf(e);if(null!==t&&n)return{...e};const r=Object.create(t);return Object.assign(r,e)}}function kf(e,t=!1){return Bf(e)||Df(e)||!bf(e)||(wf(e)>1&&(e.set=e.add=e.clear=e.delete=$f),Object.freeze(e),t&&Object.entries(e).forEach((([e,t])=>kf(t,!0)))),e}function $f(){Rf(2)}function Bf(e){return Object.isFrozen(e)}var Gf,Wf={};function Hf(e){const t=Wf[e];return t||Rf(0),t}function qf(){return Gf}function zf(e,t){t&&(Hf("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Yf(e){Kf(e),e.drafts_.forEach(Jf),e.drafts_=null}function Kf(e){e===Gf&&(Gf=e.parent_)}function Xf(e){return Gf={drafts_:[],parent_:Gf,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Jf(e){const t=e[Nf];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Qf(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[Nf].modified_&&(Yf(t),Rf(4)),bf(e)&&(e=Zf(t,e),t.parent_||tm(t,e)),t.patches_&&Hf("Patches").generateReplacementPatches_(n[Nf].base_,e,t.patches_,t.inversePatches_)):e=Zf(t,n,[]),Yf(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Sf?e:void 0}function Zf(e,t,n){if(Bf(t))return t;const r=t[Nf];if(!r)return xf(t,((s,a)=>em(e,r,t,s,a,n))),t;if(r.scope_!==e)return t;if(!r.modified_)return tm(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),xf(s,((s,o)=>em(e,r,t,s,o,n,a))),tm(e,t,!1),n&&e.patches_&&Hf("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function em(e,t,n,r,s,a,o){if(Df(s)){const o=Zf(e,s,a&&t&&3!==t.type_&&!Mf(t.assigned_,r)?a.concat(r):void 0);if(Lf(n,r,o),!Df(o))return;e.canAutoFreeze_=!1}else o&&n.add(s);if(bf(s)&&!Bf(s)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Zf(e,s),t&&t.scope_.parent_||"symbol"==typeof r||!Object.prototype.propertyIsEnumerable.call(n,r)||tm(e,s)}}function tm(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&kf(t,n)}var nm={get(e,t){if(t===Nf)return e;const n=jf(e);if(!Mf(n,t))return function(e,t,n){const r=am(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_||!bf(r)?r:r===sm(e.base_,t)?(im(e),e.copy_[t]=cm(r,e)):r},has:(e,t)=>t in jf(e),ownKeys:e=>Reflect.ownKeys(jf(e)),set(e,t,n){const r=am(jf(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=sm(jf(e),t),o=r?.[Nf];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||Mf(e.base_,t)))return!0;im(e),om(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!==sm(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,im(e),om(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=jf(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty(){Rf(11)},getPrototypeOf:e=>Pf(e.base_),setPrototypeOf(){Rf(12)}},rm={};function sm(e,t){const n=e[Nf];return(n?jf(n):e)[t]}function am(e,t){if(!(t in e))return;let n=Pf(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=Pf(n)}}function om(e){e.modified_||(e.modified_=!0,e.parent_&&om(e.parent_))}function im(e){e.copy_||(e.copy_=Vf(e.base_,e.scope_.immer_.useStrictShallowCopy_))}xf(nm,((e,t)=>{rm[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),rm.deleteProperty=function(e,t){return rm.set.call(this,e,t,void 0)},rm.set=function(e,t,n){return nm.set.call(this,e[0],t,n,e[0])};function cm(e,t){const n=Uf(e)?Hf("MapSet").proxyMap_(e,t):Ff(e)?Hf("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:qf(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let s=r,a=nm;n&&(s=[r],a=rm);const{revoke:o,proxy:i}=Proxy.revocable(s,a);return r.draft_=i,r.revoke_=o,i}(e,t);return(t?t.scope_:qf()).drafts_.push(n),n}function lm(e){if(!bf(e)||Bf(e))return e;const t=e[Nf];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Vf(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Vf(e,!0);return xf(n,((e,t)=>{Lf(n,e,lm(t))})),t&&(t.finalized_=!1),n}var um=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&&Rf(6),void 0!==n&&"function"!=typeof n&&Rf(7),bf(e)){const s=Xf(this),a=cm(e,void 0);let o=!0;try{r=t(a),o=!1}finally{o?Yf(s):Kf(s)}return zf(s,n),Qf(r,s)}if(!e||"object"!=typeof e){if(r=t(e),void 0===r&&(r=e),r===Sf&&(r=void 0),this.autoFreeze_&&kf(r,!0),n){const t=[],s=[];Hf("Patches").generateReplacementPatches_(e,r,t,s),n(t,s)}return r}Rf(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){bf(e)||Rf(8),Df(e)&&(e=function(e){Df(e)||Rf(10);return lm(e)}(e));const t=Xf(this),n=cm(e,void 0);return n[Nf].isManual_=!0,Kf(t),n}finishDraft(e,t){const n=e&&e[Nf];n&&n.isManual_||Rf(9);const{scope_:r}=n;return zf(r,t),Qf(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=Hf("Patches").applyPatches_;return Df(e)?r(e,t):this.produce(e,(e=>r(e,t)))}},dm=um.produce;um.produceWithPatches.bind(um),um.setAutoFreeze.bind(um),um.setUseStrictShallowCopy.bind(um),um.applyPatches.bind(um),um.createDraft.bind(um),um.finishDraft.bind(um);const pm=(e,t)=>{const{data:{shared:n={}}={},context:r}=t;((e,t)=>{Ou.updateDataPageStore(t),Object.keys(t).forEach((n=>{Lh.getIn(e,[j.SHARED,n])?Object.keys(t[n]).forEach((r=>{Lh.setIn(e,[j.SHARED,n,r],t[n][r])})):Lh.setIn(e,[j.SHARED,n],t[n])}))})(e,n),r&&Lh.deleteIn(e,[r,"shared"])},hm=(e,t,n=!1)=>{const{context:r,caseViewMode:s=(n?void 0:j.PERFORM_MODE),containerName:a}=t;a!==hd.WORKAREA&&s&&Lh.setIn(e,[r,"context_data","caseViewMode"],s)},gm=(e,t)=>{const{context:n}=t;Lh.setIn(e,[n,"context_data","actionType"],t.actionType),Lh.setIn(e,[n,"context_data","assignmentID"],t.assignmentID)},fm=(e,t=[])=>{t.forEach((t=>Lh.deleteIn(e,t)))},mm=(e,t=[])=>{t.forEach((t=>Lh.deleteIn(e,t)))},ym=(e,t=[])=>{t.forEach((t=>{Lh.deleteIn(e,t)}))},Em=(e,t,n={})=>{const{deleteAssignmentSpecificResources:r=!0,doDeleteConfirmationDetails:s=!0}=n;Lh.deleteIn(e,[t,"nextAssignmentInfo"]),Lh.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"availableActions"]),Lh.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"availableProcesses"]),Lh.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"activeActionID"]),Lh.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"assignments"]),Lh.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"childCases"]),s&&(Lh.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"confirmationLinks"]),Lh.deleteIn(e,[t,"caseMessages"])),r&&(Lh.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"actionButtons"]),Lh.deleteIn(e,[t,j.CASE_INFO.CASE_INFO,"navigation"]))},Im=(e,t)=>dm(e||{},(e=>{switch(t.type){case Ce:{if(!t.payload.data||e[t.payload.context])return e;t.payload.doDeleteCaseSummary&&Em(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,hm(e,t.payload),gm(e,t.payload),pm(e,t.payload),((e,t)=>{const{context:n}=t;Lh.deleteIn(e,[n,"context_data","blocking_action_counter"]),Lh.deleteIn(e,[n,"context_data","deferred_action_queue"])})(e,t.payload),e}case xe:{t.payload.doDeleteCaseSummary&&Em(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]=bh(e[t.payload.containerItemID],t.payload.data,{propertiesToReplace:[...r]}):e[t.payload.context]=bh(e[t.payload.context],t.payload.data,{propertiesToReplace:[...r]}),(t.payload.actionType||t.payload.assignmentID)&&gm(e,t.payload),hm(e,t.payload),pm(e,t.payload),mm(e,t.payload.suggestionContexts),e}case Se:{const{childContainersContexts:n=[]}=t.payload;return((e,t)=>{const{containerItemID:n,context:r,deleteContext:s}=t;s&&Lh.deleteIn(e,[r]),Lh.deleteIn(e,[n])})(e,t.payload),ym(e,n),fm(e,t.payload.transientItems),mm(e,t.payload.suggestionContexts),e}case _e:{const{containerItems:n}=t.payload;return Array.isArray(n)?n.forEach((t=>{Lh.deleteIn(e,[t])})):Lh.deleteIn(e,[n]),e}case we:{const{context:n,contextToBeRemoved:r,data:s,childContainersContextsToBeRemoved:a}=t.payload;return Em(e,t.payload.context),hm(e,t.payload),e[n]=bh(e[n],e[r]),e[n]=bh(e[n],s),Lh.deleteIn(e,[r]),ym(e,a),pm(e,t.payload),e}case Me:{const{payload:{context:n,pulseReplace:r=!0,childContainersContexts:s=[]}}=t;let{payload:{data:a}}=t;const o=Lh.getIn(e[n],"pulse");let i=Lh.getIn(e[n],"OperatorID"),c=Lh.getIn(e[n],"pxRequestor");return c&&a.pxRequestor&&(c=Lh.mergeDeep(c,a.pxRequestor)),i&&a.OperatorID&&(i=Lh.mergeDeep(i,a.OperatorID)),!r&&o&&(a=Oh(a,"pulse",o),a=Oh(a,"OperatorID",i),a=Oh(a,"pxRequestor",c)),Lh.setIn(e,n,a),hm(e,t.payload),pm(e,t.payload),ym(e,s),fm(e,t.payload.transientItems),mm(e,t.payload.suggestionContexts),e}case at:{const{context:n,doDeleteConfirmationDetails:r=!0}=t.payload;return Em(e,n,{doDeleteConfirmationDetails:r}),e}case Te:{const{transientItemID:n,data:r}=t.payload;return Lh.setIn(e,n,r)}case Re:case Pe:{const{transientItems:n}=t.payload;return n.forEach((t=>Lh.deleteIn(e,t))),e}case Ne:case De:{const{transientItemID:n,data:r}=t.payload;return bh(Lh.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)&&Lh.deleteIn(e,[n,t]);return e}case Oe:{const{transientItemID:n,data:r}=t.payload;return Lh.deleteIn(e,n),Lh.setIn(e,n,r)}case ce:{const{key:n,value:r}=t.payload;return Lh.setIn(e,`${j.SHARED}.${n}`,r),e}case Fe:{const{context:n,data:r}=t.payload;return Lh.setIn(e,n,r)}default:return e}})),Am=(e,t)=>dm(e,(e=>{switch(t.type){case fe:{const{propertiesToReplace:n=[],interestPath:r}=t.payload;if(r){const s=Lh.getIn(e[t.payload.context],r),a=Lh.getIn(t.payload.data,r),o=bh(s,a,{isArrayDeepMerge:!0});Dh(e[t.payload.context],[...n]),Lh.setIn(e[t.payload.context],r,o)}else e[t.payload.context]=bh(e[t.payload.context],t.payload.data,{isArrayDeepMerge:t.payload.isArrayDeepMerge,propertiesToReplace:[...n]});return hm(e,t.payload,!0),pm(e,t.payload),e}case Q:{const{context:n,reference:r,value:s,isArrayDeepMerge:a}=t.payload;return Oh(e[n],r,s,{isArrayDeepMerge:a}),e}case Z:{const{context:n,reference:r,value:s}=t.payload;return vh(e[n],r,s),e}case me:return Rh(e[t.payload.context],t.payload.reference),e;case oe:return Lh.setIn(e[t.payload.context],"context_data.isLoading",!0),e;case ie:return Lh.setIn(e[t.payload.context],"context_data.isLoading",!1),e;case nt:{const{data:n}=t.payload;return pm(e,{data:{shared:n}}),e}case rt:{const{dataPagesToBeRemoved:n=[]}=t.payload;return n.forEach((t=>{const{dataPageName:n,dataPageNameWithHash:r}=t;Lh.deleteIn(e.shared,[n,r]);const s=Lh.getIn(e.shared,[n]);s&&0===Object.keys(s).length&&Lh.deleteIn(e.shared,[n])})),e}case ot:{const n=Lh.getIn(e[t.payload.context].context_data,"blocking_action_counter",0);return t.payload.isInitiateBlockingAction?Lh.setIn(e[t.payload.context].context_data,"blocking_action_counter",n+1):Lh.setIn(e[t.payload.context].context_data,"blocking_action_counter",n-1),e}default:return e}})),_m=/\[(\d+)\]$/gi,Cm=/(\d+)/gi,Sm=/\[.\]$/gi,Tm=(e,t,n,r=[j.CONTEXT_DATA,j.CASE_INFO.CASE_INFO,j.CONTENT])=>{const s=Lh.getIn(t,r);if(s){const t=Qn(s,[],[]);for(const s of t)Lh.setIn(e[n],[...r,...s],{})}},Nm=(e,t,n,r)=>{const{property:s,pageReference:a,category:o,type:i}=r.payload,c=Lh.getIn(e[t],n);if(c&&o===j.CASEMESSAGES)Lh.setIn(e[t],Hn(s,a,o),"");else if(c&&c.length>0&&Array.isArray(c)){const r=c.filter((e=>e.type!==i));n&&n.length>0&&Lh.setIn(e[t],Hn(s,a,o),r)}},Rm=(e,t)=>{const{property:n,pageReference:r,category:s,isListEntry:a,deletingIndex:o,stateObj:i}=t.payload,{context:c}=t.payload;if(i)return Tm(e,i,c),e;const l=Hn(n,r,s,a);if(Number.isInteger(o)){Lh.deleteIn(e[c],l);const t=l.slice(0,l.length-1);let n=Lh.getIn(e[c],t)||{};const r=(u=Object.keys(n),[...u].sort(((e,t)=>{const n=e.match(_m),r=t.match(_m);if(!n&&!r)return e.localeCompare(t);if(!n&&r)return-1;if(n?.length&&r?.length){const e=n[0].match(Cm),t=r[0].match(Cm);if(e?.length&&t?.length)return parseInt(e[0],10)-parseInt(t[0],10)}return 1})));n=r.map((e=>n[e])),n.forEach(((n,s)=>{const a=r[s].match(_m);if(a?.length){const i=parseInt(a[0].match(Cm)[0],10);i>o&&(Lh.deleteIn(e[c],t.concat(r[s])),Lh.setIn(e[c],t.concat(r[s].replace(Sm,`[${i-1}]`)),n))}}))}else Lh.setIn(e[c],l,{});var u;return e};function Pm(e,t){const n=Lh.getIn(e,t);return void 0!==n?.dataInfo?.content}function Dm(e,t){let n=Wn.FIELD_MESSAGES_PATH;return Pm(e,t)&&(n=Wn.DATA_OBJECT_FIELD_MESSAGES_PATH),n}const bm=(e,t,n)=>{n.forEach((n=>{((e,t,n)=>{const r=Lh.getIn(n,j.ERROR_FIELD_IN_PAGE).slice(1),s=Lh.getIn(n,j.ERROR_IN_PAGE_IDENTIFIER).slice(1);if(s){let a="caseInfo.content";Pm(e,t)&&(a="dataInfo.content");let o=r?`${a}.${r}`:a;o=o.replace(/\(/g,"[").replace(/\)/g,"]");const i=Hn(s,o,j.PROPERTY),c=Lh.getIn(e[t],`${o}.classID`),l=Hp(s,c),u=PCore.getLocaleUtils(),d=`${l?.definedOnClassID||l?.classID}.${s}`,p={type:F.MESSAGES.MESSAGES_TYPE_ERROR,message:n.localizedValue,...l?.label&&{fieldLabel:u.getLocaleValue(l.label,d,u.FIELD_LABELS_BUNDLE_KEY)}},h=Lh.getIn(e[t],i,[]);if(Lh.isContains(h,p))return;Lh.setIn(e[t],i,[...h,p])}})(e,t,n)}))};function Om(e,t){const{err:n,formFields:r}=t.payload;let{context:s}=t.payload;const{fieldErrors:a,pageErrors:o}=qc(n.errorDetails,r),i=Dm(e,s);if(Lh.setIn(e,[s,...i],{}),Lh.setIn(e,[s,...Wn.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=Hn(r,t,j.PROPERTY);Lh.setIn(e,[s,...a],[])}}})),a.length>0&&bm(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),Lh.setIn(e,[s,...Wn.PAGE_MESSAGES_PATH],t)}else s.includes&&s.includes(hd.WORKAREA)&&(s=W(s)),Lh.deleteIn(e,[s,...Wn.PAGE_MESSAGES_PATH]);return e}const vm=(e,t)=>dm(e||Vm().data,(e=>{switch(t.type){case Ie:return t.payload.err.errorDetails&&("Validation fail"===t.payload.err.errorClassification||(t.payload.err?.displayButtonsOnErrors?.length??0)>0)?Om(e,t):e;case xe:{const{context:n}=t.payload,r=[n,...Dm(e,n)],s=[n,...Wn.PAGE_MESSAGES_PATH];if(Lh.setIn(e,r,{}),Lh.setIn(e,s,[]),n&&n.includes(hd.WORKAREA)){const t=[X(n),...Wn.PAGE_MESSAGES_PATH];Lh.setIn(e,t,[])}return e}case Ze:{const{isListEntry:n}=t.payload;return n?Rm(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 Tm(e,o,i),e;const l=Hn(n,r,s,a);return s===j.PAGE&&i?.includes(hd.WORKAREA)&&(c=W(i)),Nm(e,c,l,t),Nm(e,i,l,t),e})(e,t)}case Qe:{const{messages:n,property:r,pageReference:s,context:a,category:o}=t.payload,i=Hn(r,s,o);return n&&n.length>0&&Array.isArray(n)&&i&&i.length>0&&Lh.setIn(e[a],Hn(r,s,o),n),e}default:return e}})),xm=(e,t)=>dm(e,(e=>{if(t.type===st){const{instruction:n,actions:r,context:s,referenceList:a,listIndex:o,listMoveToIndex:i,content:c={}}=t.payload,l=fh(a);switch(n){case j.LIST_ACTIONS.INSERT:((e,t,n,r,s)=>{Lh.setIn(e[t],[...n,r],s)})(e,s,l,o,c);break;case j.LIST_ACTIONS.UPDATE:((e,t,n,r,s)=>{const a=bh(Lh.getIn(e[t],[...n,r],{}),s);Lh.setIn(e[t],[...n,r],a)})(e,s,l,o,c);break;case j.LIST_ACTIONS.DELETE:((e,t,n,r)=>{const s=Lh.getIn(e[t],n,[]);s.splice(r,1),Lh.setIn(e[t],n,s),bn.deleteListNode(t,n,s.length)})(e,s,l,o);break;case j.LIST_ACTIONS.MOVE:((e,t,n,r,s)=>{const a=Lh.getIn(e[t],[...n,r],{}),o=Lh.getIn(e[t],n,[]);o.splice(r,1),o.splice(s,0,a),Lh.setIn(e[t],n,o),Yn(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=Lh.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(".");yr(t,e)}else delete s[o]})),Lh.setIn(e[t],n,s.filter(Boolean))})(e,s,l,r);break;case j.LIST_ACTIONS_TYPE.DESELECT_ALL:((e,t,n)=>{Lh.setIn(e[t],n,[])})(e,s,l);break;case j.LIST_ACTIONS.REPLACE:((e,t,n,r)=>{Lh.setIn(e[t],n,r)})(e,s,l,c);break;case j.LIST_ACTIONS.DELETE_PAGE:((e,t,n)=>{Lh.setIn(e[t],n,{})})(e,s,l)}}return e})),wm=[Am,Im,vm,xm],Mm=(e,t)=>(e||(e=Vm().data),t.type===et?Vm().data:(wm.forEach((n=>{e=n(e,t)})),e)),Lm=(e,t=[])=>{t.forEach((t=>{Lh.deleteIn(e,[t])}))},Um=(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?Lh.setIn(e,[a,"items",l,"view"],c):g&&Lh.deleteIn(e,[a,"items",l,"view"]),o&&Lh.setIn(e,[a,"items",l,"context"],o),d&&Lh.setIn(e,[a,"items",l,"flowName"],d),(!s||s&&h)&&Lh.setIn(e,[a,"items",l,"key"],h.trim()),((e,t,n,r)=>{""===e&&Lh.deleteIn(t,[n,"items",r,"key"])})(h,e,a,l),(!s||s&&i)&&Lh.setIn(e,[a,"items",l,"semanticURL"],i),(!s||s&&p)&&Lh.setIn(e,[a,"items",l,"resourceType"],p),Lm(e,u),e},Fm=(e,t)=>(e||(e=Vm().containers),t.type===et?Vm().containers:dm(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 pn.resolveActionByID(a,null,!1),e[o]?e:(i={type:s,accessedOrder:[],items:{}},Lh.setIn(e,[o],i),e)}case Ue:{const{containerName:n,childContainers:r=[]}=t.payload;return Lh.deleteIn(e,[n]),r.forEach((t=>{Lh.deleteIn(e,[t])})),e}case _e:{const{context:n,name:r,actionMgrID:s,childContainers:a}=t.payload,o=`${n}/${r}`;return pn.resolveActionByID(s,null,!1),Lh.setIn(e,[o,"accessedOrder"],[]),Lh.setIn(e,[o,"items"],{}),Array.isArray(a)&&a.forEach((t=>{Lh.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:E,actionID:I,isMultiRecordData:A,acTertiary:_,parentContext:C,heading:S,isTraditionalRemoteCase:T}=t.payload,N=e[n],R=N&&N.type,P=N&&N.accessedOrder||[],D=N&&N.items||{};let b=null;return e[n]&&"single"===R&&P.length>0?Um(e,t):(b={accessedOrder:[...P,c],items:{...D,[c]:{view:i,semanticURL:o,key:u,flowName:d,context:r,isInCreateStage:s,resourceType:p,actionName:h,isMinimizable:g,...a&&{isBulkAction:a},showProgress:f,progressMessage:m,modalOptions:y,isTraditionalRemoteCase:T,resourceStatus:E,...I&&{actionID:I},..._&&{acTertiary:_},...A&&{isMultiRecordData:A},...C&&{parentContext:C},heading:S}}},pn.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=Um(e,t),pn.resolveActionByID(n,r,!1)}catch{pn.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],Lh.setIn(e,[s,"items",a,"transientItems"],[]),Lh.setIn(e,[s,"accessedOrder"],c),o=Um(e,t),pn.resolveActionByID(n,r,!1)}catch{pn.rejectActionByID(n,!1)}return o})(e,t);case ve:{const{target:n,containerItemID:r,actionMgrID:s}=t.payload;try{const t=Lh.getIn(e,[n,"accessedOrder"]).filter((e=>e!==r));t.push(r),Lh.setIn(e,[n,"accessedOrder"],t),pn.resolveActionByID(s,null,!1)}catch{pn.rejectActionByID(s,!1)}return e}case we:case Se:{const{target:n,containerItemID:r,actionMgrID:s,childContainers:a}=t.payload;try{const t=Lh.getIn(e,[n,"accessedOrder"]).filter((e=>e!==r));Lh.setIn(e,[n,"accessedOrder"],t),Lh.deleteIn(e,[n,"items",r]),Lm(e,a),pn.resolveActionByID(s,null,!1)}catch{pn.rejectActionByID(s,!1)}return e}case Te:{const{transientItemID:n,target:r,contextName:s}=t.payload,a=Lh.getIn(e,[r,"items",s,"transientItems"])??[];return Lh.setIn(e,[r,"items",s,"transientItems"],[...a,n])}case Pe:{const{target:n,containerItemID:r}=t.payload;return Lh.deleteIn(e,[n,"items",r,"transientItems"]),e}case Re:{const{target:n,transientItemID:r,containerItemID:s}=t.payload,a=(Lh.getIn(e,[n,"items",s,"transientItems"])??[]).filter((e=>e!==r));return Lh.setIn(e,[n,"items",s,"transientItems"],a)}default:return e}})));let jm={};const Vm=()=>jm,km=e=>((e=>{const t=e.Data||e.data,{uiResources:n={}}=e,r=n[j.CONTEXT_DATA]||e[j.CONTEXT_DATA];jm={data:{[j.APP.APP]:{...t,[j.CONTEXT_DATA]:r}},containers:{}}})(e),of({data:Mm,containers:Fm}));function $m(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=ou(e),r=function(e,t){return"number"==typeof au(e)?e.pop():t}(e,1/0),s=e;return s.length?1===s.length?ri(s[0]):function(e){return void 0===e&&(e=1/0),ru(qo,e)}(r)(hi(s,n)):lu}const Bm=(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}},Gm=(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 Bm(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 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,Bm(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},Wm={},{VIEW:Hm,FIELD:qm}=j.CONTEXT_TREE_NODE_TYPES,zm=e=>(e=>Mi[e])(e)>0&&Wm[e],Ym=[(e,t)=>e.pipe(eu(On.REFRESH_DATA,ft),nu((e=>e.payload)),ru((e=>{const{context:n,contextData:r,options:s}=e,{propertyName:a="",classID:o=""}=s,i=$c(n,{skipUUID:!1});let c=[],l=[],u=!1;Sp.getFeatureMap().granularUIRefresh?(({fieldsWithDeclarativeTargets:c=[],whens:l=[]}=$n(n)),u=l.some((e=>e.type===Hm))):u=!0;const d=l.filter((e=>e.type===qm)),p=Lh.getPropertyName(a),h=p?p.split("."):[],g=h.pop(),f=h.join("."),m=[];if(f){const e=Hp(f,o);if(e&&"copy"===e.dataRetrievalType){const e=Lh.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 E=ol(n);Lh.isEmpty(E)||(y=al(E,y));const I=((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=On.REFRESH;return r?(l=Vg(On.REFRESH_CASE_VIEW,e),d={...d,interestPage:i}):o&&n?l=Vg(On.REFRESH_CASE_DATA,e):o&&!n?l=Vg(On.REFRESH_ASSIGNMENT_DATA,e):(s.length>0||a.length>0)&&(d={...d,calculations:{fields:s,whens:a}},l=Vg(n?On.RECALCULATE_CASE_DATA:On.RECALCULATE_ASSIGNMENT_DATA,e),p=On.RECALCULATE),{restAPI:l,requestBody:d,requestType:p}})({...e,fieldsWithDeclarativeTargets:c,fieldsWithWhen:d,isViewsWithWhen:u},y);Qt.registerBlockingAction(n).catch((()=>{}));const{restAPI:A,requestBody:_,requestType:C}=I;(e={...e,requestType:C}).requestType=C;const{reqType:S,restApi:T}=A,N=t.value.data[n]?.caseInfo?.headers;return hi(((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(t.interestPage&&(e.interestPage=t.interestPage),zm(r)){const t=[];for(let n=0;n<Wm[r].length;){const s=Wm[r][n],a=Bn(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=>{Wm[r].splice(e,1)}))}const s=Hi();return e.signal=s.token,e.cancelConfig=s,Wm[r]?Wm[r].push(e):Wm[r]=[e],Bi(e.url,e,n,{cancelContext:r}).then((e=>(delete Wm[r],e))).catch((e=>{throw e&&"ERR_CANCELED"!==e.code&&delete Wm[r],e}))})({reqHeaders:N,context:n,method:S,body:_,url:kn(e,T)},e)).pipe(nu((t=>({response:{...t.data||{}},actionConfig:e,actionMgrID:e.options.actionMgrID,headers:kc(t.headers)}))),du(": Error occurred during fetch call at refreshData Epic : ",e.context,e?.options?.actionMgrID))})),ru((async e=>{if(e&&e.type===Ie)return Qt.deRegisterBlockingAction(e.payload?.context).catch((()=>{})),zc(e);const{actionConfig:t,response:n,actionMgrID:r}=e,{context:s,serverPrecedenceFields:a,requestType:o}=t,i=pc.getTargetViewContainerName(je),c=yt(i,s),l={acName:c,context:s},u=Gm(n,{[F.STOPMERGEACTIONS]:!0,[F.ACTIONS.DELETEAVIALACTIONS]:!0});u.directUrlUpdation=!1,o===On.REFRESH&&await Gc(u,t,l);const d={target:c,context:s};let p=ll.getStateMachinesByContext(s)||{};const h=Bc(u,d);t.interestPage&&(h.interestPath=`caseInfo.content${Lh.convertClipboardPageToPageRefNotation(t.interestPage)}`),p={...p,...ll.getUnConnectedStateMachines(s)||{}},Object.keys(p).forEach((e=>{if(Lh.hasIn(h.data,e)){const t=Lh.getIn(h.data,e),n=Ch(e,void 0,s),r=bn.getContextReferences(s)?.get(e);((e,t,n,r,s)=>Array.isArray(e)&&Array.isArray(t)&&t.length!==e.length&&"Multiselect"!==n&&"Attachment"!==n&&(!r.interestPath||s.startsWith(r.interestPath)))(t,n,r?.props?.componentName,h,e)&&ll.setStateMachineEmpty(s,e)}})),t.options?.skipDataMerge&&h.data?.caseInfo?.content&&(h.data.caseInfo.content={}),h.preserveClientChanges=void 0===t.options.preserveClientChanges||t.options.preserveClientChanges;const g=Uc.getPropertiesToReplace(s),f=Eg(Hh,h,{serverPrecedenceFields:a,propertiesToReplace:g});return ll.registerForServerChanges(),Eh(f),pn.resolveActionByID(r,h),ll.unRegisterForServerChanges(),Qt.deRegisterBlockingAction(s).catch((()=>{})),[]})))],Km=Ym,Xm=[e=>e.pipe(eu(tt),ru((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=Ah()[a.name];if(n&&s in n){const r=n[s],{loadTime:a}=r;if(!Au.isTimeElapsed(a,e,t))return}}return Au.getData(a.name,{dataViewParameters:a.dataViewParameters},t).then((e=>{const t=a.mode===j.READONLY?r:n;t[a.name]?t[a.name][s]={pxResults:e.data.data,parameters:a.dataViewParameters,loadTime:e.data?.fetchDateTime}:t[a.name]={[s]:{pxResults:e.data.data,parameters:a.dataViewParameters,loadTime:e.data?.fetchDateTime}}})).catch((()=>{}))}));await Promise.allSettled(s);const a=[];return Object.keys(n).length&&a.push(Hh({context:t,data:n})),Object.keys(r).length&&a.push(Ag({data:r,context:t})),Eh(a),[]})))],Jm=Xm;class Qm{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 Qm.DISPLAY_DIRTY_POPUP:this.broadcastEventToIframe=e.data.fromInfinity,this.isDirtyDialogActive||(e.data.isFormDirty?(yi.publish(j.PUB_SUB_EVENTS.EVENT_SHOW_CANCEL_ALERT,{isModalAction:!0,hideDelete:!0}),this.isDirtyDialogActive=!0):this.callback?.call(this));break;case Qm.LOAD_PREVIEW:this.loadPreview(e);break;case Qm.UPDATE_COEXISTENCE_DRILLDOWN_CASE:this.updateCoexistenceDrilldownCase(e);break;case Qm.OPEN_ASSIGNMENT_ACTION:this.openAssignment(e);break;case Qm.GET_NEXT_WORK_ACTION:this.getNextWork(e);break;case Qm.OPEN_WORK_BY_HANDLE:this.openWorkByHandle(e);break;case Qm.CLOSE_CONTAINER_ACTION:this.closeContainer(e)}}};loadPreview=e=>{const{pyID:t,caseClassName:n,uniqueId:r}=e.data;if(r===this.getUniqueId()){cd({}).getPConnect().getActionsApi().showCasePreview(t,{caseClassName:n})}};navigateToDefaultPage=()=>{const e=cd({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,uniqueId:a}=e.data;if(a!==this.getUniqueId())return;let o=r;r===Qm.OPEN_WORK_ITEM&&(o=Qm.OPEN_WORK_BY_HANDLE),Cp.updateSemanticURLAndDocumentTitle({key:t,caseClassName:n,actionName:o});cd({}).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}`;cd({meta:{},options:{context:Od(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}`;cd({meta:{},options:{context:Od(e)}}).getPConnect().getActionsApi().openWorkByHandle(t,n)}};destroyBroadcastChannel=()=>{this.getBroadCastChannel()?.close(),this.broadcastChannel=null};subscribeEvents=()=>{this.setReverseCoexistenceCaseLoaded(!0),yi.subscribe(F.PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.HANDLE_DISCARD,this.handleDiscard),yi.subscribe(F.PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.CHECK_IS_FORM_DIRTY,this.postDirtyPopupMessage)};unsubscribeEvents=()=>{yi.unsubscribeAllWithEventType(F.PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.CHECK_IS_FORM_DIRTY),yi.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:Qm.DIRTY_POPUP_C11N,uniqueId:this.getUniqueId()}),this.setCallBackFunction(e)};handleDiscard=()=>{this.broadcastEventToIframe?(this.broadcastChannel?.postMessage({action:Qm.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:Qm.OPEN_ASSIGNMENT_MODAL,uniqueId:this.getUniqueId(),key:e}),this.broadcastEventToIframe=!1,this.onCreateCallback=t,this.openAssignmentParams=n}}const Zm=new Qm,ey="nextAssignmentInfo",ty="nextAssignmentInfo.context",ny=e=>{const{containerName:t,isInCreateStage:n}=e;return n?j.MODAL:t||pc.getTargetViewContainerName(We)},ry=e=>{const t=Lh.getIn(e,[j.DATA,j.CASE_INFO.CASE_INFO]);return rn(t)&&sn(Sp.getOperatorIdentifier(),t)},sy=(e,t)=>{const{class:n,context:r,viewType:s=jc.PAGE}=e,{removeActionPayload:a}=t;let o=e?.pageName?e?.pageName:Sp.getDefaultCasePage();return e.isTraditionalUICase&&(o="pyDetails"),hi(Qi.createCase(n,{...e,pageName:o,viewType:s,context:r})).pipe(nu((({response:t,headers:n})=>({response:t,actionInPayload:e,headers:n,removeActionPayload:a}))),du("Error occurred during ajax call at createWork Epic : ",r))},ay=e=>{yi.publish(j.PUB_SUB_EVENTS.DISPLAY_CASE_CREATED_TOASTER,e)},oy=e=>{yi.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_DONE,e)},iy=e=>{let t=0,n=[],r="",s=!1;return e.pipe(eu(Bh),pu(100),nu((e=>(({actionMgrID:t}=e.payload),e.payload))),ru((e=>{const{context:n}=e,r=ny(e),a=yt(r,n),{continueExecution:o,removeActionPayload:i}=(e=>Ld(e)?{continueExecution:!0,removeActionPayload:{}}:Qc(e))(a);return s=xc(e.class),o?(e.isTraditionalUICase=s,sy(e,{removeActionPayload:i})):(pn.rejectActionByID(t),uu())})),ru((async e=>{if(e&&e.type===Ie)return e.payload.context=ap(),n.push(zc(e)),n;const{actionInPayload:a,response:o,headers:i,removeActionPayload:c}=e;let l;l=!(a.renderInline||Sp.getDefaultCasePage()||s)&&ry(o),Lh.setIn(o.data,F.CASE_INFO.IS_FIRST_ASSIGNMENT,!0);const u=ny({...a,isInCreateStage:l}),d=yt(u,a.context),p=Kc(d,u,a.context);if(!Ec(u)&&Ld(d)){const{continueExecution:e}=Qc(d);if(!e)return pn.rejectActionByID(t),uu()}if(!(a?.openCaseViewAfterCreate??!0)&&!l){const e=Lh.getIn(o.data,F.CASE_INFO.CASE_INFO_CONTENT);r=`${e.pyID} ${Rp.getLocaleValue("has been created.","Assignment")}`;const t=Rc(o),s=Sc(o);return ay({toastMessage:r}),oy({caseId:`${e.pyID}`,assignmentId:t,caseType:s}),n}const h=Gm(o);let g=Fg("createWork",{caseClassName:Sc(h)});g=g.replace(/{.+?}/,String(Cc(Nc(h)))),h.semanticURL=g,((e,t)=>{const n=ry(e),{skipBrowserSemanticUrlUpdate:r=!1,isTraditionalUICase:s}=t;Lh.setIn(e,["directUrlUpdation"],(!n||s)&&!r)})(h,a);const f={acName:d,context:p},m=Lc(p);await Gc(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:Lh.getIn(h,ty),nextAssignmentInfo:Lh.getIn(h,ey),resourceType:F.CASE,openCaseViewAfterCreate:a.openCaseViewAfterCreate,modalOptions:a.modalOptions,debugInfo:a.debugInfo};bc(y,h);const E=Bc(h,y);s&&(E.data.caseInfo.content.coexistenceAction="openAssignment");const I=Yc(d,E);return Xc(I)&&Pc(n,{removeActionPayload:c,target:d}),n.push(I),tl(n),n})),nu((()=>{const e=wc(),a=rn(Lh.getIn(n[0]?.payload,"data.caseInfo"));return s&&e&&a?Zm.postCreateCaseMessage(n[0]?.payload?.nextAssignmentInfo?.ID,sl,n):sl(n),vc(n,t),r="",n=[],n})))},{RESOURCE_TYPES:cy}=F,ly=(e,t=[])=>{const{viewType:n,containerName:r,targetContainerName:s,isChild:a}=e,o=_c(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?jc.PAGE:n||(!yc(r)&&!yc(s)||a?jc.PAGE:jc.FORM)},uy=(e,t,n,r,s)=>{if(Pc(e,{removeActionPayload:t,target:n}),((e,t)=>{const n=Rd(t);let r=null;return n&&(r=md(t,n)),r?.key===e&&Ud(t)})(r.key,n))r.context=Od(n),r.containerItemID=r.context,e.push(Eg(gg,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(Eg(gg,r))}else{const t=Wd(r.context),n=_d(t,r.key);n?(r.target=t,r.context=n,r.containerItemID=n,e.push(Eg(gg,r))):e.push(Eg(Zh,r))}},dy=(e,t,n,r,s,a,o)=>{Ld(t)&&Fd(t)?((e,t,n,r,s)=>{ly(e,t)===jc.FORM?(n.caseViewMode=r||j.PERFORM_MODE,s.push(Eg(ag,n))):s.push(Eg(gg,n))})(r,s,e,a,n):uy(n,o,t,e,r)},py=({restUrl:e,reqType:t,requestHeaders:n,debugInfo:r,context:s,isGetNextWork:a,doNotMergeMessagesForStatusCode:o})=>Bi(e,{method:t,headers:{"if-match":n&&n.etag,...n,...r&&{...xi.addDebugHeaders(r)}}},s,{doNotMergeHttpMessagesForStatusCode:a?o:""}),hy=(e,t)=>{const n=ly(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?Vg("getNextWork",{viewType:n}):c?Vg("openStage",{caseID:u,stageID:l}):Vg(Ge,{assignmentID:a,viewType:n}),{removeActionPayload:f}=t,m=Sp.getDefaultCasePage();let y="",E=e.pageName;e.isTraditionalUICase&&(E="pyDetails"),y=m?`${h}?viewType=${n}&pageName=${m}`:E?`${h}?viewType=${n}&pageName=${E}`:`${h}?viewType=${n}`,d&&Object.keys(d).forEach((e=>{y+=`&${e}=${d[e]}`}));const I=(e=>{let t=e?.headers??{};return e?.isRemote&&(t=kc(t,e.remoteClassName)),t})(e);return hi(py({restUrl:y,reqType:g,requestHeaders:I,debugInfo:i,context:s,isGetNextWork:o,doNotMergeMessagesForStatusCode:"404"})).pipe(nu((e=>{if(Sp.isCoexistenceAppOfType(j.APP_TYPE.UIKIT)&&!p){return rn(e.data.data.caseInfo)?e:(y=y.replaceAll(E,"pyDetails"),Sp.setDefaultCasePage("pyDetails"),{isReloadWithDifferentViewTypeRequired:!0,restUrl:y})}return e})),ru((e=>e?.isReloadWithDifferentViewTypeRequired?py({restUrl:y,reqType:g,requestHeaders:I,debugInfo:i,context:s,isGetNextWork:o,doNotMergeMessagesForStatusCode:"404"}):iu(e))),nu((t=>{const{key:s,flowName:o}=Hc(a);return{response:{...t.data,key:s,flowName:o},actionInPayload:e,viewType:n,removeActionPayload:f,headers:kc({...r,...t.headers})}})),du("Error occurred during ajax call at openAssignment Epic : ",s))},{RESOURCE_TYPES:gy}=F,fy=e=>{const t="Browser"===Sp.getRuntime();let n=0,r=[];const s=[];let a=!1,o=!1;return e.pipe(eu(zl),nu((e=>(({actionMgrID:n}=e.payload),{...e.payload,...t?{insKey:e.payload.assignmentID}:{assignmentID:e.payload.assignmentID}}))),ru((e=>{a=e.isGetNextWork;const{context:t}=e;let r;r=(e?.isChild||e?.isRemote)&&e?.isMultiDoc?jc.FORM:ly(e),e.viewType=r;const s=fc(Ge,e),i=yt(s,t),{activate:c,activateContainerActionPayload:l}=el(gy.ASSIGNMENT,i,e);if(c&&!e.isParallelCall)return iu({type:ve,activateContainerActionPayload:l,actionInPayload:e});const u=Rd(i);let d;d=l?.isParallelAssignment?{continueExecution:!0,removeActionPayload:{}}:u?Qc(i):{continueExecution:!0,removeActionPayload:{}};const{continueExecution:p,removeActionPayload:h}=d;return p?(o=xc(e.className),e.isTraditionalUICase=o,hy(e,{removeActionPayload:h})):(pn.rejectActionByID(n),uu())})),ru((async e=>{if(e?.type===Ie){if(a){const{payload:t}=e,{err:n}=t,r=n.response.status;s.push({status:Number(r)})}return r.push(zc(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=zl,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=_c(e);let r;r=!Sp.getDefaultCasePage()&&rn(n);const{isChild:s,containerName:a}=t,o=s&&r,i=r&&!t.isActionFromToDoList;return o||i?j.MODAL:a||fc(Ge,t)})(i,n);o=xc(i?.data?.caseInfo?.caseTypeID),n.isTraditionalUICase=o,o&&(f=n.containerName);const m=yt(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=bd(s);await Gc({directUrlUpdation:!l,semanticURL:r},c,{acName:i,target:i,context:u}),e.push(Eg(lg,{containerItemID:s,target:i,isParallelAssignment:a,insKey:o,resourceType:cy.CASE,context:u,doDeleteCaseSummary:c.doDeleteCaseSummary}))})(r,d,{actionInPayload:n,target:m}),tl(r),r;const y=i?.data?.caseInfo?.content,E=i?.uiResources?.root?.config?.name,I=i?.uiResources?.root?.config?.context;y&&!y.pyViewName&&E&&"page"!==n.viewType&&(Lh.setIn(y,"pyViewName",E),Lh.setIn(y,"pyViewContext",I));const A=Gm(i);((e,t)=>{const n=_c(e),r=Nc(e),s=rn(n),{skipBrowserSemanticUrlUpdate:a=!1,viewType:o,isTraditionalUICase:i}=t,c=o===jc.PAGE&&(!s||i)&&!a,{caseTypeID:l}=n;if(c){const t=Fg(Be,{caseClassName:l}).replace(/{.+?}/,String(Cc(r)));e.semanticURL=t,e.directUrlUpdation=!0}})(A,n);const _=Kc(m,f,p),C={acName:m,target:m,context:_};await Gc(A,n,C);const S={target:m,context:_,containerItemID:_,headers:l,parentContext:W(n?.context),isMinimizable:rn(Lh.getIn(A,"data.caseInfo")),doDeleteCaseSummary:n.doDeleteCaseSummary,acTertiary:n.acTertiary,resourceType:F.ASSIGNMENT,debugInfo:g};bc(S,A,{skipFlowNameUpdate:n?.caseViewMode===j.REVIEW_MODE});const T=Bc(A,S);return n.isProcessAction&&(T.data.isProcessAction=n.isProcessAction),o&&(T.data.caseInfo.content.coexistenceAction="openAssignment"),((e,t)=>{e.acTertiary&&(t.data.caseInfo.isFirstAssignment=e.acTertiary)})(n,T),dy(T,m,r,n,i,h,u),c===jc.FORM&&Dc(T.containerItemID)&&rl(T,r),tl(r),(e=>{yi.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_OPENED,e)})({actionInContext:p,assignmentID:n.assignmentID,caseKey:T.key}),r})),nu((()=>{const e=n,t=wc(),a=rn(Lh.getIn(r[0]?.payload,"data.caseInfo"));return o&&t&&a?Zm.postCreateCaseMessage(r[0]?.payload?.data?.caseInfo?.assignments?.[0]?.ID,Eh,r):Eh(r),vc(r,e,s),r[0]?.payload?.isParallelAssignment&&Eh({type:zl,payload:{...r[0].payload,isParallelCall:!0}}),r=[],r})))},my=(e,t)=>{const{insKey:n,headers:r,context:s,debugInfo:a,viewType:o}=e,{removeActionPayload:i}=t,c=e?.pageName?e?.pageName:Sp.getDefaultCasePage(),l=Vg(Be,{caseID:n,params:{pageName:c}});let{restApi:u}=l;const{reqType:d}=l;return"none"===o&&(u=`${u?.split("viewType")[0]}viewType=none`),hi(Bi(u,{method:d,headers:{...r,...a&&{...xi.addDebugHeaders(a)}}},s)).pipe(nu((t=>({response:t.data,actionInPayload:e,headers:kc({...r,...t.headers}),removeActionPayload:i}))),du("Error occurred during ajax call at openWorkByHandle Epic : ",s))},yy="OPEN_WORK_BY_HANDLE",{RESOURCE_TYPES:Ey}=F,Iy=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=fc(Be,r),h=yt(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=fc(Be,s),l=yt(c,a),u=bd(r);await Gc({directUrlUpdation:!o,semanticURL:n},s,{acName:l,containerName:c,target:l,context:u}),e.push(Eg(lg,{containerItemID:r,target:l,context:u,doDeleteCaseSummary:i}))})(t,{activateContainerActionPayload:s,actionInPayload:r});else{const s=Kc(h,p,l,{buildNew:!0}),a=Gm(o),g=((e,t)=>{const{isRemoteCase:n,remoteCaseClass:r}=t,s=Nc(e),a=n?r:Sc(e);let o=Fg(Be,{caseClassName:a},{id:t?.insKey});return o=o?.replace("{workID}",String(Cc(s)))?.replace("{id}",t?.insKey),o})(a,r);a.semanticURL=g,a.directUrlUpdation=!u;const f={acName:h,context:s};await Gc(a,r,f);const m=Bc(a,{target:h,context:s,containerItemID:s,semanticURL:g,headers:c,debugInfo:d});m.caseViewMode=j.REVIEW_MODE,m.resourceType=Ey.CASE,n&&(m.data.caseInfo.content.coexistenceAction="openWorkByHandle"),bc(m,a,{skipFlowNameUpdate:!0}),m.currentCaseViewMode=Lc(e?.actionInPayload?.context);const y=Yc(h,m);i.containerItemID&&Xc(y)&&t.push(Eg(dg,{containerItemID:i.containerItemID,target:h})),t.push(y)}tl(t);(e=>{yi.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.CASE_OPENED,e)})({caseKey:r.insKey,actionInContext:l})},Ay=e=>{let t=0,n=[];return e.pipe(eu(yy),nu((e=>(({actionMgrID:t}=e.payload),e.payload))),ru((e=>{const{context:n,isChild:r,viewType:s}=e,a=fc(Be,e),o=yt(a,n);let i,c=!0;if("none"!==s){const e=Qc(o);c=e.continueExecution,i=e.removeActionPayload}if(!c)return pn.rejectActionByID(t),uu();const{activate:l,activateContainerActionPayload:u}=el(Ey.CASE,o,e);return l&&!r&&"none"!==s?iu({type:ve,activateContainerActionPayload:u,actionInPayload:e}):my(e,{removeActionPayload:i})})),ru((async e=>{if(e&&Ic(e.type))return n.push(zc(e)),n;const t=Ih(e?.actionInPayload?.context),r=xc(e?.actionInPayload.className);if("none"===e?.actionInPayload?.viewType){if("perform"!==t?.context_data?.caseViewMode){const t=Gm(e?.response),s={data:{...t?.data},context:e?.actionInPayload?.context,isArrayDeepMerge:!0};n.push({type:at,payload:{context:s.context,doDeleteConfirmationDetails:!1}}),r&&s.data.caseInfo?.content&&(s.data.caseInfo.content.coexistenceAction="openWorkByHandle"),n.push(Eg(Hh,s));const a=Wd(e?.actionInPayload?.context),o=mc(e?.actionInPayload?.context),i=Object.freeze({target:a,containerItemID:e?.actionInPayload?.context,context:e?.actionInPayload?.context,containerName:o});if(Dc(e?.actionInPayload?.context)){const t=Bc(e?.response,{...i});rl({...t,isArrayDeepMerge:!0},n)}}}else await Iy(e,n,r);return n})),nu((()=>(Eh(n),vc(n,t),n=[],n))))},_y="FINISH_ASSIGNMENT",{RESOURCE_TYPES:Cy}=F,Sy=(e,t)=>{const{containerItemID:n,skipReleaseLockRequest:r,isInCreateStage:s,isProcessAction:a}=t,o=bd(n),i=`${o?.includes("root")?j.APP.ROOT:j.APP.APP}/${hd.MODAL}`;e.push(Eg(dg,{containerItemID:n,context:o,target:i,skipReleaseLockRequest:r,isInCreateStage:s,isProcessAction:a}))},Ty=e=>Ch(".openCaseViewAfterCreate",j.CONTEXT_DATA,e)??!0,Ny=async(e,{translatedDXAPIResponse:t,actionInPayload:n},r,s)=>{const{caseID:a}=n,o=(i=t,Lh.getIn(i,gc.NEXT_ASSIGNMENT_INFO_ID,j.EMPTY_STRING));var i;const c=Sc(t),{caseViewMode:l,headers:u,semanticURL:d,actionMgrID:p,directUrlUpdation:h,key:g,flowName:f,resourceType:m}=r;s&&Object.assign(s,{caseId:a,assignmentId:o,caseType:c}),Sy(e,{...n,skipReleaseLockRequest:!0});const y=`${n?.containerItemID.includes("root")?j.APP.ROOT:j.APP.APP}/${hd.PRIMARY}`,E=Kc(y,hd.PRIMARY),I=xi.getCoreHeadersFromContext(n.context)||!1,A=Bc(t,{target:y,context:E,containerItemID:E,caseViewMode:l,headers:u,semanticURL:d,key:g,flowName:f,resourceType:m,directUrlUpdation:h,debugInfo:I&&I.debugInfo&&{debugId:I.debugInfo[j.COREHEADER_APP_DEBUG_ID]}});if(Ld(y)){const t=Ih(E),s=Nc({data:t}),[,a]=s?s.split(" "):[],o=`You will lose unsaved changes for ${a}. Do you want to continue?`;if(!Ty(n.context))return e;{const{continueExecution:t}=Qc(y,{dirtyMessage:o});if(!t)return r.directUrlUpdation=!1,pn.rejectActionByID(p),uu();A.currentCaseViewMode=Lc(A?.context),e.push(Eg(gg,A))}}else e.push(Eg(Zh,A));return t.directUrlUpdation=h,t.semanticURL=d,await Gc(t,{...A,acName:y},{acName:y,context:E}),e},Ry=e=>/^app\/preview_[0-9]*/g.test(e),Py=(e,t)=>{const n=W(e);return!Ry(e)&&(n===t||/^app\/primary_[0-9]*/g.test(n))},Dy=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=Ih(e),r=c?.response?.data?.caseInfo?.assignments??[],s=n?.caseInfo?.assignments??[],a=Lc(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=Ld(Wd(e));let d=!1;const p=Wd(n),h=fd(p),g=Rd(p);g&&h?.items?.[g]?.key===c?.actionInPayload?.caseID&&(d=!0),Sy(s,{...r,skipReleaseLockRequest:!0});const f=mc(e),m={target:Wd(e),containerItemID:e,context:e,containerName:f};t.doDeleteCaseSummary=r.doDeleteCaseSummary;const y=X(n),E=Ih(y),I=Ih(r.context),A=E?.caseInfo?.ID,_=I?.caseInfo?.ID,C=Ih(e)?.caseInfo?.ID;if(u&&A===_||!u&&(""===o||m.containerItemID.includes(j.WORKAREA)&&"review"===t.caseViewMode||!a&&t.root&&0===Object.keys(t.root).length&&C===t.data?.caseInfo?.ID))(void 0===t?.data?.caseInfo?.content||void 0!==t.data.caseInfo.content&&"object"==typeof t.data.caseInfo.content&&0===Object.keys(t.data.caseInfo.content).length)&&(t.root=void 0,delete t.data?.caseMessages),e.includes(j.WORKAREA)&&t.caseViewMode===j.REVIEW_MODE&&((e,t)=>{const n=e?.assignmentID,r=t?.data?.caseInfo?.assignments??[],s=r[0]?.ID;return n!==s})(r,i)&&(t.flowName=" ",t.clearView=!0),s.push(Eg(ag,{...t,key:o,resourceType:"",...m}));else if(a){const a=Wd(e),i=_d(a,o);if(i)m.target=a,m.context=i,m.containerItemID=i,s.push(Eg(ag,{...t,key:o,resourceType:"",...m}));else{const e=xd(n)[0];if(r.target=e,r.context=Kc(e,j.WORKAREA,n),r?.context){r.containerItemID=r.context,s.push(Eg(Zh,{...r,...t}));const n=r.containerItemID;s.push(Eg(lg,{parentContainerTarget:e,containerItemID:n}))}}}if(r.target=Wd(e),r.containerName=mc(e),r.context=e,r.containerItemID=e,Lh.setIn(t,"acName",m.target),await Gc(i,t),d){const{data:e,caseViewMode:r}=t;n.includes(j.WORKAREA)&&Dc(n)&&(n=X(n));const a={data:e,caseViewMode:r,context:n};Lh.setIn(a.data,["context_data","caseViewMode"],r),s.push({type:at,payload:{context:n}}),s.push(Eg(Hh,a))}if(!a&&t.caseViewMode===j.PERFORM_MODE){const t=((e,t)=>{const n=Wd(e);return _d(n,t)})(e,o),n={data:{caseInfo:{headers:l}},context:t};s.push(Eg(Hh,n)),s.push(vn(((e,t=!1,n=!1)=>{const r=pn.getNextActionMgrId();return{ID:Vh.getPropertyValue(F.CASE_INFO.ASSIGNMENT_ID,"",e),actionID:Vh.getPropertyValue(F.CASE_INFO.ASSIGNMENTACTION_ID,"",e),context:e,caseWideAction:t,contextData:n,options:{actionMgrID:r}}})(t)))}}else{Sy(s,r);let e=!1;const o=Wd(n),i=fd(o),l=Rd(o);if(l&&i?.items?.[l]?.key===c?.actionInPayload?.caseID&&(e=!0),a){const e=xd(n)[0];r.target=e,r.context=Kc(e,j.WORKAREA,n),r.containerItemID=r.context,s.push(Eg(Zh,{...r,...t}));const a=r.containerItemID;s.push(Eg(lg,{parentContainerTarget:e,containerItemID:a}))}if(e){const{data:e,caseViewMode:r}=t,a={data:e,caseViewMode:r,context:n};Lh.setIn(a.data,["context_data","caseViewMode"],r),s.push({type:at,payload:{context:n}}),s.push(Eg(Hh,a))}}},by=async(e,t,n,r,s,a)=>{((e,t,n)=>{if(t.isProcessAction&&(Sy(n,{...t,skipReleaseLockRequest:!0}),e)){const r=`${t?.containerItemID.includes("root")?j.APP.ROOT:j.APP.APP}/${hd.PRIMARY}`,s=Kc(r,hd.PRIMARY),a={insKey:e.ID,className:e.content.classID,context:s,acTargetName:j.PRIMARY,isChild:!0},o={type:ue,payload:{...a}};n.push(o)}})(e.data.caseInfo.parentCaseInfo,t,s);const o=e?.data?.caseInfo?.parentCaseInfo?.ID;if(o){const n=Wd(t?.context),r=md(n,t?.context)?.parentContext,s=Wd(r);t?.isProcessAction&&Ad(s,o)&&ip(r,e?.data?.caseInfo?.lastUpdateTime)}n.resourceType=Cy.CASE,n.directUrlUpdation=!0,t.isProcessAction||await Ny(s,{translatedDXAPIResponse:r,actionInPayload:t},n,a)},Oy=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=Uc.getPropertiesToReplace(a);s.push(Eg(ag,{...e,...r,propertiesToReplace:o})),Lh.setIn(e,"acName",r.target),await Gc(n,e),((e,t,{data:n,caseViewMode:r})=>{const{containerItemID:s}=t,a=bd(s);if(a&&Dc(s)){const t=X(a),o={data:n,caseViewMode:r,context:t};Lh.setIn(o.data,["context_data","caseViewMode"],r),e.push({type:at,payload:{context:t}});const i=Uc.getPropertiesToReplace(s);e.push(Eg(Hh,o,{propertiesToReplace:i}))}})(s,t,e)},vy=async(e,t,n,r,s,a,o,i,c)=>{const{isCaseWideAction:l,isInCreateStage:u,containerItemID:d}=e,p=W(e.context),h=Tc(s),g=Sc(s),f=u&&!h&&!l,m=xd(p)[0],y=m?Rd(m):p,E=mc(d),I=bd(d),A=Object.freeze({target:e.target,containerItemID:d,context:I,containerName:E});f&&!Ry(e.context)?await by(i,e,t,s,a,c):Py(e.context,y)?await Dy(y,t,p,e,a,n,r,s,o):l&&!Py(e.context,y)?(Sy(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=bd(a);e.push(Eg(zh,{containerItemID:a,context:o,container:hd.PREVIEW,containerName:hd.PREVIEW,caseId:s,viewName:F.PREVIEW_VIEW_NAME,caseClassName:t,updateData:!0}))}})(a,e,{caseClassName:g})):await Oy(t,e,s,A,a)},xy=(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?jc.PAGE:n||jc.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}=Vg(p,h),{reqType:f}=Vg(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}=$c(a);e.attachmentsExist=y;const E=u.value.data[a]?.caseInfo?.headers||{},{etag:I}=E,A={"if-match":I,...o};return hi(Bi(g,{method:f,body:m,headers:A},a)).pipe(nu((t=>{const{data:n,headers:r}=t;return{response:n,actionInPayload:e,headers:kc({...A,...r})}})),du("Error occurred during ajax call at finishAssignment Epic : ",a))},{RESOURCE_TYPES:wy}=F,My=(e,t)=>{let n=0,r=[],s={},a="",o={},i=!1,c=!1;return e.pipe(eu(_y),tu((e=>{const l=Sp.isCoexistenceAppOfType(j.APP_TYPE.UIKIT);if(({actionMgrID:n}=e.payload),a=e.payload.context,Xn({context:a,stateObj:Ih(a),clearContextMessages:!0}),!_l(a)){const t={type:F.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return pn.rejectActionByID(n,!0,t),Qt.handleDeferredActionCompletion(e.payload.context),iu([])}return iu(e.payload).pipe(ru((e=>{((e,t)=>{const{containerItemID:n,context:r,actionMgrID:s,isInCreateStage:a,isModalAction:o}=t;if(a&&o){const t=mc(n),a=yt(t,r);e.push(Eg(lg,{containerItemID:n,target:a,actionMgrID:s}))}})(r,e);const n={...e};return xy(n,{state$:t})})),ru((async e=>{if(e&&e.type===Ie){(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=Ih(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};Eh({type:fe,payload:a})}})(e);const t=zc(e);return r.push(t),r}$u.clearContextedCache(a);const{headers:t,actionInPayload:u,response:d}=e,{containerItemID:p,context:h=bd(p),isModalAction:g,isInCreateStage:f}=u;i=u.isCaseWideAction,c=u.isProcessAction;const m=Wd(p);u.target=m;const y=mc(p),E=Object.freeze({target:u.target,containerItemID:p,context:h,containerName:y});Lh.setIn(d.data,j.CASE_INFO.IS_FIRST_ASSIGNMENT,!1),Lh.setIn(d.data,j.CASE_INFO_IS_LOCAL_ACTION,!1),d?.uiResources?.root?.config?.name&&"page"!==u.viewType&&Lh.setIn(d.data,j.CASE_INFO.VIEW_NAME,d?.uiResources?.root?.config?.name),(e=>{yi.publish(j.PUB_SUB_EVENTS.EVENT_EXPRESS_LOCALACTION,e)})({submitResponse:d});let I=Gm(d,{[F.STOPMERGEACTIONS]:!d.nextAssignmentInfo});const A=Sc(I),_=W(u.context),C=xd(_)[0]?Rd(xd(_)[0]):_,S=Tc(I),T=f&&!S;!g||f||Py(u.context,C)||(I=((e,t)=>(e?.data?.caseInfo&&t?.caseInfo?.content&&(e.data.caseInfo.content=t?.caseInfo?.content),e))(I,Ih(p)));const N=Bc(I,{headers:t,actionMgrID:n,directUrlUpdation:!1});let R,P;Oc(N.data,u),N.caseClassName=A,N.resourceType=wy.ASSIGNMENT,N.headers=t;const D=I?.data?.caseInfo?.assignments?.some((e=>e.ID===u.assignmentID)),b=((e,t)=>{const{assignmentID:n}=t;return e?.data?.caseInfo?.assignments?.some((e=>e.ID===n&&"true"===e?.canPerform))})(I,u),O=((e,t,n,r,s)=>{let a;const o=Wd(t);return a=Ud(o)?_d(o,n.data?.caseInfo?.ID):Rd(o),r&&e&&Sh(null,j.CASE_VIEW_MODE_PROP,a)===j.PERFORM_MODE&&s})(D,C,I,g,b),v=u?.actionID===F.LOCAL_ACTIONS.TRANSFER_ASSIGNMENT;if(I?.data?.nextAssignmentInfo&&!v)N.caseViewMode=j.PERFORM_MODE,R=Nc(I),P=!0;else if(O&&!v)N.caseViewMode=j.PERFORM_MODE,R=Nc(I),N.flowName=" ",N.deleteAssignmentSpecificResources=!1,P=!1;else{N.caseViewMode=j.REVIEW_MODE;const e=Ld(Wd(C));R=I?.confirmationNote&&I?.uiResources?.root?.config?.name===j.PY_CONFIRM&&!e?Nc(I):"",P=!1}const x=Nc(I);bc(N,I,{skipFlowNameUpdate:N?.caseViewMode===j.REVIEW_MODE||O});const w=Fg("createWork",{caseClassName:A}).replace(/{.+?}/,String(Cc(x)));if(I.semanticURL=w,N.semanticURL=w,g?(await vy(u,N,P,R,I,r,e,d,o),T&&(s=(e=>{if(!Ty(e.context)){let t;const n=e?.caseTypeID,r=e?.caseTypeName;return t=e.businessID?e.businessID:e.workID,{caseID:t,caseTypeID:n,caseTypeName:r}}return{}})(u))):f&&l&&!S?(Sp.setDefaultCasePage("pyDetails"),await(async(e,t,n)=>{const r={assignmentID:e?.data?.caseInfo?.assignments[0]?.ID,className:e?.data?.caseInfo?.content?.classID,containerName:hd.PRIMARY,targetContainerName:hd.PRIMARY,viewType:jc.PAGE,isLastStepInCreateStage:!0,context:n},s={type:ge,payload:{...r}};t.push(s)})(d,r,W(h))):await Oy(N,u,I,E,r),Mc(e,r),Qt.handleDeferredActionCompletion(a).catch((()=>{})),((e,t,n)=>{const{isModalAction:r,isCaseWideAction:s,caseID:a}=t,o=Py(t.context,n),i=e?.data?.caseInfo?.stages||[],c=e?.data?.caseInfo?.stageID;hc({caseID:a,isModalAction:r,isModalLaunchedFromPrimaryValue:o,isCaseWideAction:s,stages:i,stageID:c})})(N,u,C),!I?.data?.nextAssignmentInfo){const e=((e,t)=>{const{isCaseWideAction:n,assignmentID:r,actionID:s}=t;return{isCaseWideAction:n,caseID:Nc(e),assignmentID:n?null:r,actionID:n?s:null}})(I,u);(e=>{yi.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.END_OF_ASSIGNMENT_PROCESSING,e)})({...e,containerItemID:p})}return((e,{isModalAction:t,target:n,transientItemID:r})=>{if(t){const t=e.find((({type:e})=>e===Me));t?.payload&&(n=t.payload.target,r=t.payload.containerItemID)}const s=pg({target:n,containerItemID:r});s.payload.transientItems.length&&e.push(s)})(r,{transientItemID:p,target:m,isModalAction:g}),r})),nu((()=>{const e=r.find((e=>e.type===Ie));return e?(Qt.handleDeferredActionCompletion(a).catch((()=>{})),(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=Hn(s,a,j.PROPERTY),i={type:F.MESSAGES.MESSAGES_TYPE_ERROR,message:e.localizedValue};bn.mutateField(n,a,o[o.length-1],{messages:[i],type:F.MESSAGES.MESSAGES_TYPE_ERROR,fieldName:r})}}))})(e),pn.rejectActionByID(n)):pn.resolveActionByID(n,s),o?.caseId&&(e=>{yi.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_DONE,e)})(o),sl(r),(i||c)&&(e=>{yi.publish(j.PUB_SUB_EVENTS.EVENT_LOCALACTION_SUBMISSION,e)})({updateState:!0}),r=[],s={},o={},r})))})))},Ly="CANCEL_ASSIGNMENT",Uy=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}=Vg(i,{ID:s,caseID:s,viewType:jc.PAGE});return Oi.getPreviewMode()&&(t[j.SKIPCOREHEADERS]=!0),hi(Bi(c,{method:l,headers:t},a,{includeRemoteSystemIdIfPresent:!!o})).pipe(nu((t=>r?{actionInPayload:e}:{response:t.data,actionInPayload:e,headers:kc(t.headers)})),du(": Error occurred during ajax call at release lock request : ",a))},Fy=(e,t)=>{const{isModalAction:n}=t;return Uy({routeKey:"cancelAssignment",isModalAction:n,...e})},jy=e=>{let t=0,n=[];return e.pipe(eu(Ly),nu((e=>(({actionMgrID:t}=e.payload),e.payload))),ru((e=>{const{isModalAction:n}=e;e.context||(e.context=bd(e.containerItemID));const{context:r}=e,s=(e=>{const{isModalAction:t,containerItemID:n}=e;return t?hd.MODAL:mc(n)})(e),a=yt(s,r),{continueExecution:o}=Qc(a);return o?(e.RemoteSystemID=$.getRemoteHeaderByContext(e.context)??void 0,Fy(e,{isModalAction:n})):(pn.rejectActionByID(t),uu())})),ru((async e=>{if(e&&e.type===Ie)return n.push(zc(e)),n;const{actionInPayload:r,response:s}=e,{containerItemID:a,isModalAction:o,isInCreateStage:i}=r,c=Wd(a),l=bd(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:Nc(s),skipReleaseLockRequest:!1};return i&&n.push(Eg(ag,u)),!o&&Dc(a)&&(async(e,t)=>{const{childContainerItemID:n,caseViewMode:r,referencedUsers:s}=t,a=W(n),o={context:bd(a),data:{referencedUsers:s,context_data:{caseViewMode:r}}};o.data={...t.response.data,...o.data},e.push(Eg(Hh,o))})(n,{childContainerItemID:a,caseViewMode:j.REVIEW_MODE,referencedUsers:s?.data.referencedUsers,response:s}),u.skipReleaseLockRequest=!0,n.push(Eg(dg,u)),n})),nu((()=>(Eh(n),vc(n,t),n=[],n))))},Vy="NAVIGATE_TO_STEP",ky=(e,t)=>{const{ID:n,stepID:r,containerItemID:s,context:a=bd(s),isInCreateStage:o}=e,{state$:i}=t,c={ID:n,stepID:r,viewType:o?jc.PAGE:jc.FORM},{restApi:l,reqType:u}=Vg("navigateToStep",c),{content:d}=$c(a),p=i.value.data[a].caseInfo.headers;return hi(Bi(`${l}`,{method:u,body:d,headers:{"if-match":p&&p.etag}},a)).pipe(nu((t=>({response:t.data,actionInPayload:e,headers:kc({...p,...t.headers})}))),du("Error occurred during ajax call at navigateToStep Epic : ",a))},{RESOURCE_TYPES:$y}=F,By=(e,t)=>{let n=0,r=[];return e.pipe(eu(Vy),tu((e=>(({actionMgrID:n}=e.payload),iu(e.payload).pipe(ru((e=>(er(e.context),ky(e,{state$:t})))),ru((async e=>{if(e&&Ic(e.type))return r.push(zc(e)),r;const{actionInPayload:t,response:n,headers:s}=e,{containerItemID:a,context:o=bd(a),isModalAction:i}=t;$u.clearContextedCache(t.context);const c=Wd(a),l=mc(a),u=Object.freeze({target:c,containerItemID:a,context:o,containerName:l}),d=n?.data?.caseInfo?.content,p=n?.uiResources?.root?.config?.name,h=n?.uiResources?.root?.config?.context;d&&!d.pyViewName&&p&&"page"!==t.viewType&&(Lh.setIn(d,"pyViewName",p),Lh.setIn(d,"pyViewContext",h));const g=Gm(n),f={acName:c,...u};await Gc(g,t,f);const m=Bc(g,{...u,headers:s});n?.nextAssignmentInfo||(m.caseViewMode=j.REVIEW_MODE),Mc(e,r),m.doDeleteCaseSummary=t.doDeleteCaseSummary,m.resourceType=$y.ASSIGNMENT,bc(m,g),Oc(m.data,t);const y=g.data?.caseInfo?.stages,E=g.data?.caseInfo?.stageID;return hc({caseID:Nc(g),isModalAction:i,stages:y,stageID:E}),Dc(a)&&rl(m,r),r.push(Eg(ag,m)),tl(r),r})),nu((()=>(Eh(r),vc(r,n),r=[],r))))))))},Gy=e=>{const{caseID:t,context:n}=e,{restApi:r,reqType:s}=Vg("deleteCaseInCreateStage",{ID:t});return hi(Bi(r,{method:s},n)).pipe(nu((t=>({response:t.data,actionInPayload:e,headers:kc(t.headers)}))),du(": Error occurred during ajax call at deleteCaseInCreateStage Epic : ",n))},Wy=e=>{yi.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_DELETED,e)},Hy=(e,t)=>{let n,r=0,s=[];return e.pipe(eu(Yl),nu((e=>(({actionMgrID:r,caseType:n}=e.payload),e.payload))),ru((e=>e.ignoreCaseDeletion?iu({actionInPayload:e}):Gy(e))),ru((async e=>{if(e&&Ic(e.type)){const{payload:t}=e,n=zc({...e,...t,actionMgrID:r});return s.push(n),s}const{actionInPayload:n}=e,{context:a,isModalAction:o}=n,i=o?hd.MODAL:hd.PRIMARY,c=yt(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 Gc({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(Eg(dg,l)),s})),nu((()=>(Eh(s),vc(s,r)===j.PROMISE_VALUE.RESOLVE&&Wy({caseType:n}),s=[],s))))},qy=(e,t)=>{const{assignmentID:n,actionID:r,context:s}=e,{restApi:a,reqType:o}=Vg("save",{assignmentID:n,actionID:r}),{content:i}=$c(s),c=t.value.data[s]?.caseInfo?.headers;return hi(Bi(a,{method:o,body:i,headers:{"if-match":c&&c.etag}},s)).pipe(nu((t=>({response:t.data,actionInPayload:e,headers:kc(t.headers)}))),du(": Error occurred during ajax call at saveAndCloseAssignment Epic at save action : ",s))},zy=(e,t=!1)=>{const{action:n,state$:r,actionMgrID:s}=e;let a=[];return iu(n.payload).pipe(ru((e=>qy(e,r))),ru((e=>{if(e&&Ic(e.type))return iu(e);const{containerItemID:t}=e&&e.actionInPayload,r=W(t),s=Wd(r),o=fd(s),i=xd(r)[0];let c=i?Rd(xd(r)[0]):r;if(!Ld(Wd(c))){const t=fd(i);t?.accessedOrder.forEach((n=>{e.actionInPayload.caseID===t.items[n].key&&(c=t.items[n].context)}))}const l=Rd(s);n.payload.canUpdateAvailableActions&&Bm(e.response);if(c&&a.push((t=>Eg(Hh,{context:t,data:{caseInfo:{headers:e.headers}}}))(c)),o?.items?.[l]?.key===e?.actionInPayload?.caseID){const n={context:r,data:{...e.response.data,caseInfo:{...e.response.data?.caseInfo||{},headers:e.headers}}},s=Uc.getPropertiesToReplace(t);a.push(Eg(Hh,n,{propertiesToReplace:s}))}return a.push(Eg(ag,{context:t})),Mc(e,a),e.actionInPayload.RemoteSystemID=$.getRemoteHeaderByContext(e.actionInPayload.context)??void 0,Uy(e.actionInPayload)})),ru((async n=>{if(n&&Ic(n.type)){const{payload:t}=n,r=zc({...n,...t,actionMgrID:s});a.push(r);const o=e.action.payload.modalLoadingContainer;if(o){const e=o.context,{context_data:t}=Ih(e)||{};t?.isLoading&&Hd(e)}return a}const{actionInPayload:r}=n,{context:o,containerName:i}=r,c={target:yt(i,o),containerItemID:o,context:o};return t||a.push(Eg(dg,c)),a})),nu((()=>(Eh(a),vc(a,s),t||(a=[]),a))))},Yy=(e,t)=>{let n,r=0;return e.pipe(eu(Kl),tu((e=>{const{saveOnly:s}=e.payload;({actionMgrID:r,caseType:n}=e.payload);return zy({action:e,state$:t,actionMgrID:r,caseType:n},s)})))},Ky=e=>{const{callbacks:t}=e;if(t?.submit){const e=e=>{var n;t.submit(e),n="expressLocalActionSubmit",yi.unsubscribe(j.PUB_SUB_EVENTS.EVENT_EXPRESS_LOCALACTION,n)};n=e,r="expressLocalActionSubmit",yi.subscribe(j.PUB_SUB_EVENTS.EVENT_EXPRESS_LOCALACTION,n,r)}var n,r},{LOCAL_ACTION_TYPE:Xy}=j,{RESOURCE_TYPES:Jy}=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===Xy.CASE_WIDE||t===Xy.EXPRESS?Ye:qe})(e),d=jc.FORM,{reqType:p}=Vg(u,{caseID:s,ID:r,actionID:n,viewType:d});let{restApi:h}=Vg(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 hi(Bi(h,{method:p,headers:c},g)).pipe(nu((t=>({response:t.data,actionInPayload:e,headers:kc(t.headers)}))),du(`: 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"===fc(r,e)){s=xd(e.contextName)[0]?xd(e.contextName):Wd(e.contextName);const n=s?Rd(s):e.contextName,r=bd(n),a=fc(e.openActionType,e),o=yt(a,e.context),i=K(e.context,H(a,e.context));if(Eh(Zh({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}}})),Eh(og({context:i})),e.modalLoadingContainer={target:o,context:i},!xd(e.contextName)[0])return Qy(e,t);if(!e.continueExecution)return Qy(e,t);if(!Vl(r))return Qy(e,t);e.saveActionPayload.modalLoadingContainer=e.modalLoadingContainer,e.saveActionPayload.canUpdateAvailableActions=!e.saveActionPayload.isModalAction;return hi([Xl(e.saveActionPayload)]).pipe(ru((e=>(e=>{let t,n=0;const r=[],s={value:yh()?.getState()};return iu(e).pipe(eu(Kl),tu((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 pn.rejectActionByID(n,!0,e),iu([])}return zy({action:e,state$:s,actionMgrID:n,caseType:t,actionsOut:r},!0)})))})(e))),ru((n=>{if(1===n.length&&Ic(n[0].type)){const{continueExecution:n}=Qc(s);if(!n)return pn.rejectActionByID(e.actionMgrID),lu.pipe(gi((()=>uu()))).toPromise();if(n)return Qy(e,t)}return Qy(e,t)})),nu((e=>e)))}return Qy(e,t)},eE=async(e,t,{headers:n,actionInPayload:r})=>{const{context:s,actionName:a,openActionType:o,doDeleteCaseSummary:i,modalLoadingContainer:c}=r,l=Gm(e),u=fc(o,r),d=c?.target??yt(u,s);let p,h,g=!1;!Fd(d)||Ud(d)&&!Ad(d,e.data.caseInfo.ID)?(h=H(u,s),Ec(u)&&(h=K(s,h)),p=h,g=!0):(p=Ud(d)?_d(d,e.data.caseInfo.ID):Rd(d),h=bd(p));const f={acName:d,target:d,containerName:u,context:h};await Gc(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 E=Bc(l,{target:d,context:h,containerItemID:p,caseViewMode:y,doDeleteCaseSummary:i,headers:n,actionName:a,isMinimizable:!1,isInCreateStage:Ec(u),resourceType:Jy.ASSIGNMENT,isProcessAction:r.isProcessAction,showProgress:r.showProgress,progressMessage:r.progressMessage,assignmentID:r.assignmentID,actionType:r.actionType});m&&bc(E,l),Ec(u)&&delete E.doDeleteCaseSummary,r.openActionType===Ke&&(E.isBulkAction=!0,E.data.caseInfo.actionButtons.main[0].jsAction="async"===r.runningMode?"submitBulkActionAsync":"submitBulkAction",E.data.caseInfo.actionButtons.secondary[0].jsAction="cancelBulkAction",E.data.caseInfo.cases=r.selectedList);const I=g?Zh:ag;if(E.data.context_data.isProcessAction=r.isProcessAction,t.push(Eg(I,E)),g||t.push(Eg(ig,E)),g){const s=xd(r.contextName),a=_d(s,e.data.caseInfo.ID);if(a){const e={data:{caseInfo:{headers:n}},context:a};t.push(Eg(Hh,e))}}return p!==Rd(d)&&t.push(Eg(lg,{target:d,containerItemID:p})),Dc(p)&&!c?.context&&rl(E,t),E.caseViewMode===j.REVIEW_MODE&&t.push(Eg(dg,E)),t},tE="OPEN_LOCAL_ACTION",nE=(e,t)=>Zy(e,t),rE=e=>{let t=0,n=[];return e.pipe(eu(tE),nu((e=>(({actionMgrID:t}=e.payload),e.payload))),ru((e=>nE(e,{actionMgrID:t}))),ru((async e=>{if(!e)return lu;if(Ic(e.type)){const t=zc(e);n.push(t);const{context_data:r}=Ih(e.payload.context)||{};return r?.isLoading&&n.push(Eg(ig,e.payload)),n}const{actionInPayload:t,headers:r,response:s}=e,{actionID:a}=t;return Lh.setIn(s,"data.caseInfo.activeActionID",a),Lh.setIn(s.data,j.CASE_INFO_IS_LOCAL_ACTION,!0),t.refreshConditions&&Lh.setIn(s.data,j.CASE_INFO_REFRESH_CONDITIONS,t.refreshConditions),await eE(s,n,{headers:r,actionInPayload:t}),Ky(t),n})),nu((()=>(Eh(n),vc(n,t),n=[],n))))},sE=e=>{const{actionID:t,context:n,openActionType:r,caseTypeID:s,bulkContextID:a="",bulkContextType:o=""}=e,i=Ke,{reqType:c,restApi:l}=Vg(i,{caseTypeID:s,actionID:t,bulkContextID:a,bulkContextType:o});return hi(Bi(l,{method:c},n)).pipe(nu((t=>({response:t.data,actionInPayload:e,headers:kc(t.headers)}))),du(`: Error occurred during ajax call at ${r} Epic : `,n))},aE=e=>{const{callbacks:t}=e;if(t?.submit){const e=e=>{var n;t.submit(e),n="bulkActionSubmit",yi.unsubscribe(j.PUB_SUB_EVENTS.EVENT_BULKACTION,n)};n=e,r="bulkActionSubmit",yi.subscribe(j.PUB_SUB_EVENTS.EVENT_BULKACTION,n,r)}var n,r},oE="OPEN_BULK_ACTION",iE=e=>{let t=0,n=[];return e.pipe(eu(oE),nu((e=>(({actionMgrID:t}=e.payload),e.payload))),ru((e=>((e,t)=>{const{context:n}=e,{actionMgrID:r}=t;e.openActionType=Ke;const s=fc(Ke,e),a=yt(s,n),{continueExecution:o}=Qc(a);return o?sE(e):(pn.rejectActionByID(r),uu())})(e,{actionMgrID:t}))),ru((async e=>{if(e&&Ic(e.type)){const t=zc(e);return n.push(t),n}const{actionInPayload:t,headers:r,response:s}=e,{actionID:a}=t;return Lh.setIn(s,"data.caseInfo.activeActionID",a),await eE(s,n,{headers:r,actionInPayload:t}),aE(t),n})),nu((()=>(1===n.length&&Ic(n[0].type)?pn.rejectActionByID(t):pn.resolveActionByID(t),Eh(n),n=[],n))))};var cE=Array.isArray,lE=Object.getPrototypeOf,uE=Object.prototype,dE=Object.keys;function pE(e){if(1===e.length){var t=e[0];if(cE(t))return{args:t,keys:null};if((r=t)&&"object"==typeof r&&lE(r)===uE){var n=dE(t);return{args:n.map((function(e){return t[e]})),keys:n}}}var r;return{args:e,keys:null}}var hE=Array.isArray;function gE(e){return nu((function(t){return function(e,t){return hE(t)?e.apply(void 0,mo([],fo(t))):e(t)}(e,t)}))}function fE(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=function(e){return _o(au(e))?e.pop():void 0}(e),r=pE(e),s=r.args,a=r.keys,o=new Yo((function(e){var t=s.length;if(t)for(var n=new Array(t),r=t,o=t,i=function(t){var i=!1;ri(s[t]).subscribe(ii(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(gE(n)):o}const mE=e=>{const{actionID:t,context:n,cases:r,classID:s}=e,{content:a}=$c(n,{nonEmptyAndChangedData:!0});let o=5;try{const e=uc.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}=Vg(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(hi(Bi(d,{method:u,body:a},n)).pipe(nu((t=>{const{data:n,headers:r}=t;return{response:n,actionInPayload:e,headers:kc({...r})}})),du("Error occurred during ajax call at submitbulkaction Epic : ",n)));return fE(p)},yE=e=>{yi.publish(j.PUB_SUB_EVENTS.EVENT_BULKACTION,e)},EE="SUBMIT_BULK_ACTION",IE=e=>{let t,n=0,r=[],s="";return e.pipe(eu(EE),tu((e=>{const{isFormValid:a}=e.payload;if(({actionMgrID:n}=e.payload),!a){const e={type:F.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return pn.rejectActionByID(n,!0,e),iu([])}return iu(e.payload).pipe(ru((e=>(t=e,mE(t)))),ru((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`,yE({submitResponse:e}),t.target="HYBRID"===Sp.getRenderingMode()?Wd(i):`${j.APP.APP}/${hd.MODAL}`,r.push(Eg(dg,{containerItemID:i,context:c,target:t.target,skipReleaseLockRequest:!0})),a&&r.push(Eg(ug,{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})),nu((()=>(pn.resolveActionByID(n,s),Eh(r),r=[],r))))})))},AE=e=>{const{actionID:t,context:n,cases:r}=e,{content:s}=$c(n,{nonEmptyAndChangedData:!0});s.cases=r.map((e=>({ID:e})));const a=Xe,{reqType:o,restApi:i}=Vg(a,{actionID:t,runningMode:"async"});return hi(Bi(i,{method:o,body:s},n)).pipe(nu((t=>{const{data:n,headers:r}=t;return{response:n,actionInPayload:e,headers:kc({...r})}})),du("Error occurred during ajax call at submitbulkaction Epic : ",n))},_E=e=>{yi.publish(j.PUB_SUB_EVENTS.EVENT_BULKACTION,e)},CE="SUBMIT_BULK_ACTION_ASYNC",SE=e=>{let t,n=0,r=[],s="";return e.pipe(eu(CE),tu((e=>{const{isFormValid:a}=e.payload;if(({actionMgrID:n}=e.payload),!a){const e={type:F.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return pn.rejectActionByID(n,!0,e),iu([])}return iu(e.payload).pipe(tu((e=>(t=e,AE(t)))),nu((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",_E({submitResponse:i}),t.target=`${j.APP.APP}/${hd.MODAL}`,r.push(Eg(dg,{containerItemID:a,context:o,target:t.target,skipReleaseLockRequest:!0})),c&&r.push(Eg(ug,{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})),nu((()=>(pn.resolveActionByID(n,s),Eh(r),r=[],r))))})))},TE=(e,t)=>Zy(e,t),NE=e=>{let t=0,n=[];return e.pipe(eu(ql),nu((e=>(({actionMgrID:t}=e.payload),e.payload))),ru((e=>(er(e.context),TE(e,{actionMgrID:t,isProcessAction:!0})))),ru((async e=>{if(e&&Ic(e.type)){const t=zc(e);return n.push(t),n}const{actionInPayload:t,headers:r,response:s}=e;return await eE(s,n,{headers:r,actionInPayload:t}),n})),nu((()=>(sl(n),vc(n,t),n=[],n))))},RE=e=>{let t=0,n=[];return e.pipe(eu(Se,Me),nu((e=>(({actionMgrID:t}=e.payload),e.payload))),ru((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?Uy(e):t!==r||s||a||!u?t?.includes(j.MODAL)&&Lc(dp(t))===j.REVIEW_MODE?Uy(e):iu([]):Uy(e)})),ru((e=>(e&&Ic(e.type)&&n.push(zc(e)),n))),nu((()=>(Eh(n),vc(n,t),n=[],n))))};var PE=new ff(df),DE=PE;function bE(e,t,n){void 0===e&&(e=0),void 0===n&&(n=DE);var r=-1;return null!=t&&(su(t)?n=t:r=t),new Yo((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 OE(e,t){return void 0===e&&(e=0),void 0===t&&(t=PE),e<0&&(e=0),bE(e,e,t)}function vE(e){return oi((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(ii(n,(function(t){null==a||a.unsubscribe(),r=!0,s=t,a=ii(n,o,xo),ri(e(t)).subscribe(a)}),(function(){o(),n.complete()}),void 0,(function(){s=a=null})))}))}const xE=(e,t,n,r,s)=>{if(s!==j.RESOURCE_STATUS.CREATE)return;ll.isStateMachineExist(e,t,n)||ll.setStateMachine(e,n,t,new dr(n,t,e));ll.getStateMachine(e,t,n).insert({},r+1,!0,{isDefault:!0})},wE=e=>{const{context:t}=e;let n={...$c(t).content,contextData:!1};const r=ol(t);Lh.isEmpty(r)||(n=al(r,n));const{restApi:s,reqType:a}=Vg("refreshCaseView",e);return n.interestPage=e.interestPage,hi(Bi(s,{method:a,body:n},t)).pipe(nu((t=>({actionInPayload:e,response:t.data,headers:kc(t.headers)}))),du(": Error occurred during ajax call : ",t))},ME=e=>{let t=0,n=[],r="";return e.pipe(eu(ht),nu((e=>(({actionMgrID:t}=e.payload),e.payload))),ru((e=>wE(e))),ru((async e=>{if(e&&e.type===Ie)return n.push(zc(e)),{actionsOut:n,actionInPayload:{skipPageInstructions:!0}};const{actionInPayload:t,response:s}=e,a=t.containerName,o=yt(a,t.context);let i=Kc(o,a,t.context);i=K(t.context,i);const c=Gm(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=Ih(t.context)?.context_data?.caseInfo,d=`${t.pageReference}${t.targetProperty}`,p=qn(u,d.replace(j.CASE_INFO.CASE_INFO_CONTENT,"").slice(1),t.index);c.uiResources.context_data.caseInfo={...c.uiResources.context_data.caseInfo,content:Lh.mergeDeep(c.uiResources.context_data.caseInfo?.content,p?.content)};const h=Vh.getProperty(".RemoteSystemID",j.CASE_INFO.HEADERS,t.context),g={acName:o,context:i};await Gc(c,t,g);const f={target:o,context:i,containerItemID:i};h&&(f.headers={RemoteSystemID:h});const m=Bc(c,f);m.resourceStatus=t.actionType,m.isMultiRecordData=!0,m.parentContext=t.context,m.heading=t.heading,m.clearStateMachine=!1;const y=Yc(o,m);return r=i,n.push(y),tl(n),{actionsOut:n,actionInPayload:t}})),nu((({actionInPayload:e})=>(Ac(n)?pn.rejectActionByID(t):pn.resolveActionByID(t),e.skipPageInstructions||xE(r,e.pageReference,e.targetProperty,e.index,e.actionType),Eh(n),n=[],n))))},LE=e=>{let t,n="",r=[];return e.pipe(eu(gt),tu((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 pn.rejectActionByID(n,!0,t),Qt.handleDeferredActionCompletion(e.payload.context),iu([])}return iu(e.payload).pipe(ru((e=>(t=e,wE(t)))),ru((async e=>{if(e&&e.type===Ie){const t=zc(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,Ir(a).forEach((e=>{const t=Lh.convertClipboardPageToPageRefNotation(e.target);ll.isStateMachineExist(o,i,t)||ll.setStateMachine(o,t,i,new dr(t,i,o));const n=ll.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(c);break;case"replace":n.replacePage(e.content);break;case"move":n.move(e.listIndex,e.listMoveToIndex);break;case"delete all":n.deleteAll()}})),r.push(Eg(dg,{containerItemID:n,context:s,target:t.target,skipReleaseLockRequest:!0})),r})),nu((()=>{if(Ac(r))pn.rejectActionByID(n),Qt.handleDeferredActionCompletion(t.context);else{pn.resolveActionByID(n),Qt.handleDeferredActionCompletion(t.context);const{pageReference:r}=e.payload;if(Vh.getPropertyValue(j.CONTEXT_DATA_MODAL_VIEW.IS_MULTI_RECORD_DATA,r,t.parentContext)){const e=Vh.getPropertyValue(F.CASE_INFO.CASE_INFO_ID,r,t.parentContext),n=Vh.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,"");Mn(e,n,t.parentContext,a,{})}else jn(t.parentContext,j.CASE_INFO.CASE_INFO_CONTENT,{})}return Eh(r),r=[],r})))})))},UE=e=>{const{caseID:t,headers:n,debugInfo:r,context:s}=e,a=Vg("getDescendants",{caseID:t}),{restApi:o}=a,{reqType:i}=a;return hi(Bi(o,{method:i,headers:{...n,...r&&{...xi.addDebugHeaders(r)}}},s)).pipe(nu((t=>({actionInPayload:e,response:t.data,headers:kc({...n,...t.headers})}))),du("Error ocurred during ajax call at getDescendants Epic : ",s))},FE=e=>{let t=0,n=[];return e.pipe(eu(Gu),nu((e=>(({actionMgrID:t}=e.payload),e.payload))),ru((e=>UE(e))),ru((async e=>{if(e&&Ic(e.type))return n.push(zc(e)),n;const{actionInPayload:t,response:r}=e,s={};Lh.setIn(s,"caseInfo.childCases",r?.childCases??[]);const a={data:s,context:t?.context};return n.push(Eg(Hh,a)),n})),nu((()=>(Eh(n),vc(n,t),n=[],n))))},jE=[iy,fy,Ay,rE,iE,IE,SE,NE,My,By,jy,RE,Yy,Hy,e=>e.pipe(eu(He),vE((()=>OE(100))),nu((e=>{const{actionMgrID:t,isChildCase:n,isModalAction:r,isProcessAction:s,isDataObject:a,skipReleaseLockRequest:o,isInCreateStage:i}=e.payload;return pn.resolveActionByID(t),yi.publish(j.PUB_SUB_EVENTS.EVENT_SHOW_CANCEL_ALERT,{isModalAction:r,hideDelete:!s&&n,isDataObject:a,skipReleaseLockRequest:o,isInCreateStage:i}),[]}))),e=>e.pipe(eu(Le),vE((()=>OE(100))),nu((e=>{const{actionMgrID:t,context:n,containerName:r,containerItemID:s}=e.payload,a=yt(r,n);return pn.resolveActionByID(t),Eh(Eg(lg,{containerItemID:s,target:a,doDeleteCaseSummary:!1})),[]}))),ME,LE,FE],VE=jE;function kE(){return oi((function(e,t){e.subscribe(ii(t,xo))}))}const{RESOURCE_TYPES:$E}=F,BE=[e=>e.pipe(eu(te),nu((e=>e.payload)),ru((e=>{const t={caseID:e.caseId,viewID:e.viewName,caseClassName:e.caseClassName,RemoteSystemID:e.RemoteSystemID};if(e.containerName===hd.PREVIEW&&e.context&&e.caseId&&!e.updateData){const t=yt(hd.PREVIEW,e.context),n=Kc(t,hd.PREVIEW,e.context,{buildNew:!0}),r=decodeURI(e.caseId);Eh(Zh({...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}=Vg("loadView",t);return e.viewContext===$E.PAGE&&({restApi:r,reqType:s}=Vg(je,{page:e.viewName,pageClass:e.pageClass})),hi(Bi(r,{method:s,headers:n},e.context)).pipe(nu((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:kc(t.headers),rootView:Lh.getIn(r,j.ROOT)}})),du(": Error ocurred during ajax call at loadView Epic : ",e.viewLoadingContainer?.context??e.context))})),ru((async e=>{const t={};if(e?.type===Ie){if(t.actionsOut=zc(e),e?.payload?.context?.includes(hd.PREVIEW)){const n={...Ih(e.payload.context),caseInfo:{progress:!1,error:!0}},r=yt(hd.PREVIEW,e.payload.context);t.actionsOut=Eg(ag,{key:n.key,target:r,containerName:hd.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||pc.getTargetViewContainerName(je),a=r?.target??yt(s,e.context);return{target:a,context:r?.context??(t===hd.PREVIEW&&n?e.context:Kc(a,s,e.context,{buildNew:!!t}))}})(n);n.context=c;const l={acName:i,context:c};let u={};u=Gm(r),u.directUrlUpdation=!1,await Gc(u,n,l);const d={...n,target:i,context:c,containerItemID:a||c,headers:s},p=Bc(u,d);if(p.resourceType=$E.CASE,o&&!p.updateData){p.caseViewMode=j.REVIEW_MODE;const e=Wd(p?.context);((e,t,n,r,s)=>{e&&s===hd.PREVIEW?(n.data.caseInfo.progress=!1,delete n.root,r.actionsOut=Eg(ag,{...n,containerName:s})):e?(r.actionsOut=[],r.actionsOut.push(Eg(lg,{target:t,containerItemID:e}))):r.actionsOut=Eg(Zh,{...n,containerName:s})})(_d(e,p.key),e,p,t,o)}else p.preserveClientChanges=!0,t.actionsOut=[],o===hd.PREVIEW&&t.actionsOut.push({type:at,payload:{context:c}}),((e,t)=>{if(e.key){const n=Wd(e?.context),r=_d(n,e.key),s=e?.context;!r&&Dc(s)||t?.actionsOut?.push(Eg(Hh,e))}else t?.actionsOut?.push(Eg(Hh,e))})(p,t)}catch(e){console.error(e),t.rootView={type:"error",payload:e}}const{caseId:n,context:r,viewName:s}=e.actionConfig;return"pyCasePreview"===s&&(e=>{yi.publish(j.PUB_SUB_EVENTS.CASE_EVENTS.CASE_PREVIEW,e)})({caseId:n,context:r}),t})),nu((({rootView:e,actionsOut:t,actionMgrID:n=0})=>(pn.resolveActionByID(n,e),t)))),e=>{let t=0,n=[];return e.pipe(eu(ne),nu((e=>(({actionMgrID:t}=e.payload),e.payload))),ru((e=>{yi.publish(F.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_STARTED);const{debugInfo:n,context:r,viewName:s,className:a,skipSemanticUrl:o=!1,containerName:i=pc.getTargetViewContainerName(je)}=e,c=n&&{...xi.addDebugHeaders(n)},l=yt(i,r);let u="",d={},p=!0;if(!o){if(u=Fg(je,{page:s,pageClass:a}),l&&u){const{activate:t,activateContainerActionPayload:n}=el($E.PAGE,l,{semanticURL:u});if(t)return(e=>{e?.containerItemID&&uc.updateState(e.containerItemID,"traditionalGadgetId",Uc.getUniqueGadgetId(),{skipDirtyValidation:!0})})(n),iu({type:ve,activateContainerActionPayload:n,actionConfig:e})}if(Rd(l)&&({continueExecution:p,removeActionPayload:d}=Qc(l)),!p)return pn.rejectActionByID(t),uu()}const{restApi:h,reqType:g}=Vg(je,{page:s,pageClass:a});return hi(Bi(h,{method:g,headers:c},r)).pipe(nu((t=>{let n={};return n="string"==typeof t.data?JSON.parse(t.data):t.data,{response:{...n,key:u,semanticURL:u},actionConfig:e,headers:kc(t.headers),removeActionPayload:d,skipSemanticUrl:o}})),du(": Error ocurred during ajax call at showPage Epic : ",e.context))})),ru((async e=>{if(e&&e.type===Ie)return n.push(zc(e)),n;let{type:t}=e;const{actionConfig:r,skipSemanticUrl:s}=e,a=r.containerName||pc.getTargetViewContainerName(ne),o=yt(a,r.context);yi.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=_d(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:bd(s)};r.isTraditionalRemoteCase||await Gc({directUrlUpdation:!0,semanticURL:t},r,a,!0),n.push(Eg(lg,{target:o,containerItemID:s}))}else{const t=Kc(o,a,r.context),{response:c,headers:l={},removeActionPayload:u}=e,d=Gm(c,{isCreateDataObject:r.isCreateDataObject});d.directUrlUpdation=!s;const p={acName:o,context:t},h=Lc(t);await Gc(d,r,p);const g={target:o,context:t,containerItemID:t,headers:l,debugInfo:r.debugInfo,currentCaseViewMode:h},f=Bc(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=Uc.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:Cc(Uc.getRemoteCaseKey(t.assignmentID,t.insKey))}},n.isTraditionalRemoteCase=!0,n.className=t.className)})(r,i,f),f.data??={},f.data.traditionalGadgetId=Uc.getUniqueGadgetId();const m=Yc(o,f);u.containerItemID&&Xc(m)&&n.push(Eg(dg,{containerItemID:u.containerItemID,target:o})),n.push(m),tl(n)}return yi.publish(F.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_DONE,{target:o,pageName:e.actionConfig.viewName,pageClass:e.actionConfig.className}),n})),nu((()=>{pn.resolveActionByID(t),Eh(n),n=[]})),kE())}],GE=BE;const WE=(e,t)=>{const{context:n,pageName:r,dataContext:s,dataContextParameters:a,semanticURL:o,skipSemanticUrl:i,RemoteSystemID:c}=e,{removeActionPayload:l}=t,{restApi:u,reqType:d,body:p}=Vg(Ve,{pageName:r,dataContext:s,dataContextParameters:a}),h={};return h.RemoteSystemID=c,hi(Bi(u,{method:d,headers:h,body:p},n)).pipe(nu((t=>({response:{...t.data,key:o,semanticURL:o},actionConfig:e,headers:kc(t.headers),removeActionPayload:l,skipSemanticUrl:i}))),du("Error occurred during ajax call at showData Epic : ",e.context))},{RESOURCE_TYPES:HE}=F,qE=e=>{let t,n=0,r=[];return e.pipe(eu(re),(s=e=>(({actionMgrID:n}=e.payload),iu(e.payload).pipe(ru((e=>((e,t)=>{const{context:n,pageName:r,dataContext:s,dataContextParameters:a,skipSemanticUrl:o=!1,isDeferLoaded:i=!1,parentAction:c="",resourceType:l,containerName:u,RemoteSystemID:d}=e,p=yt(u,n);let h="",g={},f=!1;if(!o){h=Fg(Ve,{pageName:r,dataViewName:s},a);const{activate:n,activateContainerActionPayload:o}=el(HE.PAGE,p,{semanticURL:h});if(n)return iu({type:ve,activateContainerActionPayload:o,actionConfig:e});if(({continueExecution:f,removeActionPayload:g}=Qc(p)),!f)return pn.rejectActionByID(t),uu()}return WE({context:n,pageName:r,dataContext:s,dataContextParameters:a,semanticURL:h,skipSemanticUrl:o,containerName:u,isDeferLoaded:i,parentAction:c,resourceType:l,RemoteSystemID:d},{removeActionPayload:g})})(e,n))),ru((async e=>{if(e&&e.type===Ie)return r.push(zc(e)),r;const{type:n,actionConfig:s,headers:a,response:o,skipSemanticUrl:i}=e;t=Lh.getIn(o,j.ROOT);const{containerName:c,parentAction:l,resourceType:u}=s,d=yt(c,s.context);let p;const h=Lc(s?.context);if(s.isDeferLoaded){p=Gm(o),p.directUrlUpdation=!i;const t={acName:d,context:s.context};await Gc(p,s,t);const n={target:d,headers:a,context:s.context,containerItemID:e.containerItemID},c=Bc(p,n);return r=Eg(Hh,c),r}if(n===ve){const{activateContainerActionPayload:{semanticURL:t,containerItemID:n}}=e,a={acName:d,context:bd(n)};await Gc({directUrlUpdation:!0,semanticURL:t},s,a,!0),r.push(Eg(lg,{target:d,containerItemID:n,resourceType:HE.DATA}))}else if("DATA"===u&&l===pt){const{context:e}=s,t=o?.data,n={context:e,data:t};r.push(Eg(Hh,n))}else{const t=Kc(d,c,s.context),{removeActionPayload:n}=e;p=Gm(o),p.directUrlUpdation=!i;const l={acName:d,context:t};await Gc(p,s,l);const u=Bc(p,{target:d,context:t,containerItemID:t,headers:a,currentCaseViewMode:h});u.resourceType=HE.DATA;const g=Yc(d,u);n.containerItemID&&Xc(g)&&r.push(Eg(dg,{containerItemID:n.containerItemID,target:d})),tl(r),r.push(g)}return r})),nu((()=>(pn.resolveActionByID(n,t),Eh(r),r=[],r))))),_o(a)?ru(s,a,1):ru(s,1)));var s,a},zE=e=>{const{dataViewName:t,context:n,dataViewParameters:r}=e,s={data_view_ID:t,dataViewParameters:encodeURIComponent(JSON.stringify(r))},{restApi:a,reqType:o}=Vg("deleteDataObject",s);return hi(Bi(a,{method:o},n)).pipe(nu((t=>({response:t.data,actionInPayload:e}))),du("Error occurred during ajax call at deleteDataObject Epic",n))},YE=e=>{let t=0,n=[];return e.pipe(eu(ct),pu(100),nu((e=>(({actionMgrID:t}=e.payload),e.payload))),ru((e=>zE(e))),ru((async e=>{if(e&&e.type===Ie){const{payload:r}=e,s=zc({...e,...r,actionMgrID:t});return n.push(s),n}return[]})),nu((()=>(1===n.length&&Ic(n[0].type)?pn.rejectActionByID(t):pn.resolveActionByID(t),Eh(n),n=[],n))))},KE=e=>{const{dataViewID:t,dataViewParameters:n,context:r}=e,s={data_view_ID:t},{restApi:a,reqType:o}=Vg("getDataObjectActions",s);return hi(Bi(a,{method:o,body:{dataViewParameters:n}},r)).pipe(nu((e=>({...e.data}))),du("Error occurred during ajax call at GET data object actions : ",e.context))},XE=e=>{let t=0,n=[];let r={};return e.pipe(eu(ye),pu(100),nu((e=>(({actionMgrID:t}=e.payload),e.payload))),ru((e=>KE(e))),ru((async e=>e&&e.type===Ie?(n.push(zc(e)),n):(r=e,[]))),nu((()=>(1===n.length&&Ic(n[0].type)?pn.rejectActionByID(t):pn.resolveActionByID(t,r),Eh(n),n=[],n))))},JE=[qE,e=>{let t=0,n=[];return e.pipe(eu(it),pu(100),tu((e=>{const{isFormValid:r}=e.payload;if(({actionMgrID:t}=e.payload),!r){const e={type:F.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return pn.rejectActionByID(t,!0,e),iu([])}return iu(e.payload).pipe(ru((e=>hu(e))),ru((async e=>{if(e&&e.type===Ie){const{payload:r}=e,s=zc({...e,...r,actionMgrID:t});return n.push(s),n}const{actionInPayload:r}=e,{containerItemID:s,isModalAction:a}=r,o=a?hd.MODAL:hd.PRIMARY,i={target:yt(o,s),containerItemID:s,context:s};return n.push(Eg(dg,i)),n})),nu((()=>(1===n.length&&Ic(n[0].type)?pn.rejectActionByID(t):pn.resolveActionByID(t),Eh(n),n=[],n))))})))},e=>{let t=0,n=[];return e.pipe(eu(lt),pu(100),nu((e=>(({actionMgrID:t}=e.payload),e.payload))),ru((e=>gu(e))),ru((async e=>{if(e&&e.type===Ie){const{payload:r}=e,s=zc({...e,...r,actionMgrID:t});return n.push(s),n}const{actionInPayload:r,response:s,headers:a={}}=e,{containerName:o}=r,i=yt(o,r.context),c=Kc(i,o,r.context),l={acName:i,context:c};await Gc(s,r,l);const u=Bc(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(Eg(Zh,u)),n})),nu((()=>(1===n.length&&Ic(n[0].type)?pn.rejectActionByID(t):pn.resolveActionByID(t),Eh(n),n=[],n))))},e=>{let t=0,n=[];return e.pipe(eu(ut),pu(100),tu((e=>{const{isFormValid:r}=e.payload;if(({actionMgrID:t}=e.payload),!r){const e={type:F.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return pn.rejectActionByID(t,!0,e),iu([])}return iu(e.payload).pipe(ru((e=>fu(e))),ru((async e=>{if(e&&e.type===Ie){const{payload:r}=e,s=zc({...e,...r,actionMgrID:t});return n.push(s),n}const{actionInPayload:r}=e,{containerItemID:s,isModalAction:a}=r,o=a?hd.MODAL:hd.PRIMARY,i={target:yt(o,s),containerItemID:s,context:s};return n.push(Eg(dg,i)),n})),nu((()=>(1===n.length&&Ic(n[0].type)?pn.rejectActionByID(t):pn.resolveActionByID(t),Eh(n),n=[],n))))})))},YE,XE,e=>{let t=0,n=[];return e.pipe(eu(dt),pu(100),nu((e=>(({actionMgrID:t}=e.payload),e.payload))),ru((e=>mu(e))),ru((async e=>{if(e&&e.type===Ie){const{payload:r}=e,s=zc({...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=yt(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 Gc(s,r,h);const g=Bc(s,p);return n.push(Eg(Zh,g)),n})),nu((()=>(1===n.length&&Ic(n[0].type)?pn.rejectActionByID(t):pn.resolveActionByID(t),Eh(n),n=[],n))))},e=>{let t=0,n=[];return e.pipe(eu(pt),pu(100),tu((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 pn.rejectActionByID(t,!0,e),iu([])}return Xn({context:s,stateObj:Ih(s),clearContextMessages:!0}),iu(e.payload).pipe(ru((e=>yu(e))),ru((async e=>{if(e&&e.type===Ie){const{payload:r}=e,s=zc({...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=yt(o,r.context),d={acName:u,context:r.context};await Gc(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=Bc(n,t);i.resourceType=s||F.RESOURCE_TYPES.DATA;const c=X(o);e.push(Eg(dg,i));const l=Ch(".dataContext","dataInfo",c),u=Ch(".dataContextParameters","dataInfo",c),d={context:c,skipSemanticUrl:!0,resourceType:s,parentAction:pt,dataContext:l,dataContextParameters:u},p=l&&u&&Fg(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})),nu((()=>(1===n.length&&Ic(n[0].type)?pn.rejectActionByID(t):pn.resolveActionByID(t),Eh(n),n=[],n))))})))}],QE=JE;function ZE(e,t){return void 0===t&&(t=PE),oi((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(ii(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:eI,DATA:tI}}=F;let nI=[],rI=!1;const sI={},aI=[e=>e.pipe(eu(Ee),ZE(200),nu((e=>e.payload)),ru((e=>{rI=!1,yi.subscribe(F.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_STARTED,(()=>{rI=!0}));const t=Oi.getPreviewMode()&&xi.addDebugHeaders({debugId:Lh.generateUniqueID()});sI.dataContext=e.payload.dataViewName,sI.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=I()+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(nl(s)){case eI:i={caseTypeID:c.caseTypeID,processID:c.processID,content:{}};break;case tI:i=sI;break;default:i=c}return hi(Bi(o,{method:r,body:i,headers:{...l,...t}},n)).pipe(nu((t=>({response:{...t.data},payload:e,headers:kc(t.headers)}))),du(": Error occurred during ajax call at historyEpic : ",e))}return hi(Bi(o,{method:"GET",headers:{...l,...t}},i.substring(0,i.lastIndexOf("/")))).pipe(nu((n=>({response:n.data,payload:e,headers:{...kc(n.headers),...t}}))),cu((r=>{if(s===Je){const n={messages:[{type:"error",message:r.response.data.errorDetails[0].localizedValue}],category:"PAGE"};ic.setComponentCache("assignments-launchAssignment-Error",n);const s=Rg(Ip()),a=Cp.getEndPointInfo(s.split("/assignments")[0]),o=I()+a.routeEndpoint;return e={...e,routeKey:Be,resetSemanticURL:!0},hi(Bi(o,{method:a.reqType,headers:{...l,...t}},i.substring(0,i.lastIndexOf("/")))).pipe(nu((n=>({response:n.data,headers:{...kc(n.headers),...t},payload:e}))))}return iu(Ig(": Error occurred during ajax call at historyEpic : ",r,n))})))})),ru((async e=>{if(rI)return nI;if(yi.subscribe(F.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_STARTED,(()=>{rI=!0})),e&&e.type===Ie)return zc(e);const{headers:t={},response:n,payload:r}=e,s=Gm(n,{[F.STOPMERGEACTIONS]:!n.nextAssignmentInfo}),a=r.options.acName,o=Ld(a)&&Fd(a)?Rd(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=Fg(Be,{caseName:e.payload.payload.caseName}),l=l&&l.replace("{workID}",e.payload.payload.workID)||"",d=r?.payload?.caseClassName),(r?.routeKey===Je||r?.resetSemanticURL)&&(e=>{const t=Nc(e);let n=Fg(Be,{caseClassName:Sc(e)},{id:t});n=n?.replace("{workID}",String(Cc(t))).replace("{id}",String(Cc(t))),qg({semanticURL:n,directUrlUpdation:!0,options:{}})})(s),((e,t)=>{const n=t?.data?.caseInfo;e===Je&&n?.caseTypeID&&n?.content&&xc(n.caseTypeID)&&(n.content.coexistenceAction=Ge)})(r?.routeKey,s),yi.publish(F.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_INIT,{pageName:u,pageClass:d});const p=Lh.getIn(s,j.LOCALE_REFERENCES);await Rp.loadLocaleResources(p);const h=Lh.getIn(s,j.COMPONENTS);h&&await $r(h),Ur(s,r.options.actionConfig,!0),yi.publish(F.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_DONE,{target:a,pageName:u,pageClass:d});let g=Bc(s,c);return g=((e,t,n)=>{if(e===Fc.CASE||e===Fc.ASSIGNMENT){if(t?.caseInfo?.assignments&&t?.caseInfo?.assignments.length>0){const{key:e,flowName:r}=Hc(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,e===Fc.ASSIGNMENT?(n.caseViewMode=j.PERFORM_MODE,n.resourceType=Fc.CASE):n.caseViewMode=j.REVIEW_MODE}else n.resourceType=e,n.semanticURL=t.semanticURL;return n})(nl(e.payload.routeKey),{...n.data,semanticURL:l,caseViewMode:j.REVIEW_MODE},g),nI.push(Yc(a,g)),((e,t)=>{let n=ic.getComponentCache("assignments-launchAssignment-Error")||{};n&&"object"==typeof n&&Object.keys(n).length>0&&(n={...n,context:e},t.push(Eg(ug,n)),ic.resetComponentCache("assignments-launchAssignment-Error"))})(o,nI),tl(nI),nI})),nu((()=>(rI||Eh(nI),nI=[],rI=!1,nI))),du("Error occurred"))],oI=[e=>{let t=0,n=[];return e.pipe(eu(se),nu((e=>(({actionMgrID:t}=e.payload),e.payload))),ru((e=>{const{context:t,skipSemanticUrl:n=!1,insightID:r}=e;let s,a="";n||(a=Fg(ke,{insightID:"{insightID}"}),a=a.replace("{insightID}",r),s=Cp.getEndPointInfo(a));const{restApi:o,reqType:i}=Vg(ke,{...s?.payload||[],insightID:r});return hi(Bi(o,{method:i},t)).pipe(nu((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}})),du(": Error occurred during ajax call at showPage Epic : ",e.context))})),ru((async e=>{if(e&&e.type===Ie)return n.push(zc(e)),n;const{actionConfig:t,skipSemanticUrl:r}=e,s=pc.getTargetViewContainerName(ne),a=yt(s,t.context),o=Kc(a,s,t.context),{response:i}=e,c=Gm(i);c.directUrlUpdation=!r;const l={acName:a,context:o},u=!r,d=r;await Gc(c,t,l,u,d);const p=Bc(c,{target:a,context:o,containerItemID:o});p.resourceType=F.PAGE;const h=Yc(a,p);return n.push(h),tl(n),n})),nu((()=>{pn.resolveActionByID(t),Eh(n),n=[]})),kE())}],iI=[e=>{let t=0,n=[];return e.pipe(eu(ae),nu((e=>(({actionMgrID:t}=e.payload),e.payload))),ru((e=>{const{context:t,skipSemanticUrl:n=!1,dashboardID:r}=e;let s="";n||(s=Fg($e,{dashboardID:r}),s=s.replace("{dashboardID}",r));const{restApi:a,reqType:o}=Vg($e,{dashboardID:r});return hi(Bi(a,{method:o},t)).pipe(nu((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}})),du(": Error occurred during ajax call at showPage Epic : ",e.context))})),ru((async e=>{if(e&&e.type===Ie)return n.push(zc(e)),n;const{actionConfig:t,skipSemanticUrl:r}=e,s=pc.getTargetViewContainerName(ne),a=yt(s,t.context),o=Kc(a,s,t.context),{response:i}=e,c=Gm(i);c.directUrlUpdation=!r;const l={acName:a,context:o},u=!r,d=r;await Gc(c,t,l,u,d);const p=Bc(c,{target:a,context:o,containerItemID:o});p.resourceType=F.PAGE;const h=Yc(a,p);return n.push(h)})),nu((()=>{pn.resolveActionByID(t),Eh(n),n=[]})),kE())}],cI=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 $m.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}(...Km,...VE,...GE,...aI,...QE,...Jm,...[e=>{let t=0;return e.pipe(eu(et),nu((e=>(({actionMgrID:t}=e.payload),e.payload))),nu((()=>{const e=yh()?.getState(),n=Vm();return h()(e,n)&&t>0?pn.resolveActionByID(t,{}):pn.rejectActionByID(t),[]})),kE())}],...oI,...iI),lI=()=>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)&&(pl(a||o),bn.removeContextTreeNode(a||o)),e(t)},uI={},dI=e=>{const t=Lh.getIn(uI,[j.CONTEXT,e],[]),n=[];t.forEach((t=>{const r=t.substr(0,t.lastIndexOf("_")),s=Lh.getIn(uI,[r,t],[]),a=s&&s.length>0&&s.indexOf(e);if(a>-1&&s.splice(a,1),!s||s&&0===s.length){Lh.deleteIn(uI,[r,t]);const e=Lh.getIn(uI,[r]);e&&0===Object.keys(e).length&&Lh.deleteIn(uI,[r]),n.push({dataPageName:r,dataPageNameWithHash:t})}})),Lh.deleteIn(uI,[j.CONTEXT,e]);const r=Lh.getIn(uI,[j.CONTEXT]);(!r||r&&0===Object.keys(r).length)&&Lh.deleteIn(uI,[j.CONTEXT]),n.length>0&&Eh(_g({dataPagesToBeRemoved:n}))},pI=(e={},t)=>{Object.keys(e).forEach((n=>{const r=Lh.getIn(e,[n],{});Object.keys(r).forEach((e=>{((e,t,n)=>{const r=Lh.getIn(uI,[j.CONTEXT,n]);if(Lh.getIn(uI,[e])){const r=Lh.getIn(uI,[e,t],[]);Lh.setIn(uI,[e,t],[...new Set([...r,n])])}else Lh.setIn(uI,[e,t],[n]);r?Lh.setIn(uI,[j.CONTEXT,n],[...new Set([...r,t])]):Lh.setIn(uI,[j.CONTEXT,n],[t])})(n,e,t)}))}))},hI=()=>e=>t=>{(Array.isArray(t)?t:[t]).forEach((e=>{const{payload:{data:t={},context:n=null,childContainersContexts:r=[]}={},type:s}=e;if(((e,t)=>{t&&t.length>0&&(e===Me||e===Se)&&t.forEach((e=>{dI(e)}))})(s,r),s===Ce||s===fe||s===nt){const e=s===nt?t:t.shared;pI(e,n)}else s===Me?(dI(n),pI(t.shared,n)):s===Se&&dI(n)})),e(t)},gI=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}=Lh.getIn(e.getState(),["containers",s,"items",a])||{},o={resourceType:t,key:n,context:r,containerItemID:a};yi.publish(u.CONTAINER_EVENTS.CLOSE_CONTAINER_ITEM,o),s===`${F.APP.APP}/${j.PRIMARY}`&&l===j.CONTAINER_TYPE.MULTIPLE&&yi.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=>{Bu.cleanCaches(e)})),r!==Me&&r!==Se||Bu.cleanCaches(o),t(n)},fI=()=>e=>t=>{const{payload:{context:n=null,transientItemID:r=null,clearStateMachine:s=!0}={},type:a}=t;n&&(a===Ce||a===xe||a===Me||a===Se)&&s&&(_r(n),Er(n)),r&&a===De&&(_r(r),Er(r)),e(t)},mI=function(e){void 0===e&&(e={});var t,n=new(0,mf.constructor)(mf.schedulerActionCtor),r=new Ef,s=function(s){t=s;var a=new Ef,o=new Ef,i=a.asObservable().pipe(li(n)),c=new _f(o.pipe(li(n)),t.getState());return r.pipe(nu((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})),ru((function(e){return hi(e).pipe(ui(n),li(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}(),yI=e=>{const t=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||cf;if(null!==yh())xh();else{const n=af(km(e),t(Cf.reduxBatch,function(...e){return t=>(n,r)=>{const s=t(n,r);let a=()=>{throw new Error(ef(15))};const o={getState:s.getState,dispatch:(e,...t)=>a(e,...t)},i=e.map((e=>e(o)));return a=cf(...i)(s.dispatch),{...s,dispatch:a}}}(Gl,lI,hI,fI,mI,gI),Cf.reduxBatch));mI.run(cI),mh(n)}},EI={publishConstellationLoadedEvent:()=>{yi.publish(j.PUB_SUB_EVENTS.BOOTSTRAP_SHELL_EVENTS.CONSTELLATION_LOADED,{})}};const II=new class{activateContainerItemOnSwitch(e){const t=`${j.APP.APP}/${j.PRIMARY}`,n={target:t,containerItemID:_d(t,e)};cd({}).getPConnect().getContainerManager().activateContainerItem(n)}removeContainerItemOnClose(e){const t=`${j.APP.APP}/${j.PRIMARY}`,n={target:t,containerItemID:_d(t,e)};cd({}).getPConnect().getContainerManager().removeContainerItem(n)}showCasePreview(e,t){const n=cd({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}),Td(j.APP.APP,j.PREVIEW)||r.initializeContainers({type:"multiple",name:j.PREVIEW}),n.getPConnect().getActionsApi().showCasePreview(e,{caseClassName:t})}closeCasePreview(){cd({}).getPConnect().getContainerManager().resetContainers({name:j.PREVIEW,context:j.APP.APP})}isFormDirty(e){const t=`${j.APP.APP}/${j.PRIMARY}`,n=cp(t,e);return cl.isStateModified(n)}getEventUtils(){return EI}getBroadcastUtils(){return Zm}isTraditionalUICase(e){return xc(e)}};const AI=class{static openCase(e,t=F.APP.APP,n={}){return n.renderInline=!0,n.pageName?Sp.setDefaultCasePage(n.pageName):(Sp.setDefaultCasePage(j.PY_DETAILS),n.pageName=j.PY_DETAILS),n?.disableAssignmentHeader?Sp.disableAssignmentHeader(n.disableAssignmentHeader):Sp.disableAssignmentHeader(!1),Qu.openCase(e,t,j.PRIMARY,n)}static createCase(e,t=F.APP.APP,n={}){return n.renderInline=!0,n.pageName?Sp.setDefaultCasePage(n.pageName):(Sp.setDefaultCasePage(j.PY_DETAILS),n.pageName=j.PY_DETAILS),n?.disableAssignmentHeader?Sp.disableAssignmentHeader(n.disableAssignmentHeader):Sp.disableAssignmentHeader(!1),Qu.createCase(e,t,j.PRIMARY,n)}static getNextWork(e=F.APP.APP,t={}){return t.renderInline=!0,t.pageName?Sp.setDefaultCasePage(t.pageName):(Sp.setDefaultCasePage(j.PY_DETAILS),t.pageName=j.PY_DETAILS),t?.disableAssignmentHeader?Sp.disableAssignmentHeader(t.disableAssignmentHeader):Sp.disableAssignmentHeader(!1),Qu.getNextWork(e,j.PRIMARY,t)}static openAssignment(e,t=F.APP.APP,n={}){return n.renderInline=!0,n.pageName?Sp.setDefaultCasePage(n.pageName):(Sp.setDefaultCasePage(j.PY_DETAILS),n.pageName=j.PY_DETAILS),n?.disableAssignmentHeader?Sp.disableAssignmentHeader(n.disableAssignmentHeader):Sp.disableAssignmentHeader(!1),Qu.openAssignment(e,t,j.PRIMARY,n)}static openPage(e,t,n=F.APP.APP,r={}){const s=ne;r?.defaultCasePage?Sp.setDefaultCasePage(r.defaultCasePage):Sp.setDefaultCasePage(j.PY_DETAILS),r?.disableAssignmentHeader?Sp.disableAssignmentHeader(r.disableAssignmentHeader):Sp.disableAssignmentHeader(!1);const a={viewName:e,className:t,acTargetName:j.PRIMARY,actionMgrID:pn.getNextActionMgrId(),context:n},{promise:o}=pn.actionManagerPromise(s,a.actionMgrID);return Eh({type:s,payload:{...a}}),o}static getCurrentContextAPI(e,t=F.APP.APP){return cd({meta:{config:{}},options:{context:t,pageReference:e,containerName:j.PRIMARY}}).getPConnect()}};const _I=new class{createC11nEnv=e=>cd(e);getContextUtils=()=>e;getRoutingManager=()=>t;getComponentsRegistry=()=>en;getStateManager=()=>l;getActionCreators=()=>u;getStreamObservable=()=>r;getActionProcessor=()=>$h;getActionHandler=()=>kh;renderApp=(e,t)=>{const n={context:j.APP.APP},r={...Lh.getIn(e,j.ROOT),options:n};yI(e),Ur(e,n,!0);const s=this.createC11nEnv({meta:r,isRoot:!0});yi.publish(F.PUB_SUB_EVENTS.EVENT_RENDER_APP,{props:s,domContainerID:t})};updateStoreWithUiRoot=async(e,t,n)=>{const r=Gm(e),{data:s,uiResources:a={}}=e,o=Lh.getIn(a,j.CONTEXT_DATA);await Gc(r,{},{},!1,!0);const i={...s,[j.CONTEXT_DATA]:o},{root:c}=a;qd(c,t,i,n)};fetchEndPointResource=(e,t,n)=>{Bi(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)=>$r(n).then((()=>{const n=this.createC11nEnv({meta:e,isRoot:!0});yh()||yI({}),yi.publish(F.PUB_SUB_EVENTS.EVENT_RENDER_APP,{props:n,domContainerID:t})}));setStaticServerUrl=(e,t,n)=>{jr.initServer(e,t,n)};loadView=async(e,t,n=[])=>{y();const r=Gm(e),s=Lh.getIn(r,j.VIEWS),a=Lh.getIn(r,j.NAVIGATIONS),o=Lh.getIn(r,j.COMPONENTS)||[];o.push(...n);const i=Lh.getIn(r,j.STATIC_SERVER_URL),c=Lh.getIn(r,j.APPLICATION_DATA);s&&zp(s),a&&Yp(a),(e=>{e&&(wg=e.pyLabel)})(c),i&&jr.initServer(i),await $r(o,i).then((()=>this.renderApp(r,t)))};initAppShell=(e,t,n)=>{Qg(e),pc.buildActionTargetMap(t),y(n)};initRoutingTable=(e,t)=>{Qg(e,!0),y(t)};setAppAlias=e=>{jr.setAppAlias(e)};getHomeRestApi=e=>{const{restApi:t}=jg("home",{portalName:e});return I()+t};getViewRestApi=(e,t)=>{const{restApi:n}=((e,t)=>{let n={restApi:""};try{if(Xg()&&!t){const t=Ep(),r=Cp.processUrl(t,!0),s=Cp._getMatchedRouteInRoutingTable(r)||"",a=Cp.getRoutingInfo(),o=Cp.processUrl(t,!1).split("/"),i=o[o.length-1];let{caseID:c}=a&&a.routes[s].payload;c=c.replace("{workID}",i),n=Cp.getRestEndPoint("loadView",{caseID:c,viewID:e})||{}}else n=Cp.getRestEndPoint("showView",{page:e,pageClass:t})||{}}catch(e){}return n})(e,t);return I()+n};loadRootComponent=async(e,t,n=[],r,s,a)=>{const{config:{name:o}={}}=t;yh()||yI({}),a&&(np(`${j.APP.ROOT}/${o}`),tp().deleteContainerItem(`${j.APP.ROOT}/${o}`)),tp().getContainerItems()?.length>1&&!o?.startsWith("hybrid_")&&"authoring-preview"!==o&&xh(),Eh(Hh({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();Rd(`${l}/${u}`)||"noPortal"===t.config?.renderingMode||d.initializeContainers({type:"single"});const p=["RootContainer","Region","ModalViewContainer","PreviewViewContainer","reference",...n];return $r(p).then((()=>{yi.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===I()&&(s=this.getHomeRestApi(t)),this.fetchEndPointResource(s,r)};loadPortalView=(e,t)=>{const n=this.getHomeRestApi(e);this.fetchEndPointResource(n,t,!0)};configureForBrowserBookmark=e=>{Jg(e)};checkIfSemanticURL=()=>Xg();onPCoreReady=e=>{yi.subscribe(F.PUB_SUB_EVENTS.EVENT_RENDER_APP,e,"renderAppCallback")};onPCoreCleanup=e=>{yi.subscribe(F.PUB_SUB_EVENTS.EVENT_UNMOUNT_APP,e,"unmountAppCallback")};setFieldsDefaultConfigs=e=>{xr.updateFieldDefaults(e)};setGoogleMapsAPIKey=e=>{_(e)};setFetchDefaultHeaders=e=>{zi(e)};setFetchAuthInfo=e=>{Yi(e)};getCaseApi=()=>Qu;getMashupApi=()=>AI;enableAppRouting=e=>{Lg(e)};initStore=()=>yI({});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=cd({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 CI=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 SI=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 CI(e.serviceConfig),this.behaviorOverrides=e.behaviorOverrides,this.initBroadcast=!!e.initBroadcast,this.cookieComplianceMethod=e.cookieComplianceMethod??"none",this.isExtraCallRequiredForDefaultHome=e.isExtraCallRequiredForDefaultHome??"false"}},TI=async()=>{const e=Sp.getLocale(),t=Sp.getFeatureMap().localizationVersion||1;let n;if("en-US"!==e)try{let r;2===t?r=[e]:(r=[Rp.GENERIC_BUNDLE_KEY,Rp.MESSAGE_BUNDLE_KEY,Rp.FIELD_LABELS_BUNDLE_KEY,...Rp.getCaseTypeLocaleReferences()],n=await Rp.isCurrentLocalePackAvailable());const s=r.map((async r=>{2===t?await(async e=>{const t=Sp.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 ec("getLocalizationPack",{queryPayload:n});if((201===r.status||200===r.status)&&r.data){const e=r.data;Object.keys(e).forEach((t=>{Rp.setLocaleForRule(e[t],t)}))}})(r):n&&await(async(e,t)=>{const n=await jr.getSvcLocale(t,`${e}.json`);if(n?.ok&&e){const t=await n.json();Rp.setLocaleForRule(t,e)}})(r,e)}));await Promise.allSettled(s)}catch(e){console.warn(e)}},NI="@P .viewConfig";let RI=0;const PI=new class{#f(e,t,n){Qg(e),pc.buildActionTargetMap(t),y(n)}init(e){const t=new SI(e),n={...t.environmentInfo,renderingMode:t.renderingMode};Lg(t.enableRouting),yI({}),Sp.setTheme(t.theme),Sp.setCookieComplianceMethod(t.cookieComplianceMethod),Sp.setIsExtraCallRequiredForDefaultHome(t.isExtraCallRequiredForDefaultHome),xr.updateFieldDefaults(t.fieldDefaults),xi.setDefaultHeaders(t.additionalHeaders),this.#f(t.routingInfo,t.actionModel,{server:t.restServerConfig,reAuthUrl:t.serviceConfig.reAuthUrl}),jr.setAppAlias(t.serviceConfig.appAliasWithoutServlet||t.serviceConfig.appAlias),_(t.serviceConfig.googleMapKey),jr.initServer(t.serviceConfig.staticContentServer,t.serviceConfig.appStaticContentServer,t.tokens.C11NB2S),Rp.setTimezone(t.timezone),Sp.setEnvironmentInfo(n),Sp.setLocale(t.locale),$.setRemoteCaseMapping(t.remoteCaseMapping),Du.setConnectionConfig({messagingService:t.serviceConfig.messagingService}),ic.init(),t.initBroadcast&&II.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=cd({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 _I.getComponentsRegistry().getComponent("ReactRoot").modules.forEach((t=>{e.push(t())})),Promise.allSettled(e)};importDesignSystemComponentMap=async(e,t,n)=>{try{await function(e,t="true"){return new Promise(((n,r)=>{const s=document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("src",e),s.setAttribute("async",t),s.onload=n(),s.onerror=()=>r(new Error("Failed to load resource from Design System")),document.body.appendChild(s)}))}(`${e}component/project/${t}/designsystems/${n}/componentsmap.js?v=${Date.now()}`)}catch(e){console.log(e)}};buildSemanticUrl=(e,t,n,r,s)=>{const a=new URLSearchParams(t);let o=!1;"true"===n&&(o=!0);let i=null,c=null,l=null;if(e){e.startsWith("/")&&(e=e.substring(1));const t=e.split("/");i=t[0],t.length>1&&t[1]&&(c=t[1]),t.length>1&&"assignments"===t[2]&&t[3]&&(l=t[3])}else o=!1;let u=r;i&&(u=`${u}/${i}`),c&&(u=`${u}/${c}`),l&&(u=`${u}/assignments/${l}`),o&&(a.has("noPortal")||a.append("noPortal","true"),c&&s&&a.append("view",s));const d=a.toString();return u+=d?`?${d}`:"",u};initCoreConfig=e=>{const{routingInfo:t,serviceConfig:n,semanticUrl:r,queryParams:s,noPortal:a,noHistory:o,viewName:i,theme:c,restServerConfig:l,dynamicLoadComponents:u=!0,dynamicSemanticUrl:d=!0,renderingMode:p="FULL_PORTAL",envType:h,extras:g}=e,{appAlias:f,contextPath:m}=n;let y=window.location.origin;const E={};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)),E.dynamicSemanticUrl=!1}else console.log(`renderingMode :${p}`);!0!==u&&(E.dynamicLoadComponents=!1);let I=null;if(f){const e=f.indexOf("/app/");I=e>=0?f.substring(e+1):f}if(Object.keys(E).length>0&&window.PCore.setBehaviorOverrides(E),e.appAlias=I,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"===Sp.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)=>{RI+=1;const c=i||`mashup${RI}`,l={type:"RootContainer",config:{viewConfig:NI,renderingMode:"view",name:c}};_I.loadRootComponent(e,l,s,a,o).then((()=>_I.loadViewByName(t,n,r,c)))};launchView=(e,t,n=[],r,s,a,o)=>{RI+=1;const i="hybrid"===o?`hybrid_${RI}`:o;RI+=1;const c=i||`mashup${RI}`,l={type:"RootContainer",config:{viewConfig:NI,renderingMode:"portal",name:c}};o===j.HYBRID&&Wu.setRuntimeParam(j.HYBRID_ROOT_CONTAINERNAME,c),Wu.setRuntimeParams(r),_I.loadRootComponent(e,l,n,s,a).then((()=>_I.updateStoreWithUiRoot(t,c)))};launchPortal=(e,t,n,r=[])=>{RI+=1;const s=n||`portal${RI}`,a={type:"RootContainer",config:{viewConfig:NI,renderingMode:"portal",skeleton:"LoadingComponent",name:s}};r.push(a.config.skeleton),Sp.isPortalLoaded=!0,_I.loadRootComponent(e,a,r).then((()=>_I.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)}}_I.loadRootComponent(e,n,[PCore.getConstants().LOAD_VIEW_STRING,"ViewContainer"]),window.parent!==window&&s(754)(`${window.PCore.getAssetLoader().getStaticServerUrl()}constellation-mashup-bridge.js`).then((e=>{e.mashup.init({resizing:"stretch"})}))};start=async(e,t)=>{const{appStaticContentServer:n}=e.serviceConfig,{ccV2LibId:r,environmentId:s,isAlternateDesignSystemEnabled:a,alternateDesignSystemName:o}=e;this.initCoreConfig(e);const i=async()=>(await this.importReactRoot(),r&&await jr.importCustomComponentMap(r),"true"===a&&"other"!==o&&await this.importDesignSystemComponentMap(n,s,o),t&&t(),!0);return new Promise(((e,t)=>{TI().then((async()=>{const t=_I.getComponentsRegistry();"ReactRoot"in t.getLazyMap()?e(!0):t.getComponent("ReactRoot")?e(await i()):yi.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")}},DI={createViewRule:(e,t)=>{const{restApi:n,reqType:r}=Vg("createViewRuleByID");return Bi(n,{method:r,body:e},t).then((e=>e.data))},getViewRule:(e,t)=>{const{restApi:n,reqType:r}=Vg("getViewRuleByID",{ID:e});return Bi(n,{method:r},t).then((e=>e.data))},updateViewRule:(e,t,n)=>{const{restApi:r,reqType:s}=Vg("updateViewRuleByID",{ID:e});return Bi(r,{method:s,body:t},n).then((e=>e.data))},deleteViewRule:(e,t)=>{const{restApi:n,reqType:r}=Vg("deleteViewRuleByID",{ID:e});return Bi(n,{method:r},t).then((e=>e.data))}},bI={"Content-Type":"application/json"},OI={addCaseFollower:(e,t,n)=>{const r={caseID:e},s=JSON.stringify({users:t.map((e=>({ID:e})))});return ec("addCaseFollower",{body:s,queryPayload:r,headers:bI},n)},deleteCaseFollower:(e,t,n)=>ec("deleteCaseFollower",{queryPayload:{caseID:e,followerID:t}},n),getCaseFollowers:(e,t)=>ec("getCaseFollowers",{queryPayload:{caseID:e}},t).then((e=>e.data.followers))},vI={addRelatedCases:(e,t,n)=>{const r={caseID:e},s=JSON.stringify({cases:t});return ec("addRelatedCases",{body:s,queryPayload:r},n)},removeRelatedCase:(e,t,n)=>ec("removeRelatedCase",{queryPayload:{caseID:e,relatedCaseID:t}},n),getRelatedCases:(e,t)=>ec("getRelatedCases",{queryPayload:{caseID:e}},t).then((e=>e.data.relatedCases))},xI="operatorDetails",wI={getOperatorDetails:(e,t=!1)=>{const{reqType:n}=Vg(xI,{});if("GET"===n){const t={encodedOperatorId:encodeURIComponent(`{"opname":"${e}"}`)};return ec(xI,{queryPayload:t})}return t?ec("operatorDetailsByBusinessID",{body:{dataViewParameters:{BusinessID:e}}}):ec(xI,{body:{dataViewParameters:{ID:e}}})}},MI=async e=>{const t=Gm(e),n=Lh.getIn(t,j.COMPONENTS);Ur(t,{},!0);const r=Lh.getIn(t,j.LOCALE_REFERENCES);await Rp.loadLocaleResources(r||[]),await $r(n)},LI=(e,t,n)=>Vh.resolveView(e,t,n),UI={"Content-Type":"application/json"};const FI=new class{constructor(){this.mentionsTagsCancelTokenSource=[],this.mentions=[]}getFeeds=(e,t,n,r,s,a,o)=>{const{getLocaleValue:i}=Rp;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=rc();return s.push(d),ec("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 MI({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=>{sc(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 ec("postFeedMessages",{body:a,headers:UI},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 ec("editFeedMessage",{queryPayload:{messageID:e},body:a,headers:UI},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});ec(a,{body:o,queryPayload:{pulseContext:e},headers:UI},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);ec("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)=>ec("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=rc();return this.mentionsTagsCancelTokenSource.push(i),ec("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=>{sc(e)||t.reportError(": Error occurred during ajax call at getMentionSuggestions API : ",e.response.data)}))};getMentionTypes=e=>ec("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=rc();return this.mentionsTagsCancelTokenSource.push(a),ec("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=>{sc(e)||t.reportError(": Error occurred during ajax call at getTagSuggestions API : ",e.response.data)}))}},jI={getTaggedCases:(e,t)=>ec("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)=>ec("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 ec("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)=>ec("deleteCaseTag",{queryPayload:{caseID:e,tagID:t}},n.getContextName()).catch((e=>{n.reportError(": Error occurred during ajax call at removeTag API : ",e.response)})),getTagsLandingPageURL:e=>Ou.getPageDataAsync("D_pxGetTagsLandingPageURL",e.getContextName(),{},{invalidateCache:!0}).catch((t=>{e.reportError(": Error occurred during ajax call getTagsLandingPageURL API : ",t.response)}))},VI=(e,t)=>{rp(t.getContextName(),e.etag),sp(t.getContextName(),e.etag)},kI={getParticipants:(e,t)=>ec("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)=>ec("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)=>ec("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)=>ec("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)=>{ec("createParticipant",{body:a,queryPayload:s,headers:o},r.getContextName()).then((t=>{VI(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)=>{ec("updateParticipant",{body:n,queryPayload:s,headers:a},r.getContextName()).then((t=>{VI(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)=>{ec("deleteParticipant",{queryPayload:r,headers:s},n.getContextName()).then((t=>{VI(t.headers,n),e()})).catch((e=>{n.reportError(": Error occurred during ajax call at deleteParticipant API : ",e.response),t(e.response)}))}))}};function $I(e=[]){return e.reduce(((e,t)=>(e[t.personalizationID]={name:t.name,personalizationState:JSON.parse(t.personalizationState||"{}")},e)),{})}const BI="create",GI="update",WI="delete";function HI(e,t,n,r){const s=eh(t);if(s){switch(e){case BI:case GI:{const{markAsDefault:e,...t}=r;Object.entries(t).length>0&&(s.allPersonalizations[n]=t),e&&(s.defaultPersonalization=n);break}case WI:delete s.allPersonalizations[n],s.defaultPersonalization===n&&(s.defaultPersonalization="");break;default:return null}return s}return null}const qI={},zI=e=>{const t=eh(e);if(t)return Array.isArray(t.allPersonalizations)&&(t.allPersonalizations=$I(t.allPersonalizations)),Promise.resolve(t);const{restApi:n,reqType:r}=Vg("getUIListPersonalizations",{listID:e});return Bi(n,{method:r,body:{}}).then((e=>{const{data:t}=e;return{allPersonalizations:$I(t.allPersonalizations),defaultPersonalization:t.defaultPersonalization}}))},YI=(e,t,n)=>{const{restApi:r,reqType:s}=Vg("createListPersonalization",{listID:e});return HI(BI,e,t,n),Bi(r,{method:s,body:{...n,personalizationState:JSON.stringify(n.personalizationState)}}).then((e=>{const n=e.data;return qI[t]=n,e}))},KI=(e,t,n)=>{const r=qI[t]||t;HI(GI,e,t,n);const{restApi:s,reqType:a}=Vg("updateListPersonalization",{listID:e,personalizationID:r})||{};return Bi(s,{method:a,body:{...n,personalizationState:JSON.stringify(n.personalizationState)}})},XI=(e,t)=>{const n=qI[t]||t;HI(WI,e,t);const{restApi:r,reqType:s}=Vg("deleteListPersonalization",{listID:e,personalizationID:n});return Bi(r,{method:s,body:{}}).then((e=>(qI[t]&&delete qI[t],e)))};const JI=function(e){return e?{createPersonalization:YI.bind(null,e),updatePersonalization:KI.bind(null,e),deletePersonalization:XI.bind(null,e),fetchPersonalizations:zI.bind(null,e)}:{createPersonalization:()=>Promise.resolve(""),updatePersonalization:()=>Promise.resolve(),deletePersonalization:()=>Promise.resolve(),fetchPersonalizations:()=>Promise.resolve({})}},QI="getDataObjects",ZI="getInsightByID",eA=["LocalList","RemoteList","PromptList","DataPage"];let tA=null;const nA={},rA=e=>Au.getAppCacheKey(`PrimaryFields-${e}`);function sA(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 aA={getDataObjects:function(){const e=Au.getAppCacheKey(QI);if(window.sessionStorage.getItem(e))return Promise.resolve(JSON.parse(window.sessionStorage.getItem(e)));const{restApi:t,reqType:n}=Vg(QI,{}),r=Bi(t,{method:n});return r.then((t=>{window.sessionStorage.setItem(e,JSON.stringify(t))})),r},getDataPageObjects:function(e=!0){if(tA)return tA;const t=Au.getAppCacheKey("getDataPageObjects");if(e&&window.sessionStorage.getItem(t))return Promise.resolve(JSON.parse(window.sessionStorage.getItem(t)));const{restApi:n,reqType:r}=Vg("getDataPages",{datapageRequestType:"explorable"});return tA=Bi(n,{method:r,datapageRequestType:"explorable"}),tA.then((e=>{tA=null,window.sessionStorage.setItem(t,JSON.stringify(e))})),tA},getDataViewMetadata:function(e,t,n){if(!t){const{sourceMetadata:t,sourceFields:n}=function(e){const t=Zp(e);if(t&&t.classID){let e=nh(t.classID);const n=new Set(t.primaryFields),r=t.rdFields?.fields?.filter((e=>e.indexOf(".")>0));if(r&&!Lh.isEmpty(r)){const n=r.reduce(((e,n)=>{const r=qp(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&&eA.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:sA(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 $u.init(r).then((({dataSourceMetaData:e})=>Promise.resolve({data:e})))},getDefaultColumns:function(e){const t=Au.getAppCacheKey(`DefaultColumns_${Object.values(e).join("_")}`);if(window.sessionStorage.getItem(t))return Promise.resolve(JSON.parse(window.sessionStorage.getItem(t)));const{restApi:n,reqType:r}=Vg("getListData",{dataViewName:"D_pzGetDefaultColumns"}),s=Bi(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=Zp(e),n=Array.isArray(t?.rdFields)?t?.rdFields:t?.rdFields?.fields;return n?Promise.resolve({data:{data:n.map((e=>({pyFieldName:e})))}}):Promise.resolve({data:{data:[]}})}const r=Au.getAppCacheKey(`RDColumns-${e}`);if(window.sessionStorage.getItem(r))return Promise.resolve(JSON.parse(window.sessionStorage.getItem(r)));const s=Au.getData("D_pxFieldsForDataSource",{dataViewParameters:{DataPageName:e}},n);return s.then((e=>{window.sessionStorage.setItem(r,JSON.stringify(e))})),s},getPrimaryFieldsForDataSource:function(e="",t=""){const n=Au.getAppCacheKey(`PFColumns-${e}${t}`);if(window.sessionStorage.getItem(n))return Promise.resolve(JSON.parse(window.sessionStorage.getItem(n)));const r=Au.getData("D_pxGetInitialFieldsForDataSource",{dataViewParameters:{DataPageName:e,ClassName:t}});return r.then((e=>{window.sessionStorage.setItem(n,JSON.stringify(e))})),r},getPrimaryFieldsForInsights:async function(e,t,n){const{allClasses:r,promisesToAwait:s,classesToFetch:a,isTopLevelClassPresent:o,joinedClassesToFetch:i}=function(e,t){const n=[],r=[];let s=!1;const a=[],o=[];return e&&o.push(e),t&&t.length>0&&o.push(...t),o.forEach((t=>{const o=rA(t);window.sessionStorage.getItem(o)||(nA[t]?r.push(nA[t]):(n.push(t),t===e?s=!0:a.push(t)))})),{allClasses:o,promisesToAwait:r,classesToFetch:n,isTopLevelClassPresent:s,joinedClassesToFetch:a}}(e,n);return a.length&&s.push((async(e,t,n,r)=>{const s=Au.getData("D_pxGetPrimaryFieldsForInsights",{dataViewParameters:{...t&&{topLevelClassID:t},...r&&{joinedClassIDs:r.join(",")},...n&&{topLevelDataPageID:n}}}).then((t=>{const n=t.data?.data||[],r={};e.forEach((e=>{r[e]=[]})),n.forEach((({classID:e,pyFieldName:t})=>{r[e].push(t)})),Object.entries(r).forEach((([e,t])=>{const n=rA(e);window.sessionStorage.setItem(n,JSON.stringify(t))}))})).finally((()=>{e.forEach((e=>{delete nA[e]}))}));return e.forEach((e=>{nA[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=rA(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}=Vg("getInsightIDs");return Bi(e,{method:t})},getInsightByID:function(e){const t=th(e);if(t)return Promise.resolve({data:{pyInsights:[t]}});const n={insightID:e},{restApi:r,reqType:s}=Vg(ZI,n);return Bi(r,{method:s})},getInsightsByID:function(e){const t={insightID:e.join(",")},{restApi:n,reqType:r}=Vg(ZI,t);return Bi(n,{method:r})},createInsight:function(e){const{restApi:t,reqType:n}=Vg("createInsight");return Bi(t,{method:n,body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})},updateInsight:function(e,t){const n={insightID:e},{restApi:r,reqType:s}=Vg("updateInsight",n),a=t.UpdateDateTime;return Bi(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}=Vg("deleteInsight",t);return Bi(n,{method:r})},exportToExcel:function(e){const{restApi:t,reqType:n}=Vg("exportToExcel");return Bi(t,{method:n,body:JSON.stringify(e)})},exportToCSV:function(e){const{restApi:t,reqType:n}=Vg("exportToCSV");return Bi(t,{method:n,body:JSON.stringify(e)})},scheduleInsight:(e,t)=>{const n={insightID:e},{restApi:r,reqType:s}=Vg("scheduleInsight",n);return Bi(r,{method:s,body:JSON.stringify(t)})},updateScheduledInsight:(e,t,n)=>{const r={insightID:e,scheduleID:t},{restApi:s,reqType:a}=Vg("updateScheduledInsight",r);return Bi(s,{method:a,body:JSON.stringify(n)})},deleteScheduledInsight:(e,t)=>{const n={insightID:e,scheduleID:t},{restApi:r,reqType:s}=Vg("deleteScheduledInsight",n);return Bi(r,{method:s})},translateStrings:function(e){const{restApi:t,reqType:n}=Vg("translateStrings");return Bi(t,{method:n,body:JSON.stringify(e)})}};const oA=new class{addRoutes=e=>{return t=e,void Cp.addRoutes(t);var t}};const iA=class{static registerModule(e,t,n){n[e]=()=>t}};const cA=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);static getBulkProcessEvent=()=>Object.freeze(F.PUB_SUB_EVENTS.EVENT_BULKACTION);static getLocalActionProcessEvent=()=>Object.freeze(F.PUB_SUB_EVENTS.EVENT_LOCALACTION_SUBMISSION)},lA={getResolvedSemanticURL:(e,t,n)=>Cp.getResolvedSemanticURL(e,t,n),getActions:()=>({ACTION_OPENWORKBYHANDLE:Be,ACTION_SHOWDATA:Ve,ACTION_SHOWVIEW:je}),updateSemanticURLAndDocumentTitle:e=>Cp.updateSemanticURLAndDocumentTitle(e)};const uA=new class{constructor(){this.genericFailedMessage="Failed to display content. Contact the application administrator."}getGenericFailedMessage(){return this.genericFailedMessage}setGenericFailedMessage(e){this.genericFailedMessage=e}},dA={setTokens:e=>{Yi({tokenInfo:e}),zi(e?.csrf&&!e?.access_token?{pzCTkn:e?.csrf}:{Authorization:`${e?.token_type} ${e?.access_token}`}),setTimeout((()=>yi.publish("updateSession",{updateStatus:"success"})),0)},revokeTokens:async()=>Ai(),getAuthInstance:e=>Ii.init(e),setAuthorizationHeader:e=>{zi({Authorization:e}),setTimeout((()=>yi.publish("updateSession",{updateStatus:"success"})),0)}};const pA=new class{getDebouncedSubject(e){return(new Ef).pipe(ZE(e))}};Mr.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=Rp.getLocaleValue("Enter a valid email address","Messages")),t})),Mr.register("integer",(e=>{let t=null;return e&&!/^(-)?\d+$/.test(e)&&(t=Rp.getLocaleValue("Invalid number","Messages")),t})),Mr.register("required",(e=>Array.isArray(e)&&0===e.length||null==e||""===e?Rp.getLocaleValue("Cannot be blank","Messages"):null)),Mr.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=Rp.getLocaleValue("Enter a valid url","Messages")),t})),setTimeout((()=>{const e=Rp.getLocaleValue("Enter a valid phone number","Messages");s.e(654).then(s.bind(s,654)).then((({parsePhoneNumberFromString:t})=>{Mr.register("phone",(n=>{let r=null;n&&!/^\+?\d+$/.test(n)&&(r=e);const s=n?.startsWith("+");if(n&&s){const s=t(n);s?.isPossible()&&n===s?.number||(r=e)}return r}))}))}),j.PRIORITY.TRIVIAL);const hA=(e,t)=>{switch(t){case"invalid":return Rp.getLocaleValue(`Incorrect ${e}`,"Messages");case"incomplete":return Rp.getLocaleValue(`Incomplete ${e}`,"Messages");default:return null}};Mr.register("datetime",(e=>hA("DateTime",e))),Mr.register("date",(e=>hA("Date",e))),Mr.register("time",(e=>hA("Time",e))),Mr.register("attachment",((e,t)=>(Ch(`.attachmentsList${t.pageReference?.replace("caseInfo.content","")}${t.property}`,"context_data",t.context)||[]).some((e=>e.props?.error))?Rp.getLocaleValue("Error with one or more files"):null));const gA={createConversation:(e,t,n,r=[])=>{for(const e of r)e?.cancel&&"function"==typeof e.cancel&&e.cancel();const s=rc();r.push(s);const a={assistantID:t},o=JSON.stringify({contextID:e});return ec("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 ec("sendMessage",{body:a,queryPayload:s},r)}};const fA=class{caseTypeAccessMap=new Map;constructor(){this.caseTypeAccessMap=Sp.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 mA{constructor(){mA.behaviorOverrides={}}static behaviorOverrides={};getPCoreVersion=()=>"24.2.4";onPCoreReady=e=>_I.onPCoreReady(e);onPCoreCleanup=e=>_I.onPCoreCleanup(e);getComponentsRegistry=()=>_I.getComponentsRegistry();checkIfSemanticURL=()=>_I.checkIfSemanticURL();isValidSemanticURL=()=>(()=>{if(Xg()){const e=Cp.processUrl(Ep(),!0);return!!Cp._getMatchedRouteInRoutingTable(e)}return!1})();getRoutingUtils=()=>oA;getViewResources=()=>d;configureForBrowserBookmark=e=>_I.configureForBrowserBookmark(e);getStore=()=>yh();resetStore=()=>xh();getMessageManager=()=>nr;getCoexistenceManager=()=>II;getStoreValue=(e,t,n)=>Ch(e,t,n);getContainerUtils=()=>i;getAnnotationUtils=()=>Tl;getFieldUtils=()=>Gn;getFieldDefaultUtils=()=>xr;getAssetLoader=()=>jr;getAttachmentUtils=()=>wp;getViewRuleApi=()=>DI;getFeedUtils=()=>FI;getTagUtils=()=>jI;getGenAIAssistantUtils=()=>gA;getStakeholderUtils=()=>kI;getUserApi=()=>wI;getCaseFollowerApi=()=>OI;getCaseUtils=()=>Uc;getStateUtils=()=>uc;getRelatedCasesApi=()=>vI;getPersonalizationUtils=JI;getDataApi=()=>$u;getDataApiUtils=()=>Au;getAnalyticsUtils=()=>aA;getLocaleUtils=()=>Rp;registerLocaleManager=e=>{const t=this.getLocaleUtils();Object.keys(e).forEach((n=>{t[n]=e[n]}))};setBehaviorOverrides=e=>{mA.behaviorOverrides=e};setBehaviorOverride=(e,t)=>{mA.behaviorOverrides[e]=t};getBehaviorOverrides=()=>mA.behaviorOverrides;getBehaviorOverride=e=>mA.behaviorOverrides[e];getAsynchronousUtils=()=>pA;createPConnect=e=>cd(e);getPubSubUtils=()=>yi;registerComponentCreator=e=>{ld(e)};getConstants=()=>Object.freeze(F);getEvents=()=>cA;getRestClient=()=>o;getMashupApi=()=>AI;getEnvironmentInfo=()=>Sp;getRuntimeParamsAPI=()=>Wu;getSemanticUrlUtils=()=>lA;getRemoteCaseUtils=()=>$;getNavigationUtils=()=>ic;registerModule=(e,t)=>iA.registerModule(e,t,this);getErrorHandler=()=>uA;getFormUtils=()=>cl;getMessagingServiceManager=()=>Du;getMetadataUtils=()=>c;getDataPageUtils=()=>Ou;getDataTypeUtils=()=>Jl;getCascadeManager=()=>hh;isDeepEqual=(e,t)=>h()(e,t);getAuthUtils=()=>dA;getDebugger=()=>Oi;getDeferLoadManager=()=>Eu;getExpressionEngine=()=>n;getActionsSequencer=()=>Qt;getRefreshManager=()=>Pl;getInitialiser=()=>PI;getAllStateMachines=(e,t,n)=>t&&n?ll.getAllStateMachines(e,t,n):ll.getAllStateMachinesByContext(e);getBootstrapUtils=()=>_I;getContextTreeManager=()=>bn;getAccessPrivilege=()=>fA.getInstance()}const yA=new mA;s.g.PCore=yA})()})();
2
2
  //# sourceMappingURL=constellation-core-web.js.map